import { R as S, T as O, U as Q, V as je, W as J, X as R, Y as $e, a0 as Qe, a1 as z, a2 as X, a3 as Ge, a4 as G, a5 as le, a6 as ce, a7 as ue, a8 as Z, a9 as Ve, aa as qe, ab as xe, ac as q, ad as C, ae as Be, af as Ke, ag as Se, ah as Ye, ai as We, aj as de, ak as _, al as ze, am as He, an as Je, ao as Xe, ap as Ze, aq as Ce, ar as en, as as pe, at as fe, au as me, av as ve, aw as ye, ax as be, ay as Te, az as nn, aA as an, aB as tn, aC as he, aD as ge, aE as ee, aF as sn, aG as rn, aH as on, aI as ln, aJ as cn, aK as un } from "./index-XU9XjwM2.js";
import { aL as $n, aM as Qn, aN as Gn, aO as qn, aP as xn, aQ as Bn, aR as Kn, aS as Yn, aT as Wn, aU as zn, aV as Hn, aW as Jn, aX as Xn, aY as Zn, aZ as Cn, a_ as ea, a$ as na, b0 as aa, b1 as ta, b2 as sa, b3 as ra, b4 as ia, b5 as oa, b6 as la, b7 as ca, b8 as ua, b9 as da, ba as pa, bb as fa, bc as ma, bd as va, be as ya, bf as ba, bg as Ta, bh as ha, bi as ga, bj as Ea, bk as Ra, bl as Oa, bm as Ia, bn as wa, bo as Da, bp as Va, bq as Sa, br as Na, bs as La, bt as Fa, bu as Aa, bv as _a, bw as ka, bx as Ma, by as Ua, bz as Pa, bA as ja, bB as $a, bC as Qa, bD as Ga, bE as qa, bF as xa, bG as Ba, bH as Ka, bI as Ya, bJ as Wa, bK as za, bL as Ha, bM as Ja, bN as Xa, bO as Za, bP as Ca, bQ as et, bR as nt, bS as at, bT as tt, bU as st, bV as rt, bW as it, bX as ot, bY as lt, bZ as ct, b_ as ut, b$ as dt, c0 as pt, c1 as ft, c2 as mt, c3 as vt, c4 as yt, c5 as bt, c6 as Tt, c7 as ht, c8 as gt, c9 as Et, ca as Rt, cb as Ot, cc as It, cd as wt, ce as Dt, cf as Vt, cg as St, ch as Nt, ci as Lt, cj as Ft, ck as At, cl as _t, cm as kt, cn as Mt, co as Ut, cp as Pt, cq as jt, cr as $t, cs as Qt } from "./index-XU9XjwM2.js";
function I(e) {
  return typeof (e == null ? void 0 : e.then) == "function";
}
function dn(e) {
  let n;
  return function(s, i, r) {
    n === void 0 && (n = /* @__PURE__ */ new WeakMap());
    let l = n.get(s);
    l === void 0 && (l = /* @__PURE__ */ new WeakMap(), n.set(s, l));
    let d = l.get(i);
    d === void 0 && (d = /* @__PURE__ */ new WeakMap(), l.set(i, d));
    let p = d.get(r);
    return p === void 0 && (p = e(s, i, r), d.set(r, p)), p;
  };
}
function Ee(e) {
  return Promise.all(Object.values(e)).then((n) => {
    const t = /* @__PURE__ */ Object.create(null);
    for (const [s, i] of Object.keys(e).entries())
      t[i] = n[s];
    return t;
  });
}
function pn(e, n, t) {
  let s = t;
  for (const i of e)
    s = I(s) ? s.then((r) => n(r, i)) : n(s, i);
  return s;
}
function fn(e) {
  return e instanceof Error ? e : new mn(e);
}
class mn extends Error {
  constructor(n) {
    super("Unexpected error value: " + S(n)), this.name = "NonErrorThrown", this.thrownValue = n;
  }
}
function x(e, n, t) {
  var s;
  const i = fn(e);
  return vn(i) ? i : new O(i.message, {
    nodes: (s = i.nodes) !== null && s !== void 0 ? s : n,
    source: i.source,
    positions: i.positions,
    path: t,
    originalError: i
  });
}
function vn(e) {
  return Array.isArray(e.path);
}
const yn = dn(
  (e, n, t) => Ke(
    e.schema,
    e.fragments,
    e.variableValues,
    n,
    t
  )
);
class bn {
  constructor() {
    this._errorPositions = /* @__PURE__ */ new Set(), this._errors = [];
  }
  get errors() {
    return this._errors;
  }
  add(n, t) {
    this._hasNulledPosition(t) || (this._errorPositions.add(t), this._errors.push(n));
  }
  _hasNulledPosition(n) {
    let t = n;
    for (; t !== void 0; ) {
      if (this._errorPositions.has(t))
        return !0;
      t = t.prev;
    }
    return this._errorPositions.has(void 0);
  }
}
function Tn(e) {
  arguments.length < 2 || Q(
    !1,
    "graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead."
  );
  const { schema: n, document: t, variableValues: s, rootValue: i } = e;
  gn(n, t, s);
  const r = En(e);
  if (!("schema" in r))
    return {
      errors: r
    };
  try {
    const { operation: l } = r, d = Rn(r, l, i);
    return I(d) ? d.then(
      (p) => j(p, r.collectedErrors.errors),
      (p) => (r.collectedErrors.add(p, void 0), j(null, r.collectedErrors.errors))
    ) : j(d, r.collectedErrors.errors);
  } catch (l) {
    return r.collectedErrors.add(l, void 0), j(null, r.collectedErrors.errors);
  }
}
function hn(e) {
  const n = Tn(e);
  if (I(n))
    throw new Error("GraphQL execution failed to complete synchronously.");
  return n;
}
function j(e, n) {
  return n.length === 0 ? {
    data: e
  } : {
    errors: n,
    data: e
  };
}
function gn(e, n, t) {
  n || Q(!1, "Must provide document."), je(e), t == null || J(t) || Q(
    !1,
    "Variables must be provided as an Object where each property is a variable value. Perhaps look to see if an unparsed JSON string was provided."
  );
}
function En(e) {
  var n, t, s;
  const {
    schema: i,
    document: r,
    rootValue: l,
    contextValue: d,
    variableValues: p,
    operationName: f,
    fieldResolver: v,
    typeResolver: T,
    subscribeFieldResolver: b,
    options: h
  } = e;
  let E;
  const D = /* @__PURE__ */ Object.create(null);
  for (const N of r.definitions)
    switch (N.kind) {
      case R.OPERATION_DEFINITION:
        if (f == null) {
          if (E !== void 0)
            return [
              new O(
                "Must provide operation name if query contains multiple operations."
              )
            ];
          E = N;
        } else ((n = N.name) === null || n === void 0 ? void 0 : n.value) === f && (E = N);
        break;
      case R.FRAGMENT_DEFINITION:
        D[N.name.value] = N;
        break;
    }
  if (!E)
    return f != null ? [new O(`Unknown operation named "${f}".`)] : [new O("Must provide an operation.")];
  const V = (t = E.variableDefinitions) !== null && t !== void 0 ? t : [], F = $e(
    i,
    V,
    p ?? {},
    {
      maxErrors: (s = h == null ? void 0 : h.maxCoercionErrors) !== null && s !== void 0 ? s : 50
    }
  );
  return F.errors ? F.errors : {
    schema: i,
    fragments: D,
    rootValue: l,
    contextValue: d,
    operation: E,
    variableValues: F.coerced,
    fieldResolver: v ?? Ie,
    typeResolver: T ?? Sn,
    subscribeFieldResolver: b ?? Ie,
    collectedErrors: new bn()
  };
}
function Rn(e, n, t) {
  const s = e.schema.getRootType(n.operation);
  if (s == null)
    throw new O(
      `Schema is not configured to execute ${n.operation} operation.`,
      {
        nodes: n
      }
    );
  const i = Qe(
    e.schema,
    e.fragments,
    e.variableValues,
    s,
    n.selectionSet
  ), r = void 0;
  switch (n.operation) {
    case z.QUERY:
      return B(e, s, t, r, i);
    case z.MUTATION:
      return On(
        e,
        s,
        t,
        r,
        i
      );
    case z.SUBSCRIPTION:
      return B(e, s, t, r, i);
  }
}
function On(e, n, t, s, i) {
  return pn(
    i.entries(),
    (r, [l, d]) => {
      const p = X(s, l, n.name), f = Ne(
        e,
        n,
        t,
        d,
        p
      );
      return f === void 0 ? r : I(f) ? f.then((v) => (r[l] = v, r)) : (r[l] = f, r);
    },
    /* @__PURE__ */ Object.create(null)
  );
}
function B(e, n, t, s, i) {
  const r = /* @__PURE__ */ Object.create(null);
  let l = !1;
  try {
    for (const [d, p] of i.entries()) {
      const f = X(s, d, n.name), v = Ne(
        e,
        n,
        t,
        p,
        f
      );
      v !== void 0 && (r[d] = v, I(v) && (l = !0));
    }
  } catch (d) {
    if (l)
      return Ee(r).finally(() => {
        throw d;
      });
    throw d;
  }
  return l ? Ee(r) : r;
}
function Ne(e, n, t, s, i) {
  var r;
  const l = Nn(e.schema, n, s[0]);
  if (!l)
    return;
  const d = l.type, p = (r = l.resolve) !== null && r !== void 0 ? r : e.fieldResolver, f = In(
    e,
    l,
    s,
    n,
    i
  );
  try {
    const v = Ge(
      l,
      s[0],
      e.variableValues
    ), T = e.contextValue, b = p(t, v, T, f);
    let h;
    return I(b) ? h = b.then(
      (E) => k(e, d, s, f, i, E)
    ) : h = k(
      e,
      d,
      s,
      f,
      i,
      b
    ), I(h) ? h.then(void 0, (E) => {
      const D = x(E, s, G(i));
      return K(D, d, i, e);
    }) : h;
  } catch (v) {
    const T = x(v, s, G(i));
    return K(T, d, i, e);
  }
}
function In(e, n, t, s, i) {
  return {
    fieldName: n.name,
    fieldNodes: t,
    returnType: n.type,
    parentType: s,
    path: i,
    schema: e.schema,
    fragments: e.fragments,
    rootValue: e.rootValue,
    operation: e.operation,
    variableValues: e.variableValues
  };
}
function K(e, n, t, s) {
  if (Z(n))
    throw e;
  return s.collectedErrors.add(e, t), null;
}
function k(e, n, t, s, i, r) {
  if (r instanceof Error)
    throw r;
  if (Z(n)) {
    const l = k(
      e,
      n.ofType,
      t,
      s,
      i,
      r
    );
    if (l === null)
      throw new Error(
        `Cannot return null for non-nullable field ${s.parentType.name}.${s.fieldName}.`
      );
    return l;
  }
  if (r == null)
    return null;
  if (Ve(n))
    return wn(
      e,
      n,
      t,
      s,
      i,
      r
    );
  if (qe(n))
    return Dn(n, r);
  if (xe(n))
    return Vn(
      e,
      n,
      t,
      s,
      i,
      r
    );
  if (q(n))
    return H(
      e,
      n,
      t,
      s,
      i,
      r
    );
  C(
    !1,
    "Cannot complete value of unexpected output type: " + S(n)
  );
}
function wn(e, n, t, s, i, r) {
  if (!Be(r))
    throw new O(
      `Expected Iterable, but did not find one for field "${s.parentType.name}.${s.fieldName}".`
    );
  const l = n.ofType;
  let d = !1;
  const p = Array.from(r, (f, v) => {
    const T = X(i, v, void 0);
    try {
      let b;
      return I(f) ? b = f.then(
        (h) => k(
          e,
          l,
          t,
          s,
          T,
          h
        )
      ) : b = k(
        e,
        l,
        t,
        s,
        T,
        f
      ), I(b) ? (d = !0, b.then(void 0, (h) => {
        const E = x(
          h,
          t,
          G(T)
        );
        return K(E, l, T, e);
      })) : b;
    } catch (b) {
      const h = x(b, t, G(T));
      return K(h, l, T, e);
    }
  });
  return d ? Promise.all(p) : p;
}
function Dn(e, n) {
  const t = e.serialize(n);
  if (t == null)
    throw new Error(
      `Expected \`${S(e)}.serialize(${S(n)})\` to return non-nullable value, returned: ${S(t)}`
    );
  return t;
}
function Vn(e, n, t, s, i, r) {
  var l;
  const d = (l = n.resolveType) !== null && l !== void 0 ? l : e.typeResolver, p = e.contextValue, f = d(r, p, s, n);
  return I(f) ? f.then(
    (v) => H(
      e,
      Re(
        v,
        e,
        n,
        t,
        s,
        r
      ),
      t,
      s,
      i,
      r
    )
  ) : H(
    e,
    Re(
      f,
      e,
      n,
      t,
      s,
      r
    ),
    t,
    s,
    i,
    r
  );
}
function Re(e, n, t, s, i, r) {
  if (e == null)
    throw new O(
      `Abstract type "${t.name}" must resolve to an Object type at runtime for field "${i.parentType.name}.${i.fieldName}". Either the "${t.name}" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.`,
      s
    );
  if (q(e))
    throw new O(
      "Support for returning GraphQLObjectType from resolveType was removed in graphql-js@16.0.0 please return type name instead."
    );
  if (typeof e != "string")
    throw new O(
      `Abstract type "${t.name}" must resolve to an Object type at runtime for field "${i.parentType.name}.${i.fieldName}" with value ${S(r)}, received "${S(e)}".`
    );
  const l = n.schema.getType(e);
  if (l == null)
    throw new O(
      `Abstract type "${t.name}" was resolved to a type "${e}" that does not exist inside the schema.`,
      {
        nodes: s
      }
    );
  if (!q(l))
    throw new O(
      `Abstract type "${t.name}" was resolved to a non-object type "${e}".`,
      {
        nodes: s
      }
    );
  if (!n.schema.isSubType(t, l))
    throw new O(
      `Runtime Object type "${l.name}" is not a possible type for "${t.name}".`,
      {
        nodes: s
      }
    );
  return l;
}
function H(e, n, t, s, i, r) {
  const l = yn(e, n, t);
  if (n.isTypeOf) {
    const d = n.isTypeOf(r, e.contextValue, s);
    if (I(d))
      return d.then((p) => {
        if (!p)
          throw Oe(n, r, t);
        return B(
          e,
          n,
          r,
          i,
          l
        );
      });
    if (!d)
      throw Oe(n, r, t);
  }
  return B(e, n, r, i, l);
}
function Oe(e, n, t) {
  return new O(
    `Expected value of type "${e.name}" but got: ${S(n)}.`,
    {
      nodes: t
    }
  );
}
const Sn = function(e, n, t, s) {
  if (J(e) && typeof e.__typename == "string")
    return e.__typename;
  const i = t.schema.getPossibleTypes(s), r = [];
  for (let l = 0; l < i.length; l++) {
    const d = i[l];
    if (d.isTypeOf) {
      const p = d.isTypeOf(e, n, t);
      if (I(p))
        r[l] = p;
      else if (p)
        return r.length && Promise.allSettled(r).catch(() => {
        }), d.name;
    }
  }
  if (r.length)
    return Promise.all(r).then((l) => {
      for (let d = 0; d < l.length; d++)
        if (l[d])
          return i[d].name;
    });
}, Ie = function(e, n, t, s) {
  if (J(e) || typeof e == "function") {
    const i = e[s.fieldName];
    return typeof i == "function" ? e[s.fieldName](n, t, s) : i;
  }
};
function Nn(e, n, t) {
  const s = t.name.value;
  return s === le.name && e.getQueryType() === n ? le : s === ce.name && e.getQueryType() === n ? ce : s === ue.name ? ue : n.getFields()[s];
}
function Ln(e) {
  const n = {
    descriptions: !0,
    specifiedByUrl: !1,
    directiveIsRepeatable: !1,
    schemaDescription: !1,
    inputValueDeprecation: !1,
    oneOf: !1,
    ...e
  }, t = n.descriptions ? "description" : "", s = n.specifiedByUrl ? "specifiedByURL" : "", i = n.directiveIsRepeatable ? "isRepeatable" : "", r = n.schemaDescription ? t : "";
  function l(p) {
    return n.inputValueDeprecation ? p : "";
  }
  const d = n.oneOf ? "isOneOf" : "";
  return `
    query IntrospectionQuery {
      __schema {
        ${r}
        queryType { name kind }
        mutationType { name kind }
        subscriptionType { name kind }
        types {
          ...FullType
        }
        directives {
          name
          ${t}
          ${i}
          locations
          args${l("(includeDeprecated: true)")} {
            ...InputValue
          }
        }
      }
    }

    fragment FullType on __Type {
      kind
      name
      ${t}
      ${s}
      ${d}
      fields(includeDeprecated: true) {
        name
        ${t}
        args${l("(includeDeprecated: true)")} {
          ...InputValue
        }
        type {
          ...TypeRef
        }
        isDeprecated
        deprecationReason
      }
      inputFields${l("(includeDeprecated: true)")} {
        ...InputValue
      }
      interfaces {
        ...TypeRef
      }
      enumValues(includeDeprecated: true) {
        name
        ${t}
        isDeprecated
        deprecationReason
      }
      possibleTypes {
        ...TypeRef
      }
    }

    fragment InputValue on __InputValue {
      name
      ${t}
      type { ...TypeRef }
      defaultValue
      ${l("isDeprecated")}
      ${l("deprecationReason")}
    }

    fragment TypeRef on __Type {
      kind
      name
      ofType {
        kind
        name
        ofType {
          kind
          name
          ofType {
            kind
            name
            ofType {
              kind
              name
              ofType {
                kind
                name
                ofType {
                  kind
                  name
                  ofType {
                    kind
                    name
                    ofType {
                      kind
                      name
                      ofType {
                        kind
                        name
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  `;
}
function Mn(e, n) {
  const t = {
    specifiedByUrl: !0,
    directiveIsRepeatable: !0,
    schemaDescription: !0,
    inputValueDeprecation: !0,
    oneOf: !0,
    ...n
  }, s = Se(Ln(t)), i = hn({
    schema: e,
    document: s
  });
  return !i.errors && i.data || C(!1), i.data;
}
function Fn(e, n, t) {
  var s, i, r, l;
  const d = [], p = /* @__PURE__ */ Object.create(null), f = [];
  let v;
  const T = [];
  for (const a of n.definitions)
    if (a.kind === R.SCHEMA_DEFINITION)
      v = a;
    else if (a.kind === R.SCHEMA_EXTENSION)
      T.push(a);
    else if (Ye(a))
      d.push(a);
    else if (We(a)) {
      const c = a.name.value, o = p[c];
      p[c] = o ? o.concat([a]) : [a];
    } else a.kind === R.DIRECTIVE_DEFINITION && f.push(a);
  if (Object.keys(p).length === 0 && d.length === 0 && f.length === 0 && T.length === 0 && v == null)
    return e;
  const b = /* @__PURE__ */ Object.create(null);
  for (const a of e.types)
    b[a.name] = N(a);
  for (const a of d) {
    var h;
    const c = a.name.value;
    b[c] = (h = we[c]) !== null && h !== void 0 ? h : Pe(a);
  }
  const E = {
    // Get the extended root operation types.
    query: e.query && V(e.query),
    mutation: e.mutation && V(e.mutation),
    subscription: e.subscription && V(e.subscription),
    // Then, incorporate schema definition and all schema extensions.
    ...v && te([v]),
    ...te(T)
  };
  return {
    description: (s = v) === null || s === void 0 || (i = s.description) === null || i === void 0 ? void 0 : i.value,
    ...E,
    types: Object.values(b),
    directives: [
      ...e.directives.map(F),
      ...f.map(Ue)
    ],
    extensions: /* @__PURE__ */ Object.create(null),
    astNode: (r = v) !== null && r !== void 0 ? r : e.astNode,
    extensionASTNodes: e.extensionASTNodes.concat(T),
    assumeValid: (l = t == null ? void 0 : t.assumeValid) !== null && l !== void 0 ? l : !1
  };
  function D(a) {
    return Ve(a) ? new he(D(a.ofType)) : Z(a) ? new ge(D(a.ofType)) : V(a);
  }
  function V(a) {
    return b[a.name];
  }
  function F(a) {
    const c = a.toConfig();
    return new de({
      ...c,
      args: _(c.args, ae)
    });
  }
  function N(a) {
    if (ze(a) || He(a))
      return a;
    if (Je(a))
      return Ae(a);
    if (q(a))
      return _e(a);
    if (Xe(a))
      return ke(a);
    if (Ze(a))
      return Me(a);
    if (Ce(a))
      return Fe(a);
    if (en(a))
      return Le(a);
    C(!1, "Unexpected type: " + S(a));
  }
  function Le(a) {
    var c;
    const o = a.toConfig(), u = (c = p[o.name]) !== null && c !== void 0 ? c : [];
    return new pe({
      ...o,
      fields: () => ({
        ..._(o.fields, (m) => ({
          ...m,
          type: D(m.type)
        })),
        ...re(u)
      }),
      extensionASTNodes: o.extensionASTNodes.concat(u)
    });
  }
  function Fe(a) {
    var c;
    const o = a.toConfig(), u = (c = p[a.name]) !== null && c !== void 0 ? c : [];
    return new fe({
      ...o,
      values: { ...o.values, ...ie(u) },
      extensionASTNodes: o.extensionASTNodes.concat(u)
    });
  }
  function Ae(a) {
    var c;
    const o = a.toConfig(), u = (c = p[o.name]) !== null && c !== void 0 ? c : [];
    let m = o.specifiedByURL;
    for (const y of u) {
      var g;
      m = (g = De(y)) !== null && g !== void 0 ? g : m;
    }
    return new me({
      ...o,
      specifiedByURL: m,
      extensionASTNodes: o.extensionASTNodes.concat(u)
    });
  }
  function _e(a) {
    var c;
    const o = a.toConfig(), u = (c = p[o.name]) !== null && c !== void 0 ? c : [];
    return new ve({
      ...o,
      interfaces: () => [
        ...a.getInterfaces().map(V),
        ...P(u)
      ],
      fields: () => ({
        ..._(o.fields, ne),
        ...U(u)
      }),
      extensionASTNodes: o.extensionASTNodes.concat(u)
    });
  }
  function ke(a) {
    var c;
    const o = a.toConfig(), u = (c = p[o.name]) !== null && c !== void 0 ? c : [];
    return new ye({
      ...o,
      interfaces: () => [
        ...a.getInterfaces().map(V),
        ...P(u)
      ],
      fields: () => ({
        ..._(o.fields, ne),
        ...U(u)
      }),
      extensionASTNodes: o.extensionASTNodes.concat(u)
    });
  }
  function Me(a) {
    var c;
    const o = a.toConfig(), u = (c = p[o.name]) !== null && c !== void 0 ? c : [];
    return new be({
      ...o,
      types: () => [
        ...a.getTypes().map(V),
        ...oe(u)
      ],
      extensionASTNodes: o.extensionASTNodes.concat(u)
    });
  }
  function ne(a) {
    return {
      ...a,
      type: D(a.type),
      args: a.args && _(a.args, ae)
    };
  }
  function ae(a) {
    return { ...a, type: D(a.type) };
  }
  function te(a) {
    const c = {};
    for (const u of a) {
      var o;
      const m = (
        /* c8 ignore next */
        (o = u.operationTypes) !== null && o !== void 0 ? o : []
      );
      for (const g of m)
        c[g.operation] = M(g.type);
    }
    return c;
  }
  function M(a) {
    var c;
    const o = a.name.value, u = (c = we[o]) !== null && c !== void 0 ? c : b[o];
    if (u === void 0)
      throw new Error(`Unknown type: "${o}".`);
    return u;
  }
  function A(a) {
    return a.kind === R.LIST_TYPE ? new he(A(a.type)) : a.kind === R.NON_NULL_TYPE ? new ge(A(a.type)) : M(a);
  }
  function Ue(a) {
    var c;
    return new de({
      name: a.name.value,
      description: (c = a.description) === null || c === void 0 ? void 0 : c.value,
      // @ts-expect-error
      locations: a.locations.map(({ value: o }) => o),
      isRepeatable: a.repeatable,
      args: se(a.arguments),
      astNode: a
    });
  }
  function U(a) {
    const c = /* @__PURE__ */ Object.create(null);
    for (const m of a) {
      var o;
      const g = (
        /* c8 ignore next */
        (o = m.fields) !== null && o !== void 0 ? o : []
      );
      for (const y of g) {
        var u;
        c[y.name.value] = {
          // Note: While this could make assertions to get the correctly typed
          // value, that would throw immediately while type system validation
          // with validateSchema() will produce more actionable results.
          type: A(y.type),
          description: (u = y.description) === null || u === void 0 ? void 0 : u.value,
          args: se(y.arguments),
          deprecationReason: $(y),
          astNode: y
        };
      }
    }
    return c;
  }
  function se(a) {
    const c = (
      /* c8 ignore next */
      a ?? []
    ), o = /* @__PURE__ */ Object.create(null);
    for (const m of c) {
      var u;
      const g = A(m.type);
      o[m.name.value] = {
        type: g,
        description: (u = m.description) === null || u === void 0 ? void 0 : u.value,
        defaultValue: Te(m.defaultValue, g),
        deprecationReason: $(m),
        astNode: m
      };
    }
    return o;
  }
  function re(a) {
    const c = /* @__PURE__ */ Object.create(null);
    for (const m of a) {
      var o;
      const g = (
        /* c8 ignore next */
        (o = m.fields) !== null && o !== void 0 ? o : []
      );
      for (const y of g) {
        var u;
        const L = A(y.type);
        c[y.name.value] = {
          type: L,
          description: (u = y.description) === null || u === void 0 ? void 0 : u.value,
          defaultValue: Te(y.defaultValue, L),
          deprecationReason: $(y),
          astNode: y
        };
      }
    }
    return c;
  }
  function ie(a) {
    const c = /* @__PURE__ */ Object.create(null);
    for (const m of a) {
      var o;
      const g = (
        /* c8 ignore next */
        (o = m.values) !== null && o !== void 0 ? o : []
      );
      for (const y of g) {
        var u;
        c[y.name.value] = {
          description: (u = y.description) === null || u === void 0 ? void 0 : u.value,
          deprecationReason: $(y),
          astNode: y
        };
      }
    }
    return c;
  }
  function P(a) {
    return a.flatMap(
      // FIXME: https://github.com/graphql/graphql-js/issues/2203
      (c) => {
        var o, u;
        return (
          /* c8 ignore next */
          (o = (u = c.interfaces) === null || u === void 0 ? void 0 : u.map(M)) !== null && o !== void 0 ? o : []
        );
      }
    );
  }
  function oe(a) {
    return a.flatMap(
      // FIXME: https://github.com/graphql/graphql-js/issues/2203
      (c) => {
        var o, u;
        return (
          /* c8 ignore next */
          (o = (u = c.types) === null || u === void 0 ? void 0 : u.map(M)) !== null && o !== void 0 ? o : []
        );
      }
    );
  }
  function Pe(a) {
    var c;
    const o = a.name.value, u = (c = p[o]) !== null && c !== void 0 ? c : [];
    switch (a.kind) {
      case R.OBJECT_TYPE_DEFINITION: {
        var m;
        const w = [a, ...u];
        return new ve({
          name: o,
          description: (m = a.description) === null || m === void 0 ? void 0 : m.value,
          interfaces: () => P(w),
          fields: () => U(w),
          astNode: a,
          extensionASTNodes: u
        });
      }
      case R.INTERFACE_TYPE_DEFINITION: {
        var g;
        const w = [a, ...u];
        return new ye({
          name: o,
          description: (g = a.description) === null || g === void 0 ? void 0 : g.value,
          interfaces: () => P(w),
          fields: () => U(w),
          astNode: a,
          extensionASTNodes: u
        });
      }
      case R.ENUM_TYPE_DEFINITION: {
        var y;
        const w = [a, ...u];
        return new fe({
          name: o,
          description: (y = a.description) === null || y === void 0 ? void 0 : y.value,
          values: ie(w),
          astNode: a,
          extensionASTNodes: u
        });
      }
      case R.UNION_TYPE_DEFINITION: {
        var L;
        const w = [a, ...u];
        return new be({
          name: o,
          description: (L = a.description) === null || L === void 0 ? void 0 : L.value,
          types: () => oe(w),
          astNode: a,
          extensionASTNodes: u
        });
      }
      case R.SCALAR_TYPE_DEFINITION: {
        var Y;
        return new me({
          name: o,
          description: (Y = a.description) === null || Y === void 0 ? void 0 : Y.value,
          specifiedByURL: De(a),
          astNode: a,
          extensionASTNodes: u
        });
      }
      case R.INPUT_OBJECT_TYPE_DEFINITION: {
        var W;
        const w = [a, ...u];
        return new pe({
          name: o,
          description: (W = a.description) === null || W === void 0 ? void 0 : W.value,
          fields: () => re(w),
          astNode: a,
          extensionASTNodes: u,
          isOneOf: An(a)
        });
      }
    }
  }
}
const we = nn(
  [...an, ...tn],
  (e) => e.name
);
function $(e) {
  const n = ee(rn, e);
  return n == null ? void 0 : n.reason;
}
function De(e) {
  const n = ee(sn, e);
  return n == null ? void 0 : n.url;
}
function An(e) {
  return !!ee(on, e);
}
function _n(e, n) {
  e != null && e.kind === R.DOCUMENT || Q(!1, "Must provide valid Document AST."), (n == null ? void 0 : n.assumeValid) !== !0 && (n == null ? void 0 : n.assumeValidSDL) !== !0 && ln(e);
  const s = Fn({
    description: void 0,
    types: [],
    directives: [],
    extensions: /* @__PURE__ */ Object.create(null),
    extensionASTNodes: [],
    assumeValid: !1
  }, e, n);
  if (s.astNode == null)
    for (const r of s.types)
      switch (r.name) {
        // Note: While this could make early assertions to get the correctly
        // typed values below, that would throw immediately while type system
        // validation with validateSchema() will produce more actionable results.
        case "Query":
          s.query = r;
          break;
        case "Mutation":
          s.mutation = r;
          break;
        case "Subscription":
          s.subscription = r;
          break;
      }
  const i = [
    ...s.directives,
    // If specified directives were not explicitly declared, add them.
    ...cn.filter(
      (r) => s.directives.every(
        (l) => l.name !== r.name
      )
    )
  ];
  return new un({ ...s, directives: i });
}
function Un(e, n) {
  const t = Se(e, {
    noLocation: n == null ? void 0 : n.noLocation,
    allowLegacyFragmentVariables: n == null ? void 0 : n.allowLegacyFragmentVariables
  });
  return _n(t, {
    assumeValidSDL: n == null ? void 0 : n.assumeValidSDL,
    assumeValid: n == null ? void 0 : n.assumeValid
  });
}
export {
  $n as BREAK,
  Qn as DEFAULT_DEPRECATION_REASON,
  Gn as DirectiveLocation,
  qn as ExecutableDefinitionsRule,
  xn as FieldsOnCorrectTypeRule,
  Bn as FragmentsOnCompositeTypesRule,
  Kn as GRAPHQL_MAX_INT,
  Yn as GRAPHQL_MIN_INT,
  Wn as GraphQLBoolean,
  rn as GraphQLDeprecatedDirective,
  de as GraphQLDirective,
  fe as GraphQLEnumType,
  O as GraphQLError,
  zn as GraphQLFloat,
  Hn as GraphQLID,
  Jn as GraphQLIncludeDirective,
  pe as GraphQLInputObjectType,
  Xn as GraphQLInt,
  ye as GraphQLInterfaceType,
  he as GraphQLList,
  ge as GraphQLNonNull,
  ve as GraphQLObjectType,
  on as GraphQLOneOfDirective,
  me as GraphQLScalarType,
  un as GraphQLSchema,
  Zn as GraphQLSkipDirective,
  sn as GraphQLSpecifiedByDirective,
  Cn as GraphQLString,
  be as GraphQLUnionType,
  R as Kind,
  ea as KnownArgumentNamesRule,
  na as KnownDirectivesRule,
  aa as KnownFragmentNamesRule,
  ta as KnownTypeNamesRule,
  sa as Lexer,
  ra as Location,
  ia as LoneAnonymousOperationRule,
  oa as LoneSchemaDefinitionRule,
  la as MaxIntrospectionDepthRule,
  ca as NoDeprecatedCustomRule,
  ua as NoFragmentCyclesRule,
  da as NoUndefinedVariablesRule,
  pa as NoUnusedFragmentsRule,
  fa as NoUnusedVariablesRule,
  z as OperationTypeNode,
  ma as OverlappingFieldsCanBeMergedRule,
  va as PossibleFragmentSpreadsRule,
  ya as PossibleTypeExtensionsRule,
  ba as ProvidedRequiredArgumentsRule,
  Ta as ScalarLeafsRule,
  le as SchemaMetaFieldDef,
  ha as SingleFieldSubscriptionsRule,
  ga as Source,
  Ea as Token,
  Ra as TokenKind,
  Oa as TypeInfo,
  Ia as TypeKind,
  ce as TypeMetaFieldDef,
  ue as TypeNameMetaFieldDef,
  wa as UniqueArgumentDefinitionNamesRule,
  Da as UniqueArgumentNamesRule,
  Va as UniqueDirectiveNamesRule,
  Sa as UniqueDirectivesPerLocationRule,
  Na as UniqueEnumValueNamesRule,
  La as UniqueFieldDefinitionNamesRule,
  Fa as UniqueFragmentNamesRule,
  Aa as UniqueInputFieldNamesRule,
  _a as UniqueOperationNamesRule,
  ka as UniqueOperationTypesRule,
  Ma as UniqueTypeNamesRule,
  Ua as UniqueVariableNamesRule,
  Pa as ValidationContext,
  ja as ValuesOfCorrectTypeRule,
  $a as VariablesAreInputTypesRule,
  Qa as VariablesInAllowedPositionRule,
  Ga as __Directive,
  qa as __DirectiveLocation,
  xa as __EnumValue,
  Ba as __Field,
  Ka as __InputValue,
  Ya as __Schema,
  Wa as __Type,
  za as __TypeKind,
  Ha as assertEnumValueName,
  Ja as assertInterfaceType,
  Xa as assertName,
  Za as assertNullableType,
  Ca as assertObjectType,
  et as assertSchema,
  je as assertValidSchema,
  nt as astFromValue,
  _n as buildASTSchema,
  at as buildClientSchema,
  Un as buildSchema,
  tt as coerceInputValue,
  Ie as defaultFieldResolver,
  Sn as defaultTypeResolver,
  st as doTypesOverlap,
  Tn as execute,
  hn as executeSync,
  Ge as getArgumentValues,
  ee as getDirectiveValues,
  rt as getEnterLeaveForKind,
  Ln as getIntrospectionQuery,
  it as getLocation,
  ot as getNamedType,
  lt as getNullableType,
  $e as getVariableValues,
  Mn as introspectionFromSchema,
  tn as introspectionTypes,
  xe as isAbstractType,
  ct as isCompositeType,
  ut as isDirective,
  Ce as isEnumType,
  dt as isEqualType,
  pt as isExecutableDefinitionNode,
  en as isInputObjectType,
  ft as isInputType,
  Xe as isInterfaceType,
  ze as isIntrospectionType,
  qe as isLeafType,
  Ve as isListType,
  mt as isNamedType,
  Z as isNonNullType,
  vt as isNullableType,
  q as isObjectType,
  yt as isOutputType,
  bt as isRequiredArgument,
  Tt as isRequiredInputField,
  Je as isScalarType,
  ht as isSchema,
  He as isSpecifiedScalarType,
  gt as isType,
  Ye as isTypeDefinitionNode,
  We as isTypeExtensionNode,
  Et as isTypeSubTypeOf,
  Rt as isTypeSystemDefinitionNode,
  Ot as isTypeSystemExtensionNode,
  Ze as isUnionType,
  It as isWrappingType,
  x as locatedError,
  Se as parse,
  wt as parseValue,
  Dt as print,
  Vt as printLocation,
  St as printSourceLocation,
  Nt as recommendedRules,
  Lt as resolveObjMapThunk,
  Ft as resolveReadonlyArrayThunk,
  G as responsePathAsArray,
  cn as specifiedDirectives,
  At as specifiedRules,
  an as specifiedScalarTypes,
  _t as syntaxError,
  kt as typeFromAST,
  Mt as validate,
  Ut as validateSchema,
  Te as valueFromAST,
  Pt as valueFromASTUntyped,
  jt as visit,
  $t as visitInParallel,
  Qt as visitWithTypeInfo
};
