import CJS_COMPAT_NODE_URL from 'node:url';
import CJS_COMPAT_NODE_PATH from 'node:path';
import CJS_COMPAT_NODE_MODULE from "node:module";

const __filename = CJS_COMPAT_NODE_URL.fileURLToPath(import.meta.url);
const __dirname = CJS_COMPAT_NODE_PATH.dirname(__filename);
const require = CJS_COMPAT_NODE_MODULE.createRequire(import.meta.url);
// ------------------------------------------------------------
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
// ------------------------------------------------------------
import {
  C as Ne
} from "./chunk-3KW7Q6W3.js";
import {
  a as c
} from "./chunk-HRN2KQZP.js";

// src/cli/globalSettings.ts
import je from "node:fs/promises";
import { homedir as Kt } from "node:os";
import { dirname as er, join as tr } from "node:path";

// ../node_modules/zod/lib/index.mjs
var x;
(function(r) {
  r.assertEqual = (n) => n;
  function e(n) {
  }
  c(e, "assertIs"), r.assertIs = e;
  function t(n) {
    throw new Error();
  }
  c(t, "assertNever"), r.assertNever = t, r.arrayToEnum = (n) => {
    let a = {};
    for (let i of n)
      a[i] = i;
    return a;
  }, r.getValidEnumValues = (n) => {
    let a = r.objectKeys(n).filter((o) => typeof n[n[o]] != "number"), i = {};
    for (let o of a)
      i[o] = n[o];
    return r.objectValues(i);
  }, r.objectValues = (n) => r.objectKeys(n).map(function(a) {
    return n[a];
  }), r.objectKeys = typeof Object.keys == "function" ? (n) => Object.keys(n) : (n) => {
    let a = [];
    for (let i in n)
      Object.prototype.hasOwnProperty.call(n, i) && a.push(i);
    return a;
  }, r.find = (n, a) => {
    for (let i of n)
      if (a(i))
        return i;
  }, r.isInteger = typeof Number.isInteger == "function" ? (n) => Number.isInteger(n) : (n) => typeof n == "number" && isFinite(n) && Math.floor(n) === n;
  function s(n, a = " | ") {
    return n.map((i) => typeof i == "string" ? `'${i}'` : i).join(a);
  }
  c(s, "joinValues"), r.joinValues = s, r.jsonStringifyReplacer = (n, a) => typeof a == "bigint" ? a.toString() : a;
})(x || (x = {}));
var Oe;
(function(r) {
  r.mergeShapes = (e, t) => ({
    ...e,
    ...t
    // second overwrites first
  });
})(Oe || (Oe = {}));
var h = x.arrayToEnum([
  "string",
  "nan",
  "number",
  "integer",
  "float",
  "boolean",
  "date",
  "bigint",
  "symbol",
  "function",
  "undefined",
  "null",
  "array",
  "object",
  "unknown",
  "promise",
  "void",
  "never",
  "map",
  "set"
]), Z = /* @__PURE__ */ c((r) => {
  switch (typeof r) {
    case "undefined":
      return h.undefined;
    case "string":
      return h.string;
    case "number":
      return isNaN(r) ? h.nan : h.number;
    case "boolean":
      return h.boolean;
    case "function":
      return h.function;
    case "bigint":
      return h.bigint;
    case "symbol":
      return h.symbol;
    case "object":
      return Array.isArray(r) ? h.array : r === null ? h.null : r.then && typeof r.then == "function" && r.catch && typeof r.catch == "function" ? h.promise : typeof Map < "u" && r instanceof Map ? h.map : typeof Set < "u" && r instanceof Set ? h.set : typeof Date < "u" && r instanceof Date ? h.date : h.object;
    default:
      return h.unknown;
  }
}, "getParsedType"), d = x.arrayToEnum([
  "invalid_type",
  "invalid_literal",
  "custom",
  "invalid_union",
  "invalid_union_discriminator",
  "invalid_enum_value",
  "unrecognized_keys",
  "invalid_arguments",
  "invalid_return_type",
  "invalid_date",
  "invalid_string",
  "too_small",
  "too_big",
  "invalid_intersection_types",
  "not_multiple_of",
  "not_finite"
]), We = /* @__PURE__ */ c((r) => JSON.stringify(r, null, 2).replace(/"([^"]+)":/g, "$1:"), "quotelessJson"), S = class r extends Error {
  static {
    c(this, "ZodError");
  }
  get errors() {
    return this.issues;
  }
  constructor(e) {
    super(), this.issues = [], this.addIssue = (s) => {
      this.issues = [...this.issues, s];
    }, this.addIssues = (s = []) => {
      this.issues = [...this.issues, ...s];
    };
    let t = new.target.prototype;
    Object.setPrototypeOf ? Object.setPrototypeOf(this, t) : this.__proto__ = t, this.name = "ZodError", this.issues = e;
  }
  format(e) {
    let t = e || function(a) {
      return a.message;
    }, s = { _errors: [] }, n = /* @__PURE__ */ c((a) => {
      for (let i of a.issues)
        if (i.code === "invalid_union")
          i.unionErrors.map(n);
        else if (i.code === "invalid_return_type")
          n(i.returnTypeError);
        else if (i.code === "invalid_arguments")
          n(i.argumentsError);
        else if (i.path.length === 0)
          s._errors.push(t(i));
        else {
          let o = s, f = 0;
          for (; f < i.path.length; ) {
            let u = i.path[f];
            f === i.path.length - 1 ? (o[u] = o[u] || { _errors: [] }, o[u]._errors.push(t(i))) : o[u] = o[u] || { _errors: [] }, o = o[u], f++;
          }
        }
    }, "processError");
    return n(this), s;
  }
  static assert(e) {
    if (!(e instanceof r))
      throw new Error(`Not a ZodError: ${e}`);
  }
  toString() {
    return this.message;
  }
  get message() {
    return JSON.stringify(this.issues, x.jsonStringifyReplacer, 2);
  }
  get isEmpty() {
    return this.issues.length === 0;
  }
  flatten(e = (t) => t.message) {
    let t = {}, s = [];
    for (let n of this.issues)
      n.path.length > 0 ? (t[n.path[0]] = t[n.path[0]] || [], t[n.path[0]].push(e(n))) : s.push(e(n));
    return { formErrors: s, fieldErrors: t };
  }
  get formErrors() {
    return this.flatten();
  }
};
S.create = (r) => new S(r);
var ne = /* @__PURE__ */ c((r, e) => {
  let t;
  switch (r.code) {
    case d.invalid_type:
      r.received === h.undefined ? t = "Required" : t = `Expected ${r.expected}, received ${r.received}`;
      break;
    case d.invalid_literal:
      t = `Invalid literal value, expected ${JSON.stringify(r.expected, x.jsonStringifyReplacer)}`;
      break;
    case d.unrecognized_keys:
      t = `Unrecognized key(s) in object: ${x.joinValues(r.keys, ", ")}`;
      break;
    case d.invalid_union:
      t = "Invalid input";
      break;
    case d.invalid_union_discriminator:
      t = `Invalid discriminator value. Expected ${x.joinValues(r.options)}`;
      break;
    case d.invalid_enum_value:
      t = `Invalid enum value. Expected ${x.joinValues(r.options)}, received '${r.received}'`;
      break;
    case d.invalid_arguments:
      t = "Invalid function arguments";
      break;
    case d.invalid_return_type:
      t = "Invalid function return type";
      break;
    case d.invalid_date:
      t = "Invalid date";
      break;
    case d.invalid_string:
      typeof r.validation == "object" ? "includes" in r.validation ? (t = `Invalid input: must include "${r.validation.includes}"`, typeof r.validation.position == "number" && (t = `${t} at one or more positions greater than or equal to ${r.validation.position}`)) : "startsWith" in r.validation ? t = `Invalid input: must start with "${r.validation.startsWith}"` : "endsWith" in r.validation ? t = `Invalid input: must end with "${r.validation.endsWith}"` : x.assertNever(r.validation) : r.validation !== "regex" ? t = `Invalid ${r.validation}` : t = "Invalid";
      break;
    case d.too_small:
      r.type === "array" ? t = `Array must contain ${r.exact ? "exactly" : r.inclusive ? "at least" : "more than"} ${r.minimum} element(s)` : r.type === "string" ? t = `String must contain ${r.exact ? "exactly" : r.inclusive ? "at least" : "over"} ${r.minimum} character(s)` : r.type === "number" ? t = `Number must be ${r.exact ? "exactly equal to " : r.inclusive ? "greater than or equal to " : "greater than "}${r.minimum}` : r.type === "date" ? t = `Date must be ${r.exact ? "exactly equal to " : r.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(r.minimum))}` : t = "Invalid input";
      break;
    case d.too_big:
      r.type === "array" ? t = `Array must contain ${r.exact ? "exactly" : r.inclusive ? "at most" : "less than"} ${r.maximum} element(s)` : r.type === "string" ? t = `String must contain ${r.exact ? "exactly" : r.inclusive ? "at most" : "under"} ${r.maximum} character(s)` : r.type === "number" ? t = `Number must be ${r.exact ? "exactly" : r.inclusive ? "less than or equal to" : "less than"} ${r.maximum}` : r.type === "bigint" ? t = `BigInt must be ${r.exact ? "exactly" : r.inclusive ? "less than or equal to" : "less than"} ${r.maximum}` : r.type === "date" ? t = `Date must be ${r.exact ? "exactly" : r.inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(r.maximum))}` : t = "Invalid input";
      break;
    case d.custom:
      t = "Invalid input";
      break;
    case d.invalid_intersection_types:
      t = "Intersection results could not be merged";
      break;
    case d.not_multiple_of:
      t = `Number must be a multiple of ${r.multipleOf}`;
      break;
    case d.not_finite:
      t = "Number must be finite";
      break;
    default:
      t = e.defaultError, x.assertNever(r);
  }
  return { message: t };
}, "errorMap"), $e = ne;
function qe(r) {
  $e = r;
}
c(qe, "setErrorMap");
function ye() {
  return $e;
}
c(ye, "getErrorMap");
var _e = /* @__PURE__ */ c((r) => {
  let { data: e, path: t, errorMaps: s, issueData: n } = r, a = [...t, ...n.path || []], i = {
    ...n,
    path: a
  };
  if (n.message !== void 0)
    return {
      ...n,
      path: a,
      message: n.message
    };
  let o = "", f = s.filter((u) => !!u).slice().reverse();
  for (let u of f)
    o = u(i, { data: e, defaultError: o }).message;
  return {
    ...n,
    path: a,
    message: o
  };
}, "makeIssue"), Je = [];
function l(r, e) {
  let t = ye(), s = _e({
    issueData: e,
    data: r.data,
    path: r.path,
    errorMaps: [
      r.common.contextualErrorMap,
      // contextual error map is first priority
      r.schemaErrorMap,
      // then schema-bound map if available
      t,
      // then global override map
      t === ne ? void 0 : ne
      // then global default map
    ].filter((n) => !!n)
  });
  r.common.issues.push(s);
}
c(l, "addIssueToContext");
var b = class r {
  static {
    c(this, "ParseStatus");
  }
  constructor() {
    this.value = "valid";
  }
  dirty() {
    this.value === "valid" && (this.value = "dirty");
  }
  abort() {
    this.value !== "aborted" && (this.value = "aborted");
  }
  static mergeArray(e, t) {
    let s = [];
    for (let n of t) {
      if (n.status === "aborted")
        return y;
      n.status === "dirty" && e.dirty(), s.push(n.value);
    }
    return { status: e.value, value: s };
  }
  static async mergeObjectAsync(e, t) {
    let s = [];
    for (let n of t) {
      let a = await n.key, i = await n.value;
      s.push({
        key: a,
        value: i
      });
    }
    return r.mergeObjectSync(e, s);
  }
  static mergeObjectSync(e, t) {
    let s = {};
    for (let n of t) {
      let { key: a, value: i } = n;
      if (a.status === "aborted" || i.status === "aborted")
        return y;
      a.status === "dirty" && e.dirty(), i.status === "dirty" && e.dirty(), a.value !== "__proto__" && (typeof i.value < "u" || n.alwaysSet) && (s[a.value] = i.value);
    }
    return { status: e.value, value: s };
  }
}, y = Object.freeze({
  status: "aborted"
}), se = /* @__PURE__ */ c((r) => ({ status: "dirty", value: r }), "DIRTY"), w = /* @__PURE__ */ c((r) => ({ status: "valid", value: r }), "OK"), Ce = /* @__PURE__ */ c((r) => r.status === "aborted", "isAborted"), Ae = /* @__PURE__ */ c((r) => r.status === "dirty", "isDirty"), z = /* @__PURE__ */ c((r) => r.status === "valid", "isValid"), he = /* @__PURE__ */ c((r) => typeof Promise < "u" && r instanceof Promise, "isAsync");
function ge(r, e, t, s) {
  if (t === "a" && !s) throw new TypeError("Private accessor was defined without a getter");
  if (typeof e == "function" ? r !== e || !s : !e.has(r)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
  return t === "m" ? s : t === "a" ? s.call(r) : s ? s.value : e.get(r);
}
c(ge, "__classPrivateFieldGet");
function Me(r, e, t, s, n) {
  if (s === "m") throw new TypeError("Private method is not writable");
  if (s === "a" && !n) throw new TypeError("Private accessor was defined without a setter");
  if (typeof e == "function" ? r !== e || !n : !e.has(r)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
  return s === "a" ? n.call(r, t) : n ? n.value = t : e.set(r, t), t;
}
c(Me, "__classPrivateFieldSet");
var p;
(function(r) {
  r.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, r.toString = (e) => typeof e == "string" ? e : e?.message;
})(p || (p = {}));
var le, fe, A = class {
  static {
    c(this, "ParseInputLazyPath");
  }
  constructor(e, t, s, n) {
    this._cachedPath = [], this.parent = e, this.data = t, this._path = s, this._key = n;
  }
  get path() {
    return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
  }
}, Re = /* @__PURE__ */ c((r, e) => {
  if (z(e))
    return { success: !0, data: e.value };
  if (!r.common.issues.length)
    throw new Error("Validation failed but no issues detected.");
  return {
    success: !1,
    get error() {
      if (this._error)
        return this._error;
      let t = new S(r.common.issues);
      return this._error = t, this._error;
    }
  };
}, "handleResult");
function _(r) {
  if (!r)
    return {};
  let { errorMap: e, invalid_type_error: t, required_error: s, description: n } = r;
  if (e && (t || s))
    throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
  return e ? { errorMap: e, description: n } : { errorMap: /* @__PURE__ */ c((i, o) => {
    var f, u;
    let { message: m } = r;
    return i.code === "invalid_enum_value" ? { message: m ?? o.defaultError } : typeof o.data > "u" ? { message: (f = m ?? s) !== null && f !== void 0 ? f : o.defaultError } : i.code !== "invalid_type" ? { message: o.defaultError } : { message: (u = m ?? t) !== null && u !== void 0 ? u : o.defaultError };
  }, "customMap"), description: n };
}
c(_, "processCreateParams");
var g = class {
  static {
    c(this, "ZodType");
  }
  get description() {
    return this._def.description;
  }
  _getType(e) {
    return Z(e.data);
  }
  _getOrReturnCtx(e, t) {
    return t || {
      common: e.parent.common,
      data: e.data,
      parsedType: Z(e.data),
      schemaErrorMap: this._def.errorMap,
      path: e.path,
      parent: e.parent
    };
  }
  _processInputParams(e) {
    return {
      status: new b(),
      ctx: {
        common: e.parent.common,
        data: e.data,
        parsedType: Z(e.data),
        schemaErrorMap: this._def.errorMap,
        path: e.path,
        parent: e.parent
      }
    };
  }
  _parseSync(e) {
    let t = this._parse(e);
    if (he(t))
      throw new Error("Synchronous parse encountered promise.");
    return t;
  }
  _parseAsync(e) {
    let t = this._parse(e);
    return Promise.resolve(t);
  }
  parse(e, t) {
    let s = this.safeParse(e, t);
    if (s.success)
      return s.data;
    throw s.error;
  }
  safeParse(e, t) {
    var s;
    let n = {
      common: {
        issues: [],
        async: (s = t?.async) !== null && s !== void 0 ? s : !1,
        contextualErrorMap: t?.errorMap
      },
      path: t?.path || [],
      schemaErrorMap: this._def.errorMap,
      parent: null,
      data: e,
      parsedType: Z(e)
    }, a = this._parseSync({ data: e, path: n.path, parent: n });
    return Re(n, a);
  }
  "~validate"(e) {
    var t, s;
    let n = {
      common: {
        issues: [],
        async: !!this["~standard"].async
      },
      path: [],
      schemaErrorMap: this._def.errorMap,
      parent: null,
      data: e,
      parsedType: Z(e)
    };
    if (!this["~standard"].async)
      try {
        let a = this._parseSync({ data: e, path: [], parent: n });
        return z(a) ? {
          value: a.value
        } : {
          issues: n.common.issues
        };
      } catch (a) {
        !((s = (t = a?.message) === null || t === void 0 ? void 0 : t.toLowerCase()) === null || s === void 0) && s.includes("encountered") && (this["~standard"].async = !0), n.common = {
          issues: [],
          async: !0
        };
      }
    return this._parseAsync({ data: e, path: [], parent: n }).then((a) => z(a) ? {
      value: a.value
    } : {
      issues: n.common.issues
    });
  }
  async parseAsync(e, t) {
    let s = await this.safeParseAsync(e, t);
    if (s.success)
      return s.data;
    throw s.error;
  }
  async safeParseAsync(e, t) {
    let s = {
      common: {
        issues: [],
        contextualErrorMap: t?.errorMap,
        async: !0
      },
      path: t?.path || [],
      schemaErrorMap: this._def.errorMap,
      parent: null,
      data: e,
      parsedType: Z(e)
    }, n = this._parse({ data: e, path: s.path, parent: s }), a = await (he(n) ? n : Promise.resolve(n));
    return Re(s, a);
  }
  refine(e, t) {
    let s = /* @__PURE__ */ c((n) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(n) : t, "getIssueProperties");
    return this._refinement((n, a) => {
      let i = e(n), o = /* @__PURE__ */ c(() => a.addIssue({
        code: d.custom,
        ...s(n)
      }), "setError");
      return typeof Promise < "u" && i instanceof Promise ? i.then((f) => f ? !0 : (o(), !1)) : i ? !0 : (o(), !1);
    });
  }
  refinement(e, t) {
    return this._refinement((s, n) => e(s) ? !0 : (n.addIssue(typeof t == "function" ? t(s, n) : t), !1));
  }
  _refinement(e) {
    return new O({
      schema: this,
      typeName: v.ZodEffects,
      effect: { type: "refinement", refinement: e }
    });
  }
  superRefine(e) {
    return this._refinement(e);
  }
  constructor(e) {
    this.spa = this.safeParseAsync, this._def = e, this.parse = this.parse.bind(this), this.safeParse = this.safeParse.bind(this), this.parseAsync = this.parseAsync.bind(this), this.safeParseAsync = this.safeParseAsync.bind(this), this.spa = this.spa.bind(this), this.refine = this.refine.bind(this), this.refinement = this.refinement.bind(this), this.superRefine = this.superRefine.bind(this), this.optional = this.optional.bind(this), this.nullable = this.nullable.bind(this), this.nullish = this.nullish.bind(this), this.array = this.array.bind(this), this.promise = this.promise.bind(this), this.or = this.or.bind(this), this.and = this.and.bind(this), this.transform = this.transform.bind(this), this.brand = this.brand.bind(this), this.default = this.default.bind(this), this.catch = this.catch.bind(this), this.describe = this.describe.bind(this), this.pipe = this.pipe.bind(this), this.readonly = this.readonly.bind(this), this.isNullable = this.isNullable.bind(this), this.isOptional = this.isOptional.bind(this), this["~standard"] = {
      version: 1,
      vendor: "zod",
      validate: /* @__PURE__ */ c((t) => this["~validate"](t), "validate")
    };
  }
  optional() {
    return C.create(this, this._def);
  }
  nullable() {
    return N.create(this, this._def);
  }
  nullish() {
    return this.nullable().optional();
  }
  array() {
    return $.create(this);
  }
  promise() {
    return V.create(this, this._def);
  }
  or(e) {
    return q.create([this, e], this._def);
  }
  and(e) {
    return J.create(this, e, this._def);
  }
  transform(e) {
    return new O({
      ..._(this._def),
      schema: this,
      typeName: v.ZodEffects,
      effect: { type: "transform", transform: e }
    });
  }
  default(e) {
    let t = typeof e == "function" ? e : () => e;
    return new Q({
      ..._(this._def),
      innerType: this,
      defaultValue: t,
      typeName: v.ZodDefault
    });
  }
  brand() {
    return new pe({
      typeName: v.ZodBranded,
      type: this,
      ..._(this._def)
    });
  }
  catch(e) {
    let t = typeof e == "function" ? e : () => e;
    return new K({
      ..._(this._def),
      innerType: this,
      catchValue: t,
      typeName: v.ZodCatch
    });
  }
  describe(e) {
    let t = this.constructor;
    return new t({
      ...this._def,
      description: e
    });
  }
  pipe(e) {
    return me.create(this, e);
  }
  readonly() {
    return ee.create(this);
  }
  isOptional() {
    return this.safeParse(void 0).success;
  }
  isNullable() {
    return this.safeParse(null).success;
  }
}, Ye = /^c[^\s-]{8,}$/i, Ge = /^[0-9a-z]+$/, He = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Xe = /^[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}$/i, Qe = /^[a-z0-9_-]{21}$/i, Ke = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, et = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, tt = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, rt = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", Se, st = /^(?:(?: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])$/, nt = /^(?:(?: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])$/, at = /^(([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]))$/, it = /^(([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])$/, ot = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, ct = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, Pe = "((\\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])))", dt = new RegExp(`^${Pe}$`);
function Ve(r) {
  let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
  return r.precision ? e = `${e}\\.\\d{${r.precision}}` : r.precision == null && (e = `${e}(\\.\\d+)?`), e;
}
c(Ve, "timeRegexSource");
function ut(r) {
  return new RegExp(`^${Ve(r)}$`);
}
c(ut, "timeRegex");
function ze(r) {
  let e = `${Pe}T${Ve(r)}`, t = [];
  return t.push(r.local ? "Z?" : "Z"), r.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
}
c(ze, "datetimeRegex");
function lt(r, e) {
  return !!((e === "v4" || !e) && st.test(r) || (e === "v6" || !e) && at.test(r));
}
c(lt, "isValidIP");
function ft(r, e) {
  if (!Ke.test(r))
    return !1;
  try {
    let [t] = r.split("."), s = t.replace(/-/g, "+").replace(/_/g, "/").padEnd(t.length + (4 - t.length % 4) % 4, "="), n = JSON.parse(atob(s));
    return !(typeof n != "object" || n === null || !n.typ || !n.alg || e && n.alg !== e);
  } catch {
    return !1;
  }
}
c(ft, "isValidJWT");
function ht(r, e) {
  return !!((e === "v4" || !e) && nt.test(r) || (e === "v6" || !e) && it.test(r));
}
c(ht, "isValidCidr");
var M = class r extends g {
  static {
    c(this, "ZodString");
  }
  _parse(e) {
    if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== h.string) {
      let a = this._getOrReturnCtx(e);
      return l(a, {
        code: d.invalid_type,
        expected: h.string,
        received: a.parsedType
      }), y;
    }
    let s = new b(), n;
    for (let a of this._def.checks)
      if (a.kind === "min")
        e.data.length < a.value && (n = this._getOrReturnCtx(e, n), l(n, {
          code: d.too_small,
          minimum: a.value,
          type: "string",
          inclusive: !0,
          exact: !1,
          message: a.message
        }), s.dirty());
      else if (a.kind === "max")
        e.data.length > a.value && (n = this._getOrReturnCtx(e, n), l(n, {
          code: d.too_big,
          maximum: a.value,
          type: "string",
          inclusive: !0,
          exact: !1,
          message: a.message
        }), s.dirty());
      else if (a.kind === "length") {
        let i = e.data.length > a.value, o = e.data.length < a.value;
        (i || o) && (n = this._getOrReturnCtx(e, n), i ? l(n, {
          code: d.too_big,
          maximum: a.value,
          type: "string",
          inclusive: !0,
          exact: !0,
          message: a.message
        }) : o && l(n, {
          code: d.too_small,
          minimum: a.value,
          type: "string",
          inclusive: !0,
          exact: !0,
          message: a.message
        }), s.dirty());
      } else if (a.kind === "email")
        tt.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
          validation: "email",
          code: d.invalid_string,
          message: a.message
        }), s.dirty());
      else if (a.kind === "emoji")
        Se || (Se = new RegExp(rt, "u")), Se.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
          validation: "emoji",
          code: d.invalid_string,
          message: a.message
        }), s.dirty());
      else if (a.kind === "uuid")
        Xe.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
          validation: "uuid",
          code: d.invalid_string,
          message: a.message
        }), s.dirty());
      else if (a.kind === "nanoid")
        Qe.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
          validation: "nanoid",
          code: d.invalid_string,
          message: a.message
        }), s.dirty());
      else if (a.kind === "cuid")
        Ye.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
          validation: "cuid",
          code: d.invalid_string,
          message: a.message
        }), s.dirty());
      else if (a.kind === "cuid2")
        Ge.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
          validation: "cuid2",
          code: d.invalid_string,
          message: a.message
        }), s.dirty());
      else if (a.kind === "ulid")
        He.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
          validation: "ulid",
          code: d.invalid_string,
          message: a.message
        }), s.dirty());
      else if (a.kind === "url")
        try {
          new URL(e.data);
        } catch {
          n = this._getOrReturnCtx(e, n), l(n, {
            validation: "url",
            code: d.invalid_string,
            message: a.message
          }), s.dirty();
        }
      else a.kind === "regex" ? (a.regex.lastIndex = 0, a.regex.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
        validation: "regex",
        code: d.invalid_string,
        message: a.message
      }), s.dirty())) : a.kind === "trim" ? e.data = e.data.trim() : a.kind === "includes" ? e.data.includes(a.value, a.position) || (n = this._getOrReturnCtx(e, n), l(n, {
        code: d.invalid_string,
        validation: { includes: a.value, position: a.position },
        message: a.message
      }), s.dirty()) : a.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : a.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : a.kind === "startsWith" ? e.data.startsWith(a.value) || (n = this._getOrReturnCtx(e, n), l(n, {
        code: d.invalid_string,
        validation: { startsWith: a.value },
        message: a.message
      }), s.dirty()) : a.kind === "endsWith" ? e.data.endsWith(a.value) || (n = this._getOrReturnCtx(e, n), l(n, {
        code: d.invalid_string,
        validation: { endsWith: a.value },
        message: a.message
      }), s.dirty()) : a.kind === "datetime" ? ze(a).test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
        code: d.invalid_string,
        validation: "datetime",
        message: a.message
      }), s.dirty()) : a.kind === "date" ? dt.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
        code: d.invalid_string,
        validation: "date",
        message: a.message
      }), s.dirty()) : a.kind === "time" ? ut(a).test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
        code: d.invalid_string,
        validation: "time",
        message: a.message
      }), s.dirty()) : a.kind === "duration" ? et.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
        validation: "duration",
        code: d.invalid_string,
        message: a.message
      }), s.dirty()) : a.kind === "ip" ? lt(e.data, a.version) || (n = this._getOrReturnCtx(e, n), l(n, {
        validation: "ip",
        code: d.invalid_string,
        message: a.message
      }), s.dirty()) : a.kind === "jwt" ? ft(e.data, a.alg) || (n = this._getOrReturnCtx(e, n), l(n, {
        validation: "jwt",
        code: d.invalid_string,
        message: a.message
      }), s.dirty()) : a.kind === "cidr" ? ht(e.data, a.version) || (n = this._getOrReturnCtx(e, n), l(n, {
        validation: "cidr",
        code: d.invalid_string,
        message: a.message
      }), s.dirty()) : a.kind === "base64" ? ot.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
        validation: "base64",
        code: d.invalid_string,
        message: a.message
      }), s.dirty()) : a.kind === "base64url" ? ct.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
        validation: "base64url",
        code: d.invalid_string,
        message: a.message
      }), s.dirty()) : x.assertNever(a);
    return { status: s.value, value: e.data };
  }
  _regex(e, t, s) {
    return this.refinement((n) => e.test(n), {
      validation: t,
      code: d.invalid_string,
      ...p.errToObj(s)
    });
  }
  _addCheck(e) {
    return new r({
      ...this._def,
      checks: [...this._def.checks, e]
    });
  }
  email(e) {
    return this._addCheck({ kind: "email", ...p.errToObj(e) });
  }
  url(e) {
    return this._addCheck({ kind: "url", ...p.errToObj(e) });
  }
  emoji(e) {
    return this._addCheck({ kind: "emoji", ...p.errToObj(e) });
  }
  uuid(e) {
    return this._addCheck({ kind: "uuid", ...p.errToObj(e) });
  }
  nanoid(e) {
    return this._addCheck({ kind: "nanoid", ...p.errToObj(e) });
  }
  cuid(e) {
    return this._addCheck({ kind: "cuid", ...p.errToObj(e) });
  }
  cuid2(e) {
    return this._addCheck({ kind: "cuid2", ...p.errToObj(e) });
  }
  ulid(e) {
    return this._addCheck({ kind: "ulid", ...p.errToObj(e) });
  }
  base64(e) {
    return this._addCheck({ kind: "base64", ...p.errToObj(e) });
  }
  base64url(e) {
    return this._addCheck({
      kind: "base64url",
      ...p.errToObj(e)
    });
  }
  jwt(e) {
    return this._addCheck({ kind: "jwt", ...p.errToObj(e) });
  }
  ip(e) {
    return this._addCheck({ kind: "ip", ...p.errToObj(e) });
  }
  cidr(e) {
    return this._addCheck({ kind: "cidr", ...p.errToObj(e) });
  }
  datetime(e) {
    var t, s;
    return typeof e == "string" ? this._addCheck({
      kind: "datetime",
      precision: null,
      offset: !1,
      local: !1,
      message: e
    }) : this._addCheck({
      kind: "datetime",
      precision: typeof e?.precision > "u" ? null : e?.precision,
      offset: (t = e?.offset) !== null && t !== void 0 ? t : !1,
      local: (s = e?.local) !== null && s !== void 0 ? s : !1,
      ...p.errToObj(e?.message)
    });
  }
  date(e) {
    return this._addCheck({ kind: "date", message: e });
  }
  time(e) {
    return typeof e == "string" ? this._addCheck({
      kind: "time",
      precision: null,
      message: e
    }) : this._addCheck({
      kind: "time",
      precision: typeof e?.precision > "u" ? null : e?.precision,
      ...p.errToObj(e?.message)
    });
  }
  duration(e) {
    return this._addCheck({ kind: "duration", ...p.errToObj(e) });
  }
  regex(e, t) {
    return this._addCheck({
      kind: "regex",
      regex: e,
      ...p.errToObj(t)
    });
  }
  includes(e, t) {
    return this._addCheck({
      kind: "includes",
      value: e,
      position: t?.position,
      ...p.errToObj(t?.message)
    });
  }
  startsWith(e, t) {
    return this._addCheck({
      kind: "startsWith",
      value: e,
      ...p.errToObj(t)
    });
  }
  endsWith(e, t) {
    return this._addCheck({
      kind: "endsWith",
      value: e,
      ...p.errToObj(t)
    });
  }
  min(e, t) {
    return this._addCheck({
      kind: "min",
      value: e,
      ...p.errToObj(t)
    });
  }
  max(e, t) {
    return this._addCheck({
      kind: "max",
      value: e,
      ...p.errToObj(t)
    });
  }
  length(e, t) {
    return this._addCheck({
      kind: "length",
      value: e,
      ...p.errToObj(t)
    });
  }
  /**
   * Equivalent to `.min(1)`
   */
  nonempty(e) {
    return this.min(1, p.errToObj(e));
  }
  trim() {
    return new r({
      ...this._def,
      checks: [...this._def.checks, { kind: "trim" }]
    });
  }
  toLowerCase() {
    return new r({
      ...this._def,
      checks: [...this._def.checks, { kind: "toLowerCase" }]
    });
  }
  toUpperCase() {
    return new r({
      ...this._def,
      checks: [...this._def.checks, { kind: "toUpperCase" }]
    });
  }
  get isDatetime() {
    return !!this._def.checks.find((e) => e.kind === "datetime");
  }
  get isDate() {
    return !!this._def.checks.find((e) => e.kind === "date");
  }
  get isTime() {
    return !!this._def.checks.find((e) => e.kind === "time");
  }
  get isDuration() {
    return !!this._def.checks.find((e) => e.kind === "duration");
  }
  get isEmail() {
    return !!this._def.checks.find((e) => e.kind === "email");
  }
  get isURL() {
    return !!this._def.checks.find((e) => e.kind === "url");
  }
  get isEmoji() {
    return !!this._def.checks.find((e) => e.kind === "emoji");
  }
  get isUUID() {
    return !!this._def.checks.find((e) => e.kind === "uuid");
  }
  get isNANOID() {
    return !!this._def.checks.find((e) => e.kind === "nanoid");
  }
  get isCUID() {
    return !!this._def.checks.find((e) => e.kind === "cuid");
  }
  get isCUID2() {
    return !!this._def.checks.find((e) => e.kind === "cuid2");
  }
  get isULID() {
    return !!this._def.checks.find((e) => e.kind === "ulid");
  }
  get isIP() {
    return !!this._def.checks.find((e) => e.kind === "ip");
  }
  get isCIDR() {
    return !!this._def.checks.find((e) => e.kind === "cidr");
  }
  get isBase64() {
    return !!this._def.checks.find((e) => e.kind === "base64");
  }
  get isBase64url() {
    return !!this._def.checks.find((e) => e.kind === "base64url");
  }
  get minLength() {
    let e = null;
    for (let t of this._def.checks)
      t.kind === "min" && (e === null || t.value > e) && (e = t.value);
    return e;
  }
  get maxLength() {
    let e = null;
    for (let t of this._def.checks)
      t.kind === "max" && (e === null || t.value < e) && (e = t.value);
    return e;
  }
};
M.create = (r) => {
  var e;
  return new M({
    checks: [],
    typeName: v.ZodString,
    coerce: (e = r?.coerce) !== null && e !== void 0 ? e : !1,
    ..._(r)
  });
};
function pt(r, e) {
  let t = (r.toString().split(".")[1] || "").length, s = (e.toString().split(".")[1] || "").length, n = t > s ? t : s, a = parseInt(r.toFixed(n).replace(".", "")), i = parseInt(e.toFixed(n).replace(".", ""));
  return a % i / Math.pow(10, n);
}
c(pt, "floatSafeRemainder");
var D = class r extends g {
  static {
    c(this, "ZodNumber");
  }
  constructor() {
    super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
  }
  _parse(e) {
    if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== h.number) {
      let a = this._getOrReturnCtx(e);
      return l(a, {
        code: d.invalid_type,
        expected: h.number,
        received: a.parsedType
      }), y;
    }
    let s, n = new b();
    for (let a of this._def.checks)
      a.kind === "int" ? x.isInteger(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
        code: d.invalid_type,
        expected: "integer",
        received: "float",
        message: a.message
      }), n.dirty()) : a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (s = this._getOrReturnCtx(e, s), l(s, {
        code: d.too_small,
        minimum: a.value,
        type: "number",
        inclusive: a.inclusive,
        exact: !1,
        message: a.message
      }), n.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (s = this._getOrReturnCtx(e, s), l(s, {
        code: d.too_big,
        maximum: a.value,
        type: "number",
        inclusive: a.inclusive,
        exact: !1,
        message: a.message
      }), n.dirty()) : a.kind === "multipleOf" ? pt(e.data, a.value) !== 0 && (s = this._getOrReturnCtx(e, s), l(s, {
        code: d.not_multiple_of,
        multipleOf: a.value,
        message: a.message
      }), n.dirty()) : a.kind === "finite" ? Number.isFinite(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
        code: d.not_finite,
        message: a.message
      }), n.dirty()) : x.assertNever(a);
    return { status: n.value, value: e.data };
  }
  gte(e, t) {
    return this.setLimit("min", e, !0, p.toString(t));
  }
  gt(e, t) {
    return this.setLimit("min", e, !1, p.toString(t));
  }
  lte(e, t) {
    return this.setLimit("max", e, !0, p.toString(t));
  }
  lt(e, t) {
    return this.setLimit("max", e, !1, p.toString(t));
  }
  setLimit(e, t, s, n) {
    return new r({
      ...this._def,
      checks: [
        ...this._def.checks,
        {
          kind: e,
          value: t,
          inclusive: s,
          message: p.toString(n)
        }
      ]
    });
  }
  _addCheck(e) {
    return new r({
      ...this._def,
      checks: [...this._def.checks, e]
    });
  }
  int(e) {
    return this._addCheck({
      kind: "int",
      message: p.toString(e)
    });
  }
  positive(e) {
    return this._addCheck({
      kind: "min",
      value: 0,
      inclusive: !1,
      message: p.toString(e)
    });
  }
  negative(e) {
    return this._addCheck({
      kind: "max",
      value: 0,
      inclusive: !1,
      message: p.toString(e)
    });
  }
  nonpositive(e) {
    return this._addCheck({
      kind: "max",
      value: 0,
      inclusive: !0,
      message: p.toString(e)
    });
  }
  nonnegative(e) {
    return this._addCheck({
      kind: "min",
      value: 0,
      inclusive: !0,
      message: p.toString(e)
    });
  }
  multipleOf(e, t) {
    return this._addCheck({
      kind: "multipleOf",
      value: e,
      message: p.toString(t)
    });
  }
  finite(e) {
    return this._addCheck({
      kind: "finite",
      message: p.toString(e)
    });
  }
  safe(e) {
    return this._addCheck({
      kind: "min",
      inclusive: !0,
      value: Number.MIN_SAFE_INTEGER,
      message: p.toString(e)
    })._addCheck({
      kind: "max",
      inclusive: !0,
      value: Number.MAX_SAFE_INTEGER,
      message: p.toString(e)
    });
  }
  get minValue() {
    let e = null;
    for (let t of this._def.checks)
      t.kind === "min" && (e === null || t.value > e) && (e = t.value);
    return e;
  }
  get maxValue() {
    let e = null;
    for (let t of this._def.checks)
      t.kind === "max" && (e === null || t.value < e) && (e = t.value);
    return e;
  }
  get isInt() {
    return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" && x.isInteger(e.value));
  }
  get isFinite() {
    let e = null, t = null;
    for (let s of this._def.checks) {
      if (s.kind === "finite" || s.kind === "int" || s.kind === "multipleOf")
        return !0;
      s.kind === "min" ? (t === null || s.value > t) && (t = s.value) : s.kind === "max" && (e === null || s.value < e) && (e = s.value);
    }
    return Number.isFinite(t) && Number.isFinite(e);
  }
};
D.create = (r) => new D({
  checks: [],
  typeName: v.ZodNumber,
  coerce: r?.coerce || !1,
  ..._(r)
});
var L = class r extends g {
  static {
    c(this, "ZodBigInt");
  }
  constructor() {
    super(...arguments), this.min = this.gte, this.max = this.lte;
  }
  _parse(e) {
    if (this._def.coerce)
      try {
        e.data = BigInt(e.data);
      } catch {
        return this._getInvalidInput(e);
      }
    if (this._getType(e) !== h.bigint)
      return this._getInvalidInput(e);
    let s, n = new b();
    for (let a of this._def.checks)
      a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (s = this._getOrReturnCtx(e, s), l(s, {
        code: d.too_small,
        type: "bigint",
        minimum: a.value,
        inclusive: a.inclusive,
        message: a.message
      }), n.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (s = this._getOrReturnCtx(e, s), l(s, {
        code: d.too_big,
        type: "bigint",
        maximum: a.value,
        inclusive: a.inclusive,
        message: a.message
      }), n.dirty()) : a.kind === "multipleOf" ? e.data % a.value !== BigInt(0) && (s = this._getOrReturnCtx(e, s), l(s, {
        code: d.not_multiple_of,
        multipleOf: a.value,
        message: a.message
      }), n.dirty()) : x.assertNever(a);
    return { status: n.value, value: e.data };
  }
  _getInvalidInput(e) {
    let t = this._getOrReturnCtx(e);
    return l(t, {
      code: d.invalid_type,
      expected: h.bigint,
      received: t.parsedType
    }), y;
  }
  gte(e, t) {
    return this.setLimit("min", e, !0, p.toString(t));
  }
  gt(e, t) {
    return this.setLimit("min", e, !1, p.toString(t));
  }
  lte(e, t) {
    return this.setLimit("max", e, !0, p.toString(t));
  }
  lt(e, t) {
    return this.setLimit("max", e, !1, p.toString(t));
  }
  setLimit(e, t, s, n) {
    return new r({
      ...this._def,
      checks: [
        ...this._def.checks,
        {
          kind: e,
          value: t,
          inclusive: s,
          message: p.toString(n)
        }
      ]
    });
  }
  _addCheck(e) {
    return new r({
      ...this._def,
      checks: [...this._def.checks, e]
    });
  }
  positive(e) {
    return this._addCheck({
      kind: "min",
      value: BigInt(0),
      inclusive: !1,
      message: p.toString(e)
    });
  }
  negative(e) {
    return this._addCheck({
      kind: "max",
      value: BigInt(0),
      inclusive: !1,
      message: p.toString(e)
    });
  }
  nonpositive(e) {
    return this._addCheck({
      kind: "max",
      value: BigInt(0),
      inclusive: !0,
      message: p.toString(e)
    });
  }
  nonnegative(e) {
    return this._addCheck({
      kind: "min",
      value: BigInt(0),
      inclusive: !0,
      message: p.toString(e)
    });
  }
  multipleOf(e, t) {
    return this._addCheck({
      kind: "multipleOf",
      value: e,
      message: p.toString(t)
    });
  }
  get minValue() {
    let e = null;
    for (let t of this._def.checks)
      t.kind === "min" && (e === null || t.value > e) && (e = t.value);
    return e;
  }
  get maxValue() {
    let e = null;
    for (let t of this._def.checks)
      t.kind === "max" && (e === null || t.value < e) && (e = t.value);
    return e;
  }
};
L.create = (r) => {
  var e;
  return new L({
    checks: [],
    typeName: v.ZodBigInt,
    coerce: (e = r?.coerce) !== null && e !== void 0 ? e : !1,
    ..._(r)
  });
};
var F = class extends g {
  static {
    c(this, "ZodBoolean");
  }
  _parse(e) {
    if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== h.boolean) {
      let s = this._getOrReturnCtx(e);
      return l(s, {
        code: d.invalid_type,
        expected: h.boolean,
        received: s.parsedType
      }), y;
    }
    return w(e.data);
  }
};
F.create = (r) => new F({
  typeName: v.ZodBoolean,
  coerce: r?.coerce || !1,
  ..._(r)
});
var U = class r extends g {
  static {
    c(this, "ZodDate");
  }
  _parse(e) {
    if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== h.date) {
      let a = this._getOrReturnCtx(e);
      return l(a, {
        code: d.invalid_type,
        expected: h.date,
        received: a.parsedType
      }), y;
    }
    if (isNaN(e.data.getTime())) {
      let a = this._getOrReturnCtx(e);
      return l(a, {
        code: d.invalid_date
      }), y;
    }
    let s = new b(), n;
    for (let a of this._def.checks)
      a.kind === "min" ? e.data.getTime() < a.value && (n = this._getOrReturnCtx(e, n), l(n, {
        code: d.too_small,
        message: a.message,
        inclusive: !0,
        exact: !1,
        minimum: a.value,
        type: "date"
      }), s.dirty()) : a.kind === "max" ? e.data.getTime() > a.value && (n = this._getOrReturnCtx(e, n), l(n, {
        code: d.too_big,
        message: a.message,
        inclusive: !0,
        exact: !1,
        maximum: a.value,
        type: "date"
      }), s.dirty()) : x.assertNever(a);
    return {
      status: s.value,
      value: new Date(e.data.getTime())
    };
  }
  _addCheck(e) {
    return new r({
      ...this._def,
      checks: [...this._def.checks, e]
    });
  }
  min(e, t) {
    return this._addCheck({
      kind: "min",
      value: e.getTime(),
      message: p.toString(t)
    });
  }
  max(e, t) {
    return this._addCheck({
      kind: "max",
      value: e.getTime(),
      message: p.toString(t)
    });
  }
  get minDate() {
    let e = null;
    for (let t of this._def.checks)
      t.kind === "min" && (e === null || t.value > e) && (e = t.value);
    return e != null ? new Date(e) : null;
  }
  get maxDate() {
    let e = null;
    for (let t of this._def.checks)
      t.kind === "max" && (e === null || t.value < e) && (e = t.value);
    return e != null ? new Date(e) : null;
  }
};
U.create = (r) => new U({
  checks: [],
  coerce: r?.coerce || !1,
  typeName: v.ZodDate,
  ..._(r)
});
var ae = class extends g {
  static {
    c(this, "ZodSymbol");
  }
  _parse(e) {
    if (this._getType(e) !== h.symbol) {
      let s = this._getOrReturnCtx(e);
      return l(s, {
        code: d.invalid_type,
        expected: h.symbol,
        received: s.parsedType
      }), y;
    }
    return w(e.data);
  }
};
ae.create = (r) => new ae({
  typeName: v.ZodSymbol,
  ..._(r)
});
var B = class extends g {
  static {
    c(this, "ZodUndefined");
  }
  _parse(e) {
    if (this._getType(e) !== h.undefined) {
      let s = this._getOrReturnCtx(e);
      return l(s, {
        code: d.invalid_type,
        expected: h.undefined,
        received: s.parsedType
      }), y;
    }
    return w(e.data);
  }
};
B.create = (r) => new B({
  typeName: v.ZodUndefined,
  ..._(r)
});
var W = class extends g {
  static {
    c(this, "ZodNull");
  }
  _parse(e) {
    if (this._getType(e) !== h.null) {
      let s = this._getOrReturnCtx(e);
      return l(s, {
        code: d.invalid_type,
        expected: h.null,
        received: s.parsedType
      }), y;
    }
    return w(e.data);
  }
};
W.create = (r) => new W({
  typeName: v.ZodNull,
  ..._(r)
});
var P = class extends g {
  static {
    c(this, "ZodAny");
  }
  constructor() {
    super(...arguments), this._any = !0;
  }
  _parse(e) {
    return w(e.data);
  }
};
P.create = (r) => new P({
  typeName: v.ZodAny,
  ..._(r)
});
var I = class extends g {
  static {
    c(this, "ZodUnknown");
  }
  constructor() {
    super(...arguments), this._unknown = !0;
  }
  _parse(e) {
    return w(e.data);
  }
};
I.create = (r) => new I({
  typeName: v.ZodUnknown,
  ..._(r)
});
var E = class extends g {
  static {
    c(this, "ZodNever");
  }
  _parse(e) {
    let t = this._getOrReturnCtx(e);
    return l(t, {
      code: d.invalid_type,
      expected: h.never,
      received: t.parsedType
    }), y;
  }
};
E.create = (r) => new E({
  typeName: v.ZodNever,
  ..._(r)
});
var ie = class extends g {
  static {
    c(this, "ZodVoid");
  }
  _parse(e) {
    if (this._getType(e) !== h.undefined) {
      let s = this._getOrReturnCtx(e);
      return l(s, {
        code: d.invalid_type,
        expected: h.void,
        received: s.parsedType
      }), y;
    }
    return w(e.data);
  }
};
ie.create = (r) => new ie({
  typeName: v.ZodVoid,
  ..._(r)
});
var $ = class r extends g {
  static {
    c(this, "ZodArray");
  }
  _parse(e) {
    let { ctx: t, status: s } = this._processInputParams(e), n = this._def;
    if (t.parsedType !== h.array)
      return l(t, {
        code: d.invalid_type,
        expected: h.array,
        received: t.parsedType
      }), y;
    if (n.exactLength !== null) {
      let i = t.data.length > n.exactLength.value, o = t.data.length < n.exactLength.value;
      (i || o) && (l(t, {
        code: i ? d.too_big : d.too_small,
        minimum: o ? n.exactLength.value : void 0,
        maximum: i ? n.exactLength.value : void 0,
        type: "array",
        inclusive: !0,
        exact: !0,
        message: n.exactLength.message
      }), s.dirty());
    }
    if (n.minLength !== null && t.data.length < n.minLength.value && (l(t, {
      code: d.too_small,
      minimum: n.minLength.value,
      type: "array",
      inclusive: !0,
      exact: !1,
      message: n.minLength.message
    }), s.dirty()), n.maxLength !== null && t.data.length > n.maxLength.value && (l(t, {
      code: d.too_big,
      maximum: n.maxLength.value,
      type: "array",
      inclusive: !0,
      exact: !1,
      message: n.maxLength.message
    }), s.dirty()), t.common.async)
      return Promise.all([...t.data].map((i, o) => n.type._parseAsync(new A(t, i, t.path, o)))).then((i) => b.mergeArray(s, i));
    let a = [...t.data].map((i, o) => n.type._parseSync(new A(t, i, t.path, o)));
    return b.mergeArray(s, a);
  }
  get element() {
    return this._def.type;
  }
  min(e, t) {
    return new r({
      ...this._def,
      minLength: { value: e, message: p.toString(t) }
    });
  }
  max(e, t) {
    return new r({
      ...this._def,
      maxLength: { value: e, message: p.toString(t) }
    });
  }
  length(e, t) {
    return new r({
      ...this._def,
      exactLength: { value: e, message: p.toString(t) }
    });
  }
  nonempty(e) {
    return this.min(1, e);
  }
};
$.create = (r, e) => new $({
  type: r,
  minLength: null,
  maxLength: null,
  exactLength: null,
  typeName: v.ZodArray,
  ..._(e)
});
function re(r) {
  if (r instanceof T) {
    let e = {};
    for (let t in r.shape) {
      let s = r.shape[t];
      e[t] = C.create(re(s));
    }
    return new T({
      ...r._def,
      shape: /* @__PURE__ */ c(() => e, "shape")
    });
  } else return r instanceof $ ? new $({
    ...r._def,
    type: re(r.element)
  }) : r instanceof C ? C.create(re(r.unwrap())) : r instanceof N ? N.create(re(r.unwrap())) : r instanceof j ? j.create(r.items.map((e) => re(e))) : r;
}
c(re, "deepPartialify");
var T = class r extends g {
  static {
    c(this, "ZodObject");
  }
  constructor() {
    super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
  }
  _getCached() {
    if (this._cached !== null)
      return this._cached;
    let e = this._def.shape(), t = x.objectKeys(e);
    return this._cached = { shape: e, keys: t };
  }
  _parse(e) {
    if (this._getType(e) !== h.object) {
      let u = this._getOrReturnCtx(e);
      return l(u, {
        code: d.invalid_type,
        expected: h.object,
        received: u.parsedType
      }), y;
    }
    let { status: s, ctx: n } = this._processInputParams(e), { shape: a, keys: i } = this._getCached(), o = [];
    if (!(this._def.catchall instanceof E && this._def.unknownKeys === "strip"))
      for (let u in n.data)
        i.includes(u) || o.push(u);
    let f = [];
    for (let u of i) {
      let m = a[u], k = n.data[u];
      f.push({
        key: { status: "valid", value: u },
        value: m._parse(new A(n, k, n.path, u)),
        alwaysSet: u in n.data
      });
    }
    if (this._def.catchall instanceof E) {
      let u = this._def.unknownKeys;
      if (u === "passthrough")
        for (let m of o)
          f.push({
            key: { status: "valid", value: m },
            value: { status: "valid", value: n.data[m] }
          });
      else if (u === "strict")
        o.length > 0 && (l(n, {
          code: d.unrecognized_keys,
          keys: o
        }), s.dirty());
      else if (u !== "strip") throw new Error("Internal ZodObject error: invalid unknownKeys value.");
    } else {
      let u = this._def.catchall;
      for (let m of o) {
        let k = n.data[m];
        f.push({
          key: { status: "valid", value: m },
          value: u._parse(
            new A(n, k, n.path, m)
            //, ctx.child(key), value, getParsedType(value)
          ),
          alwaysSet: m in n.data
        });
      }
    }
    return n.common.async ? Promise.resolve().then(async () => {
      let u = [];
      for (let m of f) {
        let k = await m.key, ve = await m.value;
        u.push({
          key: k,
          value: ve,
          alwaysSet: m.alwaysSet
        });
      }
      return u;
    }).then((u) => b.mergeObjectSync(s, u)) : b.mergeObjectSync(s, f);
  }
  get shape() {
    return this._def.shape();
  }
  strict(e) {
    return p.errToObj, new r({
      ...this._def,
      unknownKeys: "strict",
      ...e !== void 0 ? {
        errorMap: /* @__PURE__ */ c((t, s) => {
          var n, a, i, o;
          let f = (i = (a = (n = this._def).errorMap) === null || a === void 0 ? void 0 : a.call(n, t, s).message) !== null && i !== void 0 ? i : s.defaultError;
          return t.code === "unrecognized_keys" ? {
            message: (o = p.errToObj(e).message) !== null && o !== void 0 ? o : f
          } : {
            message: f
          };
        }, "errorMap")
      } : {}
    });
  }
  strip() {
    return new r({
      ...this._def,
      unknownKeys: "strip"
    });
  }
  passthrough() {
    return new r({
      ...this._def,
      unknownKeys: "passthrough"
    });
  }
  // const AugmentFactory =
  //   <Def extends ZodObjectDef>(def: Def) =>
  //   <Augmentation extends ZodRawShape>(
  //     augmentation: Augmentation
  //   ): ZodObject<
  //     extendShape<ReturnType<Def["shape"]>, Augmentation>,
  //     Def["unknownKeys"],
  //     Def["catchall"]
  //   > => {
  //     return new ZodObject({
  //       ...def,
  //       shape: () => ({
  //         ...def.shape(),
  //         ...augmentation,
  //       }),
  //     }) as any;
  //   };
  extend(e) {
    return new r({
      ...this._def,
      shape: /* @__PURE__ */ c(() => ({
        ...this._def.shape(),
        ...e
      }), "shape")
    });
  }
  /**
   * Prior to zod@1.0.12 there was a bug in the
   * inferred type of merged objects. Please
   * upgrade if you are experiencing issues.
   */
  merge(e) {
    return new r({
      unknownKeys: e._def.unknownKeys,
      catchall: e._def.catchall,
      shape: /* @__PURE__ */ c(() => ({
        ...this._def.shape(),
        ...e._def.shape()
      }), "shape"),
      typeName: v.ZodObject
    });
  }
  // merge<
  //   Incoming extends AnyZodObject,
  //   Augmentation extends Incoming["shape"],
  //   NewOutput extends {
  //     [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation
  //       ? Augmentation[k]["_output"]
  //       : k extends keyof Output
  //       ? Output[k]
  //       : never;
  //   },
  //   NewInput extends {
  //     [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation
  //       ? Augmentation[k]["_input"]
  //       : k extends keyof Input
  //       ? Input[k]
  //       : never;
  //   }
  // >(
  //   merging: Incoming
  // ): ZodObject<
  //   extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
  //   Incoming["_def"]["unknownKeys"],
  //   Incoming["_def"]["catchall"],
  //   NewOutput,
  //   NewInput
  // > {
  //   const merged: any = new ZodObject({
  //     unknownKeys: merging._def.unknownKeys,
  //     catchall: merging._def.catchall,
  //     shape: () =>
  //       objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
  //     typeName: ZodFirstPartyTypeKind.ZodObject,
  //   }) as any;
  //   return merged;
  // }
  setKey(e, t) {
    return this.augment({ [e]: t });
  }
  // merge<Incoming extends AnyZodObject>(
  //   merging: Incoming
  // ): //ZodObject<T & Incoming["_shape"], UnknownKeys, Catchall> = (merging) => {
  // ZodObject<
  //   extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
  //   Incoming["_def"]["unknownKeys"],
  //   Incoming["_def"]["catchall"]
  // > {
  //   // const mergedShape = objectUtil.mergeShapes(
  //   //   this._def.shape(),
  //   //   merging._def.shape()
  //   // );
  //   const merged: any = new ZodObject({
  //     unknownKeys: merging._def.unknownKeys,
  //     catchall: merging._def.catchall,
  //     shape: () =>
  //       objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
  //     typeName: ZodFirstPartyTypeKind.ZodObject,
  //   }) as any;
  //   return merged;
  // }
  catchall(e) {
    return new r({
      ...this._def,
      catchall: e
    });
  }
  pick(e) {
    let t = {};
    return x.objectKeys(e).forEach((s) => {
      e[s] && this.shape[s] && (t[s] = this.shape[s]);
    }), new r({
      ...this._def,
      shape: /* @__PURE__ */ c(() => t, "shape")
    });
  }
  omit(e) {
    let t = {};
    return x.objectKeys(this.shape).forEach((s) => {
      e[s] || (t[s] = this.shape[s]);
    }), new r({
      ...this._def,
      shape: /* @__PURE__ */ c(() => t, "shape")
    });
  }
  /**
   * @deprecated
   */
  deepPartial() {
    return re(this);
  }
  partial(e) {
    let t = {};
    return x.objectKeys(this.shape).forEach((s) => {
      let n = this.shape[s];
      e && !e[s] ? t[s] = n : t[s] = n.optional();
    }), new r({
      ...this._def,
      shape: /* @__PURE__ */ c(() => t, "shape")
    });
  }
  required(e) {
    let t = {};
    return x.objectKeys(this.shape).forEach((s) => {
      if (e && !e[s])
        t[s] = this.shape[s];
      else {
        let a = this.shape[s];
        for (; a instanceof C; )
          a = a._def.innerType;
        t[s] = a;
      }
    }), new r({
      ...this._def,
      shape: /* @__PURE__ */ c(() => t, "shape")
    });
  }
  keyof() {
    return De(x.objectKeys(this.shape));
  }
};
T.create = (r, e) => new T({
  shape: /* @__PURE__ */ c(() => r, "shape"),
  unknownKeys: "strip",
  catchall: E.create(),
  typeName: v.ZodObject,
  ..._(e)
});
T.strictCreate = (r, e) => new T({
  shape: /* @__PURE__ */ c(() => r, "shape"),
  unknownKeys: "strict",
  catchall: E.create(),
  typeName: v.ZodObject,
  ..._(e)
});
T.lazycreate = (r, e) => new T({
  shape: r,
  unknownKeys: "strip",
  catchall: E.create(),
  typeName: v.ZodObject,
  ..._(e)
});
var q = class extends g {
  static {
    c(this, "ZodUnion");
  }
  _parse(e) {
    let { ctx: t } = this._processInputParams(e), s = this._def.options;
    function n(a) {
      for (let o of a)
        if (o.result.status === "valid")
          return o.result;
      for (let o of a)
        if (o.result.status === "dirty")
          return t.common.issues.push(...o.ctx.common.issues), o.result;
      let i = a.map((o) => new S(o.ctx.common.issues));
      return l(t, {
        code: d.invalid_union,
        unionErrors: i
      }), y;
    }
    if (c(n, "handleResults"), t.common.async)
      return Promise.all(s.map(async (a) => {
        let i = {
          ...t,
          common: {
            ...t.common,
            issues: []
          },
          parent: null
        };
        return {
          result: await a._parseAsync({
            data: t.data,
            path: t.path,
            parent: i
          }),
          ctx: i
        };
      })).then(n);
    {
      let a, i = [];
      for (let f of s) {
        let u = {
          ...t,
          common: {
            ...t.common,
            issues: []
          },
          parent: null
        }, m = f._parseSync({
          data: t.data,
          path: t.path,
          parent: u
        });
        if (m.status === "valid")
          return m;
        m.status === "dirty" && !a && (a = { result: m, ctx: u }), u.common.issues.length && i.push(u.common.issues);
      }
      if (a)
        return t.common.issues.push(...a.ctx.common.issues), a.result;
      let o = i.map((f) => new S(f));
      return l(t, {
        code: d.invalid_union,
        unionErrors: o
      }), y;
    }
  }
  get options() {
    return this._def.options;
  }
};
q.create = (r, e) => new q({
  options: r,
  typeName: v.ZodUnion,
  ..._(e)
});
var R = /* @__PURE__ */ c((r) => r instanceof Y ? R(r.schema) : r instanceof O ? R(r.innerType()) : r instanceof G ? [r.value] : r instanceof H ? r.options : r instanceof X ? x.objectValues(r.enum) : r instanceof Q ? R(r._def.innerType) : r instanceof B ? [void 0] : r instanceof W ? [null] : r instanceof C ? [void 0, ...R(r.unwrap())] : r instanceof N ? [null, ...R(r.unwrap())] : r instanceof pe || r instanceof ee ? R(r.unwrap()) : r instanceof K ? R(r._def.innerType) : [], "getDiscriminator"), xe = class r extends g {
  static {
    c(this, "ZodDiscriminatedUnion");
  }
  _parse(e) {
    let { ctx: t } = this._processInputParams(e);
    if (t.parsedType !== h.object)
      return l(t, {
        code: d.invalid_type,
        expected: h.object,
        received: t.parsedType
      }), y;
    let s = this.discriminator, n = t.data[s], a = this.optionsMap.get(n);
    return a ? t.common.async ? a._parseAsync({
      data: t.data,
      path: t.path,
      parent: t
    }) : a._parseSync({
      data: t.data,
      path: t.path,
      parent: t
    }) : (l(t, {
      code: d.invalid_union_discriminator,
      options: Array.from(this.optionsMap.keys()),
      path: [s]
    }), y);
  }
  get discriminator() {
    return this._def.discriminator;
  }
  get options() {
    return this._def.options;
  }
  get optionsMap() {
    return this._def.optionsMap;
  }
  /**
   * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.
   * However, it only allows a union of objects, all of which need to share a discriminator property. This property must
   * have a different value for each object in the union.
   * @param discriminator the name of the discriminator property
   * @param types an array of object schemas
   * @param params
   */
  static create(e, t, s) {
    let n = /* @__PURE__ */ new Map();
    for (let a of t) {
      let i = R(a.shape[e]);
      if (!i.length)
        throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
      for (let o of i) {
        if (n.has(o))
          throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);
        n.set(o, a);
      }
    }
    return new r({
      typeName: v.ZodDiscriminatedUnion,
      discriminator: e,
      options: t,
      optionsMap: n,
      ..._(s)
    });
  }
};
function Ee(r, e) {
  let t = Z(r), s = Z(e);
  if (r === e)
    return { valid: !0, data: r };
  if (t === h.object && s === h.object) {
    let n = x.objectKeys(e), a = x.objectKeys(r).filter((o) => n.indexOf(o) !== -1), i = { ...r, ...e };
    for (let o of a) {
      let f = Ee(r[o], e[o]);
      if (!f.valid)
        return { valid: !1 };
      i[o] = f.data;
    }
    return { valid: !0, data: i };
  } else if (t === h.array && s === h.array) {
    if (r.length !== e.length)
      return { valid: !1 };
    let n = [];
    for (let a = 0; a < r.length; a++) {
      let i = r[a], o = e[a], f = Ee(i, o);
      if (!f.valid)
        return { valid: !1 };
      n.push(f.data);
    }
    return { valid: !0, data: n };
  } else return t === h.date && s === h.date && +r == +e ? { valid: !0, data: r } : { valid: !1 };
}
c(Ee, "mergeValues");
var J = class extends g {
  static {
    c(this, "ZodIntersection");
  }
  _parse(e) {
    let { status: t, ctx: s } = this._processInputParams(e), n = /* @__PURE__ */ c((a, i) => {
      if (Ce(a) || Ce(i))
        return y;
      let o = Ee(a.value, i.value);
      return o.valid ? ((Ae(a) || Ae(i)) && t.dirty(), { status: t.value, value: o.data }) : (l(s, {
        code: d.invalid_intersection_types
      }), y);
    }, "handleParsed");
    return s.common.async ? Promise.all([
      this._def.left._parseAsync({
        data: s.data,
        path: s.path,
        parent: s
      }),
      this._def.right._parseAsync({
        data: s.data,
        path: s.path,
        parent: s
      })
    ]).then(([a, i]) => n(a, i)) : n(this._def.left._parseSync({
      data: s.data,
      path: s.path,
      parent: s
    }), this._def.right._parseSync({
      data: s.data,
      path: s.path,
      parent: s
    }));
  }
};
J.create = (r, e, t) => new J({
  left: r,
  right: e,
  typeName: v.ZodIntersection,
  ..._(t)
});
var j = class r extends g {
  static {
    c(this, "ZodTuple");
  }
  _parse(e) {
    let { status: t, ctx: s } = this._processInputParams(e);
    if (s.parsedType !== h.array)
      return l(s, {
        code: d.invalid_type,
        expected: h.array,
        received: s.parsedType
      }), y;
    if (s.data.length < this._def.items.length)
      return l(s, {
        code: d.too_small,
        minimum: this._def.items.length,
        inclusive: !0,
        exact: !1,
        type: "array"
      }), y;
    !this._def.rest && s.data.length > this._def.items.length && (l(s, {
      code: d.too_big,
      maximum: this._def.items.length,
      inclusive: !0,
      exact: !1,
      type: "array"
    }), t.dirty());
    let a = [...s.data].map((i, o) => {
      let f = this._def.items[o] || this._def.rest;
      return f ? f._parse(new A(s, i, s.path, o)) : null;
    }).filter((i) => !!i);
    return s.common.async ? Promise.all(a).then((i) => b.mergeArray(t, i)) : b.mergeArray(t, a);
  }
  get items() {
    return this._def.items;
  }
  rest(e) {
    return new r({
      ...this._def,
      rest: e
    });
  }
};
j.create = (r, e) => {
  if (!Array.isArray(r))
    throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
  return new j({
    items: r,
    typeName: v.ZodTuple,
    rest: null,
    ..._(e)
  });
};
var be = class r extends g {
  static {
    c(this, "ZodRecord");
  }
  get keySchema() {
    return this._def.keyType;
  }
  get valueSchema() {
    return this._def.valueType;
  }
  _parse(e) {
    let { status: t, ctx: s } = this._processInputParams(e);
    if (s.parsedType !== h.object)
      return l(s, {
        code: d.invalid_type,
        expected: h.object,
        received: s.parsedType
      }), y;
    let n = [], a = this._def.keyType, i = this._def.valueType;
    for (let o in s.data)
      n.push({
        key: a._parse(new A(s, o, s.path, o)),
        value: i._parse(new A(s, s.data[o], s.path, o)),
        alwaysSet: o in s.data
      });
    return s.common.async ? b.mergeObjectAsync(t, n) : b.mergeObjectSync(t, n);
  }
  get element() {
    return this._def.valueType;
  }
  static create(e, t, s) {
    return t instanceof g ? new r({
      keyType: e,
      valueType: t,
      typeName: v.ZodRecord,
      ..._(s)
    }) : new r({
      keyType: M.create(),
      valueType: e,
      typeName: v.ZodRecord,
      ..._(t)
    });
  }
}, oe = class extends g {
  static {
    c(this, "ZodMap");
  }
  get keySchema() {
    return this._def.keyType;
  }
  get valueSchema() {
    return this._def.valueType;
  }
  _parse(e) {
    let { status: t, ctx: s } = this._processInputParams(e);
    if (s.parsedType !== h.map)
      return l(s, {
        code: d.invalid_type,
        expected: h.map,
        received: s.parsedType
      }), y;
    let n = this._def.keyType, a = this._def.valueType, i = [...s.data.entries()].map(([o, f], u) => ({
      key: n._parse(new A(s, o, s.path, [u, "key"])),
      value: a._parse(new A(s, f, s.path, [u, "value"]))
    }));
    if (s.common.async) {
      let o = /* @__PURE__ */ new Map();
      return Promise.resolve().then(async () => {
        for (let f of i) {
          let u = await f.key, m = await f.value;
          if (u.status === "aborted" || m.status === "aborted")
            return y;
          (u.status === "dirty" || m.status === "dirty") && t.dirty(), o.set(u.value, m.value);
        }
        return { status: t.value, value: o };
      });
    } else {
      let o = /* @__PURE__ */ new Map();
      for (let f of i) {
        let u = f.key, m = f.value;
        if (u.status === "aborted" || m.status === "aborted")
          return y;
        (u.status === "dirty" || m.status === "dirty") && t.dirty(), o.set(u.value, m.value);
      }
      return { status: t.value, value: o };
    }
  }
};
oe.create = (r, e, t) => new oe({
  valueType: e,
  keyType: r,
  typeName: v.ZodMap,
  ..._(t)
});
var ce = class r extends g {
  static {
    c(this, "ZodSet");
  }
  _parse(e) {
    let { status: t, ctx: s } = this._processInputParams(e);
    if (s.parsedType !== h.set)
      return l(s, {
        code: d.invalid_type,
        expected: h.set,
        received: s.parsedType
      }), y;
    let n = this._def;
    n.minSize !== null && s.data.size < n.minSize.value && (l(s, {
      code: d.too_small,
      minimum: n.minSize.value,
      type: "set",
      inclusive: !0,
      exact: !1,
      message: n.minSize.message
    }), t.dirty()), n.maxSize !== null && s.data.size > n.maxSize.value && (l(s, {
      code: d.too_big,
      maximum: n.maxSize.value,
      type: "set",
      inclusive: !0,
      exact: !1,
      message: n.maxSize.message
    }), t.dirty());
    let a = this._def.valueType;
    function i(f) {
      let u = /* @__PURE__ */ new Set();
      for (let m of f) {
        if (m.status === "aborted")
          return y;
        m.status === "dirty" && t.dirty(), u.add(m.value);
      }
      return { status: t.value, value: u };
    }
    c(i, "finalizeSet");
    let o = [...s.data.values()].map((f, u) => a._parse(new A(s, f, s.path, u)));
    return s.common.async ? Promise.all(o).then((f) => i(f)) : i(o);
  }
  min(e, t) {
    return new r({
      ...this._def,
      minSize: { value: e, message: p.toString(t) }
    });
  }
  max(e, t) {
    return new r({
      ...this._def,
      maxSize: { value: e, message: p.toString(t) }
    });
  }
  size(e, t) {
    return this.min(e, t).max(e, t);
  }
  nonempty(e) {
    return this.min(1, e);
  }
};
ce.create = (r, e) => new ce({
  valueType: r,
  minSize: null,
  maxSize: null,
  typeName: v.ZodSet,
  ..._(e)
});
var ke = class r extends g {
  static {
    c(this, "ZodFunction");
  }
  constructor() {
    super(...arguments), this.validate = this.implement;
  }
  _parse(e) {
    let { ctx: t } = this._processInputParams(e);
    if (t.parsedType !== h.function)
      return l(t, {
        code: d.invalid_type,
        expected: h.function,
        received: t.parsedType
      }), y;
    function s(o, f) {
      return _e({
        data: o,
        path: t.path,
        errorMaps: [
          t.common.contextualErrorMap,
          t.schemaErrorMap,
          ye(),
          ne
        ].filter((u) => !!u),
        issueData: {
          code: d.invalid_arguments,
          argumentsError: f
        }
      });
    }
    c(s, "makeArgsIssue");
    function n(o, f) {
      return _e({
        data: o,
        path: t.path,
        errorMaps: [
          t.common.contextualErrorMap,
          t.schemaErrorMap,
          ye(),
          ne
        ].filter((u) => !!u),
        issueData: {
          code: d.invalid_return_type,
          returnTypeError: f
        }
      });
    }
    c(n, "makeReturnsIssue");
    let a = { errorMap: t.common.contextualErrorMap }, i = t.data;
    if (this._def.returns instanceof V) {
      let o = this;
      return w(async function(...f) {
        let u = new S([]), m = await o._def.args.parseAsync(f, a).catch((Te) => {
          throw u.addIssue(s(f, Te)), u;
        }), k = await Reflect.apply(i, this, m);
        return await o._def.returns._def.type.parseAsync(k, a).catch((Te) => {
          throw u.addIssue(n(k, Te)), u;
        });
      });
    } else {
      let o = this;
      return w(function(...f) {
        let u = o._def.args.safeParse(f, a);
        if (!u.success)
          throw new S([s(f, u.error)]);
        let m = Reflect.apply(i, this, u.data), k = o._def.returns.safeParse(m, a);
        if (!k.success)
          throw new S([n(m, k.error)]);
        return k.data;
      });
    }
  }
  parameters() {
    return this._def.args;
  }
  returnType() {
    return this._def.returns;
  }
  args(...e) {
    return new r({
      ...this._def,
      args: j.create(e).rest(I.create())
    });
  }
  returns(e) {
    return new r({
      ...this._def,
      returns: e
    });
  }
  implement(e) {
    return this.parse(e);
  }
  strictImplement(e) {
    return this.parse(e);
  }
  static create(e, t, s) {
    return new r({
      args: e || j.create([]).rest(I.create()),
      returns: t || I.create(),
      typeName: v.ZodFunction,
      ..._(s)
    });
  }
}, Y = class extends g {
  static {
    c(this, "ZodLazy");
  }
  get schema() {
    return this._def.getter();
  }
  _parse(e) {
    let { ctx: t } = this._processInputParams(e);
    return this._def.getter()._parse({ data: t.data, path: t.path, parent: t });
  }
};
Y.create = (r, e) => new Y({
  getter: r,
  typeName: v.ZodLazy,
  ..._(e)
});
var G = class extends g {
  static {
    c(this, "ZodLiteral");
  }
  _parse(e) {
    if (e.data !== this._def.value) {
      let t = this._getOrReturnCtx(e);
      return l(t, {
        received: t.data,
        code: d.invalid_literal,
        expected: this._def.value
      }), y;
    }
    return { status: "valid", value: e.data };
  }
  get value() {
    return this._def.value;
  }
};
G.create = (r, e) => new G({
  value: r,
  typeName: v.ZodLiteral,
  ..._(e)
});
function De(r, e) {
  return new H({
    values: r,
    typeName: v.ZodEnum,
    ..._(e)
  });
}
c(De, "createZodEnum");
var H = class r extends g {
  static {
    c(this, "ZodEnum");
  }
  constructor() {
    super(...arguments), le.set(this, void 0);
  }
  _parse(e) {
    if (typeof e.data != "string") {
      let t = this._getOrReturnCtx(e), s = this._def.values;
      return l(t, {
        expected: x.joinValues(s),
        received: t.parsedType,
        code: d.invalid_type
      }), y;
    }
    if (ge(this, le, "f") || Me(this, le, new Set(this._def.values), "f"), !ge(this, le, "f").has(e.data)) {
      let t = this._getOrReturnCtx(e), s = this._def.values;
      return l(t, {
        received: t.data,
        code: d.invalid_enum_value,
        options: s
      }), y;
    }
    return w(e.data);
  }
  get options() {
    return this._def.values;
  }
  get enum() {
    let e = {};
    for (let t of this._def.values)
      e[t] = t;
    return e;
  }
  get Values() {
    let e = {};
    for (let t of this._def.values)
      e[t] = t;
    return e;
  }
  get Enum() {
    let e = {};
    for (let t of this._def.values)
      e[t] = t;
    return e;
  }
  extract(e, t = this._def) {
    return r.create(e, {
      ...this._def,
      ...t
    });
  }
  exclude(e, t = this._def) {
    return r.create(this.options.filter((s) => !e.includes(s)), {
      ...this._def,
      ...t
    });
  }
};
le = /* @__PURE__ */ new WeakMap();
H.create = De;
var X = class extends g {
  static {
    c(this, "ZodNativeEnum");
  }
  constructor() {
    super(...arguments), fe.set(this, void 0);
  }
  _parse(e) {
    let t = x.getValidEnumValues(this._def.values), s = this._getOrReturnCtx(e);
    if (s.parsedType !== h.string && s.parsedType !== h.number) {
      let n = x.objectValues(t);
      return l(s, {
        expected: x.joinValues(n),
        received: s.parsedType,
        code: d.invalid_type
      }), y;
    }
    if (ge(this, fe, "f") || Me(this, fe, new Set(x.getValidEnumValues(this._def.values)), "f"), !ge(this, fe, "f").has(e.data)) {
      let n = x.objectValues(t);
      return l(s, {
        received: s.data,
        code: d.invalid_enum_value,
        options: n
      }), y;
    }
    return w(e.data);
  }
  get enum() {
    return this._def.values;
  }
};
fe = /* @__PURE__ */ new WeakMap();
X.create = (r, e) => new X({
  values: r,
  typeName: v.ZodNativeEnum,
  ..._(e)
});
var V = class extends g {
  static {
    c(this, "ZodPromise");
  }
  unwrap() {
    return this._def.type;
  }
  _parse(e) {
    let { ctx: t } = this._processInputParams(e);
    if (t.parsedType !== h.promise && t.common.async === !1)
      return l(t, {
        code: d.invalid_type,
        expected: h.promise,
        received: t.parsedType
      }), y;
    let s = t.parsedType === h.promise ? t.data : Promise.resolve(t.data);
    return w(s.then((n) => this._def.type.parseAsync(n, {
      path: t.path,
      errorMap: t.common.contextualErrorMap
    })));
  }
};
V.create = (r, e) => new V({
  type: r,
  typeName: v.ZodPromise,
  ..._(e)
});
var O = class extends g {
  static {
    c(this, "ZodEffects");
  }
  innerType() {
    return this._def.schema;
  }
  sourceType() {
    return this._def.schema._def.typeName === v.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
  }
  _parse(e) {
    let { status: t, ctx: s } = this._processInputParams(e), n = this._def.effect || null, a = {
      addIssue: /* @__PURE__ */ c((i) => {
        l(s, i), i.fatal ? t.abort() : t.dirty();
      }, "addIssue"),
      get path() {
        return s.path;
      }
    };
    if (a.addIssue = a.addIssue.bind(a), n.type === "preprocess") {
      let i = n.transform(s.data, a);
      if (s.common.async)
        return Promise.resolve(i).then(async (o) => {
          if (t.value === "aborted")
            return y;
          let f = await this._def.schema._parseAsync({
            data: o,
            path: s.path,
            parent: s
          });
          return f.status === "aborted" ? y : f.status === "dirty" || t.value === "dirty" ? se(f.value) : f;
        });
      {
        if (t.value === "aborted")
          return y;
        let o = this._def.schema._parseSync({
          data: i,
          path: s.path,
          parent: s
        });
        return o.status === "aborted" ? y : o.status === "dirty" || t.value === "dirty" ? se(o.value) : o;
      }
    }
    if (n.type === "refinement") {
      let i = /* @__PURE__ */ c((o) => {
        let f = n.refinement(o, a);
        if (s.common.async)
          return Promise.resolve(f);
        if (f instanceof Promise)
          throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
        return o;
      }, "executeRefinement");
      if (s.common.async === !1) {
        let o = this._def.schema._parseSync({
          data: s.data,
          path: s.path,
          parent: s
        });
        return o.status === "aborted" ? y : (o.status === "dirty" && t.dirty(), i(o.value), { status: t.value, value: o.value });
      } else
        return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((o) => o.status === "aborted" ? y : (o.status === "dirty" && t.dirty(), i(o.value).then(() => ({ status: t.value, value: o.value }))));
    }
    if (n.type === "transform")
      if (s.common.async === !1) {
        let i = this._def.schema._parseSync({
          data: s.data,
          path: s.path,
          parent: s
        });
        if (!z(i))
          return i;
        let o = n.transform(i.value, a);
        if (o instanceof Promise)
          throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
        return { status: t.value, value: o };
      } else
        return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((i) => z(i) ? Promise.resolve(n.transform(i.value, a)).then((o) => ({ status: t.value, value: o })) : i);
    x.assertNever(n);
  }
};
O.create = (r, e, t) => new O({
  schema: r,
  typeName: v.ZodEffects,
  effect: e,
  ..._(t)
});
O.createWithPreprocess = (r, e, t) => new O({
  schema: e,
  effect: { type: "preprocess", transform: r },
  typeName: v.ZodEffects,
  ..._(t)
});
var C = class extends g {
  static {
    c(this, "ZodOptional");
  }
  _parse(e) {
    return this._getType(e) === h.undefined ? w(void 0) : this._def.innerType._parse(e);
  }
  unwrap() {
    return this._def.innerType;
  }
};
C.create = (r, e) => new C({
  innerType: r,
  typeName: v.ZodOptional,
  ..._(e)
});
var N = class extends g {
  static {
    c(this, "ZodNullable");
  }
  _parse(e) {
    return this._getType(e) === h.null ? w(null) : this._def.innerType._parse(e);
  }
  unwrap() {
    return this._def.innerType;
  }
};
N.create = (r, e) => new N({
  innerType: r,
  typeName: v.ZodNullable,
  ..._(e)
});
var Q = class extends g {
  static {
    c(this, "ZodDefault");
  }
  _parse(e) {
    let { ctx: t } = this._processInputParams(e), s = t.data;
    return t.parsedType === h.undefined && (s = this._def.defaultValue()), this._def.innerType._parse({
      data: s,
      path: t.path,
      parent: t
    });
  }
  removeDefault() {
    return this._def.innerType;
  }
};
Q.create = (r, e) => new Q({
  innerType: r,
  typeName: v.ZodDefault,
  defaultValue: typeof e.default == "function" ? e.default : () => e.default,
  ..._(e)
});
var K = class extends g {
  static {
    c(this, "ZodCatch");
  }
  _parse(e) {
    let { ctx: t } = this._processInputParams(e), s = {
      ...t,
      common: {
        ...t.common,
        issues: []
      }
    }, n = this._def.innerType._parse({
      data: s.data,
      path: s.path,
      parent: {
        ...s
      }
    });
    return he(n) ? n.then((a) => ({
      status: "valid",
      value: a.status === "valid" ? a.value : this._def.catchValue({
        get error() {
          return new S(s.common.issues);
        },
        input: s.data
      })
    })) : {
      status: "valid",
      value: n.status === "valid" ? n.value : this._def.catchValue({
        get error() {
          return new S(s.common.issues);
        },
        input: s.data
      })
    };
  }
  removeCatch() {
    return this._def.innerType;
  }
};
K.create = (r, e) => new K({
  innerType: r,
  typeName: v.ZodCatch,
  catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
  ..._(e)
});
var de = class extends g {
  static {
    c(this, "ZodNaN");
  }
  _parse(e) {
    if (this._getType(e) !== h.nan) {
      let s = this._getOrReturnCtx(e);
      return l(s, {
        code: d.invalid_type,
        expected: h.nan,
        received: s.parsedType
      }), y;
    }
    return { status: "valid", value: e.data };
  }
};
de.create = (r) => new de({
  typeName: v.ZodNaN,
  ..._(r)
});
var mt = Symbol("zod_brand"), pe = class extends g {
  static {
    c(this, "ZodBranded");
  }
  _parse(e) {
    let { ctx: t } = this._processInputParams(e), s = t.data;
    return this._def.type._parse({
      data: s,
      path: t.path,
      parent: t
    });
  }
  unwrap() {
    return this._def.type;
  }
}, me = class r extends g {
  static {
    c(this, "ZodPipeline");
  }
  _parse(e) {
    let { status: t, ctx: s } = this._processInputParams(e);
    if (s.common.async)
      return (/* @__PURE__ */ c(async () => {
        let a = await this._def.in._parseAsync({
          data: s.data,
          path: s.path,
          parent: s
        });
        return a.status === "aborted" ? y : a.status === "dirty" ? (t.dirty(), se(a.value)) : this._def.out._parseAsync({
          data: a.value,
          path: s.path,
          parent: s
        });
      }, "handleAsync"))();
    {
      let n = this._def.in._parseSync({
        data: s.data,
        path: s.path,
        parent: s
      });
      return n.status === "aborted" ? y : n.status === "dirty" ? (t.dirty(), {
        status: "dirty",
        value: n.value
      }) : this._def.out._parseSync({
        data: n.value,
        path: s.path,
        parent: s
      });
    }
  }
  static create(e, t) {
    return new r({
      in: e,
      out: t,
      typeName: v.ZodPipeline
    });
  }
}, ee = class extends g {
  static {
    c(this, "ZodReadonly");
  }
  _parse(e) {
    let t = this._def.innerType._parse(e), s = /* @__PURE__ */ c((n) => (z(n) && (n.value = Object.freeze(n.value)), n), "freeze");
    return he(t) ? t.then((n) => s(n)) : s(t);
  }
  unwrap() {
    return this._def.innerType;
  }
};
ee.create = (r, e) => new ee({
  innerType: r,
  typeName: v.ZodReadonly,
  ..._(e)
});
function Ze(r, e) {
  let t = typeof r == "function" ? r(e) : typeof r == "string" ? { message: r } : r;
  return typeof t == "string" ? { message: t } : t;
}
c(Ze, "cleanParams");
function Le(r, e = {}, t) {
  return r ? P.create().superRefine((s, n) => {
    var a, i;
    let o = r(s);
    if (o instanceof Promise)
      return o.then((f) => {
        var u, m;
        if (!f) {
          let k = Ze(e, s), ve = (m = (u = k.fatal) !== null && u !== void 0 ? u : t) !== null && m !== void 0 ? m : !0;
          n.addIssue({ code: "custom", ...k, fatal: ve });
        }
      });
    if (!o) {
      let f = Ze(e, s), u = (i = (a = f.fatal) !== null && a !== void 0 ? a : t) !== null && i !== void 0 ? i : !0;
      n.addIssue({ code: "custom", ...f, fatal: u });
    }
  }) : P.create();
}
c(Le, "custom");
var vt = {
  object: T.lazycreate
}, v;
(function(r) {
  r.ZodString = "ZodString", r.ZodNumber = "ZodNumber", r.ZodNaN = "ZodNaN", r.ZodBigInt = "ZodBigInt", r.ZodBoolean = "ZodBoolean", r.ZodDate = "ZodDate", r.ZodSymbol = "ZodSymbol", r.ZodUndefined = "ZodUndefined", r.ZodNull = "ZodNull", r.ZodAny = "ZodAny", r.ZodUnknown = "ZodUnknown", r.ZodNever = "ZodNever", r.ZodVoid = "ZodVoid", r.ZodArray = "ZodArray", r.ZodObject = "ZodObject", r.ZodUnion = "ZodUnion", r.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", r.ZodIntersection = "ZodIntersection", r.ZodTuple = "ZodTuple", r.ZodRecord = "ZodRecord", r.ZodMap = "ZodMap", r.ZodSet = "ZodSet", r.ZodFunction = "ZodFunction", r.ZodLazy = "ZodLazy", r.ZodLiteral = "ZodLiteral", r.ZodEnum = "ZodEnum", r.ZodEffects = "ZodEffects", r.ZodNativeEnum = "ZodNativeEnum", r.ZodOptional = "ZodOptional", r.ZodNullable = "ZodNullable", r.ZodDefault = "ZodDefault", r.ZodCatch = "ZodCatch", r.ZodPromise = "ZodPromise", r.ZodBranded = "ZodBranded", r.ZodPipeline = "ZodPipeline", r.ZodReadonly = "ZodReadonly";
})(v || (v = {}));
var yt = /* @__PURE__ */ c((r, e = {
  message: `Input not instance of ${r.name}`
}) => Le((t) => t instanceof r, e), "instanceOfType"), Fe = M.create, Ue = D.create, _t = de.create, gt = L.create, Be = F.create, xt = U.create, bt = ae.create, kt = B.create, wt = W.create, Tt = P.create, St = I.create, Ot = E.create, Ct = ie.create, At = $.create, Et = T.create, jt = T.strictCreate, Nt = q.create, Rt = xe.create, Zt = J.create, It = j.create, $t = be.create, Mt = oe.create, Pt = ce.create, Vt = ke.create, zt = Y.create, Dt = G.create, Lt = H.create, Ft = X.create, Ut = V.create, Ie = O.create, Bt = C.create, Wt = N.create, qt = O.createWithPreprocess, Jt = me.create, Yt = /* @__PURE__ */ c(() => Fe().optional(), "ostring"), Gt = /* @__PURE__ */ c(() => Ue().optional(), "onumber"), Ht = /* @__PURE__ */ c(() => Be().optional(), "oboolean"), Xt = {
  string: /* @__PURE__ */ c((r) => M.create({ ...r, coerce: !0 }), "string"),
  number: /* @__PURE__ */ c((r) => D.create({ ...r, coerce: !0 }), "number"),
  boolean: /* @__PURE__ */ c((r) => F.create({
    ...r,
    coerce: !0
  }), "boolean"),
  bigint: /* @__PURE__ */ c((r) => L.create({ ...r, coerce: !0 }), "bigint"),
  date: /* @__PURE__ */ c((r) => U.create({ ...r, coerce: !0 }), "date")
}, Qt = y, ue = Object.freeze({
  __proto__: null,
  defaultErrorMap: ne,
  setErrorMap: qe,
  getErrorMap: ye,
  makeIssue: _e,
  EMPTY_PATH: Je,
  addIssueToContext: l,
  ParseStatus: b,
  INVALID: y,
  DIRTY: se,
  OK: w,
  isAborted: Ce,
  isDirty: Ae,
  isValid: z,
  isAsync: he,
  get util() {
    return x;
  },
  get objectUtil() {
    return Oe;
  },
  ZodParsedType: h,
  getParsedType: Z,
  ZodType: g,
  datetimeRegex: ze,
  ZodString: M,
  ZodNumber: D,
  ZodBigInt: L,
  ZodBoolean: F,
  ZodDate: U,
  ZodSymbol: ae,
  ZodUndefined: B,
  ZodNull: W,
  ZodAny: P,
  ZodUnknown: I,
  ZodNever: E,
  ZodVoid: ie,
  ZodArray: $,
  ZodObject: T,
  ZodUnion: q,
  ZodDiscriminatedUnion: xe,
  ZodIntersection: J,
  ZodTuple: j,
  ZodRecord: be,
  ZodMap: oe,
  ZodSet: ce,
  ZodFunction: ke,
  ZodLazy: Y,
  ZodLiteral: G,
  ZodEnum: H,
  ZodNativeEnum: X,
  ZodPromise: V,
  ZodEffects: O,
  ZodTransformer: O,
  ZodOptional: C,
  ZodNullable: N,
  ZodDefault: Q,
  ZodCatch: K,
  ZodNaN: de,
  BRAND: mt,
  ZodBranded: pe,
  ZodPipeline: me,
  ZodReadonly: ee,
  custom: Le,
  Schema: g,
  ZodSchema: g,
  late: vt,
  get ZodFirstPartyTypeKind() {
    return v;
  },
  coerce: Xt,
  any: Tt,
  array: At,
  bigint: gt,
  boolean: Be,
  date: xt,
  discriminatedUnion: Rt,
  effect: Ie,
  enum: Lt,
  function: Vt,
  instanceof: yt,
  intersection: Zt,
  lazy: zt,
  literal: Dt,
  map: Mt,
  nan: _t,
  nativeEnum: Ft,
  never: Ot,
  null: wt,
  nullable: Wt,
  number: Ue,
  object: Et,
  oboolean: Ht,
  onumber: Gt,
  optional: Bt,
  ostring: Yt,
  pipeline: Jt,
  preprocess: qt,
  promise: Ut,
  record: $t,
  set: Pt,
  strictObject: jt,
  string: Fe,
  symbol: bt,
  transformer: Ie,
  tuple: It,
  undefined: kt,
  union: Nt,
  unknown: St,
  void: Ct,
  NEVER: Qt,
  ZodIssueCode: d,
  quotelessJson: We,
  ZodError: S
});

// src/cli/globalSettings.ts
var rr = tr(Kt(), ".storybook", "settings.json"), sr = 1, nr = ue.object({
  version: ue.number(),
  // NOTE: every key (and subkey) below must be optional, for forwards compatibility reasons
  // (we can remove keys once they are deprecated)
  userSince: ue.number().optional(),
  init: ue.object({ skipOnboarding: ue.boolean().optional() }).optional()
}), te;
async function fr(r = rr) {
  if (te)
    return te;
  try {
    let e = await je.readFile(r, "utf8"), t = nr.parse(JSON.parse(e));
    te = new we(r, t);
  } catch {
    te = new we(r, { version: sr, userSince: Date.now() }), await te.save();
  }
  return te;
}
c(fr, "globalSettings");
function hr() {
  te = void 0;
}
c(hr, "_clearGlobalSettings");
var we = class {
  static {
    c(this, "Settings");
  }
  /**
   * Create a new Settings instance
   *
   * @param filePath Path to the JSON settings file
   * @param value Loaded value of settings
   */
  constructor(e, t) {
    this.filePath = e, this.value = t;
  }
  /** Save settings to the file */
  async save() {
    try {
      await je.mkdir(er(this.filePath), { recursive: !0 }), await je.writeFile(this.filePath, JSON.stringify(this.value, null, 2));
    } catch (e) {
      throw new Ne({
        filePath: this.filePath,
        error: e
      });
    }
  }
};

export {
  fr as a,
  hr as b,
  we as c
};
