@kubb/core 3.0.0-alpha.14 → 3.0.0-alpha.16

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