angular.module("c8y.parts.appArchives").controller("ArchivesUploadCtrl",["$scope","$q","$uibModalInstance","c8yApplication","app",function(e,l,o,r,i){e.uploading=!1,e.uploadProgress=0,e.allowMultipleFiles=!1,e.filesRequired=!0,e.files=[],e.upload=function(){if(e.uploading)return l.reject();e.uploading=!0;var a=_(e.files).map("file").map(_.partial(r.uploadArchive,i)).value();return _.forEach(a,function(o){o.progress(function(l){o.uploadProgress=l.loaded/l.total,e.uploadProgress=_(a).map("uploadProgress").reduce(function(l,o){return l+o})/a.length})}),l.all(a).then(o.close).finally(function(){e.uploadProgress=100,e.uploading=!1})},e.dismiss=o.dismiss}]);