@builtbystack/sq-shopify-theme-sdk 0.0.32 → 0.0.34

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.
@@ -1,7 +1,7 @@
1
- var He = Object.defineProperty;
2
- var Ye = (e, t, n) => t in e ? He(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var ve = (e, t, n) => (Ye(e, typeof t != "symbol" ? t + "" : t, n), n);
4
- function ze(e, t) {
1
+ var Je = Object.defineProperty;
2
+ var Xe = (e, t, n) => t in e ? Je(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var Se = (e, t, n) => Xe(e, typeof t != "symbol" ? t + "" : t, n);
4
+ function Ke(e, t) {
5
5
  for (var n = 0; n < t.length; n++) {
6
6
  const r = t[n];
7
7
  if (typeof r != "string" && !Array.isArray(r)) {
@@ -17,34 +17,44 @@ function ze(e, t) {
17
17
  }
18
18
  return Object.freeze(Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }));
19
19
  }
20
- var ne = function() {
21
- return ne = Object.assign || function(t) {
22
- for (var n, r = 1, i = arguments.length; r < i; r++) {
23
- n = arguments[r];
24
- for (var s in n)
25
- Object.prototype.hasOwnProperty.call(n, s) && (t[s] = n[s]);
26
- }
27
- return t;
28
- }, ne.apply(this, arguments);
20
+ const Ae = JSON, Ze = (e) => e.toUpperCase(), We = (e) => {
21
+ const t = {};
22
+ return e.forEach((n, r) => {
23
+ t[r] = n;
24
+ }), t;
25
+ }, et = (e, t, n) => e.document ? e : {
26
+ document: e,
27
+ variables: t,
28
+ requestHeaders: n,
29
+ signal: void 0
30
+ }, tt = (e, t, n) => e.query ? e : {
31
+ query: e,
32
+ variables: t,
33
+ requestHeaders: n,
34
+ signal: void 0
35
+ }, nt = (e, t) => e.documents ? e : {
36
+ documents: e,
37
+ requestHeaders: t,
38
+ signal: void 0
29
39
  };
30
- function Z(e, t) {
40
+ function ee(e, t) {
31
41
  if (!!!e)
32
42
  throw new Error(t);
33
43
  }
34
- function Je(e) {
44
+ function it(e) {
35
45
  return typeof e == "object" && e !== null;
36
46
  }
37
- function Qe(e, t) {
47
+ function rt(e, t) {
38
48
  if (!!!e)
39
49
  throw new Error(
40
- t ?? "Unexpected invariant triggered."
50
+ "Unexpected invariant triggered."
41
51
  );
42
52
  }
43
- const Xe = /\r\n|[\n\r]/g;
44
- function he(e, t) {
53
+ const st = /\r\n|[\n\r]/g;
54
+ function ge(e, t) {
45
55
  let n = 0, r = 1;
46
- for (const i of e.body.matchAll(Xe)) {
47
- if (typeof i.index == "number" || Qe(!1), i.index >= t)
56
+ for (const i of e.body.matchAll(st)) {
57
+ if (typeof i.index == "number" || rt(!1), i.index >= t)
48
58
  break;
49
59
  n = i.index + i[0].length, r += 1;
50
60
  }
@@ -53,40 +63,40 @@ function he(e, t) {
53
63
  column: t + 1 - n
54
64
  };
55
65
  }
56
- function Ke(e) {
57
- return Pe(
66
+ function at(e) {
67
+ return ke(
58
68
  e.source,
59
- he(e.source, e.start)
69
+ ge(e.source, e.start)
60
70
  );
61
71
  }
62
- function Pe(e, t) {
63
- const n = e.locationOffset.column - 1, r = "".padStart(n) + e.body, i = t.line - 1, s = e.locationOffset.line - 1, a = t.line + s, c = t.line === 1 ? n : 0, p = t.column + c, h = `${e.name}:${a}:${p}
64
- `, f = r.split(/\r\n|[\n\r]/g), C = f[i];
65
- if (C.length > 120) {
66
- const y = Math.floor(p / 80), I = p % 80, g = [];
67
- for (let T = 0; T < C.length; T += 80)
68
- g.push(C.slice(T, T + 80));
69
- return h + Ie([
70
- [`${a} |`, g[0]],
71
- ...g.slice(1, y + 1).map((T) => ["|", T]),
72
- ["|", "^".padStart(I)],
73
- ["|", g[y + 1]]
72
+ function ke(e, t) {
73
+ const n = e.locationOffset.column - 1, r = "".padStart(n) + e.body, i = t.line - 1, s = e.locationOffset.line - 1, a = t.line + s, c = t.line === 1 ? n : 0, l = t.column + c, m = `${e.name}:${a}:${l}
74
+ `, f = r.split(/\r\n|[\n\r]/g), A = f[i];
75
+ if (A.length > 120) {
76
+ const C = Math.floor(l / 80), R = l % 80, I = [];
77
+ for (let y = 0; y < A.length; y += 80)
78
+ I.push(A.slice(y, y + 80));
79
+ return m + Re([
80
+ [`${a} |`, I[0]],
81
+ ...I.slice(1, C + 1).map((y) => ["|", y]),
82
+ ["|", "^".padStart(R)],
83
+ ["|", I[C + 1]]
74
84
  ]);
75
85
  }
76
- return h + Ie([
86
+ return m + Re([
77
87
  // Lines specified like this: ["prefix", "string"],
78
88
  [`${a - 1} |`, f[i - 1]],
79
- [`${a} |`, C],
80
- ["|", "^".padStart(p)],
89
+ [`${a} |`, A],
90
+ ["|", "^".padStart(l)],
81
91
  [`${a + 1} |`, f[i + 1]]
82
92
  ]);
83
93
  }
84
- function Ie(e) {
94
+ function Re(e) {
85
95
  const t = e.filter(([r, i]) => i !== void 0), n = Math.max(...t.map(([r]) => r.length));
86
96
  return t.map(([r, i]) => r.padStart(n) + (i ? " " + i : "")).join(`
87
97
  `);
88
98
  }
89
- function Ze(e) {
99
+ function ot(e) {
90
100
  const t = e[0];
91
101
  return t == null || "kind" in t || "length" in t ? {
92
102
  nodes: t,
@@ -97,7 +107,7 @@ function Ze(e) {
97
107
  extensions: e[5]
98
108
  } : t;
99
109
  }
100
- class ye extends Error {
110
+ class ve extends Error {
101
111
  /**
102
112
  * An array of `{ line, column }` locations within the source GraphQL document
103
113
  * which correspond to this error.
@@ -138,18 +148,18 @@ class ye extends Error {
138
148
  */
139
149
  constructor(t, ...n) {
140
150
  var r, i, s;
141
- const { nodes: a, source: c, positions: p, path: h, originalError: f, extensions: C } = Ze(n);
142
- super(t), this.name = "GraphQLError", this.path = h ?? void 0, this.originalError = f ?? void 0, this.nodes = Te(
151
+ const { nodes: a, source: c, positions: l, path: m, originalError: f, extensions: A } = ot(n);
152
+ super(t), this.name = "GraphQLError", this.path = m ?? void 0, this.originalError = f ?? void 0, this.nodes = Oe(
143
153
  Array.isArray(a) ? a : a ? [a] : void 0
144
154
  );
145
- const y = Te(
146
- (r = this.nodes) === null || r === void 0 ? void 0 : r.map((g) => g.loc).filter((g) => g != null)
155
+ const C = Oe(
156
+ (r = this.nodes) === null || r === void 0 ? void 0 : r.map((I) => I.loc).filter((I) => I != null)
147
157
  );
148
- this.source = c ?? (y == null || (i = y[0]) === null || i === void 0 ? void 0 : i.source), this.positions = p ?? (y == null ? void 0 : y.map((g) => g.start)), this.locations = p && c ? p.map((g) => he(c, g)) : y == null ? void 0 : y.map((g) => he(g.source, g.start));
149
- const I = Je(
158
+ this.source = c ?? (C == null || (i = C[0]) === null || i === void 0 ? void 0 : i.source), this.positions = l ?? (C == null ? void 0 : C.map((I) => I.start)), this.locations = l && c ? l.map((I) => ge(c, I)) : C == null ? void 0 : C.map((I) => ge(I.source, I.start));
159
+ const R = it(
150
160
  f == null ? void 0 : f.extensions
151
161
  ) ? f == null ? void 0 : f.extensions : void 0;
152
- this.extensions = (s = C ?? I) !== null && s !== void 0 ? s : /* @__PURE__ */ Object.create(null), Object.defineProperties(this, {
162
+ this.extensions = (s = A ?? R) !== null && s !== void 0 ? s : /* @__PURE__ */ Object.create(null), Object.defineProperties(this, {
153
163
  message: {
154
164
  writable: !0,
155
165
  enumerable: !0
@@ -173,7 +183,7 @@ class ye extends Error {
173
183
  value: f.stack,
174
184
  writable: !0,
175
185
  configurable: !0
176
- }) : Error.captureStackTrace ? Error.captureStackTrace(this, ye) : Object.defineProperty(this, "stack", {
186
+ }) : Error.captureStackTrace ? Error.captureStackTrace(this, ve) : Object.defineProperty(this, "stack", {
177
187
  value: Error().stack,
178
188
  writable: !0,
179
189
  configurable: !0
@@ -188,12 +198,12 @@ class ye extends Error {
188
198
  for (const n of this.nodes)
189
199
  n.loc && (t += `
190
200
 
191
- ` + Ke(n.loc));
201
+ ` + at(n.loc));
192
202
  else if (this.source && this.locations)
193
203
  for (const n of this.locations)
194
204
  t += `
195
205
 
196
- ` + Pe(this.source, n);
206
+ ` + ke(this.source, n);
197
207
  return t;
198
208
  }
199
209
  toJSON() {
@@ -203,16 +213,16 @@ class ye extends Error {
203
213
  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;
204
214
  }
205
215
  }
206
- function Te(e) {
216
+ function Oe(e) {
207
217
  return e === void 0 || e.length === 0 ? void 0 : e;
208
218
  }
209
- function R(e, t, n) {
210
- return new ye(`Syntax Error: ${n}`, {
219
+ function P(e, t, n) {
220
+ return new ve(`Syntax Error: ${n}`, {
211
221
  source: e,
212
222
  positions: [t]
213
223
  });
214
224
  }
215
- class We {
225
+ class ut {
216
226
  /**
217
227
  * The character offset at which this Node begins.
218
228
  */
@@ -241,7 +251,7 @@ class We {
241
251
  };
242
252
  }
243
253
  }
244
- class De {
254
+ class _e {
245
255
  /**
246
256
  * The kind of Token.
247
257
  */
@@ -283,16 +293,23 @@ class De {
283
293
  };
284
294
  }
285
295
  }
286
- const be = {
296
+ const Le = {
287
297
  Name: [],
288
298
  Document: ["definitions"],
289
299
  OperationDefinition: [
300
+ "description",
290
301
  "name",
291
302
  "variableDefinitions",
292
303
  "directives",
293
304
  "selectionSet"
294
305
  ],
295
- VariableDefinition: ["variable", "type", "defaultValue", "directives"],
306
+ VariableDefinition: [
307
+ "description",
308
+ "variable",
309
+ "type",
310
+ "defaultValue",
311
+ "directives"
312
+ ],
296
313
  Variable: ["name"],
297
314
  SelectionSet: ["selections"],
298
315
  Field: ["alias", "name", "arguments", "directives", "selectionSet"],
@@ -300,6 +317,7 @@ const be = {
300
317
  FragmentSpread: ["name", "directives"],
301
318
  InlineFragment: ["typeCondition", "directives", "selectionSet"],
302
319
  FragmentDefinition: [
320
+ "description",
303
321
  "name",
304
322
  // Note: fragment variable definitions are deprecated and will removed in v17.0.0
305
323
  "variableDefinitions",
@@ -356,73 +374,80 @@ const be = {
356
374
  InterfaceTypeExtension: ["name", "interfaces", "directives", "fields"],
357
375
  UnionTypeExtension: ["name", "directives", "types"],
358
376
  EnumTypeExtension: ["name", "directives", "values"],
359
- InputObjectTypeExtension: ["name", "directives", "fields"]
360
- }, et = new Set(Object.keys(be));
377
+ InputObjectTypeExtension: ["name", "directives", "fields"],
378
+ TypeCoordinate: ["name"],
379
+ MemberCoordinate: ["name", "memberName"],
380
+ ArgumentCoordinate: ["name", "fieldName", "argumentName"],
381
+ DirectiveCoordinate: ["name"],
382
+ DirectiveArgumentCoordinate: ["name", "argumentName"]
383
+ }, ct = new Set(Object.keys(Le));
361
384
  function xe(e) {
362
385
  const t = e == null ? void 0 : e.kind;
363
- return typeof t == "string" && et.has(t);
386
+ return typeof t == "string" && ct.has(t);
364
387
  }
365
- var q;
388
+ var V;
366
389
  (function(e) {
367
390
  e.QUERY = "query", e.MUTATION = "mutation", e.SUBSCRIPTION = "subscription";
368
- })(q || (q = {}));
369
- var me;
391
+ })(V || (V = {}));
392
+ var Ce;
370
393
  (function(e) {
371
394
  e.QUERY = "QUERY", e.MUTATION = "MUTATION", e.SUBSCRIPTION = "SUBSCRIPTION", e.FIELD = "FIELD", e.FRAGMENT_DEFINITION = "FRAGMENT_DEFINITION", e.FRAGMENT_SPREAD = "FRAGMENT_SPREAD", e.INLINE_FRAGMENT = "INLINE_FRAGMENT", e.VARIABLE_DEFINITION = "VARIABLE_DEFINITION", e.SCHEMA = "SCHEMA", e.SCALAR = "SCALAR", e.OBJECT = "OBJECT", e.FIELD_DEFINITION = "FIELD_DEFINITION", e.ARGUMENT_DEFINITION = "ARGUMENT_DEFINITION", e.INTERFACE = "INTERFACE", e.UNION = "UNION", e.ENUM = "ENUM", e.ENUM_VALUE = "ENUM_VALUE", e.INPUT_OBJECT = "INPUT_OBJECT", e.INPUT_FIELD_DEFINITION = "INPUT_FIELD_DEFINITION";
372
- })(me || (me = {}));
373
- var m;
395
+ })(Ce || (Ce = {}));
396
+ var p;
374
397
  (function(e) {
375
- e.NAME = "Name", e.DOCUMENT = "Document", e.OPERATION_DEFINITION = "OperationDefinition", e.VARIABLE_DEFINITION = "VariableDefinition", e.SELECTION_SET = "SelectionSet", e.FIELD = "Field", e.ARGUMENT = "Argument", e.FRAGMENT_SPREAD = "FragmentSpread", e.INLINE_FRAGMENT = "InlineFragment", e.FRAGMENT_DEFINITION = "FragmentDefinition", e.VARIABLE = "Variable", e.INT = "IntValue", e.FLOAT = "FloatValue", e.STRING = "StringValue", e.BOOLEAN = "BooleanValue", e.NULL = "NullValue", e.ENUM = "EnumValue", e.LIST = "ListValue", e.OBJECT = "ObjectValue", e.OBJECT_FIELD = "ObjectField", e.DIRECTIVE = "Directive", e.NAMED_TYPE = "NamedType", e.LIST_TYPE = "ListType", e.NON_NULL_TYPE = "NonNullType", e.SCHEMA_DEFINITION = "SchemaDefinition", e.OPERATION_TYPE_DEFINITION = "OperationTypeDefinition", e.SCALAR_TYPE_DEFINITION = "ScalarTypeDefinition", e.OBJECT_TYPE_DEFINITION = "ObjectTypeDefinition", e.FIELD_DEFINITION = "FieldDefinition", e.INPUT_VALUE_DEFINITION = "InputValueDefinition", e.INTERFACE_TYPE_DEFINITION = "InterfaceTypeDefinition", e.UNION_TYPE_DEFINITION = "UnionTypeDefinition", e.ENUM_TYPE_DEFINITION = "EnumTypeDefinition", e.ENUM_VALUE_DEFINITION = "EnumValueDefinition", e.INPUT_OBJECT_TYPE_DEFINITION = "InputObjectTypeDefinition", e.DIRECTIVE_DEFINITION = "DirectiveDefinition", e.SCHEMA_EXTENSION = "SchemaExtension", e.SCALAR_TYPE_EXTENSION = "ScalarTypeExtension", e.OBJECT_TYPE_EXTENSION = "ObjectTypeExtension", e.INTERFACE_TYPE_EXTENSION = "InterfaceTypeExtension", e.UNION_TYPE_EXTENSION = "UnionTypeExtension", e.ENUM_TYPE_EXTENSION = "EnumTypeExtension", e.INPUT_OBJECT_TYPE_EXTENSION = "InputObjectTypeExtension";
376
- })(m || (m = {}));
377
- function fe(e) {
398
+ e.NAME = "Name", e.DOCUMENT = "Document", e.OPERATION_DEFINITION = "OperationDefinition", e.VARIABLE_DEFINITION = "VariableDefinition", e.SELECTION_SET = "SelectionSet", e.FIELD = "Field", e.ARGUMENT = "Argument", e.FRAGMENT_SPREAD = "FragmentSpread", e.INLINE_FRAGMENT = "InlineFragment", e.FRAGMENT_DEFINITION = "FragmentDefinition", e.VARIABLE = "Variable", e.INT = "IntValue", e.FLOAT = "FloatValue", e.STRING = "StringValue", e.BOOLEAN = "BooleanValue", e.NULL = "NullValue", e.ENUM = "EnumValue", e.LIST = "ListValue", e.OBJECT = "ObjectValue", e.OBJECT_FIELD = "ObjectField", e.DIRECTIVE = "Directive", e.NAMED_TYPE = "NamedType", e.LIST_TYPE = "ListType", e.NON_NULL_TYPE = "NonNullType", e.SCHEMA_DEFINITION = "SchemaDefinition", e.OPERATION_TYPE_DEFINITION = "OperationTypeDefinition", e.SCALAR_TYPE_DEFINITION = "ScalarTypeDefinition", e.OBJECT_TYPE_DEFINITION = "ObjectTypeDefinition", e.FIELD_DEFINITION = "FieldDefinition", e.INPUT_VALUE_DEFINITION = "InputValueDefinition", e.INTERFACE_TYPE_DEFINITION = "InterfaceTypeDefinition", e.UNION_TYPE_DEFINITION = "UnionTypeDefinition", e.ENUM_TYPE_DEFINITION = "EnumTypeDefinition", e.ENUM_VALUE_DEFINITION = "EnumValueDefinition", e.INPUT_OBJECT_TYPE_DEFINITION = "InputObjectTypeDefinition", e.DIRECTIVE_DEFINITION = "DirectiveDefinition", e.SCHEMA_EXTENSION = "SchemaExtension", e.SCALAR_TYPE_EXTENSION = "ScalarTypeExtension", e.OBJECT_TYPE_EXTENSION = "ObjectTypeExtension", e.INTERFACE_TYPE_EXTENSION = "InterfaceTypeExtension", e.UNION_TYPE_EXTENSION = "UnionTypeExtension", e.ENUM_TYPE_EXTENSION = "EnumTypeExtension", e.INPUT_OBJECT_TYPE_EXTENSION = "InputObjectTypeExtension", e.TYPE_COORDINATE = "TypeCoordinate", e.MEMBER_COORDINATE = "MemberCoordinate", e.ARGUMENT_COORDINATE = "ArgumentCoordinate", e.DIRECTIVE_COORDINATE = "DirectiveCoordinate", e.DIRECTIVE_ARGUMENT_COORDINATE = "DirectiveArgumentCoordinate";
399
+ })(p || (p = {}));
400
+ function ye(e) {
378
401
  return e === 9 || e === 32;
379
402
  }
380
- function Y(e) {
403
+ function z(e) {
381
404
  return e >= 48 && e <= 57;
382
405
  }
383
- function ke(e) {
406
+ function we(e) {
384
407
  return e >= 97 && e <= 122 || // A-Z
385
408
  e >= 65 && e <= 90;
386
409
  }
387
- function _e(e) {
388
- return ke(e) || e === 95;
410
+ function Me(e) {
411
+ return we(e) || e === 95;
389
412
  }
390
- function tt(e) {
391
- return ke(e) || Y(e) || e === 95;
413
+ function dt(e) {
414
+ return we(e) || z(e) || e === 95;
392
415
  }
393
- function nt(e) {
416
+ function lt(e) {
394
417
  var t;
395
418
  let n = Number.MAX_SAFE_INTEGER, r = null, i = -1;
396
419
  for (let a = 0; a < e.length; ++a) {
397
420
  var s;
398
- const c = e[a], p = it(c);
399
- p !== c.length && (r = (s = r) !== null && s !== void 0 ? s : a, i = a, a !== 0 && p < n && (n = p));
421
+ const c = e[a], l = ht(c);
422
+ l !== c.length && (r = (s = r) !== null && s !== void 0 ? s : a, i = a, a !== 0 && l < n && (n = l));
400
423
  }
401
424
  return e.map((a, c) => c === 0 ? a : a.slice(n)).slice(
402
425
  (t = r) !== null && t !== void 0 ? t : 0,
403
426
  i + 1
404
427
  );
405
428
  }
406
- function it(e) {
429
+ function ht(e) {
407
430
  let t = 0;
408
- for (; t < e.length && fe(e.charCodeAt(t)); )
431
+ for (; t < e.length && ye(e.charCodeAt(t)); )
409
432
  ++t;
410
433
  return t;
411
434
  }
412
- function rt(e, t) {
413
- const n = e.replace(/"""/g, '\\"""'), r = n.split(/\r\n|[\n\r]/g), i = r.length === 1, s = r.length > 1 && r.slice(1).every((I) => I.length === 0 || fe(I.charCodeAt(0))), a = n.endsWith('\\"""'), c = e.endsWith('"') && !a, p = e.endsWith("\\"), h = c || p, f = !(t != null && t.minimize) && // add leading and trailing new lines only if it improves readability
414
- (!i || e.length > 70 || h || s || a);
415
- let C = "";
416
- const y = i && fe(e.charCodeAt(0));
417
- return (f && !y || s) && (C += `
418
- `), C += n, (f || h) && (C += `
419
- `), '"""' + C + '"""';
435
+ function pt(e, t) {
436
+ const n = e.replace(/"""/g, '\\"""'), r = n.split(/\r\n|[\n\r]/g), i = r.length === 1, s = r.length > 1 && r.slice(1).every((R) => R.length === 0 || ye(R.charCodeAt(0))), a = n.endsWith('\\"""'), c = e.endsWith('"') && !a, l = e.endsWith("\\"), m = c || l, f = (
437
+ // add leading and trailing new lines only if it improves readability
438
+ !i || e.length > 70 || m || s || a
439
+ );
440
+ let A = "";
441
+ const C = i && ye(e.charCodeAt(0));
442
+ return (f && !C || s) && (A += `
443
+ `), A += n, (f || m) && (A += `
444
+ `), '"""' + A + '"""';
420
445
  }
421
446
  var u;
422
447
  (function(e) {
423
- e.SOF = "<SOF>", e.EOF = "<EOF>", e.BANG = "!", e.DOLLAR = "$", e.AMP = "&", e.PAREN_L = "(", e.PAREN_R = ")", e.SPREAD = "...", e.COLON = ":", e.EQUALS = "=", e.AT = "@", e.BRACKET_L = "[", e.BRACKET_R = "]", e.BRACE_L = "{", e.PIPE = "|", e.BRACE_R = "}", e.NAME = "Name", e.INT = "Int", e.FLOAT = "Float", e.STRING = "String", e.BLOCK_STRING = "BlockString", e.COMMENT = "Comment";
448
+ e.SOF = "<SOF>", e.EOF = "<EOF>", e.BANG = "!", e.DOLLAR = "$", e.AMP = "&", e.PAREN_L = "(", e.PAREN_R = ")", e.DOT = ".", e.SPREAD = "...", e.COLON = ":", e.EQUALS = "=", e.AT = "@", e.BRACKET_L = "[", e.BRACKET_R = "]", e.BRACE_L = "{", e.PIPE = "|", e.BRACE_R = "}", e.NAME = "Name", e.INT = "Int", e.FLOAT = "Float", e.STRING = "String", e.BLOCK_STRING = "BlockString", e.COMMENT = "Comment";
424
449
  })(u || (u = {}));
425
- class st {
450
+ class mt {
426
451
  /**
427
452
  * The previously focused non-ignored token.
428
453
  */
@@ -436,7 +461,7 @@ class st {
436
461
  * The character offset at which the current line begins.
437
462
  */
438
463
  constructor(t) {
439
- const n = new De(u.SOF, 0, 0, 0, 0);
464
+ const n = new _e(u.SOF, 0, 0, 0, 0);
440
465
  this.source = t, this.lastToken = n, this.token = n, this.line = 1, this.lineStart = 0;
441
466
  }
442
467
  get [Symbol.toStringTag]() {
@@ -459,29 +484,29 @@ class st {
459
484
  if (t.next)
460
485
  t = t.next;
461
486
  else {
462
- const n = ot(this, t.end);
487
+ const n = gt(this, t.end);
463
488
  t.next = n, n.prev = t, t = n;
464
489
  }
465
490
  while (t.kind === u.COMMENT);
466
491
  return t;
467
492
  }
468
493
  }
469
- function at(e) {
470
- return e === u.BANG || e === u.DOLLAR || e === u.AMP || e === u.PAREN_L || e === u.PAREN_R || e === u.SPREAD || e === u.COLON || e === u.EQUALS || e === u.AT || e === u.BRACKET_L || e === u.BRACKET_R || e === u.BRACE_L || e === u.PIPE || e === u.BRACE_R;
494
+ function ft(e) {
495
+ return e === u.BANG || e === u.DOLLAR || e === u.AMP || e === u.PAREN_L || e === u.PAREN_R || e === u.DOT || e === u.SPREAD || e === u.COLON || e === u.EQUALS || e === u.AT || e === u.BRACKET_L || e === u.BRACKET_R || e === u.BRACE_L || e === u.PIPE || e === u.BRACE_R;
471
496
  }
472
497
  function G(e) {
473
498
  return e >= 0 && e <= 55295 || e >= 57344 && e <= 1114111;
474
499
  }
475
- function se(e, t) {
476
- return Le(e.charCodeAt(t)) && we(e.charCodeAt(t + 1));
500
+ function oe(e, t) {
501
+ return qe(e.charCodeAt(t)) && Be(e.charCodeAt(t + 1));
477
502
  }
478
- function Le(e) {
503
+ function qe(e) {
479
504
  return e >= 55296 && e <= 56319;
480
505
  }
481
- function we(e) {
506
+ function Be(e) {
482
507
  return e >= 56320 && e <= 57343;
483
508
  }
484
- function F(e, t) {
509
+ function B(e, t) {
485
510
  const n = e.source.body.codePointAt(t);
486
511
  if (n === void 0)
487
512
  return u.EOF;
@@ -491,76 +516,107 @@ function F(e, t) {
491
516
  }
492
517
  return "U+" + n.toString(16).toUpperCase().padStart(4, "0");
493
518
  }
494
- function S(e, t, n, r, i) {
519
+ function x(e, t, n, r, i) {
495
520
  const s = e.line, a = 1 + n - e.lineStart;
496
- return new De(t, n, r, s, a, i);
521
+ return new _e(t, n, r, s, a, i);
497
522
  }
498
- function ot(e, t) {
523
+ function gt(e, t) {
499
524
  const n = e.source.body, r = n.length;
500
525
  let i = t;
501
526
  for (; i < r; ) {
502
527
  const s = n.charCodeAt(i);
503
528
  switch (s) {
529
+ // Ignored ::
530
+ // - UnicodeBOM
531
+ // - WhiteSpace
532
+ // - LineTerminator
533
+ // - Comment
534
+ // - Comma
535
+ //
536
+ // UnicodeBOM :: "Byte Order Mark (U+FEFF)"
537
+ //
538
+ // WhiteSpace ::
539
+ // - "Horizontal Tab (U+0009)"
540
+ // - "Space (U+0020)"
541
+ //
542
+ // Comma :: ,
504
543
  case 65279:
544
+ // <BOM>
505
545
  case 9:
546
+ // \t
506
547
  case 32:
548
+ // <space>
507
549
  case 44:
508
550
  ++i;
509
551
  continue;
552
+ // LineTerminator ::
553
+ // - "New Line (U+000A)"
554
+ // - "Carriage Return (U+000D)" [lookahead != "New Line (U+000A)"]
555
+ // - "Carriage Return (U+000D)" "New Line (U+000A)"
510
556
  case 10:
511
557
  ++i, ++e.line, e.lineStart = i;
512
558
  continue;
513
559
  case 13:
514
560
  n.charCodeAt(i + 1) === 10 ? i += 2 : ++i, ++e.line, e.lineStart = i;
515
561
  continue;
562
+ // Comment
516
563
  case 35:
517
- return ut(e, i);
564
+ return Ct(e, i);
565
+ // Token ::
566
+ // - Punctuator
567
+ // - Name
568
+ // - IntValue
569
+ // - FloatValue
570
+ // - StringValue
571
+ //
572
+ // Punctuator :: one of ! $ & ( ) ... : = @ [ ] { | }
518
573
  case 33:
519
- return S(e, u.BANG, i, i + 1);
574
+ return x(e, u.BANG, i, i + 1);
520
575
  case 36:
521
- return S(e, u.DOLLAR, i, i + 1);
576
+ return x(e, u.DOLLAR, i, i + 1);
522
577
  case 38:
523
- return S(e, u.AMP, i, i + 1);
578
+ return x(e, u.AMP, i, i + 1);
524
579
  case 40:
525
- return S(e, u.PAREN_L, i, i + 1);
580
+ return x(e, u.PAREN_L, i, i + 1);
526
581
  case 41:
527
- return S(e, u.PAREN_R, i, i + 1);
582
+ return x(e, u.PAREN_R, i, i + 1);
528
583
  case 46:
529
584
  if (n.charCodeAt(i + 1) === 46 && n.charCodeAt(i + 2) === 46)
530
- return S(e, u.SPREAD, i, i + 3);
585
+ return x(e, u.SPREAD, i, i + 3);
531
586
  break;
532
587
  case 58:
533
- return S(e, u.COLON, i, i + 1);
588
+ return x(e, u.COLON, i, i + 1);
534
589
  case 61:
535
- return S(e, u.EQUALS, i, i + 1);
590
+ return x(e, u.EQUALS, i, i + 1);
536
591
  case 64:
537
- return S(e, u.AT, i, i + 1);
592
+ return x(e, u.AT, i, i + 1);
538
593
  case 91:
539
- return S(e, u.BRACKET_L, i, i + 1);
594
+ return x(e, u.BRACKET_L, i, i + 1);
540
595
  case 93:
541
- return S(e, u.BRACKET_R, i, i + 1);
596
+ return x(e, u.BRACKET_R, i, i + 1);
542
597
  case 123:
543
- return S(e, u.BRACE_L, i, i + 1);
598
+ return x(e, u.BRACE_L, i, i + 1);
544
599
  case 124:
545
- return S(e, u.PIPE, i, i + 1);
600
+ return x(e, u.PIPE, i, i + 1);
546
601
  case 125:
547
- return S(e, u.BRACE_R, i, i + 1);
602
+ return x(e, u.BRACE_R, i, i + 1);
603
+ // StringValue
548
604
  case 34:
549
- return n.charCodeAt(i + 1) === 34 && n.charCodeAt(i + 2) === 34 ? mt(e, i) : lt(e, i);
605
+ return n.charCodeAt(i + 1) === 34 && n.charCodeAt(i + 2) === 34 ? It(e, i) : Et(e, i);
550
606
  }
551
- if (Y(s) || s === 45)
552
- return ct(e, i, s);
553
- if (_e(s))
554
- return ft(e, i);
555
- throw R(
607
+ if (z(s) || s === 45)
608
+ return yt(e, i, s);
609
+ if (Me(s))
610
+ return St(e, i);
611
+ throw P(
556
612
  e.source,
557
613
  i,
558
- s === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : G(s) || se(n, i) ? `Unexpected character: ${F(e, i)}.` : `Invalid character: ${F(e, i)}.`
614
+ s === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : G(s) || oe(n, i) ? `Unexpected character: ${B(e, i)}.` : `Invalid character: ${B(e, i)}.`
559
615
  );
560
616
  }
561
- return S(e, u.EOF, r, r);
617
+ return x(e, u.EOF, r, r);
562
618
  }
563
- function ut(e, t) {
619
+ function Ct(e, t) {
564
620
  const n = e.source.body, r = n.length;
565
621
  let i = t + 1;
566
622
  for (; i < r; ) {
@@ -569,12 +625,12 @@ function ut(e, t) {
569
625
  break;
570
626
  if (G(s))
571
627
  ++i;
572
- else if (se(n, i))
628
+ else if (oe(n, i))
573
629
  i += 2;
574
630
  else
575
631
  break;
576
632
  }
577
- return S(
633
+ return x(
578
634
  e,
579
635
  u.COMMENT,
580
636
  t,
@@ -582,31 +638,31 @@ function ut(e, t) {
582
638
  n.slice(t + 1, i)
583
639
  );
584
640
  }
585
- function ct(e, t, n) {
641
+ function yt(e, t, n) {
586
642
  const r = e.source.body;
587
643
  let i = t, s = n, a = !1;
588
644
  if (s === 45 && (s = r.charCodeAt(++i)), s === 48) {
589
- if (s = r.charCodeAt(++i), Y(s))
590
- throw R(
645
+ if (s = r.charCodeAt(++i), z(s))
646
+ throw P(
591
647
  e.source,
592
648
  i,
593
- `Invalid number, unexpected digit after 0: ${F(
649
+ `Invalid number, unexpected digit after 0: ${B(
594
650
  e,
595
651
  i
596
652
  )}.`
597
653
  );
598
654
  } else
599
- i = ce(e, i, s), s = r.charCodeAt(i);
600
- if (s === 46 && (a = !0, s = r.charCodeAt(++i), i = ce(e, i, s), s = r.charCodeAt(i)), (s === 69 || s === 101) && (a = !0, s = r.charCodeAt(++i), (s === 43 || s === 45) && (s = r.charCodeAt(++i)), i = ce(e, i, s), s = r.charCodeAt(i)), s === 46 || _e(s))
601
- throw R(
655
+ i = le(e, i, s), s = r.charCodeAt(i);
656
+ if (s === 46 && (a = !0, s = r.charCodeAt(++i), i = le(e, i, s), s = r.charCodeAt(i)), (s === 69 || s === 101) && (a = !0, s = r.charCodeAt(++i), (s === 43 || s === 45) && (s = r.charCodeAt(++i)), i = le(e, i, s), s = r.charCodeAt(i)), s === 46 || Me(s))
657
+ throw P(
602
658
  e.source,
603
659
  i,
604
- `Invalid number, expected digit but got: ${F(
660
+ `Invalid number, expected digit but got: ${B(
605
661
  e,
606
662
  i
607
663
  )}.`
608
664
  );
609
- return S(
665
+ return x(
610
666
  e,
611
667
  a ? u.FLOAT : u.INT,
612
668
  t,
@@ -614,54 +670,54 @@ function ct(e, t, n) {
614
670
  r.slice(t, i)
615
671
  );
616
672
  }
617
- function ce(e, t, n) {
618
- if (!Y(n))
619
- throw R(
673
+ function le(e, t, n) {
674
+ if (!z(n))
675
+ throw P(
620
676
  e.source,
621
677
  t,
622
- `Invalid number, expected digit but got: ${F(
678
+ `Invalid number, expected digit but got: ${B(
623
679
  e,
624
680
  t
625
681
  )}.`
626
682
  );
627
683
  const r = e.source.body;
628
684
  let i = t + 1;
629
- for (; Y(r.charCodeAt(i)); )
685
+ for (; z(r.charCodeAt(i)); )
630
686
  ++i;
631
687
  return i;
632
688
  }
633
- function lt(e, t) {
689
+ function Et(e, t) {
634
690
  const n = e.source.body, r = n.length;
635
691
  let i = t + 1, s = i, a = "";
636
692
  for (; i < r; ) {
637
693
  const c = n.charCodeAt(i);
638
694
  if (c === 34)
639
- return a += n.slice(s, i), S(e, u.STRING, t, i + 1, a);
695
+ return a += n.slice(s, i), x(e, u.STRING, t, i + 1, a);
640
696
  if (c === 92) {
641
697
  a += n.slice(s, i);
642
- const p = n.charCodeAt(i + 1) === 117 ? n.charCodeAt(i + 2) === 123 ? dt(e, i) : pt(e, i) : ht(e, i);
643
- a += p.value, i += p.size, s = i;
698
+ const l = n.charCodeAt(i + 1) === 117 ? n.charCodeAt(i + 2) === 123 ? At(e, i) : vt(e, i) : Tt(e, i);
699
+ a += l.value, i += l.size, s = i;
644
700
  continue;
645
701
  }
646
702
  if (c === 10 || c === 13)
647
703
  break;
648
704
  if (G(c))
649
705
  ++i;
650
- else if (se(n, i))
706
+ else if (oe(n, i))
651
707
  i += 2;
652
708
  else
653
- throw R(
709
+ throw P(
654
710
  e.source,
655
711
  i,
656
- `Invalid character within String: ${F(
712
+ `Invalid character within String: ${B(
657
713
  e,
658
714
  i
659
715
  )}.`
660
716
  );
661
717
  }
662
- throw R(e.source, i, "Unterminated string.");
718
+ throw P(e.source, i, "Unterminated string.");
663
719
  }
664
- function dt(e, t) {
720
+ function At(e, t) {
665
721
  const n = e.source.body;
666
722
  let r = 0, i = 3;
667
723
  for (; i < 12; ) {
@@ -674,10 +730,10 @@ function dt(e, t) {
674
730
  size: i
675
731
  };
676
732
  }
677
- if (r = r << 4 | j(s), r < 0)
733
+ if (r = r << 4 | H(s), r < 0)
678
734
  break;
679
735
  }
680
- throw R(
736
+ throw P(
681
737
  e.source,
682
738
  t,
683
739
  `Invalid Unicode escape sequence: "${n.slice(
@@ -686,34 +742,34 @@ function dt(e, t) {
686
742
  )}".`
687
743
  );
688
744
  }
689
- function pt(e, t) {
690
- const n = e.source.body, r = Se(n, t + 2);
745
+ function vt(e, t) {
746
+ const n = e.source.body, r = Pe(n, t + 2);
691
747
  if (G(r))
692
748
  return {
693
749
  value: String.fromCodePoint(r),
694
750
  size: 6
695
751
  };
696
- if (Le(r) && n.charCodeAt(t + 6) === 92 && n.charCodeAt(t + 7) === 117) {
697
- const i = Se(n, t + 8);
698
- if (we(i))
752
+ if (qe(r) && n.charCodeAt(t + 6) === 92 && n.charCodeAt(t + 7) === 117) {
753
+ const i = Pe(n, t + 8);
754
+ if (Be(i))
699
755
  return {
700
756
  value: String.fromCodePoint(r, i),
701
757
  size: 12
702
758
  };
703
759
  }
704
- throw R(
760
+ throw P(
705
761
  e.source,
706
762
  t,
707
763
  `Invalid Unicode escape sequence: "${n.slice(t, t + 6)}".`
708
764
  );
709
765
  }
710
- function Se(e, t) {
711
- return j(e.charCodeAt(t)) << 12 | j(e.charCodeAt(t + 1)) << 8 | j(e.charCodeAt(t + 2)) << 4 | j(e.charCodeAt(t + 3));
766
+ function Pe(e, t) {
767
+ return H(e.charCodeAt(t)) << 12 | H(e.charCodeAt(t + 1)) << 8 | H(e.charCodeAt(t + 2)) << 4 | H(e.charCodeAt(t + 3));
712
768
  }
713
- function j(e) {
769
+ function H(e) {
714
770
  return e >= 48 && e <= 57 ? e - 48 : e >= 65 && e <= 70 ? e - 55 : e >= 97 && e <= 102 ? e - 87 : -1;
715
771
  }
716
- function ht(e, t) {
772
+ function Tt(e, t) {
717
773
  const n = e.source.body;
718
774
  switch (n.charCodeAt(t + 1)) {
719
775
  case 34:
@@ -758,7 +814,7 @@ function ht(e, t) {
758
814
  size: 2
759
815
  };
760
816
  }
761
- throw R(
817
+ throw P(
762
818
  e.source,
763
819
  t,
764
820
  `Invalid character escape sequence: "${n.slice(
@@ -767,60 +823,60 @@ function ht(e, t) {
767
823
  )}".`
768
824
  );
769
825
  }
770
- function mt(e, t) {
826
+ function It(e, t) {
771
827
  const n = e.source.body, r = n.length;
772
828
  let i = e.lineStart, s = t + 3, a = s, c = "";
773
- const p = [];
829
+ const l = [];
774
830
  for (; s < r; ) {
775
- const h = n.charCodeAt(s);
776
- if (h === 34 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34) {
777
- c += n.slice(a, s), p.push(c);
778
- const f = S(
831
+ const m = n.charCodeAt(s);
832
+ if (m === 34 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34) {
833
+ c += n.slice(a, s), l.push(c);
834
+ const f = x(
779
835
  e,
780
836
  u.BLOCK_STRING,
781
837
  t,
782
838
  s + 3,
783
839
  // Return a string of the lines joined with U+000A.
784
- nt(p).join(`
840
+ lt(l).join(`
785
841
  `)
786
842
  );
787
- return e.line += p.length - 1, e.lineStart = i, f;
843
+ return e.line += l.length - 1, e.lineStart = i, f;
788
844
  }
789
- if (h === 92 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34 && n.charCodeAt(s + 3) === 34) {
845
+ if (m === 92 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34 && n.charCodeAt(s + 3) === 34) {
790
846
  c += n.slice(a, s), a = s + 1, s += 4;
791
847
  continue;
792
848
  }
793
- if (h === 10 || h === 13) {
794
- c += n.slice(a, s), p.push(c), h === 13 && n.charCodeAt(s + 1) === 10 ? s += 2 : ++s, c = "", a = s, i = s;
849
+ if (m === 10 || m === 13) {
850
+ c += n.slice(a, s), l.push(c), m === 13 && n.charCodeAt(s + 1) === 10 ? s += 2 : ++s, c = "", a = s, i = s;
795
851
  continue;
796
852
  }
797
- if (G(h))
853
+ if (G(m))
798
854
  ++s;
799
- else if (se(n, s))
855
+ else if (oe(n, s))
800
856
  s += 2;
801
857
  else
802
- throw R(
858
+ throw P(
803
859
  e.source,
804
860
  s,
805
- `Invalid character within String: ${F(
861
+ `Invalid character within String: ${B(
806
862
  e,
807
863
  s
808
864
  )}.`
809
865
  );
810
866
  }
811
- throw R(e.source, s, "Unterminated string.");
867
+ throw P(e.source, s, "Unterminated string.");
812
868
  }
813
- function ft(e, t) {
869
+ function St(e, t) {
814
870
  const n = e.source.body, r = n.length;
815
871
  let i = t + 1;
816
872
  for (; i < r; ) {
817
873
  const s = n.charCodeAt(i);
818
- if (tt(s))
874
+ if (dt(s))
819
875
  ++i;
820
876
  else
821
877
  break;
822
878
  }
823
- return S(
879
+ return x(
824
880
  e,
825
881
  u.NAME,
826
882
  t,
@@ -828,56 +884,56 @@ function ft(e, t) {
828
884
  n.slice(t, i)
829
885
  );
830
886
  }
831
- const gt = 10, Fe = 2;
832
- function Ee(e) {
833
- return ae(e, []);
887
+ const Rt = 10, Fe = 2;
888
+ function Te(e) {
889
+ return ue(e, []);
834
890
  }
835
- function ae(e, t) {
891
+ function ue(e, t) {
836
892
  switch (typeof e) {
837
893
  case "string":
838
894
  return JSON.stringify(e);
839
895
  case "function":
840
896
  return e.name ? `[function ${e.name}]` : "[function]";
841
897
  case "object":
842
- return Ct(e, t);
898
+ return Ot(e, t);
843
899
  default:
844
900
  return String(e);
845
901
  }
846
902
  }
847
- function Ct(e, t) {
903
+ function Ot(e, t) {
848
904
  if (e === null)
849
905
  return "null";
850
906
  if (t.includes(e))
851
907
  return "[Circular]";
852
908
  const n = [...t, e];
853
- if (yt(e)) {
909
+ if (xt(e)) {
854
910
  const r = e.toJSON();
855
911
  if (r !== e)
856
- return typeof r == "string" ? r : ae(r, n);
912
+ return typeof r == "string" ? r : ue(r, n);
857
913
  } else if (Array.isArray(e))
858
- return At(e, n);
859
- return Et(e, n);
914
+ return Dt(e, n);
915
+ return Pt(e, n);
860
916
  }
861
- function yt(e) {
917
+ function xt(e) {
862
918
  return typeof e.toJSON == "function";
863
919
  }
864
- function Et(e, t) {
920
+ function Pt(e, t) {
865
921
  const n = Object.entries(e);
866
- return n.length === 0 ? "{}" : t.length > Fe ? "[" + vt(e) + "]" : "{ " + n.map(
867
- ([i, s]) => i + ": " + ae(s, t)
922
+ return n.length === 0 ? "{}" : t.length > Fe ? "[" + Nt(e) + "]" : "{ " + n.map(
923
+ ([i, s]) => i + ": " + ue(s, t)
868
924
  ).join(", ") + " }";
869
925
  }
870
- function At(e, t) {
926
+ function Dt(e, t) {
871
927
  if (e.length === 0)
872
928
  return "[]";
873
929
  if (t.length > Fe)
874
930
  return "[Array]";
875
- const n = Math.min(gt, e.length), r = e.length - n, i = [];
931
+ const n = Math.min(Rt, e.length), r = e.length - n, i = [];
876
932
  for (let s = 0; s < n; ++s)
877
- i.push(ae(e[s], t));
933
+ i.push(ue(e[s], t));
878
934
  return r === 1 ? i.push("... 1 more item") : r > 1 && i.push(`... ${r} more items`), "[" + i.join(", ") + "]";
879
935
  }
880
- function vt(e) {
936
+ function Nt(e) {
881
937
  const t = Object.prototype.toString.call(e).replace(/^\[object /, "").replace(/]$/, "");
882
938
  if (t === "Object" && typeof e.constructor == "function") {
883
939
  const n = e.constructor.name;
@@ -886,10 +942,11 @@ function vt(e) {
886
942
  }
887
943
  return t;
888
944
  }
889
- const It = (
945
+ const bt = globalThis.process && // eslint-disable-next-line no-undef
946
+ process.env.NODE_ENV === "production", kt = (
890
947
  /* c8 ignore next 6 */
891
948
  // FIXME: https://github.com/graphql/graphql-js/issues/2317
892
- globalThis.process && globalThis.process.env.NODE_ENV === "production" ? function(t, n) {
949
+ bt ? function(t, n) {
893
950
  return t instanceof n;
894
951
  } : function(t, n) {
895
952
  if (t instanceof n)
@@ -901,7 +958,7 @@ const It = (
901
958
  Symbol.toStringTag in t ? t[Symbol.toStringTag] : (r = t.constructor) === null || r === void 0 ? void 0 : r.name
902
959
  );
903
960
  if (i === s) {
904
- const a = Ee(t);
961
+ const a = Te(t);
905
962
  throw new Error(`Cannot use ${i} "${a}" from another module or realm.
906
963
 
907
964
  Ensure that there is only one instance of "graphql" in the node_modules
@@ -919,15 +976,15 @@ spurious results.`);
919
976
  return !1;
920
977
  }
921
978
  );
922
- class Me {
979
+ class Ue {
923
980
  constructor(t, n = "GraphQL request", r = {
924
981
  line: 1,
925
982
  column: 1
926
983
  }) {
927
- typeof t == "string" || Z(!1, `Body must be a string. Received: ${Ee(t)}.`), this.body = t, this.name = n, this.locationOffset = r, this.locationOffset.line > 0 || Z(
984
+ typeof t == "string" || ee(!1, `Body must be a string. Received: ${Te(t)}.`), this.body = t, this.name = n, this.locationOffset = r, this.locationOffset.line > 0 || ee(
928
985
  !1,
929
986
  "line in locationOffset is 1-indexed and must be positive."
930
- ), this.locationOffset.column > 0 || Z(
987
+ ), this.locationOffset.column > 0 || ee(
931
988
  !1,
932
989
  "column in locationOffset is 1-indexed and must be positive."
933
990
  );
@@ -936,16 +993,29 @@ class Me {
936
993
  return "Source";
937
994
  }
938
995
  }
939
- function Tt(e) {
940
- return It(e, Me);
996
+ function _t(e) {
997
+ return kt(e, Ue);
941
998
  }
942
- function Be(e, t) {
943
- return new xt(e, t).parseDocument();
999
+ function Ve(e, t) {
1000
+ const n = new Lt(e, t), r = n.parseDocument();
1001
+ return Object.defineProperty(r, "tokenCount", {
1002
+ enumerable: !1,
1003
+ value: n.tokenCount
1004
+ }), r;
944
1005
  }
945
- class xt {
1006
+ class Lt {
946
1007
  constructor(t, n = {}) {
947
- const r = Tt(t) ? t : new Me(t);
948
- this._lexer = new st(r), this._options = n, this._tokenCounter = 0;
1008
+ const { lexer: r, ...i } = n;
1009
+ if (r)
1010
+ this._lexer = r;
1011
+ else {
1012
+ const s = _t(t) ? t : new Ue(t);
1013
+ this._lexer = new mt(s);
1014
+ }
1015
+ this._options = i, this._tokenCounter = 0;
1016
+ }
1017
+ get tokenCount() {
1018
+ return this._tokenCounter;
949
1019
  }
950
1020
  /**
951
1021
  * Converts a name lex token into a name parse node.
@@ -953,7 +1023,7 @@ class xt {
953
1023
  parseName() {
954
1024
  const t = this.expectToken(u.NAME);
955
1025
  return this.node(t, {
956
- kind: m.NAME,
1026
+ kind: p.NAME,
957
1027
  value: t.value
958
1028
  });
959
1029
  }
@@ -963,7 +1033,7 @@ class xt {
963
1033
  */
964
1034
  parseDocument() {
965
1035
  return this.node(this._lexer.token, {
966
- kind: m.DOCUMENT,
1036
+ kind: p.DOCUMENT,
967
1037
  definitions: this.many(
968
1038
  u.SOF,
969
1039
  this.parseDefinition,
@@ -998,6 +1068,12 @@ class xt {
998
1068
  if (this.peek(u.BRACE_L))
999
1069
  return this.parseOperationDefinition();
1000
1070
  const t = this.peekDescription(), n = t ? this._lexer.lookahead() : this._lexer.token;
1071
+ if (t && n.kind === u.BRACE_L)
1072
+ throw P(
1073
+ this._lexer.source,
1074
+ this._lexer.token.start,
1075
+ "Unexpected description, descriptions are not supported on shorthand queries."
1076
+ );
1001
1077
  if (n.kind === u.NAME) {
1002
1078
  switch (n.value) {
1003
1079
  case "schema":
@@ -1017,12 +1093,6 @@ class xt {
1017
1093
  case "directive":
1018
1094
  return this.parseDirectiveDefinition();
1019
1095
  }
1020
- if (t)
1021
- throw R(
1022
- this._lexer.source,
1023
- this._lexer.token.start,
1024
- "Unexpected description, descriptions are supported only on type definitions."
1025
- );
1026
1096
  switch (n.value) {
1027
1097
  case "query":
1028
1098
  case "mutation":
@@ -1030,6 +1100,14 @@ class xt {
1030
1100
  return this.parseOperationDefinition();
1031
1101
  case "fragment":
1032
1102
  return this.parseFragmentDefinition();
1103
+ }
1104
+ if (t)
1105
+ throw P(
1106
+ this._lexer.source,
1107
+ this._lexer.token.start,
1108
+ "Unexpected description, only GraphQL definitions support descriptions."
1109
+ );
1110
+ switch (n.value) {
1033
1111
  case "extend":
1034
1112
  return this.parseTypeSystemExtension();
1035
1113
  }
@@ -1046,19 +1124,21 @@ class xt {
1046
1124
  const t = this._lexer.token;
1047
1125
  if (this.peek(u.BRACE_L))
1048
1126
  return this.node(t, {
1049
- kind: m.OPERATION_DEFINITION,
1050
- operation: q.QUERY,
1127
+ kind: p.OPERATION_DEFINITION,
1128
+ operation: V.QUERY,
1129
+ description: void 0,
1051
1130
  name: void 0,
1052
1131
  variableDefinitions: [],
1053
1132
  directives: [],
1054
1133
  selectionSet: this.parseSelectionSet()
1055
1134
  });
1056
- const n = this.parseOperationType();
1057
- let r;
1058
- return this.peek(u.NAME) && (r = this.parseName()), this.node(t, {
1059
- kind: m.OPERATION_DEFINITION,
1060
- operation: n,
1061
- name: r,
1135
+ const n = this.parseDescription(), r = this.parseOperationType();
1136
+ let i;
1137
+ return this.peek(u.NAME) && (i = this.parseName()), this.node(t, {
1138
+ kind: p.OPERATION_DEFINITION,
1139
+ operation: r,
1140
+ description: n,
1141
+ name: i,
1062
1142
  variableDefinitions: this.parseVariableDefinitions(),
1063
1143
  directives: this.parseDirectives(!1),
1064
1144
  selectionSet: this.parseSelectionSet()
@@ -1071,11 +1151,11 @@ class xt {
1071
1151
  const t = this.expectToken(u.NAME);
1072
1152
  switch (t.value) {
1073
1153
  case "query":
1074
- return q.QUERY;
1154
+ return V.QUERY;
1075
1155
  case "mutation":
1076
- return q.MUTATION;
1156
+ return V.MUTATION;
1077
1157
  case "subscription":
1078
- return q.SUBSCRIPTION;
1158
+ return V.SUBSCRIPTION;
1079
1159
  }
1080
1160
  throw this.unexpected(t);
1081
1161
  }
@@ -1094,7 +1174,8 @@ class xt {
1094
1174
  */
1095
1175
  parseVariableDefinition() {
1096
1176
  return this.node(this._lexer.token, {
1097
- kind: m.VARIABLE_DEFINITION,
1177
+ kind: p.VARIABLE_DEFINITION,
1178
+ description: this.parseDescription(),
1098
1179
  variable: this.parseVariable(),
1099
1180
  type: (this.expectToken(u.COLON), this.parseTypeReference()),
1100
1181
  defaultValue: this.expectOptionalToken(u.EQUALS) ? this.parseConstValueLiteral() : void 0,
@@ -1107,7 +1188,7 @@ class xt {
1107
1188
  parseVariable() {
1108
1189
  const t = this._lexer.token;
1109
1190
  return this.expectToken(u.DOLLAR), this.node(t, {
1110
- kind: m.VARIABLE,
1191
+ kind: p.VARIABLE,
1111
1192
  name: this.parseName()
1112
1193
  });
1113
1194
  }
@@ -1118,7 +1199,7 @@ class xt {
1118
1199
  */
1119
1200
  parseSelectionSet() {
1120
1201
  return this.node(this._lexer.token, {
1121
- kind: m.SELECTION_SET,
1202
+ kind: p.SELECTION_SET,
1122
1203
  selections: this.many(
1123
1204
  u.BRACE_L,
1124
1205
  this.parseSelection,
@@ -1144,7 +1225,7 @@ class xt {
1144
1225
  const t = this._lexer.token, n = this.parseName();
1145
1226
  let r, i;
1146
1227
  return this.expectOptionalToken(u.COLON) ? (r = n, i = this.parseName()) : i = n, this.node(t, {
1147
- kind: m.FIELD,
1228
+ kind: p.FIELD,
1148
1229
  alias: r,
1149
1230
  name: i,
1150
1231
  arguments: this.parseArguments(!1),
@@ -1165,7 +1246,7 @@ class xt {
1165
1246
  parseArgument(t = !1) {
1166
1247
  const n = this._lexer.token, r = this.parseName();
1167
1248
  return this.expectToken(u.COLON), this.node(n, {
1168
- kind: m.ARGUMENT,
1249
+ kind: p.ARGUMENT,
1169
1250
  name: r,
1170
1251
  value: this.parseValueLiteral(t)
1171
1252
  });
@@ -1186,11 +1267,11 @@ class xt {
1186
1267
  this.expectToken(u.SPREAD);
1187
1268
  const n = this.expectOptionalKeyword("on");
1188
1269
  return !n && this.peek(u.NAME) ? this.node(t, {
1189
- kind: m.FRAGMENT_SPREAD,
1270
+ kind: p.FRAGMENT_SPREAD,
1190
1271
  name: this.parseFragmentName(),
1191
1272
  directives: this.parseDirectives(!1)
1192
1273
  }) : this.node(t, {
1193
- kind: m.INLINE_FRAGMENT,
1274
+ kind: p.INLINE_FRAGMENT,
1194
1275
  typeCondition: n ? this.parseNamedType() : void 0,
1195
1276
  directives: this.parseDirectives(!1),
1196
1277
  selectionSet: this.parseSelectionSet()
@@ -1203,16 +1284,18 @@ class xt {
1203
1284
  * TypeCondition : NamedType
1204
1285
  */
1205
1286
  parseFragmentDefinition() {
1206
- const t = this._lexer.token;
1287
+ const t = this._lexer.token, n = this.parseDescription();
1207
1288
  return this.expectKeyword("fragment"), this._options.allowLegacyFragmentVariables === !0 ? this.node(t, {
1208
- kind: m.FRAGMENT_DEFINITION,
1289
+ kind: p.FRAGMENT_DEFINITION,
1290
+ description: n,
1209
1291
  name: this.parseFragmentName(),
1210
1292
  variableDefinitions: this.parseVariableDefinitions(),
1211
1293
  typeCondition: (this.expectKeyword("on"), this.parseNamedType()),
1212
1294
  directives: this.parseDirectives(!1),
1213
1295
  selectionSet: this.parseSelectionSet()
1214
1296
  }) : this.node(t, {
1215
- kind: m.FRAGMENT_DEFINITION,
1297
+ kind: p.FRAGMENT_DEFINITION,
1298
+ description: n,
1216
1299
  name: this.parseFragmentName(),
1217
1300
  typeCondition: (this.expectKeyword("on"), this.parseNamedType()),
1218
1301
  directives: this.parseDirectives(!1),
@@ -1255,12 +1338,12 @@ class xt {
1255
1338
  return this.parseObject(t);
1256
1339
  case u.INT:
1257
1340
  return this.advanceLexer(), this.node(n, {
1258
- kind: m.INT,
1341
+ kind: p.INT,
1259
1342
  value: n.value
1260
1343
  });
1261
1344
  case u.FLOAT:
1262
1345
  return this.advanceLexer(), this.node(n, {
1263
- kind: m.FLOAT,
1346
+ kind: p.FLOAT,
1264
1347
  value: n.value
1265
1348
  });
1266
1349
  case u.STRING:
@@ -1270,21 +1353,21 @@ class xt {
1270
1353
  switch (this.advanceLexer(), n.value) {
1271
1354
  case "true":
1272
1355
  return this.node(n, {
1273
- kind: m.BOOLEAN,
1356
+ kind: p.BOOLEAN,
1274
1357
  value: !0
1275
1358
  });
1276
1359
  case "false":
1277
1360
  return this.node(n, {
1278
- kind: m.BOOLEAN,
1361
+ kind: p.BOOLEAN,
1279
1362
  value: !1
1280
1363
  });
1281
1364
  case "null":
1282
1365
  return this.node(n, {
1283
- kind: m.NULL
1366
+ kind: p.NULL
1284
1367
  });
1285
1368
  default:
1286
1369
  return this.node(n, {
1287
- kind: m.ENUM,
1370
+ kind: p.ENUM,
1288
1371
  value: n.value
1289
1372
  });
1290
1373
  }
@@ -1292,7 +1375,7 @@ class xt {
1292
1375
  if (t)
1293
1376
  if (this.expectToken(u.DOLLAR), this._lexer.token.kind === u.NAME) {
1294
1377
  const r = this._lexer.token.value;
1295
- throw R(
1378
+ throw P(
1296
1379
  this._lexer.source,
1297
1380
  n.start,
1298
1381
  `Unexpected variable "$${r}" in constant value.`
@@ -1310,7 +1393,7 @@ class xt {
1310
1393
  parseStringLiteral() {
1311
1394
  const t = this._lexer.token;
1312
1395
  return this.advanceLexer(), this.node(t, {
1313
- kind: m.STRING,
1396
+ kind: p.STRING,
1314
1397
  value: t.value,
1315
1398
  block: t.kind === u.BLOCK_STRING
1316
1399
  });
@@ -1323,7 +1406,7 @@ class xt {
1323
1406
  parseList(t) {
1324
1407
  const n = () => this.parseValueLiteral(t);
1325
1408
  return this.node(this._lexer.token, {
1326
- kind: m.LIST,
1409
+ kind: p.LIST,
1327
1410
  values: this.any(u.BRACKET_L, n, u.BRACKET_R)
1328
1411
  });
1329
1412
  }
@@ -1337,7 +1420,7 @@ class xt {
1337
1420
  parseObject(t) {
1338
1421
  const n = () => this.parseObjectField(t);
1339
1422
  return this.node(this._lexer.token, {
1340
- kind: m.OBJECT,
1423
+ kind: p.OBJECT,
1341
1424
  fields: this.any(u.BRACE_L, n, u.BRACE_R)
1342
1425
  });
1343
1426
  }
@@ -1347,7 +1430,7 @@ class xt {
1347
1430
  parseObjectField(t) {
1348
1431
  const n = this._lexer.token, r = this.parseName();
1349
1432
  return this.expectToken(u.COLON), this.node(n, {
1350
- kind: m.OBJECT_FIELD,
1433
+ kind: p.OBJECT_FIELD,
1351
1434
  name: r,
1352
1435
  value: this.parseValueLiteral(t)
1353
1436
  });
@@ -1373,7 +1456,7 @@ class xt {
1373
1456
  parseDirective(t) {
1374
1457
  const n = this._lexer.token;
1375
1458
  return this.expectToken(u.AT), this.node(n, {
1376
- kind: m.DIRECTIVE,
1459
+ kind: p.DIRECTIVE,
1377
1460
  name: this.parseName(),
1378
1461
  arguments: this.parseArguments(t)
1379
1462
  });
@@ -1391,13 +1474,13 @@ class xt {
1391
1474
  if (this.expectOptionalToken(u.BRACKET_L)) {
1392
1475
  const r = this.parseTypeReference();
1393
1476
  this.expectToken(u.BRACKET_R), n = this.node(t, {
1394
- kind: m.LIST_TYPE,
1477
+ kind: p.LIST_TYPE,
1395
1478
  type: r
1396
1479
  });
1397
1480
  } else
1398
1481
  n = this.parseNamedType();
1399
1482
  return this.expectOptionalToken(u.BANG) ? this.node(t, {
1400
- kind: m.NON_NULL_TYPE,
1483
+ kind: p.NON_NULL_TYPE,
1401
1484
  type: n
1402
1485
  }) : n;
1403
1486
  }
@@ -1406,7 +1489,7 @@ class xt {
1406
1489
  */
1407
1490
  parseNamedType() {
1408
1491
  return this.node(this._lexer.token, {
1409
- kind: m.NAMED_TYPE,
1492
+ kind: p.NAMED_TYPE,
1410
1493
  name: this.parseName()
1411
1494
  });
1412
1495
  }
@@ -1435,7 +1518,7 @@ class xt {
1435
1518
  u.BRACE_R
1436
1519
  );
1437
1520
  return this.node(t, {
1438
- kind: m.SCHEMA_DEFINITION,
1521
+ kind: p.SCHEMA_DEFINITION,
1439
1522
  description: n,
1440
1523
  directives: r,
1441
1524
  operationTypes: i
@@ -1449,7 +1532,7 @@ class xt {
1449
1532
  this.expectToken(u.COLON);
1450
1533
  const r = this.parseNamedType();
1451
1534
  return this.node(t, {
1452
- kind: m.OPERATION_TYPE_DEFINITION,
1535
+ kind: p.OPERATION_TYPE_DEFINITION,
1453
1536
  operation: n,
1454
1537
  type: r
1455
1538
  });
@@ -1462,7 +1545,7 @@ class xt {
1462
1545
  this.expectKeyword("scalar");
1463
1546
  const r = this.parseName(), i = this.parseConstDirectives();
1464
1547
  return this.node(t, {
1465
- kind: m.SCALAR_TYPE_DEFINITION,
1548
+ kind: p.SCALAR_TYPE_DEFINITION,
1466
1549
  description: n,
1467
1550
  name: r,
1468
1551
  directives: i
@@ -1478,7 +1561,7 @@ class xt {
1478
1561
  this.expectKeyword("type");
1479
1562
  const r = this.parseName(), i = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), a = this.parseFieldsDefinition();
1480
1563
  return this.node(t, {
1481
- kind: m.OBJECT_TYPE_DEFINITION,
1564
+ kind: p.OBJECT_TYPE_DEFINITION,
1482
1565
  description: n,
1483
1566
  name: r,
1484
1567
  interfaces: i,
@@ -1515,7 +1598,7 @@ class xt {
1515
1598
  this.expectToken(u.COLON);
1516
1599
  const s = this.parseTypeReference(), a = this.parseConstDirectives();
1517
1600
  return this.node(t, {
1518
- kind: m.FIELD_DEFINITION,
1601
+ kind: p.FIELD_DEFINITION,
1519
1602
  description: n,
1520
1603
  name: r,
1521
1604
  arguments: i,
@@ -1545,7 +1628,7 @@ class xt {
1545
1628
  this.expectOptionalToken(u.EQUALS) && (s = this.parseConstValueLiteral());
1546
1629
  const a = this.parseConstDirectives();
1547
1630
  return this.node(t, {
1548
- kind: m.INPUT_VALUE_DEFINITION,
1631
+ kind: p.INPUT_VALUE_DEFINITION,
1549
1632
  description: n,
1550
1633
  name: r,
1551
1634
  type: i,
@@ -1562,7 +1645,7 @@ class xt {
1562
1645
  this.expectKeyword("interface");
1563
1646
  const r = this.parseName(), i = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), a = this.parseFieldsDefinition();
1564
1647
  return this.node(t, {
1565
- kind: m.INTERFACE_TYPE_DEFINITION,
1648
+ kind: p.INTERFACE_TYPE_DEFINITION,
1566
1649
  description: n,
1567
1650
  name: r,
1568
1651
  interfaces: i,
@@ -1579,7 +1662,7 @@ class xt {
1579
1662
  this.expectKeyword("union");
1580
1663
  const r = this.parseName(), i = this.parseConstDirectives(), s = this.parseUnionMemberTypes();
1581
1664
  return this.node(t, {
1582
- kind: m.UNION_TYPE_DEFINITION,
1665
+ kind: p.UNION_TYPE_DEFINITION,
1583
1666
  description: n,
1584
1667
  name: r,
1585
1668
  directives: i,
@@ -1603,7 +1686,7 @@ class xt {
1603
1686
  this.expectKeyword("enum");
1604
1687
  const r = this.parseName(), i = this.parseConstDirectives(), s = this.parseEnumValuesDefinition();
1605
1688
  return this.node(t, {
1606
- kind: m.ENUM_TYPE_DEFINITION,
1689
+ kind: p.ENUM_TYPE_DEFINITION,
1607
1690
  description: n,
1608
1691
  name: r,
1609
1692
  directives: i,
@@ -1628,7 +1711,7 @@ class xt {
1628
1711
  parseEnumValueDefinition() {
1629
1712
  const t = this._lexer.token, n = this.parseDescription(), r = this.parseEnumValueName(), i = this.parseConstDirectives();
1630
1713
  return this.node(t, {
1631
- kind: m.ENUM_VALUE_DEFINITION,
1714
+ kind: p.ENUM_VALUE_DEFINITION,
1632
1715
  description: n,
1633
1716
  name: r,
1634
1717
  directives: i
@@ -1639,7 +1722,7 @@ class xt {
1639
1722
  */
1640
1723
  parseEnumValueName() {
1641
1724
  if (this._lexer.token.value === "true" || this._lexer.token.value === "false" || this._lexer.token.value === "null")
1642
- throw R(
1725
+ throw P(
1643
1726
  this._lexer.source,
1644
1727
  this._lexer.token.start,
1645
1728
  `${K(
@@ -1657,7 +1740,7 @@ class xt {
1657
1740
  this.expectKeyword("input");
1658
1741
  const r = this.parseName(), i = this.parseConstDirectives(), s = this.parseInputFieldsDefinition();
1659
1742
  return this.node(t, {
1660
- kind: m.INPUT_OBJECT_TYPE_DEFINITION,
1743
+ kind: p.INPUT_OBJECT_TYPE_DEFINITION,
1661
1744
  description: n,
1662
1745
  name: r,
1663
1746
  directives: i,
@@ -1728,7 +1811,7 @@ class xt {
1728
1811
  if (n.length === 0 && r.length === 0)
1729
1812
  throw this.unexpected();
1730
1813
  return this.node(t, {
1731
- kind: m.SCHEMA_EXTENSION,
1814
+ kind: p.SCHEMA_EXTENSION,
1732
1815
  directives: n,
1733
1816
  operationTypes: r
1734
1817
  });
@@ -1744,7 +1827,7 @@ class xt {
1744
1827
  if (r.length === 0)
1745
1828
  throw this.unexpected();
1746
1829
  return this.node(t, {
1747
- kind: m.SCALAR_TYPE_EXTENSION,
1830
+ kind: p.SCALAR_TYPE_EXTENSION,
1748
1831
  name: n,
1749
1832
  directives: r
1750
1833
  });
@@ -1762,7 +1845,7 @@ class xt {
1762
1845
  if (r.length === 0 && i.length === 0 && s.length === 0)
1763
1846
  throw this.unexpected();
1764
1847
  return this.node(t, {
1765
- kind: m.OBJECT_TYPE_EXTENSION,
1848
+ kind: p.OBJECT_TYPE_EXTENSION,
1766
1849
  name: n,
1767
1850
  interfaces: r,
1768
1851
  directives: i,
@@ -1782,7 +1865,7 @@ class xt {
1782
1865
  if (r.length === 0 && i.length === 0 && s.length === 0)
1783
1866
  throw this.unexpected();
1784
1867
  return this.node(t, {
1785
- kind: m.INTERFACE_TYPE_EXTENSION,
1868
+ kind: p.INTERFACE_TYPE_EXTENSION,
1786
1869
  name: n,
1787
1870
  interfaces: r,
1788
1871
  directives: i,
@@ -1801,7 +1884,7 @@ class xt {
1801
1884
  if (r.length === 0 && i.length === 0)
1802
1885
  throw this.unexpected();
1803
1886
  return this.node(t, {
1804
- kind: m.UNION_TYPE_EXTENSION,
1887
+ kind: p.UNION_TYPE_EXTENSION,
1805
1888
  name: n,
1806
1889
  directives: r,
1807
1890
  types: i
@@ -1819,7 +1902,7 @@ class xt {
1819
1902
  if (r.length === 0 && i.length === 0)
1820
1903
  throw this.unexpected();
1821
1904
  return this.node(t, {
1822
- kind: m.ENUM_TYPE_EXTENSION,
1905
+ kind: p.ENUM_TYPE_EXTENSION,
1823
1906
  name: n,
1824
1907
  directives: r,
1825
1908
  values: i
@@ -1837,7 +1920,7 @@ class xt {
1837
1920
  if (r.length === 0 && i.length === 0)
1838
1921
  throw this.unexpected();
1839
1922
  return this.node(t, {
1840
- kind: m.INPUT_OBJECT_TYPE_EXTENSION,
1923
+ kind: p.INPUT_OBJECT_TYPE_EXTENSION,
1841
1924
  name: n,
1842
1925
  directives: r,
1843
1926
  fields: i
@@ -1856,7 +1939,7 @@ class xt {
1856
1939
  this.expectKeyword("on");
1857
1940
  const a = this.parseDirectiveLocations();
1858
1941
  return this.node(t, {
1859
- kind: m.DIRECTIVE_DEFINITION,
1942
+ kind: p.DIRECTIVE_DEFINITION,
1860
1943
  description: n,
1861
1944
  name: r,
1862
1945
  arguments: i,
@@ -1901,10 +1984,45 @@ class xt {
1901
1984
  */
1902
1985
  parseDirectiveLocation() {
1903
1986
  const t = this._lexer.token, n = this.parseName();
1904
- if (Object.prototype.hasOwnProperty.call(me, n.value))
1987
+ if (Object.prototype.hasOwnProperty.call(Ce, n.value))
1905
1988
  return n;
1906
1989
  throw this.unexpected(t);
1907
1990
  }
1991
+ // Schema Coordinates
1992
+ /**
1993
+ * SchemaCoordinate :
1994
+ * - Name
1995
+ * - Name . Name
1996
+ * - Name . Name ( Name : )
1997
+ * - \@ Name
1998
+ * - \@ Name ( Name : )
1999
+ */
2000
+ parseSchemaCoordinate() {
2001
+ const t = this._lexer.token, n = this.expectOptionalToken(u.AT), r = this.parseName();
2002
+ let i;
2003
+ !n && this.expectOptionalToken(u.DOT) && (i = this.parseName());
2004
+ let s;
2005
+ return (n || i) && this.expectOptionalToken(u.PAREN_L) && (s = this.parseName(), this.expectToken(u.COLON), this.expectToken(u.PAREN_R)), n ? s ? this.node(t, {
2006
+ kind: p.DIRECTIVE_ARGUMENT_COORDINATE,
2007
+ name: r,
2008
+ argumentName: s
2009
+ }) : this.node(t, {
2010
+ kind: p.DIRECTIVE_COORDINATE,
2011
+ name: r
2012
+ }) : i ? s ? this.node(t, {
2013
+ kind: p.ARGUMENT_COORDINATE,
2014
+ name: r,
2015
+ fieldName: i,
2016
+ argumentName: s
2017
+ }) : this.node(t, {
2018
+ kind: p.MEMBER_COORDINATE,
2019
+ name: r,
2020
+ memberName: i
2021
+ }) : this.node(t, {
2022
+ kind: p.TYPE_COORDINATE,
2023
+ name: r
2024
+ });
2025
+ }
1908
2026
  // Core parsing utility functions
1909
2027
  /**
1910
2028
  * Returns a node that, if configured to do so, sets a "loc" field as a
@@ -1912,7 +2030,7 @@ class xt {
1912
2030
  * given parsed object.
1913
2031
  */
1914
2032
  node(t, n) {
1915
- return this._options.noLocation !== !0 && (n.loc = new We(
2033
+ return this._options.noLocation !== !0 && (n.loc = new ut(
1916
2034
  t,
1917
2035
  this._lexer.lastToken,
1918
2036
  this._lexer.source
@@ -1932,10 +2050,10 @@ class xt {
1932
2050
  const n = this._lexer.token;
1933
2051
  if (n.kind === t)
1934
2052
  return this.advanceLexer(), n;
1935
- throw R(
2053
+ throw P(
1936
2054
  this._lexer.source,
1937
2055
  n.start,
1938
- `Expected ${qe(t)}, found ${K(n)}.`
2056
+ `Expected ${Ge(t)}, found ${K(n)}.`
1939
2057
  );
1940
2058
  }
1941
2059
  /**
@@ -1954,7 +2072,7 @@ class xt {
1954
2072
  if (n.kind === u.NAME && n.value === t)
1955
2073
  this.advanceLexer();
1956
2074
  else
1957
- throw R(
2075
+ throw P(
1958
2076
  this._lexer.source,
1959
2077
  n.start,
1960
2078
  `Expected "${t}", found ${K(n)}.`
@@ -1973,7 +2091,7 @@ class xt {
1973
2091
  */
1974
2092
  unexpected(t) {
1975
2093
  const n = t ?? this._lexer.token;
1976
- return R(
2094
+ return P(
1977
2095
  this._lexer.source,
1978
2096
  n.start,
1979
2097
  `Unexpected ${K(n)}.`
@@ -2035,8 +2153,8 @@ class xt {
2035
2153
  }
2036
2154
  advanceLexer() {
2037
2155
  const { maxTokens: t } = this._options, n = this._lexer.advance();
2038
- if (t !== void 0 && n.kind !== u.EOF && (++this._tokenCounter, this._tokenCounter > t))
2039
- throw R(
2156
+ if (n.kind !== u.EOF && (++this._tokenCounter, t !== void 0 && this._tokenCounter > t))
2157
+ throw P(
2040
2158
  this._lexer.source,
2041
2159
  n.start,
2042
2160
  `Document contains more that ${t} tokens. Parsing aborted.`
@@ -2045,19 +2163,19 @@ class xt {
2045
2163
  }
2046
2164
  function K(e) {
2047
2165
  const t = e.value;
2048
- return qe(e.kind) + (t != null ? ` "${t}"` : "");
2166
+ return Ge(e.kind) + (t != null ? ` "${t}"` : "");
2049
2167
  }
2050
- function qe(e) {
2051
- return at(e) ? `"${e}"` : e;
2168
+ function Ge(e) {
2169
+ return ft(e) ? `"${e}"` : e;
2052
2170
  }
2053
- function St(e) {
2054
- return `"${e.replace(Rt, Ot)}"`;
2171
+ function wt(e) {
2172
+ return `"${e.replace(Mt, qt)}"`;
2055
2173
  }
2056
- const Rt = /[\x00-\x1f\x22\x5c\x7f-\x9f]/g;
2057
- function Ot(e) {
2058
- return Nt[e.charCodeAt(0)];
2174
+ const Mt = /[\x00-\x1f\x22\x5c\x7f-\x9f]/g;
2175
+ function qt(e) {
2176
+ return Bt[e.charCodeAt(0)];
2059
2177
  }
2060
- const Nt = [
2178
+ const Bt = [
2061
2179
  "\\u0000",
2062
2180
  "\\u0001",
2063
2181
  "\\u0002",
@@ -2223,75 +2341,72 @@ const Nt = [
2223
2341
  "\\u009D",
2224
2342
  "\\u009E",
2225
2343
  "\\u009F"
2226
- ], Pt = Object.freeze({});
2227
- function Dt(e, t, n = be) {
2344
+ ], Ft = Object.freeze({});
2345
+ function Ut(e, t, n = Le) {
2228
2346
  const r = /* @__PURE__ */ new Map();
2229
- for (const D of Object.values(m))
2230
- r.set(D, bt(t, D));
2231
- let i, s = Array.isArray(e), a = [e], c = -1, p = [], h = e, f, C;
2232
- const y = [], I = [];
2347
+ for (const b of Object.values(p))
2348
+ r.set(b, Vt(t, b));
2349
+ let i, s = Array.isArray(e), a = [e], c = -1, l = [], m = e, f, A;
2350
+ const C = [], R = [];
2233
2351
  do {
2234
2352
  c++;
2235
- const D = c === a.length, z = D && p.length !== 0;
2236
- if (D) {
2237
- if (f = I.length === 0 ? void 0 : y[y.length - 1], h = C, C = I.pop(), z)
2353
+ const b = c === a.length, Q = b && l.length !== 0;
2354
+ if (b) {
2355
+ if (f = R.length === 0 ? void 0 : C[C.length - 1], m = A, A = R.pop(), Q)
2238
2356
  if (s) {
2239
- h = h.slice();
2240
- let b = 0;
2241
- for (const [M, J] of p) {
2242
- const Q = M - b;
2243
- J === null ? (h.splice(Q, 1), b++) : h[Q] = J;
2357
+ m = m.slice();
2358
+ let w = 0;
2359
+ for (const [F, $] of l) {
2360
+ const J = F - w;
2361
+ $ === null ? (m.splice(J, 1), w++) : m[J] = $;
2244
2362
  }
2245
2363
  } else {
2246
- h = Object.defineProperties(
2247
- {},
2248
- Object.getOwnPropertyDescriptors(h)
2249
- );
2250
- for (const [b, M] of p)
2251
- h[b] = M;
2364
+ m = { ...m };
2365
+ for (const [w, F] of l)
2366
+ m[w] = F;
2252
2367
  }
2253
- c = i.index, a = i.keys, p = i.edits, s = i.inArray, i = i.prev;
2254
- } else if (C) {
2255
- if (f = s ? c : a[c], h = C[f], h == null)
2368
+ c = i.index, a = i.keys, l = i.edits, s = i.inArray, i = i.prev;
2369
+ } else if (A) {
2370
+ if (f = s ? c : a[c], m = A[f], m == null)
2256
2371
  continue;
2257
- y.push(f);
2372
+ C.push(f);
2258
2373
  }
2259
- let _;
2260
- if (!Array.isArray(h)) {
2261
- var g, T;
2262
- xe(h) || Z(!1, `Invalid AST Node: ${Ee(h)}.`);
2263
- const b = D ? (g = r.get(h.kind)) === null || g === void 0 ? void 0 : g.leave : (T = r.get(h.kind)) === null || T === void 0 ? void 0 : T.enter;
2264
- if (_ = b == null ? void 0 : b.call(t, h, f, C, y, I), _ === Pt)
2374
+ let L;
2375
+ if (!Array.isArray(m)) {
2376
+ var I, y;
2377
+ xe(m) || ee(!1, `Invalid AST Node: ${Te(m)}.`);
2378
+ const w = b ? (I = r.get(m.kind)) === null || I === void 0 ? void 0 : I.leave : (y = r.get(m.kind)) === null || y === void 0 ? void 0 : y.enter;
2379
+ if (L = w == null ? void 0 : w.call(t, m, f, A, C, R), L === Ft)
2265
2380
  break;
2266
- if (_ === !1) {
2267
- if (!D) {
2268
- y.pop();
2381
+ if (L === !1) {
2382
+ if (!b) {
2383
+ C.pop();
2269
2384
  continue;
2270
2385
  }
2271
- } else if (_ !== void 0 && (p.push([f, _]), !D))
2272
- if (xe(_))
2273
- h = _;
2386
+ } else if (L !== void 0 && (l.push([f, L]), !b))
2387
+ if (xe(L))
2388
+ m = L;
2274
2389
  else {
2275
- y.pop();
2390
+ C.pop();
2276
2391
  continue;
2277
2392
  }
2278
2393
  }
2279
- if (_ === void 0 && z && p.push([f, h]), D)
2280
- y.pop();
2394
+ if (L === void 0 && Q && l.push([f, m]), b)
2395
+ C.pop();
2281
2396
  else {
2282
- var P;
2397
+ var N;
2283
2398
  i = {
2284
2399
  inArray: s,
2285
2400
  index: c,
2286
2401
  keys: a,
2287
- edits: p,
2402
+ edits: l,
2288
2403
  prev: i
2289
- }, s = Array.isArray(h), a = s ? h : (P = n[h.kind]) !== null && P !== void 0 ? P : [], c = -1, p = [], C && I.push(C), C = h;
2404
+ }, s = Array.isArray(m), a = s ? m : (N = n[m.kind]) !== null && N !== void 0 ? N : [], c = -1, l = [], A && R.push(A), A = m;
2290
2405
  }
2291
2406
  } while (i !== void 0);
2292
- return p.length !== 0 ? p[p.length - 1][1] : e;
2407
+ return l.length !== 0 ? l[l.length - 1][1] : e;
2293
2408
  }
2294
- function bt(e, t) {
2409
+ function Vt(e, t) {
2295
2410
  const n = e[t];
2296
2411
  return typeof n == "object" ? n : typeof n == "function" ? {
2297
2412
  enter: n,
@@ -2301,10 +2416,10 @@ function bt(e, t) {
2301
2416
  leave: e.leave
2302
2417
  };
2303
2418
  }
2304
- function kt(e) {
2305
- return Dt(e, Lt);
2419
+ function Gt(e) {
2420
+ return Ut(e, jt);
2306
2421
  }
2307
- const _t = 80, Lt = {
2422
+ const $t = 80, jt = {
2308
2423
  Name: {
2309
2424
  leave: (e) => e.value
2310
2425
  },
@@ -2313,17 +2428,21 @@ const _t = 80, Lt = {
2313
2428
  },
2314
2429
  // Document
2315
2430
  Document: {
2316
- leave: (e) => d(e.definitions, `
2431
+ leave: (e) => h(e.definitions, `
2317
2432
 
2318
2433
  `)
2319
2434
  },
2320
2435
  OperationDefinition: {
2321
2436
  leave(e) {
2322
- const t = A("(", d(e.variableDefinitions, ", "), ")"), n = d(
2437
+ const t = he(e.variableDefinitions) ? g(`(
2438
+ `, h(e.variableDefinitions, `
2439
+ `), `
2440
+ )`) : g("(", h(e.variableDefinitions, ", "), ")"), n = g("", e.description, `
2441
+ `) + h(
2323
2442
  [
2324
2443
  e.operation,
2325
- d([e.name, t]),
2326
- d(e.directives, " ")
2444
+ h([e.name, t]),
2445
+ h(e.directives, " ")
2327
2446
  ],
2328
2447
  " "
2329
2448
  );
@@ -2331,19 +2450,20 @@ const _t = 80, Lt = {
2331
2450
  }
2332
2451
  },
2333
2452
  VariableDefinition: {
2334
- leave: ({ variable: e, type: t, defaultValue: n, directives: r }) => e + ": " + t + A(" = ", n) + A(" ", d(r, " "))
2453
+ leave: ({ variable: e, type: t, defaultValue: n, directives: r, description: i }) => g("", i, `
2454
+ `) + e + ": " + t + g(" = ", n) + g(" ", h(r, " "))
2335
2455
  },
2336
2456
  SelectionSet: {
2337
- leave: ({ selections: e }) => k(e)
2457
+ leave: ({ selections: e }) => _(e)
2338
2458
  },
2339
2459
  Field: {
2340
2460
  leave({ alias: e, name: t, arguments: n, directives: r, selectionSet: i }) {
2341
- const s = A("", e, ": ") + t;
2342
- let a = s + A("(", d(n, ", "), ")");
2343
- return a.length > _t && (a = s + A(`(
2344
- `, W(d(n, `
2461
+ const s = g("", e, ": ") + t;
2462
+ let a = s + g("(", h(n, ", "), ")");
2463
+ return a.length > $t && (a = s + g(`(
2464
+ `, te(h(n, `
2345
2465
  `)), `
2346
- )`)), d([a, d(r, " "), i], " ");
2466
+ )`)), h([a, h(r, " "), i], " ");
2347
2467
  }
2348
2468
  },
2349
2469
  Argument: {
@@ -2351,24 +2471,31 @@ const _t = 80, Lt = {
2351
2471
  },
2352
2472
  // Fragments
2353
2473
  FragmentSpread: {
2354
- leave: ({ name: e, directives: t }) => "..." + e + A(" ", d(t, " "))
2474
+ leave: ({ name: e, directives: t }) => "..." + e + g(" ", h(t, " "))
2355
2475
  },
2356
2476
  InlineFragment: {
2357
- leave: ({ typeCondition: e, directives: t, selectionSet: n }) => d(
2477
+ leave: ({ typeCondition: e, directives: t, selectionSet: n }) => h(
2358
2478
  [
2359
2479
  "...",
2360
- A("on ", e),
2361
- d(t, " "),
2480
+ g("on ", e),
2481
+ h(t, " "),
2362
2482
  n
2363
2483
  ],
2364
2484
  " "
2365
2485
  )
2366
2486
  },
2367
2487
  FragmentDefinition: {
2368
- leave: ({ name: e, typeCondition: t, variableDefinitions: n, directives: r, selectionSet: i }) => (
2369
- // or removed in the future.
2370
- `fragment ${e}${A("(", d(n, ", "), ")")} on ${t} ${A("", d(r, " "), " ")}` + i
2371
- )
2488
+ leave: ({
2489
+ name: e,
2490
+ typeCondition: t,
2491
+ variableDefinitions: n,
2492
+ directives: r,
2493
+ selectionSet: i,
2494
+ description: s
2495
+ }) => g("", s, `
2496
+ `) + // Note: fragment variable definitions are experimental and may be changed
2497
+ // or removed in the future.
2498
+ `fragment ${e}${g("(", h(n, ", "), ")")} on ${t} ${g("", h(r, " "), " ")}` + i
2372
2499
  },
2373
2500
  // Value
2374
2501
  IntValue: {
@@ -2378,7 +2505,7 @@ const _t = 80, Lt = {
2378
2505
  leave: ({ value: e }) => e
2379
2506
  },
2380
2507
  StringValue: {
2381
- leave: ({ value: e, block: t }) => t ? rt(e) : St(e)
2508
+ leave: ({ value: e, block: t }) => t ? pt(e) : wt(e)
2382
2509
  },
2383
2510
  BooleanValue: {
2384
2511
  leave: ({ value: e }) => e ? "true" : "false"
@@ -2390,17 +2517,17 @@ const _t = 80, Lt = {
2390
2517
  leave: ({ value: e }) => e
2391
2518
  },
2392
2519
  ListValue: {
2393
- leave: ({ values: e }) => "[" + d(e, ", ") + "]"
2520
+ leave: ({ values: e }) => "[" + h(e, ", ") + "]"
2394
2521
  },
2395
2522
  ObjectValue: {
2396
- leave: ({ fields: e }) => "{" + d(e, ", ") + "}"
2523
+ leave: ({ fields: e }) => "{" + h(e, ", ") + "}"
2397
2524
  },
2398
2525
  ObjectField: {
2399
2526
  leave: ({ name: e, value: t }) => e + ": " + t
2400
2527
  },
2401
2528
  // Directive
2402
2529
  Directive: {
2403
- leave: ({ name: e, arguments: t }) => "@" + e + A("(", d(t, ", "), ")")
2530
+ leave: ({ name: e, arguments: t }) => "@" + e + g("(", h(t, ", "), ")")
2404
2531
  },
2405
2532
  // Type
2406
2533
  NamedType: {
@@ -2414,175 +2541,737 @@ const _t = 80, Lt = {
2414
2541
  },
2415
2542
  // Type System Definitions
2416
2543
  SchemaDefinition: {
2417
- leave: ({ description: e, directives: t, operationTypes: n }) => A("", e, `
2418
- `) + d(["schema", d(t, " "), k(n)], " ")
2544
+ leave: ({ description: e, directives: t, operationTypes: n }) => g("", e, `
2545
+ `) + h(["schema", h(t, " "), _(n)], " ")
2419
2546
  },
2420
2547
  OperationTypeDefinition: {
2421
2548
  leave: ({ operation: e, type: t }) => e + ": " + t
2422
2549
  },
2423
2550
  ScalarTypeDefinition: {
2424
- leave: ({ description: e, name: t, directives: n }) => A("", e, `
2425
- `) + d(["scalar", t, d(n, " ")], " ")
2551
+ leave: ({ description: e, name: t, directives: n }) => g("", e, `
2552
+ `) + h(["scalar", t, h(n, " ")], " ")
2426
2553
  },
2427
2554
  ObjectTypeDefinition: {
2428
- leave: ({ description: e, name: t, interfaces: n, directives: r, fields: i }) => A("", e, `
2429
- `) + d(
2555
+ leave: ({ description: e, name: t, interfaces: n, directives: r, fields: i }) => g("", e, `
2556
+ `) + h(
2430
2557
  [
2431
2558
  "type",
2432
2559
  t,
2433
- A("implements ", d(n, " & ")),
2434
- d(r, " "),
2435
- k(i)
2560
+ g("implements ", h(n, " & ")),
2561
+ h(r, " "),
2562
+ _(i)
2436
2563
  ],
2437
2564
  " "
2438
2565
  )
2439
2566
  },
2440
2567
  FieldDefinition: {
2441
- leave: ({ description: e, name: t, arguments: n, type: r, directives: i }) => A("", e, `
2442
- `) + t + (Re(n) ? A(`(
2443
- `, W(d(n, `
2568
+ leave: ({ description: e, name: t, arguments: n, type: r, directives: i }) => g("", e, `
2569
+ `) + t + (he(n) ? g(`(
2570
+ `, te(h(n, `
2444
2571
  `)), `
2445
- )`) : A("(", d(n, ", "), ")")) + ": " + r + A(" ", d(i, " "))
2572
+ )`) : g("(", h(n, ", "), ")")) + ": " + r + g(" ", h(i, " "))
2446
2573
  },
2447
2574
  InputValueDefinition: {
2448
- leave: ({ description: e, name: t, type: n, defaultValue: r, directives: i }) => A("", e, `
2449
- `) + d(
2450
- [t + ": " + n, A("= ", r), d(i, " ")],
2575
+ leave: ({ description: e, name: t, type: n, defaultValue: r, directives: i }) => g("", e, `
2576
+ `) + h(
2577
+ [t + ": " + n, g("= ", r), h(i, " ")],
2451
2578
  " "
2452
2579
  )
2453
2580
  },
2454
2581
  InterfaceTypeDefinition: {
2455
- leave: ({ description: e, name: t, interfaces: n, directives: r, fields: i }) => A("", e, `
2456
- `) + d(
2582
+ leave: ({ description: e, name: t, interfaces: n, directives: r, fields: i }) => g("", e, `
2583
+ `) + h(
2457
2584
  [
2458
2585
  "interface",
2459
2586
  t,
2460
- A("implements ", d(n, " & ")),
2461
- d(r, " "),
2462
- k(i)
2587
+ g("implements ", h(n, " & ")),
2588
+ h(r, " "),
2589
+ _(i)
2463
2590
  ],
2464
2591
  " "
2465
2592
  )
2466
2593
  },
2467
2594
  UnionTypeDefinition: {
2468
- leave: ({ description: e, name: t, directives: n, types: r }) => A("", e, `
2469
- `) + d(
2470
- ["union", t, d(n, " "), A("= ", d(r, " | "))],
2595
+ leave: ({ description: e, name: t, directives: n, types: r }) => g("", e, `
2596
+ `) + h(
2597
+ ["union", t, h(n, " "), g("= ", h(r, " | "))],
2471
2598
  " "
2472
2599
  )
2473
2600
  },
2474
2601
  EnumTypeDefinition: {
2475
- leave: ({ description: e, name: t, directives: n, values: r }) => A("", e, `
2476
- `) + d(["enum", t, d(n, " "), k(r)], " ")
2602
+ leave: ({ description: e, name: t, directives: n, values: r }) => g("", e, `
2603
+ `) + h(["enum", t, h(n, " "), _(r)], " ")
2477
2604
  },
2478
2605
  EnumValueDefinition: {
2479
- leave: ({ description: e, name: t, directives: n }) => A("", e, `
2480
- `) + d([t, d(n, " ")], " ")
2606
+ leave: ({ description: e, name: t, directives: n }) => g("", e, `
2607
+ `) + h([t, h(n, " ")], " ")
2481
2608
  },
2482
2609
  InputObjectTypeDefinition: {
2483
- leave: ({ description: e, name: t, directives: n, fields: r }) => A("", e, `
2484
- `) + d(["input", t, d(n, " "), k(r)], " ")
2610
+ leave: ({ description: e, name: t, directives: n, fields: r }) => g("", e, `
2611
+ `) + h(["input", t, h(n, " "), _(r)], " ")
2485
2612
  },
2486
2613
  DirectiveDefinition: {
2487
- leave: ({ description: e, name: t, arguments: n, repeatable: r, locations: i }) => A("", e, `
2488
- `) + "directive @" + t + (Re(n) ? A(`(
2489
- `, W(d(n, `
2614
+ leave: ({ description: e, name: t, arguments: n, repeatable: r, locations: i }) => g("", e, `
2615
+ `) + "directive @" + t + (he(n) ? g(`(
2616
+ `, te(h(n, `
2490
2617
  `)), `
2491
- )`) : A("(", d(n, ", "), ")")) + (r ? " repeatable" : "") + " on " + d(i, " | ")
2618
+ )`) : g("(", h(n, ", "), ")")) + (r ? " repeatable" : "") + " on " + h(i, " | ")
2492
2619
  },
2493
2620
  SchemaExtension: {
2494
- leave: ({ directives: e, operationTypes: t }) => d(
2495
- ["extend schema", d(e, " "), k(t)],
2621
+ leave: ({ directives: e, operationTypes: t }) => h(
2622
+ ["extend schema", h(e, " "), _(t)],
2496
2623
  " "
2497
2624
  )
2498
2625
  },
2499
2626
  ScalarTypeExtension: {
2500
- leave: ({ name: e, directives: t }) => d(["extend scalar", e, d(t, " ")], " ")
2627
+ leave: ({ name: e, directives: t }) => h(["extend scalar", e, h(t, " ")], " ")
2501
2628
  },
2502
2629
  ObjectTypeExtension: {
2503
- leave: ({ name: e, interfaces: t, directives: n, fields: r }) => d(
2630
+ leave: ({ name: e, interfaces: t, directives: n, fields: r }) => h(
2504
2631
  [
2505
2632
  "extend type",
2506
2633
  e,
2507
- A("implements ", d(t, " & ")),
2508
- d(n, " "),
2509
- k(r)
2634
+ g("implements ", h(t, " & ")),
2635
+ h(n, " "),
2636
+ _(r)
2510
2637
  ],
2511
2638
  " "
2512
2639
  )
2513
2640
  },
2514
2641
  InterfaceTypeExtension: {
2515
- leave: ({ name: e, interfaces: t, directives: n, fields: r }) => d(
2642
+ leave: ({ name: e, interfaces: t, directives: n, fields: r }) => h(
2516
2643
  [
2517
2644
  "extend interface",
2518
2645
  e,
2519
- A("implements ", d(t, " & ")),
2520
- d(n, " "),
2521
- k(r)
2646
+ g("implements ", h(t, " & ")),
2647
+ h(n, " "),
2648
+ _(r)
2522
2649
  ],
2523
2650
  " "
2524
2651
  )
2525
2652
  },
2526
2653
  UnionTypeExtension: {
2527
- leave: ({ name: e, directives: t, types: n }) => d(
2654
+ leave: ({ name: e, directives: t, types: n }) => h(
2528
2655
  [
2529
2656
  "extend union",
2530
2657
  e,
2531
- d(t, " "),
2532
- A("= ", d(n, " | "))
2658
+ h(t, " "),
2659
+ g("= ", h(n, " | "))
2533
2660
  ],
2534
2661
  " "
2535
2662
  )
2536
2663
  },
2537
2664
  EnumTypeExtension: {
2538
- leave: ({ name: e, directives: t, values: n }) => d(["extend enum", e, d(t, " "), k(n)], " ")
2665
+ leave: ({ name: e, directives: t, values: n }) => h(["extend enum", e, h(t, " "), _(n)], " ")
2539
2666
  },
2540
2667
  InputObjectTypeExtension: {
2541
- leave: ({ name: e, directives: t, fields: n }) => d(["extend input", e, d(t, " "), k(n)], " ")
2668
+ leave: ({ name: e, directives: t, fields: n }) => h(["extend input", e, h(t, " "), _(n)], " ")
2669
+ },
2670
+ // Schema Coordinates
2671
+ TypeCoordinate: {
2672
+ leave: ({ name: e }) => e
2673
+ },
2674
+ MemberCoordinate: {
2675
+ leave: ({ name: e, memberName: t }) => h([e, g(".", t)])
2676
+ },
2677
+ ArgumentCoordinate: {
2678
+ leave: ({ name: e, fieldName: t, argumentName: n }) => h([e, g(".", t), g("(", n, ":)")])
2679
+ },
2680
+ DirectiveCoordinate: {
2681
+ leave: ({ name: e }) => h(["@", e])
2682
+ },
2683
+ DirectiveArgumentCoordinate: {
2684
+ leave: ({ name: e, argumentName: t }) => h(["@", e, g("(", t, ":)")])
2542
2685
  }
2543
2686
  };
2544
- function d(e, t = "") {
2687
+ function h(e, t = "") {
2545
2688
  var n;
2546
2689
  return (n = e == null ? void 0 : e.filter((r) => r).join(t)) !== null && n !== void 0 ? n : "";
2547
2690
  }
2548
- function k(e) {
2549
- return A(`{
2550
- `, W(d(e, `
2691
+ function _(e) {
2692
+ return g(`{
2693
+ `, te(h(e, `
2551
2694
  `)), `
2552
2695
  }`);
2553
2696
  }
2554
- function A(e, t, n = "") {
2697
+ function g(e, t, n = "") {
2555
2698
  return t != null && t !== "" ? e + t + n : "";
2556
2699
  }
2557
- function W(e) {
2558
- return A(" ", e.replace(/\n/g, `
2700
+ function te(e) {
2701
+ return g(" ", e.replace(/\n/g, `
2559
2702
  `));
2560
2703
  }
2561
- function Re(e) {
2704
+ function he(e) {
2562
2705
  var t;
2563
2706
  return (t = e == null ? void 0 : e.some((n) => n.includes(`
2564
2707
  `))) !== null && t !== void 0 ? t : !1;
2565
2708
  }
2566
- var ee = /* @__PURE__ */ new Map(), ge = /* @__PURE__ */ new Map(), Ue = !0, ie = !1;
2567
- function Ge(e) {
2709
+ const De = (e) => {
2710
+ var r, i;
2711
+ let t;
2712
+ const n = e.definitions.filter((s) => s.kind === "OperationDefinition");
2713
+ return n.length === 1 && (t = (i = (r = n[0]) == null ? void 0 : r.name) == null ? void 0 : i.value), t;
2714
+ }, pe = (e) => {
2715
+ if (typeof e == "string") {
2716
+ let n;
2717
+ try {
2718
+ const r = Ve(e);
2719
+ n = De(r);
2720
+ } catch {
2721
+ }
2722
+ return { query: e, operationName: n };
2723
+ }
2724
+ const t = De(e);
2725
+ return { query: Gt(e), operationName: t };
2726
+ };
2727
+ class Y extends Error {
2728
+ constructor(t, n) {
2729
+ const r = `${Y.extractMessage(t)}: ${JSON.stringify({
2730
+ response: t,
2731
+ request: n
2732
+ })}`;
2733
+ super(r), Object.setPrototypeOf(this, Y.prototype), this.response = t, this.request = n, typeof Error.captureStackTrace == "function" && Error.captureStackTrace(this, Y);
2734
+ }
2735
+ static extractMessage(t) {
2736
+ var n, r;
2737
+ return ((r = (n = t.errors) == null ? void 0 : n[0]) == null ? void 0 : r.message) ?? `GraphQL Error (Code: ${t.status})`;
2738
+ }
2739
+ }
2740
+ var Z = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
2741
+ function Ht(e) {
2742
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
2743
+ }
2744
+ var W = { exports: {} }, Ne;
2745
+ function Yt() {
2746
+ return Ne || (Ne = 1, (function(e, t) {
2747
+ var n = typeof globalThis < "u" && globalThis || typeof self < "u" && self || typeof Z < "u" && Z, r = (function() {
2748
+ function s() {
2749
+ this.fetch = !1, this.DOMException = n.DOMException;
2750
+ }
2751
+ return s.prototype = n, new s();
2752
+ })();
2753
+ (function(s) {
2754
+ (function(a) {
2755
+ var c = typeof s < "u" && s || typeof self < "u" && self || // eslint-disable-next-line no-undef
2756
+ typeof Z < "u" && Z || {}, l = {
2757
+ searchParams: "URLSearchParams" in c,
2758
+ iterable: "Symbol" in c && "iterator" in Symbol,
2759
+ blob: "FileReader" in c && "Blob" in c && (function() {
2760
+ try {
2761
+ return new Blob(), !0;
2762
+ } catch {
2763
+ return !1;
2764
+ }
2765
+ })(),
2766
+ formData: "FormData" in c,
2767
+ arrayBuffer: "ArrayBuffer" in c
2768
+ };
2769
+ function m(o) {
2770
+ return o && DataView.prototype.isPrototypeOf(o);
2771
+ }
2772
+ if (l.arrayBuffer)
2773
+ var f = [
2774
+ "[object Int8Array]",
2775
+ "[object Uint8Array]",
2776
+ "[object Uint8ClampedArray]",
2777
+ "[object Int16Array]",
2778
+ "[object Uint16Array]",
2779
+ "[object Int32Array]",
2780
+ "[object Uint32Array]",
2781
+ "[object Float32Array]",
2782
+ "[object Float64Array]"
2783
+ ], A = ArrayBuffer.isView || function(o) {
2784
+ return o && f.indexOf(Object.prototype.toString.call(o)) > -1;
2785
+ };
2786
+ function C(o) {
2787
+ if (typeof o != "string" && (o = String(o)), /[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(o) || o === "")
2788
+ throw new TypeError('Invalid character in header field name: "' + o + '"');
2789
+ return o.toLowerCase();
2790
+ }
2791
+ function R(o) {
2792
+ return typeof o != "string" && (o = String(o)), o;
2793
+ }
2794
+ function I(o) {
2795
+ var d = {
2796
+ next: function() {
2797
+ var E = o.shift();
2798
+ return { done: E === void 0, value: E };
2799
+ }
2800
+ };
2801
+ return l.iterable && (d[Symbol.iterator] = function() {
2802
+ return d;
2803
+ }), d;
2804
+ }
2805
+ function y(o) {
2806
+ this.map = {}, o instanceof y ? o.forEach(function(d, E) {
2807
+ this.append(E, d);
2808
+ }, this) : Array.isArray(o) ? o.forEach(function(d) {
2809
+ if (d.length != 2)
2810
+ throw new TypeError("Headers constructor: expected name/value pair to be length 2, found" + d.length);
2811
+ this.append(d[0], d[1]);
2812
+ }, this) : o && Object.getOwnPropertyNames(o).forEach(function(d) {
2813
+ this.append(d, o[d]);
2814
+ }, this);
2815
+ }
2816
+ y.prototype.append = function(o, d) {
2817
+ o = C(o), d = R(d);
2818
+ var E = this.map[o];
2819
+ this.map[o] = E ? E + ", " + d : d;
2820
+ }, y.prototype.delete = function(o) {
2821
+ delete this.map[C(o)];
2822
+ }, y.prototype.get = function(o) {
2823
+ return o = C(o), this.has(o) ? this.map[o] : null;
2824
+ }, y.prototype.has = function(o) {
2825
+ return this.map.hasOwnProperty(C(o));
2826
+ }, y.prototype.set = function(o, d) {
2827
+ this.map[C(o)] = R(d);
2828
+ }, y.prototype.forEach = function(o, d) {
2829
+ for (var E in this.map)
2830
+ this.map.hasOwnProperty(E) && o.call(d, this.map[E], E, this);
2831
+ }, y.prototype.keys = function() {
2832
+ var o = [];
2833
+ return this.forEach(function(d, E) {
2834
+ o.push(E);
2835
+ }), I(o);
2836
+ }, y.prototype.values = function() {
2837
+ var o = [];
2838
+ return this.forEach(function(d) {
2839
+ o.push(d);
2840
+ }), I(o);
2841
+ }, y.prototype.entries = function() {
2842
+ var o = [];
2843
+ return this.forEach(function(d, E) {
2844
+ o.push([E, d]);
2845
+ }), I(o);
2846
+ }, l.iterable && (y.prototype[Symbol.iterator] = y.prototype.entries);
2847
+ function N(o) {
2848
+ if (!o._noBody) {
2849
+ if (o.bodyUsed)
2850
+ return Promise.reject(new TypeError("Already read"));
2851
+ o.bodyUsed = !0;
2852
+ }
2853
+ }
2854
+ function b(o) {
2855
+ return new Promise(function(d, E) {
2856
+ o.onload = function() {
2857
+ d(o.result);
2858
+ }, o.onerror = function() {
2859
+ E(o.error);
2860
+ };
2861
+ });
2862
+ }
2863
+ function Q(o) {
2864
+ var d = new FileReader(), E = b(d);
2865
+ return d.readAsArrayBuffer(o), E;
2866
+ }
2867
+ function L(o) {
2868
+ var d = new FileReader(), E = b(d), S = /charset=([A-Za-z0-9_-]+)/.exec(o.type), O = S ? S[1] : "utf-8";
2869
+ return d.readAsText(o, O), E;
2870
+ }
2871
+ function w(o) {
2872
+ for (var d = new Uint8Array(o), E = new Array(d.length), S = 0; S < d.length; S++)
2873
+ E[S] = String.fromCharCode(d[S]);
2874
+ return E.join("");
2875
+ }
2876
+ function F(o) {
2877
+ if (o.slice)
2878
+ return o.slice(0);
2879
+ var d = new Uint8Array(o.byteLength);
2880
+ return d.set(new Uint8Array(o)), d.buffer;
2881
+ }
2882
+ function $() {
2883
+ return this.bodyUsed = !1, this._initBody = function(o) {
2884
+ this.bodyUsed = this.bodyUsed, this._bodyInit = o, o ? typeof o == "string" ? this._bodyText = o : l.blob && Blob.prototype.isPrototypeOf(o) ? this._bodyBlob = o : l.formData && FormData.prototype.isPrototypeOf(o) ? this._bodyFormData = o : l.searchParams && URLSearchParams.prototype.isPrototypeOf(o) ? this._bodyText = o.toString() : l.arrayBuffer && l.blob && m(o) ? (this._bodyArrayBuffer = F(o.buffer), this._bodyInit = new Blob([this._bodyArrayBuffer])) : l.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(o) || A(o)) ? this._bodyArrayBuffer = F(o) : this._bodyText = o = Object.prototype.toString.call(o) : (this._noBody = !0, this._bodyText = ""), this.headers.get("content-type") || (typeof o == "string" ? this.headers.set("content-type", "text/plain;charset=UTF-8") : this._bodyBlob && this._bodyBlob.type ? this.headers.set("content-type", this._bodyBlob.type) : l.searchParams && URLSearchParams.prototype.isPrototypeOf(o) && this.headers.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"));
2885
+ }, l.blob && (this.blob = function() {
2886
+ var o = N(this);
2887
+ if (o)
2888
+ return o;
2889
+ if (this._bodyBlob)
2890
+ return Promise.resolve(this._bodyBlob);
2891
+ if (this._bodyArrayBuffer)
2892
+ return Promise.resolve(new Blob([this._bodyArrayBuffer]));
2893
+ if (this._bodyFormData)
2894
+ throw new Error("could not read FormData body as blob");
2895
+ return Promise.resolve(new Blob([this._bodyText]));
2896
+ }), this.arrayBuffer = function() {
2897
+ if (this._bodyArrayBuffer) {
2898
+ var o = N(this);
2899
+ return o || (ArrayBuffer.isView(this._bodyArrayBuffer) ? Promise.resolve(
2900
+ this._bodyArrayBuffer.buffer.slice(
2901
+ this._bodyArrayBuffer.byteOffset,
2902
+ this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength
2903
+ )
2904
+ ) : Promise.resolve(this._bodyArrayBuffer));
2905
+ } else {
2906
+ if (l.blob)
2907
+ return this.blob().then(Q);
2908
+ throw new Error("could not read as ArrayBuffer");
2909
+ }
2910
+ }, this.text = function() {
2911
+ var o = N(this);
2912
+ if (o)
2913
+ return o;
2914
+ if (this._bodyBlob)
2915
+ return L(this._bodyBlob);
2916
+ if (this._bodyArrayBuffer)
2917
+ return Promise.resolve(w(this._bodyArrayBuffer));
2918
+ if (this._bodyFormData)
2919
+ throw new Error("could not read FormData body as text");
2920
+ return Promise.resolve(this._bodyText);
2921
+ }, l.formData && (this.formData = function() {
2922
+ return this.text().then(Ye);
2923
+ }), this.json = function() {
2924
+ return this.text().then(JSON.parse);
2925
+ }, this;
2926
+ }
2927
+ var J = ["CONNECT", "DELETE", "GET", "HEAD", "OPTIONS", "PATCH", "POST", "PUT", "TRACE"];
2928
+ function He(o) {
2929
+ var d = o.toUpperCase();
2930
+ return J.indexOf(d) > -1 ? d : o;
2931
+ }
2932
+ function M(o, d) {
2933
+ if (!(this instanceof M))
2934
+ throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');
2935
+ d = d || {};
2936
+ var E = d.body;
2937
+ if (o instanceof M) {
2938
+ if (o.bodyUsed)
2939
+ throw new TypeError("Already read");
2940
+ this.url = o.url, this.credentials = o.credentials, d.headers || (this.headers = new y(o.headers)), this.method = o.method, this.mode = o.mode, this.signal = o.signal, !E && o._bodyInit != null && (E = o._bodyInit, o.bodyUsed = !0);
2941
+ } else
2942
+ this.url = String(o);
2943
+ if (this.credentials = d.credentials || this.credentials || "same-origin", (d.headers || !this.headers) && (this.headers = new y(d.headers)), this.method = He(d.method || this.method || "GET"), this.mode = d.mode || this.mode || null, this.signal = d.signal || this.signal || (function() {
2944
+ if ("AbortController" in c) {
2945
+ var v = new AbortController();
2946
+ return v.signal;
2947
+ }
2948
+ })(), this.referrer = null, (this.method === "GET" || this.method === "HEAD") && E)
2949
+ throw new TypeError("Body not allowed for GET or HEAD requests");
2950
+ if (this._initBody(E), (this.method === "GET" || this.method === "HEAD") && (d.cache === "no-store" || d.cache === "no-cache")) {
2951
+ var S = /([?&])_=[^&]*/;
2952
+ if (S.test(this.url))
2953
+ this.url = this.url.replace(S, "$1_=" + (/* @__PURE__ */ new Date()).getTime());
2954
+ else {
2955
+ var O = /\?/;
2956
+ this.url += (O.test(this.url) ? "&" : "?") + "_=" + (/* @__PURE__ */ new Date()).getTime();
2957
+ }
2958
+ }
2959
+ }
2960
+ M.prototype.clone = function() {
2961
+ return new M(this, { body: this._bodyInit });
2962
+ };
2963
+ function Ye(o) {
2964
+ var d = new FormData();
2965
+ return o.trim().split("&").forEach(function(E) {
2966
+ if (E) {
2967
+ var S = E.split("="), O = S.shift().replace(/\+/g, " "), v = S.join("=").replace(/\+/g, " ");
2968
+ d.append(decodeURIComponent(O), decodeURIComponent(v));
2969
+ }
2970
+ }), d;
2971
+ }
2972
+ function ze(o) {
2973
+ var d = new y(), E = o.replace(/\r?\n[\t ]+/g, " ");
2974
+ return E.split("\r").map(function(S) {
2975
+ return S.indexOf(`
2976
+ `) === 0 ? S.substr(1, S.length) : S;
2977
+ }).forEach(function(S) {
2978
+ var O = S.split(":"), v = O.shift().trim();
2979
+ if (v) {
2980
+ var X = O.join(":").trim();
2981
+ try {
2982
+ d.append(v, X);
2983
+ } catch (de) {
2984
+ console.warn("Response " + de.message);
2985
+ }
2986
+ }
2987
+ }), d;
2988
+ }
2989
+ $.call(M.prototype);
2990
+ function k(o, d) {
2991
+ if (!(this instanceof k))
2992
+ throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');
2993
+ if (d || (d = {}), this.type = "default", this.status = d.status === void 0 ? 200 : d.status, this.status < 200 || this.status > 599)
2994
+ throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");
2995
+ this.ok = this.status >= 200 && this.status < 300, this.statusText = d.statusText === void 0 ? "" : "" + d.statusText, this.headers = new y(d.headers), this.url = d.url || "", this._initBody(o);
2996
+ }
2997
+ $.call(k.prototype), k.prototype.clone = function() {
2998
+ return new k(this._bodyInit, {
2999
+ status: this.status,
3000
+ statusText: this.statusText,
3001
+ headers: new y(this.headers),
3002
+ url: this.url
3003
+ });
3004
+ }, k.error = function() {
3005
+ var o = new k(null, { status: 200, statusText: "" });
3006
+ return o.ok = !1, o.status = 0, o.type = "error", o;
3007
+ };
3008
+ var Qe = [301, 302, 303, 307, 308];
3009
+ k.redirect = function(o, d) {
3010
+ if (Qe.indexOf(d) === -1)
3011
+ throw new RangeError("Invalid status code");
3012
+ return new k(null, { status: d, headers: { location: o } });
3013
+ }, a.DOMException = c.DOMException;
3014
+ try {
3015
+ new a.DOMException();
3016
+ } catch {
3017
+ a.DOMException = function(d, E) {
3018
+ this.message = d, this.name = E;
3019
+ var S = Error(d);
3020
+ this.stack = S.stack;
3021
+ }, a.DOMException.prototype = Object.create(Error.prototype), a.DOMException.prototype.constructor = a.DOMException;
3022
+ }
3023
+ function ce(o, d) {
3024
+ return new Promise(function(E, S) {
3025
+ var O = new M(o, d);
3026
+ if (O.signal && O.signal.aborted)
3027
+ return S(new a.DOMException("Aborted", "AbortError"));
3028
+ var v = new XMLHttpRequest();
3029
+ function X() {
3030
+ v.abort();
3031
+ }
3032
+ v.onload = function() {
3033
+ var D = {
3034
+ statusText: v.statusText,
3035
+ headers: ze(v.getAllResponseHeaders() || "")
3036
+ };
3037
+ O.url.indexOf("file://") === 0 && (v.status < 200 || v.status > 599) ? D.status = 200 : D.status = v.status, D.url = "responseURL" in v ? v.responseURL : D.headers.get("X-Request-URL");
3038
+ var q = "response" in v ? v.response : v.responseText;
3039
+ setTimeout(function() {
3040
+ E(new k(q, D));
3041
+ }, 0);
3042
+ }, v.onerror = function() {
3043
+ setTimeout(function() {
3044
+ S(new TypeError("Network request failed"));
3045
+ }, 0);
3046
+ }, v.ontimeout = function() {
3047
+ setTimeout(function() {
3048
+ S(new TypeError("Network request timed out"));
3049
+ }, 0);
3050
+ }, v.onabort = function() {
3051
+ setTimeout(function() {
3052
+ S(new a.DOMException("Aborted", "AbortError"));
3053
+ }, 0);
3054
+ };
3055
+ function de(D) {
3056
+ try {
3057
+ return D === "" && c.location.href ? c.location.href : D;
3058
+ } catch {
3059
+ return D;
3060
+ }
3061
+ }
3062
+ if (v.open(O.method, de(O.url), !0), O.credentials === "include" ? v.withCredentials = !0 : O.credentials === "omit" && (v.withCredentials = !1), "responseType" in v && (l.blob ? v.responseType = "blob" : l.arrayBuffer && (v.responseType = "arraybuffer")), d && typeof d.headers == "object" && !(d.headers instanceof y || c.Headers && d.headers instanceof c.Headers)) {
3063
+ var Ie = [];
3064
+ Object.getOwnPropertyNames(d.headers).forEach(function(D) {
3065
+ Ie.push(C(D)), v.setRequestHeader(D, R(d.headers[D]));
3066
+ }), O.headers.forEach(function(D, q) {
3067
+ Ie.indexOf(q) === -1 && v.setRequestHeader(q, D);
3068
+ });
3069
+ } else
3070
+ O.headers.forEach(function(D, q) {
3071
+ v.setRequestHeader(q, D);
3072
+ });
3073
+ O.signal && (O.signal.addEventListener("abort", X), v.onreadystatechange = function() {
3074
+ v.readyState === 4 && O.signal.removeEventListener("abort", X);
3075
+ }), v.send(typeof O._bodyInit > "u" ? null : O._bodyInit);
3076
+ });
3077
+ }
3078
+ return ce.polyfill = !0, c.fetch || (c.fetch = ce, c.Headers = y, c.Request = M, c.Response = k), a.Headers = y, a.Request = M, a.Response = k, a.fetch = ce, Object.defineProperty(a, "__esModule", { value: !0 }), a;
3079
+ })({});
3080
+ })(r), r.fetch.ponyfill = !0, delete r.fetch.polyfill;
3081
+ var i = n.fetch ? n : r;
3082
+ t = i.fetch, t.default = i.fetch, t.fetch = i.fetch, t.Headers = i.Headers, t.Request = i.Request, t.Response = i.Response, e.exports = t;
3083
+ })(W, W.exports)), W.exports;
3084
+ }
3085
+ var re = Yt();
3086
+ const ne = /* @__PURE__ */ Ht(re), zt = /* @__PURE__ */ Ke({
3087
+ __proto__: null,
3088
+ default: ne
3089
+ }, [re]), U = (e) => {
3090
+ let t = {};
3091
+ return e && (typeof Headers < "u" && e instanceof Headers || zt && re.Headers && e instanceof re.Headers ? t = We(e) : Array.isArray(e) ? e.forEach(([n, r]) => {
3092
+ n && r !== void 0 && (t[n] = r);
3093
+ }) : t = e), t;
3094
+ }, be = (e) => e.replace(/([\s,]|#[^\n\r]+)+/g, " ").trim(), Qt = (e) => {
3095
+ if (!Array.isArray(e.query)) {
3096
+ const r = e, i = [`query=${encodeURIComponent(be(r.query))}`];
3097
+ return e.variables && i.push(`variables=${encodeURIComponent(r.jsonSerializer.stringify(r.variables))}`), r.operationName && i.push(`operationName=${encodeURIComponent(r.operationName)}`), i.join("&");
3098
+ }
3099
+ if (typeof e.variables < "u" && !Array.isArray(e.variables))
3100
+ throw new Error("Cannot create query with given variable type, array expected");
3101
+ const t = e, n = e.query.reduce((r, i, s) => (r.push({
3102
+ query: be(i),
3103
+ variables: t.variables ? t.jsonSerializer.stringify(t.variables[s]) : void 0
3104
+ }), r), []);
3105
+ return `query=${encodeURIComponent(t.jsonSerializer.stringify(n))}`;
3106
+ }, Jt = (e) => async (t) => {
3107
+ const { url: n, query: r, variables: i, operationName: s, fetch: a, fetchOptions: c, middleware: l } = t, m = { ...t.headers };
3108
+ let f = "", A;
3109
+ e === "POST" ? (A = Kt(r, i, s, c.jsonSerializer), typeof A == "string" && (m["Content-Type"] = "application/json")) : f = Qt({
3110
+ query: r,
3111
+ variables: i,
3112
+ operationName: s,
3113
+ jsonSerializer: c.jsonSerializer ?? Ae
3114
+ });
3115
+ const C = {
3116
+ method: e,
3117
+ headers: m,
3118
+ body: A,
3119
+ ...c
3120
+ };
3121
+ let R = n, I = C;
3122
+ if (l) {
3123
+ const y = await Promise.resolve(l({ ...C, url: n, operationName: s, variables: i })), { url: N, ...b } = y;
3124
+ R = N, I = b;
3125
+ }
3126
+ return f && (R = `${R}?${f}`), await a(R, I);
3127
+ };
3128
+ class Xt {
3129
+ constructor(t, n = {}) {
3130
+ this.url = t, this.requestConfig = n, this.rawRequest = async (...r) => {
3131
+ const [i, s, a] = r, c = tt(i, s, a), { headers: l, fetch: m = ne, method: f = "POST", requestMiddleware: A, responseMiddleware: C, ...R } = this.requestConfig, { url: I } = this;
3132
+ c.signal !== void 0 && (R.signal = c.signal);
3133
+ const { operationName: y } = pe(c.query);
3134
+ return me({
3135
+ url: I,
3136
+ query: c.query,
3137
+ variables: c.variables,
3138
+ headers: {
3139
+ ...U(fe(l)),
3140
+ ...U(c.requestHeaders)
3141
+ },
3142
+ operationName: y,
3143
+ fetch: m,
3144
+ method: f,
3145
+ fetchOptions: R,
3146
+ middleware: A
3147
+ }).then((N) => (C && C(N), N)).catch((N) => {
3148
+ throw C && C(N), N;
3149
+ });
3150
+ };
3151
+ }
3152
+ async request(t, ...n) {
3153
+ const [r, i] = n, s = et(t, r, i), { headers: a, fetch: c = ne, method: l = "POST", requestMiddleware: m, responseMiddleware: f, ...A } = this.requestConfig, { url: C } = this;
3154
+ s.signal !== void 0 && (A.signal = s.signal);
3155
+ const { query: R, operationName: I } = pe(s.document);
3156
+ return me({
3157
+ url: C,
3158
+ query: R,
3159
+ variables: s.variables,
3160
+ headers: {
3161
+ ...U(fe(a)),
3162
+ ...U(s.requestHeaders)
3163
+ },
3164
+ operationName: I,
3165
+ fetch: c,
3166
+ method: l,
3167
+ fetchOptions: A,
3168
+ middleware: m
3169
+ }).then((y) => (f && f(y), y.data)).catch((y) => {
3170
+ throw f && f(y), y;
3171
+ });
3172
+ }
3173
+ // prettier-ignore
3174
+ batchRequests(t, n) {
3175
+ const r = nt(t, n), { headers: i, ...s } = this.requestConfig;
3176
+ r.signal !== void 0 && (s.signal = r.signal);
3177
+ const a = r.documents.map(({ document: l }) => pe(l).query), c = r.documents.map(({ variables: l }) => l);
3178
+ return me({
3179
+ url: this.url,
3180
+ query: a,
3181
+ // @ts-expect-error TODO reconcile batch variables into system.
3182
+ variables: c,
3183
+ headers: {
3184
+ ...U(fe(i)),
3185
+ ...U(r.requestHeaders)
3186
+ },
3187
+ operationName: void 0,
3188
+ fetch: this.requestConfig.fetch ?? ne,
3189
+ method: this.requestConfig.method || "POST",
3190
+ fetchOptions: s,
3191
+ middleware: this.requestConfig.requestMiddleware
3192
+ }).then((l) => (this.requestConfig.responseMiddleware && this.requestConfig.responseMiddleware(l), l.data)).catch((l) => {
3193
+ throw this.requestConfig.responseMiddleware && this.requestConfig.responseMiddleware(l), l;
3194
+ });
3195
+ }
3196
+ setHeaders(t) {
3197
+ return this.requestConfig.headers = t, this;
3198
+ }
3199
+ /**
3200
+ * Attach a header to the client. All subsequent requests will have this header.
3201
+ */
3202
+ setHeader(t, n) {
3203
+ const { headers: r } = this.requestConfig;
3204
+ return r ? r[t] = n : this.requestConfig.headers = { [t]: n }, this;
3205
+ }
3206
+ /**
3207
+ * Change the client endpoint. All subsequent requests will send to this endpoint.
3208
+ */
3209
+ setEndpoint(t) {
3210
+ return this.url = t, this;
3211
+ }
3212
+ }
3213
+ const me = async (e) => {
3214
+ const { query: t, variables: n, fetchOptions: r } = e, i = Jt(Ze(e.method ?? "post")), s = Array.isArray(e.query), a = await i(e), c = await Zt(a, r.jsonSerializer ?? Ae), l = Array.isArray(c) ? !c.some(({ data: f }) => !f) : !!c.data, m = Array.isArray(c) || !c.errors || Array.isArray(c.errors) && !c.errors.length || r.errorPolicy === "all" || r.errorPolicy === "ignore";
3215
+ if (a.ok && m && l) {
3216
+ const { errors: f, ...A } = (Array.isArray(c), c), C = r.errorPolicy === "ignore" ? A : c;
3217
+ return {
3218
+ ...s ? { data: C } : C,
3219
+ headers: a.headers,
3220
+ status: a.status
3221
+ };
3222
+ } else {
3223
+ const f = typeof c == "string" ? {
3224
+ error: c
3225
+ } : c;
3226
+ throw new Y(
3227
+ // @ts-expect-error TODO
3228
+ { ...f, status: a.status, headers: a.headers },
3229
+ { query: t, variables: n }
3230
+ );
3231
+ }
3232
+ }, Kt = (e, t, n, r) => {
3233
+ const i = r ?? Ae;
3234
+ if (!Array.isArray(e))
3235
+ return i.stringify({ query: e, variables: t, operationName: n });
3236
+ if (typeof t < "u" && !Array.isArray(t))
3237
+ throw new Error("Cannot create request body with given variable type, array expected");
3238
+ const s = e.reduce((a, c, l) => (a.push({ query: c, variables: t ? t[l] : void 0 }), a), []);
3239
+ return i.stringify(s);
3240
+ }, Zt = async (e, t) => {
3241
+ let n;
3242
+ return e.headers.forEach((r, i) => {
3243
+ i.toLowerCase() === "content-type" && (n = r);
3244
+ }), n && (n.toLowerCase().startsWith("application/json") || n.toLowerCase().startsWith("application/graphql+json") || n.toLowerCase().startsWith("application/graphql-response+json")) ? t.parse(await e.text()) : e.text();
3245
+ }, fe = (e) => typeof e == "function" ? e() : e;
3246
+ var se = function() {
3247
+ return se = Object.assign || function(t) {
3248
+ for (var n, r = 1, i = arguments.length; r < i; r++) {
3249
+ n = arguments[r];
3250
+ for (var s in n) Object.prototype.hasOwnProperty.call(n, s) && (t[s] = n[s]);
3251
+ }
3252
+ return t;
3253
+ }, se.apply(this, arguments);
3254
+ };
3255
+ var ie = /* @__PURE__ */ new Map(), Ee = /* @__PURE__ */ new Map(), $e = !0, ae = !1;
3256
+ function je(e) {
2568
3257
  return e.replace(/[\s,]+/g, " ").trim();
2569
3258
  }
2570
- function wt(e) {
2571
- return Ge(e.source.body.substring(e.start, e.end));
3259
+ function Wt(e) {
3260
+ return je(e.source.body.substring(e.start, e.end));
2572
3261
  }
2573
- function Ft(e) {
3262
+ function en(e) {
2574
3263
  var t = /* @__PURE__ */ new Set(), n = [];
2575
3264
  return e.definitions.forEach(function(r) {
2576
3265
  if (r.kind === "FragmentDefinition") {
2577
- var i = r.name.value, s = wt(r.loc), a = ge.get(i);
2578
- a && !a.has(s) ? Ue && console.warn("Warning: fragment with name " + i + ` already exists.
3266
+ var i = r.name.value, s = Wt(r.loc), a = Ee.get(i);
3267
+ a && !a.has(s) ? $e && console.warn("Warning: fragment with name " + i + ` already exists.
2579
3268
  graphql-tag enforces all fragment names across your application to be unique; read more about
2580
- this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`) : a || ge.set(i, a = /* @__PURE__ */ new Set()), a.add(s), t.has(s) || (t.add(s), n.push(r));
3269
+ this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`) : a || Ee.set(i, a = /* @__PURE__ */ new Set()), a.add(s), t.has(s) || (t.add(s), n.push(r));
2581
3270
  } else
2582
3271
  n.push(r);
2583
- }), ne(ne({}, e), { definitions: n });
3272
+ }), se(se({}, e), { definitions: n });
2584
3273
  }
2585
- function Mt(e) {
3274
+ function tn(e) {
2586
3275
  var t = new Set(e.definitions);
2587
3276
  t.forEach(function(r) {
2588
3277
  r.loc && delete r.loc, Object.keys(r).forEach(function(i) {
@@ -2593,52 +3282,52 @@ function Mt(e) {
2593
3282
  var n = e.loc;
2594
3283
  return n && (delete n.startToken, delete n.endToken), e;
2595
3284
  }
2596
- function Bt(e) {
2597
- var t = Ge(e);
2598
- if (!ee.has(t)) {
2599
- var n = Be(e, {
2600
- experimentalFragmentVariables: ie,
2601
- allowLegacyFragmentVariables: ie
3285
+ function nn(e) {
3286
+ var t = je(e);
3287
+ if (!ie.has(t)) {
3288
+ var n = Ve(e, {
3289
+ experimentalFragmentVariables: ae,
3290
+ allowLegacyFragmentVariables: ae
2602
3291
  });
2603
3292
  if (!n || n.kind !== "Document")
2604
3293
  throw new Error("Not a valid GraphQL document.");
2605
- ee.set(t, Mt(Ft(n)));
3294
+ ie.set(t, tn(en(n)));
2606
3295
  }
2607
- return ee.get(t);
3296
+ return ie.get(t);
2608
3297
  }
2609
- function U(e) {
3298
+ function T(e) {
2610
3299
  for (var t = [], n = 1; n < arguments.length; n++)
2611
3300
  t[n - 1] = arguments[n];
2612
3301
  typeof e == "string" && (e = [e]);
2613
3302
  var r = e[0];
2614
3303
  return t.forEach(function(i, s) {
2615
3304
  i && i.kind === "Document" ? r += i.loc.source.body : r += i, r += e[s + 1];
2616
- }), Bt(r);
3305
+ }), nn(r);
2617
3306
  }
2618
- function qt() {
2619
- ee.clear(), ge.clear();
3307
+ function rn() {
3308
+ ie.clear(), Ee.clear();
2620
3309
  }
2621
- function Ut() {
2622
- Ue = !1;
3310
+ function sn() {
3311
+ $e = !1;
2623
3312
  }
2624
- function Gt() {
2625
- ie = !0;
3313
+ function an() {
3314
+ ae = !0;
2626
3315
  }
2627
- function $t() {
2628
- ie = !1;
3316
+ function on() {
3317
+ ae = !1;
2629
3318
  }
2630
- var V = {
2631
- gql: U,
2632
- resetCaches: qt,
2633
- disableFragmentWarnings: Ut,
2634
- enableExperimentalFragmentVariables: Gt,
2635
- disableExperimentalFragmentVariables: $t
3319
+ var j = {
3320
+ gql: T,
3321
+ resetCaches: rn,
3322
+ disableFragmentWarnings: sn,
3323
+ enableExperimentalFragmentVariables: an,
3324
+ disableExperimentalFragmentVariables: on
2636
3325
  };
2637
3326
  (function(e) {
2638
- e.gql = V.gql, e.resetCaches = V.resetCaches, e.disableFragmentWarnings = V.disableFragmentWarnings, e.enableExperimentalFragmentVariables = V.enableExperimentalFragmentVariables, e.disableExperimentalFragmentVariables = V.disableExperimentalFragmentVariables;
2639
- })(U || (U = {}));
2640
- U.default = U;
2641
- const x = U, Vt = x`
3327
+ e.gql = j.gql, e.resetCaches = j.resetCaches, e.disableFragmentWarnings = j.disableFragmentWarnings, e.enableExperimentalFragmentVariables = j.enableExperimentalFragmentVariables, e.disableExperimentalFragmentVariables = j.disableExperimentalFragmentVariables;
3328
+ })(T || (T = {}));
3329
+ T.default = T;
3330
+ const un = T`
2642
3331
  query GetLocationAvailabilities($sku: String!, $first: Int, $after: String, $isReverse: Boolean! = false) {
2643
3332
  locationAvailabilities(
2644
3333
  sku: $sku
@@ -2677,7 +3366,7 @@ const x = U, Vt = x`
2677
3366
  }
2678
3367
  }
2679
3368
  }
2680
- `, jt = x`
3369
+ `, cn = T`
2681
3370
  query GetLocationAvailability($sku: String!, $locationID: ID!) {
2682
3371
  locationAvailability(sku: $sku, locationID: $locationID) {
2683
3372
  location {
@@ -2703,7 +3392,7 @@ const x = U, Vt = x`
2703
3392
  inventoryQuantity
2704
3393
  }
2705
3394
  }
2706
- `, Ht = x`
3395
+ `, dn = T`
2707
3396
  query GetPurchasingCustomerMetafield($namespace: String!, $key: String!) {
2708
3397
  purchasingCustomerMetafield(namespace: $namespace, key: $key) {
2709
3398
  id
@@ -2712,7 +3401,7 @@ const x = U, Vt = x`
2712
3401
  value
2713
3402
  }
2714
3403
  }
2715
- `, Yt = x`
3404
+ `, ln = T`
2716
3405
  query GetPoints {
2717
3406
  purchasingCustomer {
2718
3407
  pointsApproved
@@ -2724,7 +3413,7 @@ const x = U, Vt = x`
2724
3413
  }
2725
3414
  }
2726
3415
  }
2727
- `, zt = x`
3416
+ `, hn = T`
2728
3417
  query GetLocations($first: Int, $after: String, $filter: LocationFilter, $isReverse: Boolean! = false) {
2729
3418
  locations(first: $first, after: $after, filter: $filter, isReverse: $isReverse) {
2730
3419
  nodes {
@@ -2755,7 +3444,7 @@ const x = U, Vt = x`
2755
3444
  }
2756
3445
  }
2757
3446
  }
2758
- `, Jt = x`
3447
+ `, pn = T`
2759
3448
  query GetPurchasingCustomerDiscounts($first: Int, $after: String, $isReverse: Boolean! = false) {
2760
3449
  purchasingCustomer {
2761
3450
  id
@@ -2784,14 +3473,14 @@ const x = U, Vt = x`
2784
3473
  }
2785
3474
  }
2786
3475
  }
2787
- `, Qt = x`
3476
+ `, mn = T`
2788
3477
  query GetPurchasingCustomerDiscountCodeCount {
2789
3478
  purchasingCustomer {
2790
3479
  id
2791
3480
  orderPriceAdjustmentRuleCount
2792
3481
  }
2793
3482
  }
2794
- `, Xt = x`
3483
+ `, fn = T`
2795
3484
  query GetPurchasingCustomerPointChangeActivities($first: Int, $after: String, $isReverse: Boolean! = false, $sortKeys: PointChangeActivitySortKey! = CREATED_AT) {
2796
3485
  purchasingCustomer {
2797
3486
  id
@@ -2851,7 +3540,7 @@ const x = U, Vt = x`
2851
3540
  }
2852
3541
  }
2853
3542
  }
2854
- `, Kt = x`
3543
+ `, gn = T`
2855
3544
  query GetPurchasingCustomerRank {
2856
3545
  purchasingCustomer {
2857
3546
  currentCustomerRank {
@@ -2892,14 +3581,14 @@ const x = U, Vt = x`
2892
3581
  }
2893
3582
  }
2894
3583
  }
2895
- `, Zt = x`
3584
+ `, Cn = T`
2896
3585
  query GetSharingPurchasingCustomerCount {
2897
3586
  purchasingCustomer {
2898
3587
  id
2899
3588
  sharingPurchasingCustomerCount
2900
3589
  }
2901
3590
  }
2902
- `, Wt = x`
3591
+ `, yn = T`
2903
3592
  query GetPurchasingCustomerSharing {
2904
3593
  purchasingCustomer {
2905
3594
  id
@@ -2916,7 +3605,7 @@ const x = U, Vt = x`
2916
3605
  }
2917
3606
  }
2918
3607
  }
2919
- `, en = x`
3608
+ `, En = T`
2920
3609
  query GetProduct($id: String!, $first: Int, $after: String, $isReverse: Boolean! = false, $sortKeys: ProductVariantSortKeys! = CREATED_AT) {
2921
3610
  productByProductShopifyLegacyResourceID(productShopifyLegacyResourceID: $id) {
2922
3611
  id
@@ -2948,14 +3637,14 @@ const x = U, Vt = x`
2948
3637
  }
2949
3638
  }
2950
3639
  }
2951
- `, tn = x`
3640
+ `, An = T`
2952
3641
  query GetHasBackOrderProductVariantsByProductShopifyLegacyResourceID($id: String!) {
2953
3642
  productByProductShopifyLegacyResourceID(productShopifyLegacyResourceID: $id) {
2954
3643
  id
2955
3644
  hasBackOrderProductVariants
2956
3645
  }
2957
3646
  }
2958
- `, nn = x`
3647
+ `, vn = T`
2959
3648
  query GetPointCampaignOrderRuleTargetCustomerRank {
2960
3649
  pointCampaignOrderRuleTargetCustomerRank {
2961
3650
  pointCampaignOrderRule {
@@ -2968,7 +3657,7 @@ const x = U, Vt = x`
2968
3657
  fixedPoint
2969
3658
  }
2970
3659
  }
2971
- `, rn = x`
3660
+ `, Tn = T`
2972
3661
  query GetEstimatedShopifyCartPoint($input: EstimatedShopifyCartPointInput!) {
2973
3662
  estimatedShopifyCartPoint(input: $input) {
2974
3663
  pointsEarning
@@ -2984,7 +3673,7 @@ const x = U, Vt = x`
2984
3673
  }
2985
3674
  }
2986
3675
  }
2987
- `, sn = x`
3676
+ `, In = T`
2988
3677
  query GetEstimatedShopifyCartLineItemPoint($input: EstimatedShopifyCartLineItemPointInput!) {
2989
3678
  estimatedShopifyCartLineItemPoint(input: $input) {
2990
3679
  pointsEarning
@@ -3000,7 +3689,15 @@ const x = U, Vt = x`
3000
3689
  }
3001
3690
  }
3002
3691
  }
3003
- `, an = x`
3692
+ `, Sn = T`
3693
+ query GetPurchasingCustomerSMS {
3694
+ purchasingCustomer {
3695
+ id
3696
+ smsVerified
3697
+ smsVerifiedPhone
3698
+ }
3699
+ }
3700
+ `, Rn = T`
3004
3701
  mutation PurchasingCustomerSendCustomerSharingActivationCode {
3005
3702
  purchasingCustomerSendCustomerSharingActivationCode {
3006
3703
  purchasingCustomer {
@@ -3016,7 +3713,7 @@ const x = U, Vt = x`
3016
3713
  }
3017
3714
  }
3018
3715
  }
3019
- `, on = x`
3716
+ `, On = T`
3020
3717
  mutation PurchasingCustomerActivateCustomerSharing($email: String!, $activationCode: String!) {
3021
3718
  purchasingCustomerActivateCustomerSharing(
3022
3719
  input: {email: $email, activationCode: $activationCode}
@@ -3031,13 +3728,13 @@ const x = U, Vt = x`
3031
3728
  }
3032
3729
  }
3033
3730
  }
3034
- `, un = x`
3731
+ `, xn = T`
3035
3732
  query GetMiles {
3036
3733
  purchasingCustomer {
3037
3734
  miles
3038
3735
  }
3039
3736
  }
3040
- `, cn = x`
3737
+ `, Pn = T`
3041
3738
  query GetPurchasingCustomerMileChangeActivities($first: Int, $after: String, $isReverse: Boolean! = false, $sortKeys: MileChangeActivitySortKey! = CREATED_AT) {
3042
3739
  purchasingCustomer {
3043
3740
  id
@@ -3066,7 +3763,7 @@ const x = U, Vt = x`
3066
3763
  }
3067
3764
  }
3068
3765
  }
3069
- `, ln = x`
3766
+ `, Dn = T`
3070
3767
  query GetMileItems($first: Int, $after: String, $isReverse: Boolean! = false, $sortKeys: ShopifyMileItemSortKey! = CREATED_AT) {
3071
3768
  mileItems(
3072
3769
  first: $first
@@ -3094,7 +3791,7 @@ const x = U, Vt = x`
3094
3791
  }
3095
3792
  }
3096
3793
  }
3097
- `, dn = x`
3794
+ `, Nn = T`
3098
3795
  query GetMileOrders($first: Int, $after: String, $isReverse: Boolean! = false, $sortKeys: MileOrderSortKey! = CREATED_AT) {
3099
3796
  purchasingCustomer {
3100
3797
  id
@@ -3131,7 +3828,7 @@ const x = U, Vt = x`
3131
3828
  }
3132
3829
  }
3133
3830
  }
3134
- `, pn = x`
3831
+ `, bn = T`
3135
3832
  mutation MileItemExchange($mileItemID: ID!) {
3136
3833
  mileItemExchange(input: {mileItemID: $mileItemID}) {
3137
3834
  mileOrder {
@@ -3154,573 +3851,130 @@ const x = U, Vt = x`
3154
3851
  }
3155
3852
  }
3156
3853
  }
3157
- `, hn = (e, t, n, r) => e();
3158
- function mn(e, t = hn) {
3854
+ `, kn = T`
3855
+ mutation PurchasingCustomerSendSMSVerificationCode($phone: String!) {
3856
+ purchasingCustomerSendSMSVerificationCode(input: {phone: $phone}) {
3857
+ purchasingCustomer {
3858
+ id
3859
+ smsVerified
3860
+ smsVerifiedPhone
3861
+ }
3862
+ }
3863
+ }
3864
+ `, _n = T`
3865
+ mutation PurchasingCustomerVerifySMS($phone: String!, $verificationCode: String!) {
3866
+ purchasingCustomerVerifySMS(
3867
+ input: {phone: $phone, verificationCode: $verificationCode}
3868
+ ) {
3869
+ purchasingCustomer {
3870
+ id
3871
+ smsVerified
3872
+ smsVerifiedPhone
3873
+ }
3874
+ }
3875
+ }
3876
+ `, Ln = T`
3877
+ mutation DiscountUsageCreate($orderPriceAdjustmentRuleID: ID!) {
3878
+ shopifyOrderPriceAdjustmentUsageCreate(
3879
+ input: {orderPriceAdjustmentRuleID: $orderPriceAdjustmentRuleID}
3880
+ ) {
3881
+ orderPriceAdjustmentRule {
3882
+ id
3883
+ }
3884
+ }
3885
+ }
3886
+ `, wn = (e, t, n, r) => e();
3887
+ function Mn(e, t = wn) {
3159
3888
  return {
3160
- GetLocationAvailabilities(n, r) {
3161
- return t((i) => e.request(Vt, n, { ...r, ...i }), "GetLocationAvailabilities", "query", n);
3889
+ GetLocationAvailabilities(n, r, i) {
3890
+ return t((s) => e.request({ document: un, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "GetLocationAvailabilities", "query", n);
3891
+ },
3892
+ GetLocationAvailability(n, r, i) {
3893
+ return t((s) => e.request({ document: cn, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "GetLocationAvailability", "query", n);
3162
3894
  },
3163
- GetLocationAvailability(n, r) {
3164
- return t((i) => e.request(jt, n, { ...r, ...i }), "GetLocationAvailability", "query", n);
3895
+ GetPurchasingCustomerMetafield(n, r, i) {
3896
+ return t((s) => e.request({ document: dn, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "GetPurchasingCustomerMetafield", "query", n);
3165
3897
  },
3166
- GetPurchasingCustomerMetafield(n, r) {
3167
- return t((i) => e.request(Ht, n, { ...r, ...i }), "GetPurchasingCustomerMetafield", "query", n);
3898
+ GetPoints(n, r, i) {
3899
+ return t((s) => e.request({ document: ln, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "GetPoints", "query", n);
3168
3900
  },
3169
- GetPoints(n, r) {
3170
- return t((i) => e.request(Yt, n, { ...r, ...i }), "GetPoints", "query", n);
3901
+ GetLocations(n, r, i) {
3902
+ return t((s) => e.request({ document: hn, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "GetLocations", "query", n);
3171
3903
  },
3172
- GetLocations(n, r) {
3173
- return t((i) => e.request(zt, n, { ...r, ...i }), "GetLocations", "query", n);
3904
+ GetPurchasingCustomerDiscounts(n, r, i) {
3905
+ return t((s) => e.request({ document: pn, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "GetPurchasingCustomerDiscounts", "query", n);
3174
3906
  },
3175
- GetPurchasingCustomerDiscounts(n, r) {
3176
- return t((i) => e.request(Jt, n, { ...r, ...i }), "GetPurchasingCustomerDiscounts", "query", n);
3907
+ GetPurchasingCustomerDiscountCodeCount(n, r, i) {
3908
+ return t((s) => e.request({ document: mn, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "GetPurchasingCustomerDiscountCodeCount", "query", n);
3177
3909
  },
3178
- GetPurchasingCustomerDiscountCodeCount(n, r) {
3179
- return t((i) => e.request(Qt, n, { ...r, ...i }), "GetPurchasingCustomerDiscountCodeCount", "query", n);
3910
+ GetPurchasingCustomerPointChangeActivities(n, r, i) {
3911
+ return t((s) => e.request({ document: fn, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "GetPurchasingCustomerPointChangeActivities", "query", n);
3180
3912
  },
3181
- GetPurchasingCustomerPointChangeActivities(n, r) {
3182
- return t((i) => e.request(Xt, n, { ...r, ...i }), "GetPurchasingCustomerPointChangeActivities", "query", n);
3913
+ GetPurchasingCustomerRank(n, r, i) {
3914
+ return t((s) => e.request({ document: gn, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "GetPurchasingCustomerRank", "query", n);
3183
3915
  },
3184
- GetPurchasingCustomerRank(n, r) {
3185
- return t((i) => e.request(Kt, n, { ...r, ...i }), "GetPurchasingCustomerRank", "query", n);
3916
+ GetSharingPurchasingCustomerCount(n, r, i) {
3917
+ return t((s) => e.request({ document: Cn, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "GetSharingPurchasingCustomerCount", "query", n);
3186
3918
  },
3187
- GetSharingPurchasingCustomerCount(n, r) {
3188
- return t((i) => e.request(Zt, n, { ...r, ...i }), "GetSharingPurchasingCustomerCount", "query", n);
3919
+ GetPurchasingCustomerSharing(n, r, i) {
3920
+ return t((s) => e.request({ document: yn, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "GetPurchasingCustomerSharing", "query", n);
3189
3921
  },
3190
- GetPurchasingCustomerSharing(n, r) {
3191
- return t((i) => e.request(Wt, n, { ...r, ...i }), "GetPurchasingCustomerSharing", "query", n);
3922
+ GetProduct(n, r, i) {
3923
+ return t((s) => e.request({ document: En, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "GetProduct", "query", n);
3192
3924
  },
3193
- GetProduct(n, r) {
3194
- return t((i) => e.request(en, n, { ...r, ...i }), "GetProduct", "query", n);
3925
+ GetHasBackOrderProductVariantsByProductShopifyLegacyResourceID(n, r, i) {
3926
+ return t((s) => e.request({ document: An, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "GetHasBackOrderProductVariantsByProductShopifyLegacyResourceID", "query", n);
3195
3927
  },
3196
- GetHasBackOrderProductVariantsByProductShopifyLegacyResourceID(n, r) {
3197
- return t((i) => e.request(tn, n, { ...r, ...i }), "GetHasBackOrderProductVariantsByProductShopifyLegacyResourceID", "query", n);
3928
+ GetPointCampaignOrderRuleTargetCustomerRank(n, r, i) {
3929
+ return t((s) => e.request({ document: vn, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "GetPointCampaignOrderRuleTargetCustomerRank", "query", n);
3198
3930
  },
3199
- GetPointCampaignOrderRuleTargetCustomerRank(n, r) {
3200
- return t((i) => e.request(nn, n, { ...r, ...i }), "GetPointCampaignOrderRuleTargetCustomerRank", "query", n);
3931
+ GetEstimatedShopifyCartPoint(n, r, i) {
3932
+ return t((s) => e.request({ document: Tn, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "GetEstimatedShopifyCartPoint", "query", n);
3201
3933
  },
3202
- GetEstimatedShopifyCartPoint(n, r) {
3203
- return t((i) => e.request(rn, n, { ...r, ...i }), "GetEstimatedShopifyCartPoint", "query", n);
3934
+ GetEstimatedShopifyCartLineItemPoint(n, r, i) {
3935
+ return t((s) => e.request({ document: In, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "GetEstimatedShopifyCartLineItemPoint", "query", n);
3204
3936
  },
3205
- GetEstimatedShopifyCartLineItemPoint(n, r) {
3206
- return t((i) => e.request(sn, n, { ...r, ...i }), "GetEstimatedShopifyCartLineItemPoint", "query", n);
3937
+ GetPurchasingCustomerSMS(n, r, i) {
3938
+ return t((s) => e.request({ document: Sn, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "GetPurchasingCustomerSMS", "query", n);
3207
3939
  },
3208
- PurchasingCustomerSendCustomerSharingActivationCode(n, r) {
3209
- return t((i) => e.request(an, n, { ...r, ...i }), "PurchasingCustomerSendCustomerSharingActivationCode", "mutation", n);
3940
+ PurchasingCustomerSendCustomerSharingActivationCode(n, r, i) {
3941
+ return t((s) => e.request({ document: Rn, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "PurchasingCustomerSendCustomerSharingActivationCode", "mutation", n);
3210
3942
  },
3211
- PurchasingCustomerActivateCustomerSharing(n, r) {
3212
- return t((i) => e.request(on, n, { ...r, ...i }), "PurchasingCustomerActivateCustomerSharing", "mutation", n);
3943
+ PurchasingCustomerActivateCustomerSharing(n, r, i) {
3944
+ return t((s) => e.request({ document: On, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "PurchasingCustomerActivateCustomerSharing", "mutation", n);
3213
3945
  },
3214
- GetMiles(n, r) {
3215
- return t((i) => e.request(un, n, { ...r, ...i }), "GetMiles", "query", n);
3946
+ GetMiles(n, r, i) {
3947
+ return t((s) => e.request({ document: xn, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "GetMiles", "query", n);
3216
3948
  },
3217
- GetPurchasingCustomerMileChangeActivities(n, r) {
3218
- return t((i) => e.request(cn, n, { ...r, ...i }), "GetPurchasingCustomerMileChangeActivities", "query", n);
3949
+ GetPurchasingCustomerMileChangeActivities(n, r, i) {
3950
+ return t((s) => e.request({ document: Pn, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "GetPurchasingCustomerMileChangeActivities", "query", n);
3219
3951
  },
3220
- GetMileItems(n, r) {
3221
- return t((i) => e.request(ln, n, { ...r, ...i }), "GetMileItems", "query", n);
3952
+ GetMileItems(n, r, i) {
3953
+ return t((s) => e.request({ document: Dn, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "GetMileItems", "query", n);
3222
3954
  },
3223
- GetMileOrders(n, r) {
3224
- return t((i) => e.request(dn, n, { ...r, ...i }), "GetMileOrders", "query", n);
3955
+ GetMileOrders(n, r, i) {
3956
+ return t((s) => e.request({ document: Nn, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "GetMileOrders", "query", n);
3225
3957
  },
3226
- MileItemExchange(n, r) {
3227
- return t((i) => e.request(pn, n, { ...r, ...i }), "MileItemExchange", "mutation", n);
3958
+ MileItemExchange(n, r, i) {
3959
+ return t((s) => e.request({ document: bn, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "MileItemExchange", "mutation", n);
3960
+ },
3961
+ PurchasingCustomerSendSMSVerificationCode(n, r, i) {
3962
+ return t((s) => e.request({ document: kn, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "PurchasingCustomerSendSMSVerificationCode", "mutation", n);
3963
+ },
3964
+ PurchasingCustomerVerifySMS(n, r, i) {
3965
+ return t((s) => e.request({ document: _n, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "PurchasingCustomerVerifySMS", "mutation", n);
3966
+ },
3967
+ DiscountUsageCreate(n, r, i) {
3968
+ return t((s) => e.request({ document: Ln, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "DiscountUsageCreate", "mutation", n);
3228
3969
  }
3229
3970
  };
3230
3971
  }
3231
- const Ae = JSON, fn = (e) => e.toUpperCase(), gn = (e) => {
3232
- const t = {};
3233
- return e.forEach((n, r) => {
3234
- t[r] = n;
3235
- }), t;
3236
- }, Cn = (e, t, n) => e.document ? e : {
3237
- document: e,
3238
- variables: t,
3239
- requestHeaders: n,
3240
- signal: void 0
3241
- }, yn = (e, t, n) => e.query ? e : {
3242
- query: e,
3243
- variables: t,
3244
- requestHeaders: n,
3245
- signal: void 0
3246
- }, En = (e, t) => e.documents ? e : {
3247
- documents: e,
3248
- requestHeaders: t,
3249
- signal: void 0
3250
- }, Oe = (e) => {
3251
- var r, i;
3252
- let t;
3253
- const n = e.definitions.filter((s) => s.kind === "OperationDefinition");
3254
- return n.length === 1 && (t = (i = (r = n[0]) == null ? void 0 : r.name) == null ? void 0 : i.value), t;
3255
- }, le = (e) => {
3256
- if (typeof e == "string") {
3257
- let n;
3258
- try {
3259
- const r = Be(e);
3260
- n = Oe(r);
3261
- } catch {
3262
- }
3263
- return { query: e, operationName: n };
3264
- }
3265
- const t = Oe(e);
3266
- return { query: kt(e), operationName: t };
3267
- };
3268
- class H extends Error {
3269
- constructor(t, n) {
3270
- const r = `${H.extractMessage(t)}: ${JSON.stringify({
3271
- response: t,
3272
- request: n
3273
- })}`;
3274
- super(r), Object.setPrototypeOf(this, H.prototype), this.response = t, this.request = n, typeof Error.captureStackTrace == "function" && Error.captureStackTrace(this, H);
3275
- }
3276
- static extractMessage(t) {
3277
- var n, r;
3278
- return ((r = (n = t.errors) == null ? void 0 : n[0]) == null ? void 0 : r.message) ?? `GraphQL Error (Code: ${t.status})`;
3279
- }
3280
- }
3281
- var An = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
3282
- function vn(e) {
3283
- return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
3284
- }
3285
- var Ce = { exports: {} };
3286
- (function(e, t) {
3287
- var n = typeof self < "u" ? self : An, r = function() {
3288
- function s() {
3289
- this.fetch = !1, this.DOMException = n.DOMException;
3290
- }
3291
- return s.prototype = n, new s();
3292
- }();
3293
- (function(s) {
3294
- (function(a) {
3295
- var c = {
3296
- searchParams: "URLSearchParams" in s,
3297
- iterable: "Symbol" in s && "iterator" in Symbol,
3298
- blob: "FileReader" in s && "Blob" in s && function() {
3299
- try {
3300
- return new Blob(), !0;
3301
- } catch {
3302
- return !1;
3303
- }
3304
- }(),
3305
- formData: "FormData" in s,
3306
- arrayBuffer: "ArrayBuffer" in s
3307
- };
3308
- function p(o) {
3309
- return o && DataView.prototype.isPrototypeOf(o);
3310
- }
3311
- if (c.arrayBuffer)
3312
- var h = [
3313
- "[object Int8Array]",
3314
- "[object Uint8Array]",
3315
- "[object Uint8ClampedArray]",
3316
- "[object Int16Array]",
3317
- "[object Uint16Array]",
3318
- "[object Int32Array]",
3319
- "[object Uint32Array]",
3320
- "[object Float32Array]",
3321
- "[object Float64Array]"
3322
- ], f = ArrayBuffer.isView || function(o) {
3323
- return o && h.indexOf(Object.prototype.toString.call(o)) > -1;
3324
- };
3325
- function C(o) {
3326
- if (typeof o != "string" && (o = String(o)), /[^a-z0-9\-#$%&'*+.^_`|~]/i.test(o))
3327
- throw new TypeError("Invalid character in header field name");
3328
- return o.toLowerCase();
3329
- }
3330
- function y(o) {
3331
- return typeof o != "string" && (o = String(o)), o;
3332
- }
3333
- function I(o) {
3334
- var l = {
3335
- next: function() {
3336
- var E = o.shift();
3337
- return { done: E === void 0, value: E };
3338
- }
3339
- };
3340
- return c.iterable && (l[Symbol.iterator] = function() {
3341
- return l;
3342
- }), l;
3343
- }
3344
- function g(o) {
3345
- this.map = {}, o instanceof g ? o.forEach(function(l, E) {
3346
- this.append(E, l);
3347
- }, this) : Array.isArray(o) ? o.forEach(function(l) {
3348
- this.append(l[0], l[1]);
3349
- }, this) : o && Object.getOwnPropertyNames(o).forEach(function(l) {
3350
- this.append(l, o[l]);
3351
- }, this);
3352
- }
3353
- g.prototype.append = function(o, l) {
3354
- o = C(o), l = y(l);
3355
- var E = this.map[o];
3356
- this.map[o] = E ? E + ", " + l : l;
3357
- }, g.prototype.delete = function(o) {
3358
- delete this.map[C(o)];
3359
- }, g.prototype.get = function(o) {
3360
- return o = C(o), this.has(o) ? this.map[o] : null;
3361
- }, g.prototype.has = function(o) {
3362
- return this.map.hasOwnProperty(C(o));
3363
- }, g.prototype.set = function(o, l) {
3364
- this.map[C(o)] = y(l);
3365
- }, g.prototype.forEach = function(o, l) {
3366
- for (var E in this.map)
3367
- this.map.hasOwnProperty(E) && o.call(l, this.map[E], E, this);
3368
- }, g.prototype.keys = function() {
3369
- var o = [];
3370
- return this.forEach(function(l, E) {
3371
- o.push(E);
3372
- }), I(o);
3373
- }, g.prototype.values = function() {
3374
- var o = [];
3375
- return this.forEach(function(l) {
3376
- o.push(l);
3377
- }), I(o);
3378
- }, g.prototype.entries = function() {
3379
- var o = [];
3380
- return this.forEach(function(l, E) {
3381
- o.push([E, l]);
3382
- }), I(o);
3383
- }, c.iterable && (g.prototype[Symbol.iterator] = g.prototype.entries);
3384
- function T(o) {
3385
- if (o.bodyUsed)
3386
- return Promise.reject(new TypeError("Already read"));
3387
- o.bodyUsed = !0;
3388
- }
3389
- function P(o) {
3390
- return new Promise(function(l, E) {
3391
- o.onload = function() {
3392
- l(o.result);
3393
- }, o.onerror = function() {
3394
- E(o.error);
3395
- };
3396
- });
3397
- }
3398
- function D(o) {
3399
- var l = new FileReader(), E = P(l);
3400
- return l.readAsArrayBuffer(o), E;
3401
- }
3402
- function z(o) {
3403
- var l = new FileReader(), E = P(l);
3404
- return l.readAsText(o), E;
3405
- }
3406
- function _(o) {
3407
- for (var l = new Uint8Array(o), E = new Array(l.length), N = 0; N < l.length; N++)
3408
- E[N] = String.fromCharCode(l[N]);
3409
- return E.join("");
3410
- }
3411
- function b(o) {
3412
- if (o.slice)
3413
- return o.slice(0);
3414
- var l = new Uint8Array(o.byteLength);
3415
- return l.set(new Uint8Array(o)), l.buffer;
3416
- }
3417
- function M() {
3418
- return this.bodyUsed = !1, this._initBody = function(o) {
3419
- this._bodyInit = o, o ? typeof o == "string" ? this._bodyText = o : c.blob && Blob.prototype.isPrototypeOf(o) ? this._bodyBlob = o : c.formData && FormData.prototype.isPrototypeOf(o) ? this._bodyFormData = o : c.searchParams && URLSearchParams.prototype.isPrototypeOf(o) ? this._bodyText = o.toString() : c.arrayBuffer && c.blob && p(o) ? (this._bodyArrayBuffer = b(o.buffer), this._bodyInit = new Blob([this._bodyArrayBuffer])) : c.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(o) || f(o)) ? this._bodyArrayBuffer = b(o) : this._bodyText = o = Object.prototype.toString.call(o) : this._bodyText = "", this.headers.get("content-type") || (typeof o == "string" ? this.headers.set("content-type", "text/plain;charset=UTF-8") : this._bodyBlob && this._bodyBlob.type ? this.headers.set("content-type", this._bodyBlob.type) : c.searchParams && URLSearchParams.prototype.isPrototypeOf(o) && this.headers.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"));
3420
- }, c.blob && (this.blob = function() {
3421
- var o = T(this);
3422
- if (o)
3423
- return o;
3424
- if (this._bodyBlob)
3425
- return Promise.resolve(this._bodyBlob);
3426
- if (this._bodyArrayBuffer)
3427
- return Promise.resolve(new Blob([this._bodyArrayBuffer]));
3428
- if (this._bodyFormData)
3429
- throw new Error("could not read FormData body as blob");
3430
- return Promise.resolve(new Blob([this._bodyText]));
3431
- }, this.arrayBuffer = function() {
3432
- return this._bodyArrayBuffer ? T(this) || Promise.resolve(this._bodyArrayBuffer) : this.blob().then(D);
3433
- }), this.text = function() {
3434
- var o = T(this);
3435
- if (o)
3436
- return o;
3437
- if (this._bodyBlob)
3438
- return z(this._bodyBlob);
3439
- if (this._bodyArrayBuffer)
3440
- return Promise.resolve(_(this._bodyArrayBuffer));
3441
- if (this._bodyFormData)
3442
- throw new Error("could not read FormData body as text");
3443
- return Promise.resolve(this._bodyText);
3444
- }, c.formData && (this.formData = function() {
3445
- return this.text().then($e);
3446
- }), this.json = function() {
3447
- return this.text().then(JSON.parse);
3448
- }, this;
3449
- }
3450
- var J = ["DELETE", "GET", "HEAD", "OPTIONS", "POST", "PUT"];
3451
- function Q(o) {
3452
- var l = o.toUpperCase();
3453
- return J.indexOf(l) > -1 ? l : o;
3454
- }
3455
- function w(o, l) {
3456
- l = l || {};
3457
- var E = l.body;
3458
- if (o instanceof w) {
3459
- if (o.bodyUsed)
3460
- throw new TypeError("Already read");
3461
- this.url = o.url, this.credentials = o.credentials, l.headers || (this.headers = new g(o.headers)), this.method = o.method, this.mode = o.mode, this.signal = o.signal, !E && o._bodyInit != null && (E = o._bodyInit, o.bodyUsed = !0);
3462
- } else
3463
- this.url = String(o);
3464
- if (this.credentials = l.credentials || this.credentials || "same-origin", (l.headers || !this.headers) && (this.headers = new g(l.headers)), this.method = Q(l.method || this.method || "GET"), this.mode = l.mode || this.mode || null, this.signal = l.signal || this.signal, this.referrer = null, (this.method === "GET" || this.method === "HEAD") && E)
3465
- throw new TypeError("Body not allowed for GET or HEAD requests");
3466
- this._initBody(E);
3467
- }
3468
- w.prototype.clone = function() {
3469
- return new w(this, { body: this._bodyInit });
3470
- };
3471
- function $e(o) {
3472
- var l = new FormData();
3473
- return o.trim().split("&").forEach(function(E) {
3474
- if (E) {
3475
- var N = E.split("="), O = N.shift().replace(/\+/g, " "), v = N.join("=").replace(/\+/g, " ");
3476
- l.append(decodeURIComponent(O), decodeURIComponent(v));
3477
- }
3478
- }), l;
3479
- }
3480
- function Ve(o) {
3481
- var l = new g(), E = o.replace(/\r?\n[\t ]+/g, " ");
3482
- return E.split(/\r?\n/).forEach(function(N) {
3483
- var O = N.split(":"), v = O.shift().trim();
3484
- if (v) {
3485
- var X = O.join(":").trim();
3486
- l.append(v, X);
3487
- }
3488
- }), l;
3489
- }
3490
- M.call(w.prototype);
3491
- function L(o, l) {
3492
- l || (l = {}), this.type = "default", this.status = l.status === void 0 ? 200 : l.status, this.ok = this.status >= 200 && this.status < 300, this.statusText = "statusText" in l ? l.statusText : "OK", this.headers = new g(l.headers), this.url = l.url || "", this._initBody(o);
3493
- }
3494
- M.call(L.prototype), L.prototype.clone = function() {
3495
- return new L(this._bodyInit, {
3496
- status: this.status,
3497
- statusText: this.statusText,
3498
- headers: new g(this.headers),
3499
- url: this.url
3500
- });
3501
- }, L.error = function() {
3502
- var o = new L(null, { status: 0, statusText: "" });
3503
- return o.type = "error", o;
3504
- };
3505
- var je = [301, 302, 303, 307, 308];
3506
- L.redirect = function(o, l) {
3507
- if (je.indexOf(l) === -1)
3508
- throw new RangeError("Invalid status code");
3509
- return new L(null, { status: l, headers: { location: o } });
3510
- }, a.DOMException = s.DOMException;
3511
- try {
3512
- new a.DOMException();
3513
- } catch {
3514
- a.DOMException = function(l, E) {
3515
- this.message = l, this.name = E;
3516
- var N = Error(l);
3517
- this.stack = N.stack;
3518
- }, a.DOMException.prototype = Object.create(Error.prototype), a.DOMException.prototype.constructor = a.DOMException;
3519
- }
3520
- function oe(o, l) {
3521
- return new Promise(function(E, N) {
3522
- var O = new w(o, l);
3523
- if (O.signal && O.signal.aborted)
3524
- return N(new a.DOMException("Aborted", "AbortError"));
3525
- var v = new XMLHttpRequest();
3526
- function X() {
3527
- v.abort();
3528
- }
3529
- v.onload = function() {
3530
- var $ = {
3531
- status: v.status,
3532
- statusText: v.statusText,
3533
- headers: Ve(v.getAllResponseHeaders() || "")
3534
- };
3535
- $.url = "responseURL" in v ? v.responseURL : $.headers.get("X-Request-URL");
3536
- var ue = "response" in v ? v.response : v.responseText;
3537
- E(new L(ue, $));
3538
- }, v.onerror = function() {
3539
- N(new TypeError("Network request failed"));
3540
- }, v.ontimeout = function() {
3541
- N(new TypeError("Network request failed"));
3542
- }, v.onabort = function() {
3543
- N(new a.DOMException("Aborted", "AbortError"));
3544
- }, v.open(O.method, O.url, !0), O.credentials === "include" ? v.withCredentials = !0 : O.credentials === "omit" && (v.withCredentials = !1), "responseType" in v && c.blob && (v.responseType = "blob"), O.headers.forEach(function($, ue) {
3545
- v.setRequestHeader(ue, $);
3546
- }), O.signal && (O.signal.addEventListener("abort", X), v.onreadystatechange = function() {
3547
- v.readyState === 4 && O.signal.removeEventListener("abort", X);
3548
- }), v.send(typeof O._bodyInit > "u" ? null : O._bodyInit);
3549
- });
3550
- }
3551
- return oe.polyfill = !0, s.fetch || (s.fetch = oe, s.Headers = g, s.Request = w, s.Response = L), a.Headers = g, a.Request = w, a.Response = L, a.fetch = oe, Object.defineProperty(a, "__esModule", { value: !0 }), a;
3552
- })({});
3553
- })(r), r.fetch.ponyfill = !0, delete r.fetch.polyfill;
3554
- var i = r;
3555
- t = i.fetch, t.default = i.fetch, t.fetch = i.fetch, t.Headers = i.Headers, t.Request = i.Request, t.Response = i.Response, e.exports = t;
3556
- })(Ce, Ce.exports);
3557
- var re = Ce.exports;
3558
- const te = /* @__PURE__ */ vn(re), In = /* @__PURE__ */ ze({
3559
- __proto__: null,
3560
- default: te
3561
- }, [re]), B = (e) => {
3562
- let t = {};
3563
- return e && (typeof Headers < "u" && e instanceof Headers || In && re.Headers && e instanceof re.Headers ? t = gn(e) : Array.isArray(e) ? e.forEach(([n, r]) => {
3564
- n && r !== void 0 && (t[n] = r);
3565
- }) : t = e), t;
3566
- }, Ne = (e) => e.replace(/([\s,]|#[^\n\r]+)+/g, " ").trim(), Tn = (e) => {
3567
- if (!Array.isArray(e.query)) {
3568
- const r = e, i = [`query=${encodeURIComponent(Ne(r.query))}`];
3569
- return e.variables && i.push(`variables=${encodeURIComponent(r.jsonSerializer.stringify(r.variables))}`), r.operationName && i.push(`operationName=${encodeURIComponent(r.operationName)}`), i.join("&");
3570
- }
3571
- if (typeof e.variables < "u" && !Array.isArray(e.variables))
3572
- throw new Error("Cannot create query with given variable type, array expected");
3573
- const t = e, n = e.query.reduce((r, i, s) => (r.push({
3574
- query: Ne(i),
3575
- variables: t.variables ? t.jsonSerializer.stringify(t.variables[s]) : void 0
3576
- }), r), []);
3577
- return `query=${encodeURIComponent(t.jsonSerializer.stringify(n))}`;
3578
- }, xn = (e) => async (t) => {
3579
- const { url: n, query: r, variables: i, operationName: s, fetch: a, fetchOptions: c, middleware: p } = t, h = { ...t.headers };
3580
- let f = "", C;
3581
- e === "POST" ? (C = Rn(r, i, s, c.jsonSerializer), typeof C == "string" && (h["Content-Type"] = "application/json")) : f = Tn({
3582
- query: r,
3583
- variables: i,
3584
- operationName: s,
3585
- jsonSerializer: c.jsonSerializer ?? Ae
3586
- });
3587
- const y = {
3588
- method: e,
3589
- headers: h,
3590
- body: C,
3591
- ...c
3592
- };
3593
- let I = n, g = y;
3594
- if (p) {
3595
- const T = await Promise.resolve(p({ ...y, url: n, operationName: s, variables: i })), { url: P, ...D } = T;
3596
- I = P, g = D;
3597
- }
3598
- return f && (I = `${I}?${f}`), await a(I, g);
3599
- };
3600
- class Sn {
3601
- constructor(t, n = {}) {
3602
- this.url = t, this.requestConfig = n, this.rawRequest = async (...r) => {
3603
- const [i, s, a] = r, c = yn(i, s, a), { headers: p, fetch: h = te, method: f = "POST", requestMiddleware: C, responseMiddleware: y, ...I } = this.requestConfig, { url: g } = this;
3604
- c.signal !== void 0 && (I.signal = c.signal);
3605
- const { operationName: T } = le(c.query);
3606
- return de({
3607
- url: g,
3608
- query: c.query,
3609
- variables: c.variables,
3610
- headers: {
3611
- ...B(pe(p)),
3612
- ...B(c.requestHeaders)
3613
- },
3614
- operationName: T,
3615
- fetch: h,
3616
- method: f,
3617
- fetchOptions: I,
3618
- middleware: C
3619
- }).then((P) => (y && y(P), P)).catch((P) => {
3620
- throw y && y(P), P;
3621
- });
3622
- };
3623
- }
3624
- async request(t, ...n) {
3625
- const [r, i] = n, s = Cn(t, r, i), { headers: a, fetch: c = te, method: p = "POST", requestMiddleware: h, responseMiddleware: f, ...C } = this.requestConfig, { url: y } = this;
3626
- s.signal !== void 0 && (C.signal = s.signal);
3627
- const { query: I, operationName: g } = le(s.document);
3628
- return de({
3629
- url: y,
3630
- query: I,
3631
- variables: s.variables,
3632
- headers: {
3633
- ...B(pe(a)),
3634
- ...B(s.requestHeaders)
3635
- },
3636
- operationName: g,
3637
- fetch: c,
3638
- method: p,
3639
- fetchOptions: C,
3640
- middleware: h
3641
- }).then((T) => (f && f(T), T.data)).catch((T) => {
3642
- throw f && f(T), T;
3643
- });
3644
- }
3645
- // prettier-ignore
3646
- batchRequests(t, n) {
3647
- const r = En(t, n), { headers: i, ...s } = this.requestConfig;
3648
- r.signal !== void 0 && (s.signal = r.signal);
3649
- const a = r.documents.map(({ document: p }) => le(p).query), c = r.documents.map(({ variables: p }) => p);
3650
- return de({
3651
- url: this.url,
3652
- query: a,
3653
- // @ts-expect-error TODO reconcile batch variables into system.
3654
- variables: c,
3655
- headers: {
3656
- ...B(pe(i)),
3657
- ...B(r.requestHeaders)
3658
- },
3659
- operationName: void 0,
3660
- fetch: this.requestConfig.fetch ?? te,
3661
- method: this.requestConfig.method || "POST",
3662
- fetchOptions: s,
3663
- middleware: this.requestConfig.requestMiddleware
3664
- }).then((p) => (this.requestConfig.responseMiddleware && this.requestConfig.responseMiddleware(p), p.data)).catch((p) => {
3665
- throw this.requestConfig.responseMiddleware && this.requestConfig.responseMiddleware(p), p;
3666
- });
3667
- }
3668
- setHeaders(t) {
3669
- return this.requestConfig.headers = t, this;
3670
- }
3671
- /**
3672
- * Attach a header to the client. All subsequent requests will have this header.
3673
- */
3674
- setHeader(t, n) {
3675
- const { headers: r } = this.requestConfig;
3676
- return r ? r[t] = n : this.requestConfig.headers = { [t]: n }, this;
3677
- }
3678
- /**
3679
- * Change the client endpoint. All subsequent requests will send to this endpoint.
3680
- */
3681
- setEndpoint(t) {
3682
- return this.url = t, this;
3683
- }
3684
- }
3685
- const de = async (e) => {
3686
- const { query: t, variables: n, fetchOptions: r } = e, i = xn(fn(e.method ?? "post")), s = Array.isArray(e.query), a = await i(e), c = await On(a, r.jsonSerializer ?? Ae), p = Array.isArray(c) ? !c.some(({ data: f }) => !f) : !!c.data, h = Array.isArray(c) || !c.errors || Array.isArray(c.errors) && !c.errors.length || r.errorPolicy === "all" || r.errorPolicy === "ignore";
3687
- if (a.ok && h && p) {
3688
- const { errors: f, ...C } = (Array.isArray(c), c), y = r.errorPolicy === "ignore" ? C : c;
3689
- return {
3690
- ...s ? { data: y } : y,
3691
- headers: a.headers,
3692
- status: a.status
3693
- };
3694
- } else {
3695
- const f = typeof c == "string" ? {
3696
- error: c
3697
- } : c;
3698
- throw new H(
3699
- // @ts-expect-error TODO
3700
- { ...f, status: a.status, headers: a.headers },
3701
- { query: t, variables: n }
3702
- );
3703
- }
3704
- }, Rn = (e, t, n, r) => {
3705
- const i = r ?? Ae;
3706
- if (!Array.isArray(e))
3707
- return i.stringify({ query: e, variables: t, operationName: n });
3708
- if (typeof t < "u" && !Array.isArray(t))
3709
- throw new Error("Cannot create request body with given variable type, array expected");
3710
- const s = e.reduce((a, c, p) => (a.push({ query: c, variables: t ? t[p] : void 0 }), a), []);
3711
- return i.stringify(s);
3712
- }, On = async (e, t) => {
3713
- let n;
3714
- return e.headers.forEach((r, i) => {
3715
- i.toLowerCase() === "content-type" && (n = r);
3716
- }), n && (n.toLowerCase().startsWith("application/json") || n.toLowerCase().startsWith("application/graphql+json") || n.toLowerCase().startsWith("application/graphql-response+json")) ? t.parse(await e.text()) : e.text();
3717
- }, pe = (e) => typeof e == "function" ? e() : e;
3718
- var Nn = /* @__PURE__ */ ((e) => (e.Eur = "EUR", e.Jpy = "JPY", e.Usd = "USD", e))(Nn || {}), Pn = /* @__PURE__ */ ((e) => (e.Retail = "RETAIL", e.Warehouse = "WAREHOUSE", e))(Pn || {});
3719
- class bn {
3972
+ var qn = /* @__PURE__ */ ((e) => (e.Eur = "EUR", e.Jpy = "JPY", e.Usd = "USD", e))(qn || {}), Bn = /* @__PURE__ */ ((e) => (e.Retail = "RETAIL", e.Warehouse = "WAREHOUSE", e))(Bn || {});
3973
+ class Un {
3720
3974
  constructor(t) {
3721
- ve(this, "api");
3722
- this.api = mn(
3723
- new Sn(`${t}/apps/sq-api`, {
3975
+ Se(this, "api");
3976
+ this.api = Mn(
3977
+ new Xt(`${t}/apps/sq-api`, {
3724
3978
  headers: {
3725
3979
  "X-SQ-CLIENT": "ShopifyAppProxy"
3726
3980
  }
@@ -4082,9 +4336,11 @@ class bn {
4082
4336
  * @param {string} [productShopifyLegacyResourceID] 商品のShopifyLegacyResourceID(gid://shopify/Product/xxxのxxxの部分)
4083
4337
  */
4084
4338
  async getHasBackOrderProductVariants(t) {
4085
- const n = await this.api.GetHasBackOrderProductVariantsByProductShopifyLegacyResourceID({
4086
- id: t
4087
- });
4339
+ const n = await this.api.GetHasBackOrderProductVariantsByProductShopifyLegacyResourceID(
4340
+ {
4341
+ id: t
4342
+ }
4343
+ );
4088
4344
  return n.productByProductShopifyLegacyResourceID ? n.productByProductShopifyLegacyResourceID.hasBackOrderProductVariants : null;
4089
4345
  }
4090
4346
  async getPointCampaignOrderRuleTargetCustomerRank() {
@@ -4164,7 +4420,7 @@ class bn {
4164
4420
  } : null;
4165
4421
  }
4166
4422
  /**
4167
- * purchasingCustomerActivateCustomerSharing はクティベーションコードを入力して顧客を有効化する。
4423
+ * purchasingCustomerActivateCustomerSharing はアクティベーションコードを入力して顧客を有効化する。
4168
4424
  */
4169
4425
  async purchasingCustomerActivateCustomerSharing(t, n) {
4170
4426
  if (n.length !== 6)
@@ -4273,27 +4529,40 @@ class bn {
4273
4529
  sortKeys: i
4274
4530
  });
4275
4531
  return s.purchasingCustomer ? {
4276
- nodes: s.purchasingCustomer.mileOrders.nodes.map((a) => ({
4277
- id: a.id,
4278
- mileItem: {
4279
- id: a.mileItem.id,
4280
- title: a.mileItem.title,
4281
- description: a.mileItem.description,
4282
- miles: a.mileItem.miles,
4283
- sku: a.mileItem.sku,
4284
- isActive: a.mileItem.isActive,
4285
- isScheduled: a.mileItem.isScheduled,
4286
- customerExchangeable: a.mileItem.customerExchangeable,
4287
- startsAt: new Date(a.mileItem.startsAt),
4288
- endsAt: a.mileItem.endsAt ? new Date(a.mileItem.endsAt) : void 0
4289
- },
4290
- miles: a.miles,
4291
- exchangedAt: new Date(a.exchangedAt),
4292
- isCancelled: a.isCancelled
4293
- })),
4532
+ nodes: s.purchasingCustomer.mileOrders.nodes.map(
4533
+ (a) => ({
4534
+ id: a.id,
4535
+ mileItem: {
4536
+ id: a.mileItem.id,
4537
+ title: a.mileItem.title,
4538
+ description: a.mileItem.description,
4539
+ miles: a.mileItem.miles,
4540
+ sku: a.mileItem.sku,
4541
+ isActive: a.mileItem.isActive,
4542
+ isScheduled: a.mileItem.isScheduled,
4543
+ customerExchangeable: a.mileItem.customerExchangeable,
4544
+ startsAt: new Date(a.mileItem.startsAt),
4545
+ endsAt: a.mileItem.endsAt ? new Date(a.mileItem.endsAt) : void 0
4546
+ },
4547
+ miles: a.miles,
4548
+ exchangedAt: new Date(a.exchangedAt),
4549
+ isCancelled: a.isCancelled
4550
+ })
4551
+ ),
4294
4552
  pageInfo: s.purchasingCustomer.mileOrders.pageInfo
4295
4553
  } : null;
4296
4554
  }
4555
+ /**
4556
+ * getPurchasingCustomerSMS は顧客のSMS認証情報を返します。
4557
+ */
4558
+ async getPurchasingCustomerSMS() {
4559
+ const t = await this.api.GetPurchasingCustomerSMS();
4560
+ return t.purchasingCustomer ? {
4561
+ id: t.purchasingCustomer.id,
4562
+ smsVerifiedPhone: t.purchasingCustomer.smsVerifiedPhone,
4563
+ smsVerified: t.purchasingCustomer.smsVerified
4564
+ } : null;
4565
+ }
4297
4566
  /**
4298
4567
  * mileItemExchange は指定したマイル商品を交換します。
4299
4568
  *
@@ -4314,7 +4583,9 @@ class bn {
4314
4583
  isActive: n.mileItemExchange.mileOrder.mileItem.isActive,
4315
4584
  isScheduled: n.mileItemExchange.mileOrder.mileItem.isScheduled,
4316
4585
  customerExchangeable: n.mileItemExchange.mileOrder.mileItem.customerExchangeable,
4317
- startsAt: new Date(n.mileItemExchange.mileOrder.mileItem.startsAt),
4586
+ startsAt: new Date(
4587
+ n.mileItemExchange.mileOrder.mileItem.startsAt
4588
+ ),
4318
4589
  endsAt: n.mileItemExchange.mileOrder.mileItem.endsAt ? new Date(n.mileItemExchange.mileOrder.mileItem.endsAt) : void 0
4319
4590
  },
4320
4591
  miles: n.mileItemExchange.mileOrder.miles,
@@ -4322,9 +4593,55 @@ class bn {
4322
4593
  isCancelled: n.mileItemExchange.mileOrder.isCancelled
4323
4594
  } : null;
4324
4595
  }
4596
+ /**
4597
+ * purchasingCustomerSendSMSVerificationCode は指定された電話番号に対して、SMS認証用コード(数字6桁)を送信します。
4598
+ *
4599
+ * @param {string} phone SMS認証コードを送信する電話番号
4600
+ */
4601
+ async purchasingCustomerSendSMSVerificationCode(t) {
4602
+ var i;
4603
+ const r = (i = (await this.api.PurchasingCustomerSendSMSVerificationCode({
4604
+ phone: t
4605
+ })).purchasingCustomerSendSMSVerificationCode) == null ? void 0 : i.purchasingCustomer;
4606
+ return r ? {
4607
+ id: r.id,
4608
+ smsVerifiedPhone: r.smsVerifiedPhone,
4609
+ smsVerified: r.smsVerified
4610
+ } : null;
4611
+ }
4612
+ /**
4613
+ * purchasingCustomerVerifySMS はSMS認証用コード(数字6桁)を指定して、SMS認証を行います。
4614
+ *
4615
+ * @param {string} phone SMS認証コードを送信した電話番号
4616
+ * @param {string} verificationCode SMS認証用コード
4617
+ */
4618
+ async purchasingCustomerVerifySMS(t, n) {
4619
+ var s;
4620
+ const i = (s = (await this.api.PurchasingCustomerVerifySMS({
4621
+ phone: t,
4622
+ verificationCode: n
4623
+ })).purchasingCustomerVerifySMS) == null ? void 0 : s.purchasingCustomer;
4624
+ return i ? {
4625
+ id: i.id,
4626
+ smsVerifiedPhone: i.smsVerifiedPhone,
4627
+ smsVerified: i.smsVerified
4628
+ } : null;
4629
+ }
4630
+ /**
4631
+ * DiscountUsageCreate は指定した注文価格調整の利用履歴を作成します。
4632
+ *
4633
+ * @param {string} orderPriceAdjustmentRuleID 利用する注文価格調整ルールのID
4634
+ */
4635
+ async DiscountUsageCreate(t) {
4636
+ var r;
4637
+ const n = await this.api.DiscountUsageCreate({
4638
+ orderPriceAdjustmentRuleID: t
4639
+ });
4640
+ return (r = n == null ? void 0 : n.shopifyOrderPriceAdjustmentUsageCreate) != null && r.orderPriceAdjustmentRule ? n.shopifyOrderPriceAdjustmentUsageCreate.orderPriceAdjustmentRule : null;
4641
+ }
4325
4642
  }
4326
4643
  export {
4327
- Nn as CurrencyCode,
4328
- Pn as LocationType,
4329
- bn as SDK
4644
+ qn as CurrencyCode,
4645
+ Bn as LocationType,
4646
+ Un as SDK
4330
4647
  };