@ticketapp-dev/shop-sdk 1.0.44 → 1.0.45

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,99 +1,101 @@
1
- import { GraphQLClient as v } from "graphql-request";
2
- import { DateTime as A } from "luxon";
3
- var T = /* @__PURE__ */ ((t) => (t.PACKAGE = "PACKAGE", t.PRODUCT = "PRODUCT", t.ADD_ONS = "ADD_ONS", t.DELIVERY = "DELIVERY", t.PICKUP = "PICKUP", t))(T || {}), R = /* @__PURE__ */ ((t) => (t.AdditionalEvent = "ADDITIONAL_EVENT", t.Addon = "ADDON", t.Regular = "REGULAR", t))(R || {}), K = /* @__PURE__ */ ((t) => (t.Active = "ACTIVE", t.Concept = "CONCEPT", t.Paused = "PAUSED", t.SoldOut = "SOLD_OUT", t))(K || {}), ee = /* @__PURE__ */ ((t) => (t.Active = "ACTIVE", t.Inactive = "INACTIVE", t))(ee || {}), te = /* @__PURE__ */ ((t) => (t.Active = "ACTIVE", t.Inactive = "INACTIVE", t.Paused = "PAUSED", t.SoldOut = "SOLD_OUT", t))(te || {}), ne = /* @__PURE__ */ ((t) => (t.Asc = "ASC", t.Desc = "DESC", t))(ne || {}), ie = /* @__PURE__ */ ((t) => (t.AllReserved = "ALL_RESERVED", t.Available = "AVAILABLE", t.SoldOut = "SOLD_OUT", t))(ie || {}), re = /* @__PURE__ */ ((t) => (t.Addon = "ADDON", t.Delivery = "DELIVERY", t.Door = "DOOR", t.Friend = "FRIEND", t.Guest = "GUEST", t.Pickup = "PICKUP", t.Promoter = "PROMOTER", t.Ticket = "TICKET", t))(re || {}), se = /* @__PURE__ */ ((t) => (t.FIXED = "FIXED", t.PERCENTAGE = "PERCENTAGE", t))(se || {}), ae = /* @__PURE__ */ ((t) => (t.AddOn = "ADD_ON", t.DeliveryOption = "DELIVERY_OPTION", t.EntranceTicket = "ENTRANCE_TICKET", t))(ae || {}), oe = /* @__PURE__ */ ((t) => (t.Fixed = "FIXED", t.Percentage = "PERCENTAGE", t))(oe || {}), w = /* @__PURE__ */ ((t) => (t.Event = "EVENT", t.Package = "PACKAGE", t))(w || {});
1
+ import { GraphQLClient as N } from "graphql-request";
2
+ import { DateTime as k } from "luxon";
3
+ var T = /* @__PURE__ */ ((t) => (t.PACKAGE = "PACKAGE", t.PRODUCT = "PRODUCT", t.ADD_ONS = "ADD_ONS", t.DELIVERY = "DELIVERY", t.PICKUP = "PICKUP", t))(T || {}), R = /* @__PURE__ */ ((t) => (t.AdditionalEvent = "ADDITIONAL_EVENT", t.Addon = "ADDON", t.Regular = "REGULAR", t))(R || {}), Z = /* @__PURE__ */ ((t) => (t.Active = "ACTIVE", t.Concept = "CONCEPT", t.Paused = "PAUSED", t.SoldOut = "SOLD_OUT", t))(Z || {}), K = /* @__PURE__ */ ((t) => (t.Active = "ACTIVE", t.Inactive = "INACTIVE", t))(K || {}), ee = /* @__PURE__ */ ((t) => (t.Active = "ACTIVE", t.Inactive = "INACTIVE", t.Paused = "PAUSED", t.SoldOut = "SOLD_OUT", t))(ee || {}), te = /* @__PURE__ */ ((t) => (t.Asc = "ASC", t.Desc = "DESC", t))(te || {}), ne = /* @__PURE__ */ ((t) => (t.AllReserved = "ALL_RESERVED", t.Available = "AVAILABLE", t.SoldOut = "SOLD_OUT", t))(ne || {}), ie = /* @__PURE__ */ ((t) => (t.Addon = "ADDON", t.Delivery = "DELIVERY", t.Door = "DOOR", t.Friend = "FRIEND", t.Guest = "GUEST", t.Pickup = "PICKUP", t.Promoter = "PROMOTER", t.Ticket = "TICKET", t))(ie || {}), re = /* @__PURE__ */ ((t) => (t.FIXED = "FIXED", t.PERCENTAGE = "PERCENTAGE", t))(re || {}), se = /* @__PURE__ */ ((t) => (t.AddOn = "ADD_ON", t.DeliveryOption = "DELIVERY_OPTION", t.EntranceTicket = "ENTRANCE_TICKET", t))(se || {}), ae = /* @__PURE__ */ ((t) => (t.Fixed = "FIXED", t.Percentage = "PERCENTAGE", t))(ae || {}), oe = /* @__PURE__ */ ((t) => (t.Default = "DEFAULT", t.Transparent = "TRANSPARENT", t))(oe || {}), ce = /* @__PURE__ */ ((t) => (t.Calendar = "CALENDAR", t.Large = "LARGE", t.Small = "SMALL", t))(ce || {}), F = /* @__PURE__ */ ((t) => (t.Event = "EVENT", t.Package = "PACKAGE", t))(F || {});
4
4
  const Te = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
5
5
  __proto__: null,
6
6
  BasketOrderType: T,
7
- DiscountType: oe,
8
- EventStatus: te,
9
- MetricsType: w,
10
- OrderItemType: ae,
7
+ DiscountType: ae,
8
+ EventStatus: ee,
9
+ MetricsType: F,
10
+ OrderItemType: se,
11
11
  PackageItemType: R,
12
- PackageStatus: K,
13
- PackageTabType: ee,
14
- PaymentMethodFeeType: se,
15
- ProductStatus: ie,
16
- ProductType: re,
17
- SortOrder: ne
12
+ PackageStatus: Z,
13
+ PackageTabType: K,
14
+ PaymentMethodFeeType: re,
15
+ ProductStatus: ne,
16
+ ProductType: ie,
17
+ ShopTemplateType: oe,
18
+ ShopVariationType: ce,
19
+ SortOrder: te
18
20
  }, Symbol.toStringTag, { value: "Module" }));
19
- var F = function() {
20
- return F = Object.assign || function(n) {
21
- for (var e, i = 1, r = arguments.length; i < r; i++) {
22
- e = arguments[i];
23
- for (var s in e) Object.prototype.hasOwnProperty.call(e, s) && (n[s] = e[s]);
21
+ var w = function() {
22
+ return w = Object.assign || function(e) {
23
+ for (var n, i = 1, r = arguments.length; i < r; i++) {
24
+ n = arguments[i];
25
+ for (var s in n) Object.prototype.hasOwnProperty.call(n, s) && (e[s] = n[s]);
24
26
  }
25
- return n;
26
- }, F.apply(this, arguments);
27
+ return e;
28
+ }, w.apply(this, arguments);
27
29
  };
28
- function U(t, n) {
30
+ function U(t, e) {
29
31
  if (!!!t)
30
- throw new Error(n);
32
+ throw new Error(e);
31
33
  }
32
- function Ae(t) {
34
+ function De(t) {
33
35
  return typeof t == "object" && t !== null;
34
36
  }
35
- function Ne(t, n) {
37
+ function Ne(t, e) {
36
38
  if (!!!t)
37
39
  throw new Error(
38
40
  "Unexpected invariant triggered."
39
41
  );
40
42
  }
41
- const De = /\r\n|[\n\r]/g;
42
- function z(t, n) {
43
- let e = 0, i = 1;
44
- for (const r of t.body.matchAll(De)) {
45
- if (typeof r.index == "number" || Ne(!1), r.index >= n)
43
+ const ve = /\r\n|[\n\r]/g;
44
+ function z(t, e) {
45
+ let n = 0, i = 1;
46
+ for (const r of t.body.matchAll(ve)) {
47
+ if (typeof r.index == "number" || Ne(!1), r.index >= e)
46
48
  break;
47
- e = r.index + r[0].length, i += 1;
49
+ n = r.index + r[0].length, i += 1;
48
50
  }
49
51
  return {
50
52
  line: i,
51
- column: n + 1 - e
53
+ column: e + 1 - n
52
54
  };
53
55
  }
54
- function ve(t) {
55
- return ce(
56
+ function be(t) {
57
+ return de(
56
58
  t.source,
57
59
  z(t.source, t.start)
58
60
  );
59
61
  }
60
- function ce(t, n) {
61
- const e = t.locationOffset.column - 1, i = "".padStart(e) + t.body, r = n.line - 1, s = t.locationOffset.line - 1, o = n.line + s, u = n.line === 1 ? e : 0, h = n.column + u, E = `${t.name}:${o}:${h}
62
- `, m = i.split(/\r\n|[\n\r]/g), d = m[r];
62
+ function de(t, e) {
63
+ const n = t.locationOffset.column - 1, i = "".padStart(n) + t.body, r = e.line - 1, s = t.locationOffset.line - 1, o = e.line + s, l = e.line === 1 ? n : 0, p = e.column + l, E = `${t.name}:${o}:${p}
64
+ `, g = i.split(/\r\n|[\n\r]/g), d = g[r];
63
65
  if (d.length > 120) {
64
- const f = Math.floor(h / 80), y = h % 80, p = [];
66
+ const m = Math.floor(p / 80), y = p % 80, h = [];
65
67
  for (let O = 0; O < d.length; O += 80)
66
- p.push(d.slice(O, O + 80));
68
+ h.push(d.slice(O, O + 80));
67
69
  return E + Q([
68
- [`${o} |`, p[0]],
69
- ...p.slice(1, f + 1).map((O) => ["|", O]),
70
+ [`${o} |`, h[0]],
71
+ ...h.slice(1, m + 1).map((O) => ["|", O]),
70
72
  ["|", "^".padStart(y)],
71
- ["|", p[f + 1]]
73
+ ["|", h[m + 1]]
72
74
  ]);
73
75
  }
74
76
  return E + Q([
75
77
  // Lines specified like this: ["prefix", "string"],
76
- [`${o - 1} |`, m[r - 1]],
78
+ [`${o - 1} |`, g[r - 1]],
77
79
  [`${o} |`, d],
78
- ["|", "^".padStart(h)],
79
- [`${o + 1} |`, m[r + 1]]
80
+ ["|", "^".padStart(p)],
81
+ [`${o + 1} |`, g[r + 1]]
80
82
  ]);
81
83
  }
82
84
  function Q(t) {
83
- const n = t.filter(([i, r]) => r !== void 0), e = Math.max(...n.map(([i]) => i.length));
84
- return n.map(([i, r]) => i.padStart(e) + (r ? " " + r : "")).join(`
85
+ const e = t.filter(([i, r]) => r !== void 0), n = Math.max(...e.map(([i]) => i.length));
86
+ return e.map(([i, r]) => i.padStart(n) + (r ? " " + r : "")).join(`
85
87
  `);
86
88
  }
87
89
  function Pe(t) {
88
- const n = t[0];
89
- return n == null || "kind" in n || "length" in n ? {
90
- nodes: n,
90
+ const e = t[0];
91
+ return e == null || "kind" in e || "length" in e ? {
92
+ nodes: e,
91
93
  source: t[1],
92
94
  positions: t[2],
93
95
  path: t[3],
94
96
  originalError: t[4],
95
97
  extensions: t[5]
96
- } : n;
98
+ } : e;
97
99
  }
98
100
  class j extends Error {
99
101
  /**
@@ -134,19 +136,19 @@ class j extends Error {
134
136
  /**
135
137
  * @deprecated Please use the `GraphQLErrorOptions` constructor overload instead.
136
138
  */
137
- constructor(n, ...e) {
139
+ constructor(e, ...n) {
138
140
  var i, r, s;
139
- const { nodes: o, source: u, positions: h, path: E, originalError: m, extensions: d } = Pe(e);
140
- super(n), this.name = "GraphQLError", this.path = E ?? void 0, this.originalError = m ?? void 0, this.nodes = X(
141
+ const { nodes: o, source: l, positions: p, path: E, originalError: g, extensions: d } = Pe(n);
142
+ super(e), this.name = "GraphQLError", this.path = E ?? void 0, this.originalError = g ?? void 0, this.nodes = X(
141
143
  Array.isArray(o) ? o : o ? [o] : void 0
142
144
  );
143
- const f = X(
144
- (i = this.nodes) === null || i === void 0 ? void 0 : i.map((p) => p.loc).filter((p) => p != null)
145
+ const m = X(
146
+ (i = this.nodes) === null || i === void 0 ? void 0 : i.map((h) => h.loc).filter((h) => h != null)
145
147
  );
146
- this.source = u ?? (f == null || (r = f[0]) === null || r === void 0 ? void 0 : r.source), this.positions = h ?? f?.map((p) => p.start), this.locations = h && u ? h.map((p) => z(u, p)) : f?.map((p) => z(p.source, p.start));
147
- const y = Ae(
148
- m?.extensions
149
- ) ? m?.extensions : void 0;
148
+ this.source = l ?? (m == null || (r = m[0]) === null || r === void 0 ? void 0 : r.source), this.positions = p ?? m?.map((h) => h.start), this.locations = p && l ? p.map((h) => z(l, h)) : m?.map((h) => z(h.source, h.start));
149
+ const y = De(
150
+ g?.extensions
151
+ ) ? g?.extensions : void 0;
150
152
  this.extensions = (s = d ?? y) !== null && s !== void 0 ? s : /* @__PURE__ */ Object.create(null), Object.defineProperties(this, {
151
153
  message: {
152
154
  writable: !0,
@@ -167,8 +169,8 @@ class j extends Error {
167
169
  originalError: {
168
170
  enumerable: !1
169
171
  }
170
- }), m != null && m.stack ? Object.defineProperty(this, "stack", {
171
- value: m.stack,
172
+ }), g != null && g.stack ? Object.defineProperty(this, "stack", {
173
+ value: g.stack,
172
174
  writable: !0,
173
175
  configurable: !0
174
176
  }) : Error.captureStackTrace ? Error.captureStackTrace(this, j) : Object.defineProperty(this, "stack", {
@@ -181,36 +183,36 @@ class j extends Error {
181
183
  return "GraphQLError";
182
184
  }
183
185
  toString() {
184
- let n = this.message;
186
+ let e = this.message;
185
187
  if (this.nodes)
186
- for (const e of this.nodes)
187
- e.loc && (n += `
188
+ for (const n of this.nodes)
189
+ n.loc && (e += `
188
190
 
189
- ` + ve(e.loc));
191
+ ` + be(n.loc));
190
192
  else if (this.source && this.locations)
191
- for (const e of this.locations)
192
- n += `
193
+ for (const n of this.locations)
194
+ e += `
193
195
 
194
- ` + ce(this.source, e);
195
- return n;
196
+ ` + de(this.source, n);
197
+ return e;
196
198
  }
197
199
  toJSON() {
198
- const n = {
200
+ const e = {
199
201
  message: this.message
200
202
  };
201
- return this.locations != null && (n.locations = this.locations), this.path != null && (n.path = this.path), this.extensions != null && Object.keys(this.extensions).length > 0 && (n.extensions = this.extensions), n;
203
+ return this.locations != null && (e.locations = this.locations), this.path != null && (e.path = this.path), this.extensions != null && Object.keys(this.extensions).length > 0 && (e.extensions = this.extensions), e;
202
204
  }
203
205
  }
204
206
  function X(t) {
205
207
  return t === void 0 || t.length === 0 ? void 0 : t;
206
208
  }
207
- function I(t, n, e) {
208
- return new j(`Syntax Error: ${e}`, {
209
+ function I(t, e, n) {
210
+ return new j(`Syntax Error: ${n}`, {
209
211
  source: t,
210
- positions: [n]
212
+ positions: [e]
211
213
  });
212
214
  }
213
- class xe {
215
+ class Se {
214
216
  /**
215
217
  * The character offset at which this Node begins.
216
218
  */
@@ -226,8 +228,8 @@ class xe {
226
228
  /**
227
229
  * The Source document the AST represents.
228
230
  */
229
- constructor(n, e, i) {
230
- this.start = n.start, this.end = e.end, this.startToken = n, this.endToken = e, this.source = i;
231
+ constructor(e, n, i) {
232
+ this.start = e.start, this.end = n.end, this.startToken = e, this.endToken = n, this.source = i;
231
233
  }
232
234
  get [Symbol.toStringTag]() {
233
235
  return "Location";
@@ -239,7 +241,7 @@ class xe {
239
241
  };
240
242
  }
241
243
  }
242
- class de {
244
+ class ue {
243
245
  /**
244
246
  * The kind of Token.
245
247
  */
@@ -266,8 +268,8 @@ class de {
266
268
  * including ignored tokens. <SOF> is always the first node and <EOF>
267
269
  * the last.
268
270
  */
269
- constructor(n, e, i, r, s, o) {
270
- this.kind = n, this.start = e, this.end = i, this.line = r, this.column = s, this.value = o, this.prev = null, this.next = null;
271
+ constructor(e, n, i, r, s, o) {
272
+ this.kind = e, this.start = n, this.end = i, this.line = r, this.column = s, this.value = o, this.prev = null, this.next = null;
271
273
  }
272
274
  get [Symbol.toStringTag]() {
273
275
  return "Token";
@@ -281,7 +283,7 @@ class de {
281
283
  };
282
284
  }
283
285
  }
284
- const be = {
286
+ const xe = {
285
287
  Name: [],
286
288
  Document: ["definitions"],
287
289
  OperationDefinition: [
@@ -369,11 +371,11 @@ const be = {
369
371
  DirectiveCoordinate: ["name"],
370
372
  DirectiveArgumentCoordinate: ["name", "argumentName"]
371
373
  };
372
- new Set(Object.keys(be));
373
- var D;
374
+ new Set(Object.keys(xe));
375
+ var v;
374
376
  (function(t) {
375
377
  t.QUERY = "query", t.MUTATION = "mutation", t.SUBSCRIPTION = "subscription";
376
- })(D || (D = {}));
378
+ })(v || (v = {}));
377
379
  var q;
378
380
  (function(t) {
379
381
  t.QUERY = "QUERY", t.MUTATION = "MUTATION", t.SUBSCRIPTION = "SUBSCRIPTION", t.FIELD = "FIELD", t.FRAGMENT_DEFINITION = "FRAGMENT_DEFINITION", t.FRAGMENT_SPREAD = "FRAGMENT_SPREAD", t.INLINE_FRAGMENT = "INLINE_FRAGMENT", t.VARIABLE_DEFINITION = "VARIABLE_DEFINITION", t.SCHEMA = "SCHEMA", t.SCALAR = "SCALAR", t.OBJECT = "OBJECT", t.FIELD_DEFINITION = "FIELD_DEFINITION", t.ARGUMENT_DEFINITION = "ARGUMENT_DEFINITION", t.INTERFACE = "INTERFACE", t.UNION = "UNION", t.ENUM = "ENUM", t.ENUM_VALUE = "ENUM_VALUE", t.INPUT_OBJECT = "INPUT_OBJECT", t.INPUT_FIELD_DEFINITION = "INPUT_FIELD_DEFINITION";
@@ -382,46 +384,46 @@ var c;
382
384
  (function(t) {
383
385
  t.NAME = "Name", t.DOCUMENT = "Document", t.OPERATION_DEFINITION = "OperationDefinition", t.VARIABLE_DEFINITION = "VariableDefinition", t.SELECTION_SET = "SelectionSet", t.FIELD = "Field", t.ARGUMENT = "Argument", t.FRAGMENT_SPREAD = "FragmentSpread", t.INLINE_FRAGMENT = "InlineFragment", t.FRAGMENT_DEFINITION = "FragmentDefinition", t.VARIABLE = "Variable", t.INT = "IntValue", t.FLOAT = "FloatValue", t.STRING = "StringValue", t.BOOLEAN = "BooleanValue", t.NULL = "NullValue", t.ENUM = "EnumValue", t.LIST = "ListValue", t.OBJECT = "ObjectValue", t.OBJECT_FIELD = "ObjectField", t.DIRECTIVE = "Directive", t.NAMED_TYPE = "NamedType", t.LIST_TYPE = "ListType", t.NON_NULL_TYPE = "NonNullType", t.SCHEMA_DEFINITION = "SchemaDefinition", t.OPERATION_TYPE_DEFINITION = "OperationTypeDefinition", t.SCALAR_TYPE_DEFINITION = "ScalarTypeDefinition", t.OBJECT_TYPE_DEFINITION = "ObjectTypeDefinition", t.FIELD_DEFINITION = "FieldDefinition", t.INPUT_VALUE_DEFINITION = "InputValueDefinition", t.INTERFACE_TYPE_DEFINITION = "InterfaceTypeDefinition", t.UNION_TYPE_DEFINITION = "UnionTypeDefinition", t.ENUM_TYPE_DEFINITION = "EnumTypeDefinition", t.ENUM_VALUE_DEFINITION = "EnumValueDefinition", t.INPUT_OBJECT_TYPE_DEFINITION = "InputObjectTypeDefinition", t.DIRECTIVE_DEFINITION = "DirectiveDefinition", t.SCHEMA_EXTENSION = "SchemaExtension", t.SCALAR_TYPE_EXTENSION = "ScalarTypeExtension", t.OBJECT_TYPE_EXTENSION = "ObjectTypeExtension", t.INTERFACE_TYPE_EXTENSION = "InterfaceTypeExtension", t.UNION_TYPE_EXTENSION = "UnionTypeExtension", t.ENUM_TYPE_EXTENSION = "EnumTypeExtension", t.INPUT_OBJECT_TYPE_EXTENSION = "InputObjectTypeExtension", t.TYPE_COORDINATE = "TypeCoordinate", t.MEMBER_COORDINATE = "MemberCoordinate", t.ARGUMENT_COORDINATE = "ArgumentCoordinate", t.DIRECTIVE_COORDINATE = "DirectiveCoordinate", t.DIRECTIVE_ARGUMENT_COORDINATE = "DirectiveArgumentCoordinate";
384
386
  })(c || (c = {}));
385
- function Se(t) {
387
+ function Ce(t) {
386
388
  return t === 9 || t === 32;
387
389
  }
388
- function S(t) {
390
+ function x(t) {
389
391
  return t >= 48 && t <= 57;
390
392
  }
391
- function ue(t) {
393
+ function le(t) {
392
394
  return t >= 97 && t <= 122 || // A-Z
393
395
  t >= 65 && t <= 90;
394
396
  }
395
- function le(t) {
396
- return ue(t) || t === 95;
397
- }
398
- function Ce(t) {
399
- return ue(t) || S(t) || t === 95;
397
+ function pe(t) {
398
+ return le(t) || t === 95;
400
399
  }
401
400
  function _e(t) {
402
- var n;
403
- let e = Number.MAX_SAFE_INTEGER, i = null, r = -1;
401
+ return le(t) || x(t) || t === 95;
402
+ }
403
+ function Le(t) {
404
+ var e;
405
+ let n = Number.MAX_SAFE_INTEGER, i = null, r = -1;
404
406
  for (let o = 0; o < t.length; ++o) {
405
407
  var s;
406
- const u = t[o], h = Le(u);
407
- h !== u.length && (i = (s = i) !== null && s !== void 0 ? s : o, r = o, o !== 0 && h < e && (e = h));
408
+ const l = t[o], p = Re(l);
409
+ p !== l.length && (i = (s = i) !== null && s !== void 0 ? s : o, r = o, o !== 0 && p < n && (n = p));
408
410
  }
409
- return t.map((o, u) => u === 0 ? o : o.slice(e)).slice(
410
- (n = i) !== null && n !== void 0 ? n : 0,
411
+ return t.map((o, l) => l === 0 ? o : o.slice(n)).slice(
412
+ (e = i) !== null && e !== void 0 ? e : 0,
411
413
  r + 1
412
414
  );
413
415
  }
414
- function Le(t) {
415
- let n = 0;
416
- for (; n < t.length && Se(t.charCodeAt(n)); )
417
- ++n;
418
- return n;
416
+ function Re(t) {
417
+ let e = 0;
418
+ for (; e < t.length && Ce(t.charCodeAt(e)); )
419
+ ++e;
420
+ return e;
419
421
  }
420
422
  var a;
421
423
  (function(t) {
422
424
  t.SOF = "<SOF>", t.EOF = "<EOF>", t.BANG = "!", t.DOLLAR = "$", t.AMP = "&", t.PAREN_L = "(", t.PAREN_R = ")", t.DOT = ".", t.SPREAD = "...", t.COLON = ":", t.EQUALS = "=", t.AT = "@", t.BRACKET_L = "[", t.BRACKET_R = "]", t.BRACE_L = "{", t.PIPE = "|", t.BRACE_R = "}", t.NAME = "Name", t.INT = "Int", t.FLOAT = "Float", t.STRING = "String", t.BLOCK_STRING = "BlockString", t.COMMENT = "Comment";
423
425
  })(a || (a = {}));
424
- class Re {
426
+ class Fe {
425
427
  /**
426
428
  * The previously focused non-ignored token.
427
429
  */
@@ -434,9 +436,9 @@ class Re {
434
436
  /**
435
437
  * The character offset at which the current line begins.
436
438
  */
437
- constructor(n) {
438
- const e = new de(a.SOF, 0, 0, 0, 0);
439
- this.source = n, this.lastToken = e, this.token = e, this.line = 1, this.lineStart = 0;
439
+ constructor(e) {
440
+ const n = new ue(a.SOF, 0, 0, 0, 0);
441
+ this.source = e, this.lastToken = n, this.token = n, this.line = 1, this.lineStart = 0;
440
442
  }
441
443
  get [Symbol.toStringTag]() {
442
444
  return "Lexer";
@@ -452,53 +454,53 @@ class Re {
452
454
  * the state of Lexer.
453
455
  */
454
456
  lookahead() {
455
- let n = this.token;
456
- if (n.kind !== a.EOF)
457
+ let e = this.token;
458
+ if (e.kind !== a.EOF)
457
459
  do
458
- if (n.next)
459
- n = n.next;
460
+ if (e.next)
461
+ e = e.next;
460
462
  else {
461
- const e = Fe(this, n.end);
462
- n.next = e, e.prev = n, n = e;
463
+ const n = $e(this, e.end);
464
+ e.next = n, n.prev = e, e = n;
463
465
  }
464
- while (n.kind === a.COMMENT);
465
- return n;
466
+ while (e.kind === a.COMMENT);
467
+ return e;
466
468
  }
467
469
  }
468
470
  function we(t) {
469
471
  return t === a.BANG || t === a.DOLLAR || t === a.AMP || t === a.PAREN_L || t === a.PAREN_R || t === a.DOT || t === a.SPREAD || t === a.COLON || t === a.EQUALS || t === a.AT || t === a.BRACKET_L || t === a.BRACKET_R || t === a.BRACE_L || t === a.PIPE || t === a.BRACE_R;
470
472
  }
471
- function P(t) {
473
+ function b(t) {
472
474
  return t >= 0 && t <= 55295 || t >= 57344 && t <= 1114111;
473
475
  }
474
- function B(t, n) {
475
- return he(t.charCodeAt(n)) && pe(t.charCodeAt(n + 1));
476
+ function B(t, e) {
477
+ return he(t.charCodeAt(e)) && ge(t.charCodeAt(e + 1));
476
478
  }
477
479
  function he(t) {
478
480
  return t >= 55296 && t <= 56319;
479
481
  }
480
- function pe(t) {
482
+ function ge(t) {
481
483
  return t >= 56320 && t <= 57343;
482
484
  }
483
- function N(t, n) {
484
- const e = t.source.body.codePointAt(n);
485
- if (e === void 0)
485
+ function D(t, e) {
486
+ const n = t.source.body.codePointAt(e);
487
+ if (n === void 0)
486
488
  return a.EOF;
487
- if (e >= 32 && e <= 126) {
488
- const i = String.fromCodePoint(e);
489
+ if (n >= 32 && n <= 126) {
490
+ const i = String.fromCodePoint(n);
489
491
  return i === '"' ? `'"'` : `"${i}"`;
490
492
  }
491
- return "U+" + e.toString(16).toUpperCase().padStart(4, "0");
493
+ return "U+" + n.toString(16).toUpperCase().padStart(4, "0");
492
494
  }
493
- function g(t, n, e, i, r) {
494
- const s = t.line, o = 1 + e - t.lineStart;
495
- return new de(n, e, i, s, o, r);
495
+ function f(t, e, n, i, r) {
496
+ const s = t.line, o = 1 + n - t.lineStart;
497
+ return new ue(e, n, i, s, o, r);
496
498
  }
497
- function Fe(t, n) {
498
- const e = t.source.body, i = e.length;
499
- let r = n;
499
+ function $e(t, e) {
500
+ const n = t.source.body, i = n.length;
501
+ let r = e;
500
502
  for (; r < i; ) {
501
- const s = e.charCodeAt(r);
503
+ const s = n.charCodeAt(r);
502
504
  switch (s) {
503
505
  // Ignored ::
504
506
  // - UnicodeBOM
@@ -531,11 +533,11 @@ function Fe(t, n) {
531
533
  ++r, ++t.line, t.lineStart = r;
532
534
  continue;
533
535
  case 13:
534
- e.charCodeAt(r + 1) === 10 ? r += 2 : ++r, ++t.line, t.lineStart = r;
536
+ n.charCodeAt(r + 1) === 10 ? r += 2 : ++r, ++t.line, t.lineStart = r;
535
537
  continue;
536
538
  // Comment
537
539
  case 35:
538
- return $e(t, r);
540
+ return Be(t, r);
539
541
  // Token ::
540
542
  // - Punctuator
541
543
  // - Name
@@ -545,145 +547,145 @@ function Fe(t, n) {
545
547
  //
546
548
  // Punctuator :: one of ! $ & ( ) ... : = @ [ ] { | }
547
549
  case 33:
548
- return g(t, a.BANG, r, r + 1);
550
+ return f(t, a.BANG, r, r + 1);
549
551
  case 36:
550
- return g(t, a.DOLLAR, r, r + 1);
552
+ return f(t, a.DOLLAR, r, r + 1);
551
553
  case 38:
552
- return g(t, a.AMP, r, r + 1);
554
+ return f(t, a.AMP, r, r + 1);
553
555
  case 40:
554
- return g(t, a.PAREN_L, r, r + 1);
556
+ return f(t, a.PAREN_L, r, r + 1);
555
557
  case 41:
556
- return g(t, a.PAREN_R, r, r + 1);
558
+ return f(t, a.PAREN_R, r, r + 1);
557
559
  case 46:
558
- if (e.charCodeAt(r + 1) === 46 && e.charCodeAt(r + 2) === 46)
559
- return g(t, a.SPREAD, r, r + 3);
560
+ if (n.charCodeAt(r + 1) === 46 && n.charCodeAt(r + 2) === 46)
561
+ return f(t, a.SPREAD, r, r + 3);
560
562
  break;
561
563
  case 58:
562
- return g(t, a.COLON, r, r + 1);
564
+ return f(t, a.COLON, r, r + 1);
563
565
  case 61:
564
- return g(t, a.EQUALS, r, r + 1);
566
+ return f(t, a.EQUALS, r, r + 1);
565
567
  case 64:
566
- return g(t, a.AT, r, r + 1);
568
+ return f(t, a.AT, r, r + 1);
567
569
  case 91:
568
- return g(t, a.BRACKET_L, r, r + 1);
570
+ return f(t, a.BRACKET_L, r, r + 1);
569
571
  case 93:
570
- return g(t, a.BRACKET_R, r, r + 1);
572
+ return f(t, a.BRACKET_R, r, r + 1);
571
573
  case 123:
572
- return g(t, a.BRACE_L, r, r + 1);
574
+ return f(t, a.BRACE_L, r, r + 1);
573
575
  case 124:
574
- return g(t, a.PIPE, r, r + 1);
576
+ return f(t, a.PIPE, r, r + 1);
575
577
  case 125:
576
- return g(t, a.BRACE_R, r, r + 1);
578
+ return f(t, a.BRACE_R, r, r + 1);
577
579
  // StringValue
578
580
  case 34:
579
- return e.charCodeAt(r + 1) === 34 && e.charCodeAt(r + 2) === 34 ? qe(t, r) : Ve(t, r);
581
+ return n.charCodeAt(r + 1) === 34 && n.charCodeAt(r + 2) === 34 ? Ge(t, r) : Ue(t, r);
580
582
  }
581
- if (S(s) || s === 45)
582
- return Be(t, r, s);
583
- if (le(s))
584
- return Ge(t, r);
583
+ if (x(s) || s === 45)
584
+ return Ve(t, r, s);
585
+ if (pe(s))
586
+ return je(t, r);
585
587
  throw I(
586
588
  t.source,
587
589
  r,
588
- s === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : P(s) || B(e, r) ? `Unexpected character: ${N(t, r)}.` : `Invalid character: ${N(t, r)}.`
590
+ s === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : b(s) || B(n, r) ? `Unexpected character: ${D(t, r)}.` : `Invalid character: ${D(t, r)}.`
589
591
  );
590
592
  }
591
- return g(t, a.EOF, i, i);
593
+ return f(t, a.EOF, i, i);
592
594
  }
593
- function $e(t, n) {
594
- const e = t.source.body, i = e.length;
595
- let r = n + 1;
595
+ function Be(t, e) {
596
+ const n = t.source.body, i = n.length;
597
+ let r = e + 1;
596
598
  for (; r < i; ) {
597
- const s = e.charCodeAt(r);
599
+ const s = n.charCodeAt(r);
598
600
  if (s === 10 || s === 13)
599
601
  break;
600
- if (P(s))
602
+ if (b(s))
601
603
  ++r;
602
- else if (B(e, r))
604
+ else if (B(n, r))
603
605
  r += 2;
604
606
  else
605
607
  break;
606
608
  }
607
- return g(
609
+ return f(
608
610
  t,
609
611
  a.COMMENT,
610
- n,
612
+ e,
611
613
  r,
612
- e.slice(n + 1, r)
614
+ n.slice(e + 1, r)
613
615
  );
614
616
  }
615
- function Be(t, n, e) {
617
+ function Ve(t, e, n) {
616
618
  const i = t.source.body;
617
- let r = n, s = e, o = !1;
619
+ let r = e, s = n, o = !1;
618
620
  if (s === 45 && (s = i.charCodeAt(++r)), s === 48) {
619
- if (s = i.charCodeAt(++r), S(s))
621
+ if (s = i.charCodeAt(++r), x(s))
620
622
  throw I(
621
623
  t.source,
622
624
  r,
623
- `Invalid number, unexpected digit after 0: ${N(
625
+ `Invalid number, unexpected digit after 0: ${D(
624
626
  t,
625
627
  r
626
628
  )}.`
627
629
  );
628
630
  } else
629
631
  r = M(t, r, s), s = i.charCodeAt(r);
630
- if (s === 46 && (o = !0, s = i.charCodeAt(++r), r = M(t, r, s), s = i.charCodeAt(r)), (s === 69 || s === 101) && (o = !0, s = i.charCodeAt(++r), (s === 43 || s === 45) && (s = i.charCodeAt(++r)), r = M(t, r, s), s = i.charCodeAt(r)), s === 46 || le(s))
632
+ if (s === 46 && (o = !0, s = i.charCodeAt(++r), r = M(t, r, s), s = i.charCodeAt(r)), (s === 69 || s === 101) && (o = !0, s = i.charCodeAt(++r), (s === 43 || s === 45) && (s = i.charCodeAt(++r)), r = M(t, r, s), s = i.charCodeAt(r)), s === 46 || pe(s))
631
633
  throw I(
632
634
  t.source,
633
635
  r,
634
- `Invalid number, expected digit but got: ${N(
636
+ `Invalid number, expected digit but got: ${D(
635
637
  t,
636
638
  r
637
639
  )}.`
638
640
  );
639
- return g(
641
+ return f(
640
642
  t,
641
643
  o ? a.FLOAT : a.INT,
642
- n,
644
+ e,
643
645
  r,
644
- i.slice(n, r)
646
+ i.slice(e, r)
645
647
  );
646
648
  }
647
- function M(t, n, e) {
648
- if (!S(e))
649
+ function M(t, e, n) {
650
+ if (!x(n))
649
651
  throw I(
650
652
  t.source,
651
- n,
652
- `Invalid number, expected digit but got: ${N(
653
+ e,
654
+ `Invalid number, expected digit but got: ${D(
653
655
  t,
654
- n
656
+ e
655
657
  )}.`
656
658
  );
657
659
  const i = t.source.body;
658
- let r = n + 1;
659
- for (; S(i.charCodeAt(r)); )
660
+ let r = e + 1;
661
+ for (; x(i.charCodeAt(r)); )
660
662
  ++r;
661
663
  return r;
662
664
  }
663
- function Ve(t, n) {
664
- const e = t.source.body, i = e.length;
665
- let r = n + 1, s = r, o = "";
665
+ function Ue(t, e) {
666
+ const n = t.source.body, i = n.length;
667
+ let r = e + 1, s = r, o = "";
666
668
  for (; r < i; ) {
667
- const u = e.charCodeAt(r);
668
- if (u === 34)
669
- return o += e.slice(s, r), g(t, a.STRING, n, r + 1, o);
670
- if (u === 92) {
671
- o += e.slice(s, r);
672
- const h = e.charCodeAt(r + 1) === 117 ? e.charCodeAt(r + 2) === 123 ? Ue(t, r) : Me(t, r) : ze(t, r);
673
- o += h.value, r += h.size, s = r;
669
+ const l = n.charCodeAt(r);
670
+ if (l === 34)
671
+ return o += n.slice(s, r), f(t, a.STRING, e, r + 1, o);
672
+ if (l === 92) {
673
+ o += n.slice(s, r);
674
+ const p = n.charCodeAt(r + 1) === 117 ? n.charCodeAt(r + 2) === 123 ? Me(t, r) : ze(t, r) : qe(t, r);
675
+ o += p.value, r += p.size, s = r;
674
676
  continue;
675
677
  }
676
- if (u === 10 || u === 13)
678
+ if (l === 10 || l === 13)
677
679
  break;
678
- if (P(u))
680
+ if (b(l))
679
681
  ++r;
680
- else if (B(e, r))
682
+ else if (B(n, r))
681
683
  r += 2;
682
684
  else
683
685
  throw I(
684
686
  t.source,
685
687
  r,
686
- `Invalid character within String: ${N(
688
+ `Invalid character within String: ${D(
687
689
  t,
688
690
  r
689
691
  )}.`
@@ -691,41 +693,41 @@ function Ve(t, n) {
691
693
  }
692
694
  throw I(t.source, r, "Unterminated string.");
693
695
  }
694
- function Ue(t, n) {
695
- const e = t.source.body;
696
+ function Me(t, e) {
697
+ const n = t.source.body;
696
698
  let i = 0, r = 3;
697
699
  for (; r < 12; ) {
698
- const s = e.charCodeAt(n + r++);
700
+ const s = n.charCodeAt(e + r++);
699
701
  if (s === 125) {
700
- if (r < 5 || !P(i))
702
+ if (r < 5 || !b(i))
701
703
  break;
702
704
  return {
703
705
  value: String.fromCodePoint(i),
704
706
  size: r
705
707
  };
706
708
  }
707
- if (i = i << 4 | b(s), i < 0)
709
+ if (i = i << 4 | S(s), i < 0)
708
710
  break;
709
711
  }
710
712
  throw I(
711
713
  t.source,
712
- n,
713
- `Invalid Unicode escape sequence: "${e.slice(
714
- n,
715
- n + r
714
+ e,
715
+ `Invalid Unicode escape sequence: "${n.slice(
716
+ e,
717
+ e + r
716
718
  )}".`
717
719
  );
718
720
  }
719
- function Me(t, n) {
720
- const e = t.source.body, i = W(e, n + 2);
721
- if (P(i))
721
+ function ze(t, e) {
722
+ const n = t.source.body, i = W(n, e + 2);
723
+ if (b(i))
722
724
  return {
723
725
  value: String.fromCodePoint(i),
724
726
  size: 6
725
727
  };
726
- if (he(i) && e.charCodeAt(n + 6) === 92 && e.charCodeAt(n + 7) === 117) {
727
- const r = W(e, n + 8);
728
- if (pe(r))
728
+ if (he(i) && n.charCodeAt(e + 6) === 92 && n.charCodeAt(e + 7) === 117) {
729
+ const r = W(n, e + 8);
730
+ if (ge(r))
729
731
  return {
730
732
  value: String.fromCodePoint(i, r),
731
733
  size: 12
@@ -733,19 +735,19 @@ function Me(t, n) {
733
735
  }
734
736
  throw I(
735
737
  t.source,
736
- n,
737
- `Invalid Unicode escape sequence: "${e.slice(n, n + 6)}".`
738
+ e,
739
+ `Invalid Unicode escape sequence: "${n.slice(e, e + 6)}".`
738
740
  );
739
741
  }
740
- function W(t, n) {
741
- return b(t.charCodeAt(n)) << 12 | b(t.charCodeAt(n + 1)) << 8 | b(t.charCodeAt(n + 2)) << 4 | b(t.charCodeAt(n + 3));
742
+ function W(t, e) {
743
+ return S(t.charCodeAt(e)) << 12 | S(t.charCodeAt(e + 1)) << 8 | S(t.charCodeAt(e + 2)) << 4 | S(t.charCodeAt(e + 3));
742
744
  }
743
- function b(t) {
745
+ function S(t) {
744
746
  return t >= 48 && t <= 57 ? t - 48 : t >= 65 && t <= 70 ? t - 55 : t >= 97 && t <= 102 ? t - 87 : -1;
745
747
  }
746
- function ze(t, n) {
747
- const e = t.source.body;
748
- switch (e.charCodeAt(n + 1)) {
748
+ function qe(t, e) {
749
+ const n = t.source.body;
750
+ switch (n.charCodeAt(e + 1)) {
749
751
  case 34:
750
752
  return {
751
753
  value: '"',
@@ -790,49 +792,49 @@ function ze(t, n) {
790
792
  }
791
793
  throw I(
792
794
  t.source,
793
- n,
794
- `Invalid character escape sequence: "${e.slice(
795
- n,
796
- n + 2
795
+ e,
796
+ `Invalid character escape sequence: "${n.slice(
797
+ e,
798
+ e + 2
797
799
  )}".`
798
800
  );
799
801
  }
800
- function qe(t, n) {
801
- const e = t.source.body, i = e.length;
802
- let r = t.lineStart, s = n + 3, o = s, u = "";
803
- const h = [];
802
+ function Ge(t, e) {
803
+ const n = t.source.body, i = n.length;
804
+ let r = t.lineStart, s = e + 3, o = s, l = "";
805
+ const p = [];
804
806
  for (; s < i; ) {
805
- const E = e.charCodeAt(s);
806
- if (E === 34 && e.charCodeAt(s + 1) === 34 && e.charCodeAt(s + 2) === 34) {
807
- u += e.slice(o, s), h.push(u);
808
- const m = g(
807
+ const E = n.charCodeAt(s);
808
+ if (E === 34 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34) {
809
+ l += n.slice(o, s), p.push(l);
810
+ const g = f(
809
811
  t,
810
812
  a.BLOCK_STRING,
811
- n,
813
+ e,
812
814
  s + 3,
813
815
  // Return a string of the lines joined with U+000A.
814
- _e(h).join(`
816
+ Le(p).join(`
815
817
  `)
816
818
  );
817
- return t.line += h.length - 1, t.lineStart = r, m;
819
+ return t.line += p.length - 1, t.lineStart = r, g;
818
820
  }
819
- if (E === 92 && e.charCodeAt(s + 1) === 34 && e.charCodeAt(s + 2) === 34 && e.charCodeAt(s + 3) === 34) {
820
- u += e.slice(o, s), o = s + 1, s += 4;
821
+ if (E === 92 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34 && n.charCodeAt(s + 3) === 34) {
822
+ l += n.slice(o, s), o = s + 1, s += 4;
821
823
  continue;
822
824
  }
823
825
  if (E === 10 || E === 13) {
824
- u += e.slice(o, s), h.push(u), E === 13 && e.charCodeAt(s + 1) === 10 ? s += 2 : ++s, u = "", o = s, r = s;
826
+ l += n.slice(o, s), p.push(l), E === 13 && n.charCodeAt(s + 1) === 10 ? s += 2 : ++s, l = "", o = s, r = s;
825
827
  continue;
826
828
  }
827
- if (P(E))
829
+ if (b(E))
828
830
  ++s;
829
- else if (B(e, s))
831
+ else if (B(n, s))
830
832
  s += 2;
831
833
  else
832
834
  throw I(
833
835
  t.source,
834
836
  s,
835
- `Invalid character within String: ${N(
837
+ `Invalid character within String: ${D(
836
838
  t,
837
839
  s
838
840
  )}.`
@@ -840,99 +842,99 @@ function qe(t, n) {
840
842
  }
841
843
  throw I(t.source, s, "Unterminated string.");
842
844
  }
843
- function Ge(t, n) {
844
- const e = t.source.body, i = e.length;
845
- let r = n + 1;
845
+ function je(t, e) {
846
+ const n = t.source.body, i = n.length;
847
+ let r = e + 1;
846
848
  for (; r < i; ) {
847
- const s = e.charCodeAt(r);
848
- if (Ce(s))
849
+ const s = n.charCodeAt(r);
850
+ if (_e(s))
849
851
  ++r;
850
852
  else
851
853
  break;
852
854
  }
853
- return g(
855
+ return f(
854
856
  t,
855
857
  a.NAME,
856
- n,
858
+ e,
857
859
  r,
858
- e.slice(n, r)
860
+ n.slice(e, r)
859
861
  );
860
862
  }
861
- const je = 10, me = 2;
863
+ const Ye = 10, me = 2;
862
864
  function fe(t) {
863
865
  return V(t, []);
864
866
  }
865
- function V(t, n) {
867
+ function V(t, e) {
866
868
  switch (typeof t) {
867
869
  case "string":
868
870
  return JSON.stringify(t);
869
871
  case "function":
870
872
  return t.name ? `[function ${t.name}]` : "[function]";
871
873
  case "object":
872
- return Ye(t, n);
874
+ return He(t, e);
873
875
  default:
874
876
  return String(t);
875
877
  }
876
878
  }
877
- function Ye(t, n) {
879
+ function He(t, e) {
878
880
  if (t === null)
879
881
  return "null";
880
- if (n.includes(t))
882
+ if (e.includes(t))
881
883
  return "[Circular]";
882
- const e = [...n, t];
883
- if (He(t)) {
884
+ const n = [...e, t];
885
+ if (Je(t)) {
884
886
  const i = t.toJSON();
885
887
  if (i !== t)
886
- return typeof i == "string" ? i : V(i, e);
888
+ return typeof i == "string" ? i : V(i, n);
887
889
  } else if (Array.isArray(t))
888
- return Qe(t, e);
889
- return Je(t, e);
890
+ return Xe(t, n);
891
+ return Qe(t, n);
890
892
  }
891
- function He(t) {
893
+ function Je(t) {
892
894
  return typeof t.toJSON == "function";
893
895
  }
894
- function Je(t, n) {
895
- const e = Object.entries(t);
896
- return e.length === 0 ? "{}" : n.length > me ? "[" + Xe(t) + "]" : "{ " + e.map(
897
- ([r, s]) => r + ": " + V(s, n)
896
+ function Qe(t, e) {
897
+ const n = Object.entries(t);
898
+ return n.length === 0 ? "{}" : e.length > me ? "[" + We(t) + "]" : "{ " + n.map(
899
+ ([r, s]) => r + ": " + V(s, e)
898
900
  ).join(", ") + " }";
899
901
  }
900
- function Qe(t, n) {
902
+ function Xe(t, e) {
901
903
  if (t.length === 0)
902
904
  return "[]";
903
- if (n.length > me)
905
+ if (e.length > me)
904
906
  return "[Array]";
905
- const e = Math.min(je, t.length), i = t.length - e, r = [];
906
- for (let s = 0; s < e; ++s)
907
- r.push(V(t[s], n));
907
+ const n = Math.min(Ye, t.length), i = t.length - n, r = [];
908
+ for (let s = 0; s < n; ++s)
909
+ r.push(V(t[s], e));
908
910
  return i === 1 ? r.push("... 1 more item") : i > 1 && r.push(`... ${i} more items`), "[" + r.join(", ") + "]";
909
911
  }
910
- function Xe(t) {
911
- const n = Object.prototype.toString.call(t).replace(/^\[object /, "").replace(/]$/, "");
912
- if (n === "Object" && typeof t.constructor == "function") {
913
- const e = t.constructor.name;
914
- if (typeof e == "string" && e !== "")
915
- return e;
912
+ function We(t) {
913
+ const e = Object.prototype.toString.call(t).replace(/^\[object /, "").replace(/]$/, "");
914
+ if (e === "Object" && typeof t.constructor == "function") {
915
+ const n = t.constructor.name;
916
+ if (typeof n == "string" && n !== "")
917
+ return n;
916
918
  }
917
- return n;
919
+ return e;
918
920
  }
919
- const We = globalThis.process && // eslint-disable-next-line no-undef
920
- process.env.NODE_ENV === "production", Ze = (
921
+ const Ze = globalThis.process && // eslint-disable-next-line no-undef
922
+ process.env.NODE_ENV === "production", Ke = (
921
923
  /* c8 ignore next 6 */
922
924
  // FIXME: https://github.com/graphql/graphql-js/issues/2317
923
- We ? function(n, e) {
924
- return n instanceof e;
925
- } : function(n, e) {
926
- if (n instanceof e)
925
+ Ze ? function(e, n) {
926
+ return e instanceof n;
927
+ } : function(e, n) {
928
+ if (e instanceof n)
927
929
  return !0;
928
- if (typeof n == "object" && n !== null) {
930
+ if (typeof e == "object" && e !== null) {
929
931
  var i;
930
- const r = e.prototype[Symbol.toStringTag], s = (
932
+ const r = n.prototype[Symbol.toStringTag], s = (
931
933
  // We still need to support constructor's name to detect conflicts with older versions of this library.
932
- Symbol.toStringTag in n ? n[Symbol.toStringTag] : (i = n.constructor) === null || i === void 0 ? void 0 : i.name
934
+ Symbol.toStringTag in e ? e[Symbol.toStringTag] : (i = e.constructor) === null || i === void 0 ? void 0 : i.name
933
935
  );
934
936
  if (r === s) {
935
- const o = fe(n);
937
+ const o = fe(e);
936
938
  throw new Error(`Cannot use ${r} "${o}" from another module or realm.
937
939
 
938
940
  Ensure that there is only one instance of "graphql" in the node_modules
@@ -950,12 +952,12 @@ spurious results.`);
950
952
  return !1;
951
953
  }
952
954
  );
953
- class ge {
954
- constructor(n, e = "GraphQL request", i = {
955
+ class Ie {
956
+ constructor(e, n = "GraphQL request", i = {
955
957
  line: 1,
956
958
  column: 1
957
959
  }) {
958
- typeof n == "string" || U(!1, `Body must be a string. Received: ${fe(n)}.`), this.body = n, this.name = e, this.locationOffset = i, this.locationOffset.line > 0 || U(
960
+ typeof e == "string" || U(!1, `Body must be a string. Received: ${fe(e)}.`), this.body = e, this.name = n, this.locationOffset = i, this.locationOffset.line > 0 || U(
959
961
  !1,
960
962
  "line in locationOffset is 1-indexed and must be positive."
961
963
  ), this.locationOffset.column > 0 || U(
@@ -967,24 +969,24 @@ class ge {
967
969
  return "Source";
968
970
  }
969
971
  }
970
- function Ke(t) {
971
- return Ze(t, ge);
972
+ function et(t) {
973
+ return Ke(t, Ie);
972
974
  }
973
- function et(t, n) {
974
- const e = new tt(t, n), i = e.parseDocument();
975
+ function tt(t, e) {
976
+ const n = new nt(t, e), i = n.parseDocument();
975
977
  return Object.defineProperty(i, "tokenCount", {
976
978
  enumerable: !1,
977
- value: e.tokenCount
979
+ value: n.tokenCount
978
980
  }), i;
979
981
  }
980
- class tt {
981
- constructor(n, e = {}) {
982
- const { lexer: i, ...r } = e;
982
+ class nt {
983
+ constructor(e, n = {}) {
984
+ const { lexer: i, ...r } = n;
983
985
  if (i)
984
986
  this._lexer = i;
985
987
  else {
986
- const s = Ke(n) ? n : new ge(n);
987
- this._lexer = new Re(s);
988
+ const s = et(e) ? e : new Ie(e);
989
+ this._lexer = new Fe(s);
988
990
  }
989
991
  this._options = r, this._tokenCounter = 0;
990
992
  }
@@ -995,10 +997,10 @@ class tt {
995
997
  * Converts a name lex token into a name parse node.
996
998
  */
997
999
  parseName() {
998
- const n = this.expectToken(a.NAME);
999
- return this.node(n, {
1000
+ const e = this.expectToken(a.NAME);
1001
+ return this.node(e, {
1000
1002
  kind: c.NAME,
1001
- value: n.value
1003
+ value: e.value
1002
1004
  });
1003
1005
  }
1004
1006
  // Implements the parsing rules in the Document section.
@@ -1041,15 +1043,15 @@ class tt {
1041
1043
  parseDefinition() {
1042
1044
  if (this.peek(a.BRACE_L))
1043
1045
  return this.parseOperationDefinition();
1044
- const n = this.peekDescription(), e = n ? this._lexer.lookahead() : this._lexer.token;
1045
- if (n && e.kind === a.BRACE_L)
1046
+ const e = this.peekDescription(), n = e ? this._lexer.lookahead() : this._lexer.token;
1047
+ if (e && n.kind === a.BRACE_L)
1046
1048
  throw I(
1047
1049
  this._lexer.source,
1048
1050
  this._lexer.token.start,
1049
1051
  "Unexpected description, descriptions are not supported on shorthand queries."
1050
1052
  );
1051
- if (e.kind === a.NAME) {
1052
- switch (e.value) {
1053
+ if (n.kind === a.NAME) {
1054
+ switch (n.value) {
1053
1055
  case "schema":
1054
1056
  return this.parseSchemaDefinition();
1055
1057
  case "scalar":
@@ -1067,7 +1069,7 @@ class tt {
1067
1069
  case "directive":
1068
1070
  return this.parseDirectiveDefinition();
1069
1071
  }
1070
- switch (e.value) {
1072
+ switch (n.value) {
1071
1073
  case "query":
1072
1074
  case "mutation":
1073
1075
  case "subscription":
@@ -1075,16 +1077,16 @@ class tt {
1075
1077
  case "fragment":
1076
1078
  return this.parseFragmentDefinition();
1077
1079
  }
1078
- if (n)
1080
+ if (e)
1079
1081
  throw I(
1080
1082
  this._lexer.source,
1081
1083
  this._lexer.token.start,
1082
1084
  "Unexpected description, only GraphQL definitions support descriptions."
1083
1085
  );
1084
- if (e.value === "extend")
1086
+ if (n.value === "extend")
1085
1087
  return this.parseTypeSystemExtension();
1086
1088
  }
1087
- throw this.unexpected(e);
1089
+ throw this.unexpected(n);
1088
1090
  }
1089
1091
  // Implements the parsing rules in the Operations section.
1090
1092
  /**
@@ -1093,23 +1095,23 @@ class tt {
1093
1095
  * - OperationType Name? VariableDefinitions? Directives? SelectionSet
1094
1096
  */
1095
1097
  parseOperationDefinition() {
1096
- const n = this._lexer.token;
1098
+ const e = this._lexer.token;
1097
1099
  if (this.peek(a.BRACE_L))
1098
- return this.node(n, {
1100
+ return this.node(e, {
1099
1101
  kind: c.OPERATION_DEFINITION,
1100
- operation: D.QUERY,
1102
+ operation: v.QUERY,
1101
1103
  description: void 0,
1102
1104
  name: void 0,
1103
1105
  variableDefinitions: [],
1104
1106
  directives: [],
1105
1107
  selectionSet: this.parseSelectionSet()
1106
1108
  });
1107
- const e = this.parseDescription(), i = this.parseOperationType();
1109
+ const n = this.parseDescription(), i = this.parseOperationType();
1108
1110
  let r;
1109
- return this.peek(a.NAME) && (r = this.parseName()), this.node(n, {
1111
+ return this.peek(a.NAME) && (r = this.parseName()), this.node(e, {
1110
1112
  kind: c.OPERATION_DEFINITION,
1111
1113
  operation: i,
1112
- description: e,
1114
+ description: n,
1113
1115
  name: r,
1114
1116
  variableDefinitions: this.parseVariableDefinitions(),
1115
1117
  directives: this.parseDirectives(!1),
@@ -1120,16 +1122,16 @@ class tt {
1120
1122
  * OperationType : one of query mutation subscription
1121
1123
  */
1122
1124
  parseOperationType() {
1123
- const n = this.expectToken(a.NAME);
1124
- switch (n.value) {
1125
+ const e = this.expectToken(a.NAME);
1126
+ switch (e.value) {
1125
1127
  case "query":
1126
- return D.QUERY;
1128
+ return v.QUERY;
1127
1129
  case "mutation":
1128
- return D.MUTATION;
1130
+ return v.MUTATION;
1129
1131
  case "subscription":
1130
- return D.SUBSCRIPTION;
1132
+ return v.SUBSCRIPTION;
1131
1133
  }
1132
- throw this.unexpected(n);
1134
+ throw this.unexpected(e);
1133
1135
  }
1134
1136
  /**
1135
1137
  * VariableDefinitions : ( VariableDefinition+ )
@@ -1158,8 +1160,8 @@ class tt {
1158
1160
  * Variable : $ Name
1159
1161
  */
1160
1162
  parseVariable() {
1161
- const n = this._lexer.token;
1162
- return this.expectToken(a.DOLLAR), this.node(n, {
1163
+ const e = this._lexer.token;
1164
+ return this.expectToken(a.DOLLAR), this.node(e, {
1163
1165
  kind: c.VARIABLE,
1164
1166
  name: this.parseName()
1165
1167
  });
@@ -1194,9 +1196,9 @@ class tt {
1194
1196
  * Alias : Name :
1195
1197
  */
1196
1198
  parseField() {
1197
- const n = this._lexer.token, e = this.parseName();
1199
+ const e = this._lexer.token, n = this.parseName();
1198
1200
  let i, r;
1199
- return this.expectOptionalToken(a.COLON) ? (i = e, r = this.parseName()) : r = e, this.node(n, {
1201
+ return this.expectOptionalToken(a.COLON) ? (i = n, r = this.parseName()) : r = n, this.node(e, {
1200
1202
  kind: c.FIELD,
1201
1203
  alias: i,
1202
1204
  name: r,
@@ -1208,19 +1210,19 @@ class tt {
1208
1210
  /**
1209
1211
  * Arguments[Const] : ( Argument[?Const]+ )
1210
1212
  */
1211
- parseArguments(n) {
1212
- const e = n ? this.parseConstArgument : this.parseArgument;
1213
- return this.optionalMany(a.PAREN_L, e, a.PAREN_R);
1213
+ parseArguments(e) {
1214
+ const n = e ? this.parseConstArgument : this.parseArgument;
1215
+ return this.optionalMany(a.PAREN_L, n, a.PAREN_R);
1214
1216
  }
1215
1217
  /**
1216
1218
  * Argument[Const] : Name : Value[?Const]
1217
1219
  */
1218
- parseArgument(n = !1) {
1219
- const e = this._lexer.token, i = this.parseName();
1220
- return this.expectToken(a.COLON), this.node(e, {
1220
+ parseArgument(e = !1) {
1221
+ const n = this._lexer.token, i = this.parseName();
1222
+ return this.expectToken(a.COLON), this.node(n, {
1221
1223
  kind: c.ARGUMENT,
1222
1224
  name: i,
1223
- value: this.parseValueLiteral(n)
1225
+ value: this.parseValueLiteral(e)
1224
1226
  });
1225
1227
  }
1226
1228
  parseConstArgument() {
@@ -1235,16 +1237,16 @@ class tt {
1235
1237
  * InlineFragment : ... TypeCondition? Directives? SelectionSet
1236
1238
  */
1237
1239
  parseFragment() {
1238
- const n = this._lexer.token;
1240
+ const e = this._lexer.token;
1239
1241
  this.expectToken(a.SPREAD);
1240
- const e = this.expectOptionalKeyword("on");
1241
- return !e && this.peek(a.NAME) ? this.node(n, {
1242
+ const n = this.expectOptionalKeyword("on");
1243
+ return !n && this.peek(a.NAME) ? this.node(e, {
1242
1244
  kind: c.FRAGMENT_SPREAD,
1243
1245
  name: this.parseFragmentName(),
1244
1246
  directives: this.parseDirectives(!1)
1245
- }) : this.node(n, {
1247
+ }) : this.node(e, {
1246
1248
  kind: c.INLINE_FRAGMENT,
1247
- typeCondition: e ? this.parseNamedType() : void 0,
1249
+ typeCondition: n ? this.parseNamedType() : void 0,
1248
1250
  directives: this.parseDirectives(!1),
1249
1251
  selectionSet: this.parseSelectionSet()
1250
1252
  });
@@ -1256,18 +1258,18 @@ class tt {
1256
1258
  * TypeCondition : NamedType
1257
1259
  */
1258
1260
  parseFragmentDefinition() {
1259
- const n = this._lexer.token, e = this.parseDescription();
1260
- return this.expectKeyword("fragment"), this._options.allowLegacyFragmentVariables === !0 ? this.node(n, {
1261
+ const e = this._lexer.token, n = this.parseDescription();
1262
+ return this.expectKeyword("fragment"), this._options.allowLegacyFragmentVariables === !0 ? this.node(e, {
1261
1263
  kind: c.FRAGMENT_DEFINITION,
1262
- description: e,
1264
+ description: n,
1263
1265
  name: this.parseFragmentName(),
1264
1266
  variableDefinitions: this.parseVariableDefinitions(),
1265
1267
  typeCondition: (this.expectKeyword("on"), this.parseNamedType()),
1266
1268
  directives: this.parseDirectives(!1),
1267
1269
  selectionSet: this.parseSelectionSet()
1268
- }) : this.node(n, {
1270
+ }) : this.node(e, {
1269
1271
  kind: c.FRAGMENT_DEFINITION,
1270
- description: e,
1272
+ description: n,
1271
1273
  name: this.parseFragmentName(),
1272
1274
  typeCondition: (this.expectKeyword("on"), this.parseNamedType()),
1273
1275
  directives: this.parseDirectives(!1),
@@ -1301,59 +1303,59 @@ class tt {
1301
1303
  *
1302
1304
  * EnumValue : Name but not `true`, `false` or `null`
1303
1305
  */
1304
- parseValueLiteral(n) {
1305
- const e = this._lexer.token;
1306
- switch (e.kind) {
1306
+ parseValueLiteral(e) {
1307
+ const n = this._lexer.token;
1308
+ switch (n.kind) {
1307
1309
  case a.BRACKET_L:
1308
- return this.parseList(n);
1310
+ return this.parseList(e);
1309
1311
  case a.BRACE_L:
1310
- return this.parseObject(n);
1312
+ return this.parseObject(e);
1311
1313
  case a.INT:
1312
- return this.advanceLexer(), this.node(e, {
1314
+ return this.advanceLexer(), this.node(n, {
1313
1315
  kind: c.INT,
1314
- value: e.value
1316
+ value: n.value
1315
1317
  });
1316
1318
  case a.FLOAT:
1317
- return this.advanceLexer(), this.node(e, {
1319
+ return this.advanceLexer(), this.node(n, {
1318
1320
  kind: c.FLOAT,
1319
- value: e.value
1321
+ value: n.value
1320
1322
  });
1321
1323
  case a.STRING:
1322
1324
  case a.BLOCK_STRING:
1323
1325
  return this.parseStringLiteral();
1324
1326
  case a.NAME:
1325
- switch (this.advanceLexer(), e.value) {
1327
+ switch (this.advanceLexer(), n.value) {
1326
1328
  case "true":
1327
- return this.node(e, {
1329
+ return this.node(n, {
1328
1330
  kind: c.BOOLEAN,
1329
1331
  value: !0
1330
1332
  });
1331
1333
  case "false":
1332
- return this.node(e, {
1334
+ return this.node(n, {
1333
1335
  kind: c.BOOLEAN,
1334
1336
  value: !1
1335
1337
  });
1336
1338
  case "null":
1337
- return this.node(e, {
1339
+ return this.node(n, {
1338
1340
  kind: c.NULL
1339
1341
  });
1340
1342
  default:
1341
- return this.node(e, {
1343
+ return this.node(n, {
1342
1344
  kind: c.ENUM,
1343
- value: e.value
1345
+ value: n.value
1344
1346
  });
1345
1347
  }
1346
1348
  case a.DOLLAR:
1347
- if (n)
1349
+ if (e)
1348
1350
  if (this.expectToken(a.DOLLAR), this._lexer.token.kind === a.NAME) {
1349
1351
  const i = this._lexer.token.value;
1350
1352
  throw I(
1351
1353
  this._lexer.source,
1352
- e.start,
1354
+ n.start,
1353
1355
  `Unexpected variable "$${i}" in constant value.`
1354
1356
  );
1355
1357
  } else
1356
- throw this.unexpected(e);
1358
+ throw this.unexpected(n);
1357
1359
  return this.parseVariable();
1358
1360
  default:
1359
1361
  throw this.unexpected();
@@ -1363,11 +1365,11 @@ class tt {
1363
1365
  return this.parseValueLiteral(!0);
1364
1366
  }
1365
1367
  parseStringLiteral() {
1366
- const n = this._lexer.token;
1367
- return this.advanceLexer(), this.node(n, {
1368
+ const e = this._lexer.token;
1369
+ return this.advanceLexer(), this.node(e, {
1368
1370
  kind: c.STRING,
1369
- value: n.value,
1370
- block: n.kind === a.BLOCK_STRING
1371
+ value: e.value,
1372
+ block: e.kind === a.BLOCK_STRING
1371
1373
  });
1372
1374
  }
1373
1375
  /**
@@ -1375,11 +1377,11 @@ class tt {
1375
1377
  * - [ ]
1376
1378
  * - [ Value[?Const]+ ]
1377
1379
  */
1378
- parseList(n) {
1379
- const e = () => this.parseValueLiteral(n);
1380
+ parseList(e) {
1381
+ const n = () => this.parseValueLiteral(e);
1380
1382
  return this.node(this._lexer.token, {
1381
1383
  kind: c.LIST,
1382
- values: this.any(a.BRACKET_L, e, a.BRACKET_R)
1384
+ values: this.any(a.BRACKET_L, n, a.BRACKET_R)
1383
1385
  });
1384
1386
  }
1385
1387
  /**
@@ -1389,33 +1391,33 @@ class tt {
1389
1391
  * - { ObjectField[?Const]+ }
1390
1392
  * ```
1391
1393
  */
1392
- parseObject(n) {
1393
- const e = () => this.parseObjectField(n);
1394
+ parseObject(e) {
1395
+ const n = () => this.parseObjectField(e);
1394
1396
  return this.node(this._lexer.token, {
1395
1397
  kind: c.OBJECT,
1396
- fields: this.any(a.BRACE_L, e, a.BRACE_R)
1398
+ fields: this.any(a.BRACE_L, n, a.BRACE_R)
1397
1399
  });
1398
1400
  }
1399
1401
  /**
1400
1402
  * ObjectField[Const] : Name : Value[?Const]
1401
1403
  */
1402
- parseObjectField(n) {
1403
- const e = this._lexer.token, i = this.parseName();
1404
- return this.expectToken(a.COLON), this.node(e, {
1404
+ parseObjectField(e) {
1405
+ const n = this._lexer.token, i = this.parseName();
1406
+ return this.expectToken(a.COLON), this.node(n, {
1405
1407
  kind: c.OBJECT_FIELD,
1406
1408
  name: i,
1407
- value: this.parseValueLiteral(n)
1409
+ value: this.parseValueLiteral(e)
1408
1410
  });
1409
1411
  }
1410
1412
  // Implements the parsing rules in the Directives section.
1411
1413
  /**
1412
1414
  * Directives[Const] : Directive[?Const]+
1413
1415
  */
1414
- parseDirectives(n) {
1415
- const e = [];
1416
+ parseDirectives(e) {
1417
+ const n = [];
1416
1418
  for (; this.peek(a.AT); )
1417
- e.push(this.parseDirective(n));
1418
- return e;
1419
+ n.push(this.parseDirective(e));
1420
+ return n;
1419
1421
  }
1420
1422
  parseConstDirectives() {
1421
1423
  return this.parseDirectives(!0);
@@ -1425,12 +1427,12 @@ class tt {
1425
1427
  * Directive[Const] : @ Name Arguments[?Const]?
1426
1428
  * ```
1427
1429
  */
1428
- parseDirective(n) {
1429
- const e = this._lexer.token;
1430
- return this.expectToken(a.AT), this.node(e, {
1430
+ parseDirective(e) {
1431
+ const n = this._lexer.token;
1432
+ return this.expectToken(a.AT), this.node(n, {
1431
1433
  kind: c.DIRECTIVE,
1432
1434
  name: this.parseName(),
1433
- arguments: this.parseArguments(n)
1435
+ arguments: this.parseArguments(e)
1434
1436
  });
1435
1437
  }
1436
1438
  // Implements the parsing rules in the Types section.
@@ -1441,20 +1443,20 @@ class tt {
1441
1443
  * - NonNullType
1442
1444
  */
1443
1445
  parseTypeReference() {
1444
- const n = this._lexer.token;
1445
- let e;
1446
+ const e = this._lexer.token;
1447
+ let n;
1446
1448
  if (this.expectOptionalToken(a.BRACKET_L)) {
1447
1449
  const i = this.parseTypeReference();
1448
- this.expectToken(a.BRACKET_R), e = this.node(n, {
1450
+ this.expectToken(a.BRACKET_R), n = this.node(e, {
1449
1451
  kind: c.LIST_TYPE,
1450
1452
  type: i
1451
1453
  });
1452
1454
  } else
1453
- e = this.parseNamedType();
1454
- return this.expectOptionalToken(a.BANG) ? this.node(n, {
1455
+ n = this.parseNamedType();
1456
+ return this.expectOptionalToken(a.BANG) ? this.node(e, {
1455
1457
  kind: c.NON_NULL_TYPE,
1456
- type: e
1457
- }) : e;
1458
+ type: n
1459
+ }) : n;
1458
1460
  }
1459
1461
  /**
1460
1462
  * NamedType : Name
@@ -1482,16 +1484,16 @@ class tt {
1482
1484
  * ```
1483
1485
  */
1484
1486
  parseSchemaDefinition() {
1485
- const n = this._lexer.token, e = this.parseDescription();
1487
+ const e = this._lexer.token, n = this.parseDescription();
1486
1488
  this.expectKeyword("schema");
1487
1489
  const i = this.parseConstDirectives(), r = this.many(
1488
1490
  a.BRACE_L,
1489
1491
  this.parseOperationTypeDefinition,
1490
1492
  a.BRACE_R
1491
1493
  );
1492
- return this.node(n, {
1494
+ return this.node(e, {
1493
1495
  kind: c.SCHEMA_DEFINITION,
1494
- description: e,
1496
+ description: n,
1495
1497
  directives: i,
1496
1498
  operationTypes: r
1497
1499
  });
@@ -1500,12 +1502,12 @@ class tt {
1500
1502
  * OperationTypeDefinition : OperationType : NamedType
1501
1503
  */
1502
1504
  parseOperationTypeDefinition() {
1503
- const n = this._lexer.token, e = this.parseOperationType();
1505
+ const e = this._lexer.token, n = this.parseOperationType();
1504
1506
  this.expectToken(a.COLON);
1505
1507
  const i = this.parseNamedType();
1506
- return this.node(n, {
1508
+ return this.node(e, {
1507
1509
  kind: c.OPERATION_TYPE_DEFINITION,
1508
- operation: e,
1510
+ operation: n,
1509
1511
  type: i
1510
1512
  });
1511
1513
  }
@@ -1513,12 +1515,12 @@ class tt {
1513
1515
  * ScalarTypeDefinition : Description? scalar Name Directives[Const]?
1514
1516
  */
1515
1517
  parseScalarTypeDefinition() {
1516
- const n = this._lexer.token, e = this.parseDescription();
1518
+ const e = this._lexer.token, n = this.parseDescription();
1517
1519
  this.expectKeyword("scalar");
1518
1520
  const i = this.parseName(), r = this.parseConstDirectives();
1519
- return this.node(n, {
1521
+ return this.node(e, {
1520
1522
  kind: c.SCALAR_TYPE_DEFINITION,
1521
- description: e,
1523
+ description: n,
1522
1524
  name: i,
1523
1525
  directives: r
1524
1526
  });
@@ -1529,12 +1531,12 @@ class tt {
1529
1531
  * type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition?
1530
1532
  */
1531
1533
  parseObjectTypeDefinition() {
1532
- const n = this._lexer.token, e = this.parseDescription();
1534
+ const e = this._lexer.token, n = this.parseDescription();
1533
1535
  this.expectKeyword("type");
1534
1536
  const i = this.parseName(), r = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), o = this.parseFieldsDefinition();
1535
- return this.node(n, {
1537
+ return this.node(e, {
1536
1538
  kind: c.OBJECT_TYPE_DEFINITION,
1537
- description: e,
1539
+ description: n,
1538
1540
  name: i,
1539
1541
  interfaces: r,
1540
1542
  directives: s,
@@ -1566,12 +1568,12 @@ class tt {
1566
1568
  * - Description? Name ArgumentsDefinition? : Type Directives[Const]?
1567
1569
  */
1568
1570
  parseFieldDefinition() {
1569
- const n = this._lexer.token, e = this.parseDescription(), i = this.parseName(), r = this.parseArgumentDefs();
1571
+ const e = this._lexer.token, n = this.parseDescription(), i = this.parseName(), r = this.parseArgumentDefs();
1570
1572
  this.expectToken(a.COLON);
1571
1573
  const s = this.parseTypeReference(), o = this.parseConstDirectives();
1572
- return this.node(n, {
1574
+ return this.node(e, {
1573
1575
  kind: c.FIELD_DEFINITION,
1574
- description: e,
1576
+ description: n,
1575
1577
  name: i,
1576
1578
  arguments: r,
1577
1579
  type: s,
@@ -1593,15 +1595,15 @@ class tt {
1593
1595
  * - Description? Name : Type DefaultValue? Directives[Const]?
1594
1596
  */
1595
1597
  parseInputValueDef() {
1596
- const n = this._lexer.token, e = this.parseDescription(), i = this.parseName();
1598
+ const e = this._lexer.token, n = this.parseDescription(), i = this.parseName();
1597
1599
  this.expectToken(a.COLON);
1598
1600
  const r = this.parseTypeReference();
1599
1601
  let s;
1600
1602
  this.expectOptionalToken(a.EQUALS) && (s = this.parseConstValueLiteral());
1601
1603
  const o = this.parseConstDirectives();
1602
- return this.node(n, {
1604
+ return this.node(e, {
1603
1605
  kind: c.INPUT_VALUE_DEFINITION,
1604
- description: e,
1606
+ description: n,
1605
1607
  name: i,
1606
1608
  type: r,
1607
1609
  defaultValue: s,
@@ -1613,12 +1615,12 @@ class tt {
1613
1615
  * - Description? interface Name Directives[Const]? FieldsDefinition?
1614
1616
  */
1615
1617
  parseInterfaceTypeDefinition() {
1616
- const n = this._lexer.token, e = this.parseDescription();
1618
+ const e = this._lexer.token, n = this.parseDescription();
1617
1619
  this.expectKeyword("interface");
1618
1620
  const i = this.parseName(), r = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), o = this.parseFieldsDefinition();
1619
- return this.node(n, {
1621
+ return this.node(e, {
1620
1622
  kind: c.INTERFACE_TYPE_DEFINITION,
1621
- description: e,
1623
+ description: n,
1622
1624
  name: i,
1623
1625
  interfaces: r,
1624
1626
  directives: s,
@@ -1630,12 +1632,12 @@ class tt {
1630
1632
  * - Description? union Name Directives[Const]? UnionMemberTypes?
1631
1633
  */
1632
1634
  parseUnionTypeDefinition() {
1633
- const n = this._lexer.token, e = this.parseDescription();
1635
+ const e = this._lexer.token, n = this.parseDescription();
1634
1636
  this.expectKeyword("union");
1635
1637
  const i = this.parseName(), r = this.parseConstDirectives(), s = this.parseUnionMemberTypes();
1636
- return this.node(n, {
1638
+ return this.node(e, {
1637
1639
  kind: c.UNION_TYPE_DEFINITION,
1638
- description: e,
1640
+ description: n,
1639
1641
  name: i,
1640
1642
  directives: r,
1641
1643
  types: s
@@ -1654,12 +1656,12 @@ class tt {
1654
1656
  * - Description? enum Name Directives[Const]? EnumValuesDefinition?
1655
1657
  */
1656
1658
  parseEnumTypeDefinition() {
1657
- const n = this._lexer.token, e = this.parseDescription();
1659
+ const e = this._lexer.token, n = this.parseDescription();
1658
1660
  this.expectKeyword("enum");
1659
1661
  const i = this.parseName(), r = this.parseConstDirectives(), s = this.parseEnumValuesDefinition();
1660
- return this.node(n, {
1662
+ return this.node(e, {
1661
1663
  kind: c.ENUM_TYPE_DEFINITION,
1662
- description: e,
1664
+ description: n,
1663
1665
  name: i,
1664
1666
  directives: r,
1665
1667
  values: s
@@ -1681,10 +1683,10 @@ class tt {
1681
1683
  * EnumValueDefinition : Description? EnumValue Directives[Const]?
1682
1684
  */
1683
1685
  parseEnumValueDefinition() {
1684
- const n = this._lexer.token, e = this.parseDescription(), i = this.parseEnumValueName(), r = this.parseConstDirectives();
1685
- return this.node(n, {
1686
+ const e = this._lexer.token, n = this.parseDescription(), i = this.parseEnumValueName(), r = this.parseConstDirectives();
1687
+ return this.node(e, {
1686
1688
  kind: c.ENUM_VALUE_DEFINITION,
1687
- description: e,
1689
+ description: n,
1688
1690
  name: i,
1689
1691
  directives: r
1690
1692
  });
@@ -1708,12 +1710,12 @@ class tt {
1708
1710
  * - Description? input Name Directives[Const]? InputFieldsDefinition?
1709
1711
  */
1710
1712
  parseInputObjectTypeDefinition() {
1711
- const n = this._lexer.token, e = this.parseDescription();
1713
+ const e = this._lexer.token, n = this.parseDescription();
1712
1714
  this.expectKeyword("input");
1713
1715
  const i = this.parseName(), r = this.parseConstDirectives(), s = this.parseInputFieldsDefinition();
1714
- return this.node(n, {
1716
+ return this.node(e, {
1715
1717
  kind: c.INPUT_OBJECT_TYPE_DEFINITION,
1716
- description: e,
1718
+ description: n,
1717
1719
  name: i,
1718
1720
  directives: r,
1719
1721
  fields: s
@@ -1745,9 +1747,9 @@ class tt {
1745
1747
  * - InputObjectTypeDefinition
1746
1748
  */
1747
1749
  parseTypeSystemExtension() {
1748
- const n = this._lexer.lookahead();
1749
- if (n.kind === a.NAME)
1750
- switch (n.value) {
1750
+ const e = this._lexer.lookahead();
1751
+ if (e.kind === a.NAME)
1752
+ switch (e.value) {
1751
1753
  case "schema":
1752
1754
  return this.parseSchemaExtension();
1753
1755
  case "scalar":
@@ -1763,7 +1765,7 @@ class tt {
1763
1765
  case "input":
1764
1766
  return this.parseInputObjectTypeExtension();
1765
1767
  }
1766
- throw this.unexpected(n);
1768
+ throw this.unexpected(e);
1767
1769
  }
1768
1770
  /**
1769
1771
  * ```
@@ -1773,18 +1775,18 @@ class tt {
1773
1775
  * ```
1774
1776
  */
1775
1777
  parseSchemaExtension() {
1776
- const n = this._lexer.token;
1778
+ const e = this._lexer.token;
1777
1779
  this.expectKeyword("extend"), this.expectKeyword("schema");
1778
- const e = this.parseConstDirectives(), i = this.optionalMany(
1780
+ const n = this.parseConstDirectives(), i = this.optionalMany(
1779
1781
  a.BRACE_L,
1780
1782
  this.parseOperationTypeDefinition,
1781
1783
  a.BRACE_R
1782
1784
  );
1783
- if (e.length === 0 && i.length === 0)
1785
+ if (n.length === 0 && i.length === 0)
1784
1786
  throw this.unexpected();
1785
- return this.node(n, {
1787
+ return this.node(e, {
1786
1788
  kind: c.SCHEMA_EXTENSION,
1787
- directives: e,
1789
+ directives: n,
1788
1790
  operationTypes: i
1789
1791
  });
1790
1792
  }
@@ -1793,14 +1795,14 @@ class tt {
1793
1795
  * - extend scalar Name Directives[Const]
1794
1796
  */
1795
1797
  parseScalarTypeExtension() {
1796
- const n = this._lexer.token;
1798
+ const e = this._lexer.token;
1797
1799
  this.expectKeyword("extend"), this.expectKeyword("scalar");
1798
- const e = this.parseName(), i = this.parseConstDirectives();
1800
+ const n = this.parseName(), i = this.parseConstDirectives();
1799
1801
  if (i.length === 0)
1800
1802
  throw this.unexpected();
1801
- return this.node(n, {
1803
+ return this.node(e, {
1802
1804
  kind: c.SCALAR_TYPE_EXTENSION,
1803
- name: e,
1805
+ name: n,
1804
1806
  directives: i
1805
1807
  });
1806
1808
  }
@@ -1811,14 +1813,14 @@ class tt {
1811
1813
  * - extend type Name ImplementsInterfaces
1812
1814
  */
1813
1815
  parseObjectTypeExtension() {
1814
- const n = this._lexer.token;
1816
+ const e = this._lexer.token;
1815
1817
  this.expectKeyword("extend"), this.expectKeyword("type");
1816
- const e = this.parseName(), i = this.parseImplementsInterfaces(), r = this.parseConstDirectives(), s = this.parseFieldsDefinition();
1818
+ const n = this.parseName(), i = this.parseImplementsInterfaces(), r = this.parseConstDirectives(), s = this.parseFieldsDefinition();
1817
1819
  if (i.length === 0 && r.length === 0 && s.length === 0)
1818
1820
  throw this.unexpected();
1819
- return this.node(n, {
1821
+ return this.node(e, {
1820
1822
  kind: c.OBJECT_TYPE_EXTENSION,
1821
- name: e,
1823
+ name: n,
1822
1824
  interfaces: i,
1823
1825
  directives: r,
1824
1826
  fields: s
@@ -1831,14 +1833,14 @@ class tt {
1831
1833
  * - extend interface Name ImplementsInterfaces
1832
1834
  */
1833
1835
  parseInterfaceTypeExtension() {
1834
- const n = this._lexer.token;
1836
+ const e = this._lexer.token;
1835
1837
  this.expectKeyword("extend"), this.expectKeyword("interface");
1836
- const e = this.parseName(), i = this.parseImplementsInterfaces(), r = this.parseConstDirectives(), s = this.parseFieldsDefinition();
1838
+ const n = this.parseName(), i = this.parseImplementsInterfaces(), r = this.parseConstDirectives(), s = this.parseFieldsDefinition();
1837
1839
  if (i.length === 0 && r.length === 0 && s.length === 0)
1838
1840
  throw this.unexpected();
1839
- return this.node(n, {
1841
+ return this.node(e, {
1840
1842
  kind: c.INTERFACE_TYPE_EXTENSION,
1841
- name: e,
1843
+ name: n,
1842
1844
  interfaces: i,
1843
1845
  directives: r,
1844
1846
  fields: s
@@ -1850,14 +1852,14 @@ class tt {
1850
1852
  * - extend union Name Directives[Const]
1851
1853
  */
1852
1854
  parseUnionTypeExtension() {
1853
- const n = this._lexer.token;
1855
+ const e = this._lexer.token;
1854
1856
  this.expectKeyword("extend"), this.expectKeyword("union");
1855
- const e = this.parseName(), i = this.parseConstDirectives(), r = this.parseUnionMemberTypes();
1857
+ const n = this.parseName(), i = this.parseConstDirectives(), r = this.parseUnionMemberTypes();
1856
1858
  if (i.length === 0 && r.length === 0)
1857
1859
  throw this.unexpected();
1858
- return this.node(n, {
1860
+ return this.node(e, {
1859
1861
  kind: c.UNION_TYPE_EXTENSION,
1860
- name: e,
1862
+ name: n,
1861
1863
  directives: i,
1862
1864
  types: r
1863
1865
  });
@@ -1868,14 +1870,14 @@ class tt {
1868
1870
  * - extend enum Name Directives[Const]
1869
1871
  */
1870
1872
  parseEnumTypeExtension() {
1871
- const n = this._lexer.token;
1873
+ const e = this._lexer.token;
1872
1874
  this.expectKeyword("extend"), this.expectKeyword("enum");
1873
- const e = this.parseName(), i = this.parseConstDirectives(), r = this.parseEnumValuesDefinition();
1875
+ const n = this.parseName(), i = this.parseConstDirectives(), r = this.parseEnumValuesDefinition();
1874
1876
  if (i.length === 0 && r.length === 0)
1875
1877
  throw this.unexpected();
1876
- return this.node(n, {
1878
+ return this.node(e, {
1877
1879
  kind: c.ENUM_TYPE_EXTENSION,
1878
- name: e,
1880
+ name: n,
1879
1881
  directives: i,
1880
1882
  values: r
1881
1883
  });
@@ -1886,14 +1888,14 @@ class tt {
1886
1888
  * - extend input Name Directives[Const]
1887
1889
  */
1888
1890
  parseInputObjectTypeExtension() {
1889
- const n = this._lexer.token;
1891
+ const e = this._lexer.token;
1890
1892
  this.expectKeyword("extend"), this.expectKeyword("input");
1891
- const e = this.parseName(), i = this.parseConstDirectives(), r = this.parseInputFieldsDefinition();
1893
+ const n = this.parseName(), i = this.parseConstDirectives(), r = this.parseInputFieldsDefinition();
1892
1894
  if (i.length === 0 && r.length === 0)
1893
1895
  throw this.unexpected();
1894
- return this.node(n, {
1896
+ return this.node(e, {
1895
1897
  kind: c.INPUT_OBJECT_TYPE_EXTENSION,
1896
- name: e,
1898
+ name: n,
1897
1899
  directives: i,
1898
1900
  fields: r
1899
1901
  });
@@ -1905,14 +1907,14 @@ class tt {
1905
1907
  * ```
1906
1908
  */
1907
1909
  parseDirectiveDefinition() {
1908
- const n = this._lexer.token, e = this.parseDescription();
1910
+ const e = this._lexer.token, n = this.parseDescription();
1909
1911
  this.expectKeyword("directive"), this.expectToken(a.AT);
1910
1912
  const i = this.parseName(), r = this.parseArgumentDefs(), s = this.expectOptionalKeyword("repeatable");
1911
1913
  this.expectKeyword("on");
1912
1914
  const o = this.parseDirectiveLocations();
1913
- return this.node(n, {
1915
+ return this.node(e, {
1914
1916
  kind: c.DIRECTIVE_DEFINITION,
1915
- description: e,
1917
+ description: n,
1916
1918
  name: i,
1917
1919
  arguments: r,
1918
1920
  repeatable: s,
@@ -1955,10 +1957,10 @@ class tt {
1955
1957
  * `INPUT_FIELD_DEFINITION`
1956
1958
  */
1957
1959
  parseDirectiveLocation() {
1958
- const n = this._lexer.token, e = this.parseName();
1959
- if (Object.prototype.hasOwnProperty.call(q, e.value))
1960
- return e;
1961
- throw this.unexpected(n);
1960
+ const e = this._lexer.token, n = this.parseName();
1961
+ if (Object.prototype.hasOwnProperty.call(q, n.value))
1962
+ return n;
1963
+ throw this.unexpected(e);
1962
1964
  }
1963
1965
  // Schema Coordinates
1964
1966
  /**
@@ -1970,27 +1972,27 @@ class tt {
1970
1972
  * - \@ Name ( Name : )
1971
1973
  */
1972
1974
  parseSchemaCoordinate() {
1973
- const n = this._lexer.token, e = this.expectOptionalToken(a.AT), i = this.parseName();
1975
+ const e = this._lexer.token, n = this.expectOptionalToken(a.AT), i = this.parseName();
1974
1976
  let r;
1975
- !e && this.expectOptionalToken(a.DOT) && (r = this.parseName());
1977
+ !n && this.expectOptionalToken(a.DOT) && (r = this.parseName());
1976
1978
  let s;
1977
- return (e || r) && this.expectOptionalToken(a.PAREN_L) && (s = this.parseName(), this.expectToken(a.COLON), this.expectToken(a.PAREN_R)), e ? s ? this.node(n, {
1979
+ return (n || r) && this.expectOptionalToken(a.PAREN_L) && (s = this.parseName(), this.expectToken(a.COLON), this.expectToken(a.PAREN_R)), n ? s ? this.node(e, {
1978
1980
  kind: c.DIRECTIVE_ARGUMENT_COORDINATE,
1979
1981
  name: i,
1980
1982
  argumentName: s
1981
- }) : this.node(n, {
1983
+ }) : this.node(e, {
1982
1984
  kind: c.DIRECTIVE_COORDINATE,
1983
1985
  name: i
1984
- }) : r ? s ? this.node(n, {
1986
+ }) : r ? s ? this.node(e, {
1985
1987
  kind: c.ARGUMENT_COORDINATE,
1986
1988
  name: i,
1987
1989
  fieldName: r,
1988
1990
  argumentName: s
1989
- }) : this.node(n, {
1991
+ }) : this.node(e, {
1990
1992
  kind: c.MEMBER_COORDINATE,
1991
1993
  name: i,
1992
1994
  memberName: r
1993
- }) : this.node(n, {
1995
+ }) : this.node(e, {
1994
1996
  kind: c.TYPE_COORDINATE,
1995
1997
  name: i
1996
1998
  });
@@ -2001,72 +2003,72 @@ class tt {
2001
2003
  * location object, used to identify the place in the source that created a
2002
2004
  * given parsed object.
2003
2005
  */
2004
- node(n, e) {
2005
- return this._options.noLocation !== !0 && (e.loc = new xe(
2006
- n,
2006
+ node(e, n) {
2007
+ return this._options.noLocation !== !0 && (n.loc = new Se(
2008
+ e,
2007
2009
  this._lexer.lastToken,
2008
2010
  this._lexer.source
2009
- )), e;
2011
+ )), n;
2010
2012
  }
2011
2013
  /**
2012
2014
  * Determines if the next token is of a given kind
2013
2015
  */
2014
- peek(n) {
2015
- return this._lexer.token.kind === n;
2016
+ peek(e) {
2017
+ return this._lexer.token.kind === e;
2016
2018
  }
2017
2019
  /**
2018
2020
  * If the next token is of the given kind, return that token after advancing the lexer.
2019
2021
  * Otherwise, do not change the parser state and throw an error.
2020
2022
  */
2021
- expectToken(n) {
2022
- const e = this._lexer.token;
2023
- if (e.kind === n)
2024
- return this.advanceLexer(), e;
2023
+ expectToken(e) {
2024
+ const n = this._lexer.token;
2025
+ if (n.kind === e)
2026
+ return this.advanceLexer(), n;
2025
2027
  throw I(
2026
2028
  this._lexer.source,
2027
- e.start,
2028
- `Expected ${Ie(n)}, found ${_(e)}.`
2029
+ n.start,
2030
+ `Expected ${Ee(e)}, found ${_(n)}.`
2029
2031
  );
2030
2032
  }
2031
2033
  /**
2032
2034
  * If the next token is of the given kind, return "true" after advancing the lexer.
2033
2035
  * Otherwise, do not change the parser state and return "false".
2034
2036
  */
2035
- expectOptionalToken(n) {
2036
- return this._lexer.token.kind === n ? (this.advanceLexer(), !0) : !1;
2037
+ expectOptionalToken(e) {
2038
+ return this._lexer.token.kind === e ? (this.advanceLexer(), !0) : !1;
2037
2039
  }
2038
2040
  /**
2039
2041
  * If the next token is a given keyword, advance the lexer.
2040
2042
  * Otherwise, do not change the parser state and throw an error.
2041
2043
  */
2042
- expectKeyword(n) {
2043
- const e = this._lexer.token;
2044
- if (e.kind === a.NAME && e.value === n)
2044
+ expectKeyword(e) {
2045
+ const n = this._lexer.token;
2046
+ if (n.kind === a.NAME && n.value === e)
2045
2047
  this.advanceLexer();
2046
2048
  else
2047
2049
  throw I(
2048
2050
  this._lexer.source,
2049
- e.start,
2050
- `Expected "${n}", found ${_(e)}.`
2051
+ n.start,
2052
+ `Expected "${e}", found ${_(n)}.`
2051
2053
  );
2052
2054
  }
2053
2055
  /**
2054
2056
  * If the next token is a given keyword, return "true" after advancing the lexer.
2055
2057
  * Otherwise, do not change the parser state and return "false".
2056
2058
  */
2057
- expectOptionalKeyword(n) {
2058
- const e = this._lexer.token;
2059
- return e.kind === a.NAME && e.value === n ? (this.advanceLexer(), !0) : !1;
2059
+ expectOptionalKeyword(e) {
2060
+ const n = this._lexer.token;
2061
+ return n.kind === a.NAME && n.value === e ? (this.advanceLexer(), !0) : !1;
2060
2062
  }
2061
2063
  /**
2062
2064
  * Helper function for creating an error when an unexpected lexed token is encountered.
2063
2065
  */
2064
- unexpected(n) {
2065
- const e = n ?? this._lexer.token;
2066
+ unexpected(e) {
2067
+ const n = e ?? this._lexer.token;
2066
2068
  return I(
2067
2069
  this._lexer.source,
2068
- e.start,
2069
- `Unexpected ${_(e)}.`
2070
+ n.start,
2071
+ `Unexpected ${_(n)}.`
2070
2072
  );
2071
2073
  }
2072
2074
  /**
@@ -2074,11 +2076,11 @@ class tt {
2074
2076
  * This list begins with a lex token of openKind and ends with a lex token of closeKind.
2075
2077
  * Advances the parser to the next lex token after the closing token.
2076
2078
  */
2077
- any(n, e, i) {
2078
- this.expectToken(n);
2079
+ any(e, n, i) {
2080
+ this.expectToken(e);
2079
2081
  const r = [];
2080
2082
  for (; !this.expectOptionalToken(i); )
2081
- r.push(e.call(this));
2083
+ r.push(n.call(this));
2082
2084
  return r;
2083
2085
  }
2084
2086
  /**
@@ -2087,11 +2089,11 @@ class tt {
2087
2089
  * that begins with a lex token of openKind and ends with a lex token of closeKind.
2088
2090
  * Advances the parser to the next lex token after the closing token.
2089
2091
  */
2090
- optionalMany(n, e, i) {
2091
- if (this.expectOptionalToken(n)) {
2092
+ optionalMany(e, n, i) {
2093
+ if (this.expectOptionalToken(e)) {
2092
2094
  const r = [];
2093
2095
  do
2094
- r.push(e.call(this));
2096
+ r.push(n.call(this));
2095
2097
  while (!this.expectOptionalToken(i));
2096
2098
  return r;
2097
2099
  }
@@ -2102,11 +2104,11 @@ class tt {
2102
2104
  * This list begins with a lex token of openKind and ends with a lex token of closeKind.
2103
2105
  * Advances the parser to the next lex token after the closing token.
2104
2106
  */
2105
- many(n, e, i) {
2106
- this.expectToken(n);
2107
+ many(e, n, i) {
2108
+ this.expectToken(e);
2107
2109
  const r = [];
2108
2110
  do
2109
- r.push(e.call(this));
2111
+ r.push(n.call(this));
2110
2112
  while (!this.expectOptionalToken(i));
2111
2113
  return r;
2112
2114
  }
@@ -2115,107 +2117,107 @@ class tt {
2115
2117
  * This list may begin with a lex token of delimiterKind followed by items separated by lex tokens of tokenKind.
2116
2118
  * Advances the parser to the next lex token after last item in the list.
2117
2119
  */
2118
- delimitedMany(n, e) {
2119
- this.expectOptionalToken(n);
2120
+ delimitedMany(e, n) {
2121
+ this.expectOptionalToken(e);
2120
2122
  const i = [];
2121
2123
  do
2122
- i.push(e.call(this));
2123
- while (this.expectOptionalToken(n));
2124
+ i.push(n.call(this));
2125
+ while (this.expectOptionalToken(e));
2124
2126
  return i;
2125
2127
  }
2126
2128
  advanceLexer() {
2127
- const { maxTokens: n } = this._options, e = this._lexer.advance();
2128
- if (e.kind !== a.EOF && (++this._tokenCounter, n !== void 0 && this._tokenCounter > n))
2129
+ const { maxTokens: e } = this._options, n = this._lexer.advance();
2130
+ if (n.kind !== a.EOF && (++this._tokenCounter, e !== void 0 && this._tokenCounter > e))
2129
2131
  throw I(
2130
2132
  this._lexer.source,
2131
- e.start,
2132
- `Document contains more that ${n} tokens. Parsing aborted.`
2133
+ n.start,
2134
+ `Document contains more that ${e} tokens. Parsing aborted.`
2133
2135
  );
2134
2136
  }
2135
2137
  }
2136
2138
  function _(t) {
2137
- const n = t.value;
2138
- return Ie(t.kind) + (n != null ? ` "${n}"` : "");
2139
+ const e = t.value;
2140
+ return Ee(t.kind) + (e != null ? ` "${e}"` : "");
2139
2141
  }
2140
- function Ie(t) {
2142
+ function Ee(t) {
2141
2143
  return we(t) ? `"${t}"` : t;
2142
2144
  }
2143
- var L = /* @__PURE__ */ new Map(), G = /* @__PURE__ */ new Map(), Ee = !0, $ = !1;
2144
- function ye(t) {
2145
+ var L = /* @__PURE__ */ new Map(), G = /* @__PURE__ */ new Map(), ye = !0, $ = !1;
2146
+ function ke(t) {
2145
2147
  return t.replace(/[\s,]+/g, " ").trim();
2146
2148
  }
2147
- function nt(t) {
2148
- return ye(t.source.body.substring(t.start, t.end));
2149
- }
2150
2149
  function it(t) {
2151
- var n = /* @__PURE__ */ new Set(), e = [];
2150
+ return ke(t.source.body.substring(t.start, t.end));
2151
+ }
2152
+ function rt(t) {
2153
+ var e = /* @__PURE__ */ new Set(), n = [];
2152
2154
  return t.definitions.forEach(function(i) {
2153
2155
  if (i.kind === "FragmentDefinition") {
2154
- var r = i.name.value, s = nt(i.loc), o = G.get(r);
2155
- o && !o.has(s) ? Ee && console.warn("Warning: fragment with name " + r + ` already exists.
2156
+ var r = i.name.value, s = it(i.loc), o = G.get(r);
2157
+ o && !o.has(s) ? ye && console.warn("Warning: fragment with name " + r + ` already exists.
2156
2158
  graphql-tag enforces all fragment names across your application to be unique; read more about
2157
- this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`) : o || G.set(r, o = /* @__PURE__ */ new Set()), o.add(s), n.has(s) || (n.add(s), e.push(i));
2159
+ this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`) : o || G.set(r, o = /* @__PURE__ */ new Set()), o.add(s), e.has(s) || (e.add(s), n.push(i));
2158
2160
  } else
2159
- e.push(i);
2160
- }), F(F({}, t), { definitions: e });
2161
+ n.push(i);
2162
+ }), w(w({}, t), { definitions: n });
2161
2163
  }
2162
- function rt(t) {
2163
- var n = new Set(t.definitions);
2164
- n.forEach(function(i) {
2164
+ function st(t) {
2165
+ var e = new Set(t.definitions);
2166
+ e.forEach(function(i) {
2165
2167
  i.loc && delete i.loc, Object.keys(i).forEach(function(r) {
2166
2168
  var s = i[r];
2167
- s && typeof s == "object" && n.add(s);
2169
+ s && typeof s == "object" && e.add(s);
2168
2170
  });
2169
2171
  });
2170
- var e = t.loc;
2171
- return e && (delete e.startToken, delete e.endToken), t;
2172
+ var n = t.loc;
2173
+ return n && (delete n.startToken, delete n.endToken), t;
2172
2174
  }
2173
- function st(t) {
2174
- var n = ye(t);
2175
- if (!L.has(n)) {
2176
- var e = et(t, {
2175
+ function at(t) {
2176
+ var e = ke(t);
2177
+ if (!L.has(e)) {
2178
+ var n = tt(t, {
2177
2179
  experimentalFragmentVariables: $,
2178
2180
  allowLegacyFragmentVariables: $
2179
2181
  });
2180
- if (!e || e.kind !== "Document")
2182
+ if (!n || n.kind !== "Document")
2181
2183
  throw new Error("Not a valid GraphQL document.");
2182
- L.set(n, rt(it(e)));
2184
+ L.set(e, st(rt(n)));
2183
2185
  }
2184
- return L.get(n);
2186
+ return L.get(e);
2185
2187
  }
2186
- function l(t) {
2187
- for (var n = [], e = 1; e < arguments.length; e++)
2188
- n[e - 1] = arguments[e];
2188
+ function u(t) {
2189
+ for (var e = [], n = 1; n < arguments.length; n++)
2190
+ e[n - 1] = arguments[n];
2189
2191
  typeof t == "string" && (t = [t]);
2190
2192
  var i = t[0];
2191
- return n.forEach(function(r, s) {
2193
+ return e.forEach(function(r, s) {
2192
2194
  r && r.kind === "Document" ? i += r.loc.source.body : i += r, i += t[s + 1];
2193
- }), st(i);
2194
- }
2195
- function at() {
2196
- L.clear(), G.clear();
2195
+ }), at(i);
2197
2196
  }
2198
2197
  function ot() {
2199
- Ee = !1;
2198
+ L.clear(), G.clear();
2200
2199
  }
2201
2200
  function ct() {
2202
- $ = !0;
2201
+ ye = !1;
2203
2202
  }
2204
2203
  function dt() {
2204
+ $ = !0;
2205
+ }
2206
+ function ut() {
2205
2207
  $ = !1;
2206
2208
  }
2207
- var x = {
2208
- gql: l,
2209
- resetCaches: at,
2210
- disableFragmentWarnings: ot,
2211
- enableExperimentalFragmentVariables: ct,
2212
- disableExperimentalFragmentVariables: dt
2209
+ var P = {
2210
+ gql: u,
2211
+ resetCaches: ot,
2212
+ disableFragmentWarnings: ct,
2213
+ enableExperimentalFragmentVariables: dt,
2214
+ disableExperimentalFragmentVariables: ut
2213
2215
  };
2214
2216
  (function(t) {
2215
- t.gql = x.gql, t.resetCaches = x.resetCaches, t.disableFragmentWarnings = x.disableFragmentWarnings, t.enableExperimentalFragmentVariables = x.enableExperimentalFragmentVariables, t.disableExperimentalFragmentVariables = x.disableExperimentalFragmentVariables;
2216
- })(l || (l = {}));
2217
- l.default = l;
2218
- const ut = l`
2217
+ t.gql = P.gql, t.resetCaches = P.resetCaches, t.disableFragmentWarnings = P.disableFragmentWarnings, t.enableExperimentalFragmentVariables = P.enableExperimentalFragmentVariables, t.disableExperimentalFragmentVariables = P.disableExperimentalFragmentVariables;
2218
+ })(u || (u = {}));
2219
+ u.default = u;
2220
+ const lt = u`
2219
2221
  query findActiveOrderById($id: String) {
2220
2222
  findOrder(id: $id) {
2221
2223
  id
@@ -2302,7 +2304,7 @@ const ut = l`
2302
2304
  }
2303
2305
  }
2304
2306
  }
2305
- `, lt = l`
2307
+ `, pt = u`
2306
2308
  query findOrderById($id: String, $reference: String) {
2307
2309
  findOrder(id: $id, reference: $reference) {
2308
2310
  id
@@ -2346,7 +2348,7 @@ const ut = l`
2346
2348
  downloadCode
2347
2349
  }
2348
2350
  }
2349
- `, ht = l`
2351
+ `, ht = u`
2350
2352
  mutation addToOrder($orderId: ID!, $productId: ID!, $shopId: ID, $additionalData: AdditionalDataInput, $trackerId: ID, $amount: Int) {
2351
2353
  reserveProduct(
2352
2354
  input: {orderId: $orderId, productId: $productId, additionalData: $additionalData, trackerId: $trackerId, shopId: $shopId, amountToIncrease: $amount}
@@ -2356,7 +2358,7 @@ const ut = l`
2356
2358
  amountReserved
2357
2359
  }
2358
2360
  }
2359
- `, pt = l`
2361
+ `, gt = u`
2360
2362
  mutation removeFromOrder($orderId: ID!, $productId: ID!, $additionalData: AdditionalDataInput, $amount: Int) {
2361
2363
  releaseProduct(
2362
2364
  input: {orderId: $orderId, productId: $productId, additionalData: $additionalData, amountToRelease: $amount}
@@ -2365,7 +2367,7 @@ const ut = l`
2365
2367
  amountReleased
2366
2368
  }
2367
2369
  }
2368
- `, mt = l`
2370
+ `, mt = u`
2369
2371
  mutation configurePackage($orderId: ID!, $packageId: ID!, $amount: Int!, $items: [ReservedItem!]!, $shopId: ID, $trackerId: ID) {
2370
2372
  configurePackage(
2371
2373
  input: {orderId: $orderId, shopId: $shopId, trackerId: $trackerId, packageId: $packageId, amount: $amount, items: $items}
@@ -2375,7 +2377,7 @@ const ut = l`
2375
2377
  amountReserved
2376
2378
  }
2377
2379
  }
2378
- `, ft = l`
2380
+ `, ft = u`
2379
2381
  mutation reserveAdditionalPackageItem($amount: Int!, $orderId: ID!, $packageId: ID!, $eventId: ID!, $packageItemId: ID!) {
2380
2382
  reserveAdditionalPackageItem(
2381
2383
  input: {amount: $amount, eventId: $eventId, orderId: $orderId, packageId: $packageId, packageItemId: $packageItemId}
@@ -2385,158 +2387,158 @@ const ut = l`
2385
2387
  amountReserved
2386
2388
  }
2387
2389
  }
2388
- `, gt = l`
2390
+ `, It = u`
2389
2391
  mutation configureOrderDeliveryOption($orderId: ID!, $productId: ID) {
2390
2392
  configureDeliveryOption(input: {orderId: $orderId, productId: $productId})
2391
2393
  }
2392
- `, It = l`
2394
+ `, Et = u`
2393
2395
  mutation createOrderCustomer($orderId: ID!, $countryCode: String, $customer: CreateCustomerInput!) {
2394
2396
  createOrderCustomer(
2395
2397
  input: {id: $orderId, countryCode: $countryCode, customer: $customer}
2396
2398
  )
2397
2399
  }
2398
- `, Et = l`
2400
+ `, yt = u`
2399
2401
  mutation deleteOrder($orderId: ID!) {
2400
2402
  cancelOrder(id: $orderId)
2401
2403
  }
2402
- `, yt = (t, n, e, i) => t();
2403
- function Ot(t, n = yt) {
2404
+ `, kt = (t, e, n, i) => t();
2405
+ function Ot(t, e = kt) {
2404
2406
  return {
2405
- findActiveOrderById(e, i, r) {
2406
- return n((s) => t.request({ document: ut, variables: e, requestHeaders: { ...i, ...s }, signal: r }), "findActiveOrderById", "query", e);
2407
+ findActiveOrderById(n, i, r) {
2408
+ return e((s) => t.request({ document: lt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findActiveOrderById", "query", n);
2407
2409
  },
2408
- findOrderById(e, i, r) {
2409
- return n((s) => t.request({ document: lt, variables: e, requestHeaders: { ...i, ...s }, signal: r }), "findOrderById", "query", e);
2410
+ findOrderById(n, i, r) {
2411
+ return e((s) => t.request({ document: pt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findOrderById", "query", n);
2410
2412
  },
2411
- addToOrder(e, i, r) {
2412
- return n((s) => t.request({ document: ht, variables: e, requestHeaders: { ...i, ...s }, signal: r }), "addToOrder", "mutation", e);
2413
+ addToOrder(n, i, r) {
2414
+ return e((s) => t.request({ document: ht, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "addToOrder", "mutation", n);
2413
2415
  },
2414
- removeFromOrder(e, i, r) {
2415
- return n((s) => t.request({ document: pt, variables: e, requestHeaders: { ...i, ...s }, signal: r }), "removeFromOrder", "mutation", e);
2416
+ removeFromOrder(n, i, r) {
2417
+ return e((s) => t.request({ document: gt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "removeFromOrder", "mutation", n);
2416
2418
  },
2417
- configurePackage(e, i, r) {
2418
- return n((s) => t.request({ document: mt, variables: e, requestHeaders: { ...i, ...s }, signal: r }), "configurePackage", "mutation", e);
2419
+ configurePackage(n, i, r) {
2420
+ return e((s) => t.request({ document: mt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "configurePackage", "mutation", n);
2419
2421
  },
2420
- reserveAdditionalPackageItem(e, i, r) {
2421
- return n((s) => t.request({ document: ft, variables: e, requestHeaders: { ...i, ...s }, signal: r }), "reserveAdditionalPackageItem", "mutation", e);
2422
+ reserveAdditionalPackageItem(n, i, r) {
2423
+ return e((s) => t.request({ document: ft, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "reserveAdditionalPackageItem", "mutation", n);
2422
2424
  },
2423
- configureOrderDeliveryOption(e, i, r) {
2424
- return n((s) => t.request({ document: gt, variables: e, requestHeaders: { ...i, ...s }, signal: r }), "configureOrderDeliveryOption", "mutation", e);
2425
+ configureOrderDeliveryOption(n, i, r) {
2426
+ return e((s) => t.request({ document: It, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "configureOrderDeliveryOption", "mutation", n);
2425
2427
  },
2426
- createOrderCustomer(e, i, r) {
2427
- return n((s) => t.request({ document: It, variables: e, requestHeaders: { ...i, ...s }, signal: r }), "createOrderCustomer", "mutation", e);
2428
+ createOrderCustomer(n, i, r) {
2429
+ return e((s) => t.request({ document: Et, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "createOrderCustomer", "mutation", n);
2428
2430
  },
2429
- deleteOrder(e, i, r) {
2430
- return n((s) => t.request({ document: Et, variables: e, requestHeaders: { ...i, ...s }, signal: r }), "deleteOrder", "mutation", e);
2431
+ deleteOrder(n, i, r) {
2432
+ return e((s) => t.request({ document: yt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "deleteOrder", "mutation", n);
2431
2433
  }
2432
2434
  };
2433
2435
  }
2434
- class kt {
2436
+ class At {
2435
2437
  config;
2436
2438
  sdk;
2437
- constructor(n) {
2438
- this.config = n, this.sdk = Ot(new v(n.apiUrl));
2439
+ constructor(e) {
2440
+ this.config = e, this.sdk = Ot(new N(e.apiUrl));
2439
2441
  }
2440
2442
  // Basket update functions
2441
- async addProduct(n, e) {
2443
+ async addProduct(e, n, i) {
2442
2444
  try {
2443
2445
  return this.debugLog("Adding product", {
2444
- productId: e.id,
2445
- orderId: n,
2446
- amount: e.amount,
2447
- seat: e.seat
2446
+ productId: n.id,
2447
+ orderId: e,
2448
+ amount: n.amount,
2449
+ seat: n.seat
2448
2450
  }), (await this.sdk.addToOrder({
2449
- productId: e.id,
2450
- orderId: n,
2451
- additionalData: e.seat ? {
2451
+ productId: n.id,
2452
+ orderId: e,
2453
+ additionalData: n.seat ? {
2452
2454
  seat: {
2453
- seatId: e.seat.id,
2454
- seatLabel: e.seat.label,
2455
- holdToken: e.seat.holdToken
2455
+ seatId: n.seat.id,
2456
+ seatLabel: n.seat.label,
2457
+ holdToken: n.seat.holdToken
2456
2458
  }
2457
2459
  } : null,
2458
2460
  trackerId: this.config.trackerId,
2459
- shopId: this.config.shopId,
2460
- amount: e.amount
2461
+ shopId: i,
2462
+ amount: n.amount
2461
2463
  })).reserveProduct;
2462
- } catch (i) {
2463
- throw this.debugLog("Error adding product", i), this.handleError(i), i;
2464
+ } catch (r) {
2465
+ throw this.debugLog("Error adding product", r), this.handleError(r), r;
2464
2466
  }
2465
2467
  }
2466
- async removeProduct(n, e) {
2468
+ async removeProduct(e, n) {
2467
2469
  try {
2468
2470
  return this.debugLog("Removing product", {
2469
- productId: e.id,
2470
- orderId: n,
2471
- amount: e.amount
2471
+ productId: n.id,
2472
+ orderId: e,
2473
+ amount: n.amount
2472
2474
  }), (await this.sdk.removeFromOrder({
2473
- productId: e.id,
2474
- orderId: n,
2475
- additionalData: e.seat ? {
2475
+ productId: n.id,
2476
+ orderId: e,
2477
+ additionalData: n.seat ? {
2476
2478
  seat: {
2477
- seatId: e.seat.id,
2478
- seatLabel: e.seat.label
2479
+ seatId: n.seat.id,
2480
+ seatLabel: n.seat.label
2479
2481
  }
2480
2482
  } : null,
2481
- amount: e.amount
2483
+ amount: n.amount
2482
2484
  })).releaseProduct ?? null;
2483
2485
  } catch (i) {
2484
2486
  throw this.debugLog("Error removing product", i), this.handleError(i), i;
2485
2487
  }
2486
2488
  }
2487
- async configurePackage(n, e) {
2489
+ async configurePackage(e, n, i) {
2488
2490
  try {
2489
- const i = e.items.map((s) => ({
2490
- packageItemId: s.packageItemId,
2491
- eventId: s.eventId
2491
+ const r = n.items.map((o) => ({
2492
+ packageItemId: o.packageItemId,
2493
+ eventId: o.eventId
2492
2494
  }));
2493
2495
  this.debugLog("Configuring package", {
2494
- packageId: e.id,
2495
- orderId: n,
2496
- amount: e.amount,
2497
- items: i,
2498
- shopId: this.config.shopId
2496
+ packageId: n.id,
2497
+ orderId: e,
2498
+ amount: n.amount,
2499
+ items: r,
2500
+ shopId: i
2499
2501
  });
2500
- const r = await this.sdk.configurePackage({
2502
+ const s = await this.sdk.configurePackage({
2501
2503
  trackerId: this.config.trackerId,
2502
- shopId: this.config.shopId,
2503
- packageId: e.id,
2504
- orderId: n,
2505
- amount: e.amount,
2506
- items: i
2504
+ shopId: i,
2505
+ packageId: n.id,
2506
+ orderId: e,
2507
+ amount: n.amount,
2508
+ items: r
2507
2509
  });
2508
- return this.debugLog("Configure package response"), r.configurePackage ?? null;
2509
- } catch (i) {
2510
- throw this.debugLog("Error configuring package", i), this.handleError(i), i;
2510
+ return this.debugLog("Configure package response"), s.configurePackage ?? null;
2511
+ } catch (r) {
2512
+ throw this.debugLog("Error configuring package", r), this.handleError(r), r;
2511
2513
  }
2512
2514
  }
2513
- async configureCustomer(n, e) {
2514
- this.debugLog("Creating/replacing customer", { orderId: n, email: e.email });
2515
+ async configureCustomer(e, n) {
2516
+ this.debugLog("Creating/replacing customer", { orderId: e, email: n.email });
2515
2517
  try {
2516
2518
  const i = await this.sdk.createOrderCustomer({
2517
- orderId: n,
2518
- customer: e
2519
+ orderId: e,
2520
+ customer: n
2519
2521
  });
2520
2522
  this.debugLog("Customer set successfully", i);
2521
2523
  } catch (i) {
2522
2524
  throw this.debugLog("Failed to set customer", i), new Error(`Failed to set customer: ${i.message}`);
2523
2525
  }
2524
2526
  }
2525
- async reserveAdditionalPackageItem(n, e) {
2527
+ async reserveAdditionalPackageItem(e, n) {
2526
2528
  try {
2527
2529
  this.debugLog("reserve additional packageItem", {
2528
- orderId: n,
2529
- eventId: e.eventId,
2530
- amount: e.amount,
2531
- packageId: e.packageId,
2532
- packageItemId: e.packageItemId
2530
+ orderId: e,
2531
+ eventId: n.eventId,
2532
+ amount: n.amount,
2533
+ packageId: n.packageId,
2534
+ packageItemId: n.packageItemId
2533
2535
  });
2534
2536
  const i = await this.sdk.reserveAdditionalPackageItem({
2535
- orderId: n,
2536
- eventId: e.eventId,
2537
- amount: e.amount,
2538
- packageId: e.packageId,
2539
- packageItemId: e.packageItemId
2537
+ orderId: e,
2538
+ eventId: n.eventId,
2539
+ amount: n.amount,
2540
+ packageId: n.packageId,
2541
+ packageItemId: n.packageItemId
2540
2542
  });
2541
2543
  return this.debugLog("reserve additional packageItem"), i.reserveAdditionalPackageItem ?? null;
2542
2544
  } catch (i) {
@@ -2544,12 +2546,12 @@ class kt {
2544
2546
  }
2545
2547
  }
2546
2548
  // Cancel and clear order functions
2547
- async cancelOrder(n) {
2548
- n && (this.debugLog("Cancelling order", { orderId: n }), await this.sdk.deleteOrder({ orderId: n }), this.debugLog("Order cancelled successfully"));
2549
+ async cancelOrder(e) {
2550
+ e && (this.debugLog("Cancelling order", { orderId: e }), await this.sdk.deleteOrder({ orderId: e }), this.debugLog("Order cancelled successfully"));
2549
2551
  }
2550
- async findOrder(n, e) {
2552
+ async findOrder(e, n) {
2551
2553
  try {
2552
- const i = await this.sdk.findOrderById({ id: n, reference: e });
2554
+ const i = await this.sdk.findOrderById({ id: e, reference: n });
2553
2555
  return i.findOrder ? {
2554
2556
  id: i.findOrder.id,
2555
2557
  reference: i.findOrder.reference,
@@ -2574,19 +2576,19 @@ class kt {
2574
2576
  return this.debugLog("Error finding order", i), this.handleError(i), null;
2575
2577
  }
2576
2578
  }
2577
- async findActiveOrder(n) {
2578
- this.debugLog("Fetching order from server", { orderId: n });
2579
+ async findActiveOrder(e) {
2580
+ this.debugLog("Fetching order from server", { orderId: e });
2579
2581
  try {
2580
- const e = await this.sdk.findActiveOrderById({ id: n });
2581
- if (!e?.findOrder)
2582
+ const n = await this.sdk.findActiveOrderById({ id: e });
2583
+ if (!n?.findOrder)
2582
2584
  return null;
2583
- const i = e.findOrder;
2585
+ const i = n.findOrder;
2584
2586
  this.debugLog("Order fetched successfully", i);
2585
2587
  const r = i.items, s = r.filter((d) => d.product != null && d.amount > 0).map((d) => {
2586
- let f = T.PRODUCT;
2587
- return d.product.type === "PROMOTER" ? f = T.ADD_ONS : d.product.type === "PICKUP" ? f = T.PICKUP : d.product.type === "DELIVERY" && (f = T.DELIVERY), {
2588
+ let m = T.PRODUCT;
2589
+ return d.product.type === "PROMOTER" ? m = T.ADD_ONS : d.product.type === "PICKUP" ? m = T.PICKUP : d.product.type === "DELIVERY" && (m = T.DELIVERY), {
2588
2590
  id: d.product.id,
2589
- type: f,
2591
+ type: m,
2590
2592
  name: d.product.name,
2591
2593
  icon: d.product.icon,
2592
2594
  description: d.product.description,
@@ -2600,18 +2602,18 @@ class kt {
2600
2602
  label: y.label
2601
2603
  }))
2602
2604
  };
2603
- }), o = r.filter((d) => d.packageItem != null && d.amount > 0).reduce((d, f) => {
2605
+ }), o = r.filter((d) => d.packageItem != null && d.amount > 0).reduce((d, m) => {
2604
2606
  const {
2605
2607
  packageItem: y,
2606
- event: p,
2608
+ event: h,
2607
2609
  amount: O,
2608
2610
  price: C,
2609
2611
  serviceFee: Y,
2610
2612
  depositPrice: H,
2611
2613
  originalPrice: J
2612
- } = f, k = y.package.id;
2613
- d[k] ? (d[k].price += C ?? 0, d[k].serviceFee += Y ?? 0, d[k].originalPrice += J ?? 0, d[k].depositPrice += H ?? C ?? 0) : d[k] = {
2614
- id: k,
2614
+ } = m, A = y.package.id;
2615
+ d[A] ? (d[A].price += C ?? 0, d[A].serviceFee += Y ?? 0, d[A].originalPrice += J ?? 0, d[A].depositPrice += H ?? C ?? 0) : d[A] = {
2616
+ id: A,
2615
2617
  type: T.PACKAGE,
2616
2618
  name: y.package.name,
2617
2619
  amount: O,
@@ -2621,30 +2623,30 @@ class kt {
2621
2623
  originalPrice: J ?? 0,
2622
2624
  packageItems: []
2623
2625
  };
2624
- const Oe = A.fromISO(p.startAt, {
2625
- zone: p.timezone
2626
- }), ke = A.fromISO(p.endAt, {
2627
- zone: p.timezone
2626
+ const Oe = k.fromISO(h.startAt, {
2627
+ zone: h.timezone
2628
+ }), Ae = k.fromISO(h.endAt, {
2629
+ zone: h.timezone
2628
2630
  });
2629
- return d[k].packageItems.push({
2631
+ return d[A].packageItems.push({
2630
2632
  packageItemId: y.id,
2631
- eventId: p.id,
2632
- name: p.name,
2633
+ eventId: h.id,
2634
+ name: h.name,
2633
2635
  startAt: Oe.toJSDate().toISOString(),
2634
- endAt: ke.toJSDate().toISOString()
2636
+ endAt: Ae.toJSDate().toISOString()
2635
2637
  }), d;
2636
- }, {}), u = [
2638
+ }, {}), l = [
2637
2639
  ...s,
2638
2640
  ...Object.values(o)
2639
- ], h = u.reduce((d, f) => d + (f.amount || 0), 0);
2640
- if (h === 0)
2641
+ ], p = l.reduce((d, m) => d + (m.amount || 0), 0);
2642
+ if (p === 0)
2641
2643
  return null;
2642
- const E = r.filter((d) => d.amount > 0).map((d) => new Date(d.expiredAt).getTime()), m = A.fromMillis(Math.min(...E));
2644
+ const E = r.filter((d) => d.amount > 0).map((d) => new Date(d.expiredAt).getTime()), g = k.fromMillis(Math.min(...E));
2643
2645
  return {
2644
2646
  id: i.id,
2645
2647
  currency: i.currency,
2646
- expiredAt: m?.toJSDate().toISOString(),
2647
- items: u,
2648
+ expiredAt: g?.toJSDate().toISOString(),
2649
+ items: l,
2648
2650
  customer: i.mainBooker ? {
2649
2651
  firstName: i.mainBooker.firstName,
2650
2652
  lastName: i.mainBooker.lastName,
@@ -2654,29 +2656,29 @@ class kt {
2654
2656
  residence: i.mainBooker.residence,
2655
2657
  extraInfo: i.mainBooker.extraInfo
2656
2658
  } : null,
2657
- count: h,
2659
+ count: p,
2658
2660
  orderProtection: !1
2659
2661
  };
2660
- } catch (e) {
2661
- throw this.debugLog("Error fetching order", e), e;
2662
+ } catch (n) {
2663
+ throw this.debugLog("Error fetching order", n), n;
2662
2664
  }
2663
2665
  }
2664
- debugLog(n, e) {
2665
- this.config.debug && console.log(`[BasketService] ${n}`, e || "");
2666
+ debugLog(e, n) {
2667
+ this.config.debug && console.log(`[BasketService] ${e}`, n || "");
2666
2668
  }
2667
- handleError(n) {
2668
- const e = n;
2669
- if (e.graphQLErrors && e.graphQLErrors.length > 0) {
2670
- const i = e.graphQLErrors[0];
2669
+ handleError(e) {
2670
+ const n = e;
2671
+ if (n.graphQLErrors && n.graphQLErrors.length > 0) {
2672
+ const i = n.graphQLErrors[0];
2671
2673
  i.extensions?.status === "RATE_LIMIT" && console.error("Rate Limit reached"), i.extensions?.status === "SOLD_OUT" && console.error("Product sold out");
2672
2674
  }
2673
- if (e.response?.errors && e.response.errors.length > 0) {
2674
- const i = e.response.errors[0];
2675
+ if (n.response?.errors && n.response.errors.length > 0) {
2676
+ const i = n.response.errors[0];
2675
2677
  console.error("GraphQL Error:", i.message), i.extensions?.code && console.error("Error Code:", i.extensions.code);
2676
2678
  }
2677
2679
  }
2678
2680
  }
2679
- const Tt = l`
2681
+ const Tt = u`
2680
2682
  query EventOverviewPage($organizationId: ID!, $hostingIds: [String!], $locationIds: [String!], $excludedEventIds: [String!], $trackerId: String, $filterEventStatuses: [EventStatus!], $dateRange: DateRangeInput, $page: PageInput, $sorts: [SortInput!], $searchTerm: String, $priceRange: PriceRangeInput) {
2681
2683
  findAllPublicEventByOrganizationId(
2682
2684
  id: $organizationId
@@ -2721,7 +2723,7 @@ const Tt = l`
2721
2723
  count
2722
2724
  }
2723
2725
  }
2724
- `, At = l`
2726
+ `, Dt = u`
2725
2727
  query EventDetailPage($eventId: ID!) {
2726
2728
  findPublicEventById(id: $eventId) {
2727
2729
  id
@@ -2753,7 +2755,39 @@ const Tt = l`
2753
2755
  totalViews
2754
2756
  }
2755
2757
  }
2756
- `, Nt = l`
2758
+ `, Nt = u`
2759
+ query FindPublicEventBySlug($organizationId: ID!, $slug: String!) {
2760
+ findPublicEventBySlug(organizationId: $organizationId, slug: $slug) {
2761
+ id
2762
+ name
2763
+ icon
2764
+ banner
2765
+ description
2766
+ addonDescription
2767
+ startAt
2768
+ endAt
2769
+ startSalesAt
2770
+ endSalesAt
2771
+ facebookPixelId
2772
+ timezone
2773
+ slug
2774
+ status
2775
+ location {
2776
+ id
2777
+ name
2778
+ address
2779
+ }
2780
+ hosting {
2781
+ id
2782
+ name
2783
+ }
2784
+ infoDescription
2785
+ maxAmountOfTicketsPerOrder
2786
+ startingPrice
2787
+ totalViews
2788
+ }
2789
+ }
2790
+ `, vt = u`
2757
2791
  query findProductsByEventId($eventId: ID!, $promoCode: String, $trackerId: String, $productTypes: [ProductType!]) {
2758
2792
  findPublicProductsByEventId(
2759
2793
  eventId: $eventId
@@ -2787,106 +2821,109 @@ const Tt = l`
2787
2821
  showEndSalesAtTag
2788
2822
  }
2789
2823
  }
2790
- `, Dt = (t, n, e, i) => t();
2791
- function vt(t, n = Dt) {
2824
+ `, bt = (t, e, n, i) => t();
2825
+ function Pt(t, e = bt) {
2792
2826
  return {
2793
- EventOverviewPage(e, i, r) {
2794
- return n((s) => t.request({ document: Tt, variables: e, requestHeaders: { ...i, ...s }, signal: r }), "EventOverviewPage", "query", e);
2827
+ EventOverviewPage(n, i, r) {
2828
+ return e((s) => t.request({ document: Tt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "EventOverviewPage", "query", n);
2795
2829
  },
2796
- EventDetailPage(e, i, r) {
2797
- return n((s) => t.request({ document: At, variables: e, requestHeaders: { ...i, ...s }, signal: r }), "EventDetailPage", "query", e);
2830
+ EventDetailPage(n, i, r) {
2831
+ return e((s) => t.request({ document: Dt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "EventDetailPage", "query", n);
2798
2832
  },
2799
- findProductsByEventId(e, i, r) {
2800
- return n((s) => t.request({ document: Nt, variables: e, requestHeaders: { ...i, ...s }, signal: r }), "findProductsByEventId", "query", e);
2833
+ FindPublicEventBySlug(n, i, r) {
2834
+ return e((s) => t.request({ document: Nt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "FindPublicEventBySlug", "query", n);
2835
+ },
2836
+ findProductsByEventId(n, i, r) {
2837
+ return e((s) => t.request({ document: vt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findProductsByEventId", "query", n);
2801
2838
  }
2802
2839
  };
2803
2840
  }
2804
- class Pt {
2841
+ class St {
2805
2842
  config;
2806
2843
  sdk;
2807
- constructor(n) {
2808
- this.config = n, this.sdk = vt(new v(n.apiUrl));
2844
+ constructor(e) {
2845
+ this.config = e, this.sdk = Pt(new N(e.apiUrl));
2809
2846
  }
2810
- async getEvents(n = {}) {
2847
+ async getEvents(e, n) {
2811
2848
  try {
2812
- n.page && (n.page = {
2813
- index: n.page.index ?? 0,
2814
- size: n.page.size ?? 20
2849
+ e.page && (e.page = {
2850
+ index: e.page.index ?? 0,
2851
+ size: e.page.size ?? 20
2815
2852
  }), this.debugLog("Fetching events with parameters", {
2816
- organizationId: this.config.organizationId,
2817
- hostingIds: n.hostingIds,
2818
- filterEventStatuses: n.statuses,
2819
- dateRange: n.dateRange,
2820
- page: n.page,
2821
- sorts: n.sorts,
2853
+ organizationId: this.config.organizationId ?? n ?? "",
2854
+ hostingIds: e.hostingIds,
2855
+ filterEventStatuses: e.statuses,
2856
+ dateRange: e.dateRange,
2857
+ page: e.page,
2858
+ sorts: e.sorts,
2822
2859
  trackerId: this.config.trackerId
2823
2860
  });
2824
- const e = await this.sdk.EventOverviewPage({
2825
- organizationId: this.config.organizationId,
2826
- hostingIds: n.hostingIds,
2827
- locationIds: n.locationIds,
2828
- excludedEventIds: n.excludedEventIds,
2829
- filterEventStatuses: n.statuses,
2830
- dateRange: n.dateRange && n.dateRange.from && n.dateRange.till ? {
2831
- from: n.dateRange.from.toISO(),
2832
- till: n.dateRange.till.toISO()
2861
+ const i = await this.sdk.EventOverviewPage({
2862
+ organizationId: this.config.organizationId ?? n ?? "",
2863
+ hostingIds: e.hostingIds,
2864
+ locationIds: e.locationIds,
2865
+ excludedEventIds: e.excludedEventIds,
2866
+ filterEventStatuses: e.statuses,
2867
+ dateRange: e.dateRange && e.dateRange.from && e.dateRange.till ? {
2868
+ from: e.dateRange.from.toISO(),
2869
+ till: e.dateRange.till.toISO()
2833
2870
  } : void 0,
2834
- page: n.page,
2835
- sorts: n.sorts,
2871
+ page: e.page,
2872
+ sorts: e.sorts,
2836
2873
  trackerId: this.config.trackerId,
2837
- searchTerm: n.searchTerm,
2838
- priceRange: n.priceRange
2874
+ searchTerm: e.searchTerm,
2875
+ priceRange: e.priceRange
2839
2876
  });
2840
- if (this.debugLog("Raw GraphQL response", e), e?.findAllPublicEventByOrganizationId?.data) {
2841
- const i = e.findAllPublicEventByOrganizationId.data.map((r) => ({
2842
- id: r.id,
2843
- name: r.name,
2844
- icon: r.icon,
2845
- banner: r.banner,
2846
- description: r.description,
2847
- addonDescription: r.addonDescription,
2848
- startAt: A.fromISO(r.startAt, { zone: r.timezone }).toJSDate().toISOString(),
2849
- endAt: A.fromISO(r.endAt, { zone: r.timezone }).toJSDate().toISOString(),
2850
- timezone: r.timezone,
2877
+ if (this.debugLog("Raw GraphQL response", i), i?.findAllPublicEventByOrganizationId?.data) {
2878
+ const r = i.findAllPublicEventByOrganizationId.data.map((s) => ({
2879
+ id: s.id,
2880
+ name: s.name,
2881
+ icon: s.icon,
2882
+ banner: s.banner,
2883
+ description: s.description,
2884
+ addonDescription: s.addonDescription,
2885
+ startAt: k.fromISO(s.startAt, { zone: s.timezone }).toJSDate().toISOString(),
2886
+ endAt: k.fromISO(s.endAt, { zone: s.timezone }).toJSDate().toISOString(),
2887
+ timezone: s.timezone,
2851
2888
  startSalesAt: null,
2852
2889
  endSalesAt: null,
2853
- slug: r.slug ?? "ERROR",
2890
+ slug: s.slug ?? "ERROR",
2854
2891
  facebookPixelId: null,
2855
- status: r.status,
2856
- location: r.location ? {
2857
- id: r.location.id,
2858
- name: r.location.name,
2859
- address: r.location.address
2892
+ status: s.status,
2893
+ location: s.location ? {
2894
+ id: s.location.id,
2895
+ name: s.location.name,
2896
+ address: s.location.address
2860
2897
  } : void 0,
2861
- hosting: r.hosting ? {
2862
- id: r.hosting.id,
2863
- name: r.hosting.name
2898
+ hosting: s.hosting ? {
2899
+ id: s.hosting.id,
2900
+ name: s.hosting.name
2864
2901
  } : void 0,
2865
- infoDescription: r.infoDescription,
2866
- startingPrice: r.startingPrice,
2867
- totalViews: r.totalViews
2902
+ infoDescription: s.infoDescription,
2903
+ startingPrice: s.startingPrice,
2904
+ totalViews: s.totalViews
2868
2905
  }));
2869
- return this.debugLog("Processed events", { events: i, count: i.length }), [i, e.findAllPublicEventByOrganizationId.count ?? 0];
2906
+ return this.debugLog("Processed events", { events: r, count: r.length }), [r, i.findAllPublicEventByOrganizationId.count ?? 0];
2870
2907
  } else
2871
2908
  return this.debugLog("No events found in response"), [[], 0];
2872
- } catch (e) {
2873
- throw this.debugLog("Error fetching events", e), e;
2909
+ } catch (i) {
2910
+ throw this.debugLog("Error fetching events", i), i;
2874
2911
  }
2875
2912
  }
2876
- async getEvent(n) {
2913
+ async getEvent(e) {
2877
2914
  try {
2878
- this.debugLog("Fetching single event", { eventId: n });
2879
- const e = await this.sdk.EventDetailPage({ eventId: n });
2880
- if (this.debugLog("Raw GraphQL response", e), e?.findPublicEventById) {
2881
- const i = e.findPublicEventById, r = {
2915
+ this.debugLog("Fetching single event", { eventId: e });
2916
+ const n = await this.sdk.EventDetailPage({ eventId: e });
2917
+ if (this.debugLog("Raw GraphQL response", n), n?.findPublicEventById) {
2918
+ const i = n.findPublicEventById, r = {
2882
2919
  id: i.id,
2883
2920
  name: i.name,
2884
2921
  icon: i.icon,
2885
2922
  banner: i.banner,
2886
2923
  description: i.description,
2887
2924
  addonDescription: i.addonDescription,
2888
- startAt: A.fromISO(i.startAt, { zone: i.timezone }).toJSDate().toISOString(),
2889
- endAt: A.fromISO(i.endAt, { zone: i.timezone }).toJSDate().toISOString(),
2925
+ startAt: k.fromISO(i.startAt, { zone: i.timezone }).toJSDate().toISOString(),
2926
+ endAt: k.fromISO(i.endAt, { zone: i.timezone }).toJSDate().toISOString(),
2890
2927
  timezone: i.timezone,
2891
2928
  startSalesAt: i.startSalesAt,
2892
2929
  endSalesAt: i.endSalesAt,
@@ -2908,26 +2945,68 @@ class Pt {
2908
2945
  };
2909
2946
  return this.debugLog("Processed single event", r), r;
2910
2947
  } else {
2911
- this.debugLog("No event found for id", n);
2948
+ this.debugLog("No event found for id", e);
2949
+ return;
2950
+ }
2951
+ } catch (n) {
2952
+ throw this.debugLog("Error fetching single event", n), n;
2953
+ }
2954
+ }
2955
+ async getEventBySlug(e, n) {
2956
+ try {
2957
+ this.debugLog("Fetching single event by slug", { organizationId: e, slug: n });
2958
+ const i = await this.sdk.FindPublicEventBySlug({ organizationId: e, slug: n });
2959
+ if (this.debugLog("Raw GraphQL response", i), i?.findPublicEventBySlug) {
2960
+ const r = i.findPublicEventBySlug, s = {
2961
+ id: r.id,
2962
+ name: r.name,
2963
+ icon: r.icon,
2964
+ banner: r.banner,
2965
+ description: r.description,
2966
+ addonDescription: r.addonDescription,
2967
+ startAt: k.fromISO(r.startAt, { zone: r.timezone }).toJSDate().toISOString(),
2968
+ endAt: k.fromISO(r.endAt, { zone: r.timezone }).toJSDate().toISOString(),
2969
+ timezone: r.timezone,
2970
+ startSalesAt: r.startSalesAt,
2971
+ endSalesAt: r.endSalesAt,
2972
+ slug: r.slug ?? "ERROR",
2973
+ facebookPixelId: r.facebookPixelId,
2974
+ status: r.status,
2975
+ location: r.location ? {
2976
+ id: r.location.id,
2977
+ name: r.location.name,
2978
+ address: r.location.address
2979
+ } : void 0,
2980
+ hosting: r.hosting ? {
2981
+ id: r.hosting.id,
2982
+ name: r.hosting.name
2983
+ } : void 0,
2984
+ infoDescription: r.infoDescription,
2985
+ startingPrice: r.startingPrice,
2986
+ totalViews: r.totalViews
2987
+ };
2988
+ return this.debugLog("Processed single event", s), s;
2989
+ } else {
2990
+ this.debugLog("No event found for id by slug", { organizationId: e, slug: n });
2912
2991
  return;
2913
2992
  }
2914
- } catch (e) {
2915
- throw this.debugLog("Error fetching single event", e), e;
2993
+ } catch (i) {
2994
+ throw this.debugLog("Error fetching single event", i), i;
2916
2995
  }
2917
2996
  }
2918
- async getProducts(n, e, i) {
2997
+ async getProducts(e, n, i) {
2919
2998
  try {
2920
2999
  this.debugLog("Fetching products for event", {
2921
- eventId: n,
3000
+ eventId: e,
2922
3001
  promoCode: i,
2923
3002
  trackerId: this.config.trackerId,
2924
- productTypes: e
3003
+ productTypes: n
2925
3004
  });
2926
3005
  const r = await this.sdk.findProductsByEventId({
2927
- eventId: n,
3006
+ eventId: e,
2928
3007
  promoCode: i,
2929
3008
  trackerId: this.config.trackerId,
2930
- productTypes: e
3009
+ productTypes: n
2931
3010
  });
2932
3011
  if (r?.findPublicProductsByEventId) {
2933
3012
  const s = r.findPublicProductsByEventId.map((o) => ({
@@ -2955,21 +3034,21 @@ class Pt {
2955
3034
  type: o.type
2956
3035
  }));
2957
3036
  return this.debugLog("Products fetched", {
2958
- eventId: n,
3037
+ eventId: e,
2959
3038
  count: s.length,
2960
3039
  types: s.map((o) => o.type)
2961
3040
  }), s;
2962
3041
  }
2963
3042
  return;
2964
3043
  } catch (r) {
2965
- throw this.debugLog("Error fetching products", { eventId: n, error: r }), r;
3044
+ throw this.debugLog("Error fetching products", { eventId: e, error: r }), r;
2966
3045
  }
2967
3046
  }
2968
- debugLog(n, e) {
2969
- this.config.debug && console.log(`[EventService:${this.config.organizationId}] ${n}`, e || "");
3047
+ debugLog(e, n) {
3048
+ this.config.debug && console.log(`[EventService:${this.config.organizationId}] ${e}`, n || "");
2970
3049
  }
2971
3050
  }
2972
- const xt = l`
3051
+ const xt = u`
2973
3052
  query findPaymentMethods($orderId: ID!, $orderItemId: String, $amountOfTickets: Int, $paymentMethodId: String, $withTicketProtection: Boolean) {
2974
3053
  findPaymentDetails(
2975
3054
  orderId: $orderId
@@ -2999,40 +3078,40 @@ const xt = l`
2999
3078
  protectionFee
3000
3079
  }
3001
3080
  }
3002
- `, bt = l`
3081
+ `, Ct = u`
3003
3082
  mutation createDigitalPayment($input: CreateDigitalOrderPaymentInput!) {
3004
3083
  createDigitalOrderPayment(input: $input)
3005
3084
  }
3006
- `, St = (t, n, e, i) => t();
3007
- function Ct(t, n = St) {
3085
+ `, _t = (t, e, n, i) => t();
3086
+ function Lt(t, e = _t) {
3008
3087
  return {
3009
- findPaymentMethods(e, i, r) {
3010
- return n((s) => t.request({ document: xt, variables: e, requestHeaders: { ...i, ...s }, signal: r }), "findPaymentMethods", "query", e);
3088
+ findPaymentMethods(n, i, r) {
3089
+ return e((s) => t.request({ document: xt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findPaymentMethods", "query", n);
3011
3090
  },
3012
- createDigitalPayment(e, i, r) {
3013
- return n((s) => t.request({ document: bt, variables: e, requestHeaders: { ...i, ...s }, signal: r }), "createDigitalPayment", "mutation", e);
3091
+ createDigitalPayment(n, i, r) {
3092
+ return e((s) => t.request({ document: Ct, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "createDigitalPayment", "mutation", n);
3014
3093
  }
3015
3094
  };
3016
3095
  }
3017
- class _t {
3096
+ class Rt {
3018
3097
  config;
3019
3098
  sdk;
3020
- constructor(n) {
3021
- this.config = n, this.sdk = Ct(new v(n.apiUrl));
3099
+ constructor(e) {
3100
+ this.config = e, this.sdk = Lt(new N(e.apiUrl));
3022
3101
  }
3023
- async getPaymentDetails(n) {
3024
- this.debugLog("Fetching payment methods", n);
3102
+ async getPaymentDetails(e) {
3103
+ this.debugLog("Fetching payment methods", e);
3025
3104
  try {
3026
- const e = await this.sdk.findPaymentMethods({
3027
- orderId: n.orderId,
3028
- orderItemId: n.orderItemId,
3029
- amountOfTickets: n.amountOfTickets,
3030
- paymentMethodId: n.paymentMethodId,
3031
- withTicketProtection: n.withTicketProtection
3105
+ const n = await this.sdk.findPaymentMethods({
3106
+ orderId: e.orderId,
3107
+ orderItemId: e.orderItemId,
3108
+ amountOfTickets: e.amountOfTickets,
3109
+ paymentMethodId: e.paymentMethodId,
3110
+ withTicketProtection: e.withTicketProtection
3032
3111
  });
3033
- if (!e?.findPaymentDetails)
3112
+ if (!n?.findPaymentDetails)
3034
3113
  throw this.debugLog("No payment details found"), new Error("No payment details found for this order");
3035
- const i = e.findPaymentDetails;
3114
+ const i = n.findPaymentDetails;
3036
3115
  return this.debugLog("Payment methods fetched successfully", {
3037
3116
  methodCount: i.methods?.length ?? 0,
3038
3117
  transactionPrice: i.transactionPrice,
@@ -3061,42 +3140,42 @@ class _t {
3061
3140
  })) ?? null
3062
3141
  })) ?? null
3063
3142
  };
3064
- } catch (e) {
3065
- throw this.debugLog("Error fetching payment methods", e), e;
3143
+ } catch (n) {
3144
+ throw this.debugLog("Error fetching payment methods", n), n;
3066
3145
  }
3067
3146
  }
3068
- async createPayment(n) {
3069
- this.debugLog("Creating payment", n);
3147
+ async createPayment(e) {
3148
+ this.debugLog("Creating payment", e);
3070
3149
  try {
3071
- const e = {
3072
- orderId: n.orderId,
3073
- paymentMethodId: n.paymentMethodId,
3074
- issuerId: n.issuerId,
3075
- redirectUrl: n.redirectUrl,
3150
+ const n = {
3151
+ orderId: e.orderId,
3152
+ paymentMethodId: e.paymentMethodId,
3153
+ issuerId: e.issuerId,
3154
+ redirectUrl: e.redirectUrl,
3076
3155
  // For payment links this input in used
3077
- initiatedByUserId: n.initiatedByUserId,
3078
- initiatedByTeamId: n.initiatedByTeamId,
3079
- amountOfTickets: n.amountOfTickets,
3080
- orderItemId: n.orderItemId,
3081
- withTicketProtection: n.withTicketProtection
3156
+ initiatedByUserId: e.initiatedByUserId,
3157
+ initiatedByTeamId: e.initiatedByTeamId,
3158
+ amountOfTickets: e.amountOfTickets,
3159
+ orderItemId: e.orderItemId,
3160
+ withTicketProtection: e.withTicketProtection
3082
3161
  };
3083
- n.customer && (e.customer = n.customer), n.products && (e.products = n.products), n.description && (e.description = n.description), n.reference && (e.reference = n.reference), n.ipAddress && (e.ipAddress = n.ipAddress);
3162
+ e.customer && (n.customer = e.customer), e.products && (n.products = e.products), e.description && (n.description = e.description), e.reference && (n.reference = e.reference), e.ipAddress && (n.ipAddress = e.ipAddress);
3084
3163
  const i = await this.sdk.createDigitalPayment({
3085
- input: e
3164
+ input: n
3086
3165
  });
3087
3166
  if (!i?.createDigitalOrderPayment)
3088
3167
  throw this.debugLog("Failed to create payment"), new Error("Failed to create payment for this order");
3089
3168
  const r = i.createDigitalOrderPayment;
3090
3169
  return this.debugLog("Payment created successfully", { paymentUrl: r }), { paymentUrl: r };
3091
- } catch (e) {
3092
- throw this.debugLog("Error creating payment", e), e;
3170
+ } catch (n) {
3171
+ throw this.debugLog("Error creating payment", n), n;
3093
3172
  }
3094
3173
  }
3095
- debugLog(n, e) {
3096
- this.config.debug && console.log(`[PaymentService] ${n}`, e || "");
3174
+ debugLog(e, n) {
3175
+ this.config.debug && console.log(`[PaymentService] ${e}`, n || "");
3097
3176
  }
3098
3177
  }
3099
- const Lt = l`
3178
+ const Ft = u`
3100
3179
  query findAllPublicPackagesByOrganizationId($organizationId: ID!) {
3101
3180
  findAllPublicPackagesByOrganizationId(organizationId: $organizationId) {
3102
3181
  data {
@@ -3121,7 +3200,7 @@ const Lt = l`
3121
3200
  count
3122
3201
  }
3123
3202
  }
3124
- `, Rt = l`
3203
+ `, wt = u`
3125
3204
  query findPublicPackageById($packageId: ID!) {
3126
3205
  findPublicPackageById(id: $packageId) {
3127
3206
  id
@@ -3147,7 +3226,33 @@ const Lt = l`
3147
3226
  }
3148
3227
  }
3149
3228
  }
3150
- `, wt = l`
3229
+ `, $t = u`
3230
+ query findPublicPackageBySlug($organizationId: ID!, $slug: String!) {
3231
+ findPublicPackageBySlug(organizationId: $organizationId, slug: $slug) {
3232
+ id
3233
+ slug
3234
+ status
3235
+ name
3236
+ description
3237
+ shortTitle
3238
+ shortDescription
3239
+ startAvailabilityAt
3240
+ endAvailabilityAt
3241
+ maxAmountOfPersonsPerOrder
3242
+ icon
3243
+ banner
3244
+ currency
3245
+ amountOfEvents
3246
+ amountOfAddons
3247
+ prices {
3248
+ price
3249
+ deposit
3250
+ discount
3251
+ serviceFee
3252
+ }
3253
+ }
3254
+ }
3255
+ `, Bt = u`
3151
3256
  query findPublicItemsByPackageId($packageId: ID!, $types: [PackageItemType!], $page: PageInput) {
3152
3257
  findPublicItemsByPackageId(packageId: $packageId, types: $types, page: $page) {
3153
3258
  data {
@@ -3182,77 +3287,96 @@ const Lt = l`
3182
3287
  count
3183
3288
  }
3184
3289
  }
3185
- `, Ft = (t, n, e, i) => t();
3186
- function $t(t, n = Ft) {
3290
+ `, Vt = (t, e, n, i) => t();
3291
+ function Ut(t, e = Vt) {
3187
3292
  return {
3188
- findAllPublicPackagesByOrganizationId(e, i, r) {
3189
- return n((s) => t.request({ document: Lt, variables: e, requestHeaders: { ...i, ...s }, signal: r }), "findAllPublicPackagesByOrganizationId", "query", e);
3293
+ findAllPublicPackagesByOrganizationId(n, i, r) {
3294
+ return e((s) => t.request({ document: Ft, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findAllPublicPackagesByOrganizationId", "query", n);
3190
3295
  },
3191
- findPublicPackageById(e, i, r) {
3192
- return n((s) => t.request({ document: Rt, variables: e, requestHeaders: { ...i, ...s }, signal: r }), "findPublicPackageById", "query", e);
3296
+ findPublicPackageById(n, i, r) {
3297
+ return e((s) => t.request({ document: wt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findPublicPackageById", "query", n);
3193
3298
  },
3194
- findPublicItemsByPackageId(e, i, r) {
3195
- return n((s) => t.request({ document: wt, variables: e, requestHeaders: { ...i, ...s }, signal: r }), "findPublicItemsByPackageId", "query", e);
3299
+ findPublicPackageBySlug(n, i, r) {
3300
+ return e((s) => t.request({ document: $t, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findPublicPackageBySlug", "query", n);
3301
+ },
3302
+ findPublicItemsByPackageId(n, i, r) {
3303
+ return e((s) => t.request({ document: Bt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findPublicItemsByPackageId", "query", n);
3196
3304
  }
3197
3305
  };
3198
3306
  }
3199
- class Bt {
3307
+ class Mt {
3200
3308
  config;
3201
3309
  sdk;
3202
- constructor(n) {
3203
- this.config = n, this.sdk = $t(new v(n.apiUrl));
3310
+ constructor(e) {
3311
+ this.config = e, this.sdk = Ut(new N(e.apiUrl));
3204
3312
  }
3205
- debugLog(n, e) {
3206
- this.config.debug && console.log(`[PackageService] ${n}`, e || "");
3313
+ debugLog(e, n) {
3314
+ this.config.debug && console.log(`[PackageService] ${e}`, n || "");
3207
3315
  }
3208
- async getPackages(n = {}) {
3316
+ async getPackages(e, n) {
3209
3317
  try {
3210
- let e;
3211
- n.page && (e = {
3212
- index: n.page.index ?? 0,
3213
- size: n.page.size ?? 20
3318
+ let i;
3319
+ e.page && (i = {
3320
+ index: e.page.index ?? 0,
3321
+ size: e.page.size ?? 20
3214
3322
  }), this.debugLog("Fetching public packages", {
3215
- organizationId: this.config.organizationId,
3216
- page: e,
3217
- tab: n.tab,
3218
- statuses: n.statuses
3323
+ organizationId: this.config.organizationId ?? n ?? "",
3324
+ page: i,
3325
+ tab: e.tab,
3326
+ statuses: e.statuses
3219
3327
  });
3220
- const i = await this.sdk.findAllPublicPackagesByOrganizationId({
3221
- organizationId: this.config.organizationId
3328
+ const r = await this.sdk.findAllPublicPackagesByOrganizationId({
3329
+ organizationId: this.config.organizationId ?? n ?? ""
3222
3330
  });
3223
- if (i?.findAllPublicPackagesByOrganizationId) {
3224
- const r = i.findAllPublicPackagesByOrganizationId;
3331
+ if (r?.findAllPublicPackagesByOrganizationId) {
3332
+ const s = r.findAllPublicPackagesByOrganizationId;
3225
3333
  return this.debugLog("Public packages fetched", {
3226
- count: r.count,
3227
- dataLength: r.data.length
3228
- }), r.data;
3334
+ count: s.count,
3335
+ dataLength: s.data.length
3336
+ }), s.data;
3229
3337
  }
3230
3338
  return null;
3231
- } catch (e) {
3232
- throw this.debugLog("Error fetching public packages", e), e;
3339
+ } catch (i) {
3340
+ throw this.debugLog("Error fetching public packages", i), i;
3233
3341
  }
3234
3342
  }
3235
- async getPackage(n) {
3343
+ async getPackage(e) {
3236
3344
  try {
3237
3345
  this.debugLog("Fetching public packages", {
3238
- packageId: n
3346
+ packageId: e
3239
3347
  });
3240
- const e = await this.sdk.findPublicPackageById({ packageId: n });
3241
- if (e?.findPublicPackageById) {
3242
- const i = e.findPublicPackageById;
3348
+ const n = await this.sdk.findPublicPackageById({ packageId: e });
3349
+ if (n?.findPublicPackageById) {
3350
+ const i = n.findPublicPackageById;
3243
3351
  return this.debugLog("Public package fetched"), i;
3244
3352
  }
3245
3353
  return null;
3246
- } catch (e) {
3247
- throw this.debugLog("Error fetching public packages", e), e;
3354
+ } catch (n) {
3355
+ throw this.debugLog("Error fetching public packages", n), n;
3356
+ }
3357
+ }
3358
+ async getPackageBySlug(e, n) {
3359
+ try {
3360
+ this.debugLog("Fetching public packages by slug", {
3361
+ organizationId: e,
3362
+ slug: n
3363
+ });
3364
+ const i = await this.sdk.findPublicPackageBySlug({ organizationId: e, slug: n });
3365
+ if (i?.findPublicPackageBySlug) {
3366
+ const r = i.findPublicPackageBySlug;
3367
+ return this.debugLog("Public package fetched"), r;
3368
+ }
3369
+ return null;
3370
+ } catch (i) {
3371
+ throw this.debugLog("Error fetching public packages", i), i;
3248
3372
  }
3249
3373
  }
3250
- async getPackageItems(n, e = [R.Regular, R.AdditionalEvent]) {
3374
+ async getPackageItems(e, n = [R.Regular, R.AdditionalEvent]) {
3251
3375
  try {
3252
- this.debugLog("Fetching public package items", { packageId: n, types: e });
3376
+ this.debugLog("Fetching public package items", { packageId: e, types: n });
3253
3377
  const i = await this.sdk.findPublicItemsByPackageId({
3254
- packageId: n,
3255
- types: e,
3378
+ packageId: e,
3379
+ types: n,
3256
3380
  page: { index: 0, size: 100 }
3257
3381
  });
3258
3382
  if (i?.findPublicItemsByPackageId) {
@@ -3268,7 +3392,7 @@ class Bt {
3268
3392
  }
3269
3393
  }
3270
3394
  }
3271
- const Vt = l`
3395
+ const zt = u`
3272
3396
  query findAllPublicCategoriesByOrganizationId($organizationId: ID!, $dateRange: DateRangeInput) {
3273
3397
  findAllPublicLocationsByOrganizationId(id: $organizationId) {
3274
3398
  data {
@@ -3288,89 +3412,89 @@ const Vt = l`
3288
3412
  count
3289
3413
  }
3290
3414
  }
3291
- `, Ut = (t, n, e, i) => t();
3292
- function Mt(t, n = Ut) {
3415
+ `, qt = (t, e, n, i) => t();
3416
+ function Gt(t, e = qt) {
3293
3417
  return {
3294
- findAllPublicCategoriesByOrganizationId(e, i, r) {
3295
- return n((s) => t.request({ document: Vt, variables: e, requestHeaders: { ...i, ...s }, signal: r }), "findAllPublicCategoriesByOrganizationId", "query", e);
3418
+ findAllPublicCategoriesByOrganizationId(n, i, r) {
3419
+ return e((s) => t.request({ document: zt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findAllPublicCategoriesByOrganizationId", "query", n);
3296
3420
  }
3297
3421
  };
3298
3422
  }
3299
- class zt {
3423
+ class jt {
3300
3424
  config;
3301
3425
  sdk;
3302
- constructor(n) {
3303
- this.config = n, this.sdk = Mt(new v(n.apiUrl));
3426
+ constructor(e) {
3427
+ this.config = e, this.sdk = Gt(new N(e.apiUrl));
3304
3428
  }
3305
- debugLog(n, e) {
3306
- this.config.debug && console.log(`[CategoryService] ${n}`, e || "");
3429
+ debugLog(e, n) {
3430
+ this.config.debug && console.log(`[CategoryService] ${e}`, n || "");
3307
3431
  }
3308
- async getCategories(n) {
3432
+ async getCategories(e, n) {
3309
3433
  try {
3310
3434
  this.debugLog("Fetching all categories", { organizationId: this.config.organizationId });
3311
- const e = await this.sdk.findAllPublicCategoriesByOrganizationId({ organizationId: this.config.organizationId, dateRange: n ?? null });
3312
- if (e?.findAllPublicHostingsByOrganizationId) {
3313
- const i = e.findAllPublicHostingsByOrganizationId, r = e.findAllPublicLocationsByOrganizationId;
3314
- return this.debugLog("Categories fetched", { count: i.count + r.count, dataLength: i.data.length + r.data.length }), [
3315
- ...i.data.map((s) => ({ id: s.id, name: s.name, icon: s.icon, activeEvents: s.amountOfActiveEvents, type: "HOSTING" })),
3316
- ...r.data.map((s) => ({ id: s.id, name: s.name, activeEvents: s.amountOfActiveEvents, type: "LOCATION" }))
3435
+ const i = await this.sdk.findAllPublicCategoriesByOrganizationId({ organizationId: this.config.organizationId ?? n ?? "", dateRange: e ?? null });
3436
+ if (i?.findAllPublicHostingsByOrganizationId) {
3437
+ const r = i.findAllPublicHostingsByOrganizationId, s = i.findAllPublicLocationsByOrganizationId;
3438
+ return this.debugLog("Categories fetched", { count: r.count + s.count, dataLength: r.data.length + s.data.length }), [
3439
+ ...r.data.map((o) => ({ id: o.id, name: o.name, icon: o.icon, activeEvents: o.amountOfActiveEvents, type: "HOSTING" })),
3440
+ ...s.data.map((o) => ({ id: o.id, name: o.name, activeEvents: o.amountOfActiveEvents, type: "LOCATION" }))
3317
3441
  ];
3318
3442
  }
3319
3443
  return [];
3320
- } catch (e) {
3321
- throw this.debugLog("Error fetching categories", e), e;
3444
+ } catch (i) {
3445
+ throw this.debugLog("Error fetching categories", i), i;
3322
3446
  }
3323
3447
  }
3324
3448
  }
3325
- const qt = l`
3449
+ const Yt = u`
3326
3450
  mutation CreateShopView($id: ID!, $trackerLinkId: ID) {
3327
3451
  createShopView(id: $id, trackerId: $trackerLinkId)
3328
3452
  }
3329
- `, Gt = l`
3453
+ `, Ht = u`
3330
3454
  mutation CreateEventView($id: ID!, $shopId: ID, $trackerLinkId: ID) {
3331
3455
  createEventView(id: $id, shopId: $shopId, trackerId: $trackerLinkId)
3332
3456
  }
3333
- `, jt = l`
3457
+ `, Jt = u`
3334
3458
  mutation CreatePackageView($id: ID!, $shopId: ID, $trackerLinkId: ID) {
3335
3459
  createPackageView(id: $id, shopId: $shopId, trackerId: $trackerLinkId)
3336
3460
  }
3337
- `, Yt = (t, n, e, i) => t();
3338
- function Ht(t, n = Yt) {
3461
+ `, Qt = (t, e, n, i) => t();
3462
+ function Xt(t, e = Qt) {
3339
3463
  return {
3340
- CreateShopView(e, i, r) {
3341
- return n((s) => t.request({ document: qt, variables: e, requestHeaders: { ...i, ...s }, signal: r }), "CreateShopView", "mutation", e);
3464
+ CreateShopView(n, i, r) {
3465
+ return e((s) => t.request({ document: Yt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "CreateShopView", "mutation", n);
3342
3466
  },
3343
- CreateEventView(e, i, r) {
3344
- return n((s) => t.request({ document: Gt, variables: e, requestHeaders: { ...i, ...s }, signal: r }), "CreateEventView", "mutation", e);
3467
+ CreateEventView(n, i, r) {
3468
+ return e((s) => t.request({ document: Ht, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "CreateEventView", "mutation", n);
3345
3469
  },
3346
- CreatePackageView(e, i, r) {
3347
- return n((s) => t.request({ document: jt, variables: e, requestHeaders: { ...i, ...s }, signal: r }), "CreatePackageView", "mutation", e);
3470
+ CreatePackageView(n, i, r) {
3471
+ return e((s) => t.request({ document: Jt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "CreatePackageView", "mutation", n);
3348
3472
  }
3349
3473
  };
3350
3474
  }
3351
- class Jt {
3475
+ class Wt {
3352
3476
  config;
3353
3477
  sdk;
3354
- constructor(n) {
3355
- this.config = n, this.sdk = Ht(new v(n.apiUrl));
3478
+ constructor(e) {
3479
+ this.config = e, this.sdk = Xt(new N(e.apiUrl));
3356
3480
  }
3357
- createMetric = async (n, e, i) => {
3358
- switch (!e && !i && await this.sdk.CreateShopView({
3359
- id: n,
3481
+ createMetric = async (e, n, i) => {
3482
+ switch (!n && !i && await this.sdk.CreateShopView({
3483
+ id: e,
3360
3484
  trackerLinkId: this.config.trackerId
3361
3485
  }), i) {
3362
- case w.Event:
3486
+ case F.Event:
3363
3487
  await this.sdk.CreateEventView({
3364
- id: n,
3365
- shopId: e,
3488
+ id: e,
3489
+ shopId: n,
3366
3490
  trackerLinkId: this.config.trackerId
3367
3491
  });
3368
3492
  break;
3369
- case w.Package:
3493
+ case F.Package:
3370
3494
  await this.sdk.CreatePackageView(
3371
3495
  {
3372
- id: n,
3373
- shopId: e,
3496
+ id: e,
3497
+ shopId: n,
3374
3498
  trackerLinkId: this.config.trackerId
3375
3499
  }
3376
3500
  );
@@ -3378,70 +3502,111 @@ class Jt {
3378
3502
  }
3379
3503
  };
3380
3504
  }
3381
- const Qt = "https://api.ticketapp.com/graphql", Z = "TIC_TRACKER_ID";
3382
- class Zt {
3505
+ const Zt = u`
3506
+ query getShopBySlug($slug: String!, $trackerLinkId: String) {
3507
+ findShopBySlug(slug: $slug, promoterId: $trackerLinkId) {
3508
+ id
3509
+ name
3510
+ description
3511
+ filteredLocationIds
3512
+ filteredHostingIds
3513
+ slug
3514
+ enablePromoCode
3515
+ enableDoorTickets
3516
+ removeServiceFee
3517
+ organization {
3518
+ id
3519
+ name
3520
+ logo
3521
+ socials {
3522
+ key
3523
+ value
3524
+ }
3525
+ billing_address_name
3526
+ terms_and_conditions
3527
+ facebook_pixel
3528
+ google_tag
3529
+ seatsIoWorkspaceId
3530
+ }
3531
+ template(trackerId: $trackerLinkId) {
3532
+ type
3533
+ variation
3534
+ backgroundColor
3535
+ primaryColor
3536
+ secondaryColor
3537
+ textColor
3538
+ slogan
3539
+ title
3540
+ notes
3541
+ description
3542
+ banner
3543
+ autoSelectFirstEvent
3544
+ useDarkTheme
3545
+ }
3546
+ blockedLanguages
3547
+ }
3548
+ }
3549
+ `, Kt = (t, e, n, i) => t();
3550
+ function en(t, e = Kt) {
3551
+ return {
3552
+ getShopBySlug(n, i, r) {
3553
+ return e((s) => t.request({ document: Zt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "getShopBySlug", "query", n);
3554
+ }
3555
+ };
3556
+ }
3557
+ class tn {
3558
+ config;
3559
+ sdk;
3560
+ constructor(e) {
3561
+ this.config = e, this.sdk = en(new N(e.apiUrl));
3562
+ }
3563
+ async getShop(e) {
3564
+ try {
3565
+ this.debugLog("Fetching shop", { slug: e });
3566
+ const n = await this.sdk.getShopBySlug({ slug: e, trackerLinkId: this.config.trackerId });
3567
+ if (this.debugLog("Raw GraphQL response", n), n?.findShopBySlug) {
3568
+ const i = n.findShopBySlug;
3569
+ return this.debugLog("Public Shop fetched"), i;
3570
+ }
3571
+ return null;
3572
+ } catch (n) {
3573
+ throw this.debugLog("Error fetching single Shop", n), n;
3574
+ }
3575
+ }
3576
+ debugLog(e, n) {
3577
+ this.config.debug && console.log(`[ShopService] ${e}`, n || "");
3578
+ }
3579
+ }
3580
+ const nn = "https://api.ticketapp.com/graphql";
3581
+ class an {
3383
3582
  basket;
3384
3583
  event;
3385
3584
  payment;
3386
3585
  package;
3387
3586
  category;
3388
3587
  metric;
3588
+ shop;
3389
3589
  // Attach selected public types to the SDK class
3390
3590
  static Types = Te;
3391
- constructor(n) {
3392
- const { organizationId: e, debug: i = !1, apiUrl: r = Qt } = n, s = this.getOrInitTrackerId();
3393
- this.basket = new kt({ debug: i, apiUrl: r, shopId: n.shopId, trackerId: s }), this.event = new Pt({ organizationId: e, debug: i, apiUrl: r, trackerId: s }), this.payment = new _t({ debug: i, apiUrl: r }), this.package = new Bt({ organizationId: e, debug: i, apiUrl: r }), this.category = new zt({ organizationId: e, debug: i, apiUrl: r }), this.metric = new Jt({ apiUrl: r, trackerId: s });
3394
- }
3395
- // Resolve tracker id from (in order): explicit config, URL query, or session storage
3396
- // Persist to session when found via config or URL for subsequent page loads
3397
- getOrInitTrackerId() {
3398
- try {
3399
- let n = null, e = null;
3400
- if (typeof window < "u") {
3401
- try {
3402
- e = new URL(window.location.href).searchParams.get("trackerId");
3403
- } catch {
3404
- }
3405
- try {
3406
- n = window.sessionStorage?.getItem(Z) ?? null;
3407
- } catch {
3408
- }
3409
- }
3410
- if (e && e.trim().length > 0) {
3411
- try {
3412
- typeof window < "u" && window.sessionStorage && sessionStorage.setItem(Z, e);
3413
- } catch {
3414
- }
3415
- return e;
3416
- }
3417
- if (n && n.trim().length > 0) {
3418
- try {
3419
- if (typeof window < "u") {
3420
- const i = new URL(window.location.href);
3421
- i.searchParams.get("trackerId") || (i.searchParams.set("trackerId", n), window.history.replaceState({}, "", i.toString()));
3422
- }
3423
- } catch {
3424
- }
3425
- return n;
3426
- }
3427
- return;
3428
- } catch {
3429
- return;
3430
- }
3591
+ constructor(e) {
3592
+ const { organizationId: n, debug: i = !1, apiUrl: r = nn } = e;
3593
+ this.event = new St({ organizationId: n, debug: i, apiUrl: r, trackerId: e.trackerId }), this.package = new Mt({ organizationId: n, debug: i, apiUrl: r }), this.category = new jt({ organizationId: n, debug: i, apiUrl: r }), this.metric = new Wt({ apiUrl: r, trackerId: e.trackerId }), this.shop = new tn({ debug: i, apiUrl: r, trackerId: e.trackerId }), this.basket = new At({ debug: i, apiUrl: r, trackerId: e.trackerId }), this.payment = new Rt({ debug: i, apiUrl: r });
3431
3594
  }
3432
3595
  }
3433
3596
  export {
3434
3597
  T as BasketOrderType,
3435
- oe as DiscountType,
3436
- te as EventStatus,
3437
- w as MetricsType,
3438
- ae as OrderItemType,
3598
+ ae as DiscountType,
3599
+ ee as EventStatus,
3600
+ F as MetricsType,
3601
+ se as OrderItemType,
3439
3602
  R as PackageItemType,
3440
- K as PackageStatus,
3441
- ee as PackageTabType,
3442
- se as PaymentMethodFeeType,
3443
- ie as ProductStatus,
3444
- re as ProductType,
3445
- ne as SortOrder,
3446
- Zt as TicketappSDK
3603
+ Z as PackageStatus,
3604
+ K as PackageTabType,
3605
+ re as PaymentMethodFeeType,
3606
+ ne as ProductStatus,
3607
+ ie as ProductType,
3608
+ oe as ShopTemplateType,
3609
+ ce as ShopVariationType,
3610
+ te as SortOrder,
3611
+ an as TicketappSDK
3447
3612
  };