const Tt = Object.freeze({
  status: "aborted"
});
function c(t, e, n) {
  function r(a, u) {
    var f;
    Object.defineProperty(a, "_zod", {
      value: a._zod ?? {},
      enumerable: !1
    }), (f = a._zod).traits ?? (f.traits = /* @__PURE__ */ new Set()), a._zod.traits.add(t), e(a, u);
    for (const z in i.prototype)
      z in a || Object.defineProperty(a, z, { value: i.prototype[z].bind(a) });
    a._zod.constr = i, a._zod.def = u;
  }
  const o = n?.Parent ?? Object;
  class s extends o {
  }
  Object.defineProperty(s, "name", { value: t });
  function i(a) {
    var u;
    const f = n?.Parent ? new s() : this;
    r(f, a), (u = f._zod).deferred ?? (u.deferred = []);
    for (const z of f._zod.deferred)
      z();
    return f;
  }
  return Object.defineProperty(i, "init", { value: r }), Object.defineProperty(i, Symbol.hasInstance, {
    value: (a) => n?.Parent && a instanceof n.Parent ? !0 : a?._zod?.traits?.has(t)
  }), Object.defineProperty(i, "name", { value: t }), i;
}
class C extends Error {
  constructor() {
    super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
  }
}
const de = {};
function x(t) {
  return de;
}
function ye(t) {
  const e = Object.values(t).filter((r) => typeof r == "number");
  return Object.entries(t).filter(([r, o]) => e.indexOf(+r) === -1).map(([r, o]) => o);
}
function Ae(t, e) {
  return typeof e == "bigint" ? e.toString() : e;
}
function H(t) {
  return {
    get value() {
      {
        const e = t();
        return Object.defineProperty(this, "value", { value: e }), e;
      }
    }
  };
}
function Y(t) {
  return t == null;
}
function q(t) {
  const e = t.startsWith("^") ? 1 : 0, n = t.endsWith("$") ? t.length - 1 : t.length;
  return t.slice(e, n);
}
function Ee(t, e) {
  const n = (t.toString().split(".")[1] || "").length, r = (e.toString().split(".")[1] || "").length, o = n > r ? n : r, s = Number.parseInt(t.toFixed(o).replace(".", "")), i = Number.parseInt(e.toFixed(o).replace(".", ""));
  return s % i / 10 ** o;
}
function m(t, e, n) {
  Object.defineProperty(t, e, {
    get() {
      {
        const r = n();
        return t[e] = r, r;
      }
    },
    set(r) {
      Object.defineProperty(t, e, {
        value: r
        // configurable: true,
      });
    },
    configurable: !0
  });
}
function me(t, e, n) {
  Object.defineProperty(t, e, {
    value: n,
    writable: !0,
    enumerable: !0,
    configurable: !0
  });
}
function j(t) {
  return JSON.stringify(t);
}
const _e = Error.captureStackTrace ? Error.captureStackTrace : (...t) => {
};
function D(t) {
  return typeof t == "object" && t !== null && !Array.isArray(t);
}
const xe = H(() => {
  if (typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare"))
    return !1;
  try {
    const t = Function;
    return new t(""), !0;
  } catch {
    return !1;
  }
});
function V(t) {
  if (D(t) === !1)
    return !1;
  const e = t.constructor;
  if (e === void 0)
    return !0;
  const n = e.prototype;
  return !(D(n) === !1 || Object.prototype.hasOwnProperty.call(n, "isPrototypeOf") === !1);
}
const Ie = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
function T(t) {
  return t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
}
function R(t, e, n) {
  const r = new t._zod.constr(e ?? t._zod.def);
  return (!e || n?.parent) && (r._zod.parent = t), r;
}
function l(t) {
  const e = t;
  if (!e)
    return {};
  if (typeof e == "string")
    return { error: () => e };
  if (e?.message !== void 0) {
    if (e?.error !== void 0)
      throw new Error("Cannot specify both `message` and `error` params");
    e.error = e.message;
  }
  return delete e.message, typeof e.error == "string" ? { ...e, error: () => e.error } : e;
}
function Pe(t) {
  return Object.keys(t).filter((e) => t[e]._zod.optin === "optional" && t[e]._zod.optout === "optional");
}
const Oe = {
  safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
  int32: [-2147483648, 2147483647],
  uint32: [0, 4294967295],
  float32: [-34028234663852886e22, 34028234663852886e22],
  float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
};
function Nt(t, e) {
  const n = {}, r = t._zod.def;
  for (const o in e) {
    if (!(o in r.shape))
      throw new Error(`Unrecognized key: "${o}"`);
    e[o] && (n[o] = r.shape[o]);
  }
  return R(t, {
    ...t._zod.def,
    shape: n,
    checks: []
  });
}
function Mt(t, e) {
  const n = { ...t._zod.def.shape }, r = t._zod.def;
  for (const o in e) {
    if (!(o in r.shape))
      throw new Error(`Unrecognized key: "${o}"`);
    e[o] && delete n[o];
  }
  return R(t, {
    ...t._zod.def,
    shape: n,
    checks: []
  });
}
function Lt(t, e) {
  if (!V(e))
    throw new Error("Invalid input to extend: expected a plain object");
  const n = {
    ...t._zod.def,
    get shape() {
      const r = { ...t._zod.def.shape, ...e };
      return me(this, "shape", r), r;
    },
    checks: []
    // delete existing checks
  };
  return R(t, n);
}
function Ut(t, e) {
  return R(t, {
    ...t._zod.def,
    get shape() {
      const n = { ...t._zod.def.shape, ...e._zod.def.shape };
      return me(this, "shape", n), n;
    },
    catchall: e._zod.def.catchall,
    checks: []
    // delete existing checks
  });
}
function Dt(t, e, n) {
  const r = e._zod.def.shape, o = { ...r };
  if (n)
    for (const s in n) {
      if (!(s in r))
        throw new Error(`Unrecognized key: "${s}"`);
      n[s] && (o[s] = t ? new t({
        type: "optional",
        innerType: r[s]
      }) : r[s]);
    }
  else
    for (const s in r)
      o[s] = t ? new t({
        type: "optional",
        innerType: r[s]
      }) : r[s];
  return R(e, {
    ...e._zod.def,
    shape: o,
    checks: []
  });
}
function Vt(t, e, n) {
  const r = e._zod.def.shape, o = { ...r };
  if (n)
    for (const s in n) {
      if (!(s in o))
        throw new Error(`Unrecognized key: "${s}"`);
      n[s] && (o[s] = new t({
        type: "nonoptional",
        innerType: r[s]
      }));
    }
  else
    for (const s in r)
      o[s] = new t({
        type: "nonoptional",
        innerType: r[s]
      });
  return R(e, {
    ...e._zod.def,
    shape: o,
    // optional: [],
    checks: []
  });
}
function F(t, e = 0) {
  for (let n = e; n < t.issues.length; n++)
    if (t.issues[n]?.continue !== !0)
      return !0;
  return !1;
}
function O(t, e) {
  return e.map((n) => {
    var r;
    return (r = n).path ?? (r.path = []), n.path.unshift(t), n;
  });
}
function L(t) {
  return typeof t == "string" ? t : t?.message;
}
function I(t, e, n) {
  const r = { ...t, path: t.path ?? [] };
  if (!t.message) {
    const o = L(t.inst?._zod.def?.error?.(t)) ?? L(e?.error?.(t)) ?? L(n.customError?.(t)) ?? L(n.localeError?.(t)) ?? "Invalid input";
    r.message = o;
  }
  return delete r.inst, delete r.continue, e?.reportInput || delete r.input, r;
}
function Q(t) {
  return Array.isArray(t) ? "array" : typeof t == "string" ? "string" : "unknown";
}
function Re(...t) {
  const [e, n, r] = t;
  return typeof e == "string" ? {
    message: e,
    code: "custom",
    input: n,
    inst: r
  } : { ...e };
}
const ge = (t, e) => {
  t.name = "$ZodError", Object.defineProperty(t, "_zod", {
    value: t._zod,
    enumerable: !1
  }), Object.defineProperty(t, "issues", {
    value: e,
    enumerable: !1
  }), Object.defineProperty(t, "message", {
    get() {
      return JSON.stringify(e, Ae, 2);
    },
    enumerable: !0
    // configurable: false,
  }), Object.defineProperty(t, "toString", {
    value: () => t.message,
    enumerable: !1
  });
}, Se = c("$ZodError", ge), ee = c("$ZodError", ge, { Parent: Error });
function Wt(t, e = (n) => n.message) {
  const n = {}, r = [];
  for (const o of t.issues)
    o.path.length > 0 ? (n[o.path[0]] = n[o.path[0]] || [], n[o.path[0]].push(e(o))) : r.push(e(o));
  return { formErrors: r, fieldErrors: n };
}
function Bt(t, e) {
  const n = e || function(s) {
    return s.message;
  }, r = { _errors: [] }, o = (s) => {
    for (const i of s.issues)
      if (i.code === "invalid_union" && i.errors.length)
        i.errors.map((a) => o({ issues: a }));
      else if (i.code === "invalid_key")
        o({ issues: i.issues });
      else if (i.code === "invalid_element")
        o({ issues: i.issues });
      else if (i.path.length === 0)
        r._errors.push(n(i));
      else {
        let a = r, u = 0;
        for (; u < i.path.length; ) {
          const f = i.path[u];
          u === i.path.length - 1 ? (a[f] = a[f] || { _errors: [] }, a[f]._errors.push(n(i))) : a[f] = a[f] || { _errors: [] }, a = a[f], u++;
        }
      }
  };
  return o(t), r;
}
const je = (t) => (e, n, r, o) => {
  const s = r ? Object.assign(r, { async: !1 }) : { async: !1 }, i = e._zod.run({ value: n, issues: [] }, s);
  if (i instanceof Promise)
    throw new C();
  if (i.issues.length) {
    const a = new (o?.Err ?? t)(i.issues.map((u) => I(u, s, x())));
    throw _e(a, o?.callee), a;
  }
  return i.value;
}, Gt = /* @__PURE__ */ je(ee), Kt = (t) => async (e, n, r, o) => {
  const s = r ? Object.assign(r, { async: !0 }) : { async: !0 };
  let i = e._zod.run({ value: n, issues: [] }, s);
  if (i instanceof Promise && (i = await i), i.issues.length) {
    const a = new (o?.Err ?? t)(i.issues.map((u) => I(u, s, x())));
    throw _e(a, o?.callee), a;
  }
  return i.value;
}, Fe = (t) => (e, n, r) => {
  const o = r ? { ...r, async: !1 } : { async: !1 }, s = e._zod.run({ value: n, issues: [] }, o);
  if (s instanceof Promise)
    throw new C();
  return s.issues.length ? {
    success: !1,
    error: new (t ?? Se)(s.issues.map((i) => I(i, o, x())))
  } : { success: !0, data: s.value };
}, Ce = /* @__PURE__ */ Fe(ee), Te = (t) => async (e, n, r) => {
  const o = r ? Object.assign(r, { async: !0 }) : { async: !0 };
  let s = e._zod.run({ value: n, issues: [] }, o);
  return s instanceof Promise && (s = await s), s.issues.length ? {
    success: !1,
    error: new t(s.issues.map((i) => I(i, o, x())))
  } : { success: !0, data: s.value };
}, Ne = /* @__PURE__ */ Te(ee), Me = /^[cC][^\s-]{8,}$/, Le = /^[0-9a-z]+$/, Ue = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, De = /^[0-9a-vA-V]{20}$/, Ve = /^[A-Za-z0-9]{27}$/, We = /^[a-zA-Z0-9_-]{21}$/, Be = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, Ge = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/, re = (t) => t ? new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/, Ke = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, Je = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
function Xe() {
  return new RegExp(Je, "u");
}
const He = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, Ye = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/, qe = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/, Qe = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, et = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, ve = /^[A-Za-z0-9_-]*$/, tt = /^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/, nt = /^\+(?:[0-9]){6,14}[0-9]$/, ze = "(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))", rt = /* @__PURE__ */ new RegExp(`^${ze}$`);
function be(t) {
  const e = "(?:[01]\\d|2[0-3]):[0-5]\\d";
  return typeof t.precision == "number" ? t.precision === -1 ? `${e}` : t.precision === 0 ? `${e}:[0-5]\\d` : `${e}:[0-5]\\d\\.\\d{${t.precision}}` : `${e}(?::[0-5]\\d(?:\\.\\d+)?)?`;
}
function ot(t) {
  return new RegExp(`^${be(t)}$`);
}
function st(t) {
  const e = be({ precision: t.precision }), n = ["Z"];
  t.local && n.push(""), t.offset && n.push("([+-]\\d{2}:\\d{2})");
  const r = `${e}(?:${n.join("|")})`;
  return new RegExp(`^${ze}T(?:${r})$`);
}
const it = (t) => {
  const e = t ? `[\\s\\S]{${t?.minimum ?? 0},${t?.maximum ?? ""}}` : "[\\s\\S]*";
  return new RegExp(`^${e}$`);
}, at = /^\d+$/, ut = /^-?\d+(?:\.\d+)?/i, ct = /true|false/i, lt = /null/i, ft = /^[^A-Z]*$/, pt = /^[^a-z]*$/, k = /* @__PURE__ */ c("$ZodCheck", (t, e) => {
  var n;
  t._zod ?? (t._zod = {}), t._zod.def = e, (n = t._zod).onattach ?? (n.onattach = []);
}), $e = {
  number: "number",
  bigint: "bigint",
  object: "date"
}, we = /* @__PURE__ */ c("$ZodCheckLessThan", (t, e) => {
  k.init(t, e);
  const n = $e[typeof e.value];
  t._zod.onattach.push((r) => {
    const o = r._zod.bag, s = (e.inclusive ? o.maximum : o.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
    e.value < s && (e.inclusive ? o.maximum = e.value : o.exclusiveMaximum = e.value);
  }), t._zod.check = (r) => {
    (e.inclusive ? r.value <= e.value : r.value < e.value) || r.issues.push({
      origin: n,
      code: "too_big",
      maximum: e.value,
      input: r.value,
      inclusive: e.inclusive,
      inst: t,
      continue: !e.abort
    });
  };
}), ke = /* @__PURE__ */ c("$ZodCheckGreaterThan", (t, e) => {
  k.init(t, e);
  const n = $e[typeof e.value];
  t._zod.onattach.push((r) => {
    const o = r._zod.bag, s = (e.inclusive ? o.minimum : o.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
    e.value > s && (e.inclusive ? o.minimum = e.value : o.exclusiveMinimum = e.value);
  }), t._zod.check = (r) => {
    (e.inclusive ? r.value >= e.value : r.value > e.value) || r.issues.push({
      origin: n,
      code: "too_small",
      minimum: e.value,
      input: r.value,
      inclusive: e.inclusive,
      inst: t,
      continue: !e.abort
    });
  };
}), ht = /* @__PURE__ */ c("$ZodCheckMultipleOf", (t, e) => {
  k.init(t, e), t._zod.onattach.push((n) => {
    var r;
    (r = n._zod.bag).multipleOf ?? (r.multipleOf = e.value);
  }), t._zod.check = (n) => {
    if (typeof n.value != typeof e.value)
      throw new Error("Cannot mix number and bigint in multiple_of check.");
    (typeof n.value == "bigint" ? n.value % e.value === BigInt(0) : Ee(n.value, e.value) === 0) || n.issues.push({
      origin: typeof n.value,
      code: "not_multiple_of",
      divisor: e.value,
      input: n.value,
      inst: t,
      continue: !e.abort
    });
  };
}), dt = /* @__PURE__ */ c("$ZodCheckNumberFormat", (t, e) => {
  k.init(t, e), e.format = e.format || "float64";
  const n = e.format?.includes("int"), r = n ? "int" : "number", [o, s] = Oe[e.format];
  t._zod.onattach.push((i) => {
    const a = i._zod.bag;
    a.format = e.format, a.minimum = o, a.maximum = s, n && (a.pattern = at);
  }), t._zod.check = (i) => {
    const a = i.value;
    if (n) {
      if (!Number.isInteger(a)) {
        i.issues.push({
          expected: r,
          format: e.format,
          code: "invalid_type",
          input: a,
          inst: t
        });
        return;
      }
      if (!Number.isSafeInteger(a)) {
        a > 0 ? i.issues.push({
          input: a,
          code: "too_big",
          maximum: Number.MAX_SAFE_INTEGER,
          note: "Integers must be within the safe integer range.",
          inst: t,
          origin: r,
          continue: !e.abort
        }) : i.issues.push({
          input: a,
          code: "too_small",
          minimum: Number.MIN_SAFE_INTEGER,
          note: "Integers must be within the safe integer range.",
          inst: t,
          origin: r,
          continue: !e.abort
        });
        return;
      }
    }
    a < o && i.issues.push({
      origin: "number",
      input: a,
      code: "too_small",
      minimum: o,
      inclusive: !0,
      inst: t,
      continue: !e.abort
    }), a > s && i.issues.push({
      origin: "number",
      input: a,
      code: "too_big",
      maximum: s,
      inst: t
    });
  };
}), mt = /* @__PURE__ */ c("$ZodCheckMaxLength", (t, e) => {
  var n;
  k.init(t, e), (n = t._zod.def).when ?? (n.when = (r) => {
    const o = r.value;
    return !Y(o) && o.length !== void 0;
  }), t._zod.onattach.push((r) => {
    const o = r._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
    e.maximum < o && (r._zod.bag.maximum = e.maximum);
  }), t._zod.check = (r) => {
    const o = r.value;
    if (o.length <= e.maximum)
      return;
    const i = Q(o);
    r.issues.push({
      origin: i,
      code: "too_big",
      maximum: e.maximum,
      inclusive: !0,
      input: o,
      inst: t,
      continue: !e.abort
    });
  };
}), _t = /* @__PURE__ */ c("$ZodCheckMinLength", (t, e) => {
  var n;
  k.init(t, e), (n = t._zod.def).when ?? (n.when = (r) => {
    const o = r.value;
    return !Y(o) && o.length !== void 0;
  }), t._zod.onattach.push((r) => {
    const o = r._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
    e.minimum > o && (r._zod.bag.minimum = e.minimum);
  }), t._zod.check = (r) => {
    const o = r.value;
    if (o.length >= e.minimum)
      return;
    const i = Q(o);
    r.issues.push({
      origin: i,
      code: "too_small",
      minimum: e.minimum,
      inclusive: !0,
      input: o,
      inst: t,
      continue: !e.abort
    });
  };
}), gt = /* @__PURE__ */ c("$ZodCheckLengthEquals", (t, e) => {
  var n;
  k.init(t, e), (n = t._zod.def).when ?? (n.when = (r) => {
    const o = r.value;
    return !Y(o) && o.length !== void 0;
  }), t._zod.onattach.push((r) => {
    const o = r._zod.bag;
    o.minimum = e.length, o.maximum = e.length, o.length = e.length;
  }), t._zod.check = (r) => {
    const o = r.value, s = o.length;
    if (s === e.length)
      return;
    const i = Q(o), a = s > e.length;
    r.issues.push({
      origin: i,
      ...a ? { code: "too_big", maximum: e.length } : { code: "too_small", minimum: e.length },
      inclusive: !0,
      exact: !0,
      input: r.value,
      inst: t,
      continue: !e.abort
    });
  };
}), W = /* @__PURE__ */ c("$ZodCheckStringFormat", (t, e) => {
  var n, r;
  k.init(t, e), t._zod.onattach.push((o) => {
    const s = o._zod.bag;
    s.format = e.format, e.pattern && (s.patterns ?? (s.patterns = /* @__PURE__ */ new Set()), s.patterns.add(e.pattern));
  }), e.pattern ? (n = t._zod).check ?? (n.check = (o) => {
    e.pattern.lastIndex = 0, !e.pattern.test(o.value) && o.issues.push({
      origin: "string",
      code: "invalid_format",
      format: e.format,
      input: o.value,
      ...e.pattern ? { pattern: e.pattern.toString() } : {},
      inst: t,
      continue: !e.abort
    });
  }) : (r = t._zod).check ?? (r.check = () => {
  });
}), vt = /* @__PURE__ */ c("$ZodCheckRegex", (t, e) => {
  W.init(t, e), t._zod.check = (n) => {
    e.pattern.lastIndex = 0, !e.pattern.test(n.value) && n.issues.push({
      origin: "string",
      code: "invalid_format",
      format: "regex",
      input: n.value,
      pattern: e.pattern.toString(),
      inst: t,
      continue: !e.abort
    });
  };
}), zt = /* @__PURE__ */ c("$ZodCheckLowerCase", (t, e) => {
  e.pattern ?? (e.pattern = ft), W.init(t, e);
}), bt = /* @__PURE__ */ c("$ZodCheckUpperCase", (t, e) => {
  e.pattern ?? (e.pattern = pt), W.init(t, e);
}), $t = /* @__PURE__ */ c("$ZodCheckIncludes", (t, e) => {
  k.init(t, e);
  const n = T(e.includes), r = new RegExp(typeof e.position == "number" ? `^.{${e.position}}${n}` : n);
  e.pattern = r, t._zod.onattach.push((o) => {
    const s = o._zod.bag;
    s.patterns ?? (s.patterns = /* @__PURE__ */ new Set()), s.patterns.add(r);
  }), t._zod.check = (o) => {
    o.value.includes(e.includes, e.position) || o.issues.push({
      origin: "string",
      code: "invalid_format",
      format: "includes",
      includes: e.includes,
      input: o.value,
      inst: t,
      continue: !e.abort
    });
  };
}), wt = /* @__PURE__ */ c("$ZodCheckStartsWith", (t, e) => {
  k.init(t, e);
  const n = new RegExp(`^${T(e.prefix)}.*`);
  e.pattern ?? (e.pattern = n), t._zod.onattach.push((r) => {
    const o = r._zod.bag;
    o.patterns ?? (o.patterns = /* @__PURE__ */ new Set()), o.patterns.add(n);
  }), t._zod.check = (r) => {
    r.value.startsWith(e.prefix) || r.issues.push({
      origin: "string",
      code: "invalid_format",
      format: "starts_with",
      prefix: e.prefix,
      input: r.value,
      inst: t,
      continue: !e.abort
    });
  };
}), kt = /* @__PURE__ */ c("$ZodCheckEndsWith", (t, e) => {
  k.init(t, e);
  const n = new RegExp(`.*${T(e.suffix)}$`);
  e.pattern ?? (e.pattern = n), t._zod.onattach.push((r) => {
    const o = r._zod.bag;
    o.patterns ?? (o.patterns = /* @__PURE__ */ new Set()), o.patterns.add(n);
  }), t._zod.check = (r) => {
    r.value.endsWith(e.suffix) || r.issues.push({
      origin: "string",
      code: "invalid_format",
      format: "ends_with",
      suffix: e.suffix,
      input: r.value,
      inst: t,
      continue: !e.abort
    });
  };
}), Zt = /* @__PURE__ */ c("$ZodCheckOverwrite", (t, e) => {
  k.init(t, e), t._zod.check = (n) => {
    n.value = e.tx(n.value);
  };
});
class yt {
  constructor(e = []) {
    this.content = [], this.indent = 0, this && (this.args = e);
  }
  indented(e) {
    this.indent += 1, e(this), this.indent -= 1;
  }
  write(e) {
    if (typeof e == "function") {
      e(this, { execution: "sync" }), e(this, { execution: "async" });
      return;
    }
    const r = e.split(`
`).filter((i) => i), o = Math.min(...r.map((i) => i.length - i.trimStart().length)), s = r.map((i) => i.slice(o)).map((i) => " ".repeat(this.indent * 2) + i);
    for (const i of s)
      this.content.push(i);
  }
  compile() {
    const e = Function, n = this?.args, o = [...(this?.content ?? [""]).map((s) => `  ${s}`)];
    return new e(...n, o.join(`
`));
  }
}
const At = {
  major: 4,
  minor: 0,
  patch: 0
}, d = /* @__PURE__ */ c("$ZodType", (t, e) => {
  var n;
  t ?? (t = {}), t._zod.def = e, t._zod.bag = t._zod.bag || {}, t._zod.version = At;
  const r = [...t._zod.def.checks ?? []];
  t._zod.traits.has("$ZodCheck") && r.unshift(t);
  for (const o of r)
    for (const s of o._zod.onattach)
      s(t);
  if (r.length === 0)
    (n = t._zod).deferred ?? (n.deferred = []), t._zod.deferred?.push(() => {
      t._zod.run = t._zod.parse;
    });
  else {
    const o = (s, i, a) => {
      let u = F(s), f;
      for (const z of i) {
        if (z._zod.def.when) {
          if (!z._zod.def.when(s))
            continue;
        } else if (u)
          continue;
        const p = s.issues.length, h = z._zod.check(s);
        if (h instanceof Promise && a?.async === !1)
          throw new C();
        if (f || h instanceof Promise)
          f = (f ?? Promise.resolve()).then(async () => {
            await h, s.issues.length !== p && (u || (u = F(s, p)));
          });
        else {
          if (s.issues.length === p)
            continue;
          u || (u = F(s, p));
        }
      }
      return f ? f.then(() => s) : s;
    };
    t._zod.run = (s, i) => {
      const a = t._zod.parse(s, i);
      if (a instanceof Promise) {
        if (i.async === !1)
          throw new C();
        return a.then((u) => o(u, r, i));
      }
      return o(a, r, i);
    };
  }
  t["~standard"] = {
    validate: (o) => {
      try {
        const s = Ce(t, o);
        return s.success ? { value: s.data } : { issues: s.error?.issues };
      } catch {
        return Ne(t, o).then((i) => i.success ? { value: i.data } : { issues: i.error?.issues });
      }
    },
    vendor: "zod",
    version: 1
  };
}), Et = /* @__PURE__ */ c("$ZodString", (t, e) => {
  d.init(t, e), t._zod.pattern = [...t?._zod.bag?.patterns ?? []].pop() ?? it(t._zod.bag), t._zod.parse = (n, r) => {
    if (e.coerce)
      try {
        n.value = String(n.value);
      } catch {
      }
    return typeof n.value == "string" || n.issues.push({
      expected: "string",
      code: "invalid_type",
      input: n.value,
      inst: t
    }), n;
  };
}), v = /* @__PURE__ */ c("$ZodStringFormat", (t, e) => {
  W.init(t, e), Et.init(t, e);
}), Jt = /* @__PURE__ */ c("$ZodGUID", (t, e) => {
  e.pattern ?? (e.pattern = Ge), v.init(t, e);
}), Xt = /* @__PURE__ */ c("$ZodUUID", (t, e) => {
  if (e.version) {
    const r = {
      v1: 1,
      v2: 2,
      v3: 3,
      v4: 4,
      v5: 5,
      v6: 6,
      v7: 7,
      v8: 8
    }[e.version];
    if (r === void 0)
      throw new Error(`Invalid UUID version: "${e.version}"`);
    e.pattern ?? (e.pattern = re(r));
  } else
    e.pattern ?? (e.pattern = re());
  v.init(t, e);
}), Ht = /* @__PURE__ */ c("$ZodEmail", (t, e) => {
  e.pattern ?? (e.pattern = Ke), v.init(t, e);
}), Yt = /* @__PURE__ */ c("$ZodURL", (t, e) => {
  v.init(t, e), t._zod.check = (n) => {
    try {
      const r = n.value, o = new URL(r), s = o.href;
      e.hostname && (e.hostname.lastIndex = 0, e.hostname.test(o.hostname) || n.issues.push({
        code: "invalid_format",
        format: "url",
        note: "Invalid hostname",
        pattern: tt.source,
        input: n.value,
        inst: t,
        continue: !e.abort
      })), e.protocol && (e.protocol.lastIndex = 0, e.protocol.test(o.protocol.endsWith(":") ? o.protocol.slice(0, -1) : o.protocol) || n.issues.push({
        code: "invalid_format",
        format: "url",
        note: "Invalid protocol",
        pattern: e.protocol.source,
        input: n.value,
        inst: t,
        continue: !e.abort
      })), !r.endsWith("/") && s.endsWith("/") ? n.value = s.slice(0, -1) : n.value = s;
      return;
    } catch {
      n.issues.push({
        code: "invalid_format",
        format: "url",
        input: n.value,
        inst: t,
        continue: !e.abort
      });
    }
  };
}), qt = /* @__PURE__ */ c("$ZodEmoji", (t, e) => {
  e.pattern ?? (e.pattern = Xe()), v.init(t, e);
}), Qt = /* @__PURE__ */ c("$ZodNanoID", (t, e) => {
  e.pattern ?? (e.pattern = We), v.init(t, e);
}), en = /* @__PURE__ */ c("$ZodCUID", (t, e) => {
  e.pattern ?? (e.pattern = Me), v.init(t, e);
}), tn = /* @__PURE__ */ c("$ZodCUID2", (t, e) => {
  e.pattern ?? (e.pattern = Le), v.init(t, e);
}), nn = /* @__PURE__ */ c("$ZodULID", (t, e) => {
  e.pattern ?? (e.pattern = Ue), v.init(t, e);
}), rn = /* @__PURE__ */ c("$ZodXID", (t, e) => {
  e.pattern ?? (e.pattern = De), v.init(t, e);
}), on = /* @__PURE__ */ c("$ZodKSUID", (t, e) => {
  e.pattern ?? (e.pattern = Ve), v.init(t, e);
}), sn = /* @__PURE__ */ c("$ZodISODateTime", (t, e) => {
  e.pattern ?? (e.pattern = st(e)), v.init(t, e);
}), an = /* @__PURE__ */ c("$ZodISODate", (t, e) => {
  e.pattern ?? (e.pattern = rt), v.init(t, e);
}), un = /* @__PURE__ */ c("$ZodISOTime", (t, e) => {
  e.pattern ?? (e.pattern = ot(e)), v.init(t, e);
}), cn = /* @__PURE__ */ c("$ZodISODuration", (t, e) => {
  e.pattern ?? (e.pattern = Be), v.init(t, e);
}), ln = /* @__PURE__ */ c("$ZodIPv4", (t, e) => {
  e.pattern ?? (e.pattern = He), v.init(t, e), t._zod.onattach.push((n) => {
    const r = n._zod.bag;
    r.format = "ipv4";
  });
}), fn = /* @__PURE__ */ c("$ZodIPv6", (t, e) => {
  e.pattern ?? (e.pattern = Ye), v.init(t, e), t._zod.onattach.push((n) => {
    const r = n._zod.bag;
    r.format = "ipv6";
  }), t._zod.check = (n) => {
    try {
      new URL(`http://[${n.value}]`);
    } catch {
      n.issues.push({
        code: "invalid_format",
        format: "ipv6",
        input: n.value,
        inst: t,
        continue: !e.abort
      });
    }
  };
}), pn = /* @__PURE__ */ c("$ZodCIDRv4", (t, e) => {
  e.pattern ?? (e.pattern = qe), v.init(t, e);
}), hn = /* @__PURE__ */ c("$ZodCIDRv6", (t, e) => {
  e.pattern ?? (e.pattern = Qe), v.init(t, e), t._zod.check = (n) => {
    const [r, o] = n.value.split("/");
    try {
      if (!o)
        throw new Error();
      const s = Number(o);
      if (`${s}` !== o)
        throw new Error();
      if (s < 0 || s > 128)
        throw new Error();
      new URL(`http://[${r}]`);
    } catch {
      n.issues.push({
        code: "invalid_format",
        format: "cidrv6",
        input: n.value,
        inst: t,
        continue: !e.abort
      });
    }
  };
});
function Ze(t) {
  if (t === "")
    return !0;
  if (t.length % 4 !== 0)
    return !1;
  try {
    return atob(t), !0;
  } catch {
    return !1;
  }
}
const dn = /* @__PURE__ */ c("$ZodBase64", (t, e) => {
  e.pattern ?? (e.pattern = et), v.init(t, e), t._zod.onattach.push((n) => {
    n._zod.bag.contentEncoding = "base64";
  }), t._zod.check = (n) => {
    Ze(n.value) || n.issues.push({
      code: "invalid_format",
      format: "base64",
      input: n.value,
      inst: t,
      continue: !e.abort
    });
  };
});
function xt(t) {
  if (!ve.test(t))
    return !1;
  const e = t.replace(/[-_]/g, (r) => r === "-" ? "+" : "/"), n = e.padEnd(Math.ceil(e.length / 4) * 4, "=");
  return Ze(n);
}
const mn = /* @__PURE__ */ c("$ZodBase64URL", (t, e) => {
  e.pattern ?? (e.pattern = ve), v.init(t, e), t._zod.onattach.push((n) => {
    n._zod.bag.contentEncoding = "base64url";
  }), t._zod.check = (n) => {
    xt(n.value) || n.issues.push({
      code: "invalid_format",
      format: "base64url",
      input: n.value,
      inst: t,
      continue: !e.abort
    });
  };
}), _n = /* @__PURE__ */ c("$ZodE164", (t, e) => {
  e.pattern ?? (e.pattern = nt), v.init(t, e);
});
function It(t, e = null) {
  try {
    const n = t.split(".");
    if (n.length !== 3)
      return !1;
    const [r] = n;
    if (!r)
      return !1;
    const o = JSON.parse(atob(r));
    return !("typ" in o && o?.typ !== "JWT" || !o.alg || e && (!("alg" in o) || o.alg !== e));
  } catch {
    return !1;
  }
}
const gn = /* @__PURE__ */ c("$ZodJWT", (t, e) => {
  v.init(t, e), t._zod.check = (n) => {
    It(n.value, e.alg) || n.issues.push({
      code: "invalid_format",
      format: "jwt",
      input: n.value,
      inst: t,
      continue: !e.abort
    });
  };
}), Pt = /* @__PURE__ */ c("$ZodNumber", (t, e) => {
  d.init(t, e), t._zod.pattern = t._zod.bag.pattern ?? ut, t._zod.parse = (n, r) => {
    if (e.coerce)
      try {
        n.value = Number(n.value);
      } catch {
      }
    const o = n.value;
    if (typeof o == "number" && !Number.isNaN(o) && Number.isFinite(o))
      return n;
    const s = typeof o == "number" ? Number.isNaN(o) ? "NaN" : Number.isFinite(o) ? void 0 : "Infinity" : void 0;
    return n.issues.push({
      expected: "number",
      code: "invalid_type",
      input: o,
      inst: t,
      ...s ? { received: s } : {}
    }), n;
  };
}), vn = /* @__PURE__ */ c("$ZodNumber", (t, e) => {
  dt.init(t, e), Pt.init(t, e);
}), zn = /* @__PURE__ */ c("$ZodBoolean", (t, e) => {
  d.init(t, e), t._zod.pattern = ct, t._zod.parse = (n, r) => {
    if (e.coerce)
      try {
        n.value = !!n.value;
      } catch {
      }
    const o = n.value;
    return typeof o == "boolean" || n.issues.push({
      expected: "boolean",
      code: "invalid_type",
      input: o,
      inst: t
    }), n;
  };
}), bn = /* @__PURE__ */ c("$ZodNull", (t, e) => {
  d.init(t, e), t._zod.pattern = lt, t._zod.values = /* @__PURE__ */ new Set([null]), t._zod.parse = (n, r) => {
    const o = n.value;
    return o === null || n.issues.push({
      expected: "null",
      code: "invalid_type",
      input: o,
      inst: t
    }), n;
  };
}), $n = /* @__PURE__ */ c("$ZodAny", (t, e) => {
  d.init(t, e), t._zod.parse = (n) => n;
}), wn = /* @__PURE__ */ c("$ZodUnknown", (t, e) => {
  d.init(t, e), t._zod.parse = (n) => n;
}), kn = /* @__PURE__ */ c("$ZodNever", (t, e) => {
  d.init(t, e), t._zod.parse = (n, r) => (n.issues.push({
    expected: "never",
    code: "invalid_type",
    input: n.value,
    inst: t
  }), n);
});
function oe(t, e, n) {
  t.issues.length && e.issues.push(...O(n, t.issues)), e.value[n] = t.value;
}
const Zn = /* @__PURE__ */ c("$ZodArray", (t, e) => {
  d.init(t, e), t._zod.parse = (n, r) => {
    const o = n.value;
    if (!Array.isArray(o))
      return n.issues.push({
        expected: "array",
        code: "invalid_type",
        input: o,
        inst: t
      }), n;
    n.value = Array(o.length);
    const s = [];
    for (let i = 0; i < o.length; i++) {
      const a = o[i], u = e.element._zod.run({
        value: a,
        issues: []
      }, r);
      u instanceof Promise ? s.push(u.then((f) => oe(f, n, i))) : oe(u, n, i);
    }
    return s.length ? Promise.all(s).then(() => n) : n;
  };
});
function U(t, e, n) {
  t.issues.length && e.issues.push(...O(n, t.issues)), e.value[n] = t.value;
}
function se(t, e, n, r) {
  t.issues.length ? r[n] === void 0 ? n in r ? e.value[n] = void 0 : e.value[n] = t.value : e.issues.push(...O(n, t.issues)) : t.value === void 0 ? n in r && (e.value[n] = void 0) : e.value[n] = t.value;
}
const yn = /* @__PURE__ */ c("$ZodObject", (t, e) => {
  d.init(t, e);
  const n = H(() => {
    const p = Object.keys(e.shape);
    for (const _ of p)
      if (!(e.shape[_] instanceof d))
        throw new Error(`Invalid element at key "${_}": expected a Zod schema`);
    const h = Pe(e.shape);
    return {
      shape: e.shape,
      keys: p,
      keySet: new Set(p),
      numKeys: p.length,
      optionalKeys: new Set(h)
    };
  });
  m(t._zod, "propValues", () => {
    const p = e.shape, h = {};
    for (const _ in p) {
      const Z = p[_]._zod;
      if (Z.values) {
        h[_] ?? (h[_] = /* @__PURE__ */ new Set());
        for (const E of Z.values)
          h[_].add(E);
      }
    }
    return h;
  });
  const r = (p) => {
    const h = new yt(["shape", "payload", "ctx"]), _ = n.value, Z = ($) => {
      const g = j($);
      return `shape[${g}]._zod.run({ value: input[${g}], issues: [] }, ctx)`;
    };
    h.write("const input = payload.value;");
    const E = /* @__PURE__ */ Object.create(null);
    let G = 0;
    for (const $ of _.keys)
      E[$] = `key_${G++}`;
    h.write("const newResult = {}");
    for (const $ of _.keys)
      if (_.optionalKeys.has($)) {
        const g = E[$];
        h.write(`const ${g} = ${Z($)};`);
        const b = j($);
        h.write(`
        if (${g}.issues.length) {
          if (input[${b}] === undefined) {
            if (${b} in input) {
              newResult[${b}] = undefined;
            }
          } else {
            payload.issues = payload.issues.concat(
              ${g}.issues.map((iss) => ({
                ...iss,
                path: iss.path ? [${b}, ...iss.path] : [${b}],
              }))
            );
          }
        } else if (${g}.value === undefined) {
          if (${b} in input) newResult[${b}] = undefined;
        } else {
          newResult[${b}] = ${g}.value;
        }
        `);
      } else {
        const g = E[$];
        h.write(`const ${g} = ${Z($)};`), h.write(`
          if (${g}.issues.length) payload.issues = payload.issues.concat(${g}.issues.map(iss => ({
            ...iss,
            path: iss.path ? [${j($)}, ...iss.path] : [${j($)}]
          })));`), h.write(`newResult[${j($)}] = ${g}.value`);
      }
    h.write("payload.value = newResult;"), h.write("return payload;");
    const N = h.compile();
    return ($, g) => N(p, $, g);
  };
  let o;
  const s = D, i = !de.jitless, u = i && xe.value, f = e.catchall;
  let z;
  t._zod.parse = (p, h) => {
    z ?? (z = n.value);
    const _ = p.value;
    if (!s(_))
      return p.issues.push({
        expected: "object",
        code: "invalid_type",
        input: _,
        inst: t
      }), p;
    const Z = [];
    if (i && u && h?.async === !1 && h.jitless !== !0)
      o || (o = r(e.shape)), p = o(p, h);
    else {
      p.value = {};
      const g = z.shape;
      for (const b of z.keys) {
        const S = g[b], M = S._zod.run({ value: _[b], issues: [] }, h), te = S._zod.optin === "optional" && S._zod.optout === "optional";
        M instanceof Promise ? Z.push(M.then((ne) => te ? se(ne, p, b, _) : U(ne, p, b))) : te ? se(M, p, b, _) : U(M, p, b);
      }
    }
    if (!f)
      return Z.length ? Promise.all(Z).then(() => p) : p;
    const E = [], G = z.keySet, N = f._zod, $ = N.def.type;
    for (const g of Object.keys(_)) {
      if (G.has(g))
        continue;
      if ($ === "never") {
        E.push(g);
        continue;
      }
      const b = N.run({ value: _[g], issues: [] }, h);
      b instanceof Promise ? Z.push(b.then((S) => U(S, p, g))) : U(b, p, g);
    }
    return E.length && p.issues.push({
      code: "unrecognized_keys",
      keys: E,
      input: _,
      inst: t
    }), Z.length ? Promise.all(Z).then(() => p) : p;
  };
});
function ie(t, e, n, r) {
  for (const o of t)
    if (o.issues.length === 0)
      return e.value = o.value, e;
  return e.issues.push({
    code: "invalid_union",
    input: e.value,
    inst: n,
    errors: t.map((o) => o.issues.map((s) => I(s, r, x())))
  }), e;
}
const Ot = /* @__PURE__ */ c("$ZodUnion", (t, e) => {
  d.init(t, e), m(t._zod, "optin", () => e.options.some((n) => n._zod.optin === "optional") ? "optional" : void 0), m(t._zod, "optout", () => e.options.some((n) => n._zod.optout === "optional") ? "optional" : void 0), m(t._zod, "values", () => {
    if (e.options.every((n) => n._zod.values))
      return new Set(e.options.flatMap((n) => Array.from(n._zod.values)));
  }), m(t._zod, "pattern", () => {
    if (e.options.every((n) => n._zod.pattern)) {
      const n = e.options.map((r) => r._zod.pattern);
      return new RegExp(`^(${n.map((r) => q(r.source)).join("|")})$`);
    }
  }), t._zod.parse = (n, r) => {
    let o = !1;
    const s = [];
    for (const i of e.options) {
      const a = i._zod.run({
        value: n.value,
        issues: []
      }, r);
      if (a instanceof Promise)
        s.push(a), o = !0;
      else {
        if (a.issues.length === 0)
          return a;
        s.push(a);
      }
    }
    return o ? Promise.all(s).then((i) => ie(i, n, t, r)) : ie(s, n, t, r);
  };
}), An = /* @__PURE__ */ c("$ZodDiscriminatedUnion", (t, e) => {
  Ot.init(t, e);
  const n = t._zod.parse;
  m(t._zod, "propValues", () => {
    const o = {};
    for (const s of e.options) {
      const i = s._zod.propValues;
      if (!i || Object.keys(i).length === 0)
        throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);
      for (const [a, u] of Object.entries(i)) {
        o[a] || (o[a] = /* @__PURE__ */ new Set());
        for (const f of u)
          o[a].add(f);
      }
    }
    return o;
  });
  const r = H(() => {
    const o = e.options, s = /* @__PURE__ */ new Map();
    for (const i of o) {
      const a = i._zod.propValues[e.discriminator];
      if (!a || a.size === 0)
        throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(i)}"`);
      for (const u of a) {
        if (s.has(u))
          throw new Error(`Duplicate discriminator value "${String(u)}"`);
        s.set(u, i);
      }
    }
    return s;
  });
  t._zod.parse = (o, s) => {
    const i = o.value;
    if (!D(i))
      return o.issues.push({
        code: "invalid_type",
        expected: "object",
        input: i,
        inst: t
      }), o;
    const a = r.value.get(i?.[e.discriminator]);
    return a ? a._zod.run(o, s) : e.unionFallback ? n(o, s) : (o.issues.push({
      code: "invalid_union",
      errors: [],
      note: "No matching discriminator",
      input: i,
      path: [e.discriminator],
      inst: t
    }), o);
  };
}), En = /* @__PURE__ */ c("$ZodIntersection", (t, e) => {
  d.init(t, e), t._zod.parse = (n, r) => {
    const o = n.value, s = e.left._zod.run({ value: o, issues: [] }, r), i = e.right._zod.run({ value: o, issues: [] }, r);
    return s instanceof Promise || i instanceof Promise ? Promise.all([s, i]).then(([u, f]) => ae(n, u, f)) : ae(n, s, i);
  };
});
function X(t, e) {
  if (t === e)
    return { valid: !0, data: t };
  if (t instanceof Date && e instanceof Date && +t == +e)
    return { valid: !0, data: t };
  if (V(t) && V(e)) {
    const n = Object.keys(e), r = Object.keys(t).filter((s) => n.indexOf(s) !== -1), o = { ...t, ...e };
    for (const s of r) {
      const i = X(t[s], e[s]);
      if (!i.valid)
        return {
          valid: !1,
          mergeErrorPath: [s, ...i.mergeErrorPath]
        };
      o[s] = i.data;
    }
    return { valid: !0, data: o };
  }
  if (Array.isArray(t) && Array.isArray(e)) {
    if (t.length !== e.length)
      return { valid: !1, mergeErrorPath: [] };
    const n = [];
    for (let r = 0; r < t.length; r++) {
      const o = t[r], s = e[r], i = X(o, s);
      if (!i.valid)
        return {
          valid: !1,
          mergeErrorPath: [r, ...i.mergeErrorPath]
        };
      n.push(i.data);
    }
    return { valid: !0, data: n };
  }
  return { valid: !1, mergeErrorPath: [] };
}
function ae(t, e, n) {
  if (e.issues.length && t.issues.push(...e.issues), n.issues.length && t.issues.push(...n.issues), F(t))
    return t;
  const r = X(e.value, n.value);
  if (!r.valid)
    throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);
  return t.value = r.data, t;
}
const xn = /* @__PURE__ */ c("$ZodRecord", (t, e) => {
  d.init(t, e), t._zod.parse = (n, r) => {
    const o = n.value;
    if (!V(o))
      return n.issues.push({
        expected: "record",
        code: "invalid_type",
        input: o,
        inst: t
      }), n;
    const s = [];
    if (e.keyType._zod.values) {
      const i = e.keyType._zod.values;
      n.value = {};
      for (const u of i)
        if (typeof u == "string" || typeof u == "number" || typeof u == "symbol") {
          const f = e.valueType._zod.run({ value: o[u], issues: [] }, r);
          f instanceof Promise ? s.push(f.then((z) => {
            z.issues.length && n.issues.push(...O(u, z.issues)), n.value[u] = z.value;
          })) : (f.issues.length && n.issues.push(...O(u, f.issues)), n.value[u] = f.value);
        }
      let a;
      for (const u in o)
        i.has(u) || (a = a ?? [], a.push(u));
      a && a.length > 0 && n.issues.push({
        code: "unrecognized_keys",
        input: o,
        inst: t,
        keys: a
      });
    } else {
      n.value = {};
      for (const i of Reflect.ownKeys(o)) {
        if (i === "__proto__")
          continue;
        const a = e.keyType._zod.run({ value: i, issues: [] }, r);
        if (a instanceof Promise)
          throw new Error("Async schemas not supported in object keys currently");
        if (a.issues.length) {
          n.issues.push({
            origin: "record",
            code: "invalid_key",
            issues: a.issues.map((f) => I(f, r, x())),
            input: i,
            path: [i],
            inst: t
          }), n.value[a.value] = a.value;
          continue;
        }
        const u = e.valueType._zod.run({ value: o[i], issues: [] }, r);
        u instanceof Promise ? s.push(u.then((f) => {
          f.issues.length && n.issues.push(...O(i, f.issues)), n.value[a.value] = f.value;
        })) : (u.issues.length && n.issues.push(...O(i, u.issues)), n.value[a.value] = u.value);
      }
    }
    return s.length ? Promise.all(s).then(() => n) : n;
  };
}), In = /* @__PURE__ */ c("$ZodEnum", (t, e) => {
  d.init(t, e);
  const n = ye(e.entries);
  t._zod.values = new Set(n), t._zod.pattern = new RegExp(`^(${n.filter((r) => Ie.has(typeof r)).map((r) => typeof r == "string" ? T(r) : r.toString()).join("|")})$`), t._zod.parse = (r, o) => {
    const s = r.value;
    return t._zod.values.has(s) || r.issues.push({
      code: "invalid_value",
      values: n,
      input: s,
      inst: t
    }), r;
  };
}), Pn = /* @__PURE__ */ c("$ZodLiteral", (t, e) => {
  d.init(t, e), t._zod.values = new Set(e.values), t._zod.pattern = new RegExp(`^(${e.values.map((n) => typeof n == "string" ? T(n) : n ? n.toString() : String(n)).join("|")})$`), t._zod.parse = (n, r) => {
    const o = n.value;
    return t._zod.values.has(o) || n.issues.push({
      code: "invalid_value",
      values: e.values,
      input: o,
      inst: t
    }), n;
  };
}), On = /* @__PURE__ */ c("$ZodTransform", (t, e) => {
  d.init(t, e), t._zod.parse = (n, r) => {
    const o = e.transform(n.value, n);
    if (r.async)
      return (o instanceof Promise ? o : Promise.resolve(o)).then((i) => (n.value = i, n));
    if (o instanceof Promise)
      throw new C();
    return n.value = o, n;
  };
}), Rn = /* @__PURE__ */ c("$ZodOptional", (t, e) => {
  d.init(t, e), t._zod.optin = "optional", t._zod.optout = "optional", m(t._zod, "values", () => e.innerType._zod.values ? /* @__PURE__ */ new Set([...e.innerType._zod.values, void 0]) : void 0), m(t._zod, "pattern", () => {
    const n = e.innerType._zod.pattern;
    return n ? new RegExp(`^(${q(n.source)})?$`) : void 0;
  }), t._zod.parse = (n, r) => e.innerType._zod.optin === "optional" ? e.innerType._zod.run(n, r) : n.value === void 0 ? n : e.innerType._zod.run(n, r);
}), Sn = /* @__PURE__ */ c("$ZodNullable", (t, e) => {
  d.init(t, e), m(t._zod, "optin", () => e.innerType._zod.optin), m(t._zod, "optout", () => e.innerType._zod.optout), m(t._zod, "pattern", () => {
    const n = e.innerType._zod.pattern;
    return n ? new RegExp(`^(${q(n.source)}|null)$`) : void 0;
  }), m(t._zod, "values", () => e.innerType._zod.values ? /* @__PURE__ */ new Set([...e.innerType._zod.values, null]) : void 0), t._zod.parse = (n, r) => n.value === null ? n : e.innerType._zod.run(n, r);
}), jn = /* @__PURE__ */ c("$ZodDefault", (t, e) => {
  d.init(t, e), t._zod.optin = "optional", m(t._zod, "values", () => e.innerType._zod.values), t._zod.parse = (n, r) => {
    if (n.value === void 0)
      return n.value = e.defaultValue, n;
    const o = e.innerType._zod.run(n, r);
    return o instanceof Promise ? o.then((s) => ue(s, e)) : ue(o, e);
  };
});
function ue(t, e) {
  return t.value === void 0 && (t.value = e.defaultValue), t;
}
const Fn = /* @__PURE__ */ c("$ZodPrefault", (t, e) => {
  d.init(t, e), t._zod.optin = "optional", m(t._zod, "values", () => e.innerType._zod.values), t._zod.parse = (n, r) => (n.value === void 0 && (n.value = e.defaultValue), e.innerType._zod.run(n, r));
}), Cn = /* @__PURE__ */ c("$ZodNonOptional", (t, e) => {
  d.init(t, e), m(t._zod, "values", () => {
    const n = e.innerType._zod.values;
    return n ? new Set([...n].filter((r) => r !== void 0)) : void 0;
  }), t._zod.parse = (n, r) => {
    const o = e.innerType._zod.run(n, r);
    return o instanceof Promise ? o.then((s) => ce(s, t)) : ce(o, t);
  };
});
function ce(t, e) {
  return !t.issues.length && t.value === void 0 && t.issues.push({
    code: "invalid_type",
    expected: "nonoptional",
    input: t.value,
    inst: e
  }), t;
}
const Tn = /* @__PURE__ */ c("$ZodCatch", (t, e) => {
  d.init(t, e), t._zod.optin = "optional", m(t._zod, "optout", () => e.innerType._zod.optout), m(t._zod, "values", () => e.innerType._zod.values), t._zod.parse = (n, r) => {
    const o = e.innerType._zod.run(n, r);
    return o instanceof Promise ? o.then((s) => (n.value = s.value, s.issues.length && (n.value = e.catchValue({
      ...n,
      error: {
        issues: s.issues.map((i) => I(i, r, x()))
      },
      input: n.value
    }), n.issues = []), n)) : (n.value = o.value, o.issues.length && (n.value = e.catchValue({
      ...n,
      error: {
        issues: o.issues.map((s) => I(s, r, x()))
      },
      input: n.value
    }), n.issues = []), n);
  };
}), Nn = /* @__PURE__ */ c("$ZodPipe", (t, e) => {
  d.init(t, e), m(t._zod, "values", () => e.in._zod.values), m(t._zod, "optin", () => e.in._zod.optin), m(t._zod, "optout", () => e.out._zod.optout), t._zod.parse = (n, r) => {
    const o = e.in._zod.run(n, r);
    return o instanceof Promise ? o.then((s) => le(s, e, r)) : le(o, e, r);
  };
});
function le(t, e, n) {
  return F(t) ? t : e.out._zod.run({ value: t.value, issues: t.issues }, n);
}
const Mn = /* @__PURE__ */ c("$ZodReadonly", (t, e) => {
  d.init(t, e), m(t._zod, "propValues", () => e.innerType._zod.propValues), m(t._zod, "values", () => e.innerType._zod.values), m(t._zod, "optin", () => e.innerType._zod.optin), m(t._zod, "optout", () => e.innerType._zod.optout), t._zod.parse = (n, r) => {
    const o = e.innerType._zod.run(n, r);
    return o instanceof Promise ? o.then(fe) : fe(o);
  };
});
function fe(t) {
  return t.value = Object.freeze(t.value), t;
}
const Ln = /* @__PURE__ */ c("$ZodCustom", (t, e) => {
  k.init(t, e), d.init(t, e), t._zod.parse = (n, r) => n, t._zod.check = (n) => {
    const r = n.value, o = e.fn(r);
    if (o instanceof Promise)
      return o.then((s) => pe(s, n, r, t));
    pe(o, n, r, t);
  };
});
function pe(t, e, n, r) {
  if (!t) {
    const o = {
      code: "custom",
      input: n,
      inst: r,
      // incorporates params.error into issue reporting
      path: [...r._zod.def.path ?? []],
      // incorporates params.error into issue reporting
      continue: !r._zod.def.abort
      // params: inst._zod.def.params,
    };
    r._zod.def.params && (o.params = r._zod.def.params), e.issues.push(Re(o));
  }
}
class Rt {
  constructor() {
    this._map = /* @__PURE__ */ new Map(), this._idmap = /* @__PURE__ */ new Map();
  }
  add(e, ...n) {
    const r = n[0];
    if (this._map.set(e, r), r && typeof r == "object" && "id" in r) {
      if (this._idmap.has(r.id))
        throw new Error(`ID ${r.id} already exists in the registry`);
      this._idmap.set(r.id, e);
    }
    return this;
  }
  clear() {
    return this._map = /* @__PURE__ */ new Map(), this._idmap = /* @__PURE__ */ new Map(), this;
  }
  remove(e) {
    const n = this._map.get(e);
    return n && typeof n == "object" && "id" in n && this._idmap.delete(n.id), this._map.delete(e), this;
  }
  get(e) {
    const n = e._zod.parent;
    if (n) {
      const r = { ...this.get(n) ?? {} };
      return delete r.id, { ...r, ...this._map.get(e) };
    }
    return this._map.get(e);
  }
  has(e) {
    return this._map.has(e);
  }
}
function St() {
  return new Rt();
}
const Un = /* @__PURE__ */ St();
function Dn(t, e) {
  return new t({
    type: "string",
    ...l(e)
  });
}
function Vn(t, e) {
  return new t({
    type: "string",
    format: "email",
    check: "string_format",
    abort: !1,
    ...l(e)
  });
}
function Wn(t, e) {
  return new t({
    type: "string",
    format: "guid",
    check: "string_format",
    abort: !1,
    ...l(e)
  });
}
function Bn(t, e) {
  return new t({
    type: "string",
    format: "uuid",
    check: "string_format",
    abort: !1,
    ...l(e)
  });
}
function Gn(t, e) {
  return new t({
    type: "string",
    format: "uuid",
    check: "string_format",
    abort: !1,
    version: "v4",
    ...l(e)
  });
}
function Kn(t, e) {
  return new t({
    type: "string",
    format: "uuid",
    check: "string_format",
    abort: !1,
    version: "v6",
    ...l(e)
  });
}
function Jn(t, e) {
  return new t({
    type: "string",
    format: "uuid",
    check: "string_format",
    abort: !1,
    version: "v7",
    ...l(e)
  });
}
function Xn(t, e) {
  return new t({
    type: "string",
    format: "url",
    check: "string_format",
    abort: !1,
    ...l(e)
  });
}
function Hn(t, e) {
  return new t({
    type: "string",
    format: "emoji",
    check: "string_format",
    abort: !1,
    ...l(e)
  });
}
function Yn(t, e) {
  return new t({
    type: "string",
    format: "nanoid",
    check: "string_format",
    abort: !1,
    ...l(e)
  });
}
function qn(t, e) {
  return new t({
    type: "string",
    format: "cuid",
    check: "string_format",
    abort: !1,
    ...l(e)
  });
}
function Qn(t, e) {
  return new t({
    type: "string",
    format: "cuid2",
    check: "string_format",
    abort: !1,
    ...l(e)
  });
}
function er(t, e) {
  return new t({
    type: "string",
    format: "ulid",
    check: "string_format",
    abort: !1,
    ...l(e)
  });
}
function tr(t, e) {
  return new t({
    type: "string",
    format: "xid",
    check: "string_format",
    abort: !1,
    ...l(e)
  });
}
function nr(t, e) {
  return new t({
    type: "string",
    format: "ksuid",
    check: "string_format",
    abort: !1,
    ...l(e)
  });
}
function rr(t, e) {
  return new t({
    type: "string",
    format: "ipv4",
    check: "string_format",
    abort: !1,
    ...l(e)
  });
}
function or(t, e) {
  return new t({
    type: "string",
    format: "ipv6",
    check: "string_format",
    abort: !1,
    ...l(e)
  });
}
function sr(t, e) {
  return new t({
    type: "string",
    format: "cidrv4",
    check: "string_format",
    abort: !1,
    ...l(e)
  });
}
function ir(t, e) {
  return new t({
    type: "string",
    format: "cidrv6",
    check: "string_format",
    abort: !1,
    ...l(e)
  });
}
function ar(t, e) {
  return new t({
    type: "string",
    format: "base64",
    check: "string_format",
    abort: !1,
    ...l(e)
  });
}
function ur(t, e) {
  return new t({
    type: "string",
    format: "base64url",
    check: "string_format",
    abort: !1,
    ...l(e)
  });
}
function cr(t, e) {
  return new t({
    type: "string",
    format: "e164",
    check: "string_format",
    abort: !1,
    ...l(e)
  });
}
function lr(t, e) {
  return new t({
    type: "string",
    format: "jwt",
    check: "string_format",
    abort: !1,
    ...l(e)
  });
}
function fr(t, e) {
  return new t({
    type: "string",
    format: "datetime",
    check: "string_format",
    offset: !1,
    local: !1,
    precision: null,
    ...l(e)
  });
}
function pr(t, e) {
  return new t({
    type: "string",
    format: "date",
    check: "string_format",
    ...l(e)
  });
}
function hr(t, e) {
  return new t({
    type: "string",
    format: "time",
    check: "string_format",
    precision: null,
    ...l(e)
  });
}
function dr(t, e) {
  return new t({
    type: "string",
    format: "duration",
    check: "string_format",
    ...l(e)
  });
}
function mr(t, e) {
  return new t({
    type: "number",
    checks: [],
    ...l(e)
  });
}
function _r(t, e) {
  return new t({
    type: "number",
    coerce: !0,
    checks: [],
    ...l(e)
  });
}
function gr(t, e) {
  return new t({
    type: "number",
    check: "number_format",
    abort: !1,
    format: "safeint",
    ...l(e)
  });
}
function vr(t, e) {
  return new t({
    type: "boolean",
    ...l(e)
  });
}
function zr(t, e) {
  return new t({
    type: "null",
    ...l(e)
  });
}
function br(t) {
  return new t({
    type: "any"
  });
}
function $r(t) {
  return new t({
    type: "unknown"
  });
}
function wr(t, e) {
  return new t({
    type: "never",
    ...l(e)
  });
}
function kr(t, e) {
  return new we({
    check: "less_than",
    ...l(e),
    value: t,
    inclusive: !1
  });
}
function Zr(t, e) {
  return new we({
    check: "less_than",
    ...l(e),
    value: t,
    inclusive: !0
  });
}
function yr(t, e) {
  return new ke({
    check: "greater_than",
    ...l(e),
    value: t,
    inclusive: !1
  });
}
function Ar(t, e) {
  return new ke({
    check: "greater_than",
    ...l(e),
    value: t,
    inclusive: !0
  });
}
function Er(t, e) {
  return new ht({
    check: "multiple_of",
    ...l(e),
    value: t
  });
}
function xr(t, e) {
  return new mt({
    check: "max_length",
    ...l(e),
    maximum: t
  });
}
function Ir(t, e) {
  return new _t({
    check: "min_length",
    ...l(e),
    minimum: t
  });
}
function Pr(t, e) {
  return new gt({
    check: "length_equals",
    ...l(e),
    length: t
  });
}
function Or(t, e) {
  return new vt({
    check: "string_format",
    format: "regex",
    ...l(e),
    pattern: t
  });
}
function Rr(t) {
  return new zt({
    check: "string_format",
    format: "lowercase",
    ...l(t)
  });
}
function Sr(t) {
  return new bt({
    check: "string_format",
    format: "uppercase",
    ...l(t)
  });
}
function jr(t, e) {
  return new $t({
    check: "string_format",
    format: "includes",
    ...l(e),
    includes: t
  });
}
function Fr(t, e) {
  return new wt({
    check: "string_format",
    format: "starts_with",
    ...l(e),
    prefix: t
  });
}
function Cr(t, e) {
  return new kt({
    check: "string_format",
    format: "ends_with",
    ...l(e),
    suffix: t
  });
}
function B(t) {
  return new Zt({
    check: "overwrite",
    tx: t
  });
}
function Tr(t) {
  return B((e) => e.normalize(t));
}
function Nr() {
  return B((t) => t.trim());
}
function Mr() {
  return B((t) => t.toLowerCase());
}
function Lr() {
  return B((t) => t.toUpperCase());
}
function Ur(t, e, n) {
  return new t({
    type: "array",
    element: e,
    // get element() {
    //   return element;
    // },
    ...l(n)
  });
}
function Dr(t, e, n) {
  const r = l(n);
  return r.abort ?? (r.abort = !0), new t({
    type: "custom",
    check: "custom",
    fn: e,
    ...r
  });
}
function Vr(t, e, n) {
  return new t({
    type: "custom",
    check: "custom",
    fn: e,
    ...l(n)
  });
}
function jt(t, e, n, r) {
  r?.errorMessages && n && (t.errorMessage = {
    ...t.errorMessage,
    [e]: n
  });
}
function P(t, e, n, r, o) {
  t[e] = n, jt(t, e, r, o);
}
let K;
const y = {
  /**
   * `c` was changed to `[cC]` to replicate /i flag
   */
  cuid: /^[cC][^\s-]{8,}$/,
  cuid2: /^[0-9a-z]+$/,
  ulid: /^[0-9A-HJKMNP-TV-Z]{26}$/,
  /**
   * `a-z` was added to replicate /i flag
   */
  email: /^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,
  /**
   * Constructed a valid Unicode RegExp
   *
   * Lazily instantiate since this type of regex isn't supported
   * in all envs (e.g. React Native).
   *
   * See:
   * https://github.com/colinhacks/zod/issues/2433
   * Fix in Zod:
   * https://github.com/colinhacks/zod/commit/9340fd51e48576a75adc919bff65dbc4a5d4c99b
   */
  emoji: () => (K === void 0 && (K = RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", "u")), K),
  /**
   * Unused
   */
  uuid: /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,
  /**
   * Unused
   */
  ipv4: /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,
  ipv4Cidr: /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,
  /**
   * Unused
   */
  ipv6: /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,
  ipv6Cidr: /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,
  base64: /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,
  base64url: /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,
  nanoid: /^[a-zA-Z0-9_-]{21}$/,
  jwt: /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/
};
function Wr(t, e) {
  const n = {
    type: "string"
  };
  if (t.checks)
    for (const r of t.checks)
      switch (r.kind) {
        case "min":
          P(n, "minLength", typeof n.minLength == "number" ? Math.max(n.minLength, r.value) : r.value, r.message, e);
          break;
        case "max":
          P(n, "maxLength", typeof n.maxLength == "number" ? Math.min(n.maxLength, r.value) : r.value, r.message, e);
          break;
        case "email":
          switch (e.emailStrategy) {
            case "format:email":
              A(n, "email", r.message, e);
              break;
            case "format:idn-email":
              A(n, "idn-email", r.message, e);
              break;
            case "pattern:zod":
              w(n, y.email, r.message, e);
              break;
          }
          break;
        case "url":
          A(n, "uri", r.message, e);
          break;
        case "uuid":
          A(n, "uuid", r.message, e);
          break;
        case "regex":
          w(n, r.regex, r.message, e);
          break;
        case "cuid":
          w(n, y.cuid, r.message, e);
          break;
        case "cuid2":
          w(n, y.cuid2, r.message, e);
          break;
        case "startsWith":
          w(n, RegExp(`^${J(r.value, e)}`), r.message, e);
          break;
        case "endsWith":
          w(n, RegExp(`${J(r.value, e)}$`), r.message, e);
          break;
        case "datetime":
          A(n, "date-time", r.message, e);
          break;
        case "date":
          A(n, "date", r.message, e);
          break;
        case "time":
          A(n, "time", r.message, e);
          break;
        case "duration":
          A(n, "duration", r.message, e);
          break;
        case "length":
          P(n, "minLength", typeof n.minLength == "number" ? Math.max(n.minLength, r.value) : r.value, r.message, e), P(n, "maxLength", typeof n.maxLength == "number" ? Math.min(n.maxLength, r.value) : r.value, r.message, e);
          break;
        case "includes": {
          w(n, RegExp(J(r.value, e)), r.message, e);
          break;
        }
        case "ip": {
          r.version !== "v6" && A(n, "ipv4", r.message, e), r.version !== "v4" && A(n, "ipv6", r.message, e);
          break;
        }
        case "base64url":
          w(n, y.base64url, r.message, e);
          break;
        case "jwt":
          w(n, y.jwt, r.message, e);
          break;
        case "cidr": {
          r.version !== "v6" && w(n, y.ipv4Cidr, r.message, e), r.version !== "v4" && w(n, y.ipv6Cidr, r.message, e);
          break;
        }
        case "emoji":
          w(n, y.emoji(), r.message, e);
          break;
        case "ulid": {
          w(n, y.ulid, r.message, e);
          break;
        }
        case "base64": {
          switch (e.base64Strategy) {
            case "format:binary": {
              A(n, "binary", r.message, e);
              break;
            }
            case "contentEncoding:base64": {
              P(n, "contentEncoding", "base64", r.message, e);
              break;
            }
            case "pattern:zod": {
              w(n, y.base64, r.message, e);
              break;
            }
          }
          break;
        }
        case "nanoid":
          w(n, y.nanoid, r.message, e);
      }
  return n;
}
function J(t, e) {
  return e.patternStrategy === "escape" ? Ct(t) : t;
}
const Ft = new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");
function Ct(t) {
  let e = "";
  for (let n = 0; n < t.length; n++)
    Ft.has(t[n]) || (e += "\\"), e += t[n];
  return e;
}
function A(t, e, n, r) {
  t.format || t.anyOf?.some((o) => o.format) ? (t.anyOf || (t.anyOf = []), t.format && (t.anyOf.push({
    format: t.format,
    ...t.errorMessage && r.errorMessages && {
      errorMessage: { format: t.errorMessage.format }
    }
  }), delete t.format, t.errorMessage && (delete t.errorMessage.format, Object.keys(t.errorMessage).length === 0 && delete t.errorMessage)), t.anyOf.push({
    format: e,
    ...n && r.errorMessages && { errorMessage: { format: n } }
  })) : P(t, "format", e, n, r);
}
function w(t, e, n, r) {
  t.pattern || t.allOf?.some((o) => o.pattern) ? (t.allOf || (t.allOf = []), t.pattern && (t.allOf.push({
    pattern: t.pattern,
    ...t.errorMessage && r.errorMessages && {
      errorMessage: { pattern: t.errorMessage.pattern }
    }
  }), delete t.pattern, t.errorMessage && (delete t.errorMessage.pattern, Object.keys(t.errorMessage).length === 0 && delete t.errorMessage)), t.allOf.push({
    pattern: he(e, r),
    ...n && r.errorMessages && { errorMessage: { pattern: n } }
  })) : P(t, "pattern", he(e, r), n, r);
}
function he(t, e) {
  if (!e.applyRegexFlags || !t.flags)
    return t.source;
  const n = {
    i: t.flags.includes("i"),
    m: t.flags.includes("m"),
    s: t.flags.includes("s")
    // `.` matches newlines
  }, r = n.i ? t.source.toLowerCase() : t.source;
  let o = "", s = !1, i = !1, a = !1;
  for (let u = 0; u < r.length; u++) {
    if (s) {
      o += r[u], s = !1;
      continue;
    }
    if (n.i) {
      if (i) {
        if (r[u].match(/[a-z]/)) {
          a ? (o += r[u], o += `${r[u - 2]}-${r[u]}`.toUpperCase(), a = !1) : r[u + 1] === "-" && r[u + 2]?.match(/[a-z]/) ? (o += r[u], a = !0) : o += `${r[u]}${r[u].toUpperCase()}`;
          continue;
        }
      } else if (r[u].match(/[a-z]/)) {
        o += `[${r[u]}${r[u].toUpperCase()}]`;
        continue;
      }
    }
    if (n.m) {
      if (r[u] === "^") {
        o += `(^|(?<=[\r
]))`;
        continue;
      } else if (r[u] === "$") {
        o += `($|(?=[\r
]))`;
        continue;
      }
    }
    if (n.s && r[u] === ".") {
      o += i ? `${r[u]}\r
` : `[${r[u]}\r
]`;
      continue;
    }
    o += r[u], r[u] === "\\" ? s = !0 : i && r[u] === "]" ? i = !1 : !i && r[u] === "[" && (i = !0);
  }
  try {
    new RegExp(o);
  } catch {
    return console.warn(`Could not convert regex pattern at ${e.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`), t.source;
  }
  return o;
}
export {
  c as $,
  Et as A,
  Or as B,
  jr as C,
  Fr as D,
  Cr as E,
  Ir as F,
  xr as G,
  Pr as H,
  Rr as I,
  Sr as J,
  Nr as K,
  Tr as L,
  Mr as M,
  Lr as N,
  d as O,
  R as P,
  B as Q,
  Un as R,
  Vr as S,
  k as T,
  Re as U,
  Sn as V,
  Cn as W,
  jn as X,
  Fn as Y,
  Tn as Z,
  fr as _,
  sn as a,
  rn as a$,
  Mn as a0,
  yn as a1,
  m as a2,
  Lt as a3,
  Ut as a4,
  Nt as a5,
  Mt as a6,
  Dt as a7,
  Vt as a8,
  Ot as a9,
  sr as aA,
  ir as aB,
  cr as aC,
  Yt as aD,
  Pt as aE,
  yr as aF,
  Ar as aG,
  kr as aH,
  Zr as aI,
  Er as aJ,
  zn as aK,
  bn as aL,
  $n as aM,
  wn as aN,
  Zn as aO,
  wr as aP,
  Ln as aQ,
  gr as aR,
  kn as aS,
  Ht as aT,
  Jt as aU,
  Xt as aV,
  qt as aW,
  Qt as aX,
  en as aY,
  tn as aZ,
  nn as a_,
  An as aa,
  En as ab,
  xn as ac,
  In as ad,
  Pn as ae,
  On as af,
  Rn as ag,
  Nn as ah,
  Vn as ai,
  lr as aj,
  Hn as ak,
  Wn as al,
  Bn as am,
  Gn as an,
  Kn as ao,
  Jn as ap,
  Yn as aq,
  qn as ar,
  Qn as as,
  er as at,
  ar as au,
  ur as av,
  tr as aw,
  nr as ax,
  rr as ay,
  or as az,
  pr as b,
  on as b0,
  ln as b1,
  fn as b2,
  pn as b3,
  hn as b4,
  dn as b5,
  mn as b6,
  _n as b7,
  gn as b8,
  vn as b9,
  Rt as ba,
  ye as bb,
  P as bc,
  Wr as bd,
  jt as be,
  Gt as bf,
  _r as bg,
  Ce as bh,
  Tt as bi,
  hr as c,
  dr as d,
  an as e,
  un as f,
  cn as g,
  Se as h,
  Wt as i,
  Bt as j,
  je as k,
  Fe as l,
  Kt as m,
  Te as n,
  Dr as o,
  l as p,
  Dn as q,
  mr as r,
  me as s,
  zr as t,
  $r as u,
  Ur as v,
  vr as w,
  Xn as x,
  br as y,
  v as z
};
//# sourceMappingURL=string-BZO3_EzG.js.map
