@builtbystack/sq-shopify-theme-sdk 0.0.23 → 0.0.24

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.
@@ -17,44 +17,34 @@ function ze(e, t) {
17
17
  }
18
18
  return Object.freeze(Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }));
19
19
  }
20
- const Ce = JSON, Qe = (e) => e.toUpperCase(), Je = (e) => {
21
- const t = {};
22
- return e.forEach((n, r) => {
23
- t[r] = n;
24
- }), t;
25
- }, Xe = (e, t, n) => e.document ? e : {
26
- document: e,
27
- variables: t,
28
- requestHeaders: n,
29
- signal: void 0
30
- }, We = (e, t, n) => e.query ? e : {
31
- query: e,
32
- variables: t,
33
- requestHeaders: n,
34
- signal: void 0
35
- }, Ke = (e, t) => e.documents ? e : {
36
- documents: e,
37
- requestHeaders: t,
38
- signal: void 0
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);
39
29
  };
40
30
  function K(e, t) {
41
31
  if (!!!e)
42
32
  throw new Error(t);
43
33
  }
44
- function Ze(e) {
34
+ function Je(e) {
45
35
  return typeof e == "object" && e !== null;
46
36
  }
47
- function et(e, t) {
37
+ function Qe(e, t) {
48
38
  if (!!!e)
49
39
  throw new Error(
50
40
  t ?? "Unexpected invariant triggered."
51
41
  );
52
42
  }
53
- const tt = /\r\n|[\n\r]/g;
43
+ const Xe = /\r\n|[\n\r]/g;
54
44
  function pe(e, t) {
55
45
  let n = 0, r = 1;
56
- for (const i of e.body.matchAll(tt)) {
57
- if (typeof i.index == "number" || et(!1), i.index >= t)
46
+ for (const i of e.body.matchAll(Xe)) {
47
+ if (typeof i.index == "number" || Qe(!1), i.index >= t)
58
48
  break;
59
49
  n = i.index + i[0].length, r += 1;
60
50
  }
@@ -63,13 +53,13 @@ function pe(e, t) {
63
53
  column: t + 1 - n
64
54
  };
65
55
  }
66
- function nt(e) {
67
- return Se(
56
+ function We(e) {
57
+ return Oe(
68
58
  e.source,
69
59
  pe(e.source, e.start)
70
60
  );
71
61
  }
72
- function Se(e, t) {
62
+ function Oe(e, t) {
73
63
  const n = e.locationOffset.column - 1, r = "".padStart(n) + e.body, i = t.line - 1, s = e.locationOffset.line - 1, o = t.line + s, c = t.line === 1 ? n : 0, h = t.column + c, p = `${e.name}:${o}:${h}
74
64
  `, m = r.split(/\r\n|[\n\r]/g), y = m[i];
75
65
  if (y.length > 120) {
@@ -96,7 +86,7 @@ function Te(e) {
96
86
  return t.map(([r, i]) => r.padStart(n) + (i ? " " + i : "")).join(`
97
87
  `);
98
88
  }
99
- function rt(e) {
89
+ function Ke(e) {
100
90
  const t = e[0];
101
91
  return t == null || "kind" in t || "length" in t ? {
102
92
  nodes: t,
@@ -107,7 +97,7 @@ function rt(e) {
107
97
  extensions: e[5]
108
98
  } : t;
109
99
  }
110
- class Ee extends Error {
100
+ class Ce extends Error {
111
101
  /**
112
102
  * An array of `{ line, column }` locations within the source GraphQL document
113
103
  * which correspond to this error.
@@ -148,7 +138,7 @@ class Ee extends Error {
148
138
  */
149
139
  constructor(t, ...n) {
150
140
  var r, i, s;
151
- const { nodes: o, source: c, positions: h, path: p, originalError: m, extensions: y } = rt(n);
141
+ const { nodes: o, source: c, positions: h, path: p, originalError: m, extensions: y } = Ke(n);
152
142
  super(t), this.name = "GraphQLError", this.path = p ?? void 0, this.originalError = m ?? void 0, this.nodes = Ne(
153
143
  Array.isArray(o) ? o : o ? [o] : void 0
154
144
  );
@@ -156,7 +146,7 @@ class Ee extends Error {
156
146
  (r = this.nodes) === null || r === void 0 ? void 0 : r.map((g) => g.loc).filter((g) => g != null)
157
147
  );
158
148
  this.source = c ?? (C == null || (i = C[0]) === null || i === void 0 ? void 0 : i.source), this.positions = h ?? (C == null ? void 0 : C.map((g) => g.start)), this.locations = h && c ? h.map((g) => pe(c, g)) : C == null ? void 0 : C.map((g) => pe(g.source, g.start));
159
- const T = Ze(
149
+ const T = Je(
160
150
  m == null ? void 0 : m.extensions
161
151
  ) ? m == null ? void 0 : m.extensions : void 0;
162
152
  this.extensions = (s = y ?? T) !== null && s !== void 0 ? s : /* @__PURE__ */ Object.create(null), Object.defineProperties(this, {
@@ -183,7 +173,7 @@ class Ee extends Error {
183
173
  value: m.stack,
184
174
  writable: !0,
185
175
  configurable: !0
186
- }) : Error.captureStackTrace ? Error.captureStackTrace(this, Ee) : Object.defineProperty(this, "stack", {
176
+ }) : Error.captureStackTrace ? Error.captureStackTrace(this, Ce) : Object.defineProperty(this, "stack", {
187
177
  value: Error().stack,
188
178
  writable: !0,
189
179
  configurable: !0
@@ -198,12 +188,12 @@ class Ee extends Error {
198
188
  for (const n of this.nodes)
199
189
  n.loc && (t += `
200
190
 
201
- ` + nt(n.loc));
191
+ ` + We(n.loc));
202
192
  else if (this.source && this.locations)
203
193
  for (const n of this.locations)
204
194
  t += `
205
195
 
206
- ` + Se(this.source, n);
196
+ ` + Oe(this.source, n);
207
197
  return t;
208
198
  }
209
199
  toJSON() {
@@ -216,13 +206,13 @@ class Ee extends Error {
216
206
  function Ne(e) {
217
207
  return e === void 0 || e.length === 0 ? void 0 : e;
218
208
  }
219
- function b(e, t, n) {
220
- return new Ee(`Syntax Error: ${n}`, {
209
+ function S(e, t, n) {
210
+ return new Ce(`Syntax Error: ${n}`, {
221
211
  source: e,
222
212
  positions: [t]
223
213
  });
224
214
  }
225
- class it {
215
+ class Ze {
226
216
  /**
227
217
  * The character offset at which this Node begins.
228
218
  */
@@ -367,15 +357,15 @@ const ke = {
367
357
  UnionTypeExtension: ["name", "directives", "types"],
368
358
  EnumTypeExtension: ["name", "directives", "values"],
369
359
  InputObjectTypeExtension: ["name", "directives", "fields"]
370
- }, st = new Set(Object.keys(ke));
360
+ }, et = new Set(Object.keys(ke));
371
361
  function Ie(e) {
372
362
  const t = e == null ? void 0 : e.kind;
373
- return typeof t == "string" && st.has(t);
363
+ return typeof t == "string" && et.has(t);
374
364
  }
375
- var M;
365
+ var q;
376
366
  (function(e) {
377
367
  e.QUERY = "query", e.MUTATION = "mutation", e.SUBSCRIPTION = "subscription";
378
- })(M || (M = {}));
368
+ })(q || (q = {}));
379
369
  var fe;
380
370
  (function(e) {
381
371
  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";
@@ -397,15 +387,15 @@ function Pe(e) {
397
387
  function _e(e) {
398
388
  return Pe(e) || e === 95;
399
389
  }
400
- function ot(e) {
390
+ function tt(e) {
401
391
  return Pe(e) || Y(e) || e === 95;
402
392
  }
403
- function at(e) {
393
+ function nt(e) {
404
394
  var t;
405
395
  let n = Number.MAX_SAFE_INTEGER, r = null, i = -1;
406
396
  for (let o = 0; o < e.length; ++o) {
407
397
  var s;
408
- const c = e[o], h = ut(c);
398
+ const c = e[o], h = rt(c);
409
399
  h !== c.length && (r = (s = r) !== null && s !== void 0 ? s : o, i = o, o !== 0 && h < n && (n = h));
410
400
  }
411
401
  return e.map((o, c) => c === 0 ? o : o.slice(n)).slice(
@@ -413,13 +403,13 @@ function at(e) {
413
403
  i + 1
414
404
  );
415
405
  }
416
- function ut(e) {
406
+ function rt(e) {
417
407
  let t = 0;
418
408
  for (; t < e.length && me(e.charCodeAt(t)); )
419
409
  ++t;
420
410
  return t;
421
411
  }
422
- function ct(e, t) {
412
+ function it(e, t) {
423
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((T) => T.length === 0 || me(T.charCodeAt(0))), o = n.endsWith('\\"""'), c = e.endsWith('"') && !o, h = e.endsWith("\\"), p = c || h, m = !(t != null && t.minimize) && // add leading and trailing new lines only if it improves readability
424
414
  (!i || e.length > 70 || p || s || o);
425
415
  let y = "";
@@ -432,7 +422,7 @@ var u;
432
422
  (function(e) {
433
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";
434
424
  })(u || (u = {}));
435
- class lt {
425
+ class st {
436
426
  /**
437
427
  * The previously focused non-ignored token.
438
428
  */
@@ -469,17 +459,17 @@ class lt {
469
459
  if (t.next)
470
460
  t = t.next;
471
461
  else {
472
- const n = ht(this, t.end);
462
+ const n = at(this, t.end);
473
463
  t.next = n, n.prev = t, t = n;
474
464
  }
475
465
  while (t.kind === u.COMMENT);
476
466
  return t;
477
467
  }
478
468
  }
479
- function dt(e) {
469
+ function ot(e) {
480
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;
481
471
  }
482
- function V(e) {
472
+ function G(e) {
483
473
  return e >= 0 && e <= 55295 || e >= 57344 && e <= 1114111;
484
474
  }
485
475
  function se(e, t) {
@@ -505,7 +495,7 @@ function I(e, t, n, r, i) {
505
495
  const s = e.line, o = 1 + n - e.lineStart;
506
496
  return new De(t, n, r, s, o, i);
507
497
  }
508
- function ht(e, t) {
498
+ function at(e, t) {
509
499
  const n = e.source.body, r = n.length;
510
500
  let i = t;
511
501
  for (; i < r; ) {
@@ -524,7 +514,7 @@ function ht(e, t) {
524
514
  n.charCodeAt(i + 1) === 10 ? i += 2 : ++i, ++e.line, e.lineStart = i;
525
515
  continue;
526
516
  case 35:
527
- return pt(e, i);
517
+ return ut(e, i);
528
518
  case 33:
529
519
  return I(e, u.BANG, i, i + 1);
530
520
  case 36:
@@ -556,28 +546,28 @@ function ht(e, t) {
556
546
  case 125:
557
547
  return I(e, u.BRACE_R, i, i + 1);
558
548
  case 34:
559
- return n.charCodeAt(i + 1) === 34 && n.charCodeAt(i + 2) === 34 ? Et(e, i) : mt(e, i);
549
+ return n.charCodeAt(i + 1) === 34 && n.charCodeAt(i + 2) === 34 ? ft(e, i) : lt(e, i);
560
550
  }
561
551
  if (Y(s) || s === 45)
562
- return ft(e, i, s);
552
+ return ct(e, i, s);
563
553
  if (_e(s))
564
- return vt(e, i);
565
- throw b(
554
+ return mt(e, i);
555
+ throw S(
566
556
  e.source,
567
557
  i,
568
- s === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : V(s) || se(n, i) ? `Unexpected character: ${F(e, i)}.` : `Invalid character: ${F(e, 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)}.`
569
559
  );
570
560
  }
571
561
  return I(e, u.EOF, r, r);
572
562
  }
573
- function pt(e, t) {
563
+ function ut(e, t) {
574
564
  const n = e.source.body, r = n.length;
575
565
  let i = t + 1;
576
566
  for (; i < r; ) {
577
567
  const s = n.charCodeAt(i);
578
568
  if (s === 10 || s === 13)
579
569
  break;
580
- if (V(s))
570
+ if (G(s))
581
571
  ++i;
582
572
  else if (se(n, i))
583
573
  i += 2;
@@ -592,12 +582,12 @@ function pt(e, t) {
592
582
  n.slice(t + 1, i)
593
583
  );
594
584
  }
595
- function ft(e, t, n) {
585
+ function ct(e, t, n) {
596
586
  const r = e.source.body;
597
587
  let i = t, s = n, o = !1;
598
588
  if (s === 45 && (s = r.charCodeAt(++i)), s === 48) {
599
589
  if (s = r.charCodeAt(++i), Y(s))
600
- throw b(
590
+ throw S(
601
591
  e.source,
602
592
  i,
603
593
  `Invalid number, unexpected digit after 0: ${F(
@@ -608,7 +598,7 @@ function ft(e, t, n) {
608
598
  } else
609
599
  i = ce(e, i, s), s = r.charCodeAt(i);
610
600
  if (s === 46 && (o = !0, s = r.charCodeAt(++i), i = ce(e, i, s), s = r.charCodeAt(i)), (s === 69 || s === 101) && (o = !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))
611
- throw b(
601
+ throw S(
612
602
  e.source,
613
603
  i,
614
604
  `Invalid number, expected digit but got: ${F(
@@ -626,7 +616,7 @@ function ft(e, t, n) {
626
616
  }
627
617
  function ce(e, t, n) {
628
618
  if (!Y(n))
629
- throw b(
619
+ throw S(
630
620
  e.source,
631
621
  t,
632
622
  `Invalid number, expected digit but got: ${F(
@@ -640,7 +630,7 @@ function ce(e, t, n) {
640
630
  ++i;
641
631
  return i;
642
632
  }
643
- function mt(e, t) {
633
+ function lt(e, t) {
644
634
  const n = e.source.body, r = n.length;
645
635
  let i = t + 1, s = i, o = "";
646
636
  for (; i < r; ) {
@@ -649,18 +639,18 @@ function mt(e, t) {
649
639
  return o += n.slice(s, i), I(e, u.STRING, t, i + 1, o);
650
640
  if (c === 92) {
651
641
  o += n.slice(s, i);
652
- const h = n.charCodeAt(i + 1) === 117 ? n.charCodeAt(i + 2) === 123 ? gt(e, i) : yt(e, i) : Ct(e, i);
642
+ const h = n.charCodeAt(i + 1) === 117 ? n.charCodeAt(i + 2) === 123 ? dt(e, i) : ht(e, i) : pt(e, i);
653
643
  o += h.value, i += h.size, s = i;
654
644
  continue;
655
645
  }
656
646
  if (c === 10 || c === 13)
657
647
  break;
658
- if (V(c))
648
+ if (G(c))
659
649
  ++i;
660
650
  else if (se(n, i))
661
651
  i += 2;
662
652
  else
663
- throw b(
653
+ throw S(
664
654
  e.source,
665
655
  i,
666
656
  `Invalid character within String: ${F(
@@ -669,15 +659,15 @@ function mt(e, t) {
669
659
  )}.`
670
660
  );
671
661
  }
672
- throw b(e.source, i, "Unterminated string.");
662
+ throw S(e.source, i, "Unterminated string.");
673
663
  }
674
- function gt(e, t) {
664
+ function dt(e, t) {
675
665
  const n = e.source.body;
676
666
  let r = 0, i = 3;
677
667
  for (; i < 12; ) {
678
668
  const s = n.charCodeAt(t + i++);
679
669
  if (s === 125) {
680
- if (i < 5 || !V(r))
670
+ if (i < 5 || !G(r))
681
671
  break;
682
672
  return {
683
673
  value: String.fromCodePoint(r),
@@ -687,7 +677,7 @@ function gt(e, t) {
687
677
  if (r = r << 4 | j(s), r < 0)
688
678
  break;
689
679
  }
690
- throw b(
680
+ throw S(
691
681
  e.source,
692
682
  t,
693
683
  `Invalid Unicode escape sequence: "${n.slice(
@@ -696,34 +686,34 @@ function gt(e, t) {
696
686
  )}".`
697
687
  );
698
688
  }
699
- function yt(e, t) {
700
- const n = e.source.body, r = be(n, t + 2);
701
- if (V(r))
689
+ function ht(e, t) {
690
+ const n = e.source.body, r = Se(n, t + 2);
691
+ if (G(r))
702
692
  return {
703
693
  value: String.fromCodePoint(r),
704
694
  size: 6
705
695
  };
706
696
  if (Le(r) && n.charCodeAt(t + 6) === 92 && n.charCodeAt(t + 7) === 117) {
707
- const i = be(n, t + 8);
697
+ const i = Se(n, t + 8);
708
698
  if (we(i))
709
699
  return {
710
700
  value: String.fromCodePoint(r, i),
711
701
  size: 12
712
702
  };
713
703
  }
714
- throw b(
704
+ throw S(
715
705
  e.source,
716
706
  t,
717
707
  `Invalid Unicode escape sequence: "${n.slice(t, t + 6)}".`
718
708
  );
719
709
  }
720
- function be(e, t) {
710
+ function Se(e, t) {
721
711
  return j(e.charCodeAt(t)) << 12 | j(e.charCodeAt(t + 1)) << 8 | j(e.charCodeAt(t + 2)) << 4 | j(e.charCodeAt(t + 3));
722
712
  }
723
713
  function j(e) {
724
714
  return e >= 48 && e <= 57 ? e - 48 : e >= 65 && e <= 70 ? e - 55 : e >= 97 && e <= 102 ? e - 87 : -1;
725
715
  }
726
- function Ct(e, t) {
716
+ function pt(e, t) {
727
717
  const n = e.source.body;
728
718
  switch (n.charCodeAt(t + 1)) {
729
719
  case 34:
@@ -768,7 +758,7 @@ function Ct(e, t) {
768
758
  size: 2
769
759
  };
770
760
  }
771
- throw b(
761
+ throw S(
772
762
  e.source,
773
763
  t,
774
764
  `Invalid character escape sequence: "${n.slice(
@@ -777,7 +767,7 @@ function Ct(e, t) {
777
767
  )}".`
778
768
  );
779
769
  }
780
- function Et(e, t) {
770
+ function ft(e, t) {
781
771
  const n = e.source.body, r = n.length;
782
772
  let i = e.lineStart, s = t + 3, o = s, c = "";
783
773
  const h = [];
@@ -791,7 +781,7 @@ function Et(e, t) {
791
781
  t,
792
782
  s + 3,
793
783
  // Return a string of the lines joined with U+000A.
794
- at(h).join(`
784
+ nt(h).join(`
795
785
  `)
796
786
  );
797
787
  return e.line += h.length - 1, e.lineStart = i, m;
@@ -804,12 +794,12 @@ function Et(e, t) {
804
794
  c += n.slice(o, s), h.push(c), p === 13 && n.charCodeAt(s + 1) === 10 ? s += 2 : ++s, c = "", o = s, i = s;
805
795
  continue;
806
796
  }
807
- if (V(p))
797
+ if (G(p))
808
798
  ++s;
809
799
  else if (se(n, s))
810
800
  s += 2;
811
801
  else
812
- throw b(
802
+ throw S(
813
803
  e.source,
814
804
  s,
815
805
  `Invalid character within String: ${F(
@@ -818,14 +808,14 @@ function Et(e, t) {
818
808
  )}.`
819
809
  );
820
810
  }
821
- throw b(e.source, s, "Unterminated string.");
811
+ throw S(e.source, s, "Unterminated string.");
822
812
  }
823
- function vt(e, t) {
813
+ function mt(e, t) {
824
814
  const n = e.source.body, r = n.length;
825
815
  let i = t + 1;
826
816
  for (; i < r; ) {
827
817
  const s = n.charCodeAt(i);
828
- if (ot(s))
818
+ if (tt(s))
829
819
  ++i;
830
820
  else
831
821
  break;
@@ -838,8 +828,8 @@ function vt(e, t) {
838
828
  n.slice(t, i)
839
829
  );
840
830
  }
841
- const At = 10, Fe = 2;
842
- function ve(e) {
831
+ const gt = 10, Fe = 2;
832
+ function Ee(e) {
843
833
  return oe(e, []);
844
834
  }
845
835
  function oe(e, t) {
@@ -849,45 +839,45 @@ function oe(e, t) {
849
839
  case "function":
850
840
  return e.name ? `[function ${e.name}]` : "[function]";
851
841
  case "object":
852
- return Tt(e, t);
842
+ return yt(e, t);
853
843
  default:
854
844
  return String(e);
855
845
  }
856
846
  }
857
- function Tt(e, t) {
847
+ function yt(e, t) {
858
848
  if (e === null)
859
849
  return "null";
860
850
  if (t.includes(e))
861
851
  return "[Circular]";
862
852
  const n = [...t, e];
863
- if (Nt(e)) {
853
+ if (Ct(e)) {
864
854
  const r = e.toJSON();
865
855
  if (r !== e)
866
856
  return typeof r == "string" ? r : oe(r, n);
867
857
  } else if (Array.isArray(e))
868
- return bt(e, n);
869
- return It(e, n);
858
+ return vt(e, n);
859
+ return Et(e, n);
870
860
  }
871
- function Nt(e) {
861
+ function Ct(e) {
872
862
  return typeof e.toJSON == "function";
873
863
  }
874
- function It(e, t) {
864
+ function Et(e, t) {
875
865
  const n = Object.entries(e);
876
- return n.length === 0 ? "{}" : t.length > Fe ? "[" + xt(e) + "]" : "{ " + n.map(
866
+ return n.length === 0 ? "{}" : t.length > Fe ? "[" + At(e) + "]" : "{ " + n.map(
877
867
  ([i, s]) => i + ": " + oe(s, t)
878
868
  ).join(", ") + " }";
879
869
  }
880
- function bt(e, t) {
870
+ function vt(e, t) {
881
871
  if (e.length === 0)
882
872
  return "[]";
883
873
  if (t.length > Fe)
884
874
  return "[Array]";
885
- const n = Math.min(At, e.length), r = e.length - n, i = [];
875
+ const n = Math.min(gt, e.length), r = e.length - n, i = [];
886
876
  for (let s = 0; s < n; ++s)
887
877
  i.push(oe(e[s], t));
888
878
  return r === 1 ? i.push("... 1 more item") : r > 1 && i.push(`... ${r} more items`), "[" + i.join(", ") + "]";
889
879
  }
890
- function xt(e) {
880
+ function At(e) {
891
881
  const t = Object.prototype.toString.call(e).replace(/^\[object /, "").replace(/]$/, "");
892
882
  if (t === "Object" && typeof e.constructor == "function") {
893
883
  const n = e.constructor.name;
@@ -896,7 +886,7 @@ function xt(e) {
896
886
  }
897
887
  return t;
898
888
  }
899
- const Rt = (
889
+ const Tt = (
900
890
  /* c8 ignore next 6 */
901
891
  // FIXME: https://github.com/graphql/graphql-js/issues/2317
902
892
  globalThis.process && globalThis.process.env.NODE_ENV === "production" ? function(t, n) {
@@ -911,7 +901,7 @@ const Rt = (
911
901
  Symbol.toStringTag in t ? t[Symbol.toStringTag] : (r = t.constructor) === null || r === void 0 ? void 0 : r.name
912
902
  );
913
903
  if (i === s) {
914
- const o = ve(t);
904
+ const o = Ee(t);
915
905
  throw new Error(`Cannot use ${i} "${o}" from another module or realm.
916
906
 
917
907
  Ensure that there is only one instance of "graphql" in the node_modules
@@ -934,7 +924,7 @@ class Be {
934
924
  line: 1,
935
925
  column: 1
936
926
  }) {
937
- typeof t == "string" || K(!1, `Body must be a string. Received: ${ve(t)}.`), this.body = t, this.name = n, this.locationOffset = r, this.locationOffset.line > 0 || K(
927
+ typeof t == "string" || K(!1, `Body must be a string. Received: ${Ee(t)}.`), this.body = t, this.name = n, this.locationOffset = r, this.locationOffset.line > 0 || K(
938
928
  !1,
939
929
  "line in locationOffset is 1-indexed and must be positive."
940
930
  ), this.locationOffset.column > 0 || K(
@@ -946,16 +936,16 @@ class Be {
946
936
  return "Source";
947
937
  }
948
938
  }
949
- function Ot(e) {
950
- return Rt(e, Be);
939
+ function Nt(e) {
940
+ return Tt(e, Be);
951
941
  }
952
942
  function Ue(e, t) {
953
- return new St(e, t).parseDocument();
943
+ return new It(e, t).parseDocument();
954
944
  }
955
- class St {
945
+ class It {
956
946
  constructor(t, n = {}) {
957
- const r = Ot(t) ? t : new Be(t);
958
- this._lexer = new lt(r), this._options = n, this._tokenCounter = 0;
947
+ const r = Nt(t) ? t : new Be(t);
948
+ this._lexer = new st(r), this._options = n, this._tokenCounter = 0;
959
949
  }
960
950
  /**
961
951
  * Converts a name lex token into a name parse node.
@@ -1028,7 +1018,7 @@ class St {
1028
1018
  return this.parseDirectiveDefinition();
1029
1019
  }
1030
1020
  if (t)
1031
- throw b(
1021
+ throw S(
1032
1022
  this._lexer.source,
1033
1023
  this._lexer.token.start,
1034
1024
  "Unexpected description, descriptions are supported only on type definitions."
@@ -1057,7 +1047,7 @@ class St {
1057
1047
  if (this.peek(u.BRACE_L))
1058
1048
  return this.node(t, {
1059
1049
  kind: f.OPERATION_DEFINITION,
1060
- operation: M.QUERY,
1050
+ operation: q.QUERY,
1061
1051
  name: void 0,
1062
1052
  variableDefinitions: [],
1063
1053
  directives: [],
@@ -1081,11 +1071,11 @@ class St {
1081
1071
  const t = this.expectToken(u.NAME);
1082
1072
  switch (t.value) {
1083
1073
  case "query":
1084
- return M.QUERY;
1074
+ return q.QUERY;
1085
1075
  case "mutation":
1086
- return M.MUTATION;
1076
+ return q.MUTATION;
1087
1077
  case "subscription":
1088
- return M.SUBSCRIPTION;
1078
+ return q.SUBSCRIPTION;
1089
1079
  }
1090
1080
  throw this.unexpected(t);
1091
1081
  }
@@ -1302,7 +1292,7 @@ class St {
1302
1292
  if (t)
1303
1293
  if (this.expectToken(u.DOLLAR), this._lexer.token.kind === u.NAME) {
1304
1294
  const r = this._lexer.token.value;
1305
- throw b(
1295
+ throw S(
1306
1296
  this._lexer.source,
1307
1297
  n.start,
1308
1298
  `Unexpected variable "$${r}" in constant value.`
@@ -1649,7 +1639,7 @@ class St {
1649
1639
  */
1650
1640
  parseEnumValueName() {
1651
1641
  if (this._lexer.token.value === "true" || this._lexer.token.value === "false" || this._lexer.token.value === "null")
1652
- throw b(
1642
+ throw S(
1653
1643
  this._lexer.source,
1654
1644
  this._lexer.token.start,
1655
1645
  `${W(
@@ -1922,7 +1912,7 @@ class St {
1922
1912
  * given parsed object.
1923
1913
  */
1924
1914
  node(t, n) {
1925
- return this._options.noLocation !== !0 && (n.loc = new it(
1915
+ return this._options.noLocation !== !0 && (n.loc = new Ze(
1926
1916
  t,
1927
1917
  this._lexer.lastToken,
1928
1918
  this._lexer.source
@@ -1942,10 +1932,10 @@ class St {
1942
1932
  const n = this._lexer.token;
1943
1933
  if (n.kind === t)
1944
1934
  return this.advanceLexer(), n;
1945
- throw b(
1935
+ throw S(
1946
1936
  this._lexer.source,
1947
1937
  n.start,
1948
- `Expected ${Me(t)}, found ${W(n)}.`
1938
+ `Expected ${qe(t)}, found ${W(n)}.`
1949
1939
  );
1950
1940
  }
1951
1941
  /**
@@ -1964,7 +1954,7 @@ class St {
1964
1954
  if (n.kind === u.NAME && n.value === t)
1965
1955
  this.advanceLexer();
1966
1956
  else
1967
- throw b(
1957
+ throw S(
1968
1958
  this._lexer.source,
1969
1959
  n.start,
1970
1960
  `Expected "${t}", found ${W(n)}.`
@@ -1983,7 +1973,7 @@ class St {
1983
1973
  */
1984
1974
  unexpected(t) {
1985
1975
  const n = t ?? this._lexer.token;
1986
- return b(
1976
+ return S(
1987
1977
  this._lexer.source,
1988
1978
  n.start,
1989
1979
  `Unexpected ${W(n)}.`
@@ -2046,7 +2036,7 @@ class St {
2046
2036
  advanceLexer() {
2047
2037
  const { maxTokens: t } = this._options, n = this._lexer.advance();
2048
2038
  if (t !== void 0 && n.kind !== u.EOF && (++this._tokenCounter, this._tokenCounter > t))
2049
- throw b(
2039
+ throw S(
2050
2040
  this._lexer.source,
2051
2041
  n.start,
2052
2042
  `Document contains more that ${t} tokens. Parsing aborted.`
@@ -2055,19 +2045,19 @@ class St {
2055
2045
  }
2056
2046
  function W(e) {
2057
2047
  const t = e.value;
2058
- return Me(e.kind) + (t != null ? ` "${t}"` : "");
2048
+ return qe(e.kind) + (t != null ? ` "${t}"` : "");
2059
2049
  }
2060
- function Me(e) {
2061
- return dt(e) ? `"${e}"` : e;
2050
+ function qe(e) {
2051
+ return ot(e) ? `"${e}"` : e;
2062
2052
  }
2063
- function Dt(e) {
2064
- return `"${e.replace(kt, Pt)}"`;
2053
+ function St(e) {
2054
+ return `"${e.replace(bt, xt)}"`;
2065
2055
  }
2066
- const kt = /[\x00-\x1f\x22\x5c\x7f-\x9f]/g;
2067
- function Pt(e) {
2068
- return _t[e.charCodeAt(0)];
2056
+ const bt = /[\x00-\x1f\x22\x5c\x7f-\x9f]/g;
2057
+ function xt(e) {
2058
+ return Rt[e.charCodeAt(0)];
2069
2059
  }
2070
- const _t = [
2060
+ const Rt = [
2071
2061
  "\\u0000",
2072
2062
  "\\u0001",
2073
2063
  "\\u0002",
@@ -2233,11 +2223,11 @@ const _t = [
2233
2223
  "\\u009D",
2234
2224
  "\\u009E",
2235
2225
  "\\u009F"
2236
- ], Lt = Object.freeze({});
2237
- function wt(e, t, n = ke) {
2226
+ ], Ot = Object.freeze({});
2227
+ function Dt(e, t, n = ke) {
2238
2228
  const r = /* @__PURE__ */ new Map();
2239
2229
  for (const D of Object.values(f))
2240
- r.set(D, Ft(t, D));
2230
+ r.set(D, kt(t, D));
2241
2231
  let i, s = Array.isArray(e), o = [e], c = -1, h = [], p = e, m, y;
2242
2232
  const C = [], T = [];
2243
2233
  do {
@@ -2248,9 +2238,9 @@ function wt(e, t, n = ke) {
2248
2238
  if (s) {
2249
2239
  p = p.slice();
2250
2240
  let k = 0;
2251
- for (const [B, Q] of h) {
2252
- const J = B - k;
2253
- Q === null ? (p.splice(J, 1), k++) : p[J] = Q;
2241
+ for (const [B, J] of h) {
2242
+ const Q = B - k;
2243
+ J === null ? (p.splice(Q, 1), k++) : p[Q] = J;
2254
2244
  }
2255
2245
  } else {
2256
2246
  p = Object.defineProperties(
@@ -2269,9 +2259,9 @@ function wt(e, t, n = ke) {
2269
2259
  let _;
2270
2260
  if (!Array.isArray(p)) {
2271
2261
  var g, N;
2272
- Ie(p) || K(!1, `Invalid AST Node: ${ve(p)}.`);
2262
+ Ie(p) || K(!1, `Invalid AST Node: ${Ee(p)}.`);
2273
2263
  const k = D ? (g = r.get(p.kind)) === null || g === void 0 ? void 0 : g.leave : (N = r.get(p.kind)) === null || N === void 0 ? void 0 : N.enter;
2274
- if (_ = k == null ? void 0 : k.call(t, p, m, y, C, T), _ === Lt)
2264
+ if (_ = k == null ? void 0 : k.call(t, p, m, y, C, T), _ === Ot)
2275
2265
  break;
2276
2266
  if (_ === !1) {
2277
2267
  if (!D) {
@@ -2289,19 +2279,19 @@ function wt(e, t, n = ke) {
2289
2279
  if (_ === void 0 && z && h.push([m, p]), D)
2290
2280
  C.pop();
2291
2281
  else {
2292
- var S;
2282
+ var O;
2293
2283
  i = {
2294
2284
  inArray: s,
2295
2285
  index: c,
2296
2286
  keys: o,
2297
2287
  edits: h,
2298
2288
  prev: i
2299
- }, s = Array.isArray(p), o = s ? p : (S = n[p.kind]) !== null && S !== void 0 ? S : [], c = -1, h = [], y && T.push(y), y = p;
2289
+ }, s = Array.isArray(p), o = s ? p : (O = n[p.kind]) !== null && O !== void 0 ? O : [], c = -1, h = [], y && T.push(y), y = p;
2300
2290
  }
2301
2291
  } while (i !== void 0);
2302
2292
  return h.length !== 0 ? h[h.length - 1][1] : e;
2303
2293
  }
2304
- function Ft(e, t) {
2294
+ function kt(e, t) {
2305
2295
  const n = e[t];
2306
2296
  return typeof n == "object" ? n : typeof n == "function" ? {
2307
2297
  enter: n,
@@ -2311,10 +2301,10 @@ function Ft(e, t) {
2311
2301
  leave: e.leave
2312
2302
  };
2313
2303
  }
2314
- function Bt(e) {
2315
- return wt(e, Mt);
2304
+ function Pt(e) {
2305
+ return Dt(e, Lt);
2316
2306
  }
2317
- const Ut = 80, Mt = {
2307
+ const _t = 80, Lt = {
2318
2308
  Name: {
2319
2309
  leave: (e) => e.value
2320
2310
  },
@@ -2350,7 +2340,7 @@ const Ut = 80, Mt = {
2350
2340
  leave({ alias: e, name: t, arguments: n, directives: r, selectionSet: i }) {
2351
2341
  const s = v("", e, ": ") + t;
2352
2342
  let o = s + v("(", d(n, ", "), ")");
2353
- return o.length > Ut && (o = s + v(`(
2343
+ return o.length > _t && (o = s + v(`(
2354
2344
  `, Z(d(n, `
2355
2345
  `)), `
2356
2346
  )`)), d([o, d(r, " "), i], " ");
@@ -2388,7 +2378,7 @@ const Ut = 80, Mt = {
2388
2378
  leave: ({ value: e }) => e
2389
2379
  },
2390
2380
  StringValue: {
2391
- leave: ({ value: e, block: t }) => t ? ct(e) : Dt(e)
2381
+ leave: ({ value: e, block: t }) => t ? it(e) : St(e)
2392
2382
  },
2393
2383
  BooleanValue: {
2394
2384
  leave: ({ value: e }) => e ? "true" : "false"
@@ -2449,7 +2439,7 @@ const Ut = 80, Mt = {
2449
2439
  },
2450
2440
  FieldDefinition: {
2451
2441
  leave: ({ description: e, name: t, arguments: n, type: r, directives: i }) => v("", e, `
2452
- `) + t + (xe(n) ? v(`(
2442
+ `) + t + (be(n) ? v(`(
2453
2443
  `, Z(d(n, `
2454
2444
  `)), `
2455
2445
  )`) : v("(", d(n, ", "), ")")) + ": " + r + v(" ", d(i, " "))
@@ -2495,7 +2485,7 @@ const Ut = 80, Mt = {
2495
2485
  },
2496
2486
  DirectiveDefinition: {
2497
2487
  leave: ({ description: e, name: t, arguments: n, repeatable: r, locations: i }) => v("", e, `
2498
- `) + "directive @" + t + (xe(n) ? v(`(
2488
+ `) + "directive @" + t + (be(n) ? v(`(
2499
2489
  `, Z(d(n, `
2500
2490
  `)), `
2501
2491
  )`) : v("(", d(n, ", "), ")")) + (r ? " repeatable" : "") + " on " + d(i, " | ")
@@ -2568,969 +2558,997 @@ function Z(e) {
2568
2558
  return v(" ", e.replace(/\n/g, `
2569
2559
  `));
2570
2560
  }
2571
- function xe(e) {
2561
+ function be(e) {
2572
2562
  var t;
2573
2563
  return (t = e == null ? void 0 : e.some((n) => n.includes(`
2574
2564
  `))) !== null && t !== void 0 ? t : !1;
2575
2565
  }
2576
- const Re = (e) => {
2577
- var r, i;
2578
- let t;
2579
- const n = e.definitions.filter((s) => s.kind === "OperationDefinition");
2580
- return n.length === 1 && (t = (i = (r = n[0]) == null ? void 0 : r.name) == null ? void 0 : i.value), t;
2581
- }, le = (e) => {
2582
- if (typeof e == "string") {
2583
- let n;
2584
- try {
2585
- const r = Ue(e);
2586
- n = Re(r);
2587
- } catch {
2588
- }
2589
- return { query: e, operationName: n };
2566
+ var ee = /* @__PURE__ */ new Map(), ge = /* @__PURE__ */ new Map(), Me = !0, re = !1;
2567
+ function Ge(e) {
2568
+ return e.replace(/[\s,]+/g, " ").trim();
2569
+ }
2570
+ function wt(e) {
2571
+ return Ge(e.source.body.substring(e.start, e.end));
2572
+ }
2573
+ function Ft(e) {
2574
+ var t = /* @__PURE__ */ new Set(), n = [];
2575
+ return e.definitions.forEach(function(r) {
2576
+ if (r.kind === "FragmentDefinition") {
2577
+ var i = r.name.value, s = wt(r.loc), o = ge.get(i);
2578
+ o && !o.has(s) ? Me && console.warn("Warning: fragment with name " + i + ` already exists.
2579
+ 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`) : o || ge.set(i, o = /* @__PURE__ */ new Set()), o.add(s), t.has(s) || (t.add(s), n.push(r));
2581
+ } else
2582
+ n.push(r);
2583
+ }), ne(ne({}, e), { definitions: n });
2584
+ }
2585
+ function Bt(e) {
2586
+ var t = new Set(e.definitions);
2587
+ t.forEach(function(r) {
2588
+ r.loc && delete r.loc, Object.keys(r).forEach(function(i) {
2589
+ var s = r[i];
2590
+ s && typeof s == "object" && t.add(s);
2591
+ });
2592
+ });
2593
+ var n = e.loc;
2594
+ return n && (delete n.startToken, delete n.endToken), e;
2595
+ }
2596
+ function Ut(e) {
2597
+ var t = Ge(e);
2598
+ if (!ee.has(t)) {
2599
+ var n = Ue(e, {
2600
+ experimentalFragmentVariables: re,
2601
+ allowLegacyFragmentVariables: re
2602
+ });
2603
+ if (!n || n.kind !== "Document")
2604
+ throw new Error("Not a valid GraphQL document.");
2605
+ ee.set(t, Bt(Ft(n)));
2590
2606
  }
2591
- const t = Re(e);
2592
- return { query: Bt(e), operationName: t };
2607
+ return ee.get(t);
2608
+ }
2609
+ function M(e) {
2610
+ for (var t = [], n = 1; n < arguments.length; n++)
2611
+ t[n - 1] = arguments[n];
2612
+ typeof e == "string" && (e = [e]);
2613
+ var r = e[0];
2614
+ return t.forEach(function(i, s) {
2615
+ i && i.kind === "Document" ? r += i.loc.source.body : r += i, r += e[s + 1];
2616
+ }), Ut(r);
2617
+ }
2618
+ function qt() {
2619
+ ee.clear(), ge.clear();
2620
+ }
2621
+ function Mt() {
2622
+ Me = !1;
2623
+ }
2624
+ function Gt() {
2625
+ re = !0;
2626
+ }
2627
+ function Vt() {
2628
+ re = !1;
2629
+ }
2630
+ var $ = {
2631
+ gql: M,
2632
+ resetCaches: qt,
2633
+ disableFragmentWarnings: Mt,
2634
+ enableExperimentalFragmentVariables: Gt,
2635
+ disableExperimentalFragmentVariables: Vt
2593
2636
  };
2594
- class H extends Error {
2595
- constructor(t, n) {
2596
- const r = `${H.extractMessage(t)}: ${JSON.stringify({
2597
- response: t,
2598
- request: n
2599
- })}`;
2600
- super(r), Object.setPrototypeOf(this, H.prototype), this.response = t, this.request = n, typeof Error.captureStackTrace == "function" && Error.captureStackTrace(this, H);
2637
+ (function(e) {
2638
+ e.gql = $.gql, e.resetCaches = $.resetCaches, e.disableFragmentWarnings = $.disableFragmentWarnings, e.enableExperimentalFragmentVariables = $.enableExperimentalFragmentVariables, e.disableExperimentalFragmentVariables = $.disableExperimentalFragmentVariables;
2639
+ })(M || (M = {}));
2640
+ M.default = M;
2641
+ const x = M, $t = x`
2642
+ query GetLocationAvailabilities($sku: String!, $first: Int, $after: String, $isReverse: Boolean! = false) {
2643
+ locationAvailabilities(
2644
+ sku: $sku
2645
+ first: $first
2646
+ after: $after
2647
+ isReverse: $isReverse
2648
+ ) {
2649
+ nodes {
2650
+ location {
2651
+ id
2652
+ name
2653
+ phone
2654
+ mapURL
2655
+ tags
2656
+ address {
2657
+ id
2658
+ countryCode
2659
+ country
2660
+ postalCode
2661
+ provinceCode
2662
+ province
2663
+ city
2664
+ address1
2665
+ address2
2666
+ updatedAt
2667
+ createdAt
2668
+ }
2669
+ }
2670
+ inventoryQuantity
2671
+ }
2672
+ pageInfo {
2673
+ startCursor
2674
+ endCursor
2675
+ hasNextPage
2676
+ hasPreviousPage
2677
+ }
2601
2678
  }
2602
- static extractMessage(t) {
2603
- var n, r;
2604
- return ((r = (n = t.errors) == null ? void 0 : n[0]) == null ? void 0 : r.message) ?? `GraphQL Error (Code: ${t.status})`;
2679
+ }
2680
+ `, jt = x`
2681
+ query GetLocationAvailability($sku: String!, $locationID: ID!) {
2682
+ locationAvailability(sku: $sku, locationID: $locationID) {
2683
+ location {
2684
+ id
2685
+ name
2686
+ phone
2687
+ mapURL
2688
+ tags
2689
+ address {
2690
+ id
2691
+ countryCode
2692
+ country
2693
+ postalCode
2694
+ provinceCode
2695
+ province
2696
+ city
2697
+ address1
2698
+ address2
2699
+ updatedAt
2700
+ createdAt
2701
+ }
2702
+ }
2703
+ inventoryQuantity
2605
2704
  }
2606
2705
  }
2607
- var qt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
2608
- function Vt(e) {
2609
- return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
2706
+ `, Ht = x`
2707
+ query GetPurchasingCustomerMetafield($namespace: String!, $key: String!) {
2708
+ purchasingCustomerMetafield(namespace: $namespace, key: $key) {
2709
+ id
2710
+ namespace
2711
+ key
2712
+ value
2713
+ }
2610
2714
  }
2611
- var ge = { exports: {} };
2612
- (function(e, t) {
2613
- var n = typeof self < "u" ? self : qt, r = function() {
2614
- function s() {
2615
- this.fetch = !1, this.DOMException = n.DOMException;
2616
- }
2617
- return s.prototype = n, new s();
2618
- }();
2619
- (function(s) {
2620
- (function(o) {
2621
- var c = {
2622
- searchParams: "URLSearchParams" in s,
2623
- iterable: "Symbol" in s && "iterator" in Symbol,
2624
- blob: "FileReader" in s && "Blob" in s && function() {
2625
- try {
2626
- return new Blob(), !0;
2627
- } catch {
2628
- return !1;
2629
- }
2630
- }(),
2631
- formData: "FormData" in s,
2632
- arrayBuffer: "ArrayBuffer" in s
2633
- };
2634
- function h(a) {
2635
- return a && DataView.prototype.isPrototypeOf(a);
2636
- }
2637
- if (c.arrayBuffer)
2638
- var p = [
2639
- "[object Int8Array]",
2640
- "[object Uint8Array]",
2641
- "[object Uint8ClampedArray]",
2642
- "[object Int16Array]",
2643
- "[object Uint16Array]",
2644
- "[object Int32Array]",
2645
- "[object Uint32Array]",
2646
- "[object Float32Array]",
2647
- "[object Float64Array]"
2648
- ], m = ArrayBuffer.isView || function(a) {
2649
- return a && p.indexOf(Object.prototype.toString.call(a)) > -1;
2650
- };
2651
- function y(a) {
2652
- if (typeof a != "string" && (a = String(a)), /[^a-z0-9\-#$%&'*+.^_`|~]/i.test(a))
2653
- throw new TypeError("Invalid character in header field name");
2654
- return a.toLowerCase();
2715
+ `, Yt = x`
2716
+ query GetPoints {
2717
+ purchasingCustomer {
2718
+ pointsApproved
2719
+ pointsPending
2720
+ }
2721
+ }
2722
+ `, zt = x`
2723
+ query GetLocations($tag: String, $provinceCodes: [String!], $first: Int, $after: String, $isReverse: Boolean! = false) {
2724
+ locations(
2725
+ first: $first
2726
+ after: $after
2727
+ isReverse: $isReverse
2728
+ filter: {tag: $tag, provinceCodes: $provinceCodes}
2729
+ ) {
2730
+ nodes {
2731
+ id
2732
+ name
2733
+ phone
2734
+ mapURL
2735
+ tags
2736
+ address {
2737
+ id
2738
+ countryCode
2739
+ country
2740
+ postalCode
2741
+ provinceCode
2742
+ province
2743
+ city
2744
+ address1
2745
+ address2
2746
+ updatedAt
2747
+ createdAt
2655
2748
  }
2656
- function C(a) {
2657
- return typeof a != "string" && (a = String(a)), a;
2749
+ }
2750
+ pageInfo {
2751
+ startCursor
2752
+ endCursor
2753
+ hasNextPage
2754
+ hasPreviousPage
2755
+ }
2756
+ }
2757
+ }
2758
+ `, Jt = x`
2759
+ query GetPurchasingCustomerDiscounts($first: Int, $after: String, $isReverse: Boolean! = false) {
2760
+ purchasingCustomer {
2761
+ id
2762
+ orderPriceAdjustmentRules(first: $first, after: $after, isReverse: $isReverse) {
2763
+ nodes {
2764
+ id
2765
+ title
2766
+ status
2767
+ description
2768
+ code
2769
+ customerApplicable
2770
+ shopifyStoreApplicable
2771
+ applicableLocationCount
2772
+ hasApplicableLocations
2773
+ startsAt
2774
+ endsAt
2775
+ createdAt
2776
+ updatedAt
2658
2777
  }
2659
- function T(a) {
2660
- var l = {
2661
- next: function() {
2662
- var E = a.shift();
2663
- return { done: E === void 0, value: E };
2778
+ pageInfo {
2779
+ startCursor
2780
+ endCursor
2781
+ hasNextPage
2782
+ hasPreviousPage
2783
+ }
2784
+ }
2785
+ }
2786
+ }
2787
+ `, Qt = x`
2788
+ query GetPurchasingCustomerDiscountCodeCount {
2789
+ purchasingCustomer {
2790
+ id
2791
+ orderPriceAdjustmentRuleCount
2792
+ }
2793
+ }
2794
+ `, Xt = x`
2795
+ query GetPurchasingCustomerPointChangeActivities($first: Int, $after: String, $isReverse: Boolean! = false, $sortKeys: PointChangeActivitySortKey! = CREATED_AT) {
2796
+ purchasingCustomer {
2797
+ id
2798
+ pointChangeActivities(
2799
+ first: $first
2800
+ after: $after
2801
+ isReverse: $isReverse
2802
+ sortKeys: $sortKeys
2803
+ ) {
2804
+ nodes {
2805
+ id
2806
+ title
2807
+ tenant {
2808
+ id
2809
+ name
2810
+ }
2811
+ pointChange {
2812
+ id
2813
+ delta
2814
+ availableAt
2815
+ expiresDate
2816
+ availableUntil
2817
+ pointChangeCreatedAt
2818
+ tenant {
2819
+ id
2820
+ name
2664
2821
  }
2665
- };
2666
- return c.iterable && (l[Symbol.iterator] = function() {
2667
- return l;
2668
- }), l;
2822
+ createdAt
2823
+ }
2824
+ retailLocation {
2825
+ id
2826
+ name
2827
+ phone
2828
+ mapURL
2829
+ tags
2830
+ address {
2831
+ id
2832
+ countryCode
2833
+ country
2834
+ postalCode
2835
+ provinceCode
2836
+ province
2837
+ city
2838
+ address1
2839
+ address2
2840
+ updatedAt
2841
+ createdAt
2842
+ }
2843
+ }
2669
2844
  }
2670
- function g(a) {
2671
- this.map = {}, a instanceof g ? a.forEach(function(l, E) {
2672
- this.append(E, l);
2673
- }, this) : Array.isArray(a) ? a.forEach(function(l) {
2674
- this.append(l[0], l[1]);
2675
- }, this) : a && Object.getOwnPropertyNames(a).forEach(function(l) {
2676
- this.append(l, a[l]);
2677
- }, this);
2845
+ pageInfo {
2846
+ startCursor
2847
+ endCursor
2848
+ hasNextPage
2849
+ hasPreviousPage
2678
2850
  }
2679
- g.prototype.append = function(a, l) {
2680
- a = y(a), l = C(l);
2681
- var E = this.map[a];
2682
- this.map[a] = E ? E + ", " + l : l;
2683
- }, g.prototype.delete = function(a) {
2684
- delete this.map[y(a)];
2685
- }, g.prototype.get = function(a) {
2686
- return a = y(a), this.has(a) ? this.map[a] : null;
2687
- }, g.prototype.has = function(a) {
2688
- return this.map.hasOwnProperty(y(a));
2689
- }, g.prototype.set = function(a, l) {
2690
- this.map[y(a)] = C(l);
2691
- }, g.prototype.forEach = function(a, l) {
2692
- for (var E in this.map)
2693
- this.map.hasOwnProperty(E) && a.call(l, this.map[E], E, this);
2694
- }, g.prototype.keys = function() {
2695
- var a = [];
2696
- return this.forEach(function(l, E) {
2697
- a.push(E);
2698
- }), T(a);
2699
- }, g.prototype.values = function() {
2700
- var a = [];
2701
- return this.forEach(function(l) {
2702
- a.push(l);
2703
- }), T(a);
2704
- }, g.prototype.entries = function() {
2705
- var a = [];
2706
- return this.forEach(function(l, E) {
2707
- a.push([E, l]);
2708
- }), T(a);
2709
- }, c.iterable && (g.prototype[Symbol.iterator] = g.prototype.entries);
2710
- function N(a) {
2711
- if (a.bodyUsed)
2712
- return Promise.reject(new TypeError("Already read"));
2713
- a.bodyUsed = !0;
2851
+ }
2852
+ }
2853
+ }
2854
+ `, Wt = x`
2855
+ query GetPurchasingCustomerRank {
2856
+ purchasingCustomer {
2857
+ currentCustomerRank {
2858
+ id
2859
+ name
2860
+ threshold
2861
+ higherRank {
2862
+ id
2863
+ name
2864
+ threshold
2714
2865
  }
2715
- function S(a) {
2716
- return new Promise(function(l, E) {
2717
- a.onload = function() {
2718
- l(a.result);
2719
- }, a.onerror = function() {
2720
- E(a.error);
2721
- };
2722
- });
2866
+ lowerRank {
2867
+ id
2868
+ name
2869
+ threshold
2723
2870
  }
2724
- function D(a) {
2725
- var l = new FileReader(), E = S(l);
2726
- return l.readAsArrayBuffer(a), E;
2871
+ earnedPointToRankUp
2872
+ purchasePriceToRankUp
2873
+ calculationCondition {
2874
+ customerRankCalculationPeriod {
2875
+ start
2876
+ end
2877
+ }
2878
+ earnedPoint
2879
+ purchasePrice
2727
2880
  }
2728
- function z(a) {
2729
- var l = new FileReader(), E = S(l);
2730
- return l.readAsText(a), E;
2881
+ pointMultiplier {
2882
+ id
2883
+ customerRankRule {
2884
+ id
2885
+ name
2886
+ threshold
2887
+ }
2888
+ multiplier
2731
2889
  }
2732
- function _(a) {
2733
- for (var l = new Uint8Array(a), E = new Array(l.length), R = 0; R < l.length; R++)
2734
- E[R] = String.fromCharCode(l[R]);
2735
- return E.join("");
2890
+ }
2891
+ }
2892
+ }
2893
+ `, Kt = x`
2894
+ query GetSharingPurchasingCustomerCount {
2895
+ purchasingCustomer {
2896
+ id
2897
+ sharingPurchasingCustomerCount
2898
+ }
2899
+ }
2900
+ `, Zt = x`
2901
+ query GetPurchasingCustomerSharing {
2902
+ purchasingCustomer {
2903
+ id
2904
+ customerSharing {
2905
+ id
2906
+ purchasingCustomers {
2907
+ id
2908
+ sharingPurchasingCustomerCount
2909
+ tenant {
2910
+ id
2911
+ name
2912
+ }
2736
2913
  }
2737
- function k(a) {
2738
- if (a.slice)
2739
- return a.slice(0);
2740
- var l = new Uint8Array(a.byteLength);
2741
- return l.set(new Uint8Array(a)), l.buffer;
2914
+ }
2915
+ }
2916
+ }
2917
+ `, en = x`
2918
+ query GetProduct($id: String!, $first: Int, $after: String, $isReverse: Boolean! = false, $sortKeys: ProductVariantSortKeys! = CREATED_AT) {
2919
+ productByProductShopifyLegacyResourceID(productShopifyLegacyResourceID: $id) {
2920
+ id
2921
+ title
2922
+ hasBackOrderProductVariants
2923
+ isLocalPickupAvailable
2924
+ productVariants(
2925
+ first: $first
2926
+ after: $after
2927
+ isReverse: $isReverse
2928
+ sortKeys: $sortKeys
2929
+ ) {
2930
+ nodes {
2931
+ id
2932
+ title
2933
+ inventoryItem {
2934
+ id
2935
+ sku
2936
+ }
2937
+ isBackOrderEnable
2938
+ isLocalPickupAvailable
2742
2939
  }
2743
- function B() {
2744
- return this.bodyUsed = !1, this._initBody = function(a) {
2745
- this._bodyInit = a, a ? typeof a == "string" ? this._bodyText = a : c.blob && Blob.prototype.isPrototypeOf(a) ? this._bodyBlob = a : c.formData && FormData.prototype.isPrototypeOf(a) ? this._bodyFormData = a : c.searchParams && URLSearchParams.prototype.isPrototypeOf(a) ? this._bodyText = a.toString() : c.arrayBuffer && c.blob && h(a) ? (this._bodyArrayBuffer = k(a.buffer), this._bodyInit = new Blob([this._bodyArrayBuffer])) : c.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(a) || m(a)) ? this._bodyArrayBuffer = k(a) : this._bodyText = a = Object.prototype.toString.call(a) : this._bodyText = "", this.headers.get("content-type") || (typeof a == "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(a) && this.headers.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"));
2746
- }, c.blob && (this.blob = function() {
2747
- var a = N(this);
2748
- if (a)
2749
- return a;
2750
- if (this._bodyBlob)
2751
- return Promise.resolve(this._bodyBlob);
2752
- if (this._bodyArrayBuffer)
2753
- return Promise.resolve(new Blob([this._bodyArrayBuffer]));
2754
- if (this._bodyFormData)
2755
- throw new Error("could not read FormData body as blob");
2756
- return Promise.resolve(new Blob([this._bodyText]));
2757
- }, this.arrayBuffer = function() {
2758
- return this._bodyArrayBuffer ? N(this) || Promise.resolve(this._bodyArrayBuffer) : this.blob().then(D);
2759
- }), this.text = function() {
2760
- var a = N(this);
2761
- if (a)
2762
- return a;
2763
- if (this._bodyBlob)
2764
- return z(this._bodyBlob);
2765
- if (this._bodyArrayBuffer)
2766
- return Promise.resolve(_(this._bodyArrayBuffer));
2767
- if (this._bodyFormData)
2768
- throw new Error("could not read FormData body as text");
2769
- return Promise.resolve(this._bodyText);
2770
- }, c.formData && (this.formData = function() {
2771
- return this.text().then(Ge);
2772
- }), this.json = function() {
2773
- return this.text().then(JSON.parse);
2774
- }, this;
2775
- }
2776
- var Q = ["DELETE", "GET", "HEAD", "OPTIONS", "POST", "PUT"];
2777
- function J(a) {
2778
- var l = a.toUpperCase();
2779
- return Q.indexOf(l) > -1 ? l : a;
2780
- }
2781
- function w(a, l) {
2782
- l = l || {};
2783
- var E = l.body;
2784
- if (a instanceof w) {
2785
- if (a.bodyUsed)
2786
- throw new TypeError("Already read");
2787
- this.url = a.url, this.credentials = a.credentials, l.headers || (this.headers = new g(a.headers)), this.method = a.method, this.mode = a.mode, this.signal = a.signal, !E && a._bodyInit != null && (E = a._bodyInit, a.bodyUsed = !0);
2788
- } else
2789
- this.url = String(a);
2790
- if (this.credentials = l.credentials || this.credentials || "same-origin", (l.headers || !this.headers) && (this.headers = new g(l.headers)), this.method = J(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)
2791
- throw new TypeError("Body not allowed for GET or HEAD requests");
2792
- this._initBody(E);
2793
- }
2794
- w.prototype.clone = function() {
2795
- return new w(this, { body: this._bodyInit });
2796
- };
2797
- function Ge(a) {
2798
- var l = new FormData();
2799
- return a.trim().split("&").forEach(function(E) {
2800
- if (E) {
2801
- var R = E.split("="), x = R.shift().replace(/\+/g, " "), A = R.join("=").replace(/\+/g, " ");
2802
- l.append(decodeURIComponent(x), decodeURIComponent(A));
2803
- }
2804
- }), l;
2805
- }
2806
- function $e(a) {
2807
- var l = new g(), E = a.replace(/\r?\n[\t ]+/g, " ");
2808
- return E.split(/\r?\n/).forEach(function(R) {
2809
- var x = R.split(":"), A = x.shift().trim();
2810
- if (A) {
2811
- var X = x.join(":").trim();
2812
- l.append(A, X);
2813
- }
2814
- }), l;
2815
- }
2816
- B.call(w.prototype);
2817
- function L(a, l) {
2818
- 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(a);
2819
- }
2820
- B.call(L.prototype), L.prototype.clone = function() {
2821
- return new L(this._bodyInit, {
2822
- status: this.status,
2823
- statusText: this.statusText,
2824
- headers: new g(this.headers),
2825
- url: this.url
2826
- });
2827
- }, L.error = function() {
2828
- var a = new L(null, { status: 0, statusText: "" });
2829
- return a.type = "error", a;
2830
- };
2831
- var je = [301, 302, 303, 307, 308];
2832
- L.redirect = function(a, l) {
2833
- if (je.indexOf(l) === -1)
2834
- throw new RangeError("Invalid status code");
2835
- return new L(null, { status: l, headers: { location: a } });
2836
- }, o.DOMException = s.DOMException;
2837
- try {
2838
- new o.DOMException();
2839
- } catch {
2840
- o.DOMException = function(l, E) {
2841
- this.message = l, this.name = E;
2842
- var R = Error(l);
2843
- this.stack = R.stack;
2844
- }, o.DOMException.prototype = Object.create(Error.prototype), o.DOMException.prototype.constructor = o.DOMException;
2845
- }
2846
- function ae(a, l) {
2847
- return new Promise(function(E, R) {
2848
- var x = new w(a, l);
2849
- if (x.signal && x.signal.aborted)
2850
- return R(new o.DOMException("Aborted", "AbortError"));
2851
- var A = new XMLHttpRequest();
2852
- function X() {
2853
- A.abort();
2854
- }
2855
- A.onload = function() {
2856
- var G = {
2857
- status: A.status,
2858
- statusText: A.statusText,
2859
- headers: $e(A.getAllResponseHeaders() || "")
2860
- };
2861
- G.url = "responseURL" in A ? A.responseURL : G.headers.get("X-Request-URL");
2862
- var ue = "response" in A ? A.response : A.responseText;
2863
- E(new L(ue, G));
2864
- }, A.onerror = function() {
2865
- R(new TypeError("Network request failed"));
2866
- }, A.ontimeout = function() {
2867
- R(new TypeError("Network request failed"));
2868
- }, A.onabort = function() {
2869
- R(new o.DOMException("Aborted", "AbortError"));
2870
- }, A.open(x.method, x.url, !0), x.credentials === "include" ? A.withCredentials = !0 : x.credentials === "omit" && (A.withCredentials = !1), "responseType" in A && c.blob && (A.responseType = "blob"), x.headers.forEach(function(G, ue) {
2871
- A.setRequestHeader(ue, G);
2872
- }), x.signal && (x.signal.addEventListener("abort", X), A.onreadystatechange = function() {
2873
- A.readyState === 4 && x.signal.removeEventListener("abort", X);
2874
- }), A.send(typeof x._bodyInit > "u" ? null : x._bodyInit);
2875
- });
2940
+ pageInfo {
2941
+ startCursor
2942
+ endCursor
2943
+ hasNextPage
2944
+ hasPreviousPage
2876
2945
  }
2877
- return ae.polyfill = !0, s.fetch || (s.fetch = ae, s.Headers = g, s.Request = w, s.Response = L), o.Headers = g, o.Request = w, o.Response = L, o.fetch = ae, Object.defineProperty(o, "__esModule", { value: !0 }), o;
2878
- })({});
2879
- })(r), r.fetch.ponyfill = !0, delete r.fetch.polyfill;
2880
- var i = r;
2881
- 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;
2882
- })(ge, ge.exports);
2883
- var ne = ge.exports;
2884
- const ee = /* @__PURE__ */ Vt(ne), Gt = /* @__PURE__ */ ze({
2885
- __proto__: null,
2886
- default: ee
2887
- }, [ne]), U = (e) => {
2888
- let t = {};
2889
- return e && (typeof Headers < "u" && e instanceof Headers || Gt && ne.Headers && e instanceof ne.Headers ? t = Je(e) : Array.isArray(e) ? e.forEach(([n, r]) => {
2890
- n && r !== void 0 && (t[n] = r);
2891
- }) : t = e), t;
2892
- }, Oe = (e) => e.replace(/([\s,]|#[^\n\r]+)+/g, " ").trim(), $t = (e) => {
2893
- if (!Array.isArray(e.query)) {
2894
- const r = e, i = [`query=${encodeURIComponent(Oe(r.query))}`];
2895
- return e.variables && i.push(`variables=${encodeURIComponent(r.jsonSerializer.stringify(r.variables))}`), r.operationName && i.push(`operationName=${encodeURIComponent(r.operationName)}`), i.join("&");
2896
- }
2897
- if (typeof e.variables < "u" && !Array.isArray(e.variables))
2898
- throw new Error("Cannot create query with given variable type, array expected");
2899
- const t = e, n = e.query.reduce((r, i, s) => (r.push({
2900
- query: Oe(i),
2901
- variables: t.variables ? t.jsonSerializer.stringify(t.variables[s]) : void 0
2902
- }), r), []);
2903
- return `query=${encodeURIComponent(t.jsonSerializer.stringify(n))}`;
2904
- }, jt = (e) => async (t) => {
2905
- const { url: n, query: r, variables: i, operationName: s, fetch: o, fetchOptions: c, middleware: h } = t, p = { ...t.headers };
2906
- let m = "", y;
2907
- e === "POST" ? (y = Yt(r, i, s, c.jsonSerializer), typeof y == "string" && (p["Content-Type"] = "application/json")) : m = $t({
2908
- query: r,
2909
- variables: i,
2910
- operationName: s,
2911
- jsonSerializer: c.jsonSerializer ?? Ce
2912
- });
2913
- const C = {
2914
- method: e,
2915
- headers: p,
2916
- body: y,
2917
- ...c
2918
- };
2919
- let T = n, g = C;
2920
- if (h) {
2921
- const N = await Promise.resolve(h({ ...C, url: n, operationName: s, variables: i })), { url: S, ...D } = N;
2922
- T = S, g = D;
2923
- }
2924
- return m && (T = `${T}?${m}`), await o(T, g);
2925
- };
2926
- class Ht {
2927
- constructor(t, n = {}) {
2928
- this.url = t, this.requestConfig = n, this.rawRequest = async (...r) => {
2929
- const [i, s, o] = r, c = We(i, s, o), { headers: h, fetch: p = ee, method: m = "POST", requestMiddleware: y, responseMiddleware: C, ...T } = this.requestConfig, { url: g } = this;
2930
- c.signal !== void 0 && (T.signal = c.signal);
2931
- const { operationName: N } = le(c.query);
2932
- return de({
2933
- url: g,
2934
- query: c.query,
2935
- variables: c.variables,
2936
- headers: {
2937
- ...U(he(h)),
2938
- ...U(c.requestHeaders)
2939
- },
2940
- operationName: N,
2941
- fetch: p,
2942
- method: m,
2943
- fetchOptions: T,
2944
- middleware: y
2945
- }).then((S) => (C && C(S), S)).catch((S) => {
2946
- throw C && C(S), S;
2947
- });
2948
- };
2949
- }
2950
- async request(t, ...n) {
2951
- const [r, i] = n, s = Xe(t, r, i), { headers: o, fetch: c = ee, method: h = "POST", requestMiddleware: p, responseMiddleware: m, ...y } = this.requestConfig, { url: C } = this;
2952
- s.signal !== void 0 && (y.signal = s.signal);
2953
- const { query: T, operationName: g } = le(s.document);
2954
- return de({
2955
- url: C,
2956
- query: T,
2957
- variables: s.variables,
2958
- headers: {
2959
- ...U(he(o)),
2960
- ...U(s.requestHeaders)
2961
- },
2962
- operationName: g,
2963
- fetch: c,
2964
- method: h,
2965
- fetchOptions: y,
2966
- middleware: p
2967
- }).then((N) => (m && m(N), N.data)).catch((N) => {
2968
- throw m && m(N), N;
2969
- });
2970
- }
2971
- // prettier-ignore
2972
- batchRequests(t, n) {
2973
- const r = Ke(t, n), { headers: i, ...s } = this.requestConfig;
2974
- r.signal !== void 0 && (s.signal = r.signal);
2975
- const o = r.documents.map(({ document: h }) => le(h).query), c = r.documents.map(({ variables: h }) => h);
2976
- return de({
2977
- url: this.url,
2978
- query: o,
2979
- // @ts-expect-error TODO reconcile batch variables into system.
2980
- variables: c,
2981
- headers: {
2982
- ...U(he(i)),
2983
- ...U(r.requestHeaders)
2984
- },
2985
- operationName: void 0,
2986
- fetch: this.requestConfig.fetch ?? ee,
2987
- method: this.requestConfig.method || "POST",
2988
- fetchOptions: s,
2989
- middleware: this.requestConfig.requestMiddleware
2990
- }).then((h) => (this.requestConfig.responseMiddleware && this.requestConfig.responseMiddleware(h), h.data)).catch((h) => {
2991
- throw this.requestConfig.responseMiddleware && this.requestConfig.responseMiddleware(h), h;
2992
- });
2993
- }
2994
- setHeaders(t) {
2995
- return this.requestConfig.headers = t, this;
2996
- }
2997
- /**
2998
- * Attach a header to the client. All subsequent requests will have this header.
2999
- */
3000
- setHeader(t, n) {
3001
- const { headers: r } = this.requestConfig;
3002
- return r ? r[t] = n : this.requestConfig.headers = { [t]: n }, this;
3003
- }
3004
- /**
3005
- * Change the client endpoint. All subsequent requests will send to this endpoint.
3006
- */
3007
- setEndpoint(t) {
3008
- return this.url = t, this;
2946
+ }
3009
2947
  }
3010
2948
  }
3011
- const de = async (e) => {
3012
- const { query: t, variables: n, fetchOptions: r } = e, i = jt(Qe(e.method ?? "post")), s = Array.isArray(e.query), o = await i(e), c = await zt(o, r.jsonSerializer ?? Ce), h = Array.isArray(c) ? !c.some(({ data: m }) => !m) : !!c.data, p = Array.isArray(c) || !c.errors || Array.isArray(c.errors) && !c.errors.length || r.errorPolicy === "all" || r.errorPolicy === "ignore";
3013
- if (o.ok && p && h) {
3014
- const { errors: m, ...y } = (Array.isArray(c), c), C = r.errorPolicy === "ignore" ? y : c;
3015
- return {
3016
- ...s ? { data: C } : C,
3017
- headers: o.headers,
3018
- status: o.status
3019
- };
3020
- } else {
3021
- const m = typeof c == "string" ? {
3022
- error: c
3023
- } : c;
3024
- throw new H(
3025
- // @ts-expect-error TODO
3026
- { ...m, status: o.status, headers: o.headers },
3027
- { query: t, variables: n }
3028
- );
3029
- }
3030
- }, Yt = (e, t, n, r) => {
3031
- const i = r ?? Ce;
3032
- if (!Array.isArray(e))
3033
- return i.stringify({ query: e, variables: t, operationName: n });
3034
- if (typeof t < "u" && !Array.isArray(t))
3035
- throw new Error("Cannot create request body with given variable type, array expected");
3036
- const s = e.reduce((o, c, h) => (o.push({ query: c, variables: t ? t[h] : void 0 }), o), []);
3037
- return i.stringify(s);
3038
- }, zt = async (e, t) => {
3039
- let n;
3040
- return e.headers.forEach((r, i) => {
3041
- i.toLowerCase() === "content-type" && (n = r);
3042
- }), 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();
3043
- }, he = (e) => typeof e == "function" ? e() : e;
3044
- var re = function() {
3045
- return re = Object.assign || function(t) {
3046
- for (var n, r = 1, i = arguments.length; r < i; r++) {
3047
- n = arguments[r];
3048
- for (var s in n)
3049
- Object.prototype.hasOwnProperty.call(n, s) && (t[s] = n[s]);
2949
+ `, tn = x`
2950
+ query GetPointCampaignOrderRuleTargetCustomerRank {
2951
+ pointCampaignOrderRuleTargetCustomerRank {
2952
+ pointCampaignOrderRule {
2953
+ id
2954
+ title
3050
2955
  }
3051
- return t;
3052
- }, re.apply(this, arguments);
3053
- };
3054
- var te = /* @__PURE__ */ new Map(), ye = /* @__PURE__ */ new Map(), qe = !0, ie = !1;
3055
- function Ve(e) {
3056
- return e.replace(/[\s,]+/g, " ").trim();
3057
- }
3058
- function Qt(e) {
3059
- return Ve(e.source.body.substring(e.start, e.end));
3060
- }
3061
- function Jt(e) {
3062
- var t = /* @__PURE__ */ new Set(), n = [];
3063
- return e.definitions.forEach(function(r) {
3064
- if (r.kind === "FragmentDefinition") {
3065
- var i = r.name.value, s = Qt(r.loc), o = ye.get(i);
3066
- o && !o.has(s) ? qe && console.warn("Warning: fragment with name " + i + ` already exists.
3067
- graphql-tag enforces all fragment names across your application to be unique; read more about
3068
- this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`) : o || ye.set(i, o = /* @__PURE__ */ new Set()), o.add(s), t.has(s) || (t.add(s), n.push(r));
3069
- } else
3070
- n.push(r);
3071
- }), re(re({}, e), { definitions: n });
3072
- }
3073
- function Xt(e) {
3074
- var t = new Set(e.definitions);
3075
- t.forEach(function(r) {
3076
- r.loc && delete r.loc, Object.keys(r).forEach(function(i) {
3077
- var s = r[i];
3078
- s && typeof s == "object" && t.add(s);
3079
- });
3080
- });
3081
- var n = e.loc;
3082
- return n && (delete n.startToken, delete n.endToken), e;
3083
- }
3084
- function Wt(e) {
3085
- var t = Ve(e);
3086
- if (!te.has(t)) {
3087
- var n = Ue(e, {
3088
- experimentalFragmentVariables: ie,
3089
- allowLegacyFragmentVariables: ie
3090
- });
3091
- if (!n || n.kind !== "Document")
3092
- throw new Error("Not a valid GraphQL document.");
3093
- te.set(t, Xt(Jt(n)));
2956
+ multiplier
2957
+ fixedPoint
3094
2958
  }
3095
- return te.get(t);
3096
2959
  }
3097
- function q(e) {
3098
- for (var t = [], n = 1; n < arguments.length; n++)
3099
- t[n - 1] = arguments[n];
3100
- typeof e == "string" && (e = [e]);
3101
- var r = e[0];
3102
- return t.forEach(function(i, s) {
3103
- i && i.kind === "Document" ? r += i.loc.source.body : r += i, r += e[s + 1];
3104
- }), Wt(r);
3105
- }
3106
- function Kt() {
3107
- te.clear(), ye.clear();
3108
- }
3109
- function Zt() {
3110
- qe = !1;
3111
- }
3112
- function en() {
3113
- ie = !0;
2960
+ `, nn = x`
2961
+ query GetEstimatedShopifyCartPoint($input: EstimatedShopifyCartPointInput!) {
2962
+ estimatedShopifyCartPoint(input: $input) {
2963
+ pointsEarned
2964
+ }
3114
2965
  }
3115
- function tn() {
3116
- ie = !1;
2966
+ `, rn = x`
2967
+ query GetEstimatedShopifyCartLineItemPoint($input: EstimatedShopifyCartLineItemPointInput!) {
2968
+ estimatedShopifyCartLineItemPoint(input: $input) {
2969
+ pointsEarned
2970
+ }
3117
2971
  }
3118
- var $ = {
3119
- gql: q,
3120
- resetCaches: Kt,
3121
- disableFragmentWarnings: Zt,
3122
- enableExperimentalFragmentVariables: en,
3123
- disableExperimentalFragmentVariables: tn
3124
- };
3125
- (function(e) {
3126
- e.gql = $.gql, e.resetCaches = $.resetCaches, e.disableFragmentWarnings = $.disableFragmentWarnings, e.enableExperimentalFragmentVariables = $.enableExperimentalFragmentVariables, e.disableExperimentalFragmentVariables = $.disableExperimentalFragmentVariables;
3127
- })(q || (q = {}));
3128
- q.default = q;
3129
- const O = q, nn = O`
3130
- query GetLocationAvailabilities($sku: String!, $first: Int, $after: String, $isReverse: Boolean! = false) {
3131
- locationAvailabilities(
3132
- sku: $sku
3133
- first: $first
3134
- after: $after
3135
- isReverse: $isReverse
3136
- ) {
3137
- nodes {
3138
- location {
3139
- id
3140
- name
3141
- phone
3142
- mapURL
3143
- tags
3144
- address {
3145
- id
3146
- countryCode
3147
- country
3148
- postalCode
3149
- provinceCode
3150
- province
3151
- city
3152
- address1
3153
- address2
3154
- updatedAt
3155
- createdAt
3156
- }
3157
- }
3158
- inventoryQuantity
3159
- }
3160
- pageInfo {
3161
- startCursor
3162
- endCursor
3163
- hasNextPage
3164
- hasPreviousPage
2972
+ `, sn = x`
2973
+ mutation PurchasingCustomerSendCustomerSharingActivationCode {
2974
+ purchasingCustomerSendCustomerSharingActivationCode {
2975
+ purchasingCustomer {
2976
+ id
2977
+ sharingPurchasingCustomerCount
2978
+ tenant {
2979
+ id
2980
+ name
2981
+ }
2982
+ }
2983
+ customerSharingActivationCode {
2984
+ id
3165
2985
  }
3166
2986
  }
3167
2987
  }
3168
- `, rn = O`
3169
- query GetLocationAvailability($sku: String!, $locationID: ID!) {
3170
- locationAvailability(sku: $sku, locationID: $locationID) {
3171
- location {
2988
+ `, on = x`
2989
+ mutation PurchasingCustomerActivateCustomerSharing($email: String!, $activationCode: String!) {
2990
+ purchasingCustomerActivateCustomerSharing(
2991
+ input: {email: $email, activationCode: $activationCode}
2992
+ ) {
2993
+ purchasingCustomer {
3172
2994
  id
3173
- name
3174
- phone
3175
- mapURL
3176
- tags
3177
- address {
2995
+ sharingPurchasingCustomerCount
2996
+ tenant {
3178
2997
  id
3179
- countryCode
3180
- country
3181
- postalCode
3182
- provinceCode
3183
- province
3184
- city
3185
- address1
3186
- address2
3187
- updatedAt
3188
- createdAt
2998
+ name
3189
2999
  }
3190
3000
  }
3191
- inventoryQuantity
3192
3001
  }
3193
3002
  }
3194
- `, sn = O`
3195
- query GetPurchasingCustomerMetafield($namespace: String!, $key: String!) {
3196
- purchasingCustomerMetafield(namespace: $namespace, key: $key) {
3197
- id
3198
- namespace
3199
- key
3200
- value
3201
- }
3003
+ `, an = (e, t, n, r) => e();
3004
+ function un(e, t = an) {
3005
+ return {
3006
+ GetLocationAvailabilities(n, r) {
3007
+ return t((i) => e.request($t, n, { ...r, ...i }), "GetLocationAvailabilities", "query", n);
3008
+ },
3009
+ GetLocationAvailability(n, r) {
3010
+ return t((i) => e.request(jt, n, { ...r, ...i }), "GetLocationAvailability", "query", n);
3011
+ },
3012
+ GetPurchasingCustomerMetafield(n, r) {
3013
+ return t((i) => e.request(Ht, n, { ...r, ...i }), "GetPurchasingCustomerMetafield", "query", n);
3014
+ },
3015
+ GetPoints(n, r) {
3016
+ return t((i) => e.request(Yt, n, { ...r, ...i }), "GetPoints", "query", n);
3017
+ },
3018
+ GetLocations(n, r) {
3019
+ return t((i) => e.request(zt, n, { ...r, ...i }), "GetLocations", "query", n);
3020
+ },
3021
+ GetPurchasingCustomerDiscounts(n, r) {
3022
+ return t((i) => e.request(Jt, n, { ...r, ...i }), "GetPurchasingCustomerDiscounts", "query", n);
3023
+ },
3024
+ GetPurchasingCustomerDiscountCodeCount(n, r) {
3025
+ return t((i) => e.request(Qt, n, { ...r, ...i }), "GetPurchasingCustomerDiscountCodeCount", "query", n);
3026
+ },
3027
+ GetPurchasingCustomerPointChangeActivities(n, r) {
3028
+ return t((i) => e.request(Xt, n, { ...r, ...i }), "GetPurchasingCustomerPointChangeActivities", "query", n);
3029
+ },
3030
+ GetPurchasingCustomerRank(n, r) {
3031
+ return t((i) => e.request(Wt, n, { ...r, ...i }), "GetPurchasingCustomerRank", "query", n);
3032
+ },
3033
+ GetSharingPurchasingCustomerCount(n, r) {
3034
+ return t((i) => e.request(Kt, n, { ...r, ...i }), "GetSharingPurchasingCustomerCount", "query", n);
3035
+ },
3036
+ GetPurchasingCustomerSharing(n, r) {
3037
+ return t((i) => e.request(Zt, n, { ...r, ...i }), "GetPurchasingCustomerSharing", "query", n);
3038
+ },
3039
+ GetProduct(n, r) {
3040
+ return t((i) => e.request(en, n, { ...r, ...i }), "GetProduct", "query", n);
3041
+ },
3042
+ GetPointCampaignOrderRuleTargetCustomerRank(n, r) {
3043
+ return t((i) => e.request(tn, n, { ...r, ...i }), "GetPointCampaignOrderRuleTargetCustomerRank", "query", n);
3044
+ },
3045
+ GetEstimatedShopifyCartPoint(n, r) {
3046
+ return t((i) => e.request(nn, n, { ...r, ...i }), "GetEstimatedShopifyCartPoint", "query", n);
3047
+ },
3048
+ GetEstimatedShopifyCartLineItemPoint(n, r) {
3049
+ return t((i) => e.request(rn, n, { ...r, ...i }), "GetEstimatedShopifyCartLineItemPoint", "query", n);
3050
+ },
3051
+ PurchasingCustomerSendCustomerSharingActivationCode(n, r) {
3052
+ return t((i) => e.request(sn, n, { ...r, ...i }), "PurchasingCustomerSendCustomerSharingActivationCode", "mutation", n);
3053
+ },
3054
+ PurchasingCustomerActivateCustomerSharing(n, r) {
3055
+ return t((i) => e.request(on, n, { ...r, ...i }), "PurchasingCustomerActivateCustomerSharing", "mutation", n);
3056
+ }
3057
+ };
3202
3058
  }
3203
- `, on = O`
3204
- query GetPoints {
3205
- purchasingCustomer {
3206
- pointsApproved
3207
- pointsPending
3059
+ const ve = JSON, cn = (e) => e.toUpperCase(), ln = (e) => {
3060
+ const t = {};
3061
+ return e.forEach((n, r) => {
3062
+ t[r] = n;
3063
+ }), t;
3064
+ }, dn = (e, t, n) => e.document ? e : {
3065
+ document: e,
3066
+ variables: t,
3067
+ requestHeaders: n,
3068
+ signal: void 0
3069
+ }, hn = (e, t, n) => e.query ? e : {
3070
+ query: e,
3071
+ variables: t,
3072
+ requestHeaders: n,
3073
+ signal: void 0
3074
+ }, pn = (e, t) => e.documents ? e : {
3075
+ documents: e,
3076
+ requestHeaders: t,
3077
+ signal: void 0
3078
+ }, xe = (e) => {
3079
+ var r, i;
3080
+ let t;
3081
+ const n = e.definitions.filter((s) => s.kind === "OperationDefinition");
3082
+ return n.length === 1 && (t = (i = (r = n[0]) == null ? void 0 : r.name) == null ? void 0 : i.value), t;
3083
+ }, le = (e) => {
3084
+ if (typeof e == "string") {
3085
+ let n;
3086
+ try {
3087
+ const r = Ue(e);
3088
+ n = xe(r);
3089
+ } catch {
3090
+ }
3091
+ return { query: e, operationName: n };
3092
+ }
3093
+ const t = xe(e);
3094
+ return { query: Pt(e), operationName: t };
3095
+ };
3096
+ class H extends Error {
3097
+ constructor(t, n) {
3098
+ const r = `${H.extractMessage(t)}: ${JSON.stringify({
3099
+ response: t,
3100
+ request: n
3101
+ })}`;
3102
+ super(r), Object.setPrototypeOf(this, H.prototype), this.response = t, this.request = n, typeof Error.captureStackTrace == "function" && Error.captureStackTrace(this, H);
3103
+ }
3104
+ static extractMessage(t) {
3105
+ var n, r;
3106
+ return ((r = (n = t.errors) == null ? void 0 : n[0]) == null ? void 0 : r.message) ?? `GraphQL Error (Code: ${t.status})`;
3208
3107
  }
3209
3108
  }
3210
- `, an = O`
3211
- query GetLocations($tag: String, $provinceCodes: [String!], $first: Int, $after: String, $isReverse: Boolean! = false) {
3212
- locations(
3213
- first: $first
3214
- after: $after
3215
- isReverse: $isReverse
3216
- filter: {tag: $tag, provinceCodes: $provinceCodes}
3217
- ) {
3218
- nodes {
3219
- id
3220
- name
3221
- phone
3222
- mapURL
3223
- tags
3224
- address {
3225
- id
3226
- countryCode
3227
- country
3228
- postalCode
3229
- provinceCode
3230
- province
3231
- city
3232
- address1
3233
- address2
3234
- updatedAt
3235
- createdAt
3109
+ var fn = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
3110
+ function mn(e) {
3111
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
3112
+ }
3113
+ var ye = { exports: {} };
3114
+ (function(e, t) {
3115
+ var n = typeof self < "u" ? self : fn, r = function() {
3116
+ function s() {
3117
+ this.fetch = !1, this.DOMException = n.DOMException;
3118
+ }
3119
+ return s.prototype = n, new s();
3120
+ }();
3121
+ (function(s) {
3122
+ (function(o) {
3123
+ var c = {
3124
+ searchParams: "URLSearchParams" in s,
3125
+ iterable: "Symbol" in s && "iterator" in Symbol,
3126
+ blob: "FileReader" in s && "Blob" in s && function() {
3127
+ try {
3128
+ return new Blob(), !0;
3129
+ } catch {
3130
+ return !1;
3131
+ }
3132
+ }(),
3133
+ formData: "FormData" in s,
3134
+ arrayBuffer: "ArrayBuffer" in s
3135
+ };
3136
+ function h(a) {
3137
+ return a && DataView.prototype.isPrototypeOf(a);
3138
+ }
3139
+ if (c.arrayBuffer)
3140
+ var p = [
3141
+ "[object Int8Array]",
3142
+ "[object Uint8Array]",
3143
+ "[object Uint8ClampedArray]",
3144
+ "[object Int16Array]",
3145
+ "[object Uint16Array]",
3146
+ "[object Int32Array]",
3147
+ "[object Uint32Array]",
3148
+ "[object Float32Array]",
3149
+ "[object Float64Array]"
3150
+ ], m = ArrayBuffer.isView || function(a) {
3151
+ return a && p.indexOf(Object.prototype.toString.call(a)) > -1;
3152
+ };
3153
+ function y(a) {
3154
+ if (typeof a != "string" && (a = String(a)), /[^a-z0-9\-#$%&'*+.^_`|~]/i.test(a))
3155
+ throw new TypeError("Invalid character in header field name");
3156
+ return a.toLowerCase();
3157
+ }
3158
+ function C(a) {
3159
+ return typeof a != "string" && (a = String(a)), a;
3160
+ }
3161
+ function T(a) {
3162
+ var l = {
3163
+ next: function() {
3164
+ var E = a.shift();
3165
+ return { done: E === void 0, value: E };
3166
+ }
3167
+ };
3168
+ return c.iterable && (l[Symbol.iterator] = function() {
3169
+ return l;
3170
+ }), l;
3171
+ }
3172
+ function g(a) {
3173
+ this.map = {}, a instanceof g ? a.forEach(function(l, E) {
3174
+ this.append(E, l);
3175
+ }, this) : Array.isArray(a) ? a.forEach(function(l) {
3176
+ this.append(l[0], l[1]);
3177
+ }, this) : a && Object.getOwnPropertyNames(a).forEach(function(l) {
3178
+ this.append(l, a[l]);
3179
+ }, this);
3180
+ }
3181
+ g.prototype.append = function(a, l) {
3182
+ a = y(a), l = C(l);
3183
+ var E = this.map[a];
3184
+ this.map[a] = E ? E + ", " + l : l;
3185
+ }, g.prototype.delete = function(a) {
3186
+ delete this.map[y(a)];
3187
+ }, g.prototype.get = function(a) {
3188
+ return a = y(a), this.has(a) ? this.map[a] : null;
3189
+ }, g.prototype.has = function(a) {
3190
+ return this.map.hasOwnProperty(y(a));
3191
+ }, g.prototype.set = function(a, l) {
3192
+ this.map[y(a)] = C(l);
3193
+ }, g.prototype.forEach = function(a, l) {
3194
+ for (var E in this.map)
3195
+ this.map.hasOwnProperty(E) && a.call(l, this.map[E], E, this);
3196
+ }, g.prototype.keys = function() {
3197
+ var a = [];
3198
+ return this.forEach(function(l, E) {
3199
+ a.push(E);
3200
+ }), T(a);
3201
+ }, g.prototype.values = function() {
3202
+ var a = [];
3203
+ return this.forEach(function(l) {
3204
+ a.push(l);
3205
+ }), T(a);
3206
+ }, g.prototype.entries = function() {
3207
+ var a = [];
3208
+ return this.forEach(function(l, E) {
3209
+ a.push([E, l]);
3210
+ }), T(a);
3211
+ }, c.iterable && (g.prototype[Symbol.iterator] = g.prototype.entries);
3212
+ function N(a) {
3213
+ if (a.bodyUsed)
3214
+ return Promise.reject(new TypeError("Already read"));
3215
+ a.bodyUsed = !0;
3216
+ }
3217
+ function O(a) {
3218
+ return new Promise(function(l, E) {
3219
+ a.onload = function() {
3220
+ l(a.result);
3221
+ }, a.onerror = function() {
3222
+ E(a.error);
3223
+ };
3224
+ });
3225
+ }
3226
+ function D(a) {
3227
+ var l = new FileReader(), E = O(l);
3228
+ return l.readAsArrayBuffer(a), E;
3236
3229
  }
3237
- }
3238
- pageInfo {
3239
- startCursor
3240
- endCursor
3241
- hasNextPage
3242
- hasPreviousPage
3243
- }
3244
- }
3245
- }
3246
- `, un = O`
3247
- query GetPurchasingCustomerDiscounts($first: Int, $after: String, $isReverse: Boolean! = false) {
3248
- purchasingCustomer {
3249
- id
3250
- orderPriceAdjustmentRules(first: $first, after: $after, isReverse: $isReverse) {
3251
- nodes {
3252
- id
3253
- title
3254
- status
3255
- description
3256
- code
3257
- customerApplicable
3258
- shopifyStoreApplicable
3259
- applicableLocationCount
3260
- hasApplicableLocations
3261
- startsAt
3262
- endsAt
3263
- createdAt
3264
- updatedAt
3230
+ function z(a) {
3231
+ var l = new FileReader(), E = O(l);
3232
+ return l.readAsText(a), E;
3265
3233
  }
3266
- pageInfo {
3267
- startCursor
3268
- endCursor
3269
- hasNextPage
3270
- hasPreviousPage
3234
+ function _(a) {
3235
+ for (var l = new Uint8Array(a), E = new Array(l.length), R = 0; R < l.length; R++)
3236
+ E[R] = String.fromCharCode(l[R]);
3237
+ return E.join("");
3271
3238
  }
3272
- }
3273
- }
3274
- }
3275
- `, cn = O`
3276
- query GetPurchasingCustomerDiscountCodeCount {
3277
- purchasingCustomer {
3278
- id
3279
- orderPriceAdjustmentRuleCount
3280
- }
3281
- }
3282
- `, ln = O`
3283
- query GetPurchasingCustomerPointChangeActivities($first: Int, $after: String, $isReverse: Boolean! = false, $sortKeys: PointChangeActivitySortKey! = CREATED_AT) {
3284
- purchasingCustomer {
3285
- id
3286
- pointChangeActivities(
3287
- first: $first
3288
- after: $after
3289
- isReverse: $isReverse
3290
- sortKeys: $sortKeys
3291
- ) {
3292
- nodes {
3293
- id
3294
- title
3295
- tenant {
3296
- id
3297
- name
3298
- }
3299
- pointChange {
3300
- id
3301
- delta
3302
- availableAt
3303
- expiresDate
3304
- availableUntil
3305
- pointChangeCreatedAt
3306
- tenant {
3307
- id
3308
- name
3309
- }
3310
- createdAt
3311
- }
3312
- retailLocation {
3313
- id
3314
- name
3315
- phone
3316
- mapURL
3317
- tags
3318
- address {
3319
- id
3320
- countryCode
3321
- country
3322
- postalCode
3323
- provinceCode
3324
- province
3325
- city
3326
- address1
3327
- address2
3328
- updatedAt
3329
- createdAt
3330
- }
3331
- }
3239
+ function k(a) {
3240
+ if (a.slice)
3241
+ return a.slice(0);
3242
+ var l = new Uint8Array(a.byteLength);
3243
+ return l.set(new Uint8Array(a)), l.buffer;
3332
3244
  }
3333
- pageInfo {
3334
- startCursor
3335
- endCursor
3336
- hasNextPage
3337
- hasPreviousPage
3245
+ function B() {
3246
+ return this.bodyUsed = !1, this._initBody = function(a) {
3247
+ this._bodyInit = a, a ? typeof a == "string" ? this._bodyText = a : c.blob && Blob.prototype.isPrototypeOf(a) ? this._bodyBlob = a : c.formData && FormData.prototype.isPrototypeOf(a) ? this._bodyFormData = a : c.searchParams && URLSearchParams.prototype.isPrototypeOf(a) ? this._bodyText = a.toString() : c.arrayBuffer && c.blob && h(a) ? (this._bodyArrayBuffer = k(a.buffer), this._bodyInit = new Blob([this._bodyArrayBuffer])) : c.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(a) || m(a)) ? this._bodyArrayBuffer = k(a) : this._bodyText = a = Object.prototype.toString.call(a) : this._bodyText = "", this.headers.get("content-type") || (typeof a == "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(a) && this.headers.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"));
3248
+ }, c.blob && (this.blob = function() {
3249
+ var a = N(this);
3250
+ if (a)
3251
+ return a;
3252
+ if (this._bodyBlob)
3253
+ return Promise.resolve(this._bodyBlob);
3254
+ if (this._bodyArrayBuffer)
3255
+ return Promise.resolve(new Blob([this._bodyArrayBuffer]));
3256
+ if (this._bodyFormData)
3257
+ throw new Error("could not read FormData body as blob");
3258
+ return Promise.resolve(new Blob([this._bodyText]));
3259
+ }, this.arrayBuffer = function() {
3260
+ return this._bodyArrayBuffer ? N(this) || Promise.resolve(this._bodyArrayBuffer) : this.blob().then(D);
3261
+ }), this.text = function() {
3262
+ var a = N(this);
3263
+ if (a)
3264
+ return a;
3265
+ if (this._bodyBlob)
3266
+ return z(this._bodyBlob);
3267
+ if (this._bodyArrayBuffer)
3268
+ return Promise.resolve(_(this._bodyArrayBuffer));
3269
+ if (this._bodyFormData)
3270
+ throw new Error("could not read FormData body as text");
3271
+ return Promise.resolve(this._bodyText);
3272
+ }, c.formData && (this.formData = function() {
3273
+ return this.text().then(Ve);
3274
+ }), this.json = function() {
3275
+ return this.text().then(JSON.parse);
3276
+ }, this;
3338
3277
  }
3339
- }
3340
- }
3341
- }
3342
- `, dn = O`
3343
- query GetPurchasingCustomerRank {
3344
- purchasingCustomer {
3345
- currentCustomerRank {
3346
- id
3347
- name
3348
- threshold
3349
- higherRank {
3350
- id
3351
- name
3352
- threshold
3278
+ var J = ["DELETE", "GET", "HEAD", "OPTIONS", "POST", "PUT"];
3279
+ function Q(a) {
3280
+ var l = a.toUpperCase();
3281
+ return J.indexOf(l) > -1 ? l : a;
3353
3282
  }
3354
- lowerRank {
3355
- id
3356
- name
3357
- threshold
3283
+ function w(a, l) {
3284
+ l = l || {};
3285
+ var E = l.body;
3286
+ if (a instanceof w) {
3287
+ if (a.bodyUsed)
3288
+ throw new TypeError("Already read");
3289
+ this.url = a.url, this.credentials = a.credentials, l.headers || (this.headers = new g(a.headers)), this.method = a.method, this.mode = a.mode, this.signal = a.signal, !E && a._bodyInit != null && (E = a._bodyInit, a.bodyUsed = !0);
3290
+ } else
3291
+ this.url = String(a);
3292
+ 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)
3293
+ throw new TypeError("Body not allowed for GET or HEAD requests");
3294
+ this._initBody(E);
3358
3295
  }
3359
- earnedPointToRankUp
3360
- purchasePriceToRankUp
3361
- calculationCondition {
3362
- customerRankCalculationPeriod {
3363
- start
3364
- end
3365
- }
3366
- earnedPoint
3367
- purchasePrice
3296
+ w.prototype.clone = function() {
3297
+ return new w(this, { body: this._bodyInit });
3298
+ };
3299
+ function Ve(a) {
3300
+ var l = new FormData();
3301
+ return a.trim().split("&").forEach(function(E) {
3302
+ if (E) {
3303
+ var R = E.split("="), b = R.shift().replace(/\+/g, " "), A = R.join("=").replace(/\+/g, " ");
3304
+ l.append(decodeURIComponent(b), decodeURIComponent(A));
3305
+ }
3306
+ }), l;
3368
3307
  }
3369
- pointMultiplier {
3370
- id
3371
- customerRankRule {
3372
- id
3373
- name
3374
- threshold
3375
- }
3376
- multiplier
3308
+ function $e(a) {
3309
+ var l = new g(), E = a.replace(/\r?\n[\t ]+/g, " ");
3310
+ return E.split(/\r?\n/).forEach(function(R) {
3311
+ var b = R.split(":"), A = b.shift().trim();
3312
+ if (A) {
3313
+ var X = b.join(":").trim();
3314
+ l.append(A, X);
3315
+ }
3316
+ }), l;
3377
3317
  }
3378
- }
3318
+ B.call(w.prototype);
3319
+ function L(a, l) {
3320
+ 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(a);
3321
+ }
3322
+ B.call(L.prototype), L.prototype.clone = function() {
3323
+ return new L(this._bodyInit, {
3324
+ status: this.status,
3325
+ statusText: this.statusText,
3326
+ headers: new g(this.headers),
3327
+ url: this.url
3328
+ });
3329
+ }, L.error = function() {
3330
+ var a = new L(null, { status: 0, statusText: "" });
3331
+ return a.type = "error", a;
3332
+ };
3333
+ var je = [301, 302, 303, 307, 308];
3334
+ L.redirect = function(a, l) {
3335
+ if (je.indexOf(l) === -1)
3336
+ throw new RangeError("Invalid status code");
3337
+ return new L(null, { status: l, headers: { location: a } });
3338
+ }, o.DOMException = s.DOMException;
3339
+ try {
3340
+ new o.DOMException();
3341
+ } catch {
3342
+ o.DOMException = function(l, E) {
3343
+ this.message = l, this.name = E;
3344
+ var R = Error(l);
3345
+ this.stack = R.stack;
3346
+ }, o.DOMException.prototype = Object.create(Error.prototype), o.DOMException.prototype.constructor = o.DOMException;
3347
+ }
3348
+ function ae(a, l) {
3349
+ return new Promise(function(E, R) {
3350
+ var b = new w(a, l);
3351
+ if (b.signal && b.signal.aborted)
3352
+ return R(new o.DOMException("Aborted", "AbortError"));
3353
+ var A = new XMLHttpRequest();
3354
+ function X() {
3355
+ A.abort();
3356
+ }
3357
+ A.onload = function() {
3358
+ var V = {
3359
+ status: A.status,
3360
+ statusText: A.statusText,
3361
+ headers: $e(A.getAllResponseHeaders() || "")
3362
+ };
3363
+ V.url = "responseURL" in A ? A.responseURL : V.headers.get("X-Request-URL");
3364
+ var ue = "response" in A ? A.response : A.responseText;
3365
+ E(new L(ue, V));
3366
+ }, A.onerror = function() {
3367
+ R(new TypeError("Network request failed"));
3368
+ }, A.ontimeout = function() {
3369
+ R(new TypeError("Network request failed"));
3370
+ }, A.onabort = function() {
3371
+ R(new o.DOMException("Aborted", "AbortError"));
3372
+ }, A.open(b.method, b.url, !0), b.credentials === "include" ? A.withCredentials = !0 : b.credentials === "omit" && (A.withCredentials = !1), "responseType" in A && c.blob && (A.responseType = "blob"), b.headers.forEach(function(V, ue) {
3373
+ A.setRequestHeader(ue, V);
3374
+ }), b.signal && (b.signal.addEventListener("abort", X), A.onreadystatechange = function() {
3375
+ A.readyState === 4 && b.signal.removeEventListener("abort", X);
3376
+ }), A.send(typeof b._bodyInit > "u" ? null : b._bodyInit);
3377
+ });
3378
+ }
3379
+ return ae.polyfill = !0, s.fetch || (s.fetch = ae, s.Headers = g, s.Request = w, s.Response = L), o.Headers = g, o.Request = w, o.Response = L, o.fetch = ae, Object.defineProperty(o, "__esModule", { value: !0 }), o;
3380
+ })({});
3381
+ })(r), r.fetch.ponyfill = !0, delete r.fetch.polyfill;
3382
+ var i = r;
3383
+ 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;
3384
+ })(ye, ye.exports);
3385
+ var ie = ye.exports;
3386
+ const te = /* @__PURE__ */ mn(ie), gn = /* @__PURE__ */ ze({
3387
+ __proto__: null,
3388
+ default: te
3389
+ }, [ie]), U = (e) => {
3390
+ let t = {};
3391
+ return e && (typeof Headers < "u" && e instanceof Headers || gn && ie.Headers && e instanceof ie.Headers ? t = ln(e) : Array.isArray(e) ? e.forEach(([n, r]) => {
3392
+ n && r !== void 0 && (t[n] = r);
3393
+ }) : t = e), t;
3394
+ }, Re = (e) => e.replace(/([\s,]|#[^\n\r]+)+/g, " ").trim(), yn = (e) => {
3395
+ if (!Array.isArray(e.query)) {
3396
+ const r = e, i = [`query=${encodeURIComponent(Re(r.query))}`];
3397
+ return e.variables && i.push(`variables=${encodeURIComponent(r.jsonSerializer.stringify(r.variables))}`), r.operationName && i.push(`operationName=${encodeURIComponent(r.operationName)}`), i.join("&");
3379
3398
  }
3380
- }
3381
- `, hn = O`
3382
- query GetSharingPurchasingCustomerCount {
3383
- purchasingCustomer {
3384
- id
3385
- sharingPurchasingCustomerCount
3399
+ if (typeof e.variables < "u" && !Array.isArray(e.variables))
3400
+ throw new Error("Cannot create query with given variable type, array expected");
3401
+ const t = e, n = e.query.reduce((r, i, s) => (r.push({
3402
+ query: Re(i),
3403
+ variables: t.variables ? t.jsonSerializer.stringify(t.variables[s]) : void 0
3404
+ }), r), []);
3405
+ return `query=${encodeURIComponent(t.jsonSerializer.stringify(n))}`;
3406
+ }, Cn = (e) => async (t) => {
3407
+ const { url: n, query: r, variables: i, operationName: s, fetch: o, fetchOptions: c, middleware: h } = t, p = { ...t.headers };
3408
+ let m = "", y;
3409
+ e === "POST" ? (y = vn(r, i, s, c.jsonSerializer), typeof y == "string" && (p["Content-Type"] = "application/json")) : m = yn({
3410
+ query: r,
3411
+ variables: i,
3412
+ operationName: s,
3413
+ jsonSerializer: c.jsonSerializer ?? ve
3414
+ });
3415
+ const C = {
3416
+ method: e,
3417
+ headers: p,
3418
+ body: y,
3419
+ ...c
3420
+ };
3421
+ let T = n, g = C;
3422
+ if (h) {
3423
+ const N = await Promise.resolve(h({ ...C, url: n, operationName: s, variables: i })), { url: O, ...D } = N;
3424
+ T = O, g = D;
3386
3425
  }
3387
- }
3388
- `, pn = O`
3389
- query GetPurchasingCustomerSharing {
3390
- purchasingCustomer {
3391
- id
3392
- customerSharing {
3393
- id
3394
- purchasingCustomers {
3395
- id
3396
- sharingPurchasingCustomerCount
3397
- tenant {
3398
- id
3399
- name
3400
- }
3401
- }
3402
- }
3426
+ return m && (T = `${T}?${m}`), await o(T, g);
3427
+ };
3428
+ class En {
3429
+ constructor(t, n = {}) {
3430
+ this.url = t, this.requestConfig = n, this.rawRequest = async (...r) => {
3431
+ const [i, s, o] = r, c = hn(i, s, o), { headers: h, fetch: p = te, method: m = "POST", requestMiddleware: y, responseMiddleware: C, ...T } = this.requestConfig, { url: g } = this;
3432
+ c.signal !== void 0 && (T.signal = c.signal);
3433
+ const { operationName: N } = le(c.query);
3434
+ return de({
3435
+ url: g,
3436
+ query: c.query,
3437
+ variables: c.variables,
3438
+ headers: {
3439
+ ...U(he(h)),
3440
+ ...U(c.requestHeaders)
3441
+ },
3442
+ operationName: N,
3443
+ fetch: p,
3444
+ method: m,
3445
+ fetchOptions: T,
3446
+ middleware: y
3447
+ }).then((O) => (C && C(O), O)).catch((O) => {
3448
+ throw C && C(O), O;
3449
+ });
3450
+ };
3403
3451
  }
3404
- }
3405
- `, fn = O`
3406
- query GetProduct($id: String!, $first: Int, $after: String, $isReverse: Boolean! = false, $sortKeys: ProductVariantSortKeys! = CREATED_AT) {
3407
- productByProductShopifyLegacyResourceID(productShopifyLegacyResourceID: $id) {
3408
- id
3409
- title
3410
- hasBackOrderProductVariants
3411
- isLocalPickupAvailable
3412
- productVariants(
3413
- first: $first
3414
- after: $after
3415
- isReverse: $isReverse
3416
- sortKeys: $sortKeys
3417
- ) {
3418
- nodes {
3419
- id
3420
- title
3421
- inventoryItem {
3422
- id
3423
- sku
3424
- }
3425
- isBackOrderEnable
3426
- isLocalPickupAvailable
3427
- }
3428
- pageInfo {
3429
- startCursor
3430
- endCursor
3431
- hasNextPage
3432
- hasPreviousPage
3433
- }
3434
- }
3452
+ async request(t, ...n) {
3453
+ const [r, i] = n, s = dn(t, r, i), { headers: o, fetch: c = te, method: h = "POST", requestMiddleware: p, responseMiddleware: m, ...y } = this.requestConfig, { url: C } = this;
3454
+ s.signal !== void 0 && (y.signal = s.signal);
3455
+ const { query: T, operationName: g } = le(s.document);
3456
+ return de({
3457
+ url: C,
3458
+ query: T,
3459
+ variables: s.variables,
3460
+ headers: {
3461
+ ...U(he(o)),
3462
+ ...U(s.requestHeaders)
3463
+ },
3464
+ operationName: g,
3465
+ fetch: c,
3466
+ method: h,
3467
+ fetchOptions: y,
3468
+ middleware: p
3469
+ }).then((N) => (m && m(N), N.data)).catch((N) => {
3470
+ throw m && m(N), N;
3471
+ });
3435
3472
  }
3436
- }
3437
- `, mn = O`
3438
- query GetPointCampaignOrderRuleTargetCustomerRank {
3439
- pointCampaignOrderRuleTargetCustomerRank {
3440
- pointCampaignOrderRule {
3441
- id
3442
- title
3443
- }
3444
- multiplier
3445
- fixedPoint
3473
+ // prettier-ignore
3474
+ batchRequests(t, n) {
3475
+ const r = pn(t, n), { headers: i, ...s } = this.requestConfig;
3476
+ r.signal !== void 0 && (s.signal = r.signal);
3477
+ const o = r.documents.map(({ document: h }) => le(h).query), c = r.documents.map(({ variables: h }) => h);
3478
+ return de({
3479
+ url: this.url,
3480
+ query: o,
3481
+ // @ts-expect-error TODO reconcile batch variables into system.
3482
+ variables: c,
3483
+ headers: {
3484
+ ...U(he(i)),
3485
+ ...U(r.requestHeaders)
3486
+ },
3487
+ operationName: void 0,
3488
+ fetch: this.requestConfig.fetch ?? te,
3489
+ method: this.requestConfig.method || "POST",
3490
+ fetchOptions: s,
3491
+ middleware: this.requestConfig.requestMiddleware
3492
+ }).then((h) => (this.requestConfig.responseMiddleware && this.requestConfig.responseMiddleware(h), h.data)).catch((h) => {
3493
+ throw this.requestConfig.responseMiddleware && this.requestConfig.responseMiddleware(h), h;
3494
+ });
3446
3495
  }
3447
- }
3448
- `, gn = O`
3449
- mutation PurchasingCustomerSendCustomerSharingActivationCode {
3450
- purchasingCustomerSendCustomerSharingActivationCode {
3451
- purchasingCustomer {
3452
- id
3453
- sharingPurchasingCustomerCount
3454
- tenant {
3455
- id
3456
- name
3457
- }
3458
- }
3459
- customerSharingActivationCode {
3460
- id
3461
- }
3496
+ setHeaders(t) {
3497
+ return this.requestConfig.headers = t, this;
3462
3498
  }
3463
- }
3464
- `, yn = O`
3465
- mutation PurchasingCustomerActivateCustomerSharing($email: String!, $activationCode: String!) {
3466
- purchasingCustomerActivateCustomerSharing(
3467
- input: {email: $email, activationCode: $activationCode}
3468
- ) {
3469
- purchasingCustomer {
3470
- id
3471
- sharingPurchasingCustomerCount
3472
- tenant {
3473
- id
3474
- name
3475
- }
3476
- }
3499
+ /**
3500
+ * Attach a header to the client. All subsequent requests will have this header.
3501
+ */
3502
+ setHeader(t, n) {
3503
+ const { headers: r } = this.requestConfig;
3504
+ return r ? r[t] = n : this.requestConfig.headers = { [t]: n }, this;
3505
+ }
3506
+ /**
3507
+ * Change the client endpoint. All subsequent requests will send to this endpoint.
3508
+ */
3509
+ setEndpoint(t) {
3510
+ return this.url = t, this;
3477
3511
  }
3478
3512
  }
3479
- `, Cn = (e, t, n, r) => e();
3480
- function En(e, t = Cn) {
3481
- return {
3482
- GetLocationAvailabilities(n, r) {
3483
- return t((i) => e.request(nn, n, { ...r, ...i }), "GetLocationAvailabilities", "query", n);
3484
- },
3485
- GetLocationAvailability(n, r) {
3486
- return t((i) => e.request(rn, n, { ...r, ...i }), "GetLocationAvailability", "query", n);
3487
- },
3488
- GetPurchasingCustomerMetafield(n, r) {
3489
- return t((i) => e.request(sn, n, { ...r, ...i }), "GetPurchasingCustomerMetafield", "query", n);
3490
- },
3491
- GetPoints(n, r) {
3492
- return t((i) => e.request(on, n, { ...r, ...i }), "GetPoints", "query", n);
3493
- },
3494
- GetLocations(n, r) {
3495
- return t((i) => e.request(an, n, { ...r, ...i }), "GetLocations", "query", n);
3496
- },
3497
- GetPurchasingCustomerDiscounts(n, r) {
3498
- return t((i) => e.request(un, n, { ...r, ...i }), "GetPurchasingCustomerDiscounts", "query", n);
3499
- },
3500
- GetPurchasingCustomerDiscountCodeCount(n, r) {
3501
- return t((i) => e.request(cn, n, { ...r, ...i }), "GetPurchasingCustomerDiscountCodeCount", "query", n);
3502
- },
3503
- GetPurchasingCustomerPointChangeActivities(n, r) {
3504
- return t((i) => e.request(ln, n, { ...r, ...i }), "GetPurchasingCustomerPointChangeActivities", "query", n);
3505
- },
3506
- GetPurchasingCustomerRank(n, r) {
3507
- return t((i) => e.request(dn, n, { ...r, ...i }), "GetPurchasingCustomerRank", "query", n);
3508
- },
3509
- GetSharingPurchasingCustomerCount(n, r) {
3510
- return t((i) => e.request(hn, n, { ...r, ...i }), "GetSharingPurchasingCustomerCount", "query", n);
3511
- },
3512
- GetPurchasingCustomerSharing(n, r) {
3513
- return t((i) => e.request(pn, n, { ...r, ...i }), "GetPurchasingCustomerSharing", "query", n);
3514
- },
3515
- GetProduct(n, r) {
3516
- return t((i) => e.request(fn, n, { ...r, ...i }), "GetProduct", "query", n);
3517
- },
3518
- GetPointCampaignOrderRuleTargetCustomerRank(n, r) {
3519
- return t((i) => e.request(mn, n, { ...r, ...i }), "GetPointCampaignOrderRuleTargetCustomerRank", "query", n);
3520
- },
3521
- PurchasingCustomerSendCustomerSharingActivationCode(n, r) {
3522
- return t((i) => e.request(gn, n, { ...r, ...i }), "PurchasingCustomerSendCustomerSharingActivationCode", "mutation", n);
3523
- },
3524
- PurchasingCustomerActivateCustomerSharing(n, r) {
3525
- return t((i) => e.request(yn, n, { ...r, ...i }), "PurchasingCustomerActivateCustomerSharing", "mutation", n);
3526
- }
3527
- };
3528
- }
3529
- class An {
3513
+ const de = async (e) => {
3514
+ const { query: t, variables: n, fetchOptions: r } = e, i = Cn(cn(e.method ?? "post")), s = Array.isArray(e.query), o = await i(e), c = await An(o, r.jsonSerializer ?? ve), h = Array.isArray(c) ? !c.some(({ data: m }) => !m) : !!c.data, p = Array.isArray(c) || !c.errors || Array.isArray(c.errors) && !c.errors.length || r.errorPolicy === "all" || r.errorPolicy === "ignore";
3515
+ if (o.ok && p && h) {
3516
+ const { errors: m, ...y } = (Array.isArray(c), c), C = r.errorPolicy === "ignore" ? y : c;
3517
+ return {
3518
+ ...s ? { data: C } : C,
3519
+ headers: o.headers,
3520
+ status: o.status
3521
+ };
3522
+ } else {
3523
+ const m = typeof c == "string" ? {
3524
+ error: c
3525
+ } : c;
3526
+ throw new H(
3527
+ // @ts-expect-error TODO
3528
+ { ...m, status: o.status, headers: o.headers },
3529
+ { query: t, variables: n }
3530
+ );
3531
+ }
3532
+ }, vn = (e, t, n, r) => {
3533
+ const i = r ?? ve;
3534
+ if (!Array.isArray(e))
3535
+ return i.stringify({ query: e, variables: t, operationName: n });
3536
+ if (typeof t < "u" && !Array.isArray(t))
3537
+ throw new Error("Cannot create request body with given variable type, array expected");
3538
+ const s = e.reduce((o, c, h) => (o.push({ query: c, variables: t ? t[h] : void 0 }), o), []);
3539
+ return i.stringify(s);
3540
+ }, An = async (e, t) => {
3541
+ let n;
3542
+ return e.headers.forEach((r, i) => {
3543
+ i.toLowerCase() === "content-type" && (n = r);
3544
+ }), 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();
3545
+ }, he = (e) => typeof e == "function" ? e() : e;
3546
+ var Tn = /* @__PURE__ */ ((e) => (e.Eur = "EUR", e.Jpy = "JPY", e.Usd = "USD", e))(Tn || {});
3547
+ class In {
3530
3548
  constructor(t) {
3531
3549
  Ae(this, "api");
3532
- this.api = En(
3533
- new Ht(`${t}/apps/sq-api`, {
3550
+ this.api = un(
3551
+ new En(`${t}/apps/sq-api`, {
3534
3552
  headers: {
3535
3553
  "X-SQ-CLIENT": "ShopifyAppProxy"
3536
3554
  }
@@ -3883,6 +3901,32 @@ class An {
3883
3901
  fixedPoint: t.pointCampaignOrderRuleTargetCustomerRank.fixedPoint ? t.pointCampaignOrderRuleTargetCustomerRank.fixedPoint : void 0
3884
3902
  } : null;
3885
3903
  }
3904
+ async getEstimatedShopifyCartPoint(t, n, r) {
3905
+ const i = await this.api.GetEstimatedShopifyCartPoint({
3906
+ input: {
3907
+ currencyCode: t,
3908
+ taxesIncluded: n,
3909
+ lineItems: r
3910
+ }
3911
+ });
3912
+ return i.estimatedShopifyCartPoint ? {
3913
+ pointsEarned: i.estimatedShopifyCartPoint.pointsEarned
3914
+ } : null;
3915
+ }
3916
+ async getEstimatedShopifyCartLineItemPoint(t, n, r, i, s) {
3917
+ const o = await this.api.GetEstimatedShopifyCartLineItemPoint({
3918
+ input: {
3919
+ currencyCode: t,
3920
+ taxesIncluded: n,
3921
+ sku: r,
3922
+ quantity: i,
3923
+ unitPrice: s
3924
+ }
3925
+ });
3926
+ return o.estimatedShopifyCartLineItemPoint ? {
3927
+ pointsEarned: o.estimatedShopifyCartLineItemPoint.pointsEarned
3928
+ } : null;
3929
+ }
3886
3930
  /**
3887
3931
  * purchasingCustomerSendCustomerSharingActivationCode はログインしているアカウントのメールアドレスに顧客情報共有のためのアクティベーションコードを送信します。
3888
3932
  */
@@ -3923,5 +3967,6 @@ class An {
3923
3967
  }
3924
3968
  }
3925
3969
  export {
3926
- An as SDK
3970
+ Tn as CurrencyCode,
3971
+ In as SDK
3927
3972
  };