python2ts 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/README.md +148 -0
  2. package/dist/acorn-CDFV7HXL.js +3131 -0
  3. package/dist/acorn-CDFV7HXL.js.map +1 -0
  4. package/dist/angular-PCJAXZFD.js +3071 -0
  5. package/dist/angular-PCJAXZFD.js.map +1 -0
  6. package/dist/babel-O6RKFHDQ.js +7297 -0
  7. package/dist/babel-O6RKFHDQ.js.map +1 -0
  8. package/dist/chunk-DTI6R2GT.js +23942 -0
  9. package/dist/chunk-DTI6R2GT.js.map +1 -0
  10. package/dist/chunk-PZ5AY32C.js +10 -0
  11. package/dist/chunk-PZ5AY32C.js.map +1 -0
  12. package/dist/cli/index.d.ts +1 -0
  13. package/dist/cli/index.js +117 -0
  14. package/dist/cli/index.js.map +1 -0
  15. package/dist/estree-467CT4RF.js +4613 -0
  16. package/dist/estree-467CT4RF.js.map +1 -0
  17. package/dist/flow-FCFYGKSM.js +27547 -0
  18. package/dist/flow-FCFYGKSM.js.map +1 -0
  19. package/dist/glimmer-P46N72G3.js +2895 -0
  20. package/dist/glimmer-P46N72G3.js.map +1 -0
  21. package/dist/graphql-TFOZJU7B.js +1267 -0
  22. package/dist/graphql-TFOZJU7B.js.map +1 -0
  23. package/dist/html-KZKNLN3R.js +2934 -0
  24. package/dist/html-KZKNLN3R.js.map +1 -0
  25. package/dist/index.d.ts +123 -0
  26. package/dist/index.js +36 -0
  27. package/dist/index.js.map +1 -0
  28. package/dist/markdown-BS2B5AKD.js +3554 -0
  29. package/dist/markdown-BS2B5AKD.js.map +1 -0
  30. package/dist/meriyah-W6HUPGCY.js +2685 -0
  31. package/dist/meriyah-W6HUPGCY.js.map +1 -0
  32. package/dist/postcss-LMJBCD2Q.js +5081 -0
  33. package/dist/postcss-LMJBCD2Q.js.map +1 -0
  34. package/dist/typescript-Y5EPKFX5.js +13204 -0
  35. package/dist/typescript-Y5EPKFX5.js.map +1 -0
  36. package/dist/yaml-ZNP3H3BX.js +4225 -0
  37. package/dist/yaml-ZNP3H3BX.js.map +1 -0
  38. package/package.json +52 -0
@@ -0,0 +1,1267 @@
1
+ import "./chunk-PZ5AY32C.js";
2
+
3
+ // ../../node_modules/.pnpm/prettier@3.8.0/node_modules/prettier/plugins/graphql.mjs
4
+ var pt = Object.defineProperty;
5
+ var de = (e2, t) => {
6
+ for (var n in t) pt(e2, n, { get: t[n], enumerable: true });
7
+ };
8
+ var ut = {};
9
+ de(ut, { languages: () => Ye, options: () => $e, parsers: () => he, printers: () => nn });
10
+ var me = (e2, t) => (n, i, ...r) => n | 1 && i == null ? void 0 : (t.call(i) ?? i[e2]).apply(i, r);
11
+ var lt = String.prototype.replaceAll ?? function(e2, t) {
12
+ return e2.global ? this.replace(e2, t) : this.split(e2).join(t);
13
+ };
14
+ var ft = me("replaceAll", function() {
15
+ if (typeof this == "string") return lt;
16
+ });
17
+ var U = ft;
18
+ var ht = () => {
19
+ };
20
+ var ie = ht;
21
+ var Ee = "indent";
22
+ var Te = "group";
23
+ var Ne = "if-break";
24
+ var G = "line";
25
+ var xe = "break-parent";
26
+ var S = ie;
27
+ var Y = ie;
28
+ function x(e2) {
29
+ return S(e2), { type: Ee, contents: e2 };
30
+ }
31
+ var _e = { type: xe };
32
+ function y(e2, t = {}) {
33
+ return S(e2), Y(t.expandedStates, true), { type: Te, id: t.id, contents: e2, break: !!t.shouldBreak, expandedStates: t.expandedStates };
34
+ }
35
+ function I(e2, t = "", n = {}) {
36
+ return S(e2), t !== "" && S(t), { type: Ne, breakContents: e2, flatContents: t, groupId: n.groupId };
37
+ }
38
+ function E(e2, t) {
39
+ S(e2), Y(t);
40
+ let n = [];
41
+ for (let i = 0; i < t.length; i++) i !== 0 && n.push(e2), n.push(t[i]);
42
+ return n;
43
+ }
44
+ var k = { type: G };
45
+ var l = { type: G, soft: true };
46
+ var dt = { type: G, hard: true };
47
+ var f = [dt, _e];
48
+ function j(e2) {
49
+ return (t, n, i) => {
50
+ let r = !!i?.backwards;
51
+ if (n === false) return false;
52
+ let { length: s } = t, a = n;
53
+ for (; a >= 0 && a < s; ) {
54
+ let u = t.charAt(a);
55
+ if (e2 instanceof RegExp) {
56
+ if (!e2.test(u)) return a;
57
+ } else if (!e2.includes(u)) return a;
58
+ r ? a-- : a++;
59
+ }
60
+ return a === -1 || a === s ? a : false;
61
+ };
62
+ }
63
+ var kn = j(/\s/u);
64
+ var $ = j(" ");
65
+ var ye = j(",; ");
66
+ var Ae = j(/[^\n\r]/u);
67
+ var Oe = (e2) => e2 === `
68
+ ` || e2 === "\r" || e2 === "\u2028" || e2 === "\u2029";
69
+ function mt(e2, t, n) {
70
+ let i = !!n?.backwards;
71
+ if (t === false) return false;
72
+ let r = e2.charAt(t);
73
+ if (i) {
74
+ if (e2.charAt(t - 1) === "\r" && r === `
75
+ `) return t - 2;
76
+ if (Oe(r)) return t - 1;
77
+ } else {
78
+ if (r === "\r" && e2.charAt(t + 1) === `
79
+ `) return t + 2;
80
+ if (Oe(r)) return t + 1;
81
+ }
82
+ return t;
83
+ }
84
+ var X = mt;
85
+ function Et(e2, t, n = {}) {
86
+ let i = $(e2, n.backwards ? t - 1 : t, n), r = X(e2, i, n);
87
+ return i !== r;
88
+ }
89
+ var Ie = Et;
90
+ function Tt(e2, t) {
91
+ if (t === false) return false;
92
+ if (e2.charAt(t) === "/" && e2.charAt(t + 1) === "*") {
93
+ for (let n = t + 2; n < e2.length; ++n) if (e2.charAt(n) === "*" && e2.charAt(n + 1) === "/") return n + 2;
94
+ }
95
+ return t;
96
+ }
97
+ var De = Tt;
98
+ function Nt(e2, t) {
99
+ return t === false ? false : e2.charAt(t) === "/" && e2.charAt(t + 1) === "/" ? Ae(e2, t) : t;
100
+ }
101
+ var ge = Nt;
102
+ function xt(e2, t) {
103
+ let n = null, i = t;
104
+ for (; i !== n; ) n = i, i = ye(e2, i), i = De(e2, i), i = $(e2, i);
105
+ return i = ge(e2, i), i = X(e2, i), i !== false && Ie(e2, i);
106
+ }
107
+ var Se = xt;
108
+ function _t(e2) {
109
+ return Array.isArray(e2) && e2.length > 0;
110
+ }
111
+ var se = _t;
112
+ var oe = class extends Error {
113
+ name = "UnexpectedNodeError";
114
+ constructor(t, n, i = "type") {
115
+ super(`Unexpected ${n} node ${i}: ${JSON.stringify(t[i])}.`), this.node = t;
116
+ }
117
+ };
118
+ var ke = oe;
119
+ var P = null;
120
+ function w(e2) {
121
+ if (P !== null && typeof P.property) {
122
+ let t = P;
123
+ return P = w.prototype = null, t;
124
+ }
125
+ return P = w.prototype = e2 ?? /* @__PURE__ */ Object.create(null), new w();
126
+ }
127
+ var yt = 10;
128
+ for (let e2 = 0; e2 <= yt; e2++) w();
129
+ function ae(e2) {
130
+ return w(e2);
131
+ }
132
+ function At(e2, t = "type") {
133
+ ae(e2);
134
+ function n(i) {
135
+ let r = i[t], s = e2[r];
136
+ if (!Array.isArray(s)) throw Object.assign(new Error(`Missing visitor keys for '${r}'.`), { node: i });
137
+ return s;
138
+ }
139
+ return n;
140
+ }
141
+ var Ce = At;
142
+ var H = class {
143
+ constructor(t, n, i) {
144
+ this.start = t.start, this.end = n.end, this.startToken = t, this.endToken = n, this.source = i;
145
+ }
146
+ get [Symbol.toStringTag]() {
147
+ return "Location";
148
+ }
149
+ toJSON() {
150
+ return { start: this.start, end: this.end };
151
+ }
152
+ };
153
+ var F = class {
154
+ constructor(t, n, i, r, s, a) {
155
+ this.kind = t, this.start = n, this.end = i, this.line = r, this.column = s, this.value = a, this.prev = null, this.next = null;
156
+ }
157
+ get [Symbol.toStringTag]() {
158
+ return "Token";
159
+ }
160
+ toJSON() {
161
+ return { kind: this.kind, value: this.value, line: this.line, column: this.column };
162
+ }
163
+ };
164
+ var ce = { Name: [], Document: ["definitions"], OperationDefinition: ["description", "name", "variableDefinitions", "directives", "selectionSet"], VariableDefinition: ["description", "variable", "type", "defaultValue", "directives"], Variable: ["name"], SelectionSet: ["selections"], Field: ["alias", "name", "arguments", "directives", "selectionSet"], Argument: ["name", "value"], FragmentSpread: ["name", "directives"], InlineFragment: ["typeCondition", "directives", "selectionSet"], FragmentDefinition: ["description", "name", "variableDefinitions", "typeCondition", "directives", "selectionSet"], IntValue: [], FloatValue: [], StringValue: [], BooleanValue: [], NullValue: [], EnumValue: [], ListValue: ["values"], ObjectValue: ["fields"], ObjectField: ["name", "value"], Directive: ["name", "arguments"], NamedType: ["name"], ListType: ["type"], NonNullType: ["type"], SchemaDefinition: ["description", "directives", "operationTypes"], OperationTypeDefinition: ["type"], ScalarTypeDefinition: ["description", "name", "directives"], ObjectTypeDefinition: ["description", "name", "interfaces", "directives", "fields"], FieldDefinition: ["description", "name", "arguments", "type", "directives"], InputValueDefinition: ["description", "name", "type", "defaultValue", "directives"], InterfaceTypeDefinition: ["description", "name", "interfaces", "directives", "fields"], UnionTypeDefinition: ["description", "name", "directives", "types"], EnumTypeDefinition: ["description", "name", "directives", "values"], EnumValueDefinition: ["description", "name", "directives"], InputObjectTypeDefinition: ["description", "name", "directives", "fields"], DirectiveDefinition: ["description", "name", "arguments", "locations"], SchemaExtension: ["directives", "operationTypes"], ScalarTypeExtension: ["name", "directives"], ObjectTypeExtension: ["name", "interfaces", "directives", "fields"], InterfaceTypeExtension: ["name", "interfaces", "directives", "fields"], UnionTypeExtension: ["name", "directives", "types"], EnumTypeExtension: ["name", "directives", "values"], InputObjectTypeExtension: ["name", "directives", "fields"], TypeCoordinate: ["name"], MemberCoordinate: ["name", "memberName"], ArgumentCoordinate: ["name", "fieldName", "argumentName"], DirectiveCoordinate: ["name"], DirectiveArgumentCoordinate: ["name", "argumentName"] };
165
+ var qn = new Set(Object.keys(ce));
166
+ var C;
167
+ (function(e2) {
168
+ e2.QUERY = "query", e2.MUTATION = "mutation", e2.SUBSCRIPTION = "subscription";
169
+ })(C || (C = {}));
170
+ var Re = { ...ce };
171
+ for (let e2 of ["ArgumentCoordinate", "DirectiveArgumentCoordinate", "DirectiveCoordinate", "MemberCoordinate", "TypeCoordinate"]) delete Re[e2];
172
+ var ve = Re;
173
+ var Ot = Ce(ve, "kind");
174
+ var be = Ot;
175
+ var J = (e2) => e2.loc.start;
176
+ var q = (e2) => e2.loc.end;
177
+ var Le = "format";
178
+ var Pe = /^\s*#[^\S\n]*@(?:noformat|noprettier)\s*(?:\n|$)/u;
179
+ var we = /^\s*#[^\S\n]*@(?:format|prettier)\s*(?:\n|$)/u;
180
+ var Fe = (e2) => we.test(e2);
181
+ var Me = (e2) => Pe.test(e2);
182
+ var Ve = (e2) => `# @${Le}
183
+
184
+ ${e2}`;
185
+ function It(e2, t, n) {
186
+ let { node: i } = e2;
187
+ if (!i.description) return "";
188
+ let r = [n("description")];
189
+ return i.kind === "InputValueDefinition" && !i.description.block ? r.push(k) : r.push(f), r;
190
+ }
191
+ var A = It;
192
+ function Dt(e2, t, n) {
193
+ let { node: i } = e2;
194
+ switch (i.kind) {
195
+ case "Document":
196
+ return [...E(f, g(e2, t, n, "definitions")), f];
197
+ case "OperationDefinition": {
198
+ let r = t.originalText[J(i)] !== "{", s = !!i.name;
199
+ return [A(e2, t, n), r ? i.operation : "", r && s ? [" ", n("name")] : "", r && !s && se(i.variableDefinitions) ? " " : "", Be(e2, n), _(e2, n, i), !r && !s ? "" : " ", n("selectionSet")];
200
+ }
201
+ case "FragmentDefinition":
202
+ return [A(e2, t, n), "fragment ", n("name"), Be(e2, n), " on ", n("typeCondition"), _(e2, n, i), " ", n("selectionSet")];
203
+ case "SelectionSet":
204
+ return ["{", x([f, E(f, g(e2, t, n, "selections"))]), f, "}"];
205
+ case "Field":
206
+ return y([i.alias ? [n("alias"), ": "] : "", n("name"), i.arguments.length > 0 ? y(["(", x([l, E([I("", ", "), l], g(e2, t, n, "arguments"))]), l, ")"]) : "", _(e2, n, i), i.selectionSet ? " " : "", n("selectionSet")]);
207
+ case "Name":
208
+ return i.value;
209
+ case "StringValue":
210
+ if (i.block) {
211
+ let r = U(0, i.value, '"""', '\\"""').split(`
212
+ `);
213
+ return r.length === 1 && (r[0] = r[0].trim()), r.every((s) => s === "") && (r.length = 0), E(f, ['"""', ...r, '"""']);
214
+ }
215
+ return ['"', U(0, U(0, i.value, /["\\]/gu, "\\$&"), `
216
+ `, "\\n"), '"'];
217
+ case "IntValue":
218
+ case "FloatValue":
219
+ case "EnumValue":
220
+ return i.value;
221
+ case "BooleanValue":
222
+ return i.value ? "true" : "false";
223
+ case "NullValue":
224
+ return "null";
225
+ case "Variable":
226
+ return ["$", n("name")];
227
+ case "ListValue":
228
+ return y(["[", x([l, E([I("", ", "), l], e2.map(n, "values"))]), l, "]"]);
229
+ case "ObjectValue": {
230
+ let r = t.bracketSpacing && i.fields.length > 0 ? " " : "";
231
+ return y(["{", r, x([l, E([I("", ", "), l], e2.map(n, "fields"))]), l, I("", r), "}"]);
232
+ }
233
+ case "ObjectField":
234
+ case "Argument":
235
+ return [n("name"), ": ", n("value")];
236
+ case "Directive":
237
+ return ["@", n("name"), i.arguments.length > 0 ? y(["(", x([l, E([I("", ", "), l], g(e2, t, n, "arguments"))]), l, ")"]) : ""];
238
+ case "NamedType":
239
+ return n("name");
240
+ case "VariableDefinition":
241
+ return [A(e2, t, n), n("variable"), ": ", n("type"), i.defaultValue ? [" = ", n("defaultValue")] : "", _(e2, n, i)];
242
+ case "ObjectTypeExtension":
243
+ case "ObjectTypeDefinition":
244
+ case "InputObjectTypeExtension":
245
+ case "InputObjectTypeDefinition":
246
+ case "InterfaceTypeExtension":
247
+ case "InterfaceTypeDefinition": {
248
+ let { kind: r } = i, s = [];
249
+ return r.endsWith("TypeDefinition") ? s.push(A(e2, t, n)) : s.push("extend "), r.startsWith("ObjectType") ? s.push("type") : r.startsWith("InputObjectType") ? s.push("input") : s.push("interface"), s.push(" ", n("name")), !r.startsWith("InputObjectType") && i.interfaces.length > 0 && s.push(" implements ", ...kt(e2, t, n)), s.push(_(e2, n, i)), i.fields.length > 0 && s.push([" {", x([f, E(f, g(e2, t, n, "fields"))]), f, "}"]), s;
250
+ }
251
+ case "FieldDefinition":
252
+ return [A(e2, t, n), n("name"), i.arguments.length > 0 ? y(["(", x([l, E([I("", ", "), l], g(e2, t, n, "arguments"))]), l, ")"]) : "", ": ", n("type"), _(e2, n, i)];
253
+ case "DirectiveDefinition":
254
+ return [A(e2, t, n), "directive ", "@", n("name"), i.arguments.length > 0 ? y(["(", x([l, E([I("", ", "), l], g(e2, t, n, "arguments"))]), l, ")"]) : "", i.repeatable ? " repeatable" : "", " on ", ...E(" | ", e2.map(n, "locations"))];
255
+ case "EnumTypeExtension":
256
+ case "EnumTypeDefinition":
257
+ return [A(e2, t, n), i.kind === "EnumTypeExtension" ? "extend " : "", "enum ", n("name"), _(e2, n, i), i.values.length > 0 ? [" {", x([f, E(f, g(e2, t, n, "values"))]), f, "}"] : ""];
258
+ case "EnumValueDefinition":
259
+ return [A(e2, t, n), n("name"), _(e2, n, i)];
260
+ case "InputValueDefinition":
261
+ return [A(e2, t, n), n("name"), ": ", n("type"), i.defaultValue ? [" = ", n("defaultValue")] : "", _(e2, n, i)];
262
+ case "SchemaExtension":
263
+ return ["extend schema", _(e2, n, i), ...i.operationTypes.length > 0 ? [" {", x([f, E(f, g(e2, t, n, "operationTypes"))]), f, "}"] : []];
264
+ case "SchemaDefinition":
265
+ return [A(e2, t, n), "schema", _(e2, n, i), " {", i.operationTypes.length > 0 ? x([f, E(f, g(e2, t, n, "operationTypes"))]) : "", f, "}"];
266
+ case "OperationTypeDefinition":
267
+ return [i.operation, ": ", n("type")];
268
+ case "FragmentSpread":
269
+ return ["...", n("name"), _(e2, n, i)];
270
+ case "InlineFragment":
271
+ return ["...", i.typeCondition ? [" on ", n("typeCondition")] : "", _(e2, n, i), " ", n("selectionSet")];
272
+ case "UnionTypeExtension":
273
+ case "UnionTypeDefinition":
274
+ return y([A(e2, t, n), y([i.kind === "UnionTypeExtension" ? "extend " : "", "union ", n("name"), _(e2, n, i), i.types.length > 0 ? [" =", I("", " "), x([I([k, "| "]), E([k, "| "], e2.map(n, "types"))])] : ""])]);
275
+ case "ScalarTypeExtension":
276
+ case "ScalarTypeDefinition":
277
+ return [A(e2, t, n), i.kind === "ScalarTypeExtension" ? "extend " : "", "scalar ", n("name"), _(e2, n, i)];
278
+ case "NonNullType":
279
+ return [n("type"), "!"];
280
+ case "ListType":
281
+ return ["[", n("type"), "]"];
282
+ default:
283
+ throw new ke(i, "Graphql", "kind");
284
+ }
285
+ }
286
+ function _(e2, t, n) {
287
+ if (n.directives.length === 0) return "";
288
+ let i = E(k, e2.map(t, "directives"));
289
+ return n.kind === "FragmentDefinition" || n.kind === "OperationDefinition" ? y([k, i]) : [" ", y(x([l, i]))];
290
+ }
291
+ function g(e2, t, n, i) {
292
+ return e2.map(({ isLast: r, node: s }) => {
293
+ let a = n();
294
+ return !r && Se(t.originalText, q(s)) ? [a, f] : a;
295
+ }, i);
296
+ }
297
+ function gt(e2) {
298
+ return e2.kind !== "Comment";
299
+ }
300
+ function St({ node: e2 }) {
301
+ if (e2.kind === "Comment") return "#" + e2.value.trimEnd();
302
+ throw new Error("Not a comment: " + JSON.stringify(e2));
303
+ }
304
+ function kt(e2, t, n) {
305
+ let { node: i } = e2, r = [], { interfaces: s } = i, a = e2.map(n, "interfaces");
306
+ for (let u = 0; u < s.length; u++) {
307
+ let p = s[u];
308
+ r.push(a[u]);
309
+ let T = s[u + 1];
310
+ if (T) {
311
+ let D = t.originalText.slice(p.loc.end, T.loc.start).includes("#");
312
+ r.push(" &", D ? k : " ");
313
+ }
314
+ }
315
+ return r;
316
+ }
317
+ function Be(e2, t) {
318
+ let { node: n } = e2;
319
+ return se(n.variableDefinitions) ? y(["(", x([l, E([I("", ", "), l], e2.map(t, "variableDefinitions"))]), l, ")"]) : "";
320
+ }
321
+ function Ue(e2, t) {
322
+ e2.kind === "StringValue" && e2.block && !e2.value.includes(`
323
+ `) && (t.value = e2.value.trim());
324
+ }
325
+ Ue.ignoredProperties = /* @__PURE__ */ new Set(["loc", "comments"]);
326
+ function Ct(e2) {
327
+ let { node: t } = e2;
328
+ return t?.comments?.some((n) => n.value.trim() === "prettier-ignore");
329
+ }
330
+ var Rt = { print: Dt, massageAstNode: Ue, hasPrettierIgnore: Ct, insertPragma: Ve, printComment: St, canAttachComment: gt, getVisitorKeys: be };
331
+ var Ge = Rt;
332
+ var Ye = [{ name: "GraphQL", type: "data", aceMode: "graphqlschema", extensions: [".graphql", ".gql", ".graphqls"], tmScope: "source.graphql", parsers: ["graphql"], vscodeLanguageIds: ["graphql"], linguistLanguageId: 139 }];
333
+ var je = { bracketSpacing: { category: "Common", type: "boolean", default: true, description: "Print spaces between brackets.", oppositeDescription: "Do not print spaces between brackets." }, objectWrap: { category: "Common", type: "choice", default: "preserve", description: "How to wrap object literals.", choices: [{ value: "preserve", description: "Keep as multi-line, if there is a newline between the opening brace and first property." }, { value: "collapse", description: "Fit to a single line when possible." }] }, singleQuote: { category: "Common", type: "boolean", default: false, description: "Use single quotes instead of double quotes." }, proseWrap: { category: "Common", type: "choice", default: "preserve", description: "How to wrap prose.", choices: [{ value: "always", description: "Wrap prose if it exceeds the print width." }, { value: "never", description: "Do not wrap prose." }, { value: "preserve", description: "Wrap prose as-is." }] }, bracketSameLine: { category: "Common", type: "boolean", default: false, description: "Put > of opening tags on the last line instead of on a new line." }, singleAttributePerLine: { category: "Common", type: "boolean", default: false, description: "Enforce single attribute per line in HTML, Vue and JSX." } };
334
+ var vt = { bracketSpacing: je.bracketSpacing };
335
+ var $e = vt;
336
+ var he = {};
337
+ de(he, { graphql: () => tn });
338
+ function Xe(e2) {
339
+ return typeof e2 == "object" && e2 !== null;
340
+ }
341
+ function He(e2, t) {
342
+ if (!!!e2) throw new Error(t ?? "Unexpected invariant triggered.");
343
+ }
344
+ var bt = /\r\n|[\n\r]/g;
345
+ function M(e2, t) {
346
+ let n = 0, i = 1;
347
+ for (let r of e2.body.matchAll(bt)) {
348
+ if (typeof r.index == "number" || He(false), r.index >= t) break;
349
+ n = r.index + r[0].length, i += 1;
350
+ }
351
+ return { line: i, column: t + 1 - n };
352
+ }
353
+ function qe(e2) {
354
+ return ue(e2.source, M(e2.source, e2.start));
355
+ }
356
+ function ue(e2, t) {
357
+ let n = e2.locationOffset.column - 1, i = "".padStart(n) + e2.body, r = t.line - 1, s = e2.locationOffset.line - 1, a = t.line + s, u = t.line === 1 ? n : 0, p = t.column + u, T = `${e2.name}:${a}:${p}
358
+ `, d = i.split(/\r\n|[\n\r]/g), D = d[r];
359
+ if (D.length > 120) {
360
+ let O = Math.floor(p / 80), re = p % 80, N = [];
361
+ for (let v = 0; v < D.length; v += 80) N.push(D.slice(v, v + 80));
362
+ return T + Je([[`${a} |`, N[0]], ...N.slice(1, O + 1).map((v) => ["|", v]), ["|", "^".padStart(re)], ["|", N[O + 1]]]);
363
+ }
364
+ return T + Je([[`${a - 1} |`, d[r - 1]], [`${a} |`, D], ["|", "^".padStart(p)], [`${a + 1} |`, d[r + 1]]]);
365
+ }
366
+ function Je(e2) {
367
+ let t = e2.filter(([i, r]) => r !== void 0), n = Math.max(...t.map(([i]) => i.length));
368
+ return t.map(([i, r]) => i.padStart(n) + (r ? " " + r : "")).join(`
369
+ `);
370
+ }
371
+ function Lt(e2) {
372
+ let t = e2[0];
373
+ return t == null || "kind" in t || "length" in t ? { nodes: t, source: e2[1], positions: e2[2], path: e2[3], originalError: e2[4], extensions: e2[5] } : t;
374
+ }
375
+ var Q = class e extends Error {
376
+ constructor(t, ...n) {
377
+ var i, r, s;
378
+ let { nodes: a, source: u, positions: p, path: T, originalError: d, extensions: D } = Lt(n);
379
+ super(t), this.name = "GraphQLError", this.path = T ?? void 0, this.originalError = d ?? void 0, this.nodes = Qe(Array.isArray(a) ? a : a ? [a] : void 0);
380
+ let O = Qe((i = this.nodes) === null || i === void 0 ? void 0 : i.map((N) => N.loc).filter((N) => N != null));
381
+ this.source = u ?? (O == null || (r = O[0]) === null || r === void 0 ? void 0 : r.source), this.positions = p ?? O?.map((N) => N.start), this.locations = p && u ? p.map((N) => M(u, N)) : O?.map((N) => M(N.source, N.start));
382
+ let re = Xe(d?.extensions) ? d?.extensions : void 0;
383
+ this.extensions = (s = D ?? re) !== null && s !== void 0 ? s : /* @__PURE__ */ Object.create(null), Object.defineProperties(this, { message: { writable: true, enumerable: true }, name: { enumerable: false }, nodes: { enumerable: false }, source: { enumerable: false }, positions: { enumerable: false }, originalError: { enumerable: false } }), d != null && d.stack ? Object.defineProperty(this, "stack", { value: d.stack, writable: true, configurable: true }) : Error.captureStackTrace ? Error.captureStackTrace(this, e) : Object.defineProperty(this, "stack", { value: Error().stack, writable: true, configurable: true });
384
+ }
385
+ get [Symbol.toStringTag]() {
386
+ return "GraphQLError";
387
+ }
388
+ toString() {
389
+ let t = this.message;
390
+ if (this.nodes) for (let n of this.nodes) n.loc && (t += `
391
+
392
+ ` + qe(n.loc));
393
+ else if (this.source && this.locations) for (let n of this.locations) t += `
394
+
395
+ ` + ue(this.source, n);
396
+ return t;
397
+ }
398
+ toJSON() {
399
+ let t = { message: this.message };
400
+ return this.locations != null && (t.locations = this.locations), this.path != null && (t.path = this.path), this.extensions != null && Object.keys(this.extensions).length > 0 && (t.extensions = this.extensions), t;
401
+ }
402
+ };
403
+ function Qe(e2) {
404
+ return e2 === void 0 || e2.length === 0 ? void 0 : e2;
405
+ }
406
+ function h(e2, t, n) {
407
+ return new Q(`Syntax Error: ${n}`, { source: e2, positions: [t] });
408
+ }
409
+ var W;
410
+ (function(e2) {
411
+ e2.QUERY = "QUERY", e2.MUTATION = "MUTATION", e2.SUBSCRIPTION = "SUBSCRIPTION", e2.FIELD = "FIELD", e2.FRAGMENT_DEFINITION = "FRAGMENT_DEFINITION", e2.FRAGMENT_SPREAD = "FRAGMENT_SPREAD", e2.INLINE_FRAGMENT = "INLINE_FRAGMENT", e2.VARIABLE_DEFINITION = "VARIABLE_DEFINITION", e2.SCHEMA = "SCHEMA", e2.SCALAR = "SCALAR", e2.OBJECT = "OBJECT", e2.FIELD_DEFINITION = "FIELD_DEFINITION", e2.ARGUMENT_DEFINITION = "ARGUMENT_DEFINITION", e2.INTERFACE = "INTERFACE", e2.UNION = "UNION", e2.ENUM = "ENUM", e2.ENUM_VALUE = "ENUM_VALUE", e2.INPUT_OBJECT = "INPUT_OBJECT", e2.INPUT_FIELD_DEFINITION = "INPUT_FIELD_DEFINITION";
412
+ })(W || (W = {}));
413
+ var c;
414
+ (function(e2) {
415
+ e2.NAME = "Name", e2.DOCUMENT = "Document", e2.OPERATION_DEFINITION = "OperationDefinition", e2.VARIABLE_DEFINITION = "VariableDefinition", e2.SELECTION_SET = "SelectionSet", e2.FIELD = "Field", e2.ARGUMENT = "Argument", e2.FRAGMENT_SPREAD = "FragmentSpread", e2.INLINE_FRAGMENT = "InlineFragment", e2.FRAGMENT_DEFINITION = "FragmentDefinition", e2.VARIABLE = "Variable", e2.INT = "IntValue", e2.FLOAT = "FloatValue", e2.STRING = "StringValue", e2.BOOLEAN = "BooleanValue", e2.NULL = "NullValue", e2.ENUM = "EnumValue", e2.LIST = "ListValue", e2.OBJECT = "ObjectValue", e2.OBJECT_FIELD = "ObjectField", e2.DIRECTIVE = "Directive", e2.NAMED_TYPE = "NamedType", e2.LIST_TYPE = "ListType", e2.NON_NULL_TYPE = "NonNullType", e2.SCHEMA_DEFINITION = "SchemaDefinition", e2.OPERATION_TYPE_DEFINITION = "OperationTypeDefinition", e2.SCALAR_TYPE_DEFINITION = "ScalarTypeDefinition", e2.OBJECT_TYPE_DEFINITION = "ObjectTypeDefinition", e2.FIELD_DEFINITION = "FieldDefinition", e2.INPUT_VALUE_DEFINITION = "InputValueDefinition", e2.INTERFACE_TYPE_DEFINITION = "InterfaceTypeDefinition", e2.UNION_TYPE_DEFINITION = "UnionTypeDefinition", e2.ENUM_TYPE_DEFINITION = "EnumTypeDefinition", e2.ENUM_VALUE_DEFINITION = "EnumValueDefinition", e2.INPUT_OBJECT_TYPE_DEFINITION = "InputObjectTypeDefinition", e2.DIRECTIVE_DEFINITION = "DirectiveDefinition", e2.SCHEMA_EXTENSION = "SchemaExtension", e2.SCALAR_TYPE_EXTENSION = "ScalarTypeExtension", e2.OBJECT_TYPE_EXTENSION = "ObjectTypeExtension", e2.INTERFACE_TYPE_EXTENSION = "InterfaceTypeExtension", e2.UNION_TYPE_EXTENSION = "UnionTypeExtension", e2.ENUM_TYPE_EXTENSION = "EnumTypeExtension", e2.INPUT_OBJECT_TYPE_EXTENSION = "InputObjectTypeExtension", e2.TYPE_COORDINATE = "TypeCoordinate", e2.MEMBER_COORDINATE = "MemberCoordinate", e2.ARGUMENT_COORDINATE = "ArgumentCoordinate", e2.DIRECTIVE_COORDINATE = "DirectiveCoordinate", e2.DIRECTIVE_ARGUMENT_COORDINATE = "DirectiveArgumentCoordinate";
416
+ })(c || (c = {}));
417
+ function We(e2) {
418
+ return e2 === 9 || e2 === 32;
419
+ }
420
+ function b(e2) {
421
+ return e2 >= 48 && e2 <= 57;
422
+ }
423
+ function ze(e2) {
424
+ return e2 >= 97 && e2 <= 122 || e2 >= 65 && e2 <= 90;
425
+ }
426
+ function pe(e2) {
427
+ return ze(e2) || e2 === 95;
428
+ }
429
+ function Ke(e2) {
430
+ return ze(e2) || b(e2) || e2 === 95;
431
+ }
432
+ function Ze(e2) {
433
+ var t;
434
+ let n = Number.MAX_SAFE_INTEGER, i = null, r = -1;
435
+ for (let a = 0; a < e2.length; ++a) {
436
+ var s;
437
+ let u = e2[a], p = Pt(u);
438
+ p !== u.length && (i = (s = i) !== null && s !== void 0 ? s : a, r = a, a !== 0 && p < n && (n = p));
439
+ }
440
+ return e2.map((a, u) => u === 0 ? a : a.slice(n)).slice((t = i) !== null && t !== void 0 ? t : 0, r + 1);
441
+ }
442
+ function Pt(e2) {
443
+ let t = 0;
444
+ for (; t < e2.length && We(e2.charCodeAt(t)); ) ++t;
445
+ return t;
446
+ }
447
+ var o;
448
+ (function(e2) {
449
+ e2.SOF = "<SOF>", e2.EOF = "<EOF>", e2.BANG = "!", e2.DOLLAR = "$", e2.AMP = "&", e2.PAREN_L = "(", e2.PAREN_R = ")", e2.DOT = ".", e2.SPREAD = "...", e2.COLON = ":", e2.EQUALS = "=", e2.AT = "@", e2.BRACKET_L = "[", e2.BRACKET_R = "]", e2.BRACE_L = "{", e2.PIPE = "|", e2.BRACE_R = "}", e2.NAME = "Name", e2.INT = "Int", e2.FLOAT = "Float", e2.STRING = "String", e2.BLOCK_STRING = "BlockString", e2.COMMENT = "Comment";
450
+ })(o || (o = {}));
451
+ var z = class {
452
+ constructor(t) {
453
+ let n = new F(o.SOF, 0, 0, 0, 0);
454
+ this.source = t, this.lastToken = n, this.token = n, this.line = 1, this.lineStart = 0;
455
+ }
456
+ get [Symbol.toStringTag]() {
457
+ return "Lexer";
458
+ }
459
+ advance() {
460
+ return this.lastToken = this.token, this.token = this.lookahead();
461
+ }
462
+ lookahead() {
463
+ let t = this.token;
464
+ if (t.kind !== o.EOF) do
465
+ if (t.next) t = t.next;
466
+ else {
467
+ let n = wt(this, t.end);
468
+ t.next = n, n.prev = t, t = n;
469
+ }
470
+ while (t.kind === o.COMMENT);
471
+ return t;
472
+ }
473
+ };
474
+ function tt(e2) {
475
+ return e2 === o.BANG || e2 === o.DOLLAR || e2 === o.AMP || e2 === o.PAREN_L || e2 === o.PAREN_R || e2 === o.DOT || e2 === o.SPREAD || e2 === o.COLON || e2 === o.EQUALS || e2 === o.AT || e2 === o.BRACKET_L || e2 === o.BRACKET_R || e2 === o.BRACE_L || e2 === o.PIPE || e2 === o.BRACE_R;
476
+ }
477
+ function L(e2) {
478
+ return e2 >= 0 && e2 <= 55295 || e2 >= 57344 && e2 <= 1114111;
479
+ }
480
+ function K(e2, t) {
481
+ return nt(e2.charCodeAt(t)) && rt(e2.charCodeAt(t + 1));
482
+ }
483
+ function nt(e2) {
484
+ return e2 >= 55296 && e2 <= 56319;
485
+ }
486
+ function rt(e2) {
487
+ return e2 >= 56320 && e2 <= 57343;
488
+ }
489
+ function R(e2, t) {
490
+ let n = e2.source.body.codePointAt(t);
491
+ if (n === void 0) return o.EOF;
492
+ if (n >= 32 && n <= 126) {
493
+ let i = String.fromCodePoint(n);
494
+ return i === '"' ? `'"'` : `"${i}"`;
495
+ }
496
+ return "U+" + n.toString(16).toUpperCase().padStart(4, "0");
497
+ }
498
+ function m(e2, t, n, i, r) {
499
+ let s = e2.line, a = 1 + n - e2.lineStart;
500
+ return new F(t, n, i, s, a, r);
501
+ }
502
+ function wt(e2, t) {
503
+ let n = e2.source.body, i = n.length, r = t;
504
+ for (; r < i; ) {
505
+ let s = n.charCodeAt(r);
506
+ switch (s) {
507
+ case 65279:
508
+ case 9:
509
+ case 32:
510
+ case 44:
511
+ ++r;
512
+ continue;
513
+ case 10:
514
+ ++r, ++e2.line, e2.lineStart = r;
515
+ continue;
516
+ case 13:
517
+ n.charCodeAt(r + 1) === 10 ? r += 2 : ++r, ++e2.line, e2.lineStart = r;
518
+ continue;
519
+ case 35:
520
+ return Ft(e2, r);
521
+ case 33:
522
+ return m(e2, o.BANG, r, r + 1);
523
+ case 36:
524
+ return m(e2, o.DOLLAR, r, r + 1);
525
+ case 38:
526
+ return m(e2, o.AMP, r, r + 1);
527
+ case 40:
528
+ return m(e2, o.PAREN_L, r, r + 1);
529
+ case 41:
530
+ return m(e2, o.PAREN_R, r, r + 1);
531
+ case 46:
532
+ if (n.charCodeAt(r + 1) === 46 && n.charCodeAt(r + 2) === 46) return m(e2, o.SPREAD, r, r + 3);
533
+ break;
534
+ case 58:
535
+ return m(e2, o.COLON, r, r + 1);
536
+ case 61:
537
+ return m(e2, o.EQUALS, r, r + 1);
538
+ case 64:
539
+ return m(e2, o.AT, r, r + 1);
540
+ case 91:
541
+ return m(e2, o.BRACKET_L, r, r + 1);
542
+ case 93:
543
+ return m(e2, o.BRACKET_R, r, r + 1);
544
+ case 123:
545
+ return m(e2, o.BRACE_L, r, r + 1);
546
+ case 124:
547
+ return m(e2, o.PIPE, r, r + 1);
548
+ case 125:
549
+ return m(e2, o.BRACE_R, r, r + 1);
550
+ case 34:
551
+ return n.charCodeAt(r + 1) === 34 && n.charCodeAt(r + 2) === 34 ? Yt(e2, r) : Vt(e2, r);
552
+ }
553
+ if (b(s) || s === 45) return Mt(e2, r, s);
554
+ if (pe(s)) return jt(e2, r);
555
+ throw h(e2.source, r, s === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : L(s) || K(n, r) ? `Unexpected character: ${R(e2, r)}.` : `Invalid character: ${R(e2, r)}.`);
556
+ }
557
+ return m(e2, o.EOF, i, i);
558
+ }
559
+ function Ft(e2, t) {
560
+ let n = e2.source.body, i = n.length, r = t + 1;
561
+ for (; r < i; ) {
562
+ let s = n.charCodeAt(r);
563
+ if (s === 10 || s === 13) break;
564
+ if (L(s)) ++r;
565
+ else if (K(n, r)) r += 2;
566
+ else break;
567
+ }
568
+ return m(e2, o.COMMENT, t, r, n.slice(t + 1, r));
569
+ }
570
+ function Mt(e2, t, n) {
571
+ let i = e2.source.body, r = t, s = n, a = false;
572
+ if (s === 45 && (s = i.charCodeAt(++r)), s === 48) {
573
+ if (s = i.charCodeAt(++r), b(s)) throw h(e2.source, r, `Invalid number, unexpected digit after 0: ${R(e2, r)}.`);
574
+ } else r = le(e2, r, s), s = i.charCodeAt(r);
575
+ if (s === 46 && (a = true, s = i.charCodeAt(++r), r = le(e2, r, s), s = i.charCodeAt(r)), (s === 69 || s === 101) && (a = true, s = i.charCodeAt(++r), (s === 43 || s === 45) && (s = i.charCodeAt(++r)), r = le(e2, r, s), s = i.charCodeAt(r)), s === 46 || pe(s)) throw h(e2.source, r, `Invalid number, expected digit but got: ${R(e2, r)}.`);
576
+ return m(e2, a ? o.FLOAT : o.INT, t, r, i.slice(t, r));
577
+ }
578
+ function le(e2, t, n) {
579
+ if (!b(n)) throw h(e2.source, t, `Invalid number, expected digit but got: ${R(e2, t)}.`);
580
+ let i = e2.source.body, r = t + 1;
581
+ for (; b(i.charCodeAt(r)); ) ++r;
582
+ return r;
583
+ }
584
+ function Vt(e2, t) {
585
+ let n = e2.source.body, i = n.length, r = t + 1, s = r, a = "";
586
+ for (; r < i; ) {
587
+ let u = n.charCodeAt(r);
588
+ if (u === 34) return a += n.slice(s, r), m(e2, o.STRING, t, r + 1, a);
589
+ if (u === 92) {
590
+ a += n.slice(s, r);
591
+ let p = n.charCodeAt(r + 1) === 117 ? n.charCodeAt(r + 2) === 123 ? Bt(e2, r) : Ut(e2, r) : Gt(e2, r);
592
+ a += p.value, r += p.size, s = r;
593
+ continue;
594
+ }
595
+ if (u === 10 || u === 13) break;
596
+ if (L(u)) ++r;
597
+ else if (K(n, r)) r += 2;
598
+ else throw h(e2.source, r, `Invalid character within String: ${R(e2, r)}.`);
599
+ }
600
+ throw h(e2.source, r, "Unterminated string.");
601
+ }
602
+ function Bt(e2, t) {
603
+ let n = e2.source.body, i = 0, r = 3;
604
+ for (; r < 12; ) {
605
+ let s = n.charCodeAt(t + r++);
606
+ if (s === 125) {
607
+ if (r < 5 || !L(i)) break;
608
+ return { value: String.fromCodePoint(i), size: r };
609
+ }
610
+ if (i = i << 4 | V(s), i < 0) break;
611
+ }
612
+ throw h(e2.source, t, `Invalid Unicode escape sequence: "${n.slice(t, t + r)}".`);
613
+ }
614
+ function Ut(e2, t) {
615
+ let n = e2.source.body, i = et(n, t + 2);
616
+ if (L(i)) return { value: String.fromCodePoint(i), size: 6 };
617
+ if (nt(i) && n.charCodeAt(t + 6) === 92 && n.charCodeAt(t + 7) === 117) {
618
+ let r = et(n, t + 8);
619
+ if (rt(r)) return { value: String.fromCodePoint(i, r), size: 12 };
620
+ }
621
+ throw h(e2.source, t, `Invalid Unicode escape sequence: "${n.slice(t, t + 6)}".`);
622
+ }
623
+ function et(e2, t) {
624
+ return V(e2.charCodeAt(t)) << 12 | V(e2.charCodeAt(t + 1)) << 8 | V(e2.charCodeAt(t + 2)) << 4 | V(e2.charCodeAt(t + 3));
625
+ }
626
+ function V(e2) {
627
+ return e2 >= 48 && e2 <= 57 ? e2 - 48 : e2 >= 65 && e2 <= 70 ? e2 - 55 : e2 >= 97 && e2 <= 102 ? e2 - 87 : -1;
628
+ }
629
+ function Gt(e2, t) {
630
+ let n = e2.source.body;
631
+ switch (n.charCodeAt(t + 1)) {
632
+ case 34:
633
+ return { value: '"', size: 2 };
634
+ case 92:
635
+ return { value: "\\", size: 2 };
636
+ case 47:
637
+ return { value: "/", size: 2 };
638
+ case 98:
639
+ return { value: "\b", size: 2 };
640
+ case 102:
641
+ return { value: "\f", size: 2 };
642
+ case 110:
643
+ return { value: `
644
+ `, size: 2 };
645
+ case 114:
646
+ return { value: "\r", size: 2 };
647
+ case 116:
648
+ return { value: " ", size: 2 };
649
+ }
650
+ throw h(e2.source, t, `Invalid character escape sequence: "${n.slice(t, t + 2)}".`);
651
+ }
652
+ function Yt(e2, t) {
653
+ let n = e2.source.body, i = n.length, r = e2.lineStart, s = t + 3, a = s, u = "", p = [];
654
+ for (; s < i; ) {
655
+ let T = n.charCodeAt(s);
656
+ if (T === 34 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34) {
657
+ u += n.slice(a, s), p.push(u);
658
+ let d = m(e2, o.BLOCK_STRING, t, s + 3, Ze(p).join(`
659
+ `));
660
+ return e2.line += p.length - 1, e2.lineStart = r, d;
661
+ }
662
+ if (T === 92 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34 && n.charCodeAt(s + 3) === 34) {
663
+ u += n.slice(a, s), a = s + 1, s += 4;
664
+ continue;
665
+ }
666
+ if (T === 10 || T === 13) {
667
+ u += n.slice(a, s), p.push(u), T === 13 && n.charCodeAt(s + 1) === 10 ? s += 2 : ++s, u = "", a = s, r = s;
668
+ continue;
669
+ }
670
+ if (L(T)) ++s;
671
+ else if (K(n, s)) s += 2;
672
+ else throw h(e2.source, s, `Invalid character within String: ${R(e2, s)}.`);
673
+ }
674
+ throw h(e2.source, s, "Unterminated string.");
675
+ }
676
+ function jt(e2, t) {
677
+ let n = e2.source.body, i = n.length, r = t + 1;
678
+ for (; r < i; ) {
679
+ let s = n.charCodeAt(r);
680
+ if (Ke(s)) ++r;
681
+ else break;
682
+ }
683
+ return m(e2, o.NAME, t, r, n.slice(t, r));
684
+ }
685
+ function Z(e2, t) {
686
+ if (!!!e2) throw new Error(t);
687
+ }
688
+ function ee(e2) {
689
+ return te(e2, []);
690
+ }
691
+ function te(e2, t) {
692
+ switch (typeof e2) {
693
+ case "string":
694
+ return JSON.stringify(e2);
695
+ case "function":
696
+ return e2.name ? `[function ${e2.name}]` : "[function]";
697
+ case "object":
698
+ return $t(e2, t);
699
+ default:
700
+ return String(e2);
701
+ }
702
+ }
703
+ function $t(e2, t) {
704
+ if (e2 === null) return "null";
705
+ if (t.includes(e2)) return "[Circular]";
706
+ let n = [...t, e2];
707
+ if (Xt(e2)) {
708
+ let i = e2.toJSON();
709
+ if (i !== e2) return typeof i == "string" ? i : te(i, n);
710
+ } else if (Array.isArray(e2)) return Jt(e2, n);
711
+ return Ht(e2, n);
712
+ }
713
+ function Xt(e2) {
714
+ return typeof e2.toJSON == "function";
715
+ }
716
+ function Ht(e2, t) {
717
+ let n = Object.entries(e2);
718
+ return n.length === 0 ? "{}" : t.length > 2 ? "[" + qt(e2) + "]" : "{ " + n.map(([r, s]) => r + ": " + te(s, t)).join(", ") + " }";
719
+ }
720
+ function Jt(e2, t) {
721
+ if (e2.length === 0) return "[]";
722
+ if (t.length > 2) return "[Array]";
723
+ let n = Math.min(10, e2.length), i = e2.length - n, r = [];
724
+ for (let s = 0; s < n; ++s) r.push(te(e2[s], t));
725
+ return i === 1 ? r.push("... 1 more item") : i > 1 && r.push(`... ${i} more items`), "[" + r.join(", ") + "]";
726
+ }
727
+ function qt(e2) {
728
+ let t = Object.prototype.toString.call(e2).replace(/^\[object /, "").replace(/]$/, "");
729
+ if (t === "Object" && typeof e2.constructor == "function") {
730
+ let n = e2.constructor.name;
731
+ if (typeof n == "string" && n !== "") return n;
732
+ }
733
+ return t;
734
+ }
735
+ var Qt = globalThis.process && true;
736
+ var it = Qt ? function(t, n) {
737
+ return t instanceof n;
738
+ } : function(t, n) {
739
+ if (t instanceof n) return true;
740
+ if (typeof t == "object" && t !== null) {
741
+ var i;
742
+ let r = n.prototype[Symbol.toStringTag], s = Symbol.toStringTag in t ? t[Symbol.toStringTag] : (i = t.constructor) === null || i === void 0 ? void 0 : i.name;
743
+ if (r === s) {
744
+ let a = ee(t);
745
+ throw new Error(`Cannot use ${r} "${a}" from another module or realm.
746
+
747
+ Ensure that there is only one instance of "graphql" in the node_modules
748
+ directory. If different versions of "graphql" are the dependencies of other
749
+ relied on modules, use "resolutions" to ensure only one version is installed.
750
+
751
+ https://yarnpkg.com/en/docs/selective-version-resolutions
752
+
753
+ Duplicate "graphql" modules cannot be used at the same time since different
754
+ versions may have different capabilities and behavior. The data from one
755
+ version used in the function from another could produce confusing and
756
+ spurious results.`);
757
+ }
758
+ }
759
+ return false;
760
+ };
761
+ var B = class {
762
+ constructor(t, n = "GraphQL request", i = { line: 1, column: 1 }) {
763
+ typeof t == "string" || Z(false, `Body must be a string. Received: ${ee(t)}.`), this.body = t, this.name = n, this.locationOffset = i, this.locationOffset.line > 0 || Z(false, "line in locationOffset is 1-indexed and must be positive."), this.locationOffset.column > 0 || Z(false, "column in locationOffset is 1-indexed and must be positive.");
764
+ }
765
+ get [Symbol.toStringTag]() {
766
+ return "Source";
767
+ }
768
+ };
769
+ function st(e2) {
770
+ return it(e2, B);
771
+ }
772
+ function ot(e2, t) {
773
+ let n = new fe(e2, t), i = n.parseDocument();
774
+ return Object.defineProperty(i, "tokenCount", { enumerable: false, value: n.tokenCount }), i;
775
+ }
776
+ var fe = class {
777
+ constructor(t, n = {}) {
778
+ let { lexer: i, ...r } = n;
779
+ if (i) this._lexer = i;
780
+ else {
781
+ let s = st(t) ? t : new B(t);
782
+ this._lexer = new z(s);
783
+ }
784
+ this._options = r, this._tokenCounter = 0;
785
+ }
786
+ get tokenCount() {
787
+ return this._tokenCounter;
788
+ }
789
+ parseName() {
790
+ let t = this.expectToken(o.NAME);
791
+ return this.node(t, { kind: c.NAME, value: t.value });
792
+ }
793
+ parseDocument() {
794
+ return this.node(this._lexer.token, { kind: c.DOCUMENT, definitions: this.many(o.SOF, this.parseDefinition, o.EOF) });
795
+ }
796
+ parseDefinition() {
797
+ if (this.peek(o.BRACE_L)) return this.parseOperationDefinition();
798
+ let t = this.peekDescription(), n = t ? this._lexer.lookahead() : this._lexer.token;
799
+ if (t && n.kind === o.BRACE_L) throw h(this._lexer.source, this._lexer.token.start, "Unexpected description, descriptions are not supported on shorthand queries.");
800
+ if (n.kind === o.NAME) {
801
+ switch (n.value) {
802
+ case "schema":
803
+ return this.parseSchemaDefinition();
804
+ case "scalar":
805
+ return this.parseScalarTypeDefinition();
806
+ case "type":
807
+ return this.parseObjectTypeDefinition();
808
+ case "interface":
809
+ return this.parseInterfaceTypeDefinition();
810
+ case "union":
811
+ return this.parseUnionTypeDefinition();
812
+ case "enum":
813
+ return this.parseEnumTypeDefinition();
814
+ case "input":
815
+ return this.parseInputObjectTypeDefinition();
816
+ case "directive":
817
+ return this.parseDirectiveDefinition();
818
+ }
819
+ switch (n.value) {
820
+ case "query":
821
+ case "mutation":
822
+ case "subscription":
823
+ return this.parseOperationDefinition();
824
+ case "fragment":
825
+ return this.parseFragmentDefinition();
826
+ }
827
+ if (t) throw h(this._lexer.source, this._lexer.token.start, "Unexpected description, only GraphQL definitions support descriptions.");
828
+ switch (n.value) {
829
+ case "extend":
830
+ return this.parseTypeSystemExtension();
831
+ }
832
+ }
833
+ throw this.unexpected(n);
834
+ }
835
+ parseOperationDefinition() {
836
+ let t = this._lexer.token;
837
+ if (this.peek(o.BRACE_L)) return this.node(t, { kind: c.OPERATION_DEFINITION, operation: C.QUERY, description: void 0, name: void 0, variableDefinitions: [], directives: [], selectionSet: this.parseSelectionSet() });
838
+ let n = this.parseDescription(), i = this.parseOperationType(), r;
839
+ return this.peek(o.NAME) && (r = this.parseName()), this.node(t, { kind: c.OPERATION_DEFINITION, operation: i, description: n, name: r, variableDefinitions: this.parseVariableDefinitions(), directives: this.parseDirectives(false), selectionSet: this.parseSelectionSet() });
840
+ }
841
+ parseOperationType() {
842
+ let t = this.expectToken(o.NAME);
843
+ switch (t.value) {
844
+ case "query":
845
+ return C.QUERY;
846
+ case "mutation":
847
+ return C.MUTATION;
848
+ case "subscription":
849
+ return C.SUBSCRIPTION;
850
+ }
851
+ throw this.unexpected(t);
852
+ }
853
+ parseVariableDefinitions() {
854
+ return this.optionalMany(o.PAREN_L, this.parseVariableDefinition, o.PAREN_R);
855
+ }
856
+ parseVariableDefinition() {
857
+ return this.node(this._lexer.token, { kind: c.VARIABLE_DEFINITION, description: this.parseDescription(), variable: this.parseVariable(), type: (this.expectToken(o.COLON), this.parseTypeReference()), defaultValue: this.expectOptionalToken(o.EQUALS) ? this.parseConstValueLiteral() : void 0, directives: this.parseConstDirectives() });
858
+ }
859
+ parseVariable() {
860
+ let t = this._lexer.token;
861
+ return this.expectToken(o.DOLLAR), this.node(t, { kind: c.VARIABLE, name: this.parseName() });
862
+ }
863
+ parseSelectionSet() {
864
+ return this.node(this._lexer.token, { kind: c.SELECTION_SET, selections: this.many(o.BRACE_L, this.parseSelection, o.BRACE_R) });
865
+ }
866
+ parseSelection() {
867
+ return this.peek(o.SPREAD) ? this.parseFragment() : this.parseField();
868
+ }
869
+ parseField() {
870
+ let t = this._lexer.token, n = this.parseName(), i, r;
871
+ return this.expectOptionalToken(o.COLON) ? (i = n, r = this.parseName()) : r = n, this.node(t, { kind: c.FIELD, alias: i, name: r, arguments: this.parseArguments(false), directives: this.parseDirectives(false), selectionSet: this.peek(o.BRACE_L) ? this.parseSelectionSet() : void 0 });
872
+ }
873
+ parseArguments(t) {
874
+ let n = t ? this.parseConstArgument : this.parseArgument;
875
+ return this.optionalMany(o.PAREN_L, n, o.PAREN_R);
876
+ }
877
+ parseArgument(t = false) {
878
+ let n = this._lexer.token, i = this.parseName();
879
+ return this.expectToken(o.COLON), this.node(n, { kind: c.ARGUMENT, name: i, value: this.parseValueLiteral(t) });
880
+ }
881
+ parseConstArgument() {
882
+ return this.parseArgument(true);
883
+ }
884
+ parseFragment() {
885
+ let t = this._lexer.token;
886
+ this.expectToken(o.SPREAD);
887
+ let n = this.expectOptionalKeyword("on");
888
+ return !n && this.peek(o.NAME) ? this.node(t, { kind: c.FRAGMENT_SPREAD, name: this.parseFragmentName(), directives: this.parseDirectives(false) }) : this.node(t, { kind: c.INLINE_FRAGMENT, typeCondition: n ? this.parseNamedType() : void 0, directives: this.parseDirectives(false), selectionSet: this.parseSelectionSet() });
889
+ }
890
+ parseFragmentDefinition() {
891
+ let t = this._lexer.token, n = this.parseDescription();
892
+ return this.expectKeyword("fragment"), this._options.allowLegacyFragmentVariables === true ? this.node(t, { kind: c.FRAGMENT_DEFINITION, description: n, name: this.parseFragmentName(), variableDefinitions: this.parseVariableDefinitions(), typeCondition: (this.expectKeyword("on"), this.parseNamedType()), directives: this.parseDirectives(false), selectionSet: this.parseSelectionSet() }) : this.node(t, { kind: c.FRAGMENT_DEFINITION, description: n, name: this.parseFragmentName(), typeCondition: (this.expectKeyword("on"), this.parseNamedType()), directives: this.parseDirectives(false), selectionSet: this.parseSelectionSet() });
893
+ }
894
+ parseFragmentName() {
895
+ if (this._lexer.token.value === "on") throw this.unexpected();
896
+ return this.parseName();
897
+ }
898
+ parseValueLiteral(t) {
899
+ let n = this._lexer.token;
900
+ switch (n.kind) {
901
+ case o.BRACKET_L:
902
+ return this.parseList(t);
903
+ case o.BRACE_L:
904
+ return this.parseObject(t);
905
+ case o.INT:
906
+ return this.advanceLexer(), this.node(n, { kind: c.INT, value: n.value });
907
+ case o.FLOAT:
908
+ return this.advanceLexer(), this.node(n, { kind: c.FLOAT, value: n.value });
909
+ case o.STRING:
910
+ case o.BLOCK_STRING:
911
+ return this.parseStringLiteral();
912
+ case o.NAME:
913
+ switch (this.advanceLexer(), n.value) {
914
+ case "true":
915
+ return this.node(n, { kind: c.BOOLEAN, value: true });
916
+ case "false":
917
+ return this.node(n, { kind: c.BOOLEAN, value: false });
918
+ case "null":
919
+ return this.node(n, { kind: c.NULL });
920
+ default:
921
+ return this.node(n, { kind: c.ENUM, value: n.value });
922
+ }
923
+ case o.DOLLAR:
924
+ if (t) if (this.expectToken(o.DOLLAR), this._lexer.token.kind === o.NAME) {
925
+ let i = this._lexer.token.value;
926
+ throw h(this._lexer.source, n.start, `Unexpected variable "$${i}" in constant value.`);
927
+ } else throw this.unexpected(n);
928
+ return this.parseVariable();
929
+ default:
930
+ throw this.unexpected();
931
+ }
932
+ }
933
+ parseConstValueLiteral() {
934
+ return this.parseValueLiteral(true);
935
+ }
936
+ parseStringLiteral() {
937
+ let t = this._lexer.token;
938
+ return this.advanceLexer(), this.node(t, { kind: c.STRING, value: t.value, block: t.kind === o.BLOCK_STRING });
939
+ }
940
+ parseList(t) {
941
+ let n = () => this.parseValueLiteral(t);
942
+ return this.node(this._lexer.token, { kind: c.LIST, values: this.any(o.BRACKET_L, n, o.BRACKET_R) });
943
+ }
944
+ parseObject(t) {
945
+ let n = () => this.parseObjectField(t);
946
+ return this.node(this._lexer.token, { kind: c.OBJECT, fields: this.any(o.BRACE_L, n, o.BRACE_R) });
947
+ }
948
+ parseObjectField(t) {
949
+ let n = this._lexer.token, i = this.parseName();
950
+ return this.expectToken(o.COLON), this.node(n, { kind: c.OBJECT_FIELD, name: i, value: this.parseValueLiteral(t) });
951
+ }
952
+ parseDirectives(t) {
953
+ let n = [];
954
+ for (; this.peek(o.AT); ) n.push(this.parseDirective(t));
955
+ return n;
956
+ }
957
+ parseConstDirectives() {
958
+ return this.parseDirectives(true);
959
+ }
960
+ parseDirective(t) {
961
+ let n = this._lexer.token;
962
+ return this.expectToken(o.AT), this.node(n, { kind: c.DIRECTIVE, name: this.parseName(), arguments: this.parseArguments(t) });
963
+ }
964
+ parseTypeReference() {
965
+ let t = this._lexer.token, n;
966
+ if (this.expectOptionalToken(o.BRACKET_L)) {
967
+ let i = this.parseTypeReference();
968
+ this.expectToken(o.BRACKET_R), n = this.node(t, { kind: c.LIST_TYPE, type: i });
969
+ } else n = this.parseNamedType();
970
+ return this.expectOptionalToken(o.BANG) ? this.node(t, { kind: c.NON_NULL_TYPE, type: n }) : n;
971
+ }
972
+ parseNamedType() {
973
+ return this.node(this._lexer.token, { kind: c.NAMED_TYPE, name: this.parseName() });
974
+ }
975
+ peekDescription() {
976
+ return this.peek(o.STRING) || this.peek(o.BLOCK_STRING);
977
+ }
978
+ parseDescription() {
979
+ if (this.peekDescription()) return this.parseStringLiteral();
980
+ }
981
+ parseSchemaDefinition() {
982
+ let t = this._lexer.token, n = this.parseDescription();
983
+ this.expectKeyword("schema");
984
+ let i = this.parseConstDirectives(), r = this.many(o.BRACE_L, this.parseOperationTypeDefinition, o.BRACE_R);
985
+ return this.node(t, { kind: c.SCHEMA_DEFINITION, description: n, directives: i, operationTypes: r });
986
+ }
987
+ parseOperationTypeDefinition() {
988
+ let t = this._lexer.token, n = this.parseOperationType();
989
+ this.expectToken(o.COLON);
990
+ let i = this.parseNamedType();
991
+ return this.node(t, { kind: c.OPERATION_TYPE_DEFINITION, operation: n, type: i });
992
+ }
993
+ parseScalarTypeDefinition() {
994
+ let t = this._lexer.token, n = this.parseDescription();
995
+ this.expectKeyword("scalar");
996
+ let i = this.parseName(), r = this.parseConstDirectives();
997
+ return this.node(t, { kind: c.SCALAR_TYPE_DEFINITION, description: n, name: i, directives: r });
998
+ }
999
+ parseObjectTypeDefinition() {
1000
+ let t = this._lexer.token, n = this.parseDescription();
1001
+ this.expectKeyword("type");
1002
+ let i = this.parseName(), r = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), a = this.parseFieldsDefinition();
1003
+ return this.node(t, { kind: c.OBJECT_TYPE_DEFINITION, description: n, name: i, interfaces: r, directives: s, fields: a });
1004
+ }
1005
+ parseImplementsInterfaces() {
1006
+ return this.expectOptionalKeyword("implements") ? this.delimitedMany(o.AMP, this.parseNamedType) : [];
1007
+ }
1008
+ parseFieldsDefinition() {
1009
+ return this.optionalMany(o.BRACE_L, this.parseFieldDefinition, o.BRACE_R);
1010
+ }
1011
+ parseFieldDefinition() {
1012
+ let t = this._lexer.token, n = this.parseDescription(), i = this.parseName(), r = this.parseArgumentDefs();
1013
+ this.expectToken(o.COLON);
1014
+ let s = this.parseTypeReference(), a = this.parseConstDirectives();
1015
+ return this.node(t, { kind: c.FIELD_DEFINITION, description: n, name: i, arguments: r, type: s, directives: a });
1016
+ }
1017
+ parseArgumentDefs() {
1018
+ return this.optionalMany(o.PAREN_L, this.parseInputValueDef, o.PAREN_R);
1019
+ }
1020
+ parseInputValueDef() {
1021
+ let t = this._lexer.token, n = this.parseDescription(), i = this.parseName();
1022
+ this.expectToken(o.COLON);
1023
+ let r = this.parseTypeReference(), s;
1024
+ this.expectOptionalToken(o.EQUALS) && (s = this.parseConstValueLiteral());
1025
+ let a = this.parseConstDirectives();
1026
+ return this.node(t, { kind: c.INPUT_VALUE_DEFINITION, description: n, name: i, type: r, defaultValue: s, directives: a });
1027
+ }
1028
+ parseInterfaceTypeDefinition() {
1029
+ let t = this._lexer.token, n = this.parseDescription();
1030
+ this.expectKeyword("interface");
1031
+ let i = this.parseName(), r = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), a = this.parseFieldsDefinition();
1032
+ return this.node(t, { kind: c.INTERFACE_TYPE_DEFINITION, description: n, name: i, interfaces: r, directives: s, fields: a });
1033
+ }
1034
+ parseUnionTypeDefinition() {
1035
+ let t = this._lexer.token, n = this.parseDescription();
1036
+ this.expectKeyword("union");
1037
+ let i = this.parseName(), r = this.parseConstDirectives(), s = this.parseUnionMemberTypes();
1038
+ return this.node(t, { kind: c.UNION_TYPE_DEFINITION, description: n, name: i, directives: r, types: s });
1039
+ }
1040
+ parseUnionMemberTypes() {
1041
+ return this.expectOptionalToken(o.EQUALS) ? this.delimitedMany(o.PIPE, this.parseNamedType) : [];
1042
+ }
1043
+ parseEnumTypeDefinition() {
1044
+ let t = this._lexer.token, n = this.parseDescription();
1045
+ this.expectKeyword("enum");
1046
+ let i = this.parseName(), r = this.parseConstDirectives(), s = this.parseEnumValuesDefinition();
1047
+ return this.node(t, { kind: c.ENUM_TYPE_DEFINITION, description: n, name: i, directives: r, values: s });
1048
+ }
1049
+ parseEnumValuesDefinition() {
1050
+ return this.optionalMany(o.BRACE_L, this.parseEnumValueDefinition, o.BRACE_R);
1051
+ }
1052
+ parseEnumValueDefinition() {
1053
+ let t = this._lexer.token, n = this.parseDescription(), i = this.parseEnumValueName(), r = this.parseConstDirectives();
1054
+ return this.node(t, { kind: c.ENUM_VALUE_DEFINITION, description: n, name: i, directives: r });
1055
+ }
1056
+ parseEnumValueName() {
1057
+ if (this._lexer.token.value === "true" || this._lexer.token.value === "false" || this._lexer.token.value === "null") throw h(this._lexer.source, this._lexer.token.start, `${ne(this._lexer.token)} is reserved and cannot be used for an enum value.`);
1058
+ return this.parseName();
1059
+ }
1060
+ parseInputObjectTypeDefinition() {
1061
+ let t = this._lexer.token, n = this.parseDescription();
1062
+ this.expectKeyword("input");
1063
+ let i = this.parseName(), r = this.parseConstDirectives(), s = this.parseInputFieldsDefinition();
1064
+ return this.node(t, { kind: c.INPUT_OBJECT_TYPE_DEFINITION, description: n, name: i, directives: r, fields: s });
1065
+ }
1066
+ parseInputFieldsDefinition() {
1067
+ return this.optionalMany(o.BRACE_L, this.parseInputValueDef, o.BRACE_R);
1068
+ }
1069
+ parseTypeSystemExtension() {
1070
+ let t = this._lexer.lookahead();
1071
+ if (t.kind === o.NAME) switch (t.value) {
1072
+ case "schema":
1073
+ return this.parseSchemaExtension();
1074
+ case "scalar":
1075
+ return this.parseScalarTypeExtension();
1076
+ case "type":
1077
+ return this.parseObjectTypeExtension();
1078
+ case "interface":
1079
+ return this.parseInterfaceTypeExtension();
1080
+ case "union":
1081
+ return this.parseUnionTypeExtension();
1082
+ case "enum":
1083
+ return this.parseEnumTypeExtension();
1084
+ case "input":
1085
+ return this.parseInputObjectTypeExtension();
1086
+ }
1087
+ throw this.unexpected(t);
1088
+ }
1089
+ parseSchemaExtension() {
1090
+ let t = this._lexer.token;
1091
+ this.expectKeyword("extend"), this.expectKeyword("schema");
1092
+ let n = this.parseConstDirectives(), i = this.optionalMany(o.BRACE_L, this.parseOperationTypeDefinition, o.BRACE_R);
1093
+ if (n.length === 0 && i.length === 0) throw this.unexpected();
1094
+ return this.node(t, { kind: c.SCHEMA_EXTENSION, directives: n, operationTypes: i });
1095
+ }
1096
+ parseScalarTypeExtension() {
1097
+ let t = this._lexer.token;
1098
+ this.expectKeyword("extend"), this.expectKeyword("scalar");
1099
+ let n = this.parseName(), i = this.parseConstDirectives();
1100
+ if (i.length === 0) throw this.unexpected();
1101
+ return this.node(t, { kind: c.SCALAR_TYPE_EXTENSION, name: n, directives: i });
1102
+ }
1103
+ parseObjectTypeExtension() {
1104
+ let t = this._lexer.token;
1105
+ this.expectKeyword("extend"), this.expectKeyword("type");
1106
+ let n = this.parseName(), i = this.parseImplementsInterfaces(), r = this.parseConstDirectives(), s = this.parseFieldsDefinition();
1107
+ if (i.length === 0 && r.length === 0 && s.length === 0) throw this.unexpected();
1108
+ return this.node(t, { kind: c.OBJECT_TYPE_EXTENSION, name: n, interfaces: i, directives: r, fields: s });
1109
+ }
1110
+ parseInterfaceTypeExtension() {
1111
+ let t = this._lexer.token;
1112
+ this.expectKeyword("extend"), this.expectKeyword("interface");
1113
+ let n = this.parseName(), i = this.parseImplementsInterfaces(), r = this.parseConstDirectives(), s = this.parseFieldsDefinition();
1114
+ if (i.length === 0 && r.length === 0 && s.length === 0) throw this.unexpected();
1115
+ return this.node(t, { kind: c.INTERFACE_TYPE_EXTENSION, name: n, interfaces: i, directives: r, fields: s });
1116
+ }
1117
+ parseUnionTypeExtension() {
1118
+ let t = this._lexer.token;
1119
+ this.expectKeyword("extend"), this.expectKeyword("union");
1120
+ let n = this.parseName(), i = this.parseConstDirectives(), r = this.parseUnionMemberTypes();
1121
+ if (i.length === 0 && r.length === 0) throw this.unexpected();
1122
+ return this.node(t, { kind: c.UNION_TYPE_EXTENSION, name: n, directives: i, types: r });
1123
+ }
1124
+ parseEnumTypeExtension() {
1125
+ let t = this._lexer.token;
1126
+ this.expectKeyword("extend"), this.expectKeyword("enum");
1127
+ let n = this.parseName(), i = this.parseConstDirectives(), r = this.parseEnumValuesDefinition();
1128
+ if (i.length === 0 && r.length === 0) throw this.unexpected();
1129
+ return this.node(t, { kind: c.ENUM_TYPE_EXTENSION, name: n, directives: i, values: r });
1130
+ }
1131
+ parseInputObjectTypeExtension() {
1132
+ let t = this._lexer.token;
1133
+ this.expectKeyword("extend"), this.expectKeyword("input");
1134
+ let n = this.parseName(), i = this.parseConstDirectives(), r = this.parseInputFieldsDefinition();
1135
+ if (i.length === 0 && r.length === 0) throw this.unexpected();
1136
+ return this.node(t, { kind: c.INPUT_OBJECT_TYPE_EXTENSION, name: n, directives: i, fields: r });
1137
+ }
1138
+ parseDirectiveDefinition() {
1139
+ let t = this._lexer.token, n = this.parseDescription();
1140
+ this.expectKeyword("directive"), this.expectToken(o.AT);
1141
+ let i = this.parseName(), r = this.parseArgumentDefs(), s = this.expectOptionalKeyword("repeatable");
1142
+ this.expectKeyword("on");
1143
+ let a = this.parseDirectiveLocations();
1144
+ return this.node(t, { kind: c.DIRECTIVE_DEFINITION, description: n, name: i, arguments: r, repeatable: s, locations: a });
1145
+ }
1146
+ parseDirectiveLocations() {
1147
+ return this.delimitedMany(o.PIPE, this.parseDirectiveLocation);
1148
+ }
1149
+ parseDirectiveLocation() {
1150
+ let t = this._lexer.token, n = this.parseName();
1151
+ if (Object.prototype.hasOwnProperty.call(W, n.value)) return n;
1152
+ throw this.unexpected(t);
1153
+ }
1154
+ parseSchemaCoordinate() {
1155
+ let t = this._lexer.token, n = this.expectOptionalToken(o.AT), i = this.parseName(), r;
1156
+ !n && this.expectOptionalToken(o.DOT) && (r = this.parseName());
1157
+ let s;
1158
+ return (n || r) && this.expectOptionalToken(o.PAREN_L) && (s = this.parseName(), this.expectToken(o.COLON), this.expectToken(o.PAREN_R)), n ? s ? this.node(t, { kind: c.DIRECTIVE_ARGUMENT_COORDINATE, name: i, argumentName: s }) : this.node(t, { kind: c.DIRECTIVE_COORDINATE, name: i }) : r ? s ? this.node(t, { kind: c.ARGUMENT_COORDINATE, name: i, fieldName: r, argumentName: s }) : this.node(t, { kind: c.MEMBER_COORDINATE, name: i, memberName: r }) : this.node(t, { kind: c.TYPE_COORDINATE, name: i });
1159
+ }
1160
+ node(t, n) {
1161
+ return this._options.noLocation !== true && (n.loc = new H(t, this._lexer.lastToken, this._lexer.source)), n;
1162
+ }
1163
+ peek(t) {
1164
+ return this._lexer.token.kind === t;
1165
+ }
1166
+ expectToken(t) {
1167
+ let n = this._lexer.token;
1168
+ if (n.kind === t) return this.advanceLexer(), n;
1169
+ throw h(this._lexer.source, n.start, `Expected ${at(t)}, found ${ne(n)}.`);
1170
+ }
1171
+ expectOptionalToken(t) {
1172
+ return this._lexer.token.kind === t ? (this.advanceLexer(), true) : false;
1173
+ }
1174
+ expectKeyword(t) {
1175
+ let n = this._lexer.token;
1176
+ if (n.kind === o.NAME && n.value === t) this.advanceLexer();
1177
+ else throw h(this._lexer.source, n.start, `Expected "${t}", found ${ne(n)}.`);
1178
+ }
1179
+ expectOptionalKeyword(t) {
1180
+ let n = this._lexer.token;
1181
+ return n.kind === o.NAME && n.value === t ? (this.advanceLexer(), true) : false;
1182
+ }
1183
+ unexpected(t) {
1184
+ let n = t ?? this._lexer.token;
1185
+ return h(this._lexer.source, n.start, `Unexpected ${ne(n)}.`);
1186
+ }
1187
+ any(t, n, i) {
1188
+ this.expectToken(t);
1189
+ let r = [];
1190
+ for (; !this.expectOptionalToken(i); ) r.push(n.call(this));
1191
+ return r;
1192
+ }
1193
+ optionalMany(t, n, i) {
1194
+ if (this.expectOptionalToken(t)) {
1195
+ let r = [];
1196
+ do
1197
+ r.push(n.call(this));
1198
+ while (!this.expectOptionalToken(i));
1199
+ return r;
1200
+ }
1201
+ return [];
1202
+ }
1203
+ many(t, n, i) {
1204
+ this.expectToken(t);
1205
+ let r = [];
1206
+ do
1207
+ r.push(n.call(this));
1208
+ while (!this.expectOptionalToken(i));
1209
+ return r;
1210
+ }
1211
+ delimitedMany(t, n) {
1212
+ this.expectOptionalToken(t);
1213
+ let i = [];
1214
+ do
1215
+ i.push(n.call(this));
1216
+ while (this.expectOptionalToken(t));
1217
+ return i;
1218
+ }
1219
+ advanceLexer() {
1220
+ let { maxTokens: t } = this._options, n = this._lexer.advance();
1221
+ if (n.kind !== o.EOF && (++this._tokenCounter, t !== void 0 && this._tokenCounter > t)) throw h(this._lexer.source, n.start, `Document contains more that ${t} tokens. Parsing aborted.`);
1222
+ }
1223
+ };
1224
+ function ne(e2) {
1225
+ let t = e2.value;
1226
+ return at(e2.kind) + (t != null ? ` "${t}"` : "");
1227
+ }
1228
+ function at(e2) {
1229
+ return tt(e2) ? `"${e2}"` : e2;
1230
+ }
1231
+ function Wt(e2, t) {
1232
+ let n = new SyntaxError(e2 + " (" + t.loc.start.line + ":" + t.loc.start.column + ")");
1233
+ return Object.assign(n, t);
1234
+ }
1235
+ var ct = Wt;
1236
+ function zt(e2) {
1237
+ let t = [], { startToken: n, endToken: i } = e2.loc;
1238
+ for (let r = n; r !== i; r = r.next) r.kind === "Comment" && t.push({ ...r, loc: { start: r.start, end: r.end } });
1239
+ return t;
1240
+ }
1241
+ var Kt = { allowLegacyFragmentVariables: true };
1242
+ function Zt(e2) {
1243
+ if (e2?.name === "GraphQLError") {
1244
+ let { message: t, locations: [n] } = e2;
1245
+ return ct(t, { loc: { start: n }, cause: e2 });
1246
+ }
1247
+ return e2;
1248
+ }
1249
+ function en(e2) {
1250
+ let t;
1251
+ try {
1252
+ t = ot(e2, Kt);
1253
+ } catch (n) {
1254
+ throw Zt(n);
1255
+ }
1256
+ return t.comments = zt(t), t;
1257
+ }
1258
+ var tn = { parse: en, astFormat: "graphql", hasPragma: Fe, hasIgnorePragma: Me, locStart: J, locEnd: q };
1259
+ var nn = { graphql: Ge };
1260
+ export {
1261
+ ut as default,
1262
+ Ye as languages,
1263
+ $e as options,
1264
+ he as parsers,
1265
+ nn as printers
1266
+ };
1267
+ //# sourceMappingURL=graphql-TFOZJU7B.js.map