(()=>{function e(e,n,r,t,o){var s=this;function l(n){return function(e){s.onChangeUser({user:e,action:n})}}function a(){return!(!s.searchFilter&&!_.get(s.globalRolesFilter,"length",0))}function i(e){return s.FEATURE_USER_HIERARCHY&&s.currentUserId&&e.id!==s.currentUserId}_.assign(s,{$onInit:function(){e.all({twoFactorAuthAvailable:t.isTfaAvailable(),totpStrategy:r.getTfaStrategy()}).then(function(e){return _.assign(s,e)}),t.userHierarchyActive().then(function(e){s.FEATURE_USER_HIERARCHY=e}),r.current().then(function(e){s.currentUserId=_.get(e,"id")}),o.isSsoClearingUserRolesOnEveryLogin().then(function(e){s.userCanEditRoles=!e})},$onChanges:function(e){e.users&&s.users&&(s.userFlatTree=t.createUserFlatTree(s.users),n.paging=s.users.paging,n.loadNext=function(){return s.onLoadMore()})},searchOn:a,fullName:t.fullName,toggleExpanded:function(e){e._expanded||s.onLoadSubusers({user:e});t.toggleExpanded(e)},visible:function(e){return!!a()||t.visibleInList(e)},detailLink:t.detailLink,editUser:t.editUser,mapRolesForUser:_.memoize(function(e){return _.map(e,"group")}),changeGlobalRoles:function(e,n){s.onChangeUser({user:e,action:{name:"changeGlobalRoles",data:{roles:n}}})},copyInventoryRoles:l("copyInventoryRoles"),disable:l("disable"),enable:l("enable"),remove:l("remove"),delegate:l("delegate"),removeDelegate:l("removeDelegate"),getPasswordStrength:t.getPasswordStrength,getPasswordColor:t.getPasswordColor,getPasswordIcon:t.getPasswordIcon,showDelegate:function(e){return i(e)&&!e.delegatedBy},showUndelegate:function(e){return i(e)&&e.delegatedBy},globalRolesAvailable:function(e){return _.get(e,"_owner._globalRoles",s.globalRoles)},isUndeletable:t.isUndeletable,isCurrent:t.isCurrent,shouldDisableGlobalRolesSelector:function(e){return!s.userCanEditRoles&&r.hasExternalOrigin(e)},editGlobalRolesForUserWithExternalOrigin:t.EXTERNAL_ORIGIN_TEXT_FOR_USERS_LIST_VIEW,hasExternalOrigin:r.hasExternalOrigin})}e.$inject=["$q","$scope","c8yUser","c8yUsersUi","c8yLoginOptions"],angular.module("c8y.users").component("c8yUserList",{bindings:{users:"<",globalRoles:"<",searchFilter:"<",globalRolesFilter:"<",onChangeUser:"&",onLoadSubusers:"&",onLoadMore:"&"},templateUrl:":::PLUGIN_PATH:::/userList/userList.html",controller:e,controllerAs:"vm"})})();