1 import { USED_CLIENT_FLAGS } from '../interfaces';
2 import { hasBitBigInt } from './bitset';
29 } = USED_CLIENT_FLAGS;
31 const isWebDriveUser = (usedClientFlags: bigint) => hasBitBigInt(usedClientFlags, WEB_DRIVE);
32 const isAndroidDriveUser = (usedClientFlags: bigint) => hasBitBigInt(usedClientFlags, ANDROID_DRIVE);
33 const isIOSDriveUser = (usedClientFlags: bigint) => hasBitBigInt(usedClientFlags, IOS_DRIVE);
34 const isDesktopDriveUser = (usedClientFlags: bigint) =>
35 hasBitBigInt(usedClientFlags, WINDOWS_DRIVE) || hasBitBigInt(usedClientFlags, MACOS_DRIVE);
37 const isWebPassUser = (usedClientFlags: bigint) => hasBitBigInt(usedClientFlags, WEB_PASS);
38 const isAndroidPassUser = (usedClientFlags: bigint) => hasBitBigInt(usedClientFlags, ANDROID_PASS);
39 const isIOSPassUser = (usedClientFlags: bigint) => hasBitBigInt(usedClientFlags, IOS_PASS);
40 const isDesktopPassUser = (usedClientFlags: bigint) =>
41 hasBitBigInt(usedClientFlags, WINDOWS_PASS) ||
42 hasBitBigInt(usedClientFlags, LINUX_PASS) ||
43 hasBitBigInt(usedClientFlags, MACOS_PASS);
45 const isWebVPNUser = (usedClientFlags: bigint) =>
46 hasBitBigInt(usedClientFlags, WEB_VPN) ||
47 hasBitBigInt(usedClientFlags, WEB_VPN_SETTINGS) ||
48 hasBitBigInt(usedClientFlags, BROWSER_VPN);
49 const isAndroidVPNUser = (usedClientFlags: bigint) =>
50 hasBitBigInt(usedClientFlags, ANDROID_VPN) || hasBitBigInt(usedClientFlags, ANDROID_TV_VPN);
51 const isIOSVPNUser = (usedClientFlags: bigint) =>
52 hasBitBigInt(usedClientFlags, IOS_VPN) || hasBitBigInt(usedClientFlags, APPLE_TV_VPN);
53 const isDesktopVPNUser = (usedClientFlags: bigint) =>
54 hasBitBigInt(usedClientFlags, WINDOWS_VPN) ||
55 hasBitBigInt(usedClientFlags, LINUX_VPN) ||
56 hasBitBigInt(usedClientFlags, MACOS_VPN);
58 export const isDesktopInboxUser = (usedClientFlags: bigint) => {
60 hasBitBigInt(usedClientFlags, WINDOWS_INBOX) ||
61 hasBitBigInt(usedClientFlags, LINUX_INBOX) ||
62 hasBitBigInt(usedClientFlags, MACOS_INBOX)
66 export const isDriveUser = (usedClientFlags: bigint) => {
68 isWebDriveUser(usedClientFlags) ||
69 isAndroidDriveUser(usedClientFlags) ||
70 isIOSDriveUser(usedClientFlags) ||
71 isDesktopDriveUser(usedClientFlags)
75 export const isPassUser = (usedClientFlags: bigint) => {
77 isWebPassUser(usedClientFlags) ||
78 isAndroidPassUser(usedClientFlags) ||
79 isIOSPassUser(usedClientFlags) ||
80 isDesktopPassUser(usedClientFlags)
84 export const isVPNUser = (usedClientFlags: bigint) => {
86 isWebVPNUser(usedClientFlags) ||
87 isAndroidVPNUser(usedClientFlags) ||
88 isIOSVPNUser(usedClientFlags) ||
89 isDesktopVPNUser(usedClientFlags)