(()=>{function r(t,e,n,l,o){var a=this,s={inProgress:!1,progress:0,label:null};function i(r){s.inProgress=r,a.wizardCtrl.setAllowUserInteraction(!r)}function u(r,e){return l.upload(r.file).progress(function(r){var t;(t=s.multipleProgress)[e]=10+r.loaded/r.total*90,s.progress=_.sum(t)/t.length}).then(n.getResData)}function c(r){s.progress=100,a.wizardCtrl.data.updloadResult=r.reduce(function(e,r){return _.forEach(r,function(r,t){e[t]=_.get(e,t,[]).concat(r)}),e},{}),e(_.partial(a.wizardCtrl.goTo,"c8yLwm2mFinalStep"),200)}function g(r){var r=r.data,t=a.wizardCtrl,e=t.data;e.errorMsg=_.get(r,"message")||o("Parsing the DDF file resulted in an internal error"),e.backStep=t.getCurrentStep().stepId,t.goTo("error")}function p(){i(!1)}_.assign(a,{upload:function(r){i(!0),s.progress=0,s.multipleProgress=_.fill(Array(r.length),0);r=_.map(r,u);return t.all(r).then(c,g).then(p,p)},processingStatus:s})}r.$inject=["$q","$timeout","c8yBase","c8yLwm2m","gettext"],angular.module("c8y.lwm2m").component("c8yLwm2mUploadStep",{templateUrl:":::PLUGIN_PATH:::/lwm2mUploadStep.html",require:{wizardCtrl:"^c8yWizardStep"},controllerAs:"vm",controller:r})})();