import { ROLE_LABELS_DE } from "@/components/admin/users/usersUi";

export const CREATE_ROLE_OPTIONS = Object.freeze([
	{ value: "branch", label: ROLE_LABELS_DE.branch },
	{ value: "admin", label: ROLE_LABELS_DE.admin },
	{ value: "superadmin", label: ROLE_LABELS_DE.superadmin },
	{ value: "dev", label: ROLE_LABELS_DE.dev },
]);

export const EMAIL_RE = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
export const BRANCH_RE = /^NL\d+$/;

export function normalizeUsername(value) {
	return String(value || "")
		.trim()
		.toLowerCase();
}

export function normalizeEmail(value) {
	return String(value || "")
		.trim()
		.toLowerCase();
}
