Subject: [PATCH] Built motion from commit 2bba9b4.|0.0.70

From: Daniele Cinti <[email-masked]>
Date: Wed, 23 Mar 2016 16:04:19 +0100

---
 public/app/3d92426c.app.js                         |   51 ++++++++++++++
 public/app/7f4f3cd9.app.js                         |   51 --------------
 public/index.html                                  |    2 +-
 release-notes/changelog_0.0.70.txt                 |    2 +-
 server/api/mail_message/mail_message.controller.js |   69 ++++++++------------
 server/api/update/update.controller.js             |    2 +-
 6 files changed, 81 insertions(+), 96 deletions(-)
 create mode 100644 public/app/3d92426c.app.js
 delete mode 100644 public/app/7f4f3cd9.app.js

diff --git a/public/app/3d92426c.app.js b/public/app/3d92426c.app.js
new file mode 100644
index 0000000..2029d15
--- /dev/null
+++ b/public/app/3d92426c.app.js
@@ -0,0 +1,51 @@
+"use strict";angular.module("xCallyShuttleApp",["adf","adf.structures.base","adf.widget.clock","adf.widget.iframe","adf.widget.counter","adf.widget.pie-chart","angular-md5","angular.filter","angularFileUpload","btford.socket-io","chart.js","checklist-model","colorpicker.module","frapontillo.bootstrap-switch","infinite-scroll","LocalStorageModule","mgo-angular-wizard","ng-slide-down","ngAnimate","ngBootstrap","ngCookies","ngCsv","ngFileSaver","ngJsTree","ngMap","ngPapaParse","ngResource","ngSanitize","notification","oc.lazyLoad","pascalprecht.translate","pdf","remoteValidation","smart-table","sprintf","textAngular","timer","toastr","permission","ui-notification","ui.bootstrap.modal","ui.bootstrap.dropdown","ui.bootstrap.popover","ui.bootstrap.timepicker","ui.bootstrap.tooltip","ui.bootstrap.tpls","ui.bootstrap.accordion","ui.bootstrap.progressbar","ui.bootstrap.typeahead","ui.grid","ui.grid.autoResize","ui.grid.draggable-rows","ui.grid.exporter","ui.grid.grouping","ui.grid.moveColumns","ui.grid.pagination","ui.grid.treeView","ui.grid.selection","ui.grid.exporter","ui.grid.resizeColumns","ui.router","ui.navbar","ui.select","ui.sortable","xeditable","ngAudio","truncate","ngScrollbars","ngEmoticons","angularSpinner","builder","builder.components","validator","angular-clipboard","ng-code-mirror","angularMoment"]).config(["$stateProvider","$urlRouterProvider","$locationProvider","$httpProvider","$translateProvider","localStorageServiceProvider","dashboardProvider","ScrollBarsProvider",function(a,b,c,d,e,f,g,h){b.otherwise("/dashboard/voice"),e.useStaticFilesLoader({prefix:"assets/languages/locale-",suffix:".json"}),e.preferredLanguage("en_EN"),e.useLocalStorage(),e.useSanitizeValueStrategy("sanitize"),c.html5Mode(!0),d.interceptors.push("authInterceptor"),g.structure("4-4-4",{rows:[{columns:[{styleClass:"col-md-4"},{styleClass:"col-md-4"},{styleClass:"col-md-4"}]}]}).structure("3-3-3-3",{rows:[{columns:[{styleClass:"col-md-3"},{styleClass:"col-md-3"},{styleClass:"col-md-3"},{styleClass:"col-md-3"}]}]}),f.setPrefix("xcally"),h.defaults={scrollButtons:{scrollAmount:"auto",enable:!0},axis:"y"}}]).factory("settings",["$rootScope","$interval","License","localStorageService",function(a,b,c,d){return a.settings={patternName:"[A-Za-z0-9._]+",layout:{pageSidebarClosed:d.get("sidebarClosed")||!1,pageQuickSidebarOpened:!1,pageBodySolid:!1,pageAutoScrollOnLoad:1e3}},c.get(function(b){b.license&&(a.license=b.license,a.soundPath=b.soundPath)}),a.settings}]).factory("authInterceptor",["$rootScope","$q","$cookieStore",function(a,b,c){return{request:function(a){return a.headers=a.headers||{},c.get("token")&&(a.headers.Authorization="Bearer "+c.get("token")),a}}}]).run(["$rootScope","$location","$state","$stateParams","$window","$q","$http","Auth","RoleStore","editableThemes","editableOptions",function(a,b,c,d,e,f,g,h,i,j,k){g.get("/api/settings/1").success(function(b){a.license=b.license}).error(function(a){console.error(a)}),a.$state=c,a.$stateParams=d,j.bs3.inputClass="input-sm",j.bs3.buttonsClass="btn-xs",k.theme="bs3",a.online=navigator.onLine,e.addEventListener("offline",function(){a.$apply(function(){a.online=!1})},!1),e.addEventListener("online",function(){a.$apply(function(){a.online=!0})},!1),a.$on("$stateChangeStart",function(a,c){h.isLoggedInAsync(function(a){c.authenticate&&!a&&b.path("/login")})}),a.updateTableConfig=function(a,b){var c=_.find(a,{name:"All"});c&&(c.value=b)},i.defineRole("admin",[],function(){return h.isAdmin()})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.analytics",{url:"/analytics",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").factory("Extracted",["$resource",function(a){return a("/api/analytics/extracted/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.analytics.extracted",{url:"/extracted",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("AnalyticExtractedListCtrl",["$scope","$translate","gridOptions","Extracted",function(a,b,c,d){a.moment=moment,a.Extracted=d,a.initView=function(){var b={exporterCsvFilename:"ExtractedReports.csv",columnDefs:[{name:"name"},{name:"startDate",displayName:"APPLICATION_START_DATE"},{name:"endDate",displayName:"APPLICATION_END_DATE"},{name:"createdAt",displayName:"APPLICATION_RUN_DATE"},{name:"startDate",displayName:"APPLICATION_START_DATE"},{name:"output"},{name:"status"},{name:"action",width:140,buttons:[{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"},{directive:"<motion-file-download data-ng-show=\"row.entity.status == 'completed'\" resource=\"grid.appScope.Extracted\" params=\"{id:row.entity.id,controller:'download'}\" mimetype=\"'application/'+row.entity.output.toLowerCase()\" filename=\"row.entity.name+'_'+grid.appScope.moment(row.entity.startDate).format('MM-DD-YYYY').toString()+'_'+grid.appScope.moment(row.entity.endDate).format('MM-DD-YYYY').toString()+'.'+row.entity.output.toLowerCase()\"></motion-file-download>"}]}]};a.gridOptions=c.gridOptions(d,b,a,{order:"createdAt DESC"})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.analytics.extracted.list",{url:"/list",templateUrl:"app/analytic/extracted/list/list.html",controller:"AnalyticExtractedListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").controller("AnalyticMetricListCreateModalCtrl",["$scope","$uibModalInstance",function(a,b){a.forms={dashboard:void 0},a.item={},a.tables=[{name:"Agent Report",value:"report_agent_history"},{name:"Mail Report",value:"report_mail_session_history"},{name:"Queue Report",value:"report_queue_history"},{name:"Integration Report",value:"report_integration_history"},{name:"Chat Report",value:"report_chat_session_history"}],a.ok=function(){a.item.model=JSON.stringify({title:a.item.name}),b.close(a.item)},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("AnalyticMetricListCtrl",["$scope","xAlert","Modal","$uibModal","$log","gridOptions","Metric","$translate",function(a,b,c,d,e,f,g,h){a.$translate=h,a.initView=function(){var b={exporterCsvFilename:"Metrics.csv",columnDefs:[{name:"name"},{name:"table",cellTemplate:"<div style=\"padding:5px\">{{'APPLICATION_'+row.entity.table.toUpperCase() | translate}}</div>"},{name:"description"},{name:"action",width:125,buttons:[{"class":"{{row.entity.defaultEntry ? 'blue-hoki disabled' : 'blue-hoki'}}",href:"/analytics/metrics/view/{{row.entity.id}}/settings",name:"settings"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=f.gridOptions(g,b,a)},a.create=function(){var c=d.open({animation:!0,templateUrl:"app/analytic/metric/list/create.modal.html",controller:"AnalyticMetricListCreateModalCtrl"});c.result.then(function(c){return g.save(c).$promise.then(function(){a.gridOptions.getPage(),b.show(h.instant("MESSAGE_WELL_DONE")+"!","success")})["catch"](function(a){b.show(a.data.message,"danger")})},function(){e.info("Modal dismissed at: "+new Date)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.analytics.metrics.list",{url:"/list",templateUrl:"app/analytic/metric/list/list.html",controller:"AnalyticMetricListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").factory("Metric",["$resource",function(a){return a("/api/analytics/metrics/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.analytics.metrics",{url:"/metrics",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("AnalyticMetricViewCtrl",["$scope","xAlert","$translate","$stateParams","$location","Metric",function(a,b,c,d,e,f){a.tables=[{name:"Agent Report",value:"report_agent_history"},{name:"Mail Report",value:"report_mail_session_history"},{name:"Queue Report",value:"report_queue_history"},{name:"Integration Report",value:"report_integration_history"},{name:"Chat Report",value:"report_chat_session_history"}],a.getMetric=function(){return f.get({id:d.id}).$promise.then(function(b){a.metric=b})["catch"](function(a){e.path("/analytics/metrics/list")})},a.updateMetric=function(){return f.update({id:d.id},a.metric).$promise.then(function(){b.show(c.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){b.show(a.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.analytics.metrics.view",{url:"/view/:id",templateUrl:"app/analytic/metric/view/view.html",controller:"AnalyticMetricViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.analytics.metrics.view.settings",{url:"/settings",templateUrl:"app/analytic/metric/view/view.settings.html"})}]),angular.module("xCallyShuttleApp").factory("customReport",["$resource",function(a){return a("/api/analytics/reports/custom/:id/:controller/:action",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").factory("defaultReport",["$resource",function(a){return a("/api/analytics/reports/default/:id/:controller/:action",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").controller("ReportListCopyModalCtrl",["$scope","$uibModalInstance","$log","customTreeData",function(a,b,c,d){a.customTreeData=d,a.forms={dashboard:void 0},a.item={},a.customTreeConfig={multiple:!1,animation:!0,core:{error:function(a){c.error("treeCtrl: error from js tree - "+angular.toJson(a))},check_callback:!0}},a.ac=function(){return!0},a.initCustomScopeTree=function(){a.customTree=a.customTreeInstance.jstree(!0),a.customTree.deselect_all(),a.customTree.open_all()},a.ok=function(){b.close({parent:a.customTree.get_selected(!0).pop().id})},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("ReportListCreateModalCtrl",["$scope","$uibModalInstance","path",function(a,b,c){a.path=c,a.forms={dashboard:void 0},a.item={},a.ok=function(){a.item.model=JSON.stringify({title:a.item.name}),b.close(a.item)},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("ReportListExtractModalCtrl",["$scope","$uibModalInstance",function(a,b){a.dates={startDate:moment().subtract(1,"days").startOf("day"),endDate:moment().subtract(1,"days").endOf("day")},a.ranges={Yesterday:[moment().subtract(1,"days").startOf("day"),moment().subtract(1,"days").endOf("day")],"Last 7 days":[moment().subtract(7,"days"),moment()],"Last 30 days":[moment().subtract(30,"days"),moment()],"This month":[moment().startOf("month"),moment().endOf("month")]},a.extract=function(c){var d={startDate:a.dates.startDate.toISOString(),endDate:a.dates.endDate.toISOString(),output:c};b.close(d)},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("AnalyticReportListCtrl",["$scope","xAlert","$translate","$location","$log","Modal","$uibModal","FileSaver","Blob","gridOptions","customReport","defaultReport","reportTree",function(a,b,c,d,e,f,g,h,i,j,k,l,m){function n(){var b,c={},d=a.defaultTree.get_selected(),e=a.customTree.get_selected();if(d.length)b=d.pop(),a.selectedNode=a.defaultTree.get_path(b," / "),c={parent:b},a.gridOptions=j.gridOptions(l,o,a,c,!0),a.gridOptions.getPage();else{if(!e.length)return;b=e.pop(),a.selectedNode=a.customTree.get_path(b," / "),c={parent:b},a.gridOptions=j.gridOptions(k,o,a,c,!0),a.gridOptions.getPage()}}var o={exporterCsvFilename:"reports.csv",columnDefs:[{name:"name"},{name:"description"},{name:"manage",width:120,buttons:[{"class":"blue-hoki",href:"/analytics/reports/view/{{row.entity.id}}/settings",icon:"icon-settings",title:c.instant("APPLICATION_SETTINGS")},{"class":"red-sunglo",icon:"fa fa-trash-o",title:c.instant("APPLICATION_DELETE"),onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"},{"class":"green",icon:"fa fa-files-o",title:c.instant("APPLICATION_COPY"),onClick:"grid.appScope.copy(row.entity.id)"},{"class":"purple",icon:"fa fa-download",title:c.instant("APPLICATION_EXPORT"),onClick:"grid.appScope.export(row.entity.id)"}]},{name:"actions",buttons:[{"class":"yellow",name:"preview",onClick:"grid.appScope.preview(row.entity.id)"},{"class":"green-turquoise",name:"run",onClick:"grid.appScope.extract(row.entity.id)"}]}]};a.searchField="",a.ac=function(){return!0},a.initDefaultScopeTree=function(){a.defaultTree=a.defaultTreeInstance.jstree(!0),a.defaultTree.deselect_all(),a.defaultTree.close_all(),a.defaultTree.open_node({id:1}),a.defaultTreeReady=!0,a.defaultTreeActive=!0,a.previousDefaultNode=""},a.initCustomScopeTree=function(){a.customTree=a.customTreeInstance.jstree(!0),a.customTree.deselect_all(),a.customTree.close_all(),a.customTree.open_node({id:1}),a.customTreeReady=!0,a.previousCustomNode=""},a.$watchGroup(["defaultTreeReady","customTreeReady"],function(b,c,d){b[0]&&b[1]&&a.defaultTree.select_node({id:"1"})}),a.updateCustomTree=function(){var d={tree:angular.toJson(a.customTree.get_json("#",{flat:!0}))};return m.update({id:2},d).$promise.then(function(a){console.log("Custom Tree Updated")})["catch"](function(a){b.show(c.instant(a.message),"danger")})},a.configTrees=function(){a.defaultTreeConfig={multiple:!1,animation:!0,core:{error:function(a){e.error("treeCtrl: error from js tree - "+angular.toJson(a))},check_callback:!0,themes:{name:"default",url:"../../../assets/css/jstree-metronic/style.css"}},plugins:["search"]},a.customTreeConfig={multiple:!1,animation:!0,core:{error:function(a){e.error("treeCtrl: error from js tree - "+angular.toJson(a))},check_callback:!0,themes:{name:"default",url:"../../../assets/css/jstree-metronic/style.css"}},plugins:["contextmenu","dnd","search"],contextmenu:{items:function(b,d){var e={create:{label:c.instant("APPLICATION_CREATE"),action:function(c){a.customTree.create_node(b),a.customTree.open_node(b)}},rename:{label:c.instant("APPLICATION_RENAME"),action:function(c){a.customTree.edit(b)}},remove:{label:c.instant("APPLICATION_REMOVE"),action:function(c){console.log(b),a.deleteNode(b.text,b)}}};return"#"===b.parent&&(delete e.rename,delete e.remove),d(e),e}}}},a.deleteNode=f.confirm["delete"](function(b){a.customTree.delete_node(b),a.previousCustomNode==b.id&&a.customTree.select_node({id:b.parent})}),a.searchTrees=function(){a.defaultTree.search(a.searchField),a.customTree.search(a.searchField)},a.selectDefaultNode=function(){if(a.customTreeReady){a.previousCustomNode="";var b=a.defaultTree.get_selected(!0),c=b.pop();if(a.defaultTree.deselect_node(b[0],!0),a.customTree.deselect_all(),a.defaultTree.select_node(c,!0),c.id===a.previousDefaultNode)return void console.log("def");a.previousDefaultNode=c.id,a.defaultTreeActive=!0,n()}},a.selectCustomNode=function(){if(a.defaultTreeReady){a.previousDefaultNode="";var b=a.customTree.get_selected(!0),c=b.pop();if(a.customTree.deselect_node(b[0],!0),a.defaultTree.deselect_all(),a.customTree.select_node(c,!0),c.id===a.previousCustomNode)return void console.log("cus");a.previousCustomNode=c.id,a.defaultTreeActive=!1,n()}},a.getTrees=function(){return m.query().$promise.then(function(b){a.defaultTreeData=JSON.parse(b[0].tree),a.customTreeData=JSON.parse(b[1].tree),a.configTrees()})["catch"](function(a){b.show(c.instant(a.message),"danger")})},a.create=function(){var c=g.open({animation:!0,templateUrl:"app/analytic/report/list/create.modal.html",controller:"ReportListCreateModalCtrl",resolve:{path:function(){return a.selectedNode}}});c.result.then(function(c){return c.parent=a.previousCustomNode,k.save(c).$promise.then(function(a){d.path("/analytics/reports/view/"+a.id+"/settings")})["catch"](function(a){b.show(a.message,"danger")})},function(){e.info("Modal dismissed at: "+new Date)})},a.copy=function(d){var f=a.defaultTreeActive?l:k,h=g.open({animation:!0,templateUrl:"app/analytic/report/list/copy.modal.html",controller:"ReportListCopyModalCtrl",resolve:{customTreeData:function(){return a.customTreeData}}});h.result.then(function(e){return f.save({id:d,controller:"copy"},e).$promise.then(function(){a.gridOptions.getPage(),b.show(c.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){b.show(a.message,"danger")})},function(){e.info("Modal dismissed at: "+new Date)})},a["export"]=function(c){var d=a.defaultTreeActive?l:k;return d.get({id:c}).$promise.then(function(a){delete a.id,delete a.createdAt,delete a.updatedAt,delete a.deletedAt,_.forEach(a.Fields,function(a){delete a.id,delete a.CustomReportId,a.Metric&&(delete a.Metric.id,a.Metric.name+="_"+_.random(9999))});var b=new i([angular.toJson(a)],{type:"application/json;charset=utf-8"});h.saveAs(b,a.name+".json")})["catch"](function(a){console.error(data),b.show(a.message,"danger")})},a["import"]=function(d){var e=JSON.parse(d);e.parent=a.previousCustomNode;var f=e.name&&e.parent?!0:!1,g=!0;return _.forEach(e.Fields,function(a){a.field&&a.alias||(g=!1)}),f&&g?k.save({controller:"import"},e).$promise.then(function(){a.gridOptions.getPage(),b.show(c.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){b.show(a.message,"danger")}):void b.show(c.instant("MESSAGE_INVALID_JSON"),"danger")},a.preview=function(b){g.open({animation:!0,templateUrl:"app/analytic/report/list/preview.modal.html",controller:"ReportListPreviewModalCtrl",size:"full",resolve:{report:function(){return{id:b,tree:a.defaultTreeActive?"default":"custom"}}}})},a.extract=function(d){var f=g.open({animation:!0,templateUrl:"app/analytic/report/list/extract.modal.html",controller:"ReportListExtractModalCtrl",size:"md",resolve:{report:function(){return{id:d,tree:a.defaultTreeActive?"default":"custom"}}}});f.result.then(function(e){var f=a.defaultTreeActive?l:k;return f.get({id:d,controller:"extract",action:e.output,startDate:e.startDate,endDate:e.endDate}).$promise.then(function(){b.show(c.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){b.show(a.message,"danger")})},function(){e.info("Modal dismissed at: "+new Date)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.analytics.reports.list",{url:"/list",templateUrl:"app/analytic/report/list/list.html",controller:"AnalyticReportListCtrl"})}]),angular.module("xCallyShuttleApp").controller("ReportListPreviewModalCtrl",["$scope","$uibModalInstance","report","xAlert","$translate","$timeout","customReport","defaultReport",function(a,b,c,d,e,f,g,h){a.forms={dashboard:void 0},a.dates={startDate:moment().subtract(1,"days").startOf("day"),endDate:moment().subtract(1,"days").endOf("day")},a.ranges={Yesterday:[moment().subtract(1,"days").startOf("day"),moment().subtract(1,"days").endOf("day")],"Last 7 days":[moment().subtract(7,"days"),moment()],"Last 30 days":[moment().subtract(30,"days"),moment()],"This month":[moment().startOf("month"),moment().endOf("month")]};var i={pageNumber:1,pageSize:25,sort:null,where:{},order:{}};a.gridOptions={paginationPageSizes:[10,25,50],paginationPageSize:25,useExternalPagination:!0,enableSorting:!1,enableFiltering:!0,useExternalFiltering:!0,enableGrouping:!1,enableColumnMenus:!1,treeRowHeaderAlwaysVisible:!1,gridMenuShowHideColumns:!1,enableGridMenu:!1,onRegisterApi:function(b){a.gridApi=b,b.pagination.on.paginationChanged(a,function(b,c){i.offset=(b-1)*c,i.limit=c,a.getPage()}),b.core.on.filterChanged(a,function(){var b=this.grid,c={};b.columns.forEach(function(a){console.log(a),a.filters[0].term&&(c[a.field]=a.filters[0].term)}),i.where=c,a.getPage()})}},a.getPage=function(){var b={params:{offset:i.offset,limit:i.limit,startDate:a.dates.startDate.toISOString(),endDate:a.dates.endDate.toISOString()}};_.forOwn(i.where,function(a,c){b.params[c]=a}),console.log(b);var f="custom"===c.tree?g:h;return f.get({id:c.id,controller:"preview"},b).$promise.then(function(b){a.gridOptions.totalItems=b.count,a.gridOptions.paginationPageSizes[3]=b.count,a.gridOptions.data=b.rows,a.showResult=!0})["catch"](function(a){d.show(e.instant(a.message),"danger")})},a.cancel=function(){b.dismiss("cancel")},f(function(){a.getPage()})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.analytics.reports",{url:"/reports",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").factory("reportTree",["$resource",function(a){return a("/api/analytics/reports/trees/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").controller("AnalyticReportViewCtrl",["$scope","$http","xAlert","$translate","$stateParams","$location",function(a,b,c,d,e,f){function g(e){var f=_.find(a.tables,{table:e}).url;b.get(f).success(function(b){a.tableFields=_.map(b,function(a,b){return{name:b,value:b}})}).error(function(a){c.show(d.instant(a.message),"danger")})}function h(e){console.log(e),b.get("/api/analytics/metrics/table",{params:{table:e}}).success(function(b){_.forEach(b,function(b){a.tableFields.push({name:"<strong>Metric.</strong>"+b.name,value:b.metric,MetricId:b.id})})}).error(function(a){c.show(d.instant(a.message),"danger")})}function i(a){return String(a).replace(/</g,"&lt;").replace(/>/g,"&gt;")}function j(a){if(!a)return"";for(var b="(",c=0;c<a.rules.length;c++)c>0&&(b+=" <strong>"+a.operator+"</strong> "),b+=a.rules[c].group?j(a.rules[c].group):a.rules[c].field+" "+i(a.rules[c].condition)+" '"+("like"===a.rules[c].condition?"%"+a.rules[c].value+"%":a.rules[c].value)+"'";return b+")"}a.$translate=d,a.tempReport={},a.tables=[{name:"Agent Report",table:"report_agent_history",url:"/api/report/agents/describe"},{name:"Mail Report",table:"report_mail_session_history",url:"/api/report/mail/sessions/describe"},{name:"Queue Report",table:"report_queue_history",url:"/api/report/queues/describe"},{name:"Chat Report",table:"report_chat_session_history",url:"/api/report/chat/sessions/describe"}];var k={group:{operator:"AND",rules:[]}};a.getReport=function(){a.firstLoad=!0,b.get("/api/analytics/reports/custom/"+e.id).success(function(b){a.report=b,_.forEach(a.report.Fields,function(a){delete a.id}),a.report.conditions=a.report.conditions?JSON.parse(a.report.conditions):_.clone(k,!0),a.getPreview(a.report.Fields.length)}).error(function(a){console.error(a),f.path("/analytics/reports/list")})},a.randomName=function(a,b){var c=[];for(a=a||5,b=b||"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";--a;)c.push(b.charAt(Math.floor(Math.random()*b.length)));return c.join("")},a.$watch("report.table",function(b,c){console.log(b),b&&(console.log("is newvalue"),g(b),h(b),c&&(console.log("is oldvalue"),a.tempReport[c]={conditions:a.report.conditions,fields:a.report.Fields}),a.firstLoad?a.firstLoad=!1:a.tempReport[b]?(a.report.Fields=a.tempReport[b].fields,a.report.conditions=a.tempReport[b].conditions):(a.report.Fields=[],a.report.conditions=_.clone(k,!0)))},!0),a.setMetricId=function(b,c){a.report.Fields[c].MetricId=b.MetricId?b.MetricId:null},a.groupByField=[{name:"APPLICATION_YES",value:!0},{name:"APPLICATION_NO",value:!1}],a.functions=[{name:"Sum",value:"SUM"},{name:"Count",value:"COUNT"},{name:"Count Distinct",value:"COUNT DISTINCT"},{name:"Maximum",value:"MAX"},{name:"Minimum",value:"MIN"},{name:"Average",value:"AVG"},{name:"Group Concat",value:"GROUP_CONCAT"},{name:"Group Concat(asc)",value:"GROUP_CONCAT ASC"},{name:"Group Concat(desc)",value:"GROUP_CONCAT DESC"}],a.addField=function(){a.report.Fields.push({groupBy:!1})},a.removeField=function(b){a.report.Fields.splice(b,1)},a.sortableOptions={"ui-floating":!0,cancel:".unsortable",handle:".report-field-handle",axis:"y"},a.updateReport=function(){if(a.report.Fields.length){var f=angular.copy(a.report);f.conditions=angular.toJson(f.conditions),b.put("/api/analytics/reports/custom/"+e.id,f).success(function(){c.show(d.instant("MESSAGE_WELL_DONE")+"!","success"),a.getPreview(!0)}).error(function(b){c.show(d.instant(b.message),"danger"),f.conditions=JSON.parse(f.conditions),a.report=f})}else c.show(d.instant("MESSAGE_SELECT_A_FIELD"),"danger")},a.$watch("report.conditions",function(b){a.output=b?j(b.group):"()"},!0),a.gridOptions={enableFiltering:!0,treeRowHeaderAlwaysVisible:!1,enableGridMenu:!0},a.getPreview=function(f){b.get("/api/analytics/reports/custom/"+e.id+"/preview/",{params:{limit:20}}).success(function(b){a.gridOptions.data=b.rows}).error(function(a){f&&c.show(d.instant(a.message||"MESSAGE_QUERY_NOT_VALID"),"warning")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.analytics.reports.view",{url:"/view/:id",templateUrl:"app/analytic/report/view/view.html",controller:"AnalyticReportViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.analytics.reports.view.settings",{url:"/settings",templateUrl:"app/analytic/report/view/view.settings.html"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels",{url:"/channels",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat",{url:"/chat",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").factory("ChatEnquiry",["$resource",function(a){return a("/api/chat/enquiries/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").factory("ChatMessage",["$resource",function(a){return a("/api/chat/messages/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").factory("ChatReport",["$resource",function(a){return a("/api/report/chats/:id/:controller1/:controller2",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").factory("ChatRoom",["$resource",function(a){return a("/api/chat/rooms/:id/:controller",{id:"@id"},{me:{method:"GET",isArray:!0,params:{id:"me"}},users:{method:"GET",params:{id:"users"}},externals:{method:"GET",isArray:!0,params:{id:"type",controller:"external"}},groups:{method:"GET",isArray:!0,params:{id:"groups"}},update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").factory("ChatVisitor",["$resource",function(a){return a("/api/chat/visitors/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").controller("ChatOfflineListCtrl",["$scope","ChatVisitor","gridOptions",function(a,b,c){a.initView=function(){var d={exporterCsvFilename:"chat_offline_messages.csv",columnDefs:[{name:"fullname",cellClass:"text-center"},{name:"email",cellClass:"text-center"},{name:"ChatWebsite.name",displayName:"Website",cellClass:"text-center"},{name:"createdAt",displayName:"createdAt",cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div><span am-time-ago="row.entity.createdAt"></span></div>'},{name:"action",width:100,buttons:[{"class":"blue-hoki",href:"/channels/chat/offline/view/{{row.entity.id}}/detail",name:"detail"}]}]};a.gridOptions=c.gridOptions(b,d,a,{origin:"enquiry"})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.offline.list",{url:"/list",templateUrl:"app/channels/chat/offline/list/list.html",controller:"ChatOfflineListCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.offline",{url:"/offline",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("ChatOfflineViewCtrl",["$scope","$stateParams","ChatVisitor",function(a,b,c){a.initView=function(){return c.get({id:b.id}).$promise.then(function(b){a.chatVisitor=b})["catch"](function(a){console.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.offline.view",{url:"/view/:id",templateUrl:"app/channels/chat/offline/view/view.html",controller:"ChatOfflineViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.channels.chat.offline.view.detail",{url:"/detail",templateUrl:"app/channels/chat/offline/view/view.detail.html",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/css/news.css"]}])}]}})}]),angular.module("xCallyShuttleApp").controller("ChatOnlineListCtrl",["$scope","ChatRoom","gridOptions",function(a,b,c){a.initView=function(){var d={exporterCsvFilename:"chat_online_messages.csv",columnDefs:[{name:"ChatVisitor.fullname",displayName:"APPLICATION_FULLNAME",cellClass:"text-center"},{name:"ChatVisitor.email",displayName:"APPLICATION_EMAIL",cellClass:"text-center"},{name:"action",width:100,buttons:[{"class":"blue-hoki",href:"/channels/chat/online/view/{{row.entity.id}}/detail",name:"detail"}]}]};a.gridOptions=c.gridOptions(b,d,a,{type:"external"})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.online.list",{url:"/list",templateUrl:"app/channels/chat/online/list/list.html",controller:"ChatOnlineListCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.online",{url:"/online",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("ChatOnlineViewCtrl",["$scope","$stateParams","ChatRoom",function(a,b,c){a.initView=function(){return a.config={autoHideScrollbar:!1,theme:"light",advanced:{updateOnContentResize:!0},setHeight:400,scrollInertia:0},c.get({id:b.id}).$promise.then(function(b){a.chatRoom=b})["catch"](function(a){console.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.online.view",{url:"/view/:id",templateUrl:"app/channels/chat/online/view/view.html",controller:"ChatOnlineViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.channels.chat.online.view.detail",{url:"/detail",templateUrl:"app/channels/chat/online/view/view.detail.html",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/css/news.css"]}])}]}})}]),angular.module("xCallyShuttleApp").controller("PreviewCtrl",["$scope",function(a){a.message="Hello"}]),angular.module("xCallyShuttleApp").directive("preview",function(){return{templateUrl:"app/channels/chat/preview/preview.html",restrict:"EA",link:function(a,b,c){}}}),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("preview",{url:"/preview",templateUrl:"app/channels/chat/preview/preview.html",controller:"PreviewCtrl"})}]),angular.module("xCallyShuttleApp").factory("ChatQueue",["$resource",function(a){return a("/api/chat/queues/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").controller("ChatQueueListCtrl",["$scope","ChatQueue","gridOptions","$uibModal",function(a,b,c,d){a.initView=function(){var d={exporterCsvFilename:"chat_queues.csv",columnDefs:[{name:"name"},{name:"description"},{name:"strategy"},{name:"timeout"},{name:"action",width:125,buttons:[{"class":"blue-hoki",href:"/channels/chat/queues/view/{{row.entity.id}}/settings",
+name:"profile"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=c.gridOptions(b,d,a)},a.createItem=function(){var b=d.open({animation:!0,templateUrl:"app/channels/mail/queue/list/list.create.modal.html",controller:"ChatQueueListCreateCtrl"});b.result.then(function(){a.gridOptions.getPage()})}}]),angular.module("xCallyShuttleApp").controller("ChatQueueListCreateCtrl",["$scope","$uibModalInstance","$translate","xAlert","ChatQueue",function(a,b,c,d,e){a.form={},a.item={},a.save=function(){return e.save(a.item).$promise.then(function(a){d.show(c.instant("MESSAGE_WELL_DONE"),"success"),b.close(a)})["catch"](function(a){d.show(a.data.message,"danger")})},a.cancel=function(){b.dismiss()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.queues.list",{url:"/list",templateUrl:"app/channels/chat/queue/list/list.html",controller:"ChatQueueListCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.queues",{url:"/queues",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("ChatQueueViewCtrl",["$scope","$http","xAlert","$translate","$stateParams","ChatQueue","Team",function(a,b,c,d,e,f,g){var h=function(){return{select:function(b){return f.save({id:a.queue.id,controller:"agents"},{agents:b,penalty:a.queue.penalty}).$promise.then(function(){a.getTeams()})["catch"](function(a){console.log(a)})},deselect:function(b){return f["delete"]({id:a.queue.id,controller:"agents",agents:b}).$promise.then(function(){a.getTeams()})["catch"](function(a){console.log(a)})}}};a.getQueue=function(){b.get("/api/chat/queues/"+e.id).success(function(b){b.penalty=0,a.queue=b}).error(function(a){console.error(a)})},a.updateChatQueue=function(){var f=angular.copy(a.queue);b.put("/api/chat/queues/"+e.id,f).success(function(){c.show(d.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(b){a.queue=f,b.errors.forEach(function(a){c.show(a.message,"danger")})})},a.getTeams=function(){return g.get().$promise.then(function(b){return a.teams=b.rows,f.query({id:e.id,controller:"agents"}).$promise}).then(function(b){ComponentsDropdowns.bindChatQueue(a.teams,_.map(b,function(a){return{id:a.id,penalty:a.UserHasChatQueue.penalty}}),h)})["catch"](function(a){console.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.queues.view",{url:"/view/:id",templateUrl:"app/channels/chat/queue/view/view.html",controller:"ChatQueueViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.channels.chat.queues.view.settings",{url:"/settings",templateUrl:"app/channels/chat/queue/view/view.settings.html"}).state("main.channels.chat.queues.view.agents",{url:"/agents",templateUrl:"app/channels/chat/queue/view/view.agents.html",cache:!1,serie:!0,resolve:{deps:["$ocLazyLoad",function(a){return a.load({insertBefore:"#ng_load_plugins_before",files:["assets/plugins/jquery-multi-select/css/multi-select.css","assets/plugins/jquery-multi-select/js/jquery.multi-select.js","assets/plugins/jquery-quicksearch/jquery.quicksearch.js","assets/scripts/components-dropdowns.js"]})}]}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.realtime",{url:"/realtime",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("ChatRealtimeViewAgentCtrl",["$scope","$log","$uibModal","$translate","socket","xAlert","Agent","Pause","Action","ChatQueue","usSpinnerService","$q","uiGridConstants",function(a,b,c,d,e,f,g,h,i,j,k,l,m){function n(){return k.spin("spinner-grid"),g.get(s).$promise.then(function(b){a.gridOptions.totalItems=b.count,a.gridOptions.data=[],b.rows.forEach(function(a){p(a)})})["catch"](function(a){f.show(a.message,"danger")})["finally"](function(){k.stop("spinner-grid")})}function o(){e.socket.on("agent:save",function(b){var c=_.find(a.gridOptions.data,{agentId:b.id,isAgent:!0});if(c){var d=a.gridOptions.data.indexOf(c);a.gridOptions.data[d].online=b.online,a.gridOptions.data[d].lastLoginAt=b.lastLoginAt,a.gridOptions.data[d].pause=b.chatPause,a.gridOptions.data[d].pauseType=b.pauseType,a.gridOptions.data[d].lastPauseAt=b.lastPauseAt,a.gridOptions.data[d].ipaddr=b.ipaddr,a.gridOptions.data[d].port=b.port,a.gridOptions.data[d].fullcontact=b.fullcontact,a.gridOptions.data[d].useragent=b.useragent,a.gridOptions.data[d].lastms=b.lastms,a.gridOptions.data[d].internal=b.internal,_.map(a.gridOptions.data,function(a){a.isAgent||a.agentId!==b.id||(a.online=b.online)})}}),e.socket.on("agent:remove",function(b){_.remove(a.gridOptions.data,{agentId:b.id})}),e.socket.on("user_has_chat_queue:save",function(b){console.log("new queue",b);var c=_.find(a.gridOptions.data,{agentId:b.UserId,isAgent:!0}),d=a.gridOptions.data.indexOf(c);a.gridOptions.data.splice(d+1,0,{isAgent:!1,agentId:b.UserId,queue:b.queue,queueId:b.ChatQueueId,agent:b.membername,online:c.online})}),e.socket.on("user_has_chat_queue:remove",function(b){_.remove(a.gridOptions.data,{agentId:b.UserId,queueId:b.ChatQueueId})})}function p(b){a.gridOptions.data.push({isAgent:!0,agentId:b.id,agent:b.name,online:b.online,lastLoginAt:b.lastLoginAt,lastPauseAt:b.lastPauseAt,pause:b.chatPause,pauseType:b.pauseType,ipaddr:b.ipaddr,port:b.port,fullcontact:b.fullcontact,useragent:b.useragent,lastms:b.lastms,internal:b.internal,$$treeLevel:0}),b.ChatQueues.forEach(function(c){a.gridOptions.data.push({isAgent:!1,agentId:b.id,queue:c.name,queueId:c.id,agent:b.name,online:b.online})})}function q(){return h.get().$promise.then(function(b){a.pauses=b.rows,e.syncUpdates("pause",a.pauses)})["catch"](function(a){f.show(a.message,"danger")})}function r(){return j.get().$promise.then(function(b){a.chatQueues=b.rows,e.syncUpdates("chat_queue",a.chatQueues)})["catch"](function(a){f.show(a.message,"danger")})}a.chatQueues=[];var s={offset:0,limit:10};a.moment=moment,a.initAgents=function(){a.gridOptions={enableGridMenu:!0,headerCellFilter:"translate",enableHorizontalScrollbar:0,enableVerticalScrollbar:0,enableFiltering:!0,showGridFooter:!0,paginationPageSizes:[10,25,50,75],paginationPageSize:10,useExternalPagination:!0,useExternalSorting:!0,useExternalFiltering:!0,multiSelect:!0,showTreeExpandNoChildren:!0,columnDefs:[{name:"name",displayName:"APPLICATION_AGENT",headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div data-ng-if="row.entity.isAgent">{{row.entity.agent}} &lt;{{row.entity.internal}}&gt;</div>'},{name:"online",displayName:"APPLICATION_ONLINE",width:150,headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div data-ng-if="row.entity.online != null && row.entity.isAgent"><i class="icon-user" data-ng-class="row.entity.online ? \'font-green\' : \'font-red\'"></i> <span data-ng-if="row.entity.online" class="left-margin">(<timer start-time="grid.appScope.moment(row.entity.lastLoginAt).unix()*1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>)</span></div>',filter:{type:m.filter.SELECT,selectOptions:[{value:"true",label:"ONLINE"},{value:"false",label:"OFFLINE"}]}},{name:"chatPause",width:300,displayName:"APPLICATION_PAUSE",headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div data-ng-if="row.entity.pause != null && row.entity.online" class="ui-grid-vcenter" data-ng-class="{\'paused-agent\':row.entity.pause}"><timer data-ng-if="row.entity.pause" start-time="grid.appScope.moment(row.entity.lastPauseAt).unix()*1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer></span><span data-ng-if="row.entity.pause" class="left-margin">({{row.entity.pauseType}})</span><i data-ng-if="row.entity.pause" data-ng-click="grid.appScope.pause(row.entity.agentId,\'unpause\')" class="icon-control-play font-green pointer-cursor left-margin" title="{{\'APPLICATION_RESUME\' | translate}}"></i><i class="icon-control-pause font-yellow pointer-cursor" data-ng-click="grid.appScope.pause(row.entity.agentId,\'pause\',\'DEFAULT PAUSE\')" title="{{\'APPLICATION_DEFAULT_PAUSE\' | translate}}"></i><select data-ng-if="grid.appScope.pauses.length" class="pause-select pointer-cursor" data-ng-model="grid.appScope.pauseType" data-ng-change="grid.appScope.pause(row.entity.agentId,\'pause\',grid.appScope.pauseType)"><option class="pointer-cursor" data-ng-repeat="pause in grid.appScope.pauses">{{pause.name}}</option></select></div>',filter:{type:m.filter.SELECT,selectOptions:[{value:"true",label:"PAUSED"},{value:"false",label:"NOT PAUSED"}]},enableSorting:!1,enableColumnMenu:!1},{name:"queue",displayName:"APPLICATION_QUEUE",headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",enableSorting:!1,enableFiltering:!1,enableColumnMenu:!1},{name:"action",displayName:"",width:170,cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div><button data-ng-if="row.entity.queueId" class="btn btn-xs red-sunglo" data-ng-click="grid.appScope.leaveQueue(row.entity.agentId,row.entity.queueId)"><i class="icon-ban"></i> {{\'APPLICATION_LEAVE\' | translate}}</button><button data-ng-if="row.entity.isAgent && row.treeNode.children.length < grid.appScope.chatQueues.length" class="btn btn-xs blue-hoki" data-ng-click="grid.appScope.joinQueue(row.entity.agentId)"><i class="icon-plus"></i> {{\'APPLICATION_JOIN_QUEUE\' | translate}}</button> <button data-ng-if="row.entity.isAgent" class="btn btn-xs blue-madison" data-ng-click="grid.appScope.showInfo(row.entity)"><i class="icon-info"></i> {{\'APPLICATION_INFO\' | translate}}</button><div>',enableSorting:!1,enableFiltering:!1,enableColumnMenu:!1}],data:[],gridMenuTitleFilter:function(a){var b=l.defer();return b.resolve(d.instant(a)),b.promise},onRegisterApi:function(b){a.gridApi=b,a.gridApi.grid.registerDataChangeCallback(function(){t(a.gridApi.core.getVisibleRows(a.gridApi.grid).length)}),a.gridApi.treeBase.on.rowExpanded(a,function(b){t(a.gridApi.core.getVisibleRows(a.gridApi.grid).length+b.treeNode.children.length)}),a.gridApi.treeBase.on.rowCollapsed(a,function(b){t(a.gridApi.core.getVisibleRows(a.gridApi.grid).length-b.treeNode.children.length)}),a.gridApi.core.on.sortChanged(a,function(a,b){0===b.length?s.order=null:s.order=b[0].name+" "+b[0].sort.direction.toUpperCase(),n()}),a.gridApi.pagination.on.paginationChanged(a,function(a,b){s.offset=(a-1)*b,s.limit=b,n()}),a.gridApi.core.on.filterChanged(a,function(){var a=this.grid;a.columns.forEach(function(a){a.filters[0].term?s[a.name]=a.filters[0].term:delete s[a.name]}),n()})}},n(),q(),r(),o()};var t=function(a){var b=a?30*a+130:270;angular.element(document.getElementsByClassName("ui-grid")[0]).css("height",b+"px"),angular.element(document.getElementsByClassName("ui-grid-viewport")).css("height",30*a+"px")};a.$on("$destroy",function(){e.unsyncUpdates("agent"),e.unsyncUpdates("user_has_chat_queue")}),a.pause=function(a,b,c){return i.save({name:b,agent:a,type:c||"DEFAULT PAUSE",data4:c||"DEFAULT PAUSE",channel:"chat"}).$promise.then(function(){f.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){f.show(a.message,"danger")})},a.joinQueue=function(e){var g=c.open({animation:!0,templateUrl:"app/channels/chat/realtime/view/agent/queue.modal.add.html",controller:"ChatRealtimeViewAgentQueueModalCtrl",resolve:{queues:function(){return _.reject(a.chatQueues,function(b){return _.find(a.gridOptions.data,{queue:b.name,isAgent:!1,agentId:e})?!0:!1})}}});g.result.then(function(b){return i.save({name:"QueueAdd",agent:e,queues:_.filter(a.chatQueues,function(a){return _.includes(b.queues,a.id)}),channel:"chat",data1:e,data3:b.queues.join(","),data4:"chat"}).$promise.then(function(){f.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){f.show(a.message,"danger")})},function(){b.info("Modal dismissed at: "+new Date)})},a.leaveQueue=function(a,b){return i.save({name:"QueueRemove",agent:a,queueId:b,channel:"chat",data1:a,data3:b,data4:"chat"}).$promise.then(function(){f.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){f.show(a.message,"danger")})},a.showInfo=function(a){c.open({animation:!0,templateUrl:"app/channels/chat/realtime/view/agent/agent.modal.info.html",controller:"ChatRealtimeViewAgentInfoModalCtrl",resolve:{agent:a}})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.realtime.view.agents",{url:"/agents",templateUrl:"app/channels/chat/realtime/view/agent/agent.html",controller:"ChatRealtimeViewAgentCtrl"})}]),angular.module("xCallyShuttleApp").controller("ChatRealtimeViewAgentInfoModalCtrl",["$scope","$uibModalInstance","$http","agent",function(a,b,c,d){a.agent=d,a.close=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("ChatRealtimeViewAgentQueueModalCtrl",["$scope","$uibModalInstance","$http","queues",function(a,b,c,d){a.queues=d,a.item={},a.save=function(){b.close(a.item)},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("ChatRealtimeViewQueueCtrl",["$scope","$http","socket","ChatQueue","Agent",function(a,b,c,d,e){a.initQueues=function(){a.gridOptions={enableSorting:!1,enableFiltering:!0,enableHorizontalScrollbar:0,enableVerticalScrollbar:0,showTreeExpandNoChildren:!1,columnDefs:[{name:"queueName",displayName:"Queue"},{name:"fullname",displayName:"Agent",cellClass:"text-center"},{name:"online",cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div><i data-ng-if="row.entity.online != null" class="icon-user" data-ng-class="row.entity.online ? \'font-green\' : \'font-red\'"></i></div>'},{name:"chatPause",cellClass:"text-center ui-grid-vcenter",cellTemplate:"<div><i data-ng-if=\"row.entity.chatPause != null\" data-ng-class=\"row.entity.chatPause ? 'icon-control-pause font-red' : 'icon-control-play font-green'\"></i></div>"},{name:"pauseType",cellClass:"text-center",cellTemplate:'<span data-ng-if="row.entity.chatPause">{{row.entity.pauseType}}</span>'},{name:"lastLoginAt",cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div><time data-ng-if="row.entity.lastLoginAt" is="relative-time" datetime="{{row.entity.lastLoginAt}}">April 1, 2014</time></div>'}],onRegisterApi:function(b){a.gridApi=b,a.gridApi.treeBase.on.rowExpanded(a,function(b){var c=_.findIndex(a.gridOptions.data,{$$hashKey:b.entity.$$hashKey});b.entity.Users&&b.entity.Users.forEach(function(b){_.find(a.gridOptions.data,{name:b.name})||a.gridOptions.data.splice(c+1,0,b)})})}},d.get(function(b){a.gridOptions.data=[],b.rows.forEach(function(b){b.$$treeLevel=0,b.queueName=b.name,a.gridOptions.data.push(b),b.Users&&b.Users.forEach(function(b){b.agentName=b.name,a.gridOptions.data.push(b)})}),c.socket.on("agent:save",function(b){var c=_.filter(a.gridOptions.data,{agentName:b.name});c.forEach(function(a){a.online=b.online,a.lastLoginAt=b.lastLoginAt})}),c.socket.on("chat_queue:save",function(b){b.$$treeLevel=0,b.queueName=b.name,a.gridOptions.data.push(b)}),c.socket.on("chat_queue:remove",function(b){_.remov(a.gridOptions.data,{queueName:b.name})}),c.socket.on("user_has_chat_queue:save",function(b){var c=_.findIndex(a.gridOptions.data,function(a){return a.queueName&&a.id===b.ChatQueueId});e.get({id:b.UserId}).$promise.then(function(b){a.gridOptions.data.splice(c+1,0,{id:b.id,name:b.name,fullname:b.fullname,agentName:b.name,online:b.online,lastLoginAt:b.lastLoginAt})})["catch"](function(a){console.error(a)})}),c.socket.on("user_has_chat_queue:remove",function(b){for(var c=_.findIndex(a.gridOptions.data,function(a){return a.queueName&&a.id===b.ChatQueueId}),d=c+1;d<a.gridOptions.data.length;d++)a.gridOptions.data[d].id==b.UserId&&a.gridOptions.data.splice(d,1)})},function(a){console.error(a)})},a.conf={agentsByPage:{name:"10",value:10},labels:["fullname","name","email"]},a.agentsByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.$on("$destroy",function(){c.unsyncUpdates("report_mail:save"),c.unsyncUpdates("report_mail:update")}),a.initAgents=function(){b.get("/api/report/mails").success(function(b){a.agents=b,c.socket.on("report_mail:save",function(b){var c=_.find(a.agents,{id:b.id});c||a.agents.unshift(b)}),c.socket.on("report_mail:update",function(b){var c=_.find(a.agents,{id:b.id}),d=a.agents.indexOf(c);c&&_.merge(a.agents[d],b)})}).error(function(a){console.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.realtime.view.queues",{url:"/queues",templateUrl:"app/channels/chat/realtime/view/queue/queue.html",controller:"ChatRealtimeViewQueueCtrl"})}]),angular.module("xCallyShuttleApp").controller("ChatRealtimeViewSessionCtrl",["$scope","$http","socket","uiGridConstants",function(a,b,c,d){a.initSessions=function(){a.gridOptions={enableHorizontalScrollbar:0,enableVerticalScrollbar:0,columnDefs:[{name:"uniqueid",cellClass:"text-center",width:150,enableSorting:!1,enableFiltering:!0},{name:"application",displayName:"APPLICATION_APP",headerCellFilter:"translate",cellClass:"text-center"},{name:"queuename",displayName:"APPLICATION_QUEUE",headerCellFilter:"translate",cellClass:"text-center"},{name:"agentname",cellClass:"text-center"},{name:"websitename",displayName:"APPLICATION_WEB_SITE",headerCellFilter:"translate"},{name:"joinAt",cellClass:"text-center",cellTemplate:'<time data-ng-if="row.entity.joinAt" is="relative-time" datetime="{{row.entity.joinAt}}">April 1, 2014</time>',sort:{direction:d.DESC,priority:1}},{name:"leaveAt",cellClass:"text-center",cellTemplate:'<time data-ng-if="row.entity.leaveAt" is="relative-time" datetime="{{row.entity.leaveAt}}">April 1, 2014</time>'},{name:"unmanagedAt",cellClass:"text-center",cellTemplate:'<time data-ng-if="row.entity.unmanagedAt" is="relative-time" datetime="{{row.entity.unmanagedAt}}">April 1, 2014</time>'}],data:[]},b.get("/api/report/chat/sessions").success(function(b){a.gridOptions.data=b.rows,c.socket.on("report_chat_session:save",function(b){var c=_.find(a.gridOptions.data,{id:b.id}),d=a.gridOptions.data.indexOf(c);c?_.merge(a.gridOptions.data[d],b):a.gridOptions.data.unshift(b)})}).error(function(a){console.error(a)})},a.$on("$destroy",function(){c.unsyncUpdates("report_chat:save"),c.unsyncUpdates("report_chat:update")})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.realtime.view.sessions",{url:"/sessions",templateUrl:"app/channels/chat/realtime/view/session/session.html",controller:"ChatRealtimeViewSessionCtrl"})}]),angular.module("xCallyShuttleApp").controller("ChatRealtimeViewCtrl",["$scope",function(a){a.agents=[{name:"Queues",link:"main.chat.realtime.view.agent.queues"},{name:"Timeline",link:"main.chat.realtime.view.agent.timeline"}],a.sessions=[{name:"Sessions",link:"main.chat.realtime.view.sessions"}]}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.realtime.view",{url:"/view",templateUrl:"app/channels/chat/realtime/view/view.html",controller:"ChatRealtimeViewCtrl"})}]),angular.module("xCallyShuttleApp").controller("ChatVisitorListCtrl",["$scope","ChatVisitor","gridOptions","$uibModal",function(a,b,c,d){a.initView=function(){var d={exporterCsvFilename:"chat_visitors.csv",columnDefs:[{name:"fullname",cellClass:"text-center"},{name:"email",cellClass:"text-center"},{name:"origin",cellClass:"text-center"},{name:"createdAt",displayName:"createdAt",cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div><span am-time-ago="row.entity.createdAt"></span></div>'},{name:"action",width:100,buttons:[{"class":"blue-hoki",href:"/channels/chat/visitors/view/{{row.entity.id}}/profile",name:"profile"}]}]};a.gridOptions=c.gridOptions(b,d,a)}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.visitors.list",{url:"/list",templateUrl:"app/channels/chat/visitor/list/list.html",controller:"ChatVisitorListCtrl"})}]),angular.module("xCallyShuttleApp").controller("ChatVisitorViewCtrl",["$scope","$stateParams","ChatVisitor",function(a,b,c){a.initView=function(){return c.get({id:b.id}).$promise.then(function(b){a.chatVisitor=b})["catch"](function(a){console.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.visitors.view",{url:"/view/:id",templateUrl:"app/channels/chat/visitor/view/view.html",controller:"ChatVisitorViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.channels.chat.visitors.view.profile",{url:"/profile",templateUrl:"app/channels/chat/visitor/view/view.profile.html"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.visitors",{url:"/visitors",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").factory("ChatApplication",["$resource",function(a){return a("/api/chat/applications/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").factory("ChatWebsite",["$resource",function(a){return a("/api/chat/websites/:websiteId/:controller/:id",{id:"@websiteId"},{update:{method:"PUT"},updateFields:{method:"PUT",isArray:!0}})}]),angular.module("xCallyShuttleApp").controller("ChatWebsiteListCtrl",["$scope","gridOptions","ChatWebsite",function(a,b,c){a.initView=function(){var d={exporterCsvFilename:"chat_websites.csv",columnDefs:[{name:"name"},{name:"description"},{name:"address"},{name:"action",width:125,buttons:[{"class":"blue-hoki",href:"/channels/chat/websites/view/{{row.entity.id}}/embedding/view",name:"profile"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=b.gridOptions(c,d,a)}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.websites.list",{url:"/list",templateUrl:"app/channels/chat/website/list/list.html",controller:"ChatWebsiteListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.websites.view.actions",{url:"/actions",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("ChatWebsiteViewActionListCtrl",["$scope","gridOptions","ChatWebsite","$http","$translate","$stateParams","socket","xAlert","Modal",function(a,b,c,d,e,f,g,h,i){a.initActons=function(){var d={draggable:!0,exporterCsvFilename:"chat_applications.csv",columnDefs:[{name:"app",cellClass:"text-center"},{name:"name",cellClass:"text-center ui-grid-vcenter",cellTemplate:"<div><span>{{row.entity.ChatQueue ? row.entity.ChatQueue.name : row.entity.User.name}}</span></div>"},{name:"timeout",cellClass:"text-center"},{name:"interval",cellClass:"text-center"},{name:"action",width:125,buttons:[{"class":"blue-hoki",href:"/channels/chat/websites/view/{{row.entity.ChatWebsiteId}}/actions/view/{{row.entity.id}}",name:"profile"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.app, row.entity.id)"}]}]};a.gridOptions=b.gridOptions(c,d,a,{websiteId:f.websiteId,controller:"applications"})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.websites.view.actions.list",{url:"/list",templateUrl:"app/channels/chat/website/view/action/list/list.html",controller:"ChatWebsiteViewActionListCtrl"})}]),angular.module("xCallyShuttleApp").controller("ChatWebsiteViewActionViewCtrl",["$scope","$http","$stateParams","$translate","$location","xAlert","WizardHandler","socket","application","interval","ChatApplication","ChatQueue","Agent","Interval",function(a,b,c,d,e,f,g,h,i,j,k,l,m,n){a.isActive=!0,a.size="small",a.animate=!0,a.radioOff=!0,a.handleWidth="auto",a.labelWidth="auto",a.inverse=!0,a.offColor="danger",a.onColor="success",a.initAction=function(){return a.$application=i.application,a.$stateParams=c,a.$interval=j.interval,a.forms={},a.apps=[{name:"Queue",value:"queue"},{name:"Agent",value:"agent"}],k.get({id:c.actionId}).$promise.then(function(b){if(a.application=b,a.application.alwaysTime=!1,a.application.IntervalId)a.application.intType="list";else switch(a.application.interval){case"*,*,*,*":a.application.intType="always";break;default:a.application.intType="custom"}var c=a.application.interval.split(",");"*"===c[0]?a.application.alwaysTime=!0:(a.application.t_from=moment(new Date),a.application.t_to=moment(new Date),a.application.t_from.hour(c[0].split("-")[0].split(":")[0]),a.application.t_from.minute(c[0].split("-")[0].split(":")[1]),a.application.t_to.hour(c[0].split("-")[1].split(":")[0]),a.application.t_to.minute(c[0].split("-")[1].split(":")[1])),"*"===c[1]?(a.application.wd_from="always",a.application.wd_to="always"):(a.application.wd_from=c[1].split("-")[0],a.application.wd_to=c[1].split("-")[1]),"*"===c[2]?(a.application.md_from="always",a.application.md_to="always"):(a.application.md_from=c[2].split("-")[0],a.application.md_to=c[2].split("-")[1]),"*"===c[3]?(a.application.m_from="always",a.application.m_to="always"):(a.application.m_from=c[3].split("-")[0],a.application.m_to=c[3].split("-")[1]),a.$watch("application.t_from",function(b){a.application.t_from_hm=moment(b).format("HH:mm")}),a.$watch("application.t_to",function(b){a.application.t_to_hm=moment(b).format("HH:mm")})})["catch"](function(a){f.show(d.instant("Something went wrong!"),"danger")})},a.getQueues=function(){return l.get().$promise.then(function(b){a.queues=b.rows})["catch"](function(a){console.error(a)})},a.getAgents=function(){return m.get().$promise.then(function(b){a.agents=b.rows})["catch"](function(a){console.error(a)})},a.getIntervals=function(){return n.get().$promise.then(function(b){a.intervals=b.rows})["catch"](function(a){console.error(a)})},a.updateItem=function(){var b=["*","*","*","*"],e={app:a.application.app,timeout:a.application.timeout,chatAccountId:c.id};switch(a.application.app){case"agent":e.UserId=a.application.UserId;break;case"queue":e.chatQueueId=a.application.chatQueueId}switch(a.application.intType){case"always":e.interval=b.join(","),delete a.application.IntervalId;break;case"custom":a.application.alwaysTime||(b[0]=a.application.alwaysTime?"*":a.application.t_from_hm+"-"+a.application.t_to_hm),a.application.wd_from&&a.application.wd_to&&"always"===a.application.wd_from&&"always"===a.application.wd_to?b[1]="*":b[1]=a.application.wd_from&&a.application.wd_to?a.application.wd_from+"-"+a.application.wd_to:"*",a.application.md_from&&a.application.md_to&&"always"===a.application.md_from&&"always"===a.application.md_to?b[2]="*":b[2]=a.application.md_from&&a.application.md_to?a.application.md_from+"-"+a.application.md_to:"*",a.application.m_from&&a.application.m_to&&"always"===a.application.m_from&&"always"===a.application.m_to?b[3]="*":b[3]=a.application.m_from&&a.application.m_to?a.application.m_from+"-"+a.application.m_to:"*",e.interval=b.join(","),delete a.application.IntervalId;break;case"list":e.IntervalId=a.application.IntervalId}return k.update({id:c.actionId},e).$promise.then(function(){f.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){f.show(a.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.websites.view.actions.view",{url:"/view/:actionId",templateUrl:"app/channels/chat/website/view/action/view/view.html",controller:"ChatWebsiteViewActionViewCtrl"})}]),angular.module("xCallyShuttleApp").controller("ChatWebsiteViewActionWizardCtrl",["$scope","$http","Agent","Interval","ChatQueue","$stateParams","$translate","$location","xAlert","WizardHandler","socket","application","interval",function(a,b,c,d,e,f,g,h,i,j,k,l,m){a.isActive=!0,a.size="small",a.animate=!0,a.radioOff=!0,a.handleWidth="auto",a.labelWidth="auto",a.inverse=!0,a.offColor="danger",a.onColor="success",a.initWizard=function(){a.apps=[{name:"Queue",value:"queue"},{name:"Agent",value:"agent"}],a.$application=l.application,a.$stateParams=f,a.$interval=m.interval,a.forms={},a.application={app:"queue",intType:"always",alwaysTime:!0},a.$watch("application.t_from",function(b){a.application.t_from_hm=moment(b).format("HH:mm")}),a.$watch("application.t_to",function(b){a.application.t_to_hm=moment(b).format("HH:mm")})},a.getQueues=function(){return e.get().$promise.then(function(b){a.queues=b.rows})["catch"](function(a){console.error(a)})},a.getAgents=function(){return c.get().$promise.then(function(b){a.agents=b.rows})["catch"](function(a){console.error(a)})},a.getIntervals=function(){return d.get().$promise.then(function(b){a.intervals=b.rows})["catch"](function(a){console.error(a)})},a.createItem=function(){var c=["*","*","*","*"],d={app:a.application.app,timeout:a.application.timeout,ChatWebsiteId:f.websiteId};switch(a.application.app){case"agent":d.UserId=a.application.UserId;break;case"queue":d.ChatQueueId=a.application.ChatQueueId}switch(a.application.intType){case"always":d.interval=c.join(","),delete a.application.IntervalId;break;case"custom":a.application.alwaysTime||(c[0]=a.application.alwaysTime?"*":a.application.t_from_hm+"-"+a.application.t_to_hm),a.application.wd_from&&a.application.wd_to&&"always"===a.application.wd_from&&"always"===a.application.wd_to?c[1]="*":c[1]=a.application.wd_from&&a.application.wd_to?a.application.wd_from+"-"+a.application.wd_to:"*",a.application.md_from&&a.application.md_to&&"always"===a.application.md_from&&"always"===a.application.md_to?c[2]="*":c[2]=a.application.md_from&&a.application.md_to?a.application.md_from+"-"+a.application.md_to:"*",a.application.m_from&&a.application.m_to&&"always"===a.application.m_from&&"always"===a.application.m_to?c[3]="*":c[3]=a.application.m_from&&a.application.m_to?a.application.m_from+"-"+a.application.m_to:"*",d.interval=c.join(","),delete a.application.IntervalId;break;case"list":d.IntervalId=a.application.IntervalId}b.post("/api/chat/applications",d).success(function(){h.path("/channels/chat/websites/view/"+f.websiteId+"/actions/list")}).error(function(a){console.error(a)})},a.formValidation=function(a){return a},a.next=function(){j.wizard().next()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.websites.view.actions.wizard",{url:"/wizard",templateUrl:"app/channels/chat/website/view/action/wizard/wizard.html",controller:"ChatWebsiteViewActionWizardCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.websites.view.embedding",{url:"/embedding",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("ChatWebsiteViewEmbeddingViewCtrl",["$scope","$stateParams","$translate","clipboard","xAlert","ChatWebsite",function(a,b,c,d,e,f){a.initView=function(){return f.get({websiteId:b.websiteId,controller:"snippet"}).$promise.then(function(b){a.snippetCode=b.html})["catch"](function(a){e.show(a.message,"danger")})},a.copyToClipboard=function(){d.copyText(a.snippetCode),e.show(c.instant("MESSAGE_TEXT_COPIED_CLIPBOARD")+"!","success")}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.websites.view.embedding.view",{url:"/view",templateUrl:"app/channels/chat/website/view/embedding/view/view.html",controller:"ChatWebsiteViewEmbeddingViewCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.websites.view.form",{url:"/forms",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("ChatWebsiteViewFormViewCtrl",["$scope","$builder","$validator","$stateParams","$translate","ChatWebsite","xAlert",function(a,b,c,d,e,f,g){
+a.saveForm=function(a){var c=angular.copy(b.forms[a]);return c.length>3?g.show("You can insert at least 3 input elements","danger"):(_.forEach(c,function(a){delete a.id}),f.updateFields({websiteId:d.websiteId,controller:"fields",id:a},c).$promise.then(function(){g.show(e.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){g.show(a.message,"danger")}))},a.getChatWebsiteFields=function(a){return f.query({websiteId:d.websiteId,controller:"fields",id:a}).$promise.then(function(c){_.forEach(c,function(c){b.addFormObject(a,c)})})["catch"](function(a){console.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.websites.view.form.view",{url:"/view",templateUrl:"app/channels/chat/website/view/form/view/view.html",controller:"ChatWebsiteViewFormViewCtrl"})}]),angular.module("xCallyShuttleApp").controller("ChatWebsiteViewProactiveListCtrl",["$scope","gridOptions","ChatWebsite","$http","$translate","$stateParams","$uibModal",function(a,b,c,d,e,f,g){a.initProactiveActions=function(){var d={exporterCsvFilename:"telephones.csv",columnDefs:[{name:"name"},{name:"type"},{name:"action",width:125,buttons:[{"class":"blue-hoki",onClick:"grid.appScope.createItem(row.entity)",name:"profile"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=b.gridOptions(c,d,a,{websiteId:f.websiteId,controller:"proactive"})},a.createItem=function(b){var c=g.open({animation:!0,templateUrl:"app/channels/chat/website/view/proactive/list/list.create.modal.html",controller:"ChatWebsiteProactiveListCreateCtrl",resolve:{item:b}});c.result.then(function(b){a.gridOptions.getPage()})}}]),angular.module("xCallyShuttleApp").controller("ChatWebsiteProactiveListCreateCtrl",["$scope","$translate","$uibModalInstance","$stateParams","ChatWebsite","xAlert","item",function(a,b,c,d,e,f,g){a.form={},a.item=g||{},a.title=g?b.instant("APPLICATION_EDIT_PROACTIVE_ACTION"):b.instant("APPLICATION_NEW_PROACTIVE_ACTION"),a.possibleType=[{type:"mouseOver",title:"Mouse Over"},{type:"timeout",title:"Timeout"}],a.save=function(){return g?e.update({websiteId:d.websiteId,controller:"proactive",id:a.item.id},a.item).$promise.then(function(a){f.show(b.instant("MESSAGE_WELL_DONE"),"success"),c.close(a)})["catch"](function(a){f.show(a.data.message,"danger")}):e.save({websiteId:d.websiteId,controller:"proactive"},a.item).$promise.then(function(a){f.show(b.instant("MESSAGE_WELL_DONE"),"success"),c.close(a)})["catch"](function(a){f.show(a.data.message,"danger")})},a.cancel=function(){c.dismiss()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.websites.view.proactive.list",{url:"/list",templateUrl:"app/channels/chat/website/view/proactive/list/list.html",controller:"ChatWebsiteViewProactiveListCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.websites.view.proactive",{url:"/proactive",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.websites.view.snippet",{url:"/snippet",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("ChatWebsiteViewSnippetViewCtrl",["$scope","$http","$stateParams","$translate","Template",function(a,b,c,d,e){a.$translate=d,a.statePreview={state:"online"},a.enquirySwitch={onText:"On",offText:"Off",isActive:!0,size:"small",animate:!0,radioOff:!0,handleWidth:"auto",labelWidth:"auto",inverse:!0,offColor:"danger",onColor:"success"},a.lang={HeaderCurrentlyChatting:"Live Chat",HeaderOffline:"Contact us",OperatorOfflineMessage:"It appears as if all operators are currently offline.",OfflineMessage:"<strong>We're not online.</strong><br/>It doesn't mean we're not there to help - leave your message below and we'll be in touch as soon as possible.",EnquiryMessagePlaceholder:"Your message...",EnquiryButtonText:"Leave message",EnquirySubmitSuccess:"Your message was sucessfully submitted - we will contact you as soon as possible.",OperatorComposing:"{fullname} is typing...",FirstMessageText:"",ExitChatButtonText:"Exit Chat",ExitChatQuestionText:"Are you sure?",ExitChatButtonConfirmText:"Yes",ExitChatButtonCancelText:"No",MessagePlaceholderText:"Your message...",MessageSendButtonText:"Send",ValidationEmailRequired:"Please enter your email address",ValidationEmailInvalid:"Please enter a valid email address",ValidationEmailMaxLength:"The email address may not exceed 85 characters",ValidationUsernameRequired:"Please enter your name",ValidationUsernameMaxLength:"The name may not exceed 45 characters",ValidationEnquiryRequired:"Please enter your enquiry",ValidationEnquiryMaxLength:"The enquiry may not exceed 1500 characters",ValidationMessageRequired:"Please enter your message",ValidationMessageMaxLength:"The message may not exceed 750 characters"},a.initView=function(){e.get().$promise.then(function(b){console.log(b),a.mailTemplates=b.rows})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.websites.view.snippet.view",{url:"/view",templateUrl:"app/channels/chat/website/view/snippet/view/view.html",controller:"ChatWebsiteViewSnippetViewCtrl"})}]),angular.module("xCallyShuttleApp").controller("ChatWebsiteViewCtrl",["$scope","xAlert","$http","$location","$stateParams","$translate","WizardHandler","ChatApplication","ChatWebsite",function(a,b,c,d,e,f,g,h,i){a.initApplication=function(){a.forms={},a.application={}},a.goNext=function(){g.wizard().next()},a.formValidation=function(a){return a},a.deleteItem=function(a){return h["delete"]({id:a}).$promise.then(function(){b.show(f.instant("MESSAGE_WELL_DONE")+"!","success")})["catch"](function(a){b.show(f.instant("Something went wrong!"),"danger")})},a.initView=function(){return i.get({id:e.websiteId}).$promise.then(function(b){a.chatWebsite=b})["catch"](function(a){b.show(a.message,"danger")})},a.updateItem=function(){return i.update({id:a.chatWebsite.id},a.chatWebsite).$promise.then(function(){b.show(f.instant("MESSAGE_CHAT_WEBSITE_UPDATE_SUCCESS")+"!","success")})["catch"](function(){b.show(f.instant("MESSAGE_CHAT_WEBSITE_UPDATE_FAILURE"),"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.websites.view",{url:"/view/:websiteId",templateUrl:"app/channels/chat/website/view/view.html",controller:"ChatWebsiteViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/css/profile.css","assets/css/tasks.css"]}])}]}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.websites",{url:"/websites",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("ChatWebsiteWizardCtrl",["$scope","$http","$location","$translate","WizardHandler","xAlert","ChatWebsite",function(a,b,c,d,e,f,g){a.$translate=d,a.forms={formSetting:void 0,formAppearance:void 0,formLabel:void 0,formFunctionality:void 0},a.next=function(){e.wizard().next()},a.exitValidation=function(a){return a},a.item={},a.createItem=function(){return g.save(a.item).$promise.then(function(){f.show(d.instant("MESSAGE_CHAT_WEBSITE_CREATE_SUCCESS"),"success"),c.path("/channels/chat/websites/list")})["catch"](function(a){f.show(d.instant("MESSAGE_CHAT_WEBSITE_CREATE_FAILURE"),"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.websites.wizard",{url:"/wizard",templateUrl:"app/channels/chat/website/wizard/wizard.html",controller:"ChatWebsiteWizardCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.fax.accounts",{url:"/accounts",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").controller("FaxAccountListCtrl",["$scope","$http","xAlert","$translate","socket","Modal","$rootScope","$log","stResource",function(a,b,c,d,e,f,g,h,i){a.conf={faxAccountsByPage:{name:"10",value:10}},a.faxAccountsByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.fax_accounts={checked:[]},a.check=function(b,c){c?a.fax_accounts.checked=angular.copy(_.map(a.displayedFaxAccounts,"id")):a.fax_accounts.checked=[]},a.initList=function(b){e.unsyncUpdates("fax_account"),b.url="/api/fax/accounts",i.getPage(b).then(function(c){a.displayedFaxAccounts=c.rows,b.pagination.numberOfPages=c.total_pages,g.updateTableConfig(a.faxAccountsByPage,a.displayedFaxAccounts.length),g.updateTableConfig(a.conf.faxAccountsByPage,a.displayedFaxAccounts.length)}),e.socket.on("fax_account:save",function(){a.initList(b)}),e.socket.on("fax_account:remove",function(c){a.fax_accounts.checked=_.without(a.fax_accounts.checked,c.id),a.initList(b)})},a.deleteItem=f.confirm["delete"](function(a){b["delete"]("api/fax/accounts/"+a).success(function(){c.show(d.instant("MESSAGE_FAX_ACCOUNT_DELETE_SUCCESS"),"success")}).error(function(){c.show(d.instant("MESSAGE_FAX_ACCOUNT_DELETE_FAILURE"),"danger")})}),a.deleteItems=f.confirm["delete"](function(){b["delete"]("/api/fax/accounts",{params:{id:a.fax_accounts.checked}}).success(function(){c.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){c.show(d.instant(a.message),"danger")})}),a.getFaxAccounts=function(b){return _.map(a.faxAccountsByPage,function(a){var c={};return b.forEach(function(b){c[b]=a[b]}),c})},a.$on("$destroy",function(){e.unsyncUpdates("fax_account")})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.fax.accounts.list",{url:"/list",templateUrl:"app/channels/fax/account/list/list.html",controller:"FaxAccountListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").controller("FaxAccountViewCtrl",["$scope","$http","$stateParams","$translate","$location","WizardHandler","socket","xAlert","Modal",function(a,b,c,d,e,f,g,h,i){a.isActive=!0,a.size="small",a.animate=!0,a.radioOff=!0,a.handleWidth="auto",a.labelWidth="auto",a.inverse=!0,a.offColor="danger",a.onColor="success",a.forms={},a.sortableOptions={stop:function(){b.post("api/fax/accounts/"+c.id+"/applications",{applications:_.map(a.faxApplications,"id")}).success(function(b){a.faxApplications=b}).error(function(a){console.error(a)})},"ui-floating":!0},a.goNext=function(){f.wizard().next()},a.formValidation=function(a){return a},a.initApplication=function(){a.forms={},a.application={}},a.deleteItem=i.confirm["delete"](function(a){b["delete"]("api/fax/applications/"+a).success(function(){h.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(){h.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})}),a.getAppdata=function(b,c){switch(b){case"agent":return a.agents?_.find(a.agents,{id:c}).name:c;case"queue":return a.faxQueues?_.find(a.faxQueues,{id:c}).name:c}return"UNKNOWN"},a.createItem=function(){switch(a.application.appdata=a.application.appdata.id,a.application.app){case"agent":a.application.UserId=parseInt(a.application.appdata,10);break;case"queue":a.application.FaxQueueId=parseInt(a.application.appdata,10)}a.application.FaxAccountId=c.id,b.post("api/fax/applications",a.application).success(function(){e.path("/channels/fax/accounts/view/"+c.id+"/routes")}).error(function(){h.show("Something went wrong!","danger")})},a.$watch("application.app",function(c){if(c){var d;switch(c){case"agent":d="api/agents";break;case"queue":d="api/fax/queues"}b.get(d).success(function(b){a.items=b.rows})}},!0),a.initView=function(){b.get("/api/trunks").success(function(b){a.trunks=b.rows}).error(function(a){console.log(a)}),b.get("/api/fax/accounts/"+c.id).success(function(b){a.account=b}).error(function(){})},a.getAgents=function(){b.get("api/fax/agents").success(function(b){a.agents=b})},a.getFaxApplications=function(){b.get("/api/fax/applications",{params:{FaxAccountId:c.id}}).success(function(b){a.faxApplications=b,g.socket.on("fax_application:remove",function(b){_.remove(a.faxApplications,{id:b.id})})}),b.get("/api/agents").success(function(b){a.agents=b.rows}),b.get("/api/fax/queues").success(function(b){a.faxQueues=b.rows})},a.updateItemFaxAccount=function(){b.put("/api/fax/accounts/"+c.id,a.account).success(function(){h.show(d.instant("MESSAGE_FAX_ACCOUNT_UPDATE_SUCCESS")+".","success")}).error(function(){h.show(d.instant("MESSAGE_FAX_ACCOUNT_UPDATE_FAILURE")+".","danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.fax.accounts.view",{url:"/view/:id",templateUrl:"app/channels/fax/account/view/view.html",controller:"FaxAccountViewCtrl",authenticate:!0,resolve:{deps:["$ocLazyLoad",function(a){return a.load({insertBefore:"#ng_load_plugins_before",files:["assets/css/profile.css","assets/css/tasks.css"]})}]}}).state("main.channels.fax.accounts.view.settings",{url:"/settings",templateUrl:"app/channels/fax/account/view/view.settings.html",authenticate:!0}).state("main.channels.fax.accounts.view.routes",{url:"/routes",templateUrl:"app/channels/fax/account/view/view.routes.html",authenticate:!0}).state("main.channels.fax.accounts.view.applications",{url:"/applications",templateUrl:"app/channels/fax/account/view/view.applications.html",authenticate:!0})}]),angular.module("xCallyShuttleApp").controller("FaxAccountWizardCtrl",["$scope","$http","$location","$translate","xAlert","WizardHandler",function(a,b,c,d,e,f){a.translate=d,a.isActive=!0,a.size="small",a.animate=!0,a.radioOff=!0,a.handleWidth="auto",a.labelWidth="auto",a.inverse=!0,a.offColor="danger",a.onColor="success",a.initWizard=function(){a.$translate=d,a.forms={},a.item={},a.item.ecm=!1,a.item.minrate="9600",a.item.maxrate="33600",b.get("/api/trunks").success(function(b){a.trunks=b.rows}).error(function(a){console.error(a)})},a.next=function(){f.wizard().next()},a.exitValidation=function(a){return a},a.createItem=function(){b.post("api/fax/accounts",a.item).success(function(){e.show(d.instant("MESSAGE_FAX_ACCOUNT_CREATE_SUCCESS")+".","success"),c.path("/channels/fax/accounts/list")}).error(function(){e.show(d.instant("MESSAGE_FAX_ACCOUNT_CREATE_FAILURE")+".","danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.fax.accounts.wizard",{url:"/wizard",templateUrl:"app/channels/fax/account/wizard/wizard.html",controller:"FaxAccountWizardCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.fax",{url:"/fax",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("FaxInboxComposeCtrl",["$scope","$http","FileUploader","$location","Auth","xAlert","$cookieStore","$translate",function(a,b,c,d,e,f,g,h){a.forms={},a.form={to:[],sto:[]},b.get("api/fax/accounts").success(function(b){a.faxAccounts=b.rows}),a.isNewMessageFromEmpty=!0;var i=a.uploader=new c({url:"api/fax/messages",queueLimit:1,withCredentials:!0,headers:{Authorization:"Bearer "+g.get("token")}});i.filters.push({name:"pdfFilter",fn:function(a){var b="|"+a.type.slice(a.type.lastIndexOf("/")+1)+"|";return-1!=="|pdf|".indexOf(b)}}),i.onBeforeUploadItem=function(b){b.formData.push({accountId:a.form.from.id,toNum:a.form.sto[0],isNewRoom:a.isNewMessageFromEmpty,userId:e.getCurrentUser().id,html:a.form.html?a.form.html:""})},i.onSuccessItem=function(a,b,c,d){console.info("onSuccessItem",a,b,c,d)},i.onErrorItem=function(a,b,c,d){console.info("onErrorItem",a,b,c,d)},i.onCompleteAll=function(){i.clearQueue(),f.show(h.instant("MESSAGE_WELL_DONE"),"success"),d.path("/channels/fax/inbox/incoming")},i.onWhenAddingFileFailed=function(){f.show(h.instant("MESSAGE_WRONG_FORMAT"),"danger")},a.sendFax=function(){return a.form.sto.length?void(i.queue.length?i.uploadAll():b.post("api/fax/messages",{accountId:a.form.from.id,toNum:a.form.sto[0],isNewRoom:a.isNewMessageFromEmpty,userId:e.getCurrentUser().id,html:a.form.html,onlyText:!0}).success(function(){f.show(h.instant("MESSAGE_WELL_DONE"),"success"),d.path("/channels/fax/inbox/incoming")}).error(function(a){f.show(h.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger"),console.error(a)})):(a.forms.compose.to.$valid=!1,void(a.forms.compose.to.$invalid=!0))},a.cancel=function(){a.form.sto=[],delete a.form.from}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.fax.inbox.compose",{url:"/compose",templateUrl:"app/channels/fax/inbox/room/room.html",controller:"FaxInboxComposeCtrl"})}]),angular.module("xCallyShuttleApp").controller("FaxInboxCtrl",["$scope","$http","$location","$translate","$timeout","$notification","Auth","socket","$interval",function(a,b,c,d,e,f,g,h,i){a.go=function(a,d,e){e?b.put("/api/fax/rooms/"+d,{status:e}).success(function(){c.path(a)}).error(function(a){console.error(a)}):c.path(a)}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.fax.inbox",{url:"/inbox",templateUrl:"app/channels/fax/inbox/inbox.html",controller:"FaxInboxCtrl",authenticate:!0,resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/inbox.css","assets/css/todo.css"]}])}]}})}]),angular.module("xCallyShuttleApp").controller("FaxInboxIncomingCtrl",["$scope","$http","$location","socket","Auth","xAlert",function(a,b,c,d,e,f){a.$location=c,a.getRooms=function(){e.isAdmin()?b.get("api/fax/rooms").success(function(b){a.faxRooms=b,d.syncUpdates("fax_room",a.faxRooms)}).error(function(a){console.error(a),f.show($translate.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")}):b.get("api/fax/rooms/agent/"+e.getCurrentUser().id).success(function(b){a.faxRooms=b,d.socket.on("fax_room:update",function(b){b.UserId===e.getCurrentUser().id&&a.faxRooms.push(b)})}).error(function(a){f.show($translate.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger"),console.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.fax.inbox.incoming",{url:"/incoming",templateUrl:"app/channels/fax/inbox/incoming/incoming.html",controller:"FaxInboxIncomingCtrl"})}]),angular.module("xCallyShuttleApp").controller("FaxInboxRoomCtrl",["$scope","$http","$stateParams","$location","FileUploader","socket","Auth","xAlert","$translate","$cookieStore",function(a,b,c,d,e,f,g,h,i,j){function k(){a.lastMessage=_.reject(a.faxRoom.FaxMessages,function(a){return"RECEIVED"!==a.status}),a.lastMessage=_.sortByOrder(a.lastMessage,["id"],["desc"])[0],a.lastMessage&&(console.log(a.faxRoom),a.form.from=a.faxRoom.FaxAccount,a.form.to=[a.lastMessage.From.phone],a.form.sto=[a.lastMessage.From.phone])}var l=a.uploader=new e({url:"api/fax/messages",queueLimit:1,withCredentials:!0,headers:{Authorization:"Bearer "+j.get("token")}});l.filters.push({name:"pdfFilter",fn:function(a){var b="|"+a.type.slice(a.type.lastIndexOf("/")+1)+"|";return-1!=="|pdf|".indexOf(b)}}),l.onBeforeUploadItem=function(b){console.log(a.form.from.id,a.form.sto[0],a.isNewMessageFromEmpty,c.id,g.getCurrentUser().id),b.formData.push({accountId:a.form.from.id,toNum:a.form.sto[0],isNewRoom:a.isNewMessageFromEmpty,roomId:c.id,userId:g.getCurrentUser().id,html:a.form.html}),console.log(b)},l.onSuccessItem=function(a,b,c,d){console.info("onSuccessItem",a,b,c,d)},l.onErrorItem=function(a,b,c,d){console.info("onErrorItem",b,c,d)},l.onCompleteAll=function(){l.clearQueue(),h.show(i.instant("MESSAGE_WELL_DONE"),"success")},l.onWhenAddingFileFailed=function(){h.show(i.instant("MESSAGE_WRONG_FORMAT"),"danger")},a.initRoomView=function(){a.isNewMessageFromEmpty=!0,a.Auth=g,a.forms={},a.form={to:[],sto:[]},b.get("api/agents").success(function(b){a.agents=b}),b.get("api/fax/accounts").success(function(b){a.faxAccounts=b.rows}),c.id&&b.get("/api/fax/rooms/"+c.id).success(function(b){a.faxRoom=b,a.isNewMessageFromEmpty=!1,f.syncUpdates("fax_message",[],function(b,c){"created"===b&&c.FaxRoomId===a.faxRoom.id&&(a.faxRoom.FaxMessages.push(c),k())}),k()}).error(function(a){console.error(a),h.show(i.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})},a.sendFax=function(){return a.form.sto.length?void(l.queue.length?l.uploadAll():b.post("api/fax/messages",{accountId:a.form.from.id,toNum:a.form.sto[0],isNewRoom:a.isNewMessageFromEmpty,userId:g.getCurrentUser().id,html:a.form.html,onlyText:!0}).success(function(){h.show(i.instant("MESSAGE_WELL_DONE"),"success"),console.log("Fax Message sent")}).error(function(a){h.show(i.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger"),console.error(a)})):(a.forms.compose.to.$valid=!1,void(a.forms.compose.to.$invalid=!0))},a.assignAgent=function(a){b.put("/api/fax/rooms/"+c.id,{UserId:a}).success(function(){h.show(i.instant("MESSAGE_WELL_DONE"),"danger")}).error(function(){h.show(i.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})},a.updateStatus=function(d){b.put("/api/fax/rooms/"+c.id,{status:d}).success(function(b){a.faxRoom.status=b.status,h.show(i.instant("MESSAGE_WELL_DONE"),"danger")}).error(function(a){console.error(a),h.show(i.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})},a.cancel=function(){a.form.sto=[],delete a.form.from,l.clearQueue()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.fax.inbox.room",{url:"/room/:id",templateUrl:"app/channels/fax/inbox/room/room.html",controller:"FaxInboxRoomCtrl"})}]),angular.module("xCallyShuttleApp").factory("FaxQueue",["$resource",function(a){return a("/api/fax/queues/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").controller("FaxQueueListCtrl",["$scope","FaxQueue","gridOptions","$uibModal",function(a,b,c,d){a.initView=function(){var d={exporterCsvFilename:"fax_queues.csv",columnDefs:[{name:"name"},{name:"description"},{name:"strategy"},{name:"timeout"},{name:"action",width:125,buttons:[{"class":"blue-hoki",href:"/channels/fax/queues/view/{{row.entity.id}}/settings",name:"profile"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=c.gridOptions(b,d,a)},a.createItem=function(){var b=d.open({animation:!0,templateUrl:"app/channels/fax/queue/list/list.create.modal.html",controller:"FaxQueueListCreateCtrl"});b.result.then(function(b){console.log(b),a.gridOptions.getPage()})}}]),angular.module("xCallyShuttleApp").controller("FaxQueueListCreateCtrl",["$scope","$uibModalInstance","$translate","xAlert","FaxQueue",function(a,b,c,d,e){a.form={},a.item={},a.save=function(){return e.save(a.item).$promise.then(function(a){d.show(c.instant("MESSAGE_WELL_DONE"),"success"),b.close(a)})["catch"](function(a){d.show(a.data.message,"danger")})},a.cancel=function(){b.dismiss()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.fax.queues.list",{url:"/list",templateUrl:"app/channels/fax/queue/list/list.html",controller:"FaxQueueListCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.fax.queues",{url:"/queues",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").controller("FaxQueueViewCtrl",["$scope","$http","$translate","$stateParams","xAlert","FaxQueue","Team",function(a,b,c,d,e,f,g){var h=function(){return{select:function(b){return f.save({id:a.queue.id,controller:"agents"},{agents:b,penalty:a.queue.penalty}).$promise.then(function(){a.getTeams()})["catch"](function(a){console.error(a)})},deselect:function(b){return f["delete"]({id:a.queue.id,controller:"agents",agents:b}).$promise.then(function(){a.getTeams()})["catch"](function(a){console.error(a)})}}};a.getQueue=function(){return f.get({id:d.id}).$promise.then(function(b){b.penalty=0,a.queue=b})["catch"](function(a){e.show(a.message,"danger")})},a.updateFaxQueue=function(){return f.update({id:d.id},{name:a.queue.name,description:a.queue.description,timeout:a.queue.timeout,strategy:a.queue.strategy}).$promise.then(function(){e.show(c.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){e.show(a.message,"danger")})},a.getTeams=function(){return g.get().$promise.then(function(b){return a.teams=b.rows,f.query({id:d.id,controller:"agents"}).$promise}).then(function(b){ComponentsDropdowns.bindMailQueue(a.teams,_.map(b,function(a){return{id:a.id,penalty:a.UserHasFaxQueue.penalty}}),h)})["catch"](function(a){console.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.fax.queues.view",{url:"/view/:id",templateUrl:"app/channels/fax/queue/view/view.html",controller:"FaxQueueViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.channels.fax.queues.view.settings",{url:"/settings",templateUrl:"app/channels/fax/queue/view/view.settings.html"}).state("main.channels.fax.queues.view.agents",{url:"/agents",templateUrl:"app/channels/fax/queue/view/view.agents.html",cache:!1,serie:!0,resolve:{deps:["$ocLazyLoad",function(a){return a.load({insertBefore:"#ng_load_plugins_before",files:["assets/plugins/jquery-multi-select/css/multi-select.css","assets/plugins/jquery-multi-select/js/jquery.multi-select.js","assets/plugins/jquery-quicksearch/jquery.quicksearch.js","assets/scripts/components-dropdowns.js"]})}]}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.fax.realtime",{url:"/realtime",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").controller("FaxRealtimeViewAgentCtrl",["$scope","$log","$uibModal","$translate","socket","xAlert","Agent","Pause","Action","FaxQueue","usSpinnerService","$q","uiGridConstants",function(a,b,c,d,e,f,g,h,i,j,k,l,m){function n(){return k.spin("spinner-grid"),g.get(s).$promise.then(function(b){a.gridOptions.totalItems=b.count,a.gridOptions.data=[],b.rows.forEach(function(a){p(a)})})["catch"](function(a){f.show(a.message,"danger")})["finally"](function(){k.stop("spinner-grid")})}function o(){e.socket.on("agent:save",function(b){var c=_.find(a.gridOptions.data,{agentId:b.id,isAgent:!0});if(c){var d=a.gridOptions.data.indexOf(c);a.gridOptions.data[d].online=b.online,a.gridOptions.data[d].lastLoginAt=b.lastLoginAt,a.gridOptions.data[d].pause=b.faxPause,a.gridOptions.data[d].pauseType=b.pauseType,a.gridOptions.data[d].lastPauseAt=b.lastPauseAt,a.gridOptions.data[d].ipaddr=b.ipaddr,a.gridOptions.data[d].port=b.port,a.gridOptions.data[d].fullcontact=b.fullcontact,a.gridOptions.data[d].useragent=b.useragent,a.gridOptions.data[d].lastms=b.lastms,a.gridOptions.data[d].internal=b.internal,_.map(a.gridOptions.data,function(a){a.isAgent||a.agentId!==b.id||(a.online=b.online)})}}),e.socket.on("agent:remove",function(b){_.remove(a.gridOptions.data,{agentId:b.id})}),e.socket.on("user_has_fax_queue:save",function(b){console.log("new queue",b);var c=_.find(a.gridOptions.data,{agentId:b.UserId,isAgent:!0}),d=a.gridOptions.data.indexOf(c);a.gridOptions.data.splice(d+1,0,{isAgent:!1,agentId:b.UserId,queue:b.queue,queueId:b.FaxQueueId,agent:b.membername,online:c.online})}),e.socket.on("user_has_fax_queue:remove",function(b){_.remove(a.gridOptions.data,{agentId:b.UserId,queueId:b.FaxQueueId})})}function p(b){a.gridOptions.data.push({isAgent:!0,agentId:b.id,agent:b.name,online:b.online,lastLoginAt:b.lastLoginAt,lastPauseAt:b.lastPauseAt,pause:b.faxPause,pauseType:b.pauseType,ipaddr:b.ipaddr,port:b.port,fullcontact:b.fullcontact,useragent:b.useragent,lastms:b.lastms,internal:b.internal,$$treeLevel:0}),b.FaxQueues.forEach(function(c){a.gridOptions.data.push({isAgent:!1,agentId:b.id,queue:c.name,queueId:c.id,agent:b.name,online:b.online})})}function q(){return h.get().$promise.then(function(b){a.pauses=b.rows,e.syncUpdates("pause",a.pauses)})["catch"](function(a){f.show(a.message,"danger")})}function r(){return j.get().$promise.then(function(b){a.faxQueues=b.rows,e.syncUpdates("fax_queue",a.faxQueues)})["catch"](function(a){f.show(a.message,"danger")})}a.faxQueues=[];var s={offset:0,limit:10};a.moment=moment,a.initAgents=function(){a.gridOptions={enableGridMenu:!0,headerCellFilter:"translate",enableHorizontalScrollbar:0,enableVerticalScrollbar:0,enableFiltering:!0,showGridFooter:!0,paginationPageSizes:[10,25,50,75],paginationPageSize:10,useExternalPagination:!0,useExternalSorting:!0,useExternalFiltering:!0,multiSelect:!0,showTreeExpandNoChildren:!0,columnDefs:[{name:"name",displayName:"APPLICATION_AGENT",headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div data-ng-if="row.entity.isAgent">{{row.entity.agent}} &lt;{{row.entity.internal}}&gt;</div>'},{name:"online",displayName:"APPLICATION_ONLINE",width:150,headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div data-ng-if="row.entity.online != null && row.entity.isAgent"><i class="icon-user" data-ng-class="row.entity.online ? \'font-green\' : \'font-red\'"></i> <span data-ng-if="row.entity.online" class="left-margin">(<timer start-time="grid.appScope.moment(row.entity.lastLoginAt).unix()*1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>)</span></div>',filter:{type:m.filter.SELECT,selectOptions:[{value:"true",label:"ONLINE"},{value:"false",label:"OFFLINE"}]}},{name:"faxPause",width:300,displayName:"APPLICATION_PAUSE",headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div data-ng-if="row.entity.pause != null && row.entity.online" class="ui-grid-vcenter" data-ng-class="{\'paused-agent\':row.entity.pause}"><timer data-ng-if="row.entity.pause" start-time="grid.appScope.moment(row.entity.lastPauseAt).unix()*1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer></span><span data-ng-if="row.entity.pause" class="left-margin">({{row.entity.pauseType}})</span><i data-ng-if="row.entity.pause" data-ng-click="grid.appScope.pause(row.entity.agentId,\'unpause\')" class="icon-control-play font-green pointer-cursor left-margin" title="{{\'APPLICATION_RESUME\' | translate}}"></i><i class="icon-control-pause font-yellow pointer-cursor" data-ng-click="grid.appScope.pause(row.entity.agentId,\'pause\',\'DEFAULT PAUSE\')" title="{{\'APPLICATION_DEFAULT_PAUSE\' | translate}}"></i><select data-ng-if="grid.appScope.pauses.length" class="pause-select pointer-cursor" data-ng-model="grid.appScope.pauseType" data-ng-change="grid.appScope.pause(row.entity.agentId,\'pause\',grid.appScope.pauseType)"><option class="pointer-cursor" data-ng-repeat="pause in grid.appScope.pauses">{{pause.name}}</option></select></div>',filter:{type:m.filter.SELECT,selectOptions:[{value:"true",label:"PAUSED"},{value:"false",label:"NOT PAUSED"}]},enableSorting:!1,enableColumnMenu:!1},{name:"queue",displayName:"APPLICATION_QUEUE",headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",enableSorting:!1,enableFiltering:!1,enableColumnMenu:!1},{name:"action",displayName:"",width:170,cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div><button data-ng-if="row.entity.queueId" class="btn btn-xs red-sunglo" data-ng-click="grid.appScope.leaveQueue(row.entity.agentId,row.entity.queueId)"><i class="icon-ban"></i> {{\'APPLICATION_LEAVE\' | translate}}</button><button data-ng-if="row.entity.isAgent && row.treeNode.children.length < grid.appScope.faxQueues.length" class="btn btn-xs blue-hoki" data-ng-click="grid.appScope.joinQueue(row.entity.agentId)"><i class="icon-plus"></i> {{\'APPLICATION_JOIN_QUEUE\' | translate}}</button> <button data-ng-if="row.entity.isAgent" class="btn btn-xs blue-madison" data-ng-click="grid.appScope.showInfo(row.entity)"><i class="icon-info"></i> {{\'APPLICATION_INFO\' | translate}}</button><div>',
+enableSorting:!1,enableFiltering:!1,enableColumnMenu:!1}],data:[],gridMenuTitleFilter:function(a){var b=l.defer();return b.resolve(d.instant(a)),b.promise},onRegisterApi:function(b){a.gridApi=b,a.gridApi.grid.registerDataChangeCallback(function(){t(a.gridApi.core.getVisibleRows(a.gridApi.grid).length)}),a.gridApi.treeBase.on.rowExpanded(a,function(b){t(a.gridApi.core.getVisibleRows(a.gridApi.grid).length+b.treeNode.children.length)}),a.gridApi.treeBase.on.rowCollapsed(a,function(b){t(a.gridApi.core.getVisibleRows(a.gridApi.grid).length-b.treeNode.children.length)}),a.gridApi.core.on.sortChanged(a,function(a,b){0===b.length?s.order=null:s.order=b[0].name+" "+b[0].sort.direction.toUpperCase(),n()}),a.gridApi.pagination.on.paginationChanged(a,function(a,b){s.offset=(a-1)*b,s.limit=b,n()}),a.gridApi.core.on.filterChanged(a,function(){var a=this.grid;a.columns.forEach(function(a){a.filters[0].term?s[a.name]=a.filters[0].term:delete s[a.name]}),n()})}},n(),q(),r(),o()};var t=function(a){var b=a?30*a+130:270;angular.element(document.getElementsByClassName("ui-grid")[0]).css("height",b+"px"),angular.element(document.getElementsByClassName("ui-grid-viewport")).css("height",30*a+"px")};a.$on("$destroy",function(){e.unsyncUpdates("agent"),e.unsyncUpdates("user_has_fax_queue")}),a.pause=function(a,b,c){return i.save({name:b,agent:a,type:c||"DEFAULT PAUSE",data4:c||"DEFAULT PAUSE",channel:"fax"}).$promise.then(function(){f.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){f.show(a.message,"danger")})},a.joinQueue=function(e){var g=c.open({animation:!0,templateUrl:"app/channels/fax/realtime/view/agent/queue.modal.add.html",controller:"FaxRealtimeViewAgentQueueModalCtrl",resolve:{queues:function(){return _.reject(a.faxQueues,function(b){return _.find(a.gridOptions.data,{queue:b.name,isAgent:!1,agentId:e})?!0:!1})}}});g.result.then(function(b){return i.save({name:"QueueAdd",agent:e,queues:_.filter(a.faxQueues,function(a){return _.includes(b.queues,a.id)}),channel:"fax",data1:e,data3:b.queues.join(","),data4:"fax"}).$promise.then(function(){f.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){f.show(a.message,"danger")})},function(){b.info("Modal dismissed at: "+new Date)})},a.leaveQueue=function(a,b){return i.save({name:"QueueRemove",agent:a,queueId:b,channel:"fax",data1:a,data3:b,data4:"fax"}).$promise.then(function(){f.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){f.show(a.message,"danger")})},a.showInfo=function(a){c.open({animation:!0,templateUrl:"app/channels/fax/realtime/view/agent/agent.modal.info.html",controller:"FaxRealtimeViewAgentInfoModalCtrl",resolve:{agent:a}})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.fax.realtime.view.agents",{url:"/agents",templateUrl:"app/channels/fax/realtime/view/agent/agent.html",controller:"FaxRealtimeViewAgentCtrl"})}]),angular.module("xCallyShuttleApp").controller("FaxRealtimeViewAgentInfoModalCtrl",["$scope","$uibModalInstance","$http","agent",function(a,b,c,d){a.agent=d,a.close=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("FaxRealtimeViewAgentQueueModalCtrl",["$scope","$uibModalInstance","$http","queues",function(a,b,c,d){a.queues=d,a.item={},a.save=function(){b.close(a.item)},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("FaxRealtimeViewCtrl",["$scope","$state",function(a,b){a.agents=[{name:"Queues",link:"main.channels.fax.realtime.view.agents.queues"},{name:"Timeline",link:"main.channels.fax.realtime.view.agents.timeline"}],a.sessions=[{name:"Sessions",link:"main.channels.fax.realtime.view.sessions"}],a.tree={queues:[{name:"Queues",link:"main.channels.fax.realtime.view.agents.queues"},{name:"Timeline",link:"main.channels.fax.realtime.view.agents.timeline"}],sessions:[{name:"Sessions",link:"main.channels.fax.realtime.view.sessions"}]}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.fax.realtime.view",{url:"/view",templateUrl:"app/channels/fax/realtime/view/view.html",controller:"FaxRealtimeViewCtrl"})}]),angular.module("xCallyShuttleApp").factory("MailAccount",["$resource",function(a){return a("/api/mail/accounts/:accountId/:controller/:id",{id:"@accountId"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.mail.accounts",{url:"/accounts",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").controller("MailAccountListCtrl",["$scope","gridOptions","MailAccount","$stateParams",function(a,b,c,d){a.initView=function(){var e={exporterCsvFilename:"mail_accounts.csv",columnDefs:[{name:"name"},{name:"description"},{name:"address"},{name:"MailServerIn.state",width:100,cellClass:"text-center ui-grid-vcenter",cellTemplate:"<div><span class=\"label label-sm\" data-ng-class=\"row.entity.MailServerIn.state === 'CONNECTED' ? 'label-success' : 'label-danger'\">{{row.entity.MailServerIn.state}}</span></div>",displayName:"IMAP",enableSorting:!1,enableFiltering:!1},{name:"MailServerOut.state",width:110,cellClass:"text-center ui-grid-vcenter",cellTemplate:"<div><span class=\"label label-sm\" data-ng-class=\"row.entity.MailServerOut.state === 'CONNECTED' ? 'label-success' : 'label-danger'\">{{row.entity.MailServerOut.state}}</span></div>",displayName:"SMTP",enableSorting:!1,enableFiltering:!1},{name:"action",width:125,buttons:[{"class":"blue-hoki",href:"/channels/mail/accounts/view/{{row.entity.id}}/settings",name:"profile"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=b.gridOptions(c,e,a,{accountId:d.accountId})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.mail.accounts.list",{url:"/list",templateUrl:"app/channels/mail/account/list/list.html",controller:"MailAccountListCtrl"})}]),angular.module("xCallyShuttleApp").factory("MailServerIn",["$resource",function(a){return a("/api/mail/servers/in/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").factory("MailServerOut",["$resource",function(a){return a("/api/mail/servers/out/:id/:controller",{id:"@id"},{update:{method:"PUT"},test:{method:"GET"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.mail.accounts.view.actions",{url:"/actions",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("MailAccountViewActionListCtrl",["$scope","gridOptions","MailAccount","$http","$translate","$stateParams",function(a,b,c,d,e,f){a.initActons=function(){var d={draggable:!0,exporterCsvFilename:"mail_applications.csv",enableSorting:!1,enableFiltering:!1,columnDefs:[{name:"app",cellClass:"text-center"},{name:"name",cellClass:"text-center ui-grid-vcenter",cellTemplate:"<div><span>{{row.entity.MailQueue ? row.entity.MailQueue.name : row.entity.User.name}}</span></div>"},{name:"timeout",cellClass:"text-center"},{name:"interval",cellClass:"text-center"},{name:"action",width:125,buttons:[{"class":"blue-hoki",href:"/channels/mail/accounts/view/{{row.entity.MailAccountId}}/actions/view/{{row.entity.id}}",name:"profile"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.app, row.entity.id)"}]}]};a.gridOptions=b.gridOptions(c,d,a,{accountId:f.accountId,controller:"applications"})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.mail.accounts.view.actions.list",{url:"/list",templateUrl:"app/channels/mail/account/view/action/list/list.html",controller:"MailAccountViewActionListCtrl"})}]),angular.module("xCallyShuttleApp").controller("MailAccountViewActionViewCtrl",["$scope","$http","$stateParams","$translate","$location","xAlert","WizardHandler","socket","application","interval","Agent","Interval","MailQueue",function(a,b,c,d,e,f,g,h,i,j,k,l,m){a.isActive=!0,a.size="small",a.animate=!0,a.radioOff=!0,a.handleWidth="auto",a.labelWidth="auto",a.inverse=!0,a.offColor="danger",a.onColor="success",a.initAction=function(){a.$application=i.application,a.$stateParams=c,a.$interval=j.interval,a.forms={},a.apps=[{name:"Queue",value:"queue"},{name:"Agent",value:"agent"}],b.get("/api/mail/applications/"+c.actionId).success(function(b){if(a.application=b,a.application.alwaysTime=!1,a.application.IntervalId)a.application.intType="list";else switch(a.application.interval){case"*,*,*,*":a.application.intType="always";break;default:a.application.intType="custom"}var c=a.application.interval.split(",");"*"===c[0]?a.application.alwaysTime=!0:(a.application.t_from=moment(new Date),a.application.t_to=moment(new Date),a.application.t_from.hour(c[0].split("-")[0].split(":")[0]),a.application.t_from.minute(c[0].split("-")[0].split(":")[1]),a.application.t_to.hour(c[0].split("-")[1].split(":")[0]),a.application.t_to.minute(c[0].split("-")[1].split(":")[1])),"*"===c[1]?(a.application.wd_from="always",a.application.wd_to="always"):(a.application.wd_from=c[1].split("-")[0],a.application.wd_to=c[1].split("-")[1]),"*"===c[2]?(a.application.md_from="always",a.application.md_to="always"):(a.application.md_from=c[2].split("-")[0],a.application.md_to=c[2].split("-")[1]),"*"===c[3]?(a.application.m_from="always",a.application.m_to="always"):(a.application.m_from=c[3].split("-")[0],a.application.m_to=c[3].split("-")[1]),a.$watch("application.t_from",function(b){a.application.t_from_hm=moment(b).format("HH:mm")}),a.$watch("application.t_to",function(b){a.application.t_to_hm=moment(b).format("HH:mm")})}).error(function(a){console.error(a)})},a.getQueues=function(){return m.get().$promise.then(function(b){a.queues=b.rows})["catch"](function(a){console.error(a)})},a.getAgents=function(){return k.get().$promise.then(function(b){a.agents=b.rows})["catch"](function(a){console.error(a)})},a.getIntervals=function(){return l.get().$promise.then(function(b){a.intervals=b.rows})["catch"](function(a){console.error(a)})},a.updateItem=function(){var e=["*","*","*","*"],g={app:a.application.app,timeout:a.application.timeout,MailAccountId:c.id};switch(a.application.app){case"agent":g.UserId=a.application.UserId;break;case"queue":g.MailQueueId=a.application.MailQueueId}switch(a.application.intType){case"always":g.interval=e.join(","),delete a.application.IntervalId;break;case"custom":a.application.alwaysTime||(e[0]=a.application.alwaysTime?"*":a.application.t_from_hm+"-"+a.application.t_to_hm),a.application.wd_from&&a.application.wd_to&&"always"===a.application.wd_from&&"always"===a.application.wd_to?e[1]="*":e[1]=a.application.wd_from&&a.application.wd_to?a.application.wd_from+"-"+a.application.wd_to:"*",a.application.md_from&&a.application.md_to&&"always"===a.application.md_from&&"always"===a.application.md_to?e[2]="*":e[2]=a.application.md_from&&a.application.md_to?a.application.md_from+"-"+a.application.md_to:"*",a.application.m_from&&a.application.m_to&&"always"===a.application.m_from&&"always"===a.application.m_to?e[3]="*":e[3]=a.application.m_from&&a.application.m_to?a.application.m_from+"-"+a.application.m_to:"*",g.interval=e.join(","),delete a.application.IntervalId;break;case"list":g.IntervalId=a.application.IntervalId}b.put("/api/mail/applications/"+c.actionId,g).success(function(){f.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){f.show(a.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.mail.accounts.view.actions.view",{url:"/view/:actionId",templateUrl:"app/channels/mail/account/view/action/view/view.html",controller:"MailAccountViewActionViewCtrl"})}]),angular.module("xCallyShuttleApp").controller("MailAccountViewActionWizardCtrl",["$scope","$http","Agent","MailQueue","Interval","$stateParams","$translate","$location","xAlert","WizardHandler","socket","application","interval",function(a,b,c,d,e,f,g,h,i,j,k,l,m){a.isActive=!0,a.size="small",a.animate=!0,a.radioOff=!0,a.handleWidth="auto",a.labelWidth="auto",a.inverse=!0,a.offColor="danger",a.onColor="success",a.initWizard=function(){a.apps=[{name:"Queue",value:"queue"},{name:"Agent",value:"agent"}],a.$application=l.application,a.$stateParams=f,a.$interval=m.interval,a.forms={},a.application={alwaysTime:!0},a.$watch("application.t_from",function(b){a.application.t_from_hm=moment(b).format("HH:mm")}),a.$watch("application.t_to",function(b){a.application.t_to_hm=moment(b).format("HH:mm")})},a.getQueues=function(){return d.get().$promise.then(function(b){a.queues=b.rows})["catch"](function(a){console.error(a)})},a.getAgents=function(){return c.get().$promise.then(function(b){a.agents=b.rows})["catch"](function(a){console.error(a)})},a.getIntervals=function(){return e.get().$promise.then(function(b){a.intervals=b.rows})["catch"](function(a){console.error(a)})},a.createItem=function(){var c=["*","*","*","*"],d={app:a.application.app,timeout:a.application.timeout,MailAccountId:f.accountId};switch(a.application.app){case"agent":d.UserId=a.application.UserId;break;case"queue":d.MailQueueId=a.application.MailQueueId}switch(a.application.intType){case"always":d.interval=c.join(","),delete a.application.IntervalId;break;case"custom":a.application.alwaysTime||(c[0]=a.application.alwaysTime?"*":a.application.t_from_hm+"-"+a.application.t_to_hm),a.application.wd_from&&a.application.wd_to&&"always"===a.application.wd_from&&"always"===a.application.wd_to?c[1]="*":c[1]=a.application.wd_from&&a.application.wd_to?a.application.wd_from+"-"+a.application.wd_to:"*",a.application.md_from&&a.application.md_to&&"always"===a.application.md_from&&"always"===a.application.md_to?c[2]="*":c[2]=a.application.md_from&&a.application.md_to?a.application.md_from+"-"+a.application.md_to:"*",a.application.m_from&&a.application.m_to&&"always"===a.application.m_from&&"always"===a.application.m_to?c[3]="*":c[3]=a.application.m_from&&a.application.m_to?a.application.m_from+"-"+a.application.m_to:"*",d.interval=c.join(","),delete a.application.IntervalId;break;case"list":d.IntervalId=a.application.IntervalId}b.post("/api/mail/applications",d).success(function(){h.path("/channels/mail/accounts/view/"+f.accountId+"/actions/list")}).error(function(a){console.error(a)})},a.formValidation=function(a){return a},a.next=function(){j.wizard().next()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.mail.accounts.view.actions.wizard",{url:"/wizard",templateUrl:"app/channels/mail/account/view/action/wizard/wizard.html",controller:"MailAccountViewActionWizardCtrl"})}]),angular.module("xCallyShuttleApp").controller("MailAccountViewCtrl",["$scope","$http","$stateParams","$translate","$location","$timeout","socket","xAlert","MailAccount","MailMessage","MailServerIn","MailServerOut","usSpinnerService",function(a,b,c,d,e,f,g,h,i,j,k,l,m){a.isActive=!0,a.size="small",a.animate=!0,a.radioOff=!0,a.handleWidth="auto",a.labelWidth="auto",a.inverse=!0,a.offColor="danger",a.onColor="success",a.CONST_TIMEOUT=3e4,a.$on("$destroy",function(){g.socket.removeAllListeners("mail_message:sent"),g.socket.removeAllListeners("mail_message:failed")}),a.initView=function(){return g.socket.on("mail_message:sent",function(){h.show(d.instant("MESSAGE_WELL_DONE"),"success"),m.stop("spinner-grid")}),g.socket.on("mail_message:failed",function(){h.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger"),m.stop("spinner-grid")}),i.get({id:c.accountId}).$promise.then(function(b){a.account=b})["catch"](function(a){h.show(a.message,"danger")})},a.updateItemMailAccount=function(){return i.update({id:c.accountId},{name:a.account.name,description:a.account.description,address:a.account.address,fidelity:a.account.fidelity,timeout:a.account.timeout}).$promise.then(function(){h.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){h.show(a.message,"danger")})},a.updateItemMailServerIn=function(){return k.update({id:a.account.MailServerIn.id},a.account.MailServerIn).$promise.then(function(){h.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){h.show(a.message,"danger")})},a.updateItemMailServerOut=function(){return l.update({id:a.account.MailServerOut.id},a.account.MailServerOut).$promise.then(function(){h.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){h.show(a.message,"danger")})},a.test=function(){return m.spin("spinner-grid"),l.test({id:a.account.MailServerOut.id,controller:"test"}).$promise["finally"](function(){f(function(){m.stop("spinner-grid")},a.CONST_TIMEOUT)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.mail.accounts.view",{url:"/view/:accountId",templateUrl:"app/channels/mail/account/view/view.html",controller:"MailAccountViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load({insertBefore:"#ng_load_plugins_before",files:["assets/css/profile.css","assets/css/tasks.css"]})}]}}).state("main.channels.mail.accounts.view.settings",{url:"/settings",templateUrl:"app/channels/mail/account/view/view.settings.html"})}]),angular.module("xCallyShuttleApp").controller("MailAccountWizardCtrl",["$scope","$http","$location","$translate","WizardHandler","xAlert","MailAccount",function(a,b,c,d,e,f,g){a.isActive=!0,a.size="small",a.animate=!0,a.radioOff=!0,a.handleWidth="auto",a.labelWidth="auto",a.inverse=!0,a.offColor="danger",a.onColor="success",a.initWizard=function(){a.forms={},a.item={MailServerIn:{port:993,ssl:!0,"delete":!1,protocol:"IMAP",filter:"UNSEEN",mailbox:"INBOX",keepalive:!0,authTimeout:5,connTimeout:10},MailServerOut:{port:465,ssl:!0}}},a.goNext=function(){e.wizard().next()},a.formValidation=function(a){return a},a.createItem=function(){return g.save(a.item).$promise.then(function(){c.path("/channels/mail/accounts/list")})["catch"](function(a){f.show(a.data.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.mail.accounts.wizard",{url:"/wizard",templateUrl:"app/channels/mail/account/wizard/wizard.html",controller:"MailAccountWizardCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.mail.inbox",{url:"/inbox",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("MailInboxListCtrl",["$scope","$rootScope","$uibModal","MailRoom","gridOptions","uiGridConstants","Auth",function(a,b,c,d,e,f,g){a.loadAgents=function(a){c.open({animation:!0,templateUrl:"app/channels/mail/inbox/view/view.agents.modal.html",controller:"MailInboxViewModalAgentCtrl",resolve:{roomId:a}})},a.initView=function(){var c={exporterCsvFilename:"mail_rooms.csv",enableRowHeaderSelection:g.isAdmin(),columnDefs:[{name:"id",displayName:"",cellClass:"text-center ui-grid-vcenter",cellTemplate:"<div><span>#{{row.entity.id}}</span></div>",width:75,enableSorting:!1,enableFiltering:!1},{name:"subject"},{name:"from",cellClass:"text-center"},{name:"MailAccount.name",displayName:"Account",cellClass:"text-center",enableSorting:!1,enableFiltering:!1},{name:"users",displayName:"APPLICATION_AGENTS",cellClass:"ui-grid-vcenter",cellTemplate:"<div>{{(row.entity.Users | map:'fullname').join(', ')}}</div>",enableSorting:!1,enableFiltering:!1},{name:"status",cellClass:"text-center ui-grid-vcenter",cellTemplate:"<div><span class=\"label label-sm\" data-ng-class=\"{'label-info': row.entity.status === 'OPEN', 'label-danger': row.entity.status === 'NEW','label-success': row.entity.status === 'CLOSED'}\">{{row.entity.status}}</span></div>",filter:{type:f.filter.SELECT,selectOptions:[{value:"NEW",label:"NEW"},{value:"OPEN",label:"OPEN"},{value:"CLOSED",label:"CLOSED"}]},width:100},{name:"createdAt",displayName:"",cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div><time is="relative-time" datetime="{{row.entity.createdAt}}">April 1, 2014</time></div>',enableSorting:!1,enableFiltering:!1,width:125},{name:"action",width:175,buttons:[{"class":"blue-hoki",href:"/channels/mail/inbox/view/{{row.entity.id}}/room",name:"open"},{"class":"green-meadow",href:"#",name:"agents",onClick:"grid.appScope.loadAgents(row.entity.id)"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.id, row.entity.id)",hide:!g.isAdmin()}]}]};a.gridOptions=e.gridOptions(d,c,a),b.$on("mailMessageEvent",function(){a.gridOptions.getPage()})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.mail.inbox.list",{url:"/list",templateUrl:"app/channels/mail/inbox/list/list.html",controller:"MailInboxListCtrl"})}]),angular.module("xCallyShuttleApp").directive("mail",function(){return{templateUrl:"app/channels/mail/inbox/mail/mail.html",restrict:"EA",scope:{mailMessage:"=message"}}}),angular.module("xCallyShuttleApp").directive("note",function(){return{templateUrl:"app/channels/mail/inbox/note/note.html",restrict:"EA",scope:{mailMessage:"=message"}}}),angular.module("xCallyShuttleApp").controller("MailInboxViewModalAgentCtrl",["$scope","$uibModalInstance","$translate","$stateParams","Agent","MailRoom","xAlert","roomId",function(a,b,c,d,e,f,g,h){console.log("roomId",h),a.initModal=function(){a.agents=[],a.item={agents:[]},e.get().$promise.then(function(b){b.rows.forEach(function(b){a.agents.push(b)})})["catch"](function(a){console.error(a)}),f.query({id:d.id||h,controller:"agents"}).$promise.then(function(b){b.forEach(function(b){a.agents.push(b),a.item.agents.push(b.id)})})["catch"](function(a){console.error(a)}),a.modal={dismissable:!0,title:"APPLICATION_MESSAGE_SEND_RETRY",text:"MESSAGE_MESSAGE_SEND_RETRY",buttons:[{classes:"btn btn-success",text:"APPLICATION_RETRY",click:function(a){b.close(a)}},{classes:"btn default",text:"APPLICATION_CANCEL",click:function(a){b.dismiss(a)}}]}},a.ok=function(){return f.update({id:d.id||h,controller:"agents",agents:a.item.agents}).$promise.then(function(){g.show(c.instant("MESSAGE_WELL_DONE"),"success"),b.close()})["catch"](function(a){console.error(a)})},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("MailInboxViewCtrl",["$scope","$location","$cookieStore","$stateParams","$translate","$uibModal","CannedAnswer","socket","Agent","MailAccount","MailRoom","MailAttachment","MailMessage","FileUploader","Auth","xAlert","usSpinnerService",function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q){var r,s=[];a.onSelectAnswer=function(b){a.form.html+=b,a.selectedAnswer=""},a.getAnswers=function(a){return g.get({key:a}).$promise.then(function(a){return _.map(a.rows,"value")})},a.initRoom=function(){a.Auth=o,a.config={autoHideScrollbar:!1,theme:"light",advanced:{updateOnContentResize:!0},setHeight:781,scrollInertia:0},a.forms={},a.selectedAnswer="",a.form={disabled:!1,from:[],to:[],sto:[],cc:[],scc:[],html:""},h.socket.on("mail_message:save",function(b){return a.mailRoom&&b.MailRoomId===d.id?m.get({id:b.id}).$promise.then(function(b){a.mailRoom.MailMessages.unshift(b)})["catch"](function(a){console.error(a)}):void 0}),r=a.uploader=new n({url:"api/mail/attachments",autoUpload:!0,withCredentials:!0,headers:{Authorization:"Bearer "+c.get("token")}}),r.removeFromQueue=function(a){var b=this;return l["delete"]({id:a.basename}).$promise.then(function(){var c=b.getIndexOfItem(a),d=b.queue[c];d.isUploading&&d.cancel(),b.queue.splice(c,1),d._destroy(),b.progress=b._getTotalProgress(),s=_.reject(s,{basename:a.basename})})["catch"](function(){p.show(e.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})},r.onErrorItem=function(){p.show(e.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")},r.onSuccessItem=function(a,b){var c={size:b.size,path:b.path,name:b.name,basename:b.basename,type:b.type};a=_.merge(a,c),s.push(c)},i.get().$promise.then(function(b){a.agents=b.rows})["catch"](function(a){console.error(a)}),j.get().$promise.then(function(b){a.mailAccounts=b.rows})["catch"](function(a){console.error(a)}),d.id&&k.get({id:d.id}).$promise.then(function(b){a.mailRoom=b,a.form.from.push(b.MailAccount.address);var c=_.last(a.mailRoom.MailMessages);a.form.to=a.form.cc=a.form.bcc=_.union(c.from,c.to,c.cc,c.bcc),a.form.sto=_.remove(a.form.to,function(a){return a!==b.MailAccount.address}),"NEW"===a.mailRoom.status&&k.update({id:d.id},{status:"OPEN"})})["catch"](function(a){console.error(a)})},a.cancel=function(){a.form.disabled=!1,a.form.from=[],a.form.to=[],a.form.sto=[],a.form.cc=[],a.form.scc=[],delete a.form.subject,delete a.form.html},a.updateStatus=function(a){return k.update({id:d.id},{status:a}).$promise.then(function(){p.show(e.instant("MESSAGE_STATUS_UPDATE_SUCCESS"),"success"),b.path("/channels/mail/inbox/list")})["catch"](function(a){p.show(a.message,"danger")})},a.loadAgents=function(){f.open({animation:!0,templateUrl:"app/channels/mail/inbox/view/view.agents.modal.html",controller:"MailInboxViewModalAgentCtrl"})},a.loadTemplate=function(){f.open({animation:!0,templateUrl:"app/channels/mail/inbox/view/view.templates.modal.html",controller:"MailInboxViewModalTemplateCtrl"}).result.then(function(b){a.form.subject=b.template.subject,a.form.html=b.template.html})},a.loadNote=function(){f.open({animation:!0,templateUrl:"app/channels/mail/inbox/view/view.notes.modal.html",controller:"MailInboxViewModalNoteCtrl"})},a.sendMail=function(){var c={},f={subject:a.mailRoom?a.mailRoom.subject:a.form.subject,from:a.form.from,to:a.form.sto||[],cc:a.form.scc||[],html:a.form.html||null,text:a.form.text||null,inReplyTo:c.messageId||null,status:"SENDING",MailAttachments:s};return q.spin("spinner-grid"),a.form.disabled=!0,a.mailRoom?(c=_.last(a.mailRoom.MailMessages,{status:"RECEIVED"}),f.inReplyTo=c.messageId||null,k.save({id:d.id,controller:"messages"},f).$promise.then(function(){p.show(e.instant("MESSAGE_WELL_DONE"),"success"),b.path("/channels/mail/inbox/list")})["catch"](function(){p.show(e.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})["finally"](function(){q.stop("spinner-grid"),a.form.disabled=!1})):m.save(f).$promise.then(function(){p.show(e.instant("MESSAGE_MAIL_MESSAGE_SEND_SUCCESS"),"success"),b.path("/channels/mail/inbox/list")})["catch"](function(){p.show(e.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})["finally"](function(){q.stop("spinner-grid"),a.form.disabled=!1})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.mail.inbox.view",{url:"/view",templateUrl:"app/channels/mail/inbox/view/view.html"}).state("main.channels.mail.inbox.view.compose",{url:"/compose",templateUrl:"app/channels/mail/inbox/view/view.room.html",controller:"MailInboxViewCtrl"}).state("main.channels.mail.inbox.view.room",{url:"/:id/room",templateUrl:"app/channels/mail/inbox/view/view.room.html",controller:"MailInboxViewCtrl"})}]),angular.module("xCallyShuttleApp").controller("MailInboxViewModalNoteCtrl",["$scope","$uibModalInstance","$stateParams","$translate","MailRoom","xAlert",function(a,b,c,d,e,f){a.initModal=function(){a.item={}},a.ok=function(){return e.save({id:c.id,controller:"messages"},{text:a.item.text,status:"NOTE"}).$promise.then(function(){f.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(){f.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})["finally"](function(){b.close()})},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("MailInboxViewModalTemplateCtrl",["$scope","$uibModalInstance","Template",function(a,b,c){a.initModal=function(){return a.item={},c.get().$promise.then(function(b){a.templates=b.rows})["catch"](function(a){console.error(a)})},a.ok=function(){b.close(a.item)},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.mail",{url:"/mail",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").factory("MailAttachment",["$resource",function(a){return a("/api/mail/attachments/:id/:controller",{id:"@id"})}]),angular.module("xCallyShuttleApp").factory("MailMessage",["$resource",function(a){return a("/api/mail/messages/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").factory("MailReport",["$resource",function(a){return a("/api/report/mails/:id/:controller1/:controller2",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").factory("MailRoom",["$resource",function(a){return a("/api/mail/rooms/:id/:controller",{id:"@id",controller:"@controller"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").controller("MailQueueListCtrl",["$scope","MailQueue","gridOptions","$uibModal","xAlert",function(a,b,c,d,e){a.initView=function(){var d={exporterCsvFilename:"voice_queues.csv",columnDefs:[{name:"name"},{name:"description"},{name:"timeout"},{name:"strategy"},{name:"action",width:125,buttons:[{"class":"blue-hoki",href:"/channels/mail/queues/view/{{row.entity.id}}/settings",name:"profile"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=c.gridOptions(b,d,a)},a.createItem=function(){var b=d.open({animation:!0,templateUrl:"app/channels/mail/queue/list/list.create.modal.html",controller:"MailQueueListCreateCtrl"});b.result.then(function(b){console.log(b),a.gridOptions.getPage()})}}]),angular.module("xCallyShuttleApp").controller("MailQueueListCreateCtrl",["$scope","$uibModalInstance","$translate","xAlert","MailQueue",function(a,b,c,d,e){a.form={},a.item={},a.save=function(){return e.save(a.item).$promise.then(function(a){b.close(a)})["catch"](function(a){d.show(a.data.message,"danger")})},a.cancel=function(){b.dismiss()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.mail.queues.list",{url:"/list",templateUrl:"app/channels/mail/queue/list/list.html",controller:"MailQueueListCtrl"})}]),angular.module("xCallyShuttleApp").factory("MailQueue",["$resource",function(a){return a("/api/mail/queues/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.mail.queues",{url:"/queues",template:"<div ui-view></div>","abstract":!0,resolve:{deps:["$ocLazyLoad",function(a){return a.load({insertBefore:"#ng_load_plugins_before",files:["assets/plugins/jquery-multi-select/css/multi-select.css","assets/plugins/jquery-multi-select/js/jquery.multi-select.js","assets/scripts/components-dropdowns.js"]})}]},data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").controller("MailQueueViewCtrl",["$scope","$http","$translate","$stateParams","xAlert","Team","MailQueue",function(a,b,c,d,e,f,g){var h=function(){return{select:function(b){return g.save({id:a.queue.id,controller:"agents"},{agents:b,penalty:a.queue.penalty}).$promise.then(function(){a.getTeams()})["catch"](function(a){console.error(a)})},deselect:function(b){return g["delete"]({id:a.queue.id,controller:"agents",agents:b}).$promise.then(function(){a.getTeams()})["catch"](function(a){console.error(a)})}}};a.getQueue=function(){return g.get({id:d.id}).$promise.then(function(b){b.penalty=0,a.queue=b})["catch"](function(a){console.error(a)})},a.updateMailQueue=function(){return g.update({id:d.id},{name:a.queue.name,description:a.queue.description,timeout:a.queue.timeout,strategy:a.queue.strategy}).$promise.then(function(){e.show(c.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){e.show(a.data.message,"danger")})},a.getTeams=function(){return f.get().$promise.then(function(b){return a.teams=b.rows,g.query({id:d.id,controller:"agents"}).$promise}).then(function(b){ComponentsDropdowns.bindMailQueue(a.teams,_.map(b,function(a){return{id:a.id,penalty:a.UserHasMailQueue.penalty}}),h)})["catch"](function(a){console.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.mail.queues.view",{url:"/view/:id",templateUrl:"app/channels/mail/queue/view/view.html",
+controller:"MailQueueViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.channels.mail.queues.view.settings",{url:"/settings",templateUrl:"app/channels/mail/queue/view/view.settings.html"}).state("main.channels.mail.queues.view.agents",{url:"/agents",templateUrl:"app/channels/mail/queue/view/view.agents.html",cache:!1,serie:!0,resolve:{deps:["$ocLazyLoad",function(a){return a.load({insertBefore:"#ng_load_plugins_before",files:["assets/plugins/jquery-multi-select/css/multi-select.css","assets/plugins/jquery-multi-select/js/jquery.multi-select.js","assets/plugins/jquery-quicksearch/jquery.quicksearch.js","assets/scripts/components-dropdowns.js"]})}]}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.mail.realtime",{url:"/realtime",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").controller("MailRealtimeViewAgentCtrl",["$scope","$log","$uibModal","$translate","socket","xAlert","Agent","Pause","Action","MailQueue","usSpinnerService","$q","uiGridConstants",function(a,b,c,d,e,f,g,h,i,j,k,l,m){function n(){return k.spin("spinner-grid"),g.get(s).$promise.then(function(b){a.gridOptions.totalItems=b.count,a.gridOptions.data=[],b.rows.forEach(function(a){p(a)})})["catch"](function(a){f.show(a.message,"danger")})["finally"](function(){k.stop("spinner-grid")})}function o(){e.socket.on("agent:save",function(b){var c=_.find(a.gridOptions.data,{agentId:b.id,isAgent:!0});if(c){var d=a.gridOptions.data.indexOf(c);a.gridOptions.data[d].online=b.online,a.gridOptions.data[d].lastLoginAt=b.lastLoginAt,a.gridOptions.data[d].pause=b.mailPause,a.gridOptions.data[d].pauseType=b.pauseType,a.gridOptions.data[d].lastPauseAt=b.lastPauseAt,a.gridOptions.data[d].ipaddr=b.ipaddr,a.gridOptions.data[d].port=b.port,a.gridOptions.data[d].fullcontact=b.fullcontact,a.gridOptions.data[d].useragent=b.useragent,a.gridOptions.data[d].lastms=b.lastms,a.gridOptions.data[d].internal=b.internal,_.map(a.gridOptions.data,function(a){a.isAgent||a.agentId!==b.id||(a.online=b.online)})}}),e.socket.on("agent:remove",function(b){_.remove(a.gridOptions.data,{agentId:b.id})}),e.socket.on("user_has_mail_queue:save",function(b){console.log("new queue",b);var c=_.find(a.gridOptions.data,{agentId:b.UserId,isAgent:!0}),d=a.gridOptions.data.indexOf(c);a.gridOptions.data.splice(d+1,0,{isAgent:!1,agentId:b.UserId,queue:b.queue,queueId:b.MailQueueId,agent:b.membername,online:c.online})}),e.socket.on("user_has_mail_queue:remove",function(b){_.remove(a.gridOptions.data,{agentId:b.UserId,queueId:b.MailQueueId})})}function p(b){a.gridOptions.data.push({isAgent:!0,agentId:b.id,agent:b.name,online:b.online,lastLoginAt:b.lastLoginAt,lastPauseAt:b.lastPauseAt,pause:b.mailPause,pauseType:b.pauseType,ipaddr:b.ipaddr,port:b.port,fullcontact:b.fullcontact,useragent:b.useragent,lastms:b.lastms,internal:b.internal,$$treeLevel:0}),b.MailQueues.forEach(function(c){a.gridOptions.data.push({isAgent:!1,agentId:b.id,queue:c.name,queueId:c.id,agent:b.name,online:b.online})})}function q(){return h.get().$promise.then(function(b){a.pauses=b.rows,e.syncUpdates("pause",a.pauses)})["catch"](function(a){f.show(a.message,"danger")})}function r(){return j.get().$promise.then(function(b){a.mailQueues=b.rows,e.syncUpdates("mail_queue",a.mailQueues)})["catch"](function(a){f.show(a.message,"danger")})}a.mailQueues=[];var s={offset:0,limit:10};a.moment=moment,a.initAgents=function(){a.gridOptions={enableGridMenu:!0,headerCellFilter:"translate",enableHorizontalScrollbar:0,enableVerticalScrollbar:0,enableFiltering:!0,showGridFooter:!0,paginationPageSizes:[10,25,50,75],paginationPageSize:10,useExternalPagination:!0,useExternalSorting:!0,useExternalFiltering:!0,multiSelect:!0,showTreeExpandNoChildren:!0,columnDefs:[{name:"name",displayName:"APPLICATION_AGENT",headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div data-ng-if="row.entity.isAgent">{{row.entity.agent}} &lt;{{row.entity.internal}}&gt;</div>'},{name:"online",displayName:"APPLICATION_ONLINE",width:150,headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div data-ng-if="row.entity.online != null && row.entity.isAgent"><i class="icon-user" data-ng-class="row.entity.online ? \'font-green\' : \'font-red\'"></i> <span data-ng-if="row.entity.online" class="left-margin">(<timer start-time="grid.appScope.moment(row.entity.lastLoginAt).unix()*1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>)</span></div>',filter:{type:m.filter.SELECT,selectOptions:[{value:"true",label:"ONLINE"},{value:"false",label:"OFFLINE"}]}},{name:"mailPause",width:300,displayName:"APPLICATION_PAUSE",headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div data-ng-if="row.entity.pause != null && row.entity.online" class="ui-grid-vcenter" data-ng-class="{\'paused-agent\':row.entity.pause}"><timer data-ng-if="row.entity.pause" start-time="grid.appScope.moment(row.entity.lastPauseAt).unix()*1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer></span><span data-ng-if="row.entity.pause" class="left-margin">({{row.entity.pauseType}})</span><i data-ng-if="row.entity.pause" data-ng-click="grid.appScope.pause(row.entity.agentId,\'unpause\')" class="icon-control-play font-green pointer-cursor left-margin" title="{{\'APPLICATION_RESUME\' | translate}}"></i><i class="icon-control-pause font-yellow pointer-cursor" data-ng-click="grid.appScope.pause(row.entity.agentId,\'pause\',\'DEFAULT PAUSE\')" title="{{\'APPLICATION_DEFAULT_PAUSE\' | translate}}"></i><select data-ng-if="grid.appScope.pauses.length" class="pause-select pointer-cursor" data-ng-model="grid.appScope.pauseType" data-ng-change="grid.appScope.pause(row.entity.agentId,\'pause\',grid.appScope.pauseType)"><option class="pointer-cursor" data-ng-repeat="pause in grid.appScope.pauses">{{pause.name}}</option></select></div>',filter:{type:m.filter.SELECT,selectOptions:[{value:"true",label:"PAUSED"},{value:"false",label:"NOT PAUSED"}]},enableSorting:!1,enableColumnMenu:!1},{name:"queue",displayName:"APPLICATION_QUEUE",headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",enableSorting:!1,enableFiltering:!1,enableColumnMenu:!1},{name:"action",displayName:"",width:170,cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div><button data-ng-if="row.entity.queueId" class="btn btn-xs red-sunglo" data-ng-click="grid.appScope.leaveQueue(row.entity.agentId,row.entity.queueId)"><i class="icon-ban"></i> {{\'APPLICATION_LEAVE\' | translate}}</button><button data-ng-if="row.entity.isAgent && row.treeNode.children.length < grid.appScope.mailQueues.length" class="btn btn-xs blue-hoki" data-ng-click="grid.appScope.joinQueue(row.entity.agentId)"><i class="icon-plus"></i> {{\'APPLICATION_JOIN_QUEUE\' | translate}}</button> <button data-ng-if="row.entity.isAgent" class="btn btn-xs blue-madison" data-ng-click="grid.appScope.showInfo(row.entity)"><i class="icon-info"></i> {{\'APPLICATION_INFO\' | translate}}</button><div>',enableSorting:!1,enableFiltering:!1,enableColumnMenu:!1}],data:[],gridMenuTitleFilter:function(a){var b=l.defer();return b.resolve(d.instant(a)),b.promise},onRegisterApi:function(b){a.gridApi=b,a.gridApi.grid.registerDataChangeCallback(function(){t(a.gridApi.core.getVisibleRows(a.gridApi.grid).length)}),a.gridApi.treeBase.on.rowExpanded(a,function(b){t(a.gridApi.core.getVisibleRows(a.gridApi.grid).length+b.treeNode.children.length)}),a.gridApi.treeBase.on.rowCollapsed(a,function(b){t(a.gridApi.core.getVisibleRows(a.gridApi.grid).length-b.treeNode.children.length)}),a.gridApi.core.on.sortChanged(a,function(a,b){0===b.length?s.order=null:s.order=b[0].name+" "+b[0].sort.direction.toUpperCase(),n()}),a.gridApi.pagination.on.paginationChanged(a,function(a,b){s.offset=(a-1)*b,s.limit=b,n()}),a.gridApi.core.on.filterChanged(a,function(){var a=this.grid;a.columns.forEach(function(a){a.filters[0].term?s[a.name]=a.filters[0].term:delete s[a.name]}),n()})}},n(),q(),r(),o()};var t=function(a){var b=a?30*a+130:270;angular.element(document.getElementsByClassName("ui-grid")[0]).css("height",b+"px"),angular.element(document.getElementsByClassName("ui-grid-viewport")).css("height",30*a+"px")};a.$on("$destroy",function(){e.unsyncUpdates("agent"),e.unsyncUpdates("user_has_mail_queue")}),a.pause=function(a,b,c){return i.save({name:b,agent:a,type:c||"DEFAULT PAUSE",data4:c||"DEFAULT PAUSE",channel:"mail"}).$promise.then(function(){f.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){f.show(a.message,"danger")})},a.joinQueue=function(e){var g=c.open({animation:!0,templateUrl:"app/channels/mail/realtime/view/agent/queue.modal.add.html",controller:"MailRealtimeViewAgentQueueModalCtrl",resolve:{queues:function(){return _.reject(a.mailQueues,function(b){return _.find(a.gridOptions.data,{queue:b.name,isAgent:!1,agentId:e})?!0:!1})}}});g.result.then(function(b){return i.save({name:"QueueAdd",agent:e,queues:_.filter(a.mailQueues,function(a){return _.includes(b.queues,a.id)}),channel:"mail",data1:e,data3:b.queues.join(","),data4:"mail"}).$promise.then(function(){f.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){f.show(a.message,"danger")})},function(){b.info("Modal dismissed at: "+new Date)})},a.leaveQueue=function(a,b){return i.save({name:"QueueRemove",agent:a,queueId:b,channel:"mail",data1:a,data3:b,data4:"mail"}).$promise.then(function(){f.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){f.show(a.message,"danger")})},a.showInfo=function(a){c.open({animation:!0,templateUrl:"app/channels/mail/realtime/view/agent/agent.modal.info.html",controller:"MailRealtimeViewAgentInfoModalCtrl",resolve:{agent:a}})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.mail.realtime.view.agents",{url:"/agents",templateUrl:"app/channels/mail/realtime/view/agent/agent.html",controller:"MailRealtimeViewAgentCtrl"})}]),angular.module("xCallyShuttleApp").controller("MailRealtimeViewAgentInfoModalCtrl",["$scope","$uibModalInstance","$http","agent",function(a,b,c,d){a.agent=d,a.close=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("MailRealtimeViewAgentQueueModalCtrl",["$scope","$uibModalInstance","$http","queues",function(a,b,c,d){a.queues=d,a.item={},a.save=function(){b.close(a.item)},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("MailRealtimeViewQueueCtrl",["$scope","$http","socket","MailQueue","Agent",function(a,b,c,d,e){a.initQueues=function(){a.gridOptions={enableSorting:!1,enableFiltering:!0,enableHorizontalScrollbar:0,enableVerticalScrollbar:0,showTreeExpandNoChildren:!1,columnDefs:[{name:"queueName",displayName:"Queue"},{name:"fullname",displayName:"Agent",cellClass:"text-center"},{name:"online",cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div><i data-ng-if="row.entity.online != null" class="icon-user" data-ng-class="row.entity.online ? \'font-green\' : \'font-red\'"></i></div>'},{name:"chatPause",cellClass:"text-center ui-grid-vcenter",cellTemplate:"<div><i data-ng-if=\"row.entity.mailPause != null\" data-ng-class=\"row.entity.mailPause ? 'icon-control-pause font-red' : 'icon-control-play font-green'\"></i></div>"},{name:"pauseType",cellClass:"text-center",cellTemplate:'<span data-ng-if="row.entity.mailPause">{{row.entity.pauseType}}</span>'},{name:"lastLoginAt",cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div><time data-ng-if="row.entity.agentName" is="relative-time" datetime="{{row.entity.lastLoginAt}}">April 1, 2014</time></div>'}],onRegisterApi:function(b){a.gridApi=b,a.gridApi.treeBase.on.rowExpanded(a,function(b){var c=_.findIndex(a.gridOptions.data,{$$hashKey:b.entity.$$hashKey});b.entity.Users&&b.entity.Users.forEach(function(b){_.find(a.gridOptions.data,{name:b.name})||a.gridOptions.data.splice(c+1,0,b)})})}},d.get(function(b){a.gridOptions.data=[],b.rows.forEach(function(b){b.$$treeLevel=0,b.queueName=b.name,a.gridOptions.data.push(b),b.Users&&b.Users.forEach(function(b){b.agentName=b.name,a.gridOptions.data.push(b)})}),c.socket.on("agent:save",function(b){var c=_.filter(a.gridOptions.data,{agentName:b.name});c.forEach(function(a){a.online=b.online,a.lastLoginAt=b.lastLoginAt})}),c.socket.on("mail_queue:save",function(b){b.$$treeLevel=0,b.queueName=b.name,a.gridOptions.data.push(b)}),c.socket.on("mail_queue:remove",function(b){_.remov(a.gridOptions.data,{queueName:b.name})}),c.socket.on("user_has_mail_queue:save",function(b){var c=_.findIndex(a.gridOptions.data,function(a){return a.queueName&&a.id===b.MailQueueId});e.get({id:b.UserId}).$promise.then(function(b){a.gridOptions.data.splice(c+1,0,{id:b.id,name:b.name,fullname:b.fullname,agentName:b.name,online:b.online,lastLoginAt:b.lastLoginAt})})["catch"](function(a){console.error(a)})}),c.socket.on("user_has_mail_queue:remove",function(b){for(var c=_.findIndex(a.gridOptions.data,function(a){return a.queueName&&a.id===b.MailQueueId}),d=c+1;d<a.gridOptions.data.length;d++)a.gridOptions.data[d].id==b.UserId&&a.gridOptions.data.splice(d,1)})},function(a){console.error(a)})},a.conf={agentsByPage:{name:"10",value:10},labels:["fullname","name","email"]},a.agentsByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.$on("$destroy",function(){c.unsyncUpdates("report_mail:save"),c.unsyncUpdates("report_mail:update")}),a.initAgents=function(){b.get("/api/report/mails").success(function(b){a.agents=b,c.socket.on("report_mail:save",function(b){var c=_.find(a.agents,{id:b.id});c||a.agents.unshift(b)}),c.socket.on("report_mail:update",function(b){var c=_.find(a.agents,{id:b.id}),d=a.agents.indexOf(c);c&&_.merge(a.agents[d],b)})}).error(function(a){console.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.mail.realtime.view.queues",{url:"/queues",templateUrl:"app/channels/mail/realtime/view/queue/queue.html",controller:"MailRealtimeViewQueueCtrl"})}]),angular.module("xCallyShuttleApp").controller("MailRealtimeViewSessionCtrl",["$scope","$http","socket","uiGridConstants",function(a,b,c,d){a.initSessions=function(){a.gridOptions={enableHorizontalScrollbar:0,enableVerticalScrollbar:0,columnDefs:[{name:"uniqueid",displayName:"",cellClass:"text-center",width:150,enableSorting:!1,enableFiltering:!0},{name:"application",displayName:"APPLICATION_APP",headerCellFilter:"translate",cellClass:"text-center"},{name:"queuename",displayName:"APPLICATION_QUEUE",headerCellFilter:"translate",cellClass:"text-center"},{name:"agentname",cellClass:"text-center"},{name:"accountname",displayName:"APPLICATION_ACCOUNT",headerCellFilter:"translate"},{name:"joinAt",displayName:"joinAt",cellClass:"text-center",cellTemplate:'<time data-ng-if="row.entity.joinAt" is="relative-time" datetime="{{row.entity.joinAt}}">April 1, 2014</time>',sort:{direction:d.DESC,priority:1}},{name:"leaveAt",displayName:"leaveAt",cellClass:"text-center",cellTemplate:'<time data-ng-if="row.entity.leaveAt" is="relative-time" datetime="{{row.entity.leaveAt}}">April 1, 2014</time>'},{name:"unmanagedAt",displayName:"unmanangedAt",cellClass:"text-center",cellTemplate:'<time data-ng-if="row.entity.unmanagedAt" is="relative-time" datetime="{{row.entity.unmanagedAt}}">April 1, 2014</time>'}],data:[]},b.get("/api/report/mail/sessions").success(function(b){a.gridOptions.data=b.rows,c.socket.on("report_mail_session:save",function(b){var c=_.find(a.gridOptions.data,{id:b.id}),d=a.gridOptions.data.indexOf(c);c?_.merge(a.gridOptions.data[d],b):a.gridOptions.data.unshift(b)})}).error(function(a){console.error(a)})},a.$on("$destroy",function(){c.unsyncUpdates("report_mail:save"),c.unsyncUpdates("report_mail:update")})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.mail.realtime.view.sessions",{url:"/sessions",templateUrl:"app/channels/mail/realtime/view/session/session.html",controller:"MailRealtimeViewSessionCtrl"})}]),angular.module("xCallyShuttleApp").controller("MailRealtimeViewCtrl",["$scope","$state",function(a,b){a.agents=[{name:"Queues",link:"main.channels.mail.realtime.view.agents.queues"},{name:"Timeline",link:"main.channels.mail.realtime.view.agents.timeline"}],a.sessions=[{name:"Sessions",link:"main.channels.mail.realtime.view.sessions"}],a.tree={queues:[{name:"Queues",link:"main.channels.mail.realtime.view.agents.queues"},{name:"Timeline",link:"main.channels.mail.realtime.view.agents.timeline"}],sessions:[{name:"Sessions",link:"main.channels.mail.realtime.view.sessions"}]}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.mail.realtime.view",{url:"/view",templateUrl:"app/channels/mail/realtime/view/view.html",controller:"MailRealtimeViewCtrl"})}]),angular.module("xCallyShuttleApp").factory("ReportCall",["$resource",function(a){return a("/api/report/calls/:id/:controller",{name:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").factory("ChanSpy",["$resource",function(a){return a("/api/chanspy/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.chanspy",{url:"/chanspy",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("ChanSpyListCtrl",["$scope","$uibModal","ChanSpy","gridOptions",function(a,b,c,d){a.initView=function(){var b={exporterCsvFilename:"chanspy.csv",columnDefs:[{name:"name"},{name:"description"},{name:"action",width:160,buttons:[{"class":"blue-hoki",href:"/channels/voice/chanspy/view/{{row.entity.id}}/settings",name:"settings"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=d.gridOptions(c,b,a)},a.createItem=function(){var c=b.open({animation:!0,templateUrl:"app/channels/voice/chanspy/list/list.create.modal.html",controller:"ChanSpyListCreateCtrl"});c.result.then(function(b){a.gridOptions.getPage()})}}]),angular.module("xCallyShuttleApp").controller("ChanSpyListCreateCtrl",["$scope","$translate","$uibModalInstance","ChanSpy","xAlert",function(a,b,c,d,e){a.form={},a.item={},a.recordSwitch={onText:"On",offText:"Off",isActive:!0,size:"small",animate:!0,radioOff:!0,handleWidth:"auto",labelWidth:"auto",inverse:!0,offColor:"danger",onColor:"success"},a.options=[{name:"APPLICATION_CHANSPY_OPTION_b",value:"b"},{name:"APPLICATION_CHANSPY_OPTION_B",value:"B"},{name:"APPLICATION_CHANSPY_OPTION_E",value:"E"},{name:"APPLICATION_CHANSPY_OPTION_o",value:"o"},{name:"APPLICATION_CHANSPY_OPTION_q",value:"q"},{name:"APPLICATION_CHANSPY_OPTION_s",value:"s"},{name:"APPLICATION_CHANSPY_OPTION_S",value:"S"},{name:"APPLICATION_CHANSPY_OPTION_w",value:"w"},{name:"APPLICATION_CHANSPY_OPTION_W",value:"W"}],a.save=function(){return a.item.options=a.item.options.join(""),d.save(a.item).$promise.then(function(a){e.show(b.instant("MESSAGE_WELL_DONE"),"success"),c.close(a)})["catch"](function(a){e.show(a.data.message,"danger")})},a.cancel=function(){c.dismiss()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.chanspy.list",{url:"/list",templateUrl:"app/channels/voice/chanspy/list/list.html",controller:"ChanSpyListCtrl"})}]),angular.module("xCallyShuttleApp").controller("ChanSpyViewCtrl",["$scope","$translate","$stateParams","xAlert","ChanSpy",function(a,b,c,d,e){a.recordSwitch={onText:"On",offText:"Off",isActive:!0,size:"small",animate:!0,radioOff:!0,handleWidth:"auto",labelWidth:"auto",inverse:!0,offColor:"danger",onColor:"success"},a.options=[{name:"APPLICATION_CHANSPY_OPTION_b",value:"b"},{name:"APPLICATION_CHANSPY_OPTION_B",value:"B"},{name:"APPLICATION_CHANSPY_OPTION_E",value:"E"},{name:"APPLICATION_CHANSPY_OPTION_o",value:"o"},{name:"APPLICATION_CHANSPY_OPTION_q",value:"q"},{name:"APPLICATION_CHANSPY_OPTION_s",value:"s"},{name:"APPLICATION_CHANSPY_OPTION_S",value:"S"},{name:"APPLICATION_CHANSPY_OPTION_w",value:"w"},{name:"APPLICATION_CHANSPY_OPTION_W",value:"W"}],a.getChanSpy=function(){return e.get({id:c.id}).$promise.then(function(b){b.options=b.options.split(""),a.chanspy=b})["catch"](function(a){d.show(a.data.message,"danger")})},a.updateChanSpy=function(){var f=angular.copy(a.chanspy);return f.options=f.options.join(""),e.update({id:c.id},f).$promise.then(function(){d.show(b.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){d.show(a.data.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.chanspy.view",{url:"/view/:id",templateUrl:"app/channels/voice/chanspy/view/view.html",controller:"ChanSpyViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.channels.voice.chanspy.view.settings",{url:"/settings",templateUrl:"app/channels/voice/chanspy/view/view.settings.html"})}]),angular.module("xCallyShuttleApp").factory("VoiceContext",["$resource",function(a){return a("/api/voice/contexts/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.contexts",{url:"/contexts",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("VoiceContextListCtrl",["$scope","VoiceContext","gridOptions","$uibModal","xAlert","$translate",function(a,b,c,d,e,f){a.initView=function(){var d={exporterCsvFilename:"voice_contexts.csv",columnDefs:[{name:"name"},{name:"description"},{name:"action",width:170,buttons:[{"class":"{{row.entity.defaultEntry ? 'blue-hoki disabled' : 'blue-hoki'}}",href:"/channels/voice/contexts/view/{{row.entity.id}}/settings",name:"settings"},{"class":"{{row.entity.defaultEntry ? 'red-sunglo disabled' : 'red-sunglo'}}",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=c.gridOptions(b,d,a)},a.createItem=function(){var c=d.open({animation:!0,templateUrl:"app/channels/voice/context/list/create.modal.html",controller:["$scope","$uibModalInstance",function(a,b){a.form={},a.item={},a.ok=function(){b.close(a.item)},a.cancel=function(){b.dismiss("cancel")}}]});c.result.then(function(c){return b.save(c).$promise.then(function(){a.gridOptions.getPage(),e.show(f.instant("MESSAGE_WELL_DONE")+"!","success")})["catch"](function(a){e.show(a.data.message,"danger")})})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.contexts.list",{url:"/list",templateUrl:"app/channels/voice/context/list/list.html",controller:"VoiceContextListCtrl"})}]),angular.module("xCallyShuttleApp").controller("VoiceContextViewCtrl",["$scope","$http","xAlert","$translate","$stateParams","$location",function(a,b,c,d,e,f){a.getContext=function(){b.get("/api/voice/contexts/"+e.id).success(function(b){a.context=b}).error(function(a){console.error(a),f.path("/voice/contexts/list")})},a.updateVoiceContext=function(){var f=angular.copy(a.context);b.put("/api/voice/contexts/"+e.id,f).success(function(){c.show(d.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(b){c.show(d.instant(b.message),"danger"),a.context=f})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.contexts.view",{url:"/view/:id",templateUrl:"app/channels/voice/context/view/view.html",controller:"VoiceContextViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.channels.voice.contexts.view.settings",{url:"/settings",templateUrl:"app/channels/voice/context/view/view.settings.html"})}]),angular.module("xCallyShuttleApp").controller("VoiceMohListCtrl",["$scope","gridOptions","VoiceMoh","$uibModal","xAlert","$translate",function(a,b,c,d,e,f){a.initView=function(){var d={exporterCsvFilename:"voice_mohs.csv",columnDefs:[{name:"name"},{name:"directory"},{name:"sort"},{name:"description"},{name:"action",width:125,buttons:[{"class":"blue-hoki",href:"/channels/voice/mohs/view/{{row.entity.id}}/settings",name:"settings"},{"class":"{{row.entity.defaultEntry ? 'red-sunglo disabled' : 'red-sunglo'}}",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=b.gridOptions(c,d,a)},a.createItem=function(){var b=d.open({animation:!0,templateUrl:"app/channels/voice/moh/list/create.modal.html",controller:["$scope","$uibModalInstance",function(a,b){a.form={},a.item={},a.ok=function(){b.close(a.item)},a.cancel=function(){b.dismiss("cancel")}}]});b.result.then(function(b){return c.save(b).$promise.then(function(){a.gridOptions.getPage(),e.show(f.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){e.show(a.data.message,"danger")})})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.mohs.list",{url:"/list",templateUrl:"app/channels/voice/moh/list/list.html",controller:"VoiceMohListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").factory("VoiceMoh",["$resource",function(a){return a("/api/voice/musiconholds/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.mohs",{url:"/mohs",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("VoiceMohViewCtrl",["$scope","$http","xAlert","$translate","VoiceMoh","$stateParams","socket","Modal","$sce","$location","Sound",function(a,b,c,d,e,f,g,h,i,j,k){a.$translate=d,a.audioSources={},a.sortOptions=[{value:"random",name:"APPLICATION_RANDOM"},{value:"alpha",name:"APPLICATION_ALPHABETICAL"}],a.getMoh=function(){return e.get({id:f.id}).$promise.then(function(b){delete b.stamp,a.moh=b})["catch"](function(a){c.show(a.message,"danger")})},a.updateVoiceMoh=function(){return console.log("update"),e.update({id:f.id},a.moh).$promise.then(function(){c.show(d.instant("MESSAGE_WELL_DONE")+"!","success")})["catch"](function(a){c.show(a.message,"danger")})},a.addMohs=function(){return e.save({id:f.id,controller:"files"},a.item).$promise.then(function(){j.path("/channels/voice/mohs/view/"+f.id+"/audios")})["catch"](function(a){c.show(a.message,"danger")})},a.getAudioFiles=function(){return e.get({id:f.id,controller:"files"}).$promise.then(function(b){a.audioFiles=b.files,a.mohPath=b.path,a.audioFiles.forEach(function(a){l(a)})})["catch"](function(a){c.show(a.message,"danger")})},a.getSecureSrc=function(a){return i.trustAsResourceUrl(a)},a.getSounds=function(){return a.item={sounds:[]},k.get().$promise.then(function(b){a.soundList=b.rows})["catch"](function(a){c.show(a.message,"danger")})};var l=function(c){b.get("/api/voice/musiconholds/stream",{params:{path:encodeURI(a.mohPath+"/"+c)}}).success(function(b){a.audioSources[c]="data:audio/ogg;base64,"+b}).error(function(a){console.error(a)})};a.deleteItem=h.confirm["delete"](function(e){b["delete"]("/api/voice/musiconholds/"+f.id+"/files",{params:{filename:e}}).success(function(){_.remove(a.audioFiles,function(a){return a===e}),c.show(d.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(a){c.show(a.message,"danger")})})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.mohs.view",{url:"/view/:id",templateUrl:"app/channels/voice/moh/view/view.html",controller:"VoiceMohViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.channels.voice.mohs.view.settings",{url:"/settings",templateUrl:"app/channels/voice/moh/view/view.settings.html"}).state("main.channels.voice.mohs.view.audios",{url:"/audios",templateUrl:"app/channels/voice/moh/view/view.audios.html",cache:!1}).state("main.channels.voice.mohs.view.add",{url:"/add",templateUrl:"app/channels/voice/moh/view/view.addFiles.html",cache:!1})}]),angular.module("xCallyShuttleApp").controller("VoiceQueueListCtrl",["$scope","$rootScope","VoiceQueue","gridOptions","$uibModal",function(a,b,c,d,e){a.initView=function(){var b={exporterCsvFilename:"voice_queues.csv",primaryKey:"name",columnDefs:[{name:"name"},{name:"strategy"},{name:"description"},{name:"action",width:200,buttons:[{"class":"blue-hoki",href:"/channels/voice/queues/view/{{row.entity.name}}/settings",name:"settings"},{"class":"green-meadow",href:"/channels/voice/queues/view/{{row.entity.name}}/agents",name:"agents"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.name)"}]}]};a.gridOptions=d.gridOptions(c,b,a)},a.createItem=function(){var b=e.open({animation:!0,templateUrl:"app/channels/voice/queue/list/list.create.modal.html",controller:"VoiceQueueListCreateCtrl"});b.result.then(function(){a.gridOptions.getPage()})}}]),angular.module("xCallyShuttleApp").controller("VoiceQueueListCreateCtrl",["$scope","$uibModalInstance","$translate","xAlert","VoiceQueue",function(a,b,c,d,e){a.form={},a.item={},a.save=function(){return e.save(a.item).$promise.then(function(a){d.show(c.instant("MESSAGE_WELL_DONE"),"success"),b.close(a)})["catch"](function(a){d.show(a.data.message,"danger")})},a.cancel=function(){b.dismiss()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.queues.list",{url:"/list",templateUrl:"app/channels/voice/queue/list/list.html",controller:"VoiceQueueListCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.queues",{url:"/queues",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").factory("ReportQueue",["$resource",function(a){return a("/api/report/queues/:id/:controller",{name:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").controller("VoiceQueueViewCtrl",["$scope","$http","xAlert","$translate","$stateParams","socket","$location","VoiceQueue","VoiceContext","Team",function(a,b,c,d,e,f,g,h,i,j){a.penalty=0,a.binaryChoices=[{name:"Yes",value:1},{name:"No",value:0}],a.recordSwitch={onText:"On",offText:"Off",isActive:!0,size:"small",animate:!0,radioOff:!0,handleWidth:"auto",labelWidth:"auto",inverse:!0,offColor:"danger",onColor:"success"},a.monitorFormats=[{name:"wav",value:"wav"},{name:"gsm",value:"gsm"},{name:"Inactive",value:""}],a.queueAnnounces=[{display_name:"Default",value:null},{display_name:"Disabled",value:""}];var k=function(){return{select:function(b){return h.save({id:a.queue.name,controller:"agents"},{agents:b,penalty:a.queue.penalty}).$promise.then(function(){a.getTeams()})["catch"](function(a){console.log(a)})},deselect:function(b){return h["delete"]({id:a.queue.name,controller:"agents",agents:b}).$promise.then(function(){a.getTeams()})["catch"](function(a){console.log(a)})}}};a.getQueue=function(){return h.get({id:e.id}).$promise.then(function(b){b.joinempty=""===b.joinempty?[]:b.joinempty.split(","),b.leavewhenempty=""===b.leavewhenempty?[]:b.leavewhenempty.split(","),b.periodic_announce=""===b.periodic_announce?[]:b.periodic_announce.split(","),b.penalty=0,a.queue=b})["catch"](function(a){g.path("/channels/voice/queues/list")})},a.updateVoiceQueue=function(){var b=angular.copy(a.queue);return b.joinempty=b.joinempty.join(","),b.leavewhenempty=b.leavewhenempty.join(","),
+b.periodic_announce=b.periodic_announce.join(","),b.context||(b.context=null),h.update({id:e.id},b).$promise.then(function(){c.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){c.show(d.instant(a.data.message),"danger")})},a.getTeams=function(){return j.get().$promise.then(function(b){return a.teams=b.rows,h.query({id:e.id,controller:"agents"}).$promise}).then(function(b){ComponentsDropdowns.bindQueue(a.teams,_.map(b,function(a){return{id:a.id,penalty:a.UserHasVoiceQueue.penalty}}),k)})["catch"](function(a){console.error(a)})},a.getContexts=function(){return i.get().$promise.then(function(b){a.voiceContexts=b.rows})["catch"](function(a){c.show(d.instant(data.message),"danger")})},a.getMohs=function(){b.get("/api/voice/musiconholds").success(function(b){a.voiceMohs=b.rows,f.syncUpdates("voice_musiconhold",a.voiceMohs)}).error(function(a){c.show(a.message,"danger")})},a.getSounds=function(){b.get("/api/sounds").success(function(b){a.queueAnnounces=a.queueAnnounces.concat(b),a.periodicAnnounces=angular.copy(b.rows),b.rows.unshift({display_name:"None",converted_path:null,value:""}),a.sounds=b.rows,f.syncUpdates("sound",a.sounds)}).error(function(a){console.error(a)})},a.returnAnnouncePath=function(a){return a.converted_path?a.converted_path+"/"+a.save_name:null===a.value?null:a.value}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.queues.view",{url:"/view/:id",templateUrl:"app/channels/voice/queue/view/view.html",controller:"VoiceQueueViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.channels.voice.queues.view.settings",{url:"/settings",templateUrl:"app/channels/voice/queue/view/view.settings.html"}).state("main.channels.voice.queues.view.agents",{url:"/agents",templateUrl:"app/channels/voice/queue/view/view.agents.html",cache:!1,serie:!0,resolve:{deps:["$ocLazyLoad",function(a){return a.load({insertBefore:"#ng_load_plugins_before",files:["assets/plugins/jquery-multi-select/css/multi-select.css","assets/plugins/jquery-multi-select/js/jquery.multi-select.js","assets/plugins/jquery-quicksearch/jquery.quicksearch.js","assets/scripts/components-dropdowns.js"]})}]}})}]),angular.module("xCallyShuttleApp").factory("VoiceQueue",["$resource",function(a){return a("/api/voice/queues/:id/:controller",{name:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.realtime",{url:"/realtime",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("VoiceRealtimeViewAgentCtrl",["$scope","$log","$uibModal","$translate","socket","xAlert","Agent","Pause","Action","VoiceQueue","usSpinnerService","$q","uiGridConstants",function(a,b,c,d,e,f,g,h,i,j,k,l,m){function n(){return k.spin("spinner-grid"),g.get(s).$promise.then(function(b){a.gridOptions.totalItems=b.count,a.gridOptions.data=[],b.rows.forEach(function(a){p(a)})})["catch"](function(a){f.show(a.message,"danger")})["finally"](function(){k.stop("spinner-grid")})}function o(){e.socket.on("agent:save",function(b){var c=_.find(a.gridOptions.data,{agentId:b.id,isAgent:!0});if(c){var d=a.gridOptions.data.indexOf(c);a.gridOptions.data[d].online=b.online,a.gridOptions.data[d].lastLoginAt=b.lastLoginAt,a.gridOptions.data[d].pause=b.voicePause,a.gridOptions.data[d].pauseType=b.pauseType,a.gridOptions.data[d].lastPauseAt=b.lastPauseAt,a.gridOptions.data[d].status=b.status,a.gridOptions.data[d].statusAt=b.statusAt,a.gridOptions.data[d].queueStatus=b.queueStatus,a.gridOptions.data[d].queueStatusAt=b.queueStatusAt,a.gridOptions.data[d].lastQueue=b.lastQueue,a.gridOptions.data[d].ipaddr=b.ipaddr,a.gridOptions.data[d].port=b.port,a.gridOptions.data[d].fullcontact=b.fullcontact,a.gridOptions.data[d].useragent=b.useragent,a.gridOptions.data[d].lastms=b.lastms,a.gridOptions.data[d].internal=b.internal,_.map(a.gridOptions.data,function(a){a.isAgent||a.agentId!==b.id||(a.online=b.online)})}}),e.socket.on("agent:remove",function(b){_.remove(a.gridOptions.data,{agentId:b.id})}),e.socket.on("user_has_voice_queue:save",function(b){var c=_.find(a.gridOptions.data,{agentId:b.UserId,queue:b.queue});if(!c&&b.logged){var d=_.find(a.gridOptions.data,{agentId:b.UserId,isAgent:!0}),e=a.gridOptions.data.indexOf(d);a.gridOptions.data.splice(e+1,0,{isAgent:!1,agentId:b.UserId,queue:b.queue,agent:b.membername,callstaken:b.callstaken?b.callstaken:0,online:d.online})}else c&&!b.logged?_.remove(a.gridOptions.data,{agentId:b.UserId,queue:b.queue}):c&&b.logged&&(c.callstaken=b.callstaken?b.callstaken:0)}),e.socket.on("user_has_voice_queue:remove",function(b){_.remove(a.gridOptions.data,{agentId:b.UserId,queue:b.queue})})}function p(b){a.gridOptions.data.push({isAgent:!0,agentId:b.id,agent:b.name,online:b.online,lastLoginAt:b.lastLoginAt,lastPauseAt:b.lastPauseAt,pause:b.voicePause,pauseType:b.pauseType,status:b.status||"UNKNOWN",statusAt:b.statusAt,queueStatus:b.queueStatus||"READY",queueStatusAt:b.queueStatusAt,lastQueue:b.lastQueue,ipaddr:b.ipaddr,port:b.port,fullcontact:b.fullcontact,useragent:b.useragent,lastms:b.lastms,internal:b.internal,$$treeLevel:0}),b.VoiceQueues.forEach(function(c){c.UserHasVoiceQueue.logged&&a.gridOptions.data.push({isAgent:!1,agentId:b.id,queue:c.name,agent:b.name,callstaken:c.UserHasVoiceQueue.callstaken?c.UserHasVoiceQueue.callstaken:0,online:b.online})})}function q(){return h.get().$promise.then(function(b){a.pauses=b.rows,e.syncUpdates("pause",a.pauses)})["catch"](function(a){f.show(a.message,"danger")})}function r(){return j.get().$promise.then(function(b){a.voiceQueues=b.rows,e.syncUpdates("voice_queue",a.voiceQueues)})["catch"](function(a){f.show(a.message,"danger")})}a.voiceQueues=[];var s={offset:0,limit:10};a.moment=moment,a.initAgents=function(){a.gridOptions={enableGridMenu:!0,headerCellFilter:"translate",enableHorizontalScrollbar:0,enableVerticalScrollbar:0,enableFiltering:!0,showGridFooter:!0,paginationPageSizes:[10,25,50,75],paginationPageSize:10,useExternalPagination:!0,useExternalSorting:!0,useExternalFiltering:!0,multiSelect:!0,showTreeExpandNoChildren:!0,columnDefs:[{name:"name",displayName:"APPLICATION_AGENT",headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div data-ng-if="row.entity.isAgent">{{row.entity.agent}} &lt;{{row.entity.internal}}&gt;</div>'},{name:"online",displayName:"APPLICATION_ONLINE",width:150,headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div data-ng-if="row.entity.online != null && row.entity.isAgent"><i class="icon-user" data-ng-class="row.entity.online ? \'font-green\' : \'font-red\'"></i> <span data-ng-if="row.entity.online" class="left-margin">(<timer start-time="grid.appScope.moment(row.entity.lastLoginAt).unix()*1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>)</span></div>',filter:{type:m.filter.SELECT,selectOptions:[{value:"true",label:"ONLINE"},{value:"false",label:"OFFLINE"}]}},{name:"status",displayName:"APPLICATION_PHONE_STATUS",headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",cellTemplate:"<div data-ng-if=\"row.entity.isAgent\">{{'APPLICATION_'+row.entity.status | translate}} <span data-ng-if=\"row.entity.statusAt && (row.entity.status === 'BUSY' || row.entity.status === 'ONHOLD' || row.entity.status === 'INUSE')\">(<timer start-time=\"grid.appScope.moment(row.entity.statusAt).unix()*1000\">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>)</span></span></div>",filter:{type:m.filter.SELECT,selectOptions:[{value:"UNKNOWN",label:d.instant("APPLICATION_UNKNOWN")},{value:"NOT_INUSE",label:d.instant("APPLICATION_NOT_INUSE")},{value:"INUSE",label:d.instant("APPLICATION_INUSE")},{value:"BUSY",label:d.instant("APPLICATION_BUSY")},{value:"INVALID",label:d.instant("APPLICATION_INVALID")},{value:"UNAVAILABLE",label:d.instant("APPLICATION_UNAVAILABLE")},{value:"RINGING",label:d.instant("APPLICATION_RINGING")},{value:"RINGINUSE",label:d.instant("APPLICATION_RINGINUSE")},{value:"ONHOLD",label:d.instant("APPLICATION_ONHOLD")}]}},{name:"queueStatus",width:400,displayName:"APPLICATION_QUEUE_STATUS",headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div data-ng-if="row.entity.isAgent && row.entity.online" class="ui-grid-vcenter" data-ng-class="{\'paused-agent\':row.entity.pause}"><span>{{\'APPLICATION_\'+row.entity.queueStatus.toUpperCase() | translate}}</span><span data-ng-if="(row.entity.queueStatus!==\'complete\' && (row.entity.queueStatus!==\'paused\' || row.entity.pauseType === \'ACW\'))"> [{{row.entity.lastQueue}}]</span><span data-ng-if="row.entity.pause"> [{{row.entity.pauseType}}]</span><timer data-ng-if="row.entity.queueStatusAt && row.entity.queueStatus!==\'complete\'" start-time="grid.appScope.moment(row.entity.queueStatusAt).unix()*1000"> [{{hhours}}:{{mminutes}}:{{sseconds}}]</timer></span><span class="left-margin"><i data-ng-if="row.entity.pause" data-ng-click="grid.appScope.pause(row.entity.agentId,\'unpause\')" class="icon-control-play font-green pointer-cursor" title="{{\'APPLICATION_RESUME\' | translate}}"></i><i class="icon-control-pause font-yellow pointer-cursor" data-ng-click="grid.appScope.pause(row.entity.agentId,\'pause\',\'DEFAULT PAUSE\')" title="{{\'APPLICATION_DEFAULT_PAUSE\' | translate}}"></i></span><select data-ng-if="grid.appScope.pauses.length" class="pause-select pointer-cursor" data-ng-model="grid.appScope.pauseType" data-ng-change="grid.appScope.pause(row.entity.agentId,\'pause\',grid.appScope.pauseType)"><option class="pointer-cursor" data-ng-repeat="pause in grid.appScope.pauses">{{pause.name}}</option></select></div>',filter:{type:m.filter.SELECT,selectOptions:[{value:"paused",label:d.instant("APPLICATION_PAUSED")},{value:"connect",label:d.instant("APPLICATION_CONNECT")},{value:"complete",label:d.instant("APPLICATION_COMPLETE")},{value:"called",label:d.instant("APPLICATION_CALLED")}]},enableSorting:!1,enableColumnMenu:!1},{name:"queue",displayName:"APPLICATION_QUEUE",headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",enableSorting:!1,enableFiltering:!1,enableColumnMenu:!1},{name:"callstaken",displayName:"APPLICATION_CALLS_TAKEN",headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div data-ng-if="row.entity.callstaken !== null">{{row.entity.callstaken}}</div>',enableSorting:!1,enableFiltering:!1,enableColumnMenu:!1,width:100},{name:"action",displayName:"",width:170,cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div><button data-ng-if="row.entity.queue" class="btn btn-xs red-sunglo" data-ng-click="grid.appScope.leaveQueue(row.entity.agentId,row.entity.queue)"><i class="icon-ban"></i> {{\'APPLICATION_LEAVE\' | translate}}</button><button data-ng-if="row.entity.isAgent && row.treeNode.children.length < grid.appScope.voiceQueues.length" class="btn btn-xs blue-hoki" data-ng-click="grid.appScope.joinQueue(row.entity.agentId)"><i class="icon-plus"></i> {{\'APPLICATION_JOIN_QUEUE\' | translate}}</button> <button data-ng-if="row.entity.isAgent" class="btn btn-xs blue-madison" data-ng-click="grid.appScope.showInfo(row.entity)"><i class="icon-info"></i> {{\'APPLICATION_INFO\' | translate}}</button><div>',enableSorting:!1,enableFiltering:!1,enableColumnMenu:!1}],data:[],gridMenuTitleFilter:function(a){var b=l.defer();return b.resolve(d.instant(a)),b.promise},onRegisterApi:function(b){a.gridApi=b,a.gridApi.grid.registerDataChangeCallback(function(){t(a.gridApi.core.getVisibleRows(a.gridApi.grid).length)}),a.gridApi.treeBase.on.rowExpanded(a,function(b){t(a.gridApi.core.getVisibleRows(a.gridApi.grid).length+b.treeNode.children.length)}),a.gridApi.treeBase.on.rowCollapsed(a,function(b){t(a.gridApi.core.getVisibleRows(a.gridApi.grid).length-b.treeNode.children.length)}),a.gridApi.core.on.sortChanged(a,function(a,b){0===b.length?s.order=null:s.order=b[0].name+" "+b[0].sort.direction.toUpperCase(),n()}),a.gridApi.pagination.on.paginationChanged(a,function(a,b){s.offset=(a-1)*b,s.limit=b,n()}),a.gridApi.core.on.filterChanged(a,function(){var a=this.grid;a.columns.forEach(function(a){a.filters[0].term?s[a.name]=a.filters[0].term:delete s[a.name]}),n()})}},n(),q(),r(),o()};var t=function(a){var b=a?30*a+130:270;angular.element(document.getElementsByClassName("ui-grid")[0]).css("height",b+"px"),angular.element(document.getElementsByClassName("ui-grid-viewport")).css("height",30*a+"px")};a.$on("$destroy",function(){e.unsyncUpdates("agent"),e.unsyncUpdates("user_has_voice_queue")}),a.pause=function(a,b,c){return i.save({name:b,agent:a,type:c||"DEFAULT PAUSE",data4:c||"DEFAULT PAUSE",channel:"voice"}).$promise.then(function(){f.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){f.show(d.instant(a.message||a.data.message||a.translatedMessage||a.data.translatedMessage),"danger")})},a.joinQueue=function(e){var g=c.open({animation:!0,templateUrl:"app/channels/voice/realtime/view/agent/queue.modal.add.html",controller:"VoiceRealtimeViewAgentQueueModalCtrl",resolve:{queues:function(){return _.reject(a.voiceQueues,function(b){return _.find(a.gridOptions.data,{queue:b.name,isAgent:!1,agentId:e})?!0:!1})}}});g.result.then(function(a){return i.save({name:"QueueAdd",agent:e,queues:a.queues,channel:"voice",data1:e,data3:a.queues.join(","),data4:"voice"}).$promise.then(function(){f.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){f.show(a.message,"danger")})},function(){b.info("Modal dismissed at: "+new Date)})},a.leaveQueue=function(a,b){return i.save({name:"QueueRemove",agent:a,queue:b,channel:"voice",data1:a,data3:b,data4:"voice"}).$promise.then(function(){f.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){f.show(a.message,"danger")})},a.showInfo=function(a){c.open({animation:!0,templateUrl:"app/channels/voice/realtime/view/agent/agent.modal.info.html",controller:"VoiceRealtimeViewAgentInfoModalCtrl",resolve:{agent:a}})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.realtime.view.agents",{url:"/agents",templateUrl:"app/channels/voice/realtime/view/agent/agent.html",controller:"VoiceRealtimeViewAgentCtrl"})}]),angular.module("xCallyShuttleApp").controller("VoiceRealtimeViewAgentInfoModalCtrl",["$scope","$uibModalInstance","$http","agent",function(a,b,c,d){a.agent=d,a.close=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("VoiceRealtimeViewAgentQueueModalCtrl",["$scope","$uibModalInstance","$http","queues",function(a,b,c,d){a.queues=d,a.item={},a.save=function(){b.close(a.item)},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("VoiceRealtimeViewAgentReportCtrl",["$scope","$http","socket",function(a,b,c){a.$on("$destroy",function(){c.unsyncUpdates("report_agent")}),a.conf={agentsByPage:{name:"10",value:10},labels:["fullname","name","email"]},a.agentsByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.initReport=function(){a.agents=[],b.get("/api/report/agents").success(function(b){a.agents=b,c.syncUpdates("report_agent",a.agents)}).error(function(a){console.error(a)})}}]),angular.module("xCallyShuttleApp").filter("VoiceRealtimeViewAgentReportFilter",function(){return function(a){return new Date(1970,0,1).setSeconds(a)}}),angular.module("xCallyShuttleApp").controller("VoiceRealtimeViewQueueReportCtrl",["$scope","$http","socket",function(a,b,c){a.$on("$destroy",function(){c.unsyncUpdates("report_queue")}),a.conf={queuesByPage:{name:"10",value:10},labels:["fullname","name","email"]},a.queuesByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.initReport=function(){a.queues=[],b.get("/api/report/queues").success(function(b){console.log(b),a.queues=b,c.syncUpdates("report_queue",a.queues)}).error(function(a){console.error(a)})}}]),angular.module("xCallyShuttleApp").filter("VoiceRealtimeViewQueueReportFilter",function(){return function(a){return new Date(1970,0,1).setSeconds(a)}}),angular.module("xCallyShuttleApp").controller("VoiceRealtimeViewQueuePauseModalCtrl",["$scope","$uibModalInstance","items","data",function(a,b,c,d){a.items=c,a.data=d,console.log(d),a.selected={item:a.items[0],queue:_.isArray(d)?a.data[0].queue:a.data.queue,membername:_.isArray(d)?a.data[0].membername:a.data.membername,"interface":_.isArray(d)?a.data[0]["interface"]:a.data["interface"]},a.ok=function(c,e){var f;_.isArray(d)?(f=[],d.forEach(function(b){f.push({action:"QueuePause",queue:b.queue,membername:b.membername,"interface":b["interface"],paused:c,reason:a.selected.item})})):f={action:"QueuePause",queue:a.selected.queue,membername:a.selected.membername,"interface":a.selected["interface"],paused:c,reason:a.selected.item},b.close(f)},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("VoiceRealtimeViewQueueCtrl",["$scope","$http","$log","$uibModal","$translate","socket","xAlert",function(a,b,c,d,e,f,g){a.conf={agentsByPage:{name:"10",value:10},labels:["fullname","name","email"]},a.agentsByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.$on("$destroy",function(){f.unsyncUpdates("user_has_voice_queue")}),a.groups=[],a.pauses=["pausa1","pausa2","pausa3"],a.pause=function(f,h){var i=d.open({animation:!0,size:f,templateUrl:"app/channels/voice/realtime/view/queue/pause.modal.html",controller:"VoiceRealtimeViewQueuePauseModalCtrl",resolve:{items:function(){return a.pauses},data:function(){return h}}});i.result.then(function(a){_.isArray(a)?a.forEach(function(a){b.post("/api/ami",a).then(function(a){console.log(a),g.show(e.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){console.log(a),g.show(a.data.message,"danger")})}):b.post("/api/ami",a).then(function(a){console.log(a),g.show(e.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){console.log(a),g.show(a.data.message,"danger")})},function(){c.info("Modal dismissed at: "+new Date)})},a.add=function(f,h){var i=d.open({animation:!0,size:f,templateUrl:"app/channels/voice/realtime/view/queue/queue.modal.add.html",controller:"VoiceRealtimeViewQueueQueueModalCtrl",resolve:{pauses:function(){return a.pauses},data:function(){return h}}});i.result.then(function(a){console.log("action",a),b.post("/api/voice/user_has_queues",a).then(function(){a.login?b.post("/api/ami",a).then(function(){g.show(e.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){g.show(a.data.message,"danger")}):g.show(e.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){g.show(a.message,"danger")}),console.log(a)},function(){c.info("Modal dismissed at: "+new Date)})},a.remove=function(a,f){var h=d.open({animation:!0,size:a,templateUrl:"app/channels/voice/realtime/view/queue/queue.modal.remove.html",controller:"VoiceRealtimeViewQueueQueueModalCtrl",resolve:{pauses:function(){return null},data:function(){return f}}});h.result.then(function(a){_.isArray(a)?a.forEach(function(a){b.post("/api/ami",a).then(function(){a.logout?b.put("/api/voice/queues/"+a.queue+"/agents",{agents:[a.UserId]}).then(function(){g.show(e.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){g.show(a.data.message,"danger")}):g.show(e.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){g.show(a.data.message,"danger")})}):b.post("/api/ami",a).then(function(){a.logout?b.put("/api/voice/queues/"+a.queue+"/agents",{agents:[a.UserId]}).then(function(){g.show(e.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){g.show(a.data.message,"danger")}):g.show(e.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){g.show(a.data.message,"danger")})},function(){c.info("Modal dismissed at: "+new Date)})},a.initQueues=function(){b.get("/api/voice/user_has_queues").success(function(b){a.queues=b,a.groups=_.map(_.groupBy(a.queues,"queue"),function(a,b){return{queue:b,agents:a}}),console.log("ok"),f.socket.on("user_has_voice_queue:save",function(b){console.log("item",b);var c=_.find(a.groups,{queue:b.queue}),d=a.groups.indexOf(c);if(c){var e=_.find(c.agents,{membername:b.membername});e?_.merge(e,b):a.groups[d].agents.push(b)}else{var f={queue:b.queue,agents:[b]};a.groups.unshift(f)}}),f.socket.on("user_has_voice_queue:remove",function(b){var c=_.find(a.groups,{queue:b.queue});_.remove(c.agents,{membername:b.membername}),c.agents.length||_.remove(a.groups,{queue:b.queue})}),f.socket.on("report_agent:save",function(b){var c=_.find(a.groups,{queue:b.queue}),d=a.groups.indexOf(c);if(c){var e=_.find(c.agents,{membername:b.membername});e?_.merge(e,b):a.groups[d].agents.push(b)}else{var f={queue:b.queue,agents:[b]};a.groups.unshift(f)}})}).error(function(a){console.error(a)})}}]),angular.module("xCallyShuttleApp").controller("VoiceRealtimeViewQueueQueueModalCtrl",["$scope","$uibModalInstance","$http","pauses","data",function(a,b,c,d,e){a.initAdd=function(){a.data=e,a.pauses=d,a.selected={penalty:0,paused:!1,reason:a.pauses[0]},a.$watch("selected.agent",function(b){b&&(a.selected.membername=b.name,a.selected["interface"]="SIP/"+b.name,a.selected.UserId=b.id)}),c.get("/api/agents",{params:{page:0,per_page:500}}).success(function(b){a.agents=_.reject(b.rows,function(b){return _.find(a.data,{membername:b.name})?!0:!1}),a.selected.queue=a.data[0]?a.data[0].queue:null}).error(function(a){console.error(a)})},a.initRemove=function(){a.data=e,console.log(e),_.isArray(e)?a.selected={queue:a.data[0].queue,logout:!1}:a.selected={membername:a.data.membername,"interface":a.data["interface"],queue:a.data.queue,logout:!1,UserId:a.data.UserId}},a.okAdd=function(){var c={action:"QueueAdd",queue:a.selected.queue,membername:a.selected.membername,"interface":a.selected["interface"],penalty:a.selected.penalty,paused:a.selected.paused,UserId:a.selected.UserId};c.paused&&(c.reason=a.selected.reason),b.close(c)},a.okRemove=function(){var c;_.isArray(a.data)?(c=[],a.data.forEach(function(b){c.push({action:"QueueRemove",queue:b.queue,"interface":b["interface"],logout:a.selected.logout,UserId:b.UserId})})):c={action:"QueueRemove",queue:a.selected.queue,logout:a.selected.logout,"interface":a.selected["interface"],UserId:a.selected.UserId},b.close(c)},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("VoiceRealtimeViewCtrl",["$scope",function(a){a.agents=[{name:"View1",link:"main.channels.voice.realtime.view.agents"},{name:"View2",link:"main.channels.voice.realtime.view.areports"}],a.queues=[{name:"View1",link:"main.channels.voice.realtime.view.queues"},{name:"View2",link:"main.channels.voice.realtime.view.qreports"}]}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.realtime.view",{url:"/view",templateUrl:"app/channels/voice/realtime/view/view.html",controller:"VoiceRealtimeViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/css/profile.css","assets/css/tasks.css"]}])}]}})}]),angular.module("xCallyShuttleApp").controller("VoiceRecordingListCtrl",["$scope","$translate","$sce","Recording","gridOptions","xAlert","uiGridConstants",function(a,b,c,d,e,f,g){a.Recording=d;a.updateRating=function(a,c){d.patch({id:a,rating:c}).$promise.then(function(){f.show(b.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){f.show(a.message,"danger")})},a.initView=function(){var b={exporterCsvFilename:"recordings.csv",rowHeight:30,columnDefs:[{name:"uniqueid"},{name:"calleridnum"},{name:"calleridname"},{name:"connectedlinenum"},{name:"connectedlinename"},{name:"rating",filter:{type:g.filter.SELECT,selectOptions:[{value:1,label:"1"},{value:2,label:"2"},{value:3,label:"3"},{value:4,label:"4"},{value:5,label:"5"}]},cellClass:"ui-grid-vcenter",width:"100",cellTemplate:'<div><uib-rating data-ng-model="row.entity.rating" data-ng-click="grid.appScope.updateRating(row.entity.uniqueid, row.entity.rating)" aria-labelledby="default-rating"></uib-rating></div>'},{name:"audio",displayName:"",width:225,enableSorting:!1,enableFiltering:!1,buttons:[{directive:'<audio-file-download params="{id:row.entity.uniqueid,controller:\'stream\'}" resource="grid.appScope.Recording"></audio-file-download>'}]},{name:"action",width:150,buttons:[{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.uniqueid, row.entity.uniqueid)"},{directive:'<motion-file-download params="{id:row.entity.uniqueid,controller:\'stream\'}" resource="grid.appScope.Recording" mimetype="audio/wav" btnclass="btn btn-xs blue-hoki" filename="row.entity.uniqueid+\'.wav\'"></motion-file-download>'}]}]};a.gridOptions=e.gridOptions(d,b,a)}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.recordings.list",{url:"/list",templateUrl:"app/channels/voice/recording/list/list.html",controller:"VoiceRecordingListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").factory("Recording",["$resource",function(a){return a("/api/voice/recordings/:id/:controller",{id:"@id"},{update:{method:"PUT"},patch:{method:"PATCH"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.recordings",{url:"/recordings",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.routes.inbound",{url:"/inbound",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("VoiceRouteInboundListCreateCtrl",["$scope","$uibModalInstance","Route","application","xAlert","$location","$translate",function(a,b,c,d,e,f,g){a.$application=d.application,a.forms={route:void 0},a.item={type:"inbound",appdata:"Inbound Call",context:"from-voip-provider"},a.ok=function(){return a.item.exten=a.$application.checkUnderscore(a.item.exten),c.save(a.item).$promise.then(function(a){b.close(a),f.path("/channels/voice/routes/inbound/view/"+a.id+"/applications")})["catch"](function(a){console.log(a),e.show(g.instant(a.data.translatedMessage),"danger")})},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("VoiceRouteInboundListCtrl",["$scope","$http","socket","$translate","$rootScope","xAlert","Modal","stResource","gridOptions","Route","$uibModal","$location","$log",function(a,b,c,d,e,f,g,h,i,j,k,l,m){a.initView=function(){var b={exporterCsvFilename:"InboundRoutes.csv",columnDefs:[{name:"exten",displayName:"APPLICATION_PHONE_NUMBER"},{name:"description"},{name:"applications",cellClass:"ui-grid-vcenter",cellTemplate:'<div data-ng-if="row.entity.Applications.length"><span data-ng-repeat="app in row.entity.Applications | limitTo:2">{{app.app}}({{app.appdata[0]}}), </span>...</div><div data-ng-if="!row.entity.Applications.length">{{\'MESSAGE_NO_AVAILABLE_APPLICATIONS\' | translate}}</div>',enableSorting:!1,enableFiltering:!1,enableColumnMenu:!1},{name:"action",width:170,buttons:[{"class":"blue-hoki",href:"/channels/voice/routes/inbound/view/{{row.entity.id}}/settings",name:"settings"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.exten, row.entity.id)"}]}]};a.gridOptions=i.gridOptions(j,b,a,{type:"inbound"})},a.create=function(){k.open({animation:!0,templateUrl:"app/channels/voice/route/inbound/list/create.modal.html",controller:"VoiceRouteInboundListCreateCtrl"})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.routes.inbound.list",{url:"/list",templateUrl:"app/channels/voice/route/inbound/list/list.html",controller:"VoiceRouteInboundListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").controller("VoiceRouteInboundViewCtrl",["$scope","$translate","$stateParams","socket","$location","WizardHandler","Modal","xAlert","application","interval","Route","VoiceQueue","Sound","SquareProject","VoiceContext","Interval","VoiceMail",function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q){function r(b){var c,d;if("always"===b.intType)c=null,d="*,*,*,*";else if("list"===b.intType)d=b.IntervalId?_.find(a.Intervals,{id:b.IntervalId}).name:"*,*,*,*",c=b.IntervalId||null;else if("custom"===b.intType){c=null;var e,f,g,h;e=b.t_from&&b.t_to&&!b.alwaysTime?moment(b.t_from).format("HH:mm")+"-"+moment(b.t_to).format("HH:mm"):"*",b.wd_from&&"always"!==b.wd_from?(f=b.wd_from,b.wd_to&&"always"!==b.wd_to&&(f+="-"+b.wd_to)):f="*",b.md_from&&"always"!==b.md_from?(g=b.md_from,b.md_to&&"always"!==b.md_to&&(g+="-"+b.md_to)):g="*",b.m_from&&"always"!==b.m_from?(h=b.m_from,b.m_to&&"always"!==b.m_to&&(h+="-"+b.m_to)):h="*",d=e+","+f+","+g+","+h}void 0===a.selectedApp?(a.application.interval=d,a.application.IntervalId=c):(a.route.Applications[a.selectedApp].interval=d,a.route.Applications[a.selectedApp].IntervalId=c)}function s(){if(a.interval.intType=a.route.Applications[a.selectedApp].IntervalId?"list":"*,*,*,*"===a.route.Applications[a.selectedApp].interval?"always":"custom",a.interval.IntervalId=a.route.Applications[a.selectedApp].IntervalId,!a.route.Applications[a.selectedApp].IntervalId){var b,c=a.route.Applications[a.selectedApp].interval?a.route.Applications[a.selectedApp].interval.split(","):["*","*","*","*"];c.forEach(function(c,d){switch(d){case 0:"*"!==c?(b=c.split("-"),a.interval.t_from=moment(b[0],"HH:mm"),a.interval.t_to=moment(b[1],"HH:mm"),a.interval.alwaysTime=!1):(a.interval.t_from=moment(new Date),a.interval.t_to=moment(new Date),a.interval.alwaysTime=!0);break;case 1:"*"!==c?(b=c.split("-"),a.interval.wd_from=b[0],a.interval.wd_to=b[1]?b[1]:"always"):(a.interval.wd_from="always",a.interval.wd_to="always");break;case 2:"*"!==c?(b=c.split("-"),a.interval.md_from=b[0],a.interval.md_to=b[1]?b[1]:"always"):(a.interval.md_from="always",a.interval.md_to="always");break;case 3:"*"!==c?(b=c.split("-"),a.interval.m_from=b[0],a.interval.m_to=b[1]?b[1]:"always"):(a.interval.m_from="always",a.interval.m_to="always")}})}}a.$translate=b,a.$application=i.application,a.$interval=j.interval,a.gridOptions={rowTemplate:'<div grid="grid" class="ui-grid-draggable-row" draggable="true"><div ng-repeat="(colRenderIndex, col) in colContainer.renderedColumns track by col.colDef.name" class="ui-grid-cell" ng-class="{ \'ui-grid-row-header-cell\': col.isRowHeader, \'custom\': true }" ui-grid-cell></div></div>',columnDefs:[{name:"app",displayName:"APPLICATION_APPLICATION",headerCellFilter:"translate",enableSorting:!1,enableColumnMenu:!1},{name:"appdata",displayName:"APPLICATION_ARGUMENTS",headerCellFilter:"translate",cellClass:"ui-grid-vcenter",cellTemplate:"<div>{{row.entity.appdata.join(',')}}</div>",enableSorting:!1,enableColumnMenu:!1},{name:"interval",displayName:"APPLICATION_TIME",headerCellFilter:"translate",enableSorting:!1,enableColumnMenu:!1},{name:"action",enableSorting:!1,enableColumnMenu:!1,displayName:"APPLICATION_ACTION",headerCellFilter:"translate",width:125,cellTemplate:'<a class="btn btn-xs blue-hoki" data-ng-click="grid.appScope.openApplication(grid.appScope.gridOptions.data.indexOf(row.entity))">{{\'APPLICATION_SETTINGS\' | translate}}</a><a class="btn btn-xs red-sunglo" data-ng-click="grid.appScope.deleteApp(row.entity.app+\' application\', grid.appScope.gridOptions.data.indexOf(row.entity))">{{\'APPLICATION_DELETE\' | translate}}</a>'}],onRegisterApi:function(b){b.draggableRows.on.rowDropped(a,function(b,c){a.updateRoute()})}},a.initApplication=function(b){b&&(a.selectedApp=void 0),a.forms={settings:void 0,interval:void 0},a.application={},a.interval={intType:"always",t_from:moment(new Date),t_to:moment(new Date),wd_from:"always",wd_to:"always",md_from:"always",md_to:"always",
+m_from:"always",m_to:"always",alwaysTime:!0},a.main={app:""}},a.$watch("interval",function(a){a&&r(a)},!0),a.updateSetAppdata=function(){a.application.variable&&a.application.value&&"Set"===a.main.app?a.application.appdata[0]=a.application.variable+"="+a.application.value:a.application.appdata[0]=null},a.updateSetAppdataSettings=function(){a.application.variable&&a.application.value&&"Set"===a.main.app?a.route.Applications[a.selectedApp].appdata[0]=a.application.variable+"="+a.application.value:a.application.appdata[0]=null},a.$watch("main.app",function(d){if(d){var e,f;switch(c.appId||(a.application={app:d,interval:a.application.interval||"*,*,*,*",appdata:[]}),d){case"Queue":e=l,f=m;break;case"Playback":e=m;break;case"AGI":e=n;break;case"Goto":e=o;break;case"Voicemail":e=q;break;default:e=null,f=null}if(e)return e.get().$promise.then(function(b){a.items=b.rows}).then(function(){return f?f.get().$promise:void 0}).then(function(b){b&&(a.items2=b.rows)})["catch"](function(a){h.show(b.instant(a.message),"danger")})}},!0),a.deselectAndRedirect=function(b){a.selectedApp=void 0,e.path(b)},a.getIntervals=function(){return p.get().$promise.then(function(b){a.Intervals=b.rows,d.syncUpdates("interval",a.Intervals)})["catch"](function(a){h.show(b.instant(a.message),"danger")})},a.getRoute=function(){return k.get({id:c.id}).$promise.then(function(b){a.route=b,a.gridOptions.data=b.Applications})["catch"](function(a){e.path("/channels/voice/routes/inbound/list")})},a.getApplication=function(){void 0===a.selectedApp&&e.path("/channels/voice/routes/inbound/list");var b=_.find(a.$application.applications,{value:a.route.Applications[a.selectedApp].app});if(a.main.app=b?b.value:"custom","Set"===a.main.app){var c=a.route.Applications[a.selectedApp].appdata[0].split("=");a.application.variable=c[0],a.application.value=c[1]}if(!b){var d=a.route.Applications[a.selectedApp].appdata.join(",");a.route.Applications[a.selectedApp].appdata=[d]}s()},a.openApplication=function(b){a.selectedApp=b,e.path("/channels/voice/routes/inbound/view/"+c.id+"/applications/settings")},a.updateRoute=function(d){return a.selectedApp=void 0,a.route.exten=a.$application.checkUnderscore(a.route.exten),k.update({id:a.route.id},a.route).$promise.then(function(a){h.show(b.instant("MESSAGE_WELL_DONE")+"!","success"),d&&e.path("/channels/voice/routes/inbound/view/"+c.id+"/"+d)})["catch"](function(a){console.log(a),h.show(b.instant(a.data.translatedMessage),"danger")})},a.getContexts=function(){return o.get().$promise.then(function(b){a.voiceContexts=b.rows,d.syncUpdates("voice_context",a.voiceContexts)})["catch"](function(a){h.show(b.instant(a.message),"danger")})},a.deleteApp=g.confirm["delete"](function(b){console.log(b),console.log(a.route.Applications[b]),a.route.Applications.splice(b,1)}),a.addApplication=function(){a.route.Applications.push(a.application),a.updateRoute("applications")},a.goNext=function(){f.wizard().next()},a.previous=function(){f.wizard().previous()},a.formValidation=function(a){return a},a.$on("destroy",function(){d.unsyncUpdates("voice_extension")})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.routes.inbound.view",{url:"/view/:id",templateUrl:"app/channels/voice/route/inbound/view/view.html",controller:"VoiceRouteInboundViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.channels.voice.routes.inbound.view.settings",{url:"/settings",templateUrl:"app/channels/voice/route/inbound/view/view.settings.html"}).state("main.channels.voice.routes.inbound.view.applications",{url:"/applications",templateUrl:"app/channels/voice/route/inbound/view/view.applications.html"}).state("main.channels.voice.routes.inbound.view.application",{url:"/application",templateUrl:"app/channels/voice/route/view.application.html"}).state("main.channels.voice.routes.inbound.view.applications.settings",{url:"/settings",templateUrl:"app/channels/voice/route/view.applicationSettings.html"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.routes.internal",{url:"/internal",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("VoiceRouteInternalListCreateCtrl",["$scope","$uibModalInstance","Route","application","$location","$translate","xAlert",function(a,b,c,d,e,f,g){a.$application=d.application,a.forms={route:void 0},a.item={type:"internal",appdata:"Internal Call",context:"from-sip"},a.ok=function(){return a.item.exten=a.$application.checkUnderscore(a.item.exten),c.save(a.item).$promise.then(function(a){b.close(a),e.path("/channels/voice/routes/internal/view/"+a.id+"/applications")})["catch"](function(a){g.show(f.instant(a.data.translatedMessage),"danger")})},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("VoiceRouteInternalListCtrl",["$scope","$http","socket","$translate","$rootScope","xAlert","Modal","stResource","gridOptions","Route","$uibModal","$location","$log",function(a,b,c,d,e,f,g,h,i,j,k,l,m){a.initView=function(){var b={exporterCsvFilename:"InternalRoutes.csv",columnDefs:[{name:"exten",displayName:"APPLICATION_PHONE_NUMBER"},{name:"description"},{name:"applications",cellClass:"ui-grid-vcenter",cellTemplate:'<div data-ng-if="row.entity.Applications.length"><span data-ng-repeat="app in row.entity.Applications | limitTo:2">{{app.app}}({{app.appdata[0]}}),</span>...</div><div data-ng-if="!row.entity.Applications.length">{{\'MESSAGE_NO_AVAILABLE_APPLICATIONS\' | translate}}</div>',enableSorting:!1,enableFiltering:!1,enableColumnMenu:!1},{name:"action",width:170,buttons:[{"class":"blue-hoki",href:"/channels/voice/routes/internal/view/{{row.entity.id}}/settings",name:"settings"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.exten, row.entity.id)"}]}]};a.gridOptions=i.gridOptions(j,b,a,{type:"internal"})},a.create=function(){k.open({animation:!0,templateUrl:"app/channels/voice/route/internal/list/create.modal.html",controller:"VoiceRouteInternalListCreateCtrl"})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.routes.internal.list",{url:"/list",templateUrl:"app/channels/voice/route/internal/list/list.html",controller:"VoiceRouteInternalListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").controller("VoiceRouteInternalViewCtrl",["$scope","$translate","$stateParams","socket","$location","WizardHandler","Modal","xAlert","application","interval","Route","VoiceQueue","Sound","SquareProject","VoiceContext","Interval","VoiceMail",function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q){function r(b){var c,d;if("always"===b.intType)c=null,d="*,*,*,*";else if("list"===b.intType)d=b.IntervalId?_.find(a.Intervals,{id:b.IntervalId}).name:"*,*,*,*",c=b.IntervalId||null;else if("custom"===b.intType){c=null;var e,f,g,h;e=b.t_from&&b.t_to&&!b.alwaysTime?moment(b.t_from).format("HH:mm")+"-"+moment(b.t_to).format("HH:mm"):"*",b.wd_from&&"always"!==b.wd_from?(f=b.wd_from,b.wd_to&&"always"!==b.wd_to&&(f+="-"+b.wd_to)):f="*",b.md_from&&"always"!==b.md_from?(g=b.md_from,b.md_to&&"always"!==b.md_to&&(g+="-"+b.md_to)):g="*",b.m_from&&"always"!==b.m_from?(h=b.m_from,b.m_to&&"always"!==b.m_to&&(h+="-"+b.m_to)):h="*",d=e+","+f+","+g+","+h}void 0===a.selectedApp?(a.application.interval=d,a.application.IntervalId=c):(a.route.Applications[a.selectedApp].interval=d,a.route.Applications[a.selectedApp].IntervalId=c)}function s(){if(a.interval.intType=a.route.Applications[a.selectedApp].IntervalId?"list":"*,*,*,*"===a.route.Applications[a.selectedApp].interval?"always":"custom",a.interval.IntervalId=a.route.Applications[a.selectedApp].IntervalId,!a.route.Applications[a.selectedApp].IntervalId){var b,c=a.route.Applications[a.selectedApp].interval?a.route.Applications[a.selectedApp].interval.split(","):["*","*","*","*"];c.forEach(function(c,d){switch(d){case 0:"*"!==c?(b=c.split("-"),a.interval.t_from=moment(b[0],"HH:mm"),a.interval.t_to=moment(b[1],"HH:mm"),a.interval.alwaysTime=!1):(a.interval.t_from=moment(new Date),a.interval.t_to=moment(new Date),a.interval.alwaysTime=!0);break;case 1:"*"!==c?(b=c.split("-"),a.interval.wd_from=b[0],a.interval.wd_to=b[1]?b[1]:"always"):(a.interval.wd_from="always",a.interval.wd_to="always");break;case 2:"*"!==c?(b=c.split("-"),a.interval.md_from=b[0],a.interval.md_to=b[1]?b[1]:"always"):(a.interval.md_from="always",a.interval.md_to="always");break;case 3:"*"!==c?(b=c.split("-"),a.interval.m_from=b[0],a.interval.m_to=b[1]?b[1]:"always"):(a.interval.m_from="always",a.interval.m_to="always")}})}}a.$translate=b,a.selectedApp=void 0,a.$application=i.application,a.$interval=j.interval,a.gridOptions={rowTemplate:'<div grid="grid" class="ui-grid-draggable-row" draggable="true"><div ng-repeat="(colRenderIndex, col) in colContainer.renderedColumns track by col.colDef.name" class="ui-grid-cell" ng-class="{ \'ui-grid-row-header-cell\': col.isRowHeader, \'custom\': true }" ui-grid-cell></div></div>',columnDefs:[{name:"app",displayName:"APPLICATION_APPLICATION",headerCellFilter:"translate",enableSorting:!1,enableColumnMenu:!1},{name:"appdata",displayName:"APPLICATION_ARGUMENTS",headerCellFilter:"translate",cellClass:"ui-grid-vcenter",cellTemplate:"<div>{{row.entity.appdata.join(',')}}</div>",enableSorting:!1,enableColumnMenu:!1},{name:"interval",displayName:"APPLICATION_TIME",headerCellFilter:"translate",enableSorting:!1,enableColumnMenu:!1},{name:"action",displayName:"APPLICATION_ACTION",headerCellFilter:"translate",enableSorting:!1,enableColumnMenu:!1,width:125,cellTemplate:'<a class="btn btn-xs blue-hoki" data-ng-click="grid.appScope.openApplication(grid.appScope.gridOptions.data.indexOf(row.entity))">{{\'APPLICATION_SETTINGS\' | translate}}</a><a class="btn btn-xs red-sunglo" data-ng-click="grid.appScope.deleteApp(row.entity.app+\' application\', grid.appScope.gridOptions.data.indexOf(row.entity))">{{\'APPLICATION_DELETE\' | translate}}</a>'}],onRegisterApi:function(b){b.draggableRows.on.rowDropped(a,function(b,c){a.updateRoute()})}},a.initApplication=function(b){b&&(a.selectedApp=void 0),a.forms={settings:void 0,interval:void 0},a.application={},a.interval={intType:"always",t_from:moment(new Date),t_to:moment(new Date),wd_from:"always",wd_to:"always",md_from:"always",md_to:"always",m_from:"always",m_to:"always",alwaysTime:!0},a.main={app:""}},a.$watch("interval",function(a){a&&r(a)},!0),a.updateSetAppdata=function(){a.application.variable&&a.application.value&&"Set"===a.main.app?a.application.appdata[0]=a.application.variable+"="+a.application.value:a.application.appdata[0]=null},a.updateSetAppdataSettings=function(){a.application.variable&&a.application.value&&"Set"===a.main.app?a.route.Applications[a.selectedApp].appdata[0]=a.application.variable+"="+a.application.value:a.application.appdata[0]=null},a.$watch("main.app",function(d){if(d){var e,f;switch(c.appId||(a.application={app:d,interval:a.application.interval||"*,*,*,*",appdata:[]}),d){case"Queue":e=l,f=m;break;case"Playback":e=m;break;case"AGI":e=n;break;case"Goto":e=o;break;case"Voicemail":e=q;break;default:e=null,f=null}if(e)return e.get().$promise.then(function(b){a.items=b.rows}).then(function(){return f?f.get().$promise:void 0}).then(function(b){b&&(a.items2=b.rows)})["catch"](function(a){h.show(b.instant(a.message),"danger")})}},!0),a.deselectAndRedirect=function(b){a.selectedApp=void 0,e.path(b)},a.getIntervals=function(){return p.get().$promise.then(function(b){a.Intervals=b.rows,d.syncUpdates("interval",a.Intervals)})["catch"](function(a){h.show(b.instant(a.message),"danger")})},a.getRoute=function(){return k.get({id:c.id}).$promise.then(function(b){a.route=b,a.gridOptions.data=b.Applications})["catch"](function(a){e.path("/channels/voice/routes/internal/list")})},a.getApplication=function(){console.log(a.selectedApp),void 0===a.selectedApp&&e.path("/channels/voice/routes/internal/list");var b=_.find(a.$application.applications,{value:a.route.Applications[a.selectedApp].app});if(a.main.app=b?b.value:"custom","Set"===a.main.app){var c=a.route.Applications[a.selectedApp].appdata[0].split("=");a.application.variable=c[0],a.application.value=c[1]}if(!b){var d=a.route.Applications[a.selectedApp].appdata.join(",");a.route.Applications[a.selectedApp].appdata=[d]}s()},a.openApplication=function(b){a.selectedApp=b,e.path("/channels/voice/routes/internal/view/"+c.id+"/applications/settings")},a.updateRoute=function(d){return a.selectedApp=void 0,a.route.exten=a.$application.checkUnderscore(a.route.exten),k.update({id:a.route.id},a.route).$promise.then(function(a){h.show(b.instant("MESSAGE_WELL_DONE")+"!","success"),d&&e.path("/channels/voice/routes/internal/view/"+c.id+"/"+d)})["catch"](function(a){h.show(b.instant(a.data.translatedMessage),"danger")})},a.getContexts=function(){return o.get().$promise.then(function(b){a.voiceContexts=b.rows,d.syncUpdates("voice_context",a.voiceContexts)})["catch"](function(a){h.show(b.instant(a.message),"danger")})},a.deleteApp=g.confirm["delete"](function(b){a.route.Applications.splice(b,1),a.updateRoute()}),a.addApplication=function(){a.route.Applications.push(a.application),a.updateRoute("applications")},a.goNext=function(){f.wizard().next()},a.previous=function(){f.wizard().previous()},a.formValidation=function(a){return a},a.$on("destroy",function(){d.unsyncUpdates("voice_extension")})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.routes.internal.view",{url:"/view/:id",templateUrl:"app/channels/voice/route/internal/view/view.html",controller:"VoiceRouteInternalViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.channels.voice.routes.internal.view.settings",{url:"/settings",templateUrl:"app/channels/voice/route/internal/view/view.settings.html"}).state("main.channels.voice.routes.internal.view.applications",{url:"/applications",templateUrl:"app/channels/voice/route/internal/view/view.applications.html"}).state("main.channels.voice.routes.internal.view.application",{url:"/application",templateUrl:"app/channels/voice/route/view.application.html"}).state("main.channels.voice.routes.internal.view.applications.settings",{url:"/settings",templateUrl:"app/channels/voice/route/view.applicationSettings.html"})}]),angular.module("xCallyShuttleApp").controller("VoiceRouteOutboundListCreateCtrl",["$scope","$uibModalInstance","Route","application","xAlert","$translate","$location","Tag",function(a,b,c,d,e,f,g,h){a.$application=d.application,a.forms={route:void 0},a.item={type:"outbound",appdata:"Outbound Call",context:"from-sip"},a.getTags=function(){return h.get().$promise.then(function(b){b.rows.unshift({name:"--"}),a.tags=b.rows})["catch"](function(a){e.show(f.instant(a.data.translatedMessage),"danger")})},a.ok=function(){return a.item.exten=a.$application.checkUnderscore(a.item.exten),c.save(a.item).$promise.then(function(a){b.close(a),g.path("/channels/voice/routes/outbound/view/"+a.id+"/routes")})["catch"](function(a){e.show(f.instant(a.data.translatedMessage),"danger")})},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("VoiceRouteOutboundListCtrl",["$scope","$http","socket","$translate","$rootScope","xAlert","Modal","stResource","gridOptions","Route","$uibModal","$location","$log",function(a,b,c,d,e,f,g,h,i,j,k,l,m){a.initView=function(){var b={exporterCsvFilename:"OutboundRoutes.csv",columnDefs:[{name:"exten",displayName:"APPLICATION_DESTINATION_PATTERN"},{name:"description"},{name:"applications",cellClass:"ui-grid-vcenter",cellTemplate:'<div data-ng-if="row.entity.Applications.length"><span data-ng-repeat="app in row.entity.Applications | limitTo:2">{{app.app}}({{app.appdata[0]}}),</span>...</div><div data-ng-if="!row.entity.Applications.length">{{\'MESSAGE_NO_AVAILABLE_APPLICATIONS\' | translate}}</div>',enableSorting:!1,enableFiltering:!1,enableColumnMenu:!1},{name:"action",width:170,buttons:[{"class":"blue-hoki",href:"/channels/voice/routes/outbound/view/{{row.entity.id}}/settings",name:"settings"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.exten, row.entity.id)"}]}]};a.gridOptions=i.gridOptions(j,b,a,{type:"outbound"})},a.create=function(){k.open({animation:!0,templateUrl:"app/channels/voice/route/outbound/list/create.modal.html",controller:"VoiceRouteOutboundListCreateCtrl"})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.routes.outbound.list",{url:"/list",templateUrl:"app/channels/voice/route/outbound/list/list.html",controller:"VoiceRouteOutboundListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.routes.outbound",{url:"/outbound",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("VoiceRouteOutboundViewCtrl",["$scope","xAlert","$translate","$stateParams","socket","$location","WizardHandler","Modal","application","interval","Route","Trunk","VoiceContext","Interval","Tag",function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){function p(b){var c,d;if("always"===b.intType)c=null,d="*,*,*,*";else if("list"===b.intType)d=b.IntervalId?_.find(a.Intervals,{id:b.IntervalId}).name:"*,*,*,*",c=b.IntervalId||null;else if("custom"===b.intType){c=null;var e,f,g,h;e=b.t_from&&b.t_to&&!b.alwaysTime?moment(b.t_from).format("HH:mm")+"-"+moment(b.t_to).format("HH:mm"):"*",b.wd_from&&"always"!==b.wd_from?(f=b.wd_from,b.wd_to&&"always"!==b.wd_to&&(f+="-"+b.wd_to)):f="*",b.md_from&&"always"!==b.md_from?(g=b.md_from,b.md_to&&"always"!==b.md_to&&(g+="-"+b.md_to)):g="*",b.m_from&&"always"!==b.m_from?(h=b.m_from,b.m_to&&"always"!==b.m_to&&(h+="-"+b.m_to)):h="*",d=e+","+f+","+g+","+h}void 0===a.selectedApp?(a.application.interval=d,a.application.IntervalId=c):(a.route.Applications[a.selectedApp].interval=d,a.route.Applications[a.selectedApp].IntervalId=c)}function q(){if(a.interval.intType=a.route.Applications[a.selectedApp].IntervalId?"list":"*,*,*,*"===a.route.Applications[a.selectedApp].interval?"always":"custom",a.interval.IntervalId=a.route.Applications[a.selectedApp].IntervalId,!a.route.Applications[a.selectedApp].IntervalId){var b,c=a.route.Applications[a.selectedApp].interval?a.route.Applications[a.selectedApp].interval.split(","):["*","*","*","*"];c.forEach(function(c,d){switch(d){case 0:"*"!==c?(b=c.split("-"),a.interval.t_from=moment(b[0],"HH:mm"),a.interval.t_to=moment(b[1],"HH:mm"),a.interval.alwaysTime=!1):(a.interval.t_from=moment(new Date),a.interval.t_to=moment(new Date),a.interval.alwaysTime=!0);break;case 1:"*"!==c?(b=c.split("-"),a.interval.wd_from=b[0],a.interval.wd_to=b[1]?b[1]:"always"):(a.interval.wd_from="always",a.interval.wd_to="always");break;case 2:"*"!==c?(b=c.split("-"),a.interval.md_from=b[0],a.interval.md_to=b[1]?b[1]:"always"):(a.interval.md_from="always",a.interval.md_to="always");break;case 3:"*"!==c?(b=c.split("-"),a.interval.m_from=b[0],a.interval.m_to=b[1]?b[1]:"always"):(a.interval.m_from="always",a.interval.m_to="always")}})}}a.$translate=c,a.$application=i.application,a.$interval=j.interval,a.recordSwitch={onText:"On",offText:"Off",isActive:!0,size:"small",animate:!0,radioOff:!0,handleWidth:"auto",labelWidth:"auto",inverse:!0,offColor:"danger",onColor:"success"},a.gridOptions={rowTemplate:'<div grid="grid" class="ui-grid-draggable-row" draggable="true"><div ng-repeat="(colRenderIndex, col) in colContainer.renderedColumns track by col.colDef.name" class="ui-grid-cell" ng-class="{ \'ui-grid-row-header-cell\': col.isRowHeader, \'custom\': true }" ui-grid-cell></div></div>',columnDefs:[{name:"app",displayName:"APPLICATION_APPLICATION",cellClass:"ui-grid-vcenter",cellTemplate:"<div><span data-ng-if=\"row.entity.app === 'Dial'\">Default</span><span data-ng-if=\"row.entity.app !== 'Dial'\">{{row.entity.app}}</span></div>",headerCellFilter:"translate",enableSorting:!1,enableColumnMenu:!1},{name:"appdata",displayName:"APPLICATION_ARGUMENTS",headerCellFilter:"translate",cellClass:"ui-grid-vcenter",cellTemplate:"<div>{{row.entity.appdata.join(',')}}</div>",enableSorting:!1,enableColumnMenu:!1},{name:"interval",displayName:"APPLICATION_TIME",headerCellFilter:"translate",enableSorting:!1,enableColumnMenu:!1},{name:"action",displayName:"APPLICATION_ACTION",enableSorting:!1,enableColumnMenu:!1,headerCellFilter:"translate",width:125,cellTemplate:'<a class="btn btn-xs blue-hoki" data-ng-click="grid.appScope.openApplication(grid.appScope.gridOptions.data.indexOf(row.entity))">{{\'APPLICATION_SETTINGS\' | translate}}</a><a class="btn btn-xs red-sunglo" data-ng-click="grid.appScope.deleteApp(row.entity.app+\' application\', grid.appScope.gridOptions.data.indexOf(row.entity))">{{\'APPLICATION_DELETE\' | translate}}</a>'}],onRegisterApi:function(b){b.draggableRows.on.rowDropped(a,function(b,c){a.updateRoute()})}},a.initApplication=function(b){b&&(a.selectedApp=void 0),a.forms={info:void 0,interval:void 0},a.application={},a.interval={intType:"always",t_from:moment(new Date),t_to:moment(new Date),wd_from:"always",wd_to:"always",md_from:"always",md_to:"always",m_from:"always",m_to:"always",alwaysTime:!0},a.main={app:""},a.applications=[{name:"Default",value:"Dial"},{name:"Custom",value:"custom"}]},a.$watch("interval",function(a){a&&p(a)},!0),a.$watch("main.app",function(e){if(e){var f,g;switch(d.appId||(a.application={app:e,interval:a.application.interval||"*,*,*,*",appdata:[]}),e){case"Dial":f=l,g=m;break;default:f=null,g=null}if(f)return f.get().$promise.then(function(b){a.items=b.rows}).then(function(){return g?g.get().$promise:void 0}).then(function(b){b&&(a.items2=b.rows)})["catch"](function(a){b.show(c.instant(a.message),"danger")})}},!0),a.deselectAndRedirect=function(b){a.selectedApp=void 0,f.path(b)},a.getIntervals=function(){return n.get().$promise.then(function(b){a.Intervals=b.rows,e.syncUpdates("interval",a.Intervals)})["catch"](function(a){b.show(c.instant(a.message),"danger")})},a.getRoute=function(){return k.get({id:d.id}).$promise.then(function(b){a.route=b,a.gridOptions.data=b.Applications})["catch"](function(a){f.path("/channels/voice/routes/outbound/list")})},a.getApplication=function(){void 0===a.selectedApp&&f.path("/channels/voice/routes/outbound/list");var b=_.find(a.applications,{value:a.route.Applications[a.selectedApp].app});if(a.main.app=b?b.value:"custom",!b){var c=a.route.Applications[a.selectedApp].appdata.join(",");a.route.Applications[a.selectedApp].appdata=[c]}q()},a.openApplication=function(b){a.selectedApp=b,f.path("/channels/voice/routes/outbound/view/"+d.id+"/routes/settings")},a.updateRoute=function(e){return a.selectedApp=void 0,a.route.exten=a.$application.checkUnderscore(a.route.exten),k.update({id:a.route.id},a.route).$promise.then(function(a){b.show(c.instant("MESSAGE_WELL_DONE")+"!","success"),e&&f.path("/channels/voice/routes/outbound/view/"+d.id+"/"+e)})["catch"](function(a){b.show(c.instant(a.data.translatedMessage),"danger")})},a.getContexts=function(){return m.get().$promise.then(function(b){a.voiceContexts=b.rows,e.syncUpdates("voice_context",a.voiceContexts)})["catch"](function(a){b.show(c.instant(a.message),"danger")})},a.getTags=function(){return o.get().$promise.then(function(b){b.rows.unshift({name:"--"}),a.tags=b.rows})["catch"](function(a){b.show(c.instant(a.data.translatedMessage),"danger")})},a.deleteApp=h.confirm["delete"](function(b){a.route.Applications.splice(b,1),a.updateRoute()}),a.addApplication=function(){a.route.Applications.push(a.application),a.updateRoute("routes")},a.goNext=function(){g.wizard().next()},a.previous=function(){g.wizard().previous()},a.formValidation=function(a){return a},a.$on("destroy",function(){e.unsyncUpdates("voice_extension")})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.routes.outbound.view",{url:"/view/:id",templateUrl:"app/channels/voice/route/outbound/view/view.html",controller:"VoiceRouteOutboundViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.channels.voice.routes.outbound.view.settings",{url:"/settings",templateUrl:"app/channels/voice/route/outbound/view/view.settings.html"}).state("main.channels.voice.routes.outbound.view.routes",{url:"/routes",templateUrl:"app/channels/voice/route/outbound/view/view.routes.html"}).state("main.channels.voice.routes.outbound.view.route",{url:"/route",templateUrl:"app/channels/voice/route/outbound/view/view.route.html"}).state("main.channels.voice.routes.outbound.view.routes.settings",{url:"/settings",templateUrl:"app/channels/voice/route/outbound/view/view.routeSettings.html"})}]),angular.module("xCallyShuttleApp").factory("Route",["$resource",function(a){return a("/api/voice/extensions/:id",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.routes",{url:"/routes",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice",{url:"/voice",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").controller("VoiceVoicemailListCtrl",["$scope","VoiceMail","gridOptions",function(a,b,c){a.initView=function(){var d={exporterCsvFilename:"voice_mails.csv",primaryKey:"uniqueid",columnDefs:[{name:"mailbox"},{name:"fullname"},{name:"email"},{name:"action",width:125,buttons:[{"class":"blue-hoki",href:"/channels/voice/voicemails/view/{{row.entity.uniqueid}}/settings",name:"profile"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.mailbox, row.entity.uniqueid)"}]}]};a.gridOptions=c.gridOptions(b,d,a)}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.voicemails.list",{url:"/list",templateUrl:"app/channels/voice/voicemail/list/list.html",controller:"VoiceVoicemailListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").controller("VoiceVoicemailViewCtrl",["$scope","VoiceMail","VoiceMailMessage","VoiceContext","$http","xAlert","$translate","$stateParams","socket","$sce","Modal","$location","gridOptions",function(a,b,c,d,e,f,g,h,i,j,k,l,m){function n(){var b={exporterCsvFilename:"voice_mail_messages.csv",primaryKey:"id",columnDefs:[{name:"callerid"},{name:"stamp",displayName:"APPLICATION_DATE",cellClass:"ui-grid-vcenter",cellTemplate:"<div>{{grid.appScope.moment(row.entity.stamp).format('YYYY-MM-DD HH:mm:ss')}}</div>"},{name:"duration",cellClass:"ui-grid-vcenter",cellTemplate:"<div>{{row.entity.duration*1000 | date:'mm:ss'}}</div>"},{name:"audio",displayName:"",width:225,enableSorting:!1,enableFiltering:!1,buttons:[{directive:'<audio-file-download params="{id:row.entity.id,controller:\'download\'}" resource="grid.appScope.VoiceMailMessage"></audio-file-download>'}]},{name:"action",width:150,buttons:[{directive:'<motion-file-download params="{id:row.entity.id,controller:\'download\'}" resource="grid.appScope.VoiceMailMessage" mimetype="audio/wav" btnclass="btn btn-xs blue-hoki" filename="row.entity.msg_id+\'.wav\'"></motion-file-download>'},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.id, row.entity.id)"}]}]};a.gridOptions=m.gridOptions(c,b,a,{mailbox:a.voicemail.mailbox,context:a.voicemail.context})}a.moment=moment,a.VoiceMailMessage=c,a.getVoicemail=function(){return b.get({id:h.uniqueid}).$promise.then(function(b){delete b.password,delete b.stamp,a.voicemail=b})["catch"](function(a){l.path("/voice/voicemails/list")})},a.updateVoiceVoicemail=function(){return b.update({id:h.uniqueid},a.voicemail).$promise.then(function(){f.show(g.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){f.show(g.instant(a.message),"danger")})},a.getContexts=function(){return d.get().$promise.then(function(b){a.voiceContexts=b.rows})["catch"](function(a){f.show(a.message,"danger")})},a.getMessages=function(){return a.voicemail?void n():b.get({id:h.uniqueid}).$promise.then(function(b){delete b.password,delete b.stamp,a.voicemail=b,n()})["catch"](function(a){l.path("/voice/voicemails/view/"+h.uniqueid+"/settings")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.voicemails.view",{url:"/view/:uniqueid",templateUrl:"app/channels/voice/voicemail/view/view.html",controller:"VoiceVoicemailViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.channels.voice.voicemails.view.settings",{url:"/settings",templateUrl:"app/channels/voice/voicemail/view/view.settings.html"}).state("main.channels.voice.voicemails.view.messages",{url:"/messages",templateUrl:"app/channels/voice/voicemail/view/view.messages.html"})}]),angular.module("xCallyShuttleApp").factory("VoiceMail",["$resource",function(a){return a("/api/voice/voicemails/:id/:controller",{uniqueid:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.voicemails",{url:"/voicemails",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").factory("VoiceMailMessage",["$resource",function(a){return a("/api/voice/voicemails/messages/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").controller("VoiceVoicemailWizardCtrl",["$scope","VoiceMail","xAlert","WizardHandler","$location","Setting",function(a,b,c,d,e,f){a.initWizard=function(){a.form={},a.item={context:"from-voicemail"}},a.next=function(){d.wizard().next()},a.previous=function(){d.wizard().previous()},a.exitValidation=function(a){return a},a.getFirstFreeMailbox=function(){f.get({controller:"mailbox"}).$promise.then(function(b){a.item.mailbox=b.value})["catch"](function(a){c.show(a.data.message,"danger")})},a.createItem=function(){return a.item.customer_id=a.item.mailbox,b.save(a.item).$promise.then(function(){e.path("/channels/voice/voicemails/list")})["catch"](function(a){c.show(data.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.voicemails.wizard",{url:"/wizard",templateUrl:"app/channels/voice/voicemail/wizard/wizard.html",controller:"VoiceVoicemailWizardCtrl"})}]),angular.module("xCallyShuttleApp").factory("VoiceQueue",["$resource",function(a){return a("/api/voice/queues/:id/:controller",{name:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").factory("Company",["$resource",function(a){return a("/api/contactmanager/companies/:id/:controller",{name:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.contactmanager.companies",{url:"/companies",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("CompanyListCreateModalCtrl",["$scope","$uibModalInstance",function(a,b){
+a.forms={dashboard:void 0},a.item={},a.ok=function(){a.item.model=JSON.stringify({title:a.item.name}),b.close(a.item)},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("ContactManagerCompanyListCtrl",["$scope","$http","$translate","xAlert","Modal","$uibModal","$log","Company","gridOptions","$location",function(a,b,c,d,e,f,g,h,i,j){a.initView=function(){var b={exporterCsvFilename:"Companies.csv",columnDefs:[{name:"name"},{name:"description"},{name:"action",width:125,buttons:[{"class":"blue-hoki",name:"profile",href:"/contactmanager/companies/view/{{row.entity.id}}/settings"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=i.gridOptions(h,b,a)},a.create=function(){var a=f.open({animation:!0,templateUrl:"app/contactmanager/company/list/create.modal.html",controller:"CompanyListCreateModalCtrl"});a.result.then(function(a){b.post("/api/contactmanager/companies",a).then(function(a){j.path("/contactmanager/companies/view/"+a.id+"/settings")})["catch"](function(a){d.show(a.data.message,"danger")})},function(){g.info("Modal dismissed at: "+new Date)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.contactmanager.companies.list",{url:"/list",templateUrl:"app/contactmanager/company/list/list.html",controller:"ContactManagerCompanyListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").controller("ContactManagerCompanyViewCtrl",["$scope","$http","xAlert","$translate","$stateParams","$location",function(a,b,c,d,e,f){a.getCompany=function(){b.get("/api/contactmanager/companies/"+e.id).success(function(b){a.company=b}).error(function(a){f.path("/contactmanager/companies/list")})},a.updateCompany=function(){var f=angular.copy(a.company);b.put("/api/contactmanager/companies/"+e.id,f).success(function(){c.show(d.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(b){c.show(d.instant(b.message),"danger"),a.company=f})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.contactmanager.companies.view",{url:"/view/:id",templateUrl:"app/contactmanager/company/view/view.html",controller:"ContactManagerCompanyViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.contactmanager.companies.view.settings",{url:"/settings",templateUrl:"app/contactmanager/company/view/view.settings.html"})}]),angular.module("xCallyShuttleApp").factory("Contact",["$resource",function(a){return a("/api/contactmanager/contacts/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.contactmanager.contacts",{url:"/contacts",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("ContactManagerListImportModalCtrl",["$scope","$uibModalInstance","indexes","csv","xAlert","socket","$http","$translate",function(a,b,c,d,e,f,g,h){function i(b){if(b>=a.csvLength||a.stopped)return void(a.importing=!1);var c={Phones:[],Emails:[],customFields:{}};_.forOwn(a.item,function(e,f){switch(f){case"Phones":a.item.Phones.forEach(function(a){""!==d[b][a]&&c.Phones.push({phone:d[b][a]})});break;case"Emails":a.item.Emails.forEach(function(a){""!==d[b][a]&&c.Emails.push({email:d[b][a]})});break;case"customFields":_.forOwn(a.item.customFields,function(a,e){c.customFields[e]=d[b][a]});break;case"tags":c.tags=[],a.item.tags.forEach(function(a){""!==d[b][a]&&c.tags.push(d[b][a])});break;default:c[f]=d[b][e]}}),c.tags=c.tags?c.tags.join(","):void 0,_.forOwn(c.customFields,function(a,b){""===a&&delete c.customFields[b]}),c.ServiceId=a.item.ServiceId,c.CompanyId=a.item.CompanyId||null,g.post("/api/contactmanager/contacts",c).success(function(c){a["import"].success+=j,a["import"].succeeded+=1,i(b+1)}).error(function(c){a["import"].fail+=j,a["import"].failed+=1,i(b+1)})}a.indexes=c,a.importing=!1,a.submitted=!1,a.stopped=!1,a["import"]={success:0,fail:0,succeeded:0,failed:0},a.csvLength=d.length;var j=100/a.csvLength;a.forms={dashboard:void 0},a.item={},a.start=function(){a.importing=!0,a.submitted=!0,i(0)},a.getServices=function(){g.get("/api/contactmanager/services/").success(function(b){a.services=b.rows,a.item.ServiceId=1,a.getCustomFields()}).error(function(a){e.show(h.instant(a.message)+"!","danger")})},a.getCustomFields=function(){g.get("/api/contactmanager/services/"+a.item.ServiceId+"/customfields").success(function(b){a.customFields=b,a.customFields.forEach(function(a){a.values=JSON.parse(a.values)}),f.socket.on("custom_field:remove",function(b){_.remove(a.customFields,function(a){return b.id==a.id})}),f.socket.on("custom_field:save",function(b){if(b.ServiceId===a.item.ServiceId){var c=_.find(a.customFields,{id:b.id});c||("string"==typeof b.values&&(b.values=JSON.parse(b.values)),a.customFields.push(b))}})}).error(function(a){console.error(a),e.show(a.message,"danger")})},a.close=function(){b.close()},a.stop=function(){a.stopped=!0}}]),angular.module("xCallyShuttleApp").controller("ContactManagerContactListCtrl",["$scope","$translate","Modal","FileUploader","Papa","$uibModal","$log","Contact","gridOptions","Service","uiGridConstants","xAlert",function(a,b,c,d,e,f,g,h,i,j,k,l){a.initView=function(){return j.get().$promise.then(function(b){a.services=[],b.rows.forEach(function(b,c){a.services.push({value:b.id,label:b.name})})}).then(function(){var b={exporterCsvFilename:"Contacts.csv",columnDefs:[{name:"firstName"},{name:"lastName"},{name:"phone"},{name:"mobile"},{name:"email"},{name:"ServiceId",displayName:"APPLICATION_SERVICE",field:"Service.name",filter:{type:k.filter.SELECT,selectOptions:a.services}},{name:"description"},{name:"action",width:125,buttons:[{"class":"blue-hoki",name:"profile",onClick:"grid.appScope.openContactTab(row.entity)"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.fullname, row.entity.id)"}]}]};a.gridOptions=i.gridOptions(h,b,a)})["catch"](function(a){l.show(b.instant(a.message)+"!","danger")})},d.FileSelect.prototype.isEmptyAfterSelection=function(){return!0};var m=a.uploader=new d({queueLimit:1,clearInputAfterAddedToQueue:!0});m.onAfterAddingFile=function(b){console.log("fileadded"),e.parse(b._file,{header:!0,complete:function(b){a.uploader.clearQueue(),a["import"](b.data)},error:function(a){console.log(a)}})},a["import"]=function(b){var c=f.open({animation:!0,size:"lg",backdrop:"static",keyboard:!1,templateUrl:"app/contactmanager/contact/list/import.modal.html",controller:"ContactManagerListImportModalCtrl",resolve:{indexes:function(){return _.keys(b[0])},csv:function(){return b}}});c.result.then(function(b){a.gridOptions.getPage()},function(){g.info("Modal dismissed at: "+new Date)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.contactmanager.contacts.list",{url:"/list",templateUrl:"app/contactmanager/contact/list/list.html",controller:"ContactManagerContactListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.contactmanager",{url:"/contactmanager",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").controller("ContactManagerServiceListCreateModalCtrl",["$scope","$uibModalInstance",function(a,b){a.forms={dashboard:void 0},a.item={},a.ok=function(){b.close(a.item)},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("ContactManagerServiceListCtrl",["$scope","$http","$translate","Modal","xAlert","$uibModal","$log","Service","gridOptions",function(a,b,c,d,e,f,g,h,i){a.initView=function(){var b={exporterCsvFilename:"Services.csv",columnDefs:[{name:"name"},{name:"description"},{name:"action",width:125,buttons:[{"class":"blue-hoki",name:"settings",href:"/contactmanager/services/view/{{row.entity.id}}/settings"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=i.gridOptions(h,b,a)},a.create=function(){var d=f.open({animation:!0,templateUrl:"app/contactmanager/service/list/create.modal.html",controller:"ContactManagerServiceListCreateModalCtrl"});d.result.then(function(d){b.post("/api/contactmanager/services/",d).then(function(b){a.gridOptions.getPage(),e.show(c.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){e.show(a.data.message,"danger")})},function(){g.info("Modal dismissed at: "+new Date)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.contactmanager.services.list",{url:"/list",templateUrl:"app/contactmanager/service/list/list.html",controller:"ContactManagerServiceListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").factory("Service",["$resource",function(a){return a("/api/contactmanager/services/:serviceId/:controller/:id",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.contactmanager.services",{url:"/services",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("ContactManagerServiceCustomFieldViewCreateModalCtrl",["$scope","$uibModalInstance","$translate",function(a,b,c){a.$translate=c,a.forms={dashboard:void 0},a.item={},a.choices=[{value:""}],a.addField=function(){a.choices.push({})},a.removeField=function(b){a.choices.splice(b,1)},a.types=[{name:"APPLICATION_TEXT",value:"text"},{name:"APPLICATION_SELECT",value:"select"}],a.ok=function(){"select"===a.item.type&&(a.item.values=angular.toJson(a.choices)),b.close(a.item)},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("ContactManagerServiceViewCtrl",["$scope","xAlert","$translate","$stateParams","socket","$location","$uibModal","$log","Modal","Service","Team","gridOptions",function(a,b,c,d,e,f,g,h,i,j,k,l){var m=function(){return{select:function(b){return j.save({serviceId:a.service.id,controller:"agents"},{agents:b}).$promise.then(function(){a.getTeams()})["catch"](function(a){console.log(a)})},deselect:function(b){return j["delete"]({serviceId:a.service.id,controller:"agents",agents:b}).$promise.then(function(){a.getTeams()})["catch"](function(a){console.log(a)})}}};a.getService=function(){return j.get({serviceId:d.id}).$promise.then(function(b){a.service=b})["catch"](function(a){f.path("/contactmanager/services/list")})},a.updateService=function(){return j.update({serviceId:d.id},a.service).$promise.then(function(){b.show(c.instant("MESSAGE_WELL_DONE")+"!","success")})["catch"](function(a){b.show(c.instant(a.message),"danger")})},a.getTeams=function(){return k.get().$promise.then(function(b){return a.teams=b.rows,j.query({serviceId:d.id,controller:"agents"}).$promise}).then(function(b){ComponentsDropdowns.bindQueue(a.teams,_.map(b,function(a){return{id:a.id}}),m)})["catch"](function(a){console.error(a)})},a.initCustomFields=function(){var b={exporterCsvFilename:"customfields.csv",primaryKey:"id",columnDefs:[{name:"name"},{name:"type"},{name:"description"},{name:"action",width:200,buttons:[{"class":"blue-hoki",href:"/contactmanager/services/view/{{grid.appScope.$stateParams.id}}/customfields/settings/{{row.entity.id}}",name:"settings"},{"class":"red-sunglo",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)",name:"delete"}]}]};a.gridOptions=l.gridOptions(j,b,a,{serviceId:d.id,controller:"customfields"})},a.create=function(){var e=g.open({animation:!0,templateUrl:"app/contactmanager/service/view/create.modal.html",controller:"ContactManagerServiceCustomFieldViewCreateModalCtrl"});e.result.then(function(e){return j.save({serviceId:d.id,controller:"customfields"},e).$promise.then(function(d){a.gridOptions.getPage(),b.show(c.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){b.show(a.message||a.data.message,"danger")})},function(){h.info("Modal dismissed at: "+new Date)})},a.getCustomField=function(){return j.get({serviceId:d.id,controller:"customfields",id:d.cfId}).$promise.then(function(b){console.log(b),a.customField=b,"select"===a.customField.type&&(a.choices=JSON.parse(a.customField.values))})["catch"](function(a){console.error(a),f.path("/contactmanager/customfields/list")})},a.updateCustomField=function(){var e=angular.copy(a.customField);return"select"===e.type&&(e.values=angular.toJson(a.choices)),j.update({serviceId:d.id,controller:"customfields",id:d.cfId},e).$promise.then(function(){b.show(c.instant("MESSAGE_WELL_DONE")+"!","success")})["catch"](function(a){b.show(c.instant(a.message),"danger")})},a.addField=function(){a.choices.push({})},a.removeField=function(b){a.choices.splice(b,1)}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.contactmanager.services.view",{url:"/view/:id",templateUrl:"app/contactmanager/service/view/view.html",controller:"ContactManagerServiceViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.contactmanager.services.view.settings",{url:"/settings",templateUrl:"app/contactmanager/service/view/view.settings.html"}).state("main.contactmanager.services.view.agents",{url:"/agents",templateUrl:"app/contactmanager/service/view/view.agents.html",cache:!1,serie:!0,resolve:{deps:["$ocLazyLoad",function(a){return a.load({insertBefore:"#ng_load_plugins_before",files:["assets/plugins/jquery-multi-select/css/multi-select.css","assets/plugins/jquery-multi-select/js/jquery.multi-select.js","assets/plugins/jquery-quicksearch/jquery.quicksearch.js","assets/scripts/components-dropdowns.js"]})}]}}).state("main.contactmanager.services.view.customfields",{url:"/customfields",templateUrl:"app/contactmanager/service/view/view.customFields.html"}).state("main.contactmanager.services.view.customfields.settings",{url:"/settings/:cfId",templateUrl:"app/contactmanager/service/view/view.customFieldSettings.html",controller:"ContactManagerServiceViewCtrl"})}]),angular.module("xCallyShuttleApp").controller("DashboardCtrl",["$scope","$translate",function(a,b){a.voice=[{name:b.instant("APPLICATION_QUEUE"),link:"main.dashboard.voice"}],a.mail=[{name:b.instant("APPLICATION_QUEUE"),link:"main.dashboard.mail"}]}]),angular.module("xCallyShuttleApp").factory("Dashboard",["$resource",function(a){return a("/api/dashboards/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.dashboard",{"abstract":!0,url:"/dashboard",templateUrl:"app/dashboard/dashboard.html",controller:"DashboardCtrl"}).state("main.dashboard.voice",{url:"/voice",controller:"DashboardVoiceCtrl",templateUrl:"app/dashboard/voice/voice.html"}).state("main.dashboard.mail",{url:"/mail",controller:"DashboardMailCtrl",templateUrl:"app/dashboard/mail/mail.html"})}]),angular.module("xCallyShuttleApp").controller("DashboardMailCtrl",["$scope",function(a){a.message="Hello"}]),angular.module("xCallyShuttleApp").controller("DashboardVoiceCtrl",["$scope","Auth","ReportQueue","ReportCall","socket",function(a,b,c,d,e){a.Auth=b,a.initWaiting=function(){return c.get({id:"waiting"}).$promise.then(function(b){a.waiting=b.value,e.socket.on("dashboard:waiting",function(b){a.waiting=b.value})})["catch"](function(a){console.error(a)})},a.initActive=function(){return c.get({id:"active"}).$promise.then(function(b){a.active=b.value,e.socket.on("dashboard:active",function(b){a.active=b.value})})["catch"](function(a){console.error(a)})},a.initAnswered=function(){return c.get({id:"answered"}).$promise.then(function(b){a.answered=b.value,e.socket.on("dashboard:answered",function(b){a.answered=b.value})})["catch"](function(a){console.error(a)})},a.initAbandoned=function(){return c.get({id:"abandoned"}).$promise.then(function(b){a.abandoned=b.value,e.socket.on("dashboard:abandoned",function(b){a.abandoned=b.value})})["catch"](function(a){console.error(a)})},a.initAvgAnswerTime=function(){return c.get({id:"avganswertime"}).$promise.then(function(b){a.avganswertime=b.value,e.socket.on("dashboard:avganswertime",function(b){a.avganswertime=b.value})})["catch"](function(a){console.error(a)})},a.initAvgTalkTime=function(){return c.get({id:"avgtalktime"}).$promise.then(function(b){a.avgtalktime=b.value,e.socket.on("dashboard:avgtalktime",function(b){a.avgtalktime=b.value})})["catch"](function(a){console.error(a)})},a.initAnswerRate=function(){return c.get({id:"answerrate"}).$promise.then(function(b){a.answerrate=b.value,e.socket.on("dashboard:answerrate",function(b){a.answerrate=b.value})})["catch"](function(a){console.error(a)})},a.initTotalOffered=function(){return c.get({id:"totaloffered"}).$promise.then(function(b){a.totaloffered=b.value,e.socket.on("dashboard:totaloffered",function(b){a.totaloffered=b.value})})["catch"](function(a){console.error(a)})},a.initUnmanaged=function(){return c.get({id:"unmanaged"}).$promise.then(function(b){a.unmanaged=b.value,e.socket.on("dashboard:unmanaged",function(b){a.unmanaged=b.value})})["catch"](function(a){console.error(a)})},a.initAbandonRate=function(){return c.get({id:"abandonrate"}).$promise.then(function(b){a.abandonrate=b.value,e.socket.on("dashboard:abandonrate",function(b){a.abandonrate=b.value})})["catch"](function(a){console.error(a)})},a.initManualOutbound=function(){return d.get({id:"manualoutbound"}).$promise.then(function(b){a.manualoutbound=b.value,e.socket.on("dashboard:manualoutbound",function(b){a.manualoutbound=b.value})})["catch"](function(a){console.error(a)})},a.initManualOutboundGlobalDuration=function(){return d.get({id:"manualoutboundglobalduration"}).$promise.then(function(b){a.manualoutboundglobalduration=b.value,e.socket.on("dashboard:manualoutboundglobalduration",function(b){a.manualoutboundglobalduration=b.value})})["catch"](function(a){console.error(a)})},a.initManualOutboundAvgDuration=function(){return d.get({id:"manualoutboundavgduration"}).$promise.then(function(b){a.manualoutboundavgduration=b.value,e.socket.on("dashboard:manualoutboundavgduration",function(b){a.manualoutboundavgduration=b.value})})["catch"](function(a){console.error(a)})},a.initManualOutboundAnswered=function(){return d.get({id:"manualoutboundanswered"}).$promise.then(function(b){a.manualoutboundanswered=b.value,e.socket.on("dashboard:manualoutboundanswered",function(b){a.manualoutboundanswered=b.value})})["catch"](function(a){console.error(a)})},a.initManualOutboundAnswerRate=function(){return d.get({id:"manualoutboundanswerrate"}).$promise.then(function(b){a.manualoutboundanswerrate=b.value,e.socket.on("dashboard:manualoutboundanswerrate",function(b){a.manualoutboundanswerrate=b.value})})["catch"](function(a){console.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.desk",{url:"/desk",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").factory("DeskAccount",["$resource",function(a){return a("/api/desk/accounts/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").controller("DeskListCtrl",["$scope","$http","$rootScope","xAlert","$translate","socket","Modal","stResource",function(a,b,c,d,e,f,g,h){a.conf={accountsByPage:{name:"10",value:10}},a.accountsByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.accounts={checked:[]},a.check=function(b,c){c?a.accounts.checked=angular.copy(_.map(a.displayedDeskAccounts,"id")):a.accounts.checked=[]},a.getAccounts=function(b){return _.map(a.displayedDeskAccounts,function(a){var c={};return b.forEach(function(b){c[b]=a[b]}),c})},a.initList=function(b){f.unsyncUpdates("desk_account"),b.url="/api/desk/accounts",h.getPage(b).then(function(d){a.displayedDeskAccounts=d.rows,b.pagination.numberOfPages=d.total_pages,c.updateTableConfig(a.accountsByPage,a.displayedDeskAccounts.length),c.updateTableConfig(a.conf.accountsByPage,a.displayedDeskAccounts.length)}),f.socket.on("desk_account:save",function(){a.initList(b)}),f.socket.on("desk_account:remove",function(c){a.accounts.checked=_.without(a.accounts.checked,c.id),a.initList(b)})},a.deleteItem=g.confirm["delete"](function(a){b["delete"]("/api/desk/accounts/"+a).success(function(){d.show(e.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(a){d.show(e.instant(a.message),"danger")})}),a.deleteItems=g.confirm["delete"](function(){b["delete"]("/api/desk/accounts",{params:{id:a.accounts.checked}}).success(function(){d.show(e.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){d.show(e.instant(a.message),"danger")})}),a.checkAccount=function(a){b.get("/api/desk/accounts/"+a+"/check").then(function(){d.show(e.instant("MESSAGE_ACCOUNT_VERIFIED"),"success")})["catch"](function(){d.show(e.instant("MESSAGE_ACCOUNT_INVALID"),"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.desk.list",{url:"/list",templateUrl:"app/desk/list/list.html",controller:"DeskListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").controller("DeskViewCtrl",["$scope","$http","$stateParams","$translate","$location","WizardHandler","socket","xAlert","Modal","desk_com",function(a,b,c,d,e,f,g,h,i,j){a.$stateParams=c,a.config={autoHideScrollbar:!1,theme:"dark",advanced:{updateOnContentResize:!0},setHeight:500,scrollInertia:0},a.initConfiguration=function(){a.formsConfiguration={},a.configuration={}},a.goNext=function(){f.wizard().next()},a.formValidation=function(a){return a},a.$on("$destroy",function(){g.unsyncUpdates("desk_configuration"),g.unsyncUpdates("desk_field")}),a.initView=function(){b.get("/api/desk/accounts/"+c.id).success(function(b){a.account=b}).error(function(a){h.show(a.message,"danger")})},a.updateItem=function(){b.put("/api/desk/accounts/"+c.id,a.account).success(function(){h.show(d.instant("MESSAGE_WELL_DONE")+".","success")}).error(function(){h.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG")+".","danger")})},a.getConfigurations=function(){b.get("/api/desk/configurations",{params:{AccountId:c.id}}).success(function(b){a.configurations=b,g.socket.on("desk_configuration:remove",function(b){_.remove(a.configurations,{id:b.id})})}).error(function(a){h.show(a.message,"danger")})},a.deleteConfiguration=i.confirm["delete"](function(a){b["delete"]("api/desk/configurations/"+a).success(function(){h.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(){h.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})}),a.createConfiguration=function(){a.configuration.AccountId=c.id,b.post("api/desk/configurations",a.configuration).success(function(a){e.path("desk/view/"+c.id+"/configurations/settings/"+a.id)}).error(function(){h.show("Something went wrong!","danger")})},a.fieldType=["string","variable"],a.descFieldType=["string","key_value"],a.getFields=function(){b.get("/api/desk/accounts/"+c.id+"/fields").success(function(b){a.accountFields=j.fields.concat(b)}).error(function(a){h.show(a.message,"danger")})},a.getConfiguration=function(){b.get("/api/desk/configurations/"+c.configurationId).success(function(b){a.configurationName=b.name,a.subjectConfig=b.Subject,a.descriptionConfig=b.Description,a.fieldConfig=b.Field,g.socket.on("desk_field:remove",function(b){_.remove(a.subjectConfig,{id:b.id}),_.remove(a.descriptionConfig,{id:b.id}),_.remove(a.fieldConfig,{id:b.id})})}).error(function(a){h.show(a.message,"danger")})},a.getVariables=function(){b.get("/api/variables").success(function(b){a.variables=b.rows}).error(function(a){h.show(a.message,"danger")})},a.removeItem=function(a){b["delete"]("api/desk/fields/"+a.id).success(function(){h.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(){h.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})},a.addItemSubject=function(){var d={type:"string",content:""};b.post("/api/desk/configurations/"+c.configurationId+"/subject",d).success(function(b){a.subjectConfig.push(b)}).error(function(){h.show("Something went wrong!","danger")})},a.addItemDescription=function(){var d={type:"string",content:""};b.post("/api/desk/configurations/"+c.configurationId+"/description",d).success(function(b){a.descriptionConfig.push(b)}).error(function(){h.show("Something went wrong!","danger")})},a.addItemField=function(){var d={content:""};b.post("/api/desk/configurations/"+c.configurationId+"/field",d).success(function(b){a.fieldConfig.push(b)}).error(function(){h.show("Something went wrong!","danger")})},a.updateField=function(a){b.put("/api/desk/fields/"+a.id,a).success(function(){}).error(function(){h.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG")+".","danger")})},a.changeType=function(b){"variable"===b.type?b.content="":"string"===b.type&&(b.VariableId=null),a.updateField(b)},a.changeDescType=function(b){"key_value"===b.type?(b.content="","string"===b.keyType?b.VariableId=null:"variable"===b.keyType&&(b.keyContent="")):"string"===b.type&&(b.VariableId=null,b.key="",b.keyContent=""),a.updateField(b)},a.changeFieldType=function(b){if(b.content="",b.idField){var c=_.find(a.accountFields,"id",b.idField);c&&(b.customField=_.result(c,"custom",!0))}a.updateField(b)},a.getSystemFieldOptions=function(b){if(b){var c=_.find(a.accountFields,"id",b);return c?c.data.choices?c.data.choices:null:void 0}}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.desk.view",{url:"/view/:id",templateUrl:"app/desk/view/view.html",controller:"DeskViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.desk.view.account",{url:"/account",templateUrl:"app/desk/view/view.account.html"}).state("main.desk.view.configurations",{url:"/configurations",templateUrl:"app/desk/view/view.configurations.html"}).state("main.desk.view.configurations.settings",{url:"/settings/:configurationId",templateUrl:"app/desk/view/view.configurationSettings.html",controller:"DeskViewCtrl"}).state("main.desk.view.configuration",{url:"/configuration",templateUrl:"app/desk/view/view.configuration.html"})}]),angular.module("xCallyShuttleApp").controller("DeskWizardCtrl",["$scope","$http","$location","$translate","xAlert","WizardHandler",function(a,b,c,d,e,f){a.translate=d,a.initWizard=function(){a.$translate=d,a.forms={},a.item={}},a.next=function(){f.wizard().next()},a.exitValidation=function(a){return a},a.createItem=function(){console.log(a.item),b.post("api/desk/accounts",a.item).success(function(){e.show(d.instant("MESSAGE_WELL_DONE")+".","success"),c.path("/desk/list")}).error(function(){e.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG")+".","danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.desk.wizard",{url:"/wizard",templateUrl:"app/desk/wizard/wizard.html",controller:"DeskWizardCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.freshdesk",{url:"/freshdesk",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").factory("FreshdeskAccount",["$resource",function(a){return a("/api/freshdesk/accounts/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").controller("FreshdeskListCtrl",["$scope","$http","$rootScope","xAlert","$translate","socket","Modal","stResource",function(a,b,c,d,e,f,g,h){a.conf={accountsByPage:{name:"10",value:10}},a.accountsByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.accounts={checked:[]},a.check=function(b,c){c?a.accounts.checked=angular.copy(_.map(a.displayedFreshdeskAccounts,"id")):a.accounts.checked=[]},a.getAccounts=function(b){return _.map(a.displayedFreshdeskAccounts,function(a){var c={};return b.forEach(function(b){c[b]=a[b]}),c})},a.initList=function(b){f.unsyncUpdates("freshdesk_account"),b.url="/api/freshdesk/accounts",h.getPage(b).then(function(d){a.displayedFreshdeskAccounts=d.rows,b.pagination.numberOfPages=d.total_pages,c.updateTableConfig(a.accountsByPage,a.displayedFreshdeskAccounts.length),c.updateTableConfig(a.conf.accountsByPage,a.displayedFreshdeskAccounts.length)}),f.socket.on("freshdesk_account:save",function(){a.initList(b)}),f.socket.on("freshdesk_account:remove",function(c){a.accounts.checked=_.without(a.accounts.checked,c.id),a.initList(b)})},a.deleteItem=g.confirm["delete"](function(a){b["delete"]("/api/freshdesk/accounts/"+a).success(function(){d.show(e.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(a){d.show(e.instant(a.message),"danger")})}),a.deleteItems=g.confirm["delete"](function(){b["delete"]("/api/freshdesk/accounts",{params:{id:a.accounts.checked}}).success(function(){d.show(e.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){d.show(e.instant(a.message),"danger")})}),a.checkAccount=function(a){b.get("/api/freshdesk/accounts/"+a+"/check").then(function(){d.show(e.instant("MESSAGE_ACCOUNT_VERIFIED"),"success")})["catch"](function(){d.show(e.instant("MESSAGE_ACCOUNT_INVALID"),"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.freshdesk.list",{url:"/list",templateUrl:"app/freshdesk/list/list.html",controller:"FreshdeskListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").controller("FreshdeskViewCtrl",["$scope","$http","$stateParams","$translate","$location","$filter","WizardHandler","socket","xAlert","Modal",function(a,b,c,d,e,f,g,h,i,j){a.$stateParams=c,a.config={autoHideScrollbar:!1,theme:"dark",advanced:{updateOnContentResize:!0},setHeight:500,scrollInertia:0},a.initConfiguration=function(){a.formsConfiguration={},a.configuration={}},a.goNext=function(){g.wizard().next()},a.formValidation=function(a){return a},a.$on("$destroy",function(){h.unsyncUpdates("freshdesk_configuration"),h.unsyncUpdates("freshdesk_field")}),a.initView=function(){b.get("/api/freshdesk/accounts/"+c.id).success(function(b){a.account=b}).error(function(a){i.show(a.message,"danger")})},a.updateItem=function(){b.put("/api/freshdesk/accounts/"+c.id,a.account).success(function(){i.show(d.instant("MESSAGE_WELL_DONE")+".","success")}).error(function(){i.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG")+".","danger")})},a.getConfigurations=function(){b.get("/api/freshdesk/configurations",{params:{AccountId:c.id}}).success(function(b){a.configurations=b,h.socket.on("freshdesk_configuration:remove",function(b){_.remove(a.configurations,{id:b.id})})}).error(function(a){i.show(a.message,"danger")})},a.deleteConfiguration=j.confirm["delete"](function(a){b["delete"]("api/freshdesk/configurations/"+a).success(function(){i.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(){i.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})}),a.createConfiguration=function(){a.configuration.AccountId=c.id,b.post("api/freshdesk/configurations",a.configuration).success(function(a){e.path("freshdesk/view/"+c.id+"/configurations/settings/"+a.id);
+}).error(function(){i.show("Something went wrong!","danger")})},a.fieldType=["string","variable"],a.descFieldType=["string","key_value"],a.getFields=function(){b.get("/api/freshdesk/accounts/"+c.id+"/fields").success(function(b){a.accountFields=[],b=f("freshdesk")(b),_.forEach(b,function(b){a.accountFields.push(b.ticket_field)})}).error(function(a){i.show(a.message,"danger")})},a.getConfiguration=function(){b.get("/api/freshdesk/configurations/"+c.configurationId).success(function(b){a.configurationName=b.name,a.subjectConfig=b.Subject,a.descriptionConfig=b.Description,a.fieldConfig=b.Field,h.socket.on("freshdesk_field:remove",function(b){_.remove(a.subjectConfig,{id:b.id}),_.remove(a.descriptionConfig,{id:b.id}),_.remove(a.fieldConfig,{id:b.id})})}).error(function(a){i.show(a.message,"danger")})},a.getVariables=function(){b.get("/api/variables").success(function(b){a.variables=b.rows}).error(function(a){i.show(a.message,"danger")})},a.removeItem=function(a){b["delete"]("api/freshdesk/fields/"+a.id).success(function(){i.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(){i.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})},a.addItemSubject=function(){var d={type:"string",content:""};b.post("/api/freshdesk/configurations/"+c.configurationId+"/subject",d).success(function(b){a.subjectConfig.push(b)}).error(function(){i.show("Something went wrong!","danger")})},a.addItemDescription=function(){var d={type:"string",content:""};b.post("/api/freshdesk/configurations/"+c.configurationId+"/description",d).success(function(b){a.descriptionConfig.push(b)}).error(function(){i.show("Something went wrong!","danger")})},a.addItemField=function(){var d={content:""};b.post("/api/freshdesk/configurations/"+c.configurationId+"/field",d).success(function(b){a.fieldConfig.push(b)}).error(function(){i.show("Something went wrong!","danger")})},a.updateField=function(a){b.put("/api/freshdesk/fields/"+a.id,a).success(function(){}).error(function(){i.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG")+".","danger")})},a.changeType=function(b){"variable"===b.type?b.content="":"string"===b.type&&(b.VariableId=null),a.updateField(b)},a.changeDescType=function(b){"key_value"===b.type?(b.content="","string"===b.keyType?b.VariableId=null:"variable"===b.keyType&&(b.keyContent="")):"string"===b.type&&(b.VariableId=null,b.key="",b.keyContent=""),a.updateField(b)},a.changeFieldType=function(b){if(b.content="",b.idField){var c=_.find(a.accountFields,"name",b.idField);c&&(b.customField=!_.result(c,"default",!0))}a.updateField(b)},a.getSystemFieldOptions=function(b){if(b){var c=_.find(a.accountFields,"name",b);return c?c.choices.length>0?c.choices:null:void 0}}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.freshdesk.view",{url:"/view/:id",templateUrl:"app/freshdesk/view/view.html",controller:"FreshdeskViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.freshdesk.view.account",{url:"/account",templateUrl:"app/freshdesk/view/view.account.html"}).state("main.freshdesk.view.configurations",{url:"/configurations",templateUrl:"app/freshdesk/view/view.configurations.html"}).state("main.freshdesk.view.configurations.settings",{url:"/settings/:configurationId",templateUrl:"app/freshdesk/view/view.configurationSettings.html",controller:"FreshdeskViewCtrl"}).state("main.freshdesk.view.configuration",{url:"/configuration",templateUrl:"app/freshdesk/view/view.configuration.html"})}]),angular.module("xCallyShuttleApp").controller("FreshdeskWizardCtrl",["$scope","$http","$location","$translate","xAlert","WizardHandler",function(a,b,c,d,e,f){a.translate=d,a.initWizard=function(){a.$translate=d,a.forms={},a.item={}},a.next=function(){f.wizard().next()},a.exitValidation=function(a){return a},a.createItem=function(){console.log(a.item),b.post("api/freshdesk/accounts",a.item).success(function(){e.show(d.instant("MESSAGE_WELL_DONE")+".","success"),c.path("/freshdesk/list")}).error(function(){e.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG")+".","danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.freshdesk.wizard",{url:"/wizard",templateUrl:"app/freshdesk/wizard/wizard.html",controller:"FreshdeskWizardCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.integrations",{url:"/integrations",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").factory("Integration",["$resource",function(a){return a("/api/integrations/:id/:controller",{id:"@id"})}]),angular.module("xCallyShuttleApp").controller("IntegrationListCtrl",["$scope","Modal","socket","FileUploader","Integration","xAlert",function(a,b,c,d,e,f){a.integrationsByPage=10;var g=a.uploader=new d({url:"api/integrations",autoUpload:!0,removeAfterUpload:!0});g.filters.push({name:"zipFilter",fn:function(a){var b="|"+a.type.slice(a.type.lastIndexOf("/")+1)+"|";return-1!=="|zip|".indexOf(b)}}),g.onSuccessItem=function(a,b,c,d){console.info("onSuccessItem",a,b,c,d),f.show(b.name,"success")},g.onErrorItem=function(a,b,c,d){console.info("onErrorItem",a,b,c,d),b.errors.forEach(function(a){f.show(a.message,"danger")})},a.deleteItem=b.confirm["delete"](function(a){e["delete"]({id:a},function(){f.show("Integration Removed","success")},function(a){f.show(a.data.errors,"danger")})}),a.initList=function(){a.integrations=e.query({},function(a){c.syncUpdates("integration",a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.integrations.list",{url:"/list",templateUrl:"app/integration/list/list.html",controller:"IntegrationListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load({insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/plugins/bootstrap-fileinput/bootstrap-fileinput.js"]})}]}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.jscripty",{url:"/jscripty",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").factory("JscriptyProject",["$resource",function(a){return a("/api/jscripty/projects/:id/:controller/:action/:action2",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").controller("JscriptyProjectListCtrl",["$scope","$uibModal","JscriptyProject","gridOptions",function(a,b,c,d){a.initView=function(){var b={exporterCsvFilename:"jscriptyProjects.csv",columnDefs:[{name:"name"},{name:"description"},{name:"action",width:300,buttons:[{"class":"blue-hoki",href:"/jscripty/projects/view/{{row.entity.id}}",name:"settings"},{"class":"green",name:"start",onClick:"grid.appScope.openJscriptyTab(row.entity)"},{"class":"purple",href:"/jscripty/projects/report/{{row.entity.id}}/sessions",name:"report"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=d.gridOptions(c,b,a)},a.createItem=function(){var c=b.open({animation:!0,templateUrl:"app/jscripty/project/list/list.create.modal.html",controller:"JscriptyProjectListCreateCtrl"});c.result.then(function(b){console.log(b),a.gridOptions.getPage()})}}]),angular.module("xCallyShuttleApp").controller("JscriptyProjectListCreateCtrl",["$scope","$translate","$uibModalInstance","JscriptyProject","xAlert",function(a,b,c,d,e){a.form={},a.item={},a.save=function(){return d.save(a.item).$promise.then(function(a){e.show(b.instant("MESSAGE_WELL_DONE"),"success"),c.close(a)})["catch"](function(a){console.log(a),e.show(b.instant(a.data.translatedMessage),"danger")})},a.cancel=function(){c.dismiss()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.jscripty.projects.list",{url:"/list",templateUrl:"app/jscripty/project/list/list.html",controller:"JscriptyProjectListCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.jscripty.projects",{url:"/projects",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("JscriptyProjectReportCtrl",["$scope","$http","$state","$stateParams","socket","Auth","Modal","xAlert","$translate","$rootScope","gridOptions","JscriptyProject","$location",function(a,b,c,d,e,f,g,h,i,j,k,l,m){a.projectStats={started:0,incomplete:0,completed:0},a.projectId=d.id,a.initView=function(){return l.get({id:d.id,controller:"sessions"}).$promise.then(function(b){a.projectId=d.id,console.log(a.projectId);var c=_.groupBy(b.rows,"status");a.projectStats.started=c.started?c.started.length:0,a.projectStats.completed=c.completed?c.completed.length:0,a.projectStats.incomplete=c.incomplete?c.incomplete.length:0})["catch"](function(a){h.show(a.message,"danger")})},a.getProjectSessions=function(){var b={exporterCsvFilename:"jscriptyProjects.csv",columnDefs:[{name:"projectId",displayName:"APPLICATION_PROJECTID"},{name:"session_id",displayName:"APPLICATION_SESSIONID"},{name:"createdAt",displayName:"APPLICATION_STARTEDAT"},{name:"completedAt",displayName:"APPLICATION_COMPLETEDAT"},{name:"status",displayName:"APPLICATION_STATUS"},{name:"last_question_id",displayName:"APPLICATION_LASTQUESTIONID"},{name:"action",width:100,buttons:[{"class":"blue-hoki",href:"/jscripty/projects/report/{{row.entity.projectId}}/session/{{row.entity.session_id}}",name:"Detail"}]}]};a.gridOptions=k.gridOptions(l,b,a,{id:d.id,controller:"sessions"})},a.getSessionDetails=function(){console.log(d.sessionId),b.get("/api/jscripty/projects/"+d.id+"/sessions/"+d.sessionId).success(function(b){a.sessionQuestions=b[0],console.log("session",a.sessionQuestions)})["catch"](function(a){h.show(a.message,"danger")})},a.getQuestionSummary=function(){var b={exporterCsvFilename:"jscriptyProjects.csv",columnDefs:[{name:"question_id",width:150,displayName:"APPLICATION_QUESTIONID"},{name:"question_type",width:150,displayName:"APPLICATION_QUESTIONTYPE"},{name:"question_label",width:200,displayName:"APPLICATION_QUESTIONLABEL"},{name:"question_text",displayName:"APPLICATION_QUESTION"},{name:"count",width:100,displayName:"APPLICATION_COUNT"}]};a.gridOptions=k.gridOptions(l,b,a,{id:d.id,controller:"questions",action:"summary"})},a.getQuestionDetail=function(){b.get("/api/jscripty/projects/"+d.id+"/questions/detail").success(function(b){var c=_.groupBy(b,"question_id");_.forEach(c,function(a,b){c[b]=_.groupBy(a,"question_label"),_.forEach(c[b],function(a,d){c[b][d]=_.groupBy(a,"question_text")})}),a.questionDetail=c,console.log("detail",a.questionDetail)})["catch"](function(a){h.show(a.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.jscripty.projects.report",{url:"/report/:id",templateUrl:"app/jscripty/project/report/report.html",controller:"JscriptyProjectReportCtrl"}).state("main.jscripty.projects.report.sessions",{url:"/sessions",templateUrl:"app/jscripty/project/report/report.sessions.html"}).state("main.jscripty.projects.report.summary",{url:"/summary",templateUrl:"app/jscripty/project/report/report.summary.html"}).state("main.jscripty.projects.report.detail",{url:"/detail",templateUrl:"app/jscripty/project/report/report.detail.html"}).state("main.jscripty.projects.report.sessionDetail",{url:"/session/:sessionId",controller:"JscriptyProjectReportCtrl",templateUrl:"app/jscripty/project/report/report.session.detail.html"})}]),angular.module("xCallyShuttleApp").controller("JscriptyProjectViewCtrl",["$scope","$http","$state","$stateParams","socket","Auth","Modal","xAlert","$translate","$rootScope",function(a,b,c,d,e,f,g,h,i,j){a.jscriptyProject={},a.getProject=function(){b.get("/api/jscripty/projects/"+d.id).success(function(b){a.jscriptyProject=b,angular.element(document).ready(function(){window.onerror=function(a,b,c){try{if(null!=a&&-1!=a.indexOf("Script error."));else{var d=new Image;d.src="assets/plugins/mxgraph/images/1x1.png?msg="+encodeURIComponent(a)+"&url="+encodeURIComponent(b)+"&lnum="+encodeURIComponent(c)}}catch(e){}},b.token=f.getToken();var a=new EditorUi(new Editor);a.openString(b.draft,b.name,b),a.editor.graphChangeListener=function(a,b){var c=b.properties.rtChange||!1;c||(this.modified=!0)}}),e.syncUpdates("jscripty_project",[b],function(a,c,d){c.id===b.id})})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.jscripty.projects.view",{url:"/view/:id",templateUrl:"app/jscripty/project/view/view.html",controller:"JscriptyProjectViewCtrl",authenticate:!0,resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",serie:!0,cache:!1,files:["assets/plugins/mxgraph/css/common.css","assets/plugins/mxgraph/css/explorer.css","assets/plugins/mxgraph/styles/grapheditor.css","assets/plugins/mxgraph/styles/custom.css","assets/plugins/jscripty/js/custom.js","assets/plugins/mxgraph/js/mxClient.js","assets/plugins/jscripty/js/Editor.js","assets/plugins/jscripty/js/Graph.js","assets/plugins/jscripty/js/EditorUi.js","assets/plugins/jscripty/js/Actions.js","assets/plugins/jscripty/js/Menus.js","assets/plugins/jscripty/js/Sidebar.js","assets/plugins/jscripty/js/Toolbar.js","assets/plugins/jscripty/js/Dialogs.js"]}])}]}})}]),angular.module("xCallyShuttleApp").controller("LoginCtrl",["$scope","Auth","$location","$window","$rootScope",function(a,b,c,d,e){a.year=moment().year(),a.userLogin={},a.userSignUp={},a.loginSubmitted=!1,a.signupSubmitted=!1,a.errorLogin=!1,a.errorSignup=!1,a.errorLog="",a.flagLogin1=!1,a.toogleLogin=function(){a.flagLogin1=!a.flagLogin1},e.bodyLayout="login",a.$on("$viewContentLoaded",function(){Metronic.init(),Layout.init()}),a.login=function(d){a.loginSubmitted=!0,d.$valid?b.login({name:a.userLogin.name,password:a.userLogin.password,remember:a.userLogin.remember}).then(function(){c.path("/dashboard/voice")})["catch"](function(b){a.errorLog=b.message,a.errorLogin=!0}):a.errorLogin=!0},a.signup=function(d){a.signupSubmitted=!0,d.$valid?b.createUser({email:a.userSignUp.email,fullname:a.userSignUp.fullname,name:a.userSignUp.name,password:a.userSignUp.password,role:a.userSignUp.role,online:!0}).then(function(){c.path("/")})["catch"](function(b){a.errorLog=b.message,a.errorSignup=!0}):a.errorSignup=!0},a.loginOauth=function(a){d.location.href="/auth/"+a}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("login",{url:"/login",templateUrl:"app/login/login.html",controller:"LoginCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/css/login.css"]}])}]}})}]),angular.module("xCallyShuttleApp").factory("Action",["$resource",function(a){return a("/api/actions/:name/:controller",{name:"@name"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").directive("actionBuilderTemplate",["$compile","xAlert","$http","$timeout","Template","$translate",function(a,b,c,d,e,f){return{restrict:"E",scope:{element:"=",form:"="},templateUrl:"app/main/template/actionBuilder/template.actionBuilderTemplate.html",compile:function(c,g){var h,i;return h=c.contents().remove(),function(c,g,j){function k(a,b){var c=[];for(a=a||5,b=b||"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";--a;)c.push(b.charAt(Math.floor(Math.random()*b.length)));return c.join("")}c.randomName=k(),d(function(){return e.get().$promise.then(function(a){c.templates=a.rows})["catch"](function(a){b.show(f.instant(a.message),"danger")})}),i||(i=a(h)),g.append(i(c,function(a){return a}))}}}}]).directive("actionBuilderIntegration",["$compile","xAlert","$http","$timeout","Integration","$translate","ZendeskAccount","DeskAccount","SalesforceAccount","FreshdeskAccount","SugarcrmAccount",function(a,b,c,d,e,f,g,h,i,j,k){return{restrict:"E",scope:{element:"=",form:"="},templateUrl:"app/main/template/actionBuilder/template.actionBuilderIntegration.html",compile:function(c,l){var m,n;return m=c.contents().remove(),function(c,l,o){function p(a,b){var c=[];for(a=a||5,b=b||"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";--a;)c.push(b.charAt(Math.floor(Math.random()*b.length)));return c.join("")}c.randomName=p(),d(function(){return e.get({active:1}).$promise.then(function(a){c.integrations=a.rows,c.element.data1&&q()})["catch"](function(a){b.show(f.instant(a.message),"danger")})});var q=function(){var a;switch(c.element.data1){case"zendesk":a=g;break;case"desk":a=h;break;case"salesforce":a=i;break;case"freshdesk":a=j;break;case"sugarcrm":a=k}return a.get().$promise.then(function(a){c.accounts=a.rows,c.element.data2&&r()})["catch"](function(a){b.show(f.instant(a.message),"danger")})},r=function(){c.configurations=_.find(c.accounts,{id:Number(c.element.data2)}).Configurations};c.changeIntegration=function(){c.element.data2="",q()},c.changeAccount=function(){c.element.data3="",r()},n||(n=a(m)),l.append(n(c,function(a){return a}))}}}}]).directive("actionBuilderStatus",["$compile","xAlert","$http","$timeout","$translate",function(a,b,c,d,e){return{restrict:"E",scope:{element:"=",form:"="},templateUrl:"app/main/template/actionBuilder/template.actionBuilderStatus.html",compile:function(b,c){var d,e;return d=b.contents().remove(),function(b,c,f){function g(a,b){var c=[];for(a=a||5,b=b||"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";--a;)c.push(b.charAt(Math.floor(Math.random()*b.length)));return c.join("")}b.randomName=g(),b.states=[{name:"APPLICATION_STATUS_NEW",value:"NEW"},{name:"APPLICATION_STATUS_OPEN",value:"OPEN"},{name:"APPLICATION_STATUS_CLOSED",value:"CLOSED"}],e||(e=a(d)),c.append(e(b,function(a){return a}))}}}}]),angular.module("xCallyShuttleApp").factory("Ami",["$resource",function(a){return a("/api/ami/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").controller("ChooseContactModalCtrl",["$scope","$uibModalInstance","eventId","$http","xAlert","$translate",function(a,b,c,d,e,f){a.open=function(a){b.close(a)},a.getContacts=function(){d.get("/api/contactmanager/contacts/"+c+"/checkevent").success(function(b){a.contacts=b}).error(function(a){e.show(f.instant(a.message)+"!","danger")})},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("CloseEditedTabModalCtrl",["$scope","$uibModalInstance",function(a,b){a.close=function(){b.close()},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").factory("gridOptions",["Modal","xAlert","$translate","$interval","$q","usSpinnerService",function(a,b,c,d,e,f){return{gridOptions:function(d,g,h,i,j,k){h.id=[];var l=k?"gridOptions"+k:"gridOptions",m={offset:0,limit:10};g.draggable&&(g.rowTemplate='<div grid="grid" class="ui-grid-draggable-row" draggable="true"><div ng-repeat="(colRenderIndex, col) in colContainer.renderedColumns track by col.colDef.name" class="ui-grid-cell" ng-class="{ \'ui-grid-row-header-cell\': col.isRowHeader, \'custom\': true }" ui-grid-cell></div></div>',g.useExternalPagination=!1,g.enablePaginationControls=!1,g.showGridFooter=!1);var n=function(a){var b=a?30*a+120:177;angular.element(document.getElementsByClassName("ui-grid")[0]).css("height",b+"px")},o=function(){return h[l].enablePaginationControls||(delete m.offset,delete m.limit),f.spin("spinner-grid"),d.get(i?_.merge(m,i):m).$promise.then(function(a){h[l].totalItems=a.count,h[l].data=a.rows,n(a.rows.length)})["catch"](function(a){console.error(a)})["finally"](function(){f.stop("spinner-grid")})};return h.deleteItem=a.confirm["delete"](function(a){var e=i?angular.copy(i):{};return _.merge(e,{id:a}),d.remove(e).$promise.then(function(){o(),b.show(c.instant("MESSAGE_WELL_DONE")+"!","success"),h.gridApi.selection.clearSelectedRows(),h.id=[]})["catch"](function(a){b.show(a.message?a.message:a.data.message,"danger")})}),h.deleteItems=a.confirm["delete"](function(){var a=i?angular.copy(i):{};return _.merge(a,{ids:h.id}),d["delete"](a).$promise.then(function(){o(),b.show(c.instant("MESSAGE_WELL_DONE")+"!","success"),h.gridApi.selection.clearSelectedRows(),h.id=[]})["catch"](function(a){b.show(a.message?a.message:a.data.message,"danger")})}),g.columnDefs.forEach(function(a){a.hasOwnProperty("displayName")||(a.displayName="APPLICATION_"+a.name.toUpperCase()),a.headerCellFilter="translate",a.hasOwnProperty("buttons")&&(a.displayName="",a.cellClass="ui-grid-vcenter",a.enableSorting=!1,a.enableFiltering=!1,a.enableColumnMenu=!1,a.cellTemplate="<div>",a.buttons.forEach(function(b){b.directive?a.cellTemplate+=b.directive:(a.cellTemplate+="<a",a.cellTemplate+=b.hide?' data-ng-hide="true" ':" ",a.cellTemplate+=b["class"]?' class="btn btn-xs '+b["class"]+'" ':" ",a.cellTemplate+=b.href?' data-ng-href="'+b.href+'" ':" ",a.cellTemplate+=b.onClick?' data-ng-click="'+b.onClick+'" ':" ",a.cellTemplate+=b.title?' title="'+b.title+'"':"",a.cellTemplate+=">",a.cellTemplate+=b.icon?'<i class="'+b.icon+'"></i>':"",a.cellTemplate+=b.displayName||b.name?"{{'"+(b.displayName||"APPLICATION_"+b.name.toUpperCase())+"' | translate}}":"",a.cellTemplate+="</a> ")}),a.cellTemplate+="<div>",delete a.buttons)}),_.merge({enableGridMenu:!0,headerCellFilter:"translate",enableHorizontalScrollbar:0,enableVerticalScrollbar:0,enableRowSelection:!0,enableSelectAll:!0,enableFiltering:!0,showGridFooter:!0,paginationPageSizes:[10,25,50,75],paginationPageSize:10,useExternalPagination:!0,useExternalSorting:!0,useExternalFiltering:!0,multiSelect:!0,getPage:o,gridMenuTitleFilter:function(a){var b=e.defer();return b.resolve(c.instant(a)),b.promise},onRegisterApi:function(a){h.gridApi=a,h.gridApi.selection.on.rowSelectionChanged(h,function(a){a.isSelected?h.id.push(h.gridApi.grid.options.primaryKey?a.entity[h.gridApi.grid.options.primaryKey]:a.entity.id):_.pull(h.id,h.gridApi.grid.options.primaryKey?a.entity[h.gridApi.grid.options.primaryKey]:a.entity.id)}),h.gridApi.selection.on.rowSelectionChangedBatch(h,function(a){a[0].isSelected?h.id=_.union(h.id,_.map(a,h.gridApi.grid.options.primaryKey?"entity."+h.gridApi.grid.options.primaryKey:"entity.id")):_.map(a,h.gridApi.grid.options.primaryKey?"entity."+h.gridApi.grid.options.primaryKey:"entity.id").forEach(function(a){_.pull(h.id,a)})}),h.gridApi.core.on.sortChanged(h,function(a,b){0===b.length?m.order=null:m.order=b[0].name+" "+b[0].sort.direction.toUpperCase(),o()}),h.gridApi.pagination.on.paginationChanged(h,function(a,b){m.offset=(a-1)*b,m.limit=b,o()}),h.gridApi.core.on.filterChanged(h,function(){var a=this.grid;a.columns.forEach(function(a){a.filters[0].term?m[a.name]=a.filters[0].term:delete m[a.name]}),o()}),h.gridApi.draggableRows.on.rowDropped(h,function(a){a.fromIndex!==a.toIndex&&d.update(i,h[l].data).$promise.then(function(){b.show(c.instant("MESSAGE_WELL_DONE")+"!","success")})["catch"](function(a){b.show(a.message,"danger")})}),j||o()}},g)}}}]),angular.module("xCallyShuttleApp").controller("MainCtrl",["$scope","$rootScope","$translate","socket","Auth","xAlert","$uibModal","$log","$state","Contact",function(a,b,c,d,e,f,g,h,i,j){a.awesomeThings=[],a.isLoggedIn=e.isLoggedIn,a.isAdmin=e.isAdmin,a.getCurrentUser=e.getCurrentUser,a.workspaces=[],a.mainTab={active:!0},a.closeTab=function(b){if(a.workspaces[b].edited){var c=g.open({animation:!0,templateUrl:"app/main/closeEditedTab.modal.html",controller:"CloseEditedTabModalCtrl"});c.result.then(function(c){a.workspaces.splice(b,1)},function(){h.info("Modal dismissed at: "+new Date)})}else a.workspaces.splice(b,1)},a.createContact=function(b,d){return d.tags=d.tags?d.tags.join(","):void 0,j.save(d).$promise.then(function(d){a.workspaces.splice(b,1);var e=d.firstName;d.lastName&&(e+=" "+d.lastName),a.openContactTab({fullname:d.fullname,id:d.id}),f.show(c.instant("MESSAGE_WELL_DONE")+"!","success")})["catch"](function(a){f.show(a.message,"danger")})};var k=function(b){var c=g.open({animation:!0,templateUrl:"app/main/chooseContact.modal.html",controller:"ChooseContactModalCtrl",resolve:{eventId:function(){return b.id}}});c.result.then(function(c){c?a.openContactTab(c):a.newContact(b)},function(){h.info("Modal dismissed at: "+new Date)})};a.updateContact=function(b,d){var e=angular.copy(d);return e.tags=e.tags?e.tags.join(","):void 0,e.CompanyId||(e.CompanyId=null),j.update({id:e.id},e).$promise.then(function(){a.workspaces[b].edited=!1,f.show(c.instant("MESSAGE_WELL_DONE")+"!","success")})["catch"](function(a){f.show(c.instant(a.message)+"!","danger")})},d.socket.on("report_integration:contactmanager",function(a){console.log("choosecontact"),k(a)}),a.openContactTab=function(b){var c=_.find(a.workspaces,{contactID:b.id});if(c)c.active=!0;else{var d=b.firstName;b.lastName&&(d+=" "+b.lastName),a.workspaces.push({name:d,type:"contact",contactID:b.id,active:!0,eventData:b.uniqueid?b:null})}},a.openJscriptyTab=function(b){a.workspaces.push({name:b.name,type:"jscripty",active:!0,data:b})},a.newContact=function(b){a.workspaces.push({name:"New Contact",type:"newContact",active:!0,data:b||null,eventData:b&&b.uniqueid?b:""})},a.$on("$viewContentLoaded",function(){Metronic.init()}),b.language=c.use(),a.changeLanguage=function(a){c.use(a).then(function(a){b.language=a,("main.jscripty.projects.view"===i.current.name||"main.square.projects.view"===i.current.name)&&i.go(i.current,{},{reload:!0})})["catch"](function(a){console.error(a)})}}]),angular.module("xCallyShuttleApp").directive("ngSpinnerBar",["$rootScope",function(a){return{link:function(b,c){c.addClass("hide"),a.$on("$stateChangeStart",function(){"spinner-page"===c[0].id&&c.removeClass("hide")}),a.$on("$stateChangeSuccess",function(){"spinner-page"===c[0].id&&(c.addClass("hide"),$("body").removeClass("page-on-load"),Layout.setSidebarMenuActiveLink("match"),setTimeout(function(){Metronic.scrollTop()},1e3))}),a.$on("$spinnerStart",function(){"spinner-request"===c[0].id&&c.removeClass("hide")}),a.$on("$spinnerStop",function(){"spinner-request"===c[0].id&&c.addClass("hide")}),a.$on("$stateNotFound",function(){"spinner-page"===c[0].id&&c.addClass("hide")}),a.$on("$stateChangeError",function(){"spinner-page"===c[0].id&&c.addClass("hide")})}}}]).directive("a",function(){return{restrict:"E",link:function(a,b,c){(c.ngClick||""===c.href||"#"===c.href)&&b.on("click",function(a){a.preventDefault()})}}}).directive("nxEqual",function(){return{require:"ngModel",link:function(a,b,c,d){return c.nxEqual?(a.$watch(c.nxEqual,function(a){d.$setValidity("nxEqual",a===d.$viewValue)}),void d.$parsers.push(function(b){var e=b===a.$eval(c.nxEqual);return d.$setValidity("nxEqual",e),e?b:void 0})):void console.error("nxEqual expects a model as an argument!")}}}).directive("ngEnter",function(){return function(a,b,c){b.bind("keydown keypress",function(b){13===b.which&&(a.$apply(function(){a.$eval(c.ngEnter)}),b.preventDefault())})}}).directive("dropdownMenuHover",function(){return{link:function(a,b){b.dropdownHover()}}}).directive("uiSelectRequired",function(){return{require:"ngModel",link:function(a,b,c,d){d.$validators.uiSelectRequired=function(a){return a&&a.length}}}}).directive("rpattern",function(){return{restrict:"A",require:"ngModel",link:function(a,b,c,d){function e(a,b){return null==b||""===b||!h||a.test(b)?(d.$setValidity("pattern",!0),b):void d.$setValidity("pattern",!1)}var f,g=c.rpattern,h=!0;g&&(g.match(/^\/(.*)\/$/)?(g=new RegExp(g.substr(1,g.length-2)),f=function(a){return e(g,a)}):f=function(b){var c=a.$eval(g);if(!c||!c.test)throw new Error("Expected "+g+" to be a RegExp but was "+c);return e(c,b)}),d.$formatters.push(f),d.$parsers.push(f),c.$observe("required",function(a){h=a,f(d.$viewValue)})}}}).directive("conditionBuilder",["$compile","xAlert","$timeout",function(a,b,c){return{restrict:"E",scope:{element:"=",serviceindex:"=",service:"=",form:"="},templateUrl:"app/main/template/template.conditionBuilder.html",compile:function(d,e){var f,g;return f=d.contents().remove(),function(d,e,h){function i(a){var c=_.find(d.service.services[d.serviceindex].conditions,{value:a});if(c)if(d.elementType=c.type,c.arr)d.values=c.arr;else if(c.resource)return c.resource.get().$promise.then(function(a){d.values=_.map(a.rows,function(a){return{name:a[c.resValue],value:a[c.resValue]}})})["catch"](function(a){b.show($translate.instant(a.message),"danger")})}function j(a,b){var c=[];for(a=a||5,b=b||"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";--a;)c.push(b.charAt(Math.floor(Math.random()*b.length)));return c.join("")}d._=_,d.randomName=j(),c(function(){d.element.field&&i(d.element.field)}),d.checkCondition=function(a){d.element.value="",d.element.operator="",i(a)},g||(g=a(f)),e.append(g(d,function(a){return a}))}}}}]).directive("newContact",["$compile","xAlert","socket","$translate","$timeout","Service","Tag","Company",function(a,b,c,d,e,f,g,h){return{restrict:"E",scope:{workspace:"=",index:"=",submit:"&onSubmit"},templateUrl:"app/main/template/template.contactTab.html",compile:function(a,i){return function(a,i,j){function k(){a.$watch("contact",function(b,c){angular.equals(b,c)||(a.workspace.edited=!0)},!0)}a.forms={general:{}},a.firstLoad=!0,a.detail={tab:"main"},a.contact={},a.submitButtonLabel=d.instant("APPLICATION_CONFIRM"),a.init=function(){a.workspace.data&&(a.contact.firstName=a.workspace.data.calleridname?a.workspace.data.calleridname:a.workspace.data.messageId?a.workspace.data.messageId:a.workspace.data.uniqueid?a.workspace.data.uniqueid:"",a.workspace.data.calleridnum&&(a.contact.phone=a.workspace.data.calleridnum),a.workspace.data.from&&(a.contact.email=a.workspace.data.from)),a.getTags(),a.getCompanies(),a.getServices()},a.getServices=function(){return f.get().$promise.then(function(b){a.services=b.rows,c.syncUpdates("service",a.services),a.contact.ServiceId=1,a.getCustomFields()})["catch"](function(a){b.show(d.instant(a.message)+"!","danger")})},a.getCustomFields=function(){return f.get({serviceId:a.contact.ServiceId,controller:"customfields"}).$promise.then(function(b){a.customFields=b.rows,a.customFields.forEach(function(a){a.values=JSON.parse(a.values)}),c.socket.on("custom_field:remove",function(b){_.remove(a.customFields,function(a){return b.id==a.id})}),c.socket.on("custom_field:save",function(b){if(b.ServiceId===a.contact.ServiceId){var c=_.find(a.customFields,{id:b.id});c||("string"==typeof b.values&&(b.values=JSON.parse(b.values)),a.customFields.push(b))}}),!a.firstLoad||a.workspace.data?(a.workspace.edited=!0,a.firstLoad=!1):(a.firstLoad=!1,k())})["catch"](function(a){console.error(a),b.show(a.message,"danger")})},a.getTags=function(){return g.get().$promise.then(function(b){a.tags=_.map(b.rows,"name")})["catch"](function(a){console.error(a),b.show(a.message,"danger")})},a.getCompanies=function(){return h.get().$promise.then(function(b){a.companies=b.rows,c.syncUpdates("company",a.companies)})["catch"](function(a){console.error(a),b.show(a.message,"danger")})},e(function(){a.init()})}}}}]).directive("contact",["$compile","xAlert","socket","$timeout","Service","Tag","Company","Contact","$translate","gridOptions",function(a,b,c,d,e,f,g,h,i,j){return{restrict:"E",scope:{workspace:"=",index:"=",submit:"&onSubmit"},templateUrl:"app/main/template/template.contactTab.html",compile:function(a,k){return function(a,k,l){function m(b){var c={exporterCsvFilename:b+".csv",columnDefs:[{name:a.columns[a.log[b].show][a.log[b].detail].indexes[0],displayName:a.columns[a.log[b].show][a.log[b].detail].header[0],headerCellFilter:"translate",enableSorting:!1,enableColumnMenu:!1},{name:a.columns[a.log[b].show][a.log[b].detail].indexes[1],displayName:a.columns[a.log[b].show][a.log[b].detail].header[1],headerCellFilter:"translate",enableSorting:!1,enableColumnMenu:!1},{name:a.columns[a.log[b].show][a.log[b].detail].indexes[2],displayName:a.columns[a.log[b].show][a.log[b].detail].header[2],headerCellFilter:"translate",enableSorting:!1,enableColumnMenu:!1}]};a["gridOptions"+b]=j.gridOptions(h,c,a,_.merge({id:a.workspace.contactID,controller:"log",logType:b},a.log[b]),!0,b),a["gridOptions"+b].getPage();
+}a.moment=moment,a.submitButtonLabel=i.instant("APPLICATION_UPDATE"),a.forms={general:{}},a.detail={tab:"main"},a.log={journal:{show:"phone",type:"inbound",detail:"general"},history:{show:"phone",type:"inbound",detail:"general"}},a.columns={phone:{general:{header:["APPLICATION_SOURCE","APPLICATION_DESTINATION","APPLICATION_DATE"],indexes:["source","destination","createdAt"]},queue:{header:["APPLICATION_CALLERID","APPLICATION_QUEUE","APPLICATION_DATE"],indexes:["calleridnum","queue","createdAt"]},agent:{header:["APPLICATION_AGENT","APPLICATION_QUEUE","APPLICATION_DATE"],indexes:["membername","queue","agentcalledAt"]}},email:{general:{header:["APPLICATION_FROM","APPLICATION_TO","APPLICATION_DATE"],indexes:["from","to","createdAt"]}}},a.updateLog=function(b,c,d,e){c&&(a.log[b].show=c),d&&(a.log[b].detail=d),e&&(a.log[b].type=e),m(b)},a.getContact=function(){return h.get({id:a.workspace.contactID}).$promise.then(function(b){b.tags=b.tags?b.tags.split(","):[],a.contact=b,a.getCustomFields(b.ServiceId),a.updateLog("journal"),a.updateLog("history")})["catch"](function(a){console.error(a),b.show(a.message,"danger")})},a.getTags=function(){return f.get().$promise.then(function(b){a.tags=_.map(b.rows,"name")})["catch"](function(a){console.error(a),b.show(a.message,"danger")})},a.getCompanies=function(){return g.get().$promise.then(function(b){a.companies=b.rows,c.syncUpdates("company",a.companies)})["catch"](function(a){console.error(a),b.show(a.message,"danger")})},a.getCustomFields=function(d){return e.get({serviceId:d,controller:"customfields"}).$promise.then(function(b){a.customFields=b.rows,a.customFields.forEach(function(a){a.values=JSON.parse(a.values)}),c.socket.on("custom_field:remove",function(b){_.remove(a.customFields,function(a){return b.id==a.id})}),c.socket.on("custom_field:save",function(b){if(b.ServiceId===d){var c=_.find(a.customFields,{id:b.id});c||("string"==typeof b.values&&(b.values=JSON.parse(b.values)),a.customFields.push(b))}})})["catch"](function(a){console.error(a),b.show(a.message,"danger")})},d(function(){a.getTags(),a.getCompanies(),a.getContact()})}}}}]).directive("jscripty",["$compile","xAlert","$http","socket",function(a,b,c,d){return{restrict:"E",scope:{workspace:"=",index:"=",submit:"&onSubmit"},templateUrl:"app/main/template/template.jscriptyTab.html",compile:function(a,d){return function(a,d,e){a.count=0,a.questions=[];var f=0,g=a.workspace.data.id;c.get("/api/jscripty/projects/"+g+"/download").success(function(b){if(b){c.post("/api/jscripty/projects/"+g+"/sessions",{projectId:g,status:"started"}).success(function(a){f=a.session_id,console.log(a)});var d=mxUtils.parseXml(b),e=new mxCodec(d);a.decObj=e.decode(d.documentElement);a.questions[a.count]=a.currentQuestion=_.find(a.decObj.cells,function(a){return a.vertex&&"start"==a.value.nodeName})}else console.log("No project published!"),alert("No project published!"),a.submit({index:a.index})}),a.next=function(b,c){a.currentQuestion.answer&&a.currentQuestion.answer!=c&&(a.questions=_.take(a.questions,a.count+1)),a.currentQuestion.answer=c,a.questions[a.count]=a.currentQuestion;var d=[];_.forEach(b.edges,function(a,c){if(a.source.id==b.id&&a.value){var e=a.value.split(",");e.length>1&&(_.forEach(e,function(c,d){var e=Object.create(a);e.setValue(c),b.edges.push(e)}),d.push(a))}}),_.forEach(d,function(a){_.remove(b.edges,function(b){return b.value==a.value&&b.id==a.id})}),a.currentQuestion=b,a.count++,a.questions[a.count]=b,a.saveQuestions()},a.end=function(){var d="completed";if("end"!=a.questions[a.questions.length-1].value.nodeName){var d="incomplete";a.saveQuestions()}c.put("/api/jscripty/projects/"+g+"/sessions/"+f,{status:d,completedAt:Date(),last_question_id:a.currentQuestion.id}).success(function(c){b.show("Project Ended","success"),a.submit({index:a.index})})},a.back=function(){a.count--,a.currentQuestion=a.questions[a.count]},a.setCurrentQuestion=function(b){a.count=b,a.currentQuestion=a.questions[a.count]},a.saveQuestions=function(){var b=[],d=[];_.forEach(a.questions,function(a,c){a.children&&_.forEach(a.children,function(a,b){d[b]={input_id:a.id,input_type:a.getAttribute("type",""),input_label:a.getAttribute("label",""),input_value:"checkbox"!=a.getAttribute("type","")||a.answer?a.answer:"Not selected"}}),b[c]={sessionId:f,projectId:g,question_id:a.id,question_type:a.value.nodeName,question_label:a.getAttribute("label",""),question_text:a.getAttribute("question",""),question_other_label:a.getAttribute("other"),question_other_answer:a.otheranswer,question_answer:a.answer,ReportJscriptyInputs:d},d=[]}),c.post("/api/jscripty/projects/"+g+"/sessions/"+f+"/questions/",b).success(function(a){})}}}}}]).directive("reportBuilder",["$compile",function(a){return{restrict:"E",scope:{group:"=",fields:"=",forms:"=",firstCall:"="},templateUrl:"app/main/template/template.reportBuilderView.html",compile:function(b,c){var d,e;return d=b.contents().remove(),function(b,c,f){b.operators=[{name:"AND"},{name:"OR"}],b.conditions=[{name:"="},{name:"!="},{name:"<"},{name:"<="},{name:">"},{name:">="},{name:"LIKE"}],b.addCondition=function(){b.group.rules.push({condition:"=",field:"",value:""})},b.removeCondition=function(a){b.group.rules.splice(a,1)},b.addGroup=function(){b.group.rules.push({group:{operator:"AND",rules:[{condition:"=",field:"",value:""}]}})},b.randomName=function(a,b){var c=[];for(a=a||5,b=b||"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";--a;)c.push(b.charAt(Math.floor(Math.random()*b.length)));return c.join("")},b.removeGroup=function(){b.$parent.group&&b.$parent.group.rules.splice(b.$parent.$index,1)},e||(e=a(d)),c.append(e(b,function(a){return a}))}}}}]).directive("dynamicName",["$compile",function(a){return{restrict:"A",terminal:!0,priority:1e3,link:function(b,c,d){c.attr("name",b.$eval(d.dynamicName)),c.removeAttr("dynamic-name"),a(c)(b)}}}]).directive("onReadFile",["$parse",function(a){return{restrict:"A",scope:!1,link:function(b,c,d){var e=a(d.onReadFile);c.on("change",function(a){var c=new FileReader;c.onload=function(a){b.$apply(function(){e(b,{$fileContent:a.target.result})})},c.readAsText((a.srcElement||a.target).files[0])})}}}]).directive("motionFileDownload",["xAlert","$translate","$timeout","$location","FileSaver","$compile",function(a,b,c,d,e,f){return{restrict:"E",template:'<a uib-tooltip=\'{{tooltiptext}}\' class="{{btnclass || \'btn default btn-xs blue-hoki\'}}" href="" data-ng-click="download()" ng-bind-html="btncontent || (\'APPLICATION_DOWNLOAD\' | translate)"></a>',scope:{mimetype:"=",filename:"=",resource:"=",params:"=",btnclass:"@",btncontent:"@",tooltiptext:"@"},link:function(c,d,f){var g=d.children()[0];c.$on("download-start",function(){$(g).attr("disabled","disabled")}),c.$on("downloaded",function(a,b){var d=base64ToBlob(b,c.mimetype);e.saveAs(d,c.filename),$(g).attr("disabled",!1)}),c.download=function(){return c.$emit("download-start"),c.resource.get(c.params).$promise.then(function(a){c.$emit("downloaded",a.downloadString)})["catch"](function(d){a.show(b.instant(d.translatedMessage||d.data.translatedMessage||d.message||d.data.message),"danger"),c.download=function(){}})}}}}]).directive("audioFileDownload",["xAlert","$translate","$sce",function(a,b,c){return{restrict:"E",template:'<button type="button" class="btn default btn-xs blue-hoki" data-ng-click="download()"><i class="icon-control-play"></i> {{ \'APPLICATION_PREVIEW\' | translate}}</button>',scope:{resource:"=",params:"="},link:function(d,e,f){var g=e.children()[0];d.$on("download-start",function(a,b){$(g).attr("disabled","disabled").html('<i class="icon-refresh"></i> Loading...')}),d.$on("downloaded",function(a,b){var d=new Audio(c.trustAsResourceUrl("data:audio/ogg;base64,"+b));d.controls=!0,$(g).remove(),e.append(d),d.play()}),d.$on("error",function(a,b){$(g).removeClass("blue-stripe").addClass("red-stripe").html('<i class="icon-ban"></i> Error!')}),d.download=function(){return d.$emit("download-start"),d.resource.get(d.params).$promise.then(function(a){d.$emit("downloaded",a.downloadString)})["catch"](function(c){a.show(b.instant(c.translatedMessage||c.data.translatedMessage||c.message||c.data.message),"danger")})}}}}]).directive("uiRequired",function(){return{require:"ngModel",link:function(a,b,c,d){d.$validators.required=function(a,b){return!(b&&0===b.length&&"true"===c.uiRequired)},c.$observe("uiRequired",function(){d.$setValidity("required",!("true"===c.uiRequired&&d.$viewValue&&0===d.$viewValue.length))})}}}),angular.module("xCallyShuttleApp").filter("propsFilter",function(){return function(a,b){var c=[];return angular.isArray(a)?a.forEach(function(a){for(var d=!1,e=Object.keys(b),f=0;f<e.length;f++){var g=e[f],h=b[g].toLowerCase();if(-1!==a[g].toString().toLowerCase().indexOf(h)){d=!0;break}}d&&c.push(a)}):c=a,c}}).filter("capitalize",function(){return function(a){return a?a.replace(/([^\W_]+[^\s-]*) */g,function(a){return a.charAt(0).toUpperCase()+a.substr(1).toLowerCase()}):""}}).filter("salesforce",function(){var a=["CallDisposition","CallDurationInSeconds","CallObject","CallType","IsArchived","Priority","Status","Type"];return function(b){return _.remove(b,function(b){return b.custom===!1&&a.indexOf(b.name)<0}),b}}).filter("sugarcrm",function(){var a=["account_id","account_name","account_name1","assigned_user_name","assigned_user_id","case_number","created_by","created_by_name","date_entered","date_modified","deleted","description","id","modified_by_name","modified_user_id","name"];return function(b){return _.remove(b,function(b){return a.indexOf(b.name)>=0}),b}}).filter("freshdesk",function(){var a=["requester","subject","agent","description"];return function(b){return _.remove(b,function(b){return a.indexOf(b.ticket_field.name)>=0}),b}}).filter("zendesk",function(){var a=["subject","assignee","description"];return function(b){return _.remove(b,function(b){return a.indexOf(b.type)>=0}),b}}),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main",{"abstract":!0,templateUrl:"app/main/main.html",controller:"MainCtrl",resolve:{authorization:["$q","Auth","$state","$timeout","$location",function(a,b,c,d,e){return b.getToken()?a.when():(d(function(){e.path("/login")}),a.reject())}],deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css","assets/plugins/mxgraph/js/mxClient.js"]}])}]}})}]),angular.module("xCallyShuttleApp").factory("xAlert",["$translate","Notification",function(a,b){return{show:function(c,d){switch(d){case"success":b.success({message:c,title:'<i class="glyphicon glyphicon-ok"></i> <strong>'+a.instant("MESSAGE_SUCCESS")+"!</strong>",delay:5e3});break;case"info":b.info({message:c,title:'<i class="glyphicon glyphicon-info-sign"></i> <strong>'+a.instant("MESSAGE_INFO")+"!</strong>",delay:5e3});break;case"danger":b.error({message:c,title:'<i class="glyphicon glyphicon-exclamation-sign"></i> <strong>'+a.instant("MESSAGE_ERROR")+"!</strong>",delay:1e4});break;case"warning":b.warning({message:c,title:'<i class="glyphicon glyphicon-warning-sign"></i> <strong>'+a.instant("MESSAGE_WARNING")+"!</strong>",delay:1e4});break;default:b.info(c)}}}}]).factory("stResource",["$q","$filter","$timeout","$rootScope","$http","$translate","xAlert",function(a,b,c,d,e,f,g){return{getPage:function(b){var c={page:Math.ceil(b.pagination.start/b.pagination.number),per_page:b.pagination.number};b.sort.predicate&&(c.sort_by=b.sort.predicate,c.sort_order=b.sort.reverse?"DESC":"ASC"),_.forIn(b.search.predicateObject,function(a,b){c[b]=a}),b.search.params&&(c.clientQuery={},_.forIn(b.search.params,function(a,b){c.clientQuery[b]=a})),d.$broadcast("$spinnerStart"),e.get(b.url,{params:c}).success(function(a){h.resolve(a),d.$broadcast("$spinnerStop")}).error(function(a){g.show(f.instant(a.message),"danger"),d.$broadcast("$spinnerStop")});var h=a.defer();return h.promise}}}]),angular.module("xCallyShuttleApp").factory("Widget",["$resource",function(a){return a("/api/widgets/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").controller("MarketCtrl",["$scope","$http","$translate","socket","xAlert","Modal","$timeout",function(a,b,c,d,e,f,g){function h(a,b){return Math.floor(Math.random()*(b-a+1))+a}a.initView=function(){b.get("/api/integrations").success(function(b){a.integrations=b.rows,a.groupedIntegration=_.chunk(a.integrations,4),d.syncUpdates("integration",a.integrations,function(){a.groupedIntegration=_.chunk(a.integrations,4)})}).error(function(a){e.show(a.message,"danger")})},a.isProgressing=!1,a.$on("$destroy",function(){d.unsyncUpdates("integration")}),a.installIntegration=function(d){a.status="Downloading",a.percentage=h(1,50),a.isProgressing=!0,d.downloading=!0,b.put("/api/integrations/"+d.id,{active:!0}).success(function(){g(function(){a.percentage=h(51,99),a.status="Installing"},2500),g(function(){a.percentage=100,a.isProgressing=!1,a.status="Completed!",d.downloading=!1,e.show(c.instant("MESSAGE_WELL_DONE")+".","success")},5e3)}).error(function(){d.downloading=!1,a.percentage=0,a.isProgressing=!1,e.show(c.instant("MESSAGE_SOMETHING_WENT_WRONG")+".","danger")})},a.uninstallIntegration=function(d){a.status="Uninstalling",a.percentage=h(1,99),a.isProgressing=!0,d.downloading=!0,b.put("/api/integrations/"+d.id,{active:!1}).success(function(){g(function(){a.percentage=100,a.isProgressing=!1,a.status="Completed!",d.downloading=!1,e.show(c.instant("MESSAGE_WELL_DONE")+".","success")},5e3)}).error(function(){d.downloading=!1,a.percentage=0,a.isProgressing=!1,e.show(c.instant("MESSAGE_SOMETHING_WENT_WRONG")+".","danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.market",{url:"/market",templateUrl:"app/market/market.html",controller:"MarketCtrl",data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").controller("MotionbarCtrl",["$scope","$stateParams","$cookieStore","settings","Auth",function(a,b,c,d,e){e.loginWithToken(b.token,b.userId,b.name),a.getCurrentUser=e.getCurrentUser,d.layout.pageQuickSidebarOpened=!0}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("motionbar",{url:"/motionbar",template:"<div ui-view></div>","abstract":!0}).state("motionbar.chat",{url:"/chat?token&userId&name",templateUrl:"app/motionbar/motionbar.chat.html",controller:"MotionbarCtrl"})}]),angular.module("xCallyShuttleApp").controller("SalesforceListCtrl",["$scope","$http","$rootScope","xAlert","$translate","socket","Modal","stResource",function(a,b,c,d,e,f,g,h){a.conf={accountsByPage:{name:"10",value:10}},a.accountsByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.accounts={checked:[]},a.check=function(b,c){c?a.accounts.checked=angular.copy(_.map(a.displayedSalesforceAccounts,"id")):a.accounts.checked=[]},a.getAccounts=function(b){return _.map(a.displayedSalesforceAccounts,function(a){var c={};return b.forEach(function(b){c[b]=a[b]}),c})},a.initList=function(b){f.unsyncUpdates("salesforce_account"),b.url="/api/salesforce/accounts",h.getPage(b).then(function(d){a.displayedSalesforceAccounts=d.rows,b.pagination.numberOfPages=d.total_pages,c.updateTableConfig(a.accountsByPage,a.displayedSalesforceAccounts.length),c.updateTableConfig(a.conf.accountsByPage,a.displayedSalesforceAccounts.length)}),f.socket.on("salesforce_account:save",function(){a.initList(b)}),f.socket.on("salesforce_account:remove",function(c){a.accounts.checked=_.without(a.accounts.checked,c.id),a.initList(b)})},a.deleteItem=g.confirm["delete"](function(a){b["delete"]("/api/salesforce/accounts/"+a).success(function(){d.show(e.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(a){d.show(e.instant(a.message),"danger")})}),a.deleteItems=g.confirm["delete"](function(){b["delete"]("/api/salesforce/accounts",{params:{id:a.accounts.checked}}).success(function(){d.show(e.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){d.show(e.instant(a.message),"danger")})}),a.checkAccount=function(a){b.get("/api/salesforce/accounts/"+a+"/check").then(function(){d.show(e.instant("MESSAGE_ACCOUNT_VERIFIED"),"success")})["catch"](function(){d.show(e.instant("MESSAGE_ACCOUNT_INVALID"),"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.salesforce.list",{url:"/list",templateUrl:"app/salesforce/list/list.html",controller:"SalesforceListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.salesforce",{url:"/salesforce",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").factory("SalesforceAccount",["$resource",function(a){return a("/api/salesforce/accounts/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").controller("SalesforceViewCtrl",["$scope","$http","$stateParams","$translate","$location","WizardHandler","socket","xAlert","Modal","$filter",function(a,b,c,d,e,f,g,h,i,j){a.$stateParams=c,a.config={autoHideScrollbar:!1,theme:"dark",advanced:{updateOnContentResize:!0},setHeight:500,scrollInertia:0},a.initConfiguration=function(){a.formsConfiguration={},a.configuration={}},a.goNext=function(){f.wizard().next()},a.formValidation=function(a){return a},a.$on("$destroy",function(){g.unsyncUpdates("salesforce_configuration"),g.unsyncUpdates("salesforce_field")}),a.initView=function(){b.get("/api/salesforce/accounts/"+c.id).success(function(b){a.account=b}).error(function(a){h.show(a.message,"danger")})},a.updateItem=function(){b.put("/api/salesforce/accounts/"+c.id,a.account).success(function(){h.show(d.instant("MESSAGE_WELL_DONE")+".","success")}).error(function(){h.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG")+".","danger")})},a.getConfigurations=function(){b.get("/api/salesforce/configurations",{params:{AccountId:c.id}}).success(function(b){a.configurations=b,g.socket.on("salesforce_configuration:remove",function(b){_.remove(a.configurations,{id:b.id})})}).error(function(a){h.show(a.message,"danger")})},a.deleteConfiguration=i.confirm["delete"](function(a){b["delete"]("api/salesforce/configurations/"+a).success(function(){h.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(){h.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})}),a.createConfiguration=function(){a.configuration.AccountId=c.id,b.post("api/salesforce/configurations",a.configuration).success(function(a){e.path("salesforce/view/"+c.id+"/configurations/settings/"+a.id)}).error(function(){h.show("Something went wrong!","danger")})},a.fieldType=["string","variable"],a.descFieldType=["string","key_value"],a.getFields=function(){b.get("/api/salesforce/accounts/"+c.id+"/fields").success(function(b){a.accountFields=_.sortByOrder(j("salesforce")(b),"name","asc")}).error(function(a){h.show(a.message,"danger")})},a.getConfiguration=function(){b.get("/api/salesforce/configurations/"+c.configurationId).success(function(b){a.configurationName=b.name,a.subjectConfig=b.Subject,a.descriptionConfig=b.Description,a.fieldConfig=b.Field,g.socket.on("salesforce_field:remove",function(b){_.remove(a.subjectConfig,{id:b.id}),_.remove(a.descriptionConfig,{id:b.id}),_.remove(a.fieldConfig,{id:b.id})})}).error(function(a){h.show(a.message,"danger")})},a.getVariables=function(){b.get("/api/variables").success(function(b){a.variables=b.rows}).error(function(a){h.show(a.message,"danger")})},a.removeItem=function(a){b["delete"]("api/salesforce/fields/"+a.id).success(function(){h.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(){h.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})},a.addItemSubject=function(){var d={type:"string",content:""};b.post("/api/salesforce/configurations/"+c.configurationId+"/subject",d).success(function(b){a.subjectConfig.push(b)}).error(function(){h.show("Something went wrong!","danger")})},a.addItemDescription=function(){var d={type:"string",content:""};b.post("/api/salesforce/configurations/"+c.configurationId+"/description",d).success(function(b){a.descriptionConfig.push(b)}).error(function(){h.show("Something went wrong!","danger")})},a.addItemField=function(){var d={content:""};b.post("/api/salesforce/configurations/"+c.configurationId+"/field",d).success(function(b){a.fieldConfig.push(b)}).error(function(){h.show("Something went wrong!","danger")})},a.updateField=function(a){b.put("/api/salesforce/fields/"+a.id,a).success(function(){}).error(function(){h.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG")+".","danger")})},a.changeType=function(b){"variable"===b.type?b.content="":"string"===b.type&&(b.VariableId=null),a.updateField(b)},a.changeDescType=function(b){"key_value"===b.type?(b.content="","string"===b.keyType?b.VariableId=null:"variable"===b.keyType&&(b.keyContent="")):"string"===b.type&&(b.VariableId=null,b.key="",b.keyContent=""),a.updateField(b)},a.changeFieldType=function(b){b.content="",a.updateField(b)},a.getSystemFieldOptions=function(b){if(b){var c=_.find(a.accountFields,"name",b);if(c)switch(c.type){case"picklist":return c.picklistValues;default:return}}}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.salesforce.view",{url:"/view/:id",templateUrl:"app/salesforce/view/view.html",controller:"SalesforceViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.salesforce.view.account",{url:"/account",templateUrl:"app/salesforce/view/view.account.html"}).state("main.salesforce.view.configurations",{url:"/configurations",templateUrl:"app/salesforce/view/view.configurations.html"}).state("main.salesforce.view.configurations.settings",{url:"/settings/:configurationId",templateUrl:"app/salesforce/view/view.configurationSettings.html",controller:"SalesforceViewCtrl"}).state("main.salesforce.view.configuration",{url:"/configuration",templateUrl:"app/salesforce/view/view.configuration.html"})}]),angular.module("xCallyShuttleApp").controller("SalesforceWizardCtrl",["$scope","$http","$location","$translate","xAlert","WizardHandler",function(a,b,c,d,e,f){a.translate=d,a.initWizard=function(){a.$translate=d,a.forms={},a.item={}},a.next=function(){f.wizard().next()},a.exitValidation=function(a){return a},a.createItem=function(){console.log(a.item),b.post("api/salesforce/accounts",a.item).success(function(){e.show(d.instant("MESSAGE_WELL_DONE")+".","success"),c.path("/salesforce/list")}).error(function(){e.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG")+".","danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.salesforce.wizard",{url:"/wizard",templateUrl:"app/salesforce/wizard/wizard.html",controller:"SalesforceWizardCtrl"})}]),angular.module("xCallyShuttleApp").factory("License",["$resource",function(a){return a("/api/licenses/:id/:controller",{id:"@id"},{request:{method:"POST",params:{id:"request"}}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting.license",{url:"/license",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("LicenseViewCtrl",["$scope","$rootScope","$translate","License","xAlert",function(a,b,c,d,e){a.initView=function(){d.get(function(b){a.item=b.license})},a.submitRequest=function(){d.request(a.item,function(){e.show(c.instant("MESSAGE_WELL_DONE"),"success")},function(a){switch(a.status){case 304:e.show(a.statusText,"info");break;default:e.show(a.statusText,"danger")}})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting.license.view",{url:"/view",templateUrl:"app/setting/license/view/view.html",controller:"LicenseViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/css/pricing-tables.css"]}])}]}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting",{url:"/setting",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").factory("Setting",["$resource",function(a){return a("/api/settings/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").factory("Smtp",["$resource",function(a){return a("/api/mail/servers/out/:id/:controller",{id:"@id"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting.smtp",{url:"/smtp",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("SmtpViewCtrl",["$scope","$stateParams","$translate","MailServerOut","xAlert","usSpinnerService",function(a,b,c,d,e,f){a.initView=function(){a.item={},d.get({id:"service"}).$promise.then(function(b){a.item=b})["catch"](function(a){e.show(a.message,"danger")})},a.updateItem=function(){return a.item.id?d.update({id:a.item.id},a.item).$promise.then(function(){e.show(c.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){e.show(a.message,"danger")}):(a.item.service=!0,d.save(a.item).$promise.then(function(b){a.item=b,e.show(c.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){e.show(a.message,"danger")}))},a.test=function(){return f.spin("spinner-grid"),d.test({id:a.item.id,controller:"test"}).$promise.then(function(){e.show(c.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){e.show(a.data.message,"danger")})["finally"](function(){f.stop("spinner-grid")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting.smtp.view",{url:"/view",templateUrl:"app/setting/smtp/view/view.html",controller:"SmtpViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}})}]),angular.module("xCallyShuttleApp").controller("UpdateListCtrl",["$scope","gridOptions","$uibModal","$location","Update",function(a,b,c,d,e){a.initCounter=function(){a.$on("timer-stopped",function(a,b){console.log("Timer Stopped - data = ",b),d.path("/dashboard/voice")})},a.initView=function(){var c={exporterCsvFilename:"updates.csv",enableFiltering:!1,enableSorting:!1,enablePaginationControls:!1,enableSelectAll:!1,columnDefs:[{name:"message"},{width:125,name:"version",cellClass:"text-center ui-grid-vcenter"},{width:125,name:"createdAt",displayName:"APPLICATION_UPDATED_AT",cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div><span am-time-ago="row.entity.createdAt"></span></div>'}]};a.gridOptions=b.gridOptions(e,c,a)},a.pull=function(){c.open({animation:!0,templateUrl:"app/setting/update/list/list.pull.html",controller:"UpdateListPullCtrl"})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting.updates.list",{url:"/list",templateUrl:"app/setting/update/list/list.html",controller:"UpdateListCtrl"}).state("main.setting.updates.landing",{url:"/landing",templateUrl:"app/setting/update/list/landing.html",controller:"UpdateListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/error.css"]}])}]}})}]),angular.module("xCallyShuttleApp").controller("UpdateListPullCtrl",["$scope","$uibModalInstance","$translate","$location","Update","xAlert",function(a,b,c,d,e,f){a.modal={dismissable:!0,title:"Confirm Checkout",html:"Are you sure you want to checkout?",buttons:[{classes:"btn btn-success",text:"Checkout",click:function(){return b.dismiss("close"),e.pull().$promise.then(function(){d.path("/setting/updates/landing")})["catch"](function(a){console.error("err",a),f.show(c.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})}},{classes:"btn default",text:"Cancel",click:function(){b.dismiss("cancel")}}]}}]),angular.module("xCallyShuttleApp").factory("Update",["$resource",function(a){return a("/api/updates/:id/:controller",{id:"@id"},{pull:{method:"GET",params:{id:"pull"}}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting.updates",{url:"/updates",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("SquareOdbcListCtrl",["$scope","$uibModal","$translate","SquareOdbc","gridOptions","xAlert",function(a,b,c,d,e,f){a.initView=function(){var b={exporterCsvFilename:"odbc.csv",columnDefs:[{name:"name"},{name:"dsn",displayName:"APPLICATION_ODBC"},{name:"description"},{name:"action",width:250,buttons:[{"class":"blue-hoki",href:"/square/odbc/view/{{row.entity.id}}/settings",name:"settings"},{"class":"green-jungle",name:"check",displayName:"APPLICATION_CHECK_CONNECTION",onClick:"grid.appScope.checkConnection(row.entity.id)"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=e.gridOptions(d,b,a)},a.createItem=function(){var c=b.open({animation:!0,templateUrl:"app/square/odbc/list/list.create.modal.html",controller:"SquareOdbcListCreateCtrl"});c.result.then(function(){a.gridOptions.getPage()})},a.checkConnection=function(a){return d.get({id:a,controller:"check"}).$promise.then(function(){f.show(c.instant("MESSAGE_CONNECTION_VERIFIED"),"success")})["catch"](function(){f.show(c.instant("MESSAGE_CONNECTION_INVALID"),"danger")})}}]),angular.module("xCallyShuttleApp").controller("SquareOdbcListCreateCtrl",["$scope","$translate","$uibModalInstance","SquareOdbc","xAlert",function(a,b,c,d,e){a.form={},a.item={},a.item.dsn||(a.item.dsn="DRIVER=MySQL;SERVER=127.0.0.1;UID=xcall;PWD=password;DATABASE=motion"),a.save=function(){return d.save(a.item).$promise.then(function(a){e.show(b.instant("MESSAGE_WELL_DONE"),"success"),c.close(a)})["catch"](function(a){e.show(a.data.message,"danger")})},a.cancel=function(){c.dismiss()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.square.odbc.list",{url:"/list",templateUrl:"app/square/odbc/list/list.html",controller:"SquareOdbcListCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.square.odbc",{url:"/odbc",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").factory("SquareOdbc",["$resource",function(a){return a("/api/square/odbc/:id/:controller",{name:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").controller("SquareOdbcViewCtrl",["$scope","$translate","$stateParams","SquareOdbc","xAlert",function(a,b,c,d,e){a.odbc={},a.getOdbc=function(){return d.get({id:c.id}).$promise.then(function(b){a.odbc=b})["catch"](function(a){e.show(a.data.message,"danger")})},a.updateOdbc=function(){var f=angular.copy(a.odbc);return d.update({id:c.id},f).$promise.then(function(){e.show(b.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){e.show(a.data.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.square.odbc.view",{url:"/view/:id",templateUrl:"app/square/odbc/view/view.html",controller:"SquareOdbcViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.square.odbc.view.settings",{url:"/settings",templateUrl:"app/square/odbc/view/view.settings.html"})}]),angular.module("xCallyShuttleApp").controller("SquareProjectListCtrl",["$scope","$uibModal","SquareProject","gridOptions",function(a,b,c,d){a.initView=function(){var b={exporterCsvFilename:"projects.csv",columnDefs:[{name:"name"},{name:"description"
+},{name:"action",width:160,buttons:[{"class":"blue-hoki",href:"/square/projects/view/{{row.entity.id}}",name:"settings"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=d.gridOptions(c,b,a)},a.createItem=function(){var c=b.open({animation:!0,templateUrl:"app/square/project/list/list.create.modal.html",controller:"SquareProjectListCreateCtrl"});c.result.then(function(b){console.log(b),a.gridOptions.getPage()})}}]),angular.module("xCallyShuttleApp").controller("SquareProjectListCreateCtrl",["$scope","$translate","$uibModalInstance","SquareProject","xAlert",function(a,b,c,d,e){a.form={},a.item={},a.save=function(){return d.save(a.item).$promise.then(function(a){e.show(b.instant("MESSAGE_WELL_DONE"),"success"),c.close(a)})["catch"](function(a){e.show(a.data.message,"danger")})},a.cancel=function(){c.dismiss()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.square.projects.list",{url:"/list",templateUrl:"app/square/project/list/list.html",controller:"SquareProjectListCtrl",authenticate:!0})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.square.projects",{url:"/projects",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").factory("SquareProject",["$resource",function(a){return a("/api/square/projects/:id/:controller",{name:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").controller("SquareProjectViewCtrl",["$scope","$stateParams","Auth","xAlert","SquareProject",function(a,b,c,d,e){a.squareProject={},a.getProject=function(){return e.get({id:b.id}).$promise.then(function(b){a.squareProject=b,angular.element(document).ready(function(){window.onerror=function(a,b,c){try{if(null!==a&&-1!==a.indexOf("Script error."));else{var e=new Image;e.src="assets/plugins/mxgraph/images/1x1.png?msg="+encodeURIComponent(a)+"&url="+encodeURIComponent(b)+"&lnum="+encodeURIComponent(c)}}catch(f){d.show(f,"danger")}},b.token=c.getToken();var a=new EditorUi(new Editor);a.openString(b.preproduction,b.name,b),a.editor.graphChangeListener=function(a,b){var c=b.properties.rtChange||!1;c||(this.modified=!0)}})})["catch"](function(a){d.show(a.data.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.square.projects.view",{url:"/view/:id",templateUrl:"app/square/project/view/view.html",controller:"SquareProjectViewCtrl",authenticate:!0,resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",serie:!0,cache:!1,files:["assets/plugins/mxgraph/css/common.css","assets/plugins/mxgraph/css/explorer.css","assets/plugins/mxgraph/styles/grapheditor.css","assets/plugins/mxgraph/styles/custom.css","assets/plugins/square/js/custom.js","assets/plugins/mxgraph/js/mxClient.js","assets/plugins/square/js/Editor.js","assets/plugins/square/js/Graph.js","assets/plugins/square/js/EditorUi.js","assets/plugins/square/js/Actions.js","assets/plugins/square/js/Menus.js","assets/plugins/square/js/Sidebar.js","assets/plugins/square/js/Toolbar.js","assets/plugins/square/js/Dialogs.js"]}])}]}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.square",{url:"/square",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").factory("Agent",["$resource",function(a){return a("/api/agents/:id/:controller",{id:"@id"},{changePassword:{method:"PUT",params:{controller:"password"}},update:{method:"PUT"},patch:{method:"PATCH"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.agents",{url:"/agents",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("AgentListCtrl",["$scope","Agent","gridOptions",function(a,b,c){a.initView=function(){var d={exporterCsvFilename:"agents.csv",columnDefs:[{name:"fullname"},{name:"name",displayName:"APPLICATION_USERNAME"},{name:"internal"},{name:"email"},{name:"description"},{name:"action",width:125,buttons:[{"class":"blue-hoki",href:"/staff/agents/view/{{row.entity.id}}/account",name:"profile"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.fullname, row.entity.id)"}]}]};a.gridOptions=c.gridOptions(b,d,a)}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.agents.list",{url:"/list",templateUrl:"app/staff/agent/list/list.html",controller:"AgentListCtrl",data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").controller("AgentViewCtrl",["$scope","$http","xAlert","$translate","$stateParams","$cookieStore","Agent","FileUploader","Auth","User",function(a,b,c,d,e,f,g,h,i,j){a.Auth=i,a.recordSwitch={onText:"On",offText:"Off",isActive:!0,size:"small",animate:!0,radioOff:!0,handleWidth:"auto",labelWidth:"auto",inverse:!0,offColor:"danger",onColor:"success"},a.updatePassword=function(){var b={newPassword:a.agent.newPwd};return i.isAdmin()?b.id=e.id:b.oldPassword=a.agent.currentPwd,j.changePassword(b).$promise.then(function(){c.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){c.show(a.message,"danger")})};var k=a.uploader=new h({url:"api/users/"+e.id+"/avatar",queueLimit:1,withCredentials:!0,headers:{Authorization:"Bearer "+f.get("token")}});k.filters.push({name:"imageFilter",fn:function(a){var b="|"+a.type.slice(a.type.lastIndexOf("/")+1)+"|";return-1!=="|jpg|png|jpeg|".indexOf(b)}}),k.onSuccessItem=function(b,e){a.agent.userpic=e.userpic,a.agent.id===i.getCurrentUser().id&&(i.getCurrentUser().userpic=e.userpic),c.show(d.instant("MESSAGE_WELL_DONE"),"success")},k.onErrorItem=function(){},k.onCompleteAll=function(){k.clearQueue()},a.initView=function(){return g.get({id:e.id}).$promise.then(function(b){a.agent=b,a.agent.transport=a.agent.transport?a.agent.transport.split(","):[],a.agent.allow=a.agent.allow?a.agent.allow.split(";"):[],a.agent.nat=a.agent.nat?a.agent.nat.split(","):[]})["catch"](function(a){c.show(a.message,"danger")})},a.patchItem=function(){return g.patch({id:e.id},{chatCapacity:a.agent.chatCapacity,mailCapacity:a.agent.mailCapacity,faxCapacity:a.agent.faxCapacity}).$promise.then(function(){c.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){c.show(a.message,"danger")})},a.updateItem=function(){var b=angular.copy(a.agent);return delete b.password,delete b.md5secret,b.transport=b.transport.join(","),b.allow=b.allow.join(";"),b.nat=b.nat.join(","),g.update({id:e.id},b).$promise.then(function(){c.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){c.show(a.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.agents.view",{url:"/view/:id",templateUrl:"app/staff/agent/view/view.html",controller:"AgentViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.staff.agents.view.account",{url:"/account",templateUrl:"app/staff/agent/view/view.account.html",resolve:{deps:["$ocLazyLoad",function(a){return a.load({insertBefore:"#ng_load_plugins_before",files:["assets/scripts/jquery.sparkline.min.js","assets/plugins/bootstrap-fileinput/bootstrap-fileinput.js","assets/scripts/profile.js"]})}]}}).state("main.staff.agents.view.voice",{url:"/voice",templateUrl:"app/staff/agent/view/view.voice.html",data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}}).state("main.staff.agents.view.chat",{url:"/chat",templateUrl:"app/staff/agent/view/view.chat.html",data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}}).state("main.staff.agents.view.mail",{url:"/mail",templateUrl:"app/staff/agent/view/view.mail.html",data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}}).state("main.staff.agents.view.fax",{url:"/fax",templateUrl:"app/staff/agent/view/view.fax.html",data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}}).state("main.staff.agents.view.phonebar",{url:"/phonebar",templateUrl:"app/staff/agent/view/view.phonebar.html",data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").controller("AgentWizardCtrl",["$scope","$rootScope","Agent","Setting","xAlert","$location","$translate","$http","WizardHandler",function(a,b,c,d,e,f,g,h,i){a.forms={info:void 0,voice:void 0},a.item={role:"agent",allow:["alaw","ulaw","gsm"],transport:["udp"],context:"from-sip"},a.next=function(){i.wizard().next()},a.exitValidation=function(a){return a},a.getFirstFreeInternal=function(){return d.get({controller:"internal"}).$promise.then(function(b){a.item.internal=b.value})["catch"](function(a){e.show(a.data.message,"danger")})},a.createItem=function(){var b=angular.copy(a.item);return b.transport&&(b.transport=b.transport.join(",")),a.item.allow&&(b.allow=b.allow.join(";")),c.save(b).$promise.then(function(){f.path("/staff/agents/list")})["catch"](function(a){e.show(a.data.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.agents.wizard",{url:"/wizard",templateUrl:"app/staff/agent/wizard/wizard.html",controller:"AgentWizardCtrl",data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff",{url:"/staff",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("TeamCreateCtrl",["$scope","$uibModalInstance","Team","xAlert",function(a,b,c,d){a.form={},a.item={},a.ok=function(){return c.save(a.item).$promise.then(function(){b.close(a.item)})["catch"](function(a){d.show(a.data.message,"danger")})},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("TeamListCtrl",["$scope","Team","gridOptions","$uibModal",function(a,b,c,d){a.initView=function(){var d={exporterCsvFilename:"teams.csv",columnDefs:[{name:"name"},{name:"description"},{name:"action",width:125,buttons:[{"class":"{{row.entity.defaultEntry ? 'blue-hoki disabled' : 'blue-hoki'}}",href:"/staff/teams/view/{{row.entity.id}}/settings",name:"profile"},{"class":"{{row.entity.defaultEntry ? 'red-sunglo disabled' : 'red-sunglo'}}",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=c.gridOptions(b,d,a)},a.createItem=function(){d.open({animation:!0,templateUrl:"app/staff/team/list/create.modal.html",controller:"TeamCreateCtrl"}).result.then(function(){a.gridOptions.getPage()})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.teams.list",{url:"/list",templateUrl:"app/staff/team/list/list.html",controller:"TeamListCtrl"})}]),angular.module("xCallyShuttleApp").factory("Team",["$resource",function(a){return a("/api/teams/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.teams",{url:"/teams",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").controller("TeamViewCtrl",["$scope","$http","$stateParams","$translate","Team","Agent","xAlert",function(a,b,c,d,e,f,g){var h=function(){return{select:function(b){return console.log("agents",b),e.save({id:a.team.id,controller:"agents"},{agents:b})},deselect:function(b){return e["delete"]({id:a.team.id,controller:"agents",agents:b})}}};a.initView=function(){return e.get({id:c.id}).$promise.then(function(b){a.team=b})["catch"](function(a){g.show(a.message,"danger")})},a.initAgents=function(){return f.get().$promise.then(function(b){return a.agents=b.rows,e.query({id:c.id,controller:"agents"}).$promise}).then(function(b){ComponentsDropdowns.bindTeam(_.map(b,"id"),_.map(a.agents,function(a){return{id:a.id,name:a.name,fullname:a.fullname,internal:a.internal}}),h)})["catch"](function(a){g.show(a.message,"danger")})},a.updateItem=function(){var b=angular.copy(a.team);return e.update({id:c.id},b).$promise.then(function(){g.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){g.show(a.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.teams.view",{url:"/view/:id",templateUrl:"app/staff/team/view/view.html",controller:"TeamViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.staff.teams.view.agents",{url:"/agents",templateUrl:"app/staff/team/view/view.agents.html",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/jquery-multi-select/css/multi-select.css","assets/plugins/jquery-multi-select/js/jquery.multi-select.js","assets/plugins/jquery-quicksearch/jquery.quicksearch.js","assets/scripts/components-dropdowns.js"]}])}]}}).state("main.staff.teams.view.settings",{url:"/settings",templateUrl:"app/staff/team/view/view.settings.html"})}]),angular.module("xCallyShuttleApp").controller("TelephoneListCtrl",["$scope","Telephone","gridOptions",function(a,b,c){a.initView=function(){var d={exporterCsvFilename:"telephones.csv",columnDefs:[{name:"fullname"},{name:"name"},{name:"accountcode"},{name:"description"},{name:"action",width:125,buttons:[{"class":"blue-hoki",href:"/staff/telephones/view/{{row.entity.id}}/account",name:"profile"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.fullname, row.entity.id)"}]}]};a.gridOptions=c.gridOptions(b,d,a)}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.telephones.list",{url:"/list",templateUrl:"app/staff/telephone/list/list.html",controller:"TelephoneListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").factory("Telephone",["$resource",function(a){return a("/api/telephones/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.telephones",{url:"/telephones",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").controller("TelephoneViewCtrl",["$scope","$http","$stateParams","$translate","$cookieStore","Auth","xAlert","Telephone",function(a,b,c,d,e,f,g,h){a.initView=function(){a.Auth=f,a.forms={},h.get({id:c.id}).$promise.then(function(b){delete b.password,a.item=b,a.item.transport=a.item.transport?a.item.transport.split(","):[],a.item.allow=a.item.allow?a.item.allow.split(";"):[]})["catch"](function(a){g.show(a.message,"danger")})},a.updateItem=function(){var b=angular.copy(a.item);b.transport=b.transport.join(","),b.allow=b.allow.join(";"),h.update(b).$promise.then(function(){g.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){g.show(a.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.telephones.view",{url:"/view/:id",templateUrl:"app/staff/telephone/view/view.html",controller:"TelephoneViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.staff.telephones.view.account",{url:"/account",templateUrl:"app/staff/telephone/view/view.account.html",resolve:{deps:["$ocLazyLoad",function(a){return a.load({insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css","assets/scripts/jquery.sparkline.min.js","assets/plugins/bootstrap-fileinput/bootstrap-fileinput.js","assets/scripts/profile.js"]})}]}})}]),angular.module("xCallyShuttleApp").controller("TelephoneWizardCtrl",["$scope","$http","$location","WizardHandler","xAlert","$translate","Telephone",function(a,b,c,d,e,f,g){a.next=function(){d.wizard().next()},a.exitValidation=function(a){return a},a.initWizard=function(){return a.forms={},a.item={allow:["alaw","ulaw","gsm"],transport:["udp"],context:"from-sip"},g.get({id:"internal"}).$promise.then(function(b){a.item.internal=b.internal})["catch"](function(a){console.error(a)})},a.createItem=function(){var b=angular.copy(a.item);return b.transport&&(b.transport=b.transport.join(",")),a.item.allow&&(b.allow=b.allow.join(";")),g.save(b).$promise.then(function(){c.path("/staff/telephones/list")})["catch"](function(a){e.show(a.data.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.telephones.wizard",{url:"/wizard",templateUrl:"app/staff/telephone/wizard/wizard.html",controller:"TelephoneWizardCtrl"})}]),angular.module("xCallyShuttleApp").controller("UserListCtrl",["$scope","User","gridOptions",function(a,b,c){a.initView=function(){var d={exporterCsvFilename:"users.csv",columnDefs:[{name:"fullname"},{name:"name",displayName:"APPLICATION_USERNAME"},{name:"email"},{name:"description"},{name:"action",width:125,buttons:[{"class":"blue-hoki",href:"/staff/users/view/{{row.entity.id}}/account",name:"profile"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.fullname, row.entity.id)"}]}]};a.gridOptions=c.gridOptions(b,d,a)}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.users.list",{url:"/list",templateUrl:"app/staff/user/list/list.html",controller:"UserListCtrl"})}]),angular.module("xCallyShuttleApp").factory("User",["$resource",function(a){return a("/api/users/:id/:controller",{id:"@id"},{changePassword:{method:"PUT",params:{controller:"password"}},update:{method:"PUT"},me:{method:"GET",params:{id:"me"}}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.users",{url:"/users",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").controller("UserViewCtrl",["$scope","$stateParams","$cookieStore","$translate","FileUploader","User","Auth","xAlert",function(a,b,c,d,e,f,g,h){a.Auth=g,a.initView=function(){return f.get({id:b.id}).$promise.then(function(b){a.user=b,a.user.transport=a.user.transport?a.user.transport.split(","):[],a.user.allow=a.user.allow?a.user.allow.split(";"):[]})["catch"](function(a){h.show(a.message,"danger")})},a.updateItem=function(){var c=angular.copy(a.user);return delete c.password,delete c.md5secret,c.transport=c.transport.join(","),c.allow=c.allow.join(";"),f.update({id:b.id},c).$promise.then(function(){h.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){h.show(a.message,"danger")})},a.updatePassword=function(){var c={newPassword:a.user.newPwd};return g.isAdmin()?c.id=b.id:c.oldPassword=a.user.currentPwd,f.changePassword(c).$promise.then(function(){h.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){h.show(a.message,"danger")})};var i=a.uploader=new e({url:"api/users/"+b.id+"/avatar",queueLimit:1,withCredentials:!0,headers:{Authorization:"Bearer "+c.get("token")}});i.filters.push({name:"imageFilter",fn:function(a){var b="|"+a.type.slice(a.type.lastIndexOf("/")+1)+"|";return-1!=="|jpg|png|jpeg|".indexOf(b)}}),i.onSuccessItem=function(b,c){a.user.userpic=c.userpic,a.user.id===g.getCurrentUser().id&&(g.getCurrentUser().userpic=c.userpic),h.show(d.instant("MESSAGE_WELL_DONE"),"success")},i.onErrorItem=function(){h.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")},i.onCompleteAll=function(){i.clearQueue()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.users.view",{url:"/view/:id",templateUrl:"app/staff/user/view/view.html",controller:"UserViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.staff.users.view.account",{url:"/account",templateUrl:"app/staff/user/view/view.account.html",resolve:{deps:["$ocLazyLoad",function(a){return a.load({insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css","assets/scripts/jquery.sparkline.min.js","assets/plugins/bootstrap-fileinput/bootstrap-fileinput.js","assets/scripts/profile.js"]})}]}})}]),angular.module("xCallyShuttleApp").controller("UserWizardCtrl",["$scope","$location","WizardHandler","xAlert","$translate","User",function(a,b,c,d,e,f){a.forms={info:void 0,voice:void 0},a.item={role:"user",host:"dynamic",context:"from-sip"},a.next=function(){c.wizard().next()},a.exitValidation=function(a){return a},a.createItem=function(){return f.save(a.item).$promise.then(function(){b.path("/staff/users/list")})["catch"](function(a){d.show(a.data.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.users.wizard",{url:"/wizard",templateUrl:"app/staff/user/wizard/wizard.html",controller:"UserWizardCtrl"})}]),angular.module("xCallyShuttleApp").controller("SugarcrmListCtrl",["$scope","SugarcrmAccount","gridOptions","xAlert","$translate","Modal",function(a,b,c,d,e,f){a.initView=function(){var d={exporterCsvFilename:"sugarcrm_account.csv",columnDefs:[{name:"name",displayName:"APPLICATION_NAME"},{name:"username"},{name:"remoteUri",displayName:"APPLICATION_REMOTE_ADDRESS"},{name:"action",width:250,buttons:[{"class":"blue-hoki",href:"/sugarcrm/view/{{row.entity.id}}/account",name:"profile"},{"class":"green-jungle",name:"check",displayName:"APPLICATION_CHECK_CONNECTION",onClick:"grid.appScope.checkAccount(row.entity.id)"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=c.gridOptions(b,d,a)},a.checkAccount=function(a){return b.get({id:a,controller:"check"}).$promise.then(function(){d.show(e.instant("MESSAGE_ACCOUNT_VERIFIED"),"success")})["catch"](function(a){d.show(e.instant("MESSAGE_ACCOUNT_INVALID"),"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.sugarcrm.list",{url:"/list",templateUrl:"app/sugarcrm/list/list.html",controller:"SugarcrmListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.sugarcrm",{url:"/sugarcrm",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").factory("SugarcrmAccount",["$resource",function(a){return a("/api/sugarcrm/accounts/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").factory("SugarcrmConfiguration",["$resource",function(a){return a("/api/sugarcrm/configurations/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").factory("SugarcrmField",["$resource",function(a){return a("/api/sugarcrm/fields/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").controller("SugarcrmViewCtrl",["$scope","$http","$stateParams","$translate","$location","$filter","WizardHandler","socket","xAlert","Modal",function(a,b,c,d,e,f,g,h,i,j){a.$stateParams=c,a.config={autoHideScrollbar:!1,theme:"dark",advanced:{updateOnContentResize:!0},setHeight:500,scrollInertia:0},a.initConfiguration=function(){a.formsConfiguration={},a.configuration={}},a.goNext=function(){g.wizard().next()},a.formValidation=function(a){return a},a.$on("$destroy",function(){h.unsyncUpdates("sugarcrm_configuration"),h.unsyncUpdates("sugarcrm_field")}),a.initView=function(){b.get("/api/sugarcrm/accounts/"+c.id).success(function(b){a.account=b}).error(function(a){i.show(a.message,"danger")})},a.updateItem=function(){b.put("/api/sugarcrm/accounts/"+c.id,a.account).success(function(){i.show(d.instant("MESSAGE_WELL_DONE")+".","success")}).error(function(){i.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG")+".","danger")})},a.getConfigurations=function(){b.get("/api/sugarcrm/configurations",{params:{AccountId:c.id}}).success(function(b){a.configurations=b,h.socket.on("sugarcrm_configuration:remove",function(b){_.remove(a.configurations,{id:b.id})})}).error(function(a){i.show(a.message,"danger")})},a.deleteConfiguration=j.confirm["delete"](function(a){b["delete"]("api/sugarcrm/configurations/"+a).success(function(){i.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(){i.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})}),a.createConfiguration=function(){a.configuration.AccountId=c.id,b.post("api/sugarcrm/configurations",a.configuration).success(function(a){e.path("sugarcrm/view/"+c.id+"/configurations/settings/"+a.id)}).error(function(){i.show("Something went wrong!","danger")})},a.fieldType=["string","variable"],a.descFieldType=["string","key_value"],a.getFields=function(){b.get("/api/sugarcrm/accounts/"+c.id+"/fields").success(function(b){a.accountFields=_.sortByOrder(f("sugarcrm")(_.toArray(b)),"name","asc"),_.forEach(b,function(a){a.options=_.toArray(a.options)})}).error(function(a){i.show(a.message,"danger")})},a.getConfiguration=function(){b.get("/api/sugarcrm/configurations/"+c.configurationId).success(function(b){a.configurationName=b.name,a.subjectConfig=b.Subject,a.descriptionConfig=b.Description,a.fieldConfig=b.Field,h.socket.on("sugarcrm_field:remove",function(b){_.remove(a.subjectConfig,{id:b.id}),_.remove(a.descriptionConfig,{id:b.id}),_.remove(a.fieldConfig,{id:b.id})})}).error(function(a){i.show(a.message,"danger")})},a.getVariables=function(){b.get("/api/variables").success(function(b){a.variables=b.rows}).error(function(a){i.show(a.message,"danger")})},a.removeItem=function(a){b["delete"]("api/sugarcrm/fields/"+a.id).success(function(){i.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(){i.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})},a.addItemSubject=function(){var d={type:"string",content:""};b.post("/api/sugarcrm/configurations/"+c.configurationId+"/subject",d).success(function(b){a.subjectConfig.push(b)}).error(function(){i.show("Something went wrong!","danger")})},a.addItemDescription=function(){var d={type:"string",content:""};b.post("/api/sugarcrm/configurations/"+c.configurationId+"/description",d).success(function(b){a.descriptionConfig.push(b)}).error(function(){i.show("Something went wrong!","danger")})},a.addItemField=function(){var d={content:""};b.post("/api/sugarcrm/configurations/"+c.configurationId+"/field",d).success(function(b){a.fieldConfig.push(b)}).error(function(){i.show("Something went wrong!","danger")})},a.updateField=function(a){b.put("/api/sugarcrm/fields/"+a.id,a).success(function(){}).error(function(){i.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG")+".","danger")})},a.changeType=function(b){"variable"===b.type?b.content="":"string"===b.type&&(b.VariableId=null),a.updateField(b)},a.changeDescType=function(b){"key_value"===b.type?(b.content="","string"===b.keyType?b.VariableId=null:"variable"===b.keyType&&(b.keyContent="")):"string"===b.type&&(b.VariableId=null,b.key="",b.keyContent=""),a.updateField(b)},a.changeFieldType=function(b){b.content="",a.updateField(b)},a.getSystemFieldOptions=function(b){if(b){var c=_.find(a.accountFields,"name",b);return c?c.options.length>0?c.options:null:void 0}}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.sugarcrm.view",{url:"/view/:id",templateUrl:"app/sugarcrm/view/view.html",controller:"SugarcrmViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.sugarcrm.view.account",{url:"/account",templateUrl:"app/sugarcrm/view/view.account.html"}).state("main.sugarcrm.view.configurations",{url:"/configurations",templateUrl:"app/sugarcrm/view/view.configurations.html"}).state("main.sugarcrm.view.configurations.settings",{url:"/settings/:configurationId",templateUrl:"app/sugarcrm/view/view.configurationSettings.html",controller:"SugarcrmViewCtrl"}).state("main.sugarcrm.view.configuration",{url:"/configuration",templateUrl:"app/sugarcrm/view/view.configuration.html"})}]),angular.module("xCallyShuttleApp").controller("SugarcrmkWizardCtrl",["$scope","$http","$location","$translate","xAlert","WizardHandler",function(a,b,c,d,e,f){a.translate=d,a.initWizard=function(){a.$translate=d,a.forms={},a.item={}},a.next=function(){f.wizard().next()},a.exitValidation=function(a){return a},a.createItem=function(){b.post("api/sugarcrm/accounts",a.item).success(function(){e.show(d.instant("MESSAGE_WELL_DONE")+".","success"),c.path("/sugarcrm/list")}).error(function(){e.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG")+".","danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.sugarcrm.wizard",{url:"/wizard",templateUrl:"app/sugarcrm/wizard/wizard.html",controller:"SugarcrmkWizardCtrl"})}]),angular.module("xCallyShuttleApp").factory("CannedAnswer",["$resource",function(a){return a("/api/answers/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.answers",{url:"/answers",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("AnswerListCtrl",["$scope","$uibModal","CannedAnswer","gridOptions",function(a,b,c,d){a.initView=function(){var b={exporterCsvFilename:"answers.csv",columnDefs:[{name:"key",displayName:"APPLICATION_NAME"},{name:"value"},{name:"description"},{name:"action",width:160,buttons:[{"class":"blue-hoki",href:"/tools/answers/view/{{row.entity.id}}/settings",name:"settings"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.key, row.entity.id)"}]}]};a.gridOptions=d.gridOptions(c,b,a)},a.createItem=function(){b.open({animation:!0,templateUrl:"app/tools/answer/list/list.create.modal.html",controller:"AnswerListCreateCtrl"}).result.then(function(b){a.gridOptions.getPage()})}}]),angular.module("xCallyShuttleApp").controller("AnswerListCreateCtrl",["$scope","$translate","$uibModalInstance","CannedAnswer","xAlert",function(a,b,c,d,e){a.form={},a.item={},a.save=function(){return d.save(a.item).$promise.then(function(a){e.show(b.instant("MESSAGE_WELL_DONE"),"success"),c.close(a)})["catch"](function(a){e.show(a.data.message,"danger")})},a.cancel=function(){c.dismiss()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.answers.list",{url:"/list",templateUrl:"app/tools/answer/list/list.html",controller:"AnswerListCtrl"})}]),angular.module("xCallyShuttleApp").controller("AnswerViewCtrl",["$scope","$http","xAlert","$translate","$stateParams","$location","CannedAnswer",function(a,b,c,d,e,f,g){a.getAnswer=function(){return g.get({id:e.id}).$promise.then(function(b){a.answer=b})["catch"](function(a){c.show(a.data.message,"danger")})},a.updateAnswer=function(){var b=angular.copy(a.answer);return g.update({id:e.id},b).$promise.then(function(){c.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){c.show(a.data.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){
+a.state("main.tools.answers.view",{url:"/view/:id",templateUrl:"app/tools/answer/view/view.html",controller:"AnswerViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.tools.answers.view.settings",{url:"/settings",templateUrl:"app/tools/answer/view/view.settings.html"})}]),angular.module("xCallyShuttleApp").factory("Automation",["$resource",function(a){return a("/api/automations/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.automations",{url:"/automations",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("AutomationListCtrl",["$scope","$http","$translate","xAlert","Automation","gridOptions",function(a,b,c,d,e,f){a.onText="On",a.offText="Off",a.isActive=!0,a.size="mini",a.animate=!0,a.radioOff=!0,a.handleWidth="auto",a.labelWidth="auto",a.inverse=!0,a.offColor="danger",a.onColor="success",a.initView=function(){var b={exporterCsvFilename:"Automations.csv",columnDefs:[{name:"name"},{name:"description"},{name:"channel"},{name:"status",cellTemplate:'<div class="centered-uigrid-td"><input data-ng-change="grid.appScope.updateItem(row.entity)", bs-switch ng-model="row.entity.status" type="checkbox" switch-active="{{ grid.appScope.isActive }}" switch-on-text="{{ grid.appScope.onText }}" switch-off-text="{{ grid.appScope.offText }}" switch-on-color="{{ grid.appScope.onColor }}" switch-off-color="{{ grid.appScope.offColor }}" switch-animate="{{ grid.appScope.animate }}" switch-size="{{ grid.appScope.size }}" switch-label="{{ grid.appScope.label }}" switch-icon="{{ grid.appScope.icon }}" switch-radio-off="{{ grid.appScope.radioOff }}" switch-label-width="{{ grid.appScope.labelWidth }}" switch-handle-width="{{ grid.appScope.handleWidth }}"></div>',width:100,enableFiltering:!1},{name:"action",width:160,buttons:[{"class":"blue-hoki",href:"/tools/automations/view/{{row.entity.id}}/settings",name:"settings"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=f.gridOptions(e,b,a)},a.updateItem=function(a){return e.update({id:a.id},a).$promise.then(function(){d.show(c.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){console.error(a),d.show(a.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.automations.list",{url:"/list",templateUrl:"app/tools/automation/list/list.html",controller:"AutomationListCtrl"})}]),angular.module("xCallyShuttleApp").controller("AutomationViewCtrl",["$scope","$stateParams","$http","$translate","xAlert","automations","Automation","$location",function(a,b,c,d,e,f,g,h){a.$automations=f,a.recordSwitch={onText:"On",offText:"Off",isActive:!0,size:"small",animate:!0,radioOff:!0,handleWidth:"auto",labelWidth:"auto",inverse:!0,offColor:"danger",onColor:"success"},a.forms={general:{}},a.addCondition=function(b){a.automation[b].push({field:"",operator:"",value:""})},a.removeCondition=function(b,c){a.automation[b].splice(c,1)},a.addAction=function(){a.automation.Actions.push({action:"",data1:"",data2:"",data3:"",data4:"",data5:""})},a.resetActionData=function(a){a.data1="",a.data2="",a.data3="",a.data4="",a.data5=""},a.removeAction=function(b){a.automation.Actions.splice(b,1)},a.initView=function(){return g.get({id:b.id}).$promise.then(function(b){a.automation=b})["catch"](function(a){e.show(a.message,"danger"),h.path("/tools/automations/list")})},a.updateAutomation=function(){return g.update({id:b.id},a.automation).$promise.then(function(){e.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){console.error(a),e.show(a.message,"danger")})},a.exitValidation=function(b){return console.log(b&&(a.automation.All.length||a.automation.Any.length)&&a.automation.Actions.length),b&&(a.automation.All.length||a.automation.Any.length)&&a.automation.Actions.length?!0:!1}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.automations.view",{url:"/view/:id",templateUrl:"app/tools/automation/view/view.html",controller:"AutomationViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load({insertBefore:"#ng_load_plugins_before",files:["assets/css/profile.css","assets/css/tasks.css"]})}]}}).state("main.tools.automations.view.settings",{url:"/settings",templateUrl:"app/tools/automation/view/view.settings.html"}).state("main.tools.automations.view.routes",{url:"/routes",templateUrl:"app/tools/automation/view/view.routes.html"}).state("main.tools.automations.view.application",{url:"/application",templateUrl:"app/tools/automation/view/view.application.html"})}]),angular.module("xCallyShuttleApp").controller("AutomationWizardCtrl",["$scope","$http","$location","xAlert","automations","WizardHandler","Automation",function(a,b,c,d,e,f,g){a.$automations=e,a.recordSwitch={onText:"On",offText:"Off",isActive:!0,size:"small",animate:!0,radioOff:!0,handleWidth:"auto",labelWidth:"auto",inverse:!0,offColor:"danger",onColor:"success"},a.tempData={voice:{},mail:{},chat:{},fax:{}},a.item={All:[],Any:[],Actions:[]},a.forms={general:void 0,settings:void 0},a.addCondition=function(b){a.item[b].push({field:"",operator:"",value:""})},a.removeCondition=function(b,c){a.item[b].splice(c,1)},a.addAction=function(){a.item.Actions.push({action:"",data1:"",data2:"",data3:"",data4:"",data5:""})},a.resetActionData=function(a){a.data1="",a.data2="",a.data3="",a.data4="",a.data5=""},a.removeAction=function(b){a.item.Actions.splice(b,1)},a.$watch("item.channel",function(b,c){c&&(a.tempData[c].All=_.clone(a.item.All,!0),a.tempData[c].Any=_.clone(a.item.Any,!0),a.tempData[c].Actions=_.clone(a.item.Actions,!0)),a.item.All=a.tempData[b].All?a.tempData[b].All:[],a.item.Any=a.tempData[b].Any?a.tempData[b].Any:[],a.item.Actions=a.tempData[b].Actions?a.tempData[b].Actions:[]},!0),a.item.channel="voice",a.createItem=function(){return g.save(a.item).$promise.then(function(){c.path("/tools/automations/list")})["catch"](function(a){console.error(a),d.show(a.message,"danger")})},a.next=function(){f.wizard().next()},a.previous=function(){f.wizard().previous()},a.exitValidation=function(a){return a},a.exitSettingsValidation=function(b){return b&&(a.item.All.length||a.item.Any.length)&&a.item.Actions.length?!0:!1}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.automations.wizard",{url:"/wizard",templateUrl:"app/tools/automation/wizard/wizard.html",controller:"AutomationWizardCtrl"})}]),angular.module("xCallyShuttleApp").factory("Interval",["$resource",function(a){return a("/api/intervals/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.intervals",{url:"/intervals",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("IntervalListCtrl",["$scope","$uibModal","Interval","gridOptions",function(a,b,c,d){a.initView=function(){var b={exporterCsvFilename:"intervals.csv",columnDefs:[{name:"name"},{name:"description"},{name:"action",width:160,buttons:[{"class":"blue-hoki",href:"/tools/intervals/view/{{row.entity.id}}/settings",name:"settings"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=d.gridOptions(c,b,a)},a.createItem=function(){var c=b.open({animation:!0,templateUrl:"app/tools/interval/list/list.create.modal.html",controller:"IntervalListCreateCtrl"});c.result.then(function(b){console.log(b),a.gridOptions.getPage()})}}]),angular.module("xCallyShuttleApp").controller("IntervalListCreateCtrl",["$scope","$translate","$uibModalInstance","Interval","xAlert",function(a,b,c,d,e){a.form={},a.item={},a.save=function(){return d.save(a.item).$promise.then(function(a){e.show(b.instant("MESSAGE_WELL_DONE"),"success"),c.close(a)})["catch"](function(a){e.show(b.instant(a.data.message),"danger")})},a.cancel=function(){c.dismiss()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.intervals.list",{url:"/list",templateUrl:"app/tools/interval/list/list.html",controller:"IntervalListCtrl"})}]),angular.module("xCallyShuttleApp").controller("IntervalViewCtrl",["$scope","$http","xAlert","$translate","$stateParams","socket","$location","WizardHandler","Modal","interval",function(a,b,c,d,e,f,g,h,i,j){function k(b){console.log(b);var c,d,e,f;c=b.t_from&&b.t_to&&!b.alwaysTime?moment(b.t_from).format("HH:mm")+"-"+moment(b.t_to).format("HH:mm"):"*",b.wd_from&&"always"!==b.wd_from?(d=b.wd_from,b.wd_to&&"always"!==b.wd_to&&(d+="-"+b.wd_to)):d="*",b.md_from&&"always"!==b.md_from?(e=b.md_from,b.md_to&&"always"!==b.md_to&&(e+="-"+b.md_to)):e="*",b.m_from&&"always"!==b.m_from?(f=b.m_from,b.m_to&&"always"!==b.m_to&&(f+="-"+b.m_to)):f="*",void 0!==a.selectedSubInterval?a.interval.SubIntervals[a.selectedSubInterval].interval=c+","+d+","+e+","+f:a.subinterval.interval=c+","+d+","+e+","+f}a.$translate=d,a.$interval=j.interval,a.selectedSubInterval=void 0,a.gridOptions={columnDefs:[{name:"name",displayName:"APPLICATION_NAME",headerCellFilter:"translate"},{name:"interval",displayName:"APPLICATION_INTERVAL",headerCellFilter:"translate"},{name:"action",displayName:"APPLICATION_ACTION",headerCellFilter:"translate",width:125,cellTemplate:'<a class="btn btn-xs blue-hoki" data-ng-click="grid.appScope.openSubInterval(grid.appScope.gridOptions.data.indexOf(row.entity))">{{\'APPLICATION_SETTINGS\' | translate}}</a><a class="btn btn-xs red-sunglo" data-ng-click="grid.appScope.deleteSubInterval(row.entity.name+\' interval\', gridOptions.data.indexOf(row.entity))">{{\'APPLICATION_DELETE\' | translate}}</a>'}]},a.forms={subinterval:void 0,general:void 0},a.initSubInterval=function(b){b&&(a.selectedSubInterval=void 0),a.subinterval={},a.splittedInterval={t_from:moment(new Date),t_to:moment(new Date),wd_from:"always",wd_to:"always",md_from:"always",md_to:"always",m_from:"always",m_to:"always",alwaysTime:!0}},a.next=function(){h.wizard().next()},a.previous=function(){h.wizard().previous()},a.exitValidation=function(a){return a},a.deselectAndRedirect=function(b){a.selectedSubInterval=void 0,g.path(b)},a.getInterval=function(){b.get("/api/intervals/"+e.id).success(function(b){a.interval=b,a.gridOptions.data=b.SubIntervals}).error(function(a){console.error(a),g.path("/tools/intervals/list")})},a.openSubInterval=function(b){a.selectedSubInterval=b,g.path("/tools/intervals/view/"+e.id+"/subintervals/settings")},a.updateInterval=function(f){a.selectedSubInterval=void 0,b.put("/api/intervals/"+e.id,a.interval).success(function(){c.show(d.instant("MESSAGE_WELL_DONE")+"!","success"),f&&g.path("/tools/intervals/view/"+e.id+"/"+f)}).error(function(a){c.show(d.instant(a.message),"danger")})},a.getSubInterval=function(){void 0===a.selectedSubInterval&&g.path("/tools/intervals/list"),a.splittedInterval={t_from:moment(new Date),t_to:moment(new Date)};var b,c=a.interval.SubIntervals[a.selectedSubInterval]?a.interval.SubIntervals[a.selectedSubInterval].interval.split(","):["*","*","*","*"];c.forEach(function(c,d){switch(d){case 0:"*"!==c?(b=c.split("-"),a.splittedInterval.t_from=moment(b[0],"HH:mm"),a.splittedInterval.t_to=moment(b[1],"HH:mm"),a.splittedInterval.alwaysTime=!1):(a.splittedInterval.t_from=moment(new Date),a.splittedInterval.t_to=moment(new Date),a.splittedInterval.alwaysTime=!0);break;case 1:"*"!==c?(b=c.split("-"),a.splittedInterval.wd_from=b[0],a.splittedInterval.wd_to=b[1]?b[1]:"always"):(a.splittedInterval.wd_from="always",a.splittedInterval.wd_to="always");break;case 2:"*"!==c?(b=c.split("-"),a.splittedInterval.md_from=b[0],a.splittedInterval.md_to=b[1]?b[1]:"always"):(a.splittedInterval.md_from="always",a.splittedInterval.md_to="always");break;case 3:"*"!==c?(b=c.split("-"),a.splittedInterval.m_from=b[0],a.splittedInterval.m_to=b[1]?b[1]:"always"):(a.splittedInterval.m_from="always",a.splittedInterval.m_to="always")}})},a.$watch("splittedInterval",function(a){a&&k(a)},!0),a.addSubInterval=function(){a.interval.SubIntervals.push(a.subinterval),a.updateInterval("subintervals")},a.deleteSubInterval=i.confirm["delete"](function(b){a.interval.SubIntervals.splice(b,1),a.updateInterval()})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.intervals.view",{url:"/view/:id",templateUrl:"app/tools/interval/view/view.html",controller:"IntervalViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.tools.intervals.view.settings",{url:"/settings",templateUrl:"app/tools/interval/view/view.settings.html"}).state("main.tools.intervals.view.subintervals",{url:"/subintervals",templateUrl:"app/tools/interval/view/view.subintervals.html"}).state("main.tools.intervals.view.subinterval",{url:"/subinterval",templateUrl:"app/tools/interval/view/view.subinterval.html"}).state("main.tools.intervals.view.subintervals.settings",{url:"/settings",templateUrl:"app/tools/interval/view/view.subintervalSettings.html"})}]),angular.module("xCallyShuttleApp").controller("PauseListCtrl",["$scope","$log","$uibModal","$translate","Pause","gridOptions",function(a,b,c,d,e,f){a.initView=function(){var b={exporterCsvFilename:"pauses.csv",columnDefs:[{name:"name"},{name:"description"},{name:"action",width:160,buttons:[{"class":"blue-hoki",href:"/tools/pauses/view/{{row.entity.id}}/settings",name:"settings"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=f.gridOptions(e,b,a)},a.createItem=function(){var b=c.open({animation:!0,templateUrl:"app/tools/pause/list/list.create.modal.html",controller:"PauseListCreateCtrl"});b.result.then(function(b){console.log(b),a.gridOptions.getPage()})}}]),angular.module("xCallyShuttleApp").controller("PauseListCreateCtrl",["$scope","$translate","$uibModalInstance","Pause","xAlert",function(a,b,c,d,e){a.form={},a.item={},a.save=function(){return d.save(a.item).$promise.then(function(a){e.show(b.instant("MESSAGE_WELL_DONE"),"success"),c.close(a)})["catch"](function(a){e.show(a.data.message,"danger")})},a.cancel=function(){c.dismiss()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.pauses.list",{url:"/list",templateUrl:"app/tools/pause/list/list.html",controller:"PauseListCtrl"})}]),angular.module("xCallyShuttleApp").factory("Pause",["$resource",function(a){return a("/api/pauses/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.pauses",{url:"/pauses",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("PauseViewCtrl",["$scope","$http","xAlert","$translate","$stateParams","$location","Pause",function(a,b,c,d,e,f,g){a.getPause=function(){return g.get({id:e.id}).$promise.then(function(b){a.pause=b})["catch"](function(a){c.show(a.data.message,"danger")})},a.updatePause=function(){var b=angular.copy(a.pause);return g.update({id:e.id},b).$promise.then(function(){c.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){c.show(a.data.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.pauses.view",{url:"/view/:id",templateUrl:"app/tools/pause/view/view.html",controller:"PauseViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.tools.pauses.view.settings",{url:"/settings",templateUrl:"app/tools/pause/view/view.settings.html"})}]),angular.module("xCallyShuttleApp").controller("SoundListCtrl",["$scope","$http","socket","Modal","$q","FileUploader","$translate","xAlert","$cookieStore","$sce","Sound",function(a,b,c,d,e,f,g,h,i,j,k){a.Sound=k,a.isCollapsed=!0,a.downloadButtonContent='<i class="icon-cloud-download"></i>',a.downloadButtonClass="btn btn-xs blue-hoki",a["delete"]=d.confirm["delete"](function(a){b["delete"]("/api/sounds/"+a).success(function(a){}).error(function(a){console.log(a)})}),a.updateAudio=function(a,c){var d=e.defer();return b.put("/api/sounds/"+a,c).success(function(a){d.resolve()}).error(function(a){console.log(a.message),d.reject(a.message)}),d.promise},a.$on("$destroy",function(){c.unsyncUpdates("sound")}),a.initList=function(){b.get("/api/sounds").success(function(b){a.sounds=b.rows,b.rows.length||(a.isCollapsed=!1),c.syncUpdates("sound",a.sounds,function(){a.sounds.length||(a.isCollapsed=!1)})}).error(function(a){})};var l=a.uploader=new f({url:"/api/sounds",withCredentials:!0,headers:{Authorization:"Bearer "+i.get("token")}});l.filters.push({name:"customFilter",fn:function(a,b){return this.queue.length<10}}),l.onWhenAddingFileFailed=function(a,b,c){console.info("onWhenAddingFileFailed",a,b,c)},l.onAfterAddingFile=function(a){console.info("onAfterAddingFile",a)},l.onAfterAddingAll=function(a){console.info("onAfterAddingAll",a)},l.onBeforeUploadItem=function(a){console.info("onBeforeUploadItem",a)},l.onProgressItem=function(a,b){console.info("onProgressItem",a,b),a.isUploading=!0},l.onProgressAll=function(a){console.info("onProgressAll",a)},l.onSuccessItem=function(a,b,c,d){console.info("onSuccessItem",a,b,c,d),a.isUploading=!1},l.onErrorItem=function(a,b,c,d){console.info("onErrorItem",a,b,c,d),a.responseMessage=b,a.isUploading=!1},l.onCancelItem=function(a,b,c,d){console.info("onCancelItem",a,b,c,d),a.isUploading=!1},l.onCompleteItem=function(a,b,c,d){console.info("onCompleteItem",a,b,c,d),a.isUploading=!1},l.onCompleteAll=function(){console.info("onCompleteAll")},console.info("uploader",l)}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.sounds.list",{url:"/list",templateUrl:"app/tools/sound/list/list.html",controller:"SoundListCtrl",authenticate:!0,resolve:{deps:["$ocLazyLoad",function(a){return a.load({insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/plugins/bootstrap-fileinput/bootstrap-fileinput.js"]})}]}})}]),angular.module("xCallyShuttleApp").factory("Sound",["$resource",function(a){return a("/api/sounds/:id/:controller",{name:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.sounds",{url:"/sounds",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("TagListCtrl",["$scope","$uibModal","Tag","gridOptions",function(a,b,c,d){a.initView=function(){var b={exporterCsvFilename:"tag.csv",columnDefs:[{name:"name"},{name:"description"},{name:"action",width:160,buttons:[{"class":"blue-hoki",href:"/tools/tags/view/{{row.entity.id}}/settings",name:"settings"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=d.gridOptions(c,b,a)},a.createItem=function(){var c=b.open({animation:!0,templateUrl:"app/tools/tag/list/list.create.modal.html",controller:"TagListCreateCtrl"});c.result.then(function(b){console.log(b),a.gridOptions.getPage()})}}]),angular.module("xCallyShuttleApp").controller("TagListCreateCtrl",["$scope","$translate","$uibModalInstance","Tag","xAlert",function(a,b,c,d,e){a.form={},a.item={},a.save=function(){return d.save(a.item).$promise.then(function(a){e.show(b.instant("MESSAGE_WELL_DONE"),"success"),c.close(a)})["catch"](function(a){e.show(a.data.message,"danger")})},a.cancel=function(){c.dismiss()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.tags.list",{url:"/list",templateUrl:"app/tools/tag/list/list.html",controller:"TagListCtrl"})}]),angular.module("xCallyShuttleApp").factory("Tag",["$resource",function(a){return a("/api/tags/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.tags",{url:"/tags",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("TagViewCtrl",["$scope","$http","xAlert","$translate","$stateParams","$location","Tag",function(a,b,c,d,e,f,g){a.getTag=function(){return g.get({id:e.id}).$promise.then(function(b){a.tag=b})["catch"](function(a){c.show(a.data.message,"danger")})},a.updateTag=function(){var b=angular.copy(a.tag);return g.update({id:e.id},b).$promise.then(function(){c.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){c.show(a.data.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.tags.view",{url:"/view/:id",templateUrl:"app/tools/tag/view/view.html",controller:"TagViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.tools.tags.view.settings",{url:"/settings",templateUrl:"app/tools/tag/view/view.settings.html"})}]),angular.module("xCallyShuttleApp").controller("TemplateListCtrl",["$scope","Template","gridOptions",function(a,b,c){a.initView=function(){var d={exporterCsvFilename:"templates.csv",columnDefs:[{name:"name"},{name:"description"},{name:"action",width:125,buttons:[{"class":"blue-hoki",href:"/tools/templates/view/{{row.entity.id}}/settings",name:"profile"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=c.gridOptions(b,d,a)}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.templates.list",{url:"/list",templateUrl:"app/tools/template/list/list.html",controller:"TemplateListCtrl"})}]),angular.module("xCallyShuttleApp").factory("Template",["$resource",function(a){return a("/api/mail/templates/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.templates",{url:"/templates",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("TemplateViewCtrl",["$scope","$http","$translate","$stateParams","xAlert","Template",function(a,b,c,d,e,f){a.initItem=function(){a.form={},a.item={},a.groups=[{title:"Voice",variables:[]},{title:"Chat",variables:["username","email","text","chatWebsite"]},{title:"Mail",variables:[]},{title:"Fax",variables:[]}],a.item=f.get({id:d.id})},a.updateItem=function(){f.update(a.item).$promise.then(function(){e.show(c.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){e.show(a.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.templates.view",{url:"/view/:id",templateUrl:"app/tools/template/view/view.html",controller:"TemplateViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.tools.templates.view.settings",{url:"/settings",templateUrl:"app/tools/template/view/view.settings.html"})}]),angular.module("xCallyShuttleApp").controller("TemplateWizardCtrl",["$scope","$location","$http","WizardHandler","xAlert","Template",function(a,b,c,d,e,f){a.initWizard=function(){a.item={},a.form={},a.groups=[{title:"Voice",variables:[]},{title:"Chat",variables:["username","email","text","chatWebsite"]},{title:"Mail",variables:[]},{title:"Fax",variables:[]}]},a.next=function(){d.wizard().next()},a.exitValidation=function(a){return a},a.createItem=function(){return f.save({name:a.item.name,description:a.item.description,subject:a.item.subject||null,html:a.item.html||null,text:a.item.text||null}).$promise.then(function(){b.path("/tools/templates/list")})["catch"](function(a){e.show(data.err.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.templates.wizard",{url:"/wizard",templateUrl:"app/tools/template/wizard/wizard.html",controller:"TemplateWizardCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools",{url:"/tools",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").controller("TriggerListCtrl",["$scope","$http","$translate","Modal","xAlert","Trigger","gridOptions",function(a,b,c,d,e,f,g){a.onText="On",a.offText="Off",a.isActive=!0,a.size="mini",a.animate=!0,a.radioOff=!0,a.handleWidth="auto",a.labelWidth="auto",a.inverse=!0,a.offColor="danger",a.onColor="success",a.initView=function(){var b={exporterCsvFilename:"Triggers.csv",columnDefs:[{name:"name"},{name:"description"},{name:"channel"},{name:"status",cellTemplate:'<div class="centered-uigrid-td"><input data-ng-change="grid.appScope.updateItem(row.entity)", bs-switch ng-model="row.entity.status" type="checkbox" switch-active="{{ grid.appScope.isActive }}" switch-on-text="{{ grid.appScope.onText }}" switch-off-text="{{ grid.appScope.offText }}" switch-on-color="{{ grid.appScope.onColor }}" switch-off-color="{{ grid.appScope.offColor }}" switch-animate="{{ grid.appScope.animate }}" switch-size="{{ grid.appScope.size }}" switch-label="{{ grid.appScope.label }}" switch-icon="{{ grid.appScope.icon }}" switch-radio-off="{{ grid.appScope.radioOff }}" switch-label-width="{{ grid.appScope.labelWidth }}" switch-handle-width="{{ grid.appScope.handleWidth }}"></div>',width:100,enableFiltering:!1},{name:"action",width:160,buttons:[{"class":"blue-hoki",href:"/tools/triggers/view/{{row.entity.id}}/settings",name:"settings"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=g.gridOptions(f,b,a)},a.updateItem=function(a){return f.update({id:a.id},a).$promise.then(function(){e.show(c.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){console.error(a),e.show(a.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.triggers.list",{url:"/list",templateUrl:"app/tools/trigger/list/list.html",controller:"TriggerListCtrl"})}]),angular.module("xCallyShuttleApp").factory("Trigger",["$resource",function(a){return a("/api/triggers/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.triggers",{url:"/triggers",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("TriggerViewCtrl",["$scope","$stateParams","$translate","xAlert","triggers","Trigger","$location",function(a,b,c,d,e,f,g){a.$triggers=e,a.recordSwitch={onText:"On",offText:"Off",isActive:!0,size:"small",animate:!0,radioOff:!0,handleWidth:"auto",labelWidth:"auto",inverse:!0,offColor:"danger",onColor:"success"},a.forms={general:{}},a.addCondition=function(b){a.trigger[b].push({field:"",operator:"",value:""})},a.removeCondition=function(b,c){a.trigger[b].splice(c,1)},a.addAction=function(){a.trigger.Actions.push({action:"",data1:"",data2:"",data3:"",data4:"",data5:""})},a.resetActionData=function(a){a.data1="",a.data2="",a.data3="",a.data4="",a.data5=""},a.removeAction=function(b){a.trigger.Actions.splice(b,1)},a.initView=function(){return f.get({id:b.id}).$promise.then(function(b){a.trigger=b})["catch"](function(a){d.show(a.message,"danger"),g.path("/tools/triggers/list")})},a.updateTrigger=function(){return f.update({id:b.id},a.trigger).$promise.then(function(){d.show(c.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){console.error(a),d.show(a.message,"danger")})},a.exitValidation=function(b){return console.log(b&&(a.trigger.All.length||a.trigger.Any.length)&&a.trigger.Actions.length),b&&(a.trigger.All.length||a.trigger.Any.length)&&a.trigger.Actions.length?!0:!1}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.triggers.view",{url:"/view/:id",templateUrl:"app/tools/trigger/view/view.html",controller:"TriggerViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load({insertBefore:"#ng_load_plugins_before",files:["assets/css/profile.css","assets/css/tasks.css"]})}]}}).state("main.tools.triggers.view.settings",{url:"/settings",templateUrl:"app/tools/trigger/view/view.settings.html"}).state("main.tools.triggers.view.routes",{url:"/routes",templateUrl:"app/tools/trigger/view/view.routes.html"}).state("main.tools.triggers.view.application",{url:"/application",templateUrl:"app/tools/trigger/view/view.application.html"})}]),angular.module("xCallyShuttleApp").controller("TriggerWizardCtrl",["$scope","$http","$location","xAlert","triggers","WizardHandler","Trigger",function(a,b,c,d,e,f,g){a.$triggers=e,a.tempData={voice:{},mail:{},chat:{},fax:{}},a.item={All:[],Any:[],Actions:[]},a.forms={general:void 0,settings:void 0},a.addCondition=function(b){a.item[b].push({field:"",operator:"",value:""})},a.removeCondition=function(b,c){a.item[b].splice(c,1)},a.addAction=function(){a.item.Actions.push({action:"",data1:"",data2:"",data3:"",data4:"",data5:""})},a.resetActionData=function(a){a.data1="",a.data2="",a.data3="",a.data4="",a.data5=""},a.removeAction=function(b){a.item.Actions.splice(b,1)},a.$watch("item.channel",function(b,c){c&&(a.tempData[c].All=_.clone(a.item.All,!0),a.tempData[c].Any=_.clone(a.item.Any,!0),a.tempData[c].Actions=_.clone(a.item.Actions,!0)),a.item.All=a.tempData[b].All?a.tempData[b].All:[],a.item.Any=a.tempData[b].Any?a.tempData[b].Any:[],a.item.Actions=a.tempData[b].Actions?a.tempData[b].Actions:[]},!0),a.item.channel="voice",a.createItem=function(){return g.save(a.item).$promise.then(function(){c.path("/tools/triggers/list")})["catch"](function(a){console.error(a),d.show(a.message,"danger")})},a.next=function(){f.wizard().next()},a.previous=function(){f.wizard().previous()},a.exitValidation=function(a){return a},a.exitSettingsValidation=function(b){return b&&(a.item.All.length||a.item.Any.length)&&a.item.Actions.length?!0:!1}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.triggers.wizard",{url:"/wizard",templateUrl:"app/tools/trigger/wizard/wizard.html",controller:"TriggerWizardCtrl"})}]),angular.module("xCallyShuttleApp").controller("TrunkListCtrl",["$scope","Trunk","gridOptions",function(a,b,c){a.initView=function(){var d={exporterCsvFilename:"Trunks.csv",columnDefs:[{name:"name"},{name:"host"},{name:"context"},{name:"description"},{name:"action",width:160,buttons:[{"class":"blue-hoki",href:"/tools/trunks/view/{{row.entity.name}}/settings",name:"settings"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.name)"}]}]};a.gridOptions=c.gridOptions(b,d,a)}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.trunks.list",{url:"/list",templateUrl:"app/tools/trunk/list/list.html",controller:"TrunkListCtrl"})}]),angular.module("xCallyShuttleApp").factory("Trunk",["$resource",function(a){return a("/api/trunks/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.trunks",{url:"/trunks",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("TrunkViewCtrl",["$scope","$http","xAlert","$translate","$stateParams","socket","$location","Trunk","VoiceContext",function(a,b,c,d,e,f,g,h,i){a.initView=function(){return h.get({
+id:e.id}).$promise.then(function(b){b.nat=b.nat?b.nat.split(","):[],b.allow=b.allow?b.allow.split(";"):[],b.insecure=b.insecure?b.insecure.split(","):[],b.transport=b.transport?b.transport.split(","):[],a.trunk=b})["catch"](function(a){console.error(a),g.path("/tools/trunks/list")})},a.updateTrunk=function(){""===a.trunk.password&&delete a.trunk.password;var b=angular.copy(a.trunk);return b.nat=b.nat.join(","),b.allow=b.allow.join(";"),b.insecure=b.insecure.join(","),b.transport=b.transport.join(","),h.update({id:e.id},b).$promise.then(function(){c.show(d.instant("MESSAGE_WELL_DONE")+"!","success")})["catch"](function(a){c.show(a.data.message,"danger")})},a.getContexts=function(){return i.get().$promise.then(function(b){a.voiceContexts=b.rows})["catch"](function(a){c.show(a.data.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.trunks.view",{url:"/view/:id",templateUrl:"app/tools/trunk/view/view.html",controller:"TrunkViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.tools.trunks.view.settings",{url:"/settings",templateUrl:"app/tools/trunk/view/view.settings.html"})}]),angular.module("xCallyShuttleApp").controller("TrunkWizardCtrl",["$scope","$http","WizardHandler","$location","xAlert","socket","$translate",function(a,b,c,d,e,f,g){a.initWizard=function(){a.forms={},a.item={context:"from-voip-provider"}},a.next=function(d){d?b.post("/api/trunks/validate/",a.item).success(function(a){console.log(a),a.length?e.show(g.instant("MESSAGE_EXIST_TRUNK"),"danger"):c.wizard().next()}).error(function(a){e.show(g.instant(a.message),"danger")}):c.wizard().next()},a.previous=function(){c.wizard().previous()},a.exitValidation=function(a){return a},a.createItem=function(){b.post("/api/trunks/",a.item).success(function(){d.path("/tools/trunks/list")}).error(function(a){e.show(a.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.trunks.wizard",{url:"/wizard",templateUrl:"app/tools/trunk/wizard/wizard.html",controller:"TrunkWizardCtrl"})}]),angular.module("xCallyShuttleApp").controller("VariableListCtrl",["$scope","$uibModal","Variable","gridOptions",function(a,b,c,d){a.initView=function(){var b={exporterCsvFilename:"variables.csv",columnDefs:[{name:"name"},{name:"description"},{name:"action",width:160,buttons:[{"class":"blue-hoki",href:"/tools/variables/view/{{row.entity.id}}/settings",name:"settings"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=d.gridOptions(c,b,a)},a.createItem=function(){var c=b.open({animation:!0,templateUrl:"app/tools/variable/list/list.create.modal.html",controller:"VariableListCreateCtrl"});c.result.then(function(b){console.log(b),a.gridOptions.getPage()})}}]),angular.module("xCallyShuttleApp").controller("VariableListCreateCtrl",["$scope","$translate","$uibModalInstance","Variable","xAlert",function(a,b,c,d,e){a.form={},a.item={},a.save=function(){return d.save(a.item).$promise.then(function(a){e.show(b.instant("MESSAGE_WELL_DONE"),"success"),c.close(a)})["catch"](function(a){e.show(a.data.message,"danger")})},a.cancel=function(){c.dismiss()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.variables.list",{url:"/list",templateUrl:"app/tools/variable/list/list.html",controller:"VariableListCtrl"})}]),angular.module("xCallyShuttleApp").factory("Variable",["$resource",function(a){return a("/api/variables/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.variables",{url:"/variables",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("VariableViewCtrl",["$scope","$translate","$stateParams","xAlert","Variable",function(a,b,c,d,e){a.getVariable=function(){return e.get({id:c.id}).$promise.then(function(b){a.variable=b})["catch"](function(a){d.show(a.data.message,"danger")})},a.updateVariable=function(){return e.update({id:c.id},a.variable).$promise.then(function(){d.show(b.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){d.show(a.data.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.variables.view",{url:"/view/:id",templateUrl:"app/tools/variable/view/view.html",controller:"VariableViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.tools.variables.view.settings",{url:"/settings",templateUrl:"app/tools/variable/view/view.settings.html"})}]),angular.module("xCallyShuttleApp").controller("YourdashboardListCloneModalCtrl",["$scope","$uibModalInstance",function(a,b){a.forms={dashboard:void 0},a.item={},a.ok=function(){b.close(a.item)},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("YourdashboardListCreateModalCtrl",["$scope","$uibModalInstance",function(a,b){a.forms={dashboard:void 0},a.item={},a.ok=function(){a.item.model=JSON.stringify({title:a.item.name}),b.close(a.item)},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("YourdashboardListCtrl",["$scope","$http","$translate","xAlert","Modal","$uibModal","$log","YourDashboard","gridOptions",function(a,b,c,d,e,f,g,h,i){a.initView=function(){var b={exporterCsvFilename:"voice_contexts.csv",columnDefs:[{name:"name"},{name:"description"},{name:"action",width:220,buttons:[{"class":"green",href:"/tools/yourdashboards/show/{{row.entity.id}}",name:"view"},{"class":"blue-hoki",href:"/tools/yourdashboards/view/{{row.entity.id}}/settings",name:"settings"},{"class":"{{row.entity.defaultEntry ? 'red-sunglo disabled' : 'red-sunglo'}}",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"},{"class":"purple",name:"clone",onClick:"grid.appScope.clone(row.entity.id)"}]}]};a.gridOptions=i.gridOptions(h,b,a)},a.create=function(){var b=f.open({animation:!0,templateUrl:"app/tools/yourdashboard/list/create.modal.html",controller:"YourdashboardListCreateModalCtrl"});b.result.then(function(b){return h.save(b).$promise.then(function(){d.show(c.instant("MESSAGE_WELL_DONE"),"success"),a.gridOptions.getPage()})["catch"](function(a){console.error(a),d.show(a.message,"danger")})},function(){g.info("Modal dismissed at: "+new Date)})},a.clone=function(b){var e=f.open({animation:!0,templateUrl:"app/tools/yourdashboard/list/clone.modal.html",controller:"YourdashboardListCloneModalCtrl"});e.result.then(function(e){return h.save({id:b,controller:"clone"},e).$promise.then(function(){d.show(c.instant("MESSAGE_WELL_DONE"),"success"),a.gridOptions.getPage()})["catch"](function(a){console.error(a),d.show(a.message,"danger")})},function(){g.info("Modal dismissed at: "+new Date)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.yourdashboards.list",{url:"/list",templateUrl:"app/tools/yourdashboard/list/list.html",controller:"YourdashboardListCtrl"})}]),angular.module("xCallyShuttleApp").controller("YourdashboardShowCtrl",["$scope","localStorageService","$http","xAlert","$translate","Auth","$stateParams","$location",function(a,b,c,d,e,f,g,h){a.Auth=f,a.getDashboard=function(){c.get("/api/dashboards/"+g.id).success(function(b){var c={name:"dashboard",structure:"4-8",enableconfirmdelete:!0,maximizable:!0,collapsible:!0};b.model=JSON.parse(b.model||'{"title":"Dashboard"}'),b.editable=f.isAdmin()&&b.editable?!0:!1,a.dashboard=_.merge(c,b)}).error(function(a){h.path("/tools/yourdashboards/list")})};var i=function(b,f,h){var i=angular.copy(a.dashboard);i.name=a.dashboard.model.title,i.model=JSON.stringify(i.model),c.put("/api/dashboards/"+g.id,i).success(function(){d.show(e.instant("MESSAGE_DASHBOARD_SAVED")+"!","success")}).error(function(b){d.show(b.message,"danger"),i.model=JSON.parse(i.model),i.name="dashboard",a.dashboard=i})};a.$on("adfDashboardChanged",i),a.$on("destroy",function(){console.log("main dashboard")})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.yourdashboards.show",{url:"/show/:id",templateUrl:"app/tools/yourdashboard/show/show.html",controller:"YourdashboardShowCtrl"})}]),angular.module("xCallyShuttleApp").controller("YourdashboardViewCtrl",["$scope","$http","xAlert","$translate","$stateParams","$location",function(a,b,c,d,e,f){a.radioSwitch={isActive:!0,size:"small",animate:!0,radioOff:!0,handleWidth:"auto",labelWidth:"auto",inverse:!0,offColor:"danger",onColor:"success"},a.getDashboard=function(){b.get("/api/dashboards/"+e.id).success(function(b){delete b.model,a.dashboard=b}).error(function(a){f.path("/tools/yourdashboards/list")})},a.updateDashboard=function(){var f=angular.copy(a.dashboard);b.put("/api/dashboards/"+e.id,f).success(function(){c.show(d.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(b){c.show(d.instant(b.message),"danger"),a.dashboard=f})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.yourdashboards.view",{url:"/view/:id",templateUrl:"app/tools/yourdashboard/view/view.html",controller:"YourdashboardViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.tools.yourdashboards.view.settings",{url:"/settings",templateUrl:"app/tools/yourdashboard/view/view.settings.html"})}]),angular.module("xCallyShuttleApp").factory("YourDashboard",["$resource",function(a){return a("/api/dashboards/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.yourdashboards",{url:"/yourdashboards",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("ZendeskListCtrl",["$scope","ZendeskAccount","gridOptions","xAlert","$translate",function(a,b,c,d,e){a.initView=function(){var d={exporterCsvFilename:"zendesk_account.csv",columnDefs:[{name:"name",displayName:"APPLICATION_NAME"},{name:"username"},{name:"remoteUri",displayName:"APPLICATION_REMOTE_ADDRESS"},{name:"action",width:250,buttons:[{"class":"blue-hoki",href:"/zendesk/view/{{row.entity.id}}/account",name:"profile"},{"class":"green-jungle",name:"check",displayName:"APPLICATION_CHECK_CONNECTION",onClick:"grid.appScope.checkAccount(row.entity.id)"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=c.gridOptions(b,d,a)},a.checkAccount=function(a){return b.check({id:a}).$promise.then(function(){d.show(e.instant("MESSAGE_ACCOUNT_VERIFIED"),"success")})["catch"](function(){d.show(e.instant("MESSAGE_ACCOUNT_INVALID"),"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.zendesk.list",{url:"/list",templateUrl:"app/zendesk/list/list.html",controller:"ZendeskListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.zendesk.view.configurations",{url:"/configurations",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("ZendeskViewConfigurationListCtrl",["$scope","$stateParams","$translate","gridOptions","ZendeskConfiguration","$uibModal","xAlert",function(a,b,c,d,e,f,g){a.initView=function(){var c={exporterCsvFilename:"zendesk_configurations.csv",columnDefs:[{name:"name"},{name:"description"},{name:"action",width:125,buttons:[{"class":"blue-hoki",href:"/zendesk/view/{{row.entity.AccountId}}/configurations/view/{{row.entity.id}}",name:"profile"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=d.gridOptions(e,c,a,{accountId:b.id})},a.createItem=function(){var c=f.open({animation:!0,templateUrl:"app/zendesk/view/configuration/list/create.modal.html",controller:["$scope","$uibModalInstance",function(a,b){a.form={},a.item={},a.ok=function(){b.close(a.item)},a.cancel=function(){b.dismiss("cancel")}}]});c.result.then(function(c){return e.save({accountId:b.id},c).$promise.then(function(){a.gridOptions.getPage()})["catch"](function(a){g.show(a.data.message,"danger")})})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.zendesk.view.configurations.list",{url:"/list",templateUrl:"app/zendesk/view/configuration/list/list.html",controller:"ZendeskViewConfigurationListCtrl"})}]),angular.module("xCallyShuttleApp").controller("ZendeskViewConfigurationViewCtrl",["$scope","$stateParams","$filter","$translate","socket","ZendeskConfiguration","xAlert","variable","Variable","ZendeskAccount","Tag","ZendeskField",function(a,b,c,d,e,f,g,h,i,j,k,l){a.$on("$destroy",function(){e.unsyncUpdates("zendesk_field")}),a.config={autoHideScrollbar:!1,theme:"dark",advanced:{updateOnContentResize:!0},setHeight:300,scrollInertia:0},a.fieldType=[{type:"string",title:"String"},{type:"variable",title:"Variable"},{type:"customVariable",title:"Custom Variable"}],a.descFieldType=[{type:"string",title:"String"},{type:"keyValue",title:"Key Value"}],a.initView=function(){a.configurationName="",a.subjectConfig=[],a.descriptionConfig=[],a.fieldConfig=[],a.selectedTags={tags:[]},a.variables=h},a.getConfiguration=function(){return f.get({accountId:b.id,id:b.configurationId}).$promise.then(function(b){a.configurationName=b.name,a.subjectConfig=b.Subject,a.descriptionConfig=b.Description,a.fieldConfig=b.Field,a.selectedTags={tags:_.map(b.Tags,function(a){return a.id})},e.socket.on("zendesk_field:remove",function(b){_.remove(a.subjectConfig,{id:b.id}),_.remove(a.descriptionConfig,{id:b.id}),_.remove(a.fieldConfig,{id:b.id})})})["catch"](function(a){g.show(a.message,"danger")})},a.getCustomVariables=function(){return i.get().$promise.then(function(b){a.customVariables=b.rows})["catch"](function(a){g.show(a.message,"danger")})},a.getFields=function(){return j.fields({id:b.id}).$promise.then(function(b){a.accountFields=c("zendesk")(b)})["catch"](function(a){g.show(a.message,"danger")})},a.getTags=function(){return k.get().$promise.then(function(b){a.tags=b.rows})["catch"](function(a){g.show(a.message,"danger")})},a.addItem=function(c){switch(c){case"subject":case"description":var d={type:"string",content:""};break;case"field":var d={content:""}}return f.save({accountId:b.id,id:b.configurationId,controller:c},d).$promise.then(function(b){switch(c){case"subject":a.subjectConfig.push(b);break;case"description":a.descriptionConfig.push(b);break;case"field":a.fieldConfig.push(b)}})["catch"](function(a){g.show(a.data.message,"danger")})},a.changeType=function(b){"variable"===b.type?(b.content="",b.variableName=""):"string"===b.type?(b.VariableId=null,b.variableName=""):"customVariable"===b.type&&(b.VariableId=null,b.content=""),a.updateField(b)},a.updateField=function(a){return l.update({accountId:b.id,configurationId:b.configurationId,id:a.id},a).$promise.then(function(){})["catch"](function(){g.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG")+".","danger")})},a.removeItem=function(a){return l["delete"]({accountId:b.id,configurationId:b.configurationId,id:a.id}).$promise.then(function(){g.show(d.instant("MESSAGE_WELL_DONE")+"!","success")})["catch"](function(){g.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})},a.changeDescType=function(b){"keyValue"===b.type?(b.content="","string"===b.keyType?(b.VariableId=null,b.variableName=""):"variable"===b.keyType?(b.keyContent="",b.VariableId=null):"customVariable"===b.keyType&&(b.keyContent="",b.variableName="")):"string"===b.type&&(b.VariableId=null,b.variableName="",b.key="",b.keyContent=""),a.updateField(b)},a.changeFieldType=function(b){if(b.content="",b.variableName="",b.nameField="",b.VariableId=null,b.idField){var c=_.find(a.accountFields,"id",b.idField);c&&(c.system_field_options?(b.customField=!1,b.nameField=c.title.toLowerCase()):b.customField=!0)}a.updateField(b)},a.updateTags=function(){return f.update({accountId:b.id,id:b.configurationId,controller:"tags"},a.selectedTags.tags).$promise.then(function(){g.show(d.instant("MESSAGE_WELL_DONE")+".","success")})["catch"](function(a){g.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG")+".","danger")})},a.getSystemFieldOptions=function(b){if(b){var c=_.find(a.accountFields,"id",b);return c?c.system_field_options?c.system_field_options:null:void 0}}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.zendesk.view.configurations.view",{url:"/view/:configurationId",templateUrl:"app/zendesk/view/configuration/view/view.html",controller:"ZendeskViewConfigurationViewCtrl"})}]),angular.module("xCallyShuttleApp").controller("ZendeskViewCtrl",["$scope","$stateParams","$translate","xAlert","Modal","ZendeskAccount",function(a,b,c,d,e,f){a.initView=function(){return f.get({id:b.id}).$promise.then(function(b){a.account=b})["catch"](function(a){d.show(a.message,"danger")})},a.updateItem=function(){return f.update({id:b.id},a.account).$promise.then(function(){d.show(c.instant("MESSAGE_WELL_DONE")+".","success")})["catch"](function(){d.show(c.instant("MESSAGE_SOMETHING_WENT_WRONG")+".","danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.zendesk.view",{url:"/view/:id",templateUrl:"app/zendesk/view/view.html",controller:"ZendeskViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.zendesk.view.account",{url:"/account",templateUrl:"app/zendesk/view/view.account.html"})}]),angular.module("xCallyShuttleApp").controller("ZendeskWizardCtrl",["$scope","$http","$location","$translate","xAlert","WizardHandler","ZendeskAccount",function(a,b,c,d,e,f,g){a.translate=d,a.initWizard=function(){a.$translate=d,a.forms={},a.item={},a.item.authType="password"},a.next=function(){f.wizard().next()},a.exitValidation=function(a){return a},a.createItem=function(){return g.save(a.item).$promise.then(function(){e.show(d.instant("MESSAGE_WELL_DONE")+".","success"),c.path("/zendesk/list")})["catch"](function(){e.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG")+".","danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.zendesk.wizard",{url:"/wizard",templateUrl:"app/zendesk/wizard/wizard.html",controller:"ZendeskWizardCtrl"})}]),angular.module("xCallyShuttleApp").factory("ZendeskAccount",["$resource",function(a){return a("/api/zendesk/accounts/:id/:controller",{id:"@id"},{update:{method:"PUT"},fields:{params:{controller:"fields"},isArray:!0},check:{params:{controller:"check"}}})}]).factory("ZendeskConfiguration",["$resource",function(a){return a("/api/zendesk/accounts/:accountId/configurations/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]).factory("ZendeskField",["$resource",function(a){return a("/api/zendesk/accounts/:accountId/configurations/:configurationId/fields/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.zendesk",{url:"/zendesk",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").service("application",function(){var a={applications:[{name:"Queue",value:"Queue"},{name:"Playback",value:"Playback"},{name:"Dial",value:"Dial"},{name:"Cally-Square IVR",value:"AGI"},{name:"GoTo",value:"Goto"},{name:"Hangup",value:"Hangup"},{name:"Set",value:"Set"},{name:"Custom",value:"custom"},{name:"VoiceMail",value:"Voicemail"}],queueOptions:[{value:"C",name:"APPLICATION_QUEUE_OPTION_C"},{value:"c",name:"APPLICATION_QUEUE_OPTION_c"},{value:"d",name:"APPLICATION_QUEUE_OPTION_d"},{value:"F",name:"APPLICATION_QUEUE_OPTION_F"},{value:"h",name:"APPLICATION_QUEUE_OPTION_h"},{value:"H",name:"APPLICATION_QUEUE_OPTION_H"},{value:"n",name:"APPLICATION_QUEUE_OPTION_n"},{value:"i",name:"APPLICATION_QUEUE_OPTION_i"},{value:"I",name:"APPLICATION_QUEUE_OPTION_I"},{value:"r",name:"APPLICATION_QUEUE_OPTION_r"},{value:"R",name:"APPLICATION_QUEUE_OPTION_R"},{value:"t",name:"APPLICATION_QUEUE_OPTION_t"},{value:"T",name:"APPLICATION_QUEUE_OPTION_T"},{value:"w",name:"APPLICATION_QUEUE_OPTION_w"},{value:"W",name:"APPLICATION_QUEUE_OPTION_W"},{value:"k",name:"APPLICATION_QUEUE_OPTION_k"},{value:"K",name:"APPLICATION_QUEUE_OPTION_K"},{value:"x",name:"APPLICATION_QUEUE_OPTION_x"},{value:"X",name:"APPLICATION_QUEUE_OPTION_X"}],audioOptions:[{value:"skip",name:"APPLICATION_PLAYBACK_OPTION_SKIP"},{value:"noanswer",name:"APPLICATION_PLAYBACK_OPTION_NOANSWER"},{value:"j",name:"APPLICATION_PLAYBACK_OPTION_J"},{value:"say",name:"APPLICATION_PLAYBACK_OPTION_SAY"}],hangupCauses:[{value:"",name:"--"},{value:"1",name:"APPLICATION_HANGUP_CAUSE_1"},{value:"16",name:"APPLICATION_HANGUP_CAUSE_16"},{value:"17",name:"APPLICATION_HANGUP_CAUSE_17"},{value:"18",name:"APPLICATION_HANGUP_CAUSE_18"},{value:"21",name:"APPLICATION_HANGUP_CAUSE_21"},{value:"22",name:"APPLICATION_HANGUP_CAUSE_22"},{value:"27",name:"APPLICATION_HANGUP_CAUSE_27"},{value:"38",name:"APPLICATION_HANGUP_CAUSE_38"},{value:"41",name:"APPLICATION_HANGUP_CAUSE_41"}],intTypes:[{value:"always",name:"APPLICATION_ALWAYS"},{value:"custom",name:"APPLICATION_CUSTOM"},{value:"list",name:"APPLICATION_FROM_LIST"}],checkUnderscore:function(a){return 0===a.indexOf("_")?a:"_"+a}};return{application:a}}),angular.module("xCallyShuttleApp").factory("Auth",["$location","$rootScope","$http","User","$cookieStore","$q",function(a,b,c,d,e,f){var g={};return e.get("token")&&(g=d.me()),{login:function(a,h){var i=h||angular.noop,j=f.defer();return c.post("/auth/local",{name:a.name,password:a.password,remember:a.remember}).success(function(a){return e.put("role",a.role),e.put("token",a.token),e.put("userId",a.userId),g=d.me({},function(){b.$broadcast("login")}),j.resolve(a),i()}).error(function(a){return this.logout(),j.reject(a),i(a)}.bind(this)),j.promise},loginWithToken:function(a,b,c){e.put("token",a),e.put("userId",b),e.put("name",c),g=d.me()},logout:function(){c.put("/api/users/"+g.id,{online:!1}).success(function(){e.remove("role"),e.remove("token"),e.remove("userId"),g={},b.$broadcast("logout")}).error(function(a){return a})},createUser:function(a,b){var c=b||angular.noop;return d.save(a,function(b){return e.put("token",b.token),g=d.me(),c(a)},function(a){return this.logout(),c(a)}.bind(this)).$promise},changePassword:function(a,b,c){var e=c||angular.noop;return d.changePassword({id:g.id},{oldPassword:a,newPassword:b},function(a){return e(null,a)},function(a){return e(a)}).$promise},getCurrentUser:function(){return g},isLoggedIn:function(){return g.hasOwnProperty("role")},isLoggedInAsync:function(a){g.hasOwnProperty("$promise")?g.$promise.then(function(){a(!0)})["catch"](function(){a(!1)}):a(g.hasOwnProperty("role")?!0:!1)},isAdmin:function(){return"admin"===(e.get("role")||g.role)||"user"===(e.get("role")||g.role)},getRole:function(){return g.role},getToken:function(){return e.get("token")},getUserId:function(){return console.log(e.get("userId")),e.get("userId")},getName:function(){return e.get("name")}}}]),angular.module("xCallyShuttleApp").service("automations",function(){var a={voice:{conditions:[],actions:[]},mail:{conditions:[{name:"APPLICATION_STATUS",value:"status",type:"select",arr:[{name:"APPLICATION_STATUS_NEW",value:"NEW"},{name:"APPLICATION_STATUS_OPEN",value:"OPEN"},{name:"APPLICATION_STATUS_CLOSED",value:"CLOSED"}],operators:[{value:"equals",name:"APPLICATION_EQUALS_TO"},{value:"not_equals",name:"APPLICATION_NOT_EQUALS_TO"}]},{name:"APPLICATION_HOURS_SINCE_CREATED",value:"createdAt",type:"input",operators:[{value:"greater_or_equal",name:"APPLICATION_GTE_TO"},{value:"less_or_equal",name:"APPLICATION_LTE_TO"},{value:"greater",name:"APPLICATION_GREATER_THAN"},{value:"less",name:"APPLICATION_LESS_THAN"}]}],actions:[{name:"APPLICATION_STATUS",value:"status"}]},chat:{conditions:[{name:"APPLICATION_STATUS",value:"status",type:"select",arr:[{name:"APPLICATION_STATUS_NEW",value:"NEW"},{name:"APPLICATION_STATUS_OPEN",value:"OPEN"},{name:"APPLICATION_STATUS_CLOSED",value:"CLOSED"}],operators:[{value:"equals",name:"APPLICATION_EQUALS_TO"},{value:"not_equals",name:"APPLICATION_NOT_EQUALS_TO"}]},{name:"APPLICATION_HOURS_SINCE_CREATED",value:"createdAt",type:"input",operators:[{value:"greater_or_equal",name:"APPLICATION_GTE_TO"},{value:"less_or_equal",name:"APPLICATION_LTE_TO"},{value:"greater",name:"APPLICATION_GREATER_THAN"},{value:"less",name:"APPLICATION_LESS_THAN"}]}],actions:[{name:"APPLICATION_STATUS",value:"status"}]},fax:{conditions:[{name:"APPLICATION_STATUS",value:"status",type:"select",arr:[{name:"APPLICATION_STATUS_NEW",value:"NEW"},{name:"APPLICATION_STATUS_OPEN",value:"OPEN"},{name:"APPLICATION_STATUS_CLOSED",value:"CLOSED"}],operators:[{value:"equals",name:"APPLICATION_EQUALS_TO"},{value:"not_equals",name:"APPLICATION_NOT_EQUALS_TO"}]},{name:"APPLICATION_HOURS_SINCE_CREATED",value:"createdAt",type:"input",operators:[{value:"greater_or_equal",name:"APPLICATION_GTE_TO"},{value:"less_or_equal",name:"APPLICATION_LTE_TO"},{value:"greater",name:"APPLICATION_GREATER_THAN"},{value:"less",name:"APPLICATION_LESS_THAN"}]}],actions:[{name:"APPLICATION_STATUS",value:"status"}]}},b=["voice","mail","chat","fax"];return{services:a,channels:b}}),angular.module("xCallyShuttleApp").service("desk_com",function(){var a=[{id:"priority",label:"Priority",custom:!1,data:{choices:[1,2,3,4,5,6,7,8,9,10]}},{id:"status",label:"Status",custom:!1,data:{choices:["new","open","pending","resolved","closed"]}},{id:"type",label:"Type",custom:!1,data:{choices:["chat","twitter","email","qna","facebook","phone"]}}];return{fields:a}}),angular.module("xCallyShuttleApp").controller("FooterController",["$scope","$http",function(a,b){a.year=moment().year(),a.$on("$includeContentLoaded",function(){Layout.initFooter()}),a.initFooter=function(){b.get("/api/settings/info").success(function(b){a.info=b}).error(function(a){console.error(a)})}}]),angular.module("xCallyShuttleApp").controller("HeaderController",["$scope","$rootScope","$location","$state","$http","$notification","Auth","xAlert","socket","ngAudio","settings","toastr","localStorageService","MailReport","ChatReport",function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){a.toggleQuickSidebar=function(){k.layout.pageQuickSidebarOpened=!k.layout.pageQuickSidebarOpened,k.layout.pageQuickSidebarOpened||m.remove("chatRoomId")},a.toogleSidebar=function(){k.layout.pageSidebarClosed=!k.layout.pageSidebarClosed,m.set("sidebarClosed",k.layout.pageSidebarClosed)},a.initHeader=function(){var c=j.load("api/xchatty/assets?resource=notification/xc_blubb.mp3"),d={};"agent"===g.getCurrentUser().role&&(i.socket.on("report_mail:save",function(a){c.play();var d=f("MAIL CHANNEL",{icon:"assets/images/media/channels/mail64.png",body:"NEW Incoming Mail Message!",delay:1e3*a.timeslot});d.$on("click",function(){return n.get({id:a.id,controller1:"accept",controller2:a.uniqueid}).$promise.then(function(){h.show("Mail properly assigned","success"),b.$broadcast("mailMessageEvent",{message:"Mail properly assigned.."})})["catch"](function(a){h.show(a.data.message,"danger")})})}),i.socket.on("report_chat:save",function(a){c.play(),d[a.uniqueid]&&(d[a.uniqueid].close(),delete d[a.uniqueid]),d[a.uniqueid]=f("CHAT CHANNEL",{icon:"assets/images/media/channels/chat64.png",body:"NEW Incoming Chat Visitor!",delay:1e3*a.timeslot}),d[a.uniqueid].$on("click",function(){return o.get({id:a.id,controller1:"accept",controller2:a.uniqueid}).$promise.then(function(){h.show("Chat properly assigned","success"),b.$broadcast("mailMessageEvent",{message:"Chat properly assigned.."})})["catch"](function(a){h.show(a.data.message,"danger")})})}),i.socket.on("chat_message:save",function(a){c.play();var d=m.get("chatRoomId");if((!d||d!==a.ChatRoomId)&&a.UserId&&a.UserId!==g.getCurrentUser().id){var e=f(a.User.fullname,{icon:"assets/images/media/channels/chat64.png",body:a.body.length>35?a.body.substring(0,35)+"...":a.body,delay:1e4});e.$on("click",function(){b.$broadcast("chatMessageEvent",{chatRoomId:a.ChatRoomId})})}}),i.socket.on("user_has_chat_room:save",function(a){c.play(),b.$broadcast("chatGroupEvent",a)})),e({url:"/api/fax/user_has_queues",method:"GET",params:{UserId:g.getCurrentUser().id}}).success(function(b){a.faxQueues=_.map(b,"FaxQueueId"),a.faxQueues.forEach(function(a){i.socket.on("FAX:QUEUE:"+a,function(a,b){var c=f("FAX CHANNEL",{icon:"assets/images/media/channels/telephone124.png",body:"NEW Incoming Fax Message!",delay:1e3*a.timeout});c.$on("click",function(){e.put("/api/fax/rooms/"+a.roomId,{UserId:g.getCurrentUser().id}).success(function(){c.close(),b(g.getCurrentUser().id),l.success("Fax properly assigned","Success",{closeButton:!0,timeOut:5e3})}).error(function(){l.warning("Fax already assigned","Warning",{closeButton:!0,timeOut:5e3})})})})}),i.socket.on("FAX:AGENT:"+g.getCurrentUser().id,function(a,b){var c=f("FAX CHANNEL",{icon:"assets/images/media/channels/telephone124.png",body:"NEW Incoming Fax Message!",delay:1e3*a.timeout});c.$on("click",function(){e.put("/api/fax/rooms/"+a.roomId,{UserId:g.getCurrentUser().id}).success(function(){c.close(),b(g.getCurrentUser().id),l.success("Fax properly assigned","Success",{closeButton:!0,timeOut:5e3})}).error(function(){b(g.getCurrentUser().id),l.warning("Fax already assigned","Warning",{closeButton:!0,timeOut:5e3})})})})}).error(function(a){console.error(a)}),i.socket.on("user_has_fax_queue:save",function(b){b=_.map(b,function(a){return a.UserId=parseInt(a.UserId,10),a}),b=_.find(b,{UserId:g.getCurrentUser().id}),b&&-1===_.indexOf(a.faxQueues,b.FaxQueueId)&&(a.faxQueues.push(b.FaxQueueId),i.socket.on("FAX:QUEUE:"+b.FaxQueueId,function(a,b){var c=f("FAX CHANNEL",{icon:"assets/images/media/channels/telephone124.png",body:"NEW Incoming Fax Message!",delay:1e3*a.timeout});c.$on("click",function(){e.put("/api/fax/rooms/"+a.roomId,{UserId:g.getCurrentUser().id}).success(function(){c.close(),b(g.getCurrentUser().id),l.success("Fax properly assigned","Success",{closeButton:!0,timeOut:5e3})}).error(function(){b(g.getCurrentUser().id),l.warning("Fax already assigned","Warning",{closeButton:!0,timeOut:5e3})})})}))}),i.socket.on("user_has_fax_queue:remove",function(b){_.indexOf(b.where.UserId,g.getCurrentUser().id.toString())>=0&&_.indexOf(a.faxQueues,b.where.FaxQueueId)>=0&&(a.faxQueues=_.remove(a.faxQueues,b.where.FaxQueueId),i.socket.removeAllListeners("FAX:QUEUE:"+b.where.FaxQueueId))})},a.logout=function(){e.get("/auth/local/logout").success(function(){g.logout(),c.path("/login")}).error(function(a){console.error(a)})},a.isActive=function(a){return a===c.path()}}]),angular.module("xCallyShuttleApp").service("interval",function(){var a={months:[{value:"always",name:"APPLICATION_ALWAYS"},{value:"jan",name:"APPLICATION_JANUARY"},{value:"feb",name:"APPLICATION_FEBRUARY"},{value:"mar",name:"APPLICATION_MARCH"},{value:"apr",name:"APPLICATION_APRIL"},{value:"may",name:"APPLICATION_MAY"},{value:"jun",name:"APPLICATION_JUNE"},{value:"jul",name:"APPLICATION_JULY"},{value:"aug",name:"APPLICATION_AUGUST"},{value:"sep",name:"APPLICATION_SEPTEMBER"},{value:"oct",name:"APPLICATION_OCTOBER"},{value:"nov",name:"APPLICATION_NOVEMBER"},{value:"dec",name:"APPLICATION_DECEMBER"}],daysOfWeek:[{value:"always",name:"APPLICATION_ALWAYS"},{value:"mon",name:"APPLICATION_MONDAY"},{value:"tue",name:"APPLICATION_TUESDAY"},{value:"wed",name:"APPLICATION_WEDNESDAY"},{value:"thu",
+name:"APPLICATION_THURSDAY"},{value:"fri",name:"APPLICATION_FRIDAY"},{value:"sat",name:"APPLICATION_SATURDAY"},{value:"sun",name:"APPLICATION_SUNDAY"}],daysOfMonth:["always",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{interval:a}}),angular.module("xCallyShuttleApp").factory("Modal",["$rootScope","$uibModal",function(a,b){function c(c,d){console.log("openModal",d);var e=a.$new();return c=c||{},d=d||"modal-default",angular.extend(e,c),b.open({templateUrl:"components/modal/delete.html",windowClass:d,scope:e})}return{confirm:{"delete":function(a){return a=a||angular.noop,function(){console.log(Array.prototype.slice.call(arguments));var b,d=Array.prototype.slice.call(arguments),e=d.shift();b=c({modal:{dismissable:!0,title:"Confirm Delete",html:"<p>Are you sure you want to delete"+(e?"<strong> "+e+"</strong>":" selected items")+"?</p>",buttons:[{classes:"btn red",text:"Delete",click:function(a){b.close(a)}},{classes:"btn default",text:"Cancel",click:function(a){b.dismiss(a)}}]}},"over-topbar center"),b.result.then(function(b){a.apply(b,d)})}}}}}]),angular.module("xCallyShuttleApp").controller("QuickSidebarControllerAddModal",["$scope","$uibModalInstance","Agent","items",function(a,b,c,d){a.items=d,a.agents=c.get(function(b){a.agents=b,a.items.forEach(function(b){_.remove(a.agents.rows,{id:b.id})})}),a.selected={items:[]},a.modal={title:"APPLICATION_AGENTS_SELECTION"},a.ok=function(){b.close(_.union(_.map(a.selected.items,"id"),_.map(a.items,"id")))},a.cancel=function(){b.dismiss()}}]),angular.module("xCallyShuttleApp").controller("QuickSidebarControllerCloseModal",["$scope","$uibModalInstance",function(a,b){a.modal={title:"APPLICATION_CONFIRM_CLOSE",text:"MESSAGE_ARE_YOU_SURE_YOU_WANT_TO_CLOSE_THE_CHAT"},a.ok=function(){b.close()},a.cancel=function(){b.dismiss()}}]),angular.module("xCallyShuttleApp").controller("QuickSidebarController",["$scope","$rootScope","$window","$http","$uibModal","$log","$timeout","$interval","Auth","Agent","User","ChatRoom","ChatMessage","socket","settings","localStorageService","xAlert","$translate","QuickSidebarFactory",function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s){a.emojiMessage={},a.options=s.options,a.message={body:"",user:""};var t=a.currentUser=i.getCurrentUser(),u=function(b){switch(a.messagesTab=!0,o.layout.pageQuickSidebarOpened=!0,p.set("chatRoomId",b.id),p.set("messagesTab",a.messagesTab),a.chatRoom=b,b.type){case"internal":a.currentTab=0;break;case"external":a.currentTab=2,_.find(a.chatRooms,{id:b.id})||a.chatRooms.push(b)}b.Users.length>2&&(a.currentTab=3),g(function(){angular.element("page-quick-sidebar-chat-user-messages").mCustomScrollbar("scrollTo","last")},1500)},v=function(a){console.error(a)};a.$on("$includeContentLoaded",function(){p.get("chatRoomId")&&l.get({id:p.get("chatRoomId")},u,v),p.get("currentTab")&&(a.currentTab=p.get("currentTab"))}),a.agents=j.get({offset:0,limit:1e3},function(){n.syncUpdates("agent",a.agents.rows)}),a.users=k.get({offset:0,limit:1e3},function(){n.syncUpdates("user",a.users.rows)}),a.currentTab=0,a.messagesTab=!1,a.chatRooms=l.me(function(b){a.chatRooms=b},function(a){console.error(a)}),n.socket.on("report_chat:assignment",function(a){a.agentid&&l.get({id:a.chatroomid},u,v)}),n.socket.on("chat_room:save",function(b){if(a.chatRoom&&a.chatRoom.id===b.id){_.merge(a.chatRoom,b);var c=_.find(a.chatRooms,{id:b.id});c&&_.merge(c,b)}}),n.socket.on("chat_message:save",function(b){a.chatRoom&&a.chatRoom.id===b.ChatRoomId&&(a.chatRoom.ChatMessages.push(b),angular.element("page-quick-sidebar-chat-user-messages").mCustomScrollbar("scrollTo","last"))}),n.socket.on("user_has_chat_room:save",function(b){var c=_.findIndex(a.chatRooms,{id:b.id});c>=0?a.chatRooms[c]=b:a.chatRooms.push(b)}),b.$on("chatMessageEvent",function(a,b){l.get({id:b.chatRoomId},u,v)}),b.$on("chatGroupEvent",function(b,c){a.currentTab=3,a.messagesTab=!0,o.layout.pageQuickSidebarOpened=!0,a.chatRoom=c}),a.goToTab=function(b){a.currentTab=b,a.messagesTab=!1,a.chatRoom=null,p.set("currentTab",a.currentTab),p.set("messagesTab",a.messagesTab),p.remove("chatRoomId")},a.goToMessage=function(a,b){a?l.users({users:[t.id,a]},u,v):l.get({id:b},u,v)},a.sendMessage=function(){a.message.body.trim().length&&m.save({ChatRoomId:a.chatRoom.id,body:a.message.body},function(){a.message.body=""},function(a){console.error(a)})},a.goBack=function(){a.messagesTab=!1,a.chatRoom=null,p.set("messagesTab",a.messagesTab),p.remove("chatRoomId")},a.closeChatRoom=function(a,b){var c=e.open({animation:!0,size:b,templateUrl:"components/quickSidebar/modal/close.html",controller:"QuickSidebarControllerCloseModal"});c.result.then(function(){l.update({id:a,status:"CLOSED",completeReason:"agent"}).$promise.then(function(){q.show(r.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){q.show(a.data.message,"danger")})})},a.addAgent=function(b,c){var f=e.open({animation:!0,size:c,templateUrl:"components/quickSidebar/modal/add.html",controller:"QuickSidebarControllerAddModal",resolve:{items:function(){return _.map(a.chatRoom.Users?a.chatRoom.Users:[],function(a){return{id:a.id,fullname:a.fullname}})}}});f.result.then(function(a){d.put("/api/chat/rooms/"+b+"/users",{users:a}).then(function(){q.show(r.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){q.show(a.data.message,"danger")})})};var w=function(){var b=angular.element(c),d=function(){return{h:b.height(),w:b.width()}};a.$watch(d,function(b){a.style={height:b.h-46-46-46+"px"},a.style2={height:b.h-46-46-46-180+"px"}},!0),b.bind("resize",function(){a.$apply()})};w(),a.$on("$destroy",function(){n.unsyncUpdates("agent"),n.unsyncUpdates("user")})}]),angular.module("xCallyShuttleApp").directive("resizeQuickSidebar",["$window",function(a){return function(b){var c=angular.element(a);b.getWindowDimensions=function(){return{h:c.height(),w:c.width()}},b.$watch(b.getWindowDimensions,function(a){b.style={height:a.h-46-46-46+"px"}},!0),c.bind("resize",function(){b.$apply()})}}]),angular.module("xCallyShuttleApp").factory("QuickSidebarFactory",function(){return{options:{link:!0,linkTarget:"_blank",pdf:{embed:!1},image:{embed:!0},audio:{embed:!0},code:{highlight:!0,lineNumbers:!1},basicVideo:!1,video:{embed:!1,width:null,height:null,ytTheme:"dark",details:!1,ytAuthKey:"_nkO9h1A7HlVyiUICO17oA"}}}}),angular.module("xCallyShuttleApp").filter("QuickSidebarFilterUsersGreaterThan",function(){return function(a,b){var c=[];return a.forEach(function(a){var d=0;a.ChatVisitor&&d++,d+=a.Users.length,d>b&&c.push(a)}),c}}).filter("QuickSidebarFilterUsersLowerThan",function(){return function(a,b){var c=[];return a.forEach(function(a){a.Users.length<b&&c.push(a)}),c}}),angular.module("xCallyShuttleApp").controller("SidebarController",["$scope","$rootScope","$resource","$location","Auth","$http","xAlert","$stateParams","socket",function(a,b,c,d,e,f,g,h,i){a.Auth=e,a.$stateParams=h,a.$on("$includeContentLoaded",function(){Metronic.init(),Layout.initSidebar()}),a.isAssociated=function(a){if(e.isAdmin())return!0;if(e.getCurrentUser().Modules)for(var b=0;b<e.getCurrentUser().Modules.length;b++)if(e.getCurrentUser().Modules[b].name===a)return!0;return!1},a.getSidebarDashboards=function(){f.get("/api/dashboards").then(function(b){a.dashboards=b.data.rows,i.syncUpdates("dashboard",a.dashboards)})["catch"](function(a){g.show("Error loading your dashboards","danger")})},a.getSidebarIntegrations=function(){f.get("/api/integrations").success(function(b){a.integrations=b.rows,i.syncUpdates("integration",a.integrations)}).error(function(a){g.show(a.message,"danger")})},a.isActive=function(a){return a===d.path()},a.$on("destroy",function(){i.unsyncUpdates("dashboard"),i.unsyncUpdates("integration")})}]),angular.module("xCallyShuttleApp").factory("socket",["$rootScope","$window","socketFactory","Auth",function(a,b,c,d){var e=d.getCurrentUser(),f=io("",{query:"token="+d.getToken()+"&userId="+(e.id||d.getUserId())+"&name="+(e.name||d.getName())+"&role="+(e.role||"agent")+"&source=browser",path:"/socket.io-client"}),g=c({ioSocket:f});return a.$on("logout",function(){g&&(g.disconnect(!0),b.location.reload())}),{socket:g,syncUpdates:function(a,b,c){c=c||angular.noop,g.on(a+":save",function(a){var d=_.find(b,{id:a.id}),e=b.indexOf(d),f="created";d?(_.merge(b[e],a),f="updated"):b.unshift(a),c(f,a,b)}),g.on(a+":remove",function(a){var d="deleted";_.remove(b,{id:a.id}),c(d,a,b)})},unsyncUpdates:function(a){g.removeAllListeners(a+":save"),g.removeAllListeners(a+":remove")},syncUpdatesByAttributes:function(a,b,c,d){d=d||angular.noop,g.on(a+":save",function(a){var e=!0;if(_.forIn(b,function(b,c){return a[c]&&a[c]===b?!0:e=!1}),e){var f=_.find(c,{id:a.id}),g=c.indexOf(f),h="created";f?(_.merge(c[g],a),h="updated"):c.unshift(a),d(h,a,c)}}),g.on(a+":remove",function(a){var b="deleted";_.remove(c,{id:a.id}),d(b,a,c)})},syncMailMessageUpdates:function(a,b,c,d){d=d||angular.noop,g.on(a+":"+b+":save",function(a){var b=_.find(c,{id:a.id}),e=c.indexOf(b),f="created";b?(_.merge(c[e],a),f="updated"):c.unshift(a),d(f,a)}),g.on(a+":"+b+":remove",function(a){var b="deleted";_.remove(c,{id:a.id}),d(b,a,c)})},unsyncMailMessageUpdates:function(a,b){g.removeAllListeners(a+":"+b+":save"),g.removeAllListeners(a+":"+b+":remove")},syncFaxMessageUpdates:function(a,b,c,d){d=d||angular.noop,g.on(a+":"+b+":save",function(a){var b=_.find(c,{id:a.id}),e=c.indexOf(b),f="created";b?(_.merge(c[e],a),f="updated"):c.unshift(a),d(f,a)}),g.on(a+":"+b+":remove",function(a){var b="deleted";_.remove(c,{id:a.id}),d(b,a,c)})},unsyncFaxMessageUpdates:function(a,b){g.removeAllListeners(a+":"+b+":save"),g.removeAllListeners(a+":"+b+":remove")}}}]),angular.module("xCallyShuttleApp").service("triggers",["VoiceQueue",function(a){var b={voice:{conditions:[{name:"APPLICATION_QUEUE",value:"queue",type:"select",resource:a,resValue:"name",operators:[{value:"equals",name:"APPLICATION_EQUALS_TO"},{value:"not_equals",name:"APPLICATION_NOT_EQUALS_TO"}]},{name:"APPLICATION_CALL_STATUS",value:"lastevent",type:"select",arr:[{name:"called",value:"called"},{name:"connect",value:"connect"},{name:"complete",value:"complete"},{name:"rejected",value:"rejected"},{name:"abandoned",value:"abandoned"}],operators:[{value:"equals",name:"APPLICATION_EQUALS_TO"},{value:"not_equals",name:"APPLICATION_NOT_EQUALS_TO"}]}],actions:[{name:"APPLICATION_CONTACT_MANAGER",value:"contactManager"},{name:"APPLICATION_INTEGRATIONS",value:"integration",propertyField:"select"}]},mail:{conditions:[{name:"APPLICATION_FROM",value:"from",type:"input",operators:[{value:"equals",name:"APPLICATION_EQUALS_TO"},{value:"not_equals",name:"APPLICATION_NOT_EQUALS_TO"}]},{name:"APPLICATION_CC",value:"cc",type:"input",operators:[{value:"equals",name:"APPLICATION_EQUALS_TO"},{value:"not_equals",name:"APPLICATION_NOT_EQUALS_TO"}]},{name:"APPLICATION_SUBJECT",value:"subject",type:"input",operators:[{value:"equals",name:"APPLICATION_EQUALS_TO"},{value:"not_equals",name:"APPLICATION_NOT_EQUALS_TO"}]}],actions:[{name:"APPLICATION_TEMPLATE",value:"template"},{name:"APPLICATION_CONTACT_MANAGER",value:"contactManager"}]},chat:{conditions:[],actions:[]},fax:{conditions:[],actions:[]}},c=["voice","mail","chat","fax"];return{services:b,channels:c}}]),angular.module("xCallyShuttleApp").service("variable",function(){var a=[{title:"Unique ID",name:"uniqueid",group:"voice_queue"},{title:"Caller Number",name:"calleridnum",group:"voice_queue"},{title:"Caller Name",name:"calleridname",group:"voice_queue"},{title:"Queue",name:"queue",group:"voice_queue"},{title:"Called Number",name:"destcalleridnum",group:"voice_queue"},{title:"Called Name",name:"destcalleridname",group:"voice_queue"},{title:"Hold Time",name:"holdtime",group:"voice_queue"},{title:"Talk Time",name:"talktime",group:"voice_queue"},{title:"Connected Time",name:"agentconnectAt",group:"voice_queue"},{title:"Called Time",name:"agentcalledAt",group:"voice_queue"},{title:"DNID",name:"destexten",group:"voice_queue"},{title:"Complete Time",name:"agentcompleteAt",group:"voice_queue"},{title:"No Answer Time",name:"agentringnoanswerAt",group:"voice_queue"}];return a}),function(a,b){angular.module("adf.widget.counter",["adf.provider"]).config(["dashboardProvider",function(a){a.widget("counter",{title:"Single Value",description:"Single Value for db results",templateUrl:"{widgetsPath}/counter/src/view.html",controller:"apiwidgetCounterViewCtrl",edit:{templateUrl:"{widgetsPath}/counter/src/edit.html",controller:"apiwidgetCounterEditCtrl"}})}]).service("apiServiceCounter",["Widget",function(a){return{get:function(b){return a.get({select:b.select,condition:encodeURIComponent(b.condition),table:b.report,controller:"counter"}).$promise.then(function(a){return a})["catch"](function(a){console.log(a)})}}}]).controller("apiwidgetCounterEditCtrl",["$scope",function(a){a.config.reportTables=[{name:"Agents",value:"report_agent"},{name:"Calls",value:"report_call"},{name:"Dials",value:"report_dial"},{name:"Queues",value:"report_queue"},{name:"Users",value:"users"},{name:"Chat Sessions",value:"report_chat_session"},{name:"Mail Sessions",value:"report_mail_session"}],a.config.colors=[{name:"Blue",value:"blue-madison"},{name:"Red",value:"red-intense"},{name:"Green",value:"green-haze"},{name:"Purple",value:"purple-plum"},{name:"Orange",value:"yellow-casablanca"},{name:"Yellow",value:"yellow-crusta"}],a.config.icons=[{name:"Talk bubbles",value:"fa-comments"},{name:"Bar Chart",value:"fa-bar-chart"},{name:"Shopping Cart",value:"fa-shopping-cart"},{name:"Globe",value:"fa-globe"}],a.config.select=a.config.select?a.config.select:"COUNT(*)",a.config.timeout=a.config.timeout?a.config.timeout:1,a.config.color=a.config.color?a.config.color:"blue-madison",a.config.icon=a.config.icon?a.config.icon:"fa-comments",a.config.link=a.config.link?a.config.link:"#",a.config.linkText=a.config.linkText?a.config.linkText:"VIEW MORE"}]).controller("apiwidgetCounterViewCtrl",["$scope","$interval","apiServiceCounter",function(a,b,c){a.config.timeout=a.config.timeout?a.config.timeout:1,a.config.condition=a.config.condition?a.config.condition:null,a.config.color=a.config.color?a.config.color:"blue-madison",a.config.icon=a.config.icon?a.config.icon:"fa-comments",a.config.link=a.config.link?a.config.link:"#",a.config.linkText=a.config.linkText?a.config.linkText:"VIEW MORE",a.counterApiCall=function(){a.config.report&&c.get(a.config).then(function(b){b?b.result&&b.result.length>1||_.keys(b.result[0]).length>1?(a.tooManyResults=!0,a.result=null):(a.tooManyResults=!1,null!==_.values(b.result[0])[0]?a.result=_.values(b.result[0])[0].toString():a.result="--"):a.result=null})},a.counterApiCall();var d=b(function(){a.counterApiCall()},1e3*parseInt(a.config.timeout));a.$on("$destroy",function(){b.cancel(d)})}]),angular.module("adf.widget.counter").run(["$templateCache",function(a){a.put("{widgetsPath}/counter/src/edit.html","<form role=form><div class=form-group><label for=select>Select</label> <input type=text class=form-control id=condition ng-model=config.select placeholder=Select></div><div class=form-group><label class=control-label>From</label><ui-select data-ng-model=config.report name=report theme=bootstrap><ui-select-match placeholder=From>{{$select.selected.name}}</ui-select-match><ui-select-choices repeat=\"report.value as report in config.reportTables | filter: $select.search\"><div ng-bind-html=\"report.name | highlight: $select.search\"></div></ui-select-choices></ui-select></div><div class=form-group><label for=condition>Where</label> <input type=text class=form-control id=condition ng-model=config.condition placeholder=Where></div><div class=form-group><label for=condition>{{'APPLICATION_REFRESH_TIMEOUT' | translate}}</label> <input type=number class=form-control id=timeout ng-model=config.timeout placeholder=\"{{'APPLICATION_REFRESH_TIMEOUT' | translate}}\" min=1></div><div class=form-group><label class=control-label>{{'APPLICATION_WIDGET_COLOR' | translate}}</label><ui-select data-ng-model=config.color name=color theme=bootstrap><ui-select-match placeholder=\"{{ 'APPLICATION_WIDGET_COLOR' | translate }}\">{{$select.selected.name}}</ui-select-match><ui-select-choices repeat=\"color.value as color in config.colors | filter: $select.search\"><div ng-bind-html=\"color.name | highlight: $select.search\"></div></ui-select-choices></ui-select></div><div class=form-group><label class=control-label>{{'APPLICATION_WIDGET_ICON' | translate}}</label><ui-select data-ng-model=config.icon name=icon theme=bootstrap><ui-select-match placeholder=\"{{ 'APPLICATION_WIDGET_ICON' | translate }}\">{{$select.selected.name}}</ui-select-match><ui-select-choices repeat=\"icon.value as icon in config.icons | filter: $select.search\"><div ng-bind-html=\"icon.name | highlight: $select.search\"></div></ui-select-choices></ui-select></div><div class=form-group><label for=condition>{{'APPLICATION_WIDGET_DETAILS' | translate}}</label> <input type=text class=form-control id=details ng-model=config.details maxlength=30 placeholder=\"{{'APPLICATION_WIDGET_DETAILS' | translate}}\"></div><div class=form-group><label for=condition>{{'APPLICATION_WIDGET_LINK' | translate}}</label> <input type=text class=form-control id=link ng-model=config.link placeholder=http://yourlink></div><div class=form-group><label for=condition>{{'APPLICATION_WIDGET_LINK_TEXT' | translate}}</label> <input type=text class=form-control id=linkText ng-model=config.linkText maxlength=30 placeholder=\"{{'APPLICATION_WIDGET_LINK_TEXT' | translate}}\"></div></form>"),a.put("{widgetsPath}/counter/src/view.html",'<div class=dashboard-stat ng-class=config.color ng-if=result><div class=visual><i class=fa ng-class=config.icon></i></div><div class=details><div class=number>{{result}}</div><div class=desc>{{config.details}}</div></div><a class=more href={{config.link}}>{{config.linkText}} <i class="m-icon-swapright m-icon-white"></i></a></div><div class="alert alert-danger" role=alert ng-if=!config.report><span class="glyphicon glyphicon-exclamation-sign" aria-hidden=true></span> <span class=sr-only>{{\'APPLICATION_ERROR\' | translate}}:</span> {{\'MESSAGE_WIDGET_SELECT_REPORT\' | translate}}</div><div class="alert alert-danger" role=alert ng-if=tooManyResults><span class="glyphicon glyphicon-exclamation-sign" aria-hidden=true></span> <span class=sr-only>{{\'APPLICATION_ERROR\' | translate}}:</span> {{\'MESSAGE_TOO_MANY_RESULTS\' | translate}}</div><div class="alert alert-danger" role=alert ng-if="!result && !tooManyResults"><span class="glyphicon glyphicon-exclamation-sign" aria-hidden=true></span> <span class=sr-only>{{\'APPLICATION_ERROR\' | translate}}:</span> {{\'MESSAGE_QUERY_NOT_VALID\' | translate}}</div>')}])}(window),function(a,b){angular.module("adf.widget.pie-chart",["adf.provider"]).config(["dashboardProvider",function(a){a.widget("pie-chart",{title:"Pie-Chart",description:"Display a pie-chart starting from DB values",templateUrl:"{widgetsPath}/pie-chart/src/view.html",controller:"apiWidgetPieChartViewCtrl",edit:{templateUrl:"{widgetsPath}/pie-chart/src/edit.html",controller:"apiWidgetPieChartEditCtrl"}})}]).service("apiServicePieChart",["Widget",function(a){return{get:function(b){return a.get({condition:encodeURIComponent(b.condition),table:b.report,fields:b.fields,controller:"piechart"}).$promise.then(function(a){return a})["catch"](function(a){console.log(a)})}}}]).controller("apiWidgetPieChartEditCtrl",["$scope",function(a){function b(){return a.config.fields||(a.config.fields=[{column:"",alias:""}]),a.config.fields}a.config.reportTables=[{name:"Agents",value:"report_agent"},{name:"Calls",value:"report_call"},{name:"Dials",value:"report_dial"},{name:"Queues",value:"report_queue"},{name:"Users",value:"users"},{name:"Chat Sessions",value:"report_chat_session"},{name:"Mail Sessions",value:"report_mail_session"}],a.config.timeout=a.config.timeout?a.config.timeout:1,a.config.fields=a.config.fields?a.config.fields:[{column:"",alias:""}],a.addField=function(){b().push({})},a.removeField=function(a){b().splice(a,1)}}]).controller("apiWidgetPieChartViewCtrl",["$scope","$interval","apiServicePieChart",function(a,b,c){a.config.timeout=a.config.timeout?a.config.timeout:1,a.pieChartApiCall=function(){a.config.report&&a.config.fields.length&&""!==a.config.fields[0].column&&""!==a.config.fields[0].alias&&c.get(a.config).then(function(b){if(b&&b.result&&1===b.result.length){a.labels=[],a.data=[];for(var c in b.result[0])a.labels.push(c),a.data.push(b.result[0][c])}else a.labels=[],a.data=[]})},a.pieChartApiCall();var d=b(function(){a.pieChartApiCall()},1e3*parseInt(a.config.timeout));a.$on("$destroy",function(){b.cancel(d)})}]),angular.module("adf.widget.pie-chart").run(["$templateCache",function(a){a.put("{widgetsPath}/pie-chart/src/edit.html",'<form role=form><div class=form-group><label class=control-label>{{\'APPLICATION_REPORT\' | translate}}</label><ui-select data-ng-model=config.report name=report theme=bootstrap><ui-select-match placeholder="{{ \'APPLICATION_REPORT\' | translate }}">{{$select.selected.name}}</ui-select-match><ui-select-choices repeat="report.value as report in config.reportTables | filter: $select.search"><div ng-bind-html="report.name | highlight: $select.search"></div></ui-select-choices></ui-select></div><div><label class=control-label>{{\'APPLICATION_FIELDS\' | translate}}</label></div><div class=padding-bottom ng-repeat="field in config.fields"><div class=form-group><div class=input-group><input type=text class=form-control ng-model=field.column> <span class=input-group-addon>as</span> <input type=text class=form-control ng-model=field.alias> <span class=input-group-btn ng-if="config.fields.length>1"><button class="btn btn-danger" type=button data-ng-click=removeField($index)><i class="fa fa-times"></i> {{\'APPLICATION_REMOVE\' | translate}}</button></span></div></div></div><button type=button class="btn btn-sm green mbottom20" ng-click=addField()><i class="fa fa-plus"></i> {{\'APPLICATION_ADD_FIELD\' | translate}}</button><div class=form-group><label for=condition>{{\'APPLICATION_CONDITION\' | translate}}</label> <input type=text class=form-control id=condition ng-model=config.condition placeholder="{{\'APPLICATION_CONDITION\' | translate}}"></div><div class=form-group><label for=condition>{{\'APPLICATION_REFRESH_TIMEOUT\' | translate}}</label> <input type=number class=form-control id=timeout ng-model=config.timeout placeholder="{{\'APPLICATION_REFRESH_TIMEOUT\' | translate}}" min=1></div></form>'),a.put("{widgetsPath}/pie-chart/src/view.html",'<div ng-if=labels.length ng-style=config.style><canvas id=doughnut class="chart chart-doughnut" chart-data=data chart-labels=labels legend=true></canvas></div><div class="alert alert-danger" role=alert ng-if=!config.report><span class="glyphicon glyphicon-exclamation-sign" aria-hidden=true></span> <span class=sr-only>{{\'APPLICATION_ERROR\' | translate}}:</span> {{\'MESSAGE_WIDGET_SELECT_REPORT\' | translate}}</div><div class="alert alert-danger" role=alert ng-if=!labels.length><span class="glyphicon glyphicon-exclamation-sign" aria-hidden=true></span> <span class=sr-only>{{\'APPLICATION_ERROR\' | translate}}:</span> {{\'MESSAGE_ENTER_VALID_CONDITION\' | translate}}</div><div class="alert alert-danger" role=alert ng-if=!labels.length><span class="glyphicon glyphicon-exclamation-sign" aria-hidden=true></span> <span class=sr-only>{{\'APPLICATION_ERROR\' | translate}}:</span> {{\'MESSAGE_ENTER_ONE_VALID_METRIC_AND_CHECK_OTHER\' | translate}}</div>')}])}(window),function(a,b){angular.module("adf.widget.table",["adf.provider"]).value("apiServiceUrlTable","/api/widgets/table").config(["dashboardProvider",function(a){a.widget("table",{title:"Table",description:"Show tabbed results from db",templateUrl:"{widgetsPath}/table/src/view.html",controller:"apiWidgetTableViewCtrl",edit:{templateUrl:"{widgetsPath}/table/src/edit.html",controller:"apiWidgetTableEditCtrl"}})}]).service("apiServiceTable",["$q","$http","apiServiceUrlTable",function(a,b,c){return{get:function(d){var e=a.defer();return b.get(c,{params:{condition:encodeURIComponent(d.condition),table:d.report,fields:d.fields}}).success(function(a){a?e.resolve(a):e.reject()}).error(function(a){console.log(a),e.reject()}),e.promise}}}]).controller("apiWidgetTableEditCtrl",["$scope",function(a){function b(){return a.config.fields||(a.config.fields=[{column:"",alias:""}]),a.config.fields}a.config.reportTables=[{name:"Agents",value:"agent"},{name:"Calls",value:"call"},{name:"Dials",value:"dial"},{name:"Members",value:"member"},{name:"Queues",value:"queue"}],a.config.timeout=a.config.timeout?a.config.timeout:1,a.config.height=a.config.height?a.config.height:350,a.config.fields=a.config.fields?a.config.fields:[{column:"",alias:""}],a.addField=function(){b().push({})},a.removeField=function(a){b().splice(a,1)}}]).controller("apiWidgetTableViewCtrl",["$scope","$interval","apiServiceTable",function(a,b,c){a.config.timeout=a.config.timeout?a.config.timeout:1,a.config.height=a.config.height?a.config.height:350,a.config.style={"max-height":a.config.height+"px",overflow:"scroll"},a.tableApiCall=function(){a.config.condition&&a.config.report&&a.config.fields.length&&""!==a.config.fields[0].column&&""!==a.config.fields[0].alias&&c.get(a.config).then(function(b){a.results=b})},a.tableApiCall();var d=b(function(){a.tableApiCall()},1e3*parseInt(a.config.timeout));a.$on("$destroy",function(){b.cancel(d)})}]),angular.module("adf.widget.table").run(["$templateCache",function(a){a.put("{widgetsPath}/table/src/edit.html",'<form role=form><div class=form-group><label class=control-label>{{\'APPLICATION_REPORT\' | translate}}</label><ui-select data-ng-model=config.report name=report theme=bootstrap><ui-select-match placeholder="{{ \'APPLICATION_REPORT\' | translate }}">{{$select.selected.name}}</ui-select-match><ui-select-choices repeat="report.value as report in config.reportTables | filter: $select.search"><div ng-bind-html="report.name | highlight: $select.search"></div></ui-select-choices></ui-select></div><div><label class=control-label>{{\'APPLICATION_METRICS\' | translate}}</label></div><div class=padding-bottom ng-repeat="field in config.fields"><div class=form-group><div class=input-group><input type=text class=form-control ng-model=field.column> <span class=input-group-addon>as</span> <input type=text class=form-control ng-model=field.alias> <span class=input-group-btn ng-if="config.fields.length>1"><button class="btn btn-danger" type=button data-ng-click=removeField($index)><i class="fa fa-times"></i> {{\'APPLICATION_REMOVE\' | translate}}</button></span></div></div></div><button type=button class="btn btn-sm green mbottom20" ng-click=addField()><i class="fa fa-plus"></i> {{\'APPLICATION_ADD_FIELD\' | translate}}</button><div class=form-group><label for=condition>{{\'APPLICATION_CONDITION\' | translate}}</label> <input type=text class=form-control id=condition ng-model=config.condition placeholder="{{\'APPLICATION_CONDITION\' | translate}}"></div><div class=form-group><label for=condition>{{\'APPLICATION_REFRESH_TIMEOUT\' | translate}}</label> <input type=number class=form-control id=timeout ng-model=config.timeout placeholder="{{\'APPLICATION_REFRESH_TIMEOUT\' | translate}}" min=1></div><div class=form-group><label for=condition>{{\'APPLICATION_WIDGET_MAX_HEIGHT\' | translate}}</label> <input type=number class=form-control id=height ng-model=config.height placeholder="{{\'APPLICATION_WIDGET_MAX_HEIGHT\' | translate}}" min=350></div></form>'),a.put("{widgetsPath}/table/src/view.html",'<div ng-if=results ng-style=config.style><table st-table=results class="table table-striped table-bordered table-hover"><div class=table-responsive><thead><tr><th colspan={{config.fields.length}}><div class=row><div class=col-md-6></div><div class=col-md-6><div class="input-group input-medium pull-right"><input st-search placeholder="{{ \'APPLICATION_SEARCH\' | translate }}" class=form-control type=search> <span class=input-group-addon><i class="fa fa-search"></i></span></div></div></div></th></tr><tr><th ng-repeat="field in config.fields">{{field.alias}}</th></tr></thead><tbody><tr data-ng-repeat="result in results" class=animate-repeat><td ng-repeat="field in config.fields">{{result[field.alias]}}</td></tr><tr data-ng-hide=results.length><td colspan={{config.fields.length}} style=text-align:center;><i>{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</i></td></tr></tbody><tfoot><tr><td colspan={{config.fields.length}} class=text-center><div st-pagination class=pagination st-items-by-page=10 st-displayed-pages=3></div></td></tr></tfoot></div></table></div><div class="alert alert-danger" role=alert ng-if=!config.report><span class="glyphicon glyphicon-exclamation-sign" aria-hidden=true></span> <span class=sr-only>{{\'APPLICATION_ERROR\' | translate}}:</span> {{\'MESSAGE_WIDGET_SELECT_REPORT\' | translate}}</div><div class="alert alert-danger" role=alert ng-if=!results><span class="glyphicon glyphicon-exclamation-sign" aria-hidden=true></span> <span class=sr-only>{{\'APPLICATION_ERROR\' | translate}}:</span> {{\'MESSAGE_ENTER_VALID_CONDITION\' | translate}}</div><div class="alert alert-danger" role=alert ng-if=!results><span class="glyphicon glyphicon-exclamation-sign" aria-hidden=true></span> <span class=sr-only>{{\'APPLICATION_ERROR\' | translate}}:</span> {{\'MESSAGE_ENTER_ONE_VALID_FIELD_AND_CHECK_OTHER\' | translate}}</div>')}])}(window),function(){angular.module("pdf",[]).directive("ngPdf",["$window",function(a){return{restrict:"E",templateUrl:function(a,b){return b.templateUrl?b.templateUrl:"partials/viewer.html"},link:function(b,c,d){var e=d.pdfUrl,f=null,g=d.page?d.page:1,h=d.scale>0?d.scale:1,i=c.find("canvas"),j=i[0],k=j.getContext("2d"),l=angular.element(a);l.on("scroll",function(){b.$apply(function(){b.scroll=l[0].scrollY})}),PDFJS.disableWorker=!0,b.pageNum=g,b.renderPage=function(a){f.getPage(a).then(function(a){var e,f,g,i={};"page-fit"!==d.scale||h?e=a.getViewport(h):(e=a.getViewport(1),f=c[0].clientWidth/e.width,g=c[0].clientHeight/e.height,h=Math.min(f,g)),j.height=e.height,j.width=e.width,i={canvasContext:k,viewport:e},a.render(i).promise.then(function(){"function"==typeof b.onPageRender&&b.onPageRender()})})},b.goPrevious=function(){b.pageToDisplay<=1||(b.pageNum=parseInt(b.pageNum)-1)},b.goNext=function(){b.pageToDisplay>=f.numPages||(b.pageNum=parseInt(b.pageNum)+1)},b.zoomIn=function(){return h=parseFloat(h)+.2,b.renderPage(b.pageToDisplay),h},b.zoomOut=function(){return h=parseFloat(h)-.2,b.renderPage(b.pageToDisplay),h},b.changePage=function(){b.renderPage(b.pageToDisplay)},b.rotate=function(){"rotate0"===j.getAttribute("class")?j.setAttribute("class","rotate90"):"rotate90"===j.getAttribute("class")?j.setAttribute("class","rotate180"):"rotate180"===j.getAttribute("class")?j.setAttribute("class","rotate270"):j.setAttribute("class","rotate0")},PDFJS.getDocument(e,null,null,b.onProgress).then(function(a){"function"==typeof b.onLoad&&b.onLoad(),f=a,b.renderPage(b.pageToDisplay),b.$apply(function(){b.pageCount=a.numPages})},function(a){a&&"function"==typeof b.onError&&b.onError(a)}),b.$watch("pageNum",function(a){b.pageToDisplay=parseInt(a),null!==f&&b.renderPage(b.pageToDisplay)})}}}])}();var Metronic=function(){var a,b=!1,c=!1,d=!1,e=!1,f=[],g="assets/",h="img/",i="plugins/",j="css/",k={blue:"#89C4F4",red:"#F3565D",green:"#1bbc9b",purple:"#9b59b6",grey:"#95a5a6",yellow:"#F8CB00"},l=function(){"rtl"===$("body").css("direction")&&(b=!0),c=!!navigator.userAgent.match(/MSIE 8.0/),d=!!navigator.userAgent.match(/MSIE 9.0/),e=!!navigator.userAgent.match(/MSIE 10.0/),e&&$("html").addClass("ie10"),(e||d||c)&&$("html").addClass("ie")},m=function(){for(var a=0;a<f.length;a++){var b=f[a];b.call()}},n=function(){var a;if(c){var b;$(window).resize(function(){b!=document.documentElement.clientHeight&&(a&&clearTimeout(a),a=setTimeout(function(){m()},50),b=document.documentElement.clientHeight)})}else $(window).resize(function(){a&&clearTimeout(a),a=setTimeout(function(){m()},50)})},o=function(){$("body").on("click",".portlet > .portlet-title > .tools > a.remove",function(a){
+a.preventDefault();var b=$(this).closest(".portlet");$("body").hasClass("page-portlet-fullscreen")&&$("body").removeClass("page-portlet-fullscreen"),b.find(".portlet-title .fullscreen").tooltip("destroy"),b.find(".portlet-title > .tools > .reload").tooltip("destroy"),b.find(".portlet-title > .tools > .remove").tooltip("destroy"),b.find(".portlet-title > .tools > .config").tooltip("destroy"),b.find(".portlet-title > .tools > .collapse, .portlet > .portlet-title > .tools > .expand").tooltip("destroy"),b.remove()}),$("body").on("click",".portlet > .portlet-title .fullscreen",function(a){a.preventDefault();var b=$(this).closest(".portlet");if(b.hasClass("portlet-fullscreen"))$(this).removeClass("on"),b.removeClass("portlet-fullscreen"),$("body").removeClass("page-portlet-fullscreen"),b.children(".portlet-body").css("height","auto");else{var c=Metronic.getViewPort().height-b.children(".portlet-title").outerHeight()-parseInt(b.children(".portlet-body").css("padding-top"))-parseInt(b.children(".portlet-body").css("padding-bottom"));$(this).addClass("on"),b.addClass("portlet-fullscreen"),$("body").addClass("page-portlet-fullscreen"),b.children(".portlet-body").css("height",c)}}),$("body").on("click",".portlet > .portlet-title > .tools > a.reload",function(a){a.preventDefault();var b=$(this).closest(".portlet").children(".portlet-body"),c=$(this).attr("data-url"),d=$(this).attr("data-error-display");c?(Metronic.blockUI({target:b,animate:!0,overlayColor:"none"}),$.ajax({type:"GET",cache:!1,url:c,dataType:"html",success:function(a){Metronic.unblockUI(b),b.html(a)},error:function(a,c,e){Metronic.unblockUI(b);var f="Error on reloading the content. Please check your connection and try again.";"toastr"==d&&toastr?toastr.error(f):"notific8"==d&&$.notific8?($.notific8("zindex",11500),$.notific8(f,{theme:"ruby",life:3e3})):alert(f)}})):(Metronic.blockUI({target:b,animate:!0,overlayColor:"none"}),window.setTimeout(function(){Metronic.unblockUI(b)},1e3))}),$('.portlet .portlet-title a.reload[data-load="true"]').click(),$("body").on("click",".portlet > .portlet-title > .tools > .collapse, .portlet .portlet-title > .tools > .expand",function(a){a.preventDefault()})},p=function(){if($().uniform){var a=$("input[type=checkbox]:not(.toggle, .make-switch, .icheck), input[type=radio]:not(.toggle, .star, .make-switch, .icheck)");a.size()>0&&a.each(function(){0===$(this).parents(".checker").size()&&$(this).show()})}},q=function(){$().iCheck&&$(".icheck").each(function(){var a=$(this).attr("data-checkbox")?$(this).attr("data-checkbox"):"icheckbox_minimal-grey",b=$(this).attr("data-radio")?$(this).attr("data-radio"):"iradio_minimal-grey";a.indexOf("_line")>-1||b.indexOf("_line")>-1?$(this).iCheck({checkboxClass:a,radioClass:b,insert:'<div class="icheck_line-icon"></div>'+$(this).attr("data-label")}):$(this).iCheck({checkboxClass:a,radioClass:b})})},r=function(){$().bootstrapSwitch&&$(".make-switch").bootstrapSwitch()},s=function(){$().confirmation&&$("[data-toggle=confirmation]").confirmation({container:"body",btnOkClass:"btn-xs btn-success",btnCancelClass:"btn-xs btn-danger"})},t=function(){$("body").on("shown.bs.collapse",".accordion.scrollable",function(a){Metronic.scrollTo($(a.target))})},u=function(){if(location.hash){var a=location.hash.substr(1);$('a[href="#'+a+'"]').parents(".tab-pane:hidden").each(function(){var a=$(this).attr("id");$('a[href="#'+a+'"]').click()}),$('a[href="#'+a+'"]').click()}},v=function(){$("body").on("hide.bs.modal",function(){$(".modal:visible").size()>1&&$("html").hasClass("modal-open")===!1?$("html").addClass("modal-open"):$(".modal:visible").size()<=1&&$("html").removeClass("modal-open")}),$("body").on("show.bs.modal",".modal",function(){$(this).hasClass("modal-scroll")&&$("body").addClass("modal-open-noscroll")}),$("body").on("hide.bs.modal",".modal",function(){$("body").removeClass("modal-open-noscroll")}),$("body").on("hidden.bs.modal",".modal:not(.modal-cached)",function(){$(this).removeData("bs.modal")})},w=function(){$(".tooltips").tooltip(),$(".portlet > .portlet-title .fullscreen").tooltip({container:"body",title:"Fullscreen"}),$(".portlet > .portlet-title > .tools > .reload").tooltip({container:"body",title:"Reload"}),$(".portlet > .portlet-title > .tools > .remove").tooltip({container:"body",title:"Remove"}),$(".portlet > .portlet-title > .tools > .config").tooltip({container:"body",title:"Settings"}),$(".portlet > .portlet-title > .tools > .collapse, .portlet > .portlet-title > .tools > .expand").tooltip({container:"body",title:"Collapse/Expand"})},x=function(){$("body").on("click",".dropdown-menu.hold-on-click",function(a){a.stopPropagation()})},y=function(){$("body").on("click",'[data-close="alert"]',function(a){$(this).parent(".alert").hide(),$(this).closest(".note").hide(),a.preventDefault()}),$("body").on("click",'[data-close="note"]',function(a){$(this).closest(".note").hide(),a.preventDefault()}),$("body").on("click",'[data-remove="note"]',function(a){$(this).closest(".note").remove(),a.preventDefault()})},z=function(){$('[data-hover="dropdown"]').not(".hover-initialized").each(function(){$(this).dropdownHover(),$(this).addClass("hover-initialized")})},A=function(){$(".popovers").popover(),$(document).on("click.bs.popover.data-api",function(b){a&&a.popover("hide")})},B=function(){Metronic.initSlimScroll(".scroller")},C=function(){jQuery.fancybox&&$(".fancybox-button").size()>0&&$(".fancybox-button").fancybox({groupAttr:"data-rel",prevEffect:"none",nextEffect:"none",closeBtn:!0,helpers:{title:{type:"inside"}}})},D=function(){(c||d)&&$("input[placeholder]:not(.placeholder-no-fix), textarea[placeholder]:not(.placeholder-no-fix)").each(function(){var a=$(this);""===a.val()&&""!==a.attr("placeholder")&&a.addClass("placeholder").val(a.attr("placeholder")),a.focus(function(){a.val()==a.attr("placeholder")&&a.val("")}),a.blur(function(){(""===a.val()||a.val()==a.attr("placeholder"))&&a.val(a.attr("placeholder"))})})},E=function(){$().select2&&$(".select2me").select2({placeholder:"Select"})};return{init:function(){l(),n(),p(),q(),r(),B(),C(),E(),o(),y(),x(),u(),w(),A(),t(),v(),s(),D()},initAjax:function(){p(),q(),r(),z(),B(),E(),C(),x(),w(),A(),t(),s()},initComponents:function(){this.initAjax()},setLastPopedPopover:function(b){a=b},addResizeHandler:function(a){f.push(a)},runResizeHandlers:function(){m()},scrollTo:function(a,b){var c=a&&a.size()>0?a.offset().top:0;a&&($("body").hasClass("page-header-fixed")&&(c-=$(".page-header").height()),c+=b?b:-1*a.height()),$("html,body").animate({scrollTop:c},"slow")},initSlimScroll:function(a){$(a).each(function(){if(!$(this).attr("data-initialized")){var a;a=$(this).attr("data-height")?$(this).attr("data-height"):$(this).css("height"),$(this).slimScroll({allowPageScroll:!0,size:"7px",color:$(this).attr("data-handle-color")?$(this).attr("data-handle-color"):"#bbb",wrapperClass:$(this).attr("data-wrapper-class")?$(this).attr("data-wrapper-class"):"slimScrollDiv",railColor:$(this).attr("data-rail-color")?$(this).attr("data-rail-color"):"#eaeaea",position:b?"left":"right",height:a,alwaysVisible:"1"==$(this).attr("data-always-visible")?!0:!1,railVisible:"1"==$(this).attr("data-rail-visible")?!0:!1,disableFadeOut:!0}),$(this).attr("data-initialized","1")}})},destroySlimScroll:function(a){$(a).each(function(){if("1"===$(this).attr("data-initialized")){$(this).removeAttr("data-initialized"),$(this).removeAttr("style");var a={};$(this).attr("data-handle-color")&&(a["data-handle-color"]=$(this).attr("data-handle-color")),$(this).attr("data-wrapper-class")&&(a["data-wrapper-class"]=$(this).attr("data-wrapper-class")),$(this).attr("data-rail-color")&&(a["data-rail-color"]=$(this).attr("data-rail-color")),$(this).attr("data-always-visible")&&(a["data-always-visible"]=$(this).attr("data-always-visible")),$(this).attr("data-rail-visible")&&(a["data-rail-visible"]=$(this).attr("data-rail-visible")),$(this).slimScroll({wrapperClass:$(this).attr("data-wrapper-class")?$(this).attr("data-wrapper-class"):"slimScrollDiv",destroy:!0});var b=$(this);$.each(a,function(a,c){b.attr(a,c)})}})},scrollTop:function(){Metronic.scrollTo()},blockUI:function(a){a=$.extend(!0,{},a);var b="";if(b=a.animate?'<div class="loading-message '+(a.boxed?"loading-message-boxed":"")+'"><div class="block-spinner-bar"><div class="bounce1"></div><div class="bounce2"></div><div class="bounce3"></div></div></div>':a.iconOnly?'<div class="loading-message '+(a.boxed?"loading-message-boxed":"")+'"><img src="'+this.getGlobalImgPath()+'loading-spinner-blue.gif" align=""></div>':a.textOnly?'<div class="loading-message '+(a.boxed?"loading-message-boxed":"")+'"><span>&nbsp;&nbsp;'+(a.message?a.message:"LOADING...")+"</span></div>":'<div class="loading-message '+(a.boxed?"loading-message-boxed":"")+'"><img src="'+this.getGlobalImgPath()+'loading-spinner-blue.gif" align=""><span>&nbsp;&nbsp;'+(a.message?a.message:"LOADING...")+"</span></div>",a.target){var c=$(a.target);c.height()<=$(window).height()&&(a.cenrerY=!0),c.block({message:b,baseZ:a.zIndex?a.zIndex:1e3,centerY:void 0!==a.cenrerY?a.cenrerY:!1,css:{top:"10%",border:"0",padding:"0",backgroundColor:"none"},overlayCSS:{backgroundColor:a.overlayColor?a.overlayColor:"#555",opacity:a.boxed?.05:.1,cursor:"wait"}})}else $.blockUI({message:b,baseZ:a.zIndex?a.zIndex:1e3,css:{border:"0",padding:"0",backgroundColor:"none"},overlayCSS:{backgroundColor:a.overlayColor?a.overlayColor:"#555",opacity:a.boxed?.05:.1,cursor:"wait"}})},unblockUI:function(a){a?$(a).unblock({onUnblock:function(){$(a).css("position",""),$(a).css("zoom","")}}):$.unblockUI()},startPageLoading:function(a){a&&a.animate?($(".page-spinner-bar").remove(),$("body").append('<div class="page-spinner-bar"><div class="bounce1"></div><div class="bounce2"></div><div class="bounce3"></div></div>')):($(".page-loading").remove(),$("body").append('<div class="page-loading"><img src="'+this.getGlobalImgPath()+'loading-spinner-blue.gif"/>&nbsp;&nbsp;<span>'+(a&&a.message?a.message:"Loading...")+"</span></div>"))},stopPageLoading:function(){$(".page-loading, .page-spinner-bar").remove()},alert:function(a){a=$.extend(!0,{container:"",place:"append",type:"success",message:"",close:!0,reset:!0,focus:!0,closeInSeconds:0,icon:""},a);var b=Metronic.getUniqueID("Metronic_alert"),c='<div id="'+b+'" class="Metronic-alerts alert alert-'+a.type+' fade in">'+(a.close?'<button type="button" class="close" data-dismiss="alert" aria-hidden="true"></button>':"")+(""!==a.icon?'<i class="fa-lg fa fa-'+a.icon+'"></i>  ':"")+a.message+"</div>";return a.reset&&$(".Metronic-alerts").remove(),a.container?"append"==a.place?$(a.container).append(c):$(a.container).prepend(c):$("body").hasClass("page-container-bg-solid")?$(".page-title").after(c):$(".page-bar").size()>0?$(".page-bar").after(c):$(".page-breadcrumb").after(c),a.focus&&Metronic.scrollTo($("#"+b)),a.closeInSeconds>0&&setTimeout(function(){$("#"+b).remove()},1e3*a.closeInSeconds),b},initUniform:function(a){a?$(a).each(function(){0===$(this).parents(".checker").size()&&($(this).show(),$(this).uniform())}):p()},updateUniform:function(a){$.uniform.update(a)},initFancybox:function(){C()},getActualVal:function(a){return a=$(a),a.val()===a.attr("placeholder")?"":a.val()},getURLParameter:function(a){var b,c,d=window.location.search.substring(1),e=d.split("&");for(b=0;b<e.length;b++)if(c=e[b].split("="),c[0]==a)return unescape(c[1]);return null},isTouchDevice:function(){try{return document.createEvent("TouchEvent"),!0}catch(a){return!1}},getViewPort:function(){var a=window,b="inner";return"innerWidth"in window||(b="client",a=document.documentElement||document.body),{width:a[b+"Width"],height:a[b+"Height"]}},getUniqueID:function(a){return"prefix_"+Math.floor(Math.random()*(new Date).getTime())},isIE8:function(){return c},isIE9:function(){return d},isRTL:function(){return b},isAngularJsApp:function(){return"undefined"==typeof angular?!1:!0},getAssetsPath:function(){return g},setAssetsPath:function(a){g=a},setGlobalImgPath:function(a){h=a},getGlobalImgPath:function(){return g+h},setGlobalPluginsPath:function(a){i=a},getGlobalPluginsPath:function(){return g+i},getGlobalCssPath:function(){return g+j},getBrandColor:function(a){return k[a]?k[a]:""},getResponsiveBreakpoint:function(a){var b={xs:480,sm:768,md:900,lg:1200};return b[a]?b[a]:0}}}(),Layout=function(){var a="img/",b="css/",c=Metronic.getResponsiveBreakpoint("md"),d=function(){var a,b=$(".page-content"),d=$(".page-sidebar"),e=$("body");if(e.hasClass("page-footer-fixed")===!0&&e.hasClass("page-sidebar-fixed")===!1){var f=Metronic.getViewPort().height-$(".page-footer").outerHeight()-$(".page-header").outerHeight();b.height()<f&&b.attr("style","min-height:"+f+"px")}else{if(e.hasClass("page-sidebar-fixed"))a=g(),e.hasClass("page-footer-fixed")===!1&&(a-=$(".page-footer").outerHeight());else{var h=$(".page-header").outerHeight(),i=$(".page-footer").outerHeight();a=Metronic.getViewPort().width<c?Metronic.getViewPort().height-h-i:d.height()+20,a+h+i<=Metronic.getViewPort().height&&(a=Metronic.getViewPort().height-h-i)}b.attr("style","min-height:"+a+"px")}},e=function(a,b){var d=location.hash.toLowerCase(),e=$(".page-sidebar-menu");if("click"===a||"set"===a?b=$(b):"match"===a&&e.find("li > a").each(function(){var a=$(this).attr("href").toLowerCase();return a.length>1&&d.substr(1,a.length-1)==a.substr(1)?void(b=$(this)):void 0}),b&&0!=b.size()&&"javascript:;"!==b.attr("href").toLowerCase()&&"#"!==b.attr("href").toLowerCase()){parseInt(e.data("slide-speed")),e.data("keep-expanded");e.find("li.active").removeClass("active"),e.find("li > a > .selected").remove(),e.hasClass("page-sidebar-menu-hover-submenu")===!1?e.find("li.open").each(function(){0===$(this).children(".sub-menu").size()&&($(this).removeClass("open"),$(this).find("> a > .arrow.open").removeClass("open"))}):e.find("li.open").removeClass("open"),b.parents("li").each(function(){$(this).addClass("active"),$(this).find("> a > span.arrow").addClass("open"),1===$(this).parent("ul.page-sidebar-menu").size()&&$(this).find("> a").append('<span class="selected"></span>'),1===$(this).children("ul.sub-menu").size()&&$(this).addClass("open")}),"click"===a&&Metronic.getViewPort().width<c&&$(".page-sidebar").hasClass("in")&&$(".page-header .responsive-toggler").click()}},f=function(){jQuery(".page-sidebar").on("click","li > a",function(a){var b=$(this).next().hasClass("sub-menu");if(!(Metronic.getViewPort().width>=c&&1===$(this).parents(".page-sidebar-menu-hover-submenu").size())){if(b===!1)return void(Metronic.getViewPort().width<c&&$(".page-sidebar").hasClass("in")&&$(".page-header .responsive-toggler").click());if(!$(this).next().hasClass("sub-menu always-open")){var e=$(this).parent().parent(),f=$(this),g=$(".page-sidebar-menu"),h=jQuery(this).next(),i=g.data("auto-scroll"),j=parseInt(g.data("slide-speed")),k=g.data("keep-expanded");k!==!0&&(e.children("li.open").children("a").children(".arrow").removeClass("open"),e.children("li.open").children(".sub-menu:not(.always-open)").slideUp(j),e.children("li.open").removeClass("open"));var l=-200;h.is(":visible")?(jQuery(".arrow",jQuery(this)).removeClass("open"),jQuery(this).parent().removeClass("open"),h.slideUp(j,function(){i===!0&&$("body").hasClass("page-sidebar-closed")===!1&&($("body").hasClass("page-sidebar-fixed")?g.slimScroll({scrollTo:f.position().top}):Metronic.scrollTo(f,l)),d()})):b&&(jQuery(".arrow",jQuery(this)).addClass("open"),jQuery(this).parent().addClass("open"),h.slideDown(j,function(){i===!0&&$("body").hasClass("page-sidebar-closed")===!1&&($("body").hasClass("page-sidebar-fixed")?g.slimScroll({scrollTo:f.position().top}):Metronic.scrollTo(f,l)),d()})),a.preventDefault()}}}),jQuery(".page-sidebar").on("click"," li > a.ajaxify",function(a){a.preventDefault(),Metronic.scrollTop();var b=$(this).attr("href"),d=jQuery(".page-sidebar ul"),e=($(".page-content"),$(".page-content .page-content-body"));d.children("li.active").removeClass("active"),d.children("arrow.open").removeClass("open"),$(this).parents("li").each(function(){$(this).addClass("active"),$(this).children("a > span.arrow").addClass("open")}),$(this).parents("li").addClass("active"),Metronic.getViewPort().width<c&&$(".page-sidebar").hasClass("in")&&$(".page-header .responsive-toggler").click(),Metronic.startPageLoading();var f=$(this);$.ajax({type:"GET",cache:!1,url:b,dataType:"html",success:function(a){0===f.parents("li.open").size()&&$(".page-sidebar-menu > li.open > a").click(),Metronic.stopPageLoading(),e.html(a),Layout.fixContentHeight(),Metronic.initAjax()},error:function(a,b,c){Metronic.stopPageLoading(),e.html("<h4>Could not load the requested content.</h4>")}})}),jQuery(".page-content").on("click",".ajaxify",function(a){a.preventDefault(),Metronic.scrollTop();var b=$(this).attr("href"),d=($(".page-content"),$(".page-content .page-content-body"));Metronic.startPageLoading(),Metronic.getViewPort().width<c&&$(".page-sidebar").hasClass("in")&&$(".page-header .responsive-toggler").click(),$.ajax({type:"GET",cache:!1,url:b,dataType:"html",success:function(a){Metronic.stopPageLoading(),d.html(a),Layout.fixContentHeight(),Metronic.initAjax()},error:function(a,b,c){d.html("<h4>Could not load the requested content.</h4>"),Metronic.stopPageLoading()}})}),i(),$(".page-sidebar").on("click",".sidebar-search .remove",function(a){a.preventDefault(),$(".sidebar-search").removeClass("open")}),$(".page-sidebar .sidebar-search").on("keypress","input.form-control",function(a){return 13==a.which?($(".sidebar-search").submit(),!1):void 0}),0!==$(".sidebar-search").size()&&($(".sidebar-search .input-group").on("click",function(a){a.stopPropagation()}),$("body").on("click",function(){$(".sidebar-search").hasClass("open")&&$(".sidebar-search").removeClass("open")}))},g=function(){var a=Metronic.getViewPort().height-$(".page-header").outerHeight();return $("body").hasClass("page-footer-fixed")&&(a-=$(".page-footer").outerHeight()),a},h=function(){var a=$(".page-sidebar-menu");return Metronic.destroySlimScroll(a),0===$(".page-sidebar-fixed").size()?void d():void(Metronic.getViewPort().width>=c&&(a.attr("data-height",g()),Metronic.initSlimScroll(a),d()))},i=function(){var a=$("body");a.hasClass("page-sidebar-fixed")&&$(".page-sidebar").on("mouseenter",function(){a.hasClass("page-sidebar-closed")&&$(this).find(".page-sidebar-menu").removeClass("page-sidebar-menu-closed")}).on("mouseleave",function(){a.hasClass("page-sidebar-closed")&&$(this).find(".page-sidebar-menu").addClass("page-sidebar-menu-closed")})},j=function(){$("body");$.cookie&&"1"===$.cookie("sidebar_closed")&&Metronic.getViewPort().width>=c?($("body").addClass("page-sidebar-closed"),$(".page-sidebar-menu").addClass("page-sidebar-menu-closed")):$.cookie&&$.cookie("sidebar_closed","0")},k=function(){$(".page-header").on("click",'.hor-menu a[data-toggle="tab"]',function(a){a.preventDefault();var b=$(".hor-menu .nav"),c=b.find("li.current");$("li.active",c).removeClass("active"),$(".selected",c).remove();var d=$(this).parents("li").last();d.addClass("current"),d.find("a:first").append('<span class="selected"></span>')}),$(".page-header").on("click",".search-form",function(a){$(this).addClass("open"),$(this).find(".form-control").focus(),$(".page-header .search-form .form-control").on("blur",function(a){$(this).closest(".search-form").removeClass("open"),$(this).unbind("blur")})}),$(".page-header").on("keypress",".hor-menu .search-form .form-control",function(a){return 13==a.which?($(this).closest(".search-form").submit(),!1):void 0}),$(".page-header").on("mousedown",".search-form.open .submit",function(a){a.preventDefault(),a.stopPropagation(),$(this).closest(".search-form").submit()}),$('[data-hover="megamenu-dropdown"]').not(".hover-initialized").each(function(){$(this).dropdownHover(),$(this).addClass("hover-initialized")}),$(document).on("click",".mega-menu-dropdown .dropdown-menu",function(a){a.stopPropagation()})},l=function(){$("body").on("shown.bs.tab",'a[data-toggle="tab"]',function(){d()})},m=function(){var a=300,b=500;navigator.userAgent.match(/iPhone|iPad|iPod/i)?$(window).bind("touchend touchcancel touchleave",function(c){$(this).scrollTop()>a?$(".scroll-to-top").fadeIn(b):$(".scroll-to-top").fadeOut(b)}):$(window).scroll(function(){$(this).scrollTop()>a?$(".scroll-to-top").fadeIn(b):$(".scroll-to-top").fadeOut(b)}),$(".scroll-to-top").click(function(a){return a.preventDefault(),$("html, body").animate({scrollTop:0},b),!1})},n=function(){var a,b=$(".full-height-content");if(a=Metronic.getViewPort().height-$(".page-header").outerHeight(!0)-$(".page-footer").outerHeight(!0)-$(".page-title").outerHeight(!0)-$(".page-bar").outerHeight(!0),b.hasClass("portlet")){var d=b.find(".portlet-body");if(Metronic.getViewPort().width<c)return void Metronic.destroySlimScroll(d.find(".full-height-content-body"));a=a-b.find(".portlet-title").outerHeight(!0)-parseInt(b.find(".portlet-body").css("padding-top"))-parseInt(b.find(".portlet-body").css("padding-bottom"))-2,b.hasClass("full-height-content-scrollable")?(a-=35,d.find(".full-height-content-body").css("height",a),Metronic.initSlimScroll(d.find(".full-height-content-body"))):d.css("min-height",a)}else{if(Metronic.getViewPort().width<c)return void Metronic.destroySlimScroll(b.find(".full-height-content-body"));b.hasClass("full-height-content-scrollable")?(a-=35,b.find(".full-height-content-body").css("height",a),Metronic.initSlimScroll(b.find(".full-height-content-body"))):b.css("min-height",a)}};return{initHeader:function(){k()},setSidebarMenuActiveLink:function(a,b){e(a,b)},initSidebar:function(){h(),f(),j(),Metronic.isAngularJsApp()&&e("match"),Metronic.addResizeHandler(h)},initContent:function(){n(),l(),Metronic.addResizeHandler(d),Metronic.addResizeHandler(n)},initFooter:function(){m()},init:function(){this.initHeader(),this.initSidebar(),this.initContent(),this.initFooter()},fixContentHeight:function(){d()},initFixedSidebarHoverEffect:function(){i()},initFixedSidebar:function(){h()},getLayoutImgPath:function(){return Metronic.getAssetsPath()+a},getLayoutCssPath:function(){return Metronic.getAssetsPath()+b}}}();angular.module("xCallyShuttleApp").run(["$templateCache",function(a){a.put("app/analytic/extracted/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="fa fa-file-pdf-o"></i>\n					<a href="/analytics/extracted/list">{{ \'APPLICATION_EXTRACTED_REPORTS\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="fa fa-file-pdf-o font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_EXTRACTED_REPORTS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<!-- <a class="btn btn-icon-only btn-default fullscreen" href="#"></a> -->\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n\n<!-- END PAGE CONTENT-->\n'),a.put("app/analytic/metric/list/create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_METRIC\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="forms.metric" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (forms.metric.name.$touched || forms.metric.$submitted) && forms.metric.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n      <span data-ng-show="(forms.metric.name.$touched || forms.metric.$submitted) && forms.metric.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n    <!-- START TABLE -->\n    <div class="form-group" data-ng-class="{\'has-error\': (forms.metric.table.$touched || forms.metric.$submitted) && forms.metric.table.$invalid}">\n      <label class="control-label">{{\'APPLICATION_TABLE\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <ui-select data-ng-model="item.table" name="table" theme="bootstrap" required>\n        <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n        <ui-select-choices repeat="table.value as table in tables | filter: $select.search">\n          <div ng-bind-html="table.name | highlight: $select.search"></div>\n        </ui-select-choices>\n      </ui-select>\n      <span data-ng-show="(forms.metric.table.$touched || forms.metric.$submitted) && forms.metric.table.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END TABLE-->\n\n    <!-- START METRIC -->\n    <div class="form-group" data-ng-class="{\'has-error\': (forms.metric.metric.$touched || forms.metric.$submitted) && forms.metric.metric.$invalid}">\n      <label class="control-label">{{\'APPLICATION_METRIC\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <textarea type="text" name="metric" placeholder="{{\'APPLICATION_METRIC\' | translate}}" class="form-control" data-ng-model="item.metric" required/></textarea>\n      <span data-ng-show="(forms.metric.metric.$touched || forms.metric.$submitted) && forms.metric.metric.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END METRIC -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="metric.description"></textarea>\n    </div>\n    <!-- END DESCRIPTION -->\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="ok()" ng-disabled="forms.metric.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/analytic/metric/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-calculator"></i>\n					<a href="/analytics/metrics/list">{{ \'APPLICATION_METRICS\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-calculator font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_METRICS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<button class="btn green-jungle " ng-click="create()">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_METRIC\' | translate }}\n						</button>\n					</div>\n					<!-- <a class="btn btn-icon-only btn-default fullscreen" href="#"></a> -->\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/analytic/metric/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getMetric()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-eye"></i>\n					<a href="/analytics/metrics/list">{{ \'APPLICATION_METRICS\' | translate }}</a>\n					<i data-ng-show="metric" class="fa fa-angle-right"></i>\n				</li>\n				<li data-ng-show="metric">\n					<a href="#">{{metric.name}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/metric.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{metric.name}}\n					</div>\n					<!-- <div class="profile-usertitle-job">\n						{{user.role}}\n					</div> -->\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.analytics.metrics.view.settings\')}">\n							<a data-ng-href="/analytics/metrics/view/{{metric.id}}/settings">\n							<i class="icon-settings"></i>\n							{{ \'APPLICATION_SETTINGS\' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/analytic/metric/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_METRIC\' | translate}} {{ \'APPLICATION_SETTINGS\' | translate}} </span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_GENERAL\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.general" data-ng-submit="forms.general.$valid && updateMetric()" novalidate>\n\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="metric.name" required/>\n								<span data-ng-show="(forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<!-- START TABLE -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.table.$touched || forms.general.$submitted) && forms.general.table.$invalid}">\n								<label class="control-label">{{\'APPLICATION_TABLE\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="metric.table" name="table" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n									<ui-select-choices repeat="table.value as table in tables | filter: $select.search">\n										<div ng-bind-html="table.name | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span data-ng-show="(forms.general.table.$touched || forms.general.$submitted) && forms.general.table.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END TABLE-->\n\n							<!-- START METRIC -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.metric.$touched || forms.general.$submitted) && forms.general.metric.$invalid}">\n								<label class="control-label">{{\'APPLICATION_METRIC\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<textarea type="text" name="metric" placeholder="{{\'APPLICATION_METRIC\' | translate}}" class="form-control" data-ng-model="metric.metric" required/></textarea>\n								<span data-ng-show="(forms.general.metric.$touched || forms.general.$submitted) && forms.general.metric.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END METRIC -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="metric.description"></textarea>\n							</div>\n							<!-- END DESCRIPTION -->\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END ADVANCED TAB -->\n\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),
+a.put("app/analytic/report/list/copy.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_COPY_REPORT\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <div class="portlet light bordered">\n    <div class="portlet-title">\n      <div class="caption font-green-sharp" style="padding-left:10px;">\n        <i class="icon-folder font-green-sharp"></i>\n        <span class="caption-subject">{{ \'APPLICATION_COPY_TO\' | translate }} </span>\n      </div>\n    </div>\n    <div class="portlet-body">\n      <div js-tree="customTreeConfig" ng-model="customTreeData" should-apply="ac()" tree="customTreeInstance" tree-events="ready:initCustomScopeTree;"></div>\n    </div>\n  </div>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" data-ng-disabled="!customTree.get_selected(true).pop().id" ng-click="ok()" ng-disabled="forms.report.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/analytic/report/list/create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_REPORT\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="forms.report" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (forms.report.name.$touched || forms.report.$submitted) && forms.report.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n      <span data-ng-show="(forms.report.name.$touched || forms.report.$submitted) && forms.report.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n    </div>\n    <!-- END DESCRIPTION -->\n\n    <div class="form-group" data-ng-class="{\'has-error\': (forms.report.name.$touched || forms.report.$submitted) && forms.report.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_PATH\' | translate}}<span class="required" aria-required="true"></span></label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_PATH\' | translate}}" class="form-control" data-ng-model="path" disabled/>\n      <span data-ng-show="(forms.report.name.$touched || forms.report.$submitted) && forms.report.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="ok()" ng-disabled="forms.report.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/analytic/report/list/extract.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_EXTRACT_REPORT\' | translate }}</h3>\n</div>\n<div class="modal-body" style="text-align:center;">\n  <form name="forms.report" class="form-inline mbottom20" novalidate>\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DATE_RANGE\' | translate}}<span class="required" aria-required="true"></span></label>\n      <input type="daterange" name="dates" ranges="ranges" placeholder="{{\'APPLICATION_DATE_RANGE\' | translate}}" class="form-control" data-ng-model="dates" required/>\n    </div>\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn default green-jungle" type="button" data-ng-click="extract(\'csv\')"><i class="fa fa-file-excel-o"></i> {{ \'APPLICATION_SAVE_AS_CSV\' | translate }}</button>\n  <button class="btn default red-intense" type="button" data-ng-click="extract(\'pdf\')"><i class="fa fa-file-pdf-o"></i> {{ \'APPLICATION_SAVE_AS_PDF\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/analytic/report/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getTrees()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-book-open"></i>\n					<a href="/analytics/reports/list">{{ \'APPLICATION_REPORTS\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n		<div class="col-fixed">\n			<!-- BEGIN Portlet PORTLET-->\n			<div class="portlet light bordered">\n				<div class="portlet-title">\n					<div class="caption font-green-sharp" style="padding-left:10px;">\n						<i class="icon-folder font-green-sharp"></i>\n						<span class="caption-subject">{{ \'APPLICATION_FOLDERS\' | translate }} </span>\n					</div>\n					<div class="inputs">\n						<div class="portlet-input input-inline input-small">\n							<div class="input-icon right">\n								<i class="icon-magnifier"></i>\n								<input type="text" data-ng-model="searchField" data-ng-change="searchTrees()" class="form-control input-circle" placeholder="search...">\n							</div>\n						</div>\n					</div>\n				</div>\n				<div class="portlet-body">\n					<div js-tree="defaultTreeConfig" ng-model="defaultTreeData" should-apply="ac()" tree="defaultTreeInstance" tree-events="ready:initDefaultScopeTree;select_node:selectDefaultNode;"></div>\n					<div js-tree="customTreeConfig" ng-model="customTreeData" should-apply="ac()" tree="customTreeInstance" tree-events="ready:initCustomScopeTree;select_node:selectCustomNode;rename_node:updateCustomTree;delete_node:updateCustomTree;move_node:updateCustomTree;create_node:updateCustomTree;"></div>\n				</div>\n			</div>\n			<!-- END Portlet PORTLET-->\n		</div>\n		<div class="row tree-row">\n			<div class="col-md-12">\n				<!-- BEGIN Portlet PORTLET-->\n				<div class="portlet light bordered">\n					<div class="portlet-title">\n						<div class="caption font-green-sharp">\n							<i class="icon-book-open font-green-sharp"></i>\n							<span class="caption-subject">{{ \'APPLICATION_REPORTS\' | translate }}<span data-ng-if="selectedNode"> - {{selectedNode}}</span></span>\n						</div>\n						<div data-ng-if="!defaultTreeActive" class="actions">\n							<div class="btn-group" data-ng-show="id.length">\n								<a class="btn red" href="#" data-ng-click="deleteItems()">\n									<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n								</a>\n							</div>\n							<div class="btn-group">\n								<span class="btn default btn-file">\n								<span class="fileinput-new">\n								<i class="icon-cloud-upload"></i> {{\'APPLICATION_IMPORT_FROM_JSON\' | translate}}</span>\n								<input type="file" on-read-file="import($fileContent)"/>\n								</span>\n							</div>\n							<div class="btn-group">\n								<button class="btn green-jungle " ng-click="create()">\n									<i class="icon-plus"></i> {{ \'APPLICATION_NEW_REPORT\' | translate }}\n								</button>\n							</div>\n						</div>\n					</div>\n					<div class="portlet-body">\n						<div ng-slide-down="gridOptions" lazy-render duration="1">\n						<!-- START TABLE -->\n						<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n							<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n						</div>\n						<!-- END TABLE -->\n					</div>\n					</div>\n				</div>\n				<!-- END Portlet PORTLET-->\n			</div>\n		</div>\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/analytic/report/list/preview.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_REPORT_PREVIEW\' | translate }}</h3>\n</div>\n<div class="modal-body" style="text-align:center;">\n  <form name="forms.report" class="form-inline mbottom20" novalidate>\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DATE_RANGE\' | translate}}<span class="required" aria-required="true"></span></label>\n      <input type="daterange" name="dates" ranges="ranges" placeholder="{{\'APPLICATION_DATE_RANGE\' | translate}}" class="form-control" data-ng-model="dates" data-ng-change="getPage()" required/>\n    </div>\n  </form>\n  <div ng-slide-down="showResult" lazy-render duration="1">\n    <div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-exporter class="grid extract-grid">\n      <div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n    </div>\n  </div>\n</div>\n<div class="modal-footer">\n<button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CLOSE\' | translate }}</button>\n</div>\n'),a.put("app/analytic/report/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getReport()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-book-open"></i>\n					<a href="/analytics/reports/list">{{ \'APPLICATION_REPORTS\' | translate }}</a>\n					<i data-ng-show="report" class="fa fa-angle-right"></i>\n				</li>\n				<li data-ng-show="report">\n					<a href="#">{{report.name}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/report.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{report.name}}\n					</div>\n					<!-- <div class="profile-usertitle-job">\n						{{user.role}}\n					</div> -->\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.analytics.reports.view.settings\')}">\n							<a data-ng-href="/analytics/reports/view/{{report.id}}/settings">\n							<i class="icon-settings"></i>\n							{{ \'APPLICATION_SETTINGS\' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/analytic/report/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_REPORT\' | translate}} {{ \'APPLICATION_SETTINGS\' | translate}} </span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li>\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_GENERAL\' | translate}}</a>\n					</li>\n					<li class="active">\n						<a href="#" data-target="#tab_1_2" data-toggle="tab">{{ \'APPLICATION_BUILD\' | translate}}</a>\n					</li>\n					<li>\n						<a href="#" data-target="#tab_1_3" data-toggle="tab" data-ng-click="showResult = true">{{ \'APPLICATION_TEST_PREVIEW\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n\n			<div class="portlet-body">\n\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane" id="tab_1_1">\n						<form name="forms.general" data-ng-submit="forms.report.$valid && forms.general.$valid && updateReport()" novalidate>\n\n\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="report.name" required/>\n								<span data-ng-show="(forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="report.description"></textarea>\n							</div>\n							<!-- END DESCRIPTION -->\n\n							<!-- START TABLE INPUT -->\n\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n\n					</div>\n					<!-- END GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_2">\n						<form name="forms.report" data-ng-submit="forms.report.$valid && forms.general.$valid && updateReport()" novalidate>\n						<div class="form-group" data-ng-class="{\'has-error\': (forms.report.table.$touched || forms.report.$submitted) && forms.report.table.$invalid}">\n							<label class="control-label">{{\'APPLICATION_TABLE\' | translate}}<span class="required" aria-required="true">*</span></label>\n							<ui-select data-ng-model="report.table" name="table" theme="bootstrap" required>\n								<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n								<ui-select-choices repeat="table.table as table in tables | filter: $select.search">\n									<div ng-bind-html="table.name | highlight: $select.search"></div>\n								</ui-select-choices>\n							</ui-select>\n							<span class="help-block">\n							</span>\n							<span data-ng-show="(forms.report.table.$touched || forms.report.$submitted) && forms.report.table.$error.required" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n						</div>\n						<!-- END TABLE INPUT-->\n						<div data-ng-if="report.table" class="mbottom20 pbottom20">\n						<div class="portlet-title tabbable-line">\n							<div class="caption caption-md">\n								<i class="icon-globe theme-font hide"></i>\n								<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_FIELDS\' | translate}} </span>\n							</div>\n						</div>\n								<!-- START TABLE -->\n								<table class="table table-striped table-bordered table-hover">\n									<thead>\n										<tr>\n											<th>{{ \'APPLICATION_FIELD\' | translate }} / {{ \'APPLICATION_METRIC\' | translate }}</th>\n											<th>{{ \'APPLICATION_ALIAS\' | translate }}</th>\n											<th>{{ \'APPLICATION_FUNCTION\' | translate }}</th>\n											<th>{{ \'APPLICATION_GROUP_BY\' | translate }}</th>\n											<th>{{ \'APPLICATION_ORDER_BY\' | translate }}</th>\n											<th></th>\n											<th></th>\n										</tr>\n									</thead>\n										<tbody ui-sortable="sortableOptions" data-ng-model="report.Fields">\n											<tr data-ng-repeat="field in report.Fields">\n												<td>\n													<!-- START FIELD -->\n													<div class="form-group" data-ng-class="{\'has-error\': forms.report.$submitted && !field.field}">\n														<!-- <label class="control-label">{{\'APPLICATION_FIELD\' | translate}}<span class="required" aria-required="true">*</span></label> -->\n														<ui-select data-ng-model="field.field" dynamic-name="randomName()" theme="bootstrap" on-select="setMetricId($item,$index)" required>\n															<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}"><span ng-bind-html="$select.selected.name"></span></ui-select-match>\n															<ui-select-choices repeat="tableField.value as tableField in tableFields | filter: $select.search">\n																<div ng-bind-html="tableField.name | highlight: $select.search"></div>\n															</ui-select-choices>\n														</ui-select>\n														<span data-ng-show="forms.report.$submitted && !field.field" class="help-block help-block-error">\n															<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n														</span>\n													</div>\n													<!-- END FIELD-->\n												</td>\n												<td>\n													<!-- START ALIAS -->\n													<div class="form-group" data-ng-class="{\'has-error\': forms.report.$submitted && !field.alias}">\n														<!-- <label class="control-label">{{\'APPLICATION_ALIAS\' | translate}}<span class="required" aria-required="true">*</span></label> -->\n														<input type="text" dynamic-name="randomName()" placeholder="{{\'APPLICATION_ALIAS\' | translate}}" class="form-control" data-ng-model="field.alias" required/>\n														<span data-ng-show="forms.report.$submitted && !field.alias" class="help-block help-block-error">\n															<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n														</span>\n													</div>\n													<!-- END ALIAS -->\n												</td>\n												<td>\n													<!-- START FUNCTION -->\n													<div class="form-group">\n														<!-- <label class="control-label">{{\'APPLICATION_FIELD\' | translate}}<span class="required" aria-required="true">*</span></label> -->\n														<ui-select data-ng-model="field.function" name="function" theme="bootstrap">\n															<ui-select-match placeholder="{{\'APPLICATION_FUNCTION\' | translate}}" allow-clear>{{$select.selected.name}}</ui-select-match>\n															<ui-select-choices repeat="function.value as function in functions | filter: $select.search">\n																<div ng-bind-html="function.name | highlight: $select.search"></div>\n															</ui-select-choices>\n														</ui-select>\n													</div>\n													<!-- END FUNCTION-->\n												</td>\n												<td>\n													<!-- START GROUP_BY -->\n													<div class="form-group">\n														<!-- <label class="control-label">{{\'APPLICATION_FIELD\' | translate}}<span class="required" aria-required="true">*</span></label> -->\n														<ui-select data-ng-model="field.groupBy" name="groupBy" theme="bootstrap" required>\n															<ui-select-match placeholder="{{\'APPLICATION_GROUP_BY\' | translate}}">{{$select.selected.name | translate}}</ui-select-match>\n															<ui-select-choices repeat="groupBy.value as groupBy in groupByField | filter: $select.search">\n																{{$translate.instant(groupBy.name)}}\n															</ui-select-choices>\n														</ui-select>\n													</div>\n													<!-- END GROUP_BY-->\n												</td>\n												<td>\n													<!-- START ORDER_BY -->\n													<div class="form-group">\n														<!-- <label class="control-label">{{\'APPLICATION_FIELD\' | translate}}<span class="required" aria-required="true">*</span></label> -->\n														<ui-select data-ng-model="field.orderBy" name="orderBy" theme="bootstrap">\n															<ui-select-match placeholder="{{\'APPLICATION_ORDER_BY\' | translate}}" allow-clear>{{$select.selected}}</ui-select-match>\n															<ui-select-choices repeat="orderBy in [\'ASC\',\'DESC\'] | filter: $select.search">\n																<div ng-bind-html="orderBy | highlight: $select.search"></div>\n															</ui-select-choices>\n														</ui-select>\n													</div>\n													<!-- END TABLE INPUT-->\n												</td>\n												<td class="report-field-remove">\n													<button class="btn red" type="button" data-ng-click="removeField($index)"><i class="fa fa-times"></i></button>\n												</td>\n												<td class="report-field-handle">\n													<!-- <img data-ng-src="assets/images/move.png" class="img-responsive"> -->\n												</td>\n											</tr>\n											<tr data-ng-hide="report.Fields.length" class="unsortable">\n												<td colspan="7" style="text-align:center;">\n													<i>{{ \'MESSAGE_ADD_A_FIELD\' | translate }}</i>\n												</td>\n											</tr>\n										</tbody>\n								</table>\n								<button type="button" class="btn btn-sm green padding-bottom" ng-click="addField()">\n									<i class="fa fa-plus"></i> {{\'APPLICATION_ADD_FIELD\' | translate}}\n								</button>\n								<!-- END TABLE -->\n							</div>\n								<div data-ng-if="report.Fields.length" class="mbottom20 pbottom20">\n									<div class="portlet-title tabbable-line">\n										<div class="caption caption-md">\n											<i class="icon-globe theme-font hide"></i>\n											<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_CONDITIONS\' | translate}} </span>\n										</div>\n									</div>\n									<div class="alert alert-info">\n											<strong>Output</strong><br>\n											<span ng-bind-html="output"></span>\n									</div>\n\n									<report-builder group="report.conditions.group" fields="report.Fields" forms="forms" firstCall=\'true\'></report-builder>\n								</div>\n								<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n								</form>\n					</div>\n					<div class="tab-pane" id="tab_1_3">\n						<div ng-slide-down="showResult" lazy-render duration="0.5">\n							<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-move-columns class="grid">\n								<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n							</div>\n						</div>\n					</div>\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/channels/chat/offline/list/list.html",'<div class="row">\n	<div class="col-md-12">\n			<div class="page-bar">\n				<ul class="page-breadcrumb">\n					<li>\n						<i class="icon-rocket"></i>\n						<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-puzzle"></i>\n						<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-bubble"></i>\n						<a href="#">{{ \'APPLICATION_CHAT\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-login"></i>\n						<a href="/channels/chat/offline/list">Offline</a>\n					</li>\n				</ul>\n			</div>\n		</div>\n</div>\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-question font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_VISITORS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/chat/offline/view/view.detail.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_DETAIL\' | translate}}</span>\n				</div>\n			</div>\n			<div class="portlet-body row" data-ng-init="initView()">\n				<div class="col-md-6">\n					<div class="news-blocks">\n						<h3>\n							<a href="#" class="inactive-link">{{\'APPLICATION_MESSAGE\' | translate}}</a>\n							<hr>\n						</h3>\n						<div class="news-block-tags">\n							<em am-time-ago="chatVisitor.ChatEnquiry.createdAt"></em>\n						</div>\n						<p>\n							{{chatVisitor.ChatEnquiry.text}}\n						</p>\n					</div>\n				</div>\n				<div class="col-md-6">\n					<div class="news-blocks">\n						<h3>\n							<a href="#" class="inactive-link">{{\'APPLICATION_VISITOR\' | translate}}</a>\n							<hr>\n						</h3>\n						<div class="margin-top-20 profile-desc-link">\n							<i class="icon-user"></i>\n							<a href="#" class="inactive-link">{{chatVisitor.fullname}}</a>\n						</div>\n						<div class="margin-top-20 profile-desc-link">\n							<i class="icon-envelope"></i>\n							<a href="#" class="inactive-link">{{chatVisitor.email}}</a>\n						</div>\n						<div class="margin-top-20 profile-desc-link">\n							<i class="icon-globe"></i>\n							<a href="#" class="inactive-link">{{chatVisitor.remote_address}}</a>\n						</div>\n						<div class="margin-top-20 profile-desc-link">\n							<i class="icon-home"></i>\n							<a href="#" class="inactive-link">{{chatVisitor.referer}} - {{chatVisitor.ChatWebsite.name}}</a>\n						</div>\n						<div class="margin-top-20 profile-desc-link">\n							<i class="icon-cursor"></i>\n							<a href="#" class="inactive-link">{{chatVisitor.browser}}</a>\n						</div>\n						<div class="margin-top-20 profile-desc-link">\n							<i class="icon-screen-desktop"></i>\n							<a href="#" class="inactive-link">{{chatVisitor.os}}</a>\n						</div>\n					</div>\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/channels/chat/offline/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-puzzle"></i>\n					<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-bubble"></i>\n					<a href="#">{{ \'APPLICATION_CHAT\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-login"></i>\n					<a href="/channels/chat/offline/list">Offline</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/enquiry.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- START USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{chatVisitor.ChatEnquiry.email}}\n					</div>\n					<div class="profile-usertitle-job">\n						{{chatVisitor.ChatEnquiry.username}}\n					</div>\n				</div>\n				<!-- END USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.channels.chat.offline.view.detail\')}">\n							<a data-ng-href="/channels/chat/offline/view/{{chatVisitor.id}}/detail">\n							<i class="icon-tag"></i>\n							{{ \'APPLICATION_DETAIL\' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/chat/online/list/list.html",'<div class="row">\n	<div class="col-md-12">\n			<div class="page-bar">\n				<ul class="page-breadcrumb">\n					<li>\n						<i class="icon-rocket"></i>\n						<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-puzzle"></i>\n						<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-bubble"></i>\n						<a href="#">{{ \'APPLICATION_CHAT\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-login"></i>\n						<a href="/channels/chat/offline/list">Offline</a>\n					</li>\n				</ul>\n			</div>\n		</div>\n</div>\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-question font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_VISITORS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/chat/online/view/view.detail.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_DETAIL\' | translate}}</span>\n				</div>\n			</div>\n			<div class="portlet-body row" data-ng-init="initView()">\n				<div class="col-md-6">\n					<div class="news-blocks">\n						<h3>\n							<a href="#" class="inactive-link">{{\'APPLICATION_MESSAGES\' | translate}}</a>\n							<!-- <a href="#" data-ng-click="export()" data-ng-show="chatRoom.ChatMessages.length" class="btn btn-sm blue pull-right"><i class="icon-cloud-download"></i> {{\'APPLICATION_EXPORT\' | translate}} CSV </a> -->\n							<a href="api/chat/rooms/{{chatRoom.id}}/export" target="_blank" data-ng-show="chatRoom.ChatMessages.length" class="btn btn-sm blue pull-right"><i class="icon-cloud-download"></i> {{\'APPLICATION_EXPORT\' | translate}} CSV </a>\n							<hr>\n						</h3>\n						<div class="news-block-tags">\n							<em am-time-ago="chatRoom.ChatVisitor.ChatEnquiry.createdAt"></em>\n						</div>\n						<p>\n							<div ng-scrollbars ng-scrollbars-config="config">\n								<ul class="chats">\n									<li data-ng-class="{\'out\': message.User, \'in\':message.ChatVisitor}" data-ng-repeat="message in chatRoom.ChatMessages | orderBy:\'createdAt\'">\n										<img class="avatar" data-ng-src="api/users/avatar/{{message.User.userpic || \'unknown_avatar\'}}">\n										<div class="message">\n											<span class="arrow">\n											</span>\n											<a href="#" class="name">\n												{{message.User ? message.User.fullname : message.ChatVisitor.fullname}}\n											</a>\n											<span class="datetime">\n												at {{message.createdAt | date: \'medium\'}}\n											</span>\n											<span class="body">\n												{{message.body}}\n											</span>\n										</div>\n									</li>\n								</ul>\n							</div>\n						</div>\n					</div>\n					<div class="col-md-6">\n						<div class="news-blocks">\n							<h3>\n								<a href="#" class="inactive-link">{{\'APPLICATION_VISITOR\' | translate}}</a>\n								<hr>\n							</h3>\n							<div class="margin-top-20 profile-desc-link">\n								<i class="icon-user"></i>\n								<a href="#" class="inactive-link">{{chatRoom.ChatVisitor.fullname}}</a>\n							</div>\n							<div class="margin-top-20 profile-desc-link">\n								<i class="icon-envelope"></i>\n								<a href="#" class="inactive-link">{{chatRoom.ChatVisitor.email}}</a>\n							</div>\n							<div class="margin-top-20 profile-desc-link">\n								<i class="icon-globe"></i>\n								<a href="#" class="inactive-link">{{chatRoom.ChatVisitor.remote_address}}</a>\n							</div>\n							<div class="margin-top-20 profile-desc-link">\n								<i class="icon-home"></i>\n								<a href="#" class="inactive-link">{{chatRoom.ChatVisitor.referer}} - {{chatRoom.ChatVisitor.ChatWebsite.name}}</a>\n							</div>\n							<div class="margin-top-20 profile-desc-link">\n								<i class="icon-cursor"></i>\n								<a href="#" class="inactive-link">{{chatRoom.ChatVisitor.browser}}</a>\n							</div>\n							<div class="margin-top-20 profile-desc-link">\n								<i class="icon-screen-desktop"></i>\n								<a href="#" class="inactive-link">{{chatRoom.ChatVisitor.os}}</a>\n							</div>\n						</div>\n					</div>\n				</div>\n			</div>\n		</div>\n	</div>\n'),
+a.put("app/channels/chat/online/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-puzzle"></i>\n					<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-bubble"></i>\n					<a href="#">{{ \'APPLICATION_CHAT\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-login"></i>\n					<a href="/channels/chat/online/list">Online</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/enquiry.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- START USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{chatRoom.ChatVisitor.email}}\n					</div>\n					<div class="profile-usertitle-job">\n						{{chatRoom.ChatVisitor.fullname}}\n					</div>\n				</div>\n				<!-- END USER TITLE -->\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.channels.chat.online.view.detail\')}">\n							<a data-ng-href="/channels/chat/online/view/{{chatRoom.id}}/detail">\n							<i class="icon-tag"></i>\n							{{ \'APPLICATION_DETAIL\' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/chat/preview/preview.html",'<style>\n.xc_rating {\n  text-align: center;\n}\n.xc_rating_label > input{ /* HIDE RADIO */\n  display:none;\n}\n.xc_rating_label > input + img{ /* IMAGE STYLES */\n  cursor:pointer;\n  border:2px solid transparent;\n}\n.xc_rating_label > input:checked + img{ /* (CHECKED) IMAGE STYLES */\n  /*border:2px solid #f00;*/\n  background-color: #efefef;\n}\n\n.xc_label {\n  display: inline-block;\n  max-width: 100%;\n  margin-bottom: 5px;\n  font-weight: bold;\n}\n\n.xc_online_message,\n.xc_offline_message,\n.xc_rating_message\n{\n  text-align: center;\n}\n\n.xc_div_group {\n  margin: 10px 0 10px 0;\n}\n.xc_footer\n{\n  text-align: center;\n  padding-bottom: 5px;\n}\n\n.xc_powered\n{\n  color: grey;\n  font: 10px/16px "Lucida Grande","Lucida Sans Unicode",Arial,Verdana,sans-serif;\n  padding-bottom: 5px;\n}\n\n.xc_chat_container\n{\n  //width:379px;\n  //position:fixed;\n  //bottom:0;\n  //right:50px;\n  z-index:9999;\n  background-color:transparent;\n}\n\n.xc_chat_container *\n{\n  font-family:Arial,Helvetica,sans-serif;\n  font-size:13px;\n  margin:0;\n  padding:0;\n}\n\n.xc_chat_container p\n{\n  margin:5px 0;\n}\n\n.xc_signup_wrapper\n{\n  max-height:375px;\n}\n\n.xc_conversation_container\n{\n  max-height:375px;\n  list-style:none;\n  overflow:auto;\n  margin:0;\n  padding:20px 10px;\n}\n\n.xc_conversation_container a\n{\n  color:#036;\n}\n\n.xc_conversation_container a.xc_btn_style\n{\n  color:#fff;\n}\n\ndiv.xc_chat_head\n{\n  color:#fff;\n  background:{{chatWebsite.color}};\n  //border-radius: 20px 20px 0px 0px !important;\n  height:52px;\n  line-height:55px;\n  cursor:pointer;\n}\n\ndiv.xc_chat_head.rounded\n{\n  border-radius: 20px 20px 0px 0px !important;\n}\n\ndiv.xc_chat_head.squared\n{\n  //border-radius: 20px 20px 0px 0px !important;\n}\n\n.xc_chat_head-title\n{\n  margin:5px 0 0 15px;\n  color: #fff;\n}\n\n.xc_header_icon\n{\n  display:block;\n  background-image:url({{chatWebsite.remote}}/api/xchatty/assets?resource=images/icon_visitorchat.png);\n  width:21px;\n  height:16px;\n  float:right;\n  margin:20px 20px 0 0;\n}\n\n.xc_header_icon span.xc_notification_badge span\n{\n  display:block;\n  height:16px;\n  width:15px;\n  text-align:center;\n  font-size:9px;\n  color:#555;\n  position:relative;\n  top:-20px;\n  left:4px;\n  margin:0;\n  padding:0;\n}\n\n.xc_sub-head-spacer\n{\n  padding:1px;\n}\n\n.xc_conversation\n{\n  display:none;\n  margin:0 12px 0 11px;\n}\n\n.xc_chat_toggle_container\n{\n  /*background:mediumslateblue center 52px;*/\n  background: white;\n  border-style: solid;\n  border-width: 1px;\n  border-color: {{chatWebsite.color}};\n  //display:none;\n}\n\n.xc_signup_wrapper,.xc_notifications_wrapper,.xc_enquiry_wrapper,.xc_rating_wrapper\n{\n  //display:none;\n  display:block;\n  overflow:auto;\n  line-height:1;\n  padding:25px;\n}\n\n.xc_exit_chat_container\n{\n  text-align:right;\n  width:95%;\n  margin:0 auto;\n  padding:5px 1px 0 0;\n}\n\n.xc_exit_chat_container span,.xc_exit_chat_container a\n{\n  font-size:80%;\n  color:#666;\n  text-decoration:none;\n}\n\n.xc_exit_chat_container a:hover\n{\n  color:#333;\n}\n\na.xc_btn_exit_chat_confirm:hover\n{\n  color:red;\n}\n\na.xc_btn_exit_chat_cancel:hover\n{\n  color:#0c0;\n}\n\nform.xc_form_reply\n{\n  position:relative;\n}\n\n.xc_form_reply\n{\n  /*background-color:#e3e3e3;*/\n  text-align:center;\n  /*border-top:1px solid #d3d3d3;*/\n}\n\n.xc_input_message\n{\n  height:100px;\n  margin:10px auto 5px;\n}\n\n.xc_input_enquiry_message,\n.xc_input_rating_message\n{\n  height:100px;\n}\n\n.xc_form_signup,.xc_form_enquiry,.xc_form_rating\n{\n  /*text-align:center;*/\n}\n\n.xc_chat_container textarea,.xc_chat_container input[type=text]\n{\n  width:95%;\n  min-width:95%;\n  max-width:95%;\n  -webkit-box-sizing:border-box;\n  -moz-box-sizing:border-box;\n  box-sizing:border-box;\n  background-color:#fff;\n  border:1px solid #ccc;\n  -webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);\n  -moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);\n  box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);\n  -webkit-transition:border linear .2s, box-shadow linear .2s;\n  -moz-transition:border linear .2s, box-shadow linear .2s;\n  -o-transition:border linear .2s, box-shadow linear .2s;\n  transition:border linear .2s, box-shadow linear .2s;\n  display:inline-block;\n  font-size:14px;\n  line-height:20px;\n  color:#555;\n  -webkit-border-radius:4px;\n  -moz-border-radius:4px;\n  border-radius:4px;\n  vertical-align:middle;\n  margin:3px 0;\n  padding:4px 6px;\n  resize: none;\n}\n\n.xc_chat_container textarea:focus,.xc_chat_container input[type=text]:focus\n{\n  outline: {{chatWebsite.color_focus}} auto 5px;\n}\n\n.xc_chat_container input[type=text]\n{\n  height: 30px;\n}\n\n.xc_message_sending textarea, .xc_enquiry_sending textarea\n{\n  background: #fff url({{chatWebsite.remote}}/api/xchatty/assets?resource=images/loading.gif) 98% 5px no-repeat;\n}\n\n.xc_chatrow\n{\n  display:block;\n  border-top:1px dashed #e3e3e3;\n  margin:5px 0;\n  clear: both;\n}\n\n.xc_chatrow p\n{\n  color:#444;\n  word-wrap:break-word;\n}\n\n.xc_time\n{\n  float:right;\n  font-size:80%;\n  color:#ccc;\n  padding-left:12px;\n  margin:3px;\n}\n\n.xc_submission_pending\n{\n  background:transparent url({{chatWebsite.remote}}/api/xchatty/assets?resource=images/bullet_clock.png) left center norepeat;\n}\n\n.xc_submission_confirmed\n{\n  background:transparent url({{chatWebsite.remote}}/api/xchatty/assets?resource=images/bullet_tick.png) left center norepeat;\n}\n\n.xc_fullname\n{\n  font-weight:700;\n}\n\n.xc_fullname:after\n{\n  content:":";\n}\n\n.xc_avatar\n{\n  float: left;\n  margin: 0 5px 5px 0;\n  display: inline-block;\n  width: 40px;\n  height: 40px;\n  border-radius: 5px;\n  -moz-border-radius: 5px;\n  -webkit-border-radius: 5px;\n}\n\n.xc_smilie\n{\n  background-repeat:no-repeat;\n  display:inline-block;\n  width:18px;\n  height:18px;\n  text-indent:-9999px;\n  white-space:nowrap;\n}\n\n.xc_btn_load_more\n{\n  width:100%!important;\n}\n\n.xc_notifications_wrapper\n{\n  text-shadow:0 1px 0 rgba(255,255,255,0.5);\n}\n\n.xc_notification_success\n{\n  color:#468847;\n}\n\n.xc_notification_error\n{\n  color:#b94a48;\n}\n\n.xc_errorlist\n{\n  margin:0 0 0 25px;\n  padding:0;\n}\n\ni.xc_btn_notifications_close\n{\n  float:right;\n  font-weight:700;\n  font-size:20px;\n  color:#ccc;\n  cursor:pointer;\n  margin:-15px 0 0;\n  padding:0;\n}\n\n.xc_btn_style\n{\n  width:95%;\n  text-align:center;\n  line-height:1.2;\n  font-size:90%;\n  -moz-box-shadow:inset 0 1px 0 0 {{chatWebsite.color_button}};\n  -webkit-box-shadow:inset 0 1px 0 0 {{chatWebsite.color_button}};\n  box-shadow:inset 0 1px 0 0 {{chatWebsite.color_button}};\n  background:0;\n  background-color:{{chatWebsite.color_button}};\n  -moz-border-radius:4px;\n  -webkit-border-radius:4px;\n  border-radius:4px;\n  border:1px solid {{chatWebsite.color_button}};\n  display:inline-block;\n  color:#fff;\n  font-weight:700;\n  text-decoration:none;\n  text-shadow:1px 1px 0 #000c17;\n  margin:0 auto 5px;\n  padding:2px 0;\n}\n\n.xc_btn_style:hover\n{\n  background:0;\n  background-color:{{chatWebsite.color_button}};\n  color: #fff;\n  text-decoration: none;\n}\n\n.xc_btn_style:active\n{\n  position:relative;\n  top:1px;\n}\n\n.xc_composing_container\n{\n  display: none;\n  width: 95%;\n  margin: 0 auto;\n  background: transparent url({{chatWebsite.remote}}/api/xchatty/assets?resource=images/bullet_pencil.png) 6px center no-repeat;\n  padding-left: 19px;\n  font-style: italic;\n}\n\n@media only screen and (max-height: 620px) {\n  .xc_conversation_container\n  {\n    max-height:300px!important;\n  }\n}\n\n@media only screen and (max-height: 545px) {\n  .xc_conversation_container\n  {\n    max-height:200px!important;\n  }\n}\n\n@media only screen and (max-height: 445px) {\n  .xc_conversation_container\n  {\n    max-height:150px!important;\n  }\n}\n\n@media only screen and (max-width: 480px) {\n  .xc_chat_container\n  {\n    width:95%!important;\n    right:auto!important;\n    -webkit-border-top-left-radius:15px;\n    -webkit-border-top-right-radius:15px;\n    -moz-border-radius-topleft:15px;\n    -moz-border-radius-topright:15px;\n    border-top-left-radius:15px;\n    border-top-right-radius:15px;\n    box-shadow:0 0 5px rgba(0,0,0,.5);\n    -webkit-box-shadow:0 0 5px rgba(0,0,0,.5);\n    -moz-box-shadow:0 0 5px rgba(0,0,0,.5);\n  }\n\n  div.xc_chat_head\n  {\n    background-color:#036;\n    background-image:none;\n    line-height:25px;\n    height:auto;\n    -webkit-border-top-left-radius:15px;\n    -webkit-border-top-right-radius:15px;\n    -moz-border-radius-topleft:15px;\n    -moz-border-radius-topright:15px;\n    border-top-left-radius:15px;\n    border-top-right-radius:15px;\n    padding:10px;\n  }\n\n  .xc_chat_toggle_container\n  {\n    background-color:#fff;\n    background-image:none;\n    border-color:#036;\n    border-style:solid;\n    border-width:0 1px;\n  }\n\n  .xc_header_icon\n  {\n    background-image:url({{chatWebsite.remote}}/api/xchatty/assets?resource=images/icon_visitorchat.png);\n    margin:0;\n  }\n\n  .xc_header_icon span.xc_notification_badge span\n  {\n    top:-5px;\n    left:5px;\n  }\n\n  .xc_notification_success\n  {\n    background-color:#dff0d8;\n    border:1px solid #d6e9c6;\n  }\n\n  .xc_conversation_container\n  {\n    max-height:375px;\n    border-color:#036;\n  }\n\n  .xc_notification_error\n  {\n    background-color:#f2dede;\n    border:1px solid #eed3d7;\n  }\n\n  .xc_sub-head-spacer\n  {\n    display:none;\n    padding:0;\n  }\n\n  .xc_chat_head-title,.xc_conversation\n  {\n    margin:0;\n  }\n}\n</style>\n<div class="xc_chat_container">\n  <div class="xc_chat_head {{chatWebsite.header_shape}}">\n    <i class="xc_header_icon">\n      <span class="xc_notification_badge">\n        <span class="xc_notification_badge_number"></span>\n      </span>\n    </i>\n    <span class="xc_chat_head-title">{{statePreview.state == \'online\' ? chatWebsite.header_online : chatWebsite.header_offline}}</span>\n  </div>\n  <div class="xc_chat_toggle_container">\n    <div class="xc_sub-head-spacer"></div>\n    <!-- <div class="xc_notifications_wrapper">\n    <ul class="xc_errorlist"></ul>\n  </div> -->\n  <div class="xc_enquiry_wrapper" data-ng-show=\'statePreview.state == "offline"\'>\n    <form class="xc_form_enquiry" accept-charset="UTF-8">\n      <p class="xc_offline_message" ng-bind-html=\'chatWebsite.offline_message\'></p>\n      <br>\n      <div ng-if="chatWebsite.enquiry_enable">\n        <div class="xc_div_group">\n          <label for="enquiryFullname" class="xc_label">Name *</label>\n          <input id="enquiryFullname" maxlength="45" data-label="Name" type="text" name="data[Enquiry][fullname]" placeholder="{{chatWebsite.username_placeholder}}" class="xc_input_enquiry_fullname" required/>\n        </div>\n        <br>\n        <div class="xc_div_group">\n          <label for="enquiryEmail" class="xc_label">Email Address *</label>\n          <input id="enquiryEmail" maxlength="85" type="text" data-label="Email Address" name="data[Enquiry][email]" placeholder="{{chatWebsite.email_placeholder}}" class="xc_input_enquiry_email" required/>\n        </div>\n        <br>\n        <div class="xc_div_group">\n          <label for="enquiryMessage" class="xc_label">Message*</label>\n          <textarea id="enquiryMessage" data-label="Message" maxlength="1500" placeholder="{{chatWebsite.enquiry_message_placeholder}}" name="data[Enquiry][message]" class="xc_input_enquiry_message" required></textarea>\n        </div>\n        <br>\n        <button type="submit" class="xc_btn_enquiry xc_btn_style">{{chatWebsite.enquiry_button}}</button>\n      </div>\n    </form>\n  </div>\n  <div class="xc_signup_wrapper" data-ng-show=\'statePreview.state == "online"\'>\n    <form class="xc_form_signup" accept-charset="UTF-8">\n      <p class="xc_online_message" ng-bind-html=\'chatWebsite.online_message\'></p>\n      <br>\n      <div class="xc_div_group">\n        <label for="dataFullname" class="xc_label">Fullname *</label>\n        <input maxlength="45" id="dataFullname" data-label="Fullname" type="text" name="data[Discussion][fullname]" placeholder="{{chatWebsite.username_placeholder}}" class="xc_input_fullname" required/>\n      </div>\n      <br>\n      <div class="xc_div_group">\n        <label for="dataEmail" class="xc_label">Email Address *</label>\n        <input maxlength="85" id="dataEmail" data-label="Email Address" type="text" name="data[Discussion][email]" placeholder="{{chatWebsite.email_placeholder}}" class="xc_input_email" required/>\n      </div>\n      <br>\n      <input type="hidden" class="xc_input_visitor_time" name="data[Discussion][visitor_time]" />\n      <button type="submit" class="xc_btn_signup xc_btn_style">{{chatWebsite.start_chat_button}}</button>\n    </form>\n  </div>\n  <div class="xc_rating_wrapper" data-ng-show=\'statePreview.state == "rating"\'>\n    <form class="xc_form_rating" accept-charset="UTF-8">\n      <p class="xc_rating_message">{{chatWebsite.rating_message}}</p>\n      <br>\n      <div class="xc_rating">\n        <label class="xc_rating_label" style="padding:30px;">\n          <input type="radio" name="data[Rating][rating]" value="good" />\n          <img src="{{chatWebsite.remote}}/api/xchatty/assets?resource=images/like.png" alt="Good" height="50"/>\n        </label>\n        <label class="xc_rating_label" style="padding:30px;">\n          <input type="radio" name="data[Rating][rating]" value="bad"/>\n          <img src="{{chatWebsite.remote}}/api/xchatty/assets?resource=images/dislike.png" alt="Good" height="50"/>\n        </label>\n      </div>\n      <div class="xc_div_group">\n        <label for="ratingMessage" class="xc_label">Message</label>\n        <textarea id="ratingMessage" data-label="Message" maxlength="1500" name="data[Rating][message]" class="xc_input_rating_message"></textarea>\n      </div>\n      <button type="submit" class="xc_button_rating xc_btn_style">{{chatWebsite.rating_send}}</button>\n      <button type="button" class="xc_button_skip_rating xc_btn_style">{{chatWebsite.rating_skip}}</button>\n    </form>\n  </div>\n  <div class="xc_footer">\n    <div class="xc_powered"><a>Powered by Xenialab | Trademark xCALLY</a></div>\n  </div>\n</div>\n</div>\n'),a.put("app/channels/chat/queue/list/list.create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_QUEUE\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.general.name.$touched || form.general.$submitted) && form.general.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n      <span data-ng-show="(form.general.name.$touched || form.general.$submitted) && form.general.name.$invalid && form.general.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"/>\n    </div>\n    <!-- END DESCRIPTION -->\n\n    <!-- START TIMEOUT -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.general.timeout.$touched || form.general.$submitted) && form.general.timeout.$invalid}">\n      <label class="control-label">{{\'APPLICATION_AGENT_TIMEOUT\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="number" name="timeout" placeholder="Timeout" class="form-control" data-ng-model="item.timeout" required/>\n      <span data-ng-show="(form.general.timeout.$touched || form.general.$submitted) && form.general.timeout.$invalid && form.general.timeout.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END TIMEOUT -->\n\n    <!-- START HEADER SHAPE -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.general.strategy.$touched || form.general.$submitted) && form.general.strategy.$invalid}">\n      <label class="control-label">{{\'APPLICATION_STRATEGY\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <ui-select data-ng-model="item.strategy" name="strategy" theme="bootstrap" required>\n        <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.toUpperCase()}}</ui-select-match>\n        <ui-select-choices repeat="strategy in [\'rrmemory\',\'beepall\'] | filter: $select.search">\n          <div ng-bind-html="strategy.toUpperCase() | highlight: $select.search"></div>\n        </ui-select-choices>\n      </ui-select>\n      <span data-ng-show="(form.general.strategy.$touched || form.general.$submitted) && form.general.strategy.$invalid && form.general.strategy.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END HEADER SHAPE -->\n\n\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="save()" ng-disabled="form.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/channels/chat/queue/list/list.html",'<div class="row">\n	<div class="col-md-12">\n			<div class="page-bar">\n				<ul class="page-breadcrumb">\n					<li>\n						<i class="icon-rocket"></i>\n						<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-puzzle"></i>\n						<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-bubble"></i>\n						<a href="#">{{ \'APPLICATION_CHAT\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-docs"></i>\n						<a href="#">{{ \'APPLICATION_QUEUES\' | translate }}</a>\n					</li>\n				</ul>\n			</div>\n		</div>\n</div>\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-docs font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_QUEUES\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<a class="btn green-jungle " href="#"  data-ng-click="createItem()">\n						<i class="icon-plus"></i> {{ \'APPLICATION_NEW_QUEUE\' | translate }}\n					</a>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/chat/queue/view/view.agents.html",'<div class="row" data-ng-init="getTeams()">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_AGENTS\' | translate}}</span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- BEGIN FORM-->\n				<form action="index.html" class="form-horizontal form-row-seperated">\n					<div class="form-body">\n						<label for="penalty">{{\'APPLICATION_PENALTY\' | translate}}</label>\n						<div class="input-group input-small mbottom20">\n							<input type="number" class="spinner-input form-control" maxlength="3" data-ng-model="queue.penalty" readonly>\n							<div class="spinner-buttons input-group-btn btn-group-vertical">\n								<button type="button" class="btn spinner-up btn-xs blue" data-ng-click="queue.penalty=queue.penalty+1">\n									<i class="fa fa-angle-up"></i>\n								</button>\n								<button type="button" class="btn spinner-down btn-xs blue" data-ng-disabled="!queue.penalty" data-ng-click="queue.penalty=queue.penalty-1">\n									<i class="fa fa-angle-down"></i>\n								</button>\n							</div>\n						</div>\n						<div class="form-group last">\n							<div class="col-md-12" id="multi-select-team">\n							</div>\n						</div>\n					</div>\n				</form>\n				<!-- END FORM-->\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/channels/chat/queue/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getQueue()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-bubble"></i>\n					<a href="#">{{ \'APPLICATION_CHAT\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-docs"></i>\n					<a href="/channels/chat/queues/list">{{ \'APPLICATION_QUEUES\' | translate }}</a>\n					<i data-ng-show="queue" class="fa fa-angle-right"></i>\n				</li>\n				<li data-ng-show="queue">\n					<a href="#">{{queue.name}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/queue.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{queue.name}}\n					</div>\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.channels.chat.queues.view.settings\')}">\n							<a data-ng-href="/channels/chat/queues/view/{{queue.id}}/settings">\n							<i class="icon-settings"></i>\n							{{ \'APPLICATION_SETTINGS\' | translate}} </a>\n						</li>\n						<li data-ng-class="{active: $state.is(\'main.channels.chat.queues.view.agents\')}">\n							<a data-ng-href="/channels/chat/queues/view/{{queue.id}}/agents">\n							<i class="icon-people"></i>\n							{{ \'APPLICATION_AGENTS\' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/chat/queue/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_SETTINGS\' | translate}}</span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<form name="forms.general" data-ng-submit="forms.general.$valid && updateChatQueue()" novalidate>\n					<!-- START NAME -->\n					<div class="form-group" data-ng-class="{\'has-error\': (forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid}">\n						<label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n						<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="queue.name" required/>\n						<span data-ng-show="(forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid && forms.general.name.$error.required" class="help-block help-block-error">\n							<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n						</span>\n					</div>\n					<!-- END NAME -->\n\n					<!-- START DESCRIPTION -->\n					<div class="form-group">\n						<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n						<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="queue.description"/>\n					</div>\n					<!-- END DESCRIPTION -->\n\n					<!-- START TIMEOUT -->\n					<div class="form-group">\n						<label class="control-label">{{\'APPLICATION_AGENT\' | translate}} {{\'APPLICATION_TIMEOUT\' | translate}}</label>\n						<input type="number" name="timeout" placeholder="{{\'APPLICATION_TIMEOUT\' | translate}}" class="form-control" min="1" data-ng-model="queue.timeout"/>\n					</div>\n					<!-- END TIMEOUT -->\n\n					<!-- START HEADER SHAPE -->\n					<div class="form-group" data-ng-class="{\'has-error\': (forms.general.strategy.$touched || forms.general.$submitted) && forms.general.strategy.$invalid}">\n						<label class="control-label">{{\'APPLICATION_STRATEGY\' | translate}}</label>\n						<!-- <input colorpicker type="text" name="animationToggle" placeholder="{{\'APPLICATION_BUTTON_COLOR\' | translate}}" class="form-control" data-ng-model="chatWebsite.animation" required/> -->\n						<ui-select data-ng-model="queue.strategy" name="strategy" theme="bootstrap">\n							<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.toUpperCase()}}</ui-select-match>\n							<ui-select-choices repeat="strategy in [\'rrmemory\',\'beepall\'] | filter: $select.search">\n								<div ng-bind-html="strategy.toUpperCase() | highlight: $select.search"></div>\n							</ui-select-choices>\n						</ui-select>\n					</div>\n					<!-- END HEADER SHAPE -->\n					<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n				</form>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/channels/chat/realtime/view/agent/agent.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initAgents()">\n	<div class="col-md-12">\n		<!-- START TABLE -->\n		<div ui-grid="gridOptions"  ui-grid-resize-columns  class="ui-grid" ui-grid-tree-view ui-grid-expandable-row ui-grid-pagination auto-resize>\n			<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n		</div>\n		<!-- END TABLE -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/chat/realtime/view/agent/agent.modal.info.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_INTERFACE_INFO\' | translate }}</h3>\n</div>\n<div class="modal-body">\n<div data-ng-if="agent.ipaddr" class="well">\n  <div>{{agent.ipaddr}}:{{agent.port}}</div>\n  <div>{{agent.fullcontact}}</div>\n  <div>{{agent.useragent}}</div>\n  <div>{{agent.lastms}}</div>\n</div>\n<div data-ng-if="!agent.ipaddr" class="alert alert-danger" role="alert">\n  {{\'MESSAGE_NO_AVAILABLE_INFO\' | translate}}\n</div>\n</div>\n<div class="modal-footer">\n  <button class="btn default" type="button" ng-click="close()">{{ \'APPLICATION_CLOSE\' | translate }}</button>\n</div>\n'),a.put("app/channels/chat/realtime/view/agent/queue.modal.add.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_JOIN_QUEUE\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n\n    <div class="form-group row">\n  <label class="col-md-2 control-label" style="margin-top: 7px;">{{\'APPLICATION_QUEUE\' | translate}}:</label>\n  <div class="col-md-10">\n    <ui-select multiple ng-model="item.queues" theme="bootstrap" required>\n      <ui-select-match placeholder="{{\'APPLICATION_QUEUE\' | translate}}">{{$item.name}}</ui-select-match>\n      <ui-select-choices repeat="queue.id as queue in queues | filter: $select.search">\n        <div ng-bind-html="queue.name | highlight: $select.search"></div>\n      </ui-select-choices>\n    </ui-select>\n  </div>\n</div>\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="save()" ng-disabled="form.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/channels/chat/realtime/view/queue/queue.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initQueues()">\n	<div class="col-md-12">\n		<!-- START TABLE -->\n		<div ui-grid="gridOptions"  ui-grid-resize-columns class="ui-grid" ui-grid-tree-view auto-resize>\n			<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n		</div>\n		<!-- END TABLE -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),
+a.put("app/channels/chat/realtime/view/session/session.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initSessions()">\n	<div class="col-md-12">\n		<!-- START TABLE -->\n		<div ui-grid="gridOptions"  ui-grid-resize-columns class="ui-grid" auto-resize>\n			<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n		</div>\n		<!-- END TABLE -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/chat/realtime/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-puzzle"></i>\n					<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-bubble"></i>\n					<a href="#">{{ \'APPLICATION_CHAT\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-energy"></i>\n					<a href="#">{{ \'APPLICATION_REALTIME\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<div>\n			<nav class="navbar navbar-default" role="navigation">\n				<div class="collapse navbar-collapse">\n					<ul class="nav navbar-nav">\n						<li data-ng-class="{\'active\': $state.is(\'main.channels.chat.realtime.view.agents\')}">\n							<a href="/channels/chat/realtime/view/agents">\n								{{\'APPLICATION_AGENTS\' | translate}}\n							</a>\n						</li>\n					</ul>\n				</div>\n			</nav>\n		</div>\n\n		<div ui-view></div>\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/chat/visitor/list/list.html",'<div class="row">\n	<div class="col-md-12">\n			<div class="page-bar">\n				<ul class="page-breadcrumb">\n					<li>\n						<i class="icon-rocket"></i>\n						<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-puzzle"></i>\n						<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-bubble"></i>\n						<a href="#">{{ \'APPLICATION_CHAT\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-question"></i>\n						<a href="/channels/chat/visitors/list">{{ \'APPLICATION_VISITORS\' | translate }}</a>\n					</li>\n				</ul>\n			</div>\n		</div>\n</div>\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-question font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_VISITORS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/chat/visitor/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-puzzle"></i>\n					<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-bubble"></i>\n					<a href="#">{{ \'APPLICATION_CHAT\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-question"></i>\n					<a href="/channels/chat/visitors/list">{{ \'APPLICATION_VISITORS\' | translate }}</a>\n					<i  class="fa fa-angle-right"></i>\n				</li>\n				<li data-ng-show="chatVisitor">\n					<a href="#">{{chatVisitor.fullname}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/visitor.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{chatVisitor.fullname}}\n					</div>\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.channels.chat.visitors.view.profile\')}">\n							<a data-ng-href="/channels/chat/visitors/view/{{chatVisitor.id}}/profile">\n							<i class="icon-tag"></i>\n							{{ \'APPLICATION_PROFILE\' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/chat/visitor/view/view.profile.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_PROFILE\' | translate}}</span>\n				</div>\n			</div>\n			<div class="portlet-body" data-ng-init="initView()">\n				<div>\n					<h4 class="profile-desc-title">{{chatVisitor.email}}</h4>\n					<div class="margin-top-20 profile-desc-link">\n						<i class="icon-magnifier"></i>\n						<a href="#" class="inactive-link">{{chatVisitor.origin}}</a>\n					</div>\n					<div class="margin-top-20 profile-desc-link">\n						<i class="icon-globe"></i>\n						<a href="#" class="inactive-link">{{chatVisitor.remote_address}}</a>\n					</div>\n					<div class="margin-top-20 profile-desc-link">\n						<i class="icon-user"></i>\n						<a href="#" class="inactive-link">{{chatVisitor.user_agent | truncate: 50: \'...\'}}</a>\n					</div>\n					<div class="margin-top-20 profile-desc-link">\n						<i class="icon-flag"></i>\n						<a href="#" class="inactive-link">{{chatVisitor.visitor_language}}</a>\n					</div>\n					<div class="margin-top-20 profile-desc-link">\n						<i class="icon-home"></i>\n						<a href="#" class="inactive-link">{{chatVisitor.referer}}</a>\n					</div>\n					<div class="margin-top-20 profile-desc-link">\n						<i class="icon-cursor"></i>\n						<a href="#" class="inactive-link">{{chatVisitor.browser}}</a>\n					</div>\n					<div class="margin-top-20 profile-desc-link">\n						<i class="icon-screen-desktop"></i>\n						<a href="#" class="inactive-link">{{chatVisitor.os}}</a>\n					</div>\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/channels/chat/website/list/list.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-puzzle"></i>\n					<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-bubble"></i>\n					<a href="#">{{ \'APPLICATION_CHAT\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-globe"></i>\n					<a href="#">{{ \'APPLICATION_WEB_SITES\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n	</div>\n</div>\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-notebook font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_WEB_SITES\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<a class="btn green-jungle" href="/channels/chat/websites/wizard">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_WEB_SITE\' | translate }}\n						</a>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/chat/website/view/action/list/list.html",'<div class="row" data-ng-init="initActons()">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_ACTIONS\' | translate}}</span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<a class="btn green-jungle" href="/channels/chat/websites/view/{{chatWebsite.id}}/actions/wizard" data-toggle="dropdown">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_ACTION\' | translate }}\n						</a>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/channels/chat/website/view/action/view/view.html",'\n<div class="row" data-ng-init="initAction()">\n	<div class="col-md-12">\n		<!-- BEGIN  PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-directions font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_ACTION\' | translate }}</a> </span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<form name="forms.settings" ng-submit="updateItem()" novalidate>\n					<!-- START APP -->\n					<div class="form-group"  data-ng-class="{\'has-error\': (forms.settings.app.$touched || forms.settings.$submitted) && forms.settings.app.$invalid}">\n						<label class="control-label">{{ \'APPLICATION_APPLICATION\' | translate }}<span class="required" aria-required="true">*</span></label>\n						<ui-select data-ng-model="application.app" name="app" theme="bootstrap" required>\n							<ui-select-match placeholder="{{ \'APPLICATION_APPLICATION\' | translate }}">{{$select.selected.name}}</ui-select-match>\n							<ui-select-choices repeat="app.value as app in apps | filter: $select.search">\n								<div ng-bind-html="app.name | highlight: $select.search"></div>\n							</ui-select-choices>\n						</ui-select>\n						<span data-ng-show="(forms.settings.app.$touched || forms.settings.$submitted) && forms.settings.app.$invalid && forms.settings.app.$error.required" class="help-block help-block-error">\n							<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n						</span>\n					</div>\n					<!-- END APP -->\n\n					<!-- START HOST -->\n					<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid}">\n						<label class="control-label">{{\'APPLICATION_TIMEOUT\' | translate}} <span class="required" aria-required="true">*</span></label>\n						<input type="number" name="timeout" placeholder="{{\'APPLICATION_TIMEOUT\' | translate}}" class="form-control" data-ng-model="application.timeout" min="0" required/>\n						<span data-ng-show="(forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid && forms.settings.timeout.$error.required" class="help-block help-block-error">\n							<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n						</span>\n					</div>\n					<!-- END HOST -->\n\n					<div class="app-settings" ng-slide-down="application.app === \'queue\'" lazy-render duration="1" data-ng-init="getQueues()">\n						<!-- START QUEUE -->\n						<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.queue.$touched || forms.settings.$submitted) && forms.settings.queue.$invalid}">\n							<label class="control-label">{{\'APPLICATION_QUEUE\' | translate}}<span class="required" aria-required="true">*</span></label>\n							<ui-select data-ng-model="application.ChatQueueId" name="queue" theme="bootstrap" required>\n								<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n								<ui-select-choices repeat="queue.id as queue in queues | filter: $select.search">\n									<div ng-bind-html="queue.name | highlight: $select.search"></div>\n								</ui-select-choices>\n							</ui-select>\n							<span data-ng-show="(forms.settings.queue.$touched || forms.settings.$submitted) && forms.settings.queue.$error.required" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n						</div>\n						<!-- END QUEUE -->\n					</div>\n\n					<div class="app-settings" ng-slide-down="application.app === \'agent\'" lazy-render duration="1" data-ng-init="getAgents()">\n						<!-- START AGENT -->\n						<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.agent.$touched || forms.settings.$submitted) && forms.settings.agent.$invalid}">\n							<label class="control-label">{{\'APPLICATION_AGENT\' | translate}}<span class="required" aria-required="true">*</span></label>\n							<ui-select data-ng-model="application.UserId" name="agent" theme="bootstrap" required>\n								<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.fullname}}</ui-select-match>\n								<ui-select-choices repeat="agent.id as agent in agents | filter: $select.search">\n									<div ng-bind-html="agent.fullname | highlight: $select.search"></div>\n								</ui-select-choices>\n							</ui-select>\n							<span data-ng-show="(forms.settings.agent.$touched || forms.settings.$submitted) && forms.settings.agent.$error.required" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n						</div>\n						<!-- END AGENT -->\n					</div>\n\n					<!-- START INTERVAL_TYPE -->\n					<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.intType.$touched || forms.settings.$submitted) && forms.settings.intType.$invalid}">\n						<label class="control-label">{{ \'APPLICATION_INTERVAL_TYPE\' | translate }}<span class="required" aria-required="true">*</span></label>\n						<ui-select data-ng-model="application.intType" theme="bootstrap" name="intType" required>\n							<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{ $select.selected.name | translate }}</ui-select-match>\n							<ui-select-choices repeat="intType.value as intType in $application.intTypes | filter: $select.search">\n								{{ intType.name | translate }}\n							</ui-select-choices>\n						</ui-select>\n						<span data-ng-show="(forms.settings.intType.$touched || forms.settings.$submitted) && forms.settings.intType.$error.required" class="help-block help-block-error">\n							<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n						</span>\n					</div>\n					<!-- END INTERVAL_TYPE -->\n\n					<div class="app-settings" ng-slide-down="application.intType === \'custom\'" lazy-render duration="1">\n						<!-- START TIME -->\n						<div class="form-group">\n							<label class="control-label">{{ \'APPLICATION_TIME\' | translate }}</label>\n							<div class="input-group input-large">\n								<fieldset class="pull-left" ng-disabled="application.alwaysTime">\n									<uib-timepicker name="t_from" data-ng-model="application.t_from" show-meridian="false" show-spinners="false" mousewheel="false"></uib-timepicker>\n								</fieldset>\n								<div class="input-group-addon col-md-1 interval-to pull-left">to</div>\n								<fieldset ng-disabled="application.alwaysTime"><uib-timepicker  name="t_to" data-ng-model="application.t_to" show-meridian="false" show-spinners="false" mousewheel="false"></uib-timepicker></fieldset>\n								<!-- <label class="control-label pointer-cursor"><input type="checkbox" data-ng-model="application.alwaysTime">{{\'APPLICATION_ALWAYS\' | translate}}</label> -->\n							</div>\n						</div>\n						<!-- END TIME -->\n\n						<!-- START ALWAYS -->\n						<div class="form-group">\n							<label class="control-label">{{ \'APPLICATION_ALWAYS\' | translate }}</label>\n							<div class="input-group input-large">\n								<label class="control-label pointer-cursor">\n									<input\n										bs-switch\n										data-ng-model="application.alwaysTime"\n										type="checkbox"\n										switch-active="{{ isActive }}"\n										switch-on-text="{{ \'APPLICATION_YES\' | translate }}"\n										switch-off-text="{{ \'APPLICATION_NO\' | translate }}"\n										switch-on-color="{{ onColor }}"\n										switch-off-color="{{ offColor }}"\n										switch-animate="{{ animate }}"\n										switch-size="{{ size }}"\n										switch-label="{{ label }}"\n										switch-icon="{{ icon }}"\n										switch-radio-off="{{ radioOff }}"\n										switch-label-width="{{ labelWidth }}"\n										switch-handle-width="{{ handleWidth }}">\n									<!-- <input type="checkbox" data-ng-model="application.alwaysTime"> -->\n								</label>\n							</div>\n						</div>\n						<!-- END ALWAYS -->\n\n						<!-- START WEEKDAY -->\n						<div class="form-group">\n							<label class="control-label">{{ \'APPLICATION_WEEKDAY\' | translate }}</label>\n							<div class="input-group input-large">\n								<ui-select data-ng-model="application.wd_from" theme="bootstrap" name="wd_from">\n									<ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n									<ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n										{{ weekDay.name | translate}}\n									</ui-select-choices>\n								</ui-select>\n								<span class="input-group-addon">to</span>\n								<ui-select data-ng-model="application.wd_to" theme="bootstrap" name="wd_to">\n									<ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n									<ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n										{{ weekDay.name | translate }}\n									</ui-select-choices>\n								</ui-select>\n							</div>\n						</div>\n						<!-- END WEEKDAY -->\n\n						<!-- START MONTHDAY -->\n						<div class="form-group">\n							<label class="control-label">{{ \'APPLICATION_MONTHDAY\' | translate }}</label>\n							<div class="input-group input-large">\n								<ui-select data-ng-model="application.md_from" theme="bootstrap" name="md_from">\n									<ui-select-match>{{$select.selected}}</ui-select-match>\n									<ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n										{{monthDay}}\n									</ui-select-choices>\n								</ui-select>\n								<span class="input-group-addon">to</span>\n								<ui-select data-ng-model="application.md_to" theme="bootstrap" name="md_to">\n									<ui-select-match>{{$select.selected}}</ui-select-match>\n									<ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n										{{monthDay}}\n									</ui-select-choices>\n								</ui-select>\n							</div>\n						</div>\n						<!-- END MONTHDAY -->\n\n						<!-- START MONTH -->\n						<div class="form-group">\n							<label class="control-label">{{ \'APPLICATION_MONTH\' | translate }}</label>\n							<div class="input-group input-large">\n								<ui-select data-ng-model="application.m_from" theme="bootstrap" name="m_from">\n									<ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n									<ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n										{{ month.name | translate }}\n									</ui-select-choices>\n								</ui-select>\n								<span class="input-group-addon">to</span>\n								<ui-select data-ng-model="application.m_to" theme="bootstrap" name="m_to">\n									<ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n									<ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n										{{ month.name | translate }}\n									</ui-select-choices>\n								</ui-select>\n							</div>\n						</div>\n						<!-- END MONTH -->\n					</div>\n\n					<div class="app-settings" ng-slide-down="application.intType === \'list\'" lazy-render duration="1" data-ng-init="getIntervals()">\n\n						<!-- START INTERVALS -->\n						<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.IntervalId.$touched || forms.settings.$submitted) && forms.settings.IntervalId.$invalid}">\n							<label class="control-label">{{\'APPLICATION_INTERVALS\' | translate}}<span class="required" aria-required="true">*</span></label>\n							<ui-select data-ng-model="application.IntervalId" theme="bootstrap" name="IntervalId" required>\n								<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{ $select.selected.name}}</ui-select-match>\n								<ui-select-choices repeat="interval.id as interval in intervals | filter: $select.search">\n									{{ interval.name}}\n								</ui-select-choices>\n							</ui-select>\n							<span data-ng-show="(forms.settings.IntervalId.$touched || forms.settings.$submitted) && forms.settings.IntervalId.$error.required" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n						</div>\n						<!-- END INTERVALS -->\n\n					</div>\n					<button class="btn green-haze" type="submit">{{\'APPLICATION_UPDATE\' | translate}}</button>\n				</form>\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/chat/website/view/action/wizard/wizard.html",'\n<div class="row" data-ng-init="initWizard()">\n	<div class="col-md-12">\n		<!-- BEGIN  PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-directions font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_ACTION\' | translate }} WIZARD</a> </span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<wizard on-finish="createItem()">\n					<wz-step title="{{\'APPLICATION_APPLICATION\' | translate}}" canexit="formValidation(forms.action.$valid)">\n						<form name="forms.action" novalidate>\n							<!-- START APP -->\n							<div class="form-group"  data-ng-class="{\'has-error\': forms.action.$submitted && forms.action.app.$invalid}">\n								<label class="control-label">{{ \'APPLICATION_APPLICATION\' | translate }}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="application.app" name="app" theme="bootstrap" required>\n									<ui-select-match placeholder="{{ \'APPLICATION_APPLICATION\' | translate }}">{{$select.selected.name}}</ui-select-match>\n									<ui-select-choices repeat="app.value as app in apps | filter: $select.search">\n										<div ng-bind-html="app.name | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span data-ng-show="forms.action.$submitted && forms.action.app.$invalid" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END APP -->\n\n							<!-- START HOST -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.action.timeout.$touched || forms.action.$submitted) && forms.action.timeout.$invalid}">\n								<label class="control-label">{{\'APPLICATION_TIMEOUT\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="number" name="timeout" placeholder="{{\'APPLICATION_TIMEOUT\' | translate}}" class="form-control" data-ng-model="application.timeout" min="0" required/>\n								<span data-ng-show="(forms.action.timeout.$touched || forms.action.$submitted) && forms.action.timeout.$invalid && forms.action.timeout.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END HOST -->\n\n							<div class="app-settings" ng-slide-down="application.app === \'queue\'" lazy-render duration="1" data-ng-init="getQueues()">\n								<!-- START QUEUE -->\n								<div class="form-group" data-ng-class="{\'has-error\': (forms.action.queue.$touched || forms.action.$submitted) && forms.action.queue.$invalid}">\n									<label class="control-label">{{\'APPLICATION_QUEUE\' | translate}}<span class="required" aria-required="true">*</span></label>\n									<ui-select data-ng-model="application.ChatQueueId" name="queue" theme="bootstrap" required>\n										<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n										<ui-select-choices repeat="queue.id as queue in queues | filter: $select.search">\n											<div ng-bind-html="queue.name | highlight: $select.search"></div>\n										</ui-select-choices>\n									</ui-select>\n									<span data-ng-show="(forms.action.queue.$touched || forms.action.$submitted) && forms.action.queue.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END QUEUE -->\n							</div>\n\n							<div class="app-settings" ng-slide-down="application.app === \'agent\'" lazy-render duration="1" data-ng-init="getAgents()">\n								<!-- START AGENT -->\n								<div class="form-group" data-ng-class="{\'has-error\': (forms.action.agent.$touched || forms.action.$submitted) && forms.action.agent.$invalid}">\n									<label class="control-label">{{\'APPLICATION_AGENT\' | translate}}<span class="required" aria-required="true">*</span></label>\n									<ui-select data-ng-model="application.UserId" name="agent" theme="bootstrap" required>\n										<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.fullname}}</ui-select-match>\n										<ui-select-choices repeat="agent.id as agent in agents | filter: $select.search">\n											<div ng-bind-html="agent.fullname | highlight: $select.search"></div>\n										</ui-select-choices>\n									</ui-select>\n									<span data-ng-show="(forms.action.agent.$touched || forms.action.$submitted) && forms.action.agent.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END AGENT -->\n							</div>\n\n							<!-- START INTERVAL_TYPE -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.action.intType.$touched || forms.action.$submitted) && forms.action.intType.$invalid}">\n								<label class="control-label">{{ \'APPLICATION_INTERVAL_TYPE\' | translate }}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="application.intType" theme="bootstrap" name="intType" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{ $select.selected.name | translate }}</ui-select-match>\n									<ui-select-choices repeat="intType.value as intType in $application.intTypes | filter: $select.search">\n										{{ intType.name | translate }}\n									</ui-select-choices>\n								</ui-select>\n								<span data-ng-show="(forms.action.intType.$touched || forms.action.$submitted) && forms.action.intType.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END INTERVAL_TYPE -->\n\n							<div class="app-settings" ng-slide-down="application.intType === \'custom\'" lazy-render duration="1">\n								<!-- START TIME -->\n								<div class="form-group">\n									<label class="control-label">{{ \'APPLICATION_TIME\' | translate }}</label>\n									<div class="input-group input-large">\n										<fieldset class="pull-left" ng-disabled="application.alwaysTime">\n											<uib-timepicker name="t_from" data-ng-model="application.t_from" show-meridian="false" show-spinners="false" mousewheel="false"></uib-timepicker>\n										</fieldset>\n										<div class="input-group-addon col-md-1 interval-to pull-left">to</div>\n										<fieldset ng-disabled="application.alwaysTime"><uib-timepicker  name="t_to" data-ng-model="application.t_to" show-meridian="false" show-spinners="false" mousewheel="false"></uib-timepicker></fieldset>\n										<!-- <label class="control-label pointer-cursor"><input type="checkbox" data-ng-model="application.alwaysTime">{{\'APPLICATION_ALWAYS\' | translate}}</label> -->\n									</div>\n								</div>\n								<!-- END TIME -->\n\n								<!-- START ALWAYS -->\n								<div class="form-group">\n									<label class="control-label">{{ \'APPLICATION_ALWAYS\' | translate }}</label>\n									<div class="input-group input-large">\n										<label class="control-label pointer-cursor">\n											<input\n												bs-switch\n												data-ng-model="application.alwaysTime"\n												type="checkbox"\n												switch-active="{{ isActive }}"\n												switch-on-text="{{ \'APPLICATION_YES\' | translate }}"\n												switch-off-text="{{ \'APPLICATION_NO\' | translate }}"\n												switch-on-color="{{ onColor }}"\n												switch-off-color="{{ offColor }}"\n												switch-animate="{{ animate }}"\n												switch-size="{{ size }}"\n												switch-label="{{ label }}"\n												switch-icon="{{ icon }}"\n												switch-radio-off="{{ radioOff }}"\n												switch-label-width="{{ labelWidth }}"\n												switch-handle-width="{{ handleWidth }}">\n											<!-- <input type="checkbox" data-ng-model="application.alwaysTime"> -->\n										</label>\n									</div>\n								</div>\n								<!-- END ALWAYS -->\n\n								<!-- START WEEKDAY -->\n								<div class="form-group">\n									<label class="control-label">{{ \'APPLICATION_WEEKDAY\' | translate }}</label>\n									<div class="input-group input-large">\n										<ui-select data-ng-model="application.wd_from" theme="bootstrap" name="wd_from">\n											<ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n											<ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n												{{ weekDay.name | translate}}\n											</ui-select-choices>\n										</ui-select>\n										<span class="input-group-addon">to</span>\n										<ui-select data-ng-model="application.wd_to" theme="bootstrap" name="wd_to">\n											<ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n											<ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n												{{ weekDay.name | translate }}\n											</ui-select-choices>\n										</ui-select>\n									</div>\n								</div>\n								<!-- END WEEKDAY -->\n\n								<!-- START MONTHDAY -->\n								<div class="form-group">\n									<label class="control-label">{{ \'APPLICATION_MONTHDAY\' | translate }}</label>\n									<div class="input-group input-large">\n										<ui-select data-ng-model="application.md_from" theme="bootstrap" name="md_from">\n											<ui-select-match>{{$select.selected}}</ui-select-match>\n											<ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n												{{monthDay}}\n											</ui-select-choices>\n										</ui-select>\n										<span class="input-group-addon">to</span>\n										<ui-select data-ng-model="application.md_to" theme="bootstrap" name="md_to">\n											<ui-select-match>{{$select.selected}}</ui-select-match>\n											<ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n												{{monthDay}}\n											</ui-select-choices>\n										</ui-select>\n									</div>\n								</div>\n								<!-- END MONTHDAY -->\n\n								<!-- START MONTH -->\n								<div class="form-group">\n									<label class="control-label">{{ \'APPLICATION_MONTH\' | translate }}</label>\n									<div class="input-group input-large">\n										<ui-select data-ng-model="application.m_from" theme="bootstrap" name="m_from">\n											<ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n											<ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n												{{ month.name | translate }}\n											</ui-select-choices>\n										</ui-select>\n										<span class="input-group-addon">to</span>\n										<ui-select data-ng-model="application.m_to" theme="bootstrap" name="m_to">\n											<ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n											<ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n												{{ month.name | translate }}\n											</ui-select-choices>\n										</ui-select>\n									</div>\n								</div>\n								<!-- END MONTH -->\n							</div>\n\n							<div class="app-settings" ng-slide-down="application.intType === \'list\'" lazy-render duration="1" data-ng-init="getIntervals()">\n\n								<!-- START INTERVALS -->\n								<div class="form-group" data-ng-class="{\'has-error\': (forms.action.IntervalId.$touched || forms.action.$submitted) && forms.action.IntervalId.$invalid}">\n									<label class="control-label">{{\'APPLICATION_INTERVALS\' | translate}}<span class="required" aria-required="true">*</span></label>\n									<ui-select data-ng-model="application.IntervalId" theme="bootstrap" name="IntervalId" required>\n										<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{ $select.selected.name}}</ui-select-match>\n										<ui-select-choices repeat="interval.id as interval in intervals | filter: $select.search">\n											{{ interval.name}}\n										</ui-select-choices>\n									</ui-select>\n									<span data-ng-show="(forms.action.IntervalId.$touched || forms.action.$submitted) && forms.action.IntervalId.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END INTERVALS -->\n\n							</div>\n\n							<input class="btn green-haze" type="submit" data-ng-click="next()" value="{{\'APPLICATION_CONTINUE\' | translate}}"/>\n						</form>\n					</wz-step>\n					<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n						<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n						<!-- <button class="btn green-haze" type="button" wz-previous><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button> -->\n						<input class="btn green-haze" type="submit" data-ng-click="next()" value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n					</wz-step>\n				</wizard>\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),
+a.put("app/channels/chat/website/view/embedding/view/view.html",'<div class="row" data-ng-init="initView()">\n  <div class="col-md-12">\n    <div class="portlet light">\n      <div class="portlet-title">\n        <div class="caption caption-md">\n          <i class="icon-globe theme-font hide"></i>\n          <span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_EMBEDDING\' | translate}}</span>\n        </div>\n        <div class="actions">\n          <div class="btn-group">\n            <a class="btn green-jungle" href="#" data-ng-click="copyToClipboard();">\n              <i class="fa fa-clipboard"></i> {{\'APPLICATION_COPY_TO_CLIPBOARD\' | translate}}\n            </a>\n          </div>\n        </div>\n      </div>\n      <div class="portlet-body">\n        <div class="row">\n          <div class="col-md-12">\n            <h3>{{\'APPLICATION_EMBED_SNIPPET\' | translate}}</h3>\n            <p>\n              {{\'MESSAGE_EMBED_SNIPPET\' | translate}}\n            </p>\n            <div class="form-body">\n              <div class="form-group">\n                <div class="col-md-12">\n                  <code-mirror lang="html" model="snippetCode"></code-mirror>\n                </div>\n              </div>\n            </div>\n          </div>\n        </div>\n      </div>\n    </div>\n  </div>\n</div>\n'),a.put("app/channels/chat/website/view/form/view/view.html",'<div class="row" data-ng-init="getChatWebsiteFields(\'online\');getChatWebsiteFields(\'offline\');">\n  <div class="col-md-12">\n    <div class="portlet light">\n      <div class="portlet-title tabbable-line">\n        <ul class="nav nav-tabs">\n          <li class="active">\n            <a href="#" data-target="#tab_1_1" data-toggle="tab">{{\'APPLICATION_ONLINE\' | translate}}</a>\n          </li>\n          <li>\n            <a href="#" data-target="#tab_1_2" data-toggle="tab">{{\'APPLICATION_OFFLINE\' | translate}}</a>\n          </li>\n        </ul>\n      </div>\n    <div class="portlet-body">\n      <div class="row">\n        <div class="col-md-12">\n          <div class="tab-content">\n            <div class="tab-pane active" id="tab_1_1">\n              <div class="row">\n                <div class="col-md-6">\n                  <div class="portlet">\n                    <div class="portlet-title">\n                      <div class="caption font-green-sharp">\n                        <i class="icon-book-open font-green-sharp"></i>\n                        <span class="caption-subject">{{ \'APPLICATION_FIELDS_SELECTED\' | translate }}</span>\n                      </div>\n                      <div class="actions">\n                        <div class="btn-group">\n                          <a class="btn green-jungle" href="#" data-ng-click="saveForm(\'online\');">\n                            <i class="fa fa-check"></i> {{ \'APPLICATION_SAVE\' | translate }}\n                          </a>\n                        </div>\n                      </div>\n                    </div>\n                    <div class="portlet-body">\n                      <div fb-builder="online"></div>\n                    </div>\n                  </div>\n                </div>\n                <div class="col-md-6">\n                  <div class="portlet">\n                    <div class="portlet-title">\n                      <div class="caption font-green-sharp">\n                        <i class="icon-book-open font-green-sharp"></i>\n                        <span class="caption-subject">{{ \'APPLICATION_FIELDS_AVAILABLE\' | translate }}</span>\n                      </div>\n                    </div>\n                    <div class="portlet-body">\n                      <div fb-components></div>\n                    </div>\n                  </div>\n                </div>\n              </div>\n            </div>\n            <div class="tab-pane" id="tab_1_2">\n              <div class="row">\n                <div class="col-md-6">\n                  <div class="portlet">\n                    <div class="portlet-title">\n                      <div class="caption font-green-sharp">\n                        <i class="icon-book-open font-green-sharp"></i>\n                        <span class="caption-subject">{{ \'APPLICATION_FIELDS_SELECTED\' | translate }}</span>\n                      </div>\n                      <div class="actions">\n                        <div class="btn-group">\n                          <a class="btn green-jungle" href="#" data-ng-click="saveForm(\'offline\');">\n                            <i class="fa fa-check"></i> {{ \'APPLICATION_SAVE\' | translate }}\n                          </a>\n                        </div>\n                      </div>\n                    </div>\n                    <div class="portlet-body">\n                      <div fb-builder="offline"></div>\n                    </div>\n                  </div>\n                </div>\n                <div class="col-md-6">\n                  <div class="portlet">\n                    <div class="portlet-title">\n                      <div class="caption font-green-sharp">\n                        <i class="icon-book-open font-green-sharp"></i>\n                        <span class="caption-subject">{{ \'APPLICATION_FIELDS_AVAILABLE\' | translate }}</span>\n                      </div>\n                    </div>\n                    <div class="portlet-body">\n                      <div fb-components></div>\n                    </div>\n                  </div>\n                </div>\n              </div>\n            </div>\n          </div>\n        </div>\n      </div>\n    </div>\n  </div>\n</div>\n</div>\n'),a.put("app/channels/chat/website/view/proactive/list/list.create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{title}}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.name.$touched || form.$submitted) && form.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n      <span data-ng-show="(form.name.$touched || form.$submitted) && form.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n    <!-- START TYPE -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.type.$touched || form.$submitted) && form.type.$invalid}">\n      <label class="control-label">{{\'APPLICATION_TYPE\' | translate}}</label>\n      <ui-select name="type" ng-model="item.type" theme="bootstrap" ng-disabled="disabled">\n        <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.title}}</ui-select-match>\n        <ui-select-choices repeat="item.type as item in possibleType | filter: $select.search">\n          <div ng-bind-html="item.title | highlight: $select.search"></div>\n        </ui-select-choices>\n      </ui-select>\n    </div>\n    <!-- END TYPE -->\n\n    <!-- START SELECTOR -->\n    <div class="form-group" data-ng-if="item.type === \'mouseOver\'" data-ng-class="{\'has-error\': (form.selector.$touched || form.$submitted) && form.selector.$invalid}">\n      <label class="control-label">{{\'APPLICATION_SELECTOR\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="selector" placeholder="{{\'APPLICATION_SELECTOR\' | translate}}" class="form-control" data-ng-model="item.selector" required/>\n      <span data-ng-show="(form.name.$touched || form.$submitted) && form.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END SELECTOR -->\n\n    <!-- START TIMEOUT -->\n    <div class="form-group" data-ng-if="item.type === \'timeout\'" data-ng-class="{\'has-error\': (form.timeout.$touched || form.$submitted) && form.timeout.$invalid}">\n      <label class="control-label">{{\'APPLICATION_TIMEOUT\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="number" name="timeout" placeholder="{{\'APPLICATION_TIMEOUT\' | translate}}" class="form-control" data-ng-model="item.timeout" min="0" required/>\n      <span data-ng-show="(form.name.$touched || form.$submitted) && form.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END TIMEOUT -->\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="save()" ng-disabled="form.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/channels/chat/website/view/proactive/list/list.html",'<div class="row" data-ng-init="initProactiveActions()">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_PROACTIVE_ACTIONS\' | translate}}</span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<a class="btn green-jungle" href="#" data-toggle="dropdown" data-ng-click="createItem()">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_PROACTIVE_ACTION\' | translate }}\n						</a>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/channels/chat/website/view/snippet/view/view.html",'<div class="row" data-ng-init="initView()">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_SNIPPET\' | translate}}</span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{\'APPLICATION_APPEARANCE\' | translate}}</a>\n					</li>\n					<li>\n						<a href="#" data-target="#tab_1_2" data-toggle="tab">{{\'APPLICATION_FORMS\' | translate}}</a>\n					</li>\n					<li>\n						<a href="#" data-target="#tab_1_3" data-toggle="tab">{{\'APPLICATION_LABELS\' | translate}}</a>\n					</li>\n					<li>\n						<a href="#" data-target="#tab_1_4" data-toggle="tab">{{\'APPLICATION_SETTINGS\' | translate}}</a>\n					</li>\n					<li>\n						<a href="#" data-target="#tab_1_5" data-toggle="tab">{{\'APPLICATION_OFFLINE\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n			<div class="portlet-body">\n				<div class="row">\n						<div class="col-md-8">\n							<div class="tab-content">\n\n								<!-- APPEARANCE TAB -->\n								<div class="tab-pane active" id="tab_1_1">\n									<form name="forms.formAppearance" data-ng-submit="forms.formAppearance.$valid && updateItem()" novalidate>\n\n										<!-- START MAIN COLOR -->\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.formAppearance.mainColor.$touched || forms.formAppearance.$submitted) && forms.formAppearance.host.$invalid}">\n											<label class="control-label">{{\'APPLICATION_MAIN_COLOR\' | translate}} <span class="required" aria-required="true">*</span></label>\n											<input colorpicker type="text" name="mainColor" placeholder="{{\'APPLICATION_MAIN_COLOR\' | translate}}" style="color:{{chatWebsite.color}}" class="form-control" data-ng-model="chatWebsite.color" required/>\n											<span data-ng-show="(forms.formAppearance.mainColor.$touched || forms.formAppearance.$submitted) && forms.formAppearance.mainColor.$invalid && forms.formAppearance.mainColor.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END MAIN COLOR -->\n\n										<!-- START FOCUS COLOR -->\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.formAppearance.focusColor.$touched || forms.formAppearance.$submitted) && forms.formAppearance.focusColor.$invalid}">\n											<label class="control-label">{{\'APPLICATION_FOCUS_COLOR\' | translate}} <span class="required" aria-required="true">*</span></label>\n											<input colorpicker type="text" name="focusColor" placeholder="{{\'APPLICATION_FOCUS_COLOR\' | translate}}" style="color:{{chatWebsite.color_focus}}" class="form-control" data-ng-model="chatWebsite.color_focus" required/>\n											<span data-ng-show="(forms.formAppearance.focusColor.$touched || forms.formAppearance.$submitted) && forms.formAppearance.focusColor.$invalid && forms.formAppearance.focusColor.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END FOCUS COLOR -->\n\n										<!-- START BUTTON COLOR -->\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.formAppearance.buttonColor.$touched || forms.formAppearance.$submitted) && forms.formAppearance.buttonColor.$invalid}">\n											<label class="control-label">{{\'APPLICATION_BUTTON_COLOR\' | translate}} <span class="required" aria-required="true">*</span></label>\n											<input colorpicker type="text" name="buttonColor" placeholder="{{\'APPLICATION_BUTTON_COLOR\' | translate}}" style="color:{{chatWebsite.color_button}}" class="form-control" data-ng-model="chatWebsite.color_button" required/>\n											<span data-ng-show="(forms.formAppearance.buttonColor.$touched || forms.formAppearance.$submitted) && forms.formAppearance.buttonColor.$invalid && forms.formAppearance.buttonColor.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END BUTTON COLOR -->\n\n										<!-- START HEADER SHAPE -->\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.formAppearance.headerShape.$touched || forms.formAppearance.$submitted) && forms.formAppearance.headerShape.$invalid}">\n											<label class="control-label">{{\'APPLICATION_ANIMATION\' | translate}}</label>\n											<!-- <input colorpicker type="text" name="animationToggle" placeholder="{{\'APPLICATION_BUTTON_COLOR\' | translate}}" class="form-control" data-ng-model="chatWebsite.animation" required/> -->\n											<ui-select data-ng-model="chatWebsite.header_shape" name="headerShape" theme="bootstrap">\n												<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$translate.instant(\'APPLICATION_\' + $select.selected.toUpperCase())}}</ui-select-match>\n												<ui-select-choices repeat="headerShape in [\'rounded\',\'squared\'] | filter: $select.search">\n													<div ng-bind-html="$translate.instant(\'APPLICATION_\' + headerShape.toUpperCase()) | highlight: $select.search"></div>\n												</ui-select-choices>\n											</ui-select>\n										</div>\n										<!-- END HEADER SHAPE -->\n\n										<!-- START ANIMATION TOGGLE -->\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.formAppearance.animationToggle.$touched || forms.formAppearance.$submitted) && forms.formAppearance.animationToggle.$invalid}">\n											<label class="control-label">{{\'APPLICATION_ANIMATION\' | translate}}</label>\n											<!-- <input colorpicker type="text" name="animationToggle" placeholder="{{\'APPLICATION_BUTTON_COLOR\' | translate}}" class="form-control" data-ng-model="chatWebsite.animation" required/> -->\n											<ui-select data-ng-model="chatWebsite.animation" name="animationToggle" theme="bootstrap">\n												<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected ? \'On\' : \'Off\'}}</ui-select-match>\n												<ui-select-choices repeat="animationToggle in [true, false] | filter: $select.search">\n													<div ng-bind-html="animationToggle ? \'On\' : \'Off\' | highlight: $select.search"></div>\n												</ui-select-choices>\n											</ui-select>\n										</div>\n										<!-- END ANIMATION TOGGLE -->\n\n\n										<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n									</form>\n								</div>\n								<!-- END APPEARANCE TAB -->\n\n								<!-- FORMS TAB -->\n								<div class="tab-pane" id="tab_1_2">\n									<form name="forms.formFunctionality" data-ng-submit="forms.formFunctionality.$valid && updateItem()" novalidate>\n\n										<!-- START DOWNLOAD TRANSCRIPT -->\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.formFunctionality.animationToggle.$touched || forms.formFunctionality.$submitted) && forms.formFunctionality.animationToggle.$invalid}">\n											<label class="control-label">{{\'APPLICATION_DOWNLOAD_TRANSCRIPT\' | translate}}</label>\n											<ui-select data-ng-model="chatWebsite.download_transcript" name="downloadTranscript" theme="bootstrap">\n												<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected ? \'On\' : \'Off\'}}</ui-select-match>\n												<ui-select-choices repeat="downloadTranscript in [true, false] | filter: $select.search">\n													<div ng-bind-html="downloadTranscript ? \'On\' : \'Off\' | highlight: $select.search"></div>\n												</ui-select-choices>\n											</ui-select>\n										</div>\n										<!-- END DOWNLOAD TRANSCRIPT -->\n\n										<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n									</form>\n								</div>\n								<!-- END FORMS TAB -->\n\n								<!-- STRINGS TAB -->\n								<div class="tab-pane" id="tab_1_3">\n									<form name="forms.formLabel" data-ng-submit="forms.formLabel.$valid && updateItem()" novalidate>\n\n										<h4 class="block" data-ng-show="statePreview.state == \'online\'">{{\'APPLICATION_ONLINE_STATE\' | translate}}</h4>\n\n										<!-- START HEADER ONLINE -->\n										<div class="form-group" data-ng-show="statePreview.state == \'online\'" data-ng-class="{\'has-error\': (forms.formLabel.headerOnline.$touched || forms.formLabel.$submitted) && forms.formLabel.headerOnline.$invalid}">\n											<label class="control-label">{{\'APPLICATION_HEADER_ONLINE\' | translate}}</label>\n											<input type="text" name="headerOnline" placeholder="{{\'APPLICATION_HEADER_ONLINE\' | translate}}" class="form-control" data-ng-model="chatWebsite.header_online"/>\n										</div>\n										<!-- END HEADER ONLINE -->\n\n										<!-- START ONLINE MESSAGE-->\n										<div class="form-group" data-ng-show="statePreview.state == \'online\'" data-ng-class="{\'has-error\': (forms.formLabel.onlineMessage.$touched || forms.formLabel.$submitted) && forms.formLabel.onlineMessage.$invalid}">\n											<label class="control-label">{{\'APPLICATION_ONLINE_MESSAGE\' | translate}}</label>\n											<input type="text" name="onlineMessage" placeholder="{{\'APPLICATION_ONLINE_MESSAGE\' | translate}}" class="form-control" data-ng-model="chatWebsite.online_message"/>\n										</div>\n										<!-- END HEADER ONLINE -->\n\n										<!-- START USERNAME PLACEHOLDER -->\n										<div class="form-group" data-ng-show="statePreview.state == \'online\' || statePreview.state == \'offline\'" data-ng-class="{\'has-error\': (forms.formLabel.usernamePlaceholder.$touched || forms.formLabel.$submitted) && forms.formLabel.usernamePlaceholder.$invalid}">\n											<label class="control-label">{{\'APPLICATION_USERNAME_PLACEHOLDER\' | translate}}</label>\n											<input type="text" name="usernamePlaceholder" placeholder="{{\'APPLICATION_USERNAME_PLACEHOLDER\' | translate}}" class="form-control" data-ng-model="chatWebsite.username_placeholder"/>\n										</div>\n										<!-- END USERNAME PLACEHOLDER -->\n\n										<!-- START EMAIL PLACEHOLDER -->\n										<div class="form-group" data-ng-show="statePreview.state == \'online\' || statePreview.state == \'offline\'" data-ng-class="{\'has-error\': (forms.formLabel.emailPlaceholder.$touched || forms.formLabel.$submitted) && forms.formLabel.emailPlaceholder.$invalid}">\n											<label class="control-label">{{\'APPLICATION_EMAIL_PLACEHOLDER\' | translate}}</label>\n											<input type="text" name="emailPlaceholder" placeholder="{{\'APPLICATION_EMAIL_PLACEHOLDER\' | translate}}" class="form-control" data-ng-model="chatWebsite.email_placeholder"/>\n										</div>\n										<!-- END EMAIL PLACEHOLDER -->\n\n										<!-- START START CHAT BUTTON -->\n										<div class="form-group" data-ng-show="statePreview.state == \'online\'" data-ng-class="{\'has-error\': (forms.formLabel.startChatButton.$touched || forms.formLabel.$submitted) && forms.formLabel.startChatButton.$invalid}">\n											<label class="control-label">{{\'APPLICATION_START_CHAT_BUTTON\' | translate}}</label>\n											<input type="text" name="startChatButton" placeholder="{{\'APPLICATION_START_CHAT_BUTTON\' | translate}}" class="form-control" data-ng-model="chatWebsite.start_chat_button"/>\n										</div>\n										<!-- END START CHAT BUTTON -->\n\n										<h4 class="block" data-ng-show="statePreview.state == \'rating\'">{{\'APPLICATION_RATING_STATE\' | translate}}</h4>\n\n										<!-- START RATING MESSAGE -->\n										<div class="form-group" data-ng-show="statePreview.state == \'rating\'" data-ng-class="{\'has-error\': (forms.formLabel.ratingMessage.$touched || forms.formLabel.$submitted) && forms.formLabel.ratingMessage.$invalid}">\n											<label class="control-label">{{\'APPLICATION_RATING_MESSAGE\' | translate}}</label>\n											<input type="text" name="ratingMessage" placeholder="{{\'APPLICATION_RATING_MESSAGE\' | translate}}" class="form-control" data-ng-model="chatWebsite.rating_message"/>\n										</div>\n										<!-- END RATING MESSAGE -->\n\n										<!-- START RATING SEND BUTTON -->\n										<div class="form-group" data-ng-show="statePreview.state == \'rating\'" data-ng-class="{\'has-error\': (forms.formLabel.ratingSend.$touched || forms.formLabel.$submitted) && forms.formLabel.ratingSend.$invalid}">\n											<label class="control-label">{{\'APPLICATION_RATING_SEND_BUTTON\' | translate}}</label>\n											<input type="text" name="ratingSend" placeholder="{{\'APPLICATION_RATING_SEND_BUTTON\' | translate}}" class="form-control" data-ng-model="chatWebsite.rating_send"/>\n										</div>\n										<!-- END RATING SEND BUTTON -->\n\n										<!-- START RATING SKIP BUTTON -->\n										<div class="form-group" data-ng-show="statePreview.state == \'rating\'" data-ng-class="{\'has-error\': (forms.formLabel.ratingSkip.$touched || forms.formLabel.$submitted) && forms.formLabel.ratingSkip.$invalid}">\n											<label class="control-label">{{\'APPLICATION_RATING_SKIP_BUTTON\' | translate}}</label>\n											<input type="text" name="ratingSkip" placeholder="{{\'APPLICATION_RATING_SKIP_BUTTON\' | translate}}" class="form-control" data-ng-model="chatWebsite.rating_skip"/>\n										</div>\n										<!-- END RATING SKIP BUTTON -->\n\n										<h4 class="block" data-ng-show="statePreview.state == \'offline\'">{{\'APPLICATION_OFFLINE_STATE\' | translate}}</h4>\n\n										<!-- START HEADER OFFLINE -->\n										<div class="form-group" data-ng-show="statePreview.state == \'offline\'" data-ng-class="{\'has-error\': (forms.formLabel.headerOffline.$touched || forms.formLabel.$submitted) && forms.formLabel.headerOnline.$invalid}">\n											<label class="control-label">{{\'APPLICATION_HEADER_OFFLINE\' | translate}}</label>\n											<input type="text" name="headerOffline" placeholder="{{\'APPLICATION_HEADER_OFFLINE\' | translate}}" class="form-control" data-ng-model="chatWebsite.header_offline"/>\n										</div>\n										<!-- END HEADER OFFLINE -->\n\n										<!-- START OFFLINE MESSAGE-->\n										<div class="form-group" data-ng-show="statePreview.state == \'offline\'" data-ng-class="{\'has-error\': (forms.formLabel.offlineMessage.$touched || forms.formLabel.$submitted) && forms.formLabel.onlineMessage.$invalid}">\n											<label class="control-label">{{\'APPLICATION_OFFLINE_MESSAGE\' | translate}}</label>\n											<input type="text" name="offlineMessage" placeholder="{{\'APPLICATION_OFFLINE_MESSAGE\' | translate}}" class="form-control" data-ng-model="chatWebsite.offline_message"/>\n										</div>\n										<!-- END OFFLINE MESSAGE -->\n\n										<!-- START ENQUIRY MESSAGE PLACEHOLDER-->\n										<div class="form-group" data-ng-show="statePreview.state == \'offline\'" data-ng-class="{\'has-error\': (forms.formLabel.enquiryMessagePlaceholder.$touched || forms.formLabel.$submitted) && forms.formLabel.onlineMessage.$invalid}">\n											<label class="control-label">{{\'APPLICATION_ENQUIRY_MESSAGE_PLACEHOLDER\' | translate}}</label>\n											<input type="text" name="enquiryMessagePlaceholder" placeholder="{{\'APPLICATION_ENQUIRY_MESSAGE_PLACEHOLDER\' | translate}}" class="form-control" data-ng-model="chatWebsite.enquiry_message_placeholder"/>\n										</div>\n										<!-- END ENQUIRY MESSAGE PLACEHOLDER -->\n\n										<!-- START ENQUIRY BUTTON -->\n										<div class="form-group" data-ng-show="statePreview.state == \'offline\'" data-ng-class="{\'has-error\': (forms.formLabel.enquiryButton.$touched || forms.formLabel.$submitted) && forms.formLabel.startChatButton.$invalid}">\n											<label class="control-label">{{\'APPLICATION_ENQUIRY_BUTTON\' | translate}}</label>\n											<input type="text" name="enquiryButton" placeholder="{{\'APPLICATION_ENQUIRY_BUTTON\' | translate}}" class="form-control" data-ng-model="chatWebsite.enquiry_button"/>\n										</div>\n										<!-- END ENQUIRY BUTTON -->\n\n										<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n									</form>\n								</div>\n								<!-- END STRINGS TAB -->\n\n								<!-- SETTINGS TAB -->\n								<div class="tab-pane" id="tab_1_4">\n									<form name="forms.formSetting" data-ng-submit="forms.formSetting.$valid && updateItem()" novalidate>\n\n										<!-- START NAME -->\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.formSetting.name.$touched || forms.formSetting.$submitted) && forms.formSetting.name.$invalid}">\n											<label class="control-label">{{\'APPLICATION_NAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n											<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="chatWebsite.name" required/>\n											<span data-ng-show="(forms.formSetting.name.$touched || forms.formSetting.$submitted) && forms.formSettings.name.$invalid && forms.formSetting.name.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END NAME -->\n\n										<!-- START ADDRESS -->\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.formSetting.address.$touched || forms.formSetting.$submitted) && forms.formSetting.address.$invalid}">\n											<label class="control-label">{{\'APPLICATION_WEB_ADDRESS\' | translate}} <span class="required" aria-required="true">*</span></label>\n											<input type="url" name="address" placeholder="{{\'APPLICATION_WEB_ADDRESS\' | translate}}" class="form-control" data-ng-model="chatWebsite.address" required/>\n											<span data-ng-show="(forms.formSetting.address.$touched || forms.formSetting.$submitted) && forms.formSetting.address.$invalid && forms.formSetting.address.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END ADDRESS -->\n\n										<!-- START REMOTE IP -->\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.formSetting.remote.$touched || forms.formSetting.$submitted) && forms.formSetting.remote.$invalid}">\n											<label class="control-label">{{\'APPLICATION_MOTION_ADDRESS\' | translate}} <span class="required" aria-required="true">*</span></label>\n											<input type="url" name="remote" placeholder="{{\'APPLICATION_MOTION_ADDRESS\' | translate}}" class="form-control" data-ng-model="chatWebsite.remote" required/>\n											<span data-ng-show="(forms.formSetting.remote.$touched || forms.formSetting.$submitted) && forms.formSetting.remote.$invalid && forms.formSetting.remote.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END REMOTE IP -->\n\n										<!-- START DESCRIPTION -->\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.formSetting.description.$touched || forms.formSetting.$submitted) && forms.formSetting.description.$invalid}">\n											<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n											<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="chatWebsite.description"/>\n										</div>\n										<!-- END DESCRIPTION -->\n\n										<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n									</form>\n								</div>\n								<!-- END SETTINGS TAB -->\n\n								<!-- OFFLINE TAB -->\n								<div class="tab-pane" id="tab_1_5">\n									<form name="forms.formOffline" data-ng-submit="forms.formOffline.$valid && updateItem()" novalidate>\n\n										<!-- START ENQUIRY ENABLE -->\n										<div class="form-group">\n											<label class="control-label">{{\'APPLICATION_ENQUIRY_ENABLED\' | translate}}</label></br>\n											<input\n											    bs-switch\n													class="form-control"\n											    ng-model="chatWebsite.enquiry_enable"\n											    type="checkbox"\n											    switch-active="{{ enquirySwitch.isActive }}"\n											    switch-on-text="{{ enquirySwitch.onText }}"\n											    switch-off-text="{{ enquirySwitch.offText }}"\n											    switch-on-color="{{ enquirySwitch.onColor }}"\n											    switch-off-color="{{ enquirySwitch.offColor }}"\n											    switch-animate="{{ enquirySwitch.animate }}"\n											    switch-size="{{ enquirySwitch.size }}"\n											    switch-label="{{ enquirySwitch.label }}"\n											    switch-icon="{{ enquirySwitch.icon }}"\n											    switch-radio-off="{{ enquirySwitch.radioOff }}"\n											    switch-label-width="{{ enquirySwitch.labelWidth }}"\n											    switch-handle-width="{{ enquirySwitch.handleWidth }}">\n										</div>\n										<!-- END ENQUIRY ENABLE -->\n\n										<!-- START ENQUIRY FORWARDING -->\n										<div class="form-group" data-ng-if="chatWebsite.enquiry_enable">\n											<label class="control-label">{{\'APPLICATION_ENQUIRY_FORWARDING\' | translate}}</label></br>\n											<input\n											    bs-switch\n													class="form-control"\n											    ng-model="chatWebsite.enquiry_forwarding"\n											    type="checkbox"\n											    switch-active="{{ enquirySwitch.isActive }}"\n											    switch-on-text="{{ enquirySwitch.onText }}"\n											    switch-off-text="{{ enquirySwitch.offText }}"\n											    switch-on-color="{{ enquirySwitch.onColor }}"\n											    switch-off-color="{{ enquirySwitch.offColor }}"\n											    switch-animate="{{ enquirySwitch.animate }}"\n											    switch-size="{{ enquirySwitch.size }}"\n											    switch-label="{{ enquirySwitch.label }}"\n											    switch-icon="{{ enquirySwitch.icon }}"\n											    switch-radio-off="{{ enquirySwitch.radioOff }}"\n											    switch-label-width="{{ enquirySwitch.labelWidth }}"\n											    switch-handle-width="{{ enquirySwitch.handleWidth }}">\n											<span class="help-block col-md-12">{{\'MESSAGE_REMEMBER_SMTP_SERVICE_ACCOUNT\' | translate}}.</span>\n										</div>\n										<!-- END ENQUIRY FORWARDING -->\n\n										<!-- START REMOTE IP -->\n										<div class="form-group" data-ng-if="chatWebsite.enquiry_enable && chatWebsite.enquiry_forwarding" data-ng-class="{\'has-error\': (forms.formOffline.forwardingAddress.$touched || forms.formOffline.$submitted) && forms.formSetting.forwardingAddress.$invalid}">\n											<label class="control-label">{{\'APPLICATION_ENQUIRY_FORWARDING_ADDRESS\' | translate}}<span class="required" aria-required="true">*</span></label>\n											<input type="text" name="forwardingAddress" placeholder="{{\'APPLICATION_ADDRESS\' | translate}}" class="form-control" data-ng-model="chatWebsite.enquiry_forwarding_address" required/>\n											<span data-ng-show="(forms.formOffline.forwardingAddress.$touched || forms.formOffline.$submitted) && forms.formOffline.forwardingAddress.$invalid && forms.formOffline.forwardingAddress.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END REMOTE IP -->\n\n										<!-- START HEADER SHAPE -->\n										<div class="form-group" data-ng-if="chatWebsite.enquiry_enable && chatWebsite.enquiry_forwarding" data-ng-class="{\'has-error\': (forms.formOffline.OfflineTemplateId.$touched || forms.formOffline.$submitted) && forms.formOffline.OfflineTemplateId.$invalid}">\n											<label class="control-label">{{\'APPLICATION_TEMPLATE\' | translate}}<span class="required" aria-required="true">*</span></label>\n											<ui-select data-ng-model="chatWebsite.OfflineTemplateId" name="OfflineTemplateId" theme="bootstrap" required>\n												<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n												<ui-select-choices repeat="mailTemplate.id as mailTemplate in mailTemplates | filter: $select.search">\n													<div ng-bind-html="mailTemplate.name | highlight: $select.search"></div>\n												</ui-select-choices>\n											</ui-select>\n											<span data-ng-show="(forms.formOffline.OfflineTemplateId.$touched || forms.formOffline.$submitted) && forms.formOffline.OfflineTemplateId.$invalid && forms.formOffline.OfflineTemplateId.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END HEADER SHAPE -->\n\n										<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n									</form>\n								</div>\n								<!-- END OFFLINE TAB -->\n							</div>\n						</div>\n						<div class="col-md-4">\n							<!-- START STATE -->\n							<div class="form-group">\n								<!-- <label class="control-label">{{\'APPLICATION_ANIMATION\' | translate}}</label> -->\n								<!-- <input colorpicker type="text" name="animationToggle" placeholder="{{\'APPLICATION_BUTTON_COLOR\' | translate}}" class="form-control" data-ng-model="chatWebsite.animation" required/> -->\n								<ui-select data-ng-model="statePreview.state" name="statePreview" theme="bootstrap">\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected}}</ui-select-match>\n									<ui-select-choices repeat="statePreview in [\'online\',\'rating\',\'offline\'] | filter: $select.search">\n										<div ng-bind-html="statePreview | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n							</div>\n							<!-- END STATE -->\n							<preview></preview>\n						</div>\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),
+a.put("app/channels/chat/website/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initView()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-puzzle"></i>\n					<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-bubble"></i>\n					<a href="#">{{ \'APPLICATION_CHAT\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-globe"></i>\n					<a href="/channels/chat/websites/list">{{ \'APPLICATION_WEB_SITES\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<a href="#">{{chatWebsite.name}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img src="assets/images/media/website.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{chatWebsite.name}}\n					</div>\n					<div class="profile-usertitle-job">\n						{{chatWebsite.address}}\n					</div>\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.includes(\'main.channels.chat.websites.view.embedding\')}">\n							<a ng-href="/channels/chat/websites/view/{{chatWebsite.id}}/embedding/view">\n							<i class="icon-settings"></i>\n							{{ \'APPLICATION_EMBEDDING\' | translate }} </a>\n						</li>\n						<li data-ng-class="{active: $state.includes(\'main.channels.chat.websites.view.snippet\')}">\n							<a ng-href="/channels/chat/websites/view/{{chatWebsite.id}}/snippet/view">\n							<i class="icon-note"></i>\n							{{ \'APPLICATION_SNIPPET\' | translate }} </a>\n						</li>\n						<li data-ng-class="{active: $state.includes(\'main.channels.chat.websites.view.form\')}">\n							<a ng-href="/channels/chat/websites/view/{{chatWebsite.id}}/forms/view">\n							<i class="icon-list"></i>\n							{{ \'APPLICATION_FORMS\' | translate }} </a>\n						</li>\n						<li data-ng-class="{active: $state.includes(\'main.channels.chat.websites.view.proactive\')}">\n							<a ng-href="/channels/chat/websites/view/{{chatWebsite.id}}/proactive/list">\n							<i class="icon-target"></i>\n							{{ \'APPLICATION_PROACTIVE_ACTIONS\' | translate }} </a>\n						</li>\n						<li data-ng-class="{active: $state.includes(\'main.channels.chat.websites.view.actions\')}">\n							<a ng-href="/channels/chat/websites/view/{{chatWebsite.id}}/actions/list">\n							<i class="icon-directions"></i>\n							{{ \'APPLICATION_ACTIONS\' | translate }} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/chat/website/wizard/wizard.html",'<!-- BEGIN PAGE HEADER-->\n<div class="row">\n	<div class="col-md-12">\n			<div class="page-bar">\n				<ul class="page-breadcrumb">\n					<li>\n						<i class="icon-rocket"></i>\n						<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-bubble"></i>\n						<a href="#">{{ \'APPLICATION_CHAT\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-globe"></i>\n						<a href="/channels/chat/websites/list">{{ \'APPLICATION_WEB_SITES\' | translate }}</a>\n					</li>\n				</ul>\n			</div>\n		</div>\n</div>\n<!-- END PAGE HEADER-->\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-notebook font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_WEB_SITE\' | translate }} WIZARD</a> </span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<wizard on-finish="createItem()">\n          <wz-step title="{{\'APPLICATION_WEB_SITE_INFO\' | translate}}" canexit="exitValidation(forms.formSetting.$valid)">\n						<form name="forms.formSetting" novalidate>\n\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formSetting.name.$touched || forms.formSetting.$submitted) && forms.formSetting.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n								<span data-ng-show="forms.formSetting.name.$touched && !forms.formSettings.name.$valid && forms.formSetting.name.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<!-- START ADDRESS -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formSetting.address.$touched || forms.formSetting.$submitted) && forms.formSetting.address.$invalid}">\n								<label class="control-label">{{\'APPLICATION_WEB_ADDRESS\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="url" name="address" placeholder="{{\'APPLICATION_WEB_ADDRESS\' | translate}}" class="form-control" data-ng-model="item.address" required/>\n								<span data-ng-show="(forms.formSetting.address.$touched || forms.formSetting.$submitted) && forms.formSetting.address.$invalid && forms.formSetting.address.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END ADDRESS -->\n\n							<!-- START REMOTE IP -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formSetting.remote.$touched || forms.formSetting.$submitted) && forms.formSetting.remote.$invalid}">\n								<label class="control-label">{{\'APPLICATION_MOTION_ADDRESS\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="url" name="remote" placeholder="{{\'APPLICATION_MOTION_ADDRESS\' | translate}}" class="form-control" data-ng-model="item.remote" required/>\n								<span data-ng-show="(forms.formSetting.remote.$touched || forms.formSetting.$submitted) && forms.formSetting.remote.$invalid && forms.formSetting.remote.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END REMOTE IP -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.form.description"/>\n							</div>\n							<!-- END DESCRIPTION -->\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" ng-click="next()"/>\n						</form>\n					</wz-step>\n\n					<wz-step title="{{\'APPLICATION_WEB_SITE_APPEARANCE\' | translate}}" canexit="exitValidation(forms.formAppearance.$valid)">\n						<form name="forms.formAppearance" novalidate>\n\n							<!-- START MAIN COLOR -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formAppearance.mainColor.$touched || forms.formAppearance.$submitted) && forms.formAppearance.host.$invalid}">\n								<label class="control-label">{{\'APPLICATION_MAIN_COLOR\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input colorpicker type="text" name="mainColor" placeholder="{{\'APPLICATION_MAIN_COLOR\' | translate}}" style="color:{{item.color}}" class="form-control" data-ng-model="item.color" required/>\n								<span data-ng-show="(forms.formAppearance.mainColor.$touched || forms.formAppearance.$submitted) && forms.formAppearance.mainColor.$invalid && forms.formAppearance.mainColor.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END MAIN COLOR -->\n\n							<!-- START FOCUS COLOR -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formAppearance.focusColor.$touched || forms.formAppearance.$submitted) && forms.formAppearance.focusColor.$invalid}">\n								<label class="control-label">{{\'APPLICATION_FOCUS_COLOR\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input colorpicker type="text" name="focusColor" placeholder="{{\'APPLICATION_FOCUS_COLOR\' | translate}}" style="color:{{item.color_focus}}" class="form-control" data-ng-model="item.color_focus" required/>\n								<span data-ng-show="(forms.formAppearance.focusColor.$touched || forms.formAppearance.$submitted) && forms.formAppearance.focusColor.$invalid && forms.formAppearance.focusColor.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END FOCUS COLOR -->\n\n							<!-- START BUTTON COLOR -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formAppearance.buttonColor.$touched || forms.formAppearance.$submitted) && forms.formAppearance.buttonColor.$invalid}">\n								<label class="control-label">{{\'APPLICATION_BUTTON_COLOR\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input colorpicker type="text" name="buttonColor" placeholder="{{\'APPLICATION_BUTTON_COLOR\' | translate}}" style="color:{{item.color_button}}" class="form-control" data-ng-model="item.color_button" required/>\n								<span data-ng-show="(forms.formAppearance.buttonColor.$touched || forms.formAppearance.$submitted) && forms.formAppearance.buttonColor.$invalid && forms.formAppearance.buttonColor.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END BUTTON COLOR -->\n\n							<!-- START HEADER SHAPE -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formAppearance.headerShape.$touched || forms.formAppearance.$submitted) && forms.formAppearance.headerShape.$invalid}">\n								<label class="control-label">{{\'APPLICATION_HEADER_SHAPE\' | translate}}</label>\n								<!-- <input colorpicker type="text" name="animationToggle" placeholder="{{\'APPLICATION_BUTTON_COLOR\' | translate}}" class="form-control" data-ng-model="item.animation" required/> -->\n								<ui-select data-ng-model="item.header_shape" name="headerShape" theme="bootstrap">\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$translate.instant(\'APPLICATION_\' + $select.selected.toUpperCase())}}</ui-select-match>\n									<ui-select-choices repeat="headerShape in [\'rounded\',\'squared\'] | filter: $select.search">\n										<div ng-bind-html="$translate.instant(\'APPLICATION_\' + headerShape.toUpperCase()) | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n							</div>\n							<!-- END HEADER SHAPE -->\n\n							<!-- START ANIMATION TOGGLE -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formAppearance.animationToggle.$touched || forms.formAppearance.$submitted) && forms.formAppearance.animationToggle.$invalid}">\n								<label class="control-label">{{\'APPLICATION_ANIMATION\' | translate}}</label>\n								<ui-select data-ng-model="item.animation" name="animationToggle" theme="bootstrap">\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected  ? \'On\' : \'Off\'}}</ui-select-match>\n									<ui-select-choices repeat="filter in [true,false] | filter: $select.search">\n										<div ng-bind-html="filter ? \'On\' : \'Off\' | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n							</div>\n							<!-- END ANIMATION TOGGLE -->\n\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" ng-click="next()"/>\n						</form>\n					</wz-step>\n\n					<wz-step title="{{\'APPLICATION_LABELS\' | translate}}" canexit="exitValidation(forms.formLabel.$valid)">\n						<form name="forms.formLabel" novalidate>\n\n							<!-- START HEADER ONLINE -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formLabel.headerOnline.$touched || forms.formLabel.$submitted) && forms.formLabel.headerOnline.$invalid}">\n								<label class="control-label">{{\'APPLICATION_HEADER_ONLINE\' | translate}}</label>\n								<input type="text" name="headerOnline" placeholder="{{\'APPLICATION_HEADER_ONLINE\' | translate}}" class="form-control" data-ng-model="item.header_online"/>\n							</div>\n							<!-- END HEADER ONLINE -->\n\n							<!-- START ONLINE MESSAGE-->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formLabel.onlineMessage.$touched || forms.formLabel.$submitted) && forms.formLabel.onlineMessage.$invalid}">\n								<label class="control-label">{{\'APPLICATION_ONLINE_MESSAGE\' | translate}}</label>\n								<input type="text" name="onlineMessage" placeholder="{{\'APPLICATION_ONLINE_MESSAGE\' | translate}}" class="form-control" data-ng-model="item.online_message"/>\n							</div>\n							<!-- END HEADER ONLINE -->\n\n							<!-- START USERNAME PLACEHOLDER -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formLabel.usernamePlaceholder.$touched || forms.formLabel.$submitted) && forms.formLabel.usernamePlaceholder.$invalid}">\n								<label class="control-label">{{\'APPLICATION_USERNAME_PLACEHOLDER\' | translate}}</label>\n								<input type="text" name="usernamePlaceholder" placeholder="{{\'APPLICATION_USERNAME_PLACEHOLDER\' | translate}}" class="form-control" data-ng-model="item.username_placeholder"/>\n							</div>\n							<!-- END USERNAME PLACEHOLDER -->\n\n							<!-- START EMAIL PLACEHOLDER -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formLabel.emailPlaceholder.$touched || forms.formLabel.$submitted) && forms.formLabel.emailPlaceholder.$invalid}">\n								<label class="control-label">{{\'APPLICATION_EMAIL_PLACEHOLDER\' | translate}}</label>\n								<input type="text" name="emailPlaceholder" placeholder="{{\'APPLICATION_EMAIL_PLACEHOLDER\' | translate}}" class="form-control" data-ng-model="item.email_placeholder"/>\n							</div>\n							<!-- END EMAIL PLACEHOLDER -->\n\n							<!-- START START CHAT BUTTON -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formLabel.startChatButton.$touched || forms.formLabel.$submitted) && forms.formLabel.startChatButton.$invalid}">\n								<label class="control-label">{{\'APPLICATION_START_CHAT_BUTTON\' | translate}}</label>\n								<input type="text" name="startChatButton" placeholder="{{\'APPLICATION_START_CHAT_BUTTON\' | translate}}" class="form-control" data-ng-model="item.start_chat_button"/>\n							</div>\n							<!-- END START CHAT BUTTON -->\n\n							<!-- START RATING MESSAGE -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formLabel.ratingMessage.$touched || forms.formLabel.$submitted) && forms.formLabel.ratingMessage.$invalid}">\n								<label class="control-label">{{\'APPLICATION_RATING_MESSAGE\' | translate}}</label>\n								<input type="text" name="ratingMessage" placeholder="{{\'APPLICATION_RATING_MESSAGE\' | translate}}" class="form-control" data-ng-model="item.rating_message"/>\n							</div>\n							<!-- END RATING MESSAGE -->\n\n							<!-- START RATING START TEXT -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formLabel.ratingSend.$touched || forms.formLabel.$submitted) && forms.formLabel.ratingSend.$invalid}">\n								<label class="control-label">{{\'APPLICATION_RATING_SEND_BUTTON\' | translate}}</label>\n								<input type="text" name="ratingSend" placeholder="{{\'APPLICATION_RATING_SEND_BUTTON\' | translate}}" class="form-control" data-ng-model="item.rating_send"/>\n							</div>\n							<!-- END RATING START TEXT -->\n\n							<!-- START RATING MESSAGE -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formLabel.ratingSkip.$touched || forms.formLabel.$submitted) && forms.formLabel.ratingSkip.$invalid}">\n								<label class="control-label">{{\'APPLICATION_RATING_SKIP_BUTTON\' | translate}}</label>\n								<input type="text" name="ratingSkip" placeholder="{{\'APPLICATION_RATING_SKIP_BUTTON\' | translate}}" class="form-control" data-ng-model="item.rating_skip"/>\n							</div>\n							<!-- END RATING MESSAGE -->\n\n							<!-- START HEADER OFFLINE -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formLabel.headerOffline.$touched || forms.formLabel.$submitted) && forms.formLabel.headerOnline.$invalid}">\n								<label class="control-label">{{\'APPLICATION_HEADER_OFFLINE\' | translate}}</label>\n								<input type="text" name="headerOffline" placeholder="{{\'APPLICATION_HEADER_OFFLINE\' | translate}}" class="form-control" data-ng-model="item.header_offline"/>\n							</div>\n							<!-- END HEADER OFFLINE -->\n\n							<!-- START OFFLINE MESSAGE-->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formLabel.offlineMessage.$touched || forms.formLabel.$submitted) && forms.formLabel.onlineMessage.$invalid}">\n								<label class="control-label">{{\'APPLICATION_OFFLINE_MESSAGE\' | translate}}</label>\n								<input type="text" name="offlineMessage" placeholder="{{\'APPLICATION_OFFLINE_MESSAGE\' | translate}}" class="form-control" data-ng-model="item.offline_message"/>\n							</div>\n							<!-- END OFFLINE MESSAGE -->\n\n							<!-- START ENQUIRY MESSAGE PLACEHOLDER-->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formLabel.enquiryMessagePlaceholder.$touched || forms.formLabel.$submitted) && forms.formLabel.onlineMessage.$invalid}">\n								<label class="control-label">{{\'APPLICATION_ENQUIRY_MESSAGE_PLACEHOLDER\' | translate}}</label>\n								<input type="text" name="enquiryMessagePlaceholder" placeholder="{{\'APPLICATION_ENQUIRY_MESSAGE_PLACEHOLDER\' | translate}}" class="form-control" data-ng-model="item.enquiry_message_placeholder"/>\n							</div>\n							<!-- END ENQUIRY MESSAGE PLACEHOLDER -->\n\n							<!-- START ENQUIRY BUTTON -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formLabel.enquiryButton.$touched || forms.formLabel.$submitted) && forms.formLabel.startChatButton.$invalid}">\n								<label class="control-label">{{\'APPLICATION_ENQUIRY_BUTTON\' | translate}}</label>\n								<input type="text" name="enquiryButton" placeholder="{{\'APPLICATION_ENQUIRY_BUTTON\' | translate}}" class="form-control" data-ng-model="item.enquiry_button"/>\n							</div>\n							<!-- END ENQUIRY BUTTON -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" ng-click="next()"/>\n						</form>\n					</wz-step>\n\n					<wz-step title="{{\'APPLICATION_FORMS\' | translate}}" canexit="exitValidation(forms.formAppearance.$valid)">\n						<form name="forms.formFunctionality" novalidate>\n\n							<!-- START DOWNLOAD TRANSCRIPT -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formFunctionality.animationToggle.$touched || forms.formFunctionality.$submitted) && forms.formFunctionality.animationToggle.$invalid}">\n								<label class="control-label">{{\'APPLICATION_DOWNLOAD_TRANSCRIPT\' | translate}}</label>\n								<ui-select data-ng-model="item.download_transcript" name="downloadTranscript" theme="bootstrap">\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected ? \'On\' : \'Off\'}}</ui-select-match>\n									<ui-select-choices repeat="downloadTranscript in [true, false] | filter: $select.search">\n										<div ng-bind-html="downloadTranscript ? \'On\' : \'Off\' | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n							</div>\n							<!-- END DOWNLOAD TRANSCRIPT -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" ng-click="next()"/>\n						</form>\n					</wz-step>\n\n					<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n						<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n						<input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n					</wz-step>\n				</wizard>\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/fax/account/list/list.html",'<div class="row">\n	<div class="col-md-12">\n			<div class="page-bar">\n				<ul class="page-breadcrumb">\n					<li>\n						<i class="icon-rocket"></i>\n						<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-paper-plane"></i>\n						<a href="#">{{ \'APPLICATION_FAX\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-notebook"></i>\n						<a href="/channels/fax/accounts/list">{{ \'APPLICATION_ACCOUNTS\' | translate }}</a>\n					</li>\n				</ul>\n			</div>\n		</div>\n</div>\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-notebook font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_ACCOUNTS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="fax_accounts.checked.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<a class="btn green-jungle" href="/channels/fax/accounts/wizard">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_ACCOUNT\' | translate }}\n						</a>\n					</div>\n					<a class="btn btn-icon-only btn-default" href="#" ng-csv="getFaxAccounts([\'name\', \'description\', \'phone\'])" csv-header="[\'Name\', \'Description\', \'Phone\']" field-separator=";" filename="fax_accounts.csv">\n					<i class="icon-cloud-download"></i></a>\n					<!-- <a class="btn btn-icon-only btn-default fullscreen" href="#"></a> -->\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<table st-table="displayedFaxAccounts" st-pipe="initList" class="table table-striped table-bordered table-hover">\n					<div class="table-responsive">\n					  <thead>\n							<tr>\n								<th colspan="5">\n									<div class="row">\n										<div class="col-md-6">\n											<ui-select class="input-xsmall" ng-model="conf.faxAccountsByPage" theme="bootstrap" ng-disabled="disabled">\n												<ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n												<ui-select-choices repeat="faxAccountByPage in faxAccountsByPage | filter: $select.search">\n													<div ng-bind-html="faxAccountByPage.name | highlight: $select.search"></div>\n												</ui-select-choices>\n											</ui-select>\n										</div>\n										<div class="col-md-6">\n											<div class="input-group input-medium pull-right">\n												<input st-search placeholder="{{ \'APPLICATION_SEARCH\' | translate }}" class="form-control" type="search" />\n												<span class="input-group-addon">\n													<i class="fa fa-search"></i>\n												</span>\n											</div>\n										</div>\n									</div>\n								</th>\n							</tr>\n						  <tr>\n								<th class="small-cells" style="text-align: center; vertical-align: middle"><input type="checkbox" ng-change="check(faxAccount, checked)" checklist-model checklist-value="id"></th>\n						    <th st-sort="name">{{ \'APPLICATION_NAME\' | translate }}</th>\n								<th st-sort="description">{{ \'APPLICATION_DESCRIPTION\' | translate }}</th>\n								<th st-sort="phone">{{ \'APPLICATION_PHONE\' | translate }}</th>\n								<th>{{ \'APPLICATION_ACTIONS\' | translate }}</th>\n						  </tr>\n					  </thead>\n					  <tbody>\n					    <tr data-ng-repeat="faxAccount in displayedFaxAccounts" class="animate-repeat">\n								<td style="text-align: center; vertical-align: middle"><input type="checkbox" checklist-model="fax_accounts.checked" checklist-value="faxAccount.id"></td>\n					      <td>{{faxAccount.name}}</td>\n								<td>{{faxAccount.description}}</td>\n								<td>{{faxAccount.phone}}</td>\n					      <td>\n					        <a class="btn default btn-xs blue-stripe" data-ng-href="/channels/fax/accounts/view/{{faxAccount.id}}/settings">\n										{{ \'APPLICATION_EDIT\' | translate }}\n					        </a>\n					        <a class="btn default btn-xs red-stripe" data-ng-click="deleteItem(faxAccount.name,faxAccount.id)">\n										{{ \'APPLICATION_DELETE\' | translate }}\n					        </a>\n					      </td>\n					    </tr>\n							<tr data-ng-hide="displayedFaxAccounts.length">\n								<td colspan="5" style="text-align:center;">\n									<i>No fax account available</i>\n								</td>\n							</tr>\n					  </tbody>\n					  <tfoot>\n							<tr>\n								<td></td>\n						    <td>\n									<div class="input-icon right">\n										<i class="fa fa-search"></i>\n										<input st-search="name" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_NAME\' | translate | lowercase}}" class="form-control" type="search"/>\n									</div>\n						    </td>\n								<td>\n									<div class="input-icon right">\n										<i class="fa fa-search"></i>\n										<input st-search="description" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_DESCRIPTION\' | translate | lowercase}}" class="form-control" type="search"/>\n									</div>\n						    </td>\n								<td>\n									<div class="input-icon right">\n										<i class="fa fa-search"></i>\n										<input st-search="phone" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_PHONE\' | translate | lowercase}}" class="form-control" type="search"/>\n									</div>\n						    </td>\n						    <td>\n						    </td>\n						  </tr>\n					    <tr>\n					      <td colspan="5" class="text-center">\n					        <div st-pagination class="pagination" st-items-by-page="conf.faxAccountsByPage.value" st-displayed-pages="7"></div>\n					      </td>\n					    </tr>\n					  </tfoot>\n				</div>\n				</table>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/fax/account/view/view.applications.html",'<div class="row" data-ng-init="initApplication()">\n	<div class="col-md-12">\n\n		<!-- BEGIN  PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-notebook font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_ACCOUNT\' | translate }} WIZARD</a> </span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<wizard on-finish="createItem()">\n	        <wz-step title="{{\'APPLICATION_SETTINGS\' | translate}}" canexit="formValidation(forms.info.$valid)">\n							<form name="forms.info" novalidate>\n								<!-- START APP -->\n								<div class="form-group"  data-ng-class="{\'has-error\': (forms.info.app.$touched || forms.info.$submitted) && forms.info.app.$invalid}">\n									<label class="control-label">{{\'APPLICATION_APPLICATION\' | translate}}</label>\n									<ui-select data-ng-model="application.app" name="app" theme="bootstrap" required>\n				            <ui-select-match placeholder="{{\'APPLICATION_APPLICATION\' | translate}}">{{$select.selected | uppercase}}</ui-select-match>\n				            <ui-select-choices repeat="filter in [\'queue\', \'agent\'] | filter: $select.search">\n				              <div ng-bind-html="filter | uppercase | highlight: $select.search"></div>\n				            </ui-select-choices>\n				          </ui-select>\n									<span data-ng-show="(forms.info.app.$touched || forms.info.$submitted) && forms.info.app.$invalid && forms.info.app.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END APP -->\n\n								<!-- START APPADATA -->\n								<div class="form-group"  data-ng-class="{\'has-error\': (forms.info.appdata.$touched || forms.info.$submitted) && forms.info.appdata.$invalid}">\n									<label class="control-label">{{\'APPLICATION_ARGUMENTS\' | translate}}</label>\n									<ui-select data-ng-model="application.appdata" name="appdata" theme="bootstrap" required>\n				            <ui-select-match placeholder="{{\'APPLICATION_ARGUMENTS\' | translate}}">{{$select.selected.name}}</ui-select-match>\n				            <ui-select-choices repeat="item in items | filter: $select.search">\n				              <div data-ng-bind-html="item.name | highlight: $select.search"></div>\n				            </ui-select-choices>\n				          </ui-select>\n									<span data-ng-show="(forms.info.appdata.$touched || forms.info.$submitted) && forms.info.appdata.$invalid && forms.info.appdata.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END APPADATA -->\n\n								<!-- START TIMEOUT -->\n								<div class="form-group"  data-ng-class="{\'has-error\': (forms.info.timeout.$touched || forms.info.$submitted) && forms.info.timeout.$invalid}">\n									<label class="control-label">{{\'APPLICATION_TIMEOUT\' | translate}}</label>\n									<input type="text" name="timeout" placeholder="{{\'APPLICATION_TIMEOUT\' | translate}}" class="form-control" data-ng-model="application.timeout" required>\n									<span data-ng-show="(forms.info.timeout.$touched || forms.info.$submitted) && forms.info.timeout.$invalid && forms.info.timeout.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END TIMEOUT -->\n\n								<!-- START INTERVAL -->\n								<!-- <div class="form-group" data-ng-class="{\'has-error\': (forms.info.interval.$touched || forms.info.$submitted) && forms.info.interval.$invalid}">\n									<label class="control-label">{{\'APPLICATION_INTERVAL\' | translate}}</label>\n									<input type="text" name="interval" placeholder="*|*|*|*" class="form-control" data-ng-model="application.interval">\n									<span data-ng-show="(forms.info.info.interval.$touched || forms.info.$submitted) && forms.info.interval.$invalid && forms.info.interval.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div> -->\n								<!-- END INTERVAL -->\n\n								<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" data-ng-click="goNext()"/>\n							</form>\n						</wz-step>\n\n						<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n							<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n							<input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n						</wz-step>\n				</wizard>\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),
+a.put("app/channels/fax/account/view/view.html",'<!-- BEGIN PAGE HEADER-->\n<div class="row" data-ng-init="initView()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-paper-plane"></i>\n					<a href="/">{{ \'APPLICATION_FAX\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-notebook"></i>\n					<a href="/channels/fax/accounts/list">{{ \'APPLICATION_ACCOUNTS\' | translate }}</a>\n					<i class="fa fa-angle-right" data-ng-show="account"></i>\n				</li>\n				<li data-ng-show="account">\n					<a href="#">{{ account.name || account.description }}</a>\n				</li>\n			</ul>\n		</div>\n\n<!-- END PAGE HEADER-->\n\n<!-- BEGIN PAGE CONTENT-->\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/account.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{ account.name || account.description }}\n					</div>\n					<div class="profile-usertitle-job">\n						{{ account.phone }}\n					</div>\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.channels.fax.accounts.view.settings\')}">\n							<a href="/channels/fax/accounts/view/{{account.id}}/settings">\n							<i class="icon-settings"></i>\n							{{\'APPLICATION_SETTINGS\' | translate}} </a>\n						</li>\n						<li data-ng-class="{active: $state.is(\'main.channels.fax.accounts.view.routes\') || $state.is(\'main.channels.fax.accounts.view.applications\')}">\n							<a href="/channels/fax/accounts/view/{{account.id}}/routes">\n							<i class="icon-directions"></i>\n							{{\'APPLICATION_ROUTES\' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/fax/account/view/view.routes.html",'<div class="row" data-ng-init="getFaxApplications()">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title  tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_ROUTES\' | translate}}</span>\n				</div>\n				<div class="actions">\n					<div class="btn-group">\n						<a class="btn green-jungle" href="/channels/fax/accounts/view/{{account.id}}/applications" data-toggle="dropdown">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_APPLICATION\' | translate }}\n						</a>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<table class="table table-striped table-bordered table-hover">\n					  <thead>\n						  <tr>\n								<!-- <th width="5%">{{ \'APPLICATION_ID\' | translate }}</th> -->\n						    <th>{{\'APPLICATION_APPLICATION\' | translate}}</th>\n						    <th>{{\'APPLICATION_ARGUMENTS\' | translate}}</th>\n								<th>{{\'APPLICATION_TIMEOUT\' | translate}}</th>\n						    <!-- <th>{{\'APPLICATION_INTERVAL\' | translate}}</th> -->\n								<th width="5%">{{ \'APPLICATION_ACTIONS\' | translate }}</th>\n						  </tr>\n					  </thead>\n						<tbody ui-sortable="sortableOptions" data-ng-model="faxApplications">\n					    <tr data-ng-repeat="application in faxApplications | orderBy:\'priority\'">\n								<td><span data-ng-class="{\'label-info\': application.app == \'agent\', \'label-success\': application.app == \'queue\'}" class="label label-sm"> {{application.app}} </span></td>\n								<td>{{getAppdata(application.app, application.appdata)}}</td>\n								<td>{{application.timeout}}</td>\n								<!-- <td>{{application.interval}}</td> -->\n					      <td>\n					        <a class="btn default btn-xs red-stripe" data-ng-click="deleteItem(application.app,application.id)">\n										{{ \'APPLICATION_DELETE\' | translate }}\n					        </a>\n					      </td>\n					    </tr>\n							<tr data-ng-hide="faxApplications.length">\n								<td colspan="5" style="text-align:center;">\n									<i>No applications available</i>\n								</td>\n							</tr>\n					  </tbody>\n				</table>\n				<!-- END TABLE -->\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/channels/fax/account/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_SETTINGS\' | translate}}</span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{\'APPLICATION_GENERALS\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.formSetting" data-ng-submit="forms.formSetting.$valid && updateItemFaxAccount()" novalidate>\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="account.name" required/>\n								<span data-ng-show="forms.formSetting.name.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="account.description"/>\n							</div>\n							<!-- END DESCRIPTION -->\n\n							<!-- START TRUNKS -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.trunk.$invalid}">\n								<label class="control-label">{{\'APPLICATION_TRUNK\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="account.TrunkId" name="trunk" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_TRUNK\' | translate}}">{{$select.selected.name}}</ui-select-match>\n									<ui-select-choices repeat="trunk.id as trunk in trunks | filter: $select.search">\n										<div data-ng-bind="trunk.name | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span data-ng-show="forms.formSetting.trunk.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- START TRUNKS -->\n\n							<!-- START PHONE -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.phone.$invalid}">\n								<label class="control-label">{{\'APPLICATION_PHONE\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="phone" placeholder="{{\'APPLICATION_PHONE\' | translate}}" class="form-control" data-ng-model="account.phone" required/>\n								<span data-ng-show="forms.formSetting.phone.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END PHONE -->\n\n							<!-- START ECM -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_ECM\' | translate}}<span class="required" aria-required="true">*</span></label><br>\n								<!-- <button type="button" name="ecm" class="btn btn-default form-control" data-ng-model="account.ecm" bs-checkbox>{{account.ecm ? \'ENABLED\' : \'DISABLED\'}}</button> -->\n								<input\n									bs-switch\n									ng-model="account.ecm"\n									type="checkbox"\n									switch-active="{{ isActive }}"\n									switch-on-text="{{ \'APPLICATION_ENABLED\' | translate }}"\n									switch-off-text="{{ \'APPLICATION_DISABLED\' | translate }}"\n									switch-on-color="{{ onColor }}"\n									switch-off-color="{{ offColor }}"\n									switch-animate="{{ animate }}"\n									switch-size="{{ size }}"\n									switch-label="{{ label }}"\n									switch-icon="{{ icon }}"\n									switch-radio-off="{{ radioOff }}"\n									switch-label-width="{{ labelWidth }}"\n									switch-handle-width="{{ handleWidth }}">\n							</div>\n							<!-- END ECM -->\n\n							<!-- START FAXHEADER -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.faxheader.$invalid}">\n								<label class="control-label">{{\'APPLICATION_FAXHEADER\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="faxheader" placeholder="{{\'APPLICATION_FAXHEADER\' | translate}}" class="form-control" data-ng-model="account.faxheader" required/>\n								<span data-ng-show="forms.formSetting.faxheader.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END FAXHEADER -->\n\n							<!-- START LOCALID -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.localid.$invalid}">\n								<label class="control-label">{{\'APPLICATION_LOCALID\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="localid" placeholder="{{\'APPLICATION_LOCALID\' | translate}}" class="form-control" data-ng-model="account.localid" required/>\n								<span data-ng-show="forms.formSetting.localid.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END LOCALID -->\n\n							<!-- START MAXRATE -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.maxrate.$invalid}">\n								<label class="control-label">{{\'APPLICATION_MAXRATE\' | translate}}</label>\n								<ui-select data-ng-model="account.maxrate" name="maxrate" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_MAXRATE\' | translate}}">{{$select.selected}}</ui-select-match>\n									<ui-select-choices repeat="maxrate in [\'9600\', \'14400\', \'33600\'] | filter: $select.search">\n										<div data-ng-bind="maxrate | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span data-ng-show="forms.formSetting.maxrate.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- START MAXRATE -->\n\n							<!-- START MINRATE -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.minrate.$invalid}">\n								<label class="control-label">{{\'APPLICATION_MINRATE\' | translate}}</label>\n								<ui-select data-ng-model="account.minrate" name="minrate" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_MAXRATE\' | translate}}">{{$select.selected}}</ui-select-match>\n									<ui-select-choices repeat="minrate in [\'9600\', \'14400\', \'33600\'] | filter: $select.search">\n										<div data-ng-bind="minrate | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span data-ng-show="forms.formSetting.minrate.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- START MINRATE -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END GENERAL TAB -->\n\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/channels/fax/account/wizard/wizard.html",'<!-- BEGIN PAGE HEADER-->\n<div class="row">\n	<div class="col-md-12">\n			<div class="page-bar">\n				<ul class="page-breadcrumb">\n					<li>\n						<i class="icon-rocket"></i>\n						<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-paper-plane"></i>\n						<a href="#">{{ \'APPLICATION_FAX\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-notebook"></i>\n						<a href="/fax/accounts/list">{{ \'APPLICATION_ACCOUNTS\' | translate }}</a>\n					</li>\n				</ul>\n			</div>\n		</div>\n</div>\n<!-- END PAGE HEADER-->\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initWizard()">\n	<div class="col-md-12">\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-notebook font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_ACCOUNT\' | translate }} WIZARD</a> </span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<wizard on-finish="createItem()">\n          <wz-step title="{{\'APPLICATION_ACCOUNT_INFO\' | translate}}" canexit="exitValidation(forms.formSetting.$valid)">\n						<form name="forms.formSetting" novalidate>\n\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n								<span data-ng-show="forms.formSetting.name.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"/>\n							</div>\n							<!-- END DESCRIPTION -->\n\n							<!-- START TRUNKS -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.trunk.$invalid}">\n								<label class="control-label">{{\'APPLICATION_TRUNK\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="item.TrunkId" name="trunk" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_TRUNK\' | translate}}">{{$select.selected.name}}</ui-select-match>\n									<ui-select-choices repeat="trunk.id as trunk in trunks | filter: $select.search">\n										<div data-ng-bind="trunk.name | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span data-ng-show="forms.formSetting.trunk.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- START TRUNKS -->\n\n							<!-- START PHONE -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.phone.$invalid}">\n								<label class="control-label">{{\'APPLICATION_PHONE\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="phone" placeholder="{{\'APPLICATION_PHONE\' | translate}}" class="form-control" data-ng-model="item.phone" required/>\n								<span data-ng-show="forms.formSetting.phone.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END PHONE -->\n\n							<!-- START ECM -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_ECM\' | translate}}<span class="required" aria-required="true">*</span></label><br>\n								<!-- <button type="button" name="ecm" class="btn btn-default form-control" data-ng-model="item.ecm" bs-checkbox>{{item.ecm ? \'ENABLED\' : \'DISABLED\'}}</button> -->\n								<input\n									bs-switch\n									ng-model="item.ecm"\n									type="checkbox"\n									switch-active="{{ isActive }}"\n									switch-on-text="{{ \'APPLICATION_ENABLED\' | translate }}"\n									switch-off-text="{{ \'APPLICATION_DISABLED\' | translate }}"\n									switch-on-color="{{ onColor }}"\n									switch-off-color="{{ offColor }}"\n									switch-animate="{{ animate }}"\n									switch-size="{{ size }}"\n									switch-label="{{ label }}"\n									switch-icon="{{ icon }}"\n									switch-radio-off="{{ radioOff }}"\n									switch-label-width="{{ labelWidth }}"\n									switch-handle-width="{{ handleWidth }}">\n							</div>\n							<!-- END ECM -->\n\n							<!-- START FAXHEADER -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.faxheader.$invalid}">\n								<label class="control-label">{{\'APPLICATION_FAXHEADER\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="faxheader" placeholder="{{\'APPLICATION_FAXHEADER\' | translate}}" class="form-control" data-ng-model="item.faxheader" required/>\n								<span data-ng-show="forms.formSetting.faxheader.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END FAXHEADER -->\n\n							<!-- START LOCALID -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.localid.$invalid}">\n								<label class="control-label">{{\'APPLICATION_LOCALID\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="localid" placeholder="{{\'APPLICATION_LOCALID\' | translate}}" class="form-control" data-ng-model="item.localid" required/>\n								<span data-ng-show="forms.formSetting.localid.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END LOCALID -->\n\n							<!-- START MAXRATE -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.maxrate.$invalid}">\n								<label class="control-label">{{\'APPLICATION_MAXRATE\' | translate}}</label>\n								<ui-select data-ng-model="item.maxrate" name="maxrate" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_MAXRATE\' | translate}}">{{$select.selected}}</ui-select-match>\n									<ui-select-choices repeat="maxrate in [\'9600\', \'14400\', \'33600\'] | filter: $select.search">\n										<div data-ng-bind="maxrate | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span data-ng-show="forms.formSetting.maxrate.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- START MAXRATE -->\n\n							<!-- START MINRATE -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.minrate.$invalid}">\n								<label class="control-label">{{\'APPLICATION_MINRATE\' | translate}}</label>\n								<ui-select data-ng-model="item.minrate" name="minrate" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_MAXRATE\' | translate}}">{{$select.selected}}</ui-select-match>\n									<ui-select-choices repeat="minrate in [\'9600\', \'14400\', \'33600\'] | filter: $select.search">\n										<div data-ng-bind="minrate | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span data-ng-show="forms.formSetting.minrate.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- START MINRATE -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" data-ng-click="next()"/>\n\n						</form>\n					</wz-step>\n\n					<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n						<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n						<input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n					</wz-step>\n\n				</wizard>\n\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/fax/inbox/inbox.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n			<div class="page-bar">\n				<ul class="page-breadcrumb">\n					<li>\n						<i class="icon-rocket"></i>\n						<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-paper-plane"></i>\n						<a href="#">{{ \'APPLICATION_FAX\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-note"></i>\n						<a href="/channels/fax/inbox/incoming">{{ \'APPLICATION_INBOX\' | translate }}</a>\n					</li>\n				</ul>\n			</div>\n		</div>\n</div>\n<!-- END PAGE CONTENT-->\n<div class="row inbox">\n	<div class="col-md-12" ui-view>\n	</div>\n</div>\n'),a.put("app/channels/fax/inbox/incoming/incoming.html",'<!-- END PAGE HEADER-->\n<div data-ng-init="getRooms()">\n	<!-- <pre>\n		{{faxRooms | json}}\n	</pre> -->\n	<div class="inbox-header">\n		<h1 class="pull-left">Inbox</h1>\n	</div>\n	<div class="inbox-content">\n		<table class="table table-advance" st-table="displayedFaxRooms" st-safe-src="faxRooms">\n			<thead>\n				<tr>\n					<th colspan="8" style="background: #eef4f7; border: none; border-bottom: solid 5px #fff;">\n						<div class="row">\n							<div class="col-md-6">\n								<input type="checkbox" class="mail-checkbox mail-group-checkbox checker" data-ng-model="checked" data-ng-change="switchCheckbox(displayedFaxRooms, checked)">\n								<div class="btn-group">\n									<a data-ng-href="/channels/fax/inbox/compose" class="btn btn-sm blue">{{\'APPLICATION_NEW_MESSAGE\' | translate}} <i class="fa fa-plus"></i></a>\n									<!-- <a class="btn btn-sm blue dropdown-toggle" href="#" data-toggle="dropdown">\n										{{\'APPLICATION_MORE\' | translate}} <i class="fa fa-angle-down"></i>\n									</a> -->\n									<ul class="dropdown-menu">\n										<li>\n											<a href="#" data-ng-click="markAsRead(true)">\n											<i class="icon-paper-plane-open"></i> {{\'APPLICATION_MARK_AS_READ\' | translate}} </a>\n										</li>\n										<li>\n											<a href="#" data-ng-click="markAsRead(false)">\n											<i class="icon-paper-plane"></i> {{\'APPLICATION_MARK_AS_UNREAD\' | translate}} </a>\n										</li>\n										<li class="divider">\n										</li>\n										<li>\n											<a href="#" data-ng-click="deleteMessage()">\n											<i class="icon-trash"></i> {{\'APPLICATION_DELETE\' | translate}} </a>\n										</li>\n									</ul>\n								</div>\n							</div>\n							<div class="col-md-6">\n								<div class="input-group input-medium pull-right">\n									<input st-search placeholder="{{ \'APPLICATION_SEARCH\' | translate }}" class="form-control" type="search" />\n									<span class="input-group-addon btn green" style="cursor: default;">\n										<i class="icon-magnifier" style="color: white;"></i>\n									</span>\n								</div>\n								<ui-select data-ng-model="conf.faxRoomsByPage" theme="bootstrap" style="width: 100px;" class="pull-right margin-right-10">\n									<ui-select-match placeholder="{{ \'APPLICATION_SEARCH\' | translate }}">{{$select.selected}}</ui-select-match>\n									<ui-select-choices repeat="p in [10, 20, 35, 50] | filter: $select.search">\n										<span ng-bind-html="p | highlight: $select.search"></span>\n									</ui-select-choices>\n								</ui-select>\n							</div>\n						</div>\n					</th>\n				</tr>\n			</thead>\n			<tbody>\n				<tr data-ng-repeat="faxRoom in displayedFaxRooms | orderBy:\'-updatedAt\'" data-ng-class="{unread: !faxRoom.read}" data-ng-click="go(\'/fax/inbox/room/\' + faxRoom.id, faxRoom.id, \'OPEN\')" class="animate-repeat">\n					<td class="inbox-small-cells" style="border: none;">\n						<input type="checkbox" class="checker" checklist-model="checkedMailMessages.id" checklist-value="faxRoom.id">\n					</td>\n					<!-- <td class="inbox-small-cells" style="border: none;">\n						<i class="fa fa-star" data-ng-class="{\'inbox-started\': faxRoom.favorite}" data-ng-click="markAsFavorite(faxRoom.id, faxRoom.favorite)"></i>\n					</td> -->\n					<td class="view-message hidden-xs" style="cursor:pointer; border:none;">\n						#{{faxRoom.id}}\n					</td>\n					<!-- <td class="inbox-small-cells" style="border: none;">\n						<i class="fa fa-star" data-ng-class="{\'inbox-started\': faxRoom.favorite}" data-ng-click="markAsFavorite(faxRoom.id, faxRoom.favorite)"></i>\n					</td> -->\n					<!-- <td class="view-message hidden-xs" style="cursor:pointer; border:none;">\n						{{faxRoom.subject}}\n					</td> -->\n					<td class="view-message" style="cursor:pointer; border:none;">\n					 	{{faxRoom.from}}\n					</td>\n					<td class="view-message" style="cursor:pointer; border:none;">\n					 	{{faxRoom.MailAccount.description ? faxRoom.MailAccount.description : faxRoom.MailAccount.name}}\n					</td>\n					<td class="view-message" style="cursor:pointer; border:none;" data-ng-switch="faxRoom.status">\n						<span class="badge badge-default" data-ng-class="{\n						\'badge-danger\': faxRoom.status == \'NEW\',\n						\'badge-warning\': faxRoom.status == \'OPEN\',\n						\'badge-info\': faxRoom.status == \'PENDING\',\n						\'badge-success\': faxRoom.status == \'CLOSED\'}"> {{faxRoom.status | uppercase}} </span>\n					</td>\n					<td class="view-message" style="cursor:pointer; border:none;">\n						<span class="badge badge-success badge-roundless" data-ng-show="faxRoom.User.fullname"> {{faxRoom.User.fullname}} </span>\n						<span class="badge badge-default badge-roundless" data-ng-hide="faxRoom.User.fullname"> {{\'APPLICATION_UNASSIGNED\' | translate}} </span>\n					</td>\n					<td class="view-message text-right" context-menu="menuOptions" style="border: none;">\n						<time is="relative-time" datetime="{{faxRoom.updatedAt}}">\n							April 1, 2014\n						</time>\n					</td>\n				</tr>\n				<tr data-ng-hide="faxRooms.length">\n					<td colspan="6" class="text-center">\n						<i>{{\'MESSAGE_NO_AVAILABLE_MESSAGES\' | translate}}</i>\n					</td>\n				</tr>\n				<tr>\n					<td colspan="8" class="text-center" style="border: none;">\n						<div st-pagination class="pagination" st-items-by-page="conf.faxRoomsByPage" st-displayed-pages="7"></div>\n					</td>\n				</tr>\n			</tbody>\n		</table>\n	</div>\n</div>\n'),a.put("app/channels/fax/inbox/room/room.html",'<!-- BEGIN TODO CONTENT -->\n<div class="todo-content" data-ng-init="initRoomView()">\n	<div class="portlet light">\n		<!-- PROJECT HEAD -->\n		<div class="portlet-title">\n			<div class="caption" data-ng-show="faxRoom">\n				<i class="icon-bar-chart font-green-sharp hide"></i>\n				<span class="badge badge-default" data-ng-class="{\'badge-error\': faxRoom.status == \'NEW\',\n				\'badge-warning\': faxRoom.status == \'OPEN\',\n				\'badge-info\': faxRoom.status == \'PENDING\',\n				\'badge-success\': faxRoom.status == \'CLOSED\'}"> {{faxRoom.status | uppercase}} </span>\n			</div>\n			<div class="actions" data-ng-show="faxRoom">\n				<div class="btn-group" data-ng-show="Auth.isAdmin()">\n					<a class="btn grey-salsa btn-circle btn-sm" href="#" data-toggle="dropdown" data-hover="dropdown" data-close-others="true">\n					{{ \'APPLICATION_ASSIGN\' | translate }} <i class="fa fa-angle-down"></i>\n					</a>\n					<ul class="dropdown-menu pull-right">\n						<li data-ng-repeat="agent in agents">\n							<a href="#" data-ng-click="assignAgent(agent.id)">\n							{{agent.fullname}} <span class="badge badge-default"> {{agent.fullname | uppercase | limitTo : 1}} </span>\n							</a>\n						</li>\n					</ul>\n				</div>\n				<div class="btn-group">\n					<a class="btn green-haze btn-circle btn-sm" href="#" data-toggle="dropdown" data-hover="dropdown" data-close-others="true">\n					{{ \'APPLICATION_STATUS\' | translate }} <i class="fa fa-angle-down"></i>\n					</a>\n					<ul class="dropdown-menu pull-right">\n						<li>\n							<a href="#" data-ng-click="updateStatus(\'PENDING\')">\n							{{\'STATUS_PENING\' | translate}} <span class="badge badge-danger">\n							P </span>\n							</a>\n						</li>\n						<li>\n							<a href="#" data-ng-click="updateStatus(\'CLOSED\')">\n							{{\'STATUS_CLOSED\' | translate}} <span class="badge badge-success">\n							C </span>\n							</a>\n						</li>\n					</ul>\n				</div>\n			</div>\n		</div>\n		<!-- end PROJECT HEAD -->\n		<div class="portlet-body">\n			<div class="row">\n				<div data-ng-show="faxRoom" data-ng-class="{\'col-md-7 col-sm-7\': faxRoom}">\n					<div class="scroller" id="faxMessages" style="height: 500px; overflow-y: scroll; width: auto;" data-always-visible="1" data-rail-visible1="1" data-initialized="1">\n						<ul class="chats">\n							<li data-ng-class="{\'in\': faxMessage.status == \'RECEIVED\', \'out\': (faxMessage.status == \'SENT\' || faxMessage.status == \'SENDING\' || faxMessage.status == \'FAILED\' || faxMessage.status == \'NOT SENT\')}" data-ng-repeat="faxMessage in faxRoom.FaxMessages | orderBy:\'createdAt\'">\n							<img class="avatar" alt="" data-ng-src="api/users/avatar/{{getCurrentUser().userpic && faxMessage.status === \'SENT\' ? getCurrentUser().userpic : \'unknown_avatar\'}}">\n							<div class="message">\n								<span class="arrow">\n								</span>\n								<span class="bold">{{\'APPLICATION_FROM\' | translate}}: </span>\n								<span>{{faxMessage.From.fullname}} </span>\n								<span> &#60;{{faxMessage.From.phone}}&#62; </span>\n								<br>\n								<span class="bold">{{\'APPLICATION_TO\' | translate}}: </span>\n								<span>{{faxMessage.To.fullname}} </span>\n								<span> &#60;{{faxMessage.To.phone}}&#62; </span>\n								<br>\n								<span class="todo-tasklist-date">\n									<i class="fa fa-calendar"></i>\n									<time is="relative-time" datetime="{{faxMessage.createdAt}}">\n										April 1, 2014\n									</time>\n								</span>\n								<span data-ng-show="faxMessage.status == \'FAILED\' || faxMessage.status == \'SENDING\'" class="badge badge-default" data-ng-class="{\'badge-error\': faxMessage.status == \'FAILED\', \'badge-warning\': faxMessage.status == \'SENDING\'}"> {{faxMessage.status | uppercase}} </span>\n								<br>\n								<br>\n								<span class="body">\n									<div class="wrapper" ng-controller="FaxInboxRoomCtrl" style="max-height:600px; overflow:auto;">\n					          <ng-pdf pdf-url="/api/fax/messages/{{faxMessage.id}}/content" template-url="/assets/plugins/angular-pdf/example/partials/viewer.html" scale="0.5" page=1></ng-pdf>\n					        </div>\n								</span>\n								<br>\n							</div>\n						</li>\n						</ul>\n					</div>\n				</div>\n				<div data-ng-class="{\'col-md-5 col-sm-5\': faxRoom, \'col-md-12 col-sm-12\': !faxRoom}">\n					<form name="forms.compose" data-ng-submit="forms.compose.$valid && sendFax()" class="form-horizontal" novalidate>\n						<!-- TASK HEAD -->\n						<div class="form">\n							<div class="form-group">\n								<div class="col-md-12 col-sm-12">\n									<div class="todo-taskbody-user">\n										<img class="todo-userpic pull-left" data-ng-src="api/users/avatar/{{getCurrentUser().userpic ? getCurrentUser().userpic : \'unknown_avatar\'}}" width="50px" height="50px">\n										<span class="todo-username pull-left">{{ getCurrentUser().fullname }}</span>\n									</div>\n								</div>\n							</div>\n							<!-- END TASK HEAD -->\n\n							<!-- FAX FROM -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.compose.from.$invalid && forms.compose.$submitted}">\n								<div class="col-md-12">\n									<div class="row">\n										<div class="col-md-1">\n											<label class="control-label">{{\'APPLICATION_FROM\' | translate}}:</label>\n										</div>\n										<div class="col-md-11">\n											<ui-select data-ng-model="form.from" theme="bootstrap" name="from" required ng-disabled="disabled">\n												<ui-select-match placeholder="{{\'APPLICATION_FROM\' | translate}}...">{{$select.selected.name}} - {{$select.selected.phone}}</ui-select-match>\n												<ui-select-choices repeat="faxAccount in faxAccounts | filter: $select.search">\n													<div ng-bind-html="faxAccount.name | highlight: $select.search"></div>\n													<small ng-bind-html="faxAccount.phone | highlight: $select.search"></small>\n												</ui-select-choices>\n											</ui-select>\n											<span data-ng-show="forms.compose.from.$invalid && forms.compose.$submitted" class="help-block help-block-error">\n							          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							        </span>\n										</div>\n									</div>\n								</div>\n							</div>\n\n							<!-- FAX TO -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.compose.to.$invalid && forms.compose.$submitted}">\n								<div class="col-md-12">\n									<div class="row">\n										<div class="col-md-1">\n											<label class="control-label">{{\'APPLICATION_TO\' | translate}}:</label>\n										</div>\n										<div class="col-md-11">\n											<ui-select tagging tagging-label="" multiple required data-ng-model="form.sto" theme="bootstrap" name="to" ng-disabled="disabled">\n												<ui-select-match placeholder="{{\'APPLICATION_TO\' | translate}}...">{{$item}}</ui-select-match>\n												<ui-select-choices repeat="to in form.to | filter:$select.search">\n													{{to}}\n												</ui-select-choices>\n											</ui-select>\n											<span data-ng-show="forms.compose.to.$invalid && forms.compose.$submitted" class="help-block help-block-error">\n							          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							        </span>\n										</div>\n									</div>\n								</div>\n							</div>\n\n							<!-- TASK DESC -->\n							<div class="form-group">\n								<div class="col-md-12">\n									<!-- <textarea class="form-control todo-taskbody-taskdesc" rows="8" data-ng-model="form.text" name="text" style="resize: none;"></textarea> -->\n									<div class="inbox-editor inbox-wysihtml5" text-angular data-ng-model="form.html" name="html"></div>\n								</div>\n							</div>\n							<!-- END TASK DESC -->\n\n							<!-- START ATTACH -->\n							<div class="form-group">\n								<div class="col-md-6">\n									<input type="file" nv-file-select uploader="uploader" name="file">\n									<table class="table" border="0">\n										<tbody>\n										<tr data-ng-repeat="item in uploader.queue">\n												<td style="border-top-style:none">\n													<strong>\n														{{ item.file.name }}\n													</strong>\n												</td>\n												<td data-ng-show="uploader.isHTML5" nowrap style="border-top-style:none">\n													{{ item.file.size/1024/1024|number:2 }} MB\n												</td>\n												<td nowrap style="border-top-style:none">\n													<button type="button" class="btn btn-danger btn-xs" data-ng-click="item.remove()">\n															<span class="glyphicon glyphicon-trash"></span> Remove\n													</button>\n												</td>\n											</tr>\n										</tbody>\n									</table>\n								</div>\n								<div class="col-md-6">\n									<div class="form-actions right todo-form-actions">\n										<button class="btn btn-circle btn-sm green-haze">{{ \'APPLICATION_SEND\' | translate }}</button>\n										<input type="button" name="cancel" value="{{ \'APPLICATION_CANCEL\' | translate }}" class="btn btn-circle btn-sm btn-default" data-ng-click="cancel()">\n									</div>\n								</div>\n							</div>\n							<!-- END ATTACH -->\n\n						</div>\n					</form>\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n<!-- END TODO CONTENT -->\n'),
+a.put("app/channels/fax/queue/list/list.create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_QUEUE\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.general.name.$touched || form.general.$submitted) && form.general.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n      <span data-ng-show="(form.general.name.$touched || form.general.$submitted) && form.general.name.$invalid && form.general.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"/>\n    </div>\n    <!-- END DESCRIPTION -->\n\n    <!-- START TIMEOUT -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.general.timeout.$touched || form.general.$submitted) && form.general.timeout.$invalid}">\n      <label class="control-label">{{\'APPLICATION_AGENT_TIMEOUT\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="number" name="timeout" placeholder="Timeout" class="form-control" data-ng-model="item.timeout" required/>\n      <span data-ng-show="(form.general.timeout.$touched || form.general.$submitted) && form.general.timeout.$invalid && form.general.timeout.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END TIMEOUT -->\n\n    <!-- START HEADER SHAPE -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.general.strategy.$touched || form.general.$submitted) && form.general.strategy.$invalid}">\n      <label class="control-label">{{\'APPLICATION_STRATEGY\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <ui-select data-ng-model="item.strategy" name="strategy" theme="bootstrap" required>\n        <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.toUpperCase()}}</ui-select-match>\n        <ui-select-choices repeat="strategy in [\'rrmemory\',\'beepall\'] | filter: $select.search">\n          <div ng-bind-html="strategy.toUpperCase() | highlight: $select.search"></div>\n        </ui-select-choices>\n      </ui-select>\n      <span data-ng-show="(form.general.strategy.$touched || form.general.$submitted) && form.general.strategy.$invalid && form.general.strategy.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END HEADER SHAPE -->\n\n\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="save()" ng-disabled="form.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/channels/fax/queue/list/list.html",'<div class="row">\n	<div class="col-md-12">\n			<div class="page-bar">\n				<ul class="page-breadcrumb">\n					<li>\n						<i class="icon-rocket"></i>\n						<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-paper-plane"></i>\n						<a href="#">{{ \'APPLICATION_FAX\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-docs"></i>\n						<a href="/channels/fax/queues/lis">{{ \'APPLICATION_QUEUES\' | translate }}</a>\n					</li>\n				</ul>\n			</div>\n		</div>\n</div>\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-docs font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_QUEUES\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<a class="btn green-jungle " href="#"  data-ng-click="createItem()">\n						<i class="icon-plus"></i> {{ \'APPLICATION_NEW_QUEUE\' | translate }}\n					</a>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/fax/queue/view/view.agents.html",'<div class="row" data-ng-init="getTeams()">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_AGENTS\' | translate}}</span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- BEGIN FORM-->\n				<form action="index.html" class="form-horizontal form-row-seperated">\n					<div class="form-body">\n						<label for="penalty">{{\'APPLICATION_PENALTY\' | translate}}</label>\n						<div class="input-group input-small mbottom20">\n							<input type="number" class="spinner-input form-control" maxlength="3" data-ng-model="queue.penalty" readonly>\n							<div class="spinner-buttons input-group-btn btn-group-vertical">\n								<button type="button" class="btn spinner-up btn-xs blue" data-ng-click="queue.penalty=queue.penalty+1">\n									<i class="fa fa-angle-up"></i>\n								</button>\n								<button type="button" class="btn spinner-down btn-xs blue" data-ng-disabled="!queue.penalty" data-ng-click="queue.penalty=queue.penalty-1">\n									<i class="fa fa-angle-down"></i>\n								</button>\n							</div>\n						</div>\n						<div class="form-group last">\n							<div class="col-md-12" id="multi-select-team">\n							</div>\n						</div>\n					</div>\n				</form>\n				<!-- END FORM-->\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/channels/fax/queue/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getQueue()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-paper-plane"></i>\n					<a href="#">{{ \'APPLICATION_FAX\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-docs"></i>\n					<a href="/channels/fax/queues/list">{{ \'APPLICATION_QUEUES\' | translate }}</a>\n					<i data-ng-show="queue" class="fa fa-angle-right"></i>\n				</li>\n				<li data-ng-show="queue">\n					<a href="#">{{queue.name}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/queue.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{queue.name}}\n					</div>\n					<!-- <div class="profile-usertitle-job">\n						{{user.role}}\n					</div> -->\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.channels.fax.queues.view.settings\')}">\n							<a data-ng-href="/channels/fax/queues/view/{{queue.id}}/settings">\n							<i class="icon-settings"></i>\n							{{ \'APPLICATION_SETTINGS\' | translate}} </a>\n						</li>\n						<li data-ng-class="{active: $state.is(\'main.channels.fax.queues.view.agents\')}">\n							<a data-ng-href="/channels/fax/queues/view/{{queue.id}}/agents">\n							<i class="icon-people"></i>\n							{{ \'APPLICATION_AGENTS\' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/fax/queue/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_SETTINGS\' | translate}}</span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<form name="forms.general" data-ng-submit="forms.general.$valid && updateFaxQueue()" novalidate>\n					<!-- START NAME -->\n					<div class="form-group" data-ng-class="{\'has-error\': (forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid}">\n						<label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n						<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="queue.name" required/>\n						<span data-ng-show="(forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid && forms.general.name.$error.required" class="help-block help-block-error">\n							<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n						</span>\n					</div>\n					<!-- END NAME -->\n\n					<!-- START DESCRIPTION -->\n					<div class="form-group">\n						<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n						<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="queue.description"/>\n					</div>\n					<!-- END DESCRIPTION -->\n\n					<!-- START TIMEOUT -->\n					<div class="form-group">\n						<label class="control-label">{{\'APPLICATION_TIMEOUT\' | translate}}</label>\n						<input type="number" name="timeout" placeholder="{{\'APPLICATION_TIMEOUT\' | translate}}" class="form-control" min="1" data-ng-model="queue.timeout"/>\n					</div>\n					<!-- END TIMEOUT -->\n\n					<!-- START HEADER SHAPE -->\n					<div class="form-group" data-ng-class="{\'has-error\': (forms.general.strategy.$touched || forms.general.$submitted) && forms.general.strategy.$invalid}">\n						<label class="control-label">{{\'APPLICATION_STRATEGY\' | translate}}</label>\n						<!-- <input colorpicker type="text" name="animationToggle" placeholder="{{\'APPLICATION_BUTTON_COLOR\' | translate}}" class="form-control" data-ng-model="chatWebsite.animation" required/> -->\n						<ui-select data-ng-model="queue.strategy" name="strategy" theme="bootstrap">\n							<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.toUpperCase()}}</ui-select-match>\n							<ui-select-choices repeat="strategy in [\'rrmemory\',\'beepall\'] | filter: $select.search">\n								<div ng-bind-html="strategy.toUpperCase() | highlight: $select.search"></div>\n							</ui-select-choices>\n						</ui-select>\n					</div>\n					<!-- END HEADER SHAPE -->\n					<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n				</form>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/channels/fax/realtime/view/agent/agent.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initAgents()">\n	<div class="col-md-12">\n		<!-- START TABLE -->\n		<div ui-grid="gridOptions"  ui-grid-resize-columns  class="ui-grid" ui-grid-tree-view ui-grid-expandable-row ui-grid-pagination auto-resize>\n			<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n		</div>\n		<!-- END TABLE -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/fax/realtime/view/agent/agent.modal.info.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_INTERFACE_INFO\' | translate }}</h3>\n</div>\n<div class="modal-body">\n<div data-ng-if="agent.ipaddr" class="well">\n  <div>{{agent.ipaddr}}:{{agent.port}}</div>\n  <div>{{agent.fullcontact}}</div>\n  <div>{{agent.useragent}}</div>\n  <div>{{agent.lastms}}</div>\n</div>\n<div data-ng-if="!agent.ipaddr" class="alert alert-danger" role="alert">\n  {{\'MESSAGE_NO_AVAILABLE_INFO\' | translate}}\n</div>\n</div>\n<div class="modal-footer">\n  <button class="btn default" type="button" ng-click="close()">{{ \'APPLICATION_CLOSE\' | translate }}</button>\n</div>\n'),a.put("app/channels/fax/realtime/view/agent/queue.modal.add.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_JOIN_QUEUE\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n\n    <div class="form-group row">\n  <label class="col-md-2 control-label" style="margin-top: 7px;">{{\'APPLICATION_QUEUE\' | translate}}:</label>\n  <div class="col-md-10">\n    <ui-select multiple ng-model="item.queues" theme="bootstrap" required>\n      <ui-select-match placeholder="{{\'APPLICATION_QUEUE\' | translate}}">{{$item.name}}</ui-select-match>\n      <ui-select-choices repeat="queue.id as queue in queues | filter: $select.search">\n        <div ng-bind-html="queue.name | highlight: $select.search"></div>\n      </ui-select-choices>\n    </ui-select>\n  </div>\n</div>\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="save()" ng-disabled="form.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/channels/fax/realtime/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-directions"></i>\n					<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-envelope"></i>\n					<a href="#">{{ \'APPLICATION_FAX\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-energy"></i>\n					<a href="#">{{ \'APPLICATION_REALTIME\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<div>\n			<nav class="navbar navbar-default" role="navigation">\n				<div class="collapse navbar-collapse">\n					<ul class="nav navbar-nav">\n						<li data-ng-class="{\'active\': $state.is(\'channels.fax.realtime.view.agents\')}">\n							<a href="/channels/fax/realtime/view/agents">\n								{{\'APPLICATION_AGENTS\' | translate}}\n							</a>\n						</li>\n					</ul>\n				</div>\n			</nav>\n		</div>\n\n		<div ui-view></div>\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/mail/account/list/list.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-puzzle"></i>\n					<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-envelope"></i>\n					<a href="#">{{ \'APPLICATION_MAIL\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-notebook"></i>\n					<a href="#">{{ \'APPLICATION_ACCOUNTS\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n	</div>\n</div>\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-notebook font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_ACCOUNTS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group">\n						<a class="btn btn-default" href="#" data-ng-click="gridOptions.getPage();">\n							<i class="icon-reload"></i>\n						</a>\n					</div>\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<a class="btn green-jungle" href="/channels/mail/accounts/wizard">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_ACCOUNT\' | translate }}\n						</a>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/mail/account/view/action/list/list.html",'<div class="row" data-ng-init="initActons()">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_ACTIONS\' | translate}}</span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<a class="btn green-jungle" href="/channels/mail/accounts/view/{{account.id}}/actions/wizard" data-toggle="dropdown">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_ACTION\' | translate }}\n						</a>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/channels/mail/account/view/action/view/view.html",'\n<div class="row" data-ng-init="initAction()">\n	<div class="col-md-12">\n		<!-- BEGIN  PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-directions font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_ACTION\' | translate }}</a> </span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<form name="forms.settings" ng-submit="updateItem()" novalidate>\n					<!-- START APP -->\n					<div class="form-group"  data-ng-class="{\'has-error\': (forms.settings.app.$touched || forms.settings.$submitted) && forms.settings.app.$invalid}">\n						<label class="control-label">{{ \'APPLICATION_APPLICATION\' | translate }}<span class="required" aria-required="true">*</span></label>\n						<ui-select data-ng-model="application.app" name="app" theme="bootstrap" required>\n							<ui-select-match placeholder="{{ \'APPLICATION_APPLICATION\' | translate }}">{{$select.selected.name}}</ui-select-match>\n							<ui-select-choices repeat="app.value as app in apps | filter: $select.search">\n								<div ng-bind-html="app.name | highlight: $select.search"></div>\n							</ui-select-choices>\n						</ui-select>\n						<span data-ng-show="(forms.settings.app.$touched || forms.settings.$submitted) && forms.settings.app.$invalid && forms.settings.app.$error.required" class="help-block help-block-error">\n							<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n						</span>\n					</div>\n					<!-- END APP -->\n\n					<!-- START HOST -->\n					<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid}">\n						<label class="control-label">{{\'APPLICATION_TIMEOUT\' | translate}} <span class="required" aria-required="true">*</span></label>\n						<input type="number" name="timeout" placeholder="{{\'APPLICATION_TIMEOUT\' | translate}}" class="form-control" data-ng-model="application.timeout" min="0" required/>\n						<span data-ng-show="(forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid && forms.settings.timeout.$error.required" class="help-block help-block-error">\n							<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n						</span>\n					</div>\n					<!-- END HOST -->\n\n					<div class="app-settings" ng-slide-down="application.app === \'queue\'" lazy-render duration="1" data-ng-init="getQueues()">\n						<!-- START QUEUE -->\n						<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.queue.$touched || forms.settings.$submitted) && forms.settings.queue.$invalid}">\n							<label class="control-label">{{\'APPLICATION_QUEUE\' | translate}}<span class="required" aria-required="true">*</span></label>\n							<ui-select data-ng-model="application.MailQueueId" name="queue" theme="bootstrap" required>\n								<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n								<ui-select-choices repeat="queue.id as queue in queues | filter: $select.search">\n									<div ng-bind-html="queue.name | highlight: $select.search"></div>\n								</ui-select-choices>\n							</ui-select>\n							<span data-ng-show="(forms.settings.queue.$touched || forms.settings.$submitted) && forms.settings.queue.$error.required" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n						</div>\n						<!-- END QUEUE -->\n					</div>\n\n					<div class="app-settings" ng-slide-down="application.app === \'agent\'" lazy-render duration="1" data-ng-init="getAgents()">\n						<!-- START AGENT -->\n						<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.agent.$touched || forms.settings.$submitted) && forms.settings.agent.$invalid}">\n							<label class="control-label">{{\'APPLICATION_AGENT\' | translate}}<span class="required" aria-required="true">*</span></label>\n							<ui-select data-ng-model="application.UserId" name="agent" theme="bootstrap" required>\n								<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.fullname}}</ui-select-match>\n								<ui-select-choices repeat="agent.id as agent in agents | filter: $select.search">\n									<div ng-bind-html="agent.fullname | highlight: $select.search"></div>\n								</ui-select-choices>\n							</ui-select>\n							<span data-ng-show="(forms.settings.agent.$touched || forms.settings.$submitted) && forms.settings.agent.$error.required" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n						</div>\n						<!-- END AGENT -->\n					</div>\n\n					<!-- START INTERVAL_TYPE -->\n					<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.intType.$touched || forms.settings.$submitted) && forms.settings.intType.$invalid}">\n						<label class="control-label">{{ \'APPLICATION_INTERVAL_TYPE\' | translate }}<span class="required" aria-required="true">*</span></label>\n						<ui-select data-ng-model="application.intType" theme="bootstrap" name="intType" required>\n							<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{ $select.selected.name | translate }}</ui-select-match>\n							<ui-select-choices repeat="intType.value as intType in $application.intTypes | filter: $select.search">\n								{{ intType.name | translate }}\n							</ui-select-choices>\n						</ui-select>\n						<span data-ng-show="(forms.settings.intType.$touched || forms.settings.$submitted) && forms.settings.intType.$error.required" class="help-block help-block-error">\n							<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n						</span>\n					</div>\n					<!-- END INTERVAL_TYPE -->\n\n					<div class="app-settings" ng-slide-down="application.intType === \'custom\'" lazy-render duration="1">\n						<!-- START TIME -->\n						<div class="form-group">\n							<label class="control-label">{{ \'APPLICATION_TIME\' | translate }}</label>\n							<div class="input-group input-large">\n								<fieldset class="pull-left" ng-disabled="application.alwaysTime">\n									<uib-timepicker name="t_from" data-ng-model="application.t_from" show-meridian="false" show-spinners="false" mousewheel="false"></uib-timepicker>\n								</fieldset>\n								<div class="input-group-addon col-md-1 interval-to pull-left">to</div>\n								<fieldset ng-disabled="application.alwaysTime"><uib-timepicker  name="t_to" data-ng-model="application.t_to" show-meridian="false" show-spinners="false" mousewheel="false"></uib-timepicker></fieldset>\n								<!-- <label class="control-label pointer-cursor"><input type="checkbox" data-ng-model="application.alwaysTime">{{\'APPLICATION_ALWAYS\' | translate}}</label> -->\n							</div>\n						</div>\n						<!-- END TIME -->\n\n						<!-- START ALWAYS -->\n						<div class="form-group">\n							<label class="control-label">{{ \'APPLICATION_ALWAYS\' | translate }}</label>\n							<div class="input-group input-large">\n								<label class="control-label pointer-cursor">\n									<input\n										bs-switch\n										data-ng-model="application.alwaysTime"\n										type="checkbox"\n										switch-active="{{ isActive }}"\n										switch-on-text="{{ \'APPLICATION_YES\' | translate }}"\n										switch-off-text="{{ \'APPLICATION_NO\' | translate }}"\n										switch-on-color="{{ onColor }}"\n										switch-off-color="{{ offColor }}"\n										switch-animate="{{ animate }}"\n										switch-size="{{ size }}"\n										switch-label="{{ label }}"\n										switch-icon="{{ icon }}"\n										switch-radio-off="{{ radioOff }}"\n										switch-label-width="{{ labelWidth }}"\n										switch-handle-width="{{ handleWidth }}">\n									<!-- <input type="checkbox" data-ng-model="application.alwaysTime"> -->\n								</label>\n							</div>\n						</div>\n						<!-- END ALWAYS -->\n\n						<!-- START WEEKDAY -->\n						<div class="form-group">\n							<label class="control-label">{{ \'APPLICATION_WEEKDAY\' | translate }}</label>\n							<div class="input-group input-large">\n								<ui-select data-ng-model="application.wd_from" theme="bootstrap" name="wd_from">\n									<ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n									<ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n										{{ weekDay.name | translate}}\n									</ui-select-choices>\n								</ui-select>\n								<span class="input-group-addon">to</span>\n								<ui-select data-ng-model="application.wd_to" theme="bootstrap" name="wd_to">\n									<ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n									<ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n										{{ weekDay.name | translate }}\n									</ui-select-choices>\n								</ui-select>\n							</div>\n						</div>\n						<!-- END WEEKDAY -->\n\n						<!-- START MONTHDAY -->\n						<div class="form-group">\n							<label class="control-label">{{ \'APPLICATION_MONTHDAY\' | translate }}</label>\n							<div class="input-group input-large">\n								<ui-select data-ng-model="application.md_from" theme="bootstrap" name="md_from">\n									<ui-select-match>{{$select.selected}}</ui-select-match>\n									<ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n										{{monthDay}}\n									</ui-select-choices>\n								</ui-select>\n								<span class="input-group-addon">to</span>\n								<ui-select data-ng-model="application.md_to" theme="bootstrap" name="md_to">\n									<ui-select-match>{{$select.selected}}</ui-select-match>\n									<ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n										{{monthDay}}\n									</ui-select-choices>\n								</ui-select>\n							</div>\n						</div>\n						<!-- END MONTHDAY -->\n\n						<!-- START MONTH -->\n						<div class="form-group">\n							<label class="control-label">{{ \'APPLICATION_MONTH\' | translate }}</label>\n							<div class="input-group input-large">\n								<ui-select data-ng-model="application.m_from" theme="bootstrap" name="m_from">\n									<ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n									<ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n										{{ month.name | translate }}\n									</ui-select-choices>\n								</ui-select>\n								<span class="input-group-addon">to</span>\n								<ui-select data-ng-model="application.m_to" theme="bootstrap" name="m_to">\n									<ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n									<ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n										{{ month.name | translate }}\n									</ui-select-choices>\n								</ui-select>\n							</div>\n						</div>\n						<!-- END MONTH -->\n					</div>\n\n					<div class="app-settings" ng-slide-down="application.intType === \'list\'" lazy-render duration="1" data-ng-init="getIntervals()">\n\n						<!-- START INTERVALS -->\n						<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.IntervalId.$touched || forms.settings.$submitted) && forms.settings.IntervalId.$invalid}">\n							<label class="control-label">{{\'APPLICATION_INTERVALS\' | translate}}<span class="required" aria-required="true">*</span></label>\n							<ui-select data-ng-model="application.IntervalId" theme="bootstrap" name="IntervalId" required>\n								<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{ $select.selected.name}}</ui-select-match>\n								<ui-select-choices repeat="interval.id as interval in intervals | filter: $select.search">\n									{{ interval.name}}\n								</ui-select-choices>\n							</ui-select>\n							<span data-ng-show="(forms.settings.IntervalId.$touched || forms.settings.$submitted) && forms.settings.IntervalId.$error.required" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n						</div>\n						<!-- END INTERVALS -->\n\n					</div>\n					<button class="btn green-haze" type="submit">{{\'APPLICATION_UPDATE\' | translate}}</button>\n				</form>\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),
+a.put("app/channels/mail/account/view/action/wizard/wizard.html",'\n<div class="row" data-ng-init="initWizard()">\n	<div class="col-md-12">\n		<!-- BEGIN  PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-directions font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_ACTION\' | translate }} WIZARD</a> </span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<wizard on-finish="createItem()">\n					<wz-step title="{{\'APPLICATION_APPLICATION\' | translate}}" canexit="formValidation(forms.action.$valid)">\n						<form name="forms.action" novalidate>\n							<!-- START APP -->\n							<div class="form-group"  data-ng-class="{\'has-error\': forms.action.$submitted && forms.action.app.$invalid}">\n								<label class="control-label">{{ \'APPLICATION_APPLICATION\' | translate }}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="application.app" name="app" theme="bootstrap" required>\n									<ui-select-match placeholder="{{ \'APPLICATION_APPLICATION\' | translate }}">{{$select.selected.name}}</ui-select-match>\n									<ui-select-choices repeat="app.value as app in apps | filter: $select.search">\n										<div ng-bind-html="app.name | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span data-ng-show="forms.action.$submitted && forms.action.app.$invalid" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END APP -->\n\n							<!-- START HOST -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.action.timeout.$touched || forms.action.$submitted) && forms.action.timeout.$invalid}">\n								<label class="control-label">{{\'APPLICATION_TIMEOUT\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="number" name="timeout" placeholder="{{\'APPLICATION_TIMEOUT\' | translate}}" class="form-control" data-ng-model="application.timeout" min="0" required/>\n								<span data-ng-show="(forms.action.timeout.$touched || forms.action.$submitted) && forms.action.timeout.$invalid && forms.action.timeout.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END HOST -->\n\n							<div class="app-settings" ng-slide-down="application.app === \'queue\'" lazy-render duration="1" data-ng-init="getQueues()">\n								<!-- START QUEUE -->\n								<div class="form-group" data-ng-class="{\'has-error\': (forms.action.queue.$touched || forms.action.$submitted) && forms.action.queue.$invalid}">\n									<label class="control-label">{{\'APPLICATION_QUEUE\' | translate}}<span class="required" aria-required="true">*</span></label>\n									<ui-select data-ng-model="application.MailQueueId" name="queue" theme="bootstrap" required>\n										<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n										<ui-select-choices repeat="queue.id as queue in queues | filter: $select.search">\n											<div ng-bind-html="queue.name | highlight: $select.search"></div>\n										</ui-select-choices>\n									</ui-select>\n									<span data-ng-show="(forms.action.queue.$touched || forms.action.$submitted) && forms.action.queue.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END QUEUE -->\n							</div>\n\n							<div class="app-settings" ng-slide-down="application.app === \'agent\'" lazy-render duration="1" data-ng-init="getAgents()">\n								<!-- START AGENT -->\n								<div class="form-group" data-ng-class="{\'has-error\': (forms.action.agent.$touched || forms.action.$submitted) && forms.action.agent.$invalid}">\n									<label class="control-label">{{\'APPLICATION_AGENT\' | translate}}<span class="required" aria-required="true">*</span></label>\n									<ui-select data-ng-model="application.UserId" name="agent" theme="bootstrap" required>\n										<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.fullname}}</ui-select-match>\n										<ui-select-choices repeat="agent.id as agent in agents | filter: $select.search">\n											<div ng-bind-html="agent.fullname | highlight: $select.search"></div>\n										</ui-select-choices>\n									</ui-select>\n									<span data-ng-show="(forms.action.agent.$touched || forms.action.$submitted) && forms.action.agent.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END AGENT -->\n							</div>\n\n							<!-- START INTERVAL_TYPE -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.action.intType.$touched || forms.action.$submitted) && forms.action.intType.$invalid}">\n								<label class="control-label">{{ \'APPLICATION_INTERVAL_TYPE\' | translate }}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="application.intType" theme="bootstrap" name="intType" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{ $select.selected.name | translate }}</ui-select-match>\n									<ui-select-choices repeat="intType.value as intType in $application.intTypes | filter: $select.search">\n										{{ intType.name | translate }}\n									</ui-select-choices>\n								</ui-select>\n								<span data-ng-show="(forms.action.intType.$touched || forms.action.$submitted) && forms.action.intType.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END INTERVAL_TYPE -->\n\n							<div class="app-settings" ng-slide-down="application.intType === \'custom\'" lazy-render duration="1">\n								<!-- START TIME -->\n								<div class="form-group">\n									<label class="control-label">{{ \'APPLICATION_TIME\' | translate }}</label>\n									<div class="input-group input-large">\n										<fieldset class="pull-left" ng-disabled="application.alwaysTime">\n											<uib-timepicker name="t_from" data-ng-model="application.t_from" show-meridian="false" show-spinners="false" mousewheel="false"></uib-timepicker>\n										</fieldset>\n										<div class="input-group-addon col-md-1 interval-to pull-left">to</div>\n										<fieldset ng-disabled="application.alwaysTime"><uib-timepicker  name="t_to" data-ng-model="application.t_to" show-meridian="false" show-spinners="false" mousewheel="false"></uib-timepicker></fieldset>\n										<!-- <label class="control-label pointer-cursor"><input type="checkbox" data-ng-model="application.alwaysTime">{{\'APPLICATION_ALWAYS\' | translate}}</label> -->\n									</div>\n								</div>\n								<!-- END TIME -->\n\n								<!-- START ALWAYS -->\n								<div class="form-group">\n									<label class="control-label">{{ \'APPLICATION_ALWAYS\' | translate }}</label>\n									<div class="input-group input-large">\n										<label class="control-label pointer-cursor">\n											<input\n												bs-switch\n												data-ng-model="application.alwaysTime"\n												type="checkbox"\n												switch-active="{{ isActive }}"\n												switch-on-text="{{ \'APPLICATION_YES\' | translate }}"\n												switch-off-text="{{ \'APPLICATION_NO\' | translate }}"\n												switch-on-color="{{ onColor }}"\n												switch-off-color="{{ offColor }}"\n												switch-animate="{{ animate }}"\n												switch-size="{{ size }}"\n												switch-label="{{ label }}"\n												switch-icon="{{ icon }}"\n												switch-radio-off="{{ radioOff }}"\n												switch-label-width="{{ labelWidth }}"\n												switch-handle-width="{{ handleWidth }}">\n											<!-- <input type="checkbox" data-ng-model="application.alwaysTime"> -->\n										</label>\n									</div>\n								</div>\n								<!-- END ALWAYS -->\n\n								<!-- START WEEKDAY -->\n								<div class="form-group">\n									<label class="control-label">{{ \'APPLICATION_WEEKDAY\' | translate }}</label>\n									<div class="input-group input-large">\n										<ui-select data-ng-model="application.wd_from" theme="bootstrap" name="wd_from">\n											<ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n											<ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n												{{ weekDay.name | translate}}\n											</ui-select-choices>\n										</ui-select>\n										<span class="input-group-addon">to</span>\n										<ui-select data-ng-model="application.wd_to" theme="bootstrap" name="wd_to">\n											<ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n											<ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n												{{ weekDay.name | translate }}\n											</ui-select-choices>\n										</ui-select>\n									</div>\n								</div>\n								<!-- END WEEKDAY -->\n\n								<!-- START MONTHDAY -->\n								<div class="form-group">\n									<label class="control-label">{{ \'APPLICATION_MONTHDAY\' | translate }}</label>\n									<div class="input-group input-large">\n										<ui-select data-ng-model="application.md_from" theme="bootstrap" name="md_from">\n											<ui-select-match>{{$select.selected}}</ui-select-match>\n											<ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n												{{monthDay}}\n											</ui-select-choices>\n										</ui-select>\n										<span class="input-group-addon">to</span>\n										<ui-select data-ng-model="application.md_to" theme="bootstrap" name="md_to">\n											<ui-select-match>{{$select.selected}}</ui-select-match>\n											<ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n												{{monthDay}}\n											</ui-select-choices>\n										</ui-select>\n									</div>\n								</div>\n								<!-- END MONTHDAY -->\n\n								<!-- START MONTH -->\n								<div class="form-group">\n									<label class="control-label">{{ \'APPLICATION_MONTH\' | translate }}</label>\n									<div class="input-group input-large">\n										<ui-select data-ng-model="application.m_from" theme="bootstrap" name="m_from">\n											<ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n											<ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n												{{ month.name | translate }}\n											</ui-select-choices>\n										</ui-select>\n										<span class="input-group-addon">to</span>\n										<ui-select data-ng-model="application.m_to" theme="bootstrap" name="m_to">\n											<ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n											<ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n												{{ month.name | translate }}\n											</ui-select-choices>\n										</ui-select>\n									</div>\n								</div>\n								<!-- END MONTH -->\n							</div>\n\n							<div class="app-settings" ng-slide-down="application.intType === \'list\'" lazy-render duration="1" data-ng-init="getIntervals()">\n\n								<!-- START INTERVALS -->\n								<div class="form-group" data-ng-class="{\'has-error\': (forms.action.IntervalId.$touched || forms.action.$submitted) && forms.action.IntervalId.$invalid}">\n									<label class="control-label">{{\'APPLICATION_INTERVALS\' | translate}}<span class="required" aria-required="true">*</span></label>\n									<ui-select data-ng-model="application.IntervalId" theme="bootstrap" name="IntervalId" required>\n										<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{ $select.selected.name}}</ui-select-match>\n										<ui-select-choices repeat="interval.id as interval in intervals | filter: $select.search">\n											{{ interval.name}}\n										</ui-select-choices>\n									</ui-select>\n									<span data-ng-show="(forms.action.IntervalId.$touched || forms.action.$submitted) && forms.action.IntervalId.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END INTERVALS -->\n\n							</div>\n\n							<input class="btn green-haze" type="submit" data-ng-click="next()" value="{{\'APPLICATION_CONTINUE\' | translate}}"/>\n						</form>\n					</wz-step>\n					<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n						<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n						<!-- <button class="btn green-haze" type="button" wz-previous><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button> -->\n						<input class="btn green-haze" type="submit" data-ng-click="next()" value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n					</wz-step>\n				</wizard>\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/mail/account/view/view.html",'<!-- BEGIN PAGE HEADER-->\n<div class="row" data-ng-init="initView()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-puzzle"></i>\n					<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-envelope"></i>\n					<a href="#">{{ \'APPLICATION_MAIL\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-notebook"></i>\n					<a href="/channels/mail/accounts/list">{{ \'APPLICATION_ACCOUNTS\' | translate }}</a>\n					<i class="fa fa-angle-right" data-ng-show="account"></i>\n				</li>\n				<li data-ng-show="account">\n					<a href="#">{{ account.description || account.name }}</a>\n				</li>\n			</ul>\n		</div>\n\n<!-- END PAGE HEADER-->\n\n<!-- BEGIN PAGE CONTENT-->\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET main.channels -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img ng-src="assets/images/media/account.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{ account.description || account.name }}\n					</div>\n					<div class="profile-usertitle-job">\n						{{account.email}}\n					</div>\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li ng-class="{active: $state.is(\'main.channels.mail.accounts.view.settings\')}">\n							<a href="/channels/mail/accounts/view/{{account.id}}/settings">\n							<i class="icon-settings"></i>\n							{{\'APPLICATION_SETTINGS\' | translate}} </a>\n						</li>\n						<li ng-class="{active: $state.includes(\'main.channels.mail.accounts.view.actions\')}">\n							<a href="/channels/mail/accounts/view/{{account.id}}/actions/list">\n							<i class="icon-directions"></i>\n							{{\'APPLICATION_ACTIONS\' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<div ui-view class="profile-content"></div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n<!-- END PAGE CONTENT-->\n</div>\n'),a.put("app/channels/mail/account/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_SETTINGS\' | translate}}</span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{\'APPLICATION_GENERALS\' | translate}}</a>\n					</li>\n					<li>\n						<a href="#" data-target="#tab_1_2" data-toggle="tab">IMAP</a>\n					</li>\n					<li>\n						<a href="#" data-target="#tab_1_3" data-toggle="tab">SMTP</a>\n					</li>\n				</ul>\n			</div>\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.info" data-ng-submit="forms.info.$valid && updateItemMailAccount()" novalidate>\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="account.name" required/>\n								<span data-ng-show="(forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$invalid && forms.info.name.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<!-- START ADDRESS -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.info.address.$touched || forms.info.$submitted) && forms.info.address.$invalid}">\n								<label class="control-label">{{\'APPLICATION_EMAIL_ADDRESS\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="address" placeholder="{{\'APPLICATION_ADDRESS\' | translate}}" class="form-control" data-ng-model="account.address" required/>\n								<span data-ng-show="(forms.info.address.$touched || forms.info.$submitted) && forms.info.address.$invalid && forms.info.address.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END ADDRESS -->\n\n							<!-- START FIDELITY -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_FIDELITY\' | translate}}</label></br>\n								<input\n								bs-switch\n								data-ng-model="account.fidelity"\n								type="checkbox"\n								switch-active="{{ isActive }}"\n								switch-on-text="{{ \'APPLICATION_ENABLED\' | translate }}"\n								switch-off-text="{{ \'APPLICATION_DISABLED\' | translate }}"\n								switch-on-color="{{ onColor }}"\n								switch-off-color="{{ offColor }}"\n								switch-animate="{{ animate }}"\n								switch-size="{{ size }}"\n								switch-label="{{ label }}"\n								switch-icon="{{ icon }}"\n								switch-radio-off="{{ radioOff }}"\n								switch-label-width="{{ labelWidth }}"\n								switch-handle-width="{{ handleWidth }}">\n							</div>\n							<!-- END FIDELITY -->\n\n							<!-- START TIMEOUT -->\n							<div class="form-group" data-ng-if="account.fidelity" data-ng-class="{\'has-error\': (forms.info.timeout.$touched || forms.info.$submitted) && forms.info.timeout.$invalid}">\n								<label class="control-label">{{\'APPLICATION_TIMEOUT\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="number" min="0" name="timeout" placeholder="{{\'APPLICATION_PORT\' | translate}}" class="form-control" data-ng-model="account.timeout" required/>\n								<span data-ng-show="(forms.info.timeout.$touched || forms.info.$submitted) && forms.info.timeout.$invalid && forms.info.timeout.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n								<span data-ng-show="(forms.info.timeout.$touched || forms.info.$submitted) && forms.info.timeout.$invalid && forms.info.timeout.$error.number" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_NUMERIC_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END TIMEOUT -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="account.description"/>\n							</div>\n							<!-- END DESCRIPTION -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END GENERAL TAB -->\n\n					<!-- IMAP TAB -->\n					<div class="tab-pane" id="tab_1_2">\n						<form name="forms.formIn" data-ng-submit="forms.formIn.$valid && updateItemMailServerIn()" novalidate>\n\n							<!-- START HOST -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formIn.host.$touched || forms.formIn.$submitted) && forms.formIn.host.$invalid}">\n								<label class="control-label">{{\'APPLICATION_HOST\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="host" placeholder="{{\'APPLICATION_HOST\' | translate}}" class="form-control" data-ng-model="account.MailServerIn.host" required/>\n								<span data-ng-show="(forms.formIn.host.$touched || forms.formIn.$submitted) && forms.formIn.host.$invalid && forms.formIn.host.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END HOST -->\n\n							<!-- START USERNAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formIn.username.$touched || forms.formIn.$submitted) && forms.formIn.username.$invalid}">\n								<label class="control-label">{{\'APPLICATION_USERNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="username" placeholder="{{\'APPLICATION_USERNAME\' | translate}}" class="form-control" data-ng-model="account.MailServerIn.username" required/>\n								<span data-ng-show="(forms.formIn.username.$touched || forms.formIn.$submitted) && forms.formIn.username.$invalid && forms.formIn.username.$error.required"  class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END USERNAME -->\n\n							<!-- START PASSWORD -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formIn.password.$touched || forms.formIn.$submitted) && forms.formIn.password.$invalid}">\n								<label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="password" name="password" placeholder="{{\'APPLICATION_PASSWORD\' | translate}}" class="form-control" data-ng-model="account.MailServerIn.password" required/>\n								<span data-ng-show="(forms.formIn.password.$touched || forms.formIn.$submitted) && forms.formIn.password.$invalid && forms.formIn.password.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END PASSWORD -->\n\n							<!-- START PORT -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formIn.port.$touched || forms.formIn.$submitted) && forms.formIn.port.$invalid}">\n								<label class="control-label">{{\'APPLICATION_PORT\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="number" name="port" placeholder="{{\'APPLICATION_PORT\' | translate}}" class="form-control" data-ng-model="account.MailServerIn.port" required/>\n								<span data-ng-show="(forms.formIn.port.$touched || forms.formIn.$submitted) && forms.formIn.port.$invalid && forms.formIn.port.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n								<span data-ng-show="(forms.formIn.port.$touched || forms.formIn.$submitted) && forms.formIn.port.$invalid && forms.formIn.port.$error.number" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_NUMERIC_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END PORT -->\n\n							<!-- START MAILBOX -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_MAILBOX\' | translate}}</label>\n								<input type="text" name="mailbox" placeholder="{{\'APPLICATION_MAILBOX\' | translate}}" class="form-control" data-ng-model="account.MailServerIn.mailbox"/>\n							</div>\n							<!-- END MAILBOX -->\n\n							<!-- START SEARCH FILTER -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_SEARCH_FILTER\' | translate}}</label>\n								<ui-select data-ng-model="account.MailServerIn.filter" name="filter" theme="bootstrap">\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected}}</ui-select-match>\n									<ui-select-choices repeat="filter in [\'UNSEEN\'] | filter: $select.search">\n										<div ng-bind-html="filter | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n							</div>\n							<!-- START SEARCH FILTER -->\n\n							<!-- START connTimeout -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.in.connTimeout.$touched || forms.in.$submitted) && forms.in.connTimeout.$invalid}">\n								<label class="control-label">{{\'APPLICATION_CONNECTION_TIMEOUT\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="number" name="connTimeout" placeholder="{{\'APPLICATION_CONNECTION_TIMEOUT\' | translate}}" class="form-control" data-ng-model="account.MailServerIn.connTimeout" required/>\n								<span data-ng-show="(forms.in.connTimeout.$touched || forms.in.$submitted) && forms.in.connTimeout.$invalid && forms.in.connTimeout.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n								<span data-ng-show="(forms.in.connTimeout.$touched || forms.in.$submitted) && forms.in.connTimeout.$invalid && forms.in.connTimeout.$error.number" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_NUMERIC_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END connTimeout -->\n\n							<!-- START authTimeout -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.in.authTimeout.$touched || forms.in.$submitted) && forms.in.authTimeout.$invalid}">\n								<label class="control-label">{{\'APPLICATION_AUTH_TIMEOUT\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="number" name="authTimeout" placeholder="{{\'APPLICATION_AUTH_TIMEOUT\' | translate}}" class="form-control" data-ng-model="account.MailServerIn.authTimeout" required/>\n								<span data-ng-show="(forms.in.authTimeout.$touched || forms.in.$submitted) && forms.in.authTimeout.$invalid && forms.in.authTimeout.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n								<span data-ng-show="(forms.in.authTimeout.$touched || forms.in.$submitted) && forms.in.authTimeout.$invalid && forms.in.authTimeout.$error.number" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_NUMERIC_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END authTimeout -->\n\n							<!-- START DELETE -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DELETE_MAIL_FROM_SERVER\' | translate}}</label><br>\n								<input\n								bs-switch\n								data-ng-model="account.MailServerIn.delete"\n								type="checkbox"\n								switch-active="{{ isActive }}"\n								switch-on-text="{{ \'APPLICATION_ENABLED\' | translate }}"\n								switch-off-text="{{ \'APPLICATION_DISABLED\' | translate }}"\n								switch-on-color="{{ onColor }}"\n								switch-off-color="{{ offColor }}"\n								switch-animate="{{ animate }}"\n								switch-size="{{ size }}"\n								switch-label="{{ label }}"\n								switch-icon="{{ icon }}"\n								switch-radio-off="{{ radioOff }}"\n								switch-label-width="{{ labelWidth }}"\n								switch-handle-width="{{ handleWidth }}">\n							</div>\n							<!-- END DELETE -->\n\n							<!-- START SSL -->\n							<div class="form-group">\n								<label class="control-label">SSL</label><br>\n								<input\n								bs-switch\n								data-ng-model="account.MailServerIn.ssl"\n								type="checkbox"\n								switch-active="{{ isActive }}"\n								switch-on-text="{{ \'APPLICATION_ENABLED\' | translate }}"\n								switch-off-text="{{ \'APPLICATION_DISABLED\' | translate }}"\n								switch-on-color="{{ onColor }}"\n								switch-off-color="{{ offColor }}"\n								switch-animate="{{ animate }}"\n								switch-size="{{ size }}"\n								switch-label="{{ label }}"\n								switch-icon="{{ icon }}"\n								switch-radio-off="{{ radioOff }}"\n								switch-label-width="{{ labelWidth }}"\n								switch-handle-width="{{ handleWidth }}">\n							</div>\n							<!-- END SSL -->\n\n							<!-- START Keepalive -->\n							<div class="form-group">\n								<label class="control-label">Keepalive</label><br>\n								<input\n								bs-switch\n								data-ng-model="account.MailServerIn.keepalive"\n								type="checkbox"\n								switch-active="{{ isActive }}"\n								switch-on-text="{{ \'APPLICATION_ENABLED\' | translate }}"\n								switch-off-text="{{ \'APPLICATION_DISABLED\' | translate }}"\n								switch-on-color="{{ onColor }}"\n								switch-off-color="{{ offColor }}"\n								switch-animate="{{ animate }}"\n								switch-size="{{ size }}"\n								switch-label="{{ label }}"\n								switch-icon="{{ icon }}"\n								switch-radio-off="{{ radioOff }}"\n								switch-label-width="{{ labelWidth }}"\n								switch-handle-width="{{ handleWidth }}">\n							</div>\n							<!-- END Keepalive -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END IMAP TAB -->\n\n					<!-- SMTP TAB -->\n					<div class="tab-pane" id="tab_1_3">\n						<form name="forms.formOut" data-ng-submit="forms.formOut.$valid && updateItemMailServerOut()" novalidate>\n\n							<!-- START HOST -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formOut.host.$touched || forms.formOut.$submitted) && forms.formOut.host.$invalid}">\n								<label class="control-label">{{\'APPLICATION_HOST\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="host" placeholder="{{\'APPLICATION_HOST\' | translate}}" class="form-control" data-ng-model="account.MailServerOut.host" required/>\n								<span data-ng-show="(forms.formOut.host.$touched || forms.formOut.$submitted) && forms.formOut.host.$invalid && forms.formOut.host.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END HOST -->\n\n							<!-- START USERNAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formOut.username.$touched || forms.formOut.$submitted) && forms.formOut.username.$invalid}">\n								<label class="control-label">{{\'APPLICATION_USERNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="username" placeholder="{{\'APPLICATION_USERNAME\' | translate}}" class="form-control" data-ng-model="account.MailServerOut.username" required/>\n								<span data-ng-show="(forms.formOut.username.$touched || forms.formOut.$submitted) && forms.formOut.username.$invalid && forms.formOut.username.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END USERNAME -->\n\n							<!-- START PASSWORD -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formOut.password.$touched || forms.formOut.$submitted) && forms.formOut.password.$invalid}">\n								<label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="password" name="password" placeholder="{{\'APPLICATION_PASSWORD\' | translate}}" class="form-control" data-ng-model="account.MailServerOut.password" required/>\n								<span data-ng-show="(forms.formOut.password.$touched || forms.formOut.$submitted) && forms.formOut.password.$invalid && forms.formOut.password.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END PASSWORD -->\n\n							<!-- START PORT -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formOut.port.$touched || forms.formOut.$submitted) && forms.formOut.port.$invalid}">\n								<label class="control-label">{{\'APPLICATION_PORT\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="number" name="port" placeholder="{{\'APPLICATION_PORT\' | translate}}" class="form-control" data-ng-model="account.MailServerOut.port" required/>\n								<span data-ng-show="(forms.formOut.form.$touched || forms.formOut.$submitted) && forms.formOut.port.$invalid && forms.formOut.port.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n								<span data-ng-show="(forms.formOut.form.$touched || forms.formOut.$submitted) && forms.formOut.port.$invalid && forms.formOut.port.$error.number" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_NUMERIC_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END PORT -->\n\n							<!-- START SSL -->\n							<div class="form-group">\n								<label class="control-label">SSL</label><br>\n								<input\n								bs-switch\n								data-ng-model="account.MailServerIn.ssl"\n								type="checkbox"\n								switch-active="{{ isActive }}"\n								switch-on-text="{{ \'APPLICATION_ENABLED\' | translate }}"\n								switch-off-text="{{ \'APPLICATION_DISABLED\' | translate }}"\n								switch-on-color="{{ onColor }}"\n								switch-off-color="{{ offColor }}"\n								switch-animate="{{ animate }}"\n								switch-size="{{ size }}"\n								switch-label="{{ label }}"\n								switch-icon="{{ icon }}"\n								switch-radio-off="{{ radioOff }}"\n								switch-label-width="{{ labelWidth }}"\n								switch-handle-width="{{ handleWidth }}">\n							</div>\n							<!-- END SSL -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n							<input class="btn blue-madison" type="button" value="Test" data-ng-click="test()"/>\n						</form>\n					</div>\n					<!-- END SMTP TAB -->\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),
+a.put("app/channels/mail/account/wizard/wizard.html",'\n<div class="row" data-ng-init="initWizard()">\n	<div class="col-md-12">\n		<!-- BEGIN PAGE HEADER-->\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-envelope"></i>\n					<a href="#">{{ \'APPLICATION_MAIL\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-notebook"></i>\n					<a href="/mail/accounts/list">{{ \'APPLICATION_ACCOUNTS\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n		<!-- END PAGE HEADER-->\n\n		<!-- BEGIN  PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-notebook font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_ACCOUNT\' | translate }} WIZARD</a> </span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<wizard on-finish="createItem()">\n					<wz-step title="{{\'APPLICATION_ACCOUNT_INFO\' | translate}}" canexit="formValidation(forms.info.$valid)">\n						<form name="forms.info" novalidate>\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n								<span data-ng-show="(forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$invalid && forms.info.name.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<!-- START ADDRESS -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.info.address.$touched || forms.info.$submitted) && forms.info.address.$invalid}">\n								<label class="control-label">{{\'APPLICATION_EMAIL_ADDRESS\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="address" placeholder="{{\'APPLICATION_ADDRESS\' | translate}}" class="form-control" data-ng-model="item.address" required/>\n								<span data-ng-show="(forms.info.address.$touched || forms.info.$submitted) && forms.info.address.$invalid && forms.info.address.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END ADDRESS -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"/>\n							</div>\n							<!-- END DESCRIPTION -->\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" data-ng-click="goNext()"/>\n						</form>\n					</wz-step>\n\n					<wz-step title="IMAP" canexit="formValidation(forms.in.$valid)">\n						<form name="forms.in" novalidate>\n							<!-- START HOST -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.in.host.$touched || forms.in.$submitted) && forms.in.host.$invalid}">\n								<label class="control-label">{{\'APPLICATION_INCOMING_MAIL_SERVER\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="host" placeholder="{{\'APPLICATION_HOST\' | translate}}" class="form-control" data-ng-model="item.MailServerIn.host" required/>\n								<span data-ng-show="(forms.in.host.$touched || forms.in.$submitted) && forms.in.host.$invalid && forms.in.host.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END HOST -->\n\n							<!-- START USERNAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.in.username.$touched || forms.in.$submitted) && forms.in.username.$invalid}">\n								<label class="control-label">{{\'APPLICATION_USERNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="username" placeholder="{{\'APPLICATION_USERNAME\' | translate}}" class="form-control" data-ng-model="item.MailServerIn.username" name="username" required/>\n								<span data-ng-show="(forms.in.username.$touched || forms.in.$submitted) && forms.in.username.$invalid && forms.in.username.$error.required"  class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END USERNAME -->\n\n							<!-- START PASSWORD -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.in.password.$touched || forms.in.$submitted) && forms.in.password.$invalid}">\n								<label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="password" name="password" placeholder="{{\'APPLICATION_PASSWORD\' | translate}}" class="form-control" data-ng-model="item.MailServerIn.password" required/>\n								<span data-ng-show="(forms.in.password.$touched || forms.in.$submitted) && forms.in.password.$invalid && forms.in.password.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END PASSWORD -->\n\n							<!-- START PORT -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.in.port.$touched || forms.in.$submitted) && forms.in.port.$invalid}">\n								<label class="control-label">{{\'APPLICATION_PORT\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="number" name="port" placeholder="{{\'APPLICATION_PORT\' | translate}}" class="form-control" data-ng-model="item.MailServerIn.port" required/>\n								<span data-ng-show="(forms.in.port.$touched || forms.in.$submitted) && forms.in.port.$invalid && forms.in.port.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n								<span data-ng-show="(forms.in.port.$touched || forms.in.$submitted) && forms.in.port.$invalid && forms.in.port.$error.number" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_NUMERIC_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END PORT -->\n\n							<!-- START MAILBOX -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_MAILBOX\' | translate}}</label>\n								<input type="text" name="mailbox" placeholder="{{\'APPLICATION_MAILBOX\' | translate}}" class="form-control" data-ng-model="item.MailServerIn.mailbox"/>\n							</div>\n							<!-- END MAILBOX -->\n\n							<!-- START SEARCH FILTER -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_SEARCH_FILTER\' | translate}}</label>\n								<ui-select data-ng-model="item.MailServerIn.filter" name="filter" theme="bootstrap">\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected}}</ui-select-match>\n									<ui-select-choices repeat="filter in [\'UNSEEN\'] | filter: $select.search">\n										<div data-ng-bind="filter | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n							</div>\n							<!-- START SEARCH FILTER -->\n\n							<!-- START connTimeout -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.in.connTimeout.$touched || forms.in.$submitted) && forms.in.connTimeout.$invalid}">\n								<label class="control-label">{{\'APPLICATION_CONNECTION_TIMEOUT\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="number" name="connTimeout" placeholder="{{\'APPLICATION_CONNECTION_TIMEOUT\' | translate}}" class="form-control" data-ng-model="item.MailServerIn.connTimeout" required/>\n								<span data-ng-show="(forms.in.connTimeout.$touched || forms.in.$submitted) && forms.in.connTimeout.$invalid && forms.in.connTimeout.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n								<span data-ng-show="(forms.in.connTimeout.$touched || forms.in.$submitted) && forms.in.connTimeout.$invalid && forms.in.connTimeout.$error.number" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_NUMERIC_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END connTimeout -->\n\n							<!-- START authTimeout -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.in.authTimeout.$touched || forms.in.$submitted) && forms.in.authTimeout.$invalid}">\n								<label class="control-label">{{\'APPLICATION_AUTH_TIMEOUT\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="number" name="authTimeout" placeholder="{{\'APPLICATION_AUTH_TIMEOUT\' | translate}}" class="form-control" data-ng-model="item.MailServerIn.authTimeout" required/>\n								<span data-ng-show="(forms.in.authTimeout.$touched || forms.in.$submitted) && forms.in.authTimeout.$invalid && forms.in.authTimeout.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n								<span data-ng-show="(forms.in.authTimeout.$touched || forms.in.$submitted) && forms.in.authTimeout.$invalid && forms.in.authTimeout.$error.number" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_NUMERIC_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END authTimeout -->\n\n							<!-- START DELETE -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DELETE_MAIL_FROM_SERVER\' | translate}}</label><br>\n								<input\n								bs-switch\n								data-ng-model="item.MailServerIn.delete"\n								type="checkbox"\n								switch-active="{{ isActive }}"\n								switch-on-text="{{ \'APPLICATION_ENABLED\' | translate }}"\n								switch-off-text="{{ \'APPLICATION_DISABLED\' | translate }}"\n								switch-on-color="{{ onColor }}"\n								switch-off-color="{{ offColor }}"\n								switch-animate="{{ animate }}"\n								switch-size="{{ size }}"\n								switch-label="{{ label }}"\n								switch-icon="{{ icon }}"\n								switch-radio-off="{{ radioOff }}"\n								switch-label-width="{{ labelWidth }}"\n								switch-handle-width="{{ handleWidth }}">\n							</div>\n							<!-- END DELETE -->\n\n							<!-- START SSL -->\n							<div class="form-group">\n								<label class="control-label">SSL</label><br>\n								<input\n								bs-switch\n								data-ng-model="item.MailServerIn.ssl"\n								type="checkbox"\n								switch-active="{{ isActive }}"\n								switch-on-text="{{ \'APPLICATION_ENABLED\' | translate }}"\n								switch-off-text="{{ \'APPLICATION_DISABLED\' | translate }}"\n								switch-on-color="{{ onColor }}"\n								switch-off-color="{{ offColor }}"\n								switch-animate="{{ animate }}"\n								switch-size="{{ size }}"\n								switch-label="{{ label }}"\n								switch-icon="{{ icon }}"\n								switch-radio-off="{{ radioOff }}"\n								switch-label-width="{{ labelWidth }}"\n								switch-handle-width="{{ handleWidth }}">\n							</div>\n							<!-- END SSL -->\n\n							<!-- START Keepalive -->\n							<div class="form-group">\n								<label class="control-label">Keepalive</label><br>\n								<input\n								bs-switch\n								data-ng-model="item.MailServerIn.keepalive"\n								type="checkbox"\n								switch-active="{{ isActive }}"\n								switch-on-text="{{ \'APPLICATION_ENABLED\' | translate }}"\n								switch-off-text="{{ \'APPLICATION_DISABLED\' | translate }}"\n								switch-on-color="{{ onColor }}"\n								switch-off-color="{{ offColor }}"\n								switch-animate="{{ animate }}"\n								switch-size="{{ size }}"\n								switch-label="{{ label }}"\n								switch-icon="{{ icon }}"\n								switch-radio-off="{{ radioOff }}"\n								switch-label-width="{{ labelWidth }}"\n								switch-handle-width="{{ handleWidth }}">\n							</div>\n							<!-- END Keepalive -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" ng-click="goNext()"/>\n						</form>\n					</wz-step>\n					<wz-step title="SMTP" canexit="formValidation(forms.out.$valid)">\n						<form name="forms.out" novalidate>\n							<!-- START HOST -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.out.host.$touched || forms.out.$submitted) && forms.out.host.$invalid}">\n								<label class="control-label">{{\'APPLICATION_OUTGOING_MAIL_SERVER\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="host" placeholder="{{\'APPLICATION_HOST\' | translate}}" class="form-control" data-ng-model="item.MailServerOut.host" required/>\n								<span data-ng-show="(forms.out.host.$touched || forms.out.$submitted) && forms.out.host.$invalid && forms.out.host.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END HOST -->\n\n							<!-- START USERNAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.out.username.$touched || forms.out.$submitted) && forms.out.username.$invalid}">\n								<label class="control-label">{{\'APPLICATION_USERNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="username" placeholder="{{\'APPLICATION_USERNAME\' | translate}}" class="form-control" data-ng-model="item.MailServerOut.username" required/>\n								<span data-ng-show="(forms.out.username.$touched || forms.out.$submitted) && forms.out.username.$invalid && forms.out.username.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END USERNAME -->\n\n							<!-- START PASSWORD -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.out.password.$touched || forms.out.$submitted) && forms.out.password.$invalid}">\n								<label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="password" name="password" placeholder="{{\'APPLICATION_PASSWORD\' | translate}}" class="form-control" data-ng-model="item.MailServerOut.password" required/>\n								<span data-ng-show="(forms.out.password.$touched || forms.out.$submitted) && forms.out.password.$invalid && forms.out.password.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END PASSWORD -->\n\n							<!-- START PORT -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.out.port.$touched || forms.out.$submitted) && forms.out.port.$invalid}">\n								<label class="control-label">{{\'APPLICATION_PORT\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="number" name="port" placeholder="{{\'APPLICATION_PORT\' | translate}}" class="form-control" data-ng-model="item.MailServerOut.port" required/>\n								<span data-ng-show="(out.$touched || forms.out.$submitted) && forms.out.port.$invalid && forms.out.port.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n								<span data-ng-show="(out.$touched || forms.out.$submitted) && forms.out.port.$invalid && forms.out.port.$error.number" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_NUMERIC_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END PORT -->\n\n							<!-- START SSL -->\n							<div class="form-group">\n								<label class="control-label">SSL</label><br>\n								<input\n								bs-switch\n								data-ng-model="item.MailServerIn.ssl"\n								type="checkbox"\n								switch-active="{{ isActive }}"\n								switch-on-text="{{ \'APPLICATION_ENABLED\' | translate }}"\n								switch-off-text="{{ \'APPLICATION_DISABLED\' | translate }}"\n								switch-on-color="{{ onColor }}"\n								switch-off-color="{{ offColor }}"\n								switch-animate="{{ animate }}"\n								switch-size="{{ size }}"\n								switch-label="{{ label }}"\n								switch-icon="{{ icon }}"\n								switch-radio-off="{{ radioOff }}"\n								switch-label-width="{{ labelWidth }}"\n								switch-handle-width="{{ handleWidth }}">\n							</div>\n							<!-- END SSL -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" ng-click="goNext()"/>\n							<input class="btn default" type="button" value="{{\'APPLICATION_BACK\' | translate}}" wz-previous/>\n						</form>\n					</wz-step>\n					<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n						<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n						<input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n					</wz-step>\n				</wizard>\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/mail/inbox/list/list.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-puzzle"></i>\n					<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-envelope"></i>\n					<a href="#">{{ \'APPLICATION_MAIL\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-note"></i>\n					<a href="#">{{ \'APPLICATION_INBOX\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n	</div>\n</div>\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-note font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_INBOX\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group">\n						<a class="btn btn-default" href="#" data-ng-click="gridOptions.getPage();">\n							<i class="icon-reload"></i>\n						</a>\n					</div>\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<a class="btn green-jungle" href="/channels/mail/inbox/view/compose">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_MESSAGE\' | translate }}\n						</a>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/mail/inbox/mail/mail.html",'<div class="message">\r\n  <div class="row">\r\n    <div class="col-md-6">\r\n      <span class="bold">From: </span>\r\n      <span>{{mailMessage.from}}</span>\r\n      <br>\r\n      <span class="bold">To: </span>\r\n      <span>{{mailMessage.to}} </span>\r\n      <br>\r\n      <span data-ng-if="mailMessage.cc.length" class="bold">Cc: </span>\r\n      <span data-ng-if="mailMessage.cc.length">{{mailMessage.cc}} </span>\r\n    </div>\r\n    <div class="col-md-6">\r\n      <span class="pull-right" data-ng-show="mailMessage.User">{{\'APPLICATION_SENT_BY\' | translate}}: <strong>{{mailMessage.User.fullname}}</strong></span>\r\n    </div>\r\n  </div>\r\n  <br>\r\n  <span class="todo-tasklist-date">\r\n    <span class="pull-right">\r\n      <a data-ng-click="(mailMessage.status == \'SENDING\' || mailMessage.status == \'FAILED\') && retry(mailMessage.id)" href="#" class="btn default btn-xs inactive-link" data-ng-class="{\'green-stripe\': mailMessage.status == \'SENT\' || mailMessage.status == \'RECEIVED\', \'blue-stripe\': mailMessage.status == \'SENDING\', \'red-stripe\': mailMessage.status == \'FAILED\'}"> {{mailMessage.status | uppercase}}\r\n        <i data-ng-class="{\'fa fa-check\': mailMessage.status == \'SENT\' || mailMessage.status == \'RECEIVED\', \'fa fa-warning\': mailMessage.status == \'SENDING\', \'fa fa-times\': mailMessage.status == \'FAILED\'}"></i>\r\n      </a>\r\n    </span>\r\n    <i class="icon-calendar"></i> <span am-time-ago="mailMessage.updatedAt"></span>\r\n  </span>\r\n  <hr>\r\n  <span class="body text-left" data-ng-bind-html="mailMessage.text" style="white-space: pre-wrap;"></span>\r\n  <hr data-ng-if="mailMessage.MailAttachments.length">\r\n  <div data-ng-repeat="mailAttachment in mailMessage.MailAttachments">\r\n    <strong>{{mailAttachment.name}}</strong>\r\n    <span>\r\n      {{mailAttachment.size}}B </span>\r\n      <a target="_self" download="{{mailAttachment.name}}" href="api/mail/attachments/{{mailAttachment.id}}">\r\n        {{ \'APPLICATION_DOWNLOAD\' | translate }}\r\n      </a>\r\n    </div>\r\n  </div>\r\n'),a.put("app/channels/mail/inbox/note/note.html",'<div class="note">\r\n  <div class="row">\r\n    <div class="col-md-6">\r\n      <i class="icon-calendar"></i> <span am-time-ago="mailMessage.updatedAt"></span>\r\n    </div>\r\n    <div class="col-md-6">\r\n      <span class="pull-right" data-ng-show="mailMessage.User">{{\'APPLICATION_ADD_BY\' | translate}}: <strong>{{mailMessage.User.fullname}}</strong></span>\r\n    </div>\r\n  </div>\r\n  <hr>\r\n  <span class="body text-left" data-ng-bind-html="mailMessage.text" style="white-space: pre-wrap;"></span>\r\n  <hr data-ng-if="mailMessage.MailAttachments.length">\r\n  <div data-ng-repeat="mailAttachment in mailMessage.MailAttachments">\r\n    <strong>{{mailAttachment.name}}</strong>\r\n    <span>\r\n      {{mailAttachment.size}}B </span>\r\n      <a target="_self" download="{{mailAttachment.name}}" href="api/mail/attachments/{{mailAttachment.id}}">\r\n        {{ \'APPLICATION_DOWNLOAD\' | translate }}\r\n      </a>\r\n    </div>\r\n  </div>\r\n'),a.put("app/channels/mail/inbox/view/view.agents.modal.html",'<div class="modal-header" data-ng-init="initModal()">\n  <h3 class="modal-title">{{ \'APPLICATION_AGENTS\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <!-- START TRANSPORT -->\n  <div class="form-group">\n    <form name="form" novalidate>\n      <!-- START TRANSPORT -->\n      <div class="form-group">\n        <ui-select multiple name="agents" data-ng-model="item.agents" theme="bootstrap">\n          <ui-select-match placeholder="{{\'APPLICATION_AGENTS\' | translate}}">{{$item.fullname}}</ui-select-match>\n          <ui-select-choices repeat="agent.id as agent in agents | filter: $select.search">\n            {{agent.fullname}}\n          </ui-select-choices>\n        </ui-select>\n      </div>\n      <!-- END TRANSPORT -->\n    </form>\n  </div>\n  <!-- END TRANSPORT -->\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" data-ng-click="ok()">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" data-ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/channels/mail/inbox/view/view.html",'<div class="row">\r\n  <div class="col-md-12">\r\n    <div class="page-bar">\r\n      <ul class="page-breadcrumb">\r\n        <li>\r\n          <i class="icon-rocket"></i>\r\n          <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\r\n          <i class="fa fa-angle-right"></i>\r\n        </li>\r\n        <li>\r\n          <i class="icon-puzzle"></i>\r\n          <a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\r\n          <i class="fa fa-angle-right"></i>\r\n        </li>\r\n        <li>\r\n          <i class="icon-envelope"></i>\r\n          <a href="#">{{ \'APPLICATION_MAIL\' | translate }}</a>\r\n          <i class="fa fa-angle-right"></i>\r\n        </li>\r\n        <li>\r\n					<i class="icon-note"></i>\r\n					<a href="/channels/mail/inbox/list">{{ \'APPLICATION_INBOX\' | translate }}</a>\r\n				</li>\r\n      </ul>\r\n    </div>\r\n  </div>\r\n</div>\r\n\r\n<!-- BEGIN PAGE CONTENT-->\r\n<div class="row">\r\n	<div class="col-md-12">\r\n    <div ui-view></div>\r\n	</div>\r\n</div>\r\n<!-- END PAGE CONTENT-->\r\n'),a.put("app/channels/mail/inbox/view/view.notes.modal.html",'<div class="modal-header" data-ng-init="initModal()">\n  <h3 class="modal-title">{{ \'APPLICATION_NOTES\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n    <div class="form-group">\n      <textarea data-ng-model="item.text" name="text" rows="10" style="resize: none; width: 100%;"></textarea>\n    </div>\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" data-ng-click="ok()">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" data-ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/channels/mail/inbox/view/view.room.html",'<!-- BEGIN TODO CONTENT -->\n<div class="todo-content" data-ng-init="initRoom()">\n	<div class="portlet light">\n		<div class="portlet-title">\n			<div class="caption" data-ng-show="mailRoom">\n				<i class="icon-bar-chart font-green-sharp hide"></i>\n				<span class="label label-sm label-default">{{mailRoom.status}}</span> - <span class="caption-subject font-green-sharp bold uppercase">{{mailRoom.subject}}</span>\n			</div>\n			<div class="actions" data-ng-switch="mailRoom.status">\n				<div class="btn-group btn-group-solid" data-ng-show="mailRoom">\n					<button type="button" class="btn yellow" data-ng-click="loadNote()" uib-popover="{{\'APPLICATION_ADD_NOTE\' | translate}}" popover-trigger="mouseenter">N</button>\n				</div>\n				<div class="btn-group btn-group-solid" data-ng-show="mailRoom">\n					<button type="button" class="btn blue" data-ng-click="loadAgents()" uib-popover="{{\'APPLICATION_ASSING_AGENTS\' | translate}}" popover-trigger="mouseenter">A</button>\n				</div>\n				<div class="btn-group btn-group-solid">\n					<button type="button" class="btn red" data-ng-click="loadTemplate()" uib-popover="{{\'APPLICATION_LOAD_TEMPLATES\' | translate}}" popover-trigger="mouseenter">T</button>\n				</div>\n				<div class="btn-group btn-group-solid">\n					<button type="button" class="btn green" data-ng-switch-when="NEW" data-ng-click="updateStatus(\'CLOSED\')" uib-popover="{{\'APPLICATION_CLOSE\' | translate}}" popover-trigger="mouseenter">S</button>\n					<button type="button" class="btn green" data-ng-switch-when="OPEN" data-ng-click="updateStatus(\'CLOSED\')" uib-popover="{{\'APPLICATION_CLOSE\' | translate}}" popover-trigger="mouseenter">S</button>\n					<button type="button" class="btn green" data-ng-switch-when="CLOSED" data-ng-click="updateStatus(\'OPEN\')" uib-popover="{{\'APPLICATION_OPEN\' | translate}}" popover-trigger="mouseenter">O</button>\n				</div>\n			</div>\n		</div>\n		<div class="portlet-body">\n			<div class="row">\n				<div data-ng-show="mailRoom" data-ng-class="{\'col-md-6 col-sm-6\': mailRoom}">\n					<div ng-scrollbars ng-scrollbars-config="config">\n						<ul class="chats">\n							<li data-ng-switch="mailMessage.status" data-ng-class="{\'in\': mailMessage.status == \'RECEIVED\', \'out\': mailMessage.status == \'SENT\' || mailMessage.status == \'SENDING\' || mailMessage.status == \'FAILED\' || mailMessage.status == \'NOTE\'}" data-ng-repeat="mailMessage in mailRoom.MailMessages | orderBy:\'-createdAt\'">\n								<img class="avatar" alt="" data-ng-src="api/users/avatar/{{getCurrentUser().userpic && mailMessage.status === \'SENT\' ? getCurrentUser().userpic : \'unknown_avatar\'}}">\n								<note message="mailMessage" ng-switch-when="NOTE"></note>\n								<mail message="mailMessage" ng-switch-default></mail>\n							</li>\n						</ul>\n					</div>\n				</div>\n				<div data-ng-class="{\'col-md-6 col-sm-6\': mailRoom, \'col-md-12 col-sm-12\': !mailRoom}">\n					<form name="forms.compose" data-ng-submit="forms.compose.$valid && sendMail()" class="form-horizontal" novalidate>\n						<!-- START HEAD -->\n						<div class="form">\n							<!-- START FROM -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.compose.from.$invalid && forms.compose.$submitted}">\n								<div class="col-md-12">\n									<div class="row">\n										<div class="col-md-1">\n											<label class="control-label">From:</label>\n										</div>\n										<div class="col-md-11">\n											<ui-select data-ng-model="form.from[0]" theme="bootstrap" name="from" required>\n												<ui-select-match placeholder="From...">{{$select.selected.name}}</ui-select-match>\n												<ui-select-choices repeat="mailAccount.address as mailAccount in mailAccounts | filter: $select.search">\n													<div data-ng-bind-html="mailAccount.name | highlight: $select.search"></div>\n													<small data-ng-bind-html="mailAccount.address | highlight: $select.search"></small>\n												</ui-select-choices>\n											</ui-select>\n											<span data-ng-show="forms.compose.from.$invalid && forms.compose.$submitted" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n									</div>\n								</div>\n							</div>\n							<!-- END FROM -->\n\n							<!-- MAIL TO -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.compose.to.$invalid && forms.compose.$submitted}">\n								<div class="col-md-12">\n									<div class="row">\n										<div class="col-md-1">\n											<label class="control-label">To:</label>\n										</div>\n										<div class="col-md-11">\n											<ui-select tagging tagging-label multiple data-ng-model="form.sto" theme="bootstrap" name="to">\n												<ui-select-match placeholder="To...">{{$item}}</ui-select-match>\n												<ui-select-choices repeat="to in form.to | filter:$select.search">\n													{{to}}\n												</ui-select-choices>\n											</ui-select>\n											<span data-ng-show="forms.compose.to.$invalid && forms.compose.$submitted" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n									</div>\n								</div>\n							</div>\n							<!-- END TO -->\n\n							<!-- START CC -->\n							<div class="form-group">\n								<div class="col-md-12">\n									<div class="row">\n										<div class="col-md-1">\n											<label class="control-label">Cc:</label>\n										</div>\n										<div class="col-md-11">\n											<ui-select tagging tagging-label="" multiple data-ng-model="form.scc" theme="bootstrap" name="cc" ng-disabled="disabled">\n												<ui-select-match placeholder="Cc...">{{$item}}</ui-select-match>\n												<ui-select-choices repeat="cc in form.cc">\n													{{cc}}\n												</ui-select-choices>\n											</ui-select>\n										</div>\n									</div>\n								</div>\n							</div>\n							<!-- END CC -->\n\n							<!-- START SUBJECT -->\n							<div data-ng-hide="mailRoom" class="form-group" data-ng-class="{\'has-error\': forms.compose.subject.$invalid && forms.compose.$submitted}">\n								<div class="col-md-12">\n									<div class="row">\n										<div class="col-md-1">\n											<label class="control-label">Subject:</label>\n										</div>\n										<div class="col-md-11">\n											<input type="text" name="subject" class="form-control todo-taskbody-taskdesc" placeholder="Subject..." rows="8" data-ng-model="form.subject">\n											<span data-ng-show="forms.compose.subject.$invalid && forms.compose.$submitted" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n									</div>\n								</div>\n							</div>\n							<!-- END SUJBECT -->\n\n							<!-- START HTML -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.compose.text.$invalid && forms.compose.$submitted}">\n								<div class="col-md-12">\n									<div class="inbox-editor inbox-wysihtml5" text-angular data-ng-model="form.html" name="html"></div>\n									<span data-ng-show="forms.compose.text.$invalid && forms.compose.$submitted" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n							</div>\n							<!-- END HTML -->\n\n							<!-- START CANNED -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.compose.subject.$invalid && forms.compose.$submitted}">\n								<div class="col-md-12">\n									<input type="text"\n									data-ng-model="selectedAnswer"\n									placeholder="{{\'APPLICATION_CANNED_ANSWERS\' | translate | lowercase | capitalize}}.."\n									typeahead-on-select="onSelectAnswer($item)"\n									uib-typeahead="answer for answer in getAnswers($viewValue)"\n									typeahead-loading="loadingAnswers"\n									typeahead-no-results="noResults"\n									class="form-control">\n									<span data-ng-show="forms.compose.subject.$invalid && forms.compose.$submitted" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n							</div>\n							<!-- END CANNED -->\n\n							<!-- START ATTACH -->\n							<div class="form-group">\n								<div class="col-md-6">\n									<input type="file" nv-file-select="" uploader="uploader" multiple="">\n									<table class="table">\n										<tbody>\n											<tr ng-repeat="item in uploader.queue">\n												<td style="border-top:none"><strong>{{ item.file.name }}</strong></td>\n												<td style="border-top:none" ng-show="uploader.isHTML5" nowrap>{{ item.file.size/1024/1024|number:2 }} MB</td>\n												<td style="border-top:none" ng-show="uploader.isHTML5">\n													<div class="progress" style="margin-bottom: 0;">\n														<div class="progress-bar" role="progressbar" ng-style="{ \'width\': item.progress + \'%\' }"></div>\n													</div>\n												</td>\n												<td style="border-top-style:none" class="text-center">\n													<span ng-show="item.isSuccess"><i class="glyphicon glyphicon-ok"></i></span>\n													<span ng-show="item.isCancel"><i class="glyphicon glyphicon-ban-circle"></i></span>\n													<span ng-show="item.isError"><i class="glyphicon glyphicon-remove"></i></span>\n												</td>\n												<td style="border-top-style:none" nowrap>\n													<button type="button" class="btn btn-danger btn-xs" data-ng-click="item.remove()">\n														<span class="glyphicon glyphicon-trash"></span> {{\'APPLICATION_REMOVE\' | translate}}\n													</button>\n												</td>\n											</tr>\n										</tbody>\n									</table>\n									<div>\n									</div>\n								</div>\n								<div class="col-md-6">\n									<div class="form-actions right todo-form-actions" style="border-top: none;">\n										<input type="submit" value="{{ \'APPLICATION_SEND\' | translate }}" class="btn btn-sm green-meadow" data-ng-disabled="form.disabled || !form.html">\n										<input type="button" value="{{ \'APPLICATION_CANCEL\' | translate }}"class="btn btn-sm btn-default" data-ng-click="cancel()">\n									</div>\n								</div>\n							</div>\n							<!-- END ATTACH -->\n						</div>\n					</form>\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n<!-- END TODO CONTENT -->\n'),
+a.put("app/channels/mail/inbox/view/view.templates.modal.html",'<div class="modal-header" data-ng-init="initModal()">\n  <h3 class="modal-title">{{ \'APPLICATION_TEMPLATES\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <div class="note note-info" data-ng-show="!templates.length">\n    <h4 class="block">Info!</h4>\n    <p>\n      {{\'MESSAGE_NO_TEMPLATES_AVAILABLE\' | translate}}\n    </p>\n  </div>\n  <form name="form" data-ng-show="templates.length" novalidate>\n    <div class="form-group">\n      <ui-select data-ng-model="item.template" theme="bootstrap">\n        <ui-select-match placeholder="Select a template in the list or search his name...">{{$select.selected.name}}</ui-select-match>\n        <ui-select-choices repeat="template in templates | propsFilter: {name: $select.search}">\n          <div ng-bind-html="template.name | highlight: $select.search"></div>\n          <small data-ng-show="template.description">\n            {{\'APPLICATION_DESCRIPTION\' | translate}}: {{template.description}}\n          </small>\n        </ui-select-choices>\n      </ui-select>\n    </div>\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" data-ng-click="ok()" data-ng-show="templates.length">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" data-ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/channels/mail/queue/list/list.create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_QUEUE\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.general.name.$touched || form.general.$submitted) && form.general.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n      <span data-ng-show="(form.general.name.$touched || form.general.$submitted) && form.general.name.$invalid && form.general.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"/>\n    </div>\n    <!-- END DESCRIPTION -->\n\n    <!-- START TIMEOUT -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.general.timeout.$touched || form.general.$submitted) && form.general.timeout.$invalid}">\n      <label class="control-label">{{\'APPLICATION_AGENT_TIMEOUT\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="number" min="0" name="timeout" placeholder="Timeout" class="form-control" data-ng-model="item.timeout" required/>\n      <span data-ng-show="(form.general.timeout.$touched || form.general.$submitted) && form.general.timeout.$invalid && form.general.timeout.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END TIMEOUT -->\n\n    <!-- START STRATEGY -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.general.strategy.$touched || form.general.$submitted) && form.general.strategy.$invalid}">\n      <label class="control-label">{{\'APPLICATION_STRATEGY\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <ui-select data-ng-model="item.strategy" name="strategy" theme="bootstrap" required>\n        <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.toUpperCase()}}</ui-select-match>\n        <ui-select-choices repeat="strategy in [\'rrmemory\',\'beepall\'] | filter: $select.search">\n          <div ng-bind-html="strategy.toUpperCase() | highlight: $select.search"></div>\n        </ui-select-choices>\n      </ui-select>\n      <span data-ng-show="(form.general.strategy.$touched || form.general.$submitted) && form.general.strategy.$invalid && form.general.strategy.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END STRATEGY -->\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="save()" ng-disabled="form.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/channels/mail/queue/list/list.html",'<div class="row">\n	<div class="col-md-12">\n			<div class="page-bar">\n				<ul class="page-breadcrumb">\n					<li>\n						<i class="icon-rocket"></i>\n						<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-puzzle"></i>\n						<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-envelope"></i>\n						<a href="#">{{ \'APPLICATION_MAIL\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-docs"></i>\n						<a href="#">{{ \'APPLICATION_QUEUES\' | translate }}</a>\n					</li>\n				</ul>\n			</div>\n		</div>\n</div>\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-docs font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_QUEUES\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<a class="btn green-jungle" href="#" data-ng-click="createItem()">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_QUEUE\' | translate }}\n						</a>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n						<div class="watermark" ng-show="!gridOptions.data.length">{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/mail/queue/view/view.agents.html",'<div class="row" data-ng-init="getTeams()">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_AGENTS\' | translate}}</span>\n				</div>\n			</div>\n			<div class="note note-warning" data-ng-hide="teams.length">\n				<h4 class="block">Warning!</h4>\n				<p>\n					 {{ \'MESSAGE_NO_AVAILABLE_TEAMS\' | translate }}\n				</p>\n			</div>\n			<div class="portlet-body">\n				<!-- BEGIN FORM-->\n				<form action="index.html" class="form-horizontal form-row-seperated">\n					<div class="form-body">\n						<label for="penalty">{{\'APPLICATION_PENALTY\' | translate}}</label>\n						<div class="input-group input-small mbottom20">\n							<input type="number" class="spinner-input form-control" maxlength="3" data-ng-model="queue.penalty" readonly>\n							<div class="spinner-buttons input-group-btn btn-group-vertical">\n								<button type="button" class="btn spinner-up btn-xs blue" data-ng-click="queue.penalty=queue.penalty+1">\n									<i class="fa fa-angle-up"></i>\n								</button>\n								<button type="button" class="btn spinner-down btn-xs blue" data-ng-disabled="!queue.penalty" data-ng-click="queue.penalty=queue.penalty-1">\n									<i class="fa fa-angle-down"></i>\n								</button>\n							</div>\n						</div>\n						<div class="form-group last">\n							<div class="col-md-12" id="multi-select-team">\n							</div>\n						</div>\n					</div>\n				</form>\n				<!-- END FORM-->\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/channels/mail/queue/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getQueue()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-puzzle"></i>\n					<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-envelope"></i>\n					<a href="#">{{ \'APPLICATION_MAIL\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-docs"></i>\n					<a href="/channels/mail/queues/list">{{ \'APPLICATION_QUEUES\' | translate }}</a>\n					<i data-ng-show="queue" class="fa fa-angle-right"></i>\n				</li>\n				<li data-ng-show="queue">\n					<a href="#">{{queue.name}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET main.channels -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/queue.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{queue.name}}\n					</div>\n					<!-- <div class="profile-usertitle-job">\n					{{user.role}}\n				</div> -->\n			</div>\n			<!-- END SIDEBAR USER TITLE -->\n\n			<!-- SIDEBAR MENU -->\n			<div class="profile-usermenu">\n				<ul class="nav">\n					<li data-ng-class="{active: $state.is(\'main.channels.mail.queues.view.settings\')}">\n						<a data-ng-href="/channels/mail/queues/view/{{queue.id}}/settings">\n							<i class="icon-settings"></i>\n							{{ \'APPLICATION_SETTINGS\' | translate}} </a>\n						</li>\n						<li data-ng-class="{active: $state.is(\'main.channels.mail.queues.view.agents\')}">\n							<a data-ng-href="/channels/mail/queues/view/{{queue.id}}/agents">\n								<i class="icon-people"></i>\n								{{ \'APPLICATION_AGENTS\' | translate}} </a>\n							</li>\n						</ul>\n					</div>\n					<!-- END MENU -->\n				</div>\n				<!-- END PORTLET main.channels -->\n			</div>\n			<!-- END BEGIN PROFILE SIDEBAR -->\n			<!-- BEGIN PROFILE CONTENT -->\n			<div ui-view class="profile-content">\n			</div>\n			<!-- END PROFILE CONTENT -->\n		</div>\n	</div>\n	<!-- END PAGE CONTENT-->\n'),a.put("app/channels/mail/queue/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_SETTINGS\' | translate}}</span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<form name="forms.general" data-ng-submit="forms.general.$valid && updateMailQueue()" novalidate>\n					<!-- START NAME -->\n					<div class="form-group" data-ng-class="{\'has-error\': (forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid}">\n						<label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n						<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="queue.name" required/>\n						<span data-ng-show="(forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid && forms.general.name.$error.required" class="help-block help-block-error">\n							<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n						</span>\n					</div>\n					<!-- END NAME -->\n\n					<!-- START DESCRIPTION -->\n					<div class="form-group">\n						<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n						<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="queue.description"/>\n					</div>\n					<!-- END DESCRIPTION -->\n\n					<!-- START TIMEOUT -->\n					<div class="form-group">\n						<label class="control-label">Agent Timeout</label>\n						<input type="number" name="timeout" placeholder="Timeout" class="form-control" min="1" data-ng-model="queue.timeout"/>\n					</div>\n					<!-- END TIMEOUT -->\n\n					<!-- START HEADER SHAPE -->\n					<div class="form-group" data-ng-class="{\'has-error\': (forms.general.strategy.$touched || forms.general.$submitted) && forms.general.strategy.$invalid}">\n						<label class="control-label">{{\'APPLICATION_STRATEGY\' | translate}}</label>\n						<ui-select data-ng-model="queue.strategy" name="strategy" theme="bootstrap">\n							<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.toUpperCase()}}</ui-select-match>\n							<ui-select-choices repeat="strategy in [\'rrmemory\',\'beepall\'] | filter: $select.search">\n								<div ng-bind-html="strategy.toUpperCase() | highlight: $select.search"></div>\n							</ui-select-choices>\n						</ui-select>\n					</div>\n					<!-- END HEADER SHAPE -->\n					<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n				</form>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/channels/mail/realtime/view/agent/agent.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initAgents()">\n	<div class="col-md-12">\n		<!-- START TABLE -->\n		<div ui-grid="gridOptions"  ui-grid-resize-columns  class="ui-grid" ui-grid-tree-view ui-grid-expandable-row ui-grid-pagination auto-resize>\n			<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n		</div>\n		<!-- END TABLE -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/mail/realtime/view/agent/agent.modal.info.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_INTERFACE_INFO\' | translate }}</h3>\n</div>\n<div class="modal-body">\n<div data-ng-if="agent.ipaddr" class="well">\n  <div>{{agent.ipaddr}}:{{agent.port}}</div>\n  <div>{{agent.fullcontact}}</div>\n  <div>{{agent.useragent}}</div>\n  <div>{{agent.lastms}}</div>\n</div>\n<div data-ng-if="!agent.ipaddr" class="alert alert-danger" role="alert">\n  {{\'MESSAGE_NO_AVAILABLE_INFO\' | translate}}\n</div>\n</div>\n<div class="modal-footer">\n  <button class="btn default" type="button" ng-click="close()">{{ \'APPLICATION_CLOSE\' | translate }}</button>\n</div>\n'),a.put("app/channels/mail/realtime/view/agent/queue.modal.add.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_JOIN_QUEUE\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n\n    <div class="form-group row">\n  <label class="col-md-2 control-label" style="margin-top: 7px;">{{\'APPLICATION_QUEUE\' | translate}}:</label>\n  <div class="col-md-10">\n    <ui-select multiple ng-model="item.queues" theme="bootstrap" required>\n      <ui-select-match placeholder="{{\'APPLICATION_QUEUE\' | translate}}">{{$item.name}}</ui-select-match>\n      <ui-select-choices repeat="queue.id as queue in queues | filter: $select.search">\n        <div ng-bind-html="queue.name | highlight: $select.search"></div>\n      </ui-select-choices>\n    </ui-select>\n  </div>\n</div>\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="save()" ng-disabled="form.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/channels/mail/realtime/view/queue/queue.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initQueues()">\n	<div class="col-md-12">\n		<!-- START TABLE -->\n		<div ui-grid="gridOptions"  ui-grid-resize-columns class="ui-grid" ui-grid-tree-view auto-resize>\n			<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n		</div>\n		<!-- END TABLE -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/mail/realtime/view/session/session.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initSessions()">\n	<div class="col-md-12">\n		<!-- START TABLE -->\n		<div ui-grid="gridOptions"  ui-grid-resize-columns class="ui-grid" auto-resize>\n			<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n		</div>\n		<!-- END TABLE -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/mail/realtime/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-directions"></i>\n					<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-envelope"></i>\n					<a href="#">{{ \'APPLICATION_MAIL\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-energy"></i>\n					<a href="#">{{ \'APPLICATION_REALTIME\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<div>\n			<nav class="navbar navbar-default" role="navigation">\n				<div class="collapse navbar-collapse">\n					<ul class="nav navbar-nav">\n						<li data-ng-class="{\'active\': $state.is(\'channels.mail.realtime.view.agents\')}">\n							<a href="/channels/mail/realtime/view/agents">\n								{{\'APPLICATION_AGENTS\' | translate}}\n							</a>\n						</li>\n					</ul>\n				</div>\n			</nav>\n		</div>\n\n		<div ui-view></div>\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/mail/realtime/view/view.queue.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initAgents()">\n	<div class="col-md-12">\n		<!-- START TABLE -->\n		<div id="grid1" ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-tree-view class="grid">\n			<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n		</div>\n		<!-- END TABLE -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/voice/chanspy/list/list.create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_CHANSPY\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.name.$touched || form.$submitted) && form.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n      <span data-ng-show="(form.name.$touched || form.$submitted) && form.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n    <!-- START PREFIX -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.prefix.$touched || form.$submitted) && form.prefix.$invalid}">\n      <label class="control-label">{{\'APPLICATION_PREFIX\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="prefix" placeholder="{{\'APPLICATION_PREFIX\' | translate}}" class="form-control" data-ng-model="item.prefix" required/>\n      <span data-ng-show="(form.prefix.$touched || form.$submitted) && form.prefix.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END PREFIX -->\n\n    <!-- START OPTIONS -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.options.$touched || form.$submitted) && form.options.$invalid}">\n      <label class="control-label">{{\'APPLICATION_OPTIONS\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <ui-select multiple data-ng-model="item.options" name="options" theme="bootstrap" ui-required="true">\n        <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$item.value}}: {{$item.name | translate}}</ui-select-match>\n        <ui-select-choices repeat="option.value as option in options | filter: $select.search">\n          <div ng-bind-html="option.value + \': \' + (option.name | translate) | highlight: $select.search"></div>\n        </ui-select-choices>\n      </ui-select>\n      <span data-ng-show="(form.options.$touched || form.$submitted) && form.options.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END OPTIONS -->\n\n    <!-- START AUTH -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_AUTH\' | translate}}</label></br>\n      <input\n      bs-switch\n      class="form-control"\n      ng-model="item.auth"\n      type="checkbox"\n      name="auth"\n      data-ng-init="item.auth = 0"\n      switch-active="{{ recordSwitch.isActive }}"\n      switch-on-text="{{ recordSwitch.onText }}"\n      switch-off-text="{{ recordSwitch.offText }}"\n      switch-on-color="{{ recordSwitch.onColor }}"\n      switch-off-color="{{ recordSwitch.offColor }}"\n      switch-animate="{{ recordSwitch.animate }}"\n      switch-size="{{ recordSwitch.size }}"\n      switch-label="{{ recordSwitch.label }}"\n      switch-icon="{{ recordSwitch.icon }}"\n      switch-radio-off="{{ recordSwitch.radioOff }}"\n      switch-label-width="{{ recordSwitch.labelWidth }}"\n      switch-handle-width="{{ recordSwitch.handleWidth }}">\n    </div>\n    <!-- END AUTH -->\n\n    <!-- START PASSWORD -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.password.$touched || form.$submitted) && form.password.$invalid}">\n      <label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}}<span data-ng-show="item.auth" class="required" aria-required="true">*</span></label>\n      <input type="password" name="password" placeholder="{{\'APPLICATION_PASSWORD\' | translate}}" class="form-control" data-ng-model="item.password" data-ng-disabled="!item.auth" data-ng-required="item.auth"/>\n      <span data-ng-show="(form.password.$touched || form.$submitted) && form.password.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END PASSWORD -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n    </div>\n    <!-- END DESCRIPTION -->\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="save()" ng-disabled="form.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/channels/voice/chanspy/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-wrench"></i>\n					<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-eye"></i>\n					<a href="/channels/voice/chanspys/list">{{ \'APPLICATION_CHANSPY\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-docs font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_CHANSPY\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<button class="btn green-jungle " ng-click="createItem()">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_CHANSPY\' | translate }}\n						</button>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/voice/chanspy/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getChanSpy()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-wrench"></i>\n					<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-eye"></i>\n					<a href="/channels/voice/chanspys/list">{{ \'APPLICATION_CHANSPY\' | translate }}</a>\n					<i data-ng-show="chanspy" class="fa fa-angle-right"></i>\n				</li>\n				<li data-ng-show="chanspy">\n					<a href="#">{{chanspy.name}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/chanspy.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{chanspy.name}}\n					</div>\n					<!-- <div class="profile-usertitle-job">\n						{{user.role}}\n					</div> -->\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.tools.chanspy.view.settings\')}">\n							<a data-ng-href="/tools/chanspy/view/{{chanspy.id}}/settings">\n							<i class="icon-settings"></i>\n							{{ \'APPLICATION_SETTINGS\' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/voice/chanspy/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_CHANSPY\' | translate}} {{ \'APPLICATION_SETTINGS\' | translate}} </span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_GENERAL\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.general" data-ng-submit="forms.general.$valid && updateChanSpy()" novalidate>\n\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="chanspy.name" required/>\n								<span data-ng-show="(forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<!-- START PREFIX -->\n							<div class="form-group" data-ng-class="{\'has-error\': (form.general.prefix.$touched || form.general.$submitted) && form.general.prefix.$invalid}">\n								<label class="control-label">{{\'APPLICATION_PREFIX\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="prefix" placeholder="{{\'APPLICATION_PREFIX\' | translate}}" class="form-control" data-ng-model="chanspy.prefix" required/>\n								<span data-ng-show="(form.general.prefix.$touched || form.general.$submitted) && form.general.prefix.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END PREFIX -->\n\n							<!-- START OPTIONS -->\n							<div class="form-group" data-ng-class="{\'has-error\': (form.general.options.$touched || form.general.$submitted) && form.general.options.$invalid}">\n								<label class="control-label">{{\'APPLICATION_OPTIONS\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select multiple data-ng-model="chanspy.options" name="options" theme="bootstrap" ui-required="true">\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$item.value}}: {{$item.name | translate}}</ui-select-match>\n									<ui-select-choices repeat="option.value as option in options | filter: $select.search">\n										<div ng-bind-html="option.value + \': \' + (option.name | translate) | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span data-ng-show="(form.general.options.$touched || form.general.$submitted) && form.general.options.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END OPTIONS -->\n\n							<!-- START AUTH -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_AUTH\' | translate}}</label></br>\n								<input\n								bs-switch\n								class="form-control"\n								ng-model="chanspy.auth"\n								type="checkbox"\n								name="auth"\n								switch-active="{{ recordSwitch.isActive }}"\n								switch-on-text="{{ recordSwitch.onText }}"\n								switch-off-text="{{ recordSwitch.offText }}"\n								switch-on-color="{{ recordSwitch.onColor }}"\n								switch-off-color="{{ recordSwitch.offColor }}"\n								switch-animate="{{ recordSwitch.animate }}"\n								switch-size="{{ recordSwitch.size }}"\n								switch-label="{{ recordSwitch.label }}"\n								switch-icon="{{ recordSwitch.icon }}"\n								switch-radio-off="{{ recordSwitch.radioOff }}"\n								switch-label-width="{{ recordSwitch.labelWidth }}"\n								switch-handle-width="{{ recordSwitch.handleWidth }}">\n							</div>\n							<!-- END AUTH -->\n\n							<!-- START PASSWORD -->\n							<div class="form-group" data-ng-class="{\'has-error\': (form.general.password.$touched || form.general.$submitted) && form.general.password.$invalid}">\n								<label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}}<span class="required" data-ng-show="chanspy.auth" aria-required="true">*</span></label>\n								<input type="password" name="password" placeholder="{{\'APPLICATION_PASSWORD\' | translate}}" class="form-control" data-ng-model="chanspy.password" data-ng-disabled="!chanspy.auth" data-ng-required="chanspy.auth"/>\n								<span data-ng-show="(form.general.password.$touched || form.general.$submitted) && form.general.password.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END PASSWORD -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="chanspy.description"></textarea>\n							</div>\n							<!-- END DESCRIPTION -->\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END ADVANCED TAB -->\n\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),
+a.put("app/channels/voice/context/list/create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_CONTEXT\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.name.$touched || form.$submitted) && form.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n      <span data-ng-show="(form.name.$touched || form.$submitted) && form.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"/></textarea>\n    </div>\n    <!-- END DESCRIPTION -->\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" data-ng-click="ok()" data-ng-disabled="form.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" data-ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/channels/voice/context/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-puzzle"></i>\n					<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-docs"></i>\n					<a href="#">{{ \'APPLICATION_CONTEXTS\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-docs font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_CONTEXTS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<a class="btn green-jungle" href="#" data-ng-click="createItem()">\n						<i class="icon-plus"></i> {{ \'APPLICATION_NEW_CONTEXT\' | translate }}\n					</a>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/voice/context/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getContext()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-puzzle"></i>\n					<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-docs"></i>\n					<a href="/channels/voice/contexts/list">{{ \'APPLICATION_CONTEXTS\' | translate }}</a>\n					<i data-ng-show="context" class="fa fa-angle-right"></i>\n				</li>\n				<li data-ng-show="context">\n					<a href="#">{{context.name}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET main.channels -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/context.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{context.name}}\n					</div>\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.channels.voice.contexts.view.settings\')}">\n							<a data-ng-href="/channels/voice/contexts/view/{{context.id}}/settings">\n								<i class="icon-settings"></i>\n								{{ \'APPLICATION_SETTINGS\' | translate}} </a>\n							</li>\n						</ul>\n					</div>\n					<!-- END MENU -->\n				</div>\n				<!-- END PORTLET main.channels -->\n			</div>\n			<!-- END BEGIN PROFILE SIDEBAR -->\n			<!-- BEGIN PROFILE CONTENT -->\n			<div ui-view class="profile-content">\n			</div>\n			<!-- END PROFILE CONTENT -->\n		</div>\n	</div>\n	<!-- END PAGE CONTENT-->\n'),a.put("app/channels/voice/context/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_CONTEXT\' | translate}} {{ \'APPLICATION_SETTINGS\' | translate}} </span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_GENERAL\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.general" data-ng-submit="forms.general.$valid && updateVoiceContext()" novalidate>\n\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (form.name.$touched || form.$submitted) && form.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="context.name" required readonly/>\n								<span class="help-block">\n									{{ \'DESCRIPTION_CANT_EDIT_NAME\' | translate }}\n								</span>\n								<span data-ng-show="(form.name.$touched || form.$submitted) && form.name.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="context.description"></textarea>\n							</div>\n							<!-- END DESCRIPTION -->\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END ADVANCED TAB -->\n\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/channels/voice/moh/list/create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_MOH_CLASS\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.name.$touched || form.$submitted) && form.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n      <span data-ng-show="(form.name.$touched || form.$submitted) && form.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n    </div>\n    <!-- END DESCRIPTION -->\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="ok()" ng-disabled="form.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/channels/voice/moh/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-puzzle"></i>\n					<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-music-tone"></i>\n					<a href="#">{{ \'APPLICATION_MOHS\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-music-tone font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_MOHS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<a class="btn green-jungle" href="#" data-ng-click="createItem()">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_MOH_CLASS\' | translate }}\n						</a>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/voice/moh/view/view.addFiles.html",'\n<div class="row" data-ng-init="getSounds()">\n	<div class="col-md-12">\n		<!-- BEGIN  PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-notebook font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_MOH\' | translate }} {{ \'APPLICATION_ADD_FILES\' | translate }}</a> </span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<div class="note note-warning" data-ng-hide="soundList.length">\n					<h4 class="block">Warning!</h4>\n					<p>\n						 {{ \'MESSAGE_NO_SOUNDS_AVAILABLE\' | translate }}\n					</p>\n					<p>\n						{{\'APPLICATION_GO_TO\' | translate}} <a href="/tools/sounds/list">{{\'APPLICATION_SOUNDS\' | translate}}</a>\n					</p>\n				</div>\n            <form name="forms.general" data-ng-submit="(item.sounds.length > 0) && addMohs()" data-ng-show="soundList.length" novalidate>\n\n              <!-- START SOUNDS -->\n              <div class="form-group" data-ng-class="{\'has-error\': (forms.general.sounds.$touched || forms.general.$submitted) && item.sounds.length == 0}">\n                <label class="control-label">{{\'APPLICATION_SOUNDS\' | translate}}<span class="required" aria-required="true">*</span></label>\n                <ui-select multiple data-ng-model="item.sounds" theme="bootstrap" name="sounds" required>\n                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$item.display_name}}</ui-select-match>\n                  <ui-select-choices repeat="sound.id as sound in soundList | filter: $select.search">\n                    {{sound.display_name}}\n                  </ui-select-choices>\n                </ui-select>\n                <span data-ng-show="(forms.general.sounds.$touched || forms.general.$submitted) && item.sounds.length == 0" class="help-block help-block-error">\n                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                </span>\n              </div>\n              <!-- END OPTIONS -->\n\n							<input type="submit" class="btn green-haze" value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n						</form>\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/voice/moh/view/view.audios.html",'<div ui-view class="profile-content">\n<div class="row" data-ng-init="getAudioFiles()">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title  tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_AUDIOS\' | translate}}</span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="audioFiles">\n						<a class="btn green-jungle " href="/channels/voice/mohs/view/{{moh.id}}/add" data-toggle="dropdown">\n							<i class="icon-plus"></i> {{ \'APPLICATION_ADD_FILES\' | translate }}\n						</a>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<div class="note note-warning" data-ng-hide="audioFiles">\n					<h4 class="block">Warning!</h4>\n					<p>\n						 {{ \'MESSAGE_FOLDER_DOES_NOT_EXIST\' | translate }}\n					</p>\n				</div>\n				<!-- START TABLE -->\n				<table class="table table-striped table-bordered table-hover" data-ng-show="audioFiles">\n					  <thead>\n						  <tr>\n						    <th>{{ \'APPLICATION_NAME\' | translate }}</th>\n								<th width="30%">{{ \'APPLICATION_PREVIEW\' | translate }}</th>\n								<th width="10%">{{ \'APPLICATION_ACTIONS\' | translate }}</th>\n						  </tr>\n					  </thead>\n					  <tbody data-ng-model="audioFiles">\n					    <tr data-ng-repeat="audiofile in audioFiles">\n								<td>{{audiofile}}</td>\n								<td>\n									<audio controls ng-src="{{getSecureSrc(audioSources[audiofile])}}" preload="none">\n				            Your browser does not support the audio tag.\n				          </audio></td>\n					      <td>\n					        <a class="btn default btn-xs red-stripe" data-ng-click="deleteItem(audiofile,audiofile)">\n										{{ \'APPLICATION_DELETE\' | translate }}\n					        </a>\n					      </td>\n					    </tr>\n							<tr data-ng-hide="audioFiles.length">\n								<td colspan="3" style="text-align:center;">\n									<i>{{ \'MESSAGE_NO_AUDIOFILES_AVAILABLE\' | translate }}</i>\n								</td>\n							</tr>\n					  </tbody>\n				</table>\n				<!-- END TABLE -->\n			</div>\n		</div>\n	</div>\n</div>\n</div>\n'),a.put("app/channels/voice/moh/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getMoh()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-puzzle"></i>\n					<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-music-tone"></i>\n					<a href="/channels/voice/mohs/list">{{ \'APPLICATION_MOH_CLASS\' | translate }}</a>\n					<i data-ng-show="moh" class="fa fa-angle-right"></i>\n				</li>\n				<li data-ng-show="moh">\n					<a href="#">{{moh.name}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET main.channels -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/moh.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{moh.name}}\n					</div>\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.channels.voice.mohs.view.settings\')}">\n							<a data-ng-href="/channels/voice/mohs/view/{{moh.id}}/settings">\n							<i class="icon-settings"></i>\n							{{ \'APPLICATION_SETTINGS\' | translate}} </a>\n						</li>\n						<li data-ng-class="{active: $state.is(\'main.channels.voice.mohs.view.audios\') || $state.is(\'main.channels.voice.mohs.view.add\')}">\n							<a data-ng-href="/channels/voice/mohs/view/{{moh.id}}/audios">\n							<i class="icon-list"></i>\n							{{ \'APPLICATION_AUDIOS\' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET main.channels -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/voice/moh/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_MOH_CLASS\' | translate}} {{ \'APPLICATION_SETTINGS\' | translate}} </span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_GENERAL\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n\n			<div class="portlet-body" data-ng-init="getContexts();">\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.general" data-ng-submit="forms.general.$valid && updateVoiceMoh()" novalidate>\n\n	            <!-- START PATH -->\n	            <div class="form-group" >\n	              <label class="control-label">{{\'APPLICATION_PATH\' | translate}}</label>\n	              <input type="text" name="path" class="form-control" data-ng-model="moh.directory" disabled/>\n	            </div>\n	            <!-- END PATH -->\n\n	            <!-- START SORT -->\n	            <div class="form-group" data-ng-class="{\'has-error\': (forms.general.sort.$touched || forms.general.$submitted) && forms.general.sort.$invalid}">\n	              <label class="control-label">{{\'APPLICATION_SORT\' | translate}}<span class="required" aria-required="true">*</span></label>\n	              <ui-select data-ng-model="moh.sort" theme="bootstrap" name="sort" required>\n	                <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$translate.instant($select.selected.name)}}</ui-select-match>\n	                <ui-select-choices repeat="sort.value as sort in sortOptions | filter: $select.search">\n	                  {{$translate.instant(sort.name)}}\n	                </ui-select-choices>\n	              </ui-select>\n	              <span data-ng-show="(forms.general.sort.$touched || forms.general.$submitted) && forms.general.sort.$error.required" class="help-block help-block-error">\n	                <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n	              </span>\n	            </div>\n	            <!-- END SORT -->\n\n	            <!-- START DESCRIPTION -->\n				      <div class="form-group" data-ng-class="{\'has-error\': forms.general.$submitted && forms.general.description.$invalid}">\n				        <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n				        <textarea type="text" name="description" class="form-control" data-ng-model="moh.description"/></textarea>\n								<span data-ng-show="forms.general.$submitted && forms.general.description.$invalid" class="help-block help-block-error">\n				          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n				        </span>\n				      </div>\n				      <!-- END DESCRIPTION -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END GENERAL TAB -->\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/channels/voice/queue/list/list.create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_QUEUE\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.queue.name.$touched || form.queue.$submitted) && form.queue.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" data-ng-pattern="settings.patternName" required />\n      <span data-ng-show="(form.queue.name.$touched || form.queue.$submitted) && form.queue.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n      <span data-ng-show="(form.queue.name.$touched || form.queue.$submitted) && form.queue.name.$error.pattern" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_INVALID_PATTERN_NAME\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n    <!-- START STRATEGY -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.queue.strategy.$touched || form.queue.$submitted) && form.queue.strategy.$invalid}">\n      <label class="control-label">{{\'APPLICATION_STRATEGY\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <ui-select data-ng-model="item.strategy" name="strategy" theme="bootstrap" required>\n        <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.toUpperCase()}}</ui-select-match>\n        <ui-select-choices repeat="strategy in [\'ringall\', \'leastrecent\', \'fewestcalls\', \'random\', \'rrmemory\', \'linear\', \'wrandom\', \'rrordered\'] | filter: $select.search">\n          <div ng-bind-html="strategy.toUpperCase() | highlight: $select.search"></div>\n        </ui-select-choices>\n      </ui-select>\n      <span class="help-block">\n        {{ \'DESCRIPTION_QUEUE_STRATEGY\' | translate }}\n      </span>\n      <span data-ng-show="(form.queue.strategy.$touched || form.queue.$submitted) && form.queue.strategy.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END STRATEGY -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n    </div>\n    <!-- END DESCRIPTION -->\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="save()" ng-disabled="form.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/channels/voice/queue/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-puzzle"></i>\n					<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-earphones-alt"></i>\n					<a href="#">{{ \'APPLICATION_VOICE\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-docs"></i>\n					<a href="#">{{ \'APPLICATION_QUEUES\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-docs font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_QUEUES\' | translate }}</span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<a class="btn green-jungle " href="#"  data-ng-click="createItem()">\n						<i class="icon-plus"></i> {{ \'APPLICATION_NEW_QUEUE\' | translate }}\n					</a>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/voice/queue/view/view.agents.html",'<div class="row" data-ng-init="getTeams()">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_AGENTS\' | translate}}</span>\n				</div>\n			</div>\n			<div class="note note-warning" data-ng-hide="teams.length">\n				<h4 class="block">Warning!</h4><p>{{ \'MESSAGE_NO_AVAILABLE_TEAMS\' | translate }}</p>\n			</div>\n			<div class="portlet-body">\n				<!-- BEGIN FORM-->\n				<form action="index.html" class="form-horizontal form-row-seperated">\n					<div class="form-body">\n						<label for="penalty">{{\'APPLICATION_PENALTY\' | translate}}</label>\n						<div class="input-group input-small mbottom20">\n							<input type="number" class="spinner-input form-control" maxlength="3" data-ng-model="queue.penalty" readonly>\n							<div class="spinner-buttons input-group-btn btn-group-vertical">\n								<button type="button" class="btn spinner-up btn-xs blue" data-ng-click="queue.penalty=queue.penalty+1">\n									<i class="fa fa-angle-up"></i>\n								</button>\n								<button type="button" class="btn spinner-down btn-xs blue" data-ng-disabled="!queue.penalty" data-ng-click="queue.penalty=queue.penalty-1">\n									<i class="fa fa-angle-down"></i>\n								</button>\n							</div>\n						</div>\n						<div class="form-group last">\n							<div class="col-md-12" id="multi-select-team">\n							</div>\n						</div>\n					</div>\n				</form>\n				<!-- END FORM-->\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/channels/voice/queue/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getQueue()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-puzzle"></i>\n					<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-earphones-alt"></i>\n					<a href="#">{{ \'APPLICATION_VOICE\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-docs"></i>\n					<a href="/channels/voice/queues/list">{{ \'APPLICATION_QUEUES\' | translate }}</a>\n					<i data-ng-show="queue" class="fa fa-angle-right"></i>\n				</li>\n				<li data-ng-show="queue">\n					<a href="#">{{queue.name}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET main.channels -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/queue.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{queue.name}}\n					</div>\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.channels.voice.queues.view.settings\')}">\n							<a data-ng-href="/channels/voice/queues/view/{{queue.name}}/settings"> <i class="icon-settings"></i> {{ \'APPLICATION_SETTINGS\' | translate}} </a>\n						</li>\n						<li data-ng-class="{active: $state.is(\'main.channels.voice.queues.view.agents\')}">\n							<a data-ng-href="/channels/voice/queues/view/{{queue.name}}/agents"><i class="icon-people"></i>{{ \'APPLICATION_AGENTS\' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET main.channels -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/voice/queue/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_QUEUE_SETTINGS\' | translate}}</span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_GENERAL\' | translate}}</a>\n					</li>\n					<li>\n						<a href="#" data-target="#tab_1_2" data-toggle="tab">{{ \'APPLICATION_PERIODIC_ANNOUNCE\' | translate}}</a>\n					</li>\n					<li>\n						<a href="#" data-target="#tab_1_3" data-toggle="tab">{{ \'APPLICATION_ADVANCED\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n\n			<div class="portlet-body" data-ng-init="getContexts();getMohs();getSounds();">\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.general" data-ng-submit="forms.general.$valid && updateVoiceQueue()" novalidate>\n							<div class="row">\n								<div class="col-md-6">\n							<!-- START STRATEGY -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.strategy.$touched || forms.general.$submitted) && forms.general.strategy.$invalid}">\n								<label class="control-label">{{\'APPLICATION_STRATEGY\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="queue.strategy" name="strategy" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.toUpperCase()}}</ui-select-match>\n									<ui-select-choices repeat="strategy in [\'ringall\', \'leastrecent\', \'fewestcalls\', \'random\', \'rrmemory\', \'linear\', \'wrandom\', \'rrordered\'] | filter: $select.search">\n										<div ng-bind-html="strategy.toUpperCase() | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_STRATEGY\' | translate }}\n								</span>\n								<span data-ng-show="(forms.general.strategy.$touched || forms.general.$submitted) && forms.general.strategy.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n				      <!-- END STRATEGY -->\n\n							<!-- START MOH -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.musiconhold.$touched || forms.general.$submitted) && forms.general.musiconhold.$invalid}">\n								<label class="control-label">{{\'APPLICATION_MOH\' | translate}}</label>\n								<ui-select data-ng-model="queue.musiconhold" name="musiconhold" theme="bootstrap">\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n									<ui-select-choices repeat="musiconhold.name as musiconhold in voiceMohs | filter: $select.search">\n										<div ng-bind-html="musiconhold.name | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_VOICE_MOH\' | translate }}\n								</span>\n								<span data-ng-show="(forms.general.musiconhold.$touched || forms.general.$submitted) && forms.general.musiconhold.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END MOH -->\n\n							<!-- START TIMEOUT -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.timeout.$touched || forms.general.$submitted) && forms.general.timeout.$invalid}">\n								<label class="control-label">{{\'APPLICATION_TIMEOUT\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="number" min="0" name="timeout" placeholder="{{\'APPLICATION_TIMEOUT\' | translate}}" class="form-control" data-ng-model="queue.timeout" required/>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_TIMEOUT\' | translate }}\n								</span>\n								<span data-ng-show="(forms.general.timeout.$touched || forms.general.$submitted) && forms.general.timeout.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END TIMEOUT -->\n\n							<!-- START MAXLEN -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.maxlen.$touched || forms.general.$submitted) && forms.general.maxlen.$invalid}">\n								<label class="control-label">{{\'APPLICATION_MAXLEN\' | translate}}</label>\n								<input type="number" min="0" name="maxlen" placeholder="{{\'APPLICATION_MAXLEN\' | translate}}" class="form-control" data-ng-model="queue.maxlen" required/>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_MAXLEN\' | translate }}\n								</span>\n								<span data-ng-show="(forms.general.maxlen.$touched || forms.general.$submitted) && forms.general.maxlen.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END MAXLEN -->\n\n							<!-- START RETRY -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.retry.$touched || forms.general.$submitted) && forms.general.retry.$invalid}">\n								<label class="control-label">{{\'APPLICATION_RETRY\' | translate}}</label>\n								<input type="number" min="0" name="retry" placeholder="{{\'APPLICATION_RETRY\' | translate}}" class="form-control" data-ng-model="queue.retry" required/>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_RETRY\' | translate }}\n								</span>\n								<span data-ng-show="(forms.general.retry.$touched || forms.general.$submitted) && forms.general.retry.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END RETRY -->\n\n						</div>\n						<div class="col-md-6">\n							<!-- START WRAPUPTIME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.wrapuptime.$touched || forms.general.$submitted) && forms.general.wrapuptime.$invalid}">\n								<label class="control-label">{{\'APPLICATION_WRAPUPTIME\' | translate}}</label>\n								<input type="number" min="0" name="wrapuptime" placeholder="{{\'APPLICATION_WRAPUPTIME\' | translate}}" class="form-control" data-ng-model="queue.wrapuptime" required/>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_WRAPUPTIME\' | translate }}\n								</span>\n								<span data-ng-show="(forms.general.wrapuptime.$touched || forms.general.$submitted) && forms.general.wrapuptime.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END WRAPUPTIME -->\n\n							<!-- START WEIGHT -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.weight.$touched || forms.general.$submitted) && forms.general.weight.$invalid}">\n								<label class="control-label">{{\'APPLICATION_WEIGHT\' | translate}}</label>\n								<input type="number" min="0" name="weight" placeholder="{{\'APPLICATION_WEIGHT\' | translate}}" class="form-control" data-ng-model="queue.weight" required/>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_WEIGHT\' | translate }}\n								</span>\n								<span data-ng-show="(forms.general.weight.$touched || forms.general.$submitted) && forms.general.weight.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END WEIGHT -->\n\n							<!-- START JOINEMPTY -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.joinempty.$touched || forms.general.$submitted) && forms.general.joinempty.$invalid}">\n								<label class="control-label">{{\'APPLICATION_JOINEMPTY\' | translate}}</label>\n								<ui-select multiple data-ng-model="queue.joinempty" name="joinempty" theme="bootstrap">\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$item}}</ui-select-match>\n									<ui-select-choices repeat="item in [\'yes\',\'no\',\'strict\',\'loose\',\'paused\',\'penalty\',\'inuse\',\'ringing\',\'unavailable\',\'invalid\',\'unknown\',\'wrapup\'] | filter: $select.search">\n										<div ng-bind-html="item | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_JOINEMPTY\' | translate }}\n								</span>\n								<span data-ng-show="(forms.general.joinempty.$touched || forms.general.$submitted) && forms.general.joinempty.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END JOINEMPTY -->\n\n							<!-- START LEAVEWHENEMPTY -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.leavewhenempty.$touched || forms.general.$submitted) && forms.general.leavewhenempty.$invalid}">\n								<label class="control-label">{{\'APPLICATION_LEAVEWHENEMPTY\' | translate}}</label>\n								<ui-select multiple data-ng-model="queue.leavewhenempty" name="leavewhenempty" theme="bootstrap">\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$item}}</ui-select-match>\n									<ui-select-choices repeat="item in [\'yes\',\'no\',\'strict\',\'loose\',\'paused\',\'penalty\',\'inuse\',\'ringing\',\'unavailable\',\'invalid\',\'unknown\',\'wrapup\'] | filter: $select.search">\n										<div ng-bind-html="item | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_LEAVEWHENEMPTY\' | translate }}\n								</span>\n								<span data-ng-show="(forms.general.leavewhenempty.$touched || forms.general.$submitted) && forms.general.leavewhenempty.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END LEAVEWHENEMPTY -->\n\n							<!-- START ANNOUNCE -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.announce.$touched || forms.general.$submitted) && forms.general.announce.$invalid}">\n								<label class="control-label">{{\'APPLICATION_ANNOUNCE\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="queue.announce" name="announce" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n									<ui-select-choices repeat="returnAnnouncePath(announce) as announce in sounds | filter: $select.search">\n										<div ng-bind-html="announce.display_name | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_ANNOUNCE\' | translate }}\n								</span>\n								<span data-ng-show="(forms.general.announce.$touched || forms.general.$submitted) && forms.general.announce.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END ANNOUNCE -->\n						</div>\n					</div>\n					<!-- START DESCRIPTION -->\n					<div class="form-group">\n						<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n						<textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="queue.description"></textarea>\n					</div>\n					<!-- END DESCRIPTION -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n\n					<div class="tab-pane" id="tab_1_2">\n						<form name="forms.announce" data-ng-submit="forms.announce.$valid && updateVoiceQueue()" novalidate>\n							<div class="row">\n								<div class="col-md-12">\n							<!-- START PERIODIC_ANNOUNCE -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.announce.periodic_announce.$touched || forms.announce.$submitted) && forms.announce.periodic_announce.$invalid}">\n								<label class="control-label">{{\'APPLICATION_PERIODIC_ANNOUNCE\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select multiple data-ng-model="queue.periodic_announce" name="periodic_announce" theme="bootstrap" required data-ng-disabled="!periodicAnnounces.length">\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$item.display_name}}</ui-select-match>\n									<ui-select-choices repeat="returnAnnouncePath(announce) as announce in periodicAnnounces | filter: $select.search">\n										<div ng-bind-html="announce.display_name | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<div class="note note-warning" data-ng-hide="periodicAnnounces.length">\n									<h4 class="block">Warning!</h4>\n									<p>\n										{{ \'MESSAGE_NO_SOUNDS_AVAILABLE\' | translate }}\n									</p>\n									<p>\n										{{\'APPLICATION_GO_TO\' | translate}} <a href="/tools/sounds/list">{{\'APPLICATION_SOUNDS\' | translate}}</a>\n									</p>\n								</div>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_PERIODIC_ANNOUNCE\' | translate }}\n								</span>\n								<span data-ng-show="(forms.announce.periodic_announce.$touched || forms.announce.$submitted) && forms.announce.periodic_announce.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END PERIODIC_ANNOUNCE -->\n						</div>\n					</div>\n							<div class="row">\n								<div class="col-md-6">\n							<p><h3>{{\'APPLICATION_SETTINGS\' | translate}}</h3></p>\n							<!-- START ANNOUNCE_FREQUENCY -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.announce.announce_frequency.$touched || forms.announce.$submitted) && forms.announce.announce_frequency.$invalid}">\n								<label class="control-label">{{\'APPLICATION_ANNOUNCE_FREQUENCY\' | translate}}</label>\n								<input type="number" min="0" name="announce_frequency" placeholder="{{\'APPLICATION_ANNOUNCE_FREQUENCY\' | translate}}" class="form-control" data-ng-model="queue.announce_frequency" required/>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_ANNOUNCE_FREQUENCY\' | translate }}\n								</span>\n								<span data-ng-show="(forms.announce.announce_frequency.$touched || forms.announce.$submitted) && forms.announce.announce_frequency.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END ANNOUNCE_FREQUENCY -->\n\n							<!-- START MIN_ANNOUNCE_FREQUENCY -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.announce.min_announce_frequency.$touched || forms.announce.$submitted) && forms.announce.min_announce_frequency.$invalid}">\n								<label class="control-label">{{\'APPLICATION_MIN_ANNOUNCE_FREQUENCY\' | translate}}</label>\n								<input type="number" min="0" name="min_announce_frequency" placeholder="{{\'APPLICATION_MIN_ANNOUNCE_FREQUENCY\' | translate}}" class="form-control" data-ng-model="queue.min_announce_frequency" required/>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_MIN_ANNOUNCE_FREQUENCY\' | translate }}\n								</span>\n								<span data-ng-show="(forms.announce.min_announce_frequency.$touched || forms.announce.$submitted) && forms.announce.min_announce_frequency.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END MIN_ANNOUNCE_FREQUENCY -->\n\n							<!-- START PERIODIC_ANNOUNCE_FREQUENCY -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.announce.periodic_announce_frequency.$touched || forms.announce.$submitted) && forms.announce.periodic_announce_frequency.$invalid}">\n								<label class="control-label">{{\'APPLICATION_PERIODIC_ANNOUNCE_FREQUENCY\' | translate}}</label>\n								<input type="number" min="0" name="periodic_announce_frequency" placeholder="{{\'APPLICATION_PERIODIC_ANNOUNCE_FREQUENCY\' | translate}}" class="form-control" data-ng-model="queue.periodic_announce_frequency"/>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_PERIODIC_ANNOUNCE_FREQUENCY\' | translate }}\n								</span>\n								<span data-ng-show="(forms.announce.periodic_announce_frequency.$touched || forms.announce.$submitted) && forms.announce.periodic_announce_frequency.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END PERIODIC_ANNOUNCE_FREQUENCY -->\n\n							<!-- START RANDOM_PERIODIC_ANNOUNCE -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.announce.random_periodic_announce.$touched || forms.announce.$submitted) && forms.announce.random_periodic_announce.$invalid}">\n								<label class="control-label">{{\'APPLICATION_RANDOM_PERIODIC_ANNOUNCE\' | translate}}</label>\n								<ui-select data-ng-model="queue.random_periodic_announce" name="random_periodic_announce" theme="bootstrap">\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n									<ui-select-choices repeat="item in [\'yes\',\'no\'] | filter: $select.search">\n										<div ng-bind-html="item | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_RANDOM_PERIODIC_ANNOUNCE\' | translate }}\n								</span>\n								<span data-ng-show="(forms.announce.random_periodic_announce.$touched || forms.announce.$submitted) && forms.announce.random_periodic_announce.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END RANDOM_PERIODIC_ANNOUNCE -->\n\n							<!-- START ANNOUNCE_HOLDTIME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.announce.announce_holdtime.$touched || forms.announce.$submitted) && forms.announce.announce_holdtime.$invalid}">\n								<label class="control-label">{{\'APPLICATION_ANNOUNCE_HOLDTIME\' | translate}}</label>\n								<ui-select data-ng-model="queue.announce_holdtime" name="announce_holdtime" theme="bootstrap">\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n									<ui-select-choices repeat="item in [\'yes\',\'no\',\'once\'] | filter: $select.search">\n										<div ng-bind-html="item | highlight: $select.search"></div>\n									</ui-select-choices>\n									</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_ANNOUNCE_HOLDTIME\' | translate }}\n								</span>\n								<span data-ng-show="(forms.announce.announce_holdtime.$touched || forms.announce.$submitted) && forms.announce.announce_holdtime.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END ANNOUNCE_HOLDTIME -->\n\n							<!-- START ANNOUNCE_POSITION -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.announce.announce_position.$touched || forms.announce.$submitted) && forms.announce.announce_position.$invalid}">\n								<label class="control-label">{{\'APPLICATION_ANNOUNCE_POSITION\' | translate}}</label>\n								<ui-select data-ng-model="queue.announce_position" name="announce_position" theme="bootstrap">\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n									<ui-select-choices repeat="item in [\'yes\',\'no\',\'limit\',\'more\'] | filter: $select.search">\n										<div ng-bind-html="item | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_ANNOUNCE_POSITION\' | translate }}\n								</span>\n								<span data-ng-show="(forms.announce.announce_position.$touched || forms.announce.$submitted) && forms.announce.announce_position.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END ANNOUNCE_POSITION -->\n\n							<!-- START ANNOUNCE_POSITION_LIMIT -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.announce.announce_position_limit.$touched || forms.announce.$submitted) && forms.announce.announce_position_limit.$invalid}">\n								<label class="control-label">{{\'APPLICATION_ANNOUNCE_POSITION_LIMIT\' | translate}}</label>\n								<input type="number" min="0" name="announce_position_limit" placeholder="{{\'APPLICATION_ANNOUNCE_POSITION_LIMIT\' | translate}}" class="form-control" data-ng-model="queue.announce_position_limit"/>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_ANNOUNCE_POSITION_LIMIT\' | translate }}\n								</span>\n								<span data-ng-show="(forms.announce.announce_position_limit.$touched || forms.announce.$submitted) && forms.announce.announce_position_limit.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END ANNOUNCE_POSITION_LIMIT -->\n\n							<!-- START REPORTHOLDTIME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.announce.reportholdtime.$touched || forms.announce.$submitted) && forms.announce.reportholdtime.$invalid}">\n								<label class="control-label">{{\'APPLICATION_REPORTHOLDTIME\' | translate}}</label>\n								<ui-select data-ng-model="queue.reportholdtime" name="reportholdtime" theme="bootstrap">\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n									<ui-select-choices repeat="item in [\'yes\',\'no\'] | filter: $select.search">\n										<div ng-bind-html="item | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_REPORTHOLDTIME\' | translate }}\n								</span>\n								<span data-ng-show="(forms.announce.reportholdtime.$touched || forms.announce.$submitted) && forms.announce.reportholdtime.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END REPORTHOLDTIME -->\n\n						</div>\n							<div class="col-md-6">\n								<p><h3>{{\'APPLICATION_SOUNDS\' | translate}}</h3></p>\n								<!-- START QUEUE_REPORTHOLD -->\n								<div class="form-group" data-ng-class="{\'has-error\': (forms.announce.queue_reporthold.$touched || forms.announce.$submitted) && forms.announce.queue_reporthold.$invalid}">\n									<label class="control-label">{{\'APPLICATION_QUEUE_REPORTHOLD\' | translate}}<span class="required" aria-required="true">*</span></label>\n									<ui-select data-ng-model="queue.queue_reporthold" name="queue_reporthold" theme="bootstrap" required>\n										<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n										<ui-select-choices repeat="returnAnnouncePath(announce) as announce in queueAnnounces | filter: $select.search">\n											<div ng-bind-html="announce.display_name | highlight: $select.search"></div>\n										</ui-select-choices>\n									</ui-select>\n									<span class="help-block">\n										{{ \'DESCRIPTION_QUEUE_REPORTHOLD\' | translate }}\n									</span>\n									<span data-ng-show="(forms.announce.queue_reporthold.$touched || forms.announce.$submitted) && forms.announce.queue_reporthold.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END QUEUE_REPORTHOLD -->\n\n								<!-- START QUEUE_YOUARENEXT -->\n								<div class="form-group" data-ng-class="{\'has-error\': (forms.announce.queue_youarenext.$touched || forms.announce.$submitted) && forms.announce.queue_youarenext.$invalid}">\n									<label class="control-label">{{\'APPLICATION_QUEUE_YOUARENEXT\' | translate}}<span class="required" aria-required="true">*</span></label>\n									<ui-select data-ng-model="queue.queue_youarenext" name="queue_youarenext" theme="bootstrap" required>\n										<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n										<ui-select-choices repeat="returnAnnouncePath(announce) as announce in queueAnnounces | filter: $select.search">\n											<div ng-bind-html="announce.display_name | highlight: $select.search"></div>\n										</ui-select-choices>\n									</ui-select>\n									<span class="help-block">\n										{{ \'DESCRIPTION_QUEUE_YOUARENEXT\' | translate }}\n									</span>\n									<span data-ng-show="(forms.announce.queue_youarenext.$touched || forms.announce.$submitted) && forms.announce.queue_youarenext.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END QUEUE_YOUARENEXT -->\n\n							<!-- START QUEUE_THEREARE -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.announce.queue_thereare.$touched || forms.announce.$submitted) && forms.announce.queue_thereare.$invalid}">\n								<label class="control-label">{{\'APPLICATION_QUEUE_THEREARE\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="queue.queue_thereare" name="queue_thereare" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n									<ui-select-choices repeat="returnAnnouncePath(announce) as announce in queueAnnounces | filter: $select.search">\n										<div ng-bind-html="announce.display_name | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_THEREARE\' | translate }}\n								</span>\n								<span data-ng-show="(forms.announce.queue_thereare.$touched || forms.announce.$submitted) && forms.announce.queue_thereare.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END QUEUE_THEREARE -->\n\n							<!-- START QUEUE_CALLSWAITING -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.announce.queue_callswaiting.$touched || forms.announce.$submitted) && forms.announce.queue_callswaiting.$invalid}">\n								<label class="control-label">{{\'APPLICATION_QUEUE_CALLSWAITING\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="queue.queue_callswaiting" name="queue_callswaiting" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n									<ui-select-choices repeat="returnAnnouncePath(announce) as announce in queueAnnounces | filter: $select.search">\n										<div ng-bind-html="announce.display_name | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_CALLSWAITING\' | translate }}\n								</span>\n								<span data-ng-show="(forms.announce.queue_callswaiting.$touched || forms.announce.$submitted) && forms.announce.queue_callswaiting.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END QUEUE_CALLSWAITING -->\n\n							<!-- START QUEUE_HOLDTIME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.announce.queue_holdtime.$touched || forms.announce.$submitted) && forms.announce.queue_holdtime.$invalid}">\n								<label class="control-label">{{\'APPLICATION_QUEUE_HOLDTIME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="queue.queue_holdtime" name="queue_holdtime" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n									<ui-select-choices repeat="returnAnnouncePath(announce) as announce in queueAnnounces | filter: $select.search">\n										<div ng-bind-html="announce.display_name | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_HOLDTIME\' | translate }}\n								</span>\n								<span data-ng-show="(forms.announce.queue_holdtime.$touched || forms.announce.$submitted) && forms.announce.queue_holdtime.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END QUEUE_HOLDTIME -->\n\n							<!-- START QUEUE_MINUTES -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.announce.queue_minutes.$touched || forms.announce.$submitted) && forms.announce.queue_minutes.$invalid}">\n								<label class="control-label">{{\'APPLICATION_QUEUE_MINUTES\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="queue.queue_minutes" name="queue_minutes" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n									<ui-select-choices repeat="returnAnnouncePath(announce) as announce in queueAnnounces | filter: $select.search">\n										<div ng-bind-html="announce.display_name | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_MINUTES\' | translate }}\n								</span>\n								<span data-ng-show="(forms.announce.queue_minutes.$touched || forms.announce.$submitted) && forms.announce.queue_minutes.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END QUEUE_MINUTES -->\n\n							<!-- START QUEUE_MINUTE -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.announce.queue_minute.$touched || forms.announce.$submitted) && forms.announce.queue_minute.$invalid}">\n								<label class="control-label">{{\'APPLICATION_QUEUE_MINUTE\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="queue.queue_minute" name="queue_minute" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n									<ui-select-choices repeat="returnAnnouncePath(announce) as announce in queueAnnounces | filter: $select.search">\n										<div ng-bind-html="announce.display_name | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_MINUTE\' | translate }}\n								</span>\n								<span data-ng-show="(forms.announce.queue_minute.$touched || forms.announce.$submitted) && forms.announce.queue_minute.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END QUEUE_MINUTE -->\n\n							<!-- START QUEUE_SECONDS -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.announce.queue_seconds.$touched || forms.announce.$submitted) && forms.announce.queue_seconds.$invalid}">\n								<label class="control-label">{{\'APPLICATION_QUEUE_SECONDS\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="queue.queue_seconds" name="queue_seconds" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n									<ui-select-choices repeat="returnAnnouncePath(announce) as announce in queueAnnounces | filter: $select.search">\n										<div ng-bind-html="announce.display_name | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_SECONDS\' | translate }}\n								</span>\n								<span data-ng-show="(forms.announce.queue_seconds.$touched || forms.announce.$submitted) && forms.announce.queue_seconds.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END QUEUE_SECONDS -->\n\n							<!-- START QUEUE_THANKYOU -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.announce.queue_thankyou.$touched || forms.announce.$submitted) && forms.announce.queue_thankyou.$invalid}">\n								<label class="control-label">{{\'APPLICATION_QUEUE_THANKYOU\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="queue.queue_thankyou" name="QUEUE_THANKYOU" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n									<ui-select-choices repeat="returnAnnouncePath(announce) as announce in queueAnnounces | filter: $select.search">\n										<div ng-bind-html="announce.display_name | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_THANKYOU\' | translate }}\n								</span>\n								<span data-ng-show="(forms.announce.queue_thankyou.$touched || forms.announce.$submitted) && forms.announce.queue_thankyou.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END QUEUE_THANKYOU -->\n\n						</div>\n					</div>\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END GENERAL TAB -->\n					<!-- ADVANCED TAB -->\n					<div class="tab-pane" id="tab_1_3">\n						<form name="forms.advanced" data-ng-submit="forms.advanced.$valid && updateVoiceQueue()" novalidate>\n\n							<div class="row">\n								<div class="col-md-6">\n\n							<!-- START AUTOPAUSE -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.autopause.$touched || forms.advanced.$submitted) && forms.advanced.autopause.$invalid}">\n								<label class="control-label">{{\'APPLICATION_AUTOPAUSE\' | translate}}</label>\n								<ui-select data-ng-model="queue.autopause" name="autopause" theme="bootstrap">\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n									<ui-select-choices repeat="item in [\'yes\',\'no\',\'all\'] | filter: $select.search">\n										<div ng-bind-html="item | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_AUTOPAUSE\' | translate }}\n								</span>\n								<span data-ng-show="(forms.advanced.autopause.$touched || forms.advanced.$submitted) && forms.advanced.autopause.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END AUTOPAUSE -->\n\n							<!-- START RINGINUSE -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.ringinuse.$touched || forms.advanced.$submitted) && forms.advanced.ringinuse.$invalid}">\n								<label class="control-label">{{\'APPLICATION_RINGINUSE\' | translate}}</label>\n								<ui-select data-ng-model="queue.ringinuse" name="ringinuse" theme="bootstrap">\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n									<ui-select-choices repeat="item in [\'yes\',\'no\'] | filter: $select.search">\n										<div ng-bind-html="item | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_RINGINUSE\' | translate }}\n								</span>\n								<span data-ng-show="(forms.advanced.ringinuse.$touched || forms.advanced.$submitted) && forms.advanced.ringinuse.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END RINGINUSE -->\n\n							<!-- START MEMBER_DELAY -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.memberdelay.$touched || forms.advanced.$submitted) && forms.advanced.memberdelay.$invalid}">\n								<label class="control-label">{{\'APPLICATION_MEMBER_DELAY\' | translate}}</label>\n								<input type="number" min="0" name="memberdelay" placeholder="{{\'APPLICATION_MEMBER_DELAY\' | translate}}" class="form-control" data-ng-model="queue.memberdelay" required/>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_MEMBER_DELAY\' | translate }}\n								</span>\n								<span data-ng-show="(forms.advanced.memberdelay.$touched || forms.advanced.$submitted) && forms.advanced.memberdelay.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END MEMBER_DELAY -->\n\n							<!-- START ACW -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.acw.$touched || forms.advanced.$submitted) && forms.advanced.acw.$invalid}">\n								<label class="control-label">{{\'APPLICATION_ACW\' | translate}}</label></br>\n								<input\n								bs-switch\n								class="form-control"\n								ng-model="queue.acw"\n								type="checkbox"\n								switch-active="{{ recordSwitch.isActive }}"\n								switch-on-text="{{ recordSwitch.onText }}"\n								switch-off-text="{{ recordSwitch.offText }}"\n								switch-on-color="{{ recordSwitch.onColor }}"\n								switch-off-color="{{ recordSwitch.offColor }}"\n								switch-animate="{{ recordSwitch.animate }}"\n								switch-size="{{ recordSwitch.size }}"\n								switch-label="{{ recordSwitch.label }}"\n								switch-icon="{{ recordSwitch.icon }}"\n								switch-radio-off="{{ recordSwitch.radioOff }}"\n								switch-label-width="{{ recordSwitch.labelWidth }}"\n								switch-handle-width="{{ recordSwitch.handleWidth }}">\n								<span class="help-block">\n									{{ \'DESCRIPTION_ACW\' | translate }}\n								</span>\n								<span data-ng-show="(forms.advanced.acw.$touched || forms.advanced.$submitted) && forms.advanced.acw.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_ACW\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END ACW -->\n\n						</div>\n							<div class="col-md-6">\n\n							<!-- START TIMEOUTRESTART -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.timeoutrestart.$touched || forms.advanced.$submitted) && forms.advanced.timeoutrestart.$invalid}">\n								<label class="control-label">{{\'APPLICATION_TIMEOUTRESTART\' | translate}}</label>\n								<ui-select data-ng-model="queue.timeoutrestart" name="timeoutrestart" theme="bootstrap">\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n									<ui-select-choices repeat="item in [\'yes\',\'no\'] | filter: $select.search">\n										<div ng-bind-html="item | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_TIMEOUTRESTART\' | translate }}\n								</span>\n								<span data-ng-show="(forms.advanced.timeoutrestart.$touched || forms.advanced.$submitted) && forms.advanced.timeoutrestart.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END TIMEOUTRESTART -->\n\n							<!-- START MONITOR_FORMAT -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.monitor_format.$touched || forms.advanced.$submitted) && forms.advanced.monitor_format.$invalid}">\n								<label class="control-label">{{\'APPLICATION_MONITOR_FORMAT\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="queue.monitor_format" name="monitor_format" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n									<ui-select-choices repeat="monFormat.value as monFormat in monitorFormats | filter: $select.search">\n										<div ng-bind-html="monFormat.name | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_MONITOR_FORMAT\' | translate }}\n								</span>\n								<span data-ng-show="(forms.advanced.monitor_format.$touched || forms.advanced.$submitted) && forms.advanced.monitor_format.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END MONITOR_FORMAT -->\n\n							<!-- START CONTEXT -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.context.$touched || forms.advanced.$submitted) && forms.advanced.context.$invalid}">\n								<label class="control-label">{{\'APPLICATION_CONTEXT\' | translate}}</label>\n								<ui-select data-ng-model="queue.context" name="context" theme="bootstrap">\n									<ui-select-match allow-clear placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n									<ui-select-choices repeat="context.name as context in voiceContexts | filter: $select.search">\n										<div ng-bind-html="context.name | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_VOICE_CONTEXT\' | translate }}\n								</span>\n								<span data-ng-show="(forms.advanced.context.$touched || forms.advanced.$submitted) && forms.advanced.context.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END CONTEXT -->\n\n							<!-- START ACW_TIMEOUT -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.acwTimeout.$touched || forms.advanced.$submitted) && forms.advanced.acwTimeout.$invalid}">\n								<label class="control-label">{{\'APPLICATION_ACW_TIMEOUT\' | translate}}</label>\n								<input type="number" min="0" name="acwTimeout" placeholder="{{\'APPLICATION_ACW_TIMEOUT\' | translate}}" class="form-control" data-ng-model="queue.acwTimeout" required/>\n								<span class="help-block">\n									{{ \'DESCRIPTION_ACW_TIMEOUT\' | translate }}\n								</span>\n								<span data-ng-show="(forms.advanced.acwTimeout.$touched || forms.advanced.$submitted) && forms.advanced.acwTimeout.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END ACW_TIMEOUT -->\n\n						</div>\n					</div>\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END ADVANCED TAB -->\n\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),
+a.put("app/channels/voice/realtime/view/agent/agent.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initAgents()">\n	<div class="col-md-12">\n		<!-- START TABLE -->\n		<div ui-grid="gridOptions"  ui-grid-resize-columns  class="ui-grid" ui-grid-tree-view ui-grid-expandable-row ui-grid-pagination auto-resize>\n			<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n		</div>\n		<!-- END TABLE -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/voice/realtime/view/agent/agent.modal.info.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_INTERFACE_INFO\' | translate }}</h3>\n</div>\n<div class="modal-body">\n<div data-ng-if="agent.ipaddr" class="well">\n  <div>{{agent.ipaddr}}:{{agent.port}}</div>\n  <div>{{agent.fullcontact}}</div>\n  <div>{{agent.useragent}}</div>\n  <div>{{agent.lastms}}</div>\n</div>\n<div data-ng-if="!agent.ipaddr" class="alert alert-danger" role="alert">\n  {{\'MESSAGE_NO_AVAILABLE_INFO\' | translate}}\n</div>\n</div>\n<div class="modal-footer">\n  <button class="btn default" type="button" ng-click="close()">{{ \'APPLICATION_CLOSE\' | translate }}</button>\n</div>\n'),a.put("app/channels/voice/realtime/view/agent/queue.modal.add.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_JOIN_QUEUE\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n\n    <div class="form-group row">\n  <label class="col-md-2 control-label" style="margin-top: 7px;">{{\'APPLICATION_QUEUE\' | translate}}:</label>\n  <div class="col-md-10">\n    <ui-select multiple ng-model="item.queues" theme="bootstrap" required>\n      <ui-select-match placeholder="{{\'APPLICATION_QUEUE\' | translate}}">{{$item.name}}</ui-select-match>\n      <ui-select-choices repeat="queue.name as queue in queues | filter: $select.search">\n        <div ng-bind-html="queue.name | highlight: $select.search"></div>\n      </ui-select-choices>\n    </ui-select>\n  </div>\n</div>\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="save()" ng-disabled="form.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/channels/voice/realtime/view/areport/report.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initReport()">\n	<div class="col-md-12">\n		<!-- START TABLE -->\n		<table st-table="displayedAgents" st-safe-src="agents" class="table table-striped table-bordered table-hover">\n			<div class="table-responsive">\n			  <thead>\n					<tr>\n						<th colspan="11">\n							<div class="row">\n								<div class="col-md-6">\n									<ui-select class="input-xsmall" ng-model="conf.agentsByPage" theme="bootstrap" ng-disabled="disabled">\n										<ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n										<ui-select-choices repeat="agentByPage in agentsByPage | filter: $select.search">\n											<div ng-bind-html="agentByPage.name | highlight: $select.search"></div>\n										</ui-select-choices>\n									</ui-select>\n								</div>\n								<div class="col-md-6">\n									<div class="input-group input-medium pull-right">\n										<input st-search placeholder="{{ \'APPLICATION_SEARCH\' | translate }}" class="form-control" type="search" />\n										<span class="input-group-addon">\n											<i class="fa fa-search"></i>\n										</span>\n									</div>\n								</div>\n							</div>\n						</th>\n					</tr>\n				  <tr>\n						<th></th>\n						<th st-sort="uniqueid">{{ \'APPLICATION_UNIQUEID\' | translate }}</th>\n				    <th st-sort="queue">{{ \'APPLICATION_QUEUE\' | translate }}</th>\n				    <th st-sort="membername">{{ \'APPLICATION_AGENT\' | translate }}</th>\n						<th st-sort="calleridname">{{ \'APPLICATION_CALLER\' | translate }}</th>\n						<th st-sort="agentcalledAt">{{ \'APPLICATION_CALLED_AT\' | translate }}</th>\n						<th st-sort="agentconnectAt">{{ \'APPLICATION_CONNECTED_AT\' | translate }}</th>\n						<th st-sort="agentcompleteAt">{{ \'APPLICATION_COMPLETED_AT\' | translate }}</th>\n						<th st-sort="reason">{{ \'APPLICATION_REASON\' | translate }}</th>\n						<th st-sort="holdtime">{{ \'APPLICATION_HOLDTIME\' | translate }}</th>\n				    <th st-sort="talktime">{{ \'APPLICATION_TALKTIME\' | translate }}</th>\n				  </tr>\n			  </thead>\n			  <tbody>\n			    <tr data-ng-repeat="agent in displayedAgents">\n						<td><span data-ng-class="{\'icon-call-in font-yellow\': agent.lastevent === \'called\',\n							\'icon-phone font-blue\': agent.lastevent === \'connect\',\n							\'icon-call-end font-green\': agent.lastevent === \'complete\',\n							\'icon-call-end font-red\': agent.lastevent === \'answered_elsewhere\'}"></span>\n						</td>\n						<td>{{agent.uniqueid}}</td>\n						<td>{{agent.queue}}</td>\n						<td>{{agent.destcalleridname ? agent.destcalleridname + \' [\' + agent.membername + \']\' : agent.membername }}</td>\n						<td>{{agent.calleridname ? agent.calleridname + \' [\' + agent.calleridnum + \']\' : agent.calleridnum }}</td>\n						<td>\n							<time is="relative-time" datetime="{{agent.agentcalledAt}}">\n								April 1, 2014\n							</time>\n						</td>\n						<td>\n							<time is="relative-time" datetime="{{agent.agentconnectAt}}" data-ng-show="agent.agentconnectAt">\n								April 1, 2014\n							</time>\n						</td>\n						<td>\n							<time is="relative-time" datetime="{{agent.agentcompleteAt}}" data-ng-show="agent.agentcompleteAt">\n								April 1, 2014\n							</time>\n						</td>\n						<td>\n							{{agent.reason | uppercase}}\n						</td>\n						<td>{{agent.holdtime || 0 | VoiceRealtimeViewAgentReportFilter | date:\'HH:mm:ss\'}}</td>\n			      <td>{{agent.talktime || 0 | VoiceRealtimeViewAgentReportFilter | date:\'HH:mm:ss\'}}</td>\n			    </tr>\n					<tr data-ng-hide="displayedAgents.length">\n						<td colspan="11" style="text-align:center;">\n							<i>No agents available</i>\n						</td>\n					</tr>\n			  </tbody>\n			  <tfoot>\n					<tr>\n						<td/>\n						<td>\n							<div class="input-icon right">\n								<i class="fa fa-search"></i>\n								<input st-search="uniqueid" data-ng-model="filters.uniqueid" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_UNIQUEID\' | translate | lowercase}}" class="form-control" type="search"/>\n							</div>\n				    </td>\n				    <td>\n							<div class="input-icon right">\n								<i class="fa fa-search"></i>\n								<input st-search="queue" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_QUEUE\' | translate | lowercase}}" class="form-control" type="search"/>\n							</div>\n				    </td>\n				    <td>\n							<div class="input-icon right">\n								<i class="fa fa-search"></i>\n								<input st-search="membername" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_AGENT\' | translate | lowercase}}" class="form-control" type="search"/>\n							</div>\n				    </td>\n				    <td>\n							<div class="input-icon right">\n								<i class="fa fa-search"></i>\n								<input st-search="calleridnum" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_CALLER\' | translate | lowercase}}" class="form-control" type="search"/>\n							</div>\n				    </td>\n						<td colspan="7"></td>\n				  </tr>\n			    <tr>\n			      <td colspan="11" class="text-center">\n							<div class="pagination" st-pagination st-items-by-page="conf.agentsByPage.value" st-displayed-pages="7"></div>\n			      </td>\n			    </tr>\n			  </tfoot>\n			</div>\n		</table>\n		<!-- END TABLE -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/voice/realtime/view/qreport/report.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initReport()">\n	<div class="col-md-12">\n		<!-- START TABLE -->\n		<table st-table="displayedQueues" st-safe-src="queues" class="table table-striped table-bordered table-hover">\n			<div class="table-responsive">\n			  <thead>\n					<tr>\n						<th colspan="10">\n							<div class="row">\n								<div class="col-md-6">\n									<ui-select class="input-xsmall" ng-model="conf.queuesByPage" theme="bootstrap" ng-disabled="disabled">\n										<ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n										<ui-select-choices repeat="queueByPage in queuesByPage | filter: $select.search">\n											<div ng-bind-html="queueByPage.name | highlight: $select.search"></div>\n										</ui-select-choices>\n									</ui-select>\n								</div>\n								<div class="col-md-6">\n									<div class="input-group input-medium pull-right">\n										<input st-search placeholder="{{ \'APPLICATION_SEARCH\' | translate }}" class="form-control" type="search"/>\n										<span class="input-group-addon">\n											<i class="fa fa-search"></i>\n										</span>\n									</div>\n								</div>\n							</div>\n						</th>\n					</tr>\n				  <tr>\n						<th></th>\n						<th st-sort="uniqueid">{{ \'APPLICATION_UNIQUEID\' | translate }}</th>\n				    <th st-sort="queue">{{ \'APPLICATION_QUEUE\' | translate }}</th>\n				    <th st-sort="membername">{{ \'APPLICATION_AGENT\' | translate }}</th>\n						<th st-sort="calleridname">{{ \'APPLICATION_CALLER\' | translate }}</th>\n						<th st-sort="queuecallerjoinAt">{{ \'APPLICATION_CALLED_AT\' | translate }}</th>\n						<th st-sort="queuecallerleaveAt">{{ \'APPLICATION_CONNECTED_AT\' | translate }}</th>\n						<th st-sort="queuecallerabandonAt">{{ \'APPLICATION_ABANDONED_AT\' | translate }}</th>\n				  </tr>\n			  </thead>\n			  <tbody>\n			    <tr data-ng-repeat="queue in displayedQueues">\n						<td><span data-ng-class="{\'icon-call-in font-yellow\': queue.queuecallerjoinAt && !queue.queuecallerleaveAt,\n							\'icon-phone font-blue\': queue.queuecallerjoinAt && queue.queuecallerleaveAt,\n							\'icon-call-end font-red\': queue.queuecallerjoinAt && queue.queuecallerleaveAt && queue.queuecallerabandonAt}"></span>\n						</td>\n						<td>{{queue.uniqueid}}</td>\n						<td>{{queue.queue}}</td>\n						<td>{{queue.connectedlinename ? queue.connectedlinename + \' [\' + queue.connectedlinenum + \']\' : queue.connectedlinenum }}</td>\n						<td>{{queue.calleridname ? queue.calleridname + \' [\' + queue.calleridnum + \']\' : queue.calleridnum }}</td>\n						<td>\n							<time is="relative-time" datetime="{{queue.queuecallerjoinAt}}">\n								April 1, 2014\n							</time>\n						</td>\n						<td>\n							<time is="relative-time" datetime="{{queue.queuecallerleaveAt}}" data-ng-show="queue.queuecallerleaveAt">\n								April 1, 2014\n							</time>\n						</td>\n						<td>\n							<time is="relative-time" datetime="{{queue.queuecallerabandonAt}}" data-ng-show="queue.queuecallerabandonAt">\n								April 1, 2014\n							</time>\n						</td>\n			    </tr>\n					<tr data-ng-hide="displayedQueues.length">\n						<td colspan="10" style="text-align:center;">\n							<i>No queues available</i>\n						</td>\n					</tr>\n			  </tbody>\n			  <tfoot>\n					<tr>\n						<td/>\n				    <td>\n							<div class="input-icon right">\n								<i class="fa fa-search"></i>\n								<input st-search="uniqueid" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_UNIQUEID\' | translate | lowercase}}" class="form-control" type="search"/>\n							</div>\n				    </td>\n						<td>\n							<div class="input-icon right">\n								<i class="fa fa-search"></i>\n								<input st-search="queue" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_QUEUE\' | translate | lowercase}}" class="form-control" type="search"/>\n							</div>\n				    </td>\n				    <td>\n							<div class="input-icon right">\n								<i class="fa fa-search"></i>\n								<input st-search="connectedlinename" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_AGENT\' | translate | lowercase}}" class="form-control" type="search"/>\n							</div>\n				    </td>\n				    <td>\n							<div class="input-icon right">\n								<i class="fa fa-search"></i>\n								<input st-search="calleridnum" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_CALLER\' | translate | lowercase}}" class="form-control" type="search"/>\n							</div>\n				    </td>\n						<td colspan="6"></td>\n				  </tr>\n			    <tr>\n			      <td colspan="10" class="text-center">\n							<div class="pagination" st-pagination st-items-by-page="conf.queuesByPage.value" st-displayed-pages="7"></div>\n			      </td>\n			    </tr>\n			  </tfoot>\n			</div>\n		</table>\n		<!-- END TABLE -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/voice/realtime/view/queue/pause.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_PAUSE_SELECTION\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <div class="panel panel-info">\n		<!-- Default panel contents -->\n		<div class="panel-heading">\n			<h3 class="panel-title"><span class="icon-doc"></span> Summary</h3>\n		</div>\n		<!-- List group -->\n		<ul class="list-group">\n      <li class="list-group-item">\n				 {{ \'APPLICATION_QUEUE\' | translate }}: <b class="pull-right">{{ selected.queue }}</b>\n			</li>\n      <li class="list-group-item" data-ng-hide="data.length">\n				 {{ \'APPLICATION_AGENT\' | translate }}: <b class="pull-right">{{ selected.membername }}</b>\n			</li>\n      <li class="list-group-item">\n        <div class="btn-group">\n          <ui-select ng-model="selected.item" theme="bootstrap" ng-disabled="disabled" class="btn input-xlarge pull-left">\n            <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected}}</ui-select-match>\n            <ui-select-choices repeat="item in items | filter: $select.search">\n              <div ng-bind-html="item | highlight: $select.search"></div>\n            </ui-select-choices>\n          </ui-select>\n          <button class="btn btn-success pull-right" type="button" ng-click="ok(true)" style="margin-top: 7px;">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n        </div>\n			</li>\n		</ul>\n	</div>\n  <button data-ng-show="(data | isArray) ? (data | where: {paused: true}).length : data.paused " class="btn btn-danger btn-block" type="button" ng-click="ok(false, data.queue)">Exit</button>\n</div>\n<div class="modal-footer">\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/channels/voice/realtime/view/queue/queue.add.modal.html",'<div class="modal-header" data-ng-init="initAdd()">\n  <h3 class="modal-title">{{ \'APPLICATION_QUEUE_SELECTION\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <div class="panel panel-info">\n		<!-- Default panel contents -->\n		<div class="panel-heading">\n			<h3 class="panel-title"><span class="icon-doc"></span> Summary</h3>\n		</div>\n		<!-- List group -->\n		<ul class="list-group">\n      <li class="list-group-item">\n        <div class="form-group row">\n					<label class="col-md-2 control-label" style="margin-top: 7px;">{{\'APPLICATION_AGENT\' | translate}}:</label>\n					<div class="col-md-10">\n            <input type="text" placeholder="{{\'APPLICATION_AGENT\' | translate}}" class="form-control" data-ng-model="selected.membername" ng-disabled="true"/>\n					</div>\n				</div>\n      </li>\n      <li class="list-group-item" data-ng-show="queues.length">\n        <div class="form-group row">\n					<label class="col-md-2 control-label" style="margin-top: 7px;">{{\'APPLICATION_QUEUE\' | translate}}:</label>\n					<div class="col-md-10">\n            <ui-select ng-model="selected.queue" theme="bootstrap" ng-disabled="disabled">\n              <ui-select-match placeholder="{{\'APPLICATION_QUEUE\' | translate}}">{{$select.selected.name}}</ui-select-match>\n              <ui-select-choices repeat="queue.name as queue in queues | filter: $select.search">\n                <div ng-bind-html="queue.name | highlight: $select.search"></div>\n              </ui-select-choices>\n            </ui-select>\n					</div>\n				</div>\n			</li>\n      <li class="list-group-item">\n        <div class="form-group row">\n					<label class="col-md-2 control-label" style="margin-top: 7px;">{{\'APPLICATION_PENALTY\' | translate}}:</label>\n					<div class="col-md-10">\n            <input type="number" min="0" max="10" placeholder="{{\'APPLICATION_PENALTY\' | translate}}" class="form-control" data-ng-model="selected.penalty"/>\n					</div>\n				</div>\n			</li>\n      <li class="list-group-item">\n        <div class="form-group row">\n					<label class="col-md-2 control-label" style="margin-top: 7px;">{{\'APPLICATION_PAUSE\' | translate}}:</label>\n					<div class="col-md-10">\n            <button type="button" class="btn btn-default form-control" data-ng-model="selected.paused" ui-btn-checkbox> {{ selected.paused ? \'APPLICATION_YES\' : \'APPLICATION_NO\' | translate }} </button>\n					</div>\n				</div>\n      </li>\n      <li class="list-group-item" data-ng-show="selected.paused">\n        <div class="form-group row">\n					<label class="col-md-2 control-label" style="margin-top: 7px;">{{\'APPLICATION_REASON\' | translate}}:</label>\n					<div class="col-md-10">\n            <ui-select ng-model="selected.reason" theme="bootstrap" ng-disabled="disabled">\n              <ui-select-match placeholder="{{\'APPLICATION_REASON\' | translate}}">{{$select.selected}}</ui-select-match>\n              <ui-select-choices repeat="pause in pauses | filter: $select.search">\n                <div ng-bind-html="pause | highlight: $select.search"></div>\n              </ui-select-choices>\n            </ui-select>\n					</div>\n				</div>\n			</li>\n      <li class="list-group-item">\n        <div class="form-group row">\n					<label class="col-md-2 control-label" style="margin-top: 7px;">{{\'APPLICATION_LOGIN\' | translate}}:</label>\n					<div class="col-md-10">\n            <button type="button" class="btn btn-default form-control" data-ng-model="selected.login" ui-btn-checkbox> {{ selected.login ? \'APPLICATION_YES\' : \'APPLICATION_NO\' | translate }} </button>\n					</div>\n				</div>\n      </li>\n		</ul>\n	</div>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="okAdd()">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/channels/voice/realtime/view/queue/queue.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initQueues()">\n	<div class="col-md-12">\n	 <div ng-show="selected">Selection from a modal: {{ selected }}</div>\n		<!-- BEGIN TABLE -->\n			<table st-table="displayedGroups" st-safe-src="groups" class="table table-striped table-bordered table-hover">\n				<div class="table-responsive">\n				  <thead>\n						<tr>\n							<th colspan="10">\n								<div class="row">\n									<div class="col-md-6">\n										<ui-select class="input-xsmall" ng-model="conf.agentsByPage" theme="bootstrap" ng-disabled="disabled">\n											<ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n											<ui-select-choices repeat="agentByPage in agentsByPage | filter: $select.search">\n												<div ng-bind-html="agentByPage.name | highlight: $select.search"></div>\n											</ui-select-choices>\n										</ui-select>\n									</div>\n									<div class="col-md-6">\n										<!-- <div class="input-group input-medium pull-right">\n											<input st-search placeholder="{{ \'APPLICATION_SEARCH\' | translate }}" class="form-control" type="search" />\n											<span class="input-group-addon">\n												<i class="fa fa-search"></i>\n											</span>\n										</div> -->\n									</div>\n								</div>\n							</th>\n						</tr>\n						<tr>\n							<th st-sort="memebername" colspan="3">{{ \'APPLICATION_QUEUE\' | translate }}</th>\n					    <th st-sort="agent">{{ \'APPLICATION_AGENT\' | translate }}</th>\n							<th>{{ \'APPLICATION_LAST_LOGIN\' | translate }}</th>\n							<th>{{ \'APPLICATION_LAST_PAUSE\' | translate }}</th>\n							<th>{{ \'APPLICATION_LAST_INCOMING_CALL\' | translate }}</th>\n							<th>{{ \'APPLICATION_SERVED\' | translate }}</th>\n							<th colspan="2"></th>\n					  </tr>\n				  </thead>\n					<tbody>\n				    <tr data-ng-repeat-start="group in displayedGroups">\n							<td rowspan="{{group.agents.length}}" align="center" style="vertical-align:middle">{{group.queue}}</td>\n							<td data-ng-repeat="agent in group.agents" data-ng-if="$first" align="center">\n								<span data-ng-class="{\'icon-like font-green\': agent.lastevent != \'called\' && agent.lastevent != \'connect\' ,\'icon-bell font-yellow\': agent.lastevent == \'called\', \'icon-call-in font-red\': agent.lastevent == \'connect\'}"></span>\n							</td>\n							<td data-ng-repeat="agent in group.agents" data-ng-if="$first" align="center">\n								<span class="icon-cup" data-ng-class="agent.paused ? \'font-red\' : \'font-green\'"></span>\n							</td>\n							<td data-ng-repeat="agent in group.agents" data-ng-if="$first" align="center">\n								{{agent.membername}}\n							</td>\n							<td data-ng-repeat="agent in group.agents" data-ng-if="$first" align="center">\n								<time is="relative-time" datetime="{{agent.loggedAt}}" data-ng-show="agent.logged">\n									April 1, 2014\n								</time>\n								 <span class="badge badge-empty badge-danger" data-ng-show="!agent.logged"></span>\n							</td>\n							<td data-ng-repeat="agent in group.agents" data-ng-if="$first" align="center">\n								<time is="relative-time" datetime="{{agent.pausedAt}}" data-ng-show="agent.pausedAt">\n									April 1, 2014\n								</time>\n								<span> <strong>{{agent.paused ? \'(\' + agent.reason + \')\' : \'\'}}</strong></span>\n							</td>\n							<td data-ng-repeat="agent in group.agents" data-ng-if="$first" align="center">\n								<time is="relative-time" datetime="{{agent.lastcall}}" data-ng-show="agent.lastcall">\n									April 1, 2014\n								</time>\n							</td>\n							<td data-ng-repeat="agent in group.agents" data-ng-if="$first" align="center">\n								{{agent.callstaken}}\n							</td>\n							<td data-ng-repeat="agent in group.agents" data-ng-if="$first" align="center">\n								<span data-ng-show="agent.logged" class="icon-cup pull-left" style="cursor:pointer;" data-ng-click="pause(null, agent)"> </span>\n								<span class="icon-close font-red pull-right" style="cursor:pointer;" data-ng-click="remove(null, agent)"> </span>\n							</td>\n							<td rowspan="{{group.agents.length}}" align="center" style="vertical-align:middle">\n								<span data-ng-show="group.agents.length > 1" class="icon-cup pull-left" style="cursor:pointer;" data-ng-click="pause(null, group.agents)"> </span>\n								<span class="icon-plus font-green" style="cursor:pointer;" data-ng-click="add(null, group.agents)"> </span>\n								<span data-ng-show="group.agents.length > 1" class="icon-close font-red pull-right" style="cursor:pointer;" data-ng-click="remove(null, group.agents)"></span>\n							</td>\n				    </tr>\n						<tr data-ng-repeat="agent in group.agents" data-ng-if="$middle">\n							<td align="center">\n								<span data-ng-class="{\'icon-like font-green\': agent.lastevent != \'called\' && agent.lastevent != \'connect\' ,\'icon-bell font-yellow\': agent.lastevent == \'called\', \'icon-call-in font-red\': agent.lastevent == \'connect\'}"></span>\n							</td>\n							<td align="center">\n								<span class="icon-cup" data-ng-class="agent.paused ? \'font-red\' : \'font-green\'"></span>\n							</td>\n							<td align="center">\n								{{agent.membername}}\n							</td>\n							<td align="center">\n								<time is="relative-time" datetime="{{agent.loggedAt}}" data-ng-show="agent.logged">\n									April 1, 2014\n								</time>\n								<span class="badge badge-empty badge-danger" data-ng-show="!agent.logged"></span>\n							</td>\n							<td align="center">\n								<time is="relative-time" datetime="{{agent.pausedAt}}" data-ng-show="agent.pausedAt">\n									April 1, 2014\n								</time>\n								<span> <strong>{{agent.paused ? \'(\' + agent.reason + \')\' : \'\'}}</strong></span>\n							</td>\n							<td align="center">\n								<time is="relative-time" datetime="{{agent.lastcall}}" data-ng-show="agent.lastcall">\n									April 1, 2014\n								</time>\n							</td>\n							<td align="center">\n								{{agent.callstaken}}\n							</td>\n							<td align="center">\n								<span data-ng-show="agent.logged" class="icon-cup pull-left" style="cursor:pointer;" data-ng-click="pause(null, agent)"> </span>\n								<span class="icon-close font-red pull-right" style="cursor:pointer;" data-ng-click="remove(null, agent)"> </span>\n							</td>\n						</tr>\n						<tr data-ng-repeat="agent in group.agents" data-ng-if="group.agents.length > 1 && $last" data-ng-repeat-end>\n							<td align="center">\n								<span data-ng-class="{\'icon-like font-green\': agent.lastevent != \'called\' && agent.lastevent != \'connect\' ,\'icon-bell font-yellow\': agent.lastevent == \'called\', \'icon-call-in font-red\': agent.lastevent == \'connect\'}"></span>\n							</td>\n							<td align="center">\n								<span class="icon-cup" data-ng-class="agent.paused ? \'font-red\': \'font-green\'"></span>\n							</td>\n							<td align="center">\n								{{agent.membername}}\n							</td>\n							<td align="center">\n								<time is="relative-time" datetime="{{agent.loggedAt}}" data-ng-show="agent.logged">\n									April 1, 2014\n								</time>\n								<span class="badge badge-empty badge-danger" data-ng-show="!agent.logged"></span>\n							</td>\n							<td align="center">\n								<time is="relative-time" datetime="{{agent.pausedAt}}" data-ng-show="agent.pausedAt">\n									April 1, 2014\n								</time>\n								<span> <strong>{{agent.paused ? \'(\' + agent.reason + \')\' : \'\'}}</strong></span>\n							</td>\n							<td align="center">\n								<time is="relative-time" datetime="{{agent.lastcall}}" data-ng-show="agent.lastcall">\n									April 1, 2014\n								</time>\n							</td>\n							<td align="center">\n								{{agent.callstaken}}\n							</td>\n							<td align="center">\n								<span data-ng-show="agent.logged" class="icon-cup pull-left" style="cursor:pointer;" data-ng-click="pause(null, agent)"> </span>\n								<span class="icon-close font-red pull-right" style="cursor:pointer;" data-ng-click="remove(null, agent)"> </span>\n							</td>\n						</tr>\n						<tr data-ng-hide="displayedGroups.length">\n							<td colspan="9" style="text-align:center;">\n								<i>No agents available</i>\n							</td>\n						</tr>\n				  </tbody>\n				  <tfoot>\n						<tr>\n							<td colspan="1">\n								<div class="input-icon right">\n									<i class="fa fa-search"></i>\n									<input st-search="queue" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_QUEUE\' | translate | lowercase}}" class="form-control" type="search"/>\n								</div>\n							<td colspan="9"></td>\n					  </tr>\n				    <tr>\n				      <td colspan="10" class="text-center">\n								<div class="pagination" st-pagination st-items-by-page="conf.agentsByPage.value" st-displayed-pages="7"></div>\n				      </td>\n				    </tr>\n				  </tfoot>\n				</div>\n			</table>\n		<!-- END TABLE -->\n	</div>\n\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/voice/realtime/view/queue/queue.modal.add.html",'<div class="modal-header" data-ng-init="initAdd()">\n  <h3 class="modal-title">{{ \'APPLICATION_QUEUE_SELECTION\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <div class="panel panel-info" data-ng-show="selected.queue">\n		<!-- Default panel contents -->\n		<div class="panel-heading">\n			<h3 class="panel-title"><span class="icon-doc"></span> Summary</h3>\n		</div>\n		<!-- List group -->\n		<ul class="list-group">\n      <li class="list-group-item">\n        <div class="form-group row">\n					<label class="col-md-2 control-label" style="margin-top: 7px;">{{\'APPLICATION_QUEUE\' | translate}}:</label>\n					<div class="col-md-10">\n            <input type="text" placeholder="{{\'APPLICATION_QUEUE\' | translate}}" class="form-control" data-ng-model="selected.queue" ng-disabled="true"/>\n					</div>\n				</div>\n      </li>\n      <li class="list-group-item" data-ng-show="agents.length">\n        <div class="form-group row">\n					<label class="col-md-2 control-label" style="margin-top: 7px;">{{\'APPLICATION_AGENT\' | translate}}:</label>\n					<div class="col-md-10">\n            <ui-select ng-model="selected.agent" theme="bootstrap" ng-disabled="disabled">\n              <ui-select-match placeholder="{{\'APPLICATION_AGENT\' | translate}}">{{$select.selected.name}}</ui-select-match>\n              <ui-select-choices repeat="{name: agent.name, id: agent.id} as agent in agents | filter: $select.search">\n                <div ng-bind-html="agent.name | highlight: $select.search"></div>\n              </ui-select-choices>\n            </ui-select>\n					</div>\n				</div>\n			</li>\n      <li class="list-group-item">\n        <div class="form-group row">\n					<label class="col-md-2 control-label" style="margin-top: 7px;">{{\'APPLICATION_PENALTY\' | translate}}:</label>\n					<div class="col-md-10">\n            <input type="number" min="0" max="10" placeholder="{{\'APPLICATION_PENALTY\' | translate}}" class="form-control" data-ng-model="selected.penalty"/>\n					</div>\n				</div>\n			</li>\n      <li class="list-group-item">\n        <div class="form-group row">\n					<label class="col-md-2 control-label" style="margin-top: 7px;">{{\'APPLICATION_PAUSE\' | translate}}:</label>\n					<div class="col-md-10">\n            <button type="button" class="btn btn-default form-control" data-ng-model="selected.paused" btn-checkbox> {{ selected.paused ? \'APPLICATION_YES\' : \'APPLICATION_NO\' | translate }} </button>\n					</div>\n				</div>\n      </li>\n      <li class="list-group-item" data-ng-show="selected.paused">\n        <div class="form-group row">\n					<label class="col-md-2 control-label" style="margin-top: 7px;">{{\'APPLICATION_REASON\' | translate}}:</label>\n					<div class="col-md-10">\n            <ui-select ng-model="selected.reason" theme="bootstrap" ng-disabled="disabled">\n              <ui-select-match placeholder="{{\'APPLICATION_REASON\' | translate}}">{{$select.selected}}</ui-select-match>\n              <ui-select-choices repeat="pause in pauses | filter: $select.search">\n                <div ng-bind-html="pause | highlight: $select.search"></div>\n              </ui-select-choices>\n            </ui-select>\n					</div>\n				</div>\n			</li>\n      <li class="list-group-item">\n        <div class="form-group row">\n					<label class="col-md-2 control-label" style="margin-top: 7px;">{{\'APPLICATION_LOGIN\' | translate}}:</label>\n					<div class="col-md-10">\n            <button type="button" class="btn btn-default form-control" data-ng-model="selected.login" btn-checkbox> {{ selected.login ? \'APPLICATION_YES\' : \'APPLICATION_NO\' | translate }} </button>\n					</div>\n				</div>\n      </li>\n		</ul>\n    <!-- End List group -->\n  </div>\n  <div class="note note-warning" data-ng-hide="selected.queue">\n    <h4 class="block">Warning!</h4>\n    <p>\n       {{ \'MESSAGE_NO_QUEUES_AVAILABLE\' | translate }}\n    </p>\n  </div>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="okAdd()" data-ng-show="selected.queue">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),
+a.put("app/channels/voice/realtime/view/queue/queue.modal.remove.html",'<div class="modal-header" data-ng-init="initRemove()">\n  <h3 class="modal-title">{{ \'APPLICATION_QUEUE_REMOVAL\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <div class="panel panel-info">\n		<!-- Default panel contents -->\n		<div class="panel-heading">\n			<h3 class="panel-title"><span class="icon-doc"></span> Summary</h3>\n		</div>\n		<!-- List group -->\n		<ul class="list-group">\n      <li class="list-group-item">\n        <div class="form-group row" data-ng-hide="data.length">\n					<label class="col-md-2 control-label" style="margin-top: 7px;">{{\'APPLICATION_AGENT\' | translate}}:</label>\n					<div class="col-md-10">\n            <input type="text" placeholder="{{\'APPLICATION_AGENT\' | translate}}" class="form-control" data-ng-model="selected.membername" ng-disabled="true"/>\n					</div>\n				</div>\n      </li>\n      <li class="list-group-item">\n        <div class="form-group row">\n					<label class="col-md-2 control-label" style="margin-top: 7px;">{{\'APPLICATION_QUEUE\' | translate}}:</label>\n					<div class="col-md-10">\n            <input type="text" placeholder="{{\'APPLICATION_QUEUE\' | translate}}" class="form-control" data-ng-model="selected.queue" ng-disabled="true"/>\n					</div>\n				</div>\n      </li>\n      <li class="list-group-item">\n        <div class="form-group row">\n					<label class="col-md-2 control-label" style="margin-top: 7px;">{{\'APPLICATION_LOGOUT\' | translate}}:</label>\n					<div class="col-md-10">\n            <button type="button" class="btn btn-default form-control" data-ng-model="selected.logout" btn-checkbox> {{ selected.logout ? \'APPLICATION_YES\' : \'APPLICATION_NO\' | translate }} </button>\n            <span class="help-block">{{ \'MESSAGE_PERMANENT_REMOVAL_FROM_QUEUE\' | translate }}. </span>\n          </div>\n				</div>\n      </li>\n		</ul>\n	</div>\n  <button class="btn btn-danger btn-block" type="button" ng-click="okRemove()">{{ \'APPLICATION_REMOVE\' | translate }}</button>\n</div>\n<div class="modal-footer">\n  <!-- <button class="btn btn-success" type="button" ng-click="okRemove()">{{ \'APPLICATION_CONFIRM\' | translate }}</button> -->\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/channels/voice/realtime/view/queue/queue.remove.modal.html",'<div class="modal-header" data-ng-init="initRemove()">\n  <h3 class="modal-title">{{ \'APPLICATION_QUEUE_REMOVAL\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <div class="panel panel-info">\n		<!-- Default panel contents -->\n		<div class="panel-heading">\n			<h3 class="panel-title"><span class="icon-doc"></span> Summary</h3>\n		</div>\n		<!-- List group -->\n		<ul class="list-group">\n      <li class="list-group-item">\n        <div class="form-group row">\n					<label class="col-md-2 control-label" style="margin-top: 7px;">{{\'APPLICATION_AGENT\' | translate}}:</label>\n					<div class="col-md-10">\n            <input type="text" placeholder="{{\'APPLICATION_AGENT\' | translate}}" class="form-control" data-ng-model="selected.membername" ng-disabled="true"/>\n					</div>\n				</div>\n      </li>\n      <li class="list-group-item" data-ng-hide="data.length">\n        <div class="form-group row">\n					<label class="col-md-2 control-label" style="margin-top: 7px;">{{\'APPLICATION_QUEUE\' | translate}}:</label>\n					<div class="col-md-10">\n            <input type="text" placeholder="{{\'APPLICATION_QUEUE\' | translate}}" class="form-control" data-ng-model="selected.queue" ng-disabled="true"/>\n					</div>\n				</div>\n      </li>\n      <li class="list-group-item">\n        <div class="form-group row">\n					<label class="col-md-2 control-label" style="margin-top: 7px;">{{\'APPLICATION_LOGOUT\' | translate}}:</label>\n					<div class="col-md-10">\n            <button type="button" class="btn btn-default form-control" data-ng-model="selected.logout" btn-checkbox> {{ selected.logout ? \'APPLICATION_YES\' : \'APPLICATION_NO\' | translate }} </button>\n            <span class="help-block">{{ \'MESSAGE_PERMANENT_REMOVAL_FROM_QUEUE\' | translate }}. </span>\n          </div>\n				</div>\n      </li>\n		</ul>\n	</div>\n  <button class="btn btn-danger btn-block" type="button" ng-click="okRemove()">{{ \'APPLICATION_REMOVE\' | translate }}</button>\n</div>\n<div class="modal-footer">\n  <!-- <button class="btn btn-success" type="button" ng-click="okRemove()">{{ \'APPLICATION_CONFIRM\' | translate }}</button> -->\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/channels/voice/realtime/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-directions"></i>\n					<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-earphones-alt"></i>\n					<a href="#">{{ \'APPLICATION_VOICE\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-energy"></i>\n					<a href="/channels/voice/realtime/view/agents">{{ \'APPLICATION_REALTIME\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<div>\n		    <nav class="navbar navbar-default" role="navigation">\n					<div class="collapse navbar-collapse">\n						<ul class="nav navbar-nav">\n							<li data-ng-class="{\'active\': $state.is(\'main.channels.voice.realtime.view.agents\')}">\n								<a href="/channels/voice/realtime/view/agents">\n									{{\'APPLICATION_AGENTS\' | translate}}\n								</a>\n							</li>\n						</ul>\n					</div>\n		    </nav>\n		</div>\n		<div ui-view></div>\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/voice/recording/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-puzzle"></i>\n					<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-control-play"></i>\n					<a href="#">{{ \'APPLICATION_RECORDINGS\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-control-play font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_RECORDINGS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/voice/route/inbound/list/create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_ROUTE\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="forms.extension" novalidate>\n\n    <!-- START EXTEN -->\n    <div class="form-group" data-ng-class="{\'has-error\': (forms.extension.exten.$touched || forms.extension.$submitted) && forms.extension.exten.$invalid || existRoute}">\n      <label class="control-label">{{\'APPLICATION_PHONE_NUMBER\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="exten" placeholder="{{\'APPLICATION_PHONE_NUMBER\' | translate}}" class="form-control" data-ng-model="item.exten" data-ng-pattern="settings.patternName" required/>\n      <span data-ng-show="(forms.extension.exten.$touched || forms.extension.$submitted) && forms.extension.exten.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END EXTEN -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n    </div>\n    <!-- END DESCRIPTION -->\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="ok()" ng-disabled="forms.extension.$invalid || existRoute">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n<!-- <pre>\n  {{item | json}}\n</pre> -->\n'),a.put("app/channels/voice/route/inbound/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-puzzle"></i>\n					<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-earphones-alt"></i>\n					<a href="#">{{ \'APPLICATION_VOICE\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-call-in"></i>\n					<a href="/channels/voice/routes/inbound/list">{{ \'APPLICATION_INBOUND\' | translate }} {{ \'APPLICATION_ROUTES\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-users font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_INBOUND\' | translate }} {{ \'APPLICATION_ROUTES\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<a class="btn green-jungle " href="#" data-ng-click="create()">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_ROUTE\' | translate }}\n						</a>\n					</div>\n					<!-- <a class="btn btn-icon-only btn-default fullscreen" href="#"></a> -->\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter class="ui-grid" ui-grid-draggable-rows>\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/voice/route/inbound/view/view.applications.html",'<div ui-view class="profile-content">\n<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title  tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_ACTIONS\' | translate}}</span>\n				</div>\n				<div class="actions">\n					<div class="btn-group">\n						<a class="btn green-jungle " href="/channels/voice/routes/inbound/view/{{route.id}}/application" data-toggle="dropdown">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_APPLICATION\' | translate }}\n						</a>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div data-ng-if="selectedApp === undefined" ui-grid="gridOptions"  ui-grid-resize-columns class="grid" ui-grid-draggable-rows ui-grid-auto-resize>\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n	</div>\n</div>\n</div>\n'),a.put("app/channels/voice/route/inbound/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getRoute()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-reload"></i>\n					<a href="/channels/voice/routes/inbound/list">{{ \'APPLICATION_INBOUND\' | translate }} {{ \'APPLICATION_ROUTES\' | translate }}</a>\n					<i data-ng-show="route" class="fa fa-angle-right"></i>\n				</li>\n				<li data-ng-show="route">\n					<a href="#">{{route.exten}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/inboundroute.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{route.exten}}\n					</div>\n					<!-- <div class="profile-usertitle-job">\n						{{user.role}}\n					</div> -->\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.channels.voice.routes.inbound.view.settings\')}">\n							<a data-ng-click="deselectAndRedirect(\'/channels/voice/routes/inbound/view/\'+route.id+\'/settings\')">\n							<i class="icon-settings"></i>\n							{{ \'APPLICATION_SETTINGS\' | translate}} </a>\n						</li>\n'+"						<li data-ng-class=\"{active: $state.is('main.channels.voice.routes.inbound.view.applications') || $state.is('main.channels.voice.routes.inbound.view.application') || $state.is('main.channels.voice.routes.inbound.view.applications.settings')}\">\n							<a data-ng-click=\"deselectAndRedirect('/channels/voice/routes/inbound/view/'+route.id+'/applications')\">\n							<i class=\"icon-list\"></i>\n							{{ 'APPLICATION_ACTIONS' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class=\"profile-content\">\n		</div>\n		<!-- <pre>\n			{{route | json}}\n		</pre> -->\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n"),a.put("app/channels/voice/route/inbound/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_INBOUND\' | translate}} {{ \'APPLICATION_ROUTE\' | translate}} {{ \'APPLICATION_SETTINGS\' | translate}} </span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_GENERAL\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n\n			<div class="portlet-body" data-ng-init="getContexts()">\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.general" data-ng-submit="forms.general.$valid && updateRoute()" novalidate>\n\n							<!-- START EXTEN -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.exten.$touched || forms.general.$submitted) && forms.general.exten.$invalid}">\n								<label class="control-label">{{\'APPLICATION_PHONE_NUMBER\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="exten" placeholder="{{\'APPLICATION_PHONE_NUMBER\' | translate}}" class="form-control" data-ng-model="route.exten" required/>\n								<span data-ng-show="(forms.general.exten.$touched || forms.general.$submitted) && forms.general.exten.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END EXTEN -->\n\n							<!-- START CONTEXT -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.context.$touched || forms.general.$submitted) && forms.general.context.$invalid}">\n								<label class="control-label">{{\'APPLICATION_CONTEXT\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="route.context" name="context" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n									<ui-select-choices repeat="context.name as context in voiceContexts | filter: $select.search">\n										<div ng-bind-html="context.name | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_VOICE_CONTEXT\' | translate }}\n								</span>\n								<span data-ng-show="(forms.general.context.$touched || forms.general.$submitted) && forms.general.context.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END CONTEXT -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="route.description"/></textarea>\n							</div>\n							<!-- END DESCRIPTION -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END GENERAL TAB -->\n\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/channels/voice/route/internal/list/create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_ROUTE\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="forms.extension" novalidate>\n\n    <!-- START EXTEN -->\n    <div class="form-group" data-ng-class="{\'has-error\': (forms.extension.exten.$touched || forms.extension.$submitted) && forms.extension.exten.$invalid || existRoute}">\n      <label class="control-label">{{\'APPLICATION_PHONE_NUMBER\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="exten" placeholder="{{\'APPLICATION_PHONE_NUMBER\' | translate}}" class="form-control" data-ng-model="item.exten" data-ng-pattern="settings.patternName" required/>\n      <span data-ng-show="(forms.extension.exten.$touched || forms.extension.$submitted) && forms.extension.exten.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END EXTEN -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n    </div>\n    <!-- END DESCRIPTION -->\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="ok()" ng-disabled="forms.extension.$invalid || existRoute">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n<!-- <pre>\n  {{item | json}}\n</pre> -->\n'),a.put("app/channels/voice/route/internal/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-reload"></i>\n					<a href="/voice/routes/internal/list">{{ \'APPLICATION_INTERNAL\' | translate }} {{ \'APPLICATION_ROUTES\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-users font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_INTERNAL\' | translate }} {{ \'APPLICATION_ROUTES\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<a class="btn green-jungle " href="#" data-ng-click="create()">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_ROUTE\' | translate }}\n						</a>\n					</div>\n					<!-- <a class="btn btn-icon-only btn-default fullscreen" href="#"></a> -->\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter class="ui-grid" ui-grid-draggable-rows>\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/voice/route/internal/view/view.applications.html",'<div ui-view class="profile-content">\n<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title  tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_ACTIONS\' | translate}}</span>\n				</div>\n				<div class="actions">\n					<div class="btn-group">\n						<a class="btn green-jungle " href="/channels/voice/routes/internal/view/{{route.id}}/application" data-toggle="dropdown">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_APPLICATION\' | translate }}\n						</a>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div data-ng-if="selectedApp === undefined" ui-grid="gridOptions"  ui-grid-resize-columns class="grid" ui-grid-draggable-rows>\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n	</div>\n</div>\n</div>\n'),a.put("app/channels/voice/route/internal/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getRoute()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-reload"></i>\n					<a href="/channels/voice/routes/internal/list">{{ \'APPLICATION_INTERNAL\' | translate }} {{ \'APPLICATION_ROUTES\' | translate }}</a>\n					<i data-ng-show="route" class="fa fa-angle-right"></i>\n				</li>\n				<li data-ng-show="route">\n					<a href="#">{{route.exten}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/internalroute.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{route.exten}}\n					</div>\n					<!-- <div class="profile-usertitle-job">\n						{{user.role}}\n					</div> -->\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.channels.voice.routes.internal.view.settings\')}">\n							<a data-ng-click="deselectAndRedirect(\'/channels/voice/routes/internal/view/\'+route.id+\'/settings\')">\n							<i class="icon-settings"></i>\n							{{ \'APPLICATION_SETTINGS\' | translate}} </a>\n						</li>\n'+"						<li data-ng-class=\"{active: $state.is('main.channels.voice.routes.internal.view.applications') || $state.is('main.channels.voice.routes.internal.view.application') || $state.is('main.channels.voice.routes.internal.view.applications.settings')}\">\n							<a data-ng-click=\"deselectAndRedirect('/channels/voice/routes/internal/view/'+route.id+'/applications')\">\n							<i class=\"icon-list\"></i>\n							{{ 'APPLICATION_ACTIONS' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class=\"profile-content\">\n		</div>\n		<!-- <pre>\n			{{route | json}}\n		</pre> -->\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n"),a.put("app/channels/voice/route/internal/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_INTERNAL\' | translate}} {{ \'APPLICATION_ROUTE\' | translate}} {{ \'APPLICATION_SETTINGS\' | translate}} </span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_GENERAL\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n\n			<div class="portlet-body" data-ng-init="getContexts()">\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.general" data-ng-submit="forms.general.$valid && updateRoute()" novalidate>\n\n							<!-- START EXTEN -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.exten.$touched || forms.general.$submitted) && forms.general.exten.$invalid}">\n								<label class="control-label">{{\'APPLICATION_PHONE_NUMBER\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="exten" placeholder="{{\'APPLICATION_PHONE_NUMBER\' | translate}}" class="form-control" data-ng-model="route.exten" required/>\n								<span data-ng-show="(forms.general.exten.$touched || forms.general.$submitted) && forms.general.exten.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END EXTEN -->\n\n							<!-- START CONTEXT -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.context.$touched || forms.general.$submitted) && forms.general.context.$invalid}">\n								<label class="control-label">{{\'APPLICATION_CONTEXT\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="route.context" name="context" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n									<ui-select-choices repeat="context.name as context in voiceContexts | filter: $select.search">\n										<div ng-bind-html="context.name | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_VOICE_CONTEXT\' | translate }}\n								</span>\n								<span data-ng-show="(forms.general.context.$touched || forms.general.$submitted) && forms.general.context.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END CONTEXT -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="route.description"/></textarea>\n							</div>\n							<!-- END DESCRIPTION -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END GENERAL TAB -->\n\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/channels/voice/route/outbound/list/create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_ROUTE\' | translate }}</h3>\n</div>\n<div class="modal-body" data-ng-init="getTags()">\n  <form name="forms.extension" novalidate>\n\n    <!-- START EXTEN -->\n    <div class="form-group" data-ng-class="{\'has-error\': (forms.extension.exten.$touched || forms.extension.$submitted) && forms.extension.exten.$invalid || existRoute}">\n      <label class="control-label">{{\'APPLICATION_DESTINATION_PATTERN\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="exten" placeholder="{{\'APPLICATION_DESTINATION_PATTERN\' | translate}}" class="form-control" data-ng-model="item.exten" data-ng-pattern="settings.patternName" required/>\n      <span data-ng-show="(forms.extension.exten.$touched || forms.extension.$submitted) && forms.extension.exten.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END EXTEN -->\n\n    <!-- START TAG -->\n    <div class="form-group"  data-ng-class="{\'has-error\': (forms.extension.tag.$touched || forms.extension.$submitted) && forms.extension.tag.$invalid}">\n      <label class="control-label">{{ \'APPLICATION_TAG\' | translate }}<span class="required" aria-required="true">*</span></label>\n      <ui-select data-ng-model="item.tag" name="tag" theme="bootstrap" required>\n        <ui-select-match placeholder="{{ \'APPLICATION_TAG\' | translate }}" data-ng-init="item.tag = \'--\'">{{$select.selected.name}}</ui-select-match>\n        <ui-select-choices repeat="tag.name as tag in tags | filter: $select.search">\n          <div ng-bind-html="tag.name | highlight: $select.search"></div>\n        </ui-select-choices>\n      </ui-select>\n      <span data-ng-show="(forms.extension.tag.$touched || forms.extension.$submitted) && forms.extension.tag.$invalid && forms.extension.tag.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END TAG -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n    </div>\n    <!-- END DESCRIPTION -->\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="ok()" ng-disabled="forms.extension.$invalid || existRoute">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n<!-- <pre>\n  {{item | json}}\n</pre> -->\n'),
+a.put("app/channels/voice/route/outbound/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-call-out"></i>\n					<a href="/channels/voice/routes/outbound/list">{{ \'APPLICATION_OUTBOUND\' | translate }} {{ \'APPLICATION_ROUTES\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-users font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_OUTBOUND\' | translate }} {{ \'APPLICATION_ROUTES\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<a class="btn green-jungle " href="#" data-ng-click="create()">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_ROUTE\' | translate }}\n						</a>\n					</div>\n					<!-- <a class="btn btn-icon-only btn-default fullscreen" href="#"></a> -->\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter class="ui-grid" ui-grid-draggable-rows>\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/voice/route/outbound/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getRoute()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-call-out"></i>\n					<a href="/channels/voice/routes/outbound/list">{{ \'APPLICATION_OUTBOUND\' | translate }} {{ \'APPLICATION_ROUTES\' | translate }}</a>\n					<i data-ng-show="route" class="fa fa-angle-right"></i>\n				</li>\n				<li data-ng-show="route">\n					<a href="#">{{route.exten}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/outboundroute.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{route.exten}}\n					</div>\n					<!-- <div class="profile-usertitle-job">\n						{{user.role}}\n					</div> -->\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.channels.voice.routes.outbound.view.settings\')}">\n							<a data-ng-click="deselectAndRedirect(\'/channels/voice/routes/outbound/view/\'+route.id+\'/settings\')">\n							<i class="icon-settings"></i>\n							{{ \'APPLICATION_SETTINGS\' | translate}} </a>\n						</li>\n'+"						<li data-ng-class=\"{active: $state.is('main.channels.voice.routes.outbound.view.routes') || $state.is('main.channels.voice.routes.outbound.view.route') || $state.is('main.channels.voice.routes.outbound.view.routes.settings')}\">\n							<a data-ng-click=\"deselectAndRedirect('/channels/voice/routes/outbound/view/'+route.id+'/routes')\">\n							<i class=\"icon-list\"></i>\n							{{ 'APPLICATION_ACTIONS' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class=\"profile-content\">\n		</div>\n		<!-- <pre>\n			{{route | json}}\n		</pre> -->\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n"),a.put("app/channels/voice/route/outbound/view/view.route.html",'<div class="row" data-ng-init="initApplication(true);getIntervals();">\n	<div class="col-md-12">\n		<!-- BEGIN  PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-notebook font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_NEW_ROUTE\' | translate }} WIZARD</a> </span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<div class="profile-usertitle-name">\n					{{(main.app | capitalize) || \'Application\'}}\n				</div>\n				<wizard on-finish="addApplication()">\n	        <wz-step title="{{\'APPLICATION_SETTINGS\' | translate}}" canexit="formValidation(forms.info.$valid)">\n							<form name="forms.info" novalidate>\n								<button class="btn green-haze" type="submit" ng-click="goNext()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n								<!-- START APP -->\n								<div class="form-group"  data-ng-class="{\'has-error\': (forms.info.app.$touched || forms.info.$submitted) && forms.info.app.$invalid}">\n									<label class="control-label">{{ \'APPLICATION_APPLICATION\' | translate }}<span class="required" aria-required="true">*</span></label>\n									<ui-select data-ng-model="main.app" name="app" theme="bootstrap" required>\n										<ui-select-match placeholder="{{ \'APPLICATION_APPLICATION\' | translate }}">{{$select.selected.name}}</ui-select-match>\n										<ui-select-choices repeat="app.value as app in applications | filter: $select.search">\n											<div ng-bind-html="app.name | highlight: $select.search"></div>\n										</ui-select-choices>\n									</ui-select>\n									<span data-ng-show="(forms.info.app.$touched || forms.info.$submitted) && forms.info.app.$invalid && forms.info.app.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END APP -->\n								<div id="Dial" class="app-settings" ng-slide-down="main.app == \'Dial\'" lazy-render duration="1">\n								<!-- START TRUNK -->\n								<div class="form-group" data-ng-class="{\'has-error\': (forms.info.trunk.$touched || forms.info.$submitted) && forms.info.trunk.$invalid}">\n									<label class="control-label">{{\'APPLICATION_TRUNK\' | translate}}<span class="required" aria-required="true">*</span></label>\n									<ui-select data-ng-model="application.appdata[0]" data-ng-init="application.appdata[0] = null" name="trunk" theme="bootstrap" required data-ng-disabled="!items.length">\n										<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n										<ui-select-choices repeat="trunk.name as trunk in items | filter: $select.search">\n											<div ng-bind-html="trunk.name | highlight: $select.search"></div>\n										</ui-select-choices>\n									</ui-select>\n									<div class="note note-warning" data-ng-hide="items.length">\n										<h4 class="block">Warning!</h4>\n										<p>\n											{{ \'MESSAGE_NO_TRUNKS_AVAILABLE\' | translate }}\n										</p>\n										<p>\n											{{\'APPLICATION_GO_TO\' | translate}} <a href="/tools/trunks/list">{{\'APPLICATION_TRUNKS\' | translate}}</a>\n										</p>\n									</div>\n									<span data-ng-show="(forms.info.trunk.$touched || forms.info.$submitted) && forms.info.trunk.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END TRUNK -->\n\n								<!-- <input type="hidden" class="form-control" name="context" data-ng-model="application.appdata[1]" data-ng-init="application.appdata[1] = \'from-sip\'"> -->\n\n								<!-- START CALLERID -->\n								<div class="form-group"  data-ng-class="{\'has-error\': (forms.info.callerID.$touched || forms.info.$submitted) && forms.info.callerID.$invalid}">\n									<label class="control-label">{{ \'APPLICATION_CALLERID\' | translate }}</label>\n									<input type="text" name="callerID" pattern=\'^"[a-zA-Z0-9_.-]*" <[a-zA-Z0-9_.-]*>\' placeholder=\'"name" <number>\' class="form-control" data-ng-model="application.appdata[1]" data-ng-init="application.appdata[1] = null">\n										<span class="help-block">\n											{{ \'DESCRIPTION_OUTBOUND_CALLERID\' | translate }}\n										</span>\n									<span data-ng-show="(forms.info.callerID.$touched || forms.info.$submitted) && forms.info.callerID.$invalid" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END CALLERID -->\n\n									<!-- START CUTDIGITS -->\n								<div class="form-group">\n									<label class="control-label">{{\'APPLICATION_CUTDIGITS\' | translate}}</label>\n									<input type="text" pattern="[0-9]+" class="form-control" name="cutdigits" data-ng-model="application.appdata[2]" data-ng-init="application.appdata[2] = null">\n									<span class="help-block">\n										{{ \'DESCRIPTION_VOICE_CONTEXT\' | translate }}\n									</span>\n								</div>\n								<!-- END CUTDIGITS -->\n\n								<!-- START PREFIX -->\n								<div class="form-group"  data-ng-class="{\'has-error\': (forms.info.prefix.$touched || forms.info.$submitted) && forms.info.prefix.$invalid}">\n									<label class="control-label">{{ \'APPLICATION_PREFIX\' | translate }}</label>\n									<input type="text" name="prefix"  placeholder="{{ \'APPLICATION_PREFIX\' | translate }}" class="form-control" data-ng-model="application.appdata[3]" data-ng-init="application.appdata[3] = null">\n										<span class="help-block">\n											{{ \'DESCRIPTION_OUTBOUND_PREFIX\' | translate }}\n										</span>\n										<span data-ng-show="(forms.info.prefix.$touched || forms.info.$submitted) && forms.info.prefix.$invalid" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<!-- END PREFIX -->\n							</div>\n							<div id="Custom" class="app-settings" ng-slide-down="main.app == \'custom\'" lazy-render duration="1">\n\n								<!-- START CUSTOMAPP -->\n								<div class="form-group"  data-ng-class="{\'has-error\': (forms.info.customApp.$touched || forms.info.$submitted) && forms.info.customApp.$invalid}">\n									<label class="control-label">{{ \'APPLICATION_CUSTOM_APP\' | translate }}<span class="required" aria-required="true">*</span></label>\n									<input type="text" name="customApp" placeholder="{{ \'APPLICATION_CUSTOM_APP\' | translate }}" class="form-control" data-ng-model="application.app" data-ng-init="application.appdata[0] = null" required>\n									<span data-ng-show="(forms.info.customApp.$touched || forms.info.$submitted) && forms.info.customApp.$invalid && forms.info.customApp.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END CUSTOMAPP -->\n\n								<!-- START APPDATA -->\n								<div class="form-group"  data-ng-class="{\'has-error\': (forms.info.appdata.$touched || forms.info.$submitted) && forms.info.appdata.$invalid}">\n									<label class="control-label">{{ \'APPLICATION_ARGUMENTS\' | translate }}</label>\n									<input type="text" name="appdata" placeholder="{{ \'APPLICATION_ARGUMENTS\' | translate }}" class="form-control" data-ng-model="application.appdata[0]" data-ng-init="application.appdata[1] = null">\n									<span data-ng-show="(forms.info.appdata.$touched || forms.info.$submitted) && forms.info.appdata.$invalid && forms.info.appdata.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END APPDATA -->\n							</div>\n							<button class="btn green-haze" type="submit" ng-click="goNext()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n							</form>\n							</wz-step>\n								<wz-step title="{{\'APPLICATION_INTERVAL\' | translate}}" canexit="formValidation(forms.interval.IntervalId.$valid || forms.interval.hasOwnProperty(\'t_from\') || forms.interval.intType.$modelValue === \'always\')">\n									<form name="forms.interval" novalidate>\n										<button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n										<button class="btn green-haze" type="submit" ng-click="goNext()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n									<!-- START INTERVAL_TYPE -->\n								<div class="form-group" data-ng-class="{\'has-error\': (forms.interval.intType.$touched || forms.interval.$submitted) && forms.interval.intType.$invalid}">\n									<label class="control-label">{{\'APPLICATION_INTERVAL_TYPE\' | translate}}<span class="required" aria-required="true">*</span></label>\n									<ui-select data-ng-model="interval.intType" theme="bootstrap" name="intType" required>\n										<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$translate.instant($select.selected.name)}}</ui-select-match>\n										<ui-select-choices repeat="intType.value as intType in $application.intTypes | filter: $select.search">\n											{{$translate.instant(intType.name)}}\n										</ui-select-choices>\n									</ui-select>\n									<span data-ng-show="(forms.interval.intType.$touched || forms.interval.$submitted) && forms.interval.intType.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END INTERVAL_TYPE -->\n								<div id="customInterval" class="app-settings" ng-slide-down="interval.intType == \'custom\'" lazy-render duration="1">\n										<!-- START TIME -->\n										<div class="form-group">\n											<label class="control-label">{{ \'APPLICATION_TIME\' | translate }}</label>\n											<div class="input-group input-large">\n												<fieldset class="pull-left" ng-disabled="interval.alwaysTime"><uib-timepicker name="t_from" data-ng-model="interval.t_from" show-meridian="false" show-spinners="false"></uib-timepicker></fieldset>\n												<div class="input-group-addon col-md-1 interval-to pull-left">to</div>\n												<fieldset ng-disabled="interval.alwaysTime"><uib-timepicker  name="t_to" data-ng-model="interval.t_to" show-meridian="false" show-spinners="false"></uib-timepicker></fieldset>\n												<label class="control-label pointer-cursor"><input type="checkbox" data-ng-model="interval.alwaysTime">{{\'APPLICATION_ALWAYS\' | translate}}</label>\n											</div>\n										</div>\n										<!-- END TIME -->\n\n										<!-- START WEEKDAY -->\n										<div class="form-group">\n											<label class="control-label">{{ \'APPLICATION_WEEKDAY\' | translate }}</label>\n											<div class="input-group input-large">\n												<ui-select data-ng-model="interval.wd_from" theme="bootstrap" name="wd_from">\n													<ui-select-match placeholder="">{{$translate.instant($select.selected.name)}}</ui-select-match>\n													<ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n														{{$translate.instant(weekDay.name)}}\n													</ui-select-choices>\n												</ui-select>\n												<span class="input-group-addon">to</span>\n												<ui-select data-ng-model="interval.wd_to" theme="bootstrap" name="wd_to">\n													<ui-select-match placeholder="">{{$translate.instant($select.selected.name)}}</ui-select-match>\n													<ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n														{{$translate.instant(weekDay.name)}}\n													</ui-select-choices>\n												</ui-select>\n											</div>\n										</div>\n										<!-- END WEEKDAY -->\n\n										<!-- START MONTHDAY -->\n										<div class="form-group">\n											<label class="control-label">{{ \'APPLICATION_MONTHDAY\' | translate }}</label>\n											<div class="input-group input-large">\n												<ui-select data-ng-model="interval.md_from" theme="bootstrap" name="md_from">\n													<ui-select-match>{{$select.selected}}</ui-select-match>\n													<ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n														{{monthDay}}\n													</ui-select-choices>\n												</ui-select>\n												<span class="input-group-addon">to</span>\n												<ui-select data-ng-model="interval.md_to" theme="bootstrap" name="md_to">\n													<ui-select-match>{{$select.selected}}</ui-select-match>\n													<ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n														{{monthDay}}\n													</ui-select-choices>\n												</ui-select>\n											</div>\n										</div>\n										<!-- END MONTHDAY -->\n\n										<!-- START MONTH -->\n										<div class="form-group">\n											<label class="control-label">{{ \'APPLICATION_MONTH\' | translate }}</label>\n											<div class="input-group input-large">\n												<ui-select data-ng-model="interval.m_from" theme="bootstrap" name="m_from">\n													<ui-select-match placeholder="">{{$translate.instant($select.selected.name)}}</ui-select-match>\n													<ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n														{{$translate.instant(month.name)}}\n													</ui-select-choices>\n												</ui-select>\n												<span class="input-group-addon">to</span>\n												<ui-select data-ng-model="interval.m_to" theme="bootstrap" name="m_to">\n													<ui-select-match placeholder="">{{$translate.instant($select.selected.name)}}</ui-select-match>\n													<ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n														{{$translate.instant(month.name)}}\n													</ui-select-choices>\n												</ui-select>\n											</div>\n										</div>\n										<!-- END MONTH -->\n						</div>\n\n						<div id="customInterval" class="app-settings" ng-slide-down="interval.intType == \'list\'" lazy-render duration="1">\n\n							<!-- START INTERVALS -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.interval.IntervalId.$touched || forms.interval.$submitted) && forms.interval.IntervalId.$invalid}">\n								<label class="control-label">{{\'APPLICATION_INTERVALS\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="interval.IntervalId" theme="bootstrap" name="IntervalId" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$translate.instant($select.selected.name)}}</ui-select-match>\n									<ui-select-choices repeat="interval.id as interval in Intervals | filter: $select.search">\n										{{$translate.instant(interval.name)}}\n									</ui-select-choices>\n								</ui-select>\n								<span data-ng-show="(forms.interval.IntervalId.$touched || forms.interval.$submitted) && forms.interval.IntervalId.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END INTERVALS -->\n\n						</div>\n\n						<button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n						<button class="btn green-haze" type="submit" ng-click="goNext()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n							</form>\n						</wz-step>\n\n						<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n							<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n							<button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n							<input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n						</wz-step>\n				</wizard>\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/voice/route/outbound/view/view.routeSettings.html",'\n<div class="row" data-ng-init="initApplication();getApplication();getIntervals();">\n	<div class="col-md-12">\n		<!-- BEGIN  PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-notebook font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_APPLICATION_SETTINGS\' | translate }} WIZARD</a> </span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<wizard on-finish="updateRoute(\'routes\')">\n					<div class="profile-usertitle-name">\n						{{(main.app | capitalize) || \'Application\'}}\n					</div>\n	        <wz-step title="{{\'APPLICATION_APPLICATION\' | translate}}" canexit="formValidation(forms.info.$valid)">\n						<form name="forms.info" novalidate>\n							<div id="Dial" class="app-settings" ng-slide-down="main.app == \'Dial\'" lazy-render duration="1">\n							<button class="btn green-haze" type="submit" ng-click="goNext()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n\n							<!-- START TRUNK -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.info.trunk.$touched || forms.info.$submitted) && forms.info.trunk.$invalid}">\n								<label class="control-label">{{\'APPLICATION_TRUNK\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="route.Applications[selectedApp].appdata[0]" name="trunk" theme="bootstrap" required data-ng-disabled="!items.length">\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n									<ui-select-choices repeat="trunk.name as trunk in items | filter: $select.search">\n										<div ng-bind-html="trunk.name | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<div class="note note-warning" data-ng-hide="items.length">\n									<h4 class="block">Warning!</h4>\n									<p>\n										{{ \'MESSAGE_NO_TRUNKS_AVAILABLE\' | translate }}\n									</p>\n									<p>\n										{{\'APPLICATION_GO_TO\' | translate}} <a href="/tools/trunks/list">{{\'APPLICATION_TRUNKS\' | translate}}</a>\n									</p>\n								</div>\n								<span data-ng-show="(forms.info.trunk.$touched || forms.info.$submitted) && forms.info.trunk.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END TRUNK -->\n\n							<!-- START CONTEXT -->\n							<!-- <div class="form-group" data-ng-class="{\'has-error\': (forms.info.context.$touched || forms.info.$submitted) && forms.info.context.$invalid}">\n								<label class="control-label">{{\'APPLICATION_CONTEXT\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="route.Applications[selectedApp].appdata[1]" name="context" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n									<ui-select-choices repeat="context.name as context in items2 | filter: $select.search">\n										<div ng-bind-html="context.name | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_VOICE_CONTEXT\' | translate }}\n								</span>\n								<span data-ng-show="(forms.info.context.$touched || forms.info.$submitted) && forms.info.context.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div> -->\n							<!-- END CONTEXT -->\n\n							<!-- START CALLERID -->\n							<div class="form-group"  data-ng-class="{\'has-error\': (forms.info.callerID.$touched || forms.info.$submitted) && forms.info.callerID.$invalid}">\n								<label class="control-label">{{ \'APPLICATION_CALLERID\' | translate }}</label>\n								<input type="text" name="callerID" pattern=\'^"[a-zA-Z0-9_.-]*" <[a-zA-Z0-9_.-]*>\' placeholder=\'"name" <number>\' class="form-control" data-ng-model="route.Applications[selectedApp].appdata[1]">\n									<span class="help-block">\n										{{ \'DESCRIPTION_OUTBOUND_CALLERID\' | translate }} "name" &lt;number&gt;\n									</span>\n								<span data-ng-show="(forms.info.callerID.$touched || forms.info.$submitted) && forms.info.callerID.$invalid" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END CALLERID -->\n\n								<!-- START CUTDIGITS -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_CUTDIGITS\' | translate}}</label>\n								<input type="text" pattern="[0-9]+" class="form-control" name="cutdigits" data-ng-model="route.Applications[selectedApp].appdata[2]">\n								<span class="help-block">\n									{{ \'DESCRIPTION_VOICE_CONTEXT\' | translate }}\n								</span>\n							</div>\n							<!-- END CUTDIGITS -->\n\n							<!-- START PREFIX -->\n							<div class="form-group"  data-ng-class="{\'has-error\': (forms.info.prefix.$touched || forms.info.$submitted) && forms.info.prefix.$invalid}">\n								<label class="control-label">{{ \'APPLICATION_PREFIX\' | translate }}</label>\n								<input type="text" name="prefix"  placeholder="{{ \'APPLICATION_PREFIX\' | translate }}" class="form-control" data-ng-model="route.Applications[selectedApp].appdata[3]">\n								<span class="help-block">\n									{{ \'DESCRIPTION_OUTBOUND_PREFIX\' | translate }}\n								</span>\n								<span data-ng-show="(forms.info.prefix.$touched || forms.info.$submitted) && forms.info.prefix.$invalid" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n								<!-- END PREFIX -->\n						</div>\n						<div id="Custom" class="app-settings" ng-slide-down="main.app == \'custom\'" lazy-render duration="1">\n\n							<!-- START CUSTOMAPP -->\n							<div class="form-group"  data-ng-class="{\'has-error\': (forms.info.customApp.$touched || forms.info.$submitted) && forms.info.customApp.$invalid}">\n								<label class="control-label">{{ \'APPLICATION_CUSTOM_APP\' | translate }}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="customApp" placeholder="{{ \'APPLICATION_CUSTOM_APP\' | translate }}" class="form-control" data-ng-model="route.Applications[selectedApp].app" required>\n								<span data-ng-show="(forms.info.customApp.$touched || forms.info.$submitted) && forms.info.customApp.$invalid && forms.info.customApp.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END CUSTOMAPP -->\n\n							<!-- START APPDATA -->\n							<div class="form-group"  data-ng-class="{\'has-error\': (forms.info.appdata.$touched || forms.info.$submitted) && forms.info.appdata.$invalid}">\n								<label class="control-label">{{ \'APPLICATION_ARGUMENTS\' | translate }}</label>\n								<input type="text" name="appdata" placeholder="{{ \'APPLICATION_ARGUMENTS\' | translate }}" class="form-control" data-ng-model="route.Applications[selectedApp].appdata[0]">\n								<span data-ng-show="(forms.info.appdata.$touched || forms.info.$submitted) && forms.info.appdata.$invalid && forms.info.appdata.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END APPDATA -->\n						</div>\n						<button class="btn green-haze" type="submit" ng-click="goNext()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n					</form>\n					</wz-step>\n						<wz-step title="{{\'APPLICATION_INTERVAL\' | translate}}" canexit="formValidation(forms.interval.IntervalId.$valid || forms.interval.hasOwnProperty(\'t_from\') || forms.interval.intType.$modelValue === \'always\')">\n							<form name="forms.interval" novalidate>\n								<button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n								<button class="btn green-haze" type="submit" ng-click="goNext()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n						<!-- START INTERVAL_TYPE -->\n						<div class="form-group" data-ng-class="{\'has-error\': (forms.interval.intType.$touched || forms.interval.$submitted) && forms.interval.intType.$invalid}">\n							<label class="control-label">{{\'APPLICATION_INTERVAL_TYPE\' | translate}}<span class="required" aria-required="true">*</span></label>\n							<ui-select data-ng-model="interval.intType" theme="bootstrap" name="intType" required>\n								<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$translate.instant($select.selected.name)}}</ui-select-match>\n								<ui-select-choices repeat="intType.value as intType in $application.intTypes | filter: $select.search">\n									{{$translate.instant(intType.name)}}\n								</ui-select-choices>\n							</ui-select>\n							<span data-ng-show="(forms.interval.intType.$touched || forms.interval.$submitted) && forms.interval.intType.$error.required" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n						</div>\n						<!-- END INTERVAL_TYPE -->\n						<div id="customInterval" class="app-settings" ng-slide-down="interval.intType == \'custom\'" lazy-render duration="1">\n								<!-- START TIME -->\n								<div class="form-group">\n									<label class="control-label">{{ \'APPLICATION_TIME\' | translate }}</label>\n									<div class="input-group input-large">\n										<fieldset class="pull-left" ng-disabled="interval.alwaysTime"><uib-timepicker name="t_from" data-ng-model="interval.t_from" show-meridian="false" show-spinners="false"></uib-timepicker></fieldset>\n										<div class="input-group-addon col-md-1 interval-to pull-left">to</div>\n										<fieldset ng-disabled="interval.alwaysTime"><uib-timepicker  name="t_to" data-ng-model="interval.t_to" show-meridian="false" show-spinners="false"></uib-timepicker></fieldset>\n										<label class="control-label pointer-cursor"><input type="checkbox" data-ng-model="interval.alwaysTime">{{\'APPLICATION_ALWAYS\' | translate}}</label>\n									</div>\n								</div>\n								<!-- END TIME -->\n\n								<!-- START WEEKDAY -->\n								<div class="form-group">\n									<label class="control-label">{{ \'APPLICATION_WEEKDAY\' | translate }}</label>\n									<div class="input-group input-large">\n										<ui-select data-ng-model="interval.wd_from" theme="bootstrap" name="wd_from">\n											<ui-select-match placeholder="">{{$translate.instant($select.selected.name)}}</ui-select-match>\n											<ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n												{{$translate.instant(weekDay.name)}}\n											</ui-select-choices>\n										</ui-select>\n										<span class="input-group-addon">to</span>\n										<ui-select data-ng-model="interval.wd_to" theme="bootstrap" name="wd_to">\n											<ui-select-match placeholder="">{{$translate.instant($select.selected.name)}}</ui-select-match>\n											<ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n												{{$translate.instant(weekDay.name)}}\n											</ui-select-choices>\n										</ui-select>\n									</div>\n								</div>\n								<!-- END WEEKDAY -->\n\n								<!-- START MONTHDAY -->\n								<div class="form-group">\n									<label class="control-label">{{ \'APPLICATION_MONTHDAY\' | translate }}</label>\n									<div class="input-group input-large">\n										<ui-select data-ng-model="interval.md_from" theme="bootstrap" name="md_from">\n											<ui-select-match>{{$select.selected}}</ui-select-match>\n											<ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n												{{monthDay}}\n											</ui-select-choices>\n										</ui-select>\n										<span class="input-group-addon">to</span>\n										<ui-select data-ng-model="interval.md_to" theme="bootstrap" name="md_to">\n											<ui-select-match>{{$select.selected}}</ui-select-match>\n											<ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n												{{monthDay}}\n											</ui-select-choices>\n										</ui-select>\n									</div>\n								</div>\n								<!-- END MONTHDAY -->\n\n								<!-- START MONTH -->\n								<div class="form-group">\n									<label class="control-label">{{ \'APPLICATION_MONTH\' | translate }}</label>\n									<div class="input-group input-large">\n										<ui-select data-ng-model="interval.m_from" theme="bootstrap" name="m_from">\n											<ui-select-match placeholder="">{{$translate.instant($select.selected.name)}}</ui-select-match>\n											<ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n												{{$translate.instant(month.name)}}\n											</ui-select-choices>\n										</ui-select>\n										<span class="input-group-addon">to</span>\n										<ui-select data-ng-model="interval.m_to" theme="bootstrap" name="m_to">\n											<ui-select-match placeholder="">{{$translate.instant($select.selected.name)}}</ui-select-match>\n											<ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n												{{$translate.instant(month.name)}}\n											</ui-select-choices>\n										</ui-select>\n									</div>\n								</div>\n								<!-- END MONTH -->\n							</div>\n\n							<div id="customInterval" class="app-settings" ng-slide-down="interval.intType == \'list\'" lazy-render duration="1">\n\n								<!-- START INTERVALS -->\n								<div class="form-group" data-ng-class="{\'has-error\': (forms.interval.IntervalId.$touched || forms.interval.$submitted) && forms.interval.IntervalId.$invalid}">\n									<label class="control-label">{{\'APPLICATION_INTERVALS\' | translate}}<span class="required" aria-required="true">*</span></label>\n									<ui-select data-ng-model="interval.IntervalId" theme="bootstrap" name="IntervalId" required>\n										<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$translate.instant($select.selected.name)}}</ui-select-match>\n										<ui-select-choices repeat="interval.id as interval in Intervals | filter: $select.search">\n											{{$translate.instant(interval.name)}}\n										</ui-select-choices>\n									</ui-select>\n									<span data-ng-show="(forms.interval.IntervalId.$touched || forms.interval.$submitted) && forms.interval.IntervalId.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END INTERVALS -->\n\n							</div>\n							<button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n							<button class="btn green-haze" type="submit" ng-click="goNext()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n							</form>\n						</wz-step>\n\n						<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n							<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n							<button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n							<input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n						</wz-step>\n				</wizard>\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),
+a.put("app/channels/voice/route/outbound/view/view.routes.html",'<div ui-view class="profile-content">\n<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title  tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_ACTIONS\' | translate}}</span>\n				</div>\n				<div class="actions">\n					<div class="btn-group">\n						<a class="btn green-jungle " href="/channels/voice/routes/outbound/view/{{route.id}}/route" data-toggle="dropdown">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_ROUTE\' | translate }}\n						</a>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div data-ng-if="selectedApp === undefined" ui-grid="gridOptions"  ui-grid-resize-columns class="grid" ui-grid-draggable-rows>\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n	</div>\n</div>\n</div>\n'),a.put("app/channels/voice/route/outbound/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_OUTBOUND\' | translate}} {{ \'APPLICATION_ROUTE\' | translate}} {{ \'APPLICATION_SETTINGS\' | translate}} </span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_GENERAL\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n\n			<div class="portlet-body" data-ng-init="getContexts();getTags();">\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.general" data-ng-submit="forms.general.$valid && updateRoute()" novalidate>\n\n							<!-- START EXTEN -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.exten.$touched || forms.general.$submitted) && forms.general.exten.$invalid}">\n								<label class="control-label">{{\'APPLICATION_DESTINATION_PATTERN\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="exten" placeholder="{{\'APPLICATION_DESTINATION_PATTERN\' | translate}}" class="form-control" data-ng-model="route.exten" required/>\n								<span data-ng-show="(forms.general.exten.$touched || forms.general.$submitted) && forms.general.exten.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END EXTEN -->\n\n							<!-- START TAG -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.tag.$touched || forms.general.$submitted) && forms.general.tag.$invalid}">\n								<label class="control-label">{{\'APPLICATION_TAG\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="route.tag" name="tag" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n									<ui-select-choices repeat="tag.name as tag in tags | filter: $select.search">\n										<div ng-bind-html="tag.name | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span data-ng-show="(forms.general.tag.$touched || forms.general.$submitted) && forms.general.tag.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END TAG -->\n\n							<!-- START CONTEXT -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.context.$touched || forms.general.$submitted) && forms.general.context.$invalid}">\n								<label class="control-label">{{\'APPLICATION_CONTEXT\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="route.context" name="context" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n									<ui-select-choices repeat="context.name as context in voiceContexts | filter: $select.search">\n										<div ng-bind-html="context.name | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_VOICE_CONTEXT\' | translate }}\n								</span>\n								<span data-ng-show="(forms.general.context.$touched || forms.general.$submitted) && forms.general.context.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END CONTEXT -->\n\n							<!-- START RECORD -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.record.$touched || forms.general.$submitted) && forms.general.record.$invalid}">\n								<label class="control-label">{{\'APPLICATION_RECORDING\' | translate}}</label></br>\n								<input\n								    bs-switch\n										class="form-control"\n								    ng-model="route.record"\n								    type="checkbox"\n								    switch-active="{{ recordSwitch.isActive }}"\n								    switch-on-text="{{ recordSwitch.onText }}"\n								    switch-off-text="{{ recordSwitch.offText }}"\n								    switch-on-color="{{ recordSwitch.onColor }}"\n								    switch-off-color="{{ recordSwitch.offColor }}"\n								    switch-animate="{{ recordSwitch.animate }}"\n								    switch-size="{{ recordSwitch.size }}"\n								    switch-label="{{ recordSwitch.label }}"\n								    switch-icon="{{ recordSwitch.icon }}"\n								    switch-radio-off="{{ recordSwitch.radioOff }}"\n								    switch-label-width="{{ recordSwitch.labelWidth }}"\n								    switch-handle-width="{{ recordSwitch.handleWidth }}">\n								<span data-ng-show="(forms.general.record.$touched || forms.general.$submitted) && forms.general.record.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END RECORD -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="route.description"/></textarea>\n							</div>\n							<!-- END DESCRIPTION -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END GENERAL TAB -->\n\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/channels/voice/route/view.application.html",'\n<div class="row" data-ng-init="initApplication(true); getIntervals();">\n	<div class="col-md-12">\n		<!-- BEGIN  PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-notebook font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_NEW_APPLICATION\' | translate }} WIZARD</a> </span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<wizard on-finish="addApplication()">\n					<div class="profile-usertitle-name">\n						{{(main.app | capitalize) || \'Application\'}}\n					</div>\n	        <wz-step title="{{\'APPLICATION_APPLICATION\' | translate}}" canexit="formValidation(forms.settings.$valid)">\n							<form name="forms.settings" novalidate>\n								<button class="btn green-haze" type="submit" ng-click="goNext()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n									<!-- START APP -->\n									<div class="form-group"  data-ng-class="{\'has-error\': (forms.settings.app.$touched || forms.settings.$submitted) && forms.settings.app.$invalid}">\n										<label class="control-label">{{ \'APPLICATION_APPLICATION\' | translate }}<span class="required" aria-required="true">*</span></label>\n										<ui-select data-ng-model="main.app" name="app" theme="bootstrap" required>\n					            <ui-select-match placeholder="{{ \'APPLICATION_APPLICATION\' | translate }}">{{$select.selected.name}}</ui-select-match>\n					            <ui-select-choices repeat="app.value as app in $application.applications| filter: $select.search">\n					              <div ng-bind-html="app.name | highlight: $select.search"></div>\n					            </ui-select-choices>\n					          </ui-select>\n										<span data-ng-show="(forms.settings.app.$touched || forms.settings.$submitted) && forms.settings.app.$invalid && forms.settings.app.$error.required" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<!-- END APP -->\n\n									<div id="Queue" class="app-settings" ng-slide-down="main.app == \'Queue\'" lazy-render duration="1">\n										<!-- START QUEUE -->\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.queue.$touched || forms.settings.$submitted) && forms.settings.queue.$invalid}">\n											<label class="control-label">{{\'APPLICATION_QUEUE\' | translate}}<span class="required" aria-required="true">*</span></label>\n											<ui-select data-ng-model="application.appdata[0]" data-ng-init="application.appdata[0] = null" name="queue" theme="bootstrap" required data-ng-disabled="!items.length">\n												<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n												<ui-select-choices repeat="queue.name as queue in items | filter: $select.search">\n													<div ng-bind-html="queue.name | highlight: $select.search"></div>\n												</ui-select-choices>\n											</ui-select>\n											<div class="note note-warning" data-ng-hide="items.length">\n												<h4 class="block">Warning!</h4>\n												<p>\n													{{ \'MESSAGE_NO_QUEUES_AVAILABLE\' | translate }}\n												</p>\n												<p>\n													{{\'APPLICATION_GO_TO\' | translate}} <a href="/channels/voice/queues/list">{{\'APPLICATION_QUEUES\' | translate}}</a>\n												</p>\n											</div>\n											<span data-ng-show="(forms.settings.queue.$touched || forms.settings.$submitted) && forms.settings.queue.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END QUEUE -->\n\n										<!-- START OPTIONS -->\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.app_options.$touched || forms.settings.$submitted) && forms.settings.app_options.$invalid}">\n											<label class="control-label">{{\'APPLICATION_OPTIONS\' | translate}}</label>\n											<input type="text" name="app_options" placeholder="{{ \'APPLICATION_OPTIONS\' | translate }}" class="form-control" data-ng-model="application.appdata[1]" data-ng-init="application.appdata[1] = null">\n											<span data-ng-show="(forms.settings.app_options.$touched || forms.settings.$submitted) && forms.settings.app_options.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END OPTIONS -->\n										<!-- START URL -->\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.url.$touched || forms.settings.$submitted) && forms.settings.url.$invalid}">\n											<label class="control-label">{{ \'APPLICATION_URL\' | translate }}</label>\n											<input type="text" name="url" placeholder="{{ \'APPLICATION_URL\' | translate }}" class="form-control" data-ng-model="application.appdata[2]" data-ng-init="application.appdata[2] = null">\n											<span data-ng-show="(forms.settings.url.$touched || forms.settings.$submitted) && forms.settings.url.$invalid && forms.settings.url.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END URL -->\n\n										<!-- START AUDIOFILE -->\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.audiofile.$touched || forms.settings.$submitted) && forms.settings.audiofile.$invalid}">\n											<label class="control-label">{{\'APPLICATION_AUDIO_FILE\' | translate}}</label>\n											<ui-select data-ng-model="application.appdata[3]" data-ng-init="application.appdata[3] = null" name="audiofile" theme="bootstrap" data-ng-disabled="!items2.length">\n												<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n												<ui-select-choices repeat="soundPath+\'/\'+audio.save_name as audio in items2 | filter: $select.search">\n													<div ng-bind-html="audio.display_name | highlight: $select.search"></div>\n												</ui-select-choices>\n											</ui-select>\n											<div class="note note-warning" data-ng-hide="items2.length">\n												<h4 class="block">Warning!</h4>\n												<p>\n													{{ \'MESSAGE_NO_SOUNDS_AVAILABLE\' | translate }}\n												</p>\n												<p>\n													{{\'APPLICATION_GO_TO\' | translate}} <a href="/tools/sounds/list">{{\'APPLICATION_SOUNDS\' | translate}}</a>\n												</p>\n											</div>\n											<span data-ng-show="(forms.settings.audiofile.$touched || forms.settings.$submitted) && forms.settings.audiofile.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END AUDIOFILE -->\n\n										<!-- START TIMEOUT -->\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid}">\n											<label class="control-label">{{ \'APPLICATION_TIMEOUT\' | translate }}</label>\n											<input type="text" pattern="[0-9]+" name="timeout" placeholder="" class="form-control" data-ng-model="application.appdata[4]" data-ng-init="application.appdata[4] = null">\n											<span data-ng-show="(forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid && forms.settings.timeout.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END TIMEOUT -->\n\n									</div>\n									<div id="Playback" class="app-settings" ng-slide-down="main.app == \'Playback\'" lazy-render duration="1">\n										<!-- START AUDIOFILE -->\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.audiofile.$touched || forms.settings.$submitted) && forms.settings.audiofile.$invalid}">\n											<label class="control-label">{{\'APPLICATION_AUDIO_FILE\' | translate}}<span class="required" aria-required="true">*</span></label>\n											<ui-select data-ng-model="application.appdata[0]" data-ng-init="application.appdata[0] = null" name="audiofile" theme="bootstrap" required data-ng-disabled="!items.length">\n												<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n												<ui-select-choices repeat="soundPath+\'/\'+audio.save_name as audio in items | filter: $select.search">\n													<div ng-bind-html="audio.display_name | highlight: $select.search"></div>\n												</ui-select-choices>\n											</ui-select>\n											<div class="note note-warning" data-ng-hide="items.length">\n												<h4 class="block">Warning!</h4>\n												<p>\n													{{ \'MESSAGE_NO_SOUNDS_AVAILABLE\' | translate }}\n												</p>\n												<p>\n													{{\'APPLICATION_GO_TO\' | translate}} <a href="/tools/sounds/list">{{\'APPLICATION_SOUNDS\' | translate}}</a>\n												</p>\n											</div>\n											<span data-ng-show="(forms.settings.audiofile.$touched || forms.settings.$submitted) && forms.settings.audiofile.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END AUDIOFILE -->\n\n										<!-- START OPTIONS -->\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.app_options.$touched || forms.settings.$submitted) && forms.settings.app_options.$invalid}">\n											<label class="control-label">{{\'APPLICATION_OPTIONS\' | translate}}</label>\n											<input type="text" name="app_options" placeholder="{{ \'APPLICATION_OPTIONS\' | translate }}" class="form-control" data-ng-model="application.appdata[1]" data-ng-init="application.appdata[1] = null">\n											<span data-ng-show="(forms.settings.app_options.$touched || forms.settings.$submitted) && forms.settings.app_options.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END OPTIONS -->\n									</div>\n									<div id="Dial" class="app-settings" ng-slide-down="main.app == \'Dial\'" lazy-render duration="1">\n										<!-- START INTERFACE -->\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.interface.$touched || forms.settings.$submitted) && forms.settings.interface.$invalid}">\n											<label class="control-label">{{ \'APPLICATION_TYPE\' | translate }}/{{ \'APPLICATION_IDENTIFIER\' | translate }}<span class="required" aria-required="true">*</span></label>\n											<input type="text" name="interface" placeholder="SIP/0000" class="form-control" data-ng-model="application.appdata[0]" data-ng-init="application.appdata[0] = null" required>\n											<span data-ng-show="(forms.settings.interface.$touched || forms.settings.$submitted) && forms.settings.interface.$invalid && forms.settings.interface.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END INTERFACE -->\n\n										<!-- START TIMEOUT -->\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid}">\n											<label class="control-label">{{ \'APPLICATION_TIMEOUT\' | translate }}</label>\n											<input type="text" pattern="[0-9]+" name="timeout" placeholder="" class="form-control" data-ng-model="application.appdata[1]" data-ng-init="application.appdata[1] = null">\n											<span data-ng-show="(forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid && forms.settings.timeout.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END TIMEOUT -->\n\n										<!-- START OPTIONS -->\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.app_options.$touched || forms.settings.$submitted) && forms.settings.app_options.$invalid}">\n											<label class="control-label">{{ \'APPLICATION_OPTIONS\' | translate }}</label>\n											<input type="text" name="app_options" placeholder="" class="form-control" data-ng-model="application.appdata[2]" data-ng-init="application.appdata[2] = null">\n											<span data-ng-show="(forms.settings.app_options.$touched || forms.settings.$submitted) && forms.settings.app_options.$invalid && forms.settings.app_options.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END OPTIONS -->\n\n										<!-- START URL -->\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.url.$touched || forms.settings.$submitted) && forms.settings.url.$invalid}">\n											<label class="control-label">{{ \'APPLICATION_URL\' | translate }}</label>\n											<input type="text" name="url" placeholder="{{ \'APPLICATION_URL\' | translate }}" class="form-control" data-ng-model="application.appdata[3]" data-ng-init="application.appdata[3] = null">\n											<span data-ng-show="(forms.settings.url.$touched || forms.settings.$submitted) && forms.settings.url.$invalid && forms.settings.url.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END URL -->\n									</div>\n									<div id="AGI" class="app-settings" ng-slide-down="main.app == \'AGI\'" lazy-render duration="1">\n										<!-- START PROJECT -->\n										<input type="hidden" name="url" placeholder="{{ \'APPLICATION_URL\' | translate }}" class="form-control" data-ng-model="application.appdata[0]" data-ng-init="application.appdata[0] = \'agi://127.0.0.1/square\'">\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.project.$touched || forms.settings.$submitted) && forms.settings.project.$invalid}">\n											<label class="control-label">{{\'APPLICATION_PROJECT\' | translate}}<span class="required" aria-required="true">*</span></label>\n											<ui-select data-ng-model="application.appdata[1]" data-ng-init="application.appdata[1] = null" name="project" theme="bootstrap" required data-ng-disabled="!items.length">\n												<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n												<ui-select-choices repeat="project.name as project in items | filter: $select.search">\n													<div ng-bind-html="project.name | highlight: $select.search"></div>\n												</ui-select-choices>\n											</ui-select>\n											<div class="note note-warning" data-ng-hide="items.length">\n												<h4 class="block">Warning!</h4>\n												<p>\n													{{ \'MESSAGE_NO_PROJECTS_AVAILABLE\' | translate }}\n												</p>\n												<p>\n													{{\'APPLICATION_GO_TO\' | translate}} <a href="/square/projects/list">{{\'APPLICATION_PROJECTS\' | translate}}</a>\n												</p>\n											</div>\n											<span data-ng-show="(forms.settings.project.$touched || forms.settings.$submitted) && forms.settings.project.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END PROJECT -->\n\n									</div>\n									<div id="Goto" class="app-settings" ng-slide-down="main.app == \'Goto\'" lazy-render duration="1">\n										<!-- START CONTEXT -->\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.context.$touched || forms.settings.$submitted) && forms.settings.context.$invalid}">\n											<label class="control-label">{{\'APPLICATION_CONTEXT\' | translate}}<span class="required" aria-required="true">*</span></label>\n											<ui-select data-ng-model="application.appdata[0]" data-ng-init="application.appdata[0] = null" name="context" theme="bootstrap" required>\n												<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n												<ui-select-choices repeat="context.name as context in items | filter: $select.search">\n													<div ng-bind-html="context.name | highlight: $select.search"></div>\n												</ui-select-choices>\n											</ui-select>\n											<span data-ng-show="(forms.settings.context.$touched || forms.settings.$submitted) && forms.settings.context.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END CONTEXT -->\n\n										<!-- START EXTENSION -->\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.extension.$touched || forms.settings.$submitted) && forms.settings.extension.$invalid}">\n											<label class="control-label">{{ \'APPLICATION_EXTENSION\' | translate }}<span class="required" aria-required="true">*</span></label>\n											<input type="text" name="extension" placeholder="" class="form-control" data-ng-model="application.appdata[1]" data-ng-init="application.appdata[1] = null" required>\n											<span data-ng-show="(forms.settings.extension.$touched || forms.settings.$submitted) && forms.settings.extension.$invalid && forms.settings.extension.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END EXTENSION -->\n\n										<!-- START PRIORITY -->\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.priority.$touched || forms.settings.$submitted) && forms.settings.priority.$invalid}">\n											<label class="control-label">{{ \'APPLICATION_PRIORITY\' | translate }}<span class="required" aria-required="true">*</span></label>\n											<input type="text" pattern="[0-9]+" name="priority" placeholder="" class="form-control" data-ng-model="application.appdata[2]" data-ng-init="application.appdata[2] = null" required>\n											<span data-ng-show="(forms.settings.priority.$touched || forms.settings.$submitted) && forms.settings.priority.$invalid" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END PRIORITY -->\n									</div>\n									<div id="Hangup" class="app-settings" ng-slide-down="main.app == \'Hangup\'" lazy-render duration="1">\n										<!-- START HANGUPCAUSE -->\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.hangupCause.$touched || forms.settings.$submitted) && forms.settings.hangupCause.$invalid}">\n											<label class="control-label">{{\'APPLICATION_HANGUP_CAUSE\' | translate}}<span class="required" aria-required="true">*</span></label>\n											<ui-select data-ng-model="application.appdata[0]" data-ng-init="application.appdata[0] = null" theme="bootstrap" name="hangupCause" required>\n												<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name | translate}}</ui-select-match>\n												<ui-select-choices repeat="hangupCause.value as hangupCause in $application.hangupCauses | filter: $select.search">\n													<div ng-bind-html="hangupCause.name  | translate | highlight: $select.search"></div>\n												</ui-select-choices>\n											</ui-select>\n											<span data-ng-show="(forms.settings.hangupCause.$touched || forms.settings.$submitted) && forms.settings.hangupCause.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END HANGUPCAUSE -->\n									</div>\n									<div id="Set" class="app-settings" ng-slide-down="main.app == \'Set\'" lazy-render duration="1">\n										<!-- START VARIABLE -->\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.variable.$touched || forms.settings.$submitted) && forms.settings.variable.$invalid}">\n											<label class="control-label">{{ \'APPLICATION_VARIABLE\' | translate }}<span class="required" aria-required="true">*</span></label>\n											<input type="text" name="variable" placeholder="" class="form-control" data-ng-model="application.variable" data-ng-init="application.appdata[0] = null" data-ng-change="updateSetAppdata()" required>\n											<span data-ng-show="(forms.settings.variable.$touched || forms.settings.$submitted) && forms.settings.variable.$invalid && forms.settings.variable.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END VARIABLE -->\n\n										<!-- START VARVALUE -->\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.varvalue.$touched || forms.settings.$submitted) && forms.settings.varvalue.$invalid}">\n											<label class="control-label">{{ \'APPLICATION_VALUE\' | translate }}<span class="required" aria-required="true">*</span></label>\n											<input type="text" name="varvalue" placeholder="" class="form-control" data-ng-model="application.value" data-ng-change="updateSetAppdata()" required>\n											<span data-ng-show="(forms.settings.varvalue.$touched || forms.settings.$submitted) && forms.settings.varvalue.$invalid && forms.settings.varvalue.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END VARVALUE -->\n									</div>\n									<div id="Custom" class="app-settings" ng-slide-down="main.app == \'custom\'" lazy-render duration="1">\n\n										<!-- START CUSTOMAPP -->\n										<div class="form-group"  data-ng-class="{\'has-error\': (forms.settings.customApp.$touched || forms.settings.$submitted) && forms.settings.customApp.$invalid}">\n											<label class="control-label">{{ \'APPLICATION_CUSTOM_APP\' | translate }}<span class="required" aria-required="true">*</span></label>\n											<input type="text" name="customApp" placeholder="{{ \'APPLICATION_CUSTOM_APP\' | translate }}" class="form-control" data-ng-model="application.app" required>\n											<span data-ng-show="(forms.settings.customApp.$touched || forms.settings.$submitted) && forms.settings.customApp.$invalid && forms.settings.customApp.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END CUSTOMAPP -->\n\n										<!-- START APPDATA -->\n										<div class="form-group"  data-ng-class="{\'has-error\': (forms.settings.appdata.$touched || forms.settings.$submitted) && forms.settings.appdata.$invalid}">\n											<label class="control-label">{{ \'APPLICATION_ARGUMENTS\' | translate }}</label>\n											<input type="text" name="appdata" placeholder="{{ \'APPLICATION_ARGUMENTS\' | translate }}" class="form-control" data-ng-model="application.appdata[0]" data-ng-init="application.appdata[0] = null">\n											<span data-ng-show="(forms.settings.appdata.$touched || forms.settings.$submitted) && forms.settings.appdata.$invalid && forms.settings.appdata.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END APPDATA -->\n									</div>\n									<div id="Voicemail" class="app-settings" ng-slide-down="main.app == \'Voicemail\'" lazy-render duration="1">\n										<!-- START VOICEMAIL -->\n										<div class="form-group"  data-ng-class="{\'has-error\': (forms.settings.voicemail.$touched || forms.settings.$submitted) && forms.settings.voicemail.$invalid}">\n											<label class="control-label">{{ \'APPLICATION_MAILBOX\' | translate }}@{{ \'APPLICATION_CONTEXT\' | translate }}<span class="required" aria-required="true">*</span></label>\n											<ui-select data-ng-model="application.appdata[0]" data-ng-init="application.appdata[0] = null" theme="bootstrap" name="voicemail" required data-ng-disabled="!items.length">\n												<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.mailbox}}</ui-select-match>\n												<ui-select-choices repeat="mailbox.mailbox+\'@\'+mailbox.context as mailbox in items | filter: $select.search">\n													<div ng-bind-html="mailbox.mailbox | highlight: $select.search"></div>\n												</ui-select-choices>\n											</ui-select>\n											<div class="note note-warning" data-ng-hide="items.length">\n												<h4 class="block">Warning!</h4>\n												<p>\n													{{ \'MESSAGE_NO_VOICEMAILS_AVAILABLE\' | translate }}\n												</p>\n												<p>\n													{{\'APPLICATION_GO_TO\' | translate}} <a href="/channels/voice/voicemails/list">{{\'APPLICATION_VOICEMAILS\' | translate}}</a>\n												</p>\n											</div>\n											<span data-ng-show="(forms.settings.voicemail.$touched || forms.settings.$submitted) && forms.settings.voicemail.$invalid && forms.settings.voicemail.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END VOICEMAIL -->\n									</div>\n									<button class="btn green-haze" type="submit" ng-click="goNext()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n								</form>\n								</wz-step>\n									<wz-step title="{{\'APPLICATION_INTERVAL\' | translate}}" canexit="formValidation(forms.interval.IntervalId.$valid || forms.interval.hasOwnProperty(\'t_from\') || forms.interval.intType.$modelValue === \'always\')">\n										<form name="forms.interval" novalidate>\n										<button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n										<button class="btn green-haze" type="submit" ng-click="goNext()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n									<!-- START INTERVAL_TYPE -->\n									<div class="form-group" data-ng-class="{\'has-error\': (forms.interval.intType.$touched || forms.interval.$submitted) && forms.interval.intType.$invalid}">\n										<label class="control-label">{{\'APPLICATION_INTERVAL_TYPE\' | translate}}<span class="required" aria-required="true">*</span></label>\n										<ui-select data-ng-model="interval.intType" theme="bootstrap" name="intType" required>\n											<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name | translate}}</ui-select-match>\n											<ui-select-choices repeat="intType.value as intType in $application.intTypes | filter: $select.search">\n												<div ng-bind-html="intType.name | translate | highlight: $select.search"></div>\n											</ui-select-choices>\n										</ui-select>\n										<span data-ng-show="(forms.interval.intType.$touched || forms.interval.$submitted) && forms.interval.intType.$error.required" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<!-- END INTERVAL_TYPE -->\n									<div id="customInterval" class="app-settings" ng-slide-down="interval.intType == \'custom\'" lazy-render duration="1">\n											<!-- START TIME -->\n											<div class="form-group">\n												<label class="control-label">{{ \'APPLICATION_TIME\' | translate }}</label>\n												<div class="input-group input-large">\n													<fieldset class="pull-left" ng-disabled="interval.alwaysTime"><uib-timepicker name="t_from" data-ng-model="interval.t_from" show-meridian="false" show-spinners="false"></uib-timepicker></fieldset>\n													<div class="input-group-addon col-md-1 interval-to pull-left">to</div>\n													<fieldset ng-disabled="interval.alwaysTime"><uib-timepicker  name="t_to" data-ng-model="interval.t_to" show-meridian="false" show-spinners="false"></uib-timepicker></fieldset>\n													<label class="control-label pointer-cursor"><input type="checkbox" data-ng-model="interval.alwaysTime">{{\'APPLICATION_ALWAYS\' | translate}}</label>\n												</div>\n											</div>\n											<!-- END TIME -->\n\n											<!-- START WEEKDAY -->\n											<div class="form-group">\n												<label class="control-label">{{ \'APPLICATION_WEEKDAY\' | translate }}</label>\n												<div class="input-group input-large">\n													<ui-select data-ng-model="interval.wd_from" theme="bootstrap" name="wd_from">\n														<ui-select-match placeholder="">{{$translate.instant($select.selected.name)}}</ui-select-match>\n														<ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n															{{$translate.instant(weekDay.name)}}\n														</ui-select-choices>\n													</ui-select>\n													<span class="input-group-addon">to</span>\n													<ui-select data-ng-model="interval.wd_to" theme="bootstrap" name="wd_to">\n														<ui-select-match placeholder="">{{$translate.instant($select.selected.name)}}</ui-select-match>\n														<ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n															{{$translate.instant(weekDay.name)}}\n														</ui-select-choices>\n													</ui-select>\n												</div>\n											</div>\n											<!-- END WEEKDAY -->\n\n											<!-- START MONTHDAY -->\n											<div class="form-group">\n												<label class="control-label">{{ \'APPLICATION_MONTHDAY\' | translate }}</label>\n												<div class="input-group input-large">\n													<ui-select data-ng-model="interval.md_from" theme="bootstrap" name="md_from">\n														<ui-select-match>{{$select.selected}}</ui-select-match>\n														<ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n															{{monthDay}}\n														</ui-select-choices>\n													</ui-select>\n													<span class="input-group-addon">to</span>\n													<ui-select data-ng-model="interval.md_to" theme="bootstrap" name="md_to">\n														<ui-select-match>{{$select.selected}}</ui-select-match>\n														<ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n															{{monthDay}}\n														</ui-select-choices>\n													</ui-select>\n												</div>\n											</div>\n											<!-- END MONTHDAY -->\n\n											<!-- START MONTH -->\n											<div class="form-group">\n												<label class="control-label">{{ \'APPLICATION_MONTH\' | translate }}</label>\n												<div class="input-group input-large">\n													<ui-select data-ng-model="interval.m_from" theme="bootstrap" name="m_from">\n														<ui-select-match placeholder="">{{$translate.instant($select.selected.name)}}</ui-select-match>\n														<ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n															{{$translate.instant(month.name)}}\n														</ui-select-choices>\n													</ui-select>\n													<span class="input-group-addon">to</span>\n													<ui-select data-ng-model="interval.m_to" theme="bootstrap" name="m_to">\n														<ui-select-match placeholder="">{{$translate.instant($select.selected.name)}}</ui-select-match>\n														<ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n															{{$translate.instant(month.name)}}\n														</ui-select-choices>\n													</ui-select>\n												</div>\n											</div>\n											<!-- END MONTH -->\n							</div>\n\n							<div id="customInterval" class="app-settings" ng-slide-down="interval.intType == \'list\'" lazy-render duration="1">\n\n								<!-- START INTERVALS -->\n								<div class="form-group" data-ng-class="{\'has-error\': (forms.interval.IntervalId.$touched || forms.interval.$submitted) && forms.interval.IntervalId.$invalid}">\n									<label class="control-label">{{\'APPLICATION_INTERVALS\' | translate}}<span class="required" aria-required="true">*</span></label>\n									<ui-select data-ng-model="interval.IntervalId" theme="bootstrap" name="IntervalId" required>\n										<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$translate.instant($select.selected.name)}}</ui-select-match>\n										<ui-select-choices repeat="interval.id as interval in Intervals | filter: $select.search">\n											{{$translate.instant(interval.name)}}\n										</ui-select-choices>\n									</ui-select>\n									<span data-ng-show="(forms.interval.IntervalId.$touched || forms.interval.$submitted) && forms.interval.IntervalId.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END INTERVALS -->\n\n							</div>\n								<button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n								<button class="btn green-haze" type="submit" ng-click="goNext()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n							</form>\n						</wz-step>\n\n						<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n							<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n							<button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n							<input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n						</wz-step>\n				</wizard>\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n<!-- <pre>\n	{{application | json}}\n</pre>\n<pre>\n	{{interval | json}}\n</pre> -->\n'),
+a.put("app/channels/voice/route/view.applicationSettings.html",'\n<div class="row" data-ng-init="initApplication();getIntervals();getApplication();">\n	<div class="col-md-12">\n		<!-- BEGIN  PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-notebook font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_APPLICATION_SETTINGS\' | translate }} WIZARD</a> </span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<wizard on-finish="updateRoute(\'applications\')">\n					<div class="profile-usertitle-name">\n						{{(main.app | capitalize) || \'Application\'}}\n					</div>\n	        <wz-step title="{{\'APPLICATION_APPLICATION\' | translate}}" canexit="formValidation(forms.settings.$valid)">\n							<form name="forms.settings" novalidate>\n\n								<button class="btn green-haze" type="submit" ng-click="goNext()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n								<div id="Queue" class="app-settings" ng-slide-down="main.app == \'Queue\'" lazy-render duration="1">\n									<!-- START QUEUE -->\n									<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.queue.$touched || forms.settings.$submitted) && forms.settings.queue.$invalid}">\n										<label class="control-label">{{\'APPLICATION_QUEUE\' | translate}}<span class="required" aria-required="true">*</span></label>\n										<ui-select data-ng-model="route.Applications[selectedApp].appdata[0]" name="queue" theme="bootstrap" required data-ng-disabled="!items.length">\n											<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n											<ui-select-choices repeat="queue.name as queue in items | filter: $select.search">\n												<div ng-bind-html="queue.name | highlight: $select.search"></div>\n											</ui-select-choices>\n										</ui-select>\n										<div class="note note-warning" data-ng-hide="items.length">\n											<h4 class="block">Warning!</h4>\n											<p>\n												{{ \'MESSAGE_NO_QUEUES_AVAILABLE\' | translate }}\n											</p>\n											<p>\n												{{\'APPLICATION_GO_TO\' | translate}} <a href="/channels/voice/queues/list">{{\'APPLICATION_QUEUES\' | translate}}</a>\n											</p>\n										</div>\n										<span data-ng-show="(forms.settings.queue.$touched || forms.settings.$submitted) && forms.settings.queue.$error.required" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<!-- END QUEUE -->\n\n									<!-- START OPTIONS -->\n									<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.app_options.$touched || forms.settings.$submitted) && forms.settings.app_options.$invalid}">\n										<label class="control-label">{{\'APPLICATION_OPTIONS\' | translate}}</label>\n										<ui-select multiple data-ng-model="route.Applications[selectedApp].appdata[1]" theme="bootstrap" name="app_options">\n											<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$translate.instant($item.name)}}</ui-select-match>\n											<ui-select-choices repeat="queueOpt.value as queueOpt in $application.queueOptions | filter: $select.search">\n												{{$translate.instant(queueOpt.name)}}\n											</ui-select-choices>\n										</ui-select>\n										<span data-ng-show="(forms.settings.app_options.$touched || forms.settings.$submitted) && forms.settings.app_options.$error.required" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<!-- END OPTIONS -->\n\n									<!-- START URL -->\n									<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.url.$touched || forms.settings.$submitted) && forms.settings.url.$invalid}">\n										<label class="control-label">{{ \'APPLICATION_URL\' | translate }}</label>\n										<input type="text" name="url" placeholder="{{ \'APPLICATION_URL\' | translate }}" class="form-control" data-ng-model="route.Applications[selectedApp].appdata[2]">\n										<span data-ng-show="(forms.settings.url.$touched || forms.settings.$submitted) && forms.settings.url.$invalid && forms.settings.url.$error.required" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<!-- END URL -->\n\n									<!-- START AUDIOFILE -->\n									<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.audiofile.$touched || forms.settings.$submitted) && forms.settings.audiofile.$invalid}">\n										<label class="control-label">{{\'APPLICATION_AUDIO_FILE\' | translate}}</label>\n										<ui-select data-ng-model="route.Applications[selectedApp].appdata[3]" name="audiofile" theme="bootstrap" data-ng-disabled="!items2.length">\n											<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n											<ui-select-choices repeat="soundPath+\'/\'+audio.save_name as audio in items2 | filter: $select.search">\n												<div ng-bind-html="audio.display_name | highlight: $select.search"></div>\n											</ui-select-choices>\n										</ui-select>\n										<div class="note note-warning" data-ng-hide="items2.length">\n											<h4 class="block">Warning!</h4>\n											<p>\n												{{ \'MESSAGE_NO_SOUNDS_AVAILABLE\' | translate }}\n											</p>\n											<p>\n												{{\'APPLICATION_GO_TO\' | translate}} <a href="/tools/sounds/list">{{\'APPLICATION_SOUNDS\' | translate}}</a>\n											</p>\n										</div>\n										<span data-ng-show="(forms.settings.audiofile.$touched || forms.settings.$submitted) && forms.settings.audiofile.$error.required" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<!-- END AUDIOFILE -->\n\n									<!-- START TIMEOUT -->\n									<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid}">\n										<label class="control-label">{{ \'APPLICATION_TIMEOUT\' | translate }}</label>\n										<input type="text" pattern="[0-9]+" name="timeout" placeholder="" class="form-control" data-ng-model="route.Applications[selectedApp].appdata[4]">\n										<span data-ng-show="(forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid && forms.settings.timeout.$error.required" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<!-- END TIMEOUT -->\n\n								</div>\n								<div id="Playback" class="app-settings" ng-slide-down="main.app == \'Playback\'" lazy-render duration="1">\n									<!-- START AUDIOFILE -->\n									<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.audiofile.$touched || forms.settings.$submitted) && forms.settings.audiofile.$invalid}">\n										<label class="control-label">{{\'APPLICATION_AUDIO_FILE\' | translate}}<span class="required" aria-required="true">*</span></label>\n										<ui-select data-ng-model="route.Applications[selectedApp].appdata[0]" name="audiofile" theme="bootstrap" required data-ng-disabled="!items.length">\n											<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n											<ui-select-choices repeat="soundPath+\'/\'+audio.save_name as audio in items | filter: $select.search">\n												<div ng-bind-html="audio.display_name | highlight: $select.search"></div>\n											</ui-select-choices>\n										</ui-select>\n										<div class="note note-warning" data-ng-hide="items.length">\n											<h4 class="block">Warning!</h4>\n											<p>\n												{{ \'MESSAGE_NO_SOUNDS_AVAILABLE\' | translate }}\n											</p>\n											<p>\n												{{\'APPLICATION_GO_TO\' | translate}} <a href="/tools/sounds/list">{{\'APPLICATION_SOUNDS\' | translate}}</a>\n											</p>\n										</div>\n										<span data-ng-show="(forms.settings.audiofile.$touched || forms.settings.$submitted) && forms.settings.audiofile.$error.required" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<!-- END AUDIOFILE -->\n\n									<!-- START OPTIONS -->\n									<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.app_options.$touched || forms.settings.$submitted) && forms.settings.app_options.$invalid}">\n										<label class="control-label">{{\'APPLICATION_OPTIONS\' | translate}}</label>\n										<ui-select data-ng-model="route.Applications[selectedApp].appdata[1]" theme="bootstrap" name="app_options">\n											<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$translate.instant($select.selected.name)}}</ui-select-match>\n											<ui-select-choices repeat="audioOpt.value as audioOpt in $application.audioOptions | filter: $select.search">\n												{{$translate.instant(audioOpt.name)}}\n											</ui-select-choices>\n										</ui-select>\n										<span data-ng-show="(forms.settings.app_options.$touched || forms.settings.$submitted) && forms.settings.app_options.$error.required" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<!-- END OPTIONS -->\n								</div>\n								<div id="Dial" class="app-settings" ng-slide-down="main.app == \'Dial\'" lazy-render duration="1">\n									<!-- START INTERFACE -->\n									<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.interface.$touched || forms.settings.$submitted) && forms.settings.interface.$invalid}">\n										<label class="control-label">{{ \'APPLICATION_TYPE\' | translate }}/{{ \'APPLICATION_IDENTIFIER\' | translate }}<span class="required" aria-required="true">*</span></label>\n										<input type="text" name="interface" placeholder="SIP/0000" class="form-control" data-ng-model="route.Applications[selectedApp].appdata[0]" required>\n										<span data-ng-show="(forms.settings.interface.$touched || forms.settings.$submitted) && forms.settings.interface.$invalid && forms.settings.interface.$error.required" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<!-- END INTERFACE -->\n\n									<!-- START TIMEOUT -->\n									<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid}">\n										<label class="control-label">{{ \'APPLICATION_TIMEOUT\' | translate }}</label>\n										<input type="text" pattern="[0-9]+" name="timeout" placeholder="" class="form-control" data-ng-model="route.Applications[selectedApp].appdata[1]">\n										<span data-ng-show="(forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid && forms.settings.timeout.$error.required" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<!-- END TIMEOUT -->\n\n									<!-- START OPTIONS -->\n									<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.app_options.$touched || forms.settings.$submitted) && forms.settings.app_options.$invalid}">\n										<label class="control-label">{{ \'APPLICATION_OPTIONS\' | translate }}</label>\n										<input type="text" name="app_options" placeholder="" class="form-control" data-ng-model="route.Applications[selectedApp].appdata[2]">\n										<span data-ng-show="(forms.settings.app_options.$touched || forms.settings.$submitted) && forms.settings.app_options.$invalid && forms.settings.app_options.$error.required" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<!-- END OPTIONS -->\n\n									<!-- START URL -->\n									<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.url.$touched || forms.settings.$submitted) && forms.settings.url.$invalid}">\n										<label class="control-label">{{ \'APPLICATION_URL\' | translate }}</label>\n										<input type="text" name="url" placeholder="{{ \'APPLICATION_URL\' | translate }}" class="form-control" data-ng-model="route.Applications[selectedApp].appdata[3]">\n										<span data-ng-show="(forms.settings.url.$touched || forms.settings.$submitted) && forms.settings.url.$invalid && forms.settings.url.$error.required" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<!-- END URL -->\n								</div>\n								<div id="AGI" class="app-settings" ng-slide-down="main.app == \'AGI\'" lazy-render duration="1">\n									<!-- START PROJECT -->\n									<input type="hidden" name="url" placeholder="{{ \'APPLICATION_URL\' | translate }}" class="form-control" data-ng-model="route.Applications[selectedApp].appdata[0]" data-ng-init="route.Applications[selectedApp].appdata[0] = \'agi://127.0.0.1/square\'">\n									<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.project.$touched || forms.settings.$submitted) && forms.settings.project.$invalid}">\n										<label class="control-label">{{\'APPLICATION_PROJECT\' | translate}}<span class="required" aria-required="true">*</span></label>\n										<ui-select data-ng-model="route.Applications[selectedApp].appdata[1]" name="project" theme="bootstrap" required data-ng-disabled="!items.length">\n											<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n											<ui-select-choices repeat="project.name as project in items | filter: $select.search">\n												<div ng-bind-html="project.name | highlight: $select.search"></div>\n											</ui-select-choices>\n										</ui-select>\n										<div class="note note-warning" data-ng-hide="items.length">\n											<h4 class="block">Warning!</h4>\n											<p>\n												{{ \'MESSAGE_NO_PROJECTS_AVAILABLE\' | translate }}\n											</p>\n											<p>\n												{{\'APPLICATION_GO_TO\' | translate}} <a href="/square/projects/list">{{\'APPLICATION_PROJECTS\' | translate}}</a>\n											</p>\n										</div>\n										<span data-ng-show="(forms.settings.project.$touched || forms.settings.$submitted) && forms.settings.project.$error.required" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<!-- END PROJECT -->\n\n									<!-- START URL -->\n									<!-- <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.url.$touched || forms.settings.$submitted) && forms.settings.url.$invalid}">\n										<label class="control-label">{{ \'APPLICATION_URL\' | translate }}</label>\n										<div class="input-group">\n											<input type="text" name="url" placeholder="agi://127.0.0.1/square" class="form-control" data-ng-model="application.url" data-ng-disabled="!application.urlEnabled" data-ng-required="application.urlEnabled" rpattern="/^agi:\\/\\/(?:[0-9]{1,3}\\.){3}[0-9]{1,3}\\/square$/">\n											<span class="input-group-addon">\n												<input type="checkbox" data-ng-model="application.urlEnabled">\n											</span>\n										</div>\n										<span data-ng-show="(forms.settings.url.$touched || forms.settings.$submitted) && forms.settings.url.$invalid && forms.settings.url.$error.required" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n										<span data-ng-show="(forms.settings.url.$touched || forms.settings.$submitted) && forms.settings.url.$invalid && forms.settings.url.$error.pattern" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_WRONG_FORMAT\' | translate}}.\n										</span>\n									</div> -->\n									<!-- END URL -->\n\n								</div>\n								<div id="Goto" class="app-settings" ng-slide-down="main.app == \'Goto\'" lazy-render duration="1">\n									<!-- START CONTEXT -->\n									<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.context.$touched || forms.settings.$submitted) && forms.settings.context.$invalid}">\n										<label class="control-label">{{\'APPLICATION_CONTEXT\' | translate}}<span class="required" aria-required="true">*</span></label>\n										<ui-select data-ng-model="route.Applications[selectedApp].appdata[0]" name="context" theme="bootstrap" required>\n											<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n											<ui-select-choices repeat="context.name as context in items | filter: $select.search">\n												<div ng-bind-html="context.name | highlight: $select.search"></div>\n											</ui-select-choices>\n										</ui-select>\n										<span data-ng-show="(forms.settings.context.$touched || forms.settings.$submitted) && forms.settings.context.$error.required" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<!-- END CONTEXT -->\n\n									<!-- START EXTENSION -->\n									<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.extension.$touched || forms.settings.$submitted) && forms.settings.extension.$invalid}">\n										<label class="control-label">{{ \'APPLICATION_EXTENSION\' | translate }}<span class="required" aria-required="true">*</span></label>\n										<input type="text" name="extension" placeholder="" class="form-control" data-ng-model="route.Applications[selectedApp].appdata[1]" required>\n										<span data-ng-show="(forms.settings.extension.$touched || forms.settings.$submitted) && forms.settings.extension.$invalid && forms.settings.extension.$error.required" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<!-- END EXTENSION -->\n\n									<!-- START PRIORITY -->\n									<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.priority.$touched || forms.settings.$submitted) && forms.settings.priority.$invalid}">\n										<label class="control-label">{{ \'APPLICATION_PRIORITY\' | translate }}<span class="required" aria-required="true">*</span></label>\n										<input type="text" pattern="[0-9]+" name="priority" placeholder="" class="form-control" data-ng-model="route.Applications[selectedApp].appdata[2]" required>\n										<span data-ng-show="(forms.settings.priority.$touched || forms.settings.$submitted) && forms.settings.priority.$invalid" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<!-- END PRIORITY -->\n								</div>\n								<div id="Hangup" class="app-settings" ng-slide-down="main.app == \'Hangup\'" lazy-render duration="1">\n									<!-- START HANGUPCAUSE -->\n									<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.hangupCause.$touched || forms.settings.$submitted) && forms.settings.hangupCause.$invalid}">\n										<label class="control-label">{{\'APPLICATION_HANGUP_CAUSE\' | translate}}<span class="required" aria-required="true">*</span></label>\n										<ui-select data-ng-model="route.Applications[selectedApp].appdata[0]" theme="bootstrap" name="hangupCause" required>\n											<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$translate.instant($select.selected.name)}}</ui-select-match>\n											<ui-select-choices repeat="hangupCause.value as hangupCause in $application.hangupCauses | filter: $select.search">\n												{{$translate.instant(hangupCause.name)}}\n											</ui-select-choices>\n										</ui-select>\n										<span data-ng-show="(forms.settings.hangupCause.$touched || forms.settings.$submitted) && forms.settings.hangupCause.$error.required" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<!-- END HANGUPCAUSE -->\n								</div>\n								<div id="Set" class="app-settings" ng-slide-down="main.app == \'Set\'" lazy-render duration="1">\n									<!-- START VARIABLE -->\n									<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.variable.$touched || forms.settings.$submitted) && forms.settings.variable.$invalid}">\n										<label class="control-label">{{ \'APPLICATION_VARIABLE\' | translate }}<span class="required" aria-required="true">*</span></label>\n										<input type="text" name="variable" placeholder="" class="form-control" data-ng-model="application.variable" data-ng-change="updateSetAppdataSettings()" required>\n										<span data-ng-show="(forms.settings.variable.$touched || forms.settings.$submitted) && forms.settings.variable.$invalid && forms.settings.variable.$error.required" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<!-- END VARIABLE -->\n\n									<!-- START VARVALUE -->\n									<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.varvalue.$touched || forms.settings.$submitted) && forms.settings.varvalue.$invalid}">\n										<label class="control-label">{{ \'APPLICATION_VALUE\' | translate }}<span class="required" aria-required="true">*</span></label>\n										<input type="text" name="varvalue" placeholder="" class="form-control" data-ng-model="application.value" data-ng-change="updateSetAppdataSettings()" required>\n										<span data-ng-show="(forms.settings.varvalue.$touched || forms.settings.$submitted) && forms.settings.varvalue.$invalid && forms.settings.varvalue.$error.required" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<!-- END VARVALUE -->\n								</div>\n								<div id="Custom" class="app-settings" ng-slide-down="main.app == \'custom\'" lazy-render duration="1">\n\n									<!-- START CUSTOMAPP -->\n									<div class="form-group"  data-ng-class="{\'has-error\': (forms.settings.customApp.$touched || forms.settings.$submitted) && forms.settings.customApp.$invalid}">\n										<label class="control-label">{{ \'APPLICATION_CUSTOM_APP\' | translate }}<span class="required" aria-required="true">*</span></label>\n										<input type="text" name="customApp" placeholder="{{ \'APPLICATION_CUSTOM_APP\' | translate }}" class="form-control" data-ng-model="route.Applications[selectedApp].app" required>\n										<span data-ng-show="(forms.settings.customApp.$touched || forms.settings.$submitted) && forms.settings.customApp.$invalid && forms.settings.customApp.$error.required" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<!-- END CUSTOMAPP -->\n\n									<!-- START APPDATA -->\n									<div class="form-group"  data-ng-class="{\'has-error\': (forms.settings.appdata.$touched || forms.settings.$submitted) && forms.settings.appdata.$invalid}">\n										<label class="control-label">{{ \'APPLICATION_ARGUMENTS\' | translate }}</label>\n										<input type="text" name="appdata" placeholder="{{ \'APPLICATION_ARGUMENTS\' | translate }}" class="form-control" data-ng-model="route.Applications[selectedApp].appdata[0]">\n										<span data-ng-show="(forms.settings.appdata.$touched || forms.settings.$submitted) && forms.settings.appdata.$invalid && forms.settings.appdata.$error.required" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<!-- END APPDATA -->\n								</div>\n								<div id="Voicemail" class="app-settings" ng-slide-down="main.app == \'Voicemail\'" lazy-render duration="1">\n									<!-- START VOICEMAIL -->\n									<div class="form-group"  data-ng-class="{\'has-error\': (forms.settings.voicemail.$touched || forms.settings.$submitted) && forms.settings.voicemail.$invalid}">\n										<label class="control-label">{{ \'APPLICATION_MAILBOX\' | translate }}@{{ \'APPLICATION_CONTEXT\' | translate }}<span class="required" aria-required="true">*</span></label>\n										<ui-select data-ng-model="route.Applications[selectedApp].appdata[0]" theme="bootstrap" name="voicemail" required data-ng-disabled="!items.length">\n											<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.mailbox}}</ui-select-match>\n											<ui-select-choices repeat="mailbox.mailbox+\'@\'+mailbox.context as mailbox in items | filter: $select.search">\n												<div ng-bind-html="mailbox.mailbox | highlight: $select.search"></div>\n											</ui-select-choices>\n										</ui-select>\n										<div class="note note-warning" data-ng-hide="items.length">\n											<h4 class="block">Warning!</h4>\n											<p>\n												{{ \'MESSAGE_NO_VOICEMAILS_AVAILABLE\' | translate }}\n											</p>\n											<p>\n												{{\'APPLICATION_GO_TO\' | translate}} <a href="/channels/voice/voicemails/list">{{\'APPLICATION_VOICEMAILS\' | translate}}</a>\n											</p>\n										</div>\n										<span data-ng-show="(forms.settings.voicemail.$touched || forms.settings.$submitted) && forms.settings.voicemail.$invalid && forms.settings.voicemail.$error.required" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<!-- END VOICEMAIL -->\n								</div>\n								<button class="btn green-haze" type="submit" ng-click="goNext()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n							</form>\n							</wz-step>\n								<wz-step title="{{\'APPLICATION_INTERVAL\' | translate}}" canexit="formValidation(forms.interval.IntervalId.$valid || forms.interval.hasOwnProperty(\'t_from\') || forms.interval.intType.$modelValue === \'always\')">\n									<form name="forms.interval" novalidate>\n										<button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n										<button class="btn green-haze" type="submit" ng-click="goNext()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n								<!-- START INTERVAL_TYPE -->\n								<div class="form-group" data-ng-class="{\'has-error\': (forms.interval.intType.$touched || forms.interval.$submitted) && forms.interval.intType.$invalid}">\n									<label class="control-label">{{\'APPLICATION_INTERVAL_TYPE\' | translate}}<span class="required" aria-required="true">*</span></label>\n									<ui-select data-ng-model="interval.intType" theme="bootstrap" name="intType" required>\n										<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$translate.instant($select.selected.name)}}</ui-select-match>\n										<ui-select-choices repeat="intType.value as intType in $application.intTypes | filter: $select.search">\n											{{$translate.instant(intType.name)}}\n										</ui-select-choices>\n									</ui-select>\n									<span data-ng-show="(forms.interval.intType.$touched || forms.interval.$submitted) && forms.interval.intType.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END INTERVAL_TYPE -->\n								<div id="customInterval" class="app-settings" ng-slide-down="interval.intType == \'custom\'" lazy-render duration="1">\n										<!-- START TIME -->\n										<div class="form-group">\n											<label class="control-label">{{ \'APPLICATION_TIME\' | translate }}</label>\n											<div class="input-group input-large">\n												<fieldset class="pull-left" ng-disabled="interval.alwaysTime"><uib-timepicker name="t_from" data-ng-model="interval.t_from" show-meridian="false" show-spinners="false"></uib-timepicker></fieldset>\n												<div class="input-group-addon col-md-1 interval-to pull-left">to</div>\n												<fieldset ng-disabled="interval.alwaysTime"><uib-timepicker  name="t_to" data-ng-model="interval.t_to" show-meridian="false" show-spinners="false"></uib-timepicker></fieldset>\n												<label class="control-label pointer-cursor"><input type="checkbox" data-ng-model="interval.alwaysTime">{{\'APPLICATION_ALWAYS\' | translate}}</label>\n											</div>\n											</div>\n										<!-- END TIME -->\n\n										<!-- START WEEKDAY -->\n										<div class="form-group">\n											<label class="control-label">{{ \'APPLICATION_WEEKDAY\' | translate }}</label>\n											<div class="input-group input-large">\n												<ui-select data-ng-model="interval.wd_from" theme="bootstrap" name="wd_from">\n													<ui-select-match placeholder="">{{$translate.instant($select.selected.name)}}</ui-select-match>\n													<ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n														{{$translate.instant(weekDay.name)}}\n													</ui-select-choices>\n												</ui-select>\n												<span class="input-group-addon">to</span>\n												<ui-select data-ng-model="interval.wd_to" theme="bootstrap" name="wd_to">\n													<ui-select-match placeholder="">{{$translate.instant($select.selected.name)}}</ui-select-match>\n													<ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n														{{$translate.instant(weekDay.name)}}\n													</ui-select-choices>\n												</ui-select>\n											</div>\n										</div>\n										<!-- END WEEKDAY -->\n\n										<!-- START MONTHDAY -->\n										<div class="form-group">\n											<label class="control-label">{{ \'APPLICATION_MONTHDAY\' | translate }}</label>\n											<div class="input-group input-large">\n												<ui-select data-ng-model="interval.md_from" theme="bootstrap" name="md_from">\n													<ui-select-match>{{$select.selected}}</ui-select-match>\n													<ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n														{{monthDay}}\n													</ui-select-choices>\n												</ui-select>\n												<span class="input-group-addon">to</span>\n												<ui-select data-ng-model="interval.md_to" theme="bootstrap" name="md_to">\n													<ui-select-match>{{$select.selected}}</ui-select-match>\n													<ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n														{{monthDay}}\n													</ui-select-choices>\n												</ui-select>\n											</div>\n										</div>\n										<!-- END MONTHDAY -->\n\n										<!-- START MONTH -->\n										<div class="form-group">\n											<label class="control-label">{{ \'APPLICATION_MONTH\' | translate }}</label>\n											<div class="input-group input-large">\n												<ui-select data-ng-model="interval.m_from" theme="bootstrap" name="m_from">\n													<ui-select-match placeholder="">{{$translate.instant($select.selected.name)}}</ui-select-match>\n													<ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n														{{$translate.instant(month.name)}}\n													</ui-select-choices>\n												</ui-select>\n												<span class="input-group-addon">to</span>\n												<ui-select data-ng-model="interval.m_to" theme="bootstrap" name="m_to">\n													<ui-select-match placeholder="">{{$translate.instant($select.selected.name)}}</ui-select-match>\n													<ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n														{{$translate.instant(month.name)}}\n													</ui-select-choices>\n												</ui-select>\n											</div>\n										</div>\n										<!-- END MONTH -->\n						</div>\n\n						<div id="customInterval" class="app-settings" ng-slide-down="interval.intType == \'list\'" lazy-render duration="1">\n\n							<!-- START INTERVALS -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.interval.IntervalId.$touched || forms.interval.$submitted) && forms.interval.IntervalId.$invalid}">\n								<label class="control-label">{{\'APPLICATION_INTERVALS\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="interval.IntervalId" theme="bootstrap" name="IntervalId" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$translate.instant($select.selected.name)}}</ui-select-match>\n									<ui-select-choices repeat="interval.id as interval in Intervals | filter: $select.search">\n										{{$translate.instant(interval.name)}}\n									</ui-select-choices>\n								</ui-select>\n								<span data-ng-show="(forms.interval.IntervalId.$touched || forms.interval.$submitted) && forms.interval.IntervalId.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END INTERVALS -->\n\n						</div>\n						<button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n						<button class="btn green-haze" type="submit" ng-click="goNext()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n							</form>\n						</wz-step>\n\n						<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n							<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n							<button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n							<input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n						</wz-step>\n				</wizard>\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),
+a.put("app/channels/voice/voicemail/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-puzzle"></i>\n					<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-envelope-letter"></i>\n					<a href="#">{{ \'APPLICATION_VOICEMAILS\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-envelope-letter font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_VOICEMAILS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<a class="btn green-jungle" href="/channels/voice/voicemails/wizard">\n						<i class="icon-plus"></i> {{ \'APPLICATION_NEW_VOICEMAIL\' | translate }}\n					</a>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/voice/voicemail/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getVoicemail()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-puzzle"></i>\n					<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-envelope-letter"></i>\n					<a href="/channels/voice/voicemails/list">{{ \'APPLICATION_VOICEMAILS\' | translate }}</a>\n					<i data-ng-show="voicemail" class="fa fa-angle-right"></i>\n				</li>\n				<li data-ng-show="voicemail">\n					<a href="#">{{voicemail.mailbox}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET main.channels -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/voicemail.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{voicemail.mailbox}}\n					</div>\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.channels.voice.voicemails.view.settings\')}">\n							<a data-ng-href="/channels/voice/voicemails/view/{{voicemail.uniqueid}}/settings"><i class="icon-settings"></i>{{ \'APPLICATION_SETTINGS\' | translate}} </a>\n						</li>\n						<li data-ng-class="{active: $state.is(\'main.channels.voice.voicemails.view.messages\')}">\n							<a data-ng-href="/channels/voice/voicemails/view/{{voicemail.uniqueid}}/messages"><i class="icon-speech"></i>{{ \'APPLICATION_MESSAGES\' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET main.channels -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/voice/voicemail/view/view.messages.html",'<div class="row" data-ng-init="getMessages()">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title  tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_MESSAGES\' | translate}}</span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns data-ng-if="gridOptions" ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/channels/voice/voicemail/view/view.settings.html",'<div class="row" data-ng-init="getContexts()">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_VOICEMAIL\' | translate}} {{ \'APPLICATION_SETTINGS\' | translate}} </span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_GENERAL\' | translate}}</a>\n					</li>\n					<!-- <li>\n						<a href="#" data-target="#tab_1_2" data-toggle="tab">{{ \'APPLICATION_ADVANCED\' | translate}}</a>\n					</li> -->\n				</ul>\n			</div>\n\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.general" data-ng-submit="forms.general.$valid && updateVoiceVoicemail()" novalidate>\n\n							<!-- START FULLNAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.general.$submitted && forms.general.fullname.$invalid}">\n								<label class="control-label">{{\'APPLICATION_FULLNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="fullname" placeholder="{{\'APPLICATION_FULLNAME\' | translate}}" class="form-control" data-ng-model="voicemail.fullname" required/>\n								<span data-ng-show="forms.general.$submitted && forms.general.fullname.$invalid" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END FULLNAME -->\n\n							<!-- START EMAIL -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.general.$submitted && forms.general.email.$invalid}">\n								<label class="control-label">{{\'APPLICATION_EMAIL\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="email" name="email" placeholder="{{\'APPLICATION_EMAIL\' | translate}}" class="form-control" data-ng-model="voicemail.email" required/>\n								<span data-ng-show="forms.general.$submitted && forms.general.host.$invalid" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END EMAIL -->\n\n							<!-- START PASSWORD -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.general.$submitted && forms.general.password.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NEW_PASSWORD\' | translate}}</label>\n								<input type="password" name="password" placeholder="{{\'APPLICATION_NEW_PASSWORD\' | translate}}" class="form-control" data-ng-model="voicemail.password" />\n								<span data-ng-show="forms.general.$submitted && forms.general.password.$invalid" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END PASSWORD -->\n\n							<!-- START CONFIRM PASSWORD -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.general.$submitted && forms.general.rpassword.$invalid}">\n								<label class="control-label">{{\'APPLICATION_CONFIRM_PASSWORD\' | translate}}</label>\n								<input type="password" name="rpassword" placeholder="{{\'APPLICATION_CONFIRM_PASSWORD\' | translate}}" class="form-control" data-ng-model="voicemail.rpassword" nx-equal="voicemail.password"/>\n								<span data-ng-show="forms.general.$submitted && (forms.general.rpassword.$invalid || forms.general.rpassword.$invalid)" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_WRONG_PASSWORD\' | translate}}.\n								</span>\n							</div>\n							<!-- END CONFIRM PASSWORD -->\n\n							<!-- START MAILBOX -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.general.$submitted && forms.general.mailbox.$invalid}">\n								<label class="control-label">{{\'APPLICATION_MAILBOX\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="mailbox" placeholder="{{\'APPLICATION_MAILBOX\' | translate}}" class="form-control" data-ng-model="voicemail.mailbox" required readonly/>\n								<span data-ng-show="forms.general.$submitted && forms.general.mailbox.$invalid" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END MAILBOX -->\n\n							<!-- START CONTEXT -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.context.$touched || forms.general.$submitted) && forms.general.context.$invalid}">\n								<label class="control-label">{{\'APPLICATION_CONTEXT\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="voicemail.context" name="context" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n									<ui-select-choices repeat="context.name as context in voiceContexts | filter: $select.search">\n										<div ng-bind-html="context.name | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_VOICE_CONTEXT\' | translate }}\n								</span>\n								<span data-ng-show="(forms.general.context.$touched || forms.general.$submitted) && forms.general.context.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END CONTEXT -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END GENERAL TAB -->\n					<!-- ADVANCED TAB -->\n					<!-- <div class="tab-pane" id="tab_1_2">\n						<form name="forms.advanced" data-ng-submit="updateVoiceVoicemail()" novalidate>\n\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div> -->\n					<!-- END ADVANCED TAB -->\n\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/channels/voice/voicemail/wizard/wizard.html",'<div class="col-md-12" data-ng-init="initWizard()">\n  <!-- BEGIN PAGE HEADER-->\n	<div class="page-bar">\n		<ul class="page-breadcrumb">\n			<li>\n				<i class="icon-rocket"></i>\n				<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n				<i class="fa fa-angle-right"></i>\n			</li>\n			<li>\n				<i class="icon-puzzle"></i>\n				<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n				<i class="fa fa-angle-right"></i>\n			</li>\n			<li>\n				<i class="icon-envelope-letter"></i>\n				<a href="/channels/voice/voicemails/list">{{ \'APPLICATION_VOICEMAILS\' | translate }}</a>\n				<i class="fa fa-angle-right"></i>\n			</li>\n			<li>\n				<i class="icon-options"></i>\n				<a href="#">{{ \'APPLICATION_WIZARD\' | translate }}</a>\n			</li>\n		</ul>\n	</div>\n  <!-- END PAGE HEADER-->\n\n  <!-- BEGIN PORTLET-->\n  <div class="portlet light bordered" data-ng-init="getFirstFreeMailbox()">\n  	<div class="portlet-title">\n  		<div class="caption font-green-sharp">\n  			<i class="icon-envelope-letter font-green-sharp"></i>\n  			<span class="caption-subject">{{ \'APPLICATION_VOICEMAIL\' | translate }} WIZARD</a> </span>\n  		</div>\n  	</div>\n  	<div class="portlet-body">\n  		<wizard on-finish="createItem()">\n				<wz-step title="{{\'APPLICATION_GENERAL\' | translate}}" canexit="exitValidation(form.general.$valid)">\n			    <form name="form.general" novalidate>\n\n						<!-- START FULLNAME -->\n						<div class="form-group" data-ng-class="{\'has-error\': form.general.$submitted && form.general.fullname.$invalid}">\n							<label class="control-label">{{\'APPLICATION_FULLNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n							<input type="text" name="fullname" placeholder="{{\'APPLICATION_FULLNAME\' | translate}}" class="form-control" data-ng-model="item.fullname" required/>\n							<span data-ng-show="form.general.$submitted && form.general.fullname.$invalid" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n						</div>\n						<!-- END FULLNAME -->\n\n						<!-- START EMAIL -->\n						<div class="form-group" data-ng-class="{\'has-error\': form.general.$submitted && form.general.email.$invalid}">\n							<label class="control-label">{{\'APPLICATION_EMAIL\' | translate}}<span class="required" aria-required="true">*</span></label>\n							<input type="email" name="email" placeholder="{{\'APPLICATION_EMAIL\' | translate}}" class="form-control" data-ng-model="item.email" required/>\n							<span data-ng-show="form.general.$submitted && form.general.host.$invalid" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n						</div>\n						<!-- END EMAIL -->\n\n						<!-- START PASSWORD -->\n						<div class="form-group" data-ng-class="{\'has-error\': form.general.$submitted && form.general.password.$invalid}">\n							<label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n							<input type="password" name="password" placeholder="{{\'APPLICATION_PASSWORD\' | translate}}" class="form-control" data-ng-model="item.password" required/>\n							<span data-ng-show="form.general.$submitted && form.general.password.$invalid" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n						</div>\n						<!-- END PASSWORD -->\n\n						<!-- START CONFIRM PASSWORD -->\n						<div class="form-group" data-ng-class="{\'has-error\': form.general.$submitted && form.general.rpassword.$invalid}">\n							<label class="control-label">{{\'APPLICATION_CONFIRM_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n							<input type="password" name="rpassword" placeholder="{{\'APPLICATION_CONFIRM_PASSWORD\' | translate}}" class="form-control" data-ng-model="item.rpassword" nx-equal="item.password" required/>\n							<span data-ng-show="form.general.$submitted && (form.general.rpassword.$invalid || form.general.rpassword.$invalid)" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_WRONG_PASSWORD\' | translate}}.\n							</span>\n						</div>\n						<!-- END CONFIRM PASSWORD -->\n\n						<!-- START MAILBOX -->\n						<div class="form-group" data-ng-class="{\'has-error\': form.general.$submitted && form.general.mailbox.$invalid}">\n							<label class="control-label">{{\'APPLICATION_MAILBOX\' | translate}}<span class="required" aria-required="true">*</span></label>\n							<input type="text" name="mailbox" placeholder="{{\'APPLICATION_MAILBOX\' | translate}}" class="form-control" data-ng-model="item.mailbox" required readonly/>\n							<span data-ng-show="form.general.$submitted && form.general.mailbox.$invalid" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n						</div>\n						<!-- END MAILBOX -->\n\n						<button class="btn green-haze" type="submit" ng-click="next()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n					</form>\n				</wz-step>\n\n				<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n					<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n					<button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n					<input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n				</wz-step>\n  		</wizard>\n  	</div>\n  </div>\n  <!-- END PORTLET-->\n</div>\n'),a.put("app/contactmanager/company/list/create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_COMPANY\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="forms.company" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (forms.company.name.$touched || forms.company.$submitted) && forms.company.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n      <span data-ng-show="(forms.cmopany.name.$touched || forms.company.$submitted) && forms.company.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n    </div>\n    <!-- END DESCRIPTION -->\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="ok()" ng-disabled="forms.company.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/contactmanager/company/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-briefcase"></i>\n					<a href="/contactmanager/companies/list">{{ \'APPLICATION_COMPANIES\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-briefcase font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_COMPANIES\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<button class="btn green-jungle " ng-click="create()">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_COMPANY\' | translate }}\n						</button>\n					</div>\n					<!-- <a class="btn btn-icon-only btn-default fullscreen" href="#"></a> -->\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/contactmanager/company/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getCompany()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-briefcase"></i>\n					<a href="/contactmanager/companies/list">{{ \'APPLICATION_COMPANIES\' | translate }}</a>\n					<i data-ng-show="company" class="fa fa-angle-right"></i>\n				</li>\n				<li data-ng-show="company">\n					<a href="#">{{company.name}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/company.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{company.name}}\n					</div>\n					<!-- <div class="profile-usertitle-job">\n						{{user.role}}\n					</div> -->\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.contactmanager.companies.view.settings\')}">\n							<a data-ng-href="/contactmanager/companies/view/{{company.id}}/settings">\n							<i class="icon-settings"></i>\n							{{ \'APPLICATION_SETTINGS\' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/contactmanager/company/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_COMPANY\' | translate}} {{ \'APPLICATION_SETTINGS\' | translate}} </span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_GENERAL\' | translate}}</a>\n					</li>\n					<li>\n						<a href="#" data-target="#tab_1_2" data-toggle="tab">{{ \'APPLICATION_ADDRESS\' | translate}}</a>\n					</li>\n					<li>\n						<a href="#" data-target="#tab_1_3" data-toggle="tab">{{ \'APPLICATION_SHIPMENT_ADDRESS\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.general" data-ng-submit="forms.general.$valid && updateCompany()" novalidate>\n\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="company.name" required/>\n								<span data-ng-show="(forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="company.description"></textarea>\n							</div>\n							<!-- END DESCRIPTION -->\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END ADVANCED TAB -->\n					<div class="tab-pane" id="tab_1_2">\n						<!-- START STREET -->\n						<div class="form-group" data-ng-class="{\'has-error\': (forms.general.street.$touched || forms.general.$submitted) && forms.general.street.$invalid}">\n							<label class="control-label">{{\'APPLICATION_STREET\' | translate}}</label>\n							<input type="text" name="street" placeholder="{{\'APPLICATION_STREET\' | translate}}" class="form-control" data-ng-model="company.street"/>\n							<span data-ng-show="(forms.general.street.$touched || forms.general.$submitted) && forms.general.street.$error.required" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n						</div>\n						<!-- END STREET -->\n\n						<!-- START POSTALCODE -->\n						<div class="form-group" data-ng-class="{\'has-error\': (forms.general.postalCode.$touched || forms.general.$submitted) && forms.general.postalCode.$invalid}">\n							<label class="control-label">{{\'APPLICATION_POSTALCODE\' | translate}}</label>\n							<input type="text" name="postalCode" placeholder="{{\'APPLICATION_POSTALCODE\' | translate}}" class="form-control" data-ng-model="company.postalCode"/>\n							<span data-ng-show="(forms.general.postalCode.$touched || forms.general.$submitted) && forms.general.postalCode.$error.required" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n						</div>\n						<!-- END POSTALCODE -->\n\n						<!-- START CITY -->\n						<div class="form-group" data-ng-class="{\'has-error\': (forms.general.city.$touched || forms.general.$submitted) && forms.general.city.$invalid}">\n							<label class="control-label">{{\'APPLICATION_CITY\' | translate}}</label>\n							<input type="text" name="city" placeholder="{{\'APPLICATION_CITY\' | translate}}" class="form-control" data-ng-model="company.city"/>\n							<span data-ng-show="(forms.general.city.$touched || forms.general.$submitted) && forms.general.city.$error.required" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n						</div>\n						<!-- END CITY -->\n						<!-- START COUNTRY -->\n						<div class="form-group" data-ng-class="{\'has-error\': (forms.general.country.$touched || forms.general.$submitted) && forms.general.country.$invalid}">\n							<label class="control-label">{{\'APPLICATION_COUNTRY\' | translate}}</label>\n							<input type="text" name="country" placeholder="{{\'APPLICATION_COUNTRY\' | translate}}" class="form-control" data-ng-model="company.country"/>\n							<span data-ng-show="(forms.general.country.$touched || forms.general.$submitted) && forms.general.country.$error.required" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n						</div>\n						<!-- END COUNTRY -->\n						<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n					</div>\n					<div class="tab-pane" id="tab_1_3">\n						<!-- START STREET -->\n						<div class="form-group" data-ng-class="{\'has-error\': (forms.general.sStreet.$touched || forms.general.$submitted) && forms.general.sStreet.$invalid}">\n							<label class="control-label">{{\'APPLICATION_STREET\' | translate}}</label>\n							<input type="text" name="sStreet" placeholder="{{\'APPLICATION_STREET\' | translate}}" class="form-control" data-ng-model="company.sStreet"/>\n							<span data-ng-show="(forms.general.sStreet.$touched || forms.general.$submitted) && forms.general.sStreet.$error.required" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n						</div>\n						<!-- END STREET -->\n\n						<!-- START POSTALCODE -->\n						<div class="form-group" data-ng-class="{\'has-error\': (forms.general.sPostalCode.$touched || forms.general.$submitted) && forms.general.sPostalCode.$invalid}">\n							<label class="control-label">{{\'APPLICATION_POSTALCODE\' | translate}}</label>\n							<input type="text" name="sPostalCode" placeholder="{{\'APPLICATION_POSTALCODE\' | translate}}" class="form-control" data-ng-model="company.sPostalCode"/>\n							<span data-ng-show="(forms.general.sPostalCode.$touched || forms.general.$submitted) && forms.general.sPostalCode.$error.required" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n						</div>\n						<!-- END POSTALCODE -->\n\n						<!-- START CITY -->\n						<div class="form-group" data-ng-class="{\'has-error\': (forms.general.sCity.$touched || forms.general.$submitted) && forms.general.sCity.$invalid}">\n							<label class="control-label">{{\'APPLICATION_CITY\' | translate}}</label>\n							<input type="text" name="sCity" placeholder="{{\'APPLICATION_CITY\' | translate}}" class="form-control" data-ng-model="company.sCity"/>\n							<span data-ng-show="(forms.general.sCity.$touched || forms.general.$submitted) && forms.general.sCity.$error.required" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n						</div>\n						<!-- END CITY -->\n						<!-- START COUNTRY -->\n						<div class="form-group" data-ng-class="{\'has-error\': (forms.general.sCountry.$touched || forms.general.$submitted) && forms.general.sCountry.$invalid}">\n							<label class="control-label">{{\'APPLICATION_COUNTRY\' | translate}}</label>\n							<input type="text" name="sCountry" placeholder="{{\'APPLICATION_COUNTRY\' | translate}}" class="form-control" data-ng-model="company.sCountry"/>\n							<span data-ng-show="(forms.general.sCountry.$touched || forms.general.$submitted) && forms.general.sCountry.$error.required" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n						</div>\n						<!-- END COUNTRY -->\n						<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n					</div>\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),
+a.put("app/contactmanager/contact/list/import.modal.html",'<div class="modal-header" data-ng-init="getServices()">\n  <h3 class="modal-title">{{ \'APPLICATION_IMPORT_FROM_CSV\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="forms.csv" novalidate>\n    <div class="row">\n      <div class="col-md-6">\n        <!-- START SERVICE -->\n        <div class="form-group" data-ng-class="{\'has-error\': forms.general.ServiceId.$invalid && forms.general.$submitted}">\n          <label class="control-label">{{\'APPLICATION_SERVICE\' | translate}}</label>\n          <ui-select data-ng-model="item.ServiceId" theme="bootstrap" name="ServiceId" data-ng-disabled="disabled" data-ng-change="getCustomFields()">\n            <ui-select-match placeholder="{{ \'APPLICATION_SERVICE\' | translate }}">{{$select.selected.name}}</ui-select-match>\n            <ui-select-choices repeat="service.id as service in services | filter: $select.search">\n              <div ng-bind-html="service.name | highlight: $select.search"></div>\n            </ui-select-choices>\n          </ui-select>\n          <span data-ng-show="forms.general.ServiceId.$invalid && forms.general.$submitted" class="help-block help-block-error">\n            <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n          </span>\n        </div>\n        <!-- END SERVICE -->\n\n    <!-- START FULLNAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': forms.csv.fullname.$invalid && forms.csv.$submitted}">\n      <label class="control-label">{{\'APPLICATION_FULLNAME\' | translate}}</label>\n      <ui-select data-ng-model="item.fullname" theme="bootstrap" name="fullname" data-ng-disabled="disabled" required>\n        <ui-select-match allow-clear placeholder="{{ \'APPLICATION_FULLNAME\' | translate }}">{{$select.selected}}</ui-select-match>\n        <ui-select-choices repeat="index in indexes | filter: $select.search">\n          <div ng-bind-html="index | highlight: $select.search"></div>\n        </ui-select-choices>\n      </ui-select>\n      <span data-ng-show="forms.csv.fullname.$invalid && forms.csv.$touched" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END FULLNAME -->\n\n    <!-- START STREET -->\n    <div class="form-group" data-ng-class="{\'has-error\': forms.csv.street.$invalid && forms.csv.$submitted}">\n      <label class="control-label">{{\'APPLICATION_STREET\' | translate}}</label>\n      <ui-select data-ng-model="item.street" theme="bootstrap" name="street" data-ng-disabled="disabled">\n        <ui-select-match allow-clear placeholder="{{ \'APPLICATION_STREET\' | translate }}">{{$select.selected}}</ui-select-match>\n        <ui-select-choices repeat="index in indexes | filter: $select.search">\n          <div ng-bind-html="index | highlight: $select.search"></div>\n        </ui-select-choices>\n      </ui-select>\n      <span data-ng-show="forms.csv.street.$invalid && forms.csv.$touched" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END STREET -->\n\n    <!-- START POSTALCODE -->\n    <div class="form-group" data-ng-class="{\'has-error\': forms.csv.postalCode.$invalid && forms.csv.$submitted}">\n      <label class="control-label">{{\'APPLICATION_POSTALCODE\' | translate}}</label>\n      <ui-select data-ng-model="item.postalCode" theme="bootstrap" name="postalCode" data-ng-disabled="disabled">\n        <ui-select-match allow-clear placeholder="{{ \'APPLICATION_POSTALCODE\' | translate }}">{{$select.selected}}</ui-select-match>\n        <ui-select-choices repeat="index in indexes | filter: $select.search">\n          <div ng-bind-html="index | highlight: $select.search"></div>\n        </ui-select-choices>\n      </ui-select>\n      <span data-ng-show="forms.csv.postalCode.$invalid && forms.csv.$touched" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END POSTALCODE -->\n\n    <!-- START CITY -->\n    <div class="form-group" data-ng-class="{\'has-error\': forms.csv.city.$invalid && forms.csv.$submitted}">\n      <label class="control-label">{{\'APPLICATION_CITY\' | translate}}</label>\n      <ui-select data-ng-model="item.city" theme="bootstrap" name="city" data-ng-disabled="disabled">\n        <ui-select-match allow-clear placeholder="{{ \'APPLICATION_CITY\' | translate }}">{{$select.selected}}</ui-select-match>\n        <ui-select-choices repeat="index in indexes | filter: $select.search">\n          <div ng-bind-html="index | highlight: $select.search"></div>\n        </ui-select-choices>\n      </ui-select>\n      <span data-ng-show="forms.csv.city.$invalid && forms.csv.$touched" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END CITY -->\n\n    <!-- START PHONES -->\n    <div class="form-group" data-ng-class="{\'has-error\': forms.csv.Phones.$invalid && forms.csv.$submitted}">\n      <label class="control-label">{{\'APPLICATION_PHONES\' | translate}}</label>\n      <ui-select multiple data-ng-model="item.Phones" theme="bootstrap" name="Phones" data-ng-disabled="disabled">\n        <ui-select-match allow-clear placeholder="{{ \'APPLICATION_PHONES\' | translate }}">{{$item}}</ui-select-match>\n        <ui-select-choices repeat="index in indexes | filter: $select.search">\n          <div ng-bind-html="index | highlight: $select.search"></div>\n        </ui-select-choices>\n      </ui-select>\n      <span data-ng-show="forms.csv.Phones.$invalid && forms.csv.$touched" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END PHONES -->\n\n  </div>\n  <div class="col-md-6">\n\n    <!-- START COUNTRY -->\n    <div class="form-group" data-ng-class="{\'has-error\': forms.csv.country.$invalid && forms.csv.$submitted}">\n      <label class="control-label">{{\'APPLICATION_COUNTRY\' | translate}}</label>\n      <ui-select data-ng-model="item.country" theme="bootstrap" name="country" data-ng-disabled="disabled">\n        <ui-select-match allow-clear placeholder="{{ \'APPLICATION_COUNTRY\' | translate }}">{{$select.selected}}</ui-select-match>\n        <ui-select-choices repeat="index in indexes | filter: $select.search">\n          <div ng-bind-html="index | highlight: $select.search"></div>\n        </ui-select-choices>\n      </ui-select>\n      <span data-ng-show="forms.csv.country.$invalid && forms.csv.$touched" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END COUNTRY -->\n\n    <!-- START DATEOFBIRTH -->\n    <div class="form-group" data-ng-class="{\'has-error\': forms.csv.dateOfBirth.$invalid && forms.csv.$submitted}">\n      <label class="control-label">{{\'APPLICATION_DATEOFBIRTH\' | translate}}</label>\n      <ui-select data-ng-model="item.dateOfBirth" theme="bootstrap" name="dateOfBirth" data-ng-disabled="disabled">\n        <ui-select-match allow-clear placeholder="{{ \'APPLICATION_DATEOFBIRTH\' | translate }}">{{$select.selected}}</ui-select-match>\n        <ui-select-choices repeat="index in indexes | filter: $select.search">\n          <div ng-bind-html="index | highlight: $select.search"></div>\n        </ui-select-choices>\n      </ui-select>\n      <span data-ng-show="forms.csv.dateOfBirth.$invalid && forms.csv.$touched" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END DATEOFBIRTH -->\n\n    <!-- START TAGS -->\n    <div class="form-group" data-ng-class="{\'has-error\': forms.csv.tags.$invalid && forms.csv.$submitted}">\n      <label class="control-label">{{\'APPLICATION_TAGS\' | translate}}</label>\n      <ui-select multiple data-ng-model="item.tags" theme="bootstrap" name="tags" data-ng-disabled="disabled">\n        <ui-select-match allow-clear placeholder="{{ \'APPLICATION_TAGS\' | translate }}">{{$item}}</ui-select-match>\n        <ui-select-choices repeat="index in indexes | filter: $select.search">\n          <div ng-bind-html="index | highlight: $select.search"></div>\n        </ui-select-choices>\n      </ui-select>\n      <span data-ng-show="forms.csv.tags.$invalid && forms.csv.$touched" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END TAGS -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group" data-ng-class="{\'has-error\': forms.csv.description.$invalid && forms.csv.$submitted}">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <ui-select data-ng-model="item.description" theme="bootstrap" name="description" data-ng-disabled="disabled">\n        <ui-select-match allow-clear placeholder="{{ \'APPLICATION_DESCRIPTION\' | translate }}">{{$select.selected}}</ui-select-match>\n        <ui-select-choices repeat="index in indexes | filter: $select.search">\n          <div ng-bind-html="index | highlight: $select.search"></div>\n        </ui-select-choices>\n      </ui-select>\n      <span data-ng-show="forms.csv.description.$invalid && forms.csv.$touched" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END DESCRIPTION -->\n\n    <!-- START EMAILS -->\n    <div class="form-group" data-ng-class="{\'has-error\': forms.csv.Emails.$invalid && forms.csv.$submitted}">\n      <label class="control-label">{{\'APPLICATION_EMAILS\' | translate}}</label>\n      <ui-select multiple data-ng-model="item.Emails" theme="bootstrap" name="Emails" data-ng-disabled="disabled">\n        <ui-select-match allow-clear placeholder="{{ \'APPLICATION_EMAILS\' | translate }}">{{$item}}</ui-select-match>\n        <ui-select-choices repeat="index in indexes | filter: $select.search">\n          <div ng-bind-html="index | highlight: $select.search"></div>\n        </ui-select-choices>\n      </ui-select>\n      <span data-ng-show="forms.csv.Emails.$invalid && forms.csv.$touched" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END EMAILS -->\n\n    <!-- START COMPANY -->\n    <div class="form-group" data-ng-class="{\'has-error\': forms.general.CompanyId.$invalid && forms.general.$submitted}">\n      <label class="control-label">{{\'APPLICATION_COMPANY\' | translate}}</label>\n      <ui-select data-ng-model="item.CompanyId" theme="bootstrap" name="CompanyId" data-ng-disabled="disabled">\n        <ui-select-match allow-clear placeholder="{{ \'APPLICATION_COMPANY\' | translate }}">{{$select.selected.name}}</ui-select-match>\n        <ui-select-choices repeat="company.id as company in companies | filter: $select.search">\n          <div ng-bind-html="company.name | highlight: $select.search"></div>\n        </ui-select-choices>\n      </ui-select>\n      <span data-ng-show="forms.general.CompanyId.$invalid && forms.general.$submitted" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END COMPANY -->\n\n  </div>\n  </div>\n\n  <!-- START CUSTOMFIELDS -->\n  <div data-ng-repeat="customField in customFields">\n    <div class="form-group" data-ng-class="{\'has-error\': forms.csv[customField.name].$invalid && forms.csv.$submitted}">\n      <label class="control-label">{{customField.name}}</label>\n      <ui-select data-ng-if="!joinPrompt" data-ng-model="item.customFields[customField.id]" theme="bootstrap" name="{{customField.name}}" data-ng-disabled="disabled">\n        <ui-select-match allow-clear placeholder="{{customField.name}}">{{$select.selected}}</ui-select-match>\n        <ui-select-choices repeat="index in indexes | filter: $select.search">\n          <div ng-bind-html="index | highlight: $select.search"></div>\n        </ui-select-choices>\n      </ui-select>\n      <span data-ng-show="forms.csv[customField.name].$invalid && forms.csv.$submitted" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n  </div>\n  <!-- END CUSTOMFIELDS -->\n\n  <div>\n    <p>{{\'APPLICATION_IMPORT_SUCCEEDED\' | translate}}: {{import.succeeded}}/{{csvLength}}</p>\n    <div class="progress progress-sm" style="">\n      <div class="progress-bar progress-bar-info" role="progressbar" ng-style="{ \'width\': import.success + \'%\' }"></div>\n    </div>\n  </div>\n  <div>\n    <p>{{\'APPLICATION_IMPORT_FAILED\' | translate}}: {{import.failed}}/{{csvLength}}</p>\n    <div class="progress progress-sm" style="">\n      <div class="progress-bar progress-bar-info" role="progressbar" ng-style="{ \'width\': import.fail + \'%\' }"></div>\n    </div>\n  </div>\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="start()" ng-disabled="forms.csv.$invalid || !forms.csv.fullname || submitted">{{ \'APPLICATION_SUBMIT\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="close()" data-ng-if="!importing">{{ \'APPLICATION_CLOSE\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="stop()" data-ng-if="importing">{{ \'APPLICATION_STOP\' | translate }}</button>\n</div>\n'),a.put("app/contactmanager/contact/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="fa fa-users"></i>\n					<a href="/contactmanager/contacts/list">{{ \'APPLICATION_CONTACT_MANAGER\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="fa fa-users font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_CONTACTS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<button class="btn green-jungle" data-ng-click="newContact();">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_CONTACT\' | translate }}\n						</button>\n						<span class="btn default btn-file">\n						<span class="fileinput-new">\n						<i class="icon-cloud-upload"></i> {{\'APPLICATION_IMPORT_FROM_CSV\' | translate}}</span>\n						<input type="file" nv-file-select="" uploader="uploader"/>\n						</span>\n					</div>\n					<!-- <a class="btn btn-icon-only btn-default fullscreen" href="#"></a> -->\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div data-ng-if="gridOptions"  ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/contactmanager/service/list/create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_SERVICE\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="forms.service" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (forms.service.name.$touched || forms.service.$submitted) && forms.service.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n      <span data-ng-show="(forms.service.name.$touched || forms.service.$submitted) && forms.service.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n    </div>\n    <!-- END DESCRIPTION -->\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="ok()" ng-disabled="forms.service.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/contactmanager/service/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="fa fa-tty"></i>\n					<a href="/contactmanager/services/list">{{ \'APPLICATION_SERVICES\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="fa fa-tty font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_SERVICES\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<button class="btn green-jungle " ng-click="create()">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_SERVICE\' | translate }}\n						</button>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/contactmanager/service/view/create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_CUSTOM_FIELD\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="forms.customField" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (forms.customField.name.$touched || forms.customField.$submitted) && forms.customField.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.alias" required/>\n      <span data-ng-show="(forms.customField.name.$touched || forms.customField.$submitted) && forms.customField.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n    <!-- START TYPE -->\n    <div class="form-group"  data-ng-class="{\'has-error\': (forms.customField.type.$touched || forms.customField.$submitted) && forms.customField.type.$invalid}">\n      <label class="control-label">{{ \'APPLICATION_TYPE\' | translate }}<span class="required" aria-required="true">*</span></label>\n      <ui-select data-ng-model="item.type" name="type" theme="bootstrap" required>\n        <ui-select-match placeholder="{{ \'APPLICATION_TYPE\' | translate }}">{{$translate.instant($select.selected.name)}}</ui-select-match>\n        <ui-select-choices repeat="type.value as type in types| filter: $select.search">\n          {{$translate.instant(type.name)}}\n        </ui-select-choices>\n      </ui-select>\n      <span data-ng-show="(forms.customField.type.$touched || forms.customField.$submitted) && forms.customField.type.$invalid && forms.customField.type.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END TYPE -->\n\n    <div ng-slide-down="item.type == \'select\'" lazy-render duration="1">\n      <div>\n        <label class="control-label">{{\'APPLICATION_CHOICES\' | translate}}</label>\n      </div>\n      <div class="padding-bottom" ng-repeat="choice in choices">\n        <div class="form-group">\n          <div class="input-group">\n            <input type="text" class="form-control" ng-model="choice.value" required>\n            <span class="input-group-btn">\n            <button class="btn red" type="button"data-ng-click="removeField($index)" data-ng-disabled="choices.length<=1"><i class="fa fa-times"></i></button>\n            </span>\n          </div>\n        </div>\n      </div>\n      <button type="button" class="btn btn-sm green padding-bottom" ng-click="addField()">\n        <i class="fa fa-plus"></i> {{\'APPLICATION_ADD_CHOICE\' | translate}}\n      </button>\n\n    </div>\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n    </div>\n    <!-- END DESCRIPTION -->\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="ok()" ng-disabled="forms.customField.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/contactmanager/service/view/view.agents.html",'<div class="row" data-ng-init="getTeams()">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_AGENTS\' | translate}}</span>\n				</div>\n			</div>\n			<div class="note note-warning" data-ng-hide="teams.length">\n				<h4 class="block">Warning!</h4>\n				<p>\n					 {{ \'MESSAGE_NO_AVAILABLE_TEAMS\' | translate }}\n				</p>\n			</div>\n			<div class="portlet-body">\n				<!-- BEGIN FORM-->\n				<form action="index.html" class="form-horizontal form-row-seperated">\n					<div class="form-body">\n						<div class="form-group last">\n							<div class="col-md-12" id="multi-select-team">\n							</div>\n						</div>\n					</div>\n				</form>\n				<!-- END FORM-->\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/contactmanager/service/view/view.customFieldSettings.html",'<div class="row" data-ng-init="getCustomField()">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_CUSTOM_FIELD\' | translate}} {{ \'APPLICATION_SETTINGS\' | translate}} </span>\n				</div>\n			</div>\n\n			<div class="portlet-body">\n					<!-- GENERAL TAB -->\n						<form name="forms.general" data-ng-submit="forms.general.$valid && updateCustomField()" novalidate>\n\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="customField.alias" required/>\n								<span data-ng-show="(forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<div ng-slide-down="customField.type == \'select\'" lazy-render duration="1" class="mbottom20">\n								<div>\n									<label class="control-label">{{\'APPLICATION_CHOICES\' | translate}}</label>\n								</div>\n								<div class="padding-bottom" ng-repeat="choice in choices">\n									<div class="form-group">\n										<div class="input-group">\n											<input type="text" class="form-control" ng-model="choice.value" required>\n											<span class="input-group-btn">\n											<button class="btn red" type="button"data-ng-click="removeField($index)" data-ng-disabled="choices.length<=1"><i class="fa fa-times"></i></button>\n											</span>\n										</div>\n									</div>\n								</div>\n								<button type="button" class="btn btn-sm green padding-bottom" ng-click="addField()">\n									<i class="fa fa-plus"></i> {{\'APPLICATION_ADD_CHOICE\' | translate}}\n								</button>\n\n							</div>\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="customField.description"></textarea>\n							</div>\n							<!-- END DESCRIPTION -->\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/contactmanager/service/view/view.customFields.html",'<div ui-view class="profile-content">\n<div class="row" data-ng-init="initCustomFields()">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title  tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_CUSTOM_FIELDS\' | translate}}</span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n          <div class="btn-group">\n            <button class="btn green-jungle " ng-click="create()">\n              <i class="icon-plus"></i> {{ \'APPLICATION_NEW_CUSTOM_FIELD\' | translate }}\n            </button>\n          </div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n	</div>\n</div>\n</div>\n'),a.put("app/contactmanager/service/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getService()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="fa fa-tty"></i>\n					<a href="/contactmanager/services/list">{{ \'APPLICATION_SERVICES\' | translate }}</a>\n					<i data-ng-show="service" class="fa fa-angle-right"></i>\n				</li>\n				<li data-ng-show="service">\n					<a href="#">{{service.name}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/service.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{service.name}}\n					</div>\n					<!-- <div class="profile-usertitle-job">\n						{{user.role}}\n					</div> -->\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.contactmanager.services.view.settings\')}">\n							<a data-ng-href="/contactmanager/services/view/{{service.id}}/settings">\n							<i class="icon-settings"></i>\n							{{ \'APPLICATION_SETTINGS\' | translate}} </a>\n						</li>\n						<li data-ng-class="{active: $state.is(\'main.contactmanager.services.view.agents\')}">\n							<a data-ng-href="/contactmanager/services/view/{{service.id}}/agents">\n							<i class="icon-people"></i>\n							{{ \'APPLICATION_AGENTS\' | translate}} </a>\n						</li>\n						<li data-ng-class="{active: $state.includes(\'main.contactmanager.services.view.customfields\')}">\n							<a data-ng-href="/contactmanager/services/view/{{service.id}}/customfields">\n							<i class="icon-pencil"></i>\n							{{ \'APPLICATION_CUSTOM_FIELDS\' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/contactmanager/service/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_SERVICE\' | translate}} {{ \'APPLICATION_SETTINGS\' | translate}} </span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_GENERAL\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.general" data-ng-submit="forms.general.$valid && updateService()" novalidate>\n\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="service.name" data-ng-disabled="service.defaultEntry" required/>\n								<span data-ng-show="(forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="service.description"></textarea>\n							</div>\n							<!-- END DESCRIPTION -->\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END ADVANCED TAB -->\n\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),
+a.put("app/dashboard/dashboard.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div>\n			<nav class="navbar navbar-default" role="navigation">\n				<div class="navbar-header">\n					<button type="button" class="navbar-toggle" data-ng-init="navCollapsed = true" data-ng-click="navCollapsed = !navCollapsed">\n						<span class="sr-only">Toggle navigation</span>\n						<span class="icon-bar"></span>\n						<span class="icon-bar"></span>\n						<span class="icon-bar"></span>\n					</button>\n				</div>\n\n				<!-- Collect the nav links, forms, and other content for toggling -->\n				<div class="collapse navbar-collapse" ng-class="!navCollapsed && \'in\'">\n					<ul class="nav navbar-nav">\n						<li data-ng-class="{active: $state.is(\'main.dashboard.voice\')}">\n							<a href="/dashboard/voice">\n								<b class=\'icon-earphones-alt\'></b>\n								{{ \'APPLICATION_VOICE\' | translate }}\n							</a>\n						</li>\n						<!-- <li data-ng-class="{active: $state.is(\'main.dashboard.mail\')}">\n							<a href="/dashboard/mail">\n								<b class=\'icon-envelope\'></b>\n								{{ \'APPLICATION_MAIL\' | translate }}\n							</a>\n						</li> -->\n					</ul>\n				</div>\n				<!-- /.navbar-collapse -->\n			</nav>\n		</div>\n		<div ui-view></div>\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/dashboard/mail/mail.html",'<div class="col-md-12">\nThis is the mail view.\n</div>\n'),a.put("app/dashboard/voice/voice.html",'<div data-ng-switch="Auth.getRole()">\n  <div ng-switch-when="agent">\n    <div>\n      test\n    </div>\n  </div>\n  <div ng-switch-default>\n    <fieldset>\n      <legend>\n        <span class="caption-subject">{{ \'APPLICATION_INBOUND\' | translate }}</span>\n      </legend>\n\n      <div class="row">\n        <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12" data-ng-init="initWaiting()">\n          <div class="dashboard-stat blue-madison">\n            <div class="visual">\n              <i class="icon-bell"></i>\n            </div>\n            <div class="details">\n              <div class="number">\n                {{waiting || 0}}\n              </div>\n              <div class="desc">\n                {{\'APPLICATION_WAITING\' | translate}}\n              </div>\n            </div>\n          </div>\n        </div>\n        <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12" data-ng-init="initActive()">\n          <div class="dashboard-stat purple-plum">\n            <div class="visual">\n              <i class="icon-control-play"></i>\n            </div>\n            <div class="details">\n              <div class="number">\n                {{active || 0}}\n              </div>\n              <div class="desc">\n                {{\'APPLICATION_ACTIVE\' | translate}}\n              </div>\n            </div>\n          </div>\n        </div>\n        <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12" data-ng-init="initAnswered()">\n          <div class="dashboard-stat green-haze">\n            <div class="visual">\n              <i class="icon-like"></i>\n            </div>\n            <div class="details">\n              <div class="number">\n                {{answered || 0}}\n              </div>\n              <div class="desc">\n                {{\'APPLICATION_ANSWERED\' | translate}}\n              </div>\n            </div>\n          </div>\n        </div>\n        <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12" data-ng-init="initAbandoned()">\n          <div class="dashboard-stat red-intense">\n            <div class="visual">\n              <i class="icon-dislike"></i>\n            </div>\n            <div class="details">\n              <div class="number">\n                {{abandoned || 0}}\n              </div>\n              <div class="desc">\n                {{\'APPLICATION_ABANDONED\' | translate}}\n              </div>\n            </div>\n          </div>\n        </div>\n      </div>\n\n      <div class="row">\n        <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12" data-ng-init="initAvgAnswerTime()">\n          <div class="dashboard-stat blue-madison">\n            <div class="visual">\n              <i class="icon-clock"></i>\n            </div>\n            <div class="details">\n              <div class="number">\n                {{avganswertime || 0}}\n              </div>\n              <div class="desc">\n                {{\'APPLICATION_AVG_ANSWER_TIME\' | translate}}\n              </div>\n            </div>\n          </div>\n        </div>\n        <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12" data-ng-init="initAvgTalkTime()">\n          <div class="dashboard-stat purple-plum">\n            <div class="visual">\n              <i class="icon-clock"></i>\n            </div>\n            <div class="details">\n              <div class="number">\n                {{avgtalktime || 0}}\n              </div>\n              <div class="desc">\n                {{\'APPLICATION_AVG_TALK_TIME\' | translate}}\n              </div>\n            </div>\n          </div>\n        </div>\n        <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12" data-ng-init="initAnswerRate()">\n          <div class="dashboard-stat green-haze">\n            <div class="visual">\n              <i class="icon-pie-chart"></i>\n            </div>\n            <div class="details">\n              <div class="number">\n                {{answerrate || 0}}\n              </div>\n              <div class="desc">\n                {{\'APPLICATION_ANSWER_RATE\' | translate}} (%)\n              </div>\n            </div>\n          </div>\n        </div>\n        <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12" data-ng-init="initAbandonRate()">\n          <div class="dashboard-stat red-intense">\n            <div class="visual">\n              <i class="icon-pie-chart"></i>\n            </div>\n            <div class="details">\n              <div class="number">\n                {{abandonrate || 0}}\n              </div>\n              <div class="desc">\n                {{\'APPLICATION_ABANDON_RATE\' | translate}} (%)\n              </div>\n            </div>\n          </div>\n        </div>\n      </div>\n\n      <div class="row">\n        <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12" data-ng-init="initTotalOffered()">\n          <div class="dashboard-stat blue-madison">\n            <div class="visual">\n              <i class="icon-info"></i>\n            </div>\n            <div class="details">\n              <div class="number">\n                {{totaloffered || 0}}\n              </div>\n              <div class="desc">\n                {{\'APPLICATION_TOTAL_OFFERED\' | translate}}\n              </div>\n            </div>\n          </div>\n        </div>\n        <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12" data-ng-init="initUnmanaged()">\n          <div class="dashboard-stat purple-plum">\n            <div class="visual">\n              <i class="icon-info"></i>\n            </div>\n            <div class="details">\n              <div class="number">\n                {{unmanaged || 0}}\n              </div>\n              <div class="desc">\n                {{\'APPLICATION_UNMANAGED\' | translate}}\n              </div>\n            </div>\n          </div>\n        </div>\n      </div>\n    </fieldset>\n\n    <fieldset>\n      <legend>\n        <span class="caption-subject">{{ \'APPLICATION_OUTBOUND\' | translate }}</span>\n      </legend>\n\n      <div class="row">\n        <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12" data-ng-init="initManualOutbound()">\n          <div class="dashboard-stat blue-madison">\n            <div class="visual">\n              <i class="icon-call-out"></i>\n            </div>\n            <div class="details">\n              <div class="number">\n                {{manualoutbound || 0}}\n              </div>\n              <div class="desc">\n                {{\'APPLICATION_MANUAL_OUTBOUND\' | translate}}\n              </div>\n            </div>\n          </div>\n        </div>\n        <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12" data-ng-init="initManualOutboundGlobalDuration()">\n          <div class="dashboard-stat purple-plum">\n            <div class="visual">\n              <i class="icon-clock"></i>\n            </div>\n            <div class="details">\n              <div class="number">\n                {{manualoutboundglobalduration || 0}}\n              </div>\n              <div class="desc">\n                {{\'APPLICATION_GLOBAL_DURATION\' | translate}}\n              </div>\n            </div>\n          </div>\n        </div>\n        <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12" data-ng-init="initManualOutboundAnswered()">\n          <div class="dashboard-stat green-haze">\n            <div class="visual">\n              <i class="icon-like"></i>\n            </div>\n            <div class="details">\n              <div class="number">\n                {{manualoutboundanswered || 0}}\n              </div>\n              <div class="desc">\n                {{\'APPLICATION_ANSWERED\' | translate}}\n              </div>\n            </div>\n          </div>\n        </div>\n        <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12" data-ng-init="initManualOutboundAvgDuration()">\n          <div class="dashboard-stat red-intense">\n            <div class="visual">\n              <i class="icon-pie-chart"></i>\n            </div>\n            <div class="details">\n              <div class="number">\n                {{manualoutboundavgduration || 0}}\n              </div>\n              <div class="desc">\n                {{\'APPLICATION_AVG_DURATION\' | translate}} (%)\n              </div>\n            </div>\n          </div>\n        </div>\n      </div>\n\n      <div class="row">\n        <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12" data-ng-init="initManualOutboundAnswerRate()">\n          <div class="dashboard-stat blue-madison">\n            <div class="visual">\n              <i class="icon-pie-chart"></i>\n            </div>\n            <div class="details">\n              <div class="number">\n                {{manualoutboundanswerrate || 0}}\n              </div>\n              <div class="desc">\n                {{\'APPLICATION_ANSWER_RATE\' | translate}} (%)\n              </div>\n            </div>\n          </div>\n        </div>\n      </div>\n\n    </fieldset>\n  </div>\n</div>\n'),a.put("app/desk/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-handbag"></i>\n					<a href="/desk/list">{{ \'APPLICATION_DESK_COM\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-handbag font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_DESK_COM\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="accounts.checked.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<a class="btn green-jungle" href="/desk/wizard">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_ACCOUNT\' | translate }}\n						</a>\n					</div>\n					<a class="btn btn-icon-only btn-default" href="#" ng-csv="getAccounts([\'name\',\'username\',\'remoteUri\',\'authType\',\'consumerKey\',\'consumerSecret\',\'token\',\'tokenSecret\',\'password\'])" csv-header="[\'Name\', \'Username\', \'Remote Address\', \'Authentication Type\', \'Consumer Key\', \'Consumer Secret\', \'Token\', \'Token Secret\', \'Password\']" field-separator=";" filename="desk_accounts.csv">\n					<i class="icon-cloud-download"></i></a>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<table st-table="displayedDeskAccounts" st-pipe="initList" class="table table-striped table-bordered table-hover">\n					<div class="table-responsive">\n					  <thead>\n							<tr>\n								<th colspan="7">\n									<div class="row">\n										<div class="col-md-6">\n											<ui-select class="input-xsmall" ng-model="conf.accountsByPage" theme="bootstrap" ng-disabled="disabled">\n												<ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n												<ui-select-choices repeat="accountByPage in accountsByPage | filter: $select.search">\n													<div ng-bind-html="accountByPage.name | highlight: $select.search"></div>\n												</ui-select-choices>\n											</ui-select>\n										</div>\n										<div class="col-md-6">\n											<div class="input-group input-medium pull-right">\n												<input st-search placeholder="{{ \'APPLICATION_SEARCH\' | translate }}" class="form-control" type="search" />\n												<span class="input-group-addon">\n													<i class="fa fa-search"></i>\n												</span>\n											</div>\n										</div>\n									</div>\n								</th>\n							</tr>\n						  <tr>\n								<th class="small-cells" style="text-align: center; vertical-align: middle"><input type="checkbox" ng-change="check(account, checked)" checklist-model checklist-value="id"></th>\n						    <th st-sort="name">{{ \'APPLICATION_NAME\' | translate }}</th>\n						    <th st-sort="username">{{ \'APPLICATION_EMAIL\' | translate }}</th>\n								<th st-sort="remoteUri">{{ \'APPLICATION_REMOTE_ADDRESS\' | translate }}</th>\n								<th>{{ \'APPLICATION_DESCRIPTION\' | translate }}</th>\n								<th>{{ \'APPLICATION_ACTIONS\' | translate }}</th>\n						  </tr>\n					  </thead>\n					  <tbody>\n					    <tr data-ng-repeat="account in displayedDeskAccounts" class="animate-repeat">\n								<td style="text-align: center; vertical-align: middle"><input type="checkbox" checklist-model="accounts.checked" checklist-value="account.id"></td>\n					      <td>{{account.name}}</td>\n					      <td>{{account.username}}</td>\n								<td>{{account.remoteUri}}</td>\n								<td>{{account.description}}</td>\n					      <td>\n					        <a class="btn default btn-xs blue-stripe" data-ng-href="/desk/view/{{account.id}}/account">\n										{{ \'APPLICATION_EDIT\' | translate }}\n					        </a>\n									<a class="btn default btn-xs green-stripe" data-ng-click="checkAccount(account.id)">\n										{{ \'APPLICATION_CHECK_CONNECTION\' | translate }}\n					        </a>\n					        <a class="btn default btn-xs red-stripe" data-ng-click="deleteItem(account.name,account.id)">\n										{{ \'APPLICATION_DELETE\' | translate }}\n					        </a>\n					      </td>\n					    </tr>\n							<tr data-ng-hide="displayedDeskAccounts.length">\n								<td colspan="7" style="text-align:center;">\n									<i>No account available</i>\n								</td>\n							</tr>\n					  </tbody>\n					  <tfoot>\n							<tr>\n								<td/>\n						    <td>\n									<div class="input-icon right">\n										<i class="fa fa-search"></i>\n										<input st-search="name" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_NAME\' | translate | lowercase}}" class="form-control" type="search"/>\n									</div>\n						    </td>\n						    <td>\n									<div class="input-icon right">\n										<i class="fa fa-search"></i>\n										<input st-search="email" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_EMAIL\' | translate | lowercase}}" class="form-control" type="search"/>\n									</div>\n						    </td>\n						    <td>\n									<div class="input-icon right">\n										<i class="fa fa-search"></i>\n										<input st-search="remoteUri" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_REMOTE_ADDRESS\' | translate | lowercase}}" class="form-control" type="search"/>\n									</div>\n						    </td>\n						    <td/>\n								<td/>\n						  </tr>\n					    <tr>\n					      <td colspan="7" class="text-center">\n									<div class="pagination" st-pagination st-items-by-page="conf.accountsByPage.value" st-displayed-pages="7"></div>\n					      </td>\n					    </tr>\n					  </tfoot>\n					</div>\n				</table>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/desk/view/view.account.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_ACCOUNT\' | translate}}</span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{\'APPLICATION_GENERALS\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.formSetting" data-ng-submit="forms.formSetting.$valid && updateItem()" novalidate>\n              <!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="account.name" required/>\n								<span data-ng-show="forms.formSetting.name.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="account.description"/>\n							</div>\n							<!-- END DESCRIPTION -->\n\n              <!-- START USERNAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.username.$invalid}">\n								<label class="control-label">{{\'APPLICATION_USERNAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="username" placeholder="{{\'APPLICATION_USERNAME\' | translate}}" class="form-control" data-ng-model="account.username" required/>\n								<span data-ng-show="forms.formSetting.username.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END USERNAME -->\n\n              <!-- START REMOTE ADDRESS -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.remoteUri.$invalid}">\n								<label class="control-label">{{\'APPLICATION_REMOTE_ADDRESS\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="url" name="remoteUri" placeholder="{{\'APPLICATION_REMOTE_ADDRESS\' | translate}}" class="form-control" data-ng-model="account.remoteUri" required />\n								<span data-ng-show="forms.formSetting.remoteUri.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END USERNAME -->\n\n							<!-- START AUTH TYPE -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.authType.$invalid}">\n								<label class="control-label">{{\'APPLICATION_AUTHENTICATION_TYPE\' | translate}}</label>\n								<ui-select data-ng-model="account.authType" name="authType" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_AUTHENTICATION_TYPE\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n									<ui-select-choices repeat="type in [\'basic\', \'oauth\'] | filter: $select.search">\n										<div data-ng-bind="type | capitalize | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span data-ng-show="forms.formSetting.authType.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- START AUTH TYPE -->\n\n              <!-- START PASSWORD -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.password.$invalid}" ng-slide-down="account.authType == \'basic\'" lazy-render duration="1">\n								<label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="password" name="password" placeholder="{{\'APPLICATION_PASSWORD\' | translate}}" class="form-control" data-ng-model="account.password" required/>\n								<span data-ng-show="forms.formSetting.password.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END PASSWORD -->\n\n							<!-- START CONSUMER KEY -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.consumerKey.$invalid}" ng-slide-down="account.authType == \'oauth\'" lazy-render duration="1">\n								<label class="control-label">{{\'APPLICATION_CONSUMER_KEY\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="consumerKey" placeholder="{{\'APPLICATION_CONSUMER_KEY\' | translate}}" class="form-control" data-ng-model="account.consumerKey" required/>\n								<span data-ng-show="forms.formSetting.consumerKey.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END CONSUMER KEY -->\n\n              <!-- START CONSUMER SECRET -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.consumerSecret.$invalid}" ng-slide-down="account.authType == \'oauth\'" lazy-render duration="1">\n								<label class="control-label">{{\'APPLICATION_CONSUMER_SECRET\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="consumerSecret" placeholder="{{\'APPLICATION_CONSUMER_SECRET\' | translate}}" class="form-control" data-ng-model="account.consumerSecret" required/>\n								<span data-ng-show="forms.formSetting.consumerSecret.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END CONSUMER SECRET -->\n\n              <!-- START TOKEN -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.token.$invalid}" ng-slide-down="account.authType == \'oauth\'" lazy-render duration="1">\n								<label class="control-label">{{\'APPLICATION_TOKEN\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="token" placeholder="{{\'APPLICATION_TOKEN\' | translate}}" class="form-control" data-ng-model="account.token" required/>\n								<span data-ng-show="forms.formSetting.token.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END TOKEN -->\n\n              <!-- START TOKEN SECRET-->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.tokenSecret.$invalid}" ng-slide-down="account.authType == \'oauth\'" lazy-render duration="1">\n								<label class="control-label">{{\'APPLICATION_TOKEN_SECRET\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="tokenSecret" placeholder="{{\'APPLICATION_TOKEN_SECRET\' | translate}}" class="form-control" data-ng-model="account.tokenSecret" required/>\n								<span data-ng-show="forms.formSetting.tokenSecret.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END TOKEN SECRET-->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END GENERAL TAB -->\n\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/desk/view/view.configuration.html",'<div class="row" data-ng-init="initConfiguration()">\n	<div class="col-md-12">\n		<!-- BEGIN  PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-notebook font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_CONFIGURATION\' | translate }} WIZARD</a> </span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<wizard on-finish="createConfiguration()">\n	        <wz-step title="{{\'APPLICATION_SETTINGS\' | translate}}" canexit="formValidation(formsConfiguration.info.$valid)">\n							<form name="formsConfiguration.info" novalidate>\n								<!-- START NAME -->\n								<div class="form-group" data-ng-class="{\'has-error\': formsConfiguration.info.$submitted && formsConfiguration.info.name.$invalid}">\n									<label class="control-label">{{\'APPLICATION_NAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n									<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="configuration.name" required/>\n									<span data-ng-show="formsConfiguration.info.name.$invalid && formsConfiguration.info.$submitted" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END NAME -->\n								<!-- START DESCRIPTION -->\n								<div class="form-group">\n									<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n									<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="configuration.description"/>\n								</div>\n								<!-- END DESCRIPTION -->\n\n								<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" data-ng-click="goNext()"/>\n							</form>\n						</wz-step>\n\n						<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n							<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n							<input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n						</wz-step>\n				</wizard>\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/desk/view/view.configurationSettings.html",'<div class="row" data-ng-init="getConfiguration();getVariables();getFields();">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_CONFIGURATION\' | translate}}: {{configurationName}}</span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{\'APPLICATION_SUBJECT\' | translate}}</a>\n					</li>\n          <li>\n						<a href="#" data-target="#tab_1_2" data-toggle="tab">{{\'APPLICATION_DESCRIPTION\' | translate}}</a>\n					</li>\n          <li>\n						<a href="#" data-target="#tab_1_3" data-toggle="tab">{{\'APPLICATION_FIELDS\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- SUBJECT TAB -->\n					<div class="tab-pane ui-padding active" id="tab_1_1">\n            <div class="row">\n              <div class="col-md-11">\n                <span class="caption-subject">All following fields will be join by blank space:</span>\n              </div>\n              <div class="col-md-1 pull-rigth">\n                <button class="btn btn-icon-only green" data-ng-click="addItemSubject()"><i class="fa fa-plus"></i></button>\n              </div>\n            </div>\n            <hr>\n						<!-- <div ng-scrollbars ng-scrollbars-config="config"> -->\n	            <div class="row" data-ng-repeat="subjectItem in subjectConfig">\n	              <div class="col-md-3">\n	                <ui-select ng-model="subjectItem.type" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeType(subjectItem)">\n	                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n	                  <ui-select-choices repeat="item in fieldType | filter: $select.search">\n	                    <div ng-bind-html="item | highlight: $select.search | capitalize"></div>\n	                  </ui-select-choices>\n	                </ui-select>\n	              </div>\n	              <div class="col-md-8" data-ng-if="subjectItem.type==\'string\'">\n	                <div class="form-group">\n	                  <input type="text" class="form-control" data-ng-model="subjectItem.content" data-ng-change="updateField(subjectItem)">\n	                </div>\n	              </div>\n	              <div class="col-md-8" data-ng-if="subjectItem.type==\'variable\'">\n	                <div class="form-group">\n	                  <ui-select theme="bootstrap" ng-disabled="disabled" data-ng-model="subjectItem.VariableId" data-ng-change="updateField(subjectItem)">\n	                    <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n	                    <ui-select-choices repeat="variable.id as variable in variables | filter: $select.search">\n	                      <div ng-bind-html="variable.name | highlight: $select.search"></div>\n	                    </ui-select-choices>\n	                  </ui-select>\n	                </div>\n	              </div>\n	              <div class="col-md-1">\n	                <div class="form-group">\n	                  <button class="btn btn-icon-only red" data-ng-click="removeItem(subjectItem)"><i class="fa fa-times"></i></button>\n	                </div>\n	              </div>\n	            </div>\n						<!-- </div> -->\n					</div>\n					<!-- END SUBJECT TAB -->\n          <!-- DESCRIPTION TAB -->\n					<div class="tab-pane ui-padding" id="tab_1_2">\n						<div class="row">\n              <div class="col-md-11">\n                <span class="caption-subject">All following fields will be join by new line:</span>\n              </div>\n              <div class="col-md-1 pull-rigth">\n                <button class="btn btn-icon-only green" data-ng-click="addItemDescription()"><i class="fa fa-plus"></i></button>\n              </div>\n            </div>\n            <hr>\n						<!-- <div ng-scrollbars ng-scrollbars-config="config"> -->\n							<div class="row" data-ng-repeat="descriptionItem in descriptionConfig">\n								<!-- <pre>\n									{{descriptionItem|json}}\n								</pre> -->\n	              <div class="col-md-2">\n	                <ui-select ng-model="descriptionItem.type" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeDescType(descriptionItem)">\n	                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected | ucfirst}}</ui-select-match>\n	                  <ui-select-choices repeat="item in descFieldType | filter: $select.search">\n	                    <div ng-bind-html="item | highlight: $select.search | ucfirst"></div>\n	                  </ui-select-choices>\n	                </ui-select>\n	              </div>\n	              <div class="col-md-9" data-ng-if="descriptionItem.type==\'string\'">\n	                <div class="form-group">\n	                  <input type="text" class="form-control" data-ng-model="descriptionItem.content" data-ng-change="updateField(descriptionItem)">\n	                </div>\n	              </div>\n								<div class="col-md-3" data-ng-if="descriptionItem.type==\'key_value\'">\n									<input type="text" class="form-control" placeholder="Key" data-ng-model="descriptionItem.key" data-ng-change="updateField(descriptionItem)">\n								</div>\n								<div class="col-md-3" data-ng-if="descriptionItem.type==\'key_value\'">\n									<ui-select ng-model="descriptionItem.keyType" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeDescType(descriptionItem)">\n	                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n	                  <ui-select-choices repeat="item in fieldType | filter: $select.search">\n	                    <div ng-bind-html="item | highlight: $select.search | capitalize"></div>\n	                  </ui-select-choices>\n	                </ui-select>\n								</div>\n								<div class="col-md-3" data-ng-if="descriptionItem.type==\'key_value\' && descriptionItem.keyType==\'string\'">\n									<input type="text" class="form-control" placeholder="Value" data-ng-model="descriptionItem.keyContent" data-ng-change="updateField(descriptionItem)">\n								</div>\n	              <div class="col-md-3" data-ng-if="descriptionItem.type==\'key_value\' && descriptionItem.keyType==\'variable\'">\n	                <div class="form-group">\n	                  <ui-select theme="bootstrap" ng-disabled="disabled" data-ng-model="descriptionItem.VariableId" data-ng-change="updateField(descriptionItem)">\n	                    <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n	                    <ui-select-choices repeat="variable.id as variable in variables | filter: $select.search">\n	                      <div ng-bind-html="variable.name | highlight: $select.search"></div>\n	                    </ui-select-choices>\n	                  </ui-select>\n	                </div>\n	              </div>\n	              <div class="col-md-1">\n	                <div class="form-group">\n	                  <button class="btn btn-icon-only red" data-ng-click="removeItem(descriptionItem)"><i class="fa fa-times"></i></button>\n	                </div>\n	              </div>\n	            </div>\n						<!-- </div> -->\n					</div>\n					<!-- END DESCRIPTION TAB -->\n          <!-- FIELDS TAB -->\n					<div class="tab-pane ui-padding" id="tab_1_3">\n						<div class="row">\n              <div class="col-md-11">\n                <span class="caption-subject">Add how to fill the fields present in your account:</span>\n              </div>\n              <div class="col-md-1 pull-rigth">\n                <button class="btn btn-icon-only green" data-ng-click="addItemField()"><i class="fa fa-plus"></i></button>\n              </div>\n            </div>\n            <hr>\n						<!-- <div ng-scrollbars ng-scrollbars-config="config"> -->\n	            <div class="row" data-ng-repeat="fieldItem in fieldConfig">\n	              <div class="col-md-3">\n	                <ui-select ng-model="fieldItem.idField" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeFieldType(fieldItem)">\n	                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.label}}</ui-select-match>\n	                  <ui-select-choices repeat="item.id as item in accountFields | filter: $select.search">\n	                    <div ng-bind-html="item.label | highlight: $select.search"></div>\n	                  </ui-select-choices>\n	                </ui-select>\n	              </div>\n	              <div class="col-md-8" data-ng-if="getSystemFieldOptions(fieldItem.idField)">\n	                <div class="form-group">\n										<ui-select ng-model="fieldItem.content" theme="bootstrap" ng-disabled="disabled" data-ng-change="updateField(fieldItem)">\n		                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected}}</ui-select-match>\n		                  <ui-select-choices repeat="item in getSystemFieldOptions(fieldItem.idField) | filter: $select.search">\n		                    <div ng-bind-html="item | highlight: $select.search"></div>\n		                  </ui-select-choices>\n		                </ui-select>\n	                </div>\n	              </div>\n								<div class="col-md-4" data-ng-if="!getSystemFieldOptions(fieldItem.idField)">\n									<div class="form-group">\n										<ui-select ng-model="fieldItem.type" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeType(fieldItem)">\n		                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected | ucfirst}}</ui-select-match>\n		                  <ui-select-choices repeat="item in fieldType | filter: $select.search">\n		                    <div ng-bind-html="item | highlight: $select.search | ucfirst"></div>\n		                  </ui-select-choices>\n		                </ui-select>\n									</div>\n								</div>\n								<div class="col-md-4" data-ng-if="!getSystemFieldOptions(fieldItem.idField) && fieldItem.type === \'string\'">\n	                <div class="form-group">\n										<input type="text" class="form-control" data-ng-model="fieldItem.content" data-ng-change="updateField(fieldItem)">\n	                </div>\n	              </div>\n								<div class="col-md-4" data-ng-if="!getSystemFieldOptions(fieldItem.idField) && fieldItem.type === \'variable\'">\n	                <div class="form-group">\n										<ui-select theme="bootstrap" ng-disabled="disabled" data-ng-model="fieldItem.VariableId" data-ng-change="updateField(fieldItem)">\n	                    <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n	                    <ui-select-choices repeat="variable.id as variable in variables | filter: $select.search">\n	                      <div ng-bind-html="variable.name | highlight: $select.search"></div>\n	                    </ui-select-choices>\n	                  </ui-select>\n	                </div>\n	              </div>\n	              <div class="col-md-1">\n	                <div class="form-group">\n	                  <button class="btn btn-icon-only red" data-ng-click="removeItem(fieldItem)"><i class="fa fa-times"></i></button>\n	                </div>\n	              </div>\n	            </div>\n						<!-- </div> -->\n					</div>\n					<!-- END FIELDS TAB -->\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),
+a.put("app/desk/view/view.configurations.html",'<div ui-view class="profile-content">\n	<div class="row" data-ng-init="getConfigurations()">\n		<div class="col-md-12">\n			<div class="portlet light">\n				<div class="portlet-title  tabbable-line">\n					<div class="caption caption-md">\n						<i class="icon-globe theme-font hide"></i>\n						<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_CONFIGURATIONS\' | translate}}</span>\n					</div>\n					<div class="actions">\n						<div class="btn-group">\n							<a class="btn green-jungle " href="/desk/view/{{account.id}}/configuration" data-toggle="dropdown">\n								<i class="icon-plus"></i> {{ \'APPLICATION_NEW_CONFIGURATION\' | translate }}\n							</a>\n						</div>\n					</div>\n				</div>\n				<div class="portlet-body">\n					<!-- START TABLE -->\n					<table class="table table-striped table-bordered table-hover">\n						  <thead>\n							  <tr>\n							    <th>{{\'APPLICATION_NAME\' | translate}}</th>\n									<th>{{\'APPLICATION_DESCRIPTION\' | translate}}</th>\n									<th>{{ \'APPLICATION_ACTIONS\' | translate }}</th>\n							  </tr>\n						  </thead>\n							<tbody>\n						    <tr data-ng-repeat="configuration in configurations">\n									<td>{{configuration.name}}</td>\n									<td>{{configuration.description}}</td>\n						      <td>\n										<a class="btn default btn-xs blue-stripe" data-ng-href="/desk/view/{{account.id}}/configurations/settings/{{configuration.id}}">\n											{{ \'APPLICATION_SETTINGS\' | translate}}\n						        </a>\n						        <a class="btn default btn-xs red-stripe" data-ng-click="deleteConfiguration(configuration.name,configuration.id)">\n											{{ \'APPLICATION_DELETE\' | translate }}\n						        </a>\n						      </td>\n						    </tr>\n								<tr data-ng-hide="configurations.length">\n									<td colspan="5" style="text-align:center;">\n										<i>No configuration available</i>\n									</td>\n								</tr>\n						  </tbody>\n					</table>\n					<!-- END TABLE -->\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/desk/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initView()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n          <i class="icon-handbag"></i>\n          <a href="/desk/list">{{ \'APPLICATION_DESK_COM\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<a href="#">{{account.name}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img src="assets/images/media/desk.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{account.name}}\n					</div>\n					<div class="profile-usertitle-job">\n						{{account.remoteUri}}\n					</div>\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.desk.view.account\')}">\n							<a ng-href="/desk/view/{{account.id}}/account">\n							<i class="icon-user"></i>\n							{{ \'APPLICATION_ACCOUNT\' | translate }} </a>\n						</li>\n						<li data-ng-class="{active: $state.includes(\'main.desk.view.configurations\') || $state.is(\'main.desk.view.configuration\')}">\n							<a ng-href="/desk/view/{{account.id}}/configurations">\n							<i class="icon-settings"></i>\n							{{ \'APPLICATION_CONFIGURATIONS\' | translate }} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/desk/wizard/wizard.html",'<!-- BEGIN PAGE HEADER-->\n<div class="row">\n	<div class="col-md-12">\n			<div class="page-bar">\n				<ul class="page-breadcrumb">\n					<li>\n						<i class="icon-rocket"></i>\n						<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-handbag"></i>\n						<a href="/desk/list">{{ \'APPLICATION_DESK_COM\' | translate }}</a>\n					</li>\n				</ul>\n			</div>\n		</div>\n</div>\n<!-- END PAGE HEADER-->\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initWizard()">\n	<div class="col-md-12">\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-notebook font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_ACCOUNT\' | translate }} WIZARD</a> </span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<wizard on-finish="createItem()">\n          <wz-step title="{{\'APPLICATION_ACCOUNT_INFO\' | translate}}" canexit="exitValidation(forms.formSetting.$valid)">\n						<form name="forms.formSetting" novalidate>\n\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n								<span data-ng-show="forms.formSetting.name.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"/>\n							</div>\n							<!-- END DESCRIPTION -->\n\n              <!-- START USERNAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.username.$invalid}">\n								<label class="control-label">{{\'APPLICATION_USERNAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="username" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.username" required ng-remote-validate="/api/desk/accounts/validate/username"/>\n								<span data-ng-show="forms.formSetting.username.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n								<span data-ng-show="(forms.formSetting.username.$touched || forms.formSetting.$submitted) && forms.formSetting.username.$error.ngRemoteValidate" class="help-block help-block-error">\n				          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_EXIST_USERNAME\' | translate}}.\n				        </span>\n							</div>\n							<!-- END USERNAME -->\n\n\n              <!-- START REMOTE ADDRESS -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.remoteUri.$invalid}">\n								<label class="control-label">{{\'APPLICATION_REMOTE_ADDRESS\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="url" name="remoteUri" placeholder="{{\'APPLICATION_REMOTE_ADDRESS\' | translate}}" class="form-control" data-ng-model="item.remoteUri" required ng-remote-validate="/api/desk/accounts/validate/remoteUri"/>\n								<span data-ng-show="forms.formSetting.remoteUri.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n								<span data-ng-show="(forms.formSetting.remoteUri.$touched || forms.formSetting.$submitted) && forms.formSetting.remoteUri.$error.ngRemoteValidate" class="help-block help-block-error">\n				          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_EXIST_DOMAIN\' | translate}}.\n				        </span>\n							</div>\n							<!-- END USERNAME -->\n\n							<!-- START AUTH TYPE -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.authType.$invalid}">\n								<label class="control-label">{{\'APPLICATION_AUTHENTICATION_TYPE\' | translate}}</label>\n								<ui-select data-ng-model="item.authType" name="authType" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_AUTHENTICATION_TYPE\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n									<ui-select-choices repeat="type in [\'basic\', \'oauth\'] | filter: $select.search">\n										<div data-ng-bind="type | capitalize | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span data-ng-show="forms.formSetting.authType.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- START AUTH TYPE -->\n\n              <!-- START PASSWORD -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.password.$invalid}" ng-slide-down="item.authType == \'basic\'" lazy-render duration="1">\n								<label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="password" name="password" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.password" required/>\n								<span data-ng-show="forms.formSetting.password.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END PASSWORD -->\n\n              <!-- START CONSUMER KEY -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.consumerKey.$invalid}" ng-slide-down="item.authType == \'oauth\'" lazy-render duration="1">\n								<label class="control-label">{{\'APPLICATION_CONSUMER_KEY\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="consumerKey" placeholder="{{\'APPLICATION_CONSUMER_KEY\' | translate}}" class="form-control" data-ng-model="item.consumerKey" required/>\n								<span data-ng-show="forms.formSetting.consumerKey.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END CONSUMER KEY -->\n\n              <!-- START CONSUMER SECRET -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.consumerSecret.$invalid}" ng-slide-down="item.authType == \'oauth\'" lazy-render duration="1">\n								<label class="control-label">{{\'APPLICATION_CONSUMER_SECRET\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="consumerSecret" placeholder="{{\'APPLICATION_CONSUMER_SECRET\' | translate}}" class="form-control" data-ng-model="item.consumerSecret" required/>\n								<span data-ng-show="forms.formSetting.consumerSecret.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END CONSUMER SECRET -->\n\n              <!-- START TOKEN -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.token.$invalid}" ng-slide-down="item.authType == \'oauth\'" lazy-render duration="1">\n								<label class="control-label">{{\'APPLICATION_TOKEN\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="token" placeholder="{{\'APPLICATION_TOKEN\' | translate}}" class="form-control" data-ng-model="item.token" required/>\n								<span data-ng-show="forms.formSetting.token.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END TOKEN -->\n\n              <!-- START TOKEN SECRET-->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.tokenSecret.$invalid}" ng-slide-down="item.authType == \'oauth\'" lazy-render duration="1">\n								<label class="control-label">{{\'APPLICATION_TOKEN_SECRET\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="tokenSecret" placeholder="{{\'APPLICATION_TOKEN_SECRET\' | translate}}" class="form-control" data-ng-model="item.tokenSecret" required/>\n								<span data-ng-show="forms.formSetting.tokenSecret.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END TOKEN SECRET-->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" data-ng-click="next()"/>\n\n						</form>\n					</wz-step>\n\n					<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n						<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n						<input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n					</wz-step>\n\n				</wizard>\n\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/freshdesk/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-handbag"></i>\n					<a href="/freshdesk/list">{{ \'APPLICATION_FRESHDESK\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-handbag font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_FRESHDESK\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="accounts.checked.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<a class="btn green-jungle" href="/freshdesk/wizard">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_ACCOUNT\' | translate }}\n						</a>\n					</div>\n					<a class="btn btn-icon-only btn-default" href="#" ng-csv="getAccounts([\'name\',\'username\',\'remoteUri\',\'apiKey\'])" csv-header="[\'Name\', \'Username\', \'Remote Address\', \'Api Key\']" field-separator=";" filename="freshdesk_accounts.csv">\n					<i class="icon-cloud-download"></i></a>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<table st-table="displayedFreshdeskAccounts" st-pipe="initList" class="table table-striped table-bordered table-hover">\n					<div class="table-responsive">\n					  <thead>\n							<tr>\n								<th colspan="7">\n									<div class="row">\n										<div class="col-md-6">\n											<ui-select class="input-xsmall" ng-model="conf.accountsByPage" theme="bootstrap" ng-disabled="disabled">\n												<ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n												<ui-select-choices repeat="accountByPage in accountsByPage | filter: $select.search">\n													<div ng-bind-html="accountByPage.name | highlight: $select.search"></div>\n												</ui-select-choices>\n											</ui-select>\n										</div>\n										<div class="col-md-6">\n											<div class="input-group input-medium pull-right">\n												<input st-search placeholder="{{ \'APPLICATION_SEARCH\' | translate }}" class="form-control" type="search" />\n												<span class="input-group-addon">\n													<i class="fa fa-search"></i>\n												</span>\n											</div>\n										</div>\n									</div>\n								</th>\n							</tr>\n						  <tr>\n								<th class="small-cells" style="text-align: center; vertical-align: middle"><input type="checkbox" ng-change="check(account, checked)" checklist-model checklist-value="id"></th>\n						    <th st-sort="name">{{ \'APPLICATION_NAME\' | translate }}</th>\n						    <th st-sort="username">{{ \'APPLICATION_EMAIL\' | translate }}</th>\n								<th st-sort="remoteUri">{{ \'APPLICATION_REMOTE_ADDRESS\' | translate }}</th>\n								<th>{{ \'APPLICATION_DESCRIPTION\' | translate }}</th>\n								<th>{{ \'APPLICATION_ACTIONS\' | translate }}</th>\n						  </tr>\n					  </thead>\n					  <tbody>\n					    <tr data-ng-repeat="account in displayedFreshdeskAccounts" class="animate-repeat">\n								<td style="text-align: center; vertical-align: middle"><input type="checkbox" checklist-model="accounts.checked" checklist-value="account.id"></td>\n					      <td>{{account.name}}</td>\n					      <td>{{account.username}}</td>\n								<td>{{account.remoteUri}}</td>\n								<td>{{account.description}}</td>\n					      <td>\n					        <a class="btn default btn-xs blue-stripe" data-ng-href="/freshdesk/view/{{account.id}}/account">\n										{{ \'APPLICATION_EDIT\' | translate }}\n					        </a>\n									<a class="btn default btn-xs green-stripe" data-ng-click="checkAccount(account.id)">\n										{{ \'APPLICATION_CHECK_CONNECTION\' | translate }}\n					        </a>\n					        <a class="btn default btn-xs red-stripe" data-ng-click="deleteItem(account.name,account.id)">\n										{{ \'APPLICATION_DELETE\' | translate }}\n					        </a>\n					      </td>\n					    </tr>\n							<tr data-ng-hide="displayedFreshdeskAccounts.length">\n								<td colspan="7" style="text-align:center;">\n									<i>No account available</i>\n								</td>\n							</tr>\n					  </tbody>\n					  <tfoot>\n							<tr>\n								<td/>\n						    <td>\n									<div class="input-icon right">\n										<i class="fa fa-search"></i>\n										<input st-search="name" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_NAME\' | translate | lowercase}}" class="form-control" type="search"/>\n									</div>\n						    </td>\n						    <td>\n									<div class="input-icon right">\n										<i class="fa fa-search"></i>\n										<input st-search="email" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_EMAIL\' | translate | lowercase}}" class="form-control" type="search"/>\n									</div>\n						    </td>\n						    <td>\n									<div class="input-icon right">\n										<i class="fa fa-search"></i>\n										<input st-search="remoteUri" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_REMOTE_ADDRESS\' | translate | lowercase}}" class="form-control" type="search"/>\n									</div>\n						    </td>\n						    <td/>\n								<td/>\n						  </tr>\n					    <tr>\n					      <td colspan="7" class="text-center">\n									<div class="pagination" st-pagination st-items-by-page="conf.accountsByPage.value" st-displayed-pages="7"></div>\n					      </td>\n					    </tr>\n					  </tfoot>\n					</div>\n				</table>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/freshdesk/view/view.account.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_ACCOUNT\' | translate}}</span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{\'APPLICATION_GENERALS\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.formSetting" data-ng-submit="forms.formSetting.$valid && updateItem()" novalidate>\n              <!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="account.name" required/>\n								<span data-ng-show="forms.formSetting.name.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="account.description"/>\n							</div>\n							<!-- END DESCRIPTION -->\n\n              <!-- START USERNAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.username.$invalid}">\n								<label class="control-label">{{\'APPLICATION_USERNAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="username" placeholder="{{\'APPLICATION_USERNAME\' | translate}}" class="form-control" data-ng-model="account.username" required/>\n								<span data-ng-show="forms.formSetting.username.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END USERNAME -->\n\n              <!-- START REMOTE ADDRESS -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.remoteUri.$invalid}">\n								<label class="control-label">{{\'APPLICATION_REMOTE_ADDRESS\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="url" name="remoteUri" placeholder="{{\'APPLICATION_REMOTE_ADDRESS\' | translate}}" class="form-control" data-ng-model="account.remoteUri" required />\n								<span data-ng-show="forms.formSetting.remoteUri.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END USERNAME -->\n\n							<!-- START API KEY -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.apiKey.$invalid}">\n								<label class="control-label">{{\'APPLICATION_API_KEY\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="apiKey" placeholder="{{\'APPLICATION_API_KEY\' | translate}}" class="form-control" data-ng-model="account.apiKey" required/>\n								<span data-ng-show="forms.formSetting.apiKey.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END API KEY -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END GENERAL TAB -->\n\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/freshdesk/view/view.configuration.html",'<div class="row" data-ng-init="initConfiguration()">\n	<div class="col-md-12">\n		<!-- BEGIN  PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-notebook font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_CONFIGURATION\' | translate }} WIZARD</a> </span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<wizard on-finish="createConfiguration()">\n	        <wz-step title="{{\'APPLICATION_SETTINGS\' | translate}}" canexit="formValidation(formsConfiguration.info.$valid)">\n							<form name="formsConfiguration.info" novalidate>\n								<!-- START NAME -->\n								<div class="form-group" data-ng-class="{\'has-error\': formsConfiguration.info.$submitted && formsConfiguration.info.name.$invalid}">\n									<label class="control-label">{{\'APPLICATION_NAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n									<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="configuration.name" required/>\n									<span data-ng-show="formsConfiguration.info.name.$invalid && formsConfiguration.info.$submitted" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END NAME -->\n								<!-- START DESCRIPTION -->\n								<div class="form-group">\n									<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n									<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="configuration.description"/>\n								</div>\n								<!-- END DESCRIPTION -->\n\n								<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" data-ng-click="goNext()"/>\n							</form>\n						</wz-step>\n\n						<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n							<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n							<input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n						</wz-step>\n				</wizard>\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/freshdesk/view/view.configurationSettings.html",'<div class="row" data-ng-init="getConfiguration();getVariables();getFields();">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_CONFIGURATION\' | translate}}: {{configurationName}}</span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{\'APPLICATION_SUBJECT\' | translate}}</a>\n					</li>\n          <li>\n						<a href="#" data-target="#tab_1_2" data-toggle="tab">{{\'APPLICATION_DESCRIPTION\' | translate}}</a>\n					</li>\n          <li>\n						<a href="#" data-target="#tab_1_3" data-toggle="tab">{{\'APPLICATION_FIELDS\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- SUBJECT TAB -->\n					<div class="tab-pane ui-padding active" id="tab_1_1">\n            <div class="row">\n              <div class="col-md-11">\n                <span class="caption-subject">All following fields will be join by blank space:</span>\n              </div>\n              <div class="col-md-1 pull-rigth">\n                <button class="btn btn-icon-only green" data-ng-click="addItemSubject()"><i class="fa fa-plus"></i></button>\n              </div>\n            </div>\n            <hr>\n						<!-- <div ng-scrollbars ng-scrollbars-config="config"> -->\n	            <div class="row" data-ng-repeat="subjectItem in subjectConfig">\n	              <div class="col-md-3">\n	                <ui-select ng-model="subjectItem.type" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeType(subjectItem)">\n	                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n	                  <ui-select-choices repeat="item in fieldType | filter: $select.search">\n	                    <div ng-bind-html="item | highlight: $select.search | capitalize"></div>\n	                  </ui-select-choices>\n	                </ui-select>\n	              </div>\n	              <div class="col-md-8" data-ng-if="subjectItem.type==\'string\'">\n	                <div class="form-group">\n	                  <input type="text" class="form-control" data-ng-model="subjectItem.content" data-ng-change="updateField(subjectItem)">\n	                </div>\n	              </div>\n	              <div class="col-md-8" data-ng-if="subjectItem.type==\'variable\'">\n	                <div class="form-group">\n	                  <ui-select theme="bootstrap" ng-disabled="disabled" data-ng-model="subjectItem.VariableId" data-ng-change="updateField(subjectItem)">\n	                    <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n	                    <ui-select-choices repeat="variable.id as variable in variables | filter: $select.search">\n	                      <div ng-bind-html="variable.name | highlight: $select.search"></div>\n	                    </ui-select-choices>\n	                  </ui-select>\n	                </div>\n	              </div>\n	              <div class="col-md-1">\n	                <div class="form-group">\n	                  <button class="btn btn-icon-only red" data-ng-click="removeItem(subjectItem)"><i class="fa fa-times"></i></button>\n	                </div>\n	              </div>\n	            </div>\n						<!-- </div> -->\n					</div>\n					<!-- END SUBJECT TAB -->\n          <!-- DESCRIPTION TAB -->\n					<div class="tab-pane ui-padding" id="tab_1_2">\n						<div class="row">\n              <div class="col-md-11">\n                <span class="caption-subject">All following fields will be join by new line:</span>\n              </div>\n              <div class="col-md-1 pull-rigth">\n                <button class="btn btn-icon-only green" data-ng-click="addItemDescription()"><i class="fa fa-plus"></i></button>\n              </div>\n            </div>\n            <hr>\n						<!-- <div ng-scrollbars ng-scrollbars-config="config"> -->\n							<div class="row" data-ng-repeat="descriptionItem in descriptionConfig">\n								<!-- <pre>\n									{{descriptionItem|json}}\n								</pre> -->\n	              <div class="col-md-2">\n	                <ui-select ng-model="descriptionItem.type" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeDescType(descriptionItem)">\n	                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected | ucfirst}}</ui-select-match>\n	                  <ui-select-choices repeat="item in descFieldType | filter: $select.search">\n	                    <div ng-bind-html="item | highlight: $select.search | ucfirst"></div>\n	                  </ui-select-choices>\n	                </ui-select>\n	              </div>\n	              <div class="col-md-9" data-ng-if="descriptionItem.type==\'string\'">\n	                <div class="form-group">\n	                  <input type="text" class="form-control" data-ng-model="descriptionItem.content" data-ng-change="updateField(descriptionItem)">\n	                </div>\n	              </div>\n								<div class="col-md-3" data-ng-if="descriptionItem.type==\'key_value\'">\n									<input type="text" class="form-control" placeholder="Key" data-ng-model="descriptionItem.key" data-ng-change="updateField(descriptionItem)">\n								</div>\n								<div class="col-md-3" data-ng-if="descriptionItem.type==\'key_value\'">\n									<ui-select ng-model="descriptionItem.keyType" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeDescType(descriptionItem)">\n	                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n	                  <ui-select-choices repeat="item in fieldType | filter: $select.search">\n	                    <div ng-bind-html="item | highlight: $select.search | capitalize"></div>\n	                  </ui-select-choices>\n	                </ui-select>\n								</div>\n								<div class="col-md-3" data-ng-if="descriptionItem.type==\'key_value\' && descriptionItem.keyType==\'string\'">\n									<input type="text" class="form-control" placeholder="Value" data-ng-model="descriptionItem.keyContent" data-ng-change="updateField(descriptionItem)">\n								</div>\n	              <div class="col-md-3" data-ng-if="descriptionItem.type==\'key_value\' && descriptionItem.keyType==\'variable\'">\n	                <div class="form-group">\n	                  <ui-select theme="bootstrap" ng-disabled="disabled" data-ng-model="descriptionItem.VariableId" data-ng-change="updateField(descriptionItem)">\n	                    <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n	                    <ui-select-choices repeat="variable.id as variable in variables | filter: $select.search">\n	                      <div ng-bind-html="variable.name | highlight: $select.search"></div>\n	                    </ui-select-choices>\n	                  </ui-select>\n	                </div>\n	              </div>\n	              <div class="col-md-1">\n	                <div class="form-group">\n	                  <button class="btn btn-icon-only red" data-ng-click="removeItem(descriptionItem)"><i class="fa fa-times"></i></button>\n	                </div>\n	              </div>\n	            </div>\n						<!-- </div> -->\n					</div>\n					<!-- END DESCRIPTION TAB -->\n          <!-- FIELDS TAB -->\n					<div class="tab-pane ui-padding" id="tab_1_3">\n						<div class="row">\n              <div class="col-md-11">\n                <span class="caption-subject">Add how to fill the fields present in your account:</span>\n              </div>\n              <div class="col-md-1 pull-rigth">\n                <button class="btn btn-icon-only green" data-ng-click="addItemField()"><i class="fa fa-plus"></i></button>\n              </div>\n            </div>\n            <hr>\n						<!-- <div ng-scrollbars ng-scrollbars-config="config"> -->\n	            <div class="row" data-ng-repeat="fieldItem in fieldConfig">\n	              <div class="col-md-3">\n	                <ui-select ng-model="fieldItem.idField" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeFieldType(fieldItem)">\n	                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.label}}</ui-select-match>\n	                  <ui-select-choices repeat="item.name as item in accountFields | filter: $select.search">\n	                    <div ng-bind-html="item.label | highlight: $select.search"></div>\n	                  </ui-select-choices>\n	                </ui-select>\n	              </div>\n	              <div class="col-md-8" data-ng-if="getSystemFieldOptions(fieldItem.idField)">\n	                <div class="form-group">\n										<ui-select ng-model="fieldItem.content" theme="bootstrap" ng-disabled="disabled" data-ng-change="updateField(fieldItem)">\n		                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected[0]}}</ui-select-match>\n		                  <ui-select-choices repeat="item[0] as item in getSystemFieldOptions(fieldItem.idField) | filter: $select.search">\n		                    <div ng-bind-html="item[0] | highlight: $select.search"></div>\n		                  </ui-select-choices>\n		                </ui-select>\n	                </div>\n	              </div>\n								<div class="col-md-4" data-ng-if="!getSystemFieldOptions(fieldItem.idField)">\n									<div class="form-group">\n										<ui-select ng-model="fieldItem.type" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeType(fieldItem)">\n		                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected | ucfirst}}</ui-select-match>\n		                  <ui-select-choices repeat="item in fieldType | filter: $select.search">\n		                    <div ng-bind-html="item | highlight: $select.search | ucfirst"></div>\n		                  </ui-select-choices>\n		                </ui-select>\n									</div>\n								</div>\n								<div class="col-md-4" data-ng-if="!getSystemFieldOptions(fieldItem.idField) && fieldItem.type === \'string\'">\n	                <div class="form-group">\n										<input type="text" class="form-control" data-ng-model="fieldItem.content" data-ng-change="updateField(fieldItem)">\n	                </div>\n	              </div>\n								<div class="col-md-4" data-ng-if="!getSystemFieldOptions(fieldItem.idField) && fieldItem.type === \'variable\'">\n	                <div class="form-group">\n										<ui-select theme="bootstrap" ng-disabled="disabled" data-ng-model="fieldItem.VariableId" data-ng-change="updateField(fieldItem)">\n	                    <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n	                    <ui-select-choices repeat="variable.id as variable in variables | filter: $select.search">\n	                      <div ng-bind-html="variable.name | highlight: $select.search"></div>\n	                    </ui-select-choices>\n	                  </ui-select>\n	                </div>\n	              </div>\n	              <div class="col-md-1">\n	                <div class="form-group">\n	                  <button class="btn btn-icon-only red" data-ng-click="removeItem(fieldItem)"><i class="fa fa-times"></i></button>\n	                </div>\n	              </div>\n	            </div>\n						<!-- </div> -->\n					</div>\n					<!-- END FIELDS TAB -->\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),
+a.put("app/freshdesk/view/view.configurations.html",'<div ui-view class="profile-content">\n	<div class="row" data-ng-init="getConfigurations()">\n		<div class="col-md-12">\n			<div class="portlet light">\n				<div class="portlet-title  tabbable-line">\n					<div class="caption caption-md">\n						<i class="icon-globe theme-font hide"></i>\n						<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_CONFIGURATIONS\' | translate}}</span>\n					</div>\n					<div class="actions">\n						<div class="btn-group">\n							<a class="btn green-jungle " href="/freshdesk/view/{{account.id}}/configuration" data-toggle="dropdown">\n								<i class="icon-plus"></i> {{ \'APPLICATION_NEW_CONFIGURATION\' | translate }}\n							</a>\n						</div>\n					</div>\n				</div>\n				<div class="portlet-body">\n					<!-- START TABLE -->\n					<table class="table table-striped table-bordered table-hover">\n						  <thead>\n							  <tr>\n							    <th>{{\'APPLICATION_NAME\' | translate}}</th>\n									<th>{{\'APPLICATION_DESCRIPTION\' | translate}}</th>\n									<th>{{ \'APPLICATION_ACTIONS\' | translate }}</th>\n							  </tr>\n						  </thead>\n							<tbody>\n						    <tr data-ng-repeat="configuration in configurations">\n									<td>{{configuration.name}}</td>\n									<td>{{configuration.description}}</td>\n						      <td>\n										<a class="btn default btn-xs blue-stripe" data-ng-href="/freshdesk/view/{{account.id}}/configurations/settings/{{configuration.id}}">\n											{{ \'APPLICATION_SETTINGS\' | translate}}\n						        </a>\n						        <a class="btn default btn-xs red-stripe" data-ng-click="deleteConfiguration(configuration.name,configuration.id)">\n											{{ \'APPLICATION_DELETE\' | translate }}\n						        </a>\n						      </td>\n						    </tr>\n								<tr data-ng-hide="configurations.length">\n									<td colspan="5" style="text-align:center;">\n										<i>No configuration available</i>\n									</td>\n								</tr>\n						  </tbody>\n					</table>\n					<!-- END TABLE -->\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/freshdesk/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initView()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n          <i class="icon-handbag"></i>\n          <a href="/freshdesk/list">{{ \'APPLICATION_FRESHDESK\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<a href="#">{{account.name}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img src="assets/images/media/freshdesk.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{account.name}}\n					</div>\n					<div class="profile-usertitle-job">\n						{{account.remoteUri}}\n					</div>\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.freshdesk.view.account\')}">\n							<a ng-href="/freshdesk/view/{{account.id}}/account">\n							<i class="icon-user"></i>\n							{{ \'APPLICATION_ACCOUNT\' | translate }} </a>\n						</li>\n						<li data-ng-class="{active: $state.includes(\'main.freshdesk.view.configurations\') || $state.is(\'main.freshdesk.view.configuration\')}">\n							<a ng-href="/freshdesk/view/{{account.id}}/configurations">\n							<i class="icon-settings"></i>\n							{{ \'APPLICATION_CONFIGURATIONS\' | translate }} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/freshdesk/wizard/wizard.html",'<!-- BEGIN PAGE HEADER-->\n<div class="row">\n	<div class="col-md-12">\n			<div class="page-bar">\n				<ul class="page-breadcrumb">\n					<li>\n						<i class="icon-rocket"></i>\n						<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-handbag"></i>\n						<a href="/freshdesk/list">{{ \'APPLICATION_FRESHDESK\' | translate }}</a>\n					</li>\n				</ul>\n			</div>\n		</div>\n</div>\n<!-- END PAGE HEADER-->\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initWizard()">\n	<div class="col-md-12">\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-notebook font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_ACCOUNT\' | translate }} WIZARD</a> </span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<wizard on-finish="createItem()">\n          <wz-step title="{{\'APPLICATION_ACCOUNT_INFO\' | translate}}" canexit="exitValidation(forms.formSetting.$valid)">\n						<form name="forms.formSetting" novalidate>\n\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n								<span data-ng-show="forms.formSetting.name.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"/>\n							</div>\n							<!-- END DESCRIPTION -->\n\n              <!-- START USERNAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.username.$invalid}">\n								<label class="control-label">{{\'APPLICATION_USERNAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="username" placeholder="{{\'APPLICATION_USERNAME\' | translate}}" class="form-control" data-ng-model="item.username" required ng-remote-validate="/api/freshdesk/accounts/validate/username"/>\n								<span data-ng-show="forms.formSetting.username.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n								<span data-ng-show="(forms.formSetting.username.$touched || forms.formSetting.$submitted) && forms.formSetting.username.$error.ngRemoteValidate" class="help-block help-block-error">\n				          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_EXIST_USERNAME\' | translate}}.\n				        </span>\n							</div>\n							<!-- END USERNAME -->\n\n\n              <!-- START REMOTE ADDRESS -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.remoteUri.$invalid}">\n								<label class="control-label">{{\'APPLICATION_REMOTE_ADDRESS\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="url" name="remoteUri" placeholder="{{\'APPLICATION_REMOTE_ADDRESS\' | translate}}" class="form-control" data-ng-model="item.remoteUri" required ng-remote-validate="/api/freshdesk/accounts/validate/remoteUri"/>\n								<span data-ng-show="forms.formSetting.remoteUri.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n                <span data-ng-show="(forms.formSetting.remoteUri.$touched || forms.formSetting.$submitted) && forms.formSetting.remoteUri.$error.ngRemoteValidate" class="help-block help-block-error">\n				          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_EXIST_DOMAIN\' | translate}}.\n				        </span>\n							</div>\n							<!-- END USERNAME -->\n\n              <!-- START API KEY -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.apiKey.$invalid}">\n								<label class="control-label">{{\'APPLICATION_API_KEY\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="apiKey" placeholder="{{\'APPLICATION_API_KEY\' | translate}}" class="form-control" data-ng-model="item.apiKey" required/>\n								<span data-ng-show="forms.formSetting.apiKey.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END API KEY -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" data-ng-click="next()"/>\n\n						</form>\n					</wz-step>\n\n					<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n						<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n						<input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n					</wz-step>\n\n				</wizard>\n\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/integration/list/list.html",'\n<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-game-controller"></i>\n					<a href="/integrations/list">{{ \'APPLICATION_INTEGRATIONS\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initList()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-eye font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_INTEGRATIONS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n				  <span class="btn green-jungle btn-file">\n            <span> <i class="icon-plus"></i> New App </span>\n            <input type="file" accept=".zip" nv-file-select="" uploader="uploader"/>\n          </span>\n          <a class="btn btn-icon-only btn-default" href="#" ng-csv="displayedIntegrations" filename="integrations.csv">\n					<i class="icon-cloud-download"></i></a>\n					<a class="btn btn-icon-only btn-default fullscreen" href="#"></a>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<table st-table="displayedIntegrations" st-safe-src="integrations" class="table table-striped table-bordered table-hover">\n					<div class="table-responsive">\n					  <thead>\n							<tr>\n								<th colspan="6">\n									<div class="row">\n										<div class="col-md-6">\n											<select class="form-control input-small select2me" data-ng-model="integrationsByPage">\n												<option value="10">10</option>\n												<option value="25">25</option>\n												<option value="50">50</option>\n												<option value="{{integrations.length}}">{{ \'APPLICATION_ALL\' | translate }}</option>\n											</select>\n										</div>\n										<div class="col-md-6">\n											<div class="input-group input-medium pull-right">\n												<input st-search placeholder="{{ \'APPLICATION_SEARCH\' | translate }}" class="form-control" type="search" />\n												<span class="input-group-addon">\n													<i class="fa fa-search"></i>\n												</span>\n											</div>\n										</div>\n									</div>\n								</th>\n							</tr>\n						  <tr>\n								<th st-sort="id" width="5%" st-sort-default="reverse">{{ \'APPLICATION_ID\' | translate }}</th>\n						    <th st-sort="fullname">{{ \'APPLICATION_NAME\' | translate }}</th>\n								<th st-sort="name">{{ \'APPLICATION_FILENAME\' | translate }}</th>\n								<th st-sort="name">{{ \'APPLICATION_VERSION\' | translate }}</th>\n						    <th st-sort="name">{{ \'APPLICATION_DESCRIPTION\' | translate }}</th>\n						    <th>{{ \'APPLICATION_ACTIONS\' | translate }}</th>\n						  </tr>\n					  </thead>\n					  <tbody>\n					    <tr data-ng-repeat="integration in displayedIntegrations">\n								<td>{{integration.id}}</td>\n								<td>{{integration.name}}</td>\n								<td>{{integration.filename}}</td>\n								<td>{{integration.version}}</td>\n					      <td>{{integration.description}}</td>\n								<td>\n									<span class="btn default btn-xs blue-stripe btn-file">\n				            <span> {{ \'APPLICATION_UPDATE\' | translate }} </span>\n				            <input type="file" accept=".zip" nv-file-select="" uploader="uploader"/>\n				          </span>\n					        <a class="btn default btn-xs red-stripe" data-ng-click="deleteItem(integration.name, integration.id)">\n										{{ \'APPLICATION_DELETE\' | translate }}\n					        </a>\n					      </td>\n					    </tr>\n							<tr data-ng-hide="integrations.length">\n								<td colspan="6" style="text-align:center;">\n									<i>No integrations available</i>\n								</td>\n							</tr>\n					  </tbody>\n					  <tfoot>\n							<tr>\n								<td>\n									<div class="input-icon right">\n										<i class="fa fa-search"></i>\n										<input st-search="id" class="form-control" type="search"/>\n									</div>\n						    </td>\n						    <td>\n									<div class="input-icon right">\n										<i class="fa fa-search"></i>\n										<input st-search="name" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_NAME\' | translate | lowercase}}" class="form-control" type="search"/>\n									</div>\n						    </td>\n						    <td>\n									<div class="input-icon right">\n										<i class="fa fa-search"></i>\n										<input st-search="filename" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_FILENAME\' | translate | lowercase}}" class="form-control" type="search"/>\n									</div>\n						    </td>\n								<td>\n						    </td>\n								<td>\n						    </td>\n								<td>\n						    </td>\n						  </tr>\n					    <tr>\n					      <td colspan="6" class="text-center">\n					        <div st-pagination class="pagination" st-items-by-page="integrationsByPage" st-displayed-pages="7"></div>\n					      </td>\n					    </tr>\n					  </tfoot>\n				</div>\n				</table>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/jscripty/project/list/list.create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_PROJECT\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.name.$touched || form.$submitted) && form.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n      <span data-ng-show="(form.name.$touched || form.$submitted) && form.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n    </div>\n    <!-- END DESCRIPTION -->\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="save()" ng-disabled="form.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/jscripty/project/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n        <li>\n          <i class="fa fa-slack"></i>\n          <a href="/jscripty/projects/list">{{ \'APPLICATION_PROJECTS\' | translate }}</a>\n        </li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-docs font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_PROJECTS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<a class="btn green-jungle" ng-click="createItem()">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_PROJECT\' | translate }}\n						</a>\n					</div>\n					<!-- <a class="btn btn-icon-only btn-default fullscreen" href="#"></a> -->\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n\n					<!-- <div class="table-responsive"> -->\n\n\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</div>\n\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/jscripty/project/report/report.detail.html",'<div class="row">\n	<div class="col-md-12">\n		<!-- <div class="tab-pane" id="tab_1_3" data-ng-init="getQuestionDetail()"> -->\n		<div  id="tab_1_3" data-ng-init="getQuestionDetail()">\n\n			<div class="row">\n						<div class="col-md-12">\n							<div class="portlet ">\n													<div class="portlet-title">\n														<div class="caption">\n															<i class="fa fa-list"></i>Questions Detail\n														</div>\n														<!-- <div class="tools">\n															<a href="" class="fullscreen" data-original-title="" title="">\n															</a>\n														</div> -->\n													</div>\n													<div class="portlet-body" id="questionDetail" >\n														<div class="row  margin-top-20">\n															<div class="col-md-10 col-md-offset-1">\n																<div class="panel panel-info" ng-show="!questionDetail">\n																	{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}\n\n																</div>\n																<div class="panel panel-info" ng-repeat= " (id ,labels) in questionDetail ">\n																					<div class="panel-heading">\n																						<h3 class="panel-title">\n																								<i class="fa-chart "></i>Question Id: {{id}}\n																								</h3>\n\n																					</div>\n																					<div class="panel-body">\n																								<div class="row" ng-repeat= " (label , questions) in labels ">\n																									<div class="col-md-10 col-md-offset-1">\n																											<div class="row">\n																												<h3 >\n																														<i class="icon-bar-chart "></i>	{{label}}\n																														</h3>\n\n																											</div>\n																											<div class="row" ng-repeat= " (question , answers) in questions ">\n																												<div class="col-md-10 col-md-offset-1">\n																													<div class="row" style="word-wrap: break-word;">\n																														<h3 >\n																																<i class="icon-bar-chart "></i>\n\n																																</h3>\n																																{{question}}\n																													</div>\n																													<div class="row">\n																														<div class="col-md-6 col-md-offset-3 ">\n																														<table class="table  table-hover">\n																															<thead>\n																																<tr>\n																																	<th style="width=5%"> Answer  </th>\n																																	<th style="width=5%"> Count </th>\n																																</tr>\n																															</thead>\n																															<tbody>\n																																<tr ng-if= "answer.question_answer"  ng-repeat="answer in answers ">\n\n																																				<td>{{answer.question_answer || \'No answer\'}}</td>\n																																				<td>{{answer.count}}</td>\n\n																																</tr>\n\n																															</tbody>\n																														</table>\n																														</div>\n																													</div>\n\n																												</div>\n																										</div>\n																									</div>\n\n\n																									</div>\n\n\n																					</div>\n																</div>\n																<!-- <div class="panel panel-info" ng-repeat= " question in questionDetail ">\n																	<div class="panel-heading">\n																		<h3 class="panel-title">\n																				<i class="icon-bar-chart "></i>\n																				{{question.question_label}}</h3>\n\n																	</div>\n																	<div class="panel-body">\n																		<div class="row">\n																			<div class="col-md-10 col-md-offset-1 ">\n																				<strong>ID:	 </strong>{{question.question_id}}\n																			</div>\n																		</div>\n																		<div class="row">\n																			<div class="col-md-10 col-md-offset-1 ">\n																				<strong>Question:	 </strong>{{question.question_text}}\n																			</div>\n																		</div>\n\n																		<div class="row">\n																			<div class="col-md-6 col-md-offset-3 ">\n																			<table class="table  table-hover">\n																				<thead>\n																					<tr>\n																						<th style="width=5%"> Answer  </th>\n																						<th style="width=5%"> Count </th>\n																					</tr>\n																				</thead>\n																				<tbody>\n																					<tr ng-if= "answer"  ng-repeat="answer in question.question_answers ">\n\n																									<td>{{answer || \'No answer\'}}</td>\n																									<td>{{question.count[$index]}}</td>\n\n																					</tr>\n\n																				</tbody>\n																			</table>\n																			</div>\n																		</div>\n																		<div class="row" ng-if="question.question_other_label">\n																			<div class="col-md-10 col-md-offset-1 ">\n																				<i class="fa fa-cog "></i>\n																					{{question.question_other_label}}\n																			</div>\n																		</div>\n\n																		<div class="row" ng-if="question.question_other_label">\n																			<div class="col-md-6 col-md-offset-3 ">\n																			<table class="table  table-hover">\n																				<thead>\n																					<tr>\n																						<th style="width=5%"> Value  </th>\n																						<th style="width=5%"> Count </th>\n																					</tr>\n																				</thead>\n																				<tbody>\n\n																					<tr ng-if= "answer" ng-repeat="answer in question.question_other_answer ">\n\n																									<td>{{answer || \'No value\'}}</td>\n																									<td>{{question.question_other_count[$index]}}</td>\n\n																					</tr>\n\n																				</tbody>\n																			</table>\n																			</div>\n																		</div>\n																	</div>\n																</div> -->\n															</div>\n\n														</div>\n\n													</div>\n												</div>\n\n		 </div>\n\n			</div>\n\n		</div>\n		</div>\n			</div>\n'),a.put("app/jscripty/project/report/report.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row margin-top-20" data-ng-init="initView()">\n				<div class="col-md-12">\n\n				<!-- BEGIN PROFILE SIDEBAR -->\n  					<div class="profile-sidebar">\n	              <div class="portlet light profile-sidebar-portlet">\n										<!-- SIDEBAR USERPIC -->\n										<div class="profile-userpic">\n												<img src="assets/images/xcally.png" class="img-responsive" >\n										</div>\n										<!-- END SIDEBAR USERPIC -->\n										<!-- SIDEBAR USER TITLE -->\n										<div class="profile-usertitle">\n												<div class="profile-usertitle-name">\n												</div>\n												<div class="profile-usertitle-job">\n\n												</div>\n										</div>\n										<!-- END SIDEBAR USER TITLE -->\n\n										<!-- SIDEBAR MENU -->\n										<div class="profile-usermenu">\n													<ul class="nav">\n														<li data-ng-class="{active: $state.is(\'main.jscripty.projects.report.sessions\')}">\n														<!-- <li class="active"> -->\n\n																	<a data-ng-href=\'/jscripty/projects/report/{{projectId}}/sessions\'>\n						                      	<i class="icon-settings"></i>\n						                        Project Sessions</a>\n														</li>\n						                <li data-ng-class="{active: $state.is(\'main.jscripty.projects.report.summary\')}">\n																<a data-ng-href=\'/jscripty/projects/report/{{projectId}}/summary\'>\n						          					<i class="fa fa-bar-chart"></i>\n						                      Questions Summary</a>\n						                </li>\n						                <li data-ng-class="{active: $state.is(\'main.jscripty.projects.report.detail\')}">\n																<a data-ng-href=\'/jscripty/projects/report/{{projectId}}/detail\'>\n						    								<i class="fa fa-list"></i>\n						                      Questions Detail</a>\n						                </li>\n													</ul>\n										</div>\n										<!-- END MENU -->\n\n	          	</div>\n\n          	</div>\n\n              <div class="profile-content margin-top-20">\n									<div class="row">\n										<div class="col-md-12">\n														<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">\n															<div class="dashboard-stat2">\n																<div class="display">\n																	<div class="number">\n																		<h3 class="font-green-sharp">{{projectStats.started}}</h3>\n																		<small>Started</small>\n																	</div>\n																	<div class="icon">\n																		<i class="icon-pie-chart"></i>\n																	</div>\n																</div>\n																<div class="progress-info">\n																	<div class="progress">\n																		<span style="width: 100%;" class="progress-bar progress-bar-success green-sharp">\n																		</span>\n																	</div>\n																	<div class="status">\n																	</div>\n																</div>\n															</div>\n														</div>\n														<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">\n															<div class="dashboard-stat2">\n																<div class="display">\n																	<div class="number">\n																		<h3 class="font-red-haze">{{projectStats.incomplete}}</h3>\n																		<small>Incomplete</small>\n																	</div>\n																	<div class="icon">\n																		<i class="icon-chart"></i>\n																	</div>\n																</div>\n																<div class="progress-info">\n																	<div class="progress">\n																		<span style="width: 100%;" class="progress-bar progress-bar-success red-haze">\n																		</span>\n																	</div>\n																	<div class="status">\n																	</div>\n																</div>\n															</div>\n														</div>\n														<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">\n															<div class="dashboard-stat2">\n																<div class="display">\n																	<div class="number">\n																		<h3 class="font-blue-sharp">{{projectStats.completed}}</h3>\n																		<small>Completed</small>\n																	</div>\n																	<div class="icon">\n																		<i class="icon-like"></i>\n																	</div>\n																</div>\n																<div class="progress-info">\n																	<div class="progress">\n																		<span style="width: 100%;" class="progress-bar progress-bar-success blue-sharp">\n																		</span>\n																	</div>\n																	<div class="status">\n																	</div>\n																</div>\n															</div>\n														</div>\n											</div>\n							</div>\n\n	                <div class="row">\n	                  <div ui-view class="col-md-12">\n	                  </div>\n	                  </div>\n              </div>\n      	</div>\n	</div>\n'),a.put("app/jscripty/project/report/report.session.detail.html",'\n\n<div class="row" data-ng-init="getSessionDetails()">\n			<div class="col-md-12">\n					<div class="portlet" >\n									<div class="portlet-title">\n										<div class="caption">\n											<i class="fa fa-list"></i>Session Detail\n										</div>\n										<div class="tools">\n											<a href="" class="fullscreen" data-original-title="" title="">\n											</a>\n										</div>\n									</div>\n									<div class="portlet-body"  id="sessionDetail" style="height: auto;">\n										<div class="row  margin-top-20">\n											<div class="col-md-10 col-md-offset-1">\n												<div class="panel panel-default">\n													<div class="panel-heading">\n														<p>\n															<h3 class="panel-title">\n																Session Id: {{sessionQuestions.session_id}}</h3>\n														</p>\n														<p>\n															<h3 class="panel-title">\n																Status: {{sessionQuestions.status}}</h3>\n														</p>\n														<p>\n															<h3 class="panel-title">\n																Started At: {{sessionQuestions.createdAt}}</h3>\n														</p>\n														<p ng-if="sessionQuestions.completedAt">\n															<h3 class="panel-title">\n																Closed At: {{sessionQuestions.completedAt}}</h3>\n														</p>\n													</div>\n\n												</div>\n\n												<div class="panel panel-info" ng-repeat=" question in sessionQuestions.ReportJscriptyQuestions |orderBy:\'id\'">\n													<div class="panel-heading">\n														<h3 class="panel-title">\n																<i class="icon-bar-chart "></i>\n																{{question.question_label}} [ID : {{question.question_id}}]</h3>\n\n													</div>\n													<div class="panel-body"  ng-if="question.question_text" >\n\n														<div class="row" style="word-wrap: break-word;">\n															<div class="col-md-10 col-md-offset-1 ">\n																<h4><strong>Question:	 </strong></h4>{{question.question_text}}\n															</div>\n														</div>\n														<div class="row" style="word-wrap: break-word;">\n															<div class="col-md-10 col-md-offset-1 " ng-if="question.question_answer ">\n																<h4><strong>Answer:	 </strong></h4>{{question.question_answer}}\n															</div>\n														</div>\n														<div ng-if="question.question_other_label" class="col-md-10 col-md-offset-1 ">\n															<h4>\n																	<i class="fa fa-cog "></i>\n																	<strong>{{question.question_other_label}}: </strong>\n															</h4>\n															{{question.question_other_answer}}\n														</div>\n													</div>\n\n\n														<div class="row">\n															<div class="col-md-6 col-md-offset-3 ">\n																<table class="table  table-hover" ng-if="question.ReportJscriptyInputs.length">\n																	<thead>\n																		<tr>\n																			<th style="width=5%"> Label </th>\n																			<th style="width=5%">Answer </th>\n																		</tr>\n																	</thead>\n																	<tbody>\n\n																		<tr ng-repeat="input in question.ReportJscriptyInputs |orderBy:\'id\'">\n\n																						<td>{{input.input_label}}</td>\n																						<td>{{input.input_value || \'No Answer\'}}</td>\n\n																		</tr>\n\n																	</tbody>\n																</table>\n\n															</div>\n														</div>\n													</div>\n												</div>\n											</div>\n\n										</div>\n\n									</div>\n\n								</div>\n					</div>\n	</div>\n'),
+a.put("app/jscripty/project/report/report.sessions.html",'<!-- <div ui-view class="profile-content"> -->\n\n	<div class="row" data-ng-init="getProjectSessions()">\n		<div class="col-md-12">\n			<!-- <div class="tab-pane active" id="tab_1_1" > -->\n				<div class="portlet box blue">\n							<div class="portlet-title">\n								<div class="caption">\n									<i class="icon-settings"></i>Project Sessions\n								</div>\n								<div class="tools">\n									<a href="" class="fullscreen" data-original-title="" title="">\n									</a>\n								</div>\n							</div>\n							<div class="portlet-body" style="height: auto;">\n								<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n									<div class="watermark" ng-show="!gridOptions.data.length">{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</div>\n\n								</div>\n							</div>\n				</div>\n			<!-- </div> -->\n			</div>\n	</div>\n<!-- </div> -->\n'),a.put("app/jscripty/project/report/report.summary.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="tab-pane" id="tab_1_2" data-ng-init="getQuestionSummary()" >\n			<div class="portlet box blue">\n									<div class="portlet-title">\n										<div class="caption">\n											<i class="fa fa-bar-chart"></i>Questions Summary\n\n										</div>\n										<div class="tools">\n											<a href="" class="fullscreen" data-original-title="" title="">\n											</a>\n										</div>\n									</div>\n									<div class="portlet-body" style="height: auto;">\n										<div ui-grid="gridOptions" ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n											<div class="watermark" ng-show="!gridOptions.data.length">{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</div>\n\n										</div>\n\n									</div>\n\n				</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/jscripty/project/view/view.html",'<div class="row" data-ng-init="getProject()">\n	<div class="col-md-12">\n			<div class="page-bar">\n				<ul class="page-breadcrumb">\n					<li>\n						<i class="icon-rocket"></i>\n						<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="fa fa-edit"></i>\n						<a href="/jscripty/projects/list">{{ \'APPLICATION_JSCRIPTY\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="fa fa-slack"></i>\n						<a href="/jscripty/projects/list">{{ \'APPLICATION_PROJECTS\' | translate }}</a>\n            <i class="fa fa-angle-right"></i>\n					</li>\n          <li>\n						<a ng-href="/jscripty/projects/view/{{jscriptyProject.id}}">{{jscriptyProject.name}}</a>\n          </li>\n				</ul>\n			</div>\n		</div>\n</div>\n<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n  <div class="col-md-12">\n		<div id="geEditor" class="geEditor"></div>\n  </div>\n</div>\n<!-- END PAGE CONTENT-->\n<script>\n\n\n</script>\n'),a.put("app/login/login.html",'<!-- BEGIN LOGO -->\n<div class="logo">\n	<a href="index.html">\n	<img src="assets/images/logo-big.png" alt=""/>\n	</a>\n</div>\n<!-- END LOGO -->\n<!-- BEGIN LOGIN -->\n<div class="content">\n	<!-- BEGIN LOGIN FORM -->\n	<form class="login-form" name="loginForm" data-ng-show="!flagLogin1" data-ng-submit="login(loginForm)" novalidate>\n		<h3 class="form-title">Sign In</h3>\n		<div class="alert alert-danger" data-ng-class="{\'display-hide\': !loginSubmitted || !errorLogin}">\n			<button class="close" data-close="alert"></button>\n			<span>{{ errorLog ? errorLog : \'Enter any username and password.\'}}</span>\n		</div>\n		<div class="form-group" data-ng-class="{\'has-error\': loginSubmitted && loginForm.name.$invalid}">\n			<label class="control-label">Username</label>\n      <div class="input-icon">\n        <i class="fa fa-user"></i>\n        <input ng-enter="login(loginForm)" class="form-control form-control-solid placeholder-no-fix" type="text" autocomplete="off" placeholder="Username" name="name" ng-model="userLogin.name" required/>\n      </div>\n      <span data-ng-show="loginSubmitted && loginForm.name.$invalid" class="help-block">Username is required.</span>\n		</div>\n		<div class="form-group" data-ng-class="{\'has-error\': loginSubmitted && loginForm.password.$invalid}">\n			<label class="control-label">Password</label>\n      <div class="input-icon">\n        <i class="fa fa-lock"></i>\n        <input ng-enter="login(loginForm)" class="form-control form-control-solid placeholder-no-fix" type="password" autocomplete="off" placeholder="Password" name="password" ng-model="userLogin.password" required/>\n      </div>\n      <span data-ng-show="loginSubmitted && loginForm.password.$invalid" class="help-block">Password is required.</span>\n		</div>\n		<div class="form-actions">\n			<button type="submit" class="btn btn-success uppercase">Login</button>\n      <label class="rememberme check">\n        <input type="checkbox"> Remember me\n      </label>\n			<!-- <label class="rememberme check">\n			<input type="checkbox" name="remember" value="1"/>Remember </label> -->\n			<!-- <a href="javascript:;" id="forget-password" class="forget-password">Forgot Password?</a> -->\n		</div>\n		<div class="login-options">\n			<h4>Follow Us on</h4>\n			<ul class="social-icons">\n				<li>\n					<a class="social-icon-color facebook" data-original-title="facebook" href="https://www.facebook.com/xenialab"></a>\n				</li>\n				<li>\n					<a class="social-icon-color twitter" data-original-title="Twitter" href="https://twitter.com/xenialab"></a>\n				</li>\n				<li>\n					<a class="social-icon-color googleplus" data-original-title="Goole Plus" href="#"></a>\n				</li>\n				<li>\n					<a class="social-icon-color linkedin" data-original-title="Linkedin" href="#"></a>\n				</li>\n			</ul>\n		</div>\n	</form>\n</div>\n<div class="copyright">\n	 xCALLY Motion | {{year}} - {{year + 1}} &copy; Powered by Xenialab\n</div>\n<!-- END LOGIN -->\n'),a.put("app/main/chooseContact.modal.html",'<div class="modal-header" data-ng-init="getContacts()">\n  <h3 class="modal-title">{{ \'APPLICATION_CHOOSE_CONTACT\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <table st-table="rowCollection" class="table table-striped">\n  	<tbody>\n  	<tr ng-repeat="contact in contacts">\n  		<td>{{contact.fullname}}</td>\n  		<td>{{contact.Service.name}}</td>\n  		<td>\n        <button class="btn default btn-xs green-stripe" data-ng-click="open(contact)">\n          {{ \'APPLICATION_OPEN\' | translate}}\n        </button>\n      </td>\n  	</tr>\n    <tr data-ng-hide="contacts.length">\n      <td colspan="3" style="text-align:center;">\n        <i>{{ \'MESSAGE_NO_CONTACTS_AVAILABLE\' | translate }}</i>\n      </td>\n    </tr>\n  	</tbody>\n  </table>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="open()"><i class="icon-plus"></i> {{ \'APPLICATION_NEW_CONTACT\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/main/closeEditedTab.modal.html",'<div class="modal-header" data-ng-init="getContacts()">\n  <h3 class="modal-title">{{ \'APPLICATION_WARNING\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <p>{{\'MESSAGE_CLOSE_EDITED_TAB\' | translate}}</p>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-danger" type="button" ng-click="close()">{{ \'APPLICATION_CLOSE\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/main/main.html",'<!-- BEGIN HEADER -->\n<div data-ng-include="\'components/header/header.html\'" data-ng-controller="HeaderController" class="page-header navbar navbar-fixed-top">\n</div>\n<!-- END HEADER -->\n\n<div class="clearfix">\n</div>\n<!-- BEGIN CONTAINER -->\n<div class="page-container" data-ng-init="initMain()">\n\n  <!-- BEGIN SIDEBAR -->\n  <div data-ng-include="\'components/sidebar/sidebar.html\'" data-ng-controller="SidebarController" class="page-sidebar-wrapper">\n  </div>\n  <!-- END SIDEBAR -->\n\n  <!-- BEGIN CONTENT -->\n  <div class="page-content-wrapper">\n    <div class="page-content" data-ng-class="{\'demo\': !license.expiration}">\n\n      <!-- BEGIN PAGE CONTENT -->\n      <uib-tabset>\n        <uib-tab select="addWorkspace()" active="mainTab.active">\n          <uib-tab-heading>\n            Motion <i class="icon-rocket"></i>\n          </uib-tab-heading>\n          <div ui-view class=""></div>\n        </uib-tab>\n        <uib-tab data-ng-repeat="workspace in workspaces" active="workspace.active" data-ng-switch="workspace.type">\n          <uib-tab-heading>\n            {{workspace.name}} <i class="icon-close pointer-cursor" data-ng-click="closeTab($index)"></i>\n          </uib-tab-heading>\n          <div class="" data-ng-switch="workspace.type">\n            <new-contact data-ng-switch-when="newContact" workspace="workspace" index="$index" on-submit="createContact(index,item)"></new-contact>\n            <contact data-ng-switch-when="contact" workspace="workspace" index="$index" on-submit="updateContact(index,item)"></contact>\n            <jscripty data-ng-switch-when="jscripty" workspace="workspace" index="$index" on-submit="closeTab(index)"></jscripty>\n          </div>\n        </uib-tab>\n      </uib-tabset>\n      <!-- END PAGE CONTENT  -->\n\n    </div>\n  </div>\n  <!-- END CONTENT -->\n\n  <!-- BEGIN QUICK SIDEBAR -->\n  <a href="javascript:;" class="page-quick-sidebar-toggler"><i class="icon-close"></i></a>\n  <div data-ng-include="\'components/quickSidebar/quickSidebar.html\'" data-ng-controller="QuickSidebarController" class="page-quick-sidebar-wrapper">\n  </div>\n  <!-- END QUICK SIDEBAR -->\n\n</div>\n<!-- END CONTAINER -->\n\n<!-- BEGIN FOOTER -->\n<div data-ng-include="\'components/footer/footer.html\'" data-ng-controller="FooterController" class="page-footer">\n</div>\n<!-- END FOOTER -->\n\n<!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->\n<!-- BEGIN CORE PLUGINS -->\n<!--[if lt IE 9]>\n<script src="../../assets/global/plugins/respond.min.js"></script>\n<script src="../../assets/global/plugins/excanvas.min.js"></script>\n<![endif]-->\n\n<!-- END JAVASCRIPTS -->\n'),a.put("app/main/template/actionBuilder/template.actionBuilderIntegration.html",'<div data-ng-if="randomName" class="form-group col-md-2" data-ng-class="{\'has-error\': (form[\'data1\'+randomName].$touched || form.$submitted) && form[\'data1\'+randomName].$invalid}">\n  <ui-select data-ng-model="element.data1" name="data1{{randomName}}" theme="bootstrap" data-ng-change="changeIntegration()" required>\n    <ui-select-match>{{$select.selected.name}}</ui-select-match>\n    <ui-select-choices repeat="integration.state as integration in integrations | filter: $select.search">\n      <div ng-bind-html="integration.name | highlight: $select.search"></div>\n    </ui-select-choices>\n  </ui-select>\n  <span data-ng-show="(form[\'data1\'+randomName].$touched || form.$submitted) && form[\'data1\'+randomName].$error.required" class="help-block help-block-error">\n    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n  </span>\n</div>\n<div class="form-group col-md-2" data-ng-if="element.data1 && accounts && randomName" data-ng-class="{\'has-error\': (form[\'data2\'+randomName].$touched || form.$submitted) && form[\'data2\'+randomName].$invalid}">\n  <ui-select data-ng-model="element.data2" name="data2{{randomName}}" theme="bootstrap" data-ng-change="changeAccount();" required>\n    <ui-select-match>{{$select.selected.name}}</ui-select-match>\n    <ui-select-choices repeat="account.id as account in accounts | filter: $select.search">\n      <div ng-bind-html="account.name | highlight: $select.search"></div>\n    </ui-select-choices>\n  </ui-select>\n  <span data-ng-show="(form[\'data2\'+randomName].$touched || form.$submitted) && form[\'data2\'+randomName].$error.required" class="help-block help-block-error">\n    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n  </span>\n</div>\n<div class="form-group col-md-2" data-ng-if="element.data2 && configurations && randomName" data-ng-class="{\'has-error\': (form[\'data3\'+randomName].$touched || form.$submitted) && form[\'data3\'+randomName].$invalid}">\n  <ui-select data-ng-model="element.data3" name="data3{{randomName}}" theme="bootstrap" required>\n    <ui-select-match>{{$select.selected.name}}</ui-select-match>\n    <ui-select-choices repeat="config.id as config in configurations | filter: $select.search">\n      <div ng-bind-html="config.name | highlight: $select.search"></div>\n    </ui-select-choices>\n  </ui-select>\n  <span data-ng-show="(form[\'data3\'+randomName].$touched || form.$submitted) && form[\'data3\'+randomName].$error.required" class="help-block help-block-error">\n'+"    <strong>{{'APPLICATION_WARNING' | translate}}!</strong> {{'MESSAGE_REQUIRED_FIELD' | translate}}.\n  </span>\n</div>\n"),a.put("app/main/template/actionBuilder/template.actionBuilderStatus.html",'<div data-ng-if="randomName" class="form-group col-md-2" data-ng-class="{\'has-error\': (form[\'data1\'+randomName].$touched || form.$submitted) && form[\'data1\'+randomName].$invalid}">\n  <ui-select data-ng-model="element.data1" name="data1{{randomName}}" theme="bootstrap" required>\n    <ui-select-match>{{$select.selected.name | translate}}</ui-select-match>\n    <ui-select-choices repeat="status.value as status in states | filter: $select.search">\n      <div ng-bind-html="status.name | translate | highlight: $select.search"></div>\n    </ui-select-choices>\n  </ui-select>\n  <span data-ng-show="(form[\'data1\'+randomName].$touched || form.$submitted) && form[\'data1\'+randomName].$error.required" class="help-block help-block-error">\n'+"    <strong>{{'APPLICATION_WARNING' | translate}}!</strong> {{'MESSAGE_REQUIRED_FIELD' | translate}}.\n  </span>\n</div>\n"),a.put("app/main/template/actionBuilder/template.actionBuilderTemplate.html",'<div data-ng-if="randomName" class="form-group col-md-2" data-ng-class="{\'has-error\': (form[\'data1\'+randomName].$touched || form.$submitted) && form[\'data1\'+randomName].$invalid}">\n  <ui-select data-ng-model="element.data1" name="data1{{randomName}}" theme="bootstrap" required>\n    <ui-select-match>{{$select.selected.name}}</ui-select-match>\n    <ui-select-choices repeat="template.id as template in templates | filter: $select.search">\n      <div ng-bind-html="template.name | highlight: $select.search"></div>\n    </ui-select-choices>\n  </ui-select>\n  <span data-ng-show="(form[\'data1\'+randomName].$touched || form.$submitted) && form[\'data1\'+randomName].$error.required" class="help-block help-block-error">\n    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n  </span>\n</div>\n<div data-ng-if="randomName" class="form-group col-md-2" data-ng-class="{\'has-error\': (form[\'data2\'+randomName].$touched || form.$submitted) && form[\'data2\'+randomName].$invalid}">\n  <input type="text" ng-model="element.data2" name="data2{{randomName}}" class="form-control" required/>\n  <span data-ng-show="(form[\'data2\'+randomName].$touched || form.$submitted) && form[\'data2\'+randomName].$error.required" class="help-block help-block-error">\n    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n  </span>\n</div>\n<div class="col-md-2">\n  <input type="text" ng-model="element.data3" class="form-control"/>\n</div>\n'),a.put("app/main/template/template.conditionBuilder.html",'<div data-ng-if="randomName" class="form-group col-md-3" data-ng-class="{\'has-error\': (form[\'field\'+randomName].$touched || form.$submitted) && form[\'field\'+randomName].$invalid}">\n  <ui-select data-ng-model="element.field" name="field{{randomName}}" theme="bootstrap" data-ng-change="checkCondition(element.field)" required>\n    <ui-select-match>{{$select.selected.name | translate}}</ui-select-match>\n    <ui-select-choices repeat="condition.value as condition in service.services[serviceindex].conditions | filter: $select.search">\n      <div ng-bind-html="condition.name | translate | highlight: $select.search"></div>\n    </ui-select-choices>\n  </ui-select>\n  <span data-ng-show="(form[\'field\'+randomName].$touched || form.$submitted) && form[\'field\'+randomName].$error.required" class="help-block help-block-error">\n    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n  </span>\n</div>\n<div data-ng-if="randomName && element.field" class="form-group col-md-3" data-ng-class="{\'has-error\': (form[\'operator\'+randomName].$touched || form.$submitted) && form[\'operator\'+randomName].$invalid}">\n  <ui-select data-ng-model="element.operator" name="operator{{randomName}}" theme="bootstrap" required>\n    <ui-select-match>{{$select.selected.name | translate}}</ui-select-match>\n    <ui-select-choices repeat="operator.value as operator in _.find(service.services[serviceindex].conditions,{value:element.field}).operators | filter: $select.search">\n      <div ng-bind-html="operator.name | translate | highlight: $select.search"></div>\n    </ui-select-choices>\n  </ui-select>\n  <span data-ng-show="(form[\'operator\'+randomName].$touched || form.$submitted) && form[\'operator\'+randomName].$error.required" class="help-block help-block-error">\n    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n  </span>\n</div>\n<div class="col-md-3" data-ng-if="elementType === \'input\' && randomName && element.field" data-ng-class="{\'has-error\': (form[\'value\'+randomName].$touched || form.$submitted) && form[\'value\'+randomName].$invalid}">\n  <input type="text" ng-model="element.value" class="form-control" name="value{{randomName}}" required/>\n  <span data-ng-show="(form[\'value\'+randomName].$touched || form.$submitted) && form[\'value\'+randomName].$error.required" class="help-block help-block-error">\n      <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n    </span>\n</div>\n<div class="form-group col-md-3" data-ng-if="elementType === \'select\' && randomName && element.field" data-ng-class="{\'has-error\': (form[\'value\'+randomName].$touched || form.$submitted) && form[\'value\'+randomName].$invalid}">\n  <ui-select data-ng-model="element.value" name="value{{randomName}}" theme="bootstrap" required>\n    <ui-select-match>{{$select.selected.name | translate}}</ui-select-match>\n    <ui-select-choices repeat="value.value as value in values| filter: $select.search">\n      <div ng-bind-html="value.name | translate | highlight: $select.search"></div>\n    </ui-select-choices>\n  </ui-select>\n  <span data-ng-show="(form[\'value\'+randomName].$touched || form.$submitted) && form[\'value\'+randomName].$error.required" class="help-block help-block-error">\n'+"    <strong>{{'APPLICATION_WARNING' | translate}}!</strong> {{'MESSAGE_REQUIRED_FIELD' | translate}}.\n  </span>\n</div>\n"),a.put("app/main/template/template.contactTab.html",'<div class="row margin-top-20 contact-tab-container">\n  <div class="col-md-12 contact-tab">\n    <form name="forms.general" data-ng-submit="submit({index:index,item:contact})" novalidate>\n    <!-- BEGIN PROFILE CONTENT -->\n    <div class="profile-content">\n      <ul class="nav nav-tabs">\n  <li class="active">\n    <a href="#tab_1_1{{contact.id || \'\'}}" data-toggle="tab">{{\'APPLICATION_DETAIL\' | translate}}</a>\n  </li>\n  <li data-ng-if="contact.id">\n    <a href="#tab_1_2{{contact.id || \'\'}}" data-toggle="tab">{{\'APPLICATION_LOG\' | translate}}</a>\n  </li>\n</ul>\n<div class="tab-content">\n  <div class="tab-pane fade active in" id="tab_1_1{{contact.id || \'\'}}">\n    <!--end add-portfolio-->\n    <div class="row portfolio-block" data-ng-if="workspace.data">\n      <div class="col-md-6">\n        <div class="portfolio-text">\n          <img src="assets/images/media/CmCall.png" alt=""/>\n          <div class="portfolio-text-info">\n            <h4>{{\'MESSAGE_INBOUND_CALL_FROM\' | translate}} - {{data.calleridnum}}</h4>\n            <p>\n              {{\'MESSAGE_CALL_UNIQUEID\' | translate}} : {{data.uniqueid}}\n            </p>\n          </div>\n        </div>\n      </div>\n      <div class="col-md-2 portfolio-stat">\n        <div class="portfolio-info">\n          {{\'APPLICATION_QUEUE\' | translate}} <span>\n            {{workspace.data.queue}} </span>\n          </div>\n        </div>\n        <div class="col-md-2 portfolio-stat">\n          <div class="portfolio-info">\n            {{\'APPLICATION_AGENT\' | translate}} <span>\n              {{workspace.data.membername}} </span>\n            </div>\n          </div>\n          <div class="col-md-2 portfolio-stat">\n            <div class="portfolio-info">\n              {{\'APPLICATION_DATE\' | translate}} <span>\n                {{workspace.data.agentcalledAt}} </span>\n              </div>\n            </div>\n          </div>\n            <!--end row-->\n          <!-- BEGIN PORTLET -->\n          <div class="portlet light ">\n            <div class="portlet-title">\n              <div class="caption caption-md">\n                <i class="icon-bar-chart theme-font hide"></i>\n                <span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_DETAIL\' | translate}}</span>\n              </div>\n              <div class="actions">\n                <div class="btn-group btn-group-devided" data-toggle="buttons">\n                  <label class="btn btn-transparent grey-salsa btn-circle btn-sm active" data-ng-click="detail.tab=\'main\'">\n                  <input type="radio" class="toggle">{{\'APPLICATION_MAIN\' | translate}}</label>\n                  <label class="btn btn-transparent grey-salsa btn-circle btn-sm" data-ng-click="detail.tab=\'other\'">\n                  <input type="radio" class="toggle">{{\'APPLICATION_OTHER\' | translate}}</label>\n                </div>\n              </div>\n            </div>\n            <div class="portlet-body">\n              <div data-ng-class="{\'hidden\':detail.tab != \'main\'}" class="portlet-body contact-portlet row">\n                <div class="col-md-4">\n              <!-- START FIRSTNAME -->\n              <div class="form-group" data-ng-class="{\'has-error\': (forms.general.firstName.$touched || forms.general.$submitted) && forms.general.firstName.$invalid}">\n                <label class="control-label">{{\'APPLICATION_FIRSTNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n                <input type="text" name="firstName" placeholder="{{\'APPLICATION_FIRSTNAME\' | translate}}" class="form-control" data-ng-model="contact.firstName" required/>\n                <span data-ng-show="(forms.general.firstName.$touched || forms.general.$submitted) && forms.general.firstName.$error.required" class="help-block help-block-error">\n                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                </span>\n              </div>\n              <!-- END FIRSTNAME -->\n\n              <!-- START LASTNAME -->\n              <div class="form-group" data-ng-class="{\'has-error\': (forms.general.lastName.$touched || forms.general.$submitted) && forms.general.lastName.$invalid}">\n                <label class="control-label">{{\'APPLICATION_LASTNAME\' | translate}}</label>\n                <input type="text" name="lastName" placeholder="{{\'APPLICATION_LASTNAME\' | translate}}" class="form-control" data-ng-model="contact.lastName"/>\n                <span data-ng-show="(forms.general.lastName.$touched || forms.general.$submitted) && forms.general.lastName.$error.required" class="help-block help-block-error">\n                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                </span>\n              </div>\n              <!-- END LASTNAME -->\n\n              <!-- START COMPANY -->\n              <div class="form-group" data-ng-class="{\'has-error\': forms.general.CompanyId.$invalid && forms.general.$submitted}">\n                <label class="control-label">{{\'APPLICATION_COMPANY\' | translate}}</label>\n                <ui-select data-ng-model="contact.CompanyId" theme="bootstrap" name="CompanyId" ng-disabled="!companies.length">\n                  <ui-select-match allow-clear placeholder="{{ \'APPLICATION_COMPANY\' | translate }}">{{$select.selected.name}}</ui-select-match>\n                  <ui-select-choices repeat="company.id as company in companies | filter: $select.search">\n                    <div ng-bind-html="company.name | highlight: $select.search"></div>\n                  </ui-select-choices>\n                </ui-select>\n                <div class="note note-warning" data-ng-hide="companies.length">\n                  <h4 class="block">Warning!</h4>\n                  <p>\n                    {{ \'MESSAGE_NO_COMPANIES_AVAILABLE\' | translate }}\n                  </p>\n                  <p>\n                    {{\'APPLICATION_GO_TO\' | translate}} <a href="/contactmanager/companies/list">{{\'APPLICATION_COMPANIES\' | translate}}</a>\n                  </p>\n                </div>\n                <span data-ng-show="forms.general.CompanyId.$invalid && forms.general.$submitted" class="help-block help-block-error">\n                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                </span>\n              </div>\n              <!-- END COMPANY -->\n            </div>\n            <div class="col-md-4">\n              <!-- START PHONE -->\n              <div class="form-group" data-ng-class="{\'has-error\': (forms.general.phone.$touched || forms.general.$submitted) && forms.general.phone.$invalid}">\n                <label class="control-label">{{\'APPLICATION_PHONE\' | translate}}</label>\n                <input type="text" name="phone" placeholder="{{\'APPLICATION_PHONE\' | translate}}" class="form-control" data-ng-model="contact.phone"/>\n                <span data-ng-show="(forms.general.phone.$touched || forms.general.$submitted) && forms.general.phone.$error.required" class="help-block help-block-error">\n                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                </span>\n              </div>\n              <!-- END PHONE -->\n              <!-- START MOBILE -->\n              <div class="form-group" data-ng-class="{\'has-error\': (forms.general.mobile.$touched || forms.general.$submitted) && forms.general.mobile.$invalid}">\n                <label class="control-label">{{\'APPLICATION_MOBILE\' | translate}}</label>\n                <input type="text" name="mobile" placeholder="{{\'APPLICATION_MOBILE\' | translate}}" class="form-control" data-ng-model="contact.mobile"/>\n                <span data-ng-show="(forms.general.mobile.$touched || forms.general.$submitted) && forms.general.mobile.$error.required" class="help-block help-block-error">\n                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                </span>\n              </div>\n              <!-- END MOBILE -->\n              <!-- START EMAIL -->\n              <div class="form-group" data-ng-class="{\'has-error\': (forms.general.email.$touched || forms.general.$submitted) && forms.general.email.$invalid}">\n                <label class="control-label">{{\'APPLICATION_EMAIL\' | translate}}</label>\n                <input type="text" name="email" placeholder="{{\'APPLICATION_EMAIL\' | translate}}" class="form-control" data-ng-model="contact.email"/>\n                <span data-ng-show="(forms.general.email.$touched || forms.general.$submitted) && forms.general.email.$error.required" class="help-block help-block-error">\n                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                </span>\n              </div>\n              <!-- END EMAIL -->\n            </div>\n            <div class="col-md-4">\n              <!-- START FAX -->\n              <div class="form-group" data-ng-class="{\'has-error\': (forms.general.fax.$touched || forms.general.$submitted) && forms.general.fax.$invalid}">\n                <label class="control-label">{{\'APPLICATION_FAX\' | translate}}</label>\n                <input type="text" name="fax" placeholder="{{\'APPLICATION_FAX\' | translate}}" class="form-control" data-ng-model="contact.fax"/>\n                <span data-ng-show="(forms.general.fax.$touched || forms.general.$submitted) && forms.general.fax.$error.required" class="help-block help-block-error">\n                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                </span>\n              </div>\n              <!-- END FAX -->\n              <!-- START TAGS -->\n              <div class="form-group" data-ng-class="{\'has-error\': forms.general.tags.$invalid && forms.general.$submitted}">\n                <label class="control-label">{{\'APPLICATION_TAGS\' | translate}}</label>\n                <ui-select tagging tagging-label="" multiple=\'true\' data-ng-model="contact.tags" theme="bootstrap" name="tags" ng-disabled="disabled">\n                  <ui-select-match placeholder="{{ \'APPLICATION_TAGS\' | translate }}">{{$item}}</ui-select-match>\n                  <ui-select-choices repeat="tag in tags | filter: $select.search">\n                    {{tag}}\n                  </ui-select-choices>\n                </ui-select>\n                <span data-ng-show="forms.general.tags.$invalid && forms.general.$submitted" class="help-block help-block-error">\n                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                </span>\n              </div>\n              <!-- END TAGS -->\n              <!-- START SERVICE -->\n              <div class="form-group" data-ng-if="contact.id">\n                <label class="control-label">{{\'APPLICATION_SERVICE\' | translate}}</label>\n                <input type="text" name="service" placeholder="{{\'APPLICATION_SERVICE\' | translate}}" class="form-control" data-ng data-ng-model="contact.Service.name" disabled/>\n              </div>\n              <!-- END SERVICE -->\n              <!-- START SERVICE -->\n              <div data-ng-if="!contact.id" class="form-group" data-ng-class="{\'has-error\': forms.general.ServiceId.$invalid && forms.general.$submitted}">\n                <label class="control-label">{{\'APPLICATION_SERVICE\' | translate}}</label>\n                <ui-select data-ng-model="contact.ServiceId" theme="bootstrap" name="ServiceId" data-ng-change="getCustomFields()">\n                  <ui-select-match placeholder="{{ \'APPLICATION_SERVICE\' | translate }}">{{$select.selected.name}}</ui-select-match>\n                  <ui-select-choices repeat="service.id as service in services | filter: $select.search">\n                    <div ng-bind-html="service.name | highlight: $select.search"></div>\n                  </ui-select-choices>\n                </ui-select>\n                <span data-ng-show="forms.general.ServiceId.$invalid && forms.general.$submitted" class="help-block help-block-error">\n                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                </span>\n              </div>\n              <!-- END SERVICE -->\n            </div>\n            </div>\n            <div data-ng-class="{\'hidden\':detail.tab != \'other\'}" class="portlet-body contact-portlet row">\n              <div class="col-md-4">\n              <!-- START STREET -->\n              <div class="form-group" data-ng-class="{\'has-error\': (forms.general.street.$touched || forms.general.$submitted) && forms.general.street.$invalid}">\n                <label class="control-label">{{\'APPLICATION_STREET\' | translate}}</label>\n                <input type="text" name="street" placeholder="{{\'APPLICATION_STREET\' | translate}}" class="form-control" data-ng-model="contact.street"/>\n                <span data-ng-show="(forms.general.street.$touched || forms.general.$submitted) && forms.general.street.$error.required" class="help-block help-block-error">\n                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                </span>\n              </div>\n              <!-- END STREET -->\n\n              <!-- START POSTALCODE -->\n              <div class="form-group" data-ng-class="{\'has-error\': (forms.general.postalCode.$touched || forms.general.$submitted) && forms.general.postalCode.$invalid}">\n                <label class="control-label">{{\'APPLICATION_POSTALCODE\' | translate}}</label>\n                <input type="text" name="postalCode" placeholder="{{\'APPLICATION_POSTALCODE\' | translate}}" class="form-control" data-ng-model="contact.postalCode"/>\n                <span data-ng-show="(forms.general.postalCode.$touched || forms.general.$submitted) && forms.general.postalCode.$error.required" class="help-block help-block-error">\n                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                </span>\n              </div>\n              <!-- END POSTALCODE -->\n\n              <!-- START CITY -->\n              <div class="form-group" data-ng-class="{\'has-error\': (forms.general.city.$touched || forms.general.$submitted) && forms.general.city.$invalid}">\n                <label class="control-label">{{\'APPLICATION_CITY\' | translate}}</label>\n                <input type="text" name="city" placeholder="{{\'APPLICATION_CITY\' | translate}}" class="form-control" data-ng-model="contact.city"/>\n                <span data-ng-show="(forms.general.city.$touched || forms.general.$submitted) && forms.general.city.$error.required" class="help-block help-block-error">\n                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                </span>\n              </div>\n              <!-- END CITY -->\n            </div>\n            <div class="col-md-4">\n              <!-- START COUNTRY -->\n              <div class="form-group" data-ng-class="{\'has-error\': (forms.general.country.$touched || forms.general.$submitted) && forms.general.country.$invalid}">\n                <label class="control-label">{{\'APPLICATION_COUNTRY\' | translate}}</label>\n                <input type="text" name="country" placeholder="{{\'APPLICATION_COUNTRY\' | translate}}" class="form-control" data-ng-model="contact.country"/>\n                <span data-ng-show="(forms.general.country.$touched || forms.general.$submitted) && forms.general.country.$error.required" class="help-block help-block-error">\n                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                </span>\n              </div>\n              <!-- END COUNTRY -->\n\n              <!-- START DATEOFBIRTH -->\n              <div class="form-group" data-ng-class="{\'has-error\': (forms.general.dateOfBirth.$touched || forms.general.$submitted) && forms.general.dateOfBirth.$invalid}">\n                <label class="control-label">{{\'APPLICATION_DATEOFBIRTH\' | translate}}</label>\n                <input name="dateOfBirth" type="date" placeholder="{{\'APPLICATION_DATEOFBIRTH\' | translate}}" class="form-control date-picker" data-ng-model="contact.dateOfBirth"/>\n                <span data-ng-show="(forms.general.dateOfBirth.$touched || forms.general.$submitted) && forms.general.dateOfBirth.$error.required" class="help-block help-block-error">\n                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                </span>\n              </div>\n              <!-- END DATEOFBIRTH -->\n\n              <!-- START DESCRIPTION -->\n              <div class="form-group">\n                <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n                <textarea style="resize: vertical;" type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="contact.description"></textarea>\n              </div>\n              <!-- END DESCRIPTION -->\n            </div>\n            <div class="col-md-4">\n              <!-- START CREATED_BY -->\n              <div class="form-group" data-ng-if="contact.id">\n                <label class="control-label">{{\'APPLICATION_CREATED_BY\' | translate}}</label>\n                <input type="text" name="createdBy" placeholder="{{\'APPLICATION_CREATED_BY\' | translate}}" class="form-control" data-ng-model="contact.User.name" disabled/>\n              </div>\n              <!-- END CREATED_BY -->\n            </div>\n            </div>\n            </div>\n            <button type="submit" class="btn btn-circle green-haze btn-sm" data-ng-disabled="!contact.firstName">{{submitButtonLabel}}</button>\n          </div>\n          <!-- END PORTLET -->\n          <!-- BEGIN PORTLET -->\n          <div class="portlet light" data-ng-if="customFields.length">\n            <div class="portlet-title tabbable-line">\n              <div class="caption caption-md">\n                <i class="icon-globe theme-font hide"></i>\n                <span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_CUSTOM_FIELDS\' | translate}}</span>\n              </div>\n            </div>\n            <div class="portlet-body">\n              <div data-ng-repeat="customField in customFields">\n                <div data-ng-if="customField.type==\'text\'" class="form-group" data-ng-class="{\'has-error\': (forms.general[customField.name].$touched || forms.general.$submitted) && forms.general[customField.name].$invalid}">\n                  <label class="control-label">{{customField.alias}}</label>\n                  <input type="text" name="{{customField.name}}" placeholder="{{customField.alias}}" class="form-control" data-ng-model="contact[customField.name]"/>\n                  <span data-ng-show="(forms.general[customField.name].$touched || forms.general.$submitted) && forms.general[customField.name].$error.required" class="help-block help-block-error">\n                    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                  </span>\n                </div>\n                <div data-ng-if="customField.type==\'select\'" class="form-group" data-ng-class="{\'has-error\': forms.general[customField.name].$invalid && forms.general.$submitted}">\n                  <label class="control-label">{{customField.alias}}</label>\n                  <ui-select data-ng-model="contact[customField.name]" theme="bootstrap" name="{{customField.name}}" data-ng-disabled="disabled">\n                    <ui-select-match allow-clear placeholder="{{customField.alias}}">{{$select.selected.value}}</ui-select-match>\n                    <ui-select-choices repeat="choice.value as choice in customField.values | filter: $select.search">\n                      <div ng-bind-html="choice.value | highlight: $select.search"></div>\n                    </ui-select-choices>\n                  </ui-select>\n                  <span data-ng-show="forms.general[customField.name].$invalid && forms.general.$submitted" class="help-block help-block-error">\n                    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                  </span>\n                </div>\n              </div>\n              <button type="submit" class="btn btn-circle green-haze btn-sm" data-ng-disabled="!contact.firstName">{{submitButtonLabel}}</button>\n            </div>\n        </div>\n        <!-- END PORTLET -->\n      </div>\n      <div class="tab-pane fade" id="tab_1_2{{contact.id || \'\'}}">\n          <!-- BEGIN PORTLET -->\n          <div class="portlet light">\n            <div class="portlet-title tabbable-line">\n              <div class="caption caption-md">\n                <i class="icon-globe theme-font hide"></i>\n                <span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_LOG\' | translate}}</span>\n              </div>\n              <ul class="nav nav-tabs">\n                <li class="active">\n                  <a href="#" data-target="#tab_2_1" data-toggle="tab">{{ \'APPLICATION_JOURNAL\' | translate}}</a>\n                </li>\n                <li>\n                  <a href="#" data-target="#tab_2_2" data-toggle="tab">{{ \'APPLICATION_HISTORY\' | translate}}</a>\n                </li>\n              </ul>\n            </div>\n            <div class="portlet-body">\n              <!--BEGIN TABS-->\n              <div class="tab-content">\n                <div class="tab-pane active" id="tab_2_1">\n                  <div class="contact-portlet">\n                    <div class="actions">\n                      <div class="btn-group btn-group-devided" data-toggle="buttons">\n                        <label class="btn btn-transparent grey-salsa btn-circle btn-sm" data-ng-class="{\'active\':log.journal.show === \'phone\'}" data-ng-click="updateLog(\'journal\',\'phone\')">\n                        <input type="radio" class="toggle">{{\'APPLICATION_PHONES\' | translate}}</label>\n                        <label class="btn btn-transparent grey-salsa btn-circle btn-sm" data-ng-class="{\'active\':log.journal.show === \'email\'}" data-ng-click="updateLog(\'journal\',\'email\',\'general\')">\n                        <input type="radio" class="toggle">{{\'APPLICATION_EMAILS\' | translate}}</label>\n                      </div> |\n                      <div class="btn-group btn-group-devided" data-toggle="buttons">\n                        <label class="btn btn-transparent grey-salsa btn-circle btn-sm" data-ng-class="{\'active\':log.journal.type === \'inbound\'}" data-ng-click="updateLog(\'journal\',false,false,\'inbound\')">\n                        <input type="radio" class="toggle">{{\'APPLICATION_INBOUND\' | translate}}</label>\n                        <label class="btn btn-transparent grey-salsa btn-circle btn-sm" data-ng-class="{\'active\':log.journal.type === \'outbound\'}" data-ng-click="updateLog(\'journal\',false,\'general\',\'outbound\')">\n                        <input type="radio" class="toggle">{{\'APPLICATION_OUTBOUND\' | translate}}</label>\n                      </div> |\n                      <div class="btn-group btn-group-devided" data-toggle="buttons" data-ng-if="log.journal.show==\'phone\'">\n                        <label class="btn btn-transparent grey-salsa btn-circle btn-sm" data-ng-class="{\'active\':log.journal.detail === \'general\'}" data-ng-click="updateLog(\'journal\',false,\'general\',false)">\n                        <input type="radio" class="toggle">{{\'APPLICATION_GENERAL\' | translate}}</label>\n                        <label data-ng-if="log.journal.type===\'inbound\'" class="btn btn-transparent grey-salsa btn-circle btn-sm" data-ng-class="{\'active\':log.journal.detail === \'queue\'}" data-ng-click="updateLog(\'journal\',false,\'queue\',\'inbound\')">\n                        <input type="radio" class="toggle">{{\'APPLICATION_QUEUES\' | translate}}</label>\n                      </div>\n                    </div>\n                    <div data-ng-if="gridOptionsjournal"  ui-grid="gridOptionsjournal"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n                      <div class="watermark" ng-show="!gridOptionsjournal.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n                    </div>\n                  </div>\n              </div>\n                <div class="tab-pane" id="tab_2_2">\n                  <div class="contact-portlet">\n                    <div class="actions">\n                      <div class="btn-group btn-group-devided" data-toggle="buttons">\n                        <label class="btn btn-transparent grey-salsa btn-circle btn-sm" data-ng-class="{\'active\':log.history.show === \'phone\'}" data-ng-click="updateLog(\'history\',\'phone\')">\n                        <input type="radio" class="toggle">{{\'APPLICATION_PHONES\' | translate}}</label>\n                        <label class="btn btn-transparent grey-salsa btn-circle btn-sm" data-ng-class="{\'active\':log.history.show === \'email\'}" data-ng-click="updateLog(\'history\',\'email\',\'general\')">\n                        <input type="radio" class="toggle">{{\'APPLICATION_EMAILS\' | translate}}</label>\n                      </div> |\n                      <div class="btn-group btn-group-devided" data-toggle="buttons">\n                        <label class="btn btn-transparent grey-salsa btn-circle btn-sm" data-ng-class="{\'active\':log.history.type === \'inbound\'}" data-ng-click="updateLog(\'history\',false,false,\'inbound\')">\n                        <input type="radio" class="toggle">{{\'APPLICATION_INBOUND\' | translate}}</label>\n                        <label class="btn btn-transparent grey-salsa btn-circle btn-sm" data-ng-class="{\'active\':log.history.type === \'outbound\'}" data-ng-click="updateLog(\'history\',false,\'general\',\'outbound\')">\n                        <input type="radio" class="toggle">{{\'APPLICATION_OUTBOUND\' | translate}}</label>\n                      </div> |\n                      <div class="btn-group btn-group-devided" data-toggle="buttons" data-ng-if="log.history.show==\'phone\'">\n                        <label class="btn btn-transparent grey-salsa btn-circle btn-sm" data-ng-class="{\'active\':log.history.detail === \'general\'}" data-ng-click="updateLog(\'history\',false,\'general\',false)">\n                        <input type="radio" class="toggle">{{\'APPLICATION_GENERAL\' | translate}}</label>\n                        <label data-ng-if="log.history.type===\'inbound\'" class="btn btn-transparent grey-salsa btn-circle btn-sm" data-ng-class="{\'active\':log.history.detail === \'queue\'}" data-ng-click="updateLog(\'history\',false,\'queue\',\'inbound\')">\n                        <input type="radio" class="toggle">{{\'APPLICATION_QUEUES\' | translate}}</label>\n                      </div>\n                    </div>\n                    <div data-ng-if="gridOptionshistory"  ui-grid="gridOptionshistory"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n                      <div class="watermark" ng-show="!gridOptionshistory.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n                    </div>\n                  </div>\n                </div>\n              </div>\n              <!--END TABS-->\n            </div>\n          </div>\n          <!-- END PORTLET -->\n        </div>\n    <!-- END PROFILE CONTENT -->\n  </form>\n</div>\n  </div>\n</div>\n'),
+a.put("app/main/template/template.jscriptyTab.html",'<div class="portlet light bordered">\n\n    <!-- BEGIN PORTLET BODY -->\n    <div class="portlet-body">\n          <div class="row">\n              <!-- BEGIN SIDEBAR -->\n                <div  class="profile-sidebar" style="width: 250px;">\n                  <!-- PORTLET MAIN -->\n              				<!-- SIDEBAR MENU -->\n              				<div class="profile-usermenu">\n              					<ul class="nav">\n              						<li  ng-repeat= \'question in questions track by $index\' ng-class="{active: $index == count}">\n\n              							<a  ng-click="setCurrentQuestion($index)" >\n  																	<i class="fa fa-check"></i> <label ng-if="attribute.nodeName == \'label\'" ng-repeat=\'attribute in question.value.attributes track by $index\'>{{attribute.value}}</label>\n\n                            </a>\n              						</li>\n              					</ul>\n              				</div>\n              				<!-- END SIDEBAR MENU -->\n                    <!-- END PORTLET MAIN -->\n                </div>\n                  <!-- END SIDEBAR -->\n                  <div   class="profile-content">\n                        <div class="portlet box blue-hoki">\n        												<div class="portlet-title">\n\n        													<div class="caption" >\n        														<i class="fa fa-edit"></i>\n                                 <span ng-if="attribute.nodeName ==\'label\'" ng-repeat=\'attribute in currentQuestion.value.attributes\' class="caption-subject">{{attribute.value}} </span>\n\n        													</div>\n\n\n        												</div>\n                                <div class="portlet-body form ">\n                                  <div class="row">\n																		<div class="col-md-11 col-md-offset-1 ">\n                                        <form >\n                                          <div class="form-body" style="height: 400px; overflow-y: auto;overflow-x:hidden">\n\n                                             <!-- Question  -->\n                                             <div class="form-group" style="word-wrap: break-word;" >\n                                                <h3 ng-if="attribute.nodeName ==\'question\'" ng-repeat=\'attribute in currentQuestion.value.attributes\'>{{attribute.value}}</h3>\n                                              </div>\n                                              <!-- Buttons  -->\n\n                                                <div class="row">\n                                                  <div class="col-md-6">\n                                                    <ul class="nav nav-pills nav-stacked" >\n                                                      <li  ng-repeat=\'edge in currentQuestion.edges track by $index\'  style="background-color: #E8F7FC" ng-show="(edge.source.id == currentQuestion.id) && edge.value" ng-class="{active: (edge.value) == currentQuestion.answer}">\n                                                        <a  ng-click="next(edge.target, edge.value)" >\n                                                                <span style=" display:block;word-break:break-all;">{{edge.value}}</span>\n                                                            </a>\n                                                      </li>\n                                                    </ul>\n                                                  </div>\n                                                </div>\n\n\n                                               <!-- Question Other Option  -->\n\n                                               <div class="form-group" ng-if= "attribute.nodeName ==\'other\' && attribute.value " ng-repeat=\'attribute in currentQuestion.value.attributes track by $index\'>\n                                                 <div class="col-md-4">\n                                                   <label class="control-label">{{attribute.value}}</label>\n                                                 </div>\n                                                    <div class="col-md-8">\n                                                      <textarea  style="overflow:auto" ng-model="currentQuestion.otheranswer" placeholder="Enter text" rows="8" cols="40" ></textarea>\n                                                    </div>\n\n                    													</div>\n                                              <!--  Inputs -->\n\n                                                  <div class="row margin-top-10"  ng-repeat=\'question in currentQuestion.children track by $index\'>\n                                                              <div class="col-md-10 col-md-offset-1">\n                                                                <div  ng-repeat=\'attribute in question.value.attributes track by $index\'>\n                                                                      <div  ng-switch="attribute.nodeName">\n                                                                          <div ng-class="col-md-2" ng-switch-when="label">\n                                                                            <label class="control-label" style=" display:block;word-break:break-all;" >{{attribute.value}}</label>\n\n                                                                          </div>\n\n                                                                          <div ng-class="attribute.value != \'checkbox\' ? \'col-md-10 pull-right\': \'col-md-2\'" ng-switch-when="type" ng-switch="attribute.value">\n                                                                              <input class="form-control" ng-switch-when="text" type="text" ng-model="question.answer" />\n                                                                              <input  class="form-control" ng-switch-when="number" type="number" ng-model="question.answer" />\n                                                                              <input  class=" pull-right"  ng-switch-when="checkbox" type="checkbox" ng-model="question.answer" ng-true-value="\'Selected\'" ng-false-value="\'Not Selected\'"/>\n                                                                              <textarea  class="form-control" ng-switch-when="textarea" ng-model="question.answer" rows="8" cols="40"></textarea>\n\n                                                                          </div>\n\n                                                                      </div>\n                                                                </div>\n                                                              </div>\n\n                                                  </div>\n\n                                          </div>\n                                          <!-- actions -->\n                                          <div class="form-actions">\n                                            <div class="btn-set pull-left">\n                                              <button class="btn red-haze "   ng-click="end()"><span class="fa fa-times" > End</span></button>\n\n                                            </div>\n                                            <div class="btn-set pull-right">\n                                               <button class="btn blue-haze"  ng-show="count" ng-click="back()"><span class="glyphicon glyphicon-chevron-left"></span>Back</button>\n                                                <button ng-repeat=\'edge in currentQuestion.edges track by $index\' ng-show="(edge.source.id == currentQuestion.id) && !edge.value" class="btn blue-hoki"   ng-click="next(edge.target)">Next<span class="glyphicon glyphicon-chevron-right" ></span></button>\n\n                                            </div>\n                                          </div>\n                                          </form>\n                                  </div>\n                                </div>\n                            </div>\n                        </div>\n                 </div>\n          </div>\n  </div>\n  <!-- END PORTLET BODY -->\n</div>\n'),a.put("app/main/template/template.reportBuilderView.html",'<div class="alert alert-warning alert-group">\n        <div class="form-inline" data-ng-class="{\'has-error\': forms.report.$submitted && !group.rules.length}">\n            <select ng-options="o.name as o.name for o in operators" ng-model="group.operator" class="form-control input-sm"></select>\n            <button style="margin-left: 5px" type="button" ng-click="addCondition()" class="btn btn-sm btn-success"><span class="glyphicon glyphicon-plus-sign"></span> {{\'APPLICATION_ADD_CONDITION\' | translate}}</button>\n            <button style="margin-left: 5px" type="button" ng-click="addGroup()" class="btn btn-sm btn-success"><span class="glyphicon glyphicon-plus-sign"></span> {{\'APPLICATION_ADD_GROUP\' | translate}}</button>\n            <button style="margin-left: 5px" type="button" ng-click="removeGroup()" class="btn btn-sm btn-danger"><span class="glyphicon glyphicon-minus-sign"></span> {{\'APPLICATION_REMOVE_GROUP\' | translate}}</button>\n        </div>\n        <div class="group-conditions">\n            <div ng-repeat="rule in group.rules | orderBy:\'index\'" class="condition">\n                <div ng-switch="rule.hasOwnProperty(\'group\')">\n                    <div ng-switch-when="true">\n                        <report-builder group="rule.group" fields="fields" forms="forms"></report-builder>\n                    </div>\n                    <div ng-switch-default="ng-switch-default">\n                        <div class="row">\n                          <div class="col-md-2" data-ng-class="{\'has-error\': forms.report.$submitted && !rule.field}">\n                          <ui-select data-ng-model="rule.field" theme="bootstrap" dynamic-name="randomName()" required>\n                            <ui-select-match placeholder="">{{$select.selected.field | translate}}</ui-select-match>\n                            <ui-select-choices repeat="field.field as field in fields | filter: $select.search">\n                              <div ng-bind-html="field.field | highlight: $select.search"></div>\n                            </ui-select-choices>\n                          </ui-select>\n                          <span data-ng-show="forms.report.$submitted && !rule.field" class="help-block help-block-error">\n                            <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                          </span>\n                        </div>\n                          <ui-select data-ng-model="rule.condition" theme="bootstrap" class="col-md-1" dynamic-name="randomName()">\n                            <ui-select-match placeholder="">{{$select.selected.name}}</ui-select-match>\n                            <ui-select-choices repeat="condition.name as condition in conditions | filter: $select.search">\n                              <div ng-bind-html="condition.name | highlight: $select.search"></div>\n                            </ui-select-choices>\n                          </ui-select>\n                          <div class="col-md-2 left-margin" data-ng-class="{\'has-error\': forms.report.$submitted && !rule.value}">\n                            <input type="text" ng-model="rule.value" class="form-control" dynamic-name="randomName()" required/>\n                            <span data-ng-show="forms.report.$submitted && !rule.value" class="help-block help-block-error">\n															<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n														</span>\n                          </div>\n                            <button style="margin-left: 5px" ng-click="removeCondition($index)" class="btn btn-sm btn-danger" type="button"><span class="glyphicon glyphicon-minus-sign"></span></button>\n                        </div>\n                    </div>\n                </div>\n            </div>\n        </div>\n    </div>\n'),a.put("app/market/market.html",'<div class="row">\n	<div class="col-md-12">\n			<div class="page-bar">\n				<ul class="page-breadcrumb">\n					<li>\n						<i class="icon-rocket"></i>\n						<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-handbag"></i>\n						<a href="/market">Market Place</a>\n          </li>\n        </ul>\n			</div>\n		</div>\n</div>\n<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initView()">\n  <div class="col-md-12">\n    <!-- Our Integration -->\n    <div class="headline">\n      <h3>Our Integrations</h3>\n    </div>\n    <div class="row thumbnails" data-ng-repeat="group in groupedIntegration">\n      <div class="col-md-3" data-ng-repeat="integration in group">\n        <div class="our-integrations">\n          <h3> {{integration.name}} <small> {{integration.author}}</small></h3>\n          <img data-ng-src="{{integration.logo}}" alt="{{integration.name}}" class="img-responsive"/>\n          <div class="integration-info" data-ng-if="!integration.downloading">\n            <p>\n              {{integration.description}}\n            </p>\n            <div class="pull-right">\n	            <a data-ng-disabled="isProgressing" data-ng-if="!integration.active" data-ng-click="installIntegration(integration)" href="#" class="btn btn-xs green-meadow">Install <i class="fa fa-download"></i></a>\n							<a data-ng-disabled="isProgressing" data-ng-if="integration.active" data-ng-click="uninstallIntegration(integration)" href="#" class="btn btn-xs red-sunglo">Uninstall <i class="fa fa-trash"></i></a>\n	            <a href="https://wiki.xcallymotion.com/" class="btn btn-xs grey-cascade" target="_blank">More <i class="fa fa-link"></i></a>\n            </div>\n          </div>\n					<div class="integration-info" data-ng-if="integration.downloading">\n						<div>\n							<uib-progressbar class="progress-striped active" value="percentage" type="success"><i style="color:black;">{{status}}</i></uib-progressbar>\n						</div>\n          </div>\n        </div>\n      </div>\n		</div>\n    <!--/thumbnails-->\n    <!-- //End Meer Our Team -->\n  </div>\n</div>\n'),a.put("app/motionbar/motionbar.chat.html",'<div data-ng-include="\'components/quickSidebar/quickSidebar.html\'" data-ng-controller="QuickSidebarController" class="page-quick-sidebar-wrapper" style="margin-top: -92px;"></div>\n'),a.put("app/salesforce/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-handbag"></i>\n					<a href="/salesforce/list">{{ \'APPLICATION_SALESFORCE\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-handbag font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_SALESFORCE\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="accounts.checked.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<a class="btn green-jungle" href="/salesforce/wizard">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_ACCOUNT\' | translate }}\n						</a>\n					</div>\n					<a class="btn btn-icon-only btn-default" href="#" ng-csv="getAccounts([\'name\',\'username\',\'remoteUri\',\'password\',\'clientId\',\'clientSecret\',\'securityToken\'])" csv-header="[\'Name\', \'Username\', \'Remote Address\', \'Password\', \'Client Id\', \'Client Secret\', \'Security token\']" field-separator=";" filename="salesforce_accounts.csv">\n					<i class="icon-cloud-download"></i></a>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<table st-table="displayedSalesforceAccounts" st-pipe="initList" class="table table-striped table-bordered table-hover">\n					<div class="table-responsive">\n					  <thead>\n							<tr>\n								<th colspan="7">\n									<div class="row">\n										<div class="col-md-6">\n											<ui-select class="input-xsmall" ng-model="conf.accountsByPage" theme="bootstrap" ng-disabled="disabled">\n												<ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n												<ui-select-choices repeat="accountByPage in accountsByPage | filter: $select.search">\n													<div ng-bind-html="accountByPage.name | highlight: $select.search"></div>\n												</ui-select-choices>\n											</ui-select>\n										</div>\n										<div class="col-md-6">\n											<div class="input-group input-medium pull-right">\n												<input st-search placeholder="{{ \'APPLICATION_SEARCH\' | translate }}" class="form-control" type="search" />\n												<span class="input-group-addon">\n													<i class="fa fa-search"></i>\n												</span>\n											</div>\n										</div>\n									</div>\n								</th>\n							</tr>\n						  <tr>\n								<th class="small-cells" style="text-align: center; vertical-align: middle"><input type="checkbox" ng-change="check(account, checked)" checklist-model checklist-value="id"></th>\n						    <th st-sort="name">{{ \'APPLICATION_NAME\' | translate }}</th>\n						    <th st-sort="username">{{ \'APPLICATION_EMAIL\' | translate }}</th>\n								<th st-sort="remoteUri">{{ \'APPLICATION_REMOTE_ADDRESS\' | translate }}</th>\n								<th>{{ \'APPLICATION_DESCRIPTION\' | translate }}</th>\n								<th>{{ \'APPLICATION_ACTIONS\' | translate }}</th>\n						  </tr>\n					  </thead>\n					  <tbody>\n					    <tr data-ng-repeat="account in displayedSalesforceAccounts" class="animate-repeat">\n								<td style="text-align: center; vertical-align: middle"><input type="checkbox" checklist-model="accounts.checked" checklist-value="account.id"></td>\n					      <td>{{account.name}}</td>\n					      <td>{{account.username}}</td>\n								<td>{{account.remoteUri}}</td>\n								<td>{{account.description}}</td>\n					      <td>\n					        <a class="btn default btn-xs blue-stripe" data-ng-href="/salesforce/view/{{account.id}}/account">\n										{{ \'APPLICATION_EDIT\' | translate }}\n					        </a>\n									<a class="btn default btn-xs green-stripe" data-ng-click="checkAccount(account.id)">\n										{{ \'APPLICATION_CHECK_CONNECTION\' | translate }}\n					        </a>\n					        <a class="btn default btn-xs red-stripe" data-ng-click="deleteItem(account.name,account.id)">\n										{{ \'APPLICATION_DELETE\' | translate }}\n					        </a>\n					      </td>\n					    </tr>\n							<tr data-ng-hide="displayedSalesforceAccounts.length">\n								<td colspan="7" style="text-align:center;">\n									<i>No account available</i>\n								</td>\n							</tr>\n					  </tbody>\n					  <tfoot>\n							<tr>\n								<td/>\n						    <td>\n									<div class="input-icon right">\n										<i class="fa fa-search"></i>\n										<input st-search="name" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_NAME\' | translate | lowercase}}" class="form-control" type="search"/>\n									</div>\n						    </td>\n						    <td>\n									<div class="input-icon right">\n										<i class="fa fa-search"></i>\n										<input st-search="email" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_EMAIL\' | translate | lowercase}}" class="form-control" type="search"/>\n									</div>\n						    </td>\n						    <td>\n									<div class="input-icon right">\n										<i class="fa fa-search"></i>\n										<input st-search="remoteUri" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_REMOTE_ADDRESS\' | translate | lowercase}}" class="form-control" type="search"/>\n									</div>\n						    </td>\n						    <td/>\n								<td/>\n						  </tr>\n					    <tr>\n					      <td colspan="7" class="text-center">\n									<div class="pagination" st-pagination st-items-by-page="conf.accountsByPage.value" st-displayed-pages="7"></div>\n					      </td>\n					    </tr>\n					  </tfoot>\n					</div>\n				</table>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/salesforce/view/view.account.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_ACCOUNT\' | translate}}</span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{\'APPLICATION_GENERALS\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.formSetting" data-ng-submit="forms.formSetting.$valid && updateItem()" novalidate>\n              <!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="account.name" required/>\n								<span data-ng-show="forms.formSetting.name.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="account.description"/>\n							</div>\n							<!-- END DESCRIPTION -->\n\n              <!-- START USERNAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.username.$invalid}">\n								<label class="control-label">{{\'APPLICATION_USERNAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="username" placeholder="{{\'APPLICATION_USERNAME\' | translate}}" class="form-control" data-ng-model="account.username" required/>\n								<span data-ng-show="forms.formSetting.username.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END USERNAME -->\n\n              <!-- START REMOTE ADDRESS -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.remoteUri.$invalid}">\n								<label class="control-label">{{\'APPLICATION_REMOTE_ADDRESS\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="url" name="remoteUri" placeholder="{{\'APPLICATION_REMOTE_ADDRESS\' | translate}}" class="form-control" data-ng-model="account.remoteUri" required />\n								<span data-ng-show="forms.formSetting.remoteUri.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END USERNAME -->\n\n							<!-- START PASSWORD -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.password.$invalid}">\n								<label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="password" name="password" placeholder="{{\'APPLICATION_PASSWORD\' | translate}}" class="form-control" data-ng-model="account.password" required/>\n								<span data-ng-show="forms.formSetting.password.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END PASSWORD -->\n\n              <!-- START CLIENT ID -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.clientId.$invalid}">\n								<label class="control-label">{{\'APPLICATION_CLIENT_ID\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="clientId" placeholder="{{\'APPLICATION_CLIENT_ID\' | translate}}" class="form-control" data-ng-model="account.clientId" required/>\n								<span data-ng-show="forms.formSetting.clientId.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END CLIENT ID -->\n\n              <!-- START CLIENT SECRET -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.clientSecret.$invalid}">\n								<label class="control-label">{{\'APPLICATION_CLIENT_SECRET\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="clientSecret" placeholder="{{\'APPLICATION_CLIENT_SECRET\' | translate}}" class="form-control" data-ng-model="account.clientSecret" required/>\n								<span data-ng-show="forms.formSetting.clientSecret.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END CLIENT SECRET -->\n\n              <!-- START SECURITY TOKEN -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.securityToken.$invalid}">\n								<label class="control-label">{{\'APPLICATION_SECURITY_TOKEN\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="securityToken" placeholder="{{\'APPLICATION_SECURITY_TOKEN\' | translate}}" class="form-control" data-ng-model="account.securityToken" required/>\n								<span data-ng-show="forms.formSetting.securityToken.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END SECURITY TOKEN -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END GENERAL TAB -->\n\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/salesforce/view/view.configuration.html",'<div class="row" data-ng-init="initConfiguration()">\n	<div class="col-md-12">\n		<!-- BEGIN  PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-notebook font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_CONFIGURATION\' | translate }} WIZARD</a> </span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<wizard on-finish="createConfiguration()">\n	        <wz-step title="{{\'APPLICATION_SETTINGS\' | translate}}" canexit="formValidation(formsConfiguration.info.$valid)">\n							<form name="formsConfiguration.info" novalidate>\n								<!-- START NAME -->\n								<div class="form-group" data-ng-class="{\'has-error\': formsConfiguration.info.$submitted && formsConfiguration.info.name.$invalid}">\n									<label class="control-label">{{\'APPLICATION_NAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n									<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="configuration.name" required/>\n									<span data-ng-show="formsConfiguration.info.name.$invalid && formsConfiguration.info.$submitted" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END NAME -->\n								<!-- START DESCRIPTION -->\n								<div class="form-group">\n									<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n									<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="configuration.description"/>\n								</div>\n								<!-- END DESCRIPTION -->\n\n								<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" data-ng-click="goNext()"/>\n							</form>\n						</wz-step>\n\n						<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n							<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n							<input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n						</wz-step>\n				</wizard>\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/salesforce/view/view.configurationSettings.html",'<div class="row" data-ng-init="getConfiguration();getVariables();getFields();">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_CONFIGURATION\' | translate}}: {{configurationName}}</span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{\'APPLICATION_SUBJECT\' | translate}}</a>\n					</li>\n          <li>\n						<a href="#" data-target="#tab_1_2" data-toggle="tab">{{\'APPLICATION_DESCRIPTION\' | translate}}</a>\n					</li>\n          <li>\n						<a href="#" data-target="#tab_1_3" data-toggle="tab">{{\'APPLICATION_FIELDS\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- SUBJECT TAB -->\n					<div class="tab-pane ui-padding active" id="tab_1_1">\n            <div class="row">\n              <div class="col-md-11">\n                <span class="caption-subject">All following fields will be join by blank space:</span>\n              </div>\n              <div class="col-md-1 pull-rigth">\n                <button class="btn btn-icon-only green" data-ng-click="addItemSubject()"><i class="fa fa-plus"></i></button>\n              </div>\n            </div>\n            <hr>\n						<!-- <div ng-scrollbars ng-scrollbars-config="config"> -->\n	            <div class="row" data-ng-repeat="subjectItem in subjectConfig">\n	              <div class="col-md-3">\n	                <ui-select ng-model="subjectItem.type" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeType(subjectItem)">\n	                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n	                  <ui-select-choices repeat="item in fieldType | filter: $select.search">\n	                    <div ng-bind-html="item | highlight: $select.search | capitalize"></div>\n	                  </ui-select-choices>\n	                </ui-select>\n	              </div>\n	              <div class="col-md-8" data-ng-if="subjectItem.type==\'string\'">\n	                <div class="form-group">\n	                  <input type="text" class="form-control" data-ng-model="subjectItem.content" data-ng-change="updateField(subjectItem)">\n	                </div>\n	              </div>\n	              <div class="col-md-8" data-ng-if="subjectItem.type==\'variable\'">\n	                <div class="form-group">\n	                  <ui-select theme="bootstrap" ng-disabled="disabled" data-ng-model="subjectItem.VariableId" data-ng-change="updateField(subjectItem)">\n	                    <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n	                    <ui-select-choices repeat="variable.id as variable in variables | filter: $select.search">\n	                      <div ng-bind-html="variable.name | highlight: $select.search"></div>\n	                    </ui-select-choices>\n	                  </ui-select>\n	                </div>\n	              </div>\n	              <div class="col-md-1">\n	                <div class="form-group">\n	                  <button class="btn btn-icon-only red" data-ng-click="removeItem(subjectItem)"><i class="fa fa-times"></i></button>\n	                </div>\n	              </div>\n	            </div>\n						<!-- </div> -->\n					</div>\n					<!-- END SUBJECT TAB -->\n          <!-- DESCRIPTION TAB -->\n					<div class="tab-pane ui-padding" id="tab_1_2">\n						<div class="row">\n              <div class="col-md-11">\n                <span class="caption-subject">All following fields will be join by new line:</span>\n              </div>\n              <div class="col-md-1 pull-rigth">\n                <button class="btn btn-icon-only green" data-ng-click="addItemDescription()"><i class="fa fa-plus"></i></button>\n              </div>\n            </div>\n            <hr>\n						<!-- <div ng-scrollbars ng-scrollbars-config="config"> -->\n							<div class="row" data-ng-repeat="descriptionItem in descriptionConfig">\n								<!-- <pre>\n									{{descriptionItem|json}}\n								</pre> -->\n	              <div class="col-md-2">\n	                <ui-select ng-model="descriptionItem.type" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeDescType(descriptionItem)">\n	                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected | ucfirst}}</ui-select-match>\n	                  <ui-select-choices repeat="item in descFieldType | filter: $select.search">\n	                    <div ng-bind-html="item | highlight: $select.search | ucfirst"></div>\n	                  </ui-select-choices>\n	                </ui-select>\n	              </div>\n	              <div class="col-md-9" data-ng-if="descriptionItem.type==\'string\'">\n	                <div class="form-group">\n	                  <input type="text" class="form-control" data-ng-model="descriptionItem.content" data-ng-change="updateField(descriptionItem)">\n	                </div>\n	              </div>\n								<div class="col-md-3" data-ng-if="descriptionItem.type==\'key_value\'">\n									<input type="text" class="form-control" placeholder="Key" data-ng-model="descriptionItem.key" data-ng-change="updateField(descriptionItem)">\n								</div>\n								<div class="col-md-3" data-ng-if="descriptionItem.type==\'key_value\'">\n									<ui-select ng-model="descriptionItem.keyType" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeDescType(descriptionItem)">\n	                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n	                  <ui-select-choices repeat="item in fieldType | filter: $select.search">\n	                    <div ng-bind-html="item | highlight: $select.search | capitalize"></div>\n	                  </ui-select-choices>\n	                </ui-select>\n								</div>\n								<div class="col-md-3" data-ng-if="descriptionItem.type==\'key_value\' && descriptionItem.keyType==\'string\'">\n									<input type="text" class="form-control" placeholder="Value" data-ng-model="descriptionItem.keyContent" data-ng-change="updateField(descriptionItem)">\n								</div>\n	              <div class="col-md-3" data-ng-if="descriptionItem.type==\'key_value\' && descriptionItem.keyType==\'variable\'">\n	                <div class="form-group">\n	                  <ui-select theme="bootstrap" ng-disabled="disabled" data-ng-model="descriptionItem.VariableId" data-ng-change="updateField(descriptionItem)">\n	                    <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n	                    <ui-select-choices repeat="variable.id as variable in variables | filter: $select.search">\n	                      <div ng-bind-html="variable.name | highlight: $select.search"></div>\n	                    </ui-select-choices>\n	                  </ui-select>\n	                </div>\n	              </div>\n	              <div class="col-md-1">\n	                <div class="form-group">\n	                  <button class="btn btn-icon-only red" data-ng-click="removeItem(descriptionItem)"><i class="fa fa-times"></i></button>\n	                </div>\n	              </div>\n	            </div>\n						<!-- </div> -->\n					</div>\n					<!-- END DESCRIPTION TAB -->\n          <!-- FIELDS TAB -->\n					<div class="tab-pane ui-padding" id="tab_1_3">\n						<div class="row">\n              <div class="col-md-11">\n                <span class="caption-subject">Add how to fill the fields present in your account:</span>\n              </div>\n              <div class="col-md-1 pull-rigth">\n                <button class="btn btn-icon-only green" data-ng-click="addItemField()"><i class="fa fa-plus"></i></button>\n              </div>\n            </div>\n            <hr>\n						<!-- <div ng-scrollbars ng-scrollbars-config="config"> -->\n	            <div class="row" data-ng-repeat="fieldItem in fieldConfig">\n	              <div class="col-md-3">\n	                <ui-select ng-model="fieldItem.idField" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeFieldType(fieldItem)">\n	                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.label}}</ui-select-match>\n	                  <ui-select-choices repeat="item.name as item in accountFields | filter: $select.search">\n	                    <div ng-bind-html="item.label | highlight: $select.search"></div>\n	                  </ui-select-choices>\n	                </ui-select>\n	              </div>\n	              <div class="col-md-8" data-ng-if="getSystemFieldOptions(fieldItem.idField)">\n	                <div class="form-group">\n										<ui-select ng-model="fieldItem.content" theme="bootstrap" ng-disabled="disabled" data-ng-change="updateField(fieldItem)">\n		                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.label}}</ui-select-match>\n		                  <ui-select-choices repeat="item.value as item in getSystemFieldOptions(fieldItem.idField) | filter: $select.search">\n		                    <div ng-bind-html="item.value | highlight: $select.search"></div>\n		                  </ui-select-choices>\n		                </ui-select>\n	                </div>\n	              </div>\n								<div class="col-md-4" data-ng-if="!getSystemFieldOptions(fieldItem.idField)">\n									<div class="form-group">\n										<ui-select ng-model="fieldItem.type" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeType(fieldItem)">\n		                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected | ucfirst}}</ui-select-match>\n		                  <ui-select-choices repeat="item in fieldType | filter: $select.search">\n		                    <div ng-bind-html="item | highlight: $select.search | ucfirst"></div>\n		                  </ui-select-choices>\n		                </ui-select>\n									</div>\n								</div>\n								<div class="col-md-4" data-ng-if="!getSystemFieldOptions(fieldItem.idField) && fieldItem.type === \'string\'">\n	                <div class="form-group">\n										<input type="text" class="form-control" data-ng-model="fieldItem.content" data-ng-change="updateField(fieldItem)">\n	                </div>\n	              </div>\n								<div class="col-md-4" data-ng-if="!getSystemFieldOptions(fieldItem.idField) && fieldItem.type === \'variable\'">\n	                <div class="form-group">\n										<ui-select theme="bootstrap" ng-disabled="disabled" data-ng-model="fieldItem.VariableId" data-ng-change="updateField(fieldItem)">\n	                    <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n	                    <ui-select-choices repeat="variable.id as variable in variables | filter: $select.search">\n	                      <div ng-bind-html="variable.name | highlight: $select.search"></div>\n	                    </ui-select-choices>\n	                  </ui-select>\n	                </div>\n	              </div>\n	              <div class="col-md-1">\n	                <div class="form-group">\n	                  <button class="btn btn-icon-only red" data-ng-click="removeItem(fieldItem)"><i class="fa fa-times"></i></button>\n	                </div>\n	              </div>\n	            </div>\n						<!-- </div> -->\n					</div>\n					<!-- END FIELDS TAB -->\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),
+a.put("app/salesforce/view/view.configurations.html",'<div ui-view class="profile-content">\n	<div class="row" data-ng-init="getConfigurations()">\n		<div class="col-md-12">\n			<div class="portlet light">\n				<div class="portlet-title  tabbable-line">\n					<div class="caption caption-md">\n						<i class="icon-globe theme-font hide"></i>\n						<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_CONFIGURATIONS\' | translate}}</span>\n					</div>\n					<div class="actions">\n						<div class="btn-group">\n							<a class="btn green-jungle " href="/salesforce/view/{{account.id}}/configuration" data-toggle="dropdown">\n								<i class="icon-plus"></i> {{ \'APPLICATION_NEW_CONFIGURATION\' | translate }}\n							</a>\n						</div>\n					</div>\n				</div>\n				<div class="portlet-body">\n					<!-- START TABLE -->\n					<table class="table table-striped table-bordered table-hover">\n						  <thead>\n							  <tr>\n							    <th>{{\'APPLICATION_NAME\' | translate}}</th>\n									<th>{{\'APPLICATION_DESCRIPTION\' | translate}}</th>\n									<th>{{ \'APPLICATION_ACTIONS\' | translate }}</th>\n							  </tr>\n						  </thead>\n							<tbody>\n						    <tr data-ng-repeat="configuration in configurations">\n									<td>{{configuration.name}}</td>\n									<td>{{configuration.description}}</td>\n						      <td>\n										<a class="btn default btn-xs blue-stripe" data-ng-href="/salesforce/view/{{account.id}}/configurations/settings/{{configuration.id}}">\n											{{ \'APPLICATION_SETTINGS\' | translate}}\n						        </a>\n						        <a class="btn default btn-xs red-stripe" data-ng-click="deleteConfiguration(configuration.name,configuration.id)">\n											{{ \'APPLICATION_DELETE\' | translate }}\n						        </a>\n						      </td>\n						    </tr>\n								<tr data-ng-hide="configurations.length">\n									<td colspan="5" style="text-align:center;">\n										<i>No configuration available</i>\n									</td>\n								</tr>\n						  </tbody>\n					</table>\n					<!-- END TABLE -->\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/salesforce/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initView()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n          <i class="icon-handbag"></i>\n          <a href="/salesforce/list">{{ \'APPLICATION_SALESFORCE\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<a href="#">{{account.name}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img src="assets/images/media/salesforce.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{account.name}}\n					</div>\n					<div class="profile-usertitle-job">\n						{{account.remoteUri}}\n					</div>\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.salesforce.view.account\')}">\n							<a ng-href="/salesforce/view/{{account.id}}/account">\n							<i class="icon-user"></i>\n							{{ \'APPLICATION_ACCOUNT\' | translate }} </a>\n						</li>\n						<li data-ng-class="{active: $state.includes(\'main.salesforce.view.configurations\') || $state.is(\'main.salesforce.view.configuration\')}">\n							<a ng-href="/salesforce/view/{{account.id}}/configurations">\n							<i class="icon-settings"></i>\n							{{ \'APPLICATION_CONFIGURATIONS\' | translate }} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/salesforce/wizard/wizard.html",'<!-- BEGIN PAGE HEADER-->\n<div class="row">\n	<div class="col-md-12">\n			<div class="page-bar">\n				<ul class="page-breadcrumb">\n					<li>\n						<i class="icon-rocket"></i>\n						<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-handbag"></i>\n						<a href="/salesforce/list">{{ \'APPLICATION_SALESFORCE\' | translate }}</a>\n					</li>\n				</ul>\n			</div>\n		</div>\n</div>\n<!-- END PAGE HEADER-->\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initWizard()">\n	<div class="col-md-12">\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-notebook font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_ACCOUNT\' | translate }} WIZARD</a> </span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<wizard on-finish="createItem()">\n          <wz-step title="{{\'APPLICATION_ACCOUNT_INFO\' | translate}}" canexit="exitValidation(forms.formSetting.$valid)">\n						<form name="forms.formSetting" novalidate>\n\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n								<span data-ng-show="forms.formSetting.name.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"/>\n							</div>\n							<!-- END DESCRIPTION -->\n\n              <!-- START USERNAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.username.$invalid}">\n								<label class="control-label">{{\'APPLICATION_USERNAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="username" placeholder="{{\'APPLICATION_USERNAME\' | translate}}" class="form-control" data-ng-model="item.username" required ng-remote-validate="/api/salesforce/accounts/validate/username"/>\n								<span data-ng-show="forms.formSetting.username.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n								<span data-ng-show="(forms.formSetting.username.$touched || forms.formSetting.$submitted) && forms.formSetting.username.$error.ngRemoteValidate" class="help-block help-block-error">\n				          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_EXIST_USERNAME\' | translate}}.\n				        </span>\n							</div>\n							<!-- END USERNAME -->\n\n\n              <!-- START REMOTE ADDRESS -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.remoteUri.$invalid}">\n								<label class="control-label">{{\'APPLICATION_REMOTE_ADDRESS\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="url" name="remoteUri" placeholder="{{\'APPLICATION_REMOTE_ADDRESS\' | translate}}" class="form-control" data-ng-model="item.remoteUri" required/>\n								<span data-ng-show="forms.formSetting.remoteUri.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END USERNAME -->\n\n              <!-- START PASSWORD -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.password.$invalid}">\n								<label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="password" name="password" placeholder="{{\'APPLICATION_PASSWORD\' | translate}}" class="form-control" data-ng-model="item.password" required/>\n								<span data-ng-show="forms.formSetting.password.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END PASSWORD -->\n\n              <!-- START CLIENT ID -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.clientId.$invalid}">\n								<label class="control-label">{{\'APPLICATION_CLIENT_ID\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="clientId" placeholder="{{\'APPLICATION_CLIENT_ID\' | translate}}" class="form-control" data-ng-model="item.clientId" required/>\n								<span data-ng-show="forms.formSetting.clientId.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END CLIENT ID -->\n\n              <!-- START CLIENT SECRET -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.clientSecret.$invalid}">\n								<label class="control-label">{{\'APPLICATION_CLIENT_SECRET\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="clientSecret" placeholder="{{\'APPLICATION_CLIENT_SECRET\' | translate}}" class="form-control" data-ng-model="item.clientSecret" required/>\n								<span data-ng-show="forms.formSetting.clientSecret.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END CLIENT SECRET -->\n\n              <!-- START SECURITY TOKEN -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.securityToken.$invalid}">\n								<label class="control-label">{{\'APPLICATION_SECURITY_TOKEN\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="securityToken" placeholder="{{\'APPLICATION_SECURITY_TOKEN\' | translate}}" class="form-control" data-ng-model="item.securityToken" required/>\n								<span data-ng-show="forms.formSetting.securityToken.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END SECURITY TOKEN -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" data-ng-click="next()"/>\n\n						</form>\n					</wz-step>\n\n					<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n						<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n						<input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n					</wz-step>\n\n				</wizard>\n\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/setting/license/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div\n class="row" data-ng-init="initView()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-settings"></i>\n					<a href="#">{{ \'APPLICATION_SETTINGS\' | translate }}</a>\n          <i class="fa fa-angle-right"></i>\n				</li>\n        <li>\n          <i class="icon-info"></i>\n          <a href="#">{{ \'APPLICATION_LICENSE\' | translate }}</a>\n        </li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE CONTENT -->\n		<div class="profile-content">\n			<div class="row">\n				<div class="col-md-6">\n					<div class="pricing hover-effect">\n						<div class="pricing-head" data-ng-switch="license.months">\n							<h3 ng-switch-when="1">{{\'APPLICATION_MONTH_TO_MONTH\' | translate}}<span>{{license.token || \'unknown\'}} </span></h3>\n							<h3 ng-switch-when="12">{{\'APPLICATION_YEARLY\' | translate}}<span>{{license.token || \'unknown\'}} </span></h3>\n							<h3 ng-switch-when="36">{{\'APPLICATION_PERPETUAL\' | translate}}<span>{{license.token || \'unknown\'}} </span></h3>\n							<h3 ng-switch-default>{{\'APPLICATION_UNKNOWN\' | translate}}<span>{{license.token || \'unknown\'}} </span></h3>\n							<h4><i>{{license.expiration ? (license.expiration | date:\'medium\') : \'DEMO\'}}</i>\n							<span data-ng-show="license.expiration">Expiration Date </span>\n							</h4>\n						</div>\n						<ul class="pricing-content list-unstyled">\n							<li class="row">\n								<div class="col-md-9">\n									<i class="icon-eye"></i> {{\'APPLICATION_USERS\' | translate}}:\n								</div>\n								<div class="col-md-3 text-center">\n									{{(license.users || license.users >= 0) ? license.users : \'unknown\'}}\n								</div>\n							</li>\n							<li class="row">\n								<div class="col-md-9">\n									<i class="icon-people"></i> {{\'APPLICATION_AGENTS\' | translate}} ({{\'APPLICATION_CONCURRENTS\' | translate}}):\n								</div>\n								<div class="col-md-3 text-center">\n									{{(license.agents || license.agents >= 0)  ? license.agents : \'unknown\'}}\n								</div>\n							</li>\n							<li class="row">\n								<div class="col-md-9">\n									<i class="icon-phone"></i> {{\'APPLICATION_TELEPHONES\' | translate}}:\n								</div>\n								<div class="col-md-3 text-center">\n									{{(license.telephones || license.telephones >= 0) ? license.telephones : \'unknown\'}}\n								</div>\n							</li>\n							<li class="row">\n								<div class="col-md-9">\n									<i class="icon-bubble"></i> {{\'APPLICATION_CHAT\' | translate}}:\n								</div>\n								<div class="col-md-3 text-center">\n									<span class="label label-sm" data-ng-class="license.chat ? \'label-success\' : \'label-danger\'">{{license.chat ? \'APPLICATION_ENABLED\' : \'APPLICATION_DISABLED\' | translate}}</span>\n								</div>\n							</li>\n							<li class="row">\n								<div class="col-md-9">\n									<i class="icon-envelope"></i> {{\'APPLICATION_MAIL\' | translate}}:\n								</div>\n								<div class="col-md-3 text-center">\n								 <span class="label label-sm" data-ng-class="license.mail ? \'label-success\' : \'label-danger\'">{{license.mail ? \'APPLICATION_ENABLED\' : \'APPLICATION_DISABLED\' | translate}}</span>\n								</div>\n							</li>\n							<li class="row">\n								<div class="col-md-9">\n									<i class="icon-paper-plane"></i> {{\'APPLICATION_FAX\' | translate}}:\n								</div>\n								<div class="col-md-3 text-center">\n									 <span class="label label-sm" data-ng-class="license.fax ? \'label-success\' : \'label-danger\'">{{license.fax ? \'APPLICATION_ENABLED\' : \'APPLICATION_DISABLED\' | translate}}</span>\n								</div>\n							</li>\n						</ul>\n						<div class="pricing-footer">\n							<p>\n								 {{license.description}}\n							</p>\n							<a href="#" class="btn yellow-crusta">\n							{{\'APPLICATION_PRICES\' | translate}} <i class="m-icon-swapright m-icon-white"></i>\n							</a>\n						</div>\n					</div>\n				</div>\n				<div class="col-md-6">\n					<div class="portlet light bordered">\n						<div class="portlet-title">\n							<div class="caption font-green-sharp">\n								<i class="icon-info font-green-sharp"></i>\n								<span class="caption-subject">FORM {{ \'APPLICATION_LICENSE\' | translate }}</a> </span>\n							</div>\n						</div>\n						<div class="portlet-body">\n							<form name="form" novalidate data-ng-submit="submitRequest()">\n\n								<!-- START USERS -->\n								<div class="form-group" data-ng-class="{\'has-error\': (form.users.$touched || form.$submitted) && form.users.$invalid}">\n									<label class="control-label">{{\'APPLICATION_USERS\' | translate}}</label>\n									<div class="input-icon">\n										<i class="icon-eye"></i>\n										<input type="number" name="users" placeholder="{{\'APPLICATION_USERS\' | translate}}" class="form-control" data-ng-model="item.users" min="0" required>\n									</div>\n									<span data-ng-show="(form.users.$touched || forms.$submitted) && form.users.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END USERS -->\n\n								<!-- START AGENTS -->\n								<div class="form-group" data-ng-class="{\'has-error\': (form.agents.$touched || form.$submitted) && form.agents.$invalid}">\n									<label class="control-label">{{\'APPLICATION_AGENTS\' | translate}} ({{\'APPLICATION_CONCURRENTS\' | translate}})</label>\n									<div class="input-icon">\n										<i class="icon-people"></i>\n										<input type="number" name="agents" placeholder="{{\'APPLICATION_AGENTS\' | translate}} ({{\'APPLICATION_CONCURRENTS\' | translate}})" class="form-control" data-ng-model="item.agents" min="0" required>\n									</div>\n									<span data-ng-show="(form.users.$touched || forms.$submitted) && form.users.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END AGENTS -->\n\n								<!-- START TELEPHONES -->\n								<div class="form-group" data-ng-class="{\'has-error\': (form.telephones.$touched || form.$submitted) && form.telephones.$invalid}">\n									<label class="control-label">{{\'APPLICATION_TELEPHONES\' | translate}}</label>\n									<div class="input-icon">\n										<i class="icon-phone"></i>\n										<input type="number" name="telephones" placeholder="{{\'APPLICATION_TELEPHONES\' | translate}}" class="form-control" data-ng-model="item.telephones" min="0" required>\n									</div>\n									<span data-ng-show="(form.telephones.$touched || forms.$submitted) && form.telephones.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END TELEPHONES -->\n\n								<!-- START CHAT -->\n								<div class="form-group" data-ng-class="{\'has-error\': (form.chat.$touched || form.$submitted) && form.chat.$invalid}">\n									<label class="control-label">{{\'APPLICATION_CHAT\' | translate}}</label>\n									<div class="input-group input-icon">\n										<i class="icon-bubble"></i>\n										<input type="text" placeholder="{{\'APPLICATION_CHAT\' | translate}}" class="form-control" readonly>\n										<span class="input-group-addon">\n											<input type="checkbox" name="chat" data-ng-model="item.chat" required>\n										</span>\n									</div>\n									<span data-ng-show="(form.chat.$touched || forms.$submitted) && form.chat.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END CHAT -->\n\n								<!-- START MAIL -->\n								<div class="form-group" data-ng-class="{\'has-error\': (form.mail.$touched || form.$submitted) && form.mail.$invalid}">\n									<label class="control-label">{{\'APPLICATION_MAIL\' | translate}}</label>\n									<div class="input-group input-icon">\n										<i class="icon-envelope"></i>\n										<input type="text" placeholder="{{\'APPLICATION_MAIL\' | translate}}" class="form-control" readonly>\n										<span class="input-group-addon">\n											<input type="checkbox" name="mail" data-ng-model="item.mail" required>\n										</span>\n									</div>\n									<span data-ng-show="(form.mail.$touched || forms.$submitted) && form.mail.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END MAIL -->\n\n								<!-- START FAX -->\n								<div class="form-group" data-ng-class="{\'has-error\': (form.fax.$touched || form.$submitted) && form.fax.$invalid}">\n									<label class="control-label">{{\'APPLICATION_FAX\' | translate}}</label>\n									<div class="input-group input-icon">\n										<i class="icon-paper-plane"></i>\n										<input type="text" placeholder="{{\'APPLICATION_FAX\' | translate}}" class="form-control" readonly>\n										<span class="input-group-addon">\n											<input type="checkbox" name="fax" data-ng-model="item.fax" required>\n										</span>\n									</div>\n									<span data-ng-show="(form.fax.$touched || forms.$submitted) && form.fax.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END FAX -->\n\n								<input class="btn green-haze" type="submit" value="{{\'APPLICATION_SUBMIT\' | translate}} {{\'APPLICATION_REQUEST\' | translate}}"/>\n							</form>\n						</div>\n					</div>\n				</div>\n			</div>\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/setting/smtp/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initView()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-settings"></i>\n					<a href="#">{{ \'APPLICATION_SETTINGS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-envelope"></i>\n					<a href="#">SMTP</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE CONTENT -->\n		<div class="profile-content">\n			<!-- START SMTP TAB -->\n			<form name="form" data-ng-submit="form.$valid && updateItem()" novalidate>\n\n				<!-- START HOST -->\n				<div class="form-group" data-ng-class="{\'has-error\': (form.host.$touched || form.$submitted) && form.host.$invalid}">\n					<label class="control-label">{{\'APPLICATION_OUTGOING_MAIL_SERVER\' | translate}} <span class="required" aria-required="true">*</span></label>\n					<input type="text" name="host" placeholder="{{\'APPLICATION_HOST\' | translate}}" class="form-control" data-ng-model="item.host" required/>\n					<span data-ng-show="(form.host.$touched || form.$submitted) && form.host.$invalid && form.host.$error.required" class="help-block help-block-error">\n						<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n					</span>\n				</div>\n				<!-- END HOST -->\n\n				<!-- START USERNAME -->\n				<div class="form-group" data-ng-class="{\'has-error\': (form.username.$touched || form.$submitted) && form.username.$invalid}">\n					<label class="control-label">{{\'APPLICATION_USERNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n					<input type="text" name="username" placeholder="{{\'APPLICATION_USERNAME\' | translate}}" class="form-control" data-ng-model="item.username" required/>\n					<span data-ng-show="(form.username.$touched || form.$submitted) && form.username.$invalid && form.username.$error.required" class="help-block help-block-error">\n						<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n					</span>\n				</div>\n				<!-- END USERNAME -->\n\n				<!-- START PASSWORD -->\n				<div class="form-group" data-ng-class="{\'has-error\': (form.password.$touched || form.$submitted) && form.password.$invalid}">\n					<label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n					<input type="password" name="password" placeholder="{{\'APPLICATION_PASSWORD\' | translate}}" class="form-control" data-ng-model="item.password" required/>\n					<span data-ng-show="(form.password.$touched || form.$submitted) && form.password.$invalid && form.password.$error.required" class="help-block help-block-error">\n						<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n					</span>\n				</div>\n				<!-- END PASSWORD -->\n\n				<!-- START PORT -->\n				<div class="form-group" data-ng-class="{\'has-error\': (form.port.$touched || form.$submitted) && form.port.$invalid}">\n					<label class="control-label">{{\'APPLICATION_PORT\' | translate}}<span class="required" aria-required="true">*</span></label>\n					<input type="number" name="port" placeholder="{{\'APPLICATION_PORT\' | translate}}" class="form-control" data-ng-model="item.port" required/>\n					<span data-ng-show="(form.form.$touched || form.$submitted) && form.port.$invalid && form.port.$error.required" class="help-block help-block-error">\n						<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n					</span>\n					<span data-ng-show="(form.form.$touched || form.$submitted) && form.port.$invalid && form.port.$error.number" class="help-block help-block-error">\n						<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_NUMERIC_FIELD\' | translate}}.\n					</span>\n				</div>\n				<!-- END PORT -->\n\n				<!-- START SSL -->\n				<div class="form-group row">\n					<label class="col-md-3">\n						SSL\n					</label>\n					<label class="col-md-9">\n							<input type="checkbox" data-ng-model="item.ssl">\n					</label>\n				</div>\n				<!-- END SSL -->\n				<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n				<input class="btn blue-madison" type="button" value="Test" data-ng-click="test()"/>\n			</form>\n			<!-- END SMTP TAB -->\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/setting/update/list/landing.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n  <div class="col-md-12">\n    <div class="page-bar">\n      <ul class="page-breadcrumb">\n        <li>\n          <i class="icon-rocket"></i>\n          <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n          <i class="fa fa-angle-right"></i>\n        </li>\n        <li>\n          <i class="icon-settings"></i>\n          <a href="#">{{ \'APPLICATION_SETTINGS\' | translate }}</a>\n          <i class="fa fa-angle-right"></i>\n        </li>\n        <li>\n          <i class="icon-cloud-download"></i>\n          <a href="#">{{ \'APPLICATION_UPDATES\' | translate }}</a>\n        </li>\n      </ul>\n    </div>\n    <!-- BEGIN PAGE CONTENT-->\n    <div class="row" data-ng-init="initCounter()">\n      <div class="col-md-12 page-500">\n        <div class="number">\n          <timer interval="1000" countdown="180">{{countdown}}</timer>\n        </div>\n        <div class="details">\n          <h3>Wait! We need to restart xCALLY Motion server.</h3>\n          <p>\n            We are updatig it!<br/>\n            xCALLY Motion Team<br/><br/>\n          </p>\n        </div>\n      </div>\n    </div>\n    <!-- END PAGE CONTENT-->\n  </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/setting/update/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-settings"></i>\n					<a href="#">{{ \'APPLICATION_SETTINGS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-cloud-download"></i>\n					<a href="#">{{ \'APPLICATION_UPDATES\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-cloud-download font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_UPDATES\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<a class="btn btn-default" href="#" data-ng-click="pull()">\n						<i class="icon-cloud-download"></i> {{ \'APPLICATION_UPDATE\' | translate }}\n					</a>\n				</div>\n			</div>\n			<div class="portlet-body" data-ng-init="initView()">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n			<!-- END Portlet PORTLET-->\n		</div>\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/setting/update/list/list.pull.html",'<div class="modal-header">\n  <button data-ng-if="modal.dismissable" type="button" data-ng-click="$dismiss()" class="close">&times;</button>\n  <h4 ng-if="modal.title" ng-bind="modal.title" class="modal-title"></h4>\n</div>\n<div class="modal-body">\n  <p data-ng-if="modal.text" data-ng-bind="modal.text"></p>\n  <div data-ng-if="modal.html" data-ng-bind-html="modal.html"></div>\n</div>\n<div class="modal-footer">\n  <button data-ng-repeat="button in modal.buttons" data-ng-class="button.classes" data-ng-click="button.click($event)" data-ng-bind="button.text" class="btn"></button>\n</div>\n'),a.put("app/square/odbc/list/list.create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_PROJECT\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.name.$touched || form.$submitted) && form.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n      <span data-ng-show="(form.name.$touched || form.$submitted) && form.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n    <!-- START DSN -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.dsn.$touched || form.$submitted) && form.dsn.$invalid}">\n      <label class="control-label">{{\'APPLICATION_ODBC\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="dsn" placeholder="DRIVER=MySQL;SERVER=127.0.0.1;UID=xcall;PWD=password;DATABASE=motion" class="form-control" data-ng-model="item.dsn" required/>\n      <p class="help-block">Es. DRIVER=MySQL;SERVER=127.0.0.1;UID=xcall;PWD=password;DATABASE=motion</p>\n      <span data-ng-show="(form.dsn.$touched || form.$submitted) && form.dsn.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END DSN -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n    </div>\n    <!-- END DESCRIPTION -->\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="save()" ng-disabled="form.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),
+a.put("app/square/odbc/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="fa fa-superscript"></i>\n					<a>{{ \'APPLICATION_CALLYSQUARE\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-docs"></i>\n					<a href="#">{{ \'APPLICATION_ODBCS\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-docs font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_ODBCS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<button class="btn green-jungle " ng-click="createItem()">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_ODBC\' | translate }}\n						</button>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/square/odbc/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getOdbc()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="fa fa-superscript"></i>\n					<a>{{ \'APPLICATION_CALLYSQUARE\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-docs"></i>\n					<a href="/square/odbc/list">{{ \'APPLICATION_ODBCS\' | translate }}</a>\n					<i data-ng-show="odbc" class="fa fa-angle-right"></i>\n				</li>\n				<li data-ng-show="odbc">\n					<a href="#">{{odbc.name}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/odbc.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{odbc.name}}\n					</div>\n					<!-- <div class="profile-usertitle-job">\n						{{user.role}}\n					</div> -->\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.square.odbc.view.settings\')}">\n							<a data-ng-href="/square/odbc/view/{{odbc.id}}/settings">\n							<i class="icon-settings"></i>\n							{{ \'APPLICATION_SETTINGS\' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/square/odbc/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_ODBC\' | translate}} {{ \'APPLICATION_SETTINGS\' | translate}} </span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_GENERAL\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.general" data-ng-submit="forms.general.$valid && updateOdbc()" novalidate>\n\n							<!-- START NAME -->\n				      <div class="form-group" data-ng-class="{\'has-error\': (forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid}">\n				        <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n				        <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="odbc.name" required/>\n								<span data-ng-show="(forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$error.required" class="help-block help-block-error">\n				          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n				        </span>\n				      </div>\n				      <!-- END NAME -->\n\n							<!-- START DSN -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.odbc.dsn.$touched || forms.odbc.$submitted) && forms.odbc.dsn.$invalid}">\n								<label class="control-label">{{\'APPLICATION_ODBC\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="dsn" placeholder="{{\'APPLICATION_DSN\' | translate}}" class="form-control" data-ng-model="odbc.dsn" required/>\n								<p class="help-block">Es. DRIVER=MySQL;SERVER=127.0.0.1;UID=xcall;PWD=password;DATABASE=motion</p>\n					      <span data-ng-show="(forms.odbc.dsn.$touched || forms.odbc.$submitted) && forms.odbc.dsn.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END DSN -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="odbc.description"></textarea>\n							</div>\n							<!-- END DESCRIPTION -->\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END ADVANCED TAB -->\n\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/square/project/list/list.create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_PROJECT\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.name.$touched || form.$submitted) && form.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n      <span data-ng-show="(form.name.$touched || form.$submitted) && form.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n    </div>\n    <!-- END DESCRIPTION -->\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="save()" ng-disabled="form.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/square/project/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="fa fa-superscript"></i>\n					<a>{{ \'APPLICATION_CALLYSQUARE\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n        <li>\n          <i class="fa fa-slack"></i>\n          <a href="#">{{ \'APPLICATION_PROJECTS\' | translate }}</a>\n        </li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-docs font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_PROJECTS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<button class="btn green-jungle " ng-click="createItem()">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_PROJECT\' | translate }}\n						</button>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/square/project/view/view.html",'<div class="row" data-ng-init="getProject()">\n	<div class="col-md-12">\n			<div class="page-bar">\n				<ul class="page-breadcrumb">\n					<li>\n						<i class="icon-rocket"></i>\n						<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="fa fa-superscript"></i>\n						<a>{{ \'APPLICATION_CALLYSQUARE\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="fa fa-slack"></i>\n						<a href="/square/projects/list">{{ \'APPLICATION_PROJECTS\' | translate }}</a>\n            <i class="fa fa-angle-right"></i>\n					</li>\n          <li>\n						<a ng-href="/square/projects/view/{{squareProject.id}}">{{squareProject.name}}</a>\n          </li>\n				</ul>\n			</div>\n		</div>\n</div>\n<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n  <div class="col-md-12">\n		<div id="geEditor" class="geEditor"></div>\n  </div>\n</div>\n<!-- END PAGE CONTENT-->\n<script>\n\n\n</script>\n'),a.put("app/staff/agent/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-puzzle"></i>\n					<a href="#">{{ \'APPLICATION_STAFF\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-people"></i>\n					<a href="#">{{ \'APPLICATION_AGENTS\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-people font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_AGENTS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<a class="btn green-jungle" href="/staff/agents/wizard">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_AGENT\' | translate }}\n						</a>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/staff/agent/view/view.account.html",'<div class="row" data-ng-init="initView()">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_PROFILE\' | translate}} {{ \'APPLICATION_ACCOUNT\' | translate}}</span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li data-ng-class="{\'active\': Auth.isAdmin()}" data-ng-show="Auth.isAdmin()">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_PERSONAL_INFO\' | translate}}</a>\n					</li>\n					<li data-ng-show="Auth.isAdmin()">\n						<a href="#" data-target="#tab_1_2" data-toggle="tab">{{ \'APPLICATION_CHANGE_AVATAR\' | translate}}</a>\n					</li>\n					<li data-ng-show="Auth.isAdmin() || agent.id === Auth.getCurrentUser().id" data-ng-class="{\'active\': !Auth.isAdmin() && agent.id === Auth.getCurrentUser().id}">\n						<a href="#" data-target="#tab_1_3" data-toggle="tab">{{ \'APPLICATION_CHANGE_PASSWORD\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- PERSONAL INFO TAB -->\n					<div class="tab-pane" data-ng-class="{\'active\': Auth.isAdmin()}" data-ng-show="Auth.isAdmin()" id="tab_1_1">\n						<form name="forms.info" data-ng-submit="updateItem()" novalidate>\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.info.fullname.$touched || forms.info.$submitted) && forms.info.fullname.$invalid}">\n								<label class="control-label">{{\'APPLICATION_FULLNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="fullname" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="agent.fullname" required/>\n								<span data-ng-show="(forms.info.fullname.$touched || forms.info.$submitted) && forms.info.fullname.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<!-- START USERNAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_USERNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_USERNAME\' | translate}}" class="form-control" data-ng-model="agent.name" required/>\n								<span data-ng-show="(forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END USERNAME -->\n\n							<!-- START EMAIL -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.info.email.$touched || forms.info.$submitted) && forms.info.email.$invalid}">\n								<label class="control-label">{{\'APPLICATION_EMAIL\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="email" name="email" placeholder="{{\'APPLICATION_EMAIL\' | translate}}" class="form-control" data-ng-model="agent.email" required/>\n								<span data-ng-show="(forms.info.email.$touched || forms.info.$submitted) && forms.info.email.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n								<span data-ng-show="(forms.info.email.$touched || forms.info.$submitted) && forms.info.email.$error.email" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_WRONG_FORMAT\' | translate}}.\n								</span>\n							</div>\n							<!-- END EMAIL -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="agent.description"></textarea>\n							</div>\n							<!-- END DESCRIPTION -->\n\n							<!-- START INTERNAL -->\n							<!-- <div class="form-group" data-ng-class="{\'has-error\': (forms.info.internal.$touched || forms.info.$submitted) && forms.info.internal.$invalid}">\n								<label class="control-label">{{\'APPLICATION_INTERNAL_NUMBER\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="internal" placeholder="{{\'APPLICATION_INTERNAL_NUMBER\' | translate}}" class="form-control" data-ng-model="agent.internal" required disabled/>\n								<span data-ng-show="(forms.info.internal.$touched || forms.info.$submitted) && forms.info.internal.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div> -->\n							<!-- END INTERNAL -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END PERSONAL INFO TAB -->\n					<!-- CHANGE AVATAR TAB -->\n					<div class="tab-pane" data-ng-show="Auth.isAdmin()" id="tab_1_2">\n						<form action="#" role="form">\n							<div class="form-group">\n								<div class="fileinput fileinput-new" data-provides="fileinput">\n									<div class="fileinput-new thumbnail" style="width: 200px; height: 150px;">\n										<img src="http://www.placehold.it/200x150/EFEFEF/AAAAAA&amp;text=no+image" alt=""/>\n									</div>\n									<div class="fileinput-preview fileinput-exists thumbnail" style="max-width: 200px; max-height: 150px;">\n									</div>\n									<div>\n										<span class="btn default btn-file" data-ng-show="!uploader.queue[0]">\n											<span> {{ \'APPLICATION_SELECT_IMAGE\' | translate }} </span>\n											<input type="file" nv-file-select="" uploader="uploader" /><br/>\n										</span>\n										<button type="button" class="btn default" data-ng-show="uploader.queue[0]" data-dismiss="fileinput" ng-click="uploader.queue[0].remove()">\n											{{ \'APPLICATION_REMOVE\' | translate }}\n										</button>\n										<button type="button" class="btn green-haze" data-ng-show="uploader.queue[0]" data-ng-click="uploader.queue[0].upload()" ng-disabled="uploader.queue[0].isReady || uploader.queue[0].isUploading || uploader.queue[0].isSuccess">\n											{{ \'APPLICATION_CONFIRM\' | translate }}\n										</button>\n									</div>\n									<p>\n										</br> {{ \'MESSAGE_SUPPORTED_FORMATS\' | translate }} <b>jpg, png, jpeg</b>.\n									</p>\n								</div>\n							</div>\n						</form>\n						<div class="row">\n							<div class="col-md-2">\n								<table class="table" border="0">\n									<tbody>\n									<tr data-ng-repeat="item in uploader.queue">\n											<td style="border-top-style:none">\n												<strong>\n													{{ item.file.name }}\n												</strong>\n											</td>\n											<td data-ng-show="uploader.isHTML5" nowrap style="border-top-style:none">\n												{{ item.file.size/1024/1024|number:2 }} MB\n											</td>\n											<td nowrap style="border-top-style:none">\n												<button type="button" class="btn btn-danger btn-xs" data-ng-click="item.remove()">\n														<span class="glyphicon glyphicon-trash"></span> Remove\n												</button>\n											</td>\n										</tr>\n									</tbody>\n								</table>\n							</div>\n						</div>\n					</div>\n					<!-- END CHANGE AVATAR TAB -->\n					<!-- CHANGE PASSWORD TAB -->\n					<div class="tab-pane" data-ng-show="Auth.isAdmin() || agent.id === Auth.getCurrentUser().id" data-ng-class="{\'active\': !Auth.isAdmin() && agent.id === Auth.getCurrentUser().id}" id="tab_1_3">\n						<form name="forms.changePwd" data-ng-submit="forms.changePwd.$valid && updatePassword()" novalidate>\n							<!-- START CURRENT PWD -->\n							<div class="form-group" data-ng-if="!Auth.isAdmin()" data-ng-class="{\'has-error\': (forms.changePwd.current_pwd.$touched || forms.changePwd.$submitted) && forms.changePwd.current_pwd.$invalid}">\n								<label class="control-label">{{\'APPLICATION_CURRENT_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="password" name="current_pwd" placeholder="{{\'APPLICATION_CURRENT_PASSWORD\' | translate}}" class="form-control" data-ng-model="agent.currentPwd" required/>\n								<span data-ng-show="(forms.changePwd.current_pwd.$touched || forms.changePwd.$submitted) && forms.changePwd.current_pwd.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END CURRENT PWD -->\n							<!-- START NEW PWD -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.changePwd.new_pwd.$touched || forms.changePwd.$submitted) && forms.changePwd.new_pwd.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NEW_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="password" name="new_pwd" placeholder="{{\'APPLICATION_NEW_PASSWORD\' | translate}}" class="form-control" data-ng-model="agent.newPwd" required/>\n								<span data-ng-show="(forms.changePwd.new_pwd.$touched || forms.changePwd.$submitted) && forms.changePwd.new_pwd.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NEW PWD -->\n							<!-- START RE-NEW PWD -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.changePwd.re_new_pwd.$touched || forms.changePwd.$submitted) && forms.changePwd.re_new_pwd.$invalid}">\n								<label class="control-label">{{\'APPLICATION_RE_TYPE_NEW_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="password" name="re_new_pwd" placeholder="{{\'APPLICATION_RE_TYPE_NEW_PASSWORD\' | translate}}" class="form-control" data-ng-model="agent.reNewPwd" nx-equal="agent.newPwd" required/>\n								<span data-ng-show="(forms.changePwd.new_pwd.$touched || forms.changePwd.$submitted) && forms.changePwd.new_pwd.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END RE-NEW PWD -->\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END CHANGE PASSWORD TAB -->\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/staff/agent/view/view.chat.html",'<div class="row" data-ng-init="initView()">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_PROFILE\' | translate}} {{ \'APPLICATION_CHAT\' | translate}}</span>\n				</div>\n			</div>\n\n			<div class="portlet-body">\n				<!-- START CHAT TAB -->\n				<form name="form" data-ng-submit="patchItem()" novalidate>\n					<!-- START CAPACITY -->\n					<div class="form-group" data-ng-class="{\'has-error\': (form.capacity.$touched || form.$submitted) && form.name.$invalid}">\n						<label class="control-label">{{\'APPLICATION_CAPACITY\' | translate}}<span class="required" aria-required="true">*</span></label>\n						<input type="number" name="chatCapacity" placeholder="{{\'APPLICATION_CAPACITY\' | translate}}" class="form-control" data-ng-model="agent.chatCapacity" min="0" required/>\n						<span class="help-block">\n							{{\'MESSAGE_ZERO_MEANS_UNLIMITED\' | translate}}\n						</span>\n						<span data-ng-show="(form.name.$touched || form.$submitted) && form.name.$error.required" class="help-block help-block-error">\n							<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n						</span>\n					</div>\n					<!-- END CAPACITY -->\n					<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n				</form>\n				<!-- END CHAT TAB -->\n			</div>\n		</div>\n	</div>\n</div>\n</div>\n'),a.put("app/staff/agent/view/view.fax.html",'<div class="row" data-ng-init="initView()">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_PROFILE\' | translate}} {{ \'APPLICATION_FAX\' | translate}}</span>\n				</div>\n			</div>\n\n			<div class="portlet-body">\n				<!-- START CHAT TAB -->\n				<form name="form" data-ng-submit="patchItem()" novalidate>\n					<!-- START CAPACITY -->\n					<div class="form-group" data-ng-class="{\'has-error\': (form.capacity.$touched || form.$submitted) && form.name.$invalid}">\n						<label class="control-label">{{\'APPLICATION_CAPACITY\' | translate}}<span class="required" aria-required="true">*</span></label>\n						<input type="number" name="faxCapacity" placeholder="{{\'APPLICATION_CAPACITY\' | translate}}" class="form-control" data-ng-model="agent.faxCapacity" min="0" required/>\n						<span class="help-block">\n							{{\'MESSAGE_ZERO_MEANS_UNLIMITED\' | translate}}\n						</span>\n						<span data-ng-show="(form.name.$touched || form.$submitted) && form.name.$error.required" class="help-block help-block-error">\n							<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n						</span>\n					</div>\n					<!-- END CAPACITY -->\n					<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n				</form>\n				<!-- END CHAT TAB -->\n			</div>\n		</div>\n	</div>\n</div>\n</div>\n'),a.put("app/staff/agent/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-puzzle"></i>\n					<a href="#">{{ \'APPLICATION_STAFF\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-people"></i>\n					<a href="/staff/agents/list">{{ \'APPLICATION_AGENTS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<a href="#">{{agent.fullname}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-userpic">\n					<img ng-src="api/users/avatar/{{agent.userpic ? agent.userpic : \'unknown_avatar\'}}" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n\n				<!-- START SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{agent.fullname}}\n					</div>\n					<div class="profile-usertitle-job">\n						{{agent.role}}\n					</div>\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.staff.agents.view.account\')}">\n							<a data-ng-href="/staff/agents/view/{{agent.id}}/account">\n							<i class="icon-user"></i>\n							{{ \'APPLICATION_ACCOUNT\' | translate}} </a>\n						</li>\n\n						<li data-ng-class="{active: $state.is(\'main.staff.agents.view.voice\')}" data-ng-show="Auth.isAdmin()">\n							<a data-ng-href="/staff/agents/view/{{agent.id}}/voice">\n							<i class="icon-earphones-alt"></i>\n							{{ \'APPLICATION_VOICE\' | translate}} </a>\n						</li>\n\n						<li data-ng-class="{active: $state.is(\'main.staff.agents.view.chat\')}" data-ng-show="Auth.isAdmin()">\n							<a data-ng-href="/staff/agents/view/{{agent.id}}/chat">\n							<i class="icon-bubble"></i>\n							{{ \'APPLICATION_CHAT\' | translate}} </a>\n						</li>\n\n						<li data-ng-class="{active: $state.is(\'main.staff.agents.view.mail\')}" data-ng-show="Auth.isAdmin()">\n							<a data-ng-href="/staff/agents/view/{{agent.id}}/mail">\n							<i class="icon-envelope"></i>\n							{{ \'APPLICATION_MAIL\' | translate}} </a>\n						</li>\n\n						<li data-ng-class="{active: $state.is(\'main.staff.agents.view.fax\')}" data-ng-show="Auth.isAdmin()">\n							<a data-ng-href="/staff/agents/view/{{agent.id}}/fax">\n							<i class="icon-paper-plane"></i>\n							{{ \'APPLICATION_FAX\' | translate}} </a>\n						</li>\n\n						<li data-ng-class="{active: $state.is(\'main.staff.agents.view.phonebar\')}" data-ng-show="Auth.isAdmin()">\n							<a data-ng-href="/staff/agents/view/{{agent.id}}/phonebar">\n							<i class="icon-screen-desktop"></i>\n							{{ \'APPLICATION_PHONE_BAR\' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/staff/agent/view/view.mail.html",'<div class="row" data-ng-init="initView()">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_PROFILE\' | translate}} {{ \'APPLICATION_MAIL\' | translate}}</span>\n				</div>\n			</div>\n\n			<div class="portlet-body">\n				<!-- START CHAT TAB -->\n				<form name="form" data-ng-submit="patchItem()" novalidate>\n					<!-- START CAPACITY -->\n					<div class="form-group" data-ng-class="{\'has-error\': (form.capacity.$touched || form.$submitted) && form.name.$invalid}">\n						<label class="control-label">{{\'APPLICATION_CAPACITY\' | translate}}<span class="required" aria-required="true">*</span></label>\n						<input type="number" name="mailCapacity" placeholder="{{\'APPLICATION_CAPACITY\' | translate}}" class="form-control" data-ng-model="agent.mailCapacity" min="0" required/>\n						<span class="help-block">\n							{{\'MESSAGE_ZERO_MEANS_UNLIMITED\' | translate}}\n						</span>\n						<span data-ng-show="(form.name.$touched || form.$submitted) && form.name.$error.required" class="help-block help-block-error">\n							<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n						</span>\n					</div>\n					<!-- END CAPACITY -->\n					<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n				</form>\n				<!-- END CHAT TAB -->\n			</div>\n		</div>\n	</div>\n</div>\n</div>\n'),
+a.put("app/staff/agent/view/view.phonebar.html",'<div class="row" data-ng-init="initView()">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_PROFILE\' | translate}} {{ \'APPLICATION_PHONE_BAR\' | translate}}</span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li data-ng-class="{\'active\': Auth.isAdmin()}" data-ng-show="Auth.isAdmin()">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_GENERAL\' | translate}}</a>\n					</li>\n					<li data-ng-show="Auth.isAdmin()">\n						<a href="#" data-target="#tab_1_2" data-toggle="tab">{{ \'APPLICATION_CALL_FORWARDING\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- PERSONAL INFO TAB -->\n					<div class="tab-pane" data-ng-class="{\'active\': Auth.isAdmin()}" data-ng-show="Auth.isAdmin()" id="tab_1_1">\n						<form name="forms.general" data-ng-submit="updateItem()" novalidate>\n\n							<!-- START DELETE -->\n							<div class="form-group row">\n								<label class="col-md-3">\n									{{\'APPLICATION_AUTO_ANSWER\' | translate}}\n								</label>\n								<label class="col-md-9">\n									<input type="checkbox" data-ng-model="agent.phoneBarAutoAnswer">\n								</label>\n							</div>\n							<!-- END DELETE -->\n\n							<!-- START DELETE -->\n							<div class="form-group row">\n								<label class="col-md-3">\n									{{\'APPLICATION_ENABLE_SETTINGS\' | translate}}\n								</label>\n								<label class="col-md-9">\n									<input type="checkbox" data-ng-model="agent.phoneBarEnableSettings">\n								</label>\n							</div>\n							<!-- END DELETE -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END PERSONAL INFO TAB -->\n					<!-- CHANGE AVATAR TAB -->\n					<div class="tab-pane" data-ng-show="Auth.isAdmin()" id="tab_1_2">\n						<form name="forms.callForwarding" data-ng-submit="updateItem()" novalidate>\n							<!-- START UNCONDITIONAL -->\n							<div class="form-group row">\n								<label class="col-md-3">\n									{{\'APPLICATION_UNCONDITIONAL\' | translate}}\n								</label>\n								<label class="col-md-9">\n									<input name="phoneBarUnconditional" type="checkbox" data-ng-model="agent.phoneBarUnconditional">\n								</label>\n							</div>\n							<!-- END UNCONDITIONAL -->\n\n							<!-- START UNCONDITIONAL NUMBER -->\n							<div class="form-group" data-ng-if="agent.phoneBarUnconditional" data-ng-class="{\'has-error\': (forms.callForwarding.phoneBarUnconditionalNumber.$touched || forms.callForwarding.$submitted) && forms.callForwarding.phoneBarUnconditionalNumber.$invalid}">\n								<input type="text" name="phoneBarUnconditionalNumber" placeholder="{{\'APPLICATION_NUMBER\' | translate}}" class="form-control" data-ng-model="agent.phoneBarUnconditionalNumber" required/>\n								<span class="help-block">\n									<!-- {{ \'DESCRIPTION_VOICE_HOST\' | translate }} -->\n								</span>\n								<span data-ng-show="(forms.callForwarding.phoneBarUnconditionalNumber.$touched || forms.callForwarding.$submitted) && forms.callForwarding.phoneBarUnconditionalNumber.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END UNCONDITIONAL NUMBER -->\n\n							<!-- START NO REPLY -->\n							<div class="form-group row">\n								<label class="col-md-3">\n									{{\'APPLICATION_NO_REPLY\' | translate}}\n								</label>\n								<label class="col-md-9">\n									<input name="phoneBarNoReply" type="checkbox" data-ng-model="agent.phoneBarNoReply">\n								</label>\n							</div>\n							<!-- END NO REPLY -->\n\n							<!-- START NO REPLY -->\n							<div class="form-group" data-ng-if="agent.phoneBarNoReply" data-ng-class="{\'has-error\': (forms.callForwarding.phoneBarNoReplyNumber.$touched || forms.callForwarding.$submitted) && forms.callForwarding.phoneBarNoReplyNumber.$invalid}">\n								<input type="text" name="phoneBarNoReplyNumber" placeholder="{{\'APPLICATION_NUMBER\' | translate}}" class="form-control" data-ng-model="agent.phoneBarNoReplyNumber" required/>\n								<span class="help-block">\n									<!-- {{ \'DESCRIPTION_VOICE_HOST\' | translate }} -->\n								</span>\n								<span data-ng-show="(forms.callForwarding.phoneBarNoReplyNumber.$touched || forms.callForwarding.$submitted) && forms.callForwarding.phoneBarNoReplyNumber.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END REPLY -->\n\n							<!-- START BUSY -->\n							<div class="form-group row">\n								<label class="col-md-3">\n									{{\'APPLICATION_BUSY\' | translate}}\n								</label>\n								<label class="col-md-9">\n									<input name="phoneBarBusy" type="checkbox" data-ng-model="agent.phoneBarBusy">\n								</label>\n							</div>\n							<!-- END BUSY -->\n\n							<!-- START BUSY NUMBER -->\n							<div class="form-group" data-ng-if="agent.phoneBarBusy" data-ng-class="{\'has-error\': (forms.callForwarding.phoneBarBusyNumber.$touched || forms.callForwarding.$submitted) && forms.callForwarding.phoneBarBusyNumber.$invalid}">\n								<input type="text" name="phoneBarBusyNumber" placeholder="{{\'APPLICATION_NUMBER\' | translate}}" class="form-control" data-ng-model="agent.phoneBarBusyNumber" required/>\n								<span class="help-block">\n									<!-- {{ \'DESCRIPTION_VOICE_HOST\' | translate }} -->\n								</span>\n								<span data-ng-show="(forms.callForwarding.phoneBarBusyNumber.$touched || forms.callForwarding.$submitted) && forms.callForwarding.phoneBarBusyNumber.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END BUSY NUMBER -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END CHANGE AVATAR TAB -->\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/staff/agent/view/view.voice.html",'<div class="row" data-ng-init="initView()">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_PROFILE\' | translate}} {{ \'APPLICATION_VOICE\' | translate}}</span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<form name="forms.voice" data-ng-submit="updateItem()" novalidate>\n\n					<!-- START INTERNAL -->\n					<div class="form-group" data-ng-class="{\'has-error\': (forms.voice.internal.$touched || forms.voice.$submitted) && forms.voice.internal.$invalid}">\n						<label class="control-label">{{\'APPLICATION_INTERNAL_NUMBER\' | translate}}<span class="required" aria-required="true">*</span></label>\n						<input type="text" name="internal" placeholder="{{\'APPLICATION_INTERNAL_NUMBER\' | translate}}" class="form-control" data-ng-model="agent.internal" required disabled/>\n						<span data-ng-show="(forms.voice.internal.$touched || forms.voice.$submitted) && forms.voice.internal.$error.required" class="help-block help-block-error">\n							<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n						</span>\n					</div>\n					<!-- END INTERNAL -->\n\n					<!-- START TRANSPORT -->\n					<div class="form-group">\n						<label class="control-label">{{ \'APPLICATION_TRANSPORT\' | translate}}</label>\n						<ui-select multiple name="transport" ng-model="agent.transport" theme="bootstrap">\n							<ui-select-match placeholder="Select transport...">{{$item}}</ui-select-match>\n							<ui-select-choices repeat="transport in [\'udp\', \'tcp\', \'ws\', \'wss\'] | filter: $select.search">\n								{{transport}}\n							</ui-select-choices>\n						</ui-select>\n						<span class="help-block">\n							{{ \'DESCRIPTION_VOICE_TRANSPORT\' | translate }}\n						</span>\n					</div>\n					<!-- END TRANSPORT -->\n\n					<!-- START HOST -->\n					<div class="form-group" data-ng-class="{\'has-error\': (forms.voice.host.$touched || forms.voice.$submitted) && forms.voice.host.$invalid}">\n						<label class="control-label">{{\'APPLICATION_HOST\' | translate}}<span class="required" aria-required="true">*</span></label>\n						<input type="text" name="host" placeholder="{{\'APPLICATION_HOST\' | translate}}" class="form-control" data-ng-model="agent.host" required/>\n						<span class="help-block">\n							{{ \'DESCRIPTION_VOICE_HOST\' | translate }}\n						</span>\n						<span data-ng-show="(forms.voice.host.$touched || forms.voice.$submitted) && forms.voice.host.$error.required" class="help-block help-block-error">\n							<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n						</span>\n					</div>\n					<!-- END HOST -->\n\n					<!-- START NAT -->\n					<div class="form-group">\n						<label class="control-label">{{ \'APPLICATION_NAT\' | translate}}</label>\n						<ui-select multiple data-ng-model="agent.nat" name="nat" theme="bootstrap">\n							<ui-select-match placeholder="{{ \'APPLICATION_SEARCH_FILTER\' | translate }}">{{$item}}</ui-select-match>\n							<ui-select-choices repeat="nat in [\'yes\', \'no\', \'never\', \'route\', \'force_rport\', \'comedia\'] | filter: $select.search">\n								{{nat}}\n							</ui-select-choices>\n						</ui-select>\n						<span class="help-block">\n							{{ \'DESCRIPTION_VOICE_NAT\' | translate }}\n						</span>\n					</div>\n					<!-- END NAT -->\n\n					<!-- START TYPE -->\n					<div class="form-group" data-ng-class="{\'has-error\': (forms.voice.type.$touched || forms.voice.$submitted) && forms.voice.type.$invalid}">\n						<label class="control-label">{{\'APPLICATION_TYPE\' | translate}}<span class="required" aria-required="true">*</span></label>\n						<ui-select data-ng-model="agent.type" name="type" theme="bootstrap" required>\n							<ui-select-match placeholder="{{ \'APPLICATION_SEARCH_FILTER\' | translate }}">{{$select.selected}}</ui-select-match>\n							<ui-select-choices repeat="type in [\'friend\', \'user\', \'peer\'] | filter: $select.search">\n								<div ng-bind-html="type | highlight: $select.search"></div>\n							</ui-select-choices>\n						</ui-select>\n						<span class="help-block">\n							{{ \'DESCRIPTION_VOICE_TYPE\' | translate }}\n						</span>\n						<span data-ng-show="(forms.voice.type.$touched || forms.voice.$submitted) && forms.voice.type.$error.required" class="help-block help-block-error">\n							<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n						</span>\n					</div>\n					<!-- END TYPE -->\n\n					<!-- START CODEC -->\n					<div class="form-group">\n						<label class="control-label">{{ \'APPLICATION_ALLOWED_CODECS\' | translate}}</label>\n						<ui-select multiple ng-model="agent.allow" name="allow" theme="bootstrap" ng-disabled="disabled">\n							<ui-select-match placeholder="Select codec...">{{$item}}</ui-select-match>\n							<ui-select-choices repeat="allow in [\'g729\', \'ilbc\', \'gsm\', \'ulaw\', \'alaw\'] | filter: $select.search">\n								{{allow}}\n							</ui-select-choices>\n						</ui-select>\n						<span class="help-block">\n							{{ \'DESCRIPTION_VOICE_CODEC\' | translate }}\n						</span>\n					</div>\n					<!-- END CODEC -->\n\n					<!-- START STATUS -->\n					<div class="form-group">\n						<label class="control-label">{{\'APPLICATION_CHANSPY\' | translate}}</label></br>\n						<input\n						bs-switch\n						class="form-control"\n						ng-model="agent.chanspy"\n						type="checkbox"\n						name="auth"\n						switch-active="{{ recordSwitch.isActive }}"\n						switch-on-text="{{ recordSwitch.onText }}"\n						switch-off-text="{{ recordSwitch.offText }}"\n						switch-on-color="{{ recordSwitch.onColor }}"\n						switch-off-color="{{ recordSwitch.offColor }}"\n						switch-animate="{{ recordSwitch.animate }}"\n						switch-size="{{ recordSwitch.size }}"\n						switch-label="{{ recordSwitch.label }}"\n						switch-icon="{{ recordSwitch.icon }}"\n						switch-radio-off="{{ recordSwitch.radioOff }}"\n						switch-label-width="{{ recordSwitch.labelWidth }}"\n						switch-handle-width="{{ recordSwitch.handleWidth }}">\n					</div>\n					<!-- END STATUS -->\n\n					<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n				</form>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/staff/agent/wizard/wizard.html",'<div class="col-md-12">\n	<!-- BEGIN PAGE HEADER-->\n	<div class="page-bar">\n		<ul class="page-breadcrumb">\n			<li>\n				<i class="icon-rocket"></i>\n				<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n				<i class="fa fa-angle-right"></i>\n			</li>\n			<li>\n				<i class="icon-people"></i>\n				<a href="/agents/list">{{ \'APPLICATION_AGENTS\' | translate }}</a>\n				<i class="fa fa-angle-right"></i>\n			</li>\n			<li>\n				<i class="icon-options"></i>\n				<a href="/agents/wizard">{{ \'APPLICATION_WIZARD\' | translate }}</a>\n			</li>\n		</ul>\n	</div>\n	<!-- END PAGE HEADER-->\n\n	<!-- BEGIN PORTLET-->\n	<div class="portlet light bordered" data-ng-init="getFirstFreeInternal();">\n		<div class="portlet-title">\n			<div class="caption font-green-sharp">\n				<i class="icon-user font-green-sharp"></i>\n				<span class="caption-subject">{{ \'APPLICATION_AGENT\' | translate }} WIZARD</a> </span>\n			</div>\n		</div>\n		<div class="portlet-body">\n			<wizard on-finish="createItem()">\n				<wz-step title="{{\'APPLICATION_ACCOUNT\' | translate}}" canexit="exitValidation(forms.info.$valid)">\n					<form name="forms.info" novalidate>\n\n						<!-- START NAME -->\n						<div class="form-group" data-ng-class="{\'has-error\': (forms.info.fullname.$touched || forms.info.$submitted) && forms.info.fullname.$invalid}">\n							<label class="control-label">{{\'APPLICATION_FULLNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n							<input type="text" name="fullname" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.fullname" required/>\n							<span data-ng-show="(forms.info.fullname.$touched || forms.info.$submitted) && forms.info.fullname.$error.required" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n						</div>\n						<!-- END NAME -->\n\n						<!-- START USERNAME -->\n						<div class="form-group" data-ng-class="{\'has-error\': (forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$invalid}">\n							<label class="control-label">{{\'APPLICATION_USERNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n							<input type="text" name="name" placeholder="{{\'APPLICATION_USERNAME\' | translate}}" class="form-control" data-ng-model="item.name" data-ng-pattern="settings.patternName" required>\n							<span data-ng-show="(forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$error.required" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n							<span data-ng-show="(forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$error.pattern" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_INVALID_PATTERN_NAME\' | translate}}.\n							</span>\n						</div>\n						<!-- END USERNAME -->\n\n						<!-- START EMAIL -->\n						<div class="form-group" data-ng-class="{\'has-error\': (forms.info.email.$touched || forms.info.$submitted) && forms.info.email.$invalid}">\n							<label class="control-label">{{\'APPLICATION_EMAIL\' | translate}}<span class="required" aria-required="true">*</span></label>\n							<input type="email" name="email" placeholder="{{\'APPLICATION_EMAIL\' | translate}}" class="form-control" data-ng-model="item.email" required>\n							<span data-ng-show="(forms.info.email.$touched || forms.info.$submitted) && forms.info.email.$error.required" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n							<span data-ng-show="(forms.info.email.$touched || forms.info.$submitted) && forms.info.email.$error.email" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_WRONG_FORMAT\' | translate}}.\n							</span>\n						</div>\n						<!-- END EMAIL -->\n\n						<!-- START PASSWORD -->\n						<div class="form-group" data-ng-class="{\'has-error\': (forms.info.password.$touched || forms.info.$submitted) && forms.info.password.$invalid}">\n							<label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n							<input type="password" name="password" placeholder="{{\'APPLICATION_PASSWORD\' | translate}}" class="form-control" data-ng-model="item.password" required/>\n							<span data-ng-show="(forms.info.password.$touched || forms.info.$submitted) && forms.info.password.$error.required" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n						</div>\n						<!-- END PASSWORD -->\n\n						<!-- START RE PASSWORD -->\n						<div class="form-group" data-ng-class="{\'has-error\': (forms.info.rpassword.$touched || forms.info.$submitted) && forms.info.rpassword.$invalid}">\n							<label class="control-label">{{\'APPLICATION_CONFIRM_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n							<input type="password" name="rpassword" placeholder="{{\'APPLICATION_CONFIRM_PASSWORD\' | translate}}" class="form-control" data-ng-model="item.rpassword" nx-equal="item.password" required/>\n							<span data-ng-show="(forms.info.rpassword.$touched || forms.info.$submitted) && forms.info.rpassword.$error.required" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n							<span data-ng-show="(forms.info.rpassword.$touched || forms.info.$submitted) && forms.info.rpassword.$error.nxEqual" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_WRONG_PASSWORD\' | translate}}.\n							</span>\n						</div>\n						<!-- END RE PASSWORD -->\n\n						<!-- START INTERNAL -->\n						<div class="form-group" data-ng-class="{\'has-error\': (forms.info.internal.$touched || forms.info.$submitted) && forms.info.internal.$invalid}">\n							<label class="control-label">{{\'APPLICATION_INTERNAL_NUMBER\' | translate}}<span class="required" aria-required="true">*</span></label>\n							<div class="input-group">\n								<input type="number" min="1" name="internal" placeholder="{{\'APPLICATION_INTERNAL_NUMBER\' | translate}}" class="form-control" data-ng-model="item.internal" data-ng-disabled="!item.internalEnabled" data-ng-required="item.internalEnabled"/>\n								<span class="input-group-addon">\n									<input type="checkbox" data-ng-model="item.internalEnabled">\n								</span>\n							</div>\n							<span data-ng-show="(forms.info.internal.$touched || forms.info.$submitted) && forms.info.internal.$error.required" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n						</div>\n						<!-- END INTERNAL -->\n\n						<!-- START DESCRIPTION -->\n						<div class="form-group">\n							<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n							<textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n						</div>\n						<!-- END DESCRIPTION -->\n\n						<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" ng-click="next()"/>\n					</form>\n				</wz-step>\n\n				<wz-step title="{{\'APPLICATION_VOICE\' | translate}}" canexit="exitValidation(forms.voice.$valid)">\n					<form name="forms.voice" novalidate>\n\n						<!-- START TRANSPORT -->\n						<div class="form-group">\n							<label class="control-label">{{ \'APPLICATION_TRANSPORT\' | translate}}</label>\n							<ui-select multiple name="transport" ng-model="item.transport" theme="bootstrap" ng-disabled="disabled">\n								<ui-select-match placeholder="Select transport...">{{$item}}</ui-select-match>\n								<ui-select-choices repeat="transport in [\'udp\', \'tcp\', \'ws\', \'wss\'] | filter: $select.search">\n									{{transport}}\n								</ui-select-choices>\n							</ui-select>\n							<span class="help-block">\n								{{ \'DESCRIPTION_VOICE_TRANSPORT\' | translate }}\n							</span>\n						</div>\n						<!-- END TRANSPORT -->\n\n						<!-- START CODEC -->\n						<div class="form-group">\n							<label class="control-label">{{ \'APPLICATION_ALLOWED_CODECS\' | translate}}</label>\n							<ui-select multiple ng-model="item.allow" name="allow" theme="bootstrap" ng-disabled="disabled">\n								<ui-select-match placeholder="Select codec...">{{$item}}</ui-select-match>\n								<ui-select-choices repeat="allow in [\'g729\', \'ilbc\', \'gsm\', \'ulaw\', \'alaw\'] | filter: $select.search">\n									{{allow}}\n								</ui-select-choices>\n							</ui-select>\n							<span class="help-block">\n								{{ \'DESCRIPTION_VOICE_CODEC\' | translate }}\n							</span>\n						</div>\n						<!-- END CODEC -->\n\n						<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" ng-click="next()"/>\n						<input class="btn default" type="button" value="{{\'APPLICATION_BACK\' | translate}}" wz-previous/>\n					</form>\n				</wz-step>\n\n				<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n					<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n					<input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n				</wz-step>\n			</wizard>\n		</div>\n	</div>\n	<!-- END PORTLET-->\n</div>\n'),a.put("app/staff/team/list/create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_TEAM\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.name.$touched || form.$submitted) && form.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n      <span data-ng-show="(form.name.$touched || form.$submitted) && form.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n    </div>\n    <!-- END DESCRIPTION -->\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="ok()" ng-disabled="form.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/staff/team/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-shield"></i>\n					<a href="/staff/teams/list">{{ \'APPLICATION_TEAMS\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-shield font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_TEAMS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<a class="btn green-jungle" href="#" data-ng-click="createItem()">\n						<i class="icon-plus"></i> {{ \'APPLICATION_NEW_TEAM\' | translate }}\n					</a>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/staff/team/view/view.agents.html",'<div class="row" data-ng-init="initAgents()">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_AGENTS\' | translate}}</span>\n				</div>\n			</div>\n			<div class="portlet-body">\n			<!-- GENERAL TAB -->\n				<!-- BEGIN PORTLET-->\n					<!-- BEGIN FORM-->\n					<form action="index.html" class="form-horizontal form-row-seperated">\n						<div class="form-body">\n							<div class="form-group last">\n								<div class="col-md-12" id="multi-select-team">\n								</div>\n							</div>\n						</div>\n					</form>\n					<!-- END FORM-->\n				<!-- END PORTLET-->\n			<!-- END GENERAL TAB -->\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/staff/team/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initView()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-shield"></i>\n					<a href="/staff/teams/list">{{ \'APPLICATION_TEAMS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<a href="#">{{team.name}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img ng-src="assets/images/media/team.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{team.name}}\n					</div>\n\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.staff.teams.view.settings\')}">\n							<a data-ng-href="/staff/teams/view/{{team.id}}/settings">\n							<i class="icon-settings"></i>\n							{{ \'APPLICATION_SETTINGS\' | translate}} </a>\n						</li>\n						<li data-ng-class="{active: $state.is(\'main.staff.teams.view.agents\')}">\n							<a data-ng-href="/staff/teams/view/{{team.id}}/agents">\n							<i class="icon-people"></i>\n							{{ \'APPLICATION_AGENTS\' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content"></div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/staff/team/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_PROFILE\' | translate}} {{ \'APPLICATION_ACCOUNT\' | translate}}</span>\n				</div>\n			</div>\n\n			<div class="portlet-body">\n				<!-- PERSONAL INFO TAB -->\n				<div>\n\n					<form name="forms.info" data-ng-submit="updateItem()" novalidate>\n						<!-- START NAME -->\n						<div class="form-group" data-ng-class="{\'has-error\': (forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$invalid}">\n							<label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n							<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="team.name" required/>\n							<span data-ng-show="(forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$error.required" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n						</div>\n						<!-- END NAME -->\n\n						<!-- START DESCRIPTION -->\n						<div class="form-group">\n							<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n							<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="team.description"/>\n						</div>\n						<!-- END DESCRIPTION -->\n\n						<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n					</form>\n				</div>\n				<!-- END PERSONAL INFO TAB -->\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/staff/telephone/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-phone"></i>\n					<a href="/staff/telephones/list">{{ \'APPLICATION_TELEPHONES\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-phone font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_TELEPHONES\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<a class="btn green-jungle" href="/staff/telephones/wizard" data-toggle="dropdown">\n						<i class="icon-plus"></i> {{ \'APPLICATION_NEW_TELEPHONE\' | translate }}\n					</a>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),
+a.put("app/staff/telephone/view/view.account.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_PROFILE\' | translate}}</span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_ACCOUNT\' | translate}}</a>\n					</li>\n					<li>\n						<a href="#" data-target="#tab_1_2" data-toggle="tab">{{ \'APPLICATION_VOICE\' | translate}}</a>\n					</li>\n					<li>\n						<a href="#" data-ng-show="Auth.isAdmin() || item.id === getCurrentTelephone().id" data-target="#tab_1_3" data-toggle="tab">{{ \'APPLICATION_CHANGE_PASSWORD\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- PERSONAL INFO TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.info" data-ng-submit="updateItem() && forms.info.$valid" novalidate>\n\n				      <!-- START NAME -->\n				      <div class="form-group" data-ng-class="{\'has-error\': (forms.info.fullname.$touched || forms.info.$submitted) && forms.info.fullname.$invalid}">\n				        <label class="control-label">{{\'APPLICATION_FULLNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n				        <input type="text" name="fullname" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.fullname" required/>\n								<span data-ng-show="(forms.info.fullname.$touched || forms.info.$submitted) && forms.info.fullname.$error.required" class="help-block help-block-error">\n				          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n				        </span>\n				      </div>\n				      <!-- END NAME -->\n\n				      <!-- START USERNAME -->\n				      <div class="form-group" data-ng-class="{\'has-error\': (forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$invalid}">\n				        <label class="control-label">{{\'APPLICATION_USERNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n				        <input type="text" name="name" placeholder="{{\'APPLICATION_USERNAME\' | translate}}" class="form-control" data-ng-model="item.name" required ng-remote-validate="/api/agents/validate/name"/>\n								<span data-ng-show="(forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$error.required" class="help-block help-block-error">\n				          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n				        </span>\n								<span data-ng-show="(forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$error.ngRemoteValidate" class="help-block help-block-error">\n				          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_EXIST_USERNAME\' | translate}}.\n				        </span>\n				      </div>\n				      <!-- END USERNAME -->\n\n							<!-- START INTERNAL -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.info.internal.$touched || forms.info.$submitted) && forms.info.internal.$invalid}">\n								<label class="control-label">{{\'APPLICATION_INTERNAL_NUMBER\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="number" min="1" name="internal" placeholder="{{\'APPLICATION_INTERNAL_NUMBER\' | translate}}" class="form-control" data-ng-model="item.internal" required ng-remote-validate="/api/agents/validate/internal"/>\n								<span data-ng-show="(forms.info.internal.$touched || forms.info.$submitted) && forms.info.internal.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n								<span data-ng-show="(forms.info.internal.$touched || forms.info.$submitted) && forms.info.internal.$error.ngRemoteValidate" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_EXIST_INTERNAL\' | translate}}.\n								</span>\n							</div>\n							<!-- END INTERNAL -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n							</div>\n							<!-- END DESCRIPTION -->\n\n				      <input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" ng-click="next()"/>\n				    </form>\n					</div>\n					<!-- END PERSONAL INFO TAB -->\n\n					<!-- CHANGE AVATAR TAB -->\n					<div class="tab-pane" id="tab_1_2">\n						<form name="forms.voice" data-ng-submit="updateItem() && forms.voice.$valid" novalidate>\n\n							<!-- START TRANSPORT -->\n							<div class="form-group">\n								<label class="control-label">{{ \'APPLICATION_TRANSPORT\' | translate}}</label>\n								<ui-select multiple name="transport" ng-model="item.transport" theme="bootstrap" ng-disabled="disabled">\n							    <ui-select-match placeholder="Select transport...">{{$item}}</ui-select-match>\n							    <ui-select-choices repeat="transport in [\'udp\', \'tcp\', \'ws\', \'wss\'] | filter: $select.search">\n							    	{{transport}}\n							    </ui-select-choices>\n							  </ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_VOICE_TRANSPORT\' | translate }}\n								</span>\n							</div>\n							<!-- END TRANSPORT -->\n\n							<!-- START CODEC -->\n							<div class="form-group">\n								<label class="control-label">{{ \'APPLICATION_ALLOWED_CODECS\' | translate}}</label>\n								<ui-select multiple ng-model="item.allow" name="allow" theme="bootstrap" ng-disabled="disabled">\n							    <ui-select-match placeholder="Select codec...">{{$item}}</ui-select-match>\n							    <ui-select-choices repeat="allow in [\'g729\', \'ilbc\', \'gsm\', \'ulaw\', \'alaw\'] | filter: $select.search">\n							    	{{allow}}\n							    </ui-select-choices>\n							  </ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_VOICE_CODEC\' | translate }}\n								</span>\n							</div>\n							<!-- END CODEC -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END CHANGE AVATAR TAB -->\n\n					<!-- CHANGE PASSWORD TAB -->\n					<div class="tab-pane" id="tab_1_3" data-ng-show="Auth.isAdmin() || item.id === getCurrentTelephone().id">\n						<form name="forms.changePwd" data-ng-submit="updateItem() && forms.changePwd.$valid" novalidate>\n							<!-- START CURRENT PWD -->\n							<!-- <div class="form-group" data-ng-if="!Auth.isAdmin()" data-ng-class="{\'has-error\': (forms.changePwd.current_pwd.$touched || forms.changePwd.$submitted) && forms.changePwd.current_pwd.$invalid}">\n								<label class="control-label">{{\'APPLICATION_CURRENT_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="password" name="current_pwd" placeholder="{{\'APPLICATION_CURRENT_PASSWORD\' | translate}}" class="form-control" data-ng-model="item.currentPwd" required/>\n								<span data-ng-show="(forms.changePwd.current_pwd.$touched || forms.changePwd.$submitted) && forms.changePwd.current_pwd.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div> -->\n							<!-- END CURRENT PWD -->\n							<!-- START NEW PWD -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.changePwd.new_pwd.$touched || forms.changePwd.$submitted) && forms.changePwd.new_pwd.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NEW_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="password" name="new_pwd" placeholder="{{\'APPLICATION_NEW_PASSWORD\' | translate}}" class="form-control" data-ng-model="item.password" required/>\n								<span data-ng-show="(forms.changePwd.new_pwd.$touched || forms.changePwd.$submitted) && forms.changePwd.new_pwd.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NEW PWD -->\n							<!-- START RE-NEW PWD -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.changePwd.re_new_pwd.$touched || forms.changePwd.$submitted) && forms.changePwd.re_new_pwd.$invalid}">\n								<label class="control-label">{{\'APPLICATION_RE_TYPE_NEW_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="password" name="re_new_pwd" placeholder="{{\'APPLICATION_RE_TYPE_NEW_PASSWORD\' | translate}}" class="form-control" data-ng-model="item.reNewPwd" nx-equal="item.password" required/>\n								<span data-ng-show="(forms.changePwd.new_pwd.$touched || forms.changePwd.$submitted) && forms.changePwd.new_pwd.$invalid" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END RE-NEW PWD -->\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END CHANGE PASSWORD TAB -->\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/staff/telephone/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initView()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-phone"></i>\n					<a href="/staff/telephones/list">{{ \'APPLICATION_TELEPHONES\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<a href="#">{{item.fullname}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR TELEPHONEPIC -->\n				<div class="profile-userpic">\n					<!-- <img ng-src="api/telephones/avatar/{{item.userpic ? item.userpic : \'unknown_avatar\'}}" class="img-responsive"> -->\n				</div>\n				<!-- END SIDEBAR TELEPHONEPIC -->\n				<!-- SIDEBAR TELEPHONE TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{item.fullname}}\n					</div>\n					<div class="profile-usertitle-job">\n						{{item.role}}\n					</div>\n				</div>\n				<!-- END SIDEBAR TELEPHONE TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.staff.telephones.view.account\')}">\n							<a data-ng-href="/telephones/view/{{item.id}}/account">\n							<i class="icon-item"></i>\n							{{ \'APPLICATION_ACCOUNT\' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/staff/telephone/wizard/wizard.html",'<div class="col-md-12">\n  <!-- BEGIN PAGE HEADER-->\n	<div class="page-bar">\n		<ul class="page-breadcrumb">\n			<li>\n				<i class="icon-rocket"></i>\n				<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n				<i class="fa fa-angle-right"></i>\n			</li>\n			<li>\n				<i class="icon-phone"></i>\n				<a href="/staff/telephones/list">{{ \'APPLICATION_TELEPHONES\' | translate }}</a>\n				<i class="fa fa-angle-right"></i>\n			</li>\n			<li>\n				<i class="icon-options"></i>\n				<a href="/staff/telephones/wizard">{{ \'APPLICATION_WIZARD\' | translate }}</a>\n			</li>\n		</ul>\n	</div>\n  <!-- END PAGE HEADER-->\n\n  <!-- BEGIN PORTLET-->\n  <div class="portlet light bordered" data-ng-init="initWizard()">\n  	<div class="portlet-title">\n  		<div class="caption font-green-sharp">\n  			<i class="icon-phone font-green-sharp"></i>\n  			<span class="caption-subject">{{ \'APPLICATION_TELEPHONE\' | translate }} WIZARD</a> </span>\n  		</div>\n  	</div>\n  	<div class="portlet-body">\n  		<wizard on-finish="createItem()">\n				<wz-step title="{{\'APPLICATION_ACCOUNT\' | translate}}" canexit="exitValidation(forms.info.$valid)">\n			    <form name="forms.info" novalidate>\n\n			      <!-- START NAME -->\n			      <div class="form-group" data-ng-class="{\'has-error\': (forms.info.fullname.$touched || forms.info.$submitted) && forms.info.fullname.$invalid}">\n			        <label class="control-label">{{\'APPLICATION_FULLNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n			        <input type="text" name="fullname" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.fullname" required/>\n							<span data-ng-show="(forms.info.fullname.$touched || forms.info.$submitted) && forms.info.fullname.$error.required" class="help-block help-block-error">\n			          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n			        </span>\n			      </div>\n			      <!-- END NAME -->\n\n			      <!-- START USERNAME -->\n			      <div class="form-group" data-ng-class="{\'has-error\': (forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$invalid}">\n			        <label class="control-label">{{\'APPLICATION_USERNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n			        <input type="text" name="name" placeholder="{{\'APPLICATION_USERNAME\' | translate}}" class="form-control" data-ng-model="item.name" ata-ng-pattern="settings.patternName"  required />\n							<span data-ng-show="(forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$error.required" class="help-block help-block-error">\n			          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n			        </span>\n							<span data-ng-show="(forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$error.ngRemoteValidate" class="help-block help-block-error">\n			          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_EXIST_USERNAME\' | translate}}.\n			        </span>\n							<span data-ng-show="(forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$error.pattern" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_INVALID_PATTERN_NAME\' | translate}}.\n							</span>\n			      </div>\n			      <!-- END USERNAME -->\n\n			      <!-- START PASSWORD -->\n			      <div class="form-group" data-ng-class="{\'has-error\': (forms.info.password.$touched || forms.info.$submitted) && forms.info.password.$invalid}">\n			        <label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n			        <input type="password" name="password" placeholder="{{\'APPLICATION_PASSWORD\' | translate}}" class="form-control" data-ng-model="item.password" required/>\n			        <span data-ng-show="(forms.info.password.$touched || forms.info.$submitted) && forms.info.password.$error.required" class="help-block help-block-error">\n			          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n			        </span>\n			      </div>\n			      <!-- END PASSWORD -->\n\n			      <!-- START RE PASSWORD -->\n			      <div class="form-group" data-ng-class="{\'has-error\': (forms.info.rpassword.$touched || forms.info.$submitted) && forms.info.rpassword.$invalid}">\n			        <label class="control-label">{{\'APPLICATION_CONFIRM_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n			        <input type="password" name="rpassword" placeholder="{{\'APPLICATION_CONFIRM_PASSWORD\' | translate}}" class="form-control" data-ng-model="item.rpassword" nx-equal="item.password" required/>\n			        <span data-ng-show="(forms.info.rpassword.$touched || forms.info.$submitted) && forms.info.rpassword.$error.required" class="help-block help-block-error">\n			          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n			        </span>\n			        <span data-ng-show="(forms.info.rpassword.$touched || forms.info.$submitted) && forms.info.rpassword.$error.nxEqual" class="help-block help-block-error">\n			          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_WRONG_PASSWORD\' | translate}}.\n			        </span>\n			      </div>\n			      <!-- END RE PASSWORD -->\n\n						<!-- START INTERNAL -->\n						<div class="form-group" data-ng-class="{\'has-error\': (forms.info.internal.$touched || forms.info.$submitted) && forms.info.internal.$invalid}">\n							<label class="control-label">{{\'APPLICATION_INTERNAL_NUMBER\' | translate}}<span class="required" aria-required="true">*</span></label>\n							<div class="input-group">\n							<input type="number" min="1" name="internal" placeholder="{{\'APPLICATION_INTERNAL_NUMBER\' | translate}}" class="form-control" data-ng-model="item.internal" data-ng-disabled="!item.internalEnabled" data-ng-required="item.internalEnabled" ng-remote-validate="/api/agents/validate/internal"/>\n							<span class="input-group-addon">\n								<input type="checkbox" data-ng-model="item.internalEnabled">\n							</span>\n							</div>\n							<span data-ng-show="(forms.info.internal.$touched || forms.info.$submitted) && forms.info.internal.$error.required" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n							<span data-ng-show="(forms.info.internal.$touched || forms.info.$submitted) && forms.info.internal.$error.ngRemoteValidate" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_EXIST_INTERNAL\' | translate}}.\n							</span>\n						</div>\n						<!-- END INTERNAL -->\n\n						<!-- START DESCRIPTION -->\n						<div class="form-group">\n							<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n							<textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n						</div>\n						<!-- END DESCRIPTION -->\n\n			      <input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" ng-click="next()"/>\n			    </form>\n			  </wz-step>\n\n				<wz-step title="{{\'APPLICATION_VOICE\' | translate}}" canexit="exitValidation(forms.voice.$valid)">\n					<form name="forms.voice" novalidate>\n\n						<!-- START TRANSPORT -->\n						<div class="form-group">\n							<label class="control-label">{{ \'APPLICATION_TRANSPORT\' | translate}}</label>\n							<ui-select multiple name="transport" ng-model="item.transport" theme="bootstrap" ng-disabled="disabled">\n						    <ui-select-match placeholder="Select transport...">{{$item}}</ui-select-match>\n						    <ui-select-choices repeat="transport in [\'udp\', \'tcp\', \'ws\', \'wss\'] | filter: $select.search">\n						    	{{transport}}\n						    </ui-select-choices>\n						  </ui-select>\n							<span class="help-block">\n								{{ \'DESCRIPTION_VOICE_TRANSPORT\' | translate }}\n							</span>\n						</div>\n						<!-- END TRANSPORT -->\n\n						<!-- START CODEC -->\n						<div class="form-group">\n							<label class="control-label">{{ \'APPLICATION_ALLOWED_CODECS\' | translate}}</label>\n							<ui-select multiple ng-model="item.allow" name="allow" theme="bootstrap" ng-disabled="disabled">\n						    <ui-select-match placeholder="Select codec...">{{$item}}</ui-select-match>\n						    <ui-select-choices repeat="allow in [\'g729\', \'ilbc\', \'gsm\', \'ulaw\', \'alaw\'] | filter: $select.search">\n						    	{{allow}}\n						    </ui-select-choices>\n						  </ui-select>\n							<span class="help-block">\n								{{ \'DESCRIPTION_VOICE_CODEC\' | translate }}\n							</span>\n						</div>\n						<!-- END CODEC -->\n\n						<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" ng-click="next()"/>\n						<input class="btn default" type="button" value="{{\'APPLICATION_BACK\' | translate}}" wz-previous/>\n					</form>\n				</wz-step>\n\n				<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n					<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n					<input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n				</wz-step>\n  		</wizard>\n  	</div>\n  </div>\n  <!-- END PORTLET-->\n</div>\n'),a.put("app/staff/user/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-eye"></i>\n					<a href="#">{{ \'APPLICATION_USERS\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-eye font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_USERS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<a class="btn green-jungle" href="/staff/users/wizard" data-toggle="dropdown">\n						<i class="icon-plus"></i> {{ \'APPLICATION_NEW_USER\' | translate }}\n					</a>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/staff/user/view/view.account.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_PROFILE\' | translate}} {{ \'APPLICATION_ACCOUNT\' | translate}}</span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_PERSONAL_INFO\' | translate}}</a>\n					</li>\n					<li>\n						<a href="#" data-target="#tab_1_2" data-toggle="tab">{{ \'APPLICATION_CHANGE_AVATAR\' | translate}}</a>\n					</li>\n					<li>\n						<a href="#" data-ng-show="Auth.isAdmin() || user.id === getCurrentUser().id" data-target="#tab_1_3" data-toggle="tab">{{ \'APPLICATION_CHANGE_PASSWORD\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- PERSONAL INFO TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.info" data-ng-submit="updateItem()" novalidate>\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.info.fullname.$touched || forms.info.$submitted) && forms.info.fullname.$invalid}">\n								<label class="control-label">{{\'APPLICATION_FULLNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="fullname" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="user.fullname" required/>\n								<span data-ng-show="(forms.info.fullname.$touched || forms.info.$submitted) && forms.info.fullname.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<!-- START USERNAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_USERNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_USERNAME\' | translate}}" class="form-control" data-ng-model="user.name" required/>\n								<span data-ng-show="(forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END USERNAME -->\n\n							<!-- START EMAIL -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.info.email.$touched || forms.info.$submitted) && forms.info.email.$invalid}">\n								<label class="control-label">{{\'APPLICATION_EMAIL\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="email" name="email" placeholder="{{\'APPLICATION_EMAIL\' | translate}}" class="form-control" data-ng-model="user.email" required/>\n								<span data-ng-show="(forms.info.email.$touched || forms.info.$submitted) && forms.info.email.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n								<span data-ng-show="(forms.info.email.$touched || forms.info.$submitted) && forms.info.email.$error.email" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_WRONG_FORMAT\' | translate}}.\n								</span>\n							</div>\n							<!-- END EMAIL -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="user.description"></textarea>\n							</div>\n							<!-- END DESCRIPTION -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END PERSONAL INFO TAB -->\n					<!-- CHANGE AVATAR TAB -->\n					<div class="tab-pane" id="tab_1_2">\n						<form action="#" role="form">\n							<div class="form-group">\n								<div class="fileinput fileinput-new" data-provides="fileinput">\n									<div class="fileinput-new thumbnail" style="width: 200px; height: 150px;">\n										<img src="http://www.placehold.it/200x150/EFEFEF/AAAAAA&amp;text=no+image" alt=""/>\n									</div>\n									<div class="fileinput-preview fileinput-exists thumbnail" style="max-width: 200px; max-height: 150px;">\n									</div>\n									<div>\n										<span class="btn default btn-file" data-ng-show="!uploader.queue[0]">\n											<span> {{ \'APPLICATION_SELECT_IMAGE\' | translate }} </span>\n											<input type="file" nv-file-select="" uploader="uploader" /><br/>\n										</span>\n										<button type="button" class="btn default" data-ng-show="uploader.queue[0]" data-dismiss="fileinput" ng-click="uploader.queue[0].remove()">\n											<span> {{ \'APPLICATION_REMOVE\' | translate }} </span>\n										</button>\n										<button type="button" class="btn green-haze" data-ng-show="uploader.queue[0]" data-ng-click="uploader.queue[0].upload()" ng-disabled="uploader.queue[0].isReady || uploader.queue[0].isUploading || uploader.queue[0].isSuccess">\n											<span> {{ \'APPLICATION_CONFIRM\' | translate }} </span>\n										</button>\n									</div>\n									<p>\n										</br> {{ \'MESSAGE_SUPPORTED_FORMATS\' | translate }} <b>jpg, png, jpeg</b>.\n									</p>\n								</div>\n							</div>\n						</form>\n						<div class="row">\n							<div class="col-md-2">\n								<table class="table" border="0">\n									<tbody>\n									<tr data-ng-repeat="item in uploader.queue">\n											<td style="border-top-style:none">\n												<strong>\n													{{ item.file.name }}\n												</strong>\n											</td>\n											<td data-ng-show="uploader.isHTML5" nowrap style="border-top-style:none">\n												{{ item.file.size/1024/1024|number:2 }} MB\n											</td>\n											<td nowrap style="border-top-style:none">\n												<button type="button" class="btn btn-danger btn-xs" data-ng-click="item.remove()">\n														<span class="glyphicon glyphicon-trash"></span> Remove\n												</button>\n											</td>\n										</tr>\n									</tbody>\n								</table>\n							</div>\n						</div>\n					</div>\n					<!-- END CHANGE AVATAR TAB -->\n					<!-- CHANGE PASSWORD TAB -->\n					<div class="tab-pane" id="tab_1_3" data-ng-show="Auth.isAdmin() || user.id === getCurrentUser().id">\n						<form name="forms.changePwd" data-ng-submit="forms.changePwd.$valid && updatePassword()" novalidate>\n							<!-- START CURRENT PWD -->\n							<div class="form-group" data-ng-if="!Auth.isAdmin()" data-ng-class="{\'has-error\': (forms.changePwd.current_pwd.$touched || forms.changePwd.$submitted) && forms.changePwd.current_pwd.$invalid}">\n								<label class="control-label">{{\'APPLICATION_CURRENT_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="password" name="current_pwd" placeholder="{{\'APPLICATION_CURRENT_PASSWORD\' | translate}}" class="form-control" data-ng-model="user.currentPwd" required/>\n								<span data-ng-show="(forms.changePwd.current_pwd.$touched || forms.changePwd.$submitted) && forms.changePwd.current_pwd.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END CURRENT PWD -->\n							<!-- START NEW PWD -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.changePwd.new_pwd.$touched || forms.changePwd.$submitted) && forms.changePwd.new_pwd.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NEW_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="password" name="new_pwd" placeholder="{{\'APPLICATION_NEW_PASSWORD\' | translate}}" class="form-control" data-ng-model="user.newPwd" required/>\n								<span data-ng-show="(forms.changePwd.new_pwd.$touched || forms.changePwd.$submitted) && forms.changePwd.new_pwd.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NEW PWD -->\n							<!-- START RE-NEW PWD -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.changePwd.re_new_pwd.$touched || forms.changePwd.$submitted) && forms.changePwd.re_new_pwd.$invalid}">\n								<label class="control-label">{{\'APPLICATION_RE_TYPE_NEW_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="password" name="re_new_pwd" placeholder="{{\'APPLICATION_RE_TYPE_NEW_PASSWORD\' | translate}}" class="form-control" data-ng-model="user.reNewPwd" nx-equal="user.newPwd" required/>\n								<span data-ng-show="(forms.changePwd.new_pwd.$touched || forms.changePwd.$submitted) && forms.changePwd.new_pwd.$invalid" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END RE-NEW PWD -->\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END CHANGE PASSWORD TAB -->\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),
+a.put("app/staff/user/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initView()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-eye"></i>\n					<a href="/staff/users/list">{{ \'APPLICATION_USERS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<a href="#">{{user.fullname}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-userpic">\n					<img ng-src="api/users/avatar/{{user.userpic ? user.userpic : \'unknown_avatar\'}}" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{user.fullname}}\n					</div>\n					<div class="profile-usertitle-job">\n						{{user.role}}\n					</div>\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.staff.users.view.account\')}">\n							<a data-ng-href="/staff/users/view/{{user.id}}/account">\n							<i class="icon-user"></i>\n							{{ \'APPLICATION_ACCOUNT\' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/staff/user/wizard/wizard.html",'<div class="col-md-12">\n  <!-- BEGIN PAGE HEADER-->\n	<div class="page-bar">\n		<ul class="page-breadcrumb">\n			<li>\n				<i class="icon-rocket"></i>\n				<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n				<i class="fa fa-angle-right"></i>\n			</li>\n			<li>\n				<i class="icon-eye"></i>\n				<a href="/users/list">{{ \'APPLICATION_USERS\' | translate }}</a>\n				<i class="fa fa-angle-right"></i>\n			</li>\n			<li>\n				<i class="icon-options"></i>\n				<a href="/staff/users/wizard">{{ \'APPLICATION_WIZARD\' | translate }}</a>\n			</li>\n		</ul>\n	</div>\n  <!-- END PAGE HEADER-->\n\n  <!-- BEGIN PORTLET-->\n  <div class="portlet light bordered">\n  	<div class="portlet-title">\n  		<div class="caption font-green-sharp">\n  			<i class="icon-user font-green-sharp"></i>\n  			<span class="caption-subject">{{ \'APPLICATION_USER\' | translate }} WIZARD</a> </span>\n  		</div>\n  	</div>\n  	<div class="portlet-body">\n  		<wizard on-finish="createItem()">\n				<wz-step title="{{\'APPLICATION_ACCOUNT\' | translate}}" canexit="exitValidation(forms.info.$valid)">\n			    <form name="forms.info" novalidate>\n\n			      <!-- START NAME -->\n			      <div class="form-group" data-ng-class="{\'has-error\': (forms.info.fullname.$touched || forms.info.$submitted) && forms.info.fullname.$invalid}">\n			        <label class="control-label">{{\'APPLICATION_FULLNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n			        <input type="text" name="fullname" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.fullname" required/>\n							<span data-ng-show="(forms.info.fullname.$touched || forms.info.$submitted) && forms.info.fullname.$error.required" class="help-block help-block-error">\n			          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n			        </span>\n			      </div>\n			      <!-- END NAME -->\n\n			      <!-- START USERNAME -->\n			      <div class="form-group" data-ng-class="{\'has-error\': (forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$invalid}">\n			        <label class="control-label">{{\'APPLICATION_USERNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n			        <input type="text" name="name" placeholder="{{\'APPLICATION_USERNAME\' | translate}}" class="form-control" data-ng-model="item.name" data-ng-pattern="settings.patternName" required />\n							<span data-ng-show="(forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$error.required" class="help-block help-block-error">\n			          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n			        </span>\n							<span data-ng-show="(forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$error.pattern" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_INVALID_PATTERN_NAME\' | translate}}.\n							</span>\n			      </div>\n			      <!-- END USERNAME -->\n\n			      <!-- START EMAIL -->\n			      <div class="form-group" data-ng-class="{\'has-error\': (forms.info.email.$touched || forms.info.$submitted) && forms.info.email.$invalid}">\n			        <label class="control-label">{{\'APPLICATION_EMAIL\' | translate}}<span class="required" aria-required="true">*</span></label>\n			        <input type="email" name="email" placeholder="{{\'APPLICATION_EMAIL\' | translate}}" class="form-control" data-ng-model="item.email" required />\n			        <span data-ng-show="(forms.info.email.$touched || forms.info.$submitted) && forms.info.email.$error.required" class="help-block help-block-error">\n			          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n			        </span>\n			        <span data-ng-show="(forms.info.email.$touched || forms.info.$submitted) && forms.info.email.$error.email" class="help-block help-block-error">\n			          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_WRONG_FORMAT\' | translate}}.\n			        </span>\n			      </div>\n			      <!-- END EMAIL -->\n\n			      <!-- START PASSWORD -->\n			      <div class="form-group" data-ng-class="{\'has-error\': (forms.info.password.$touched || forms.info.$submitted) && forms.info.password.$invalid}">\n			        <label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n			        <input type="password" name="password" placeholder="{{\'APPLICATION_PASSWORD\' | translate}}" class="form-control" data-ng-model="item.password" required/>\n			        <span data-ng-show="(forms.info.password.$touched || forms.info.$submitted) && forms.info.password.$error.required" class="help-block help-block-error">\n			          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n			        </span>\n			      </div>\n			      <!-- END PASSWORD -->\n\n			      <!-- START RE PASSWORD -->\n			      <div class="form-group" data-ng-class="{\'has-error\': (forms.info.rpassword.$touched || forms.info.$submitted) && forms.info.rpassword.$invalid}">\n			        <label class="control-label">{{\'APPLICATION_CONFIRM_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n			        <input type="password" name="rpassword" placeholder="{{\'APPLICATION_CONFIRM_PASSWORD\' | translate}}" class="form-control" data-ng-model="item.rpassword" nx-equal="item.password" required/>\n			        <span data-ng-show="(forms.info.rpassword.$touched || forms.info.$submitted) && forms.info.rpassword.$error.required" class="help-block help-block-error">\n			          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n			        </span>\n			        <span data-ng-show="(forms.info.rpassword.$touched || forms.info.$submitted) && forms.info.rpassword.$error.nxEqual" class="help-block help-block-error">\n			          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_WRONG_PASSWORD\' | translate}}.\n			        </span>\n			      </div>\n			      <!-- END RE PASSWORD -->\n\n						<!-- START DESCRIPTION -->\n						<div class="form-group">\n							<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n							<textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n						</div>\n						<!-- END DESCRIPTION -->\n\n			      <input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" ng-click="next()"/>\n			    </form>\n			  </wz-step>\n\n				<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n					<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n					<input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n				</wz-step>\n  		</wizard>\n  	</div>\n  </div>\n  <!-- END PORTLET-->\n</div>\n'),a.put("app/sugarcrm/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-handbag"></i>\n					<a href="/sugarcrm/list">{{ \'APPLICATION_SUGARCRM\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-handbag font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_SUGARCRM\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<a class="btn green-jungle" href="/sugarcrm/wizard" data-toggle="dropdown">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_ACCOUNT\' | translate }}\n						</a>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/sugarcrm/view/view.account.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_ACCOUNT\' | translate}}</span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{\'APPLICATION_GENERALS\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.formSetting" data-ng-submit="forms.formSetting.$valid && updateItem()" novalidate>\n              <!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="account.name" required/>\n								<span data-ng-show="forms.formSetting.name.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="account.description"/>\n							</div>\n							<!-- END DESCRIPTION -->\n\n              <!-- START USERNAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.username.$invalid}">\n								<label class="control-label">{{\'APPLICATION_USERNAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="username" placeholder="{{\'APPLICATION_USERNAME\' | translate}}" class="form-control" data-ng-model="account.username" required/>\n								<span data-ng-show="forms.formSetting.username.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END USERNAME -->\n\n              <!-- START REMOTE ADDRESS -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.remoteUri.$invalid}">\n								<label class="control-label">{{\'APPLICATION_REMOTE_ADDRESS\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="url" name="remoteUri" placeholder="{{\'APPLICATION_REMOTE_ADDRESS\' | translate}}" class="form-control" data-ng-model="account.remoteUri" required />\n								<span data-ng-show="forms.formSetting.remoteUri.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END USERNAME -->\n\n							<!-- START PASSWORD -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.password.$invalid}">\n								<label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="password" name="password" placeholder="{{\'APPLICATION_PASSWORD\' | translate}}" class="form-control" data-ng-model="account.password" required/>\n								<span data-ng-show="forms.formSetting.apiKey.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END API KEY -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END GENERAL TAB -->\n\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/sugarcrm/view/view.configuration.html",'<div class="row" data-ng-init="initConfiguration()">\n	<div class="col-md-12">\n		<!-- BEGIN  PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-notebook font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_CONFIGURATION\' | translate }} WIZARD</a> </span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<wizard on-finish="createConfiguration()">\n	        <wz-step title="{{\'APPLICATION_SETTINGS\' | translate}}" canexit="formValidation(formsConfiguration.info.$valid)">\n							<form name="formsConfiguration.info" novalidate>\n								<!-- START NAME -->\n								<div class="form-group" data-ng-class="{\'has-error\': formsConfiguration.info.$submitted && formsConfiguration.info.name.$invalid}">\n									<label class="control-label">{{\'APPLICATION_NAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n									<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="configuration.name" required/>\n									<span data-ng-show="formsConfiguration.info.name.$invalid && formsConfiguration.info.$submitted" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END NAME -->\n								<!-- START DESCRIPTION -->\n								<div class="form-group">\n									<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n									<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="configuration.description"/>\n								</div>\n								<!-- END DESCRIPTION -->\n\n								<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" data-ng-click="goNext()"/>\n							</form>\n						</wz-step>\n\n						<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n							<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n							<input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n						</wz-step>\n				</wizard>\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/sugarcrm/view/view.configurationSettings.html",'<div class="row" data-ng-init="getConfiguration();getVariables();getFields();">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_CONFIGURATION\' | translate}}: {{configurationName}}</span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{\'APPLICATION_SUBJECT\' | translate}}</a>\n					</li>\n          <li>\n						<a href="#" data-target="#tab_1_2" data-toggle="tab">{{\'APPLICATION_DESCRIPTION\' | translate}}</a>\n					</li>\n          <li>\n						<a href="#" data-target="#tab_1_3" data-toggle="tab">{{\'APPLICATION_FIELDS\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- SUBJECT TAB -->\n					<div class="tab-pane ui-padding active" id="tab_1_1">\n            <div class="row">\n              <div class="col-md-11">\n                <span class="caption-subject">All following fields will be join by blank space:</span>\n              </div>\n              <div class="col-md-1 pull-rigth">\n                <button class="btn btn-icon-only green" data-ng-click="addItemSubject()"><i class="fa fa-plus"></i></button>\n              </div>\n            </div>\n            <hr>\n						<!-- <div ng-scrollbars ng-scrollbars-config="config"> -->\n	            <div class="row" data-ng-repeat="subjectItem in subjectConfig">\n	              <div class="col-md-3">\n	                <ui-select ng-model="subjectItem.type" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeType(subjectItem)">\n	                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n	                  <ui-select-choices repeat="item in fieldType | filter: $select.search">\n	                    <div ng-bind-html="item | highlight: $select.search | capitalize"></div>\n	                  </ui-select-choices>\n	                </ui-select>\n	              </div>\n	              <div class="col-md-8" data-ng-if="subjectItem.type==\'string\'">\n	                <div class="form-group">\n	                  <input type="text" class="form-control" data-ng-model="subjectItem.content" data-ng-change="updateField(subjectItem)">\n	                </div>\n	              </div>\n	              <div class="col-md-8" data-ng-if="subjectItem.type==\'variable\'">\n	                <div class="form-group">\n	                  <ui-select theme="bootstrap" ng-disabled="disabled" data-ng-model="subjectItem.VariableId" data-ng-change="updateField(subjectItem)">\n	                    <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n	                    <ui-select-choices repeat="variable.id as variable in variables | filter: $select.search">\n	                      <div ng-bind-html="variable.name | highlight: $select.search"></div>\n	                    </ui-select-choices>\n	                  </ui-select>\n	                </div>\n	              </div>\n	              <div class="col-md-1">\n	                <div class="form-group">\n	                  <button class="btn btn-icon-only red" data-ng-click="removeItem(subjectItem)"><i class="fa fa-times"></i></button>\n	                </div>\n	              </div>\n	            </div>\n						<!-- </div> -->\n					</div>\n					<!-- END SUBJECT TAB -->\n          <!-- DESCRIPTION TAB -->\n					<div class="tab-pane ui-padding" id="tab_1_2">\n						<div class="row">\n              <div class="col-md-11">\n                <span class="caption-subject">All following fields will be join by new line:</span>\n              </div>\n              <div class="col-md-1 pull-rigth">\n                <button class="btn btn-icon-only green" data-ng-click="addItemDescription()"><i class="fa fa-plus"></i></button>\n              </div>\n            </div>\n            <hr>\n						<!-- <div ng-scrollbars ng-scrollbars-config="config"> -->\n							<div class="row" data-ng-repeat="descriptionItem in descriptionConfig">\n								<!-- <pre>\n									{{descriptionItem|json}}\n								</pre> -->\n	              <div class="col-md-2">\n	                <ui-select ng-model="descriptionItem.type" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeDescType(descriptionItem)">\n	                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected | ucfirst}}</ui-select-match>\n	                  <ui-select-choices repeat="item in descFieldType | filter: $select.search">\n	                    <div ng-bind-html="item | highlight: $select.search | ucfirst"></div>\n	                  </ui-select-choices>\n	                </ui-select>\n	              </div>\n	              <div class="col-md-9" data-ng-if="descriptionItem.type==\'string\'">\n	                <div class="form-group">\n	                  <input type="text" class="form-control" data-ng-model="descriptionItem.content" data-ng-change="updateField(descriptionItem)">\n	                </div>\n	              </div>\n								<div class="col-md-3" data-ng-if="descriptionItem.type==\'key_value\'">\n									<input type="text" class="form-control" placeholder="Key" data-ng-model="descriptionItem.key" data-ng-change="updateField(descriptionItem)">\n								</div>\n								<div class="col-md-3" data-ng-if="descriptionItem.type==\'key_value\'">\n									<ui-select ng-model="descriptionItem.keyType" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeDescType(descriptionItem)">\n	                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n	                  <ui-select-choices repeat="item in fieldType | filter: $select.search">\n	                    <div ng-bind-html="item | highlight: $select.search | capitalize"></div>\n	                  </ui-select-choices>\n	                </ui-select>\n								</div>\n								<div class="col-md-3" data-ng-if="descriptionItem.type==\'key_value\' && descriptionItem.keyType==\'string\'">\n									<input type="text" class="form-control" placeholder="Value" data-ng-model="descriptionItem.keyContent" data-ng-change="updateField(descriptionItem)">\n								</div>\n	              <div class="col-md-3" data-ng-if="descriptionItem.type==\'key_value\' && descriptionItem.keyType==\'variable\'">\n	                <div class="form-group">\n	                  <ui-select theme="bootstrap" ng-disabled="disabled" data-ng-model="descriptionItem.VariableId" data-ng-change="updateField(descriptionItem)">\n	                    <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n	                    <ui-select-choices repeat="variable.id as variable in variables | filter: $select.search">\n	                      <div ng-bind-html="variable.name | highlight: $select.search"></div>\n	                    </ui-select-choices>\n	                  </ui-select>\n	                </div>\n	              </div>\n	              <div class="col-md-1">\n	                <div class="form-group">\n	                  <button class="btn btn-icon-only red" data-ng-click="removeItem(descriptionItem)"><i class="fa fa-times"></i></button>\n	                </div>\n	              </div>\n	            </div>\n						<!-- </div> -->\n					</div>\n					<!-- END DESCRIPTION TAB -->\n          <!-- FIELDS TAB -->\n					<div class="tab-pane ui-padding" id="tab_1_3">\n						<div class="row">\n              <div class="col-md-11">\n                <span class="caption-subject">Add how to fill the fields present in your account:</span>\n              </div>\n              <div class="col-md-1 pull-rigth">\n                <button class="btn btn-icon-only green" data-ng-click="addItemField()"><i class="fa fa-plus"></i></button>\n              </div>\n            </div>\n            <hr>\n						<!-- <div ng-scrollbars ng-scrollbars-config="config"> -->\n	            <div class="row" data-ng-repeat="fieldItem in fieldConfig">\n	              <div class="col-md-3">\n	                <ui-select ng-model="fieldItem.idField" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeFieldType(fieldItem)">\n	                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.label}}</ui-select-match>\n	                  <ui-select-choices repeat="item.name as item in accountFields | filter: $select.search">\n	                    <div ng-bind-html="item.label | highlight: $select.search"></div>\n	                  </ui-select-choices>\n	                </ui-select>\n	              </div>\n	              <div class="col-md-8" data-ng-if="getSystemFieldOptions(fieldItem.idField)">\n	                <div class="form-group">\n										<ui-select ng-model="fieldItem.content" theme="bootstrap" ng-disabled="disabled" data-ng-change="updateField(fieldItem)">\n		                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n		                  <ui-select-choices repeat="item.value as item in getSystemFieldOptions(fieldItem.idField) | filter: $select.search">\n		                    <div ng-bind-html="item.name | highlight: $select.search"></div>\n		                  </ui-select-choices>\n		                </ui-select>\n	                </div>\n	              </div>\n								<div class="col-md-4" data-ng-if="!getSystemFieldOptions(fieldItem.idField)">\n									<div class="form-group">\n										<ui-select ng-model="fieldItem.type" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeType(fieldItem)">\n		                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected | ucfirst}}</ui-select-match>\n		                  <ui-select-choices repeat="item in fieldType | filter: $select.search">\n		                    <div ng-bind-html="item | highlight: $select.search | ucfirst"></div>\n		                  </ui-select-choices>\n		                </ui-select>\n									</div>\n								</div>\n								<div class="col-md-4" data-ng-if="!getSystemFieldOptions(fieldItem.idField) && fieldItem.type === \'string\'">\n	                <div class="form-group">\n										<input type="text" class="form-control" data-ng-model="fieldItem.content" data-ng-change="updateField(fieldItem)">\n	                </div>\n	              </div>\n								<div class="col-md-4" data-ng-if="!getSystemFieldOptions(fieldItem.idField) && fieldItem.type === \'variable\'">\n	                <div class="form-group">\n										<ui-select theme="bootstrap" ng-disabled="disabled" data-ng-model="fieldItem.VariableId" data-ng-change="updateField(fieldItem)">\n	                    <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n	                    <ui-select-choices repeat="variable.id as variable in variables | filter: $select.search">\n	                      <div ng-bind-html="variable.name | highlight: $select.search"></div>\n	                    </ui-select-choices>\n	                  </ui-select>\n	                </div>\n	              </div>\n	              <div class="col-md-1">\n	                <div class="form-group">\n	                  <button class="btn btn-icon-only red" data-ng-click="removeItem(fieldItem)"><i class="fa fa-times"></i></button>\n	                </div>\n	              </div>\n	            </div>\n						<!-- </div> -->\n					</div>\n					<!-- END FIELDS TAB -->\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/sugarcrm/view/view.configurations.html",'<div ui-view class="profile-content">\n	<div class="row" data-ng-init="getConfigurations()">\n		<div class="col-md-12">\n			<div class="portlet light">\n				<div class="portlet-title  tabbable-line">\n					<div class="caption caption-md">\n						<i class="icon-globe theme-font hide"></i>\n						<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_CONFIGURATIONS\' | translate}}</span>\n					</div>\n					<div class="actions">\n						<div class="btn-group">\n							<a class="btn green-jungle " href="/sugarcrm/view/{{account.id}}/configuration" data-toggle="dropdown">\n								<i class="icon-plus"></i> {{ \'APPLICATION_NEW_CONFIGURATION\' | translate }}\n							</a>\n						</div>\n					</div>\n				</div>\n				<div class="portlet-body">\n					<!-- START TABLE -->\n					<table class="table table-striped table-bordered table-hover">\n						  <thead>\n							  <tr>\n							    <th>{{\'APPLICATION_NAME\' | translate}}</th>\n									<th>{{\'APPLICATION_DESCRIPTION\' | translate}}</th>\n									<th>{{ \'APPLICATION_ACTIONS\' | translate }}</th>\n							  </tr>\n						  </thead>\n							<tbody>\n						    <tr data-ng-repeat="configuration in configurations">\n									<td>{{configuration.name}}</td>\n									<td>{{configuration.description}}</td>\n						      <td>\n										<a class="btn default btn-xs blue-stripe" data-ng-href="/sugarcrm/view/{{account.id}}/configurations/settings/{{configuration.id}}">\n											{{ \'APPLICATION_SETTINGS\' | translate}}\n						        </a>\n						        <a class="btn default btn-xs red-stripe" data-ng-click="deleteConfiguration(configuration.name,configuration.id)">\n											{{ \'APPLICATION_DELETE\' | translate }}\n						        </a>\n						      </td>\n						    </tr>\n								<tr data-ng-hide="configurations.length">\n									<td colspan="5" style="text-align:center;">\n										<i>No configuration available</i>\n									</td>\n								</tr>\n						  </tbody>\n					</table>\n					<!-- END TABLE -->\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/sugarcrm/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initView()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n          <i class="icon-handbag"></i>\n          <a href="/sugarcrm/list">{{ \'APPLICATION_SUGARCRM\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<a href="#">{{account.name}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img src="assets/images/media/sugarcrm.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{account.name}}\n					</div>\n					<div class="profile-usertitle-job">\n						{{account.remoteUri}}\n					</div>\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.sugarcrm.view.account\')}">\n							<a ng-href="/sugarcrm/view/{{account.id}}/account">\n							<i class="icon-user"></i>\n							{{ \'APPLICATION_ACCOUNT\' | translate }} </a>\n						</li>\n						<li data-ng-class="{active: $state.includes(\'main.sugarcrm.view.configurations\') || $state.is(\'main.sugarcrm.view.configuration\')}">\n							<a ng-href="/sugarcrm/view/{{account.id}}/configurations">\n							<i class="icon-settings"></i>\n							{{ \'APPLICATION_CONFIGURATIONS\' | translate }} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),
+a.put("app/sugarcrm/wizard/wizard.html",'<!-- BEGIN PAGE HEADER-->\n<div class="row">\n	<div class="col-md-12">\n			<div class="page-bar">\n				<ul class="page-breadcrumb">\n					<li>\n						<i class="icon-rocket"></i>\n						<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-handbag"></i>\n						<a href="/sugarcrm/list">{{ \'APPLICATION_SUGARCRM\' | translate }}</a>\n					</li>\n				</ul>\n			</div>\n		</div>\n</div>\n<!-- END PAGE HEADER-->\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initWizard()">\n	<div class="col-md-12">\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-notebook font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_ACCOUNT\' | translate }} WIZARD</a> </span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<wizard on-finish="createItem()">\n          <wz-step title="{{\'APPLICATION_ACCOUNT_INFO\' | translate}}" canexit="exitValidation(forms.formSetting.$valid)">\n						<form name="forms.formSetting" novalidate>\n\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n								<span data-ng-show="forms.formSetting.name.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"/>\n							</div>\n							<!-- END DESCRIPTION -->\n\n              <!-- START USERNAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.username.$invalid}">\n								<label class="control-label">{{\'APPLICATION_USERNAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="username" placeholder="{{\'APPLICATION_USERNAME\' | translate}}" class="form-control" data-ng-model="item.username" required/>\n								<span data-ng-show="forms.formSetting.username.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END USERNAME -->\n\n\n              <!-- START REMOTE ADDRESS -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.remoteUri.$invalid}">\n								<label class="control-label">{{\'APPLICATION_REMOTE_ADDRESS\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="url" name="remoteUri" placeholder="{{\'APPLICATION_REMOTE_ADDRESS\' | translate}}" class="form-control" data-ng-model="item.remoteUri" required ng-remote-validate="/api/sugarcrm/accounts/validate/remoteUri"/>\n								<span data-ng-show="forms.formSetting.remoteUri.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n                <span data-ng-show="(forms.formSetting.remoteUri.$touched || forms.formSetting.$submitted) && forms.formSetting.remoteUri.$error.ngRemoteValidate" class="help-block help-block-error">\n				          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_EXIST_DOMAIN\' | translate}}.\n				        </span>\n							</div>\n							<!-- END USERNAME -->\n\n              <!-- START PASSWORD -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.password.$invalid}">\n								<label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="password" name="password" placeholder="{{\'APPLICATION_PASSWORD\' | translate}}" class="form-control" data-ng-model="item.password" required/>\n								<span data-ng-show="forms.formSetting.apiKey.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END PASSWORD -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" data-ng-click="next()"/>\n\n						</form>\n					</wz-step>\n\n					<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n						<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n						<input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n					</wz-step>\n\n				</wizard>\n\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/tools/answer/list/list.create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_CANNED_ANSWER\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.key.$touched || form.$submitted) && form.key.$invalid}">\n      <label class="control-label">{{\'APPLICATION_KEY\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="key" placeholder="{{\'APPLICATION_KEY\' | translate}}" class="form-control" data-ng-model="item.key" required/>\n      <span data-ng-show="(form.key.$touched || form.$submitted) && form.key.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n    <!-- START VALUE -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.value.$touched || form.$submitted) && form.value.$invalid}">\n      <label class="control-label">{{\'APPLICATION_VALUE\' | translate}}<span class="required" aria-required="true">*</span></label></label>\n      <textarea type="text" name="value" placeholder="{{\'APPLICATION_VALUE\' | translate}}" class="form-control" data-ng-model="item.value" required></textarea>\n      <span data-ng-show="(form.value.$touched || form.$submitted) && form.value.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END VALUE -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n    </div>\n    <!-- END DESCRIPTION -->\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="save()" ng-disabled="form.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/tools/answer/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-wrench"></i>\n					<a href="#">{{ \'APPLICATION_TOOLS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-magic-wand"></i>\n					<a href="#">{{ \'APPLICATION_CANNED_ANSWERS\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-magic-wand font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_CANNED_ANSWERS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<a class="btn green-jungle" href="#" data-toggle="dropdown" data-ng-click="createItem()">\n						<i class="icon-plus"></i> {{ \'APPLICATION_NEW_CANNED_ANSWER\' | translate }}\n					</a>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n						<div class="watermark" ng-show="!gridOptions.data.length">{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/tools/answer/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getAnswer()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-wrench"></i>\n					<a href="#">{{ \'APPLICATION_TOOLS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-magic-wand"></i>\n					<a href="/tools/answers/list">{{ \'APPLICATION_CANNED_ANSWER\' | translate }}</a>\n					<i data-ng-show="answer" class="fa fa-angle-right"></i>\n				</li>\n				<li data-ng-show="answer">\n					<a href="#">{{answer.key}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/answer.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{answer.name}}\n					</div>\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.tools.answers.view.settings\')}">\n							<a data-ng-href="/tools/answers/view/{{answer.id}}/settings">\n								<i class="icon-settings"></i>\n								{{ \'APPLICATION_SETTINGS\' | translate}}\n							</a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/tools/answer/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_CANNED_ANSWER\' | translate}} {{ \'APPLICATION_SETTINGS\' | translate}} </span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_GENERAL\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.general" data-ng-submit="forms.general.$valid && updateAnswer()" novalidate>\n\n							<!-- START KEY -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.key.$touched || forms.general.$submitted) && forms.general.key.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="key" placeholder="{{\'APPLICATION_KEY\' | translate}}" class="form-control" data-ng-model="answer.key" required/>\n								<span data-ng-show="(forms.general.key.$touched || forms.general.$submitted) && forms.general.key.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END KEY -->\n\n							<!-- START VALUE -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.value.$touched || forms.general.$submitted) && forms.general.value.$invalid}">\n								<label class="control-label">{{\'APPLICATION_VALUE\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<textarea type="text" name="value" placeholder="{{\'APPLICATION_VALUE\' | translate}}" class="form-control" data-ng-model="answer.value" required></textarea>\n								<span data-ng-show="(forms.general.value.$touched || forms.general.$submitted) && forms.general.value.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END VALUE -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="answer.description"></textarea>\n							</div>\n							<!-- END DESCRIPTION -->\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END ADVANCED TAB -->\n\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/tools/automation/list/list.html",'<div class="row">\n	<div class="col-md-12">\n			<div class="page-bar">\n				<ul class="page-breadcrumb">\n					<li>\n						<i class="icon-rocket"></i>\n						<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-wrench"></i>\n						<a href="#">{{ \'APPLICATION_TOOLS\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-bulb"></i>\n						<a href="#">{{ \'APPLICATION_AUTOMATIONS\' | translate }}</a>\n					</li>\n				</ul>\n			</div>\n		</div>\n</div>\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-bulb font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_AUTOMATIONS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<a class="btn green-jungle " href="/tools/automations/wizard">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_AUTOMATION\' | translate }}\n						</a>\n					</div>\n					<!-- <a class="btn btn-icon-only btn-default fullscreen" href="#"></a> -->\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/tools/automation/view/view.html",'<!-- BEGIN PAGE HEADER-->\n<div class="row" data-ng-init="initView()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-settings"></i>\n					<a href="/tools/automations/list">{{ \'APPLICATION_AUTOMATIONS\' | translate }}</a>\n					<i class="fa fa-angle-right" data-ng-show="automation"></i>\n				</li>\n				<li data-ng-show="automation">\n					<a href="#">{{ automation.description || automation.name }}</a>\n				</li>\n			</ul>\n		</div>\n\n<!-- END PAGE HEADER-->\n\n<!-- BEGIN PAGE CONTENT-->\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/automation.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{ automation.name }}\n					</div>\n					<div class="profile-usertitle-job">\n						{{ automation.description }}\n					</div>\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.tools.automations.view.settings\')}">\n							<a href="/tools/automations/view/{{automation.id}}/settings">\n							<i class="icon-bulb"></i>\n							{{ \'APPLICATION_SETTINGS\' | translate }} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/tools/automation/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_SETTINGS\' | translate}}</span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{\'APPLICATION_GENERALS\' | translate}}</a>\n					</li>\n					<li>\n						<a href="#" data-target="#tab_1_2" data-toggle="tab">{{\'APPLICATION_CONDITIONS\' | translate}} & {{\'APPLICATION_ACTIONS\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n			<div class="portlet-body">\n				<!-- <pre>\n					{{conditionsData.query | json}}\n				</pre>\n				<pre>\n					{{actionsData.query | json}}\n				</pre> -->\n				<form name="forms.general" data-ng-submit="exitValidation(forms.general.$valid) && updateAutomation()" novalidate>\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="automation.name" required/>\n								<span data-ng-show="(forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid && forms.general.name.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<!-- START TIMEOUT -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.general.timeout.$touched && forms.general.timeout.$invalid}">\n								<label class="control-label">{{\'APPLICATION_TIMEOUT\' | translate}}</label>\n								<input type="number" name="timeout" min="1" placeholder="{{\'APPLICATION_TIMEOUT\' | translate}}" class="form-control" data-ng-model="automation.timeout" data-ng-init="item.timeout = 10" required/>\n								<span data-ng-show="forms.general.timeout.$touched && forms.general.name.$invalid && forms.general.name.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END TIMEOUT -->\n\n							<!-- START STATUS -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_STATUS\' | translate}}</label></br>\n							<input\n								    bs-switch\n										class="form-control"\n								    ng-model="automation.status"\n								    type="checkbox"\n										name="status"\n								    switch-active="{{ recordSwitch.isActive }}"\n								    switch-on-text="{{ recordSwitch.onText }}"\n								    switch-off-text="{{ recordSwitch.offText }}"\n								    switch-on-color="{{ recordSwitch.onColor }}"\n								    switch-off-color="{{ recordSwitch.offColor }}"\n								    switch-animate="{{ recordSwitch.animate }}"\n								    switch-size="{{ recordSwitch.size }}"\n								    switch-label="{{ recordSwitch.label }}"\n								    switch-icon="{{ recordSwitch.icon }}"\n								    switch-radio-off="{{ recordSwitch.radioOff }}"\n								    switch-label-width="{{ recordSwitch.labelWidth }}"\n								    switch-handle-width="{{ recordSwitch.handleWidth }}">\n							</div>\n							<!-- END STATUS -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="automation.description"/>\n							</div>\n							<!-- END DESCRIPTION -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n					</div>\n					<!-- END GENERAL TAB -->\n					<div class="tab-pane" id="tab_1_2">\n						<div class="portlet light bordered">\n							<div class="portlet-title">\n								<div class="caption font-blue-hoki">\n									<i class="icon-tag font-blue-hoki"></i>\n									<span class="caption-subject" ng-bind-html="\'APPLICATION_MEET_ALL_CONDITIONS\' | translate"></span>:\n								</div>\n							</div>\n							<div class="portlet-body">\n								<div class="padding-bottom row" ng-repeat="all in automation.All">\n									<condition-builder element="all" serviceindex="automation.channel" service="$automations" form="forms.general"></condition-builder>\n									<button type="button" ng-click="removeCondition(\'All\',$index)" class="btn btn-danger remove-condition col-md-1 left-margin"><span class="glyphicon glyphicon-minus-sign"></span></button>\n								</div>\n								<button type="button" class="btn btn-sm green padding-bottom" data-ng-click="addCondition(\'All\')">\n									<i class="fa fa-plus"></i> {{\'APPLICATION_ADD_CONDITION\' | translate}}\n								</button>\n							</div>\n						</div>\n						<div class="portlet light bordered">\n							<div class="portlet-title">\n								<div class="caption font-blue-hoki">\n									<i class="icon-tag font-blue-hoki"></i>\n									<span class="caption-subject" ng-bind-html="\'APPLICATION_MEET_ANY_CONDITIONS\' | translate"></span>:\n								</div>\n							</div>\n							<div class="portlet-body">\n								<div class="padding-bottom row" ng-repeat="any in automation.Any">\n									<condition-builder element="any" serviceindex="automation.channel" service="$automations" form="forms.general"></condition-builder>\n									<button type="button" ng-click="removeCondition(\'Any\',$index)" class="btn btn-danger remove-condition col-md-1 left-margin"><span class="glyphicon glyphicon-minus-sign"></span></button>\n								</div>\n								<button type="button" class="btn btn-sm green padding-bottom" data-ng-click="addCondition(\'Any\')">\n									<i class="fa fa-plus"></i> {{\'APPLICATION_ADD_CONDITION\' | translate}}\n								</button>\n							</div>\n						</div>\n						<div class="portlet light bordered">\n							<div class="portlet-title">\n								<div class="caption font-blue-hoki">\n									<i class="icon-tag font-blue-hoki"></i>\n									<span class="caption-subject">{{ \'APPLICATION_ACTIONS\' | translate }}</span>:\n								</div>\n							</div>\n							<div class="portlet-body">\n								<div class="padding-bottom row" ng-repeat="action in automation.Actions">\n									<div class="form-group col-md-2" data-ng-class="{\'has-error\': (forms.general[\'action\'+$index].$touched || forms.general.$submitted) && forms.general[\'action\'+$index].$invalid}">\n										<ui-select data-ng-model="action.action" theme="bootstrap" data-ng-change="resetActionData(action)" name="action{{$index}}" required>\n											<ui-select-match placeholder="{{ \'APPLICATION_ACTION\' | translate }}">{{$select.selected.name | translate}}</ui-select-match>\n											<ui-select-choices repeat="tAction.value as tAction in $automations.services[automation.channel].actions | filter: $select.search">\n												<div ng-bind-html="tAction.name | translate | highlight: $select.search"></div>\n											</ui-select-choices>\n										</ui-select>\n										<span data-ng-show="(forms.general[\'action\'+$index].$touched || forms.general.$submitted) && forms.general[\'action\'+$index].$error.required" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<div ng-switch="action.action">\n										<action-builder-template ng-switch-when="template" element="action" form="forms.general"></action-builder-template>\n										<action-builder-integration ng-switch-when="integration" element="action" form="forms.general"></action-builder-integration>\n										<action-builder-status ng-switch-when="status" element="action" form="forms.general"></action-builder-status>\n									</div>\n									<button type="button" ng-click="removeAction($index)" class="btn btn-danger remove-condition col-md-1 left-margin"><span class="glyphicon glyphicon-minus-sign"></span></button>\n								</div>\n								<button type="button" class="btn btn-sm green padding-bottom" data-ng-click="addAction()">\n									<i class="fa fa-plus"></i> {{\'APPLICATION_ADD_ACTION\' | translate}}\n								</button>\n							</div>\n						</div>\n						<div class="has-error" data-ng-show="forms.general.$submitted && !automation.All.length && !automation.Any.length">\n							<span class="help-block help-block-error form-control">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_INSERT_AT_LEAST_ONE_CONDITION\' | translate}}.\n							</span>\n						</div>\n						<div class="has-error" data-ng-show="forms.general.$submitted && !automation.Actions.length">\n							<span class="help-block help-block-error form-control">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_INSERT_AT_LEAST_ONE_ACTION\' | translate}}.\n							</span>\n						</div>\n						<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n					</div>\n				</div>\n				</form>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/tools/automation/wizard/wizard.html",'<div class="row">\n	<div class="col-md-12">\n		<!-- BEGIN PAGE HEADER-->\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-settings"></i>\n					<a href="/tools/automations/list">{{ \'APPLICATION_AUTOMATIONS\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n		<!-- END PAGE HEADER-->\n\n		<!-- BEGIN  PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-bulb font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_AUTOMATIONS\' | translate }} WIZARD</a> </span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<wizard on-finish="createItem()">\n					<wz-step title="{{\'APPLICATION_GENERAL\' | translate}}" canexit="exitValidation(forms.general.$valid)">\n						<form name="forms.general" data-ng-submit="submit()" novalidate>\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.general.name.$touched && forms.general.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n								<span data-ng-show="forms.general.name.$touched && forms.general.name.$invalid && forms.general.name.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<!-- START TIMEOUT -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.general.timeout.$touched && forms.general.timeout.$invalid}">\n								<label class="control-label">{{\'APPLICATION_TIMEOUT\' | translate}}</label>\n								<input type="number" name="timeout" min="1" placeholder="{{\'APPLICATION_TIMEOUT\' | translate}}" class="form-control" data-ng-model="item.timeout" data-ng-init="item.timeout = 10" required/>\n								<span data-ng-show="forms.general.timeout.$touched && forms.general.name.$invalid && forms.general.name.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END TIMEOUT -->\n\n							<!-- START STATUS -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_STATUS\' | translate}}</label></br>\n							<input\n								    bs-switch\n										class="form-control"\n								    ng-model="item.status"\n								    type="checkbox"\n										name="status"\n										data-ng-init="item.status = 0"\n								    switch-active="{{ recordSwitch.isActive }}"\n								    switch-on-text="{{ recordSwitch.onText }}"\n								    switch-off-text="{{ recordSwitch.offText }}"\n								    switch-on-color="{{ recordSwitch.onColor }}"\n								    switch-off-color="{{ recordSwitch.offColor }}"\n								    switch-animate="{{ recordSwitch.animate }}"\n								    switch-size="{{ recordSwitch.size }}"\n								    switch-label="{{ recordSwitch.label }}"\n								    switch-icon="{{ recordSwitch.icon }}"\n								    switch-radio-off="{{ recordSwitch.radioOff }}"\n								    switch-label-width="{{ recordSwitch.labelWidth }}"\n								    switch-handle-width="{{ recordSwitch.handleWidth }}">\n							</div>\n							<!-- END STATUS -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"/>\n							</div>\n							<!-- END DESCRIPTION -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" ng-click="next()"/>\n						</form>\n					</wz-step>\n					<wz-step title="{{\'APPLICATION_SETTINGS\' | translate}}" canexit="exitSettingsValidation(forms.settings.$valid)">\n						<form name="forms.settings" novalidate>\n						<div class="portlet light bordered">\n							<div class="portlet-title">\n								<div class="caption font-blue-hoki">\n									<i class="icon-tag font-blue-hoki"></i>\n									<span class="caption-subject">{{ \'APPLICATION_CHANNEL\' | translate }}</span>\n								</div>\n							</div>\n							<div class="portlet-body">\n								<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.channel.$touched || forms.settings.$submitted) && forms.settings.channel.$invalid}">\n									<label class="control-label">{{ \'APPLICATION_CHANNEL\' | translate }}<span class="required" aria-required="true">*</span></label>\n									<ui-select data-ng-model="item.channel" name="channel" theme="bootstrap" required>\n										<ui-select-match placeholder="{{ \'APPLICATION_CHANNEL\' | translate }}">{{$select.selected | capitalize}}</ui-select-match>\n										<ui-select-choices repeat="channel in $automations.channels | filter: $select.search">\n											<div ng-bind-html="channel | highlight: $select.search | capitalize"></div>\n										</ui-select-choices>\n									</ui-select>\n									<span data-ng-show="(forms.settings.channel.$touched || forms.settings.$submitted) && forms.settings.channel.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n							</div>\n						</div>\n						<div class="portlet light bordered">\n							<div class="portlet-title">\n								<div class="caption font-blue-hoki">\n									<i class="icon-tag font-blue-hoki"></i>\n									<span class="caption-subject" ng-bind-html="\'APPLICATION_MEET_ALL_CONDITIONS\' | translate"></span>:\n								</div>\n							</div>\n							<div class="portlet-body">\n								<div class="padding-bottom row" ng-repeat="all in item.All">\n									<condition-builder element="all" serviceindex="item.channel" service="$automations" form="forms.settings"></condition-builder>\n									<button type="button" ng-click="removeCondition(\'All\',$index)" class="btn btn-danger remove-condition col-md-1 left-margin"><span class="glyphicon glyphicon-minus-sign"></span></button>\n								</div>\n								<button type="button" class="btn btn-sm green padding-bottom" data-ng-click="addCondition(\'All\')">\n									<i class="fa fa-plus"></i> {{\'APPLICATION_ADD_CONDITION\' | translate}}\n								</button>\n							</div>\n						</div>\n						<div class="portlet light bordered">\n							<div class="portlet-title">\n								<div class="caption font-blue-hoki">\n									<i class="icon-tag font-blue-hoki"></i>\n									<span class="caption-subject" ng-bind-html="\'APPLICATION_MEET_ANY_CONDITIONS\' | translate"></span>:\n								</div>\n							</div>\n							<div class="portlet-body">\n								<div class="padding-bottom row" ng-repeat="any in item.Any">\n									<condition-builder element="any" serviceindex="item.channel" service="$automations" form="forms.settings"></condition-builder>\n									<button type="button" ng-click="removeCondition(\'Any\',$index)" class="btn btn-danger remove-condition col-md-1 left-margin"><span class="glyphicon glyphicon-minus-sign"></span></button>\n								</div>\n								<button type="button" class="btn btn-sm green padding-bottom" data-ng-click="addCondition(\'Any\')">\n									<i class="fa fa-plus"></i> {{\'APPLICATION_ADD_CONDITION\' | translate}}\n								</button>\n							</div>\n						</div>\n						<div class="portlet light bordered">\n							<div class="portlet-title">\n								<div class="caption font-blue-hoki">\n									<i class="icon-tag font-blue-hoki"></i>\n									<span class="caption-subject">{{ \'APPLICATION_ACTIONS\' | translate }}</span>:\n								</div>\n							</div>\n							<div class="portlet-body">\n								<div class="padding-bottom row" ng-repeat="action in item.Actions">\n									<div class="form-group col-md-2" data-ng-class="{\'has-error\': (forms.settings[\'action\'+$index].$touched || forms.settings.$submitted) && forms.settings[\'action\'+$index].$invalid}">\n										<ui-select data-ng-model="action.action" theme="bootstrap" data-ng-change="resetActionData(action)" name="action{{$index}}" required>\n											<ui-select-match placeholder="{{ \'APPLICATION_ACTION\' | translate }}">{{$select.selected.name | translate}}</ui-select-match>\n											<ui-select-choices repeat="tAction.value as tAction in $automations.services[item.channel].actions | filter: $select.search">\n												<div ng-bind-html="tAction.name | translate | highlight: $select.search"></div>\n											</ui-select-choices>\n										</ui-select>\n										<span data-ng-show="(forms.settings[\'action\'+$index].$touched || forms.settings.$submitted) && forms.settings[\'action\'+$index].$error.required" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<div ng-switch="action.action">\n										<action-builder-template ng-switch-when="template" element="action" form="forms.settings"></action-builder-template>\n										<action-builder-integration ng-switch-when="integration" element="action" form="forms.settings"></action-builder-integration>\n										<action-builder-status ng-switch-when="status" element="action" form="forms.settings"></action-builder-status>\n									</div>\n									<button type="button" ng-click="removeAction($index)" class="btn btn-danger remove-condition col-md-1 left-margin"><span class="glyphicon glyphicon-minus-sign"></span></button>\n								</div>\n								<button type="button" class="btn btn-sm green padding-bottom" data-ng-click="addAction()">\n									<i class="fa fa-plus"></i> {{\'APPLICATION_ADD_ACTION\' | translate}}\n								</button>\n							</div>\n						</div>\n						<div class="has-error" data-ng-show="forms.settings.$submitted && !item.All.length && !item.Any.length">\n							<span class="help-block help-block-error form-control">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_INSERT_AT_LEAST_ONE_CONDITION\' | translate}}.\n							</span>\n						</div>\n						<div class="has-error" data-ng-show="forms.settings.$submitted && !item.Actions.length">\n							<span class="help-block help-block-error form-control">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_INSERT_AT_LEAST_ONE_ACTION\' | translate}}.\n							</span>\n						</div>\n						<button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n						<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" ng-click="next()"/>\n					</form>\n					</wz-step>\n					<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n						<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n						<button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n						<input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n					</wz-step>\n				</wizard>\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),
+a.put("app/tools/interval/list/list.create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_INTERVAL\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.name.$touched || form.$submitted) && form.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n      <span data-ng-show="(form.name.$touched || form.$submitted) && form.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n    </div>\n    <!-- END DESCRIPTION -->\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="save()" ng-disabled="form.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/tools/interval/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-wrench"></i>\n					<a href="#">{{ \'APPLICATION_TOOLS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-clock"></i>\n					<a href="#">{{ \'APPLICATION_INTERVALS\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-docs font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_INTERVALS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<button class="btn green-jungle " ng-click="createItem()">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_INTERVAL\' | translate }}\n						</button>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/tools/interval/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getInterval()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-wrench"></i>\n					<a href="#">{{ \'APPLICATION_TOOLS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-clock"></i>\n					<a href="/tools/intervals/list">{{ \'APPLICATION_INTERVALS\' | translate }}</a>\n					<i data-ng-show="interval" class="fa fa-angle-right"></i>\n				</li>\n				<li data-ng-show="interval">\n					<a href="#">{{interval.name}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/interval.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{interval.name}}\n					</div>\n					<!-- <div class="profile-usertitle-job">\n						{{user.role}}\n					</div> -->\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.tools.intervals.view.settings\')}">\n							<a data-ng-click="deselectAndRedirect(\'/tools/intervals/view/\'+interval.id+\'/settings\')">\n							<i class="icon-settings"></i>\n							{{ \'APPLICATION_SETTINGS\' | translate}} </a>\n						</li>\n'+"						<li data-ng-class=\"{active: $state.is('main.tools.intervals.view.subintervals') || $state.is('main.tools.intervals.view.subinterval') || $state.is('main.tools.intervals.view.subintervals.settings')}\">\n							<a data-ng-click=\"deselectAndRedirect('/tools/intervals/view/'+interval.id+'/subintervals')\">\n							<i class=\"icon-list\"></i>\n							{{ 'APPLICATION_SUBINTERVALS' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class=\"profile-content\">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n"),a.put("app/tools/interval/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_INTERVAL\' | translate}} {{ \'APPLICATION_SETTINGS\' | translate}} </span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_GENERAL\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.general" data-ng-submit="forms.general.$valid && updateInterval()" novalidate>\n\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="interval.name" required/>\n								<span data-ng-show="(forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="interval.description"></textarea>\n							</div>\n							<!-- END DESCRIPTION -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END ADVANCED TAB -->\n\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/tools/interval/view/view.subinterval.html",'\n<div class="row" data-ng-init="initSubInterval(true)">\n	<div class="col-md-12">\n		<!-- BEGIN  PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-notebook font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_NEW_SUBINTERVAL\' | translate }} WIZARD</a> </span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<wizard on-finish="addSubInterval()">\n          <wz-step title="{{\'APPLICATION_SETTINGS\' | translate}}" canexit="exitValidation(forms.subinterval.name.$valid)">\n            <form name="forms.subinterval" novalidate>\n\n              <!-- START NAME -->\n              <div class="form-group" data-ng-class="{\'has-error\': (forms.subinterval.name.$touched || forms.subinterval.$submitted) && forms.subinterval.name.$invalid}">\n                <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n                <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="subinterval.name" required/>\n                <span data-ng-show="(forms.subinterval.name.$touched || forms.subinterval.$submitted) && forms.subinterval.name.$error.required" class="help-block help-block-error">\n                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                </span>\n              </div>\n              <!-- END NAME -->\n\n							<!-- START TIME -->\n              <div class="form-group">\n                <label class="control-label">{{ \'APPLICATION_TIME\' | translate }}</label>\n                <div class="input-group input-large">\n									<fieldset class="pull-left" ng-disabled="splittedInterval.alwaysTime"><uib-timepicker name="t_from" data-ng-model="splittedInterval.t_from" show-meridian="false" show-spinners="false"></uib-timepicker></fieldset>\n                  <div class="input-group-addon col-md-1 interval-to pull-left">to</div>\n									<fieldset ng-disabled="splittedInterval.alwaysTime"><uib-timepicker  name="t_to" data-ng-model="splittedInterval.t_to" show-meridian="false" show-spinners="false"></uib-timepicker></fieldset>\n									<label class="control-label pointer-cursor"><input type="checkbox" data-ng-model="splittedInterval.alwaysTime">{{\'APPLICATION_ALWAYS\' | translate}}</label>\n                </div>\n              </div>\n              <!-- END TIME -->\n\n              <!-- START WEEKDAY -->\n              <div class="form-group">\n                <label class="control-label">{{ \'APPLICATION_WEEKDAY\' | translate }}</label>\n                <div class="input-group input-large">\n                  <ui-select data-ng-model="splittedInterval.wd_from" theme="bootstrap" name="wd_from">\n                    <ui-select-match placeholder="">{{$translate.instant($select.selected.name)}}</ui-select-match>\n                    <ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n                      {{$translate.instant(weekDay.name)}}\n                    </ui-select-choices>\n                  </ui-select>\n                  <span class="input-group-addon">to</span>\n                  <ui-select data-ng-model="splittedInterval.wd_to" theme="bootstrap" name="wd_to">\n                    <ui-select-match placeholder="">{{$translate.instant($select.selected.name)}}</ui-select-match>\n                    <ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n                      {{$translate.instant(weekDay.name)}}\n                    </ui-select-choices>\n                  </ui-select>\n                </div>\n              </div>\n              <!-- END WEEKDAY -->\n\n              <!-- START MONTHDAY -->\n              <div class="form-group">\n                <label class="control-label">{{ \'APPLICATION_MONTHDAY\' | translate }}</label>\n                <div class="input-group input-large">\n                  <ui-select data-ng-model="splittedInterval.md_from" theme="bootstrap" name="md_from">\n                    <ui-select-match>{{$select.selected}}</ui-select-match>\n                    <ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n                      {{monthDay}}\n                    </ui-select-choices>\n                  </ui-select>\n                  <span class="input-group-addon">to</span>\n                  <ui-select data-ng-model="splittedInterval.md_to" theme="bootstrap" name="md_to">\n                    <ui-select-match>{{$select.selected}}</ui-select-match>\n                    <ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n                      {{monthDay}}\n                    </ui-select-choices>\n                  </ui-select>\n                </div>\n              </div>\n              <!-- END MONTHDAY -->\n\n              <!-- START MONTH -->\n              <div class="form-group">\n                <label class="control-label">{{ \'APPLICATION_MONTH\' | translate }}</label>\n                <div class="input-group input-large">\n                  <ui-select data-ng-model="splittedInterval.m_from" theme="bootstrap" name="m_from">\n                    <ui-select-match placeholder="">{{$translate.instant($select.selected.name)}}</ui-select-match>\n                    <ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n                      {{$translate.instant(month.name)}}\n                    </ui-select-choices>\n                  </ui-select>\n                  <span class="input-group-addon">to</span>\n                  <ui-select data-ng-model="splittedInterval.m_to" theme="bootstrap" name="m_to">\n                    <ui-select-match placeholder="">{{$translate.instant($select.selected.name)}}</ui-select-match>\n                    <ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n                      {{$translate.instant(month.name)}}\n                    </ui-select-choices>\n                  </ui-select>\n                </div>\n              </div>\n              <!-- END MONTH -->\n\n\n\n							<button class="btn green-haze" type="submit" ng-click="next()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n            </form>\n          </wz-step>\n\n\n						<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n							<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n							<button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n							<input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n						</wz-step>\n				</wizard>\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/tools/interval/view/view.subintervalSettings.html",'\n<div class="row" data-ng-init="initSubInterval();getSubInterval();">\n	<div class="col-md-12">\n		<!-- BEGIN  PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-notebook font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_SUBINTERVAL_SETTINGS\' | translate }} WIZARD</a> </span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<wizard on-finish="updateInterval(\'subintervals\')">\n					<div class="profile-usertitle-name">\n						{{subinterval.name}}\n					</div>\n          <wz-step title="{{\'APPLICATION_SETTINGS\' | translate}}" canexit="exitValidation(forms.subinterval.name.$valid)">\n            <form name="forms.subinterval" novalidate>\n\n              <!-- START NAME -->\n              <div class="form-group" data-ng-class="{\'has-error\': (forms.subinterval.name.$touched || forms.subinterval.$submitted) && forms.subinterval.name.$invalid}">\n                <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n                <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="interval.SubIntervals[selectedSubInterval].name" required/>\n                <span data-ng-show="(forms.subinterval.name.$touched || forms.subinterval.$submitted) && forms.subinterval.name.$error.required" class="help-block help-block-error">\n                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                </span>\n              </div>\n              <!-- END NAME -->\n\n              <!-- START TIME -->\n              <div class="form-group">\n                <label class="control-label">{{ \'APPLICATION_TIME\' | translate }}</label>\n                <div class="input-group input-large">\n									<fieldset class="pull-left" ng-disabled="splittedInterval.alwaysTime"><uib-timepicker name="t_from" data-ng-model="splittedInterval.t_from" show-meridian="false" show-spinners="false"></uib-timepicker></fieldset>\n                  <div class="input-group-addon col-md-1 interval-to pull-left">to</div>\n									<fieldset ng-disabled="splittedInterval.alwaysTime"><uib-timepicker  name="t_to" data-ng-model="splittedInterval.t_to" show-meridian="false" show-spinners="false"></uib-timepicker></fieldset>\n									<label class="control-label pointer-cursor"><input type="checkbox" data-ng-model="splittedInterval.alwaysTime">{{\'APPLICATION_ALWAYS\' | translate}}</label>\n                </div>\n              </div>\n              <!-- END TIME -->\n\n              <!-- START WEEKDAY -->\n              <div class="form-group">\n                <label class="control-label">{{ \'APPLICATION_WEEKDAY\' | translate }}</label>\n                <div class="input-group input-large">\n                  <ui-select data-ng-model="splittedInterval.wd_from" theme="bootstrap" name="wd_from">\n                    <ui-select-match placeholder="">{{$translate.instant($select.selected.name)}}</ui-select-match>\n                    <ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n                      {{$translate.instant(weekDay.name)}}\n                    </ui-select-choices>\n                  </ui-select>\n                  <span class="input-group-addon">to</span>\n                  <ui-select data-ng-model="splittedInterval.wd_to" theme="bootstrap" name="wd_to">\n                    <ui-select-match placeholder="">{{$translate.instant($select.selected.name)}}</ui-select-match>\n                    <ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n                      {{$translate.instant(weekDay.name)}}\n                    </ui-select-choices>\n                  </ui-select>\n                </div>\n              </div>\n              <!-- END WEEKDAY -->\n\n              <!-- START MONTHDAY -->\n              <div class="form-group">\n                <label class="control-label">{{ \'APPLICATION_MONTHDAY\' | translate }}</label>\n                <div class="input-group input-large">\n                  <ui-select data-ng-model="splittedInterval.md_from" theme="bootstrap" name="md_from">\n                    <ui-select-match>{{$select.selected}}</ui-select-match>\n                    <ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n                      {{monthDay}}\n                    </ui-select-choices>\n                  </ui-select>\n                  <span class="input-group-addon">to</span>\n                  <ui-select data-ng-model="splittedInterval.md_to" theme="bootstrap" name="md_to">\n                    <ui-select-match>{{$select.selected}}</ui-select-match>\n                    <ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n                      {{monthDay}}\n                    </ui-select-choices>\n                  </ui-select>\n                </div>\n              </div>\n              <!-- END MONTHDAY -->\n\n              <!-- START MONTH -->\n              <div class="form-group">\n                <label class="control-label">{{ \'APPLICATION_MONTH\' | translate }}</label>\n                <div class="input-group input-large">\n                  <ui-select data-ng-model="splittedInterval.m_from" theme="bootstrap" name="m_from">\n                    <ui-select-match placeholder="">{{$translate.instant($select.selected.name)}}</ui-select-match>\n                    <ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n                      {{$translate.instant(month.name)}}\n                    </ui-select-choices>\n                  </ui-select>\n                  <span class="input-group-addon">to</span>\n                  <ui-select data-ng-model="splittedInterval.m_to" theme="bootstrap" name="m_to">\n                    <ui-select-match placeholder="">{{$translate.instant($select.selected.name)}}</ui-select-match>\n                    <ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n                      {{$translate.instant(month.name)}}\n                    </ui-select-choices>\n                  </ui-select>\n                </div>\n              </div>\n              <!-- END MONTH -->\n\n\n\n							<button class="btn green-haze" type="submit" ng-click="next()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n            </form>\n          </wz-step>\n\n\n						<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n							<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n							<button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n							<input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n						</wz-step>\n				</wizard>\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/tools/interval/view/view.subintervals.html",'<div ui-view class="profile-content">\n<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title  tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_SUBINTERVALS\' | translate}}</span>\n				</div>\n				<div class="actions">\n					<div class="btn-group">\n						<a class="btn green-jungle " href="/tools/intervals/view/{{interval.id}}/subinterval" data-toggle="dropdown">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_SUBINTERVAL\' | translate }}\n						</a>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div data-ng-if="selectedSubInterval === undefined" ui-grid="gridOptions"  ui-grid-resize-columns class="grid" ui-grid-draggable-rows>\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n	</div>\n</div>\n</div>\n'),a.put("app/tools/pause/list/list.create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_PAUSE\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.name.$touched || form.$submitted) && form.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n      <span data-ng-show="(form.name.$touched || form.$submitted) && form.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n    </div>\n    <!-- END DESCRIPTION -->\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="save()" ng-disabled="form.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/tools/pause/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-wrench"></i>\n					<a href="#">{{ \'APPLICATION_TOOLS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-control-pause"></i>\n					<a href="#">{{ \'APPLICATION_PAUSES\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-control-pause font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_PAUSES\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<a class="btn green-jungle" href="#" data-toggle="dropdown" data-ng-click="createItem()">\n						<i class="icon-plus"></i> {{ \'APPLICATION_NEW_PAUSE\' | translate }}\n					</a>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n						<div class="watermark" ng-show="!gridOptions.data.length">{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/tools/pause/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getPause()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-wrench"></i>\n					<a href="#">{{ \'APPLICATION_TOOLS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-pause"></i>\n					<a href="/tools/pauses/list">{{ \'APPLICATION_PAUSES\' | translate }}</a>\n					<i data-ng-show="pause" class="fa fa-angle-right"></i>\n				</li>\n				<li data-ng-show="pause">\n					<a href="#">{{pause.name}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/pause.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{pause.name}}\n					</div>\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.tools.pauses.view.settings\')}">\n							<a data-ng-href="/tools/pauses/view/{{pause.id}}/settings">\n								<i class="icon-settings"></i>\n								{{ \'APPLICATION_SETTINGS\' | translate}}\n							</a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/tools/pause/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_PAUSE\' | translate}} {{ \'APPLICATION_SETTINGS\' | translate}} </span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_GENERAL\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.general" data-ng-submit="forms.general.$valid && updatePause()" novalidate>\n\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="pause.name" required/>\n								<span data-ng-show="(forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="pause.description"></textarea>\n							</div>\n							<!-- END DESCRIPTION -->\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END ADVANCED TAB -->\n\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/tools/sound/list/list.html",'<div class="page-bar">\n  <ul class="page-breadcrumb">\n    <li>\n      <i class="icon-rocket"></i>\n      <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n      <i class="fa fa-angle-right"></i>\n    </li>\n    <li>\n      <i class="icon-music-tone-alt"></i>\n      <a href="#">{{ \'APPLICATION_SOUNDS\' | translate }}</a>\n    </li>\n  </ul>\n  <div class="page-toolbar">\n  </div>\n</div>\n<!-- END PAGE HEADER-->\n<!-- BEGIN PAGE CONTENT-->\n<!-- Audio Portlets -->\n<div class="headline">\n  <h3><i class="icon-music-tone-alt sounds-title-icon"></i> {{ \'APPLICATION_SOUNDS\' | translate }}</h3>\n</div>\n<div class="portlet light bg-inverse">\n  <div class="portlet-title collapsible" ng-click="isCollapsed = !isCollapsed">\n    <div class="caption">\n      <i class="icon-puzzle font-red-flamingo"></i>\n      <span class="caption-subject bold font-red-flamingo uppercase">\n      {{\'APPLICATION_FILE_UPLOAD\' | translate}} </span>\n    </div>\n    <div class="tools">\n      <a href="" ng-class="{\'collapse\': !isCollapsed, \'expand\' : isCollapsed}">\n      </a>\n    </div>\n  </div>\n  <div class="portlet-body" ng-slide-down="!isCollapsed">\n    <div class="row" nv-file-drop="" uploader="uploader" filters="queueLimit, customFilter">\n    	<div class="col-md-4">\n    		<div class="portlet light bordered">\n    			<div class="portlet-title">\n    				<div class="caption font-green-sharp">\n    					<i class="icon-settings font-green-sharp"></i>\n    					<span class="caption-subject bold uppercase">{{\'APPLICATION_SELECT_FILES\' | translate}}</span>\n    					<span class="caption-helper hide"></span>\n    				</div>\n    				<div class="actions">\n    				</div>\n    			</div>\n    			<div class="portlet-body">\n    				<div ng-show="uploader.isHTML5">\n    					<div class="file-drop-zone margin-bottom-20" nv-file-over="" uploader="uploader" over-class="file-drop-zone-over">\n    						Base drop zone\n    					</div>\n    				</div>\n    				<span class="btn default btn-file">\n    				<span class="fileinput-new">\n    				{{\'APPLICATION_FILE_UPLOAD\' | translate}}</span>\n    				<input type="file" nv-file-select="" uploader="uploader" />\n    				</span>\n    				<span class="btn default btn-file">\n    				<span class="fileinput-new">\n    				{{\'APPLICATION_MULTI_FILE_UPLOAD\' | translate}}</span>\n    				<input type="file" nv-file-select="" uploader="uploader" multiple  /><br/>\n          </span>\n          <p>\n            </br>\n            {{ \'MESSAGE_SUPPORTED_FORMATS\' | translate }} <b>wav, mp3, gsm, ogg</b>.\n          </p>\n          <p>\n            {{ \'MESSAGE_MAXIMUM_SOUND_UPLOAD_SIZE\' | translate }} <b>15 Mb</b>.\n          </p>\n    			</div>\n    		</div>\n    	</div>\n    	<div class="col-md-8">\n    		<div class="portlet light bordered">\n    			<div class="portlet-title">\n    				<div class="caption font-green-sharp">\n    					<i class="icon-settings font-green-sharp"></i>\n    					<span class="caption-subject bold uppercase">{{\'APPLICATION_UPLOAD_QUEUE\' | translate}}</span>\n    					<span class="caption-helper">{{\'APPLICATION_QUEUE_LENGTH\' | translate}}: {{ uploader.queue.length }}</span>\n    				</div>\n    				<div class="actions">\n    				</div>\n    			</div>\n    			<div class="portlet-body">\n    				<div class="table-scrollable table-scrollable-borderless">\n    					<table class="table table-hover table-light">\n    						<thead>\n    							<tr class="uppercase">\n    								<th width="50%">{{\'APPLICATION_NAME\' | translate}}</th>\n    								<th ng-show="uploader.isHTML5">{{\'APPLICATION_SIZE\' | translate}}</th>\n    								<th ng-show="uploader.isHTML5">{{\'APPLICATION_PROGRESS\' | translate}}</th>\n    								<th>{{\'APPLICATION_STATUS\' | translate}}</th>\n    								<th>{{\'APPLICATION_MESSAGE\' | translate}}</th>\n    								<th>{{\'APPLICATION_ACTIONS\' | translate}}</th>\n    							</tr>\n    						</thead>\n    						<tbody>\n    							<tr ng-repeat="item in uploader.queue">\n    								<td><strong>{{ item.file.name }}</strong></td>\n    								<td ng-show="uploader.isHTML5" nowrap>{{ item.file.size/1024/1024|number:2 }} MB</td>\n    								<td ng-show="uploader.isHTML5">\n    									<div class="progress progress-sm" style="margin-bottom: 0;">\n    										<div class="progress-bar progress-bar-info" role="progressbar" ng-style="{ \'width\': item.progress + \'%\' }"></div>\n    									</div>\n    								</td>\n    								<td class="text-center">\n    									<span ng-show="item.isSuccess" class="text-success"><i class="glyphicon glyphicon-ok"></i></span>\n    									<span ng-show="item.isCancel" class="text-info"><i class="glyphicon glyphicon-ban-circle"></i></span>\n    									<span ng-show="item.isError" class="text-danger"><i class="glyphicon glyphicon-remove"></i></span>\n    									<span ng-show="item.isUploading" class="text-info"><i class="glyphicon glyphicon-upload"></i></span>\n    								</td>\n    								<td class="text-center">\n    									<span ng-show="item.responseMessage" class="text-danger">{{item.responseMessage}}</span>\n    								</td>\n    								<td nowrap>\n    									<button type="button" class="btn btn-success btn-xs" ng-click="item.upload()" ng-disabled="item.isReady || item.isUploading || item.isSuccess">\n    									<span class="glyphicon glyphicon-upload"></span> {{\'APPLICATION_UPLOAD\' | translate}}\n    									</button>\n    									<button type="button" class="btn btn-warning btn-xs" ng-click="item.cancel()" ng-disabled="!item.isUploading">\n    									<span class="glyphicon glyphicon-ban-circle"></span> {{\'APPLICATION_CANCEL\' | translate}}\n    									</button>\n    									<button type="button" class="btn btn-danger btn-xs" ng-click="item.remove()">\n    									<span class="glyphicon glyphicon-trash"></span> {{\'APPLICATION_REMOVE\' | translate}}\n    									</button>\n    								</td>\n    							</tr>\n    						</tbody>\n    					</table>\n    				</div>\n    				<div>\n    					<p>{{\'APPLICATION_UPLOAD_QUEUE_PROGRESS\' | translate}}:</p>\n    					<div class="progress progress-sm" style="">\n    						<div class="progress-bar progress-bar-info" role="progressbar" ng-style="{ \'width\': uploader.progress + \'%\' }"></div>\n    					</div>\n    				</div>\n    				<button type="button" class="btn btn-success btn-s" ng-click="uploader.uploadAll()" ng-disabled="!uploader.getNotUploadedItems().length">\n    				<span class="glyphicon glyphicon-upload"></span> {{\'APPLICATION_UPLOAD_ALL\' | translate}}\n    				</button>\n    				<button type="button" class="btn btn-warning btn-s" ng-click="uploader.cancelAll()" ng-disabled="!uploader.isUploading">\n    				<span class="glyphicon glyphicon-ban-circle"></span> {{\'APPLICATION_CANCEL_ALL\' | translate}}\n    				</button>\n    				<button type="button" class="btn btn-danger btn-s" ng-click="uploader.clearQueue()" ng-disabled="!uploader.queue.length">\n    				<span class="glyphicon glyphicon-trash"></span> {{\'APPLICATION_REMOVE_ALL\' | translate}}\n    				</button>\n    			</div>\n    		</div>\n    	</div>\n    </div>\n  </div>\n</div>\n<div class="row thumbnails" data-ng-init="initList()">\n  <div class="row" ng-show="sounds.length == 0">\n    <div class="col-md-12 page-404">\n      <div class="details">\n        <h3>{{ \'MESSAGE_NO_SOUNDS\' | translate }}</h3>\n        <p>\n          <a href="/">\n          {{ \'MESSAGE_RETURN_HOME\' | translate }} </a>\n          {{ \'MESSAGE_OR_UPLOAD_SOUND_FILE\' | translate }}\n        </p>\n      </div>\n    </div>\n  </div>\n  <div class="audio-portlet-wrapper animate-repeat" ng-repeat="sound in sounds">\n    <div class="audio-portlet">\n      <div class="audio-portlet-title"><a href="#" editable-text="sound.display_name" onbeforesave="updateAudio(sound.id,{display_name : $data})">{{ sound.display_name || "Empty" }}</a></div>\n      <img src="../assets/images/note_placeholder.png" alt="" class="img-responsive"/>\n      <div class="file-info">\n        <div class="audio-tag-wrapper">\n          <audio-file-download params="{id:sound.id,controller:\'stream\'}" resource="Sound"></audio-file-download>\n        </div>\n        <p id="description_div">\n          <a href="#" editable-text="sound.description" onbeforesave="updateAudio(sound.id,{description : $data})">{{ sound.description || "Empty" }}</a>\n        </p>\n        <p class="float-right">\n            <button class="btn btn-xs green-meadow" uib-tooltip-template="\'audioInfoTemplate.html\'"><i class="icon-list"></i></button>\n            <motion-file-download  params="{id:sound.id,controller:\'download\'}" resource="Sound" mimetype="\'audio/\'+sound.original_format" tooltiptext="Download" filename="sound.name+\'.\'+sound.original_format" btnclass="{{downloadButtonClass}}" btncontent=\'{{downloadButtonContent}}\'></motion-file-download>\n            <button uib-tooltip="Delete" class="btn btn-xs red-sunglo" ng-click="delete(sound.display_name, sound.id)" tooltip="Delete"><i class="icon-close" ></i></button>\n        </p>\n      </div>\n    </div>\n  </div>\n  <script type="text/ng-template" id="audioInfoTemplate.html">\n    <div>\n      <ul class="list-unstyled">\n        <li><b>Format : </b>{{sound.original_format}}</li>\n        <li><b>Duration : </b>{{sound.original_duration | date: \'mm:ss\'}}</li>\n        <li><b>Channels : </b>{{sound.original_channelCount}}</li>\n        <li><b>Bitrate : </b>{{sound.original_bitRate/1024}} kbs</li>\n        <li><b>Sample Rate : </b>{{sound.original_sampleRate/1000}} KHz</li>\n      </ul>\n    </div>\n  </script>\n</div>\n<!-- End Audio Portlets -->\n'),
+a.put("app/tools/tag/list/list.create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_TAG\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.name.$touched || form.$submitted) && form.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n      <span data-ng-show="(form.name.$touched || form.$submitted) && form.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n    </div>\n    <!-- END DESCRIPTION -->\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="save()" ng-disabled="form.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/tools/tag/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-wrench"></i>\n					<a href="#">{{ \'APPLICATION_TOOLS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-tag"></i>\n					<a href="#">{{ \'APPLICATION_TAGS\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-docs font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_TAGS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<button class="btn green-jungle " ng-click="createItem()">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_TAG\' | translate }}\n						</button>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/tools/tag/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getTag()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-wrench"></i>\n					<a href="#">{{ \'APPLICATION_TOOLS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-tag"></i>\n					<a href="/tools/tags/list">{{ \'APPLICATION_TAGS\' | translate }}</a>\n					<i data-ng-show="tag" class="fa fa-angle-right"></i>\n				</li>\n				<li data-ng-show="tag">\n					<a href="#">{{tag.name}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/tag.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{tag.name}}\n					</div>\n					<!-- <div class="profile-usertitle-job">\n						{{user.role}}\n					</div> -->\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.tools.tags.view.settings\')}">\n							<a data-ng-href="/tools/tags/view/{{tag.id}}/settings">\n							<i class="icon-settings"></i>\n							{{ \'APPLICATION_SETTINGS\' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/tools/tag/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_TAG\' | translate}} {{ \'APPLICATION_SETTINGS\' | translate}} </span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_GENERAL\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.general" data-ng-submit="forms.general.$valid && updateTag()" novalidate>\n\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="tag.name" required/>\n								<span data-ng-show="(forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="tag.description"></textarea>\n							</div>\n							<!-- END DESCRIPTION -->\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END ADVANCED TAB -->\n\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/tools/template/list/list.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-wrench"></i>\n					<a href="#">{{ \'APPLICATION_TOOLS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-docs"></i>\n					<a href="#">{{ \'APPLICATION_TEMPLATES\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n	</div>\n</div>\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-wrench font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_TEMPLATES\' | translate }}</span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<a class="btn green-jungle" href="/tools/templates/wizard">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_TEMPLATE\' | translate }}\n						</a>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/tools/template/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initItem()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-docs"></i>\n					<a href="/mail/templates/list">{{ \'APPLICATION_TEMPLATES\' | translate }}</a>\n					<i data-ng-show="item" class="fa fa-angle-right"></i>\n				</li>\n				<li data-ng-show="item">\n					<a href="#">{{item.name}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/template.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{item.name}}\n					</div>\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.tools.templates.view.settings\')}">\n							<a data-ng-href="/tools/templates/view/{{item.id}}/settings">\n								<i class="icon-settings"></i>\n								{{ \'APPLICATION_SETTINGS\' | translate}}\n							</a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/tools/template/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_SETTINGS\' | translate}}</span>\n				</div>\n			</div>\n			<div class="portlet-body">\n\n				<form name="form" data-ng-submit="form.$valid && updateItem()" class="form-horizontal" novalidate>\n					<!-- START NAME -->\n					<div class="form-group" data-ng-class="{\'has-error\': form.name.$invalid && form.$submitted}">\n						<div class="col-md-12">\n							<div class="row">\n								<div class="col-md-1">\n									<label class="control-label">{{\'APPLICATION_NAME\' | translate}}:<span class="required" aria-required="true">*</span></label>\n								</div>\n								<div class="col-md-11">\n									<input type="text" name="name" class="form-control todo-taskbody-taskdesc" placeholder="{{\'APPLICATION_NAME\' | translate}}..." data-ng-model="item.name" required>\n									<span data-ng-show="form.name.$invalid && form.$submitted" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n							</div>\n						</div>\n					</div>\n					<!-- END NAME -->\n\n					<!-- START DESCRIPTION -->\n					<div class="form-group" data-ng-class="{\'has-error\': form.description.$invalid && form.$submitted}">\n						<div class="col-md-12">\n							<div class="row">\n								<div class="col-md-1">\n									<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}:</label>\n								</div>\n								<div class="col-md-11">\n									<input type="text" name="description" class="form-control todo-taskbody-taskdesc" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}..." rows="8" data-ng-model="item.description">\n									<span data-ng-show="form.description.$invalid && form.$submitted" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n							</div>\n						</div>\n					</div>\n					<!-- END NAME -->\n\n					<hr>\n\n					<!-- START SUBJECT -->\n					<div class="form-group row" data-ng-class="{\'has-error\': form.subject.$invalid && form.$submitted}">\n						<div class="col-md-12">\n							<div class="row">\n								<div class="col-md-4">\n									<label class="control-label pull-right">{{\'APPLICATION_SUBJECT\' | translate}}:</label>\n								</div>\n								<div class="col-md-8">\n									<input type="text" name="subject" class="form-control todo-taskbody-taskdesc" placeholder="{{\'APPLICATION_SUBJECT\' | translate}}..." rows="8" data-ng-model="item.subject">\n									<span data-ng-show="form.subject.$invalid && form.$submitted" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n							</div>\n						</div>\n					</div>\n					<!-- END SUJBECT -->\n\n					<!-- START HTML -->\n					<div class="form-group row" data-ng-class="{\'has-error\': form.text.$invalid && form.$submitted}">\n\n						<div class="col-md-4">\n							<div class="portlet light bordered">\n								<div class="portlet-title">\n									<div class="caption font-green-sharp">\n										<i class="icon-pencil"></i>{{\'APPLICATION_VARIABLES\' | translate}}\n									</div>\n								</div>\n								<div class="portlet-body">\n									<uib-accordion>\n								    <uib-accordion-group heading="{{group.title | translate}}" data-ng-repeat="group in groups">\n								      {{group.content | translate}}\n											<ol>\n												<li data-ng-repeat="variable in group.variables">\n													 {{variable}}\n												</li>\n											</ol>\n								    </uib-accordion-group>\n								  </uib-accordion>\n								</div>\n							</div>\n						</div>\n						<div class="col-md-8">\n							<div class="inbox-editor inbox-wysihtml5" text-angular data-ng-model="item.html" name="html"></div>\n								<span data-ng-show="form.text.$invalid && form.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n						</div>\n					</div>\n					<!-- END HTML -->\n\n					<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n				</form>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/tools/template/wizard/wizard.html",'<div class="col-md-12">\n  <!-- BEGIN PAGE HEADER-->\n	<div class="page-bar">\n		<ul class="page-breadcrumb">\n			<li>\n				<i class="icon-rocket"></i>\n				<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n				<i class="fa fa-angle-right"></i>\n			</li>\n			<li>\n				<i class="icon-wrench"></i>\n				<a href="#">{{ \'APPLICATION_TOOLS\' | translate }}</a>\n				<i class="fa fa-angle-right"></i>\n			</li>\n			<li>\n				<i class="icon-docs"></i>\n				<a href="/tools/templates/list">{{ \'APPLICATION_TEMPLATES\' | translate }}</a>\n			</li>\n		</ul>\n	</div>\n  <!-- END PAGE HEADER-->\n\n  <!-- BEGIN PORTLET-->\n  <div class="portlet light bordered" data-ng-init="initWizard()">\n  	<div class="portlet-title">\n  		<div class="caption font-green-sharp">\n  			<i class="icon-docs font-green-sharp"></i>\n  			<span class="caption-subject">{{ \'APPLICATION_TEMPLATES\' | translate }} FORM</a> </span>\n  		</div>\n  	</div>\n  	<div class="portlet-body">\n			<form name="form" data-ng-submit="form.$valid && createItem()" class="form-horizontal" novalidate>\n				<!-- START HEAD -->\n				<div class="form">\n					<!-- START NAME -->\n					<div class="form-group" data-ng-class="{\'has-error\': form.name.$invalid && form.$submitted}">\n						<div class="col-md-12">\n							<div class="row">\n								<div class="col-md-1">\n									<label class="control-label">{{\'APPLICATION_NAME\' | translate}}:<span class="required" aria-required="true">*</span></label>\n								</div>\n								<div class="col-md-11">\n									<input type="text" name="name" class="form-control todo-taskbody-taskdesc" placeholder="{{\'APPLICATION_NAME\' | translate}}..." data-ng-model="item.name" required>\n									<span data-ng-show="form.name.$invalid && form.$submitted" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n							</div>\n						</div>\n					</div>\n					<!-- END NAME -->\n\n					<!-- START DESCRIPTION -->\n					<div class="form-group" data-ng-class="{\'has-error\': form.description.$invalid && form.$submitted}">\n						<div class="col-md-12">\n							<div class="row">\n								<div class="col-md-1">\n									<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}:</label>\n								</div>\n								<div class="col-md-11">\n									<input type="text" name="description" class="form-control todo-taskbody-taskdesc" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}..." rows="8" data-ng-model="item.description">\n									<span data-ng-show="form.description.$invalid && form.$submitted" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n							</div>\n						</div>\n					</div>\n					<!-- END NAME -->\n\n					<!-- START SUBJECT -->\n					<div class="form-group" data-ng-class="{\'has-error\': form.subject.$invalid && form.$submitted}">\n						<div class="col-md-12">\n							<div class="row">\n								<div class="col-md-1">\n									<label class="control-label">{{\'APPLICATION_SUBJECT\' | translate}}:</label>\n								</div>\n								<div class="col-md-11">\n									<input type="text" name="subject" class="form-control todo-taskbody-taskdesc" placeholder="{{\'APPLICATION_SUBJECT\' | translate}}..." rows="8" data-ng-model="item.subject">\n									<span data-ng-show="form.subject.$invalid && form.$submitted" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n							</div>\n						</div>\n					</div>\n					<!-- END SUJBECT -->\n\n					<!-- START HTML -->\n					<div class="form-group row" data-ng-class="{\'has-error\': form.text.$invalid && form.$submitted}">\n						<div class="col-md-4">\n							<div class="portlet light bordered">\n								<div class="portlet-title">\n									<div class="caption font-green-sharp">\n										<i class="icon-pencil"></i>{{\'APPLICATION_VARIABLES\' | translate}}\n									</div>\n								</div>\n								<div class="portlet-body">\n									<uib-accordion>\n								    <uib-accordion-group heading="{{group.title | translate}}" data-ng-repeat="group in groups">\n								      {{group.content | translate}}\n											<ol>\n												<li data-ng-repeat="variable in group.variables">\n													 {{variable}}\n												</li>\n											</ol>\n								    </uib-accordion-group>\n								  </uib-accordion>\n								</div>\n							</div>\n						</div>\n						<div class="col-md-8">\n							<div class="inbox-editor inbox-wysihtml5" text-angular data-ng-model="item.html" name="html"></div>\n								<span data-ng-show="form.text.$invalid && form.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n						</div>\n					</div>\n					<!-- END HTML -->\n\n				</div>\n				<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" data-ng-click="goNext()"/>\n			</form>\n  	</div>\n  </div>\n  <!-- END PORTLET-->\n</div>\n'),a.put("app/tools/trigger/list/list.html",'<div class="row">\n	<div class="col-md-12">\n			<div class="page-bar">\n				<ul class="page-breadcrumb">\n					<li>\n						<i class="icon-rocket"></i>\n						<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-wrench"></i>\n						<a href="#">{{ \'APPLICATION_TOOLS\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-bulb"></i>\n						<a href="#">{{ \'APPLICATION_TRIGGERS\' | translate }}</a>\n					</li>\n				</ul>\n			</div>\n		</div>\n</div>\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-bulb font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_TRIGGERS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<a class="btn green-jungle " href="/tools/triggers/wizard">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_TRIGGER\' | translate }}\n						</a>\n					</div>\n					<!-- <a class="btn btn-icon-only btn-default fullscreen" href="#"></a> -->\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/tools/trigger/view/view.html",'<!-- BEGIN PAGE HEADER-->\n<div class="row" data-ng-init="initView();">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-bulb"></i>\n					<a href="/tools/triggers/list">{{ \'APPLICATION_TRIGGERS\' | translate }}</a>\n					<i class="fa fa-angle-right" data-ng-show="trigger"></i>\n				</li>\n				<li data-ng-show="trigger">\n					<a href="#">{{ trigger.description || trigger.name }}</a>\n				</li>\n			</ul>\n		</div>\n\n<!-- END PAGE HEADER-->\n\n<!-- BEGIN PAGE CONTENT-->\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/trigger.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{ trigger.name }}\n					</div>\n					<div class="profile-usertitle-job">\n						{{ trigger.description }}\n					</div>\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.tools.triggers.view.settings\')}">\n							<a href="/tools/triggers/view/{{trigger.id}}/settings">\n							<i class="icon-bulb"></i>\n							{{ \'APPLICATION_SETTINGS\' | translate }} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/tools/trigger/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_SETTINGS\' | translate}}</span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{\'APPLICATION_GENERALS\' | translate}}</a>\n					</li>\n					<li>\n						<a href="#" data-target="#tab_1_2" data-toggle="tab">{{\'APPLICATION_CONDITIONS\' | translate}} & {{\'APPLICATION_ACTIONS\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n			<div class="portlet-body">\n				<!-- <pre>\n					{{conditionsData.query | json}}\n				</pre>\n				<pre>\n					{{actionsData.query | json}}\n				</pre> -->\n				<form name="forms.general" data-ng-submit="exitValidation(forms.general.$valid) && updateTrigger()" novalidate>\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="trigger.name" required/>\n								<span data-ng-show="(forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid && forms.general.name.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<!-- START STATUS -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_STATUS\' | translate}}</label></br>\n								<input\n								bs-switch\n								class="form-control"\n								ng-model="trigger.status"\n								type="checkbox"\n								name="status"\n								switch-active="{{ recordSwitch.isActive }}"\n								switch-on-text="{{ recordSwitch.onText }}"\n								switch-off-text="{{ recordSwitch.offText }}"\n								switch-on-color="{{ recordSwitch.onColor }}"\n								switch-off-color="{{ recordSwitch.offColor }}"\n								switch-animate="{{ recordSwitch.animate }}"\n								switch-size="{{ recordSwitch.size }}"\n								switch-label="{{ recordSwitch.label }}"\n								switch-icon="{{ recordSwitch.icon }}"\n								switch-radio-off="{{ recordSwitch.radioOff }}"\n								switch-label-width="{{ recordSwitch.labelWidth }}"\n								switch-handle-width="{{ recordSwitch.handleWidth }}">\n							</div>\n							<!-- END STATUS -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="trigger.description"/>\n							</div>\n							<!-- END DESCRIPTION -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n					</div>\n					<!-- END GENERAL TAB -->\n					<div class="tab-pane" id="tab_1_2">\n						<div class="portlet light bordered">\n							<div class="portlet-title">\n								<div class="caption font-blue-hoki">\n									<i class="icon-tag font-blue-hoki"></i>\n									<span class="caption-subject" ng-bind-html="\'APPLICATION_MEET_ALL_CONDITIONS\' | translate"></span>:\n								</div>\n							</div>\n							<div class="portlet-body">\n								<div class="padding-bottom row" ng-repeat="all in trigger.All">\n									<condition-builder element="all" serviceindex="trigger.channel" service="$triggers" form="forms.general"></condition-builder>\n									<button type="button" ng-click="removeCondition(\'All\',$index)" class="btn btn-danger remove-condition col-md-1 left-margin"><span class="glyphicon glyphicon-minus-sign"></span></button>\n								</div>\n								<button type="button" class="btn btn-sm green padding-bottom" data-ng-click="addCondition(\'All\')">\n									<i class="fa fa-plus"></i> {{\'APPLICATION_ADD_CONDITION\' | translate}}\n								</button>\n							</div>\n						</div>\n						<div class="portlet light bordered">\n							<div class="portlet-title">\n								<div class="caption font-blue-hoki">\n									<i class="icon-tag font-blue-hoki"></i>\n									<span class="caption-subject" ng-bind-html="\'APPLICATION_MEET_ANY_CONDITIONS\' | translate"></span>:\n								</div>\n							</div>\n							<div class="portlet-body">\n								<div class="padding-bottom row" ng-repeat="any in trigger.Any">\n									<condition-builder element="any" serviceindex="trigger.channel" service="$triggers" form="forms.general"></condition-builder>\n									<button type="button" ng-click="removeCondition(\'Any\',$index)" class="btn btn-danger remove-condition col-md-1 left-margin"><span class="glyphicon glyphicon-minus-sign"></span></button>\n								</div>\n								<button type="button" class="btn btn-sm green padding-bottom" data-ng-click="addCondition(\'Any\')">\n									<i class="fa fa-plus"></i> {{\'APPLICATION_ADD_CONDITION\' | translate}}\n								</button>\n							</div>\n						</div>\n						<div class="portlet light bordered">\n							<div class="portlet-title">\n								<div class="caption font-blue-hoki">\n									<i class="icon-tag font-blue-hoki"></i>\n									<span class="caption-subject">{{ \'APPLICATION_ACTIONS\' | translate }}</span>:\n								</div>\n							</div>\n							<div class="portlet-body">\n								<div class="padding-bottom row" ng-repeat="action in trigger.Actions">\n									<div class="form-group col-md-2" data-ng-class="{\'has-error\': (forms.general[\'action\'+$index].$touched || forms.general.$submitted) && forms.general[\'action\'+$index].$invalid}">\n										<ui-select data-ng-model="action.action" theme="bootstrap" data-ng-change="resetActionData(action)" name="action{{$index}}" required>\n											<ui-select-match placeholder="{{ \'APPLICATION_ACTION\' | translate }}">{{$select.selected.name | translate}}</ui-select-match>\n											<ui-select-choices repeat="tAction.value as tAction in $triggers.services[trigger.channel].actions | filter: $select.search">\n												<div ng-bind-html="tAction.name | translate | highlight: $select.search"></div>\n											</ui-select-choices>\n										</ui-select>\n										<span data-ng-show="(forms.general[\'action\'+$index].$touched || forms.general.$submitted) && forms.general[\'action\'+$index].$error.required" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<div ng-switch="action.action">\n										<action-builder-template ng-switch-when="template" element="action" form="forms.general"></action-builder-template>\n										<action-builder-integration ng-switch-when="integration" element="action" form="forms.general"></action-builder-integration>\n									</div>\n									<button type="button" ng-click="removeAction($index)" class="btn btn-danger remove-condition col-md-1 left-margin"><span class="glyphicon glyphicon-minus-sign"></span></button>\n								</div>\n								<button type="button" class="btn btn-sm green padding-bottom" data-ng-click="addAction()">\n									<i class="fa fa-plus"></i> {{\'APPLICATION_ADD_ACTION\' | translate}}\n								</button>\n							</div>\n						</div>\n						<div class="has-error" data-ng-show="forms.general.$submitted && !trigger.All.length && !trigger.Any.length">\n							<span class="help-block help-block-error form-control">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_INSERT_AT_LEAST_ONE_CONDITION\' | translate}}.\n							</span>\n						</div>\n						<div class="has-error" data-ng-show="forms.general.$submitted && !trigger.Actions.length">\n							<span class="help-block help-block-error form-control">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_INSERT_AT_LEAST_ONE_ACTION\' | translate}}.\n							</span>\n						</div>\n						<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n					</div>\n				</div>\n				</form>\n			</div>\n		</div>\n	</div>\n</div>\n'),
+a.put("app/tools/trigger/wizard/wizard.html",'<div class="row">\n	<div class="col-md-12">\n		<!-- BEGIN PAGE HEADER-->\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-bulb"></i>\n					<a href="/tools/triggers/list">{{ \'APPLICATION_TRIGGERS\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n		<!-- END PAGE HEADER-->\n\n		<!-- BEGIN  PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-bulb font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_TRIGGERS\' | translate }} WIZARD</span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<wizard on-finish="createItem()">\n					<wz-step title="{{\'APPLICATION_GENERAL\' | translate}}" canexit="exitValidation(forms.general.$valid)">\n						<form name="forms.general" novalidate>\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n								<span data-ng-show="(forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<!-- START STATUS -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_STATUS\' | translate}}</label></br>\n							<input\n								    bs-switch\n										class="form-control"\n								    ng-model="item.status"\n								    type="checkbox"\n										name="status"\n										data-ng-init="item.status = 0"\n								    switch-active="{{ recordSwitch.isActive }}"\n								    switch-on-text="{{ recordSwitch.onText }}"\n								    switch-off-text="{{ recordSwitch.offText }}"\n								    switch-on-color="{{ recordSwitch.onColor }}"\n								    switch-off-color="{{ recordSwitch.offColor }}"\n								    switch-animate="{{ recordSwitch.animate }}"\n								    switch-size="{{ recordSwitch.size }}"\n								    switch-label="{{ recordSwitch.label }}"\n								    switch-icon="{{ recordSwitch.icon }}"\n								    switch-radio-off="{{ recordSwitch.radioOff }}"\n								    switch-label-width="{{ recordSwitch.labelWidth }}"\n								    switch-handle-width="{{ recordSwitch.handleWidth }}">\n							</div>\n							<!-- END STATUS -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"/>\n							</div>\n							<!-- END DESCRIPTION -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" ng-click="next()"/>\n						</form>\n					</wz-step>\n	        <wz-step title="{{\'APPLICATION_SETTINGS\' | translate}}" canexit="exitSettingsValidation(forms.settings.$valid)">\n						<form name="forms.settings" novalidate>\n						<div class="portlet light bordered">\n							<div class="portlet-title">\n								<div class="caption font-blue-hoki">\n									<i class="icon-tag font-blue-hoki"></i>\n									<span class="caption-subject">{{ \'APPLICATION_CHANNEL\' | translate }}</span>\n								</div>\n							</div>\n							<div class="portlet-body">\n								<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.channel.$touched || forms.settings.$submitted) && forms.settings.channel.$invalid}">\n									<label class="control-label">{{ \'APPLICATION_CHANNEL\' | translate }}<span class="required" aria-required="true">*</span></label>\n									<ui-select data-ng-model="item.channel" name="channel" theme="bootstrap" required>\n										<ui-select-match placeholder="{{ \'APPLICATION_CHANNEL\' | translate }}">{{$select.selected | capitalize}}</ui-select-match>\n										<ui-select-choices repeat="channel in $triggers.channels | filter: $select.search">\n											<div ng-bind-html="channel | highlight: $select.search | capitalize"></div>\n										</ui-select-choices>\n									</ui-select>\n									<span data-ng-show="(forms.settings.channel.$touched || forms.settings.$submitted) && forms.settings.channel.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n							</div>\n						</div>\n						<div class="portlet light bordered">\n							<div class="portlet-title">\n								<div class="caption font-blue-hoki">\n									<i class="icon-tag font-blue-hoki"></i>\n									<span class="caption-subject" ng-bind-html="\'APPLICATION_MEET_ALL_CONDITIONS\' | translate"></span>:\n								</div>\n							</div>\n							<div class="portlet-body">\n								<div class="padding-bottom row" ng-repeat="all in item.All">\n									<condition-builder element="all" serviceindex="item.channel" service="$triggers" form="forms.settings"></condition-builder>\n									<button type="button" ng-click="removeCondition(\'All\',$index)" class="btn btn-danger remove-condition col-md-1 left-margin"><span class="glyphicon glyphicon-minus-sign"></span></button>\n								</div>\n								<button type="button" class="btn btn-sm green padding-bottom" data-ng-click="addCondition(\'All\')">\n									<i class="fa fa-plus"></i> {{\'APPLICATION_ADD_CONDITION\' | translate}}\n								</button>\n							</div>\n						</div>\n						<div class="portlet light bordered">\n							<div class="portlet-title">\n								<div class="caption font-blue-hoki">\n									<i class="icon-tag font-blue-hoki"></i>\n									<span class="caption-subject" ng-bind-html="\'APPLICATION_MEET_ANY_CONDITIONS\' | translate"></span>:\n								</div>\n							</div>\n							<div class="portlet-body">\n								<div class="padding-bottom row" ng-repeat="any in item.Any">\n									<condition-builder element="any" serviceindex="item.channel" service="$triggers" form="forms.settings"></condition-builder>\n									<button type="button" ng-click="removeCondition(\'Any\',$index)" class="btn btn-danger remove-condition col-md-1 left-margin"><span class="glyphicon glyphicon-minus-sign"></span></button>\n								</div>\n								<button type="button" class="btn btn-sm green padding-bottom" data-ng-click="addCondition(\'Any\')">\n									<i class="fa fa-plus"></i> {{\'APPLICATION_ADD_CONDITION\' | translate}}\n								</button>\n							</div>\n						</div>\n						<div class="portlet light bordered">\n							<div class="portlet-title">\n								<div class="caption font-blue-hoki">\n									<i class="icon-tag font-blue-hoki"></i>\n									<span class="caption-subject">{{ \'APPLICATION_ACTIONS\' | translate }}</span>:\n								</div>\n							</div>\n							<div class="portlet-body">\n								<div class="padding-bottom row" ng-repeat="action in item.Actions">\n									<div class="form-group col-md-2" data-ng-class="{\'has-error\': (forms.settings[\'action\'+$index].$touched || forms.settings.$submitted) && forms.settings[\'action\'+$index].$invalid}">\n										<ui-select data-ng-model="action.action" theme="bootstrap" data-ng-change="resetActionData(action)" name="action{{$index}}" required>\n											<ui-select-match placeholder="{{ \'APPLICATION_ACTION\' | translate }}">{{$select.selected.name | translate}}</ui-select-match>\n											<ui-select-choices repeat="tAction.value as tAction in $triggers.services[item.channel].actions | filter: $select.search">\n												<div ng-bind-html="tAction.name | translate | highlight: $select.search"></div>\n											</ui-select-choices>\n										</ui-select>\n										<span data-ng-show="(forms.settings[\'action\'+$index].$touched || forms.settings.$submitted) && forms.settings[\'action\'+$index].$error.required" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<div ng-switch="action.action">\n										<action-builder-template ng-switch-when="template" element="action" form="forms.settings"></action-builder-template>\n										<action-builder-integration ng-switch-when="integration" element="action" form="forms.settings"></action-builder-integration>\n									</div>\n									<button type="button" ng-click="removeAction($index)" class="btn btn-danger remove-condition col-md-1 left-margin"><span class="glyphicon glyphicon-minus-sign"></span></button>\n								</div>\n								<button type="button" class="btn btn-sm green padding-bottom" data-ng-click="addAction()">\n									<i class="fa fa-plus"></i> {{\'APPLICATION_ADD_ACTION\' | translate}}\n								</button>\n							</div>\n						</div>\n						<div class="has-error" data-ng-show="forms.settings.$submitted && !item.All.length && !item.Any.length">\n							<span class="help-block help-block-error form-control">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_INSERT_AT_LEAST_ONE_CONDITION\' | translate}}.\n							</span>\n						</div>\n						<div class="has-error" data-ng-show="forms.settings.$submitted && !item.Actions.length">\n							<span class="help-block help-block-error form-control">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_INSERT_AT_LEAST_ONE_ACTION\' | translate}}.\n							</span>\n						</div>\n						<button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n						<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" ng-click="next()"/>\n					</form>\n					</wz-step>\n					<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n						<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n						<button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n						<input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n					</wz-step>\n				</wizard>\n			</div>\n		</div>\n		<!-- END PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/tools/trunk/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-wrench"></i>\n					<a href="#">{{ \'APPLICATION_TOOLS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-link"></i>\n					<a href="#">{{ \'APPLICATION_TRUNKS\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-link font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_TRUNKS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<a class="btn green-jungle" href="/tools/trunks/wizard" data-toggle="dropdown">\n						<i class="icon-plus"></i> {{ \'APPLICATION_NEW_TRUNK\' | translate }}\n					</a>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/tools/trunk/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initView()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-wrench"></i>\n					<a href="#">{{ \'APPLICATION_TOOLS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-link"></i>\n					<a href="/tools/trunks/list">{{ \'APPLICATION_TRUNKS\' | translate }}</a>\n					<i data-ng-show="trunk" class="fa fa-angle-right"></i>\n				</li>\n				<li data-ng-show="trunk">\n					<a href="#">{{trunk.name}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/trunk.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{trunk.name}}\n					</div>\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.tools.trunks.view.settings\')}">\n							<a data-ng-href="/tools/trunks/view/{{trunk.name}}/settings"><i class="icon-settings"></i> {{ \'APPLICATION_SETTINGS\' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/tools/trunk/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_TRUNK\' | translate}} {{ \'APPLICATION_SETTINGS\' | translate}} </span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_GENERAL\' | translate}}</a>\n					</li>\n					<li>\n						<a href="#" data-target="#tab_1_2" data-toggle="tab">{{ \'APPLICATION_ADVANCED\' | translate}}</a>\n					</li>\n					<li>\n						<a href="#" data-target="#tab_1_3" data-toggle="tab">{{ \'APPLICATION_OTHER_FIELDS\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n\n			<div class="portlet-body" data-ng-init="getContexts();">\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.general" data-ng-submit="forms.general.$valid && updateTrunk()" novalidate>\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="trunk.name" required readonly/>\n								<span data-ng-show="(forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n							<div class="row">\n								<div class="col-md-6">\n\n							<!-- START HOST -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.host.$touched || forms.general.$submitted) && forms.general.host.$invalid}">\n								<label class="control-label">{{\'APPLICATION_HOST\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="host" placeholder="{{\'APPLICATION_HOST\' | translate}}" class="form-control" data-ng-model="trunk.host" required/>\n								<span class="help-block">\n									{{ \'DESCRIPTION_TRUNK_HOST\' | translate }}\n								</span>\n								<span data-ng-show="(forms.general.host.$touched || forms.general.$submitted) && forms.general.host.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END HOST -->\n\n							<!-- START SECRET -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.secret.$touched || forms.general.$submitted) && forms.general.secret.$invalid}">\n								<label class="control-label">{{\'APPLICATION_SECRET\' | translate}}</label>\n								<input type="password" name="secret" placeholder="{{\'APPLICATION_SECRET\' | translate}}" class="form-control" data-ng-model="trunk.secret">\n								<span class="help-block">\n									{{ \'DESCRIPTION_TRUNK_SECRET\' | translate }}\n								</span>\n								<span data-ng-show="(forms.general.secret.$touched || forms.general.$submitted) && forms.general.secret.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END SECRET -->\n\n							<!-- START CONTEXT -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.context.$touched || forms.general.$submitted) && forms.general.context.$invalid}">\n								<label class="control-label">{{\'APPLICATION_CONTEXT\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="trunk.context" name="context" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n									<ui-select-choices repeat="context.name as context in voiceContexts | filter: $select.search">\n										<div ng-bind-html="context.name | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_TRUNK_VOICE_CONTEXT\' | translate }}\n								</span>\n								<span data-ng-show="(forms.general.context.$touched || forms.general.$submitted) && forms.general.context.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END CONTEXT -->\n\n							<!-- START CALLERID -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.callerid.$touched || forms.general.$submitted) && forms.general.callerid.$invalid}">\n								<label class="control-label">{{\'APPLICATION_CALLERID\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="callerid" pattern=\'^"[a-zA-Z0-9_.-]*" <[a-zA-Z0-9_.-]*>\' placeholder="{{\'APPLICATION_CALLERID\' | translate}}" class="form-control" data-ng-model="trunk.callerid"/>\n								<span class="help-block">\n										{{ \'DESCRIPTION_OUTBOUND_CALLERID\' | translate }} "name" &lt;number&gt;\n									</span>\n								<span data-ng-show="(forms.general.callerid.$touched || forms.general.$submitted) && forms.general.callerid.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END CALLERID -->\n\n							<!-- START TYPE -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.type.$touched || forms.general.$submitted) && forms.general.type.$invalid}">\n								<label class="control-label">{{\'APPLICATION_TYPE\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="trunk.type" name="type" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n									<ui-select-choices repeat="item in [\'user\',\'peer\',\'friend\'] | filter: $select.search">\n										<div ng-bind-html="item | highlight: $select.search | capitalize"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_TRUNK_TYPE\' | translate }}\n								</span>\n								<span data-ng-show="(forms.general.type.$touched || forms.general.$submitted) && forms.general.type.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END TYPE -->\n\n							<!-- START DTMFMODE -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.dtmfmode.$touched || forms.general.$submitted) && forms.general.dtmfmode.$invalid}">\n								<label class="control-label">{{\'APPLICATION_DTMFMODE\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="trunk.dtmfmode" name="dtmfmode" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected}}</ui-select-match>\n									<ui-select-choices repeat="item in [\'rfc2833\', \'info\', \'shortinfo\', \'inband\',\'auto\'] | filter: $select.search">\n										<div ng-bind-html="item | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_TRUNK_DTMFMODE\' | translate }}\n								</span>\n								<span data-ng-show="(forms.general.dtmfmode.$touched || forms.general.$submitted) && forms.general.dtmfmode.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END DTMFMODE -->\n\n						</div>\n						<div class="col-md-6">\n\n							<!-- START DEFAULT USER -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.general.$submitted && forms.general.defaultuser.$invalid}">\n								<label class="control-label">{{\'APPLICATION_DEFAULT_USER\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="defaultuser" placeholder="{{\'APPLICATION_DEFAULT_USER\' | translate}}" class="form-control" data-ng-model="trunk.defaultuser" required/>\n								<span class="help-block">\n									{{ \'DESCRIPTION_TRUNK_DEFAULT_USER\' | translate }}\n								</span>\n								<span data-ng-show="forms.general.$submitted && (forms.general.defaultuser.$invalid)" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END DEFAULT USER -->\n\n							<!-- START NAT -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.nat.$touched || forms.general.$submitted) && forms.general.nat.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAT\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select multiple data-ng-model="trunk.nat" name="nat" theme="bootstrap" ui-required="true">\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$item}}</ui-select-match>\n									<ui-select-choices repeat="item in [\'yes\', \'no\', \'never\', \'route\', \'force_rport\', \'comedia\'] | filter: $select.search">\n										<div ng-bind-html="item | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_TRUNK_NAT\' | translate }}\n								</span>\n								<span data-ng-show="(forms.general.nat.$touched || forms.general.$submitted) && forms.general.nat.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAT -->\n\n							<!-- START QUALIFY -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.qualify.$touched || forms.general.$submitted) && forms.general.qualify.$invalid}">\n								<label class="control-label">{{\'APPLICATION_QUALIFY\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="trunk.qualify" name="qualify" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n									<ui-select-choices repeat="item in [\'yes\',\'no\'] | filter: $select.search">\n										<div ng-bind-html="item | highlight: $select.search | capitalize"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_TRUNK_QUALIFY\' | translate }}\n								</span>\n								<span data-ng-show="(forms.general.qualify.$touched || forms.general.$submitted) && forms.general.qualify.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END QUALIFY -->\n\n							<!-- START ALLOW -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.allow.$touched || forms.general.$submitted) && forms.general.allow.$invalid}">\n								<label class="control-label">{{\'APPLICATION_ALLOW_CODEC\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select multiple data-ng-model="trunk.allow" name="allow" theme="bootstrap" ui-required="true">\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$item}}</ui-select-match>\n									<ui-select-choices repeat="item in [\'g723\',\'gsm\',\'ulaw\',\'alaw\',\'g726\',\'g722\',\'g729\',\'ilbc\'] | filter: $select.search">\n										<div ng-bind-html="item | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_TRUNK_ALLOW_CODEC\' | translate }}\n								</span>\n								<span data-ng-show="(forms.general.allow.$touched || forms.general.$submitted) && forms.general.allow.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END ALLOW -->\n\n							<!-- START INSECURE -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.insecure.$touched || forms.general.$submitted) && forms.general.insecure.$invalid}">\n								<label class="control-label">{{\'APPLICATION_INSECURE\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select multiple data-ng-model="trunk.insecure" name="insecure" theme="bootstrap" ui-required="true">\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$item}}</ui-select-match>\n									<ui-select-choices repeat="item in [\'port\',\'invite\',\'very\'] | filter: $select.search">\n										<div ng-bind-html="item | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_TRUNK_INSECURE\' | translate }}\n								</span>\n								<span data-ng-show="(forms.general.insecure.$touched || forms.general.$submitted) && forms.general.insecure.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END INSECURE -->\n\n							<!-- START CALLLIMIT -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.call_limit.$touched || forms.general.$submitted) && forms.general.call_limit.$invalid}">\n								<label class="control-label">{{\'APPLICATION_CALLLIMIT\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="number" min="0" name="call-limit" placeholder="{{\'APPLICATION_CALLLIMIT\' | translate}}" class="form-control" data-ng-model="trunk.call_limit"/>\n								<span class="help-block">\n									{{ \'DESCRIPTION_TRUNK_CALLLIMIT\' | translate }}\n								</span>\n								<span data-ng-show="(forms.general.call_limit.$touched || forms.general.$submitted) && forms.general.call_limit.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END CALLLIMIT -->\n\n						</div>\n					</div>\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="trunk.description"></textarea>\n							</div>\n							<!-- END DESCRIPTION -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END GENERAL TAB -->\n					<!-- ADVANCED TAB -->\n					<div class="tab-pane" id="tab_1_2">\n						<form name="forms.advanced" data-ng-submit="forms.advanced.$valid && updateTrunk()" novalidate>\n							<div class="row">\n								<div class="col-md-6">\n\n							<!-- START REGISTRY -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_REGISTRY\' | translate}}</label>\n								<input type="text" name="registry" placeholder="{{\'APPLICATION_REGISTRY\' | translate}}" class="form-control" data-ng-model="trunk.registry"/>\n								<span class="help-block">\n									{{ \'DESCRIPTION_TRUNK_REGISTRY\' | translate }}\n								</span>\n							</div>\n							<!-- END REGISTRY -->\n\n							<!-- START DIRECTMEDIA -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.directmedia.$touched || forms.advanced.$submitted) && forms.advanced.directmedia.$invalid}">\n								<label class="control-label">{{\'APPLICATION_DIRECTMEDIA\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="trunk.directmedia" name="directmedia" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n									<ui-select-choices repeat="item in [\'yes\', \'no\', \'nonat\', \'update\'] | filter: $select.search">\n										<div ng-bind-html="item | highlight: $select.search | capitalize"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_TRUNK_DIRECTMEDIA\' | translate }}\n								</span>\n								<span data-ng-show="(forms.advanced.directmedia.$touched || forms.advanced.$submitted) && forms.advanced.directmedia.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END DIRECTMEDIA -->\n\n							<!-- START CALLCOUNTER -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.callcounter.$touched || forms.advanced.$submitted) && forms.advanced.callcounter.$invalid}">\n								<label class="control-label">{{\'APPLICATION_CALLCOUNTER\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="trunk.callcounter" name="callcounter" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n									<ui-select-choices repeat="item in [\'yes\',\'no\'] | filter: $select.search">\n										<div ng-bind-html="item | highlight: $select.search | capitalize"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_TRUNK_CALLCOUNTER\' | translate }}\n								</span>\n								<span data-ng-show="(forms.advanced.callcounter.$touched || forms.advanced.$submitted) && forms.advanced.callcounter.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END CALLCOUNTER -->\n\n							<!-- START FROMDOMAIN -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.advanced.$submitted && forms.advanced.fromdomain.$invalid}">\n								<label class="control-label">{{\'APPLICATION_FROMDOMAIN\' | translate}}</label>\n								<input type="text" name="fromdomain" placeholder="{{\'APPLICATION_FROMDOMAIN\' | translate}}" class="form-control" data-ng-model="trunk.fromdomain" />\n								<span class="help-block">\n									{{ \'DESCRIPTION_TRUNK_FROMDOMAIN\' | translate }}\n								</span>\n								<span data-ng-show="forms.advanced.$submitted && (forms.advanced.fromdomain.$invalid)" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END FROMDOMAIN -->\n\n							<!-- START FROMUSER -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.advanced.$submitted && forms.advanced.fromuser.$invalid}">\n								<label class="control-label">{{\'APPLICATION_FROMUSER\' | translate}}</label>\n								<input type="text" name="fromuser" placeholder="{{\'APPLICATION_FROMUSER\' | translate}}" class="form-control" data-ng-model="trunk.fromuser" />\n								<span class="help-block">\n									{{ \'DESCRIPTION_TRUNK_FROMUSER\' | translate }}\n								</span>\n								<span data-ng-show="forms.advanced.$submitted && (forms.advanced.fromuser.$invalid)" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END FROMUSER -->\n\n						</div>\n						<div class="col-md-6">\n\n							<!-- START OUTBOUNDPROXY -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.advanced.$submitted && forms.advanced.outboundproxy.$invalid}">\n								<label class="control-label">{{\'APPLICATION_OUTBOUNDPROXY\' | translate}}</label>\n								<input type="text" name="outboundproxy" placeholder="{{\'APPLICATION_OUTBOUNDPROXY\' | translate}}" class="form-control" data-ng-model="trunk.outboundproxy" />\n								<span class="help-block">\n									{{ \'DESCRIPTION_TRUNK_OUTBOUNDPROXY\' | translate }}\n								</span>\n								<span data-ng-show="forms.advanced.$submitted && (forms.advanced.outboundproxy.$invalid)" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END OUTBOUNDPROXY -->\n\n							<!-- START USEREQPHONE -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.usereqphone.$touched || forms.advanced.$submitted) && forms.advanced.usereqphone.$invalid}">\n								<label class="control-label">{{\'APPLICATION_USEREQPHONE\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="trunk.usereqphone" name="usereqphone" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n									<ui-select-choices repeat="item in [\'yes\',\'no\'] | filter: $select.search">\n										<div ng-bind-html="item | highlight: $select.search | capitalize"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_TRUNK_USEREQPHONE\' | translate }}\n								</span>\n								<span data-ng-show="(forms.advanced.usereqphone.$touched || forms.advanced.$submitted) && forms.advanced.usereqphone.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END USEREQPHONE -->\n\n							<!-- START TRUSTRPID -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.trustrpid.$touched || forms.advanced.$submitted) && forms.advanced.trustrpid.$invalid}">\n								<label class="control-label">{{\'APPLICATION_TRUSTRPID\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="trunk.trustrpid" name="trustrpid" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n									<ui-select-choices repeat="item in [\'yes\',\'no\'] | filter: $select.search">\n										<div ng-bind-html="item | highlight: $select.search | capitalize"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_TRUNK_TRUSTRPID\' | translate }}\n								</span>\n								<span data-ng-show="(forms.advanced.trustrpid.$touched || forms.advanced.$submitted) && forms.advanced.trustrpid.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END TRUSTRPID -->\n\n							<!-- START SENDRPID -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.sendrpid.$touched || forms.advanced.$submitted) && forms.advanced.sendrpid.$invalid}">\n								<label class="control-label">{{\'APPLICATION_SENDRPID\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="trunk.sendrpid" name="sendrpid" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n									<ui-select-choices repeat="item in [\'yes\',\'no\'] | filter: $select.search">\n										<div ng-bind-html="item | highlight: $select.search | capitalize"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_TRUNK_SENDRPID\' | translate }}\n								</span>\n								<span data-ng-show="(forms.advanced.sendrpid.$touched || forms.advanced.$submitted) && forms.advanced.sendrpid.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END SENDRPID -->\n\n							<!-- START ENCRYPTION -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.encryption.$touched || forms.advanced.$submitted) && forms.advanced.encryption.$invalid}">\n								<label class="control-label">{{\'APPLICATION_ENCRYPTION\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="trunk.encryption" name="encryption" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n									<ui-select-choices repeat="item in [\'yes\',\'no\'] | filter: $select.search">\n										<div ng-bind-html="item | highlight: $select.search | capitalize"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_TRUNK_ENCRYPTION\' | translate }}\n								</span>\n								<span data-ng-show="(forms.advanced.encryption.$touched || forms.advanced.$submitted) && forms.advanced.encryption.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END ENCRYPTION -->\n\n							<!-- START PORT -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.port.$touched || forms.advanced.$submitted) && forms.advanced.port.$invalid}">\n								<label class="control-label">{{\'APPLICATION_PORT\' | translate}}</label>\n								<input type="number" min="0" name="port" placeholder="{{\'APPLICATION_PORT\' | translate}}" class="form-control" data-ng-model="trunk.port"/>\n								<span class="help-block">\n									{{ \'DESCRIPTION_TRUNK_PORT\' | translate }}\n								</span>\n								<span data-ng-show="(forms.advanced.port.$touched || forms.advanced.$submitted) && forms.advanced.port.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END PORT -->\n\n							<!-- START TRANSPORT -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.transport.$touched || forms.advanced.$submitted) && forms.advanced.transport.$invalid}">\n								<label class="control-label">{{\'APPLICATION_TRANSPORT\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select multiple data-ng-model="trunk.transport" name="transport" theme="bootstrap" ui-required="true">\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$item}}</ui-select-match>\n									<ui-select-choices repeat="item in [\'udp\',\'wss\',\'ws\',\'tcp\',\'tls\'] | filter: $select.search">\n										<div ng-bind-html="item | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_TRUNK_TRANSPORT\' | translate }}\n								</span>\n								<span data-ng-show="(forms.advanced.transport.$touched || forms.advanced.$submitted) && forms.advanced.transport.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END TRANSPORT -->\n\n						</div>\n					</div>\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END ADVANCED TAB -->\n					<!-- START OTHER FIELDS TAB -->\n					<div class="tab-pane" id="tab_1_3">\n						<div class="row">\n							<div class="col-md-6">\n								<!-- START OTHER FIELDS-->\n								<div class="form-group">\n									<label class="control-label">{{\'APPLICATION_OTHER_FIELDS\' | translate}}</label>\n									<textarea name="otherFields" placeholder="{{\'APPLICATION_OTHER_FIELDS\' | translate}}" class="form-control otherfields-col" data-ng-model="trunk.otherFields"></textarea>\n									<span class="help-block">\n										{{ \'DESCRIPTION_TRUNK_OTHER_FIELDS\' | translate }}\n									</span>\n								</div>\n								<!-- END OTHER FIELDS -->\n							</div>\n							<div class="col-md-6">\n								<div class="form-group">\n									<label class="control-label">{{\'APPLICATION_EXAMPLE\' | translate}}</label>\n									<div class="well">\n										<div>host=dynamicp</div>\n										<div>secret=********</div>\n										<div>regcontext=tammari-internal</div>\n										<div>regexten=1005</div>\n										<div>dtmfmode=rfc2833</div>\n										<div>insecure=invite,port</div>\n										<div>canreinvite=yes</div>\n										<div>nat=yes</div>\n										<div>qualify=yes</div>\n										<div>context=merus-sipphone</div>\n										<div>pickupgroup=1</div>\n										<div>callgroup=1</div>\n										<div>mailbox=1000@default</div>\n									</div>\n								</div>\n							</div>\n						</div>\n					</div>\n					<!-- END OTHER FIELDS TAB -->\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),
+a.put("app/tools/trunk/wizard/wizard.html",'<div class="col-md-12" data-ng-init="initWizard()">\n	<!-- BEGIN PAGE HEADER-->\n	<div class="page-bar">\n		<ul class="page-breadcrumb">\n			<li>\n				<i class="icon-rocket"></i>\n				<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n				<i class="fa fa-angle-right"></i>\n			</li>\n			<li>\n				<i class="icon-wrench"></i>\n				<a href="#">{{ \'APPLICATION_TOOLS\' | translate }}</a>\n				<i class="fa fa-angle-right"></i>\n			</li>\n			<li>\n				<i class="icon-link"></i>\n				<a href="/tools/trunks/list">{{ \'APPLICATION_TRUNKS\' | translate }}</a>\n				<i class="fa fa-angle-right"></i>\n			</li>\n			<li>\n				<i class="icon-options"></i>\n				<a href="#">{{ \'APPLICATION_WIZARD\' | translate }}</a>\n			</li>\n		</ul>\n	</div>\n	<!-- END PAGE HEADER-->\n\n	<!-- BEGIN PORTLET-->\n	<div class="portlet light bordered">\n		<div class="portlet-title">\n			<div class="caption font-green-sharp">\n				<i class="icon-link font-green-sharp"></i>\n				<span class="caption-subject">{{ \'APPLICATION_TRUNK\' | translate }} WIZARD</a> </span>\n			</div>\n		</div>\n		<div class="portlet-body">\n			<wizard on-finish="createItem()">\n				<wz-step title="{{\'APPLICATION_GENERAL\' | translate}}" canexit="exitValidation(forms.general.$valid)">\n					<form name="forms.general" novalidate>\n\n						<!-- START NAME -->\n						<div class="form-group" data-ng-class="{\'has-error\': forms.general.$submitted && forms.general.name.$invalid}">\n							<label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n							<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n							<span data-ng-show="forms.general.$submitted && forms.general.name.$invalid" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n						</div>\n						<!-- END NAME -->\n\n						<!-- START HOST -->\n						<div class="form-group" data-ng-class="{\'has-error\': forms.general.$submitted && forms.general.host.$invalid}">\n							<label class="control-label">{{\'APPLICATION_HOST\' | translate}}<span class="required" aria-required="true">*</span></label>\n							<input type="text" name="host" placeholder="{{\'APPLICATION_HOST\' | translate}}" class="form-control" data-ng-model="item.host" required/>\n							<span class="help-block">\n								{{ \'DESCRIPTION_TRUNK_HOST\' | translate }}\n							</span>\n							<span data-ng-show="forms.general.$submitted && forms.general.host.$invalid" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n						</div>\n						<!-- END HOST -->\n\n						<!-- START PASSWORD -->\n						<div class="form-group" data-ng-class="{\'has-error\': forms.general.$submitted && forms.general.password.$invalid}">\n							<label class="control-label">{{\'APPLICATION_SECRET\' | translate}}<span class="required" aria-required="true">*</span></label>\n							<input type="password" name="password" placeholder="{{\'APPLICATION_PASSWORD\' | translate}}" class="form-control" data-ng-model="item.secret" required/>\n							<span class="help-block">\n								{{ \'DESCRIPTION_TRUNK_SECRET\' | translate }}\n							</span>\n							<span data-ng-show="forms.general.$submitted && forms.general.password.$invalid" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n						</div>\n						<!-- END PASSWORD -->\n\n						<!-- START DEFAULT USER -->\n						<div class="form-group" data-ng-class="{\'has-error\': forms.general.$submitted && forms.general.defaultuser.$invalid}">\n							<label class="control-label">{{\'APPLICATION_DEFAULT_USER\' | translate}}<span class="required" aria-required="true">*</span></label>\n							<input type="text" name="defaultuser" placeholder="{{\'APPLICATION_DEFAULT\' | translate}} {{\'APPLICATION_USER\' | translate}}" class="form-control" data-ng-model="item.defaultuser" required/>\n							<span class="help-block">\n								{{ \'DESCRIPTION_TRUNK_DEFAULT_USER\' | translate }}\n							</span>\n							<span data-ng-show="forms.general.$submitted && (forms.general.defaultuser.$invalid)" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_WRONG_PASSWORD\' | translate}}.\n							</span>\n						</div>\n						<!-- END DEFAULT USER -->\n\n						<!-- START DESCRIPTION -->\n						<div class="form-group">\n							<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n							<textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n						</div>\n						<!-- END DESCRIPTION -->\n\n						<button class="btn green-haze" type="submit" ng-click="next(true)">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n					</form>\n				</wz-step>\n\n				<wz-step title="{{\'APPLICATION_ADVANCED\' | translate}}" canexit="exitValidation(forms.advanced.$valid)">\n					<form name="forms.advanced" novalidate>\n\n						<!-- START REGISTRY -->\n						<div class="form-group">\n							<label class="control-label">{{\'APPLICATION_REGISTRY\' | translate}}</label>\n							<input type="text" name="registry" placeholder="{{\'APPLICATION_REGISTRY\' | translate}}" class="form-control" data-ng-model="item.registry"/>\n							<span class="help-block">\n								{{ \'DESCRIPTION_TRUNK_REGISTRY\' | translate }}\n							</span>\n						</div>\n						<!-- END REGISTRY -->\n						<button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n						<button class="btn green-haze" type="submit" ng-click="next()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n					</form>\n				</wz-step>\n\n				<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n					<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n					<button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n					<input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n				</wz-step>\n			</wizard>\n		</div>\n	</div>\n	<!-- END PORTLET-->\n</div>\n'),a.put("app/tools/variable/list/list.create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_VARIABLE\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.name.$touched || form.$submitted) && form.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n      <span data-ng-show="(form.name.$touched || form.$submitted) && form.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n    </div>\n    <!-- END DESCRIPTION -->\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="save()" ng-disabled="form.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/tools/variable/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-wrench"></i>\n					<a href="#">{{ \'APPLICATION_TOOLS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-eye"></i>\n					<a href="#">{{ \'APPLICATION_VARIABLES\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-docs font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_VARIABLES\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<button class="btn green-jungle " ng-click="createItem()">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_VARIABLE\' | translate }}\n						</button>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/tools/variable/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getVariable()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-wrench"></i>\n					<a href="#">{{ \'APPLICATION_TOOLS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-eye"></i>\n					<a href="/tools/variables/list">{{ \'APPLICATION_VARIABLES\' | translate }}</a>\n					<i data-ng-show="variable" class="fa fa-angle-right"></i>\n				</li>\n				<li data-ng-show="variable">\n					<a href="#">{{variable.name}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/variable.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{variable.name}}\n					</div>\n					<!-- <div class="profile-usertitle-job">\n						{{user.role}}\n					</div> -->\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.tools.variables.view.settings\')}">\n							<a data-ng-href="/tools/variables/view/{{variable.id}}/settings">\n							<i class="icon-settings"></i>\n							{{ \'APPLICATION_SETTINGS\' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/tools/variable/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_VARIABLE\' | translate}} {{ \'APPLICATION_SETTINGS\' | translate}} </span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_GENERAL\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.general" data-ng-submit="forms.general.$valid && updateVariable()" novalidate>\n\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="variable.name" required/>\n								<span data-ng-show="(forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="variable.description"></textarea>\n							</div>\n							<!-- END DESCRIPTION -->\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END ADVANCED TAB -->\n\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/tools/yourdashboard/list/clone.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_CLONE_DASHBOARD\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="forms.dashboard" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (forms.dashboard.name.$touched || forms.dashboard.$submitted) && forms.dashboard.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n      <span data-ng-show="(forms.dashboard.name.$touched || forms.dashboard.$submitted) && forms.dashboard.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="ok()" ng-disabled="forms.dashboard.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/tools/yourdashboard/list/create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_DASHBOARD\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="forms.dashboard" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (forms.dashboard.name.$touched || forms.dashboard.$submitted) && forms.dashboard.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n      <span data-ng-show="(forms.dashboard.name.$touched || forms.dashboard.$submitted) && forms.dashboard.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n    </div>\n    <!-- END DESCRIPTION -->\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="ok()" ng-disabled="forms.dashboard.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/tools/yourdashboard/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-screen-desktop"></i>\n					<a href="/tools/yourdashboards/list">{{ \'APPLICATION_YOUR_DASHBOARDS\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-docs font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_YOUR_DASHBOARDS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<button class="btn green-jungle " ng-click="create()">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_DASHBOARD\' | translate }}\n						</button>\n					</div>\n					<!-- <a class="btn btn-icon-only btn-default fullscreen" href="#"></a> -->\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/tools/yourdashboard/show/show.html",'<div class="row" style="min-height: 466px;">\n  <div class="col-md-12" ng-init="getDashboard()">\n    <adf-dashboard\n    data-ng-if="dashboard"\n    name="{{dashboard.name}}"\n    collapsible="{{dashboard.collapsible}}"\n    maximizable="{{dashboard.maximizable}}"\n    enableconfirmdelete="{{dashboard.enableconfirmdelete}}"\n    structure="{{dashboard.structure}}"\n    editable="{{dashboard.editable}}"\n    adf-model="dashboard.model"/>\n  </div>\n</div>\n'),a.put("app/tools/yourdashboard/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getDashboard()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-screen-desktop"></i>\n					<a href="/tools/yourdashboards/list">{{ \'APPLICATION_YOUR_DASHBOARDS\' | translate }}</a>\n					<i data-ng-show="dashboard" class="fa fa-angle-right"></i>\n				</li>\n				<li data-ng-show="dashboard">\n					<a href="#">{{dashboard.name}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/dashboard.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{dashboard.name}}\n					</div>\n					<!-- <div class="profile-usertitle-job">\n						{{user.role}}\n					</div> -->\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.tools.yourdashboards.view.settings\')}">\n							<a data-ng-href="/tools/yourdashboards/view/{{dashboard.id}}/settings">\n							<i class="icon-settings"></i>\n							{{ \'APPLICATION_SETTINGS\' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/tools/yourdashboard/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_DASHBOARD\' | translate}} {{ \'APPLICATION_SETTINGS\' | translate}} </span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_GENERAL\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.general" data-ng-submit="forms.general.$valid && updateDashboard()" novalidate>\n\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="dashboard.name" required/>\n								<span data-ng-show="(forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<!-- START VISIBLE TO ADMIN -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_VISIBLE_TO_ADMIN\' | translate}}</label><br>\n								<input\n									bs-switch\n									ng-model="dashboard.admin"\n									type="checkbox"\n									switch-active="{{ radioSwitch.isActive }}"\n									switch-on-text="{{ \'APPLICATION_YES\' | translate }}"\n									switch-off-text="{{ \'APPLICATION_NO\' | translate }}"\n									switch-on-color="{{ radioSwitch.onColor }}"\n									switch-off-color="{{ radioSwitch.offColor }}"\n									switch-animate="{{ radioSwitch.animate }}"\n									switch-size="{{ radioSwitch.size }}"\n									switch-label="{{ radioSwitch.label }}"\n									switch-icon="{{ radioSwitch.icon }}"\n									switch-radio-off="{{ radioSwitch.radioOff }}"\n									switch-label-width="{{ radioSwitch.labelWidth }}"\n									switch-handle-width="{{ radioSwitch.handleWidth }}">\n							</div>\n							<!-- END VISIBLE TO ADMIN -->\n\n							<!-- START VISIBLE TO USER -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_VISIBLE_TO_USER\' | translate}}</label><br>\n								<input\n									bs-switch\n									ng-model="dashboard.user"\n									type="checkbox"\n									switch-active="{{ radioSwitch.isActive }}"\n									switch-on-text="{{ \'APPLICATION_YES\' | translate }}"\n									switch-off-text="{{ \'APPLICATION_NO\' | translate }}"\n									switch-on-color="{{ radioSwitch.onColor }}"\n									switch-off-color="{{ radioSwitch.offColor }}"\n									switch-animate="{{ radioSwitch.animate }}"\n									switch-size="{{ radioSwitch.size }}"\n									switch-label="{{ radioSwitch.label }}"\n									switch-icon="{{ radioSwitch.icon }}"\n									switch-radio-off="{{ radioSwitch.radioOff }}"\n									switch-label-width="{{ radioSwitch.labelWidth }}"\n									switch-handle-width="{{ radioSwitch.handleWidth }}">\n							</div>\n							<!-- END VISIBLE TO USER -->\n\n							<!-- START VISIBLE TO AGENT -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_VISIBLE_TO_AGENT\' | translate}}</label><br>\n								<input\n									bs-switch\n									ng-model="dashboard.agent"\n									type="checkbox"\n									switch-active="{{ radioSwitch.isActive }}"\n									switch-on-text="{{ \'APPLICATION_YES\' | translate }}"\n									switch-off-text="{{ \'APPLICATION_NO\' | translate }}"\n									switch-on-color="{{ radioSwitch.onColor }}"\n									switch-off-color="{{ radioSwitch.offColor }}"\n									switch-animate="{{ radioSwitch.animate }}"\n									switch-size="{{ radioSwitch.size }}"\n									switch-label="{{ radioSwitch.label }}"\n									switch-icon="{{ radioSwitch.icon }}"\n									switch-radio-off="{{ radioSwitch.radioOff }}"\n									switch-label-width="{{ radioSwitch.labelWidth }}"\n									switch-handle-width="{{ radioSwitch.handleWidth }}">\n							</div>\n							<!-- END VISIBLE TO AGENT -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="dashboard.description"></textarea>\n							</div>\n							<!-- END DESCRIPTION -->\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END ADVANCED TAB -->\n\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/zendesk/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-handbag"></i>\n					<a href="/zendesk/list">{{ \'APPLICATION_ZENDESK\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-handbag font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_ZENDESK\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<a class="btn green-jungle" href="/zendesk/wizard" data-toggle="dropdown">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_ACCOUNT\' | translate }}\n						</a>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/zendesk/view/configuration/list/create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_CONFIGURATION\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.name.$touched || form.name.$submitted) && form.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n      <span data-ng-show="(form.name.$touched || form.name.$submitted) && form.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"/></textarea>\n    </div>\n    <!-- END DESCRIPTION -->\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="ok()" ng-disabled="form.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/zendesk/view/configuration/list/list.html",'<div ui-view class="profile-content">\n	<div class="row">\n		<div class="col-md-12">\n			<div class="portlet light" data-ng-init="initView()">\n				<div class="portlet-title  tabbable-line">\n					<div class="caption caption-md">\n						<i class="icon-globe theme-font hide"></i>\n						<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_CONFIGURATIONS\' | translate}}</span>\n					</div>\n					<div class="actions">\n						<div class="btn-group" data-ng-show="id.length">\n							<a class="btn red" href="#" data-ng-click="deleteItems()">\n								<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n							</a>\n						</div>\n						<div class="btn-group">\n							<a class="btn green-jungle" href="#" data-ng-click="createItem()">\n								<i class="icon-plus"></i> {{ \'APPLICATION_NEW_CONFIGURATION\' | translate }}\n							</a>\n						</div>\n					</div>\n				</div>\n				<div class="portlet-body">\n					<!-- START TABLE -->\n					<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n						<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n					</div>\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),
+a.put("app/zendesk/view/configuration/view/view.html",'<div class="row" data-ng-init="initView();getConfiguration();getCustomVariables();getFields();getTags();">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_CONFIGURATION\' | translate}}: {{configurationName}}</span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{\'APPLICATION_SUBJECT\' | translate}}</a>\n					</li>\n          <li>\n						<a href="#" data-target="#tab_1_2" data-toggle="tab">{{\'APPLICATION_DESCRIPTION\' | translate}}</a>\n					</li>\n          <li>\n						<a href="#" data-target="#tab_1_3" data-toggle="tab">{{\'APPLICATION_FIELDS\' | translate}}</a>\n					</li>\n					<li>\n						<a href="#" data-target="#tab_1_4" data-toggle="tab">{{\'APPLICATION_TAGS\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- SUBJECT TAB -->\n					<div class="tab-pane ui-padding active" id="tab_1_1">\n            <div class="row">\n              <div class="col-md-11">\n                <span class="caption-subject">All following fields will be join by blank space:</span>\n              </div>\n              <div class="col-md-1 pull-rigth">\n                <button class="btn btn-icon-only green" data-ng-click="addItem(\'subject\')"><i class="fa fa-plus"></i></button>\n              </div>\n            </div>\n            <hr>\n						<!-- <div id="subject-item-list" ng-scrollbars ng-scrollbars-config="config"> -->\n	            <div class="row" data-ng-repeat="subjectItem in subjectConfig">\n	              <div class="col-md-3">\n	                <ui-select ng-model="subjectItem.type" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeType(subjectItem)">\n	                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.title}}</ui-select-match>\n	                  <ui-select-choices repeat="item.type as item in fieldType | filter: $select.search">\n	                    <div ng-bind-html="item.title | highlight: $select.search"></div>\n	                  </ui-select-choices>\n	                </ui-select>\n	              </div>\n	              <div class="col-md-8" data-ng-if="subjectItem.type==\'string\'">\n	                <div class="form-group">\n	                  <input type="text" class="form-control" data-ng-model="subjectItem.content" data-ng-change="updateField(subjectItem)">\n	                </div>\n	              </div>\n								<div class="col-md-8" data-ng-if="subjectItem.type==\'variable\'">\n	                <div class="form-group">\n	                  <ui-select theme="bootstrap" ng-disabled="disabled" data-ng-model="subjectItem.variableName" data-ng-change="updateField(subjectItem)">\n	                    <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.title}}</ui-select-match>\n	                    <ui-select-choices group-by="groupVariableByGroup" repeat="variable.name as variable in variables | filter: $select.search">\n	                      <div ng-bind-html="variable.title | highlight: $select.search"></div>\n	                    </ui-select-choices>\n	                  </ui-select>\n	                </div>\n	              </div>\n	              <div class="col-md-8" data-ng-if="subjectItem.type==\'customVariable\'">\n	                <div class="form-group">\n	                  <ui-select theme="bootstrap" ng-disabled="disabled" data-ng-model="subjectItem.VariableId" data-ng-change="updateField(subjectItem)">\n	                    <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n	                    <ui-select-choices repeat="variable.id as variable in customVariables | filter: $select.search">\n	                      <div ng-bind-html="variable.name | highlight: $select.search"></div>\n	                    </ui-select-choices>\n	                  </ui-select>\n	                </div>\n	              </div>\n	              <div class="col-md-1">\n	                <div class="form-group">\n	                  <button class="btn btn-icon-only red" data-ng-click="removeItem(subjectItem)"><i class="fa fa-times"></i></button>\n	                </div>\n	              </div>\n	            </div>\n						<!-- </div> -->\n					</div>\n					<!-- END SUBJECT TAB -->\n          <!-- DESCRIPTION TAB -->\n					<div class="tab-pane ui-padding" id="tab_1_2">\n						<div class="row">\n              <div class="col-md-11">\n                <span class="caption-subject">All following fields will be join by new line:</span>\n              </div>\n              <div class="col-md-1 pull-rigth">\n                <button class="btn btn-icon-only green" data-ng-click="addItem(\'description\')"><i class="fa fa-plus"></i></button>\n              </div>\n            </div>\n            <hr>\n						<!-- <div id="description-item-list" ng-scrollbars ng-scrollbars-config="config"> -->\n							<div class="row" data-ng-repeat="descriptionItem in descriptionConfig">\n	              <div class="col-md-2">\n	                <ui-select ng-model="descriptionItem.type" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeDescType(descriptionItem)">\n	                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.title}}</ui-select-match>\n	                  <ui-select-choices repeat="item.type as item in descFieldType | filter: $select.search">\n	                    <div ng-bind-html="item.title | highlight: $select.search"></div>\n	                  </ui-select-choices>\n	                </ui-select>\n	              </div>\n	              <div class="col-md-9" data-ng-if="descriptionItem.type==\'string\'">\n	                <div class="form-group">\n	                  <input type="text" class="form-control" data-ng-model="descriptionItem.content" data-ng-change="updateField(descriptionItem)">\n	                </div>\n	              </div>\n								<div class="col-md-3" data-ng-if="descriptionItem.type==\'keyValue\'">\n									<input type="text" class="form-control" placeholder="Key" data-ng-model="descriptionItem.key" data-ng-change="updateField(descriptionItem)">\n								</div>\n								<div class="col-md-3" data-ng-if="descriptionItem.type==\'keyValue\'">\n									<ui-select ng-model="descriptionItem.keyType" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeDescType(descriptionItem)">\n	                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.title}}</ui-select-match>\n	                  <ui-select-choices repeat="item.type as item in fieldType | filter: $select.search">\n	                    <div ng-bind-html="item.title | highlight: $select.search"></div>\n	                  </ui-select-choices>\n	                </ui-select>\n								</div>\n								<div class="col-md-3" data-ng-if="descriptionItem.type==\'keyValue\' && descriptionItem.keyType==\'string\'">\n									<input type="text" class="form-control" placeholder="Value" data-ng-model="descriptionItem.keyContent" data-ng-change="updateField(descriptionItem)">\n								</div>\n								<div class="col-md-3" data-ng-if="descriptionItem.type==\'keyValue\' && descriptionItem.keyType==\'variable\'">\n	                <div class="form-group">\n	                  <ui-select theme="bootstrap" ng-disabled="disabled" data-ng-model="descriptionItem.variableName" data-ng-change="updateField(descriptionItem)">\n	                    <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.title}}</ui-select-match>\n	                    <ui-select-choices group-by="groupVariableByGroup" repeat="variable.name as variable in variables | filter: $select.search">\n	                      <div ng-bind-html="variable.title | highlight: $select.search"></div>\n	                    </ui-select-choices>\n	                  </ui-select>\n	                </div>\n	              </div>\n	              <div class="col-md-3" data-ng-if="descriptionItem.type==\'keyValue\' && descriptionItem.keyType==\'customVariable\'">\n	                <div class="form-group">\n	                  <ui-select theme="bootstrap" ng-disabled="disabled" data-ng-model="descriptionItem.VariableId" data-ng-change="updateField(descriptionItem)">\n	                    <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n	                    <ui-select-choices repeat="variable.id as variable in customVariables | filter: $select.search">\n	                      <div ng-bind-html="variable.name | highlight: $select.search"></div>\n	                    </ui-select-choices>\n	                  </ui-select>\n	                </div>\n	              </div>\n	              <div class="col-md-1">\n	                <div class="form-group">\n	                  <button class="btn btn-icon-only red" data-ng-click="removeItem(descriptionItem)"><i class="fa fa-times"></i></button>\n	                </div>\n	              </div>\n	            </div>\n						<!-- </div> -->\n					</div>\n					<!-- END DESCRIPTION TAB -->\n          <!-- FIELDS TAB -->\n					<div class="tab-pane ui-padding" id="tab_1_3">\n						<div class="row">\n              <div class="col-md-11">\n                <span class="caption-subject">Add how to fill the fields present in your account:</span>\n              </div>\n              <div class="col-md-1 pull-rigth">\n                <button class="btn btn-icon-only green" data-ng-click="addItem(\'field\')"><i class="fa fa-plus"></i></button>\n              </div>\n            </div>\n            <hr>\n						<!-- <div id="field-item-list" ng-scrollbars ng-scrollbars-config="config"> -->\n	            <div class="row" data-ng-repeat="fieldItem in fieldConfig">\n	              <div class="col-md-3">\n	                <ui-select ng-model="fieldItem.idField" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeFieldType(fieldItem)">\n	                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.title}}</ui-select-match>\n	                  <ui-select-choices repeat="item.id as item in accountFields | filter: $select.search">\n	                    <div ng-bind-html="item.title | highlight: $select.search"></div>\n	                  </ui-select-choices>\n	                </ui-select>\n	              </div>\n	              <div class="col-md-8" data-ng-if="getSystemFieldOptions(fieldItem.idField)">\n	                <div class="form-group">\n										<ui-select ng-model="fieldItem.content" theme="bootstrap" ng-disabled="disabled" data-ng-change="updateField(fieldItem)">\n		                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n		                  <ui-select-choices repeat="item.value as item in getSystemFieldOptions(fieldItem.idField) | filter: $select.search">\n		                    <div ng-bind-html="item.name | highlight: $select.search"></div>\n		                  </ui-select-choices>\n		                </ui-select>\n	                </div>\n	              </div>\n								<div class="col-md-4" data-ng-if="!getSystemFieldOptions(fieldItem.idField)">\n									<div class="form-group">\n										<ui-select ng-model="fieldItem.type" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeType(fieldItem)">\n		                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.title}}</ui-select-match>\n		                  <ui-select-choices repeat="item.type as item in fieldType | filter: $select.search">\n		                    <div ng-bind-html="item.title | highlight: $select.search | ucfirst"></div>\n		                  </ui-select-choices>\n		                </ui-select>\n									</div>\n								</div>\n								<div class="col-md-4" data-ng-if="!getSystemFieldOptions(fieldItem.idField) && fieldItem.type === \'string\'">\n	                <div class="form-group">\n										<input type="text" class="form-control" data-ng-model="fieldItem.content" data-ng-change="updateField(fieldItem)">\n	                </div>\n	              </div>\n								<div class="col-md-4" data-ng-if="!getSystemFieldOptions(fieldItem.idField) && fieldItem.type === \'variable\'">\n	                <div class="form-group">\n										<ui-select theme="bootstrap" ng-disabled="disabled" data-ng-model="fieldItem.variableName" data-ng-change="updateField(fieldItem)">\n	                    <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.title}}</ui-select-match>\n	                    <ui-select-choices group-by="groupVariableByGroup" repeat="variable.name as variable in variables | filter: $select.search">\n	                      <div ng-bind-html="variable.title | highlight: $select.search"></div>\n	                    </ui-select-choices>\n	                  </ui-select>\n	                </div>\n	              </div>\n								<div class="col-md-4" data-ng-if="!getSystemFieldOptions(fieldItem.idField) && fieldItem.type === \'customVariable\'">\n	                <div class="form-group">\n										<ui-select theme="bootstrap" ng-disabled="disabled" data-ng-model="fieldItem.VariableId" data-ng-change="updateField(fieldItem)">\n	                    <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n	                    <ui-select-choices repeat="variable.id as variable in customVariables | filter: $select.search">\n	                      <div ng-bind-html="variable.name | highlight: $select.search"></div>\n	                    </ui-select-choices>\n	                  </ui-select>\n	                </div>\n	              </div>\n	              <div class="col-md-1">\n	                <div class="form-group">\n	                  <button class="btn btn-icon-only red" data-ng-click="removeItem(fieldItem)"><i class="fa fa-times"></i></button>\n	                </div>\n	              </div>\n	            </div>\n						<!-- </div> -->\n					</div>\n					<!-- END FIELDS TAB -->\n					<!-- TAG TAB -->\n					<div class="tab-pane ui-padding" id="tab_1_4">\n						<div class="row">\n              <div class="col-md-12">\n                <span class="caption-subject">Select tags that you want add in the ticket:</span>\n              </div>\n            </div>\n            <hr>\n						<form name="forms.tags" data-ng-submit="updateTags()" novalidate>\n							<!-- TAG -->\n							<div class="form-group">\n								<ui-select multiple data-ng-model="selectedTags.tags" theme="bootstrap" name="tags" ng-disabled="disabled">\n									<ui-select-match placeholder="{{ \'APPLICATION_TAGS\' | translate }}">{{$item.name}}</ui-select-match>\n									<ui-select-choices repeat="tag.id as tag in tags | filter: $select.search">\n										{{tag.name}}\n									</ui-select-choices>\n								</ui-select>\n							</div>\n							<!-- END TAG -->\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END TAG TAB -->\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/zendesk/view/view.account.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_ACCOUNT\' | translate}}</span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{\'APPLICATION_GENERALS\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.formSetting" data-ng-submit="forms.formSetting.$valid && updateItem()" novalidate>\n              <!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="account.name" required/>\n								<span data-ng-show="forms.formSetting.name.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="account.description"/>\n							</div>\n							<!-- END DESCRIPTION -->\n\n              <!-- START USERNAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.username.$invalid}">\n								<label class="control-label">{{\'APPLICATION_USERNAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="username" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="account.username" required/>\n								<span data-ng-show="forms.formSetting.username.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END USERNAME -->\n\n              <!-- START REMOTE ADDRESS -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.remoteUri.$invalid}">\n								<label class="control-label">{{\'APPLICATION_REMOTE_ADDRESS\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="url" name="remoteUri" placeholder="{{\'APPLICATION_REMOTE_ADDRESS\' | translate}}" class="form-control" data-ng-model="account.remoteUri" required />\n								<span data-ng-show="forms.formSetting.remoteUri.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END USERNAME -->\n\n							<!-- START AUTH TYPE -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.authType.$invalid}">\n								<label class="control-label">{{\'APPLICATION_AUTHENTICATION_TYPE\' | translate}}</label>\n								<ui-select data-ng-model="account.authType" name="authType" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_AUTHENTICATION_TYPE\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n									<ui-select-choices repeat="type in [\'password\', \'token\'] | filter: $select.search">\n										<div data-ng-bind="type | capitalize | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span data-ng-show="forms.formSetting.authType.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- START AUTH TYPE -->\n\n              <!-- START PASSWORD -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.password.$invalid}" ng-slide-down="account.authType == \'password\'" lazy-render duration="1">\n								<label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="password" name="password" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="account.password" required/>\n								<span data-ng-show="forms.formSetting.password.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END PASSWORD -->\n\n              <!-- START TOKEN -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.token.$invalid}" ng-slide-down="account.authType == \'token\'" lazy-render duration="1">\n								<label class="control-label">{{\'APPLICATION_TOKEN\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="token" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="account.token" required/>\n								<span data-ng-show="forms.formSetting.token.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END TOKEN -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END GENERAL TAB -->\n\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/zendesk/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initView()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n          <i class="icon-handbag"></i>\n          <a href="/zendesk/list">{{ \'APPLICATION_ZENDESK\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<a href="#">{{account.name}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img src="assets/images/media/zendesk.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{account.name}}\n					</div>\n					<div class="profile-usertitle-job">\n						{{account.remoteUri}}\n					</div>\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.zendesk.view.account\')}">\n							<a ng-href="/zendesk/view/{{account.id}}/account">\n							<i class="icon-user"></i>\n							{{ \'APPLICATION_ACCOUNT\' | translate }} </a>\n						</li>\n						<li data-ng-class="{active: $state.includes(\'main.zendesk.view.configurations\') || $state.is(\'main.zendesk.view.configuration\')}">\n							<a ng-href="/zendesk/view/{{account.id}}/configurations/list">\n							<i class="icon-settings"></i>\n							{{ \'APPLICATION_CONFIGURATIONS\' | translate }} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/zendesk/wizard/wizard.html",'<!-- BEGIN PAGE HEADER-->\n<div class="row">\n	<div class="col-md-12">\n			<div class="page-bar">\n				<ul class="page-breadcrumb">\n					<li>\n						<i class="icon-rocket"></i>\n						<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-handbag"></i>\n						<a href="/zendesk/list">{{ \'APPLICATION_ZENDESK\' | translate }}</a>\n					</li>\n				</ul>\n			</div>\n		</div>\n</div>\n<!-- END PAGE HEADER-->\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initWizard()">\n	<div class="col-md-12">\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-notebook font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_ACCOUNT\' | translate }} WIZARD</a> </span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<wizard on-finish="createItem()">\n          <wz-step title="{{\'APPLICATION_ACCOUNT_INFO\' | translate}}" canexit="exitValidation(forms.formSetting.$valid)">\n						<form name="forms.formSetting" novalidate>\n\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n								<span data-ng-show="forms.formSetting.name.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"/>\n							</div>\n							<!-- END DESCRIPTION -->\n\n              <!-- START USERNAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.username.$invalid}">\n								<label class="control-label">{{\'APPLICATION_USERNAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="username" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.username" required ng-remote-validate="/api/zendesk/accounts/validate/username"/>\n								<span data-ng-show="forms.formSetting.username.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n								<span data-ng-show="(forms.formSetting.username.$touched || forms.formSetting.$submitted) && forms.formSetting.username.$error.ngRemoteValidate" class="help-block help-block-error">\n				          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_EXIST_USERNAME\' | translate}}.\n				        </span>\n							</div>\n							<!-- END USERNAME -->\n\n              <!-- START REMOTE ADDRESS -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.remoteUri.$invalid}">\n								<label class="control-label">{{\'APPLICATION_REMOTE_ADDRESS\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="url" name="remoteUri" placeholder="{{\'APPLICATION_REMOTE_ADDRESS\' | translate}}" class="form-control" data-ng-model="item.remoteUri" required ng-remote-validate="/api/zendesk/accounts/validate/remoteUri"/>\n								<span data-ng-show="forms.formSetting.remoteUri.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n								<span data-ng-show="(forms.formSetting.remoteUri.$touched || forms.formSetting.$submitted) && forms.formSetting.remoteUri.$error.ngRemoteValidate" class="help-block help-block-error">\n				          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_EXIST_DOMAIN\' | translate}}.\n				        </span>\n							</div>\n							<!-- END USERNAME -->\n\n							<!-- START AUTH TYPE -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.authType.$invalid}">\n								<label class="control-label">{{\'APPLICATION_AUTHENTICATION_TYPE\' | translate}}</label>\n								<ui-select data-ng-model="item.authType" name="authType" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_AUTHENTICATION_TYPE\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n									<ui-select-choices repeat="type in [\'password\', \'token\'] | filter: $select.search">\n										<div data-ng-bind="type | capitalize | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span data-ng-show="forms.formSetting.authType.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- START AUTH TYPE -->\n\n              <!-- START PASSWORD -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.password.$invalid}" ng-slide-down="item.authType == \'password\'" lazy-render duration="1">\n								<label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="password" name="password" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.password" required/>\n								<span data-ng-show="forms.formSetting.password.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END PASSWORD -->\n\n              <!-- START TOKEN -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.token.$invalid}" ng-slide-down="item.authType == \'token\'" lazy-render duration="1">\n								<label class="control-label">{{\'APPLICATION_TOKEN\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="token" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.token" required/>\n								<span data-ng-show="forms.formSetting.token.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END TOKEN -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" data-ng-click="next()"/>\n\n						</form>\n					</wz-step>\n\n					<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n						<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n						<input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n					</wz-step>\n\n				</wizard>\n\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),
+a.put("components/footer/footer.html",'<!-- BEGIN FOOTER -->\n<div class="page-footer" data-ng-init="initFooter()">\n  <div class="page-footer-inner">\n     xCALLY Motion v. {{info.version}} | {{year}} - {{year + 1}} &copy; Powered by Xenialab\n  </div>\n  <div class="scroll-to-top">\n    <i class="icon-arrow-up"></i>\n  </div>\n</div>\n<!-- END FOOTER -->\n'),a.put("components/header/header.html",'<!-- BEGIN HEADER INNER -->\n<div class="page-header-inner" data-ng-init="initHeader()">\n  <!-- BEGIN LOGO -->\n  <div class="page-logo">\n    <a href="/">\n      <img src="assets/images/logo.png" alt="logo" class="logo-default"/>\n    </a>\n    <div class="menu-toggler sidebar-toggler" data-ng-click="toogleSidebar()">\n      <!-- DOC: Remove the above "hide" to enable the sidebar toggler button on header -->\n    </div>\n  </div>\n  <!-- END LOGO -->\n  <!-- BEGIN HEADER SEARCH BOX -->\n  <!-- DOC: Apply "search-form-expanded" right after the "search-form" class to have half expanded search box -->\n  <form class="search-form hide" action="extra_search.html" method="GET">\n    <div class="input-group">\n      <input type="text" class="form-control" placeholder="Search..." name="query">\n      <span class="input-group-btn">\n        <a href="javascript:;" class="btn submit"><i class="icon-magnifier"></i></a>\n      </span>\n    </div>\n  </form>\n  <!-- END HEADER SEARCH BOX -->\n  <!-- BEGIN RESPONSIVE MENU TOGGLER -->\n  <a href="javascript:;" class="menu-toggler responsive-toggler" data-toggle="collapse" data-target=".navbar-collapse">\n  </a>\n  <!-- END RESPONSIVE MENU TOGGLER -->\n  <!-- BEGIN TOP NAVIGATION MENU -->\n  <div class="top-menu">\n    <ul class="nav navbar-nav pull-right">\n      <!-- BEGIN LANGUAGE BAR -->\n      <!-- DOC: Apply "dropdown-dark" class after below "dropdown-extended" to change the dropdown styte -->\n      <li class="dropdown dropdown-language">\n        <a href="#" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-close-others="true">\n          <img ng-src="assets/images/flags/{{ language }}.png">\n          <i class="fa fa-angle-down"></i>\n        </a>\n        <ul class="dropdown-menu dropdown-menu-default">\n          <li>\n            <a href="#" ng-click="changeLanguage(\'ar\')">\n              <img alt="" src="assets/images/flags/ar.png"> {{\'APPLICATION_ARABIC\' | translate}}\n            </a>\n          </li>\n          <li>\n            <a href="#" ng-click="changeLanguage(\'de\')">\n              <img alt="" src="assets/images/flags/de.png"> {{\'APPLICATION_GERMAN\' | translate}}\n            </a>\n          </li>\n          <li>\n            <a href="#" ng-click="changeLanguage(\'en_EN\')">\n              <img alt="" src="assets/images/flags/en_EN.png"> {{\'APPLICATION_ENGLISH\' | translate}}\n            </a>\n          </li>\n          <li>\n            <a href="#" ng-click="changeLanguage(\'es\')">\n              <img alt="" src="assets/images/flags/es.png"> {{\'APPLICATION_SPANISH\' | translate}}\n            </a>\n          </li>\n          <li>\n            <a href="#" ng-click="changeLanguage(\'fr\')">\n              <img alt="" src="assets/images/flags/fr.png"> {{\'APPLICATION_FRENCH\' | translate}}\n            </a>\n          </li>\n          <li>\n            <a href="#" ng-click="changeLanguage(\'it\')">\n              <img alt="" src="assets/images/flags/it.png"> {{\'APPLICATION_ITALIAN\' | translate}}\n            </a>\n          </li>\n          <li>\n            <a href="#" ng-click="changeLanguage(\'ja\')">\n              <img alt="" src="assets/images/flags/ja.png"> {{\'APPLICATION_JAPANASE\' | translate}}\n            </a>\n          </li>\n          <li>\n            <a href="#" ng-click="changeLanguage(\'ko\')">\n              <img alt="" src="assets/images/flags/ko.png"> {{\'APPLICATION_KOREAN\' | translate}}\n            </a>\n          </li>\n          <li>\n            <a href="#" ng-click="changeLanguage(\'pt\')">\n              <img alt="" src="assets/images/flags/pt.png"> {{\'APPLICATION_PORTUGUESE\' | translate}}\n            </a>\n          </li>\n          <li>\n            <a href="#" ng-click="changeLanguage(\'ru\')">\n              <img alt="" src="assets/images/flags/ru.png"> {{\'APPLICATION_RUSSIAN\' | translate}}\n            </a>\n          </li>\n          <li>\n            <a href="#" ng-click="changeLanguage(\'sv\')">\n              <img alt="" src="assets/images/flags/sv.png"> {{\'APPLICATION_SWEDISH\' | translate}}\n            </a>\n          </li>\n          <li>\n            <a href="#" ng-click="changeLanguage(\'zh-CN\')">\n              <img alt="" src="assets/images/flags/zh-CN.png"> {{\'APPLICATION_CHINESE_SIMPLIFIED\' | translate}}\n            </a>\n          </li>\n          <li>\n            <a href="#" ng-click="changeLanguage(\'zh-TW\')">\n              <img alt="" src="assets/images/flags/zh-TW.png"> {{\'APPLICATION_CHINESE_TRADITIONAL\' | translate}}\n            </a>\n          </li>\n        </ul>\n      </li>\n      <!-- END LANGUAGE BAR -->\n      <!-- BEGIN USER LOGIN DROPDOWN -->\n      <!-- DOC: Apply "dropdown-dark" class after below "dropdown-extended" to change the dropdown styte -->\n      <li class="dropdown dropdown-user">\n        <a href="#" class="dropdown-toggle" dropdown-menu-hover data-toggle="dropdown" data-close-others="true">\n          <img class="img-circle" data-ng-src="api/users/avatar/{{getCurrentUser().userpic || \'unknown_avatar\'}}" alt="...">\n          <span class="username username-hide-on-mobile">\n            {{ getCurrentUser().fullname }}\n          </span>\n          <i class="fa fa-angle-down"></i>\n        </a>\n        <ul class="dropdown-menu dropdown-menu-default">\n          <li>\n            <a ng-href=" {{isAdmin() ? \'/staff/users/view/\'+getCurrentUser().id+\'/account\' : \'/staff/agents/view/\'+getCurrentUser().id+\'/account\'}}">\n              <i class="icon-key"></i>{{\'APPLICATION_CHANGE_PASSWORD\' | translate}}\n            </a>\n          </li>\n          <li data-ng-click="logout()">\n            <a href="#">\n              <i class="icon-logout"></i> Log Out\n            </a>\n          </li>\n        </ul>\n      </li>\n      <!-- END USER LOGIN DROPDOWN -->\n      <!-- BEGIN QUICK SIDEBAR TOGGLER -->\n      <!-- DOC: Apply "dropdown-dark" class after below "dropdown-extended" to change the dropdown styte -->\n      <li class="dropdown dropdown-quick-sidebar-toggler" data-ng-click="toggleQuickSidebar()">\n        <a href="#" class="dropdown-toggle">\n          <i class="icon-logout"></i>\n        </a>\n      </li>\n      <!-- END QUICK SIDEBAR TOGGLER -->\n    </ul>\n  </div>\n  <!-- END TOP NAVIGATION MENU -->\n</div>\n<!-- END HEADER INNER -->\n'),a.put("components/modal/delete.html",'<div class="modal-header">\n  <button ng-if="modal.dismissable" type="button" ng-click="$dismiss()" class="close">&times;</button>\n  <h4 ng-if="modal.title" ng-bind="modal.title" class="modal-title"></h4>\n</div>\n<div class="modal-body">\n  <p ng-if="modal.text" ng-bind="modal.text"></p>\n  <div ng-if="modal.html" ng-bind-html="modal.html"></div>\n</div>\n<div class="modal-footer">\n  <button ng-repeat="button in modal.buttons" ng-class="button.classes" ng-click="button.click($event)" ng-bind="button.text" class="btn"></button>\n</div>\n'),a.put("components/quickSidebar/modal/add.html",'<div class="modal-header">\n  <button ng-if="modal.dismissable" type="button" ng-click="$dismiss()" class="close">&times;</button>\n  <h4 ng-if="modal.title" ng-bind="modal.title | translate" class="modal-title"></h4>\n</div>\n\n<div class="modal-body">\n  <div class="portlet box blue">\n		<div class="portlet-title">\n			<div class="caption">\n				<i class="icon-people"></i>{{\'APPLICATION_SELECTED_AGENTS\' | translate}}\n			</div>\n		</div>\n		<div class="portlet-body">\n			<ul>\n				<li data-ng-repeat="item in items">\n					 {{item.fullname}}\n				</li>\n\n        <li data-ng-repeat="item in selected.items">\n					 {{item.fullname}}\n				</li>\n			</ul>\n		</div>\n	</div>\n\n  <ui-select multiple name="items" ng-model="selected.items" theme="bootstrap">\n    <ui-select-match placeholder="{{\'APPLICATION_SELECTED_AGENTS\' | translate}}">{{$item.fullname}}</ui-select-match>\n    <ui-select-choices repeat="{id: agent.id, fullname: agent.fullname} as agent in agents.rows | filter: $select.search">\n      {{agent.fullname}}\n    </ui-select-choices>\n  </ui-select>\n</div>\n\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" data-ng-click="ok()" data-ng-show="selected.items.length">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" data-ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("components/quickSidebar/modal/close.html",'<div class="modal-header">\n  <button ng-if="modal.dismissable" type="button" ng-click="$dismiss()" class="close">&times;</button>\n  <h4 ng-if="modal.title" ng-bind="modal.title | translate" class="modal-title"></h4>\n</div>\n<div class="modal-body">\n  <p ng-if="modal.text" ng-bind="modal.text | translate"></p>\n  <!-- <div ng-if="modal.html" ng-bind-html="modal.html"></div> -->\n</div>\n<div class="modal-footer">\n  <button class="btn btn-danger" type="button" ng-click="ok()">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n  <!-- <button ng-repeat="button in modal.buttons" ng-class="button.classes" ng-click="button.click($event)" ng-bind="button.text" class="btn"></button> -->\n</div>\n'),a.put("components/quickSidebar/quickSidebar.html",'<div class="page-quick-sidebar">\n  <div class="nav-justified">\n    <ul class="nav nav-tabs nav-justified">\n      <li data-ng-class="{active:currentTab==0}" data-ng-click="goToTab(0)">\n        <a href="#">\n          <i class="icon-people"></i>\n        </a>\n      </li>\n      <li data-ng-class="{active:currentTab==1}" data-ng-click="goToTab(1)">\n        <a href="#">\n        <i class="icon-eye"></i>\n        </a>\n      </li>\n      <li data-ng-class="{active:currentTab==2}" data-ng-click="goToTab(2)">\n        <a href="#">\n        <i class="icon-globe"></i>\n        </a>\n      </li>\n      <li data-ng-class="{active:currentTab==3}" data-ng-click="goToTab(3)">\n        <a href="#">\n        <i class="icon-bubbles"></i>\n        </a>\n      </li>\n    </ul>\n    <div class="tab-content">\n      <div class="tab-pane page-quick-sidebar-chat" ng-class="{active:currentTab==0 && !messagesTab}">\n        <div class="page-quick-sidebar-chat-users" data-rail-color="#ddd" data-wrapper-class="page-quick-sidebar-list" >\n          <div class="quicksidebar-search">\n            <div class="input-group">\n							<input type="search" class="form-control" placeholder="{{\'APPLICATION_SEARCH\' | translate}} {{\'APPLICATION_AGENT\' | translate}}..." ng-model="searchAgent">\n							<span class="input-group-btn">\n							<i class="icon-magnifier"></i>\n							</span>\n						</div>\n          </div>\n          <ul class="media-list list-items" data-ng-style="style" ng-scrollbars>\n            <li class="media animate-repeat" data-ng-repeat="agent in agents.rows | orderBy:\'-online\' | filter:searchAgent as resultsAgent" data-ng-if="agent.id !== currentUser.id">\n              <img class="media-object" data-ng-src="api/users/avatar/{{agent.userpic ? agent.userpic : \'unknown_avatar\'}}" alt="{{agent.fullname}}">\n              <div class="media-body" data-ng-click="goToMessage(agent.id)">\n                <h4 class="media-heading"><span class="item-status">{{agent.fullname | characters:15 :true}} {{agent.internal}}</h4>\n                <div class="media-heading-small">\n                   <span class="badge badge-empty" data-ng-class="agent.online ? \'badge-success\' : \'badge-danger\'"></span></span> {{\'APPLICATION_LAST_SEEN\' | translate | lowercase}} <time is="relative-time" datetime="{{agent.updatedAt}}">April 1, 2014</time>\n                </div>\n              </div>\n            </li>\n            <li class="media animate-repeat" ng-if="agents.rows.length == 0">\n              <div class="media-body" style="text-align: center;">\n                <h4 class="media-heading"><i>{{\'MESSAGE_NO_AGENTS_FOUND\' | translate | lowercase}}</i></h4>\n              </div>\n            </li>\n            <li class="media animate-repeat" ng-if="resultsAgent.length == 0">\n              <div class="media-body" style="text-align: center;">\n                <h4 class="media-heading"><i>{{\'MESSAGE_NO_AGENTS_FOUND\' | translate | lowercase}}</i></h4>\n              </div>\n            </li>\n          </ul>\n        </div>\n      </div>\n      <div class="tab-pane page-quick-sidebar-chat" ng-class="{active:currentTab==1 && !messagesTab}">\n        <div class="page-quick-sidebar-chat-users" data-rail-color="#ddd" data-wrapper-class="page-quick-sidebar-list">\n          <div class="quicksidebar-search">\n            <div class="input-group">\n              <input type="search" class="form-control" placeholder="{{\'APPLICATION_SEARCH\' | translate}} {{\'APPLICATION_USER\' | translate}}..." ng-model="searchUser">\n              <span class="input-group-btn">\n              <i class="icon-magnifier"></i>\n              </span>\n            </div>\n          </div>\n          <ul class="media-list list-items"  data-ng-style="style" ng-scrollbars>\n            <li class="media animate-repeat" data-ng-repeat="user in users.rows | orderBy:\'-online\' | filter:searchUser as resultsUser" data-ng-if="user.id !== currentUser.id">\n              <img class="media-object" data-ng-src="api/users/avatar/{{user.userpic ? user.userpic : \'unknown_avatar\'}}" alt="{{user.fullname}}">\n              <div class="media-body" data-ng-click="goToMessage(user.id)">\n                <h4 class="media-heading">{{user.fullname | characters:15 :true}} {{user.internal}}</h4>\n                <div class="media-heading-small">\n                   <span class="badge badge-empty" data-ng-class="user.online ? \'badge-success\' : \'badge-danger\'"></span> {{\'APPLICATION_LAST_SEEN\' | translate | lowercase}} <time is="relative-time" datetime="{{user.updatedAt}}">April 1, 2014</time>\n                </div>\n              </div>\n            </li>\n            <li class="media animate-repeat" ng-if="users.rows.length == 0">\n              <div class="media-body" style="text-align: center;">\n                <h4 class="media-heading"><i>{{\'MESSAGE_NO_USERS_FOUND\' | translate | lowercase}}</i></h4>\n              </div>\n            </li>\n            <li class="media animate-repeat" ng-if="resultsUser.length == 0">\n              <div class="media-body" style="text-align: center;">\n                <h4 class="media-heading"><i>{{\'MESSAGE_NO_USERS_FOUND\' | translate | lowercase}}</i></h4>\n              </div>\n            </li>\n          </ul>\n        </div>\n      </div>\n      <div class="tab-pane page-quick-sidebar-chat" ng-class="{active:currentTab==2 && !messagesTab}">\n        <div class="page-quick-sidebar-chat-users" data-rail-color="#ddd" data-wrapper-class="page-quick-sidebar-list">\n          <div class="quicksidebar-search">\n            <div class="input-group">\n              <input type="search" class="form-control" placeholder="{{\'APPLICATION_SEARCH\' | translate}} {{\'APPLICATION_CHAT\' | translate}}..." data-ng-model="searchChatRoomsExternals">\n              <span class="input-group-btn">\n              <i class="icon-magnifier"></i>\n              </span>\n            </div>\n          </div>\n          <ul class="media-list list-items"  data-ng-style="style" ng-scrollbars>\n            <li class="media animate-repeat" data-ng-repeat="chatRoom in chatRooms | QuickSidebarFilterUsersLowerThan:2 | filter:{type:\'external\'} | filter:searchChatRoomsExternals as resultsChatRoomsExternals">\n              <div class="media-status">\n                <i class="icon icon-close" data-ng-show="chatRoom.status === \'CLOSED\'"></i>\n              </div>\n              <img class="media-object" data-ng-src="api/users/avatar/{{user.userpic ? user.userpic : \'unknown_avatar\'}}" alt="{{user.fullname}}">\n              <div class="media-body" data-ng-click="goToMessage(null, chatRoom.id)">\n                <h4 class="media-heading">{{chatRoom.ChatVisitor.fullname}}</h4>\n                <div class="media-heading-small">\n                   {{\'APPLICATION_LAST_SEEN\' | translate | lowercase}} <time is="relative-time" datetime="{{chatRoom.createdAt}}">April 1, 2014</time>\n                </div>\n              </div>\n            </li>\n            <li class="media animate-repeat" data-ng-if="resultsChatRoomsExternals.length === 0">\n              <div class="media-body" style="text-align: center;">\n                <h4 class="media-heading"><i>{{\'MESSAGE_NO_CHATS_FOUND\' | translate | lowercase}}</i></h4>\n              </div>\n            </li>\n          </ul>\n        </div>\n      </div>\n      <div class="tab-pane page-quick-sidebar-chat" ng-class="{active:currentTab==3 && !messagesTab}">\n        <div class="page-quick-sidebar-chat-users" data-rail-color="#ddd" data-wrapper-class="page-quick-sidebar-list">\n          <div class="quicksidebar-search">\n            <div class="input-group">\n              <input type="search" class="form-control" placeholder="{{\'APPLICATION_SEARCH\' | translate}} {{\'APPLICATION_GROUP\' | translate}}..." data-ng-model="searchChatRoomsGroups">\n              <span class="input-group-btn">\n              <i class="icon-magnifier"></i>\n              </span>\n            </div>\n          </div>\n          <ul class="media-list list-items"  data-ng-style="style" ng-scrollbars>\n            <li class="media animate-repeat" data-ng-repeat="chatRoom in chatRooms | QuickSidebarFilterUsersGreaterThan:2 | filter:searchChatRoomsGroups as resultsChatRoomsGroups">\n              <img class="media-object" data-ng-src="api/users/avatar/{{user.userpic ? user.userpic : \'unknown_avatar\'}}" alt="{{user.fullname}}">\n              <div class="media-body" data-ng-click="goToMessage(null, chatRoom.id)">\n                <h4 class="media-heading">{{chatRoom.ChatVisitor.fullname}}</h4>\n                <div class="media-heading-small">\n                   {{\'APPLICATION_LAST_SEEN\' | translate | lowercase}} <time is="relative-time" datetime="{{chatRoom.updatedAt}}">April 1, 2014</time>\n                </div>\n                <div class="media-heading-small">\n                  <div data-ng-repeat="user in chatRoom.Users | map: \'fullname\'" class="inline">\n                    {{ $last ? user : user + \', \'}}\n                  </div>\n                </div>\n              </div>\n            </li>\n            <li class="media animate-repeat" data-ng-if="resultsChatRoomsGroups.length === 0">\n              <div class="media-body" style="text-align: center;">\n                <h4 class="media-heading"><i>{{\'MESSAGE_NO_CHATS_FOUND\' | translate | lowercase}}</i></h4>\n              </div>\n            </li>\n          </ul>\n        </div>\n      </div>\n      <div class="tab-pane page-quick-sidebar-chat page-quick-sidebar-content-item-shown" ng-class="{active:messagesTab}">\n        <div class="page-quick-sidebar-chat-users" data-rail-color="#ddd" data-wrapper-class="page-quick-sidebar-list" >\n          <div class="quicksidebar-search">\n            <div class="input-group">\n              <input type="search" class="form-control" placeholder="{{\'APPLICATION_SEARCH\' | translate}} {{\'APPLICATION_CHAT\' | translate}}..." ng-model="searchMessage">\n              <span class="input-group-btn">\n              <i class="icon-magnifier"></i>\n              </span>\n            </div>\n          </div>\n        </div>\n        <div class="page-quick-sidebar-item">\n          <div class="page-quick-sidebar-chat-user" data-wrapper-class="page-quick-sidebar-list">\n            <div class="page-quick-sidebar-nav">\n                <a href="#" class="page-quick-sidebar-back-to-list" data-ng-click="goBack()"><i class="icon-arrow-left"></i>Back</a>\n            </div>\n            <div id="page-quick-sidebar-chat-user-messages" class="page-quick-sidebar-chat-user-messages" data-ng-style="style2" ng-scrollbars>\n              <div class="post animate-repeat" data-ng-repeat="chatMessage in chatRoom.ChatMessages | filter:searchMessage as resultsMessage" data-ng-class="chatMessage.UserId === currentUser.id ? \'in\' : \'out\'">\n                <img class="avatar" alt="" ng-src="api/users/avatar/unknown_avatar"/>\n                <div class="message">\n                  <span class="arrow"></span>\n                  <a href="#" class="name">{{chatMessage.User.fullname || chatMessage.ChatVisitor .fullname}}</a> -\n                  <span class="datetime">\n                    <time is="relative-time" datetime="{{chatMessage.createdAt}}">\n                      April 1, 2014\n                    </time>\n                  </span>\n                  <ng-emoticons class="body" emoticons-data="chatMessage.body" emoticons-options="options"/>\n                </div>\n              </div>\n\n              <div class="media-body" style="text-align: center;" data-ng-if="resultsMessage.length == 0">\n                <h5 class="media-heading"><i>{{\'MESSAGE_NO_MESSAGES_FOUND\' | translate | lowercase}}</i></h5>\n              </div>\n\n              <div class="media-body" style="text-align: center;" data-ng-if="chatRoom.status === \'CLOSED\'">\n                <h5 class="media-heading"><i>{{\'MESSAGE_CHAT_CLOSED\' | translate | lowercase}}</i></h5>\n              </div>\n\n            </div>\n            <div class="page-quick-sidebar-chat-user-form">\n              <textarea rows="3" class="form-control" style="border:none;resize: none;" placeholder="Type a message here..." ng-enter="sendMessage()" data-ng-model="message.body" data-ng-disabled="chatRoom.status === \'CLOSED\'"></textarea>\n              <div class="btn-group" style="width:100%;background-color:white">\n                <button type="button" class="btn btn-default" style="border:none" data-ng-disabled="chatRoom.status === \'CLOSED\'" data-ng-click="addAgent(chatRoom.id)"><i class="icon-plus font-blue"></i></button>\n                <button type="button" class="btn btn-default pull-right" style="border:none" data-ng-disabled="chatRoom.status === \'CLOSED\'" data-ng-click="closeChatRoom(chatRoom.id)" data-ng-show="chatRoom.type === \'external\'"><i class="icon-close font-red"></i></button>\n              </div>\n            </div>\n          </div>\n        </div>\n      </div>\n    </div>\n  </div>\n</div>\n'),a.put("components/sidebar/sidebar.html",'<div id="page-sidebar" class="page-sidebar navbar-collapse collapse">\n  <!-- BEGIN SIDEBAR MENU -->\n  <!-- DOC: Apply "page-sidebar-menu-light" class right after "page-sidebar-menu" to enable light sidebar menu style(without borders) -->\n  <!-- DOC: Apply "page-sidebar-menu-hover-submenu" class right after "page-sidebar-menu" to enable hoverable(hover vs accordion) sub menu mode -->\n  <!-- DOC: Apply "page-sidebar-menu-closed" class right after "page-sidebar-menu" to collapse("page-sidebar-closed" class must be applied to the body element) the sidebar sub menu mode -->\n  <!-- DOC: Set data-auto-scroll="false" to disable the sidebar from auto scrolling/focusing -->\n  <!-- DOC: Set data-keep-expand="true" to keep the submenues expanded -->\n  <!-- DOC: Set data-auto-speed="200" to adjust the sub menu slide up/down speed -->\n  <ul data-ng-click="mainTab.active=true" class="page-sidebar-menu" data-keep-expanded="false" data-auto-scroll="true" data-slide-speed="200" data-ng-class="{\'page-sidebar-menu-closed\': settings.layout.pageSidebarClosed}" data-ng-init="getSidebarIntegrations()">\n    <!-- DOC: To remove the search box from the sidebar you just need to completely remove the below "sidebar-search-wrapper" LI element -->\n    <li class="sidebar-search-wrapper">\n      <!-- BEGIN RESPONSIVE QUICK SEARCH FORM -->\n      <!-- DOC: Apply "sidebar-search-bordered" class the below search form to have bordered search box -->\n      <!-- DOC: Apply "sidebar-search-bordered sidebar-search-solid" class the below search form to have bordered & solid search box -->\n      <form class="sidebar-search sidebar-search-bordered" action="extra_search.html" method="POST">\n        <a href="javascript:;" class="remove">\n          <i class="icon-close"></i>\n        </a>\n      </form>\n      <!-- END RESPONSIVE QUICK SEARCH FORM -->\n    </li>\n\n    <!-- START DASHBOARD CASE -->\n    <li class="start" data-ng-class="{active: $state.includes(\'main.dashboard\')}">\n      <a href="/dashboard/channels/voice">\n        <i class="icon-rocket"></i>\n        <span class="title">{{\'APPLICATION_DASHBOARD\' | translate}}</span>\n        <span data-ng-show="$state.includes(\'main.dashboard\')" class="selected"></span>\n      </a>\n    </li>\n    <!-- END DASHBOARD CASE -->\n\n    <!-- START YOURDASHBOARD LIST CASE -->\n    <li data-ng-class="{active: $state.is(\'main.tools.yourdashboards.show\')}" data-ng-show="Auth.isAdmin()">\n      <a href="javascript:;">\n        <i class="icon-screen-desktop"></i>\n        <span class="title" >{{\'APPLICATION_YOUR_DASHBOARDS\' | translate}}</span>\n        <span class="arrow" data-ng-class="{ open: $state.includes(\'main.tools.yourdashboards.show\') }"></span>\n      </a>\n      <ul class="sub-menu" data-ng-init="getSidebarDashboards()">\n        <li data-ng-class="{active: $stateParams.id == dashboard.id && $state.includes(\'main.tools.yourdashboards.show\')}" data-ng-repeat="dashboard in dashboards" data-ng-show="dashboard[Auth.getRole()] && dashboard.visible">\n          <a href="/tools/yourdashboards/show/{{dashboard.id}}" >\n            <i class="icon-screen-tablet"></i>\n            <span class="title" >{{dashboard.name}}  </span>\n          </a>\n        </li>\n      </ul>\n    </li>\n    <!-- END YOURDASHBOARD LIST CASE -->\n\n    <!-- START STAFF LIST CASE -->\n    <li data-ng-class="{active: $state.includes(\'main.staff\')}" data-ng-show="Auth.isAdmin()">\n      <a href="javascript:;">\n        <i class="icon-puzzle"></i>\n        <span class="title" >{{\'APPLICATION_STAFF\' | translate}}</span>\n        <span class="arrow" data-ng-class="{open: $state.includes(\'main.staff\')}"></span>\n      </a>\n      <ul class="sub-menu">\n        <!-- START USERS CASE -->\n        <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.staff.users\')}">\n          <a href="/staff/users/list">\n            <i class="icon-eye"></i>\n            <span class="title" >{{\'APPLICATION_USERS\' | translate}}</span>\n            <span data-ng-show="$state.includes(\'main.staff.users\')" class="selected"></span>\n          </a>\n        </li>\n        <!-- END USERS CASE -->\n\n        <!-- START AGENTS CASE -->\n        <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.staff.agents\')}">\n          <a href="/staff/agents/list">\n            <i class="icon-people"></i>\n            <span class="title" >{{\'APPLICATION_AGENTS\' | translate}}</span>\n            <span data-ng-show="$state.includes(\'main.staff.agents\')" class="selected"></span>\n          </a>\n        </li>\n        <!-- END AGENTS CASE -->\n\n        <!-- START AGENTS CASE -->\n        <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.staff.telephones\')}">\n          <a href="/staff/telephones/list">\n            <i class="icon-phone"></i>\n            <span class="title" >{{\'APPLICATION_TELEPHONES\' | translate}}</span>\n            <span data-ng-show="$state.includes(\'main.staff.telephones\')" class="selected"></span>\n          </a>\n        </li>\n        <!-- END AGENTS CASE -->\n\n        <!-- START TEAMS CASE -->\n        <li data-ng-class="{active: $state.includes(\'main.staff.teams\')}">\n          <a href="/staff/teams/list">\n            <i class="icon-shield"></i>\n            <span class="title" >{{\'APPLICATION_TEAMS\' | translate}}</span>\n            <span data-ng-show="$state.includes(\'main.staff.teams\')" class="selected"></span>\n          </a>\n        </li>\n        <!-- END TEAMS CASE -->\n      </ul>\n    </li>\n    <!-- END STAFF LIST CASE -->\n\n    <!-- START CONTACT MANAGER LIST CASE -->\n    <li data-ng-class="{active: $state.includes(\'main.contactmanager.contacts\')\n    || $state.includes(\'main.contactmanager.companies\')\n    || $state.includes(\'main.contactmanager.services\')}" data-ng-show="Auth.isAdmin()">\n    <a href="javascript:;">\n      <i class="icon-notebook"></i>\n      <span class="title" >{{\'APPLICATION_CONTACT_MANAGER\' | translate}}</span>\n      <span class="arrow" data-ng-class="{ open: $state.includes(\'main.contactmanager.contacts\')\n      || $state.includes(\'main.contactmanager.companies\')\n      || $state.includes(\'main.contactmanager.services\') }"></span>\n    </a>\n    <ul class="sub-menu">\n      <!-- START CONTACTS CASE -->\n      <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.contactmanager.contacts\')}">\n        <a href="/contactmanager/contacts/list">\n          <i class=" fa fa-users"></i>\n          <span class="title" >{{\'APPLICATION_CONTACTS\' | translate}}</span>\n          <span data-ng-show="$state.includes(\'main.contactmanager.contacts\')" class="selected"></span>\n        </a>\n      </li>\n      <!-- END CONTACTS CASE -->\n      <!-- START COMPANIES CASE -->\n      <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.contactmanager.companies\')}">\n        <a href="/contactmanager/companies/list">\n          <i class="icon-briefcase"></i>\n          <span class="title" >{{\'APPLICATION_COMPANIES\' | translate}}</span>\n          <span data-ng-show="$state.includes(\'main.contactmanager.companies\')" class="selected"></span>\n        </a>\n      </li>\n      <!-- END COMPANIES CASE -->\n      <!-- START SERVICES CASE -->\n      <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.contactmanager.services\')}">\n        <a href="/contactmanager/services/list">\n          <i class="fa fa-tty"></i>\n          <span class="title" >{{\'APPLICATION_SERVICES\' | translate}}</span>\n          <span data-ng-show="$state.includes(\'main.contactmanager.services\')" class="selected"></span>\n        </a>\n      </li>\n      <!-- END SERVICES CASE -->\n    </ul>\n  </li>\n  <!-- END CONTACT MANAGER LIST CASE -->\n\n  <!-- START CHANNEL LIST CASE -->\n  <li data-ng-class="{active: $state.includes(\'main.channels\')}">\n    <a href="javascript:;">\n      <i class="icon-directions"></i>\n      <span class="title" >{{\'APPLICATION_CHANNELS\' | translate}}</span>\n      <span class="arrow" data-ng-class="{open: $state.includes(\'main.channels\')}"></span>\n    </a>\n    <ul class="sub-menu">\n      <!-- START VOICE CASE -->\n      <li data-ng-show="Auth.isAdmin()" data-ng-class="{ active: $state.includes(\'main.channels.voice\') }">\n        <a href="javascript:;">\n          <i class="icon-earphones-alt"></i>\n          <span class="title">{{ \'APPLICATION_VOICE\' | translate}}</span>\n          <span class="arrow" data-ng-class="{ open: $state.includes(\'main.channels.voice\') }"></span>\n        </a>\n\n        <ul class="sub-menu">\n          <li data-ng-class="{active: $state.includes(\'main.channels.voice.queues\')}">\n            <a href="/channels/voice/queues/list">\n              <i class="icon-docs"></i>\n              <span class="title">{{\'APPLICATION_QUEUES\' | translate}}</span>\n            </a>\n          </li>\n          <li>\n            <a href="javascript:;">\n              <i class="icon-directions"></i>\n              <span class="title"> {{ \'APPLICATION_ROUTES\' | translate}} </span>\n              <span class="arrow" data-ng-class="{ open: $state.includes(\'main.channels.voice.routes\') }"></span>\n              <ul class="sub-menu">\n                <li data-ng-class="{active: $state.includes(\'main.channels.voice.routes.inbound\')}">\n                  <a href="/channels/voice/routes/inbound/list">\n                    <i class="icon-call-in"></i>\n                    <span class="title"> {{\'APPLICATION_INBOUND\' | translate}} </span>\n                  </a>\n                </li>\n                <li data-ng-class="{active: $state.includes(\'main.channels.voice.routes.outbound\')}">\n                  <a href="/channels/voice/routes/outbound/list">\n                    <i class="icon-call-out"></i>\n                    <span class="title"> {{\'APPLICATION_OUTBOUND\' | translate}} </span>\n                  </a>\n                </li>\n                <li data-ng-class="{active: $state.includes(\'main.channels.voice.routes.internal\')}">\n                  <a href="/channels/voice/routes/internal/list">\n                    <i class="icon-reload"></i>\n                    <span class="title"> {{\'APPLICATION_INTERNALS\' | translate}} </span>\n                  </a>\n                </li>\n              </ul>\n            </a>\n          </li>\n          <li data-ng-class="{active: $state.includes(\'main.channels.voice.contexts\')}">\n            <a href="/channels/voice/contexts/list">\n              <i class="icon-docs"></i>\n              <span class="title"> {{\'APPLICATION_CONTEXTS\' | translate}} </span>\n            </a>\n          </li>\n          <li data-ng-class="{active: $state.includes(\'main.channels.voice.voicemails\')}">\n            <a href="/channels/voice/voicemails/list">\n              <i class="icon-envelope-letter"></i>\n              <span class="title"> {{\'APPLICATION_VOICEMAILS\' | translate}} </span>\n            </a>\n          </li>\n          <li data-ng-class="{active: $state.includes(\'main.channels.voice.mohs\')}">\n            <a href="/channels/voice/mohs/list">\n              <i class="icon-music-tone"></i>\n              <span class="title"> {{\'APPLICATION_MOH\' | translate}} </span>\n            </a>\n          </li>\n          <!-- START RECORDING CASE -->\n          <li data-ng-class="{active: $state.includes(\'main.channels.voice.recordings\')}">\n            <a href="/channels/voice/recordings/list">\n              <i class="icon-control-play"></i>\n              <span class="title">{{\'APPLICATION_RECORDINGS\' | translate}}</span>\n            </a>\n          </li>\n          <!-- END RECORDING CASE -->\n          <!-- START REALTIME CASE -->\n          <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.channels.voice.realtime\')}">\n            <a href="/channels/voice/realtime/view/agents">\n              <i class="icon-energy"></i>\n              <span class="title">{{\'APPLICATION_REALTIME\' | translate}}</span>\n            </a>\n          </li>\n          <!-- END REALTIME CASE -->\n          <!-- START CHANSPY CASE -->\n          <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.channels.voice.chanspy\')}">\n            <a href="/channels/voice/chanspy/list">\n              <i class="icon-magnifier"></i>\n              <span class="title" >{{\'APPLICATION_CHANSPY\' | translate}}</span>\n              <!-- <span data-ng-show="$state.includes(\'main.chanspy\')" class="selected"></span> -->\n            </a>\n          </li>\n          <!-- END CHANSPY CASE -->\n        </ul>\n      </li>\n      <!-- END VOICE CASE -->\n\n      <!-- START CHAT CASE -->\n      <li data-ng-class="{active: $state.includes(\'main.channels.chat\')}" data-ng-if="license.chat && Auth.isAdmin()">\n        <a href="javascript:;">\n          <i class="icon-bubble"></i>\n          <span class="title">{{\'APPLICATION_CHAT\' | translate}}</span>\n          <span class="arrow" data-ng-class="{open: $state.includes(\'main.channels.chat\')}"></span>\n        </a>\n        <ul class="sub-menu">\n          <li data-ng-class="{active: $state.includes(\'main.channels.chat.websites\')}">\n            <a href="/channels/chat/websites/list">\n              <i class="icon-globe"></i>\n              <span class="title"> {{\'APPLICATION_WEB_SITES\' | translate}} </span>\n            </a>\n          </li>\n          <li data-ng-class="{active: $state.includes(\'main.channels.chat.queues\')}">\n            <a href="/channels/chat/queues/list">\n              <i class="icon-docs"></i>\n              <span class="title"> {{\'APPLICATION_QUEUES\' | translate}} </span>\n            </a>\n          </li>\n          <li data-ng-class="{active: $state.includes(\'main.channels.chat.online\')}">\n            <a href="/channels/chat/online/list">\n              <i class="icon-login"></i>\n              <span class="title"> {{\'APPLICATION_ONLINE_MESSAGES\' | translate}} </span>\n            </a>\n          </li>\n          <li data-ng-class="{active: $state.includes(\'main.channels.chat.offline\')}">\n            <a href="/channels/chat/offline/list">\n              <i class="icon-logout"></i>\n              <span class="title"> {{\'APPLICATION_OFFLINE_MESSAGES\' | translate}} </span>\n            </a>\n          </li>\n          <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.channels.chat.realtime\')}">\n            <a href="/channels/chat/realtime/view/agents">\n              <i class="icon-energy"></i>\n              <span class="title">{{\'APPLICATION_REALTIME\' | translate}}</span>\n            </a>\n          </li>\n        </ul>\n      </li>\n      <!-- END CHAT CASE -->\n\n      <!-- START MAIL CASE -->\n      <li data-ng-class="{active: $state.includes(\'main.channels.mail\')}" data-ng-if="license.mail">\n        <a href="javascript:;">\n          <i class="icon-envelope"></i>\n          <span class="title">{{\'APPLICATION_MAIL\' | translate}}</span>\n          <span class="arrow" data-ng-class="{ open: $state.includes(\'main.channels.mail\') }"></span>\n        </a>\n\n        <ul class="sub-menu">\n          <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.channels.mail.accounts\') || $state.includes(\'main.channels.mail.account\')}">\n            <a href="/channels/mail/accounts/list">\n              <i class="icon-notebook"></i>\n              <span class="title"> {{\'APPLICATION_ACCOUNTS\' | translate}} </span>\n            </a>\n          </li>\n          <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.channels.mail.queues\') || $state.includes(\'main.channels.mail.queue\')}">\n            <a href="/channels/mail/queues/list">\n              <i class="icon-docs"></i>\n              <span class="title"> {{\'APPLICATION_QUEUES\' | translate}} </span>\n            </a>\n          </li>\n          <li data-ng-class="{active: $state.includes(\'main.channels.mail.inbox\')}">\n            <a href="/channels/mail/inbox/list">\n              <i class="icon-note"></i>\n              <span class="title"> {{\'APPLICATION_INBOX\' | translate}} </span>\n            </a>\n          </li>\n          <!-- START REALTIME CASE -->\n          <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.channels.mail.realtime\')}">\n            <a href="/channels/mail/realtime/view/agents">\n              <i class="icon-energy"></i>\n              <span class="title">{{\'APPLICATION_REALTIME\' | translate}}</span>\n            </a>\n          </li>\n          <!-- END REALTIME CASE -->\n        </ul>\n      </li>\n      <!-- END MAIL CASE -->\n\n      <!-- START FAX CASE -->\n      <li data-ng-class="{active: $state.includes(\'main.channels.fax\')}" data-ng-if="license.fax">\n        <a href="javascript:;">\n          <i class="icon-paper-plane"></i>\n          <span class="title"> {{ \'APPLICATION_FAX\' | translate}}</span>\n          <span class="arrow" data-ng-class="{ open: $state.includes(\'main.channels.fax\') }"></span>\n        </a>\n        <ul class="sub-menu">\n          <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.channels.fax.accounts\')}">\n            <a href="/channels/fax/accounts/list">\n              <i class="icon-notebook"></i>\n              <span class="title"> {{ \'APPLICATION_ACCOUNTS\' | translate}} </span>\n            </a>\n          </li>\n          <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.channels.fax.queues\')}">\n            <a href="/channels/fax/queues/list">\n              <i class="icon-docs"></i>\n              <span class="title"> {{ \'APPLICATION_QUEUES\' | translate }} </span>\n            </a>\n          </li>\n          <li data-ng-class="{active: $state.includes(\'main.channels.fax.inbox\')}">\n            <a href="/channels/fax/inbox/incoming">\n              <i class="icon-note"></i>\n              <span class="title"> {{ \'APPLICATION_INBOX\' | translate }} </span>\n            </a>\n          </li>\n          <!-- START REALTIME CASE -->\n          <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.channels.fax.realtime\')}">\n            <a href="/channels/fax/realtime/view/agents">\n              <i class="icon-energy"></i>\n              <span class="title">{{\'APPLICATION_REALTIME\' | translate}}</span>\n            </a>\n          </li>\n          <!-- END REALTIME CASE -->\n        </ul>\n      </li>\n      <!-- END FAX CASE -->\n    </ul>\n  </li>\n  <!-- END CHANNEL LIST CASE -->\n\n  <!-- START CALLYSQUARE CASE -->\n  <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.square\')}">\n    <a href="javascript:;">\n      <i class="fa fa-superscript"></i>\n      <span class="title" >{{\'APPLICATION_CALLYSQUARE\' | translate}}</span>\n      <span class="arrow"></span>\n    </a>\n    <ul class="sub-menu">\n      <li data-ng-class="{active: $state.includes(\'main.square.projects\')}">\n        <a href="/square/projects/list">\n          <i class="fa fa-slack"></i>\n          <span class="title" >{{\'APPLICATION_PROJECTS\' | translate}}  </span>\n        </a>\n      </li>\n      <li data-ng-class="{active: $state.includes(\'main.square.odbc\')}">\n        <a href="/square/odbc/list">\n          <i class="fa fa-database"></i>\n          <span class="title" >{{\'APPLICATION_ODBC\' | translate}}  </span>\n        </a>\n      </li>\n    </ul>\n  </li>\n  <!-- END CALLYSQUARE CASE -->\n\n  <!-- START ANALYTIC LIST CASE -->\n  <li data-ng-class="{active: $state.includes(\'main.analytics.reports\')\n  || $state.includes(\'main.analytics.extracted\')\n  || $state.includes(\'main.analytics.metrics\')}" data-ng-show="Auth.isAdmin()">\n  <a href="javascript:;">\n    <i class="icon-calculator"></i>\n    <span class="title" >{{\'APPLICATION_ANALYTICS\' | translate}}</span>\n    <span class="arrow" data-ng-class="{ open: $state.includes(\'main.analytics.reports\')\n    || $state.includes(\'main.analytics.extracted\')\n    || $state.includes(\'main.analytics.metrics\') }"></span>\n  </a>\n  <ul class="sub-menu">\n    <!-- START REPORT CASE -->\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.analytics.reports\')}">\n      <a href="/analytics/reports/list">\n        <i class="icon-book-open"></i>\n        <span class="title" >{{\'APPLICATION_REPORTS\' | translate}}</span>\n        <span data-ng-show="$state.includes(\'main.analytics.reports\')" class="selected"></span>\n      </a>\n    </li>\n    <!-- END REPORT CASE -->\n    <!-- START EXTRA REPORT CASE -->\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.analytics.extracted\')}">\n      <a href="/analytics/extracted/list">\n        <i class="fa fa-file-pdf-o"></i>\n        <span class="title" >{{\'APPLICATION_EXTRACTED_REPORTS\' | translate}}</span>\n        <span data-ng-show="$state.includes(\'main.analytics.extracted\')" class="selected"></span>\n      </a>\n    </li>\n    <!-- END EXTRA REPORT CASE -->\n    <!-- START METRICS CASE -->\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.analytics.metrics\')}">\n      <a href="/analytics/metrics/list">\n        <i class="icon-calculator"></i>\n        <span class="title" >{{\'APPLICATION_METRICS\' | translate}}</span>\n        <span data-ng-show="$state.includes(\'main.metrics.reports\')" class="selected"></span>\n      </a>\n    </li>\n    <!-- END METRICS CASE -->\n  </ul>\n</li>\n<!-- END ANALYTIC LIST CASE -->\n\n<!-- START TOOLS LIST CASE -->\n<li data-ng-class="{active: $state.includes(\'main.tools\') && !$state.is(\'main.tools.yourdashboards.show\')}" data-ng-show="Auth.isAdmin()">\n  <a href="javascript:;">\n    <i class="icon-wrench"></i>\n    <span class="title" >{{\'APPLICATION_TOOLS\' | translate}}</span>\n    <span class="arrow" data-ng-class="{ open: $state.includes(\'main.tools\') && !$state.is(\'main.tools.yourdashboards.show\')}"></span>\n  </a>\n  <ul class="sub-menu">\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.tools.triggers\')}">\n      <a href="/tools/triggers/list">\n        <i class="icon-bulb"></i>\n        <span class="title"> {{\'APPLICATION_TRIGGERS\' | translate}} </span>\n      </a>\n    </li>\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.tools.automations\')}">\n      <a href="/tools/automations/list">\n        <i class="icon-settings"></i>\n        <span class="title"> {{\'APPLICATION_AUTOMATIONS\' | translate}} </span>\n      </a>\n    </li>\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.tools.trunks\')}">\n      <a href="/tools/trunks/list">\n        <i class="icon-link"></i>\n        <span class="title"> {{\'APPLICATION_TRUNKS\' | translate}} </span>\n      </a>\n    </li>\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.tools.intervals\')}">\n      <a href="/tools/intervals/list">\n        <i class="icon-clock"></i>\n        <span class="title"> {{\'APPLICATION_INTERVALS\' | translate}} </span>\n      </a>\n    </li>\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.tools.variables\')}">\n      <a href="/tools/variables/list">\n        <i class="fa fa-eye"></i>\n        <span class="title" >{{\'APPLICATION_VARIABLES\' | translate}}  </span>\n      </a>\n    </li>\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.tools.tags\')}">\n      <a href="/tools/tags/list">\n        <i class="icon-tag"></i>\n        <span class="title" >{{\'APPLICATION_TAGS\' | translate}}  </span>\n      </a>\n    </li>\n    <!-- START TEMPLATE CASE -->\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.tools.templates\')}">\n      <a href="/tools/templates/list">\n        <i class="icon-docs"></i>\n        <span class="title"> {{\'APPLICATION_TEMPLATES\' | translate}} </span>\n      </a>\n    </li>\n    <!-- END TEMPLATE CASE -->\n\n    <!-- START PAUSE CASE -->\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.tools.pauses\')}">\n      <a href="/tools/pauses/list">\n        <i class="icon-control-pause"></i>\n        <span class="title"> {{\'APPLICATION_PAUSES\' | translate}} </span>\n      </a>\n    </li>\n    <!-- END PAUSE CASE -->\n    <!-- START ANSWER CASE -->\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.tools.answers\')}">\n      <a href="/tools/answers/list">\n        <i class="icon-magic-wand"></i>\n        <span class="title"> {{\'APPLICATION_CANNED_ANSWERS\' | translate}} </span>\n      </a>\n    </li>\n    <!-- END ANSWER CASE -->\n    <!-- START DASHBOARD MANAGER CASE -->\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.tools.yourdashboards\') && !$state.is(\'main.tools.yourdashboards.show\')}">\n      <a href="/tools/yourdashboards/list">\n        <i class="icon-grid"></i>\n        <span class="title"> {{\'APPLICATION_DASHBOARDS_MANAGER\' | translate}} </span>\n      </a>\n    </li>\n    <!-- END DASHBOARD MANAGER CASE -->\n    <!-- START SOUND CASE -->\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.tools.sounds\')}">\n      <a href="/tools/sounds/list">\n        <i class="icon-music-tone-alt"></i>\n        <span class="title" >{{\'APPLICATION_SOUNDS\' | translate}}</span>\n        <!-- <span data-ng-show="$state.includes(\'main.sounds\')" class="selected"></span> -->\n      </a>\n    </li>\n    <!-- END SOUND CASE -->\n  </ul>\n</li>\n<!-- END TOOLS LIST CASE -->\n\n<!-- START JSCRIPTY LIST -->\n<li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.jscripty\')}">\n  <a href="javascript:;">\n    <i class="icon-note"></i>\n    <span class="title" >{{\'APPLICATION_JSCRIPTY\' | translate}} <span class="badge">Beta</span></span>\n    <span class="arrow"></span>\n  </a>\n  <ul class="sub-menu">\n    <!-- START PROJECTS CASE -->\n    <li data-ng-class="{active: $state.includes(\'main.jscripty.projects\')}">\n      <a href="/jscripty/projects/list">\n        <i class="fa fa-slack"></i>\n        <span class="title" >{{\'APPLICATION_PROJECTS\' | translate}} </span>\n      </a>\n    </li>\n    <!-- END PROJECTS CASE -->\n  </ul>\n</li>\n<!-- END JSCRIPTY LIST -->\n\n<!-- START SETTINGS LIST -->\n<li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.setting\')}">\n  <a href="javascript:;">\n    <i class="icon-settings"></i>\n    <span class="title" >{{\'APPLICATION_SETTINGS\' | translate}}</span>\n    <span class="arrow"></span>\n  </a>\n  <ul class="sub-menu">\n    <!-- START UPDATES CASE -->\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.setting.updates\')}">\n      <a href="/setting/updates/list">\n        <i class="icon-cloud-download"></i>\n        <span class="title" >{{\'APPLICATION_UPDATES\' | translate}}</span>\n        <!-- <span data-ng-show="$state.includes(\'main.updates\')" class="selected"></span> -->\n      </a>\n    </li>\n    <!-- END UPDATES CASE -->\n\n    <!-- START SMTP CASE -->\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.setting.smtp\')}">\n      <a href="/setting/smtp/view">\n        <i class="icon-envelope"></i>\n        <span class="title">SMTP</span>\n        <!-- <span data-ng-show="$state.includes(\'main.smtp\')" class="selected"></span> -->\n      </a>\n    </li>\n    <!-- END SMTP CASE -->\n\n    <!-- START LICENSE CASE -->\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.setting.license\')}">\n      <a href="/setting/license/view">\n        <i class="icon-info"></i>\n        <span class="title"> {{\'APPLICATION_LICENSE\' | translate}} </span>\n      </a>\n    </li>\n    <!-- END LICENSE CASE -->\n  </ul>\n</li>\n<!-- END SETTINGS LIST -->\n\n<!-- START INTEGRATION CASE -->\n<li data-ng-repeat="integration in integrations" data-ng-if="integration.active" data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.{{integration.state}}\')}">\n  <a href="/{{integration.state}}/list">\n    <i class="icon-handbag"></i>\n    <span class="title" >{{integration.name}}</span>\n    <span data-ng-show="$state.includes(\'main.{{integration.state}}\')" class="selected"></span>\n  </a>\n</li>\n\n<li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.is(\'main.market\')}">\n  <a href="/market">\n    <i class="icon-handbag"></i>\n    <span class="title" translate>Market Place</span>\n    <span data-ng-show="$state.includes(\'main.market\')" class="selected"></span>\n  </a>\n</li>\n<!-- END INTEGRATIONS CASE -->\n\n</ul>\n<!-- END SIDEBAR MENU -->\n</div>\n');
+}]);
\ No newline at end of file
diff --git a/public/app/7f4f3cd9.app.js b/public/app/7f4f3cd9.app.js
deleted file mode 100644
index f4ba39c..0000000
--- a/public/app/7f4f3cd9.app.js
+++ /dev/null
@@ -1,51 +0,0 @@
-"use strict";angular.module("xCallyShuttleApp",["adf","adf.structures.base","adf.widget.clock","adf.widget.iframe","adf.widget.counter","adf.widget.pie-chart","angular-md5","angular.filter","angularFileUpload","btford.socket-io","chart.js","checklist-model","colorpicker.module","frapontillo.bootstrap-switch","infinite-scroll","LocalStorageModule","mgo-angular-wizard","ng-slide-down","ngAnimate","ngBootstrap","ngCookies","ngCsv","ngFileSaver","ngJsTree","ngMap","ngPapaParse","ngResource","ngSanitize","notification","oc.lazyLoad","pascalprecht.translate","pdf","remoteValidation","smart-table","sprintf","textAngular","timer","toastr","permission","ui-notification","ui.bootstrap.modal","ui.bootstrap.dropdown","ui.bootstrap.popover","ui.bootstrap.timepicker","ui.bootstrap.tooltip","ui.bootstrap.tpls","ui.bootstrap.accordion","ui.bootstrap.progressbar","ui.bootstrap.typeahead","ui.grid","ui.grid.autoResize","ui.grid.draggable-rows","ui.grid.exporter","ui.grid.grouping","ui.grid.moveColumns","ui.grid.pagination","ui.grid.treeView","ui.grid.selection","ui.grid.exporter","ui.grid.resizeColumns","ui.router","ui.navbar","ui.select","ui.sortable","xeditable","ngAudio","truncate","ngScrollbars","ngEmoticons","angularSpinner","builder","builder.components","validator","angular-clipboard","ng-code-mirror","angularMoment"]).config(["$stateProvider","$urlRouterProvider","$locationProvider","$httpProvider","$translateProvider","localStorageServiceProvider","dashboardProvider","ScrollBarsProvider",function(a,b,c,d,e,f,g,h){b.otherwise("/dashboard/voice"),e.useStaticFilesLoader({prefix:"assets/languages/locale-",suffix:".json"}),e.preferredLanguage("en_EN"),e.useLocalStorage(),e.useSanitizeValueStrategy("sanitize"),c.html5Mode(!0),d.interceptors.push("authInterceptor"),g.structure("4-4-4",{rows:[{columns:[{styleClass:"col-md-4"},{styleClass:"col-md-4"},{styleClass:"col-md-4"}]}]}).structure("3-3-3-3",{rows:[{columns:[{styleClass:"col-md-3"},{styleClass:"col-md-3"},{styleClass:"col-md-3"},{styleClass:"col-md-3"}]}]}),f.setPrefix("xcally"),h.defaults={scrollButtons:{scrollAmount:"auto",enable:!0},axis:"y"}}]).factory("settings",["$rootScope","$interval","License","localStorageService",function(a,b,c,d){return a.settings={patternName:"[A-Za-z0-9._]+",layout:{pageSidebarClosed:d.get("sidebarClosed")||!1,pageQuickSidebarOpened:!1,pageBodySolid:!1,pageAutoScrollOnLoad:1e3}},c.get(function(b){b.license&&(a.license=b.license,a.soundPath=b.soundPath)}),a.settings}]).factory("authInterceptor",["$rootScope","$q","$cookieStore",function(a,b,c){return{request:function(a){return a.headers=a.headers||{},c.get("token")&&(a.headers.Authorization="Bearer "+c.get("token")),a}}}]).run(["$rootScope","$location","$state","$stateParams","$window","$q","$http","Auth","RoleStore","editableThemes","editableOptions",function(a,b,c,d,e,f,g,h,i,j,k){g.get("/api/settings/1").success(function(b){a.license=b.license}).error(function(a){console.error(a)}),a.$state=c,a.$stateParams=d,j.bs3.inputClass="input-sm",j.bs3.buttonsClass="btn-xs",k.theme="bs3",a.online=navigator.onLine,e.addEventListener("offline",function(){a.$apply(function(){a.online=!1})},!1),e.addEventListener("online",function(){a.$apply(function(){a.online=!0})},!1),a.$on("$stateChangeStart",function(a,c){h.isLoggedInAsync(function(a){c.authenticate&&!a&&b.path("/login")})}),a.updateTableConfig=function(a,b){var c=_.find(a,{name:"All"});c&&(c.value=b)},i.defineRole("admin",[],function(){return h.isAdmin()})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.analytics",{url:"/analytics",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").factory("Extracted",["$resource",function(a){return a("/api/analytics/extracted/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.analytics.extracted",{url:"/extracted",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("AnalyticExtractedListCtrl",["$scope","$translate","gridOptions","Extracted",function(a,b,c,d){a.moment=moment,a.Extracted=d,a.initView=function(){var b={exporterCsvFilename:"ExtractedReports.csv",columnDefs:[{name:"name"},{name:"startDate",displayName:"APPLICATION_START_DATE"},{name:"endDate",displayName:"APPLICATION_END_DATE"},{name:"createdAt",displayName:"APPLICATION_RUN_DATE"},{name:"startDate",displayName:"APPLICATION_START_DATE"},{name:"output"},{name:"status"},{name:"action",width:140,buttons:[{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"},{directive:"<motion-file-download data-ng-show=\"row.entity.status == 'completed'\" resource=\"grid.appScope.Extracted\" params=\"{id:row.entity.id,controller:'download'}\" mimetype=\"'application/'+row.entity.output.toLowerCase()\" filename=\"row.entity.name+'_'+grid.appScope.moment(row.entity.startDate).format('MM-DD-YYYY').toString()+'_'+grid.appScope.moment(row.entity.endDate).format('MM-DD-YYYY').toString()+'.'+row.entity.output.toLowerCase()\"></motion-file-download>"}]}]};a.gridOptions=c.gridOptions(d,b,a,{order:"createdAt DESC"})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.analytics.extracted.list",{url:"/list",templateUrl:"app/analytic/extracted/list/list.html",controller:"AnalyticExtractedListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").controller("AnalyticMetricListCreateModalCtrl",["$scope","$uibModalInstance",function(a,b){a.forms={dashboard:void 0},a.item={},a.tables=[{name:"Agent Report",value:"report_agent_history"},{name:"Mail Report",value:"report_mail_session_history"},{name:"Queue Report",value:"report_queue_history"},{name:"Integration Report",value:"report_integration_history"},{name:"Chat Report",value:"report_chat_session_history"}],a.ok=function(){a.item.model=JSON.stringify({title:a.item.name}),b.close(a.item)},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("AnalyticMetricListCtrl",["$scope","xAlert","Modal","$uibModal","$log","gridOptions","Metric","$translate",function(a,b,c,d,e,f,g,h){a.$translate=h,a.initView=function(){var b={exporterCsvFilename:"Metrics.csv",columnDefs:[{name:"name"},{name:"table",cellTemplate:"<div style=\"padding:5px\">{{'APPLICATION_'+row.entity.table.toUpperCase() | translate}}</div>"},{name:"description"},{name:"action",width:125,buttons:[{"class":"{{row.entity.defaultEntry ? 'blue-hoki disabled' : 'blue-hoki'}}",href:"/analytics/metrics/view/{{row.entity.id}}/settings",name:"settings"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=f.gridOptions(g,b,a)},a.create=function(){var c=d.open({animation:!0,templateUrl:"app/analytic/metric/list/create.modal.html",controller:"AnalyticMetricListCreateModalCtrl"});c.result.then(function(c){return g.save(c).$promise.then(function(){a.gridOptions.getPage(),b.show(h.instant("MESSAGE_WELL_DONE")+"!","success")})["catch"](function(a){b.show(a.data.message,"danger")})},function(){e.info("Modal dismissed at: "+new Date)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.analytics.metrics.list",{url:"/list",templateUrl:"app/analytic/metric/list/list.html",controller:"AnalyticMetricListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").factory("Metric",["$resource",function(a){return a("/api/analytics/metrics/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.analytics.metrics",{url:"/metrics",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("AnalyticMetricViewCtrl",["$scope","xAlert","$translate","$stateParams","$location","Metric",function(a,b,c,d,e,f){a.tables=[{name:"Agent Report",value:"report_agent_history"},{name:"Mail Report",value:"report_mail_session_history"},{name:"Queue Report",value:"report_queue_history"},{name:"Integration Report",value:"report_integration_history"},{name:"Chat Report",value:"report_chat_session_history"}],a.getMetric=function(){return f.get({id:d.id}).$promise.then(function(b){a.metric=b})["catch"](function(a){e.path("/analytics/metrics/list")})},a.updateMetric=function(){return f.update({id:d.id},a.metric).$promise.then(function(){b.show(c.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){b.show(a.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.analytics.metrics.view",{url:"/view/:id",templateUrl:"app/analytic/metric/view/view.html",controller:"AnalyticMetricViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.analytics.metrics.view.settings",{url:"/settings",templateUrl:"app/analytic/metric/view/view.settings.html"})}]),angular.module("xCallyShuttleApp").factory("customReport",["$resource",function(a){return a("/api/analytics/reports/custom/:id/:controller/:action",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").factory("defaultReport",["$resource",function(a){return a("/api/analytics/reports/default/:id/:controller/:action",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").controller("ReportListCopyModalCtrl",["$scope","$uibModalInstance","$log","customTreeData",function(a,b,c,d){a.customTreeData=d,a.forms={dashboard:void 0},a.item={},a.customTreeConfig={multiple:!1,animation:!0,core:{error:function(a){c.error("treeCtrl: error from js tree - "+angular.toJson(a))},check_callback:!0}},a.ac=function(){return!0},a.initCustomScopeTree=function(){a.customTree=a.customTreeInstance.jstree(!0),a.customTree.deselect_all(),a.customTree.open_all()},a.ok=function(){b.close({parent:a.customTree.get_selected(!0).pop().id})},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("ReportListCreateModalCtrl",["$scope","$uibModalInstance","path",function(a,b,c){a.path=c,a.forms={dashboard:void 0},a.item={},a.ok=function(){a.item.model=JSON.stringify({title:a.item.name}),b.close(a.item)},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("ReportListExtractModalCtrl",["$scope","$uibModalInstance",function(a,b){a.dates={startDate:moment().subtract(1,"days").startOf("day"),endDate:moment().subtract(1,"days").endOf("day")},a.ranges={Yesterday:[moment().subtract(1,"days").startOf("day"),moment().subtract(1,"days").endOf("day")],"Last 7 days":[moment().subtract(7,"days"),moment()],"Last 30 days":[moment().subtract(30,"days"),moment()],"This month":[moment().startOf("month"),moment().endOf("month")]},a.extract=function(c){var d={startDate:a.dates.startDate.toISOString(),endDate:a.dates.endDate.toISOString(),output:c};b.close(d)},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("AnalyticReportListCtrl",["$scope","xAlert","$translate","$location","$log","Modal","$uibModal","FileSaver","Blob","gridOptions","customReport","defaultReport","reportTree",function(a,b,c,d,e,f,g,h,i,j,k,l,m){function n(){var b,c={},d=a.defaultTree.get_selected(),e=a.customTree.get_selected();if(d.length)b=d.pop(),a.selectedNode=a.defaultTree.get_path(b," / "),c={parent:b},a.gridOptions=j.gridOptions(l,o,a,c,!0),a.gridOptions.getPage();else{if(!e.length)return;b=e.pop(),a.selectedNode=a.customTree.get_path(b," / "),c={parent:b},a.gridOptions=j.gridOptions(k,o,a,c,!0),a.gridOptions.getPage()}}var o={exporterCsvFilename:"reports.csv",columnDefs:[{name:"name"},{name:"description"},{name:"manage",width:120,buttons:[{"class":"blue-hoki",href:"/analytics/reports/view/{{row.entity.id}}/settings",icon:"icon-settings",title:c.instant("APPLICATION_SETTINGS")},{"class":"red-sunglo",icon:"fa fa-trash-o",title:c.instant("APPLICATION_DELETE"),onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"},{"class":"green",icon:"fa fa-files-o",title:c.instant("APPLICATION_COPY"),onClick:"grid.appScope.copy(row.entity.id)"},{"class":"purple",icon:"fa fa-download",title:c.instant("APPLICATION_EXPORT"),onClick:"grid.appScope.export(row.entity.id)"}]},{name:"actions",buttons:[{"class":"yellow",name:"preview",onClick:"grid.appScope.preview(row.entity.id)"},{"class":"green-turquoise",name:"run",onClick:"grid.appScope.extract(row.entity.id)"}]}]};a.searchField="",a.ac=function(){return!0},a.initDefaultScopeTree=function(){a.defaultTree=a.defaultTreeInstance.jstree(!0),a.defaultTree.deselect_all(),a.defaultTree.close_all(),a.defaultTree.open_node({id:1}),a.defaultTreeReady=!0,a.defaultTreeActive=!0,a.previousDefaultNode=""},a.initCustomScopeTree=function(){a.customTree=a.customTreeInstance.jstree(!0),a.customTree.deselect_all(),a.customTree.close_all(),a.customTree.open_node({id:1}),a.customTreeReady=!0,a.previousCustomNode=""},a.$watchGroup(["defaultTreeReady","customTreeReady"],function(b,c,d){b[0]&&b[1]&&a.defaultTree.select_node({id:"1"})}),a.updateCustomTree=function(){var d={tree:angular.toJson(a.customTree.get_json("#",{flat:!0}))};return m.update({id:2},d).$promise.then(function(a){console.log("Custom Tree Updated")})["catch"](function(a){b.show(c.instant(a.message),"danger")})},a.configTrees=function(){a.defaultTreeConfig={multiple:!1,animation:!0,core:{error:function(a){e.error("treeCtrl: error from js tree - "+angular.toJson(a))},check_callback:!0,themes:{name:"default",url:"../../../assets/css/jstree-metronic/style.css"}},plugins:["search"]},a.customTreeConfig={multiple:!1,animation:!0,core:{error:function(a){e.error("treeCtrl: error from js tree - "+angular.toJson(a))},check_callback:!0,themes:{name:"default",url:"../../../assets/css/jstree-metronic/style.css"}},plugins:["contextmenu","dnd","search"],contextmenu:{items:function(b,d){var e={create:{label:c.instant("APPLICATION_CREATE"),action:function(c){a.customTree.create_node(b),a.customTree.open_node(b)}},rename:{label:c.instant("APPLICATION_RENAME"),action:function(c){a.customTree.edit(b)}},remove:{label:c.instant("APPLICATION_REMOVE"),action:function(c){console.log(b),a.deleteNode(b.text,b)}}};return"#"===b.parent&&(delete e.rename,delete e.remove),d(e),e}}}},a.deleteNode=f.confirm["delete"](function(b){a.customTree.delete_node(b),a.previousCustomNode==b.id&&a.customTree.select_node({id:b.parent})}),a.searchTrees=function(){a.defaultTree.search(a.searchField),a.customTree.search(a.searchField)},a.selectDefaultNode=function(){if(a.customTreeReady){a.previousCustomNode="";var b=a.defaultTree.get_selected(!0),c=b.pop();if(a.defaultTree.deselect_node(b[0],!0),a.customTree.deselect_all(),a.defaultTree.select_node(c,!0),c.id===a.previousDefaultNode)return void console.log("def");a.previousDefaultNode=c.id,a.defaultTreeActive=!0,n()}},a.selectCustomNode=function(){if(a.defaultTreeReady){a.previousDefaultNode="";var b=a.customTree.get_selected(!0),c=b.pop();if(a.customTree.deselect_node(b[0],!0),a.defaultTree.deselect_all(),a.customTree.select_node(c,!0),c.id===a.previousCustomNode)return void console.log("cus");a.previousCustomNode=c.id,a.defaultTreeActive=!1,n()}},a.getTrees=function(){return m.query().$promise.then(function(b){a.defaultTreeData=JSON.parse(b[0].tree),a.customTreeData=JSON.parse(b[1].tree),a.configTrees()})["catch"](function(a){b.show(c.instant(a.message),"danger")})},a.create=function(){var c=g.open({animation:!0,templateUrl:"app/analytic/report/list/create.modal.html",controller:"ReportListCreateModalCtrl",resolve:{path:function(){return a.selectedNode}}});c.result.then(function(c){return c.parent=a.previousCustomNode,k.save(c).$promise.then(function(a){d.path("/analytics/reports/view/"+a.id+"/settings")})["catch"](function(a){b.show(a.message,"danger")})},function(){e.info("Modal dismissed at: "+new Date)})},a.copy=function(d){var f=a.defaultTreeActive?l:k,h=g.open({animation:!0,templateUrl:"app/analytic/report/list/copy.modal.html",controller:"ReportListCopyModalCtrl",resolve:{customTreeData:function(){return a.customTreeData}}});h.result.then(function(e){return f.save({id:d,controller:"copy"},e).$promise.then(function(){a.gridOptions.getPage(),b.show(c.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){b.show(a.message,"danger")})},function(){e.info("Modal dismissed at: "+new Date)})},a["export"]=function(c){var d=a.defaultTreeActive?l:k;return d.get({id:c}).$promise.then(function(a){delete a.id,delete a.createdAt,delete a.updatedAt,delete a.deletedAt,_.forEach(a.Fields,function(a){delete a.id,delete a.CustomReportId,a.Metric&&(delete a.Metric.id,a.Metric.name+="_"+_.random(9999))});var b=new i([angular.toJson(a)],{type:"application/json;charset=utf-8"});h.saveAs(b,a.name+".json")})["catch"](function(a){console.error(data),b.show(a.message,"danger")})},a["import"]=function(d){var e=JSON.parse(d);e.parent=a.previousCustomNode;var f=e.name&&e.parent?!0:!1,g=!0;return _.forEach(e.Fields,function(a){a.field&&a.alias||(g=!1)}),f&&g?k.save({controller:"import"},e).$promise.then(function(){a.gridOptions.getPage(),b.show(c.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){b.show(a.message,"danger")}):void b.show(c.instant("MESSAGE_INVALID_JSON"),"danger")},a.preview=function(b){g.open({animation:!0,templateUrl:"app/analytic/report/list/preview.modal.html",controller:"ReportListPreviewModalCtrl",size:"full",resolve:{report:function(){return{id:b,tree:a.defaultTreeActive?"default":"custom"}}}})},a.extract=function(d){var f=g.open({animation:!0,templateUrl:"app/analytic/report/list/extract.modal.html",controller:"ReportListExtractModalCtrl",size:"md",resolve:{report:function(){return{id:d,tree:a.defaultTreeActive?"default":"custom"}}}});f.result.then(function(e){var f=a.defaultTreeActive?l:k;return f.get({id:d,controller:"extract",action:e.output,startDate:e.startDate,endDate:e.endDate}).$promise.then(function(){b.show(c.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){b.show(a.message,"danger")})},function(){e.info("Modal dismissed at: "+new Date)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.analytics.reports.list",{url:"/list",templateUrl:"app/analytic/report/list/list.html",controller:"AnalyticReportListCtrl"})}]),angular.module("xCallyShuttleApp").controller("ReportListPreviewModalCtrl",["$scope","$uibModalInstance","report","xAlert","$translate","$timeout","customReport","defaultReport",function(a,b,c,d,e,f,g,h){a.forms={dashboard:void 0},a.dates={startDate:moment().subtract(1,"days").startOf("day"),endDate:moment().subtract(1,"days").endOf("day")},a.ranges={Yesterday:[moment().subtract(1,"days").startOf("day"),moment().subtract(1,"days").endOf("day")],"Last 7 days":[moment().subtract(7,"days"),moment()],"Last 30 days":[moment().subtract(30,"days"),moment()],"This month":[moment().startOf("month"),moment().endOf("month")]};var i={pageNumber:1,pageSize:25,sort:null,where:{},order:{}};a.gridOptions={paginationPageSizes:[10,25,50],paginationPageSize:25,useExternalPagination:!0,enableSorting:!1,enableFiltering:!0,useExternalFiltering:!0,enableGrouping:!1,enableColumnMenus:!1,treeRowHeaderAlwaysVisible:!1,gridMenuShowHideColumns:!1,enableGridMenu:!1,onRegisterApi:function(b){a.gridApi=b,b.pagination.on.paginationChanged(a,function(b,c){i.offset=(b-1)*c,i.limit=c,a.getPage()}),b.core.on.filterChanged(a,function(){var b=this.grid,c={};b.columns.forEach(function(a){console.log(a),a.filters[0].term&&(c[a.field]=a.filters[0].term)}),i.where=c,a.getPage()})}},a.getPage=function(){var b={params:{offset:i.offset,limit:i.limit,startDate:a.dates.startDate.toISOString(),endDate:a.dates.endDate.toISOString()}};_.forOwn(i.where,function(a,c){b.params[c]=a}),console.log(b);var f="custom"===c.tree?g:h;return f.get({id:c.id,controller:"preview"},b).$promise.then(function(b){a.gridOptions.totalItems=b.count,a.gridOptions.paginationPageSizes[3]=b.count,a.gridOptions.data=b.rows,a.showResult=!0})["catch"](function(a){d.show(e.instant(a.message),"danger")})},a.cancel=function(){b.dismiss("cancel")},f(function(){a.getPage()})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.analytics.reports",{url:"/reports",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").factory("reportTree",["$resource",function(a){return a("/api/analytics/reports/trees/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").controller("AnalyticReportViewCtrl",["$scope","$http","xAlert","$translate","$stateParams","$location",function(a,b,c,d,e,f){function g(e){var f=_.find(a.tables,{table:e}).url;b.get(f).success(function(b){a.tableFields=_.map(b,function(a,b){return{name:b,value:b}})}).error(function(a){c.show(d.instant(a.message),"danger")})}function h(e){console.log(e),b.get("/api/analytics/metrics/table",{params:{table:e}}).success(function(b){_.forEach(b,function(b){a.tableFields.push({name:"<strong>Metric.</strong>"+b.name,value:b.metric,MetricId:b.id})})}).error(function(a){c.show(d.instant(a.message),"danger")})}function i(a){return String(a).replace(/</g,"&lt;").replace(/>/g,"&gt;")}function j(a){if(!a)return"";for(var b="(",c=0;c<a.rules.length;c++)c>0&&(b+=" <strong>"+a.operator+"</strong> "),b+=a.rules[c].group?j(a.rules[c].group):a.rules[c].field+" "+i(a.rules[c].condition)+" '"+("like"===a.rules[c].condition?"%"+a.rules[c].value+"%":a.rules[c].value)+"'";return b+")"}a.$translate=d,a.tempReport={},a.tables=[{name:"Agent Report",table:"report_agent_history",url:"/api/report/agents/describe"},{name:"Mail Report",table:"report_mail_session_history",url:"/api/report/mail/sessions/describe"},{name:"Queue Report",table:"report_queue_history",url:"/api/report/queues/describe"},{name:"Chat Report",table:"report_chat_session_history",url:"/api/report/chat/sessions/describe"}];var k={group:{operator:"AND",rules:[]}};a.getReport=function(){a.firstLoad=!0,b.get("/api/analytics/reports/custom/"+e.id).success(function(b){a.report=b,_.forEach(a.report.Fields,function(a){delete a.id}),a.report.conditions=a.report.conditions?JSON.parse(a.report.conditions):_.clone(k,!0),a.getPreview(a.report.Fields.length)}).error(function(a){console.error(a),f.path("/analytics/reports/list")})},a.randomName=function(a,b){var c=[];for(a=a||5,b=b||"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";--a;)c.push(b.charAt(Math.floor(Math.random()*b.length)));return c.join("")},a.$watch("report.table",function(b,c){console.log(b),b&&(console.log("is newvalue"),g(b),h(b),c&&(console.log("is oldvalue"),a.tempReport[c]={conditions:a.report.conditions,fields:a.report.Fields}),a.firstLoad?a.firstLoad=!1:a.tempReport[b]?(a.report.Fields=a.tempReport[b].fields,a.report.conditions=a.tempReport[b].conditions):(a.report.Fields=[],a.report.conditions=_.clone(k,!0)))},!0),a.setMetricId=function(b,c){a.report.Fields[c].MetricId=b.MetricId?b.MetricId:null},a.groupByField=[{name:"APPLICATION_YES",value:!0},{name:"APPLICATION_NO",value:!1}],a.functions=[{name:"Sum",value:"SUM"},{name:"Count",value:"COUNT"},{name:"Count Distinct",value:"COUNT DISTINCT"},{name:"Maximum",value:"MAX"},{name:"Minimum",value:"MIN"},{name:"Average",value:"AVG"},{name:"Group Concat",value:"GROUP_CONCAT"},{name:"Group Concat(asc)",value:"GROUP_CONCAT ASC"},{name:"Group Concat(desc)",value:"GROUP_CONCAT DESC"}],a.addField=function(){a.report.Fields.push({groupBy:!1})},a.removeField=function(b){a.report.Fields.splice(b,1)},a.sortableOptions={"ui-floating":!0,cancel:".unsortable",handle:".report-field-handle",axis:"y"},a.updateReport=function(){if(a.report.Fields.length){var f=angular.copy(a.report);f.conditions=angular.toJson(f.conditions),b.put("/api/analytics/reports/custom/"+e.id,f).success(function(){c.show(d.instant("MESSAGE_WELL_DONE")+"!","success"),a.getPreview(!0)}).error(function(b){c.show(d.instant(b.message),"danger"),f.conditions=JSON.parse(f.conditions),a.report=f})}else c.show(d.instant("MESSAGE_SELECT_A_FIELD"),"danger")},a.$watch("report.conditions",function(b){a.output=b?j(b.group):"()"},!0),a.gridOptions={enableFiltering:!0,treeRowHeaderAlwaysVisible:!1,enableGridMenu:!0},a.getPreview=function(f){b.get("/api/analytics/reports/custom/"+e.id+"/preview/",{params:{limit:20}}).success(function(b){a.gridOptions.data=b.rows}).error(function(a){f&&c.show(d.instant(a.message||"MESSAGE_QUERY_NOT_VALID"),"warning")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.analytics.reports.view",{url:"/view/:id",templateUrl:"app/analytic/report/view/view.html",controller:"AnalyticReportViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.analytics.reports.view.settings",{url:"/settings",templateUrl:"app/analytic/report/view/view.settings.html"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels",{url:"/channels",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat",{url:"/chat",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").factory("ChatEnquiry",["$resource",function(a){return a("/api/chat/enquiries/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").factory("ChatMessage",["$resource",function(a){return a("/api/chat/messages/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").factory("ChatReport",["$resource",function(a){return a("/api/report/chats/:id/:controller1/:controller2",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").factory("ChatRoom",["$resource",function(a){return a("/api/chat/rooms/:id/:controller",{id:"@id"},{me:{method:"GET",isArray:!0,params:{id:"me"}},users:{method:"GET",params:{id:"users"}},externals:{method:"GET",isArray:!0,params:{id:"type",controller:"external"}},groups:{method:"GET",isArray:!0,params:{id:"groups"}},update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").factory("ChatVisitor",["$resource",function(a){return a("/api/chat/visitors/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").controller("ChatOfflineListCtrl",["$scope","ChatVisitor","gridOptions",function(a,b,c){a.initView=function(){var d={exporterCsvFilename:"chat_offline_messages.csv",columnDefs:[{name:"fullname",cellClass:"text-center"},{name:"email",cellClass:"text-center"},{name:"ChatWebsite.name",displayName:"Website",cellClass:"text-center"},{name:"createdAt",displayName:"createdAt",cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div><span am-time-ago="row.entity.createdAt"></span></div>'},{name:"action",width:100,buttons:[{"class":"blue-hoki",href:"/channels/chat/offline/view/{{row.entity.id}}/detail",name:"detail"}]}]};a.gridOptions=c.gridOptions(b,d,a,{origin:"enquiry"})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.offline.list",{url:"/list",templateUrl:"app/channels/chat/offline/list/list.html",controller:"ChatOfflineListCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.offline",{url:"/offline",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("ChatOfflineViewCtrl",["$scope","$stateParams","ChatVisitor",function(a,b,c){a.initView=function(){return c.get({id:b.id}).$promise.then(function(b){a.chatVisitor=b})["catch"](function(a){console.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.offline.view",{url:"/view/:id",templateUrl:"app/channels/chat/offline/view/view.html",controller:"ChatOfflineViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.channels.chat.offline.view.detail",{url:"/detail",templateUrl:"app/channels/chat/offline/view/view.detail.html",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/css/news.css"]}])}]}})}]),angular.module("xCallyShuttleApp").controller("ChatOnlineListCtrl",["$scope","ChatRoom","gridOptions",function(a,b,c){a.initView=function(){var d={exporterCsvFilename:"chat_online_messages.csv",columnDefs:[{name:"ChatVisitor.fullname",displayName:"APPLICATION_FULLNAME",cellClass:"text-center"},{name:"ChatVisitor.email",displayName:"APPLICATION_EMAIL",cellClass:"text-center"},{name:"action",width:100,buttons:[{"class":"blue-hoki",href:"/channels/chat/online/view/{{row.entity.id}}/detail",name:"detail"}]}]};a.gridOptions=c.gridOptions(b,d,a,{type:"external"})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.online.list",{url:"/list",templateUrl:"app/channels/chat/online/list/list.html",controller:"ChatOnlineListCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.online",{url:"/online",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("ChatOnlineViewCtrl",["$scope","$stateParams","ChatRoom",function(a,b,c){a.initView=function(){return a.config={autoHideScrollbar:!1,theme:"light",advanced:{updateOnContentResize:!0},setHeight:400,scrollInertia:0},c.get({id:b.id}).$promise.then(function(b){a.chatRoom=b})["catch"](function(a){console.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.online.view",{url:"/view/:id",templateUrl:"app/channels/chat/online/view/view.html",controller:"ChatOnlineViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.channels.chat.online.view.detail",{url:"/detail",templateUrl:"app/channels/chat/online/view/view.detail.html",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/css/news.css"]}])}]}})}]),angular.module("xCallyShuttleApp").controller("PreviewCtrl",["$scope",function(a){a.message="Hello"}]),angular.module("xCallyShuttleApp").directive("preview",function(){return{templateUrl:"app/channels/chat/preview/preview.html",restrict:"EA",link:function(a,b,c){}}}),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("preview",{url:"/preview",templateUrl:"app/channels/chat/preview/preview.html",controller:"PreviewCtrl"})}]),angular.module("xCallyShuttleApp").factory("ChatQueue",["$resource",function(a){return a("/api/chat/queues/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").controller("ChatQueueListCtrl",["$scope","ChatQueue","gridOptions","$uibModal",function(a,b,c,d){a.initView=function(){var d={exporterCsvFilename:"chat_queues.csv",columnDefs:[{name:"name"},{name:"description"},{name:"strategy"},{name:"timeout"},{name:"action",width:125,buttons:[{"class":"blue-hoki",href:"/channels/chat/queues/view/{{row.entity.id}}/settings",
-name:"profile"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=c.gridOptions(b,d,a)},a.createItem=function(){var b=d.open({animation:!0,templateUrl:"app/channels/mail/queue/list/list.create.modal.html",controller:"ChatQueueListCreateCtrl"});b.result.then(function(){a.gridOptions.getPage()})}}]),angular.module("xCallyShuttleApp").controller("ChatQueueListCreateCtrl",["$scope","$uibModalInstance","$translate","xAlert","ChatQueue",function(a,b,c,d,e){a.form={},a.item={},a.save=function(){return e.save(a.item).$promise.then(function(a){d.show(c.instant("MESSAGE_WELL_DONE"),"success"),b.close(a)})["catch"](function(a){d.show(a.data.message,"danger")})},a.cancel=function(){b.dismiss()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.queues.list",{url:"/list",templateUrl:"app/channels/chat/queue/list/list.html",controller:"ChatQueueListCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.queues",{url:"/queues",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("ChatQueueViewCtrl",["$scope","$http","xAlert","$translate","$stateParams","ChatQueue","Team",function(a,b,c,d,e,f,g){var h=function(){return{select:function(b){return f.save({id:a.queue.id,controller:"agents"},{agents:b,penalty:a.queue.penalty}).$promise.then(function(){a.getTeams()})["catch"](function(a){console.log(a)})},deselect:function(b){return f["delete"]({id:a.queue.id,controller:"agents",agents:b}).$promise.then(function(){a.getTeams()})["catch"](function(a){console.log(a)})}}};a.getQueue=function(){b.get("/api/chat/queues/"+e.id).success(function(b){b.penalty=0,a.queue=b}).error(function(a){console.error(a)})},a.updateChatQueue=function(){var f=angular.copy(a.queue);b.put("/api/chat/queues/"+e.id,f).success(function(){c.show(d.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(b){a.queue=f,b.errors.forEach(function(a){c.show(a.message,"danger")})})},a.getTeams=function(){return g.get().$promise.then(function(b){return a.teams=b.rows,f.query({id:e.id,controller:"agents"}).$promise}).then(function(b){ComponentsDropdowns.bindChatQueue(a.teams,_.map(b,function(a){return{id:a.id,penalty:a.UserHasChatQueue.penalty}}),h)})["catch"](function(a){console.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.queues.view",{url:"/view/:id",templateUrl:"app/channels/chat/queue/view/view.html",controller:"ChatQueueViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.channels.chat.queues.view.settings",{url:"/settings",templateUrl:"app/channels/chat/queue/view/view.settings.html"}).state("main.channels.chat.queues.view.agents",{url:"/agents",templateUrl:"app/channels/chat/queue/view/view.agents.html",cache:!1,serie:!0,resolve:{deps:["$ocLazyLoad",function(a){return a.load({insertBefore:"#ng_load_plugins_before",files:["assets/plugins/jquery-multi-select/css/multi-select.css","assets/plugins/jquery-multi-select/js/jquery.multi-select.js","assets/plugins/jquery-quicksearch/jquery.quicksearch.js","assets/scripts/components-dropdowns.js"]})}]}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.realtime",{url:"/realtime",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("ChatRealtimeViewAgentCtrl",["$scope","$log","$uibModal","$translate","socket","xAlert","Agent","Pause","Action","ChatQueue","usSpinnerService","$q","uiGridConstants",function(a,b,c,d,e,f,g,h,i,j,k,l,m){function n(){return k.spin("spinner-grid"),g.get(s).$promise.then(function(b){a.gridOptions.totalItems=b.count,a.gridOptions.data=[],b.rows.forEach(function(a){p(a)})})["catch"](function(a){f.show(a.message,"danger")})["finally"](function(){k.stop("spinner-grid")})}function o(){e.socket.on("agent:save",function(b){var c=_.find(a.gridOptions.data,{agentId:b.id,isAgent:!0});if(c){var d=a.gridOptions.data.indexOf(c);a.gridOptions.data[d].online=b.online,a.gridOptions.data[d].lastLoginAt=b.lastLoginAt,a.gridOptions.data[d].pause=b.chatPause,a.gridOptions.data[d].pauseType=b.pauseType,a.gridOptions.data[d].lastPauseAt=b.lastPauseAt,a.gridOptions.data[d].ipaddr=b.ipaddr,a.gridOptions.data[d].port=b.port,a.gridOptions.data[d].fullcontact=b.fullcontact,a.gridOptions.data[d].useragent=b.useragent,a.gridOptions.data[d].lastms=b.lastms,a.gridOptions.data[d].internal=b.internal,_.map(a.gridOptions.data,function(a){a.isAgent||a.agentId!==b.id||(a.online=b.online)})}}),e.socket.on("agent:remove",function(b){_.remove(a.gridOptions.data,{agentId:b.id})}),e.socket.on("user_has_chat_queue:save",function(b){console.log("new queue",b);var c=_.find(a.gridOptions.data,{agentId:b.UserId,isAgent:!0}),d=a.gridOptions.data.indexOf(c);a.gridOptions.data.splice(d+1,0,{isAgent:!1,agentId:b.UserId,queue:b.queue,queueId:b.ChatQueueId,agent:b.membername,online:c.online})}),e.socket.on("user_has_chat_queue:remove",function(b){_.remove(a.gridOptions.data,{agentId:b.UserId,queueId:b.ChatQueueId})})}function p(b){a.gridOptions.data.push({isAgent:!0,agentId:b.id,agent:b.name,online:b.online,lastLoginAt:b.lastLoginAt,lastPauseAt:b.lastPauseAt,pause:b.chatPause,pauseType:b.pauseType,ipaddr:b.ipaddr,port:b.port,fullcontact:b.fullcontact,useragent:b.useragent,lastms:b.lastms,internal:b.internal,$$treeLevel:0}),b.ChatQueues.forEach(function(c){a.gridOptions.data.push({isAgent:!1,agentId:b.id,queue:c.name,queueId:c.id,agent:b.name,online:b.online})})}function q(){return h.get().$promise.then(function(b){a.pauses=b.rows,e.syncUpdates("pause",a.pauses)})["catch"](function(a){f.show(a.message,"danger")})}function r(){return j.get().$promise.then(function(b){a.chatQueues=b.rows,e.syncUpdates("chat_queue",a.chatQueues)})["catch"](function(a){f.show(a.message,"danger")})}a.chatQueues=[];var s={offset:0,limit:10};a.moment=moment,a.initAgents=function(){a.gridOptions={enableGridMenu:!0,headerCellFilter:"translate",enableHorizontalScrollbar:0,enableVerticalScrollbar:0,enableFiltering:!0,showGridFooter:!0,paginationPageSizes:[10,25,50,75],paginationPageSize:10,useExternalPagination:!0,useExternalSorting:!0,useExternalFiltering:!0,multiSelect:!0,showTreeExpandNoChildren:!0,columnDefs:[{name:"name",displayName:"APPLICATION_AGENT",headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div data-ng-if="row.entity.isAgent">{{row.entity.agent}} &lt;{{row.entity.internal}}&gt;</div>'},{name:"online",displayName:"APPLICATION_ONLINE",width:150,headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div data-ng-if="row.entity.online != null && row.entity.isAgent"><i class="icon-user" data-ng-class="row.entity.online ? \'font-green\' : \'font-red\'"></i> <span data-ng-if="row.entity.online" class="left-margin">(<timer start-time="grid.appScope.moment(row.entity.lastLoginAt).unix()*1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>)</span></div>',filter:{type:m.filter.SELECT,selectOptions:[{value:"true",label:"ONLINE"},{value:"false",label:"OFFLINE"}]}},{name:"chatPause",width:300,displayName:"APPLICATION_PAUSE",headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div data-ng-if="row.entity.pause != null && row.entity.online" class="ui-grid-vcenter" data-ng-class="{\'paused-agent\':row.entity.pause}"><timer data-ng-if="row.entity.pause" start-time="grid.appScope.moment(row.entity.lastPauseAt).unix()*1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer></span><span data-ng-if="row.entity.pause" class="left-margin">({{row.entity.pauseType}})</span><i data-ng-if="row.entity.pause" data-ng-click="grid.appScope.pause(row.entity.agentId,\'unpause\')" class="icon-control-play font-green pointer-cursor left-margin" title="{{\'APPLICATION_RESUME\' | translate}}"></i><i class="icon-control-pause font-yellow pointer-cursor" data-ng-click="grid.appScope.pause(row.entity.agentId,\'pause\',\'DEFAULT PAUSE\')" title="{{\'APPLICATION_DEFAULT_PAUSE\' | translate}}"></i><select data-ng-if="grid.appScope.pauses.length" class="pause-select pointer-cursor" data-ng-model="grid.appScope.pauseType" data-ng-change="grid.appScope.pause(row.entity.agentId,\'pause\',grid.appScope.pauseType)"><option class="pointer-cursor" data-ng-repeat="pause in grid.appScope.pauses">{{pause.name}}</option></select></div>',filter:{type:m.filter.SELECT,selectOptions:[{value:"true",label:"PAUSED"},{value:"false",label:"NOT PAUSED"}]},enableSorting:!1,enableColumnMenu:!1},{name:"queue",displayName:"APPLICATION_QUEUE",headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",enableSorting:!1,enableFiltering:!1,enableColumnMenu:!1},{name:"action",displayName:"",width:170,cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div><button data-ng-if="row.entity.queueId" class="btn btn-xs red-sunglo" data-ng-click="grid.appScope.leaveQueue(row.entity.agentId,row.entity.queueId)"><i class="icon-ban"></i> {{\'APPLICATION_LEAVE\' | translate}}</button><button data-ng-if="row.entity.isAgent && row.treeNode.children.length < grid.appScope.chatQueues.length" class="btn btn-xs blue-hoki" data-ng-click="grid.appScope.joinQueue(row.entity.agentId)"><i class="icon-plus"></i> {{\'APPLICATION_JOIN_QUEUE\' | translate}}</button> <button data-ng-if="row.entity.isAgent" class="btn btn-xs blue-madison" data-ng-click="grid.appScope.showInfo(row.entity)"><i class="icon-info"></i> {{\'APPLICATION_INFO\' | translate}}</button><div>',enableSorting:!1,enableFiltering:!1,enableColumnMenu:!1}],data:[],gridMenuTitleFilter:function(a){var b=l.defer();return b.resolve(d.instant(a)),b.promise},onRegisterApi:function(b){a.gridApi=b,a.gridApi.grid.registerDataChangeCallback(function(){t(a.gridApi.core.getVisibleRows(a.gridApi.grid).length)}),a.gridApi.treeBase.on.rowExpanded(a,function(b){t(a.gridApi.core.getVisibleRows(a.gridApi.grid).length+b.treeNode.children.length)}),a.gridApi.treeBase.on.rowCollapsed(a,function(b){t(a.gridApi.core.getVisibleRows(a.gridApi.grid).length-b.treeNode.children.length)}),a.gridApi.core.on.sortChanged(a,function(a,b){0===b.length?s.order=null:s.order=b[0].name+" "+b[0].sort.direction.toUpperCase(),n()}),a.gridApi.pagination.on.paginationChanged(a,function(a,b){s.offset=(a-1)*b,s.limit=b,n()}),a.gridApi.core.on.filterChanged(a,function(){var a=this.grid;a.columns.forEach(function(a){a.filters[0].term?s[a.name]=a.filters[0].term:delete s[a.name]}),n()})}},n(),q(),r(),o()};var t=function(a){var b=a?30*a+130:270;angular.element(document.getElementsByClassName("ui-grid")[0]).css("height",b+"px"),angular.element(document.getElementsByClassName("ui-grid-viewport")).css("height",30*a+"px")};a.$on("$destroy",function(){e.unsyncUpdates("agent"),e.unsyncUpdates("user_has_chat_queue")}),a.pause=function(a,b,c){return i.save({name:b,agent:a,type:c||"DEFAULT PAUSE",data4:c||"DEFAULT PAUSE",channel:"chat"}).$promise.then(function(){f.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){f.show(a.message,"danger")})},a.joinQueue=function(e){var g=c.open({animation:!0,templateUrl:"app/channels/chat/realtime/view/agent/queue.modal.add.html",controller:"ChatRealtimeViewAgentQueueModalCtrl",resolve:{queues:function(){return _.reject(a.chatQueues,function(b){return _.find(a.gridOptions.data,{queue:b.name,isAgent:!1,agentId:e})?!0:!1})}}});g.result.then(function(b){return i.save({name:"QueueAdd",agent:e,queues:_.filter(a.chatQueues,function(a){return _.includes(b.queues,a.id)}),channel:"chat",data1:e,data3:b.queues.join(","),data4:"chat"}).$promise.then(function(){f.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){f.show(a.message,"danger")})},function(){b.info("Modal dismissed at: "+new Date)})},a.leaveQueue=function(a,b){return i.save({name:"QueueRemove",agent:a,queueId:b,channel:"chat",data1:a,data3:b,data4:"chat"}).$promise.then(function(){f.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){f.show(a.message,"danger")})},a.showInfo=function(a){c.open({animation:!0,templateUrl:"app/channels/chat/realtime/view/agent/agent.modal.info.html",controller:"ChatRealtimeViewAgentInfoModalCtrl",resolve:{agent:a}})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.realtime.view.agents",{url:"/agents",templateUrl:"app/channels/chat/realtime/view/agent/agent.html",controller:"ChatRealtimeViewAgentCtrl"})}]),angular.module("xCallyShuttleApp").controller("ChatRealtimeViewAgentInfoModalCtrl",["$scope","$uibModalInstance","$http","agent",function(a,b,c,d){a.agent=d,a.close=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("ChatRealtimeViewAgentQueueModalCtrl",["$scope","$uibModalInstance","$http","queues",function(a,b,c,d){a.queues=d,a.item={},a.save=function(){b.close(a.item)},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("ChatRealtimeViewQueueCtrl",["$scope","$http","socket","ChatQueue","Agent",function(a,b,c,d,e){a.initQueues=function(){a.gridOptions={enableSorting:!1,enableFiltering:!0,enableHorizontalScrollbar:0,enableVerticalScrollbar:0,showTreeExpandNoChildren:!1,columnDefs:[{name:"queueName",displayName:"Queue"},{name:"fullname",displayName:"Agent",cellClass:"text-center"},{name:"online",cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div><i data-ng-if="row.entity.online != null" class="icon-user" data-ng-class="row.entity.online ? \'font-green\' : \'font-red\'"></i></div>'},{name:"chatPause",cellClass:"text-center ui-grid-vcenter",cellTemplate:"<div><i data-ng-if=\"row.entity.chatPause != null\" data-ng-class=\"row.entity.chatPause ? 'icon-control-pause font-red' : 'icon-control-play font-green'\"></i></div>"},{name:"pauseType",cellClass:"text-center",cellTemplate:'<span data-ng-if="row.entity.chatPause">{{row.entity.pauseType}}</span>'},{name:"lastLoginAt",cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div><time data-ng-if="row.entity.lastLoginAt" is="relative-time" datetime="{{row.entity.lastLoginAt}}">April 1, 2014</time></div>'}],onRegisterApi:function(b){a.gridApi=b,a.gridApi.treeBase.on.rowExpanded(a,function(b){var c=_.findIndex(a.gridOptions.data,{$$hashKey:b.entity.$$hashKey});b.entity.Users&&b.entity.Users.forEach(function(b){_.find(a.gridOptions.data,{name:b.name})||a.gridOptions.data.splice(c+1,0,b)})})}},d.get(function(b){a.gridOptions.data=[],b.rows.forEach(function(b){b.$$treeLevel=0,b.queueName=b.name,a.gridOptions.data.push(b),b.Users&&b.Users.forEach(function(b){b.agentName=b.name,a.gridOptions.data.push(b)})}),c.socket.on("agent:save",function(b){var c=_.filter(a.gridOptions.data,{agentName:b.name});c.forEach(function(a){a.online=b.online,a.lastLoginAt=b.lastLoginAt})}),c.socket.on("chat_queue:save",function(b){b.$$treeLevel=0,b.queueName=b.name,a.gridOptions.data.push(b)}),c.socket.on("chat_queue:remove",function(b){_.remov(a.gridOptions.data,{queueName:b.name})}),c.socket.on("user_has_chat_queue:save",function(b){var c=_.findIndex(a.gridOptions.data,function(a){return a.queueName&&a.id===b.ChatQueueId});e.get({id:b.UserId}).$promise.then(function(b){a.gridOptions.data.splice(c+1,0,{id:b.id,name:b.name,fullname:b.fullname,agentName:b.name,online:b.online,lastLoginAt:b.lastLoginAt})})["catch"](function(a){console.error(a)})}),c.socket.on("user_has_chat_queue:remove",function(b){for(var c=_.findIndex(a.gridOptions.data,function(a){return a.queueName&&a.id===b.ChatQueueId}),d=c+1;d<a.gridOptions.data.length;d++)a.gridOptions.data[d].id==b.UserId&&a.gridOptions.data.splice(d,1)})},function(a){console.error(a)})},a.conf={agentsByPage:{name:"10",value:10},labels:["fullname","name","email"]},a.agentsByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.$on("$destroy",function(){c.unsyncUpdates("report_mail:save"),c.unsyncUpdates("report_mail:update")}),a.initAgents=function(){b.get("/api/report/mails").success(function(b){a.agents=b,c.socket.on("report_mail:save",function(b){var c=_.find(a.agents,{id:b.id});c||a.agents.unshift(b)}),c.socket.on("report_mail:update",function(b){var c=_.find(a.agents,{id:b.id}),d=a.agents.indexOf(c);c&&_.merge(a.agents[d],b)})}).error(function(a){console.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.realtime.view.queues",{url:"/queues",templateUrl:"app/channels/chat/realtime/view/queue/queue.html",controller:"ChatRealtimeViewQueueCtrl"})}]),angular.module("xCallyShuttleApp").controller("ChatRealtimeViewSessionCtrl",["$scope","$http","socket","uiGridConstants",function(a,b,c,d){a.initSessions=function(){a.gridOptions={enableHorizontalScrollbar:0,enableVerticalScrollbar:0,columnDefs:[{name:"uniqueid",cellClass:"text-center",width:150,enableSorting:!1,enableFiltering:!0},{name:"application",displayName:"APPLICATION_APP",headerCellFilter:"translate",cellClass:"text-center"},{name:"queuename",displayName:"APPLICATION_QUEUE",headerCellFilter:"translate",cellClass:"text-center"},{name:"agentname",cellClass:"text-center"},{name:"websitename",displayName:"APPLICATION_WEB_SITE",headerCellFilter:"translate"},{name:"joinAt",cellClass:"text-center",cellTemplate:'<time data-ng-if="row.entity.joinAt" is="relative-time" datetime="{{row.entity.joinAt}}">April 1, 2014</time>',sort:{direction:d.DESC,priority:1}},{name:"leaveAt",cellClass:"text-center",cellTemplate:'<time data-ng-if="row.entity.leaveAt" is="relative-time" datetime="{{row.entity.leaveAt}}">April 1, 2014</time>'},{name:"unmanagedAt",cellClass:"text-center",cellTemplate:'<time data-ng-if="row.entity.unmanagedAt" is="relative-time" datetime="{{row.entity.unmanagedAt}}">April 1, 2014</time>'}],data:[]},b.get("/api/report/chat/sessions").success(function(b){a.gridOptions.data=b.rows,c.socket.on("report_chat_session:save",function(b){var c=_.find(a.gridOptions.data,{id:b.id}),d=a.gridOptions.data.indexOf(c);c?_.merge(a.gridOptions.data[d],b):a.gridOptions.data.unshift(b)})}).error(function(a){console.error(a)})},a.$on("$destroy",function(){c.unsyncUpdates("report_chat:save"),c.unsyncUpdates("report_chat:update")})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.realtime.view.sessions",{url:"/sessions",templateUrl:"app/channels/chat/realtime/view/session/session.html",controller:"ChatRealtimeViewSessionCtrl"})}]),angular.module("xCallyShuttleApp").controller("ChatRealtimeViewCtrl",["$scope",function(a){a.agents=[{name:"Queues",link:"main.chat.realtime.view.agent.queues"},{name:"Timeline",link:"main.chat.realtime.view.agent.timeline"}],a.sessions=[{name:"Sessions",link:"main.chat.realtime.view.sessions"}]}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.realtime.view",{url:"/view",templateUrl:"app/channels/chat/realtime/view/view.html",controller:"ChatRealtimeViewCtrl"})}]),angular.module("xCallyShuttleApp").controller("ChatVisitorListCtrl",["$scope","ChatVisitor","gridOptions","$uibModal",function(a,b,c,d){a.initView=function(){var d={exporterCsvFilename:"chat_visitors.csv",columnDefs:[{name:"fullname",cellClass:"text-center"},{name:"email",cellClass:"text-center"},{name:"origin",cellClass:"text-center"},{name:"createdAt",displayName:"createdAt",cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div><span am-time-ago="row.entity.createdAt"></span></div>'},{name:"action",width:100,buttons:[{"class":"blue-hoki",href:"/channels/chat/visitors/view/{{row.entity.id}}/profile",name:"profile"}]}]};a.gridOptions=c.gridOptions(b,d,a)}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.visitors.list",{url:"/list",templateUrl:"app/channels/chat/visitor/list/list.html",controller:"ChatVisitorListCtrl"})}]),angular.module("xCallyShuttleApp").controller("ChatVisitorViewCtrl",["$scope","$stateParams","ChatVisitor",function(a,b,c){a.initView=function(){return c.get({id:b.id}).$promise.then(function(b){a.chatVisitor=b})["catch"](function(a){console.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.visitors.view",{url:"/view/:id",templateUrl:"app/channels/chat/visitor/view/view.html",controller:"ChatVisitorViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.channels.chat.visitors.view.profile",{url:"/profile",templateUrl:"app/channels/chat/visitor/view/view.profile.html"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.visitors",{url:"/visitors",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").factory("ChatApplication",["$resource",function(a){return a("/api/chat/applications/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").factory("ChatWebsite",["$resource",function(a){return a("/api/chat/websites/:websiteId/:controller/:id",{id:"@websiteId"},{update:{method:"PUT"},updateFields:{method:"PUT",isArray:!0}})}]),angular.module("xCallyShuttleApp").controller("ChatWebsiteListCtrl",["$scope","gridOptions","ChatWebsite",function(a,b,c){a.initView=function(){var d={exporterCsvFilename:"chat_websites.csv",columnDefs:[{name:"name"},{name:"description"},{name:"address"},{name:"action",width:125,buttons:[{"class":"blue-hoki",href:"/channels/chat/websites/view/{{row.entity.id}}/embedding/view",name:"profile"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=b.gridOptions(c,d,a)}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.websites.list",{url:"/list",templateUrl:"app/channels/chat/website/list/list.html",controller:"ChatWebsiteListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.websites.view.actions",{url:"/actions",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("ChatWebsiteViewActionListCtrl",["$scope","gridOptions","ChatWebsite","$http","$translate","$stateParams","socket","xAlert","Modal",function(a,b,c,d,e,f,g,h,i){a.initActons=function(){var d={draggable:!0,exporterCsvFilename:"chat_applications.csv",columnDefs:[{name:"app",cellClass:"text-center"},{name:"name",cellClass:"text-center ui-grid-vcenter",cellTemplate:"<div><span>{{row.entity.ChatQueue ? row.entity.ChatQueue.name : row.entity.User.name}}</span></div>"},{name:"timeout",cellClass:"text-center"},{name:"interval",cellClass:"text-center"},{name:"action",width:125,buttons:[{"class":"blue-hoki",href:"/channels/chat/websites/view/{{row.entity.ChatWebsiteId}}/actions/view/{{row.entity.id}}",name:"profile"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.app, row.entity.id)"}]}]};a.gridOptions=b.gridOptions(c,d,a,{websiteId:f.websiteId,controller:"applications"})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.websites.view.actions.list",{url:"/list",templateUrl:"app/channels/chat/website/view/action/list/list.html",controller:"ChatWebsiteViewActionListCtrl"})}]),angular.module("xCallyShuttleApp").controller("ChatWebsiteViewActionViewCtrl",["$scope","$http","$stateParams","$translate","$location","xAlert","WizardHandler","socket","application","interval","ChatApplication","ChatQueue","Agent","Interval",function(a,b,c,d,e,f,g,h,i,j,k,l,m,n){a.isActive=!0,a.size="small",a.animate=!0,a.radioOff=!0,a.handleWidth="auto",a.labelWidth="auto",a.inverse=!0,a.offColor="danger",a.onColor="success",a.initAction=function(){return a.$application=i.application,a.$stateParams=c,a.$interval=j.interval,a.forms={},a.apps=[{name:"Queue",value:"queue"},{name:"Agent",value:"agent"}],k.get({id:c.actionId}).$promise.then(function(b){if(a.application=b,a.application.alwaysTime=!1,a.application.IntervalId)a.application.intType="list";else switch(a.application.interval){case"*,*,*,*":a.application.intType="always";break;default:a.application.intType="custom"}var c=a.application.interval.split(",");"*"===c[0]?a.application.alwaysTime=!0:(a.application.t_from=moment(new Date),a.application.t_to=moment(new Date),a.application.t_from.hour(c[0].split("-")[0].split(":")[0]),a.application.t_from.minute(c[0].split("-")[0].split(":")[1]),a.application.t_to.hour(c[0].split("-")[1].split(":")[0]),a.application.t_to.minute(c[0].split("-")[1].split(":")[1])),"*"===c[1]?(a.application.wd_from="always",a.application.wd_to="always"):(a.application.wd_from=c[1].split("-")[0],a.application.wd_to=c[1].split("-")[1]),"*"===c[2]?(a.application.md_from="always",a.application.md_to="always"):(a.application.md_from=c[2].split("-")[0],a.application.md_to=c[2].split("-")[1]),"*"===c[3]?(a.application.m_from="always",a.application.m_to="always"):(a.application.m_from=c[3].split("-")[0],a.application.m_to=c[3].split("-")[1]),a.$watch("application.t_from",function(b){a.application.t_from_hm=moment(b).format("HH:mm")}),a.$watch("application.t_to",function(b){a.application.t_to_hm=moment(b).format("HH:mm")})})["catch"](function(a){f.show(d.instant("Something went wrong!"),"danger")})},a.getQueues=function(){return l.get().$promise.then(function(b){a.queues=b.rows})["catch"](function(a){console.error(a)})},a.getAgents=function(){return m.get().$promise.then(function(b){a.agents=b.rows})["catch"](function(a){console.error(a)})},a.getIntervals=function(){return n.get().$promise.then(function(b){a.intervals=b.rows})["catch"](function(a){console.error(a)})},a.updateItem=function(){var b=["*","*","*","*"],e={app:a.application.app,timeout:a.application.timeout,chatAccountId:c.id};switch(a.application.app){case"agent":e.UserId=a.application.UserId;break;case"queue":e.chatQueueId=a.application.chatQueueId}switch(a.application.intType){case"always":e.interval=b.join(","),delete a.application.IntervalId;break;case"custom":a.application.alwaysTime||(b[0]=a.application.alwaysTime?"*":a.application.t_from_hm+"-"+a.application.t_to_hm),a.application.wd_from&&a.application.wd_to&&"always"===a.application.wd_from&&"always"===a.application.wd_to?b[1]="*":b[1]=a.application.wd_from&&a.application.wd_to?a.application.wd_from+"-"+a.application.wd_to:"*",a.application.md_from&&a.application.md_to&&"always"===a.application.md_from&&"always"===a.application.md_to?b[2]="*":b[2]=a.application.md_from&&a.application.md_to?a.application.md_from+"-"+a.application.md_to:"*",a.application.m_from&&a.application.m_to&&"always"===a.application.m_from&&"always"===a.application.m_to?b[3]="*":b[3]=a.application.m_from&&a.application.m_to?a.application.m_from+"-"+a.application.m_to:"*",e.interval=b.join(","),delete a.application.IntervalId;break;case"list":e.IntervalId=a.application.IntervalId}return k.update({id:c.actionId},e).$promise.then(function(){f.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){f.show(a.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.websites.view.actions.view",{url:"/view/:actionId",templateUrl:"app/channels/chat/website/view/action/view/view.html",controller:"ChatWebsiteViewActionViewCtrl"})}]),angular.module("xCallyShuttleApp").controller("ChatWebsiteViewActionWizardCtrl",["$scope","$http","Agent","Interval","ChatQueue","$stateParams","$translate","$location","xAlert","WizardHandler","socket","application","interval",function(a,b,c,d,e,f,g,h,i,j,k,l,m){a.isActive=!0,a.size="small",a.animate=!0,a.radioOff=!0,a.handleWidth="auto",a.labelWidth="auto",a.inverse=!0,a.offColor="danger",a.onColor="success",a.initWizard=function(){a.apps=[{name:"Queue",value:"queue"},{name:"Agent",value:"agent"}],a.$application=l.application,a.$stateParams=f,a.$interval=m.interval,a.forms={},a.application={app:"queue",intType:"always",alwaysTime:!0},a.$watch("application.t_from",function(b){a.application.t_from_hm=moment(b).format("HH:mm")}),a.$watch("application.t_to",function(b){a.application.t_to_hm=moment(b).format("HH:mm")})},a.getQueues=function(){return e.get().$promise.then(function(b){a.queues=b.rows})["catch"](function(a){console.error(a)})},a.getAgents=function(){return c.get().$promise.then(function(b){a.agents=b.rows})["catch"](function(a){console.error(a)})},a.getIntervals=function(){return d.get().$promise.then(function(b){a.intervals=b.rows})["catch"](function(a){console.error(a)})},a.createItem=function(){var c=["*","*","*","*"],d={app:a.application.app,timeout:a.application.timeout,ChatWebsiteId:f.websiteId};switch(a.application.app){case"agent":d.UserId=a.application.UserId;break;case"queue":d.ChatQueueId=a.application.ChatQueueId}switch(a.application.intType){case"always":d.interval=c.join(","),delete a.application.IntervalId;break;case"custom":a.application.alwaysTime||(c[0]=a.application.alwaysTime?"*":a.application.t_from_hm+"-"+a.application.t_to_hm),a.application.wd_from&&a.application.wd_to&&"always"===a.application.wd_from&&"always"===a.application.wd_to?c[1]="*":c[1]=a.application.wd_from&&a.application.wd_to?a.application.wd_from+"-"+a.application.wd_to:"*",a.application.md_from&&a.application.md_to&&"always"===a.application.md_from&&"always"===a.application.md_to?c[2]="*":c[2]=a.application.md_from&&a.application.md_to?a.application.md_from+"-"+a.application.md_to:"*",a.application.m_from&&a.application.m_to&&"always"===a.application.m_from&&"always"===a.application.m_to?c[3]="*":c[3]=a.application.m_from&&a.application.m_to?a.application.m_from+"-"+a.application.m_to:"*",d.interval=c.join(","),delete a.application.IntervalId;break;case"list":d.IntervalId=a.application.IntervalId}b.post("/api/chat/applications",d).success(function(){h.path("/channels/chat/websites/view/"+f.websiteId+"/actions/list")}).error(function(a){console.error(a)})},a.formValidation=function(a){return a},a.next=function(){j.wizard().next()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.websites.view.actions.wizard",{url:"/wizard",templateUrl:"app/channels/chat/website/view/action/wizard/wizard.html",controller:"ChatWebsiteViewActionWizardCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.websites.view.embedding",{url:"/embedding",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("ChatWebsiteViewEmbeddingViewCtrl",["$scope","$stateParams","$translate","clipboard","xAlert","ChatWebsite",function(a,b,c,d,e,f){a.initView=function(){return f.get({websiteId:b.websiteId,controller:"snippet"}).$promise.then(function(b){a.snippetCode=b.html})["catch"](function(a){e.show(a.message,"danger")})},a.copyToClipboard=function(){d.copyText(a.snippetCode),e.show(c.instant("MESSAGE_TEXT_COPIED_CLIPBOARD")+"!","success")}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.websites.view.embedding.view",{url:"/view",templateUrl:"app/channels/chat/website/view/embedding/view/view.html",controller:"ChatWebsiteViewEmbeddingViewCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.websites.view.form",{url:"/forms",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("ChatWebsiteViewFormViewCtrl",["$scope","$builder","$validator","$stateParams","$translate","ChatWebsite","xAlert",function(a,b,c,d,e,f,g){
-a.saveForm=function(a){var c=angular.copy(b.forms[a]);return c.length>3?g.show("You can insert at least 3 input elements","danger"):(_.forEach(c,function(a){delete a.id}),f.updateFields({websiteId:d.websiteId,controller:"fields",id:a},c).$promise.then(function(){g.show(e.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){g.show(a.message,"danger")}))},a.getChatWebsiteFields=function(a){return f.query({websiteId:d.websiteId,controller:"fields",id:a}).$promise.then(function(c){_.forEach(c,function(c){b.addFormObject(a,c)})})["catch"](function(a){console.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.websites.view.form.view",{url:"/view",templateUrl:"app/channels/chat/website/view/form/view/view.html",controller:"ChatWebsiteViewFormViewCtrl"})}]),angular.module("xCallyShuttleApp").controller("ChatWebsiteViewProactiveListCtrl",["$scope","gridOptions","ChatWebsite","$http","$translate","$stateParams","$uibModal",function(a,b,c,d,e,f,g){a.initProactiveActions=function(){var d={exporterCsvFilename:"telephones.csv",columnDefs:[{name:"name"},{name:"type"},{name:"action",width:125,buttons:[{"class":"blue-hoki",onClick:"grid.appScope.createItem(row.entity)",name:"profile"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=b.gridOptions(c,d,a,{websiteId:f.websiteId,controller:"proactive"})},a.createItem=function(b){var c=g.open({animation:!0,templateUrl:"app/channels/chat/website/view/proactive/list/list.create.modal.html",controller:"ChatWebsiteProactiveListCreateCtrl",resolve:{item:b}});c.result.then(function(b){a.gridOptions.getPage()})}}]),angular.module("xCallyShuttleApp").controller("ChatWebsiteProactiveListCreateCtrl",["$scope","$translate","$uibModalInstance","$stateParams","ChatWebsite","xAlert","item",function(a,b,c,d,e,f,g){a.form={},a.item=g||{},a.title=g?b.instant("APPLICATION_EDIT_PROACTIVE_ACTION"):b.instant("APPLICATION_NEW_PROACTIVE_ACTION"),a.possibleType=[{type:"mouseOver",title:"Mouse Over"},{type:"timeout",title:"Timeout"}],a.save=function(){return g?e.update({websiteId:d.websiteId,controller:"proactive",id:a.item.id},a.item).$promise.then(function(a){f.show(b.instant("MESSAGE_WELL_DONE"),"success"),c.close(a)})["catch"](function(a){f.show(a.data.message,"danger")}):e.save({websiteId:d.websiteId,controller:"proactive"},a.item).$promise.then(function(a){f.show(b.instant("MESSAGE_WELL_DONE"),"success"),c.close(a)})["catch"](function(a){f.show(a.data.message,"danger")})},a.cancel=function(){c.dismiss()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.websites.view.proactive.list",{url:"/list",templateUrl:"app/channels/chat/website/view/proactive/list/list.html",controller:"ChatWebsiteViewProactiveListCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.websites.view.proactive",{url:"/proactive",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.websites.view.snippet",{url:"/snippet",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("ChatWebsiteViewSnippetViewCtrl",["$scope","$http","$stateParams","$translate","Template",function(a,b,c,d,e){a.$translate=d,a.statePreview={state:"online"},a.enquirySwitch={onText:"On",offText:"Off",isActive:!0,size:"small",animate:!0,radioOff:!0,handleWidth:"auto",labelWidth:"auto",inverse:!0,offColor:"danger",onColor:"success"},a.lang={HeaderCurrentlyChatting:"Live Chat",HeaderOffline:"Contact us",OperatorOfflineMessage:"It appears as if all operators are currently offline.",OfflineMessage:"<strong>We're not online.</strong><br/>It doesn't mean we're not there to help - leave your message below and we'll be in touch as soon as possible.",EnquiryMessagePlaceholder:"Your message...",EnquiryButtonText:"Leave message",EnquirySubmitSuccess:"Your message was sucessfully submitted - we will contact you as soon as possible.",OperatorComposing:"{fullname} is typing...",FirstMessageText:"",ExitChatButtonText:"Exit Chat",ExitChatQuestionText:"Are you sure?",ExitChatButtonConfirmText:"Yes",ExitChatButtonCancelText:"No",MessagePlaceholderText:"Your message...",MessageSendButtonText:"Send",ValidationEmailRequired:"Please enter your email address",ValidationEmailInvalid:"Please enter a valid email address",ValidationEmailMaxLength:"The email address may not exceed 85 characters",ValidationUsernameRequired:"Please enter your name",ValidationUsernameMaxLength:"The name may not exceed 45 characters",ValidationEnquiryRequired:"Please enter your enquiry",ValidationEnquiryMaxLength:"The enquiry may not exceed 1500 characters",ValidationMessageRequired:"Please enter your message",ValidationMessageMaxLength:"The message may not exceed 750 characters"},a.initView=function(){e.get().$promise.then(function(b){console.log(b),a.mailTemplates=b.rows})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.websites.view.snippet.view",{url:"/view",templateUrl:"app/channels/chat/website/view/snippet/view/view.html",controller:"ChatWebsiteViewSnippetViewCtrl"})}]),angular.module("xCallyShuttleApp").controller("ChatWebsiteViewCtrl",["$scope","xAlert","$http","$location","$stateParams","$translate","WizardHandler","ChatApplication","ChatWebsite",function(a,b,c,d,e,f,g,h,i){a.initApplication=function(){a.forms={},a.application={}},a.goNext=function(){g.wizard().next()},a.formValidation=function(a){return a},a.deleteItem=function(a){return h["delete"]({id:a}).$promise.then(function(){b.show(f.instant("MESSAGE_WELL_DONE")+"!","success")})["catch"](function(a){b.show(f.instant("Something went wrong!"),"danger")})},a.initView=function(){return i.get({id:e.websiteId}).$promise.then(function(b){a.chatWebsite=b})["catch"](function(a){b.show(a.message,"danger")})},a.updateItem=function(){return i.update({id:a.chatWebsite.id},a.chatWebsite).$promise.then(function(){b.show(f.instant("MESSAGE_CHAT_WEBSITE_UPDATE_SUCCESS")+"!","success")})["catch"](function(){b.show(f.instant("MESSAGE_CHAT_WEBSITE_UPDATE_FAILURE"),"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.websites.view",{url:"/view/:websiteId",templateUrl:"app/channels/chat/website/view/view.html",controller:"ChatWebsiteViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/css/profile.css","assets/css/tasks.css"]}])}]}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.websites",{url:"/websites",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("ChatWebsiteWizardCtrl",["$scope","$http","$location","$translate","WizardHandler","xAlert","ChatWebsite",function(a,b,c,d,e,f,g){a.$translate=d,a.forms={formSetting:void 0,formAppearance:void 0,formLabel:void 0,formFunctionality:void 0},a.next=function(){e.wizard().next()},a.exitValidation=function(a){return a},a.item={},a.createItem=function(){return g.save(a.item).$promise.then(function(){f.show(d.instant("MESSAGE_CHAT_WEBSITE_CREATE_SUCCESS"),"success"),c.path("/channels/chat/websites/list")})["catch"](function(a){f.show(d.instant("MESSAGE_CHAT_WEBSITE_CREATE_FAILURE"),"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.chat.websites.wizard",{url:"/wizard",templateUrl:"app/channels/chat/website/wizard/wizard.html",controller:"ChatWebsiteWizardCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.fax.accounts",{url:"/accounts",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").controller("FaxAccountListCtrl",["$scope","$http","xAlert","$translate","socket","Modal","$rootScope","$log","stResource",function(a,b,c,d,e,f,g,h,i){a.conf={faxAccountsByPage:{name:"10",value:10}},a.faxAccountsByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.fax_accounts={checked:[]},a.check=function(b,c){c?a.fax_accounts.checked=angular.copy(_.map(a.displayedFaxAccounts,"id")):a.fax_accounts.checked=[]},a.initList=function(b){e.unsyncUpdates("fax_account"),b.url="/api/fax/accounts",i.getPage(b).then(function(c){a.displayedFaxAccounts=c.rows,b.pagination.numberOfPages=c.total_pages,g.updateTableConfig(a.faxAccountsByPage,a.displayedFaxAccounts.length),g.updateTableConfig(a.conf.faxAccountsByPage,a.displayedFaxAccounts.length)}),e.socket.on("fax_account:save",function(){a.initList(b)}),e.socket.on("fax_account:remove",function(c){a.fax_accounts.checked=_.without(a.fax_accounts.checked,c.id),a.initList(b)})},a.deleteItem=f.confirm["delete"](function(a){b["delete"]("api/fax/accounts/"+a).success(function(){c.show(d.instant("MESSAGE_FAX_ACCOUNT_DELETE_SUCCESS"),"success")}).error(function(){c.show(d.instant("MESSAGE_FAX_ACCOUNT_DELETE_FAILURE"),"danger")})}),a.deleteItems=f.confirm["delete"](function(){b["delete"]("/api/fax/accounts",{params:{id:a.fax_accounts.checked}}).success(function(){c.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){c.show(d.instant(a.message),"danger")})}),a.getFaxAccounts=function(b){return _.map(a.faxAccountsByPage,function(a){var c={};return b.forEach(function(b){c[b]=a[b]}),c})},a.$on("$destroy",function(){e.unsyncUpdates("fax_account")})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.fax.accounts.list",{url:"/list",templateUrl:"app/channels/fax/account/list/list.html",controller:"FaxAccountListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").controller("FaxAccountViewCtrl",["$scope","$http","$stateParams","$translate","$location","WizardHandler","socket","xAlert","Modal",function(a,b,c,d,e,f,g,h,i){a.isActive=!0,a.size="small",a.animate=!0,a.radioOff=!0,a.handleWidth="auto",a.labelWidth="auto",a.inverse=!0,a.offColor="danger",a.onColor="success",a.forms={},a.sortableOptions={stop:function(){b.post("api/fax/accounts/"+c.id+"/applications",{applications:_.map(a.faxApplications,"id")}).success(function(b){a.faxApplications=b}).error(function(a){console.error(a)})},"ui-floating":!0},a.goNext=function(){f.wizard().next()},a.formValidation=function(a){return a},a.initApplication=function(){a.forms={},a.application={}},a.deleteItem=i.confirm["delete"](function(a){b["delete"]("api/fax/applications/"+a).success(function(){h.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(){h.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})}),a.getAppdata=function(b,c){switch(b){case"agent":return a.agents?_.find(a.agents,{id:c}).name:c;case"queue":return a.faxQueues?_.find(a.faxQueues,{id:c}).name:c}return"UNKNOWN"},a.createItem=function(){switch(a.application.appdata=a.application.appdata.id,a.application.app){case"agent":a.application.UserId=parseInt(a.application.appdata,10);break;case"queue":a.application.FaxQueueId=parseInt(a.application.appdata,10)}a.application.FaxAccountId=c.id,b.post("api/fax/applications",a.application).success(function(){e.path("/channels/fax/accounts/view/"+c.id+"/routes")}).error(function(){h.show("Something went wrong!","danger")})},a.$watch("application.app",function(c){if(c){var d;switch(c){case"agent":d="api/agents";break;case"queue":d="api/fax/queues"}b.get(d).success(function(b){a.items=b.rows})}},!0),a.initView=function(){b.get("/api/trunks").success(function(b){a.trunks=b.rows}).error(function(a){console.log(a)}),b.get("/api/fax/accounts/"+c.id).success(function(b){a.account=b}).error(function(){})},a.getAgents=function(){b.get("api/fax/agents").success(function(b){a.agents=b})},a.getFaxApplications=function(){b.get("/api/fax/applications",{params:{FaxAccountId:c.id}}).success(function(b){a.faxApplications=b,g.socket.on("fax_application:remove",function(b){_.remove(a.faxApplications,{id:b.id})})}),b.get("/api/agents").success(function(b){a.agents=b.rows}),b.get("/api/fax/queues").success(function(b){a.faxQueues=b.rows})},a.updateItemFaxAccount=function(){b.put("/api/fax/accounts/"+c.id,a.account).success(function(){h.show(d.instant("MESSAGE_FAX_ACCOUNT_UPDATE_SUCCESS")+".","success")}).error(function(){h.show(d.instant("MESSAGE_FAX_ACCOUNT_UPDATE_FAILURE")+".","danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.fax.accounts.view",{url:"/view/:id",templateUrl:"app/channels/fax/account/view/view.html",controller:"FaxAccountViewCtrl",authenticate:!0,resolve:{deps:["$ocLazyLoad",function(a){return a.load({insertBefore:"#ng_load_plugins_before",files:["assets/css/profile.css","assets/css/tasks.css"]})}]}}).state("main.channels.fax.accounts.view.settings",{url:"/settings",templateUrl:"app/channels/fax/account/view/view.settings.html",authenticate:!0}).state("main.channels.fax.accounts.view.routes",{url:"/routes",templateUrl:"app/channels/fax/account/view/view.routes.html",authenticate:!0}).state("main.channels.fax.accounts.view.applications",{url:"/applications",templateUrl:"app/channels/fax/account/view/view.applications.html",authenticate:!0})}]),angular.module("xCallyShuttleApp").controller("FaxAccountWizardCtrl",["$scope","$http","$location","$translate","xAlert","WizardHandler",function(a,b,c,d,e,f){a.translate=d,a.isActive=!0,a.size="small",a.animate=!0,a.radioOff=!0,a.handleWidth="auto",a.labelWidth="auto",a.inverse=!0,a.offColor="danger",a.onColor="success",a.initWizard=function(){a.$translate=d,a.forms={},a.item={},a.item.ecm=!1,a.item.minrate="9600",a.item.maxrate="33600",b.get("/api/trunks").success(function(b){a.trunks=b.rows}).error(function(a){console.error(a)})},a.next=function(){f.wizard().next()},a.exitValidation=function(a){return a},a.createItem=function(){b.post("api/fax/accounts",a.item).success(function(){e.show(d.instant("MESSAGE_FAX_ACCOUNT_CREATE_SUCCESS")+".","success"),c.path("/channels/fax/accounts/list")}).error(function(){e.show(d.instant("MESSAGE_FAX_ACCOUNT_CREATE_FAILURE")+".","danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.fax.accounts.wizard",{url:"/wizard",templateUrl:"app/channels/fax/account/wizard/wizard.html",controller:"FaxAccountWizardCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.fax",{url:"/fax",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("FaxInboxComposeCtrl",["$scope","$http","FileUploader","$location","Auth","xAlert","$cookieStore","$translate",function(a,b,c,d,e,f,g,h){a.forms={},a.form={to:[],sto:[]},b.get("api/fax/accounts").success(function(b){a.faxAccounts=b.rows}),a.isNewMessageFromEmpty=!0;var i=a.uploader=new c({url:"api/fax/messages",queueLimit:1,withCredentials:!0,headers:{Authorization:"Bearer "+g.get("token")}});i.filters.push({name:"pdfFilter",fn:function(a){var b="|"+a.type.slice(a.type.lastIndexOf("/")+1)+"|";return-1!=="|pdf|".indexOf(b)}}),i.onBeforeUploadItem=function(b){b.formData.push({accountId:a.form.from.id,toNum:a.form.sto[0],isNewRoom:a.isNewMessageFromEmpty,userId:e.getCurrentUser().id,html:a.form.html?a.form.html:""})},i.onSuccessItem=function(a,b,c,d){console.info("onSuccessItem",a,b,c,d)},i.onErrorItem=function(a,b,c,d){console.info("onErrorItem",a,b,c,d)},i.onCompleteAll=function(){i.clearQueue(),f.show(h.instant("MESSAGE_WELL_DONE"),"success"),d.path("/channels/fax/inbox/incoming")},i.onWhenAddingFileFailed=function(){f.show(h.instant("MESSAGE_WRONG_FORMAT"),"danger")},a.sendFax=function(){return a.form.sto.length?void(i.queue.length?i.uploadAll():b.post("api/fax/messages",{accountId:a.form.from.id,toNum:a.form.sto[0],isNewRoom:a.isNewMessageFromEmpty,userId:e.getCurrentUser().id,html:a.form.html,onlyText:!0}).success(function(){f.show(h.instant("MESSAGE_WELL_DONE"),"success"),d.path("/channels/fax/inbox/incoming")}).error(function(a){f.show(h.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger"),console.error(a)})):(a.forms.compose.to.$valid=!1,void(a.forms.compose.to.$invalid=!0))},a.cancel=function(){a.form.sto=[],delete a.form.from}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.fax.inbox.compose",{url:"/compose",templateUrl:"app/channels/fax/inbox/room/room.html",controller:"FaxInboxComposeCtrl"})}]),angular.module("xCallyShuttleApp").controller("FaxInboxCtrl",["$scope","$http","$location","$translate","$timeout","$notification","Auth","socket","$interval",function(a,b,c,d,e,f,g,h,i){a.go=function(a,d,e){e?b.put("/api/fax/rooms/"+d,{status:e}).success(function(){c.path(a)}).error(function(a){console.error(a)}):c.path(a)}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.fax.inbox",{url:"/inbox",templateUrl:"app/channels/fax/inbox/inbox.html",controller:"FaxInboxCtrl",authenticate:!0,resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/inbox.css","assets/css/todo.css"]}])}]}})}]),angular.module("xCallyShuttleApp").controller("FaxInboxIncomingCtrl",["$scope","$http","$location","socket","Auth","xAlert",function(a,b,c,d,e,f){a.$location=c,a.getRooms=function(){e.isAdmin()?b.get("api/fax/rooms").success(function(b){a.faxRooms=b,d.syncUpdates("fax_room",a.faxRooms)}).error(function(a){console.error(a),f.show($translate.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")}):b.get("api/fax/rooms/agent/"+e.getCurrentUser().id).success(function(b){a.faxRooms=b,d.socket.on("fax_room:update",function(b){b.UserId===e.getCurrentUser().id&&a.faxRooms.push(b)})}).error(function(a){f.show($translate.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger"),console.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.fax.inbox.incoming",{url:"/incoming",templateUrl:"app/channels/fax/inbox/incoming/incoming.html",controller:"FaxInboxIncomingCtrl"})}]),angular.module("xCallyShuttleApp").controller("FaxInboxRoomCtrl",["$scope","$http","$stateParams","$location","FileUploader","socket","Auth","xAlert","$translate","$cookieStore",function(a,b,c,d,e,f,g,h,i,j){function k(){a.lastMessage=_.reject(a.faxRoom.FaxMessages,function(a){return"RECEIVED"!==a.status}),a.lastMessage=_.sortByOrder(a.lastMessage,["id"],["desc"])[0],a.lastMessage&&(console.log(a.faxRoom),a.form.from=a.faxRoom.FaxAccount,a.form.to=[a.lastMessage.From.phone],a.form.sto=[a.lastMessage.From.phone])}var l=a.uploader=new e({url:"api/fax/messages",queueLimit:1,withCredentials:!0,headers:{Authorization:"Bearer "+j.get("token")}});l.filters.push({name:"pdfFilter",fn:function(a){var b="|"+a.type.slice(a.type.lastIndexOf("/")+1)+"|";return-1!=="|pdf|".indexOf(b)}}),l.onBeforeUploadItem=function(b){console.log(a.form.from.id,a.form.sto[0],a.isNewMessageFromEmpty,c.id,g.getCurrentUser().id),b.formData.push({accountId:a.form.from.id,toNum:a.form.sto[0],isNewRoom:a.isNewMessageFromEmpty,roomId:c.id,userId:g.getCurrentUser().id,html:a.form.html}),console.log(b)},l.onSuccessItem=function(a,b,c,d){console.info("onSuccessItem",a,b,c,d)},l.onErrorItem=function(a,b,c,d){console.info("onErrorItem",b,c,d)},l.onCompleteAll=function(){l.clearQueue(),h.show(i.instant("MESSAGE_WELL_DONE"),"success")},l.onWhenAddingFileFailed=function(){h.show(i.instant("MESSAGE_WRONG_FORMAT"),"danger")},a.initRoomView=function(){a.isNewMessageFromEmpty=!0,a.Auth=g,a.forms={},a.form={to:[],sto:[]},b.get("api/agents").success(function(b){a.agents=b}),b.get("api/fax/accounts").success(function(b){a.faxAccounts=b.rows}),c.id&&b.get("/api/fax/rooms/"+c.id).success(function(b){a.faxRoom=b,a.isNewMessageFromEmpty=!1,f.syncUpdates("fax_message",[],function(b,c){"created"===b&&c.FaxRoomId===a.faxRoom.id&&(a.faxRoom.FaxMessages.push(c),k())}),k()}).error(function(a){console.error(a),h.show(i.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})},a.sendFax=function(){return a.form.sto.length?void(l.queue.length?l.uploadAll():b.post("api/fax/messages",{accountId:a.form.from.id,toNum:a.form.sto[0],isNewRoom:a.isNewMessageFromEmpty,userId:g.getCurrentUser().id,html:a.form.html,onlyText:!0}).success(function(){h.show(i.instant("MESSAGE_WELL_DONE"),"success"),console.log("Fax Message sent")}).error(function(a){h.show(i.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger"),console.error(a)})):(a.forms.compose.to.$valid=!1,void(a.forms.compose.to.$invalid=!0))},a.assignAgent=function(a){b.put("/api/fax/rooms/"+c.id,{UserId:a}).success(function(){h.show(i.instant("MESSAGE_WELL_DONE"),"danger")}).error(function(){h.show(i.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})},a.updateStatus=function(d){b.put("/api/fax/rooms/"+c.id,{status:d}).success(function(b){a.faxRoom.status=b.status,h.show(i.instant("MESSAGE_WELL_DONE"),"danger")}).error(function(a){console.error(a),h.show(i.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})},a.cancel=function(){a.form.sto=[],delete a.form.from,l.clearQueue()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.fax.inbox.room",{url:"/room/:id",templateUrl:"app/channels/fax/inbox/room/room.html",controller:"FaxInboxRoomCtrl"})}]),angular.module("xCallyShuttleApp").factory("FaxQueue",["$resource",function(a){return a("/api/fax/queues/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").controller("FaxQueueListCtrl",["$scope","FaxQueue","gridOptions","$uibModal",function(a,b,c,d){a.initView=function(){var d={exporterCsvFilename:"fax_queues.csv",columnDefs:[{name:"name"},{name:"description"},{name:"strategy"},{name:"timeout"},{name:"action",width:125,buttons:[{"class":"blue-hoki",href:"/channels/fax/queues/view/{{row.entity.id}}/settings",name:"profile"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=c.gridOptions(b,d,a)},a.createItem=function(){var b=d.open({animation:!0,templateUrl:"app/channels/fax/queue/list/list.create.modal.html",controller:"FaxQueueListCreateCtrl"});b.result.then(function(b){console.log(b),a.gridOptions.getPage()})}}]),angular.module("xCallyShuttleApp").controller("FaxQueueListCreateCtrl",["$scope","$uibModalInstance","$translate","xAlert","FaxQueue",function(a,b,c,d,e){a.form={},a.item={},a.save=function(){return e.save(a.item).$promise.then(function(a){d.show(c.instant("MESSAGE_WELL_DONE"),"success"),b.close(a)})["catch"](function(a){d.show(a.data.message,"danger")})},a.cancel=function(){b.dismiss()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.fax.queues.list",{url:"/list",templateUrl:"app/channels/fax/queue/list/list.html",controller:"FaxQueueListCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.fax.queues",{url:"/queues",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").controller("FaxQueueViewCtrl",["$scope","$http","$translate","$stateParams","xAlert","FaxQueue","Team",function(a,b,c,d,e,f,g){var h=function(){return{select:function(b){return f.save({id:a.queue.id,controller:"agents"},{agents:b,penalty:a.queue.penalty}).$promise.then(function(){a.getTeams()})["catch"](function(a){console.error(a)})},deselect:function(b){return f["delete"]({id:a.queue.id,controller:"agents",agents:b}).$promise.then(function(){a.getTeams()})["catch"](function(a){console.error(a)})}}};a.getQueue=function(){return f.get({id:d.id}).$promise.then(function(b){b.penalty=0,a.queue=b})["catch"](function(a){e.show(a.message,"danger")})},a.updateFaxQueue=function(){return f.update({id:d.id},{name:a.queue.name,description:a.queue.description,timeout:a.queue.timeout,strategy:a.queue.strategy}).$promise.then(function(){e.show(c.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){e.show(a.message,"danger")})},a.getTeams=function(){return g.get().$promise.then(function(b){return a.teams=b.rows,f.query({id:d.id,controller:"agents"}).$promise}).then(function(b){ComponentsDropdowns.bindMailQueue(a.teams,_.map(b,function(a){return{id:a.id,penalty:a.UserHasFaxQueue.penalty}}),h)})["catch"](function(a){console.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.fax.queues.view",{url:"/view/:id",templateUrl:"app/channels/fax/queue/view/view.html",controller:"FaxQueueViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.channels.fax.queues.view.settings",{url:"/settings",templateUrl:"app/channels/fax/queue/view/view.settings.html"}).state("main.channels.fax.queues.view.agents",{url:"/agents",templateUrl:"app/channels/fax/queue/view/view.agents.html",cache:!1,serie:!0,resolve:{deps:["$ocLazyLoad",function(a){return a.load({insertBefore:"#ng_load_plugins_before",files:["assets/plugins/jquery-multi-select/css/multi-select.css","assets/plugins/jquery-multi-select/js/jquery.multi-select.js","assets/plugins/jquery-quicksearch/jquery.quicksearch.js","assets/scripts/components-dropdowns.js"]})}]}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.fax.realtime",{url:"/realtime",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").controller("FaxRealtimeViewAgentCtrl",["$scope","$log","$uibModal","$translate","socket","xAlert","Agent","Pause","Action","FaxQueue","usSpinnerService","$q","uiGridConstants",function(a,b,c,d,e,f,g,h,i,j,k,l,m){function n(){return k.spin("spinner-grid"),g.get(s).$promise.then(function(b){a.gridOptions.totalItems=b.count,a.gridOptions.data=[],b.rows.forEach(function(a){p(a)})})["catch"](function(a){f.show(a.message,"danger")})["finally"](function(){k.stop("spinner-grid")})}function o(){e.socket.on("agent:save",function(b){var c=_.find(a.gridOptions.data,{agentId:b.id,isAgent:!0});if(c){var d=a.gridOptions.data.indexOf(c);a.gridOptions.data[d].online=b.online,a.gridOptions.data[d].lastLoginAt=b.lastLoginAt,a.gridOptions.data[d].pause=b.faxPause,a.gridOptions.data[d].pauseType=b.pauseType,a.gridOptions.data[d].lastPauseAt=b.lastPauseAt,a.gridOptions.data[d].ipaddr=b.ipaddr,a.gridOptions.data[d].port=b.port,a.gridOptions.data[d].fullcontact=b.fullcontact,a.gridOptions.data[d].useragent=b.useragent,a.gridOptions.data[d].lastms=b.lastms,a.gridOptions.data[d].internal=b.internal,_.map(a.gridOptions.data,function(a){a.isAgent||a.agentId!==b.id||(a.online=b.online)})}}),e.socket.on("agent:remove",function(b){_.remove(a.gridOptions.data,{agentId:b.id})}),e.socket.on("user_has_fax_queue:save",function(b){console.log("new queue",b);var c=_.find(a.gridOptions.data,{agentId:b.UserId,isAgent:!0}),d=a.gridOptions.data.indexOf(c);a.gridOptions.data.splice(d+1,0,{isAgent:!1,agentId:b.UserId,queue:b.queue,queueId:b.FaxQueueId,agent:b.membername,online:c.online})}),e.socket.on("user_has_fax_queue:remove",function(b){_.remove(a.gridOptions.data,{agentId:b.UserId,queueId:b.FaxQueueId})})}function p(b){a.gridOptions.data.push({isAgent:!0,agentId:b.id,agent:b.name,online:b.online,lastLoginAt:b.lastLoginAt,lastPauseAt:b.lastPauseAt,pause:b.faxPause,pauseType:b.pauseType,ipaddr:b.ipaddr,port:b.port,fullcontact:b.fullcontact,useragent:b.useragent,lastms:b.lastms,internal:b.internal,$$treeLevel:0}),b.FaxQueues.forEach(function(c){a.gridOptions.data.push({isAgent:!1,agentId:b.id,queue:c.name,queueId:c.id,agent:b.name,online:b.online})})}function q(){return h.get().$promise.then(function(b){a.pauses=b.rows,e.syncUpdates("pause",a.pauses)})["catch"](function(a){f.show(a.message,"danger")})}function r(){return j.get().$promise.then(function(b){a.faxQueues=b.rows,e.syncUpdates("fax_queue",a.faxQueues)})["catch"](function(a){f.show(a.message,"danger")})}a.faxQueues=[];var s={offset:0,limit:10};a.moment=moment,a.initAgents=function(){a.gridOptions={enableGridMenu:!0,headerCellFilter:"translate",enableHorizontalScrollbar:0,enableVerticalScrollbar:0,enableFiltering:!0,showGridFooter:!0,paginationPageSizes:[10,25,50,75],paginationPageSize:10,useExternalPagination:!0,useExternalSorting:!0,useExternalFiltering:!0,multiSelect:!0,showTreeExpandNoChildren:!0,columnDefs:[{name:"name",displayName:"APPLICATION_AGENT",headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div data-ng-if="row.entity.isAgent">{{row.entity.agent}} &lt;{{row.entity.internal}}&gt;</div>'},{name:"online",displayName:"APPLICATION_ONLINE",width:150,headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div data-ng-if="row.entity.online != null && row.entity.isAgent"><i class="icon-user" data-ng-class="row.entity.online ? \'font-green\' : \'font-red\'"></i> <span data-ng-if="row.entity.online" class="left-margin">(<timer start-time="grid.appScope.moment(row.entity.lastLoginAt).unix()*1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>)</span></div>',filter:{type:m.filter.SELECT,selectOptions:[{value:"true",label:"ONLINE"},{value:"false",label:"OFFLINE"}]}},{name:"faxPause",width:300,displayName:"APPLICATION_PAUSE",headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div data-ng-if="row.entity.pause != null && row.entity.online" class="ui-grid-vcenter" data-ng-class="{\'paused-agent\':row.entity.pause}"><timer data-ng-if="row.entity.pause" start-time="grid.appScope.moment(row.entity.lastPauseAt).unix()*1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer></span><span data-ng-if="row.entity.pause" class="left-margin">({{row.entity.pauseType}})</span><i data-ng-if="row.entity.pause" data-ng-click="grid.appScope.pause(row.entity.agentId,\'unpause\')" class="icon-control-play font-green pointer-cursor left-margin" title="{{\'APPLICATION_RESUME\' | translate}}"></i><i class="icon-control-pause font-yellow pointer-cursor" data-ng-click="grid.appScope.pause(row.entity.agentId,\'pause\',\'DEFAULT PAUSE\')" title="{{\'APPLICATION_DEFAULT_PAUSE\' | translate}}"></i><select data-ng-if="grid.appScope.pauses.length" class="pause-select pointer-cursor" data-ng-model="grid.appScope.pauseType" data-ng-change="grid.appScope.pause(row.entity.agentId,\'pause\',grid.appScope.pauseType)"><option class="pointer-cursor" data-ng-repeat="pause in grid.appScope.pauses">{{pause.name}}</option></select></div>',filter:{type:m.filter.SELECT,selectOptions:[{value:"true",label:"PAUSED"},{value:"false",label:"NOT PAUSED"}]},enableSorting:!1,enableColumnMenu:!1},{name:"queue",displayName:"APPLICATION_QUEUE",headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",enableSorting:!1,enableFiltering:!1,enableColumnMenu:!1},{name:"action",displayName:"",width:170,cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div><button data-ng-if="row.entity.queueId" class="btn btn-xs red-sunglo" data-ng-click="grid.appScope.leaveQueue(row.entity.agentId,row.entity.queueId)"><i class="icon-ban"></i> {{\'APPLICATION_LEAVE\' | translate}}</button><button data-ng-if="row.entity.isAgent && row.treeNode.children.length < grid.appScope.faxQueues.length" class="btn btn-xs blue-hoki" data-ng-click="grid.appScope.joinQueue(row.entity.agentId)"><i class="icon-plus"></i> {{\'APPLICATION_JOIN_QUEUE\' | translate}}</button> <button data-ng-if="row.entity.isAgent" class="btn btn-xs blue-madison" data-ng-click="grid.appScope.showInfo(row.entity)"><i class="icon-info"></i> {{\'APPLICATION_INFO\' | translate}}</button><div>',
-enableSorting:!1,enableFiltering:!1,enableColumnMenu:!1}],data:[],gridMenuTitleFilter:function(a){var b=l.defer();return b.resolve(d.instant(a)),b.promise},onRegisterApi:function(b){a.gridApi=b,a.gridApi.grid.registerDataChangeCallback(function(){t(a.gridApi.core.getVisibleRows(a.gridApi.grid).length)}),a.gridApi.treeBase.on.rowExpanded(a,function(b){t(a.gridApi.core.getVisibleRows(a.gridApi.grid).length+b.treeNode.children.length)}),a.gridApi.treeBase.on.rowCollapsed(a,function(b){t(a.gridApi.core.getVisibleRows(a.gridApi.grid).length-b.treeNode.children.length)}),a.gridApi.core.on.sortChanged(a,function(a,b){0===b.length?s.order=null:s.order=b[0].name+" "+b[0].sort.direction.toUpperCase(),n()}),a.gridApi.pagination.on.paginationChanged(a,function(a,b){s.offset=(a-1)*b,s.limit=b,n()}),a.gridApi.core.on.filterChanged(a,function(){var a=this.grid;a.columns.forEach(function(a){a.filters[0].term?s[a.name]=a.filters[0].term:delete s[a.name]}),n()})}},n(),q(),r(),o()};var t=function(a){var b=a?30*a+130:270;angular.element(document.getElementsByClassName("ui-grid")[0]).css("height",b+"px"),angular.element(document.getElementsByClassName("ui-grid-viewport")).css("height",30*a+"px")};a.$on("$destroy",function(){e.unsyncUpdates("agent"),e.unsyncUpdates("user_has_fax_queue")}),a.pause=function(a,b,c){return i.save({name:b,agent:a,type:c||"DEFAULT PAUSE",data4:c||"DEFAULT PAUSE",channel:"fax"}).$promise.then(function(){f.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){f.show(a.message,"danger")})},a.joinQueue=function(e){var g=c.open({animation:!0,templateUrl:"app/channels/fax/realtime/view/agent/queue.modal.add.html",controller:"FaxRealtimeViewAgentQueueModalCtrl",resolve:{queues:function(){return _.reject(a.faxQueues,function(b){return _.find(a.gridOptions.data,{queue:b.name,isAgent:!1,agentId:e})?!0:!1})}}});g.result.then(function(b){return i.save({name:"QueueAdd",agent:e,queues:_.filter(a.faxQueues,function(a){return _.includes(b.queues,a.id)}),channel:"fax",data1:e,data3:b.queues.join(","),data4:"fax"}).$promise.then(function(){f.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){f.show(a.message,"danger")})},function(){b.info("Modal dismissed at: "+new Date)})},a.leaveQueue=function(a,b){return i.save({name:"QueueRemove",agent:a,queueId:b,channel:"fax",data1:a,data3:b,data4:"fax"}).$promise.then(function(){f.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){f.show(a.message,"danger")})},a.showInfo=function(a){c.open({animation:!0,templateUrl:"app/channels/fax/realtime/view/agent/agent.modal.info.html",controller:"FaxRealtimeViewAgentInfoModalCtrl",resolve:{agent:a}})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.fax.realtime.view.agents",{url:"/agents",templateUrl:"app/channels/fax/realtime/view/agent/agent.html",controller:"FaxRealtimeViewAgentCtrl"})}]),angular.module("xCallyShuttleApp").controller("FaxRealtimeViewAgentInfoModalCtrl",["$scope","$uibModalInstance","$http","agent",function(a,b,c,d){a.agent=d,a.close=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("FaxRealtimeViewAgentQueueModalCtrl",["$scope","$uibModalInstance","$http","queues",function(a,b,c,d){a.queues=d,a.item={},a.save=function(){b.close(a.item)},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("FaxRealtimeViewCtrl",["$scope","$state",function(a,b){a.agents=[{name:"Queues",link:"main.channels.fax.realtime.view.agents.queues"},{name:"Timeline",link:"main.channels.fax.realtime.view.agents.timeline"}],a.sessions=[{name:"Sessions",link:"main.channels.fax.realtime.view.sessions"}],a.tree={queues:[{name:"Queues",link:"main.channels.fax.realtime.view.agents.queues"},{name:"Timeline",link:"main.channels.fax.realtime.view.agents.timeline"}],sessions:[{name:"Sessions",link:"main.channels.fax.realtime.view.sessions"}]}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.fax.realtime.view",{url:"/view",templateUrl:"app/channels/fax/realtime/view/view.html",controller:"FaxRealtimeViewCtrl"})}]),angular.module("xCallyShuttleApp").factory("MailAccount",["$resource",function(a){return a("/api/mail/accounts/:accountId/:controller/:id",{id:"@accountId"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.mail.accounts",{url:"/accounts",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").controller("MailAccountListCtrl",["$scope","gridOptions","MailAccount","$stateParams",function(a,b,c,d){a.initView=function(){var e={exporterCsvFilename:"mail_accounts.csv",columnDefs:[{name:"name"},{name:"description"},{name:"address"},{name:"MailServerIn.state",width:100,cellClass:"text-center ui-grid-vcenter",cellTemplate:"<div><span class=\"label label-sm\" data-ng-class=\"row.entity.MailServerIn.state === 'CONNECTED' ? 'label-success' : 'label-danger'\">{{row.entity.MailServerIn.state}}</span></div>",displayName:"IMAP",enableSorting:!1,enableFiltering:!1},{name:"MailServerOut.state",width:110,cellClass:"text-center ui-grid-vcenter",cellTemplate:"<div><span class=\"label label-sm\" data-ng-class=\"row.entity.MailServerOut.state === 'CONNECTED' ? 'label-success' : 'label-danger'\">{{row.entity.MailServerOut.state}}</span></div>",displayName:"SMTP",enableSorting:!1,enableFiltering:!1},{name:"action",width:125,buttons:[{"class":"blue-hoki",href:"/channels/mail/accounts/view/{{row.entity.id}}/settings",name:"profile"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=b.gridOptions(c,e,a,{accountId:d.accountId})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.mail.accounts.list",{url:"/list",templateUrl:"app/channels/mail/account/list/list.html",controller:"MailAccountListCtrl"})}]),angular.module("xCallyShuttleApp").factory("MailServerIn",["$resource",function(a){return a("/api/mail/servers/in/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").factory("MailServerOut",["$resource",function(a){return a("/api/mail/servers/out/:id/:controller",{id:"@id"},{update:{method:"PUT"},test:{method:"GET"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.mail.accounts.view.actions",{url:"/actions",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("MailAccountViewActionListCtrl",["$scope","gridOptions","MailAccount","$http","$translate","$stateParams",function(a,b,c,d,e,f){a.initActons=function(){var d={draggable:!0,exporterCsvFilename:"mail_applications.csv",enableSorting:!1,enableFiltering:!1,columnDefs:[{name:"app",cellClass:"text-center"},{name:"name",cellClass:"text-center ui-grid-vcenter",cellTemplate:"<div><span>{{row.entity.MailQueue ? row.entity.MailQueue.name : row.entity.User.name}}</span></div>"},{name:"timeout",cellClass:"text-center"},{name:"interval",cellClass:"text-center"},{name:"action",width:125,buttons:[{"class":"blue-hoki",href:"/channels/mail/accounts/view/{{row.entity.MailAccountId}}/actions/view/{{row.entity.id}}",name:"profile"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.app, row.entity.id)"}]}]};a.gridOptions=b.gridOptions(c,d,a,{accountId:f.accountId,controller:"applications"})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.mail.accounts.view.actions.list",{url:"/list",templateUrl:"app/channels/mail/account/view/action/list/list.html",controller:"MailAccountViewActionListCtrl"})}]),angular.module("xCallyShuttleApp").controller("MailAccountViewActionViewCtrl",["$scope","$http","$stateParams","$translate","$location","xAlert","WizardHandler","socket","application","interval","Agent","Interval","MailQueue",function(a,b,c,d,e,f,g,h,i,j,k,l,m){a.isActive=!0,a.size="small",a.animate=!0,a.radioOff=!0,a.handleWidth="auto",a.labelWidth="auto",a.inverse=!0,a.offColor="danger",a.onColor="success",a.initAction=function(){a.$application=i.application,a.$stateParams=c,a.$interval=j.interval,a.forms={},a.apps=[{name:"Queue",value:"queue"},{name:"Agent",value:"agent"}],b.get("/api/mail/applications/"+c.actionId).success(function(b){if(a.application=b,a.application.alwaysTime=!1,a.application.IntervalId)a.application.intType="list";else switch(a.application.interval){case"*,*,*,*":a.application.intType="always";break;default:a.application.intType="custom"}var c=a.application.interval.split(",");"*"===c[0]?a.application.alwaysTime=!0:(a.application.t_from=moment(new Date),a.application.t_to=moment(new Date),a.application.t_from.hour(c[0].split("-")[0].split(":")[0]),a.application.t_from.minute(c[0].split("-")[0].split(":")[1]),a.application.t_to.hour(c[0].split("-")[1].split(":")[0]),a.application.t_to.minute(c[0].split("-")[1].split(":")[1])),"*"===c[1]?(a.application.wd_from="always",a.application.wd_to="always"):(a.application.wd_from=c[1].split("-")[0],a.application.wd_to=c[1].split("-")[1]),"*"===c[2]?(a.application.md_from="always",a.application.md_to="always"):(a.application.md_from=c[2].split("-")[0],a.application.md_to=c[2].split("-")[1]),"*"===c[3]?(a.application.m_from="always",a.application.m_to="always"):(a.application.m_from=c[3].split("-")[0],a.application.m_to=c[3].split("-")[1]),a.$watch("application.t_from",function(b){a.application.t_from_hm=moment(b).format("HH:mm")}),a.$watch("application.t_to",function(b){a.application.t_to_hm=moment(b).format("HH:mm")})}).error(function(a){console.error(a)})},a.getQueues=function(){return m.get().$promise.then(function(b){a.queues=b.rows})["catch"](function(a){console.error(a)})},a.getAgents=function(){return k.get().$promise.then(function(b){a.agents=b.rows})["catch"](function(a){console.error(a)})},a.getIntervals=function(){return l.get().$promise.then(function(b){a.intervals=b.rows})["catch"](function(a){console.error(a)})},a.updateItem=function(){var e=["*","*","*","*"],g={app:a.application.app,timeout:a.application.timeout,MailAccountId:c.id};switch(a.application.app){case"agent":g.UserId=a.application.UserId;break;case"queue":g.MailQueueId=a.application.MailQueueId}switch(a.application.intType){case"always":g.interval=e.join(","),delete a.application.IntervalId;break;case"custom":a.application.alwaysTime||(e[0]=a.application.alwaysTime?"*":a.application.t_from_hm+"-"+a.application.t_to_hm),a.application.wd_from&&a.application.wd_to&&"always"===a.application.wd_from&&"always"===a.application.wd_to?e[1]="*":e[1]=a.application.wd_from&&a.application.wd_to?a.application.wd_from+"-"+a.application.wd_to:"*",a.application.md_from&&a.application.md_to&&"always"===a.application.md_from&&"always"===a.application.md_to?e[2]="*":e[2]=a.application.md_from&&a.application.md_to?a.application.md_from+"-"+a.application.md_to:"*",a.application.m_from&&a.application.m_to&&"always"===a.application.m_from&&"always"===a.application.m_to?e[3]="*":e[3]=a.application.m_from&&a.application.m_to?a.application.m_from+"-"+a.application.m_to:"*",g.interval=e.join(","),delete a.application.IntervalId;break;case"list":g.IntervalId=a.application.IntervalId}b.put("/api/mail/applications/"+c.actionId,g).success(function(){f.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){f.show(a.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.mail.accounts.view.actions.view",{url:"/view/:actionId",templateUrl:"app/channels/mail/account/view/action/view/view.html",controller:"MailAccountViewActionViewCtrl"})}]),angular.module("xCallyShuttleApp").controller("MailAccountViewActionWizardCtrl",["$scope","$http","Agent","MailQueue","Interval","$stateParams","$translate","$location","xAlert","WizardHandler","socket","application","interval",function(a,b,c,d,e,f,g,h,i,j,k,l,m){a.isActive=!0,a.size="small",a.animate=!0,a.radioOff=!0,a.handleWidth="auto",a.labelWidth="auto",a.inverse=!0,a.offColor="danger",a.onColor="success",a.initWizard=function(){a.apps=[{name:"Queue",value:"queue"},{name:"Agent",value:"agent"}],a.$application=l.application,a.$stateParams=f,a.$interval=m.interval,a.forms={},a.application={alwaysTime:!0},a.$watch("application.t_from",function(b){a.application.t_from_hm=moment(b).format("HH:mm")}),a.$watch("application.t_to",function(b){a.application.t_to_hm=moment(b).format("HH:mm")})},a.getQueues=function(){return d.get().$promise.then(function(b){a.queues=b.rows})["catch"](function(a){console.error(a)})},a.getAgents=function(){return c.get().$promise.then(function(b){a.agents=b.rows})["catch"](function(a){console.error(a)})},a.getIntervals=function(){return e.get().$promise.then(function(b){a.intervals=b.rows})["catch"](function(a){console.error(a)})},a.createItem=function(){var c=["*","*","*","*"],d={app:a.application.app,timeout:a.application.timeout,MailAccountId:f.accountId};switch(a.application.app){case"agent":d.UserId=a.application.UserId;break;case"queue":d.MailQueueId=a.application.MailQueueId}switch(a.application.intType){case"always":d.interval=c.join(","),delete a.application.IntervalId;break;case"custom":a.application.alwaysTime||(c[0]=a.application.alwaysTime?"*":a.application.t_from_hm+"-"+a.application.t_to_hm),a.application.wd_from&&a.application.wd_to&&"always"===a.application.wd_from&&"always"===a.application.wd_to?c[1]="*":c[1]=a.application.wd_from&&a.application.wd_to?a.application.wd_from+"-"+a.application.wd_to:"*",a.application.md_from&&a.application.md_to&&"always"===a.application.md_from&&"always"===a.application.md_to?c[2]="*":c[2]=a.application.md_from&&a.application.md_to?a.application.md_from+"-"+a.application.md_to:"*",a.application.m_from&&a.application.m_to&&"always"===a.application.m_from&&"always"===a.application.m_to?c[3]="*":c[3]=a.application.m_from&&a.application.m_to?a.application.m_from+"-"+a.application.m_to:"*",d.interval=c.join(","),delete a.application.IntervalId;break;case"list":d.IntervalId=a.application.IntervalId}b.post("/api/mail/applications",d).success(function(){h.path("/channels/mail/accounts/view/"+f.accountId+"/actions/list")}).error(function(a){console.error(a)})},a.formValidation=function(a){return a},a.next=function(){j.wizard().next()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.mail.accounts.view.actions.wizard",{url:"/wizard",templateUrl:"app/channels/mail/account/view/action/wizard/wizard.html",controller:"MailAccountViewActionWizardCtrl"})}]),angular.module("xCallyShuttleApp").controller("MailAccountViewCtrl",["$scope","$http","$stateParams","$translate","$location","$timeout","socket","xAlert","MailAccount","MailMessage","MailServerIn","MailServerOut","usSpinnerService",function(a,b,c,d,e,f,g,h,i,j,k,l,m){a.isActive=!0,a.size="small",a.animate=!0,a.radioOff=!0,a.handleWidth="auto",a.labelWidth="auto",a.inverse=!0,a.offColor="danger",a.onColor="success",a.CONST_TIMEOUT=3e4,a.$on("$destroy",function(){g.socket.removeAllListeners("mail_message:sent"),g.socket.removeAllListeners("mail_message:failed")}),a.initView=function(){return g.socket.on("mail_message:sent",function(){h.show(d.instant("MESSAGE_WELL_DONE"),"success"),m.stop("spinner-grid")}),g.socket.on("mail_message:failed",function(){h.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger"),m.stop("spinner-grid")}),i.get({id:c.accountId}).$promise.then(function(b){a.account=b})["catch"](function(a){h.show(a.message,"danger")})},a.updateItemMailAccount=function(){return i.update({id:c.accountId},{name:a.account.name,description:a.account.description,address:a.account.address,fidelity:a.account.fidelity,timeout:a.account.timeout}).$promise.then(function(){h.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){h.show(a.message,"danger")})},a.updateItemMailServerIn=function(){return k.update({id:a.account.MailServerIn.id},a.account.MailServerIn).$promise.then(function(){h.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){h.show(a.message,"danger")})},a.updateItemMailServerOut=function(){return l.update({id:a.account.MailServerOut.id},a.account.MailServerOut).$promise.then(function(){h.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){h.show(a.message,"danger")})},a.test=function(){return m.spin("spinner-grid"),l.test({id:a.account.MailServerOut.id,controller:"test"}).$promise["finally"](function(){f(function(){m.stop("spinner-grid")},a.CONST_TIMEOUT)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.mail.accounts.view",{url:"/view/:accountId",templateUrl:"app/channels/mail/account/view/view.html",controller:"MailAccountViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load({insertBefore:"#ng_load_plugins_before",files:["assets/css/profile.css","assets/css/tasks.css"]})}]}}).state("main.channels.mail.accounts.view.settings",{url:"/settings",templateUrl:"app/channels/mail/account/view/view.settings.html"})}]),angular.module("xCallyShuttleApp").controller("MailAccountWizardCtrl",["$scope","$http","$location","$translate","WizardHandler","xAlert","MailAccount",function(a,b,c,d,e,f,g){a.isActive=!0,a.size="small",a.animate=!0,a.radioOff=!0,a.handleWidth="auto",a.labelWidth="auto",a.inverse=!0,a.offColor="danger",a.onColor="success",a.initWizard=function(){a.forms={},a.item={MailServerIn:{port:993,ssl:!0,"delete":!1,protocol:"IMAP",filter:"UNSEEN",mailbox:"INBOX",keepalive:!0,authTimeout:5,connTimeout:10},MailServerOut:{port:465,ssl:!0}}},a.goNext=function(){e.wizard().next()},a.formValidation=function(a){return a},a.createItem=function(){return g.save(a.item).$promise.then(function(){c.path("/channels/mail/accounts/list")})["catch"](function(a){f.show(a.data.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.mail.accounts.wizard",{url:"/wizard",templateUrl:"app/channels/mail/account/wizard/wizard.html",controller:"MailAccountWizardCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.mail.inbox",{url:"/inbox",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("MailInboxListCtrl",["$scope","$rootScope","$uibModal","MailRoom","gridOptions","uiGridConstants","Auth",function(a,b,c,d,e,f,g){a.loadAgents=function(a){c.open({animation:!0,templateUrl:"app/channels/mail/inbox/view/view.agents.modal.html",controller:"MailInboxViewModalAgentCtrl",resolve:{roomId:a}})},a.initView=function(){var c={exporterCsvFilename:"mail_rooms.csv",enableRowHeaderSelection:g.isAdmin(),columnDefs:[{name:"id",displayName:"",cellClass:"text-center ui-grid-vcenter",cellTemplate:"<div><span>#{{row.entity.id}}</span></div>",width:75,enableSorting:!1,enableFiltering:!1},{name:"subject"},{name:"from",cellClass:"text-center"},{name:"MailAccount.name",displayName:"Account",cellClass:"text-center",enableSorting:!1,enableFiltering:!1},{name:"users",displayName:"APPLICATION_AGENTS",cellClass:"ui-grid-vcenter",cellTemplate:"<div>{{(row.entity.Users | map:'fullname').join(', ')}}</div>",enableSorting:!1,enableFiltering:!1},{name:"status",cellClass:"text-center ui-grid-vcenter",cellTemplate:"<div><span class=\"label label-sm\" data-ng-class=\"{'label-info': row.entity.status === 'OPEN', 'label-danger': row.entity.status === 'NEW','label-success': row.entity.status === 'CLOSED'}\">{{row.entity.status}}</span></div>",filter:{type:f.filter.SELECT,selectOptions:[{value:"NEW",label:"NEW"},{value:"OPEN",label:"OPEN"},{value:"CLOSED",label:"CLOSED"}]},width:100},{name:"createdAt",displayName:"",cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div><time is="relative-time" datetime="{{row.entity.createdAt}}">April 1, 2014</time></div>',enableSorting:!1,enableFiltering:!1,width:125},{name:"action",width:175,buttons:[{"class":"blue-hoki",href:"/channels/mail/inbox/view/{{row.entity.id}}/room",name:"open"},{"class":"green-meadow",href:"#",name:"agents",onClick:"grid.appScope.loadAgents(row.entity.id)"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.id, row.entity.id)",hide:!g.isAdmin()}]}]};a.gridOptions=e.gridOptions(d,c,a),b.$on("mailMessageEvent",function(){a.gridOptions.getPage()})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.mail.inbox.list",{url:"/list",templateUrl:"app/channels/mail/inbox/list/list.html",controller:"MailInboxListCtrl"})}]),angular.module("xCallyShuttleApp").directive("mail",function(){return{templateUrl:"app/channels/mail/inbox/mail/mail.html",restrict:"EA",scope:{mailMessage:"=message"}}}),angular.module("xCallyShuttleApp").directive("note",function(){return{templateUrl:"app/channels/mail/inbox/note/note.html",restrict:"EA",scope:{mailMessage:"=message"}}}),angular.module("xCallyShuttleApp").controller("MailInboxViewModalAgentCtrl",["$scope","$uibModalInstance","$translate","$stateParams","Agent","MailRoom","xAlert","roomId",function(a,b,c,d,e,f,g,h){console.log("roomId",h),a.initModal=function(){a.agents=[],a.item={agents:[]},e.get().$promise.then(function(b){b.rows.forEach(function(b){a.agents.push(b)})})["catch"](function(a){console.error(a)}),f.query({id:d.id||h,controller:"agents"}).$promise.then(function(b){b.forEach(function(b){a.agents.push(b),a.item.agents.push(b.id)})})["catch"](function(a){console.error(a)}),a.modal={dismissable:!0,title:"APPLICATION_MESSAGE_SEND_RETRY",text:"MESSAGE_MESSAGE_SEND_RETRY",buttons:[{classes:"btn btn-success",text:"APPLICATION_RETRY",click:function(a){b.close(a)}},{classes:"btn default",text:"APPLICATION_CANCEL",click:function(a){b.dismiss(a)}}]}},a.ok=function(){return f.update({id:d.id||h,controller:"agents",agents:a.item.agents}).$promise.then(function(){g.show(c.instant("MESSAGE_WELL_DONE"),"success"),b.close()})["catch"](function(a){console.error(a)})},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("MailInboxViewCtrl",["$scope","$location","$cookieStore","$stateParams","$translate","$uibModal","CannedAnswer","socket","Agent","MailAccount","MailRoom","MailAttachment","MailMessage","FileUploader","Auth","xAlert","usSpinnerService",function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q){var r,s=[];a.onSelectAnswer=function(b){a.form.html+=b,a.selectedAnswer=""},a.getAnswers=function(a){return g.get({key:a}).$promise.then(function(a){return _.map(a.rows,"value")})},a.initRoom=function(){a.Auth=o,a.config={autoHideScrollbar:!1,theme:"light",advanced:{updateOnContentResize:!0},setHeight:781,scrollInertia:0},a.forms={},a.selectedAnswer="",a.form={disabled:!1,from:[],to:[],sto:[],cc:[],scc:[],html:""},h.socket.on("mail_message:save",function(b){return a.mailRoom&&b.MailRoomId===d.id?m.get({id:b.id}).$promise.then(function(b){a.mailRoom.MailMessages.unshift(b)})["catch"](function(a){console.error(a)}):void 0}),r=a.uploader=new n({url:"api/mail/attachments",autoUpload:!0,withCredentials:!0,headers:{Authorization:"Bearer "+c.get("token")}}),r.removeFromQueue=function(a){var b=this;return l["delete"]({id:a.basename}).$promise.then(function(){var c=b.getIndexOfItem(a),d=b.queue[c];d.isUploading&&d.cancel(),b.queue.splice(c,1),d._destroy(),b.progress=b._getTotalProgress(),s=_.reject(s,{basename:a.basename})})["catch"](function(){p.show(e.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})},r.onErrorItem=function(){p.show(e.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")},r.onSuccessItem=function(a,b){var c={size:b.size,path:b.path,name:b.name,basename:b.basename,type:b.type};a=_.merge(a,c),s.push(c)},i.get().$promise.then(function(b){a.agents=b.rows})["catch"](function(a){console.error(a)}),j.get().$promise.then(function(b){a.mailAccounts=b.rows})["catch"](function(a){console.error(a)}),d.id&&k.get({id:d.id}).$promise.then(function(b){a.mailRoom=b,a.form.from.push(b.MailAccount.address);var c=_.last(a.mailRoom.MailMessages);a.form.to=a.form.cc=a.form.bcc=_.union(c.from,c.to,c.cc,c.bcc),a.form.sto=_.remove(a.form.to,function(a){return a!==b.MailAccount.address}),"NEW"===a.mailRoom.status&&k.update({id:d.id},{status:"OPEN"})})["catch"](function(a){console.error(a)})},a.cancel=function(){a.form.disabled=!1,a.form.from=[],a.form.to=[],a.form.sto=[],a.form.cc=[],a.form.scc=[],delete a.form.subject,delete a.form.html},a.updateStatus=function(a){return k.update({id:d.id},{status:a}).$promise.then(function(){p.show(e.instant("MESSAGE_STATUS_UPDATE_SUCCESS"),"success"),b.path("/channels/mail/inbox/list")})["catch"](function(a){p.show(a.message,"danger")})},a.loadAgents=function(){f.open({animation:!0,templateUrl:"app/channels/mail/inbox/view/view.agents.modal.html",controller:"MailInboxViewModalAgentCtrl"})},a.loadTemplate=function(){f.open({animation:!0,templateUrl:"app/channels/mail/inbox/view/view.templates.modal.html",controller:"MailInboxViewModalTemplateCtrl"}).result.then(function(b){a.form.subject=b.template.subject,a.form.html=b.template.html})},a.loadNote=function(){f.open({animation:!0,templateUrl:"app/channels/mail/inbox/view/view.notes.modal.html",controller:"MailInboxViewModalNoteCtrl"})},a.sendMail=function(){var c={},f={subject:a.mailRoom?a.mailRoom.subject:a.form.subject,from:a.form.from,to:a.form.sto||[],cc:a.form.scc||[],html:a.form.html||null,text:a.form.text||null,inReplyTo:c.messageId||null,status:"SENDING",MailAttachments:s};return q.spin("spinner-grid"),a.form.disabled=!0,a.mailRoom?(c=_.last(a.mailRoom.MailMessages,{status:"RECEIVED"}),f.inReplyTo=c.messageId||null,k.save({id:d.id,controller:"messages"},f).$promise.then(function(){p.show(e.instant("MESSAGE_WELL_DONE"),"success"),b.path("/channels/mail/inbox/list")})["catch"](function(){p.show(e.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})["finally"](function(){q.stop("spinner-grid"),a.form.disabled=!1})):m.save(f).$promise.then(function(){p.show(e.instant("MESSAGE_MAIL_MESSAGE_SEND_SUCCESS"),"success"),b.path("/channels/mail/inbox/list")})["catch"](function(){p.show(e.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})["finally"](function(){q.stop("spinner-grid"),a.form.disabled=!1})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.mail.inbox.view",{url:"/view",templateUrl:"app/channels/mail/inbox/view/view.html"}).state("main.channels.mail.inbox.view.compose",{url:"/compose",templateUrl:"app/channels/mail/inbox/view/view.room.html",controller:"MailInboxViewCtrl"}).state("main.channels.mail.inbox.view.room",{url:"/:id/room",templateUrl:"app/channels/mail/inbox/view/view.room.html",controller:"MailInboxViewCtrl"})}]),angular.module("xCallyShuttleApp").controller("MailInboxViewModalNoteCtrl",["$scope","$uibModalInstance","$stateParams","$translate","MailRoom","xAlert",function(a,b,c,d,e,f){a.initModal=function(){a.item={}},a.ok=function(){return e.save({id:c.id,controller:"messages"},{text:a.item.text,status:"NOTE"}).$promise.then(function(){f.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(){f.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})["finally"](function(){b.close()})},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("MailInboxViewModalTemplateCtrl",["$scope","$uibModalInstance","Template",function(a,b,c){a.initModal=function(){return a.item={},c.get().$promise.then(function(b){a.templates=b.rows})["catch"](function(a){console.error(a)})},a.ok=function(){b.close(a.item)},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.mail",{url:"/mail",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").factory("MailAttachment",["$resource",function(a){return a("/api/mail/attachments/:id/:controller",{id:"@id"})}]),angular.module("xCallyShuttleApp").factory("MailMessage",["$resource",function(a){return a("/api/mail/messages/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").factory("MailReport",["$resource",function(a){return a("/api/report/mails/:id/:controller1/:controller2",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").factory("MailRoom",["$resource",function(a){return a("/api/mail/rooms/:id/:controller",{id:"@id",controller:"@controller"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").controller("MailQueueListCtrl",["$scope","MailQueue","gridOptions","$uibModal","xAlert",function(a,b,c,d,e){a.initView=function(){var d={exporterCsvFilename:"voice_queues.csv",columnDefs:[{name:"name"},{name:"description"},{name:"timeout"},{name:"strategy"},{name:"action",width:125,buttons:[{"class":"blue-hoki",href:"/channels/mail/queues/view/{{row.entity.id}}/settings",name:"profile"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=c.gridOptions(b,d,a)},a.createItem=function(){var b=d.open({animation:!0,templateUrl:"app/channels/mail/queue/list/list.create.modal.html",controller:"MailQueueListCreateCtrl"});b.result.then(function(b){console.log(b),a.gridOptions.getPage()})}}]),angular.module("xCallyShuttleApp").controller("MailQueueListCreateCtrl",["$scope","$uibModalInstance","$translate","xAlert","MailQueue",function(a,b,c,d,e){a.form={},a.item={},a.save=function(){return e.save(a.item).$promise.then(function(a){b.close(a)})["catch"](function(a){d.show(a.data.message,"danger")})},a.cancel=function(){b.dismiss()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.mail.queues.list",{url:"/list",templateUrl:"app/channels/mail/queue/list/list.html",controller:"MailQueueListCtrl"})}]),angular.module("xCallyShuttleApp").factory("MailQueue",["$resource",function(a){return a("/api/mail/queues/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.mail.queues",{url:"/queues",template:"<div ui-view></div>","abstract":!0,resolve:{deps:["$ocLazyLoad",function(a){return a.load({insertBefore:"#ng_load_plugins_before",files:["assets/plugins/jquery-multi-select/css/multi-select.css","assets/plugins/jquery-multi-select/js/jquery.multi-select.js","assets/scripts/components-dropdowns.js"]})}]},data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").controller("MailQueueViewCtrl",["$scope","$http","$translate","$stateParams","xAlert","Team","MailQueue",function(a,b,c,d,e,f,g){var h=function(){return{select:function(b){return g.save({id:a.queue.id,controller:"agents"},{agents:b,penalty:a.queue.penalty}).$promise.then(function(){a.getTeams()})["catch"](function(a){console.error(a)})},deselect:function(b){return g["delete"]({id:a.queue.id,controller:"agents",agents:b}).$promise.then(function(){a.getTeams()})["catch"](function(a){console.error(a)})}}};a.getQueue=function(){return g.get({id:d.id}).$promise.then(function(b){b.penalty=0,a.queue=b})["catch"](function(a){console.error(a)})},a.updateMailQueue=function(){return g.update({id:d.id},{name:a.queue.name,description:a.queue.description,timeout:a.queue.timeout,strategy:a.queue.strategy}).$promise.then(function(){e.show(c.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){e.show(a.data.message,"danger")})},a.getTeams=function(){return f.get().$promise.then(function(b){return a.teams=b.rows,g.query({id:d.id,controller:"agents"}).$promise}).then(function(b){ComponentsDropdowns.bindMailQueue(a.teams,_.map(b,function(a){return{id:a.id,penalty:a.UserHasMailQueue.penalty}}),h)})["catch"](function(a){console.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.mail.queues.view",{url:"/view/:id",templateUrl:"app/channels/mail/queue/view/view.html",
-controller:"MailQueueViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.channels.mail.queues.view.settings",{url:"/settings",templateUrl:"app/channels/mail/queue/view/view.settings.html"}).state("main.channels.mail.queues.view.agents",{url:"/agents",templateUrl:"app/channels/mail/queue/view/view.agents.html",cache:!1,serie:!0,resolve:{deps:["$ocLazyLoad",function(a){return a.load({insertBefore:"#ng_load_plugins_before",files:["assets/plugins/jquery-multi-select/css/multi-select.css","assets/plugins/jquery-multi-select/js/jquery.multi-select.js","assets/plugins/jquery-quicksearch/jquery.quicksearch.js","assets/scripts/components-dropdowns.js"]})}]}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.mail.realtime",{url:"/realtime",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").controller("MailRealtimeViewAgentCtrl",["$scope","$log","$uibModal","$translate","socket","xAlert","Agent","Pause","Action","MailQueue","usSpinnerService","$q","uiGridConstants",function(a,b,c,d,e,f,g,h,i,j,k,l,m){function n(){return k.spin("spinner-grid"),g.get(s).$promise.then(function(b){a.gridOptions.totalItems=b.count,a.gridOptions.data=[],b.rows.forEach(function(a){p(a)})})["catch"](function(a){f.show(a.message,"danger")})["finally"](function(){k.stop("spinner-grid")})}function o(){e.socket.on("agent:save",function(b){var c=_.find(a.gridOptions.data,{agentId:b.id,isAgent:!0});if(c){var d=a.gridOptions.data.indexOf(c);a.gridOptions.data[d].online=b.online,a.gridOptions.data[d].lastLoginAt=b.lastLoginAt,a.gridOptions.data[d].pause=b.mailPause,a.gridOptions.data[d].pauseType=b.pauseType,a.gridOptions.data[d].lastPauseAt=b.lastPauseAt,a.gridOptions.data[d].ipaddr=b.ipaddr,a.gridOptions.data[d].port=b.port,a.gridOptions.data[d].fullcontact=b.fullcontact,a.gridOptions.data[d].useragent=b.useragent,a.gridOptions.data[d].lastms=b.lastms,a.gridOptions.data[d].internal=b.internal,_.map(a.gridOptions.data,function(a){a.isAgent||a.agentId!==b.id||(a.online=b.online)})}}),e.socket.on("agent:remove",function(b){_.remove(a.gridOptions.data,{agentId:b.id})}),e.socket.on("user_has_mail_queue:save",function(b){console.log("new queue",b);var c=_.find(a.gridOptions.data,{agentId:b.UserId,isAgent:!0}),d=a.gridOptions.data.indexOf(c);a.gridOptions.data.splice(d+1,0,{isAgent:!1,agentId:b.UserId,queue:b.queue,queueId:b.MailQueueId,agent:b.membername,online:c.online})}),e.socket.on("user_has_mail_queue:remove",function(b){_.remove(a.gridOptions.data,{agentId:b.UserId,queueId:b.MailQueueId})})}function p(b){a.gridOptions.data.push({isAgent:!0,agentId:b.id,agent:b.name,online:b.online,lastLoginAt:b.lastLoginAt,lastPauseAt:b.lastPauseAt,pause:b.mailPause,pauseType:b.pauseType,ipaddr:b.ipaddr,port:b.port,fullcontact:b.fullcontact,useragent:b.useragent,lastms:b.lastms,internal:b.internal,$$treeLevel:0}),b.MailQueues.forEach(function(c){a.gridOptions.data.push({isAgent:!1,agentId:b.id,queue:c.name,queueId:c.id,agent:b.name,online:b.online})})}function q(){return h.get().$promise.then(function(b){a.pauses=b.rows,e.syncUpdates("pause",a.pauses)})["catch"](function(a){f.show(a.message,"danger")})}function r(){return j.get().$promise.then(function(b){a.mailQueues=b.rows,e.syncUpdates("mail_queue",a.mailQueues)})["catch"](function(a){f.show(a.message,"danger")})}a.mailQueues=[];var s={offset:0,limit:10};a.moment=moment,a.initAgents=function(){a.gridOptions={enableGridMenu:!0,headerCellFilter:"translate",enableHorizontalScrollbar:0,enableVerticalScrollbar:0,enableFiltering:!0,showGridFooter:!0,paginationPageSizes:[10,25,50,75],paginationPageSize:10,useExternalPagination:!0,useExternalSorting:!0,useExternalFiltering:!0,multiSelect:!0,showTreeExpandNoChildren:!0,columnDefs:[{name:"name",displayName:"APPLICATION_AGENT",headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div data-ng-if="row.entity.isAgent">{{row.entity.agent}} &lt;{{row.entity.internal}}&gt;</div>'},{name:"online",displayName:"APPLICATION_ONLINE",width:150,headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div data-ng-if="row.entity.online != null && row.entity.isAgent"><i class="icon-user" data-ng-class="row.entity.online ? \'font-green\' : \'font-red\'"></i> <span data-ng-if="row.entity.online" class="left-margin">(<timer start-time="grid.appScope.moment(row.entity.lastLoginAt).unix()*1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>)</span></div>',filter:{type:m.filter.SELECT,selectOptions:[{value:"true",label:"ONLINE"},{value:"false",label:"OFFLINE"}]}},{name:"mailPause",width:300,displayName:"APPLICATION_PAUSE",headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div data-ng-if="row.entity.pause != null && row.entity.online" class="ui-grid-vcenter" data-ng-class="{\'paused-agent\':row.entity.pause}"><timer data-ng-if="row.entity.pause" start-time="grid.appScope.moment(row.entity.lastPauseAt).unix()*1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer></span><span data-ng-if="row.entity.pause" class="left-margin">({{row.entity.pauseType}})</span><i data-ng-if="row.entity.pause" data-ng-click="grid.appScope.pause(row.entity.agentId,\'unpause\')" class="icon-control-play font-green pointer-cursor left-margin" title="{{\'APPLICATION_RESUME\' | translate}}"></i><i class="icon-control-pause font-yellow pointer-cursor" data-ng-click="grid.appScope.pause(row.entity.agentId,\'pause\',\'DEFAULT PAUSE\')" title="{{\'APPLICATION_DEFAULT_PAUSE\' | translate}}"></i><select data-ng-if="grid.appScope.pauses.length" class="pause-select pointer-cursor" data-ng-model="grid.appScope.pauseType" data-ng-change="grid.appScope.pause(row.entity.agentId,\'pause\',grid.appScope.pauseType)"><option class="pointer-cursor" data-ng-repeat="pause in grid.appScope.pauses">{{pause.name}}</option></select></div>',filter:{type:m.filter.SELECT,selectOptions:[{value:"true",label:"PAUSED"},{value:"false",label:"NOT PAUSED"}]},enableSorting:!1,enableColumnMenu:!1},{name:"queue",displayName:"APPLICATION_QUEUE",headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",enableSorting:!1,enableFiltering:!1,enableColumnMenu:!1},{name:"action",displayName:"",width:170,cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div><button data-ng-if="row.entity.queueId" class="btn btn-xs red-sunglo" data-ng-click="grid.appScope.leaveQueue(row.entity.agentId,row.entity.queueId)"><i class="icon-ban"></i> {{\'APPLICATION_LEAVE\' | translate}}</button><button data-ng-if="row.entity.isAgent && row.treeNode.children.length < grid.appScope.mailQueues.length" class="btn btn-xs blue-hoki" data-ng-click="grid.appScope.joinQueue(row.entity.agentId)"><i class="icon-plus"></i> {{\'APPLICATION_JOIN_QUEUE\' | translate}}</button> <button data-ng-if="row.entity.isAgent" class="btn btn-xs blue-madison" data-ng-click="grid.appScope.showInfo(row.entity)"><i class="icon-info"></i> {{\'APPLICATION_INFO\' | translate}}</button><div>',enableSorting:!1,enableFiltering:!1,enableColumnMenu:!1}],data:[],gridMenuTitleFilter:function(a){var b=l.defer();return b.resolve(d.instant(a)),b.promise},onRegisterApi:function(b){a.gridApi=b,a.gridApi.grid.registerDataChangeCallback(function(){t(a.gridApi.core.getVisibleRows(a.gridApi.grid).length)}),a.gridApi.treeBase.on.rowExpanded(a,function(b){t(a.gridApi.core.getVisibleRows(a.gridApi.grid).length+b.treeNode.children.length)}),a.gridApi.treeBase.on.rowCollapsed(a,function(b){t(a.gridApi.core.getVisibleRows(a.gridApi.grid).length-b.treeNode.children.length)}),a.gridApi.core.on.sortChanged(a,function(a,b){0===b.length?s.order=null:s.order=b[0].name+" "+b[0].sort.direction.toUpperCase(),n()}),a.gridApi.pagination.on.paginationChanged(a,function(a,b){s.offset=(a-1)*b,s.limit=b,n()}),a.gridApi.core.on.filterChanged(a,function(){var a=this.grid;a.columns.forEach(function(a){a.filters[0].term?s[a.name]=a.filters[0].term:delete s[a.name]}),n()})}},n(),q(),r(),o()};var t=function(a){var b=a?30*a+130:270;angular.element(document.getElementsByClassName("ui-grid")[0]).css("height",b+"px"),angular.element(document.getElementsByClassName("ui-grid-viewport")).css("height",30*a+"px")};a.$on("$destroy",function(){e.unsyncUpdates("agent"),e.unsyncUpdates("user_has_mail_queue")}),a.pause=function(a,b,c){return i.save({name:b,agent:a,type:c||"DEFAULT PAUSE",data4:c||"DEFAULT PAUSE",channel:"mail"}).$promise.then(function(){f.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){f.show(a.message,"danger")})},a.joinQueue=function(e){var g=c.open({animation:!0,templateUrl:"app/channels/mail/realtime/view/agent/queue.modal.add.html",controller:"MailRealtimeViewAgentQueueModalCtrl",resolve:{queues:function(){return _.reject(a.mailQueues,function(b){return _.find(a.gridOptions.data,{queue:b.name,isAgent:!1,agentId:e})?!0:!1})}}});g.result.then(function(b){return i.save({name:"QueueAdd",agent:e,queues:_.filter(a.mailQueues,function(a){return _.includes(b.queues,a.id)}),channel:"mail",data1:e,data3:b.queues.join(","),data4:"mail"}).$promise.then(function(){f.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){f.show(a.message,"danger")})},function(){b.info("Modal dismissed at: "+new Date)})},a.leaveQueue=function(a,b){return i.save({name:"QueueRemove",agent:a,queueId:b,channel:"mail",data1:a,data3:b,data4:"mail"}).$promise.then(function(){f.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){f.show(a.message,"danger")})},a.showInfo=function(a){c.open({animation:!0,templateUrl:"app/channels/mail/realtime/view/agent/agent.modal.info.html",controller:"MailRealtimeViewAgentInfoModalCtrl",resolve:{agent:a}})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.mail.realtime.view.agents",{url:"/agents",templateUrl:"app/channels/mail/realtime/view/agent/agent.html",controller:"MailRealtimeViewAgentCtrl"})}]),angular.module("xCallyShuttleApp").controller("MailRealtimeViewAgentInfoModalCtrl",["$scope","$uibModalInstance","$http","agent",function(a,b,c,d){a.agent=d,a.close=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("MailRealtimeViewAgentQueueModalCtrl",["$scope","$uibModalInstance","$http","queues",function(a,b,c,d){a.queues=d,a.item={},a.save=function(){b.close(a.item)},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("MailRealtimeViewQueueCtrl",["$scope","$http","socket","MailQueue","Agent",function(a,b,c,d,e){a.initQueues=function(){a.gridOptions={enableSorting:!1,enableFiltering:!0,enableHorizontalScrollbar:0,enableVerticalScrollbar:0,showTreeExpandNoChildren:!1,columnDefs:[{name:"queueName",displayName:"Queue"},{name:"fullname",displayName:"Agent",cellClass:"text-center"},{name:"online",cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div><i data-ng-if="row.entity.online != null" class="icon-user" data-ng-class="row.entity.online ? \'font-green\' : \'font-red\'"></i></div>'},{name:"chatPause",cellClass:"text-center ui-grid-vcenter",cellTemplate:"<div><i data-ng-if=\"row.entity.mailPause != null\" data-ng-class=\"row.entity.mailPause ? 'icon-control-pause font-red' : 'icon-control-play font-green'\"></i></div>"},{name:"pauseType",cellClass:"text-center",cellTemplate:'<span data-ng-if="row.entity.mailPause">{{row.entity.pauseType}}</span>'},{name:"lastLoginAt",cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div><time data-ng-if="row.entity.agentName" is="relative-time" datetime="{{row.entity.lastLoginAt}}">April 1, 2014</time></div>'}],onRegisterApi:function(b){a.gridApi=b,a.gridApi.treeBase.on.rowExpanded(a,function(b){var c=_.findIndex(a.gridOptions.data,{$$hashKey:b.entity.$$hashKey});b.entity.Users&&b.entity.Users.forEach(function(b){_.find(a.gridOptions.data,{name:b.name})||a.gridOptions.data.splice(c+1,0,b)})})}},d.get(function(b){a.gridOptions.data=[],b.rows.forEach(function(b){b.$$treeLevel=0,b.queueName=b.name,a.gridOptions.data.push(b),b.Users&&b.Users.forEach(function(b){b.agentName=b.name,a.gridOptions.data.push(b)})}),c.socket.on("agent:save",function(b){var c=_.filter(a.gridOptions.data,{agentName:b.name});c.forEach(function(a){a.online=b.online,a.lastLoginAt=b.lastLoginAt})}),c.socket.on("mail_queue:save",function(b){b.$$treeLevel=0,b.queueName=b.name,a.gridOptions.data.push(b)}),c.socket.on("mail_queue:remove",function(b){_.remov(a.gridOptions.data,{queueName:b.name})}),c.socket.on("user_has_mail_queue:save",function(b){var c=_.findIndex(a.gridOptions.data,function(a){return a.queueName&&a.id===b.MailQueueId});e.get({id:b.UserId}).$promise.then(function(b){a.gridOptions.data.splice(c+1,0,{id:b.id,name:b.name,fullname:b.fullname,agentName:b.name,online:b.online,lastLoginAt:b.lastLoginAt})})["catch"](function(a){console.error(a)})}),c.socket.on("user_has_mail_queue:remove",function(b){for(var c=_.findIndex(a.gridOptions.data,function(a){return a.queueName&&a.id===b.MailQueueId}),d=c+1;d<a.gridOptions.data.length;d++)a.gridOptions.data[d].id==b.UserId&&a.gridOptions.data.splice(d,1)})},function(a){console.error(a)})},a.conf={agentsByPage:{name:"10",value:10},labels:["fullname","name","email"]},a.agentsByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.$on("$destroy",function(){c.unsyncUpdates("report_mail:save"),c.unsyncUpdates("report_mail:update")}),a.initAgents=function(){b.get("/api/report/mails").success(function(b){a.agents=b,c.socket.on("report_mail:save",function(b){var c=_.find(a.agents,{id:b.id});c||a.agents.unshift(b)}),c.socket.on("report_mail:update",function(b){var c=_.find(a.agents,{id:b.id}),d=a.agents.indexOf(c);c&&_.merge(a.agents[d],b)})}).error(function(a){console.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.mail.realtime.view.queues",{url:"/queues",templateUrl:"app/channels/mail/realtime/view/queue/queue.html",controller:"MailRealtimeViewQueueCtrl"})}]),angular.module("xCallyShuttleApp").controller("MailRealtimeViewSessionCtrl",["$scope","$http","socket","uiGridConstants",function(a,b,c,d){a.initSessions=function(){a.gridOptions={enableHorizontalScrollbar:0,enableVerticalScrollbar:0,columnDefs:[{name:"uniqueid",displayName:"",cellClass:"text-center",width:150,enableSorting:!1,enableFiltering:!0},{name:"application",displayName:"APPLICATION_APP",headerCellFilter:"translate",cellClass:"text-center"},{name:"queuename",displayName:"APPLICATION_QUEUE",headerCellFilter:"translate",cellClass:"text-center"},{name:"agentname",cellClass:"text-center"},{name:"accountname",displayName:"APPLICATION_ACCOUNT",headerCellFilter:"translate"},{name:"joinAt",displayName:"joinAt",cellClass:"text-center",cellTemplate:'<time data-ng-if="row.entity.joinAt" is="relative-time" datetime="{{row.entity.joinAt}}">April 1, 2014</time>',sort:{direction:d.DESC,priority:1}},{name:"leaveAt",displayName:"leaveAt",cellClass:"text-center",cellTemplate:'<time data-ng-if="row.entity.leaveAt" is="relative-time" datetime="{{row.entity.leaveAt}}">April 1, 2014</time>'},{name:"unmanagedAt",displayName:"unmanangedAt",cellClass:"text-center",cellTemplate:'<time data-ng-if="row.entity.unmanagedAt" is="relative-time" datetime="{{row.entity.unmanagedAt}}">April 1, 2014</time>'}],data:[]},b.get("/api/report/mail/sessions").success(function(b){a.gridOptions.data=b.rows,c.socket.on("report_mail_session:save",function(b){var c=_.find(a.gridOptions.data,{id:b.id}),d=a.gridOptions.data.indexOf(c);c?_.merge(a.gridOptions.data[d],b):a.gridOptions.data.unshift(b)})}).error(function(a){console.error(a)})},a.$on("$destroy",function(){c.unsyncUpdates("report_mail:save"),c.unsyncUpdates("report_mail:update")})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.mail.realtime.view.sessions",{url:"/sessions",templateUrl:"app/channels/mail/realtime/view/session/session.html",controller:"MailRealtimeViewSessionCtrl"})}]),angular.module("xCallyShuttleApp").controller("MailRealtimeViewCtrl",["$scope","$state",function(a,b){a.agents=[{name:"Queues",link:"main.channels.mail.realtime.view.agents.queues"},{name:"Timeline",link:"main.channels.mail.realtime.view.agents.timeline"}],a.sessions=[{name:"Sessions",link:"main.channels.mail.realtime.view.sessions"}],a.tree={queues:[{name:"Queues",link:"main.channels.mail.realtime.view.agents.queues"},{name:"Timeline",link:"main.channels.mail.realtime.view.agents.timeline"}],sessions:[{name:"Sessions",link:"main.channels.mail.realtime.view.sessions"}]}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.mail.realtime.view",{url:"/view",templateUrl:"app/channels/mail/realtime/view/view.html",controller:"MailRealtimeViewCtrl"})}]),angular.module("xCallyShuttleApp").factory("ReportCall",["$resource",function(a){return a("/api/report/calls/:id/:controller",{name:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").factory("ChanSpy",["$resource",function(a){return a("/api/chanspy/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.chanspy",{url:"/chanspy",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("ChanSpyListCtrl",["$scope","$uibModal","ChanSpy","gridOptions",function(a,b,c,d){a.initView=function(){var b={exporterCsvFilename:"chanspy.csv",columnDefs:[{name:"name"},{name:"description"},{name:"action",width:160,buttons:[{"class":"blue-hoki",href:"/channels/voice/chanspy/view/{{row.entity.id}}/settings",name:"settings"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=d.gridOptions(c,b,a)},a.createItem=function(){var c=b.open({animation:!0,templateUrl:"app/channels/voice/chanspy/list/list.create.modal.html",controller:"ChanSpyListCreateCtrl"});c.result.then(function(b){a.gridOptions.getPage()})}}]),angular.module("xCallyShuttleApp").controller("ChanSpyListCreateCtrl",["$scope","$translate","$uibModalInstance","ChanSpy","xAlert",function(a,b,c,d,e){a.form={},a.item={},a.recordSwitch={onText:"On",offText:"Off",isActive:!0,size:"small",animate:!0,radioOff:!0,handleWidth:"auto",labelWidth:"auto",inverse:!0,offColor:"danger",onColor:"success"},a.options=[{name:"APPLICATION_CHANSPY_OPTION_b",value:"b"},{name:"APPLICATION_CHANSPY_OPTION_B",value:"B"},{name:"APPLICATION_CHANSPY_OPTION_E",value:"E"},{name:"APPLICATION_CHANSPY_OPTION_o",value:"o"},{name:"APPLICATION_CHANSPY_OPTION_q",value:"q"},{name:"APPLICATION_CHANSPY_OPTION_s",value:"s"},{name:"APPLICATION_CHANSPY_OPTION_S",value:"S"},{name:"APPLICATION_CHANSPY_OPTION_w",value:"w"},{name:"APPLICATION_CHANSPY_OPTION_W",value:"W"}],a.save=function(){return a.item.options=a.item.options.join(""),d.save(a.item).$promise.then(function(a){e.show(b.instant("MESSAGE_WELL_DONE"),"success"),c.close(a)})["catch"](function(a){e.show(a.data.message,"danger")})},a.cancel=function(){c.dismiss()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.chanspy.list",{url:"/list",templateUrl:"app/channels/voice/chanspy/list/list.html",controller:"ChanSpyListCtrl"})}]),angular.module("xCallyShuttleApp").controller("ChanSpyViewCtrl",["$scope","$translate","$stateParams","xAlert","ChanSpy",function(a,b,c,d,e){a.recordSwitch={onText:"On",offText:"Off",isActive:!0,size:"small",animate:!0,radioOff:!0,handleWidth:"auto",labelWidth:"auto",inverse:!0,offColor:"danger",onColor:"success"},a.options=[{name:"APPLICATION_CHANSPY_OPTION_b",value:"b"},{name:"APPLICATION_CHANSPY_OPTION_B",value:"B"},{name:"APPLICATION_CHANSPY_OPTION_E",value:"E"},{name:"APPLICATION_CHANSPY_OPTION_o",value:"o"},{name:"APPLICATION_CHANSPY_OPTION_q",value:"q"},{name:"APPLICATION_CHANSPY_OPTION_s",value:"s"},{name:"APPLICATION_CHANSPY_OPTION_S",value:"S"},{name:"APPLICATION_CHANSPY_OPTION_w",value:"w"},{name:"APPLICATION_CHANSPY_OPTION_W",value:"W"}],a.getChanSpy=function(){return e.get({id:c.id}).$promise.then(function(b){b.options=b.options.split(""),a.chanspy=b})["catch"](function(a){d.show(a.data.message,"danger")})},a.updateChanSpy=function(){var f=angular.copy(a.chanspy);return f.options=f.options.join(""),e.update({id:c.id},f).$promise.then(function(){d.show(b.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){d.show(a.data.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.chanspy.view",{url:"/view/:id",templateUrl:"app/channels/voice/chanspy/view/view.html",controller:"ChanSpyViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.channels.voice.chanspy.view.settings",{url:"/settings",templateUrl:"app/channels/voice/chanspy/view/view.settings.html"})}]),angular.module("xCallyShuttleApp").factory("VoiceContext",["$resource",function(a){return a("/api/voice/contexts/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.contexts",{url:"/contexts",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("VoiceContextListCtrl",["$scope","VoiceContext","gridOptions","$uibModal","xAlert","$translate",function(a,b,c,d,e,f){a.initView=function(){var d={exporterCsvFilename:"voice_contexts.csv",columnDefs:[{name:"name"},{name:"description"},{name:"action",width:170,buttons:[{"class":"{{row.entity.defaultEntry ? 'blue-hoki disabled' : 'blue-hoki'}}",href:"/channels/voice/contexts/view/{{row.entity.id}}/settings",name:"settings"},{"class":"{{row.entity.defaultEntry ? 'red-sunglo disabled' : 'red-sunglo'}}",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=c.gridOptions(b,d,a)},a.createItem=function(){var c=d.open({animation:!0,templateUrl:"app/channels/voice/context/list/create.modal.html",controller:["$scope","$uibModalInstance",function(a,b){a.form={},a.item={},a.ok=function(){b.close(a.item)},a.cancel=function(){b.dismiss("cancel")}}]});c.result.then(function(c){return b.save(c).$promise.then(function(){a.gridOptions.getPage(),e.show(f.instant("MESSAGE_WELL_DONE")+"!","success")})["catch"](function(a){e.show(a.data.message,"danger")})})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.contexts.list",{url:"/list",templateUrl:"app/channels/voice/context/list/list.html",controller:"VoiceContextListCtrl"})}]),angular.module("xCallyShuttleApp").controller("VoiceContextViewCtrl",["$scope","$http","xAlert","$translate","$stateParams","$location",function(a,b,c,d,e,f){a.getContext=function(){b.get("/api/voice/contexts/"+e.id).success(function(b){a.context=b}).error(function(a){console.error(a),f.path("/voice/contexts/list")})},a.updateVoiceContext=function(){var f=angular.copy(a.context);b.put("/api/voice/contexts/"+e.id,f).success(function(){c.show(d.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(b){c.show(d.instant(b.message),"danger"),a.context=f})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.contexts.view",{url:"/view/:id",templateUrl:"app/channels/voice/context/view/view.html",controller:"VoiceContextViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.channels.voice.contexts.view.settings",{url:"/settings",templateUrl:"app/channels/voice/context/view/view.settings.html"})}]),angular.module("xCallyShuttleApp").controller("VoiceMohListCtrl",["$scope","gridOptions","VoiceMoh","$uibModal","xAlert","$translate",function(a,b,c,d,e,f){a.initView=function(){var d={exporterCsvFilename:"voice_mohs.csv",columnDefs:[{name:"name"},{name:"directory"},{name:"sort"},{name:"description"},{name:"action",width:125,buttons:[{"class":"blue-hoki",href:"/channels/voice/mohs/view/{{row.entity.id}}/settings",name:"settings"},{"class":"{{row.entity.defaultEntry ? 'red-sunglo disabled' : 'red-sunglo'}}",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=b.gridOptions(c,d,a)},a.createItem=function(){var b=d.open({animation:!0,templateUrl:"app/channels/voice/moh/list/create.modal.html",controller:["$scope","$uibModalInstance",function(a,b){a.form={},a.item={},a.ok=function(){b.close(a.item)},a.cancel=function(){b.dismiss("cancel")}}]});b.result.then(function(b){return c.save(b).$promise.then(function(){a.gridOptions.getPage(),e.show(f.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){e.show(a.data.message,"danger")})})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.mohs.list",{url:"/list",templateUrl:"app/channels/voice/moh/list/list.html",controller:"VoiceMohListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").factory("VoiceMoh",["$resource",function(a){return a("/api/voice/musiconholds/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.mohs",{url:"/mohs",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("VoiceMohViewCtrl",["$scope","$http","xAlert","$translate","VoiceMoh","$stateParams","socket","Modal","$sce","$location","Sound",function(a,b,c,d,e,f,g,h,i,j,k){a.$translate=d,a.audioSources={},a.sortOptions=[{value:"random",name:"APPLICATION_RANDOM"},{value:"alpha",name:"APPLICATION_ALPHABETICAL"}],a.getMoh=function(){return e.get({id:f.id}).$promise.then(function(b){delete b.stamp,a.moh=b})["catch"](function(a){c.show(a.message,"danger")})},a.updateVoiceMoh=function(){return console.log("update"),e.update({id:f.id},a.moh).$promise.then(function(){c.show(d.instant("MESSAGE_WELL_DONE")+"!","success")})["catch"](function(a){c.show(a.message,"danger")})},a.addMohs=function(){return e.save({id:f.id,controller:"files"},a.item).$promise.then(function(){j.path("/channels/voice/mohs/view/"+f.id+"/audios")})["catch"](function(a){c.show(a.message,"danger")})},a.getAudioFiles=function(){return e.get({id:f.id,controller:"files"}).$promise.then(function(b){a.audioFiles=b.files,a.mohPath=b.path,a.audioFiles.forEach(function(a){l(a)})})["catch"](function(a){c.show(a.message,"danger")})},a.getSecureSrc=function(a){return i.trustAsResourceUrl(a)},a.getSounds=function(){return a.item={sounds:[]},k.get().$promise.then(function(b){a.soundList=b.rows})["catch"](function(a){c.show(a.message,"danger")})};var l=function(c){b.get("/api/voice/musiconholds/stream",{params:{path:encodeURI(a.mohPath+"/"+c)}}).success(function(b){a.audioSources[c]="data:audio/ogg;base64,"+b}).error(function(a){console.error(a)})};a.deleteItem=h.confirm["delete"](function(e){b["delete"]("/api/voice/musiconholds/"+f.id+"/files",{params:{filename:e}}).success(function(){_.remove(a.audioFiles,function(a){return a===e}),c.show(d.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(a){c.show(a.message,"danger")})})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.mohs.view",{url:"/view/:id",templateUrl:"app/channels/voice/moh/view/view.html",controller:"VoiceMohViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.channels.voice.mohs.view.settings",{url:"/settings",templateUrl:"app/channels/voice/moh/view/view.settings.html"}).state("main.channels.voice.mohs.view.audios",{url:"/audios",templateUrl:"app/channels/voice/moh/view/view.audios.html",cache:!1}).state("main.channels.voice.mohs.view.add",{url:"/add",templateUrl:"app/channels/voice/moh/view/view.addFiles.html",cache:!1})}]),angular.module("xCallyShuttleApp").controller("VoiceQueueListCtrl",["$scope","$rootScope","VoiceQueue","gridOptions","$uibModal",function(a,b,c,d,e){a.initView=function(){var b={exporterCsvFilename:"voice_queues.csv",primaryKey:"name",columnDefs:[{name:"name"},{name:"strategy"},{name:"description"},{name:"action",width:200,buttons:[{"class":"blue-hoki",href:"/channels/voice/queues/view/{{row.entity.name}}/settings",name:"settings"},{"class":"green-meadow",href:"/channels/voice/queues/view/{{row.entity.name}}/agents",name:"agents"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.name)"}]}]};a.gridOptions=d.gridOptions(c,b,a)},a.createItem=function(){var b=e.open({animation:!0,templateUrl:"app/channels/voice/queue/list/list.create.modal.html",controller:"VoiceQueueListCreateCtrl"});b.result.then(function(){a.gridOptions.getPage()})}}]),angular.module("xCallyShuttleApp").controller("VoiceQueueListCreateCtrl",["$scope","$uibModalInstance","$translate","xAlert","VoiceQueue",function(a,b,c,d,e){a.form={},a.item={},a.save=function(){return e.save(a.item).$promise.then(function(a){d.show(c.instant("MESSAGE_WELL_DONE"),"success"),b.close(a)})["catch"](function(a){d.show(a.data.message,"danger")})},a.cancel=function(){b.dismiss()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.queues.list",{url:"/list",templateUrl:"app/channels/voice/queue/list/list.html",controller:"VoiceQueueListCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.queues",{url:"/queues",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").factory("ReportQueue",["$resource",function(a){return a("/api/report/queues/:id/:controller",{name:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").controller("VoiceQueueViewCtrl",["$scope","$http","xAlert","$translate","$stateParams","socket","$location","VoiceQueue","VoiceContext","Team",function(a,b,c,d,e,f,g,h,i,j){a.penalty=0,a.binaryChoices=[{name:"Yes",value:1},{name:"No",value:0}],a.recordSwitch={onText:"On",offText:"Off",isActive:!0,size:"small",animate:!0,radioOff:!0,handleWidth:"auto",labelWidth:"auto",inverse:!0,offColor:"danger",onColor:"success"},a.monitorFormats=[{name:"wav",value:"wav"},{name:"gsm",value:"gsm"},{name:"Inactive",value:""}],a.queueAnnounces=[{display_name:"Default",value:null},{display_name:"Disabled",value:""}];var k=function(){return{select:function(b){return h.save({id:a.queue.name,controller:"agents"},{agents:b,penalty:a.queue.penalty}).$promise.then(function(){a.getTeams()})["catch"](function(a){console.log(a)})},deselect:function(b){return h["delete"]({id:a.queue.name,controller:"agents",agents:b}).$promise.then(function(){a.getTeams()})["catch"](function(a){console.log(a)})}}};a.getQueue=function(){return h.get({id:e.id}).$promise.then(function(b){b.joinempty=""===b.joinempty?[]:b.joinempty.split(","),b.leavewhenempty=""===b.leavewhenempty?[]:b.leavewhenempty.split(","),b.periodic_announce=""===b.periodic_announce?[]:b.periodic_announce.split(","),b.penalty=0,a.queue=b})["catch"](function(a){g.path("/channels/voice/queues/list")})},a.updateVoiceQueue=function(){var b=angular.copy(a.queue);return b.joinempty=b.joinempty.join(","),b.leavewhenempty=b.leavewhenempty.join(","),
-b.periodic_announce=b.periodic_announce.join(","),b.context||(b.context=null),h.update({id:e.id},b).$promise.then(function(){c.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){c.show(d.instant(a.data.message),"danger")})},a.getTeams=function(){return j.get().$promise.then(function(b){return a.teams=b.rows,h.query({id:e.id,controller:"agents"}).$promise}).then(function(b){ComponentsDropdowns.bindQueue(a.teams,_.map(b,function(a){return{id:a.id,penalty:a.UserHasVoiceQueue.penalty}}),k)})["catch"](function(a){console.error(a)})},a.getContexts=function(){return i.get().$promise.then(function(b){a.voiceContexts=b.rows})["catch"](function(a){c.show(d.instant(data.message),"danger")})},a.getMohs=function(){b.get("/api/voice/musiconholds").success(function(b){a.voiceMohs=b.rows,f.syncUpdates("voice_musiconhold",a.voiceMohs)}).error(function(a){c.show(a.message,"danger")})},a.getSounds=function(){b.get("/api/sounds").success(function(b){a.queueAnnounces=a.queueAnnounces.concat(b),a.periodicAnnounces=angular.copy(b.rows),b.rows.unshift({display_name:"None",converted_path:null,value:""}),a.sounds=b.rows,f.syncUpdates("sound",a.sounds)}).error(function(a){console.error(a)})},a.returnAnnouncePath=function(a){return a.converted_path?a.converted_path+"/"+a.save_name:null===a.value?null:a.value}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.queues.view",{url:"/view/:id",templateUrl:"app/channels/voice/queue/view/view.html",controller:"VoiceQueueViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.channels.voice.queues.view.settings",{url:"/settings",templateUrl:"app/channels/voice/queue/view/view.settings.html"}).state("main.channels.voice.queues.view.agents",{url:"/agents",templateUrl:"app/channels/voice/queue/view/view.agents.html",cache:!1,serie:!0,resolve:{deps:["$ocLazyLoad",function(a){return a.load({insertBefore:"#ng_load_plugins_before",files:["assets/plugins/jquery-multi-select/css/multi-select.css","assets/plugins/jquery-multi-select/js/jquery.multi-select.js","assets/plugins/jquery-quicksearch/jquery.quicksearch.js","assets/scripts/components-dropdowns.js"]})}]}})}]),angular.module("xCallyShuttleApp").factory("VoiceQueue",["$resource",function(a){return a("/api/voice/queues/:id/:controller",{name:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.realtime",{url:"/realtime",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("VoiceRealtimeViewAgentCtrl",["$scope","$log","$uibModal","$translate","socket","xAlert","Agent","Pause","Action","VoiceQueue","usSpinnerService","$q","uiGridConstants",function(a,b,c,d,e,f,g,h,i,j,k,l,m){function n(){return k.spin("spinner-grid"),g.get(s).$promise.then(function(b){a.gridOptions.totalItems=b.count,a.gridOptions.data=[],b.rows.forEach(function(a){p(a)})})["catch"](function(a){f.show(a.message,"danger")})["finally"](function(){k.stop("spinner-grid")})}function o(){e.socket.on("agent:save",function(b){var c=_.find(a.gridOptions.data,{agentId:b.id,isAgent:!0});if(c){var d=a.gridOptions.data.indexOf(c);a.gridOptions.data[d].online=b.online,a.gridOptions.data[d].lastLoginAt=b.lastLoginAt,a.gridOptions.data[d].pause=b.voicePause,a.gridOptions.data[d].pauseType=b.pauseType,a.gridOptions.data[d].lastPauseAt=b.lastPauseAt,a.gridOptions.data[d].status=b.status,a.gridOptions.data[d].statusAt=b.statusAt,a.gridOptions.data[d].queueStatus=b.queueStatus,a.gridOptions.data[d].queueStatusAt=b.queueStatusAt,a.gridOptions.data[d].lastQueue=b.lastQueue,a.gridOptions.data[d].ipaddr=b.ipaddr,a.gridOptions.data[d].port=b.port,a.gridOptions.data[d].fullcontact=b.fullcontact,a.gridOptions.data[d].useragent=b.useragent,a.gridOptions.data[d].lastms=b.lastms,a.gridOptions.data[d].internal=b.internal,_.map(a.gridOptions.data,function(a){a.isAgent||a.agentId!==b.id||(a.online=b.online)})}}),e.socket.on("agent:remove",function(b){_.remove(a.gridOptions.data,{agentId:b.id})}),e.socket.on("user_has_voice_queue:save",function(b){var c=_.find(a.gridOptions.data,{agentId:b.UserId,queue:b.queue});if(!c&&b.logged){var d=_.find(a.gridOptions.data,{agentId:b.UserId,isAgent:!0}),e=a.gridOptions.data.indexOf(d);a.gridOptions.data.splice(e+1,0,{isAgent:!1,agentId:b.UserId,queue:b.queue,agent:b.membername,callstaken:b.callstaken?b.callstaken:0,online:d.online})}else c&&!b.logged?_.remove(a.gridOptions.data,{agentId:b.UserId,queue:b.queue}):c&&b.logged&&(c.callstaken=b.callstaken?b.callstaken:0)}),e.socket.on("user_has_voice_queue:remove",function(b){_.remove(a.gridOptions.data,{agentId:b.UserId,queue:b.queue})})}function p(b){a.gridOptions.data.push({isAgent:!0,agentId:b.id,agent:b.name,online:b.online,lastLoginAt:b.lastLoginAt,lastPauseAt:b.lastPauseAt,pause:b.voicePause,pauseType:b.pauseType,status:b.status||"UNKNOWN",statusAt:b.statusAt,queueStatus:b.queueStatus||"READY",queueStatusAt:b.queueStatusAt,lastQueue:b.lastQueue,ipaddr:b.ipaddr,port:b.port,fullcontact:b.fullcontact,useragent:b.useragent,lastms:b.lastms,internal:b.internal,$$treeLevel:0}),b.VoiceQueues.forEach(function(c){c.UserHasVoiceQueue.logged&&a.gridOptions.data.push({isAgent:!1,agentId:b.id,queue:c.name,agent:b.name,callstaken:c.UserHasVoiceQueue.callstaken?c.UserHasVoiceQueue.callstaken:0,online:b.online})})}function q(){return h.get().$promise.then(function(b){a.pauses=b.rows,e.syncUpdates("pause",a.pauses)})["catch"](function(a){f.show(a.message,"danger")})}function r(){return j.get().$promise.then(function(b){a.voiceQueues=b.rows,e.syncUpdates("voice_queue",a.voiceQueues)})["catch"](function(a){f.show(a.message,"danger")})}a.voiceQueues=[];var s={offset:0,limit:10};a.moment=moment,a.initAgents=function(){a.gridOptions={enableGridMenu:!0,headerCellFilter:"translate",enableHorizontalScrollbar:0,enableVerticalScrollbar:0,enableFiltering:!0,showGridFooter:!0,paginationPageSizes:[10,25,50,75],paginationPageSize:10,useExternalPagination:!0,useExternalSorting:!0,useExternalFiltering:!0,multiSelect:!0,showTreeExpandNoChildren:!0,columnDefs:[{name:"name",displayName:"APPLICATION_AGENT",headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div data-ng-if="row.entity.isAgent">{{row.entity.agent}} &lt;{{row.entity.internal}}&gt;</div>'},{name:"online",displayName:"APPLICATION_ONLINE",width:150,headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div data-ng-if="row.entity.online != null && row.entity.isAgent"><i class="icon-user" data-ng-class="row.entity.online ? \'font-green\' : \'font-red\'"></i> <span data-ng-if="row.entity.online" class="left-margin">(<timer start-time="grid.appScope.moment(row.entity.lastLoginAt).unix()*1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>)</span></div>',filter:{type:m.filter.SELECT,selectOptions:[{value:"true",label:"ONLINE"},{value:"false",label:"OFFLINE"}]}},{name:"status",displayName:"APPLICATION_PHONE_STATUS",headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",cellTemplate:"<div data-ng-if=\"row.entity.isAgent\">{{'APPLICATION_'+row.entity.status | translate}} <span data-ng-if=\"row.entity.statusAt && (row.entity.status === 'BUSY' || row.entity.status === 'ONHOLD' || row.entity.status === 'INUSE')\">(<timer start-time=\"grid.appScope.moment(row.entity.statusAt).unix()*1000\">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>)</span></span></div>",filter:{type:m.filter.SELECT,selectOptions:[{value:"UNKNOWN",label:d.instant("APPLICATION_UNKNOWN")},{value:"NOT_INUSE",label:d.instant("APPLICATION_NOT_INUSE")},{value:"INUSE",label:d.instant("APPLICATION_INUSE")},{value:"BUSY",label:d.instant("APPLICATION_BUSY")},{value:"INVALID",label:d.instant("APPLICATION_INVALID")},{value:"UNAVAILABLE",label:d.instant("APPLICATION_UNAVAILABLE")},{value:"RINGING",label:d.instant("APPLICATION_RINGING")},{value:"RINGINUSE",label:d.instant("APPLICATION_RINGINUSE")},{value:"ONHOLD",label:d.instant("APPLICATION_ONHOLD")}]}},{name:"queueStatus",width:400,displayName:"APPLICATION_QUEUE_STATUS",headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div data-ng-if="row.entity.isAgent && row.entity.online" class="ui-grid-vcenter" data-ng-class="{\'paused-agent\':row.entity.pause}"><span>{{\'APPLICATION_\'+row.entity.queueStatus.toUpperCase() | translate}}</span><span data-ng-if="(row.entity.queueStatus!==\'complete\' && (row.entity.queueStatus!==\'paused\' || row.entity.pauseType === \'ACW\'))"> [{{row.entity.lastQueue}}]</span><span data-ng-if="row.entity.pause"> [{{row.entity.pauseType}}]</span><timer data-ng-if="row.entity.queueStatusAt && row.entity.queueStatus!==\'complete\'" start-time="grid.appScope.moment(row.entity.queueStatusAt).unix()*1000"> [{{hhours}}:{{mminutes}}:{{sseconds}}]</timer></span><span class="left-margin"><i data-ng-if="row.entity.pause" data-ng-click="grid.appScope.pause(row.entity.agentId,\'unpause\')" class="icon-control-play font-green pointer-cursor" title="{{\'APPLICATION_RESUME\' | translate}}"></i><i class="icon-control-pause font-yellow pointer-cursor" data-ng-click="grid.appScope.pause(row.entity.agentId,\'pause\',\'DEFAULT PAUSE\')" title="{{\'APPLICATION_DEFAULT_PAUSE\' | translate}}"></i></span><select data-ng-if="grid.appScope.pauses.length" class="pause-select pointer-cursor" data-ng-model="grid.appScope.pauseType" data-ng-change="grid.appScope.pause(row.entity.agentId,\'pause\',grid.appScope.pauseType)"><option class="pointer-cursor" data-ng-repeat="pause in grid.appScope.pauses">{{pause.name}}</option></select></div>',filter:{type:m.filter.SELECT,selectOptions:[{value:"paused",label:d.instant("APPLICATION_PAUSED")},{value:"connect",label:d.instant("APPLICATION_CONNECT")},{value:"complete",label:d.instant("APPLICATION_COMPLETE")},{value:"called",label:d.instant("APPLICATION_CALLED")}]},enableSorting:!1,enableColumnMenu:!1},{name:"queue",displayName:"APPLICATION_QUEUE",headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",enableSorting:!1,enableFiltering:!1,enableColumnMenu:!1},{name:"callstaken",displayName:"APPLICATION_CALLS_TAKEN",headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div data-ng-if="row.entity.callstaken !== null">{{row.entity.callstaken}}</div>',enableSorting:!1,enableFiltering:!1,enableColumnMenu:!1,width:100},{name:"action",displayName:"",width:170,cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div><button data-ng-if="row.entity.queue" class="btn btn-xs red-sunglo" data-ng-click="grid.appScope.leaveQueue(row.entity.agentId,row.entity.queue)"><i class="icon-ban"></i> {{\'APPLICATION_LEAVE\' | translate}}</button><button data-ng-if="row.entity.isAgent && row.treeNode.children.length < grid.appScope.voiceQueues.length" class="btn btn-xs blue-hoki" data-ng-click="grid.appScope.joinQueue(row.entity.agentId)"><i class="icon-plus"></i> {{\'APPLICATION_JOIN_QUEUE\' | translate}}</button> <button data-ng-if="row.entity.isAgent" class="btn btn-xs blue-madison" data-ng-click="grid.appScope.showInfo(row.entity)"><i class="icon-info"></i> {{\'APPLICATION_INFO\' | translate}}</button><div>',enableSorting:!1,enableFiltering:!1,enableColumnMenu:!1}],data:[],gridMenuTitleFilter:function(a){var b=l.defer();return b.resolve(d.instant(a)),b.promise},onRegisterApi:function(b){a.gridApi=b,a.gridApi.grid.registerDataChangeCallback(function(){t(a.gridApi.core.getVisibleRows(a.gridApi.grid).length)}),a.gridApi.treeBase.on.rowExpanded(a,function(b){t(a.gridApi.core.getVisibleRows(a.gridApi.grid).length+b.treeNode.children.length)}),a.gridApi.treeBase.on.rowCollapsed(a,function(b){t(a.gridApi.core.getVisibleRows(a.gridApi.grid).length-b.treeNode.children.length)}),a.gridApi.core.on.sortChanged(a,function(a,b){0===b.length?s.order=null:s.order=b[0].name+" "+b[0].sort.direction.toUpperCase(),n()}),a.gridApi.pagination.on.paginationChanged(a,function(a,b){s.offset=(a-1)*b,s.limit=b,n()}),a.gridApi.core.on.filterChanged(a,function(){var a=this.grid;a.columns.forEach(function(a){a.filters[0].term?s[a.name]=a.filters[0].term:delete s[a.name]}),n()})}},n(),q(),r(),o()};var t=function(a){var b=a?30*a+130:270;angular.element(document.getElementsByClassName("ui-grid")[0]).css("height",b+"px"),angular.element(document.getElementsByClassName("ui-grid-viewport")).css("height",30*a+"px")};a.$on("$destroy",function(){e.unsyncUpdates("agent"),e.unsyncUpdates("user_has_voice_queue")}),a.pause=function(a,b,c){return i.save({name:b,agent:a,type:c||"DEFAULT PAUSE",data4:c||"DEFAULT PAUSE",channel:"voice"}).$promise.then(function(){f.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){f.show(d.instant(a.message||a.data.message||a.translatedMessage||a.data.translatedMessage),"danger")})},a.joinQueue=function(e){var g=c.open({animation:!0,templateUrl:"app/channels/voice/realtime/view/agent/queue.modal.add.html",controller:"VoiceRealtimeViewAgentQueueModalCtrl",resolve:{queues:function(){return _.reject(a.voiceQueues,function(b){return _.find(a.gridOptions.data,{queue:b.name,isAgent:!1,agentId:e})?!0:!1})}}});g.result.then(function(a){return i.save({name:"QueueAdd",agent:e,queues:a.queues,channel:"voice",data1:e,data3:a.queues.join(","),data4:"voice"}).$promise.then(function(){f.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){f.show(a.message,"danger")})},function(){b.info("Modal dismissed at: "+new Date)})},a.leaveQueue=function(a,b){return i.save({name:"QueueRemove",agent:a,queue:b,channel:"voice",data1:a,data3:b,data4:"voice"}).$promise.then(function(){f.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){f.show(a.message,"danger")})},a.showInfo=function(a){c.open({animation:!0,templateUrl:"app/channels/voice/realtime/view/agent/agent.modal.info.html",controller:"VoiceRealtimeViewAgentInfoModalCtrl",resolve:{agent:a}})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.realtime.view.agents",{url:"/agents",templateUrl:"app/channels/voice/realtime/view/agent/agent.html",controller:"VoiceRealtimeViewAgentCtrl"})}]),angular.module("xCallyShuttleApp").controller("VoiceRealtimeViewAgentInfoModalCtrl",["$scope","$uibModalInstance","$http","agent",function(a,b,c,d){a.agent=d,a.close=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("VoiceRealtimeViewAgentQueueModalCtrl",["$scope","$uibModalInstance","$http","queues",function(a,b,c,d){a.queues=d,a.item={},a.save=function(){b.close(a.item)},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("VoiceRealtimeViewAgentReportCtrl",["$scope","$http","socket",function(a,b,c){a.$on("$destroy",function(){c.unsyncUpdates("report_agent")}),a.conf={agentsByPage:{name:"10",value:10},labels:["fullname","name","email"]},a.agentsByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.initReport=function(){a.agents=[],b.get("/api/report/agents").success(function(b){a.agents=b,c.syncUpdates("report_agent",a.agents)}).error(function(a){console.error(a)})}}]),angular.module("xCallyShuttleApp").filter("VoiceRealtimeViewAgentReportFilter",function(){return function(a){return new Date(1970,0,1).setSeconds(a)}}),angular.module("xCallyShuttleApp").controller("VoiceRealtimeViewQueueReportCtrl",["$scope","$http","socket",function(a,b,c){a.$on("$destroy",function(){c.unsyncUpdates("report_queue")}),a.conf={queuesByPage:{name:"10",value:10},labels:["fullname","name","email"]},a.queuesByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.initReport=function(){a.queues=[],b.get("/api/report/queues").success(function(b){console.log(b),a.queues=b,c.syncUpdates("report_queue",a.queues)}).error(function(a){console.error(a)})}}]),angular.module("xCallyShuttleApp").filter("VoiceRealtimeViewQueueReportFilter",function(){return function(a){return new Date(1970,0,1).setSeconds(a)}}),angular.module("xCallyShuttleApp").controller("VoiceRealtimeViewQueuePauseModalCtrl",["$scope","$uibModalInstance","items","data",function(a,b,c,d){a.items=c,a.data=d,console.log(d),a.selected={item:a.items[0],queue:_.isArray(d)?a.data[0].queue:a.data.queue,membername:_.isArray(d)?a.data[0].membername:a.data.membername,"interface":_.isArray(d)?a.data[0]["interface"]:a.data["interface"]},a.ok=function(c,e){var f;_.isArray(d)?(f=[],d.forEach(function(b){f.push({action:"QueuePause",queue:b.queue,membername:b.membername,"interface":b["interface"],paused:c,reason:a.selected.item})})):f={action:"QueuePause",queue:a.selected.queue,membername:a.selected.membername,"interface":a.selected["interface"],paused:c,reason:a.selected.item},b.close(f)},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("VoiceRealtimeViewQueueCtrl",["$scope","$http","$log","$uibModal","$translate","socket","xAlert",function(a,b,c,d,e,f,g){a.conf={agentsByPage:{name:"10",value:10},labels:["fullname","name","email"]},a.agentsByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.$on("$destroy",function(){f.unsyncUpdates("user_has_voice_queue")}),a.groups=[],a.pauses=["pausa1","pausa2","pausa3"],a.pause=function(f,h){var i=d.open({animation:!0,size:f,templateUrl:"app/channels/voice/realtime/view/queue/pause.modal.html",controller:"VoiceRealtimeViewQueuePauseModalCtrl",resolve:{items:function(){return a.pauses},data:function(){return h}}});i.result.then(function(a){_.isArray(a)?a.forEach(function(a){b.post("/api/ami",a).then(function(a){console.log(a),g.show(e.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){console.log(a),g.show(a.data.message,"danger")})}):b.post("/api/ami",a).then(function(a){console.log(a),g.show(e.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){console.log(a),g.show(a.data.message,"danger")})},function(){c.info("Modal dismissed at: "+new Date)})},a.add=function(f,h){var i=d.open({animation:!0,size:f,templateUrl:"app/channels/voice/realtime/view/queue/queue.modal.add.html",controller:"VoiceRealtimeViewQueueQueueModalCtrl",resolve:{pauses:function(){return a.pauses},data:function(){return h}}});i.result.then(function(a){console.log("action",a),b.post("/api/voice/user_has_queues",a).then(function(){a.login?b.post("/api/ami",a).then(function(){g.show(e.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){g.show(a.data.message,"danger")}):g.show(e.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){g.show(a.message,"danger")}),console.log(a)},function(){c.info("Modal dismissed at: "+new Date)})},a.remove=function(a,f){var h=d.open({animation:!0,size:a,templateUrl:"app/channels/voice/realtime/view/queue/queue.modal.remove.html",controller:"VoiceRealtimeViewQueueQueueModalCtrl",resolve:{pauses:function(){return null},data:function(){return f}}});h.result.then(function(a){_.isArray(a)?a.forEach(function(a){b.post("/api/ami",a).then(function(){a.logout?b.put("/api/voice/queues/"+a.queue+"/agents",{agents:[a.UserId]}).then(function(){g.show(e.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){g.show(a.data.message,"danger")}):g.show(e.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){g.show(a.data.message,"danger")})}):b.post("/api/ami",a).then(function(){a.logout?b.put("/api/voice/queues/"+a.queue+"/agents",{agents:[a.UserId]}).then(function(){g.show(e.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){g.show(a.data.message,"danger")}):g.show(e.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){g.show(a.data.message,"danger")})},function(){c.info("Modal dismissed at: "+new Date)})},a.initQueues=function(){b.get("/api/voice/user_has_queues").success(function(b){a.queues=b,a.groups=_.map(_.groupBy(a.queues,"queue"),function(a,b){return{queue:b,agents:a}}),console.log("ok"),f.socket.on("user_has_voice_queue:save",function(b){console.log("item",b);var c=_.find(a.groups,{queue:b.queue}),d=a.groups.indexOf(c);if(c){var e=_.find(c.agents,{membername:b.membername});e?_.merge(e,b):a.groups[d].agents.push(b)}else{var f={queue:b.queue,agents:[b]};a.groups.unshift(f)}}),f.socket.on("user_has_voice_queue:remove",function(b){var c=_.find(a.groups,{queue:b.queue});_.remove(c.agents,{membername:b.membername}),c.agents.length||_.remove(a.groups,{queue:b.queue})}),f.socket.on("report_agent:save",function(b){var c=_.find(a.groups,{queue:b.queue}),d=a.groups.indexOf(c);if(c){var e=_.find(c.agents,{membername:b.membername});e?_.merge(e,b):a.groups[d].agents.push(b)}else{var f={queue:b.queue,agents:[b]};a.groups.unshift(f)}})}).error(function(a){console.error(a)})}}]),angular.module("xCallyShuttleApp").controller("VoiceRealtimeViewQueueQueueModalCtrl",["$scope","$uibModalInstance","$http","pauses","data",function(a,b,c,d,e){a.initAdd=function(){a.data=e,a.pauses=d,a.selected={penalty:0,paused:!1,reason:a.pauses[0]},a.$watch("selected.agent",function(b){b&&(a.selected.membername=b.name,a.selected["interface"]="SIP/"+b.name,a.selected.UserId=b.id)}),c.get("/api/agents",{params:{page:0,per_page:500}}).success(function(b){a.agents=_.reject(b.rows,function(b){return _.find(a.data,{membername:b.name})?!0:!1}),a.selected.queue=a.data[0]?a.data[0].queue:null}).error(function(a){console.error(a)})},a.initRemove=function(){a.data=e,console.log(e),_.isArray(e)?a.selected={queue:a.data[0].queue,logout:!1}:a.selected={membername:a.data.membername,"interface":a.data["interface"],queue:a.data.queue,logout:!1,UserId:a.data.UserId}},a.okAdd=function(){var c={action:"QueueAdd",queue:a.selected.queue,membername:a.selected.membername,"interface":a.selected["interface"],penalty:a.selected.penalty,paused:a.selected.paused,UserId:a.selected.UserId};c.paused&&(c.reason=a.selected.reason),b.close(c)},a.okRemove=function(){var c;_.isArray(a.data)?(c=[],a.data.forEach(function(b){c.push({action:"QueueRemove",queue:b.queue,"interface":b["interface"],logout:a.selected.logout,UserId:b.UserId})})):c={action:"QueueRemove",queue:a.selected.queue,logout:a.selected.logout,"interface":a.selected["interface"],UserId:a.selected.UserId},b.close(c)},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("VoiceRealtimeViewCtrl",["$scope",function(a){a.agents=[{name:"View1",link:"main.channels.voice.realtime.view.agents"},{name:"View2",link:"main.channels.voice.realtime.view.areports"}],a.queues=[{name:"View1",link:"main.channels.voice.realtime.view.queues"},{name:"View2",link:"main.channels.voice.realtime.view.qreports"}]}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.realtime.view",{url:"/view",templateUrl:"app/channels/voice/realtime/view/view.html",controller:"VoiceRealtimeViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/css/profile.css","assets/css/tasks.css"]}])}]}})}]),angular.module("xCallyShuttleApp").controller("VoiceRecordingListCtrl",["$scope","$translate","$sce","Recording","gridOptions","xAlert","uiGridConstants",function(a,b,c,d,e,f,g){a.Recording=d;a.updateRating=function(a,c){d.patch({id:a,rating:c}).$promise.then(function(){f.show(b.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){f.show(a.message,"danger")})},a.initView=function(){var b={exporterCsvFilename:"recordings.csv",rowHeight:30,columnDefs:[{name:"uniqueid"},{name:"calleridnum"},{name:"calleridname"},{name:"connectedlinenum"},{name:"connectedlinename"},{name:"rating",filter:{type:g.filter.SELECT,selectOptions:[{value:1,label:"1"},{value:2,label:"2"},{value:3,label:"3"},{value:4,label:"4"},{value:5,label:"5"}]},cellClass:"ui-grid-vcenter",width:"100",cellTemplate:'<div><uib-rating data-ng-model="row.entity.rating" data-ng-click="grid.appScope.updateRating(row.entity.uniqueid, row.entity.rating)" aria-labelledby="default-rating"></uib-rating></div>'},{name:"audio",displayName:"",width:225,enableSorting:!1,enableFiltering:!1,buttons:[{directive:'<audio-file-download params="{id:row.entity.uniqueid,controller:\'stream\'}" resource="grid.appScope.Recording"></audio-file-download>'}]},{name:"action",width:150,buttons:[{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.uniqueid, row.entity.uniqueid)"},{directive:'<motion-file-download params="{id:row.entity.uniqueid,controller:\'stream\'}" resource="grid.appScope.Recording" mimetype="audio/wav" btnclass="btn btn-xs blue-hoki" filename="row.entity.uniqueid+\'.wav\'"></motion-file-download>'}]}]};a.gridOptions=e.gridOptions(d,b,a)}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.recordings.list",{url:"/list",templateUrl:"app/channels/voice/recording/list/list.html",controller:"VoiceRecordingListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").factory("Recording",["$resource",function(a){return a("/api/voice/recordings/:id/:controller",{id:"@id"},{update:{method:"PUT"},patch:{method:"PATCH"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.recordings",{url:"/recordings",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.routes.inbound",{url:"/inbound",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("VoiceRouteInboundListCreateCtrl",["$scope","$uibModalInstance","Route","application","xAlert","$location","$translate",function(a,b,c,d,e,f,g){a.$application=d.application,a.forms={route:void 0},a.item={type:"inbound",appdata:"Inbound Call",context:"from-voip-provider"},a.ok=function(){return a.item.exten=a.$application.checkUnderscore(a.item.exten),c.save(a.item).$promise.then(function(a){b.close(a),f.path("/channels/voice/routes/inbound/view/"+a.id+"/applications")})["catch"](function(a){console.log(a),e.show(g.instant(a.data.translatedMessage),"danger")})},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("VoiceRouteInboundListCtrl",["$scope","$http","socket","$translate","$rootScope","xAlert","Modal","stResource","gridOptions","Route","$uibModal","$location","$log",function(a,b,c,d,e,f,g,h,i,j,k,l,m){a.initView=function(){var b={exporterCsvFilename:"InboundRoutes.csv",columnDefs:[{name:"exten",displayName:"APPLICATION_PHONE_NUMBER"},{name:"description"},{name:"applications",cellClass:"ui-grid-vcenter",cellTemplate:'<div data-ng-if="row.entity.Applications.length"><span data-ng-repeat="app in row.entity.Applications | limitTo:2">{{app.app}}({{app.appdata[0]}}), </span>...</div><div data-ng-if="!row.entity.Applications.length">{{\'MESSAGE_NO_AVAILABLE_APPLICATIONS\' | translate}}</div>',enableSorting:!1,enableFiltering:!1,enableColumnMenu:!1},{name:"action",width:170,buttons:[{"class":"blue-hoki",href:"/channels/voice/routes/inbound/view/{{row.entity.id}}/settings",name:"settings"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.exten, row.entity.id)"}]}]};a.gridOptions=i.gridOptions(j,b,a,{type:"inbound"})},a.create=function(){k.open({animation:!0,templateUrl:"app/channels/voice/route/inbound/list/create.modal.html",controller:"VoiceRouteInboundListCreateCtrl"})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.routes.inbound.list",{url:"/list",templateUrl:"app/channels/voice/route/inbound/list/list.html",controller:"VoiceRouteInboundListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").controller("VoiceRouteInboundViewCtrl",["$scope","$translate","$stateParams","socket","$location","WizardHandler","Modal","xAlert","application","interval","Route","VoiceQueue","Sound","SquareProject","VoiceContext","Interval","VoiceMail",function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q){function r(b){var c,d;if("always"===b.intType)c=null,d="*,*,*,*";else if("list"===b.intType)d=b.IntervalId?_.find(a.Intervals,{id:b.IntervalId}).name:"*,*,*,*",c=b.IntervalId||null;else if("custom"===b.intType){c=null;var e,f,g,h;e=b.t_from&&b.t_to&&!b.alwaysTime?moment(b.t_from).format("HH:mm")+"-"+moment(b.t_to).format("HH:mm"):"*",b.wd_from&&"always"!==b.wd_from?(f=b.wd_from,b.wd_to&&"always"!==b.wd_to&&(f+="-"+b.wd_to)):f="*",b.md_from&&"always"!==b.md_from?(g=b.md_from,b.md_to&&"always"!==b.md_to&&(g+="-"+b.md_to)):g="*",b.m_from&&"always"!==b.m_from?(h=b.m_from,b.m_to&&"always"!==b.m_to&&(h+="-"+b.m_to)):h="*",d=e+","+f+","+g+","+h}void 0===a.selectedApp?(a.application.interval=d,a.application.IntervalId=c):(a.route.Applications[a.selectedApp].interval=d,a.route.Applications[a.selectedApp].IntervalId=c)}function s(){if(a.interval.intType=a.route.Applications[a.selectedApp].IntervalId?"list":"*,*,*,*"===a.route.Applications[a.selectedApp].interval?"always":"custom",a.interval.IntervalId=a.route.Applications[a.selectedApp].IntervalId,!a.route.Applications[a.selectedApp].IntervalId){var b,c=a.route.Applications[a.selectedApp].interval?a.route.Applications[a.selectedApp].interval.split(","):["*","*","*","*"];c.forEach(function(c,d){switch(d){case 0:"*"!==c?(b=c.split("-"),a.interval.t_from=moment(b[0],"HH:mm"),a.interval.t_to=moment(b[1],"HH:mm"),a.interval.alwaysTime=!1):(a.interval.t_from=moment(new Date),a.interval.t_to=moment(new Date),a.interval.alwaysTime=!0);break;case 1:"*"!==c?(b=c.split("-"),a.interval.wd_from=b[0],a.interval.wd_to=b[1]?b[1]:"always"):(a.interval.wd_from="always",a.interval.wd_to="always");break;case 2:"*"!==c?(b=c.split("-"),a.interval.md_from=b[0],a.interval.md_to=b[1]?b[1]:"always"):(a.interval.md_from="always",a.interval.md_to="always");break;case 3:"*"!==c?(b=c.split("-"),a.interval.m_from=b[0],a.interval.m_to=b[1]?b[1]:"always"):(a.interval.m_from="always",a.interval.m_to="always")}})}}a.$translate=b,a.$application=i.application,a.$interval=j.interval,a.gridOptions={rowTemplate:'<div grid="grid" class="ui-grid-draggable-row" draggable="true"><div ng-repeat="(colRenderIndex, col) in colContainer.renderedColumns track by col.colDef.name" class="ui-grid-cell" ng-class="{ \'ui-grid-row-header-cell\': col.isRowHeader, \'custom\': true }" ui-grid-cell></div></div>',columnDefs:[{name:"app",displayName:"APPLICATION_APPLICATION",headerCellFilter:"translate",enableSorting:!1,enableColumnMenu:!1},{name:"appdata",displayName:"APPLICATION_ARGUMENTS",headerCellFilter:"translate",cellClass:"ui-grid-vcenter",cellTemplate:"<div>{{row.entity.appdata.join(',')}}</div>",enableSorting:!1,enableColumnMenu:!1},{name:"interval",displayName:"APPLICATION_TIME",headerCellFilter:"translate",enableSorting:!1,enableColumnMenu:!1},{name:"action",enableSorting:!1,enableColumnMenu:!1,displayName:"APPLICATION_ACTION",headerCellFilter:"translate",width:125,cellTemplate:'<a class="btn btn-xs blue-hoki" data-ng-click="grid.appScope.openApplication(grid.appScope.gridOptions.data.indexOf(row.entity))">{{\'APPLICATION_SETTINGS\' | translate}}</a><a class="btn btn-xs red-sunglo" data-ng-click="grid.appScope.deleteApp(row.entity.app+\' application\', grid.appScope.gridOptions.data.indexOf(row.entity))">{{\'APPLICATION_DELETE\' | translate}}</a>'}],onRegisterApi:function(b){b.draggableRows.on.rowDropped(a,function(b,c){a.updateRoute()})}},a.initApplication=function(b){b&&(a.selectedApp=void 0),a.forms={settings:void 0,interval:void 0},a.application={},a.interval={intType:"always",t_from:moment(new Date),t_to:moment(new Date),wd_from:"always",wd_to:"always",md_from:"always",md_to:"always",
-m_from:"always",m_to:"always",alwaysTime:!0},a.main={app:""}},a.$watch("interval",function(a){a&&r(a)},!0),a.updateSetAppdata=function(){a.application.variable&&a.application.value&&"Set"===a.main.app?a.application.appdata[0]=a.application.variable+"="+a.application.value:a.application.appdata[0]=null},a.updateSetAppdataSettings=function(){a.application.variable&&a.application.value&&"Set"===a.main.app?a.route.Applications[a.selectedApp].appdata[0]=a.application.variable+"="+a.application.value:a.application.appdata[0]=null},a.$watch("main.app",function(d){if(d){var e,f;switch(c.appId||(a.application={app:d,interval:a.application.interval||"*,*,*,*",appdata:[]}),d){case"Queue":e=l,f=m;break;case"Playback":e=m;break;case"AGI":e=n;break;case"Goto":e=o;break;case"Voicemail":e=q;break;default:e=null,f=null}if(e)return e.get().$promise.then(function(b){a.items=b.rows}).then(function(){return f?f.get().$promise:void 0}).then(function(b){b&&(a.items2=b.rows)})["catch"](function(a){h.show(b.instant(a.message),"danger")})}},!0),a.deselectAndRedirect=function(b){a.selectedApp=void 0,e.path(b)},a.getIntervals=function(){return p.get().$promise.then(function(b){a.Intervals=b.rows,d.syncUpdates("interval",a.Intervals)})["catch"](function(a){h.show(b.instant(a.message),"danger")})},a.getRoute=function(){return k.get({id:c.id}).$promise.then(function(b){a.route=b,a.gridOptions.data=b.Applications})["catch"](function(a){e.path("/channels/voice/routes/inbound/list")})},a.getApplication=function(){void 0===a.selectedApp&&e.path("/channels/voice/routes/inbound/list");var b=_.find(a.$application.applications,{value:a.route.Applications[a.selectedApp].app});if(a.main.app=b?b.value:"custom","Set"===a.main.app){var c=a.route.Applications[a.selectedApp].appdata[0].split("=");a.application.variable=c[0],a.application.value=c[1]}if(!b){var d=a.route.Applications[a.selectedApp].appdata.join(",");a.route.Applications[a.selectedApp].appdata=[d]}s()},a.openApplication=function(b){a.selectedApp=b,e.path("/channels/voice/routes/inbound/view/"+c.id+"/applications/settings")},a.updateRoute=function(d){return a.selectedApp=void 0,a.route.exten=a.$application.checkUnderscore(a.route.exten),k.update({id:a.route.id},a.route).$promise.then(function(a){h.show(b.instant("MESSAGE_WELL_DONE")+"!","success"),d&&e.path("/channels/voice/routes/inbound/view/"+c.id+"/"+d)})["catch"](function(a){console.log(a),h.show(b.instant(a.data.translatedMessage),"danger")})},a.getContexts=function(){return o.get().$promise.then(function(b){a.voiceContexts=b.rows,d.syncUpdates("voice_context",a.voiceContexts)})["catch"](function(a){h.show(b.instant(a.message),"danger")})},a.deleteApp=g.confirm["delete"](function(b){console.log(b),console.log(a.route.Applications[b]),a.route.Applications.splice(b,1)}),a.addApplication=function(){a.route.Applications.push(a.application),a.updateRoute("applications")},a.goNext=function(){f.wizard().next()},a.previous=function(){f.wizard().previous()},a.formValidation=function(a){return a},a.$on("destroy",function(){d.unsyncUpdates("voice_extension")})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.routes.inbound.view",{url:"/view/:id",templateUrl:"app/channels/voice/route/inbound/view/view.html",controller:"VoiceRouteInboundViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.channels.voice.routes.inbound.view.settings",{url:"/settings",templateUrl:"app/channels/voice/route/inbound/view/view.settings.html"}).state("main.channels.voice.routes.inbound.view.applications",{url:"/applications",templateUrl:"app/channels/voice/route/inbound/view/view.applications.html"}).state("main.channels.voice.routes.inbound.view.application",{url:"/application",templateUrl:"app/channels/voice/route/view.application.html"}).state("main.channels.voice.routes.inbound.view.applications.settings",{url:"/settings",templateUrl:"app/channels/voice/route/view.applicationSettings.html"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.routes.internal",{url:"/internal",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("VoiceRouteInternalListCreateCtrl",["$scope","$uibModalInstance","Route","application","$location","$translate","xAlert",function(a,b,c,d,e,f,g){a.$application=d.application,a.forms={route:void 0},a.item={type:"internal",appdata:"Internal Call",context:"from-sip"},a.ok=function(){return a.item.exten=a.$application.checkUnderscore(a.item.exten),c.save(a.item).$promise.then(function(a){b.close(a),e.path("/channels/voice/routes/internal/view/"+a.id+"/applications")})["catch"](function(a){g.show(f.instant(a.data.translatedMessage),"danger")})},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("VoiceRouteInternalListCtrl",["$scope","$http","socket","$translate","$rootScope","xAlert","Modal","stResource","gridOptions","Route","$uibModal","$location","$log",function(a,b,c,d,e,f,g,h,i,j,k,l,m){a.initView=function(){var b={exporterCsvFilename:"InternalRoutes.csv",columnDefs:[{name:"exten",displayName:"APPLICATION_PHONE_NUMBER"},{name:"description"},{name:"applications",cellClass:"ui-grid-vcenter",cellTemplate:'<div data-ng-if="row.entity.Applications.length"><span data-ng-repeat="app in row.entity.Applications | limitTo:2">{{app.app}}({{app.appdata[0]}}),</span>...</div><div data-ng-if="!row.entity.Applications.length">{{\'MESSAGE_NO_AVAILABLE_APPLICATIONS\' | translate}}</div>',enableSorting:!1,enableFiltering:!1,enableColumnMenu:!1},{name:"action",width:170,buttons:[{"class":"blue-hoki",href:"/channels/voice/routes/internal/view/{{row.entity.id}}/settings",name:"settings"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.exten, row.entity.id)"}]}]};a.gridOptions=i.gridOptions(j,b,a,{type:"internal"})},a.create=function(){k.open({animation:!0,templateUrl:"app/channels/voice/route/internal/list/create.modal.html",controller:"VoiceRouteInternalListCreateCtrl"})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.routes.internal.list",{url:"/list",templateUrl:"app/channels/voice/route/internal/list/list.html",controller:"VoiceRouteInternalListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").controller("VoiceRouteInternalViewCtrl",["$scope","$translate","$stateParams","socket","$location","WizardHandler","Modal","xAlert","application","interval","Route","VoiceQueue","Sound","SquareProject","VoiceContext","Interval","VoiceMail",function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q){function r(b){var c,d;if("always"===b.intType)c=null,d="*,*,*,*";else if("list"===b.intType)d=b.IntervalId?_.find(a.Intervals,{id:b.IntervalId}).name:"*,*,*,*",c=b.IntervalId||null;else if("custom"===b.intType){c=null;var e,f,g,h;e=b.t_from&&b.t_to&&!b.alwaysTime?moment(b.t_from).format("HH:mm")+"-"+moment(b.t_to).format("HH:mm"):"*",b.wd_from&&"always"!==b.wd_from?(f=b.wd_from,b.wd_to&&"always"!==b.wd_to&&(f+="-"+b.wd_to)):f="*",b.md_from&&"always"!==b.md_from?(g=b.md_from,b.md_to&&"always"!==b.md_to&&(g+="-"+b.md_to)):g="*",b.m_from&&"always"!==b.m_from?(h=b.m_from,b.m_to&&"always"!==b.m_to&&(h+="-"+b.m_to)):h="*",d=e+","+f+","+g+","+h}void 0===a.selectedApp?(a.application.interval=d,a.application.IntervalId=c):(a.route.Applications[a.selectedApp].interval=d,a.route.Applications[a.selectedApp].IntervalId=c)}function s(){if(a.interval.intType=a.route.Applications[a.selectedApp].IntervalId?"list":"*,*,*,*"===a.route.Applications[a.selectedApp].interval?"always":"custom",a.interval.IntervalId=a.route.Applications[a.selectedApp].IntervalId,!a.route.Applications[a.selectedApp].IntervalId){var b,c=a.route.Applications[a.selectedApp].interval?a.route.Applications[a.selectedApp].interval.split(","):["*","*","*","*"];c.forEach(function(c,d){switch(d){case 0:"*"!==c?(b=c.split("-"),a.interval.t_from=moment(b[0],"HH:mm"),a.interval.t_to=moment(b[1],"HH:mm"),a.interval.alwaysTime=!1):(a.interval.t_from=moment(new Date),a.interval.t_to=moment(new Date),a.interval.alwaysTime=!0);break;case 1:"*"!==c?(b=c.split("-"),a.interval.wd_from=b[0],a.interval.wd_to=b[1]?b[1]:"always"):(a.interval.wd_from="always",a.interval.wd_to="always");break;case 2:"*"!==c?(b=c.split("-"),a.interval.md_from=b[0],a.interval.md_to=b[1]?b[1]:"always"):(a.interval.md_from="always",a.interval.md_to="always");break;case 3:"*"!==c?(b=c.split("-"),a.interval.m_from=b[0],a.interval.m_to=b[1]?b[1]:"always"):(a.interval.m_from="always",a.interval.m_to="always")}})}}a.$translate=b,a.selectedApp=void 0,a.$application=i.application,a.$interval=j.interval,a.gridOptions={rowTemplate:'<div grid="grid" class="ui-grid-draggable-row" draggable="true"><div ng-repeat="(colRenderIndex, col) in colContainer.renderedColumns track by col.colDef.name" class="ui-grid-cell" ng-class="{ \'ui-grid-row-header-cell\': col.isRowHeader, \'custom\': true }" ui-grid-cell></div></div>',columnDefs:[{name:"app",displayName:"APPLICATION_APPLICATION",headerCellFilter:"translate",enableSorting:!1,enableColumnMenu:!1},{name:"appdata",displayName:"APPLICATION_ARGUMENTS",headerCellFilter:"translate",cellClass:"ui-grid-vcenter",cellTemplate:"<div>{{row.entity.appdata.join(',')}}</div>",enableSorting:!1,enableColumnMenu:!1},{name:"interval",displayName:"APPLICATION_TIME",headerCellFilter:"translate",enableSorting:!1,enableColumnMenu:!1},{name:"action",displayName:"APPLICATION_ACTION",headerCellFilter:"translate",enableSorting:!1,enableColumnMenu:!1,width:125,cellTemplate:'<a class="btn btn-xs blue-hoki" data-ng-click="grid.appScope.openApplication(grid.appScope.gridOptions.data.indexOf(row.entity))">{{\'APPLICATION_SETTINGS\' | translate}}</a><a class="btn btn-xs red-sunglo" data-ng-click="grid.appScope.deleteApp(row.entity.app+\' application\', grid.appScope.gridOptions.data.indexOf(row.entity))">{{\'APPLICATION_DELETE\' | translate}}</a>'}],onRegisterApi:function(b){b.draggableRows.on.rowDropped(a,function(b,c){a.updateRoute()})}},a.initApplication=function(b){b&&(a.selectedApp=void 0),a.forms={settings:void 0,interval:void 0},a.application={},a.interval={intType:"always",t_from:moment(new Date),t_to:moment(new Date),wd_from:"always",wd_to:"always",md_from:"always",md_to:"always",m_from:"always",m_to:"always",alwaysTime:!0},a.main={app:""}},a.$watch("interval",function(a){a&&r(a)},!0),a.updateSetAppdata=function(){a.application.variable&&a.application.value&&"Set"===a.main.app?a.application.appdata[0]=a.application.variable+"="+a.application.value:a.application.appdata[0]=null},a.updateSetAppdataSettings=function(){a.application.variable&&a.application.value&&"Set"===a.main.app?a.route.Applications[a.selectedApp].appdata[0]=a.application.variable+"="+a.application.value:a.application.appdata[0]=null},a.$watch("main.app",function(d){if(d){var e,f;switch(c.appId||(a.application={app:d,interval:a.application.interval||"*,*,*,*",appdata:[]}),d){case"Queue":e=l,f=m;break;case"Playback":e=m;break;case"AGI":e=n;break;case"Goto":e=o;break;case"Voicemail":e=q;break;default:e=null,f=null}if(e)return e.get().$promise.then(function(b){a.items=b.rows}).then(function(){return f?f.get().$promise:void 0}).then(function(b){b&&(a.items2=b.rows)})["catch"](function(a){h.show(b.instant(a.message),"danger")})}},!0),a.deselectAndRedirect=function(b){a.selectedApp=void 0,e.path(b)},a.getIntervals=function(){return p.get().$promise.then(function(b){a.Intervals=b.rows,d.syncUpdates("interval",a.Intervals)})["catch"](function(a){h.show(b.instant(a.message),"danger")})},a.getRoute=function(){return k.get({id:c.id}).$promise.then(function(b){a.route=b,a.gridOptions.data=b.Applications})["catch"](function(a){e.path("/channels/voice/routes/internal/list")})},a.getApplication=function(){console.log(a.selectedApp),void 0===a.selectedApp&&e.path("/channels/voice/routes/internal/list");var b=_.find(a.$application.applications,{value:a.route.Applications[a.selectedApp].app});if(a.main.app=b?b.value:"custom","Set"===a.main.app){var c=a.route.Applications[a.selectedApp].appdata[0].split("=");a.application.variable=c[0],a.application.value=c[1]}if(!b){var d=a.route.Applications[a.selectedApp].appdata.join(",");a.route.Applications[a.selectedApp].appdata=[d]}s()},a.openApplication=function(b){a.selectedApp=b,e.path("/channels/voice/routes/internal/view/"+c.id+"/applications/settings")},a.updateRoute=function(d){return a.selectedApp=void 0,a.route.exten=a.$application.checkUnderscore(a.route.exten),k.update({id:a.route.id},a.route).$promise.then(function(a){h.show(b.instant("MESSAGE_WELL_DONE")+"!","success"),d&&e.path("/channels/voice/routes/internal/view/"+c.id+"/"+d)})["catch"](function(a){h.show(b.instant(a.data.translatedMessage),"danger")})},a.getContexts=function(){return o.get().$promise.then(function(b){a.voiceContexts=b.rows,d.syncUpdates("voice_context",a.voiceContexts)})["catch"](function(a){h.show(b.instant(a.message),"danger")})},a.deleteApp=g.confirm["delete"](function(b){a.route.Applications.splice(b,1),a.updateRoute()}),a.addApplication=function(){a.route.Applications.push(a.application),a.updateRoute("applications")},a.goNext=function(){f.wizard().next()},a.previous=function(){f.wizard().previous()},a.formValidation=function(a){return a},a.$on("destroy",function(){d.unsyncUpdates("voice_extension")})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.routes.internal.view",{url:"/view/:id",templateUrl:"app/channels/voice/route/internal/view/view.html",controller:"VoiceRouteInternalViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.channels.voice.routes.internal.view.settings",{url:"/settings",templateUrl:"app/channels/voice/route/internal/view/view.settings.html"}).state("main.channels.voice.routes.internal.view.applications",{url:"/applications",templateUrl:"app/channels/voice/route/internal/view/view.applications.html"}).state("main.channels.voice.routes.internal.view.application",{url:"/application",templateUrl:"app/channels/voice/route/view.application.html"}).state("main.channels.voice.routes.internal.view.applications.settings",{url:"/settings",templateUrl:"app/channels/voice/route/view.applicationSettings.html"})}]),angular.module("xCallyShuttleApp").controller("VoiceRouteOutboundListCreateCtrl",["$scope","$uibModalInstance","Route","application","xAlert","$translate","$location","Tag",function(a,b,c,d,e,f,g,h){a.$application=d.application,a.forms={route:void 0},a.item={type:"outbound",appdata:"Outbound Call",context:"from-sip"},a.getTags=function(){return h.get().$promise.then(function(b){b.rows.unshift({name:"--"}),a.tags=b.rows})["catch"](function(a){e.show(f.instant(a.data.translatedMessage),"danger")})},a.ok=function(){return a.item.exten=a.$application.checkUnderscore(a.item.exten),c.save(a.item).$promise.then(function(a){b.close(a),g.path("/channels/voice/routes/outbound/view/"+a.id+"/routes")})["catch"](function(a){e.show(f.instant(a.data.translatedMessage),"danger")})},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("VoiceRouteOutboundListCtrl",["$scope","$http","socket","$translate","$rootScope","xAlert","Modal","stResource","gridOptions","Route","$uibModal","$location","$log",function(a,b,c,d,e,f,g,h,i,j,k,l,m){a.initView=function(){var b={exporterCsvFilename:"OutboundRoutes.csv",columnDefs:[{name:"exten",displayName:"APPLICATION_DESTINATION_PATTERN"},{name:"description"},{name:"applications",cellClass:"ui-grid-vcenter",cellTemplate:'<div data-ng-if="row.entity.Applications.length"><span data-ng-repeat="app in row.entity.Applications | limitTo:2">{{app.app}}({{app.appdata[0]}}),</span>...</div><div data-ng-if="!row.entity.Applications.length">{{\'MESSAGE_NO_AVAILABLE_APPLICATIONS\' | translate}}</div>',enableSorting:!1,enableFiltering:!1,enableColumnMenu:!1},{name:"action",width:170,buttons:[{"class":"blue-hoki",href:"/channels/voice/routes/outbound/view/{{row.entity.id}}/settings",name:"settings"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.exten, row.entity.id)"}]}]};a.gridOptions=i.gridOptions(j,b,a,{type:"outbound"})},a.create=function(){k.open({animation:!0,templateUrl:"app/channels/voice/route/outbound/list/create.modal.html",controller:"VoiceRouteOutboundListCreateCtrl"})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.routes.outbound.list",{url:"/list",templateUrl:"app/channels/voice/route/outbound/list/list.html",controller:"VoiceRouteOutboundListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.routes.outbound",{url:"/outbound",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("VoiceRouteOutboundViewCtrl",["$scope","xAlert","$translate","$stateParams","socket","$location","WizardHandler","Modal","application","interval","Route","Trunk","VoiceContext","Interval","Tag",function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){function p(b){var c,d;if("always"===b.intType)c=null,d="*,*,*,*";else if("list"===b.intType)d=b.IntervalId?_.find(a.Intervals,{id:b.IntervalId}).name:"*,*,*,*",c=b.IntervalId||null;else if("custom"===b.intType){c=null;var e,f,g,h;e=b.t_from&&b.t_to&&!b.alwaysTime?moment(b.t_from).format("HH:mm")+"-"+moment(b.t_to).format("HH:mm"):"*",b.wd_from&&"always"!==b.wd_from?(f=b.wd_from,b.wd_to&&"always"!==b.wd_to&&(f+="-"+b.wd_to)):f="*",b.md_from&&"always"!==b.md_from?(g=b.md_from,b.md_to&&"always"!==b.md_to&&(g+="-"+b.md_to)):g="*",b.m_from&&"always"!==b.m_from?(h=b.m_from,b.m_to&&"always"!==b.m_to&&(h+="-"+b.m_to)):h="*",d=e+","+f+","+g+","+h}void 0===a.selectedApp?(a.application.interval=d,a.application.IntervalId=c):(a.route.Applications[a.selectedApp].interval=d,a.route.Applications[a.selectedApp].IntervalId=c)}function q(){if(a.interval.intType=a.route.Applications[a.selectedApp].IntervalId?"list":"*,*,*,*"===a.route.Applications[a.selectedApp].interval?"always":"custom",a.interval.IntervalId=a.route.Applications[a.selectedApp].IntervalId,!a.route.Applications[a.selectedApp].IntervalId){var b,c=a.route.Applications[a.selectedApp].interval?a.route.Applications[a.selectedApp].interval.split(","):["*","*","*","*"];c.forEach(function(c,d){switch(d){case 0:"*"!==c?(b=c.split("-"),a.interval.t_from=moment(b[0],"HH:mm"),a.interval.t_to=moment(b[1],"HH:mm"),a.interval.alwaysTime=!1):(a.interval.t_from=moment(new Date),a.interval.t_to=moment(new Date),a.interval.alwaysTime=!0);break;case 1:"*"!==c?(b=c.split("-"),a.interval.wd_from=b[0],a.interval.wd_to=b[1]?b[1]:"always"):(a.interval.wd_from="always",a.interval.wd_to="always");break;case 2:"*"!==c?(b=c.split("-"),a.interval.md_from=b[0],a.interval.md_to=b[1]?b[1]:"always"):(a.interval.md_from="always",a.interval.md_to="always");break;case 3:"*"!==c?(b=c.split("-"),a.interval.m_from=b[0],a.interval.m_to=b[1]?b[1]:"always"):(a.interval.m_from="always",a.interval.m_to="always")}})}}a.$translate=c,a.$application=i.application,a.$interval=j.interval,a.recordSwitch={onText:"On",offText:"Off",isActive:!0,size:"small",animate:!0,radioOff:!0,handleWidth:"auto",labelWidth:"auto",inverse:!0,offColor:"danger",onColor:"success"},a.gridOptions={rowTemplate:'<div grid="grid" class="ui-grid-draggable-row" draggable="true"><div ng-repeat="(colRenderIndex, col) in colContainer.renderedColumns track by col.colDef.name" class="ui-grid-cell" ng-class="{ \'ui-grid-row-header-cell\': col.isRowHeader, \'custom\': true }" ui-grid-cell></div></div>',columnDefs:[{name:"app",displayName:"APPLICATION_APPLICATION",cellClass:"ui-grid-vcenter",cellTemplate:"<div><span data-ng-if=\"row.entity.app === 'Dial'\">Default</span><span data-ng-if=\"row.entity.app !== 'Dial'\">{{row.entity.app}}</span></div>",headerCellFilter:"translate",enableSorting:!1,enableColumnMenu:!1},{name:"appdata",displayName:"APPLICATION_ARGUMENTS",headerCellFilter:"translate",cellClass:"ui-grid-vcenter",cellTemplate:"<div>{{row.entity.appdata.join(',')}}</div>",enableSorting:!1,enableColumnMenu:!1},{name:"interval",displayName:"APPLICATION_TIME",headerCellFilter:"translate",enableSorting:!1,enableColumnMenu:!1},{name:"action",displayName:"APPLICATION_ACTION",enableSorting:!1,enableColumnMenu:!1,headerCellFilter:"translate",width:125,cellTemplate:'<a class="btn btn-xs blue-hoki" data-ng-click="grid.appScope.openApplication(grid.appScope.gridOptions.data.indexOf(row.entity))">{{\'APPLICATION_SETTINGS\' | translate}}</a><a class="btn btn-xs red-sunglo" data-ng-click="grid.appScope.deleteApp(row.entity.app+\' application\', grid.appScope.gridOptions.data.indexOf(row.entity))">{{\'APPLICATION_DELETE\' | translate}}</a>'}],onRegisterApi:function(b){b.draggableRows.on.rowDropped(a,function(b,c){a.updateRoute()})}},a.initApplication=function(b){b&&(a.selectedApp=void 0),a.forms={info:void 0,interval:void 0},a.application={},a.interval={intType:"always",t_from:moment(new Date),t_to:moment(new Date),wd_from:"always",wd_to:"always",md_from:"always",md_to:"always",m_from:"always",m_to:"always",alwaysTime:!0},a.main={app:""},a.applications=[{name:"Default",value:"Dial"},{name:"Custom",value:"custom"}]},a.$watch("interval",function(a){a&&p(a)},!0),a.$watch("main.app",function(e){if(e){var f,g;switch(d.appId||(a.application={app:e,interval:a.application.interval||"*,*,*,*",appdata:[]}),e){case"Dial":f=l,g=m;break;default:f=null,g=null}if(f)return f.get().$promise.then(function(b){a.items=b.rows}).then(function(){return g?g.get().$promise:void 0}).then(function(b){b&&(a.items2=b.rows)})["catch"](function(a){b.show(c.instant(a.message),"danger")})}},!0),a.deselectAndRedirect=function(b){a.selectedApp=void 0,f.path(b)},a.getIntervals=function(){return n.get().$promise.then(function(b){a.Intervals=b.rows,e.syncUpdates("interval",a.Intervals)})["catch"](function(a){b.show(c.instant(a.message),"danger")})},a.getRoute=function(){return k.get({id:d.id}).$promise.then(function(b){a.route=b,a.gridOptions.data=b.Applications})["catch"](function(a){f.path("/channels/voice/routes/outbound/list")})},a.getApplication=function(){void 0===a.selectedApp&&f.path("/channels/voice/routes/outbound/list");var b=_.find(a.applications,{value:a.route.Applications[a.selectedApp].app});if(a.main.app=b?b.value:"custom",!b){var c=a.route.Applications[a.selectedApp].appdata.join(",");a.route.Applications[a.selectedApp].appdata=[c]}q()},a.openApplication=function(b){a.selectedApp=b,f.path("/channels/voice/routes/outbound/view/"+d.id+"/routes/settings")},a.updateRoute=function(e){return a.selectedApp=void 0,a.route.exten=a.$application.checkUnderscore(a.route.exten),k.update({id:a.route.id},a.route).$promise.then(function(a){b.show(c.instant("MESSAGE_WELL_DONE")+"!","success"),e&&f.path("/channels/voice/routes/outbound/view/"+d.id+"/"+e)})["catch"](function(a){b.show(c.instant(a.data.translatedMessage),"danger")})},a.getContexts=function(){return m.get().$promise.then(function(b){a.voiceContexts=b.rows,e.syncUpdates("voice_context",a.voiceContexts)})["catch"](function(a){b.show(c.instant(a.message),"danger")})},a.getTags=function(){return o.get().$promise.then(function(b){b.rows.unshift({name:"--"}),a.tags=b.rows})["catch"](function(a){b.show(c.instant(a.data.translatedMessage),"danger")})},a.deleteApp=h.confirm["delete"](function(b){a.route.Applications.splice(b,1),a.updateRoute()}),a.addApplication=function(){a.route.Applications.push(a.application),a.updateRoute("routes")},a.goNext=function(){g.wizard().next()},a.previous=function(){g.wizard().previous()},a.formValidation=function(a){return a},a.$on("destroy",function(){e.unsyncUpdates("voice_extension")})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.routes.outbound.view",{url:"/view/:id",templateUrl:"app/channels/voice/route/outbound/view/view.html",controller:"VoiceRouteOutboundViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.channels.voice.routes.outbound.view.settings",{url:"/settings",templateUrl:"app/channels/voice/route/outbound/view/view.settings.html"}).state("main.channels.voice.routes.outbound.view.routes",{url:"/routes",templateUrl:"app/channels/voice/route/outbound/view/view.routes.html"}).state("main.channels.voice.routes.outbound.view.route",{url:"/route",templateUrl:"app/channels/voice/route/outbound/view/view.route.html"}).state("main.channels.voice.routes.outbound.view.routes.settings",{url:"/settings",templateUrl:"app/channels/voice/route/outbound/view/view.routeSettings.html"})}]),angular.module("xCallyShuttleApp").factory("Route",["$resource",function(a){return a("/api/voice/extensions/:id",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.routes",{url:"/routes",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice",{url:"/voice",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").controller("VoiceVoicemailListCtrl",["$scope","VoiceMail","gridOptions",function(a,b,c){a.initView=function(){var d={exporterCsvFilename:"voice_mails.csv",primaryKey:"uniqueid",columnDefs:[{name:"mailbox"},{name:"fullname"},{name:"email"},{name:"action",width:125,buttons:[{"class":"blue-hoki",href:"/channels/voice/voicemails/view/{{row.entity.uniqueid}}/settings",name:"profile"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.mailbox, row.entity.uniqueid)"}]}]};a.gridOptions=c.gridOptions(b,d,a)}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.voicemails.list",{url:"/list",templateUrl:"app/channels/voice/voicemail/list/list.html",controller:"VoiceVoicemailListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").controller("VoiceVoicemailViewCtrl",["$scope","VoiceMail","VoiceMailMessage","VoiceContext","$http","xAlert","$translate","$stateParams","socket","$sce","Modal","$location","gridOptions",function(a,b,c,d,e,f,g,h,i,j,k,l,m){function n(){var b={exporterCsvFilename:"voice_mail_messages.csv",primaryKey:"id",columnDefs:[{name:"callerid"},{name:"stamp",displayName:"APPLICATION_DATE",cellClass:"ui-grid-vcenter",cellTemplate:"<div>{{grid.appScope.moment(row.entity.stamp).format('YYYY-MM-DD HH:mm:ss')}}</div>"},{name:"duration",cellClass:"ui-grid-vcenter",cellTemplate:"<div>{{row.entity.duration*1000 | date:'mm:ss'}}</div>"},{name:"audio",displayName:"",width:225,enableSorting:!1,enableFiltering:!1,buttons:[{directive:'<audio-file-download params="{id:row.entity.id,controller:\'download\'}" resource="grid.appScope.VoiceMailMessage"></audio-file-download>'}]},{name:"action",width:150,buttons:[{directive:'<motion-file-download params="{id:row.entity.id,controller:\'download\'}" resource="grid.appScope.VoiceMailMessage" mimetype="audio/wav" btnclass="btn btn-xs blue-hoki" filename="row.entity.msg_id+\'.wav\'"></motion-file-download>'},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.id, row.entity.id)"}]}]};a.gridOptions=m.gridOptions(c,b,a,{mailbox:a.voicemail.mailbox,context:a.voicemail.context})}a.moment=moment,a.VoiceMailMessage=c,a.getVoicemail=function(){return b.get({id:h.uniqueid}).$promise.then(function(b){delete b.password,delete b.stamp,a.voicemail=b})["catch"](function(a){l.path("/voice/voicemails/list")})},a.updateVoiceVoicemail=function(){return b.update({id:h.uniqueid},a.voicemail).$promise.then(function(){f.show(g.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){f.show(g.instant(a.message),"danger")})},a.getContexts=function(){return d.get().$promise.then(function(b){a.voiceContexts=b.rows})["catch"](function(a){f.show(a.message,"danger")})},a.getMessages=function(){return a.voicemail?void n():b.get({id:h.uniqueid}).$promise.then(function(b){delete b.password,delete b.stamp,a.voicemail=b,n()})["catch"](function(a){l.path("/voice/voicemails/view/"+h.uniqueid+"/settings")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.voicemails.view",{url:"/view/:uniqueid",templateUrl:"app/channels/voice/voicemail/view/view.html",controller:"VoiceVoicemailViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.channels.voice.voicemails.view.settings",{url:"/settings",templateUrl:"app/channels/voice/voicemail/view/view.settings.html"}).state("main.channels.voice.voicemails.view.messages",{url:"/messages",templateUrl:"app/channels/voice/voicemail/view/view.messages.html"})}]),angular.module("xCallyShuttleApp").factory("VoiceMail",["$resource",function(a){return a("/api/voice/voicemails/:id/:controller",{uniqueid:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.voicemails",{url:"/voicemails",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").factory("VoiceMailMessage",["$resource",function(a){return a("/api/voice/voicemails/messages/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").controller("VoiceVoicemailWizardCtrl",["$scope","VoiceMail","xAlert","WizardHandler","$location","Setting",function(a,b,c,d,e,f){a.initWizard=function(){a.form={},a.item={context:"from-voicemail"}},a.next=function(){d.wizard().next()},a.previous=function(){d.wizard().previous()},a.exitValidation=function(a){return a},a.getFirstFreeMailbox=function(){f.get({controller:"mailbox"}).$promise.then(function(b){a.item.mailbox=b.value})["catch"](function(a){c.show(a.data.message,"danger")})},a.createItem=function(){return a.item.customer_id=a.item.mailbox,b.save(a.item).$promise.then(function(){e.path("/channels/voice/voicemails/list")})["catch"](function(a){c.show(data.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.voicemails.wizard",{url:"/wizard",templateUrl:"app/channels/voice/voicemail/wizard/wizard.html",controller:"VoiceVoicemailWizardCtrl"})}]),angular.module("xCallyShuttleApp").factory("VoiceQueue",["$resource",function(a){return a("/api/voice/queues/:id/:controller",{name:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").factory("Company",["$resource",function(a){return a("/api/contactmanager/companies/:id/:controller",{name:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.contactmanager.companies",{url:"/companies",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("CompanyListCreateModalCtrl",["$scope","$uibModalInstance",function(a,b){
-a.forms={dashboard:void 0},a.item={},a.ok=function(){a.item.model=JSON.stringify({title:a.item.name}),b.close(a.item)},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("ContactManagerCompanyListCtrl",["$scope","$http","$translate","xAlert","Modal","$uibModal","$log","Company","gridOptions","$location",function(a,b,c,d,e,f,g,h,i,j){a.initView=function(){var b={exporterCsvFilename:"Companies.csv",columnDefs:[{name:"name"},{name:"description"},{name:"action",width:125,buttons:[{"class":"blue-hoki",name:"profile",href:"/contactmanager/companies/view/{{row.entity.id}}/settings"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=i.gridOptions(h,b,a)},a.create=function(){var a=f.open({animation:!0,templateUrl:"app/contactmanager/company/list/create.modal.html",controller:"CompanyListCreateModalCtrl"});a.result.then(function(a){b.post("/api/contactmanager/companies",a).then(function(a){j.path("/contactmanager/companies/view/"+a.id+"/settings")})["catch"](function(a){d.show(a.data.message,"danger")})},function(){g.info("Modal dismissed at: "+new Date)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.contactmanager.companies.list",{url:"/list",templateUrl:"app/contactmanager/company/list/list.html",controller:"ContactManagerCompanyListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").controller("ContactManagerCompanyViewCtrl",["$scope","$http","xAlert","$translate","$stateParams","$location",function(a,b,c,d,e,f){a.getCompany=function(){b.get("/api/contactmanager/companies/"+e.id).success(function(b){a.company=b}).error(function(a){f.path("/contactmanager/companies/list")})},a.updateCompany=function(){var f=angular.copy(a.company);b.put("/api/contactmanager/companies/"+e.id,f).success(function(){c.show(d.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(b){c.show(d.instant(b.message),"danger"),a.company=f})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.contactmanager.companies.view",{url:"/view/:id",templateUrl:"app/contactmanager/company/view/view.html",controller:"ContactManagerCompanyViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.contactmanager.companies.view.settings",{url:"/settings",templateUrl:"app/contactmanager/company/view/view.settings.html"})}]),angular.module("xCallyShuttleApp").factory("Contact",["$resource",function(a){return a("/api/contactmanager/contacts/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.contactmanager.contacts",{url:"/contacts",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("ContactManagerListImportModalCtrl",["$scope","$uibModalInstance","indexes","csv","xAlert","socket","$http","$translate",function(a,b,c,d,e,f,g,h){function i(b){if(b>=a.csvLength||a.stopped)return void(a.importing=!1);var c={Phones:[],Emails:[],customFields:{}};_.forOwn(a.item,function(e,f){switch(f){case"Phones":a.item.Phones.forEach(function(a){""!==d[b][a]&&c.Phones.push({phone:d[b][a]})});break;case"Emails":a.item.Emails.forEach(function(a){""!==d[b][a]&&c.Emails.push({email:d[b][a]})});break;case"customFields":_.forOwn(a.item.customFields,function(a,e){c.customFields[e]=d[b][a]});break;case"tags":c.tags=[],a.item.tags.forEach(function(a){""!==d[b][a]&&c.tags.push(d[b][a])});break;default:c[f]=d[b][e]}}),c.tags=c.tags?c.tags.join(","):void 0,_.forOwn(c.customFields,function(a,b){""===a&&delete c.customFields[b]}),c.ServiceId=a.item.ServiceId,c.CompanyId=a.item.CompanyId||null,g.post("/api/contactmanager/contacts",c).success(function(c){a["import"].success+=j,a["import"].succeeded+=1,i(b+1)}).error(function(c){a["import"].fail+=j,a["import"].failed+=1,i(b+1)})}a.indexes=c,a.importing=!1,a.submitted=!1,a.stopped=!1,a["import"]={success:0,fail:0,succeeded:0,failed:0},a.csvLength=d.length;var j=100/a.csvLength;a.forms={dashboard:void 0},a.item={},a.start=function(){a.importing=!0,a.submitted=!0,i(0)},a.getServices=function(){g.get("/api/contactmanager/services/").success(function(b){a.services=b.rows,a.item.ServiceId=1,a.getCustomFields()}).error(function(a){e.show(h.instant(a.message)+"!","danger")})},a.getCustomFields=function(){g.get("/api/contactmanager/services/"+a.item.ServiceId+"/customfields").success(function(b){a.customFields=b,a.customFields.forEach(function(a){a.values=JSON.parse(a.values)}),f.socket.on("custom_field:remove",function(b){_.remove(a.customFields,function(a){return b.id==a.id})}),f.socket.on("custom_field:save",function(b){if(b.ServiceId===a.item.ServiceId){var c=_.find(a.customFields,{id:b.id});c||("string"==typeof b.values&&(b.values=JSON.parse(b.values)),a.customFields.push(b))}})}).error(function(a){console.error(a),e.show(a.message,"danger")})},a.close=function(){b.close()},a.stop=function(){a.stopped=!0}}]),angular.module("xCallyShuttleApp").controller("ContactManagerContactListCtrl",["$scope","$translate","Modal","FileUploader","Papa","$uibModal","$log","Contact","gridOptions","Service","uiGridConstants","xAlert",function(a,b,c,d,e,f,g,h,i,j,k,l){a.initView=function(){return j.get().$promise.then(function(b){a.services=[],b.rows.forEach(function(b,c){a.services.push({value:b.id,label:b.name})})}).then(function(){var b={exporterCsvFilename:"Contacts.csv",columnDefs:[{name:"firstName"},{name:"lastName"},{name:"phone"},{name:"mobile"},{name:"email"},{name:"ServiceId",displayName:"APPLICATION_SERVICE",field:"Service.name",filter:{type:k.filter.SELECT,selectOptions:a.services}},{name:"description"},{name:"action",width:125,buttons:[{"class":"blue-hoki",name:"profile",onClick:"grid.appScope.openContactTab(row.entity)"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.fullname, row.entity.id)"}]}]};a.gridOptions=i.gridOptions(h,b,a)})["catch"](function(a){l.show(b.instant(a.message)+"!","danger")})},d.FileSelect.prototype.isEmptyAfterSelection=function(){return!0};var m=a.uploader=new d({queueLimit:1,clearInputAfterAddedToQueue:!0});m.onAfterAddingFile=function(b){console.log("fileadded"),e.parse(b._file,{header:!0,complete:function(b){a.uploader.clearQueue(),a["import"](b.data)},error:function(a){console.log(a)}})},a["import"]=function(b){var c=f.open({animation:!0,size:"lg",backdrop:"static",keyboard:!1,templateUrl:"app/contactmanager/contact/list/import.modal.html",controller:"ContactManagerListImportModalCtrl",resolve:{indexes:function(){return _.keys(b[0])},csv:function(){return b}}});c.result.then(function(b){a.gridOptions.getPage()},function(){g.info("Modal dismissed at: "+new Date)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.contactmanager.contacts.list",{url:"/list",templateUrl:"app/contactmanager/contact/list/list.html",controller:"ContactManagerContactListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.contactmanager",{url:"/contactmanager",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").controller("ContactManagerServiceListCreateModalCtrl",["$scope","$uibModalInstance",function(a,b){a.forms={dashboard:void 0},a.item={},a.ok=function(){b.close(a.item)},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("ContactManagerServiceListCtrl",["$scope","$http","$translate","Modal","xAlert","$uibModal","$log","Service","gridOptions",function(a,b,c,d,e,f,g,h,i){a.initView=function(){var b={exporterCsvFilename:"Services.csv",columnDefs:[{name:"name"},{name:"description"},{name:"action",width:125,buttons:[{"class":"blue-hoki",name:"settings",href:"/contactmanager/services/view/{{row.entity.id}}/settings"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=i.gridOptions(h,b,a)},a.create=function(){var d=f.open({animation:!0,templateUrl:"app/contactmanager/service/list/create.modal.html",controller:"ContactManagerServiceListCreateModalCtrl"});d.result.then(function(d){b.post("/api/contactmanager/services/",d).then(function(b){a.gridOptions.getPage(),e.show(c.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){e.show(a.data.message,"danger")})},function(){g.info("Modal dismissed at: "+new Date)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.contactmanager.services.list",{url:"/list",templateUrl:"app/contactmanager/service/list/list.html",controller:"ContactManagerServiceListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").factory("Service",["$resource",function(a){return a("/api/contactmanager/services/:serviceId/:controller/:id",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.contactmanager.services",{url:"/services",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("ContactManagerServiceCustomFieldViewCreateModalCtrl",["$scope","$uibModalInstance","$translate",function(a,b,c){a.$translate=c,a.forms={dashboard:void 0},a.item={},a.choices=[{value:""}],a.addField=function(){a.choices.push({})},a.removeField=function(b){a.choices.splice(b,1)},a.types=[{name:"APPLICATION_TEXT",value:"text"},{name:"APPLICATION_SELECT",value:"select"}],a.ok=function(){"select"===a.item.type&&(a.item.values=angular.toJson(a.choices)),b.close(a.item)},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("ContactManagerServiceViewCtrl",["$scope","xAlert","$translate","$stateParams","socket","$location","$uibModal","$log","Modal","Service","Team","gridOptions",function(a,b,c,d,e,f,g,h,i,j,k,l){var m=function(){return{select:function(b){return j.save({serviceId:a.service.id,controller:"agents"},{agents:b}).$promise.then(function(){a.getTeams()})["catch"](function(a){console.log(a)})},deselect:function(b){return j["delete"]({serviceId:a.service.id,controller:"agents",agents:b}).$promise.then(function(){a.getTeams()})["catch"](function(a){console.log(a)})}}};a.getService=function(){return j.get({serviceId:d.id}).$promise.then(function(b){a.service=b})["catch"](function(a){f.path("/contactmanager/services/list")})},a.updateService=function(){return j.update({serviceId:d.id},a.service).$promise.then(function(){b.show(c.instant("MESSAGE_WELL_DONE")+"!","success")})["catch"](function(a){b.show(c.instant(a.message),"danger")})},a.getTeams=function(){return k.get().$promise.then(function(b){return a.teams=b.rows,j.query({serviceId:d.id,controller:"agents"}).$promise}).then(function(b){ComponentsDropdowns.bindQueue(a.teams,_.map(b,function(a){return{id:a.id}}),m)})["catch"](function(a){console.error(a)})},a.initCustomFields=function(){var b={exporterCsvFilename:"customfields.csv",primaryKey:"id",columnDefs:[{name:"name"},{name:"type"},{name:"description"},{name:"action",width:200,buttons:[{"class":"blue-hoki",href:"/contactmanager/services/view/{{grid.appScope.$stateParams.id}}/customfields/settings/{{row.entity.id}}",name:"settings"},{"class":"red-sunglo",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)",name:"delete"}]}]};a.gridOptions=l.gridOptions(j,b,a,{serviceId:d.id,controller:"customfields"})},a.create=function(){var e=g.open({animation:!0,templateUrl:"app/contactmanager/service/view/create.modal.html",controller:"ContactManagerServiceCustomFieldViewCreateModalCtrl"});e.result.then(function(e){return j.save({serviceId:d.id,controller:"customfields"},e).$promise.then(function(d){a.gridOptions.getPage(),b.show(c.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){b.show(a.message||a.data.message,"danger")})},function(){h.info("Modal dismissed at: "+new Date)})},a.getCustomField=function(){return j.get({serviceId:d.id,controller:"customfields",id:d.cfId}).$promise.then(function(b){console.log(b),a.customField=b,"select"===a.customField.type&&(a.choices=JSON.parse(a.customField.values))})["catch"](function(a){console.error(a),f.path("/contactmanager/customfields/list")})},a.updateCustomField=function(){var e=angular.copy(a.customField);return"select"===e.type&&(e.values=angular.toJson(a.choices)),j.update({serviceId:d.id,controller:"customfields",id:d.cfId},e).$promise.then(function(){b.show(c.instant("MESSAGE_WELL_DONE")+"!","success")})["catch"](function(a){b.show(c.instant(a.message),"danger")})},a.addField=function(){a.choices.push({})},a.removeField=function(b){a.choices.splice(b,1)}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.contactmanager.services.view",{url:"/view/:id",templateUrl:"app/contactmanager/service/view/view.html",controller:"ContactManagerServiceViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.contactmanager.services.view.settings",{url:"/settings",templateUrl:"app/contactmanager/service/view/view.settings.html"}).state("main.contactmanager.services.view.agents",{url:"/agents",templateUrl:"app/contactmanager/service/view/view.agents.html",cache:!1,serie:!0,resolve:{deps:["$ocLazyLoad",function(a){return a.load({insertBefore:"#ng_load_plugins_before",files:["assets/plugins/jquery-multi-select/css/multi-select.css","assets/plugins/jquery-multi-select/js/jquery.multi-select.js","assets/plugins/jquery-quicksearch/jquery.quicksearch.js","assets/scripts/components-dropdowns.js"]})}]}}).state("main.contactmanager.services.view.customfields",{url:"/customfields",templateUrl:"app/contactmanager/service/view/view.customFields.html"}).state("main.contactmanager.services.view.customfields.settings",{url:"/settings/:cfId",templateUrl:"app/contactmanager/service/view/view.customFieldSettings.html",controller:"ContactManagerServiceViewCtrl"})}]),angular.module("xCallyShuttleApp").controller("DashboardCtrl",["$scope","$translate",function(a,b){a.voice=[{name:b.instant("APPLICATION_QUEUE"),link:"main.dashboard.voice"}],a.mail=[{name:b.instant("APPLICATION_QUEUE"),link:"main.dashboard.mail"}]}]),angular.module("xCallyShuttleApp").factory("Dashboard",["$resource",function(a){return a("/api/dashboards/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.dashboard",{"abstract":!0,url:"/dashboard",templateUrl:"app/dashboard/dashboard.html",controller:"DashboardCtrl"}).state("main.dashboard.voice",{url:"/voice",controller:"DashboardVoiceCtrl",templateUrl:"app/dashboard/voice/voice.html"}).state("main.dashboard.mail",{url:"/mail",controller:"DashboardMailCtrl",templateUrl:"app/dashboard/mail/mail.html"})}]),angular.module("xCallyShuttleApp").controller("DashboardMailCtrl",["$scope",function(a){a.message="Hello"}]),angular.module("xCallyShuttleApp").controller("DashboardVoiceCtrl",["$scope","Auth","ReportQueue","ReportCall","socket",function(a,b,c,d,e){a.Auth=b,a.initWaiting=function(){return c.get({id:"waiting"}).$promise.then(function(b){a.waiting=b.value,e.socket.on("dashboard:waiting",function(b){a.waiting=b.value})})["catch"](function(a){console.error(a)})},a.initActive=function(){return c.get({id:"active"}).$promise.then(function(b){a.active=b.value,e.socket.on("dashboard:active",function(b){a.active=b.value})})["catch"](function(a){console.error(a)})},a.initAnswered=function(){return c.get({id:"answered"}).$promise.then(function(b){a.answered=b.value,e.socket.on("dashboard:answered",function(b){a.answered=b.value})})["catch"](function(a){console.error(a)})},a.initAbandoned=function(){return c.get({id:"abandoned"}).$promise.then(function(b){a.abandoned=b.value,e.socket.on("dashboard:abandoned",function(b){a.abandoned=b.value})})["catch"](function(a){console.error(a)})},a.initAvgAnswerTime=function(){return c.get({id:"avganswertime"}).$promise.then(function(b){a.avganswertime=b.value,e.socket.on("dashboard:avganswertime",function(b){a.avganswertime=b.value})})["catch"](function(a){console.error(a)})},a.initAvgTalkTime=function(){return c.get({id:"avgtalktime"}).$promise.then(function(b){a.avgtalktime=b.value,e.socket.on("dashboard:avgtalktime",function(b){a.avgtalktime=b.value})})["catch"](function(a){console.error(a)})},a.initAnswerRate=function(){return c.get({id:"answerrate"}).$promise.then(function(b){a.answerrate=b.value,e.socket.on("dashboard:answerrate",function(b){a.answerrate=b.value})})["catch"](function(a){console.error(a)})},a.initTotalOffered=function(){return c.get({id:"totaloffered"}).$promise.then(function(b){a.totaloffered=b.value,e.socket.on("dashboard:totaloffered",function(b){a.totaloffered=b.value})})["catch"](function(a){console.error(a)})},a.initUnmanaged=function(){return c.get({id:"unmanaged"}).$promise.then(function(b){a.unmanaged=b.value,e.socket.on("dashboard:unmanaged",function(b){a.unmanaged=b.value})})["catch"](function(a){console.error(a)})},a.initAbandonRate=function(){return c.get({id:"abandonrate"}).$promise.then(function(b){a.abandonrate=b.value,e.socket.on("dashboard:abandonrate",function(b){a.abandonrate=b.value})})["catch"](function(a){console.error(a)})},a.initManualOutbound=function(){return d.get({id:"manualoutbound"}).$promise.then(function(b){a.manualoutbound=b.value,e.socket.on("dashboard:manualoutbound",function(b){a.manualoutbound=b.value})})["catch"](function(a){console.error(a)})},a.initManualOutboundGlobalDuration=function(){return d.get({id:"manualoutboundglobalduration"}).$promise.then(function(b){a.manualoutboundglobalduration=b.value,e.socket.on("dashboard:manualoutboundglobalduration",function(b){a.manualoutboundglobalduration=b.value})})["catch"](function(a){console.error(a)})},a.initManualOutboundAvgDuration=function(){return d.get({id:"manualoutboundavgduration"}).$promise.then(function(b){a.manualoutboundavgduration=b.value,e.socket.on("dashboard:manualoutboundavgduration",function(b){a.manualoutboundavgduration=b.value})})["catch"](function(a){console.error(a)})},a.initManualOutboundAnswered=function(){return d.get({id:"manualoutboundanswered"}).$promise.then(function(b){a.manualoutboundanswered=b.value,e.socket.on("dashboard:manualoutboundanswered",function(b){a.manualoutboundanswered=b.value})})["catch"](function(a){console.error(a)})},a.initManualOutboundAnswerRate=function(){return d.get({id:"manualoutboundanswerrate"}).$promise.then(function(b){a.manualoutboundanswerrate=b.value,e.socket.on("dashboard:manualoutboundanswerrate",function(b){a.manualoutboundanswerrate=b.value})})["catch"](function(a){console.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.desk",{url:"/desk",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").factory("DeskAccount",["$resource",function(a){return a("/api/desk/accounts/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").controller("DeskListCtrl",["$scope","$http","$rootScope","xAlert","$translate","socket","Modal","stResource",function(a,b,c,d,e,f,g,h){a.conf={accountsByPage:{name:"10",value:10}},a.accountsByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.accounts={checked:[]},a.check=function(b,c){c?a.accounts.checked=angular.copy(_.map(a.displayedDeskAccounts,"id")):a.accounts.checked=[]},a.getAccounts=function(b){return _.map(a.displayedDeskAccounts,function(a){var c={};return b.forEach(function(b){c[b]=a[b]}),c})},a.initList=function(b){f.unsyncUpdates("desk_account"),b.url="/api/desk/accounts",h.getPage(b).then(function(d){a.displayedDeskAccounts=d.rows,b.pagination.numberOfPages=d.total_pages,c.updateTableConfig(a.accountsByPage,a.displayedDeskAccounts.length),c.updateTableConfig(a.conf.accountsByPage,a.displayedDeskAccounts.length)}),f.socket.on("desk_account:save",function(){a.initList(b)}),f.socket.on("desk_account:remove",function(c){a.accounts.checked=_.without(a.accounts.checked,c.id),a.initList(b)})},a.deleteItem=g.confirm["delete"](function(a){b["delete"]("/api/desk/accounts/"+a).success(function(){d.show(e.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(a){d.show(e.instant(a.message),"danger")})}),a.deleteItems=g.confirm["delete"](function(){b["delete"]("/api/desk/accounts",{params:{id:a.accounts.checked}}).success(function(){d.show(e.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){d.show(e.instant(a.message),"danger")})}),a.checkAccount=function(a){b.get("/api/desk/accounts/"+a+"/check").then(function(){d.show(e.instant("MESSAGE_ACCOUNT_VERIFIED"),"success")})["catch"](function(){d.show(e.instant("MESSAGE_ACCOUNT_INVALID"),"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.desk.list",{url:"/list",templateUrl:"app/desk/list/list.html",controller:"DeskListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").controller("DeskViewCtrl",["$scope","$http","$stateParams","$translate","$location","WizardHandler","socket","xAlert","Modal","desk_com",function(a,b,c,d,e,f,g,h,i,j){a.$stateParams=c,a.config={autoHideScrollbar:!1,theme:"dark",advanced:{updateOnContentResize:!0},setHeight:500,scrollInertia:0},a.initConfiguration=function(){a.formsConfiguration={},a.configuration={}},a.goNext=function(){f.wizard().next()},a.formValidation=function(a){return a},a.$on("$destroy",function(){g.unsyncUpdates("desk_configuration"),g.unsyncUpdates("desk_field")}),a.initView=function(){b.get("/api/desk/accounts/"+c.id).success(function(b){a.account=b}).error(function(a){h.show(a.message,"danger")})},a.updateItem=function(){b.put("/api/desk/accounts/"+c.id,a.account).success(function(){h.show(d.instant("MESSAGE_WELL_DONE")+".","success")}).error(function(){h.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG")+".","danger")})},a.getConfigurations=function(){b.get("/api/desk/configurations",{params:{AccountId:c.id}}).success(function(b){a.configurations=b,g.socket.on("desk_configuration:remove",function(b){_.remove(a.configurations,{id:b.id})})}).error(function(a){h.show(a.message,"danger")})},a.deleteConfiguration=i.confirm["delete"](function(a){b["delete"]("api/desk/configurations/"+a).success(function(){h.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(){h.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})}),a.createConfiguration=function(){a.configuration.AccountId=c.id,b.post("api/desk/configurations",a.configuration).success(function(a){e.path("desk/view/"+c.id+"/configurations/settings/"+a.id)}).error(function(){h.show("Something went wrong!","danger")})},a.fieldType=["string","variable"],a.descFieldType=["string","key_value"],a.getFields=function(){b.get("/api/desk/accounts/"+c.id+"/fields").success(function(b){a.accountFields=j.fields.concat(b)}).error(function(a){h.show(a.message,"danger")})},a.getConfiguration=function(){b.get("/api/desk/configurations/"+c.configurationId).success(function(b){a.configurationName=b.name,a.subjectConfig=b.Subject,a.descriptionConfig=b.Description,a.fieldConfig=b.Field,g.socket.on("desk_field:remove",function(b){_.remove(a.subjectConfig,{id:b.id}),_.remove(a.descriptionConfig,{id:b.id}),_.remove(a.fieldConfig,{id:b.id})})}).error(function(a){h.show(a.message,"danger")})},a.getVariables=function(){b.get("/api/variables").success(function(b){a.variables=b.rows}).error(function(a){h.show(a.message,"danger")})},a.removeItem=function(a){b["delete"]("api/desk/fields/"+a.id).success(function(){h.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(){h.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})},a.addItemSubject=function(){var d={type:"string",content:""};b.post("/api/desk/configurations/"+c.configurationId+"/subject",d).success(function(b){a.subjectConfig.push(b)}).error(function(){h.show("Something went wrong!","danger")})},a.addItemDescription=function(){var d={type:"string",content:""};b.post("/api/desk/configurations/"+c.configurationId+"/description",d).success(function(b){a.descriptionConfig.push(b)}).error(function(){h.show("Something went wrong!","danger")})},a.addItemField=function(){var d={content:""};b.post("/api/desk/configurations/"+c.configurationId+"/field",d).success(function(b){a.fieldConfig.push(b)}).error(function(){h.show("Something went wrong!","danger")})},a.updateField=function(a){b.put("/api/desk/fields/"+a.id,a).success(function(){}).error(function(){h.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG")+".","danger")})},a.changeType=function(b){"variable"===b.type?b.content="":"string"===b.type&&(b.VariableId=null),a.updateField(b)},a.changeDescType=function(b){"key_value"===b.type?(b.content="","string"===b.keyType?b.VariableId=null:"variable"===b.keyType&&(b.keyContent="")):"string"===b.type&&(b.VariableId=null,b.key="",b.keyContent=""),a.updateField(b)},a.changeFieldType=function(b){if(b.content="",b.idField){var c=_.find(a.accountFields,"id",b.idField);c&&(b.customField=_.result(c,"custom",!0))}a.updateField(b)},a.getSystemFieldOptions=function(b){if(b){var c=_.find(a.accountFields,"id",b);return c?c.data.choices?c.data.choices:null:void 0}}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.desk.view",{url:"/view/:id",templateUrl:"app/desk/view/view.html",controller:"DeskViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.desk.view.account",{url:"/account",templateUrl:"app/desk/view/view.account.html"}).state("main.desk.view.configurations",{url:"/configurations",templateUrl:"app/desk/view/view.configurations.html"}).state("main.desk.view.configurations.settings",{url:"/settings/:configurationId",templateUrl:"app/desk/view/view.configurationSettings.html",controller:"DeskViewCtrl"}).state("main.desk.view.configuration",{url:"/configuration",templateUrl:"app/desk/view/view.configuration.html"})}]),angular.module("xCallyShuttleApp").controller("DeskWizardCtrl",["$scope","$http","$location","$translate","xAlert","WizardHandler",function(a,b,c,d,e,f){a.translate=d,a.initWizard=function(){a.$translate=d,a.forms={},a.item={}},a.next=function(){f.wizard().next()},a.exitValidation=function(a){return a},a.createItem=function(){console.log(a.item),b.post("api/desk/accounts",a.item).success(function(){e.show(d.instant("MESSAGE_WELL_DONE")+".","success"),c.path("/desk/list")}).error(function(){e.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG")+".","danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.desk.wizard",{url:"/wizard",templateUrl:"app/desk/wizard/wizard.html",controller:"DeskWizardCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.freshdesk",{url:"/freshdesk",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").factory("FreshdeskAccount",["$resource",function(a){return a("/api/freshdesk/accounts/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").controller("FreshdeskListCtrl",["$scope","$http","$rootScope","xAlert","$translate","socket","Modal","stResource",function(a,b,c,d,e,f,g,h){a.conf={accountsByPage:{name:"10",value:10}},a.accountsByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.accounts={checked:[]},a.check=function(b,c){c?a.accounts.checked=angular.copy(_.map(a.displayedFreshdeskAccounts,"id")):a.accounts.checked=[]},a.getAccounts=function(b){return _.map(a.displayedFreshdeskAccounts,function(a){var c={};return b.forEach(function(b){c[b]=a[b]}),c})},a.initList=function(b){f.unsyncUpdates("freshdesk_account"),b.url="/api/freshdesk/accounts",h.getPage(b).then(function(d){a.displayedFreshdeskAccounts=d.rows,b.pagination.numberOfPages=d.total_pages,c.updateTableConfig(a.accountsByPage,a.displayedFreshdeskAccounts.length),c.updateTableConfig(a.conf.accountsByPage,a.displayedFreshdeskAccounts.length)}),f.socket.on("freshdesk_account:save",function(){a.initList(b)}),f.socket.on("freshdesk_account:remove",function(c){a.accounts.checked=_.without(a.accounts.checked,c.id),a.initList(b)})},a.deleteItem=g.confirm["delete"](function(a){b["delete"]("/api/freshdesk/accounts/"+a).success(function(){d.show(e.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(a){d.show(e.instant(a.message),"danger")})}),a.deleteItems=g.confirm["delete"](function(){b["delete"]("/api/freshdesk/accounts",{params:{id:a.accounts.checked}}).success(function(){d.show(e.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){d.show(e.instant(a.message),"danger")})}),a.checkAccount=function(a){b.get("/api/freshdesk/accounts/"+a+"/check").then(function(){d.show(e.instant("MESSAGE_ACCOUNT_VERIFIED"),"success")})["catch"](function(){d.show(e.instant("MESSAGE_ACCOUNT_INVALID"),"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.freshdesk.list",{url:"/list",templateUrl:"app/freshdesk/list/list.html",controller:"FreshdeskListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").controller("FreshdeskViewCtrl",["$scope","$http","$stateParams","$translate","$location","$filter","WizardHandler","socket","xAlert","Modal",function(a,b,c,d,e,f,g,h,i,j){a.$stateParams=c,a.config={autoHideScrollbar:!1,theme:"dark",advanced:{updateOnContentResize:!0},setHeight:500,scrollInertia:0},a.initConfiguration=function(){a.formsConfiguration={},a.configuration={}},a.goNext=function(){g.wizard().next()},a.formValidation=function(a){return a},a.$on("$destroy",function(){h.unsyncUpdates("freshdesk_configuration"),h.unsyncUpdates("freshdesk_field")}),a.initView=function(){b.get("/api/freshdesk/accounts/"+c.id).success(function(b){a.account=b}).error(function(a){i.show(a.message,"danger")})},a.updateItem=function(){b.put("/api/freshdesk/accounts/"+c.id,a.account).success(function(){i.show(d.instant("MESSAGE_WELL_DONE")+".","success")}).error(function(){i.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG")+".","danger")})},a.getConfigurations=function(){b.get("/api/freshdesk/configurations",{params:{AccountId:c.id}}).success(function(b){a.configurations=b,h.socket.on("freshdesk_configuration:remove",function(b){_.remove(a.configurations,{id:b.id})})}).error(function(a){i.show(a.message,"danger")})},a.deleteConfiguration=j.confirm["delete"](function(a){b["delete"]("api/freshdesk/configurations/"+a).success(function(){i.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(){i.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})}),a.createConfiguration=function(){a.configuration.AccountId=c.id,b.post("api/freshdesk/configurations",a.configuration).success(function(a){e.path("freshdesk/view/"+c.id+"/configurations/settings/"+a.id);
-}).error(function(){i.show("Something went wrong!","danger")})},a.fieldType=["string","variable"],a.descFieldType=["string","key_value"],a.getFields=function(){b.get("/api/freshdesk/accounts/"+c.id+"/fields").success(function(b){a.accountFields=[],b=f("freshdesk")(b),_.forEach(b,function(b){a.accountFields.push(b.ticket_field)})}).error(function(a){i.show(a.message,"danger")})},a.getConfiguration=function(){b.get("/api/freshdesk/configurations/"+c.configurationId).success(function(b){a.configurationName=b.name,a.subjectConfig=b.Subject,a.descriptionConfig=b.Description,a.fieldConfig=b.Field,h.socket.on("freshdesk_field:remove",function(b){_.remove(a.subjectConfig,{id:b.id}),_.remove(a.descriptionConfig,{id:b.id}),_.remove(a.fieldConfig,{id:b.id})})}).error(function(a){i.show(a.message,"danger")})},a.getVariables=function(){b.get("/api/variables").success(function(b){a.variables=b.rows}).error(function(a){i.show(a.message,"danger")})},a.removeItem=function(a){b["delete"]("api/freshdesk/fields/"+a.id).success(function(){i.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(){i.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})},a.addItemSubject=function(){var d={type:"string",content:""};b.post("/api/freshdesk/configurations/"+c.configurationId+"/subject",d).success(function(b){a.subjectConfig.push(b)}).error(function(){i.show("Something went wrong!","danger")})},a.addItemDescription=function(){var d={type:"string",content:""};b.post("/api/freshdesk/configurations/"+c.configurationId+"/description",d).success(function(b){a.descriptionConfig.push(b)}).error(function(){i.show("Something went wrong!","danger")})},a.addItemField=function(){var d={content:""};b.post("/api/freshdesk/configurations/"+c.configurationId+"/field",d).success(function(b){a.fieldConfig.push(b)}).error(function(){i.show("Something went wrong!","danger")})},a.updateField=function(a){b.put("/api/freshdesk/fields/"+a.id,a).success(function(){}).error(function(){i.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG")+".","danger")})},a.changeType=function(b){"variable"===b.type?b.content="":"string"===b.type&&(b.VariableId=null),a.updateField(b)},a.changeDescType=function(b){"key_value"===b.type?(b.content="","string"===b.keyType?b.VariableId=null:"variable"===b.keyType&&(b.keyContent="")):"string"===b.type&&(b.VariableId=null,b.key="",b.keyContent=""),a.updateField(b)},a.changeFieldType=function(b){if(b.content="",b.idField){var c=_.find(a.accountFields,"name",b.idField);c&&(b.customField=!_.result(c,"default",!0))}a.updateField(b)},a.getSystemFieldOptions=function(b){if(b){var c=_.find(a.accountFields,"name",b);return c?c.choices.length>0?c.choices:null:void 0}}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.freshdesk.view",{url:"/view/:id",templateUrl:"app/freshdesk/view/view.html",controller:"FreshdeskViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.freshdesk.view.account",{url:"/account",templateUrl:"app/freshdesk/view/view.account.html"}).state("main.freshdesk.view.configurations",{url:"/configurations",templateUrl:"app/freshdesk/view/view.configurations.html"}).state("main.freshdesk.view.configurations.settings",{url:"/settings/:configurationId",templateUrl:"app/freshdesk/view/view.configurationSettings.html",controller:"FreshdeskViewCtrl"}).state("main.freshdesk.view.configuration",{url:"/configuration",templateUrl:"app/freshdesk/view/view.configuration.html"})}]),angular.module("xCallyShuttleApp").controller("FreshdeskWizardCtrl",["$scope","$http","$location","$translate","xAlert","WizardHandler",function(a,b,c,d,e,f){a.translate=d,a.initWizard=function(){a.$translate=d,a.forms={},a.item={}},a.next=function(){f.wizard().next()},a.exitValidation=function(a){return a},a.createItem=function(){console.log(a.item),b.post("api/freshdesk/accounts",a.item).success(function(){e.show(d.instant("MESSAGE_WELL_DONE")+".","success"),c.path("/freshdesk/list")}).error(function(){e.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG")+".","danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.freshdesk.wizard",{url:"/wizard",templateUrl:"app/freshdesk/wizard/wizard.html",controller:"FreshdeskWizardCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.integrations",{url:"/integrations",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").factory("Integration",["$resource",function(a){return a("/api/integrations/:id/:controller",{id:"@id"})}]),angular.module("xCallyShuttleApp").controller("IntegrationListCtrl",["$scope","Modal","socket","FileUploader","Integration","xAlert",function(a,b,c,d,e,f){a.integrationsByPage=10;var g=a.uploader=new d({url:"api/integrations",autoUpload:!0,removeAfterUpload:!0});g.filters.push({name:"zipFilter",fn:function(a){var b="|"+a.type.slice(a.type.lastIndexOf("/")+1)+"|";return-1!=="|zip|".indexOf(b)}}),g.onSuccessItem=function(a,b,c,d){console.info("onSuccessItem",a,b,c,d),f.show(b.name,"success")},g.onErrorItem=function(a,b,c,d){console.info("onErrorItem",a,b,c,d),b.errors.forEach(function(a){f.show(a.message,"danger")})},a.deleteItem=b.confirm["delete"](function(a){e["delete"]({id:a},function(){f.show("Integration Removed","success")},function(a){f.show(a.data.errors,"danger")})}),a.initList=function(){a.integrations=e.query({},function(a){c.syncUpdates("integration",a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.integrations.list",{url:"/list",templateUrl:"app/integration/list/list.html",controller:"IntegrationListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load({insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/plugins/bootstrap-fileinput/bootstrap-fileinput.js"]})}]}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.jscripty",{url:"/jscripty",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").factory("JscriptyProject",["$resource",function(a){return a("/api/jscripty/projects/:id/:controller/:action/:action2",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").controller("JscriptyProjectListCtrl",["$scope","$uibModal","JscriptyProject","gridOptions",function(a,b,c,d){a.initView=function(){var b={exporterCsvFilename:"jscriptyProjects.csv",columnDefs:[{name:"name"},{name:"description"},{name:"action",width:300,buttons:[{"class":"blue-hoki",href:"/jscripty/projects/view/{{row.entity.id}}",name:"settings"},{"class":"green",name:"start",onClick:"grid.appScope.openJscriptyTab(row.entity)"},{"class":"purple",href:"/jscripty/projects/report/{{row.entity.id}}/sessions",name:"report"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=d.gridOptions(c,b,a)},a.createItem=function(){var c=b.open({animation:!0,templateUrl:"app/jscripty/project/list/list.create.modal.html",controller:"JscriptyProjectListCreateCtrl"});c.result.then(function(b){console.log(b),a.gridOptions.getPage()})}}]),angular.module("xCallyShuttleApp").controller("JscriptyProjectListCreateCtrl",["$scope","$translate","$uibModalInstance","JscriptyProject","xAlert",function(a,b,c,d,e){a.form={},a.item={},a.save=function(){return d.save(a.item).$promise.then(function(a){e.show(b.instant("MESSAGE_WELL_DONE"),"success"),c.close(a)})["catch"](function(a){console.log(a),e.show(b.instant(a.data.translatedMessage),"danger")})},a.cancel=function(){c.dismiss()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.jscripty.projects.list",{url:"/list",templateUrl:"app/jscripty/project/list/list.html",controller:"JscriptyProjectListCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.jscripty.projects",{url:"/projects",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("JscriptyProjectReportCtrl",["$scope","$http","$state","$stateParams","socket","Auth","Modal","xAlert","$translate","$rootScope","gridOptions","JscriptyProject","$location",function(a,b,c,d,e,f,g,h,i,j,k,l,m){a.projectStats={started:0,incomplete:0,completed:0},a.projectId=d.id,a.initView=function(){return l.get({id:d.id,controller:"sessions"}).$promise.then(function(b){a.projectId=d.id,console.log(a.projectId);var c=_.groupBy(b.rows,"status");a.projectStats.started=c.started?c.started.length:0,a.projectStats.completed=c.completed?c.completed.length:0,a.projectStats.incomplete=c.incomplete?c.incomplete.length:0})["catch"](function(a){h.show(a.message,"danger")})},a.getProjectSessions=function(){var b={exporterCsvFilename:"jscriptyProjects.csv",columnDefs:[{name:"projectId",displayName:"APPLICATION_PROJECTID"},{name:"session_id",displayName:"APPLICATION_SESSIONID"},{name:"createdAt",displayName:"APPLICATION_STARTEDAT"},{name:"completedAt",displayName:"APPLICATION_COMPLETEDAT"},{name:"status",displayName:"APPLICATION_STATUS"},{name:"last_question_id",displayName:"APPLICATION_LASTQUESTIONID"},{name:"action",width:100,buttons:[{"class":"blue-hoki",href:"/jscripty/projects/report/{{row.entity.projectId}}/session/{{row.entity.session_id}}",name:"Detail"}]}]};a.gridOptions=k.gridOptions(l,b,a,{id:d.id,controller:"sessions"})},a.getSessionDetails=function(){console.log(d.sessionId),b.get("/api/jscripty/projects/"+d.id+"/sessions/"+d.sessionId).success(function(b){a.sessionQuestions=b[0],console.log("session",a.sessionQuestions)})["catch"](function(a){h.show(a.message,"danger")})},a.getQuestionSummary=function(){var b={exporterCsvFilename:"jscriptyProjects.csv",columnDefs:[{name:"question_id",width:150,displayName:"APPLICATION_QUESTIONID"},{name:"question_type",width:150,displayName:"APPLICATION_QUESTIONTYPE"},{name:"question_label",width:200,displayName:"APPLICATION_QUESTIONLABEL"},{name:"question_text",displayName:"APPLICATION_QUESTION"},{name:"count",width:100,displayName:"APPLICATION_COUNT"}]};a.gridOptions=k.gridOptions(l,b,a,{id:d.id,controller:"questions",action:"summary"})},a.getQuestionDetail=function(){b.get("/api/jscripty/projects/"+d.id+"/questions/detail").success(function(b){var c=_.groupBy(b,"question_id");_.forEach(c,function(a,b){c[b]=_.groupBy(a,"question_label"),_.forEach(c[b],function(a,d){c[b][d]=_.groupBy(a,"question_text")})}),a.questionDetail=c,console.log("detail",a.questionDetail)})["catch"](function(a){h.show(a.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.jscripty.projects.report",{url:"/report/:id",templateUrl:"app/jscripty/project/report/report.html",controller:"JscriptyProjectReportCtrl"}).state("main.jscripty.projects.report.sessions",{url:"/sessions",templateUrl:"app/jscripty/project/report/report.sessions.html"}).state("main.jscripty.projects.report.summary",{url:"/summary",templateUrl:"app/jscripty/project/report/report.summary.html"}).state("main.jscripty.projects.report.detail",{url:"/detail",templateUrl:"app/jscripty/project/report/report.detail.html"}).state("main.jscripty.projects.report.sessionDetail",{url:"/session/:sessionId",controller:"JscriptyProjectReportCtrl",templateUrl:"app/jscripty/project/report/report.session.detail.html"})}]),angular.module("xCallyShuttleApp").controller("JscriptyProjectViewCtrl",["$scope","$http","$state","$stateParams","socket","Auth","Modal","xAlert","$translate","$rootScope",function(a,b,c,d,e,f,g,h,i,j){a.jscriptyProject={},a.getProject=function(){b.get("/api/jscripty/projects/"+d.id).success(function(b){a.jscriptyProject=b,angular.element(document).ready(function(){window.onerror=function(a,b,c){try{if(null!=a&&-1!=a.indexOf("Script error."));else{var d=new Image;d.src="assets/plugins/mxgraph/images/1x1.png?msg="+encodeURIComponent(a)+"&url="+encodeURIComponent(b)+"&lnum="+encodeURIComponent(c)}}catch(e){}},b.token=f.getToken();var a=new EditorUi(new Editor);a.openString(b.draft,b.name,b),a.editor.graphChangeListener=function(a,b){var c=b.properties.rtChange||!1;c||(this.modified=!0)}}),e.syncUpdates("jscripty_project",[b],function(a,c,d){c.id===b.id})})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.jscripty.projects.view",{url:"/view/:id",templateUrl:"app/jscripty/project/view/view.html",controller:"JscriptyProjectViewCtrl",authenticate:!0,resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",serie:!0,cache:!1,files:["assets/plugins/mxgraph/css/common.css","assets/plugins/mxgraph/css/explorer.css","assets/plugins/mxgraph/styles/grapheditor.css","assets/plugins/mxgraph/styles/custom.css","assets/plugins/jscripty/js/custom.js","assets/plugins/mxgraph/js/mxClient.js","assets/plugins/jscripty/js/Editor.js","assets/plugins/jscripty/js/Graph.js","assets/plugins/jscripty/js/EditorUi.js","assets/plugins/jscripty/js/Actions.js","assets/plugins/jscripty/js/Menus.js","assets/plugins/jscripty/js/Sidebar.js","assets/plugins/jscripty/js/Toolbar.js","assets/plugins/jscripty/js/Dialogs.js"]}])}]}})}]),angular.module("xCallyShuttleApp").controller("LoginCtrl",["$scope","Auth","$location","$window","$rootScope",function(a,b,c,d,e){a.year=moment().year(),a.userLogin={},a.userSignUp={},a.loginSubmitted=!1,a.signupSubmitted=!1,a.errorLogin=!1,a.errorSignup=!1,a.errorLog="",a.flagLogin1=!1,a.toogleLogin=function(){a.flagLogin1=!a.flagLogin1},e.bodyLayout="login",a.$on("$viewContentLoaded",function(){Metronic.init(),Layout.init()}),a.login=function(d){a.loginSubmitted=!0,d.$valid?b.login({name:a.userLogin.name,password:a.userLogin.password,remember:a.userLogin.remember}).then(function(){c.path("/dashboard/voice")})["catch"](function(b){a.errorLog=b.message,a.errorLogin=!0}):a.errorLogin=!0},a.signup=function(d){a.signupSubmitted=!0,d.$valid?b.createUser({email:a.userSignUp.email,fullname:a.userSignUp.fullname,name:a.userSignUp.name,password:a.userSignUp.password,role:a.userSignUp.role,online:!0}).then(function(){c.path("/")})["catch"](function(b){a.errorLog=b.message,a.errorSignup=!0}):a.errorSignup=!0},a.loginOauth=function(a){d.location.href="/auth/"+a}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("login",{url:"/login",templateUrl:"app/login/login.html",controller:"LoginCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/css/login.css"]}])}]}})}]),angular.module("xCallyShuttleApp").factory("Action",["$resource",function(a){return a("/api/actions/:name/:controller",{name:"@name"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").directive("actionBuilderTemplate",["$compile","xAlert","$http","$timeout","Template","$translate",function(a,b,c,d,e,f){return{restrict:"E",scope:{element:"=",form:"="},templateUrl:"app/main/template/actionBuilder/template.actionBuilderTemplate.html",compile:function(c,g){var h,i;return h=c.contents().remove(),function(c,g,j){function k(a,b){var c=[];for(a=a||5,b=b||"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";--a;)c.push(b.charAt(Math.floor(Math.random()*b.length)));return c.join("")}c.randomName=k(),d(function(){return e.get().$promise.then(function(a){c.templates=a.rows})["catch"](function(a){b.show(f.instant(a.message),"danger")})}),i||(i=a(h)),g.append(i(c,function(a){return a}))}}}}]).directive("actionBuilderIntegration",["$compile","xAlert","$http","$timeout","Integration","$translate","ZendeskAccount","DeskAccount","SalesforceAccount","FreshdeskAccount","SugarcrmAccount",function(a,b,c,d,e,f,g,h,i,j,k){return{restrict:"E",scope:{element:"=",form:"="},templateUrl:"app/main/template/actionBuilder/template.actionBuilderIntegration.html",compile:function(c,l){var m,n;return m=c.contents().remove(),function(c,l,o){function p(a,b){var c=[];for(a=a||5,b=b||"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";--a;)c.push(b.charAt(Math.floor(Math.random()*b.length)));return c.join("")}c.randomName=p(),d(function(){return e.get({active:1}).$promise.then(function(a){c.integrations=a.rows,c.element.data1&&q()})["catch"](function(a){b.show(f.instant(a.message),"danger")})});var q=function(){var a;switch(c.element.data1){case"zendesk":a=g;break;case"desk":a=h;break;case"salesforce":a=i;break;case"freshdesk":a=j;break;case"sugarcrm":a=k}return a.get().$promise.then(function(a){c.accounts=a.rows,c.element.data2&&r()})["catch"](function(a){b.show(f.instant(a.message),"danger")})},r=function(){c.configurations=_.find(c.accounts,{id:Number(c.element.data2)}).Configurations};c.changeIntegration=function(){c.element.data2="",q()},c.changeAccount=function(){c.element.data3="",r()},n||(n=a(m)),l.append(n(c,function(a){return a}))}}}}]).directive("actionBuilderStatus",["$compile","xAlert","$http","$timeout","$translate",function(a,b,c,d,e){return{restrict:"E",scope:{element:"=",form:"="},templateUrl:"app/main/template/actionBuilder/template.actionBuilderStatus.html",compile:function(b,c){var d,e;return d=b.contents().remove(),function(b,c,f){function g(a,b){var c=[];for(a=a||5,b=b||"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";--a;)c.push(b.charAt(Math.floor(Math.random()*b.length)));return c.join("")}b.randomName=g(),b.states=[{name:"APPLICATION_STATUS_NEW",value:"NEW"},{name:"APPLICATION_STATUS_OPEN",value:"OPEN"},{name:"APPLICATION_STATUS_CLOSED",value:"CLOSED"}],e||(e=a(d)),c.append(e(b,function(a){return a}))}}}}]),angular.module("xCallyShuttleApp").factory("Ami",["$resource",function(a){return a("/api/ami/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").controller("ChooseContactModalCtrl",["$scope","$uibModalInstance","eventId","$http","xAlert","$translate",function(a,b,c,d,e,f){a.open=function(a){b.close(a)},a.getContacts=function(){d.get("/api/contactmanager/contacts/"+c+"/checkevent").success(function(b){a.contacts=b}).error(function(a){e.show(f.instant(a.message)+"!","danger")})},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("CloseEditedTabModalCtrl",["$scope","$uibModalInstance",function(a,b){a.close=function(){b.close()},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").factory("gridOptions",["Modal","xAlert","$translate","$interval","$q","usSpinnerService",function(a,b,c,d,e,f){return{gridOptions:function(d,g,h,i,j,k){h.id=[];var l=k?"gridOptions"+k:"gridOptions",m={offset:0,limit:10};g.draggable&&(g.rowTemplate='<div grid="grid" class="ui-grid-draggable-row" draggable="true"><div ng-repeat="(colRenderIndex, col) in colContainer.renderedColumns track by col.colDef.name" class="ui-grid-cell" ng-class="{ \'ui-grid-row-header-cell\': col.isRowHeader, \'custom\': true }" ui-grid-cell></div></div>',g.useExternalPagination=!1,g.enablePaginationControls=!1,g.showGridFooter=!1);var n=function(a){var b=a?30*a+120:177;angular.element(document.getElementsByClassName("ui-grid")[0]).css("height",b+"px")},o=function(){return h[l].enablePaginationControls||(delete m.offset,delete m.limit),f.spin("spinner-grid"),d.get(i?_.merge(m,i):m).$promise.then(function(a){h[l].totalItems=a.count,h[l].data=a.rows,n(a.rows.length)})["catch"](function(a){console.error(a)})["finally"](function(){f.stop("spinner-grid")})};return h.deleteItem=a.confirm["delete"](function(a){var e=i?angular.copy(i):{};return _.merge(e,{id:a}),d.remove(e).$promise.then(function(){o(),b.show(c.instant("MESSAGE_WELL_DONE")+"!","success"),h.gridApi.selection.clearSelectedRows(),h.id=[]})["catch"](function(a){b.show(a.message?a.message:a.data.message,"danger")})}),h.deleteItems=a.confirm["delete"](function(){var a=i?angular.copy(i):{};return _.merge(a,{ids:h.id}),d["delete"](a).$promise.then(function(){o(),b.show(c.instant("MESSAGE_WELL_DONE")+"!","success"),h.gridApi.selection.clearSelectedRows(),h.id=[]})["catch"](function(a){b.show(a.message?a.message:a.data.message,"danger")})}),g.columnDefs.forEach(function(a){a.hasOwnProperty("displayName")||(a.displayName="APPLICATION_"+a.name.toUpperCase()),a.headerCellFilter="translate",a.hasOwnProperty("buttons")&&(a.displayName="",a.cellClass="ui-grid-vcenter",a.enableSorting=!1,a.enableFiltering=!1,a.enableColumnMenu=!1,a.cellTemplate="<div>",a.buttons.forEach(function(b){b.directive?a.cellTemplate+=b.directive:(a.cellTemplate+="<a",a.cellTemplate+=b.hide?' data-ng-hide="true" ':" ",a.cellTemplate+=b["class"]?' class="btn btn-xs '+b["class"]+'" ':" ",a.cellTemplate+=b.href?' data-ng-href="'+b.href+'" ':" ",a.cellTemplate+=b.onClick?' data-ng-click="'+b.onClick+'" ':" ",a.cellTemplate+=b.title?' title="'+b.title+'"':"",a.cellTemplate+=">",a.cellTemplate+=b.icon?'<i class="'+b.icon+'"></i>':"",a.cellTemplate+=b.displayName||b.name?"{{'"+(b.displayName||"APPLICATION_"+b.name.toUpperCase())+"' | translate}}":"",a.cellTemplate+="</a> ")}),a.cellTemplate+="<div>",delete a.buttons)}),_.merge({enableGridMenu:!0,headerCellFilter:"translate",enableHorizontalScrollbar:0,enableVerticalScrollbar:0,enableRowSelection:!0,enableSelectAll:!0,enableFiltering:!0,showGridFooter:!0,paginationPageSizes:[10,25,50,75],paginationPageSize:10,useExternalPagination:!0,useExternalSorting:!0,useExternalFiltering:!0,multiSelect:!0,getPage:o,gridMenuTitleFilter:function(a){var b=e.defer();return b.resolve(c.instant(a)),b.promise},onRegisterApi:function(a){h.gridApi=a,h.gridApi.selection.on.rowSelectionChanged(h,function(a){a.isSelected?h.id.push(h.gridApi.grid.options.primaryKey?a.entity[h.gridApi.grid.options.primaryKey]:a.entity.id):_.pull(h.id,h.gridApi.grid.options.primaryKey?a.entity[h.gridApi.grid.options.primaryKey]:a.entity.id)}),h.gridApi.selection.on.rowSelectionChangedBatch(h,function(a){a[0].isSelected?h.id=_.union(h.id,_.map(a,h.gridApi.grid.options.primaryKey?"entity."+h.gridApi.grid.options.primaryKey:"entity.id")):_.map(a,h.gridApi.grid.options.primaryKey?"entity."+h.gridApi.grid.options.primaryKey:"entity.id").forEach(function(a){_.pull(h.id,a)})}),h.gridApi.core.on.sortChanged(h,function(a,b){0===b.length?m.order=null:m.order=b[0].name+" "+b[0].sort.direction.toUpperCase(),o()}),h.gridApi.pagination.on.paginationChanged(h,function(a,b){m.offset=(a-1)*b,m.limit=b,o()}),h.gridApi.core.on.filterChanged(h,function(){var a=this.grid;a.columns.forEach(function(a){a.filters[0].term?m[a.name]=a.filters[0].term:delete m[a.name]}),o()}),h.gridApi.draggableRows.on.rowDropped(h,function(a){a.fromIndex!==a.toIndex&&d.update(i,h[l].data).$promise.then(function(){b.show(c.instant("MESSAGE_WELL_DONE")+"!","success")})["catch"](function(a){b.show(a.message,"danger")})}),j||o()}},g)}}}]),angular.module("xCallyShuttleApp").controller("MainCtrl",["$scope","$rootScope","$translate","socket","Auth","xAlert","$uibModal","$log","$state","Contact",function(a,b,c,d,e,f,g,h,i,j){a.awesomeThings=[],a.isLoggedIn=e.isLoggedIn,a.isAdmin=e.isAdmin,a.getCurrentUser=e.getCurrentUser,a.workspaces=[],a.mainTab={active:!0},a.closeTab=function(b){if(a.workspaces[b].edited){var c=g.open({animation:!0,templateUrl:"app/main/closeEditedTab.modal.html",controller:"CloseEditedTabModalCtrl"});c.result.then(function(c){a.workspaces.splice(b,1)},function(){h.info("Modal dismissed at: "+new Date)})}else a.workspaces.splice(b,1)},a.createContact=function(b,d){return d.tags=d.tags?d.tags.join(","):void 0,j.save(d).$promise.then(function(d){a.workspaces.splice(b,1);var e=d.firstName;d.lastName&&(e+=" "+d.lastName),a.openContactTab({fullname:d.fullname,id:d.id}),f.show(c.instant("MESSAGE_WELL_DONE")+"!","success")})["catch"](function(a){f.show(a.message,"danger")})};var k=function(b){var c=g.open({animation:!0,templateUrl:"app/main/chooseContact.modal.html",controller:"ChooseContactModalCtrl",resolve:{eventId:function(){return b.id}}});c.result.then(function(c){c?a.openContactTab(c):a.newContact(b)},function(){h.info("Modal dismissed at: "+new Date)})};a.updateContact=function(b,d){var e=angular.copy(d);return e.tags=e.tags?e.tags.join(","):void 0,e.CompanyId||(e.CompanyId=null),j.update({id:e.id},e).$promise.then(function(){a.workspaces[b].edited=!1,f.show(c.instant("MESSAGE_WELL_DONE")+"!","success")})["catch"](function(a){f.show(c.instant(a.message)+"!","danger")})},d.socket.on("report_integration:contactmanager",function(a){console.log("choosecontact"),k(a)}),a.openContactTab=function(b){var c=_.find(a.workspaces,{contactID:b.id});if(c)c.active=!0;else{var d=b.firstName;b.lastName&&(d+=" "+b.lastName),a.workspaces.push({name:d,type:"contact",contactID:b.id,active:!0,eventData:b.uniqueid?b:null})}},a.openJscriptyTab=function(b){a.workspaces.push({name:b.name,type:"jscripty",active:!0,data:b})},a.newContact=function(b){a.workspaces.push({name:"New Contact",type:"newContact",active:!0,data:b||null,eventData:b&&b.uniqueid?b:""})},a.$on("$viewContentLoaded",function(){Metronic.init()}),b.language=c.use(),a.changeLanguage=function(a){c.use(a).then(function(a){b.language=a,("main.jscripty.projects.view"===i.current.name||"main.square.projects.view"===i.current.name)&&i.go(i.current,{},{reload:!0})})["catch"](function(a){console.error(a)})}}]),angular.module("xCallyShuttleApp").directive("ngSpinnerBar",["$rootScope",function(a){return{link:function(b,c){c.addClass("hide"),a.$on("$stateChangeStart",function(){"spinner-page"===c[0].id&&c.removeClass("hide")}),a.$on("$stateChangeSuccess",function(){"spinner-page"===c[0].id&&(c.addClass("hide"),$("body").removeClass("page-on-load"),Layout.setSidebarMenuActiveLink("match"),setTimeout(function(){Metronic.scrollTop()},1e3))}),a.$on("$spinnerStart",function(){"spinner-request"===c[0].id&&c.removeClass("hide")}),a.$on("$spinnerStop",function(){"spinner-request"===c[0].id&&c.addClass("hide")}),a.$on("$stateNotFound",function(){"spinner-page"===c[0].id&&c.addClass("hide")}),a.$on("$stateChangeError",function(){"spinner-page"===c[0].id&&c.addClass("hide")})}}}]).directive("a",function(){return{restrict:"E",link:function(a,b,c){(c.ngClick||""===c.href||"#"===c.href)&&b.on("click",function(a){a.preventDefault()})}}}).directive("nxEqual",function(){return{require:"ngModel",link:function(a,b,c,d){return c.nxEqual?(a.$watch(c.nxEqual,function(a){d.$setValidity("nxEqual",a===d.$viewValue)}),void d.$parsers.push(function(b){var e=b===a.$eval(c.nxEqual);return d.$setValidity("nxEqual",e),e?b:void 0})):void console.error("nxEqual expects a model as an argument!")}}}).directive("ngEnter",function(){return function(a,b,c){b.bind("keydown keypress",function(b){13===b.which&&(a.$apply(function(){a.$eval(c.ngEnter)}),b.preventDefault())})}}).directive("dropdownMenuHover",function(){return{link:function(a,b){b.dropdownHover()}}}).directive("uiSelectRequired",function(){return{require:"ngModel",link:function(a,b,c,d){d.$validators.uiSelectRequired=function(a){return a&&a.length}}}}).directive("rpattern",function(){return{restrict:"A",require:"ngModel",link:function(a,b,c,d){function e(a,b){return null==b||""===b||!h||a.test(b)?(d.$setValidity("pattern",!0),b):void d.$setValidity("pattern",!1)}var f,g=c.rpattern,h=!0;g&&(g.match(/^\/(.*)\/$/)?(g=new RegExp(g.substr(1,g.length-2)),f=function(a){return e(g,a)}):f=function(b){var c=a.$eval(g);if(!c||!c.test)throw new Error("Expected "+g+" to be a RegExp but was "+c);return e(c,b)}),d.$formatters.push(f),d.$parsers.push(f),c.$observe("required",function(a){h=a,f(d.$viewValue)})}}}).directive("conditionBuilder",["$compile","xAlert","$timeout",function(a,b,c){return{restrict:"E",scope:{element:"=",serviceindex:"=",service:"=",form:"="},templateUrl:"app/main/template/template.conditionBuilder.html",compile:function(d,e){var f,g;return f=d.contents().remove(),function(d,e,h){function i(a){var c=_.find(d.service.services[d.serviceindex].conditions,{value:a});if(c)if(d.elementType=c.type,c.arr)d.values=c.arr;else if(c.resource)return c.resource.get().$promise.then(function(a){d.values=_.map(a.rows,function(a){return{name:a[c.resValue],value:a[c.resValue]}})})["catch"](function(a){b.show($translate.instant(a.message),"danger")})}function j(a,b){var c=[];for(a=a||5,b=b||"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";--a;)c.push(b.charAt(Math.floor(Math.random()*b.length)));return c.join("")}d._=_,d.randomName=j(),c(function(){d.element.field&&i(d.element.field)}),d.checkCondition=function(a){d.element.value="",d.element.operator="",i(a)},g||(g=a(f)),e.append(g(d,function(a){return a}))}}}}]).directive("newContact",["$compile","xAlert","socket","$translate","$timeout","Service","Tag","Company",function(a,b,c,d,e,f,g,h){return{restrict:"E",scope:{workspace:"=",index:"=",submit:"&onSubmit"},templateUrl:"app/main/template/template.contactTab.html",compile:function(a,i){return function(a,i,j){function k(){a.$watch("contact",function(b,c){angular.equals(b,c)||(a.workspace.edited=!0)},!0)}a.forms={general:{}},a.firstLoad=!0,a.detail={tab:"main"},a.contact={},a.submitButtonLabel=d.instant("APPLICATION_CONFIRM"),a.init=function(){a.workspace.data&&(a.contact.firstName=a.workspace.data.calleridname?a.workspace.data.calleridname:a.workspace.data.messageId?a.workspace.data.messageId:a.workspace.data.uniqueid?a.workspace.data.uniqueid:"",a.workspace.data.calleridnum&&(a.contact.phone=a.workspace.data.calleridnum),a.workspace.data.from&&(a.contact.email=a.workspace.data.from)),a.getTags(),a.getCompanies(),a.getServices()},a.getServices=function(){return f.get().$promise.then(function(b){a.services=b.rows,c.syncUpdates("service",a.services),a.contact.ServiceId=1,a.getCustomFields()})["catch"](function(a){b.show(d.instant(a.message)+"!","danger")})},a.getCustomFields=function(){return f.get({serviceId:a.contact.ServiceId,controller:"customfields"}).$promise.then(function(b){a.customFields=b.rows,a.customFields.forEach(function(a){a.values=JSON.parse(a.values)}),c.socket.on("custom_field:remove",function(b){_.remove(a.customFields,function(a){return b.id==a.id})}),c.socket.on("custom_field:save",function(b){if(b.ServiceId===a.contact.ServiceId){var c=_.find(a.customFields,{id:b.id});c||("string"==typeof b.values&&(b.values=JSON.parse(b.values)),a.customFields.push(b))}}),!a.firstLoad||a.workspace.data?(a.workspace.edited=!0,a.firstLoad=!1):(a.firstLoad=!1,k())})["catch"](function(a){console.error(a),b.show(a.message,"danger")})},a.getTags=function(){return g.get().$promise.then(function(b){a.tags=_.map(b.rows,"name")})["catch"](function(a){console.error(a),b.show(a.message,"danger")})},a.getCompanies=function(){return h.get().$promise.then(function(b){a.companies=b.rows,c.syncUpdates("company",a.companies)})["catch"](function(a){console.error(a),b.show(a.message,"danger")})},e(function(){a.init()})}}}}]).directive("contact",["$compile","xAlert","socket","$timeout","Service","Tag","Company","Contact","$translate","gridOptions",function(a,b,c,d,e,f,g,h,i,j){return{restrict:"E",scope:{workspace:"=",index:"=",submit:"&onSubmit"},templateUrl:"app/main/template/template.contactTab.html",compile:function(a,k){return function(a,k,l){function m(b){var c={exporterCsvFilename:b+".csv",columnDefs:[{name:a.columns[a.log[b].show][a.log[b].detail].indexes[0],displayName:a.columns[a.log[b].show][a.log[b].detail].header[0],headerCellFilter:"translate",enableSorting:!1,enableColumnMenu:!1},{name:a.columns[a.log[b].show][a.log[b].detail].indexes[1],displayName:a.columns[a.log[b].show][a.log[b].detail].header[1],headerCellFilter:"translate",enableSorting:!1,enableColumnMenu:!1},{name:a.columns[a.log[b].show][a.log[b].detail].indexes[2],displayName:a.columns[a.log[b].show][a.log[b].detail].header[2],headerCellFilter:"translate",enableSorting:!1,enableColumnMenu:!1}]};a["gridOptions"+b]=j.gridOptions(h,c,a,_.merge({id:a.workspace.contactID,controller:"log",logType:b},a.log[b]),!0,b),a["gridOptions"+b].getPage();
-}a.moment=moment,a.submitButtonLabel=i.instant("APPLICATION_UPDATE"),a.forms={general:{}},a.detail={tab:"main"},a.log={journal:{show:"phone",type:"inbound",detail:"general"},history:{show:"phone",type:"inbound",detail:"general"}},a.columns={phone:{general:{header:["APPLICATION_SOURCE","APPLICATION_DESTINATION","APPLICATION_DATE"],indexes:["source","destination","createdAt"]},queue:{header:["APPLICATION_CALLERID","APPLICATION_QUEUE","APPLICATION_DATE"],indexes:["calleridnum","queue","createdAt"]},agent:{header:["APPLICATION_AGENT","APPLICATION_QUEUE","APPLICATION_DATE"],indexes:["membername","queue","agentcalledAt"]}},email:{general:{header:["APPLICATION_FROM","APPLICATION_TO","APPLICATION_DATE"],indexes:["from","to","createdAt"]}}},a.updateLog=function(b,c,d,e){c&&(a.log[b].show=c),d&&(a.log[b].detail=d),e&&(a.log[b].type=e),m(b)},a.getContact=function(){return h.get({id:a.workspace.contactID}).$promise.then(function(b){b.tags=b.tags?b.tags.split(","):[],a.contact=b,a.getCustomFields(b.ServiceId),a.updateLog("journal"),a.updateLog("history")})["catch"](function(a){console.error(a),b.show(a.message,"danger")})},a.getTags=function(){return f.get().$promise.then(function(b){a.tags=_.map(b.rows,"name")})["catch"](function(a){console.error(a),b.show(a.message,"danger")})},a.getCompanies=function(){return g.get().$promise.then(function(b){a.companies=b.rows,c.syncUpdates("company",a.companies)})["catch"](function(a){console.error(a),b.show(a.message,"danger")})},a.getCustomFields=function(d){return e.get({serviceId:d,controller:"customfields"}).$promise.then(function(b){a.customFields=b.rows,a.customFields.forEach(function(a){a.values=JSON.parse(a.values)}),c.socket.on("custom_field:remove",function(b){_.remove(a.customFields,function(a){return b.id==a.id})}),c.socket.on("custom_field:save",function(b){if(b.ServiceId===d){var c=_.find(a.customFields,{id:b.id});c||("string"==typeof b.values&&(b.values=JSON.parse(b.values)),a.customFields.push(b))}})})["catch"](function(a){console.error(a),b.show(a.message,"danger")})},d(function(){a.getTags(),a.getCompanies(),a.getContact()})}}}}]).directive("jscripty",["$compile","xAlert","$http","socket",function(a,b,c,d){return{restrict:"E",scope:{workspace:"=",index:"=",submit:"&onSubmit"},templateUrl:"app/main/template/template.jscriptyTab.html",compile:function(a,d){return function(a,d,e){a.count=0,a.questions=[];var f=0,g=a.workspace.data.id;c.get("/api/jscripty/projects/"+g+"/download").success(function(b){if(b){c.post("/api/jscripty/projects/"+g+"/sessions",{projectId:g,status:"started"}).success(function(a){f=a.session_id,console.log(a)});var d=mxUtils.parseXml(b),e=new mxCodec(d);a.decObj=e.decode(d.documentElement);a.questions[a.count]=a.currentQuestion=_.find(a.decObj.cells,function(a){return a.vertex&&"start"==a.value.nodeName})}else console.log("No project published!"),alert("No project published!"),a.submit({index:a.index})}),a.next=function(b,c){a.currentQuestion.answer&&a.currentQuestion.answer!=c&&(a.questions=_.take(a.questions,a.count+1)),a.currentQuestion.answer=c,a.questions[a.count]=a.currentQuestion;var d=[];_.forEach(b.edges,function(a,c){if(a.source.id==b.id&&a.value){var e=a.value.split(",");e.length>1&&(_.forEach(e,function(c,d){var e=Object.create(a);e.setValue(c),b.edges.push(e)}),d.push(a))}}),_.forEach(d,function(a){_.remove(b.edges,function(b){return b.value==a.value&&b.id==a.id})}),a.currentQuestion=b,a.count++,a.questions[a.count]=b,a.saveQuestions()},a.end=function(){var d="completed";if("end"!=a.questions[a.questions.length-1].value.nodeName){var d="incomplete";a.saveQuestions()}c.put("/api/jscripty/projects/"+g+"/sessions/"+f,{status:d,completedAt:Date(),last_question_id:a.currentQuestion.id}).success(function(c){b.show("Project Ended","success"),a.submit({index:a.index})})},a.back=function(){a.count--,a.currentQuestion=a.questions[a.count]},a.setCurrentQuestion=function(b){a.count=b,a.currentQuestion=a.questions[a.count]},a.saveQuestions=function(){var b=[],d=[];_.forEach(a.questions,function(a,c){a.children&&_.forEach(a.children,function(a,b){d[b]={input_id:a.id,input_type:a.getAttribute("type",""),input_label:a.getAttribute("label",""),input_value:"checkbox"!=a.getAttribute("type","")||a.answer?a.answer:"Not selected"}}),b[c]={sessionId:f,projectId:g,question_id:a.id,question_type:a.value.nodeName,question_label:a.getAttribute("label",""),question_text:a.getAttribute("question",""),question_other_label:a.getAttribute("other"),question_other_answer:a.otheranswer,question_answer:a.answer,ReportJscriptyInputs:d},d=[]}),c.post("/api/jscripty/projects/"+g+"/sessions/"+f+"/questions/",b).success(function(a){})}}}}}]).directive("reportBuilder",["$compile",function(a){return{restrict:"E",scope:{group:"=",fields:"=",forms:"=",firstCall:"="},templateUrl:"app/main/template/template.reportBuilderView.html",compile:function(b,c){var d,e;return d=b.contents().remove(),function(b,c,f){b.operators=[{name:"AND"},{name:"OR"}],b.conditions=[{name:"="},{name:"!="},{name:"<"},{name:"<="},{name:">"},{name:">="},{name:"LIKE"}],b.addCondition=function(){b.group.rules.push({condition:"=",field:"",value:""})},b.removeCondition=function(a){b.group.rules.splice(a,1)},b.addGroup=function(){b.group.rules.push({group:{operator:"AND",rules:[{condition:"=",field:"",value:""}]}})},b.randomName=function(a,b){var c=[];for(a=a||5,b=b||"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";--a;)c.push(b.charAt(Math.floor(Math.random()*b.length)));return c.join("")},b.removeGroup=function(){b.$parent.group&&b.$parent.group.rules.splice(b.$parent.$index,1)},e||(e=a(d)),c.append(e(b,function(a){return a}))}}}}]).directive("dynamicName",["$compile",function(a){return{restrict:"A",terminal:!0,priority:1e3,link:function(b,c,d){c.attr("name",b.$eval(d.dynamicName)),c.removeAttr("dynamic-name"),a(c)(b)}}}]).directive("onReadFile",["$parse",function(a){return{restrict:"A",scope:!1,link:function(b,c,d){var e=a(d.onReadFile);c.on("change",function(a){var c=new FileReader;c.onload=function(a){b.$apply(function(){e(b,{$fileContent:a.target.result})})},c.readAsText((a.srcElement||a.target).files[0])})}}}]).directive("motionFileDownload",["xAlert","$translate","$timeout","$location","FileSaver","$compile",function(a,b,c,d,e,f){return{restrict:"E",template:'<a uib-tooltip=\'{{tooltiptext}}\' class="{{btnclass || \'btn default btn-xs blue-hoki\'}}" href="" data-ng-click="download()" ng-bind-html="btncontent || (\'APPLICATION_DOWNLOAD\' | translate)"></a>',scope:{mimetype:"=",filename:"=",resource:"=",params:"=",btnclass:"@",btncontent:"@",tooltiptext:"@"},link:function(c,d,f){var g=d.children()[0];c.$on("download-start",function(){$(g).attr("disabled","disabled")}),c.$on("downloaded",function(a,b){var d=base64ToBlob(b,c.mimetype);e.saveAs(d,c.filename),$(g).attr("disabled",!1)}),c.download=function(){return c.$emit("download-start"),c.resource.get(c.params).$promise.then(function(a){c.$emit("downloaded",a.downloadString)})["catch"](function(d){a.show(b.instant(d.translatedMessage||d.data.translatedMessage||d.message||d.data.message),"danger"),c.download=function(){}})}}}}]).directive("audioFileDownload",["xAlert","$translate","$sce",function(a,b,c){return{restrict:"E",template:'<button type="button" class="btn default btn-xs blue-hoki" data-ng-click="download()"><i class="icon-control-play"></i> {{ \'APPLICATION_PREVIEW\' | translate}}</button>',scope:{resource:"=",params:"="},link:function(d,e,f){var g=e.children()[0];d.$on("download-start",function(a,b){$(g).attr("disabled","disabled").html('<i class="icon-refresh"></i> Loading...')}),d.$on("downloaded",function(a,b){var d=new Audio(c.trustAsResourceUrl("data:audio/ogg;base64,"+b));d.controls=!0,$(g).remove(),e.append(d),d.play()}),d.$on("error",function(a,b){$(g).removeClass("blue-stripe").addClass("red-stripe").html('<i class="icon-ban"></i> Error!')}),d.download=function(){return d.$emit("download-start"),d.resource.get(d.params).$promise.then(function(a){d.$emit("downloaded",a.downloadString)})["catch"](function(c){a.show(b.instant(c.translatedMessage||c.data.translatedMessage||c.message||c.data.message),"danger")})}}}}]).directive("uiRequired",function(){return{require:"ngModel",link:function(a,b,c,d){d.$validators.required=function(a,b){return!(b&&0===b.length&&"true"===c.uiRequired)},c.$observe("uiRequired",function(){d.$setValidity("required",!("true"===c.uiRequired&&d.$viewValue&&0===d.$viewValue.length))})}}}),angular.module("xCallyShuttleApp").filter("propsFilter",function(){return function(a,b){var c=[];return angular.isArray(a)?a.forEach(function(a){for(var d=!1,e=Object.keys(b),f=0;f<e.length;f++){var g=e[f],h=b[g].toLowerCase();if(-1!==a[g].toString().toLowerCase().indexOf(h)){d=!0;break}}d&&c.push(a)}):c=a,c}}).filter("capitalize",function(){return function(a){return a?a.replace(/([^\W_]+[^\s-]*) */g,function(a){return a.charAt(0).toUpperCase()+a.substr(1).toLowerCase()}):""}}).filter("salesforce",function(){var a=["CallDisposition","CallDurationInSeconds","CallObject","CallType","IsArchived","Priority","Status","Type"];return function(b){return _.remove(b,function(b){return b.custom===!1&&a.indexOf(b.name)<0}),b}}).filter("sugarcrm",function(){var a=["account_id","account_name","account_name1","assigned_user_name","assigned_user_id","case_number","created_by","created_by_name","date_entered","date_modified","deleted","description","id","modified_by_name","modified_user_id","name"];return function(b){return _.remove(b,function(b){return a.indexOf(b.name)>=0}),b}}).filter("freshdesk",function(){var a=["requester","subject","agent","description"];return function(b){return _.remove(b,function(b){return a.indexOf(b.ticket_field.name)>=0}),b}}).filter("zendesk",function(){var a=["subject","assignee","description"];return function(b){return _.remove(b,function(b){return a.indexOf(b.type)>=0}),b}}),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main",{"abstract":!0,templateUrl:"app/main/main.html",controller:"MainCtrl",resolve:{authorization:["$q","Auth","$state","$timeout","$location",function(a,b,c,d,e){return b.getToken()?a.when():(d(function(){e.path("/login")}),a.reject())}],deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css","assets/plugins/mxgraph/js/mxClient.js"]}])}]}})}]),angular.module("xCallyShuttleApp").factory("xAlert",["$translate","Notification",function(a,b){return{show:function(c,d){switch(d){case"success":b.success({message:c,title:'<i class="glyphicon glyphicon-ok"></i> <strong>'+a.instant("MESSAGE_SUCCESS")+"!</strong>",delay:5e3});break;case"info":b.info({message:c,title:'<i class="glyphicon glyphicon-info-sign"></i> <strong>'+a.instant("MESSAGE_INFO")+"!</strong>",delay:5e3});break;case"danger":b.error({message:c,title:'<i class="glyphicon glyphicon-exclamation-sign"></i> <strong>'+a.instant("MESSAGE_ERROR")+"!</strong>",delay:1e4});break;case"warning":b.warning({message:c,title:'<i class="glyphicon glyphicon-warning-sign"></i> <strong>'+a.instant("MESSAGE_WARNING")+"!</strong>",delay:1e4});break;default:b.info(c)}}}}]).factory("stResource",["$q","$filter","$timeout","$rootScope","$http","$translate","xAlert",function(a,b,c,d,e,f,g){return{getPage:function(b){var c={page:Math.ceil(b.pagination.start/b.pagination.number),per_page:b.pagination.number};b.sort.predicate&&(c.sort_by=b.sort.predicate,c.sort_order=b.sort.reverse?"DESC":"ASC"),_.forIn(b.search.predicateObject,function(a,b){c[b]=a}),b.search.params&&(c.clientQuery={},_.forIn(b.search.params,function(a,b){c.clientQuery[b]=a})),d.$broadcast("$spinnerStart"),e.get(b.url,{params:c}).success(function(a){h.resolve(a),d.$broadcast("$spinnerStop")}).error(function(a){g.show(f.instant(a.message),"danger"),d.$broadcast("$spinnerStop")});var h=a.defer();return h.promise}}}]),angular.module("xCallyShuttleApp").factory("Widget",["$resource",function(a){return a("/api/widgets/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").controller("MarketCtrl",["$scope","$http","$translate","socket","xAlert","Modal","$timeout",function(a,b,c,d,e,f,g){function h(a,b){return Math.floor(Math.random()*(b-a+1))+a}a.initView=function(){b.get("/api/integrations").success(function(b){a.integrations=b.rows,a.groupedIntegration=_.chunk(a.integrations,4),d.syncUpdates("integration",a.integrations,function(){a.groupedIntegration=_.chunk(a.integrations,4)})}).error(function(a){e.show(a.message,"danger")})},a.isProgressing=!1,a.$on("$destroy",function(){d.unsyncUpdates("integration")}),a.installIntegration=function(d){a.status="Downloading",a.percentage=h(1,50),a.isProgressing=!0,d.downloading=!0,b.put("/api/integrations/"+d.id,{active:!0}).success(function(){g(function(){a.percentage=h(51,99),a.status="Installing"},2500),g(function(){a.percentage=100,a.isProgressing=!1,a.status="Completed!",d.downloading=!1,e.show(c.instant("MESSAGE_WELL_DONE")+".","success")},5e3)}).error(function(){d.downloading=!1,a.percentage=0,a.isProgressing=!1,e.show(c.instant("MESSAGE_SOMETHING_WENT_WRONG")+".","danger")})},a.uninstallIntegration=function(d){a.status="Uninstalling",a.percentage=h(1,99),a.isProgressing=!0,d.downloading=!0,b.put("/api/integrations/"+d.id,{active:!1}).success(function(){g(function(){a.percentage=100,a.isProgressing=!1,a.status="Completed!",d.downloading=!1,e.show(c.instant("MESSAGE_WELL_DONE")+".","success")},5e3)}).error(function(){d.downloading=!1,a.percentage=0,a.isProgressing=!1,e.show(c.instant("MESSAGE_SOMETHING_WENT_WRONG")+".","danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.market",{url:"/market",templateUrl:"app/market/market.html",controller:"MarketCtrl",data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").controller("MotionbarCtrl",["$scope","$stateParams","$cookieStore","settings","Auth",function(a,b,c,d,e){e.loginWithToken(b.token,b.userId,b.name),a.getCurrentUser=e.getCurrentUser,d.layout.pageQuickSidebarOpened=!0}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("motionbar",{url:"/motionbar",template:"<div ui-view></div>","abstract":!0}).state("motionbar.chat",{url:"/chat?token&userId&name",templateUrl:"app/motionbar/motionbar.chat.html",controller:"MotionbarCtrl"})}]),angular.module("xCallyShuttleApp").controller("SalesforceListCtrl",["$scope","$http","$rootScope","xAlert","$translate","socket","Modal","stResource",function(a,b,c,d,e,f,g,h){a.conf={accountsByPage:{name:"10",value:10}},a.accountsByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.accounts={checked:[]},a.check=function(b,c){c?a.accounts.checked=angular.copy(_.map(a.displayedSalesforceAccounts,"id")):a.accounts.checked=[]},a.getAccounts=function(b){return _.map(a.displayedSalesforceAccounts,function(a){var c={};return b.forEach(function(b){c[b]=a[b]}),c})},a.initList=function(b){f.unsyncUpdates("salesforce_account"),b.url="/api/salesforce/accounts",h.getPage(b).then(function(d){a.displayedSalesforceAccounts=d.rows,b.pagination.numberOfPages=d.total_pages,c.updateTableConfig(a.accountsByPage,a.displayedSalesforceAccounts.length),c.updateTableConfig(a.conf.accountsByPage,a.displayedSalesforceAccounts.length)}),f.socket.on("salesforce_account:save",function(){a.initList(b)}),f.socket.on("salesforce_account:remove",function(c){a.accounts.checked=_.without(a.accounts.checked,c.id),a.initList(b)})},a.deleteItem=g.confirm["delete"](function(a){b["delete"]("/api/salesforce/accounts/"+a).success(function(){d.show(e.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(a){d.show(e.instant(a.message),"danger")})}),a.deleteItems=g.confirm["delete"](function(){b["delete"]("/api/salesforce/accounts",{params:{id:a.accounts.checked}}).success(function(){d.show(e.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){d.show(e.instant(a.message),"danger")})}),a.checkAccount=function(a){b.get("/api/salesforce/accounts/"+a+"/check").then(function(){d.show(e.instant("MESSAGE_ACCOUNT_VERIFIED"),"success")})["catch"](function(){d.show(e.instant("MESSAGE_ACCOUNT_INVALID"),"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.salesforce.list",{url:"/list",templateUrl:"app/salesforce/list/list.html",controller:"SalesforceListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.salesforce",{url:"/salesforce",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").factory("SalesforceAccount",["$resource",function(a){return a("/api/salesforce/accounts/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").controller("SalesforceViewCtrl",["$scope","$http","$stateParams","$translate","$location","WizardHandler","socket","xAlert","Modal","$filter",function(a,b,c,d,e,f,g,h,i,j){a.$stateParams=c,a.config={autoHideScrollbar:!1,theme:"dark",advanced:{updateOnContentResize:!0},setHeight:500,scrollInertia:0},a.initConfiguration=function(){a.formsConfiguration={},a.configuration={}},a.goNext=function(){f.wizard().next()},a.formValidation=function(a){return a},a.$on("$destroy",function(){g.unsyncUpdates("salesforce_configuration"),g.unsyncUpdates("salesforce_field")}),a.initView=function(){b.get("/api/salesforce/accounts/"+c.id).success(function(b){a.account=b}).error(function(a){h.show(a.message,"danger")})},a.updateItem=function(){b.put("/api/salesforce/accounts/"+c.id,a.account).success(function(){h.show(d.instant("MESSAGE_WELL_DONE")+".","success")}).error(function(){h.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG")+".","danger")})},a.getConfigurations=function(){b.get("/api/salesforce/configurations",{params:{AccountId:c.id}}).success(function(b){a.configurations=b,g.socket.on("salesforce_configuration:remove",function(b){_.remove(a.configurations,{id:b.id})})}).error(function(a){h.show(a.message,"danger")})},a.deleteConfiguration=i.confirm["delete"](function(a){b["delete"]("api/salesforce/configurations/"+a).success(function(){h.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(){h.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})}),a.createConfiguration=function(){a.configuration.AccountId=c.id,b.post("api/salesforce/configurations",a.configuration).success(function(a){e.path("salesforce/view/"+c.id+"/configurations/settings/"+a.id)}).error(function(){h.show("Something went wrong!","danger")})},a.fieldType=["string","variable"],a.descFieldType=["string","key_value"],a.getFields=function(){b.get("/api/salesforce/accounts/"+c.id+"/fields").success(function(b){a.accountFields=_.sortByOrder(j("salesforce")(b),"name","asc")}).error(function(a){h.show(a.message,"danger")})},a.getConfiguration=function(){b.get("/api/salesforce/configurations/"+c.configurationId).success(function(b){a.configurationName=b.name,a.subjectConfig=b.Subject,a.descriptionConfig=b.Description,a.fieldConfig=b.Field,g.socket.on("salesforce_field:remove",function(b){_.remove(a.subjectConfig,{id:b.id}),_.remove(a.descriptionConfig,{id:b.id}),_.remove(a.fieldConfig,{id:b.id})})}).error(function(a){h.show(a.message,"danger")})},a.getVariables=function(){b.get("/api/variables").success(function(b){a.variables=b.rows}).error(function(a){h.show(a.message,"danger")})},a.removeItem=function(a){b["delete"]("api/salesforce/fields/"+a.id).success(function(){h.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(){h.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})},a.addItemSubject=function(){var d={type:"string",content:""};b.post("/api/salesforce/configurations/"+c.configurationId+"/subject",d).success(function(b){a.subjectConfig.push(b)}).error(function(){h.show("Something went wrong!","danger")})},a.addItemDescription=function(){var d={type:"string",content:""};b.post("/api/salesforce/configurations/"+c.configurationId+"/description",d).success(function(b){a.descriptionConfig.push(b)}).error(function(){h.show("Something went wrong!","danger")})},a.addItemField=function(){var d={content:""};b.post("/api/salesforce/configurations/"+c.configurationId+"/field",d).success(function(b){a.fieldConfig.push(b)}).error(function(){h.show("Something went wrong!","danger")})},a.updateField=function(a){b.put("/api/salesforce/fields/"+a.id,a).success(function(){}).error(function(){h.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG")+".","danger")})},a.changeType=function(b){"variable"===b.type?b.content="":"string"===b.type&&(b.VariableId=null),a.updateField(b)},a.changeDescType=function(b){"key_value"===b.type?(b.content="","string"===b.keyType?b.VariableId=null:"variable"===b.keyType&&(b.keyContent="")):"string"===b.type&&(b.VariableId=null,b.key="",b.keyContent=""),a.updateField(b)},a.changeFieldType=function(b){b.content="",a.updateField(b)},a.getSystemFieldOptions=function(b){if(b){var c=_.find(a.accountFields,"name",b);if(c)switch(c.type){case"picklist":return c.picklistValues;default:return}}}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.salesforce.view",{url:"/view/:id",templateUrl:"app/salesforce/view/view.html",controller:"SalesforceViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.salesforce.view.account",{url:"/account",templateUrl:"app/salesforce/view/view.account.html"}).state("main.salesforce.view.configurations",{url:"/configurations",templateUrl:"app/salesforce/view/view.configurations.html"}).state("main.salesforce.view.configurations.settings",{url:"/settings/:configurationId",templateUrl:"app/salesforce/view/view.configurationSettings.html",controller:"SalesforceViewCtrl"}).state("main.salesforce.view.configuration",{url:"/configuration",templateUrl:"app/salesforce/view/view.configuration.html"})}]),angular.module("xCallyShuttleApp").controller("SalesforceWizardCtrl",["$scope","$http","$location","$translate","xAlert","WizardHandler",function(a,b,c,d,e,f){a.translate=d,a.initWizard=function(){a.$translate=d,a.forms={},a.item={}},a.next=function(){f.wizard().next()},a.exitValidation=function(a){return a},a.createItem=function(){console.log(a.item),b.post("api/salesforce/accounts",a.item).success(function(){e.show(d.instant("MESSAGE_WELL_DONE")+".","success"),c.path("/salesforce/list")}).error(function(){e.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG")+".","danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.salesforce.wizard",{url:"/wizard",templateUrl:"app/salesforce/wizard/wizard.html",controller:"SalesforceWizardCtrl"})}]),angular.module("xCallyShuttleApp").factory("License",["$resource",function(a){return a("/api/licenses/:id/:controller",{id:"@id"},{request:{method:"POST",params:{id:"request"}}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting.license",{url:"/license",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("LicenseViewCtrl",["$scope","$rootScope","$translate","License","xAlert",function(a,b,c,d,e){a.initView=function(){d.get(function(b){a.item=b.license})},a.submitRequest=function(){d.request(a.item,function(){e.show(c.instant("MESSAGE_WELL_DONE"),"success")},function(a){switch(a.status){case 304:e.show(a.statusText,"info");break;default:e.show(a.statusText,"danger")}})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting.license.view",{url:"/view",templateUrl:"app/setting/license/view/view.html",controller:"LicenseViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/css/pricing-tables.css"]}])}]}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting",{url:"/setting",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").factory("Setting",["$resource",function(a){return a("/api/settings/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").factory("Smtp",["$resource",function(a){return a("/api/mail/servers/out/:id/:controller",{id:"@id"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting.smtp",{url:"/smtp",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("SmtpViewCtrl",["$scope","$stateParams","$translate","MailServerOut","xAlert","usSpinnerService",function(a,b,c,d,e,f){a.initView=function(){a.item={},d.get({id:"service"}).$promise.then(function(b){a.item=b})["catch"](function(a){e.show(a.message,"danger")})},a.updateItem=function(){return a.item.id?d.update({id:a.item.id},a.item).$promise.then(function(){e.show(c.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){e.show(a.message,"danger")}):(a.item.service=!0,d.save(a.item).$promise.then(function(b){a.item=b,e.show(c.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){e.show(a.message,"danger")}))},a.test=function(){return f.spin("spinner-grid"),d.test({id:a.item.id,controller:"test"}).$promise.then(function(){e.show(c.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){e.show(a.data.message,"danger")})["finally"](function(){f.stop("spinner-grid")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting.smtp.view",{url:"/view",templateUrl:"app/setting/smtp/view/view.html",controller:"SmtpViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}})}]),angular.module("xCallyShuttleApp").controller("UpdateListCtrl",["$scope","gridOptions","$uibModal","$location","Update",function(a,b,c,d,e){a.initCounter=function(){a.$on("timer-stopped",function(a,b){console.log("Timer Stopped - data = ",b),d.path("/dashboard/voice")})},a.initView=function(){var c={exporterCsvFilename:"updates.csv",enableFiltering:!1,enableSorting:!1,enablePaginationControls:!1,enableSelectAll:!1,columnDefs:[{name:"message"},{width:125,name:"version",cellClass:"text-center ui-grid-vcenter"},{width:125,name:"createdAt",displayName:"APPLICATION_UPDATED_AT",cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div><span am-time-ago="row.entity.createdAt"></span></div>'}]};a.gridOptions=b.gridOptions(e,c,a)},a.pull=function(){c.open({animation:!0,templateUrl:"app/setting/update/list/list.pull.html",controller:"UpdateListPullCtrl"})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting.updates.list",{url:"/list",templateUrl:"app/setting/update/list/list.html",controller:"UpdateListCtrl"}).state("main.setting.updates.landing",{url:"/landing",templateUrl:"app/setting/update/list/landing.html",controller:"UpdateListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/error.css"]}])}]}})}]),angular.module("xCallyShuttleApp").controller("UpdateListPullCtrl",["$scope","$uibModalInstance","$translate","$location","Update","xAlert",function(a,b,c,d,e,f){a.modal={dismissable:!0,title:"Confirm Checkout",html:"Are you sure you want to checkout?",buttons:[{classes:"btn btn-success",text:"Checkout",click:function(){return b.dismiss("close"),e.pull().$promise.then(function(){d.path("/setting/updates/landing")})["catch"](function(a){console.error("err",a),f.show(c.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})}},{classes:"btn default",text:"Cancel",click:function(){b.dismiss("cancel")}}]}}]),angular.module("xCallyShuttleApp").factory("Update",["$resource",function(a){return a("/api/updates/:id/:controller",{id:"@id"},{pull:{method:"GET",params:{id:"pull"}}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting.updates",{url:"/updates",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("SquareOdbcListCtrl",["$scope","$uibModal","$translate","SquareOdbc","gridOptions","xAlert",function(a,b,c,d,e,f){a.initView=function(){var b={exporterCsvFilename:"odbc.csv",columnDefs:[{name:"name"},{name:"dsn",displayName:"APPLICATION_ODBC"},{name:"description"},{name:"action",width:250,buttons:[{"class":"blue-hoki",href:"/square/odbc/view/{{row.entity.id}}/settings",name:"settings"},{"class":"green-jungle",name:"check",displayName:"APPLICATION_CHECK_CONNECTION",onClick:"grid.appScope.checkConnection(row.entity.id)"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=e.gridOptions(d,b,a)},a.createItem=function(){var c=b.open({animation:!0,templateUrl:"app/square/odbc/list/list.create.modal.html",controller:"SquareOdbcListCreateCtrl"});c.result.then(function(){a.gridOptions.getPage()})},a.checkConnection=function(a){return d.get({id:a,controller:"check"}).$promise.then(function(){f.show(c.instant("MESSAGE_CONNECTION_VERIFIED"),"success")})["catch"](function(){f.show(c.instant("MESSAGE_CONNECTION_INVALID"),"danger")})}}]),angular.module("xCallyShuttleApp").controller("SquareOdbcListCreateCtrl",["$scope","$translate","$uibModalInstance","SquareOdbc","xAlert",function(a,b,c,d,e){a.form={},a.item={},a.item.dsn||(a.item.dsn="DRIVER=MySQL;SERVER=127.0.0.1;UID=xcall;PWD=password;DATABASE=motion"),a.save=function(){return d.save(a.item).$promise.then(function(a){e.show(b.instant("MESSAGE_WELL_DONE"),"success"),c.close(a)})["catch"](function(a){e.show(a.data.message,"danger")})},a.cancel=function(){c.dismiss()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.square.odbc.list",{url:"/list",templateUrl:"app/square/odbc/list/list.html",controller:"SquareOdbcListCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.square.odbc",{url:"/odbc",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").factory("SquareOdbc",["$resource",function(a){return a("/api/square/odbc/:id/:controller",{name:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").controller("SquareOdbcViewCtrl",["$scope","$translate","$stateParams","SquareOdbc","xAlert",function(a,b,c,d,e){a.odbc={},a.getOdbc=function(){return d.get({id:c.id}).$promise.then(function(b){a.odbc=b})["catch"](function(a){e.show(a.data.message,"danger")})},a.updateOdbc=function(){var f=angular.copy(a.odbc);return d.update({id:c.id},f).$promise.then(function(){e.show(b.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){e.show(a.data.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.square.odbc.view",{url:"/view/:id",templateUrl:"app/square/odbc/view/view.html",controller:"SquareOdbcViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.square.odbc.view.settings",{url:"/settings",templateUrl:"app/square/odbc/view/view.settings.html"})}]),angular.module("xCallyShuttleApp").controller("SquareProjectListCtrl",["$scope","$uibModal","SquareProject","gridOptions",function(a,b,c,d){a.initView=function(){var b={exporterCsvFilename:"projects.csv",columnDefs:[{name:"name"},{name:"description"
-},{name:"action",width:160,buttons:[{"class":"blue-hoki",href:"/square/projects/view/{{row.entity.id}}",name:"settings"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=d.gridOptions(c,b,a)},a.createItem=function(){var c=b.open({animation:!0,templateUrl:"app/square/project/list/list.create.modal.html",controller:"SquareProjectListCreateCtrl"});c.result.then(function(b){console.log(b),a.gridOptions.getPage()})}}]),angular.module("xCallyShuttleApp").controller("SquareProjectListCreateCtrl",["$scope","$translate","$uibModalInstance","SquareProject","xAlert",function(a,b,c,d,e){a.form={},a.item={},a.save=function(){return d.save(a.item).$promise.then(function(a){e.show(b.instant("MESSAGE_WELL_DONE"),"success"),c.close(a)})["catch"](function(a){e.show(a.data.message,"danger")})},a.cancel=function(){c.dismiss()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.square.projects.list",{url:"/list",templateUrl:"app/square/project/list/list.html",controller:"SquareProjectListCtrl",authenticate:!0})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.square.projects",{url:"/projects",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").factory("SquareProject",["$resource",function(a){return a("/api/square/projects/:id/:controller",{name:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").controller("SquareProjectViewCtrl",["$scope","$stateParams","Auth","xAlert","SquareProject",function(a,b,c,d,e){a.squareProject={},a.getProject=function(){return e.get({id:b.id}).$promise.then(function(b){a.squareProject=b,angular.element(document).ready(function(){window.onerror=function(a,b,c){try{if(null!==a&&-1!==a.indexOf("Script error."));else{var e=new Image;e.src="assets/plugins/mxgraph/images/1x1.png?msg="+encodeURIComponent(a)+"&url="+encodeURIComponent(b)+"&lnum="+encodeURIComponent(c)}}catch(f){d.show(f,"danger")}},b.token=c.getToken();var a=new EditorUi(new Editor);a.openString(b.preproduction,b.name,b),a.editor.graphChangeListener=function(a,b){var c=b.properties.rtChange||!1;c||(this.modified=!0)}})})["catch"](function(a){d.show(a.data.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.square.projects.view",{url:"/view/:id",templateUrl:"app/square/project/view/view.html",controller:"SquareProjectViewCtrl",authenticate:!0,resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",serie:!0,cache:!1,files:["assets/plugins/mxgraph/css/common.css","assets/plugins/mxgraph/css/explorer.css","assets/plugins/mxgraph/styles/grapheditor.css","assets/plugins/mxgraph/styles/custom.css","assets/plugins/square/js/custom.js","assets/plugins/mxgraph/js/mxClient.js","assets/plugins/square/js/Editor.js","assets/plugins/square/js/Graph.js","assets/plugins/square/js/EditorUi.js","assets/plugins/square/js/Actions.js","assets/plugins/square/js/Menus.js","assets/plugins/square/js/Sidebar.js","assets/plugins/square/js/Toolbar.js","assets/plugins/square/js/Dialogs.js"]}])}]}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.square",{url:"/square",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").factory("Agent",["$resource",function(a){return a("/api/agents/:id/:controller",{id:"@id"},{changePassword:{method:"PUT",params:{controller:"password"}},update:{method:"PUT"},patch:{method:"PATCH"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.agents",{url:"/agents",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("AgentListCtrl",["$scope","Agent","gridOptions",function(a,b,c){a.initView=function(){var d={exporterCsvFilename:"agents.csv",columnDefs:[{name:"fullname"},{name:"name",displayName:"APPLICATION_USERNAME"},{name:"internal"},{name:"email"},{name:"description"},{name:"action",width:125,buttons:[{"class":"blue-hoki",href:"/staff/agents/view/{{row.entity.id}}/account",name:"profile"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.fullname, row.entity.id)"}]}]};a.gridOptions=c.gridOptions(b,d,a)}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.agents.list",{url:"/list",templateUrl:"app/staff/agent/list/list.html",controller:"AgentListCtrl",data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").controller("AgentViewCtrl",["$scope","$http","xAlert","$translate","$stateParams","$cookieStore","Agent","FileUploader","Auth","User",function(a,b,c,d,e,f,g,h,i,j){a.Auth=i,a.recordSwitch={onText:"On",offText:"Off",isActive:!0,size:"small",animate:!0,radioOff:!0,handleWidth:"auto",labelWidth:"auto",inverse:!0,offColor:"danger",onColor:"success"},a.updatePassword=function(){var b={newPassword:a.agent.newPwd};return i.isAdmin()?b.id=e.id:b.oldPassword=a.agent.currentPwd,j.changePassword(b).$promise.then(function(){c.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){c.show(a.message,"danger")})};var k=a.uploader=new h({url:"api/users/"+e.id+"/avatar",queueLimit:1,withCredentials:!0,headers:{Authorization:"Bearer "+f.get("token")}});k.filters.push({name:"imageFilter",fn:function(a){var b="|"+a.type.slice(a.type.lastIndexOf("/")+1)+"|";return-1!=="|jpg|png|jpeg|".indexOf(b)}}),k.onSuccessItem=function(b,e){a.agent.userpic=e.userpic,a.agent.id===i.getCurrentUser().id&&(i.getCurrentUser().userpic=e.userpic),c.show(d.instant("MESSAGE_WELL_DONE"),"success")},k.onErrorItem=function(){c.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")},k.onCompleteAll=function(){k.clearQueue()},a.initView=function(){return g.get({id:e.id}).$promise.then(function(b){a.agent=b,a.agent.transport=a.agent.transport?a.agent.transport.split(","):[],a.agent.allow=a.agent.allow?a.agent.allow.split(";"):[],a.agent.nat=a.agent.nat?a.agent.nat.split(","):[]})["catch"](function(a){c.show(a.message,"danger")})},a.patchItem=function(){return g.patch({id:e.id},{chatCapacity:a.agent.chatCapacity,mailCapacity:a.agent.mailCapacity,faxCapacity:a.agent.faxCapacity}).$promise.then(function(){c.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){c.show(a.message,"danger")})},a.updateItem=function(){var b=angular.copy(a.agent);return delete b.password,delete b.md5secret,b.transport=b.transport.join(","),b.allow=b.allow.join(";"),b.nat=b.nat.join(","),g.update({id:e.id},b).$promise.then(function(){c.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){c.show(a.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.agents.view",{url:"/view/:id",templateUrl:"app/staff/agent/view/view.html",controller:"AgentViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.staff.agents.view.account",{url:"/account",templateUrl:"app/staff/agent/view/view.account.html",resolve:{deps:["$ocLazyLoad",function(a){return a.load({insertBefore:"#ng_load_plugins_before",files:["assets/scripts/jquery.sparkline.min.js","assets/plugins/bootstrap-fileinput/bootstrap-fileinput.js","assets/scripts/profile.js"]})}]}}).state("main.staff.agents.view.voice",{url:"/voice",templateUrl:"app/staff/agent/view/view.voice.html",data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}}).state("main.staff.agents.view.chat",{url:"/chat",templateUrl:"app/staff/agent/view/view.chat.html",data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}}).state("main.staff.agents.view.mail",{url:"/mail",templateUrl:"app/staff/agent/view/view.mail.html",data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}}).state("main.staff.agents.view.fax",{url:"/fax",templateUrl:"app/staff/agent/view/view.fax.html",data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}}).state("main.staff.agents.view.phonebar",{url:"/phonebar",templateUrl:"app/staff/agent/view/view.phonebar.html",data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").controller("AgentWizardCtrl",["$scope","$rootScope","Agent","Setting","xAlert","$location","$translate","$http","WizardHandler",function(a,b,c,d,e,f,g,h,i){a.forms={info:void 0,voice:void 0},a.item={role:"agent",allow:["alaw","ulaw","gsm"],transport:["udp"],context:"from-sip"},a.next=function(){i.wizard().next()},a.exitValidation=function(a){return a},a.getFirstFreeInternal=function(){return d.get({controller:"internal"}).$promise.then(function(b){a.item.internal=b.value})["catch"](function(a){e.show(a.data.message,"danger")})},a.createItem=function(){var b=angular.copy(a.item);return b.transport&&(b.transport=b.transport.join(",")),a.item.allow&&(b.allow=b.allow.join(";")),c.save(b).$promise.then(function(){f.path("/staff/agents/list")})["catch"](function(a){e.show(a.data.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.agents.wizard",{url:"/wizard",templateUrl:"app/staff/agent/wizard/wizard.html",controller:"AgentWizardCtrl",data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff",{url:"/staff",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("TeamCreateCtrl",["$scope","$uibModalInstance","Team","xAlert",function(a,b,c,d){a.form={},a.item={},a.ok=function(){return c.save(a.item).$promise.then(function(){b.close(a.item)})["catch"](function(a){d.show(a.data.message,"danger")})},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("TeamListCtrl",["$scope","Team","gridOptions","$uibModal",function(a,b,c,d){a.initView=function(){var d={exporterCsvFilename:"teams.csv",columnDefs:[{name:"name"},{name:"description"},{name:"action",width:125,buttons:[{"class":"{{row.entity.defaultEntry ? 'blue-hoki disabled' : 'blue-hoki'}}",href:"/staff/teams/view/{{row.entity.id}}/settings",name:"profile"},{"class":"{{row.entity.defaultEntry ? 'red-sunglo disabled' : 'red-sunglo'}}",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=c.gridOptions(b,d,a)},a.createItem=function(){d.open({animation:!0,templateUrl:"app/staff/team/list/create.modal.html",controller:"TeamCreateCtrl"}).result.then(function(){a.gridOptions.getPage()})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.teams.list",{url:"/list",templateUrl:"app/staff/team/list/list.html",controller:"TeamListCtrl"})}]),angular.module("xCallyShuttleApp").factory("Team",["$resource",function(a){return a("/api/teams/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.teams",{url:"/teams",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").controller("TeamViewCtrl",["$scope","$http","$stateParams","$translate","Team","Agent","xAlert",function(a,b,c,d,e,f,g){var h=function(){return{select:function(b){return console.log("agents",b),e.save({id:a.team.id,controller:"agents"},{agents:b})},deselect:function(b){return e["delete"]({id:a.team.id,controller:"agents",agents:b})}}};a.initView=function(){return e.get({id:c.id}).$promise.then(function(b){a.team=b})["catch"](function(a){g.show(a.message,"danger")})},a.initAgents=function(){return f.get().$promise.then(function(b){return a.agents=b.rows,e.query({id:c.id,controller:"agents"}).$promise}).then(function(b){ComponentsDropdowns.bindTeam(_.map(b,"id"),_.map(a.agents,function(a){return{id:a.id,name:a.name,fullname:a.fullname,internal:a.internal}}),h)})["catch"](function(a){g.show(a.message,"danger")})},a.updateItem=function(){var b=angular.copy(a.team);return e.update({id:c.id},b).$promise.then(function(){g.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){g.show(a.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.teams.view",{url:"/view/:id",templateUrl:"app/staff/team/view/view.html",controller:"TeamViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.staff.teams.view.agents",{url:"/agents",templateUrl:"app/staff/team/view/view.agents.html",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/jquery-multi-select/css/multi-select.css","assets/plugins/jquery-multi-select/js/jquery.multi-select.js","assets/plugins/jquery-quicksearch/jquery.quicksearch.js","assets/scripts/components-dropdowns.js"]}])}]}}).state("main.staff.teams.view.settings",{url:"/settings",templateUrl:"app/staff/team/view/view.settings.html"})}]),angular.module("xCallyShuttleApp").controller("TelephoneListCtrl",["$scope","Telephone","gridOptions",function(a,b,c){a.initView=function(){var d={exporterCsvFilename:"telephones.csv",columnDefs:[{name:"fullname"},{name:"name"},{name:"accountcode"},{name:"description"},{name:"action",width:125,buttons:[{"class":"blue-hoki",href:"/staff/telephones/view/{{row.entity.id}}/account",name:"profile"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.fullname, row.entity.id)"}]}]};a.gridOptions=c.gridOptions(b,d,a)}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.telephones.list",{url:"/list",templateUrl:"app/staff/telephone/list/list.html",controller:"TelephoneListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").factory("Telephone",["$resource",function(a){return a("/api/telephones/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.telephones",{url:"/telephones",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").controller("TelephoneViewCtrl",["$scope","$http","$stateParams","$translate","$cookieStore","Auth","xAlert","Telephone",function(a,b,c,d,e,f,g,h){a.initView=function(){a.Auth=f,a.forms={},h.get({id:c.id}).$promise.then(function(b){delete b.password,a.item=b,a.item.transport=a.item.transport?a.item.transport.split(","):[],a.item.allow=a.item.allow?a.item.allow.split(";"):[]})["catch"](function(a){g.show(a.message,"danger")})},a.updateItem=function(){var b=angular.copy(a.item);b.transport=b.transport.join(","),b.allow=b.allow.join(";"),h.update(b).$promise.then(function(){g.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){g.show(a.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.telephones.view",{url:"/view/:id",templateUrl:"app/staff/telephone/view/view.html",controller:"TelephoneViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.staff.telephones.view.account",{url:"/account",templateUrl:"app/staff/telephone/view/view.account.html",resolve:{deps:["$ocLazyLoad",function(a){return a.load({insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css","assets/scripts/jquery.sparkline.min.js","assets/plugins/bootstrap-fileinput/bootstrap-fileinput.js","assets/scripts/profile.js"]})}]}})}]),angular.module("xCallyShuttleApp").controller("TelephoneWizardCtrl",["$scope","$http","$location","WizardHandler","xAlert","$translate","Telephone",function(a,b,c,d,e,f,g){a.next=function(){d.wizard().next()},a.exitValidation=function(a){return a},a.initWizard=function(){return a.forms={},a.item={allow:["alaw","ulaw","gsm"],transport:["udp"],context:"from-sip"},g.get({id:"internal"}).$promise.then(function(b){a.item.internal=b.internal})["catch"](function(a){console.error(a)})},a.createItem=function(){var b=angular.copy(a.item);return b.transport&&(b.transport=b.transport.join(",")),a.item.allow&&(b.allow=b.allow.join(";")),g.save(b).$promise.then(function(){c.path("/staff/telephones/list")})["catch"](function(a){e.show(a.data.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.telephones.wizard",{url:"/wizard",templateUrl:"app/staff/telephone/wizard/wizard.html",controller:"TelephoneWizardCtrl"})}]),angular.module("xCallyShuttleApp").controller("UserListCtrl",["$scope","User","gridOptions",function(a,b,c){a.initView=function(){var d={exporterCsvFilename:"users.csv",columnDefs:[{name:"fullname"},{name:"name",displayName:"APPLICATION_USERNAME"},{name:"email"},{name:"description"},{name:"action",width:125,buttons:[{"class":"blue-hoki",href:"/staff/users/view/{{row.entity.id}}/account",name:"profile"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.fullname, row.entity.id)"}]}]};a.gridOptions=c.gridOptions(b,d,a)}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.users.list",{url:"/list",templateUrl:"app/staff/user/list/list.html",controller:"UserListCtrl"})}]),angular.module("xCallyShuttleApp").factory("User",["$resource",function(a){return a("/api/users/:id/:controller",{id:"@id"},{changePassword:{method:"PUT",params:{controller:"password"}},update:{method:"PUT"},me:{method:"GET",params:{id:"me"}}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.users",{url:"/users",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").controller("UserViewCtrl",["$scope","$stateParams","$cookieStore","$translate","FileUploader","User","Auth","xAlert",function(a,b,c,d,e,f,g,h){a.Auth=g,a.initView=function(){return f.get({id:b.id}).$promise.then(function(b){a.user=b,a.user.transport=a.user.transport?a.user.transport.split(","):[],a.user.allow=a.user.allow?a.user.allow.split(";"):[]})["catch"](function(a){h.show(a.message,"danger")})},a.updateItem=function(){var c=angular.copy(a.user);return delete c.password,delete c.md5secret,c.transport=c.transport.join(","),c.allow=c.allow.join(";"),f.update({id:b.id},c).$promise.then(function(){h.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){h.show(a.message,"danger")})},a.updatePassword=function(){var c={newPassword:a.user.newPwd};return g.isAdmin()?c.id=b.id:c.oldPassword=a.user.currentPwd,f.changePassword(c).$promise.then(function(){h.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){h.show(a.message,"danger")})};var i=a.uploader=new e({url:"api/users/"+b.id+"/avatar",queueLimit:1,withCredentials:!0,headers:{Authorization:"Bearer "+c.get("token")}});i.filters.push({name:"imageFilter",fn:function(a){var b="|"+a.type.slice(a.type.lastIndexOf("/")+1)+"|";return-1!=="|jpg|png|jpeg|".indexOf(b)}}),i.onSuccessItem=function(b,c){a.user.userpic=c.userpic,a.user.id===g.getCurrentUser().id&&(g.getCurrentUser().userpic=c.userpic),h.show(d.instant("MESSAGE_WELL_DONE"),"success")},i.onErrorItem=function(){h.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")},i.onCompleteAll=function(){i.clearQueue()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.users.view",{url:"/view/:id",templateUrl:"app/staff/user/view/view.html",controller:"UserViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.staff.users.view.account",{url:"/account",templateUrl:"app/staff/user/view/view.account.html",resolve:{deps:["$ocLazyLoad",function(a){return a.load({insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css","assets/scripts/jquery.sparkline.min.js","assets/plugins/bootstrap-fileinput/bootstrap-fileinput.js","assets/scripts/profile.js"]})}]}})}]),angular.module("xCallyShuttleApp").controller("UserWizardCtrl",["$scope","$location","WizardHandler","xAlert","$translate","User",function(a,b,c,d,e,f){a.forms={info:void 0,voice:void 0},a.item={role:"user",host:"dynamic",context:"from-sip"},a.next=function(){c.wizard().next()},a.exitValidation=function(a){return a},a.createItem=function(){return f.save(a.item).$promise.then(function(){b.path("/staff/users/list")})["catch"](function(a){d.show(a.data.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.users.wizard",{url:"/wizard",templateUrl:"app/staff/user/wizard/wizard.html",controller:"UserWizardCtrl"})}]),angular.module("xCallyShuttleApp").controller("SugarcrmListCtrl",["$scope","SugarcrmAccount","gridOptions","xAlert","$translate","Modal",function(a,b,c,d,e,f){a.initView=function(){var d={exporterCsvFilename:"sugarcrm_account.csv",columnDefs:[{name:"name",displayName:"APPLICATION_NAME"},{name:"username"},{name:"remoteUri",displayName:"APPLICATION_REMOTE_ADDRESS"},{name:"action",width:250,buttons:[{"class":"blue-hoki",href:"/sugarcrm/view/{{row.entity.id}}/account",name:"profile"},{"class":"green-jungle",name:"check",displayName:"APPLICATION_CHECK_CONNECTION",onClick:"grid.appScope.checkAccount(row.entity.id)"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=c.gridOptions(b,d,a)},a.checkAccount=function(a){return b.get({id:a,controller:"check"}).$promise.then(function(){d.show(e.instant("MESSAGE_ACCOUNT_VERIFIED"),"success")})["catch"](function(a){d.show(e.instant("MESSAGE_ACCOUNT_INVALID"),"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.sugarcrm.list",{url:"/list",templateUrl:"app/sugarcrm/list/list.html",controller:"SugarcrmListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.sugarcrm",{url:"/sugarcrm",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").factory("SugarcrmAccount",["$resource",function(a){return a("/api/sugarcrm/accounts/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").factory("SugarcrmConfiguration",["$resource",function(a){return a("/api/sugarcrm/configurations/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").factory("SugarcrmField",["$resource",function(a){return a("/api/sugarcrm/fields/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").controller("SugarcrmViewCtrl",["$scope","$http","$stateParams","$translate","$location","$filter","WizardHandler","socket","xAlert","Modal",function(a,b,c,d,e,f,g,h,i,j){a.$stateParams=c,a.config={autoHideScrollbar:!1,theme:"dark",advanced:{updateOnContentResize:!0},setHeight:500,scrollInertia:0},a.initConfiguration=function(){a.formsConfiguration={},a.configuration={}},a.goNext=function(){g.wizard().next()},a.formValidation=function(a){return a},a.$on("$destroy",function(){h.unsyncUpdates("sugarcrm_configuration"),h.unsyncUpdates("sugarcrm_field")}),a.initView=function(){b.get("/api/sugarcrm/accounts/"+c.id).success(function(b){a.account=b}).error(function(a){i.show(a.message,"danger")})},a.updateItem=function(){b.put("/api/sugarcrm/accounts/"+c.id,a.account).success(function(){i.show(d.instant("MESSAGE_WELL_DONE")+".","success")}).error(function(){i.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG")+".","danger")})},a.getConfigurations=function(){b.get("/api/sugarcrm/configurations",{params:{AccountId:c.id}}).success(function(b){a.configurations=b,h.socket.on("sugarcrm_configuration:remove",function(b){_.remove(a.configurations,{id:b.id})})}).error(function(a){i.show(a.message,"danger")})},a.deleteConfiguration=j.confirm["delete"](function(a){b["delete"]("api/sugarcrm/configurations/"+a).success(function(){i.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(){i.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})}),a.createConfiguration=function(){a.configuration.AccountId=c.id,b.post("api/sugarcrm/configurations",a.configuration).success(function(a){e.path("sugarcrm/view/"+c.id+"/configurations/settings/"+a.id)}).error(function(){i.show("Something went wrong!","danger")})},a.fieldType=["string","variable"],a.descFieldType=["string","key_value"],a.getFields=function(){b.get("/api/sugarcrm/accounts/"+c.id+"/fields").success(function(b){a.accountFields=_.sortByOrder(f("sugarcrm")(_.toArray(b)),"name","asc"),_.forEach(b,function(a){a.options=_.toArray(a.options)})}).error(function(a){i.show(a.message,"danger")})},a.getConfiguration=function(){b.get("/api/sugarcrm/configurations/"+c.configurationId).success(function(b){a.configurationName=b.name,a.subjectConfig=b.Subject,a.descriptionConfig=b.Description,a.fieldConfig=b.Field,h.socket.on("sugarcrm_field:remove",function(b){_.remove(a.subjectConfig,{id:b.id}),_.remove(a.descriptionConfig,{id:b.id}),_.remove(a.fieldConfig,{id:b.id})})}).error(function(a){i.show(a.message,"danger")})},a.getVariables=function(){b.get("/api/variables").success(function(b){a.variables=b.rows}).error(function(a){i.show(a.message,"danger")})},a.removeItem=function(a){b["delete"]("api/sugarcrm/fields/"+a.id).success(function(){i.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(){i.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})},a.addItemSubject=function(){var d={type:"string",content:""};b.post("/api/sugarcrm/configurations/"+c.configurationId+"/subject",d).success(function(b){a.subjectConfig.push(b)}).error(function(){i.show("Something went wrong!","danger")})},a.addItemDescription=function(){var d={type:"string",content:""};b.post("/api/sugarcrm/configurations/"+c.configurationId+"/description",d).success(function(b){a.descriptionConfig.push(b)}).error(function(){i.show("Something went wrong!","danger")})},a.addItemField=function(){var d={content:""};b.post("/api/sugarcrm/configurations/"+c.configurationId+"/field",d).success(function(b){a.fieldConfig.push(b)}).error(function(){i.show("Something went wrong!","danger")})},a.updateField=function(a){b.put("/api/sugarcrm/fields/"+a.id,a).success(function(){}).error(function(){i.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG")+".","danger")})},a.changeType=function(b){"variable"===b.type?b.content="":"string"===b.type&&(b.VariableId=null),a.updateField(b)},a.changeDescType=function(b){"key_value"===b.type?(b.content="","string"===b.keyType?b.VariableId=null:"variable"===b.keyType&&(b.keyContent="")):"string"===b.type&&(b.VariableId=null,b.key="",b.keyContent=""),a.updateField(b)},a.changeFieldType=function(b){b.content="",a.updateField(b)},a.getSystemFieldOptions=function(b){if(b){var c=_.find(a.accountFields,"name",b);return c?c.options.length>0?c.options:null:void 0}}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.sugarcrm.view",{url:"/view/:id",templateUrl:"app/sugarcrm/view/view.html",controller:"SugarcrmViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.sugarcrm.view.account",{url:"/account",templateUrl:"app/sugarcrm/view/view.account.html"}).state("main.sugarcrm.view.configurations",{url:"/configurations",templateUrl:"app/sugarcrm/view/view.configurations.html"}).state("main.sugarcrm.view.configurations.settings",{url:"/settings/:configurationId",templateUrl:"app/sugarcrm/view/view.configurationSettings.html",controller:"SugarcrmViewCtrl"}).state("main.sugarcrm.view.configuration",{url:"/configuration",templateUrl:"app/sugarcrm/view/view.configuration.html"})}]),angular.module("xCallyShuttleApp").controller("SugarcrmkWizardCtrl",["$scope","$http","$location","$translate","xAlert","WizardHandler",function(a,b,c,d,e,f){a.translate=d,a.initWizard=function(){a.$translate=d,a.forms={},a.item={}},a.next=function(){f.wizard().next()},a.exitValidation=function(a){return a},a.createItem=function(){b.post("api/sugarcrm/accounts",a.item).success(function(){e.show(d.instant("MESSAGE_WELL_DONE")+".","success"),c.path("/sugarcrm/list")}).error(function(){e.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG")+".","danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.sugarcrm.wizard",{url:"/wizard",templateUrl:"app/sugarcrm/wizard/wizard.html",controller:"SugarcrmkWizardCtrl"})}]),angular.module("xCallyShuttleApp").factory("CannedAnswer",["$resource",function(a){return a("/api/answers/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.answers",{url:"/answers",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("AnswerListCtrl",["$scope","$uibModal","CannedAnswer","gridOptions",function(a,b,c,d){a.initView=function(){var b={exporterCsvFilename:"answers.csv",columnDefs:[{name:"key",displayName:"APPLICATION_NAME"},{name:"value"},{name:"description"},{name:"action",width:160,buttons:[{"class":"blue-hoki",href:"/tools/answers/view/{{row.entity.id}}/settings",name:"settings"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.key, row.entity.id)"}]}]};a.gridOptions=d.gridOptions(c,b,a)},a.createItem=function(){b.open({animation:!0,templateUrl:"app/tools/answer/list/list.create.modal.html",controller:"AnswerListCreateCtrl"}).result.then(function(b){a.gridOptions.getPage()})}}]),angular.module("xCallyShuttleApp").controller("AnswerListCreateCtrl",["$scope","$translate","$uibModalInstance","CannedAnswer","xAlert",function(a,b,c,d,e){a.form={},a.item={},a.save=function(){return d.save(a.item).$promise.then(function(a){e.show(b.instant("MESSAGE_WELL_DONE"),"success"),c.close(a)})["catch"](function(a){e.show(a.data.message,"danger")})},a.cancel=function(){c.dismiss()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.answers.list",{url:"/list",templateUrl:"app/tools/answer/list/list.html",controller:"AnswerListCtrl"})}]),angular.module("xCallyShuttleApp").controller("AnswerViewCtrl",["$scope","$http","xAlert","$translate","$stateParams","$location","CannedAnswer",function(a,b,c,d,e,f,g){a.getAnswer=function(){return g.get({id:e.id}).$promise.then(function(b){a.answer=b})["catch"](function(a){c.show(a.data.message,"danger")})},a.updateAnswer=function(){var b=angular.copy(a.answer);return g.update({id:e.id},b).$promise.then(function(){c.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){c.show(a.data.message,"danger")})}}]),
-angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.answers.view",{url:"/view/:id",templateUrl:"app/tools/answer/view/view.html",controller:"AnswerViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.tools.answers.view.settings",{url:"/settings",templateUrl:"app/tools/answer/view/view.settings.html"})}]),angular.module("xCallyShuttleApp").factory("Automation",["$resource",function(a){return a("/api/automations/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.automations",{url:"/automations",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("AutomationListCtrl",["$scope","$http","$translate","xAlert","Automation","gridOptions",function(a,b,c,d,e,f){a.onText="On",a.offText="Off",a.isActive=!0,a.size="mini",a.animate=!0,a.radioOff=!0,a.handleWidth="auto",a.labelWidth="auto",a.inverse=!0,a.offColor="danger",a.onColor="success",a.initView=function(){var b={exporterCsvFilename:"Automations.csv",columnDefs:[{name:"name"},{name:"description"},{name:"channel"},{name:"status",cellTemplate:'<div class="centered-uigrid-td"><input data-ng-change="grid.appScope.updateItem(row.entity)", bs-switch ng-model="row.entity.status" type="checkbox" switch-active="{{ grid.appScope.isActive }}" switch-on-text="{{ grid.appScope.onText }}" switch-off-text="{{ grid.appScope.offText }}" switch-on-color="{{ grid.appScope.onColor }}" switch-off-color="{{ grid.appScope.offColor }}" switch-animate="{{ grid.appScope.animate }}" switch-size="{{ grid.appScope.size }}" switch-label="{{ grid.appScope.label }}" switch-icon="{{ grid.appScope.icon }}" switch-radio-off="{{ grid.appScope.radioOff }}" switch-label-width="{{ grid.appScope.labelWidth }}" switch-handle-width="{{ grid.appScope.handleWidth }}"></div>',width:100,enableFiltering:!1},{name:"action",width:160,buttons:[{"class":"blue-hoki",href:"/tools/automations/view/{{row.entity.id}}/settings",name:"settings"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=f.gridOptions(e,b,a)},a.updateItem=function(a){return e.update({id:a.id},a).$promise.then(function(){d.show(c.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){console.error(a),d.show(a.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.automations.list",{url:"/list",templateUrl:"app/tools/automation/list/list.html",controller:"AutomationListCtrl"})}]),angular.module("xCallyShuttleApp").controller("AutomationViewCtrl",["$scope","$stateParams","$http","$translate","xAlert","automations","Automation","$location",function(a,b,c,d,e,f,g,h){a.$automations=f,a.recordSwitch={onText:"On",offText:"Off",isActive:!0,size:"small",animate:!0,radioOff:!0,handleWidth:"auto",labelWidth:"auto",inverse:!0,offColor:"danger",onColor:"success"},a.forms={general:{}},a.addCondition=function(b){a.automation[b].push({field:"",operator:"",value:""})},a.removeCondition=function(b,c){a.automation[b].splice(c,1)},a.addAction=function(){a.automation.Actions.push({action:"",data1:"",data2:"",data3:"",data4:"",data5:""})},a.resetActionData=function(a){a.data1="",a.data2="",a.data3="",a.data4="",a.data5=""},a.removeAction=function(b){a.automation.Actions.splice(b,1)},a.initView=function(){return g.get({id:b.id}).$promise.then(function(b){a.automation=b})["catch"](function(a){e.show(a.message,"danger"),h.path("/tools/automations/list")})},a.updateAutomation=function(){return g.update({id:b.id},a.automation).$promise.then(function(){e.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){console.error(a),e.show(a.message,"danger")})},a.exitValidation=function(b){return console.log(b&&(a.automation.All.length||a.automation.Any.length)&&a.automation.Actions.length),b&&(a.automation.All.length||a.automation.Any.length)&&a.automation.Actions.length?!0:!1}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.automations.view",{url:"/view/:id",templateUrl:"app/tools/automation/view/view.html",controller:"AutomationViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load({insertBefore:"#ng_load_plugins_before",files:["assets/css/profile.css","assets/css/tasks.css"]})}]}}).state("main.tools.automations.view.settings",{url:"/settings",templateUrl:"app/tools/automation/view/view.settings.html"}).state("main.tools.automations.view.routes",{url:"/routes",templateUrl:"app/tools/automation/view/view.routes.html"}).state("main.tools.automations.view.application",{url:"/application",templateUrl:"app/tools/automation/view/view.application.html"})}]),angular.module("xCallyShuttleApp").controller("AutomationWizardCtrl",["$scope","$http","$location","xAlert","automations","WizardHandler","Automation",function(a,b,c,d,e,f,g){a.$automations=e,a.recordSwitch={onText:"On",offText:"Off",isActive:!0,size:"small",animate:!0,radioOff:!0,handleWidth:"auto",labelWidth:"auto",inverse:!0,offColor:"danger",onColor:"success"},a.tempData={voice:{},mail:{},chat:{},fax:{}},a.item={All:[],Any:[],Actions:[]},a.forms={general:void 0,settings:void 0},a.addCondition=function(b){a.item[b].push({field:"",operator:"",value:""})},a.removeCondition=function(b,c){a.item[b].splice(c,1)},a.addAction=function(){a.item.Actions.push({action:"",data1:"",data2:"",data3:"",data4:"",data5:""})},a.resetActionData=function(a){a.data1="",a.data2="",a.data3="",a.data4="",a.data5=""},a.removeAction=function(b){a.item.Actions.splice(b,1)},a.$watch("item.channel",function(b,c){c&&(a.tempData[c].All=_.clone(a.item.All,!0),a.tempData[c].Any=_.clone(a.item.Any,!0),a.tempData[c].Actions=_.clone(a.item.Actions,!0)),a.item.All=a.tempData[b].All?a.tempData[b].All:[],a.item.Any=a.tempData[b].Any?a.tempData[b].Any:[],a.item.Actions=a.tempData[b].Actions?a.tempData[b].Actions:[]},!0),a.item.channel="voice",a.createItem=function(){return g.save(a.item).$promise.then(function(){c.path("/tools/automations/list")})["catch"](function(a){console.error(a),d.show(a.message,"danger")})},a.next=function(){f.wizard().next()},a.previous=function(){f.wizard().previous()},a.exitValidation=function(a){return a},a.exitSettingsValidation=function(b){return b&&(a.item.All.length||a.item.Any.length)&&a.item.Actions.length?!0:!1}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.automations.wizard",{url:"/wizard",templateUrl:"app/tools/automation/wizard/wizard.html",controller:"AutomationWizardCtrl"})}]),angular.module("xCallyShuttleApp").factory("Interval",["$resource",function(a){return a("/api/intervals/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.intervals",{url:"/intervals",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("IntervalListCtrl",["$scope","$uibModal","Interval","gridOptions",function(a,b,c,d){a.initView=function(){var b={exporterCsvFilename:"intervals.csv",columnDefs:[{name:"name"},{name:"description"},{name:"action",width:160,buttons:[{"class":"blue-hoki",href:"/tools/intervals/view/{{row.entity.id}}/settings",name:"settings"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=d.gridOptions(c,b,a)},a.createItem=function(){var c=b.open({animation:!0,templateUrl:"app/tools/interval/list/list.create.modal.html",controller:"IntervalListCreateCtrl"});c.result.then(function(b){console.log(b),a.gridOptions.getPage()})}}]),angular.module("xCallyShuttleApp").controller("IntervalListCreateCtrl",["$scope","$translate","$uibModalInstance","Interval","xAlert",function(a,b,c,d,e){a.form={},a.item={},a.save=function(){return d.save(a.item).$promise.then(function(a){e.show(b.instant("MESSAGE_WELL_DONE"),"success"),c.close(a)})["catch"](function(a){e.show(b.instant(a.data.message),"danger")})},a.cancel=function(){c.dismiss()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.intervals.list",{url:"/list",templateUrl:"app/tools/interval/list/list.html",controller:"IntervalListCtrl"})}]),angular.module("xCallyShuttleApp").controller("IntervalViewCtrl",["$scope","$http","xAlert","$translate","$stateParams","socket","$location","WizardHandler","Modal","interval",function(a,b,c,d,e,f,g,h,i,j){function k(b){console.log(b);var c,d,e,f;c=b.t_from&&b.t_to&&!b.alwaysTime?moment(b.t_from).format("HH:mm")+"-"+moment(b.t_to).format("HH:mm"):"*",b.wd_from&&"always"!==b.wd_from?(d=b.wd_from,b.wd_to&&"always"!==b.wd_to&&(d+="-"+b.wd_to)):d="*",b.md_from&&"always"!==b.md_from?(e=b.md_from,b.md_to&&"always"!==b.md_to&&(e+="-"+b.md_to)):e="*",b.m_from&&"always"!==b.m_from?(f=b.m_from,b.m_to&&"always"!==b.m_to&&(f+="-"+b.m_to)):f="*",void 0!==a.selectedSubInterval?a.interval.SubIntervals[a.selectedSubInterval].interval=c+","+d+","+e+","+f:a.subinterval.interval=c+","+d+","+e+","+f}a.$translate=d,a.$interval=j.interval,a.selectedSubInterval=void 0,a.gridOptions={columnDefs:[{name:"name",displayName:"APPLICATION_NAME",headerCellFilter:"translate"},{name:"interval",displayName:"APPLICATION_INTERVAL",headerCellFilter:"translate"},{name:"action",displayName:"APPLICATION_ACTION",headerCellFilter:"translate",width:125,cellTemplate:'<a class="btn btn-xs blue-hoki" data-ng-click="grid.appScope.openSubInterval(grid.appScope.gridOptions.data.indexOf(row.entity))">{{\'APPLICATION_SETTINGS\' | translate}}</a><a class="btn btn-xs red-sunglo" data-ng-click="grid.appScope.deleteSubInterval(row.entity.name+\' interval\', gridOptions.data.indexOf(row.entity))">{{\'APPLICATION_DELETE\' | translate}}</a>'}]},a.forms={subinterval:void 0,general:void 0},a.initSubInterval=function(b){b&&(a.selectedSubInterval=void 0),a.subinterval={},a.splittedInterval={t_from:moment(new Date),t_to:moment(new Date),wd_from:"always",wd_to:"always",md_from:"always",md_to:"always",m_from:"always",m_to:"always",alwaysTime:!0}},a.next=function(){h.wizard().next()},a.previous=function(){h.wizard().previous()},a.exitValidation=function(a){return a},a.deselectAndRedirect=function(b){a.selectedSubInterval=void 0,g.path(b)},a.getInterval=function(){b.get("/api/intervals/"+e.id).success(function(b){a.interval=b,a.gridOptions.data=b.SubIntervals}).error(function(a){console.error(a),g.path("/tools/intervals/list")})},a.openSubInterval=function(b){a.selectedSubInterval=b,g.path("/tools/intervals/view/"+e.id+"/subintervals/settings")},a.updateInterval=function(f){a.selectedSubInterval=void 0,b.put("/api/intervals/"+e.id,a.interval).success(function(){c.show(d.instant("MESSAGE_WELL_DONE")+"!","success"),f&&g.path("/tools/intervals/view/"+e.id+"/"+f)}).error(function(a){c.show(d.instant(a.message),"danger")})},a.getSubInterval=function(){void 0===a.selectedSubInterval&&g.path("/tools/intervals/list"),a.splittedInterval={t_from:moment(new Date),t_to:moment(new Date)};var b,c=a.interval.SubIntervals[a.selectedSubInterval]?a.interval.SubIntervals[a.selectedSubInterval].interval.split(","):["*","*","*","*"];c.forEach(function(c,d){switch(d){case 0:"*"!==c?(b=c.split("-"),a.splittedInterval.t_from=moment(b[0],"HH:mm"),a.splittedInterval.t_to=moment(b[1],"HH:mm"),a.splittedInterval.alwaysTime=!1):(a.splittedInterval.t_from=moment(new Date),a.splittedInterval.t_to=moment(new Date),a.splittedInterval.alwaysTime=!0);break;case 1:"*"!==c?(b=c.split("-"),a.splittedInterval.wd_from=b[0],a.splittedInterval.wd_to=b[1]?b[1]:"always"):(a.splittedInterval.wd_from="always",a.splittedInterval.wd_to="always");break;case 2:"*"!==c?(b=c.split("-"),a.splittedInterval.md_from=b[0],a.splittedInterval.md_to=b[1]?b[1]:"always"):(a.splittedInterval.md_from="always",a.splittedInterval.md_to="always");break;case 3:"*"!==c?(b=c.split("-"),a.splittedInterval.m_from=b[0],a.splittedInterval.m_to=b[1]?b[1]:"always"):(a.splittedInterval.m_from="always",a.splittedInterval.m_to="always")}})},a.$watch("splittedInterval",function(a){a&&k(a)},!0),a.addSubInterval=function(){a.interval.SubIntervals.push(a.subinterval),a.updateInterval("subintervals")},a.deleteSubInterval=i.confirm["delete"](function(b){a.interval.SubIntervals.splice(b,1),a.updateInterval()})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.intervals.view",{url:"/view/:id",templateUrl:"app/tools/interval/view/view.html",controller:"IntervalViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.tools.intervals.view.settings",{url:"/settings",templateUrl:"app/tools/interval/view/view.settings.html"}).state("main.tools.intervals.view.subintervals",{url:"/subintervals",templateUrl:"app/tools/interval/view/view.subintervals.html"}).state("main.tools.intervals.view.subinterval",{url:"/subinterval",templateUrl:"app/tools/interval/view/view.subinterval.html"}).state("main.tools.intervals.view.subintervals.settings",{url:"/settings",templateUrl:"app/tools/interval/view/view.subintervalSettings.html"})}]),angular.module("xCallyShuttleApp").controller("PauseListCtrl",["$scope","$log","$uibModal","$translate","Pause","gridOptions",function(a,b,c,d,e,f){a.initView=function(){var b={exporterCsvFilename:"pauses.csv",columnDefs:[{name:"name"},{name:"description"},{name:"action",width:160,buttons:[{"class":"blue-hoki",href:"/tools/pauses/view/{{row.entity.id}}/settings",name:"settings"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=f.gridOptions(e,b,a)},a.createItem=function(){var b=c.open({animation:!0,templateUrl:"app/tools/pause/list/list.create.modal.html",controller:"PauseListCreateCtrl"});b.result.then(function(b){console.log(b),a.gridOptions.getPage()})}}]),angular.module("xCallyShuttleApp").controller("PauseListCreateCtrl",["$scope","$translate","$uibModalInstance","Pause","xAlert",function(a,b,c,d,e){a.form={},a.item={},a.save=function(){return d.save(a.item).$promise.then(function(a){e.show(b.instant("MESSAGE_WELL_DONE"),"success"),c.close(a)})["catch"](function(a){e.show(a.data.message,"danger")})},a.cancel=function(){c.dismiss()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.pauses.list",{url:"/list",templateUrl:"app/tools/pause/list/list.html",controller:"PauseListCtrl"})}]),angular.module("xCallyShuttleApp").factory("Pause",["$resource",function(a){return a("/api/pauses/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.pauses",{url:"/pauses",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("PauseViewCtrl",["$scope","$http","xAlert","$translate","$stateParams","$location","Pause",function(a,b,c,d,e,f,g){a.getPause=function(){return g.get({id:e.id}).$promise.then(function(b){a.pause=b})["catch"](function(a){c.show(a.data.message,"danger")})},a.updatePause=function(){var b=angular.copy(a.pause);return g.update({id:e.id},b).$promise.then(function(){c.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){c.show(a.data.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.pauses.view",{url:"/view/:id",templateUrl:"app/tools/pause/view/view.html",controller:"PauseViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.tools.pauses.view.settings",{url:"/settings",templateUrl:"app/tools/pause/view/view.settings.html"})}]),angular.module("xCallyShuttleApp").controller("SoundListCtrl",["$scope","$http","socket","Modal","$q","FileUploader","$translate","xAlert","$cookieStore","$sce","Sound",function(a,b,c,d,e,f,g,h,i,j,k){a.Sound=k,a.isCollapsed=!0,a.downloadButtonContent='<i class="icon-cloud-download"></i>',a.downloadButtonClass="btn btn-xs blue-hoki",a["delete"]=d.confirm["delete"](function(a){b["delete"]("/api/sounds/"+a).success(function(a){}).error(function(a){console.log(a)})}),a.updateAudio=function(a,c){var d=e.defer();return b.put("/api/sounds/"+a,c).success(function(a){d.resolve()}).error(function(a){console.log(a.message),d.reject(a.message)}),d.promise},a.$on("$destroy",function(){c.unsyncUpdates("sound")}),a.initList=function(){b.get("/api/sounds").success(function(b){a.sounds=b.rows,b.rows.length||(a.isCollapsed=!1),c.syncUpdates("sound",a.sounds,function(){a.sounds.length||(a.isCollapsed=!1)})}).error(function(a){})};var l=a.uploader=new f({url:"/api/sounds",withCredentials:!0,headers:{Authorization:"Bearer "+i.get("token")}});l.filters.push({name:"customFilter",fn:function(a,b){return this.queue.length<10}}),l.onWhenAddingFileFailed=function(a,b,c){console.info("onWhenAddingFileFailed",a,b,c)},l.onAfterAddingFile=function(a){console.info("onAfterAddingFile",a)},l.onAfterAddingAll=function(a){console.info("onAfterAddingAll",a)},l.onBeforeUploadItem=function(a){console.info("onBeforeUploadItem",a)},l.onProgressItem=function(a,b){console.info("onProgressItem",a,b),a.isUploading=!0},l.onProgressAll=function(a){console.info("onProgressAll",a)},l.onSuccessItem=function(a,b,c,d){console.info("onSuccessItem",a,b,c,d),a.isUploading=!1},l.onErrorItem=function(a,b,c,d){console.info("onErrorItem",a,b,c,d),a.responseMessage=b,a.isUploading=!1},l.onCancelItem=function(a,b,c,d){console.info("onCancelItem",a,b,c,d),a.isUploading=!1},l.onCompleteItem=function(a,b,c,d){console.info("onCompleteItem",a,b,c,d),a.isUploading=!1},l.onCompleteAll=function(){console.info("onCompleteAll")},console.info("uploader",l)}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.sounds.list",{url:"/list",templateUrl:"app/tools/sound/list/list.html",controller:"SoundListCtrl",authenticate:!0,resolve:{deps:["$ocLazyLoad",function(a){return a.load({insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/plugins/bootstrap-fileinput/bootstrap-fileinput.js"]})}]}})}]),angular.module("xCallyShuttleApp").factory("Sound",["$resource",function(a){return a("/api/sounds/:id/:controller",{name:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.sounds",{url:"/sounds",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("TagListCtrl",["$scope","$uibModal","Tag","gridOptions",function(a,b,c,d){a.initView=function(){var b={exporterCsvFilename:"tag.csv",columnDefs:[{name:"name"},{name:"description"},{name:"action",width:160,buttons:[{"class":"blue-hoki",href:"/tools/tags/view/{{row.entity.id}}/settings",name:"settings"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=d.gridOptions(c,b,a)},a.createItem=function(){var c=b.open({animation:!0,templateUrl:"app/tools/tag/list/list.create.modal.html",controller:"TagListCreateCtrl"});c.result.then(function(b){console.log(b),a.gridOptions.getPage()})}}]),angular.module("xCallyShuttleApp").controller("TagListCreateCtrl",["$scope","$translate","$uibModalInstance","Tag","xAlert",function(a,b,c,d,e){a.form={},a.item={},a.save=function(){return d.save(a.item).$promise.then(function(a){e.show(b.instant("MESSAGE_WELL_DONE"),"success"),c.close(a)})["catch"](function(a){e.show(a.data.message,"danger")})},a.cancel=function(){c.dismiss()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.tags.list",{url:"/list",templateUrl:"app/tools/tag/list/list.html",controller:"TagListCtrl"})}]),angular.module("xCallyShuttleApp").factory("Tag",["$resource",function(a){return a("/api/tags/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.tags",{url:"/tags",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("TagViewCtrl",["$scope","$http","xAlert","$translate","$stateParams","$location","Tag",function(a,b,c,d,e,f,g){a.getTag=function(){return g.get({id:e.id}).$promise.then(function(b){a.tag=b})["catch"](function(a){c.show(a.data.message,"danger")})},a.updateTag=function(){var b=angular.copy(a.tag);return g.update({id:e.id},b).$promise.then(function(){c.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){c.show(a.data.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.tags.view",{url:"/view/:id",templateUrl:"app/tools/tag/view/view.html",controller:"TagViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.tools.tags.view.settings",{url:"/settings",templateUrl:"app/tools/tag/view/view.settings.html"})}]),angular.module("xCallyShuttleApp").controller("TemplateListCtrl",["$scope","Template","gridOptions",function(a,b,c){a.initView=function(){var d={exporterCsvFilename:"templates.csv",columnDefs:[{name:"name"},{name:"description"},{name:"action",width:125,buttons:[{"class":"blue-hoki",href:"/tools/templates/view/{{row.entity.id}}/settings",name:"profile"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=c.gridOptions(b,d,a)}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.templates.list",{url:"/list",templateUrl:"app/tools/template/list/list.html",controller:"TemplateListCtrl"})}]),angular.module("xCallyShuttleApp").factory("Template",["$resource",function(a){return a("/api/mail/templates/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.templates",{url:"/templates",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("TemplateViewCtrl",["$scope","$http","$translate","$stateParams","xAlert","Template",function(a,b,c,d,e,f){a.initItem=function(){a.form={},a.item={},a.groups=[{title:"Voice",variables:[]},{title:"Chat",variables:["username","email","text","chatWebsite"]},{title:"Mail",variables:[]},{title:"Fax",variables:[]}],a.item=f.get({id:d.id})},a.updateItem=function(){f.update(a.item).$promise.then(function(){e.show(c.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){e.show(a.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.templates.view",{url:"/view/:id",templateUrl:"app/tools/template/view/view.html",controller:"TemplateViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.tools.templates.view.settings",{url:"/settings",templateUrl:"app/tools/template/view/view.settings.html"})}]),angular.module("xCallyShuttleApp").controller("TemplateWizardCtrl",["$scope","$location","$http","WizardHandler","xAlert","Template",function(a,b,c,d,e,f){a.initWizard=function(){a.item={},a.form={},a.groups=[{title:"Voice",variables:[]},{title:"Chat",variables:["username","email","text","chatWebsite"]},{title:"Mail",variables:[]},{title:"Fax",variables:[]}]},a.next=function(){d.wizard().next()},a.exitValidation=function(a){return a},a.createItem=function(){return f.save({name:a.item.name,description:a.item.description,subject:a.item.subject||null,html:a.item.html||null,text:a.item.text||null}).$promise.then(function(){b.path("/tools/templates/list")})["catch"](function(a){e.show(data.err.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.templates.wizard",{url:"/wizard",templateUrl:"app/tools/template/wizard/wizard.html",controller:"TemplateWizardCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools",{url:"/tools",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").controller("TriggerListCtrl",["$scope","$http","$translate","Modal","xAlert","Trigger","gridOptions",function(a,b,c,d,e,f,g){a.onText="On",a.offText="Off",a.isActive=!0,a.size="mini",a.animate=!0,a.radioOff=!0,a.handleWidth="auto",a.labelWidth="auto",a.inverse=!0,a.offColor="danger",a.onColor="success",a.initView=function(){var b={exporterCsvFilename:"Triggers.csv",columnDefs:[{name:"name"},{name:"description"},{name:"channel"},{name:"status",cellTemplate:'<div class="centered-uigrid-td"><input data-ng-change="grid.appScope.updateItem(row.entity)", bs-switch ng-model="row.entity.status" type="checkbox" switch-active="{{ grid.appScope.isActive }}" switch-on-text="{{ grid.appScope.onText }}" switch-off-text="{{ grid.appScope.offText }}" switch-on-color="{{ grid.appScope.onColor }}" switch-off-color="{{ grid.appScope.offColor }}" switch-animate="{{ grid.appScope.animate }}" switch-size="{{ grid.appScope.size }}" switch-label="{{ grid.appScope.label }}" switch-icon="{{ grid.appScope.icon }}" switch-radio-off="{{ grid.appScope.radioOff }}" switch-label-width="{{ grid.appScope.labelWidth }}" switch-handle-width="{{ grid.appScope.handleWidth }}"></div>',width:100,enableFiltering:!1},{name:"action",width:160,buttons:[{"class":"blue-hoki",href:"/tools/triggers/view/{{row.entity.id}}/settings",name:"settings"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=g.gridOptions(f,b,a)},a.updateItem=function(a){return f.update({id:a.id},a).$promise.then(function(){e.show(c.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){console.error(a),e.show(a.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.triggers.list",{url:"/list",templateUrl:"app/tools/trigger/list/list.html",controller:"TriggerListCtrl"})}]),angular.module("xCallyShuttleApp").factory("Trigger",["$resource",function(a){return a("/api/triggers/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.triggers",{url:"/triggers",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("TriggerViewCtrl",["$scope","$stateParams","$translate","xAlert","triggers","Trigger","$location",function(a,b,c,d,e,f,g){a.$triggers=e,a.recordSwitch={onText:"On",offText:"Off",isActive:!0,size:"small",animate:!0,radioOff:!0,handleWidth:"auto",labelWidth:"auto",inverse:!0,offColor:"danger",onColor:"success"},a.forms={general:{}},a.addCondition=function(b){a.trigger[b].push({field:"",operator:"",value:""})},a.removeCondition=function(b,c){a.trigger[b].splice(c,1)},a.addAction=function(){a.trigger.Actions.push({action:"",data1:"",data2:"",data3:"",data4:"",data5:""})},a.resetActionData=function(a){a.data1="",a.data2="",a.data3="",a.data4="",a.data5=""},a.removeAction=function(b){a.trigger.Actions.splice(b,1)},a.initView=function(){return f.get({id:b.id}).$promise.then(function(b){a.trigger=b})["catch"](function(a){d.show(a.message,"danger"),g.path("/tools/triggers/list")})},a.updateTrigger=function(){return f.update({id:b.id},a.trigger).$promise.then(function(){d.show(c.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){console.error(a),d.show(a.message,"danger")})},a.exitValidation=function(b){return console.log(b&&(a.trigger.All.length||a.trigger.Any.length)&&a.trigger.Actions.length),b&&(a.trigger.All.length||a.trigger.Any.length)&&a.trigger.Actions.length?!0:!1}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.triggers.view",{url:"/view/:id",templateUrl:"app/tools/trigger/view/view.html",controller:"TriggerViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load({insertBefore:"#ng_load_plugins_before",files:["assets/css/profile.css","assets/css/tasks.css"]})}]}}).state("main.tools.triggers.view.settings",{url:"/settings",templateUrl:"app/tools/trigger/view/view.settings.html"}).state("main.tools.triggers.view.routes",{url:"/routes",templateUrl:"app/tools/trigger/view/view.routes.html"}).state("main.tools.triggers.view.application",{url:"/application",templateUrl:"app/tools/trigger/view/view.application.html"})}]),angular.module("xCallyShuttleApp").controller("TriggerWizardCtrl",["$scope","$http","$location","xAlert","triggers","WizardHandler","Trigger",function(a,b,c,d,e,f,g){a.$triggers=e,a.tempData={voice:{},mail:{},chat:{},fax:{}},a.item={All:[],Any:[],Actions:[]},a.forms={general:void 0,settings:void 0},a.addCondition=function(b){a.item[b].push({field:"",operator:"",value:""})},a.removeCondition=function(b,c){a.item[b].splice(c,1)},a.addAction=function(){a.item.Actions.push({action:"",data1:"",data2:"",data3:"",data4:"",data5:""})},a.resetActionData=function(a){a.data1="",a.data2="",a.data3="",a.data4="",a.data5=""},a.removeAction=function(b){a.item.Actions.splice(b,1)},a.$watch("item.channel",function(b,c){c&&(a.tempData[c].All=_.clone(a.item.All,!0),a.tempData[c].Any=_.clone(a.item.Any,!0),a.tempData[c].Actions=_.clone(a.item.Actions,!0)),a.item.All=a.tempData[b].All?a.tempData[b].All:[],a.item.Any=a.tempData[b].Any?a.tempData[b].Any:[],a.item.Actions=a.tempData[b].Actions?a.tempData[b].Actions:[]},!0),a.item.channel="voice",a.createItem=function(){return g.save(a.item).$promise.then(function(){c.path("/tools/triggers/list")})["catch"](function(a){console.error(a),d.show(a.message,"danger")})},a.next=function(){f.wizard().next()},a.previous=function(){f.wizard().previous()},a.exitValidation=function(a){return a},a.exitSettingsValidation=function(b){return b&&(a.item.All.length||a.item.Any.length)&&a.item.Actions.length?!0:!1}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.triggers.wizard",{url:"/wizard",templateUrl:"app/tools/trigger/wizard/wizard.html",controller:"TriggerWizardCtrl"})}]),angular.module("xCallyShuttleApp").controller("TrunkListCtrl",["$scope","Trunk","gridOptions",function(a,b,c){a.initView=function(){var d={exporterCsvFilename:"Trunks.csv",columnDefs:[{name:"name"},{name:"host"},{name:"context"},{name:"description"},{name:"action",width:160,buttons:[{"class":"blue-hoki",href:"/tools/trunks/view/{{row.entity.name}}/settings",name:"settings"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.name)"}]}]};a.gridOptions=c.gridOptions(b,d,a)}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.trunks.list",{url:"/list",templateUrl:"app/tools/trunk/list/list.html",controller:"TrunkListCtrl"})}]),angular.module("xCallyShuttleApp").factory("Trunk",["$resource",function(a){return a("/api/trunks/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.trunks",{url:"/trunks",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("TrunkViewCtrl",["$scope","$http","xAlert","$translate","$stateParams","socket","$location","Trunk","VoiceContext",function(a,b,c,d,e,f,g,h,i){
-a.initView=function(){return h.get({id:e.id}).$promise.then(function(b){b.nat=b.nat?b.nat.split(","):[],b.allow=b.allow?b.allow.split(";"):[],b.insecure=b.insecure?b.insecure.split(","):[],b.transport=b.transport?b.transport.split(","):[],a.trunk=b})["catch"](function(a){console.error(a),g.path("/tools/trunks/list")})},a.updateTrunk=function(){""===a.trunk.password&&delete a.trunk.password;var b=angular.copy(a.trunk);return b.nat=b.nat.join(","),b.allow=b.allow.join(";"),b.insecure=b.insecure.join(","),b.transport=b.transport.join(","),h.update({id:e.id},b).$promise.then(function(){c.show(d.instant("MESSAGE_WELL_DONE")+"!","success")})["catch"](function(a){c.show(a.data.message,"danger")})},a.getContexts=function(){return i.get().$promise.then(function(b){a.voiceContexts=b.rows})["catch"](function(a){c.show(a.data.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.trunks.view",{url:"/view/:id",templateUrl:"app/tools/trunk/view/view.html",controller:"TrunkViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.tools.trunks.view.settings",{url:"/settings",templateUrl:"app/tools/trunk/view/view.settings.html"})}]),angular.module("xCallyShuttleApp").controller("TrunkWizardCtrl",["$scope","$http","WizardHandler","$location","xAlert","socket","$translate",function(a,b,c,d,e,f,g){a.initWizard=function(){a.forms={},a.item={context:"from-voip-provider"}},a.next=function(d){d?b.post("/api/trunks/validate/",a.item).success(function(a){console.log(a),a.length?e.show(g.instant("MESSAGE_EXIST_TRUNK"),"danger"):c.wizard().next()}).error(function(a){e.show(g.instant(a.message),"danger")}):c.wizard().next()},a.previous=function(){c.wizard().previous()},a.exitValidation=function(a){return a},a.createItem=function(){b.post("/api/trunks/",a.item).success(function(){d.path("/tools/trunks/list")}).error(function(a){e.show(a.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.trunks.wizard",{url:"/wizard",templateUrl:"app/tools/trunk/wizard/wizard.html",controller:"TrunkWizardCtrl"})}]),angular.module("xCallyShuttleApp").controller("VariableListCtrl",["$scope","$uibModal","Variable","gridOptions",function(a,b,c,d){a.initView=function(){var b={exporterCsvFilename:"variables.csv",columnDefs:[{name:"name"},{name:"description"},{name:"action",width:160,buttons:[{"class":"blue-hoki",href:"/tools/variables/view/{{row.entity.id}}/settings",name:"settings"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=d.gridOptions(c,b,a)},a.createItem=function(){var c=b.open({animation:!0,templateUrl:"app/tools/variable/list/list.create.modal.html",controller:"VariableListCreateCtrl"});c.result.then(function(b){console.log(b),a.gridOptions.getPage()})}}]),angular.module("xCallyShuttleApp").controller("VariableListCreateCtrl",["$scope","$translate","$uibModalInstance","Variable","xAlert",function(a,b,c,d,e){a.form={},a.item={},a.save=function(){return d.save(a.item).$promise.then(function(a){e.show(b.instant("MESSAGE_WELL_DONE"),"success"),c.close(a)})["catch"](function(a){e.show(a.data.message,"danger")})},a.cancel=function(){c.dismiss()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.variables.list",{url:"/list",templateUrl:"app/tools/variable/list/list.html",controller:"VariableListCtrl"})}]),angular.module("xCallyShuttleApp").factory("Variable",["$resource",function(a){return a("/api/variables/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.variables",{url:"/variables",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("VariableViewCtrl",["$scope","$translate","$stateParams","xAlert","Variable",function(a,b,c,d,e){a.getVariable=function(){return e.get({id:c.id}).$promise.then(function(b){a.variable=b})["catch"](function(a){d.show(a.data.message,"danger")})},a.updateVariable=function(){return e.update({id:c.id},a.variable).$promise.then(function(){d.show(b.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){d.show(a.data.message,"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.variables.view",{url:"/view/:id",templateUrl:"app/tools/variable/view/view.html",controller:"VariableViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.tools.variables.view.settings",{url:"/settings",templateUrl:"app/tools/variable/view/view.settings.html"})}]),angular.module("xCallyShuttleApp").controller("YourdashboardListCloneModalCtrl",["$scope","$uibModalInstance",function(a,b){a.forms={dashboard:void 0},a.item={},a.ok=function(){b.close(a.item)},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("YourdashboardListCreateModalCtrl",["$scope","$uibModalInstance",function(a,b){a.forms={dashboard:void 0},a.item={},a.ok=function(){a.item.model=JSON.stringify({title:a.item.name}),b.close(a.item)},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("YourdashboardListCtrl",["$scope","$http","$translate","xAlert","Modal","$uibModal","$log","YourDashboard","gridOptions",function(a,b,c,d,e,f,g,h,i){a.initView=function(){var b={exporterCsvFilename:"voice_contexts.csv",columnDefs:[{name:"name"},{name:"description"},{name:"action",width:220,buttons:[{"class":"green",href:"/tools/yourdashboards/show/{{row.entity.id}}",name:"view"},{"class":"blue-hoki",href:"/tools/yourdashboards/view/{{row.entity.id}}/settings",name:"settings"},{"class":"{{row.entity.defaultEntry ? 'red-sunglo disabled' : 'red-sunglo'}}",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"},{"class":"purple",name:"clone",onClick:"grid.appScope.clone(row.entity.id)"}]}]};a.gridOptions=i.gridOptions(h,b,a)},a.create=function(){var b=f.open({animation:!0,templateUrl:"app/tools/yourdashboard/list/create.modal.html",controller:"YourdashboardListCreateModalCtrl"});b.result.then(function(b){return h.save(b).$promise.then(function(){d.show(c.instant("MESSAGE_WELL_DONE"),"success"),a.gridOptions.getPage()})["catch"](function(a){console.error(a),d.show(a.message,"danger")})},function(){g.info("Modal dismissed at: "+new Date)})},a.clone=function(b){var e=f.open({animation:!0,templateUrl:"app/tools/yourdashboard/list/clone.modal.html",controller:"YourdashboardListCloneModalCtrl"});e.result.then(function(e){return h.save({id:b,controller:"clone"},e).$promise.then(function(){d.show(c.instant("MESSAGE_WELL_DONE"),"success"),a.gridOptions.getPage()})["catch"](function(a){console.error(a),d.show(a.message,"danger")})},function(){g.info("Modal dismissed at: "+new Date)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.yourdashboards.list",{url:"/list",templateUrl:"app/tools/yourdashboard/list/list.html",controller:"YourdashboardListCtrl"})}]),angular.module("xCallyShuttleApp").controller("YourdashboardShowCtrl",["$scope","localStorageService","$http","xAlert","$translate","Auth","$stateParams","$location",function(a,b,c,d,e,f,g,h){a.Auth=f,a.getDashboard=function(){c.get("/api/dashboards/"+g.id).success(function(b){var c={name:"dashboard",structure:"4-8",enableconfirmdelete:!0,maximizable:!0,collapsible:!0};b.model=JSON.parse(b.model||'{"title":"Dashboard"}'),b.editable=f.isAdmin()&&b.editable?!0:!1,a.dashboard=_.merge(c,b)}).error(function(a){h.path("/tools/yourdashboards/list")})};var i=function(b,f,h){var i=angular.copy(a.dashboard);i.name=a.dashboard.model.title,i.model=JSON.stringify(i.model),c.put("/api/dashboards/"+g.id,i).success(function(){d.show(e.instant("MESSAGE_DASHBOARD_SAVED")+"!","success")}).error(function(b){d.show(b.message,"danger"),i.model=JSON.parse(i.model),i.name="dashboard",a.dashboard=i})};a.$on("adfDashboardChanged",i),a.$on("destroy",function(){console.log("main dashboard")})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.yourdashboards.show",{url:"/show/:id",templateUrl:"app/tools/yourdashboard/show/show.html",controller:"YourdashboardShowCtrl"})}]),angular.module("xCallyShuttleApp").controller("YourdashboardViewCtrl",["$scope","$http","xAlert","$translate","$stateParams","$location",function(a,b,c,d,e,f){a.radioSwitch={isActive:!0,size:"small",animate:!0,radioOff:!0,handleWidth:"auto",labelWidth:"auto",inverse:!0,offColor:"danger",onColor:"success"},a.getDashboard=function(){b.get("/api/dashboards/"+e.id).success(function(b){delete b.model,a.dashboard=b}).error(function(a){f.path("/tools/yourdashboards/list")})},a.updateDashboard=function(){var f=angular.copy(a.dashboard);b.put("/api/dashboards/"+e.id,f).success(function(){c.show(d.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(b){c.show(d.instant(b.message),"danger"),a.dashboard=f})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.yourdashboards.view",{url:"/view/:id",templateUrl:"app/tools/yourdashboard/view/view.html",controller:"YourdashboardViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.tools.yourdashboards.view.settings",{url:"/settings",templateUrl:"app/tools/yourdashboard/view/view.settings.html"})}]),angular.module("xCallyShuttleApp").factory("YourDashboard",["$resource",function(a){return a("/api/dashboards/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.yourdashboards",{url:"/yourdashboards",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("ZendeskListCtrl",["$scope","ZendeskAccount","gridOptions","xAlert","$translate",function(a,b,c,d,e){a.initView=function(){var d={exporterCsvFilename:"zendesk_account.csv",columnDefs:[{name:"name",displayName:"APPLICATION_NAME"},{name:"username"},{name:"remoteUri",displayName:"APPLICATION_REMOTE_ADDRESS"},{name:"action",width:250,buttons:[{"class":"blue-hoki",href:"/zendesk/view/{{row.entity.id}}/account",name:"profile"},{"class":"green-jungle",name:"check",displayName:"APPLICATION_CHECK_CONNECTION",onClick:"grid.appScope.checkAccount(row.entity.id)"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=c.gridOptions(b,d,a)},a.checkAccount=function(a){return b.check({id:a}).$promise.then(function(){d.show(e.instant("MESSAGE_ACCOUNT_VERIFIED"),"success")})["catch"](function(){d.show(e.instant("MESSAGE_ACCOUNT_INVALID"),"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.zendesk.list",{url:"/list",templateUrl:"app/zendesk/list/list.html",controller:"ZendeskListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.zendesk.view.configurations",{url:"/configurations",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("ZendeskViewConfigurationListCtrl",["$scope","$stateParams","$translate","gridOptions","ZendeskConfiguration","$uibModal","xAlert",function(a,b,c,d,e,f,g){a.initView=function(){var c={exporterCsvFilename:"zendesk_configurations.csv",columnDefs:[{name:"name"},{name:"description"},{name:"action",width:125,buttons:[{"class":"blue-hoki",href:"/zendesk/view/{{row.entity.AccountId}}/configurations/view/{{row.entity.id}}",name:"profile"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=d.gridOptions(e,c,a,{accountId:b.id})},a.createItem=function(){var c=f.open({animation:!0,templateUrl:"app/zendesk/view/configuration/list/create.modal.html",controller:["$scope","$uibModalInstance",function(a,b){a.form={},a.item={},a.ok=function(){b.close(a.item)},a.cancel=function(){b.dismiss("cancel")}}]});c.result.then(function(c){return e.save({accountId:b.id},c).$promise.then(function(){a.gridOptions.getPage()})["catch"](function(a){g.show(a.data.message,"danger")})})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.zendesk.view.configurations.list",{url:"/list",templateUrl:"app/zendesk/view/configuration/list/list.html",controller:"ZendeskViewConfigurationListCtrl"})}]),angular.module("xCallyShuttleApp").controller("ZendeskViewConfigurationViewCtrl",["$scope","$stateParams","$filter","$translate","socket","ZendeskConfiguration","xAlert","variable","Variable","ZendeskAccount","Tag","ZendeskField",function(a,b,c,d,e,f,g,h,i,j,k,l){a.$on("$destroy",function(){e.unsyncUpdates("zendesk_field")}),a.config={autoHideScrollbar:!1,theme:"dark",advanced:{updateOnContentResize:!0},setHeight:300,scrollInertia:0},a.fieldType=[{type:"string",title:"String"},{type:"variable",title:"Variable"},{type:"customVariable",title:"Custom Variable"}],a.descFieldType=[{type:"string",title:"String"},{type:"keyValue",title:"Key Value"}],a.initView=function(){a.configurationName="",a.subjectConfig=[],a.descriptionConfig=[],a.fieldConfig=[],a.selectedTags={tags:[]},a.variables=h},a.getConfiguration=function(){return f.get({accountId:b.id,id:b.configurationId}).$promise.then(function(b){a.configurationName=b.name,a.subjectConfig=b.Subject,a.descriptionConfig=b.Description,a.fieldConfig=b.Field,a.selectedTags={tags:_.map(b.Tags,function(a){return a.id})},e.socket.on("zendesk_field:remove",function(b){_.remove(a.subjectConfig,{id:b.id}),_.remove(a.descriptionConfig,{id:b.id}),_.remove(a.fieldConfig,{id:b.id})})})["catch"](function(a){g.show(a.message,"danger")})},a.getCustomVariables=function(){return i.get().$promise.then(function(b){a.customVariables=b.rows})["catch"](function(a){g.show(a.message,"danger")})},a.getFields=function(){return j.fields({id:b.id}).$promise.then(function(b){a.accountFields=c("zendesk")(b)})["catch"](function(a){g.show(a.message,"danger")})},a.getTags=function(){return k.get().$promise.then(function(b){a.tags=b.rows})["catch"](function(a){g.show(a.message,"danger")})},a.addItem=function(c){switch(c){case"subject":case"description":var d={type:"string",content:""};break;case"field":var d={content:""}}return f.save({accountId:b.id,id:b.configurationId,controller:c},d).$promise.then(function(b){switch(c){case"subject":a.subjectConfig.push(b);break;case"description":a.descriptionConfig.push(b);break;case"field":a.fieldConfig.push(b)}})["catch"](function(a){g.show(a.data.message,"danger")})},a.changeType=function(b){"variable"===b.type?(b.content="",b.variableName=""):"string"===b.type?(b.VariableId=null,b.variableName=""):"customVariable"===b.type&&(b.VariableId=null,b.content=""),a.updateField(b)},a.updateField=function(a){return l.update({accountId:b.id,configurationId:b.configurationId,id:a.id},a).$promise.then(function(){})["catch"](function(){g.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG")+".","danger")})},a.removeItem=function(a){return l["delete"]({accountId:b.id,configurationId:b.configurationId,id:a.id}).$promise.then(function(){g.show(d.instant("MESSAGE_WELL_DONE")+"!","success")})["catch"](function(){g.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})},a.changeDescType=function(b){"keyValue"===b.type?(b.content="","string"===b.keyType?(b.VariableId=null,b.variableName=""):"variable"===b.keyType?(b.keyContent="",b.VariableId=null):"customVariable"===b.keyType&&(b.keyContent="",b.variableName="")):"string"===b.type&&(b.VariableId=null,b.variableName="",b.key="",b.keyContent=""),a.updateField(b)},a.changeFieldType=function(b){if(b.content="",b.variableName="",b.nameField="",b.VariableId=null,b.idField){var c=_.find(a.accountFields,"id",b.idField);c&&(c.system_field_options?(b.customField=!1,b.nameField=c.title.toLowerCase()):b.customField=!0)}a.updateField(b)},a.updateTags=function(){return f.update({accountId:b.id,id:b.configurationId,controller:"tags"},a.selectedTags.tags).$promise.then(function(){g.show(d.instant("MESSAGE_WELL_DONE")+".","success")})["catch"](function(a){g.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG")+".","danger")})},a.getSystemFieldOptions=function(b){if(b){var c=_.find(a.accountFields,"id",b);return c?c.system_field_options?c.system_field_options:null:void 0}}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.zendesk.view.configurations.view",{url:"/view/:configurationId",templateUrl:"app/zendesk/view/configuration/view/view.html",controller:"ZendeskViewConfigurationViewCtrl"})}]),angular.module("xCallyShuttleApp").controller("ZendeskViewCtrl",["$scope","$stateParams","$translate","xAlert","Modal","ZendeskAccount",function(a,b,c,d,e,f){a.initView=function(){return f.get({id:b.id}).$promise.then(function(b){a.account=b})["catch"](function(a){d.show(a.message,"danger")})},a.updateItem=function(){return f.update({id:b.id},a.account).$promise.then(function(){d.show(c.instant("MESSAGE_WELL_DONE")+".","success")})["catch"](function(){d.show(c.instant("MESSAGE_SOMETHING_WENT_WRONG")+".","danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.zendesk.view",{url:"/view/:id",templateUrl:"app/zendesk/view/view.html",controller:"ZendeskViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.zendesk.view.account",{url:"/account",templateUrl:"app/zendesk/view/view.account.html"})}]),angular.module("xCallyShuttleApp").controller("ZendeskWizardCtrl",["$scope","$http","$location","$translate","xAlert","WizardHandler","ZendeskAccount",function(a,b,c,d,e,f,g){a.translate=d,a.initWizard=function(){a.$translate=d,a.forms={},a.item={},a.item.authType="password"},a.next=function(){f.wizard().next()},a.exitValidation=function(a){return a},a.createItem=function(){return g.save(a.item).$promise.then(function(){e.show(d.instant("MESSAGE_WELL_DONE")+".","success"),c.path("/zendesk/list")})["catch"](function(){e.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG")+".","danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.zendesk.wizard",{url:"/wizard",templateUrl:"app/zendesk/wizard/wizard.html",controller:"ZendeskWizardCtrl"})}]),angular.module("xCallyShuttleApp").factory("ZendeskAccount",["$resource",function(a){return a("/api/zendesk/accounts/:id/:controller",{id:"@id"},{update:{method:"PUT"},fields:{params:{controller:"fields"},isArray:!0},check:{params:{controller:"check"}}})}]).factory("ZendeskConfiguration",["$resource",function(a){return a("/api/zendesk/accounts/:accountId/configurations/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]).factory("ZendeskField",["$resource",function(a){return a("/api/zendesk/accounts/:accountId/configurations/:configurationId/fields/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.zendesk",{url:"/zendesk",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").service("application",function(){var a={applications:[{name:"Queue",value:"Queue"},{name:"Playback",value:"Playback"},{name:"Dial",value:"Dial"},{name:"Cally-Square IVR",value:"AGI"},{name:"GoTo",value:"Goto"},{name:"Hangup",value:"Hangup"},{name:"Set",value:"Set"},{name:"Custom",value:"custom"},{name:"VoiceMail",value:"Voicemail"}],queueOptions:[{value:"C",name:"APPLICATION_QUEUE_OPTION_C"},{value:"c",name:"APPLICATION_QUEUE_OPTION_c"},{value:"d",name:"APPLICATION_QUEUE_OPTION_d"},{value:"F",name:"APPLICATION_QUEUE_OPTION_F"},{value:"h",name:"APPLICATION_QUEUE_OPTION_h"},{value:"H",name:"APPLICATION_QUEUE_OPTION_H"},{value:"n",name:"APPLICATION_QUEUE_OPTION_n"},{value:"i",name:"APPLICATION_QUEUE_OPTION_i"},{value:"I",name:"APPLICATION_QUEUE_OPTION_I"},{value:"r",name:"APPLICATION_QUEUE_OPTION_r"},{value:"R",name:"APPLICATION_QUEUE_OPTION_R"},{value:"t",name:"APPLICATION_QUEUE_OPTION_t"},{value:"T",name:"APPLICATION_QUEUE_OPTION_T"},{value:"w",name:"APPLICATION_QUEUE_OPTION_w"},{value:"W",name:"APPLICATION_QUEUE_OPTION_W"},{value:"k",name:"APPLICATION_QUEUE_OPTION_k"},{value:"K",name:"APPLICATION_QUEUE_OPTION_K"},{value:"x",name:"APPLICATION_QUEUE_OPTION_x"},{value:"X",name:"APPLICATION_QUEUE_OPTION_X"}],audioOptions:[{value:"skip",name:"APPLICATION_PLAYBACK_OPTION_SKIP"},{value:"noanswer",name:"APPLICATION_PLAYBACK_OPTION_NOANSWER"},{value:"j",name:"APPLICATION_PLAYBACK_OPTION_J"},{value:"say",name:"APPLICATION_PLAYBACK_OPTION_SAY"}],hangupCauses:[{value:"",name:"--"},{value:"1",name:"APPLICATION_HANGUP_CAUSE_1"},{value:"16",name:"APPLICATION_HANGUP_CAUSE_16"},{value:"17",name:"APPLICATION_HANGUP_CAUSE_17"},{value:"18",name:"APPLICATION_HANGUP_CAUSE_18"},{value:"21",name:"APPLICATION_HANGUP_CAUSE_21"},{value:"22",name:"APPLICATION_HANGUP_CAUSE_22"},{value:"27",name:"APPLICATION_HANGUP_CAUSE_27"},{value:"38",name:"APPLICATION_HANGUP_CAUSE_38"},{value:"41",name:"APPLICATION_HANGUP_CAUSE_41"}],intTypes:[{value:"always",name:"APPLICATION_ALWAYS"},{value:"custom",name:"APPLICATION_CUSTOM"},{value:"list",name:"APPLICATION_FROM_LIST"}],checkUnderscore:function(a){return 0===a.indexOf("_")?a:"_"+a}};return{application:a}}),angular.module("xCallyShuttleApp").factory("Auth",["$location","$rootScope","$http","User","$cookieStore","$q",function(a,b,c,d,e,f){var g={};return e.get("token")&&(g=d.me()),{login:function(a,h){var i=h||angular.noop,j=f.defer();return c.post("/auth/local",{name:a.name,password:a.password,remember:a.remember}).success(function(a){return e.put("role",a.role),e.put("token",a.token),e.put("userId",a.userId),g=d.me({},function(){b.$broadcast("login")}),j.resolve(a),i()}).error(function(a){return this.logout(),j.reject(a),i(a)}.bind(this)),j.promise},loginWithToken:function(a,b,c){e.put("token",a),e.put("userId",b),e.put("name",c),g=d.me()},logout:function(){c.put("/api/users/"+g.id,{online:!1}).success(function(){e.remove("role"),e.remove("token"),e.remove("userId"),g={},b.$broadcast("logout")}).error(function(a){return a})},createUser:function(a,b){var c=b||angular.noop;return d.save(a,function(b){return e.put("token",b.token),g=d.me(),c(a)},function(a){return this.logout(),c(a)}.bind(this)).$promise},changePassword:function(a,b,c){var e=c||angular.noop;return d.changePassword({id:g.id},{oldPassword:a,newPassword:b},function(a){return e(null,a)},function(a){return e(a)}).$promise},getCurrentUser:function(){return g},isLoggedIn:function(){return g.hasOwnProperty("role")},isLoggedInAsync:function(a){g.hasOwnProperty("$promise")?g.$promise.then(function(){a(!0)})["catch"](function(){a(!1)}):a(g.hasOwnProperty("role")?!0:!1)},isAdmin:function(){return"admin"===(e.get("role")||g.role)||"user"===(e.get("role")||g.role)},getRole:function(){return g.role},getToken:function(){return e.get("token")},getUserId:function(){return console.log(e.get("userId")),e.get("userId")},getName:function(){return e.get("name")}}}]),angular.module("xCallyShuttleApp").service("automations",function(){var a={voice:{conditions:[],actions:[]},mail:{conditions:[{name:"APPLICATION_STATUS",value:"status",type:"select",arr:[{name:"APPLICATION_STATUS_NEW",value:"NEW"},{name:"APPLICATION_STATUS_OPEN",value:"OPEN"},{name:"APPLICATION_STATUS_CLOSED",value:"CLOSED"}],operators:[{value:"equals",name:"APPLICATION_EQUALS_TO"},{value:"not_equals",name:"APPLICATION_NOT_EQUALS_TO"}]},{name:"APPLICATION_HOURS_SINCE_CREATED",value:"createdAt",type:"input",operators:[{value:"greater_or_equal",name:"APPLICATION_GTE_TO"},{value:"less_or_equal",name:"APPLICATION_LTE_TO"},{value:"greater",name:"APPLICATION_GREATER_THAN"},{value:"less",name:"APPLICATION_LESS_THAN"}]}],actions:[{name:"APPLICATION_STATUS",value:"status"}]},chat:{conditions:[{name:"APPLICATION_STATUS",value:"status",type:"select",arr:[{name:"APPLICATION_STATUS_NEW",value:"NEW"},{name:"APPLICATION_STATUS_OPEN",value:"OPEN"},{name:"APPLICATION_STATUS_CLOSED",value:"CLOSED"}],operators:[{value:"equals",name:"APPLICATION_EQUALS_TO"},{value:"not_equals",name:"APPLICATION_NOT_EQUALS_TO"}]},{name:"APPLICATION_HOURS_SINCE_CREATED",value:"createdAt",type:"input",operators:[{value:"greater_or_equal",name:"APPLICATION_GTE_TO"},{value:"less_or_equal",name:"APPLICATION_LTE_TO"},{value:"greater",name:"APPLICATION_GREATER_THAN"},{value:"less",name:"APPLICATION_LESS_THAN"}]}],actions:[{name:"APPLICATION_STATUS",value:"status"}]},fax:{conditions:[{name:"APPLICATION_STATUS",value:"status",type:"select",arr:[{name:"APPLICATION_STATUS_NEW",value:"NEW"},{name:"APPLICATION_STATUS_OPEN",value:"OPEN"},{name:"APPLICATION_STATUS_CLOSED",value:"CLOSED"}],operators:[{value:"equals",name:"APPLICATION_EQUALS_TO"},{value:"not_equals",name:"APPLICATION_NOT_EQUALS_TO"}]},{name:"APPLICATION_HOURS_SINCE_CREATED",value:"createdAt",type:"input",operators:[{value:"greater_or_equal",name:"APPLICATION_GTE_TO"},{value:"less_or_equal",name:"APPLICATION_LTE_TO"},{value:"greater",name:"APPLICATION_GREATER_THAN"},{value:"less",name:"APPLICATION_LESS_THAN"}]}],actions:[{name:"APPLICATION_STATUS",value:"status"}]}},b=["voice","mail","chat","fax"];return{services:a,channels:b}}),angular.module("xCallyShuttleApp").service("desk_com",function(){var a=[{id:"priority",label:"Priority",custom:!1,data:{choices:[1,2,3,4,5,6,7,8,9,10]}},{id:"status",label:"Status",custom:!1,data:{choices:["new","open","pending","resolved","closed"]}},{id:"type",label:"Type",custom:!1,data:{choices:["chat","twitter","email","qna","facebook","phone"]}}];return{fields:a}}),angular.module("xCallyShuttleApp").controller("FooterController",["$scope","$http",function(a,b){a.year=moment().year(),a.$on("$includeContentLoaded",function(){Layout.initFooter()}),a.initFooter=function(){b.get("/api/settings/info").success(function(b){a.info=b}).error(function(a){console.error(a)})}}]),angular.module("xCallyShuttleApp").controller("HeaderController",["$scope","$rootScope","$location","$state","$http","$notification","Auth","xAlert","socket","ngAudio","settings","toastr","localStorageService","MailReport","ChatReport",function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){a.toggleQuickSidebar=function(){k.layout.pageQuickSidebarOpened=!k.layout.pageQuickSidebarOpened,k.layout.pageQuickSidebarOpened||m.remove("chatRoomId")},a.toogleSidebar=function(){k.layout.pageSidebarClosed=!k.layout.pageSidebarClosed,m.set("sidebarClosed",k.layout.pageSidebarClosed)},a.initHeader=function(){var c=j.load("api/xchatty/assets?resource=notification/xc_blubb.mp3"),d={};"agent"===g.getCurrentUser().role&&(i.socket.on("report_mail:save",function(a){c.play();var d=f("MAIL CHANNEL",{icon:"assets/images/media/channels/mail64.png",body:"NEW Incoming Mail Message!",delay:1e3*a.timeslot});d.$on("click",function(){return n.get({id:a.id,controller1:"accept",controller2:a.uniqueid}).$promise.then(function(){h.show("Mail properly assigned","success"),b.$broadcast("mailMessageEvent",{message:"Mail properly assigned.."})})["catch"](function(a){h.show(a.data.message,"danger")})})}),i.socket.on("report_chat:save",function(a){c.play(),d[a.uniqueid]&&(d[a.uniqueid].close(),delete d[a.uniqueid]),d[a.uniqueid]=f("CHAT CHANNEL",{icon:"assets/images/media/channels/chat64.png",body:"NEW Incoming Chat Visitor!",delay:1e3*a.timeslot}),d[a.uniqueid].$on("click",function(){return o.get({id:a.id,controller1:"accept",controller2:a.uniqueid}).$promise.then(function(){h.show("Chat properly assigned","success"),b.$broadcast("mailMessageEvent",{message:"Chat properly assigned.."})})["catch"](function(a){h.show(a.data.message,"danger")})})}),i.socket.on("chat_message:save",function(a){c.play();var d=m.get("chatRoomId");if((!d||d!==a.ChatRoomId)&&a.UserId&&a.UserId!==g.getCurrentUser().id){var e=f(a.User.fullname,{icon:"assets/images/media/channels/chat64.png",body:a.body.length>35?a.body.substring(0,35)+"...":a.body,delay:1e4});e.$on("click",function(){b.$broadcast("chatMessageEvent",{chatRoomId:a.ChatRoomId})})}}),i.socket.on("user_has_chat_room:save",function(a){c.play(),b.$broadcast("chatGroupEvent",a)})),e({url:"/api/fax/user_has_queues",method:"GET",params:{UserId:g.getCurrentUser().id}}).success(function(b){a.faxQueues=_.map(b,"FaxQueueId"),a.faxQueues.forEach(function(a){i.socket.on("FAX:QUEUE:"+a,function(a,b){var c=f("FAX CHANNEL",{icon:"assets/images/media/channels/telephone124.png",body:"NEW Incoming Fax Message!",delay:1e3*a.timeout});c.$on("click",function(){e.put("/api/fax/rooms/"+a.roomId,{UserId:g.getCurrentUser().id}).success(function(){c.close(),b(g.getCurrentUser().id),l.success("Fax properly assigned","Success",{closeButton:!0,timeOut:5e3})}).error(function(){l.warning("Fax already assigned","Warning",{closeButton:!0,timeOut:5e3})})})})}),i.socket.on("FAX:AGENT:"+g.getCurrentUser().id,function(a,b){var c=f("FAX CHANNEL",{icon:"assets/images/media/channels/telephone124.png",body:"NEW Incoming Fax Message!",delay:1e3*a.timeout});c.$on("click",function(){e.put("/api/fax/rooms/"+a.roomId,{UserId:g.getCurrentUser().id}).success(function(){c.close(),b(g.getCurrentUser().id),l.success("Fax properly assigned","Success",{closeButton:!0,timeOut:5e3})}).error(function(){b(g.getCurrentUser().id),l.warning("Fax already assigned","Warning",{closeButton:!0,timeOut:5e3})})})})}).error(function(a){console.error(a)}),i.socket.on("user_has_fax_queue:save",function(b){b=_.map(b,function(a){return a.UserId=parseInt(a.UserId,10),a}),b=_.find(b,{UserId:g.getCurrentUser().id}),b&&-1===_.indexOf(a.faxQueues,b.FaxQueueId)&&(a.faxQueues.push(b.FaxQueueId),i.socket.on("FAX:QUEUE:"+b.FaxQueueId,function(a,b){var c=f("FAX CHANNEL",{icon:"assets/images/media/channels/telephone124.png",body:"NEW Incoming Fax Message!",delay:1e3*a.timeout});c.$on("click",function(){e.put("/api/fax/rooms/"+a.roomId,{UserId:g.getCurrentUser().id}).success(function(){c.close(),b(g.getCurrentUser().id),l.success("Fax properly assigned","Success",{closeButton:!0,timeOut:5e3})}).error(function(){b(g.getCurrentUser().id),l.warning("Fax already assigned","Warning",{closeButton:!0,timeOut:5e3})})})}))}),i.socket.on("user_has_fax_queue:remove",function(b){_.indexOf(b.where.UserId,g.getCurrentUser().id.toString())>=0&&_.indexOf(a.faxQueues,b.where.FaxQueueId)>=0&&(a.faxQueues=_.remove(a.faxQueues,b.where.FaxQueueId),i.socket.removeAllListeners("FAX:QUEUE:"+b.where.FaxQueueId))})},a.logout=function(){e.get("/auth/local/logout").success(function(){g.logout(),c.path("/login")}).error(function(a){console.error(a)})},a.isActive=function(a){return a===c.path()}}]),angular.module("xCallyShuttleApp").service("interval",function(){var a={months:[{value:"always",name:"APPLICATION_ALWAYS"},{value:"jan",name:"APPLICATION_JANUARY"},{value:"feb",name:"APPLICATION_FEBRUARY"},{value:"mar",name:"APPLICATION_MARCH"},{value:"apr",name:"APPLICATION_APRIL"},{value:"may",name:"APPLICATION_MAY"},{value:"jun",name:"APPLICATION_JUNE"},{value:"jul",name:"APPLICATION_JULY"},{value:"aug",name:"APPLICATION_AUGUST"},{value:"sep",name:"APPLICATION_SEPTEMBER"},{value:"oct",name:"APPLICATION_OCTOBER"},{value:"nov",name:"APPLICATION_NOVEMBER"},{value:"dec",name:"APPLICATION_DECEMBER"}],daysOfWeek:[{value:"always",name:"APPLICATION_ALWAYS"},{value:"mon",name:"APPLICATION_MONDAY"},{value:"tue",name:"APPLICATION_TUESDAY"},{value:"wed",name:"APPLICATION_WEDNESDAY"
-},{value:"thu",name:"APPLICATION_THURSDAY"},{value:"fri",name:"APPLICATION_FRIDAY"},{value:"sat",name:"APPLICATION_SATURDAY"},{value:"sun",name:"APPLICATION_SUNDAY"}],daysOfMonth:["always",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{interval:a}}),angular.module("xCallyShuttleApp").factory("Modal",["$rootScope","$uibModal",function(a,b){function c(c,d){console.log("openModal",d);var e=a.$new();return c=c||{},d=d||"modal-default",angular.extend(e,c),b.open({templateUrl:"components/modal/delete.html",windowClass:d,scope:e})}return{confirm:{"delete":function(a){return a=a||angular.noop,function(){console.log(Array.prototype.slice.call(arguments));var b,d=Array.prototype.slice.call(arguments),e=d.shift();b=c({modal:{dismissable:!0,title:"Confirm Delete",html:"<p>Are you sure you want to delete"+(e?"<strong> "+e+"</strong>":" selected items")+"?</p>",buttons:[{classes:"btn red",text:"Delete",click:function(a){b.close(a)}},{classes:"btn default",text:"Cancel",click:function(a){b.dismiss(a)}}]}},"over-topbar center"),b.result.then(function(b){a.apply(b,d)})}}}}}]),angular.module("xCallyShuttleApp").controller("QuickSidebarControllerAddModal",["$scope","$uibModalInstance","Agent","items",function(a,b,c,d){a.items=d,a.agents=c.get(function(b){a.agents=b,a.items.forEach(function(b){_.remove(a.agents.rows,{id:b.id})})}),a.selected={items:[]},a.modal={title:"APPLICATION_AGENTS_SELECTION"},a.ok=function(){b.close(_.union(_.map(a.selected.items,"id"),_.map(a.items,"id")))},a.cancel=function(){b.dismiss()}}]),angular.module("xCallyShuttleApp").controller("QuickSidebarControllerCloseModal",["$scope","$uibModalInstance",function(a,b){a.modal={title:"APPLICATION_CONFIRM_CLOSE",text:"MESSAGE_ARE_YOU_SURE_YOU_WANT_TO_CLOSE_THE_CHAT"},a.ok=function(){b.close()},a.cancel=function(){b.dismiss()}}]),angular.module("xCallyShuttleApp").controller("QuickSidebarController",["$scope","$rootScope","$window","$http","$uibModal","$log","$timeout","$interval","Auth","Agent","User","ChatRoom","ChatMessage","socket","settings","localStorageService","xAlert","$translate","QuickSidebarFactory",function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s){a.emojiMessage={},a.options=s.options,a.message={body:"",user:""};var t=a.currentUser=i.getCurrentUser(),u=function(b){switch(a.messagesTab=!0,o.layout.pageQuickSidebarOpened=!0,p.set("chatRoomId",b.id),p.set("messagesTab",a.messagesTab),a.chatRoom=b,b.type){case"internal":a.currentTab=0;break;case"external":a.currentTab=2,_.find(a.chatRooms,{id:b.id})||a.chatRooms.push(b)}b.Users.length>2&&(a.currentTab=3),g(function(){angular.element("page-quick-sidebar-chat-user-messages").mCustomScrollbar("scrollTo","last")},1500)},v=function(a){console.error(a)};a.$on("$includeContentLoaded",function(){p.get("chatRoomId")&&l.get({id:p.get("chatRoomId")},u,v),p.get("currentTab")&&(a.currentTab=p.get("currentTab"))}),a.agents=j.get({offset:0,limit:1e3},function(){n.syncUpdates("agent",a.agents.rows)}),a.users=k.get({offset:0,limit:1e3},function(){n.syncUpdates("user",a.users.rows)}),a.currentTab=0,a.messagesTab=!1,a.chatRooms=l.me(function(b){a.chatRooms=b},function(a){console.error(a)}),n.socket.on("report_chat:assignment",function(a){a.agentid&&l.get({id:a.chatroomid},u,v)}),n.socket.on("chat_room:save",function(b){if(a.chatRoom&&a.chatRoom.id===b.id){_.merge(a.chatRoom,b);var c=_.find(a.chatRooms,{id:b.id});c&&_.merge(c,b)}}),n.socket.on("chat_message:save",function(b){a.chatRoom&&a.chatRoom.id===b.ChatRoomId&&(a.chatRoom.ChatMessages.push(b),angular.element("page-quick-sidebar-chat-user-messages").mCustomScrollbar("scrollTo","last"))}),n.socket.on("user_has_chat_room:save",function(b){var c=_.findIndex(a.chatRooms,{id:b.id});c>=0?a.chatRooms[c]=b:a.chatRooms.push(b)}),b.$on("chatMessageEvent",function(a,b){l.get({id:b.chatRoomId},u,v)}),b.$on("chatGroupEvent",function(b,c){a.currentTab=3,a.messagesTab=!0,o.layout.pageQuickSidebarOpened=!0,a.chatRoom=c}),a.goToTab=function(b){a.currentTab=b,a.messagesTab=!1,a.chatRoom=null,p.set("currentTab",a.currentTab),p.set("messagesTab",a.messagesTab),p.remove("chatRoomId")},a.goToMessage=function(a,b){a?l.users({users:[t.id,a]},u,v):l.get({id:b},u,v)},a.sendMessage=function(){a.message.body.trim().length&&m.save({ChatRoomId:a.chatRoom.id,body:a.message.body},function(){a.message.body=""},function(a){console.error(a)})},a.goBack=function(){a.messagesTab=!1,a.chatRoom=null,p.set("messagesTab",a.messagesTab),p.remove("chatRoomId")},a.closeChatRoom=function(a,b){var c=e.open({animation:!0,size:b,templateUrl:"components/quickSidebar/modal/close.html",controller:"QuickSidebarControllerCloseModal"});c.result.then(function(){l.update({id:a,status:"CLOSED",completeReason:"agent"}).$promise.then(function(){q.show(r.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){q.show(a.data.message,"danger")})})},a.addAgent=function(b,c){var f=e.open({animation:!0,size:c,templateUrl:"components/quickSidebar/modal/add.html",controller:"QuickSidebarControllerAddModal",resolve:{items:function(){return _.map(a.chatRoom.Users?a.chatRoom.Users:[],function(a){return{id:a.id,fullname:a.fullname}})}}});f.result.then(function(a){d.put("/api/chat/rooms/"+b+"/users",{users:a}).then(function(){q.show(r.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){q.show(a.data.message,"danger")})})};var w=function(){var b=angular.element(c),d=function(){return{h:b.height(),w:b.width()}};a.$watch(d,function(b){a.style={height:b.h-46-46-46+"px"},a.style2={height:b.h-46-46-46-180+"px"}},!0),b.bind("resize",function(){a.$apply()})};w(),a.$on("$destroy",function(){n.unsyncUpdates("agent"),n.unsyncUpdates("user")})}]),angular.module("xCallyShuttleApp").directive("resizeQuickSidebar",["$window",function(a){return function(b){var c=angular.element(a);b.getWindowDimensions=function(){return{h:c.height(),w:c.width()}},b.$watch(b.getWindowDimensions,function(a){b.style={height:a.h-46-46-46+"px"}},!0),c.bind("resize",function(){b.$apply()})}}]),angular.module("xCallyShuttleApp").factory("QuickSidebarFactory",function(){return{options:{link:!0,linkTarget:"_blank",pdf:{embed:!1},image:{embed:!0},audio:{embed:!0},code:{highlight:!0,lineNumbers:!1},basicVideo:!1,video:{embed:!1,width:null,height:null,ytTheme:"dark",details:!1,ytAuthKey:"_nkO9h1A7HlVyiUICO17oA"}}}}),angular.module("xCallyShuttleApp").filter("QuickSidebarFilterUsersGreaterThan",function(){return function(a,b){var c=[];return a.forEach(function(a){var d=0;a.ChatVisitor&&d++,d+=a.Users.length,d>b&&c.push(a)}),c}}).filter("QuickSidebarFilterUsersLowerThan",function(){return function(a,b){var c=[];return a.forEach(function(a){a.Users.length<b&&c.push(a)}),c}}),angular.module("xCallyShuttleApp").controller("SidebarController",["$scope","$rootScope","$resource","$location","Auth","$http","xAlert","$stateParams","socket",function(a,b,c,d,e,f,g,h,i){a.Auth=e,a.$stateParams=h,a.$on("$includeContentLoaded",function(){Metronic.init(),Layout.initSidebar()}),a.isAssociated=function(a){if(e.isAdmin())return!0;if(e.getCurrentUser().Modules)for(var b=0;b<e.getCurrentUser().Modules.length;b++)if(e.getCurrentUser().Modules[b].name===a)return!0;return!1},a.getSidebarDashboards=function(){f.get("/api/dashboards").then(function(b){a.dashboards=b.data.rows,i.syncUpdates("dashboard",a.dashboards)})["catch"](function(a){g.show("Error loading your dashboards","danger")})},a.getSidebarIntegrations=function(){f.get("/api/integrations").success(function(b){a.integrations=b.rows,i.syncUpdates("integration",a.integrations)}).error(function(a){g.show(a.message,"danger")})},a.isActive=function(a){return a===d.path()},a.$on("destroy",function(){i.unsyncUpdates("dashboard"),i.unsyncUpdates("integration")})}]),angular.module("xCallyShuttleApp").factory("socket",["$rootScope","$window","socketFactory","Auth",function(a,b,c,d){var e=d.getCurrentUser(),f=io("",{query:"token="+d.getToken()+"&userId="+(e.id||d.getUserId())+"&name="+(e.name||d.getName())+"&role="+(e.role||"agent")+"&source=browser",path:"/socket.io-client"}),g=c({ioSocket:f});return a.$on("logout",function(){g&&(g.disconnect(!0),b.location.reload())}),{socket:g,syncUpdates:function(a,b,c){c=c||angular.noop,g.on(a+":save",function(a){var d=_.find(b,{id:a.id}),e=b.indexOf(d),f="created";d?(_.merge(b[e],a),f="updated"):b.unshift(a),c(f,a,b)}),g.on(a+":remove",function(a){var d="deleted";_.remove(b,{id:a.id}),c(d,a,b)})},unsyncUpdates:function(a){g.removeAllListeners(a+":save"),g.removeAllListeners(a+":remove")},syncUpdatesByAttributes:function(a,b,c,d){d=d||angular.noop,g.on(a+":save",function(a){var e=!0;if(_.forIn(b,function(b,c){return a[c]&&a[c]===b?!0:e=!1}),e){var f=_.find(c,{id:a.id}),g=c.indexOf(f),h="created";f?(_.merge(c[g],a),h="updated"):c.unshift(a),d(h,a,c)}}),g.on(a+":remove",function(a){var b="deleted";_.remove(c,{id:a.id}),d(b,a,c)})},syncMailMessageUpdates:function(a,b,c,d){d=d||angular.noop,g.on(a+":"+b+":save",function(a){var b=_.find(c,{id:a.id}),e=c.indexOf(b),f="created";b?(_.merge(c[e],a),f="updated"):c.unshift(a),d(f,a)}),g.on(a+":"+b+":remove",function(a){var b="deleted";_.remove(c,{id:a.id}),d(b,a,c)})},unsyncMailMessageUpdates:function(a,b){g.removeAllListeners(a+":"+b+":save"),g.removeAllListeners(a+":"+b+":remove")},syncFaxMessageUpdates:function(a,b,c,d){d=d||angular.noop,g.on(a+":"+b+":save",function(a){var b=_.find(c,{id:a.id}),e=c.indexOf(b),f="created";b?(_.merge(c[e],a),f="updated"):c.unshift(a),d(f,a)}),g.on(a+":"+b+":remove",function(a){var b="deleted";_.remove(c,{id:a.id}),d(b,a,c)})},unsyncFaxMessageUpdates:function(a,b){g.removeAllListeners(a+":"+b+":save"),g.removeAllListeners(a+":"+b+":remove")}}}]),angular.module("xCallyShuttleApp").service("triggers",["VoiceQueue",function(a){var b={voice:{conditions:[{name:"APPLICATION_QUEUE",value:"queue",type:"select",resource:a,resValue:"name",operators:[{value:"equals",name:"APPLICATION_EQUALS_TO"},{value:"not_equals",name:"APPLICATION_NOT_EQUALS_TO"}]},{name:"APPLICATION_CALL_STATUS",value:"lastevent",type:"select",arr:[{name:"called",value:"called"},{name:"connect",value:"connect"},{name:"complete",value:"complete"},{name:"rejected",value:"rejected"},{name:"abandoned",value:"abandoned"}],operators:[{value:"equals",name:"APPLICATION_EQUALS_TO"},{value:"not_equals",name:"APPLICATION_NOT_EQUALS_TO"}]}],actions:[{name:"APPLICATION_CONTACT_MANAGER",value:"contactManager"},{name:"APPLICATION_INTEGRATIONS",value:"integration",propertyField:"select"}]},mail:{conditions:[{name:"APPLICATION_FROM",value:"from",type:"input",operators:[{value:"equals",name:"APPLICATION_EQUALS_TO"},{value:"not_equals",name:"APPLICATION_NOT_EQUALS_TO"}]},{name:"APPLICATION_CC",value:"cc",type:"input",operators:[{value:"equals",name:"APPLICATION_EQUALS_TO"},{value:"not_equals",name:"APPLICATION_NOT_EQUALS_TO"}]},{name:"APPLICATION_SUBJECT",value:"subject",type:"input",operators:[{value:"equals",name:"APPLICATION_EQUALS_TO"},{value:"not_equals",name:"APPLICATION_NOT_EQUALS_TO"}]}],actions:[{name:"APPLICATION_TEMPLATE",value:"template"},{name:"APPLICATION_CONTACT_MANAGER",value:"contactManager"}]},chat:{conditions:[],actions:[]},fax:{conditions:[],actions:[]}},c=["voice","mail","chat","fax"];return{services:b,channels:c}}]),angular.module("xCallyShuttleApp").service("variable",function(){var a=[{title:"Unique ID",name:"uniqueid",group:"voice_queue"},{title:"Caller Number",name:"calleridnum",group:"voice_queue"},{title:"Caller Name",name:"calleridname",group:"voice_queue"},{title:"Queue",name:"queue",group:"voice_queue"},{title:"Called Number",name:"destcalleridnum",group:"voice_queue"},{title:"Called Name",name:"destcalleridname",group:"voice_queue"},{title:"Hold Time",name:"holdtime",group:"voice_queue"},{title:"Talk Time",name:"talktime",group:"voice_queue"},{title:"Connected Time",name:"agentconnectAt",group:"voice_queue"},{title:"Called Time",name:"agentcalledAt",group:"voice_queue"},{title:"DNID",name:"destexten",group:"voice_queue"},{title:"Complete Time",name:"agentcompleteAt",group:"voice_queue"},{title:"No Answer Time",name:"agentringnoanswerAt",group:"voice_queue"}];return a}),function(a,b){angular.module("adf.widget.counter",["adf.provider"]).config(["dashboardProvider",function(a){a.widget("counter",{title:"Single Value",description:"Single Value for db results",templateUrl:"{widgetsPath}/counter/src/view.html",controller:"apiwidgetCounterViewCtrl",edit:{templateUrl:"{widgetsPath}/counter/src/edit.html",controller:"apiwidgetCounterEditCtrl"}})}]).service("apiServiceCounter",["Widget",function(a){return{get:function(b){return a.get({select:b.select,condition:encodeURIComponent(b.condition),table:b.report,controller:"counter"}).$promise.then(function(a){return a})["catch"](function(a){console.log(a)})}}}]).controller("apiwidgetCounterEditCtrl",["$scope",function(a){a.config.reportTables=[{name:"Agents",value:"report_agent"},{name:"Calls",value:"report_call"},{name:"Dials",value:"report_dial"},{name:"Queues",value:"report_queue"},{name:"Users",value:"users"},{name:"Chat Sessions",value:"report_chat_session"},{name:"Mail Sessions",value:"report_mail_session"}],a.config.colors=[{name:"Blue",value:"blue-madison"},{name:"Red",value:"red-intense"},{name:"Green",value:"green-haze"},{name:"Purple",value:"purple-plum"},{name:"Orange",value:"yellow-casablanca"},{name:"Yellow",value:"yellow-crusta"}],a.config.icons=[{name:"Talk bubbles",value:"fa-comments"},{name:"Bar Chart",value:"fa-bar-chart"},{name:"Shopping Cart",value:"fa-shopping-cart"},{name:"Globe",value:"fa-globe"}],a.config.select=a.config.select?a.config.select:"COUNT(*)",a.config.timeout=a.config.timeout?a.config.timeout:1,a.config.color=a.config.color?a.config.color:"blue-madison",a.config.icon=a.config.icon?a.config.icon:"fa-comments",a.config.link=a.config.link?a.config.link:"#",a.config.linkText=a.config.linkText?a.config.linkText:"VIEW MORE"}]).controller("apiwidgetCounterViewCtrl",["$scope","$interval","apiServiceCounter",function(a,b,c){a.config.timeout=a.config.timeout?a.config.timeout:1,a.config.condition=a.config.condition?a.config.condition:null,a.config.color=a.config.color?a.config.color:"blue-madison",a.config.icon=a.config.icon?a.config.icon:"fa-comments",a.config.link=a.config.link?a.config.link:"#",a.config.linkText=a.config.linkText?a.config.linkText:"VIEW MORE",a.counterApiCall=function(){a.config.report&&c.get(a.config).then(function(b){b?b.result&&b.result.length>1||_.keys(b.result[0]).length>1?(a.tooManyResults=!0,a.result=null):(a.tooManyResults=!1,null!==_.values(b.result[0])[0]?a.result=_.values(b.result[0])[0].toString():a.result="--"):a.result=null})},a.counterApiCall();var d=b(function(){a.counterApiCall()},1e3*parseInt(a.config.timeout));a.$on("$destroy",function(){b.cancel(d)})}]),angular.module("adf.widget.counter").run(["$templateCache",function(a){a.put("{widgetsPath}/counter/src/edit.html","<form role=form><div class=form-group><label for=select>Select</label> <input type=text class=form-control id=condition ng-model=config.select placeholder=Select></div><div class=form-group><label class=control-label>From</label><ui-select data-ng-model=config.report name=report theme=bootstrap><ui-select-match placeholder=From>{{$select.selected.name}}</ui-select-match><ui-select-choices repeat=\"report.value as report in config.reportTables | filter: $select.search\"><div ng-bind-html=\"report.name | highlight: $select.search\"></div></ui-select-choices></ui-select></div><div class=form-group><label for=condition>Where</label> <input type=text class=form-control id=condition ng-model=config.condition placeholder=Where></div><div class=form-group><label for=condition>{{'APPLICATION_REFRESH_TIMEOUT' | translate}}</label> <input type=number class=form-control id=timeout ng-model=config.timeout placeholder=\"{{'APPLICATION_REFRESH_TIMEOUT' | translate}}\" min=1></div><div class=form-group><label class=control-label>{{'APPLICATION_WIDGET_COLOR' | translate}}</label><ui-select data-ng-model=config.color name=color theme=bootstrap><ui-select-match placeholder=\"{{ 'APPLICATION_WIDGET_COLOR' | translate }}\">{{$select.selected.name}}</ui-select-match><ui-select-choices repeat=\"color.value as color in config.colors | filter: $select.search\"><div ng-bind-html=\"color.name | highlight: $select.search\"></div></ui-select-choices></ui-select></div><div class=form-group><label class=control-label>{{'APPLICATION_WIDGET_ICON' | translate}}</label><ui-select data-ng-model=config.icon name=icon theme=bootstrap><ui-select-match placeholder=\"{{ 'APPLICATION_WIDGET_ICON' | translate }}\">{{$select.selected.name}}</ui-select-match><ui-select-choices repeat=\"icon.value as icon in config.icons | filter: $select.search\"><div ng-bind-html=\"icon.name | highlight: $select.search\"></div></ui-select-choices></ui-select></div><div class=form-group><label for=condition>{{'APPLICATION_WIDGET_DETAILS' | translate}}</label> <input type=text class=form-control id=details ng-model=config.details maxlength=30 placeholder=\"{{'APPLICATION_WIDGET_DETAILS' | translate}}\"></div><div class=form-group><label for=condition>{{'APPLICATION_WIDGET_LINK' | translate}}</label> <input type=text class=form-control id=link ng-model=config.link placeholder=http://yourlink></div><div class=form-group><label for=condition>{{'APPLICATION_WIDGET_LINK_TEXT' | translate}}</label> <input type=text class=form-control id=linkText ng-model=config.linkText maxlength=30 placeholder=\"{{'APPLICATION_WIDGET_LINK_TEXT' | translate}}\"></div></form>"),a.put("{widgetsPath}/counter/src/view.html",'<div class=dashboard-stat ng-class=config.color ng-if=result><div class=visual><i class=fa ng-class=config.icon></i></div><div class=details><div class=number>{{result}}</div><div class=desc>{{config.details}}</div></div><a class=more href={{config.link}}>{{config.linkText}} <i class="m-icon-swapright m-icon-white"></i></a></div><div class="alert alert-danger" role=alert ng-if=!config.report><span class="glyphicon glyphicon-exclamation-sign" aria-hidden=true></span> <span class=sr-only>{{\'APPLICATION_ERROR\' | translate}}:</span> {{\'MESSAGE_WIDGET_SELECT_REPORT\' | translate}}</div><div class="alert alert-danger" role=alert ng-if=tooManyResults><span class="glyphicon glyphicon-exclamation-sign" aria-hidden=true></span> <span class=sr-only>{{\'APPLICATION_ERROR\' | translate}}:</span> {{\'MESSAGE_TOO_MANY_RESULTS\' | translate}}</div><div class="alert alert-danger" role=alert ng-if="!result && !tooManyResults"><span class="glyphicon glyphicon-exclamation-sign" aria-hidden=true></span> <span class=sr-only>{{\'APPLICATION_ERROR\' | translate}}:</span> {{\'MESSAGE_QUERY_NOT_VALID\' | translate}}</div>')}])}(window),function(a,b){angular.module("adf.widget.pie-chart",["adf.provider"]).config(["dashboardProvider",function(a){a.widget("pie-chart",{title:"Pie-Chart",description:"Display a pie-chart starting from DB values",templateUrl:"{widgetsPath}/pie-chart/src/view.html",controller:"apiWidgetPieChartViewCtrl",edit:{templateUrl:"{widgetsPath}/pie-chart/src/edit.html",controller:"apiWidgetPieChartEditCtrl"}})}]).service("apiServicePieChart",["Widget",function(a){return{get:function(b){return a.get({condition:encodeURIComponent(b.condition),table:b.report,fields:b.fields,controller:"piechart"}).$promise.then(function(a){return a})["catch"](function(a){console.log(a)})}}}]).controller("apiWidgetPieChartEditCtrl",["$scope",function(a){function b(){return a.config.fields||(a.config.fields=[{column:"",alias:""}]),a.config.fields}a.config.reportTables=[{name:"Agents",value:"report_agent"},{name:"Calls",value:"report_call"},{name:"Dials",value:"report_dial"},{name:"Queues",value:"report_queue"},{name:"Users",value:"users"},{name:"Chat Sessions",value:"report_chat_session"},{name:"Mail Sessions",value:"report_mail_session"}],a.config.timeout=a.config.timeout?a.config.timeout:1,a.config.fields=a.config.fields?a.config.fields:[{column:"",alias:""}],a.addField=function(){b().push({})},a.removeField=function(a){b().splice(a,1)}}]).controller("apiWidgetPieChartViewCtrl",["$scope","$interval","apiServicePieChart",function(a,b,c){a.config.timeout=a.config.timeout?a.config.timeout:1,a.pieChartApiCall=function(){a.config.report&&a.config.fields.length&&""!==a.config.fields[0].column&&""!==a.config.fields[0].alias&&c.get(a.config).then(function(b){if(b&&b.result&&1===b.result.length){a.labels=[],a.data=[];for(var c in b.result[0])a.labels.push(c),a.data.push(b.result[0][c])}else a.labels=[],a.data=[]})},a.pieChartApiCall();var d=b(function(){a.pieChartApiCall()},1e3*parseInt(a.config.timeout));a.$on("$destroy",function(){b.cancel(d)})}]),angular.module("adf.widget.pie-chart").run(["$templateCache",function(a){a.put("{widgetsPath}/pie-chart/src/edit.html",'<form role=form><div class=form-group><label class=control-label>{{\'APPLICATION_REPORT\' | translate}}</label><ui-select data-ng-model=config.report name=report theme=bootstrap><ui-select-match placeholder="{{ \'APPLICATION_REPORT\' | translate }}">{{$select.selected.name}}</ui-select-match><ui-select-choices repeat="report.value as report in config.reportTables | filter: $select.search"><div ng-bind-html="report.name | highlight: $select.search"></div></ui-select-choices></ui-select></div><div><label class=control-label>{{\'APPLICATION_FIELDS\' | translate}}</label></div><div class=padding-bottom ng-repeat="field in config.fields"><div class=form-group><div class=input-group><input type=text class=form-control ng-model=field.column> <span class=input-group-addon>as</span> <input type=text class=form-control ng-model=field.alias> <span class=input-group-btn ng-if="config.fields.length>1"><button class="btn btn-danger" type=button data-ng-click=removeField($index)><i class="fa fa-times"></i> {{\'APPLICATION_REMOVE\' | translate}}</button></span></div></div></div><button type=button class="btn btn-sm green mbottom20" ng-click=addField()><i class="fa fa-plus"></i> {{\'APPLICATION_ADD_FIELD\' | translate}}</button><div class=form-group><label for=condition>{{\'APPLICATION_CONDITION\' | translate}}</label> <input type=text class=form-control id=condition ng-model=config.condition placeholder="{{\'APPLICATION_CONDITION\' | translate}}"></div><div class=form-group><label for=condition>{{\'APPLICATION_REFRESH_TIMEOUT\' | translate}}</label> <input type=number class=form-control id=timeout ng-model=config.timeout placeholder="{{\'APPLICATION_REFRESH_TIMEOUT\' | translate}}" min=1></div></form>'),a.put("{widgetsPath}/pie-chart/src/view.html",'<div ng-if=labels.length ng-style=config.style><canvas id=doughnut class="chart chart-doughnut" chart-data=data chart-labels=labels legend=true></canvas></div><div class="alert alert-danger" role=alert ng-if=!config.report><span class="glyphicon glyphicon-exclamation-sign" aria-hidden=true></span> <span class=sr-only>{{\'APPLICATION_ERROR\' | translate}}:</span> {{\'MESSAGE_WIDGET_SELECT_REPORT\' | translate}}</div><div class="alert alert-danger" role=alert ng-if=!labels.length><span class="glyphicon glyphicon-exclamation-sign" aria-hidden=true></span> <span class=sr-only>{{\'APPLICATION_ERROR\' | translate}}:</span> {{\'MESSAGE_ENTER_VALID_CONDITION\' | translate}}</div><div class="alert alert-danger" role=alert ng-if=!labels.length><span class="glyphicon glyphicon-exclamation-sign" aria-hidden=true></span> <span class=sr-only>{{\'APPLICATION_ERROR\' | translate}}:</span> {{\'MESSAGE_ENTER_ONE_VALID_METRIC_AND_CHECK_OTHER\' | translate}}</div>')}])}(window),function(a,b){angular.module("adf.widget.table",["adf.provider"]).value("apiServiceUrlTable","/api/widgets/table").config(["dashboardProvider",function(a){a.widget("table",{title:"Table",description:"Show tabbed results from db",templateUrl:"{widgetsPath}/table/src/view.html",controller:"apiWidgetTableViewCtrl",edit:{templateUrl:"{widgetsPath}/table/src/edit.html",controller:"apiWidgetTableEditCtrl"}})}]).service("apiServiceTable",["$q","$http","apiServiceUrlTable",function(a,b,c){return{get:function(d){var e=a.defer();return b.get(c,{params:{condition:encodeURIComponent(d.condition),table:d.report,fields:d.fields}}).success(function(a){a?e.resolve(a):e.reject()}).error(function(a){console.log(a),e.reject()}),e.promise}}}]).controller("apiWidgetTableEditCtrl",["$scope",function(a){function b(){return a.config.fields||(a.config.fields=[{column:"",alias:""}]),a.config.fields}a.config.reportTables=[{name:"Agents",value:"agent"},{name:"Calls",value:"call"},{name:"Dials",value:"dial"},{name:"Members",value:"member"},{name:"Queues",value:"queue"}],a.config.timeout=a.config.timeout?a.config.timeout:1,a.config.height=a.config.height?a.config.height:350,a.config.fields=a.config.fields?a.config.fields:[{column:"",alias:""}],a.addField=function(){b().push({})},a.removeField=function(a){b().splice(a,1)}}]).controller("apiWidgetTableViewCtrl",["$scope","$interval","apiServiceTable",function(a,b,c){a.config.timeout=a.config.timeout?a.config.timeout:1,a.config.height=a.config.height?a.config.height:350,a.config.style={"max-height":a.config.height+"px",overflow:"scroll"},a.tableApiCall=function(){a.config.condition&&a.config.report&&a.config.fields.length&&""!==a.config.fields[0].column&&""!==a.config.fields[0].alias&&c.get(a.config).then(function(b){a.results=b})},a.tableApiCall();var d=b(function(){a.tableApiCall()},1e3*parseInt(a.config.timeout));a.$on("$destroy",function(){b.cancel(d)})}]),angular.module("adf.widget.table").run(["$templateCache",function(a){a.put("{widgetsPath}/table/src/edit.html",'<form role=form><div class=form-group><label class=control-label>{{\'APPLICATION_REPORT\' | translate}}</label><ui-select data-ng-model=config.report name=report theme=bootstrap><ui-select-match placeholder="{{ \'APPLICATION_REPORT\' | translate }}">{{$select.selected.name}}</ui-select-match><ui-select-choices repeat="report.value as report in config.reportTables | filter: $select.search"><div ng-bind-html="report.name | highlight: $select.search"></div></ui-select-choices></ui-select></div><div><label class=control-label>{{\'APPLICATION_METRICS\' | translate}}</label></div><div class=padding-bottom ng-repeat="field in config.fields"><div class=form-group><div class=input-group><input type=text class=form-control ng-model=field.column> <span class=input-group-addon>as</span> <input type=text class=form-control ng-model=field.alias> <span class=input-group-btn ng-if="config.fields.length>1"><button class="btn btn-danger" type=button data-ng-click=removeField($index)><i class="fa fa-times"></i> {{\'APPLICATION_REMOVE\' | translate}}</button></span></div></div></div><button type=button class="btn btn-sm green mbottom20" ng-click=addField()><i class="fa fa-plus"></i> {{\'APPLICATION_ADD_FIELD\' | translate}}</button><div class=form-group><label for=condition>{{\'APPLICATION_CONDITION\' | translate}}</label> <input type=text class=form-control id=condition ng-model=config.condition placeholder="{{\'APPLICATION_CONDITION\' | translate}}"></div><div class=form-group><label for=condition>{{\'APPLICATION_REFRESH_TIMEOUT\' | translate}}</label> <input type=number class=form-control id=timeout ng-model=config.timeout placeholder="{{\'APPLICATION_REFRESH_TIMEOUT\' | translate}}" min=1></div><div class=form-group><label for=condition>{{\'APPLICATION_WIDGET_MAX_HEIGHT\' | translate}}</label> <input type=number class=form-control id=height ng-model=config.height placeholder="{{\'APPLICATION_WIDGET_MAX_HEIGHT\' | translate}}" min=350></div></form>'),a.put("{widgetsPath}/table/src/view.html",'<div ng-if=results ng-style=config.style><table st-table=results class="table table-striped table-bordered table-hover"><div class=table-responsive><thead><tr><th colspan={{config.fields.length}}><div class=row><div class=col-md-6></div><div class=col-md-6><div class="input-group input-medium pull-right"><input st-search placeholder="{{ \'APPLICATION_SEARCH\' | translate }}" class=form-control type=search> <span class=input-group-addon><i class="fa fa-search"></i></span></div></div></div></th></tr><tr><th ng-repeat="field in config.fields">{{field.alias}}</th></tr></thead><tbody><tr data-ng-repeat="result in results" class=animate-repeat><td ng-repeat="field in config.fields">{{result[field.alias]}}</td></tr><tr data-ng-hide=results.length><td colspan={{config.fields.length}} style=text-align:center;><i>{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</i></td></tr></tbody><tfoot><tr><td colspan={{config.fields.length}} class=text-center><div st-pagination class=pagination st-items-by-page=10 st-displayed-pages=3></div></td></tr></tfoot></div></table></div><div class="alert alert-danger" role=alert ng-if=!config.report><span class="glyphicon glyphicon-exclamation-sign" aria-hidden=true></span> <span class=sr-only>{{\'APPLICATION_ERROR\' | translate}}:</span> {{\'MESSAGE_WIDGET_SELECT_REPORT\' | translate}}</div><div class="alert alert-danger" role=alert ng-if=!results><span class="glyphicon glyphicon-exclamation-sign" aria-hidden=true></span> <span class=sr-only>{{\'APPLICATION_ERROR\' | translate}}:</span> {{\'MESSAGE_ENTER_VALID_CONDITION\' | translate}}</div><div class="alert alert-danger" role=alert ng-if=!results><span class="glyphicon glyphicon-exclamation-sign" aria-hidden=true></span> <span class=sr-only>{{\'APPLICATION_ERROR\' | translate}}:</span> {{\'MESSAGE_ENTER_ONE_VALID_FIELD_AND_CHECK_OTHER\' | translate}}</div>')}])}(window),function(){angular.module("pdf",[]).directive("ngPdf",["$window",function(a){return{restrict:"E",templateUrl:function(a,b){return b.templateUrl?b.templateUrl:"partials/viewer.html"},link:function(b,c,d){var e=d.pdfUrl,f=null,g=d.page?d.page:1,h=d.scale>0?d.scale:1,i=c.find("canvas"),j=i[0],k=j.getContext("2d"),l=angular.element(a);l.on("scroll",function(){b.$apply(function(){b.scroll=l[0].scrollY})}),PDFJS.disableWorker=!0,b.pageNum=g,b.renderPage=function(a){f.getPage(a).then(function(a){var e,f,g,i={};"page-fit"!==d.scale||h?e=a.getViewport(h):(e=a.getViewport(1),f=c[0].clientWidth/e.width,g=c[0].clientHeight/e.height,h=Math.min(f,g)),j.height=e.height,j.width=e.width,i={canvasContext:k,viewport:e},a.render(i).promise.then(function(){"function"==typeof b.onPageRender&&b.onPageRender()})})},b.goPrevious=function(){b.pageToDisplay<=1||(b.pageNum=parseInt(b.pageNum)-1)},b.goNext=function(){b.pageToDisplay>=f.numPages||(b.pageNum=parseInt(b.pageNum)+1)},b.zoomIn=function(){return h=parseFloat(h)+.2,b.renderPage(b.pageToDisplay),h},b.zoomOut=function(){return h=parseFloat(h)-.2,b.renderPage(b.pageToDisplay),h},b.changePage=function(){b.renderPage(b.pageToDisplay)},b.rotate=function(){"rotate0"===j.getAttribute("class")?j.setAttribute("class","rotate90"):"rotate90"===j.getAttribute("class")?j.setAttribute("class","rotate180"):"rotate180"===j.getAttribute("class")?j.setAttribute("class","rotate270"):j.setAttribute("class","rotate0")},PDFJS.getDocument(e,null,null,b.onProgress).then(function(a){"function"==typeof b.onLoad&&b.onLoad(),f=a,b.renderPage(b.pageToDisplay),b.$apply(function(){b.pageCount=a.numPages})},function(a){a&&"function"==typeof b.onError&&b.onError(a)}),b.$watch("pageNum",function(a){b.pageToDisplay=parseInt(a),null!==f&&b.renderPage(b.pageToDisplay)})}}}])}();var Metronic=function(){var a,b=!1,c=!1,d=!1,e=!1,f=[],g="assets/",h="img/",i="plugins/",j="css/",k={blue:"#89C4F4",red:"#F3565D",green:"#1bbc9b",purple:"#9b59b6",grey:"#95a5a6",yellow:"#F8CB00"},l=function(){"rtl"===$("body").css("direction")&&(b=!0),c=!!navigator.userAgent.match(/MSIE 8.0/),d=!!navigator.userAgent.match(/MSIE 9.0/),e=!!navigator.userAgent.match(/MSIE 10.0/),e&&$("html").addClass("ie10"),(e||d||c)&&$("html").addClass("ie")},m=function(){for(var a=0;a<f.length;a++){var b=f[a];b.call()}},n=function(){var a;if(c){var b;$(window).resize(function(){b!=document.documentElement.clientHeight&&(a&&clearTimeout(a),a=setTimeout(function(){m()},50),b=document.documentElement.clientHeight)})}else $(window).resize(function(){a&&clearTimeout(a),a=setTimeout(function(){m()},50)})},o=function(){$("body").on("click",".portlet > .portlet-title > .tools > a.remove",function(a){
-a.preventDefault();var b=$(this).closest(".portlet");$("body").hasClass("page-portlet-fullscreen")&&$("body").removeClass("page-portlet-fullscreen"),b.find(".portlet-title .fullscreen").tooltip("destroy"),b.find(".portlet-title > .tools > .reload").tooltip("destroy"),b.find(".portlet-title > .tools > .remove").tooltip("destroy"),b.find(".portlet-title > .tools > .config").tooltip("destroy"),b.find(".portlet-title > .tools > .collapse, .portlet > .portlet-title > .tools > .expand").tooltip("destroy"),b.remove()}),$("body").on("click",".portlet > .portlet-title .fullscreen",function(a){a.preventDefault();var b=$(this).closest(".portlet");if(b.hasClass("portlet-fullscreen"))$(this).removeClass("on"),b.removeClass("portlet-fullscreen"),$("body").removeClass("page-portlet-fullscreen"),b.children(".portlet-body").css("height","auto");else{var c=Metronic.getViewPort().height-b.children(".portlet-title").outerHeight()-parseInt(b.children(".portlet-body").css("padding-top"))-parseInt(b.children(".portlet-body").css("padding-bottom"));$(this).addClass("on"),b.addClass("portlet-fullscreen"),$("body").addClass("page-portlet-fullscreen"),b.children(".portlet-body").css("height",c)}}),$("body").on("click",".portlet > .portlet-title > .tools > a.reload",function(a){a.preventDefault();var b=$(this).closest(".portlet").children(".portlet-body"),c=$(this).attr("data-url"),d=$(this).attr("data-error-display");c?(Metronic.blockUI({target:b,animate:!0,overlayColor:"none"}),$.ajax({type:"GET",cache:!1,url:c,dataType:"html",success:function(a){Metronic.unblockUI(b),b.html(a)},error:function(a,c,e){Metronic.unblockUI(b);var f="Error on reloading the content. Please check your connection and try again.";"toastr"==d&&toastr?toastr.error(f):"notific8"==d&&$.notific8?($.notific8("zindex",11500),$.notific8(f,{theme:"ruby",life:3e3})):alert(f)}})):(Metronic.blockUI({target:b,animate:!0,overlayColor:"none"}),window.setTimeout(function(){Metronic.unblockUI(b)},1e3))}),$('.portlet .portlet-title a.reload[data-load="true"]').click(),$("body").on("click",".portlet > .portlet-title > .tools > .collapse, .portlet .portlet-title > .tools > .expand",function(a){a.preventDefault()})},p=function(){if($().uniform){var a=$("input[type=checkbox]:not(.toggle, .make-switch, .icheck), input[type=radio]:not(.toggle, .star, .make-switch, .icheck)");a.size()>0&&a.each(function(){0===$(this).parents(".checker").size()&&$(this).show()})}},q=function(){$().iCheck&&$(".icheck").each(function(){var a=$(this).attr("data-checkbox")?$(this).attr("data-checkbox"):"icheckbox_minimal-grey",b=$(this).attr("data-radio")?$(this).attr("data-radio"):"iradio_minimal-grey";a.indexOf("_line")>-1||b.indexOf("_line")>-1?$(this).iCheck({checkboxClass:a,radioClass:b,insert:'<div class="icheck_line-icon"></div>'+$(this).attr("data-label")}):$(this).iCheck({checkboxClass:a,radioClass:b})})},r=function(){$().bootstrapSwitch&&$(".make-switch").bootstrapSwitch()},s=function(){$().confirmation&&$("[data-toggle=confirmation]").confirmation({container:"body",btnOkClass:"btn-xs btn-success",btnCancelClass:"btn-xs btn-danger"})},t=function(){$("body").on("shown.bs.collapse",".accordion.scrollable",function(a){Metronic.scrollTo($(a.target))})},u=function(){if(location.hash){var a=location.hash.substr(1);$('a[href="#'+a+'"]').parents(".tab-pane:hidden").each(function(){var a=$(this).attr("id");$('a[href="#'+a+'"]').click()}),$('a[href="#'+a+'"]').click()}},v=function(){$("body").on("hide.bs.modal",function(){$(".modal:visible").size()>1&&$("html").hasClass("modal-open")===!1?$("html").addClass("modal-open"):$(".modal:visible").size()<=1&&$("html").removeClass("modal-open")}),$("body").on("show.bs.modal",".modal",function(){$(this).hasClass("modal-scroll")&&$("body").addClass("modal-open-noscroll")}),$("body").on("hide.bs.modal",".modal",function(){$("body").removeClass("modal-open-noscroll")}),$("body").on("hidden.bs.modal",".modal:not(.modal-cached)",function(){$(this).removeData("bs.modal")})},w=function(){$(".tooltips").tooltip(),$(".portlet > .portlet-title .fullscreen").tooltip({container:"body",title:"Fullscreen"}),$(".portlet > .portlet-title > .tools > .reload").tooltip({container:"body",title:"Reload"}),$(".portlet > .portlet-title > .tools > .remove").tooltip({container:"body",title:"Remove"}),$(".portlet > .portlet-title > .tools > .config").tooltip({container:"body",title:"Settings"}),$(".portlet > .portlet-title > .tools > .collapse, .portlet > .portlet-title > .tools > .expand").tooltip({container:"body",title:"Collapse/Expand"})},x=function(){$("body").on("click",".dropdown-menu.hold-on-click",function(a){a.stopPropagation()})},y=function(){$("body").on("click",'[data-close="alert"]',function(a){$(this).parent(".alert").hide(),$(this).closest(".note").hide(),a.preventDefault()}),$("body").on("click",'[data-close="note"]',function(a){$(this).closest(".note").hide(),a.preventDefault()}),$("body").on("click",'[data-remove="note"]',function(a){$(this).closest(".note").remove(),a.preventDefault()})},z=function(){$('[data-hover="dropdown"]').not(".hover-initialized").each(function(){$(this).dropdownHover(),$(this).addClass("hover-initialized")})},A=function(){$(".popovers").popover(),$(document).on("click.bs.popover.data-api",function(b){a&&a.popover("hide")})},B=function(){Metronic.initSlimScroll(".scroller")},C=function(){jQuery.fancybox&&$(".fancybox-button").size()>0&&$(".fancybox-button").fancybox({groupAttr:"data-rel",prevEffect:"none",nextEffect:"none",closeBtn:!0,helpers:{title:{type:"inside"}}})},D=function(){(c||d)&&$("input[placeholder]:not(.placeholder-no-fix), textarea[placeholder]:not(.placeholder-no-fix)").each(function(){var a=$(this);""===a.val()&&""!==a.attr("placeholder")&&a.addClass("placeholder").val(a.attr("placeholder")),a.focus(function(){a.val()==a.attr("placeholder")&&a.val("")}),a.blur(function(){(""===a.val()||a.val()==a.attr("placeholder"))&&a.val(a.attr("placeholder"))})})},E=function(){$().select2&&$(".select2me").select2({placeholder:"Select"})};return{init:function(){l(),n(),p(),q(),r(),B(),C(),E(),o(),y(),x(),u(),w(),A(),t(),v(),s(),D()},initAjax:function(){p(),q(),r(),z(),B(),E(),C(),x(),w(),A(),t(),s()},initComponents:function(){this.initAjax()},setLastPopedPopover:function(b){a=b},addResizeHandler:function(a){f.push(a)},runResizeHandlers:function(){m()},scrollTo:function(a,b){var c=a&&a.size()>0?a.offset().top:0;a&&($("body").hasClass("page-header-fixed")&&(c-=$(".page-header").height()),c+=b?b:-1*a.height()),$("html,body").animate({scrollTop:c},"slow")},initSlimScroll:function(a){$(a).each(function(){if(!$(this).attr("data-initialized")){var a;a=$(this).attr("data-height")?$(this).attr("data-height"):$(this).css("height"),$(this).slimScroll({allowPageScroll:!0,size:"7px",color:$(this).attr("data-handle-color")?$(this).attr("data-handle-color"):"#bbb",wrapperClass:$(this).attr("data-wrapper-class")?$(this).attr("data-wrapper-class"):"slimScrollDiv",railColor:$(this).attr("data-rail-color")?$(this).attr("data-rail-color"):"#eaeaea",position:b?"left":"right",height:a,alwaysVisible:"1"==$(this).attr("data-always-visible")?!0:!1,railVisible:"1"==$(this).attr("data-rail-visible")?!0:!1,disableFadeOut:!0}),$(this).attr("data-initialized","1")}})},destroySlimScroll:function(a){$(a).each(function(){if("1"===$(this).attr("data-initialized")){$(this).removeAttr("data-initialized"),$(this).removeAttr("style");var a={};$(this).attr("data-handle-color")&&(a["data-handle-color"]=$(this).attr("data-handle-color")),$(this).attr("data-wrapper-class")&&(a["data-wrapper-class"]=$(this).attr("data-wrapper-class")),$(this).attr("data-rail-color")&&(a["data-rail-color"]=$(this).attr("data-rail-color")),$(this).attr("data-always-visible")&&(a["data-always-visible"]=$(this).attr("data-always-visible")),$(this).attr("data-rail-visible")&&(a["data-rail-visible"]=$(this).attr("data-rail-visible")),$(this).slimScroll({wrapperClass:$(this).attr("data-wrapper-class")?$(this).attr("data-wrapper-class"):"slimScrollDiv",destroy:!0});var b=$(this);$.each(a,function(a,c){b.attr(a,c)})}})},scrollTop:function(){Metronic.scrollTo()},blockUI:function(a){a=$.extend(!0,{},a);var b="";if(b=a.animate?'<div class="loading-message '+(a.boxed?"loading-message-boxed":"")+'"><div class="block-spinner-bar"><div class="bounce1"></div><div class="bounce2"></div><div class="bounce3"></div></div></div>':a.iconOnly?'<div class="loading-message '+(a.boxed?"loading-message-boxed":"")+'"><img src="'+this.getGlobalImgPath()+'loading-spinner-blue.gif" align=""></div>':a.textOnly?'<div class="loading-message '+(a.boxed?"loading-message-boxed":"")+'"><span>&nbsp;&nbsp;'+(a.message?a.message:"LOADING...")+"</span></div>":'<div class="loading-message '+(a.boxed?"loading-message-boxed":"")+'"><img src="'+this.getGlobalImgPath()+'loading-spinner-blue.gif" align=""><span>&nbsp;&nbsp;'+(a.message?a.message:"LOADING...")+"</span></div>",a.target){var c=$(a.target);c.height()<=$(window).height()&&(a.cenrerY=!0),c.block({message:b,baseZ:a.zIndex?a.zIndex:1e3,centerY:void 0!==a.cenrerY?a.cenrerY:!1,css:{top:"10%",border:"0",padding:"0",backgroundColor:"none"},overlayCSS:{backgroundColor:a.overlayColor?a.overlayColor:"#555",opacity:a.boxed?.05:.1,cursor:"wait"}})}else $.blockUI({message:b,baseZ:a.zIndex?a.zIndex:1e3,css:{border:"0",padding:"0",backgroundColor:"none"},overlayCSS:{backgroundColor:a.overlayColor?a.overlayColor:"#555",opacity:a.boxed?.05:.1,cursor:"wait"}})},unblockUI:function(a){a?$(a).unblock({onUnblock:function(){$(a).css("position",""),$(a).css("zoom","")}}):$.unblockUI()},startPageLoading:function(a){a&&a.animate?($(".page-spinner-bar").remove(),$("body").append('<div class="page-spinner-bar"><div class="bounce1"></div><div class="bounce2"></div><div class="bounce3"></div></div>')):($(".page-loading").remove(),$("body").append('<div class="page-loading"><img src="'+this.getGlobalImgPath()+'loading-spinner-blue.gif"/>&nbsp;&nbsp;<span>'+(a&&a.message?a.message:"Loading...")+"</span></div>"))},stopPageLoading:function(){$(".page-loading, .page-spinner-bar").remove()},alert:function(a){a=$.extend(!0,{container:"",place:"append",type:"success",message:"",close:!0,reset:!0,focus:!0,closeInSeconds:0,icon:""},a);var b=Metronic.getUniqueID("Metronic_alert"),c='<div id="'+b+'" class="Metronic-alerts alert alert-'+a.type+' fade in">'+(a.close?'<button type="button" class="close" data-dismiss="alert" aria-hidden="true"></button>':"")+(""!==a.icon?'<i class="fa-lg fa fa-'+a.icon+'"></i>  ':"")+a.message+"</div>";return a.reset&&$(".Metronic-alerts").remove(),a.container?"append"==a.place?$(a.container).append(c):$(a.container).prepend(c):$("body").hasClass("page-container-bg-solid")?$(".page-title").after(c):$(".page-bar").size()>0?$(".page-bar").after(c):$(".page-breadcrumb").after(c),a.focus&&Metronic.scrollTo($("#"+b)),a.closeInSeconds>0&&setTimeout(function(){$("#"+b).remove()},1e3*a.closeInSeconds),b},initUniform:function(a){a?$(a).each(function(){0===$(this).parents(".checker").size()&&($(this).show(),$(this).uniform())}):p()},updateUniform:function(a){$.uniform.update(a)},initFancybox:function(){C()},getActualVal:function(a){return a=$(a),a.val()===a.attr("placeholder")?"":a.val()},getURLParameter:function(a){var b,c,d=window.location.search.substring(1),e=d.split("&");for(b=0;b<e.length;b++)if(c=e[b].split("="),c[0]==a)return unescape(c[1]);return null},isTouchDevice:function(){try{return document.createEvent("TouchEvent"),!0}catch(a){return!1}},getViewPort:function(){var a=window,b="inner";return"innerWidth"in window||(b="client",a=document.documentElement||document.body),{width:a[b+"Width"],height:a[b+"Height"]}},getUniqueID:function(a){return"prefix_"+Math.floor(Math.random()*(new Date).getTime())},isIE8:function(){return c},isIE9:function(){return d},isRTL:function(){return b},isAngularJsApp:function(){return"undefined"==typeof angular?!1:!0},getAssetsPath:function(){return g},setAssetsPath:function(a){g=a},setGlobalImgPath:function(a){h=a},getGlobalImgPath:function(){return g+h},setGlobalPluginsPath:function(a){i=a},getGlobalPluginsPath:function(){return g+i},getGlobalCssPath:function(){return g+j},getBrandColor:function(a){return k[a]?k[a]:""},getResponsiveBreakpoint:function(a){var b={xs:480,sm:768,md:900,lg:1200};return b[a]?b[a]:0}}}(),Layout=function(){var a="img/",b="css/",c=Metronic.getResponsiveBreakpoint("md"),d=function(){var a,b=$(".page-content"),d=$(".page-sidebar"),e=$("body");if(e.hasClass("page-footer-fixed")===!0&&e.hasClass("page-sidebar-fixed")===!1){var f=Metronic.getViewPort().height-$(".page-footer").outerHeight()-$(".page-header").outerHeight();b.height()<f&&b.attr("style","min-height:"+f+"px")}else{if(e.hasClass("page-sidebar-fixed"))a=g(),e.hasClass("page-footer-fixed")===!1&&(a-=$(".page-footer").outerHeight());else{var h=$(".page-header").outerHeight(),i=$(".page-footer").outerHeight();a=Metronic.getViewPort().width<c?Metronic.getViewPort().height-h-i:d.height()+20,a+h+i<=Metronic.getViewPort().height&&(a=Metronic.getViewPort().height-h-i)}b.attr("style","min-height:"+a+"px")}},e=function(a,b){var d=location.hash.toLowerCase(),e=$(".page-sidebar-menu");if("click"===a||"set"===a?b=$(b):"match"===a&&e.find("li > a").each(function(){var a=$(this).attr("href").toLowerCase();return a.length>1&&d.substr(1,a.length-1)==a.substr(1)?void(b=$(this)):void 0}),b&&0!=b.size()&&"javascript:;"!==b.attr("href").toLowerCase()&&"#"!==b.attr("href").toLowerCase()){parseInt(e.data("slide-speed")),e.data("keep-expanded");e.find("li.active").removeClass("active"),e.find("li > a > .selected").remove(),e.hasClass("page-sidebar-menu-hover-submenu")===!1?e.find("li.open").each(function(){0===$(this).children(".sub-menu").size()&&($(this).removeClass("open"),$(this).find("> a > .arrow.open").removeClass("open"))}):e.find("li.open").removeClass("open"),b.parents("li").each(function(){$(this).addClass("active"),$(this).find("> a > span.arrow").addClass("open"),1===$(this).parent("ul.page-sidebar-menu").size()&&$(this).find("> a").append('<span class="selected"></span>'),1===$(this).children("ul.sub-menu").size()&&$(this).addClass("open")}),"click"===a&&Metronic.getViewPort().width<c&&$(".page-sidebar").hasClass("in")&&$(".page-header .responsive-toggler").click()}},f=function(){jQuery(".page-sidebar").on("click","li > a",function(a){var b=$(this).next().hasClass("sub-menu");if(!(Metronic.getViewPort().width>=c&&1===$(this).parents(".page-sidebar-menu-hover-submenu").size())){if(b===!1)return void(Metronic.getViewPort().width<c&&$(".page-sidebar").hasClass("in")&&$(".page-header .responsive-toggler").click());if(!$(this).next().hasClass("sub-menu always-open")){var e=$(this).parent().parent(),f=$(this),g=$(".page-sidebar-menu"),h=jQuery(this).next(),i=g.data("auto-scroll"),j=parseInt(g.data("slide-speed")),k=g.data("keep-expanded");k!==!0&&(e.children("li.open").children("a").children(".arrow").removeClass("open"),e.children("li.open").children(".sub-menu:not(.always-open)").slideUp(j),e.children("li.open").removeClass("open"));var l=-200;h.is(":visible")?(jQuery(".arrow",jQuery(this)).removeClass("open"),jQuery(this).parent().removeClass("open"),h.slideUp(j,function(){i===!0&&$("body").hasClass("page-sidebar-closed")===!1&&($("body").hasClass("page-sidebar-fixed")?g.slimScroll({scrollTo:f.position().top}):Metronic.scrollTo(f,l)),d()})):b&&(jQuery(".arrow",jQuery(this)).addClass("open"),jQuery(this).parent().addClass("open"),h.slideDown(j,function(){i===!0&&$("body").hasClass("page-sidebar-closed")===!1&&($("body").hasClass("page-sidebar-fixed")?g.slimScroll({scrollTo:f.position().top}):Metronic.scrollTo(f,l)),d()})),a.preventDefault()}}}),jQuery(".page-sidebar").on("click"," li > a.ajaxify",function(a){a.preventDefault(),Metronic.scrollTop();var b=$(this).attr("href"),d=jQuery(".page-sidebar ul"),e=($(".page-content"),$(".page-content .page-content-body"));d.children("li.active").removeClass("active"),d.children("arrow.open").removeClass("open"),$(this).parents("li").each(function(){$(this).addClass("active"),$(this).children("a > span.arrow").addClass("open")}),$(this).parents("li").addClass("active"),Metronic.getViewPort().width<c&&$(".page-sidebar").hasClass("in")&&$(".page-header .responsive-toggler").click(),Metronic.startPageLoading();var f=$(this);$.ajax({type:"GET",cache:!1,url:b,dataType:"html",success:function(a){0===f.parents("li.open").size()&&$(".page-sidebar-menu > li.open > a").click(),Metronic.stopPageLoading(),e.html(a),Layout.fixContentHeight(),Metronic.initAjax()},error:function(a,b,c){Metronic.stopPageLoading(),e.html("<h4>Could not load the requested content.</h4>")}})}),jQuery(".page-content").on("click",".ajaxify",function(a){a.preventDefault(),Metronic.scrollTop();var b=$(this).attr("href"),d=($(".page-content"),$(".page-content .page-content-body"));Metronic.startPageLoading(),Metronic.getViewPort().width<c&&$(".page-sidebar").hasClass("in")&&$(".page-header .responsive-toggler").click(),$.ajax({type:"GET",cache:!1,url:b,dataType:"html",success:function(a){Metronic.stopPageLoading(),d.html(a),Layout.fixContentHeight(),Metronic.initAjax()},error:function(a,b,c){d.html("<h4>Could not load the requested content.</h4>"),Metronic.stopPageLoading()}})}),i(),$(".page-sidebar").on("click",".sidebar-search .remove",function(a){a.preventDefault(),$(".sidebar-search").removeClass("open")}),$(".page-sidebar .sidebar-search").on("keypress","input.form-control",function(a){return 13==a.which?($(".sidebar-search").submit(),!1):void 0}),0!==$(".sidebar-search").size()&&($(".sidebar-search .input-group").on("click",function(a){a.stopPropagation()}),$("body").on("click",function(){$(".sidebar-search").hasClass("open")&&$(".sidebar-search").removeClass("open")}))},g=function(){var a=Metronic.getViewPort().height-$(".page-header").outerHeight();return $("body").hasClass("page-footer-fixed")&&(a-=$(".page-footer").outerHeight()),a},h=function(){var a=$(".page-sidebar-menu");return Metronic.destroySlimScroll(a),0===$(".page-sidebar-fixed").size()?void d():void(Metronic.getViewPort().width>=c&&(a.attr("data-height",g()),Metronic.initSlimScroll(a),d()))},i=function(){var a=$("body");a.hasClass("page-sidebar-fixed")&&$(".page-sidebar").on("mouseenter",function(){a.hasClass("page-sidebar-closed")&&$(this).find(".page-sidebar-menu").removeClass("page-sidebar-menu-closed")}).on("mouseleave",function(){a.hasClass("page-sidebar-closed")&&$(this).find(".page-sidebar-menu").addClass("page-sidebar-menu-closed")})},j=function(){$("body");$.cookie&&"1"===$.cookie("sidebar_closed")&&Metronic.getViewPort().width>=c?($("body").addClass("page-sidebar-closed"),$(".page-sidebar-menu").addClass("page-sidebar-menu-closed")):$.cookie&&$.cookie("sidebar_closed","0")},k=function(){$(".page-header").on("click",'.hor-menu a[data-toggle="tab"]',function(a){a.preventDefault();var b=$(".hor-menu .nav"),c=b.find("li.current");$("li.active",c).removeClass("active"),$(".selected",c).remove();var d=$(this).parents("li").last();d.addClass("current"),d.find("a:first").append('<span class="selected"></span>')}),$(".page-header").on("click",".search-form",function(a){$(this).addClass("open"),$(this).find(".form-control").focus(),$(".page-header .search-form .form-control").on("blur",function(a){$(this).closest(".search-form").removeClass("open"),$(this).unbind("blur")})}),$(".page-header").on("keypress",".hor-menu .search-form .form-control",function(a){return 13==a.which?($(this).closest(".search-form").submit(),!1):void 0}),$(".page-header").on("mousedown",".search-form.open .submit",function(a){a.preventDefault(),a.stopPropagation(),$(this).closest(".search-form").submit()}),$('[data-hover="megamenu-dropdown"]').not(".hover-initialized").each(function(){$(this).dropdownHover(),$(this).addClass("hover-initialized")}),$(document).on("click",".mega-menu-dropdown .dropdown-menu",function(a){a.stopPropagation()})},l=function(){$("body").on("shown.bs.tab",'a[data-toggle="tab"]',function(){d()})},m=function(){var a=300,b=500;navigator.userAgent.match(/iPhone|iPad|iPod/i)?$(window).bind("touchend touchcancel touchleave",function(c){$(this).scrollTop()>a?$(".scroll-to-top").fadeIn(b):$(".scroll-to-top").fadeOut(b)}):$(window).scroll(function(){$(this).scrollTop()>a?$(".scroll-to-top").fadeIn(b):$(".scroll-to-top").fadeOut(b)}),$(".scroll-to-top").click(function(a){return a.preventDefault(),$("html, body").animate({scrollTop:0},b),!1})},n=function(){var a,b=$(".full-height-content");if(a=Metronic.getViewPort().height-$(".page-header").outerHeight(!0)-$(".page-footer").outerHeight(!0)-$(".page-title").outerHeight(!0)-$(".page-bar").outerHeight(!0),b.hasClass("portlet")){var d=b.find(".portlet-body");if(Metronic.getViewPort().width<c)return void Metronic.destroySlimScroll(d.find(".full-height-content-body"));a=a-b.find(".portlet-title").outerHeight(!0)-parseInt(b.find(".portlet-body").css("padding-top"))-parseInt(b.find(".portlet-body").css("padding-bottom"))-2,b.hasClass("full-height-content-scrollable")?(a-=35,d.find(".full-height-content-body").css("height",a),Metronic.initSlimScroll(d.find(".full-height-content-body"))):d.css("min-height",a)}else{if(Metronic.getViewPort().width<c)return void Metronic.destroySlimScroll(b.find(".full-height-content-body"));b.hasClass("full-height-content-scrollable")?(a-=35,b.find(".full-height-content-body").css("height",a),Metronic.initSlimScroll(b.find(".full-height-content-body"))):b.css("min-height",a)}};return{initHeader:function(){k()},setSidebarMenuActiveLink:function(a,b){e(a,b)},initSidebar:function(){h(),f(),j(),Metronic.isAngularJsApp()&&e("match"),Metronic.addResizeHandler(h)},initContent:function(){n(),l(),Metronic.addResizeHandler(d),Metronic.addResizeHandler(n)},initFooter:function(){m()},init:function(){this.initHeader(),this.initSidebar(),this.initContent(),this.initFooter()},fixContentHeight:function(){d()},initFixedSidebarHoverEffect:function(){i()},initFixedSidebar:function(){h()},getLayoutImgPath:function(){return Metronic.getAssetsPath()+a},getLayoutCssPath:function(){return Metronic.getAssetsPath()+b}}}();angular.module("xCallyShuttleApp").run(["$templateCache",function(a){a.put("app/analytic/extracted/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="fa fa-file-pdf-o"></i>\n					<a href="/analytics/extracted/list">{{ \'APPLICATION_EXTRACTED_REPORTS\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="fa fa-file-pdf-o font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_EXTRACTED_REPORTS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<!-- <a class="btn btn-icon-only btn-default fullscreen" href="#"></a> -->\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n\n<!-- END PAGE CONTENT-->\n'),a.put("app/analytic/metric/list/create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_METRIC\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="forms.metric" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (forms.metric.name.$touched || forms.metric.$submitted) && forms.metric.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n      <span data-ng-show="(forms.metric.name.$touched || forms.metric.$submitted) && forms.metric.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n    <!-- START TABLE -->\n    <div class="form-group" data-ng-class="{\'has-error\': (forms.metric.table.$touched || forms.metric.$submitted) && forms.metric.table.$invalid}">\n      <label class="control-label">{{\'APPLICATION_TABLE\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <ui-select data-ng-model="item.table" name="table" theme="bootstrap" required>\n        <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n        <ui-select-choices repeat="table.value as table in tables | filter: $select.search">\n          <div ng-bind-html="table.name | highlight: $select.search"></div>\n        </ui-select-choices>\n      </ui-select>\n      <span data-ng-show="(forms.metric.table.$touched || forms.metric.$submitted) && forms.metric.table.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END TABLE-->\n\n    <!-- START METRIC -->\n    <div class="form-group" data-ng-class="{\'has-error\': (forms.metric.metric.$touched || forms.metric.$submitted) && forms.metric.metric.$invalid}">\n      <label class="control-label">{{\'APPLICATION_METRIC\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <textarea type="text" name="metric" placeholder="{{\'APPLICATION_METRIC\' | translate}}" class="form-control" data-ng-model="item.metric" required/></textarea>\n      <span data-ng-show="(forms.metric.metric.$touched || forms.metric.$submitted) && forms.metric.metric.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END METRIC -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="metric.description"></textarea>\n    </div>\n    <!-- END DESCRIPTION -->\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="ok()" ng-disabled="forms.metric.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/analytic/metric/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-calculator"></i>\n					<a href="/analytics/metrics/list">{{ \'APPLICATION_METRICS\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-calculator font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_METRICS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<button class="btn green-jungle " ng-click="create()">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_METRIC\' | translate }}\n						</button>\n					</div>\n					<!-- <a class="btn btn-icon-only btn-default fullscreen" href="#"></a> -->\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/analytic/metric/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getMetric()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-eye"></i>\n					<a href="/analytics/metrics/list">{{ \'APPLICATION_METRICS\' | translate }}</a>\n					<i data-ng-show="metric" class="fa fa-angle-right"></i>\n				</li>\n				<li data-ng-show="metric">\n					<a href="#">{{metric.name}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/metric.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{metric.name}}\n					</div>\n					<!-- <div class="profile-usertitle-job">\n						{{user.role}}\n					</div> -->\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.analytics.metrics.view.settings\')}">\n							<a data-ng-href="/analytics/metrics/view/{{metric.id}}/settings">\n							<i class="icon-settings"></i>\n							{{ \'APPLICATION_SETTINGS\' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/analytic/metric/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_METRIC\' | translate}} {{ \'APPLICATION_SETTINGS\' | translate}} </span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_GENERAL\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.general" data-ng-submit="forms.general.$valid && updateMetric()" novalidate>\n\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="metric.name" required/>\n								<span data-ng-show="(forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<!-- START TABLE -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.table.$touched || forms.general.$submitted) && forms.general.table.$invalid}">\n								<label class="control-label">{{\'APPLICATION_TABLE\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="metric.table" name="table" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n									<ui-select-choices repeat="table.value as table in tables | filter: $select.search">\n										<div ng-bind-html="table.name | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span data-ng-show="(forms.general.table.$touched || forms.general.$submitted) && forms.general.table.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END TABLE-->\n\n							<!-- START METRIC -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.metric.$touched || forms.general.$submitted) && forms.general.metric.$invalid}">\n								<label class="control-label">{{\'APPLICATION_METRIC\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<textarea type="text" name="metric" placeholder="{{\'APPLICATION_METRIC\' | translate}}" class="form-control" data-ng-model="metric.metric" required/></textarea>\n								<span data-ng-show="(forms.general.metric.$touched || forms.general.$submitted) && forms.general.metric.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END METRIC -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="metric.description"></textarea>\n							</div>\n							<!-- END DESCRIPTION -->\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END ADVANCED TAB -->\n\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),
-a.put("app/analytic/report/list/copy.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_COPY_REPORT\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <div class="portlet light bordered">\n    <div class="portlet-title">\n      <div class="caption font-green-sharp" style="padding-left:10px;">\n        <i class="icon-folder font-green-sharp"></i>\n        <span class="caption-subject">{{ \'APPLICATION_COPY_TO\' | translate }} </span>\n      </div>\n    </div>\n    <div class="portlet-body">\n      <div js-tree="customTreeConfig" ng-model="customTreeData" should-apply="ac()" tree="customTreeInstance" tree-events="ready:initCustomScopeTree;"></div>\n    </div>\n  </div>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" data-ng-disabled="!customTree.get_selected(true).pop().id" ng-click="ok()" ng-disabled="forms.report.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/analytic/report/list/create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_REPORT\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="forms.report" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (forms.report.name.$touched || forms.report.$submitted) && forms.report.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n      <span data-ng-show="(forms.report.name.$touched || forms.report.$submitted) && forms.report.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n    </div>\n    <!-- END DESCRIPTION -->\n\n    <div class="form-group" data-ng-class="{\'has-error\': (forms.report.name.$touched || forms.report.$submitted) && forms.report.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_PATH\' | translate}}<span class="required" aria-required="true"></span></label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_PATH\' | translate}}" class="form-control" data-ng-model="path" disabled/>\n      <span data-ng-show="(forms.report.name.$touched || forms.report.$submitted) && forms.report.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="ok()" ng-disabled="forms.report.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/analytic/report/list/extract.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_EXTRACT_REPORT\' | translate }}</h3>\n</div>\n<div class="modal-body" style="text-align:center;">\n  <form name="forms.report" class="form-inline mbottom20" novalidate>\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DATE_RANGE\' | translate}}<span class="required" aria-required="true"></span></label>\n      <input type="daterange" name="dates" ranges="ranges" placeholder="{{\'APPLICATION_DATE_RANGE\' | translate}}" class="form-control" data-ng-model="dates" required/>\n    </div>\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn default green-jungle" type="button" data-ng-click="extract(\'csv\')"><i class="fa fa-file-excel-o"></i> {{ \'APPLICATION_SAVE_AS_CSV\' | translate }}</button>\n  <button class="btn default red-intense" type="button" data-ng-click="extract(\'pdf\')"><i class="fa fa-file-pdf-o"></i> {{ \'APPLICATION_SAVE_AS_PDF\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/analytic/report/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getTrees()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-book-open"></i>\n					<a href="/analytics/reports/list">{{ \'APPLICATION_REPORTS\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n		<div class="col-fixed">\n			<!-- BEGIN Portlet PORTLET-->\n			<div class="portlet light bordered">\n				<div class="portlet-title">\n					<div class="caption font-green-sharp" style="padding-left:10px;">\n						<i class="icon-folder font-green-sharp"></i>\n						<span class="caption-subject">{{ \'APPLICATION_FOLDERS\' | translate }} </span>\n					</div>\n					<div class="inputs">\n						<div class="portlet-input input-inline input-small">\n							<div class="input-icon right">\n								<i class="icon-magnifier"></i>\n								<input type="text" data-ng-model="searchField" data-ng-change="searchTrees()" class="form-control input-circle" placeholder="search...">\n							</div>\n						</div>\n					</div>\n				</div>\n				<div class="portlet-body">\n					<div js-tree="defaultTreeConfig" ng-model="defaultTreeData" should-apply="ac()" tree="defaultTreeInstance" tree-events="ready:initDefaultScopeTree;select_node:selectDefaultNode;"></div>\n					<div js-tree="customTreeConfig" ng-model="customTreeData" should-apply="ac()" tree="customTreeInstance" tree-events="ready:initCustomScopeTree;select_node:selectCustomNode;rename_node:updateCustomTree;delete_node:updateCustomTree;move_node:updateCustomTree;create_node:updateCustomTree;"></div>\n				</div>\n			</div>\n			<!-- END Portlet PORTLET-->\n		</div>\n		<div class="row tree-row">\n			<div class="col-md-12">\n				<!-- BEGIN Portlet PORTLET-->\n				<div class="portlet light bordered">\n					<div class="portlet-title">\n						<div class="caption font-green-sharp">\n							<i class="icon-book-open font-green-sharp"></i>\n							<span class="caption-subject">{{ \'APPLICATION_REPORTS\' | translate }}<span data-ng-if="selectedNode"> - {{selectedNode}}</span></span>\n						</div>\n						<div data-ng-if="!defaultTreeActive" class="actions">\n							<div class="btn-group" data-ng-show="id.length">\n								<a class="btn red" href="#" data-ng-click="deleteItems()">\n									<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n								</a>\n							</div>\n							<div class="btn-group">\n								<span class="btn default btn-file">\n								<span class="fileinput-new">\n								<i class="icon-cloud-upload"></i> {{\'APPLICATION_IMPORT_FROM_JSON\' | translate}}</span>\n								<input type="file" on-read-file="import($fileContent)"/>\n								</span>\n							</div>\n							<div class="btn-group">\n								<button class="btn green-jungle " ng-click="create()">\n									<i class="icon-plus"></i> {{ \'APPLICATION_NEW_REPORT\' | translate }}\n								</button>\n							</div>\n						</div>\n					</div>\n					<div class="portlet-body">\n						<div ng-slide-down="gridOptions" lazy-render duration="1">\n						<!-- START TABLE -->\n						<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n							<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n						</div>\n						<!-- END TABLE -->\n					</div>\n					</div>\n				</div>\n				<!-- END Portlet PORTLET-->\n			</div>\n		</div>\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/analytic/report/list/preview.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_REPORT_PREVIEW\' | translate }}</h3>\n</div>\n<div class="modal-body" style="text-align:center;">\n  <form name="forms.report" class="form-inline mbottom20" novalidate>\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DATE_RANGE\' | translate}}<span class="required" aria-required="true"></span></label>\n      <input type="daterange" name="dates" ranges="ranges" placeholder="{{\'APPLICATION_DATE_RANGE\' | translate}}" class="form-control" data-ng-model="dates" data-ng-change="getPage()" required/>\n    </div>\n  </form>\n  <div ng-slide-down="showResult" lazy-render duration="1">\n    <div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-exporter class="grid extract-grid">\n      <div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n    </div>\n  </div>\n</div>\n<div class="modal-footer">\n<button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CLOSE\' | translate }}</button>\n</div>\n'),a.put("app/analytic/report/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getReport()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-book-open"></i>\n					<a href="/analytics/reports/list">{{ \'APPLICATION_REPORTS\' | translate }}</a>\n					<i data-ng-show="report" class="fa fa-angle-right"></i>\n				</li>\n				<li data-ng-show="report">\n					<a href="#">{{report.name}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/report.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{report.name}}\n					</div>\n					<!-- <div class="profile-usertitle-job">\n						{{user.role}}\n					</div> -->\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.analytics.reports.view.settings\')}">\n							<a data-ng-href="/analytics/reports/view/{{report.id}}/settings">\n							<i class="icon-settings"></i>\n							{{ \'APPLICATION_SETTINGS\' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/analytic/report/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_REPORT\' | translate}} {{ \'APPLICATION_SETTINGS\' | translate}} </span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li>\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_GENERAL\' | translate}}</a>\n					</li>\n					<li class="active">\n						<a href="#" data-target="#tab_1_2" data-toggle="tab">{{ \'APPLICATION_BUILD\' | translate}}</a>\n					</li>\n					<li>\n						<a href="#" data-target="#tab_1_3" data-toggle="tab" data-ng-click="showResult = true">{{ \'APPLICATION_TEST_PREVIEW\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n\n			<div class="portlet-body">\n\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane" id="tab_1_1">\n						<form name="forms.general" data-ng-submit="forms.report.$valid && forms.general.$valid && updateReport()" novalidate>\n\n\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="report.name" required/>\n								<span data-ng-show="(forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="report.description"></textarea>\n							</div>\n							<!-- END DESCRIPTION -->\n\n							<!-- START TABLE INPUT -->\n\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n\n					</div>\n					<!-- END GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_2">\n						<form name="forms.report" data-ng-submit="forms.report.$valid && forms.general.$valid && updateReport()" novalidate>\n						<div class="form-group" data-ng-class="{\'has-error\': (forms.report.table.$touched || forms.report.$submitted) && forms.report.table.$invalid}">\n							<label class="control-label">{{\'APPLICATION_TABLE\' | translate}}<span class="required" aria-required="true">*</span></label>\n							<ui-select data-ng-model="report.table" name="table" theme="bootstrap" required>\n								<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n								<ui-select-choices repeat="table.table as table in tables | filter: $select.search">\n									<div ng-bind-html="table.name | highlight: $select.search"></div>\n								</ui-select-choices>\n							</ui-select>\n							<span class="help-block">\n							</span>\n							<span data-ng-show="(forms.report.table.$touched || forms.report.$submitted) && forms.report.table.$error.required" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n						</div>\n						<!-- END TABLE INPUT-->\n						<div data-ng-if="report.table" class="mbottom20 pbottom20">\n						<div class="portlet-title tabbable-line">\n							<div class="caption caption-md">\n								<i class="icon-globe theme-font hide"></i>\n								<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_FIELDS\' | translate}} </span>\n							</div>\n						</div>\n								<!-- START TABLE -->\n								<table class="table table-striped table-bordered table-hover">\n									<thead>\n										<tr>\n											<th>{{ \'APPLICATION_FIELD\' | translate }} / {{ \'APPLICATION_METRIC\' | translate }}</th>\n											<th>{{ \'APPLICATION_ALIAS\' | translate }}</th>\n											<th>{{ \'APPLICATION_FUNCTION\' | translate }}</th>\n											<th>{{ \'APPLICATION_GROUP_BY\' | translate }}</th>\n											<th>{{ \'APPLICATION_ORDER_BY\' | translate }}</th>\n											<th></th>\n											<th></th>\n										</tr>\n									</thead>\n										<tbody ui-sortable="sortableOptions" data-ng-model="report.Fields">\n											<tr data-ng-repeat="field in report.Fields">\n												<td>\n													<!-- START FIELD -->\n													<div class="form-group" data-ng-class="{\'has-error\': forms.report.$submitted && !field.field}">\n														<!-- <label class="control-label">{{\'APPLICATION_FIELD\' | translate}}<span class="required" aria-required="true">*</span></label> -->\n														<ui-select data-ng-model="field.field" dynamic-name="randomName()" theme="bootstrap" on-select="setMetricId($item,$index)" required>\n															<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}"><span ng-bind-html="$select.selected.name"></span></ui-select-match>\n															<ui-select-choices repeat="tableField.value as tableField in tableFields | filter: $select.search">\n																<div ng-bind-html="tableField.name | highlight: $select.search"></div>\n															</ui-select-choices>\n														</ui-select>\n														<span data-ng-show="forms.report.$submitted && !field.field" class="help-block help-block-error">\n															<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n														</span>\n													</div>\n													<!-- END FIELD-->\n												</td>\n												<td>\n													<!-- START ALIAS -->\n													<div class="form-group" data-ng-class="{\'has-error\': forms.report.$submitted && !field.alias}">\n														<!-- <label class="control-label">{{\'APPLICATION_ALIAS\' | translate}}<span class="required" aria-required="true">*</span></label> -->\n														<input type="text" dynamic-name="randomName()" placeholder="{{\'APPLICATION_ALIAS\' | translate}}" class="form-control" data-ng-model="field.alias" required/>\n														<span data-ng-show="forms.report.$submitted && !field.alias" class="help-block help-block-error">\n															<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n														</span>\n													</div>\n													<!-- END ALIAS -->\n												</td>\n												<td>\n													<!-- START FUNCTION -->\n													<div class="form-group">\n														<!-- <label class="control-label">{{\'APPLICATION_FIELD\' | translate}}<span class="required" aria-required="true">*</span></label> -->\n														<ui-select data-ng-model="field.function" name="function" theme="bootstrap">\n															<ui-select-match placeholder="{{\'APPLICATION_FUNCTION\' | translate}}" allow-clear>{{$select.selected.name}}</ui-select-match>\n															<ui-select-choices repeat="function.value as function in functions | filter: $select.search">\n																<div ng-bind-html="function.name | highlight: $select.search"></div>\n															</ui-select-choices>\n														</ui-select>\n													</div>\n													<!-- END FUNCTION-->\n												</td>\n												<td>\n													<!-- START GROUP_BY -->\n													<div class="form-group">\n														<!-- <label class="control-label">{{\'APPLICATION_FIELD\' | translate}}<span class="required" aria-required="true">*</span></label> -->\n														<ui-select data-ng-model="field.groupBy" name="groupBy" theme="bootstrap" required>\n															<ui-select-match placeholder="{{\'APPLICATION_GROUP_BY\' | translate}}">{{$select.selected.name | translate}}</ui-select-match>\n															<ui-select-choices repeat="groupBy.value as groupBy in groupByField | filter: $select.search">\n																{{$translate.instant(groupBy.name)}}\n															</ui-select-choices>\n														</ui-select>\n													</div>\n													<!-- END GROUP_BY-->\n												</td>\n												<td>\n													<!-- START ORDER_BY -->\n													<div class="form-group">\n														<!-- <label class="control-label">{{\'APPLICATION_FIELD\' | translate}}<span class="required" aria-required="true">*</span></label> -->\n														<ui-select data-ng-model="field.orderBy" name="orderBy" theme="bootstrap">\n															<ui-select-match placeholder="{{\'APPLICATION_ORDER_BY\' | translate}}" allow-clear>{{$select.selected}}</ui-select-match>\n															<ui-select-choices repeat="orderBy in [\'ASC\',\'DESC\'] | filter: $select.search">\n																<div ng-bind-html="orderBy | highlight: $select.search"></div>\n															</ui-select-choices>\n														</ui-select>\n													</div>\n													<!-- END TABLE INPUT-->\n												</td>\n												<td class="report-field-remove">\n													<button class="btn red" type="button" data-ng-click="removeField($index)"><i class="fa fa-times"></i></button>\n												</td>\n												<td class="report-field-handle">\n													<!-- <img data-ng-src="assets/images/move.png" class="img-responsive"> -->\n												</td>\n											</tr>\n											<tr data-ng-hide="report.Fields.length" class="unsortable">\n												<td colspan="7" style="text-align:center;">\n													<i>{{ \'MESSAGE_ADD_A_FIELD\' | translate }}</i>\n												</td>\n											</tr>\n										</tbody>\n								</table>\n								<button type="button" class="btn btn-sm green padding-bottom" ng-click="addField()">\n									<i class="fa fa-plus"></i> {{\'APPLICATION_ADD_FIELD\' | translate}}\n								</button>\n								<!-- END TABLE -->\n							</div>\n								<div data-ng-if="report.Fields.length" class="mbottom20 pbottom20">\n									<div class="portlet-title tabbable-line">\n										<div class="caption caption-md">\n											<i class="icon-globe theme-font hide"></i>\n											<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_CONDITIONS\' | translate}} </span>\n										</div>\n									</div>\n									<div class="alert alert-info">\n											<strong>Output</strong><br>\n											<span ng-bind-html="output"></span>\n									</div>\n\n									<report-builder group="report.conditions.group" fields="report.Fields" forms="forms" firstCall=\'true\'></report-builder>\n								</div>\n								<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n								</form>\n					</div>\n					<div class="tab-pane" id="tab_1_3">\n						<div ng-slide-down="showResult" lazy-render duration="0.5">\n							<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-move-columns class="grid">\n								<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n							</div>\n						</div>\n					</div>\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/channels/chat/offline/list/list.html",'<div class="row">\n	<div class="col-md-12">\n			<div class="page-bar">\n				<ul class="page-breadcrumb">\n					<li>\n						<i class="icon-rocket"></i>\n						<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-puzzle"></i>\n						<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-bubble"></i>\n						<a href="#">{{ \'APPLICATION_CHAT\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-login"></i>\n						<a href="/channels/chat/offline/list">Offline</a>\n					</li>\n				</ul>\n			</div>\n		</div>\n</div>\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-question font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_VISITORS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/chat/offline/view/view.detail.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_DETAIL\' | translate}}</span>\n				</div>\n			</div>\n			<div class="portlet-body row" data-ng-init="initView()">\n				<div class="col-md-6">\n					<div class="news-blocks">\n						<h3>\n							<a href="#" class="inactive-link">{{\'APPLICATION_MESSAGE\' | translate}}</a>\n							<hr>\n						</h3>\n						<div class="news-block-tags">\n							<em am-time-ago="chatVisitor.ChatEnquiry.createdAt"></em>\n						</div>\n						<p>\n							{{chatVisitor.ChatEnquiry.text}}\n						</p>\n					</div>\n				</div>\n				<div class="col-md-6">\n					<div class="news-blocks">\n						<h3>\n							<a href="#" class="inactive-link">{{\'APPLICATION_VISITOR\' | translate}}</a>\n							<hr>\n						</h3>\n						<div class="margin-top-20 profile-desc-link">\n							<i class="icon-user"></i>\n							<a href="#" class="inactive-link">{{chatVisitor.fullname}}</a>\n						</div>\n						<div class="margin-top-20 profile-desc-link">\n							<i class="icon-envelope"></i>\n							<a href="#" class="inactive-link">{{chatVisitor.email}}</a>\n						</div>\n						<div class="margin-top-20 profile-desc-link">\n							<i class="icon-globe"></i>\n							<a href="#" class="inactive-link">{{chatVisitor.remote_address}}</a>\n						</div>\n						<div class="margin-top-20 profile-desc-link">\n							<i class="icon-home"></i>\n							<a href="#" class="inactive-link">{{chatVisitor.referer}} - {{chatVisitor.ChatWebsite.name}}</a>\n						</div>\n						<div class="margin-top-20 profile-desc-link">\n							<i class="icon-cursor"></i>\n							<a href="#" class="inactive-link">{{chatVisitor.browser}}</a>\n						</div>\n						<div class="margin-top-20 profile-desc-link">\n							<i class="icon-screen-desktop"></i>\n							<a href="#" class="inactive-link">{{chatVisitor.os}}</a>\n						</div>\n					</div>\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/channels/chat/offline/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-puzzle"></i>\n					<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-bubble"></i>\n					<a href="#">{{ \'APPLICATION_CHAT\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-login"></i>\n					<a href="/channels/chat/offline/list">Offline</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/enquiry.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- START USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{chatVisitor.ChatEnquiry.email}}\n					</div>\n					<div class="profile-usertitle-job">\n						{{chatVisitor.ChatEnquiry.username}}\n					</div>\n				</div>\n				<!-- END USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.channels.chat.offline.view.detail\')}">\n							<a data-ng-href="/channels/chat/offline/view/{{chatVisitor.id}}/detail">\n							<i class="icon-tag"></i>\n							{{ \'APPLICATION_DETAIL\' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/chat/online/list/list.html",'<div class="row">\n	<div class="col-md-12">\n			<div class="page-bar">\n				<ul class="page-breadcrumb">\n					<li>\n						<i class="icon-rocket"></i>\n						<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-puzzle"></i>\n						<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-bubble"></i>\n						<a href="#">{{ \'APPLICATION_CHAT\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-login"></i>\n						<a href="/channels/chat/offline/list">Offline</a>\n					</li>\n				</ul>\n			</div>\n		</div>\n</div>\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-question font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_VISITORS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/chat/online/view/view.detail.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_DETAIL\' | translate}}</span>\n				</div>\n			</div>\n			<div class="portlet-body row" data-ng-init="initView()">\n				<div class="col-md-6">\n					<div class="news-blocks">\n						<h3>\n							<a href="#" class="inactive-link">{{\'APPLICATION_MESSAGES\' | translate}}</a>\n							<!-- <a href="#" data-ng-click="export()" data-ng-show="chatRoom.ChatMessages.length" class="btn btn-sm blue pull-right"><i class="icon-cloud-download"></i> {{\'APPLICATION_EXPORT\' | translate}} CSV </a> -->\n							<a href="api/chat/rooms/{{chatRoom.id}}/export" target="_blank" data-ng-show="chatRoom.ChatMessages.length" class="btn btn-sm blue pull-right"><i class="icon-cloud-download"></i> {{\'APPLICATION_EXPORT\' | translate}} CSV </a>\n							<hr>\n						</h3>\n						<div class="news-block-tags">\n							<em am-time-ago="chatRoom.ChatVisitor.ChatEnquiry.createdAt"></em>\n						</div>\n						<p>\n							<div ng-scrollbars ng-scrollbars-config="config">\n								<ul class="chats">\n									<li data-ng-class="{\'out\': message.User, \'in\':message.ChatVisitor}" data-ng-repeat="message in chatRoom.ChatMessages | orderBy:\'createdAt\'">\n										<img class="avatar" data-ng-src="api/users/avatar/{{message.User.userpic || \'unknown_avatar\'}}">\n										<div class="message">\n											<span class="arrow">\n											</span>\n											<a href="#" class="name">\n												{{message.User ? message.User.fullname : message.ChatVisitor.fullname}}\n											</a>\n											<span class="datetime">\n												at {{message.createdAt | date: \'medium\'}}\n											</span>\n											<span class="body">\n												{{message.body}}\n											</span>\n										</div>\n									</li>\n								</ul>\n							</div>\n						</div>\n					</div>\n					<div class="col-md-6">\n						<div class="news-blocks">\n							<h3>\n								<a href="#" class="inactive-link">{{\'APPLICATION_VISITOR\' | translate}}</a>\n								<hr>\n							</h3>\n							<div class="margin-top-20 profile-desc-link">\n								<i class="icon-user"></i>\n								<a href="#" class="inactive-link">{{chatRoom.ChatVisitor.fullname}}</a>\n							</div>\n							<div class="margin-top-20 profile-desc-link">\n								<i class="icon-envelope"></i>\n								<a href="#" class="inactive-link">{{chatRoom.ChatVisitor.email}}</a>\n							</div>\n							<div class="margin-top-20 profile-desc-link">\n								<i class="icon-globe"></i>\n								<a href="#" class="inactive-link">{{chatRoom.ChatVisitor.remote_address}}</a>\n							</div>\n							<div class="margin-top-20 profile-desc-link">\n								<i class="icon-home"></i>\n								<a href="#" class="inactive-link">{{chatRoom.ChatVisitor.referer}} - {{chatRoom.ChatVisitor.ChatWebsite.name}}</a>\n							</div>\n							<div class="margin-top-20 profile-desc-link">\n								<i class="icon-cursor"></i>\n								<a href="#" class="inactive-link">{{chatRoom.ChatVisitor.browser}}</a>\n							</div>\n							<div class="margin-top-20 profile-desc-link">\n								<i class="icon-screen-desktop"></i>\n								<a href="#" class="inactive-link">{{chatRoom.ChatVisitor.os}}</a>\n							</div>\n						</div>\n					</div>\n				</div>\n			</div>\n		</div>\n	</div>\n'),
-a.put("app/channels/chat/online/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-puzzle"></i>\n					<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-bubble"></i>\n					<a href="#">{{ \'APPLICATION_CHAT\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-login"></i>\n					<a href="/channels/chat/online/list">Online</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/enquiry.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- START USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{chatRoom.ChatVisitor.email}}\n					</div>\n					<div class="profile-usertitle-job">\n						{{chatRoom.ChatVisitor.fullname}}\n					</div>\n				</div>\n				<!-- END USER TITLE -->\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.channels.chat.online.view.detail\')}">\n							<a data-ng-href="/channels/chat/online/view/{{chatRoom.id}}/detail">\n							<i class="icon-tag"></i>\n							{{ \'APPLICATION_DETAIL\' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/chat/preview/preview.html",'<style>\n.xc_rating {\n  text-align: center;\n}\n.xc_rating_label > input{ /* HIDE RADIO */\n  display:none;\n}\n.xc_rating_label > input + img{ /* IMAGE STYLES */\n  cursor:pointer;\n  border:2px solid transparent;\n}\n.xc_rating_label > input:checked + img{ /* (CHECKED) IMAGE STYLES */\n  /*border:2px solid #f00;*/\n  background-color: #efefef;\n}\n\n.xc_label {\n  display: inline-block;\n  max-width: 100%;\n  margin-bottom: 5px;\n  font-weight: bold;\n}\n\n.xc_online_message,\n.xc_offline_message,\n.xc_rating_message\n{\n  text-align: center;\n}\n\n.xc_div_group {\n  margin: 10px 0 10px 0;\n}\n.xc_footer\n{\n  text-align: center;\n  padding-bottom: 5px;\n}\n\n.xc_powered\n{\n  color: grey;\n  font: 10px/16px "Lucida Grande","Lucida Sans Unicode",Arial,Verdana,sans-serif;\n  padding-bottom: 5px;\n}\n\n.xc_chat_container\n{\n  //width:379px;\n  //position:fixed;\n  //bottom:0;\n  //right:50px;\n  z-index:9999;\n  background-color:transparent;\n}\n\n.xc_chat_container *\n{\n  font-family:Arial,Helvetica,sans-serif;\n  font-size:13px;\n  margin:0;\n  padding:0;\n}\n\n.xc_chat_container p\n{\n  margin:5px 0;\n}\n\n.xc_signup_wrapper\n{\n  max-height:375px;\n}\n\n.xc_conversation_container\n{\n  max-height:375px;\n  list-style:none;\n  overflow:auto;\n  margin:0;\n  padding:20px 10px;\n}\n\n.xc_conversation_container a\n{\n  color:#036;\n}\n\n.xc_conversation_container a.xc_btn_style\n{\n  color:#fff;\n}\n\ndiv.xc_chat_head\n{\n  color:#fff;\n  background:{{chatWebsite.color}};\n  //border-radius: 20px 20px 0px 0px !important;\n  height:52px;\n  line-height:55px;\n  cursor:pointer;\n}\n\ndiv.xc_chat_head.rounded\n{\n  border-radius: 20px 20px 0px 0px !important;\n}\n\ndiv.xc_chat_head.squared\n{\n  //border-radius: 20px 20px 0px 0px !important;\n}\n\n.xc_chat_head-title\n{\n  margin:5px 0 0 15px;\n  color: #fff;\n}\n\n.xc_header_icon\n{\n  display:block;\n  background-image:url({{chatWebsite.remote}}/api/xchatty/assets?resource=images/icon_visitorchat.png);\n  width:21px;\n  height:16px;\n  float:right;\n  margin:20px 20px 0 0;\n}\n\n.xc_header_icon span.xc_notification_badge span\n{\n  display:block;\n  height:16px;\n  width:15px;\n  text-align:center;\n  font-size:9px;\n  color:#555;\n  position:relative;\n  top:-20px;\n  left:4px;\n  margin:0;\n  padding:0;\n}\n\n.xc_sub-head-spacer\n{\n  padding:1px;\n}\n\n.xc_conversation\n{\n  display:none;\n  margin:0 12px 0 11px;\n}\n\n.xc_chat_toggle_container\n{\n  /*background:mediumslateblue center 52px;*/\n  background: white;\n  border-style: solid;\n  border-width: 1px;\n  border-color: {{chatWebsite.color}};\n  //display:none;\n}\n\n.xc_signup_wrapper,.xc_notifications_wrapper,.xc_enquiry_wrapper,.xc_rating_wrapper\n{\n  //display:none;\n  display:block;\n  overflow:auto;\n  line-height:1;\n  padding:25px;\n}\n\n.xc_exit_chat_container\n{\n  text-align:right;\n  width:95%;\n  margin:0 auto;\n  padding:5px 1px 0 0;\n}\n\n.xc_exit_chat_container span,.xc_exit_chat_container a\n{\n  font-size:80%;\n  color:#666;\n  text-decoration:none;\n}\n\n.xc_exit_chat_container a:hover\n{\n  color:#333;\n}\n\na.xc_btn_exit_chat_confirm:hover\n{\n  color:red;\n}\n\na.xc_btn_exit_chat_cancel:hover\n{\n  color:#0c0;\n}\n\nform.xc_form_reply\n{\n  position:relative;\n}\n\n.xc_form_reply\n{\n  /*background-color:#e3e3e3;*/\n  text-align:center;\n  /*border-top:1px solid #d3d3d3;*/\n}\n\n.xc_input_message\n{\n  height:100px;\n  margin:10px auto 5px;\n}\n\n.xc_input_enquiry_message,\n.xc_input_rating_message\n{\n  height:100px;\n}\n\n.xc_form_signup,.xc_form_enquiry,.xc_form_rating\n{\n  /*text-align:center;*/\n}\n\n.xc_chat_container textarea,.xc_chat_container input[type=text]\n{\n  width:95%;\n  min-width:95%;\n  max-width:95%;\n  -webkit-box-sizing:border-box;\n  -moz-box-sizing:border-box;\n  box-sizing:border-box;\n  background-color:#fff;\n  border:1px solid #ccc;\n  -webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);\n  -moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);\n  box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);\n  -webkit-transition:border linear .2s, box-shadow linear .2s;\n  -moz-transition:border linear .2s, box-shadow linear .2s;\n  -o-transition:border linear .2s, box-shadow linear .2s;\n  transition:border linear .2s, box-shadow linear .2s;\n  display:inline-block;\n  font-size:14px;\n  line-height:20px;\n  color:#555;\n  -webkit-border-radius:4px;\n  -moz-border-radius:4px;\n  border-radius:4px;\n  vertical-align:middle;\n  margin:3px 0;\n  padding:4px 6px;\n  resize: none;\n}\n\n.xc_chat_container textarea:focus,.xc_chat_container input[type=text]:focus\n{\n  outline: {{chatWebsite.color_focus}} auto 5px;\n}\n\n.xc_chat_container input[type=text]\n{\n  height: 30px;\n}\n\n.xc_message_sending textarea, .xc_enquiry_sending textarea\n{\n  background: #fff url({{chatWebsite.remote}}/api/xchatty/assets?resource=images/loading.gif) 98% 5px no-repeat;\n}\n\n.xc_chatrow\n{\n  display:block;\n  border-top:1px dashed #e3e3e3;\n  margin:5px 0;\n  clear: both;\n}\n\n.xc_chatrow p\n{\n  color:#444;\n  word-wrap:break-word;\n}\n\n.xc_time\n{\n  float:right;\n  font-size:80%;\n  color:#ccc;\n  padding-left:12px;\n  margin:3px;\n}\n\n.xc_submission_pending\n{\n  background:transparent url({{chatWebsite.remote}}/api/xchatty/assets?resource=images/bullet_clock.png) left center norepeat;\n}\n\n.xc_submission_confirmed\n{\n  background:transparent url({{chatWebsite.remote}}/api/xchatty/assets?resource=images/bullet_tick.png) left center norepeat;\n}\n\n.xc_fullname\n{\n  font-weight:700;\n}\n\n.xc_fullname:after\n{\n  content:":";\n}\n\n.xc_avatar\n{\n  float: left;\n  margin: 0 5px 5px 0;\n  display: inline-block;\n  width: 40px;\n  height: 40px;\n  border-radius: 5px;\n  -moz-border-radius: 5px;\n  -webkit-border-radius: 5px;\n}\n\n.xc_smilie\n{\n  background-repeat:no-repeat;\n  display:inline-block;\n  width:18px;\n  height:18px;\n  text-indent:-9999px;\n  white-space:nowrap;\n}\n\n.xc_btn_load_more\n{\n  width:100%!important;\n}\n\n.xc_notifications_wrapper\n{\n  text-shadow:0 1px 0 rgba(255,255,255,0.5);\n}\n\n.xc_notification_success\n{\n  color:#468847;\n}\n\n.xc_notification_error\n{\n  color:#b94a48;\n}\n\n.xc_errorlist\n{\n  margin:0 0 0 25px;\n  padding:0;\n}\n\ni.xc_btn_notifications_close\n{\n  float:right;\n  font-weight:700;\n  font-size:20px;\n  color:#ccc;\n  cursor:pointer;\n  margin:-15px 0 0;\n  padding:0;\n}\n\n.xc_btn_style\n{\n  width:95%;\n  text-align:center;\n  line-height:1.2;\n  font-size:90%;\n  -moz-box-shadow:inset 0 1px 0 0 {{chatWebsite.color_button}};\n  -webkit-box-shadow:inset 0 1px 0 0 {{chatWebsite.color_button}};\n  box-shadow:inset 0 1px 0 0 {{chatWebsite.color_button}};\n  background:0;\n  background-color:{{chatWebsite.color_button}};\n  -moz-border-radius:4px;\n  -webkit-border-radius:4px;\n  border-radius:4px;\n  border:1px solid {{chatWebsite.color_button}};\n  display:inline-block;\n  color:#fff;\n  font-weight:700;\n  text-decoration:none;\n  text-shadow:1px 1px 0 #000c17;\n  margin:0 auto 5px;\n  padding:2px 0;\n}\n\n.xc_btn_style:hover\n{\n  background:0;\n  background-color:{{chatWebsite.color_button}};\n  color: #fff;\n  text-decoration: none;\n}\n\n.xc_btn_style:active\n{\n  position:relative;\n  top:1px;\n}\n\n.xc_composing_container\n{\n  display: none;\n  width: 95%;\n  margin: 0 auto;\n  background: transparent url({{chatWebsite.remote}}/api/xchatty/assets?resource=images/bullet_pencil.png) 6px center no-repeat;\n  padding-left: 19px;\n  font-style: italic;\n}\n\n@media only screen and (max-height: 620px) {\n  .xc_conversation_container\n  {\n    max-height:300px!important;\n  }\n}\n\n@media only screen and (max-height: 545px) {\n  .xc_conversation_container\n  {\n    max-height:200px!important;\n  }\n}\n\n@media only screen and (max-height: 445px) {\n  .xc_conversation_container\n  {\n    max-height:150px!important;\n  }\n}\n\n@media only screen and (max-width: 480px) {\n  .xc_chat_container\n  {\n    width:95%!important;\n    right:auto!important;\n    -webkit-border-top-left-radius:15px;\n    -webkit-border-top-right-radius:15px;\n    -moz-border-radius-topleft:15px;\n    -moz-border-radius-topright:15px;\n    border-top-left-radius:15px;\n    border-top-right-radius:15px;\n    box-shadow:0 0 5px rgba(0,0,0,.5);\n    -webkit-box-shadow:0 0 5px rgba(0,0,0,.5);\n    -moz-box-shadow:0 0 5px rgba(0,0,0,.5);\n  }\n\n  div.xc_chat_head\n  {\n    background-color:#036;\n    background-image:none;\n    line-height:25px;\n    height:auto;\n    -webkit-border-top-left-radius:15px;\n    -webkit-border-top-right-radius:15px;\n    -moz-border-radius-topleft:15px;\n    -moz-border-radius-topright:15px;\n    border-top-left-radius:15px;\n    border-top-right-radius:15px;\n    padding:10px;\n  }\n\n  .xc_chat_toggle_container\n  {\n    background-color:#fff;\n    background-image:none;\n    border-color:#036;\n    border-style:solid;\n    border-width:0 1px;\n  }\n\n  .xc_header_icon\n  {\n    background-image:url({{chatWebsite.remote}}/api/xchatty/assets?resource=images/icon_visitorchat.png);\n    margin:0;\n  }\n\n  .xc_header_icon span.xc_notification_badge span\n  {\n    top:-5px;\n    left:5px;\n  }\n\n  .xc_notification_success\n  {\n    background-color:#dff0d8;\n    border:1px solid #d6e9c6;\n  }\n\n  .xc_conversation_container\n  {\n    max-height:375px;\n    border-color:#036;\n  }\n\n  .xc_notification_error\n  {\n    background-color:#f2dede;\n    border:1px solid #eed3d7;\n  }\n\n  .xc_sub-head-spacer\n  {\n    display:none;\n    padding:0;\n  }\n\n  .xc_chat_head-title,.xc_conversation\n  {\n    margin:0;\n  }\n}\n</style>\n<div class="xc_chat_container">\n  <div class="xc_chat_head {{chatWebsite.header_shape}}">\n    <i class="xc_header_icon">\n      <span class="xc_notification_badge">\n        <span class="xc_notification_badge_number"></span>\n      </span>\n    </i>\n    <span class="xc_chat_head-title">{{statePreview.state == \'online\' ? chatWebsite.header_online : chatWebsite.header_offline}}</span>\n  </div>\n  <div class="xc_chat_toggle_container">\n    <div class="xc_sub-head-spacer"></div>\n    <!-- <div class="xc_notifications_wrapper">\n    <ul class="xc_errorlist"></ul>\n  </div> -->\n  <div class="xc_enquiry_wrapper" data-ng-show=\'statePreview.state == "offline"\'>\n    <form class="xc_form_enquiry" accept-charset="UTF-8">\n      <p class="xc_offline_message" ng-bind-html=\'chatWebsite.offline_message\'></p>\n      <br>\n      <div ng-if="chatWebsite.enquiry_enable">\n        <div class="xc_div_group">\n          <label for="enquiryFullname" class="xc_label">Name *</label>\n          <input id="enquiryFullname" maxlength="45" data-label="Name" type="text" name="data[Enquiry][fullname]" placeholder="{{chatWebsite.username_placeholder}}" class="xc_input_enquiry_fullname" required/>\n        </div>\n        <br>\n        <div class="xc_div_group">\n          <label for="enquiryEmail" class="xc_label">Email Address *</label>\n          <input id="enquiryEmail" maxlength="85" type="text" data-label="Email Address" name="data[Enquiry][email]" placeholder="{{chatWebsite.email_placeholder}}" class="xc_input_enquiry_email" required/>\n        </div>\n        <br>\n        <div class="xc_div_group">\n          <label for="enquiryMessage" class="xc_label">Message*</label>\n          <textarea id="enquiryMessage" data-label="Message" maxlength="1500" placeholder="{{chatWebsite.enquiry_message_placeholder}}" name="data[Enquiry][message]" class="xc_input_enquiry_message" required></textarea>\n        </div>\n        <br>\n        <button type="submit" class="xc_btn_enquiry xc_btn_style">{{chatWebsite.enquiry_button}}</button>\n      </div>\n    </form>\n  </div>\n  <div class="xc_signup_wrapper" data-ng-show=\'statePreview.state == "online"\'>\n    <form class="xc_form_signup" accept-charset="UTF-8">\n      <p class="xc_online_message" ng-bind-html=\'chatWebsite.online_message\'></p>\n      <br>\n      <div class="xc_div_group">\n        <label for="dataFullname" class="xc_label">Fullname *</label>\n        <input maxlength="45" id="dataFullname" data-label="Fullname" type="text" name="data[Discussion][fullname]" placeholder="{{chatWebsite.username_placeholder}}" class="xc_input_fullname" required/>\n      </div>\n      <br>\n      <div class="xc_div_group">\n        <label for="dataEmail" class="xc_label">Email Address *</label>\n        <input maxlength="85" id="dataEmail" data-label="Email Address" type="text" name="data[Discussion][email]" placeholder="{{chatWebsite.email_placeholder}}" class="xc_input_email" required/>\n      </div>\n      <br>\n      <input type="hidden" class="xc_input_visitor_time" name="data[Discussion][visitor_time]" />\n      <button type="submit" class="xc_btn_signup xc_btn_style">{{chatWebsite.start_chat_button}}</button>\n    </form>\n  </div>\n  <div class="xc_rating_wrapper" data-ng-show=\'statePreview.state == "rating"\'>\n    <form class="xc_form_rating" accept-charset="UTF-8">\n      <p class="xc_rating_message">{{chatWebsite.rating_message}}</p>\n      <br>\n      <div class="xc_rating">\n        <label class="xc_rating_label" style="padding:30px;">\n          <input type="radio" name="data[Rating][rating]" value="good" />\n          <img src="{{chatWebsite.remote}}/api/xchatty/assets?resource=images/like.png" alt="Good" height="50"/>\n        </label>\n        <label class="xc_rating_label" style="padding:30px;">\n          <input type="radio" name="data[Rating][rating]" value="bad"/>\n          <img src="{{chatWebsite.remote}}/api/xchatty/assets?resource=images/dislike.png" alt="Good" height="50"/>\n        </label>\n      </div>\n      <div class="xc_div_group">\n        <label for="ratingMessage" class="xc_label">Message</label>\n        <textarea id="ratingMessage" data-label="Message" maxlength="1500" name="data[Rating][message]" class="xc_input_rating_message"></textarea>\n      </div>\n      <button type="submit" class="xc_button_rating xc_btn_style">{{chatWebsite.rating_send}}</button>\n      <button type="button" class="xc_button_skip_rating xc_btn_style">{{chatWebsite.rating_skip}}</button>\n    </form>\n  </div>\n  <div class="xc_footer">\n    <div class="xc_powered"><a>Powered by Xenialab | Trademark xCALLY</a></div>\n  </div>\n</div>\n</div>\n'),a.put("app/channels/chat/queue/list/list.create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_QUEUE\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.general.name.$touched || form.general.$submitted) && form.general.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n      <span data-ng-show="(form.general.name.$touched || form.general.$submitted) && form.general.name.$invalid && form.general.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"/>\n    </div>\n    <!-- END DESCRIPTION -->\n\n    <!-- START TIMEOUT -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.general.timeout.$touched || form.general.$submitted) && form.general.timeout.$invalid}">\n      <label class="control-label">{{\'APPLICATION_AGENT_TIMEOUT\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="number" name="timeout" placeholder="Timeout" class="form-control" data-ng-model="item.timeout" required/>\n      <span data-ng-show="(form.general.timeout.$touched || form.general.$submitted) && form.general.timeout.$invalid && form.general.timeout.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END TIMEOUT -->\n\n    <!-- START HEADER SHAPE -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.general.strategy.$touched || form.general.$submitted) && form.general.strategy.$invalid}">\n      <label class="control-label">{{\'APPLICATION_STRATEGY\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <ui-select data-ng-model="item.strategy" name="strategy" theme="bootstrap" required>\n        <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.toUpperCase()}}</ui-select-match>\n        <ui-select-choices repeat="strategy in [\'rrmemory\',\'beepall\'] | filter: $select.search">\n          <div ng-bind-html="strategy.toUpperCase() | highlight: $select.search"></div>\n        </ui-select-choices>\n      </ui-select>\n      <span data-ng-show="(form.general.strategy.$touched || form.general.$submitted) && form.general.strategy.$invalid && form.general.strategy.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END HEADER SHAPE -->\n\n\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="save()" ng-disabled="form.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/channels/chat/queue/list/list.html",'<div class="row">\n	<div class="col-md-12">\n			<div class="page-bar">\n				<ul class="page-breadcrumb">\n					<li>\n						<i class="icon-rocket"></i>\n						<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-puzzle"></i>\n						<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-bubble"></i>\n						<a href="#">{{ \'APPLICATION_CHAT\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-docs"></i>\n						<a href="#">{{ \'APPLICATION_QUEUES\' | translate }}</a>\n					</li>\n				</ul>\n			</div>\n		</div>\n</div>\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-docs font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_QUEUES\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<a class="btn green-jungle " href="#"  data-ng-click="createItem()">\n						<i class="icon-plus"></i> {{ \'APPLICATION_NEW_QUEUE\' | translate }}\n					</a>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/chat/queue/view/view.agents.html",'<div class="row" data-ng-init="getTeams()">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_AGENTS\' | translate}}</span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- BEGIN FORM-->\n				<form action="index.html" class="form-horizontal form-row-seperated">\n					<div class="form-body">\n						<label for="penalty">{{\'APPLICATION_PENALTY\' | translate}}</label>\n						<div class="input-group input-small mbottom20">\n							<input type="number" class="spinner-input form-control" maxlength="3" data-ng-model="queue.penalty" readonly>\n							<div class="spinner-buttons input-group-btn btn-group-vertical">\n								<button type="button" class="btn spinner-up btn-xs blue" data-ng-click="queue.penalty=queue.penalty+1">\n									<i class="fa fa-angle-up"></i>\n								</button>\n								<button type="button" class="btn spinner-down btn-xs blue" data-ng-disabled="!queue.penalty" data-ng-click="queue.penalty=queue.penalty-1">\n									<i class="fa fa-angle-down"></i>\n								</button>\n							</div>\n						</div>\n						<div class="form-group last">\n							<div class="col-md-12" id="multi-select-team">\n							</div>\n						</div>\n					</div>\n				</form>\n				<!-- END FORM-->\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/channels/chat/queue/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getQueue()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-bubble"></i>\n					<a href="#">{{ \'APPLICATION_CHAT\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-docs"></i>\n					<a href="/channels/chat/queues/list">{{ \'APPLICATION_QUEUES\' | translate }}</a>\n					<i data-ng-show="queue" class="fa fa-angle-right"></i>\n				</li>\n				<li data-ng-show="queue">\n					<a href="#">{{queue.name}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/queue.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{queue.name}}\n					</div>\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.channels.chat.queues.view.settings\')}">\n							<a data-ng-href="/channels/chat/queues/view/{{queue.id}}/settings">\n							<i class="icon-settings"></i>\n							{{ \'APPLICATION_SETTINGS\' | translate}} </a>\n						</li>\n						<li data-ng-class="{active: $state.is(\'main.channels.chat.queues.view.agents\')}">\n							<a data-ng-href="/channels/chat/queues/view/{{queue.id}}/agents">\n							<i class="icon-people"></i>\n							{{ \'APPLICATION_AGENTS\' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/chat/queue/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_SETTINGS\' | translate}}</span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<form name="forms.general" data-ng-submit="forms.general.$valid && updateChatQueue()" novalidate>\n					<!-- START NAME -->\n					<div class="form-group" data-ng-class="{\'has-error\': (forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid}">\n						<label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n						<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="queue.name" required/>\n						<span data-ng-show="(forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid && forms.general.name.$error.required" class="help-block help-block-error">\n							<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n						</span>\n					</div>\n					<!-- END NAME -->\n\n					<!-- START DESCRIPTION -->\n					<div class="form-group">\n						<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n						<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="queue.description"/>\n					</div>\n					<!-- END DESCRIPTION -->\n\n					<!-- START TIMEOUT -->\n					<div class="form-group">\n						<label class="control-label">{{\'APPLICATION_AGENT\' | translate}} {{\'APPLICATION_TIMEOUT\' | translate}}</label>\n						<input type="number" name="timeout" placeholder="{{\'APPLICATION_TIMEOUT\' | translate}}" class="form-control" min="1" data-ng-model="queue.timeout"/>\n					</div>\n					<!-- END TIMEOUT -->\n\n					<!-- START HEADER SHAPE -->\n					<div class="form-group" data-ng-class="{\'has-error\': (forms.general.strategy.$touched || forms.general.$submitted) && forms.general.strategy.$invalid}">\n						<label class="control-label">{{\'APPLICATION_STRATEGY\' | translate}}</label>\n						<!-- <input colorpicker type="text" name="animationToggle" placeholder="{{\'APPLICATION_BUTTON_COLOR\' | translate}}" class="form-control" data-ng-model="chatWebsite.animation" required/> -->\n						<ui-select data-ng-model="queue.strategy" name="strategy" theme="bootstrap">\n							<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.toUpperCase()}}</ui-select-match>\n							<ui-select-choices repeat="strategy in [\'rrmemory\',\'beepall\'] | filter: $select.search">\n								<div ng-bind-html="strategy.toUpperCase() | highlight: $select.search"></div>\n							</ui-select-choices>\n						</ui-select>\n					</div>\n					<!-- END HEADER SHAPE -->\n					<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n				</form>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/channels/chat/realtime/view/agent/agent.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initAgents()">\n	<div class="col-md-12">\n		<!-- START TABLE -->\n		<div ui-grid="gridOptions"  ui-grid-resize-columns  class="ui-grid" ui-grid-tree-view ui-grid-expandable-row ui-grid-pagination auto-resize>\n			<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n		</div>\n		<!-- END TABLE -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/chat/realtime/view/agent/agent.modal.info.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_INTERFACE_INFO\' | translate }}</h3>\n</div>\n<div class="modal-body">\n<div data-ng-if="agent.ipaddr" class="well">\n  <div>{{agent.ipaddr}}:{{agent.port}}</div>\n  <div>{{agent.fullcontact}}</div>\n  <div>{{agent.useragent}}</div>\n  <div>{{agent.lastms}}</div>\n</div>\n<div data-ng-if="!agent.ipaddr" class="alert alert-danger" role="alert">\n  {{\'MESSAGE_NO_AVAILABLE_INFO\' | translate}}\n</div>\n</div>\n<div class="modal-footer">\n  <button class="btn default" type="button" ng-click="close()">{{ \'APPLICATION_CLOSE\' | translate }}</button>\n</div>\n'),a.put("app/channels/chat/realtime/view/agent/queue.modal.add.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_JOIN_QUEUE\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n\n    <div class="form-group row">\n  <label class="col-md-2 control-label" style="margin-top: 7px;">{{\'APPLICATION_QUEUE\' | translate}}:</label>\n  <div class="col-md-10">\n    <ui-select multiple ng-model="item.queues" theme="bootstrap" required>\n      <ui-select-match placeholder="{{\'APPLICATION_QUEUE\' | translate}}">{{$item.name}}</ui-select-match>\n      <ui-select-choices repeat="queue.id as queue in queues | filter: $select.search">\n        <div ng-bind-html="queue.name | highlight: $select.search"></div>\n      </ui-select-choices>\n    </ui-select>\n  </div>\n</div>\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="save()" ng-disabled="form.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/channels/chat/realtime/view/queue/queue.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initQueues()">\n	<div class="col-md-12">\n		<!-- START TABLE -->\n		<div ui-grid="gridOptions"  ui-grid-resize-columns class="ui-grid" ui-grid-tree-view auto-resize>\n			<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n		</div>\n		<!-- END TABLE -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),
-a.put("app/channels/chat/realtime/view/session/session.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initSessions()">\n	<div class="col-md-12">\n		<!-- START TABLE -->\n		<div ui-grid="gridOptions"  ui-grid-resize-columns class="ui-grid" auto-resize>\n			<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n		</div>\n		<!-- END TABLE -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/chat/realtime/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-puzzle"></i>\n					<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-bubble"></i>\n					<a href="#">{{ \'APPLICATION_CHAT\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-energy"></i>\n					<a href="#">{{ \'APPLICATION_REALTIME\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<div>\n			<nav class="navbar navbar-default" role="navigation">\n				<div class="collapse navbar-collapse">\n					<ul class="nav navbar-nav">\n						<li data-ng-class="{\'active\': $state.is(\'main.channels.chat.realtime.view.agents\')}">\n							<a href="/channels/chat/realtime/view/agents">\n								{{\'APPLICATION_AGENTS\' | translate}}\n							</a>\n						</li>\n					</ul>\n				</div>\n			</nav>\n		</div>\n\n		<div ui-view></div>\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/chat/visitor/list/list.html",'<div class="row">\n	<div class="col-md-12">\n			<div class="page-bar">\n				<ul class="page-breadcrumb">\n					<li>\n						<i class="icon-rocket"></i>\n						<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-puzzle"></i>\n						<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-bubble"></i>\n						<a href="#">{{ \'APPLICATION_CHAT\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-question"></i>\n						<a href="/channels/chat/visitors/list">{{ \'APPLICATION_VISITORS\' | translate }}</a>\n					</li>\n				</ul>\n			</div>\n		</div>\n</div>\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-question font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_VISITORS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/chat/visitor/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-puzzle"></i>\n					<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-bubble"></i>\n					<a href="#">{{ \'APPLICATION_CHAT\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-question"></i>\n					<a href="/channels/chat/visitors/list">{{ \'APPLICATION_VISITORS\' | translate }}</a>\n					<i  class="fa fa-angle-right"></i>\n				</li>\n				<li data-ng-show="chatVisitor">\n					<a href="#">{{chatVisitor.fullname}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/visitor.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{chatVisitor.fullname}}\n					</div>\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.channels.chat.visitors.view.profile\')}">\n							<a data-ng-href="/channels/chat/visitors/view/{{chatVisitor.id}}/profile">\n							<i class="icon-tag"></i>\n							{{ \'APPLICATION_PROFILE\' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/chat/visitor/view/view.profile.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_PROFILE\' | translate}}</span>\n				</div>\n			</div>\n			<div class="portlet-body" data-ng-init="initView()">\n				<div>\n					<h4 class="profile-desc-title">{{chatVisitor.email}}</h4>\n					<div class="margin-top-20 profile-desc-link">\n						<i class="icon-magnifier"></i>\n						<a href="#" class="inactive-link">{{chatVisitor.origin}}</a>\n					</div>\n					<div class="margin-top-20 profile-desc-link">\n						<i class="icon-globe"></i>\n						<a href="#" class="inactive-link">{{chatVisitor.remote_address}}</a>\n					</div>\n					<div class="margin-top-20 profile-desc-link">\n						<i class="icon-user"></i>\n						<a href="#" class="inactive-link">{{chatVisitor.user_agent | truncate: 50: \'...\'}}</a>\n					</div>\n					<div class="margin-top-20 profile-desc-link">\n						<i class="icon-flag"></i>\n						<a href="#" class="inactive-link">{{chatVisitor.visitor_language}}</a>\n					</div>\n					<div class="margin-top-20 profile-desc-link">\n						<i class="icon-home"></i>\n						<a href="#" class="inactive-link">{{chatVisitor.referer}}</a>\n					</div>\n					<div class="margin-top-20 profile-desc-link">\n						<i class="icon-cursor"></i>\n						<a href="#" class="inactive-link">{{chatVisitor.browser}}</a>\n					</div>\n					<div class="margin-top-20 profile-desc-link">\n						<i class="icon-screen-desktop"></i>\n						<a href="#" class="inactive-link">{{chatVisitor.os}}</a>\n					</div>\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/channels/chat/website/list/list.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-puzzle"></i>\n					<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-bubble"></i>\n					<a href="#">{{ \'APPLICATION_CHAT\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-globe"></i>\n					<a href="#">{{ \'APPLICATION_WEB_SITES\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n	</div>\n</div>\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-notebook font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_WEB_SITES\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<a class="btn green-jungle" href="/channels/chat/websites/wizard">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_WEB_SITE\' | translate }}\n						</a>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/chat/website/view/action/list/list.html",'<div class="row" data-ng-init="initActons()">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_ACTIONS\' | translate}}</span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<a class="btn green-jungle" href="/channels/chat/websites/view/{{chatWebsite.id}}/actions/wizard" data-toggle="dropdown">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_ACTION\' | translate }}\n						</a>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/channels/chat/website/view/action/view/view.html",'\n<div class="row" data-ng-init="initAction()">\n	<div class="col-md-12">\n		<!-- BEGIN  PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-directions font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_ACTION\' | translate }}</a> </span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<form name="forms.settings" ng-submit="updateItem()" novalidate>\n					<!-- START APP -->\n					<div class="form-group"  data-ng-class="{\'has-error\': (forms.settings.app.$touched || forms.settings.$submitted) && forms.settings.app.$invalid}">\n						<label class="control-label">{{ \'APPLICATION_APPLICATION\' | translate }}<span class="required" aria-required="true">*</span></label>\n						<ui-select data-ng-model="application.app" name="app" theme="bootstrap" required>\n							<ui-select-match placeholder="{{ \'APPLICATION_APPLICATION\' | translate }}">{{$select.selected.name}}</ui-select-match>\n							<ui-select-choices repeat="app.value as app in apps | filter: $select.search">\n								<div ng-bind-html="app.name | highlight: $select.search"></div>\n							</ui-select-choices>\n						</ui-select>\n						<span data-ng-show="(forms.settings.app.$touched || forms.settings.$submitted) && forms.settings.app.$invalid && forms.settings.app.$error.required" class="help-block help-block-error">\n							<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n						</span>\n					</div>\n					<!-- END APP -->\n\n					<!-- START HOST -->\n					<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid}">\n						<label class="control-label">{{\'APPLICATION_TIMEOUT\' | translate}} <span class="required" aria-required="true">*</span></label>\n						<input type="number" name="timeout" placeholder="{{\'APPLICATION_TIMEOUT\' | translate}}" class="form-control" data-ng-model="application.timeout" min="0" required/>\n						<span data-ng-show="(forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid && forms.settings.timeout.$error.required" class="help-block help-block-error">\n							<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n						</span>\n					</div>\n					<!-- END HOST -->\n\n					<div class="app-settings" ng-slide-down="application.app === \'queue\'" lazy-render duration="1" data-ng-init="getQueues()">\n						<!-- START QUEUE -->\n						<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.queue.$touched || forms.settings.$submitted) && forms.settings.queue.$invalid}">\n							<label class="control-label">{{\'APPLICATION_QUEUE\' | translate}}<span class="required" aria-required="true">*</span></label>\n							<ui-select data-ng-model="application.ChatQueueId" name="queue" theme="bootstrap" required>\n								<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n								<ui-select-choices repeat="queue.id as queue in queues | filter: $select.search">\n									<div ng-bind-html="queue.name | highlight: $select.search"></div>\n								</ui-select-choices>\n							</ui-select>\n							<span data-ng-show="(forms.settings.queue.$touched || forms.settings.$submitted) && forms.settings.queue.$error.required" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n						</div>\n						<!-- END QUEUE -->\n					</div>\n\n					<div class="app-settings" ng-slide-down="application.app === \'agent\'" lazy-render duration="1" data-ng-init="getAgents()">\n						<!-- START AGENT -->\n						<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.agent.$touched || forms.settings.$submitted) && forms.settings.agent.$invalid}">\n							<label class="control-label">{{\'APPLICATION_AGENT\' | translate}}<span class="required" aria-required="true">*</span></label>\n							<ui-select data-ng-model="application.UserId" name="agent" theme="bootstrap" required>\n								<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.fullname}}</ui-select-match>\n								<ui-select-choices repeat="agent.id as agent in agents | filter: $select.search">\n									<div ng-bind-html="agent.fullname | highlight: $select.search"></div>\n								</ui-select-choices>\n							</ui-select>\n							<span data-ng-show="(forms.settings.agent.$touched || forms.settings.$submitted) && forms.settings.agent.$error.required" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n						</div>\n						<!-- END AGENT -->\n					</div>\n\n					<!-- START INTERVAL_TYPE -->\n					<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.intType.$touched || forms.settings.$submitted) && forms.settings.intType.$invalid}">\n						<label class="control-label">{{ \'APPLICATION_INTERVAL_TYPE\' | translate }}<span class="required" aria-required="true">*</span></label>\n						<ui-select data-ng-model="application.intType" theme="bootstrap" name="intType" required>\n							<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{ $select.selected.name | translate }}</ui-select-match>\n							<ui-select-choices repeat="intType.value as intType in $application.intTypes | filter: $select.search">\n								{{ intType.name | translate }}\n							</ui-select-choices>\n						</ui-select>\n						<span data-ng-show="(forms.settings.intType.$touched || forms.settings.$submitted) && forms.settings.intType.$error.required" class="help-block help-block-error">\n							<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n						</span>\n					</div>\n					<!-- END INTERVAL_TYPE -->\n\n					<div class="app-settings" ng-slide-down="application.intType === \'custom\'" lazy-render duration="1">\n						<!-- START TIME -->\n						<div class="form-group">\n							<label class="control-label">{{ \'APPLICATION_TIME\' | translate }}</label>\n							<div class="input-group input-large">\n								<fieldset class="pull-left" ng-disabled="application.alwaysTime">\n									<uib-timepicker name="t_from" data-ng-model="application.t_from" show-meridian="false" show-spinners="false" mousewheel="false"></uib-timepicker>\n								</fieldset>\n								<div class="input-group-addon col-md-1 interval-to pull-left">to</div>\n								<fieldset ng-disabled="application.alwaysTime"><uib-timepicker  name="t_to" data-ng-model="application.t_to" show-meridian="false" show-spinners="false" mousewheel="false"></uib-timepicker></fieldset>\n								<!-- <label class="control-label pointer-cursor"><input type="checkbox" data-ng-model="application.alwaysTime">{{\'APPLICATION_ALWAYS\' | translate}}</label> -->\n							</div>\n						</div>\n						<!-- END TIME -->\n\n						<!-- START ALWAYS -->\n						<div class="form-group">\n							<label class="control-label">{{ \'APPLICATION_ALWAYS\' | translate }}</label>\n							<div class="input-group input-large">\n								<label class="control-label pointer-cursor">\n									<input\n										bs-switch\n										data-ng-model="application.alwaysTime"\n										type="checkbox"\n										switch-active="{{ isActive }}"\n										switch-on-text="{{ \'APPLICATION_YES\' | translate }}"\n										switch-off-text="{{ \'APPLICATION_NO\' | translate }}"\n										switch-on-color="{{ onColor }}"\n										switch-off-color="{{ offColor }}"\n										switch-animate="{{ animate }}"\n										switch-size="{{ size }}"\n										switch-label="{{ label }}"\n										switch-icon="{{ icon }}"\n										switch-radio-off="{{ radioOff }}"\n										switch-label-width="{{ labelWidth }}"\n										switch-handle-width="{{ handleWidth }}">\n									<!-- <input type="checkbox" data-ng-model="application.alwaysTime"> -->\n								</label>\n							</div>\n						</div>\n						<!-- END ALWAYS -->\n\n						<!-- START WEEKDAY -->\n						<div class="form-group">\n							<label class="control-label">{{ \'APPLICATION_WEEKDAY\' | translate }}</label>\n							<div class="input-group input-large">\n								<ui-select data-ng-model="application.wd_from" theme="bootstrap" name="wd_from">\n									<ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n									<ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n										{{ weekDay.name | translate}}\n									</ui-select-choices>\n								</ui-select>\n								<span class="input-group-addon">to</span>\n								<ui-select data-ng-model="application.wd_to" theme="bootstrap" name="wd_to">\n									<ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n									<ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n										{{ weekDay.name | translate }}\n									</ui-select-choices>\n								</ui-select>\n							</div>\n						</div>\n						<!-- END WEEKDAY -->\n\n						<!-- START MONTHDAY -->\n						<div class="form-group">\n							<label class="control-label">{{ \'APPLICATION_MONTHDAY\' | translate }}</label>\n							<div class="input-group input-large">\n								<ui-select data-ng-model="application.md_from" theme="bootstrap" name="md_from">\n									<ui-select-match>{{$select.selected}}</ui-select-match>\n									<ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n										{{monthDay}}\n									</ui-select-choices>\n								</ui-select>\n								<span class="input-group-addon">to</span>\n								<ui-select data-ng-model="application.md_to" theme="bootstrap" name="md_to">\n									<ui-select-match>{{$select.selected}}</ui-select-match>\n									<ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n										{{monthDay}}\n									</ui-select-choices>\n								</ui-select>\n							</div>\n						</div>\n						<!-- END MONTHDAY -->\n\n						<!-- START MONTH -->\n						<div class="form-group">\n							<label class="control-label">{{ \'APPLICATION_MONTH\' | translate }}</label>\n							<div class="input-group input-large">\n								<ui-select data-ng-model="application.m_from" theme="bootstrap" name="m_from">\n									<ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n									<ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n										{{ month.name | translate }}\n									</ui-select-choices>\n								</ui-select>\n								<span class="input-group-addon">to</span>\n								<ui-select data-ng-model="application.m_to" theme="bootstrap" name="m_to">\n									<ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n									<ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n										{{ month.name | translate }}\n									</ui-select-choices>\n								</ui-select>\n							</div>\n						</div>\n						<!-- END MONTH -->\n					</div>\n\n					<div class="app-settings" ng-slide-down="application.intType === \'list\'" lazy-render duration="1" data-ng-init="getIntervals()">\n\n						<!-- START INTERVALS -->\n						<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.IntervalId.$touched || forms.settings.$submitted) && forms.settings.IntervalId.$invalid}">\n							<label class="control-label">{{\'APPLICATION_INTERVALS\' | translate}}<span class="required" aria-required="true">*</span></label>\n							<ui-select data-ng-model="application.IntervalId" theme="bootstrap" name="IntervalId" required>\n								<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{ $select.selected.name}}</ui-select-match>\n								<ui-select-choices repeat="interval.id as interval in intervals | filter: $select.search">\n									{{ interval.name}}\n								</ui-select-choices>\n							</ui-select>\n							<span data-ng-show="(forms.settings.IntervalId.$touched || forms.settings.$submitted) && forms.settings.IntervalId.$error.required" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n						</div>\n						<!-- END INTERVALS -->\n\n					</div>\n					<button class="btn green-haze" type="submit">{{\'APPLICATION_UPDATE\' | translate}}</button>\n				</form>\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/chat/website/view/action/wizard/wizard.html",'\n<div class="row" data-ng-init="initWizard()">\n	<div class="col-md-12">\n		<!-- BEGIN  PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-directions font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_ACTION\' | translate }} WIZARD</a> </span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<wizard on-finish="createItem()">\n					<wz-step title="{{\'APPLICATION_APPLICATION\' | translate}}" canexit="formValidation(forms.action.$valid)">\n						<form name="forms.action" novalidate>\n							<!-- START APP -->\n							<div class="form-group"  data-ng-class="{\'has-error\': forms.action.$submitted && forms.action.app.$invalid}">\n								<label class="control-label">{{ \'APPLICATION_APPLICATION\' | translate }}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="application.app" name="app" theme="bootstrap" required>\n									<ui-select-match placeholder="{{ \'APPLICATION_APPLICATION\' | translate }}">{{$select.selected.name}}</ui-select-match>\n									<ui-select-choices repeat="app.value as app in apps | filter: $select.search">\n										<div ng-bind-html="app.name | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span data-ng-show="forms.action.$submitted && forms.action.app.$invalid" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END APP -->\n\n							<!-- START HOST -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.action.timeout.$touched || forms.action.$submitted) && forms.action.timeout.$invalid}">\n								<label class="control-label">{{\'APPLICATION_TIMEOUT\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="number" name="timeout" placeholder="{{\'APPLICATION_TIMEOUT\' | translate}}" class="form-control" data-ng-model="application.timeout" min="0" required/>\n								<span data-ng-show="(forms.action.timeout.$touched || forms.action.$submitted) && forms.action.timeout.$invalid && forms.action.timeout.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END HOST -->\n\n							<div class="app-settings" ng-slide-down="application.app === \'queue\'" lazy-render duration="1" data-ng-init="getQueues()">\n								<!-- START QUEUE -->\n								<div class="form-group" data-ng-class="{\'has-error\': (forms.action.queue.$touched || forms.action.$submitted) && forms.action.queue.$invalid}">\n									<label class="control-label">{{\'APPLICATION_QUEUE\' | translate}}<span class="required" aria-required="true">*</span></label>\n									<ui-select data-ng-model="application.ChatQueueId" name="queue" theme="bootstrap" required>\n										<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n										<ui-select-choices repeat="queue.id as queue in queues | filter: $select.search">\n											<div ng-bind-html="queue.name | highlight: $select.search"></div>\n										</ui-select-choices>\n									</ui-select>\n									<span data-ng-show="(forms.action.queue.$touched || forms.action.$submitted) && forms.action.queue.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END QUEUE -->\n							</div>\n\n							<div class="app-settings" ng-slide-down="application.app === \'agent\'" lazy-render duration="1" data-ng-init="getAgents()">\n								<!-- START AGENT -->\n								<div class="form-group" data-ng-class="{\'has-error\': (forms.action.agent.$touched || forms.action.$submitted) && forms.action.agent.$invalid}">\n									<label class="control-label">{{\'APPLICATION_AGENT\' | translate}}<span class="required" aria-required="true">*</span></label>\n									<ui-select data-ng-model="application.UserId" name="agent" theme="bootstrap" required>\n										<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.fullname}}</ui-select-match>\n										<ui-select-choices repeat="agent.id as agent in agents | filter: $select.search">\n											<div ng-bind-html="agent.fullname | highlight: $select.search"></div>\n										</ui-select-choices>\n									</ui-select>\n									<span data-ng-show="(forms.action.agent.$touched || forms.action.$submitted) && forms.action.agent.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END AGENT -->\n							</div>\n\n							<!-- START INTERVAL_TYPE -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.action.intType.$touched || forms.action.$submitted) && forms.action.intType.$invalid}">\n								<label class="control-label">{{ \'APPLICATION_INTERVAL_TYPE\' | translate }}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="application.intType" theme="bootstrap" name="intType" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{ $select.selected.name | translate }}</ui-select-match>\n									<ui-select-choices repeat="intType.value as intType in $application.intTypes | filter: $select.search">\n										{{ intType.name | translate }}\n									</ui-select-choices>\n								</ui-select>\n								<span data-ng-show="(forms.action.intType.$touched || forms.action.$submitted) && forms.action.intType.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END INTERVAL_TYPE -->\n\n							<div class="app-settings" ng-slide-down="application.intType === \'custom\'" lazy-render duration="1">\n								<!-- START TIME -->\n								<div class="form-group">\n									<label class="control-label">{{ \'APPLICATION_TIME\' | translate }}</label>\n									<div class="input-group input-large">\n										<fieldset class="pull-left" ng-disabled="application.alwaysTime">\n											<uib-timepicker name="t_from" data-ng-model="application.t_from" show-meridian="false" show-spinners="false" mousewheel="false"></uib-timepicker>\n										</fieldset>\n										<div class="input-group-addon col-md-1 interval-to pull-left">to</div>\n										<fieldset ng-disabled="application.alwaysTime"><uib-timepicker  name="t_to" data-ng-model="application.t_to" show-meridian="false" show-spinners="false" mousewheel="false"></uib-timepicker></fieldset>\n										<!-- <label class="control-label pointer-cursor"><input type="checkbox" data-ng-model="application.alwaysTime">{{\'APPLICATION_ALWAYS\' | translate}}</label> -->\n									</div>\n								</div>\n								<!-- END TIME -->\n\n								<!-- START ALWAYS -->\n								<div class="form-group">\n									<label class="control-label">{{ \'APPLICATION_ALWAYS\' | translate }}</label>\n									<div class="input-group input-large">\n										<label class="control-label pointer-cursor">\n											<input\n												bs-switch\n												data-ng-model="application.alwaysTime"\n												type="checkbox"\n												switch-active="{{ isActive }}"\n												switch-on-text="{{ \'APPLICATION_YES\' | translate }}"\n												switch-off-text="{{ \'APPLICATION_NO\' | translate }}"\n												switch-on-color="{{ onColor }}"\n												switch-off-color="{{ offColor }}"\n												switch-animate="{{ animate }}"\n												switch-size="{{ size }}"\n												switch-label="{{ label }}"\n												switch-icon="{{ icon }}"\n												switch-radio-off="{{ radioOff }}"\n												switch-label-width="{{ labelWidth }}"\n												switch-handle-width="{{ handleWidth }}">\n											<!-- <input type="checkbox" data-ng-model="application.alwaysTime"> -->\n										</label>\n									</div>\n								</div>\n								<!-- END ALWAYS -->\n\n								<!-- START WEEKDAY -->\n								<div class="form-group">\n									<label class="control-label">{{ \'APPLICATION_WEEKDAY\' | translate }}</label>\n									<div class="input-group input-large">\n										<ui-select data-ng-model="application.wd_from" theme="bootstrap" name="wd_from">\n											<ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n											<ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n												{{ weekDay.name | translate}}\n											</ui-select-choices>\n										</ui-select>\n										<span class="input-group-addon">to</span>\n										<ui-select data-ng-model="application.wd_to" theme="bootstrap" name="wd_to">\n											<ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n											<ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n												{{ weekDay.name | translate }}\n											</ui-select-choices>\n										</ui-select>\n									</div>\n								</div>\n								<!-- END WEEKDAY -->\n\n								<!-- START MONTHDAY -->\n								<div class="form-group">\n									<label class="control-label">{{ \'APPLICATION_MONTHDAY\' | translate }}</label>\n									<div class="input-group input-large">\n										<ui-select data-ng-model="application.md_from" theme="bootstrap" name="md_from">\n											<ui-select-match>{{$select.selected}}</ui-select-match>\n											<ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n												{{monthDay}}\n											</ui-select-choices>\n										</ui-select>\n										<span class="input-group-addon">to</span>\n										<ui-select data-ng-model="application.md_to" theme="bootstrap" name="md_to">\n											<ui-select-match>{{$select.selected}}</ui-select-match>\n											<ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n												{{monthDay}}\n											</ui-select-choices>\n										</ui-select>\n									</div>\n								</div>\n								<!-- END MONTHDAY -->\n\n								<!-- START MONTH -->\n								<div class="form-group">\n									<label class="control-label">{{ \'APPLICATION_MONTH\' | translate }}</label>\n									<div class="input-group input-large">\n										<ui-select data-ng-model="application.m_from" theme="bootstrap" name="m_from">\n											<ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n											<ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n												{{ month.name | translate }}\n											</ui-select-choices>\n										</ui-select>\n										<span class="input-group-addon">to</span>\n										<ui-select data-ng-model="application.m_to" theme="bootstrap" name="m_to">\n											<ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n											<ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n												{{ month.name | translate }}\n											</ui-select-choices>\n										</ui-select>\n									</div>\n								</div>\n								<!-- END MONTH -->\n							</div>\n\n							<div class="app-settings" ng-slide-down="application.intType === \'list\'" lazy-render duration="1" data-ng-init="getIntervals()">\n\n								<!-- START INTERVALS -->\n								<div class="form-group" data-ng-class="{\'has-error\': (forms.action.IntervalId.$touched || forms.action.$submitted) && forms.action.IntervalId.$invalid}">\n									<label class="control-label">{{\'APPLICATION_INTERVALS\' | translate}}<span class="required" aria-required="true">*</span></label>\n									<ui-select data-ng-model="application.IntervalId" theme="bootstrap" name="IntervalId" required>\n										<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{ $select.selected.name}}</ui-select-match>\n										<ui-select-choices repeat="interval.id as interval in intervals | filter: $select.search">\n											{{ interval.name}}\n										</ui-select-choices>\n									</ui-select>\n									<span data-ng-show="(forms.action.IntervalId.$touched || forms.action.$submitted) && forms.action.IntervalId.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END INTERVALS -->\n\n							</div>\n\n							<input class="btn green-haze" type="submit" data-ng-click="next()" value="{{\'APPLICATION_CONTINUE\' | translate}}"/>\n						</form>\n					</wz-step>\n					<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n						<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n						<!-- <button class="btn green-haze" type="button" wz-previous><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button> -->\n						<input class="btn green-haze" type="submit" data-ng-click="next()" value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n					</wz-step>\n				</wizard>\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),
-a.put("app/channels/chat/website/view/embedding/view/view.html",'<div class="row" data-ng-init="initView()">\n  <div class="col-md-12">\n    <div class="portlet light">\n      <div class="portlet-title">\n        <div class="caption caption-md">\n          <i class="icon-globe theme-font hide"></i>\n          <span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_EMBEDDING\' | translate}}</span>\n        </div>\n        <div class="actions">\n          <div class="btn-group">\n            <a class="btn green-jungle" href="#" data-ng-click="copyToClipboard();">\n              <i class="fa fa-clipboard"></i> {{\'APPLICATION_COPY_TO_CLIPBOARD\' | translate}}\n            </a>\n          </div>\n        </div>\n      </div>\n      <div class="portlet-body">\n        <div class="row">\n          <div class="col-md-12">\n            <h3>{{\'APPLICATION_EMBED_SNIPPET\' | translate}}</h3>\n            <p>\n              {{\'MESSAGE_EMBED_SNIPPET\' | translate}}\n            </p>\n            <div class="form-body">\n              <div class="form-group">\n                <div class="col-md-12">\n                  <code-mirror lang="html" model="snippetCode"></code-mirror>\n                </div>\n              </div>\n            </div>\n          </div>\n        </div>\n      </div>\n    </div>\n  </div>\n</div>\n'),a.put("app/channels/chat/website/view/form/view/view.html",'<div class="row" data-ng-init="getChatWebsiteFields(\'online\');getChatWebsiteFields(\'offline\');">\n  <div class="col-md-12">\n    <div class="portlet light">\n      <div class="portlet-title tabbable-line">\n        <ul class="nav nav-tabs">\n          <li class="active">\n            <a href="#" data-target="#tab_1_1" data-toggle="tab">{{\'APPLICATION_ONLINE\' | translate}}</a>\n          </li>\n          <li>\n            <a href="#" data-target="#tab_1_2" data-toggle="tab">{{\'APPLICATION_OFFLINE\' | translate}}</a>\n          </li>\n        </ul>\n      </div>\n    <div class="portlet-body">\n      <div class="row">\n        <div class="col-md-12">\n          <div class="tab-content">\n            <div class="tab-pane active" id="tab_1_1">\n              <div class="row">\n                <div class="col-md-6">\n                  <div class="portlet">\n                    <div class="portlet-title">\n                      <div class="caption font-green-sharp">\n                        <i class="icon-book-open font-green-sharp"></i>\n                        <span class="caption-subject">{{ \'APPLICATION_FIELDS_SELECTED\' | translate }}</span>\n                      </div>\n                      <div class="actions">\n                        <div class="btn-group">\n                          <a class="btn green-jungle" href="#" data-ng-click="saveForm(\'online\');">\n                            <i class="fa fa-check"></i> {{ \'APPLICATION_SAVE\' | translate }}\n                          </a>\n                        </div>\n                      </div>\n                    </div>\n                    <div class="portlet-body">\n                      <div fb-builder="online"></div>\n                    </div>\n                  </div>\n                </div>\n                <div class="col-md-6">\n                  <div class="portlet">\n                    <div class="portlet-title">\n                      <div class="caption font-green-sharp">\n                        <i class="icon-book-open font-green-sharp"></i>\n                        <span class="caption-subject">{{ \'APPLICATION_FIELDS_AVAILABLE\' | translate }}</span>\n                      </div>\n                    </div>\n                    <div class="portlet-body">\n                      <div fb-components></div>\n                    </div>\n                  </div>\n                </div>\n              </div>\n            </div>\n            <div class="tab-pane" id="tab_1_2">\n              <div class="row">\n                <div class="col-md-6">\n                  <div class="portlet">\n                    <div class="portlet-title">\n                      <div class="caption font-green-sharp">\n                        <i class="icon-book-open font-green-sharp"></i>\n                        <span class="caption-subject">{{ \'APPLICATION_FIELDS_SELECTED\' | translate }}</span>\n                      </div>\n                      <div class="actions">\n                        <div class="btn-group">\n                          <a class="btn green-jungle" href="#" data-ng-click="saveForm(\'offline\');">\n                            <i class="fa fa-check"></i> {{ \'APPLICATION_SAVE\' | translate }}\n                          </a>\n                        </div>\n                      </div>\n                    </div>\n                    <div class="portlet-body">\n                      <div fb-builder="offline"></div>\n                    </div>\n                  </div>\n                </div>\n                <div class="col-md-6">\n                  <div class="portlet">\n                    <div class="portlet-title">\n                      <div class="caption font-green-sharp">\n                        <i class="icon-book-open font-green-sharp"></i>\n                        <span class="caption-subject">{{ \'APPLICATION_FIELDS_AVAILABLE\' | translate }}</span>\n                      </div>\n                    </div>\n                    <div class="portlet-body">\n                      <div fb-components></div>\n                    </div>\n                  </div>\n                </div>\n              </div>\n            </div>\n          </div>\n        </div>\n      </div>\n    </div>\n  </div>\n</div>\n</div>\n'),a.put("app/channels/chat/website/view/proactive/list/list.create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{title}}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.name.$touched || form.$submitted) && form.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n      <span data-ng-show="(form.name.$touched || form.$submitted) && form.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n    <!-- START TYPE -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.type.$touched || form.$submitted) && form.type.$invalid}">\n      <label class="control-label">{{\'APPLICATION_TYPE\' | translate}}</label>\n      <ui-select name="type" ng-model="item.type" theme="bootstrap" ng-disabled="disabled">\n        <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.title}}</ui-select-match>\n        <ui-select-choices repeat="item.type as item in possibleType | filter: $select.search">\n          <div ng-bind-html="item.title | highlight: $select.search"></div>\n        </ui-select-choices>\n      </ui-select>\n    </div>\n    <!-- END TYPE -->\n\n    <!-- START SELECTOR -->\n    <div class="form-group" data-ng-if="item.type === \'mouseOver\'" data-ng-class="{\'has-error\': (form.selector.$touched || form.$submitted) && form.selector.$invalid}">\n      <label class="control-label">{{\'APPLICATION_SELECTOR\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="selector" placeholder="{{\'APPLICATION_SELECTOR\' | translate}}" class="form-control" data-ng-model="item.selector" required/>\n      <span data-ng-show="(form.name.$touched || form.$submitted) && form.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END SELECTOR -->\n\n    <!-- START TIMEOUT -->\n    <div class="form-group" data-ng-if="item.type === \'timeout\'" data-ng-class="{\'has-error\': (form.timeout.$touched || form.$submitted) && form.timeout.$invalid}">\n      <label class="control-label">{{\'APPLICATION_TIMEOUT\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="number" name="timeout" placeholder="{{\'APPLICATION_TIMEOUT\' | translate}}" class="form-control" data-ng-model="item.timeout" min="0" required/>\n      <span data-ng-show="(form.name.$touched || form.$submitted) && form.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END TIMEOUT -->\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="save()" ng-disabled="form.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/channels/chat/website/view/proactive/list/list.html",'<div class="row" data-ng-init="initProactiveActions()">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_PROACTIVE_ACTIONS\' | translate}}</span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<a class="btn green-jungle" href="#" data-toggle="dropdown" data-ng-click="createItem()">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_PROACTIVE_ACTION\' | translate }}\n						</a>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/channels/chat/website/view/snippet/view/view.html",'<div class="row" data-ng-init="initView()">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_SNIPPET\' | translate}}</span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{\'APPLICATION_APPEARANCE\' | translate}}</a>\n					</li>\n					<li>\n						<a href="#" data-target="#tab_1_2" data-toggle="tab">{{\'APPLICATION_FORMS\' | translate}}</a>\n					</li>\n					<li>\n						<a href="#" data-target="#tab_1_3" data-toggle="tab">{{\'APPLICATION_LABELS\' | translate}}</a>\n					</li>\n					<li>\n						<a href="#" data-target="#tab_1_4" data-toggle="tab">{{\'APPLICATION_SETTINGS\' | translate}}</a>\n					</li>\n					<li>\n						<a href="#" data-target="#tab_1_5" data-toggle="tab">{{\'APPLICATION_OFFLINE\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n			<div class="portlet-body">\n				<div class="row">\n						<div class="col-md-8">\n							<div class="tab-content">\n\n								<!-- APPEARANCE TAB -->\n								<div class="tab-pane active" id="tab_1_1">\n									<form name="forms.formAppearance" data-ng-submit="forms.formAppearance.$valid && updateItem()" novalidate>\n\n										<!-- START MAIN COLOR -->\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.formAppearance.mainColor.$touched || forms.formAppearance.$submitted) && forms.formAppearance.host.$invalid}">\n											<label class="control-label">{{\'APPLICATION_MAIN_COLOR\' | translate}} <span class="required" aria-required="true">*</span></label>\n											<input colorpicker type="text" name="mainColor" placeholder="{{\'APPLICATION_MAIN_COLOR\' | translate}}" style="color:{{chatWebsite.color}}" class="form-control" data-ng-model="chatWebsite.color" required/>\n											<span data-ng-show="(forms.formAppearance.mainColor.$touched || forms.formAppearance.$submitted) && forms.formAppearance.mainColor.$invalid && forms.formAppearance.mainColor.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END MAIN COLOR -->\n\n										<!-- START FOCUS COLOR -->\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.formAppearance.focusColor.$touched || forms.formAppearance.$submitted) && forms.formAppearance.focusColor.$invalid}">\n											<label class="control-label">{{\'APPLICATION_FOCUS_COLOR\' | translate}} <span class="required" aria-required="true">*</span></label>\n											<input colorpicker type="text" name="focusColor" placeholder="{{\'APPLICATION_FOCUS_COLOR\' | translate}}" style="color:{{chatWebsite.color_focus}}" class="form-control" data-ng-model="chatWebsite.color_focus" required/>\n											<span data-ng-show="(forms.formAppearance.focusColor.$touched || forms.formAppearance.$submitted) && forms.formAppearance.focusColor.$invalid && forms.formAppearance.focusColor.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END FOCUS COLOR -->\n\n										<!-- START BUTTON COLOR -->\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.formAppearance.buttonColor.$touched || forms.formAppearance.$submitted) && forms.formAppearance.buttonColor.$invalid}">\n											<label class="control-label">{{\'APPLICATION_BUTTON_COLOR\' | translate}} <span class="required" aria-required="true">*</span></label>\n											<input colorpicker type="text" name="buttonColor" placeholder="{{\'APPLICATION_BUTTON_COLOR\' | translate}}" style="color:{{chatWebsite.color_button}}" class="form-control" data-ng-model="chatWebsite.color_button" required/>\n											<span data-ng-show="(forms.formAppearance.buttonColor.$touched || forms.formAppearance.$submitted) && forms.formAppearance.buttonColor.$invalid && forms.formAppearance.buttonColor.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END BUTTON COLOR -->\n\n										<!-- START HEADER SHAPE -->\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.formAppearance.headerShape.$touched || forms.formAppearance.$submitted) && forms.formAppearance.headerShape.$invalid}">\n											<label class="control-label">{{\'APPLICATION_ANIMATION\' | translate}}</label>\n											<!-- <input colorpicker type="text" name="animationToggle" placeholder="{{\'APPLICATION_BUTTON_COLOR\' | translate}}" class="form-control" data-ng-model="chatWebsite.animation" required/> -->\n											<ui-select data-ng-model="chatWebsite.header_shape" name="headerShape" theme="bootstrap">\n												<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$translate.instant(\'APPLICATION_\' + $select.selected.toUpperCase())}}</ui-select-match>\n												<ui-select-choices repeat="headerShape in [\'rounded\',\'squared\'] | filter: $select.search">\n													<div ng-bind-html="$translate.instant(\'APPLICATION_\' + headerShape.toUpperCase()) | highlight: $select.search"></div>\n												</ui-select-choices>\n											</ui-select>\n										</div>\n										<!-- END HEADER SHAPE -->\n\n										<!-- START ANIMATION TOGGLE -->\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.formAppearance.animationToggle.$touched || forms.formAppearance.$submitted) && forms.formAppearance.animationToggle.$invalid}">\n											<label class="control-label">{{\'APPLICATION_ANIMATION\' | translate}}</label>\n											<!-- <input colorpicker type="text" name="animationToggle" placeholder="{{\'APPLICATION_BUTTON_COLOR\' | translate}}" class="form-control" data-ng-model="chatWebsite.animation" required/> -->\n											<ui-select data-ng-model="chatWebsite.animation" name="animationToggle" theme="bootstrap">\n												<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected ? \'On\' : \'Off\'}}</ui-select-match>\n												<ui-select-choices repeat="animationToggle in [true, false] | filter: $select.search">\n													<div ng-bind-html="animationToggle ? \'On\' : \'Off\' | highlight: $select.search"></div>\n												</ui-select-choices>\n											</ui-select>\n										</div>\n										<!-- END ANIMATION TOGGLE -->\n\n\n										<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n									</form>\n								</div>\n								<!-- END APPEARANCE TAB -->\n\n								<!-- FORMS TAB -->\n								<div class="tab-pane" id="tab_1_2">\n									<form name="forms.formFunctionality" data-ng-submit="forms.formFunctionality.$valid && updateItem()" novalidate>\n\n										<!-- START DOWNLOAD TRANSCRIPT -->\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.formFunctionality.animationToggle.$touched || forms.formFunctionality.$submitted) && forms.formFunctionality.animationToggle.$invalid}">\n											<label class="control-label">{{\'APPLICATION_DOWNLOAD_TRANSCRIPT\' | translate}}</label>\n											<ui-select data-ng-model="chatWebsite.download_transcript" name="downloadTranscript" theme="bootstrap">\n												<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected ? \'On\' : \'Off\'}}</ui-select-match>\n												<ui-select-choices repeat="downloadTranscript in [true, false] | filter: $select.search">\n													<div ng-bind-html="downloadTranscript ? \'On\' : \'Off\' | highlight: $select.search"></div>\n												</ui-select-choices>\n											</ui-select>\n										</div>\n										<!-- END DOWNLOAD TRANSCRIPT -->\n\n										<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n									</form>\n								</div>\n								<!-- END FORMS TAB -->\n\n								<!-- STRINGS TAB -->\n								<div class="tab-pane" id="tab_1_3">\n									<form name="forms.formLabel" data-ng-submit="forms.formLabel.$valid && updateItem()" novalidate>\n\n										<h4 class="block" data-ng-show="statePreview.state == \'online\'">{{\'APPLICATION_ONLINE_STATE\' | translate}}</h4>\n\n										<!-- START HEADER ONLINE -->\n										<div class="form-group" data-ng-show="statePreview.state == \'online\'" data-ng-class="{\'has-error\': (forms.formLabel.headerOnline.$touched || forms.formLabel.$submitted) && forms.formLabel.headerOnline.$invalid}">\n											<label class="control-label">{{\'APPLICATION_HEADER_ONLINE\' | translate}}</label>\n											<input type="text" name="headerOnline" placeholder="{{\'APPLICATION_HEADER_ONLINE\' | translate}}" class="form-control" data-ng-model="chatWebsite.header_online"/>\n										</div>\n										<!-- END HEADER ONLINE -->\n\n										<!-- START ONLINE MESSAGE-->\n										<div class="form-group" data-ng-show="statePreview.state == \'online\'" data-ng-class="{\'has-error\': (forms.formLabel.onlineMessage.$touched || forms.formLabel.$submitted) && forms.formLabel.onlineMessage.$invalid}">\n											<label class="control-label">{{\'APPLICATION_ONLINE_MESSAGE\' | translate}}</label>\n											<input type="text" name="onlineMessage" placeholder="{{\'APPLICATION_ONLINE_MESSAGE\' | translate}}" class="form-control" data-ng-model="chatWebsite.online_message"/>\n										</div>\n										<!-- END HEADER ONLINE -->\n\n										<!-- START USERNAME PLACEHOLDER -->\n										<div class="form-group" data-ng-show="statePreview.state == \'online\' || statePreview.state == \'offline\'" data-ng-class="{\'has-error\': (forms.formLabel.usernamePlaceholder.$touched || forms.formLabel.$submitted) && forms.formLabel.usernamePlaceholder.$invalid}">\n											<label class="control-label">{{\'APPLICATION_USERNAME_PLACEHOLDER\' | translate}}</label>\n											<input type="text" name="usernamePlaceholder" placeholder="{{\'APPLICATION_USERNAME_PLACEHOLDER\' | translate}}" class="form-control" data-ng-model="chatWebsite.username_placeholder"/>\n										</div>\n										<!-- END USERNAME PLACEHOLDER -->\n\n										<!-- START EMAIL PLACEHOLDER -->\n										<div class="form-group" data-ng-show="statePreview.state == \'online\' || statePreview.state == \'offline\'" data-ng-class="{\'has-error\': (forms.formLabel.emailPlaceholder.$touched || forms.formLabel.$submitted) && forms.formLabel.emailPlaceholder.$invalid}">\n											<label class="control-label">{{\'APPLICATION_EMAIL_PLACEHOLDER\' | translate}}</label>\n											<input type="text" name="emailPlaceholder" placeholder="{{\'APPLICATION_EMAIL_PLACEHOLDER\' | translate}}" class="form-control" data-ng-model="chatWebsite.email_placeholder"/>\n										</div>\n										<!-- END EMAIL PLACEHOLDER -->\n\n										<!-- START START CHAT BUTTON -->\n										<div class="form-group" data-ng-show="statePreview.state == \'online\'" data-ng-class="{\'has-error\': (forms.formLabel.startChatButton.$touched || forms.formLabel.$submitted) && forms.formLabel.startChatButton.$invalid}">\n											<label class="control-label">{{\'APPLICATION_START_CHAT_BUTTON\' | translate}}</label>\n											<input type="text" name="startChatButton" placeholder="{{\'APPLICATION_START_CHAT_BUTTON\' | translate}}" class="form-control" data-ng-model="chatWebsite.start_chat_button"/>\n										</div>\n										<!-- END START CHAT BUTTON -->\n\n										<h4 class="block" data-ng-show="statePreview.state == \'rating\'">{{\'APPLICATION_RATING_STATE\' | translate}}</h4>\n\n										<!-- START RATING MESSAGE -->\n										<div class="form-group" data-ng-show="statePreview.state == \'rating\'" data-ng-class="{\'has-error\': (forms.formLabel.ratingMessage.$touched || forms.formLabel.$submitted) && forms.formLabel.ratingMessage.$invalid}">\n											<label class="control-label">{{\'APPLICATION_RATING_MESSAGE\' | translate}}</label>\n											<input type="text" name="ratingMessage" placeholder="{{\'APPLICATION_RATING_MESSAGE\' | translate}}" class="form-control" data-ng-model="chatWebsite.rating_message"/>\n										</div>\n										<!-- END RATING MESSAGE -->\n\n										<!-- START RATING SEND BUTTON -->\n										<div class="form-group" data-ng-show="statePreview.state == \'rating\'" data-ng-class="{\'has-error\': (forms.formLabel.ratingSend.$touched || forms.formLabel.$submitted) && forms.formLabel.ratingSend.$invalid}">\n											<label class="control-label">{{\'APPLICATION_RATING_SEND_BUTTON\' | translate}}</label>\n											<input type="text" name="ratingSend" placeholder="{{\'APPLICATION_RATING_SEND_BUTTON\' | translate}}" class="form-control" data-ng-model="chatWebsite.rating_send"/>\n										</div>\n										<!-- END RATING SEND BUTTON -->\n\n										<!-- START RATING SKIP BUTTON -->\n										<div class="form-group" data-ng-show="statePreview.state == \'rating\'" data-ng-class="{\'has-error\': (forms.formLabel.ratingSkip.$touched || forms.formLabel.$submitted) && forms.formLabel.ratingSkip.$invalid}">\n											<label class="control-label">{{\'APPLICATION_RATING_SKIP_BUTTON\' | translate}}</label>\n											<input type="text" name="ratingSkip" placeholder="{{\'APPLICATION_RATING_SKIP_BUTTON\' | translate}}" class="form-control" data-ng-model="chatWebsite.rating_skip"/>\n										</div>\n										<!-- END RATING SKIP BUTTON -->\n\n										<h4 class="block" data-ng-show="statePreview.state == \'offline\'">{{\'APPLICATION_OFFLINE_STATE\' | translate}}</h4>\n\n										<!-- START HEADER OFFLINE -->\n										<div class="form-group" data-ng-show="statePreview.state == \'offline\'" data-ng-class="{\'has-error\': (forms.formLabel.headerOffline.$touched || forms.formLabel.$submitted) && forms.formLabel.headerOnline.$invalid}">\n											<label class="control-label">{{\'APPLICATION_HEADER_OFFLINE\' | translate}}</label>\n											<input type="text" name="headerOffline" placeholder="{{\'APPLICATION_HEADER_OFFLINE\' | translate}}" class="form-control" data-ng-model="chatWebsite.header_offline"/>\n										</div>\n										<!-- END HEADER OFFLINE -->\n\n										<!-- START OFFLINE MESSAGE-->\n										<div class="form-group" data-ng-show="statePreview.state == \'offline\'" data-ng-class="{\'has-error\': (forms.formLabel.offlineMessage.$touched || forms.formLabel.$submitted) && forms.formLabel.onlineMessage.$invalid}">\n											<label class="control-label">{{\'APPLICATION_OFFLINE_MESSAGE\' | translate}}</label>\n											<input type="text" name="offlineMessage" placeholder="{{\'APPLICATION_OFFLINE_MESSAGE\' | translate}}" class="form-control" data-ng-model="chatWebsite.offline_message"/>\n										</div>\n										<!-- END OFFLINE MESSAGE -->\n\n										<!-- START ENQUIRY MESSAGE PLACEHOLDER-->\n										<div class="form-group" data-ng-show="statePreview.state == \'offline\'" data-ng-class="{\'has-error\': (forms.formLabel.enquiryMessagePlaceholder.$touched || forms.formLabel.$submitted) && forms.formLabel.onlineMessage.$invalid}">\n											<label class="control-label">{{\'APPLICATION_ENQUIRY_MESSAGE_PLACEHOLDER\' | translate}}</label>\n											<input type="text" name="enquiryMessagePlaceholder" placeholder="{{\'APPLICATION_ENQUIRY_MESSAGE_PLACEHOLDER\' | translate}}" class="form-control" data-ng-model="chatWebsite.enquiry_message_placeholder"/>\n										</div>\n										<!-- END ENQUIRY MESSAGE PLACEHOLDER -->\n\n										<!-- START ENQUIRY BUTTON -->\n										<div class="form-group" data-ng-show="statePreview.state == \'offline\'" data-ng-class="{\'has-error\': (forms.formLabel.enquiryButton.$touched || forms.formLabel.$submitted) && forms.formLabel.startChatButton.$invalid}">\n											<label class="control-label">{{\'APPLICATION_ENQUIRY_BUTTON\' | translate}}</label>\n											<input type="text" name="enquiryButton" placeholder="{{\'APPLICATION_ENQUIRY_BUTTON\' | translate}}" class="form-control" data-ng-model="chatWebsite.enquiry_button"/>\n										</div>\n										<!-- END ENQUIRY BUTTON -->\n\n										<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n									</form>\n								</div>\n								<!-- END STRINGS TAB -->\n\n								<!-- SETTINGS TAB -->\n								<div class="tab-pane" id="tab_1_4">\n									<form name="forms.formSetting" data-ng-submit="forms.formSetting.$valid && updateItem()" novalidate>\n\n										<!-- START NAME -->\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.formSetting.name.$touched || forms.formSetting.$submitted) && forms.formSetting.name.$invalid}">\n											<label class="control-label">{{\'APPLICATION_NAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n											<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="chatWebsite.name" required/>\n											<span data-ng-show="(forms.formSetting.name.$touched || forms.formSetting.$submitted) && forms.formSettings.name.$invalid && forms.formSetting.name.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END NAME -->\n\n										<!-- START ADDRESS -->\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.formSetting.address.$touched || forms.formSetting.$submitted) && forms.formSetting.address.$invalid}">\n											<label class="control-label">{{\'APPLICATION_WEB_ADDRESS\' | translate}} <span class="required" aria-required="true">*</span></label>\n											<input type="url" name="address" placeholder="{{\'APPLICATION_WEB_ADDRESS\' | translate}}" class="form-control" data-ng-model="chatWebsite.address" required/>\n											<span data-ng-show="(forms.formSetting.address.$touched || forms.formSetting.$submitted) && forms.formSetting.address.$invalid && forms.formSetting.address.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END ADDRESS -->\n\n										<!-- START REMOTE IP -->\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.formSetting.remote.$touched || forms.formSetting.$submitted) && forms.formSetting.remote.$invalid}">\n											<label class="control-label">{{\'APPLICATION_MOTION_ADDRESS\' | translate}} <span class="required" aria-required="true">*</span></label>\n											<input type="url" name="remote" placeholder="{{\'APPLICATION_MOTION_ADDRESS\' | translate}}" class="form-control" data-ng-model="chatWebsite.remote" required/>\n											<span data-ng-show="(forms.formSetting.remote.$touched || forms.formSetting.$submitted) && forms.formSetting.remote.$invalid && forms.formSetting.remote.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END REMOTE IP -->\n\n										<!-- START DESCRIPTION -->\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.formSetting.description.$touched || forms.formSetting.$submitted) && forms.formSetting.description.$invalid}">\n											<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n											<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="chatWebsite.description"/>\n										</div>\n										<!-- END DESCRIPTION -->\n\n										<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n									</form>\n								</div>\n								<!-- END SETTINGS TAB -->\n\n								<!-- OFFLINE TAB -->\n								<div class="tab-pane" id="tab_1_5">\n									<form name="forms.formOffline" data-ng-submit="forms.formOffline.$valid && updateItem()" novalidate>\n\n										<!-- START ENQUIRY ENABLE -->\n										<div class="form-group">\n											<label class="control-label">{{\'APPLICATION_ENQUIRY_ENABLED\' | translate}}</label></br>\n											<input\n											    bs-switch\n													class="form-control"\n											    ng-model="chatWebsite.enquiry_enable"\n											    type="checkbox"\n											    switch-active="{{ enquirySwitch.isActive }}"\n											    switch-on-text="{{ enquirySwitch.onText }}"\n											    switch-off-text="{{ enquirySwitch.offText }}"\n											    switch-on-color="{{ enquirySwitch.onColor }}"\n											    switch-off-color="{{ enquirySwitch.offColor }}"\n											    switch-animate="{{ enquirySwitch.animate }}"\n											    switch-size="{{ enquirySwitch.size }}"\n											    switch-label="{{ enquirySwitch.label }}"\n											    switch-icon="{{ enquirySwitch.icon }}"\n											    switch-radio-off="{{ enquirySwitch.radioOff }}"\n											    switch-label-width="{{ enquirySwitch.labelWidth }}"\n											    switch-handle-width="{{ enquirySwitch.handleWidth }}">\n										</div>\n										<!-- END ENQUIRY ENABLE -->\n\n										<!-- START ENQUIRY FORWARDING -->\n										<div class="form-group" data-ng-if="chatWebsite.enquiry_enable">\n											<label class="control-label">{{\'APPLICATION_ENQUIRY_FORWARDING\' | translate}}</label></br>\n											<input\n											    bs-switch\n													class="form-control"\n											    ng-model="chatWebsite.enquiry_forwarding"\n											    type="checkbox"\n											    switch-active="{{ enquirySwitch.isActive }}"\n											    switch-on-text="{{ enquirySwitch.onText }}"\n											    switch-off-text="{{ enquirySwitch.offText }}"\n											    switch-on-color="{{ enquirySwitch.onColor }}"\n											    switch-off-color="{{ enquirySwitch.offColor }}"\n											    switch-animate="{{ enquirySwitch.animate }}"\n											    switch-size="{{ enquirySwitch.size }}"\n											    switch-label="{{ enquirySwitch.label }}"\n											    switch-icon="{{ enquirySwitch.icon }}"\n											    switch-radio-off="{{ enquirySwitch.radioOff }}"\n											    switch-label-width="{{ enquirySwitch.labelWidth }}"\n											    switch-handle-width="{{ enquirySwitch.handleWidth }}">\n											<span class="help-block col-md-12">{{\'MESSAGE_REMEMBER_SMTP_SERVICE_ACCOUNT\' | translate}}.</span>\n										</div>\n										<!-- END ENQUIRY FORWARDING -->\n\n										<!-- START REMOTE IP -->\n										<div class="form-group" data-ng-if="chatWebsite.enquiry_enable && chatWebsite.enquiry_forwarding" data-ng-class="{\'has-error\': (forms.formOffline.forwardingAddress.$touched || forms.formOffline.$submitted) && forms.formSetting.forwardingAddress.$invalid}">\n											<label class="control-label">{{\'APPLICATION_ENQUIRY_FORWARDING_ADDRESS\' | translate}}<span class="required" aria-required="true">*</span></label>\n											<input type="text" name="forwardingAddress" placeholder="{{\'APPLICATION_ADDRESS\' | translate}}" class="form-control" data-ng-model="chatWebsite.enquiry_forwarding_address" required/>\n											<span data-ng-show="(forms.formOffline.forwardingAddress.$touched || forms.formOffline.$submitted) && forms.formOffline.forwardingAddress.$invalid && forms.formOffline.forwardingAddress.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END REMOTE IP -->\n\n										<!-- START HEADER SHAPE -->\n										<div class="form-group" data-ng-if="chatWebsite.enquiry_enable && chatWebsite.enquiry_forwarding" data-ng-class="{\'has-error\': (forms.formOffline.OfflineTemplateId.$touched || forms.formOffline.$submitted) && forms.formOffline.OfflineTemplateId.$invalid}">\n											<label class="control-label">{{\'APPLICATION_TEMPLATE\' | translate}}<span class="required" aria-required="true">*</span></label>\n											<ui-select data-ng-model="chatWebsite.OfflineTemplateId" name="OfflineTemplateId" theme="bootstrap" required>\n												<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n												<ui-select-choices repeat="mailTemplate.id as mailTemplate in mailTemplates | filter: $select.search">\n													<div ng-bind-html="mailTemplate.name | highlight: $select.search"></div>\n												</ui-select-choices>\n											</ui-select>\n											<span data-ng-show="(forms.formOffline.OfflineTemplateId.$touched || forms.formOffline.$submitted) && forms.formOffline.OfflineTemplateId.$invalid && forms.formOffline.OfflineTemplateId.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END HEADER SHAPE -->\n\n										<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n									</form>\n								</div>\n								<!-- END OFFLINE TAB -->\n							</div>\n						</div>\n						<div class="col-md-4">\n							<!-- START STATE -->\n							<div class="form-group">\n								<!-- <label class="control-label">{{\'APPLICATION_ANIMATION\' | translate}}</label> -->\n								<!-- <input colorpicker type="text" name="animationToggle" placeholder="{{\'APPLICATION_BUTTON_COLOR\' | translate}}" class="form-control" data-ng-model="chatWebsite.animation" required/> -->\n								<ui-select data-ng-model="statePreview.state" name="statePreview" theme="bootstrap">\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected}}</ui-select-match>\n									<ui-select-choices repeat="statePreview in [\'online\',\'rating\',\'offline\'] | filter: $select.search">\n										<div ng-bind-html="statePreview | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n							</div>\n							<!-- END STATE -->\n							<preview></preview>\n						</div>\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),
-a.put("app/channels/chat/website/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initView()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-puzzle"></i>\n					<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-bubble"></i>\n					<a href="#">{{ \'APPLICATION_CHAT\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-globe"></i>\n					<a href="/channels/chat/websites/list">{{ \'APPLICATION_WEB_SITES\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<a href="#">{{chatWebsite.name}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img src="assets/images/media/website.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{chatWebsite.name}}\n					</div>\n					<div class="profile-usertitle-job">\n						{{chatWebsite.address}}\n					</div>\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.includes(\'main.channels.chat.websites.view.embedding\')}">\n							<a ng-href="/channels/chat/websites/view/{{chatWebsite.id}}/embedding/view">\n							<i class="icon-settings"></i>\n							{{ \'APPLICATION_EMBEDDING\' | translate }} </a>\n						</li>\n						<li data-ng-class="{active: $state.includes(\'main.channels.chat.websites.view.snippet\')}">\n							<a ng-href="/channels/chat/websites/view/{{chatWebsite.id}}/snippet/view">\n							<i class="icon-note"></i>\n							{{ \'APPLICATION_SNIPPET\' | translate }} </a>\n						</li>\n						<li data-ng-class="{active: $state.includes(\'main.channels.chat.websites.view.form\')}">\n							<a ng-href="/channels/chat/websites/view/{{chatWebsite.id}}/forms/view">\n							<i class="icon-list"></i>\n							{{ \'APPLICATION_FORMS\' | translate }} </a>\n						</li>\n						<li data-ng-class="{active: $state.includes(\'main.channels.chat.websites.view.proactive\')}">\n							<a ng-href="/channels/chat/websites/view/{{chatWebsite.id}}/proactive/list">\n							<i class="icon-target"></i>\n							{{ \'APPLICATION_PROACTIVE_ACTIONS\' | translate }} </a>\n						</li>\n						<li data-ng-class="{active: $state.includes(\'main.channels.chat.websites.view.actions\')}">\n							<a ng-href="/channels/chat/websites/view/{{chatWebsite.id}}/actions/list">\n							<i class="icon-directions"></i>\n							{{ \'APPLICATION_ACTIONS\' | translate }} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/chat/website/wizard/wizard.html",'<!-- BEGIN PAGE HEADER-->\n<div class="row">\n	<div class="col-md-12">\n			<div class="page-bar">\n				<ul class="page-breadcrumb">\n					<li>\n						<i class="icon-rocket"></i>\n						<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-bubble"></i>\n						<a href="#">{{ \'APPLICATION_CHAT\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-globe"></i>\n						<a href="/channels/chat/websites/list">{{ \'APPLICATION_WEB_SITES\' | translate }}</a>\n					</li>\n				</ul>\n			</div>\n		</div>\n</div>\n<!-- END PAGE HEADER-->\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-notebook font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_WEB_SITE\' | translate }} WIZARD</a> </span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<wizard on-finish="createItem()">\n          <wz-step title="{{\'APPLICATION_WEB_SITE_INFO\' | translate}}" canexit="exitValidation(forms.formSetting.$valid)">\n						<form name="forms.formSetting" novalidate>\n\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formSetting.name.$touched || forms.formSetting.$submitted) && forms.formSetting.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n								<span data-ng-show="forms.formSetting.name.$touched && !forms.formSettings.name.$valid && forms.formSetting.name.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<!-- START ADDRESS -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formSetting.address.$touched || forms.formSetting.$submitted) && forms.formSetting.address.$invalid}">\n								<label class="control-label">{{\'APPLICATION_WEB_ADDRESS\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="url" name="address" placeholder="{{\'APPLICATION_WEB_ADDRESS\' | translate}}" class="form-control" data-ng-model="item.address" required/>\n								<span data-ng-show="(forms.formSetting.address.$touched || forms.formSetting.$submitted) && forms.formSetting.address.$invalid && forms.formSetting.address.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END ADDRESS -->\n\n							<!-- START REMOTE IP -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formSetting.remote.$touched || forms.formSetting.$submitted) && forms.formSetting.remote.$invalid}">\n								<label class="control-label">{{\'APPLICATION_MOTION_ADDRESS\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="url" name="remote" placeholder="{{\'APPLICATION_MOTION_ADDRESS\' | translate}}" class="form-control" data-ng-model="item.remote" required/>\n								<span data-ng-show="(forms.formSetting.remote.$touched || forms.formSetting.$submitted) && forms.formSetting.remote.$invalid && forms.formSetting.remote.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END REMOTE IP -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.form.description"/>\n							</div>\n							<!-- END DESCRIPTION -->\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" ng-click="next()"/>\n						</form>\n					</wz-step>\n\n					<wz-step title="{{\'APPLICATION_WEB_SITE_APPEARANCE\' | translate}}" canexit="exitValidation(forms.formAppearance.$valid)">\n						<form name="forms.formAppearance" novalidate>\n\n							<!-- START MAIN COLOR -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formAppearance.mainColor.$touched || forms.formAppearance.$submitted) && forms.formAppearance.host.$invalid}">\n								<label class="control-label">{{\'APPLICATION_MAIN_COLOR\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input colorpicker type="text" name="mainColor" placeholder="{{\'APPLICATION_MAIN_COLOR\' | translate}}" style="color:{{item.color}}" class="form-control" data-ng-model="item.color" required/>\n								<span data-ng-show="(forms.formAppearance.mainColor.$touched || forms.formAppearance.$submitted) && forms.formAppearance.mainColor.$invalid && forms.formAppearance.mainColor.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END MAIN COLOR -->\n\n							<!-- START FOCUS COLOR -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formAppearance.focusColor.$touched || forms.formAppearance.$submitted) && forms.formAppearance.focusColor.$invalid}">\n								<label class="control-label">{{\'APPLICATION_FOCUS_COLOR\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input colorpicker type="text" name="focusColor" placeholder="{{\'APPLICATION_FOCUS_COLOR\' | translate}}" style="color:{{item.color_focus}}" class="form-control" data-ng-model="item.color_focus" required/>\n								<span data-ng-show="(forms.formAppearance.focusColor.$touched || forms.formAppearance.$submitted) && forms.formAppearance.focusColor.$invalid && forms.formAppearance.focusColor.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END FOCUS COLOR -->\n\n							<!-- START BUTTON COLOR -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formAppearance.buttonColor.$touched || forms.formAppearance.$submitted) && forms.formAppearance.buttonColor.$invalid}">\n								<label class="control-label">{{\'APPLICATION_BUTTON_COLOR\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input colorpicker type="text" name="buttonColor" placeholder="{{\'APPLICATION_BUTTON_COLOR\' | translate}}" style="color:{{item.color_button}}" class="form-control" data-ng-model="item.color_button" required/>\n								<span data-ng-show="(forms.formAppearance.buttonColor.$touched || forms.formAppearance.$submitted) && forms.formAppearance.buttonColor.$invalid && forms.formAppearance.buttonColor.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END BUTTON COLOR -->\n\n							<!-- START HEADER SHAPE -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formAppearance.headerShape.$touched || forms.formAppearance.$submitted) && forms.formAppearance.headerShape.$invalid}">\n								<label class="control-label">{{\'APPLICATION_HEADER_SHAPE\' | translate}}</label>\n								<!-- <input colorpicker type="text" name="animationToggle" placeholder="{{\'APPLICATION_BUTTON_COLOR\' | translate}}" class="form-control" data-ng-model="item.animation" required/> -->\n								<ui-select data-ng-model="item.header_shape" name="headerShape" theme="bootstrap">\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$translate.instant(\'APPLICATION_\' + $select.selected.toUpperCase())}}</ui-select-match>\n									<ui-select-choices repeat="headerShape in [\'rounded\',\'squared\'] | filter: $select.search">\n										<div ng-bind-html="$translate.instant(\'APPLICATION_\' + headerShape.toUpperCase()) | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n							</div>\n							<!-- END HEADER SHAPE -->\n\n							<!-- START ANIMATION TOGGLE -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formAppearance.animationToggle.$touched || forms.formAppearance.$submitted) && forms.formAppearance.animationToggle.$invalid}">\n								<label class="control-label">{{\'APPLICATION_ANIMATION\' | translate}}</label>\n								<ui-select data-ng-model="item.animation" name="animationToggle" theme="bootstrap">\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected  ? \'On\' : \'Off\'}}</ui-select-match>\n									<ui-select-choices repeat="filter in [true,false] | filter: $select.search">\n										<div ng-bind-html="filter ? \'On\' : \'Off\' | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n							</div>\n							<!-- END ANIMATION TOGGLE -->\n\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" ng-click="next()"/>\n						</form>\n					</wz-step>\n\n					<wz-step title="{{\'APPLICATION_LABELS\' | translate}}" canexit="exitValidation(forms.formLabel.$valid)">\n						<form name="forms.formLabel" novalidate>\n\n							<!-- START HEADER ONLINE -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formLabel.headerOnline.$touched || forms.formLabel.$submitted) && forms.formLabel.headerOnline.$invalid}">\n								<label class="control-label">{{\'APPLICATION_HEADER_ONLINE\' | translate}}</label>\n								<input type="text" name="headerOnline" placeholder="{{\'APPLICATION_HEADER_ONLINE\' | translate}}" class="form-control" data-ng-model="item.header_online"/>\n							</div>\n							<!-- END HEADER ONLINE -->\n\n							<!-- START ONLINE MESSAGE-->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formLabel.onlineMessage.$touched || forms.formLabel.$submitted) && forms.formLabel.onlineMessage.$invalid}">\n								<label class="control-label">{{\'APPLICATION_ONLINE_MESSAGE\' | translate}}</label>\n								<input type="text" name="onlineMessage" placeholder="{{\'APPLICATION_ONLINE_MESSAGE\' | translate}}" class="form-control" data-ng-model="item.online_message"/>\n							</div>\n							<!-- END HEADER ONLINE -->\n\n							<!-- START USERNAME PLACEHOLDER -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formLabel.usernamePlaceholder.$touched || forms.formLabel.$submitted) && forms.formLabel.usernamePlaceholder.$invalid}">\n								<label class="control-label">{{\'APPLICATION_USERNAME_PLACEHOLDER\' | translate}}</label>\n								<input type="text" name="usernamePlaceholder" placeholder="{{\'APPLICATION_USERNAME_PLACEHOLDER\' | translate}}" class="form-control" data-ng-model="item.username_placeholder"/>\n							</div>\n							<!-- END USERNAME PLACEHOLDER -->\n\n							<!-- START EMAIL PLACEHOLDER -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formLabel.emailPlaceholder.$touched || forms.formLabel.$submitted) && forms.formLabel.emailPlaceholder.$invalid}">\n								<label class="control-label">{{\'APPLICATION_EMAIL_PLACEHOLDER\' | translate}}</label>\n								<input type="text" name="emailPlaceholder" placeholder="{{\'APPLICATION_EMAIL_PLACEHOLDER\' | translate}}" class="form-control" data-ng-model="item.email_placeholder"/>\n							</div>\n							<!-- END EMAIL PLACEHOLDER -->\n\n							<!-- START START CHAT BUTTON -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formLabel.startChatButton.$touched || forms.formLabel.$submitted) && forms.formLabel.startChatButton.$invalid}">\n								<label class="control-label">{{\'APPLICATION_START_CHAT_BUTTON\' | translate}}</label>\n								<input type="text" name="startChatButton" placeholder="{{\'APPLICATION_START_CHAT_BUTTON\' | translate}}" class="form-control" data-ng-model="item.start_chat_button"/>\n							</div>\n							<!-- END START CHAT BUTTON -->\n\n							<!-- START RATING MESSAGE -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formLabel.ratingMessage.$touched || forms.formLabel.$submitted) && forms.formLabel.ratingMessage.$invalid}">\n								<label class="control-label">{{\'APPLICATION_RATING_MESSAGE\' | translate}}</label>\n								<input type="text" name="ratingMessage" placeholder="{{\'APPLICATION_RATING_MESSAGE\' | translate}}" class="form-control" data-ng-model="item.rating_message"/>\n							</div>\n							<!-- END RATING MESSAGE -->\n\n							<!-- START RATING START TEXT -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formLabel.ratingSend.$touched || forms.formLabel.$submitted) && forms.formLabel.ratingSend.$invalid}">\n								<label class="control-label">{{\'APPLICATION_RATING_SEND_BUTTON\' | translate}}</label>\n								<input type="text" name="ratingSend" placeholder="{{\'APPLICATION_RATING_SEND_BUTTON\' | translate}}" class="form-control" data-ng-model="item.rating_send"/>\n							</div>\n							<!-- END RATING START TEXT -->\n\n							<!-- START RATING MESSAGE -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formLabel.ratingSkip.$touched || forms.formLabel.$submitted) && forms.formLabel.ratingSkip.$invalid}">\n								<label class="control-label">{{\'APPLICATION_RATING_SKIP_BUTTON\' | translate}}</label>\n								<input type="text" name="ratingSkip" placeholder="{{\'APPLICATION_RATING_SKIP_BUTTON\' | translate}}" class="form-control" data-ng-model="item.rating_skip"/>\n							</div>\n							<!-- END RATING MESSAGE -->\n\n							<!-- START HEADER OFFLINE -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formLabel.headerOffline.$touched || forms.formLabel.$submitted) && forms.formLabel.headerOnline.$invalid}">\n								<label class="control-label">{{\'APPLICATION_HEADER_OFFLINE\' | translate}}</label>\n								<input type="text" name="headerOffline" placeholder="{{\'APPLICATION_HEADER_OFFLINE\' | translate}}" class="form-control" data-ng-model="item.header_offline"/>\n							</div>\n							<!-- END HEADER OFFLINE -->\n\n							<!-- START OFFLINE MESSAGE-->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formLabel.offlineMessage.$touched || forms.formLabel.$submitted) && forms.formLabel.onlineMessage.$invalid}">\n								<label class="control-label">{{\'APPLICATION_OFFLINE_MESSAGE\' | translate}}</label>\n								<input type="text" name="offlineMessage" placeholder="{{\'APPLICATION_OFFLINE_MESSAGE\' | translate}}" class="form-control" data-ng-model="item.offline_message"/>\n							</div>\n							<!-- END OFFLINE MESSAGE -->\n\n							<!-- START ENQUIRY MESSAGE PLACEHOLDER-->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formLabel.enquiryMessagePlaceholder.$touched || forms.formLabel.$submitted) && forms.formLabel.onlineMessage.$invalid}">\n								<label class="control-label">{{\'APPLICATION_ENQUIRY_MESSAGE_PLACEHOLDER\' | translate}}</label>\n								<input type="text" name="enquiryMessagePlaceholder" placeholder="{{\'APPLICATION_ENQUIRY_MESSAGE_PLACEHOLDER\' | translate}}" class="form-control" data-ng-model="item.enquiry_message_placeholder"/>\n							</div>\n							<!-- END ENQUIRY MESSAGE PLACEHOLDER -->\n\n							<!-- START ENQUIRY BUTTON -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formLabel.enquiryButton.$touched || forms.formLabel.$submitted) && forms.formLabel.startChatButton.$invalid}">\n								<label class="control-label">{{\'APPLICATION_ENQUIRY_BUTTON\' | translate}}</label>\n								<input type="text" name="enquiryButton" placeholder="{{\'APPLICATION_ENQUIRY_BUTTON\' | translate}}" class="form-control" data-ng-model="item.enquiry_button"/>\n							</div>\n							<!-- END ENQUIRY BUTTON -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" ng-click="next()"/>\n						</form>\n					</wz-step>\n\n					<wz-step title="{{\'APPLICATION_FORMS\' | translate}}" canexit="exitValidation(forms.formAppearance.$valid)">\n						<form name="forms.formFunctionality" novalidate>\n\n							<!-- START DOWNLOAD TRANSCRIPT -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formFunctionality.animationToggle.$touched || forms.formFunctionality.$submitted) && forms.formFunctionality.animationToggle.$invalid}">\n								<label class="control-label">{{\'APPLICATION_DOWNLOAD_TRANSCRIPT\' | translate}}</label>\n								<ui-select data-ng-model="item.download_transcript" name="downloadTranscript" theme="bootstrap">\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected ? \'On\' : \'Off\'}}</ui-select-match>\n									<ui-select-choices repeat="downloadTranscript in [true, false] | filter: $select.search">\n										<div ng-bind-html="downloadTranscript ? \'On\' : \'Off\' | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n							</div>\n							<!-- END DOWNLOAD TRANSCRIPT -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" ng-click="next()"/>\n						</form>\n					</wz-step>\n\n					<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n						<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n						<input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n					</wz-step>\n				</wizard>\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/fax/account/list/list.html",'<div class="row">\n	<div class="col-md-12">\n			<div class="page-bar">\n				<ul class="page-breadcrumb">\n					<li>\n						<i class="icon-rocket"></i>\n						<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-paper-plane"></i>\n						<a href="#">{{ \'APPLICATION_FAX\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-notebook"></i>\n						<a href="/channels/fax/accounts/list">{{ \'APPLICATION_ACCOUNTS\' | translate }}</a>\n					</li>\n				</ul>\n			</div>\n		</div>\n</div>\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-notebook font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_ACCOUNTS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="fax_accounts.checked.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<a class="btn green-jungle" href="/channels/fax/accounts/wizard">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_ACCOUNT\' | translate }}\n						</a>\n					</div>\n					<a class="btn btn-icon-only btn-default" href="#" ng-csv="getFaxAccounts([\'name\', \'description\', \'phone\'])" csv-header="[\'Name\', \'Description\', \'Phone\']" field-separator=";" filename="fax_accounts.csv">\n					<i class="icon-cloud-download"></i></a>\n					<!-- <a class="btn btn-icon-only btn-default fullscreen" href="#"></a> -->\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<table st-table="displayedFaxAccounts" st-pipe="initList" class="table table-striped table-bordered table-hover">\n					<div class="table-responsive">\n					  <thead>\n							<tr>\n								<th colspan="5">\n									<div class="row">\n										<div class="col-md-6">\n											<ui-select class="input-xsmall" ng-model="conf.faxAccountsByPage" theme="bootstrap" ng-disabled="disabled">\n												<ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n												<ui-select-choices repeat="faxAccountByPage in faxAccountsByPage | filter: $select.search">\n													<div ng-bind-html="faxAccountByPage.name | highlight: $select.search"></div>\n												</ui-select-choices>\n											</ui-select>\n										</div>\n										<div class="col-md-6">\n											<div class="input-group input-medium pull-right">\n												<input st-search placeholder="{{ \'APPLICATION_SEARCH\' | translate }}" class="form-control" type="search" />\n												<span class="input-group-addon">\n													<i class="fa fa-search"></i>\n												</span>\n											</div>\n										</div>\n									</div>\n								</th>\n							</tr>\n						  <tr>\n								<th class="small-cells" style="text-align: center; vertical-align: middle"><input type="checkbox" ng-change="check(faxAccount, checked)" checklist-model checklist-value="id"></th>\n						    <th st-sort="name">{{ \'APPLICATION_NAME\' | translate }}</th>\n								<th st-sort="description">{{ \'APPLICATION_DESCRIPTION\' | translate }}</th>\n								<th st-sort="phone">{{ \'APPLICATION_PHONE\' | translate }}</th>\n								<th>{{ \'APPLICATION_ACTIONS\' | translate }}</th>\n						  </tr>\n					  </thead>\n					  <tbody>\n					    <tr data-ng-repeat="faxAccount in displayedFaxAccounts" class="animate-repeat">\n								<td style="text-align: center; vertical-align: middle"><input type="checkbox" checklist-model="fax_accounts.checked" checklist-value="faxAccount.id"></td>\n					      <td>{{faxAccount.name}}</td>\n								<td>{{faxAccount.description}}</td>\n								<td>{{faxAccount.phone}}</td>\n					      <td>\n					        <a class="btn default btn-xs blue-stripe" data-ng-href="/channels/fax/accounts/view/{{faxAccount.id}}/settings">\n										{{ \'APPLICATION_EDIT\' | translate }}\n					        </a>\n					        <a class="btn default btn-xs red-stripe" data-ng-click="deleteItem(faxAccount.name,faxAccount.id)">\n										{{ \'APPLICATION_DELETE\' | translate }}\n					        </a>\n					      </td>\n					    </tr>\n							<tr data-ng-hide="displayedFaxAccounts.length">\n								<td colspan="5" style="text-align:center;">\n									<i>No fax account available</i>\n								</td>\n							</tr>\n					  </tbody>\n					  <tfoot>\n							<tr>\n								<td></td>\n						    <td>\n									<div class="input-icon right">\n										<i class="fa fa-search"></i>\n										<input st-search="name" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_NAME\' | translate | lowercase}}" class="form-control" type="search"/>\n									</div>\n						    </td>\n								<td>\n									<div class="input-icon right">\n										<i class="fa fa-search"></i>\n										<input st-search="description" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_DESCRIPTION\' | translate | lowercase}}" class="form-control" type="search"/>\n									</div>\n						    </td>\n								<td>\n									<div class="input-icon right">\n										<i class="fa fa-search"></i>\n										<input st-search="phone" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_PHONE\' | translate | lowercase}}" class="form-control" type="search"/>\n									</div>\n						    </td>\n						    <td>\n						    </td>\n						  </tr>\n					    <tr>\n					      <td colspan="5" class="text-center">\n					        <div st-pagination class="pagination" st-items-by-page="conf.faxAccountsByPage.value" st-displayed-pages="7"></div>\n					      </td>\n					    </tr>\n					  </tfoot>\n				</div>\n				</table>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/fax/account/view/view.applications.html",'<div class="row" data-ng-init="initApplication()">\n	<div class="col-md-12">\n\n		<!-- BEGIN  PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-notebook font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_ACCOUNT\' | translate }} WIZARD</a> </span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<wizard on-finish="createItem()">\n	        <wz-step title="{{\'APPLICATION_SETTINGS\' | translate}}" canexit="formValidation(forms.info.$valid)">\n							<form name="forms.info" novalidate>\n								<!-- START APP -->\n								<div class="form-group"  data-ng-class="{\'has-error\': (forms.info.app.$touched || forms.info.$submitted) && forms.info.app.$invalid}">\n									<label class="control-label">{{\'APPLICATION_APPLICATION\' | translate}}</label>\n									<ui-select data-ng-model="application.app" name="app" theme="bootstrap" required>\n				            <ui-select-match placeholder="{{\'APPLICATION_APPLICATION\' | translate}}">{{$select.selected | uppercase}}</ui-select-match>\n				            <ui-select-choices repeat="filter in [\'queue\', \'agent\'] | filter: $select.search">\n				              <div ng-bind-html="filter | uppercase | highlight: $select.search"></div>\n				            </ui-select-choices>\n				          </ui-select>\n									<span data-ng-show="(forms.info.app.$touched || forms.info.$submitted) && forms.info.app.$invalid && forms.info.app.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END APP -->\n\n								<!-- START APPADATA -->\n								<div class="form-group"  data-ng-class="{\'has-error\': (forms.info.appdata.$touched || forms.info.$submitted) && forms.info.appdata.$invalid}">\n									<label class="control-label">{{\'APPLICATION_ARGUMENTS\' | translate}}</label>\n									<ui-select data-ng-model="application.appdata" name="appdata" theme="bootstrap" required>\n				            <ui-select-match placeholder="{{\'APPLICATION_ARGUMENTS\' | translate}}">{{$select.selected.name}}</ui-select-match>\n				            <ui-select-choices repeat="item in items | filter: $select.search">\n				              <div data-ng-bind-html="item.name | highlight: $select.search"></div>\n				            </ui-select-choices>\n				          </ui-select>\n									<span data-ng-show="(forms.info.appdata.$touched || forms.info.$submitted) && forms.info.appdata.$invalid && forms.info.appdata.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END APPADATA -->\n\n								<!-- START TIMEOUT -->\n								<div class="form-group"  data-ng-class="{\'has-error\': (forms.info.timeout.$touched || forms.info.$submitted) && forms.info.timeout.$invalid}">\n									<label class="control-label">{{\'APPLICATION_TIMEOUT\' | translate}}</label>\n									<input type="text" name="timeout" placeholder="{{\'APPLICATION_TIMEOUT\' | translate}}" class="form-control" data-ng-model="application.timeout" required>\n									<span data-ng-show="(forms.info.timeout.$touched || forms.info.$submitted) && forms.info.timeout.$invalid && forms.info.timeout.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END TIMEOUT -->\n\n								<!-- START INTERVAL -->\n								<!-- <div class="form-group" data-ng-class="{\'has-error\': (forms.info.interval.$touched || forms.info.$submitted) && forms.info.interval.$invalid}">\n									<label class="control-label">{{\'APPLICATION_INTERVAL\' | translate}}</label>\n									<input type="text" name="interval" placeholder="*|*|*|*" class="form-control" data-ng-model="application.interval">\n									<span data-ng-show="(forms.info.info.interval.$touched || forms.info.$submitted) && forms.info.interval.$invalid && forms.info.interval.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div> -->\n								<!-- END INTERVAL -->\n\n								<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" data-ng-click="goNext()"/>\n							</form>\n						</wz-step>\n\n						<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n							<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n							<input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n						</wz-step>\n				</wizard>\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),
-a.put("app/channels/fax/account/view/view.html",'<!-- BEGIN PAGE HEADER-->\n<div class="row" data-ng-init="initView()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-paper-plane"></i>\n					<a href="/">{{ \'APPLICATION_FAX\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-notebook"></i>\n					<a href="/channels/fax/accounts/list">{{ \'APPLICATION_ACCOUNTS\' | translate }}</a>\n					<i class="fa fa-angle-right" data-ng-show="account"></i>\n				</li>\n				<li data-ng-show="account">\n					<a href="#">{{ account.name || account.description }}</a>\n				</li>\n			</ul>\n		</div>\n\n<!-- END PAGE HEADER-->\n\n<!-- BEGIN PAGE CONTENT-->\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/account.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{ account.name || account.description }}\n					</div>\n					<div class="profile-usertitle-job">\n						{{ account.phone }}\n					</div>\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.channels.fax.accounts.view.settings\')}">\n							<a href="/channels/fax/accounts/view/{{account.id}}/settings">\n							<i class="icon-settings"></i>\n							{{\'APPLICATION_SETTINGS\' | translate}} </a>\n						</li>\n						<li data-ng-class="{active: $state.is(\'main.channels.fax.accounts.view.routes\') || $state.is(\'main.channels.fax.accounts.view.applications\')}">\n							<a href="/channels/fax/accounts/view/{{account.id}}/routes">\n							<i class="icon-directions"></i>\n							{{\'APPLICATION_ROUTES\' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/fax/account/view/view.routes.html",'<div class="row" data-ng-init="getFaxApplications()">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title  tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_ROUTES\' | translate}}</span>\n				</div>\n				<div class="actions">\n					<div class="btn-group">\n						<a class="btn green-jungle" href="/channels/fax/accounts/view/{{account.id}}/applications" data-toggle="dropdown">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_APPLICATION\' | translate }}\n						</a>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<table class="table table-striped table-bordered table-hover">\n					  <thead>\n						  <tr>\n								<!-- <th width="5%">{{ \'APPLICATION_ID\' | translate }}</th> -->\n						    <th>{{\'APPLICATION_APPLICATION\' | translate}}</th>\n						    <th>{{\'APPLICATION_ARGUMENTS\' | translate}}</th>\n								<th>{{\'APPLICATION_TIMEOUT\' | translate}}</th>\n						    <!-- <th>{{\'APPLICATION_INTERVAL\' | translate}}</th> -->\n								<th width="5%">{{ \'APPLICATION_ACTIONS\' | translate }}</th>\n						  </tr>\n					  </thead>\n						<tbody ui-sortable="sortableOptions" data-ng-model="faxApplications">\n					    <tr data-ng-repeat="application in faxApplications | orderBy:\'priority\'">\n								<td><span data-ng-class="{\'label-info\': application.app == \'agent\', \'label-success\': application.app == \'queue\'}" class="label label-sm"> {{application.app}} </span></td>\n								<td>{{getAppdata(application.app, application.appdata)}}</td>\n								<td>{{application.timeout}}</td>\n								<!-- <td>{{application.interval}}</td> -->\n					      <td>\n					        <a class="btn default btn-xs red-stripe" data-ng-click="deleteItem(application.app,application.id)">\n										{{ \'APPLICATION_DELETE\' | translate }}\n					        </a>\n					      </td>\n					    </tr>\n							<tr data-ng-hide="faxApplications.length">\n								<td colspan="5" style="text-align:center;">\n									<i>No applications available</i>\n								</td>\n							</tr>\n					  </tbody>\n				</table>\n				<!-- END TABLE -->\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/channels/fax/account/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_SETTINGS\' | translate}}</span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{\'APPLICATION_GENERALS\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.formSetting" data-ng-submit="forms.formSetting.$valid && updateItemFaxAccount()" novalidate>\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="account.name" required/>\n								<span data-ng-show="forms.formSetting.name.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="account.description"/>\n							</div>\n							<!-- END DESCRIPTION -->\n\n							<!-- START TRUNKS -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.trunk.$invalid}">\n								<label class="control-label">{{\'APPLICATION_TRUNK\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="account.TrunkId" name="trunk" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_TRUNK\' | translate}}">{{$select.selected.name}}</ui-select-match>\n									<ui-select-choices repeat="trunk.id as trunk in trunks | filter: $select.search">\n										<div data-ng-bind="trunk.name | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span data-ng-show="forms.formSetting.trunk.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- START TRUNKS -->\n\n							<!-- START PHONE -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.phone.$invalid}">\n								<label class="control-label">{{\'APPLICATION_PHONE\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="phone" placeholder="{{\'APPLICATION_PHONE\' | translate}}" class="form-control" data-ng-model="account.phone" required/>\n								<span data-ng-show="forms.formSetting.phone.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END PHONE -->\n\n							<!-- START ECM -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_ECM\' | translate}}<span class="required" aria-required="true">*</span></label><br>\n								<!-- <button type="button" name="ecm" class="btn btn-default form-control" data-ng-model="account.ecm" bs-checkbox>{{account.ecm ? \'ENABLED\' : \'DISABLED\'}}</button> -->\n								<input\n									bs-switch\n									ng-model="account.ecm"\n									type="checkbox"\n									switch-active="{{ isActive }}"\n									switch-on-text="{{ \'APPLICATION_ENABLED\' | translate }}"\n									switch-off-text="{{ \'APPLICATION_DISABLED\' | translate }}"\n									switch-on-color="{{ onColor }}"\n									switch-off-color="{{ offColor }}"\n									switch-animate="{{ animate }}"\n									switch-size="{{ size }}"\n									switch-label="{{ label }}"\n									switch-icon="{{ icon }}"\n									switch-radio-off="{{ radioOff }}"\n									switch-label-width="{{ labelWidth }}"\n									switch-handle-width="{{ handleWidth }}">\n							</div>\n							<!-- END ECM -->\n\n							<!-- START FAXHEADER -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.faxheader.$invalid}">\n								<label class="control-label">{{\'APPLICATION_FAXHEADER\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="faxheader" placeholder="{{\'APPLICATION_FAXHEADER\' | translate}}" class="form-control" data-ng-model="account.faxheader" required/>\n								<span data-ng-show="forms.formSetting.faxheader.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END FAXHEADER -->\n\n							<!-- START LOCALID -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.localid.$invalid}">\n								<label class="control-label">{{\'APPLICATION_LOCALID\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="localid" placeholder="{{\'APPLICATION_LOCALID\' | translate}}" class="form-control" data-ng-model="account.localid" required/>\n								<span data-ng-show="forms.formSetting.localid.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END LOCALID -->\n\n							<!-- START MAXRATE -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.maxrate.$invalid}">\n								<label class="control-label">{{\'APPLICATION_MAXRATE\' | translate}}</label>\n								<ui-select data-ng-model="account.maxrate" name="maxrate" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_MAXRATE\' | translate}}">{{$select.selected}}</ui-select-match>\n									<ui-select-choices repeat="maxrate in [\'9600\', \'14400\', \'33600\'] | filter: $select.search">\n										<div data-ng-bind="maxrate | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span data-ng-show="forms.formSetting.maxrate.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- START MAXRATE -->\n\n							<!-- START MINRATE -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.minrate.$invalid}">\n								<label class="control-label">{{\'APPLICATION_MINRATE\' | translate}}</label>\n								<ui-select data-ng-model="account.minrate" name="minrate" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_MAXRATE\' | translate}}">{{$select.selected}}</ui-select-match>\n									<ui-select-choices repeat="minrate in [\'9600\', \'14400\', \'33600\'] | filter: $select.search">\n										<div data-ng-bind="minrate | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span data-ng-show="forms.formSetting.minrate.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- START MINRATE -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END GENERAL TAB -->\n\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/channels/fax/account/wizard/wizard.html",'<!-- BEGIN PAGE HEADER-->\n<div class="row">\n	<div class="col-md-12">\n			<div class="page-bar">\n				<ul class="page-breadcrumb">\n					<li>\n						<i class="icon-rocket"></i>\n						<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-paper-plane"></i>\n						<a href="#">{{ \'APPLICATION_FAX\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-notebook"></i>\n						<a href="/fax/accounts/list">{{ \'APPLICATION_ACCOUNTS\' | translate }}</a>\n					</li>\n				</ul>\n			</div>\n		</div>\n</div>\n<!-- END PAGE HEADER-->\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initWizard()">\n	<div class="col-md-12">\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-notebook font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_ACCOUNT\' | translate }} WIZARD</a> </span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<wizard on-finish="createItem()">\n          <wz-step title="{{\'APPLICATION_ACCOUNT_INFO\' | translate}}" canexit="exitValidation(forms.formSetting.$valid)">\n						<form name="forms.formSetting" novalidate>\n\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n								<span data-ng-show="forms.formSetting.name.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"/>\n							</div>\n							<!-- END DESCRIPTION -->\n\n							<!-- START TRUNKS -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.trunk.$invalid}">\n								<label class="control-label">{{\'APPLICATION_TRUNK\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="item.TrunkId" name="trunk" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_TRUNK\' | translate}}">{{$select.selected.name}}</ui-select-match>\n									<ui-select-choices repeat="trunk.id as trunk in trunks | filter: $select.search">\n										<div data-ng-bind="trunk.name | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span data-ng-show="forms.formSetting.trunk.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- START TRUNKS -->\n\n							<!-- START PHONE -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.phone.$invalid}">\n								<label class="control-label">{{\'APPLICATION_PHONE\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="phone" placeholder="{{\'APPLICATION_PHONE\' | translate}}" class="form-control" data-ng-model="item.phone" required/>\n								<span data-ng-show="forms.formSetting.phone.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END PHONE -->\n\n							<!-- START ECM -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_ECM\' | translate}}<span class="required" aria-required="true">*</span></label><br>\n								<!-- <button type="button" name="ecm" class="btn btn-default form-control" data-ng-model="item.ecm" bs-checkbox>{{item.ecm ? \'ENABLED\' : \'DISABLED\'}}</button> -->\n								<input\n									bs-switch\n									ng-model="item.ecm"\n									type="checkbox"\n									switch-active="{{ isActive }}"\n									switch-on-text="{{ \'APPLICATION_ENABLED\' | translate }}"\n									switch-off-text="{{ \'APPLICATION_DISABLED\' | translate }}"\n									switch-on-color="{{ onColor }}"\n									switch-off-color="{{ offColor }}"\n									switch-animate="{{ animate }}"\n									switch-size="{{ size }}"\n									switch-label="{{ label }}"\n									switch-icon="{{ icon }}"\n									switch-radio-off="{{ radioOff }}"\n									switch-label-width="{{ labelWidth }}"\n									switch-handle-width="{{ handleWidth }}">\n							</div>\n							<!-- END ECM -->\n\n							<!-- START FAXHEADER -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.faxheader.$invalid}">\n								<label class="control-label">{{\'APPLICATION_FAXHEADER\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="faxheader" placeholder="{{\'APPLICATION_FAXHEADER\' | translate}}" class="form-control" data-ng-model="item.faxheader" required/>\n								<span data-ng-show="forms.formSetting.faxheader.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END FAXHEADER -->\n\n							<!-- START LOCALID -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.localid.$invalid}">\n								<label class="control-label">{{\'APPLICATION_LOCALID\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="localid" placeholder="{{\'APPLICATION_LOCALID\' | translate}}" class="form-control" data-ng-model="item.localid" required/>\n								<span data-ng-show="forms.formSetting.localid.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END LOCALID -->\n\n							<!-- START MAXRATE -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.maxrate.$invalid}">\n								<label class="control-label">{{\'APPLICATION_MAXRATE\' | translate}}</label>\n								<ui-select data-ng-model="item.maxrate" name="maxrate" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_MAXRATE\' | translate}}">{{$select.selected}}</ui-select-match>\n									<ui-select-choices repeat="maxrate in [\'9600\', \'14400\', \'33600\'] | filter: $select.search">\n										<div data-ng-bind="maxrate | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span data-ng-show="forms.formSetting.maxrate.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- START MAXRATE -->\n\n							<!-- START MINRATE -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.minrate.$invalid}">\n								<label class="control-label">{{\'APPLICATION_MINRATE\' | translate}}</label>\n								<ui-select data-ng-model="item.minrate" name="minrate" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_MAXRATE\' | translate}}">{{$select.selected}}</ui-select-match>\n									<ui-select-choices repeat="minrate in [\'9600\', \'14400\', \'33600\'] | filter: $select.search">\n										<div data-ng-bind="minrate | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span data-ng-show="forms.formSetting.minrate.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- START MINRATE -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" data-ng-click="next()"/>\n\n						</form>\n					</wz-step>\n\n					<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n						<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n						<input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n					</wz-step>\n\n				</wizard>\n\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/fax/inbox/inbox.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n			<div class="page-bar">\n				<ul class="page-breadcrumb">\n					<li>\n						<i class="icon-rocket"></i>\n						<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-paper-plane"></i>\n						<a href="#">{{ \'APPLICATION_FAX\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-note"></i>\n						<a href="/channels/fax/inbox/incoming">{{ \'APPLICATION_INBOX\' | translate }}</a>\n					</li>\n				</ul>\n			</div>\n		</div>\n</div>\n<!-- END PAGE CONTENT-->\n<div class="row inbox">\n	<div class="col-md-12" ui-view>\n	</div>\n</div>\n'),a.put("app/channels/fax/inbox/incoming/incoming.html",'<!-- END PAGE HEADER-->\n<div data-ng-init="getRooms()">\n	<!-- <pre>\n		{{faxRooms | json}}\n	</pre> -->\n	<div class="inbox-header">\n		<h1 class="pull-left">Inbox</h1>\n	</div>\n	<div class="inbox-content">\n		<table class="table table-advance" st-table="displayedFaxRooms" st-safe-src="faxRooms">\n			<thead>\n				<tr>\n					<th colspan="8" style="background: #eef4f7; border: none; border-bottom: solid 5px #fff;">\n						<div class="row">\n							<div class="col-md-6">\n								<input type="checkbox" class="mail-checkbox mail-group-checkbox checker" data-ng-model="checked" data-ng-change="switchCheckbox(displayedFaxRooms, checked)">\n								<div class="btn-group">\n									<a data-ng-href="/channels/fax/inbox/compose" class="btn btn-sm blue">{{\'APPLICATION_NEW_MESSAGE\' | translate}} <i class="fa fa-plus"></i></a>\n									<!-- <a class="btn btn-sm blue dropdown-toggle" href="#" data-toggle="dropdown">\n										{{\'APPLICATION_MORE\' | translate}} <i class="fa fa-angle-down"></i>\n									</a> -->\n									<ul class="dropdown-menu">\n										<li>\n											<a href="#" data-ng-click="markAsRead(true)">\n											<i class="icon-paper-plane-open"></i> {{\'APPLICATION_MARK_AS_READ\' | translate}} </a>\n										</li>\n										<li>\n											<a href="#" data-ng-click="markAsRead(false)">\n											<i class="icon-paper-plane"></i> {{\'APPLICATION_MARK_AS_UNREAD\' | translate}} </a>\n										</li>\n										<li class="divider">\n										</li>\n										<li>\n											<a href="#" data-ng-click="deleteMessage()">\n											<i class="icon-trash"></i> {{\'APPLICATION_DELETE\' | translate}} </a>\n										</li>\n									</ul>\n								</div>\n							</div>\n							<div class="col-md-6">\n								<div class="input-group input-medium pull-right">\n									<input st-search placeholder="{{ \'APPLICATION_SEARCH\' | translate }}" class="form-control" type="search" />\n									<span class="input-group-addon btn green" style="cursor: default;">\n										<i class="icon-magnifier" style="color: white;"></i>\n									</span>\n								</div>\n								<ui-select data-ng-model="conf.faxRoomsByPage" theme="bootstrap" style="width: 100px;" class="pull-right margin-right-10">\n									<ui-select-match placeholder="{{ \'APPLICATION_SEARCH\' | translate }}">{{$select.selected}}</ui-select-match>\n									<ui-select-choices repeat="p in [10, 20, 35, 50] | filter: $select.search">\n										<span ng-bind-html="p | highlight: $select.search"></span>\n									</ui-select-choices>\n								</ui-select>\n							</div>\n						</div>\n					</th>\n				</tr>\n			</thead>\n			<tbody>\n				<tr data-ng-repeat="faxRoom in displayedFaxRooms | orderBy:\'-updatedAt\'" data-ng-class="{unread: !faxRoom.read}" data-ng-click="go(\'/fax/inbox/room/\' + faxRoom.id, faxRoom.id, \'OPEN\')" class="animate-repeat">\n					<td class="inbox-small-cells" style="border: none;">\n						<input type="checkbox" class="checker" checklist-model="checkedMailMessages.id" checklist-value="faxRoom.id">\n					</td>\n					<!-- <td class="inbox-small-cells" style="border: none;">\n						<i class="fa fa-star" data-ng-class="{\'inbox-started\': faxRoom.favorite}" data-ng-click="markAsFavorite(faxRoom.id, faxRoom.favorite)"></i>\n					</td> -->\n					<td class="view-message hidden-xs" style="cursor:pointer; border:none;">\n						#{{faxRoom.id}}\n					</td>\n					<!-- <td class="inbox-small-cells" style="border: none;">\n						<i class="fa fa-star" data-ng-class="{\'inbox-started\': faxRoom.favorite}" data-ng-click="markAsFavorite(faxRoom.id, faxRoom.favorite)"></i>\n					</td> -->\n					<!-- <td class="view-message hidden-xs" style="cursor:pointer; border:none;">\n						{{faxRoom.subject}}\n					</td> -->\n					<td class="view-message" style="cursor:pointer; border:none;">\n					 	{{faxRoom.from}}\n					</td>\n					<td class="view-message" style="cursor:pointer; border:none;">\n					 	{{faxRoom.MailAccount.description ? faxRoom.MailAccount.description : faxRoom.MailAccount.name}}\n					</td>\n					<td class="view-message" style="cursor:pointer; border:none;" data-ng-switch="faxRoom.status">\n						<span class="badge badge-default" data-ng-class="{\n						\'badge-danger\': faxRoom.status == \'NEW\',\n						\'badge-warning\': faxRoom.status == \'OPEN\',\n						\'badge-info\': faxRoom.status == \'PENDING\',\n						\'badge-success\': faxRoom.status == \'CLOSED\'}"> {{faxRoom.status | uppercase}} </span>\n					</td>\n					<td class="view-message" style="cursor:pointer; border:none;">\n						<span class="badge badge-success badge-roundless" data-ng-show="faxRoom.User.fullname"> {{faxRoom.User.fullname}} </span>\n						<span class="badge badge-default badge-roundless" data-ng-hide="faxRoom.User.fullname"> {{\'APPLICATION_UNASSIGNED\' | translate}} </span>\n					</td>\n					<td class="view-message text-right" context-menu="menuOptions" style="border: none;">\n						<time is="relative-time" datetime="{{faxRoom.updatedAt}}">\n							April 1, 2014\n						</time>\n					</td>\n				</tr>\n				<tr data-ng-hide="faxRooms.length">\n					<td colspan="6" class="text-center">\n						<i>{{\'MESSAGE_NO_AVAILABLE_MESSAGES\' | translate}}</i>\n					</td>\n				</tr>\n				<tr>\n					<td colspan="8" class="text-center" style="border: none;">\n						<div st-pagination class="pagination" st-items-by-page="conf.faxRoomsByPage" st-displayed-pages="7"></div>\n					</td>\n				</tr>\n			</tbody>\n		</table>\n	</div>\n</div>\n'),a.put("app/channels/fax/inbox/room/room.html",'<!-- BEGIN TODO CONTENT -->\n<div class="todo-content" data-ng-init="initRoomView()">\n	<div class="portlet light">\n		<!-- PROJECT HEAD -->\n		<div class="portlet-title">\n			<div class="caption" data-ng-show="faxRoom">\n				<i class="icon-bar-chart font-green-sharp hide"></i>\n				<span class="badge badge-default" data-ng-class="{\'badge-error\': faxRoom.status == \'NEW\',\n				\'badge-warning\': faxRoom.status == \'OPEN\',\n				\'badge-info\': faxRoom.status == \'PENDING\',\n				\'badge-success\': faxRoom.status == \'CLOSED\'}"> {{faxRoom.status | uppercase}} </span>\n			</div>\n			<div class="actions" data-ng-show="faxRoom">\n				<div class="btn-group" data-ng-show="Auth.isAdmin()">\n					<a class="btn grey-salsa btn-circle btn-sm" href="#" data-toggle="dropdown" data-hover="dropdown" data-close-others="true">\n					{{ \'APPLICATION_ASSIGN\' | translate }} <i class="fa fa-angle-down"></i>\n					</a>\n					<ul class="dropdown-menu pull-right">\n						<li data-ng-repeat="agent in agents">\n							<a href="#" data-ng-click="assignAgent(agent.id)">\n							{{agent.fullname}} <span class="badge badge-default"> {{agent.fullname | uppercase | limitTo : 1}} </span>\n							</a>\n						</li>\n					</ul>\n				</div>\n				<div class="btn-group">\n					<a class="btn green-haze btn-circle btn-sm" href="#" data-toggle="dropdown" data-hover="dropdown" data-close-others="true">\n					{{ \'APPLICATION_STATUS\' | translate }} <i class="fa fa-angle-down"></i>\n					</a>\n					<ul class="dropdown-menu pull-right">\n						<li>\n							<a href="#" data-ng-click="updateStatus(\'PENDING\')">\n							{{\'STATUS_PENING\' | translate}} <span class="badge badge-danger">\n							P </span>\n							</a>\n						</li>\n						<li>\n							<a href="#" data-ng-click="updateStatus(\'CLOSED\')">\n							{{\'STATUS_CLOSED\' | translate}} <span class="badge badge-success">\n							C </span>\n							</a>\n						</li>\n					</ul>\n				</div>\n			</div>\n		</div>\n		<!-- end PROJECT HEAD -->\n		<div class="portlet-body">\n			<div class="row">\n				<div data-ng-show="faxRoom" data-ng-class="{\'col-md-7 col-sm-7\': faxRoom}">\n					<div class="scroller" id="faxMessages" style="height: 500px; overflow-y: scroll; width: auto;" data-always-visible="1" data-rail-visible1="1" data-initialized="1">\n						<ul class="chats">\n							<li data-ng-class="{\'in\': faxMessage.status == \'RECEIVED\', \'out\': (faxMessage.status == \'SENT\' || faxMessage.status == \'SENDING\' || faxMessage.status == \'FAILED\' || faxMessage.status == \'NOT SENT\')}" data-ng-repeat="faxMessage in faxRoom.FaxMessages | orderBy:\'createdAt\'">\n							<img class="avatar" alt="" data-ng-src="api/users/avatar/{{getCurrentUser().userpic && faxMessage.status === \'SENT\' ? getCurrentUser().userpic : \'unknown_avatar\'}}">\n							<div class="message">\n								<span class="arrow">\n								</span>\n								<span class="bold">{{\'APPLICATION_FROM\' | translate}}: </span>\n								<span>{{faxMessage.From.fullname}} </span>\n								<span> &#60;{{faxMessage.From.phone}}&#62; </span>\n								<br>\n								<span class="bold">{{\'APPLICATION_TO\' | translate}}: </span>\n								<span>{{faxMessage.To.fullname}} </span>\n								<span> &#60;{{faxMessage.To.phone}}&#62; </span>\n								<br>\n								<span class="todo-tasklist-date">\n									<i class="fa fa-calendar"></i>\n									<time is="relative-time" datetime="{{faxMessage.createdAt}}">\n										April 1, 2014\n									</time>\n								</span>\n								<span data-ng-show="faxMessage.status == \'FAILED\' || faxMessage.status == \'SENDING\'" class="badge badge-default" data-ng-class="{\'badge-error\': faxMessage.status == \'FAILED\', \'badge-warning\': faxMessage.status == \'SENDING\'}"> {{faxMessage.status | uppercase}} </span>\n								<br>\n								<br>\n								<span class="body">\n									<div class="wrapper" ng-controller="FaxInboxRoomCtrl" style="max-height:600px; overflow:auto;">\n					          <ng-pdf pdf-url="/api/fax/messages/{{faxMessage.id}}/content" template-url="/assets/plugins/angular-pdf/example/partials/viewer.html" scale="0.5" page=1></ng-pdf>\n					        </div>\n								</span>\n								<br>\n							</div>\n						</li>\n						</ul>\n					</div>\n				</div>\n				<div data-ng-class="{\'col-md-5 col-sm-5\': faxRoom, \'col-md-12 col-sm-12\': !faxRoom}">\n					<form name="forms.compose" data-ng-submit="forms.compose.$valid && sendFax()" class="form-horizontal" novalidate>\n						<!-- TASK HEAD -->\n						<div class="form">\n							<div class="form-group">\n								<div class="col-md-12 col-sm-12">\n									<div class="todo-taskbody-user">\n										<img class="todo-userpic pull-left" data-ng-src="api/users/avatar/{{getCurrentUser().userpic ? getCurrentUser().userpic : \'unknown_avatar\'}}" width="50px" height="50px">\n										<span class="todo-username pull-left">{{ getCurrentUser().fullname }}</span>\n									</div>\n								</div>\n							</div>\n							<!-- END TASK HEAD -->\n\n							<!-- FAX FROM -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.compose.from.$invalid && forms.compose.$submitted}">\n								<div class="col-md-12">\n									<div class="row">\n										<div class="col-md-1">\n											<label class="control-label">{{\'APPLICATION_FROM\' | translate}}:</label>\n										</div>\n										<div class="col-md-11">\n											<ui-select data-ng-model="form.from" theme="bootstrap" name="from" required ng-disabled="disabled">\n												<ui-select-match placeholder="{{\'APPLICATION_FROM\' | translate}}...">{{$select.selected.name}} - {{$select.selected.phone}}</ui-select-match>\n												<ui-select-choices repeat="faxAccount in faxAccounts | filter: $select.search">\n													<div ng-bind-html="faxAccount.name | highlight: $select.search"></div>\n													<small ng-bind-html="faxAccount.phone | highlight: $select.search"></small>\n												</ui-select-choices>\n											</ui-select>\n											<span data-ng-show="forms.compose.from.$invalid && forms.compose.$submitted" class="help-block help-block-error">\n							          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							        </span>\n										</div>\n									</div>\n								</div>\n							</div>\n\n							<!-- FAX TO -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.compose.to.$invalid && forms.compose.$submitted}">\n								<div class="col-md-12">\n									<div class="row">\n										<div class="col-md-1">\n											<label class="control-label">{{\'APPLICATION_TO\' | translate}}:</label>\n										</div>\n										<div class="col-md-11">\n											<ui-select tagging tagging-label="" multiple required data-ng-model="form.sto" theme="bootstrap" name="to" ng-disabled="disabled">\n												<ui-select-match placeholder="{{\'APPLICATION_TO\' | translate}}...">{{$item}}</ui-select-match>\n												<ui-select-choices repeat="to in form.to | filter:$select.search">\n													{{to}}\n												</ui-select-choices>\n											</ui-select>\n											<span data-ng-show="forms.compose.to.$invalid && forms.compose.$submitted" class="help-block help-block-error">\n							          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							        </span>\n										</div>\n									</div>\n								</div>\n							</div>\n\n							<!-- TASK DESC -->\n							<div class="form-group">\n								<div class="col-md-12">\n									<!-- <textarea class="form-control todo-taskbody-taskdesc" rows="8" data-ng-model="form.text" name="text" style="resize: none;"></textarea> -->\n									<div class="inbox-editor inbox-wysihtml5" text-angular data-ng-model="form.html" name="html"></div>\n								</div>\n							</div>\n							<!-- END TASK DESC -->\n\n							<!-- START ATTACH -->\n							<div class="form-group">\n								<div class="col-md-6">\n									<input type="file" nv-file-select uploader="uploader" name="file">\n									<table class="table" border="0">\n										<tbody>\n										<tr data-ng-repeat="item in uploader.queue">\n												<td style="border-top-style:none">\n													<strong>\n														{{ item.file.name }}\n													</strong>\n												</td>\n												<td data-ng-show="uploader.isHTML5" nowrap style="border-top-style:none">\n													{{ item.file.size/1024/1024|number:2 }} MB\n												</td>\n												<td nowrap style="border-top-style:none">\n													<button type="button" class="btn btn-danger btn-xs" data-ng-click="item.remove()">\n															<span class="glyphicon glyphicon-trash"></span> Remove\n													</button>\n												</td>\n											</tr>\n										</tbody>\n									</table>\n								</div>\n								<div class="col-md-6">\n									<div class="form-actions right todo-form-actions">\n										<button class="btn btn-circle btn-sm green-haze">{{ \'APPLICATION_SEND\' | translate }}</button>\n										<input type="button" name="cancel" value="{{ \'APPLICATION_CANCEL\' | translate }}" class="btn btn-circle btn-sm btn-default" data-ng-click="cancel()">\n									</div>\n								</div>\n							</div>\n							<!-- END ATTACH -->\n\n						</div>\n					</form>\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n<!-- END TODO CONTENT -->\n'),
-a.put("app/channels/fax/queue/list/list.create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_QUEUE\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.general.name.$touched || form.general.$submitted) && form.general.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n      <span data-ng-show="(form.general.name.$touched || form.general.$submitted) && form.general.name.$invalid && form.general.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"/>\n    </div>\n    <!-- END DESCRIPTION -->\n\n    <!-- START TIMEOUT -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.general.timeout.$touched || form.general.$submitted) && form.general.timeout.$invalid}">\n      <label class="control-label">{{\'APPLICATION_AGENT_TIMEOUT\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="number" name="timeout" placeholder="Timeout" class="form-control" data-ng-model="item.timeout" required/>\n      <span data-ng-show="(form.general.timeout.$touched || form.general.$submitted) && form.general.timeout.$invalid && form.general.timeout.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END TIMEOUT -->\n\n    <!-- START HEADER SHAPE -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.general.strategy.$touched || form.general.$submitted) && form.general.strategy.$invalid}">\n      <label class="control-label">{{\'APPLICATION_STRATEGY\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <ui-select data-ng-model="item.strategy" name="strategy" theme="bootstrap" required>\n        <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.toUpperCase()}}</ui-select-match>\n        <ui-select-choices repeat="strategy in [\'rrmemory\',\'beepall\'] | filter: $select.search">\n          <div ng-bind-html="strategy.toUpperCase() | highlight: $select.search"></div>\n        </ui-select-choices>\n      </ui-select>\n      <span data-ng-show="(form.general.strategy.$touched || form.general.$submitted) && form.general.strategy.$invalid && form.general.strategy.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END HEADER SHAPE -->\n\n\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="save()" ng-disabled="form.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/channels/fax/queue/list/list.html",'<div class="row">\n	<div class="col-md-12">\n			<div class="page-bar">\n				<ul class="page-breadcrumb">\n					<li>\n						<i class="icon-rocket"></i>\n						<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-paper-plane"></i>\n						<a href="#">{{ \'APPLICATION_FAX\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-docs"></i>\n						<a href="/channels/fax/queues/lis">{{ \'APPLICATION_QUEUES\' | translate }}</a>\n					</li>\n				</ul>\n			</div>\n		</div>\n</div>\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-docs font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_QUEUES\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<a class="btn green-jungle " href="#"  data-ng-click="createItem()">\n						<i class="icon-plus"></i> {{ \'APPLICATION_NEW_QUEUE\' | translate }}\n					</a>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/fax/queue/view/view.agents.html",'<div class="row" data-ng-init="getTeams()">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_AGENTS\' | translate}}</span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- BEGIN FORM-->\n				<form action="index.html" class="form-horizontal form-row-seperated">\n					<div class="form-body">\n						<label for="penalty">{{\'APPLICATION_PENALTY\' | translate}}</label>\n						<div class="input-group input-small mbottom20">\n							<input type="number" class="spinner-input form-control" maxlength="3" data-ng-model="queue.penalty" readonly>\n							<div class="spinner-buttons input-group-btn btn-group-vertical">\n								<button type="button" class="btn spinner-up btn-xs blue" data-ng-click="queue.penalty=queue.penalty+1">\n									<i class="fa fa-angle-up"></i>\n								</button>\n								<button type="button" class="btn spinner-down btn-xs blue" data-ng-disabled="!queue.penalty" data-ng-click="queue.penalty=queue.penalty-1">\n									<i class="fa fa-angle-down"></i>\n								</button>\n							</div>\n						</div>\n						<div class="form-group last">\n							<div class="col-md-12" id="multi-select-team">\n							</div>\n						</div>\n					</div>\n				</form>\n				<!-- END FORM-->\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/channels/fax/queue/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getQueue()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-paper-plane"></i>\n					<a href="#">{{ \'APPLICATION_FAX\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-docs"></i>\n					<a href="/channels/fax/queues/list">{{ \'APPLICATION_QUEUES\' | translate }}</a>\n					<i data-ng-show="queue" class="fa fa-angle-right"></i>\n				</li>\n				<li data-ng-show="queue">\n					<a href="#">{{queue.name}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/queue.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{queue.name}}\n					</div>\n					<!-- <div class="profile-usertitle-job">\n						{{user.role}}\n					</div> -->\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.channels.fax.queues.view.settings\')}">\n							<a data-ng-href="/channels/fax/queues/view/{{queue.id}}/settings">\n							<i class="icon-settings"></i>\n							{{ \'APPLICATION_SETTINGS\' | translate}} </a>\n						</li>\n						<li data-ng-class="{active: $state.is(\'main.channels.fax.queues.view.agents\')}">\n							<a data-ng-href="/channels/fax/queues/view/{{queue.id}}/agents">\n							<i class="icon-people"></i>\n							{{ \'APPLICATION_AGENTS\' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/fax/queue/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_SETTINGS\' | translate}}</span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<form name="forms.general" data-ng-submit="forms.general.$valid && updateFaxQueue()" novalidate>\n					<!-- START NAME -->\n					<div class="form-group" data-ng-class="{\'has-error\': (forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid}">\n						<label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n						<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="queue.name" required/>\n						<span data-ng-show="(forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid && forms.general.name.$error.required" class="help-block help-block-error">\n							<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n						</span>\n					</div>\n					<!-- END NAME -->\n\n					<!-- START DESCRIPTION -->\n					<div class="form-group">\n						<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n						<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="queue.description"/>\n					</div>\n					<!-- END DESCRIPTION -->\n\n					<!-- START TIMEOUT -->\n					<div class="form-group">\n						<label class="control-label">{{\'APPLICATION_TIMEOUT\' | translate}}</label>\n						<input type="number" name="timeout" placeholder="{{\'APPLICATION_TIMEOUT\' | translate}}" class="form-control" min="1" data-ng-model="queue.timeout"/>\n					</div>\n					<!-- END TIMEOUT -->\n\n					<!-- START HEADER SHAPE -->\n					<div class="form-group" data-ng-class="{\'has-error\': (forms.general.strategy.$touched || forms.general.$submitted) && forms.general.strategy.$invalid}">\n						<label class="control-label">{{\'APPLICATION_STRATEGY\' | translate}}</label>\n						<!-- <input colorpicker type="text" name="animationToggle" placeholder="{{\'APPLICATION_BUTTON_COLOR\' | translate}}" class="form-control" data-ng-model="chatWebsite.animation" required/> -->\n						<ui-select data-ng-model="queue.strategy" name="strategy" theme="bootstrap">\n							<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.toUpperCase()}}</ui-select-match>\n							<ui-select-choices repeat="strategy in [\'rrmemory\',\'beepall\'] | filter: $select.search">\n								<div ng-bind-html="strategy.toUpperCase() | highlight: $select.search"></div>\n							</ui-select-choices>\n						</ui-select>\n					</div>\n					<!-- END HEADER SHAPE -->\n					<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n				</form>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/channels/fax/realtime/view/agent/agent.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initAgents()">\n	<div class="col-md-12">\n		<!-- START TABLE -->\n		<div ui-grid="gridOptions"  ui-grid-resize-columns  class="ui-grid" ui-grid-tree-view ui-grid-expandable-row ui-grid-pagination auto-resize>\n			<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n		</div>\n		<!-- END TABLE -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/fax/realtime/view/agent/agent.modal.info.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_INTERFACE_INFO\' | translate }}</h3>\n</div>\n<div class="modal-body">\n<div data-ng-if="agent.ipaddr" class="well">\n  <div>{{agent.ipaddr}}:{{agent.port}}</div>\n  <div>{{agent.fullcontact}}</div>\n  <div>{{agent.useragent}}</div>\n  <div>{{agent.lastms}}</div>\n</div>\n<div data-ng-if="!agent.ipaddr" class="alert alert-danger" role="alert">\n  {{\'MESSAGE_NO_AVAILABLE_INFO\' | translate}}\n</div>\n</div>\n<div class="modal-footer">\n  <button class="btn default" type="button" ng-click="close()">{{ \'APPLICATION_CLOSE\' | translate }}</button>\n</div>\n'),a.put("app/channels/fax/realtime/view/agent/queue.modal.add.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_JOIN_QUEUE\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n\n    <div class="form-group row">\n  <label class="col-md-2 control-label" style="margin-top: 7px;">{{\'APPLICATION_QUEUE\' | translate}}:</label>\n  <div class="col-md-10">\n    <ui-select multiple ng-model="item.queues" theme="bootstrap" required>\n      <ui-select-match placeholder="{{\'APPLICATION_QUEUE\' | translate}}">{{$item.name}}</ui-select-match>\n      <ui-select-choices repeat="queue.id as queue in queues | filter: $select.search">\n        <div ng-bind-html="queue.name | highlight: $select.search"></div>\n      </ui-select-choices>\n    </ui-select>\n  </div>\n</div>\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="save()" ng-disabled="form.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/channels/fax/realtime/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-directions"></i>\n					<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-envelope"></i>\n					<a href="#">{{ \'APPLICATION_FAX\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-energy"></i>\n					<a href="#">{{ \'APPLICATION_REALTIME\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<div>\n			<nav class="navbar navbar-default" role="navigation">\n				<div class="collapse navbar-collapse">\n					<ul class="nav navbar-nav">\n						<li data-ng-class="{\'active\': $state.is(\'channels.fax.realtime.view.agents\')}">\n							<a href="/channels/fax/realtime/view/agents">\n								{{\'APPLICATION_AGENTS\' | translate}}\n							</a>\n						</li>\n					</ul>\n				</div>\n			</nav>\n		</div>\n\n		<div ui-view></div>\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/mail/account/list/list.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-puzzle"></i>\n					<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-envelope"></i>\n					<a href="#">{{ \'APPLICATION_MAIL\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-notebook"></i>\n					<a href="#">{{ \'APPLICATION_ACCOUNTS\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n	</div>\n</div>\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-notebook font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_ACCOUNTS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group">\n						<a class="btn btn-default" href="#" data-ng-click="gridOptions.getPage();">\n							<i class="icon-reload"></i>\n						</a>\n					</div>\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<a class="btn green-jungle" href="/channels/mail/accounts/wizard">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_ACCOUNT\' | translate }}\n						</a>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/mail/account/view/action/list/list.html",'<div class="row" data-ng-init="initActons()">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_ACTIONS\' | translate}}</span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<a class="btn green-jungle" href="/channels/mail/accounts/view/{{account.id}}/actions/wizard" data-toggle="dropdown">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_ACTION\' | translate }}\n						</a>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/channels/mail/account/view/action/view/view.html",'\n<div class="row" data-ng-init="initAction()">\n	<div class="col-md-12">\n		<!-- BEGIN  PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-directions font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_ACTION\' | translate }}</a> </span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<form name="forms.settings" ng-submit="updateItem()" novalidate>\n					<!-- START APP -->\n					<div class="form-group"  data-ng-class="{\'has-error\': (forms.settings.app.$touched || forms.settings.$submitted) && forms.settings.app.$invalid}">\n						<label class="control-label">{{ \'APPLICATION_APPLICATION\' | translate }}<span class="required" aria-required="true">*</span></label>\n						<ui-select data-ng-model="application.app" name="app" theme="bootstrap" required>\n							<ui-select-match placeholder="{{ \'APPLICATION_APPLICATION\' | translate }}">{{$select.selected.name}}</ui-select-match>\n							<ui-select-choices repeat="app.value as app in apps | filter: $select.search">\n								<div ng-bind-html="app.name | highlight: $select.search"></div>\n							</ui-select-choices>\n						</ui-select>\n						<span data-ng-show="(forms.settings.app.$touched || forms.settings.$submitted) && forms.settings.app.$invalid && forms.settings.app.$error.required" class="help-block help-block-error">\n							<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n						</span>\n					</div>\n					<!-- END APP -->\n\n					<!-- START HOST -->\n					<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid}">\n						<label class="control-label">{{\'APPLICATION_TIMEOUT\' | translate}} <span class="required" aria-required="true">*</span></label>\n						<input type="number" name="timeout" placeholder="{{\'APPLICATION_TIMEOUT\' | translate}}" class="form-control" data-ng-model="application.timeout" min="0" required/>\n						<span data-ng-show="(forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid && forms.settings.timeout.$error.required" class="help-block help-block-error">\n							<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n						</span>\n					</div>\n					<!-- END HOST -->\n\n					<div class="app-settings" ng-slide-down="application.app === \'queue\'" lazy-render duration="1" data-ng-init="getQueues()">\n						<!-- START QUEUE -->\n						<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.queue.$touched || forms.settings.$submitted) && forms.settings.queue.$invalid}">\n							<label class="control-label">{{\'APPLICATION_QUEUE\' | translate}}<span class="required" aria-required="true">*</span></label>\n							<ui-select data-ng-model="application.MailQueueId" name="queue" theme="bootstrap" required>\n								<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n								<ui-select-choices repeat="queue.id as queue in queues | filter: $select.search">\n									<div ng-bind-html="queue.name | highlight: $select.search"></div>\n								</ui-select-choices>\n							</ui-select>\n							<span data-ng-show="(forms.settings.queue.$touched || forms.settings.$submitted) && forms.settings.queue.$error.required" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n						</div>\n						<!-- END QUEUE -->\n					</div>\n\n					<div class="app-settings" ng-slide-down="application.app === \'agent\'" lazy-render duration="1" data-ng-init="getAgents()">\n						<!-- START AGENT -->\n						<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.agent.$touched || forms.settings.$submitted) && forms.settings.agent.$invalid}">\n							<label class="control-label">{{\'APPLICATION_AGENT\' | translate}}<span class="required" aria-required="true">*</span></label>\n							<ui-select data-ng-model="application.UserId" name="agent" theme="bootstrap" required>\n								<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.fullname}}</ui-select-match>\n								<ui-select-choices repeat="agent.id as agent in agents | filter: $select.search">\n									<div ng-bind-html="agent.fullname | highlight: $select.search"></div>\n								</ui-select-choices>\n							</ui-select>\n							<span data-ng-show="(forms.settings.agent.$touched || forms.settings.$submitted) && forms.settings.agent.$error.required" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n						</div>\n						<!-- END AGENT -->\n					</div>\n\n					<!-- START INTERVAL_TYPE -->\n					<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.intType.$touched || forms.settings.$submitted) && forms.settings.intType.$invalid}">\n						<label class="control-label">{{ \'APPLICATION_INTERVAL_TYPE\' | translate }}<span class="required" aria-required="true">*</span></label>\n						<ui-select data-ng-model="application.intType" theme="bootstrap" name="intType" required>\n							<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{ $select.selected.name | translate }}</ui-select-match>\n							<ui-select-choices repeat="intType.value as intType in $application.intTypes | filter: $select.search">\n								{{ intType.name | translate }}\n							</ui-select-choices>\n						</ui-select>\n						<span data-ng-show="(forms.settings.intType.$touched || forms.settings.$submitted) && forms.settings.intType.$error.required" class="help-block help-block-error">\n							<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n						</span>\n					</div>\n					<!-- END INTERVAL_TYPE -->\n\n					<div class="app-settings" ng-slide-down="application.intType === \'custom\'" lazy-render duration="1">\n						<!-- START TIME -->\n						<div class="form-group">\n							<label class="control-label">{{ \'APPLICATION_TIME\' | translate }}</label>\n							<div class="input-group input-large">\n								<fieldset class="pull-left" ng-disabled="application.alwaysTime">\n									<uib-timepicker name="t_from" data-ng-model="application.t_from" show-meridian="false" show-spinners="false" mousewheel="false"></uib-timepicker>\n								</fieldset>\n								<div class="input-group-addon col-md-1 interval-to pull-left">to</div>\n								<fieldset ng-disabled="application.alwaysTime"><uib-timepicker  name="t_to" data-ng-model="application.t_to" show-meridian="false" show-spinners="false" mousewheel="false"></uib-timepicker></fieldset>\n								<!-- <label class="control-label pointer-cursor"><input type="checkbox" data-ng-model="application.alwaysTime">{{\'APPLICATION_ALWAYS\' | translate}}</label> -->\n							</div>\n						</div>\n						<!-- END TIME -->\n\n						<!-- START ALWAYS -->\n						<div class="form-group">\n							<label class="control-label">{{ \'APPLICATION_ALWAYS\' | translate }}</label>\n							<div class="input-group input-large">\n								<label class="control-label pointer-cursor">\n									<input\n										bs-switch\n										data-ng-model="application.alwaysTime"\n										type="checkbox"\n										switch-active="{{ isActive }}"\n										switch-on-text="{{ \'APPLICATION_YES\' | translate }}"\n										switch-off-text="{{ \'APPLICATION_NO\' | translate }}"\n										switch-on-color="{{ onColor }}"\n										switch-off-color="{{ offColor }}"\n										switch-animate="{{ animate }}"\n										switch-size="{{ size }}"\n										switch-label="{{ label }}"\n										switch-icon="{{ icon }}"\n										switch-radio-off="{{ radioOff }}"\n										switch-label-width="{{ labelWidth }}"\n										switch-handle-width="{{ handleWidth }}">\n									<!-- <input type="checkbox" data-ng-model="application.alwaysTime"> -->\n								</label>\n							</div>\n						</div>\n						<!-- END ALWAYS -->\n\n						<!-- START WEEKDAY -->\n						<div class="form-group">\n							<label class="control-label">{{ \'APPLICATION_WEEKDAY\' | translate }}</label>\n							<div class="input-group input-large">\n								<ui-select data-ng-model="application.wd_from" theme="bootstrap" name="wd_from">\n									<ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n									<ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n										{{ weekDay.name | translate}}\n									</ui-select-choices>\n								</ui-select>\n								<span class="input-group-addon">to</span>\n								<ui-select data-ng-model="application.wd_to" theme="bootstrap" name="wd_to">\n									<ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n									<ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n										{{ weekDay.name | translate }}\n									</ui-select-choices>\n								</ui-select>\n							</div>\n						</div>\n						<!-- END WEEKDAY -->\n\n						<!-- START MONTHDAY -->\n						<div class="form-group">\n							<label class="control-label">{{ \'APPLICATION_MONTHDAY\' | translate }}</label>\n							<div class="input-group input-large">\n								<ui-select data-ng-model="application.md_from" theme="bootstrap" name="md_from">\n									<ui-select-match>{{$select.selected}}</ui-select-match>\n									<ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n										{{monthDay}}\n									</ui-select-choices>\n								</ui-select>\n								<span class="input-group-addon">to</span>\n								<ui-select data-ng-model="application.md_to" theme="bootstrap" name="md_to">\n									<ui-select-match>{{$select.selected}}</ui-select-match>\n									<ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n										{{monthDay}}\n									</ui-select-choices>\n								</ui-select>\n							</div>\n						</div>\n						<!-- END MONTHDAY -->\n\n						<!-- START MONTH -->\n						<div class="form-group">\n							<label class="control-label">{{ \'APPLICATION_MONTH\' | translate }}</label>\n							<div class="input-group input-large">\n								<ui-select data-ng-model="application.m_from" theme="bootstrap" name="m_from">\n									<ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n									<ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n										{{ month.name | translate }}\n									</ui-select-choices>\n								</ui-select>\n								<span class="input-group-addon">to</span>\n								<ui-select data-ng-model="application.m_to" theme="bootstrap" name="m_to">\n									<ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n									<ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n										{{ month.name | translate }}\n									</ui-select-choices>\n								</ui-select>\n							</div>\n						</div>\n						<!-- END MONTH -->\n					</div>\n\n					<div class="app-settings" ng-slide-down="application.intType === \'list\'" lazy-render duration="1" data-ng-init="getIntervals()">\n\n						<!-- START INTERVALS -->\n						<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.IntervalId.$touched || forms.settings.$submitted) && forms.settings.IntervalId.$invalid}">\n							<label class="control-label">{{\'APPLICATION_INTERVALS\' | translate}}<span class="required" aria-required="true">*</span></label>\n							<ui-select data-ng-model="application.IntervalId" theme="bootstrap" name="IntervalId" required>\n								<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{ $select.selected.name}}</ui-select-match>\n								<ui-select-choices repeat="interval.id as interval in intervals | filter: $select.search">\n									{{ interval.name}}\n								</ui-select-choices>\n							</ui-select>\n							<span data-ng-show="(forms.settings.IntervalId.$touched || forms.settings.$submitted) && forms.settings.IntervalId.$error.required" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n						</div>\n						<!-- END INTERVALS -->\n\n					</div>\n					<button class="btn green-haze" type="submit">{{\'APPLICATION_UPDATE\' | translate}}</button>\n				</form>\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),
-a.put("app/channels/mail/account/view/action/wizard/wizard.html",'\n<div class="row" data-ng-init="initWizard()">\n	<div class="col-md-12">\n		<!-- BEGIN  PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-directions font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_ACTION\' | translate }} WIZARD</a> </span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<wizard on-finish="createItem()">\n					<wz-step title="{{\'APPLICATION_APPLICATION\' | translate}}" canexit="formValidation(forms.action.$valid)">\n						<form name="forms.action" novalidate>\n							<!-- START APP -->\n							<div class="form-group"  data-ng-class="{\'has-error\': forms.action.$submitted && forms.action.app.$invalid}">\n								<label class="control-label">{{ \'APPLICATION_APPLICATION\' | translate }}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="application.app" name="app" theme="bootstrap" required>\n									<ui-select-match placeholder="{{ \'APPLICATION_APPLICATION\' | translate }}">{{$select.selected.name}}</ui-select-match>\n									<ui-select-choices repeat="app.value as app in apps | filter: $select.search">\n										<div ng-bind-html="app.name | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span data-ng-show="forms.action.$submitted && forms.action.app.$invalid" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END APP -->\n\n							<!-- START HOST -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.action.timeout.$touched || forms.action.$submitted) && forms.action.timeout.$invalid}">\n								<label class="control-label">{{\'APPLICATION_TIMEOUT\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="number" name="timeout" placeholder="{{\'APPLICATION_TIMEOUT\' | translate}}" class="form-control" data-ng-model="application.timeout" min="0" required/>\n								<span data-ng-show="(forms.action.timeout.$touched || forms.action.$submitted) && forms.action.timeout.$invalid && forms.action.timeout.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END HOST -->\n\n							<div class="app-settings" ng-slide-down="application.app === \'queue\'" lazy-render duration="1" data-ng-init="getQueues()">\n								<!-- START QUEUE -->\n								<div class="form-group" data-ng-class="{\'has-error\': (forms.action.queue.$touched || forms.action.$submitted) && forms.action.queue.$invalid}">\n									<label class="control-label">{{\'APPLICATION_QUEUE\' | translate}}<span class="required" aria-required="true">*</span></label>\n									<ui-select data-ng-model="application.MailQueueId" name="queue" theme="bootstrap" required>\n										<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n										<ui-select-choices repeat="queue.id as queue in queues | filter: $select.search">\n											<div ng-bind-html="queue.name | highlight: $select.search"></div>\n										</ui-select-choices>\n									</ui-select>\n									<span data-ng-show="(forms.action.queue.$touched || forms.action.$submitted) && forms.action.queue.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END QUEUE -->\n							</div>\n\n							<div class="app-settings" ng-slide-down="application.app === \'agent\'" lazy-render duration="1" data-ng-init="getAgents()">\n								<!-- START AGENT -->\n								<div class="form-group" data-ng-class="{\'has-error\': (forms.action.agent.$touched || forms.action.$submitted) && forms.action.agent.$invalid}">\n									<label class="control-label">{{\'APPLICATION_AGENT\' | translate}}<span class="required" aria-required="true">*</span></label>\n									<ui-select data-ng-model="application.UserId" name="agent" theme="bootstrap" required>\n										<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.fullname}}</ui-select-match>\n										<ui-select-choices repeat="agent.id as agent in agents | filter: $select.search">\n											<div ng-bind-html="agent.fullname | highlight: $select.search"></div>\n										</ui-select-choices>\n									</ui-select>\n									<span data-ng-show="(forms.action.agent.$touched || forms.action.$submitted) && forms.action.agent.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END AGENT -->\n							</div>\n\n							<!-- START INTERVAL_TYPE -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.action.intType.$touched || forms.action.$submitted) && forms.action.intType.$invalid}">\n								<label class="control-label">{{ \'APPLICATION_INTERVAL_TYPE\' | translate }}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="application.intType" theme="bootstrap" name="intType" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{ $select.selected.name | translate }}</ui-select-match>\n									<ui-select-choices repeat="intType.value as intType in $application.intTypes | filter: $select.search">\n										{{ intType.name | translate }}\n									</ui-select-choices>\n								</ui-select>\n								<span data-ng-show="(forms.action.intType.$touched || forms.action.$submitted) && forms.action.intType.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END INTERVAL_TYPE -->\n\n							<div class="app-settings" ng-slide-down="application.intType === \'custom\'" lazy-render duration="1">\n								<!-- START TIME -->\n								<div class="form-group">\n									<label class="control-label">{{ \'APPLICATION_TIME\' | translate }}</label>\n									<div class="input-group input-large">\n										<fieldset class="pull-left" ng-disabled="application.alwaysTime">\n											<uib-timepicker name="t_from" data-ng-model="application.t_from" show-meridian="false" show-spinners="false" mousewheel="false"></uib-timepicker>\n										</fieldset>\n										<div class="input-group-addon col-md-1 interval-to pull-left">to</div>\n										<fieldset ng-disabled="application.alwaysTime"><uib-timepicker  name="t_to" data-ng-model="application.t_to" show-meridian="false" show-spinners="false" mousewheel="false"></uib-timepicker></fieldset>\n										<!-- <label class="control-label pointer-cursor"><input type="checkbox" data-ng-model="application.alwaysTime">{{\'APPLICATION_ALWAYS\' | translate}}</label> -->\n									</div>\n								</div>\n								<!-- END TIME -->\n\n								<!-- START ALWAYS -->\n								<div class="form-group">\n									<label class="control-label">{{ \'APPLICATION_ALWAYS\' | translate }}</label>\n									<div class="input-group input-large">\n										<label class="control-label pointer-cursor">\n											<input\n												bs-switch\n												data-ng-model="application.alwaysTime"\n												type="checkbox"\n												switch-active="{{ isActive }}"\n												switch-on-text="{{ \'APPLICATION_YES\' | translate }}"\n												switch-off-text="{{ \'APPLICATION_NO\' | translate }}"\n												switch-on-color="{{ onColor }}"\n												switch-off-color="{{ offColor }}"\n												switch-animate="{{ animate }}"\n												switch-size="{{ size }}"\n												switch-label="{{ label }}"\n												switch-icon="{{ icon }}"\n												switch-radio-off="{{ radioOff }}"\n												switch-label-width="{{ labelWidth }}"\n												switch-handle-width="{{ handleWidth }}">\n											<!-- <input type="checkbox" data-ng-model="application.alwaysTime"> -->\n										</label>\n									</div>\n								</div>\n								<!-- END ALWAYS -->\n\n								<!-- START WEEKDAY -->\n								<div class="form-group">\n									<label class="control-label">{{ \'APPLICATION_WEEKDAY\' | translate }}</label>\n									<div class="input-group input-large">\n										<ui-select data-ng-model="application.wd_from" theme="bootstrap" name="wd_from">\n											<ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n											<ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n												{{ weekDay.name | translate}}\n											</ui-select-choices>\n										</ui-select>\n										<span class="input-group-addon">to</span>\n										<ui-select data-ng-model="application.wd_to" theme="bootstrap" name="wd_to">\n											<ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n											<ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n												{{ weekDay.name | translate }}\n											</ui-select-choices>\n										</ui-select>\n									</div>\n								</div>\n								<!-- END WEEKDAY -->\n\n								<!-- START MONTHDAY -->\n								<div class="form-group">\n									<label class="control-label">{{ \'APPLICATION_MONTHDAY\' | translate }}</label>\n									<div class="input-group input-large">\n										<ui-select data-ng-model="application.md_from" theme="bootstrap" name="md_from">\n											<ui-select-match>{{$select.selected}}</ui-select-match>\n											<ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n												{{monthDay}}\n											</ui-select-choices>\n										</ui-select>\n										<span class="input-group-addon">to</span>\n										<ui-select data-ng-model="application.md_to" theme="bootstrap" name="md_to">\n											<ui-select-match>{{$select.selected}}</ui-select-match>\n											<ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n												{{monthDay}}\n											</ui-select-choices>\n										</ui-select>\n									</div>\n								</div>\n								<!-- END MONTHDAY -->\n\n								<!-- START MONTH -->\n								<div class="form-group">\n									<label class="control-label">{{ \'APPLICATION_MONTH\' | translate }}</label>\n									<div class="input-group input-large">\n										<ui-select data-ng-model="application.m_from" theme="bootstrap" name="m_from">\n											<ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n											<ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n												{{ month.name | translate }}\n											</ui-select-choices>\n										</ui-select>\n										<span class="input-group-addon">to</span>\n										<ui-select data-ng-model="application.m_to" theme="bootstrap" name="m_to">\n											<ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n											<ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n												{{ month.name | translate }}\n											</ui-select-choices>\n										</ui-select>\n									</div>\n								</div>\n								<!-- END MONTH -->\n							</div>\n\n							<div class="app-settings" ng-slide-down="application.intType === \'list\'" lazy-render duration="1" data-ng-init="getIntervals()">\n\n								<!-- START INTERVALS -->\n								<div class="form-group" data-ng-class="{\'has-error\': (forms.action.IntervalId.$touched || forms.action.$submitted) && forms.action.IntervalId.$invalid}">\n									<label class="control-label">{{\'APPLICATION_INTERVALS\' | translate}}<span class="required" aria-required="true">*</span></label>\n									<ui-select data-ng-model="application.IntervalId" theme="bootstrap" name="IntervalId" required>\n										<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{ $select.selected.name}}</ui-select-match>\n										<ui-select-choices repeat="interval.id as interval in intervals | filter: $select.search">\n											{{ interval.name}}\n										</ui-select-choices>\n									</ui-select>\n									<span data-ng-show="(forms.action.IntervalId.$touched || forms.action.$submitted) && forms.action.IntervalId.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END INTERVALS -->\n\n							</div>\n\n							<input class="btn green-haze" type="submit" data-ng-click="next()" value="{{\'APPLICATION_CONTINUE\' | translate}}"/>\n						</form>\n					</wz-step>\n					<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n						<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n						<!-- <button class="btn green-haze" type="button" wz-previous><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button> -->\n						<input class="btn green-haze" type="submit" data-ng-click="next()" value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n					</wz-step>\n				</wizard>\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/mail/account/view/view.html",'<!-- BEGIN PAGE HEADER-->\n<div class="row" data-ng-init="initView()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-puzzle"></i>\n					<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-envelope"></i>\n					<a href="#">{{ \'APPLICATION_MAIL\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-notebook"></i>\n					<a href="/channels/mail/accounts/list">{{ \'APPLICATION_ACCOUNTS\' | translate }}</a>\n					<i class="fa fa-angle-right" data-ng-show="account"></i>\n				</li>\n				<li data-ng-show="account">\n					<a href="#">{{ account.description || account.name }}</a>\n				</li>\n			</ul>\n		</div>\n\n<!-- END PAGE HEADER-->\n\n<!-- BEGIN PAGE CONTENT-->\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET main.channels -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img ng-src="assets/images/media/account.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{ account.description || account.name }}\n					</div>\n					<div class="profile-usertitle-job">\n						{{account.email}}\n					</div>\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li ng-class="{active: $state.is(\'main.channels.mail.accounts.view.settings\')}">\n							<a href="/channels/mail/accounts/view/{{account.id}}/settings">\n							<i class="icon-settings"></i>\n							{{\'APPLICATION_SETTINGS\' | translate}} </a>\n						</li>\n						<li ng-class="{active: $state.includes(\'main.channels.mail.accounts.view.actions\')}">\n							<a href="/channels/mail/accounts/view/{{account.id}}/actions/list">\n							<i class="icon-directions"></i>\n							{{\'APPLICATION_ACTIONS\' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<div ui-view class="profile-content"></div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n<!-- END PAGE CONTENT-->\n</div>\n'),a.put("app/channels/mail/account/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_SETTINGS\' | translate}}</span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{\'APPLICATION_GENERALS\' | translate}}</a>\n					</li>\n					<li>\n						<a href="#" data-target="#tab_1_2" data-toggle="tab">IMAP</a>\n					</li>\n					<li>\n						<a href="#" data-target="#tab_1_3" data-toggle="tab">SMTP</a>\n					</li>\n				</ul>\n			</div>\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.info" data-ng-submit="forms.info.$valid && updateItemMailAccount()" novalidate>\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="account.name" required/>\n								<span data-ng-show="(forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$invalid && forms.info.name.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<!-- START ADDRESS -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.info.address.$touched || forms.info.$submitted) && forms.info.address.$invalid}">\n								<label class="control-label">{{\'APPLICATION_EMAIL_ADDRESS\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="address" placeholder="{{\'APPLICATION_ADDRESS\' | translate}}" class="form-control" data-ng-model="account.address" required/>\n								<span data-ng-show="(forms.info.address.$touched || forms.info.$submitted) && forms.info.address.$invalid && forms.info.address.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END ADDRESS -->\n\n							<!-- START FIDELITY -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_FIDELITY\' | translate}}</label></br>\n								<input\n								bs-switch\n								data-ng-model="account.fidelity"\n								type="checkbox"\n								switch-active="{{ isActive }}"\n								switch-on-text="{{ \'APPLICATION_ENABLED\' | translate }}"\n								switch-off-text="{{ \'APPLICATION_DISABLED\' | translate }}"\n								switch-on-color="{{ onColor }}"\n								switch-off-color="{{ offColor }}"\n								switch-animate="{{ animate }}"\n								switch-size="{{ size }}"\n								switch-label="{{ label }}"\n								switch-icon="{{ icon }}"\n								switch-radio-off="{{ radioOff }}"\n								switch-label-width="{{ labelWidth }}"\n								switch-handle-width="{{ handleWidth }}">\n							</div>\n							<!-- END FIDELITY -->\n\n							<!-- START TIMEOUT -->\n							<div class="form-group" data-ng-if="account.fidelity" data-ng-class="{\'has-error\': (forms.info.timeout.$touched || forms.info.$submitted) && forms.info.timeout.$invalid}">\n								<label class="control-label">{{\'APPLICATION_TIMEOUT\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="number" min="0" name="timeout" placeholder="{{\'APPLICATION_PORT\' | translate}}" class="form-control" data-ng-model="account.timeout" required/>\n								<span data-ng-show="(forms.info.timeout.$touched || forms.info.$submitted) && forms.info.timeout.$invalid && forms.info.timeout.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n								<span data-ng-show="(forms.info.timeout.$touched || forms.info.$submitted) && forms.info.timeout.$invalid && forms.info.timeout.$error.number" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_NUMERIC_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END TIMEOUT -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="account.description"/>\n							</div>\n							<!-- END DESCRIPTION -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END GENERAL TAB -->\n\n					<!-- IMAP TAB -->\n					<div class="tab-pane" id="tab_1_2">\n						<form name="forms.formIn" data-ng-submit="forms.formIn.$valid && updateItemMailServerIn()" novalidate>\n\n							<!-- START HOST -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formIn.host.$touched || forms.formIn.$submitted) && forms.formIn.host.$invalid}">\n								<label class="control-label">{{\'APPLICATION_HOST\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="host" placeholder="{{\'APPLICATION_HOST\' | translate}}" class="form-control" data-ng-model="account.MailServerIn.host" required/>\n								<span data-ng-show="(forms.formIn.host.$touched || forms.formIn.$submitted) && forms.formIn.host.$invalid && forms.formIn.host.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END HOST -->\n\n							<!-- START USERNAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formIn.username.$touched || forms.formIn.$submitted) && forms.formIn.username.$invalid}">\n								<label class="control-label">{{\'APPLICATION_USERNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="username" placeholder="{{\'APPLICATION_USERNAME\' | translate}}" class="form-control" data-ng-model="account.MailServerIn.username" required/>\n								<span data-ng-show="(forms.formIn.username.$touched || forms.formIn.$submitted) && forms.formIn.username.$invalid && forms.formIn.username.$error.required"  class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END USERNAME -->\n\n							<!-- START PASSWORD -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formIn.password.$touched || forms.formIn.$submitted) && forms.formIn.password.$invalid}">\n								<label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="password" name="password" placeholder="{{\'APPLICATION_PASSWORD\' | translate}}" class="form-control" data-ng-model="account.MailServerIn.password" required/>\n								<span data-ng-show="(forms.formIn.password.$touched || forms.formIn.$submitted) && forms.formIn.password.$invalid && forms.formIn.password.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END PASSWORD -->\n\n							<!-- START PORT -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formIn.port.$touched || forms.formIn.$submitted) && forms.formIn.port.$invalid}">\n								<label class="control-label">{{\'APPLICATION_PORT\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="number" name="port" placeholder="{{\'APPLICATION_PORT\' | translate}}" class="form-control" data-ng-model="account.MailServerIn.port" required/>\n								<span data-ng-show="(forms.formIn.port.$touched || forms.formIn.$submitted) && forms.formIn.port.$invalid && forms.formIn.port.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n								<span data-ng-show="(forms.formIn.port.$touched || forms.formIn.$submitted) && forms.formIn.port.$invalid && forms.formIn.port.$error.number" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_NUMERIC_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END PORT -->\n\n							<!-- START MAILBOX -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_MAILBOX\' | translate}}</label>\n								<input type="text" name="mailbox" placeholder="{{\'APPLICATION_MAILBOX\' | translate}}" class="form-control" data-ng-model="account.MailServerIn.mailbox"/>\n							</div>\n							<!-- END MAILBOX -->\n\n							<!-- START SEARCH FILTER -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_SEARCH_FILTER\' | translate}}</label>\n								<ui-select data-ng-model="account.MailServerIn.filter" name="filter" theme="bootstrap">\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected}}</ui-select-match>\n									<ui-select-choices repeat="filter in [\'UNSEEN\'] | filter: $select.search">\n										<div ng-bind-html="filter | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n							</div>\n							<!-- START SEARCH FILTER -->\n\n							<!-- START connTimeout -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.in.connTimeout.$touched || forms.in.$submitted) && forms.in.connTimeout.$invalid}">\n								<label class="control-label">{{\'APPLICATION_CONNECTION_TIMEOUT\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="number" name="connTimeout" placeholder="{{\'APPLICATION_CONNECTION_TIMEOUT\' | translate}}" class="form-control" data-ng-model="account.MailServerIn.connTimeout" required/>\n								<span data-ng-show="(forms.in.connTimeout.$touched || forms.in.$submitted) && forms.in.connTimeout.$invalid && forms.in.connTimeout.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n								<span data-ng-show="(forms.in.connTimeout.$touched || forms.in.$submitted) && forms.in.connTimeout.$invalid && forms.in.connTimeout.$error.number" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_NUMERIC_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END connTimeout -->\n\n							<!-- START authTimeout -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.in.authTimeout.$touched || forms.in.$submitted) && forms.in.authTimeout.$invalid}">\n								<label class="control-label">{{\'APPLICATION_AUTH_TIMEOUT\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="number" name="authTimeout" placeholder="{{\'APPLICATION_AUTH_TIMEOUT\' | translate}}" class="form-control" data-ng-model="account.MailServerIn.authTimeout" required/>\n								<span data-ng-show="(forms.in.authTimeout.$touched || forms.in.$submitted) && forms.in.authTimeout.$invalid && forms.in.authTimeout.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n								<span data-ng-show="(forms.in.authTimeout.$touched || forms.in.$submitted) && forms.in.authTimeout.$invalid && forms.in.authTimeout.$error.number" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_NUMERIC_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END authTimeout -->\n\n							<!-- START DELETE -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DELETE_MAIL_FROM_SERVER\' | translate}}</label><br>\n								<input\n								bs-switch\n								data-ng-model="account.MailServerIn.delete"\n								type="checkbox"\n								switch-active="{{ isActive }}"\n								switch-on-text="{{ \'APPLICATION_ENABLED\' | translate }}"\n								switch-off-text="{{ \'APPLICATION_DISABLED\' | translate }}"\n								switch-on-color="{{ onColor }}"\n								switch-off-color="{{ offColor }}"\n								switch-animate="{{ animate }}"\n								switch-size="{{ size }}"\n								switch-label="{{ label }}"\n								switch-icon="{{ icon }}"\n								switch-radio-off="{{ radioOff }}"\n								switch-label-width="{{ labelWidth }}"\n								switch-handle-width="{{ handleWidth }}">\n							</div>\n							<!-- END DELETE -->\n\n							<!-- START SSL -->\n							<div class="form-group">\n								<label class="control-label">SSL</label><br>\n								<input\n								bs-switch\n								data-ng-model="account.MailServerIn.ssl"\n								type="checkbox"\n								switch-active="{{ isActive }}"\n								switch-on-text="{{ \'APPLICATION_ENABLED\' | translate }}"\n								switch-off-text="{{ \'APPLICATION_DISABLED\' | translate }}"\n								switch-on-color="{{ onColor }}"\n								switch-off-color="{{ offColor }}"\n								switch-animate="{{ animate }}"\n								switch-size="{{ size }}"\n								switch-label="{{ label }}"\n								switch-icon="{{ icon }}"\n								switch-radio-off="{{ radioOff }}"\n								switch-label-width="{{ labelWidth }}"\n								switch-handle-width="{{ handleWidth }}">\n							</div>\n							<!-- END SSL -->\n\n							<!-- START Keepalive -->\n							<div class="form-group">\n								<label class="control-label">Keepalive</label><br>\n								<input\n								bs-switch\n								data-ng-model="account.MailServerIn.keepalive"\n								type="checkbox"\n								switch-active="{{ isActive }}"\n								switch-on-text="{{ \'APPLICATION_ENABLED\' | translate }}"\n								switch-off-text="{{ \'APPLICATION_DISABLED\' | translate }}"\n								switch-on-color="{{ onColor }}"\n								switch-off-color="{{ offColor }}"\n								switch-animate="{{ animate }}"\n								switch-size="{{ size }}"\n								switch-label="{{ label }}"\n								switch-icon="{{ icon }}"\n								switch-radio-off="{{ radioOff }}"\n								switch-label-width="{{ labelWidth }}"\n								switch-handle-width="{{ handleWidth }}">\n							</div>\n							<!-- END Keepalive -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END IMAP TAB -->\n\n					<!-- SMTP TAB -->\n					<div class="tab-pane" id="tab_1_3">\n						<form name="forms.formOut" data-ng-submit="forms.formOut.$valid && updateItemMailServerOut()" novalidate>\n\n							<!-- START HOST -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formOut.host.$touched || forms.formOut.$submitted) && forms.formOut.host.$invalid}">\n								<label class="control-label">{{\'APPLICATION_HOST\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="host" placeholder="{{\'APPLICATION_HOST\' | translate}}" class="form-control" data-ng-model="account.MailServerOut.host" required/>\n								<span data-ng-show="(forms.formOut.host.$touched || forms.formOut.$submitted) && forms.formOut.host.$invalid && forms.formOut.host.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END HOST -->\n\n							<!-- START USERNAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formOut.username.$touched || forms.formOut.$submitted) && forms.formOut.username.$invalid}">\n								<label class="control-label">{{\'APPLICATION_USERNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="username" placeholder="{{\'APPLICATION_USERNAME\' | translate}}" class="form-control" data-ng-model="account.MailServerOut.username" required/>\n								<span data-ng-show="(forms.formOut.username.$touched || forms.formOut.$submitted) && forms.formOut.username.$invalid && forms.formOut.username.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END USERNAME -->\n\n							<!-- START PASSWORD -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formOut.password.$touched || forms.formOut.$submitted) && forms.formOut.password.$invalid}">\n								<label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="password" name="password" placeholder="{{\'APPLICATION_PASSWORD\' | translate}}" class="form-control" data-ng-model="account.MailServerOut.password" required/>\n								<span data-ng-show="(forms.formOut.password.$touched || forms.formOut.$submitted) && forms.formOut.password.$invalid && forms.formOut.password.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END PASSWORD -->\n\n							<!-- START PORT -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.formOut.port.$touched || forms.formOut.$submitted) && forms.formOut.port.$invalid}">\n								<label class="control-label">{{\'APPLICATION_PORT\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="number" name="port" placeholder="{{\'APPLICATION_PORT\' | translate}}" class="form-control" data-ng-model="account.MailServerOut.port" required/>\n								<span data-ng-show="(forms.formOut.form.$touched || forms.formOut.$submitted) && forms.formOut.port.$invalid && forms.formOut.port.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n								<span data-ng-show="(forms.formOut.form.$touched || forms.formOut.$submitted) && forms.formOut.port.$invalid && forms.formOut.port.$error.number" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_NUMERIC_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END PORT -->\n\n							<!-- START SSL -->\n							<div class="form-group">\n								<label class="control-label">SSL</label><br>\n								<input\n								bs-switch\n								data-ng-model="account.MailServerIn.ssl"\n								type="checkbox"\n								switch-active="{{ isActive }}"\n								switch-on-text="{{ \'APPLICATION_ENABLED\' | translate }}"\n								switch-off-text="{{ \'APPLICATION_DISABLED\' | translate }}"\n								switch-on-color="{{ onColor }}"\n								switch-off-color="{{ offColor }}"\n								switch-animate="{{ animate }}"\n								switch-size="{{ size }}"\n								switch-label="{{ label }}"\n								switch-icon="{{ icon }}"\n								switch-radio-off="{{ radioOff }}"\n								switch-label-width="{{ labelWidth }}"\n								switch-handle-width="{{ handleWidth }}">\n							</div>\n							<!-- END SSL -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n							<input class="btn blue-madison" type="button" value="Test" data-ng-click="test()"/>\n						</form>\n					</div>\n					<!-- END SMTP TAB -->\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),
-a.put("app/channels/mail/account/wizard/wizard.html",'\n<div class="row" data-ng-init="initWizard()">\n	<div class="col-md-12">\n		<!-- BEGIN PAGE HEADER-->\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-envelope"></i>\n					<a href="#">{{ \'APPLICATION_MAIL\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-notebook"></i>\n					<a href="/mail/accounts/list">{{ \'APPLICATION_ACCOUNTS\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n		<!-- END PAGE HEADER-->\n\n		<!-- BEGIN  PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-notebook font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_ACCOUNT\' | translate }} WIZARD</a> </span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<wizard on-finish="createItem()">\n					<wz-step title="{{\'APPLICATION_ACCOUNT_INFO\' | translate}}" canexit="formValidation(forms.info.$valid)">\n						<form name="forms.info" novalidate>\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n								<span data-ng-show="(forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$invalid && forms.info.name.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<!-- START ADDRESS -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.info.address.$touched || forms.info.$submitted) && forms.info.address.$invalid}">\n								<label class="control-label">{{\'APPLICATION_EMAIL_ADDRESS\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="address" placeholder="{{\'APPLICATION_ADDRESS\' | translate}}" class="form-control" data-ng-model="item.address" required/>\n								<span data-ng-show="(forms.info.address.$touched || forms.info.$submitted) && forms.info.address.$invalid && forms.info.address.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END ADDRESS -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"/>\n							</div>\n							<!-- END DESCRIPTION -->\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" data-ng-click="goNext()"/>\n						</form>\n					</wz-step>\n\n					<wz-step title="IMAP" canexit="formValidation(forms.in.$valid)">\n						<form name="forms.in" novalidate>\n							<!-- START HOST -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.in.host.$touched || forms.in.$submitted) && forms.in.host.$invalid}">\n								<label class="control-label">{{\'APPLICATION_INCOMING_MAIL_SERVER\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="host" placeholder="{{\'APPLICATION_HOST\' | translate}}" class="form-control" data-ng-model="item.MailServerIn.host" required/>\n								<span data-ng-show="(forms.in.host.$touched || forms.in.$submitted) && forms.in.host.$invalid && forms.in.host.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END HOST -->\n\n							<!-- START USERNAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.in.username.$touched || forms.in.$submitted) && forms.in.username.$invalid}">\n								<label class="control-label">{{\'APPLICATION_USERNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="username" placeholder="{{\'APPLICATION_USERNAME\' | translate}}" class="form-control" data-ng-model="item.MailServerIn.username" name="username" required/>\n								<span data-ng-show="(forms.in.username.$touched || forms.in.$submitted) && forms.in.username.$invalid && forms.in.username.$error.required"  class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END USERNAME -->\n\n							<!-- START PASSWORD -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.in.password.$touched || forms.in.$submitted) && forms.in.password.$invalid}">\n								<label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="password" name="password" placeholder="{{\'APPLICATION_PASSWORD\' | translate}}" class="form-control" data-ng-model="item.MailServerIn.password" required/>\n								<span data-ng-show="(forms.in.password.$touched || forms.in.$submitted) && forms.in.password.$invalid && forms.in.password.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END PASSWORD -->\n\n							<!-- START PORT -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.in.port.$touched || forms.in.$submitted) && forms.in.port.$invalid}">\n								<label class="control-label">{{\'APPLICATION_PORT\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="number" name="port" placeholder="{{\'APPLICATION_PORT\' | translate}}" class="form-control" data-ng-model="item.MailServerIn.port" required/>\n								<span data-ng-show="(forms.in.port.$touched || forms.in.$submitted) && forms.in.port.$invalid && forms.in.port.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n								<span data-ng-show="(forms.in.port.$touched || forms.in.$submitted) && forms.in.port.$invalid && forms.in.port.$error.number" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_NUMERIC_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END PORT -->\n\n							<!-- START MAILBOX -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_MAILBOX\' | translate}}</label>\n								<input type="text" name="mailbox" placeholder="{{\'APPLICATION_MAILBOX\' | translate}}" class="form-control" data-ng-model="item.MailServerIn.mailbox"/>\n							</div>\n							<!-- END MAILBOX -->\n\n							<!-- START SEARCH FILTER -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_SEARCH_FILTER\' | translate}}</label>\n								<ui-select data-ng-model="item.MailServerIn.filter" name="filter" theme="bootstrap">\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected}}</ui-select-match>\n									<ui-select-choices repeat="filter in [\'UNSEEN\'] | filter: $select.search">\n										<div data-ng-bind="filter | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n							</div>\n							<!-- START SEARCH FILTER -->\n\n							<!-- START connTimeout -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.in.connTimeout.$touched || forms.in.$submitted) && forms.in.connTimeout.$invalid}">\n								<label class="control-label">{{\'APPLICATION_CONNECTION_TIMEOUT\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="number" name="connTimeout" placeholder="{{\'APPLICATION_CONNECTION_TIMEOUT\' | translate}}" class="form-control" data-ng-model="item.MailServerIn.connTimeout" required/>\n								<span data-ng-show="(forms.in.connTimeout.$touched || forms.in.$submitted) && forms.in.connTimeout.$invalid && forms.in.connTimeout.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n								<span data-ng-show="(forms.in.connTimeout.$touched || forms.in.$submitted) && forms.in.connTimeout.$invalid && forms.in.connTimeout.$error.number" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_NUMERIC_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END connTimeout -->\n\n							<!-- START authTimeout -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.in.authTimeout.$touched || forms.in.$submitted) && forms.in.authTimeout.$invalid}">\n								<label class="control-label">{{\'APPLICATION_AUTH_TIMEOUT\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="number" name="authTimeout" placeholder="{{\'APPLICATION_AUTH_TIMEOUT\' | translate}}" class="form-control" data-ng-model="item.MailServerIn.authTimeout" required/>\n								<span data-ng-show="(forms.in.authTimeout.$touched || forms.in.$submitted) && forms.in.authTimeout.$invalid && forms.in.authTimeout.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n								<span data-ng-show="(forms.in.authTimeout.$touched || forms.in.$submitted) && forms.in.authTimeout.$invalid && forms.in.authTimeout.$error.number" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_NUMERIC_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END authTimeout -->\n\n							<!-- START DELETE -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DELETE_MAIL_FROM_SERVER\' | translate}}</label><br>\n								<input\n								bs-switch\n								data-ng-model="item.MailServerIn.delete"\n								type="checkbox"\n								switch-active="{{ isActive }}"\n								switch-on-text="{{ \'APPLICATION_ENABLED\' | translate }}"\n								switch-off-text="{{ \'APPLICATION_DISABLED\' | translate }}"\n								switch-on-color="{{ onColor }}"\n								switch-off-color="{{ offColor }}"\n								switch-animate="{{ animate }}"\n								switch-size="{{ size }}"\n								switch-label="{{ label }}"\n								switch-icon="{{ icon }}"\n								switch-radio-off="{{ radioOff }}"\n								switch-label-width="{{ labelWidth }}"\n								switch-handle-width="{{ handleWidth }}">\n							</div>\n							<!-- END DELETE -->\n\n							<!-- START SSL -->\n							<div class="form-group">\n								<label class="control-label">SSL</label><br>\n								<input\n								bs-switch\n								data-ng-model="item.MailServerIn.ssl"\n								type="checkbox"\n								switch-active="{{ isActive }}"\n								switch-on-text="{{ \'APPLICATION_ENABLED\' | translate }}"\n								switch-off-text="{{ \'APPLICATION_DISABLED\' | translate }}"\n								switch-on-color="{{ onColor }}"\n								switch-off-color="{{ offColor }}"\n								switch-animate="{{ animate }}"\n								switch-size="{{ size }}"\n								switch-label="{{ label }}"\n								switch-icon="{{ icon }}"\n								switch-radio-off="{{ radioOff }}"\n								switch-label-width="{{ labelWidth }}"\n								switch-handle-width="{{ handleWidth }}">\n							</div>\n							<!-- END SSL -->\n\n							<!-- START Keepalive -->\n							<div class="form-group">\n								<label class="control-label">Keepalive</label><br>\n								<input\n								bs-switch\n								data-ng-model="item.MailServerIn.keepalive"\n								type="checkbox"\n								switch-active="{{ isActive }}"\n								switch-on-text="{{ \'APPLICATION_ENABLED\' | translate }}"\n								switch-off-text="{{ \'APPLICATION_DISABLED\' | translate }}"\n								switch-on-color="{{ onColor }}"\n								switch-off-color="{{ offColor }}"\n								switch-animate="{{ animate }}"\n								switch-size="{{ size }}"\n								switch-label="{{ label }}"\n								switch-icon="{{ icon }}"\n								switch-radio-off="{{ radioOff }}"\n								switch-label-width="{{ labelWidth }}"\n								switch-handle-width="{{ handleWidth }}">\n							</div>\n							<!-- END Keepalive -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" ng-click="goNext()"/>\n						</form>\n					</wz-step>\n					<wz-step title="SMTP" canexit="formValidation(forms.out.$valid)">\n						<form name="forms.out" novalidate>\n							<!-- START HOST -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.out.host.$touched || forms.out.$submitted) && forms.out.host.$invalid}">\n								<label class="control-label">{{\'APPLICATION_OUTGOING_MAIL_SERVER\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="host" placeholder="{{\'APPLICATION_HOST\' | translate}}" class="form-control" data-ng-model="item.MailServerOut.host" required/>\n								<span data-ng-show="(forms.out.host.$touched || forms.out.$submitted) && forms.out.host.$invalid && forms.out.host.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END HOST -->\n\n							<!-- START USERNAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.out.username.$touched || forms.out.$submitted) && forms.out.username.$invalid}">\n								<label class="control-label">{{\'APPLICATION_USERNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="username" placeholder="{{\'APPLICATION_USERNAME\' | translate}}" class="form-control" data-ng-model="item.MailServerOut.username" required/>\n								<span data-ng-show="(forms.out.username.$touched || forms.out.$submitted) && forms.out.username.$invalid && forms.out.username.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END USERNAME -->\n\n							<!-- START PASSWORD -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.out.password.$touched || forms.out.$submitted) && forms.out.password.$invalid}">\n								<label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="password" name="password" placeholder="{{\'APPLICATION_PASSWORD\' | translate}}" class="form-control" data-ng-model="item.MailServerOut.password" required/>\n								<span data-ng-show="(forms.out.password.$touched || forms.out.$submitted) && forms.out.password.$invalid && forms.out.password.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END PASSWORD -->\n\n							<!-- START PORT -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.out.port.$touched || forms.out.$submitted) && forms.out.port.$invalid}">\n								<label class="control-label">{{\'APPLICATION_PORT\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="number" name="port" placeholder="{{\'APPLICATION_PORT\' | translate}}" class="form-control" data-ng-model="item.MailServerOut.port" required/>\n								<span data-ng-show="(out.$touched || forms.out.$submitted) && forms.out.port.$invalid && forms.out.port.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n								<span data-ng-show="(out.$touched || forms.out.$submitted) && forms.out.port.$invalid && forms.out.port.$error.number" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_NUMERIC_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END PORT -->\n\n							<!-- START SSL -->\n							<div class="form-group">\n								<label class="control-label">SSL</label><br>\n								<input\n								bs-switch\n								data-ng-model="item.MailServerIn.ssl"\n								type="checkbox"\n								switch-active="{{ isActive }}"\n								switch-on-text="{{ \'APPLICATION_ENABLED\' | translate }}"\n								switch-off-text="{{ \'APPLICATION_DISABLED\' | translate }}"\n								switch-on-color="{{ onColor }}"\n								switch-off-color="{{ offColor }}"\n								switch-animate="{{ animate }}"\n								switch-size="{{ size }}"\n								switch-label="{{ label }}"\n								switch-icon="{{ icon }}"\n								switch-radio-off="{{ radioOff }}"\n								switch-label-width="{{ labelWidth }}"\n								switch-handle-width="{{ handleWidth }}">\n							</div>\n							<!-- END SSL -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" ng-click="goNext()"/>\n							<input class="btn default" type="button" value="{{\'APPLICATION_BACK\' | translate}}" wz-previous/>\n						</form>\n					</wz-step>\n					<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n						<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n						<input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n					</wz-step>\n				</wizard>\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/mail/inbox/list/list.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-puzzle"></i>\n					<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-envelope"></i>\n					<a href="#">{{ \'APPLICATION_MAIL\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-note"></i>\n					<a href="#">{{ \'APPLICATION_INBOX\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n	</div>\n</div>\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-note font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_INBOX\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group">\n						<a class="btn btn-default" href="#" data-ng-click="gridOptions.getPage();">\n							<i class="icon-reload"></i>\n						</a>\n					</div>\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<a class="btn green-jungle" href="/channels/mail/inbox/view/compose">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_MESSAGE\' | translate }}\n						</a>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/mail/inbox/mail/mail.html",'<div class="message">\r\n  <div class="row">\r\n    <div class="col-md-6">\r\n      <span class="bold">From: </span>\r\n      <span>{{mailMessage.from}}</span>\r\n      <br>\r\n      <span class="bold">To: </span>\r\n      <span>{{mailMessage.to}} </span>\r\n      <br>\r\n      <span data-ng-if="mailMessage.cc.length" class="bold">Cc: </span>\r\n      <span data-ng-if="mailMessage.cc.length">{{mailMessage.cc}} </span>\r\n    </div>\r\n    <div class="col-md-6">\r\n      <span class="pull-right" data-ng-show="mailMessage.User">{{\'APPLICATION_SENT_BY\' | translate}}: <strong>{{mailMessage.User.fullname}}</strong></span>\r\n    </div>\r\n  </div>\r\n  <br>\r\n  <span class="todo-tasklist-date">\r\n    <span class="pull-right">\r\n      <a data-ng-click="(mailMessage.status == \'SENDING\' || mailMessage.status == \'FAILED\') && retry(mailMessage.id)" href="#" class="btn default btn-xs inactive-link" data-ng-class="{\'green-stripe\': mailMessage.status == \'SENT\' || mailMessage.status == \'RECEIVED\', \'blue-stripe\': mailMessage.status == \'SENDING\', \'red-stripe\': mailMessage.status == \'FAILED\'}"> {{mailMessage.status | uppercase}}\r\n        <i data-ng-class="{\'fa fa-check\': mailMessage.status == \'SENT\' || mailMessage.status == \'RECEIVED\', \'fa fa-warning\': mailMessage.status == \'SENDING\', \'fa fa-times\': mailMessage.status == \'FAILED\'}"></i>\r\n      </a>\r\n    </span>\r\n    <i class="icon-calendar"></i> <span am-time-ago="mailMessage.updatedAt"></span>\r\n  </span>\r\n  <hr>\r\n  <span class="body text-left" data-ng-bind-html="mailMessage.text" style="white-space: pre-wrap;"></span>\r\n  <hr data-ng-if="mailMessage.MailAttachments.length">\r\n  <div data-ng-repeat="mailAttachment in mailMessage.MailAttachments">\r\n    <strong>{{mailAttachment.name}}</strong>\r\n    <span>\r\n      {{mailAttachment.size}}B </span>\r\n      <a target="_self" download="{{mailAttachment.name}}" href="api/mail/attachments/{{mailAttachment.id}}">\r\n        {{ \'APPLICATION_DOWNLOAD\' | translate }}\r\n      </a>\r\n    </div>\r\n  </div>\r\n'),a.put("app/channels/mail/inbox/note/note.html",'<div class="note">\r\n  <div class="row">\r\n    <div class="col-md-6">\r\n      <i class="icon-calendar"></i> <span am-time-ago="mailMessage.updatedAt"></span>\r\n    </div>\r\n    <div class="col-md-6">\r\n      <span class="pull-right" data-ng-show="mailMessage.User">{{\'APPLICATION_ADD_BY\' | translate}}: <strong>{{mailMessage.User.fullname}}</strong></span>\r\n    </div>\r\n  </div>\r\n  <hr>\r\n  <span class="body text-left" data-ng-bind-html="mailMessage.text" style="white-space: pre-wrap;"></span>\r\n  <hr data-ng-if="mailMessage.MailAttachments.length">\r\n  <div data-ng-repeat="mailAttachment in mailMessage.MailAttachments">\r\n    <strong>{{mailAttachment.name}}</strong>\r\n    <span>\r\n      {{mailAttachment.size}}B </span>\r\n      <a target="_self" download="{{mailAttachment.name}}" href="api/mail/attachments/{{mailAttachment.id}}">\r\n        {{ \'APPLICATION_DOWNLOAD\' | translate }}\r\n      </a>\r\n    </div>\r\n  </div>\r\n'),a.put("app/channels/mail/inbox/view/view.agents.modal.html",'<div class="modal-header" data-ng-init="initModal()">\n  <h3 class="modal-title">{{ \'APPLICATION_AGENTS\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <!-- START TRANSPORT -->\n  <div class="form-group">\n    <form name="form" novalidate>\n      <!-- START TRANSPORT -->\n      <div class="form-group">\n        <ui-select multiple name="agents" data-ng-model="item.agents" theme="bootstrap">\n          <ui-select-match placeholder="{{\'APPLICATION_AGENTS\' | translate}}">{{$item.fullname}}</ui-select-match>\n          <ui-select-choices repeat="agent.id as agent in agents | filter: $select.search">\n            {{agent.fullname}}\n          </ui-select-choices>\n        </ui-select>\n      </div>\n      <!-- END TRANSPORT -->\n    </form>\n  </div>\n  <!-- END TRANSPORT -->\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" data-ng-click="ok()">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" data-ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/channels/mail/inbox/view/view.html",'<div class="row">\r\n  <div class="col-md-12">\r\n    <div class="page-bar">\r\n      <ul class="page-breadcrumb">\r\n        <li>\r\n          <i class="icon-rocket"></i>\r\n          <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\r\n          <i class="fa fa-angle-right"></i>\r\n        </li>\r\n        <li>\r\n          <i class="icon-puzzle"></i>\r\n          <a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\r\n          <i class="fa fa-angle-right"></i>\r\n        </li>\r\n        <li>\r\n          <i class="icon-envelope"></i>\r\n          <a href="#">{{ \'APPLICATION_MAIL\' | translate }}</a>\r\n          <i class="fa fa-angle-right"></i>\r\n        </li>\r\n        <li>\r\n					<i class="icon-note"></i>\r\n					<a href="/channels/mail/inbox/list">{{ \'APPLICATION_INBOX\' | translate }}</a>\r\n				</li>\r\n      </ul>\r\n    </div>\r\n  </div>\r\n</div>\r\n\r\n<!-- BEGIN PAGE CONTENT-->\r\n<div class="row">\r\n	<div class="col-md-12">\r\n    <div ui-view></div>\r\n	</div>\r\n</div>\r\n<!-- END PAGE CONTENT-->\r\n'),a.put("app/channels/mail/inbox/view/view.notes.modal.html",'<div class="modal-header" data-ng-init="initModal()">\n  <h3 class="modal-title">{{ \'APPLICATION_NOTES\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n    <div class="form-group">\n      <textarea data-ng-model="item.text" name="text" rows="10" style="resize: none; width: 100%;"></textarea>\n    </div>\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" data-ng-click="ok()">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" data-ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/channels/mail/inbox/view/view.room.html",'<!-- BEGIN TODO CONTENT -->\n<div class="todo-content" data-ng-init="initRoom()">\n	<div class="portlet light">\n		<div class="portlet-title">\n			<div class="caption" data-ng-show="mailRoom">\n				<i class="icon-bar-chart font-green-sharp hide"></i>\n				<span class="label label-sm label-default">{{mailRoom.status}}</span> - <span class="caption-subject font-green-sharp bold uppercase">{{mailRoom.subject}}</span>\n			</div>\n			<div class="actions" data-ng-switch="mailRoom.status">\n				<div class="btn-group btn-group-solid" data-ng-show="mailRoom">\n					<button type="button" class="btn yellow" data-ng-click="loadNote()" uib-popover="{{\'APPLICATION_ADD_NOTE\' | translate}}" popover-trigger="mouseenter">N</button>\n				</div>\n				<div class="btn-group btn-group-solid" data-ng-show="mailRoom">\n					<button type="button" class="btn blue" data-ng-click="loadAgents()" uib-popover="{{\'APPLICATION_ASSING_AGENTS\' | translate}}" popover-trigger="mouseenter">A</button>\n				</div>\n				<div class="btn-group btn-group-solid">\n					<button type="button" class="btn red" data-ng-click="loadTemplate()" uib-popover="{{\'APPLICATION_LOAD_TEMPLATES\' | translate}}" popover-trigger="mouseenter">T</button>\n				</div>\n				<div class="btn-group btn-group-solid">\n					<button type="button" class="btn green" data-ng-switch-when="NEW" data-ng-click="updateStatus(\'CLOSED\')" uib-popover="{{\'APPLICATION_CLOSE\' | translate}}" popover-trigger="mouseenter">S</button>\n					<button type="button" class="btn green" data-ng-switch-when="OPEN" data-ng-click="updateStatus(\'CLOSED\')" uib-popover="{{\'APPLICATION_CLOSE\' | translate}}" popover-trigger="mouseenter">S</button>\n					<button type="button" class="btn green" data-ng-switch-when="CLOSED" data-ng-click="updateStatus(\'OPEN\')" uib-popover="{{\'APPLICATION_OPEN\' | translate}}" popover-trigger="mouseenter">O</button>\n				</div>\n			</div>\n		</div>\n		<div class="portlet-body">\n			<div class="row">\n				<div data-ng-show="mailRoom" data-ng-class="{\'col-md-6 col-sm-6\': mailRoom}">\n					<div ng-scrollbars ng-scrollbars-config="config">\n						<ul class="chats">\n							<li data-ng-switch="mailMessage.status" data-ng-class="{\'in\': mailMessage.status == \'RECEIVED\', \'out\': mailMessage.status == \'SENT\' || mailMessage.status == \'SENDING\' || mailMessage.status == \'FAILED\' || mailMessage.status == \'NOTE\'}" data-ng-repeat="mailMessage in mailRoom.MailMessages | orderBy:\'-createdAt\'">\n								<img class="avatar" alt="" data-ng-src="api/users/avatar/{{getCurrentUser().userpic && mailMessage.status === \'SENT\' ? getCurrentUser().userpic : \'unknown_avatar\'}}">\n								<note message="mailMessage" ng-switch-when="NOTE"></note>\n								<mail message="mailMessage" ng-switch-default></mail>\n							</li>\n						</ul>\n					</div>\n				</div>\n				<div data-ng-class="{\'col-md-6 col-sm-6\': mailRoom, \'col-md-12 col-sm-12\': !mailRoom}">\n					<form name="forms.compose" data-ng-submit="forms.compose.$valid && sendMail()" class="form-horizontal" novalidate>\n						<!-- START HEAD -->\n						<div class="form">\n							<!-- START FROM -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.compose.from.$invalid && forms.compose.$submitted}">\n								<div class="col-md-12">\n									<div class="row">\n										<div class="col-md-1">\n											<label class="control-label">From:</label>\n										</div>\n										<div class="col-md-11">\n											<ui-select data-ng-model="form.from[0]" theme="bootstrap" name="from" required>\n												<ui-select-match placeholder="From...">{{$select.selected.name}}</ui-select-match>\n												<ui-select-choices repeat="mailAccount.address as mailAccount in mailAccounts | filter: $select.search">\n													<div data-ng-bind-html="mailAccount.name | highlight: $select.search"></div>\n													<small data-ng-bind-html="mailAccount.address | highlight: $select.search"></small>\n												</ui-select-choices>\n											</ui-select>\n											<span data-ng-show="forms.compose.from.$invalid && forms.compose.$submitted" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n									</div>\n								</div>\n							</div>\n							<!-- END FROM -->\n\n							<!-- MAIL TO -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.compose.to.$invalid && forms.compose.$submitted}">\n								<div class="col-md-12">\n									<div class="row">\n										<div class="col-md-1">\n											<label class="control-label">To:</label>\n										</div>\n										<div class="col-md-11">\n											<ui-select tagging tagging-label multiple data-ng-model="form.sto" theme="bootstrap" name="to">\n												<ui-select-match placeholder="To...">{{$item}}</ui-select-match>\n												<ui-select-choices repeat="to in form.to | filter:$select.search">\n													{{to}}\n												</ui-select-choices>\n											</ui-select>\n											<span data-ng-show="forms.compose.to.$invalid && forms.compose.$submitted" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n									</div>\n								</div>\n							</div>\n							<!-- END TO -->\n\n							<!-- START CC -->\n							<div class="form-group">\n								<div class="col-md-12">\n									<div class="row">\n										<div class="col-md-1">\n											<label class="control-label">Cc:</label>\n										</div>\n										<div class="col-md-11">\n											<ui-select tagging tagging-label="" multiple data-ng-model="form.scc" theme="bootstrap" name="cc" ng-disabled="disabled">\n												<ui-select-match placeholder="Cc...">{{$item}}</ui-select-match>\n												<ui-select-choices repeat="cc in form.cc">\n													{{cc}}\n												</ui-select-choices>\n											</ui-select>\n										</div>\n									</div>\n								</div>\n							</div>\n							<!-- END CC -->\n\n							<!-- START SUBJECT -->\n							<div data-ng-hide="mailRoom" class="form-group" data-ng-class="{\'has-error\': forms.compose.subject.$invalid && forms.compose.$submitted}">\n								<div class="col-md-12">\n									<div class="row">\n										<div class="col-md-1">\n											<label class="control-label">Subject:</label>\n										</div>\n										<div class="col-md-11">\n											<input type="text" name="subject" class="form-control todo-taskbody-taskdesc" placeholder="Subject..." rows="8" data-ng-model="form.subject">\n											<span data-ng-show="forms.compose.subject.$invalid && forms.compose.$submitted" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n									</div>\n								</div>\n							</div>\n							<!-- END SUJBECT -->\n\n							<!-- START HTML -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.compose.text.$invalid && forms.compose.$submitted}">\n								<div class="col-md-12">\n									<div class="inbox-editor inbox-wysihtml5" text-angular data-ng-model="form.html" name="html"></div>\n									<span data-ng-show="forms.compose.text.$invalid && forms.compose.$submitted" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n							</div>\n							<!-- END HTML -->\n\n							<!-- START CANNED -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.compose.subject.$invalid && forms.compose.$submitted}">\n								<div class="col-md-12">\n									<input type="text"\n									data-ng-model="selectedAnswer"\n									placeholder="{{\'APPLICATION_CANNED_ANSWERS\' | translate | lowercase | capitalize}}.."\n									typeahead-on-select="onSelectAnswer($item)"\n									uib-typeahead="answer for answer in getAnswers($viewValue)"\n									typeahead-loading="loadingAnswers"\n									typeahead-no-results="noResults"\n									class="form-control">\n									<span data-ng-show="forms.compose.subject.$invalid && forms.compose.$submitted" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n							</div>\n							<!-- END CANNED -->\n\n							<!-- START ATTACH -->\n							<div class="form-group">\n								<div class="col-md-6">\n									<input type="file" nv-file-select="" uploader="uploader" multiple="">\n									<table class="table">\n										<tbody>\n											<tr ng-repeat="item in uploader.queue">\n												<td style="border-top:none"><strong>{{ item.file.name }}</strong></td>\n												<td style="border-top:none" ng-show="uploader.isHTML5" nowrap>{{ item.file.size/1024/1024|number:2 }} MB</td>\n												<td style="border-top:none" ng-show="uploader.isHTML5">\n													<div class="progress" style="margin-bottom: 0;">\n														<div class="progress-bar" role="progressbar" ng-style="{ \'width\': item.progress + \'%\' }"></div>\n													</div>\n												</td>\n												<td style="border-top-style:none" class="text-center">\n													<span ng-show="item.isSuccess"><i class="glyphicon glyphicon-ok"></i></span>\n													<span ng-show="item.isCancel"><i class="glyphicon glyphicon-ban-circle"></i></span>\n													<span ng-show="item.isError"><i class="glyphicon glyphicon-remove"></i></span>\n												</td>\n												<td style="border-top-style:none" nowrap>\n													<button type="button" class="btn btn-danger btn-xs" data-ng-click="item.remove()">\n														<span class="glyphicon glyphicon-trash"></span> {{\'APPLICATION_REMOVE\' | translate}}\n													</button>\n												</td>\n											</tr>\n										</tbody>\n									</table>\n									<div>\n									</div>\n								</div>\n								<div class="col-md-6">\n									<div class="form-actions right todo-form-actions" style="border-top: none;">\n										<input type="submit" value="{{ \'APPLICATION_SEND\' | translate }}" class="btn btn-sm green-meadow" data-ng-disabled="form.disabled || !form.html">\n										<input type="button" value="{{ \'APPLICATION_CANCEL\' | translate }}"class="btn btn-sm btn-default" data-ng-click="cancel()">\n									</div>\n								</div>\n							</div>\n							<!-- END ATTACH -->\n						</div>\n					</form>\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n<!-- END TODO CONTENT -->\n'),
-a.put("app/channels/mail/inbox/view/view.templates.modal.html",'<div class="modal-header" data-ng-init="initModal()">\n  <h3 class="modal-title">{{ \'APPLICATION_TEMPLATES\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <div class="note note-info" data-ng-show="!templates.length">\n    <h4 class="block">Info!</h4>\n    <p>\n      {{\'MESSAGE_NO_TEMPLATES_AVAILABLE\' | translate}}\n    </p>\n  </div>\n  <form name="form" data-ng-show="templates.length" novalidate>\n    <div class="form-group">\n      <ui-select data-ng-model="item.template" theme="bootstrap">\n        <ui-select-match placeholder="Select a template in the list or search his name...">{{$select.selected.name}}</ui-select-match>\n        <ui-select-choices repeat="template in templates | propsFilter: {name: $select.search}">\n          <div ng-bind-html="template.name | highlight: $select.search"></div>\n          <small data-ng-show="template.description">\n            {{\'APPLICATION_DESCRIPTION\' | translate}}: {{template.description}}\n          </small>\n        </ui-select-choices>\n      </ui-select>\n    </div>\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" data-ng-click="ok()" data-ng-show="templates.length">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" data-ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/channels/mail/queue/list/list.create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_QUEUE\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.general.name.$touched || form.general.$submitted) && form.general.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n      <span data-ng-show="(form.general.name.$touched || form.general.$submitted) && form.general.name.$invalid && form.general.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"/>\n    </div>\n    <!-- END DESCRIPTION -->\n\n    <!-- START TIMEOUT -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.general.timeout.$touched || form.general.$submitted) && form.general.timeout.$invalid}">\n      <label class="control-label">{{\'APPLICATION_AGENT_TIMEOUT\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="number" min="0" name="timeout" placeholder="Timeout" class="form-control" data-ng-model="item.timeout" required/>\n      <span data-ng-show="(form.general.timeout.$touched || form.general.$submitted) && form.general.timeout.$invalid && form.general.timeout.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END TIMEOUT -->\n\n    <!-- START STRATEGY -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.general.strategy.$touched || form.general.$submitted) && form.general.strategy.$invalid}">\n      <label class="control-label">{{\'APPLICATION_STRATEGY\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <ui-select data-ng-model="item.strategy" name="strategy" theme="bootstrap" required>\n        <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.toUpperCase()}}</ui-select-match>\n        <ui-select-choices repeat="strategy in [\'rrmemory\',\'beepall\'] | filter: $select.search">\n          <div ng-bind-html="strategy.toUpperCase() | highlight: $select.search"></div>\n        </ui-select-choices>\n      </ui-select>\n      <span data-ng-show="(form.general.strategy.$touched || form.general.$submitted) && form.general.strategy.$invalid && form.general.strategy.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END STRATEGY -->\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="save()" ng-disabled="form.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/channels/mail/queue/list/list.html",'<div class="row">\n	<div class="col-md-12">\n			<div class="page-bar">\n				<ul class="page-breadcrumb">\n					<li>\n						<i class="icon-rocket"></i>\n						<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-puzzle"></i>\n						<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-envelope"></i>\n						<a href="#">{{ \'APPLICATION_MAIL\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-docs"></i>\n						<a href="#">{{ \'APPLICATION_QUEUES\' | translate }}</a>\n					</li>\n				</ul>\n			</div>\n		</div>\n</div>\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-docs font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_QUEUES\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<a class="btn green-jungle" href="#" data-ng-click="createItem()">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_QUEUE\' | translate }}\n						</a>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n						<div class="watermark" ng-show="!gridOptions.data.length">{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/mail/queue/view/view.agents.html",'<div class="row" data-ng-init="getTeams()">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_AGENTS\' | translate}}</span>\n				</div>\n			</div>\n			<div class="note note-warning" data-ng-hide="teams.length">\n				<h4 class="block">Warning!</h4>\n				<p>\n					 {{ \'MESSAGE_NO_AVAILABLE_TEAMS\' | translate }}\n				</p>\n			</div>\n			<div class="portlet-body">\n				<!-- BEGIN FORM-->\n				<form action="index.html" class="form-horizontal form-row-seperated">\n					<div class="form-body">\n						<label for="penalty">{{\'APPLICATION_PENALTY\' | translate}}</label>\n						<div class="input-group input-small mbottom20">\n							<input type="number" class="spinner-input form-control" maxlength="3" data-ng-model="queue.penalty" readonly>\n							<div class="spinner-buttons input-group-btn btn-group-vertical">\n								<button type="button" class="btn spinner-up btn-xs blue" data-ng-click="queue.penalty=queue.penalty+1">\n									<i class="fa fa-angle-up"></i>\n								</button>\n								<button type="button" class="btn spinner-down btn-xs blue" data-ng-disabled="!queue.penalty" data-ng-click="queue.penalty=queue.penalty-1">\n									<i class="fa fa-angle-down"></i>\n								</button>\n							</div>\n						</div>\n						<div class="form-group last">\n							<div class="col-md-12" id="multi-select-team">\n							</div>\n						</div>\n					</div>\n				</form>\n				<!-- END FORM-->\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/channels/mail/queue/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getQueue()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-puzzle"></i>\n					<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-envelope"></i>\n					<a href="#">{{ \'APPLICATION_MAIL\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-docs"></i>\n					<a href="/channels/mail/queues/list">{{ \'APPLICATION_QUEUES\' | translate }}</a>\n					<i data-ng-show="queue" class="fa fa-angle-right"></i>\n				</li>\n				<li data-ng-show="queue">\n					<a href="#">{{queue.name}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET main.channels -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/queue.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{queue.name}}\n					</div>\n					<!-- <div class="profile-usertitle-job">\n					{{user.role}}\n				</div> -->\n			</div>\n			<!-- END SIDEBAR USER TITLE -->\n\n			<!-- SIDEBAR MENU -->\n			<div class="profile-usermenu">\n				<ul class="nav">\n					<li data-ng-class="{active: $state.is(\'main.channels.mail.queues.view.settings\')}">\n						<a data-ng-href="/channels/mail/queues/view/{{queue.id}}/settings">\n							<i class="icon-settings"></i>\n							{{ \'APPLICATION_SETTINGS\' | translate}} </a>\n						</li>\n						<li data-ng-class="{active: $state.is(\'main.channels.mail.queues.view.agents\')}">\n							<a data-ng-href="/channels/mail/queues/view/{{queue.id}}/agents">\n								<i class="icon-people"></i>\n								{{ \'APPLICATION_AGENTS\' | translate}} </a>\n							</li>\n						</ul>\n					</div>\n					<!-- END MENU -->\n				</div>\n				<!-- END PORTLET main.channels -->\n			</div>\n			<!-- END BEGIN PROFILE SIDEBAR -->\n			<!-- BEGIN PROFILE CONTENT -->\n			<div ui-view class="profile-content">\n			</div>\n			<!-- END PROFILE CONTENT -->\n		</div>\n	</div>\n	<!-- END PAGE CONTENT-->\n'),a.put("app/channels/mail/queue/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_SETTINGS\' | translate}}</span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<form name="forms.general" data-ng-submit="forms.general.$valid && updateMailQueue()" novalidate>\n					<!-- START NAME -->\n					<div class="form-group" data-ng-class="{\'has-error\': (forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid}">\n						<label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n						<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="queue.name" required/>\n						<span data-ng-show="(forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid && forms.general.name.$error.required" class="help-block help-block-error">\n							<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n						</span>\n					</div>\n					<!-- END NAME -->\n\n					<!-- START DESCRIPTION -->\n					<div class="form-group">\n						<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n						<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="queue.description"/>\n					</div>\n					<!-- END DESCRIPTION -->\n\n					<!-- START TIMEOUT -->\n					<div class="form-group">\n						<label class="control-label">Agent Timeout</label>\n						<input type="number" name="timeout" placeholder="Timeout" class="form-control" min="1" data-ng-model="queue.timeout"/>\n					</div>\n					<!-- END TIMEOUT -->\n\n					<!-- START HEADER SHAPE -->\n					<div class="form-group" data-ng-class="{\'has-error\': (forms.general.strategy.$touched || forms.general.$submitted) && forms.general.strategy.$invalid}">\n						<label class="control-label">{{\'APPLICATION_STRATEGY\' | translate}}</label>\n						<ui-select data-ng-model="queue.strategy" name="strategy" theme="bootstrap">\n							<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.toUpperCase()}}</ui-select-match>\n							<ui-select-choices repeat="strategy in [\'rrmemory\',\'beepall\'] | filter: $select.search">\n								<div ng-bind-html="strategy.toUpperCase() | highlight: $select.search"></div>\n							</ui-select-choices>\n						</ui-select>\n					</div>\n					<!-- END HEADER SHAPE -->\n					<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n				</form>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/channels/mail/realtime/view/agent/agent.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initAgents()">\n	<div class="col-md-12">\n		<!-- START TABLE -->\n		<div ui-grid="gridOptions"  ui-grid-resize-columns  class="ui-grid" ui-grid-tree-view ui-grid-expandable-row ui-grid-pagination auto-resize>\n			<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n		</div>\n		<!-- END TABLE -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/mail/realtime/view/agent/agent.modal.info.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_INTERFACE_INFO\' | translate }}</h3>\n</div>\n<div class="modal-body">\n<div data-ng-if="agent.ipaddr" class="well">\n  <div>{{agent.ipaddr}}:{{agent.port}}</div>\n  <div>{{agent.fullcontact}}</div>\n  <div>{{agent.useragent}}</div>\n  <div>{{agent.lastms}}</div>\n</div>\n<div data-ng-if="!agent.ipaddr" class="alert alert-danger" role="alert">\n  {{\'MESSAGE_NO_AVAILABLE_INFO\' | translate}}\n</div>\n</div>\n<div class="modal-footer">\n  <button class="btn default" type="button" ng-click="close()">{{ \'APPLICATION_CLOSE\' | translate }}</button>\n</div>\n'),a.put("app/channels/mail/realtime/view/agent/queue.modal.add.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_JOIN_QUEUE\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n\n    <div class="form-group row">\n  <label class="col-md-2 control-label" style="margin-top: 7px;">{{\'APPLICATION_QUEUE\' | translate}}:</label>\n  <div class="col-md-10">\n    <ui-select multiple ng-model="item.queues" theme="bootstrap" required>\n      <ui-select-match placeholder="{{\'APPLICATION_QUEUE\' | translate}}">{{$item.name}}</ui-select-match>\n      <ui-select-choices repeat="queue.id as queue in queues | filter: $select.search">\n        <div ng-bind-html="queue.name | highlight: $select.search"></div>\n      </ui-select-choices>\n    </ui-select>\n  </div>\n</div>\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="save()" ng-disabled="form.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/channels/mail/realtime/view/queue/queue.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initQueues()">\n	<div class="col-md-12">\n		<!-- START TABLE -->\n		<div ui-grid="gridOptions"  ui-grid-resize-columns class="ui-grid" ui-grid-tree-view auto-resize>\n			<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n		</div>\n		<!-- END TABLE -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/mail/realtime/view/session/session.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initSessions()">\n	<div class="col-md-12">\n		<!-- START TABLE -->\n		<div ui-grid="gridOptions"  ui-grid-resize-columns class="ui-grid" auto-resize>\n			<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n		</div>\n		<!-- END TABLE -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/mail/realtime/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-directions"></i>\n					<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-envelope"></i>\n					<a href="#">{{ \'APPLICATION_MAIL\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-energy"></i>\n					<a href="#">{{ \'APPLICATION_REALTIME\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<div>\n			<nav class="navbar navbar-default" role="navigation">\n				<div class="collapse navbar-collapse">\n					<ul class="nav navbar-nav">\n						<li data-ng-class="{\'active\': $state.is(\'channels.mail.realtime.view.agents\')}">\n							<a href="/channels/mail/realtime/view/agents">\n								{{\'APPLICATION_AGENTS\' | translate}}\n							</a>\n						</li>\n					</ul>\n				</div>\n			</nav>\n		</div>\n\n		<div ui-view></div>\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/mail/realtime/view/view.queue.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initAgents()">\n	<div class="col-md-12">\n		<!-- START TABLE -->\n		<div id="grid1" ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-tree-view class="grid">\n			<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n		</div>\n		<!-- END TABLE -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/voice/chanspy/list/list.create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_CHANSPY\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.name.$touched || form.$submitted) && form.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n      <span data-ng-show="(form.name.$touched || form.$submitted) && form.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n    <!-- START PREFIX -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.prefix.$touched || form.$submitted) && form.prefix.$invalid}">\n      <label class="control-label">{{\'APPLICATION_PREFIX\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="prefix" placeholder="{{\'APPLICATION_PREFIX\' | translate}}" class="form-control" data-ng-model="item.prefix" required/>\n      <span data-ng-show="(form.prefix.$touched || form.$submitted) && form.prefix.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END PREFIX -->\n\n    <!-- START OPTIONS -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.options.$touched || form.$submitted) && form.options.$invalid}">\n      <label class="control-label">{{\'APPLICATION_OPTIONS\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <ui-select multiple data-ng-model="item.options" name="options" theme="bootstrap" ui-required="true">\n        <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$item.value}}: {{$item.name | translate}}</ui-select-match>\n        <ui-select-choices repeat="option.value as option in options | filter: $select.search">\n          <div ng-bind-html="option.value + \': \' + (option.name | translate) | highlight: $select.search"></div>\n        </ui-select-choices>\n      </ui-select>\n      <span data-ng-show="(form.options.$touched || form.$submitted) && form.options.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END OPTIONS -->\n\n    <!-- START AUTH -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_AUTH\' | translate}}</label></br>\n      <input\n      bs-switch\n      class="form-control"\n      ng-model="item.auth"\n      type="checkbox"\n      name="auth"\n      data-ng-init="item.auth = 0"\n      switch-active="{{ recordSwitch.isActive }}"\n      switch-on-text="{{ recordSwitch.onText }}"\n      switch-off-text="{{ recordSwitch.offText }}"\n      switch-on-color="{{ recordSwitch.onColor }}"\n      switch-off-color="{{ recordSwitch.offColor }}"\n      switch-animate="{{ recordSwitch.animate }}"\n      switch-size="{{ recordSwitch.size }}"\n      switch-label="{{ recordSwitch.label }}"\n      switch-icon="{{ recordSwitch.icon }}"\n      switch-radio-off="{{ recordSwitch.radioOff }}"\n      switch-label-width="{{ recordSwitch.labelWidth }}"\n      switch-handle-width="{{ recordSwitch.handleWidth }}">\n    </div>\n    <!-- END AUTH -->\n\n    <!-- START PASSWORD -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.password.$touched || form.$submitted) && form.password.$invalid}">\n      <label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}}<span data-ng-show="item.auth" class="required" aria-required="true">*</span></label>\n      <input type="password" name="password" placeholder="{{\'APPLICATION_PASSWORD\' | translate}}" class="form-control" data-ng-model="item.password" data-ng-disabled="!item.auth" data-ng-required="item.auth"/>\n      <span data-ng-show="(form.password.$touched || form.$submitted) && form.password.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END PASSWORD -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n    </div>\n    <!-- END DESCRIPTION -->\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="save()" ng-disabled="form.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/channels/voice/chanspy/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-wrench"></i>\n					<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-eye"></i>\n					<a href="/channels/voice/chanspys/list">{{ \'APPLICATION_CHANSPY\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-docs font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_CHANSPY\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<button class="btn green-jungle " ng-click="createItem()">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_CHANSPY\' | translate }}\n						</button>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/voice/chanspy/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getChanSpy()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-wrench"></i>\n					<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-eye"></i>\n					<a href="/channels/voice/chanspys/list">{{ \'APPLICATION_CHANSPY\' | translate }}</a>\n					<i data-ng-show="chanspy" class="fa fa-angle-right"></i>\n				</li>\n				<li data-ng-show="chanspy">\n					<a href="#">{{chanspy.name}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/chanspy.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{chanspy.name}}\n					</div>\n					<!-- <div class="profile-usertitle-job">\n						{{user.role}}\n					</div> -->\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.tools.chanspy.view.settings\')}">\n							<a data-ng-href="/tools/chanspy/view/{{chanspy.id}}/settings">\n							<i class="icon-settings"></i>\n							{{ \'APPLICATION_SETTINGS\' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/voice/chanspy/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_CHANSPY\' | translate}} {{ \'APPLICATION_SETTINGS\' | translate}} </span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_GENERAL\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.general" data-ng-submit="forms.general.$valid && updateChanSpy()" novalidate>\n\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="chanspy.name" required/>\n								<span data-ng-show="(forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<!-- START PREFIX -->\n							<div class="form-group" data-ng-class="{\'has-error\': (form.general.prefix.$touched || form.general.$submitted) && form.general.prefix.$invalid}">\n								<label class="control-label">{{\'APPLICATION_PREFIX\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="prefix" placeholder="{{\'APPLICATION_PREFIX\' | translate}}" class="form-control" data-ng-model="chanspy.prefix" required/>\n								<span data-ng-show="(form.general.prefix.$touched || form.general.$submitted) && form.general.prefix.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END PREFIX -->\n\n							<!-- START OPTIONS -->\n							<div class="form-group" data-ng-class="{\'has-error\': (form.general.options.$touched || form.general.$submitted) && form.general.options.$invalid}">\n								<label class="control-label">{{\'APPLICATION_OPTIONS\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select multiple data-ng-model="chanspy.options" name="options" theme="bootstrap" ui-required="true">\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$item.value}}: {{$item.name | translate}}</ui-select-match>\n									<ui-select-choices repeat="option.value as option in options | filter: $select.search">\n										<div ng-bind-html="option.value + \': \' + (option.name | translate) | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span data-ng-show="(form.general.options.$touched || form.general.$submitted) && form.general.options.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END OPTIONS -->\n\n							<!-- START AUTH -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_AUTH\' | translate}}</label></br>\n								<input\n								bs-switch\n								class="form-control"\n								ng-model="chanspy.auth"\n								type="checkbox"\n								name="auth"\n								switch-active="{{ recordSwitch.isActive }}"\n								switch-on-text="{{ recordSwitch.onText }}"\n								switch-off-text="{{ recordSwitch.offText }}"\n								switch-on-color="{{ recordSwitch.onColor }}"\n								switch-off-color="{{ recordSwitch.offColor }}"\n								switch-animate="{{ recordSwitch.animate }}"\n								switch-size="{{ recordSwitch.size }}"\n								switch-label="{{ recordSwitch.label }}"\n								switch-icon="{{ recordSwitch.icon }}"\n								switch-radio-off="{{ recordSwitch.radioOff }}"\n								switch-label-width="{{ recordSwitch.labelWidth }}"\n								switch-handle-width="{{ recordSwitch.handleWidth }}">\n							</div>\n							<!-- END AUTH -->\n\n							<!-- START PASSWORD -->\n							<div class="form-group" data-ng-class="{\'has-error\': (form.general.password.$touched || form.general.$submitted) && form.general.password.$invalid}">\n								<label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}}<span class="required" data-ng-show="chanspy.auth" aria-required="true">*</span></label>\n								<input type="password" name="password" placeholder="{{\'APPLICATION_PASSWORD\' | translate}}" class="form-control" data-ng-model="chanspy.password" data-ng-disabled="!chanspy.auth" data-ng-required="chanspy.auth"/>\n								<span data-ng-show="(form.general.password.$touched || form.general.$submitted) && form.general.password.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END PASSWORD -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="chanspy.description"></textarea>\n							</div>\n							<!-- END DESCRIPTION -->\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END ADVANCED TAB -->\n\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),
-a.put("app/channels/voice/context/list/create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_CONTEXT\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.name.$touched || form.$submitted) && form.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n      <span data-ng-show="(form.name.$touched || form.$submitted) && form.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"/></textarea>\n    </div>\n    <!-- END DESCRIPTION -->\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" data-ng-click="ok()" data-ng-disabled="form.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" data-ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/channels/voice/context/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-puzzle"></i>\n					<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-docs"></i>\n					<a href="#">{{ \'APPLICATION_CONTEXTS\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-docs font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_CONTEXTS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<a class="btn green-jungle" href="#" data-ng-click="createItem()">\n						<i class="icon-plus"></i> {{ \'APPLICATION_NEW_CONTEXT\' | translate }}\n					</a>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/voice/context/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getContext()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-puzzle"></i>\n					<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-docs"></i>\n					<a href="/channels/voice/contexts/list">{{ \'APPLICATION_CONTEXTS\' | translate }}</a>\n					<i data-ng-show="context" class="fa fa-angle-right"></i>\n				</li>\n				<li data-ng-show="context">\n					<a href="#">{{context.name}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET main.channels -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/context.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{context.name}}\n					</div>\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.channels.voice.contexts.view.settings\')}">\n							<a data-ng-href="/channels/voice/contexts/view/{{context.id}}/settings">\n								<i class="icon-settings"></i>\n								{{ \'APPLICATION_SETTINGS\' | translate}} </a>\n							</li>\n						</ul>\n					</div>\n					<!-- END MENU -->\n				</div>\n				<!-- END PORTLET main.channels -->\n			</div>\n			<!-- END BEGIN PROFILE SIDEBAR -->\n			<!-- BEGIN PROFILE CONTENT -->\n			<div ui-view class="profile-content">\n			</div>\n			<!-- END PROFILE CONTENT -->\n		</div>\n	</div>\n	<!-- END PAGE CONTENT-->\n'),a.put("app/channels/voice/context/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_CONTEXT\' | translate}} {{ \'APPLICATION_SETTINGS\' | translate}} </span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_GENERAL\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.general" data-ng-submit="forms.general.$valid && updateVoiceContext()" novalidate>\n\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (form.name.$touched || form.$submitted) && form.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="context.name" required readonly/>\n								<span class="help-block">\n									{{ \'DESCRIPTION_CANT_EDIT_NAME\' | translate }}\n								</span>\n								<span data-ng-show="(form.name.$touched || form.$submitted) && form.name.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="context.description"></textarea>\n							</div>\n							<!-- END DESCRIPTION -->\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END ADVANCED TAB -->\n\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/channels/voice/moh/list/create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_MOH_CLASS\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.name.$touched || form.$submitted) && form.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n      <span data-ng-show="(form.name.$touched || form.$submitted) && form.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n    </div>\n    <!-- END DESCRIPTION -->\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="ok()" ng-disabled="form.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/channels/voice/moh/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-puzzle"></i>\n					<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-music-tone"></i>\n					<a href="#">{{ \'APPLICATION_MOHS\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-music-tone font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_MOHS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<a class="btn green-jungle" href="#" data-ng-click="createItem()">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_MOH_CLASS\' | translate }}\n						</a>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/voice/moh/view/view.addFiles.html",'\n<div class="row" data-ng-init="getSounds()">\n	<div class="col-md-12">\n		<!-- BEGIN  PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-notebook font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_MOH\' | translate }} {{ \'APPLICATION_ADD_FILES\' | translate }}</a> </span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<div class="note note-warning" data-ng-hide="soundList.length">\n					<h4 class="block">Warning!</h4>\n					<p>\n						 {{ \'MESSAGE_NO_SOUNDS_AVAILABLE\' | translate }}\n					</p>\n					<p>\n						{{\'APPLICATION_GO_TO\' | translate}} <a href="/tools/sounds/list">{{\'APPLICATION_SOUNDS\' | translate}}</a>\n					</p>\n				</div>\n            <form name="forms.general" data-ng-submit="(item.sounds.length > 0) && addMohs()" data-ng-show="soundList.length" novalidate>\n\n              <!-- START SOUNDS -->\n              <div class="form-group" data-ng-class="{\'has-error\': (forms.general.sounds.$touched || forms.general.$submitted) && item.sounds.length == 0}">\n                <label class="control-label">{{\'APPLICATION_SOUNDS\' | translate}}<span class="required" aria-required="true">*</span></label>\n                <ui-select multiple data-ng-model="item.sounds" theme="bootstrap" name="sounds" required>\n                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$item.display_name}}</ui-select-match>\n                  <ui-select-choices repeat="sound.id as sound in soundList | filter: $select.search">\n                    {{sound.display_name}}\n                  </ui-select-choices>\n                </ui-select>\n                <span data-ng-show="(forms.general.sounds.$touched || forms.general.$submitted) && item.sounds.length == 0" class="help-block help-block-error">\n                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                </span>\n              </div>\n              <!-- END OPTIONS -->\n\n							<input type="submit" class="btn green-haze" value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n						</form>\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/voice/moh/view/view.audios.html",'<div ui-view class="profile-content">\n<div class="row" data-ng-init="getAudioFiles()">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title  tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_AUDIOS\' | translate}}</span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="audioFiles">\n						<a class="btn green-jungle " href="/channels/voice/mohs/view/{{moh.id}}/add" data-toggle="dropdown">\n							<i class="icon-plus"></i> {{ \'APPLICATION_ADD_FILES\' | translate }}\n						</a>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<div class="note note-warning" data-ng-hide="audioFiles">\n					<h4 class="block">Warning!</h4>\n					<p>\n						 {{ \'MESSAGE_FOLDER_DOES_NOT_EXIST\' | translate }}\n					</p>\n				</div>\n				<!-- START TABLE -->\n				<table class="table table-striped table-bordered table-hover" data-ng-show="audioFiles">\n					  <thead>\n						  <tr>\n						    <th>{{ \'APPLICATION_NAME\' | translate }}</th>\n								<th width="30%">{{ \'APPLICATION_PREVIEW\' | translate }}</th>\n								<th width="10%">{{ \'APPLICATION_ACTIONS\' | translate }}</th>\n						  </tr>\n					  </thead>\n					  <tbody data-ng-model="audioFiles">\n					    <tr data-ng-repeat="audiofile in audioFiles">\n								<td>{{audiofile}}</td>\n								<td>\n									<audio controls ng-src="{{getSecureSrc(audioSources[audiofile])}}" preload="none">\n				            Your browser does not support the audio tag.\n				          </audio></td>\n					      <td>\n					        <a class="btn default btn-xs red-stripe" data-ng-click="deleteItem(audiofile,audiofile)">\n										{{ \'APPLICATION_DELETE\' | translate }}\n					        </a>\n					      </td>\n					    </tr>\n							<tr data-ng-hide="audioFiles.length">\n								<td colspan="3" style="text-align:center;">\n									<i>{{ \'MESSAGE_NO_AUDIOFILES_AVAILABLE\' | translate }}</i>\n								</td>\n							</tr>\n					  </tbody>\n				</table>\n				<!-- END TABLE -->\n			</div>\n		</div>\n	</div>\n</div>\n</div>\n'),a.put("app/channels/voice/moh/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getMoh()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-puzzle"></i>\n					<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-music-tone"></i>\n					<a href="/channels/voice/mohs/list">{{ \'APPLICATION_MOH_CLASS\' | translate }}</a>\n					<i data-ng-show="moh" class="fa fa-angle-right"></i>\n				</li>\n				<li data-ng-show="moh">\n					<a href="#">{{moh.name}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET main.channels -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/moh.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{moh.name}}\n					</div>\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.channels.voice.mohs.view.settings\')}">\n							<a data-ng-href="/channels/voice/mohs/view/{{moh.id}}/settings">\n							<i class="icon-settings"></i>\n							{{ \'APPLICATION_SETTINGS\' | translate}} </a>\n						</li>\n						<li data-ng-class="{active: $state.is(\'main.channels.voice.mohs.view.audios\') || $state.is(\'main.channels.voice.mohs.view.add\')}">\n							<a data-ng-href="/channels/voice/mohs/view/{{moh.id}}/audios">\n							<i class="icon-list"></i>\n							{{ \'APPLICATION_AUDIOS\' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET main.channels -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/voice/moh/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_MOH_CLASS\' | translate}} {{ \'APPLICATION_SETTINGS\' | translate}} </span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_GENERAL\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n\n			<div class="portlet-body" data-ng-init="getContexts();">\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.general" data-ng-submit="forms.general.$valid && updateVoiceMoh()" novalidate>\n\n	            <!-- START PATH -->\n	            <div class="form-group" >\n	              <label class="control-label">{{\'APPLICATION_PATH\' | translate}}</label>\n	              <input type="text" name="path" class="form-control" data-ng-model="moh.directory" disabled/>\n	            </div>\n	            <!-- END PATH -->\n\n	            <!-- START SORT -->\n	            <div class="form-group" data-ng-class="{\'has-error\': (forms.general.sort.$touched || forms.general.$submitted) && forms.general.sort.$invalid}">\n	              <label class="control-label">{{\'APPLICATION_SORT\' | translate}}<span class="required" aria-required="true">*</span></label>\n	              <ui-select data-ng-model="moh.sort" theme="bootstrap" name="sort" required>\n	                <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$translate.instant($select.selected.name)}}</ui-select-match>\n	                <ui-select-choices repeat="sort.value as sort in sortOptions | filter: $select.search">\n	                  {{$translate.instant(sort.name)}}\n	                </ui-select-choices>\n	              </ui-select>\n	              <span data-ng-show="(forms.general.sort.$touched || forms.general.$submitted) && forms.general.sort.$error.required" class="help-block help-block-error">\n	                <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n	              </span>\n	            </div>\n	            <!-- END SORT -->\n\n	            <!-- START DESCRIPTION -->\n				      <div class="form-group" data-ng-class="{\'has-error\': forms.general.$submitted && forms.general.description.$invalid}">\n				        <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n				        <textarea type="text" name="description" class="form-control" data-ng-model="moh.description"/></textarea>\n								<span data-ng-show="forms.general.$submitted && forms.general.description.$invalid" class="help-block help-block-error">\n				          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n				        </span>\n				      </div>\n				      <!-- END DESCRIPTION -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END GENERAL TAB -->\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/channels/voice/queue/list/list.create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_QUEUE\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.queue.name.$touched || form.queue.$submitted) && form.queue.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" data-ng-pattern="settings.patternName" required />\n      <span data-ng-show="(form.queue.name.$touched || form.queue.$submitted) && form.queue.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n      <span data-ng-show="(form.queue.name.$touched || form.queue.$submitted) && form.queue.name.$error.pattern" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_INVALID_PATTERN_NAME\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n    <!-- START STRATEGY -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.queue.strategy.$touched || form.queue.$submitted) && form.queue.strategy.$invalid}">\n      <label class="control-label">{{\'APPLICATION_STRATEGY\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <ui-select data-ng-model="item.strategy" name="strategy" theme="bootstrap" required>\n        <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.toUpperCase()}}</ui-select-match>\n        <ui-select-choices repeat="strategy in [\'ringall\', \'leastrecent\', \'fewestcalls\', \'random\', \'rrmemory\', \'linear\', \'wrandom\', \'rrordered\'] | filter: $select.search">\n          <div ng-bind-html="strategy.toUpperCase() | highlight: $select.search"></div>\n        </ui-select-choices>\n      </ui-select>\n      <span class="help-block">\n        {{ \'DESCRIPTION_QUEUE_STRATEGY\' | translate }}\n      </span>\n      <span data-ng-show="(form.queue.strategy.$touched || form.queue.$submitted) && form.queue.strategy.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END STRATEGY -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n    </div>\n    <!-- END DESCRIPTION -->\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="save()" ng-disabled="form.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/channels/voice/queue/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-puzzle"></i>\n					<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-earphones-alt"></i>\n					<a href="#">{{ \'APPLICATION_VOICE\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-docs"></i>\n					<a href="#">{{ \'APPLICATION_QUEUES\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-docs font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_QUEUES\' | translate }}</span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<a class="btn green-jungle " href="#"  data-ng-click="createItem()">\n						<i class="icon-plus"></i> {{ \'APPLICATION_NEW_QUEUE\' | translate }}\n					</a>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/voice/queue/view/view.agents.html",'<div class="row" data-ng-init="getTeams()">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_AGENTS\' | translate}}</span>\n				</div>\n			</div>\n			<div class="note note-warning" data-ng-hide="teams.length">\n				<h4 class="block">Warning!</h4><p>{{ \'MESSAGE_NO_AVAILABLE_TEAMS\' | translate }}</p>\n			</div>\n			<div class="portlet-body">\n				<!-- BEGIN FORM-->\n				<form action="index.html" class="form-horizontal form-row-seperated">\n					<div class="form-body">\n						<label for="penalty">{{\'APPLICATION_PENALTY\' | translate}}</label>\n						<div class="input-group input-small mbottom20">\n							<input type="number" class="spinner-input form-control" maxlength="3" data-ng-model="queue.penalty" readonly>\n							<div class="spinner-buttons input-group-btn btn-group-vertical">\n								<button type="button" class="btn spinner-up btn-xs blue" data-ng-click="queue.penalty=queue.penalty+1">\n									<i class="fa fa-angle-up"></i>\n								</button>\n								<button type="button" class="btn spinner-down btn-xs blue" data-ng-disabled="!queue.penalty" data-ng-click="queue.penalty=queue.penalty-1">\n									<i class="fa fa-angle-down"></i>\n								</button>\n							</div>\n						</div>\n						<div class="form-group last">\n							<div class="col-md-12" id="multi-select-team">\n							</div>\n						</div>\n					</div>\n				</form>\n				<!-- END FORM-->\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/channels/voice/queue/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getQueue()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-puzzle"></i>\n					<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-earphones-alt"></i>\n					<a href="#">{{ \'APPLICATION_VOICE\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-docs"></i>\n					<a href="/channels/voice/queues/list">{{ \'APPLICATION_QUEUES\' | translate }}</a>\n					<i data-ng-show="queue" class="fa fa-angle-right"></i>\n				</li>\n				<li data-ng-show="queue">\n					<a href="#">{{queue.name}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET main.channels -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/queue.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{queue.name}}\n					</div>\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.channels.voice.queues.view.settings\')}">\n							<a data-ng-href="/channels/voice/queues/view/{{queue.name}}/settings"> <i class="icon-settings"></i> {{ \'APPLICATION_SETTINGS\' | translate}} </a>\n						</li>\n						<li data-ng-class="{active: $state.is(\'main.channels.voice.queues.view.agents\')}">\n							<a data-ng-href="/channels/voice/queues/view/{{queue.name}}/agents"><i class="icon-people"></i>{{ \'APPLICATION_AGENTS\' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET main.channels -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/voice/queue/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_QUEUE_SETTINGS\' | translate}}</span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_GENERAL\' | translate}}</a>\n					</li>\n					<li>\n						<a href="#" data-target="#tab_1_2" data-toggle="tab">{{ \'APPLICATION_PERIODIC_ANNOUNCE\' | translate}}</a>\n					</li>\n					<li>\n						<a href="#" data-target="#tab_1_3" data-toggle="tab">{{ \'APPLICATION_ADVANCED\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n\n			<div class="portlet-body" data-ng-init="getContexts();getMohs();getSounds();">\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.general" data-ng-submit="forms.general.$valid && updateVoiceQueue()" novalidate>\n							<div class="row">\n								<div class="col-md-6">\n							<!-- START STRATEGY -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.strategy.$touched || forms.general.$submitted) && forms.general.strategy.$invalid}">\n								<label class="control-label">{{\'APPLICATION_STRATEGY\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="queue.strategy" name="strategy" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.toUpperCase()}}</ui-select-match>\n									<ui-select-choices repeat="strategy in [\'ringall\', \'leastrecent\', \'fewestcalls\', \'random\', \'rrmemory\', \'linear\', \'wrandom\', \'rrordered\'] | filter: $select.search">\n										<div ng-bind-html="strategy.toUpperCase() | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_STRATEGY\' | translate }}\n								</span>\n								<span data-ng-show="(forms.general.strategy.$touched || forms.general.$submitted) && forms.general.strategy.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n				      <!-- END STRATEGY -->\n\n							<!-- START MOH -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.musiconhold.$touched || forms.general.$submitted) && forms.general.musiconhold.$invalid}">\n								<label class="control-label">{{\'APPLICATION_MOH\' | translate}}</label>\n								<ui-select data-ng-model="queue.musiconhold" name="musiconhold" theme="bootstrap">\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n									<ui-select-choices repeat="musiconhold.name as musiconhold in voiceMohs | filter: $select.search">\n										<div ng-bind-html="musiconhold.name | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_VOICE_MOH\' | translate }}\n								</span>\n								<span data-ng-show="(forms.general.musiconhold.$touched || forms.general.$submitted) && forms.general.musiconhold.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END MOH -->\n\n							<!-- START TIMEOUT -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.timeout.$touched || forms.general.$submitted) && forms.general.timeout.$invalid}">\n								<label class="control-label">{{\'APPLICATION_TIMEOUT\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="number" min="0" name="timeout" placeholder="{{\'APPLICATION_TIMEOUT\' | translate}}" class="form-control" data-ng-model="queue.timeout" required/>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_TIMEOUT\' | translate }}\n								</span>\n								<span data-ng-show="(forms.general.timeout.$touched || forms.general.$submitted) && forms.general.timeout.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END TIMEOUT -->\n\n							<!-- START MAXLEN -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.maxlen.$touched || forms.general.$submitted) && forms.general.maxlen.$invalid}">\n								<label class="control-label">{{\'APPLICATION_MAXLEN\' | translate}}</label>\n								<input type="number" min="0" name="maxlen" placeholder="{{\'APPLICATION_MAXLEN\' | translate}}" class="form-control" data-ng-model="queue.maxlen" required/>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_MAXLEN\' | translate }}\n								</span>\n								<span data-ng-show="(forms.general.maxlen.$touched || forms.general.$submitted) && forms.general.maxlen.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END MAXLEN -->\n\n							<!-- START RETRY -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.retry.$touched || forms.general.$submitted) && forms.general.retry.$invalid}">\n								<label class="control-label">{{\'APPLICATION_RETRY\' | translate}}</label>\n								<input type="number" min="0" name="retry" placeholder="{{\'APPLICATION_RETRY\' | translate}}" class="form-control" data-ng-model="queue.retry" required/>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_RETRY\' | translate }}\n								</span>\n								<span data-ng-show="(forms.general.retry.$touched || forms.general.$submitted) && forms.general.retry.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END RETRY -->\n\n						</div>\n						<div class="col-md-6">\n							<!-- START WRAPUPTIME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.wrapuptime.$touched || forms.general.$submitted) && forms.general.wrapuptime.$invalid}">\n								<label class="control-label">{{\'APPLICATION_WRAPUPTIME\' | translate}}</label>\n								<input type="number" min="0" name="wrapuptime" placeholder="{{\'APPLICATION_WRAPUPTIME\' | translate}}" class="form-control" data-ng-model="queue.wrapuptime" required/>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_WRAPUPTIME\' | translate }}\n								</span>\n								<span data-ng-show="(forms.general.wrapuptime.$touched || forms.general.$submitted) && forms.general.wrapuptime.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END WRAPUPTIME -->\n\n							<!-- START WEIGHT -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.weight.$touched || forms.general.$submitted) && forms.general.weight.$invalid}">\n								<label class="control-label">{{\'APPLICATION_WEIGHT\' | translate}}</label>\n								<input type="number" min="0" name="weight" placeholder="{{\'APPLICATION_WEIGHT\' | translate}}" class="form-control" data-ng-model="queue.weight" required/>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_WEIGHT\' | translate }}\n								</span>\n								<span data-ng-show="(forms.general.weight.$touched || forms.general.$submitted) && forms.general.weight.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END WEIGHT -->\n\n							<!-- START JOINEMPTY -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.joinempty.$touched || forms.general.$submitted) && forms.general.joinempty.$invalid}">\n								<label class="control-label">{{\'APPLICATION_JOINEMPTY\' | translate}}</label>\n								<ui-select multiple data-ng-model="queue.joinempty" name="joinempty" theme="bootstrap">\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$item}}</ui-select-match>\n									<ui-select-choices repeat="item in [\'yes\',\'no\',\'strict\',\'loose\',\'paused\',\'penalty\',\'inuse\',\'ringing\',\'unavailable\',\'invalid\',\'unknown\',\'wrapup\'] | filter: $select.search">\n										<div ng-bind-html="item | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_JOINEMPTY\' | translate }}\n								</span>\n								<span data-ng-show="(forms.general.joinempty.$touched || forms.general.$submitted) && forms.general.joinempty.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END JOINEMPTY -->\n\n							<!-- START LEAVEWHENEMPTY -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.leavewhenempty.$touched || forms.general.$submitted) && forms.general.leavewhenempty.$invalid}">\n								<label class="control-label">{{\'APPLICATION_LEAVEWHENEMPTY\' | translate}}</label>\n								<ui-select multiple data-ng-model="queue.leavewhenempty" name="leavewhenempty" theme="bootstrap">\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$item}}</ui-select-match>\n									<ui-select-choices repeat="item in [\'yes\',\'no\',\'strict\',\'loose\',\'paused\',\'penalty\',\'inuse\',\'ringing\',\'unavailable\',\'invalid\',\'unknown\',\'wrapup\'] | filter: $select.search">\n										<div ng-bind-html="item | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_LEAVEWHENEMPTY\' | translate }}\n								</span>\n								<span data-ng-show="(forms.general.leavewhenempty.$touched || forms.general.$submitted) && forms.general.leavewhenempty.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END LEAVEWHENEMPTY -->\n\n							<!-- START ANNOUNCE -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.announce.$touched || forms.general.$submitted) && forms.general.announce.$invalid}">\n								<label class="control-label">{{\'APPLICATION_ANNOUNCE\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="queue.announce" name="announce" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n									<ui-select-choices repeat="returnAnnouncePath(announce) as announce in sounds | filter: $select.search">\n										<div ng-bind-html="announce.display_name | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_ANNOUNCE\' | translate }}\n								</span>\n								<span data-ng-show="(forms.general.announce.$touched || forms.general.$submitted) && forms.general.announce.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END ANNOUNCE -->\n						</div>\n					</div>\n					<!-- START DESCRIPTION -->\n					<div class="form-group">\n						<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n						<textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="queue.description"></textarea>\n					</div>\n					<!-- END DESCRIPTION -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n\n					<div class="tab-pane" id="tab_1_2">\n						<form name="forms.announce" data-ng-submit="forms.announce.$valid && updateVoiceQueue()" novalidate>\n							<div class="row">\n								<div class="col-md-12">\n							<!-- START PERIODIC_ANNOUNCE -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.announce.periodic_announce.$touched || forms.announce.$submitted) && forms.announce.periodic_announce.$invalid}">\n								<label class="control-label">{{\'APPLICATION_PERIODIC_ANNOUNCE\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select multiple data-ng-model="queue.periodic_announce" name="periodic_announce" theme="bootstrap" required data-ng-disabled="!periodicAnnounces.length">\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$item.display_name}}</ui-select-match>\n									<ui-select-choices repeat="returnAnnouncePath(announce) as announce in periodicAnnounces | filter: $select.search">\n										<div ng-bind-html="announce.display_name | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<div class="note note-warning" data-ng-hide="periodicAnnounces.length">\n									<h4 class="block">Warning!</h4>\n									<p>\n										{{ \'MESSAGE_NO_SOUNDS_AVAILABLE\' | translate }}\n									</p>\n									<p>\n										{{\'APPLICATION_GO_TO\' | translate}} <a href="/tools/sounds/list">{{\'APPLICATION_SOUNDS\' | translate}}</a>\n									</p>\n								</div>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_PERIODIC_ANNOUNCE\' | translate }}\n								</span>\n								<span data-ng-show="(forms.announce.periodic_announce.$touched || forms.announce.$submitted) && forms.announce.periodic_announce.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END PERIODIC_ANNOUNCE -->\n						</div>\n					</div>\n							<div class="row">\n								<div class="col-md-6">\n							<p><h3>{{\'APPLICATION_SETTINGS\' | translate}}</h3></p>\n							<!-- START ANNOUNCE_FREQUENCY -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.announce.announce_frequency.$touched || forms.announce.$submitted) && forms.announce.announce_frequency.$invalid}">\n								<label class="control-label">{{\'APPLICATION_ANNOUNCE_FREQUENCY\' | translate}}</label>\n								<input type="number" min="0" name="announce_frequency" placeholder="{{\'APPLICATION_ANNOUNCE_FREQUENCY\' | translate}}" class="form-control" data-ng-model="queue.announce_frequency" required/>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_ANNOUNCE_FREQUENCY\' | translate }}\n								</span>\n								<span data-ng-show="(forms.announce.announce_frequency.$touched || forms.announce.$submitted) && forms.announce.announce_frequency.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END ANNOUNCE_FREQUENCY -->\n\n							<!-- START MIN_ANNOUNCE_FREQUENCY -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.announce.min_announce_frequency.$touched || forms.announce.$submitted) && forms.announce.min_announce_frequency.$invalid}">\n								<label class="control-label">{{\'APPLICATION_MIN_ANNOUNCE_FREQUENCY\' | translate}}</label>\n								<input type="number" min="0" name="min_announce_frequency" placeholder="{{\'APPLICATION_MIN_ANNOUNCE_FREQUENCY\' | translate}}" class="form-control" data-ng-model="queue.min_announce_frequency" required/>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_MIN_ANNOUNCE_FREQUENCY\' | translate }}\n								</span>\n								<span data-ng-show="(forms.announce.min_announce_frequency.$touched || forms.announce.$submitted) && forms.announce.min_announce_frequency.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END MIN_ANNOUNCE_FREQUENCY -->\n\n							<!-- START PERIODIC_ANNOUNCE_FREQUENCY -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.announce.periodic_announce_frequency.$touched || forms.announce.$submitted) && forms.announce.periodic_announce_frequency.$invalid}">\n								<label class="control-label">{{\'APPLICATION_PERIODIC_ANNOUNCE_FREQUENCY\' | translate}}</label>\n								<input type="number" min="0" name="periodic_announce_frequency" placeholder="{{\'APPLICATION_PERIODIC_ANNOUNCE_FREQUENCY\' | translate}}" class="form-control" data-ng-model="queue.periodic_announce_frequency"/>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_PERIODIC_ANNOUNCE_FREQUENCY\' | translate }}\n								</span>\n								<span data-ng-show="(forms.announce.periodic_announce_frequency.$touched || forms.announce.$submitted) && forms.announce.periodic_announce_frequency.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END PERIODIC_ANNOUNCE_FREQUENCY -->\n\n							<!-- START RANDOM_PERIODIC_ANNOUNCE -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.announce.random_periodic_announce.$touched || forms.announce.$submitted) && forms.announce.random_periodic_announce.$invalid}">\n								<label class="control-label">{{\'APPLICATION_RANDOM_PERIODIC_ANNOUNCE\' | translate}}</label>\n								<ui-select data-ng-model="queue.random_periodic_announce" name="random_periodic_announce" theme="bootstrap">\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n									<ui-select-choices repeat="item in [\'yes\',\'no\'] | filter: $select.search">\n										<div ng-bind-html="item | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_RANDOM_PERIODIC_ANNOUNCE\' | translate }}\n								</span>\n								<span data-ng-show="(forms.announce.random_periodic_announce.$touched || forms.announce.$submitted) && forms.announce.random_periodic_announce.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END RANDOM_PERIODIC_ANNOUNCE -->\n\n							<!-- START ANNOUNCE_HOLDTIME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.announce.announce_holdtime.$touched || forms.announce.$submitted) && forms.announce.announce_holdtime.$invalid}">\n								<label class="control-label">{{\'APPLICATION_ANNOUNCE_HOLDTIME\' | translate}}</label>\n								<ui-select data-ng-model="queue.announce_holdtime" name="announce_holdtime" theme="bootstrap">\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n									<ui-select-choices repeat="item in [\'yes\',\'no\',\'once\'] | filter: $select.search">\n										<div ng-bind-html="item | highlight: $select.search"></div>\n									</ui-select-choices>\n									</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_ANNOUNCE_HOLDTIME\' | translate }}\n								</span>\n								<span data-ng-show="(forms.announce.announce_holdtime.$touched || forms.announce.$submitted) && forms.announce.announce_holdtime.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END ANNOUNCE_HOLDTIME -->\n\n							<!-- START ANNOUNCE_POSITION -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.announce.announce_position.$touched || forms.announce.$submitted) && forms.announce.announce_position.$invalid}">\n								<label class="control-label">{{\'APPLICATION_ANNOUNCE_POSITION\' | translate}}</label>\n								<ui-select data-ng-model="queue.announce_position" name="announce_position" theme="bootstrap">\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n									<ui-select-choices repeat="item in [\'yes\',\'no\',\'limit\',\'more\'] | filter: $select.search">\n										<div ng-bind-html="item | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_ANNOUNCE_POSITION\' | translate }}\n								</span>\n								<span data-ng-show="(forms.announce.announce_position.$touched || forms.announce.$submitted) && forms.announce.announce_position.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END ANNOUNCE_POSITION -->\n\n							<!-- START ANNOUNCE_POSITION_LIMIT -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.announce.announce_position_limit.$touched || forms.announce.$submitted) && forms.announce.announce_position_limit.$invalid}">\n								<label class="control-label">{{\'APPLICATION_ANNOUNCE_POSITION_LIMIT\' | translate}}</label>\n								<input type="number" min="0" name="announce_position_limit" placeholder="{{\'APPLICATION_ANNOUNCE_POSITION_LIMIT\' | translate}}" class="form-control" data-ng-model="queue.announce_position_limit"/>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_ANNOUNCE_POSITION_LIMIT\' | translate }}\n								</span>\n								<span data-ng-show="(forms.announce.announce_position_limit.$touched || forms.announce.$submitted) && forms.announce.announce_position_limit.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END ANNOUNCE_POSITION_LIMIT -->\n\n							<!-- START REPORTHOLDTIME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.announce.reportholdtime.$touched || forms.announce.$submitted) && forms.announce.reportholdtime.$invalid}">\n								<label class="control-label">{{\'APPLICATION_REPORTHOLDTIME\' | translate}}</label>\n								<ui-select data-ng-model="queue.reportholdtime" name="reportholdtime" theme="bootstrap">\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n									<ui-select-choices repeat="item in [\'yes\',\'no\'] | filter: $select.search">\n										<div ng-bind-html="item | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_REPORTHOLDTIME\' | translate }}\n								</span>\n								<span data-ng-show="(forms.announce.reportholdtime.$touched || forms.announce.$submitted) && forms.announce.reportholdtime.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END REPORTHOLDTIME -->\n\n						</div>\n							<div class="col-md-6">\n								<p><h3>{{\'APPLICATION_SOUNDS\' | translate}}</h3></p>\n								<!-- START QUEUE_REPORTHOLD -->\n								<div class="form-group" data-ng-class="{\'has-error\': (forms.announce.queue_reporthold.$touched || forms.announce.$submitted) && forms.announce.queue_reporthold.$invalid}">\n									<label class="control-label">{{\'APPLICATION_QUEUE_REPORTHOLD\' | translate}}<span class="required" aria-required="true">*</span></label>\n									<ui-select data-ng-model="queue.queue_reporthold" name="queue_reporthold" theme="bootstrap" required>\n										<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n										<ui-select-choices repeat="returnAnnouncePath(announce) as announce in queueAnnounces | filter: $select.search">\n											<div ng-bind-html="announce.display_name | highlight: $select.search"></div>\n										</ui-select-choices>\n									</ui-select>\n									<span class="help-block">\n										{{ \'DESCRIPTION_QUEUE_REPORTHOLD\' | translate }}\n									</span>\n									<span data-ng-show="(forms.announce.queue_reporthold.$touched || forms.announce.$submitted) && forms.announce.queue_reporthold.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END QUEUE_REPORTHOLD -->\n\n								<!-- START QUEUE_YOUARENEXT -->\n								<div class="form-group" data-ng-class="{\'has-error\': (forms.announce.queue_youarenext.$touched || forms.announce.$submitted) && forms.announce.queue_youarenext.$invalid}">\n									<label class="control-label">{{\'APPLICATION_QUEUE_YOUARENEXT\' | translate}}<span class="required" aria-required="true">*</span></label>\n									<ui-select data-ng-model="queue.queue_youarenext" name="queue_youarenext" theme="bootstrap" required>\n										<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n										<ui-select-choices repeat="returnAnnouncePath(announce) as announce in queueAnnounces | filter: $select.search">\n											<div ng-bind-html="announce.display_name | highlight: $select.search"></div>\n										</ui-select-choices>\n									</ui-select>\n									<span class="help-block">\n										{{ \'DESCRIPTION_QUEUE_YOUARENEXT\' | translate }}\n									</span>\n									<span data-ng-show="(forms.announce.queue_youarenext.$touched || forms.announce.$submitted) && forms.announce.queue_youarenext.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END QUEUE_YOUARENEXT -->\n\n							<!-- START QUEUE_THEREARE -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.announce.queue_thereare.$touched || forms.announce.$submitted) && forms.announce.queue_thereare.$invalid}">\n								<label class="control-label">{{\'APPLICATION_QUEUE_THEREARE\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="queue.queue_thereare" name="queue_thereare" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n									<ui-select-choices repeat="returnAnnouncePath(announce) as announce in queueAnnounces | filter: $select.search">\n										<div ng-bind-html="announce.display_name | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_THEREARE\' | translate }}\n								</span>\n								<span data-ng-show="(forms.announce.queue_thereare.$touched || forms.announce.$submitted) && forms.announce.queue_thereare.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END QUEUE_THEREARE -->\n\n							<!-- START QUEUE_CALLSWAITING -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.announce.queue_callswaiting.$touched || forms.announce.$submitted) && forms.announce.queue_callswaiting.$invalid}">\n								<label class="control-label">{{\'APPLICATION_QUEUE_CALLSWAITING\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="queue.queue_callswaiting" name="queue_callswaiting" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n									<ui-select-choices repeat="returnAnnouncePath(announce) as announce in queueAnnounces | filter: $select.search">\n										<div ng-bind-html="announce.display_name | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_CALLSWAITING\' | translate }}\n								</span>\n								<span data-ng-show="(forms.announce.queue_callswaiting.$touched || forms.announce.$submitted) && forms.announce.queue_callswaiting.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END QUEUE_CALLSWAITING -->\n\n							<!-- START QUEUE_HOLDTIME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.announce.queue_holdtime.$touched || forms.announce.$submitted) && forms.announce.queue_holdtime.$invalid}">\n								<label class="control-label">{{\'APPLICATION_QUEUE_HOLDTIME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="queue.queue_holdtime" name="queue_holdtime" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n									<ui-select-choices repeat="returnAnnouncePath(announce) as announce in queueAnnounces | filter: $select.search">\n										<div ng-bind-html="announce.display_name | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_HOLDTIME\' | translate }}\n								</span>\n								<span data-ng-show="(forms.announce.queue_holdtime.$touched || forms.announce.$submitted) && forms.announce.queue_holdtime.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END QUEUE_HOLDTIME -->\n\n							<!-- START QUEUE_MINUTES -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.announce.queue_minutes.$touched || forms.announce.$submitted) && forms.announce.queue_minutes.$invalid}">\n								<label class="control-label">{{\'APPLICATION_QUEUE_MINUTES\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="queue.queue_minutes" name="queue_minutes" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n									<ui-select-choices repeat="returnAnnouncePath(announce) as announce in queueAnnounces | filter: $select.search">\n										<div ng-bind-html="announce.display_name | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_MINUTES\' | translate }}\n								</span>\n								<span data-ng-show="(forms.announce.queue_minutes.$touched || forms.announce.$submitted) && forms.announce.queue_minutes.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END QUEUE_MINUTES -->\n\n							<!-- START QUEUE_MINUTE -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.announce.queue_minute.$touched || forms.announce.$submitted) && forms.announce.queue_minute.$invalid}">\n								<label class="control-label">{{\'APPLICATION_QUEUE_MINUTE\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="queue.queue_minute" name="queue_minute" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n									<ui-select-choices repeat="returnAnnouncePath(announce) as announce in queueAnnounces | filter: $select.search">\n										<div ng-bind-html="announce.display_name | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_MINUTE\' | translate }}\n								</span>\n								<span data-ng-show="(forms.announce.queue_minute.$touched || forms.announce.$submitted) && forms.announce.queue_minute.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END QUEUE_MINUTE -->\n\n							<!-- START QUEUE_SECONDS -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.announce.queue_seconds.$touched || forms.announce.$submitted) && forms.announce.queue_seconds.$invalid}">\n								<label class="control-label">{{\'APPLICATION_QUEUE_SECONDS\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="queue.queue_seconds" name="queue_seconds" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n									<ui-select-choices repeat="returnAnnouncePath(announce) as announce in queueAnnounces | filter: $select.search">\n										<div ng-bind-html="announce.display_name | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_SECONDS\' | translate }}\n								</span>\n								<span data-ng-show="(forms.announce.queue_seconds.$touched || forms.announce.$submitted) && forms.announce.queue_seconds.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END QUEUE_SECONDS -->\n\n							<!-- START QUEUE_THANKYOU -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.announce.queue_thankyou.$touched || forms.announce.$submitted) && forms.announce.queue_thankyou.$invalid}">\n								<label class="control-label">{{\'APPLICATION_QUEUE_THANKYOU\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="queue.queue_thankyou" name="QUEUE_THANKYOU" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n									<ui-select-choices repeat="returnAnnouncePath(announce) as announce in queueAnnounces | filter: $select.search">\n										<div ng-bind-html="announce.display_name | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_THANKYOU\' | translate }}\n								</span>\n								<span data-ng-show="(forms.announce.queue_thankyou.$touched || forms.announce.$submitted) && forms.announce.queue_thankyou.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END QUEUE_THANKYOU -->\n\n						</div>\n					</div>\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END GENERAL TAB -->\n					<!-- ADVANCED TAB -->\n					<div class="tab-pane" id="tab_1_3">\n						<form name="forms.advanced" data-ng-submit="forms.advanced.$valid && updateVoiceQueue()" novalidate>\n\n							<div class="row">\n								<div class="col-md-6">\n\n							<!-- START AUTOPAUSE -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.autopause.$touched || forms.advanced.$submitted) && forms.advanced.autopause.$invalid}">\n								<label class="control-label">{{\'APPLICATION_AUTOPAUSE\' | translate}}</label>\n								<ui-select data-ng-model="queue.autopause" name="autopause" theme="bootstrap">\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n									<ui-select-choices repeat="item in [\'yes\',\'no\',\'all\'] | filter: $select.search">\n										<div ng-bind-html="item | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_AUTOPAUSE\' | translate }}\n								</span>\n								<span data-ng-show="(forms.advanced.autopause.$touched || forms.advanced.$submitted) && forms.advanced.autopause.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END AUTOPAUSE -->\n\n							<!-- START RINGINUSE -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.ringinuse.$touched || forms.advanced.$submitted) && forms.advanced.ringinuse.$invalid}">\n								<label class="control-label">{{\'APPLICATION_RINGINUSE\' | translate}}</label>\n								<ui-select data-ng-model="queue.ringinuse" name="ringinuse" theme="bootstrap">\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n									<ui-select-choices repeat="item in [\'yes\',\'no\'] | filter: $select.search">\n										<div ng-bind-html="item | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_RINGINUSE\' | translate }}\n								</span>\n								<span data-ng-show="(forms.advanced.ringinuse.$touched || forms.advanced.$submitted) && forms.advanced.ringinuse.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END RINGINUSE -->\n\n							<!-- START MEMBER_DELAY -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.memberdelay.$touched || forms.advanced.$submitted) && forms.advanced.memberdelay.$invalid}">\n								<label class="control-label">{{\'APPLICATION_MEMBER_DELAY\' | translate}}</label>\n								<input type="number" min="0" name="memberdelay" placeholder="{{\'APPLICATION_MEMBER_DELAY\' | translate}}" class="form-control" data-ng-model="queue.memberdelay" required/>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_MEMBER_DELAY\' | translate }}\n								</span>\n								<span data-ng-show="(forms.advanced.memberdelay.$touched || forms.advanced.$submitted) && forms.advanced.memberdelay.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END MEMBER_DELAY -->\n\n							<!-- START ACW -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.acw.$touched || forms.advanced.$submitted) && forms.advanced.acw.$invalid}">\n								<label class="control-label">{{\'APPLICATION_ACW\' | translate}}</label></br>\n								<input\n								bs-switch\n								class="form-control"\n								ng-model="queue.acw"\n								type="checkbox"\n								switch-active="{{ recordSwitch.isActive }}"\n								switch-on-text="{{ recordSwitch.onText }}"\n								switch-off-text="{{ recordSwitch.offText }}"\n								switch-on-color="{{ recordSwitch.onColor }}"\n								switch-off-color="{{ recordSwitch.offColor }}"\n								switch-animate="{{ recordSwitch.animate }}"\n								switch-size="{{ recordSwitch.size }}"\n								switch-label="{{ recordSwitch.label }}"\n								switch-icon="{{ recordSwitch.icon }}"\n								switch-radio-off="{{ recordSwitch.radioOff }}"\n								switch-label-width="{{ recordSwitch.labelWidth }}"\n								switch-handle-width="{{ recordSwitch.handleWidth }}">\n								<span class="help-block">\n									{{ \'DESCRIPTION_ACW\' | translate }}\n								</span>\n								<span data-ng-show="(forms.advanced.acw.$touched || forms.advanced.$submitted) && forms.advanced.acw.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_ACW\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END ACW -->\n\n						</div>\n							<div class="col-md-6">\n\n							<!-- START TIMEOUTRESTART -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.timeoutrestart.$touched || forms.advanced.$submitted) && forms.advanced.timeoutrestart.$invalid}">\n								<label class="control-label">{{\'APPLICATION_TIMEOUTRESTART\' | translate}}</label>\n								<ui-select data-ng-model="queue.timeoutrestart" name="timeoutrestart" theme="bootstrap">\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n									<ui-select-choices repeat="item in [\'yes\',\'no\'] | filter: $select.search">\n										<div ng-bind-html="item | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_TIMEOUTRESTART\' | translate }}\n								</span>\n								<span data-ng-show="(forms.advanced.timeoutrestart.$touched || forms.advanced.$submitted) && forms.advanced.timeoutrestart.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END TIMEOUTRESTART -->\n\n							<!-- START MONITOR_FORMAT -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.monitor_format.$touched || forms.advanced.$submitted) && forms.advanced.monitor_format.$invalid}">\n								<label class="control-label">{{\'APPLICATION_MONITOR_FORMAT\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="queue.monitor_format" name="monitor_format" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n									<ui-select-choices repeat="monFormat.value as monFormat in monitorFormats | filter: $select.search">\n										<div ng-bind-html="monFormat.name | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_MONITOR_FORMAT\' | translate }}\n								</span>\n								<span data-ng-show="(forms.advanced.monitor_format.$touched || forms.advanced.$submitted) && forms.advanced.monitor_format.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END MONITOR_FORMAT -->\n\n							<!-- START CONTEXT -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.context.$touched || forms.advanced.$submitted) && forms.advanced.context.$invalid}">\n								<label class="control-label">{{\'APPLICATION_CONTEXT\' | translate}}</label>\n								<ui-select data-ng-model="queue.context" name="context" theme="bootstrap">\n									<ui-select-match allow-clear placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n									<ui-select-choices repeat="context.name as context in voiceContexts | filter: $select.search">\n										<div ng-bind-html="context.name | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_QUEUE_VOICE_CONTEXT\' | translate }}\n								</span>\n								<span data-ng-show="(forms.advanced.context.$touched || forms.advanced.$submitted) && forms.advanced.context.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END CONTEXT -->\n\n							<!-- START ACW_TIMEOUT -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.acwTimeout.$touched || forms.advanced.$submitted) && forms.advanced.acwTimeout.$invalid}">\n								<label class="control-label">{{\'APPLICATION_ACW_TIMEOUT\' | translate}}</label>\n								<input type="number" min="0" name="acwTimeout" placeholder="{{\'APPLICATION_ACW_TIMEOUT\' | translate}}" class="form-control" data-ng-model="queue.acwTimeout" required/>\n								<span class="help-block">\n									{{ \'DESCRIPTION_ACW_TIMEOUT\' | translate }}\n								</span>\n								<span data-ng-show="(forms.advanced.acwTimeout.$touched || forms.advanced.$submitted) && forms.advanced.acwTimeout.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END ACW_TIMEOUT -->\n\n						</div>\n					</div>\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END ADVANCED TAB -->\n\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),
-a.put("app/channels/voice/realtime/view/agent/agent.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initAgents()">\n	<div class="col-md-12">\n		<!-- START TABLE -->\n		<div ui-grid="gridOptions"  ui-grid-resize-columns  class="ui-grid" ui-grid-tree-view ui-grid-expandable-row ui-grid-pagination auto-resize>\n			<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n		</div>\n		<!-- END TABLE -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/voice/realtime/view/agent/agent.modal.info.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_INTERFACE_INFO\' | translate }}</h3>\n</div>\n<div class="modal-body">\n<div data-ng-if="agent.ipaddr" class="well">\n  <div>{{agent.ipaddr}}:{{agent.port}}</div>\n  <div>{{agent.fullcontact}}</div>\n  <div>{{agent.useragent}}</div>\n  <div>{{agent.lastms}}</div>\n</div>\n<div data-ng-if="!agent.ipaddr" class="alert alert-danger" role="alert">\n  {{\'MESSAGE_NO_AVAILABLE_INFO\' | translate}}\n</div>\n</div>\n<div class="modal-footer">\n  <button class="btn default" type="button" ng-click="close()">{{ \'APPLICATION_CLOSE\' | translate }}</button>\n</div>\n'),a.put("app/channels/voice/realtime/view/agent/queue.modal.add.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_JOIN_QUEUE\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n\n    <div class="form-group row">\n  <label class="col-md-2 control-label" style="margin-top: 7px;">{{\'APPLICATION_QUEUE\' | translate}}:</label>\n  <div class="col-md-10">\n    <ui-select multiple ng-model="item.queues" theme="bootstrap" required>\n      <ui-select-match placeholder="{{\'APPLICATION_QUEUE\' | translate}}">{{$item.name}}</ui-select-match>\n      <ui-select-choices repeat="queue.name as queue in queues | filter: $select.search">\n        <div ng-bind-html="queue.name | highlight: $select.search"></div>\n      </ui-select-choices>\n    </ui-select>\n  </div>\n</div>\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="save()" ng-disabled="form.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/channels/voice/realtime/view/areport/report.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initReport()">\n	<div class="col-md-12">\n		<!-- START TABLE -->\n		<table st-table="displayedAgents" st-safe-src="agents" class="table table-striped table-bordered table-hover">\n			<div class="table-responsive">\n			  <thead>\n					<tr>\n						<th colspan="11">\n							<div class="row">\n								<div class="col-md-6">\n									<ui-select class="input-xsmall" ng-model="conf.agentsByPage" theme="bootstrap" ng-disabled="disabled">\n										<ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n										<ui-select-choices repeat="agentByPage in agentsByPage | filter: $select.search">\n											<div ng-bind-html="agentByPage.name | highlight: $select.search"></div>\n										</ui-select-choices>\n									</ui-select>\n								</div>\n								<div class="col-md-6">\n									<div class="input-group input-medium pull-right">\n										<input st-search placeholder="{{ \'APPLICATION_SEARCH\' | translate }}" class="form-control" type="search" />\n										<span class="input-group-addon">\n											<i class="fa fa-search"></i>\n										</span>\n									</div>\n								</div>\n							</div>\n						</th>\n					</tr>\n				  <tr>\n						<th></th>\n						<th st-sort="uniqueid">{{ \'APPLICATION_UNIQUEID\' | translate }}</th>\n				    <th st-sort="queue">{{ \'APPLICATION_QUEUE\' | translate }}</th>\n				    <th st-sort="membername">{{ \'APPLICATION_AGENT\' | translate }}</th>\n						<th st-sort="calleridname">{{ \'APPLICATION_CALLER\' | translate }}</th>\n						<th st-sort="agentcalledAt">{{ \'APPLICATION_CALLED_AT\' | translate }}</th>\n						<th st-sort="agentconnectAt">{{ \'APPLICATION_CONNECTED_AT\' | translate }}</th>\n						<th st-sort="agentcompleteAt">{{ \'APPLICATION_COMPLETED_AT\' | translate }}</th>\n						<th st-sort="reason">{{ \'APPLICATION_REASON\' | translate }}</th>\n						<th st-sort="holdtime">{{ \'APPLICATION_HOLDTIME\' | translate }}</th>\n				    <th st-sort="talktime">{{ \'APPLICATION_TALKTIME\' | translate }}</th>\n				  </tr>\n			  </thead>\n			  <tbody>\n			    <tr data-ng-repeat="agent in displayedAgents">\n						<td><span data-ng-class="{\'icon-call-in font-yellow\': agent.lastevent === \'called\',\n							\'icon-phone font-blue\': agent.lastevent === \'connect\',\n							\'icon-call-end font-green\': agent.lastevent === \'complete\',\n							\'icon-call-end font-red\': agent.lastevent === \'answered_elsewhere\'}"></span>\n						</td>\n						<td>{{agent.uniqueid}}</td>\n						<td>{{agent.queue}}</td>\n						<td>{{agent.destcalleridname ? agent.destcalleridname + \' [\' + agent.membername + \']\' : agent.membername }}</td>\n						<td>{{agent.calleridname ? agent.calleridname + \' [\' + agent.calleridnum + \']\' : agent.calleridnum }}</td>\n						<td>\n							<time is="relative-time" datetime="{{agent.agentcalledAt}}">\n								April 1, 2014\n							</time>\n						</td>\n						<td>\n							<time is="relative-time" datetime="{{agent.agentconnectAt}}" data-ng-show="agent.agentconnectAt">\n								April 1, 2014\n							</time>\n						</td>\n						<td>\n							<time is="relative-time" datetime="{{agent.agentcompleteAt}}" data-ng-show="agent.agentcompleteAt">\n								April 1, 2014\n							</time>\n						</td>\n						<td>\n							{{agent.reason | uppercase}}\n						</td>\n						<td>{{agent.holdtime || 0 | VoiceRealtimeViewAgentReportFilter | date:\'HH:mm:ss\'}}</td>\n			      <td>{{agent.talktime || 0 | VoiceRealtimeViewAgentReportFilter | date:\'HH:mm:ss\'}}</td>\n			    </tr>\n					<tr data-ng-hide="displayedAgents.length">\n						<td colspan="11" style="text-align:center;">\n							<i>No agents available</i>\n						</td>\n					</tr>\n			  </tbody>\n			  <tfoot>\n					<tr>\n						<td/>\n						<td>\n							<div class="input-icon right">\n								<i class="fa fa-search"></i>\n								<input st-search="uniqueid" data-ng-model="filters.uniqueid" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_UNIQUEID\' | translate | lowercase}}" class="form-control" type="search"/>\n							</div>\n				    </td>\n				    <td>\n							<div class="input-icon right">\n								<i class="fa fa-search"></i>\n								<input st-search="queue" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_QUEUE\' | translate | lowercase}}" class="form-control" type="search"/>\n							</div>\n				    </td>\n				    <td>\n							<div class="input-icon right">\n								<i class="fa fa-search"></i>\n								<input st-search="membername" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_AGENT\' | translate | lowercase}}" class="form-control" type="search"/>\n							</div>\n				    </td>\n				    <td>\n							<div class="input-icon right">\n								<i class="fa fa-search"></i>\n								<input st-search="calleridnum" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_CALLER\' | translate | lowercase}}" class="form-control" type="search"/>\n							</div>\n				    </td>\n						<td colspan="7"></td>\n				  </tr>\n			    <tr>\n			      <td colspan="11" class="text-center">\n							<div class="pagination" st-pagination st-items-by-page="conf.agentsByPage.value" st-displayed-pages="7"></div>\n			      </td>\n			    </tr>\n			  </tfoot>\n			</div>\n		</table>\n		<!-- END TABLE -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/voice/realtime/view/qreport/report.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initReport()">\n	<div class="col-md-12">\n		<!-- START TABLE -->\n		<table st-table="displayedQueues" st-safe-src="queues" class="table table-striped table-bordered table-hover">\n			<div class="table-responsive">\n			  <thead>\n					<tr>\n						<th colspan="10">\n							<div class="row">\n								<div class="col-md-6">\n									<ui-select class="input-xsmall" ng-model="conf.queuesByPage" theme="bootstrap" ng-disabled="disabled">\n										<ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n										<ui-select-choices repeat="queueByPage in queuesByPage | filter: $select.search">\n											<div ng-bind-html="queueByPage.name | highlight: $select.search"></div>\n										</ui-select-choices>\n									</ui-select>\n								</div>\n								<div class="col-md-6">\n									<div class="input-group input-medium pull-right">\n										<input st-search placeholder="{{ \'APPLICATION_SEARCH\' | translate }}" class="form-control" type="search"/>\n										<span class="input-group-addon">\n											<i class="fa fa-search"></i>\n										</span>\n									</div>\n								</div>\n							</div>\n						</th>\n					</tr>\n				  <tr>\n						<th></th>\n						<th st-sort="uniqueid">{{ \'APPLICATION_UNIQUEID\' | translate }}</th>\n				    <th st-sort="queue">{{ \'APPLICATION_QUEUE\' | translate }}</th>\n				    <th st-sort="membername">{{ \'APPLICATION_AGENT\' | translate }}</th>\n						<th st-sort="calleridname">{{ \'APPLICATION_CALLER\' | translate }}</th>\n						<th st-sort="queuecallerjoinAt">{{ \'APPLICATION_CALLED_AT\' | translate }}</th>\n						<th st-sort="queuecallerleaveAt">{{ \'APPLICATION_CONNECTED_AT\' | translate }}</th>\n						<th st-sort="queuecallerabandonAt">{{ \'APPLICATION_ABANDONED_AT\' | translate }}</th>\n				  </tr>\n			  </thead>\n			  <tbody>\n			    <tr data-ng-repeat="queue in displayedQueues">\n						<td><span data-ng-class="{\'icon-call-in font-yellow\': queue.queuecallerjoinAt && !queue.queuecallerleaveAt,\n							\'icon-phone font-blue\': queue.queuecallerjoinAt && queue.queuecallerleaveAt,\n							\'icon-call-end font-red\': queue.queuecallerjoinAt && queue.queuecallerleaveAt && queue.queuecallerabandonAt}"></span>\n						</td>\n						<td>{{queue.uniqueid}}</td>\n						<td>{{queue.queue}}</td>\n						<td>{{queue.connectedlinename ? queue.connectedlinename + \' [\' + queue.connectedlinenum + \']\' : queue.connectedlinenum }}</td>\n						<td>{{queue.calleridname ? queue.calleridname + \' [\' + queue.calleridnum + \']\' : queue.calleridnum }}</td>\n						<td>\n							<time is="relative-time" datetime="{{queue.queuecallerjoinAt}}">\n								April 1, 2014\n							</time>\n						</td>\n						<td>\n							<time is="relative-time" datetime="{{queue.queuecallerleaveAt}}" data-ng-show="queue.queuecallerleaveAt">\n								April 1, 2014\n							</time>\n						</td>\n						<td>\n							<time is="relative-time" datetime="{{queue.queuecallerabandonAt}}" data-ng-show="queue.queuecallerabandonAt">\n								April 1, 2014\n							</time>\n						</td>\n			    </tr>\n					<tr data-ng-hide="displayedQueues.length">\n						<td colspan="10" style="text-align:center;">\n							<i>No queues available</i>\n						</td>\n					</tr>\n			  </tbody>\n			  <tfoot>\n					<tr>\n						<td/>\n				    <td>\n							<div class="input-icon right">\n								<i class="fa fa-search"></i>\n								<input st-search="uniqueid" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_UNIQUEID\' | translate | lowercase}}" class="form-control" type="search"/>\n							</div>\n				    </td>\n						<td>\n							<div class="input-icon right">\n								<i class="fa fa-search"></i>\n								<input st-search="queue" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_QUEUE\' | translate | lowercase}}" class="form-control" type="search"/>\n							</div>\n				    </td>\n				    <td>\n							<div class="input-icon right">\n								<i class="fa fa-search"></i>\n								<input st-search="connectedlinename" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_AGENT\' | translate | lowercase}}" class="form-control" type="search"/>\n							</div>\n				    </td>\n				    <td>\n							<div class="input-icon right">\n								<i class="fa fa-search"></i>\n								<input st-search="calleridnum" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_CALLER\' | translate | lowercase}}" class="form-control" type="search"/>\n							</div>\n				    </td>\n						<td colspan="6"></td>\n				  </tr>\n			    <tr>\n			      <td colspan="10" class="text-center">\n							<div class="pagination" st-pagination st-items-by-page="conf.queuesByPage.value" st-displayed-pages="7"></div>\n			      </td>\n			    </tr>\n			  </tfoot>\n			</div>\n		</table>\n		<!-- END TABLE -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/voice/realtime/view/queue/pause.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_PAUSE_SELECTION\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <div class="panel panel-info">\n		<!-- Default panel contents -->\n		<div class="panel-heading">\n			<h3 class="panel-title"><span class="icon-doc"></span> Summary</h3>\n		</div>\n		<!-- List group -->\n		<ul class="list-group">\n      <li class="list-group-item">\n				 {{ \'APPLICATION_QUEUE\' | translate }}: <b class="pull-right">{{ selected.queue }}</b>\n			</li>\n      <li class="list-group-item" data-ng-hide="data.length">\n				 {{ \'APPLICATION_AGENT\' | translate }}: <b class="pull-right">{{ selected.membername }}</b>\n			</li>\n      <li class="list-group-item">\n        <div class="btn-group">\n          <ui-select ng-model="selected.item" theme="bootstrap" ng-disabled="disabled" class="btn input-xlarge pull-left">\n            <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected}}</ui-select-match>\n            <ui-select-choices repeat="item in items | filter: $select.search">\n              <div ng-bind-html="item | highlight: $select.search"></div>\n            </ui-select-choices>\n          </ui-select>\n          <button class="btn btn-success pull-right" type="button" ng-click="ok(true)" style="margin-top: 7px;">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n        </div>\n			</li>\n		</ul>\n	</div>\n  <button data-ng-show="(data | isArray) ? (data | where: {paused: true}).length : data.paused " class="btn btn-danger btn-block" type="button" ng-click="ok(false, data.queue)">Exit</button>\n</div>\n<div class="modal-footer">\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/channels/voice/realtime/view/queue/queue.add.modal.html",'<div class="modal-header" data-ng-init="initAdd()">\n  <h3 class="modal-title">{{ \'APPLICATION_QUEUE_SELECTION\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <div class="panel panel-info">\n		<!-- Default panel contents -->\n		<div class="panel-heading">\n			<h3 class="panel-title"><span class="icon-doc"></span> Summary</h3>\n		</div>\n		<!-- List group -->\n		<ul class="list-group">\n      <li class="list-group-item">\n        <div class="form-group row">\n					<label class="col-md-2 control-label" style="margin-top: 7px;">{{\'APPLICATION_AGENT\' | translate}}:</label>\n					<div class="col-md-10">\n            <input type="text" placeholder="{{\'APPLICATION_AGENT\' | translate}}" class="form-control" data-ng-model="selected.membername" ng-disabled="true"/>\n					</div>\n				</div>\n      </li>\n      <li class="list-group-item" data-ng-show="queues.length">\n        <div class="form-group row">\n					<label class="col-md-2 control-label" style="margin-top: 7px;">{{\'APPLICATION_QUEUE\' | translate}}:</label>\n					<div class="col-md-10">\n            <ui-select ng-model="selected.queue" theme="bootstrap" ng-disabled="disabled">\n              <ui-select-match placeholder="{{\'APPLICATION_QUEUE\' | translate}}">{{$select.selected.name}}</ui-select-match>\n              <ui-select-choices repeat="queue.name as queue in queues | filter: $select.search">\n                <div ng-bind-html="queue.name | highlight: $select.search"></div>\n              </ui-select-choices>\n            </ui-select>\n					</div>\n				</div>\n			</li>\n      <li class="list-group-item">\n        <div class="form-group row">\n					<label class="col-md-2 control-label" style="margin-top: 7px;">{{\'APPLICATION_PENALTY\' | translate}}:</label>\n					<div class="col-md-10">\n            <input type="number" min="0" max="10" placeholder="{{\'APPLICATION_PENALTY\' | translate}}" class="form-control" data-ng-model="selected.penalty"/>\n					</div>\n				</div>\n			</li>\n      <li class="list-group-item">\n        <div class="form-group row">\n					<label class="col-md-2 control-label" style="margin-top: 7px;">{{\'APPLICATION_PAUSE\' | translate}}:</label>\n					<div class="col-md-10">\n            <button type="button" class="btn btn-default form-control" data-ng-model="selected.paused" ui-btn-checkbox> {{ selected.paused ? \'APPLICATION_YES\' : \'APPLICATION_NO\' | translate }} </button>\n					</div>\n				</div>\n      </li>\n      <li class="list-group-item" data-ng-show="selected.paused">\n        <div class="form-group row">\n					<label class="col-md-2 control-label" style="margin-top: 7px;">{{\'APPLICATION_REASON\' | translate}}:</label>\n					<div class="col-md-10">\n            <ui-select ng-model="selected.reason" theme="bootstrap" ng-disabled="disabled">\n              <ui-select-match placeholder="{{\'APPLICATION_REASON\' | translate}}">{{$select.selected}}</ui-select-match>\n              <ui-select-choices repeat="pause in pauses | filter: $select.search">\n                <div ng-bind-html="pause | highlight: $select.search"></div>\n              </ui-select-choices>\n            </ui-select>\n					</div>\n				</div>\n			</li>\n      <li class="list-group-item">\n        <div class="form-group row">\n					<label class="col-md-2 control-label" style="margin-top: 7px;">{{\'APPLICATION_LOGIN\' | translate}}:</label>\n					<div class="col-md-10">\n            <button type="button" class="btn btn-default form-control" data-ng-model="selected.login" ui-btn-checkbox> {{ selected.login ? \'APPLICATION_YES\' : \'APPLICATION_NO\' | translate }} </button>\n					</div>\n				</div>\n      </li>\n		</ul>\n	</div>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="okAdd()">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/channels/voice/realtime/view/queue/queue.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initQueues()">\n	<div class="col-md-12">\n	 <div ng-show="selected">Selection from a modal: {{ selected }}</div>\n		<!-- BEGIN TABLE -->\n			<table st-table="displayedGroups" st-safe-src="groups" class="table table-striped table-bordered table-hover">\n				<div class="table-responsive">\n				  <thead>\n						<tr>\n							<th colspan="10">\n								<div class="row">\n									<div class="col-md-6">\n										<ui-select class="input-xsmall" ng-model="conf.agentsByPage" theme="bootstrap" ng-disabled="disabled">\n											<ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n											<ui-select-choices repeat="agentByPage in agentsByPage | filter: $select.search">\n												<div ng-bind-html="agentByPage.name | highlight: $select.search"></div>\n											</ui-select-choices>\n										</ui-select>\n									</div>\n									<div class="col-md-6">\n										<!-- <div class="input-group input-medium pull-right">\n											<input st-search placeholder="{{ \'APPLICATION_SEARCH\' | translate }}" class="form-control" type="search" />\n											<span class="input-group-addon">\n												<i class="fa fa-search"></i>\n											</span>\n										</div> -->\n									</div>\n								</div>\n							</th>\n						</tr>\n						<tr>\n							<th st-sort="memebername" colspan="3">{{ \'APPLICATION_QUEUE\' | translate }}</th>\n					    <th st-sort="agent">{{ \'APPLICATION_AGENT\' | translate }}</th>\n							<th>{{ \'APPLICATION_LAST_LOGIN\' | translate }}</th>\n							<th>{{ \'APPLICATION_LAST_PAUSE\' | translate }}</th>\n							<th>{{ \'APPLICATION_LAST_INCOMING_CALL\' | translate }}</th>\n							<th>{{ \'APPLICATION_SERVED\' | translate }}</th>\n							<th colspan="2"></th>\n					  </tr>\n				  </thead>\n					<tbody>\n				    <tr data-ng-repeat-start="group in displayedGroups">\n							<td rowspan="{{group.agents.length}}" align="center" style="vertical-align:middle">{{group.queue}}</td>\n							<td data-ng-repeat="agent in group.agents" data-ng-if="$first" align="center">\n								<span data-ng-class="{\'icon-like font-green\': agent.lastevent != \'called\' && agent.lastevent != \'connect\' ,\'icon-bell font-yellow\': agent.lastevent == \'called\', \'icon-call-in font-red\': agent.lastevent == \'connect\'}"></span>\n							</td>\n							<td data-ng-repeat="agent in group.agents" data-ng-if="$first" align="center">\n								<span class="icon-cup" data-ng-class="agent.paused ? \'font-red\' : \'font-green\'"></span>\n							</td>\n							<td data-ng-repeat="agent in group.agents" data-ng-if="$first" align="center">\n								{{agent.membername}}\n							</td>\n							<td data-ng-repeat="agent in group.agents" data-ng-if="$first" align="center">\n								<time is="relative-time" datetime="{{agent.loggedAt}}" data-ng-show="agent.logged">\n									April 1, 2014\n								</time>\n								 <span class="badge badge-empty badge-danger" data-ng-show="!agent.logged"></span>\n							</td>\n							<td data-ng-repeat="agent in group.agents" data-ng-if="$first" align="center">\n								<time is="relative-time" datetime="{{agent.pausedAt}}" data-ng-show="agent.pausedAt">\n									April 1, 2014\n								</time>\n								<span> <strong>{{agent.paused ? \'(\' + agent.reason + \')\' : \'\'}}</strong></span>\n							</td>\n							<td data-ng-repeat="agent in group.agents" data-ng-if="$first" align="center">\n								<time is="relative-time" datetime="{{agent.lastcall}}" data-ng-show="agent.lastcall">\n									April 1, 2014\n								</time>\n							</td>\n							<td data-ng-repeat="agent in group.agents" data-ng-if="$first" align="center">\n								{{agent.callstaken}}\n							</td>\n							<td data-ng-repeat="agent in group.agents" data-ng-if="$first" align="center">\n								<span data-ng-show="agent.logged" class="icon-cup pull-left" style="cursor:pointer;" data-ng-click="pause(null, agent)"> </span>\n								<span class="icon-close font-red pull-right" style="cursor:pointer;" data-ng-click="remove(null, agent)"> </span>\n							</td>\n							<td rowspan="{{group.agents.length}}" align="center" style="vertical-align:middle">\n								<span data-ng-show="group.agents.length > 1" class="icon-cup pull-left" style="cursor:pointer;" data-ng-click="pause(null, group.agents)"> </span>\n								<span class="icon-plus font-green" style="cursor:pointer;" data-ng-click="add(null, group.agents)"> </span>\n								<span data-ng-show="group.agents.length > 1" class="icon-close font-red pull-right" style="cursor:pointer;" data-ng-click="remove(null, group.agents)"></span>\n							</td>\n				    </tr>\n						<tr data-ng-repeat="agent in group.agents" data-ng-if="$middle">\n							<td align="center">\n								<span data-ng-class="{\'icon-like font-green\': agent.lastevent != \'called\' && agent.lastevent != \'connect\' ,\'icon-bell font-yellow\': agent.lastevent == \'called\', \'icon-call-in font-red\': agent.lastevent == \'connect\'}"></span>\n							</td>\n							<td align="center">\n								<span class="icon-cup" data-ng-class="agent.paused ? \'font-red\' : \'font-green\'"></span>\n							</td>\n							<td align="center">\n								{{agent.membername}}\n							</td>\n							<td align="center">\n								<time is="relative-time" datetime="{{agent.loggedAt}}" data-ng-show="agent.logged">\n									April 1, 2014\n								</time>\n								<span class="badge badge-empty badge-danger" data-ng-show="!agent.logged"></span>\n							</td>\n							<td align="center">\n								<time is="relative-time" datetime="{{agent.pausedAt}}" data-ng-show="agent.pausedAt">\n									April 1, 2014\n								</time>\n								<span> <strong>{{agent.paused ? \'(\' + agent.reason + \')\' : \'\'}}</strong></span>\n							</td>\n							<td align="center">\n								<time is="relative-time" datetime="{{agent.lastcall}}" data-ng-show="agent.lastcall">\n									April 1, 2014\n								</time>\n							</td>\n							<td align="center">\n								{{agent.callstaken}}\n							</td>\n							<td align="center">\n								<span data-ng-show="agent.logged" class="icon-cup pull-left" style="cursor:pointer;" data-ng-click="pause(null, agent)"> </span>\n								<span class="icon-close font-red pull-right" style="cursor:pointer;" data-ng-click="remove(null, agent)"> </span>\n							</td>\n						</tr>\n						<tr data-ng-repeat="agent in group.agents" data-ng-if="group.agents.length > 1 && $last" data-ng-repeat-end>\n							<td align="center">\n								<span data-ng-class="{\'icon-like font-green\': agent.lastevent != \'called\' && agent.lastevent != \'connect\' ,\'icon-bell font-yellow\': agent.lastevent == \'called\', \'icon-call-in font-red\': agent.lastevent == \'connect\'}"></span>\n							</td>\n							<td align="center">\n								<span class="icon-cup" data-ng-class="agent.paused ? \'font-red\': \'font-green\'"></span>\n							</td>\n							<td align="center">\n								{{agent.membername}}\n							</td>\n							<td align="center">\n								<time is="relative-time" datetime="{{agent.loggedAt}}" data-ng-show="agent.logged">\n									April 1, 2014\n								</time>\n								<span class="badge badge-empty badge-danger" data-ng-show="!agent.logged"></span>\n							</td>\n							<td align="center">\n								<time is="relative-time" datetime="{{agent.pausedAt}}" data-ng-show="agent.pausedAt">\n									April 1, 2014\n								</time>\n								<span> <strong>{{agent.paused ? \'(\' + agent.reason + \')\' : \'\'}}</strong></span>\n							</td>\n							<td align="center">\n								<time is="relative-time" datetime="{{agent.lastcall}}" data-ng-show="agent.lastcall">\n									April 1, 2014\n								</time>\n							</td>\n							<td align="center">\n								{{agent.callstaken}}\n							</td>\n							<td align="center">\n								<span data-ng-show="agent.logged" class="icon-cup pull-left" style="cursor:pointer;" data-ng-click="pause(null, agent)"> </span>\n								<span class="icon-close font-red pull-right" style="cursor:pointer;" data-ng-click="remove(null, agent)"> </span>\n							</td>\n						</tr>\n						<tr data-ng-hide="displayedGroups.length">\n							<td colspan="9" style="text-align:center;">\n								<i>No agents available</i>\n							</td>\n						</tr>\n				  </tbody>\n				  <tfoot>\n						<tr>\n							<td colspan="1">\n								<div class="input-icon right">\n									<i class="fa fa-search"></i>\n									<input st-search="queue" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_QUEUE\' | translate | lowercase}}" class="form-control" type="search"/>\n								</div>\n							<td colspan="9"></td>\n					  </tr>\n				    <tr>\n				      <td colspan="10" class="text-center">\n								<div class="pagination" st-pagination st-items-by-page="conf.agentsByPage.value" st-displayed-pages="7"></div>\n				      </td>\n				    </tr>\n				  </tfoot>\n				</div>\n			</table>\n		<!-- END TABLE -->\n	</div>\n\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/voice/realtime/view/queue/queue.modal.add.html",'<div class="modal-header" data-ng-init="initAdd()">\n  <h3 class="modal-title">{{ \'APPLICATION_QUEUE_SELECTION\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <div class="panel panel-info" data-ng-show="selected.queue">\n		<!-- Default panel contents -->\n		<div class="panel-heading">\n			<h3 class="panel-title"><span class="icon-doc"></span> Summary</h3>\n		</div>\n		<!-- List group -->\n		<ul class="list-group">\n      <li class="list-group-item">\n        <div class="form-group row">\n					<label class="col-md-2 control-label" style="margin-top: 7px;">{{\'APPLICATION_QUEUE\' | translate}}:</label>\n					<div class="col-md-10">\n            <input type="text" placeholder="{{\'APPLICATION_QUEUE\' | translate}}" class="form-control" data-ng-model="selected.queue" ng-disabled="true"/>\n					</div>\n				</div>\n      </li>\n      <li class="list-group-item" data-ng-show="agents.length">\n        <div class="form-group row">\n					<label class="col-md-2 control-label" style="margin-top: 7px;">{{\'APPLICATION_AGENT\' | translate}}:</label>\n					<div class="col-md-10">\n            <ui-select ng-model="selected.agent" theme="bootstrap" ng-disabled="disabled">\n              <ui-select-match placeholder="{{\'APPLICATION_AGENT\' | translate}}">{{$select.selected.name}}</ui-select-match>\n              <ui-select-choices repeat="{name: agent.name, id: agent.id} as agent in agents | filter: $select.search">\n                <div ng-bind-html="agent.name | highlight: $select.search"></div>\n              </ui-select-choices>\n            </ui-select>\n					</div>\n				</div>\n			</li>\n      <li class="list-group-item">\n        <div class="form-group row">\n					<label class="col-md-2 control-label" style="margin-top: 7px;">{{\'APPLICATION_PENALTY\' | translate}}:</label>\n					<div class="col-md-10">\n            <input type="number" min="0" max="10" placeholder="{{\'APPLICATION_PENALTY\' | translate}}" class="form-control" data-ng-model="selected.penalty"/>\n					</div>\n				</div>\n			</li>\n      <li class="list-group-item">\n        <div class="form-group row">\n					<label class="col-md-2 control-label" style="margin-top: 7px;">{{\'APPLICATION_PAUSE\' | translate}}:</label>\n					<div class="col-md-10">\n            <button type="button" class="btn btn-default form-control" data-ng-model="selected.paused" btn-checkbox> {{ selected.paused ? \'APPLICATION_YES\' : \'APPLICATION_NO\' | translate }} </button>\n					</div>\n				</div>\n      </li>\n      <li class="list-group-item" data-ng-show="selected.paused">\n        <div class="form-group row">\n					<label class="col-md-2 control-label" style="margin-top: 7px;">{{\'APPLICATION_REASON\' | translate}}:</label>\n					<div class="col-md-10">\n            <ui-select ng-model="selected.reason" theme="bootstrap" ng-disabled="disabled">\n              <ui-select-match placeholder="{{\'APPLICATION_REASON\' | translate}}">{{$select.selected}}</ui-select-match>\n              <ui-select-choices repeat="pause in pauses | filter: $select.search">\n                <div ng-bind-html="pause | highlight: $select.search"></div>\n              </ui-select-choices>\n            </ui-select>\n					</div>\n				</div>\n			</li>\n      <li class="list-group-item">\n        <div class="form-group row">\n					<label class="col-md-2 control-label" style="margin-top: 7px;">{{\'APPLICATION_LOGIN\' | translate}}:</label>\n					<div class="col-md-10">\n            <button type="button" class="btn btn-default form-control" data-ng-model="selected.login" btn-checkbox> {{ selected.login ? \'APPLICATION_YES\' : \'APPLICATION_NO\' | translate }} </button>\n					</div>\n				</div>\n      </li>\n		</ul>\n    <!-- End List group -->\n  </div>\n  <div class="note note-warning" data-ng-hide="selected.queue">\n    <h4 class="block">Warning!</h4>\n    <p>\n       {{ \'MESSAGE_NO_QUEUES_AVAILABLE\' | translate }}\n    </p>\n  </div>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="okAdd()" data-ng-show="selected.queue">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),
-a.put("app/channels/voice/realtime/view/queue/queue.modal.remove.html",'<div class="modal-header" data-ng-init="initRemove()">\n  <h3 class="modal-title">{{ \'APPLICATION_QUEUE_REMOVAL\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <div class="panel panel-info">\n		<!-- Default panel contents -->\n		<div class="panel-heading">\n			<h3 class="panel-title"><span class="icon-doc"></span> Summary</h3>\n		</div>\n		<!-- List group -->\n		<ul class="list-group">\n      <li class="list-group-item">\n        <div class="form-group row" data-ng-hide="data.length">\n					<label class="col-md-2 control-label" style="margin-top: 7px;">{{\'APPLICATION_AGENT\' | translate}}:</label>\n					<div class="col-md-10">\n            <input type="text" placeholder="{{\'APPLICATION_AGENT\' | translate}}" class="form-control" data-ng-model="selected.membername" ng-disabled="true"/>\n					</div>\n				</div>\n      </li>\n      <li class="list-group-item">\n        <div class="form-group row">\n					<label class="col-md-2 control-label" style="margin-top: 7px;">{{\'APPLICATION_QUEUE\' | translate}}:</label>\n					<div class="col-md-10">\n            <input type="text" placeholder="{{\'APPLICATION_QUEUE\' | translate}}" class="form-control" data-ng-model="selected.queue" ng-disabled="true"/>\n					</div>\n				</div>\n      </li>\n      <li class="list-group-item">\n        <div class="form-group row">\n					<label class="col-md-2 control-label" style="margin-top: 7px;">{{\'APPLICATION_LOGOUT\' | translate}}:</label>\n					<div class="col-md-10">\n            <button type="button" class="btn btn-default form-control" data-ng-model="selected.logout" btn-checkbox> {{ selected.logout ? \'APPLICATION_YES\' : \'APPLICATION_NO\' | translate }} </button>\n            <span class="help-block">{{ \'MESSAGE_PERMANENT_REMOVAL_FROM_QUEUE\' | translate }}. </span>\n          </div>\n				</div>\n      </li>\n		</ul>\n	</div>\n  <button class="btn btn-danger btn-block" type="button" ng-click="okRemove()">{{ \'APPLICATION_REMOVE\' | translate }}</button>\n</div>\n<div class="modal-footer">\n  <!-- <button class="btn btn-success" type="button" ng-click="okRemove()">{{ \'APPLICATION_CONFIRM\' | translate }}</button> -->\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/channels/voice/realtime/view/queue/queue.remove.modal.html",'<div class="modal-header" data-ng-init="initRemove()">\n  <h3 class="modal-title">{{ \'APPLICATION_QUEUE_REMOVAL\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <div class="panel panel-info">\n		<!-- Default panel contents -->\n		<div class="panel-heading">\n			<h3 class="panel-title"><span class="icon-doc"></span> Summary</h3>\n		</div>\n		<!-- List group -->\n		<ul class="list-group">\n      <li class="list-group-item">\n        <div class="form-group row">\n					<label class="col-md-2 control-label" style="margin-top: 7px;">{{\'APPLICATION_AGENT\' | translate}}:</label>\n					<div class="col-md-10">\n            <input type="text" placeholder="{{\'APPLICATION_AGENT\' | translate}}" class="form-control" data-ng-model="selected.membername" ng-disabled="true"/>\n					</div>\n				</div>\n      </li>\n      <li class="list-group-item" data-ng-hide="data.length">\n        <div class="form-group row">\n					<label class="col-md-2 control-label" style="margin-top: 7px;">{{\'APPLICATION_QUEUE\' | translate}}:</label>\n					<div class="col-md-10">\n            <input type="text" placeholder="{{\'APPLICATION_QUEUE\' | translate}}" class="form-control" data-ng-model="selected.queue" ng-disabled="true"/>\n					</div>\n				</div>\n      </li>\n      <li class="list-group-item">\n        <div class="form-group row">\n					<label class="col-md-2 control-label" style="margin-top: 7px;">{{\'APPLICATION_LOGOUT\' | translate}}:</label>\n					<div class="col-md-10">\n            <button type="button" class="btn btn-default form-control" data-ng-model="selected.logout" btn-checkbox> {{ selected.logout ? \'APPLICATION_YES\' : \'APPLICATION_NO\' | translate }} </button>\n            <span class="help-block">{{ \'MESSAGE_PERMANENT_REMOVAL_FROM_QUEUE\' | translate }}. </span>\n          </div>\n				</div>\n      </li>\n		</ul>\n	</div>\n  <button class="btn btn-danger btn-block" type="button" ng-click="okRemove()">{{ \'APPLICATION_REMOVE\' | translate }}</button>\n</div>\n<div class="modal-footer">\n  <!-- <button class="btn btn-success" type="button" ng-click="okRemove()">{{ \'APPLICATION_CONFIRM\' | translate }}</button> -->\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/channels/voice/realtime/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-directions"></i>\n					<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-earphones-alt"></i>\n					<a href="#">{{ \'APPLICATION_VOICE\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-energy"></i>\n					<a href="/channels/voice/realtime/view/agents">{{ \'APPLICATION_REALTIME\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<div>\n		    <nav class="navbar navbar-default" role="navigation">\n					<div class="collapse navbar-collapse">\n						<ul class="nav navbar-nav">\n							<li data-ng-class="{\'active\': $state.is(\'main.channels.voice.realtime.view.agents\')}">\n								<a href="/channels/voice/realtime/view/agents">\n									{{\'APPLICATION_AGENTS\' | translate}}\n								</a>\n							</li>\n						</ul>\n					</div>\n		    </nav>\n		</div>\n		<div ui-view></div>\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/voice/recording/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-puzzle"></i>\n					<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-control-play"></i>\n					<a href="#">{{ \'APPLICATION_RECORDINGS\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-control-play font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_RECORDINGS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/voice/route/inbound/list/create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_ROUTE\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="forms.extension" novalidate>\n\n    <!-- START EXTEN -->\n    <div class="form-group" data-ng-class="{\'has-error\': (forms.extension.exten.$touched || forms.extension.$submitted) && forms.extension.exten.$invalid || existRoute}">\n      <label class="control-label">{{\'APPLICATION_PHONE_NUMBER\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="exten" placeholder="{{\'APPLICATION_PHONE_NUMBER\' | translate}}" class="form-control" data-ng-model="item.exten" data-ng-pattern="settings.patternName" required/>\n      <span data-ng-show="(forms.extension.exten.$touched || forms.extension.$submitted) && forms.extension.exten.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END EXTEN -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n    </div>\n    <!-- END DESCRIPTION -->\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="ok()" ng-disabled="forms.extension.$invalid || existRoute">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n<!-- <pre>\n  {{item | json}}\n</pre> -->\n'),a.put("app/channels/voice/route/inbound/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-puzzle"></i>\n					<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-earphones-alt"></i>\n					<a href="#">{{ \'APPLICATION_VOICE\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-call-in"></i>\n					<a href="/channels/voice/routes/inbound/list">{{ \'APPLICATION_INBOUND\' | translate }} {{ \'APPLICATION_ROUTES\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-users font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_INBOUND\' | translate }} {{ \'APPLICATION_ROUTES\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<a class="btn green-jungle " href="#" data-ng-click="create()">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_ROUTE\' | translate }}\n						</a>\n					</div>\n					<!-- <a class="btn btn-icon-only btn-default fullscreen" href="#"></a> -->\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter class="ui-grid" ui-grid-draggable-rows>\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/voice/route/inbound/view/view.applications.html",'<div ui-view class="profile-content">\n<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title  tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_ACTIONS\' | translate}}</span>\n				</div>\n				<div class="actions">\n					<div class="btn-group">\n						<a class="btn green-jungle " href="/channels/voice/routes/inbound/view/{{route.id}}/application" data-toggle="dropdown">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_APPLICATION\' | translate }}\n						</a>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div data-ng-if="selectedApp === undefined" ui-grid="gridOptions"  ui-grid-resize-columns class="grid" ui-grid-draggable-rows ui-grid-auto-resize>\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n	</div>\n</div>\n</div>\n'),a.put("app/channels/voice/route/inbound/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getRoute()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-reload"></i>\n					<a href="/channels/voice/routes/inbound/list">{{ \'APPLICATION_INBOUND\' | translate }} {{ \'APPLICATION_ROUTES\' | translate }}</a>\n					<i data-ng-show="route" class="fa fa-angle-right"></i>\n				</li>\n				<li data-ng-show="route">\n					<a href="#">{{route.exten}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/inboundroute.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{route.exten}}\n					</div>\n					<!-- <div class="profile-usertitle-job">\n						{{user.role}}\n					</div> -->\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.channels.voice.routes.inbound.view.settings\')}">\n							<a data-ng-click="deselectAndRedirect(\'/channels/voice/routes/inbound/view/\'+route.id+\'/settings\')">\n							<i class="icon-settings"></i>\n							{{ \'APPLICATION_SETTINGS\' | translate}} </a>\n						</li>\n'+"						<li data-ng-class=\"{active: $state.is('main.channels.voice.routes.inbound.view.applications') || $state.is('main.channels.voice.routes.inbound.view.application') || $state.is('main.channels.voice.routes.inbound.view.applications.settings')}\">\n							<a data-ng-click=\"deselectAndRedirect('/channels/voice/routes/inbound/view/'+route.id+'/applications')\">\n							<i class=\"icon-list\"></i>\n							{{ 'APPLICATION_ACTIONS' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class=\"profile-content\">\n		</div>\n		<!-- <pre>\n			{{route | json}}\n		</pre> -->\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n"),a.put("app/channels/voice/route/inbound/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_INBOUND\' | translate}} {{ \'APPLICATION_ROUTE\' | translate}} {{ \'APPLICATION_SETTINGS\' | translate}} </span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_GENERAL\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n\n			<div class="portlet-body" data-ng-init="getContexts()">\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.general" data-ng-submit="forms.general.$valid && updateRoute()" novalidate>\n\n							<!-- START EXTEN -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.exten.$touched || forms.general.$submitted) && forms.general.exten.$invalid}">\n								<label class="control-label">{{\'APPLICATION_PHONE_NUMBER\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="exten" placeholder="{{\'APPLICATION_PHONE_NUMBER\' | translate}}" class="form-control" data-ng-model="route.exten" required/>\n								<span data-ng-show="(forms.general.exten.$touched || forms.general.$submitted) && forms.general.exten.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END EXTEN -->\n\n							<!-- START CONTEXT -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.context.$touched || forms.general.$submitted) && forms.general.context.$invalid}">\n								<label class="control-label">{{\'APPLICATION_CONTEXT\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="route.context" name="context" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n									<ui-select-choices repeat="context.name as context in voiceContexts | filter: $select.search">\n										<div ng-bind-html="context.name | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_VOICE_CONTEXT\' | translate }}\n								</span>\n								<span data-ng-show="(forms.general.context.$touched || forms.general.$submitted) && forms.general.context.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END CONTEXT -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="route.description"/></textarea>\n							</div>\n							<!-- END DESCRIPTION -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END GENERAL TAB -->\n\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/channels/voice/route/internal/list/create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_ROUTE\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="forms.extension" novalidate>\n\n    <!-- START EXTEN -->\n    <div class="form-group" data-ng-class="{\'has-error\': (forms.extension.exten.$touched || forms.extension.$submitted) && forms.extension.exten.$invalid || existRoute}">\n      <label class="control-label">{{\'APPLICATION_PHONE_NUMBER\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="exten" placeholder="{{\'APPLICATION_PHONE_NUMBER\' | translate}}" class="form-control" data-ng-model="item.exten" data-ng-pattern="settings.patternName" required/>\n      <span data-ng-show="(forms.extension.exten.$touched || forms.extension.$submitted) && forms.extension.exten.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END EXTEN -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n    </div>\n    <!-- END DESCRIPTION -->\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="ok()" ng-disabled="forms.extension.$invalid || existRoute">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n<!-- <pre>\n  {{item | json}}\n</pre> -->\n'),a.put("app/channels/voice/route/internal/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-reload"></i>\n					<a href="/voice/routes/internal/list">{{ \'APPLICATION_INTERNAL\' | translate }} {{ \'APPLICATION_ROUTES\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-users font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_INTERNAL\' | translate }} {{ \'APPLICATION_ROUTES\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<a class="btn green-jungle " href="#" data-ng-click="create()">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_ROUTE\' | translate }}\n						</a>\n					</div>\n					<!-- <a class="btn btn-icon-only btn-default fullscreen" href="#"></a> -->\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter class="ui-grid" ui-grid-draggable-rows>\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/voice/route/internal/view/view.applications.html",'<div ui-view class="profile-content">\n<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title  tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_ACTIONS\' | translate}}</span>\n				</div>\n				<div class="actions">\n					<div class="btn-group">\n						<a class="btn green-jungle " href="/channels/voice/routes/internal/view/{{route.id}}/application" data-toggle="dropdown">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_APPLICATION\' | translate }}\n						</a>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div data-ng-if="selectedApp === undefined" ui-grid="gridOptions"  ui-grid-resize-columns class="grid" ui-grid-draggable-rows>\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n	</div>\n</div>\n</div>\n'),a.put("app/channels/voice/route/internal/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getRoute()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-reload"></i>\n					<a href="/channels/voice/routes/internal/list">{{ \'APPLICATION_INTERNAL\' | translate }} {{ \'APPLICATION_ROUTES\' | translate }}</a>\n					<i data-ng-show="route" class="fa fa-angle-right"></i>\n				</li>\n				<li data-ng-show="route">\n					<a href="#">{{route.exten}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/internalroute.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{route.exten}}\n					</div>\n					<!-- <div class="profile-usertitle-job">\n						{{user.role}}\n					</div> -->\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.channels.voice.routes.internal.view.settings\')}">\n							<a data-ng-click="deselectAndRedirect(\'/channels/voice/routes/internal/view/\'+route.id+\'/settings\')">\n							<i class="icon-settings"></i>\n							{{ \'APPLICATION_SETTINGS\' | translate}} </a>\n						</li>\n'+"						<li data-ng-class=\"{active: $state.is('main.channels.voice.routes.internal.view.applications') || $state.is('main.channels.voice.routes.internal.view.application') || $state.is('main.channels.voice.routes.internal.view.applications.settings')}\">\n							<a data-ng-click=\"deselectAndRedirect('/channels/voice/routes/internal/view/'+route.id+'/applications')\">\n							<i class=\"icon-list\"></i>\n							{{ 'APPLICATION_ACTIONS' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class=\"profile-content\">\n		</div>\n		<!-- <pre>\n			{{route | json}}\n		</pre> -->\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n"),a.put("app/channels/voice/route/internal/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_INTERNAL\' | translate}} {{ \'APPLICATION_ROUTE\' | translate}} {{ \'APPLICATION_SETTINGS\' | translate}} </span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_GENERAL\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n\n			<div class="portlet-body" data-ng-init="getContexts()">\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.general" data-ng-submit="forms.general.$valid && updateRoute()" novalidate>\n\n							<!-- START EXTEN -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.exten.$touched || forms.general.$submitted) && forms.general.exten.$invalid}">\n								<label class="control-label">{{\'APPLICATION_PHONE_NUMBER\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="exten" placeholder="{{\'APPLICATION_PHONE_NUMBER\' | translate}}" class="form-control" data-ng-model="route.exten" required/>\n								<span data-ng-show="(forms.general.exten.$touched || forms.general.$submitted) && forms.general.exten.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END EXTEN -->\n\n							<!-- START CONTEXT -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.context.$touched || forms.general.$submitted) && forms.general.context.$invalid}">\n								<label class="control-label">{{\'APPLICATION_CONTEXT\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="route.context" name="context" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n									<ui-select-choices repeat="context.name as context in voiceContexts | filter: $select.search">\n										<div ng-bind-html="context.name | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_VOICE_CONTEXT\' | translate }}\n								</span>\n								<span data-ng-show="(forms.general.context.$touched || forms.general.$submitted) && forms.general.context.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END CONTEXT -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="route.description"/></textarea>\n							</div>\n							<!-- END DESCRIPTION -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END GENERAL TAB -->\n\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/channels/voice/route/outbound/list/create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_ROUTE\' | translate }}</h3>\n</div>\n<div class="modal-body" data-ng-init="getTags()">\n  <form name="forms.extension" novalidate>\n\n    <!-- START EXTEN -->\n    <div class="form-group" data-ng-class="{\'has-error\': (forms.extension.exten.$touched || forms.extension.$submitted) && forms.extension.exten.$invalid || existRoute}">\n      <label class="control-label">{{\'APPLICATION_DESTINATION_PATTERN\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="exten" placeholder="{{\'APPLICATION_DESTINATION_PATTERN\' | translate}}" class="form-control" data-ng-model="item.exten" data-ng-pattern="settings.patternName" required/>\n      <span data-ng-show="(forms.extension.exten.$touched || forms.extension.$submitted) && forms.extension.exten.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END EXTEN -->\n\n    <!-- START TAG -->\n    <div class="form-group"  data-ng-class="{\'has-error\': (forms.extension.tag.$touched || forms.extension.$submitted) && forms.extension.tag.$invalid}">\n      <label class="control-label">{{ \'APPLICATION_TAG\' | translate }}<span class="required" aria-required="true">*</span></label>\n      <ui-select data-ng-model="item.tag" name="tag" theme="bootstrap" required>\n        <ui-select-match placeholder="{{ \'APPLICATION_TAG\' | translate }}" data-ng-init="item.tag = \'--\'">{{$select.selected.name}}</ui-select-match>\n        <ui-select-choices repeat="tag.name as tag in tags | filter: $select.search">\n          <div ng-bind-html="tag.name | highlight: $select.search"></div>\n        </ui-select-choices>\n      </ui-select>\n      <span data-ng-show="(forms.extension.tag.$touched || forms.extension.$submitted) && forms.extension.tag.$invalid && forms.extension.tag.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END TAG -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n    </div>\n    <!-- END DESCRIPTION -->\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="ok()" ng-disabled="forms.extension.$invalid || existRoute">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n<!-- <pre>\n  {{item | json}}\n</pre> -->\n'),
-a.put("app/channels/voice/route/outbound/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-call-out"></i>\n					<a href="/channels/voice/routes/outbound/list">{{ \'APPLICATION_OUTBOUND\' | translate }} {{ \'APPLICATION_ROUTES\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-users font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_OUTBOUND\' | translate }} {{ \'APPLICATION_ROUTES\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<a class="btn green-jungle " href="#" data-ng-click="create()">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_ROUTE\' | translate }}\n						</a>\n					</div>\n					<!-- <a class="btn btn-icon-only btn-default fullscreen" href="#"></a> -->\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter class="ui-grid" ui-grid-draggable-rows>\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/voice/route/outbound/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getRoute()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-call-out"></i>\n					<a href="/channels/voice/routes/outbound/list">{{ \'APPLICATION_OUTBOUND\' | translate }} {{ \'APPLICATION_ROUTES\' | translate }}</a>\n					<i data-ng-show="route" class="fa fa-angle-right"></i>\n				</li>\n				<li data-ng-show="route">\n					<a href="#">{{route.exten}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/outboundroute.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{route.exten}}\n					</div>\n					<!-- <div class="profile-usertitle-job">\n						{{user.role}}\n					</div> -->\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.channels.voice.routes.outbound.view.settings\')}">\n							<a data-ng-click="deselectAndRedirect(\'/channels/voice/routes/outbound/view/\'+route.id+\'/settings\')">\n							<i class="icon-settings"></i>\n							{{ \'APPLICATION_SETTINGS\' | translate}} </a>\n						</li>\n'+"						<li data-ng-class=\"{active: $state.is('main.channels.voice.routes.outbound.view.routes') || $state.is('main.channels.voice.routes.outbound.view.route') || $state.is('main.channels.voice.routes.outbound.view.routes.settings')}\">\n							<a data-ng-click=\"deselectAndRedirect('/channels/voice/routes/outbound/view/'+route.id+'/routes')\">\n							<i class=\"icon-list\"></i>\n							{{ 'APPLICATION_ACTIONS' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class=\"profile-content\">\n		</div>\n		<!-- <pre>\n			{{route | json}}\n		</pre> -->\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n"),a.put("app/channels/voice/route/outbound/view/view.route.html",'<div class="row" data-ng-init="initApplication(true);getIntervals();">\n	<div class="col-md-12">\n		<!-- BEGIN  PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-notebook font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_NEW_ROUTE\' | translate }} WIZARD</a> </span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<div class="profile-usertitle-name">\n					{{(main.app | capitalize) || \'Application\'}}\n				</div>\n				<wizard on-finish="addApplication()">\n	        <wz-step title="{{\'APPLICATION_SETTINGS\' | translate}}" canexit="formValidation(forms.info.$valid)">\n							<form name="forms.info" novalidate>\n								<button class="btn green-haze" type="submit" ng-click="goNext()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n								<!-- START APP -->\n								<div class="form-group"  data-ng-class="{\'has-error\': (forms.info.app.$touched || forms.info.$submitted) && forms.info.app.$invalid}">\n									<label class="control-label">{{ \'APPLICATION_APPLICATION\' | translate }}<span class="required" aria-required="true">*</span></label>\n									<ui-select data-ng-model="main.app" name="app" theme="bootstrap" required>\n										<ui-select-match placeholder="{{ \'APPLICATION_APPLICATION\' | translate }}">{{$select.selected.name}}</ui-select-match>\n										<ui-select-choices repeat="app.value as app in applications | filter: $select.search">\n											<div ng-bind-html="app.name | highlight: $select.search"></div>\n										</ui-select-choices>\n									</ui-select>\n									<span data-ng-show="(forms.info.app.$touched || forms.info.$submitted) && forms.info.app.$invalid && forms.info.app.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END APP -->\n								<div id="Dial" class="app-settings" ng-slide-down="main.app == \'Dial\'" lazy-render duration="1">\n								<!-- START TRUNK -->\n								<div class="form-group" data-ng-class="{\'has-error\': (forms.info.trunk.$touched || forms.info.$submitted) && forms.info.trunk.$invalid}">\n									<label class="control-label">{{\'APPLICATION_TRUNK\' | translate}}<span class="required" aria-required="true">*</span></label>\n									<ui-select data-ng-model="application.appdata[0]" data-ng-init="application.appdata[0] = null" name="trunk" theme="bootstrap" required data-ng-disabled="!items.length">\n										<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n										<ui-select-choices repeat="trunk.name as trunk in items | filter: $select.search">\n											<div ng-bind-html="trunk.name | highlight: $select.search"></div>\n										</ui-select-choices>\n									</ui-select>\n									<div class="note note-warning" data-ng-hide="items.length">\n										<h4 class="block">Warning!</h4>\n										<p>\n											{{ \'MESSAGE_NO_TRUNKS_AVAILABLE\' | translate }}\n										</p>\n										<p>\n											{{\'APPLICATION_GO_TO\' | translate}} <a href="/tools/trunks/list">{{\'APPLICATION_TRUNKS\' | translate}}</a>\n										</p>\n									</div>\n									<span data-ng-show="(forms.info.trunk.$touched || forms.info.$submitted) && forms.info.trunk.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END TRUNK -->\n\n								<!-- <input type="hidden" class="form-control" name="context" data-ng-model="application.appdata[1]" data-ng-init="application.appdata[1] = \'from-sip\'"> -->\n\n								<!-- START CALLERID -->\n								<div class="form-group"  data-ng-class="{\'has-error\': (forms.info.callerID.$touched || forms.info.$submitted) && forms.info.callerID.$invalid}">\n									<label class="control-label">{{ \'APPLICATION_CALLERID\' | translate }}</label>\n									<input type="text" name="callerID" pattern=\'^"[a-zA-Z0-9_.-]*" <[a-zA-Z0-9_.-]*>\' placeholder=\'"name" <number>\' class="form-control" data-ng-model="application.appdata[1]" data-ng-init="application.appdata[1] = null">\n										<span class="help-block">\n											{{ \'DESCRIPTION_OUTBOUND_CALLERID\' | translate }}\n										</span>\n									<span data-ng-show="(forms.info.callerID.$touched || forms.info.$submitted) && forms.info.callerID.$invalid" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END CALLERID -->\n\n									<!-- START CUTDIGITS -->\n								<div class="form-group">\n									<label class="control-label">{{\'APPLICATION_CUTDIGITS\' | translate}}</label>\n									<input type="text" pattern="[0-9]+" class="form-control" name="cutdigits" data-ng-model="application.appdata[2]" data-ng-init="application.appdata[2] = null">\n									<span class="help-block">\n										{{ \'DESCRIPTION_VOICE_CONTEXT\' | translate }}\n									</span>\n								</div>\n								<!-- END CUTDIGITS -->\n\n								<!-- START PREFIX -->\n								<div class="form-group"  data-ng-class="{\'has-error\': (forms.info.prefix.$touched || forms.info.$submitted) && forms.info.prefix.$invalid}">\n									<label class="control-label">{{ \'APPLICATION_PREFIX\' | translate }}</label>\n									<input type="text" name="prefix"  placeholder="{{ \'APPLICATION_PREFIX\' | translate }}" class="form-control" data-ng-model="application.appdata[3]" data-ng-init="application.appdata[3] = null">\n										<span class="help-block">\n											{{ \'DESCRIPTION_OUTBOUND_PREFIX\' | translate }}\n										</span>\n										<span data-ng-show="(forms.info.prefix.$touched || forms.info.$submitted) && forms.info.prefix.$invalid" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<!-- END PREFIX -->\n							</div>\n							<div id="Custom" class="app-settings" ng-slide-down="main.app == \'custom\'" lazy-render duration="1">\n\n								<!-- START CUSTOMAPP -->\n								<div class="form-group"  data-ng-class="{\'has-error\': (forms.info.customApp.$touched || forms.info.$submitted) && forms.info.customApp.$invalid}">\n									<label class="control-label">{{ \'APPLICATION_CUSTOM_APP\' | translate }}<span class="required" aria-required="true">*</span></label>\n									<input type="text" name="customApp" placeholder="{{ \'APPLICATION_CUSTOM_APP\' | translate }}" class="form-control" data-ng-model="application.app" data-ng-init="application.appdata[0] = null" required>\n									<span data-ng-show="(forms.info.customApp.$touched || forms.info.$submitted) && forms.info.customApp.$invalid && forms.info.customApp.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END CUSTOMAPP -->\n\n								<!-- START APPDATA -->\n								<div class="form-group"  data-ng-class="{\'has-error\': (forms.info.appdata.$touched || forms.info.$submitted) && forms.info.appdata.$invalid}">\n									<label class="control-label">{{ \'APPLICATION_ARGUMENTS\' | translate }}</label>\n									<input type="text" name="appdata" placeholder="{{ \'APPLICATION_ARGUMENTS\' | translate }}" class="form-control" data-ng-model="application.appdata[0]" data-ng-init="application.appdata[1] = null">\n									<span data-ng-show="(forms.info.appdata.$touched || forms.info.$submitted) && forms.info.appdata.$invalid && forms.info.appdata.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END APPDATA -->\n							</div>\n							<button class="btn green-haze" type="submit" ng-click="goNext()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n							</form>\n							</wz-step>\n								<wz-step title="{{\'APPLICATION_INTERVAL\' | translate}}" canexit="formValidation(forms.interval.IntervalId.$valid || forms.interval.hasOwnProperty(\'t_from\') || forms.interval.intType.$modelValue === \'always\')">\n									<form name="forms.interval" novalidate>\n										<button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n										<button class="btn green-haze" type="submit" ng-click="goNext()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n									<!-- START INTERVAL_TYPE -->\n								<div class="form-group" data-ng-class="{\'has-error\': (forms.interval.intType.$touched || forms.interval.$submitted) && forms.interval.intType.$invalid}">\n									<label class="control-label">{{\'APPLICATION_INTERVAL_TYPE\' | translate}}<span class="required" aria-required="true">*</span></label>\n									<ui-select data-ng-model="interval.intType" theme="bootstrap" name="intType" required>\n										<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$translate.instant($select.selected.name)}}</ui-select-match>\n										<ui-select-choices repeat="intType.value as intType in $application.intTypes | filter: $select.search">\n											{{$translate.instant(intType.name)}}\n										</ui-select-choices>\n									</ui-select>\n									<span data-ng-show="(forms.interval.intType.$touched || forms.interval.$submitted) && forms.interval.intType.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END INTERVAL_TYPE -->\n								<div id="customInterval" class="app-settings" ng-slide-down="interval.intType == \'custom\'" lazy-render duration="1">\n										<!-- START TIME -->\n										<div class="form-group">\n											<label class="control-label">{{ \'APPLICATION_TIME\' | translate }}</label>\n											<div class="input-group input-large">\n												<fieldset class="pull-left" ng-disabled="interval.alwaysTime"><uib-timepicker name="t_from" data-ng-model="interval.t_from" show-meridian="false" show-spinners="false"></uib-timepicker></fieldset>\n												<div class="input-group-addon col-md-1 interval-to pull-left">to</div>\n												<fieldset ng-disabled="interval.alwaysTime"><uib-timepicker  name="t_to" data-ng-model="interval.t_to" show-meridian="false" show-spinners="false"></uib-timepicker></fieldset>\n												<label class="control-label pointer-cursor"><input type="checkbox" data-ng-model="interval.alwaysTime">{{\'APPLICATION_ALWAYS\' | translate}}</label>\n											</div>\n										</div>\n										<!-- END TIME -->\n\n										<!-- START WEEKDAY -->\n										<div class="form-group">\n											<label class="control-label">{{ \'APPLICATION_WEEKDAY\' | translate }}</label>\n											<div class="input-group input-large">\n												<ui-select data-ng-model="interval.wd_from" theme="bootstrap" name="wd_from">\n													<ui-select-match placeholder="">{{$translate.instant($select.selected.name)}}</ui-select-match>\n													<ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n														{{$translate.instant(weekDay.name)}}\n													</ui-select-choices>\n												</ui-select>\n												<span class="input-group-addon">to</span>\n												<ui-select data-ng-model="interval.wd_to" theme="bootstrap" name="wd_to">\n													<ui-select-match placeholder="">{{$translate.instant($select.selected.name)}}</ui-select-match>\n													<ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n														{{$translate.instant(weekDay.name)}}\n													</ui-select-choices>\n												</ui-select>\n											</div>\n										</div>\n										<!-- END WEEKDAY -->\n\n										<!-- START MONTHDAY -->\n										<div class="form-group">\n											<label class="control-label">{{ \'APPLICATION_MONTHDAY\' | translate }}</label>\n											<div class="input-group input-large">\n												<ui-select data-ng-model="interval.md_from" theme="bootstrap" name="md_from">\n													<ui-select-match>{{$select.selected}}</ui-select-match>\n													<ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n														{{monthDay}}\n													</ui-select-choices>\n												</ui-select>\n												<span class="input-group-addon">to</span>\n												<ui-select data-ng-model="interval.md_to" theme="bootstrap" name="md_to">\n													<ui-select-match>{{$select.selected}}</ui-select-match>\n													<ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n														{{monthDay}}\n													</ui-select-choices>\n												</ui-select>\n											</div>\n										</div>\n										<!-- END MONTHDAY -->\n\n										<!-- START MONTH -->\n										<div class="form-group">\n											<label class="control-label">{{ \'APPLICATION_MONTH\' | translate }}</label>\n											<div class="input-group input-large">\n												<ui-select data-ng-model="interval.m_from" theme="bootstrap" name="m_from">\n													<ui-select-match placeholder="">{{$translate.instant($select.selected.name)}}</ui-select-match>\n													<ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n														{{$translate.instant(month.name)}}\n													</ui-select-choices>\n												</ui-select>\n												<span class="input-group-addon">to</span>\n												<ui-select data-ng-model="interval.m_to" theme="bootstrap" name="m_to">\n													<ui-select-match placeholder="">{{$translate.instant($select.selected.name)}}</ui-select-match>\n													<ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n														{{$translate.instant(month.name)}}\n													</ui-select-choices>\n												</ui-select>\n											</div>\n										</div>\n										<!-- END MONTH -->\n						</div>\n\n						<div id="customInterval" class="app-settings" ng-slide-down="interval.intType == \'list\'" lazy-render duration="1">\n\n							<!-- START INTERVALS -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.interval.IntervalId.$touched || forms.interval.$submitted) && forms.interval.IntervalId.$invalid}">\n								<label class="control-label">{{\'APPLICATION_INTERVALS\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="interval.IntervalId" theme="bootstrap" name="IntervalId" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$translate.instant($select.selected.name)}}</ui-select-match>\n									<ui-select-choices repeat="interval.id as interval in Intervals | filter: $select.search">\n										{{$translate.instant(interval.name)}}\n									</ui-select-choices>\n								</ui-select>\n								<span data-ng-show="(forms.interval.IntervalId.$touched || forms.interval.$submitted) && forms.interval.IntervalId.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END INTERVALS -->\n\n						</div>\n\n						<button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n						<button class="btn green-haze" type="submit" ng-click="goNext()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n							</form>\n						</wz-step>\n\n						<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n							<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n							<button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n							<input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n						</wz-step>\n				</wizard>\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/voice/route/outbound/view/view.routeSettings.html",'\n<div class="row" data-ng-init="initApplication();getApplication();getIntervals();">\n	<div class="col-md-12">\n		<!-- BEGIN  PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-notebook font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_APPLICATION_SETTINGS\' | translate }} WIZARD</a> </span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<wizard on-finish="updateRoute(\'routes\')">\n					<div class="profile-usertitle-name">\n						{{(main.app | capitalize) || \'Application\'}}\n					</div>\n	        <wz-step title="{{\'APPLICATION_APPLICATION\' | translate}}" canexit="formValidation(forms.info.$valid)">\n						<form name="forms.info" novalidate>\n							<div id="Dial" class="app-settings" ng-slide-down="main.app == \'Dial\'" lazy-render duration="1">\n							<button class="btn green-haze" type="submit" ng-click="goNext()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n\n							<!-- START TRUNK -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.info.trunk.$touched || forms.info.$submitted) && forms.info.trunk.$invalid}">\n								<label class="control-label">{{\'APPLICATION_TRUNK\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="route.Applications[selectedApp].appdata[0]" name="trunk" theme="bootstrap" required data-ng-disabled="!items.length">\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n									<ui-select-choices repeat="trunk.name as trunk in items | filter: $select.search">\n										<div ng-bind-html="trunk.name | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<div class="note note-warning" data-ng-hide="items.length">\n									<h4 class="block">Warning!</h4>\n									<p>\n										{{ \'MESSAGE_NO_TRUNKS_AVAILABLE\' | translate }}\n									</p>\n									<p>\n										{{\'APPLICATION_GO_TO\' | translate}} <a href="/tools/trunks/list">{{\'APPLICATION_TRUNKS\' | translate}}</a>\n									</p>\n								</div>\n								<span data-ng-show="(forms.info.trunk.$touched || forms.info.$submitted) && forms.info.trunk.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END TRUNK -->\n\n							<!-- START CONTEXT -->\n							<!-- <div class="form-group" data-ng-class="{\'has-error\': (forms.info.context.$touched || forms.info.$submitted) && forms.info.context.$invalid}">\n								<label class="control-label">{{\'APPLICATION_CONTEXT\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="route.Applications[selectedApp].appdata[1]" name="context" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n									<ui-select-choices repeat="context.name as context in items2 | filter: $select.search">\n										<div ng-bind-html="context.name | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_VOICE_CONTEXT\' | translate }}\n								</span>\n								<span data-ng-show="(forms.info.context.$touched || forms.info.$submitted) && forms.info.context.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div> -->\n							<!-- END CONTEXT -->\n\n							<!-- START CALLERID -->\n							<div class="form-group"  data-ng-class="{\'has-error\': (forms.info.callerID.$touched || forms.info.$submitted) && forms.info.callerID.$invalid}">\n								<label class="control-label">{{ \'APPLICATION_CALLERID\' | translate }}</label>\n								<input type="text" name="callerID" pattern=\'^"[a-zA-Z0-9_.-]*" <[a-zA-Z0-9_.-]*>\' placeholder=\'"name" <number>\' class="form-control" data-ng-model="route.Applications[selectedApp].appdata[1]">\n									<span class="help-block">\n										{{ \'DESCRIPTION_OUTBOUND_CALLERID\' | translate }} "name" &lt;number&gt;\n									</span>\n								<span data-ng-show="(forms.info.callerID.$touched || forms.info.$submitted) && forms.info.callerID.$invalid" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END CALLERID -->\n\n								<!-- START CUTDIGITS -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_CUTDIGITS\' | translate}}</label>\n								<input type="text" pattern="[0-9]+" class="form-control" name="cutdigits" data-ng-model="route.Applications[selectedApp].appdata[2]">\n								<span class="help-block">\n									{{ \'DESCRIPTION_VOICE_CONTEXT\' | translate }}\n								</span>\n							</div>\n							<!-- END CUTDIGITS -->\n\n							<!-- START PREFIX -->\n							<div class="form-group"  data-ng-class="{\'has-error\': (forms.info.prefix.$touched || forms.info.$submitted) && forms.info.prefix.$invalid}">\n								<label class="control-label">{{ \'APPLICATION_PREFIX\' | translate }}</label>\n								<input type="text" name="prefix"  placeholder="{{ \'APPLICATION_PREFIX\' | translate }}" class="form-control" data-ng-model="route.Applications[selectedApp].appdata[3]">\n								<span class="help-block">\n									{{ \'DESCRIPTION_OUTBOUND_PREFIX\' | translate }}\n								</span>\n								<span data-ng-show="(forms.info.prefix.$touched || forms.info.$submitted) && forms.info.prefix.$invalid" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n								<!-- END PREFIX -->\n						</div>\n						<div id="Custom" class="app-settings" ng-slide-down="main.app == \'custom\'" lazy-render duration="1">\n\n							<!-- START CUSTOMAPP -->\n							<div class="form-group"  data-ng-class="{\'has-error\': (forms.info.customApp.$touched || forms.info.$submitted) && forms.info.customApp.$invalid}">\n								<label class="control-label">{{ \'APPLICATION_CUSTOM_APP\' | translate }}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="customApp" placeholder="{{ \'APPLICATION_CUSTOM_APP\' | translate }}" class="form-control" data-ng-model="route.Applications[selectedApp].app" required>\n								<span data-ng-show="(forms.info.customApp.$touched || forms.info.$submitted) && forms.info.customApp.$invalid && forms.info.customApp.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END CUSTOMAPP -->\n\n							<!-- START APPDATA -->\n							<div class="form-group"  data-ng-class="{\'has-error\': (forms.info.appdata.$touched || forms.info.$submitted) && forms.info.appdata.$invalid}">\n								<label class="control-label">{{ \'APPLICATION_ARGUMENTS\' | translate }}</label>\n								<input type="text" name="appdata" placeholder="{{ \'APPLICATION_ARGUMENTS\' | translate }}" class="form-control" data-ng-model="route.Applications[selectedApp].appdata[0]">\n								<span data-ng-show="(forms.info.appdata.$touched || forms.info.$submitted) && forms.info.appdata.$invalid && forms.info.appdata.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END APPDATA -->\n						</div>\n						<button class="btn green-haze" type="submit" ng-click="goNext()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n					</form>\n					</wz-step>\n						<wz-step title="{{\'APPLICATION_INTERVAL\' | translate}}" canexit="formValidation(forms.interval.IntervalId.$valid || forms.interval.hasOwnProperty(\'t_from\') || forms.interval.intType.$modelValue === \'always\')">\n							<form name="forms.interval" novalidate>\n								<button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n								<button class="btn green-haze" type="submit" ng-click="goNext()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n						<!-- START INTERVAL_TYPE -->\n						<div class="form-group" data-ng-class="{\'has-error\': (forms.interval.intType.$touched || forms.interval.$submitted) && forms.interval.intType.$invalid}">\n							<label class="control-label">{{\'APPLICATION_INTERVAL_TYPE\' | translate}}<span class="required" aria-required="true">*</span></label>\n							<ui-select data-ng-model="interval.intType" theme="bootstrap" name="intType" required>\n								<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$translate.instant($select.selected.name)}}</ui-select-match>\n								<ui-select-choices repeat="intType.value as intType in $application.intTypes | filter: $select.search">\n									{{$translate.instant(intType.name)}}\n								</ui-select-choices>\n							</ui-select>\n							<span data-ng-show="(forms.interval.intType.$touched || forms.interval.$submitted) && forms.interval.intType.$error.required" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n						</div>\n						<!-- END INTERVAL_TYPE -->\n						<div id="customInterval" class="app-settings" ng-slide-down="interval.intType == \'custom\'" lazy-render duration="1">\n								<!-- START TIME -->\n								<div class="form-group">\n									<label class="control-label">{{ \'APPLICATION_TIME\' | translate }}</label>\n									<div class="input-group input-large">\n										<fieldset class="pull-left" ng-disabled="interval.alwaysTime"><uib-timepicker name="t_from" data-ng-model="interval.t_from" show-meridian="false" show-spinners="false"></uib-timepicker></fieldset>\n										<div class="input-group-addon col-md-1 interval-to pull-left">to</div>\n										<fieldset ng-disabled="interval.alwaysTime"><uib-timepicker  name="t_to" data-ng-model="interval.t_to" show-meridian="false" show-spinners="false"></uib-timepicker></fieldset>\n										<label class="control-label pointer-cursor"><input type="checkbox" data-ng-model="interval.alwaysTime">{{\'APPLICATION_ALWAYS\' | translate}}</label>\n									</div>\n								</div>\n								<!-- END TIME -->\n\n								<!-- START WEEKDAY -->\n								<div class="form-group">\n									<label class="control-label">{{ \'APPLICATION_WEEKDAY\' | translate }}</label>\n									<div class="input-group input-large">\n										<ui-select data-ng-model="interval.wd_from" theme="bootstrap" name="wd_from">\n											<ui-select-match placeholder="">{{$translate.instant($select.selected.name)}}</ui-select-match>\n											<ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n												{{$translate.instant(weekDay.name)}}\n											</ui-select-choices>\n										</ui-select>\n										<span class="input-group-addon">to</span>\n										<ui-select data-ng-model="interval.wd_to" theme="bootstrap" name="wd_to">\n											<ui-select-match placeholder="">{{$translate.instant($select.selected.name)}}</ui-select-match>\n											<ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n												{{$translate.instant(weekDay.name)}}\n											</ui-select-choices>\n										</ui-select>\n									</div>\n								</div>\n								<!-- END WEEKDAY -->\n\n								<!-- START MONTHDAY -->\n								<div class="form-group">\n									<label class="control-label">{{ \'APPLICATION_MONTHDAY\' | translate }}</label>\n									<div class="input-group input-large">\n										<ui-select data-ng-model="interval.md_from" theme="bootstrap" name="md_from">\n											<ui-select-match>{{$select.selected}}</ui-select-match>\n											<ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n												{{monthDay}}\n											</ui-select-choices>\n										</ui-select>\n										<span class="input-group-addon">to</span>\n										<ui-select data-ng-model="interval.md_to" theme="bootstrap" name="md_to">\n											<ui-select-match>{{$select.selected}}</ui-select-match>\n											<ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n												{{monthDay}}\n											</ui-select-choices>\n										</ui-select>\n									</div>\n								</div>\n								<!-- END MONTHDAY -->\n\n								<!-- START MONTH -->\n								<div class="form-group">\n									<label class="control-label">{{ \'APPLICATION_MONTH\' | translate }}</label>\n									<div class="input-group input-large">\n										<ui-select data-ng-model="interval.m_from" theme="bootstrap" name="m_from">\n											<ui-select-match placeholder="">{{$translate.instant($select.selected.name)}}</ui-select-match>\n											<ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n												{{$translate.instant(month.name)}}\n											</ui-select-choices>\n										</ui-select>\n										<span class="input-group-addon">to</span>\n										<ui-select data-ng-model="interval.m_to" theme="bootstrap" name="m_to">\n											<ui-select-match placeholder="">{{$translate.instant($select.selected.name)}}</ui-select-match>\n											<ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n												{{$translate.instant(month.name)}}\n											</ui-select-choices>\n										</ui-select>\n									</div>\n								</div>\n								<!-- END MONTH -->\n							</div>\n\n							<div id="customInterval" class="app-settings" ng-slide-down="interval.intType == \'list\'" lazy-render duration="1">\n\n								<!-- START INTERVALS -->\n								<div class="form-group" data-ng-class="{\'has-error\': (forms.interval.IntervalId.$touched || forms.interval.$submitted) && forms.interval.IntervalId.$invalid}">\n									<label class="control-label">{{\'APPLICATION_INTERVALS\' | translate}}<span class="required" aria-required="true">*</span></label>\n									<ui-select data-ng-model="interval.IntervalId" theme="bootstrap" name="IntervalId" required>\n										<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$translate.instant($select.selected.name)}}</ui-select-match>\n										<ui-select-choices repeat="interval.id as interval in Intervals | filter: $select.search">\n											{{$translate.instant(interval.name)}}\n										</ui-select-choices>\n									</ui-select>\n									<span data-ng-show="(forms.interval.IntervalId.$touched || forms.interval.$submitted) && forms.interval.IntervalId.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END INTERVALS -->\n\n							</div>\n							<button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n							<button class="btn green-haze" type="submit" ng-click="goNext()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n							</form>\n						</wz-step>\n\n						<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n							<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n							<button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n							<input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n						</wz-step>\n				</wizard>\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),
-a.put("app/channels/voice/route/outbound/view/view.routes.html",'<div ui-view class="profile-content">\n<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title  tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_ACTIONS\' | translate}}</span>\n				</div>\n				<div class="actions">\n					<div class="btn-group">\n						<a class="btn green-jungle " href="/channels/voice/routes/outbound/view/{{route.id}}/route" data-toggle="dropdown">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_ROUTE\' | translate }}\n						</a>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div data-ng-if="selectedApp === undefined" ui-grid="gridOptions"  ui-grid-resize-columns class="grid" ui-grid-draggable-rows>\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n	</div>\n</div>\n</div>\n'),a.put("app/channels/voice/route/outbound/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_OUTBOUND\' | translate}} {{ \'APPLICATION_ROUTE\' | translate}} {{ \'APPLICATION_SETTINGS\' | translate}} </span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_GENERAL\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n\n			<div class="portlet-body" data-ng-init="getContexts();getTags();">\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.general" data-ng-submit="forms.general.$valid && updateRoute()" novalidate>\n\n							<!-- START EXTEN -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.exten.$touched || forms.general.$submitted) && forms.general.exten.$invalid}">\n								<label class="control-label">{{\'APPLICATION_DESTINATION_PATTERN\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="exten" placeholder="{{\'APPLICATION_DESTINATION_PATTERN\' | translate}}" class="form-control" data-ng-model="route.exten" required/>\n								<span data-ng-show="(forms.general.exten.$touched || forms.general.$submitted) && forms.general.exten.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END EXTEN -->\n\n							<!-- START TAG -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.tag.$touched || forms.general.$submitted) && forms.general.tag.$invalid}">\n								<label class="control-label">{{\'APPLICATION_TAG\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="route.tag" name="tag" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n									<ui-select-choices repeat="tag.name as tag in tags | filter: $select.search">\n										<div ng-bind-html="tag.name | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span data-ng-show="(forms.general.tag.$touched || forms.general.$submitted) && forms.general.tag.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END TAG -->\n\n							<!-- START CONTEXT -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.context.$touched || forms.general.$submitted) && forms.general.context.$invalid}">\n								<label class="control-label">{{\'APPLICATION_CONTEXT\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="route.context" name="context" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n									<ui-select-choices repeat="context.name as context in voiceContexts | filter: $select.search">\n										<div ng-bind-html="context.name | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_VOICE_CONTEXT\' | translate }}\n								</span>\n								<span data-ng-show="(forms.general.context.$touched || forms.general.$submitted) && forms.general.context.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END CONTEXT -->\n\n							<!-- START RECORD -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.record.$touched || forms.general.$submitted) && forms.general.record.$invalid}">\n								<label class="control-label">{{\'APPLICATION_RECORDING\' | translate}}</label></br>\n								<input\n								    bs-switch\n										class="form-control"\n								    ng-model="route.record"\n								    type="checkbox"\n								    switch-active="{{ recordSwitch.isActive }}"\n								    switch-on-text="{{ recordSwitch.onText }}"\n								    switch-off-text="{{ recordSwitch.offText }}"\n								    switch-on-color="{{ recordSwitch.onColor }}"\n								    switch-off-color="{{ recordSwitch.offColor }}"\n								    switch-animate="{{ recordSwitch.animate }}"\n								    switch-size="{{ recordSwitch.size }}"\n								    switch-label="{{ recordSwitch.label }}"\n								    switch-icon="{{ recordSwitch.icon }}"\n								    switch-radio-off="{{ recordSwitch.radioOff }}"\n								    switch-label-width="{{ recordSwitch.labelWidth }}"\n								    switch-handle-width="{{ recordSwitch.handleWidth }}">\n								<span data-ng-show="(forms.general.record.$touched || forms.general.$submitted) && forms.general.record.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END RECORD -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="route.description"/></textarea>\n							</div>\n							<!-- END DESCRIPTION -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END GENERAL TAB -->\n\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/channels/voice/route/view.application.html",'\n<div class="row" data-ng-init="initApplication(true); getIntervals();">\n	<div class="col-md-12">\n		<!-- BEGIN  PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-notebook font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_NEW_APPLICATION\' | translate }} WIZARD</a> </span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<wizard on-finish="addApplication()">\n					<div class="profile-usertitle-name">\n						{{(main.app | capitalize) || \'Application\'}}\n					</div>\n	        <wz-step title="{{\'APPLICATION_APPLICATION\' | translate}}" canexit="formValidation(forms.settings.$valid)">\n							<form name="forms.settings" novalidate>\n								<button class="btn green-haze" type="submit" ng-click="goNext()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n									<!-- START APP -->\n									<div class="form-group"  data-ng-class="{\'has-error\': (forms.settings.app.$touched || forms.settings.$submitted) && forms.settings.app.$invalid}">\n										<label class="control-label">{{ \'APPLICATION_APPLICATION\' | translate }}<span class="required" aria-required="true">*</span></label>\n										<ui-select data-ng-model="main.app" name="app" theme="bootstrap" required>\n					            <ui-select-match placeholder="{{ \'APPLICATION_APPLICATION\' | translate }}">{{$select.selected.name}}</ui-select-match>\n					            <ui-select-choices repeat="app.value as app in $application.applications| filter: $select.search">\n					              <div ng-bind-html="app.name | highlight: $select.search"></div>\n					            </ui-select-choices>\n					          </ui-select>\n										<span data-ng-show="(forms.settings.app.$touched || forms.settings.$submitted) && forms.settings.app.$invalid && forms.settings.app.$error.required" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<!-- END APP -->\n\n									<div id="Queue" class="app-settings" ng-slide-down="main.app == \'Queue\'" lazy-render duration="1">\n										<!-- START QUEUE -->\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.queue.$touched || forms.settings.$submitted) && forms.settings.queue.$invalid}">\n											<label class="control-label">{{\'APPLICATION_QUEUE\' | translate}}<span class="required" aria-required="true">*</span></label>\n											<ui-select data-ng-model="application.appdata[0]" data-ng-init="application.appdata[0] = null" name="queue" theme="bootstrap" required data-ng-disabled="!items.length">\n												<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n												<ui-select-choices repeat="queue.name as queue in items | filter: $select.search">\n													<div ng-bind-html="queue.name | highlight: $select.search"></div>\n												</ui-select-choices>\n											</ui-select>\n											<div class="note note-warning" data-ng-hide="items.length">\n												<h4 class="block">Warning!</h4>\n												<p>\n													{{ \'MESSAGE_NO_QUEUES_AVAILABLE\' | translate }}\n												</p>\n												<p>\n													{{\'APPLICATION_GO_TO\' | translate}} <a href="/channels/voice/queues/list">{{\'APPLICATION_QUEUES\' | translate}}</a>\n												</p>\n											</div>\n											<span data-ng-show="(forms.settings.queue.$touched || forms.settings.$submitted) && forms.settings.queue.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END QUEUE -->\n\n										<!-- START OPTIONS -->\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.app_options.$touched || forms.settings.$submitted) && forms.settings.app_options.$invalid}">\n											<label class="control-label">{{\'APPLICATION_OPTIONS\' | translate}}</label>\n											<input type="text" name="app_options" placeholder="{{ \'APPLICATION_OPTIONS\' | translate }}" class="form-control" data-ng-model="application.appdata[1]" data-ng-init="application.appdata[1] = null">\n											<span data-ng-show="(forms.settings.app_options.$touched || forms.settings.$submitted) && forms.settings.app_options.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END OPTIONS -->\n										<!-- START URL -->\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.url.$touched || forms.settings.$submitted) && forms.settings.url.$invalid}">\n											<label class="control-label">{{ \'APPLICATION_URL\' | translate }}</label>\n											<input type="text" name="url" placeholder="{{ \'APPLICATION_URL\' | translate }}" class="form-control" data-ng-model="application.appdata[2]" data-ng-init="application.appdata[2] = null">\n											<span data-ng-show="(forms.settings.url.$touched || forms.settings.$submitted) && forms.settings.url.$invalid && forms.settings.url.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END URL -->\n\n										<!-- START AUDIOFILE -->\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.audiofile.$touched || forms.settings.$submitted) && forms.settings.audiofile.$invalid}">\n											<label class="control-label">{{\'APPLICATION_AUDIO_FILE\' | translate}}</label>\n											<ui-select data-ng-model="application.appdata[3]" data-ng-init="application.appdata[3] = null" name="audiofile" theme="bootstrap" data-ng-disabled="!items2.length">\n												<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n												<ui-select-choices repeat="soundPath+\'/\'+audio.save_name as audio in items2 | filter: $select.search">\n													<div ng-bind-html="audio.display_name | highlight: $select.search"></div>\n												</ui-select-choices>\n											</ui-select>\n											<div class="note note-warning" data-ng-hide="items2.length">\n												<h4 class="block">Warning!</h4>\n												<p>\n													{{ \'MESSAGE_NO_SOUNDS_AVAILABLE\' | translate }}\n												</p>\n												<p>\n													{{\'APPLICATION_GO_TO\' | translate}} <a href="/tools/sounds/list">{{\'APPLICATION_SOUNDS\' | translate}}</a>\n												</p>\n											</div>\n											<span data-ng-show="(forms.settings.audiofile.$touched || forms.settings.$submitted) && forms.settings.audiofile.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END AUDIOFILE -->\n\n										<!-- START TIMEOUT -->\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid}">\n											<label class="control-label">{{ \'APPLICATION_TIMEOUT\' | translate }}</label>\n											<input type="text" pattern="[0-9]+" name="timeout" placeholder="" class="form-control" data-ng-model="application.appdata[4]" data-ng-init="application.appdata[4] = null">\n											<span data-ng-show="(forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid && forms.settings.timeout.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END TIMEOUT -->\n\n									</div>\n									<div id="Playback" class="app-settings" ng-slide-down="main.app == \'Playback\'" lazy-render duration="1">\n										<!-- START AUDIOFILE -->\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.audiofile.$touched || forms.settings.$submitted) && forms.settings.audiofile.$invalid}">\n											<label class="control-label">{{\'APPLICATION_AUDIO_FILE\' | translate}}<span class="required" aria-required="true">*</span></label>\n											<ui-select data-ng-model="application.appdata[0]" data-ng-init="application.appdata[0] = null" name="audiofile" theme="bootstrap" required data-ng-disabled="!items.length">\n												<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n												<ui-select-choices repeat="soundPath+\'/\'+audio.save_name as audio in items | filter: $select.search">\n													<div ng-bind-html="audio.display_name | highlight: $select.search"></div>\n												</ui-select-choices>\n											</ui-select>\n											<div class="note note-warning" data-ng-hide="items.length">\n												<h4 class="block">Warning!</h4>\n												<p>\n													{{ \'MESSAGE_NO_SOUNDS_AVAILABLE\' | translate }}\n												</p>\n												<p>\n													{{\'APPLICATION_GO_TO\' | translate}} <a href="/tools/sounds/list">{{\'APPLICATION_SOUNDS\' | translate}}</a>\n												</p>\n											</div>\n											<span data-ng-show="(forms.settings.audiofile.$touched || forms.settings.$submitted) && forms.settings.audiofile.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END AUDIOFILE -->\n\n										<!-- START OPTIONS -->\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.app_options.$touched || forms.settings.$submitted) && forms.settings.app_options.$invalid}">\n											<label class="control-label">{{\'APPLICATION_OPTIONS\' | translate}}</label>\n											<input type="text" name="app_options" placeholder="{{ \'APPLICATION_OPTIONS\' | translate }}" class="form-control" data-ng-model="application.appdata[1]" data-ng-init="application.appdata[1] = null">\n											<span data-ng-show="(forms.settings.app_options.$touched || forms.settings.$submitted) && forms.settings.app_options.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END OPTIONS -->\n									</div>\n									<div id="Dial" class="app-settings" ng-slide-down="main.app == \'Dial\'" lazy-render duration="1">\n										<!-- START INTERFACE -->\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.interface.$touched || forms.settings.$submitted) && forms.settings.interface.$invalid}">\n											<label class="control-label">{{ \'APPLICATION_TYPE\' | translate }}/{{ \'APPLICATION_IDENTIFIER\' | translate }}<span class="required" aria-required="true">*</span></label>\n											<input type="text" name="interface" placeholder="SIP/0000" class="form-control" data-ng-model="application.appdata[0]" data-ng-init="application.appdata[0] = null" required>\n											<span data-ng-show="(forms.settings.interface.$touched || forms.settings.$submitted) && forms.settings.interface.$invalid && forms.settings.interface.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END INTERFACE -->\n\n										<!-- START TIMEOUT -->\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid}">\n											<label class="control-label">{{ \'APPLICATION_TIMEOUT\' | translate }}</label>\n											<input type="text" pattern="[0-9]+" name="timeout" placeholder="" class="form-control" data-ng-model="application.appdata[1]" data-ng-init="application.appdata[1] = null">\n											<span data-ng-show="(forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid && forms.settings.timeout.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END TIMEOUT -->\n\n										<!-- START OPTIONS -->\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.app_options.$touched || forms.settings.$submitted) && forms.settings.app_options.$invalid}">\n											<label class="control-label">{{ \'APPLICATION_OPTIONS\' | translate }}</label>\n											<input type="text" name="app_options" placeholder="" class="form-control" data-ng-model="application.appdata[2]" data-ng-init="application.appdata[2] = null">\n											<span data-ng-show="(forms.settings.app_options.$touched || forms.settings.$submitted) && forms.settings.app_options.$invalid && forms.settings.app_options.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END OPTIONS -->\n\n										<!-- START URL -->\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.url.$touched || forms.settings.$submitted) && forms.settings.url.$invalid}">\n											<label class="control-label">{{ \'APPLICATION_URL\' | translate }}</label>\n											<input type="text" name="url" placeholder="{{ \'APPLICATION_URL\' | translate }}" class="form-control" data-ng-model="application.appdata[3]" data-ng-init="application.appdata[3] = null">\n											<span data-ng-show="(forms.settings.url.$touched || forms.settings.$submitted) && forms.settings.url.$invalid && forms.settings.url.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END URL -->\n									</div>\n									<div id="AGI" class="app-settings" ng-slide-down="main.app == \'AGI\'" lazy-render duration="1">\n										<!-- START PROJECT -->\n										<input type="hidden" name="url" placeholder="{{ \'APPLICATION_URL\' | translate }}" class="form-control" data-ng-model="application.appdata[0]" data-ng-init="application.appdata[0] = \'agi://127.0.0.1/square\'">\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.project.$touched || forms.settings.$submitted) && forms.settings.project.$invalid}">\n											<label class="control-label">{{\'APPLICATION_PROJECT\' | translate}}<span class="required" aria-required="true">*</span></label>\n											<ui-select data-ng-model="application.appdata[1]" data-ng-init="application.appdata[1] = null" name="project" theme="bootstrap" required data-ng-disabled="!items.length">\n												<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n												<ui-select-choices repeat="project.name as project in items | filter: $select.search">\n													<div ng-bind-html="project.name | highlight: $select.search"></div>\n												</ui-select-choices>\n											</ui-select>\n											<div class="note note-warning" data-ng-hide="items.length">\n												<h4 class="block">Warning!</h4>\n												<p>\n													{{ \'MESSAGE_NO_PROJECTS_AVAILABLE\' | translate }}\n												</p>\n												<p>\n													{{\'APPLICATION_GO_TO\' | translate}} <a href="/square/projects/list">{{\'APPLICATION_PROJECTS\' | translate}}</a>\n												</p>\n											</div>\n											<span data-ng-show="(forms.settings.project.$touched || forms.settings.$submitted) && forms.settings.project.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END PROJECT -->\n\n									</div>\n									<div id="Goto" class="app-settings" ng-slide-down="main.app == \'Goto\'" lazy-render duration="1">\n										<!-- START CONTEXT -->\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.context.$touched || forms.settings.$submitted) && forms.settings.context.$invalid}">\n											<label class="control-label">{{\'APPLICATION_CONTEXT\' | translate}}<span class="required" aria-required="true">*</span></label>\n											<ui-select data-ng-model="application.appdata[0]" data-ng-init="application.appdata[0] = null" name="context" theme="bootstrap" required>\n												<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n												<ui-select-choices repeat="context.name as context in items | filter: $select.search">\n													<div ng-bind-html="context.name | highlight: $select.search"></div>\n												</ui-select-choices>\n											</ui-select>\n											<span data-ng-show="(forms.settings.context.$touched || forms.settings.$submitted) && forms.settings.context.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END CONTEXT -->\n\n										<!-- START EXTENSION -->\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.extension.$touched || forms.settings.$submitted) && forms.settings.extension.$invalid}">\n											<label class="control-label">{{ \'APPLICATION_EXTENSION\' | translate }}<span class="required" aria-required="true">*</span></label>\n											<input type="text" name="extension" placeholder="" class="form-control" data-ng-model="application.appdata[1]" data-ng-init="application.appdata[1] = null" required>\n											<span data-ng-show="(forms.settings.extension.$touched || forms.settings.$submitted) && forms.settings.extension.$invalid && forms.settings.extension.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END EXTENSION -->\n\n										<!-- START PRIORITY -->\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.priority.$touched || forms.settings.$submitted) && forms.settings.priority.$invalid}">\n											<label class="control-label">{{ \'APPLICATION_PRIORITY\' | translate }}<span class="required" aria-required="true">*</span></label>\n											<input type="text" pattern="[0-9]+" name="priority" placeholder="" class="form-control" data-ng-model="application.appdata[2]" data-ng-init="application.appdata[2] = null" required>\n											<span data-ng-show="(forms.settings.priority.$touched || forms.settings.$submitted) && forms.settings.priority.$invalid" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END PRIORITY -->\n									</div>\n									<div id="Hangup" class="app-settings" ng-slide-down="main.app == \'Hangup\'" lazy-render duration="1">\n										<!-- START HANGUPCAUSE -->\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.hangupCause.$touched || forms.settings.$submitted) && forms.settings.hangupCause.$invalid}">\n											<label class="control-label">{{\'APPLICATION_HANGUP_CAUSE\' | translate}}<span class="required" aria-required="true">*</span></label>\n											<ui-select data-ng-model="application.appdata[0]" data-ng-init="application.appdata[0] = null" theme="bootstrap" name="hangupCause" required>\n												<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name | translate}}</ui-select-match>\n												<ui-select-choices repeat="hangupCause.value as hangupCause in $application.hangupCauses | filter: $select.search">\n													<div ng-bind-html="hangupCause.name  | translate | highlight: $select.search"></div>\n												</ui-select-choices>\n											</ui-select>\n											<span data-ng-show="(forms.settings.hangupCause.$touched || forms.settings.$submitted) && forms.settings.hangupCause.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END HANGUPCAUSE -->\n									</div>\n									<div id="Set" class="app-settings" ng-slide-down="main.app == \'Set\'" lazy-render duration="1">\n										<!-- START VARIABLE -->\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.variable.$touched || forms.settings.$submitted) && forms.settings.variable.$invalid}">\n											<label class="control-label">{{ \'APPLICATION_VARIABLE\' | translate }}<span class="required" aria-required="true">*</span></label>\n											<input type="text" name="variable" placeholder="" class="form-control" data-ng-model="application.variable" data-ng-init="application.appdata[0] = null" data-ng-change="updateSetAppdata()" required>\n											<span data-ng-show="(forms.settings.variable.$touched || forms.settings.$submitted) && forms.settings.variable.$invalid && forms.settings.variable.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END VARIABLE -->\n\n										<!-- START VARVALUE -->\n										<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.varvalue.$touched || forms.settings.$submitted) && forms.settings.varvalue.$invalid}">\n											<label class="control-label">{{ \'APPLICATION_VALUE\' | translate }}<span class="required" aria-required="true">*</span></label>\n											<input type="text" name="varvalue" placeholder="" class="form-control" data-ng-model="application.value" data-ng-change="updateSetAppdata()" required>\n											<span data-ng-show="(forms.settings.varvalue.$touched || forms.settings.$submitted) && forms.settings.varvalue.$invalid && forms.settings.varvalue.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END VARVALUE -->\n									</div>\n									<div id="Custom" class="app-settings" ng-slide-down="main.app == \'custom\'" lazy-render duration="1">\n\n										<!-- START CUSTOMAPP -->\n										<div class="form-group"  data-ng-class="{\'has-error\': (forms.settings.customApp.$touched || forms.settings.$submitted) && forms.settings.customApp.$invalid}">\n											<label class="control-label">{{ \'APPLICATION_CUSTOM_APP\' | translate }}<span class="required" aria-required="true">*</span></label>\n											<input type="text" name="customApp" placeholder="{{ \'APPLICATION_CUSTOM_APP\' | translate }}" class="form-control" data-ng-model="application.app" required>\n											<span data-ng-show="(forms.settings.customApp.$touched || forms.settings.$submitted) && forms.settings.customApp.$invalid && forms.settings.customApp.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END CUSTOMAPP -->\n\n										<!-- START APPDATA -->\n										<div class="form-group"  data-ng-class="{\'has-error\': (forms.settings.appdata.$touched || forms.settings.$submitted) && forms.settings.appdata.$invalid}">\n											<label class="control-label">{{ \'APPLICATION_ARGUMENTS\' | translate }}</label>\n											<input type="text" name="appdata" placeholder="{{ \'APPLICATION_ARGUMENTS\' | translate }}" class="form-control" data-ng-model="application.appdata[0]" data-ng-init="application.appdata[0] = null">\n											<span data-ng-show="(forms.settings.appdata.$touched || forms.settings.$submitted) && forms.settings.appdata.$invalid && forms.settings.appdata.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END APPDATA -->\n									</div>\n									<div id="Voicemail" class="app-settings" ng-slide-down="main.app == \'Voicemail\'" lazy-render duration="1">\n										<!-- START VOICEMAIL -->\n										<div class="form-group"  data-ng-class="{\'has-error\': (forms.settings.voicemail.$touched || forms.settings.$submitted) && forms.settings.voicemail.$invalid}">\n											<label class="control-label">{{ \'APPLICATION_MAILBOX\' | translate }}@{{ \'APPLICATION_CONTEXT\' | translate }}<span class="required" aria-required="true">*</span></label>\n											<ui-select data-ng-model="application.appdata[0]" data-ng-init="application.appdata[0] = null" theme="bootstrap" name="voicemail" required data-ng-disabled="!items.length">\n												<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.mailbox}}</ui-select-match>\n												<ui-select-choices repeat="mailbox.mailbox+\'@\'+mailbox.context as mailbox in items | filter: $select.search">\n													<div ng-bind-html="mailbox.mailbox | highlight: $select.search"></div>\n												</ui-select-choices>\n											</ui-select>\n											<div class="note note-warning" data-ng-hide="items.length">\n												<h4 class="block">Warning!</h4>\n												<p>\n													{{ \'MESSAGE_NO_VOICEMAILS_AVAILABLE\' | translate }}\n												</p>\n												<p>\n													{{\'APPLICATION_GO_TO\' | translate}} <a href="/channels/voice/voicemails/list">{{\'APPLICATION_VOICEMAILS\' | translate}}</a>\n												</p>\n											</div>\n											<span data-ng-show="(forms.settings.voicemail.$touched || forms.settings.$submitted) && forms.settings.voicemail.$invalid && forms.settings.voicemail.$error.required" class="help-block help-block-error">\n												<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n											</span>\n										</div>\n										<!-- END VOICEMAIL -->\n									</div>\n									<button class="btn green-haze" type="submit" ng-click="goNext()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n								</form>\n								</wz-step>\n									<wz-step title="{{\'APPLICATION_INTERVAL\' | translate}}" canexit="formValidation(forms.interval.IntervalId.$valid || forms.interval.hasOwnProperty(\'t_from\') || forms.interval.intType.$modelValue === \'always\')">\n										<form name="forms.interval" novalidate>\n										<button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n										<button class="btn green-haze" type="submit" ng-click="goNext()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n									<!-- START INTERVAL_TYPE -->\n									<div class="form-group" data-ng-class="{\'has-error\': (forms.interval.intType.$touched || forms.interval.$submitted) && forms.interval.intType.$invalid}">\n										<label class="control-label">{{\'APPLICATION_INTERVAL_TYPE\' | translate}}<span class="required" aria-required="true">*</span></label>\n										<ui-select data-ng-model="interval.intType" theme="bootstrap" name="intType" required>\n											<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name | translate}}</ui-select-match>\n											<ui-select-choices repeat="intType.value as intType in $application.intTypes | filter: $select.search">\n												<div ng-bind-html="intType.name | translate | highlight: $select.search"></div>\n											</ui-select-choices>\n										</ui-select>\n										<span data-ng-show="(forms.interval.intType.$touched || forms.interval.$submitted) && forms.interval.intType.$error.required" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<!-- END INTERVAL_TYPE -->\n									<div id="customInterval" class="app-settings" ng-slide-down="interval.intType == \'custom\'" lazy-render duration="1">\n											<!-- START TIME -->\n											<div class="form-group">\n												<label class="control-label">{{ \'APPLICATION_TIME\' | translate }}</label>\n												<div class="input-group input-large">\n													<fieldset class="pull-left" ng-disabled="interval.alwaysTime"><uib-timepicker name="t_from" data-ng-model="interval.t_from" show-meridian="false" show-spinners="false"></uib-timepicker></fieldset>\n													<div class="input-group-addon col-md-1 interval-to pull-left">to</div>\n													<fieldset ng-disabled="interval.alwaysTime"><uib-timepicker  name="t_to" data-ng-model="interval.t_to" show-meridian="false" show-spinners="false"></uib-timepicker></fieldset>\n													<label class="control-label pointer-cursor"><input type="checkbox" data-ng-model="interval.alwaysTime">{{\'APPLICATION_ALWAYS\' | translate}}</label>\n												</div>\n											</div>\n											<!-- END TIME -->\n\n											<!-- START WEEKDAY -->\n											<div class="form-group">\n												<label class="control-label">{{ \'APPLICATION_WEEKDAY\' | translate }}</label>\n												<div class="input-group input-large">\n													<ui-select data-ng-model="interval.wd_from" theme="bootstrap" name="wd_from">\n														<ui-select-match placeholder="">{{$translate.instant($select.selected.name)}}</ui-select-match>\n														<ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n															{{$translate.instant(weekDay.name)}}\n														</ui-select-choices>\n													</ui-select>\n													<span class="input-group-addon">to</span>\n													<ui-select data-ng-model="interval.wd_to" theme="bootstrap" name="wd_to">\n														<ui-select-match placeholder="">{{$translate.instant($select.selected.name)}}</ui-select-match>\n														<ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n															{{$translate.instant(weekDay.name)}}\n														</ui-select-choices>\n													</ui-select>\n												</div>\n											</div>\n											<!-- END WEEKDAY -->\n\n											<!-- START MONTHDAY -->\n											<div class="form-group">\n												<label class="control-label">{{ \'APPLICATION_MONTHDAY\' | translate }}</label>\n												<div class="input-group input-large">\n													<ui-select data-ng-model="interval.md_from" theme="bootstrap" name="md_from">\n														<ui-select-match>{{$select.selected}}</ui-select-match>\n														<ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n															{{monthDay}}\n														</ui-select-choices>\n													</ui-select>\n													<span class="input-group-addon">to</span>\n													<ui-select data-ng-model="interval.md_to" theme="bootstrap" name="md_to">\n														<ui-select-match>{{$select.selected}}</ui-select-match>\n														<ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n															{{monthDay}}\n														</ui-select-choices>\n													</ui-select>\n												</div>\n											</div>\n											<!-- END MONTHDAY -->\n\n											<!-- START MONTH -->\n											<div class="form-group">\n												<label class="control-label">{{ \'APPLICATION_MONTH\' | translate }}</label>\n												<div class="input-group input-large">\n													<ui-select data-ng-model="interval.m_from" theme="bootstrap" name="m_from">\n														<ui-select-match placeholder="">{{$translate.instant($select.selected.name)}}</ui-select-match>\n														<ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n															{{$translate.instant(month.name)}}\n														</ui-select-choices>\n													</ui-select>\n													<span class="input-group-addon">to</span>\n													<ui-select data-ng-model="interval.m_to" theme="bootstrap" name="m_to">\n														<ui-select-match placeholder="">{{$translate.instant($select.selected.name)}}</ui-select-match>\n														<ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n															{{$translate.instant(month.name)}}\n														</ui-select-choices>\n													</ui-select>\n												</div>\n											</div>\n											<!-- END MONTH -->\n							</div>\n\n							<div id="customInterval" class="app-settings" ng-slide-down="interval.intType == \'list\'" lazy-render duration="1">\n\n								<!-- START INTERVALS -->\n								<div class="form-group" data-ng-class="{\'has-error\': (forms.interval.IntervalId.$touched || forms.interval.$submitted) && forms.interval.IntervalId.$invalid}">\n									<label class="control-label">{{\'APPLICATION_INTERVALS\' | translate}}<span class="required" aria-required="true">*</span></label>\n									<ui-select data-ng-model="interval.IntervalId" theme="bootstrap" name="IntervalId" required>\n										<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$translate.instant($select.selected.name)}}</ui-select-match>\n										<ui-select-choices repeat="interval.id as interval in Intervals | filter: $select.search">\n											{{$translate.instant(interval.name)}}\n										</ui-select-choices>\n									</ui-select>\n									<span data-ng-show="(forms.interval.IntervalId.$touched || forms.interval.$submitted) && forms.interval.IntervalId.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END INTERVALS -->\n\n							</div>\n								<button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n								<button class="btn green-haze" type="submit" ng-click="goNext()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n							</form>\n						</wz-step>\n\n						<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n							<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n							<button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n							<input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n						</wz-step>\n				</wizard>\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n<!-- <pre>\n	{{application | json}}\n</pre>\n<pre>\n	{{interval | json}}\n</pre> -->\n'),
-a.put("app/channels/voice/route/view.applicationSettings.html",'\n<div class="row" data-ng-init="initApplication();getIntervals();getApplication();">\n	<div class="col-md-12">\n		<!-- BEGIN  PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-notebook font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_APPLICATION_SETTINGS\' | translate }} WIZARD</a> </span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<wizard on-finish="updateRoute(\'applications\')">\n					<div class="profile-usertitle-name">\n						{{(main.app | capitalize) || \'Application\'}}\n					</div>\n	        <wz-step title="{{\'APPLICATION_APPLICATION\' | translate}}" canexit="formValidation(forms.settings.$valid)">\n							<form name="forms.settings" novalidate>\n\n								<button class="btn green-haze" type="submit" ng-click="goNext()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n								<div id="Queue" class="app-settings" ng-slide-down="main.app == \'Queue\'" lazy-render duration="1">\n									<!-- START QUEUE -->\n									<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.queue.$touched || forms.settings.$submitted) && forms.settings.queue.$invalid}">\n										<label class="control-label">{{\'APPLICATION_QUEUE\' | translate}}<span class="required" aria-required="true">*</span></label>\n										<ui-select data-ng-model="route.Applications[selectedApp].appdata[0]" name="queue" theme="bootstrap" required data-ng-disabled="!items.length">\n											<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n											<ui-select-choices repeat="queue.name as queue in items | filter: $select.search">\n												<div ng-bind-html="queue.name | highlight: $select.search"></div>\n											</ui-select-choices>\n										</ui-select>\n										<div class="note note-warning" data-ng-hide="items.length">\n											<h4 class="block">Warning!</h4>\n											<p>\n												{{ \'MESSAGE_NO_QUEUES_AVAILABLE\' | translate }}\n											</p>\n											<p>\n												{{\'APPLICATION_GO_TO\' | translate}} <a href="/channels/voice/queues/list">{{\'APPLICATION_QUEUES\' | translate}}</a>\n											</p>\n										</div>\n										<span data-ng-show="(forms.settings.queue.$touched || forms.settings.$submitted) && forms.settings.queue.$error.required" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<!-- END QUEUE -->\n\n									<!-- START OPTIONS -->\n									<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.app_options.$touched || forms.settings.$submitted) && forms.settings.app_options.$invalid}">\n										<label class="control-label">{{\'APPLICATION_OPTIONS\' | translate}}</label>\n										<ui-select multiple data-ng-model="route.Applications[selectedApp].appdata[1]" theme="bootstrap" name="app_options">\n											<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$translate.instant($item.name)}}</ui-select-match>\n											<ui-select-choices repeat="queueOpt.value as queueOpt in $application.queueOptions | filter: $select.search">\n												{{$translate.instant(queueOpt.name)}}\n											</ui-select-choices>\n										</ui-select>\n										<span data-ng-show="(forms.settings.app_options.$touched || forms.settings.$submitted) && forms.settings.app_options.$error.required" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<!-- END OPTIONS -->\n\n									<!-- START URL -->\n									<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.url.$touched || forms.settings.$submitted) && forms.settings.url.$invalid}">\n										<label class="control-label">{{ \'APPLICATION_URL\' | translate }}</label>\n										<input type="text" name="url" placeholder="{{ \'APPLICATION_URL\' | translate }}" class="form-control" data-ng-model="route.Applications[selectedApp].appdata[2]">\n										<span data-ng-show="(forms.settings.url.$touched || forms.settings.$submitted) && forms.settings.url.$invalid && forms.settings.url.$error.required" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<!-- END URL -->\n\n									<!-- START AUDIOFILE -->\n									<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.audiofile.$touched || forms.settings.$submitted) && forms.settings.audiofile.$invalid}">\n										<label class="control-label">{{\'APPLICATION_AUDIO_FILE\' | translate}}</label>\n										<ui-select data-ng-model="route.Applications[selectedApp].appdata[3]" name="audiofile" theme="bootstrap" data-ng-disabled="!items2.length">\n											<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n											<ui-select-choices repeat="soundPath+\'/\'+audio.save_name as audio in items2 | filter: $select.search">\n												<div ng-bind-html="audio.display_name | highlight: $select.search"></div>\n											</ui-select-choices>\n										</ui-select>\n										<div class="note note-warning" data-ng-hide="items2.length">\n											<h4 class="block">Warning!</h4>\n											<p>\n												{{ \'MESSAGE_NO_SOUNDS_AVAILABLE\' | translate }}\n											</p>\n											<p>\n												{{\'APPLICATION_GO_TO\' | translate}} <a href="/tools/sounds/list">{{\'APPLICATION_SOUNDS\' | translate}}</a>\n											</p>\n										</div>\n										<span data-ng-show="(forms.settings.audiofile.$touched || forms.settings.$submitted) && forms.settings.audiofile.$error.required" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<!-- END AUDIOFILE -->\n\n									<!-- START TIMEOUT -->\n									<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid}">\n										<label class="control-label">{{ \'APPLICATION_TIMEOUT\' | translate }}</label>\n										<input type="text" pattern="[0-9]+" name="timeout" placeholder="" class="form-control" data-ng-model="route.Applications[selectedApp].appdata[4]">\n										<span data-ng-show="(forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid && forms.settings.timeout.$error.required" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<!-- END TIMEOUT -->\n\n								</div>\n								<div id="Playback" class="app-settings" ng-slide-down="main.app == \'Playback\'" lazy-render duration="1">\n									<!-- START AUDIOFILE -->\n									<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.audiofile.$touched || forms.settings.$submitted) && forms.settings.audiofile.$invalid}">\n										<label class="control-label">{{\'APPLICATION_AUDIO_FILE\' | translate}}<span class="required" aria-required="true">*</span></label>\n										<ui-select data-ng-model="route.Applications[selectedApp].appdata[0]" name="audiofile" theme="bootstrap" required data-ng-disabled="!items.length">\n											<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n											<ui-select-choices repeat="soundPath+\'/\'+audio.save_name as audio in items | filter: $select.search">\n												<div ng-bind-html="audio.display_name | highlight: $select.search"></div>\n											</ui-select-choices>\n										</ui-select>\n										<div class="note note-warning" data-ng-hide="items.length">\n											<h4 class="block">Warning!</h4>\n											<p>\n												{{ \'MESSAGE_NO_SOUNDS_AVAILABLE\' | translate }}\n											</p>\n											<p>\n												{{\'APPLICATION_GO_TO\' | translate}} <a href="/tools/sounds/list">{{\'APPLICATION_SOUNDS\' | translate}}</a>\n											</p>\n										</div>\n										<span data-ng-show="(forms.settings.audiofile.$touched || forms.settings.$submitted) && forms.settings.audiofile.$error.required" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<!-- END AUDIOFILE -->\n\n									<!-- START OPTIONS -->\n									<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.app_options.$touched || forms.settings.$submitted) && forms.settings.app_options.$invalid}">\n										<label class="control-label">{{\'APPLICATION_OPTIONS\' | translate}}</label>\n										<ui-select data-ng-model="route.Applications[selectedApp].appdata[1]" theme="bootstrap" name="app_options">\n											<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$translate.instant($select.selected.name)}}</ui-select-match>\n											<ui-select-choices repeat="audioOpt.value as audioOpt in $application.audioOptions | filter: $select.search">\n												{{$translate.instant(audioOpt.name)}}\n											</ui-select-choices>\n										</ui-select>\n										<span data-ng-show="(forms.settings.app_options.$touched || forms.settings.$submitted) && forms.settings.app_options.$error.required" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<!-- END OPTIONS -->\n								</div>\n								<div id="Dial" class="app-settings" ng-slide-down="main.app == \'Dial\'" lazy-render duration="1">\n									<!-- START INTERFACE -->\n									<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.interface.$touched || forms.settings.$submitted) && forms.settings.interface.$invalid}">\n										<label class="control-label">{{ \'APPLICATION_TYPE\' | translate }}/{{ \'APPLICATION_IDENTIFIER\' | translate }}<span class="required" aria-required="true">*</span></label>\n										<input type="text" name="interface" placeholder="SIP/0000" class="form-control" data-ng-model="route.Applications[selectedApp].appdata[0]" required>\n										<span data-ng-show="(forms.settings.interface.$touched || forms.settings.$submitted) && forms.settings.interface.$invalid && forms.settings.interface.$error.required" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<!-- END INTERFACE -->\n\n									<!-- START TIMEOUT -->\n									<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid}">\n										<label class="control-label">{{ \'APPLICATION_TIMEOUT\' | translate }}</label>\n										<input type="text" pattern="[0-9]+" name="timeout" placeholder="" class="form-control" data-ng-model="route.Applications[selectedApp].appdata[1]">\n										<span data-ng-show="(forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid && forms.settings.timeout.$error.required" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<!-- END TIMEOUT -->\n\n									<!-- START OPTIONS -->\n									<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.app_options.$touched || forms.settings.$submitted) && forms.settings.app_options.$invalid}">\n										<label class="control-label">{{ \'APPLICATION_OPTIONS\' | translate }}</label>\n										<input type="text" name="app_options" placeholder="" class="form-control" data-ng-model="route.Applications[selectedApp].appdata[2]">\n										<span data-ng-show="(forms.settings.app_options.$touched || forms.settings.$submitted) && forms.settings.app_options.$invalid && forms.settings.app_options.$error.required" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<!-- END OPTIONS -->\n\n									<!-- START URL -->\n									<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.url.$touched || forms.settings.$submitted) && forms.settings.url.$invalid}">\n										<label class="control-label">{{ \'APPLICATION_URL\' | translate }}</label>\n										<input type="text" name="url" placeholder="{{ \'APPLICATION_URL\' | translate }}" class="form-control" data-ng-model="route.Applications[selectedApp].appdata[3]">\n										<span data-ng-show="(forms.settings.url.$touched || forms.settings.$submitted) && forms.settings.url.$invalid && forms.settings.url.$error.required" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<!-- END URL -->\n								</div>\n								<div id="AGI" class="app-settings" ng-slide-down="main.app == \'AGI\'" lazy-render duration="1">\n									<!-- START PROJECT -->\n									<input type="hidden" name="url" placeholder="{{ \'APPLICATION_URL\' | translate }}" class="form-control" data-ng-model="route.Applications[selectedApp].appdata[0]" data-ng-init="route.Applications[selectedApp].appdata[0] = \'agi://127.0.0.1/square\'">\n									<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.project.$touched || forms.settings.$submitted) && forms.settings.project.$invalid}">\n										<label class="control-label">{{\'APPLICATION_PROJECT\' | translate}}<span class="required" aria-required="true">*</span></label>\n										<ui-select data-ng-model="route.Applications[selectedApp].appdata[1]" name="project" theme="bootstrap" required data-ng-disabled="!items.length">\n											<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n											<ui-select-choices repeat="project.name as project in items | filter: $select.search">\n												<div ng-bind-html="project.name | highlight: $select.search"></div>\n											</ui-select-choices>\n										</ui-select>\n										<div class="note note-warning" data-ng-hide="items.length">\n											<h4 class="block">Warning!</h4>\n											<p>\n												{{ \'MESSAGE_NO_PROJECTS_AVAILABLE\' | translate }}\n											</p>\n											<p>\n												{{\'APPLICATION_GO_TO\' | translate}} <a href="/square/projects/list">{{\'APPLICATION_PROJECTS\' | translate}}</a>\n											</p>\n										</div>\n										<span data-ng-show="(forms.settings.project.$touched || forms.settings.$submitted) && forms.settings.project.$error.required" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<!-- END PROJECT -->\n\n									<!-- START URL -->\n									<!-- <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.url.$touched || forms.settings.$submitted) && forms.settings.url.$invalid}">\n										<label class="control-label">{{ \'APPLICATION_URL\' | translate }}</label>\n										<div class="input-group">\n											<input type="text" name="url" placeholder="agi://127.0.0.1/square" class="form-control" data-ng-model="application.url" data-ng-disabled="!application.urlEnabled" data-ng-required="application.urlEnabled" rpattern="/^agi:\\/\\/(?:[0-9]{1,3}\\.){3}[0-9]{1,3}\\/square$/">\n											<span class="input-group-addon">\n												<input type="checkbox" data-ng-model="application.urlEnabled">\n											</span>\n										</div>\n										<span data-ng-show="(forms.settings.url.$touched || forms.settings.$submitted) && forms.settings.url.$invalid && forms.settings.url.$error.required" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n										<span data-ng-show="(forms.settings.url.$touched || forms.settings.$submitted) && forms.settings.url.$invalid && forms.settings.url.$error.pattern" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_WRONG_FORMAT\' | translate}}.\n										</span>\n									</div> -->\n									<!-- END URL -->\n\n								</div>\n								<div id="Goto" class="app-settings" ng-slide-down="main.app == \'Goto\'" lazy-render duration="1">\n									<!-- START CONTEXT -->\n									<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.context.$touched || forms.settings.$submitted) && forms.settings.context.$invalid}">\n										<label class="control-label">{{\'APPLICATION_CONTEXT\' | translate}}<span class="required" aria-required="true">*</span></label>\n										<ui-select data-ng-model="route.Applications[selectedApp].appdata[0]" name="context" theme="bootstrap" required>\n											<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n											<ui-select-choices repeat="context.name as context in items | filter: $select.search">\n												<div ng-bind-html="context.name | highlight: $select.search"></div>\n											</ui-select-choices>\n										</ui-select>\n										<span data-ng-show="(forms.settings.context.$touched || forms.settings.$submitted) && forms.settings.context.$error.required" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<!-- END CONTEXT -->\n\n									<!-- START EXTENSION -->\n									<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.extension.$touched || forms.settings.$submitted) && forms.settings.extension.$invalid}">\n										<label class="control-label">{{ \'APPLICATION_EXTENSION\' | translate }}<span class="required" aria-required="true">*</span></label>\n										<input type="text" name="extension" placeholder="" class="form-control" data-ng-model="route.Applications[selectedApp].appdata[1]" required>\n										<span data-ng-show="(forms.settings.extension.$touched || forms.settings.$submitted) && forms.settings.extension.$invalid && forms.settings.extension.$error.required" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<!-- END EXTENSION -->\n\n									<!-- START PRIORITY -->\n									<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.priority.$touched || forms.settings.$submitted) && forms.settings.priority.$invalid}">\n										<label class="control-label">{{ \'APPLICATION_PRIORITY\' | translate }}<span class="required" aria-required="true">*</span></label>\n										<input type="text" pattern="[0-9]+" name="priority" placeholder="" class="form-control" data-ng-model="route.Applications[selectedApp].appdata[2]" required>\n										<span data-ng-show="(forms.settings.priority.$touched || forms.settings.$submitted) && forms.settings.priority.$invalid" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<!-- END PRIORITY -->\n								</div>\n								<div id="Hangup" class="app-settings" ng-slide-down="main.app == \'Hangup\'" lazy-render duration="1">\n									<!-- START HANGUPCAUSE -->\n									<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.hangupCause.$touched || forms.settings.$submitted) && forms.settings.hangupCause.$invalid}">\n										<label class="control-label">{{\'APPLICATION_HANGUP_CAUSE\' | translate}}<span class="required" aria-required="true">*</span></label>\n										<ui-select data-ng-model="route.Applications[selectedApp].appdata[0]" theme="bootstrap" name="hangupCause" required>\n											<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$translate.instant($select.selected.name)}}</ui-select-match>\n											<ui-select-choices repeat="hangupCause.value as hangupCause in $application.hangupCauses | filter: $select.search">\n												{{$translate.instant(hangupCause.name)}}\n											</ui-select-choices>\n										</ui-select>\n										<span data-ng-show="(forms.settings.hangupCause.$touched || forms.settings.$submitted) && forms.settings.hangupCause.$error.required" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<!-- END HANGUPCAUSE -->\n								</div>\n								<div id="Set" class="app-settings" ng-slide-down="main.app == \'Set\'" lazy-render duration="1">\n									<!-- START VARIABLE -->\n									<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.variable.$touched || forms.settings.$submitted) && forms.settings.variable.$invalid}">\n										<label class="control-label">{{ \'APPLICATION_VARIABLE\' | translate }}<span class="required" aria-required="true">*</span></label>\n										<input type="text" name="variable" placeholder="" class="form-control" data-ng-model="application.variable" data-ng-change="updateSetAppdataSettings()" required>\n										<span data-ng-show="(forms.settings.variable.$touched || forms.settings.$submitted) && forms.settings.variable.$invalid && forms.settings.variable.$error.required" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<!-- END VARIABLE -->\n\n									<!-- START VARVALUE -->\n									<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.varvalue.$touched || forms.settings.$submitted) && forms.settings.varvalue.$invalid}">\n										<label class="control-label">{{ \'APPLICATION_VALUE\' | translate }}<span class="required" aria-required="true">*</span></label>\n										<input type="text" name="varvalue" placeholder="" class="form-control" data-ng-model="application.value" data-ng-change="updateSetAppdataSettings()" required>\n										<span data-ng-show="(forms.settings.varvalue.$touched || forms.settings.$submitted) && forms.settings.varvalue.$invalid && forms.settings.varvalue.$error.required" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<!-- END VARVALUE -->\n								</div>\n								<div id="Custom" class="app-settings" ng-slide-down="main.app == \'custom\'" lazy-render duration="1">\n\n									<!-- START CUSTOMAPP -->\n									<div class="form-group"  data-ng-class="{\'has-error\': (forms.settings.customApp.$touched || forms.settings.$submitted) && forms.settings.customApp.$invalid}">\n										<label class="control-label">{{ \'APPLICATION_CUSTOM_APP\' | translate }}<span class="required" aria-required="true">*</span></label>\n										<input type="text" name="customApp" placeholder="{{ \'APPLICATION_CUSTOM_APP\' | translate }}" class="form-control" data-ng-model="route.Applications[selectedApp].app" required>\n										<span data-ng-show="(forms.settings.customApp.$touched || forms.settings.$submitted) && forms.settings.customApp.$invalid && forms.settings.customApp.$error.required" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<!-- END CUSTOMAPP -->\n\n									<!-- START APPDATA -->\n									<div class="form-group"  data-ng-class="{\'has-error\': (forms.settings.appdata.$touched || forms.settings.$submitted) && forms.settings.appdata.$invalid}">\n										<label class="control-label">{{ \'APPLICATION_ARGUMENTS\' | translate }}</label>\n										<input type="text" name="appdata" placeholder="{{ \'APPLICATION_ARGUMENTS\' | translate }}" class="form-control" data-ng-model="route.Applications[selectedApp].appdata[0]">\n										<span data-ng-show="(forms.settings.appdata.$touched || forms.settings.$submitted) && forms.settings.appdata.$invalid && forms.settings.appdata.$error.required" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<!-- END APPDATA -->\n								</div>\n								<div id="Voicemail" class="app-settings" ng-slide-down="main.app == \'Voicemail\'" lazy-render duration="1">\n									<!-- START VOICEMAIL -->\n									<div class="form-group"  data-ng-class="{\'has-error\': (forms.settings.voicemail.$touched || forms.settings.$submitted) && forms.settings.voicemail.$invalid}">\n										<label class="control-label">{{ \'APPLICATION_MAILBOX\' | translate }}@{{ \'APPLICATION_CONTEXT\' | translate }}<span class="required" aria-required="true">*</span></label>\n										<ui-select data-ng-model="route.Applications[selectedApp].appdata[0]" theme="bootstrap" name="voicemail" required data-ng-disabled="!items.length">\n											<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.mailbox}}</ui-select-match>\n											<ui-select-choices repeat="mailbox.mailbox+\'@\'+mailbox.context as mailbox in items | filter: $select.search">\n												<div ng-bind-html="mailbox.mailbox | highlight: $select.search"></div>\n											</ui-select-choices>\n										</ui-select>\n										<div class="note note-warning" data-ng-hide="items.length">\n											<h4 class="block">Warning!</h4>\n											<p>\n												{{ \'MESSAGE_NO_VOICEMAILS_AVAILABLE\' | translate }}\n											</p>\n											<p>\n												{{\'APPLICATION_GO_TO\' | translate}} <a href="/channels/voice/voicemails/list">{{\'APPLICATION_VOICEMAILS\' | translate}}</a>\n											</p>\n										</div>\n										<span data-ng-show="(forms.settings.voicemail.$touched || forms.settings.$submitted) && forms.settings.voicemail.$invalid && forms.settings.voicemail.$error.required" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<!-- END VOICEMAIL -->\n								</div>\n								<button class="btn green-haze" type="submit" ng-click="goNext()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n							</form>\n							</wz-step>\n								<wz-step title="{{\'APPLICATION_INTERVAL\' | translate}}" canexit="formValidation(forms.interval.IntervalId.$valid || forms.interval.hasOwnProperty(\'t_from\') || forms.interval.intType.$modelValue === \'always\')">\n									<form name="forms.interval" novalidate>\n										<button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n										<button class="btn green-haze" type="submit" ng-click="goNext()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n								<!-- START INTERVAL_TYPE -->\n								<div class="form-group" data-ng-class="{\'has-error\': (forms.interval.intType.$touched || forms.interval.$submitted) && forms.interval.intType.$invalid}">\n									<label class="control-label">{{\'APPLICATION_INTERVAL_TYPE\' | translate}}<span class="required" aria-required="true">*</span></label>\n									<ui-select data-ng-model="interval.intType" theme="bootstrap" name="intType" required>\n										<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$translate.instant($select.selected.name)}}</ui-select-match>\n										<ui-select-choices repeat="intType.value as intType in $application.intTypes | filter: $select.search">\n											{{$translate.instant(intType.name)}}\n										</ui-select-choices>\n									</ui-select>\n									<span data-ng-show="(forms.interval.intType.$touched || forms.interval.$submitted) && forms.interval.intType.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END INTERVAL_TYPE -->\n								<div id="customInterval" class="app-settings" ng-slide-down="interval.intType == \'custom\'" lazy-render duration="1">\n										<!-- START TIME -->\n										<div class="form-group">\n											<label class="control-label">{{ \'APPLICATION_TIME\' | translate }}</label>\n											<div class="input-group input-large">\n												<fieldset class="pull-left" ng-disabled="interval.alwaysTime"><uib-timepicker name="t_from" data-ng-model="interval.t_from" show-meridian="false" show-spinners="false"></uib-timepicker></fieldset>\n												<div class="input-group-addon col-md-1 interval-to pull-left">to</div>\n												<fieldset ng-disabled="interval.alwaysTime"><uib-timepicker  name="t_to" data-ng-model="interval.t_to" show-meridian="false" show-spinners="false"></uib-timepicker></fieldset>\n												<label class="control-label pointer-cursor"><input type="checkbox" data-ng-model="interval.alwaysTime">{{\'APPLICATION_ALWAYS\' | translate}}</label>\n											</div>\n											</div>\n										<!-- END TIME -->\n\n										<!-- START WEEKDAY -->\n										<div class="form-group">\n											<label class="control-label">{{ \'APPLICATION_WEEKDAY\' | translate }}</label>\n											<div class="input-group input-large">\n												<ui-select data-ng-model="interval.wd_from" theme="bootstrap" name="wd_from">\n													<ui-select-match placeholder="">{{$translate.instant($select.selected.name)}}</ui-select-match>\n													<ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n														{{$translate.instant(weekDay.name)}}\n													</ui-select-choices>\n												</ui-select>\n												<span class="input-group-addon">to</span>\n												<ui-select data-ng-model="interval.wd_to" theme="bootstrap" name="wd_to">\n													<ui-select-match placeholder="">{{$translate.instant($select.selected.name)}}</ui-select-match>\n													<ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n														{{$translate.instant(weekDay.name)}}\n													</ui-select-choices>\n												</ui-select>\n											</div>\n										</div>\n										<!-- END WEEKDAY -->\n\n										<!-- START MONTHDAY -->\n										<div class="form-group">\n											<label class="control-label">{{ \'APPLICATION_MONTHDAY\' | translate }}</label>\n											<div class="input-group input-large">\n												<ui-select data-ng-model="interval.md_from" theme="bootstrap" name="md_from">\n													<ui-select-match>{{$select.selected}}</ui-select-match>\n													<ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n														{{monthDay}}\n													</ui-select-choices>\n												</ui-select>\n												<span class="input-group-addon">to</span>\n												<ui-select data-ng-model="interval.md_to" theme="bootstrap" name="md_to">\n													<ui-select-match>{{$select.selected}}</ui-select-match>\n													<ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n														{{monthDay}}\n													</ui-select-choices>\n												</ui-select>\n											</div>\n										</div>\n										<!-- END MONTHDAY -->\n\n										<!-- START MONTH -->\n										<div class="form-group">\n											<label class="control-label">{{ \'APPLICATION_MONTH\' | translate }}</label>\n											<div class="input-group input-large">\n												<ui-select data-ng-model="interval.m_from" theme="bootstrap" name="m_from">\n													<ui-select-match placeholder="">{{$translate.instant($select.selected.name)}}</ui-select-match>\n													<ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n														{{$translate.instant(month.name)}}\n													</ui-select-choices>\n												</ui-select>\n												<span class="input-group-addon">to</span>\n												<ui-select data-ng-model="interval.m_to" theme="bootstrap" name="m_to">\n													<ui-select-match placeholder="">{{$translate.instant($select.selected.name)}}</ui-select-match>\n													<ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n														{{$translate.instant(month.name)}}\n													</ui-select-choices>\n												</ui-select>\n											</div>\n										</div>\n										<!-- END MONTH -->\n						</div>\n\n						<div id="customInterval" class="app-settings" ng-slide-down="interval.intType == \'list\'" lazy-render duration="1">\n\n							<!-- START INTERVALS -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.interval.IntervalId.$touched || forms.interval.$submitted) && forms.interval.IntervalId.$invalid}">\n								<label class="control-label">{{\'APPLICATION_INTERVALS\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="interval.IntervalId" theme="bootstrap" name="IntervalId" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$translate.instant($select.selected.name)}}</ui-select-match>\n									<ui-select-choices repeat="interval.id as interval in Intervals | filter: $select.search">\n										{{$translate.instant(interval.name)}}\n									</ui-select-choices>\n								</ui-select>\n								<span data-ng-show="(forms.interval.IntervalId.$touched || forms.interval.$submitted) && forms.interval.IntervalId.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END INTERVALS -->\n\n						</div>\n						<button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n						<button class="btn green-haze" type="submit" ng-click="goNext()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n							</form>\n						</wz-step>\n\n						<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n							<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n							<button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n							<input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n						</wz-step>\n				</wizard>\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),
-a.put("app/channels/voice/voicemail/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-puzzle"></i>\n					<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-envelope-letter"></i>\n					<a href="#">{{ \'APPLICATION_VOICEMAILS\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-envelope-letter font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_VOICEMAILS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<a class="btn green-jungle" href="/channels/voice/voicemails/wizard">\n						<i class="icon-plus"></i> {{ \'APPLICATION_NEW_VOICEMAIL\' | translate }}\n					</a>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/voice/voicemail/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getVoicemail()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-puzzle"></i>\n					<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-envelope-letter"></i>\n					<a href="/channels/voice/voicemails/list">{{ \'APPLICATION_VOICEMAILS\' | translate }}</a>\n					<i data-ng-show="voicemail" class="fa fa-angle-right"></i>\n				</li>\n				<li data-ng-show="voicemail">\n					<a href="#">{{voicemail.mailbox}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET main.channels -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/voicemail.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{voicemail.mailbox}}\n					</div>\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.channels.voice.voicemails.view.settings\')}">\n							<a data-ng-href="/channels/voice/voicemails/view/{{voicemail.uniqueid}}/settings"><i class="icon-settings"></i>{{ \'APPLICATION_SETTINGS\' | translate}} </a>\n						</li>\n						<li data-ng-class="{active: $state.is(\'main.channels.voice.voicemails.view.messages\')}">\n							<a data-ng-href="/channels/voice/voicemails/view/{{voicemail.uniqueid}}/messages"><i class="icon-speech"></i>{{ \'APPLICATION_MESSAGES\' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET main.channels -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/voice/voicemail/view/view.messages.html",'<div class="row" data-ng-init="getMessages()">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title  tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_MESSAGES\' | translate}}</span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns data-ng-if="gridOptions" ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/channels/voice/voicemail/view/view.settings.html",'<div class="row" data-ng-init="getContexts()">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_VOICEMAIL\' | translate}} {{ \'APPLICATION_SETTINGS\' | translate}} </span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_GENERAL\' | translate}}</a>\n					</li>\n					<!-- <li>\n						<a href="#" data-target="#tab_1_2" data-toggle="tab">{{ \'APPLICATION_ADVANCED\' | translate}}</a>\n					</li> -->\n				</ul>\n			</div>\n\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.general" data-ng-submit="forms.general.$valid && updateVoiceVoicemail()" novalidate>\n\n							<!-- START FULLNAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.general.$submitted && forms.general.fullname.$invalid}">\n								<label class="control-label">{{\'APPLICATION_FULLNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="fullname" placeholder="{{\'APPLICATION_FULLNAME\' | translate}}" class="form-control" data-ng-model="voicemail.fullname" required/>\n								<span data-ng-show="forms.general.$submitted && forms.general.fullname.$invalid" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END FULLNAME -->\n\n							<!-- START EMAIL -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.general.$submitted && forms.general.email.$invalid}">\n								<label class="control-label">{{\'APPLICATION_EMAIL\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="email" name="email" placeholder="{{\'APPLICATION_EMAIL\' | translate}}" class="form-control" data-ng-model="voicemail.email" required/>\n								<span data-ng-show="forms.general.$submitted && forms.general.host.$invalid" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END EMAIL -->\n\n							<!-- START PASSWORD -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.general.$submitted && forms.general.password.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NEW_PASSWORD\' | translate}}</label>\n								<input type="password" name="password" placeholder="{{\'APPLICATION_NEW_PASSWORD\' | translate}}" class="form-control" data-ng-model="voicemail.password" />\n								<span data-ng-show="forms.general.$submitted && forms.general.password.$invalid" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END PASSWORD -->\n\n							<!-- START CONFIRM PASSWORD -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.general.$submitted && forms.general.rpassword.$invalid}">\n								<label class="control-label">{{\'APPLICATION_CONFIRM_PASSWORD\' | translate}}</label>\n								<input type="password" name="rpassword" placeholder="{{\'APPLICATION_CONFIRM_PASSWORD\' | translate}}" class="form-control" data-ng-model="voicemail.rpassword" nx-equal="voicemail.password"/>\n								<span data-ng-show="forms.general.$submitted && (forms.general.rpassword.$invalid || forms.general.rpassword.$invalid)" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_WRONG_PASSWORD\' | translate}}.\n								</span>\n							</div>\n							<!-- END CONFIRM PASSWORD -->\n\n							<!-- START MAILBOX -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.general.$submitted && forms.general.mailbox.$invalid}">\n								<label class="control-label">{{\'APPLICATION_MAILBOX\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="mailbox" placeholder="{{\'APPLICATION_MAILBOX\' | translate}}" class="form-control" data-ng-model="voicemail.mailbox" required readonly/>\n								<span data-ng-show="forms.general.$submitted && forms.general.mailbox.$invalid" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END MAILBOX -->\n\n							<!-- START CONTEXT -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.context.$touched || forms.general.$submitted) && forms.general.context.$invalid}">\n								<label class="control-label">{{\'APPLICATION_CONTEXT\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="voicemail.context" name="context" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n									<ui-select-choices repeat="context.name as context in voiceContexts | filter: $select.search">\n										<div ng-bind-html="context.name | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_VOICE_CONTEXT\' | translate }}\n								</span>\n								<span data-ng-show="(forms.general.context.$touched || forms.general.$submitted) && forms.general.context.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END CONTEXT -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END GENERAL TAB -->\n					<!-- ADVANCED TAB -->\n					<!-- <div class="tab-pane" id="tab_1_2">\n						<form name="forms.advanced" data-ng-submit="updateVoiceVoicemail()" novalidate>\n\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div> -->\n					<!-- END ADVANCED TAB -->\n\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/channels/voice/voicemail/wizard/wizard.html",'<div class="col-md-12" data-ng-init="initWizard()">\n  <!-- BEGIN PAGE HEADER-->\n	<div class="page-bar">\n		<ul class="page-breadcrumb">\n			<li>\n				<i class="icon-rocket"></i>\n				<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n				<i class="fa fa-angle-right"></i>\n			</li>\n			<li>\n				<i class="icon-puzzle"></i>\n				<a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n				<i class="fa fa-angle-right"></i>\n			</li>\n			<li>\n				<i class="icon-envelope-letter"></i>\n				<a href="/channels/voice/voicemails/list">{{ \'APPLICATION_VOICEMAILS\' | translate }}</a>\n				<i class="fa fa-angle-right"></i>\n			</li>\n			<li>\n				<i class="icon-options"></i>\n				<a href="#">{{ \'APPLICATION_WIZARD\' | translate }}</a>\n			</li>\n		</ul>\n	</div>\n  <!-- END PAGE HEADER-->\n\n  <!-- BEGIN PORTLET-->\n  <div class="portlet light bordered" data-ng-init="getFirstFreeMailbox()">\n  	<div class="portlet-title">\n  		<div class="caption font-green-sharp">\n  			<i class="icon-envelope-letter font-green-sharp"></i>\n  			<span class="caption-subject">{{ \'APPLICATION_VOICEMAIL\' | translate }} WIZARD</a> </span>\n  		</div>\n  	</div>\n  	<div class="portlet-body">\n  		<wizard on-finish="createItem()">\n				<wz-step title="{{\'APPLICATION_GENERAL\' | translate}}" canexit="exitValidation(form.general.$valid)">\n			    <form name="form.general" novalidate>\n\n						<!-- START FULLNAME -->\n						<div class="form-group" data-ng-class="{\'has-error\': form.general.$submitted && form.general.fullname.$invalid}">\n							<label class="control-label">{{\'APPLICATION_FULLNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n							<input type="text" name="fullname" placeholder="{{\'APPLICATION_FULLNAME\' | translate}}" class="form-control" data-ng-model="item.fullname" required/>\n							<span data-ng-show="form.general.$submitted && form.general.fullname.$invalid" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n						</div>\n						<!-- END FULLNAME -->\n\n						<!-- START EMAIL -->\n						<div class="form-group" data-ng-class="{\'has-error\': form.general.$submitted && form.general.email.$invalid}">\n							<label class="control-label">{{\'APPLICATION_EMAIL\' | translate}}<span class="required" aria-required="true">*</span></label>\n							<input type="email" name="email" placeholder="{{\'APPLICATION_EMAIL\' | translate}}" class="form-control" data-ng-model="item.email" required/>\n							<span data-ng-show="form.general.$submitted && form.general.host.$invalid" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n						</div>\n						<!-- END EMAIL -->\n\n						<!-- START PASSWORD -->\n						<div class="form-group" data-ng-class="{\'has-error\': form.general.$submitted && form.general.password.$invalid}">\n							<label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n							<input type="password" name="password" placeholder="{{\'APPLICATION_PASSWORD\' | translate}}" class="form-control" data-ng-model="item.password" required/>\n							<span data-ng-show="form.general.$submitted && form.general.password.$invalid" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n						</div>\n						<!-- END PASSWORD -->\n\n						<!-- START CONFIRM PASSWORD -->\n						<div class="form-group" data-ng-class="{\'has-error\': form.general.$submitted && form.general.rpassword.$invalid}">\n							<label class="control-label">{{\'APPLICATION_CONFIRM_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n							<input type="password" name="rpassword" placeholder="{{\'APPLICATION_CONFIRM_PASSWORD\' | translate}}" class="form-control" data-ng-model="item.rpassword" nx-equal="item.password" required/>\n							<span data-ng-show="form.general.$submitted && (form.general.rpassword.$invalid || form.general.rpassword.$invalid)" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_WRONG_PASSWORD\' | translate}}.\n							</span>\n						</div>\n						<!-- END CONFIRM PASSWORD -->\n\n						<!-- START MAILBOX -->\n						<div class="form-group" data-ng-class="{\'has-error\': form.general.$submitted && form.general.mailbox.$invalid}">\n							<label class="control-label">{{\'APPLICATION_MAILBOX\' | translate}}<span class="required" aria-required="true">*</span></label>\n							<input type="text" name="mailbox" placeholder="{{\'APPLICATION_MAILBOX\' | translate}}" class="form-control" data-ng-model="item.mailbox" required readonly/>\n							<span data-ng-show="form.general.$submitted && form.general.mailbox.$invalid" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n						</div>\n						<!-- END MAILBOX -->\n\n						<button class="btn green-haze" type="submit" ng-click="next()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n					</form>\n				</wz-step>\n\n				<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n					<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n					<button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n					<input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n				</wz-step>\n  		</wizard>\n  	</div>\n  </div>\n  <!-- END PORTLET-->\n</div>\n'),a.put("app/contactmanager/company/list/create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_COMPANY\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="forms.company" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (forms.company.name.$touched || forms.company.$submitted) && forms.company.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n      <span data-ng-show="(forms.cmopany.name.$touched || forms.company.$submitted) && forms.company.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n    </div>\n    <!-- END DESCRIPTION -->\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="ok()" ng-disabled="forms.company.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/contactmanager/company/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-briefcase"></i>\n					<a href="/contactmanager/companies/list">{{ \'APPLICATION_COMPANIES\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-briefcase font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_COMPANIES\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<button class="btn green-jungle " ng-click="create()">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_COMPANY\' | translate }}\n						</button>\n					</div>\n					<!-- <a class="btn btn-icon-only btn-default fullscreen" href="#"></a> -->\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/contactmanager/company/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getCompany()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-briefcase"></i>\n					<a href="/contactmanager/companies/list">{{ \'APPLICATION_COMPANIES\' | translate }}</a>\n					<i data-ng-show="company" class="fa fa-angle-right"></i>\n				</li>\n				<li data-ng-show="company">\n					<a href="#">{{company.name}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/company.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{company.name}}\n					</div>\n					<!-- <div class="profile-usertitle-job">\n						{{user.role}}\n					</div> -->\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.contactmanager.companies.view.settings\')}">\n							<a data-ng-href="/contactmanager/companies/view/{{company.id}}/settings">\n							<i class="icon-settings"></i>\n							{{ \'APPLICATION_SETTINGS\' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/contactmanager/company/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_COMPANY\' | translate}} {{ \'APPLICATION_SETTINGS\' | translate}} </span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_GENERAL\' | translate}}</a>\n					</li>\n					<li>\n						<a href="#" data-target="#tab_1_2" data-toggle="tab">{{ \'APPLICATION_ADDRESS\' | translate}}</a>\n					</li>\n					<li>\n						<a href="#" data-target="#tab_1_3" data-toggle="tab">{{ \'APPLICATION_SHIPMENT_ADDRESS\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.general" data-ng-submit="forms.general.$valid && updateCompany()" novalidate>\n\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="company.name" required/>\n								<span data-ng-show="(forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="company.description"></textarea>\n							</div>\n							<!-- END DESCRIPTION -->\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END ADVANCED TAB -->\n					<div class="tab-pane" id="tab_1_2">\n						<!-- START STREET -->\n						<div class="form-group" data-ng-class="{\'has-error\': (forms.general.street.$touched || forms.general.$submitted) && forms.general.street.$invalid}">\n							<label class="control-label">{{\'APPLICATION_STREET\' | translate}}</label>\n							<input type="text" name="street" placeholder="{{\'APPLICATION_STREET\' | translate}}" class="form-control" data-ng-model="company.street"/>\n							<span data-ng-show="(forms.general.street.$touched || forms.general.$submitted) && forms.general.street.$error.required" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n						</div>\n						<!-- END STREET -->\n\n						<!-- START POSTALCODE -->\n						<div class="form-group" data-ng-class="{\'has-error\': (forms.general.postalCode.$touched || forms.general.$submitted) && forms.general.postalCode.$invalid}">\n							<label class="control-label">{{\'APPLICATION_POSTALCODE\' | translate}}</label>\n							<input type="text" name="postalCode" placeholder="{{\'APPLICATION_POSTALCODE\' | translate}}" class="form-control" data-ng-model="company.postalCode"/>\n							<span data-ng-show="(forms.general.postalCode.$touched || forms.general.$submitted) && forms.general.postalCode.$error.required" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n						</div>\n						<!-- END POSTALCODE -->\n\n						<!-- START CITY -->\n						<div class="form-group" data-ng-class="{\'has-error\': (forms.general.city.$touched || forms.general.$submitted) && forms.general.city.$invalid}">\n							<label class="control-label">{{\'APPLICATION_CITY\' | translate}}</label>\n							<input type="text" name="city" placeholder="{{\'APPLICATION_CITY\' | translate}}" class="form-control" data-ng-model="company.city"/>\n							<span data-ng-show="(forms.general.city.$touched || forms.general.$submitted) && forms.general.city.$error.required" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n						</div>\n						<!-- END CITY -->\n						<!-- START COUNTRY -->\n						<div class="form-group" data-ng-class="{\'has-error\': (forms.general.country.$touched || forms.general.$submitted) && forms.general.country.$invalid}">\n							<label class="control-label">{{\'APPLICATION_COUNTRY\' | translate}}</label>\n							<input type="text" name="country" placeholder="{{\'APPLICATION_COUNTRY\' | translate}}" class="form-control" data-ng-model="company.country"/>\n							<span data-ng-show="(forms.general.country.$touched || forms.general.$submitted) && forms.general.country.$error.required" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n						</div>\n						<!-- END COUNTRY -->\n						<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n					</div>\n					<div class="tab-pane" id="tab_1_3">\n						<!-- START STREET -->\n						<div class="form-group" data-ng-class="{\'has-error\': (forms.general.sStreet.$touched || forms.general.$submitted) && forms.general.sStreet.$invalid}">\n							<label class="control-label">{{\'APPLICATION_STREET\' | translate}}</label>\n							<input type="text" name="sStreet" placeholder="{{\'APPLICATION_STREET\' | translate}}" class="form-control" data-ng-model="company.sStreet"/>\n							<span data-ng-show="(forms.general.sStreet.$touched || forms.general.$submitted) && forms.general.sStreet.$error.required" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n						</div>\n						<!-- END STREET -->\n\n						<!-- START POSTALCODE -->\n						<div class="form-group" data-ng-class="{\'has-error\': (forms.general.sPostalCode.$touched || forms.general.$submitted) && forms.general.sPostalCode.$invalid}">\n							<label class="control-label">{{\'APPLICATION_POSTALCODE\' | translate}}</label>\n							<input type="text" name="sPostalCode" placeholder="{{\'APPLICATION_POSTALCODE\' | translate}}" class="form-control" data-ng-model="company.sPostalCode"/>\n							<span data-ng-show="(forms.general.sPostalCode.$touched || forms.general.$submitted) && forms.general.sPostalCode.$error.required" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n						</div>\n						<!-- END POSTALCODE -->\n\n						<!-- START CITY -->\n						<div class="form-group" data-ng-class="{\'has-error\': (forms.general.sCity.$touched || forms.general.$submitted) && forms.general.sCity.$invalid}">\n							<label class="control-label">{{\'APPLICATION_CITY\' | translate}}</label>\n							<input type="text" name="sCity" placeholder="{{\'APPLICATION_CITY\' | translate}}" class="form-control" data-ng-model="company.sCity"/>\n							<span data-ng-show="(forms.general.sCity.$touched || forms.general.$submitted) && forms.general.sCity.$error.required" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n						</div>\n						<!-- END CITY -->\n						<!-- START COUNTRY -->\n						<div class="form-group" data-ng-class="{\'has-error\': (forms.general.sCountry.$touched || forms.general.$submitted) && forms.general.sCountry.$invalid}">\n							<label class="control-label">{{\'APPLICATION_COUNTRY\' | translate}}</label>\n							<input type="text" name="sCountry" placeholder="{{\'APPLICATION_COUNTRY\' | translate}}" class="form-control" data-ng-model="company.sCountry"/>\n							<span data-ng-show="(forms.general.sCountry.$touched || forms.general.$submitted) && forms.general.sCountry.$error.required" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n						</div>\n						<!-- END COUNTRY -->\n						<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n					</div>\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),
-a.put("app/contactmanager/contact/list/import.modal.html",'<div class="modal-header" data-ng-init="getServices()">\n  <h3 class="modal-title">{{ \'APPLICATION_IMPORT_FROM_CSV\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="forms.csv" novalidate>\n    <div class="row">\n      <div class="col-md-6">\n        <!-- START SERVICE -->\n        <div class="form-group" data-ng-class="{\'has-error\': forms.general.ServiceId.$invalid && forms.general.$submitted}">\n          <label class="control-label">{{\'APPLICATION_SERVICE\' | translate}}</label>\n          <ui-select data-ng-model="item.ServiceId" theme="bootstrap" name="ServiceId" data-ng-disabled="disabled" data-ng-change="getCustomFields()">\n            <ui-select-match placeholder="{{ \'APPLICATION_SERVICE\' | translate }}">{{$select.selected.name}}</ui-select-match>\n            <ui-select-choices repeat="service.id as service in services | filter: $select.search">\n              <div ng-bind-html="service.name | highlight: $select.search"></div>\n            </ui-select-choices>\n          </ui-select>\n          <span data-ng-show="forms.general.ServiceId.$invalid && forms.general.$submitted" class="help-block help-block-error">\n            <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n          </span>\n        </div>\n        <!-- END SERVICE -->\n\n    <!-- START FULLNAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': forms.csv.fullname.$invalid && forms.csv.$submitted}">\n      <label class="control-label">{{\'APPLICATION_FULLNAME\' | translate}}</label>\n      <ui-select data-ng-model="item.fullname" theme="bootstrap" name="fullname" data-ng-disabled="disabled" required>\n        <ui-select-match allow-clear placeholder="{{ \'APPLICATION_FULLNAME\' | translate }}">{{$select.selected}}</ui-select-match>\n        <ui-select-choices repeat="index in indexes | filter: $select.search">\n          <div ng-bind-html="index | highlight: $select.search"></div>\n        </ui-select-choices>\n      </ui-select>\n      <span data-ng-show="forms.csv.fullname.$invalid && forms.csv.$touched" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END FULLNAME -->\n\n    <!-- START STREET -->\n    <div class="form-group" data-ng-class="{\'has-error\': forms.csv.street.$invalid && forms.csv.$submitted}">\n      <label class="control-label">{{\'APPLICATION_STREET\' | translate}}</label>\n      <ui-select data-ng-model="item.street" theme="bootstrap" name="street" data-ng-disabled="disabled">\n        <ui-select-match allow-clear placeholder="{{ \'APPLICATION_STREET\' | translate }}">{{$select.selected}}</ui-select-match>\n        <ui-select-choices repeat="index in indexes | filter: $select.search">\n          <div ng-bind-html="index | highlight: $select.search"></div>\n        </ui-select-choices>\n      </ui-select>\n      <span data-ng-show="forms.csv.street.$invalid && forms.csv.$touched" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END STREET -->\n\n    <!-- START POSTALCODE -->\n    <div class="form-group" data-ng-class="{\'has-error\': forms.csv.postalCode.$invalid && forms.csv.$submitted}">\n      <label class="control-label">{{\'APPLICATION_POSTALCODE\' | translate}}</label>\n      <ui-select data-ng-model="item.postalCode" theme="bootstrap" name="postalCode" data-ng-disabled="disabled">\n        <ui-select-match allow-clear placeholder="{{ \'APPLICATION_POSTALCODE\' | translate }}">{{$select.selected}}</ui-select-match>\n        <ui-select-choices repeat="index in indexes | filter: $select.search">\n          <div ng-bind-html="index | highlight: $select.search"></div>\n        </ui-select-choices>\n      </ui-select>\n      <span data-ng-show="forms.csv.postalCode.$invalid && forms.csv.$touched" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END POSTALCODE -->\n\n    <!-- START CITY -->\n    <div class="form-group" data-ng-class="{\'has-error\': forms.csv.city.$invalid && forms.csv.$submitted}">\n      <label class="control-label">{{\'APPLICATION_CITY\' | translate}}</label>\n      <ui-select data-ng-model="item.city" theme="bootstrap" name="city" data-ng-disabled="disabled">\n        <ui-select-match allow-clear placeholder="{{ \'APPLICATION_CITY\' | translate }}">{{$select.selected}}</ui-select-match>\n        <ui-select-choices repeat="index in indexes | filter: $select.search">\n          <div ng-bind-html="index | highlight: $select.search"></div>\n        </ui-select-choices>\n      </ui-select>\n      <span data-ng-show="forms.csv.city.$invalid && forms.csv.$touched" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END CITY -->\n\n    <!-- START PHONES -->\n    <div class="form-group" data-ng-class="{\'has-error\': forms.csv.Phones.$invalid && forms.csv.$submitted}">\n      <label class="control-label">{{\'APPLICATION_PHONES\' | translate}}</label>\n      <ui-select multiple data-ng-model="item.Phones" theme="bootstrap" name="Phones" data-ng-disabled="disabled">\n        <ui-select-match allow-clear placeholder="{{ \'APPLICATION_PHONES\' | translate }}">{{$item}}</ui-select-match>\n        <ui-select-choices repeat="index in indexes | filter: $select.search">\n          <div ng-bind-html="index | highlight: $select.search"></div>\n        </ui-select-choices>\n      </ui-select>\n      <span data-ng-show="forms.csv.Phones.$invalid && forms.csv.$touched" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END PHONES -->\n\n  </div>\n  <div class="col-md-6">\n\n    <!-- START COUNTRY -->\n    <div class="form-group" data-ng-class="{\'has-error\': forms.csv.country.$invalid && forms.csv.$submitted}">\n      <label class="control-label">{{\'APPLICATION_COUNTRY\' | translate}}</label>\n      <ui-select data-ng-model="item.country" theme="bootstrap" name="country" data-ng-disabled="disabled">\n        <ui-select-match allow-clear placeholder="{{ \'APPLICATION_COUNTRY\' | translate }}">{{$select.selected}}</ui-select-match>\n        <ui-select-choices repeat="index in indexes | filter: $select.search">\n          <div ng-bind-html="index | highlight: $select.search"></div>\n        </ui-select-choices>\n      </ui-select>\n      <span data-ng-show="forms.csv.country.$invalid && forms.csv.$touched" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END COUNTRY -->\n\n    <!-- START DATEOFBIRTH -->\n    <div class="form-group" data-ng-class="{\'has-error\': forms.csv.dateOfBirth.$invalid && forms.csv.$submitted}">\n      <label class="control-label">{{\'APPLICATION_DATEOFBIRTH\' | translate}}</label>\n      <ui-select data-ng-model="item.dateOfBirth" theme="bootstrap" name="dateOfBirth" data-ng-disabled="disabled">\n        <ui-select-match allow-clear placeholder="{{ \'APPLICATION_DATEOFBIRTH\' | translate }}">{{$select.selected}}</ui-select-match>\n        <ui-select-choices repeat="index in indexes | filter: $select.search">\n          <div ng-bind-html="index | highlight: $select.search"></div>\n        </ui-select-choices>\n      </ui-select>\n      <span data-ng-show="forms.csv.dateOfBirth.$invalid && forms.csv.$touched" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END DATEOFBIRTH -->\n\n    <!-- START TAGS -->\n    <div class="form-group" data-ng-class="{\'has-error\': forms.csv.tags.$invalid && forms.csv.$submitted}">\n      <label class="control-label">{{\'APPLICATION_TAGS\' | translate}}</label>\n      <ui-select multiple data-ng-model="item.tags" theme="bootstrap" name="tags" data-ng-disabled="disabled">\n        <ui-select-match allow-clear placeholder="{{ \'APPLICATION_TAGS\' | translate }}">{{$item}}</ui-select-match>\n        <ui-select-choices repeat="index in indexes | filter: $select.search">\n          <div ng-bind-html="index | highlight: $select.search"></div>\n        </ui-select-choices>\n      </ui-select>\n      <span data-ng-show="forms.csv.tags.$invalid && forms.csv.$touched" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END TAGS -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group" data-ng-class="{\'has-error\': forms.csv.description.$invalid && forms.csv.$submitted}">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <ui-select data-ng-model="item.description" theme="bootstrap" name="description" data-ng-disabled="disabled">\n        <ui-select-match allow-clear placeholder="{{ \'APPLICATION_DESCRIPTION\' | translate }}">{{$select.selected}}</ui-select-match>\n        <ui-select-choices repeat="index in indexes | filter: $select.search">\n          <div ng-bind-html="index | highlight: $select.search"></div>\n        </ui-select-choices>\n      </ui-select>\n      <span data-ng-show="forms.csv.description.$invalid && forms.csv.$touched" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END DESCRIPTION -->\n\n    <!-- START EMAILS -->\n    <div class="form-group" data-ng-class="{\'has-error\': forms.csv.Emails.$invalid && forms.csv.$submitted}">\n      <label class="control-label">{{\'APPLICATION_EMAILS\' | translate}}</label>\n      <ui-select multiple data-ng-model="item.Emails" theme="bootstrap" name="Emails" data-ng-disabled="disabled">\n        <ui-select-match allow-clear placeholder="{{ \'APPLICATION_EMAILS\' | translate }}">{{$item}}</ui-select-match>\n        <ui-select-choices repeat="index in indexes | filter: $select.search">\n          <div ng-bind-html="index | highlight: $select.search"></div>\n        </ui-select-choices>\n      </ui-select>\n      <span data-ng-show="forms.csv.Emails.$invalid && forms.csv.$touched" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END EMAILS -->\n\n    <!-- START COMPANY -->\n    <div class="form-group" data-ng-class="{\'has-error\': forms.general.CompanyId.$invalid && forms.general.$submitted}">\n      <label class="control-label">{{\'APPLICATION_COMPANY\' | translate}}</label>\n      <ui-select data-ng-model="item.CompanyId" theme="bootstrap" name="CompanyId" data-ng-disabled="disabled">\n        <ui-select-match allow-clear placeholder="{{ \'APPLICATION_COMPANY\' | translate }}">{{$select.selected.name}}</ui-select-match>\n        <ui-select-choices repeat="company.id as company in companies | filter: $select.search">\n          <div ng-bind-html="company.name | highlight: $select.search"></div>\n        </ui-select-choices>\n      </ui-select>\n      <span data-ng-show="forms.general.CompanyId.$invalid && forms.general.$submitted" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END COMPANY -->\n\n  </div>\n  </div>\n\n  <!-- START CUSTOMFIELDS -->\n  <div data-ng-repeat="customField in customFields">\n    <div class="form-group" data-ng-class="{\'has-error\': forms.csv[customField.name].$invalid && forms.csv.$submitted}">\n      <label class="control-label">{{customField.name}}</label>\n      <ui-select data-ng-if="!joinPrompt" data-ng-model="item.customFields[customField.id]" theme="bootstrap" name="{{customField.name}}" data-ng-disabled="disabled">\n        <ui-select-match allow-clear placeholder="{{customField.name}}">{{$select.selected}}</ui-select-match>\n        <ui-select-choices repeat="index in indexes | filter: $select.search">\n          <div ng-bind-html="index | highlight: $select.search"></div>\n        </ui-select-choices>\n      </ui-select>\n      <span data-ng-show="forms.csv[customField.name].$invalid && forms.csv.$submitted" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n  </div>\n  <!-- END CUSTOMFIELDS -->\n\n  <div>\n    <p>{{\'APPLICATION_IMPORT_SUCCEEDED\' | translate}}: {{import.succeeded}}/{{csvLength}}</p>\n    <div class="progress progress-sm" style="">\n      <div class="progress-bar progress-bar-info" role="progressbar" ng-style="{ \'width\': import.success + \'%\' }"></div>\n    </div>\n  </div>\n  <div>\n    <p>{{\'APPLICATION_IMPORT_FAILED\' | translate}}: {{import.failed}}/{{csvLength}}</p>\n    <div class="progress progress-sm" style="">\n      <div class="progress-bar progress-bar-info" role="progressbar" ng-style="{ \'width\': import.fail + \'%\' }"></div>\n    </div>\n  </div>\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="start()" ng-disabled="forms.csv.$invalid || !forms.csv.fullname || submitted">{{ \'APPLICATION_SUBMIT\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="close()" data-ng-if="!importing">{{ \'APPLICATION_CLOSE\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="stop()" data-ng-if="importing">{{ \'APPLICATION_STOP\' | translate }}</button>\n</div>\n'),a.put("app/contactmanager/contact/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="fa fa-users"></i>\n					<a href="/contactmanager/contacts/list">{{ \'APPLICATION_CONTACT_MANAGER\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="fa fa-users font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_CONTACTS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<button class="btn green-jungle" data-ng-click="newContact();">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_CONTACT\' | translate }}\n						</button>\n						<span class="btn default btn-file">\n						<span class="fileinput-new">\n						<i class="icon-cloud-upload"></i> {{\'APPLICATION_IMPORT_FROM_CSV\' | translate}}</span>\n						<input type="file" nv-file-select="" uploader="uploader"/>\n						</span>\n					</div>\n					<!-- <a class="btn btn-icon-only btn-default fullscreen" href="#"></a> -->\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div data-ng-if="gridOptions"  ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/contactmanager/service/list/create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_SERVICE\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="forms.service" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (forms.service.name.$touched || forms.service.$submitted) && forms.service.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n      <span data-ng-show="(forms.service.name.$touched || forms.service.$submitted) && forms.service.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n    </div>\n    <!-- END DESCRIPTION -->\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="ok()" ng-disabled="forms.service.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/contactmanager/service/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="fa fa-tty"></i>\n					<a href="/contactmanager/services/list">{{ \'APPLICATION_SERVICES\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="fa fa-tty font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_SERVICES\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<button class="btn green-jungle " ng-click="create()">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_SERVICE\' | translate }}\n						</button>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/contactmanager/service/view/create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_CUSTOM_FIELD\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="forms.customField" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (forms.customField.name.$touched || forms.customField.$submitted) && forms.customField.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.alias" required/>\n      <span data-ng-show="(forms.customField.name.$touched || forms.customField.$submitted) && forms.customField.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n    <!-- START TYPE -->\n    <div class="form-group"  data-ng-class="{\'has-error\': (forms.customField.type.$touched || forms.customField.$submitted) && forms.customField.type.$invalid}">\n      <label class="control-label">{{ \'APPLICATION_TYPE\' | translate }}<span class="required" aria-required="true">*</span></label>\n      <ui-select data-ng-model="item.type" name="type" theme="bootstrap" required>\n        <ui-select-match placeholder="{{ \'APPLICATION_TYPE\' | translate }}">{{$translate.instant($select.selected.name)}}</ui-select-match>\n        <ui-select-choices repeat="type.value as type in types| filter: $select.search">\n          {{$translate.instant(type.name)}}\n        </ui-select-choices>\n      </ui-select>\n      <span data-ng-show="(forms.customField.type.$touched || forms.customField.$submitted) && forms.customField.type.$invalid && forms.customField.type.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END TYPE -->\n\n    <div ng-slide-down="item.type == \'select\'" lazy-render duration="1">\n      <div>\n        <label class="control-label">{{\'APPLICATION_CHOICES\' | translate}}</label>\n      </div>\n      <div class="padding-bottom" ng-repeat="choice in choices">\n        <div class="form-group">\n          <div class="input-group">\n            <input type="text" class="form-control" ng-model="choice.value" required>\n            <span class="input-group-btn">\n            <button class="btn red" type="button"data-ng-click="removeField($index)" data-ng-disabled="choices.length<=1"><i class="fa fa-times"></i></button>\n            </span>\n          </div>\n        </div>\n      </div>\n      <button type="button" class="btn btn-sm green padding-bottom" ng-click="addField()">\n        <i class="fa fa-plus"></i> {{\'APPLICATION_ADD_CHOICE\' | translate}}\n      </button>\n\n    </div>\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n    </div>\n    <!-- END DESCRIPTION -->\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="ok()" ng-disabled="forms.customField.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/contactmanager/service/view/view.agents.html",'<div class="row" data-ng-init="getTeams()">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_AGENTS\' | translate}}</span>\n				</div>\n			</div>\n			<div class="note note-warning" data-ng-hide="teams.length">\n				<h4 class="block">Warning!</h4>\n				<p>\n					 {{ \'MESSAGE_NO_AVAILABLE_TEAMS\' | translate }}\n				</p>\n			</div>\n			<div class="portlet-body">\n				<!-- BEGIN FORM-->\n				<form action="index.html" class="form-horizontal form-row-seperated">\n					<div class="form-body">\n						<div class="form-group last">\n							<div class="col-md-12" id="multi-select-team">\n							</div>\n						</div>\n					</div>\n				</form>\n				<!-- END FORM-->\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/contactmanager/service/view/view.customFieldSettings.html",'<div class="row" data-ng-init="getCustomField()">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_CUSTOM_FIELD\' | translate}} {{ \'APPLICATION_SETTINGS\' | translate}} </span>\n				</div>\n			</div>\n\n			<div class="portlet-body">\n					<!-- GENERAL TAB -->\n						<form name="forms.general" data-ng-submit="forms.general.$valid && updateCustomField()" novalidate>\n\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="customField.alias" required/>\n								<span data-ng-show="(forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<div ng-slide-down="customField.type == \'select\'" lazy-render duration="1" class="mbottom20">\n								<div>\n									<label class="control-label">{{\'APPLICATION_CHOICES\' | translate}}</label>\n								</div>\n								<div class="padding-bottom" ng-repeat="choice in choices">\n									<div class="form-group">\n										<div class="input-group">\n											<input type="text" class="form-control" ng-model="choice.value" required>\n											<span class="input-group-btn">\n											<button class="btn red" type="button"data-ng-click="removeField($index)" data-ng-disabled="choices.length<=1"><i class="fa fa-times"></i></button>\n											</span>\n										</div>\n									</div>\n								</div>\n								<button type="button" class="btn btn-sm green padding-bottom" ng-click="addField()">\n									<i class="fa fa-plus"></i> {{\'APPLICATION_ADD_CHOICE\' | translate}}\n								</button>\n\n							</div>\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="customField.description"></textarea>\n							</div>\n							<!-- END DESCRIPTION -->\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/contactmanager/service/view/view.customFields.html",'<div ui-view class="profile-content">\n<div class="row" data-ng-init="initCustomFields()">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title  tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_CUSTOM_FIELDS\' | translate}}</span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n          <div class="btn-group">\n            <button class="btn green-jungle " ng-click="create()">\n              <i class="icon-plus"></i> {{ \'APPLICATION_NEW_CUSTOM_FIELD\' | translate }}\n            </button>\n          </div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n	</div>\n</div>\n</div>\n'),a.put("app/contactmanager/service/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getService()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="fa fa-tty"></i>\n					<a href="/contactmanager/services/list">{{ \'APPLICATION_SERVICES\' | translate }}</a>\n					<i data-ng-show="service" class="fa fa-angle-right"></i>\n				</li>\n				<li data-ng-show="service">\n					<a href="#">{{service.name}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/service.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{service.name}}\n					</div>\n					<!-- <div class="profile-usertitle-job">\n						{{user.role}}\n					</div> -->\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.contactmanager.services.view.settings\')}">\n							<a data-ng-href="/contactmanager/services/view/{{service.id}}/settings">\n							<i class="icon-settings"></i>\n							{{ \'APPLICATION_SETTINGS\' | translate}} </a>\n						</li>\n						<li data-ng-class="{active: $state.is(\'main.contactmanager.services.view.agents\')}">\n							<a data-ng-href="/contactmanager/services/view/{{service.id}}/agents">\n							<i class="icon-people"></i>\n							{{ \'APPLICATION_AGENTS\' | translate}} </a>\n						</li>\n						<li data-ng-class="{active: $state.includes(\'main.contactmanager.services.view.customfields\')}">\n							<a data-ng-href="/contactmanager/services/view/{{service.id}}/customfields">\n							<i class="icon-pencil"></i>\n							{{ \'APPLICATION_CUSTOM_FIELDS\' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/contactmanager/service/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_SERVICE\' | translate}} {{ \'APPLICATION_SETTINGS\' | translate}} </span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_GENERAL\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.general" data-ng-submit="forms.general.$valid && updateService()" novalidate>\n\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="service.name" data-ng-disabled="service.defaultEntry" required/>\n								<span data-ng-show="(forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="service.description"></textarea>\n							</div>\n							<!-- END DESCRIPTION -->\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END ADVANCED TAB -->\n\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),
-a.put("app/dashboard/dashboard.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div>\n			<nav class="navbar navbar-default" role="navigation">\n				<div class="navbar-header">\n					<button type="button" class="navbar-toggle" data-ng-init="navCollapsed = true" data-ng-click="navCollapsed = !navCollapsed">\n						<span class="sr-only">Toggle navigation</span>\n						<span class="icon-bar"></span>\n						<span class="icon-bar"></span>\n						<span class="icon-bar"></span>\n					</button>\n				</div>\n\n				<!-- Collect the nav links, forms, and other content for toggling -->\n				<div class="collapse navbar-collapse" ng-class="!navCollapsed && \'in\'">\n					<ul class="nav navbar-nav">\n						<li data-ng-class="{active: $state.is(\'main.dashboard.voice\')}">\n							<a href="/dashboard/voice">\n								<b class=\'icon-earphones-alt\'></b>\n								{{ \'APPLICATION_VOICE\' | translate }}\n							</a>\n						</li>\n						<!-- <li data-ng-class="{active: $state.is(\'main.dashboard.mail\')}">\n							<a href="/dashboard/mail">\n								<b class=\'icon-envelope\'></b>\n								{{ \'APPLICATION_MAIL\' | translate }}\n							</a>\n						</li> -->\n					</ul>\n				</div>\n				<!-- /.navbar-collapse -->\n			</nav>\n		</div>\n		<div ui-view></div>\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/dashboard/mail/mail.html",'<div class="col-md-12">\nThis is the mail view.\n</div>\n'),a.put("app/dashboard/voice/voice.html",'<div data-ng-switch="Auth.getRole()">\n  <div ng-switch-when="agent">\n    <div>\n      test\n    </div>\n  </div>\n  <div ng-switch-default>\n    <fieldset>\n      <legend>\n        <span class="caption-subject">{{ \'APPLICATION_INBOUND\' | translate }}</span>\n      </legend>\n\n      <div class="row">\n        <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12" data-ng-init="initWaiting()">\n          <div class="dashboard-stat blue-madison">\n            <div class="visual">\n              <i class="icon-bell"></i>\n            </div>\n            <div class="details">\n              <div class="number">\n                {{waiting || 0}}\n              </div>\n              <div class="desc">\n                {{\'APPLICATION_WAITING\' | translate}}\n              </div>\n            </div>\n          </div>\n        </div>\n        <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12" data-ng-init="initActive()">\n          <div class="dashboard-stat purple-plum">\n            <div class="visual">\n              <i class="icon-control-play"></i>\n            </div>\n            <div class="details">\n              <div class="number">\n                {{active || 0}}\n              </div>\n              <div class="desc">\n                {{\'APPLICATION_ACTIVE\' | translate}}\n              </div>\n            </div>\n          </div>\n        </div>\n        <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12" data-ng-init="initAnswered()">\n          <div class="dashboard-stat green-haze">\n            <div class="visual">\n              <i class="icon-like"></i>\n            </div>\n            <div class="details">\n              <div class="number">\n                {{answered || 0}}\n              </div>\n              <div class="desc">\n                {{\'APPLICATION_ANSWERED\' | translate}}\n              </div>\n            </div>\n          </div>\n        </div>\n        <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12" data-ng-init="initAbandoned()">\n          <div class="dashboard-stat red-intense">\n            <div class="visual">\n              <i class="icon-dislike"></i>\n            </div>\n            <div class="details">\n              <div class="number">\n                {{abandoned || 0}}\n              </div>\n              <div class="desc">\n                {{\'APPLICATION_ABANDONED\' | translate}}\n              </div>\n            </div>\n          </div>\n        </div>\n      </div>\n\n      <div class="row">\n        <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12" data-ng-init="initAvgAnswerTime()">\n          <div class="dashboard-stat blue-madison">\n            <div class="visual">\n              <i class="icon-clock"></i>\n            </div>\n            <div class="details">\n              <div class="number">\n                {{avganswertime || 0}}\n              </div>\n              <div class="desc">\n                {{\'APPLICATION_AVG_ANSWER_TIME\' | translate}}\n              </div>\n            </div>\n          </div>\n        </div>\n        <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12" data-ng-init="initAvgTalkTime()">\n          <div class="dashboard-stat purple-plum">\n            <div class="visual">\n              <i class="icon-clock"></i>\n            </div>\n            <div class="details">\n              <div class="number">\n                {{avgtalktime || 0}}\n              </div>\n              <div class="desc">\n                {{\'APPLICATION_AVG_TALK_TIME\' | translate}}\n              </div>\n            </div>\n          </div>\n        </div>\n        <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12" data-ng-init="initAnswerRate()">\n          <div class="dashboard-stat green-haze">\n            <div class="visual">\n              <i class="icon-pie-chart"></i>\n            </div>\n            <div class="details">\n              <div class="number">\n                {{answerrate || 0}}\n              </div>\n              <div class="desc">\n                {{\'APPLICATION_ANSWER_RATE\' | translate}} (%)\n              </div>\n            </div>\n          </div>\n        </div>\n        <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12" data-ng-init="initAbandonRate()">\n          <div class="dashboard-stat red-intense">\n            <div class="visual">\n              <i class="icon-pie-chart"></i>\n            </div>\n            <div class="details">\n              <div class="number">\n                {{abandonrate || 0}}\n              </div>\n              <div class="desc">\n                {{\'APPLICATION_ABANDON_RATE\' | translate}} (%)\n              </div>\n            </div>\n          </div>\n        </div>\n      </div>\n\n      <div class="row">\n        <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12" data-ng-init="initTotalOffered()">\n          <div class="dashboard-stat blue-madison">\n            <div class="visual">\n              <i class="icon-info"></i>\n            </div>\n            <div class="details">\n              <div class="number">\n                {{totaloffered || 0}}\n              </div>\n              <div class="desc">\n                {{\'APPLICATION_TOTAL_OFFERED\' | translate}}\n              </div>\n            </div>\n          </div>\n        </div>\n        <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12" data-ng-init="initUnmanaged()">\n          <div class="dashboard-stat purple-plum">\n            <div class="visual">\n              <i class="icon-info"></i>\n            </div>\n            <div class="details">\n              <div class="number">\n                {{unmanaged || 0}}\n              </div>\n              <div class="desc">\n                {{\'APPLICATION_UNMANAGED\' | translate}}\n              </div>\n            </div>\n          </div>\n        </div>\n      </div>\n    </fieldset>\n\n    <fieldset>\n      <legend>\n        <span class="caption-subject">{{ \'APPLICATION_OUTBOUND\' | translate }}</span>\n      </legend>\n\n      <div class="row">\n        <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12" data-ng-init="initManualOutbound()">\n          <div class="dashboard-stat blue-madison">\n            <div class="visual">\n              <i class="icon-call-out"></i>\n            </div>\n            <div class="details">\n              <div class="number">\n                {{manualoutbound || 0}}\n              </div>\n              <div class="desc">\n                {{\'APPLICATION_MANUAL_OUTBOUND\' | translate}}\n              </div>\n            </div>\n          </div>\n        </div>\n        <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12" data-ng-init="initManualOutboundGlobalDuration()">\n          <div class="dashboard-stat purple-plum">\n            <div class="visual">\n              <i class="icon-clock"></i>\n            </div>\n            <div class="details">\n              <div class="number">\n                {{manualoutboundglobalduration || 0}}\n              </div>\n              <div class="desc">\n                {{\'APPLICATION_GLOBAL_DURATION\' | translate}}\n              </div>\n            </div>\n          </div>\n        </div>\n        <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12" data-ng-init="initManualOutboundAnswered()">\n          <div class="dashboard-stat green-haze">\n            <div class="visual">\n              <i class="icon-like"></i>\n            </div>\n            <div class="details">\n              <div class="number">\n                {{manualoutboundanswered || 0}}\n              </div>\n              <div class="desc">\n                {{\'APPLICATION_ANSWERED\' | translate}}\n              </div>\n            </div>\n          </div>\n        </div>\n        <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12" data-ng-init="initManualOutboundAvgDuration()">\n          <div class="dashboard-stat red-intense">\n            <div class="visual">\n              <i class="icon-pie-chart"></i>\n            </div>\n            <div class="details">\n              <div class="number">\n                {{manualoutboundavgduration || 0}}\n              </div>\n              <div class="desc">\n                {{\'APPLICATION_AVG_DURATION\' | translate}} (%)\n              </div>\n            </div>\n          </div>\n        </div>\n      </div>\n\n      <div class="row">\n        <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12" data-ng-init="initManualOutboundAnswerRate()">\n          <div class="dashboard-stat blue-madison">\n            <div class="visual">\n              <i class="icon-pie-chart"></i>\n            </div>\n            <div class="details">\n              <div class="number">\n                {{manualoutboundanswerrate || 0}}\n              </div>\n              <div class="desc">\n                {{\'APPLICATION_ANSWER_RATE\' | translate}} (%)\n              </div>\n            </div>\n          </div>\n        </div>\n      </div>\n\n    </fieldset>\n  </div>\n</div>\n'),a.put("app/desk/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-handbag"></i>\n					<a href="/desk/list">{{ \'APPLICATION_DESK_COM\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-handbag font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_DESK_COM\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="accounts.checked.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<a class="btn green-jungle" href="/desk/wizard">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_ACCOUNT\' | translate }}\n						</a>\n					</div>\n					<a class="btn btn-icon-only btn-default" href="#" ng-csv="getAccounts([\'name\',\'username\',\'remoteUri\',\'authType\',\'consumerKey\',\'consumerSecret\',\'token\',\'tokenSecret\',\'password\'])" csv-header="[\'Name\', \'Username\', \'Remote Address\', \'Authentication Type\', \'Consumer Key\', \'Consumer Secret\', \'Token\', \'Token Secret\', \'Password\']" field-separator=";" filename="desk_accounts.csv">\n					<i class="icon-cloud-download"></i></a>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<table st-table="displayedDeskAccounts" st-pipe="initList" class="table table-striped table-bordered table-hover">\n					<div class="table-responsive">\n					  <thead>\n							<tr>\n								<th colspan="7">\n									<div class="row">\n										<div class="col-md-6">\n											<ui-select class="input-xsmall" ng-model="conf.accountsByPage" theme="bootstrap" ng-disabled="disabled">\n												<ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n												<ui-select-choices repeat="accountByPage in accountsByPage | filter: $select.search">\n													<div ng-bind-html="accountByPage.name | highlight: $select.search"></div>\n												</ui-select-choices>\n											</ui-select>\n										</div>\n										<div class="col-md-6">\n											<div class="input-group input-medium pull-right">\n												<input st-search placeholder="{{ \'APPLICATION_SEARCH\' | translate }}" class="form-control" type="search" />\n												<span class="input-group-addon">\n													<i class="fa fa-search"></i>\n												</span>\n											</div>\n										</div>\n									</div>\n								</th>\n							</tr>\n						  <tr>\n								<th class="small-cells" style="text-align: center; vertical-align: middle"><input type="checkbox" ng-change="check(account, checked)" checklist-model checklist-value="id"></th>\n						    <th st-sort="name">{{ \'APPLICATION_NAME\' | translate }}</th>\n						    <th st-sort="username">{{ \'APPLICATION_EMAIL\' | translate }}</th>\n								<th st-sort="remoteUri">{{ \'APPLICATION_REMOTE_ADDRESS\' | translate }}</th>\n								<th>{{ \'APPLICATION_DESCRIPTION\' | translate }}</th>\n								<th>{{ \'APPLICATION_ACTIONS\' | translate }}</th>\n						  </tr>\n					  </thead>\n					  <tbody>\n					    <tr data-ng-repeat="account in displayedDeskAccounts" class="animate-repeat">\n								<td style="text-align: center; vertical-align: middle"><input type="checkbox" checklist-model="accounts.checked" checklist-value="account.id"></td>\n					      <td>{{account.name}}</td>\n					      <td>{{account.username}}</td>\n								<td>{{account.remoteUri}}</td>\n								<td>{{account.description}}</td>\n					      <td>\n					        <a class="btn default btn-xs blue-stripe" data-ng-href="/desk/view/{{account.id}}/account">\n										{{ \'APPLICATION_EDIT\' | translate }}\n					        </a>\n									<a class="btn default btn-xs green-stripe" data-ng-click="checkAccount(account.id)">\n										{{ \'APPLICATION_CHECK_CONNECTION\' | translate }}\n					        </a>\n					        <a class="btn default btn-xs red-stripe" data-ng-click="deleteItem(account.name,account.id)">\n										{{ \'APPLICATION_DELETE\' | translate }}\n					        </a>\n					      </td>\n					    </tr>\n							<tr data-ng-hide="displayedDeskAccounts.length">\n								<td colspan="7" style="text-align:center;">\n									<i>No account available</i>\n								</td>\n							</tr>\n					  </tbody>\n					  <tfoot>\n							<tr>\n								<td/>\n						    <td>\n									<div class="input-icon right">\n										<i class="fa fa-search"></i>\n										<input st-search="name" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_NAME\' | translate | lowercase}}" class="form-control" type="search"/>\n									</div>\n						    </td>\n						    <td>\n									<div class="input-icon right">\n										<i class="fa fa-search"></i>\n										<input st-search="email" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_EMAIL\' | translate | lowercase}}" class="form-control" type="search"/>\n									</div>\n						    </td>\n						    <td>\n									<div class="input-icon right">\n										<i class="fa fa-search"></i>\n										<input st-search="remoteUri" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_REMOTE_ADDRESS\' | translate | lowercase}}" class="form-control" type="search"/>\n									</div>\n						    </td>\n						    <td/>\n								<td/>\n						  </tr>\n					    <tr>\n					      <td colspan="7" class="text-center">\n									<div class="pagination" st-pagination st-items-by-page="conf.accountsByPage.value" st-displayed-pages="7"></div>\n					      </td>\n					    </tr>\n					  </tfoot>\n					</div>\n				</table>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/desk/view/view.account.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_ACCOUNT\' | translate}}</span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{\'APPLICATION_GENERALS\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.formSetting" data-ng-submit="forms.formSetting.$valid && updateItem()" novalidate>\n              <!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="account.name" required/>\n								<span data-ng-show="forms.formSetting.name.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="account.description"/>\n							</div>\n							<!-- END DESCRIPTION -->\n\n              <!-- START USERNAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.username.$invalid}">\n								<label class="control-label">{{\'APPLICATION_USERNAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="username" placeholder="{{\'APPLICATION_USERNAME\' | translate}}" class="form-control" data-ng-model="account.username" required/>\n								<span data-ng-show="forms.formSetting.username.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END USERNAME -->\n\n              <!-- START REMOTE ADDRESS -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.remoteUri.$invalid}">\n								<label class="control-label">{{\'APPLICATION_REMOTE_ADDRESS\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="url" name="remoteUri" placeholder="{{\'APPLICATION_REMOTE_ADDRESS\' | translate}}" class="form-control" data-ng-model="account.remoteUri" required />\n								<span data-ng-show="forms.formSetting.remoteUri.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END USERNAME -->\n\n							<!-- START AUTH TYPE -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.authType.$invalid}">\n								<label class="control-label">{{\'APPLICATION_AUTHENTICATION_TYPE\' | translate}}</label>\n								<ui-select data-ng-model="account.authType" name="authType" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_AUTHENTICATION_TYPE\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n									<ui-select-choices repeat="type in [\'basic\', \'oauth\'] | filter: $select.search">\n										<div data-ng-bind="type | capitalize | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span data-ng-show="forms.formSetting.authType.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- START AUTH TYPE -->\n\n              <!-- START PASSWORD -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.password.$invalid}" ng-slide-down="account.authType == \'basic\'" lazy-render duration="1">\n								<label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="password" name="password" placeholder="{{\'APPLICATION_PASSWORD\' | translate}}" class="form-control" data-ng-model="account.password" required/>\n								<span data-ng-show="forms.formSetting.password.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END PASSWORD -->\n\n							<!-- START CONSUMER KEY -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.consumerKey.$invalid}" ng-slide-down="account.authType == \'oauth\'" lazy-render duration="1">\n								<label class="control-label">{{\'APPLICATION_CONSUMER_KEY\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="consumerKey" placeholder="{{\'APPLICATION_CONSUMER_KEY\' | translate}}" class="form-control" data-ng-model="account.consumerKey" required/>\n								<span data-ng-show="forms.formSetting.consumerKey.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END CONSUMER KEY -->\n\n              <!-- START CONSUMER SECRET -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.consumerSecret.$invalid}" ng-slide-down="account.authType == \'oauth\'" lazy-render duration="1">\n								<label class="control-label">{{\'APPLICATION_CONSUMER_SECRET\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="consumerSecret" placeholder="{{\'APPLICATION_CONSUMER_SECRET\' | translate}}" class="form-control" data-ng-model="account.consumerSecret" required/>\n								<span data-ng-show="forms.formSetting.consumerSecret.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END CONSUMER SECRET -->\n\n              <!-- START TOKEN -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.token.$invalid}" ng-slide-down="account.authType == \'oauth\'" lazy-render duration="1">\n								<label class="control-label">{{\'APPLICATION_TOKEN\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="token" placeholder="{{\'APPLICATION_TOKEN\' | translate}}" class="form-control" data-ng-model="account.token" required/>\n								<span data-ng-show="forms.formSetting.token.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END TOKEN -->\n\n              <!-- START TOKEN SECRET-->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.tokenSecret.$invalid}" ng-slide-down="account.authType == \'oauth\'" lazy-render duration="1">\n								<label class="control-label">{{\'APPLICATION_TOKEN_SECRET\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="tokenSecret" placeholder="{{\'APPLICATION_TOKEN_SECRET\' | translate}}" class="form-control" data-ng-model="account.tokenSecret" required/>\n								<span data-ng-show="forms.formSetting.tokenSecret.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END TOKEN SECRET-->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END GENERAL TAB -->\n\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/desk/view/view.configuration.html",'<div class="row" data-ng-init="initConfiguration()">\n	<div class="col-md-12">\n		<!-- BEGIN  PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-notebook font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_CONFIGURATION\' | translate }} WIZARD</a> </span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<wizard on-finish="createConfiguration()">\n	        <wz-step title="{{\'APPLICATION_SETTINGS\' | translate}}" canexit="formValidation(formsConfiguration.info.$valid)">\n							<form name="formsConfiguration.info" novalidate>\n								<!-- START NAME -->\n								<div class="form-group" data-ng-class="{\'has-error\': formsConfiguration.info.$submitted && formsConfiguration.info.name.$invalid}">\n									<label class="control-label">{{\'APPLICATION_NAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n									<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="configuration.name" required/>\n									<span data-ng-show="formsConfiguration.info.name.$invalid && formsConfiguration.info.$submitted" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END NAME -->\n								<!-- START DESCRIPTION -->\n								<div class="form-group">\n									<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n									<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="configuration.description"/>\n								</div>\n								<!-- END DESCRIPTION -->\n\n								<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" data-ng-click="goNext()"/>\n							</form>\n						</wz-step>\n\n						<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n							<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n							<input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n						</wz-step>\n				</wizard>\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/desk/view/view.configurationSettings.html",'<div class="row" data-ng-init="getConfiguration();getVariables();getFields();">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_CONFIGURATION\' | translate}}: {{configurationName}}</span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{\'APPLICATION_SUBJECT\' | translate}}</a>\n					</li>\n          <li>\n						<a href="#" data-target="#tab_1_2" data-toggle="tab">{{\'APPLICATION_DESCRIPTION\' | translate}}</a>\n					</li>\n          <li>\n						<a href="#" data-target="#tab_1_3" data-toggle="tab">{{\'APPLICATION_FIELDS\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- SUBJECT TAB -->\n					<div class="tab-pane ui-padding active" id="tab_1_1">\n            <div class="row">\n              <div class="col-md-11">\n                <span class="caption-subject">All following fields will be join by blank space:</span>\n              </div>\n              <div class="col-md-1 pull-rigth">\n                <button class="btn btn-icon-only green" data-ng-click="addItemSubject()"><i class="fa fa-plus"></i></button>\n              </div>\n            </div>\n            <hr>\n						<!-- <div ng-scrollbars ng-scrollbars-config="config"> -->\n	            <div class="row" data-ng-repeat="subjectItem in subjectConfig">\n	              <div class="col-md-3">\n	                <ui-select ng-model="subjectItem.type" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeType(subjectItem)">\n	                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n	                  <ui-select-choices repeat="item in fieldType | filter: $select.search">\n	                    <div ng-bind-html="item | highlight: $select.search | capitalize"></div>\n	                  </ui-select-choices>\n	                </ui-select>\n	              </div>\n	              <div class="col-md-8" data-ng-if="subjectItem.type==\'string\'">\n	                <div class="form-group">\n	                  <input type="text" class="form-control" data-ng-model="subjectItem.content" data-ng-change="updateField(subjectItem)">\n	                </div>\n	              </div>\n	              <div class="col-md-8" data-ng-if="subjectItem.type==\'variable\'">\n	                <div class="form-group">\n	                  <ui-select theme="bootstrap" ng-disabled="disabled" data-ng-model="subjectItem.VariableId" data-ng-change="updateField(subjectItem)">\n	                    <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n	                    <ui-select-choices repeat="variable.id as variable in variables | filter: $select.search">\n	                      <div ng-bind-html="variable.name | highlight: $select.search"></div>\n	                    </ui-select-choices>\n	                  </ui-select>\n	                </div>\n	              </div>\n	              <div class="col-md-1">\n	                <div class="form-group">\n	                  <button class="btn btn-icon-only red" data-ng-click="removeItem(subjectItem)"><i class="fa fa-times"></i></button>\n	                </div>\n	              </div>\n	            </div>\n						<!-- </div> -->\n					</div>\n					<!-- END SUBJECT TAB -->\n          <!-- DESCRIPTION TAB -->\n					<div class="tab-pane ui-padding" id="tab_1_2">\n						<div class="row">\n              <div class="col-md-11">\n                <span class="caption-subject">All following fields will be join by new line:</span>\n              </div>\n              <div class="col-md-1 pull-rigth">\n                <button class="btn btn-icon-only green" data-ng-click="addItemDescription()"><i class="fa fa-plus"></i></button>\n              </div>\n            </div>\n            <hr>\n						<!-- <div ng-scrollbars ng-scrollbars-config="config"> -->\n							<div class="row" data-ng-repeat="descriptionItem in descriptionConfig">\n								<!-- <pre>\n									{{descriptionItem|json}}\n								</pre> -->\n	              <div class="col-md-2">\n	                <ui-select ng-model="descriptionItem.type" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeDescType(descriptionItem)">\n	                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected | ucfirst}}</ui-select-match>\n	                  <ui-select-choices repeat="item in descFieldType | filter: $select.search">\n	                    <div ng-bind-html="item | highlight: $select.search | ucfirst"></div>\n	                  </ui-select-choices>\n	                </ui-select>\n	              </div>\n	              <div class="col-md-9" data-ng-if="descriptionItem.type==\'string\'">\n	                <div class="form-group">\n	                  <input type="text" class="form-control" data-ng-model="descriptionItem.content" data-ng-change="updateField(descriptionItem)">\n	                </div>\n	              </div>\n								<div class="col-md-3" data-ng-if="descriptionItem.type==\'key_value\'">\n									<input type="text" class="form-control" placeholder="Key" data-ng-model="descriptionItem.key" data-ng-change="updateField(descriptionItem)">\n								</div>\n								<div class="col-md-3" data-ng-if="descriptionItem.type==\'key_value\'">\n									<ui-select ng-model="descriptionItem.keyType" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeDescType(descriptionItem)">\n	                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n	                  <ui-select-choices repeat="item in fieldType | filter: $select.search">\n	                    <div ng-bind-html="item | highlight: $select.search | capitalize"></div>\n	                  </ui-select-choices>\n	                </ui-select>\n								</div>\n								<div class="col-md-3" data-ng-if="descriptionItem.type==\'key_value\' && descriptionItem.keyType==\'string\'">\n									<input type="text" class="form-control" placeholder="Value" data-ng-model="descriptionItem.keyContent" data-ng-change="updateField(descriptionItem)">\n								</div>\n	              <div class="col-md-3" data-ng-if="descriptionItem.type==\'key_value\' && descriptionItem.keyType==\'variable\'">\n	                <div class="form-group">\n	                  <ui-select theme="bootstrap" ng-disabled="disabled" data-ng-model="descriptionItem.VariableId" data-ng-change="updateField(descriptionItem)">\n	                    <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n	                    <ui-select-choices repeat="variable.id as variable in variables | filter: $select.search">\n	                      <div ng-bind-html="variable.name | highlight: $select.search"></div>\n	                    </ui-select-choices>\n	                  </ui-select>\n	                </div>\n	              </div>\n	              <div class="col-md-1">\n	                <div class="form-group">\n	                  <button class="btn btn-icon-only red" data-ng-click="removeItem(descriptionItem)"><i class="fa fa-times"></i></button>\n	                </div>\n	              </div>\n	            </div>\n						<!-- </div> -->\n					</div>\n					<!-- END DESCRIPTION TAB -->\n          <!-- FIELDS TAB -->\n					<div class="tab-pane ui-padding" id="tab_1_3">\n						<div class="row">\n              <div class="col-md-11">\n                <span class="caption-subject">Add how to fill the fields present in your account:</span>\n              </div>\n              <div class="col-md-1 pull-rigth">\n                <button class="btn btn-icon-only green" data-ng-click="addItemField()"><i class="fa fa-plus"></i></button>\n              </div>\n            </div>\n            <hr>\n						<!-- <div ng-scrollbars ng-scrollbars-config="config"> -->\n	            <div class="row" data-ng-repeat="fieldItem in fieldConfig">\n	              <div class="col-md-3">\n	                <ui-select ng-model="fieldItem.idField" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeFieldType(fieldItem)">\n	                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.label}}</ui-select-match>\n	                  <ui-select-choices repeat="item.id as item in accountFields | filter: $select.search">\n	                    <div ng-bind-html="item.label | highlight: $select.search"></div>\n	                  </ui-select-choices>\n	                </ui-select>\n	              </div>\n	              <div class="col-md-8" data-ng-if="getSystemFieldOptions(fieldItem.idField)">\n	                <div class="form-group">\n										<ui-select ng-model="fieldItem.content" theme="bootstrap" ng-disabled="disabled" data-ng-change="updateField(fieldItem)">\n		                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected}}</ui-select-match>\n		                  <ui-select-choices repeat="item in getSystemFieldOptions(fieldItem.idField) | filter: $select.search">\n		                    <div ng-bind-html="item | highlight: $select.search"></div>\n		                  </ui-select-choices>\n		                </ui-select>\n	                </div>\n	              </div>\n								<div class="col-md-4" data-ng-if="!getSystemFieldOptions(fieldItem.idField)">\n									<div class="form-group">\n										<ui-select ng-model="fieldItem.type" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeType(fieldItem)">\n		                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected | ucfirst}}</ui-select-match>\n		                  <ui-select-choices repeat="item in fieldType | filter: $select.search">\n		                    <div ng-bind-html="item | highlight: $select.search | ucfirst"></div>\n		                  </ui-select-choices>\n		                </ui-select>\n									</div>\n								</div>\n								<div class="col-md-4" data-ng-if="!getSystemFieldOptions(fieldItem.idField) && fieldItem.type === \'string\'">\n	                <div class="form-group">\n										<input type="text" class="form-control" data-ng-model="fieldItem.content" data-ng-change="updateField(fieldItem)">\n	                </div>\n	              </div>\n								<div class="col-md-4" data-ng-if="!getSystemFieldOptions(fieldItem.idField) && fieldItem.type === \'variable\'">\n	                <div class="form-group">\n										<ui-select theme="bootstrap" ng-disabled="disabled" data-ng-model="fieldItem.VariableId" data-ng-change="updateField(fieldItem)">\n	                    <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n	                    <ui-select-choices repeat="variable.id as variable in variables | filter: $select.search">\n	                      <div ng-bind-html="variable.name | highlight: $select.search"></div>\n	                    </ui-select-choices>\n	                  </ui-select>\n	                </div>\n	              </div>\n	              <div class="col-md-1">\n	                <div class="form-group">\n	                  <button class="btn btn-icon-only red" data-ng-click="removeItem(fieldItem)"><i class="fa fa-times"></i></button>\n	                </div>\n	              </div>\n	            </div>\n						<!-- </div> -->\n					</div>\n					<!-- END FIELDS TAB -->\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),
-a.put("app/desk/view/view.configurations.html",'<div ui-view class="profile-content">\n	<div class="row" data-ng-init="getConfigurations()">\n		<div class="col-md-12">\n			<div class="portlet light">\n				<div class="portlet-title  tabbable-line">\n					<div class="caption caption-md">\n						<i class="icon-globe theme-font hide"></i>\n						<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_CONFIGURATIONS\' | translate}}</span>\n					</div>\n					<div class="actions">\n						<div class="btn-group">\n							<a class="btn green-jungle " href="/desk/view/{{account.id}}/configuration" data-toggle="dropdown">\n								<i class="icon-plus"></i> {{ \'APPLICATION_NEW_CONFIGURATION\' | translate }}\n							</a>\n						</div>\n					</div>\n				</div>\n				<div class="portlet-body">\n					<!-- START TABLE -->\n					<table class="table table-striped table-bordered table-hover">\n						  <thead>\n							  <tr>\n							    <th>{{\'APPLICATION_NAME\' | translate}}</th>\n									<th>{{\'APPLICATION_DESCRIPTION\' | translate}}</th>\n									<th>{{ \'APPLICATION_ACTIONS\' | translate }}</th>\n							  </tr>\n						  </thead>\n							<tbody>\n						    <tr data-ng-repeat="configuration in configurations">\n									<td>{{configuration.name}}</td>\n									<td>{{configuration.description}}</td>\n						      <td>\n										<a class="btn default btn-xs blue-stripe" data-ng-href="/desk/view/{{account.id}}/configurations/settings/{{configuration.id}}">\n											{{ \'APPLICATION_SETTINGS\' | translate}}\n						        </a>\n						        <a class="btn default btn-xs red-stripe" data-ng-click="deleteConfiguration(configuration.name,configuration.id)">\n											{{ \'APPLICATION_DELETE\' | translate }}\n						        </a>\n						      </td>\n						    </tr>\n								<tr data-ng-hide="configurations.length">\n									<td colspan="5" style="text-align:center;">\n										<i>No configuration available</i>\n									</td>\n								</tr>\n						  </tbody>\n					</table>\n					<!-- END TABLE -->\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/desk/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initView()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n          <i class="icon-handbag"></i>\n          <a href="/desk/list">{{ \'APPLICATION_DESK_COM\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<a href="#">{{account.name}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img src="assets/images/media/desk.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{account.name}}\n					</div>\n					<div class="profile-usertitle-job">\n						{{account.remoteUri}}\n					</div>\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.desk.view.account\')}">\n							<a ng-href="/desk/view/{{account.id}}/account">\n							<i class="icon-user"></i>\n							{{ \'APPLICATION_ACCOUNT\' | translate }} </a>\n						</li>\n						<li data-ng-class="{active: $state.includes(\'main.desk.view.configurations\') || $state.is(\'main.desk.view.configuration\')}">\n							<a ng-href="/desk/view/{{account.id}}/configurations">\n							<i class="icon-settings"></i>\n							{{ \'APPLICATION_CONFIGURATIONS\' | translate }} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/desk/wizard/wizard.html",'<!-- BEGIN PAGE HEADER-->\n<div class="row">\n	<div class="col-md-12">\n			<div class="page-bar">\n				<ul class="page-breadcrumb">\n					<li>\n						<i class="icon-rocket"></i>\n						<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-handbag"></i>\n						<a href="/desk/list">{{ \'APPLICATION_DESK_COM\' | translate }}</a>\n					</li>\n				</ul>\n			</div>\n		</div>\n</div>\n<!-- END PAGE HEADER-->\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initWizard()">\n	<div class="col-md-12">\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-notebook font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_ACCOUNT\' | translate }} WIZARD</a> </span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<wizard on-finish="createItem()">\n          <wz-step title="{{\'APPLICATION_ACCOUNT_INFO\' | translate}}" canexit="exitValidation(forms.formSetting.$valid)">\n						<form name="forms.formSetting" novalidate>\n\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n								<span data-ng-show="forms.formSetting.name.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"/>\n							</div>\n							<!-- END DESCRIPTION -->\n\n              <!-- START USERNAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.username.$invalid}">\n								<label class="control-label">{{\'APPLICATION_USERNAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="username" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.username" required ng-remote-validate="/api/desk/accounts/validate/username"/>\n								<span data-ng-show="forms.formSetting.username.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n								<span data-ng-show="(forms.formSetting.username.$touched || forms.formSetting.$submitted) && forms.formSetting.username.$error.ngRemoteValidate" class="help-block help-block-error">\n				          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_EXIST_USERNAME\' | translate}}.\n				        </span>\n							</div>\n							<!-- END USERNAME -->\n\n\n              <!-- START REMOTE ADDRESS -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.remoteUri.$invalid}">\n								<label class="control-label">{{\'APPLICATION_REMOTE_ADDRESS\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="url" name="remoteUri" placeholder="{{\'APPLICATION_REMOTE_ADDRESS\' | translate}}" class="form-control" data-ng-model="item.remoteUri" required ng-remote-validate="/api/desk/accounts/validate/remoteUri"/>\n								<span data-ng-show="forms.formSetting.remoteUri.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n								<span data-ng-show="(forms.formSetting.remoteUri.$touched || forms.formSetting.$submitted) && forms.formSetting.remoteUri.$error.ngRemoteValidate" class="help-block help-block-error">\n				          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_EXIST_DOMAIN\' | translate}}.\n				        </span>\n							</div>\n							<!-- END USERNAME -->\n\n							<!-- START AUTH TYPE -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.authType.$invalid}">\n								<label class="control-label">{{\'APPLICATION_AUTHENTICATION_TYPE\' | translate}}</label>\n								<ui-select data-ng-model="item.authType" name="authType" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_AUTHENTICATION_TYPE\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n									<ui-select-choices repeat="type in [\'basic\', \'oauth\'] | filter: $select.search">\n										<div data-ng-bind="type | capitalize | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span data-ng-show="forms.formSetting.authType.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- START AUTH TYPE -->\n\n              <!-- START PASSWORD -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.password.$invalid}" ng-slide-down="item.authType == \'basic\'" lazy-render duration="1">\n								<label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="password" name="password" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.password" required/>\n								<span data-ng-show="forms.formSetting.password.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END PASSWORD -->\n\n              <!-- START CONSUMER KEY -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.consumerKey.$invalid}" ng-slide-down="item.authType == \'oauth\'" lazy-render duration="1">\n								<label class="control-label">{{\'APPLICATION_CONSUMER_KEY\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="consumerKey" placeholder="{{\'APPLICATION_CONSUMER_KEY\' | translate}}" class="form-control" data-ng-model="item.consumerKey" required/>\n								<span data-ng-show="forms.formSetting.consumerKey.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END CONSUMER KEY -->\n\n              <!-- START CONSUMER SECRET -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.consumerSecret.$invalid}" ng-slide-down="item.authType == \'oauth\'" lazy-render duration="1">\n								<label class="control-label">{{\'APPLICATION_CONSUMER_SECRET\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="consumerSecret" placeholder="{{\'APPLICATION_CONSUMER_SECRET\' | translate}}" class="form-control" data-ng-model="item.consumerSecret" required/>\n								<span data-ng-show="forms.formSetting.consumerSecret.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END CONSUMER SECRET -->\n\n              <!-- START TOKEN -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.token.$invalid}" ng-slide-down="item.authType == \'oauth\'" lazy-render duration="1">\n								<label class="control-label">{{\'APPLICATION_TOKEN\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="token" placeholder="{{\'APPLICATION_TOKEN\' | translate}}" class="form-control" data-ng-model="item.token" required/>\n								<span data-ng-show="forms.formSetting.token.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END TOKEN -->\n\n              <!-- START TOKEN SECRET-->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.tokenSecret.$invalid}" ng-slide-down="item.authType == \'oauth\'" lazy-render duration="1">\n								<label class="control-label">{{\'APPLICATION_TOKEN_SECRET\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="tokenSecret" placeholder="{{\'APPLICATION_TOKEN_SECRET\' | translate}}" class="form-control" data-ng-model="item.tokenSecret" required/>\n								<span data-ng-show="forms.formSetting.tokenSecret.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END TOKEN SECRET-->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" data-ng-click="next()"/>\n\n						</form>\n					</wz-step>\n\n					<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n						<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n						<input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n					</wz-step>\n\n				</wizard>\n\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/freshdesk/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-handbag"></i>\n					<a href="/freshdesk/list">{{ \'APPLICATION_FRESHDESK\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-handbag font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_FRESHDESK\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="accounts.checked.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<a class="btn green-jungle" href="/freshdesk/wizard">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_ACCOUNT\' | translate }}\n						</a>\n					</div>\n					<a class="btn btn-icon-only btn-default" href="#" ng-csv="getAccounts([\'name\',\'username\',\'remoteUri\',\'apiKey\'])" csv-header="[\'Name\', \'Username\', \'Remote Address\', \'Api Key\']" field-separator=";" filename="freshdesk_accounts.csv">\n					<i class="icon-cloud-download"></i></a>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<table st-table="displayedFreshdeskAccounts" st-pipe="initList" class="table table-striped table-bordered table-hover">\n					<div class="table-responsive">\n					  <thead>\n							<tr>\n								<th colspan="7">\n									<div class="row">\n										<div class="col-md-6">\n											<ui-select class="input-xsmall" ng-model="conf.accountsByPage" theme="bootstrap" ng-disabled="disabled">\n												<ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n												<ui-select-choices repeat="accountByPage in accountsByPage | filter: $select.search">\n													<div ng-bind-html="accountByPage.name | highlight: $select.search"></div>\n												</ui-select-choices>\n											</ui-select>\n										</div>\n										<div class="col-md-6">\n											<div class="input-group input-medium pull-right">\n												<input st-search placeholder="{{ \'APPLICATION_SEARCH\' | translate }}" class="form-control" type="search" />\n												<span class="input-group-addon">\n													<i class="fa fa-search"></i>\n												</span>\n											</div>\n										</div>\n									</div>\n								</th>\n							</tr>\n						  <tr>\n								<th class="small-cells" style="text-align: center; vertical-align: middle"><input type="checkbox" ng-change="check(account, checked)" checklist-model checklist-value="id"></th>\n						    <th st-sort="name">{{ \'APPLICATION_NAME\' | translate }}</th>\n						    <th st-sort="username">{{ \'APPLICATION_EMAIL\' | translate }}</th>\n								<th st-sort="remoteUri">{{ \'APPLICATION_REMOTE_ADDRESS\' | translate }}</th>\n								<th>{{ \'APPLICATION_DESCRIPTION\' | translate }}</th>\n								<th>{{ \'APPLICATION_ACTIONS\' | translate }}</th>\n						  </tr>\n					  </thead>\n					  <tbody>\n					    <tr data-ng-repeat="account in displayedFreshdeskAccounts" class="animate-repeat">\n								<td style="text-align: center; vertical-align: middle"><input type="checkbox" checklist-model="accounts.checked" checklist-value="account.id"></td>\n					      <td>{{account.name}}</td>\n					      <td>{{account.username}}</td>\n								<td>{{account.remoteUri}}</td>\n								<td>{{account.description}}</td>\n					      <td>\n					        <a class="btn default btn-xs blue-stripe" data-ng-href="/freshdesk/view/{{account.id}}/account">\n										{{ \'APPLICATION_EDIT\' | translate }}\n					        </a>\n									<a class="btn default btn-xs green-stripe" data-ng-click="checkAccount(account.id)">\n										{{ \'APPLICATION_CHECK_CONNECTION\' | translate }}\n					        </a>\n					        <a class="btn default btn-xs red-stripe" data-ng-click="deleteItem(account.name,account.id)">\n										{{ \'APPLICATION_DELETE\' | translate }}\n					        </a>\n					      </td>\n					    </tr>\n							<tr data-ng-hide="displayedFreshdeskAccounts.length">\n								<td colspan="7" style="text-align:center;">\n									<i>No account available</i>\n								</td>\n							</tr>\n					  </tbody>\n					  <tfoot>\n							<tr>\n								<td/>\n						    <td>\n									<div class="input-icon right">\n										<i class="fa fa-search"></i>\n										<input st-search="name" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_NAME\' | translate | lowercase}}" class="form-control" type="search"/>\n									</div>\n						    </td>\n						    <td>\n									<div class="input-icon right">\n										<i class="fa fa-search"></i>\n										<input st-search="email" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_EMAIL\' | translate | lowercase}}" class="form-control" type="search"/>\n									</div>\n						    </td>\n						    <td>\n									<div class="input-icon right">\n										<i class="fa fa-search"></i>\n										<input st-search="remoteUri" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_REMOTE_ADDRESS\' | translate | lowercase}}" class="form-control" type="search"/>\n									</div>\n						    </td>\n						    <td/>\n								<td/>\n						  </tr>\n					    <tr>\n					      <td colspan="7" class="text-center">\n									<div class="pagination" st-pagination st-items-by-page="conf.accountsByPage.value" st-displayed-pages="7"></div>\n					      </td>\n					    </tr>\n					  </tfoot>\n					</div>\n				</table>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/freshdesk/view/view.account.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_ACCOUNT\' | translate}}</span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{\'APPLICATION_GENERALS\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.formSetting" data-ng-submit="forms.formSetting.$valid && updateItem()" novalidate>\n              <!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="account.name" required/>\n								<span data-ng-show="forms.formSetting.name.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="account.description"/>\n							</div>\n							<!-- END DESCRIPTION -->\n\n              <!-- START USERNAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.username.$invalid}">\n								<label class="control-label">{{\'APPLICATION_USERNAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="username" placeholder="{{\'APPLICATION_USERNAME\' | translate}}" class="form-control" data-ng-model="account.username" required/>\n								<span data-ng-show="forms.formSetting.username.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END USERNAME -->\n\n              <!-- START REMOTE ADDRESS -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.remoteUri.$invalid}">\n								<label class="control-label">{{\'APPLICATION_REMOTE_ADDRESS\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="url" name="remoteUri" placeholder="{{\'APPLICATION_REMOTE_ADDRESS\' | translate}}" class="form-control" data-ng-model="account.remoteUri" required />\n								<span data-ng-show="forms.formSetting.remoteUri.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END USERNAME -->\n\n							<!-- START API KEY -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.apiKey.$invalid}">\n								<label class="control-label">{{\'APPLICATION_API_KEY\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="apiKey" placeholder="{{\'APPLICATION_API_KEY\' | translate}}" class="form-control" data-ng-model="account.apiKey" required/>\n								<span data-ng-show="forms.formSetting.apiKey.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END API KEY -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END GENERAL TAB -->\n\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/freshdesk/view/view.configuration.html",'<div class="row" data-ng-init="initConfiguration()">\n	<div class="col-md-12">\n		<!-- BEGIN  PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-notebook font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_CONFIGURATION\' | translate }} WIZARD</a> </span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<wizard on-finish="createConfiguration()">\n	        <wz-step title="{{\'APPLICATION_SETTINGS\' | translate}}" canexit="formValidation(formsConfiguration.info.$valid)">\n							<form name="formsConfiguration.info" novalidate>\n								<!-- START NAME -->\n								<div class="form-group" data-ng-class="{\'has-error\': formsConfiguration.info.$submitted && formsConfiguration.info.name.$invalid}">\n									<label class="control-label">{{\'APPLICATION_NAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n									<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="configuration.name" required/>\n									<span data-ng-show="formsConfiguration.info.name.$invalid && formsConfiguration.info.$submitted" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END NAME -->\n								<!-- START DESCRIPTION -->\n								<div class="form-group">\n									<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n									<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="configuration.description"/>\n								</div>\n								<!-- END DESCRIPTION -->\n\n								<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" data-ng-click="goNext()"/>\n							</form>\n						</wz-step>\n\n						<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n							<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n							<input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n						</wz-step>\n				</wizard>\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/freshdesk/view/view.configurationSettings.html",'<div class="row" data-ng-init="getConfiguration();getVariables();getFields();">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_CONFIGURATION\' | translate}}: {{configurationName}}</span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{\'APPLICATION_SUBJECT\' | translate}}</a>\n					</li>\n          <li>\n						<a href="#" data-target="#tab_1_2" data-toggle="tab">{{\'APPLICATION_DESCRIPTION\' | translate}}</a>\n					</li>\n          <li>\n						<a href="#" data-target="#tab_1_3" data-toggle="tab">{{\'APPLICATION_FIELDS\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- SUBJECT TAB -->\n					<div class="tab-pane ui-padding active" id="tab_1_1">\n            <div class="row">\n              <div class="col-md-11">\n                <span class="caption-subject">All following fields will be join by blank space:</span>\n              </div>\n              <div class="col-md-1 pull-rigth">\n                <button class="btn btn-icon-only green" data-ng-click="addItemSubject()"><i class="fa fa-plus"></i></button>\n              </div>\n            </div>\n            <hr>\n						<!-- <div ng-scrollbars ng-scrollbars-config="config"> -->\n	            <div class="row" data-ng-repeat="subjectItem in subjectConfig">\n	              <div class="col-md-3">\n	                <ui-select ng-model="subjectItem.type" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeType(subjectItem)">\n	                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n	                  <ui-select-choices repeat="item in fieldType | filter: $select.search">\n	                    <div ng-bind-html="item | highlight: $select.search | capitalize"></div>\n	                  </ui-select-choices>\n	                </ui-select>\n	              </div>\n	              <div class="col-md-8" data-ng-if="subjectItem.type==\'string\'">\n	                <div class="form-group">\n	                  <input type="text" class="form-control" data-ng-model="subjectItem.content" data-ng-change="updateField(subjectItem)">\n	                </div>\n	              </div>\n	              <div class="col-md-8" data-ng-if="subjectItem.type==\'variable\'">\n	                <div class="form-group">\n	                  <ui-select theme="bootstrap" ng-disabled="disabled" data-ng-model="subjectItem.VariableId" data-ng-change="updateField(subjectItem)">\n	                    <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n	                    <ui-select-choices repeat="variable.id as variable in variables | filter: $select.search">\n	                      <div ng-bind-html="variable.name | highlight: $select.search"></div>\n	                    </ui-select-choices>\n	                  </ui-select>\n	                </div>\n	              </div>\n	              <div class="col-md-1">\n	                <div class="form-group">\n	                  <button class="btn btn-icon-only red" data-ng-click="removeItem(subjectItem)"><i class="fa fa-times"></i></button>\n	                </div>\n	              </div>\n	            </div>\n						<!-- </div> -->\n					</div>\n					<!-- END SUBJECT TAB -->\n          <!-- DESCRIPTION TAB -->\n					<div class="tab-pane ui-padding" id="tab_1_2">\n						<div class="row">\n              <div class="col-md-11">\n                <span class="caption-subject">All following fields will be join by new line:</span>\n              </div>\n              <div class="col-md-1 pull-rigth">\n                <button class="btn btn-icon-only green" data-ng-click="addItemDescription()"><i class="fa fa-plus"></i></button>\n              </div>\n            </div>\n            <hr>\n						<!-- <div ng-scrollbars ng-scrollbars-config="config"> -->\n							<div class="row" data-ng-repeat="descriptionItem in descriptionConfig">\n								<!-- <pre>\n									{{descriptionItem|json}}\n								</pre> -->\n	              <div class="col-md-2">\n	                <ui-select ng-model="descriptionItem.type" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeDescType(descriptionItem)">\n	                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected | ucfirst}}</ui-select-match>\n	                  <ui-select-choices repeat="item in descFieldType | filter: $select.search">\n	                    <div ng-bind-html="item | highlight: $select.search | ucfirst"></div>\n	                  </ui-select-choices>\n	                </ui-select>\n	              </div>\n	              <div class="col-md-9" data-ng-if="descriptionItem.type==\'string\'">\n	                <div class="form-group">\n	                  <input type="text" class="form-control" data-ng-model="descriptionItem.content" data-ng-change="updateField(descriptionItem)">\n	                </div>\n	              </div>\n								<div class="col-md-3" data-ng-if="descriptionItem.type==\'key_value\'">\n									<input type="text" class="form-control" placeholder="Key" data-ng-model="descriptionItem.key" data-ng-change="updateField(descriptionItem)">\n								</div>\n								<div class="col-md-3" data-ng-if="descriptionItem.type==\'key_value\'">\n									<ui-select ng-model="descriptionItem.keyType" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeDescType(descriptionItem)">\n	                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n	                  <ui-select-choices repeat="item in fieldType | filter: $select.search">\n	                    <div ng-bind-html="item | highlight: $select.search | capitalize"></div>\n	                  </ui-select-choices>\n	                </ui-select>\n								</div>\n								<div class="col-md-3" data-ng-if="descriptionItem.type==\'key_value\' && descriptionItem.keyType==\'string\'">\n									<input type="text" class="form-control" placeholder="Value" data-ng-model="descriptionItem.keyContent" data-ng-change="updateField(descriptionItem)">\n								</div>\n	              <div class="col-md-3" data-ng-if="descriptionItem.type==\'key_value\' && descriptionItem.keyType==\'variable\'">\n	                <div class="form-group">\n	                  <ui-select theme="bootstrap" ng-disabled="disabled" data-ng-model="descriptionItem.VariableId" data-ng-change="updateField(descriptionItem)">\n	                    <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n	                    <ui-select-choices repeat="variable.id as variable in variables | filter: $select.search">\n	                      <div ng-bind-html="variable.name | highlight: $select.search"></div>\n	                    </ui-select-choices>\n	                  </ui-select>\n	                </div>\n	              </div>\n	              <div class="col-md-1">\n	                <div class="form-group">\n	                  <button class="btn btn-icon-only red" data-ng-click="removeItem(descriptionItem)"><i class="fa fa-times"></i></button>\n	                </div>\n	              </div>\n	            </div>\n						<!-- </div> -->\n					</div>\n					<!-- END DESCRIPTION TAB -->\n          <!-- FIELDS TAB -->\n					<div class="tab-pane ui-padding" id="tab_1_3">\n						<div class="row">\n              <div class="col-md-11">\n                <span class="caption-subject">Add how to fill the fields present in your account:</span>\n              </div>\n              <div class="col-md-1 pull-rigth">\n                <button class="btn btn-icon-only green" data-ng-click="addItemField()"><i class="fa fa-plus"></i></button>\n              </div>\n            </div>\n            <hr>\n						<!-- <div ng-scrollbars ng-scrollbars-config="config"> -->\n	            <div class="row" data-ng-repeat="fieldItem in fieldConfig">\n	              <div class="col-md-3">\n	                <ui-select ng-model="fieldItem.idField" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeFieldType(fieldItem)">\n	                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.label}}</ui-select-match>\n	                  <ui-select-choices repeat="item.name as item in accountFields | filter: $select.search">\n	                    <div ng-bind-html="item.label | highlight: $select.search"></div>\n	                  </ui-select-choices>\n	                </ui-select>\n	              </div>\n	              <div class="col-md-8" data-ng-if="getSystemFieldOptions(fieldItem.idField)">\n	                <div class="form-group">\n										<ui-select ng-model="fieldItem.content" theme="bootstrap" ng-disabled="disabled" data-ng-change="updateField(fieldItem)">\n		                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected[0]}}</ui-select-match>\n		                  <ui-select-choices repeat="item[0] as item in getSystemFieldOptions(fieldItem.idField) | filter: $select.search">\n		                    <div ng-bind-html="item[0] | highlight: $select.search"></div>\n		                  </ui-select-choices>\n		                </ui-select>\n	                </div>\n	              </div>\n								<div class="col-md-4" data-ng-if="!getSystemFieldOptions(fieldItem.idField)">\n									<div class="form-group">\n										<ui-select ng-model="fieldItem.type" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeType(fieldItem)">\n		                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected | ucfirst}}</ui-select-match>\n		                  <ui-select-choices repeat="item in fieldType | filter: $select.search">\n		                    <div ng-bind-html="item | highlight: $select.search | ucfirst"></div>\n		                  </ui-select-choices>\n		                </ui-select>\n									</div>\n								</div>\n								<div class="col-md-4" data-ng-if="!getSystemFieldOptions(fieldItem.idField) && fieldItem.type === \'string\'">\n	                <div class="form-group">\n										<input type="text" class="form-control" data-ng-model="fieldItem.content" data-ng-change="updateField(fieldItem)">\n	                </div>\n	              </div>\n								<div class="col-md-4" data-ng-if="!getSystemFieldOptions(fieldItem.idField) && fieldItem.type === \'variable\'">\n	                <div class="form-group">\n										<ui-select theme="bootstrap" ng-disabled="disabled" data-ng-model="fieldItem.VariableId" data-ng-change="updateField(fieldItem)">\n	                    <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n	                    <ui-select-choices repeat="variable.id as variable in variables | filter: $select.search">\n	                      <div ng-bind-html="variable.name | highlight: $select.search"></div>\n	                    </ui-select-choices>\n	                  </ui-select>\n	                </div>\n	              </div>\n	              <div class="col-md-1">\n	                <div class="form-group">\n	                  <button class="btn btn-icon-only red" data-ng-click="removeItem(fieldItem)"><i class="fa fa-times"></i></button>\n	                </div>\n	              </div>\n	            </div>\n						<!-- </div> -->\n					</div>\n					<!-- END FIELDS TAB -->\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),
-a.put("app/freshdesk/view/view.configurations.html",'<div ui-view class="profile-content">\n	<div class="row" data-ng-init="getConfigurations()">\n		<div class="col-md-12">\n			<div class="portlet light">\n				<div class="portlet-title  tabbable-line">\n					<div class="caption caption-md">\n						<i class="icon-globe theme-font hide"></i>\n						<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_CONFIGURATIONS\' | translate}}</span>\n					</div>\n					<div class="actions">\n						<div class="btn-group">\n							<a class="btn green-jungle " href="/freshdesk/view/{{account.id}}/configuration" data-toggle="dropdown">\n								<i class="icon-plus"></i> {{ \'APPLICATION_NEW_CONFIGURATION\' | translate }}\n							</a>\n						</div>\n					</div>\n				</div>\n				<div class="portlet-body">\n					<!-- START TABLE -->\n					<table class="table table-striped table-bordered table-hover">\n						  <thead>\n							  <tr>\n							    <th>{{\'APPLICATION_NAME\' | translate}}</th>\n									<th>{{\'APPLICATION_DESCRIPTION\' | translate}}</th>\n									<th>{{ \'APPLICATION_ACTIONS\' | translate }}</th>\n							  </tr>\n						  </thead>\n							<tbody>\n						    <tr data-ng-repeat="configuration in configurations">\n									<td>{{configuration.name}}</td>\n									<td>{{configuration.description}}</td>\n						      <td>\n										<a class="btn default btn-xs blue-stripe" data-ng-href="/freshdesk/view/{{account.id}}/configurations/settings/{{configuration.id}}">\n											{{ \'APPLICATION_SETTINGS\' | translate}}\n						        </a>\n						        <a class="btn default btn-xs red-stripe" data-ng-click="deleteConfiguration(configuration.name,configuration.id)">\n											{{ \'APPLICATION_DELETE\' | translate }}\n						        </a>\n						      </td>\n						    </tr>\n								<tr data-ng-hide="configurations.length">\n									<td colspan="5" style="text-align:center;">\n										<i>No configuration available</i>\n									</td>\n								</tr>\n						  </tbody>\n					</table>\n					<!-- END TABLE -->\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/freshdesk/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initView()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n          <i class="icon-handbag"></i>\n          <a href="/freshdesk/list">{{ \'APPLICATION_FRESHDESK\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<a href="#">{{account.name}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img src="assets/images/media/freshdesk.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{account.name}}\n					</div>\n					<div class="profile-usertitle-job">\n						{{account.remoteUri}}\n					</div>\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.freshdesk.view.account\')}">\n							<a ng-href="/freshdesk/view/{{account.id}}/account">\n							<i class="icon-user"></i>\n							{{ \'APPLICATION_ACCOUNT\' | translate }} </a>\n						</li>\n						<li data-ng-class="{active: $state.includes(\'main.freshdesk.view.configurations\') || $state.is(\'main.freshdesk.view.configuration\')}">\n							<a ng-href="/freshdesk/view/{{account.id}}/configurations">\n							<i class="icon-settings"></i>\n							{{ \'APPLICATION_CONFIGURATIONS\' | translate }} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/freshdesk/wizard/wizard.html",'<!-- BEGIN PAGE HEADER-->\n<div class="row">\n	<div class="col-md-12">\n			<div class="page-bar">\n				<ul class="page-breadcrumb">\n					<li>\n						<i class="icon-rocket"></i>\n						<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-handbag"></i>\n						<a href="/freshdesk/list">{{ \'APPLICATION_FRESHDESK\' | translate }}</a>\n					</li>\n				</ul>\n			</div>\n		</div>\n</div>\n<!-- END PAGE HEADER-->\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initWizard()">\n	<div class="col-md-12">\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-notebook font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_ACCOUNT\' | translate }} WIZARD</a> </span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<wizard on-finish="createItem()">\n          <wz-step title="{{\'APPLICATION_ACCOUNT_INFO\' | translate}}" canexit="exitValidation(forms.formSetting.$valid)">\n						<form name="forms.formSetting" novalidate>\n\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n								<span data-ng-show="forms.formSetting.name.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"/>\n							</div>\n							<!-- END DESCRIPTION -->\n\n              <!-- START USERNAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.username.$invalid}">\n								<label class="control-label">{{\'APPLICATION_USERNAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="username" placeholder="{{\'APPLICATION_USERNAME\' | translate}}" class="form-control" data-ng-model="item.username" required ng-remote-validate="/api/freshdesk/accounts/validate/username"/>\n								<span data-ng-show="forms.formSetting.username.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n								<span data-ng-show="(forms.formSetting.username.$touched || forms.formSetting.$submitted) && forms.formSetting.username.$error.ngRemoteValidate" class="help-block help-block-error">\n				          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_EXIST_USERNAME\' | translate}}.\n				        </span>\n							</div>\n							<!-- END USERNAME -->\n\n\n              <!-- START REMOTE ADDRESS -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.remoteUri.$invalid}">\n								<label class="control-label">{{\'APPLICATION_REMOTE_ADDRESS\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="url" name="remoteUri" placeholder="{{\'APPLICATION_REMOTE_ADDRESS\' | translate}}" class="form-control" data-ng-model="item.remoteUri" required ng-remote-validate="/api/freshdesk/accounts/validate/remoteUri"/>\n								<span data-ng-show="forms.formSetting.remoteUri.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n                <span data-ng-show="(forms.formSetting.remoteUri.$touched || forms.formSetting.$submitted) && forms.formSetting.remoteUri.$error.ngRemoteValidate" class="help-block help-block-error">\n				          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_EXIST_DOMAIN\' | translate}}.\n				        </span>\n							</div>\n							<!-- END USERNAME -->\n\n              <!-- START API KEY -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.apiKey.$invalid}">\n								<label class="control-label">{{\'APPLICATION_API_KEY\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="apiKey" placeholder="{{\'APPLICATION_API_KEY\' | translate}}" class="form-control" data-ng-model="item.apiKey" required/>\n								<span data-ng-show="forms.formSetting.apiKey.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END API KEY -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" data-ng-click="next()"/>\n\n						</form>\n					</wz-step>\n\n					<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n						<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n						<input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n					</wz-step>\n\n				</wizard>\n\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/integration/list/list.html",'\n<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-game-controller"></i>\n					<a href="/integrations/list">{{ \'APPLICATION_INTEGRATIONS\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initList()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-eye font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_INTEGRATIONS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n				  <span class="btn green-jungle btn-file">\n            <span> <i class="icon-plus"></i> New App </span>\n            <input type="file" accept=".zip" nv-file-select="" uploader="uploader"/>\n          </span>\n          <a class="btn btn-icon-only btn-default" href="#" ng-csv="displayedIntegrations" filename="integrations.csv">\n					<i class="icon-cloud-download"></i></a>\n					<a class="btn btn-icon-only btn-default fullscreen" href="#"></a>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<table st-table="displayedIntegrations" st-safe-src="integrations" class="table table-striped table-bordered table-hover">\n					<div class="table-responsive">\n					  <thead>\n							<tr>\n								<th colspan="6">\n									<div class="row">\n										<div class="col-md-6">\n											<select class="form-control input-small select2me" data-ng-model="integrationsByPage">\n												<option value="10">10</option>\n												<option value="25">25</option>\n												<option value="50">50</option>\n												<option value="{{integrations.length}}">{{ \'APPLICATION_ALL\' | translate }}</option>\n											</select>\n										</div>\n										<div class="col-md-6">\n											<div class="input-group input-medium pull-right">\n												<input st-search placeholder="{{ \'APPLICATION_SEARCH\' | translate }}" class="form-control" type="search" />\n												<span class="input-group-addon">\n													<i class="fa fa-search"></i>\n												</span>\n											</div>\n										</div>\n									</div>\n								</th>\n							</tr>\n						  <tr>\n								<th st-sort="id" width="5%" st-sort-default="reverse">{{ \'APPLICATION_ID\' | translate }}</th>\n						    <th st-sort="fullname">{{ \'APPLICATION_NAME\' | translate }}</th>\n								<th st-sort="name">{{ \'APPLICATION_FILENAME\' | translate }}</th>\n								<th st-sort="name">{{ \'APPLICATION_VERSION\' | translate }}</th>\n						    <th st-sort="name">{{ \'APPLICATION_DESCRIPTION\' | translate }}</th>\n						    <th>{{ \'APPLICATION_ACTIONS\' | translate }}</th>\n						  </tr>\n					  </thead>\n					  <tbody>\n					    <tr data-ng-repeat="integration in displayedIntegrations">\n								<td>{{integration.id}}</td>\n								<td>{{integration.name}}</td>\n								<td>{{integration.filename}}</td>\n								<td>{{integration.version}}</td>\n					      <td>{{integration.description}}</td>\n								<td>\n									<span class="btn default btn-xs blue-stripe btn-file">\n				            <span> {{ \'APPLICATION_UPDATE\' | translate }} </span>\n				            <input type="file" accept=".zip" nv-file-select="" uploader="uploader"/>\n				          </span>\n					        <a class="btn default btn-xs red-stripe" data-ng-click="deleteItem(integration.name, integration.id)">\n										{{ \'APPLICATION_DELETE\' | translate }}\n					        </a>\n					      </td>\n					    </tr>\n							<tr data-ng-hide="integrations.length">\n								<td colspan="6" style="text-align:center;">\n									<i>No integrations available</i>\n								</td>\n							</tr>\n					  </tbody>\n					  <tfoot>\n							<tr>\n								<td>\n									<div class="input-icon right">\n										<i class="fa fa-search"></i>\n										<input st-search="id" class="form-control" type="search"/>\n									</div>\n						    </td>\n						    <td>\n									<div class="input-icon right">\n										<i class="fa fa-search"></i>\n										<input st-search="name" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_NAME\' | translate | lowercase}}" class="form-control" type="search"/>\n									</div>\n						    </td>\n						    <td>\n									<div class="input-icon right">\n										<i class="fa fa-search"></i>\n										<input st-search="filename" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_FILENAME\' | translate | lowercase}}" class="form-control" type="search"/>\n									</div>\n						    </td>\n								<td>\n						    </td>\n								<td>\n						    </td>\n								<td>\n						    </td>\n						  </tr>\n					    <tr>\n					      <td colspan="6" class="text-center">\n					        <div st-pagination class="pagination" st-items-by-page="integrationsByPage" st-displayed-pages="7"></div>\n					      </td>\n					    </tr>\n					  </tfoot>\n				</div>\n				</table>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/jscripty/project/list/list.create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_PROJECT\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.name.$touched || form.$submitted) && form.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n      <span data-ng-show="(form.name.$touched || form.$submitted) && form.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n    </div>\n    <!-- END DESCRIPTION -->\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="save()" ng-disabled="form.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/jscripty/project/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n        <li>\n          <i class="fa fa-slack"></i>\n          <a href="/jscripty/projects/list">{{ \'APPLICATION_PROJECTS\' | translate }}</a>\n        </li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-docs font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_PROJECTS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<a class="btn green-jungle" ng-click="createItem()">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_PROJECT\' | translate }}\n						</a>\n					</div>\n					<!-- <a class="btn btn-icon-only btn-default fullscreen" href="#"></a> -->\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n\n					<!-- <div class="table-responsive"> -->\n\n\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</div>\n\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/jscripty/project/report/report.detail.html",'<div class="row">\n	<div class="col-md-12">\n		<!-- <div class="tab-pane" id="tab_1_3" data-ng-init="getQuestionDetail()"> -->\n		<div  id="tab_1_3" data-ng-init="getQuestionDetail()">\n\n			<div class="row">\n						<div class="col-md-12">\n							<div class="portlet ">\n													<div class="portlet-title">\n														<div class="caption">\n															<i class="fa fa-list"></i>Questions Detail\n														</div>\n														<!-- <div class="tools">\n															<a href="" class="fullscreen" data-original-title="" title="">\n															</a>\n														</div> -->\n													</div>\n													<div class="portlet-body" id="questionDetail" >\n														<div class="row  margin-top-20">\n															<div class="col-md-10 col-md-offset-1">\n																<div class="panel panel-info" ng-show="!questionDetail">\n																	{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}\n\n																</div>\n																<div class="panel panel-info" ng-repeat= " (id ,labels) in questionDetail ">\n																					<div class="panel-heading">\n																						<h3 class="panel-title">\n																								<i class="fa-chart "></i>Question Id: {{id}}\n																								</h3>\n\n																					</div>\n																					<div class="panel-body">\n																								<div class="row" ng-repeat= " (label , questions) in labels ">\n																									<div class="col-md-10 col-md-offset-1">\n																											<div class="row">\n																												<h3 >\n																														<i class="icon-bar-chart "></i>	{{label}}\n																														</h3>\n\n																											</div>\n																											<div class="row" ng-repeat= " (question , answers) in questions ">\n																												<div class="col-md-10 col-md-offset-1">\n																													<div class="row" style="word-wrap: break-word;">\n																														<h3 >\n																																<i class="icon-bar-chart "></i>\n\n																																</h3>\n																																{{question}}\n																													</div>\n																													<div class="row">\n																														<div class="col-md-6 col-md-offset-3 ">\n																														<table class="table  table-hover">\n																															<thead>\n																																<tr>\n																																	<th style="width=5%"> Answer  </th>\n																																	<th style="width=5%"> Count </th>\n																																</tr>\n																															</thead>\n																															<tbody>\n																																<tr ng-if= "answer.question_answer"  ng-repeat="answer in answers ">\n\n																																				<td>{{answer.question_answer || \'No answer\'}}</td>\n																																				<td>{{answer.count}}</td>\n\n																																</tr>\n\n																															</tbody>\n																														</table>\n																														</div>\n																													</div>\n\n																												</div>\n																										</div>\n																									</div>\n\n\n																									</div>\n\n\n																					</div>\n																</div>\n																<!-- <div class="panel panel-info" ng-repeat= " question in questionDetail ">\n																	<div class="panel-heading">\n																		<h3 class="panel-title">\n																				<i class="icon-bar-chart "></i>\n																				{{question.question_label}}</h3>\n\n																	</div>\n																	<div class="panel-body">\n																		<div class="row">\n																			<div class="col-md-10 col-md-offset-1 ">\n																				<strong>ID:	 </strong>{{question.question_id}}\n																			</div>\n																		</div>\n																		<div class="row">\n																			<div class="col-md-10 col-md-offset-1 ">\n																				<strong>Question:	 </strong>{{question.question_text}}\n																			</div>\n																		</div>\n\n																		<div class="row">\n																			<div class="col-md-6 col-md-offset-3 ">\n																			<table class="table  table-hover">\n																				<thead>\n																					<tr>\n																						<th style="width=5%"> Answer  </th>\n																						<th style="width=5%"> Count </th>\n																					</tr>\n																				</thead>\n																				<tbody>\n																					<tr ng-if= "answer"  ng-repeat="answer in question.question_answers ">\n\n																									<td>{{answer || \'No answer\'}}</td>\n																									<td>{{question.count[$index]}}</td>\n\n																					</tr>\n\n																				</tbody>\n																			</table>\n																			</div>\n																		</div>\n																		<div class="row" ng-if="question.question_other_label">\n																			<div class="col-md-10 col-md-offset-1 ">\n																				<i class="fa fa-cog "></i>\n																					{{question.question_other_label}}\n																			</div>\n																		</div>\n\n																		<div class="row" ng-if="question.question_other_label">\n																			<div class="col-md-6 col-md-offset-3 ">\n																			<table class="table  table-hover">\n																				<thead>\n																					<tr>\n																						<th style="width=5%"> Value  </th>\n																						<th style="width=5%"> Count </th>\n																					</tr>\n																				</thead>\n																				<tbody>\n\n																					<tr ng-if= "answer" ng-repeat="answer in question.question_other_answer ">\n\n																									<td>{{answer || \'No value\'}}</td>\n																									<td>{{question.question_other_count[$index]}}</td>\n\n																					</tr>\n\n																				</tbody>\n																			</table>\n																			</div>\n																		</div>\n																	</div>\n																</div> -->\n															</div>\n\n														</div>\n\n													</div>\n												</div>\n\n		 </div>\n\n			</div>\n\n		</div>\n		</div>\n			</div>\n'),a.put("app/jscripty/project/report/report.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row margin-top-20" data-ng-init="initView()">\n				<div class="col-md-12">\n\n				<!-- BEGIN PROFILE SIDEBAR -->\n  					<div class="profile-sidebar">\n	              <div class="portlet light profile-sidebar-portlet">\n										<!-- SIDEBAR USERPIC -->\n										<div class="profile-userpic">\n												<img src="assets/images/xcally.png" class="img-responsive" >\n										</div>\n										<!-- END SIDEBAR USERPIC -->\n										<!-- SIDEBAR USER TITLE -->\n										<div class="profile-usertitle">\n												<div class="profile-usertitle-name">\n												</div>\n												<div class="profile-usertitle-job">\n\n												</div>\n										</div>\n										<!-- END SIDEBAR USER TITLE -->\n\n										<!-- SIDEBAR MENU -->\n										<div class="profile-usermenu">\n													<ul class="nav">\n														<li data-ng-class="{active: $state.is(\'main.jscripty.projects.report.sessions\')}">\n														<!-- <li class="active"> -->\n\n																	<a data-ng-href=\'/jscripty/projects/report/{{projectId}}/sessions\'>\n						                      	<i class="icon-settings"></i>\n						                        Project Sessions</a>\n														</li>\n						                <li data-ng-class="{active: $state.is(\'main.jscripty.projects.report.summary\')}">\n																<a data-ng-href=\'/jscripty/projects/report/{{projectId}}/summary\'>\n						          					<i class="fa fa-bar-chart"></i>\n						                      Questions Summary</a>\n						                </li>\n						                <li data-ng-class="{active: $state.is(\'main.jscripty.projects.report.detail\')}">\n																<a data-ng-href=\'/jscripty/projects/report/{{projectId}}/detail\'>\n						    								<i class="fa fa-list"></i>\n						                      Questions Detail</a>\n						                </li>\n													</ul>\n										</div>\n										<!-- END MENU -->\n\n	          	</div>\n\n          	</div>\n\n              <div class="profile-content margin-top-20">\n									<div class="row">\n										<div class="col-md-12">\n														<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">\n															<div class="dashboard-stat2">\n																<div class="display">\n																	<div class="number">\n																		<h3 class="font-green-sharp">{{projectStats.started}}</h3>\n																		<small>Started</small>\n																	</div>\n																	<div class="icon">\n																		<i class="icon-pie-chart"></i>\n																	</div>\n																</div>\n																<div class="progress-info">\n																	<div class="progress">\n																		<span style="width: 100%;" class="progress-bar progress-bar-success green-sharp">\n																		</span>\n																	</div>\n																	<div class="status">\n																	</div>\n																</div>\n															</div>\n														</div>\n														<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">\n															<div class="dashboard-stat2">\n																<div class="display">\n																	<div class="number">\n																		<h3 class="font-red-haze">{{projectStats.incomplete}}</h3>\n																		<small>Incomplete</small>\n																	</div>\n																	<div class="icon">\n																		<i class="icon-chart"></i>\n																	</div>\n																</div>\n																<div class="progress-info">\n																	<div class="progress">\n																		<span style="width: 100%;" class="progress-bar progress-bar-success red-haze">\n																		</span>\n																	</div>\n																	<div class="status">\n																	</div>\n																</div>\n															</div>\n														</div>\n														<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">\n															<div class="dashboard-stat2">\n																<div class="display">\n																	<div class="number">\n																		<h3 class="font-blue-sharp">{{projectStats.completed}}</h3>\n																		<small>Completed</small>\n																	</div>\n																	<div class="icon">\n																		<i class="icon-like"></i>\n																	</div>\n																</div>\n																<div class="progress-info">\n																	<div class="progress">\n																		<span style="width: 100%;" class="progress-bar progress-bar-success blue-sharp">\n																		</span>\n																	</div>\n																	<div class="status">\n																	</div>\n																</div>\n															</div>\n														</div>\n											</div>\n							</div>\n\n	                <div class="row">\n	                  <div ui-view class="col-md-12">\n	                  </div>\n	                  </div>\n              </div>\n      	</div>\n	</div>\n'),a.put("app/jscripty/project/report/report.session.detail.html",'\n\n<div class="row" data-ng-init="getSessionDetails()">\n			<div class="col-md-12">\n					<div class="portlet" >\n									<div class="portlet-title">\n										<div class="caption">\n											<i class="fa fa-list"></i>Session Detail\n										</div>\n										<div class="tools">\n											<a href="" class="fullscreen" data-original-title="" title="">\n											</a>\n										</div>\n									</div>\n									<div class="portlet-body"  id="sessionDetail" style="height: auto;">\n										<div class="row  margin-top-20">\n											<div class="col-md-10 col-md-offset-1">\n												<div class="panel panel-default">\n													<div class="panel-heading">\n														<p>\n															<h3 class="panel-title">\n																Session Id: {{sessionQuestions.session_id}}</h3>\n														</p>\n														<p>\n															<h3 class="panel-title">\n																Status: {{sessionQuestions.status}}</h3>\n														</p>\n														<p>\n															<h3 class="panel-title">\n																Started At: {{sessionQuestions.createdAt}}</h3>\n														</p>\n														<p ng-if="sessionQuestions.completedAt">\n															<h3 class="panel-title">\n																Closed At: {{sessionQuestions.completedAt}}</h3>\n														</p>\n													</div>\n\n												</div>\n\n												<div class="panel panel-info" ng-repeat=" question in sessionQuestions.ReportJscriptyQuestions |orderBy:\'id\'">\n													<div class="panel-heading">\n														<h3 class="panel-title">\n																<i class="icon-bar-chart "></i>\n																{{question.question_label}} [ID : {{question.question_id}}]</h3>\n\n													</div>\n													<div class="panel-body"  ng-if="question.question_text" >\n\n														<div class="row" style="word-wrap: break-word;">\n															<div class="col-md-10 col-md-offset-1 ">\n																<h4><strong>Question:	 </strong></h4>{{question.question_text}}\n															</div>\n														</div>\n														<div class="row" style="word-wrap: break-word;">\n															<div class="col-md-10 col-md-offset-1 " ng-if="question.question_answer ">\n																<h4><strong>Answer:	 </strong></h4>{{question.question_answer}}\n															</div>\n														</div>\n														<div ng-if="question.question_other_label" class="col-md-10 col-md-offset-1 ">\n															<h4>\n																	<i class="fa fa-cog "></i>\n																	<strong>{{question.question_other_label}}: </strong>\n															</h4>\n															{{question.question_other_answer}}\n														</div>\n													</div>\n\n\n														<div class="row">\n															<div class="col-md-6 col-md-offset-3 ">\n																<table class="table  table-hover" ng-if="question.ReportJscriptyInputs.length">\n																	<thead>\n																		<tr>\n																			<th style="width=5%"> Label </th>\n																			<th style="width=5%">Answer </th>\n																		</tr>\n																	</thead>\n																	<tbody>\n\n																		<tr ng-repeat="input in question.ReportJscriptyInputs |orderBy:\'id\'">\n\n																						<td>{{input.input_label}}</td>\n																						<td>{{input.input_value || \'No Answer\'}}</td>\n\n																		</tr>\n\n																	</tbody>\n																</table>\n\n															</div>\n														</div>\n													</div>\n												</div>\n											</div>\n\n										</div>\n\n									</div>\n\n								</div>\n					</div>\n	</div>\n'),
-a.put("app/jscripty/project/report/report.sessions.html",'<!-- <div ui-view class="profile-content"> -->\n\n	<div class="row" data-ng-init="getProjectSessions()">\n		<div class="col-md-12">\n			<!-- <div class="tab-pane active" id="tab_1_1" > -->\n				<div class="portlet box blue">\n							<div class="portlet-title">\n								<div class="caption">\n									<i class="icon-settings"></i>Project Sessions\n								</div>\n								<div class="tools">\n									<a href="" class="fullscreen" data-original-title="" title="">\n									</a>\n								</div>\n							</div>\n							<div class="portlet-body" style="height: auto;">\n								<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n									<div class="watermark" ng-show="!gridOptions.data.length">{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</div>\n\n								</div>\n							</div>\n				</div>\n			<!-- </div> -->\n			</div>\n	</div>\n<!-- </div> -->\n'),a.put("app/jscripty/project/report/report.summary.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="tab-pane" id="tab_1_2" data-ng-init="getQuestionSummary()" >\n			<div class="portlet box blue">\n									<div class="portlet-title">\n										<div class="caption">\n											<i class="fa fa-bar-chart"></i>Questions Summary\n\n										</div>\n										<div class="tools">\n											<a href="" class="fullscreen" data-original-title="" title="">\n											</a>\n										</div>\n									</div>\n									<div class="portlet-body" style="height: auto;">\n										<div ui-grid="gridOptions" ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n											<div class="watermark" ng-show="!gridOptions.data.length">{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</div>\n\n										</div>\n\n									</div>\n\n				</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/jscripty/project/view/view.html",'<div class="row" data-ng-init="getProject()">\n	<div class="col-md-12">\n			<div class="page-bar">\n				<ul class="page-breadcrumb">\n					<li>\n						<i class="icon-rocket"></i>\n						<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="fa fa-edit"></i>\n						<a href="/jscripty/projects/list">{{ \'APPLICATION_JSCRIPTY\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="fa fa-slack"></i>\n						<a href="/jscripty/projects/list">{{ \'APPLICATION_PROJECTS\' | translate }}</a>\n            <i class="fa fa-angle-right"></i>\n					</li>\n          <li>\n						<a ng-href="/jscripty/projects/view/{{jscriptyProject.id}}">{{jscriptyProject.name}}</a>\n          </li>\n				</ul>\n			</div>\n		</div>\n</div>\n<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n  <div class="col-md-12">\n		<div id="geEditor" class="geEditor"></div>\n  </div>\n</div>\n<!-- END PAGE CONTENT-->\n<script>\n\n\n</script>\n'),a.put("app/login/login.html",'<!-- BEGIN LOGO -->\n<div class="logo">\n	<a href="index.html">\n	<img src="assets/images/logo-big.png" alt=""/>\n	</a>\n</div>\n<!-- END LOGO -->\n<!-- BEGIN LOGIN -->\n<div class="content">\n	<!-- BEGIN LOGIN FORM -->\n	<form class="login-form" name="loginForm" data-ng-show="!flagLogin1" data-ng-submit="login(loginForm)" novalidate>\n		<h3 class="form-title">Sign In</h3>\n		<div class="alert alert-danger" data-ng-class="{\'display-hide\': !loginSubmitted || !errorLogin}">\n			<button class="close" data-close="alert"></button>\n			<span>{{ errorLog ? errorLog : \'Enter any username and password.\'}}</span>\n		</div>\n		<div class="form-group" data-ng-class="{\'has-error\': loginSubmitted && loginForm.name.$invalid}">\n			<label class="control-label">Username</label>\n      <div class="input-icon">\n        <i class="fa fa-user"></i>\n        <input ng-enter="login(loginForm)" class="form-control form-control-solid placeholder-no-fix" type="text" autocomplete="off" placeholder="Username" name="name" ng-model="userLogin.name" required/>\n      </div>\n      <span data-ng-show="loginSubmitted && loginForm.name.$invalid" class="help-block">Username is required.</span>\n		</div>\n		<div class="form-group" data-ng-class="{\'has-error\': loginSubmitted && loginForm.password.$invalid}">\n			<label class="control-label">Password</label>\n      <div class="input-icon">\n        <i class="fa fa-lock"></i>\n        <input ng-enter="login(loginForm)" class="form-control form-control-solid placeholder-no-fix" type="password" autocomplete="off" placeholder="Password" name="password" ng-model="userLogin.password" required/>\n      </div>\n      <span data-ng-show="loginSubmitted && loginForm.password.$invalid" class="help-block">Password is required.</span>\n		</div>\n		<div class="form-actions">\n			<button type="submit" class="btn btn-success uppercase">Login</button>\n      <label class="rememberme check">\n        <input type="checkbox"> Remember me\n      </label>\n			<!-- <label class="rememberme check">\n			<input type="checkbox" name="remember" value="1"/>Remember </label> -->\n			<!-- <a href="javascript:;" id="forget-password" class="forget-password">Forgot Password?</a> -->\n		</div>\n		<div class="login-options">\n			<h4>Follow Us on</h4>\n			<ul class="social-icons">\n				<li>\n					<a class="social-icon-color facebook" data-original-title="facebook" href="https://www.facebook.com/xenialab"></a>\n				</li>\n				<li>\n					<a class="social-icon-color twitter" data-original-title="Twitter" href="https://twitter.com/xenialab"></a>\n				</li>\n				<li>\n					<a class="social-icon-color googleplus" data-original-title="Goole Plus" href="#"></a>\n				</li>\n				<li>\n					<a class="social-icon-color linkedin" data-original-title="Linkedin" href="#"></a>\n				</li>\n			</ul>\n		</div>\n	</form>\n</div>\n<div class="copyright">\n	 xCALLY Motion | {{year}} - {{year + 1}} &copy; Powered by Xenialab\n</div>\n<!-- END LOGIN -->\n'),a.put("app/main/chooseContact.modal.html",'<div class="modal-header" data-ng-init="getContacts()">\n  <h3 class="modal-title">{{ \'APPLICATION_CHOOSE_CONTACT\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <table st-table="rowCollection" class="table table-striped">\n  	<tbody>\n  	<tr ng-repeat="contact in contacts">\n  		<td>{{contact.fullname}}</td>\n  		<td>{{contact.Service.name}}</td>\n  		<td>\n        <button class="btn default btn-xs green-stripe" data-ng-click="open(contact)">\n          {{ \'APPLICATION_OPEN\' | translate}}\n        </button>\n      </td>\n  	</tr>\n    <tr data-ng-hide="contacts.length">\n      <td colspan="3" style="text-align:center;">\n        <i>{{ \'MESSAGE_NO_CONTACTS_AVAILABLE\' | translate }}</i>\n      </td>\n    </tr>\n  	</tbody>\n  </table>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="open()"><i class="icon-plus"></i> {{ \'APPLICATION_NEW_CONTACT\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/main/closeEditedTab.modal.html",'<div class="modal-header" data-ng-init="getContacts()">\n  <h3 class="modal-title">{{ \'APPLICATION_WARNING\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <p>{{\'MESSAGE_CLOSE_EDITED_TAB\' | translate}}</p>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-danger" type="button" ng-click="close()">{{ \'APPLICATION_CLOSE\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/main/main.html",'<!-- BEGIN HEADER -->\n<div data-ng-include="\'components/header/header.html\'" data-ng-controller="HeaderController" class="page-header navbar navbar-fixed-top">\n</div>\n<!-- END HEADER -->\n\n<div class="clearfix">\n</div>\n<!-- BEGIN CONTAINER -->\n<div class="page-container" data-ng-init="initMain()">\n\n  <!-- BEGIN SIDEBAR -->\n  <div data-ng-include="\'components/sidebar/sidebar.html\'" data-ng-controller="SidebarController" class="page-sidebar-wrapper">\n  </div>\n  <!-- END SIDEBAR -->\n\n  <!-- BEGIN CONTENT -->\n  <div class="page-content-wrapper">\n    <div class="page-content" data-ng-class="{\'demo\': !license.expiration}">\n\n      <!-- BEGIN PAGE CONTENT -->\n      <uib-tabset>\n        <uib-tab select="addWorkspace()" active="mainTab.active">\n          <uib-tab-heading>\n            Motion <i class="icon-rocket"></i>\n          </uib-tab-heading>\n          <div ui-view class=""></div>\n        </uib-tab>\n        <uib-tab data-ng-repeat="workspace in workspaces" active="workspace.active" data-ng-switch="workspace.type">\n          <uib-tab-heading>\n            {{workspace.name}} <i class="icon-close pointer-cursor" data-ng-click="closeTab($index)"></i>\n          </uib-tab-heading>\n          <div class="" data-ng-switch="workspace.type">\n            <new-contact data-ng-switch-when="newContact" workspace="workspace" index="$index" on-submit="createContact(index,item)"></new-contact>\n            <contact data-ng-switch-when="contact" workspace="workspace" index="$index" on-submit="updateContact(index,item)"></contact>\n            <jscripty data-ng-switch-when="jscripty" workspace="workspace" index="$index" on-submit="closeTab(index)"></jscripty>\n          </div>\n        </uib-tab>\n      </uib-tabset>\n      <!-- END PAGE CONTENT  -->\n\n    </div>\n  </div>\n  <!-- END CONTENT -->\n\n  <!-- BEGIN QUICK SIDEBAR -->\n  <a href="javascript:;" class="page-quick-sidebar-toggler"><i class="icon-close"></i></a>\n  <div data-ng-include="\'components/quickSidebar/quickSidebar.html\'" data-ng-controller="QuickSidebarController" class="page-quick-sidebar-wrapper">\n  </div>\n  <!-- END QUICK SIDEBAR -->\n\n</div>\n<!-- END CONTAINER -->\n\n<!-- BEGIN FOOTER -->\n<div data-ng-include="\'components/footer/footer.html\'" data-ng-controller="FooterController" class="page-footer">\n</div>\n<!-- END FOOTER -->\n\n<!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->\n<!-- BEGIN CORE PLUGINS -->\n<!--[if lt IE 9]>\n<script src="../../assets/global/plugins/respond.min.js"></script>\n<script src="../../assets/global/plugins/excanvas.min.js"></script>\n<![endif]-->\n\n<!-- END JAVASCRIPTS -->\n'),a.put("app/main/template/actionBuilder/template.actionBuilderIntegration.html",'<div data-ng-if="randomName" class="form-group col-md-2" data-ng-class="{\'has-error\': (form[\'data1\'+randomName].$touched || form.$submitted) && form[\'data1\'+randomName].$invalid}">\n  <ui-select data-ng-model="element.data1" name="data1{{randomName}}" theme="bootstrap" data-ng-change="changeIntegration()" required>\n    <ui-select-match>{{$select.selected.name}}</ui-select-match>\n    <ui-select-choices repeat="integration.state as integration in integrations | filter: $select.search">\n      <div ng-bind-html="integration.name | highlight: $select.search"></div>\n    </ui-select-choices>\n  </ui-select>\n  <span data-ng-show="(form[\'data1\'+randomName].$touched || form.$submitted) && form[\'data1\'+randomName].$error.required" class="help-block help-block-error">\n    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n  </span>\n</div>\n<div class="form-group col-md-2" data-ng-if="element.data1 && accounts && randomName" data-ng-class="{\'has-error\': (form[\'data2\'+randomName].$touched || form.$submitted) && form[\'data2\'+randomName].$invalid}">\n  <ui-select data-ng-model="element.data2" name="data2{{randomName}}" theme="bootstrap" data-ng-change="changeAccount();" required>\n    <ui-select-match>{{$select.selected.name}}</ui-select-match>\n    <ui-select-choices repeat="account.id as account in accounts | filter: $select.search">\n      <div ng-bind-html="account.name | highlight: $select.search"></div>\n    </ui-select-choices>\n  </ui-select>\n  <span data-ng-show="(form[\'data2\'+randomName].$touched || form.$submitted) && form[\'data2\'+randomName].$error.required" class="help-block help-block-error">\n    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n  </span>\n</div>\n<div class="form-group col-md-2" data-ng-if="element.data2 && configurations && randomName" data-ng-class="{\'has-error\': (form[\'data3\'+randomName].$touched || form.$submitted) && form[\'data3\'+randomName].$invalid}">\n  <ui-select data-ng-model="element.data3" name="data3{{randomName}}" theme="bootstrap" required>\n    <ui-select-match>{{$select.selected.name}}</ui-select-match>\n    <ui-select-choices repeat="config.id as config in configurations | filter: $select.search">\n      <div ng-bind-html="config.name | highlight: $select.search"></div>\n    </ui-select-choices>\n  </ui-select>\n  <span data-ng-show="(form[\'data3\'+randomName].$touched || form.$submitted) && form[\'data3\'+randomName].$error.required" class="help-block help-block-error">\n'+"    <strong>{{'APPLICATION_WARNING' | translate}}!</strong> {{'MESSAGE_REQUIRED_FIELD' | translate}}.\n  </span>\n</div>\n"),a.put("app/main/template/actionBuilder/template.actionBuilderStatus.html",'<div data-ng-if="randomName" class="form-group col-md-2" data-ng-class="{\'has-error\': (form[\'data1\'+randomName].$touched || form.$submitted) && form[\'data1\'+randomName].$invalid}">\n  <ui-select data-ng-model="element.data1" name="data1{{randomName}}" theme="bootstrap" required>\n    <ui-select-match>{{$select.selected.name | translate}}</ui-select-match>\n    <ui-select-choices repeat="status.value as status in states | filter: $select.search">\n      <div ng-bind-html="status.name | translate | highlight: $select.search"></div>\n    </ui-select-choices>\n  </ui-select>\n  <span data-ng-show="(form[\'data1\'+randomName].$touched || form.$submitted) && form[\'data1\'+randomName].$error.required" class="help-block help-block-error">\n'+"    <strong>{{'APPLICATION_WARNING' | translate}}!</strong> {{'MESSAGE_REQUIRED_FIELD' | translate}}.\n  </span>\n</div>\n"),a.put("app/main/template/actionBuilder/template.actionBuilderTemplate.html",'<div data-ng-if="randomName" class="form-group col-md-2" data-ng-class="{\'has-error\': (form[\'data1\'+randomName].$touched || form.$submitted) && form[\'data1\'+randomName].$invalid}">\n  <ui-select data-ng-model="element.data1" name="data1{{randomName}}" theme="bootstrap" required>\n    <ui-select-match>{{$select.selected.name}}</ui-select-match>\n    <ui-select-choices repeat="template.id as template in templates | filter: $select.search">\n      <div ng-bind-html="template.name | highlight: $select.search"></div>\n    </ui-select-choices>\n  </ui-select>\n  <span data-ng-show="(form[\'data1\'+randomName].$touched || form.$submitted) && form[\'data1\'+randomName].$error.required" class="help-block help-block-error">\n    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n  </span>\n</div>\n<div data-ng-if="randomName" class="form-group col-md-2" data-ng-class="{\'has-error\': (form[\'data2\'+randomName].$touched || form.$submitted) && form[\'data2\'+randomName].$invalid}">\n  <input type="text" ng-model="element.data2" name="data2{{randomName}}" class="form-control" required/>\n  <span data-ng-show="(form[\'data2\'+randomName].$touched || form.$submitted) && form[\'data2\'+randomName].$error.required" class="help-block help-block-error">\n    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n  </span>\n</div>\n<div class="col-md-2">\n  <input type="text" ng-model="element.data3" class="form-control"/>\n</div>\n'),a.put("app/main/template/template.conditionBuilder.html",'<div data-ng-if="randomName" class="form-group col-md-3" data-ng-class="{\'has-error\': (form[\'field\'+randomName].$touched || form.$submitted) && form[\'field\'+randomName].$invalid}">\n  <ui-select data-ng-model="element.field" name="field{{randomName}}" theme="bootstrap" data-ng-change="checkCondition(element.field)" required>\n    <ui-select-match>{{$select.selected.name | translate}}</ui-select-match>\n    <ui-select-choices repeat="condition.value as condition in service.services[serviceindex].conditions | filter: $select.search">\n      <div ng-bind-html="condition.name | translate | highlight: $select.search"></div>\n    </ui-select-choices>\n  </ui-select>\n  <span data-ng-show="(form[\'field\'+randomName].$touched || form.$submitted) && form[\'field\'+randomName].$error.required" class="help-block help-block-error">\n    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n  </span>\n</div>\n<div data-ng-if="randomName && element.field" class="form-group col-md-3" data-ng-class="{\'has-error\': (form[\'operator\'+randomName].$touched || form.$submitted) && form[\'operator\'+randomName].$invalid}">\n  <ui-select data-ng-model="element.operator" name="operator{{randomName}}" theme="bootstrap" required>\n    <ui-select-match>{{$select.selected.name | translate}}</ui-select-match>\n    <ui-select-choices repeat="operator.value as operator in _.find(service.services[serviceindex].conditions,{value:element.field}).operators | filter: $select.search">\n      <div ng-bind-html="operator.name | translate | highlight: $select.search"></div>\n    </ui-select-choices>\n  </ui-select>\n  <span data-ng-show="(form[\'operator\'+randomName].$touched || form.$submitted) && form[\'operator\'+randomName].$error.required" class="help-block help-block-error">\n    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n  </span>\n</div>\n<div class="col-md-3" data-ng-if="elementType === \'input\' && randomName && element.field" data-ng-class="{\'has-error\': (form[\'value\'+randomName].$touched || form.$submitted) && form[\'value\'+randomName].$invalid}">\n  <input type="text" ng-model="element.value" class="form-control" name="value{{randomName}}" required/>\n  <span data-ng-show="(form[\'value\'+randomName].$touched || form.$submitted) && form[\'value\'+randomName].$error.required" class="help-block help-block-error">\n      <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n    </span>\n</div>\n<div class="form-group col-md-3" data-ng-if="elementType === \'select\' && randomName && element.field" data-ng-class="{\'has-error\': (form[\'value\'+randomName].$touched || form.$submitted) && form[\'value\'+randomName].$invalid}">\n  <ui-select data-ng-model="element.value" name="value{{randomName}}" theme="bootstrap" required>\n    <ui-select-match>{{$select.selected.name | translate}}</ui-select-match>\n    <ui-select-choices repeat="value.value as value in values| filter: $select.search">\n      <div ng-bind-html="value.name | translate | highlight: $select.search"></div>\n    </ui-select-choices>\n  </ui-select>\n  <span data-ng-show="(form[\'value\'+randomName].$touched || form.$submitted) && form[\'value\'+randomName].$error.required" class="help-block help-block-error">\n'+"    <strong>{{'APPLICATION_WARNING' | translate}}!</strong> {{'MESSAGE_REQUIRED_FIELD' | translate}}.\n  </span>\n</div>\n"),a.put("app/main/template/template.contactTab.html",'<div class="row margin-top-20 contact-tab-container">\n  <div class="col-md-12 contact-tab">\n    <form name="forms.general" data-ng-submit="submit({index:index,item:contact})" novalidate>\n    <!-- BEGIN PROFILE CONTENT -->\n    <div class="profile-content">\n      <ul class="nav nav-tabs">\n  <li class="active">\n    <a href="#tab_1_1{{contact.id || \'\'}}" data-toggle="tab">{{\'APPLICATION_DETAIL\' | translate}}</a>\n  </li>\n  <li data-ng-if="contact.id">\n    <a href="#tab_1_2{{contact.id || \'\'}}" data-toggle="tab">{{\'APPLICATION_LOG\' | translate}}</a>\n  </li>\n</ul>\n<div class="tab-content">\n  <div class="tab-pane fade active in" id="tab_1_1{{contact.id || \'\'}}">\n    <!--end add-portfolio-->\n    <div class="row portfolio-block" data-ng-if="workspace.data">\n      <div class="col-md-6">\n        <div class="portfolio-text">\n          <img src="assets/images/media/CmCall.png" alt=""/>\n          <div class="portfolio-text-info">\n            <h4>{{\'MESSAGE_INBOUND_CALL_FROM\' | translate}} - {{data.calleridnum}}</h4>\n            <p>\n              {{\'MESSAGE_CALL_UNIQUEID\' | translate}} : {{data.uniqueid}}\n            </p>\n          </div>\n        </div>\n      </div>\n      <div class="col-md-2 portfolio-stat">\n        <div class="portfolio-info">\n          {{\'APPLICATION_QUEUE\' | translate}} <span>\n            {{workspace.data.queue}} </span>\n          </div>\n        </div>\n        <div class="col-md-2 portfolio-stat">\n          <div class="portfolio-info">\n            {{\'APPLICATION_AGENT\' | translate}} <span>\n              {{workspace.data.membername}} </span>\n            </div>\n          </div>\n          <div class="col-md-2 portfolio-stat">\n            <div class="portfolio-info">\n              {{\'APPLICATION_DATE\' | translate}} <span>\n                {{workspace.data.agentcalledAt}} </span>\n              </div>\n            </div>\n          </div>\n            <!--end row-->\n          <!-- BEGIN PORTLET -->\n          <div class="portlet light ">\n            <div class="portlet-title">\n              <div class="caption caption-md">\n                <i class="icon-bar-chart theme-font hide"></i>\n                <span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_DETAIL\' | translate}}</span>\n              </div>\n              <div class="actions">\n                <div class="btn-group btn-group-devided" data-toggle="buttons">\n                  <label class="btn btn-transparent grey-salsa btn-circle btn-sm active" data-ng-click="detail.tab=\'main\'">\n                  <input type="radio" class="toggle">{{\'APPLICATION_MAIN\' | translate}}</label>\n                  <label class="btn btn-transparent grey-salsa btn-circle btn-sm" data-ng-click="detail.tab=\'other\'">\n                  <input type="radio" class="toggle">{{\'APPLICATION_OTHER\' | translate}}</label>\n                </div>\n              </div>\n            </div>\n            <div class="portlet-body">\n              <div data-ng-class="{\'hidden\':detail.tab != \'main\'}" class="portlet-body contact-portlet row">\n                <div class="col-md-4">\n              <!-- START FIRSTNAME -->\n              <div class="form-group" data-ng-class="{\'has-error\': (forms.general.firstName.$touched || forms.general.$submitted) && forms.general.firstName.$invalid}">\n                <label class="control-label">{{\'APPLICATION_FIRSTNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n                <input type="text" name="firstName" placeholder="{{\'APPLICATION_FIRSTNAME\' | translate}}" class="form-control" data-ng-model="contact.firstName" required/>\n                <span data-ng-show="(forms.general.firstName.$touched || forms.general.$submitted) && forms.general.firstName.$error.required" class="help-block help-block-error">\n                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                </span>\n              </div>\n              <!-- END FIRSTNAME -->\n\n              <!-- START LASTNAME -->\n              <div class="form-group" data-ng-class="{\'has-error\': (forms.general.lastName.$touched || forms.general.$submitted) && forms.general.lastName.$invalid}">\n                <label class="control-label">{{\'APPLICATION_LASTNAME\' | translate}}</label>\n                <input type="text" name="lastName" placeholder="{{\'APPLICATION_LASTNAME\' | translate}}" class="form-control" data-ng-model="contact.lastName"/>\n                <span data-ng-show="(forms.general.lastName.$touched || forms.general.$submitted) && forms.general.lastName.$error.required" class="help-block help-block-error">\n                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                </span>\n              </div>\n              <!-- END LASTNAME -->\n\n              <!-- START COMPANY -->\n              <div class="form-group" data-ng-class="{\'has-error\': forms.general.CompanyId.$invalid && forms.general.$submitted}">\n                <label class="control-label">{{\'APPLICATION_COMPANY\' | translate}}</label>\n                <ui-select data-ng-model="contact.CompanyId" theme="bootstrap" name="CompanyId" ng-disabled="!companies.length">\n                  <ui-select-match allow-clear placeholder="{{ \'APPLICATION_COMPANY\' | translate }}">{{$select.selected.name}}</ui-select-match>\n                  <ui-select-choices repeat="company.id as company in companies | filter: $select.search">\n                    <div ng-bind-html="company.name | highlight: $select.search"></div>\n                  </ui-select-choices>\n                </ui-select>\n                <div class="note note-warning" data-ng-hide="companies.length">\n                  <h4 class="block">Warning!</h4>\n                  <p>\n                    {{ \'MESSAGE_NO_COMPANIES_AVAILABLE\' | translate }}\n                  </p>\n                  <p>\n                    {{\'APPLICATION_GO_TO\' | translate}} <a href="/contactmanager/companies/list">{{\'APPLICATION_COMPANIES\' | translate}}</a>\n                  </p>\n                </div>\n                <span data-ng-show="forms.general.CompanyId.$invalid && forms.general.$submitted" class="help-block help-block-error">\n                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                </span>\n              </div>\n              <!-- END COMPANY -->\n            </div>\n            <div class="col-md-4">\n              <!-- START PHONE -->\n              <div class="form-group" data-ng-class="{\'has-error\': (forms.general.phone.$touched || forms.general.$submitted) && forms.general.phone.$invalid}">\n                <label class="control-label">{{\'APPLICATION_PHONE\' | translate}}</label>\n                <input type="text" name="phone" placeholder="{{\'APPLICATION_PHONE\' | translate}}" class="form-control" data-ng-model="contact.phone"/>\n                <span data-ng-show="(forms.general.phone.$touched || forms.general.$submitted) && forms.general.phone.$error.required" class="help-block help-block-error">\n                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                </span>\n              </div>\n              <!-- END PHONE -->\n              <!-- START MOBILE -->\n              <div class="form-group" data-ng-class="{\'has-error\': (forms.general.mobile.$touched || forms.general.$submitted) && forms.general.mobile.$invalid}">\n                <label class="control-label">{{\'APPLICATION_MOBILE\' | translate}}</label>\n                <input type="text" name="mobile" placeholder="{{\'APPLICATION_MOBILE\' | translate}}" class="form-control" data-ng-model="contact.mobile"/>\n                <span data-ng-show="(forms.general.mobile.$touched || forms.general.$submitted) && forms.general.mobile.$error.required" class="help-block help-block-error">\n                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                </span>\n              </div>\n              <!-- END MOBILE -->\n              <!-- START EMAIL -->\n              <div class="form-group" data-ng-class="{\'has-error\': (forms.general.email.$touched || forms.general.$submitted) && forms.general.email.$invalid}">\n                <label class="control-label">{{\'APPLICATION_EMAIL\' | translate}}</label>\n                <input type="text" name="email" placeholder="{{\'APPLICATION_EMAIL\' | translate}}" class="form-control" data-ng-model="contact.email"/>\n                <span data-ng-show="(forms.general.email.$touched || forms.general.$submitted) && forms.general.email.$error.required" class="help-block help-block-error">\n                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                </span>\n              </div>\n              <!-- END EMAIL -->\n            </div>\n            <div class="col-md-4">\n              <!-- START FAX -->\n              <div class="form-group" data-ng-class="{\'has-error\': (forms.general.fax.$touched || forms.general.$submitted) && forms.general.fax.$invalid}">\n                <label class="control-label">{{\'APPLICATION_FAX\' | translate}}</label>\n                <input type="text" name="fax" placeholder="{{\'APPLICATION_FAX\' | translate}}" class="form-control" data-ng-model="contact.fax"/>\n                <span data-ng-show="(forms.general.fax.$touched || forms.general.$submitted) && forms.general.fax.$error.required" class="help-block help-block-error">\n                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                </span>\n              </div>\n              <!-- END FAX -->\n              <!-- START TAGS -->\n              <div class="form-group" data-ng-class="{\'has-error\': forms.general.tags.$invalid && forms.general.$submitted}">\n                <label class="control-label">{{\'APPLICATION_TAGS\' | translate}}</label>\n                <ui-select tagging tagging-label="" multiple=\'true\' data-ng-model="contact.tags" theme="bootstrap" name="tags" ng-disabled="disabled">\n                  <ui-select-match placeholder="{{ \'APPLICATION_TAGS\' | translate }}">{{$item}}</ui-select-match>\n                  <ui-select-choices repeat="tag in tags | filter: $select.search">\n                    {{tag}}\n                  </ui-select-choices>\n                </ui-select>\n                <span data-ng-show="forms.general.tags.$invalid && forms.general.$submitted" class="help-block help-block-error">\n                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                </span>\n              </div>\n              <!-- END TAGS -->\n              <!-- START SERVICE -->\n              <div class="form-group" data-ng-if="contact.id">\n                <label class="control-label">{{\'APPLICATION_SERVICE\' | translate}}</label>\n                <input type="text" name="service" placeholder="{{\'APPLICATION_SERVICE\' | translate}}" class="form-control" data-ng data-ng-model="contact.Service.name" disabled/>\n              </div>\n              <!-- END SERVICE -->\n              <!-- START SERVICE -->\n              <div data-ng-if="!contact.id" class="form-group" data-ng-class="{\'has-error\': forms.general.ServiceId.$invalid && forms.general.$submitted}">\n                <label class="control-label">{{\'APPLICATION_SERVICE\' | translate}}</label>\n                <ui-select data-ng-model="contact.ServiceId" theme="bootstrap" name="ServiceId" data-ng-change="getCustomFields()">\n                  <ui-select-match placeholder="{{ \'APPLICATION_SERVICE\' | translate }}">{{$select.selected.name}}</ui-select-match>\n                  <ui-select-choices repeat="service.id as service in services | filter: $select.search">\n                    <div ng-bind-html="service.name | highlight: $select.search"></div>\n                  </ui-select-choices>\n                </ui-select>\n                <span data-ng-show="forms.general.ServiceId.$invalid && forms.general.$submitted" class="help-block help-block-error">\n                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                </span>\n              </div>\n              <!-- END SERVICE -->\n            </div>\n            </div>\n            <div data-ng-class="{\'hidden\':detail.tab != \'other\'}" class="portlet-body contact-portlet row">\n              <div class="col-md-4">\n              <!-- START STREET -->\n              <div class="form-group" data-ng-class="{\'has-error\': (forms.general.street.$touched || forms.general.$submitted) && forms.general.street.$invalid}">\n                <label class="control-label">{{\'APPLICATION_STREET\' | translate}}</label>\n                <input type="text" name="street" placeholder="{{\'APPLICATION_STREET\' | translate}}" class="form-control" data-ng-model="contact.street"/>\n                <span data-ng-show="(forms.general.street.$touched || forms.general.$submitted) && forms.general.street.$error.required" class="help-block help-block-error">\n                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                </span>\n              </div>\n              <!-- END STREET -->\n\n              <!-- START POSTALCODE -->\n              <div class="form-group" data-ng-class="{\'has-error\': (forms.general.postalCode.$touched || forms.general.$submitted) && forms.general.postalCode.$invalid}">\n                <label class="control-label">{{\'APPLICATION_POSTALCODE\' | translate}}</label>\n                <input type="text" name="postalCode" placeholder="{{\'APPLICATION_POSTALCODE\' | translate}}" class="form-control" data-ng-model="contact.postalCode"/>\n                <span data-ng-show="(forms.general.postalCode.$touched || forms.general.$submitted) && forms.general.postalCode.$error.required" class="help-block help-block-error">\n                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                </span>\n              </div>\n              <!-- END POSTALCODE -->\n\n              <!-- START CITY -->\n              <div class="form-group" data-ng-class="{\'has-error\': (forms.general.city.$touched || forms.general.$submitted) && forms.general.city.$invalid}">\n                <label class="control-label">{{\'APPLICATION_CITY\' | translate}}</label>\n                <input type="text" name="city" placeholder="{{\'APPLICATION_CITY\' | translate}}" class="form-control" data-ng-model="contact.city"/>\n                <span data-ng-show="(forms.general.city.$touched || forms.general.$submitted) && forms.general.city.$error.required" class="help-block help-block-error">\n                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                </span>\n              </div>\n              <!-- END CITY -->\n            </div>\n            <div class="col-md-4">\n              <!-- START COUNTRY -->\n              <div class="form-group" data-ng-class="{\'has-error\': (forms.general.country.$touched || forms.general.$submitted) && forms.general.country.$invalid}">\n                <label class="control-label">{{\'APPLICATION_COUNTRY\' | translate}}</label>\n                <input type="text" name="country" placeholder="{{\'APPLICATION_COUNTRY\' | translate}}" class="form-control" data-ng-model="contact.country"/>\n                <span data-ng-show="(forms.general.country.$touched || forms.general.$submitted) && forms.general.country.$error.required" class="help-block help-block-error">\n                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                </span>\n              </div>\n              <!-- END COUNTRY -->\n\n              <!-- START DATEOFBIRTH -->\n              <div class="form-group" data-ng-class="{\'has-error\': (forms.general.dateOfBirth.$touched || forms.general.$submitted) && forms.general.dateOfBirth.$invalid}">\n                <label class="control-label">{{\'APPLICATION_DATEOFBIRTH\' | translate}}</label>\n                <input name="dateOfBirth" type="date" placeholder="{{\'APPLICATION_DATEOFBIRTH\' | translate}}" class="form-control date-picker" data-ng-model="contact.dateOfBirth"/>\n                <span data-ng-show="(forms.general.dateOfBirth.$touched || forms.general.$submitted) && forms.general.dateOfBirth.$error.required" class="help-block help-block-error">\n                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                </span>\n              </div>\n              <!-- END DATEOFBIRTH -->\n\n              <!-- START DESCRIPTION -->\n              <div class="form-group">\n                <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n                <textarea style="resize: vertical;" type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="contact.description"></textarea>\n              </div>\n              <!-- END DESCRIPTION -->\n            </div>\n            <div class="col-md-4">\n              <!-- START CREATED_BY -->\n              <div class="form-group" data-ng-if="contact.id">\n                <label class="control-label">{{\'APPLICATION_CREATED_BY\' | translate}}</label>\n                <input type="text" name="createdBy" placeholder="{{\'APPLICATION_CREATED_BY\' | translate}}" class="form-control" data-ng-model="contact.User.name" disabled/>\n              </div>\n              <!-- END CREATED_BY -->\n            </div>\n            </div>\n            </div>\n            <button type="submit" class="btn btn-circle green-haze btn-sm" data-ng-disabled="!contact.firstName">{{submitButtonLabel}}</button>\n          </div>\n          <!-- END PORTLET -->\n          <!-- BEGIN PORTLET -->\n          <div class="portlet light" data-ng-if="customFields.length">\n            <div class="portlet-title tabbable-line">\n              <div class="caption caption-md">\n                <i class="icon-globe theme-font hide"></i>\n                <span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_CUSTOM_FIELDS\' | translate}}</span>\n              </div>\n            </div>\n            <div class="portlet-body">\n              <div data-ng-repeat="customField in customFields">\n                <div data-ng-if="customField.type==\'text\'" class="form-group" data-ng-class="{\'has-error\': (forms.general[customField.name].$touched || forms.general.$submitted) && forms.general[customField.name].$invalid}">\n                  <label class="control-label">{{customField.alias}}</label>\n                  <input type="text" name="{{customField.name}}" placeholder="{{customField.alias}}" class="form-control" data-ng-model="contact[customField.name]"/>\n                  <span data-ng-show="(forms.general[customField.name].$touched || forms.general.$submitted) && forms.general[customField.name].$error.required" class="help-block help-block-error">\n                    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                  </span>\n                </div>\n                <div data-ng-if="customField.type==\'select\'" class="form-group" data-ng-class="{\'has-error\': forms.general[customField.name].$invalid && forms.general.$submitted}">\n                  <label class="control-label">{{customField.alias}}</label>\n                  <ui-select data-ng-model="contact[customField.name]" theme="bootstrap" name="{{customField.name}}" data-ng-disabled="disabled">\n                    <ui-select-match allow-clear placeholder="{{customField.alias}}">{{$select.selected.value}}</ui-select-match>\n                    <ui-select-choices repeat="choice.value as choice in customField.values | filter: $select.search">\n                      <div ng-bind-html="choice.value | highlight: $select.search"></div>\n                    </ui-select-choices>\n                  </ui-select>\n                  <span data-ng-show="forms.general[customField.name].$invalid && forms.general.$submitted" class="help-block help-block-error">\n                    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                  </span>\n                </div>\n              </div>\n              <button type="submit" class="btn btn-circle green-haze btn-sm" data-ng-disabled="!contact.firstName">{{submitButtonLabel}}</button>\n            </div>\n        </div>\n        <!-- END PORTLET -->\n      </div>\n      <div class="tab-pane fade" id="tab_1_2{{contact.id || \'\'}}">\n          <!-- BEGIN PORTLET -->\n          <div class="portlet light">\n            <div class="portlet-title tabbable-line">\n              <div class="caption caption-md">\n                <i class="icon-globe theme-font hide"></i>\n                <span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_LOG\' | translate}}</span>\n              </div>\n              <ul class="nav nav-tabs">\n                <li class="active">\n                  <a href="#" data-target="#tab_2_1" data-toggle="tab">{{ \'APPLICATION_JOURNAL\' | translate}}</a>\n                </li>\n                <li>\n                  <a href="#" data-target="#tab_2_2" data-toggle="tab">{{ \'APPLICATION_HISTORY\' | translate}}</a>\n                </li>\n              </ul>\n            </div>\n            <div class="portlet-body">\n              <!--BEGIN TABS-->\n              <div class="tab-content">\n                <div class="tab-pane active" id="tab_2_1">\n                  <div class="contact-portlet">\n                    <div class="actions">\n                      <div class="btn-group btn-group-devided" data-toggle="buttons">\n                        <label class="btn btn-transparent grey-salsa btn-circle btn-sm" data-ng-class="{\'active\':log.journal.show === \'phone\'}" data-ng-click="updateLog(\'journal\',\'phone\')">\n                        <input type="radio" class="toggle">{{\'APPLICATION_PHONES\' | translate}}</label>\n                        <label class="btn btn-transparent grey-salsa btn-circle btn-sm" data-ng-class="{\'active\':log.journal.show === \'email\'}" data-ng-click="updateLog(\'journal\',\'email\',\'general\')">\n                        <input type="radio" class="toggle">{{\'APPLICATION_EMAILS\' | translate}}</label>\n                      </div> |\n                      <div class="btn-group btn-group-devided" data-toggle="buttons">\n                        <label class="btn btn-transparent grey-salsa btn-circle btn-sm" data-ng-class="{\'active\':log.journal.type === \'inbound\'}" data-ng-click="updateLog(\'journal\',false,false,\'inbound\')">\n                        <input type="radio" class="toggle">{{\'APPLICATION_INBOUND\' | translate}}</label>\n                        <label class="btn btn-transparent grey-salsa btn-circle btn-sm" data-ng-class="{\'active\':log.journal.type === \'outbound\'}" data-ng-click="updateLog(\'journal\',false,\'general\',\'outbound\')">\n                        <input type="radio" class="toggle">{{\'APPLICATION_OUTBOUND\' | translate}}</label>\n                      </div> |\n                      <div class="btn-group btn-group-devided" data-toggle="buttons" data-ng-if="log.journal.show==\'phone\'">\n                        <label class="btn btn-transparent grey-salsa btn-circle btn-sm" data-ng-class="{\'active\':log.journal.detail === \'general\'}" data-ng-click="updateLog(\'journal\',false,\'general\',false)">\n                        <input type="radio" class="toggle">{{\'APPLICATION_GENERAL\' | translate}}</label>\n                        <label data-ng-if="log.journal.type===\'inbound\'" class="btn btn-transparent grey-salsa btn-circle btn-sm" data-ng-class="{\'active\':log.journal.detail === \'queue\'}" data-ng-click="updateLog(\'journal\',false,\'queue\',\'inbound\')">\n                        <input type="radio" class="toggle">{{\'APPLICATION_QUEUES\' | translate}}</label>\n                      </div>\n                    </div>\n                    <div data-ng-if="gridOptionsjournal"  ui-grid="gridOptionsjournal"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n                      <div class="watermark" ng-show="!gridOptionsjournal.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n                    </div>\n                  </div>\n              </div>\n                <div class="tab-pane" id="tab_2_2">\n                  <div class="contact-portlet">\n                    <div class="actions">\n                      <div class="btn-group btn-group-devided" data-toggle="buttons">\n                        <label class="btn btn-transparent grey-salsa btn-circle btn-sm" data-ng-class="{\'active\':log.history.show === \'phone\'}" data-ng-click="updateLog(\'history\',\'phone\')">\n                        <input type="radio" class="toggle">{{\'APPLICATION_PHONES\' | translate}}</label>\n                        <label class="btn btn-transparent grey-salsa btn-circle btn-sm" data-ng-class="{\'active\':log.history.show === \'email\'}" data-ng-click="updateLog(\'history\',\'email\',\'general\')">\n                        <input type="radio" class="toggle">{{\'APPLICATION_EMAILS\' | translate}}</label>\n                      </div> |\n                      <div class="btn-group btn-group-devided" data-toggle="buttons">\n                        <label class="btn btn-transparent grey-salsa btn-circle btn-sm" data-ng-class="{\'active\':log.history.type === \'inbound\'}" data-ng-click="updateLog(\'history\',false,false,\'inbound\')">\n                        <input type="radio" class="toggle">{{\'APPLICATION_INBOUND\' | translate}}</label>\n                        <label class="btn btn-transparent grey-salsa btn-circle btn-sm" data-ng-class="{\'active\':log.history.type === \'outbound\'}" data-ng-click="updateLog(\'history\',false,\'general\',\'outbound\')">\n                        <input type="radio" class="toggle">{{\'APPLICATION_OUTBOUND\' | translate}}</label>\n                      </div> |\n                      <div class="btn-group btn-group-devided" data-toggle="buttons" data-ng-if="log.history.show==\'phone\'">\n                        <label class="btn btn-transparent grey-salsa btn-circle btn-sm" data-ng-class="{\'active\':log.history.detail === \'general\'}" data-ng-click="updateLog(\'history\',false,\'general\',false)">\n                        <input type="radio" class="toggle">{{\'APPLICATION_GENERAL\' | translate}}</label>\n                        <label data-ng-if="log.history.type===\'inbound\'" class="btn btn-transparent grey-salsa btn-circle btn-sm" data-ng-class="{\'active\':log.history.detail === \'queue\'}" data-ng-click="updateLog(\'history\',false,\'queue\',\'inbound\')">\n                        <input type="radio" class="toggle">{{\'APPLICATION_QUEUES\' | translate}}</label>\n                      </div>\n                    </div>\n                    <div data-ng-if="gridOptionshistory"  ui-grid="gridOptionshistory"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n                      <div class="watermark" ng-show="!gridOptionshistory.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n                    </div>\n                  </div>\n                </div>\n              </div>\n              <!--END TABS-->\n            </div>\n          </div>\n          <!-- END PORTLET -->\n        </div>\n    <!-- END PROFILE CONTENT -->\n  </form>\n</div>\n  </div>\n</div>\n'),
-a.put("app/main/template/template.jscriptyTab.html",'<div class="portlet light bordered">\n\n    <!-- BEGIN PORTLET BODY -->\n    <div class="portlet-body">\n          <div class="row">\n              <!-- BEGIN SIDEBAR -->\n                <div  class="profile-sidebar" style="width: 250px;">\n                  <!-- PORTLET MAIN -->\n              				<!-- SIDEBAR MENU -->\n              				<div class="profile-usermenu">\n              					<ul class="nav">\n              						<li  ng-repeat= \'question in questions track by $index\' ng-class="{active: $index == count}">\n\n              							<a  ng-click="setCurrentQuestion($index)" >\n  																	<i class="fa fa-check"></i> <label ng-if="attribute.nodeName == \'label\'" ng-repeat=\'attribute in question.value.attributes track by $index\'>{{attribute.value}}</label>\n\n                            </a>\n              						</li>\n              					</ul>\n              				</div>\n              				<!-- END SIDEBAR MENU -->\n                    <!-- END PORTLET MAIN -->\n                </div>\n                  <!-- END SIDEBAR -->\n                  <div   class="profile-content">\n                        <div class="portlet box blue-hoki">\n        												<div class="portlet-title">\n\n        													<div class="caption" >\n        														<i class="fa fa-edit"></i>\n                                 <span ng-if="attribute.nodeName ==\'label\'" ng-repeat=\'attribute in currentQuestion.value.attributes\' class="caption-subject">{{attribute.value}} </span>\n\n        													</div>\n\n\n        												</div>\n                                <div class="portlet-body form ">\n                                  <div class="row">\n																		<div class="col-md-11 col-md-offset-1 ">\n                                        <form >\n                                          <div class="form-body" style="height: 400px; overflow-y: auto;overflow-x:hidden">\n\n                                             <!-- Question  -->\n                                             <div class="form-group" style="word-wrap: break-word;" >\n                                                <h3 ng-if="attribute.nodeName ==\'question\'" ng-repeat=\'attribute in currentQuestion.value.attributes\'>{{attribute.value}}</h3>\n                                              </div>\n                                              <!-- Buttons  -->\n\n                                                <div class="row">\n                                                  <div class="col-md-6">\n                                                    <ul class="nav nav-pills nav-stacked" >\n                                                      <li  ng-repeat=\'edge in currentQuestion.edges track by $index\'  style="background-color: #E8F7FC" ng-show="(edge.source.id == currentQuestion.id) && edge.value" ng-class="{active: (edge.value) == currentQuestion.answer}">\n                                                        <a  ng-click="next(edge.target, edge.value)" >\n                                                                <span style=" display:block;word-break:break-all;">{{edge.value}}</span>\n                                                            </a>\n                                                      </li>\n                                                    </ul>\n                                                  </div>\n                                                </div>\n\n\n                                               <!-- Question Other Option  -->\n\n                                               <div class="form-group" ng-if= "attribute.nodeName ==\'other\' && attribute.value " ng-repeat=\'attribute in currentQuestion.value.attributes track by $index\'>\n                                                 <div class="col-md-4">\n                                                   <label class="control-label">{{attribute.value}}</label>\n                                                 </div>\n                                                    <div class="col-md-8">\n                                                      <textarea  style="overflow:auto" ng-model="currentQuestion.otheranswer" placeholder="Enter text" rows="8" cols="40" ></textarea>\n                                                    </div>\n\n                    													</div>\n                                              <!--  Inputs -->\n\n                                                  <div class="row margin-top-10"  ng-repeat=\'question in currentQuestion.children track by $index\'>\n                                                              <div class="col-md-10 col-md-offset-1">\n                                                                <div  ng-repeat=\'attribute in question.value.attributes track by $index\'>\n                                                                      <div  ng-switch="attribute.nodeName">\n                                                                          <div ng-class="col-md-2" ng-switch-when="label">\n                                                                            <label class="control-label" style=" display:block;word-break:break-all;" >{{attribute.value}}</label>\n\n                                                                          </div>\n\n                                                                          <div ng-class="attribute.value != \'checkbox\' ? \'col-md-10 pull-right\': \'col-md-2\'" ng-switch-when="type" ng-switch="attribute.value">\n                                                                              <input class="form-control" ng-switch-when="text" type="text" ng-model="question.answer" />\n                                                                              <input  class="form-control" ng-switch-when="number" type="number" ng-model="question.answer" />\n                                                                              <input  class=" pull-right"  ng-switch-when="checkbox" type="checkbox" ng-model="question.answer" ng-true-value="\'Selected\'" ng-false-value="\'Not Selected\'"/>\n                                                                              <textarea  class="form-control" ng-switch-when="textarea" ng-model="question.answer" rows="8" cols="40"></textarea>\n\n                                                                          </div>\n\n                                                                      </div>\n                                                                </div>\n                                                              </div>\n\n                                                  </div>\n\n                                          </div>\n                                          <!-- actions -->\n                                          <div class="form-actions">\n                                            <div class="btn-set pull-left">\n                                              <button class="btn red-haze "   ng-click="end()"><span class="fa fa-times" > End</span></button>\n\n                                            </div>\n                                            <div class="btn-set pull-right">\n                                               <button class="btn blue-haze"  ng-show="count" ng-click="back()"><span class="glyphicon glyphicon-chevron-left"></span>Back</button>\n                                                <button ng-repeat=\'edge in currentQuestion.edges track by $index\' ng-show="(edge.source.id == currentQuestion.id) && !edge.value" class="btn blue-hoki"   ng-click="next(edge.target)">Next<span class="glyphicon glyphicon-chevron-right" ></span></button>\n\n                                            </div>\n                                          </div>\n                                          </form>\n                                  </div>\n                                </div>\n                            </div>\n                        </div>\n                 </div>\n          </div>\n  </div>\n  <!-- END PORTLET BODY -->\n</div>\n'),a.put("app/main/template/template.reportBuilderView.html",'<div class="alert alert-warning alert-group">\n        <div class="form-inline" data-ng-class="{\'has-error\': forms.report.$submitted && !group.rules.length}">\n            <select ng-options="o.name as o.name for o in operators" ng-model="group.operator" class="form-control input-sm"></select>\n            <button style="margin-left: 5px" type="button" ng-click="addCondition()" class="btn btn-sm btn-success"><span class="glyphicon glyphicon-plus-sign"></span> {{\'APPLICATION_ADD_CONDITION\' | translate}}</button>\n            <button style="margin-left: 5px" type="button" ng-click="addGroup()" class="btn btn-sm btn-success"><span class="glyphicon glyphicon-plus-sign"></span> {{\'APPLICATION_ADD_GROUP\' | translate}}</button>\n            <button style="margin-left: 5px" type="button" ng-click="removeGroup()" class="btn btn-sm btn-danger"><span class="glyphicon glyphicon-minus-sign"></span> {{\'APPLICATION_REMOVE_GROUP\' | translate}}</button>\n        </div>\n        <div class="group-conditions">\n            <div ng-repeat="rule in group.rules | orderBy:\'index\'" class="condition">\n                <div ng-switch="rule.hasOwnProperty(\'group\')">\n                    <div ng-switch-when="true">\n                        <report-builder group="rule.group" fields="fields" forms="forms"></report-builder>\n                    </div>\n                    <div ng-switch-default="ng-switch-default">\n                        <div class="row">\n                          <div class="col-md-2" data-ng-class="{\'has-error\': forms.report.$submitted && !rule.field}">\n                          <ui-select data-ng-model="rule.field" theme="bootstrap" dynamic-name="randomName()" required>\n                            <ui-select-match placeholder="">{{$select.selected.field | translate}}</ui-select-match>\n                            <ui-select-choices repeat="field.field as field in fields | filter: $select.search">\n                              <div ng-bind-html="field.field | highlight: $select.search"></div>\n                            </ui-select-choices>\n                          </ui-select>\n                          <span data-ng-show="forms.report.$submitted && !rule.field" class="help-block help-block-error">\n                            <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                          </span>\n                        </div>\n                          <ui-select data-ng-model="rule.condition" theme="bootstrap" class="col-md-1" dynamic-name="randomName()">\n                            <ui-select-match placeholder="">{{$select.selected.name}}</ui-select-match>\n                            <ui-select-choices repeat="condition.name as condition in conditions | filter: $select.search">\n                              <div ng-bind-html="condition.name | highlight: $select.search"></div>\n                            </ui-select-choices>\n                          </ui-select>\n                          <div class="col-md-2 left-margin" data-ng-class="{\'has-error\': forms.report.$submitted && !rule.value}">\n                            <input type="text" ng-model="rule.value" class="form-control" dynamic-name="randomName()" required/>\n                            <span data-ng-show="forms.report.$submitted && !rule.value" class="help-block help-block-error">\n															<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n														</span>\n                          </div>\n                            <button style="margin-left: 5px" ng-click="removeCondition($index)" class="btn btn-sm btn-danger" type="button"><span class="glyphicon glyphicon-minus-sign"></span></button>\n                        </div>\n                    </div>\n                </div>\n            </div>\n        </div>\n    </div>\n'),a.put("app/market/market.html",'<div class="row">\n	<div class="col-md-12">\n			<div class="page-bar">\n				<ul class="page-breadcrumb">\n					<li>\n						<i class="icon-rocket"></i>\n						<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-handbag"></i>\n						<a href="/market">Market Place</a>\n          </li>\n        </ul>\n			</div>\n		</div>\n</div>\n<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initView()">\n  <div class="col-md-12">\n    <!-- Our Integration -->\n    <div class="headline">\n      <h3>Our Integrations</h3>\n    </div>\n    <div class="row thumbnails" data-ng-repeat="group in groupedIntegration">\n      <div class="col-md-3" data-ng-repeat="integration in group">\n        <div class="our-integrations">\n          <h3> {{integration.name}} <small> {{integration.author}}</small></h3>\n          <img data-ng-src="{{integration.logo}}" alt="{{integration.name}}" class="img-responsive"/>\n          <div class="integration-info" data-ng-if="!integration.downloading">\n            <p>\n              {{integration.description}}\n            </p>\n            <div class="pull-right">\n	            <a data-ng-disabled="isProgressing" data-ng-if="!integration.active" data-ng-click="installIntegration(integration)" href="#" class="btn btn-xs green-meadow">Install <i class="fa fa-download"></i></a>\n							<a data-ng-disabled="isProgressing" data-ng-if="integration.active" data-ng-click="uninstallIntegration(integration)" href="#" class="btn btn-xs red-sunglo">Uninstall <i class="fa fa-trash"></i></a>\n	            <a href="https://wiki.xcallymotion.com/" class="btn btn-xs grey-cascade" target="_blank">More <i class="fa fa-link"></i></a>\n            </div>\n          </div>\n					<div class="integration-info" data-ng-if="integration.downloading">\n						<div>\n							<uib-progressbar class="progress-striped active" value="percentage" type="success"><i style="color:black;">{{status}}</i></uib-progressbar>\n						</div>\n          </div>\n        </div>\n      </div>\n		</div>\n    <!--/thumbnails-->\n    <!-- //End Meer Our Team -->\n  </div>\n</div>\n'),a.put("app/motionbar/motionbar.chat.html",'<div data-ng-include="\'components/quickSidebar/quickSidebar.html\'" data-ng-controller="QuickSidebarController" class="page-quick-sidebar-wrapper" style="margin-top: -92px;"></div>\n'),a.put("app/salesforce/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-handbag"></i>\n					<a href="/salesforce/list">{{ \'APPLICATION_SALESFORCE\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-handbag font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_SALESFORCE\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="accounts.checked.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<a class="btn green-jungle" href="/salesforce/wizard">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_ACCOUNT\' | translate }}\n						</a>\n					</div>\n					<a class="btn btn-icon-only btn-default" href="#" ng-csv="getAccounts([\'name\',\'username\',\'remoteUri\',\'password\',\'clientId\',\'clientSecret\',\'securityToken\'])" csv-header="[\'Name\', \'Username\', \'Remote Address\', \'Password\', \'Client Id\', \'Client Secret\', \'Security token\']" field-separator=";" filename="salesforce_accounts.csv">\n					<i class="icon-cloud-download"></i></a>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<table st-table="displayedSalesforceAccounts" st-pipe="initList" class="table table-striped table-bordered table-hover">\n					<div class="table-responsive">\n					  <thead>\n							<tr>\n								<th colspan="7">\n									<div class="row">\n										<div class="col-md-6">\n											<ui-select class="input-xsmall" ng-model="conf.accountsByPage" theme="bootstrap" ng-disabled="disabled">\n												<ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n												<ui-select-choices repeat="accountByPage in accountsByPage | filter: $select.search">\n													<div ng-bind-html="accountByPage.name | highlight: $select.search"></div>\n												</ui-select-choices>\n											</ui-select>\n										</div>\n										<div class="col-md-6">\n											<div class="input-group input-medium pull-right">\n												<input st-search placeholder="{{ \'APPLICATION_SEARCH\' | translate }}" class="form-control" type="search" />\n												<span class="input-group-addon">\n													<i class="fa fa-search"></i>\n												</span>\n											</div>\n										</div>\n									</div>\n								</th>\n							</tr>\n						  <tr>\n								<th class="small-cells" style="text-align: center; vertical-align: middle"><input type="checkbox" ng-change="check(account, checked)" checklist-model checklist-value="id"></th>\n						    <th st-sort="name">{{ \'APPLICATION_NAME\' | translate }}</th>\n						    <th st-sort="username">{{ \'APPLICATION_EMAIL\' | translate }}</th>\n								<th st-sort="remoteUri">{{ \'APPLICATION_REMOTE_ADDRESS\' | translate }}</th>\n								<th>{{ \'APPLICATION_DESCRIPTION\' | translate }}</th>\n								<th>{{ \'APPLICATION_ACTIONS\' | translate }}</th>\n						  </tr>\n					  </thead>\n					  <tbody>\n					    <tr data-ng-repeat="account in displayedSalesforceAccounts" class="animate-repeat">\n								<td style="text-align: center; vertical-align: middle"><input type="checkbox" checklist-model="accounts.checked" checklist-value="account.id"></td>\n					      <td>{{account.name}}</td>\n					      <td>{{account.username}}</td>\n								<td>{{account.remoteUri}}</td>\n								<td>{{account.description}}</td>\n					      <td>\n					        <a class="btn default btn-xs blue-stripe" data-ng-href="/salesforce/view/{{account.id}}/account">\n										{{ \'APPLICATION_EDIT\' | translate }}\n					        </a>\n									<a class="btn default btn-xs green-stripe" data-ng-click="checkAccount(account.id)">\n										{{ \'APPLICATION_CHECK_CONNECTION\' | translate }}\n					        </a>\n					        <a class="btn default btn-xs red-stripe" data-ng-click="deleteItem(account.name,account.id)">\n										{{ \'APPLICATION_DELETE\' | translate }}\n					        </a>\n					      </td>\n					    </tr>\n							<tr data-ng-hide="displayedSalesforceAccounts.length">\n								<td colspan="7" style="text-align:center;">\n									<i>No account available</i>\n								</td>\n							</tr>\n					  </tbody>\n					  <tfoot>\n							<tr>\n								<td/>\n						    <td>\n									<div class="input-icon right">\n										<i class="fa fa-search"></i>\n										<input st-search="name" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_NAME\' | translate | lowercase}}" class="form-control" type="search"/>\n									</div>\n						    </td>\n						    <td>\n									<div class="input-icon right">\n										<i class="fa fa-search"></i>\n										<input st-search="email" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_EMAIL\' | translate | lowercase}}" class="form-control" type="search"/>\n									</div>\n						    </td>\n						    <td>\n									<div class="input-icon right">\n										<i class="fa fa-search"></i>\n										<input st-search="remoteUri" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_REMOTE_ADDRESS\' | translate | lowercase}}" class="form-control" type="search"/>\n									</div>\n						    </td>\n						    <td/>\n								<td/>\n						  </tr>\n					    <tr>\n					      <td colspan="7" class="text-center">\n									<div class="pagination" st-pagination st-items-by-page="conf.accountsByPage.value" st-displayed-pages="7"></div>\n					      </td>\n					    </tr>\n					  </tfoot>\n					</div>\n				</table>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/salesforce/view/view.account.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_ACCOUNT\' | translate}}</span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{\'APPLICATION_GENERALS\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.formSetting" data-ng-submit="forms.formSetting.$valid && updateItem()" novalidate>\n              <!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="account.name" required/>\n								<span data-ng-show="forms.formSetting.name.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="account.description"/>\n							</div>\n							<!-- END DESCRIPTION -->\n\n              <!-- START USERNAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.username.$invalid}">\n								<label class="control-label">{{\'APPLICATION_USERNAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="username" placeholder="{{\'APPLICATION_USERNAME\' | translate}}" class="form-control" data-ng-model="account.username" required/>\n								<span data-ng-show="forms.formSetting.username.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END USERNAME -->\n\n              <!-- START REMOTE ADDRESS -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.remoteUri.$invalid}">\n								<label class="control-label">{{\'APPLICATION_REMOTE_ADDRESS\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="url" name="remoteUri" placeholder="{{\'APPLICATION_REMOTE_ADDRESS\' | translate}}" class="form-control" data-ng-model="account.remoteUri" required />\n								<span data-ng-show="forms.formSetting.remoteUri.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END USERNAME -->\n\n							<!-- START PASSWORD -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.password.$invalid}">\n								<label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="password" name="password" placeholder="{{\'APPLICATION_PASSWORD\' | translate}}" class="form-control" data-ng-model="account.password" required/>\n								<span data-ng-show="forms.formSetting.password.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END PASSWORD -->\n\n              <!-- START CLIENT ID -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.clientId.$invalid}">\n								<label class="control-label">{{\'APPLICATION_CLIENT_ID\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="clientId" placeholder="{{\'APPLICATION_CLIENT_ID\' | translate}}" class="form-control" data-ng-model="account.clientId" required/>\n								<span data-ng-show="forms.formSetting.clientId.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END CLIENT ID -->\n\n              <!-- START CLIENT SECRET -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.clientSecret.$invalid}">\n								<label class="control-label">{{\'APPLICATION_CLIENT_SECRET\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="clientSecret" placeholder="{{\'APPLICATION_CLIENT_SECRET\' | translate}}" class="form-control" data-ng-model="account.clientSecret" required/>\n								<span data-ng-show="forms.formSetting.clientSecret.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END CLIENT SECRET -->\n\n              <!-- START SECURITY TOKEN -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.securityToken.$invalid}">\n								<label class="control-label">{{\'APPLICATION_SECURITY_TOKEN\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="securityToken" placeholder="{{\'APPLICATION_SECURITY_TOKEN\' | translate}}" class="form-control" data-ng-model="account.securityToken" required/>\n								<span data-ng-show="forms.formSetting.securityToken.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END SECURITY TOKEN -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END GENERAL TAB -->\n\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/salesforce/view/view.configuration.html",'<div class="row" data-ng-init="initConfiguration()">\n	<div class="col-md-12">\n		<!-- BEGIN  PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-notebook font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_CONFIGURATION\' | translate }} WIZARD</a> </span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<wizard on-finish="createConfiguration()">\n	        <wz-step title="{{\'APPLICATION_SETTINGS\' | translate}}" canexit="formValidation(formsConfiguration.info.$valid)">\n							<form name="formsConfiguration.info" novalidate>\n								<!-- START NAME -->\n								<div class="form-group" data-ng-class="{\'has-error\': formsConfiguration.info.$submitted && formsConfiguration.info.name.$invalid}">\n									<label class="control-label">{{\'APPLICATION_NAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n									<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="configuration.name" required/>\n									<span data-ng-show="formsConfiguration.info.name.$invalid && formsConfiguration.info.$submitted" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END NAME -->\n								<!-- START DESCRIPTION -->\n								<div class="form-group">\n									<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n									<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="configuration.description"/>\n								</div>\n								<!-- END DESCRIPTION -->\n\n								<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" data-ng-click="goNext()"/>\n							</form>\n						</wz-step>\n\n						<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n							<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n							<input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n						</wz-step>\n				</wizard>\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/salesforce/view/view.configurationSettings.html",'<div class="row" data-ng-init="getConfiguration();getVariables();getFields();">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_CONFIGURATION\' | translate}}: {{configurationName}}</span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{\'APPLICATION_SUBJECT\' | translate}}</a>\n					</li>\n          <li>\n						<a href="#" data-target="#tab_1_2" data-toggle="tab">{{\'APPLICATION_DESCRIPTION\' | translate}}</a>\n					</li>\n          <li>\n						<a href="#" data-target="#tab_1_3" data-toggle="tab">{{\'APPLICATION_FIELDS\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- SUBJECT TAB -->\n					<div class="tab-pane ui-padding active" id="tab_1_1">\n            <div class="row">\n              <div class="col-md-11">\n                <span class="caption-subject">All following fields will be join by blank space:</span>\n              </div>\n              <div class="col-md-1 pull-rigth">\n                <button class="btn btn-icon-only green" data-ng-click="addItemSubject()"><i class="fa fa-plus"></i></button>\n              </div>\n            </div>\n            <hr>\n						<!-- <div ng-scrollbars ng-scrollbars-config="config"> -->\n	            <div class="row" data-ng-repeat="subjectItem in subjectConfig">\n	              <div class="col-md-3">\n	                <ui-select ng-model="subjectItem.type" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeType(subjectItem)">\n	                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n	                  <ui-select-choices repeat="item in fieldType | filter: $select.search">\n	                    <div ng-bind-html="item | highlight: $select.search | capitalize"></div>\n	                  </ui-select-choices>\n	                </ui-select>\n	              </div>\n	              <div class="col-md-8" data-ng-if="subjectItem.type==\'string\'">\n	                <div class="form-group">\n	                  <input type="text" class="form-control" data-ng-model="subjectItem.content" data-ng-change="updateField(subjectItem)">\n	                </div>\n	              </div>\n	              <div class="col-md-8" data-ng-if="subjectItem.type==\'variable\'">\n	                <div class="form-group">\n	                  <ui-select theme="bootstrap" ng-disabled="disabled" data-ng-model="subjectItem.VariableId" data-ng-change="updateField(subjectItem)">\n	                    <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n	                    <ui-select-choices repeat="variable.id as variable in variables | filter: $select.search">\n	                      <div ng-bind-html="variable.name | highlight: $select.search"></div>\n	                    </ui-select-choices>\n	                  </ui-select>\n	                </div>\n	              </div>\n	              <div class="col-md-1">\n	                <div class="form-group">\n	                  <button class="btn btn-icon-only red" data-ng-click="removeItem(subjectItem)"><i class="fa fa-times"></i></button>\n	                </div>\n	              </div>\n	            </div>\n						<!-- </div> -->\n					</div>\n					<!-- END SUBJECT TAB -->\n          <!-- DESCRIPTION TAB -->\n					<div class="tab-pane ui-padding" id="tab_1_2">\n						<div class="row">\n              <div class="col-md-11">\n                <span class="caption-subject">All following fields will be join by new line:</span>\n              </div>\n              <div class="col-md-1 pull-rigth">\n                <button class="btn btn-icon-only green" data-ng-click="addItemDescription()"><i class="fa fa-plus"></i></button>\n              </div>\n            </div>\n            <hr>\n						<!-- <div ng-scrollbars ng-scrollbars-config="config"> -->\n							<div class="row" data-ng-repeat="descriptionItem in descriptionConfig">\n								<!-- <pre>\n									{{descriptionItem|json}}\n								</pre> -->\n	              <div class="col-md-2">\n	                <ui-select ng-model="descriptionItem.type" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeDescType(descriptionItem)">\n	                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected | ucfirst}}</ui-select-match>\n	                  <ui-select-choices repeat="item in descFieldType | filter: $select.search">\n	                    <div ng-bind-html="item | highlight: $select.search | ucfirst"></div>\n	                  </ui-select-choices>\n	                </ui-select>\n	              </div>\n	              <div class="col-md-9" data-ng-if="descriptionItem.type==\'string\'">\n	                <div class="form-group">\n	                  <input type="text" class="form-control" data-ng-model="descriptionItem.content" data-ng-change="updateField(descriptionItem)">\n	                </div>\n	              </div>\n								<div class="col-md-3" data-ng-if="descriptionItem.type==\'key_value\'">\n									<input type="text" class="form-control" placeholder="Key" data-ng-model="descriptionItem.key" data-ng-change="updateField(descriptionItem)">\n								</div>\n								<div class="col-md-3" data-ng-if="descriptionItem.type==\'key_value\'">\n									<ui-select ng-model="descriptionItem.keyType" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeDescType(descriptionItem)">\n	                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n	                  <ui-select-choices repeat="item in fieldType | filter: $select.search">\n	                    <div ng-bind-html="item | highlight: $select.search | capitalize"></div>\n	                  </ui-select-choices>\n	                </ui-select>\n								</div>\n								<div class="col-md-3" data-ng-if="descriptionItem.type==\'key_value\' && descriptionItem.keyType==\'string\'">\n									<input type="text" class="form-control" placeholder="Value" data-ng-model="descriptionItem.keyContent" data-ng-change="updateField(descriptionItem)">\n								</div>\n	              <div class="col-md-3" data-ng-if="descriptionItem.type==\'key_value\' && descriptionItem.keyType==\'variable\'">\n	                <div class="form-group">\n	                  <ui-select theme="bootstrap" ng-disabled="disabled" data-ng-model="descriptionItem.VariableId" data-ng-change="updateField(descriptionItem)">\n	                    <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n	                    <ui-select-choices repeat="variable.id as variable in variables | filter: $select.search">\n	                      <div ng-bind-html="variable.name | highlight: $select.search"></div>\n	                    </ui-select-choices>\n	                  </ui-select>\n	                </div>\n	              </div>\n	              <div class="col-md-1">\n	                <div class="form-group">\n	                  <button class="btn btn-icon-only red" data-ng-click="removeItem(descriptionItem)"><i class="fa fa-times"></i></button>\n	                </div>\n	              </div>\n	            </div>\n						<!-- </div> -->\n					</div>\n					<!-- END DESCRIPTION TAB -->\n          <!-- FIELDS TAB -->\n					<div class="tab-pane ui-padding" id="tab_1_3">\n						<div class="row">\n              <div class="col-md-11">\n                <span class="caption-subject">Add how to fill the fields present in your account:</span>\n              </div>\n              <div class="col-md-1 pull-rigth">\n                <button class="btn btn-icon-only green" data-ng-click="addItemField()"><i class="fa fa-plus"></i></button>\n              </div>\n            </div>\n            <hr>\n						<!-- <div ng-scrollbars ng-scrollbars-config="config"> -->\n	            <div class="row" data-ng-repeat="fieldItem in fieldConfig">\n	              <div class="col-md-3">\n	                <ui-select ng-model="fieldItem.idField" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeFieldType(fieldItem)">\n	                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.label}}</ui-select-match>\n	                  <ui-select-choices repeat="item.name as item in accountFields | filter: $select.search">\n	                    <div ng-bind-html="item.label | highlight: $select.search"></div>\n	                  </ui-select-choices>\n	                </ui-select>\n	              </div>\n	              <div class="col-md-8" data-ng-if="getSystemFieldOptions(fieldItem.idField)">\n	                <div class="form-group">\n										<ui-select ng-model="fieldItem.content" theme="bootstrap" ng-disabled="disabled" data-ng-change="updateField(fieldItem)">\n		                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.label}}</ui-select-match>\n		                  <ui-select-choices repeat="item.value as item in getSystemFieldOptions(fieldItem.idField) | filter: $select.search">\n		                    <div ng-bind-html="item.value | highlight: $select.search"></div>\n		                  </ui-select-choices>\n		                </ui-select>\n	                </div>\n	              </div>\n								<div class="col-md-4" data-ng-if="!getSystemFieldOptions(fieldItem.idField)">\n									<div class="form-group">\n										<ui-select ng-model="fieldItem.type" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeType(fieldItem)">\n		                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected | ucfirst}}</ui-select-match>\n		                  <ui-select-choices repeat="item in fieldType | filter: $select.search">\n		                    <div ng-bind-html="item | highlight: $select.search | ucfirst"></div>\n		                  </ui-select-choices>\n		                </ui-select>\n									</div>\n								</div>\n								<div class="col-md-4" data-ng-if="!getSystemFieldOptions(fieldItem.idField) && fieldItem.type === \'string\'">\n	                <div class="form-group">\n										<input type="text" class="form-control" data-ng-model="fieldItem.content" data-ng-change="updateField(fieldItem)">\n	                </div>\n	              </div>\n								<div class="col-md-4" data-ng-if="!getSystemFieldOptions(fieldItem.idField) && fieldItem.type === \'variable\'">\n	                <div class="form-group">\n										<ui-select theme="bootstrap" ng-disabled="disabled" data-ng-model="fieldItem.VariableId" data-ng-change="updateField(fieldItem)">\n	                    <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n	                    <ui-select-choices repeat="variable.id as variable in variables | filter: $select.search">\n	                      <div ng-bind-html="variable.name | highlight: $select.search"></div>\n	                    </ui-select-choices>\n	                  </ui-select>\n	                </div>\n	              </div>\n	              <div class="col-md-1">\n	                <div class="form-group">\n	                  <button class="btn btn-icon-only red" data-ng-click="removeItem(fieldItem)"><i class="fa fa-times"></i></button>\n	                </div>\n	              </div>\n	            </div>\n						<!-- </div> -->\n					</div>\n					<!-- END FIELDS TAB -->\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),
-a.put("app/salesforce/view/view.configurations.html",'<div ui-view class="profile-content">\n	<div class="row" data-ng-init="getConfigurations()">\n		<div class="col-md-12">\n			<div class="portlet light">\n				<div class="portlet-title  tabbable-line">\n					<div class="caption caption-md">\n						<i class="icon-globe theme-font hide"></i>\n						<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_CONFIGURATIONS\' | translate}}</span>\n					</div>\n					<div class="actions">\n						<div class="btn-group">\n							<a class="btn green-jungle " href="/salesforce/view/{{account.id}}/configuration" data-toggle="dropdown">\n								<i class="icon-plus"></i> {{ \'APPLICATION_NEW_CONFIGURATION\' | translate }}\n							</a>\n						</div>\n					</div>\n				</div>\n				<div class="portlet-body">\n					<!-- START TABLE -->\n					<table class="table table-striped table-bordered table-hover">\n						  <thead>\n							  <tr>\n							    <th>{{\'APPLICATION_NAME\' | translate}}</th>\n									<th>{{\'APPLICATION_DESCRIPTION\' | translate}}</th>\n									<th>{{ \'APPLICATION_ACTIONS\' | translate }}</th>\n							  </tr>\n						  </thead>\n							<tbody>\n						    <tr data-ng-repeat="configuration in configurations">\n									<td>{{configuration.name}}</td>\n									<td>{{configuration.description}}</td>\n						      <td>\n										<a class="btn default btn-xs blue-stripe" data-ng-href="/salesforce/view/{{account.id}}/configurations/settings/{{configuration.id}}">\n											{{ \'APPLICATION_SETTINGS\' | translate}}\n						        </a>\n						        <a class="btn default btn-xs red-stripe" data-ng-click="deleteConfiguration(configuration.name,configuration.id)">\n											{{ \'APPLICATION_DELETE\' | translate }}\n						        </a>\n						      </td>\n						    </tr>\n								<tr data-ng-hide="configurations.length">\n									<td colspan="5" style="text-align:center;">\n										<i>No configuration available</i>\n									</td>\n								</tr>\n						  </tbody>\n					</table>\n					<!-- END TABLE -->\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/salesforce/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initView()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n          <i class="icon-handbag"></i>\n          <a href="/salesforce/list">{{ \'APPLICATION_SALESFORCE\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<a href="#">{{account.name}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img src="assets/images/media/salesforce.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{account.name}}\n					</div>\n					<div class="profile-usertitle-job">\n						{{account.remoteUri}}\n					</div>\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.salesforce.view.account\')}">\n							<a ng-href="/salesforce/view/{{account.id}}/account">\n							<i class="icon-user"></i>\n							{{ \'APPLICATION_ACCOUNT\' | translate }} </a>\n						</li>\n						<li data-ng-class="{active: $state.includes(\'main.salesforce.view.configurations\') || $state.is(\'main.salesforce.view.configuration\')}">\n							<a ng-href="/salesforce/view/{{account.id}}/configurations">\n							<i class="icon-settings"></i>\n							{{ \'APPLICATION_CONFIGURATIONS\' | translate }} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/salesforce/wizard/wizard.html",'<!-- BEGIN PAGE HEADER-->\n<div class="row">\n	<div class="col-md-12">\n			<div class="page-bar">\n				<ul class="page-breadcrumb">\n					<li>\n						<i class="icon-rocket"></i>\n						<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-handbag"></i>\n						<a href="/salesforce/list">{{ \'APPLICATION_SALESFORCE\' | translate }}</a>\n					</li>\n				</ul>\n			</div>\n		</div>\n</div>\n<!-- END PAGE HEADER-->\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initWizard()">\n	<div class="col-md-12">\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-notebook font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_ACCOUNT\' | translate }} WIZARD</a> </span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<wizard on-finish="createItem()">\n          <wz-step title="{{\'APPLICATION_ACCOUNT_INFO\' | translate}}" canexit="exitValidation(forms.formSetting.$valid)">\n						<form name="forms.formSetting" novalidate>\n\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n								<span data-ng-show="forms.formSetting.name.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"/>\n							</div>\n							<!-- END DESCRIPTION -->\n\n              <!-- START USERNAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.username.$invalid}">\n								<label class="control-label">{{\'APPLICATION_USERNAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="username" placeholder="{{\'APPLICATION_USERNAME\' | translate}}" class="form-control" data-ng-model="item.username" required ng-remote-validate="/api/salesforce/accounts/validate/username"/>\n								<span data-ng-show="forms.formSetting.username.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n								<span data-ng-show="(forms.formSetting.username.$touched || forms.formSetting.$submitted) && forms.formSetting.username.$error.ngRemoteValidate" class="help-block help-block-error">\n				          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_EXIST_USERNAME\' | translate}}.\n				        </span>\n							</div>\n							<!-- END USERNAME -->\n\n\n              <!-- START REMOTE ADDRESS -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.remoteUri.$invalid}">\n								<label class="control-label">{{\'APPLICATION_REMOTE_ADDRESS\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="url" name="remoteUri" placeholder="{{\'APPLICATION_REMOTE_ADDRESS\' | translate}}" class="form-control" data-ng-model="item.remoteUri" required/>\n								<span data-ng-show="forms.formSetting.remoteUri.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END USERNAME -->\n\n              <!-- START PASSWORD -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.password.$invalid}">\n								<label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="password" name="password" placeholder="{{\'APPLICATION_PASSWORD\' | translate}}" class="form-control" data-ng-model="item.password" required/>\n								<span data-ng-show="forms.formSetting.password.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END PASSWORD -->\n\n              <!-- START CLIENT ID -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.clientId.$invalid}">\n								<label class="control-label">{{\'APPLICATION_CLIENT_ID\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="clientId" placeholder="{{\'APPLICATION_CLIENT_ID\' | translate}}" class="form-control" data-ng-model="item.clientId" required/>\n								<span data-ng-show="forms.formSetting.clientId.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END CLIENT ID -->\n\n              <!-- START CLIENT SECRET -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.clientSecret.$invalid}">\n								<label class="control-label">{{\'APPLICATION_CLIENT_SECRET\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="clientSecret" placeholder="{{\'APPLICATION_CLIENT_SECRET\' | translate}}" class="form-control" data-ng-model="item.clientSecret" required/>\n								<span data-ng-show="forms.formSetting.clientSecret.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END CLIENT SECRET -->\n\n              <!-- START SECURITY TOKEN -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.securityToken.$invalid}">\n								<label class="control-label">{{\'APPLICATION_SECURITY_TOKEN\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="securityToken" placeholder="{{\'APPLICATION_SECURITY_TOKEN\' | translate}}" class="form-control" data-ng-model="item.securityToken" required/>\n								<span data-ng-show="forms.formSetting.securityToken.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END SECURITY TOKEN -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" data-ng-click="next()"/>\n\n						</form>\n					</wz-step>\n\n					<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n						<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n						<input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n					</wz-step>\n\n				</wizard>\n\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/setting/license/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div\n class="row" data-ng-init="initView()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-settings"></i>\n					<a href="#">{{ \'APPLICATION_SETTINGS\' | translate }}</a>\n          <i class="fa fa-angle-right"></i>\n				</li>\n        <li>\n          <i class="icon-info"></i>\n          <a href="#">{{ \'APPLICATION_LICENSE\' | translate }}</a>\n        </li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE CONTENT -->\n		<div class="profile-content">\n			<div class="row">\n				<div class="col-md-6">\n					<div class="pricing hover-effect">\n						<div class="pricing-head" data-ng-switch="license.months">\n							<h3 ng-switch-when="1">{{\'APPLICATION_MONTH_TO_MONTH\' | translate}}<span>{{license.token || \'unknown\'}} </span></h3>\n							<h3 ng-switch-when="12">{{\'APPLICATION_YEARLY\' | translate}}<span>{{license.token || \'unknown\'}} </span></h3>\n							<h3 ng-switch-when="36">{{\'APPLICATION_PERPETUAL\' | translate}}<span>{{license.token || \'unknown\'}} </span></h3>\n							<h3 ng-switch-default>{{\'APPLICATION_UNKNOWN\' | translate}}<span>{{license.token || \'unknown\'}} </span></h3>\n							<h4><i>{{license.expiration ? (license.expiration | date:\'medium\') : \'DEMO\'}}</i>\n							<span data-ng-show="license.expiration">Expiration Date </span>\n							</h4>\n						</div>\n						<ul class="pricing-content list-unstyled">\n							<li class="row">\n								<div class="col-md-9">\n									<i class="icon-eye"></i> {{\'APPLICATION_USERS\' | translate}}:\n								</div>\n								<div class="col-md-3 text-center">\n									{{(license.users || license.users >= 0) ? license.users : \'unknown\'}}\n								</div>\n							</li>\n							<li class="row">\n								<div class="col-md-9">\n									<i class="icon-people"></i> {{\'APPLICATION_AGENTS\' | translate}} ({{\'APPLICATION_CONCURRENTS\' | translate}}):\n								</div>\n								<div class="col-md-3 text-center">\n									{{(license.agents || license.agents >= 0)  ? license.agents : \'unknown\'}}\n								</div>\n							</li>\n							<li class="row">\n								<div class="col-md-9">\n									<i class="icon-phone"></i> {{\'APPLICATION_TELEPHONES\' | translate}}:\n								</div>\n								<div class="col-md-3 text-center">\n									{{(license.telephones || license.telephones >= 0) ? license.telephones : \'unknown\'}}\n								</div>\n							</li>\n							<li class="row">\n								<div class="col-md-9">\n									<i class="icon-bubble"></i> {{\'APPLICATION_CHAT\' | translate}}:\n								</div>\n								<div class="col-md-3 text-center">\n									<span class="label label-sm" data-ng-class="license.chat ? \'label-success\' : \'label-danger\'">{{license.chat ? \'APPLICATION_ENABLED\' : \'APPLICATION_DISABLED\' | translate}}</span>\n								</div>\n							</li>\n							<li class="row">\n								<div class="col-md-9">\n									<i class="icon-envelope"></i> {{\'APPLICATION_MAIL\' | translate}}:\n								</div>\n								<div class="col-md-3 text-center">\n								 <span class="label label-sm" data-ng-class="license.mail ? \'label-success\' : \'label-danger\'">{{license.mail ? \'APPLICATION_ENABLED\' : \'APPLICATION_DISABLED\' | translate}}</span>\n								</div>\n							</li>\n							<li class="row">\n								<div class="col-md-9">\n									<i class="icon-paper-plane"></i> {{\'APPLICATION_FAX\' | translate}}:\n								</div>\n								<div class="col-md-3 text-center">\n									 <span class="label label-sm" data-ng-class="license.fax ? \'label-success\' : \'label-danger\'">{{license.fax ? \'APPLICATION_ENABLED\' : \'APPLICATION_DISABLED\' | translate}}</span>\n								</div>\n							</li>\n						</ul>\n						<div class="pricing-footer">\n							<p>\n								 {{license.description}}\n							</p>\n							<a href="#" class="btn yellow-crusta">\n							{{\'APPLICATION_PRICES\' | translate}} <i class="m-icon-swapright m-icon-white"></i>\n							</a>\n						</div>\n					</div>\n				</div>\n				<div class="col-md-6">\n					<div class="portlet light bordered">\n						<div class="portlet-title">\n							<div class="caption font-green-sharp">\n								<i class="icon-info font-green-sharp"></i>\n								<span class="caption-subject">FORM {{ \'APPLICATION_LICENSE\' | translate }}</a> </span>\n							</div>\n						</div>\n						<div class="portlet-body">\n							<form name="form" novalidate data-ng-submit="submitRequest()">\n\n								<!-- START USERS -->\n								<div class="form-group" data-ng-class="{\'has-error\': (form.users.$touched || form.$submitted) && form.users.$invalid}">\n									<label class="control-label">{{\'APPLICATION_USERS\' | translate}}</label>\n									<div class="input-icon">\n										<i class="icon-eye"></i>\n										<input type="number" name="users" placeholder="{{\'APPLICATION_USERS\' | translate}}" class="form-control" data-ng-model="item.users" min="0" required>\n									</div>\n									<span data-ng-show="(form.users.$touched || forms.$submitted) && form.users.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END USERS -->\n\n								<!-- START AGENTS -->\n								<div class="form-group" data-ng-class="{\'has-error\': (form.agents.$touched || form.$submitted) && form.agents.$invalid}">\n									<label class="control-label">{{\'APPLICATION_AGENTS\' | translate}} ({{\'APPLICATION_CONCURRENTS\' | translate}})</label>\n									<div class="input-icon">\n										<i class="icon-people"></i>\n										<input type="number" name="agents" placeholder="{{\'APPLICATION_AGENTS\' | translate}} ({{\'APPLICATION_CONCURRENTS\' | translate}})" class="form-control" data-ng-model="item.agents" min="0" required>\n									</div>\n									<span data-ng-show="(form.users.$touched || forms.$submitted) && form.users.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END AGENTS -->\n\n								<!-- START TELEPHONES -->\n								<div class="form-group" data-ng-class="{\'has-error\': (form.telephones.$touched || form.$submitted) && form.telephones.$invalid}">\n									<label class="control-label">{{\'APPLICATION_TELEPHONES\' | translate}}</label>\n									<div class="input-icon">\n										<i class="icon-phone"></i>\n										<input type="number" name="telephones" placeholder="{{\'APPLICATION_TELEPHONES\' | translate}}" class="form-control" data-ng-model="item.telephones" min="0" required>\n									</div>\n									<span data-ng-show="(form.telephones.$touched || forms.$submitted) && form.telephones.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END TELEPHONES -->\n\n								<!-- START CHAT -->\n								<div class="form-group" data-ng-class="{\'has-error\': (form.chat.$touched || form.$submitted) && form.chat.$invalid}">\n									<label class="control-label">{{\'APPLICATION_CHAT\' | translate}}</label>\n									<div class="input-group input-icon">\n										<i class="icon-bubble"></i>\n										<input type="text" placeholder="{{\'APPLICATION_CHAT\' | translate}}" class="form-control" readonly>\n										<span class="input-group-addon">\n											<input type="checkbox" name="chat" data-ng-model="item.chat" required>\n										</span>\n									</div>\n									<span data-ng-show="(form.chat.$touched || forms.$submitted) && form.chat.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END CHAT -->\n\n								<!-- START MAIL -->\n								<div class="form-group" data-ng-class="{\'has-error\': (form.mail.$touched || form.$submitted) && form.mail.$invalid}">\n									<label class="control-label">{{\'APPLICATION_MAIL\' | translate}}</label>\n									<div class="input-group input-icon">\n										<i class="icon-envelope"></i>\n										<input type="text" placeholder="{{\'APPLICATION_MAIL\' | translate}}" class="form-control" readonly>\n										<span class="input-group-addon">\n											<input type="checkbox" name="mail" data-ng-model="item.mail" required>\n										</span>\n									</div>\n									<span data-ng-show="(form.mail.$touched || forms.$submitted) && form.mail.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END MAIL -->\n\n								<!-- START FAX -->\n								<div class="form-group" data-ng-class="{\'has-error\': (form.fax.$touched || form.$submitted) && form.fax.$invalid}">\n									<label class="control-label">{{\'APPLICATION_FAX\' | translate}}</label>\n									<div class="input-group input-icon">\n										<i class="icon-paper-plane"></i>\n										<input type="text" placeholder="{{\'APPLICATION_FAX\' | translate}}" class="form-control" readonly>\n										<span class="input-group-addon">\n											<input type="checkbox" name="fax" data-ng-model="item.fax" required>\n										</span>\n									</div>\n									<span data-ng-show="(form.fax.$touched || forms.$submitted) && form.fax.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END FAX -->\n\n								<input class="btn green-haze" type="submit" value="{{\'APPLICATION_SUBMIT\' | translate}} {{\'APPLICATION_REQUEST\' | translate}}"/>\n							</form>\n						</div>\n					</div>\n				</div>\n			</div>\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/setting/smtp/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initView()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-settings"></i>\n					<a href="#">{{ \'APPLICATION_SETTINGS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-envelope"></i>\n					<a href="#">SMTP</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE CONTENT -->\n		<div class="profile-content">\n			<!-- START SMTP TAB -->\n			<form name="form" data-ng-submit="form.$valid && updateItem()" novalidate>\n\n				<!-- START HOST -->\n				<div class="form-group" data-ng-class="{\'has-error\': (form.host.$touched || form.$submitted) && form.host.$invalid}">\n					<label class="control-label">{{\'APPLICATION_OUTGOING_MAIL_SERVER\' | translate}} <span class="required" aria-required="true">*</span></label>\n					<input type="text" name="host" placeholder="{{\'APPLICATION_HOST\' | translate}}" class="form-control" data-ng-model="item.host" required/>\n					<span data-ng-show="(form.host.$touched || form.$submitted) && form.host.$invalid && form.host.$error.required" class="help-block help-block-error">\n						<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n					</span>\n				</div>\n				<!-- END HOST -->\n\n				<!-- START USERNAME -->\n				<div class="form-group" data-ng-class="{\'has-error\': (form.username.$touched || form.$submitted) && form.username.$invalid}">\n					<label class="control-label">{{\'APPLICATION_USERNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n					<input type="text" name="username" placeholder="{{\'APPLICATION_USERNAME\' | translate}}" class="form-control" data-ng-model="item.username" required/>\n					<span data-ng-show="(form.username.$touched || form.$submitted) && form.username.$invalid && form.username.$error.required" class="help-block help-block-error">\n						<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n					</span>\n				</div>\n				<!-- END USERNAME -->\n\n				<!-- START PASSWORD -->\n				<div class="form-group" data-ng-class="{\'has-error\': (form.password.$touched || form.$submitted) && form.password.$invalid}">\n					<label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n					<input type="password" name="password" placeholder="{{\'APPLICATION_PASSWORD\' | translate}}" class="form-control" data-ng-model="item.password" required/>\n					<span data-ng-show="(form.password.$touched || form.$submitted) && form.password.$invalid && form.password.$error.required" class="help-block help-block-error">\n						<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n					</span>\n				</div>\n				<!-- END PASSWORD -->\n\n				<!-- START PORT -->\n				<div class="form-group" data-ng-class="{\'has-error\': (form.port.$touched || form.$submitted) && form.port.$invalid}">\n					<label class="control-label">{{\'APPLICATION_PORT\' | translate}}<span class="required" aria-required="true">*</span></label>\n					<input type="number" name="port" placeholder="{{\'APPLICATION_PORT\' | translate}}" class="form-control" data-ng-model="item.port" required/>\n					<span data-ng-show="(form.form.$touched || form.$submitted) && form.port.$invalid && form.port.$error.required" class="help-block help-block-error">\n						<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n					</span>\n					<span data-ng-show="(form.form.$touched || form.$submitted) && form.port.$invalid && form.port.$error.number" class="help-block help-block-error">\n						<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_NUMERIC_FIELD\' | translate}}.\n					</span>\n				</div>\n				<!-- END PORT -->\n\n				<!-- START SSL -->\n				<div class="form-group row">\n					<label class="col-md-3">\n						SSL\n					</label>\n					<label class="col-md-9">\n							<input type="checkbox" data-ng-model="item.ssl">\n					</label>\n				</div>\n				<!-- END SSL -->\n				<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n				<input class="btn blue-madison" type="button" value="Test" data-ng-click="test()"/>\n			</form>\n			<!-- END SMTP TAB -->\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/setting/update/list/landing.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n  <div class="col-md-12">\n    <div class="page-bar">\n      <ul class="page-breadcrumb">\n        <li>\n          <i class="icon-rocket"></i>\n          <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n          <i class="fa fa-angle-right"></i>\n        </li>\n        <li>\n          <i class="icon-settings"></i>\n          <a href="#">{{ \'APPLICATION_SETTINGS\' | translate }}</a>\n          <i class="fa fa-angle-right"></i>\n        </li>\n        <li>\n          <i class="icon-cloud-download"></i>\n          <a href="#">{{ \'APPLICATION_UPDATES\' | translate }}</a>\n        </li>\n      </ul>\n    </div>\n    <!-- BEGIN PAGE CONTENT-->\n    <div class="row" data-ng-init="initCounter()">\n      <div class="col-md-12 page-500">\n        <div class="number">\n          <timer interval="1000" countdown="180">{{countdown}}</timer>\n        </div>\n        <div class="details">\n          <h3>Wait! We need to restart xCALLY Motion server.</h3>\n          <p>\n            We are updatig it!<br/>\n            xCALLY Motion Team<br/><br/>\n          </p>\n        </div>\n      </div>\n    </div>\n    <!-- END PAGE CONTENT-->\n  </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/setting/update/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-settings"></i>\n					<a href="#">{{ \'APPLICATION_SETTINGS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-cloud-download"></i>\n					<a href="#">{{ \'APPLICATION_UPDATES\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-cloud-download font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_UPDATES\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<a class="btn btn-default" href="#" data-ng-click="pull()">\n						<i class="icon-cloud-download"></i> {{ \'APPLICATION_UPDATE\' | translate }}\n					</a>\n				</div>\n			</div>\n			<div class="portlet-body" data-ng-init="initView()">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n			<!-- END Portlet PORTLET-->\n		</div>\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/setting/update/list/list.pull.html",'<div class="modal-header">\n  <button data-ng-if="modal.dismissable" type="button" data-ng-click="$dismiss()" class="close">&times;</button>\n  <h4 ng-if="modal.title" ng-bind="modal.title" class="modal-title"></h4>\n</div>\n<div class="modal-body">\n  <p data-ng-if="modal.text" data-ng-bind="modal.text"></p>\n  <div data-ng-if="modal.html" data-ng-bind-html="modal.html"></div>\n</div>\n<div class="modal-footer">\n  <button data-ng-repeat="button in modal.buttons" data-ng-class="button.classes" data-ng-click="button.click($event)" data-ng-bind="button.text" class="btn"></button>\n</div>\n'),a.put("app/square/odbc/list/list.create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_PROJECT\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.name.$touched || form.$submitted) && form.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n      <span data-ng-show="(form.name.$touched || form.$submitted) && form.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n    <!-- START DSN -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.dsn.$touched || form.$submitted) && form.dsn.$invalid}">\n      <label class="control-label">{{\'APPLICATION_ODBC\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="dsn" placeholder="DRIVER=MySQL;SERVER=127.0.0.1;UID=xcall;PWD=password;DATABASE=motion" class="form-control" data-ng-model="item.dsn" required/>\n      <p class="help-block">Es. DRIVER=MySQL;SERVER=127.0.0.1;UID=xcall;PWD=password;DATABASE=motion</p>\n      <span data-ng-show="(form.dsn.$touched || form.$submitted) && form.dsn.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END DSN -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n    </div>\n    <!-- END DESCRIPTION -->\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="save()" ng-disabled="form.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),
-a.put("app/square/odbc/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="fa fa-superscript"></i>\n					<a>{{ \'APPLICATION_CALLYSQUARE\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-docs"></i>\n					<a href="#">{{ \'APPLICATION_ODBCS\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-docs font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_ODBCS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<button class="btn green-jungle " ng-click="createItem()">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_ODBC\' | translate }}\n						</button>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/square/odbc/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getOdbc()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="fa fa-superscript"></i>\n					<a>{{ \'APPLICATION_CALLYSQUARE\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-docs"></i>\n					<a href="/square/odbc/list">{{ \'APPLICATION_ODBCS\' | translate }}</a>\n					<i data-ng-show="odbc" class="fa fa-angle-right"></i>\n				</li>\n				<li data-ng-show="odbc">\n					<a href="#">{{odbc.name}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/odbc.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{odbc.name}}\n					</div>\n					<!-- <div class="profile-usertitle-job">\n						{{user.role}}\n					</div> -->\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.square.odbc.view.settings\')}">\n							<a data-ng-href="/square/odbc/view/{{odbc.id}}/settings">\n							<i class="icon-settings"></i>\n							{{ \'APPLICATION_SETTINGS\' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/square/odbc/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_ODBC\' | translate}} {{ \'APPLICATION_SETTINGS\' | translate}} </span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_GENERAL\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.general" data-ng-submit="forms.general.$valid && updateOdbc()" novalidate>\n\n							<!-- START NAME -->\n				      <div class="form-group" data-ng-class="{\'has-error\': (forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid}">\n				        <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n				        <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="odbc.name" required/>\n								<span data-ng-show="(forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$error.required" class="help-block help-block-error">\n				          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n				        </span>\n				      </div>\n				      <!-- END NAME -->\n\n							<!-- START DSN -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.odbc.dsn.$touched || forms.odbc.$submitted) && forms.odbc.dsn.$invalid}">\n								<label class="control-label">{{\'APPLICATION_ODBC\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="dsn" placeholder="{{\'APPLICATION_DSN\' | translate}}" class="form-control" data-ng-model="odbc.dsn" required/>\n								<p class="help-block">Es. DRIVER=MySQL;SERVER=127.0.0.1;UID=xcall;PWD=password;DATABASE=motion</p>\n					      <span data-ng-show="(forms.odbc.dsn.$touched || forms.odbc.$submitted) && forms.odbc.dsn.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END DSN -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="odbc.description"></textarea>\n							</div>\n							<!-- END DESCRIPTION -->\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END ADVANCED TAB -->\n\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/square/project/list/list.create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_PROJECT\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.name.$touched || form.$submitted) && form.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n      <span data-ng-show="(form.name.$touched || form.$submitted) && form.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n    </div>\n    <!-- END DESCRIPTION -->\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="save()" ng-disabled="form.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/square/project/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="fa fa-superscript"></i>\n					<a>{{ \'APPLICATION_CALLYSQUARE\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n        <li>\n          <i class="fa fa-slack"></i>\n          <a href="#">{{ \'APPLICATION_PROJECTS\' | translate }}</a>\n        </li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-docs font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_PROJECTS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<button class="btn green-jungle " ng-click="createItem()">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_PROJECT\' | translate }}\n						</button>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/square/project/view/view.html",'<div class="row" data-ng-init="getProject()">\n	<div class="col-md-12">\n			<div class="page-bar">\n				<ul class="page-breadcrumb">\n					<li>\n						<i class="icon-rocket"></i>\n						<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="fa fa-superscript"></i>\n						<a>{{ \'APPLICATION_CALLYSQUARE\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="fa fa-slack"></i>\n						<a href="/square/projects/list">{{ \'APPLICATION_PROJECTS\' | translate }}</a>\n            <i class="fa fa-angle-right"></i>\n					</li>\n          <li>\n						<a ng-href="/square/projects/view/{{squareProject.id}}">{{squareProject.name}}</a>\n          </li>\n				</ul>\n			</div>\n		</div>\n</div>\n<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n  <div class="col-md-12">\n		<div id="geEditor" class="geEditor"></div>\n  </div>\n</div>\n<!-- END PAGE CONTENT-->\n<script>\n\n\n</script>\n'),a.put("app/staff/agent/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-puzzle"></i>\n					<a href="#">{{ \'APPLICATION_STAFF\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-people"></i>\n					<a href="#">{{ \'APPLICATION_AGENTS\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-people font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_AGENTS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<a class="btn green-jungle" href="/staff/agents/wizard">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_AGENT\' | translate }}\n						</a>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/staff/agent/view/view.account.html",'<div class="row" data-ng-init="initView()">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_PROFILE\' | translate}} {{ \'APPLICATION_ACCOUNT\' | translate}}</span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li data-ng-class="{\'active\': Auth.isAdmin()}" data-ng-show="Auth.isAdmin()">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_PERSONAL_INFO\' | translate}}</a>\n					</li>\n					<li data-ng-show="Auth.isAdmin()">\n						<a href="#" data-target="#tab_1_2" data-toggle="tab">{{ \'APPLICATION_CHANGE_AVATAR\' | translate}}</a>\n					</li>\n					<li data-ng-show="Auth.isAdmin() || agent.id === Auth.getCurrentUser().id" data-ng-class="{\'active\': !Auth.isAdmin() && agent.id === Auth.getCurrentUser().id}">\n						<a href="#" data-target="#tab_1_3" data-toggle="tab">{{ \'APPLICATION_CHANGE_PASSWORD\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- PERSONAL INFO TAB -->\n					<div class="tab-pane" data-ng-class="{\'active\': Auth.isAdmin()}" data-ng-show="Auth.isAdmin()" id="tab_1_1">\n						<form name="forms.info" data-ng-submit="updateItem()" novalidate>\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.info.fullname.$touched || forms.info.$submitted) && forms.info.fullname.$invalid}">\n								<label class="control-label">{{\'APPLICATION_FULLNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="fullname" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="agent.fullname" required/>\n								<span data-ng-show="(forms.info.fullname.$touched || forms.info.$submitted) && forms.info.fullname.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<!-- START USERNAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_USERNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_USERNAME\' | translate}}" class="form-control" data-ng-model="agent.name" required/>\n								<span data-ng-show="(forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END USERNAME -->\n\n							<!-- START EMAIL -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.info.email.$touched || forms.info.$submitted) && forms.info.email.$invalid}">\n								<label class="control-label">{{\'APPLICATION_EMAIL\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="email" name="email" placeholder="{{\'APPLICATION_EMAIL\' | translate}}" class="form-control" data-ng-model="agent.email" required/>\n								<span data-ng-show="(forms.info.email.$touched || forms.info.$submitted) && forms.info.email.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n								<span data-ng-show="(forms.info.email.$touched || forms.info.$submitted) && forms.info.email.$error.email" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_WRONG_FORMAT\' | translate}}.\n								</span>\n							</div>\n							<!-- END EMAIL -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="agent.description"></textarea>\n							</div>\n							<!-- END DESCRIPTION -->\n\n							<!-- START INTERNAL -->\n							<!-- <div class="form-group" data-ng-class="{\'has-error\': (forms.info.internal.$touched || forms.info.$submitted) && forms.info.internal.$invalid}">\n								<label class="control-label">{{\'APPLICATION_INTERNAL_NUMBER\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="internal" placeholder="{{\'APPLICATION_INTERNAL_NUMBER\' | translate}}" class="form-control" data-ng-model="agent.internal" required disabled/>\n								<span data-ng-show="(forms.info.internal.$touched || forms.info.$submitted) && forms.info.internal.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div> -->\n							<!-- END INTERNAL -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END PERSONAL INFO TAB -->\n					<!-- CHANGE AVATAR TAB -->\n					<div class="tab-pane" data-ng-show="Auth.isAdmin()" id="tab_1_2">\n						<form action="#" role="form">\n							<div class="form-group">\n								<div class="fileinput fileinput-new" data-provides="fileinput">\n									<div class="fileinput-new thumbnail" style="width: 200px; height: 150px;">\n										<img src="http://www.placehold.it/200x150/EFEFEF/AAAAAA&amp;text=no+image" alt=""/>\n									</div>\n									<div class="fileinput-preview fileinput-exists thumbnail" style="max-width: 200px; max-height: 150px;">\n									</div>\n									<div>\n										<span class="btn default btn-file" data-ng-show="!uploader.queue[0]">\n											<span> {{ \'APPLICATION_SELECT_IMAGE\' | translate }} </span>\n											<input type="file" nv-file-select="" uploader="uploader" /><br/>\n										</span>\n										<button type="button" class="btn default" data-ng-show="uploader.queue[0]" data-dismiss="fileinput" ng-click="uploader.queue[0].remove()">\n											{{ \'APPLICATION_REMOVE\' | translate }}\n										</button>\n										<button type="button" class="btn green-haze" data-ng-show="uploader.queue[0]" data-ng-click="uploader.queue[0].upload()" ng-disabled="uploader.queue[0].isReady || uploader.queue[0].isUploading || uploader.queue[0].isSuccess">\n											{{ \'APPLICATION_CONFIRM\' | translate }}\n										</button>\n									</div>\n									<p>\n										</br> {{ \'MESSAGE_SUPPORTED_FORMATS\' | translate }} <b>jpg, png, jpeg</b>.\n									</p>\n								</div>\n							</div>\n						</form>\n						<div class="row">\n							<div class="col-md-2">\n								<table class="table" border="0">\n									<tbody>\n									<tr data-ng-repeat="item in uploader.queue">\n											<td style="border-top-style:none">\n												<strong>\n													{{ item.file.name }}\n												</strong>\n											</td>\n											<td data-ng-show="uploader.isHTML5" nowrap style="border-top-style:none">\n												{{ item.file.size/1024/1024|number:2 }} MB\n											</td>\n											<td nowrap style="border-top-style:none">\n												<button type="button" class="btn btn-danger btn-xs" data-ng-click="item.remove()">\n														<span class="glyphicon glyphicon-trash"></span> Remove\n												</button>\n											</td>\n										</tr>\n									</tbody>\n								</table>\n							</div>\n						</div>\n					</div>\n					<!-- END CHANGE AVATAR TAB -->\n					<!-- CHANGE PASSWORD TAB -->\n					<div class="tab-pane" data-ng-show="Auth.isAdmin() || agent.id === Auth.getCurrentUser().id" data-ng-class="{\'active\': !Auth.isAdmin() && agent.id === Auth.getCurrentUser().id}" id="tab_1_3">\n						<form name="forms.changePwd" data-ng-submit="forms.changePwd.$valid && updatePassword()" novalidate>\n							<!-- START CURRENT PWD -->\n							<div class="form-group" data-ng-if="!Auth.isAdmin()" data-ng-class="{\'has-error\': (forms.changePwd.current_pwd.$touched || forms.changePwd.$submitted) && forms.changePwd.current_pwd.$invalid}">\n								<label class="control-label">{{\'APPLICATION_CURRENT_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="password" name="current_pwd" placeholder="{{\'APPLICATION_CURRENT_PASSWORD\' | translate}}" class="form-control" data-ng-model="agent.currentPwd" required/>\n								<span data-ng-show="(forms.changePwd.current_pwd.$touched || forms.changePwd.$submitted) && forms.changePwd.current_pwd.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END CURRENT PWD -->\n							<!-- START NEW PWD -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.changePwd.new_pwd.$touched || forms.changePwd.$submitted) && forms.changePwd.new_pwd.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NEW_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="password" name="new_pwd" placeholder="{{\'APPLICATION_NEW_PASSWORD\' | translate}}" class="form-control" data-ng-model="agent.newPwd" required/>\n								<span data-ng-show="(forms.changePwd.new_pwd.$touched || forms.changePwd.$submitted) && forms.changePwd.new_pwd.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NEW PWD -->\n							<!-- START RE-NEW PWD -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.changePwd.re_new_pwd.$touched || forms.changePwd.$submitted) && forms.changePwd.re_new_pwd.$invalid}">\n								<label class="control-label">{{\'APPLICATION_RE_TYPE_NEW_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="password" name="re_new_pwd" placeholder="{{\'APPLICATION_RE_TYPE_NEW_PASSWORD\' | translate}}" class="form-control" data-ng-model="agent.reNewPwd" nx-equal="agent.newPwd" required/>\n								<span data-ng-show="(forms.changePwd.new_pwd.$touched || forms.changePwd.$submitted) && forms.changePwd.new_pwd.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END RE-NEW PWD -->\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END CHANGE PASSWORD TAB -->\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/staff/agent/view/view.chat.html",'<div class="row" data-ng-init="initView()">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_PROFILE\' | translate}} {{ \'APPLICATION_CHAT\' | translate}}</span>\n				</div>\n			</div>\n\n			<div class="portlet-body">\n				<!-- START CHAT TAB -->\n				<form name="form" data-ng-submit="patchItem()" novalidate>\n					<!-- START CAPACITY -->\n					<div class="form-group" data-ng-class="{\'has-error\': (form.capacity.$touched || form.$submitted) && form.name.$invalid}">\n						<label class="control-label">{{\'APPLICATION_CAPACITY\' | translate}}<span class="required" aria-required="true">*</span></label>\n						<input type="number" name="chatCapacity" placeholder="{{\'APPLICATION_CAPACITY\' | translate}}" class="form-control" data-ng-model="agent.chatCapacity" min="0" required/>\n						<span class="help-block">\n							{{\'MESSAGE_ZERO_MEANS_UNLIMITED\' | translate}}\n						</span>\n						<span data-ng-show="(form.name.$touched || form.$submitted) && form.name.$error.required" class="help-block help-block-error">\n							<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n						</span>\n					</div>\n					<!-- END CAPACITY -->\n					<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n				</form>\n				<!-- END CHAT TAB -->\n			</div>\n		</div>\n	</div>\n</div>\n</div>\n'),a.put("app/staff/agent/view/view.fax.html",'<div class="row" data-ng-init="initView()">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_PROFILE\' | translate}} {{ \'APPLICATION_FAX\' | translate}}</span>\n				</div>\n			</div>\n\n			<div class="portlet-body">\n				<!-- START CHAT TAB -->\n				<form name="form" data-ng-submit="patchItem()" novalidate>\n					<!-- START CAPACITY -->\n					<div class="form-group" data-ng-class="{\'has-error\': (form.capacity.$touched || form.$submitted) && form.name.$invalid}">\n						<label class="control-label">{{\'APPLICATION_CAPACITY\' | translate}}<span class="required" aria-required="true">*</span></label>\n						<input type="number" name="faxCapacity" placeholder="{{\'APPLICATION_CAPACITY\' | translate}}" class="form-control" data-ng-model="agent.faxCapacity" min="0" required/>\n						<span class="help-block">\n							{{\'MESSAGE_ZERO_MEANS_UNLIMITED\' | translate}}\n						</span>\n						<span data-ng-show="(form.name.$touched || form.$submitted) && form.name.$error.required" class="help-block help-block-error">\n							<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n						</span>\n					</div>\n					<!-- END CAPACITY -->\n					<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n				</form>\n				<!-- END CHAT TAB -->\n			</div>\n		</div>\n	</div>\n</div>\n</div>\n'),a.put("app/staff/agent/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-puzzle"></i>\n					<a href="#">{{ \'APPLICATION_STAFF\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-people"></i>\n					<a href="/staff/agents/list">{{ \'APPLICATION_AGENTS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<a href="#">{{agent.fullname}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-userpic">\n					<img ng-src="api/users/avatar/{{agent.userpic ? agent.userpic : \'unknown_avatar\'}}" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n\n				<!-- START SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{agent.fullname}}\n					</div>\n					<div class="profile-usertitle-job">\n						{{agent.role}}\n					</div>\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.staff.agents.view.account\')}">\n							<a data-ng-href="/staff/agents/view/{{agent.id}}/account">\n							<i class="icon-user"></i>\n							{{ \'APPLICATION_ACCOUNT\' | translate}} </a>\n						</li>\n\n						<li data-ng-class="{active: $state.is(\'main.staff.agents.view.voice\')}" data-ng-show="Auth.isAdmin()">\n							<a data-ng-href="/staff/agents/view/{{agent.id}}/voice">\n							<i class="icon-earphones-alt"></i>\n							{{ \'APPLICATION_VOICE\' | translate}} </a>\n						</li>\n\n						<li data-ng-class="{active: $state.is(\'main.staff.agents.view.chat\')}" data-ng-show="Auth.isAdmin()">\n							<a data-ng-href="/staff/agents/view/{{agent.id}}/chat">\n							<i class="icon-bubble"></i>\n							{{ \'APPLICATION_CHAT\' | translate}} </a>\n						</li>\n\n						<li data-ng-class="{active: $state.is(\'main.staff.agents.view.mail\')}" data-ng-show="Auth.isAdmin()">\n							<a data-ng-href="/staff/agents/view/{{agent.id}}/mail">\n							<i class="icon-envelope"></i>\n							{{ \'APPLICATION_MAIL\' | translate}} </a>\n						</li>\n\n						<li data-ng-class="{active: $state.is(\'main.staff.agents.view.fax\')}" data-ng-show="Auth.isAdmin()">\n							<a data-ng-href="/staff/agents/view/{{agent.id}}/fax">\n							<i class="icon-paper-plane"></i>\n							{{ \'APPLICATION_FAX\' | translate}} </a>\n						</li>\n\n						<li data-ng-class="{active: $state.is(\'main.staff.agents.view.phonebar\')}" data-ng-show="Auth.isAdmin()">\n							<a data-ng-href="/staff/agents/view/{{agent.id}}/phonebar">\n							<i class="icon-screen-desktop"></i>\n							{{ \'APPLICATION_PHONE_BAR\' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/staff/agent/view/view.mail.html",'<div class="row" data-ng-init="initView()">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_PROFILE\' | translate}} {{ \'APPLICATION_MAIL\' | translate}}</span>\n				</div>\n			</div>\n\n			<div class="portlet-body">\n				<!-- START CHAT TAB -->\n				<form name="form" data-ng-submit="patchItem()" novalidate>\n					<!-- START CAPACITY -->\n					<div class="form-group" data-ng-class="{\'has-error\': (form.capacity.$touched || form.$submitted) && form.name.$invalid}">\n						<label class="control-label">{{\'APPLICATION_CAPACITY\' | translate}}<span class="required" aria-required="true">*</span></label>\n						<input type="number" name="mailCapacity" placeholder="{{\'APPLICATION_CAPACITY\' | translate}}" class="form-control" data-ng-model="agent.mailCapacity" min="0" required/>\n						<span class="help-block">\n							{{\'MESSAGE_ZERO_MEANS_UNLIMITED\' | translate}}\n						</span>\n						<span data-ng-show="(form.name.$touched || form.$submitted) && form.name.$error.required" class="help-block help-block-error">\n							<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n						</span>\n					</div>\n					<!-- END CAPACITY -->\n					<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n				</form>\n				<!-- END CHAT TAB -->\n			</div>\n		</div>\n	</div>\n</div>\n</div>\n'),
-a.put("app/staff/agent/view/view.phonebar.html",'<div class="row" data-ng-init="initView()">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_PROFILE\' | translate}} {{ \'APPLICATION_PHONE_BAR\' | translate}}</span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li data-ng-class="{\'active\': Auth.isAdmin()}" data-ng-show="Auth.isAdmin()">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_GENERAL\' | translate}}</a>\n					</li>\n					<li data-ng-show="Auth.isAdmin()">\n						<a href="#" data-target="#tab_1_2" data-toggle="tab">{{ \'APPLICATION_CALL_FORWARDING\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- PERSONAL INFO TAB -->\n					<div class="tab-pane" data-ng-class="{\'active\': Auth.isAdmin()}" data-ng-show="Auth.isAdmin()" id="tab_1_1">\n						<form name="forms.general" data-ng-submit="updateItem()" novalidate>\n\n							<!-- START DELETE -->\n							<div class="form-group row">\n								<label class="col-md-3">\n									{{\'APPLICATION_AUTO_ANSWER\' | translate}}\n								</label>\n								<label class="col-md-9">\n									<input type="checkbox" data-ng-model="agent.phoneBarAutoAnswer">\n								</label>\n							</div>\n							<!-- END DELETE -->\n\n							<!-- START DELETE -->\n							<div class="form-group row">\n								<label class="col-md-3">\n									{{\'APPLICATION_ENABLE_SETTINGS\' | translate}}\n								</label>\n								<label class="col-md-9">\n									<input type="checkbox" data-ng-model="agent.phoneBarEnableSettings">\n								</label>\n							</div>\n							<!-- END DELETE -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END PERSONAL INFO TAB -->\n					<!-- CHANGE AVATAR TAB -->\n					<div class="tab-pane" data-ng-show="Auth.isAdmin()" id="tab_1_2">\n						<form name="forms.callForwarding" data-ng-submit="updateItem()" novalidate>\n							<!-- START UNCONDITIONAL -->\n							<div class="form-group row">\n								<label class="col-md-3">\n									{{\'APPLICATION_UNCONDITIONAL\' | translate}}\n								</label>\n								<label class="col-md-9">\n									<input name="phoneBarUnconditional" type="checkbox" data-ng-model="agent.phoneBarUnconditional">\n								</label>\n							</div>\n							<!-- END UNCONDITIONAL -->\n\n							<!-- START UNCONDITIONAL NUMBER -->\n							<div class="form-group" data-ng-if="agent.phoneBarUnconditional" data-ng-class="{\'has-error\': (forms.callForwarding.phoneBarUnconditionalNumber.$touched || forms.callForwarding.$submitted) && forms.callForwarding.phoneBarUnconditionalNumber.$invalid}">\n								<input type="text" name="phoneBarUnconditionalNumber" placeholder="{{\'APPLICATION_NUMBER\' | translate}}" class="form-control" data-ng-model="agent.phoneBarUnconditionalNumber" required/>\n								<span class="help-block">\n									<!-- {{ \'DESCRIPTION_VOICE_HOST\' | translate }} -->\n								</span>\n								<span data-ng-show="(forms.callForwarding.phoneBarUnconditionalNumber.$touched || forms.callForwarding.$submitted) && forms.callForwarding.phoneBarUnconditionalNumber.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END UNCONDITIONAL NUMBER -->\n\n							<!-- START NO REPLY -->\n							<div class="form-group row">\n								<label class="col-md-3">\n									{{\'APPLICATION_NO_REPLY\' | translate}}\n								</label>\n								<label class="col-md-9">\n									<input name="phoneBarNoReply" type="checkbox" data-ng-model="agent.phoneBarNoReply">\n								</label>\n							</div>\n							<!-- END NO REPLY -->\n\n							<!-- START NO REPLY -->\n							<div class="form-group" data-ng-if="agent.phoneBarNoReply" data-ng-class="{\'has-error\': (forms.callForwarding.phoneBarNoReplyNumber.$touched || forms.callForwarding.$submitted) && forms.callForwarding.phoneBarNoReplyNumber.$invalid}">\n								<input type="text" name="phoneBarNoReplyNumber" placeholder="{{\'APPLICATION_NUMBER\' | translate}}" class="form-control" data-ng-model="agent.phoneBarNoReplyNumber" required/>\n								<span class="help-block">\n									<!-- {{ \'DESCRIPTION_VOICE_HOST\' | translate }} -->\n								</span>\n								<span data-ng-show="(forms.callForwarding.phoneBarNoReplyNumber.$touched || forms.callForwarding.$submitted) && forms.callForwarding.phoneBarNoReplyNumber.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END REPLY -->\n\n							<!-- START BUSY -->\n							<div class="form-group row">\n								<label class="col-md-3">\n									{{\'APPLICATION_BUSY\' | translate}}\n								</label>\n								<label class="col-md-9">\n									<input name="phoneBarBusy" type="checkbox" data-ng-model="agent.phoneBarBusy">\n								</label>\n							</div>\n							<!-- END BUSY -->\n\n							<!-- START BUSY NUMBER -->\n							<div class="form-group" data-ng-if="agent.phoneBarBusy" data-ng-class="{\'has-error\': (forms.callForwarding.phoneBarBusyNumber.$touched || forms.callForwarding.$submitted) && forms.callForwarding.phoneBarBusyNumber.$invalid}">\n								<input type="text" name="phoneBarBusyNumber" placeholder="{{\'APPLICATION_NUMBER\' | translate}}" class="form-control" data-ng-model="agent.phoneBarBusyNumber" required/>\n								<span class="help-block">\n									<!-- {{ \'DESCRIPTION_VOICE_HOST\' | translate }} -->\n								</span>\n								<span data-ng-show="(forms.callForwarding.phoneBarBusyNumber.$touched || forms.callForwarding.$submitted) && forms.callForwarding.phoneBarBusyNumber.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END BUSY NUMBER -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END CHANGE AVATAR TAB -->\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/staff/agent/view/view.voice.html",'<div class="row" data-ng-init="initView()">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_PROFILE\' | translate}} {{ \'APPLICATION_VOICE\' | translate}}</span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<form name="forms.voice" data-ng-submit="updateItem()" novalidate>\n\n					<!-- START INTERNAL -->\n					<div class="form-group" data-ng-class="{\'has-error\': (forms.voice.internal.$touched || forms.voice.$submitted) && forms.voice.internal.$invalid}">\n						<label class="control-label">{{\'APPLICATION_INTERNAL_NUMBER\' | translate}}<span class="required" aria-required="true">*</span></label>\n						<input type="text" name="internal" placeholder="{{\'APPLICATION_INTERNAL_NUMBER\' | translate}}" class="form-control" data-ng-model="agent.internal" required disabled/>\n						<span data-ng-show="(forms.voice.internal.$touched || forms.voice.$submitted) && forms.voice.internal.$error.required" class="help-block help-block-error">\n							<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n						</span>\n					</div>\n					<!-- END INTERNAL -->\n\n					<!-- START TRANSPORT -->\n					<div class="form-group">\n						<label class="control-label">{{ \'APPLICATION_TRANSPORT\' | translate}}</label>\n						<ui-select multiple name="transport" ng-model="agent.transport" theme="bootstrap">\n							<ui-select-match placeholder="Select transport...">{{$item}}</ui-select-match>\n							<ui-select-choices repeat="transport in [\'udp\', \'tcp\', \'ws\', \'wss\'] | filter: $select.search">\n								{{transport}}\n							</ui-select-choices>\n						</ui-select>\n						<span class="help-block">\n							{{ \'DESCRIPTION_VOICE_TRANSPORT\' | translate }}\n						</span>\n					</div>\n					<!-- END TRANSPORT -->\n\n					<!-- START HOST -->\n					<div class="form-group" data-ng-class="{\'has-error\': (forms.voice.host.$touched || forms.voice.$submitted) && forms.voice.host.$invalid}">\n						<label class="control-label">{{\'APPLICATION_HOST\' | translate}}<span class="required" aria-required="true">*</span></label>\n						<input type="text" name="host" placeholder="{{\'APPLICATION_HOST\' | translate}}" class="form-control" data-ng-model="agent.host" required/>\n						<span class="help-block">\n							{{ \'DESCRIPTION_VOICE_HOST\' | translate }}\n						</span>\n						<span data-ng-show="(forms.voice.host.$touched || forms.voice.$submitted) && forms.voice.host.$error.required" class="help-block help-block-error">\n							<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n						</span>\n					</div>\n					<!-- END HOST -->\n\n					<!-- START NAT -->\n					<div class="form-group">\n						<label class="control-label">{{ \'APPLICATION_NAT\' | translate}}</label>\n						<ui-select multiple data-ng-model="agent.nat" name="nat" theme="bootstrap">\n							<ui-select-match placeholder="{{ \'APPLICATION_SEARCH_FILTER\' | translate }}">{{$item}}</ui-select-match>\n							<ui-select-choices repeat="nat in [\'yes\', \'no\', \'never\', \'route\', \'force_rport\', \'comedia\'] | filter: $select.search">\n								{{nat}}\n							</ui-select-choices>\n						</ui-select>\n						<span class="help-block">\n							{{ \'DESCRIPTION_VOICE_NAT\' | translate }}\n						</span>\n					</div>\n					<!-- END NAT -->\n\n					<!-- START TYPE -->\n					<div class="form-group" data-ng-class="{\'has-error\': (forms.voice.type.$touched || forms.voice.$submitted) && forms.voice.type.$invalid}">\n						<label class="control-label">{{\'APPLICATION_TYPE\' | translate}}<span class="required" aria-required="true">*</span></label>\n						<ui-select data-ng-model="agent.type" name="type" theme="bootstrap" required>\n							<ui-select-match placeholder="{{ \'APPLICATION_SEARCH_FILTER\' | translate }}">{{$select.selected}}</ui-select-match>\n							<ui-select-choices repeat="type in [\'friend\', \'user\', \'peer\'] | filter: $select.search">\n								<div ng-bind-html="type | highlight: $select.search"></div>\n							</ui-select-choices>\n						</ui-select>\n						<span class="help-block">\n							{{ \'DESCRIPTION_VOICE_TYPE\' | translate }}\n						</span>\n						<span data-ng-show="(forms.voice.type.$touched || forms.voice.$submitted) && forms.voice.type.$error.required" class="help-block help-block-error">\n							<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n						</span>\n					</div>\n					<!-- END TYPE -->\n\n					<!-- START CODEC -->\n					<div class="form-group">\n						<label class="control-label">{{ \'APPLICATION_ALLOWED_CODECS\' | translate}}</label>\n						<ui-select multiple ng-model="agent.allow" name="allow" theme="bootstrap" ng-disabled="disabled">\n							<ui-select-match placeholder="Select codec...">{{$item}}</ui-select-match>\n							<ui-select-choices repeat="allow in [\'g729\', \'ilbc\', \'gsm\', \'ulaw\', \'alaw\'] | filter: $select.search">\n								{{allow}}\n							</ui-select-choices>\n						</ui-select>\n						<span class="help-block">\n							{{ \'DESCRIPTION_VOICE_CODEC\' | translate }}\n						</span>\n					</div>\n					<!-- END CODEC -->\n\n					<!-- START STATUS -->\n					<div class="form-group">\n						<label class="control-label">{{\'APPLICATION_CHANSPY\' | translate}}</label></br>\n						<input\n						bs-switch\n						class="form-control"\n						ng-model="agent.chanspy"\n						type="checkbox"\n						name="auth"\n						switch-active="{{ recordSwitch.isActive }}"\n						switch-on-text="{{ recordSwitch.onText }}"\n						switch-off-text="{{ recordSwitch.offText }}"\n						switch-on-color="{{ recordSwitch.onColor }}"\n						switch-off-color="{{ recordSwitch.offColor }}"\n						switch-animate="{{ recordSwitch.animate }}"\n						switch-size="{{ recordSwitch.size }}"\n						switch-label="{{ recordSwitch.label }}"\n						switch-icon="{{ recordSwitch.icon }}"\n						switch-radio-off="{{ recordSwitch.radioOff }}"\n						switch-label-width="{{ recordSwitch.labelWidth }}"\n						switch-handle-width="{{ recordSwitch.handleWidth }}">\n					</div>\n					<!-- END STATUS -->\n\n					<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n				</form>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/staff/agent/wizard/wizard.html",'<div class="col-md-12">\n	<!-- BEGIN PAGE HEADER-->\n	<div class="page-bar">\n		<ul class="page-breadcrumb">\n			<li>\n				<i class="icon-rocket"></i>\n				<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n				<i class="fa fa-angle-right"></i>\n			</li>\n			<li>\n				<i class="icon-people"></i>\n				<a href="/agents/list">{{ \'APPLICATION_AGENTS\' | translate }}</a>\n				<i class="fa fa-angle-right"></i>\n			</li>\n			<li>\n				<i class="icon-options"></i>\n				<a href="/agents/wizard">{{ \'APPLICATION_WIZARD\' | translate }}</a>\n			</li>\n		</ul>\n	</div>\n	<!-- END PAGE HEADER-->\n\n	<!-- BEGIN PORTLET-->\n	<div class="portlet light bordered" data-ng-init="getFirstFreeInternal();">\n		<div class="portlet-title">\n			<div class="caption font-green-sharp">\n				<i class="icon-user font-green-sharp"></i>\n				<span class="caption-subject">{{ \'APPLICATION_AGENT\' | translate }} WIZARD</a> </span>\n			</div>\n		</div>\n		<div class="portlet-body">\n			<wizard on-finish="createItem()">\n				<wz-step title="{{\'APPLICATION_ACCOUNT\' | translate}}" canexit="exitValidation(forms.info.$valid)">\n					<form name="forms.info" novalidate>\n\n						<!-- START NAME -->\n						<div class="form-group" data-ng-class="{\'has-error\': (forms.info.fullname.$touched || forms.info.$submitted) && forms.info.fullname.$invalid}">\n							<label class="control-label">{{\'APPLICATION_FULLNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n							<input type="text" name="fullname" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.fullname" required/>\n							<span data-ng-show="(forms.info.fullname.$touched || forms.info.$submitted) && forms.info.fullname.$error.required" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n						</div>\n						<!-- END NAME -->\n\n						<!-- START USERNAME -->\n						<div class="form-group" data-ng-class="{\'has-error\': (forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$invalid}">\n							<label class="control-label">{{\'APPLICATION_USERNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n							<input type="text" name="name" placeholder="{{\'APPLICATION_USERNAME\' | translate}}" class="form-control" data-ng-model="item.name" data-ng-pattern="settings.patternName" required>\n							<span data-ng-show="(forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$error.required" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n							<span data-ng-show="(forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$error.pattern" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_INVALID_PATTERN_NAME\' | translate}}.\n							</span>\n						</div>\n						<!-- END USERNAME -->\n\n						<!-- START EMAIL -->\n						<div class="form-group" data-ng-class="{\'has-error\': (forms.info.email.$touched || forms.info.$submitted) && forms.info.email.$invalid}">\n							<label class="control-label">{{\'APPLICATION_EMAIL\' | translate}}<span class="required" aria-required="true">*</span></label>\n							<input type="email" name="email" placeholder="{{\'APPLICATION_EMAIL\' | translate}}" class="form-control" data-ng-model="item.email" required>\n							<span data-ng-show="(forms.info.email.$touched || forms.info.$submitted) && forms.info.email.$error.required" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n							<span data-ng-show="(forms.info.email.$touched || forms.info.$submitted) && forms.info.email.$error.email" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_WRONG_FORMAT\' | translate}}.\n							</span>\n						</div>\n						<!-- END EMAIL -->\n\n						<!-- START PASSWORD -->\n						<div class="form-group" data-ng-class="{\'has-error\': (forms.info.password.$touched || forms.info.$submitted) && forms.info.password.$invalid}">\n							<label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n							<input type="password" name="password" placeholder="{{\'APPLICATION_PASSWORD\' | translate}}" class="form-control" data-ng-model="item.password" required/>\n							<span data-ng-show="(forms.info.password.$touched || forms.info.$submitted) && forms.info.password.$error.required" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n						</div>\n						<!-- END PASSWORD -->\n\n						<!-- START RE PASSWORD -->\n						<div class="form-group" data-ng-class="{\'has-error\': (forms.info.rpassword.$touched || forms.info.$submitted) && forms.info.rpassword.$invalid}">\n							<label class="control-label">{{\'APPLICATION_CONFIRM_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n							<input type="password" name="rpassword" placeholder="{{\'APPLICATION_CONFIRM_PASSWORD\' | translate}}" class="form-control" data-ng-model="item.rpassword" nx-equal="item.password" required/>\n							<span data-ng-show="(forms.info.rpassword.$touched || forms.info.$submitted) && forms.info.rpassword.$error.required" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n							<span data-ng-show="(forms.info.rpassword.$touched || forms.info.$submitted) && forms.info.rpassword.$error.nxEqual" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_WRONG_PASSWORD\' | translate}}.\n							</span>\n						</div>\n						<!-- END RE PASSWORD -->\n\n						<!-- START INTERNAL -->\n						<div class="form-group" data-ng-class="{\'has-error\': (forms.info.internal.$touched || forms.info.$submitted) && forms.info.internal.$invalid}">\n							<label class="control-label">{{\'APPLICATION_INTERNAL_NUMBER\' | translate}}<span class="required" aria-required="true">*</span></label>\n							<div class="input-group">\n								<input type="number" min="1" name="internal" placeholder="{{\'APPLICATION_INTERNAL_NUMBER\' | translate}}" class="form-control" data-ng-model="item.internal" data-ng-disabled="!item.internalEnabled" data-ng-required="item.internalEnabled"/>\n								<span class="input-group-addon">\n									<input type="checkbox" data-ng-model="item.internalEnabled">\n								</span>\n							</div>\n							<span data-ng-show="(forms.info.internal.$touched || forms.info.$submitted) && forms.info.internal.$error.required" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n						</div>\n						<!-- END INTERNAL -->\n\n						<!-- START DESCRIPTION -->\n						<div class="form-group">\n							<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n							<textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n						</div>\n						<!-- END DESCRIPTION -->\n\n						<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" ng-click="next()"/>\n					</form>\n				</wz-step>\n\n				<wz-step title="{{\'APPLICATION_VOICE\' | translate}}" canexit="exitValidation(forms.voice.$valid)">\n					<form name="forms.voice" novalidate>\n\n						<!-- START TRANSPORT -->\n						<div class="form-group">\n							<label class="control-label">{{ \'APPLICATION_TRANSPORT\' | translate}}</label>\n							<ui-select multiple name="transport" ng-model="item.transport" theme="bootstrap" ng-disabled="disabled">\n								<ui-select-match placeholder="Select transport...">{{$item}}</ui-select-match>\n								<ui-select-choices repeat="transport in [\'udp\', \'tcp\', \'ws\', \'wss\'] | filter: $select.search">\n									{{transport}}\n								</ui-select-choices>\n							</ui-select>\n							<span class="help-block">\n								{{ \'DESCRIPTION_VOICE_TRANSPORT\' | translate }}\n							</span>\n						</div>\n						<!-- END TRANSPORT -->\n\n						<!-- START CODEC -->\n						<div class="form-group">\n							<label class="control-label">{{ \'APPLICATION_ALLOWED_CODECS\' | translate}}</label>\n							<ui-select multiple ng-model="item.allow" name="allow" theme="bootstrap" ng-disabled="disabled">\n								<ui-select-match placeholder="Select codec...">{{$item}}</ui-select-match>\n								<ui-select-choices repeat="allow in [\'g729\', \'ilbc\', \'gsm\', \'ulaw\', \'alaw\'] | filter: $select.search">\n									{{allow}}\n								</ui-select-choices>\n							</ui-select>\n							<span class="help-block">\n								{{ \'DESCRIPTION_VOICE_CODEC\' | translate }}\n							</span>\n						</div>\n						<!-- END CODEC -->\n\n						<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" ng-click="next()"/>\n						<input class="btn default" type="button" value="{{\'APPLICATION_BACK\' | translate}}" wz-previous/>\n					</form>\n				</wz-step>\n\n				<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n					<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n					<input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n				</wz-step>\n			</wizard>\n		</div>\n	</div>\n	<!-- END PORTLET-->\n</div>\n'),a.put("app/staff/team/list/create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_TEAM\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.name.$touched || form.$submitted) && form.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n      <span data-ng-show="(form.name.$touched || form.$submitted) && form.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n    </div>\n    <!-- END DESCRIPTION -->\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="ok()" ng-disabled="form.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/staff/team/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-shield"></i>\n					<a href="/staff/teams/list">{{ \'APPLICATION_TEAMS\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-shield font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_TEAMS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<a class="btn green-jungle" href="#" data-ng-click="createItem()">\n						<i class="icon-plus"></i> {{ \'APPLICATION_NEW_TEAM\' | translate }}\n					</a>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/staff/team/view/view.agents.html",'<div class="row" data-ng-init="initAgents()">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_AGENTS\' | translate}}</span>\n				</div>\n			</div>\n			<div class="portlet-body">\n			<!-- GENERAL TAB -->\n				<!-- BEGIN PORTLET-->\n					<!-- BEGIN FORM-->\n					<form action="index.html" class="form-horizontal form-row-seperated">\n						<div class="form-body">\n							<div class="form-group last">\n								<div class="col-md-12" id="multi-select-team">\n								</div>\n							</div>\n						</div>\n					</form>\n					<!-- END FORM-->\n				<!-- END PORTLET-->\n			<!-- END GENERAL TAB -->\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/staff/team/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initView()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-shield"></i>\n					<a href="/staff/teams/list">{{ \'APPLICATION_TEAMS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<a href="#">{{team.name}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img ng-src="assets/images/media/team.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{team.name}}\n					</div>\n\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.staff.teams.view.settings\')}">\n							<a data-ng-href="/staff/teams/view/{{team.id}}/settings">\n							<i class="icon-settings"></i>\n							{{ \'APPLICATION_SETTINGS\' | translate}} </a>\n						</li>\n						<li data-ng-class="{active: $state.is(\'main.staff.teams.view.agents\')}">\n							<a data-ng-href="/staff/teams/view/{{team.id}}/agents">\n							<i class="icon-people"></i>\n							{{ \'APPLICATION_AGENTS\' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content"></div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/staff/team/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_PROFILE\' | translate}} {{ \'APPLICATION_ACCOUNT\' | translate}}</span>\n				</div>\n			</div>\n\n			<div class="portlet-body">\n				<!-- PERSONAL INFO TAB -->\n				<div>\n\n					<form name="forms.info" data-ng-submit="updateItem()" novalidate>\n						<!-- START NAME -->\n						<div class="form-group" data-ng-class="{\'has-error\': (forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$invalid}">\n							<label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n							<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="team.name" required/>\n							<span data-ng-show="(forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$error.required" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n						</div>\n						<!-- END NAME -->\n\n						<!-- START DESCRIPTION -->\n						<div class="form-group">\n							<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n							<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="team.description"/>\n						</div>\n						<!-- END DESCRIPTION -->\n\n						<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n					</form>\n				</div>\n				<!-- END PERSONAL INFO TAB -->\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/staff/telephone/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-phone"></i>\n					<a href="/staff/telephones/list">{{ \'APPLICATION_TELEPHONES\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-phone font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_TELEPHONES\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<a class="btn green-jungle" href="/staff/telephones/wizard" data-toggle="dropdown">\n						<i class="icon-plus"></i> {{ \'APPLICATION_NEW_TELEPHONE\' | translate }}\n					</a>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),
-a.put("app/staff/telephone/view/view.account.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_PROFILE\' | translate}}</span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_ACCOUNT\' | translate}}</a>\n					</li>\n					<li>\n						<a href="#" data-target="#tab_1_2" data-toggle="tab">{{ \'APPLICATION_VOICE\' | translate}}</a>\n					</li>\n					<li>\n						<a href="#" data-ng-show="Auth.isAdmin() || item.id === getCurrentTelephone().id" data-target="#tab_1_3" data-toggle="tab">{{ \'APPLICATION_CHANGE_PASSWORD\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- PERSONAL INFO TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.info" data-ng-submit="updateItem() && forms.info.$valid" novalidate>\n\n				      <!-- START NAME -->\n				      <div class="form-group" data-ng-class="{\'has-error\': (forms.info.fullname.$touched || forms.info.$submitted) && forms.info.fullname.$invalid}">\n				        <label class="control-label">{{\'APPLICATION_FULLNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n				        <input type="text" name="fullname" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.fullname" required/>\n								<span data-ng-show="(forms.info.fullname.$touched || forms.info.$submitted) && forms.info.fullname.$error.required" class="help-block help-block-error">\n				          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n				        </span>\n				      </div>\n				      <!-- END NAME -->\n\n				      <!-- START USERNAME -->\n				      <div class="form-group" data-ng-class="{\'has-error\': (forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$invalid}">\n				        <label class="control-label">{{\'APPLICATION_USERNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n				        <input type="text" name="name" placeholder="{{\'APPLICATION_USERNAME\' | translate}}" class="form-control" data-ng-model="item.name" required ng-remote-validate="/api/agents/validate/name"/>\n								<span data-ng-show="(forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$error.required" class="help-block help-block-error">\n				          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n				        </span>\n								<span data-ng-show="(forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$error.ngRemoteValidate" class="help-block help-block-error">\n				          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_EXIST_USERNAME\' | translate}}.\n				        </span>\n				      </div>\n				      <!-- END USERNAME -->\n\n							<!-- START INTERNAL -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.info.internal.$touched || forms.info.$submitted) && forms.info.internal.$invalid}">\n								<label class="control-label">{{\'APPLICATION_INTERNAL_NUMBER\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="number" min="1" name="internal" placeholder="{{\'APPLICATION_INTERNAL_NUMBER\' | translate}}" class="form-control" data-ng-model="item.internal" required ng-remote-validate="/api/agents/validate/internal"/>\n								<span data-ng-show="(forms.info.internal.$touched || forms.info.$submitted) && forms.info.internal.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n								<span data-ng-show="(forms.info.internal.$touched || forms.info.$submitted) && forms.info.internal.$error.ngRemoteValidate" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_EXIST_INTERNAL\' | translate}}.\n								</span>\n							</div>\n							<!-- END INTERNAL -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n							</div>\n							<!-- END DESCRIPTION -->\n\n				      <input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" ng-click="next()"/>\n				    </form>\n					</div>\n					<!-- END PERSONAL INFO TAB -->\n\n					<!-- CHANGE AVATAR TAB -->\n					<div class="tab-pane" id="tab_1_2">\n						<form name="forms.voice" data-ng-submit="updateItem() && forms.voice.$valid" novalidate>\n\n							<!-- START TRANSPORT -->\n							<div class="form-group">\n								<label class="control-label">{{ \'APPLICATION_TRANSPORT\' | translate}}</label>\n								<ui-select multiple name="transport" ng-model="item.transport" theme="bootstrap" ng-disabled="disabled">\n							    <ui-select-match placeholder="Select transport...">{{$item}}</ui-select-match>\n							    <ui-select-choices repeat="transport in [\'udp\', \'tcp\', \'ws\', \'wss\'] | filter: $select.search">\n							    	{{transport}}\n							    </ui-select-choices>\n							  </ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_VOICE_TRANSPORT\' | translate }}\n								</span>\n							</div>\n							<!-- END TRANSPORT -->\n\n							<!-- START CODEC -->\n							<div class="form-group">\n								<label class="control-label">{{ \'APPLICATION_ALLOWED_CODECS\' | translate}}</label>\n								<ui-select multiple ng-model="item.allow" name="allow" theme="bootstrap" ng-disabled="disabled">\n							    <ui-select-match placeholder="Select codec...">{{$item}}</ui-select-match>\n							    <ui-select-choices repeat="allow in [\'g729\', \'ilbc\', \'gsm\', \'ulaw\', \'alaw\'] | filter: $select.search">\n							    	{{allow}}\n							    </ui-select-choices>\n							  </ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_VOICE_CODEC\' | translate }}\n								</span>\n							</div>\n							<!-- END CODEC -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END CHANGE AVATAR TAB -->\n\n					<!-- CHANGE PASSWORD TAB -->\n					<div class="tab-pane" id="tab_1_3" data-ng-show="Auth.isAdmin() || item.id === getCurrentTelephone().id">\n						<form name="forms.changePwd" data-ng-submit="updateItem() && forms.changePwd.$valid" novalidate>\n							<!-- START CURRENT PWD -->\n							<!-- <div class="form-group" data-ng-if="!Auth.isAdmin()" data-ng-class="{\'has-error\': (forms.changePwd.current_pwd.$touched || forms.changePwd.$submitted) && forms.changePwd.current_pwd.$invalid}">\n								<label class="control-label">{{\'APPLICATION_CURRENT_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="password" name="current_pwd" placeholder="{{\'APPLICATION_CURRENT_PASSWORD\' | translate}}" class="form-control" data-ng-model="item.currentPwd" required/>\n								<span data-ng-show="(forms.changePwd.current_pwd.$touched || forms.changePwd.$submitted) && forms.changePwd.current_pwd.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div> -->\n							<!-- END CURRENT PWD -->\n							<!-- START NEW PWD -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.changePwd.new_pwd.$touched || forms.changePwd.$submitted) && forms.changePwd.new_pwd.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NEW_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="password" name="new_pwd" placeholder="{{\'APPLICATION_NEW_PASSWORD\' | translate}}" class="form-control" data-ng-model="item.password" required/>\n								<span data-ng-show="(forms.changePwd.new_pwd.$touched || forms.changePwd.$submitted) && forms.changePwd.new_pwd.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NEW PWD -->\n							<!-- START RE-NEW PWD -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.changePwd.re_new_pwd.$touched || forms.changePwd.$submitted) && forms.changePwd.re_new_pwd.$invalid}">\n								<label class="control-label">{{\'APPLICATION_RE_TYPE_NEW_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="password" name="re_new_pwd" placeholder="{{\'APPLICATION_RE_TYPE_NEW_PASSWORD\' | translate}}" class="form-control" data-ng-model="item.reNewPwd" nx-equal="item.password" required/>\n								<span data-ng-show="(forms.changePwd.new_pwd.$touched || forms.changePwd.$submitted) && forms.changePwd.new_pwd.$invalid" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END RE-NEW PWD -->\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END CHANGE PASSWORD TAB -->\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/staff/telephone/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initView()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-phone"></i>\n					<a href="/staff/telephones/list">{{ \'APPLICATION_TELEPHONES\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<a href="#">{{item.fullname}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR TELEPHONEPIC -->\n				<div class="profile-userpic">\n					<!-- <img ng-src="api/telephones/avatar/{{item.userpic ? item.userpic : \'unknown_avatar\'}}" class="img-responsive"> -->\n				</div>\n				<!-- END SIDEBAR TELEPHONEPIC -->\n				<!-- SIDEBAR TELEPHONE TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{item.fullname}}\n					</div>\n					<div class="profile-usertitle-job">\n						{{item.role}}\n					</div>\n				</div>\n				<!-- END SIDEBAR TELEPHONE TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.staff.telephones.view.account\')}">\n							<a data-ng-href="/telephones/view/{{item.id}}/account">\n							<i class="icon-item"></i>\n							{{ \'APPLICATION_ACCOUNT\' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/staff/telephone/wizard/wizard.html",'<div class="col-md-12">\n  <!-- BEGIN PAGE HEADER-->\n	<div class="page-bar">\n		<ul class="page-breadcrumb">\n			<li>\n				<i class="icon-rocket"></i>\n				<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n				<i class="fa fa-angle-right"></i>\n			</li>\n			<li>\n				<i class="icon-phone"></i>\n				<a href="/staff/telephones/list">{{ \'APPLICATION_TELEPHONES\' | translate }}</a>\n				<i class="fa fa-angle-right"></i>\n			</li>\n			<li>\n				<i class="icon-options"></i>\n				<a href="/staff/telephones/wizard">{{ \'APPLICATION_WIZARD\' | translate }}</a>\n			</li>\n		</ul>\n	</div>\n  <!-- END PAGE HEADER-->\n\n  <!-- BEGIN PORTLET-->\n  <div class="portlet light bordered" data-ng-init="initWizard()">\n  	<div class="portlet-title">\n  		<div class="caption font-green-sharp">\n  			<i class="icon-phone font-green-sharp"></i>\n  			<span class="caption-subject">{{ \'APPLICATION_TELEPHONE\' | translate }} WIZARD</a> </span>\n  		</div>\n  	</div>\n  	<div class="portlet-body">\n  		<wizard on-finish="createItem()">\n				<wz-step title="{{\'APPLICATION_ACCOUNT\' | translate}}" canexit="exitValidation(forms.info.$valid)">\n			    <form name="forms.info" novalidate>\n\n			      <!-- START NAME -->\n			      <div class="form-group" data-ng-class="{\'has-error\': (forms.info.fullname.$touched || forms.info.$submitted) && forms.info.fullname.$invalid}">\n			        <label class="control-label">{{\'APPLICATION_FULLNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n			        <input type="text" name="fullname" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.fullname" required/>\n							<span data-ng-show="(forms.info.fullname.$touched || forms.info.$submitted) && forms.info.fullname.$error.required" class="help-block help-block-error">\n			          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n			        </span>\n			      </div>\n			      <!-- END NAME -->\n\n			      <!-- START USERNAME -->\n			      <div class="form-group" data-ng-class="{\'has-error\': (forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$invalid}">\n			        <label class="control-label">{{\'APPLICATION_USERNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n			        <input type="text" name="name" placeholder="{{\'APPLICATION_USERNAME\' | translate}}" class="form-control" data-ng-model="item.name" ata-ng-pattern="settings.patternName"  required />\n							<span data-ng-show="(forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$error.required" class="help-block help-block-error">\n			          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n			        </span>\n							<span data-ng-show="(forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$error.ngRemoteValidate" class="help-block help-block-error">\n			          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_EXIST_USERNAME\' | translate}}.\n			        </span>\n							<span data-ng-show="(forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$error.pattern" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_INVALID_PATTERN_NAME\' | translate}}.\n							</span>\n			      </div>\n			      <!-- END USERNAME -->\n\n			      <!-- START PASSWORD -->\n			      <div class="form-group" data-ng-class="{\'has-error\': (forms.info.password.$touched || forms.info.$submitted) && forms.info.password.$invalid}">\n			        <label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n			        <input type="password" name="password" placeholder="{{\'APPLICATION_PASSWORD\' | translate}}" class="form-control" data-ng-model="item.password" required/>\n			        <span data-ng-show="(forms.info.password.$touched || forms.info.$submitted) && forms.info.password.$error.required" class="help-block help-block-error">\n			          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n			        </span>\n			      </div>\n			      <!-- END PASSWORD -->\n\n			      <!-- START RE PASSWORD -->\n			      <div class="form-group" data-ng-class="{\'has-error\': (forms.info.rpassword.$touched || forms.info.$submitted) && forms.info.rpassword.$invalid}">\n			        <label class="control-label">{{\'APPLICATION_CONFIRM_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n			        <input type="password" name="rpassword" placeholder="{{\'APPLICATION_CONFIRM_PASSWORD\' | translate}}" class="form-control" data-ng-model="item.rpassword" nx-equal="item.password" required/>\n			        <span data-ng-show="(forms.info.rpassword.$touched || forms.info.$submitted) && forms.info.rpassword.$error.required" class="help-block help-block-error">\n			          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n			        </span>\n			        <span data-ng-show="(forms.info.rpassword.$touched || forms.info.$submitted) && forms.info.rpassword.$error.nxEqual" class="help-block help-block-error">\n			          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_WRONG_PASSWORD\' | translate}}.\n			        </span>\n			      </div>\n			      <!-- END RE PASSWORD -->\n\n						<!-- START INTERNAL -->\n						<div class="form-group" data-ng-class="{\'has-error\': (forms.info.internal.$touched || forms.info.$submitted) && forms.info.internal.$invalid}">\n							<label class="control-label">{{\'APPLICATION_INTERNAL_NUMBER\' | translate}}<span class="required" aria-required="true">*</span></label>\n							<div class="input-group">\n							<input type="number" min="1" name="internal" placeholder="{{\'APPLICATION_INTERNAL_NUMBER\' | translate}}" class="form-control" data-ng-model="item.internal" data-ng-disabled="!item.internalEnabled" data-ng-required="item.internalEnabled" ng-remote-validate="/api/agents/validate/internal"/>\n							<span class="input-group-addon">\n								<input type="checkbox" data-ng-model="item.internalEnabled">\n							</span>\n							</div>\n							<span data-ng-show="(forms.info.internal.$touched || forms.info.$submitted) && forms.info.internal.$error.required" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n							<span data-ng-show="(forms.info.internal.$touched || forms.info.$submitted) && forms.info.internal.$error.ngRemoteValidate" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_EXIST_INTERNAL\' | translate}}.\n							</span>\n						</div>\n						<!-- END INTERNAL -->\n\n						<!-- START DESCRIPTION -->\n						<div class="form-group">\n							<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n							<textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n						</div>\n						<!-- END DESCRIPTION -->\n\n			      <input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" ng-click="next()"/>\n			    </form>\n			  </wz-step>\n\n				<wz-step title="{{\'APPLICATION_VOICE\' | translate}}" canexit="exitValidation(forms.voice.$valid)">\n					<form name="forms.voice" novalidate>\n\n						<!-- START TRANSPORT -->\n						<div class="form-group">\n							<label class="control-label">{{ \'APPLICATION_TRANSPORT\' | translate}}</label>\n							<ui-select multiple name="transport" ng-model="item.transport" theme="bootstrap" ng-disabled="disabled">\n						    <ui-select-match placeholder="Select transport...">{{$item}}</ui-select-match>\n						    <ui-select-choices repeat="transport in [\'udp\', \'tcp\', \'ws\', \'wss\'] | filter: $select.search">\n						    	{{transport}}\n						    </ui-select-choices>\n						  </ui-select>\n							<span class="help-block">\n								{{ \'DESCRIPTION_VOICE_TRANSPORT\' | translate }}\n							</span>\n						</div>\n						<!-- END TRANSPORT -->\n\n						<!-- START CODEC -->\n						<div class="form-group">\n							<label class="control-label">{{ \'APPLICATION_ALLOWED_CODECS\' | translate}}</label>\n							<ui-select multiple ng-model="item.allow" name="allow" theme="bootstrap" ng-disabled="disabled">\n						    <ui-select-match placeholder="Select codec...">{{$item}}</ui-select-match>\n						    <ui-select-choices repeat="allow in [\'g729\', \'ilbc\', \'gsm\', \'ulaw\', \'alaw\'] | filter: $select.search">\n						    	{{allow}}\n						    </ui-select-choices>\n						  </ui-select>\n							<span class="help-block">\n								{{ \'DESCRIPTION_VOICE_CODEC\' | translate }}\n							</span>\n						</div>\n						<!-- END CODEC -->\n\n						<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" ng-click="next()"/>\n						<input class="btn default" type="button" value="{{\'APPLICATION_BACK\' | translate}}" wz-previous/>\n					</form>\n				</wz-step>\n\n				<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n					<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n					<input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n				</wz-step>\n  		</wizard>\n  	</div>\n  </div>\n  <!-- END PORTLET-->\n</div>\n'),a.put("app/staff/user/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-eye"></i>\n					<a href="#">{{ \'APPLICATION_USERS\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-eye font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_USERS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<a class="btn green-jungle" href="/staff/users/wizard" data-toggle="dropdown">\n						<i class="icon-plus"></i> {{ \'APPLICATION_NEW_USER\' | translate }}\n					</a>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/staff/user/view/view.account.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_PROFILE\' | translate}} {{ \'APPLICATION_ACCOUNT\' | translate}}</span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_PERSONAL_INFO\' | translate}}</a>\n					</li>\n					<li>\n						<a href="#" data-target="#tab_1_2" data-toggle="tab">{{ \'APPLICATION_CHANGE_AVATAR\' | translate}}</a>\n					</li>\n					<li>\n						<a href="#" data-ng-show="Auth.isAdmin() || user.id === getCurrentUser().id" data-target="#tab_1_3" data-toggle="tab">{{ \'APPLICATION_CHANGE_PASSWORD\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- PERSONAL INFO TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.info" data-ng-submit="updateItem()" novalidate>\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.info.fullname.$touched || forms.info.$submitted) && forms.info.fullname.$invalid}">\n								<label class="control-label">{{\'APPLICATION_FULLNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="fullname" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="user.fullname" required/>\n								<span data-ng-show="(forms.info.fullname.$touched || forms.info.$submitted) && forms.info.fullname.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<!-- START USERNAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_USERNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_USERNAME\' | translate}}" class="form-control" data-ng-model="user.name" required/>\n								<span data-ng-show="(forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END USERNAME -->\n\n							<!-- START EMAIL -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.info.email.$touched || forms.info.$submitted) && forms.info.email.$invalid}">\n								<label class="control-label">{{\'APPLICATION_EMAIL\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="email" name="email" placeholder="{{\'APPLICATION_EMAIL\' | translate}}" class="form-control" data-ng-model="user.email" required/>\n								<span data-ng-show="(forms.info.email.$touched || forms.info.$submitted) && forms.info.email.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n								<span data-ng-show="(forms.info.email.$touched || forms.info.$submitted) && forms.info.email.$error.email" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_WRONG_FORMAT\' | translate}}.\n								</span>\n							</div>\n							<!-- END EMAIL -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="user.description"></textarea>\n							</div>\n							<!-- END DESCRIPTION -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END PERSONAL INFO TAB -->\n					<!-- CHANGE AVATAR TAB -->\n					<div class="tab-pane" id="tab_1_2">\n						<form action="#" role="form">\n							<div class="form-group">\n								<div class="fileinput fileinput-new" data-provides="fileinput">\n									<div class="fileinput-new thumbnail" style="width: 200px; height: 150px;">\n										<img src="http://www.placehold.it/200x150/EFEFEF/AAAAAA&amp;text=no+image" alt=""/>\n									</div>\n									<div class="fileinput-preview fileinput-exists thumbnail" style="max-width: 200px; max-height: 150px;">\n									</div>\n									<div>\n										<span class="btn default btn-file" data-ng-show="!uploader.queue[0]">\n											<span> {{ \'APPLICATION_SELECT_IMAGE\' | translate }} </span>\n											<input type="file" nv-file-select="" uploader="uploader" /><br/>\n										</span>\n										<button type="button" class="btn default" data-ng-show="uploader.queue[0]" data-dismiss="fileinput" ng-click="uploader.queue[0].remove()">\n											<span> {{ \'APPLICATION_REMOVE\' | translate }} </span>\n										</button>\n										<button type="button" class="btn green-haze" data-ng-show="uploader.queue[0]" data-ng-click="uploader.queue[0].upload()" ng-disabled="uploader.queue[0].isReady || uploader.queue[0].isUploading || uploader.queue[0].isSuccess">\n											<span> {{ \'APPLICATION_CONFIRM\' | translate }} </span>\n										</button>\n									</div>\n									<p>\n										</br> {{ \'MESSAGE_SUPPORTED_FORMATS\' | translate }} <b>jpg, png, jpeg</b>.\n									</p>\n								</div>\n							</div>\n						</form>\n						<div class="row">\n							<div class="col-md-2">\n								<table class="table" border="0">\n									<tbody>\n									<tr data-ng-repeat="item in uploader.queue">\n											<td style="border-top-style:none">\n												<strong>\n													{{ item.file.name }}\n												</strong>\n											</td>\n											<td data-ng-show="uploader.isHTML5" nowrap style="border-top-style:none">\n												{{ item.file.size/1024/1024|number:2 }} MB\n											</td>\n											<td nowrap style="border-top-style:none">\n												<button type="button" class="btn btn-danger btn-xs" data-ng-click="item.remove()">\n														<span class="glyphicon glyphicon-trash"></span> Remove\n												</button>\n											</td>\n										</tr>\n									</tbody>\n								</table>\n							</div>\n						</div>\n					</div>\n					<!-- END CHANGE AVATAR TAB -->\n					<!-- CHANGE PASSWORD TAB -->\n					<div class="tab-pane" id="tab_1_3" data-ng-show="Auth.isAdmin() || user.id === getCurrentUser().id">\n						<form name="forms.changePwd" data-ng-submit="forms.changePwd.$valid && updatePassword()" novalidate>\n							<!-- START CURRENT PWD -->\n							<div class="form-group" data-ng-if="!Auth.isAdmin()" data-ng-class="{\'has-error\': (forms.changePwd.current_pwd.$touched || forms.changePwd.$submitted) && forms.changePwd.current_pwd.$invalid}">\n								<label class="control-label">{{\'APPLICATION_CURRENT_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="password" name="current_pwd" placeholder="{{\'APPLICATION_CURRENT_PASSWORD\' | translate}}" class="form-control" data-ng-model="user.currentPwd" required/>\n								<span data-ng-show="(forms.changePwd.current_pwd.$touched || forms.changePwd.$submitted) && forms.changePwd.current_pwd.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END CURRENT PWD -->\n							<!-- START NEW PWD -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.changePwd.new_pwd.$touched || forms.changePwd.$submitted) && forms.changePwd.new_pwd.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NEW_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="password" name="new_pwd" placeholder="{{\'APPLICATION_NEW_PASSWORD\' | translate}}" class="form-control" data-ng-model="user.newPwd" required/>\n								<span data-ng-show="(forms.changePwd.new_pwd.$touched || forms.changePwd.$submitted) && forms.changePwd.new_pwd.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NEW PWD -->\n							<!-- START RE-NEW PWD -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.changePwd.re_new_pwd.$touched || forms.changePwd.$submitted) && forms.changePwd.re_new_pwd.$invalid}">\n								<label class="control-label">{{\'APPLICATION_RE_TYPE_NEW_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="password" name="re_new_pwd" placeholder="{{\'APPLICATION_RE_TYPE_NEW_PASSWORD\' | translate}}" class="form-control" data-ng-model="user.reNewPwd" nx-equal="user.newPwd" required/>\n								<span data-ng-show="(forms.changePwd.new_pwd.$touched || forms.changePwd.$submitted) && forms.changePwd.new_pwd.$invalid" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END RE-NEW PWD -->\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END CHANGE PASSWORD TAB -->\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),
-a.put("app/staff/user/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initView()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-eye"></i>\n					<a href="/staff/users/list">{{ \'APPLICATION_USERS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<a href="#">{{user.fullname}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-userpic">\n					<img ng-src="api/users/avatar/{{user.userpic ? user.userpic : \'unknown_avatar\'}}" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{user.fullname}}\n					</div>\n					<div class="profile-usertitle-job">\n						{{user.role}}\n					</div>\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.staff.users.view.account\')}">\n							<a data-ng-href="/staff/users/view/{{user.id}}/account">\n							<i class="icon-user"></i>\n							{{ \'APPLICATION_ACCOUNT\' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/staff/user/wizard/wizard.html",'<div class="col-md-12">\n  <!-- BEGIN PAGE HEADER-->\n	<div class="page-bar">\n		<ul class="page-breadcrumb">\n			<li>\n				<i class="icon-rocket"></i>\n				<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n				<i class="fa fa-angle-right"></i>\n			</li>\n			<li>\n				<i class="icon-eye"></i>\n				<a href="/users/list">{{ \'APPLICATION_USERS\' | translate }}</a>\n				<i class="fa fa-angle-right"></i>\n			</li>\n			<li>\n				<i class="icon-options"></i>\n				<a href="/staff/users/wizard">{{ \'APPLICATION_WIZARD\' | translate }}</a>\n			</li>\n		</ul>\n	</div>\n  <!-- END PAGE HEADER-->\n\n  <!-- BEGIN PORTLET-->\n  <div class="portlet light bordered">\n  	<div class="portlet-title">\n  		<div class="caption font-green-sharp">\n  			<i class="icon-user font-green-sharp"></i>\n  			<span class="caption-subject">{{ \'APPLICATION_USER\' | translate }} WIZARD</a> </span>\n  		</div>\n  	</div>\n  	<div class="portlet-body">\n  		<wizard on-finish="createItem()">\n				<wz-step title="{{\'APPLICATION_ACCOUNT\' | translate}}" canexit="exitValidation(forms.info.$valid)">\n			    <form name="forms.info" novalidate>\n\n			      <!-- START NAME -->\n			      <div class="form-group" data-ng-class="{\'has-error\': (forms.info.fullname.$touched || forms.info.$submitted) && forms.info.fullname.$invalid}">\n			        <label class="control-label">{{\'APPLICATION_FULLNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n			        <input type="text" name="fullname" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.fullname" required/>\n							<span data-ng-show="(forms.info.fullname.$touched || forms.info.$submitted) && forms.info.fullname.$error.required" class="help-block help-block-error">\n			          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n			        </span>\n			      </div>\n			      <!-- END NAME -->\n\n			      <!-- START USERNAME -->\n			      <div class="form-group" data-ng-class="{\'has-error\': (forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$invalid}">\n			        <label class="control-label">{{\'APPLICATION_USERNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n			        <input type="text" name="name" placeholder="{{\'APPLICATION_USERNAME\' | translate}}" class="form-control" data-ng-model="item.name" data-ng-pattern="settings.patternName" required />\n							<span data-ng-show="(forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$error.required" class="help-block help-block-error">\n			          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n			        </span>\n							<span data-ng-show="(forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$error.pattern" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_INVALID_PATTERN_NAME\' | translate}}.\n							</span>\n			      </div>\n			      <!-- END USERNAME -->\n\n			      <!-- START EMAIL -->\n			      <div class="form-group" data-ng-class="{\'has-error\': (forms.info.email.$touched || forms.info.$submitted) && forms.info.email.$invalid}">\n			        <label class="control-label">{{\'APPLICATION_EMAIL\' | translate}}<span class="required" aria-required="true">*</span></label>\n			        <input type="email" name="email" placeholder="{{\'APPLICATION_EMAIL\' | translate}}" class="form-control" data-ng-model="item.email" required />\n			        <span data-ng-show="(forms.info.email.$touched || forms.info.$submitted) && forms.info.email.$error.required" class="help-block help-block-error">\n			          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n			        </span>\n			        <span data-ng-show="(forms.info.email.$touched || forms.info.$submitted) && forms.info.email.$error.email" class="help-block help-block-error">\n			          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_WRONG_FORMAT\' | translate}}.\n			        </span>\n			      </div>\n			      <!-- END EMAIL -->\n\n			      <!-- START PASSWORD -->\n			      <div class="form-group" data-ng-class="{\'has-error\': (forms.info.password.$touched || forms.info.$submitted) && forms.info.password.$invalid}">\n			        <label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n			        <input type="password" name="password" placeholder="{{\'APPLICATION_PASSWORD\' | translate}}" class="form-control" data-ng-model="item.password" required/>\n			        <span data-ng-show="(forms.info.password.$touched || forms.info.$submitted) && forms.info.password.$error.required" class="help-block help-block-error">\n			          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n			        </span>\n			      </div>\n			      <!-- END PASSWORD -->\n\n			      <!-- START RE PASSWORD -->\n			      <div class="form-group" data-ng-class="{\'has-error\': (forms.info.rpassword.$touched || forms.info.$submitted) && forms.info.rpassword.$invalid}">\n			        <label class="control-label">{{\'APPLICATION_CONFIRM_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n			        <input type="password" name="rpassword" placeholder="{{\'APPLICATION_CONFIRM_PASSWORD\' | translate}}" class="form-control" data-ng-model="item.rpassword" nx-equal="item.password" required/>\n			        <span data-ng-show="(forms.info.rpassword.$touched || forms.info.$submitted) && forms.info.rpassword.$error.required" class="help-block help-block-error">\n			          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n			        </span>\n			        <span data-ng-show="(forms.info.rpassword.$touched || forms.info.$submitted) && forms.info.rpassword.$error.nxEqual" class="help-block help-block-error">\n			          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_WRONG_PASSWORD\' | translate}}.\n			        </span>\n			      </div>\n			      <!-- END RE PASSWORD -->\n\n						<!-- START DESCRIPTION -->\n						<div class="form-group">\n							<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n							<textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n						</div>\n						<!-- END DESCRIPTION -->\n\n			      <input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" ng-click="next()"/>\n			    </form>\n			  </wz-step>\n\n				<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n					<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n					<input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n				</wz-step>\n  		</wizard>\n  	</div>\n  </div>\n  <!-- END PORTLET-->\n</div>\n'),a.put("app/sugarcrm/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-handbag"></i>\n					<a href="/sugarcrm/list">{{ \'APPLICATION_SUGARCRM\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-handbag font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_SUGARCRM\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<a class="btn green-jungle" href="/sugarcrm/wizard" data-toggle="dropdown">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_ACCOUNT\' | translate }}\n						</a>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/sugarcrm/view/view.account.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_ACCOUNT\' | translate}}</span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{\'APPLICATION_GENERALS\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.formSetting" data-ng-submit="forms.formSetting.$valid && updateItem()" novalidate>\n              <!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="account.name" required/>\n								<span data-ng-show="forms.formSetting.name.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="account.description"/>\n							</div>\n							<!-- END DESCRIPTION -->\n\n              <!-- START USERNAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.username.$invalid}">\n								<label class="control-label">{{\'APPLICATION_USERNAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="username" placeholder="{{\'APPLICATION_USERNAME\' | translate}}" class="form-control" data-ng-model="account.username" required/>\n								<span data-ng-show="forms.formSetting.username.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END USERNAME -->\n\n              <!-- START REMOTE ADDRESS -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.remoteUri.$invalid}">\n								<label class="control-label">{{\'APPLICATION_REMOTE_ADDRESS\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="url" name="remoteUri" placeholder="{{\'APPLICATION_REMOTE_ADDRESS\' | translate}}" class="form-control" data-ng-model="account.remoteUri" required />\n								<span data-ng-show="forms.formSetting.remoteUri.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END USERNAME -->\n\n							<!-- START PASSWORD -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.password.$invalid}">\n								<label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="password" name="password" placeholder="{{\'APPLICATION_PASSWORD\' | translate}}" class="form-control" data-ng-model="account.password" required/>\n								<span data-ng-show="forms.formSetting.apiKey.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END API KEY -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END GENERAL TAB -->\n\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/sugarcrm/view/view.configuration.html",'<div class="row" data-ng-init="initConfiguration()">\n	<div class="col-md-12">\n		<!-- BEGIN  PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-notebook font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_CONFIGURATION\' | translate }} WIZARD</a> </span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<wizard on-finish="createConfiguration()">\n	        <wz-step title="{{\'APPLICATION_SETTINGS\' | translate}}" canexit="formValidation(formsConfiguration.info.$valid)">\n							<form name="formsConfiguration.info" novalidate>\n								<!-- START NAME -->\n								<div class="form-group" data-ng-class="{\'has-error\': formsConfiguration.info.$submitted && formsConfiguration.info.name.$invalid}">\n									<label class="control-label">{{\'APPLICATION_NAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n									<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="configuration.name" required/>\n									<span data-ng-show="formsConfiguration.info.name.$invalid && formsConfiguration.info.$submitted" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n								<!-- END NAME -->\n								<!-- START DESCRIPTION -->\n								<div class="form-group">\n									<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n									<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="configuration.description"/>\n								</div>\n								<!-- END DESCRIPTION -->\n\n								<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" data-ng-click="goNext()"/>\n							</form>\n						</wz-step>\n\n						<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n							<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n							<input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n						</wz-step>\n				</wizard>\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/sugarcrm/view/view.configurationSettings.html",'<div class="row" data-ng-init="getConfiguration();getVariables();getFields();">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_CONFIGURATION\' | translate}}: {{configurationName}}</span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{\'APPLICATION_SUBJECT\' | translate}}</a>\n					</li>\n          <li>\n						<a href="#" data-target="#tab_1_2" data-toggle="tab">{{\'APPLICATION_DESCRIPTION\' | translate}}</a>\n					</li>\n          <li>\n						<a href="#" data-target="#tab_1_3" data-toggle="tab">{{\'APPLICATION_FIELDS\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- SUBJECT TAB -->\n					<div class="tab-pane ui-padding active" id="tab_1_1">\n            <div class="row">\n              <div class="col-md-11">\n                <span class="caption-subject">All following fields will be join by blank space:</span>\n              </div>\n              <div class="col-md-1 pull-rigth">\n                <button class="btn btn-icon-only green" data-ng-click="addItemSubject()"><i class="fa fa-plus"></i></button>\n              </div>\n            </div>\n            <hr>\n						<!-- <div ng-scrollbars ng-scrollbars-config="config"> -->\n	            <div class="row" data-ng-repeat="subjectItem in subjectConfig">\n	              <div class="col-md-3">\n	                <ui-select ng-model="subjectItem.type" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeType(subjectItem)">\n	                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n	                  <ui-select-choices repeat="item in fieldType | filter: $select.search">\n	                    <div ng-bind-html="item | highlight: $select.search | capitalize"></div>\n	                  </ui-select-choices>\n	                </ui-select>\n	              </div>\n	              <div class="col-md-8" data-ng-if="subjectItem.type==\'string\'">\n	                <div class="form-group">\n	                  <input type="text" class="form-control" data-ng-model="subjectItem.content" data-ng-change="updateField(subjectItem)">\n	                </div>\n	              </div>\n	              <div class="col-md-8" data-ng-if="subjectItem.type==\'variable\'">\n	                <div class="form-group">\n	                  <ui-select theme="bootstrap" ng-disabled="disabled" data-ng-model="subjectItem.VariableId" data-ng-change="updateField(subjectItem)">\n	                    <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n	                    <ui-select-choices repeat="variable.id as variable in variables | filter: $select.search">\n	                      <div ng-bind-html="variable.name | highlight: $select.search"></div>\n	                    </ui-select-choices>\n	                  </ui-select>\n	                </div>\n	              </div>\n	              <div class="col-md-1">\n	                <div class="form-group">\n	                  <button class="btn btn-icon-only red" data-ng-click="removeItem(subjectItem)"><i class="fa fa-times"></i></button>\n	                </div>\n	              </div>\n	            </div>\n						<!-- </div> -->\n					</div>\n					<!-- END SUBJECT TAB -->\n          <!-- DESCRIPTION TAB -->\n					<div class="tab-pane ui-padding" id="tab_1_2">\n						<div class="row">\n              <div class="col-md-11">\n                <span class="caption-subject">All following fields will be join by new line:</span>\n              </div>\n              <div class="col-md-1 pull-rigth">\n                <button class="btn btn-icon-only green" data-ng-click="addItemDescription()"><i class="fa fa-plus"></i></button>\n              </div>\n            </div>\n            <hr>\n						<!-- <div ng-scrollbars ng-scrollbars-config="config"> -->\n							<div class="row" data-ng-repeat="descriptionItem in descriptionConfig">\n								<!-- <pre>\n									{{descriptionItem|json}}\n								</pre> -->\n	              <div class="col-md-2">\n	                <ui-select ng-model="descriptionItem.type" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeDescType(descriptionItem)">\n	                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected | ucfirst}}</ui-select-match>\n	                  <ui-select-choices repeat="item in descFieldType | filter: $select.search">\n	                    <div ng-bind-html="item | highlight: $select.search | ucfirst"></div>\n	                  </ui-select-choices>\n	                </ui-select>\n	              </div>\n	              <div class="col-md-9" data-ng-if="descriptionItem.type==\'string\'">\n	                <div class="form-group">\n	                  <input type="text" class="form-control" data-ng-model="descriptionItem.content" data-ng-change="updateField(descriptionItem)">\n	                </div>\n	              </div>\n								<div class="col-md-3" data-ng-if="descriptionItem.type==\'key_value\'">\n									<input type="text" class="form-control" placeholder="Key" data-ng-model="descriptionItem.key" data-ng-change="updateField(descriptionItem)">\n								</div>\n								<div class="col-md-3" data-ng-if="descriptionItem.type==\'key_value\'">\n									<ui-select ng-model="descriptionItem.keyType" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeDescType(descriptionItem)">\n	                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n	                  <ui-select-choices repeat="item in fieldType | filter: $select.search">\n	                    <div ng-bind-html="item | highlight: $select.search | capitalize"></div>\n	                  </ui-select-choices>\n	                </ui-select>\n								</div>\n								<div class="col-md-3" data-ng-if="descriptionItem.type==\'key_value\' && descriptionItem.keyType==\'string\'">\n									<input type="text" class="form-control" placeholder="Value" data-ng-model="descriptionItem.keyContent" data-ng-change="updateField(descriptionItem)">\n								</div>\n	              <div class="col-md-3" data-ng-if="descriptionItem.type==\'key_value\' && descriptionItem.keyType==\'variable\'">\n	                <div class="form-group">\n	                  <ui-select theme="bootstrap" ng-disabled="disabled" data-ng-model="descriptionItem.VariableId" data-ng-change="updateField(descriptionItem)">\n	                    <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n	                    <ui-select-choices repeat="variable.id as variable in variables | filter: $select.search">\n	                      <div ng-bind-html="variable.name | highlight: $select.search"></div>\n	                    </ui-select-choices>\n	                  </ui-select>\n	                </div>\n	              </div>\n	              <div class="col-md-1">\n	                <div class="form-group">\n	                  <button class="btn btn-icon-only red" data-ng-click="removeItem(descriptionItem)"><i class="fa fa-times"></i></button>\n	                </div>\n	              </div>\n	            </div>\n						<!-- </div> -->\n					</div>\n					<!-- END DESCRIPTION TAB -->\n          <!-- FIELDS TAB -->\n					<div class="tab-pane ui-padding" id="tab_1_3">\n						<div class="row">\n              <div class="col-md-11">\n                <span class="caption-subject">Add how to fill the fields present in your account:</span>\n              </div>\n              <div class="col-md-1 pull-rigth">\n                <button class="btn btn-icon-only green" data-ng-click="addItemField()"><i class="fa fa-plus"></i></button>\n              </div>\n            </div>\n            <hr>\n						<!-- <div ng-scrollbars ng-scrollbars-config="config"> -->\n	            <div class="row" data-ng-repeat="fieldItem in fieldConfig">\n	              <div class="col-md-3">\n	                <ui-select ng-model="fieldItem.idField" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeFieldType(fieldItem)">\n	                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.label}}</ui-select-match>\n	                  <ui-select-choices repeat="item.name as item in accountFields | filter: $select.search">\n	                    <div ng-bind-html="item.label | highlight: $select.search"></div>\n	                  </ui-select-choices>\n	                </ui-select>\n	              </div>\n	              <div class="col-md-8" data-ng-if="getSystemFieldOptions(fieldItem.idField)">\n	                <div class="form-group">\n										<ui-select ng-model="fieldItem.content" theme="bootstrap" ng-disabled="disabled" data-ng-change="updateField(fieldItem)">\n		                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n		                  <ui-select-choices repeat="item.value as item in getSystemFieldOptions(fieldItem.idField) | filter: $select.search">\n		                    <div ng-bind-html="item.name | highlight: $select.search"></div>\n		                  </ui-select-choices>\n		                </ui-select>\n	                </div>\n	              </div>\n								<div class="col-md-4" data-ng-if="!getSystemFieldOptions(fieldItem.idField)">\n									<div class="form-group">\n										<ui-select ng-model="fieldItem.type" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeType(fieldItem)">\n		                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected | ucfirst}}</ui-select-match>\n		                  <ui-select-choices repeat="item in fieldType | filter: $select.search">\n		                    <div ng-bind-html="item | highlight: $select.search | ucfirst"></div>\n		                  </ui-select-choices>\n		                </ui-select>\n									</div>\n								</div>\n								<div class="col-md-4" data-ng-if="!getSystemFieldOptions(fieldItem.idField) && fieldItem.type === \'string\'">\n	                <div class="form-group">\n										<input type="text" class="form-control" data-ng-model="fieldItem.content" data-ng-change="updateField(fieldItem)">\n	                </div>\n	              </div>\n								<div class="col-md-4" data-ng-if="!getSystemFieldOptions(fieldItem.idField) && fieldItem.type === \'variable\'">\n	                <div class="form-group">\n										<ui-select theme="bootstrap" ng-disabled="disabled" data-ng-model="fieldItem.VariableId" data-ng-change="updateField(fieldItem)">\n	                    <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n	                    <ui-select-choices repeat="variable.id as variable in variables | filter: $select.search">\n	                      <div ng-bind-html="variable.name | highlight: $select.search"></div>\n	                    </ui-select-choices>\n	                  </ui-select>\n	                </div>\n	              </div>\n	              <div class="col-md-1">\n	                <div class="form-group">\n	                  <button class="btn btn-icon-only red" data-ng-click="removeItem(fieldItem)"><i class="fa fa-times"></i></button>\n	                </div>\n	              </div>\n	            </div>\n						<!-- </div> -->\n					</div>\n					<!-- END FIELDS TAB -->\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/sugarcrm/view/view.configurations.html",'<div ui-view class="profile-content">\n	<div class="row" data-ng-init="getConfigurations()">\n		<div class="col-md-12">\n			<div class="portlet light">\n				<div class="portlet-title  tabbable-line">\n					<div class="caption caption-md">\n						<i class="icon-globe theme-font hide"></i>\n						<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_CONFIGURATIONS\' | translate}}</span>\n					</div>\n					<div class="actions">\n						<div class="btn-group">\n							<a class="btn green-jungle " href="/sugarcrm/view/{{account.id}}/configuration" data-toggle="dropdown">\n								<i class="icon-plus"></i> {{ \'APPLICATION_NEW_CONFIGURATION\' | translate }}\n							</a>\n						</div>\n					</div>\n				</div>\n				<div class="portlet-body">\n					<!-- START TABLE -->\n					<table class="table table-striped table-bordered table-hover">\n						  <thead>\n							  <tr>\n							    <th>{{\'APPLICATION_NAME\' | translate}}</th>\n									<th>{{\'APPLICATION_DESCRIPTION\' | translate}}</th>\n									<th>{{ \'APPLICATION_ACTIONS\' | translate }}</th>\n							  </tr>\n						  </thead>\n							<tbody>\n						    <tr data-ng-repeat="configuration in configurations">\n									<td>{{configuration.name}}</td>\n									<td>{{configuration.description}}</td>\n						      <td>\n										<a class="btn default btn-xs blue-stripe" data-ng-href="/sugarcrm/view/{{account.id}}/configurations/settings/{{configuration.id}}">\n											{{ \'APPLICATION_SETTINGS\' | translate}}\n						        </a>\n						        <a class="btn default btn-xs red-stripe" data-ng-click="deleteConfiguration(configuration.name,configuration.id)">\n											{{ \'APPLICATION_DELETE\' | translate }}\n						        </a>\n						      </td>\n						    </tr>\n								<tr data-ng-hide="configurations.length">\n									<td colspan="5" style="text-align:center;">\n										<i>No configuration available</i>\n									</td>\n								</tr>\n						  </tbody>\n					</table>\n					<!-- END TABLE -->\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/sugarcrm/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initView()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n          <i class="icon-handbag"></i>\n          <a href="/sugarcrm/list">{{ \'APPLICATION_SUGARCRM\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<a href="#">{{account.name}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img src="assets/images/media/sugarcrm.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{account.name}}\n					</div>\n					<div class="profile-usertitle-job">\n						{{account.remoteUri}}\n					</div>\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.sugarcrm.view.account\')}">\n							<a ng-href="/sugarcrm/view/{{account.id}}/account">\n							<i class="icon-user"></i>\n							{{ \'APPLICATION_ACCOUNT\' | translate }} </a>\n						</li>\n						<li data-ng-class="{active: $state.includes(\'main.sugarcrm.view.configurations\') || $state.is(\'main.sugarcrm.view.configuration\')}">\n							<a ng-href="/sugarcrm/view/{{account.id}}/configurations">\n							<i class="icon-settings"></i>\n							{{ \'APPLICATION_CONFIGURATIONS\' | translate }} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),
-a.put("app/sugarcrm/wizard/wizard.html",'<!-- BEGIN PAGE HEADER-->\n<div class="row">\n	<div class="col-md-12">\n			<div class="page-bar">\n				<ul class="page-breadcrumb">\n					<li>\n						<i class="icon-rocket"></i>\n						<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-handbag"></i>\n						<a href="/sugarcrm/list">{{ \'APPLICATION_SUGARCRM\' | translate }}</a>\n					</li>\n				</ul>\n			</div>\n		</div>\n</div>\n<!-- END PAGE HEADER-->\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initWizard()">\n	<div class="col-md-12">\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-notebook font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_ACCOUNT\' | translate }} WIZARD</a> </span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<wizard on-finish="createItem()">\n          <wz-step title="{{\'APPLICATION_ACCOUNT_INFO\' | translate}}" canexit="exitValidation(forms.formSetting.$valid)">\n						<form name="forms.formSetting" novalidate>\n\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n								<span data-ng-show="forms.formSetting.name.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"/>\n							</div>\n							<!-- END DESCRIPTION -->\n\n              <!-- START USERNAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.username.$invalid}">\n								<label class="control-label">{{\'APPLICATION_USERNAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="username" placeholder="{{\'APPLICATION_USERNAME\' | translate}}" class="form-control" data-ng-model="item.username" required/>\n								<span data-ng-show="forms.formSetting.username.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END USERNAME -->\n\n\n              <!-- START REMOTE ADDRESS -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.remoteUri.$invalid}">\n								<label class="control-label">{{\'APPLICATION_REMOTE_ADDRESS\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="url" name="remoteUri" placeholder="{{\'APPLICATION_REMOTE_ADDRESS\' | translate}}" class="form-control" data-ng-model="item.remoteUri" required ng-remote-validate="/api/sugarcrm/accounts/validate/remoteUri"/>\n								<span data-ng-show="forms.formSetting.remoteUri.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n                <span data-ng-show="(forms.formSetting.remoteUri.$touched || forms.formSetting.$submitted) && forms.formSetting.remoteUri.$error.ngRemoteValidate" class="help-block help-block-error">\n				          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_EXIST_DOMAIN\' | translate}}.\n				        </span>\n							</div>\n							<!-- END USERNAME -->\n\n              <!-- START PASSWORD -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.password.$invalid}">\n								<label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="password" name="password" placeholder="{{\'APPLICATION_PASSWORD\' | translate}}" class="form-control" data-ng-model="item.password" required/>\n								<span data-ng-show="forms.formSetting.apiKey.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END PASSWORD -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" data-ng-click="next()"/>\n\n						</form>\n					</wz-step>\n\n					<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n						<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n						<input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n					</wz-step>\n\n				</wizard>\n\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/tools/answer/list/list.create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_CANNED_ANSWER\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.key.$touched || form.$submitted) && form.key.$invalid}">\n      <label class="control-label">{{\'APPLICATION_KEY\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="key" placeholder="{{\'APPLICATION_KEY\' | translate}}" class="form-control" data-ng-model="item.key" required/>\n      <span data-ng-show="(form.key.$touched || form.$submitted) && form.key.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n    <!-- START VALUE -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.value.$touched || form.$submitted) && form.value.$invalid}">\n      <label class="control-label">{{\'APPLICATION_VALUE\' | translate}}<span class="required" aria-required="true">*</span></label></label>\n      <textarea type="text" name="value" placeholder="{{\'APPLICATION_VALUE\' | translate}}" class="form-control" data-ng-model="item.value" required></textarea>\n      <span data-ng-show="(form.value.$touched || form.$submitted) && form.value.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END VALUE -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n    </div>\n    <!-- END DESCRIPTION -->\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="save()" ng-disabled="form.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/tools/answer/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-wrench"></i>\n					<a href="#">{{ \'APPLICATION_TOOLS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-magic-wand"></i>\n					<a href="#">{{ \'APPLICATION_CANNED_ANSWERS\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-magic-wand font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_CANNED_ANSWERS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<a class="btn green-jungle" href="#" data-toggle="dropdown" data-ng-click="createItem()">\n						<i class="icon-plus"></i> {{ \'APPLICATION_NEW_CANNED_ANSWER\' | translate }}\n					</a>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n						<div class="watermark" ng-show="!gridOptions.data.length">{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/tools/answer/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getAnswer()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-wrench"></i>\n					<a href="#">{{ \'APPLICATION_TOOLS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-magic-wand"></i>\n					<a href="/tools/answers/list">{{ \'APPLICATION_CANNED_ANSWER\' | translate }}</a>\n					<i data-ng-show="answer" class="fa fa-angle-right"></i>\n				</li>\n				<li data-ng-show="answer">\n					<a href="#">{{answer.key}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/answer.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{answer.name}}\n					</div>\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.tools.answers.view.settings\')}">\n							<a data-ng-href="/tools/answers/view/{{answer.id}}/settings">\n								<i class="icon-settings"></i>\n								{{ \'APPLICATION_SETTINGS\' | translate}}\n							</a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/tools/answer/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_CANNED_ANSWER\' | translate}} {{ \'APPLICATION_SETTINGS\' | translate}} </span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_GENERAL\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.general" data-ng-submit="forms.general.$valid && updateAnswer()" novalidate>\n\n							<!-- START KEY -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.key.$touched || forms.general.$submitted) && forms.general.key.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="key" placeholder="{{\'APPLICATION_KEY\' | translate}}" class="form-control" data-ng-model="answer.key" required/>\n								<span data-ng-show="(forms.general.key.$touched || forms.general.$submitted) && forms.general.key.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END KEY -->\n\n							<!-- START VALUE -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.value.$touched || forms.general.$submitted) && forms.general.value.$invalid}">\n								<label class="control-label">{{\'APPLICATION_VALUE\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<textarea type="text" name="value" placeholder="{{\'APPLICATION_VALUE\' | translate}}" class="form-control" data-ng-model="answer.value" required></textarea>\n								<span data-ng-show="(forms.general.value.$touched || forms.general.$submitted) && forms.general.value.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END VALUE -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="answer.description"></textarea>\n							</div>\n							<!-- END DESCRIPTION -->\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END ADVANCED TAB -->\n\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/tools/automation/list/list.html",'<div class="row">\n	<div class="col-md-12">\n			<div class="page-bar">\n				<ul class="page-breadcrumb">\n					<li>\n						<i class="icon-rocket"></i>\n						<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-wrench"></i>\n						<a href="#">{{ \'APPLICATION_TOOLS\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-bulb"></i>\n						<a href="#">{{ \'APPLICATION_AUTOMATIONS\' | translate }}</a>\n					</li>\n				</ul>\n			</div>\n		</div>\n</div>\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-bulb font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_AUTOMATIONS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<a class="btn green-jungle " href="/tools/automations/wizard">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_AUTOMATION\' | translate }}\n						</a>\n					</div>\n					<!-- <a class="btn btn-icon-only btn-default fullscreen" href="#"></a> -->\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/tools/automation/view/view.html",'<!-- BEGIN PAGE HEADER-->\n<div class="row" data-ng-init="initView()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-settings"></i>\n					<a href="/tools/automations/list">{{ \'APPLICATION_AUTOMATIONS\' | translate }}</a>\n					<i class="fa fa-angle-right" data-ng-show="automation"></i>\n				</li>\n				<li data-ng-show="automation">\n					<a href="#">{{ automation.description || automation.name }}</a>\n				</li>\n			</ul>\n		</div>\n\n<!-- END PAGE HEADER-->\n\n<!-- BEGIN PAGE CONTENT-->\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/automation.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{ automation.name }}\n					</div>\n					<div class="profile-usertitle-job">\n						{{ automation.description }}\n					</div>\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.tools.automations.view.settings\')}">\n							<a href="/tools/automations/view/{{automation.id}}/settings">\n							<i class="icon-bulb"></i>\n							{{ \'APPLICATION_SETTINGS\' | translate }} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/tools/automation/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_SETTINGS\' | translate}}</span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{\'APPLICATION_GENERALS\' | translate}}</a>\n					</li>\n					<li>\n						<a href="#" data-target="#tab_1_2" data-toggle="tab">{{\'APPLICATION_CONDITIONS\' | translate}} & {{\'APPLICATION_ACTIONS\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n			<div class="portlet-body">\n				<!-- <pre>\n					{{conditionsData.query | json}}\n				</pre>\n				<pre>\n					{{actionsData.query | json}}\n				</pre> -->\n				<form name="forms.general" data-ng-submit="exitValidation(forms.general.$valid) && updateAutomation()" novalidate>\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="automation.name" required/>\n								<span data-ng-show="(forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid && forms.general.name.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<!-- START TIMEOUT -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.general.timeout.$touched && forms.general.timeout.$invalid}">\n								<label class="control-label">{{\'APPLICATION_TIMEOUT\' | translate}}</label>\n								<input type="number" name="timeout" min="1" placeholder="{{\'APPLICATION_TIMEOUT\' | translate}}" class="form-control" data-ng-model="automation.timeout" data-ng-init="item.timeout = 10" required/>\n								<span data-ng-show="forms.general.timeout.$touched && forms.general.name.$invalid && forms.general.name.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END TIMEOUT -->\n\n							<!-- START STATUS -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_STATUS\' | translate}}</label></br>\n							<input\n								    bs-switch\n										class="form-control"\n								    ng-model="automation.status"\n								    type="checkbox"\n										name="status"\n								    switch-active="{{ recordSwitch.isActive }}"\n								    switch-on-text="{{ recordSwitch.onText }}"\n								    switch-off-text="{{ recordSwitch.offText }}"\n								    switch-on-color="{{ recordSwitch.onColor }}"\n								    switch-off-color="{{ recordSwitch.offColor }}"\n								    switch-animate="{{ recordSwitch.animate }}"\n								    switch-size="{{ recordSwitch.size }}"\n								    switch-label="{{ recordSwitch.label }}"\n								    switch-icon="{{ recordSwitch.icon }}"\n								    switch-radio-off="{{ recordSwitch.radioOff }}"\n								    switch-label-width="{{ recordSwitch.labelWidth }}"\n								    switch-handle-width="{{ recordSwitch.handleWidth }}">\n							</div>\n							<!-- END STATUS -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="automation.description"/>\n							</div>\n							<!-- END DESCRIPTION -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n					</div>\n					<!-- END GENERAL TAB -->\n					<div class="tab-pane" id="tab_1_2">\n						<div class="portlet light bordered">\n							<div class="portlet-title">\n								<div class="caption font-blue-hoki">\n									<i class="icon-tag font-blue-hoki"></i>\n									<span class="caption-subject" ng-bind-html="\'APPLICATION_MEET_ALL_CONDITIONS\' | translate"></span>:\n								</div>\n							</div>\n							<div class="portlet-body">\n								<div class="padding-bottom row" ng-repeat="all in automation.All">\n									<condition-builder element="all" serviceindex="automation.channel" service="$automations" form="forms.general"></condition-builder>\n									<button type="button" ng-click="removeCondition(\'All\',$index)" class="btn btn-danger remove-condition col-md-1 left-margin"><span class="glyphicon glyphicon-minus-sign"></span></button>\n								</div>\n								<button type="button" class="btn btn-sm green padding-bottom" data-ng-click="addCondition(\'All\')">\n									<i class="fa fa-plus"></i> {{\'APPLICATION_ADD_CONDITION\' | translate}}\n								</button>\n							</div>\n						</div>\n						<div class="portlet light bordered">\n							<div class="portlet-title">\n								<div class="caption font-blue-hoki">\n									<i class="icon-tag font-blue-hoki"></i>\n									<span class="caption-subject" ng-bind-html="\'APPLICATION_MEET_ANY_CONDITIONS\' | translate"></span>:\n								</div>\n							</div>\n							<div class="portlet-body">\n								<div class="padding-bottom row" ng-repeat="any in automation.Any">\n									<condition-builder element="any" serviceindex="automation.channel" service="$automations" form="forms.general"></condition-builder>\n									<button type="button" ng-click="removeCondition(\'Any\',$index)" class="btn btn-danger remove-condition col-md-1 left-margin"><span class="glyphicon glyphicon-minus-sign"></span></button>\n								</div>\n								<button type="button" class="btn btn-sm green padding-bottom" data-ng-click="addCondition(\'Any\')">\n									<i class="fa fa-plus"></i> {{\'APPLICATION_ADD_CONDITION\' | translate}}\n								</button>\n							</div>\n						</div>\n						<div class="portlet light bordered">\n							<div class="portlet-title">\n								<div class="caption font-blue-hoki">\n									<i class="icon-tag font-blue-hoki"></i>\n									<span class="caption-subject">{{ \'APPLICATION_ACTIONS\' | translate }}</span>:\n								</div>\n							</div>\n							<div class="portlet-body">\n								<div class="padding-bottom row" ng-repeat="action in automation.Actions">\n									<div class="form-group col-md-2" data-ng-class="{\'has-error\': (forms.general[\'action\'+$index].$touched || forms.general.$submitted) && forms.general[\'action\'+$index].$invalid}">\n										<ui-select data-ng-model="action.action" theme="bootstrap" data-ng-change="resetActionData(action)" name="action{{$index}}" required>\n											<ui-select-match placeholder="{{ \'APPLICATION_ACTION\' | translate }}">{{$select.selected.name | translate}}</ui-select-match>\n											<ui-select-choices repeat="tAction.value as tAction in $automations.services[automation.channel].actions | filter: $select.search">\n												<div ng-bind-html="tAction.name | translate | highlight: $select.search"></div>\n											</ui-select-choices>\n										</ui-select>\n										<span data-ng-show="(forms.general[\'action\'+$index].$touched || forms.general.$submitted) && forms.general[\'action\'+$index].$error.required" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<div ng-switch="action.action">\n										<action-builder-template ng-switch-when="template" element="action" form="forms.general"></action-builder-template>\n										<action-builder-integration ng-switch-when="integration" element="action" form="forms.general"></action-builder-integration>\n										<action-builder-status ng-switch-when="status" element="action" form="forms.general"></action-builder-status>\n									</div>\n									<button type="button" ng-click="removeAction($index)" class="btn btn-danger remove-condition col-md-1 left-margin"><span class="glyphicon glyphicon-minus-sign"></span></button>\n								</div>\n								<button type="button" class="btn btn-sm green padding-bottom" data-ng-click="addAction()">\n									<i class="fa fa-plus"></i> {{\'APPLICATION_ADD_ACTION\' | translate}}\n								</button>\n							</div>\n						</div>\n						<div class="has-error" data-ng-show="forms.general.$submitted && !automation.All.length && !automation.Any.length">\n							<span class="help-block help-block-error form-control">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_INSERT_AT_LEAST_ONE_CONDITION\' | translate}}.\n							</span>\n						</div>\n						<div class="has-error" data-ng-show="forms.general.$submitted && !automation.Actions.length">\n							<span class="help-block help-block-error form-control">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_INSERT_AT_LEAST_ONE_ACTION\' | translate}}.\n							</span>\n						</div>\n						<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n					</div>\n				</div>\n				</form>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/tools/automation/wizard/wizard.html",'<div class="row">\n	<div class="col-md-12">\n		<!-- BEGIN PAGE HEADER-->\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-settings"></i>\n					<a href="/tools/automations/list">{{ \'APPLICATION_AUTOMATIONS\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n		<!-- END PAGE HEADER-->\n\n		<!-- BEGIN  PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-bulb font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_AUTOMATIONS\' | translate }} WIZARD</a> </span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<wizard on-finish="createItem()">\n					<wz-step title="{{\'APPLICATION_GENERAL\' | translate}}" canexit="exitValidation(forms.general.$valid)">\n						<form name="forms.general" data-ng-submit="submit()" novalidate>\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.general.name.$touched && forms.general.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n								<span data-ng-show="forms.general.name.$touched && forms.general.name.$invalid && forms.general.name.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<!-- START TIMEOUT -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.general.timeout.$touched && forms.general.timeout.$invalid}">\n								<label class="control-label">{{\'APPLICATION_TIMEOUT\' | translate}}</label>\n								<input type="number" name="timeout" min="1" placeholder="{{\'APPLICATION_TIMEOUT\' | translate}}" class="form-control" data-ng-model="item.timeout" data-ng-init="item.timeout = 10" required/>\n								<span data-ng-show="forms.general.timeout.$touched && forms.general.name.$invalid && forms.general.name.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END TIMEOUT -->\n\n							<!-- START STATUS -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_STATUS\' | translate}}</label></br>\n							<input\n								    bs-switch\n										class="form-control"\n								    ng-model="item.status"\n								    type="checkbox"\n										name="status"\n										data-ng-init="item.status = 0"\n								    switch-active="{{ recordSwitch.isActive }}"\n								    switch-on-text="{{ recordSwitch.onText }}"\n								    switch-off-text="{{ recordSwitch.offText }}"\n								    switch-on-color="{{ recordSwitch.onColor }}"\n								    switch-off-color="{{ recordSwitch.offColor }}"\n								    switch-animate="{{ recordSwitch.animate }}"\n								    switch-size="{{ recordSwitch.size }}"\n								    switch-label="{{ recordSwitch.label }}"\n								    switch-icon="{{ recordSwitch.icon }}"\n								    switch-radio-off="{{ recordSwitch.radioOff }}"\n								    switch-label-width="{{ recordSwitch.labelWidth }}"\n								    switch-handle-width="{{ recordSwitch.handleWidth }}">\n							</div>\n							<!-- END STATUS -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"/>\n							</div>\n							<!-- END DESCRIPTION -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" ng-click="next()"/>\n						</form>\n					</wz-step>\n					<wz-step title="{{\'APPLICATION_SETTINGS\' | translate}}" canexit="exitSettingsValidation(forms.settings.$valid)">\n						<form name="forms.settings" novalidate>\n						<div class="portlet light bordered">\n							<div class="portlet-title">\n								<div class="caption font-blue-hoki">\n									<i class="icon-tag font-blue-hoki"></i>\n									<span class="caption-subject">{{ \'APPLICATION_CHANNEL\' | translate }}</span>\n								</div>\n							</div>\n							<div class="portlet-body">\n								<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.channel.$touched || forms.settings.$submitted) && forms.settings.channel.$invalid}">\n									<label class="control-label">{{ \'APPLICATION_CHANNEL\' | translate }}<span class="required" aria-required="true">*</span></label>\n									<ui-select data-ng-model="item.channel" name="channel" theme="bootstrap" required>\n										<ui-select-match placeholder="{{ \'APPLICATION_CHANNEL\' | translate }}">{{$select.selected | capitalize}}</ui-select-match>\n										<ui-select-choices repeat="channel in $automations.channels | filter: $select.search">\n											<div ng-bind-html="channel | highlight: $select.search | capitalize"></div>\n										</ui-select-choices>\n									</ui-select>\n									<span data-ng-show="(forms.settings.channel.$touched || forms.settings.$submitted) && forms.settings.channel.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n							</div>\n						</div>\n						<div class="portlet light bordered">\n							<div class="portlet-title">\n								<div class="caption font-blue-hoki">\n									<i class="icon-tag font-blue-hoki"></i>\n									<span class="caption-subject" ng-bind-html="\'APPLICATION_MEET_ALL_CONDITIONS\' | translate"></span>:\n								</div>\n							</div>\n							<div class="portlet-body">\n								<div class="padding-bottom row" ng-repeat="all in item.All">\n									<condition-builder element="all" serviceindex="item.channel" service="$automations" form="forms.settings"></condition-builder>\n									<button type="button" ng-click="removeCondition(\'All\',$index)" class="btn btn-danger remove-condition col-md-1 left-margin"><span class="glyphicon glyphicon-minus-sign"></span></button>\n								</div>\n								<button type="button" class="btn btn-sm green padding-bottom" data-ng-click="addCondition(\'All\')">\n									<i class="fa fa-plus"></i> {{\'APPLICATION_ADD_CONDITION\' | translate}}\n								</button>\n							</div>\n						</div>\n						<div class="portlet light bordered">\n							<div class="portlet-title">\n								<div class="caption font-blue-hoki">\n									<i class="icon-tag font-blue-hoki"></i>\n									<span class="caption-subject" ng-bind-html="\'APPLICATION_MEET_ANY_CONDITIONS\' | translate"></span>:\n								</div>\n							</div>\n							<div class="portlet-body">\n								<div class="padding-bottom row" ng-repeat="any in item.Any">\n									<condition-builder element="any" serviceindex="item.channel" service="$automations" form="forms.settings"></condition-builder>\n									<button type="button" ng-click="removeCondition(\'Any\',$index)" class="btn btn-danger remove-condition col-md-1 left-margin"><span class="glyphicon glyphicon-minus-sign"></span></button>\n								</div>\n								<button type="button" class="btn btn-sm green padding-bottom" data-ng-click="addCondition(\'Any\')">\n									<i class="fa fa-plus"></i> {{\'APPLICATION_ADD_CONDITION\' | translate}}\n								</button>\n							</div>\n						</div>\n						<div class="portlet light bordered">\n							<div class="portlet-title">\n								<div class="caption font-blue-hoki">\n									<i class="icon-tag font-blue-hoki"></i>\n									<span class="caption-subject">{{ \'APPLICATION_ACTIONS\' | translate }}</span>:\n								</div>\n							</div>\n							<div class="portlet-body">\n								<div class="padding-bottom row" ng-repeat="action in item.Actions">\n									<div class="form-group col-md-2" data-ng-class="{\'has-error\': (forms.settings[\'action\'+$index].$touched || forms.settings.$submitted) && forms.settings[\'action\'+$index].$invalid}">\n										<ui-select data-ng-model="action.action" theme="bootstrap" data-ng-change="resetActionData(action)" name="action{{$index}}" required>\n											<ui-select-match placeholder="{{ \'APPLICATION_ACTION\' | translate }}">{{$select.selected.name | translate}}</ui-select-match>\n											<ui-select-choices repeat="tAction.value as tAction in $automations.services[item.channel].actions | filter: $select.search">\n												<div ng-bind-html="tAction.name | translate | highlight: $select.search"></div>\n											</ui-select-choices>\n										</ui-select>\n										<span data-ng-show="(forms.settings[\'action\'+$index].$touched || forms.settings.$submitted) && forms.settings[\'action\'+$index].$error.required" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<div ng-switch="action.action">\n										<action-builder-template ng-switch-when="template" element="action" form="forms.settings"></action-builder-template>\n										<action-builder-integration ng-switch-when="integration" element="action" form="forms.settings"></action-builder-integration>\n										<action-builder-status ng-switch-when="status" element="action" form="forms.settings"></action-builder-status>\n									</div>\n									<button type="button" ng-click="removeAction($index)" class="btn btn-danger remove-condition col-md-1 left-margin"><span class="glyphicon glyphicon-minus-sign"></span></button>\n								</div>\n								<button type="button" class="btn btn-sm green padding-bottom" data-ng-click="addAction()">\n									<i class="fa fa-plus"></i> {{\'APPLICATION_ADD_ACTION\' | translate}}\n								</button>\n							</div>\n						</div>\n						<div class="has-error" data-ng-show="forms.settings.$submitted && !item.All.length && !item.Any.length">\n							<span class="help-block help-block-error form-control">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_INSERT_AT_LEAST_ONE_CONDITION\' | translate}}.\n							</span>\n						</div>\n						<div class="has-error" data-ng-show="forms.settings.$submitted && !item.Actions.length">\n							<span class="help-block help-block-error form-control">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_INSERT_AT_LEAST_ONE_ACTION\' | translate}}.\n							</span>\n						</div>\n						<button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n						<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" ng-click="next()"/>\n					</form>\n					</wz-step>\n					<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n						<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n						<button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n						<input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n					</wz-step>\n				</wizard>\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),
-a.put("app/tools/interval/list/list.create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_INTERVAL\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.name.$touched || form.$submitted) && form.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n      <span data-ng-show="(form.name.$touched || form.$submitted) && form.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n    </div>\n    <!-- END DESCRIPTION -->\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="save()" ng-disabled="form.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/tools/interval/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-wrench"></i>\n					<a href="#">{{ \'APPLICATION_TOOLS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-clock"></i>\n					<a href="#">{{ \'APPLICATION_INTERVALS\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-docs font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_INTERVALS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<button class="btn green-jungle " ng-click="createItem()">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_INTERVAL\' | translate }}\n						</button>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/tools/interval/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getInterval()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-wrench"></i>\n					<a href="#">{{ \'APPLICATION_TOOLS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-clock"></i>\n					<a href="/tools/intervals/list">{{ \'APPLICATION_INTERVALS\' | translate }}</a>\n					<i data-ng-show="interval" class="fa fa-angle-right"></i>\n				</li>\n				<li data-ng-show="interval">\n					<a href="#">{{interval.name}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/interval.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{interval.name}}\n					</div>\n					<!-- <div class="profile-usertitle-job">\n						{{user.role}}\n					</div> -->\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.tools.intervals.view.settings\')}">\n							<a data-ng-click="deselectAndRedirect(\'/tools/intervals/view/\'+interval.id+\'/settings\')">\n							<i class="icon-settings"></i>\n							{{ \'APPLICATION_SETTINGS\' | translate}} </a>\n						</li>\n'+"						<li data-ng-class=\"{active: $state.is('main.tools.intervals.view.subintervals') || $state.is('main.tools.intervals.view.subinterval') || $state.is('main.tools.intervals.view.subintervals.settings')}\">\n							<a data-ng-click=\"deselectAndRedirect('/tools/intervals/view/'+interval.id+'/subintervals')\">\n							<i class=\"icon-list\"></i>\n							{{ 'APPLICATION_SUBINTERVALS' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class=\"profile-content\">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n"),a.put("app/tools/interval/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_INTERVAL\' | translate}} {{ \'APPLICATION_SETTINGS\' | translate}} </span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_GENERAL\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.general" data-ng-submit="forms.general.$valid && updateInterval()" novalidate>\n\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="interval.name" required/>\n								<span data-ng-show="(forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="interval.description"></textarea>\n							</div>\n							<!-- END DESCRIPTION -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END ADVANCED TAB -->\n\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/tools/interval/view/view.subinterval.html",'\n<div class="row" data-ng-init="initSubInterval(true)">\n	<div class="col-md-12">\n		<!-- BEGIN  PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-notebook font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_NEW_SUBINTERVAL\' | translate }} WIZARD</a> </span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<wizard on-finish="addSubInterval()">\n          <wz-step title="{{\'APPLICATION_SETTINGS\' | translate}}" canexit="exitValidation(forms.subinterval.name.$valid)">\n            <form name="forms.subinterval" novalidate>\n\n              <!-- START NAME -->\n              <div class="form-group" data-ng-class="{\'has-error\': (forms.subinterval.name.$touched || forms.subinterval.$submitted) && forms.subinterval.name.$invalid}">\n                <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n                <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="subinterval.name" required/>\n                <span data-ng-show="(forms.subinterval.name.$touched || forms.subinterval.$submitted) && forms.subinterval.name.$error.required" class="help-block help-block-error">\n                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                </span>\n              </div>\n              <!-- END NAME -->\n\n							<!-- START TIME -->\n              <div class="form-group">\n                <label class="control-label">{{ \'APPLICATION_TIME\' | translate }}</label>\n                <div class="input-group input-large">\n									<fieldset class="pull-left" ng-disabled="splittedInterval.alwaysTime"><uib-timepicker name="t_from" data-ng-model="splittedInterval.t_from" show-meridian="false" show-spinners="false"></uib-timepicker></fieldset>\n                  <div class="input-group-addon col-md-1 interval-to pull-left">to</div>\n									<fieldset ng-disabled="splittedInterval.alwaysTime"><uib-timepicker  name="t_to" data-ng-model="splittedInterval.t_to" show-meridian="false" show-spinners="false"></uib-timepicker></fieldset>\n									<label class="control-label pointer-cursor"><input type="checkbox" data-ng-model="splittedInterval.alwaysTime">{{\'APPLICATION_ALWAYS\' | translate}}</label>\n                </div>\n              </div>\n              <!-- END TIME -->\n\n              <!-- START WEEKDAY -->\n              <div class="form-group">\n                <label class="control-label">{{ \'APPLICATION_WEEKDAY\' | translate }}</label>\n                <div class="input-group input-large">\n                  <ui-select data-ng-model="splittedInterval.wd_from" theme="bootstrap" name="wd_from">\n                    <ui-select-match placeholder="">{{$translate.instant($select.selected.name)}}</ui-select-match>\n                    <ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n                      {{$translate.instant(weekDay.name)}}\n                    </ui-select-choices>\n                  </ui-select>\n                  <span class="input-group-addon">to</span>\n                  <ui-select data-ng-model="splittedInterval.wd_to" theme="bootstrap" name="wd_to">\n                    <ui-select-match placeholder="">{{$translate.instant($select.selected.name)}}</ui-select-match>\n                    <ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n                      {{$translate.instant(weekDay.name)}}\n                    </ui-select-choices>\n                  </ui-select>\n                </div>\n              </div>\n              <!-- END WEEKDAY -->\n\n              <!-- START MONTHDAY -->\n              <div class="form-group">\n                <label class="control-label">{{ \'APPLICATION_MONTHDAY\' | translate }}</label>\n                <div class="input-group input-large">\n                  <ui-select data-ng-model="splittedInterval.md_from" theme="bootstrap" name="md_from">\n                    <ui-select-match>{{$select.selected}}</ui-select-match>\n                    <ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n                      {{monthDay}}\n                    </ui-select-choices>\n                  </ui-select>\n                  <span class="input-group-addon">to</span>\n                  <ui-select data-ng-model="splittedInterval.md_to" theme="bootstrap" name="md_to">\n                    <ui-select-match>{{$select.selected}}</ui-select-match>\n                    <ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n                      {{monthDay}}\n                    </ui-select-choices>\n                  </ui-select>\n                </div>\n              </div>\n              <!-- END MONTHDAY -->\n\n              <!-- START MONTH -->\n              <div class="form-group">\n                <label class="control-label">{{ \'APPLICATION_MONTH\' | translate }}</label>\n                <div class="input-group input-large">\n                  <ui-select data-ng-model="splittedInterval.m_from" theme="bootstrap" name="m_from">\n                    <ui-select-match placeholder="">{{$translate.instant($select.selected.name)}}</ui-select-match>\n                    <ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n                      {{$translate.instant(month.name)}}\n                    </ui-select-choices>\n                  </ui-select>\n                  <span class="input-group-addon">to</span>\n                  <ui-select data-ng-model="splittedInterval.m_to" theme="bootstrap" name="m_to">\n                    <ui-select-match placeholder="">{{$translate.instant($select.selected.name)}}</ui-select-match>\n                    <ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n                      {{$translate.instant(month.name)}}\n                    </ui-select-choices>\n                  </ui-select>\n                </div>\n              </div>\n              <!-- END MONTH -->\n\n\n\n							<button class="btn green-haze" type="submit" ng-click="next()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n            </form>\n          </wz-step>\n\n\n						<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n							<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n							<button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n							<input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n						</wz-step>\n				</wizard>\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/tools/interval/view/view.subintervalSettings.html",'\n<div class="row" data-ng-init="initSubInterval();getSubInterval();">\n	<div class="col-md-12">\n		<!-- BEGIN  PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-notebook font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_SUBINTERVAL_SETTINGS\' | translate }} WIZARD</a> </span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<wizard on-finish="updateInterval(\'subintervals\')">\n					<div class="profile-usertitle-name">\n						{{subinterval.name}}\n					</div>\n          <wz-step title="{{\'APPLICATION_SETTINGS\' | translate}}" canexit="exitValidation(forms.subinterval.name.$valid)">\n            <form name="forms.subinterval" novalidate>\n\n              <!-- START NAME -->\n              <div class="form-group" data-ng-class="{\'has-error\': (forms.subinterval.name.$touched || forms.subinterval.$submitted) && forms.subinterval.name.$invalid}">\n                <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n                <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="interval.SubIntervals[selectedSubInterval].name" required/>\n                <span data-ng-show="(forms.subinterval.name.$touched || forms.subinterval.$submitted) && forms.subinterval.name.$error.required" class="help-block help-block-error">\n                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                </span>\n              </div>\n              <!-- END NAME -->\n\n              <!-- START TIME -->\n              <div class="form-group">\n                <label class="control-label">{{ \'APPLICATION_TIME\' | translate }}</label>\n                <div class="input-group input-large">\n									<fieldset class="pull-left" ng-disabled="splittedInterval.alwaysTime"><uib-timepicker name="t_from" data-ng-model="splittedInterval.t_from" show-meridian="false" show-spinners="false"></uib-timepicker></fieldset>\n                  <div class="input-group-addon col-md-1 interval-to pull-left">to</div>\n									<fieldset ng-disabled="splittedInterval.alwaysTime"><uib-timepicker  name="t_to" data-ng-model="splittedInterval.t_to" show-meridian="false" show-spinners="false"></uib-timepicker></fieldset>\n									<label class="control-label pointer-cursor"><input type="checkbox" data-ng-model="splittedInterval.alwaysTime">{{\'APPLICATION_ALWAYS\' | translate}}</label>\n                </div>\n              </div>\n              <!-- END TIME -->\n\n              <!-- START WEEKDAY -->\n              <div class="form-group">\n                <label class="control-label">{{ \'APPLICATION_WEEKDAY\' | translate }}</label>\n                <div class="input-group input-large">\n                  <ui-select data-ng-model="splittedInterval.wd_from" theme="bootstrap" name="wd_from">\n                    <ui-select-match placeholder="">{{$translate.instant($select.selected.name)}}</ui-select-match>\n                    <ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n                      {{$translate.instant(weekDay.name)}}\n                    </ui-select-choices>\n                  </ui-select>\n                  <span class="input-group-addon">to</span>\n                  <ui-select data-ng-model="splittedInterval.wd_to" theme="bootstrap" name="wd_to">\n                    <ui-select-match placeholder="">{{$translate.instant($select.selected.name)}}</ui-select-match>\n                    <ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n                      {{$translate.instant(weekDay.name)}}\n                    </ui-select-choices>\n                  </ui-select>\n                </div>\n              </div>\n              <!-- END WEEKDAY -->\n\n              <!-- START MONTHDAY -->\n              <div class="form-group">\n                <label class="control-label">{{ \'APPLICATION_MONTHDAY\' | translate }}</label>\n                <div class="input-group input-large">\n                  <ui-select data-ng-model="splittedInterval.md_from" theme="bootstrap" name="md_from">\n                    <ui-select-match>{{$select.selected}}</ui-select-match>\n                    <ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n                      {{monthDay}}\n                    </ui-select-choices>\n                  </ui-select>\n                  <span class="input-group-addon">to</span>\n                  <ui-select data-ng-model="splittedInterval.md_to" theme="bootstrap" name="md_to">\n                    <ui-select-match>{{$select.selected}}</ui-select-match>\n                    <ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n                      {{monthDay}}\n                    </ui-select-choices>\n                  </ui-select>\n                </div>\n              </div>\n              <!-- END MONTHDAY -->\n\n              <!-- START MONTH -->\n              <div class="form-group">\n                <label class="control-label">{{ \'APPLICATION_MONTH\' | translate }}</label>\n                <div class="input-group input-large">\n                  <ui-select data-ng-model="splittedInterval.m_from" theme="bootstrap" name="m_from">\n                    <ui-select-match placeholder="">{{$translate.instant($select.selected.name)}}</ui-select-match>\n                    <ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n                      {{$translate.instant(month.name)}}\n                    </ui-select-choices>\n                  </ui-select>\n                  <span class="input-group-addon">to</span>\n                  <ui-select data-ng-model="splittedInterval.m_to" theme="bootstrap" name="m_to">\n                    <ui-select-match placeholder="">{{$translate.instant($select.selected.name)}}</ui-select-match>\n                    <ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n                      {{$translate.instant(month.name)}}\n                    </ui-select-choices>\n                  </ui-select>\n                </div>\n              </div>\n              <!-- END MONTH -->\n\n\n\n							<button class="btn green-haze" type="submit" ng-click="next()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n            </form>\n          </wz-step>\n\n\n						<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n							<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n							<button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n							<input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n						</wz-step>\n				</wizard>\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/tools/interval/view/view.subintervals.html",'<div ui-view class="profile-content">\n<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title  tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_SUBINTERVALS\' | translate}}</span>\n				</div>\n				<div class="actions">\n					<div class="btn-group">\n						<a class="btn green-jungle " href="/tools/intervals/view/{{interval.id}}/subinterval" data-toggle="dropdown">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_SUBINTERVAL\' | translate }}\n						</a>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div data-ng-if="selectedSubInterval === undefined" ui-grid="gridOptions"  ui-grid-resize-columns class="grid" ui-grid-draggable-rows>\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n	</div>\n</div>\n</div>\n'),a.put("app/tools/pause/list/list.create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_PAUSE\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.name.$touched || form.$submitted) && form.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n      <span data-ng-show="(form.name.$touched || form.$submitted) && form.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n    </div>\n    <!-- END DESCRIPTION -->\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="save()" ng-disabled="form.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/tools/pause/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-wrench"></i>\n					<a href="#">{{ \'APPLICATION_TOOLS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-control-pause"></i>\n					<a href="#">{{ \'APPLICATION_PAUSES\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-control-pause font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_PAUSES\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<a class="btn green-jungle" href="#" data-toggle="dropdown" data-ng-click="createItem()">\n						<i class="icon-plus"></i> {{ \'APPLICATION_NEW_PAUSE\' | translate }}\n					</a>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n						<div class="watermark" ng-show="!gridOptions.data.length">{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/tools/pause/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getPause()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-wrench"></i>\n					<a href="#">{{ \'APPLICATION_TOOLS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-pause"></i>\n					<a href="/tools/pauses/list">{{ \'APPLICATION_PAUSES\' | translate }}</a>\n					<i data-ng-show="pause" class="fa fa-angle-right"></i>\n				</li>\n				<li data-ng-show="pause">\n					<a href="#">{{pause.name}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/pause.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{pause.name}}\n					</div>\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.tools.pauses.view.settings\')}">\n							<a data-ng-href="/tools/pauses/view/{{pause.id}}/settings">\n								<i class="icon-settings"></i>\n								{{ \'APPLICATION_SETTINGS\' | translate}}\n							</a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/tools/pause/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_PAUSE\' | translate}} {{ \'APPLICATION_SETTINGS\' | translate}} </span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_GENERAL\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.general" data-ng-submit="forms.general.$valid && updatePause()" novalidate>\n\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="pause.name" required/>\n								<span data-ng-show="(forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="pause.description"></textarea>\n							</div>\n							<!-- END DESCRIPTION -->\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END ADVANCED TAB -->\n\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/tools/sound/list/list.html",'<div class="page-bar">\n  <ul class="page-breadcrumb">\n    <li>\n      <i class="icon-rocket"></i>\n      <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n      <i class="fa fa-angle-right"></i>\n    </li>\n    <li>\n      <i class="icon-music-tone-alt"></i>\n      <a href="#">{{ \'APPLICATION_SOUNDS\' | translate }}</a>\n    </li>\n  </ul>\n  <div class="page-toolbar">\n  </div>\n</div>\n<!-- END PAGE HEADER-->\n<!-- BEGIN PAGE CONTENT-->\n<!-- Audio Portlets -->\n<div class="headline">\n  <h3><i class="icon-music-tone-alt sounds-title-icon"></i> {{ \'APPLICATION_SOUNDS\' | translate }}</h3>\n</div>\n<div class="portlet light bg-inverse">\n  <div class="portlet-title collapsible" ng-click="isCollapsed = !isCollapsed">\n    <div class="caption">\n      <i class="icon-puzzle font-red-flamingo"></i>\n      <span class="caption-subject bold font-red-flamingo uppercase">\n      {{\'APPLICATION_FILE_UPLOAD\' | translate}} </span>\n    </div>\n    <div class="tools">\n      <a href="" ng-class="{\'collapse\': !isCollapsed, \'expand\' : isCollapsed}">\n      </a>\n    </div>\n  </div>\n  <div class="portlet-body" ng-slide-down="!isCollapsed">\n    <div class="row" nv-file-drop="" uploader="uploader" filters="queueLimit, customFilter">\n    	<div class="col-md-4">\n    		<div class="portlet light bordered">\n    			<div class="portlet-title">\n    				<div class="caption font-green-sharp">\n    					<i class="icon-settings font-green-sharp"></i>\n    					<span class="caption-subject bold uppercase">{{\'APPLICATION_SELECT_FILES\' | translate}}</span>\n    					<span class="caption-helper hide"></span>\n    				</div>\n    				<div class="actions">\n    				</div>\n    			</div>\n    			<div class="portlet-body">\n    				<div ng-show="uploader.isHTML5">\n    					<div class="file-drop-zone margin-bottom-20" nv-file-over="" uploader="uploader" over-class="file-drop-zone-over">\n    						Base drop zone\n    					</div>\n    				</div>\n    				<span class="btn default btn-file">\n    				<span class="fileinput-new">\n    				{{\'APPLICATION_FILE_UPLOAD\' | translate}}</span>\n    				<input type="file" nv-file-select="" uploader="uploader" />\n    				</span>\n    				<span class="btn default btn-file">\n    				<span class="fileinput-new">\n    				{{\'APPLICATION_MULTI_FILE_UPLOAD\' | translate}}</span>\n    				<input type="file" nv-file-select="" uploader="uploader" multiple  /><br/>\n          </span>\n          <p>\n            </br>\n            {{ \'MESSAGE_SUPPORTED_FORMATS\' | translate }} <b>wav, mp3, gsm, ogg</b>.\n          </p>\n          <p>\n            {{ \'MESSAGE_MAXIMUM_SOUND_UPLOAD_SIZE\' | translate }} <b>15 Mb</b>.\n          </p>\n    			</div>\n    		</div>\n    	</div>\n    	<div class="col-md-8">\n    		<div class="portlet light bordered">\n    			<div class="portlet-title">\n    				<div class="caption font-green-sharp">\n    					<i class="icon-settings font-green-sharp"></i>\n    					<span class="caption-subject bold uppercase">{{\'APPLICATION_UPLOAD_QUEUE\' | translate}}</span>\n    					<span class="caption-helper">{{\'APPLICATION_QUEUE_LENGTH\' | translate}}: {{ uploader.queue.length }}</span>\n    				</div>\n    				<div class="actions">\n    				</div>\n    			</div>\n    			<div class="portlet-body">\n    				<div class="table-scrollable table-scrollable-borderless">\n    					<table class="table table-hover table-light">\n    						<thead>\n    							<tr class="uppercase">\n    								<th width="50%">{{\'APPLICATION_NAME\' | translate}}</th>\n    								<th ng-show="uploader.isHTML5">{{\'APPLICATION_SIZE\' | translate}}</th>\n    								<th ng-show="uploader.isHTML5">{{\'APPLICATION_PROGRESS\' | translate}}</th>\n    								<th>{{\'APPLICATION_STATUS\' | translate}}</th>\n    								<th>{{\'APPLICATION_MESSAGE\' | translate}}</th>\n    								<th>{{\'APPLICATION_ACTIONS\' | translate}}</th>\n    							</tr>\n    						</thead>\n    						<tbody>\n    							<tr ng-repeat="item in uploader.queue">\n    								<td><strong>{{ item.file.name }}</strong></td>\n    								<td ng-show="uploader.isHTML5" nowrap>{{ item.file.size/1024/1024|number:2 }} MB</td>\n    								<td ng-show="uploader.isHTML5">\n    									<div class="progress progress-sm" style="margin-bottom: 0;">\n    										<div class="progress-bar progress-bar-info" role="progressbar" ng-style="{ \'width\': item.progress + \'%\' }"></div>\n    									</div>\n    								</td>\n    								<td class="text-center">\n    									<span ng-show="item.isSuccess" class="text-success"><i class="glyphicon glyphicon-ok"></i></span>\n    									<span ng-show="item.isCancel" class="text-info"><i class="glyphicon glyphicon-ban-circle"></i></span>\n    									<span ng-show="item.isError" class="text-danger"><i class="glyphicon glyphicon-remove"></i></span>\n    									<span ng-show="item.isUploading" class="text-info"><i class="glyphicon glyphicon-upload"></i></span>\n    								</td>\n    								<td class="text-center">\n    									<span ng-show="item.responseMessage" class="text-danger">{{item.responseMessage}}</span>\n    								</td>\n    								<td nowrap>\n    									<button type="button" class="btn btn-success btn-xs" ng-click="item.upload()" ng-disabled="item.isReady || item.isUploading || item.isSuccess">\n    									<span class="glyphicon glyphicon-upload"></span> {{\'APPLICATION_UPLOAD\' | translate}}\n    									</button>\n    									<button type="button" class="btn btn-warning btn-xs" ng-click="item.cancel()" ng-disabled="!item.isUploading">\n    									<span class="glyphicon glyphicon-ban-circle"></span> {{\'APPLICATION_CANCEL\' | translate}}\n    									</button>\n    									<button type="button" class="btn btn-danger btn-xs" ng-click="item.remove()">\n    									<span class="glyphicon glyphicon-trash"></span> {{\'APPLICATION_REMOVE\' | translate}}\n    									</button>\n    								</td>\n    							</tr>\n    						</tbody>\n    					</table>\n    				</div>\n    				<div>\n    					<p>{{\'APPLICATION_UPLOAD_QUEUE_PROGRESS\' | translate}}:</p>\n    					<div class="progress progress-sm" style="">\n    						<div class="progress-bar progress-bar-info" role="progressbar" ng-style="{ \'width\': uploader.progress + \'%\' }"></div>\n    					</div>\n    				</div>\n    				<button type="button" class="btn btn-success btn-s" ng-click="uploader.uploadAll()" ng-disabled="!uploader.getNotUploadedItems().length">\n    				<span class="glyphicon glyphicon-upload"></span> {{\'APPLICATION_UPLOAD_ALL\' | translate}}\n    				</button>\n    				<button type="button" class="btn btn-warning btn-s" ng-click="uploader.cancelAll()" ng-disabled="!uploader.isUploading">\n    				<span class="glyphicon glyphicon-ban-circle"></span> {{\'APPLICATION_CANCEL_ALL\' | translate}}\n    				</button>\n    				<button type="button" class="btn btn-danger btn-s" ng-click="uploader.clearQueue()" ng-disabled="!uploader.queue.length">\n    				<span class="glyphicon glyphicon-trash"></span> {{\'APPLICATION_REMOVE_ALL\' | translate}}\n    				</button>\n    			</div>\n    		</div>\n    	</div>\n    </div>\n  </div>\n</div>\n<div class="row thumbnails" data-ng-init="initList()">\n  <div class="row" ng-show="sounds.length == 0">\n    <div class="col-md-12 page-404">\n      <div class="details">\n        <h3>{{ \'MESSAGE_NO_SOUNDS\' | translate }}</h3>\n        <p>\n          <a href="/">\n          {{ \'MESSAGE_RETURN_HOME\' | translate }} </a>\n          {{ \'MESSAGE_OR_UPLOAD_SOUND_FILE\' | translate }}\n        </p>\n      </div>\n    </div>\n  </div>\n  <div class="audio-portlet-wrapper animate-repeat" ng-repeat="sound in sounds">\n    <div class="audio-portlet">\n      <div class="audio-portlet-title"><a href="#" editable-text="sound.display_name" onbeforesave="updateAudio(sound.id,{display_name : $data})">{{ sound.display_name || "Empty" }}</a></div>\n      <img src="../assets/images/note_placeholder.png" alt="" class="img-responsive"/>\n      <div class="file-info">\n        <div class="audio-tag-wrapper">\n          <audio-file-download params="{id:sound.id,controller:\'stream\'}" resource="Sound"></audio-file-download>\n        </div>\n        <p id="description_div">\n          <a href="#" editable-text="sound.description" onbeforesave="updateAudio(sound.id,{description : $data})">{{ sound.description || "Empty" }}</a>\n        </p>\n        <p class="float-right">\n            <button class="btn btn-xs green-meadow" uib-tooltip-template="\'audioInfoTemplate.html\'"><i class="icon-list"></i></button>\n            <motion-file-download  params="{id:sound.id,controller:\'download\'}" resource="Sound" mimetype="\'audio/\'+sound.original_format" tooltiptext="Download" filename="sound.name+\'.\'+sound.original_format" btnclass="{{downloadButtonClass}}" btncontent=\'{{downloadButtonContent}}\'></motion-file-download>\n            <button uib-tooltip="Delete" class="btn btn-xs red-sunglo" ng-click="delete(sound.display_name, sound.id)" tooltip="Delete"><i class="icon-close" ></i></button>\n        </p>\n      </div>\n    </div>\n  </div>\n  <script type="text/ng-template" id="audioInfoTemplate.html">\n    <div>\n      <ul class="list-unstyled">\n        <li><b>Format : </b>{{sound.original_format}}</li>\n        <li><b>Duration : </b>{{sound.original_duration | date: \'mm:ss\'}}</li>\n        <li><b>Channels : </b>{{sound.original_channelCount}}</li>\n        <li><b>Bitrate : </b>{{sound.original_bitRate/1024}} kbs</li>\n        <li><b>Sample Rate : </b>{{sound.original_sampleRate/1000}} KHz</li>\n      </ul>\n    </div>\n  </script>\n</div>\n<!-- End Audio Portlets -->\n'),
-a.put("app/tools/tag/list/list.create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_TAG\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.name.$touched || form.$submitted) && form.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n      <span data-ng-show="(form.name.$touched || form.$submitted) && form.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n    </div>\n    <!-- END DESCRIPTION -->\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="save()" ng-disabled="form.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/tools/tag/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-wrench"></i>\n					<a href="#">{{ \'APPLICATION_TOOLS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-tag"></i>\n					<a href="#">{{ \'APPLICATION_TAGS\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-docs font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_TAGS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<button class="btn green-jungle " ng-click="createItem()">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_TAG\' | translate }}\n						</button>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/tools/tag/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getTag()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-wrench"></i>\n					<a href="#">{{ \'APPLICATION_TOOLS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-tag"></i>\n					<a href="/tools/tags/list">{{ \'APPLICATION_TAGS\' | translate }}</a>\n					<i data-ng-show="tag" class="fa fa-angle-right"></i>\n				</li>\n				<li data-ng-show="tag">\n					<a href="#">{{tag.name}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/tag.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{tag.name}}\n					</div>\n					<!-- <div class="profile-usertitle-job">\n						{{user.role}}\n					</div> -->\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.tools.tags.view.settings\')}">\n							<a data-ng-href="/tools/tags/view/{{tag.id}}/settings">\n							<i class="icon-settings"></i>\n							{{ \'APPLICATION_SETTINGS\' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/tools/tag/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_TAG\' | translate}} {{ \'APPLICATION_SETTINGS\' | translate}} </span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_GENERAL\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.general" data-ng-submit="forms.general.$valid && updateTag()" novalidate>\n\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="tag.name" required/>\n								<span data-ng-show="(forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="tag.description"></textarea>\n							</div>\n							<!-- END DESCRIPTION -->\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END ADVANCED TAB -->\n\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/tools/template/list/list.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-wrench"></i>\n					<a href="#">{{ \'APPLICATION_TOOLS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-docs"></i>\n					<a href="#">{{ \'APPLICATION_TEMPLATES\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n	</div>\n</div>\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-wrench font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_TEMPLATES\' | translate }}</span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<a class="btn green-jungle" href="/tools/templates/wizard">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_TEMPLATE\' | translate }}\n						</a>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/tools/template/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initItem()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-docs"></i>\n					<a href="/mail/templates/list">{{ \'APPLICATION_TEMPLATES\' | translate }}</a>\n					<i data-ng-show="item" class="fa fa-angle-right"></i>\n				</li>\n				<li data-ng-show="item">\n					<a href="#">{{item.name}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/template.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{item.name}}\n					</div>\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.tools.templates.view.settings\')}">\n							<a data-ng-href="/tools/templates/view/{{item.id}}/settings">\n								<i class="icon-settings"></i>\n								{{ \'APPLICATION_SETTINGS\' | translate}}\n							</a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/tools/template/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_SETTINGS\' | translate}}</span>\n				</div>\n			</div>\n			<div class="portlet-body">\n\n				<form name="form" data-ng-submit="form.$valid && updateItem()" class="form-horizontal" novalidate>\n					<!-- START NAME -->\n					<div class="form-group" data-ng-class="{\'has-error\': form.name.$invalid && form.$submitted}">\n						<div class="col-md-12">\n							<div class="row">\n								<div class="col-md-1">\n									<label class="control-label">{{\'APPLICATION_NAME\' | translate}}:<span class="required" aria-required="true">*</span></label>\n								</div>\n								<div class="col-md-11">\n									<input type="text" name="name" class="form-control todo-taskbody-taskdesc" placeholder="{{\'APPLICATION_NAME\' | translate}}..." data-ng-model="item.name" required>\n									<span data-ng-show="form.name.$invalid && form.$submitted" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n							</div>\n						</div>\n					</div>\n					<!-- END NAME -->\n\n					<!-- START DESCRIPTION -->\n					<div class="form-group" data-ng-class="{\'has-error\': form.description.$invalid && form.$submitted}">\n						<div class="col-md-12">\n							<div class="row">\n								<div class="col-md-1">\n									<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}:</label>\n								</div>\n								<div class="col-md-11">\n									<input type="text" name="description" class="form-control todo-taskbody-taskdesc" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}..." rows="8" data-ng-model="item.description">\n									<span data-ng-show="form.description.$invalid && form.$submitted" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n							</div>\n						</div>\n					</div>\n					<!-- END NAME -->\n\n					<hr>\n\n					<!-- START SUBJECT -->\n					<div class="form-group row" data-ng-class="{\'has-error\': form.subject.$invalid && form.$submitted}">\n						<div class="col-md-12">\n							<div class="row">\n								<div class="col-md-4">\n									<label class="control-label pull-right">{{\'APPLICATION_SUBJECT\' | translate}}:</label>\n								</div>\n								<div class="col-md-8">\n									<input type="text" name="subject" class="form-control todo-taskbody-taskdesc" placeholder="{{\'APPLICATION_SUBJECT\' | translate}}..." rows="8" data-ng-model="item.subject">\n									<span data-ng-show="form.subject.$invalid && form.$submitted" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n							</div>\n						</div>\n					</div>\n					<!-- END SUJBECT -->\n\n					<!-- START HTML -->\n					<div class="form-group row" data-ng-class="{\'has-error\': form.text.$invalid && form.$submitted}">\n\n						<div class="col-md-4">\n							<div class="portlet light bordered">\n								<div class="portlet-title">\n									<div class="caption font-green-sharp">\n										<i class="icon-pencil"></i>{{\'APPLICATION_VARIABLES\' | translate}}\n									</div>\n								</div>\n								<div class="portlet-body">\n									<uib-accordion>\n								    <uib-accordion-group heading="{{group.title | translate}}" data-ng-repeat="group in groups">\n								      {{group.content | translate}}\n											<ol>\n												<li data-ng-repeat="variable in group.variables">\n													 {{variable}}\n												</li>\n											</ol>\n								    </uib-accordion-group>\n								  </uib-accordion>\n								</div>\n							</div>\n						</div>\n						<div class="col-md-8">\n							<div class="inbox-editor inbox-wysihtml5" text-angular data-ng-model="item.html" name="html"></div>\n								<span data-ng-show="form.text.$invalid && form.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n						</div>\n					</div>\n					<!-- END HTML -->\n\n					<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n				</form>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/tools/template/wizard/wizard.html",'<div class="col-md-12">\n  <!-- BEGIN PAGE HEADER-->\n	<div class="page-bar">\n		<ul class="page-breadcrumb">\n			<li>\n				<i class="icon-rocket"></i>\n				<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n				<i class="fa fa-angle-right"></i>\n			</li>\n			<li>\n				<i class="icon-wrench"></i>\n				<a href="#">{{ \'APPLICATION_TOOLS\' | translate }}</a>\n				<i class="fa fa-angle-right"></i>\n			</li>\n			<li>\n				<i class="icon-docs"></i>\n				<a href="/tools/templates/list">{{ \'APPLICATION_TEMPLATES\' | translate }}</a>\n			</li>\n		</ul>\n	</div>\n  <!-- END PAGE HEADER-->\n\n  <!-- BEGIN PORTLET-->\n  <div class="portlet light bordered" data-ng-init="initWizard()">\n  	<div class="portlet-title">\n  		<div class="caption font-green-sharp">\n  			<i class="icon-docs font-green-sharp"></i>\n  			<span class="caption-subject">{{ \'APPLICATION_TEMPLATES\' | translate }} FORM</a> </span>\n  		</div>\n  	</div>\n  	<div class="portlet-body">\n			<form name="form" data-ng-submit="form.$valid && createItem()" class="form-horizontal" novalidate>\n				<!-- START HEAD -->\n				<div class="form">\n					<!-- START NAME -->\n					<div class="form-group" data-ng-class="{\'has-error\': form.name.$invalid && form.$submitted}">\n						<div class="col-md-12">\n							<div class="row">\n								<div class="col-md-1">\n									<label class="control-label">{{\'APPLICATION_NAME\' | translate}}:<span class="required" aria-required="true">*</span></label>\n								</div>\n								<div class="col-md-11">\n									<input type="text" name="name" class="form-control todo-taskbody-taskdesc" placeholder="{{\'APPLICATION_NAME\' | translate}}..." data-ng-model="item.name" required>\n									<span data-ng-show="form.name.$invalid && form.$submitted" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n							</div>\n						</div>\n					</div>\n					<!-- END NAME -->\n\n					<!-- START DESCRIPTION -->\n					<div class="form-group" data-ng-class="{\'has-error\': form.description.$invalid && form.$submitted}">\n						<div class="col-md-12">\n							<div class="row">\n								<div class="col-md-1">\n									<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}:</label>\n								</div>\n								<div class="col-md-11">\n									<input type="text" name="description" class="form-control todo-taskbody-taskdesc" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}..." rows="8" data-ng-model="item.description">\n									<span data-ng-show="form.description.$invalid && form.$submitted" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n							</div>\n						</div>\n					</div>\n					<!-- END NAME -->\n\n					<!-- START SUBJECT -->\n					<div class="form-group" data-ng-class="{\'has-error\': form.subject.$invalid && form.$submitted}">\n						<div class="col-md-12">\n							<div class="row">\n								<div class="col-md-1">\n									<label class="control-label">{{\'APPLICATION_SUBJECT\' | translate}}:</label>\n								</div>\n								<div class="col-md-11">\n									<input type="text" name="subject" class="form-control todo-taskbody-taskdesc" placeholder="{{\'APPLICATION_SUBJECT\' | translate}}..." rows="8" data-ng-model="item.subject">\n									<span data-ng-show="form.subject.$invalid && form.$submitted" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n							</div>\n						</div>\n					</div>\n					<!-- END SUJBECT -->\n\n					<!-- START HTML -->\n					<div class="form-group row" data-ng-class="{\'has-error\': form.text.$invalid && form.$submitted}">\n						<div class="col-md-4">\n							<div class="portlet light bordered">\n								<div class="portlet-title">\n									<div class="caption font-green-sharp">\n										<i class="icon-pencil"></i>{{\'APPLICATION_VARIABLES\' | translate}}\n									</div>\n								</div>\n								<div class="portlet-body">\n									<uib-accordion>\n								    <uib-accordion-group heading="{{group.title | translate}}" data-ng-repeat="group in groups">\n								      {{group.content | translate}}\n											<ol>\n												<li data-ng-repeat="variable in group.variables">\n													 {{variable}}\n												</li>\n											</ol>\n								    </uib-accordion-group>\n								  </uib-accordion>\n								</div>\n							</div>\n						</div>\n						<div class="col-md-8">\n							<div class="inbox-editor inbox-wysihtml5" text-angular data-ng-model="item.html" name="html"></div>\n								<span data-ng-show="form.text.$invalid && form.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n						</div>\n					</div>\n					<!-- END HTML -->\n\n				</div>\n				<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" data-ng-click="goNext()"/>\n			</form>\n  	</div>\n  </div>\n  <!-- END PORTLET-->\n</div>\n'),a.put("app/tools/trigger/list/list.html",'<div class="row">\n	<div class="col-md-12">\n			<div class="page-bar">\n				<ul class="page-breadcrumb">\n					<li>\n						<i class="icon-rocket"></i>\n						<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-wrench"></i>\n						<a href="#">{{ \'APPLICATION_TOOLS\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-bulb"></i>\n						<a href="#">{{ \'APPLICATION_TRIGGERS\' | translate }}</a>\n					</li>\n				</ul>\n			</div>\n		</div>\n</div>\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-bulb font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_TRIGGERS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<a class="btn green-jungle " href="/tools/triggers/wizard">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_TRIGGER\' | translate }}\n						</a>\n					</div>\n					<!-- <a class="btn btn-icon-only btn-default fullscreen" href="#"></a> -->\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/tools/trigger/view/view.html",'<!-- BEGIN PAGE HEADER-->\n<div class="row" data-ng-init="initView();">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-bulb"></i>\n					<a href="/tools/triggers/list">{{ \'APPLICATION_TRIGGERS\' | translate }}</a>\n					<i class="fa fa-angle-right" data-ng-show="trigger"></i>\n				</li>\n				<li data-ng-show="trigger">\n					<a href="#">{{ trigger.description || trigger.name }}</a>\n				</li>\n			</ul>\n		</div>\n\n<!-- END PAGE HEADER-->\n\n<!-- BEGIN PAGE CONTENT-->\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/trigger.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{ trigger.name }}\n					</div>\n					<div class="profile-usertitle-job">\n						{{ trigger.description }}\n					</div>\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.tools.triggers.view.settings\')}">\n							<a href="/tools/triggers/view/{{trigger.id}}/settings">\n							<i class="icon-bulb"></i>\n							{{ \'APPLICATION_SETTINGS\' | translate }} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/tools/trigger/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_SETTINGS\' | translate}}</span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{\'APPLICATION_GENERALS\' | translate}}</a>\n					</li>\n					<li>\n						<a href="#" data-target="#tab_1_2" data-toggle="tab">{{\'APPLICATION_CONDITIONS\' | translate}} & {{\'APPLICATION_ACTIONS\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n			<div class="portlet-body">\n				<!-- <pre>\n					{{conditionsData.query | json}}\n				</pre>\n				<pre>\n					{{actionsData.query | json}}\n				</pre> -->\n				<form name="forms.general" data-ng-submit="exitValidation(forms.general.$valid) && updateTrigger()" novalidate>\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="trigger.name" required/>\n								<span data-ng-show="(forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid && forms.general.name.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<!-- START STATUS -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_STATUS\' | translate}}</label></br>\n								<input\n								bs-switch\n								class="form-control"\n								ng-model="trigger.status"\n								type="checkbox"\n								name="status"\n								switch-active="{{ recordSwitch.isActive }}"\n								switch-on-text="{{ recordSwitch.onText }}"\n								switch-off-text="{{ recordSwitch.offText }}"\n								switch-on-color="{{ recordSwitch.onColor }}"\n								switch-off-color="{{ recordSwitch.offColor }}"\n								switch-animate="{{ recordSwitch.animate }}"\n								switch-size="{{ recordSwitch.size }}"\n								switch-label="{{ recordSwitch.label }}"\n								switch-icon="{{ recordSwitch.icon }}"\n								switch-radio-off="{{ recordSwitch.radioOff }}"\n								switch-label-width="{{ recordSwitch.labelWidth }}"\n								switch-handle-width="{{ recordSwitch.handleWidth }}">\n							</div>\n							<!-- END STATUS -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="trigger.description"/>\n							</div>\n							<!-- END DESCRIPTION -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n					</div>\n					<!-- END GENERAL TAB -->\n					<div class="tab-pane" id="tab_1_2">\n						<div class="portlet light bordered">\n							<div class="portlet-title">\n								<div class="caption font-blue-hoki">\n									<i class="icon-tag font-blue-hoki"></i>\n									<span class="caption-subject" ng-bind-html="\'APPLICATION_MEET_ALL_CONDITIONS\' | translate"></span>:\n								</div>\n							</div>\n							<div class="portlet-body">\n								<div class="padding-bottom row" ng-repeat="all in trigger.All">\n									<condition-builder element="all" serviceindex="trigger.channel" service="$triggers" form="forms.general"></condition-builder>\n									<button type="button" ng-click="removeCondition(\'All\',$index)" class="btn btn-danger remove-condition col-md-1 left-margin"><span class="glyphicon glyphicon-minus-sign"></span></button>\n								</div>\n								<button type="button" class="btn btn-sm green padding-bottom" data-ng-click="addCondition(\'All\')">\n									<i class="fa fa-plus"></i> {{\'APPLICATION_ADD_CONDITION\' | translate}}\n								</button>\n							</div>\n						</div>\n						<div class="portlet light bordered">\n							<div class="portlet-title">\n								<div class="caption font-blue-hoki">\n									<i class="icon-tag font-blue-hoki"></i>\n									<span class="caption-subject" ng-bind-html="\'APPLICATION_MEET_ANY_CONDITIONS\' | translate"></span>:\n								</div>\n							</div>\n							<div class="portlet-body">\n								<div class="padding-bottom row" ng-repeat="any in trigger.Any">\n									<condition-builder element="any" serviceindex="trigger.channel" service="$triggers" form="forms.general"></condition-builder>\n									<button type="button" ng-click="removeCondition(\'Any\',$index)" class="btn btn-danger remove-condition col-md-1 left-margin"><span class="glyphicon glyphicon-minus-sign"></span></button>\n								</div>\n								<button type="button" class="btn btn-sm green padding-bottom" data-ng-click="addCondition(\'Any\')">\n									<i class="fa fa-plus"></i> {{\'APPLICATION_ADD_CONDITION\' | translate}}\n								</button>\n							</div>\n						</div>\n						<div class="portlet light bordered">\n							<div class="portlet-title">\n								<div class="caption font-blue-hoki">\n									<i class="icon-tag font-blue-hoki"></i>\n									<span class="caption-subject">{{ \'APPLICATION_ACTIONS\' | translate }}</span>:\n								</div>\n							</div>\n							<div class="portlet-body">\n								<div class="padding-bottom row" ng-repeat="action in trigger.Actions">\n									<div class="form-group col-md-2" data-ng-class="{\'has-error\': (forms.general[\'action\'+$index].$touched || forms.general.$submitted) && forms.general[\'action\'+$index].$invalid}">\n										<ui-select data-ng-model="action.action" theme="bootstrap" data-ng-change="resetActionData(action)" name="action{{$index}}" required>\n											<ui-select-match placeholder="{{ \'APPLICATION_ACTION\' | translate }}">{{$select.selected.name | translate}}</ui-select-match>\n											<ui-select-choices repeat="tAction.value as tAction in $triggers.services[trigger.channel].actions | filter: $select.search">\n												<div ng-bind-html="tAction.name | translate | highlight: $select.search"></div>\n											</ui-select-choices>\n										</ui-select>\n										<span data-ng-show="(forms.general[\'action\'+$index].$touched || forms.general.$submitted) && forms.general[\'action\'+$index].$error.required" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<div ng-switch="action.action">\n										<action-builder-template ng-switch-when="template" element="action" form="forms.general"></action-builder-template>\n										<action-builder-integration ng-switch-when="integration" element="action" form="forms.general"></action-builder-integration>\n									</div>\n									<button type="button" ng-click="removeAction($index)" class="btn btn-danger remove-condition col-md-1 left-margin"><span class="glyphicon glyphicon-minus-sign"></span></button>\n								</div>\n								<button type="button" class="btn btn-sm green padding-bottom" data-ng-click="addAction()">\n									<i class="fa fa-plus"></i> {{\'APPLICATION_ADD_ACTION\' | translate}}\n								</button>\n							</div>\n						</div>\n						<div class="has-error" data-ng-show="forms.general.$submitted && !trigger.All.length && !trigger.Any.length">\n							<span class="help-block help-block-error form-control">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_INSERT_AT_LEAST_ONE_CONDITION\' | translate}}.\n							</span>\n						</div>\n						<div class="has-error" data-ng-show="forms.general.$submitted && !trigger.Actions.length">\n							<span class="help-block help-block-error form-control">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_INSERT_AT_LEAST_ONE_ACTION\' | translate}}.\n							</span>\n						</div>\n						<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n					</div>\n				</div>\n				</form>\n			</div>\n		</div>\n	</div>\n</div>\n'),
-a.put("app/tools/trigger/wizard/wizard.html",'<div class="row">\n	<div class="col-md-12">\n		<!-- BEGIN PAGE HEADER-->\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-bulb"></i>\n					<a href="/tools/triggers/list">{{ \'APPLICATION_TRIGGERS\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n		<!-- END PAGE HEADER-->\n\n		<!-- BEGIN  PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-bulb font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_TRIGGERS\' | translate }} WIZARD</span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<wizard on-finish="createItem()">\n					<wz-step title="{{\'APPLICATION_GENERAL\' | translate}}" canexit="exitValidation(forms.general.$valid)">\n						<form name="forms.general" novalidate>\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n								<span data-ng-show="(forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<!-- START STATUS -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_STATUS\' | translate}}</label></br>\n							<input\n								    bs-switch\n										class="form-control"\n								    ng-model="item.status"\n								    type="checkbox"\n										name="status"\n										data-ng-init="item.status = 0"\n								    switch-active="{{ recordSwitch.isActive }}"\n								    switch-on-text="{{ recordSwitch.onText }}"\n								    switch-off-text="{{ recordSwitch.offText }}"\n								    switch-on-color="{{ recordSwitch.onColor }}"\n								    switch-off-color="{{ recordSwitch.offColor }}"\n								    switch-animate="{{ recordSwitch.animate }}"\n								    switch-size="{{ recordSwitch.size }}"\n								    switch-label="{{ recordSwitch.label }}"\n								    switch-icon="{{ recordSwitch.icon }}"\n								    switch-radio-off="{{ recordSwitch.radioOff }}"\n								    switch-label-width="{{ recordSwitch.labelWidth }}"\n								    switch-handle-width="{{ recordSwitch.handleWidth }}">\n							</div>\n							<!-- END STATUS -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"/>\n							</div>\n							<!-- END DESCRIPTION -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" ng-click="next()"/>\n						</form>\n					</wz-step>\n	        <wz-step title="{{\'APPLICATION_SETTINGS\' | translate}}" canexit="exitSettingsValidation(forms.settings.$valid)">\n						<form name="forms.settings" novalidate>\n						<div class="portlet light bordered">\n							<div class="portlet-title">\n								<div class="caption font-blue-hoki">\n									<i class="icon-tag font-blue-hoki"></i>\n									<span class="caption-subject">{{ \'APPLICATION_CHANNEL\' | translate }}</span>\n								</div>\n							</div>\n							<div class="portlet-body">\n								<div class="form-group" data-ng-class="{\'has-error\': (forms.settings.channel.$touched || forms.settings.$submitted) && forms.settings.channel.$invalid}">\n									<label class="control-label">{{ \'APPLICATION_CHANNEL\' | translate }}<span class="required" aria-required="true">*</span></label>\n									<ui-select data-ng-model="item.channel" name="channel" theme="bootstrap" required>\n										<ui-select-match placeholder="{{ \'APPLICATION_CHANNEL\' | translate }}">{{$select.selected | capitalize}}</ui-select-match>\n										<ui-select-choices repeat="channel in $triggers.channels | filter: $select.search">\n											<div ng-bind-html="channel | highlight: $select.search | capitalize"></div>\n										</ui-select-choices>\n									</ui-select>\n									<span data-ng-show="(forms.settings.channel.$touched || forms.settings.$submitted) && forms.settings.channel.$error.required" class="help-block help-block-error">\n										<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n									</span>\n								</div>\n							</div>\n						</div>\n						<div class="portlet light bordered">\n							<div class="portlet-title">\n								<div class="caption font-blue-hoki">\n									<i class="icon-tag font-blue-hoki"></i>\n									<span class="caption-subject" ng-bind-html="\'APPLICATION_MEET_ALL_CONDITIONS\' | translate"></span>:\n								</div>\n							</div>\n							<div class="portlet-body">\n								<div class="padding-bottom row" ng-repeat="all in item.All">\n									<condition-builder element="all" serviceindex="item.channel" service="$triggers" form="forms.settings"></condition-builder>\n									<button type="button" ng-click="removeCondition(\'All\',$index)" class="btn btn-danger remove-condition col-md-1 left-margin"><span class="glyphicon glyphicon-minus-sign"></span></button>\n								</div>\n								<button type="button" class="btn btn-sm green padding-bottom" data-ng-click="addCondition(\'All\')">\n									<i class="fa fa-plus"></i> {{\'APPLICATION_ADD_CONDITION\' | translate}}\n								</button>\n							</div>\n						</div>\n						<div class="portlet light bordered">\n							<div class="portlet-title">\n								<div class="caption font-blue-hoki">\n									<i class="icon-tag font-blue-hoki"></i>\n									<span class="caption-subject" ng-bind-html="\'APPLICATION_MEET_ANY_CONDITIONS\' | translate"></span>:\n								</div>\n							</div>\n							<div class="portlet-body">\n								<div class="padding-bottom row" ng-repeat="any in item.Any">\n									<condition-builder element="any" serviceindex="item.channel" service="$triggers" form="forms.settings"></condition-builder>\n									<button type="button" ng-click="removeCondition(\'Any\',$index)" class="btn btn-danger remove-condition col-md-1 left-margin"><span class="glyphicon glyphicon-minus-sign"></span></button>\n								</div>\n								<button type="button" class="btn btn-sm green padding-bottom" data-ng-click="addCondition(\'Any\')">\n									<i class="fa fa-plus"></i> {{\'APPLICATION_ADD_CONDITION\' | translate}}\n								</button>\n							</div>\n						</div>\n						<div class="portlet light bordered">\n							<div class="portlet-title">\n								<div class="caption font-blue-hoki">\n									<i class="icon-tag font-blue-hoki"></i>\n									<span class="caption-subject">{{ \'APPLICATION_ACTIONS\' | translate }}</span>:\n								</div>\n							</div>\n							<div class="portlet-body">\n								<div class="padding-bottom row" ng-repeat="action in item.Actions">\n									<div class="form-group col-md-2" data-ng-class="{\'has-error\': (forms.settings[\'action\'+$index].$touched || forms.settings.$submitted) && forms.settings[\'action\'+$index].$invalid}">\n										<ui-select data-ng-model="action.action" theme="bootstrap" data-ng-change="resetActionData(action)" name="action{{$index}}" required>\n											<ui-select-match placeholder="{{ \'APPLICATION_ACTION\' | translate }}">{{$select.selected.name | translate}}</ui-select-match>\n											<ui-select-choices repeat="tAction.value as tAction in $triggers.services[item.channel].actions | filter: $select.search">\n												<div ng-bind-html="tAction.name | translate | highlight: $select.search"></div>\n											</ui-select-choices>\n										</ui-select>\n										<span data-ng-show="(forms.settings[\'action\'+$index].$touched || forms.settings.$submitted) && forms.settings[\'action\'+$index].$error.required" class="help-block help-block-error">\n											<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n										</span>\n									</div>\n									<div ng-switch="action.action">\n										<action-builder-template ng-switch-when="template" element="action" form="forms.settings"></action-builder-template>\n										<action-builder-integration ng-switch-when="integration" element="action" form="forms.settings"></action-builder-integration>\n									</div>\n									<button type="button" ng-click="removeAction($index)" class="btn btn-danger remove-condition col-md-1 left-margin"><span class="glyphicon glyphicon-minus-sign"></span></button>\n								</div>\n								<button type="button" class="btn btn-sm green padding-bottom" data-ng-click="addAction()">\n									<i class="fa fa-plus"></i> {{\'APPLICATION_ADD_ACTION\' | translate}}\n								</button>\n							</div>\n						</div>\n						<div class="has-error" data-ng-show="forms.settings.$submitted && !item.All.length && !item.Any.length">\n							<span class="help-block help-block-error form-control">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_INSERT_AT_LEAST_ONE_CONDITION\' | translate}}.\n							</span>\n						</div>\n						<div class="has-error" data-ng-show="forms.settings.$submitted && !item.Actions.length">\n							<span class="help-block help-block-error form-control">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_INSERT_AT_LEAST_ONE_ACTION\' | translate}}.\n							</span>\n						</div>\n						<button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n						<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" ng-click="next()"/>\n					</form>\n					</wz-step>\n					<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n						<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n						<button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n						<input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n					</wz-step>\n				</wizard>\n			</div>\n		</div>\n		<!-- END PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/tools/trunk/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-wrench"></i>\n					<a href="#">{{ \'APPLICATION_TOOLS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-link"></i>\n					<a href="#">{{ \'APPLICATION_TRUNKS\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-link font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_TRUNKS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<a class="btn green-jungle" href="/tools/trunks/wizard" data-toggle="dropdown">\n						<i class="icon-plus"></i> {{ \'APPLICATION_NEW_TRUNK\' | translate }}\n					</a>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/tools/trunk/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initView()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-wrench"></i>\n					<a href="#">{{ \'APPLICATION_TOOLS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-link"></i>\n					<a href="/tools/trunks/list">{{ \'APPLICATION_TRUNKS\' | translate }}</a>\n					<i data-ng-show="trunk" class="fa fa-angle-right"></i>\n				</li>\n				<li data-ng-show="trunk">\n					<a href="#">{{trunk.name}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/trunk.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{trunk.name}}\n					</div>\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.tools.trunks.view.settings\')}">\n							<a data-ng-href="/tools/trunks/view/{{trunk.name}}/settings"><i class="icon-settings"></i> {{ \'APPLICATION_SETTINGS\' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/tools/trunk/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_TRUNK\' | translate}} {{ \'APPLICATION_SETTINGS\' | translate}} </span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_GENERAL\' | translate}}</a>\n					</li>\n					<li>\n						<a href="#" data-target="#tab_1_2" data-toggle="tab">{{ \'APPLICATION_ADVANCED\' | translate}}</a>\n					</li>\n					<li>\n						<a href="#" data-target="#tab_1_3" data-toggle="tab">{{ \'APPLICATION_OTHER_FIELDS\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n\n			<div class="portlet-body" data-ng-init="getContexts();">\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.general" data-ng-submit="forms.general.$valid && updateTrunk()" novalidate>\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="trunk.name" required readonly/>\n								<span data-ng-show="(forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n							<div class="row">\n								<div class="col-md-6">\n\n							<!-- START HOST -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.host.$touched || forms.general.$submitted) && forms.general.host.$invalid}">\n								<label class="control-label">{{\'APPLICATION_HOST\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="host" placeholder="{{\'APPLICATION_HOST\' | translate}}" class="form-control" data-ng-model="trunk.host" required/>\n								<span class="help-block">\n									{{ \'DESCRIPTION_TRUNK_HOST\' | translate }}\n								</span>\n								<span data-ng-show="(forms.general.host.$touched || forms.general.$submitted) && forms.general.host.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END HOST -->\n\n							<!-- START SECRET -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.secret.$touched || forms.general.$submitted) && forms.general.secret.$invalid}">\n								<label class="control-label">{{\'APPLICATION_SECRET\' | translate}}</label>\n								<input type="password" name="secret" placeholder="{{\'APPLICATION_SECRET\' | translate}}" class="form-control" data-ng-model="trunk.secret">\n								<span class="help-block">\n									{{ \'DESCRIPTION_TRUNK_SECRET\' | translate }}\n								</span>\n								<span data-ng-show="(forms.general.secret.$touched || forms.general.$submitted) && forms.general.secret.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END SECRET -->\n\n							<!-- START CONTEXT -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.context.$touched || forms.general.$submitted) && forms.general.context.$invalid}">\n								<label class="control-label">{{\'APPLICATION_CONTEXT\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="trunk.context" name="context" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n									<ui-select-choices repeat="context.name as context in voiceContexts | filter: $select.search">\n										<div ng-bind-html="context.name | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_TRUNK_VOICE_CONTEXT\' | translate }}\n								</span>\n								<span data-ng-show="(forms.general.context.$touched || forms.general.$submitted) && forms.general.context.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END CONTEXT -->\n\n							<!-- START CALLERID -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.callerid.$touched || forms.general.$submitted) && forms.general.callerid.$invalid}">\n								<label class="control-label">{{\'APPLICATION_CALLERID\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="callerid" pattern=\'^"[a-zA-Z0-9_.-]*" <[a-zA-Z0-9_.-]*>\' placeholder="{{\'APPLICATION_CALLERID\' | translate}}" class="form-control" data-ng-model="trunk.callerid"/>\n								<span class="help-block">\n										{{ \'DESCRIPTION_OUTBOUND_CALLERID\' | translate }} "name" &lt;number&gt;\n									</span>\n								<span data-ng-show="(forms.general.callerid.$touched || forms.general.$submitted) && forms.general.callerid.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END CALLERID -->\n\n							<!-- START TYPE -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.type.$touched || forms.general.$submitted) && forms.general.type.$invalid}">\n								<label class="control-label">{{\'APPLICATION_TYPE\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="trunk.type" name="type" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n									<ui-select-choices repeat="item in [\'user\',\'peer\',\'friend\'] | filter: $select.search">\n										<div ng-bind-html="item | highlight: $select.search | capitalize"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_TRUNK_TYPE\' | translate }}\n								</span>\n								<span data-ng-show="(forms.general.type.$touched || forms.general.$submitted) && forms.general.type.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END TYPE -->\n\n							<!-- START DTMFMODE -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.dtmfmode.$touched || forms.general.$submitted) && forms.general.dtmfmode.$invalid}">\n								<label class="control-label">{{\'APPLICATION_DTMFMODE\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="trunk.dtmfmode" name="dtmfmode" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected}}</ui-select-match>\n									<ui-select-choices repeat="item in [\'rfc2833\', \'info\', \'shortinfo\', \'inband\',\'auto\'] | filter: $select.search">\n										<div ng-bind-html="item | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_TRUNK_DTMFMODE\' | translate }}\n								</span>\n								<span data-ng-show="(forms.general.dtmfmode.$touched || forms.general.$submitted) && forms.general.dtmfmode.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END DTMFMODE -->\n\n						</div>\n						<div class="col-md-6">\n\n							<!-- START DEFAULT USER -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.general.$submitted && forms.general.defaultuser.$invalid}">\n								<label class="control-label">{{\'APPLICATION_DEFAULT_USER\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="defaultuser" placeholder="{{\'APPLICATION_DEFAULT_USER\' | translate}}" class="form-control" data-ng-model="trunk.defaultuser" required/>\n								<span class="help-block">\n									{{ \'DESCRIPTION_TRUNK_DEFAULT_USER\' | translate }}\n								</span>\n								<span data-ng-show="forms.general.$submitted && (forms.general.defaultuser.$invalid)" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END DEFAULT USER -->\n\n							<!-- START NAT -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.nat.$touched || forms.general.$submitted) && forms.general.nat.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAT\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select multiple data-ng-model="trunk.nat" name="nat" theme="bootstrap" ui-required="true">\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$item}}</ui-select-match>\n									<ui-select-choices repeat="item in [\'yes\', \'no\', \'never\', \'route\', \'force_rport\', \'comedia\'] | filter: $select.search">\n										<div ng-bind-html="item | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_TRUNK_NAT\' | translate }}\n								</span>\n								<span data-ng-show="(forms.general.nat.$touched || forms.general.$submitted) && forms.general.nat.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAT -->\n\n							<!-- START QUALIFY -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.qualify.$touched || forms.general.$submitted) && forms.general.qualify.$invalid}">\n								<label class="control-label">{{\'APPLICATION_QUALIFY\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="trunk.qualify" name="qualify" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n									<ui-select-choices repeat="item in [\'yes\',\'no\'] | filter: $select.search">\n										<div ng-bind-html="item | highlight: $select.search | capitalize"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_TRUNK_QUALIFY\' | translate }}\n								</span>\n								<span data-ng-show="(forms.general.qualify.$touched || forms.general.$submitted) && forms.general.qualify.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END QUALIFY -->\n\n							<!-- START ALLOW -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.allow.$touched || forms.general.$submitted) && forms.general.allow.$invalid}">\n								<label class="control-label">{{\'APPLICATION_ALLOW_CODEC\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select multiple data-ng-model="trunk.allow" name="allow" theme="bootstrap" ui-required="true">\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$item}}</ui-select-match>\n									<ui-select-choices repeat="item in [\'g723\',\'gsm\',\'ulaw\',\'alaw\',\'g726\',\'g722\',\'g729\',\'ilbc\'] | filter: $select.search">\n										<div ng-bind-html="item | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_TRUNK_ALLOW_CODEC\' | translate }}\n								</span>\n								<span data-ng-show="(forms.general.allow.$touched || forms.general.$submitted) && forms.general.allow.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END ALLOW -->\n\n							<!-- START INSECURE -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.insecure.$touched || forms.general.$submitted) && forms.general.insecure.$invalid}">\n								<label class="control-label">{{\'APPLICATION_INSECURE\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select multiple data-ng-model="trunk.insecure" name="insecure" theme="bootstrap" ui-required="true">\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$item}}</ui-select-match>\n									<ui-select-choices repeat="item in [\'port\',\'invite\',\'very\'] | filter: $select.search">\n										<div ng-bind-html="item | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_TRUNK_INSECURE\' | translate }}\n								</span>\n								<span data-ng-show="(forms.general.insecure.$touched || forms.general.$submitted) && forms.general.insecure.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END INSECURE -->\n\n							<!-- START CALLLIMIT -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.call_limit.$touched || forms.general.$submitted) && forms.general.call_limit.$invalid}">\n								<label class="control-label">{{\'APPLICATION_CALLLIMIT\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="number" min="0" name="call-limit" placeholder="{{\'APPLICATION_CALLLIMIT\' | translate}}" class="form-control" data-ng-model="trunk.call_limit"/>\n								<span class="help-block">\n									{{ \'DESCRIPTION_TRUNK_CALLLIMIT\' | translate }}\n								</span>\n								<span data-ng-show="(forms.general.call_limit.$touched || forms.general.$submitted) && forms.general.call_limit.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END CALLLIMIT -->\n\n						</div>\n					</div>\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="trunk.description"></textarea>\n							</div>\n							<!-- END DESCRIPTION -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END GENERAL TAB -->\n					<!-- ADVANCED TAB -->\n					<div class="tab-pane" id="tab_1_2">\n						<form name="forms.advanced" data-ng-submit="forms.advanced.$valid && updateTrunk()" novalidate>\n							<div class="row">\n								<div class="col-md-6">\n\n							<!-- START REGISTRY -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_REGISTRY\' | translate}}</label>\n								<input type="text" name="registry" placeholder="{{\'APPLICATION_REGISTRY\' | translate}}" class="form-control" data-ng-model="trunk.registry"/>\n								<span class="help-block">\n									{{ \'DESCRIPTION_TRUNK_REGISTRY\' | translate }}\n								</span>\n							</div>\n							<!-- END REGISTRY -->\n\n							<!-- START DIRECTMEDIA -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.directmedia.$touched || forms.advanced.$submitted) && forms.advanced.directmedia.$invalid}">\n								<label class="control-label">{{\'APPLICATION_DIRECTMEDIA\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="trunk.directmedia" name="directmedia" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n									<ui-select-choices repeat="item in [\'yes\', \'no\', \'nonat\', \'update\'] | filter: $select.search">\n										<div ng-bind-html="item | highlight: $select.search | capitalize"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_TRUNK_DIRECTMEDIA\' | translate }}\n								</span>\n								<span data-ng-show="(forms.advanced.directmedia.$touched || forms.advanced.$submitted) && forms.advanced.directmedia.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END DIRECTMEDIA -->\n\n							<!-- START CALLCOUNTER -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.callcounter.$touched || forms.advanced.$submitted) && forms.advanced.callcounter.$invalid}">\n								<label class="control-label">{{\'APPLICATION_CALLCOUNTER\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="trunk.callcounter" name="callcounter" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n									<ui-select-choices repeat="item in [\'yes\',\'no\'] | filter: $select.search">\n										<div ng-bind-html="item | highlight: $select.search | capitalize"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_TRUNK_CALLCOUNTER\' | translate }}\n								</span>\n								<span data-ng-show="(forms.advanced.callcounter.$touched || forms.advanced.$submitted) && forms.advanced.callcounter.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END CALLCOUNTER -->\n\n							<!-- START FROMDOMAIN -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.advanced.$submitted && forms.advanced.fromdomain.$invalid}">\n								<label class="control-label">{{\'APPLICATION_FROMDOMAIN\' | translate}}</label>\n								<input type="text" name="fromdomain" placeholder="{{\'APPLICATION_FROMDOMAIN\' | translate}}" class="form-control" data-ng-model="trunk.fromdomain" />\n								<span class="help-block">\n									{{ \'DESCRIPTION_TRUNK_FROMDOMAIN\' | translate }}\n								</span>\n								<span data-ng-show="forms.advanced.$submitted && (forms.advanced.fromdomain.$invalid)" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END FROMDOMAIN -->\n\n							<!-- START FROMUSER -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.advanced.$submitted && forms.advanced.fromuser.$invalid}">\n								<label class="control-label">{{\'APPLICATION_FROMUSER\' | translate}}</label>\n								<input type="text" name="fromuser" placeholder="{{\'APPLICATION_FROMUSER\' | translate}}" class="form-control" data-ng-model="trunk.fromuser" />\n								<span class="help-block">\n									{{ \'DESCRIPTION_TRUNK_FROMUSER\' | translate }}\n								</span>\n								<span data-ng-show="forms.advanced.$submitted && (forms.advanced.fromuser.$invalid)" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END FROMUSER -->\n\n						</div>\n						<div class="col-md-6">\n\n							<!-- START OUTBOUNDPROXY -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.advanced.$submitted && forms.advanced.outboundproxy.$invalid}">\n								<label class="control-label">{{\'APPLICATION_OUTBOUNDPROXY\' | translate}}</label>\n								<input type="text" name="outboundproxy" placeholder="{{\'APPLICATION_OUTBOUNDPROXY\' | translate}}" class="form-control" data-ng-model="trunk.outboundproxy" />\n								<span class="help-block">\n									{{ \'DESCRIPTION_TRUNK_OUTBOUNDPROXY\' | translate }}\n								</span>\n								<span data-ng-show="forms.advanced.$submitted && (forms.advanced.outboundproxy.$invalid)" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END OUTBOUNDPROXY -->\n\n							<!-- START USEREQPHONE -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.usereqphone.$touched || forms.advanced.$submitted) && forms.advanced.usereqphone.$invalid}">\n								<label class="control-label">{{\'APPLICATION_USEREQPHONE\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="trunk.usereqphone" name="usereqphone" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n									<ui-select-choices repeat="item in [\'yes\',\'no\'] | filter: $select.search">\n										<div ng-bind-html="item | highlight: $select.search | capitalize"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_TRUNK_USEREQPHONE\' | translate }}\n								</span>\n								<span data-ng-show="(forms.advanced.usereqphone.$touched || forms.advanced.$submitted) && forms.advanced.usereqphone.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END USEREQPHONE -->\n\n							<!-- START TRUSTRPID -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.trustrpid.$touched || forms.advanced.$submitted) && forms.advanced.trustrpid.$invalid}">\n								<label class="control-label">{{\'APPLICATION_TRUSTRPID\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="trunk.trustrpid" name="trustrpid" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n									<ui-select-choices repeat="item in [\'yes\',\'no\'] | filter: $select.search">\n										<div ng-bind-html="item | highlight: $select.search | capitalize"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_TRUNK_TRUSTRPID\' | translate }}\n								</span>\n								<span data-ng-show="(forms.advanced.trustrpid.$touched || forms.advanced.$submitted) && forms.advanced.trustrpid.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END TRUSTRPID -->\n\n							<!-- START SENDRPID -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.sendrpid.$touched || forms.advanced.$submitted) && forms.advanced.sendrpid.$invalid}">\n								<label class="control-label">{{\'APPLICATION_SENDRPID\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="trunk.sendrpid" name="sendrpid" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n									<ui-select-choices repeat="item in [\'yes\',\'no\'] | filter: $select.search">\n										<div ng-bind-html="item | highlight: $select.search | capitalize"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_TRUNK_SENDRPID\' | translate }}\n								</span>\n								<span data-ng-show="(forms.advanced.sendrpid.$touched || forms.advanced.$submitted) && forms.advanced.sendrpid.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END SENDRPID -->\n\n							<!-- START ENCRYPTION -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.encryption.$touched || forms.advanced.$submitted) && forms.advanced.encryption.$invalid}">\n								<label class="control-label">{{\'APPLICATION_ENCRYPTION\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select data-ng-model="trunk.encryption" name="encryption" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n									<ui-select-choices repeat="item in [\'yes\',\'no\'] | filter: $select.search">\n										<div ng-bind-html="item | highlight: $select.search | capitalize"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_TRUNK_ENCRYPTION\' | translate }}\n								</span>\n								<span data-ng-show="(forms.advanced.encryption.$touched || forms.advanced.$submitted) && forms.advanced.encryption.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END ENCRYPTION -->\n\n							<!-- START PORT -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.port.$touched || forms.advanced.$submitted) && forms.advanced.port.$invalid}">\n								<label class="control-label">{{\'APPLICATION_PORT\' | translate}}</label>\n								<input type="number" min="0" name="port" placeholder="{{\'APPLICATION_PORT\' | translate}}" class="form-control" data-ng-model="trunk.port"/>\n								<span class="help-block">\n									{{ \'DESCRIPTION_TRUNK_PORT\' | translate }}\n								</span>\n								<span data-ng-show="(forms.advanced.port.$touched || forms.advanced.$submitted) && forms.advanced.port.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END PORT -->\n\n							<!-- START TRANSPORT -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.transport.$touched || forms.advanced.$submitted) && forms.advanced.transport.$invalid}">\n								<label class="control-label">{{\'APPLICATION_TRANSPORT\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<ui-select multiple data-ng-model="trunk.transport" name="transport" theme="bootstrap" ui-required="true">\n									<ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$item}}</ui-select-match>\n									<ui-select-choices repeat="item in [\'udp\',\'wss\',\'ws\',\'tcp\',\'tls\'] | filter: $select.search">\n										<div ng-bind-html="item | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span class="help-block">\n									{{ \'DESCRIPTION_TRUNK_TRANSPORT\' | translate }}\n								</span>\n								<span data-ng-show="(forms.advanced.transport.$touched || forms.advanced.$submitted) && forms.advanced.transport.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END TRANSPORT -->\n\n						</div>\n					</div>\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END ADVANCED TAB -->\n					<!-- START OTHER FIELDS TAB -->\n					<div class="tab-pane" id="tab_1_3">\n						<div class="row">\n							<div class="col-md-6">\n								<!-- START OTHER FIELDS-->\n								<div class="form-group">\n									<label class="control-label">{{\'APPLICATION_OTHER_FIELDS\' | translate}}</label>\n									<textarea name="otherFields" placeholder="{{\'APPLICATION_OTHER_FIELDS\' | translate}}" class="form-control otherfields-col" data-ng-model="trunk.otherFields"></textarea>\n									<span class="help-block">\n										{{ \'DESCRIPTION_TRUNK_OTHER_FIELDS\' | translate }}\n									</span>\n								</div>\n								<!-- END OTHER FIELDS -->\n							</div>\n							<div class="col-md-6">\n								<div class="form-group">\n									<label class="control-label">{{\'APPLICATION_EXAMPLE\' | translate}}</label>\n									<div class="well">\n										<div>host=dynamicp</div>\n										<div>secret=********</div>\n										<div>regcontext=tammari-internal</div>\n										<div>regexten=1005</div>\n										<div>dtmfmode=rfc2833</div>\n										<div>insecure=invite,port</div>\n										<div>canreinvite=yes</div>\n										<div>nat=yes</div>\n										<div>qualify=yes</div>\n										<div>context=merus-sipphone</div>\n										<div>pickupgroup=1</div>\n										<div>callgroup=1</div>\n										<div>mailbox=1000@default</div>\n									</div>\n								</div>\n							</div>\n						</div>\n					</div>\n					<!-- END OTHER FIELDS TAB -->\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),
-a.put("app/tools/trunk/wizard/wizard.html",'<div class="col-md-12" data-ng-init="initWizard()">\n	<!-- BEGIN PAGE HEADER-->\n	<div class="page-bar">\n		<ul class="page-breadcrumb">\n			<li>\n				<i class="icon-rocket"></i>\n				<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n				<i class="fa fa-angle-right"></i>\n			</li>\n			<li>\n				<i class="icon-wrench"></i>\n				<a href="#">{{ \'APPLICATION_TOOLS\' | translate }}</a>\n				<i class="fa fa-angle-right"></i>\n			</li>\n			<li>\n				<i class="icon-link"></i>\n				<a href="/tools/trunks/list">{{ \'APPLICATION_TRUNKS\' | translate }}</a>\n				<i class="fa fa-angle-right"></i>\n			</li>\n			<li>\n				<i class="icon-options"></i>\n				<a href="#">{{ \'APPLICATION_WIZARD\' | translate }}</a>\n			</li>\n		</ul>\n	</div>\n	<!-- END PAGE HEADER-->\n\n	<!-- BEGIN PORTLET-->\n	<div class="portlet light bordered">\n		<div class="portlet-title">\n			<div class="caption font-green-sharp">\n				<i class="icon-link font-green-sharp"></i>\n				<span class="caption-subject">{{ \'APPLICATION_TRUNK\' | translate }} WIZARD</a> </span>\n			</div>\n		</div>\n		<div class="portlet-body">\n			<wizard on-finish="createItem()">\n				<wz-step title="{{\'APPLICATION_GENERAL\' | translate}}" canexit="exitValidation(forms.general.$valid)">\n					<form name="forms.general" novalidate>\n\n						<!-- START NAME -->\n						<div class="form-group" data-ng-class="{\'has-error\': forms.general.$submitted && forms.general.name.$invalid}">\n							<label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n							<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n							<span data-ng-show="forms.general.$submitted && forms.general.name.$invalid" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n						</div>\n						<!-- END NAME -->\n\n						<!-- START HOST -->\n						<div class="form-group" data-ng-class="{\'has-error\': forms.general.$submitted && forms.general.host.$invalid}">\n							<label class="control-label">{{\'APPLICATION_HOST\' | translate}}<span class="required" aria-required="true">*</span></label>\n							<input type="text" name="host" placeholder="{{\'APPLICATION_HOST\' | translate}}" class="form-control" data-ng-model="item.host" required/>\n							<span class="help-block">\n								{{ \'DESCRIPTION_TRUNK_HOST\' | translate }}\n							</span>\n							<span data-ng-show="forms.general.$submitted && forms.general.host.$invalid" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n						</div>\n						<!-- END HOST -->\n\n						<!-- START PASSWORD -->\n						<div class="form-group" data-ng-class="{\'has-error\': forms.general.$submitted && forms.general.password.$invalid}">\n							<label class="control-label">{{\'APPLICATION_SECRET\' | translate}}<span class="required" aria-required="true">*</span></label>\n							<input type="password" name="password" placeholder="{{\'APPLICATION_PASSWORD\' | translate}}" class="form-control" data-ng-model="item.secret" required/>\n							<span class="help-block">\n								{{ \'DESCRIPTION_TRUNK_SECRET\' | translate }}\n							</span>\n							<span data-ng-show="forms.general.$submitted && forms.general.password.$invalid" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n							</span>\n						</div>\n						<!-- END PASSWORD -->\n\n						<!-- START DEFAULT USER -->\n						<div class="form-group" data-ng-class="{\'has-error\': forms.general.$submitted && forms.general.defaultuser.$invalid}">\n							<label class="control-label">{{\'APPLICATION_DEFAULT_USER\' | translate}}<span class="required" aria-required="true">*</span></label>\n							<input type="text" name="defaultuser" placeholder="{{\'APPLICATION_DEFAULT\' | translate}} {{\'APPLICATION_USER\' | translate}}" class="form-control" data-ng-model="item.defaultuser" required/>\n							<span class="help-block">\n								{{ \'DESCRIPTION_TRUNK_DEFAULT_USER\' | translate }}\n							</span>\n							<span data-ng-show="forms.general.$submitted && (forms.general.defaultuser.$invalid)" class="help-block help-block-error">\n								<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_WRONG_PASSWORD\' | translate}}.\n							</span>\n						</div>\n						<!-- END DEFAULT USER -->\n\n						<!-- START DESCRIPTION -->\n						<div class="form-group">\n							<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n							<textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n						</div>\n						<!-- END DESCRIPTION -->\n\n						<button class="btn green-haze" type="submit" ng-click="next(true)">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n					</form>\n				</wz-step>\n\n				<wz-step title="{{\'APPLICATION_ADVANCED\' | translate}}" canexit="exitValidation(forms.advanced.$valid)">\n					<form name="forms.advanced" novalidate>\n\n						<!-- START REGISTRY -->\n						<div class="form-group">\n							<label class="control-label">{{\'APPLICATION_REGISTRY\' | translate}}</label>\n							<input type="text" name="registry" placeholder="{{\'APPLICATION_REGISTRY\' | translate}}" class="form-control" data-ng-model="item.registry"/>\n							<span class="help-block">\n								{{ \'DESCRIPTION_TRUNK_REGISTRY\' | translate }}\n							</span>\n						</div>\n						<!-- END REGISTRY -->\n						<button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n						<button class="btn green-haze" type="submit" ng-click="next()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n					</form>\n				</wz-step>\n\n				<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n					<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n					<button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n					<input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n				</wz-step>\n			</wizard>\n		</div>\n	</div>\n	<!-- END PORTLET-->\n</div>\n'),a.put("app/tools/variable/list/list.create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_VARIABLE\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.name.$touched || form.$submitted) && form.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n      <span data-ng-show="(form.name.$touched || form.$submitted) && form.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n    </div>\n    <!-- END DESCRIPTION -->\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="save()" ng-disabled="form.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/tools/variable/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-wrench"></i>\n					<a href="#">{{ \'APPLICATION_TOOLS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-eye"></i>\n					<a href="#">{{ \'APPLICATION_VARIABLES\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-docs font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_VARIABLES\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<button class="btn green-jungle " ng-click="createItem()">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_VARIABLE\' | translate }}\n						</button>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/tools/variable/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getVariable()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-wrench"></i>\n					<a href="#">{{ \'APPLICATION_TOOLS\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-eye"></i>\n					<a href="/tools/variables/list">{{ \'APPLICATION_VARIABLES\' | translate }}</a>\n					<i data-ng-show="variable" class="fa fa-angle-right"></i>\n				</li>\n				<li data-ng-show="variable">\n					<a href="#">{{variable.name}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/variable.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{variable.name}}\n					</div>\n					<!-- <div class="profile-usertitle-job">\n						{{user.role}}\n					</div> -->\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.tools.variables.view.settings\')}">\n							<a data-ng-href="/tools/variables/view/{{variable.id}}/settings">\n							<i class="icon-settings"></i>\n							{{ \'APPLICATION_SETTINGS\' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/tools/variable/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_VARIABLE\' | translate}} {{ \'APPLICATION_SETTINGS\' | translate}} </span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_GENERAL\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.general" data-ng-submit="forms.general.$valid && updateVariable()" novalidate>\n\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="variable.name" required/>\n								<span data-ng-show="(forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="variable.description"></textarea>\n							</div>\n							<!-- END DESCRIPTION -->\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END ADVANCED TAB -->\n\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/tools/yourdashboard/list/clone.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_CLONE_DASHBOARD\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="forms.dashboard" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (forms.dashboard.name.$touched || forms.dashboard.$submitted) && forms.dashboard.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n      <span data-ng-show="(forms.dashboard.name.$touched || forms.dashboard.$submitted) && forms.dashboard.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="ok()" ng-disabled="forms.dashboard.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/tools/yourdashboard/list/create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_DASHBOARD\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="forms.dashboard" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (forms.dashboard.name.$touched || forms.dashboard.$submitted) && forms.dashboard.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n      <span data-ng-show="(forms.dashboard.name.$touched || forms.dashboard.$submitted) && forms.dashboard.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n    </div>\n    <!-- END DESCRIPTION -->\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="ok()" ng-disabled="forms.dashboard.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/tools/yourdashboard/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-screen-desktop"></i>\n					<a href="/tools/yourdashboards/list">{{ \'APPLICATION_YOUR_DASHBOARDS\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-docs font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_YOUR_DASHBOARDS\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<button class="btn green-jungle " ng-click="create()">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_DASHBOARD\' | translate }}\n						</button>\n					</div>\n					<!-- <a class="btn btn-icon-only btn-default fullscreen" href="#"></a> -->\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/tools/yourdashboard/show/show.html",'<div class="row" style="min-height: 466px;">\n  <div class="col-md-12" ng-init="getDashboard()">\n    <adf-dashboard\n    data-ng-if="dashboard"\n    name="{{dashboard.name}}"\n    collapsible="{{dashboard.collapsible}}"\n    maximizable="{{dashboard.maximizable}}"\n    enableconfirmdelete="{{dashboard.enableconfirmdelete}}"\n    structure="{{dashboard.structure}}"\n    editable="{{dashboard.editable}}"\n    adf-model="dashboard.model"/>\n  </div>\n</div>\n'),a.put("app/tools/yourdashboard/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getDashboard()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-screen-desktop"></i>\n					<a href="/tools/yourdashboards/list">{{ \'APPLICATION_YOUR_DASHBOARDS\' | translate }}</a>\n					<i data-ng-show="dashboard" class="fa fa-angle-right"></i>\n				</li>\n				<li data-ng-show="dashboard">\n					<a href="#">{{dashboard.name}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img data-ng-src="assets/images/media/dashboard.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{dashboard.name}}\n					</div>\n					<!-- <div class="profile-usertitle-job">\n						{{user.role}}\n					</div> -->\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.tools.yourdashboards.view.settings\')}">\n							<a data-ng-href="/tools/yourdashboards/view/{{dashboard.id}}/settings">\n							<i class="icon-settings"></i>\n							{{ \'APPLICATION_SETTINGS\' | translate}} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/tools/yourdashboard/view/view.settings.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_DASHBOARD\' | translate}} {{ \'APPLICATION_SETTINGS\' | translate}} </span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_GENERAL\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.general" data-ng-submit="forms.general.$valid && updateDashboard()" novalidate>\n\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': (forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="dashboard.name" required/>\n								<span data-ng-show="(forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$error.required" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<!-- START VISIBLE TO ADMIN -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_VISIBLE_TO_ADMIN\' | translate}}</label><br>\n								<input\n									bs-switch\n									ng-model="dashboard.admin"\n									type="checkbox"\n									switch-active="{{ radioSwitch.isActive }}"\n									switch-on-text="{{ \'APPLICATION_YES\' | translate }}"\n									switch-off-text="{{ \'APPLICATION_NO\' | translate }}"\n									switch-on-color="{{ radioSwitch.onColor }}"\n									switch-off-color="{{ radioSwitch.offColor }}"\n									switch-animate="{{ radioSwitch.animate }}"\n									switch-size="{{ radioSwitch.size }}"\n									switch-label="{{ radioSwitch.label }}"\n									switch-icon="{{ radioSwitch.icon }}"\n									switch-radio-off="{{ radioSwitch.radioOff }}"\n									switch-label-width="{{ radioSwitch.labelWidth }}"\n									switch-handle-width="{{ radioSwitch.handleWidth }}">\n							</div>\n							<!-- END VISIBLE TO ADMIN -->\n\n							<!-- START VISIBLE TO USER -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_VISIBLE_TO_USER\' | translate}}</label><br>\n								<input\n									bs-switch\n									ng-model="dashboard.user"\n									type="checkbox"\n									switch-active="{{ radioSwitch.isActive }}"\n									switch-on-text="{{ \'APPLICATION_YES\' | translate }}"\n									switch-off-text="{{ \'APPLICATION_NO\' | translate }}"\n									switch-on-color="{{ radioSwitch.onColor }}"\n									switch-off-color="{{ radioSwitch.offColor }}"\n									switch-animate="{{ radioSwitch.animate }}"\n									switch-size="{{ radioSwitch.size }}"\n									switch-label="{{ radioSwitch.label }}"\n									switch-icon="{{ radioSwitch.icon }}"\n									switch-radio-off="{{ radioSwitch.radioOff }}"\n									switch-label-width="{{ radioSwitch.labelWidth }}"\n									switch-handle-width="{{ radioSwitch.handleWidth }}">\n							</div>\n							<!-- END VISIBLE TO USER -->\n\n							<!-- START VISIBLE TO AGENT -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_VISIBLE_TO_AGENT\' | translate}}</label><br>\n								<input\n									bs-switch\n									ng-model="dashboard.agent"\n									type="checkbox"\n									switch-active="{{ radioSwitch.isActive }}"\n									switch-on-text="{{ \'APPLICATION_YES\' | translate }}"\n									switch-off-text="{{ \'APPLICATION_NO\' | translate }}"\n									switch-on-color="{{ radioSwitch.onColor }}"\n									switch-off-color="{{ radioSwitch.offColor }}"\n									switch-animate="{{ radioSwitch.animate }}"\n									switch-size="{{ radioSwitch.size }}"\n									switch-label="{{ radioSwitch.label }}"\n									switch-icon="{{ radioSwitch.icon }}"\n									switch-radio-off="{{ radioSwitch.radioOff }}"\n									switch-label-width="{{ radioSwitch.labelWidth }}"\n									switch-handle-width="{{ radioSwitch.handleWidth }}">\n							</div>\n							<!-- END VISIBLE TO AGENT -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="dashboard.description"></textarea>\n							</div>\n							<!-- END DESCRIPTION -->\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END ADVANCED TAB -->\n\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/zendesk/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<i class="icon-handbag"></i>\n					<a href="/zendesk/list">{{ \'APPLICATION_ZENDESK\' | translate }}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered" data-ng-init="initView()">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-handbag font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_ZENDESK\' | translate }}</a> </span>\n				</div>\n				<div class="actions">\n					<div class="btn-group" data-ng-show="id.length">\n						<a class="btn red" href="#" data-ng-click="deleteItems()">\n							<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n						</a>\n					</div>\n					<div class="btn-group">\n						<a class="btn green-jungle" href="/zendesk/wizard" data-toggle="dropdown">\n							<i class="icon-plus"></i> {{ \'APPLICATION_NEW_ACCOUNT\' | translate }}\n						</a>\n					</div>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<!-- START TABLE -->\n				<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n					<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n				</div>\n				<!-- END TABLE -->\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/zendesk/view/configuration/list/create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_CONFIGURATION\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.name.$touched || form.name.$submitted) && form.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n      <span data-ng-show="(form.name.$touched || form.name.$submitted) && form.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"/></textarea>\n    </div>\n    <!-- END DESCRIPTION -->\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="ok()" ng-disabled="form.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/zendesk/view/configuration/list/list.html",'<div ui-view class="profile-content">\n	<div class="row">\n		<div class="col-md-12">\n			<div class="portlet light" data-ng-init="initView()">\n				<div class="portlet-title  tabbable-line">\n					<div class="caption caption-md">\n						<i class="icon-globe theme-font hide"></i>\n						<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_CONFIGURATIONS\' | translate}}</span>\n					</div>\n					<div class="actions">\n						<div class="btn-group" data-ng-show="id.length">\n							<a class="btn red" href="#" data-ng-click="deleteItems()">\n								<i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n							</a>\n						</div>\n						<div class="btn-group">\n							<a class="btn green-jungle" href="#" data-ng-click="createItem()">\n								<i class="icon-plus"></i> {{ \'APPLICATION_NEW_CONFIGURATION\' | translate }}\n							</a>\n						</div>\n					</div>\n				</div>\n				<div class="portlet-body">\n					<!-- START TABLE -->\n					<div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n						<div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n					</div>\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),
-a.put("app/zendesk/view/configuration/view/view.html",'<div class="row" data-ng-init="initView();getConfiguration();getCustomVariables();getFields();getTags();">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_CONFIGURATION\' | translate}}: {{configurationName}}</span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{\'APPLICATION_SUBJECT\' | translate}}</a>\n					</li>\n          <li>\n						<a href="#" data-target="#tab_1_2" data-toggle="tab">{{\'APPLICATION_DESCRIPTION\' | translate}}</a>\n					</li>\n          <li>\n						<a href="#" data-target="#tab_1_3" data-toggle="tab">{{\'APPLICATION_FIELDS\' | translate}}</a>\n					</li>\n					<li>\n						<a href="#" data-target="#tab_1_4" data-toggle="tab">{{\'APPLICATION_TAGS\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- SUBJECT TAB -->\n					<div class="tab-pane ui-padding active" id="tab_1_1">\n            <div class="row">\n              <div class="col-md-11">\n                <span class="caption-subject">All following fields will be join by blank space:</span>\n              </div>\n              <div class="col-md-1 pull-rigth">\n                <button class="btn btn-icon-only green" data-ng-click="addItem(\'subject\')"><i class="fa fa-plus"></i></button>\n              </div>\n            </div>\n            <hr>\n						<!-- <div id="subject-item-list" ng-scrollbars ng-scrollbars-config="config"> -->\n	            <div class="row" data-ng-repeat="subjectItem in subjectConfig">\n	              <div class="col-md-3">\n	                <ui-select ng-model="subjectItem.type" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeType(subjectItem)">\n	                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.title}}</ui-select-match>\n	                  <ui-select-choices repeat="item.type as item in fieldType | filter: $select.search">\n	                    <div ng-bind-html="item.title | highlight: $select.search"></div>\n	                  </ui-select-choices>\n	                </ui-select>\n	              </div>\n	              <div class="col-md-8" data-ng-if="subjectItem.type==\'string\'">\n	                <div class="form-group">\n	                  <input type="text" class="form-control" data-ng-model="subjectItem.content" data-ng-change="updateField(subjectItem)">\n	                </div>\n	              </div>\n								<div class="col-md-8" data-ng-if="subjectItem.type==\'variable\'">\n	                <div class="form-group">\n	                  <ui-select theme="bootstrap" ng-disabled="disabled" data-ng-model="subjectItem.variableName" data-ng-change="updateField(subjectItem)">\n	                    <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.title}}</ui-select-match>\n	                    <ui-select-choices group-by="groupVariableByGroup" repeat="variable.name as variable in variables | filter: $select.search">\n	                      <div ng-bind-html="variable.title | highlight: $select.search"></div>\n	                    </ui-select-choices>\n	                  </ui-select>\n	                </div>\n	              </div>\n	              <div class="col-md-8" data-ng-if="subjectItem.type==\'customVariable\'">\n	                <div class="form-group">\n	                  <ui-select theme="bootstrap" ng-disabled="disabled" data-ng-model="subjectItem.VariableId" data-ng-change="updateField(subjectItem)">\n	                    <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n	                    <ui-select-choices repeat="variable.id as variable in customVariables | filter: $select.search">\n	                      <div ng-bind-html="variable.name | highlight: $select.search"></div>\n	                    </ui-select-choices>\n	                  </ui-select>\n	                </div>\n	              </div>\n	              <div class="col-md-1">\n	                <div class="form-group">\n	                  <button class="btn btn-icon-only red" data-ng-click="removeItem(subjectItem)"><i class="fa fa-times"></i></button>\n	                </div>\n	              </div>\n	            </div>\n						<!-- </div> -->\n					</div>\n					<!-- END SUBJECT TAB -->\n          <!-- DESCRIPTION TAB -->\n					<div class="tab-pane ui-padding" id="tab_1_2">\n						<div class="row">\n              <div class="col-md-11">\n                <span class="caption-subject">All following fields will be join by new line:</span>\n              </div>\n              <div class="col-md-1 pull-rigth">\n                <button class="btn btn-icon-only green" data-ng-click="addItem(\'description\')"><i class="fa fa-plus"></i></button>\n              </div>\n            </div>\n            <hr>\n						<!-- <div id="description-item-list" ng-scrollbars ng-scrollbars-config="config"> -->\n							<div class="row" data-ng-repeat="descriptionItem in descriptionConfig">\n	              <div class="col-md-2">\n	                <ui-select ng-model="descriptionItem.type" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeDescType(descriptionItem)">\n	                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.title}}</ui-select-match>\n	                  <ui-select-choices repeat="item.type as item in descFieldType | filter: $select.search">\n	                    <div ng-bind-html="item.title | highlight: $select.search"></div>\n	                  </ui-select-choices>\n	                </ui-select>\n	              </div>\n	              <div class="col-md-9" data-ng-if="descriptionItem.type==\'string\'">\n	                <div class="form-group">\n	                  <input type="text" class="form-control" data-ng-model="descriptionItem.content" data-ng-change="updateField(descriptionItem)">\n	                </div>\n	              </div>\n								<div class="col-md-3" data-ng-if="descriptionItem.type==\'keyValue\'">\n									<input type="text" class="form-control" placeholder="Key" data-ng-model="descriptionItem.key" data-ng-change="updateField(descriptionItem)">\n								</div>\n								<div class="col-md-3" data-ng-if="descriptionItem.type==\'keyValue\'">\n									<ui-select ng-model="descriptionItem.keyType" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeDescType(descriptionItem)">\n	                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.title}}</ui-select-match>\n	                  <ui-select-choices repeat="item.type as item in fieldType | filter: $select.search">\n	                    <div ng-bind-html="item.title | highlight: $select.search"></div>\n	                  </ui-select-choices>\n	                </ui-select>\n								</div>\n								<div class="col-md-3" data-ng-if="descriptionItem.type==\'keyValue\' && descriptionItem.keyType==\'string\'">\n									<input type="text" class="form-control" placeholder="Value" data-ng-model="descriptionItem.keyContent" data-ng-change="updateField(descriptionItem)">\n								</div>\n								<div class="col-md-3" data-ng-if="descriptionItem.type==\'keyValue\' && descriptionItem.keyType==\'variable\'">\n	                <div class="form-group">\n	                  <ui-select theme="bootstrap" ng-disabled="disabled" data-ng-model="descriptionItem.variableName" data-ng-change="updateField(descriptionItem)">\n	                    <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.title}}</ui-select-match>\n	                    <ui-select-choices group-by="groupVariableByGroup" repeat="variable.name as variable in variables | filter: $select.search">\n	                      <div ng-bind-html="variable.title | highlight: $select.search"></div>\n	                    </ui-select-choices>\n	                  </ui-select>\n	                </div>\n	              </div>\n	              <div class="col-md-3" data-ng-if="descriptionItem.type==\'keyValue\' && descriptionItem.keyType==\'customVariable\'">\n	                <div class="form-group">\n	                  <ui-select theme="bootstrap" ng-disabled="disabled" data-ng-model="descriptionItem.VariableId" data-ng-change="updateField(descriptionItem)">\n	                    <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n	                    <ui-select-choices repeat="variable.id as variable in customVariables | filter: $select.search">\n	                      <div ng-bind-html="variable.name | highlight: $select.search"></div>\n	                    </ui-select-choices>\n	                  </ui-select>\n	                </div>\n	              </div>\n	              <div class="col-md-1">\n	                <div class="form-group">\n	                  <button class="btn btn-icon-only red" data-ng-click="removeItem(descriptionItem)"><i class="fa fa-times"></i></button>\n	                </div>\n	              </div>\n	            </div>\n						<!-- </div> -->\n					</div>\n					<!-- END DESCRIPTION TAB -->\n          <!-- FIELDS TAB -->\n					<div class="tab-pane ui-padding" id="tab_1_3">\n						<div class="row">\n              <div class="col-md-11">\n                <span class="caption-subject">Add how to fill the fields present in your account:</span>\n              </div>\n              <div class="col-md-1 pull-rigth">\n                <button class="btn btn-icon-only green" data-ng-click="addItem(\'field\')"><i class="fa fa-plus"></i></button>\n              </div>\n            </div>\n            <hr>\n						<!-- <div id="field-item-list" ng-scrollbars ng-scrollbars-config="config"> -->\n	            <div class="row" data-ng-repeat="fieldItem in fieldConfig">\n	              <div class="col-md-3">\n	                <ui-select ng-model="fieldItem.idField" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeFieldType(fieldItem)">\n	                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.title}}</ui-select-match>\n	                  <ui-select-choices repeat="item.id as item in accountFields | filter: $select.search">\n	                    <div ng-bind-html="item.title | highlight: $select.search"></div>\n	                  </ui-select-choices>\n	                </ui-select>\n	              </div>\n	              <div class="col-md-8" data-ng-if="getSystemFieldOptions(fieldItem.idField)">\n	                <div class="form-group">\n										<ui-select ng-model="fieldItem.content" theme="bootstrap" ng-disabled="disabled" data-ng-change="updateField(fieldItem)">\n		                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n		                  <ui-select-choices repeat="item.value as item in getSystemFieldOptions(fieldItem.idField) | filter: $select.search">\n		                    <div ng-bind-html="item.name | highlight: $select.search"></div>\n		                  </ui-select-choices>\n		                </ui-select>\n	                </div>\n	              </div>\n								<div class="col-md-4" data-ng-if="!getSystemFieldOptions(fieldItem.idField)">\n									<div class="form-group">\n										<ui-select ng-model="fieldItem.type" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeType(fieldItem)">\n		                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.title}}</ui-select-match>\n		                  <ui-select-choices repeat="item.type as item in fieldType | filter: $select.search">\n		                    <div ng-bind-html="item.title | highlight: $select.search | ucfirst"></div>\n		                  </ui-select-choices>\n		                </ui-select>\n									</div>\n								</div>\n								<div class="col-md-4" data-ng-if="!getSystemFieldOptions(fieldItem.idField) && fieldItem.type === \'string\'">\n	                <div class="form-group">\n										<input type="text" class="form-control" data-ng-model="fieldItem.content" data-ng-change="updateField(fieldItem)">\n	                </div>\n	              </div>\n								<div class="col-md-4" data-ng-if="!getSystemFieldOptions(fieldItem.idField) && fieldItem.type === \'variable\'">\n	                <div class="form-group">\n										<ui-select theme="bootstrap" ng-disabled="disabled" data-ng-model="fieldItem.variableName" data-ng-change="updateField(fieldItem)">\n	                    <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.title}}</ui-select-match>\n	                    <ui-select-choices group-by="groupVariableByGroup" repeat="variable.name as variable in variables | filter: $select.search">\n	                      <div ng-bind-html="variable.title | highlight: $select.search"></div>\n	                    </ui-select-choices>\n	                  </ui-select>\n	                </div>\n	              </div>\n								<div class="col-md-4" data-ng-if="!getSystemFieldOptions(fieldItem.idField) && fieldItem.type === \'customVariable\'">\n	                <div class="form-group">\n										<ui-select theme="bootstrap" ng-disabled="disabled" data-ng-model="fieldItem.VariableId" data-ng-change="updateField(fieldItem)">\n	                    <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n	                    <ui-select-choices repeat="variable.id as variable in customVariables | filter: $select.search">\n	                      <div ng-bind-html="variable.name | highlight: $select.search"></div>\n	                    </ui-select-choices>\n	                  </ui-select>\n	                </div>\n	              </div>\n	              <div class="col-md-1">\n	                <div class="form-group">\n	                  <button class="btn btn-icon-only red" data-ng-click="removeItem(fieldItem)"><i class="fa fa-times"></i></button>\n	                </div>\n	              </div>\n	            </div>\n						<!-- </div> -->\n					</div>\n					<!-- END FIELDS TAB -->\n					<!-- TAG TAB -->\n					<div class="tab-pane ui-padding" id="tab_1_4">\n						<div class="row">\n              <div class="col-md-12">\n                <span class="caption-subject">Select tags that you want add in the ticket:</span>\n              </div>\n            </div>\n            <hr>\n						<form name="forms.tags" data-ng-submit="updateTags()" novalidate>\n							<!-- TAG -->\n							<div class="form-group">\n								<ui-select multiple data-ng-model="selectedTags.tags" theme="bootstrap" name="tags" ng-disabled="disabled">\n									<ui-select-match placeholder="{{ \'APPLICATION_TAGS\' | translate }}">{{$item.name}}</ui-select-match>\n									<ui-select-choices repeat="tag.id as tag in tags | filter: $select.search">\n										{{tag.name}}\n									</ui-select-choices>\n								</ui-select>\n							</div>\n							<!-- END TAG -->\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END TAG TAB -->\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/zendesk/view/view.account.html",'<div class="row">\n	<div class="col-md-12">\n		<div class="portlet light">\n			<div class="portlet-title tabbable-line">\n				<div class="caption caption-md">\n					<i class="icon-globe theme-font hide"></i>\n					<span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_ACCOUNT\' | translate}}</span>\n				</div>\n				<ul class="nav nav-tabs">\n					<li class="active">\n						<a href="#" data-target="#tab_1_1" data-toggle="tab">{{\'APPLICATION_GENERALS\' | translate}}</a>\n					</li>\n				</ul>\n			</div>\n			<div class="portlet-body">\n				<div class="tab-content">\n					<!-- GENERAL TAB -->\n					<div class="tab-pane active" id="tab_1_1">\n						<form name="forms.formSetting" data-ng-submit="forms.formSetting.$valid && updateItem()" novalidate>\n              <!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="account.name" required/>\n								<span data-ng-show="forms.formSetting.name.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="account.description"/>\n							</div>\n							<!-- END DESCRIPTION -->\n\n              <!-- START USERNAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.username.$invalid}">\n								<label class="control-label">{{\'APPLICATION_USERNAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="username" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="account.username" required/>\n								<span data-ng-show="forms.formSetting.username.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END USERNAME -->\n\n              <!-- START REMOTE ADDRESS -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.remoteUri.$invalid}">\n								<label class="control-label">{{\'APPLICATION_REMOTE_ADDRESS\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="url" name="remoteUri" placeholder="{{\'APPLICATION_REMOTE_ADDRESS\' | translate}}" class="form-control" data-ng-model="account.remoteUri" required />\n								<span data-ng-show="forms.formSetting.remoteUri.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END USERNAME -->\n\n							<!-- START AUTH TYPE -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.authType.$invalid}">\n								<label class="control-label">{{\'APPLICATION_AUTHENTICATION_TYPE\' | translate}}</label>\n								<ui-select data-ng-model="account.authType" name="authType" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_AUTHENTICATION_TYPE\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n									<ui-select-choices repeat="type in [\'password\', \'token\'] | filter: $select.search">\n										<div data-ng-bind="type | capitalize | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span data-ng-show="forms.formSetting.authType.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- START AUTH TYPE -->\n\n              <!-- START PASSWORD -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.password.$invalid}" ng-slide-down="account.authType == \'password\'" lazy-render duration="1">\n								<label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="password" name="password" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="account.password" required/>\n								<span data-ng-show="forms.formSetting.password.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END PASSWORD -->\n\n              <!-- START TOKEN -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.token.$invalid}" ng-slide-down="account.authType == \'token\'" lazy-render duration="1">\n								<label class="control-label">{{\'APPLICATION_TOKEN\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="token" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="account.token" required/>\n								<span data-ng-show="forms.formSetting.token.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END TOKEN -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n						</form>\n					</div>\n					<!-- END GENERAL TAB -->\n\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n'),a.put("app/zendesk/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initView()">\n	<div class="col-md-12">\n		<div class="page-bar">\n			<ul class="page-breadcrumb">\n				<li>\n					<i class="icon-rocket"></i>\n					<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n          <i class="icon-handbag"></i>\n          <a href="/zendesk/list">{{ \'APPLICATION_ZENDESK\' | translate }}</a>\n					<i class="fa fa-angle-right"></i>\n				</li>\n				<li>\n					<a href="#">{{account.name}}</a>\n				</li>\n			</ul>\n		</div>\n\n		<!-- BEGIN PROFILE SIDEBAR -->\n		<div class="profile-sidebar">\n			<!-- PORTLET MAIN -->\n			<div class="portlet light profile-sidebar-portlet">\n				<!-- SIDEBAR USERPIC -->\n				<div class="profile-image">\n					<img src="assets/images/media/zendesk.png" class="img-responsive">\n				</div>\n				<!-- END SIDEBAR USERPIC -->\n				<!-- SIDEBAR USER TITLE -->\n				<div class="profile-usertitle">\n					<div class="profile-usertitle-name">\n						{{account.name}}\n					</div>\n					<div class="profile-usertitle-job">\n						{{account.remoteUri}}\n					</div>\n				</div>\n				<!-- END SIDEBAR USER TITLE -->\n				<!-- SIDEBAR MENU -->\n				<div class="profile-usermenu">\n					<ul class="nav">\n						<li data-ng-class="{active: $state.is(\'main.zendesk.view.account\')}">\n							<a ng-href="/zendesk/view/{{account.id}}/account">\n							<i class="icon-user"></i>\n							{{ \'APPLICATION_ACCOUNT\' | translate }} </a>\n						</li>\n						<li data-ng-class="{active: $state.includes(\'main.zendesk.view.configurations\') || $state.is(\'main.zendesk.view.configuration\')}">\n							<a ng-href="/zendesk/view/{{account.id}}/configurations/list">\n							<i class="icon-settings"></i>\n							{{ \'APPLICATION_CONFIGURATIONS\' | translate }} </a>\n						</li>\n					</ul>\n				</div>\n				<!-- END MENU -->\n			</div>\n			<!-- END PORTLET MAIN -->\n		</div>\n		<!-- END BEGIN PROFILE SIDEBAR -->\n		<!-- BEGIN PROFILE CONTENT -->\n		<div ui-view class="profile-content">\n		</div>\n		<!-- END PROFILE CONTENT -->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/zendesk/wizard/wizard.html",'<!-- BEGIN PAGE HEADER-->\n<div class="row">\n	<div class="col-md-12">\n			<div class="page-bar">\n				<ul class="page-breadcrumb">\n					<li>\n						<i class="icon-rocket"></i>\n						<a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n						<i class="fa fa-angle-right"></i>\n					</li>\n					<li>\n						<i class="icon-handbag"></i>\n						<a href="/zendesk/list">{{ \'APPLICATION_ZENDESK\' | translate }}</a>\n					</li>\n				</ul>\n			</div>\n		</div>\n</div>\n<!-- END PAGE HEADER-->\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initWizard()">\n	<div class="col-md-12">\n		<!-- BEGIN Portlet PORTLET-->\n		<div class="portlet light bordered">\n			<div class="portlet-title">\n				<div class="caption font-green-sharp">\n					<i class="icon-notebook font-green-sharp"></i>\n					<span class="caption-subject">{{ \'APPLICATION_ACCOUNT\' | translate }} WIZARD</a> </span>\n				</div>\n			</div>\n			<div class="portlet-body">\n				<wizard on-finish="createItem()">\n          <wz-step title="{{\'APPLICATION_ACCOUNT_INFO\' | translate}}" canexit="exitValidation(forms.formSetting.$valid)">\n						<form name="forms.formSetting" novalidate>\n\n							<!-- START NAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.name.$invalid}">\n								<label class="control-label">{{\'APPLICATION_NAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n								<span data-ng-show="forms.formSetting.name.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END NAME -->\n\n							<!-- START DESCRIPTION -->\n							<div class="form-group">\n								<label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n								<input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"/>\n							</div>\n							<!-- END DESCRIPTION -->\n\n              <!-- START USERNAME -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.username.$invalid}">\n								<label class="control-label">{{\'APPLICATION_USERNAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="username" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.username" required ng-remote-validate="/api/zendesk/accounts/validate/username"/>\n								<span data-ng-show="forms.formSetting.username.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n								<span data-ng-show="(forms.formSetting.username.$touched || forms.formSetting.$submitted) && forms.formSetting.username.$error.ngRemoteValidate" class="help-block help-block-error">\n				          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_EXIST_USERNAME\' | translate}}.\n				        </span>\n							</div>\n							<!-- END USERNAME -->\n\n              <!-- START REMOTE ADDRESS -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.remoteUri.$invalid}">\n								<label class="control-label">{{\'APPLICATION_REMOTE_ADDRESS\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="url" name="remoteUri" placeholder="{{\'APPLICATION_REMOTE_ADDRESS\' | translate}}" class="form-control" data-ng-model="item.remoteUri" required ng-remote-validate="/api/zendesk/accounts/validate/remoteUri"/>\n								<span data-ng-show="forms.formSetting.remoteUri.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n								<span data-ng-show="(forms.formSetting.remoteUri.$touched || forms.formSetting.$submitted) && forms.formSetting.remoteUri.$error.ngRemoteValidate" class="help-block help-block-error">\n				          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_EXIST_DOMAIN\' | translate}}.\n				        </span>\n							</div>\n							<!-- END USERNAME -->\n\n							<!-- START AUTH TYPE -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.authType.$invalid}">\n								<label class="control-label">{{\'APPLICATION_AUTHENTICATION_TYPE\' | translate}}</label>\n								<ui-select data-ng-model="item.authType" name="authType" theme="bootstrap" required>\n									<ui-select-match placeholder="{{\'APPLICATION_AUTHENTICATION_TYPE\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n									<ui-select-choices repeat="type in [\'password\', \'token\'] | filter: $select.search">\n										<div data-ng-bind="type | capitalize | highlight: $select.search"></div>\n									</ui-select-choices>\n								</ui-select>\n								<span data-ng-show="forms.formSetting.authType.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- START AUTH TYPE -->\n\n              <!-- START PASSWORD -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.password.$invalid}" ng-slide-down="item.authType == \'password\'" lazy-render duration="1">\n								<label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="password" name="password" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.password" required/>\n								<span data-ng-show="forms.formSetting.password.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END PASSWORD -->\n\n              <!-- START TOKEN -->\n							<div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.token.$invalid}" ng-slide-down="item.authType == \'token\'" lazy-render duration="1">\n								<label class="control-label">{{\'APPLICATION_TOKEN\' | translate}} <span class="required" aria-required="true">*</span></label>\n								<input type="text" name="token" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.token" required/>\n								<span data-ng-show="forms.formSetting.token.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n									<strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n								</span>\n							</div>\n							<!-- END TOKEN -->\n\n							<input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" data-ng-click="next()"/>\n\n						</form>\n					</wz-step>\n\n					<wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n						<p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n						<input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n					</wz-step>\n\n				</wizard>\n\n			</div>\n		</div>\n		<!-- END Portlet PORTLET-->\n	</div>\n</div>\n<!-- END PAGE CONTENT-->\n'),
-a.put("components/footer/footer.html",'<!-- BEGIN FOOTER -->\n<div class="page-footer" data-ng-init="initFooter()">\n  <div class="page-footer-inner">\n     xCALLY Motion v. {{info.version}} | {{year}} - {{year + 1}} &copy; Powered by Xenialab\n  </div>\n  <div class="scroll-to-top">\n    <i class="icon-arrow-up"></i>\n  </div>\n</div>\n<!-- END FOOTER -->\n'),a.put("components/header/header.html",'<!-- BEGIN HEADER INNER -->\n<div class="page-header-inner" data-ng-init="initHeader()">\n  <!-- BEGIN LOGO -->\n  <div class="page-logo">\n    <a href="/">\n      <img src="assets/images/logo.png" alt="logo" class="logo-default"/>\n    </a>\n    <div class="menu-toggler sidebar-toggler" data-ng-click="toogleSidebar()">\n      <!-- DOC: Remove the above "hide" to enable the sidebar toggler button on header -->\n    </div>\n  </div>\n  <!-- END LOGO -->\n  <!-- BEGIN HEADER SEARCH BOX -->\n  <!-- DOC: Apply "search-form-expanded" right after the "search-form" class to have half expanded search box -->\n  <form class="search-form hide" action="extra_search.html" method="GET">\n    <div class="input-group">\n      <input type="text" class="form-control" placeholder="Search..." name="query">\n      <span class="input-group-btn">\n        <a href="javascript:;" class="btn submit"><i class="icon-magnifier"></i></a>\n      </span>\n    </div>\n  </form>\n  <!-- END HEADER SEARCH BOX -->\n  <!-- BEGIN RESPONSIVE MENU TOGGLER -->\n  <a href="javascript:;" class="menu-toggler responsive-toggler" data-toggle="collapse" data-target=".navbar-collapse">\n  </a>\n  <!-- END RESPONSIVE MENU TOGGLER -->\n  <!-- BEGIN TOP NAVIGATION MENU -->\n  <div class="top-menu">\n    <ul class="nav navbar-nav pull-right">\n      <!-- BEGIN LANGUAGE BAR -->\n      <!-- DOC: Apply "dropdown-dark" class after below "dropdown-extended" to change the dropdown styte -->\n      <li class="dropdown dropdown-language">\n        <a href="#" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-close-others="true">\n          <img ng-src="assets/images/flags/{{ language }}.png">\n          <i class="fa fa-angle-down"></i>\n        </a>\n        <ul class="dropdown-menu dropdown-menu-default">\n          <li>\n            <a href="#" ng-click="changeLanguage(\'ar\')">\n              <img alt="" src="assets/images/flags/ar.png"> {{\'APPLICATION_ARABIC\' | translate}}\n            </a>\n          </li>\n          <li>\n            <a href="#" ng-click="changeLanguage(\'de\')">\n              <img alt="" src="assets/images/flags/de.png"> {{\'APPLICATION_GERMAN\' | translate}}\n            </a>\n          </li>\n          <li>\n            <a href="#" ng-click="changeLanguage(\'en_EN\')">\n              <img alt="" src="assets/images/flags/en_EN.png"> {{\'APPLICATION_ENGLISH\' | translate}}\n            </a>\n          </li>\n          <li>\n            <a href="#" ng-click="changeLanguage(\'es\')">\n              <img alt="" src="assets/images/flags/es.png"> {{\'APPLICATION_SPANISH\' | translate}}\n            </a>\n          </li>\n          <li>\n            <a href="#" ng-click="changeLanguage(\'fr\')">\n              <img alt="" src="assets/images/flags/fr.png"> {{\'APPLICATION_FRENCH\' | translate}}\n            </a>\n          </li>\n          <li>\n            <a href="#" ng-click="changeLanguage(\'it\')">\n              <img alt="" src="assets/images/flags/it.png"> {{\'APPLICATION_ITALIAN\' | translate}}\n            </a>\n          </li>\n          <li>\n            <a href="#" ng-click="changeLanguage(\'ja\')">\n              <img alt="" src="assets/images/flags/ja.png"> {{\'APPLICATION_JAPANASE\' | translate}}\n            </a>\n          </li>\n          <li>\n            <a href="#" ng-click="changeLanguage(\'ko\')">\n              <img alt="" src="assets/images/flags/ko.png"> {{\'APPLICATION_KOREAN\' | translate}}\n            </a>\n          </li>\n          <li>\n            <a href="#" ng-click="changeLanguage(\'pt\')">\n              <img alt="" src="assets/images/flags/pt.png"> {{\'APPLICATION_PORTUGUESE\' | translate}}\n            </a>\n          </li>\n          <li>\n            <a href="#" ng-click="changeLanguage(\'ru\')">\n              <img alt="" src="assets/images/flags/ru.png"> {{\'APPLICATION_RUSSIAN\' | translate}}\n            </a>\n          </li>\n          <li>\n            <a href="#" ng-click="changeLanguage(\'sv\')">\n              <img alt="" src="assets/images/flags/sv.png"> {{\'APPLICATION_SWEDISH\' | translate}}\n            </a>\n          </li>\n          <li>\n            <a href="#" ng-click="changeLanguage(\'zh-CN\')">\n              <img alt="" src="assets/images/flags/zh-CN.png"> {{\'APPLICATION_CHINESE_SIMPLIFIED\' | translate}}\n            </a>\n          </li>\n          <li>\n            <a href="#" ng-click="changeLanguage(\'zh-TW\')">\n              <img alt="" src="assets/images/flags/zh-TW.png"> {{\'APPLICATION_CHINESE_TRADITIONAL\' | translate}}\n            </a>\n          </li>\n        </ul>\n      </li>\n      <!-- END LANGUAGE BAR -->\n      <!-- BEGIN USER LOGIN DROPDOWN -->\n      <!-- DOC: Apply "dropdown-dark" class after below "dropdown-extended" to change the dropdown styte -->\n      <li class="dropdown dropdown-user">\n        <a href="#" class="dropdown-toggle" dropdown-menu-hover data-toggle="dropdown" data-close-others="true">\n          <img class="img-circle" data-ng-src="api/users/avatar/{{getCurrentUser().userpic || \'unknown_avatar\'}}" alt="...">\n          <span class="username username-hide-on-mobile">\n            {{ getCurrentUser().fullname }}\n          </span>\n          <i class="fa fa-angle-down"></i>\n        </a>\n        <ul class="dropdown-menu dropdown-menu-default">\n          <li>\n            <a ng-href=" {{isAdmin() ? \'/staff/users/view/\'+getCurrentUser().id+\'/account\' : \'/staff/agents/view/\'+getCurrentUser().id+\'/account\'}}">\n              <i class="icon-key"></i>{{\'APPLICATION_CHANGE_PASSWORD\' | translate}}\n            </a>\n          </li>\n          <li data-ng-click="logout()">\n            <a href="#">\n              <i class="icon-logout"></i> Log Out\n            </a>\n          </li>\n        </ul>\n      </li>\n      <!-- END USER LOGIN DROPDOWN -->\n      <!-- BEGIN QUICK SIDEBAR TOGGLER -->\n      <!-- DOC: Apply "dropdown-dark" class after below "dropdown-extended" to change the dropdown styte -->\n      <li class="dropdown dropdown-quick-sidebar-toggler" data-ng-click="toggleQuickSidebar()">\n        <a href="#" class="dropdown-toggle">\n          <i class="icon-logout"></i>\n        </a>\n      </li>\n      <!-- END QUICK SIDEBAR TOGGLER -->\n    </ul>\n  </div>\n  <!-- END TOP NAVIGATION MENU -->\n</div>\n<!-- END HEADER INNER -->\n'),a.put("components/modal/delete.html",'<div class="modal-header">\n  <button ng-if="modal.dismissable" type="button" ng-click="$dismiss()" class="close">&times;</button>\n  <h4 ng-if="modal.title" ng-bind="modal.title" class="modal-title"></h4>\n</div>\n<div class="modal-body">\n  <p ng-if="modal.text" ng-bind="modal.text"></p>\n  <div ng-if="modal.html" ng-bind-html="modal.html"></div>\n</div>\n<div class="modal-footer">\n  <button ng-repeat="button in modal.buttons" ng-class="button.classes" ng-click="button.click($event)" ng-bind="button.text" class="btn"></button>\n</div>\n'),a.put("components/quickSidebar/modal/add.html",'<div class="modal-header">\n  <button ng-if="modal.dismissable" type="button" ng-click="$dismiss()" class="close">&times;</button>\n  <h4 ng-if="modal.title" ng-bind="modal.title | translate" class="modal-title"></h4>\n</div>\n\n<div class="modal-body">\n  <div class="portlet box blue">\n		<div class="portlet-title">\n			<div class="caption">\n				<i class="icon-people"></i>{{\'APPLICATION_SELECTED_AGENTS\' | translate}}\n			</div>\n		</div>\n		<div class="portlet-body">\n			<ul>\n				<li data-ng-repeat="item in items">\n					 {{item.fullname}}\n				</li>\n\n        <li data-ng-repeat="item in selected.items">\n					 {{item.fullname}}\n				</li>\n			</ul>\n		</div>\n	</div>\n\n  <ui-select multiple name="items" ng-model="selected.items" theme="bootstrap">\n    <ui-select-match placeholder="{{\'APPLICATION_SELECTED_AGENTS\' | translate}}">{{$item.fullname}}</ui-select-match>\n    <ui-select-choices repeat="{id: agent.id, fullname: agent.fullname} as agent in agents.rows | filter: $select.search">\n      {{agent.fullname}}\n    </ui-select-choices>\n  </ui-select>\n</div>\n\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" data-ng-click="ok()" data-ng-show="selected.items.length">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" data-ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("components/quickSidebar/modal/close.html",'<div class="modal-header">\n  <button ng-if="modal.dismissable" type="button" ng-click="$dismiss()" class="close">&times;</button>\n  <h4 ng-if="modal.title" ng-bind="modal.title | translate" class="modal-title"></h4>\n</div>\n<div class="modal-body">\n  <p ng-if="modal.text" ng-bind="modal.text | translate"></p>\n  <!-- <div ng-if="modal.html" ng-bind-html="modal.html"></div> -->\n</div>\n<div class="modal-footer">\n  <button class="btn btn-danger" type="button" ng-click="ok()">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n  <!-- <button ng-repeat="button in modal.buttons" ng-class="button.classes" ng-click="button.click($event)" ng-bind="button.text" class="btn"></button> -->\n</div>\n'),a.put("components/quickSidebar/quickSidebar.html",'<div class="page-quick-sidebar">\n  <div class="nav-justified">\n    <ul class="nav nav-tabs nav-justified">\n      <li data-ng-class="{active:currentTab==0}" data-ng-click="goToTab(0)">\n        <a href="#">\n          <i class="icon-people"></i>\n        </a>\n      </li>\n      <li data-ng-class="{active:currentTab==1}" data-ng-click="goToTab(1)">\n        <a href="#">\n        <i class="icon-eye"></i>\n        </a>\n      </li>\n      <li data-ng-class="{active:currentTab==2}" data-ng-click="goToTab(2)">\n        <a href="#">\n        <i class="icon-globe"></i>\n        </a>\n      </li>\n      <li data-ng-class="{active:currentTab==3}" data-ng-click="goToTab(3)">\n        <a href="#">\n        <i class="icon-bubbles"></i>\n        </a>\n      </li>\n    </ul>\n    <div class="tab-content">\n      <div class="tab-pane page-quick-sidebar-chat" ng-class="{active:currentTab==0 && !messagesTab}">\n        <div class="page-quick-sidebar-chat-users" data-rail-color="#ddd" data-wrapper-class="page-quick-sidebar-list" >\n          <div class="quicksidebar-search">\n            <div class="input-group">\n							<input type="search" class="form-control" placeholder="{{\'APPLICATION_SEARCH\' | translate}} {{\'APPLICATION_AGENT\' | translate}}..." ng-model="searchAgent">\n							<span class="input-group-btn">\n							<i class="icon-magnifier"></i>\n							</span>\n						</div>\n          </div>\n          <ul class="media-list list-items" data-ng-style="style" ng-scrollbars>\n            <li class="media animate-repeat" data-ng-repeat="agent in agents.rows | orderBy:\'-online\' | filter:searchAgent as resultsAgent" data-ng-if="agent.id !== currentUser.id">\n              <img class="media-object" data-ng-src="api/users/avatar/{{agent.userpic ? agent.userpic : \'unknown_avatar\'}}" alt="{{agent.fullname}}">\n              <div class="media-body" data-ng-click="goToMessage(agent.id)">\n                <h4 class="media-heading"><span class="item-status">{{agent.fullname | characters:15 :true}} {{agent.internal}}</h4>\n                <div class="media-heading-small">\n                   <span class="badge badge-empty" data-ng-class="agent.online ? \'badge-success\' : \'badge-danger\'"></span></span> {{\'APPLICATION_LAST_SEEN\' | translate | lowercase}} <time is="relative-time" datetime="{{agent.updatedAt}}">April 1, 2014</time>\n                </div>\n              </div>\n            </li>\n            <li class="media animate-repeat" ng-if="agents.rows.length == 0">\n              <div class="media-body" style="text-align: center;">\n                <h4 class="media-heading"><i>{{\'MESSAGE_NO_AGENTS_FOUND\' | translate | lowercase}}</i></h4>\n              </div>\n            </li>\n            <li class="media animate-repeat" ng-if="resultsAgent.length == 0">\n              <div class="media-body" style="text-align: center;">\n                <h4 class="media-heading"><i>{{\'MESSAGE_NO_AGENTS_FOUND\' | translate | lowercase}}</i></h4>\n              </div>\n            </li>\n          </ul>\n        </div>\n      </div>\n      <div class="tab-pane page-quick-sidebar-chat" ng-class="{active:currentTab==1 && !messagesTab}">\n        <div class="page-quick-sidebar-chat-users" data-rail-color="#ddd" data-wrapper-class="page-quick-sidebar-list">\n          <div class="quicksidebar-search">\n            <div class="input-group">\n              <input type="search" class="form-control" placeholder="{{\'APPLICATION_SEARCH\' | translate}} {{\'APPLICATION_USER\' | translate}}..." ng-model="searchUser">\n              <span class="input-group-btn">\n              <i class="icon-magnifier"></i>\n              </span>\n            </div>\n          </div>\n          <ul class="media-list list-items"  data-ng-style="style" ng-scrollbars>\n            <li class="media animate-repeat" data-ng-repeat="user in users.rows | orderBy:\'-online\' | filter:searchUser as resultsUser" data-ng-if="user.id !== currentUser.id">\n              <img class="media-object" data-ng-src="api/users/avatar/{{user.userpic ? user.userpic : \'unknown_avatar\'}}" alt="{{user.fullname}}">\n              <div class="media-body" data-ng-click="goToMessage(user.id)">\n                <h4 class="media-heading">{{user.fullname | characters:15 :true}} {{user.internal}}</h4>\n                <div class="media-heading-small">\n                   <span class="badge badge-empty" data-ng-class="user.online ? \'badge-success\' : \'badge-danger\'"></span> {{\'APPLICATION_LAST_SEEN\' | translate | lowercase}} <time is="relative-time" datetime="{{user.updatedAt}}">April 1, 2014</time>\n                </div>\n              </div>\n            </li>\n            <li class="media animate-repeat" ng-if="users.rows.length == 0">\n              <div class="media-body" style="text-align: center;">\n                <h4 class="media-heading"><i>{{\'MESSAGE_NO_USERS_FOUND\' | translate | lowercase}}</i></h4>\n              </div>\n            </li>\n            <li class="media animate-repeat" ng-if="resultsUser.length == 0">\n              <div class="media-body" style="text-align: center;">\n                <h4 class="media-heading"><i>{{\'MESSAGE_NO_USERS_FOUND\' | translate | lowercase}}</i></h4>\n              </div>\n            </li>\n          </ul>\n        </div>\n      </div>\n      <div class="tab-pane page-quick-sidebar-chat" ng-class="{active:currentTab==2 && !messagesTab}">\n        <div class="page-quick-sidebar-chat-users" data-rail-color="#ddd" data-wrapper-class="page-quick-sidebar-list">\n          <div class="quicksidebar-search">\n            <div class="input-group">\n              <input type="search" class="form-control" placeholder="{{\'APPLICATION_SEARCH\' | translate}} {{\'APPLICATION_CHAT\' | translate}}..." data-ng-model="searchChatRoomsExternals">\n              <span class="input-group-btn">\n              <i class="icon-magnifier"></i>\n              </span>\n            </div>\n          </div>\n          <ul class="media-list list-items"  data-ng-style="style" ng-scrollbars>\n            <li class="media animate-repeat" data-ng-repeat="chatRoom in chatRooms | QuickSidebarFilterUsersLowerThan:2 | filter:{type:\'external\'} | filter:searchChatRoomsExternals as resultsChatRoomsExternals">\n              <div class="media-status">\n                <i class="icon icon-close" data-ng-show="chatRoom.status === \'CLOSED\'"></i>\n              </div>\n              <img class="media-object" data-ng-src="api/users/avatar/{{user.userpic ? user.userpic : \'unknown_avatar\'}}" alt="{{user.fullname}}">\n              <div class="media-body" data-ng-click="goToMessage(null, chatRoom.id)">\n                <h4 class="media-heading">{{chatRoom.ChatVisitor.fullname}}</h4>\n                <div class="media-heading-small">\n                   {{\'APPLICATION_LAST_SEEN\' | translate | lowercase}} <time is="relative-time" datetime="{{chatRoom.createdAt}}">April 1, 2014</time>\n                </div>\n              </div>\n            </li>\n            <li class="media animate-repeat" data-ng-if="resultsChatRoomsExternals.length === 0">\n              <div class="media-body" style="text-align: center;">\n                <h4 class="media-heading"><i>{{\'MESSAGE_NO_CHATS_FOUND\' | translate | lowercase}}</i></h4>\n              </div>\n            </li>\n          </ul>\n        </div>\n      </div>\n      <div class="tab-pane page-quick-sidebar-chat" ng-class="{active:currentTab==3 && !messagesTab}">\n        <div class="page-quick-sidebar-chat-users" data-rail-color="#ddd" data-wrapper-class="page-quick-sidebar-list">\n          <div class="quicksidebar-search">\n            <div class="input-group">\n              <input type="search" class="form-control" placeholder="{{\'APPLICATION_SEARCH\' | translate}} {{\'APPLICATION_GROUP\' | translate}}..." data-ng-model="searchChatRoomsGroups">\n              <span class="input-group-btn">\n              <i class="icon-magnifier"></i>\n              </span>\n            </div>\n          </div>\n          <ul class="media-list list-items"  data-ng-style="style" ng-scrollbars>\n            <li class="media animate-repeat" data-ng-repeat="chatRoom in chatRooms | QuickSidebarFilterUsersGreaterThan:2 | filter:searchChatRoomsGroups as resultsChatRoomsGroups">\n              <img class="media-object" data-ng-src="api/users/avatar/{{user.userpic ? user.userpic : \'unknown_avatar\'}}" alt="{{user.fullname}}">\n              <div class="media-body" data-ng-click="goToMessage(null, chatRoom.id)">\n                <h4 class="media-heading">{{chatRoom.ChatVisitor.fullname}}</h4>\n                <div class="media-heading-small">\n                   {{\'APPLICATION_LAST_SEEN\' | translate | lowercase}} <time is="relative-time" datetime="{{chatRoom.updatedAt}}">April 1, 2014</time>\n                </div>\n                <div class="media-heading-small">\n                  <div data-ng-repeat="user in chatRoom.Users | map: \'fullname\'" class="inline">\n                    {{ $last ? user : user + \', \'}}\n                  </div>\n                </div>\n              </div>\n            </li>\n            <li class="media animate-repeat" data-ng-if="resultsChatRoomsGroups.length === 0">\n              <div class="media-body" style="text-align: center;">\n                <h4 class="media-heading"><i>{{\'MESSAGE_NO_CHATS_FOUND\' | translate | lowercase}}</i></h4>\n              </div>\n            </li>\n          </ul>\n        </div>\n      </div>\n      <div class="tab-pane page-quick-sidebar-chat page-quick-sidebar-content-item-shown" ng-class="{active:messagesTab}">\n        <div class="page-quick-sidebar-chat-users" data-rail-color="#ddd" data-wrapper-class="page-quick-sidebar-list" >\n          <div class="quicksidebar-search">\n            <div class="input-group">\n              <input type="search" class="form-control" placeholder="{{\'APPLICATION_SEARCH\' | translate}} {{\'APPLICATION_CHAT\' | translate}}..." ng-model="searchMessage">\n              <span class="input-group-btn">\n              <i class="icon-magnifier"></i>\n              </span>\n            </div>\n          </div>\n        </div>\n        <div class="page-quick-sidebar-item">\n          <div class="page-quick-sidebar-chat-user" data-wrapper-class="page-quick-sidebar-list">\n            <div class="page-quick-sidebar-nav">\n                <a href="#" class="page-quick-sidebar-back-to-list" data-ng-click="goBack()"><i class="icon-arrow-left"></i>Back</a>\n            </div>\n            <div id="page-quick-sidebar-chat-user-messages" class="page-quick-sidebar-chat-user-messages" data-ng-style="style2" ng-scrollbars>\n              <div class="post animate-repeat" data-ng-repeat="chatMessage in chatRoom.ChatMessages | filter:searchMessage as resultsMessage" data-ng-class="chatMessage.UserId === currentUser.id ? \'in\' : \'out\'">\n                <img class="avatar" alt="" ng-src="api/users/avatar/unknown_avatar"/>\n                <div class="message">\n                  <span class="arrow"></span>\n                  <a href="#" class="name">{{chatMessage.User.fullname || chatMessage.ChatVisitor .fullname}}</a> -\n                  <span class="datetime">\n                    <time is="relative-time" datetime="{{chatMessage.createdAt}}">\n                      April 1, 2014\n                    </time>\n                  </span>\n                  <ng-emoticons class="body" emoticons-data="chatMessage.body" emoticons-options="options"/>\n                </div>\n              </div>\n\n              <div class="media-body" style="text-align: center;" data-ng-if="resultsMessage.length == 0">\n                <h5 class="media-heading"><i>{{\'MESSAGE_NO_MESSAGES_FOUND\' | translate | lowercase}}</i></h5>\n              </div>\n\n              <div class="media-body" style="text-align: center;" data-ng-if="chatRoom.status === \'CLOSED\'">\n                <h5 class="media-heading"><i>{{\'MESSAGE_CHAT_CLOSED\' | translate | lowercase}}</i></h5>\n              </div>\n\n            </div>\n            <div class="page-quick-sidebar-chat-user-form">\n              <textarea rows="3" class="form-control" style="border:none;resize: none;" placeholder="Type a message here..." ng-enter="sendMessage()" data-ng-model="message.body" data-ng-disabled="chatRoom.status === \'CLOSED\'"></textarea>\n              <div class="btn-group" style="width:100%;background-color:white">\n                <button type="button" class="btn btn-default" style="border:none" data-ng-disabled="chatRoom.status === \'CLOSED\'" data-ng-click="addAgent(chatRoom.id)"><i class="icon-plus font-blue"></i></button>\n                <button type="button" class="btn btn-default pull-right" style="border:none" data-ng-disabled="chatRoom.status === \'CLOSED\'" data-ng-click="closeChatRoom(chatRoom.id)" data-ng-show="chatRoom.type === \'external\'"><i class="icon-close font-red"></i></button>\n              </div>\n            </div>\n          </div>\n        </div>\n      </div>\n    </div>\n  </div>\n</div>\n'),a.put("components/sidebar/sidebar.html",'<div id="page-sidebar" class="page-sidebar navbar-collapse collapse">\n  <!-- BEGIN SIDEBAR MENU -->\n  <!-- DOC: Apply "page-sidebar-menu-light" class right after "page-sidebar-menu" to enable light sidebar menu style(without borders) -->\n  <!-- DOC: Apply "page-sidebar-menu-hover-submenu" class right after "page-sidebar-menu" to enable hoverable(hover vs accordion) sub menu mode -->\n  <!-- DOC: Apply "page-sidebar-menu-closed" class right after "page-sidebar-menu" to collapse("page-sidebar-closed" class must be applied to the body element) the sidebar sub menu mode -->\n  <!-- DOC: Set data-auto-scroll="false" to disable the sidebar from auto scrolling/focusing -->\n  <!-- DOC: Set data-keep-expand="true" to keep the submenues expanded -->\n  <!-- DOC: Set data-auto-speed="200" to adjust the sub menu slide up/down speed -->\n  <ul data-ng-click="mainTab.active=true" class="page-sidebar-menu" data-keep-expanded="false" data-auto-scroll="true" data-slide-speed="200" data-ng-class="{\'page-sidebar-menu-closed\': settings.layout.pageSidebarClosed}" data-ng-init="getSidebarIntegrations()">\n    <!-- DOC: To remove the search box from the sidebar you just need to completely remove the below "sidebar-search-wrapper" LI element -->\n    <li class="sidebar-search-wrapper">\n      <!-- BEGIN RESPONSIVE QUICK SEARCH FORM -->\n      <!-- DOC: Apply "sidebar-search-bordered" class the below search form to have bordered search box -->\n      <!-- DOC: Apply "sidebar-search-bordered sidebar-search-solid" class the below search form to have bordered & solid search box -->\n      <form class="sidebar-search sidebar-search-bordered" action="extra_search.html" method="POST">\n        <a href="javascript:;" class="remove">\n          <i class="icon-close"></i>\n        </a>\n      </form>\n      <!-- END RESPONSIVE QUICK SEARCH FORM -->\n    </li>\n\n    <!-- START DASHBOARD CASE -->\n    <li class="start" data-ng-class="{active: $state.includes(\'main.dashboard\')}">\n      <a href="/dashboard/channels/voice">\n        <i class="icon-rocket"></i>\n        <span class="title">{{\'APPLICATION_DASHBOARD\' | translate}}</span>\n        <span data-ng-show="$state.includes(\'main.dashboard\')" class="selected"></span>\n      </a>\n    </li>\n    <!-- END DASHBOARD CASE -->\n\n    <!-- START YOURDASHBOARD LIST CASE -->\n    <li data-ng-class="{active: $state.is(\'main.tools.yourdashboards.show\')}" data-ng-show="Auth.isAdmin()">\n      <a href="javascript:;">\n        <i class="icon-screen-desktop"></i>\n        <span class="title" >{{\'APPLICATION_YOUR_DASHBOARDS\' | translate}}</span>\n        <span class="arrow" data-ng-class="{ open: $state.includes(\'main.tools.yourdashboards.show\') }"></span>\n      </a>\n      <ul class="sub-menu" data-ng-init="getSidebarDashboards()">\n        <li data-ng-class="{active: $stateParams.id == dashboard.id && $state.includes(\'main.tools.yourdashboards.show\')}" data-ng-repeat="dashboard in dashboards" data-ng-show="dashboard[Auth.getRole()] && dashboard.visible">\n          <a href="/tools/yourdashboards/show/{{dashboard.id}}" >\n            <i class="icon-screen-tablet"></i>\n            <span class="title" >{{dashboard.name}}  </span>\n          </a>\n        </li>\n      </ul>\n    </li>\n    <!-- END YOURDASHBOARD LIST CASE -->\n\n    <!-- START STAFF LIST CASE -->\n    <li data-ng-class="{active: $state.includes(\'main.staff\')}" data-ng-show="Auth.isAdmin()">\n      <a href="javascript:;">\n        <i class="icon-puzzle"></i>\n        <span class="title" >{{\'APPLICATION_STAFF\' | translate}}</span>\n        <span class="arrow" data-ng-class="{open: $state.includes(\'main.staff\')}"></span>\n      </a>\n      <ul class="sub-menu">\n        <!-- START USERS CASE -->\n        <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.staff.users\')}">\n          <a href="/staff/users/list">\n            <i class="icon-eye"></i>\n            <span class="title" >{{\'APPLICATION_USERS\' | translate}}</span>\n            <span data-ng-show="$state.includes(\'main.staff.users\')" class="selected"></span>\n          </a>\n        </li>\n        <!-- END USERS CASE -->\n\n        <!-- START AGENTS CASE -->\n        <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.staff.agents\')}">\n          <a href="/staff/agents/list">\n            <i class="icon-people"></i>\n            <span class="title" >{{\'APPLICATION_AGENTS\' | translate}}</span>\n            <span data-ng-show="$state.includes(\'main.staff.agents\')" class="selected"></span>\n          </a>\n        </li>\n        <!-- END AGENTS CASE -->\n\n        <!-- START AGENTS CASE -->\n        <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.staff.telephones\')}">\n          <a href="/staff/telephones/list">\n            <i class="icon-phone"></i>\n            <span class="title" >{{\'APPLICATION_TELEPHONES\' | translate}}</span>\n            <span data-ng-show="$state.includes(\'main.staff.telephones\')" class="selected"></span>\n          </a>\n        </li>\n        <!-- END AGENTS CASE -->\n\n        <!-- START TEAMS CASE -->\n        <li data-ng-class="{active: $state.includes(\'main.staff.teams\')}">\n          <a href="/staff/teams/list">\n            <i class="icon-shield"></i>\n            <span class="title" >{{\'APPLICATION_TEAMS\' | translate}}</span>\n            <span data-ng-show="$state.includes(\'main.staff.teams\')" class="selected"></span>\n          </a>\n        </li>\n        <!-- END TEAMS CASE -->\n      </ul>\n    </li>\n    <!-- END STAFF LIST CASE -->\n\n    <!-- START CONTACT MANAGER LIST CASE -->\n    <li data-ng-class="{active: $state.includes(\'main.contactmanager.contacts\')\n    || $state.includes(\'main.contactmanager.companies\')\n    || $state.includes(\'main.contactmanager.services\')}" data-ng-show="Auth.isAdmin()">\n    <a href="javascript:;">\n      <i class="icon-notebook"></i>\n      <span class="title" >{{\'APPLICATION_CONTACT_MANAGER\' | translate}}</span>\n      <span class="arrow" data-ng-class="{ open: $state.includes(\'main.contactmanager.contacts\')\n      || $state.includes(\'main.contactmanager.companies\')\n      || $state.includes(\'main.contactmanager.services\') }"></span>\n    </a>\n    <ul class="sub-menu">\n      <!-- START CONTACTS CASE -->\n      <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.contactmanager.contacts\')}">\n        <a href="/contactmanager/contacts/list">\n          <i class=" fa fa-users"></i>\n          <span class="title" >{{\'APPLICATION_CONTACTS\' | translate}}</span>\n          <span data-ng-show="$state.includes(\'main.contactmanager.contacts\')" class="selected"></span>\n        </a>\n      </li>\n      <!-- END CONTACTS CASE -->\n      <!-- START COMPANIES CASE -->\n      <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.contactmanager.companies\')}">\n        <a href="/contactmanager/companies/list">\n          <i class="icon-briefcase"></i>\n          <span class="title" >{{\'APPLICATION_COMPANIES\' | translate}}</span>\n          <span data-ng-show="$state.includes(\'main.contactmanager.companies\')" class="selected"></span>\n        </a>\n      </li>\n      <!-- END COMPANIES CASE -->\n      <!-- START SERVICES CASE -->\n      <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.contactmanager.services\')}">\n        <a href="/contactmanager/services/list">\n          <i class="fa fa-tty"></i>\n          <span class="title" >{{\'APPLICATION_SERVICES\' | translate}}</span>\n          <span data-ng-show="$state.includes(\'main.contactmanager.services\')" class="selected"></span>\n        </a>\n      </li>\n      <!-- END SERVICES CASE -->\n    </ul>\n  </li>\n  <!-- END CONTACT MANAGER LIST CASE -->\n\n  <!-- START CHANNEL LIST CASE -->\n  <li data-ng-class="{active: $state.includes(\'main.channels\')}">\n    <a href="javascript:;">\n      <i class="icon-directions"></i>\n      <span class="title" >{{\'APPLICATION_CHANNELS\' | translate}}</span>\n      <span class="arrow" data-ng-class="{open: $state.includes(\'main.channels\')}"></span>\n    </a>\n    <ul class="sub-menu">\n      <!-- START VOICE CASE -->\n      <li data-ng-show="Auth.isAdmin()" data-ng-class="{ active: $state.includes(\'main.channels.voice\') }">\n        <a href="javascript:;">\n          <i class="icon-earphones-alt"></i>\n          <span class="title">{{ \'APPLICATION_VOICE\' | translate}}</span>\n          <span class="arrow" data-ng-class="{ open: $state.includes(\'main.channels.voice\') }"></span>\n        </a>\n\n        <ul class="sub-menu">\n          <li data-ng-class="{active: $state.includes(\'main.channels.voice.queues\')}">\n            <a href="/channels/voice/queues/list">\n              <i class="icon-docs"></i>\n              <span class="title">{{\'APPLICATION_QUEUES\' | translate}}</span>\n            </a>\n          </li>\n          <li>\n            <a href="javascript:;">\n              <i class="icon-directions"></i>\n              <span class="title"> {{ \'APPLICATION_ROUTES\' | translate}} </span>\n              <span class="arrow" data-ng-class="{ open: $state.includes(\'main.channels.voice.routes\') }"></span>\n              <ul class="sub-menu">\n                <li data-ng-class="{active: $state.includes(\'main.channels.voice.routes.inbound\')}">\n                  <a href="/channels/voice/routes/inbound/list">\n                    <i class="icon-call-in"></i>\n                    <span class="title"> {{\'APPLICATION_INBOUND\' | translate}} </span>\n                  </a>\n                </li>\n                <li data-ng-class="{active: $state.includes(\'main.channels.voice.routes.outbound\')}">\n                  <a href="/channels/voice/routes/outbound/list">\n                    <i class="icon-call-out"></i>\n                    <span class="title"> {{\'APPLICATION_OUTBOUND\' | translate}} </span>\n                  </a>\n                </li>\n                <li data-ng-class="{active: $state.includes(\'main.channels.voice.routes.internal\')}">\n                  <a href="/channels/voice/routes/internal/list">\n                    <i class="icon-reload"></i>\n                    <span class="title"> {{\'APPLICATION_INTERNALS\' | translate}} </span>\n                  </a>\n                </li>\n              </ul>\n            </a>\n          </li>\n          <li data-ng-class="{active: $state.includes(\'main.channels.voice.contexts\')}">\n            <a href="/channels/voice/contexts/list">\n              <i class="icon-docs"></i>\n              <span class="title"> {{\'APPLICATION_CONTEXTS\' | translate}} </span>\n            </a>\n          </li>\n          <li data-ng-class="{active: $state.includes(\'main.channels.voice.voicemails\')}">\n            <a href="/channels/voice/voicemails/list">\n              <i class="icon-envelope-letter"></i>\n              <span class="title"> {{\'APPLICATION_VOICEMAILS\' | translate}} </span>\n            </a>\n          </li>\n          <li data-ng-class="{active: $state.includes(\'main.channels.voice.mohs\')}">\n            <a href="/channels/voice/mohs/list">\n              <i class="icon-music-tone"></i>\n              <span class="title"> {{\'APPLICATION_MOH\' | translate}} </span>\n            </a>\n          </li>\n          <!-- START RECORDING CASE -->\n          <li data-ng-class="{active: $state.includes(\'main.channels.voice.recordings\')}">\n            <a href="/channels/voice/recordings/list">\n              <i class="icon-control-play"></i>\n              <span class="title">{{\'APPLICATION_RECORDINGS\' | translate}}</span>\n            </a>\n          </li>\n          <!-- END RECORDING CASE -->\n          <!-- START REALTIME CASE -->\n          <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.channels.voice.realtime\')}">\n            <a href="/channels/voice/realtime/view/agents">\n              <i class="icon-energy"></i>\n              <span class="title">{{\'APPLICATION_REALTIME\' | translate}}</span>\n            </a>\n          </li>\n          <!-- END REALTIME CASE -->\n          <!-- START CHANSPY CASE -->\n          <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.channels.voice.chanspy\')}">\n            <a href="/channels/voice/chanspy/list">\n              <i class="icon-magnifier"></i>\n              <span class="title" >{{\'APPLICATION_CHANSPY\' | translate}}</span>\n              <!-- <span data-ng-show="$state.includes(\'main.chanspy\')" class="selected"></span> -->\n            </a>\n          </li>\n          <!-- END CHANSPY CASE -->\n        </ul>\n      </li>\n      <!-- END VOICE CASE -->\n\n      <!-- START CHAT CASE -->\n      <li data-ng-class="{active: $state.includes(\'main.channels.chat\')}" data-ng-if="license.chat && Auth.isAdmin()">\n        <a href="javascript:;">\n          <i class="icon-bubble"></i>\n          <span class="title">{{\'APPLICATION_CHAT\' | translate}}</span>\n          <span class="arrow" data-ng-class="{open: $state.includes(\'main.channels.chat\')}"></span>\n        </a>\n        <ul class="sub-menu">\n          <li data-ng-class="{active: $state.includes(\'main.channels.chat.websites\')}">\n            <a href="/channels/chat/websites/list">\n              <i class="icon-globe"></i>\n              <span class="title"> {{\'APPLICATION_WEB_SITES\' | translate}} </span>\n            </a>\n          </li>\n          <li data-ng-class="{active: $state.includes(\'main.channels.chat.queues\')}">\n            <a href="/channels/chat/queues/list">\n              <i class="icon-docs"></i>\n              <span class="title"> {{\'APPLICATION_QUEUES\' | translate}} </span>\n            </a>\n          </li>\n          <li data-ng-class="{active: $state.includes(\'main.channels.chat.online\')}">\n            <a href="/channels/chat/online/list">\n              <i class="icon-login"></i>\n              <span class="title"> {{\'APPLICATION_ONLINE_MESSAGES\' | translate}} </span>\n            </a>\n          </li>\n          <li data-ng-class="{active: $state.includes(\'main.channels.chat.offline\')}">\n            <a href="/channels/chat/offline/list">\n              <i class="icon-logout"></i>\n              <span class="title"> {{\'APPLICATION_OFFLINE_MESSAGES\' | translate}} </span>\n            </a>\n          </li>\n          <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.channels.chat.realtime\')}">\n            <a href="/channels/chat/realtime/view/agents">\n              <i class="icon-energy"></i>\n              <span class="title">{{\'APPLICATION_REALTIME\' | translate}}</span>\n            </a>\n          </li>\n        </ul>\n      </li>\n      <!-- END CHAT CASE -->\n\n      <!-- START MAIL CASE -->\n      <li data-ng-class="{active: $state.includes(\'main.channels.mail\')}" data-ng-if="license.mail">\n        <a href="javascript:;">\n          <i class="icon-envelope"></i>\n          <span class="title">{{\'APPLICATION_MAIL\' | translate}}</span>\n          <span class="arrow" data-ng-class="{ open: $state.includes(\'main.channels.mail\') }"></span>\n        </a>\n\n        <ul class="sub-menu">\n          <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.channels.mail.accounts\') || $state.includes(\'main.channels.mail.account\')}">\n            <a href="/channels/mail/accounts/list">\n              <i class="icon-notebook"></i>\n              <span class="title"> {{\'APPLICATION_ACCOUNTS\' | translate}} </span>\n            </a>\n          </li>\n          <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.channels.mail.queues\') || $state.includes(\'main.channels.mail.queue\')}">\n            <a href="/channels/mail/queues/list">\n              <i class="icon-docs"></i>\n              <span class="title"> {{\'APPLICATION_QUEUES\' | translate}} </span>\n            </a>\n          </li>\n          <li data-ng-class="{active: $state.includes(\'main.channels.mail.inbox\')}">\n            <a href="/channels/mail/inbox/list">\n              <i class="icon-note"></i>\n              <span class="title"> {{\'APPLICATION_INBOX\' | translate}} </span>\n            </a>\n          </li>\n          <!-- START REALTIME CASE -->\n          <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.channels.mail.realtime\')}">\n            <a href="/channels/mail/realtime/view/agents">\n              <i class="icon-energy"></i>\n              <span class="title">{{\'APPLICATION_REALTIME\' | translate}}</span>\n            </a>\n          </li>\n          <!-- END REALTIME CASE -->\n        </ul>\n      </li>\n      <!-- END MAIL CASE -->\n\n      <!-- START FAX CASE -->\n      <li data-ng-class="{active: $state.includes(\'main.channels.fax\')}" data-ng-if="license.fax">\n        <a href="javascript:;">\n          <i class="icon-paper-plane"></i>\n          <span class="title"> {{ \'APPLICATION_FAX\' | translate}}</span>\n          <span class="arrow" data-ng-class="{ open: $state.includes(\'main.channels.fax\') }"></span>\n        </a>\n        <ul class="sub-menu">\n          <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.channels.fax.accounts\')}">\n            <a href="/channels/fax/accounts/list">\n              <i class="icon-notebook"></i>\n              <span class="title"> {{ \'APPLICATION_ACCOUNTS\' | translate}} </span>\n            </a>\n          </li>\n          <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.channels.fax.queues\')}">\n            <a href="/channels/fax/queues/list">\n              <i class="icon-docs"></i>\n              <span class="title"> {{ \'APPLICATION_QUEUES\' | translate }} </span>\n            </a>\n          </li>\n          <li data-ng-class="{active: $state.includes(\'main.channels.fax.inbox\')}">\n            <a href="/channels/fax/inbox/incoming">\n              <i class="icon-note"></i>\n              <span class="title"> {{ \'APPLICATION_INBOX\' | translate }} </span>\n            </a>\n          </li>\n          <!-- START REALTIME CASE -->\n          <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.channels.fax.realtime\')}">\n            <a href="/channels/fax/realtime/view/agents">\n              <i class="icon-energy"></i>\n              <span class="title">{{\'APPLICATION_REALTIME\' | translate}}</span>\n            </a>\n          </li>\n          <!-- END REALTIME CASE -->\n        </ul>\n      </li>\n      <!-- END FAX CASE -->\n    </ul>\n  </li>\n  <!-- END CHANNEL LIST CASE -->\n\n  <!-- START CALLYSQUARE CASE -->\n  <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.square\')}">\n    <a href="javascript:;">\n      <i class="fa fa-superscript"></i>\n      <span class="title" >{{\'APPLICATION_CALLYSQUARE\' | translate}}</span>\n      <span class="arrow"></span>\n    </a>\n    <ul class="sub-menu">\n      <li data-ng-class="{active: $state.includes(\'main.square.projects\')}">\n        <a href="/square/projects/list">\n          <i class="fa fa-slack"></i>\n          <span class="title" >{{\'APPLICATION_PROJECTS\' | translate}}  </span>\n        </a>\n      </li>\n      <li data-ng-class="{active: $state.includes(\'main.square.odbc\')}">\n        <a href="/square/odbc/list">\n          <i class="fa fa-database"></i>\n          <span class="title" >{{\'APPLICATION_ODBC\' | translate}}  </span>\n        </a>\n      </li>\n    </ul>\n  </li>\n  <!-- END CALLYSQUARE CASE -->\n\n  <!-- START ANALYTIC LIST CASE -->\n  <li data-ng-class="{active: $state.includes(\'main.analytics.reports\')\n  || $state.includes(\'main.analytics.extracted\')\n  || $state.includes(\'main.analytics.metrics\')}" data-ng-show="Auth.isAdmin()">\n  <a href="javascript:;">\n    <i class="icon-calculator"></i>\n    <span class="title" >{{\'APPLICATION_ANALYTICS\' | translate}}</span>\n    <span class="arrow" data-ng-class="{ open: $state.includes(\'main.analytics.reports\')\n    || $state.includes(\'main.analytics.extracted\')\n    || $state.includes(\'main.analytics.metrics\') }"></span>\n  </a>\n  <ul class="sub-menu">\n    <!-- START REPORT CASE -->\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.analytics.reports\')}">\n      <a href="/analytics/reports/list">\n        <i class="icon-book-open"></i>\n        <span class="title" >{{\'APPLICATION_REPORTS\' | translate}}</span>\n        <span data-ng-show="$state.includes(\'main.analytics.reports\')" class="selected"></span>\n      </a>\n    </li>\n    <!-- END REPORT CASE -->\n    <!-- START EXTRA REPORT CASE -->\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.analytics.extracted\')}">\n      <a href="/analytics/extracted/list">\n        <i class="fa fa-file-pdf-o"></i>\n        <span class="title" >{{\'APPLICATION_EXTRACTED_REPORTS\' | translate}}</span>\n        <span data-ng-show="$state.includes(\'main.analytics.extracted\')" class="selected"></span>\n      </a>\n    </li>\n    <!-- END EXTRA REPORT CASE -->\n    <!-- START METRICS CASE -->\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.analytics.metrics\')}">\n      <a href="/analytics/metrics/list">\n        <i class="icon-calculator"></i>\n        <span class="title" >{{\'APPLICATION_METRICS\' | translate}}</span>\n        <span data-ng-show="$state.includes(\'main.metrics.reports\')" class="selected"></span>\n      </a>\n    </li>\n    <!-- END METRICS CASE -->\n  </ul>\n</li>\n<!-- END ANALYTIC LIST CASE -->\n\n<!-- START TOOLS LIST CASE -->\n<li data-ng-class="{active: $state.includes(\'main.tools\') && !$state.is(\'main.tools.yourdashboards.show\')}" data-ng-show="Auth.isAdmin()">\n  <a href="javascript:;">\n    <i class="icon-wrench"></i>\n    <span class="title" >{{\'APPLICATION_TOOLS\' | translate}}</span>\n    <span class="arrow" data-ng-class="{ open: $state.includes(\'main.tools\') && !$state.is(\'main.tools.yourdashboards.show\')}"></span>\n  </a>\n  <ul class="sub-menu">\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.tools.triggers\')}">\n      <a href="/tools/triggers/list">\n        <i class="icon-bulb"></i>\n        <span class="title"> {{\'APPLICATION_TRIGGERS\' | translate}} </span>\n      </a>\n    </li>\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.tools.automations\')}">\n      <a href="/tools/automations/list">\n        <i class="icon-settings"></i>\n        <span class="title"> {{\'APPLICATION_AUTOMATIONS\' | translate}} </span>\n      </a>\n    </li>\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.tools.trunks\')}">\n      <a href="/tools/trunks/list">\n        <i class="icon-link"></i>\n        <span class="title"> {{\'APPLICATION_TRUNKS\' | translate}} </span>\n      </a>\n    </li>\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.tools.intervals\')}">\n      <a href="/tools/intervals/list">\n        <i class="icon-clock"></i>\n        <span class="title"> {{\'APPLICATION_INTERVALS\' | translate}} </span>\n      </a>\n    </li>\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.tools.variables\')}">\n      <a href="/tools/variables/list">\n        <i class="fa fa-eye"></i>\n        <span class="title" >{{\'APPLICATION_VARIABLES\' | translate}}  </span>\n      </a>\n    </li>\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.tools.tags\')}">\n      <a href="/tools/tags/list">\n        <i class="icon-tag"></i>\n        <span class="title" >{{\'APPLICATION_TAGS\' | translate}}  </span>\n      </a>\n    </li>\n    <!-- START TEMPLATE CASE -->\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.tools.templates\')}">\n      <a href="/tools/templates/list">\n        <i class="icon-docs"></i>\n        <span class="title"> {{\'APPLICATION_TEMPLATES\' | translate}} </span>\n      </a>\n    </li>\n    <!-- END TEMPLATE CASE -->\n\n    <!-- START PAUSE CASE -->\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.tools.pauses\')}">\n      <a href="/tools/pauses/list">\n        <i class="icon-control-pause"></i>\n        <span class="title"> {{\'APPLICATION_PAUSES\' | translate}} </span>\n      </a>\n    </li>\n    <!-- END PAUSE CASE -->\n    <!-- START ANSWER CASE -->\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.tools.answers\')}">\n      <a href="/tools/answers/list">\n        <i class="icon-magic-wand"></i>\n        <span class="title"> {{\'APPLICATION_CANNED_ANSWERS\' | translate}} </span>\n      </a>\n    </li>\n    <!-- END ANSWER CASE -->\n    <!-- START DASHBOARD MANAGER CASE -->\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.tools.yourdashboards\') && !$state.is(\'main.tools.yourdashboards.show\')}">\n      <a href="/tools/yourdashboards/list">\n        <i class="icon-grid"></i>\n        <span class="title"> {{\'APPLICATION_DASHBOARDS_MANAGER\' | translate}} </span>\n      </a>\n    </li>\n    <!-- END DASHBOARD MANAGER CASE -->\n    <!-- START SOUND CASE -->\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.tools.sounds\')}">\n      <a href="/tools/sounds/list">\n        <i class="icon-music-tone-alt"></i>\n        <span class="title" >{{\'APPLICATION_SOUNDS\' | translate}}</span>\n        <!-- <span data-ng-show="$state.includes(\'main.sounds\')" class="selected"></span> -->\n      </a>\n    </li>\n    <!-- END SOUND CASE -->\n  </ul>\n</li>\n<!-- END TOOLS LIST CASE -->\n\n<!-- START JSCRIPTY LIST -->\n<li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.jscripty\')}">\n  <a href="javascript:;">\n    <i class="icon-note"></i>\n    <span class="title" >{{\'APPLICATION_JSCRIPTY\' | translate}} <span class="badge">Beta</span></span>\n    <span class="arrow"></span>\n  </a>\n  <ul class="sub-menu">\n    <!-- START PROJECTS CASE -->\n    <li data-ng-class="{active: $state.includes(\'main.jscripty.projects\')}">\n      <a href="/jscripty/projects/list">\n        <i class="fa fa-slack"></i>\n        <span class="title" >{{\'APPLICATION_PROJECTS\' | translate}} </span>\n      </a>\n    </li>\n    <!-- END PROJECTS CASE -->\n  </ul>\n</li>\n<!-- END JSCRIPTY LIST -->\n\n<!-- START SETTINGS LIST -->\n<li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.setting\')}">\n  <a href="javascript:;">\n    <i class="icon-settings"></i>\n    <span class="title" >{{\'APPLICATION_SETTINGS\' | translate}}</span>\n    <span class="arrow"></span>\n  </a>\n  <ul class="sub-menu">\n    <!-- START UPDATES CASE -->\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.setting.updates\')}">\n      <a href="/setting/updates/list">\n        <i class="icon-cloud-download"></i>\n        <span class="title" >{{\'APPLICATION_UPDATES\' | translate}}</span>\n        <!-- <span data-ng-show="$state.includes(\'main.updates\')" class="selected"></span> -->\n      </a>\n    </li>\n    <!-- END UPDATES CASE -->\n\n    <!-- START SMTP CASE -->\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.setting.smtp\')}">\n      <a href="/setting/smtp/view">\n        <i class="icon-envelope"></i>\n        <span class="title">SMTP</span>\n        <!-- <span data-ng-show="$state.includes(\'main.smtp\')" class="selected"></span> -->\n      </a>\n    </li>\n    <!-- END SMTP CASE -->\n\n    <!-- START LICENSE CASE -->\n    <li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.setting.license\')}">\n      <a href="/setting/license/view">\n        <i class="icon-info"></i>\n        <span class="title"> {{\'APPLICATION_LICENSE\' | translate}} </span>\n      </a>\n    </li>\n    <!-- END LICENSE CASE -->\n  </ul>\n</li>\n<!-- END SETTINGS LIST -->\n\n<!-- START INTEGRATION CASE -->\n<li data-ng-repeat="integration in integrations" data-ng-if="integration.active" data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.includes(\'main.{{integration.state}}\')}">\n  <a href="/{{integration.state}}/list">\n    <i class="icon-handbag"></i>\n    <span class="title" >{{integration.name}}</span>\n    <span data-ng-show="$state.includes(\'main.{{integration.state}}\')" class="selected"></span>\n  </a>\n</li>\n\n<li data-ng-show="Auth.isAdmin()" data-ng-class="{active: $state.is(\'main.market\')}">\n  <a href="/market">\n    <i class="icon-handbag"></i>\n    <span class="title" translate>Market Place</span>\n    <span data-ng-show="$state.includes(\'main.market\')" class="selected"></span>\n  </a>\n</li>\n<!-- END INTEGRATIONS CASE -->\n\n</ul>\n<!-- END SIDEBAR MENU -->\n</div>\n');
-}]);
\ No newline at end of file
diff --git a/public/index.html b/public/index.html
index 2f59a32..f25e8d7 100644
--- a/public/index.html
+++ b/public/index.html
@@ -61,7 +61,7 @@
     <![endif]-->
     <script src="app/47e08aab.vendor.js"></script>
 
-    <script src="app/7f4f3cd9.app.js"></script>
+    <script src="app/3d92426c.app.js"></script>
 
     <!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
     <!-- BEGIN CORE PLUGINS -->
diff --git a/release-notes/changelog_0.0.70.txt b/release-notes/changelog_0.0.70.txt
index 7641e52..a525683 100644
--- a/release-notes/changelog_0.0.70.txt
+++ b/release-notes/changelog_0.0.70.txt
@@ -1,5 +1,6 @@
 # xCALLY MOTION Changelog
 
+- * 2bba9b4 - 2016-03-23: sever side api mail_message + update 
 - * 24f07e3 - 2016-03-23: test commit 
 - * eaa59f6 - 2016-03-23: client app setting update 
 - * 35d5dba - 2016-03-23: client side app mail account 
@@ -59,5 +60,4 @@
 - * 5fd994a - 2016-03-16: delete chanspy.js 
 - * db7e0ed - 2016-03-16: Added queueStatus filter for voice realtime 
 - * c7cb7eb - 2016-03-16: add complete and abandon fields for report chat 
-- * c26b760 - 2016-03-16: Added queue and queuestatus for voice realtime 
 
diff --git a/server/api/mail_message/mail_message.controller.js b/server/api/mail_message/mail_message.controller.js
index 0105703..e72dfc8 100644
--- a/server/api/mail_message/mail_message.controller.js
+++ b/server/api/mail_message/mail_message.controller.js
@@ -77,29 +77,21 @@ exports.create = function(req, res, next) {
     wordwrap: false
   });
 
-  return sequelize.transaction().then(function(t) {
-    return MailMessage
-      .create(req.body, {
-        include: [{
-          model: MailAttachment
-        }],
-        transaction: t,
-        // user: req.user
-      }).then(function(mailMessage) {
-        t.commit();
-        return res.status(201).send(mailMessage);
-      }).catch(function(err) {
-        console.error(err);
-        t.rollback();
-        return handleError(res, err);
-      });
-  });
+  return MailMessage
+    .create(req.body, {
+      include: [{
+        model: MailAttachment
+      }]
+    }).then(function(mailMessage) {
+      return res.status(201).send(mailMessage);
+    }).catch(function(err) {
+      return handleError(res, err);
+    });
 };
 
 // Updates an existing mailMessage in the DB.
 exports.update = function(req, res, next) {
-
-  MailMessage
+  return MailMessage
     .findById(req.params.id, {
       include: [{
         all: true
@@ -110,13 +102,11 @@ exports.update = function(req, res, next) {
         return res.sendStatus(404);
       }
       var updated = _.merge(mailMessage, req.body);
-      updated.save()
-        .then(function() {
-          return res.status(200).send(updated);
-        })
-        .catch(function(err) {
-          return handleError(res, err, next);
-        });
+      return updated
+        .save();
+    })
+    .then(function(updated) {
+      return res.status(200).send(updated);
     })
     .catch(function(err) {
       return handleError(res, err, next);
@@ -125,19 +115,16 @@ exports.update = function(req, res, next) {
 
 // Deletes a mailMessage from the DB.
 exports.destroy = function(req, res, next) {
-  MailMessage
+  return MailMessage
     .findById(req.params.id)
     .then(function(mailMessage) {
       if (!mailMessage) {
         return res.sendStatus(404);
       }
-      mailMessage.destroy()
-        .then(function() {
-          return res.sendStatus(204);
-        })
-        .catch(function(err) {
-          return handleError(res, err, next);
-        });
+      return mailMessage
+        .destroy();
+    }).then(function() {
+      return res.sendStatus(204);
     })
     .catch(function(err) {
       return handleError(res, err, next);
@@ -146,7 +133,7 @@ exports.destroy = function(req, res, next) {
 
 // Deletes a mailMessage from the DB.
 exports.bulkDelete = function(req, res, next) {
-  MailMessage
+  return MailMessage
     .bulkUpdate({
       where: {
         id: {
@@ -161,13 +148,11 @@ exports.bulkDelete = function(req, res, next) {
       if (!mailMessage) {
         return res.sendStatus(404);
       }
-      mailMessage.destroy()
-        .then(function() {
-          return res.sendStatus(204);
-        })
-        .catch(function(err) {
-          return handleError(res, err, next);
-        });
+      return mailMessage
+        .destroy();
+    })
+    .then(function() {
+      return res.sendStatus(204);
     })
     .catch(function(err) {
       return handleError(res, err, next);
diff --git a/server/api/update/update.controller.js b/server/api/update/update.controller.js
index e93190b..2d53008 100644
--- a/server/api/update/update.controller.js
+++ b/server/api/update/update.controller.js
@@ -37,7 +37,7 @@ exports.index = function(req, res) {
 // Get a single update
 exports.pull = function(req, res) {
   return Git
-    .pull('origin', 'develop', function(err, data) {
+    .pull('origin', 'test', function(err, data) {
       console.log('data', data);
       if (err) {
         console.error('err', err);
-- 
1.7.1