(()=>{function e(n,s,i,t,e){var r,c=this;_.assign(c,{$onInit:function(){var e;c.currentGroup.id&&(e=s.all([t.childAssets(c.currentGroup),t.childDevices(c.currentGroup)]).then(function(e){(r=[]).push(e[0]),r.push(e[1]),r=_.flattenDeep(r),n.alreadyAssignedDevices=r}));return e},currentGroup:c.resolve.currentGroup}),n.title=e("Assign devices"),n.assign=function(e){var n=s.when();_.forEach(e,function(e){n=n.then(_.partial(i.addChildAsset,c.currentGroup,e)).then(function(){r.push(e)})}),n.then(function(){e.length=0}).then(c.close)},n.isDevice=t.isDevice,n.dismiss=c.dismiss}e.$inject=["$scope","$q","c8yInventory","c8yDevices","gettext"],angular.module("c8y.ui").component("c8yGroupDeviceAssignmentModal",{templateUrl:":::PLUGIN_PATH:::/ui/groups/views/group-device-assignment.html",controller:e,controllerAs:"vm",bindings:{resolve:"<",dismiss:"&",close:"&"}})})();