// Mirrors the backend's own USt-IdNr. validation exactly (Orders.ts/ // Customers.ts/CompanySettings.ts in the Payload repo) — kept as a plain // client+server-safe helper here since this repo's frontend needs the same // check twice (checkout's instant client-side pattern + api/checkout's own // server-side re-validation, same "never trust the client" reasoning as // every other checkout field). const VAT_ID_PATTERN = /^[A-Z]{2}[A-Z0-9]{2,12}$/; export function normalizeVatId(value: string): string { return value.toUpperCase().trim(); } export function isValidVatId(value: string): boolean { return VAT_ID_PATTERN.test(value); }