(()=>{function n(e,t,o,n){var i=this,s=e.emptyListLabel||n("Nothing found."),c=(_.assign(i,{isConfigurable:function(n){return!e.disableColumnsConfig()&&o.isConfigurable(n)},isFiltered:function(n){return o.isFiltered(n,i.columnsConfig[n.name])},isSortedAscending:function(n){return o.isSortedAscending(n,i.columnsConfig[n.name])},isSortedDescending:function(n){return o.isSortedDescending(n,i.columnsConfig[n.name])},configureColumn:function(n){return o.configureColumnWithUI(n).then(u)},getNoItemsMessage:function(){return e.noItemsMessage()||n("No items to display.")},onItemClick:function(n){e.onItemClick&&e.onItemClick({item:n})},emptyListLabel:s,areItemsAndFiltersLoaded:function(){return i.items&&i.columnsConfig},areNoItemsAvailable:function(){return r()&&!_.isUndefined(i.columnsConfig)&&_.isEmpty(i.columnsConfig)},isFilteredItemsListEmpty:r}),"filtered-sorted-list-".concat(e.$id,"-row-template.html")),s=_.throttle(function(){e.$applyAsync(function(){var n;i.columnsConfig=e.columnsConfig()||{},i.columns=o.getColumns(e.columns(),i.columnsConfig),(n=_(i.columns).flatMap(function(n){_.merge(e,n.cell.scopeExtensions);var t=n.cell.templateUrl?'<ng-include src="'.concat(n.cell.templateUrl,'"></ng-include>'):n.cell.template;return["<td",l(n.cell.class),">",'  <div style="max-width:240px;" class="text-truncate"',l(n.cell.innerClass),">","    ",t,"  </div>","</td>"]}).join(" "))&&(t.put(c,n),i.ROW_TEMPLATE_KEY=c)})},200);function l(n){var t="class",e="";return n&&(e+="ng-".concat(t,"='"),_.isString(n)?e+=n:_.isPlainObject(n)&&(e+=JSON.stringify(n)),e+="'"),e}function u(n){i.columnsConfig[n.name]=n.config,n=i.columnsConfig,e.onColumnsConfigChanged({columnsConfig:n})}function r(){return i.items&&!i.items.length}e.loadNext=function(){e.onLoadMore()},e.$watch("columns()",s,!0),e.$watch("columnsConfig()",s,!0),e.$watch("items()",function(n){i.items=n},!0),e.$watch("showLoadMore()",function(){var n={next:_.noop};e.paging=e.showLoadMore()?n:{}}),e.$watch("loading()",function(n){e.paging&&(e.paging.loading=n)}),e.$on("$destroy",function(){t.remove(c)})}n.$inject=["$scope","$templateCache","c8yFilteringSortingColumns","gettext"],angular.module("c8y.ui").controller("c8yFilteredSortedListCtrl",n)})();