function binaryArtefactsListCtrl(t,n,i,e,a,r,o){var l=[];function s(e){t.files&&!t.refreshLoading||(t.files=[]),t.paging=e.paging,e.forEach(function(e){e.icon=a.icon(e),t.files.push(e)})}function c(){e.changeTitle({title:r("Files repository")})}function f(){t.refreshLoading=!0,t.paging.refresh().then(s).finally(function(){t.refreshLoading=!1})}function g(e){return l.indexOf(e)}function u(e){return-1<g(e)}t.loadNext=function(){t.paging.loading=!0,t.paging.next().then(s).finally(function(){t.paging.loading=!1})},t.refresh=f,t.toggle=function(e){var t;u(e)?l.splice(g(e),1):(l.push(e),t=e,a.isImage(t)&&!t.dataUri&&a.downloadAsDataUri(t).then(function(e){t.dataUri=e}))},t.isOpen=u,t.onClickDelete=function(e){n({title:r("Delete file"),body:o.getString('You are about to delete file "{{ name }}". Do you want to proceed?',e),status:"danger",labels:{ok:r("Delete")}}).then(angular.bind(a,a.removeBinary,e)).then(angular.bind(i,i.removeFromList,t.files,e))},t.upload=function(){n({templateUrl:":::PLUGIN_PATH:::/views/upload.html",controller:"binaryArtefactsUploadCtrl",title:r("Upload files"),backdrop:"static"}).then(f)},t.size=a.size,t.isImage=a.isImage,t.popoverTemplateUrl=":::PLUGIN_PATH:::/views/popover.html",t.isApplicationBinary=function(e){return _.has(e,"c8y_applications_storage")},a.list(void 0).then(s).then(c)}binaryArtefactsListCtrl.$inject=["$scope","c8yModal","c8yBase","c8yTitle","c8yBinary","gettext","gettextCatalog"],angular.module("c8y.binaryArtefactsManagement").controller("binaryArtefactsListCtrl",binaryArtefactsListCtrl);