export const USER_FILTER_MIN_USERS=0x6;function normalizeText(_0x2830ac){return String(_0x2830ac??'')['trim']()['toLowerCase']();}function normalizeAccessFilter(_0x5b20e7){const _0x1f6b5d=normalizeText(_0x5b20e7);return _0x1f6b5d||'all';}export function canFilterUsers(_0x204129){return Array['isArray'](_0x204129)&&_0x204129['length']>=USER_FILTER_MIN_USERS;}export function hasActiveUserFilters(_0x382b95={}){return Boolean(normalizeText(_0x382b95['search']))||normalizeAccessFilter(_0x382b95['access'])!=='all';}export function userMatchesAccessFilter(_0x1c672c,_0x501ef8='all'){switch(normalizeAccessFilter(_0x501ef8)){case'server-admin':return Boolean(_0x1c672c?.['isServerAdmin']);case'user-binding':return Boolean(_0x1c672c?.['hasUserBinding']);case'team-binding':return Boolean(_0x1c672c?.['hasTeamBinding']);case'no-access':return!_0x1c672c?.['isServerAdmin']&&!_0x1c672c?.['hasUserBinding']&&!_0x1c672c?.['hasTeamBinding'];case'all':default:return!![];}}export function userMatchesSearch(_0x3f0231,_0x2f86c4=''){const _0x31dd07=normalizeText(_0x2f86c4)['split'](/\s+/)['filter'](Boolean);if(_0x31dd07['length']===0x0)return!![];const _0x3ac6de=[_0x3f0231?.['username'],_0x3f0231?.['name'],_0x3f0231?.['email']]['map'](normalizeText)['join']('\x20');return _0x31dd07['every'](_0x4e26f2=>_0x3ac6de['includes'](_0x4e26f2));}export function filterUsers(_0x380d08,_0xeb4e02={},_0x4fc94d={}){const _0x31dcd0=Array['isArray'](_0x380d08)?_0x380d08:[],_0x26f4fb=_0x4fc94d['requireThreshold']!==![];if(_0x26f4fb&&!canFilterUsers(_0x31dcd0))return _0x31dcd0;return _0x31dcd0['filter'](_0x1a2a2c=>userMatchesSearch(_0x1a2a2c,_0xeb4e02['search'])&&userMatchesAccessFilter(_0x1a2a2c,_0xeb4e02['access']));}