/**
 * @description
 * Validator function that checks if a form control value exceeds a specified byte length.
 * Measures actual byte size using UTF-8 encoding rather than character count.
 * Useful for validating input against database column byte limits or API payload size restrictions.
 * Returns validation error when encoded byte length exceeds the specified limit.
 * @param bytes - Maximum allowed byte length for the control value
 * @returns ValidatorFn that returns null if valid, or ValidationErrors object with maxLengthBytes error containing required and actual byte counts
 */
const maxLengthBytes = (bytes) => {
    return (control) => {
        const length = new TextEncoder().encode(control.value).length;
        if (length > bytes) {
            return {
                maxLengthBytes: {
                    required: bytes,
                    actual: length,
                },
            };
        }
        return null;
    };
};

/**
 * Generated bundle index. Do not edit.
 */

export { maxLengthBytes };
//# sourceMappingURL=eui-components-validators.mjs.map
