import L from "validator/lib/isEmpty.js";
import { z as T } from "zod";
import { CommonValidationErrorType as r, ThrownErrorType as u } from "./accelbyte-widgets341.mjs";
import { MAX_SHORT_TEXT_LENGTH as h } from "./accelbyte-widgets339.mjs";
const i = T.enum([
  r.enum.empty,
  r.enum.lessThanLengthLimit,
  r.enum.exceedLengthLimit
]), E = h, M = (n, { min: t = 1, max: e = E, isRequired: o = !0 } = {}) => {
  const m = t < 0, p = e < 0, s = e < t;
  if (m || p || s)
    throw new Error(u.enum.invalidOption);
  return L(n) ? o ? i.enum.empty : null : n && n.length < t ? i.enum.lessThanLengthLimit : n && n.length > e ? i.enum.exceedLengthLimit : null;
};
export {
  E as VALIDATE_LENGTH_DEFAULT_MAX_LENGTH,
  i as ValidateLengthErrorType,
  M as validateLength
};
