(()=>{function s(e,s){var i,r=this;function n(){r.scopedPermissions=_.filter(r.permissions,{scope:r.scope})}function o(){r.permissionsListForm.$setDirty()}_.assign(r,{$onChanges:function(s){s.permissions&&(i&&i(),i=e.$watchCollection(_.constant(r.permissions),n))},accessTypes:s.ACCESS_TYPES,add:function(){r.permissions.push({scope:r.scope,permission:r.accessTypes.READ.value,type:"*"}),o()},remove:function(s){_.remove(r.permissions,s),o()},removeId:function(s){delete s.id},isOverridden:function(n){var s=r.permissions,e=r.scopedPermissions,o=["type","permission","scope"],s=_.find(_.without(s,n),function(i){return _.every(o,function(s){var e=_.matchesProperty(s,_.get(n,s)),s=_.matchesProperty(s,"*");return e(i)||s(i)})});return s&&(!_.matches(_.pick(n,o))(s)||_.indexOf(e,n)>_.indexOf(e,s))}})}s.$inject=["$scope","c8yPermissions"],angular.module("c8y.roles").component("c8yRoleInventoryPermissionList",{templateUrl:":::PLUGIN_PATH:::/detail/roleInventoryPermissionList.html",bindings:{permissions:"<",scope:"<"},controllerAs:"vm",controller:s})})();