angular.module("c8y.assets").directive("c8ySort",function(){return{restrict:"E",templateUrl:":::PLUGIN_PATH:::/views/sort2.html",require:"^c8ySortGroup",link:function(t,i,n,r){var c,i=i.parent(),o={color:"#000"};function e(i){var n="".concat(i,"Action");c=i,t.upCss=null,t.downCss=t.upCss,t["".concat(i,"Css")]=o,t.visibility="visible",t[n]&&t[n]()}i.css({cursor:"pointer"}).on("click",function(i){var n;i.preventDefault(),n="down"===c?"up":"down",t.$apply(function(){r.click(t),e(n)})}),t.sort=e,t.visibility="hidden",t.otherClicked=function(){c=null,t.visibility="hidden"},r.add(t)},scope:{downAction:"&",upAction:"&"}}}).directive("c8ySortGroup",function(){return{restrict:"A",controller:function(){var t=[];return{add:function(i){t.push(i)},click:function(n){_(t).filter(function(i){return i!==n}).invokeMap("otherClicked").value()}}}}});