angular.module("c8y.assets").controller("RendererButtonConfigCtrl",["$scope","$uibModalInstance","$q","c8yDeviceShell","config","gettext","gettextCatalog",function(t,e,o,n,i,c,a){var r=[],d=i.deviceTypes||[];function s(e){r.length=0,_.forEach(e,function(e){r.push({name:a.getString(e.name),text:e.command,category:a.getString(e.category),deviceType:e.deviceType})})}function m(e,t){e={description:e,c8y_Command:{text:t}},i.args=[e]}function g(e){t.showEditor=void 0!==e?e:!t.showEditor}t.showEditor=!1,t.config=i,t.commandTemplates=r,t.chooseOperation=function(e){g(!0),m(e.name,e.text)},t.close=function(){e.close(i)},t.expandTooltip=function(){return t.showEditor?c("Click to hide command editor"):c("Click to view command editor")},t.expandIcon=function(){return t.showEditor?"caret-square-o-up":"caret-square-o-down"},t.toggleEditor=g,t.dismiss=e.dismiss,t.data={},i.args&&i.args.length||m(a.getString("Command description"),"<command>"),(()=>{var t=[];_.map(d,function(e){t.push(n.getCommandTemplatesForDeviceType(e).then(_.identity,function(){return[]}))}),o.all(t).then(_.flattenDeep).then(s)})()}]);