import * as r from "yup";
function l(o, t, i, n) {
  const c = o.fieldType.componentId;
  if (i instanceof r.ArraySchema)
    return t.required(n).min(1, n);
  if (i instanceof r.ObjectSchema) {
    const d = t;
    return c === "RHFDateRangePicker" ? d.required(n).test("date-range-required", n, (u) => {
      if (u == null)
        return !1;
      const e = u.start, f = u.end;
      return e != null && f !== void 0 && f !== null;
    }) : d.required(n);
  }
  return i instanceof r.StringSchema ? t.nullable().required(n) : (i instanceof r.NumberSchema || i instanceof r.MixedSchema, t.required(n));
}
export {
  l as applyRequiredValidation
};
