import { d as S, m as M, n as Y, o as K, p as T, q as Q } from "./index-CyvVZ2rs.js";
var R = {}, h = {}, C;
function W() {
  if (C) return h;
  C = 1, Object.defineProperty(h, "__esModule", { value: !0 }), h.dynamicAnchor = void 0;
  const e = S(), r = M(), t = Y(), l = K(), o = {
    keyword: "$dynamicAnchor",
    schemaType: "string",
    code: (i) => n(i, i.schema)
  };
  function n(i, m) {
    const { gen: u, it: d } = i;
    d.schemaEnv.root.dynamicAnchors[m] = !0;
    const v = (0, e._)`${r.default.dynamicAnchors}${(0, e.getProperty)(m)}`, a = d.errSchemaPath === "#" ? d.validateName : s(i);
    u.if((0, e._)`!${v}`, () => u.assign(v, a));
  }
  h.dynamicAnchor = n;
  function s(i) {
    const { schemaEnv: m, schema: u, self: d } = i.it, { root: v, baseId: a, localRefs: f, meta: p } = m.root, { schemaId: D } = d.opts, c = new t.SchemaEnv({ schema: u, schemaId: D, root: v, baseId: a, localRefs: f, meta: p });
    return t.compileSchema.call(d, c), (0, l.getValidate)(i, c);
  }
  return h.default = o, h;
}
var _ = {}, E;
function X() {
  if (E) return _;
  E = 1, Object.defineProperty(_, "__esModule", { value: !0 }), _.dynamicRef = void 0;
  const e = S(), r = M(), t = K(), l = {
    keyword: "$dynamicRef",
    schemaType: "string",
    code: (n) => o(n, n.schema)
  };
  function o(n, s) {
    const { gen: i, keyword: m, it: u } = n;
    if (s[0] !== "#")
      throw new Error(`"${m}" only supports hash fragment reference`);
    const d = s.slice(1);
    if (u.allErrors)
      v();
    else {
      const f = i.let("valid", !1);
      v(f), n.ok(f);
    }
    function v(f) {
      if (u.schemaEnv.root.dynamicAnchors[d]) {
        const p = i.let("_v", (0, e._)`${r.default.dynamicAnchors}${(0, e.getProperty)(d)}`);
        i.if(p, a(p, f), a(u.validateName, f));
      } else
        a(u.validateName, f)();
    }
    function a(f, p) {
      return p ? () => i.block(() => {
        (0, t.callRef)(n, f), i.let(p, !0);
      }) : () => (0, t.callRef)(n, f);
    }
  }
  return _.dynamicRef = o, _.default = l, _;
}
var q = {}, N;
function Z() {
  if (N) return q;
  N = 1, Object.defineProperty(q, "__esModule", { value: !0 });
  const e = W(), r = T(), t = {
    keyword: "$recursiveAnchor",
    schemaType: "boolean",
    code(l) {
      l.schema ? (0, e.dynamicAnchor)(l, "") : (0, r.checkStrictMode)(l.it, "$recursiveAnchor: false is ignored");
    }
  };
  return q.default = t, q;
}
var $ = {}, U;
function x() {
  if (U) return $;
  U = 1, Object.defineProperty($, "__esModule", { value: !0 });
  const e = X(), r = {
    keyword: "$recursiveRef",
    schemaType: "string",
    code: (t) => (0, e.dynamicRef)(t, t.schema)
  };
  return $.default = r, $;
}
var V;
function ie() {
  if (V) return R;
  V = 1, Object.defineProperty(R, "__esModule", { value: !0 });
  const e = W(), r = X(), t = Z(), l = x(), o = [e.default, r.default, t.default, l.default];
  return R.default = o, R;
}
var b = {}, P = {}, L;
function ee() {
  if (L) return P;
  L = 1, Object.defineProperty(P, "__esModule", { value: !0 });
  const e = Q(), r = {
    keyword: "dependentRequired",
    type: "object",
    schemaType: "object",
    error: e.error,
    code: (t) => (0, e.validatePropertyDeps)(t)
  };
  return P.default = r, P;
}
var g = {}, z;
function re() {
  if (z) return g;
  z = 1, Object.defineProperty(g, "__esModule", { value: !0 });
  const e = Q(), r = {
    keyword: "dependentSchemas",
    type: "object",
    schemaType: "object",
    code: (t) => (0, e.validateSchemaDeps)(t)
  };
  return g.default = r, g;
}
var j = {}, B;
function te() {
  if (B) return j;
  B = 1, Object.defineProperty(j, "__esModule", { value: !0 });
  const e = T(), r = {
    keyword: ["maxContains", "minContains"],
    type: "array",
    schemaType: "number",
    code({ keyword: t, parentSchema: l, it: o }) {
      l.contains === void 0 && (0, e.checkStrictMode)(o, `"${t}" without "contains" is ignored`);
    }
  };
  return j.default = r, j;
}
var F;
function se() {
  if (F) return b;
  F = 1, Object.defineProperty(b, "__esModule", { value: !0 });
  const e = ee(), r = re(), t = te(), l = [e.default, r.default, t.default];
  return b.default = l, b;
}
var k = {}, w = {}, G;
function ne() {
  if (G) return w;
  G = 1, Object.defineProperty(w, "__esModule", { value: !0 });
  const e = S(), r = T(), t = M(), o = {
    keyword: "unevaluatedProperties",
    type: "object",
    schemaType: ["boolean", "object"],
    trackErrors: !0,
    error: {
      message: "must NOT have unevaluated properties",
      params: ({ params: n }) => (0, e._)`{unevaluatedProperty: ${n.unevaluatedProperty}}`
    },
    code(n) {
      const { gen: s, schema: i, data: m, errsCount: u, it: d } = n;
      if (!u)
        throw new Error("ajv implementation error");
      const { allErrors: v, props: a } = d;
      a instanceof e.Name ? s.if((0, e._)`${a} !== true`, () => s.forIn("key", m, (c) => s.if(p(a, c), () => f(c)))) : a !== !0 && s.forIn("key", m, (c) => a === void 0 ? f(c) : s.if(D(a, c), () => f(c))), d.props = !0, n.ok((0, e._)`${u} === ${t.default.errors}`);
      function f(c) {
        if (i === !1) {
          n.setParams({ unevaluatedProperty: c }), n.error(), v || s.break();
          return;
        }
        if (!(0, r.alwaysValidSchema)(d, i)) {
          const y = s.name("valid");
          n.subschema({
            keyword: "unevaluatedProperties",
            dataProp: c,
            dataPropType: r.Type.Str
          }, y), v || s.if((0, e.not)(y), () => s.break());
        }
      }
      function p(c, y) {
        return (0, e._)`!${c} || !${c}[${y}]`;
      }
      function D(c, y) {
        const O = [];
        for (const I in c)
          c[I] === !0 && O.push((0, e._)`${y} !== ${I}`);
        return (0, e.and)(...O);
      }
    }
  };
  return w.default = o, w;
}
var A = {}, H;
function ae() {
  if (H) return A;
  H = 1, Object.defineProperty(A, "__esModule", { value: !0 });
  const e = S(), r = T(), l = {
    keyword: "unevaluatedItems",
    type: "array",
    schemaType: ["boolean", "object"],
    error: {
      message: ({ params: { len: o } }) => (0, e.str)`must NOT have more than ${o} items`,
      params: ({ params: { len: o } }) => (0, e._)`{limit: ${o}}`
    },
    code(o) {
      const { gen: n, schema: s, data: i, it: m } = o, u = m.items || 0;
      if (u === !0)
        return;
      const d = n.const("len", (0, e._)`${i}.length`);
      if (s === !1)
        o.setParams({ len: u }), o.fail((0, e._)`${d} > ${u}`);
      else if (typeof s == "object" && !(0, r.alwaysValidSchema)(m, s)) {
        const a = n.var("valid", (0, e._)`${d} <= ${u}`);
        n.if((0, e.not)(a), () => v(a, u)), o.ok(a);
      }
      m.items = !0;
      function v(a, f) {
        n.forRange("i", f, d, (p) => {
          o.subschema({ keyword: "unevaluatedItems", dataProp: p, dataPropType: r.Type.Num }, a), m.allErrors || n.if((0, e.not)(a), () => n.break());
        });
      }
    }
  };
  return A.default = l, A;
}
var J;
function ue() {
  if (J) return k;
  J = 1, Object.defineProperty(k, "__esModule", { value: !0 });
  const e = ne(), r = ae(), t = [e.default, r.default];
  return k.default = t, k;
}
export {
  se as a,
  ue as b,
  ie as r
};
