@ticketapp-dev/shop-sdk 1.0.29 → 1.0.30
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.
package/dist/index.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { GraphQLClient as de } from "graphql-request";
|
|
2
|
-
import { createSlice as
|
|
2
|
+
import { createSlice as Je, configureStore as Xe } from "@reduxjs/toolkit";
|
|
3
3
|
import { DateTime as R } from "luxon";
|
|
4
|
-
var _ = /* @__PURE__ */ ((e) => (e.PACKAGE = "PACKAGE", e.PRODUCT = "PRODUCT", e.ADD_ONS = "ADD_ONS", e.DELIVERY = "DELIVERY", e.PICKUP = "PICKUP", e))(_ || {}), Q = /* @__PURE__ */ ((e) => (e.AdditionalEvent = "ADDITIONAL_EVENT", e.Addon = "ADDON", e.Regular = "REGULAR", e))(Q || {}),
|
|
5
|
-
const
|
|
4
|
+
var _ = /* @__PURE__ */ ((e) => (e.PACKAGE = "PACKAGE", e.PRODUCT = "PRODUCT", e.ADD_ONS = "ADD_ONS", e.DELIVERY = "DELIVERY", e.PICKUP = "PICKUP", e))(_ || {}), Q = /* @__PURE__ */ ((e) => (e.AdditionalEvent = "ADDITIONAL_EVENT", e.Addon = "ADDON", e.Regular = "REGULAR", e))(Q || {}), xe = /* @__PURE__ */ ((e) => (e.Active = "ACTIVE", e.Concept = "CONCEPT", e.Paused = "PAUSED", e.SoldOut = "SOLD_OUT", e))(xe || {}), Ne = /* @__PURE__ */ ((e) => (e.Active = "ACTIVE", e.Inactive = "INACTIVE", e))(Ne || {}), Pe = /* @__PURE__ */ ((e) => (e.Active = "ACTIVE", e.Inactive = "INACTIVE", e.Paused = "PAUSED", e.SoldOut = "SOLD_OUT", e))(Pe || {}), be = /* @__PURE__ */ ((e) => (e.Asc = "ASC", e.Desc = "DESC", e))(be || {}), Se = /* @__PURE__ */ ((e) => (e.AllReserved = "ALL_RESERVED", e.Available = "AVAILABLE", e.SoldOut = "SOLD_OUT", e))(Se || {}), Ce = /* @__PURE__ */ ((e) => (e.Addon = "ADDON", e.Delivery = "DELIVERY", e.Door = "DOOR", e.Friend = "FRIEND", e.Guest = "GUEST", e.Pickup = "PICKUP", e.Promoter = "PROMOTER", e.Ticket = "TICKET", e))(Ce || {}), _e = /* @__PURE__ */ ((e) => (e.FIXED = "FIXED", e.PERCENTAGE = "PERCENTAGE", e))(_e || {}), Le = /* @__PURE__ */ ((e) => (e.AddOn = "ADD_ON", e.DeliveryOption = "DELIVERY_OPTION", e.EntranceTicket = "ENTRANCE_TICKET", e))(Le || {}), Re = /* @__PURE__ */ ((e) => (e.Fixed = "FIXED", e.Percentage = "PERCENTAGE", e))(Re || {}), J = /* @__PURE__ */ ((e) => (e.Event = "EVENT", e.Package = "PACKAGE", e))(J || {});
|
|
5
|
+
const Ke = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
6
6
|
__proto__: null,
|
|
7
7
|
BasketOrderType: _,
|
|
8
|
-
DiscountType:
|
|
9
|
-
EventStatus:
|
|
8
|
+
DiscountType: Re,
|
|
9
|
+
EventStatus: Pe,
|
|
10
10
|
MetricsType: J,
|
|
11
|
-
OrderItemType:
|
|
11
|
+
OrderItemType: Le,
|
|
12
12
|
PackageItemType: Q,
|
|
13
|
-
PackageStatus:
|
|
14
|
-
PackageTabType:
|
|
15
|
-
PaymentMethodFeeType:
|
|
16
|
-
ProductStatus:
|
|
17
|
-
ProductType:
|
|
18
|
-
SortOrder:
|
|
13
|
+
PackageStatus: xe,
|
|
14
|
+
PackageTabType: Ne,
|
|
15
|
+
PaymentMethodFeeType: _e,
|
|
16
|
+
ProductStatus: Se,
|
|
17
|
+
ProductType: Ce,
|
|
18
|
+
SortOrder: be
|
|
19
19
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
20
20
|
var X = function() {
|
|
21
21
|
return X = Object.assign || function(t) {
|
|
@@ -30,20 +30,20 @@ function G(e, t) {
|
|
|
30
30
|
if (!!!e)
|
|
31
31
|
throw new Error(t);
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function We(e) {
|
|
34
34
|
return typeof e == "object" && e !== null;
|
|
35
35
|
}
|
|
36
|
-
function
|
|
36
|
+
function Ze(e, t) {
|
|
37
37
|
if (!!!e)
|
|
38
38
|
throw new Error(
|
|
39
39
|
"Unexpected invariant triggered."
|
|
40
40
|
);
|
|
41
41
|
}
|
|
42
|
-
const
|
|
42
|
+
const et = /\r\n|[\n\r]/g;
|
|
43
43
|
function se(e, t) {
|
|
44
44
|
let n = 0, r = 1;
|
|
45
|
-
for (const i of e.body.matchAll(
|
|
46
|
-
if (typeof i.index == "number" ||
|
|
45
|
+
for (const i of e.body.matchAll(et)) {
|
|
46
|
+
if (typeof i.index == "number" || Ze(!1), i.index >= t)
|
|
47
47
|
break;
|
|
48
48
|
n = i.index + i[0].length, r += 1;
|
|
49
49
|
}
|
|
@@ -52,30 +52,30 @@ function se(e, t) {
|
|
|
52
52
|
column: t + 1 - n
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
|
-
function
|
|
56
|
-
return
|
|
55
|
+
function tt(e) {
|
|
56
|
+
return Fe(
|
|
57
57
|
e.source,
|
|
58
58
|
se(e.source, e.start)
|
|
59
59
|
);
|
|
60
60
|
}
|
|
61
|
-
function
|
|
61
|
+
function Fe(e, t) {
|
|
62
62
|
const n = e.locationOffset.column - 1, r = "".padStart(n) + e.body, i = t.line - 1, s = e.locationOffset.line - 1, o = t.line + s, u = t.line === 1 ? n : 0, h = t.column + u, p = `${e.name}:${o}:${h}
|
|
63
|
-
`, c = r.split(/\r\n|[\n\r]/g),
|
|
64
|
-
if (
|
|
65
|
-
const
|
|
66
|
-
for (let O = 0; O <
|
|
67
|
-
I.push(
|
|
63
|
+
`, c = r.split(/\r\n|[\n\r]/g), g = c[i];
|
|
64
|
+
if (g.length > 120) {
|
|
65
|
+
const m = Math.floor(h / 80), y = h % 80, I = [];
|
|
66
|
+
for (let O = 0; O < g.length; O += 80)
|
|
67
|
+
I.push(g.slice(O, O + 80));
|
|
68
68
|
return p + he([
|
|
69
69
|
[`${o} |`, I[0]],
|
|
70
|
-
...I.slice(1,
|
|
70
|
+
...I.slice(1, m + 1).map((O) => ["|", O]),
|
|
71
71
|
["|", "^".padStart(y)],
|
|
72
|
-
["|", I[
|
|
72
|
+
["|", I[m + 1]]
|
|
73
73
|
]);
|
|
74
74
|
}
|
|
75
75
|
return p + he([
|
|
76
76
|
// Lines specified like this: ["prefix", "string"],
|
|
77
77
|
[`${o - 1} |`, c[i - 1]],
|
|
78
|
-
[`${o} |`,
|
|
78
|
+
[`${o} |`, g],
|
|
79
79
|
["|", "^".padStart(h)],
|
|
80
80
|
[`${o + 1} |`, c[i + 1]]
|
|
81
81
|
]);
|
|
@@ -85,7 +85,7 @@ function he(e) {
|
|
|
85
85
|
return t.map(([r, i]) => r.padStart(n) + (i ? " " + i : "")).join(`
|
|
86
86
|
`);
|
|
87
87
|
}
|
|
88
|
-
function
|
|
88
|
+
function nt(e) {
|
|
89
89
|
const t = e[0];
|
|
90
90
|
return t == null || "kind" in t || "length" in t ? {
|
|
91
91
|
nodes: t,
|
|
@@ -137,18 +137,18 @@ class ue extends Error {
|
|
|
137
137
|
*/
|
|
138
138
|
constructor(t, ...n) {
|
|
139
139
|
var r, i, s;
|
|
140
|
-
const { nodes: o, source: u, positions: h, path: p, originalError: c, extensions:
|
|
140
|
+
const { nodes: o, source: u, positions: h, path: p, originalError: c, extensions: g } = nt(n);
|
|
141
141
|
super(t), this.name = "GraphQLError", this.path = p ?? void 0, this.originalError = c ?? void 0, this.nodes = fe(
|
|
142
142
|
Array.isArray(o) ? o : o ? [o] : void 0
|
|
143
143
|
);
|
|
144
|
-
const
|
|
144
|
+
const m = fe(
|
|
145
145
|
(r = this.nodes) === null || r === void 0 ? void 0 : r.map((I) => I.loc).filter((I) => I != null)
|
|
146
146
|
);
|
|
147
|
-
this.source = u ?? (
|
|
148
|
-
const y =
|
|
147
|
+
this.source = u ?? (m == null || (i = m[0]) === null || i === void 0 ? void 0 : i.source), this.positions = h ?? m?.map((I) => I.start), this.locations = h && u ? h.map((I) => se(u, I)) : m?.map((I) => se(I.source, I.start));
|
|
148
|
+
const y = We(
|
|
149
149
|
c?.extensions
|
|
150
150
|
) ? c?.extensions : void 0;
|
|
151
|
-
this.extensions = (s =
|
|
151
|
+
this.extensions = (s = g ?? y) !== null && s !== void 0 ? s : /* @__PURE__ */ Object.create(null), Object.defineProperties(this, {
|
|
152
152
|
message: {
|
|
153
153
|
writable: !0,
|
|
154
154
|
enumerable: !0
|
|
@@ -187,12 +187,12 @@ class ue extends Error {
|
|
|
187
187
|
for (const n of this.nodes)
|
|
188
188
|
n.loc && (t += `
|
|
189
189
|
|
|
190
|
-
` +
|
|
190
|
+
` + tt(n.loc));
|
|
191
191
|
else if (this.source && this.locations)
|
|
192
192
|
for (const n of this.locations)
|
|
193
193
|
t += `
|
|
194
194
|
|
|
195
|
-
` +
|
|
195
|
+
` + Fe(this.source, n);
|
|
196
196
|
return t;
|
|
197
197
|
}
|
|
198
198
|
toJSON() {
|
|
@@ -211,7 +211,7 @@ function k(e, t, n) {
|
|
|
211
211
|
positions: [t]
|
|
212
212
|
});
|
|
213
213
|
}
|
|
214
|
-
class
|
|
214
|
+
class rt {
|
|
215
215
|
/**
|
|
216
216
|
* The character offset at which this Node begins.
|
|
217
217
|
*/
|
|
@@ -240,7 +240,7 @@ class nt {
|
|
|
240
240
|
};
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
|
-
class
|
|
243
|
+
class we {
|
|
244
244
|
/**
|
|
245
245
|
* The kind of Token.
|
|
246
246
|
*/
|
|
@@ -282,7 +282,7 @@ class Fe {
|
|
|
282
282
|
};
|
|
283
283
|
}
|
|
284
284
|
}
|
|
285
|
-
const
|
|
285
|
+
const $e = {
|
|
286
286
|
Name: [],
|
|
287
287
|
Document: ["definitions"],
|
|
288
288
|
OperationDefinition: [
|
|
@@ -369,10 +369,10 @@ const we = {
|
|
|
369
369
|
ArgumentCoordinate: ["name", "fieldName", "argumentName"],
|
|
370
370
|
DirectiveCoordinate: ["name"],
|
|
371
371
|
DirectiveArgumentCoordinate: ["name", "argumentName"]
|
|
372
|
-
},
|
|
373
|
-
function
|
|
372
|
+
}, it = new Set(Object.keys($e));
|
|
373
|
+
function ge(e) {
|
|
374
374
|
const t = e?.kind;
|
|
375
|
-
return typeof t == "string" &&
|
|
375
|
+
return typeof t == "string" && it.has(t);
|
|
376
376
|
}
|
|
377
377
|
var w;
|
|
378
378
|
(function(e) {
|
|
@@ -392,22 +392,22 @@ function ae(e) {
|
|
|
392
392
|
function M(e) {
|
|
393
393
|
return e >= 48 && e <= 57;
|
|
394
394
|
}
|
|
395
|
-
function
|
|
395
|
+
function Be(e) {
|
|
396
396
|
return e >= 97 && e <= 122 || // A-Z
|
|
397
397
|
e >= 65 && e <= 90;
|
|
398
398
|
}
|
|
399
|
-
function
|
|
400
|
-
return
|
|
401
|
-
}
|
|
402
|
-
function it(e) {
|
|
403
|
-
return $e(e) || M(e) || e === 95;
|
|
399
|
+
function Ve(e) {
|
|
400
|
+
return Be(e) || e === 95;
|
|
404
401
|
}
|
|
405
402
|
function st(e) {
|
|
403
|
+
return Be(e) || M(e) || e === 95;
|
|
404
|
+
}
|
|
405
|
+
function ot(e) {
|
|
406
406
|
var t;
|
|
407
407
|
let n = Number.MAX_SAFE_INTEGER, r = null, i = -1;
|
|
408
408
|
for (let o = 0; o < e.length; ++o) {
|
|
409
409
|
var s;
|
|
410
|
-
const u = e[o], h =
|
|
410
|
+
const u = e[o], h = at(u);
|
|
411
411
|
h !== u.length && (r = (s = r) !== null && s !== void 0 ? s : o, i = o, o !== 0 && h < n && (n = h));
|
|
412
412
|
}
|
|
413
413
|
return e.map((o, u) => u === 0 ? o : o.slice(n)).slice(
|
|
@@ -415,28 +415,28 @@ function st(e) {
|
|
|
415
415
|
i + 1
|
|
416
416
|
);
|
|
417
417
|
}
|
|
418
|
-
function
|
|
418
|
+
function at(e) {
|
|
419
419
|
let t = 0;
|
|
420
420
|
for (; t < e.length && ae(e.charCodeAt(t)); )
|
|
421
421
|
++t;
|
|
422
422
|
return t;
|
|
423
423
|
}
|
|
424
|
-
function
|
|
424
|
+
function ct(e, t) {
|
|
425
425
|
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((y) => y.length === 0 || ae(y.charCodeAt(0))), o = n.endsWith('\\"""'), u = e.endsWith('"') && !o, h = e.endsWith("\\"), p = u || h, c = (
|
|
426
426
|
// add leading and trailing new lines only if it improves readability
|
|
427
427
|
!i || e.length > 70 || p || s || o
|
|
428
428
|
);
|
|
429
|
-
let
|
|
430
|
-
const
|
|
431
|
-
return (c && !
|
|
432
|
-
`),
|
|
433
|
-
`), '"""' +
|
|
429
|
+
let g = "";
|
|
430
|
+
const m = i && ae(e.charCodeAt(0));
|
|
431
|
+
return (c && !m || s) && (g += `
|
|
432
|
+
`), g += n, (c || p) && (g += `
|
|
433
|
+
`), '"""' + g + '"""';
|
|
434
434
|
}
|
|
435
435
|
var a;
|
|
436
436
|
(function(e) {
|
|
437
437
|
e.SOF = "<SOF>", e.EOF = "<EOF>", e.BANG = "!", e.DOLLAR = "$", e.AMP = "&", e.PAREN_L = "(", e.PAREN_R = ")", e.DOT = ".", e.SPREAD = "...", e.COLON = ":", e.EQUALS = "=", e.AT = "@", e.BRACKET_L = "[", e.BRACKET_R = "]", e.BRACE_L = "{", e.PIPE = "|", e.BRACE_R = "}", e.NAME = "Name", e.INT = "Int", e.FLOAT = "Float", e.STRING = "String", e.BLOCK_STRING = "BlockString", e.COMMENT = "Comment";
|
|
438
438
|
})(a || (a = {}));
|
|
439
|
-
class
|
|
439
|
+
class dt {
|
|
440
440
|
/**
|
|
441
441
|
* The previously focused non-ignored token.
|
|
442
442
|
*/
|
|
@@ -450,7 +450,7 @@ class ct {
|
|
|
450
450
|
* The character offset at which the current line begins.
|
|
451
451
|
*/
|
|
452
452
|
constructor(t) {
|
|
453
|
-
const n = new
|
|
453
|
+
const n = new we(a.SOF, 0, 0, 0, 0);
|
|
454
454
|
this.source = t, this.lastToken = n, this.token = n, this.line = 1, this.lineStart = 0;
|
|
455
455
|
}
|
|
456
456
|
get [Symbol.toStringTag]() {
|
|
@@ -473,26 +473,26 @@ class ct {
|
|
|
473
473
|
if (t.next)
|
|
474
474
|
t = t.next;
|
|
475
475
|
else {
|
|
476
|
-
const n =
|
|
476
|
+
const n = lt(this, t.end);
|
|
477
477
|
t.next = n, n.prev = t, t = n;
|
|
478
478
|
}
|
|
479
479
|
while (t.kind === a.COMMENT);
|
|
480
480
|
return t;
|
|
481
481
|
}
|
|
482
482
|
}
|
|
483
|
-
function
|
|
483
|
+
function ut(e) {
|
|
484
484
|
return e === a.BANG || e === a.DOLLAR || e === a.AMP || e === a.PAREN_L || e === a.PAREN_R || e === a.DOT || e === a.SPREAD || e === a.COLON || e === a.EQUALS || e === a.AT || e === a.BRACKET_L || e === a.BRACKET_R || e === a.BRACE_L || e === a.PIPE || e === a.BRACE_R;
|
|
485
485
|
}
|
|
486
486
|
function $(e) {
|
|
487
487
|
return e >= 0 && e <= 55295 || e >= 57344 && e <= 1114111;
|
|
488
488
|
}
|
|
489
489
|
function W(e, t) {
|
|
490
|
-
return
|
|
490
|
+
return Ue(e.charCodeAt(t)) && Me(e.charCodeAt(t + 1));
|
|
491
491
|
}
|
|
492
|
-
function
|
|
492
|
+
function Ue(e) {
|
|
493
493
|
return e >= 55296 && e <= 56319;
|
|
494
494
|
}
|
|
495
|
-
function
|
|
495
|
+
function Me(e) {
|
|
496
496
|
return e >= 56320 && e <= 57343;
|
|
497
497
|
}
|
|
498
498
|
function F(e, t) {
|
|
@@ -507,9 +507,9 @@ function F(e, t) {
|
|
|
507
507
|
}
|
|
508
508
|
function v(e, t, n, r, i) {
|
|
509
509
|
const s = e.line, o = 1 + n - e.lineStart;
|
|
510
|
-
return new
|
|
510
|
+
return new we(t, n, r, s, o, i);
|
|
511
511
|
}
|
|
512
|
-
function
|
|
512
|
+
function lt(e, t) {
|
|
513
513
|
const n = e.source.body, r = n.length;
|
|
514
514
|
let i = t;
|
|
515
515
|
for (; i < r; ) {
|
|
@@ -550,7 +550,7 @@ function ut(e, t) {
|
|
|
550
550
|
continue;
|
|
551
551
|
// Comment
|
|
552
552
|
case 35:
|
|
553
|
-
return
|
|
553
|
+
return pt(e, i);
|
|
554
554
|
// Token ::
|
|
555
555
|
// - Punctuator
|
|
556
556
|
// - Name
|
|
@@ -591,12 +591,12 @@ function ut(e, t) {
|
|
|
591
591
|
return v(e, a.BRACE_R, i, i + 1);
|
|
592
592
|
// StringValue
|
|
593
593
|
case 34:
|
|
594
|
-
return n.charCodeAt(i + 1) === 34 && n.charCodeAt(i + 2) === 34 ?
|
|
594
|
+
return n.charCodeAt(i + 1) === 34 && n.charCodeAt(i + 2) === 34 ? Et(e, i) : ft(e, i);
|
|
595
595
|
}
|
|
596
596
|
if (M(s) || s === 45)
|
|
597
|
-
return
|
|
598
|
-
if (
|
|
599
|
-
return
|
|
597
|
+
return ht(e, i, s);
|
|
598
|
+
if (Ve(s))
|
|
599
|
+
return yt(e, i);
|
|
600
600
|
throw k(
|
|
601
601
|
e.source,
|
|
602
602
|
i,
|
|
@@ -605,7 +605,7 @@ function ut(e, t) {
|
|
|
605
605
|
}
|
|
606
606
|
return v(e, a.EOF, r, r);
|
|
607
607
|
}
|
|
608
|
-
function
|
|
608
|
+
function pt(e, t) {
|
|
609
609
|
const n = e.source.body, r = n.length;
|
|
610
610
|
let i = t + 1;
|
|
611
611
|
for (; i < r; ) {
|
|
@@ -627,7 +627,7 @@ function lt(e, t) {
|
|
|
627
627
|
n.slice(t + 1, i)
|
|
628
628
|
);
|
|
629
629
|
}
|
|
630
|
-
function
|
|
630
|
+
function ht(e, t, n) {
|
|
631
631
|
const r = e.source.body;
|
|
632
632
|
let i = t, s = n, o = !1;
|
|
633
633
|
if (s === 45 && (s = r.charCodeAt(++i)), s === 48) {
|
|
@@ -642,7 +642,7 @@ function pt(e, t, n) {
|
|
|
642
642
|
);
|
|
643
643
|
} else
|
|
644
644
|
i = ne(e, i, s), s = r.charCodeAt(i);
|
|
645
|
-
if (s === 46 && (o = !0, s = r.charCodeAt(++i), i = ne(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 = ne(e, i, s), s = r.charCodeAt(i)), s === 46 ||
|
|
645
|
+
if (s === 46 && (o = !0, s = r.charCodeAt(++i), i = ne(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 = ne(e, i, s), s = r.charCodeAt(i)), s === 46 || Ve(s))
|
|
646
646
|
throw k(
|
|
647
647
|
e.source,
|
|
648
648
|
i,
|
|
@@ -675,7 +675,7 @@ function ne(e, t, n) {
|
|
|
675
675
|
++i;
|
|
676
676
|
return i;
|
|
677
677
|
}
|
|
678
|
-
function
|
|
678
|
+
function ft(e, t) {
|
|
679
679
|
const n = e.source.body, r = n.length;
|
|
680
680
|
let i = t + 1, s = i, o = "";
|
|
681
681
|
for (; i < r; ) {
|
|
@@ -684,7 +684,7 @@ function ht(e, t) {
|
|
|
684
684
|
return o += n.slice(s, i), v(e, a.STRING, t, i + 1, o);
|
|
685
685
|
if (u === 92) {
|
|
686
686
|
o += n.slice(s, i);
|
|
687
|
-
const h = n.charCodeAt(i + 1) === 117 ? n.charCodeAt(i + 2) === 123 ?
|
|
687
|
+
const h = n.charCodeAt(i + 1) === 117 ? n.charCodeAt(i + 2) === 123 ? gt(e, i) : mt(e, i) : It(e, i);
|
|
688
688
|
o += h.value, i += h.size, s = i;
|
|
689
689
|
continue;
|
|
690
690
|
}
|
|
@@ -706,7 +706,7 @@ function ht(e, t) {
|
|
|
706
706
|
}
|
|
707
707
|
throw k(e.source, i, "Unterminated string.");
|
|
708
708
|
}
|
|
709
|
-
function
|
|
709
|
+
function gt(e, t) {
|
|
710
710
|
const n = e.source.body;
|
|
711
711
|
let r = 0, i = 3;
|
|
712
712
|
for (; i < 12; ) {
|
|
@@ -732,15 +732,15 @@ function ft(e, t) {
|
|
|
732
732
|
);
|
|
733
733
|
}
|
|
734
734
|
function mt(e, t) {
|
|
735
|
-
const n = e.source.body, r =
|
|
735
|
+
const n = e.source.body, r = me(n, t + 2);
|
|
736
736
|
if ($(r))
|
|
737
737
|
return {
|
|
738
738
|
value: String.fromCodePoint(r),
|
|
739
739
|
size: 6
|
|
740
740
|
};
|
|
741
|
-
if (
|
|
742
|
-
const i =
|
|
743
|
-
if (
|
|
741
|
+
if (Ue(r) && n.charCodeAt(t + 6) === 92 && n.charCodeAt(t + 7) === 117) {
|
|
742
|
+
const i = me(n, t + 8);
|
|
743
|
+
if (Me(i))
|
|
744
744
|
return {
|
|
745
745
|
value: String.fromCodePoint(r, i),
|
|
746
746
|
size: 12
|
|
@@ -752,13 +752,13 @@ function mt(e, t) {
|
|
|
752
752
|
`Invalid Unicode escape sequence: "${n.slice(t, t + 6)}".`
|
|
753
753
|
);
|
|
754
754
|
}
|
|
755
|
-
function
|
|
755
|
+
function me(e, t) {
|
|
756
756
|
return U(e.charCodeAt(t)) << 12 | U(e.charCodeAt(t + 1)) << 8 | U(e.charCodeAt(t + 2)) << 4 | U(e.charCodeAt(t + 3));
|
|
757
757
|
}
|
|
758
758
|
function U(e) {
|
|
759
759
|
return e >= 48 && e <= 57 ? e - 48 : e >= 65 && e <= 70 ? e - 55 : e >= 97 && e <= 102 ? e - 87 : -1;
|
|
760
760
|
}
|
|
761
|
-
function
|
|
761
|
+
function It(e, t) {
|
|
762
762
|
const n = e.source.body;
|
|
763
763
|
switch (n.charCodeAt(t + 1)) {
|
|
764
764
|
case 34:
|
|
@@ -812,7 +812,7 @@ function gt(e, t) {
|
|
|
812
812
|
)}".`
|
|
813
813
|
);
|
|
814
814
|
}
|
|
815
|
-
function
|
|
815
|
+
function Et(e, t) {
|
|
816
816
|
const n = e.source.body, r = n.length;
|
|
817
817
|
let i = e.lineStart, s = t + 3, o = s, u = "";
|
|
818
818
|
const h = [];
|
|
@@ -826,7 +826,7 @@ function It(e, t) {
|
|
|
826
826
|
t,
|
|
827
827
|
s + 3,
|
|
828
828
|
// Return a string of the lines joined with U+000A.
|
|
829
|
-
|
|
829
|
+
ot(h).join(`
|
|
830
830
|
`)
|
|
831
831
|
);
|
|
832
832
|
return e.line += h.length - 1, e.lineStart = i, c;
|
|
@@ -855,12 +855,12 @@ function It(e, t) {
|
|
|
855
855
|
}
|
|
856
856
|
throw k(e.source, s, "Unterminated string.");
|
|
857
857
|
}
|
|
858
|
-
function
|
|
858
|
+
function yt(e, t) {
|
|
859
859
|
const n = e.source.body, r = n.length;
|
|
860
860
|
let i = t + 1;
|
|
861
861
|
for (; i < r; ) {
|
|
862
862
|
const s = n.charCodeAt(i);
|
|
863
|
-
if (
|
|
863
|
+
if (st(s))
|
|
864
864
|
++i;
|
|
865
865
|
else
|
|
866
866
|
break;
|
|
@@ -873,7 +873,7 @@ function Et(e, t) {
|
|
|
873
873
|
n.slice(t, i)
|
|
874
874
|
);
|
|
875
875
|
}
|
|
876
|
-
const
|
|
876
|
+
const vt = 10, ze = 2;
|
|
877
877
|
function le(e) {
|
|
878
878
|
return Z(e, []);
|
|
879
879
|
}
|
|
@@ -884,45 +884,45 @@ function Z(e, t) {
|
|
|
884
884
|
case "function":
|
|
885
885
|
return e.name ? `[function ${e.name}]` : "[function]";
|
|
886
886
|
case "object":
|
|
887
|
-
return
|
|
887
|
+
return kt(e, t);
|
|
888
888
|
default:
|
|
889
889
|
return String(e);
|
|
890
890
|
}
|
|
891
891
|
}
|
|
892
|
-
function
|
|
892
|
+
function kt(e, t) {
|
|
893
893
|
if (e === null)
|
|
894
894
|
return "null";
|
|
895
895
|
if (t.includes(e))
|
|
896
896
|
return "[Circular]";
|
|
897
897
|
const n = [...t, e];
|
|
898
|
-
if (
|
|
898
|
+
if (At(e)) {
|
|
899
899
|
const r = e.toJSON();
|
|
900
900
|
if (r !== e)
|
|
901
901
|
return typeof r == "string" ? r : Z(r, n);
|
|
902
902
|
} else if (Array.isArray(e))
|
|
903
|
-
return
|
|
904
|
-
return
|
|
903
|
+
return Tt(e, n);
|
|
904
|
+
return Ot(e, n);
|
|
905
905
|
}
|
|
906
|
-
function
|
|
906
|
+
function At(e) {
|
|
907
907
|
return typeof e.toJSON == "function";
|
|
908
908
|
}
|
|
909
|
-
function
|
|
909
|
+
function Ot(e, t) {
|
|
910
910
|
const n = Object.entries(e);
|
|
911
|
-
return n.length === 0 ? "{}" : t.length >
|
|
911
|
+
return n.length === 0 ? "{}" : t.length > ze ? "[" + Dt(e) + "]" : "{ " + n.map(
|
|
912
912
|
([i, s]) => i + ": " + Z(s, t)
|
|
913
913
|
).join(", ") + " }";
|
|
914
914
|
}
|
|
915
|
-
function
|
|
915
|
+
function Tt(e, t) {
|
|
916
916
|
if (e.length === 0)
|
|
917
917
|
return "[]";
|
|
918
|
-
if (t.length >
|
|
918
|
+
if (t.length > ze)
|
|
919
919
|
return "[Array]";
|
|
920
|
-
const n = Math.min(
|
|
920
|
+
const n = Math.min(vt, e.length), r = e.length - n, i = [];
|
|
921
921
|
for (let s = 0; s < n; ++s)
|
|
922
922
|
i.push(Z(e[s], t));
|
|
923
923
|
return r === 1 ? i.push("... 1 more item") : r > 1 && i.push(`... ${r} more items`), "[" + i.join(", ") + "]";
|
|
924
924
|
}
|
|
925
|
-
function
|
|
925
|
+
function Dt(e) {
|
|
926
926
|
const t = Object.prototype.toString.call(e).replace(/^\[object /, "").replace(/]$/, "");
|
|
927
927
|
if (t === "Object" && typeof e.constructor == "function") {
|
|
928
928
|
const n = e.constructor.name;
|
|
@@ -931,11 +931,11 @@ function Tt(e) {
|
|
|
931
931
|
}
|
|
932
932
|
return t;
|
|
933
933
|
}
|
|
934
|
-
const
|
|
935
|
-
process.env.NODE_ENV === "production",
|
|
934
|
+
const xt = globalThis.process && // eslint-disable-next-line no-undef
|
|
935
|
+
process.env.NODE_ENV === "production", Nt = (
|
|
936
936
|
/* c8 ignore next 6 */
|
|
937
937
|
// FIXME: https://github.com/graphql/graphql-js/issues/2317
|
|
938
|
-
|
|
938
|
+
xt ? function(t, n) {
|
|
939
939
|
return t instanceof n;
|
|
940
940
|
} : function(t, n) {
|
|
941
941
|
if (t instanceof n)
|
|
@@ -982,24 +982,24 @@ class qe {
|
|
|
982
982
|
return "Source";
|
|
983
983
|
}
|
|
984
984
|
}
|
|
985
|
-
function
|
|
986
|
-
return
|
|
985
|
+
function Pt(e) {
|
|
986
|
+
return Nt(e, qe);
|
|
987
987
|
}
|
|
988
|
-
function
|
|
989
|
-
const n = new
|
|
988
|
+
function bt(e, t) {
|
|
989
|
+
const n = new St(e, t), r = n.parseDocument();
|
|
990
990
|
return Object.defineProperty(r, "tokenCount", {
|
|
991
991
|
enumerable: !1,
|
|
992
992
|
value: n.tokenCount
|
|
993
993
|
}), r;
|
|
994
994
|
}
|
|
995
|
-
class
|
|
995
|
+
class St {
|
|
996
996
|
constructor(t, n = {}) {
|
|
997
997
|
const { lexer: r, ...i } = n;
|
|
998
998
|
if (r)
|
|
999
999
|
this._lexer = r;
|
|
1000
1000
|
else {
|
|
1001
|
-
const s =
|
|
1002
|
-
this._lexer = new
|
|
1001
|
+
const s = Pt(t) ? t : new qe(t);
|
|
1002
|
+
this._lexer = new dt(s);
|
|
1003
1003
|
}
|
|
1004
1004
|
this._options = i, this._tokenCounter = 0;
|
|
1005
1005
|
}
|
|
@@ -1712,7 +1712,7 @@ class bt {
|
|
|
1712
1712
|
throw k(
|
|
1713
1713
|
this._lexer.source,
|
|
1714
1714
|
this._lexer.token.start,
|
|
1715
|
-
`${
|
|
1715
|
+
`${q(
|
|
1716
1716
|
this._lexer.token
|
|
1717
1717
|
)} is reserved and cannot be used for an enum value.`
|
|
1718
1718
|
);
|
|
@@ -2017,7 +2017,7 @@ class bt {
|
|
|
2017
2017
|
* given parsed object.
|
|
2018
2018
|
*/
|
|
2019
2019
|
node(t, n) {
|
|
2020
|
-
return this._options.noLocation !== !0 && (n.loc = new
|
|
2020
|
+
return this._options.noLocation !== !0 && (n.loc = new rt(
|
|
2021
2021
|
t,
|
|
2022
2022
|
this._lexer.lastToken,
|
|
2023
2023
|
this._lexer.source
|
|
@@ -2040,7 +2040,7 @@ class bt {
|
|
|
2040
2040
|
throw k(
|
|
2041
2041
|
this._lexer.source,
|
|
2042
2042
|
n.start,
|
|
2043
|
-
`Expected ${
|
|
2043
|
+
`Expected ${je(t)}, found ${q(n)}.`
|
|
2044
2044
|
);
|
|
2045
2045
|
}
|
|
2046
2046
|
/**
|
|
@@ -2062,7 +2062,7 @@ class bt {
|
|
|
2062
2062
|
throw k(
|
|
2063
2063
|
this._lexer.source,
|
|
2064
2064
|
n.start,
|
|
2065
|
-
`Expected "${t}", found ${
|
|
2065
|
+
`Expected "${t}", found ${q(n)}.`
|
|
2066
2066
|
);
|
|
2067
2067
|
}
|
|
2068
2068
|
/**
|
|
@@ -2081,7 +2081,7 @@ class bt {
|
|
|
2081
2081
|
return k(
|
|
2082
2082
|
this._lexer.source,
|
|
2083
2083
|
n.start,
|
|
2084
|
-
`Unexpected ${
|
|
2084
|
+
`Unexpected ${q(n)}.`
|
|
2085
2085
|
);
|
|
2086
2086
|
}
|
|
2087
2087
|
/**
|
|
@@ -2148,21 +2148,21 @@ class bt {
|
|
|
2148
2148
|
);
|
|
2149
2149
|
}
|
|
2150
2150
|
}
|
|
2151
|
-
function
|
|
2151
|
+
function q(e) {
|
|
2152
2152
|
const t = e.value;
|
|
2153
|
-
return
|
|
2153
|
+
return je(e.kind) + (t != null ? ` "${t}"` : "");
|
|
2154
2154
|
}
|
|
2155
|
-
function
|
|
2156
|
-
return
|
|
2155
|
+
function je(e) {
|
|
2156
|
+
return ut(e) ? `"${e}"` : e;
|
|
2157
2157
|
}
|
|
2158
|
-
function
|
|
2159
|
-
return `"${e.replace(
|
|
2158
|
+
function Ct(e) {
|
|
2159
|
+
return `"${e.replace(_t, Lt)}"`;
|
|
2160
2160
|
}
|
|
2161
|
-
const
|
|
2162
|
-
function
|
|
2163
|
-
return
|
|
2161
|
+
const _t = /[\x00-\x1f\x22\x5c\x7f-\x9f]/g;
|
|
2162
|
+
function Lt(e) {
|
|
2163
|
+
return Rt[e.charCodeAt(0)];
|
|
2164
2164
|
}
|
|
2165
|
-
const
|
|
2165
|
+
const Rt = [
|
|
2166
2166
|
"\\u0000",
|
|
2167
2167
|
"\\u0001",
|
|
2168
2168
|
"\\u0002",
|
|
@@ -2328,18 +2328,18 @@ const Lt = [
|
|
|
2328
2328
|
"\\u009D",
|
|
2329
2329
|
"\\u009E",
|
|
2330
2330
|
"\\u009F"
|
|
2331
|
-
],
|
|
2332
|
-
function
|
|
2331
|
+
], Ft = Object.freeze({});
|
|
2332
|
+
function wt(e, t, n = $e) {
|
|
2333
2333
|
const r = /* @__PURE__ */ new Map();
|
|
2334
2334
|
for (const T of Object.values(l))
|
|
2335
|
-
r.set(T,
|
|
2336
|
-
let i, s = Array.isArray(e), o = [e], u = -1, h = [], p = e, c,
|
|
2337
|
-
const
|
|
2335
|
+
r.set(T, $t(t, T));
|
|
2336
|
+
let i, s = Array.isArray(e), o = [e], u = -1, h = [], p = e, c, g;
|
|
2337
|
+
const m = [], y = [];
|
|
2338
2338
|
do {
|
|
2339
2339
|
u++;
|
|
2340
2340
|
const T = u === o.length, L = T && h.length !== 0;
|
|
2341
2341
|
if (T) {
|
|
2342
|
-
if (c = y.length === 0 ? void 0 :
|
|
2342
|
+
if (c = y.length === 0 ? void 0 : m[m.length - 1], p = g, g = y.pop(), L)
|
|
2343
2343
|
if (s) {
|
|
2344
2344
|
p = p.slice();
|
|
2345
2345
|
let N = 0;
|
|
@@ -2353,33 +2353,33 @@ function Ft(e, t, n = we) {
|
|
|
2353
2353
|
p[N] = D;
|
|
2354
2354
|
}
|
|
2355
2355
|
u = i.index, o = i.keys, h = i.edits, s = i.inArray, i = i.prev;
|
|
2356
|
-
} else if (
|
|
2357
|
-
if (c = s ? u : o[u], p =
|
|
2356
|
+
} else if (g) {
|
|
2357
|
+
if (c = s ? u : o[u], p = g[c], p == null)
|
|
2358
2358
|
continue;
|
|
2359
|
-
|
|
2359
|
+
m.push(c);
|
|
2360
2360
|
}
|
|
2361
2361
|
let A;
|
|
2362
2362
|
if (!Array.isArray(p)) {
|
|
2363
2363
|
var I, O;
|
|
2364
|
-
|
|
2364
|
+
ge(p) || G(!1, `Invalid AST Node: ${le(p)}.`);
|
|
2365
2365
|
const N = T ? (I = r.get(p.kind)) === null || I === void 0 ? void 0 : I.leave : (O = r.get(p.kind)) === null || O === void 0 ? void 0 : O.enter;
|
|
2366
|
-
if (A = N?.call(t, p, c,
|
|
2366
|
+
if (A = N?.call(t, p, c, g, m, y), A === Ft)
|
|
2367
2367
|
break;
|
|
2368
2368
|
if (A === !1) {
|
|
2369
2369
|
if (!T) {
|
|
2370
|
-
|
|
2370
|
+
m.pop();
|
|
2371
2371
|
continue;
|
|
2372
2372
|
}
|
|
2373
2373
|
} else if (A !== void 0 && (h.push([c, A]), !T))
|
|
2374
|
-
if (
|
|
2374
|
+
if (ge(A))
|
|
2375
2375
|
p = A;
|
|
2376
2376
|
else {
|
|
2377
|
-
|
|
2377
|
+
m.pop();
|
|
2378
2378
|
continue;
|
|
2379
2379
|
}
|
|
2380
2380
|
}
|
|
2381
2381
|
if (A === void 0 && L && h.push([c, p]), T)
|
|
2382
|
-
|
|
2382
|
+
m.pop();
|
|
2383
2383
|
else {
|
|
2384
2384
|
var x;
|
|
2385
2385
|
i = {
|
|
@@ -2388,12 +2388,12 @@ function Ft(e, t, n = we) {
|
|
|
2388
2388
|
keys: o,
|
|
2389
2389
|
edits: h,
|
|
2390
2390
|
prev: i
|
|
2391
|
-
}, s = Array.isArray(p), o = s ? p : (x = n[p.kind]) !== null && x !== void 0 ? x : [], u = -1, h = [],
|
|
2391
|
+
}, s = Array.isArray(p), o = s ? p : (x = n[p.kind]) !== null && x !== void 0 ? x : [], u = -1, h = [], g && y.push(g), g = p;
|
|
2392
2392
|
}
|
|
2393
2393
|
} while (i !== void 0);
|
|
2394
2394
|
return h.length !== 0 ? h[h.length - 1][1] : e;
|
|
2395
2395
|
}
|
|
2396
|
-
function
|
|
2396
|
+
function $t(e, t) {
|
|
2397
2397
|
const n = e[t];
|
|
2398
2398
|
return typeof n == "object" ? n : typeof n == "function" ? {
|
|
2399
2399
|
enter: n,
|
|
@@ -2403,10 +2403,10 @@ function wt(e, t) {
|
|
|
2403
2403
|
leave: e.leave
|
|
2404
2404
|
};
|
|
2405
2405
|
}
|
|
2406
|
-
function
|
|
2407
|
-
return
|
|
2406
|
+
function Bt(e) {
|
|
2407
|
+
return wt(e, Ut);
|
|
2408
2408
|
}
|
|
2409
|
-
const
|
|
2409
|
+
const Vt = 80, Ut = {
|
|
2410
2410
|
Name: {
|
|
2411
2411
|
leave: (e) => e.value
|
|
2412
2412
|
},
|
|
@@ -2447,7 +2447,7 @@ const Bt = 80, Vt = {
|
|
|
2447
2447
|
leave({ alias: e, name: t, arguments: n, directives: r, selectionSet: i }) {
|
|
2448
2448
|
const s = f("", e, ": ") + t;
|
|
2449
2449
|
let o = s + f("(", d(n, ", "), ")");
|
|
2450
|
-
return o.length >
|
|
2450
|
+
return o.length > Vt && (o = s + f(`(
|
|
2451
2451
|
`, Y(d(n, `
|
|
2452
2452
|
`)), `
|
|
2453
2453
|
)`)), d([o, d(r, " "), i], " ");
|
|
@@ -2492,7 +2492,7 @@ const Bt = 80, Vt = {
|
|
|
2492
2492
|
leave: ({ value: e }) => e
|
|
2493
2493
|
},
|
|
2494
2494
|
StringValue: {
|
|
2495
|
-
leave: ({ value: e, block: t }) => t ?
|
|
2495
|
+
leave: ({ value: e, block: t }) => t ? ct(e) : Ct(e)
|
|
2496
2496
|
},
|
|
2497
2497
|
BooleanValue: {
|
|
2498
2498
|
leave: ({ value: e }) => e ? "true" : "false"
|
|
@@ -2693,19 +2693,19 @@ function re(e) {
|
|
|
2693
2693
|
return (t = e?.some((n) => n.includes(`
|
|
2694
2694
|
`))) !== null && t !== void 0 ? t : !1;
|
|
2695
2695
|
}
|
|
2696
|
-
var H = /* @__PURE__ */ new Map(), ce = /* @__PURE__ */ new Map(),
|
|
2697
|
-
function
|
|
2696
|
+
var H = /* @__PURE__ */ new Map(), ce = /* @__PURE__ */ new Map(), Ge = !0, K = !1;
|
|
2697
|
+
function Ye(e) {
|
|
2698
2698
|
return e.replace(/[\s,]+/g, " ").trim();
|
|
2699
2699
|
}
|
|
2700
|
-
function Ut(e) {
|
|
2701
|
-
return Ge(e.source.body.substring(e.start, e.end));
|
|
2702
|
-
}
|
|
2703
2700
|
function Mt(e) {
|
|
2701
|
+
return Ye(e.source.body.substring(e.start, e.end));
|
|
2702
|
+
}
|
|
2703
|
+
function zt(e) {
|
|
2704
2704
|
var t = /* @__PURE__ */ new Set(), n = [];
|
|
2705
2705
|
return e.definitions.forEach(function(r) {
|
|
2706
2706
|
if (r.kind === "FragmentDefinition") {
|
|
2707
|
-
var i = r.name.value, s =
|
|
2708
|
-
o && !o.has(s) ?
|
|
2707
|
+
var i = r.name.value, s = Mt(r.loc), o = ce.get(i);
|
|
2708
|
+
o && !o.has(s) ? Ge && console.warn("Warning: fragment with name " + i + ` already exists.
|
|
2709
2709
|
graphql-tag enforces all fragment names across your application to be unique; read more about
|
|
2710
2710
|
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`) : o || ce.set(i, o = /* @__PURE__ */ new Set()), o.add(s), t.has(s) || (t.add(s), n.push(r));
|
|
2711
2711
|
} else
|
|
@@ -2723,16 +2723,16 @@ function qt(e) {
|
|
|
2723
2723
|
var n = e.loc;
|
|
2724
2724
|
return n && (delete n.startToken, delete n.endToken), e;
|
|
2725
2725
|
}
|
|
2726
|
-
function
|
|
2727
|
-
var t =
|
|
2726
|
+
function jt(e) {
|
|
2727
|
+
var t = Ye(e);
|
|
2728
2728
|
if (!H.has(t)) {
|
|
2729
|
-
var n =
|
|
2729
|
+
var n = bt(e, {
|
|
2730
2730
|
experimentalFragmentVariables: K,
|
|
2731
2731
|
allowLegacyFragmentVariables: K
|
|
2732
2732
|
});
|
|
2733
2733
|
if (!n || n.kind !== "Document")
|
|
2734
2734
|
throw new Error("Not a valid GraphQL document.");
|
|
2735
|
-
H.set(t, qt(
|
|
2735
|
+
H.set(t, qt(zt(n)));
|
|
2736
2736
|
}
|
|
2737
2737
|
return H.get(t);
|
|
2738
2738
|
}
|
|
@@ -2743,32 +2743,32 @@ function E(e) {
|
|
|
2743
2743
|
var r = e[0];
|
|
2744
2744
|
return t.forEach(function(i, s) {
|
|
2745
2745
|
i && i.kind === "Document" ? r += i.loc.source.body : r += i, r += e[s + 1];
|
|
2746
|
-
}),
|
|
2747
|
-
}
|
|
2748
|
-
function jt() {
|
|
2749
|
-
H.clear(), ce.clear();
|
|
2746
|
+
}), jt(r);
|
|
2750
2747
|
}
|
|
2751
2748
|
function Gt() {
|
|
2752
|
-
|
|
2749
|
+
H.clear(), ce.clear();
|
|
2753
2750
|
}
|
|
2754
2751
|
function Yt() {
|
|
2755
|
-
|
|
2752
|
+
Ge = !1;
|
|
2756
2753
|
}
|
|
2757
2754
|
function Ht() {
|
|
2755
|
+
K = !0;
|
|
2756
|
+
}
|
|
2757
|
+
function Qt() {
|
|
2758
2758
|
K = !1;
|
|
2759
2759
|
}
|
|
2760
2760
|
var V = {
|
|
2761
2761
|
gql: E,
|
|
2762
|
-
resetCaches:
|
|
2763
|
-
disableFragmentWarnings:
|
|
2764
|
-
enableExperimentalFragmentVariables:
|
|
2765
|
-
disableExperimentalFragmentVariables:
|
|
2762
|
+
resetCaches: Gt,
|
|
2763
|
+
disableFragmentWarnings: Yt,
|
|
2764
|
+
enableExperimentalFragmentVariables: Ht,
|
|
2765
|
+
disableExperimentalFragmentVariables: Qt
|
|
2766
2766
|
};
|
|
2767
2767
|
(function(e) {
|
|
2768
2768
|
e.gql = V.gql, e.resetCaches = V.resetCaches, e.disableFragmentWarnings = V.disableFragmentWarnings, e.enableExperimentalFragmentVariables = V.enableExperimentalFragmentVariables, e.disableExperimentalFragmentVariables = V.disableExperimentalFragmentVariables;
|
|
2769
2769
|
})(E || (E = {}));
|
|
2770
2770
|
E.default = E;
|
|
2771
|
-
const
|
|
2771
|
+
const Jt = E`
|
|
2772
2772
|
query findActiveOrderById($id: String) {
|
|
2773
2773
|
findOrder(id: $id) {
|
|
2774
2774
|
id
|
|
@@ -2855,7 +2855,7 @@ const Qt = E`
|
|
|
2855
2855
|
}
|
|
2856
2856
|
}
|
|
2857
2857
|
}
|
|
2858
|
-
`,
|
|
2858
|
+
`, Xt = E`
|
|
2859
2859
|
query findOrderById($id: String, $reference: String) {
|
|
2860
2860
|
findOrder(id: $id, reference: $reference) {
|
|
2861
2861
|
id
|
|
@@ -2886,7 +2886,7 @@ const Qt = E`
|
|
|
2886
2886
|
downloadCode
|
|
2887
2887
|
}
|
|
2888
2888
|
}
|
|
2889
|
-
`,
|
|
2889
|
+
`, Kt = E`
|
|
2890
2890
|
mutation addToOrder($orderId: ID!, $productId: ID!, $shopId: ID, $additionalData: AdditionalDataInput, $trackerId: ID, $amount: Int) {
|
|
2891
2891
|
reserveProduct(
|
|
2892
2892
|
input: {orderId: $orderId, productId: $productId, additionalData: $additionalData, trackerId: $trackerId, shopId: $shopId, amountToIncrease: $amount}
|
|
@@ -2896,7 +2896,7 @@ const Qt = E`
|
|
|
2896
2896
|
amountReserved
|
|
2897
2897
|
}
|
|
2898
2898
|
}
|
|
2899
|
-
`,
|
|
2899
|
+
`, Wt = E`
|
|
2900
2900
|
mutation removeFromOrder($orderId: ID!, $productId: ID!, $additionalData: AdditionalDataInput, $amount: Int) {
|
|
2901
2901
|
releaseProduct(
|
|
2902
2902
|
input: {orderId: $orderId, productId: $productId, additionalData: $additionalData, amountToRelease: $amount}
|
|
@@ -2905,7 +2905,7 @@ const Qt = E`
|
|
|
2905
2905
|
amountReleased
|
|
2906
2906
|
}
|
|
2907
2907
|
}
|
|
2908
|
-
`,
|
|
2908
|
+
`, Zt = E`
|
|
2909
2909
|
mutation configurePackage($orderId: ID!, $packageId: ID!, $amount: Int!, $items: [ReservedItem!]!, $shopId: ID, $trackerId: ID) {
|
|
2910
2910
|
configurePackage(
|
|
2911
2911
|
input: {orderId: $orderId, shopId: $shopId, trackerId: $trackerId, packageId: $packageId, amount: $amount, items: $items}
|
|
@@ -2915,7 +2915,7 @@ const Qt = E`
|
|
|
2915
2915
|
amountReserved
|
|
2916
2916
|
}
|
|
2917
2917
|
}
|
|
2918
|
-
`,
|
|
2918
|
+
`, en = E`
|
|
2919
2919
|
mutation reserveAdditionalPackageItem($amount: Int!, $orderId: ID!, $packageId: ID!, $eventId: ID!, $packageItemId: ID!) {
|
|
2920
2920
|
reserveAdditionalPackageItem(
|
|
2921
2921
|
input: {amount: $amount, eventId: $eventId, orderId: $orderId, packageId: $packageId, packageItemId: $packageItemId}
|
|
@@ -2925,49 +2925,49 @@ const Qt = E`
|
|
|
2925
2925
|
amountReserved
|
|
2926
2926
|
}
|
|
2927
2927
|
}
|
|
2928
|
-
`,
|
|
2928
|
+
`, tn = E`
|
|
2929
2929
|
mutation configureOrderDeliveryOption($orderId: ID!, $productId: ID) {
|
|
2930
2930
|
configureDeliveryOption(input: {orderId: $orderId, productId: $productId})
|
|
2931
2931
|
}
|
|
2932
|
-
`,
|
|
2932
|
+
`, nn = E`
|
|
2933
2933
|
mutation createOrderCustomer($orderId: ID!, $countryCode: String, $customer: CreateCustomerInput!) {
|
|
2934
2934
|
createOrderCustomer(
|
|
2935
2935
|
input: {id: $orderId, countryCode: $countryCode, customer: $customer}
|
|
2936
2936
|
)
|
|
2937
2937
|
}
|
|
2938
|
-
`,
|
|
2938
|
+
`, rn = E`
|
|
2939
2939
|
mutation deleteOrder($orderId: ID!) {
|
|
2940
2940
|
cancelOrder(id: $orderId)
|
|
2941
2941
|
}
|
|
2942
|
-
`,
|
|
2943
|
-
function
|
|
2942
|
+
`, sn = (e, t, n, r) => e();
|
|
2943
|
+
function on(e, t = sn) {
|
|
2944
2944
|
return {
|
|
2945
2945
|
findActiveOrderById(n, r, i) {
|
|
2946
|
-
return t((s) => e.request({ document:
|
|
2946
|
+
return t((s) => e.request({ document: Jt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "findActiveOrderById", "query", n);
|
|
2947
2947
|
},
|
|
2948
2948
|
findOrderById(n, r, i) {
|
|
2949
|
-
return t((s) => e.request({ document:
|
|
2949
|
+
return t((s) => e.request({ document: Xt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "findOrderById", "query", n);
|
|
2950
2950
|
},
|
|
2951
2951
|
addToOrder(n, r, i) {
|
|
2952
|
-
return t((s) => e.request({ document:
|
|
2952
|
+
return t((s) => e.request({ document: Kt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "addToOrder", "mutation", n);
|
|
2953
2953
|
},
|
|
2954
2954
|
removeFromOrder(n, r, i) {
|
|
2955
|
-
return t((s) => e.request({ document:
|
|
2955
|
+
return t((s) => e.request({ document: Wt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "removeFromOrder", "mutation", n);
|
|
2956
2956
|
},
|
|
2957
2957
|
configurePackage(n, r, i) {
|
|
2958
|
-
return t((s) => e.request({ document:
|
|
2958
|
+
return t((s) => e.request({ document: Zt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "configurePackage", "mutation", n);
|
|
2959
2959
|
},
|
|
2960
2960
|
reserveAdditionalPackageItem(n, r, i) {
|
|
2961
|
-
return t((s) => e.request({ document:
|
|
2961
|
+
return t((s) => e.request({ document: en, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "reserveAdditionalPackageItem", "mutation", n);
|
|
2962
2962
|
},
|
|
2963
2963
|
configureOrderDeliveryOption(n, r, i) {
|
|
2964
|
-
return t((s) => e.request({ document:
|
|
2964
|
+
return t((s) => e.request({ document: tn, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "configureOrderDeliveryOption", "mutation", n);
|
|
2965
2965
|
},
|
|
2966
2966
|
createOrderCustomer(n, r, i) {
|
|
2967
|
-
return t((s) => e.request({ document:
|
|
2967
|
+
return t((s) => e.request({ document: nn, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "createOrderCustomer", "mutation", n);
|
|
2968
2968
|
},
|
|
2969
2969
|
deleteOrder(n, r, i) {
|
|
2970
|
-
return t((s) => e.request({ document:
|
|
2970
|
+
return t((s) => e.request({ document: rn, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "deleteOrder", "mutation", n);
|
|
2971
2971
|
}
|
|
2972
2972
|
};
|
|
2973
2973
|
}
|
|
@@ -2975,13 +2975,11 @@ const Ie = {
|
|
|
2975
2975
|
order: null,
|
|
2976
2976
|
processing: !1,
|
|
2977
2977
|
error: null,
|
|
2978
|
-
|
|
2979
|
-
|
|
2978
|
+
// start uninitialized by default
|
|
2979
|
+
initialized: !1
|
|
2980
|
+
}, He = Je({
|
|
2980
2981
|
name: "basket",
|
|
2981
|
-
initialState:
|
|
2982
|
-
...Ie,
|
|
2983
|
-
initialized: !1
|
|
2984
|
-
},
|
|
2982
|
+
initialState: Ie,
|
|
2985
2983
|
reducers: {
|
|
2986
2984
|
setInitialized: (e, t) => {
|
|
2987
2985
|
e.initialized = t.payload;
|
|
@@ -3128,37 +3126,53 @@ const Ie = {
|
|
|
3128
3126
|
configureCustomer: (e, t) => {
|
|
3129
3127
|
e.order && (e.order.customer = t.payload);
|
|
3130
3128
|
},
|
|
3131
|
-
clearBasket: () => Ie
|
|
3129
|
+
clearBasket: () => ({ ...Ie })
|
|
3132
3130
|
}
|
|
3133
3131
|
}), {
|
|
3134
|
-
setInitialized:
|
|
3132
|
+
setInitialized: Ee,
|
|
3135
3133
|
setProcessing: C,
|
|
3136
3134
|
initializeOrder: j,
|
|
3137
|
-
addProduct:
|
|
3135
|
+
addProduct: ye,
|
|
3138
3136
|
removeProduct: an,
|
|
3139
|
-
configurePackage:
|
|
3137
|
+
configurePackage: ve,
|
|
3140
3138
|
configureDelivery: cn,
|
|
3141
|
-
configureCustomer:
|
|
3139
|
+
configureCustomer: ke,
|
|
3142
3140
|
reserveAdditionalPackageItem: dn,
|
|
3143
|
-
clearBasket:
|
|
3144
|
-
} =
|
|
3141
|
+
clearBasket: Ae
|
|
3142
|
+
} = He.actions;
|
|
3145
3143
|
class un {
|
|
3146
3144
|
orderIdKey = "ORDER_ID";
|
|
3147
3145
|
config;
|
|
3148
3146
|
sdk;
|
|
3149
3147
|
store;
|
|
3148
|
+
// Promise-based signal consumers can await to know initialization finished
|
|
3149
|
+
_resolveInitialized;
|
|
3150
|
+
initialized;
|
|
3150
3151
|
constructor(t) {
|
|
3151
|
-
this.config = t, this.store =
|
|
3152
|
+
this.config = t, this.store = Xe({
|
|
3152
3153
|
reducer: {
|
|
3153
|
-
basket:
|
|
3154
|
+
basket: He.reducer
|
|
3154
3155
|
}
|
|
3155
|
-
}), this.
|
|
3156
|
-
this.
|
|
3156
|
+
}), this.initialized = new Promise((n) => {
|
|
3157
|
+
this._resolveInitialized = n;
|
|
3158
|
+
}), this.sdk = on(new de(t.apiUrl)), this.restoreOrderFromSession().then(() => {
|
|
3159
|
+
this.debugLog("Restore order from session"), this.store.dispatch(Ee(!0)), this._resolveInitialized?.();
|
|
3160
|
+
}).catch((n) => {
|
|
3161
|
+
this.debugLog("Restore order failed", n), this.store.dispatch(Ee(!0)), this._resolveInitialized?.();
|
|
3157
3162
|
});
|
|
3158
3163
|
}
|
|
3164
|
+
// Convenience helper so consumers can `await basketService.waitUntilInitialized()`
|
|
3165
|
+
waitUntilInitialized() {
|
|
3166
|
+
return this.initialized;
|
|
3167
|
+
}
|
|
3159
3168
|
// Store functions
|
|
3160
3169
|
subscribe(t) {
|
|
3161
|
-
|
|
3170
|
+
const n = this.store.subscribe(t);
|
|
3171
|
+
try {
|
|
3172
|
+
this.getState().initialized && setTimeout(() => t(), 0);
|
|
3173
|
+
} catch {
|
|
3174
|
+
}
|
|
3175
|
+
return n;
|
|
3162
3176
|
}
|
|
3163
3177
|
getProcessing() {
|
|
3164
3178
|
return this.getState().processing;
|
|
@@ -3210,7 +3224,7 @@ class un {
|
|
|
3210
3224
|
expiredAt: o
|
|
3211
3225
|
})
|
|
3212
3226
|
), this.store.dispatch(
|
|
3213
|
-
|
|
3227
|
+
ye({
|
|
3214
3228
|
input: t,
|
|
3215
3229
|
amountReserved: u,
|
|
3216
3230
|
expiredAt: o
|
|
@@ -3294,7 +3308,7 @@ class un {
|
|
|
3294
3308
|
expiredAt: u
|
|
3295
3309
|
})
|
|
3296
3310
|
), this.store.dispatch(
|
|
3297
|
-
|
|
3311
|
+
ve({
|
|
3298
3312
|
input: t,
|
|
3299
3313
|
amountReserved: h,
|
|
3300
3314
|
expiredAt: u
|
|
@@ -3328,7 +3342,7 @@ class un {
|
|
|
3328
3342
|
orderId: r.id,
|
|
3329
3343
|
customer: t
|
|
3330
3344
|
});
|
|
3331
|
-
this.debugLog("Customer set successfully", i), this.store.dispatch(
|
|
3345
|
+
this.debugLog("Customer set successfully", i), this.store.dispatch(ke(t));
|
|
3332
3346
|
} catch (i) {
|
|
3333
3347
|
throw this.debugLog("Failed to set customer", i), new Error(`Failed to set customer: ${i.message}`);
|
|
3334
3348
|
}
|
|
@@ -3380,7 +3394,7 @@ class un {
|
|
|
3380
3394
|
t && (this.debugLog("Cancelling order", { orderId: t }), await this.sdk.deleteOrder({ orderId: t }), this.clearOrderFromSession(), this.debugLog("Order cancelled successfully"));
|
|
3381
3395
|
}
|
|
3382
3396
|
clearOrderFromSession() {
|
|
3383
|
-
this.debugLog("Clearing order from session"), sessionStorage.removeItem(this.orderIdKey), this.store.dispatch(
|
|
3397
|
+
this.debugLog("Clearing order from session"), sessionStorage.removeItem(this.orderIdKey), this.store.dispatch(Ae());
|
|
3384
3398
|
}
|
|
3385
3399
|
// Private functions for fetching the current order from a session
|
|
3386
3400
|
async restoreOrderFromSession() {
|
|
@@ -3412,10 +3426,10 @@ class un {
|
|
|
3412
3426
|
const r = n.findOrder;
|
|
3413
3427
|
this.debugLog("Order fetched successfully", r);
|
|
3414
3428
|
const i = r.items, s = i.filter((c) => c.product != null && c.amount > 0).map((c) => {
|
|
3415
|
-
let
|
|
3416
|
-
return c.product.type === "PROMOTER" ?
|
|
3429
|
+
let g = _.PRODUCT;
|
|
3430
|
+
return c.product.type === "PROMOTER" ? g = _.ADD_ONS : c.product.type === "PICKUP" ? g = _.PICKUP : c.product.type === "DELIVERY" && (g = _.DELIVERY), {
|
|
3417
3431
|
id: c.product.id,
|
|
3418
|
-
type:
|
|
3432
|
+
type: g,
|
|
3419
3433
|
name: c.product.name,
|
|
3420
3434
|
icon: c.product.icon,
|
|
3421
3435
|
description: c.product.description,
|
|
@@ -3424,25 +3438,25 @@ class un {
|
|
|
3424
3438
|
depositPrice: c.depositPrice ?? 0,
|
|
3425
3439
|
originalPrice: c.originalPrice ?? 0,
|
|
3426
3440
|
serviceFee: c.serviceFee ?? 0,
|
|
3427
|
-
seats: c.seats?.map((
|
|
3428
|
-
id:
|
|
3429
|
-
label:
|
|
3441
|
+
seats: c.seats?.map((m) => ({
|
|
3442
|
+
id: m.id,
|
|
3443
|
+
label: m.label
|
|
3430
3444
|
}))
|
|
3431
3445
|
};
|
|
3432
|
-
}), o = i.filter((c) => c.packageItem != null && c.amount > 0).reduce((c,
|
|
3446
|
+
}), o = i.filter((c) => c.packageItem != null && c.amount > 0).reduce((c, g) => {
|
|
3433
3447
|
const {
|
|
3434
|
-
packageItem:
|
|
3448
|
+
packageItem: m,
|
|
3435
3449
|
event: y,
|
|
3436
3450
|
amount: I,
|
|
3437
3451
|
price: O,
|
|
3438
3452
|
serviceFee: x,
|
|
3439
3453
|
depositPrice: T,
|
|
3440
3454
|
originalPrice: L
|
|
3441
|
-
} =
|
|
3455
|
+
} = g, A = m.package.id;
|
|
3442
3456
|
c[A] ? (c[A].price += O ?? 0, c[A].serviceFee += x ?? 0, c[A].originalPrice += L ?? 0, c[A].depositPrice += T ?? O ?? 0) : c[A] = {
|
|
3443
3457
|
id: A,
|
|
3444
3458
|
type: _.PACKAGE,
|
|
3445
|
-
name:
|
|
3459
|
+
name: m.package.name,
|
|
3446
3460
|
amount: I,
|
|
3447
3461
|
price: O ?? 0,
|
|
3448
3462
|
serviceFee: x ?? 0,
|
|
@@ -3456,7 +3470,7 @@ class un {
|
|
|
3456
3470
|
zone: y.timezone
|
|
3457
3471
|
});
|
|
3458
3472
|
return c[A].packageItems.push({
|
|
3459
|
-
packageItemId:
|
|
3473
|
+
packageItemId: m.id,
|
|
3460
3474
|
eventId: y.id,
|
|
3461
3475
|
name: y.name,
|
|
3462
3476
|
startAt: N.toJSDate().toISOString(),
|
|
@@ -3476,7 +3490,7 @@ class un {
|
|
|
3476
3490
|
return;
|
|
3477
3491
|
}
|
|
3478
3492
|
const p = R.fromMillis(Math.min(...h));
|
|
3479
|
-
this.store.dispatch(
|
|
3493
|
+
this.store.dispatch(Ae()), this.store.dispatch(
|
|
3480
3494
|
j({
|
|
3481
3495
|
id: r.id,
|
|
3482
3496
|
currency: r.currency,
|
|
@@ -3484,7 +3498,7 @@ class un {
|
|
|
3484
3498
|
})
|
|
3485
3499
|
), u.forEach((c) => {
|
|
3486
3500
|
c.type === _.PACKAGE ? this.store.dispatch(
|
|
3487
|
-
|
|
3501
|
+
ve({
|
|
3488
3502
|
input: {
|
|
3489
3503
|
id: c.id,
|
|
3490
3504
|
name: c.name,
|
|
@@ -3500,7 +3514,7 @@ class un {
|
|
|
3500
3514
|
expiredAt: p.toJSDate().toISOString()
|
|
3501
3515
|
})
|
|
3502
3516
|
) : this.store.dispatch(
|
|
3503
|
-
|
|
3517
|
+
ye({
|
|
3504
3518
|
input: {
|
|
3505
3519
|
id: c.id,
|
|
3506
3520
|
name: c.name,
|
|
@@ -3516,7 +3530,7 @@ class un {
|
|
|
3516
3530
|
})
|
|
3517
3531
|
);
|
|
3518
3532
|
}), r.mainBooker && (this.debugLog("Order has customer (mainBooker)", r.mainBooker), this.store.dispatch(
|
|
3519
|
-
|
|
3533
|
+
ke({
|
|
3520
3534
|
firstName: r.mainBooker.firstName ?? void 0,
|
|
3521
3535
|
lastName: r.mainBooker.lastName ?? void 0,
|
|
3522
3536
|
email: r.mainBooker.email ?? void 0,
|
|
@@ -3655,7 +3669,7 @@ const ln = E`
|
|
|
3655
3669
|
}
|
|
3656
3670
|
}
|
|
3657
3671
|
`, fn = (e, t, n, r) => e();
|
|
3658
|
-
function
|
|
3672
|
+
function gn(e, t = fn) {
|
|
3659
3673
|
return {
|
|
3660
3674
|
EventOverviewPage(n, r, i) {
|
|
3661
3675
|
return t((s) => e.request({ document: ln, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "EventOverviewPage", "query", n);
|
|
@@ -3668,7 +3682,7 @@ function mn(e, t = fn) {
|
|
|
3668
3682
|
}
|
|
3669
3683
|
};
|
|
3670
3684
|
}
|
|
3671
|
-
function
|
|
3685
|
+
function mn(e) {
|
|
3672
3686
|
const t = /(query|mutation|subscription)\s+(\w+)/.exec(e);
|
|
3673
3687
|
if (!t) return { type: "unknown" };
|
|
3674
3688
|
const n = t[1], r = t[2];
|
|
@@ -3693,26 +3707,26 @@ function En(e) {
|
|
|
3693
3707
|
typeof r < "u" && (t[n] = String(r));
|
|
3694
3708
|
return t;
|
|
3695
3709
|
}
|
|
3696
|
-
function
|
|
3710
|
+
function Oe(e, t) {
|
|
3697
3711
|
return e?.length ? e.some((n) => t.includes(n?.extensions?.code) || t.includes(n?.message)) : !1;
|
|
3698
3712
|
}
|
|
3699
|
-
function
|
|
3713
|
+
function Te(e, t, n, r, i) {
|
|
3700
3714
|
const s = new Error(e);
|
|
3701
3715
|
return s.response = { data: i.json?.data, errors: i.json?.errors, status: i.status }, s.request = { query: t, variables: n, operationName: r }, s.graphQLErrors = i.json?.errors, s;
|
|
3702
3716
|
}
|
|
3703
3717
|
function ie(e, t, n, r, i) {
|
|
3704
3718
|
if (i.json?.errors?.length)
|
|
3705
|
-
throw
|
|
3719
|
+
throw Te(`GraphQL request failed${e ? ` (${e})` : ""}`, t, n, r, i);
|
|
3706
3720
|
if (typeof i.json?.data > "u")
|
|
3707
|
-
throw
|
|
3721
|
+
throw Te("GraphQL request failed: no data received", t, n, r, i);
|
|
3708
3722
|
return i.json.data;
|
|
3709
3723
|
}
|
|
3710
3724
|
class ee extends de {
|
|
3711
3725
|
async request(t, ...n) {
|
|
3712
3726
|
let r = t, i, s, o;
|
|
3713
3727
|
t && typeof t == "object" && "document" in t ? (r = t.document, i = t.variables, s = t.requestHeaders, o = t.signal) : (i = n[0], s = n[1]);
|
|
3714
|
-
const u = typeof r == "string" ? r :
|
|
3715
|
-
const P = await fetch(
|
|
3728
|
+
const u = typeof r == "string" ? r : Bt(r), { type: h, name: p } = mn(u), c = await In(u), g = i ?? {}, m = this.url ?? this.endpoint ?? "", y = En(s), I = async (D) => {
|
|
3729
|
+
const P = await fetch(m, { method: "POST", headers: y, body: JSON.stringify(D), signal: o });
|
|
3716
3730
|
let b = null;
|
|
3717
3731
|
try {
|
|
3718
3732
|
b = await P.json();
|
|
@@ -3722,9 +3736,9 @@ class ee extends de {
|
|
|
3722
3736
|
return { status: P.status, json: b };
|
|
3723
3737
|
}, O = async (D) => {
|
|
3724
3738
|
const P = new URLSearchParams();
|
|
3725
|
-
for (const [
|
|
3726
|
-
typeof
|
|
3727
|
-
const b =
|
|
3739
|
+
for (const [Qe, z] of Object.entries(D))
|
|
3740
|
+
typeof z > "u" || P.set(Qe, typeof z == "string" ? z : JSON.stringify(z));
|
|
3741
|
+
const b = m.includes("?") ? "&" : "?", B = `${m}${b}${P.toString()}`, pe = await fetch(B, { method: "GET", headers: y, signal: o });
|
|
3728
3742
|
let te = null;
|
|
3729
3743
|
try {
|
|
3730
3744
|
te = await pe.json();
|
|
@@ -3734,32 +3748,32 @@ class ee extends de {
|
|
|
3734
3748
|
return { status: pe.status, json: te };
|
|
3735
3749
|
}, x = {
|
|
3736
3750
|
operationName: p,
|
|
3737
|
-
variables:
|
|
3751
|
+
variables: g,
|
|
3738
3752
|
extensions: { persistedQuery: { version: 1, sha256Hash: c } }
|
|
3739
3753
|
}, T = async (D, P, b) => {
|
|
3740
|
-
if (
|
|
3754
|
+
if (Oe(D.json?.errors, ["PERSISTED_QUERY_NOT_FOUND", "PersistedQueryNotFound"])) {
|
|
3741
3755
|
const B = await P();
|
|
3742
|
-
return ie("APQ register", u,
|
|
3756
|
+
return ie("APQ register", u, g, p, B);
|
|
3743
3757
|
}
|
|
3744
|
-
if (
|
|
3758
|
+
if (Oe(D.json?.errors, ["PERSISTED_QUERY_NOT_SUPPORTED"])) {
|
|
3745
3759
|
const B = await b();
|
|
3746
|
-
return ie("no APQ support", u,
|
|
3760
|
+
return ie("no APQ support", u, g, p, B);
|
|
3747
3761
|
}
|
|
3748
|
-
return ie("", u,
|
|
3762
|
+
return ie("", u, g, p, D);
|
|
3749
3763
|
};
|
|
3750
3764
|
if (h === "query") {
|
|
3751
3765
|
const D = await O(x);
|
|
3752
|
-
return T(D, () => I({ ...x, query: u }), () => I({ operationName: p, variables:
|
|
3766
|
+
return T(D, () => I({ ...x, query: u }), () => I({ operationName: p, variables: g, query: u }));
|
|
3753
3767
|
}
|
|
3754
3768
|
const L = await I(x);
|
|
3755
|
-
return T(L, () => I({ ...x, query: u }), () => I({ operationName: p, variables:
|
|
3769
|
+
return T(L, () => I({ ...x, query: u }), () => I({ operationName: p, variables: g, query: u }));
|
|
3756
3770
|
}
|
|
3757
3771
|
}
|
|
3758
3772
|
class yn {
|
|
3759
3773
|
config;
|
|
3760
3774
|
sdk;
|
|
3761
3775
|
constructor(t) {
|
|
3762
|
-
this.config = t, this.sdk =
|
|
3776
|
+
this.config = t, this.sdk = gn(new ee(t.apiUrl));
|
|
3763
3777
|
}
|
|
3764
3778
|
async fetchEvents(t = {}) {
|
|
3765
3779
|
try {
|
|
@@ -4328,7 +4342,7 @@ class Mn {
|
|
|
4328
4342
|
}
|
|
4329
4343
|
};
|
|
4330
4344
|
}
|
|
4331
|
-
const
|
|
4345
|
+
const zn = "https://api.ticketapp.com/graphql", De = "TIC_TRACKER_ID";
|
|
4332
4346
|
class Yn {
|
|
4333
4347
|
basket;
|
|
4334
4348
|
event;
|
|
@@ -4337,9 +4351,9 @@ class Yn {
|
|
|
4337
4351
|
category;
|
|
4338
4352
|
metric;
|
|
4339
4353
|
// Attach selected public types to the SDK class
|
|
4340
|
-
static Types =
|
|
4354
|
+
static Types = Ke;
|
|
4341
4355
|
constructor(t) {
|
|
4342
|
-
const { organizationId: n, debug: r = !1, apiUrl: i =
|
|
4356
|
+
const { organizationId: n, debug: r = !1, apiUrl: i = zn } = t, s = this.getOrInitTrackerId();
|
|
4343
4357
|
this.basket = new un({ debug: r, apiUrl: i, shopId: t.shopId, trackerId: s }), this.event = new yn({ organizationId: n, debug: r, apiUrl: i, trackerId: s }), this.payment = new Tn({ debug: r, apiUrl: i }), this.package = new Sn({ organizationId: n, debug: r, apiUrl: i }), this.category = new Fn({ organizationId: n, debug: r, apiUrl: i }), this.metric = new Mn({ apiUrl: i, trackerId: s });
|
|
4344
4358
|
}
|
|
4345
4359
|
// Resolve tracker id from (in order): explicit config, URL query, or session storage
|
|
@@ -4353,13 +4367,13 @@ class Yn {
|
|
|
4353
4367
|
} catch {
|
|
4354
4368
|
}
|
|
4355
4369
|
try {
|
|
4356
|
-
t = window.sessionStorage?.getItem(
|
|
4370
|
+
t = window.sessionStorage?.getItem(De) ?? null;
|
|
4357
4371
|
} catch {
|
|
4358
4372
|
}
|
|
4359
4373
|
}
|
|
4360
4374
|
if (n && n.trim().length > 0) {
|
|
4361
4375
|
try {
|
|
4362
|
-
typeof window < "u" && window.sessionStorage && sessionStorage.setItem(
|
|
4376
|
+
typeof window < "u" && window.sessionStorage && sessionStorage.setItem(De, n);
|
|
4363
4377
|
} catch {
|
|
4364
4378
|
}
|
|
4365
4379
|
return n;
|
|
@@ -4382,16 +4396,16 @@ class Yn {
|
|
|
4382
4396
|
}
|
|
4383
4397
|
export {
|
|
4384
4398
|
_ as BasketOrderType,
|
|
4385
|
-
|
|
4386
|
-
|
|
4399
|
+
Re as DiscountType,
|
|
4400
|
+
Pe as EventStatus,
|
|
4387
4401
|
J as MetricsType,
|
|
4388
|
-
|
|
4402
|
+
Le as OrderItemType,
|
|
4389
4403
|
Q as PackageItemType,
|
|
4390
|
-
|
|
4391
|
-
|
|
4392
|
-
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
|
|
4404
|
+
xe as PackageStatus,
|
|
4405
|
+
Ne as PackageTabType,
|
|
4406
|
+
_e as PaymentMethodFeeType,
|
|
4407
|
+
Se as ProductStatus,
|
|
4408
|
+
Ce as ProductType,
|
|
4409
|
+
be as SortOrder,
|
|
4396
4410
|
Yn as TicketappSDK
|
|
4397
4411
|
};
|