import { C as d } from "./codemirror.es-CVgHrv2u.js";
import "./show-hint.es-Bf9rucUA.js";
import { g as getAutocompleteSuggestions } from "./GraphQLPlaygroundPage-BNtxA91h.js";
import { P as Position } from "./Range-BloAiAiu.js";
import "./codemirror.es2-DH2syXui.js";
import "./index-Cr4zbAtA.js";
import "./createCell-D7cbP3PP.js";
d.registerHelper("hint", "graphql", (o, a) => {
  const { schema: i, externalFragments: c } = a;
  if (!i)
    return;
  const s = o.getCursor(), e = o.getTokenAt(s), l = e.type !== null && /"|\w/.test(e.string[0]) ? e.start : e.end, p = new Position(s.line, l), t = {
    list: getAutocompleteSuggestions(i, o.getValue(), p, e, c).map((n) => ({
      text: n.label,
      type: n.type,
      description: n.documentation,
      isDeprecated: n.isDeprecated,
      deprecationReason: n.deprecationReason
    })),
    from: { line: s.line, ch: l },
    to: { line: s.line, ch: e.end }
  };
  return t != null && t.list && t.list.length > 0 && (t.from = d.Pos(t.from.line, t.from.ch), t.to = d.Pos(t.to.line, t.to.ch), d.signal(o, "hasCompletion", o, t, e)), t;
});
