(()=>{function t(t,e,a,n,o,l,r,s){var c=this;function i(){return c.loading=!0,a.list().then(function(t){c.templates=t}).finally(function(){c.loading=!1})}function m(t){e.path("/smart-rest-templates/".concat(t.id))}c.$onInit=function(){l.changeTitle({title:r("SmartREST templates")}),i()},c.loadList=i,c.detail=m,c.download=function(t){return a.download(t)},c.remove=function(t){return o({title:r("Delete SmartREST template"),body:s.getString('You are about to delete SmartREST template "{{name}}". Do you want to proceed?',t),labels:{ok:r("Delete")},status:"danger"}).then(angular.bind(a,a.remove,t)).then(i).then(_.partial(n.success,r("SmartREST template deleted.")))},c.onTemplateAdded=function(t){n.success(r("SmartREST template created.")),m(t)},c.onTemplateImported=function(){return i().then(_.partial(n.success,r("SmartREST template imported.")))},c.countRequestTemplates=a.countRequestTemplates,c.countResponseTemplates=a.countResponseTemplates}t.$inject=["$routeParams","$location","c8ySmartRestTemplates","c8yAlert","c8yModal","c8yTitle","gettext","gettextCatalog"],angular.module("c8y.smartRestEditor").controller("SmartRestListCtrl",t)})();