@ticketapp-dev/shop-sdk 1.0.28 → 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,72 +2328,72 @@ 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
|
-
let
|
|
2346
|
-
for (const [D,
|
|
2347
|
-
const
|
|
2348
|
-
|
|
2345
|
+
let N = 0;
|
|
2346
|
+
for (const [D, P] of h) {
|
|
2347
|
+
const b = D - N;
|
|
2348
|
+
P === null ? (p.splice(b, 1), N++) : p[b] = P;
|
|
2349
2349
|
}
|
|
2350
2350
|
} else {
|
|
2351
2351
|
p = { ...p };
|
|
2352
|
-
for (const [
|
|
2353
|
-
p[
|
|
2352
|
+
for (const [N, D] of h)
|
|
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
|
-
|
|
2365
|
-
const
|
|
2366
|
-
if (A =
|
|
2364
|
+
ge(p) || G(!1, `Invalid AST Node: ${le(p)}.`);
|
|
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, 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
|
-
var
|
|
2384
|
+
var x;
|
|
2385
2385
|
i = {
|
|
2386
2386
|
inArray: s,
|
|
2387
2387
|
index: u,
|
|
2388
2388
|
keys: o,
|
|
2389
2389
|
edits: h,
|
|
2390
2390
|
prev: i
|
|
2391
|
-
}, s = Array.isArray(p), o = s ? p : (
|
|
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
|
},
|
|
@@ -2441,13 +2441,13 @@ const Bt = 80, Vt = {
|
|
|
2441
2441
|
`) + e + ": " + t + f(" = ", n) + f(" ", d(r, " "))
|
|
2442
2442
|
},
|
|
2443
2443
|
SelectionSet: {
|
|
2444
|
-
leave: ({ selections: e }) =>
|
|
2444
|
+
leave: ({ selections: e }) => S(e)
|
|
2445
2445
|
},
|
|
2446
2446
|
Field: {
|
|
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"
|
|
@@ -2529,7 +2529,7 @@ const Bt = 80, Vt = {
|
|
|
2529
2529
|
// Type System Definitions
|
|
2530
2530
|
SchemaDefinition: {
|
|
2531
2531
|
leave: ({ description: e, directives: t, operationTypes: n }) => f("", e, `
|
|
2532
|
-
`) + d(["schema", d(t, " "),
|
|
2532
|
+
`) + d(["schema", d(t, " "), S(n)], " ")
|
|
2533
2533
|
},
|
|
2534
2534
|
OperationTypeDefinition: {
|
|
2535
2535
|
leave: ({ operation: e, type: t }) => e + ": " + t
|
|
@@ -2546,7 +2546,7 @@ const Bt = 80, Vt = {
|
|
|
2546
2546
|
t,
|
|
2547
2547
|
f("implements ", d(n, " & ")),
|
|
2548
2548
|
d(r, " "),
|
|
2549
|
-
|
|
2549
|
+
S(i)
|
|
2550
2550
|
],
|
|
2551
2551
|
" "
|
|
2552
2552
|
)
|
|
@@ -2573,7 +2573,7 @@ const Bt = 80, Vt = {
|
|
|
2573
2573
|
t,
|
|
2574
2574
|
f("implements ", d(n, " & ")),
|
|
2575
2575
|
d(r, " "),
|
|
2576
|
-
|
|
2576
|
+
S(i)
|
|
2577
2577
|
],
|
|
2578
2578
|
" "
|
|
2579
2579
|
)
|
|
@@ -2587,7 +2587,7 @@ const Bt = 80, Vt = {
|
|
|
2587
2587
|
},
|
|
2588
2588
|
EnumTypeDefinition: {
|
|
2589
2589
|
leave: ({ description: e, name: t, directives: n, values: r }) => f("", e, `
|
|
2590
|
-
`) + d(["enum", t, d(n, " "),
|
|
2590
|
+
`) + d(["enum", t, d(n, " "), S(r)], " ")
|
|
2591
2591
|
},
|
|
2592
2592
|
EnumValueDefinition: {
|
|
2593
2593
|
leave: ({ description: e, name: t, directives: n }) => f("", e, `
|
|
@@ -2595,7 +2595,7 @@ const Bt = 80, Vt = {
|
|
|
2595
2595
|
},
|
|
2596
2596
|
InputObjectTypeDefinition: {
|
|
2597
2597
|
leave: ({ description: e, name: t, directives: n, fields: r }) => f("", e, `
|
|
2598
|
-
`) + d(["input", t, d(n, " "),
|
|
2598
|
+
`) + d(["input", t, d(n, " "), S(r)], " ")
|
|
2599
2599
|
},
|
|
2600
2600
|
DirectiveDefinition: {
|
|
2601
2601
|
leave: ({ description: e, name: t, arguments: n, repeatable: r, locations: i }) => f("", e, `
|
|
@@ -2606,7 +2606,7 @@ const Bt = 80, Vt = {
|
|
|
2606
2606
|
},
|
|
2607
2607
|
SchemaExtension: {
|
|
2608
2608
|
leave: ({ directives: e, operationTypes: t }) => d(
|
|
2609
|
-
["extend schema", d(e, " "),
|
|
2609
|
+
["extend schema", d(e, " "), S(t)],
|
|
2610
2610
|
" "
|
|
2611
2611
|
)
|
|
2612
2612
|
},
|
|
@@ -2620,7 +2620,7 @@ const Bt = 80, Vt = {
|
|
|
2620
2620
|
e,
|
|
2621
2621
|
f("implements ", d(t, " & ")),
|
|
2622
2622
|
d(n, " "),
|
|
2623
|
-
|
|
2623
|
+
S(r)
|
|
2624
2624
|
],
|
|
2625
2625
|
" "
|
|
2626
2626
|
)
|
|
@@ -2632,7 +2632,7 @@ const Bt = 80, Vt = {
|
|
|
2632
2632
|
e,
|
|
2633
2633
|
f("implements ", d(t, " & ")),
|
|
2634
2634
|
d(n, " "),
|
|
2635
|
-
|
|
2635
|
+
S(r)
|
|
2636
2636
|
],
|
|
2637
2637
|
" "
|
|
2638
2638
|
)
|
|
@@ -2649,10 +2649,10 @@ const Bt = 80, Vt = {
|
|
|
2649
2649
|
)
|
|
2650
2650
|
},
|
|
2651
2651
|
EnumTypeExtension: {
|
|
2652
|
-
leave: ({ name: e, directives: t, values: n }) => d(["extend enum", e, d(t, " "),
|
|
2652
|
+
leave: ({ name: e, directives: t, values: n }) => d(["extend enum", e, d(t, " "), S(n)], " ")
|
|
2653
2653
|
},
|
|
2654
2654
|
InputObjectTypeExtension: {
|
|
2655
|
-
leave: ({ name: e, directives: t, fields: n }) => d(["extend input", e, d(t, " "),
|
|
2655
|
+
leave: ({ name: e, directives: t, fields: n }) => d(["extend input", e, d(t, " "), S(n)], " ")
|
|
2656
2656
|
},
|
|
2657
2657
|
// Schema Coordinates
|
|
2658
2658
|
TypeCoordinate: {
|
|
@@ -2675,7 +2675,7 @@ function d(e, t = "") {
|
|
|
2675
2675
|
var n;
|
|
2676
2676
|
return (n = e?.filter((r) => r).join(t)) !== null && n !== void 0 ? n : "";
|
|
2677
2677
|
}
|
|
2678
|
-
function
|
|
2678
|
+
function S(e) {
|
|
2679
2679
|
return f(`{
|
|
2680
2680
|
`, Y(d(e, `
|
|
2681
2681
|
`)), `
|
|
@@ -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,60 +2925,65 @@ 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
|
}
|
|
2974
2974
|
const Ie = {
|
|
2975
2975
|
order: null,
|
|
2976
2976
|
processing: !1,
|
|
2977
|
-
error: null
|
|
2978
|
-
|
|
2977
|
+
error: null,
|
|
2978
|
+
// start uninitialized by default
|
|
2979
|
+
initialized: !1
|
|
2980
|
+
}, He = Je({
|
|
2979
2981
|
name: "basket",
|
|
2980
2982
|
initialState: Ie,
|
|
2981
2983
|
reducers: {
|
|
2984
|
+
setInitialized: (e, t) => {
|
|
2985
|
+
e.initialized = t.payload;
|
|
2986
|
+
},
|
|
2982
2987
|
setProcessing: (e, t) => {
|
|
2983
2988
|
e.processing = t.payload;
|
|
2984
2989
|
},
|
|
@@ -3121,36 +3126,53 @@ const Ie = {
|
|
|
3121
3126
|
configureCustomer: (e, t) => {
|
|
3122
3127
|
e.order && (e.order.customer = t.payload);
|
|
3123
3128
|
},
|
|
3124
|
-
clearBasket: () => Ie
|
|
3129
|
+
clearBasket: () => ({ ...Ie })
|
|
3125
3130
|
}
|
|
3126
3131
|
}), {
|
|
3127
|
-
|
|
3132
|
+
setInitialized: Ee,
|
|
3133
|
+
setProcessing: C,
|
|
3128
3134
|
initializeOrder: j,
|
|
3129
|
-
addProduct:
|
|
3130
|
-
removeProduct:
|
|
3131
|
-
configurePackage:
|
|
3132
|
-
configureDelivery:
|
|
3133
|
-
configureCustomer:
|
|
3134
|
-
reserveAdditionalPackageItem:
|
|
3135
|
-
clearBasket:
|
|
3136
|
-
} =
|
|
3137
|
-
class
|
|
3135
|
+
addProduct: ye,
|
|
3136
|
+
removeProduct: an,
|
|
3137
|
+
configurePackage: ve,
|
|
3138
|
+
configureDelivery: cn,
|
|
3139
|
+
configureCustomer: ke,
|
|
3140
|
+
reserveAdditionalPackageItem: dn,
|
|
3141
|
+
clearBasket: Ae
|
|
3142
|
+
} = He.actions;
|
|
3143
|
+
class un {
|
|
3138
3144
|
orderIdKey = "ORDER_ID";
|
|
3139
3145
|
config;
|
|
3140
3146
|
sdk;
|
|
3141
3147
|
store;
|
|
3148
|
+
// Promise-based signal consumers can await to know initialization finished
|
|
3149
|
+
_resolveInitialized;
|
|
3150
|
+
initialized;
|
|
3142
3151
|
constructor(t) {
|
|
3143
|
-
this.config = t, this.store =
|
|
3152
|
+
this.config = t, this.store = Xe({
|
|
3144
3153
|
reducer: {
|
|
3145
|
-
basket:
|
|
3154
|
+
basket: He.reducer
|
|
3146
3155
|
}
|
|
3147
|
-
}), this.
|
|
3148
|
-
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?.();
|
|
3149
3162
|
});
|
|
3150
3163
|
}
|
|
3164
|
+
// Convenience helper so consumers can `await basketService.waitUntilInitialized()`
|
|
3165
|
+
waitUntilInitialized() {
|
|
3166
|
+
return this.initialized;
|
|
3167
|
+
}
|
|
3151
3168
|
// Store functions
|
|
3152
3169
|
subscribe(t) {
|
|
3153
|
-
|
|
3170
|
+
const n = this.store.subscribe(t);
|
|
3171
|
+
try {
|
|
3172
|
+
this.getState().initialized && setTimeout(() => t(), 0);
|
|
3173
|
+
} catch {
|
|
3174
|
+
}
|
|
3175
|
+
return n;
|
|
3154
3176
|
}
|
|
3155
3177
|
getProcessing() {
|
|
3156
3178
|
return this.getState().processing;
|
|
@@ -3170,7 +3192,7 @@ class dn {
|
|
|
3170
3192
|
}
|
|
3171
3193
|
// Basket update functions
|
|
3172
3194
|
async addProduct(t) {
|
|
3173
|
-
this.store.dispatch(
|
|
3195
|
+
this.store.dispatch(C(!0));
|
|
3174
3196
|
try {
|
|
3175
3197
|
const r = this.getState().order?.id ?? sessionStorage.getItem(this.orderIdKey) ?? this.generateOrderId();
|
|
3176
3198
|
this.debugLog("Adding product", {
|
|
@@ -3202,7 +3224,7 @@ class dn {
|
|
|
3202
3224
|
expiredAt: o
|
|
3203
3225
|
})
|
|
3204
3226
|
), this.store.dispatch(
|
|
3205
|
-
|
|
3227
|
+
ye({
|
|
3206
3228
|
input: t,
|
|
3207
3229
|
amountReserved: u,
|
|
3208
3230
|
expiredAt: o
|
|
@@ -3212,13 +3234,13 @@ class dn {
|
|
|
3212
3234
|
} catch (n) {
|
|
3213
3235
|
throw this.debugLog("Error adding product", n), this.handleError(n), n;
|
|
3214
3236
|
} finally {
|
|
3215
|
-
this.store.dispatch(
|
|
3237
|
+
this.store.dispatch(C(!1));
|
|
3216
3238
|
}
|
|
3217
3239
|
}
|
|
3218
3240
|
async removeProduct(t) {
|
|
3219
3241
|
const r = this.getState().order;
|
|
3220
3242
|
if (r) {
|
|
3221
|
-
this.store.dispatch(
|
|
3243
|
+
this.store.dispatch(C(!0));
|
|
3222
3244
|
try {
|
|
3223
3245
|
this.debugLog("Removing product", {
|
|
3224
3246
|
productId: t.id,
|
|
@@ -3239,7 +3261,7 @@ class dn {
|
|
|
3239
3261
|
if (i?.releaseProduct) {
|
|
3240
3262
|
const { amountReleased: s } = i.releaseProduct;
|
|
3241
3263
|
this.debugLog("Product removed successfully", i.releaseProduct), this.store.dispatch(
|
|
3242
|
-
|
|
3264
|
+
an({
|
|
3243
3265
|
id: t.id,
|
|
3244
3266
|
amountReleased: s,
|
|
3245
3267
|
seatId: t.seat?.id
|
|
@@ -3251,12 +3273,12 @@ class dn {
|
|
|
3251
3273
|
} catch (i) {
|
|
3252
3274
|
throw this.debugLog("Error removing product", i), this.handleError(i), i;
|
|
3253
3275
|
} finally {
|
|
3254
|
-
this.store.dispatch(
|
|
3276
|
+
this.store.dispatch(C(!1));
|
|
3255
3277
|
}
|
|
3256
3278
|
}
|
|
3257
3279
|
}
|
|
3258
3280
|
async configurePackage(t) {
|
|
3259
|
-
this.store.dispatch(
|
|
3281
|
+
this.store.dispatch(C(!0));
|
|
3260
3282
|
try {
|
|
3261
3283
|
const r = this.store.getState().basket.order?.id ?? sessionStorage.getItem(this.orderIdKey) ?? this.generateOrderId(), i = t.items.map((o) => ({
|
|
3262
3284
|
packageItemId: o.packageItemId,
|
|
@@ -3286,7 +3308,7 @@ class dn {
|
|
|
3286
3308
|
expiredAt: u
|
|
3287
3309
|
})
|
|
3288
3310
|
), this.store.dispatch(
|
|
3289
|
-
|
|
3311
|
+
ve({
|
|
3290
3312
|
input: t,
|
|
3291
3313
|
amountReserved: h,
|
|
3292
3314
|
expiredAt: u
|
|
@@ -3297,17 +3319,17 @@ class dn {
|
|
|
3297
3319
|
} catch (n) {
|
|
3298
3320
|
return this.debugLog("Error configuring package", n), this.handleError(n), { error: n };
|
|
3299
3321
|
} finally {
|
|
3300
|
-
this.store.dispatch(
|
|
3322
|
+
this.store.dispatch(C(!1));
|
|
3301
3323
|
}
|
|
3302
3324
|
}
|
|
3303
3325
|
async configureDelivery(t) {
|
|
3304
|
-
this.store.dispatch(
|
|
3326
|
+
this.store.dispatch(C(!0));
|
|
3305
3327
|
try {
|
|
3306
|
-
this.store.dispatch(
|
|
3328
|
+
this.store.dispatch(cn(t));
|
|
3307
3329
|
} catch (n) {
|
|
3308
3330
|
throw this.debugLog("Error setting delivery", n), this.handleError(n), n;
|
|
3309
3331
|
} finally {
|
|
3310
|
-
this.store.dispatch(
|
|
3332
|
+
this.store.dispatch(C(!1));
|
|
3311
3333
|
}
|
|
3312
3334
|
}
|
|
3313
3335
|
async configureCustomer(t) {
|
|
@@ -3320,13 +3342,13 @@ class dn {
|
|
|
3320
3342
|
orderId: r.id,
|
|
3321
3343
|
customer: t
|
|
3322
3344
|
});
|
|
3323
|
-
this.debugLog("Customer set successfully", i), this.store.dispatch(
|
|
3345
|
+
this.debugLog("Customer set successfully", i), this.store.dispatch(ke(t));
|
|
3324
3346
|
} catch (i) {
|
|
3325
3347
|
throw this.debugLog("Failed to set customer", i), new Error(`Failed to set customer: ${i.message}`);
|
|
3326
3348
|
}
|
|
3327
3349
|
}
|
|
3328
3350
|
async reserveAdditionalPackageItem(t) {
|
|
3329
|
-
this.store.dispatch(
|
|
3351
|
+
this.store.dispatch(C(!0));
|
|
3330
3352
|
try {
|
|
3331
3353
|
const r = this.store.getState().basket.order?.id ?? sessionStorage.getItem(this.orderIdKey) ?? this.generateOrderId();
|
|
3332
3354
|
this.debugLog("reserve additional packageItem", {
|
|
@@ -3352,7 +3374,7 @@ class dn {
|
|
|
3352
3374
|
expiredAt: o
|
|
3353
3375
|
})
|
|
3354
3376
|
), this.store.dispatch(
|
|
3355
|
-
|
|
3377
|
+
dn({
|
|
3356
3378
|
input: t,
|
|
3357
3379
|
amountReserved: u,
|
|
3358
3380
|
expiredAt: o
|
|
@@ -3363,7 +3385,7 @@ class dn {
|
|
|
3363
3385
|
} catch (n) {
|
|
3364
3386
|
return this.debugLog("Error configuring package", n), this.handleError(n), { error: n };
|
|
3365
3387
|
} finally {
|
|
3366
|
-
this.store.dispatch(
|
|
3388
|
+
this.store.dispatch(C(!1));
|
|
3367
3389
|
}
|
|
3368
3390
|
}
|
|
3369
3391
|
// Cancel and clear order functions
|
|
@@ -3372,15 +3394,15 @@ class dn {
|
|
|
3372
3394
|
t && (this.debugLog("Cancelling order", { orderId: t }), await this.sdk.deleteOrder({ orderId: t }), this.clearOrderFromSession(), this.debugLog("Order cancelled successfully"));
|
|
3373
3395
|
}
|
|
3374
3396
|
clearOrderFromSession() {
|
|
3375
|
-
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());
|
|
3376
3398
|
}
|
|
3377
3399
|
// Private functions for fetching the current order from a session
|
|
3378
3400
|
async restoreOrderFromSession() {
|
|
3379
3401
|
const t = sessionStorage.getItem(this.orderIdKey);
|
|
3380
|
-
if (
|
|
3402
|
+
if (t) {
|
|
3381
3403
|
this.debugLog("Found existing order ID in session, restoring...", { orderId: t });
|
|
3382
3404
|
try {
|
|
3383
|
-
await this.fetchOrder(t), this.debugLog("Order restored successfully"), this.store.dispatch(
|
|
3405
|
+
await this.fetchOrder(t), this.debugLog("Order restored successfully"), this.store.dispatch(C(!1));
|
|
3384
3406
|
} catch (n) {
|
|
3385
3407
|
this.debugLog("Failed to restore order, clearing session", n), this.clearOrderFromSession();
|
|
3386
3408
|
}
|
|
@@ -3404,10 +3426,10 @@ class dn {
|
|
|
3404
3426
|
const r = n.findOrder;
|
|
3405
3427
|
this.debugLog("Order fetched successfully", r);
|
|
3406
3428
|
const i = r.items, s = i.filter((c) => c.product != null && c.amount > 0).map((c) => {
|
|
3407
|
-
let
|
|
3408
|
-
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), {
|
|
3409
3431
|
id: c.product.id,
|
|
3410
|
-
type:
|
|
3432
|
+
type: g,
|
|
3411
3433
|
name: c.product.name,
|
|
3412
3434
|
icon: c.product.icon,
|
|
3413
3435
|
description: c.product.description,
|
|
@@ -3416,42 +3438,42 @@ class dn {
|
|
|
3416
3438
|
depositPrice: c.depositPrice ?? 0,
|
|
3417
3439
|
originalPrice: c.originalPrice ?? 0,
|
|
3418
3440
|
serviceFee: c.serviceFee ?? 0,
|
|
3419
|
-
seats: c.seats?.map((
|
|
3420
|
-
id:
|
|
3421
|
-
label:
|
|
3441
|
+
seats: c.seats?.map((m) => ({
|
|
3442
|
+
id: m.id,
|
|
3443
|
+
label: m.label
|
|
3422
3444
|
}))
|
|
3423
3445
|
};
|
|
3424
|
-
}), 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) => {
|
|
3425
3447
|
const {
|
|
3426
|
-
packageItem:
|
|
3448
|
+
packageItem: m,
|
|
3427
3449
|
event: y,
|
|
3428
3450
|
amount: I,
|
|
3429
3451
|
price: O,
|
|
3430
|
-
serviceFee:
|
|
3452
|
+
serviceFee: x,
|
|
3431
3453
|
depositPrice: T,
|
|
3432
3454
|
originalPrice: L
|
|
3433
|
-
} =
|
|
3434
|
-
c[A] ? (c[A].price += O ?? 0, c[A].serviceFee +=
|
|
3455
|
+
} = g, A = m.package.id;
|
|
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] = {
|
|
3435
3457
|
id: A,
|
|
3436
3458
|
type: _.PACKAGE,
|
|
3437
|
-
name:
|
|
3459
|
+
name: m.package.name,
|
|
3438
3460
|
amount: I,
|
|
3439
3461
|
price: O ?? 0,
|
|
3440
|
-
serviceFee:
|
|
3462
|
+
serviceFee: x ?? 0,
|
|
3441
3463
|
depositPrice: T ?? O ?? 0,
|
|
3442
3464
|
originalPrice: L ?? 0,
|
|
3443
3465
|
packageItems: []
|
|
3444
3466
|
};
|
|
3445
|
-
const
|
|
3467
|
+
const N = R.fromISO(y.startAt, {
|
|
3446
3468
|
zone: y.timezone
|
|
3447
3469
|
}), D = R.fromISO(y.endAt, {
|
|
3448
3470
|
zone: y.timezone
|
|
3449
3471
|
});
|
|
3450
3472
|
return c[A].packageItems.push({
|
|
3451
|
-
packageItemId:
|
|
3473
|
+
packageItemId: m.id,
|
|
3452
3474
|
eventId: y.id,
|
|
3453
3475
|
name: y.name,
|
|
3454
|
-
startAt:
|
|
3476
|
+
startAt: N.toJSDate().toISOString(),
|
|
3455
3477
|
endAt: D.toJSDate().toISOString()
|
|
3456
3478
|
}), c;
|
|
3457
3479
|
}, {}), u = [
|
|
@@ -3468,7 +3490,7 @@ class dn {
|
|
|
3468
3490
|
return;
|
|
3469
3491
|
}
|
|
3470
3492
|
const p = R.fromMillis(Math.min(...h));
|
|
3471
|
-
this.store.dispatch(
|
|
3493
|
+
this.store.dispatch(Ae()), this.store.dispatch(
|
|
3472
3494
|
j({
|
|
3473
3495
|
id: r.id,
|
|
3474
3496
|
currency: r.currency,
|
|
@@ -3476,7 +3498,7 @@ class dn {
|
|
|
3476
3498
|
})
|
|
3477
3499
|
), u.forEach((c) => {
|
|
3478
3500
|
c.type === _.PACKAGE ? this.store.dispatch(
|
|
3479
|
-
|
|
3501
|
+
ve({
|
|
3480
3502
|
input: {
|
|
3481
3503
|
id: c.id,
|
|
3482
3504
|
name: c.name,
|
|
@@ -3492,7 +3514,7 @@ class dn {
|
|
|
3492
3514
|
expiredAt: p.toJSDate().toISOString()
|
|
3493
3515
|
})
|
|
3494
3516
|
) : this.store.dispatch(
|
|
3495
|
-
|
|
3517
|
+
ye({
|
|
3496
3518
|
input: {
|
|
3497
3519
|
id: c.id,
|
|
3498
3520
|
name: c.name,
|
|
@@ -3508,7 +3530,7 @@ class dn {
|
|
|
3508
3530
|
})
|
|
3509
3531
|
);
|
|
3510
3532
|
}), r.mainBooker && (this.debugLog("Order has customer (mainBooker)", r.mainBooker), this.store.dispatch(
|
|
3511
|
-
|
|
3533
|
+
ke({
|
|
3512
3534
|
firstName: r.mainBooker.firstName ?? void 0,
|
|
3513
3535
|
lastName: r.mainBooker.lastName ?? void 0,
|
|
3514
3536
|
email: r.mainBooker.email ?? void 0,
|
|
@@ -3547,7 +3569,7 @@ class dn {
|
|
|
3547
3569
|
return this.store.getState().basket;
|
|
3548
3570
|
}
|
|
3549
3571
|
}
|
|
3550
|
-
const
|
|
3572
|
+
const ln = E`
|
|
3551
3573
|
query EventOverviewPage($organizationId: ID!, $hostingIds: [String!], $trackerId: String, $filterEventStatuses: [EventStatus!], $dateRange: DateRangeInput, $page: PageInput, $sorts: [SortInput!], $searchTerm: String, $priceRange: PriceRangeInput) {
|
|
3552
3574
|
findAllPublicEventByOrganizationId(
|
|
3553
3575
|
id: $organizationId
|
|
@@ -3585,7 +3607,7 @@ const un = E`
|
|
|
3585
3607
|
count
|
|
3586
3608
|
}
|
|
3587
3609
|
}
|
|
3588
|
-
`,
|
|
3610
|
+
`, pn = E`
|
|
3589
3611
|
query EventDetailPage($eventId: ID!) {
|
|
3590
3612
|
findPublicEventById(id: $eventId) {
|
|
3591
3613
|
id
|
|
@@ -3612,7 +3634,7 @@ const un = E`
|
|
|
3612
3634
|
startingPrice
|
|
3613
3635
|
}
|
|
3614
3636
|
}
|
|
3615
|
-
`,
|
|
3637
|
+
`, hn = E`
|
|
3616
3638
|
query findProductsByEventId($eventId: ID!, $promoCode: String, $trackerId: String, $productTypes: [ProductType!]) {
|
|
3617
3639
|
findPublicProductsByEventId(
|
|
3618
3640
|
eventId: $eventId
|
|
@@ -3646,17 +3668,17 @@ const un = E`
|
|
|
3646
3668
|
showEndSalesAtTag
|
|
3647
3669
|
}
|
|
3648
3670
|
}
|
|
3649
|
-
`,
|
|
3650
|
-
function
|
|
3671
|
+
`, fn = (e, t, n, r) => e();
|
|
3672
|
+
function gn(e, t = fn) {
|
|
3651
3673
|
return {
|
|
3652
3674
|
EventOverviewPage(n, r, i) {
|
|
3653
|
-
return t((s) => e.request({ document:
|
|
3675
|
+
return t((s) => e.request({ document: ln, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "EventOverviewPage", "query", n);
|
|
3654
3676
|
},
|
|
3655
3677
|
EventDetailPage(n, r, i) {
|
|
3656
|
-
return t((s) => e.request({ document:
|
|
3678
|
+
return t((s) => e.request({ document: pn, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "EventDetailPage", "query", n);
|
|
3657
3679
|
},
|
|
3658
3680
|
findProductsByEventId(n, r, i) {
|
|
3659
|
-
return t((s) => e.request({ document:
|
|
3681
|
+
return t((s) => e.request({ document: hn, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "findProductsByEventId", "query", n);
|
|
3660
3682
|
}
|
|
3661
3683
|
};
|
|
3662
3684
|
}
|
|
@@ -3666,7 +3688,7 @@ function mn(e) {
|
|
|
3666
3688
|
const n = t[1], r = t[2];
|
|
3667
3689
|
return { type: n, name: r };
|
|
3668
3690
|
}
|
|
3669
|
-
async function
|
|
3691
|
+
async function In(e) {
|
|
3670
3692
|
if (typeof globalThis < "u" && globalThis.crypto?.subtle) {
|
|
3671
3693
|
const n = new TextEncoder().encode(e), r = await globalThis.crypto.subtle.digest("SHA-256", n);
|
|
3672
3694
|
return Array.from(new Uint8Array(r)).map((i) => i.toString(16).padStart(2, "0")).join("");
|
|
@@ -3678,45 +3700,45 @@ async function gn(e) {
|
|
|
3678
3700
|
throw new Error("SHA-256 is not available in this environment");
|
|
3679
3701
|
}
|
|
3680
3702
|
}
|
|
3681
|
-
function
|
|
3703
|
+
function En(e) {
|
|
3682
3704
|
const t = { "content-type": "application/json" };
|
|
3683
3705
|
if (e)
|
|
3684
3706
|
for (const [n, r] of Object.entries(e))
|
|
3685
3707
|
typeof r < "u" && (t[n] = String(r));
|
|
3686
3708
|
return t;
|
|
3687
3709
|
}
|
|
3688
|
-
function
|
|
3710
|
+
function Oe(e, t) {
|
|
3689
3711
|
return e?.length ? e.some((n) => t.includes(n?.extensions?.code) || t.includes(n?.message)) : !1;
|
|
3690
3712
|
}
|
|
3691
|
-
function
|
|
3713
|
+
function Te(e, t, n, r, i) {
|
|
3692
3714
|
const s = new Error(e);
|
|
3693
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;
|
|
3694
3716
|
}
|
|
3695
3717
|
function ie(e, t, n, r, i) {
|
|
3696
3718
|
if (i.json?.errors?.length)
|
|
3697
|
-
throw
|
|
3719
|
+
throw Te(`GraphQL request failed${e ? ` (${e})` : ""}`, t, n, r, i);
|
|
3698
3720
|
if (typeof i.json?.data > "u")
|
|
3699
|
-
throw
|
|
3721
|
+
throw Te("GraphQL request failed: no data received", t, n, r, i);
|
|
3700
3722
|
return i.json.data;
|
|
3701
3723
|
}
|
|
3702
3724
|
class ee extends de {
|
|
3703
3725
|
async request(t, ...n) {
|
|
3704
3726
|
let r = t, i, s, o;
|
|
3705
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]);
|
|
3706
|
-
const u = typeof r == "string" ? r :
|
|
3707
|
-
const
|
|
3708
|
-
let
|
|
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 });
|
|
3730
|
+
let b = null;
|
|
3709
3731
|
try {
|
|
3710
|
-
|
|
3732
|
+
b = await P.json();
|
|
3711
3733
|
} catch {
|
|
3712
|
-
|
|
3734
|
+
b = null;
|
|
3713
3735
|
}
|
|
3714
|
-
return { status:
|
|
3736
|
+
return { status: P.status, json: b };
|
|
3715
3737
|
}, O = async (D) => {
|
|
3716
|
-
const
|
|
3717
|
-
for (const [
|
|
3718
|
-
typeof
|
|
3719
|
-
const
|
|
3738
|
+
const P = new URLSearchParams();
|
|
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 });
|
|
3720
3742
|
let te = null;
|
|
3721
3743
|
try {
|
|
3722
3744
|
te = await pe.json();
|
|
@@ -3724,34 +3746,34 @@ class ee extends de {
|
|
|
3724
3746
|
te = null;
|
|
3725
3747
|
}
|
|
3726
3748
|
return { status: pe.status, json: te };
|
|
3727
|
-
},
|
|
3749
|
+
}, x = {
|
|
3728
3750
|
operationName: p,
|
|
3729
|
-
variables:
|
|
3751
|
+
variables: g,
|
|
3730
3752
|
extensions: { persistedQuery: { version: 1, sha256Hash: c } }
|
|
3731
|
-
}, T = async (D,
|
|
3732
|
-
if (
|
|
3733
|
-
const B = await
|
|
3734
|
-
return ie("APQ register", u,
|
|
3753
|
+
}, T = async (D, P, b) => {
|
|
3754
|
+
if (Oe(D.json?.errors, ["PERSISTED_QUERY_NOT_FOUND", "PersistedQueryNotFound"])) {
|
|
3755
|
+
const B = await P();
|
|
3756
|
+
return ie("APQ register", u, g, p, B);
|
|
3735
3757
|
}
|
|
3736
|
-
if (
|
|
3737
|
-
const B = await
|
|
3738
|
-
return ie("no APQ support", u,
|
|
3758
|
+
if (Oe(D.json?.errors, ["PERSISTED_QUERY_NOT_SUPPORTED"])) {
|
|
3759
|
+
const B = await b();
|
|
3760
|
+
return ie("no APQ support", u, g, p, B);
|
|
3739
3761
|
}
|
|
3740
|
-
return ie("", u,
|
|
3762
|
+
return ie("", u, g, p, D);
|
|
3741
3763
|
};
|
|
3742
3764
|
if (h === "query") {
|
|
3743
|
-
const D = await O(
|
|
3744
|
-
return T(D, () => I({ ...
|
|
3765
|
+
const D = await O(x);
|
|
3766
|
+
return T(D, () => I({ ...x, query: u }), () => I({ operationName: p, variables: g, query: u }));
|
|
3745
3767
|
}
|
|
3746
|
-
const L = await I(
|
|
3747
|
-
return T(L, () => I({ ...
|
|
3768
|
+
const L = await I(x);
|
|
3769
|
+
return T(L, () => I({ ...x, query: u }), () => I({ operationName: p, variables: g, query: u }));
|
|
3748
3770
|
}
|
|
3749
3771
|
}
|
|
3750
|
-
class
|
|
3772
|
+
class yn {
|
|
3751
3773
|
config;
|
|
3752
3774
|
sdk;
|
|
3753
3775
|
constructor(t) {
|
|
3754
|
-
this.config = t, this.sdk =
|
|
3776
|
+
this.config = t, this.sdk = gn(new ee(t.apiUrl));
|
|
3755
3777
|
}
|
|
3756
3778
|
async fetchEvents(t = {}) {
|
|
3757
3779
|
try {
|
|
@@ -3903,7 +3925,7 @@ class En {
|
|
|
3903
3925
|
this.config.debug && console.log(`[EventService:${this.config.organizationId}] ${t}`, n || "");
|
|
3904
3926
|
}
|
|
3905
3927
|
}
|
|
3906
|
-
const
|
|
3928
|
+
const vn = E`
|
|
3907
3929
|
query findPaymentMethods($orderId: ID!, $orderItemId: String, $amountOfTickets: Int, $paymentMethodId: String) {
|
|
3908
3930
|
findPaymentDetails(
|
|
3909
3931
|
orderId: $orderId
|
|
@@ -3931,26 +3953,26 @@ const yn = E`
|
|
|
3931
3953
|
paymentSpesificTransactionFee
|
|
3932
3954
|
}
|
|
3933
3955
|
}
|
|
3934
|
-
`,
|
|
3956
|
+
`, kn = E`
|
|
3935
3957
|
mutation createDigitalPayment($input: CreateDigitalOrderPaymentInput!) {
|
|
3936
3958
|
createDigitalOrderPayment(input: $input)
|
|
3937
3959
|
}
|
|
3938
|
-
`,
|
|
3939
|
-
function
|
|
3960
|
+
`, An = (e, t, n, r) => e();
|
|
3961
|
+
function On(e, t = An) {
|
|
3940
3962
|
return {
|
|
3941
3963
|
findPaymentMethods(n, r, i) {
|
|
3942
|
-
return t((s) => e.request({ document:
|
|
3964
|
+
return t((s) => e.request({ document: vn, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "findPaymentMethods", "query", n);
|
|
3943
3965
|
},
|
|
3944
3966
|
createDigitalPayment(n, r, i) {
|
|
3945
|
-
return t((s) => e.request({ document:
|
|
3967
|
+
return t((s) => e.request({ document: kn, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "createDigitalPayment", "mutation", n);
|
|
3946
3968
|
}
|
|
3947
3969
|
};
|
|
3948
3970
|
}
|
|
3949
|
-
class
|
|
3971
|
+
class Tn {
|
|
3950
3972
|
config;
|
|
3951
3973
|
sdk;
|
|
3952
3974
|
constructor(t) {
|
|
3953
|
-
this.config = t, this.sdk =
|
|
3975
|
+
this.config = t, this.sdk = On(new de(t.apiUrl));
|
|
3954
3976
|
}
|
|
3955
3977
|
async getPaymentDetails(t) {
|
|
3956
3978
|
this.debugLog("Fetching payment methods", t);
|
|
@@ -4024,7 +4046,7 @@ class On {
|
|
|
4024
4046
|
this.config.debug && console.log(`[PaymentService] ${t}`, n || "");
|
|
4025
4047
|
}
|
|
4026
4048
|
}
|
|
4027
|
-
const
|
|
4049
|
+
const Dn = E`
|
|
4028
4050
|
query findAllPublicPackagesByOrganizationId($organizationId: ID!) {
|
|
4029
4051
|
findAllPublicPackagesByOrganizationId(organizationId: $organizationId) {
|
|
4030
4052
|
data {
|
|
@@ -4049,7 +4071,7 @@ const Tn = E`
|
|
|
4049
4071
|
count
|
|
4050
4072
|
}
|
|
4051
4073
|
}
|
|
4052
|
-
`,
|
|
4074
|
+
`, xn = E`
|
|
4053
4075
|
query findPublicPackageById($packageId: ID!) {
|
|
4054
4076
|
findPublicPackageById(id: $packageId) {
|
|
4055
4077
|
id
|
|
@@ -4075,7 +4097,7 @@ const Tn = E`
|
|
|
4075
4097
|
}
|
|
4076
4098
|
}
|
|
4077
4099
|
}
|
|
4078
|
-
`,
|
|
4100
|
+
`, Nn = E`
|
|
4079
4101
|
query findPublicItemsByPackageId($packageId: ID!, $types: [PackageItemType!], $page: PageInput) {
|
|
4080
4102
|
findPublicItemsByPackageId(packageId: $packageId, types: $types, page: $page) {
|
|
4081
4103
|
data {
|
|
@@ -4110,25 +4132,25 @@ const Tn = E`
|
|
|
4110
4132
|
count
|
|
4111
4133
|
}
|
|
4112
4134
|
}
|
|
4113
|
-
`,
|
|
4114
|
-
function
|
|
4135
|
+
`, Pn = (e, t, n, r) => e();
|
|
4136
|
+
function bn(e, t = Pn) {
|
|
4115
4137
|
return {
|
|
4116
4138
|
findAllPublicPackagesByOrganizationId(n, r, i) {
|
|
4117
|
-
return t((s) => e.request({ document:
|
|
4139
|
+
return t((s) => e.request({ document: Dn, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "findAllPublicPackagesByOrganizationId", "query", n);
|
|
4118
4140
|
},
|
|
4119
4141
|
findPublicPackageById(n, r, i) {
|
|
4120
|
-
return t((s) => e.request({ document:
|
|
4142
|
+
return t((s) => e.request({ document: xn, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "findPublicPackageById", "query", n);
|
|
4121
4143
|
},
|
|
4122
4144
|
findPublicItemsByPackageId(n, r, i) {
|
|
4123
|
-
return t((s) => e.request({ document:
|
|
4145
|
+
return t((s) => e.request({ document: Nn, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "findPublicItemsByPackageId", "query", n);
|
|
4124
4146
|
}
|
|
4125
4147
|
};
|
|
4126
4148
|
}
|
|
4127
|
-
class
|
|
4149
|
+
class Sn {
|
|
4128
4150
|
config;
|
|
4129
4151
|
sdk;
|
|
4130
4152
|
constructor(t) {
|
|
4131
|
-
this.config = t, this.sdk =
|
|
4153
|
+
this.config = t, this.sdk = bn(new ee(t.apiUrl));
|
|
4132
4154
|
}
|
|
4133
4155
|
debugLog(t, n) {
|
|
4134
4156
|
this.config.debug && console.log(`[PackageService] ${t}`, n || "");
|
|
@@ -4196,7 +4218,7 @@ class bn {
|
|
|
4196
4218
|
}
|
|
4197
4219
|
}
|
|
4198
4220
|
}
|
|
4199
|
-
const
|
|
4221
|
+
const Cn = E`
|
|
4200
4222
|
query findAllPublicCategoriesByOrganizationId($organizationId: ID!, $dateRange: DateRangeInput) {
|
|
4201
4223
|
findAllPublicHostingsByOrganizationId(id: $organizationId) {
|
|
4202
4224
|
data {
|
|
@@ -4208,7 +4230,7 @@ const Sn = E`
|
|
|
4208
4230
|
count
|
|
4209
4231
|
}
|
|
4210
4232
|
}
|
|
4211
|
-
`,
|
|
4233
|
+
`, _n = E`
|
|
4212
4234
|
query findPublicCategoryById($hostingId: ID!, $dateRange: DateRangeInput) {
|
|
4213
4235
|
findPublicHostingById(id: $hostingId) {
|
|
4214
4236
|
id
|
|
@@ -4217,22 +4239,22 @@ const Sn = E`
|
|
|
4217
4239
|
amountOfActiveEvents(input: $dateRange)
|
|
4218
4240
|
}
|
|
4219
4241
|
}
|
|
4220
|
-
`,
|
|
4221
|
-
function
|
|
4242
|
+
`, Ln = (e, t, n, r) => e();
|
|
4243
|
+
function Rn(e, t = Ln) {
|
|
4222
4244
|
return {
|
|
4223
4245
|
findAllPublicCategoriesByOrganizationId(n, r, i) {
|
|
4224
|
-
return t((s) => e.request({ document:
|
|
4246
|
+
return t((s) => e.request({ document: Cn, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "findAllPublicCategoriesByOrganizationId", "query", n);
|
|
4225
4247
|
},
|
|
4226
4248
|
findPublicCategoryById(n, r, i) {
|
|
4227
|
-
return t((s) => e.request({ document:
|
|
4249
|
+
return t((s) => e.request({ document: _n, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "findPublicCategoryById", "query", n);
|
|
4228
4250
|
}
|
|
4229
4251
|
};
|
|
4230
4252
|
}
|
|
4231
|
-
class
|
|
4253
|
+
class Fn {
|
|
4232
4254
|
config;
|
|
4233
4255
|
sdk;
|
|
4234
4256
|
constructor(t) {
|
|
4235
|
-
this.config = t, this.sdk =
|
|
4257
|
+
this.config = t, this.sdk = Rn(new ee(t.apiUrl));
|
|
4236
4258
|
}
|
|
4237
4259
|
debugLog(t, n) {
|
|
4238
4260
|
this.config.debug && console.log(`[CategoryService] ${t}`, n || "");
|
|
@@ -4264,37 +4286,37 @@ class Rn {
|
|
|
4264
4286
|
}
|
|
4265
4287
|
}
|
|
4266
4288
|
}
|
|
4267
|
-
const
|
|
4289
|
+
const wn = E`
|
|
4268
4290
|
mutation CreateShopView($id: ID!, $trackerLinkId: ID) {
|
|
4269
4291
|
createShopView(id: $id, trackerId: $trackerLinkId)
|
|
4270
4292
|
}
|
|
4271
|
-
`,
|
|
4293
|
+
`, $n = E`
|
|
4272
4294
|
mutation CreateEventView($id: ID!, $shopId: ID, $trackerLinkId: ID) {
|
|
4273
4295
|
createEventView(id: $id, shopId: $shopId, trackerId: $trackerLinkId)
|
|
4274
4296
|
}
|
|
4275
|
-
`,
|
|
4297
|
+
`, Bn = E`
|
|
4276
4298
|
mutation CreatePackageView($id: ID!, $shopId: ID, $trackerLinkId: ID) {
|
|
4277
4299
|
createPackageView(id: $id, shopId: $shopId, trackerId: $trackerLinkId)
|
|
4278
4300
|
}
|
|
4279
|
-
`,
|
|
4280
|
-
function
|
|
4301
|
+
`, Vn = (e, t, n, r) => e();
|
|
4302
|
+
function Un(e, t = Vn) {
|
|
4281
4303
|
return {
|
|
4282
4304
|
CreateShopView(n, r, i) {
|
|
4283
|
-
return t((s) => e.request({ document:
|
|
4305
|
+
return t((s) => e.request({ document: wn, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "CreateShopView", "mutation", n);
|
|
4284
4306
|
},
|
|
4285
4307
|
CreateEventView(n, r, i) {
|
|
4286
|
-
return t((s) => e.request({ document:
|
|
4308
|
+
return t((s) => e.request({ document: $n, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "CreateEventView", "mutation", n);
|
|
4287
4309
|
},
|
|
4288
4310
|
CreatePackageView(n, r, i) {
|
|
4289
|
-
return t((s) => e.request({ document:
|
|
4311
|
+
return t((s) => e.request({ document: Bn, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "CreatePackageView", "mutation", n);
|
|
4290
4312
|
}
|
|
4291
4313
|
};
|
|
4292
4314
|
}
|
|
4293
|
-
class
|
|
4315
|
+
class Mn {
|
|
4294
4316
|
config;
|
|
4295
4317
|
sdk;
|
|
4296
4318
|
constructor(t) {
|
|
4297
|
-
this.config = t, this.sdk =
|
|
4319
|
+
this.config = t, this.sdk = Un(new ee(t.apiUrl));
|
|
4298
4320
|
}
|
|
4299
4321
|
createMetric = async (t, n, r) => {
|
|
4300
4322
|
switch (!n && !r && await this.sdk.CreateShopView({
|
|
@@ -4320,8 +4342,8 @@ class Un {
|
|
|
4320
4342
|
}
|
|
4321
4343
|
};
|
|
4322
4344
|
}
|
|
4323
|
-
const
|
|
4324
|
-
class
|
|
4345
|
+
const zn = "https://api.ticketapp.com/graphql", De = "TIC_TRACKER_ID";
|
|
4346
|
+
class Yn {
|
|
4325
4347
|
basket;
|
|
4326
4348
|
event;
|
|
4327
4349
|
payment;
|
|
@@ -4329,10 +4351,10 @@ class Gn {
|
|
|
4329
4351
|
category;
|
|
4330
4352
|
metric;
|
|
4331
4353
|
// Attach selected public types to the SDK class
|
|
4332
|
-
static Types =
|
|
4354
|
+
static Types = Ke;
|
|
4333
4355
|
constructor(t) {
|
|
4334
|
-
const { organizationId: n, debug: r = !1, apiUrl: i =
|
|
4335
|
-
this.basket = new
|
|
4356
|
+
const { organizationId: n, debug: r = !1, apiUrl: i = zn } = t, s = this.getOrInitTrackerId();
|
|
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 });
|
|
4336
4358
|
}
|
|
4337
4359
|
// Resolve tracker id from (in order): explicit config, URL query, or session storage
|
|
4338
4360
|
// Persist to session when found via config or URL for subsequent page loads
|
|
@@ -4345,13 +4367,13 @@ class Gn {
|
|
|
4345
4367
|
} catch {
|
|
4346
4368
|
}
|
|
4347
4369
|
try {
|
|
4348
|
-
t = window.sessionStorage?.getItem(
|
|
4370
|
+
t = window.sessionStorage?.getItem(De) ?? null;
|
|
4349
4371
|
} catch {
|
|
4350
4372
|
}
|
|
4351
4373
|
}
|
|
4352
4374
|
if (n && n.trim().length > 0) {
|
|
4353
4375
|
try {
|
|
4354
|
-
typeof window < "u" && window.sessionStorage && sessionStorage.setItem(
|
|
4376
|
+
typeof window < "u" && window.sessionStorage && sessionStorage.setItem(De, n);
|
|
4355
4377
|
} catch {
|
|
4356
4378
|
}
|
|
4357
4379
|
return n;
|
|
@@ -4374,16 +4396,16 @@ class Gn {
|
|
|
4374
4396
|
}
|
|
4375
4397
|
export {
|
|
4376
4398
|
_ as BasketOrderType,
|
|
4377
|
-
|
|
4378
|
-
|
|
4399
|
+
Re as DiscountType,
|
|
4400
|
+
Pe as EventStatus,
|
|
4379
4401
|
J as MetricsType,
|
|
4380
|
-
|
|
4402
|
+
Le as OrderItemType,
|
|
4381
4403
|
Q as PackageItemType,
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
|
|
4387
|
-
|
|
4388
|
-
|
|
4404
|
+
xe as PackageStatus,
|
|
4405
|
+
Ne as PackageTabType,
|
|
4406
|
+
_e as PaymentMethodFeeType,
|
|
4407
|
+
Se as ProductStatus,
|
|
4408
|
+
Ce as ProductType,
|
|
4409
|
+
be as SortOrder,
|
|
4410
|
+
Yn as TicketappSDK
|
|
4389
4411
|
};
|