@ticketapp-dev/shop-sdk 1.0.29 → 1.0.31

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,91 +1,90 @@
1
- import { GraphQLClient as de } from "graphql-request";
2
- import { createSlice as Qe, configureStore as Je } from "@reduxjs/toolkit";
3
- import { DateTime as R } from "luxon";
4
- var _ = /* @__PURE__ */ ((e) => (e.PACKAGE = "PACKAGE", e.PRODUCT = "PRODUCT", e.ADD_ONS = "ADD_ONS", e.DELIVERY = "DELIVERY", e.PICKUP = "PICKUP", e))(_ || {}), Q = /* @__PURE__ */ ((e) => (e.AdditionalEvent = "ADDITIONAL_EVENT", e.Addon = "ADDON", e.Regular = "REGULAR", e))(Q || {}), De = /* @__PURE__ */ ((e) => (e.Active = "ACTIVE", e.Concept = "CONCEPT", e.Paused = "PAUSED", e.SoldOut = "SOLD_OUT", e))(De || {}), xe = /* @__PURE__ */ ((e) => (e.Active = "ACTIVE", e.Inactive = "INACTIVE", e))(xe || {}), Ne = /* @__PURE__ */ ((e) => (e.Active = "ACTIVE", e.Inactive = "INACTIVE", e.Paused = "PAUSED", e.SoldOut = "SOLD_OUT", e))(Ne || {}), Pe = /* @__PURE__ */ ((e) => (e.Asc = "ASC", e.Desc = "DESC", e))(Pe || {}), be = /* @__PURE__ */ ((e) => (e.AllReserved = "ALL_RESERVED", e.Available = "AVAILABLE", e.SoldOut = "SOLD_OUT", e))(be || {}), Se = /* @__PURE__ */ ((e) => (e.Addon = "ADDON", e.Delivery = "DELIVERY", e.Door = "DOOR", e.Friend = "FRIEND", e.Guest = "GUEST", e.Pickup = "PICKUP", e.Promoter = "PROMOTER", e.Ticket = "TICKET", e))(Se || {}), Ce = /* @__PURE__ */ ((e) => (e.FIXED = "FIXED", e.PERCENTAGE = "PERCENTAGE", e))(Ce || {}), _e = /* @__PURE__ */ ((e) => (e.AddOn = "ADD_ON", e.DeliveryOption = "DELIVERY_OPTION", e.EntranceTicket = "ENTRANCE_TICKET", e))(_e || {}), Le = /* @__PURE__ */ ((e) => (e.Fixed = "FIXED", e.Percentage = "PERCENTAGE", e))(Le || {}), J = /* @__PURE__ */ ((e) => (e.Event = "EVENT", e.Package = "PACKAGE", e))(J || {});
5
- const Xe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1
+ import { GraphQLClient as oe } from "graphql-request";
2
+ import { DateTime as L } from "luxon";
3
+ var _ = /* @__PURE__ */ ((e) => (e.PACKAGE = "PACKAGE", e.PRODUCT = "PRODUCT", e.ADD_ONS = "ADD_ONS", e.DELIVERY = "DELIVERY", e.PICKUP = "PICKUP", e))(_ || {}), H = /* @__PURE__ */ ((e) => (e.AdditionalEvent = "ADDITIONAL_EVENT", e.Addon = "ADDON", e.Regular = "REGULAR", e))(H || {}), Ee = /* @__PURE__ */ ((e) => (e.Active = "ACTIVE", e.Concept = "CONCEPT", e.Paused = "PAUSED", e.SoldOut = "SOLD_OUT", e))(Ee || {}), ye = /* @__PURE__ */ ((e) => (e.Active = "ACTIVE", e.Inactive = "INACTIVE", e))(ye || {}), ve = /* @__PURE__ */ ((e) => (e.Active = "ACTIVE", e.Inactive = "INACTIVE", e.Paused = "PAUSED", e.SoldOut = "SOLD_OUT", e))(ve || {}), Te = /* @__PURE__ */ ((e) => (e.Asc = "ASC", e.Desc = "DESC", e))(Te || {}), Ae = /* @__PURE__ */ ((e) => (e.AllReserved = "ALL_RESERVED", e.Available = "AVAILABLE", e.SoldOut = "SOLD_OUT", e))(Ae || {}), ke = /* @__PURE__ */ ((e) => (e.Addon = "ADDON", e.Delivery = "DELIVERY", e.Door = "DOOR", e.Friend = "FRIEND", e.Guest = "GUEST", e.Pickup = "PICKUP", e.Promoter = "PROMOTER", e.Ticket = "TICKET", e))(ke || {}), Oe = /* @__PURE__ */ ((e) => (e.FIXED = "FIXED", e.PERCENTAGE = "PERCENTAGE", e))(Oe || {}), De = /* @__PURE__ */ ((e) => (e.AddOn = "ADD_ON", e.DeliveryOption = "DELIVERY_OPTION", e.EntranceTicket = "ENTRANCE_TICKET", e))(De || {}), Ne = /* @__PURE__ */ ((e) => (e.Fixed = "FIXED", e.Percentage = "PERCENTAGE", e))(Ne || {}), Y = /* @__PURE__ */ ((e) => (e.Event = "EVENT", e.Package = "PACKAGE", e))(Y || {});
4
+ const Ue = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
6
5
  __proto__: null,
7
6
  BasketOrderType: _,
8
- DiscountType: Le,
9
- EventStatus: Ne,
10
- MetricsType: J,
11
- OrderItemType: _e,
12
- PackageItemType: Q,
13
- PackageStatus: De,
14
- PackageTabType: xe,
15
- PaymentMethodFeeType: Ce,
16
- ProductStatus: be,
17
- ProductType: Se,
18
- SortOrder: Pe
7
+ DiscountType: Ne,
8
+ EventStatus: ve,
9
+ MetricsType: Y,
10
+ OrderItemType: De,
11
+ PackageItemType: H,
12
+ PackageStatus: Ee,
13
+ PackageTabType: ye,
14
+ PaymentMethodFeeType: Oe,
15
+ ProductStatus: Ae,
16
+ ProductType: ke,
17
+ SortOrder: Te
19
18
  }, Symbol.toStringTag, { value: "Module" }));
20
- var X = function() {
21
- return X = Object.assign || function(t) {
22
- for (var n, r = 1, i = arguments.length; r < i; r++) {
23
- n = arguments[r];
19
+ var Q = function() {
20
+ return Q = Object.assign || function(t) {
21
+ for (var n, i = 1, r = arguments.length; i < r; i++) {
22
+ n = arguments[i];
24
23
  for (var s in n) Object.prototype.hasOwnProperty.call(n, s) && (t[s] = n[s]);
25
24
  }
26
25
  return t;
27
- }, X.apply(this, arguments);
26
+ }, Q.apply(this, arguments);
28
27
  };
29
- function G(e, t) {
28
+ function z(e, t) {
30
29
  if (!!!e)
31
30
  throw new Error(t);
32
31
  }
33
- function Ke(e) {
32
+ function Me(e) {
34
33
  return typeof e == "object" && e !== null;
35
34
  }
36
- function We(e, t) {
35
+ function qe(e, t) {
37
36
  if (!!!e)
38
37
  throw new Error(
39
38
  "Unexpected invariant triggered."
40
39
  );
41
40
  }
42
- const Ze = /\r\n|[\n\r]/g;
43
- function se(e, t) {
44
- let n = 0, r = 1;
45
- for (const i of e.body.matchAll(Ze)) {
46
- if (typeof i.index == "number" || We(!1), i.index >= t)
41
+ const ze = /\r\n|[\n\r]/g;
42
+ function ie(e, t) {
43
+ let n = 0, i = 1;
44
+ for (const r of e.body.matchAll(ze)) {
45
+ if (typeof r.index == "number" || qe(!1), r.index >= t)
47
46
  break;
48
- n = i.index + i[0].length, r += 1;
47
+ n = r.index + r[0].length, i += 1;
49
48
  }
50
49
  return {
51
- line: r,
50
+ line: i,
52
51
  column: t + 1 - n
53
52
  };
54
53
  }
55
- function et(e) {
56
- return Re(
54
+ function je(e) {
55
+ return be(
57
56
  e.source,
58
- se(e.source, e.start)
57
+ ie(e.source, e.start)
59
58
  );
60
59
  }
61
- function Re(e, t) {
62
- const n = e.locationOffset.column - 1, r = "".padStart(n) + e.body, i = t.line - 1, s = e.locationOffset.line - 1, o = t.line + s, u = t.line === 1 ? n : 0, h = t.column + u, p = `${e.name}:${o}:${h}
63
- `, c = r.split(/\r\n|[\n\r]/g), m = c[i];
64
- if (m.length > 120) {
65
- const g = Math.floor(h / 80), y = h % 80, I = [];
66
- for (let O = 0; O < m.length; O += 80)
67
- I.push(m.slice(O, O + 80));
68
- return p + he([
60
+ function be(e, t) {
61
+ const n = e.locationOffset.column - 1, i = "".padStart(n) + e.body, r = t.line - 1, s = e.locationOffset.line - 1, o = t.line + s, l = t.line === 1 ? n : 0, f = t.column + l, p = `${e.name}:${o}:${f}
62
+ `, g = i.split(/\r\n|[\n\r]/g), d = g[r];
63
+ if (d.length > 120) {
64
+ const m = Math.floor(f / 80), y = f % 80, I = [];
65
+ for (let D = 0; D < d.length; D += 80)
66
+ I.push(d.slice(D, D + 80));
67
+ return p + le([
69
68
  [`${o} |`, I[0]],
70
- ...I.slice(1, g + 1).map((O) => ["|", O]),
69
+ ...I.slice(1, m + 1).map((D) => ["|", D]),
71
70
  ["|", "^".padStart(y)],
72
- ["|", I[g + 1]]
71
+ ["|", I[m + 1]]
73
72
  ]);
74
73
  }
75
- return p + he([
74
+ return p + le([
76
75
  // Lines specified like this: ["prefix", "string"],
77
- [`${o - 1} |`, c[i - 1]],
78
- [`${o} |`, m],
79
- ["|", "^".padStart(h)],
80
- [`${o + 1} |`, c[i + 1]]
76
+ [`${o - 1} |`, g[r - 1]],
77
+ [`${o} |`, d],
78
+ ["|", "^".padStart(f)],
79
+ [`${o + 1} |`, g[r + 1]]
81
80
  ]);
82
81
  }
83
- function he(e) {
84
- const t = e.filter(([r, i]) => i !== void 0), n = Math.max(...t.map(([r]) => r.length));
85
- return t.map(([r, i]) => r.padStart(n) + (i ? " " + i : "")).join(`
82
+ function le(e) {
83
+ const t = e.filter(([i, r]) => r !== void 0), n = Math.max(...t.map(([i]) => i.length));
84
+ return t.map(([i, r]) => i.padStart(n) + (r ? " " + r : "")).join(`
86
85
  `);
87
86
  }
88
- function tt(e) {
87
+ function Ge(e) {
89
88
  const t = e[0];
90
89
  return t == null || "kind" in t || "length" in t ? {
91
90
  nodes: t,
@@ -96,7 +95,7 @@ function tt(e) {
96
95
  extensions: e[5]
97
96
  } : t;
98
97
  }
99
- class ue extends Error {
98
+ class ce extends Error {
100
99
  /**
101
100
  * An array of `{ line, column }` locations within the source GraphQL document
102
101
  * which correspond to this error.
@@ -136,19 +135,19 @@ class ue extends Error {
136
135
  * @deprecated Please use the `GraphQLErrorOptions` constructor overload instead.
137
136
  */
138
137
  constructor(t, ...n) {
139
- var r, i, s;
140
- const { nodes: o, source: u, positions: h, path: p, originalError: c, extensions: m } = tt(n);
141
- super(t), this.name = "GraphQLError", this.path = p ?? void 0, this.originalError = c ?? void 0, this.nodes = fe(
138
+ var i, r, s;
139
+ const { nodes: o, source: l, positions: f, path: p, originalError: g, extensions: d } = Ge(n);
140
+ super(t), this.name = "GraphQLError", this.path = p ?? void 0, this.originalError = g ?? void 0, this.nodes = pe(
142
141
  Array.isArray(o) ? o : o ? [o] : void 0
143
142
  );
144
- const g = fe(
145
- (r = this.nodes) === null || r === void 0 ? void 0 : r.map((I) => I.loc).filter((I) => I != null)
143
+ const m = pe(
144
+ (i = this.nodes) === null || i === void 0 ? void 0 : i.map((I) => I.loc).filter((I) => I != null)
146
145
  );
147
- this.source = u ?? (g == null || (i = g[0]) === null || i === void 0 ? void 0 : i.source), this.positions = h ?? g?.map((I) => I.start), this.locations = h && u ? h.map((I) => se(u, I)) : g?.map((I) => se(I.source, I.start));
148
- const y = Ke(
149
- c?.extensions
150
- ) ? c?.extensions : void 0;
151
- this.extensions = (s = m ?? y) !== null && s !== void 0 ? s : /* @__PURE__ */ Object.create(null), Object.defineProperties(this, {
146
+ this.source = l ?? (m == null || (r = m[0]) === null || r === void 0 ? void 0 : r.source), this.positions = f ?? m?.map((I) => I.start), this.locations = f && l ? f.map((I) => ie(l, I)) : m?.map((I) => ie(I.source, I.start));
147
+ const y = Me(
148
+ g?.extensions
149
+ ) ? g?.extensions : void 0;
150
+ this.extensions = (s = d ?? y) !== null && s !== void 0 ? s : /* @__PURE__ */ Object.create(null), Object.defineProperties(this, {
152
151
  message: {
153
152
  writable: !0,
154
153
  enumerable: !0
@@ -168,11 +167,11 @@ class ue extends Error {
168
167
  originalError: {
169
168
  enumerable: !1
170
169
  }
171
- }), c != null && c.stack ? Object.defineProperty(this, "stack", {
172
- value: c.stack,
170
+ }), g != null && g.stack ? Object.defineProperty(this, "stack", {
171
+ value: g.stack,
173
172
  writable: !0,
174
173
  configurable: !0
175
- }) : Error.captureStackTrace ? Error.captureStackTrace(this, ue) : Object.defineProperty(this, "stack", {
174
+ }) : Error.captureStackTrace ? Error.captureStackTrace(this, ce) : Object.defineProperty(this, "stack", {
176
175
  value: Error().stack,
177
176
  writable: !0,
178
177
  configurable: !0
@@ -187,12 +186,12 @@ class ue extends Error {
187
186
  for (const n of this.nodes)
188
187
  n.loc && (t += `
189
188
 
190
- ` + et(n.loc));
189
+ ` + je(n.loc));
191
190
  else if (this.source && this.locations)
192
191
  for (const n of this.locations)
193
192
  t += `
194
193
 
195
- ` + Re(this.source, n);
194
+ ` + be(this.source, n);
196
195
  return t;
197
196
  }
198
197
  toJSON() {
@@ -202,16 +201,16 @@ class ue extends Error {
202
201
  return this.locations != null && (t.locations = this.locations), this.path != null && (t.path = this.path), this.extensions != null && Object.keys(this.extensions).length > 0 && (t.extensions = this.extensions), t;
203
202
  }
204
203
  }
205
- function fe(e) {
204
+ function pe(e) {
206
205
  return e === void 0 || e.length === 0 ? void 0 : e;
207
206
  }
208
- function k(e, t, n) {
209
- return new ue(`Syntax Error: ${n}`, {
207
+ function T(e, t, n) {
208
+ return new ce(`Syntax Error: ${n}`, {
210
209
  source: e,
211
210
  positions: [t]
212
211
  });
213
212
  }
214
- class nt {
213
+ class He {
215
214
  /**
216
215
  * The character offset at which this Node begins.
217
216
  */
@@ -227,8 +226,8 @@ class nt {
227
226
  /**
228
227
  * The Source document the AST represents.
229
228
  */
230
- constructor(t, n, r) {
231
- this.start = t.start, this.end = n.end, this.startToken = t, this.endToken = n, this.source = r;
229
+ constructor(t, n, i) {
230
+ this.start = t.start, this.end = n.end, this.startToken = t, this.endToken = n, this.source = i;
232
231
  }
233
232
  get [Symbol.toStringTag]() {
234
233
  return "Location";
@@ -240,7 +239,7 @@ class nt {
240
239
  };
241
240
  }
242
241
  }
243
- class Fe {
242
+ class xe {
244
243
  /**
245
244
  * The kind of Token.
246
245
  */
@@ -267,8 +266,8 @@ class Fe {
267
266
  * including ignored tokens. <SOF> is always the first node and <EOF>
268
267
  * the last.
269
268
  */
270
- constructor(t, n, r, i, s, o) {
271
- this.kind = t, this.start = n, this.end = r, this.line = i, this.column = s, this.value = o, this.prev = null, this.next = null;
269
+ constructor(t, n, i, r, s, o) {
270
+ this.kind = t, this.start = n, this.end = i, this.line = r, this.column = s, this.value = o, this.prev = null, this.next = null;
272
271
  }
273
272
  get [Symbol.toStringTag]() {
274
273
  return "Token";
@@ -282,7 +281,7 @@ class Fe {
282
281
  };
283
282
  }
284
283
  }
285
- const we = {
284
+ const Pe = {
286
285
  Name: [],
287
286
  Document: ["definitions"],
288
287
  OperationDefinition: [
@@ -369,74 +368,74 @@ const we = {
369
368
  ArgumentCoordinate: ["name", "fieldName", "argumentName"],
370
369
  DirectiveCoordinate: ["name"],
371
370
  DirectiveArgumentCoordinate: ["name", "argumentName"]
372
- }, rt = new Set(Object.keys(we));
373
- function me(e) {
371
+ }, Ye = new Set(Object.keys(Pe));
372
+ function he(e) {
374
373
  const t = e?.kind;
375
- return typeof t == "string" && rt.has(t);
374
+ return typeof t == "string" && Ye.has(t);
376
375
  }
377
376
  var w;
378
377
  (function(e) {
379
378
  e.QUERY = "query", e.MUTATION = "mutation", e.SUBSCRIPTION = "subscription";
380
379
  })(w || (w = {}));
381
- var oe;
380
+ var re;
382
381
  (function(e) {
383
382
  e.QUERY = "QUERY", e.MUTATION = "MUTATION", e.SUBSCRIPTION = "SUBSCRIPTION", e.FIELD = "FIELD", e.FRAGMENT_DEFINITION = "FRAGMENT_DEFINITION", e.FRAGMENT_SPREAD = "FRAGMENT_SPREAD", e.INLINE_FRAGMENT = "INLINE_FRAGMENT", e.VARIABLE_DEFINITION = "VARIABLE_DEFINITION", e.SCHEMA = "SCHEMA", e.SCALAR = "SCALAR", e.OBJECT = "OBJECT", e.FIELD_DEFINITION = "FIELD_DEFINITION", e.ARGUMENT_DEFINITION = "ARGUMENT_DEFINITION", e.INTERFACE = "INTERFACE", e.UNION = "UNION", e.ENUM = "ENUM", e.ENUM_VALUE = "ENUM_VALUE", e.INPUT_OBJECT = "INPUT_OBJECT", e.INPUT_FIELD_DEFINITION = "INPUT_FIELD_DEFINITION";
384
- })(oe || (oe = {}));
385
- var l;
383
+ })(re || (re = {}));
384
+ var u;
386
385
  (function(e) {
387
386
  e.NAME = "Name", e.DOCUMENT = "Document", e.OPERATION_DEFINITION = "OperationDefinition", e.VARIABLE_DEFINITION = "VariableDefinition", e.SELECTION_SET = "SelectionSet", e.FIELD = "Field", e.ARGUMENT = "Argument", e.FRAGMENT_SPREAD = "FragmentSpread", e.INLINE_FRAGMENT = "InlineFragment", e.FRAGMENT_DEFINITION = "FragmentDefinition", e.VARIABLE = "Variable", e.INT = "IntValue", e.FLOAT = "FloatValue", e.STRING = "StringValue", e.BOOLEAN = "BooleanValue", e.NULL = "NullValue", e.ENUM = "EnumValue", e.LIST = "ListValue", e.OBJECT = "ObjectValue", e.OBJECT_FIELD = "ObjectField", e.DIRECTIVE = "Directive", e.NAMED_TYPE = "NamedType", e.LIST_TYPE = "ListType", e.NON_NULL_TYPE = "NonNullType", e.SCHEMA_DEFINITION = "SchemaDefinition", e.OPERATION_TYPE_DEFINITION = "OperationTypeDefinition", e.SCALAR_TYPE_DEFINITION = "ScalarTypeDefinition", e.OBJECT_TYPE_DEFINITION = "ObjectTypeDefinition", e.FIELD_DEFINITION = "FieldDefinition", e.INPUT_VALUE_DEFINITION = "InputValueDefinition", e.INTERFACE_TYPE_DEFINITION = "InterfaceTypeDefinition", e.UNION_TYPE_DEFINITION = "UnionTypeDefinition", e.ENUM_TYPE_DEFINITION = "EnumTypeDefinition", e.ENUM_VALUE_DEFINITION = "EnumValueDefinition", e.INPUT_OBJECT_TYPE_DEFINITION = "InputObjectTypeDefinition", e.DIRECTIVE_DEFINITION = "DirectiveDefinition", e.SCHEMA_EXTENSION = "SchemaExtension", e.SCALAR_TYPE_EXTENSION = "ScalarTypeExtension", e.OBJECT_TYPE_EXTENSION = "ObjectTypeExtension", e.INTERFACE_TYPE_EXTENSION = "InterfaceTypeExtension", e.UNION_TYPE_EXTENSION = "UnionTypeExtension", e.ENUM_TYPE_EXTENSION = "EnumTypeExtension", e.INPUT_OBJECT_TYPE_EXTENSION = "InputObjectTypeExtension", e.TYPE_COORDINATE = "TypeCoordinate", e.MEMBER_COORDINATE = "MemberCoordinate", e.ARGUMENT_COORDINATE = "ArgumentCoordinate", e.DIRECTIVE_COORDINATE = "DirectiveCoordinate", e.DIRECTIVE_ARGUMENT_COORDINATE = "DirectiveArgumentCoordinate";
388
- })(l || (l = {}));
389
- function ae(e) {
387
+ })(u || (u = {}));
388
+ function se(e) {
390
389
  return e === 9 || e === 32;
391
390
  }
392
- function M(e) {
391
+ function U(e) {
393
392
  return e >= 48 && e <= 57;
394
393
  }
395
- function $e(e) {
394
+ function Se(e) {
396
395
  return e >= 97 && e <= 122 || // A-Z
397
396
  e >= 65 && e <= 90;
398
397
  }
399
- function Be(e) {
400
- return $e(e) || e === 95;
398
+ function Ce(e) {
399
+ return Se(e) || e === 95;
401
400
  }
402
- function it(e) {
403
- return $e(e) || M(e) || e === 95;
401
+ function Qe(e) {
402
+ return Se(e) || U(e) || e === 95;
404
403
  }
405
- function st(e) {
404
+ function Je(e) {
406
405
  var t;
407
- let n = Number.MAX_SAFE_INTEGER, r = null, i = -1;
406
+ let n = Number.MAX_SAFE_INTEGER, i = null, r = -1;
408
407
  for (let o = 0; o < e.length; ++o) {
409
408
  var s;
410
- const u = e[o], h = ot(u);
411
- h !== u.length && (r = (s = r) !== null && s !== void 0 ? s : o, i = o, o !== 0 && h < n && (n = h));
409
+ const l = e[o], f = Xe(l);
410
+ f !== l.length && (i = (s = i) !== null && s !== void 0 ? s : o, r = o, o !== 0 && f < n && (n = f));
412
411
  }
413
- return e.map((o, u) => u === 0 ? o : o.slice(n)).slice(
414
- (t = r) !== null && t !== void 0 ? t : 0,
415
- i + 1
412
+ return e.map((o, l) => l === 0 ? o : o.slice(n)).slice(
413
+ (t = i) !== null && t !== void 0 ? t : 0,
414
+ r + 1
416
415
  );
417
416
  }
418
- function ot(e) {
417
+ function Xe(e) {
419
418
  let t = 0;
420
- for (; t < e.length && ae(e.charCodeAt(t)); )
419
+ for (; t < e.length && se(e.charCodeAt(t)); )
421
420
  ++t;
422
421
  return t;
423
422
  }
424
- function at(e, t) {
425
- const n = e.replace(/"""/g, '\\"""'), r = n.split(/\r\n|[\n\r]/g), i = r.length === 1, s = r.length > 1 && r.slice(1).every((y) => y.length === 0 || ae(y.charCodeAt(0))), o = n.endsWith('\\"""'), u = e.endsWith('"') && !o, h = e.endsWith("\\"), p = u || h, c = (
423
+ function We(e, t) {
424
+ const n = e.replace(/"""/g, '\\"""'), i = n.split(/\r\n|[\n\r]/g), r = i.length === 1, s = i.length > 1 && i.slice(1).every((y) => y.length === 0 || se(y.charCodeAt(0))), o = n.endsWith('\\"""'), l = e.endsWith('"') && !o, f = e.endsWith("\\"), p = l || f, g = (
426
425
  // add leading and trailing new lines only if it improves readability
427
- !i || e.length > 70 || p || s || o
426
+ !r || e.length > 70 || p || s || o
428
427
  );
429
- let m = "";
430
- const g = i && ae(e.charCodeAt(0));
431
- return (c && !g || s) && (m += `
432
- `), m += n, (c || p) && (m += `
433
- `), '"""' + m + '"""';
428
+ let d = "";
429
+ const m = r && se(e.charCodeAt(0));
430
+ return (g && !m || s) && (d += `
431
+ `), d += n, (g || p) && (d += `
432
+ `), '"""' + d + '"""';
434
433
  }
435
434
  var a;
436
435
  (function(e) {
437
436
  e.SOF = "<SOF>", e.EOF = "<EOF>", e.BANG = "!", e.DOLLAR = "$", e.AMP = "&", e.PAREN_L = "(", e.PAREN_R = ")", e.DOT = ".", e.SPREAD = "...", e.COLON = ":", e.EQUALS = "=", e.AT = "@", e.BRACKET_L = "[", e.BRACKET_R = "]", e.BRACE_L = "{", e.PIPE = "|", e.BRACE_R = "}", e.NAME = "Name", e.INT = "Int", e.FLOAT = "Float", e.STRING = "String", e.BLOCK_STRING = "BlockString", e.COMMENT = "Comment";
438
437
  })(a || (a = {}));
439
- class ct {
438
+ class Ze {
440
439
  /**
441
440
  * The previously focused non-ignored token.
442
441
  */
@@ -450,7 +449,7 @@ class ct {
450
449
  * The character offset at which the current line begins.
451
450
  */
452
451
  constructor(t) {
453
- const n = new Fe(a.SOF, 0, 0, 0, 0);
452
+ const n = new xe(a.SOF, 0, 0, 0, 0);
454
453
  this.source = t, this.lastToken = n, this.token = n, this.line = 1, this.lineStart = 0;
455
454
  }
456
455
  get [Symbol.toStringTag]() {
@@ -473,47 +472,47 @@ class ct {
473
472
  if (t.next)
474
473
  t = t.next;
475
474
  else {
476
- const n = ut(this, t.end);
475
+ const n = et(this, t.end);
477
476
  t.next = n, n.prev = t, t = n;
478
477
  }
479
478
  while (t.kind === a.COMMENT);
480
479
  return t;
481
480
  }
482
481
  }
483
- function dt(e) {
482
+ function Ke(e) {
484
483
  return e === a.BANG || e === a.DOLLAR || e === a.AMP || e === a.PAREN_L || e === a.PAREN_R || e === a.DOT || e === a.SPREAD || e === a.COLON || e === a.EQUALS || e === a.AT || e === a.BRACKET_L || e === a.BRACKET_R || e === a.BRACE_L || e === a.PIPE || e === a.BRACE_R;
485
484
  }
486
- function $(e) {
485
+ function F(e) {
487
486
  return e >= 0 && e <= 55295 || e >= 57344 && e <= 1114111;
488
487
  }
489
- function W(e, t) {
490
- return Ve(e.charCodeAt(t)) && Ue(e.charCodeAt(t + 1));
488
+ function X(e, t) {
489
+ return _e(e.charCodeAt(t)) && Le(e.charCodeAt(t + 1));
491
490
  }
492
- function Ve(e) {
491
+ function _e(e) {
493
492
  return e >= 55296 && e <= 56319;
494
493
  }
495
- function Ue(e) {
494
+ function Le(e) {
496
495
  return e >= 56320 && e <= 57343;
497
496
  }
498
- function F(e, t) {
497
+ function R(e, t) {
499
498
  const n = e.source.body.codePointAt(t);
500
499
  if (n === void 0)
501
500
  return a.EOF;
502
501
  if (n >= 32 && n <= 126) {
503
- const r = String.fromCodePoint(n);
504
- return r === '"' ? `'"'` : `"${r}"`;
502
+ const i = String.fromCodePoint(n);
503
+ return i === '"' ? `'"'` : `"${i}"`;
505
504
  }
506
505
  return "U+" + n.toString(16).toUpperCase().padStart(4, "0");
507
506
  }
508
- function v(e, t, n, r, i) {
507
+ function v(e, t, n, i, r) {
509
508
  const s = e.line, o = 1 + n - e.lineStart;
510
- return new Fe(t, n, r, s, o, i);
509
+ return new xe(t, n, i, s, o, r);
511
510
  }
512
- function ut(e, t) {
513
- const n = e.source.body, r = n.length;
514
- let i = t;
515
- for (; i < r; ) {
516
- const s = n.charCodeAt(i);
511
+ function et(e, t) {
512
+ const n = e.source.body, i = n.length;
513
+ let r = t;
514
+ for (; r < i; ) {
515
+ const s = n.charCodeAt(r);
517
516
  switch (s) {
518
517
  // Ignored ::
519
518
  // - UnicodeBOM
@@ -536,21 +535,21 @@ function ut(e, t) {
536
535
  case 32:
537
536
  // <space>
538
537
  case 44:
539
- ++i;
538
+ ++r;
540
539
  continue;
541
540
  // LineTerminator ::
542
541
  // - "New Line (U+000A)"
543
542
  // - "Carriage Return (U+000D)" [lookahead != "New Line (U+000A)"]
544
543
  // - "Carriage Return (U+000D)" "New Line (U+000A)"
545
544
  case 10:
546
- ++i, ++e.line, e.lineStart = i;
545
+ ++r, ++e.line, e.lineStart = r;
547
546
  continue;
548
547
  case 13:
549
- n.charCodeAt(i + 1) === 10 ? i += 2 : ++i, ++e.line, e.lineStart = i;
548
+ n.charCodeAt(r + 1) === 10 ? r += 2 : ++r, ++e.line, e.lineStart = r;
550
549
  continue;
551
550
  // Comment
552
551
  case 35:
553
- return lt(e, i);
552
+ return tt(e, r);
554
553
  // Token ::
555
554
  // - Punctuator
556
555
  // - Name
@@ -560,62 +559,62 @@ function ut(e, t) {
560
559
  //
561
560
  // Punctuator :: one of ! $ & ( ) ... : = @ [ ] { | }
562
561
  case 33:
563
- return v(e, a.BANG, i, i + 1);
562
+ return v(e, a.BANG, r, r + 1);
564
563
  case 36:
565
- return v(e, a.DOLLAR, i, i + 1);
564
+ return v(e, a.DOLLAR, r, r + 1);
566
565
  case 38:
567
- return v(e, a.AMP, i, i + 1);
566
+ return v(e, a.AMP, r, r + 1);
568
567
  case 40:
569
- return v(e, a.PAREN_L, i, i + 1);
568
+ return v(e, a.PAREN_L, r, r + 1);
570
569
  case 41:
571
- return v(e, a.PAREN_R, i, i + 1);
570
+ return v(e, a.PAREN_R, r, r + 1);
572
571
  case 46:
573
- if (n.charCodeAt(i + 1) === 46 && n.charCodeAt(i + 2) === 46)
574
- return v(e, a.SPREAD, i, i + 3);
572
+ if (n.charCodeAt(r + 1) === 46 && n.charCodeAt(r + 2) === 46)
573
+ return v(e, a.SPREAD, r, r + 3);
575
574
  break;
576
575
  case 58:
577
- return v(e, a.COLON, i, i + 1);
576
+ return v(e, a.COLON, r, r + 1);
578
577
  case 61:
579
- return v(e, a.EQUALS, i, i + 1);
578
+ return v(e, a.EQUALS, r, r + 1);
580
579
  case 64:
581
- return v(e, a.AT, i, i + 1);
580
+ return v(e, a.AT, r, r + 1);
582
581
  case 91:
583
- return v(e, a.BRACKET_L, i, i + 1);
582
+ return v(e, a.BRACKET_L, r, r + 1);
584
583
  case 93:
585
- return v(e, a.BRACKET_R, i, i + 1);
584
+ return v(e, a.BRACKET_R, r, r + 1);
586
585
  case 123:
587
- return v(e, a.BRACE_L, i, i + 1);
586
+ return v(e, a.BRACE_L, r, r + 1);
588
587
  case 124:
589
- return v(e, a.PIPE, i, i + 1);
588
+ return v(e, a.PIPE, r, r + 1);
590
589
  case 125:
591
- return v(e, a.BRACE_R, i, i + 1);
590
+ return v(e, a.BRACE_R, r, r + 1);
592
591
  // StringValue
593
592
  case 34:
594
- return n.charCodeAt(i + 1) === 34 && n.charCodeAt(i + 2) === 34 ? It(e, i) : ht(e, i);
593
+ return n.charCodeAt(r + 1) === 34 && n.charCodeAt(r + 2) === 34 ? ot(e, r) : it(e, r);
595
594
  }
596
- if (M(s) || s === 45)
597
- return pt(e, i, s);
598
- if (Be(s))
599
- return Et(e, i);
600
- throw k(
595
+ if (U(s) || s === 45)
596
+ return nt(e, r, s);
597
+ if (Ce(s))
598
+ return ct(e, r);
599
+ throw T(
601
600
  e.source,
602
- i,
603
- s === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : $(s) || W(n, i) ? `Unexpected character: ${F(e, i)}.` : `Invalid character: ${F(e, i)}.`
601
+ r,
602
+ s === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : F(s) || X(n, r) ? `Unexpected character: ${R(e, r)}.` : `Invalid character: ${R(e, r)}.`
604
603
  );
605
604
  }
606
- return v(e, a.EOF, r, r);
605
+ return v(e, a.EOF, i, i);
607
606
  }
608
- function lt(e, t) {
609
- const n = e.source.body, r = n.length;
610
- let i = t + 1;
611
- for (; i < r; ) {
612
- const s = n.charCodeAt(i);
607
+ function tt(e, t) {
608
+ const n = e.source.body, i = n.length;
609
+ let r = t + 1;
610
+ for (; r < i; ) {
611
+ const s = n.charCodeAt(r);
613
612
  if (s === 10 || s === 13)
614
613
  break;
615
- if ($(s))
616
- ++i;
617
- else if (W(n, i))
618
- i += 2;
614
+ if (F(s))
615
+ ++r;
616
+ else if (X(n, r))
617
+ r += 2;
619
618
  else
620
619
  break;
621
620
  }
@@ -623,142 +622,142 @@ function lt(e, t) {
623
622
  e,
624
623
  a.COMMENT,
625
624
  t,
626
- i,
627
- n.slice(t + 1, i)
625
+ r,
626
+ n.slice(t + 1, r)
628
627
  );
629
628
  }
630
- function pt(e, t, n) {
631
- const r = e.source.body;
632
- let i = t, s = n, o = !1;
633
- if (s === 45 && (s = r.charCodeAt(++i)), s === 48) {
634
- if (s = r.charCodeAt(++i), M(s))
635
- throw k(
629
+ function nt(e, t, n) {
630
+ const i = e.source.body;
631
+ let r = t, s = n, o = !1;
632
+ if (s === 45 && (s = i.charCodeAt(++r)), s === 48) {
633
+ if (s = i.charCodeAt(++r), U(s))
634
+ throw T(
636
635
  e.source,
637
- i,
638
- `Invalid number, unexpected digit after 0: ${F(
636
+ r,
637
+ `Invalid number, unexpected digit after 0: ${R(
639
638
  e,
640
- i
639
+ r
641
640
  )}.`
642
641
  );
643
642
  } else
644
- i = ne(e, i, s), s = r.charCodeAt(i);
645
- if (s === 46 && (o = !0, s = r.charCodeAt(++i), i = ne(e, i, s), s = r.charCodeAt(i)), (s === 69 || s === 101) && (o = !0, s = r.charCodeAt(++i), (s === 43 || s === 45) && (s = r.charCodeAt(++i)), i = ne(e, i, s), s = r.charCodeAt(i)), s === 46 || Be(s))
646
- throw k(
643
+ r = ee(e, r, s), s = i.charCodeAt(r);
644
+ if (s === 46 && (o = !0, s = i.charCodeAt(++r), r = ee(e, 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 = ee(e, r, s), s = i.charCodeAt(r)), s === 46 || Ce(s))
645
+ throw T(
647
646
  e.source,
648
- i,
649
- `Invalid number, expected digit but got: ${F(
647
+ r,
648
+ `Invalid number, expected digit but got: ${R(
650
649
  e,
651
- i
650
+ r
652
651
  )}.`
653
652
  );
654
653
  return v(
655
654
  e,
656
655
  o ? a.FLOAT : a.INT,
657
656
  t,
658
- i,
659
- r.slice(t, i)
657
+ r,
658
+ i.slice(t, r)
660
659
  );
661
660
  }
662
- function ne(e, t, n) {
663
- if (!M(n))
664
- throw k(
661
+ function ee(e, t, n) {
662
+ if (!U(n))
663
+ throw T(
665
664
  e.source,
666
665
  t,
667
- `Invalid number, expected digit but got: ${F(
666
+ `Invalid number, expected digit but got: ${R(
668
667
  e,
669
668
  t
670
669
  )}.`
671
670
  );
672
- const r = e.source.body;
673
- let i = t + 1;
674
- for (; M(r.charCodeAt(i)); )
675
- ++i;
676
- return i;
677
- }
678
- function ht(e, t) {
679
- const n = e.source.body, r = n.length;
680
- let i = t + 1, s = i, o = "";
681
- for (; i < r; ) {
682
- const u = n.charCodeAt(i);
683
- if (u === 34)
684
- return o += n.slice(s, i), v(e, a.STRING, t, i + 1, o);
685
- if (u === 92) {
686
- o += n.slice(s, i);
687
- const h = n.charCodeAt(i + 1) === 117 ? n.charCodeAt(i + 2) === 123 ? ft(e, i) : mt(e, i) : gt(e, i);
688
- o += h.value, i += h.size, s = i;
671
+ const i = e.source.body;
672
+ let r = t + 1;
673
+ for (; U(i.charCodeAt(r)); )
674
+ ++r;
675
+ return r;
676
+ }
677
+ function it(e, t) {
678
+ const n = e.source.body, i = n.length;
679
+ let r = t + 1, s = r, o = "";
680
+ for (; r < i; ) {
681
+ const l = n.charCodeAt(r);
682
+ if (l === 34)
683
+ return o += n.slice(s, r), v(e, a.STRING, t, r + 1, o);
684
+ if (l === 92) {
685
+ o += n.slice(s, r);
686
+ const f = n.charCodeAt(r + 1) === 117 ? n.charCodeAt(r + 2) === 123 ? rt(e, r) : st(e, r) : at(e, r);
687
+ o += f.value, r += f.size, s = r;
689
688
  continue;
690
689
  }
691
- if (u === 10 || u === 13)
690
+ if (l === 10 || l === 13)
692
691
  break;
693
- if ($(u))
694
- ++i;
695
- else if (W(n, i))
696
- i += 2;
692
+ if (F(l))
693
+ ++r;
694
+ else if (X(n, r))
695
+ r += 2;
697
696
  else
698
- throw k(
697
+ throw T(
699
698
  e.source,
700
- i,
701
- `Invalid character within String: ${F(
699
+ r,
700
+ `Invalid character within String: ${R(
702
701
  e,
703
- i
702
+ r
704
703
  )}.`
705
704
  );
706
705
  }
707
- throw k(e.source, i, "Unterminated string.");
706
+ throw T(e.source, r, "Unterminated string.");
708
707
  }
709
- function ft(e, t) {
708
+ function rt(e, t) {
710
709
  const n = e.source.body;
711
- let r = 0, i = 3;
712
- for (; i < 12; ) {
713
- const s = n.charCodeAt(t + i++);
710
+ let i = 0, r = 3;
711
+ for (; r < 12; ) {
712
+ const s = n.charCodeAt(t + r++);
714
713
  if (s === 125) {
715
- if (i < 5 || !$(r))
714
+ if (r < 5 || !F(i))
716
715
  break;
717
716
  return {
718
- value: String.fromCodePoint(r),
719
- size: i
717
+ value: String.fromCodePoint(i),
718
+ size: r
720
719
  };
721
720
  }
722
- if (r = r << 4 | U(s), r < 0)
721
+ if (i = i << 4 | V(s), i < 0)
723
722
  break;
724
723
  }
725
- throw k(
724
+ throw T(
726
725
  e.source,
727
726
  t,
728
727
  `Invalid Unicode escape sequence: "${n.slice(
729
728
  t,
730
- t + i
729
+ t + r
731
730
  )}".`
732
731
  );
733
732
  }
734
- function mt(e, t) {
735
- const n = e.source.body, r = ge(n, t + 2);
736
- if ($(r))
733
+ function st(e, t) {
734
+ const n = e.source.body, i = fe(n, t + 2);
735
+ if (F(i))
737
736
  return {
738
- value: String.fromCodePoint(r),
737
+ value: String.fromCodePoint(i),
739
738
  size: 6
740
739
  };
741
- if (Ve(r) && n.charCodeAt(t + 6) === 92 && n.charCodeAt(t + 7) === 117) {
742
- const i = ge(n, t + 8);
743
- if (Ue(i))
740
+ if (_e(i) && n.charCodeAt(t + 6) === 92 && n.charCodeAt(t + 7) === 117) {
741
+ const r = fe(n, t + 8);
742
+ if (Le(r))
744
743
  return {
745
- value: String.fromCodePoint(r, i),
744
+ value: String.fromCodePoint(i, r),
746
745
  size: 12
747
746
  };
748
747
  }
749
- throw k(
748
+ throw T(
750
749
  e.source,
751
750
  t,
752
751
  `Invalid Unicode escape sequence: "${n.slice(t, t + 6)}".`
753
752
  );
754
753
  }
755
- function ge(e, t) {
756
- return U(e.charCodeAt(t)) << 12 | U(e.charCodeAt(t + 1)) << 8 | U(e.charCodeAt(t + 2)) << 4 | U(e.charCodeAt(t + 3));
754
+ function fe(e, t) {
755
+ return V(e.charCodeAt(t)) << 12 | V(e.charCodeAt(t + 1)) << 8 | V(e.charCodeAt(t + 2)) << 4 | V(e.charCodeAt(t + 3));
757
756
  }
758
- function U(e) {
757
+ function V(e) {
759
758
  return e >= 48 && e <= 57 ? e - 48 : e >= 65 && e <= 70 ? e - 55 : e >= 97 && e <= 102 ? e - 87 : -1;
760
759
  }
761
- function gt(e, t) {
760
+ function at(e, t) {
762
761
  const n = e.source.body;
763
762
  switch (n.charCodeAt(t + 1)) {
764
763
  case 34:
@@ -803,7 +802,7 @@ function gt(e, t) {
803
802
  size: 2
804
803
  };
805
804
  }
806
- throw k(
805
+ throw T(
807
806
  e.source,
808
807
  t,
809
808
  `Invalid character escape sequence: "${n.slice(
@@ -812,56 +811,56 @@ function gt(e, t) {
812
811
  )}".`
813
812
  );
814
813
  }
815
- function It(e, t) {
816
- const n = e.source.body, r = n.length;
817
- let i = e.lineStart, s = t + 3, o = s, u = "";
818
- const h = [];
819
- for (; s < r; ) {
814
+ function ot(e, t) {
815
+ const n = e.source.body, i = n.length;
816
+ let r = e.lineStart, s = t + 3, o = s, l = "";
817
+ const f = [];
818
+ for (; s < i; ) {
820
819
  const p = n.charCodeAt(s);
821
820
  if (p === 34 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34) {
822
- u += n.slice(o, s), h.push(u);
823
- const c = v(
821
+ l += n.slice(o, s), f.push(l);
822
+ const g = v(
824
823
  e,
825
824
  a.BLOCK_STRING,
826
825
  t,
827
826
  s + 3,
828
827
  // Return a string of the lines joined with U+000A.
829
- st(h).join(`
828
+ Je(f).join(`
830
829
  `)
831
830
  );
832
- return e.line += h.length - 1, e.lineStart = i, c;
831
+ return e.line += f.length - 1, e.lineStart = r, g;
833
832
  }
834
833
  if (p === 92 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34 && n.charCodeAt(s + 3) === 34) {
835
- u += n.slice(o, s), o = s + 1, s += 4;
834
+ l += n.slice(o, s), o = s + 1, s += 4;
836
835
  continue;
837
836
  }
838
837
  if (p === 10 || p === 13) {
839
- u += n.slice(o, s), h.push(u), p === 13 && n.charCodeAt(s + 1) === 10 ? s += 2 : ++s, u = "", o = s, i = s;
838
+ l += n.slice(o, s), f.push(l), p === 13 && n.charCodeAt(s + 1) === 10 ? s += 2 : ++s, l = "", o = s, r = s;
840
839
  continue;
841
840
  }
842
- if ($(p))
841
+ if (F(p))
843
842
  ++s;
844
- else if (W(n, s))
843
+ else if (X(n, s))
845
844
  s += 2;
846
845
  else
847
- throw k(
846
+ throw T(
848
847
  e.source,
849
848
  s,
850
- `Invalid character within String: ${F(
849
+ `Invalid character within String: ${R(
851
850
  e,
852
851
  s
853
852
  )}.`
854
853
  );
855
854
  }
856
- throw k(e.source, s, "Unterminated string.");
855
+ throw T(e.source, s, "Unterminated string.");
857
856
  }
858
- function Et(e, t) {
859
- const n = e.source.body, r = n.length;
860
- let i = t + 1;
861
- for (; i < r; ) {
862
- const s = n.charCodeAt(i);
863
- if (it(s))
864
- ++i;
857
+ function ct(e, t) {
858
+ const n = e.source.body, i = n.length;
859
+ let r = t + 1;
860
+ for (; r < i; ) {
861
+ const s = n.charCodeAt(r);
862
+ if (Qe(s))
863
+ ++r;
865
864
  else
866
865
  break;
867
866
  }
@@ -869,60 +868,60 @@ function Et(e, t) {
869
868
  e,
870
869
  a.NAME,
871
870
  t,
872
- i,
873
- n.slice(t, i)
871
+ r,
872
+ n.slice(t, r)
874
873
  );
875
874
  }
876
- const yt = 10, Me = 2;
877
- function le(e) {
878
- return Z(e, []);
875
+ const dt = 10, Re = 2;
876
+ function de(e) {
877
+ return W(e, []);
879
878
  }
880
- function Z(e, t) {
879
+ function W(e, t) {
881
880
  switch (typeof e) {
882
881
  case "string":
883
882
  return JSON.stringify(e);
884
883
  case "function":
885
884
  return e.name ? `[function ${e.name}]` : "[function]";
886
885
  case "object":
887
- return vt(e, t);
886
+ return ut(e, t);
888
887
  default:
889
888
  return String(e);
890
889
  }
891
890
  }
892
- function vt(e, t) {
891
+ function ut(e, t) {
893
892
  if (e === null)
894
893
  return "null";
895
894
  if (t.includes(e))
896
895
  return "[Circular]";
897
896
  const n = [...t, e];
898
- if (kt(e)) {
899
- const r = e.toJSON();
900
- if (r !== e)
901
- return typeof r == "string" ? r : Z(r, n);
897
+ if (lt(e)) {
898
+ const i = e.toJSON();
899
+ if (i !== e)
900
+ return typeof i == "string" ? i : W(i, n);
902
901
  } else if (Array.isArray(e))
903
- return Ot(e, n);
904
- return At(e, n);
902
+ return ht(e, n);
903
+ return pt(e, n);
905
904
  }
906
- function kt(e) {
905
+ function lt(e) {
907
906
  return typeof e.toJSON == "function";
908
907
  }
909
- function At(e, t) {
908
+ function pt(e, t) {
910
909
  const n = Object.entries(e);
911
- return n.length === 0 ? "{}" : t.length > Me ? "[" + Tt(e) + "]" : "{ " + n.map(
912
- ([i, s]) => i + ": " + Z(s, t)
910
+ return n.length === 0 ? "{}" : t.length > Re ? "[" + ft(e) + "]" : "{ " + n.map(
911
+ ([r, s]) => r + ": " + W(s, t)
913
912
  ).join(", ") + " }";
914
913
  }
915
- function Ot(e, t) {
914
+ function ht(e, t) {
916
915
  if (e.length === 0)
917
916
  return "[]";
918
- if (t.length > Me)
917
+ if (t.length > Re)
919
918
  return "[Array]";
920
- const n = Math.min(yt, e.length), r = e.length - n, i = [];
919
+ const n = Math.min(dt, e.length), i = e.length - n, r = [];
921
920
  for (let s = 0; s < n; ++s)
922
- i.push(Z(e[s], t));
923
- return r === 1 ? i.push("... 1 more item") : r > 1 && i.push(`... ${r} more items`), "[" + i.join(", ") + "]";
921
+ r.push(W(e[s], t));
922
+ return i === 1 ? r.push("... 1 more item") : i > 1 && r.push(`... ${i} more items`), "[" + r.join(", ") + "]";
924
923
  }
925
- function Tt(e) {
924
+ function ft(e) {
926
925
  const t = Object.prototype.toString.call(e).replace(/^\[object /, "").replace(/]$/, "");
927
926
  if (t === "Object" && typeof e.constructor == "function") {
928
927
  const n = e.constructor.name;
@@ -931,24 +930,24 @@ function Tt(e) {
931
930
  }
932
931
  return t;
933
932
  }
934
- const Dt = globalThis.process && // eslint-disable-next-line no-undef
935
- process.env.NODE_ENV === "production", xt = (
933
+ const mt = globalThis.process && // eslint-disable-next-line no-undef
934
+ process.env.NODE_ENV === "production", gt = (
936
935
  /* c8 ignore next 6 */
937
936
  // FIXME: https://github.com/graphql/graphql-js/issues/2317
938
- Dt ? function(t, n) {
937
+ mt ? function(t, n) {
939
938
  return t instanceof n;
940
939
  } : function(t, n) {
941
940
  if (t instanceof n)
942
941
  return !0;
943
942
  if (typeof t == "object" && t !== null) {
944
- var r;
945
- const i = n.prototype[Symbol.toStringTag], s = (
943
+ var i;
944
+ const r = n.prototype[Symbol.toStringTag], s = (
946
945
  // We still need to support constructor's name to detect conflicts with older versions of this library.
947
- Symbol.toStringTag in t ? t[Symbol.toStringTag] : (r = t.constructor) === null || r === void 0 ? void 0 : r.name
946
+ Symbol.toStringTag in t ? t[Symbol.toStringTag] : (i = t.constructor) === null || i === void 0 ? void 0 : i.name
948
947
  );
949
- if (i === s) {
950
- const o = le(t);
951
- throw new Error(`Cannot use ${i} "${o}" from another module or realm.
948
+ if (r === s) {
949
+ const o = de(t);
950
+ throw new Error(`Cannot use ${r} "${o}" from another module or realm.
952
951
 
953
952
  Ensure that there is only one instance of "graphql" in the node_modules
954
953
  directory. If different versions of "graphql" are the dependencies of other
@@ -965,15 +964,15 @@ spurious results.`);
965
964
  return !1;
966
965
  }
967
966
  );
968
- class qe {
969
- constructor(t, n = "GraphQL request", r = {
967
+ class we {
968
+ constructor(t, n = "GraphQL request", i = {
970
969
  line: 1,
971
970
  column: 1
972
971
  }) {
973
- typeof t == "string" || G(!1, `Body must be a string. Received: ${le(t)}.`), this.body = t, this.name = n, this.locationOffset = r, this.locationOffset.line > 0 || G(
972
+ typeof t == "string" || z(!1, `Body must be a string. Received: ${de(t)}.`), this.body = t, this.name = n, this.locationOffset = i, this.locationOffset.line > 0 || z(
974
973
  !1,
975
974
  "line in locationOffset is 1-indexed and must be positive."
976
- ), this.locationOffset.column > 0 || G(
975
+ ), this.locationOffset.column > 0 || z(
977
976
  !1,
978
977
  "column in locationOffset is 1-indexed and must be positive."
979
978
  );
@@ -982,26 +981,26 @@ class qe {
982
981
  return "Source";
983
982
  }
984
983
  }
985
- function Nt(e) {
986
- return xt(e, qe);
984
+ function It(e) {
985
+ return gt(e, we);
987
986
  }
988
- function Pt(e, t) {
989
- const n = new bt(e, t), r = n.parseDocument();
990
- return Object.defineProperty(r, "tokenCount", {
987
+ function Et(e, t) {
988
+ const n = new yt(e, t), i = n.parseDocument();
989
+ return Object.defineProperty(i, "tokenCount", {
991
990
  enumerable: !1,
992
991
  value: n.tokenCount
993
- }), r;
992
+ }), i;
994
993
  }
995
- class bt {
994
+ class yt {
996
995
  constructor(t, n = {}) {
997
- const { lexer: r, ...i } = n;
998
- if (r)
999
- this._lexer = r;
996
+ const { lexer: i, ...r } = n;
997
+ if (i)
998
+ this._lexer = i;
1000
999
  else {
1001
- const s = Nt(t) ? t : new qe(t);
1002
- this._lexer = new ct(s);
1000
+ const s = It(t) ? t : new we(t);
1001
+ this._lexer = new Ze(s);
1003
1002
  }
1004
- this._options = i, this._tokenCounter = 0;
1003
+ this._options = r, this._tokenCounter = 0;
1005
1004
  }
1006
1005
  get tokenCount() {
1007
1006
  return this._tokenCounter;
@@ -1012,7 +1011,7 @@ class bt {
1012
1011
  parseName() {
1013
1012
  const t = this.expectToken(a.NAME);
1014
1013
  return this.node(t, {
1015
- kind: l.NAME,
1014
+ kind: u.NAME,
1016
1015
  value: t.value
1017
1016
  });
1018
1017
  }
@@ -1022,7 +1021,7 @@ class bt {
1022
1021
  */
1023
1022
  parseDocument() {
1024
1023
  return this.node(this._lexer.token, {
1025
- kind: l.DOCUMENT,
1024
+ kind: u.DOCUMENT,
1026
1025
  definitions: this.many(
1027
1026
  a.SOF,
1028
1027
  this.parseDefinition,
@@ -1058,7 +1057,7 @@ class bt {
1058
1057
  return this.parseOperationDefinition();
1059
1058
  const t = this.peekDescription(), n = t ? this._lexer.lookahead() : this._lexer.token;
1060
1059
  if (t && n.kind === a.BRACE_L)
1061
- throw k(
1060
+ throw T(
1062
1061
  this._lexer.source,
1063
1062
  this._lexer.token.start,
1064
1063
  "Unexpected description, descriptions are not supported on shorthand queries."
@@ -1091,7 +1090,7 @@ class bt {
1091
1090
  return this.parseFragmentDefinition();
1092
1091
  }
1093
1092
  if (t)
1094
- throw k(
1093
+ throw T(
1095
1094
  this._lexer.source,
1096
1095
  this._lexer.token.start,
1097
1096
  "Unexpected description, only GraphQL definitions support descriptions."
@@ -1111,7 +1110,7 @@ class bt {
1111
1110
  const t = this._lexer.token;
1112
1111
  if (this.peek(a.BRACE_L))
1113
1112
  return this.node(t, {
1114
- kind: l.OPERATION_DEFINITION,
1113
+ kind: u.OPERATION_DEFINITION,
1115
1114
  operation: w.QUERY,
1116
1115
  description: void 0,
1117
1116
  name: void 0,
@@ -1119,13 +1118,13 @@ class bt {
1119
1118
  directives: [],
1120
1119
  selectionSet: this.parseSelectionSet()
1121
1120
  });
1122
- const n = this.parseDescription(), r = this.parseOperationType();
1123
- let i;
1124
- return this.peek(a.NAME) && (i = this.parseName()), this.node(t, {
1125
- kind: l.OPERATION_DEFINITION,
1126
- operation: r,
1121
+ const n = this.parseDescription(), i = this.parseOperationType();
1122
+ let r;
1123
+ return this.peek(a.NAME) && (r = this.parseName()), this.node(t, {
1124
+ kind: u.OPERATION_DEFINITION,
1125
+ operation: i,
1127
1126
  description: n,
1128
- name: i,
1127
+ name: r,
1129
1128
  variableDefinitions: this.parseVariableDefinitions(),
1130
1129
  directives: this.parseDirectives(!1),
1131
1130
  selectionSet: this.parseSelectionSet()
@@ -1161,7 +1160,7 @@ class bt {
1161
1160
  */
1162
1161
  parseVariableDefinition() {
1163
1162
  return this.node(this._lexer.token, {
1164
- kind: l.VARIABLE_DEFINITION,
1163
+ kind: u.VARIABLE_DEFINITION,
1165
1164
  description: this.parseDescription(),
1166
1165
  variable: this.parseVariable(),
1167
1166
  type: (this.expectToken(a.COLON), this.parseTypeReference()),
@@ -1175,7 +1174,7 @@ class bt {
1175
1174
  parseVariable() {
1176
1175
  const t = this._lexer.token;
1177
1176
  return this.expectToken(a.DOLLAR), this.node(t, {
1178
- kind: l.VARIABLE,
1177
+ kind: u.VARIABLE,
1179
1178
  name: this.parseName()
1180
1179
  });
1181
1180
  }
@@ -1186,7 +1185,7 @@ class bt {
1186
1185
  */
1187
1186
  parseSelectionSet() {
1188
1187
  return this.node(this._lexer.token, {
1189
- kind: l.SELECTION_SET,
1188
+ kind: u.SELECTION_SET,
1190
1189
  selections: this.many(
1191
1190
  a.BRACE_L,
1192
1191
  this.parseSelection,
@@ -1210,11 +1209,11 @@ class bt {
1210
1209
  */
1211
1210
  parseField() {
1212
1211
  const t = this._lexer.token, n = this.parseName();
1213
- let r, i;
1214
- return this.expectOptionalToken(a.COLON) ? (r = n, i = this.parseName()) : i = n, this.node(t, {
1215
- kind: l.FIELD,
1216
- alias: r,
1217
- name: i,
1212
+ let i, r;
1213
+ return this.expectOptionalToken(a.COLON) ? (i = n, r = this.parseName()) : r = n, this.node(t, {
1214
+ kind: u.FIELD,
1215
+ alias: i,
1216
+ name: r,
1218
1217
  arguments: this.parseArguments(!1),
1219
1218
  directives: this.parseDirectives(!1),
1220
1219
  selectionSet: this.peek(a.BRACE_L) ? this.parseSelectionSet() : void 0
@@ -1231,10 +1230,10 @@ class bt {
1231
1230
  * Argument[Const] : Name : Value[?Const]
1232
1231
  */
1233
1232
  parseArgument(t = !1) {
1234
- const n = this._lexer.token, r = this.parseName();
1233
+ const n = this._lexer.token, i = this.parseName();
1235
1234
  return this.expectToken(a.COLON), this.node(n, {
1236
- kind: l.ARGUMENT,
1237
- name: r,
1235
+ kind: u.ARGUMENT,
1236
+ name: i,
1238
1237
  value: this.parseValueLiteral(t)
1239
1238
  });
1240
1239
  }
@@ -1254,11 +1253,11 @@ class bt {
1254
1253
  this.expectToken(a.SPREAD);
1255
1254
  const n = this.expectOptionalKeyword("on");
1256
1255
  return !n && this.peek(a.NAME) ? this.node(t, {
1257
- kind: l.FRAGMENT_SPREAD,
1256
+ kind: u.FRAGMENT_SPREAD,
1258
1257
  name: this.parseFragmentName(),
1259
1258
  directives: this.parseDirectives(!1)
1260
1259
  }) : this.node(t, {
1261
- kind: l.INLINE_FRAGMENT,
1260
+ kind: u.INLINE_FRAGMENT,
1262
1261
  typeCondition: n ? this.parseNamedType() : void 0,
1263
1262
  directives: this.parseDirectives(!1),
1264
1263
  selectionSet: this.parseSelectionSet()
@@ -1273,7 +1272,7 @@ class bt {
1273
1272
  parseFragmentDefinition() {
1274
1273
  const t = this._lexer.token, n = this.parseDescription();
1275
1274
  return this.expectKeyword("fragment"), this._options.allowLegacyFragmentVariables === !0 ? this.node(t, {
1276
- kind: l.FRAGMENT_DEFINITION,
1275
+ kind: u.FRAGMENT_DEFINITION,
1277
1276
  description: n,
1278
1277
  name: this.parseFragmentName(),
1279
1278
  variableDefinitions: this.parseVariableDefinitions(),
@@ -1281,7 +1280,7 @@ class bt {
1281
1280
  directives: this.parseDirectives(!1),
1282
1281
  selectionSet: this.parseSelectionSet()
1283
1282
  }) : this.node(t, {
1284
- kind: l.FRAGMENT_DEFINITION,
1283
+ kind: u.FRAGMENT_DEFINITION,
1285
1284
  description: n,
1286
1285
  name: this.parseFragmentName(),
1287
1286
  typeCondition: (this.expectKeyword("on"), this.parseNamedType()),
@@ -1325,12 +1324,12 @@ class bt {
1325
1324
  return this.parseObject(t);
1326
1325
  case a.INT:
1327
1326
  return this.advanceLexer(), this.node(n, {
1328
- kind: l.INT,
1327
+ kind: u.INT,
1329
1328
  value: n.value
1330
1329
  });
1331
1330
  case a.FLOAT:
1332
1331
  return this.advanceLexer(), this.node(n, {
1333
- kind: l.FLOAT,
1332
+ kind: u.FLOAT,
1334
1333
  value: n.value
1335
1334
  });
1336
1335
  case a.STRING:
@@ -1340,32 +1339,32 @@ class bt {
1340
1339
  switch (this.advanceLexer(), n.value) {
1341
1340
  case "true":
1342
1341
  return this.node(n, {
1343
- kind: l.BOOLEAN,
1342
+ kind: u.BOOLEAN,
1344
1343
  value: !0
1345
1344
  });
1346
1345
  case "false":
1347
1346
  return this.node(n, {
1348
- kind: l.BOOLEAN,
1347
+ kind: u.BOOLEAN,
1349
1348
  value: !1
1350
1349
  });
1351
1350
  case "null":
1352
1351
  return this.node(n, {
1353
- kind: l.NULL
1352
+ kind: u.NULL
1354
1353
  });
1355
1354
  default:
1356
1355
  return this.node(n, {
1357
- kind: l.ENUM,
1356
+ kind: u.ENUM,
1358
1357
  value: n.value
1359
1358
  });
1360
1359
  }
1361
1360
  case a.DOLLAR:
1362
1361
  if (t)
1363
1362
  if (this.expectToken(a.DOLLAR), this._lexer.token.kind === a.NAME) {
1364
- const r = this._lexer.token.value;
1365
- throw k(
1363
+ const i = this._lexer.token.value;
1364
+ throw T(
1366
1365
  this._lexer.source,
1367
1366
  n.start,
1368
- `Unexpected variable "$${r}" in constant value.`
1367
+ `Unexpected variable "$${i}" in constant value.`
1369
1368
  );
1370
1369
  } else
1371
1370
  throw this.unexpected(n);
@@ -1380,7 +1379,7 @@ class bt {
1380
1379
  parseStringLiteral() {
1381
1380
  const t = this._lexer.token;
1382
1381
  return this.advanceLexer(), this.node(t, {
1383
- kind: l.STRING,
1382
+ kind: u.STRING,
1384
1383
  value: t.value,
1385
1384
  block: t.kind === a.BLOCK_STRING
1386
1385
  });
@@ -1393,7 +1392,7 @@ class bt {
1393
1392
  parseList(t) {
1394
1393
  const n = () => this.parseValueLiteral(t);
1395
1394
  return this.node(this._lexer.token, {
1396
- kind: l.LIST,
1395
+ kind: u.LIST,
1397
1396
  values: this.any(a.BRACKET_L, n, a.BRACKET_R)
1398
1397
  });
1399
1398
  }
@@ -1407,7 +1406,7 @@ class bt {
1407
1406
  parseObject(t) {
1408
1407
  const n = () => this.parseObjectField(t);
1409
1408
  return this.node(this._lexer.token, {
1410
- kind: l.OBJECT,
1409
+ kind: u.OBJECT,
1411
1410
  fields: this.any(a.BRACE_L, n, a.BRACE_R)
1412
1411
  });
1413
1412
  }
@@ -1415,10 +1414,10 @@ class bt {
1415
1414
  * ObjectField[Const] : Name : Value[?Const]
1416
1415
  */
1417
1416
  parseObjectField(t) {
1418
- const n = this._lexer.token, r = this.parseName();
1417
+ const n = this._lexer.token, i = this.parseName();
1419
1418
  return this.expectToken(a.COLON), this.node(n, {
1420
- kind: l.OBJECT_FIELD,
1421
- name: r,
1419
+ kind: u.OBJECT_FIELD,
1420
+ name: i,
1422
1421
  value: this.parseValueLiteral(t)
1423
1422
  });
1424
1423
  }
@@ -1443,7 +1442,7 @@ class bt {
1443
1442
  parseDirective(t) {
1444
1443
  const n = this._lexer.token;
1445
1444
  return this.expectToken(a.AT), this.node(n, {
1446
- kind: l.DIRECTIVE,
1445
+ kind: u.DIRECTIVE,
1447
1446
  name: this.parseName(),
1448
1447
  arguments: this.parseArguments(t)
1449
1448
  });
@@ -1459,15 +1458,15 @@ class bt {
1459
1458
  const t = this._lexer.token;
1460
1459
  let n;
1461
1460
  if (this.expectOptionalToken(a.BRACKET_L)) {
1462
- const r = this.parseTypeReference();
1461
+ const i = this.parseTypeReference();
1463
1462
  this.expectToken(a.BRACKET_R), n = this.node(t, {
1464
- kind: l.LIST_TYPE,
1465
- type: r
1463
+ kind: u.LIST_TYPE,
1464
+ type: i
1466
1465
  });
1467
1466
  } else
1468
1467
  n = this.parseNamedType();
1469
1468
  return this.expectOptionalToken(a.BANG) ? this.node(t, {
1470
- kind: l.NON_NULL_TYPE,
1469
+ kind: u.NON_NULL_TYPE,
1471
1470
  type: n
1472
1471
  }) : n;
1473
1472
  }
@@ -1476,7 +1475,7 @@ class bt {
1476
1475
  */
1477
1476
  parseNamedType() {
1478
1477
  return this.node(this._lexer.token, {
1479
- kind: l.NAMED_TYPE,
1478
+ kind: u.NAMED_TYPE,
1480
1479
  name: this.parseName()
1481
1480
  });
1482
1481
  }
@@ -1499,16 +1498,16 @@ class bt {
1499
1498
  parseSchemaDefinition() {
1500
1499
  const t = this._lexer.token, n = this.parseDescription();
1501
1500
  this.expectKeyword("schema");
1502
- const r = this.parseConstDirectives(), i = this.many(
1501
+ const i = this.parseConstDirectives(), r = this.many(
1503
1502
  a.BRACE_L,
1504
1503
  this.parseOperationTypeDefinition,
1505
1504
  a.BRACE_R
1506
1505
  );
1507
1506
  return this.node(t, {
1508
- kind: l.SCHEMA_DEFINITION,
1507
+ kind: u.SCHEMA_DEFINITION,
1509
1508
  description: n,
1510
- directives: r,
1511
- operationTypes: i
1509
+ directives: i,
1510
+ operationTypes: r
1512
1511
  });
1513
1512
  }
1514
1513
  /**
@@ -1517,11 +1516,11 @@ class bt {
1517
1516
  parseOperationTypeDefinition() {
1518
1517
  const t = this._lexer.token, n = this.parseOperationType();
1519
1518
  this.expectToken(a.COLON);
1520
- const r = this.parseNamedType();
1519
+ const i = this.parseNamedType();
1521
1520
  return this.node(t, {
1522
- kind: l.OPERATION_TYPE_DEFINITION,
1521
+ kind: u.OPERATION_TYPE_DEFINITION,
1523
1522
  operation: n,
1524
- type: r
1523
+ type: i
1525
1524
  });
1526
1525
  }
1527
1526
  /**
@@ -1530,12 +1529,12 @@ class bt {
1530
1529
  parseScalarTypeDefinition() {
1531
1530
  const t = this._lexer.token, n = this.parseDescription();
1532
1531
  this.expectKeyword("scalar");
1533
- const r = this.parseName(), i = this.parseConstDirectives();
1532
+ const i = this.parseName(), r = this.parseConstDirectives();
1534
1533
  return this.node(t, {
1535
- kind: l.SCALAR_TYPE_DEFINITION,
1534
+ kind: u.SCALAR_TYPE_DEFINITION,
1536
1535
  description: n,
1537
- name: r,
1538
- directives: i
1536
+ name: i,
1537
+ directives: r
1539
1538
  });
1540
1539
  }
1541
1540
  /**
@@ -1546,12 +1545,12 @@ class bt {
1546
1545
  parseObjectTypeDefinition() {
1547
1546
  const t = this._lexer.token, n = this.parseDescription();
1548
1547
  this.expectKeyword("type");
1549
- const r = this.parseName(), i = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), o = this.parseFieldsDefinition();
1548
+ const i = this.parseName(), r = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), o = this.parseFieldsDefinition();
1550
1549
  return this.node(t, {
1551
- kind: l.OBJECT_TYPE_DEFINITION,
1550
+ kind: u.OBJECT_TYPE_DEFINITION,
1552
1551
  description: n,
1553
- name: r,
1554
- interfaces: i,
1552
+ name: i,
1553
+ interfaces: r,
1555
1554
  directives: s,
1556
1555
  fields: o
1557
1556
  });
@@ -1581,14 +1580,14 @@ class bt {
1581
1580
  * - Description? Name ArgumentsDefinition? : Type Directives[Const]?
1582
1581
  */
1583
1582
  parseFieldDefinition() {
1584
- const t = this._lexer.token, n = this.parseDescription(), r = this.parseName(), i = this.parseArgumentDefs();
1583
+ const t = this._lexer.token, n = this.parseDescription(), i = this.parseName(), r = this.parseArgumentDefs();
1585
1584
  this.expectToken(a.COLON);
1586
1585
  const s = this.parseTypeReference(), o = this.parseConstDirectives();
1587
1586
  return this.node(t, {
1588
- kind: l.FIELD_DEFINITION,
1587
+ kind: u.FIELD_DEFINITION,
1589
1588
  description: n,
1590
- name: r,
1591
- arguments: i,
1589
+ name: i,
1590
+ arguments: r,
1592
1591
  type: s,
1593
1592
  directives: o
1594
1593
  });
@@ -1608,17 +1607,17 @@ class bt {
1608
1607
  * - Description? Name : Type DefaultValue? Directives[Const]?
1609
1608
  */
1610
1609
  parseInputValueDef() {
1611
- const t = this._lexer.token, n = this.parseDescription(), r = this.parseName();
1610
+ const t = this._lexer.token, n = this.parseDescription(), i = this.parseName();
1612
1611
  this.expectToken(a.COLON);
1613
- const i = this.parseTypeReference();
1612
+ const r = this.parseTypeReference();
1614
1613
  let s;
1615
1614
  this.expectOptionalToken(a.EQUALS) && (s = this.parseConstValueLiteral());
1616
1615
  const o = this.parseConstDirectives();
1617
1616
  return this.node(t, {
1618
- kind: l.INPUT_VALUE_DEFINITION,
1617
+ kind: u.INPUT_VALUE_DEFINITION,
1619
1618
  description: n,
1620
- name: r,
1621
- type: i,
1619
+ name: i,
1620
+ type: r,
1622
1621
  defaultValue: s,
1623
1622
  directives: o
1624
1623
  });
@@ -1630,12 +1629,12 @@ class bt {
1630
1629
  parseInterfaceTypeDefinition() {
1631
1630
  const t = this._lexer.token, n = this.parseDescription();
1632
1631
  this.expectKeyword("interface");
1633
- const r = this.parseName(), i = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), o = this.parseFieldsDefinition();
1632
+ const i = this.parseName(), r = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), o = this.parseFieldsDefinition();
1634
1633
  return this.node(t, {
1635
- kind: l.INTERFACE_TYPE_DEFINITION,
1634
+ kind: u.INTERFACE_TYPE_DEFINITION,
1636
1635
  description: n,
1637
- name: r,
1638
- interfaces: i,
1636
+ name: i,
1637
+ interfaces: r,
1639
1638
  directives: s,
1640
1639
  fields: o
1641
1640
  });
@@ -1647,12 +1646,12 @@ class bt {
1647
1646
  parseUnionTypeDefinition() {
1648
1647
  const t = this._lexer.token, n = this.parseDescription();
1649
1648
  this.expectKeyword("union");
1650
- const r = this.parseName(), i = this.parseConstDirectives(), s = this.parseUnionMemberTypes();
1649
+ const i = this.parseName(), r = this.parseConstDirectives(), s = this.parseUnionMemberTypes();
1651
1650
  return this.node(t, {
1652
- kind: l.UNION_TYPE_DEFINITION,
1651
+ kind: u.UNION_TYPE_DEFINITION,
1653
1652
  description: n,
1654
- name: r,
1655
- directives: i,
1653
+ name: i,
1654
+ directives: r,
1656
1655
  types: s
1657
1656
  });
1658
1657
  }
@@ -1671,12 +1670,12 @@ class bt {
1671
1670
  parseEnumTypeDefinition() {
1672
1671
  const t = this._lexer.token, n = this.parseDescription();
1673
1672
  this.expectKeyword("enum");
1674
- const r = this.parseName(), i = this.parseConstDirectives(), s = this.parseEnumValuesDefinition();
1673
+ const i = this.parseName(), r = this.parseConstDirectives(), s = this.parseEnumValuesDefinition();
1675
1674
  return this.node(t, {
1676
- kind: l.ENUM_TYPE_DEFINITION,
1675
+ kind: u.ENUM_TYPE_DEFINITION,
1677
1676
  description: n,
1678
- name: r,
1679
- directives: i,
1677
+ name: i,
1678
+ directives: r,
1680
1679
  values: s
1681
1680
  });
1682
1681
  }
@@ -1696,12 +1695,12 @@ class bt {
1696
1695
  * EnumValueDefinition : Description? EnumValue Directives[Const]?
1697
1696
  */
1698
1697
  parseEnumValueDefinition() {
1699
- const t = this._lexer.token, n = this.parseDescription(), r = this.parseEnumValueName(), i = this.parseConstDirectives();
1698
+ const t = this._lexer.token, n = this.parseDescription(), i = this.parseEnumValueName(), r = this.parseConstDirectives();
1700
1699
  return this.node(t, {
1701
- kind: l.ENUM_VALUE_DEFINITION,
1700
+ kind: u.ENUM_VALUE_DEFINITION,
1702
1701
  description: n,
1703
- name: r,
1704
- directives: i
1702
+ name: i,
1703
+ directives: r
1705
1704
  });
1706
1705
  }
1707
1706
  /**
@@ -1709,10 +1708,10 @@ class bt {
1709
1708
  */
1710
1709
  parseEnumValueName() {
1711
1710
  if (this._lexer.token.value === "true" || this._lexer.token.value === "false" || this._lexer.token.value === "null")
1712
- throw k(
1711
+ throw T(
1713
1712
  this._lexer.source,
1714
1713
  this._lexer.token.start,
1715
- `${z(
1714
+ `${q(
1716
1715
  this._lexer.token
1717
1716
  )} is reserved and cannot be used for an enum value.`
1718
1717
  );
@@ -1725,12 +1724,12 @@ class bt {
1725
1724
  parseInputObjectTypeDefinition() {
1726
1725
  const t = this._lexer.token, n = this.parseDescription();
1727
1726
  this.expectKeyword("input");
1728
- const r = this.parseName(), i = this.parseConstDirectives(), s = this.parseInputFieldsDefinition();
1727
+ const i = this.parseName(), r = this.parseConstDirectives(), s = this.parseInputFieldsDefinition();
1729
1728
  return this.node(t, {
1730
- kind: l.INPUT_OBJECT_TYPE_DEFINITION,
1729
+ kind: u.INPUT_OBJECT_TYPE_DEFINITION,
1731
1730
  description: n,
1732
- name: r,
1733
- directives: i,
1731
+ name: i,
1732
+ directives: r,
1734
1733
  fields: s
1735
1734
  });
1736
1735
  }
@@ -1790,17 +1789,17 @@ class bt {
1790
1789
  parseSchemaExtension() {
1791
1790
  const t = this._lexer.token;
1792
1791
  this.expectKeyword("extend"), this.expectKeyword("schema");
1793
- const n = this.parseConstDirectives(), r = this.optionalMany(
1792
+ const n = this.parseConstDirectives(), i = this.optionalMany(
1794
1793
  a.BRACE_L,
1795
1794
  this.parseOperationTypeDefinition,
1796
1795
  a.BRACE_R
1797
1796
  );
1798
- if (n.length === 0 && r.length === 0)
1797
+ if (n.length === 0 && i.length === 0)
1799
1798
  throw this.unexpected();
1800
1799
  return this.node(t, {
1801
- kind: l.SCHEMA_EXTENSION,
1800
+ kind: u.SCHEMA_EXTENSION,
1802
1801
  directives: n,
1803
- operationTypes: r
1802
+ operationTypes: i
1804
1803
  });
1805
1804
  }
1806
1805
  /**
@@ -1810,13 +1809,13 @@ class bt {
1810
1809
  parseScalarTypeExtension() {
1811
1810
  const t = this._lexer.token;
1812
1811
  this.expectKeyword("extend"), this.expectKeyword("scalar");
1813
- const n = this.parseName(), r = this.parseConstDirectives();
1814
- if (r.length === 0)
1812
+ const n = this.parseName(), i = this.parseConstDirectives();
1813
+ if (i.length === 0)
1815
1814
  throw this.unexpected();
1816
1815
  return this.node(t, {
1817
- kind: l.SCALAR_TYPE_EXTENSION,
1816
+ kind: u.SCALAR_TYPE_EXTENSION,
1818
1817
  name: n,
1819
- directives: r
1818
+ directives: i
1820
1819
  });
1821
1820
  }
1822
1821
  /**
@@ -1828,14 +1827,14 @@ class bt {
1828
1827
  parseObjectTypeExtension() {
1829
1828
  const t = this._lexer.token;
1830
1829
  this.expectKeyword("extend"), this.expectKeyword("type");
1831
- const n = this.parseName(), r = this.parseImplementsInterfaces(), i = this.parseConstDirectives(), s = this.parseFieldsDefinition();
1832
- if (r.length === 0 && i.length === 0 && s.length === 0)
1830
+ const n = this.parseName(), i = this.parseImplementsInterfaces(), r = this.parseConstDirectives(), s = this.parseFieldsDefinition();
1831
+ if (i.length === 0 && r.length === 0 && s.length === 0)
1833
1832
  throw this.unexpected();
1834
1833
  return this.node(t, {
1835
- kind: l.OBJECT_TYPE_EXTENSION,
1834
+ kind: u.OBJECT_TYPE_EXTENSION,
1836
1835
  name: n,
1837
- interfaces: r,
1838
- directives: i,
1836
+ interfaces: i,
1837
+ directives: r,
1839
1838
  fields: s
1840
1839
  });
1841
1840
  }
@@ -1848,14 +1847,14 @@ class bt {
1848
1847
  parseInterfaceTypeExtension() {
1849
1848
  const t = this._lexer.token;
1850
1849
  this.expectKeyword("extend"), this.expectKeyword("interface");
1851
- const n = this.parseName(), r = this.parseImplementsInterfaces(), i = this.parseConstDirectives(), s = this.parseFieldsDefinition();
1852
- if (r.length === 0 && i.length === 0 && s.length === 0)
1850
+ const n = this.parseName(), i = this.parseImplementsInterfaces(), r = this.parseConstDirectives(), s = this.parseFieldsDefinition();
1851
+ if (i.length === 0 && r.length === 0 && s.length === 0)
1853
1852
  throw this.unexpected();
1854
1853
  return this.node(t, {
1855
- kind: l.INTERFACE_TYPE_EXTENSION,
1854
+ kind: u.INTERFACE_TYPE_EXTENSION,
1856
1855
  name: n,
1857
- interfaces: r,
1858
- directives: i,
1856
+ interfaces: i,
1857
+ directives: r,
1859
1858
  fields: s
1860
1859
  });
1861
1860
  }
@@ -1867,14 +1866,14 @@ class bt {
1867
1866
  parseUnionTypeExtension() {
1868
1867
  const t = this._lexer.token;
1869
1868
  this.expectKeyword("extend"), this.expectKeyword("union");
1870
- const n = this.parseName(), r = this.parseConstDirectives(), i = this.parseUnionMemberTypes();
1871
- if (r.length === 0 && i.length === 0)
1869
+ const n = this.parseName(), i = this.parseConstDirectives(), r = this.parseUnionMemberTypes();
1870
+ if (i.length === 0 && r.length === 0)
1872
1871
  throw this.unexpected();
1873
1872
  return this.node(t, {
1874
- kind: l.UNION_TYPE_EXTENSION,
1873
+ kind: u.UNION_TYPE_EXTENSION,
1875
1874
  name: n,
1876
- directives: r,
1877
- types: i
1875
+ directives: i,
1876
+ types: r
1878
1877
  });
1879
1878
  }
1880
1879
  /**
@@ -1885,14 +1884,14 @@ class bt {
1885
1884
  parseEnumTypeExtension() {
1886
1885
  const t = this._lexer.token;
1887
1886
  this.expectKeyword("extend"), this.expectKeyword("enum");
1888
- const n = this.parseName(), r = this.parseConstDirectives(), i = this.parseEnumValuesDefinition();
1889
- if (r.length === 0 && i.length === 0)
1887
+ const n = this.parseName(), i = this.parseConstDirectives(), r = this.parseEnumValuesDefinition();
1888
+ if (i.length === 0 && r.length === 0)
1890
1889
  throw this.unexpected();
1891
1890
  return this.node(t, {
1892
- kind: l.ENUM_TYPE_EXTENSION,
1891
+ kind: u.ENUM_TYPE_EXTENSION,
1893
1892
  name: n,
1894
- directives: r,
1895
- values: i
1893
+ directives: i,
1894
+ values: r
1896
1895
  });
1897
1896
  }
1898
1897
  /**
@@ -1903,14 +1902,14 @@ class bt {
1903
1902
  parseInputObjectTypeExtension() {
1904
1903
  const t = this._lexer.token;
1905
1904
  this.expectKeyword("extend"), this.expectKeyword("input");
1906
- const n = this.parseName(), r = this.parseConstDirectives(), i = this.parseInputFieldsDefinition();
1907
- if (r.length === 0 && i.length === 0)
1905
+ const n = this.parseName(), i = this.parseConstDirectives(), r = this.parseInputFieldsDefinition();
1906
+ if (i.length === 0 && r.length === 0)
1908
1907
  throw this.unexpected();
1909
1908
  return this.node(t, {
1910
- kind: l.INPUT_OBJECT_TYPE_EXTENSION,
1909
+ kind: u.INPUT_OBJECT_TYPE_EXTENSION,
1911
1910
  name: n,
1912
- directives: r,
1913
- fields: i
1911
+ directives: i,
1912
+ fields: r
1914
1913
  });
1915
1914
  }
1916
1915
  /**
@@ -1922,14 +1921,14 @@ class bt {
1922
1921
  parseDirectiveDefinition() {
1923
1922
  const t = this._lexer.token, n = this.parseDescription();
1924
1923
  this.expectKeyword("directive"), this.expectToken(a.AT);
1925
- const r = this.parseName(), i = this.parseArgumentDefs(), s = this.expectOptionalKeyword("repeatable");
1924
+ const i = this.parseName(), r = this.parseArgumentDefs(), s = this.expectOptionalKeyword("repeatable");
1926
1925
  this.expectKeyword("on");
1927
1926
  const o = this.parseDirectiveLocations();
1928
1927
  return this.node(t, {
1929
- kind: l.DIRECTIVE_DEFINITION,
1928
+ kind: u.DIRECTIVE_DEFINITION,
1930
1929
  description: n,
1931
- name: r,
1932
- arguments: i,
1930
+ name: i,
1931
+ arguments: r,
1933
1932
  repeatable: s,
1934
1933
  locations: o
1935
1934
  });
@@ -1971,7 +1970,7 @@ class bt {
1971
1970
  */
1972
1971
  parseDirectiveLocation() {
1973
1972
  const t = this._lexer.token, n = this.parseName();
1974
- if (Object.prototype.hasOwnProperty.call(oe, n.value))
1973
+ if (Object.prototype.hasOwnProperty.call(re, n.value))
1975
1974
  return n;
1976
1975
  throw this.unexpected(t);
1977
1976
  }
@@ -1985,29 +1984,29 @@ class bt {
1985
1984
  * - \@ Name ( Name : )
1986
1985
  */
1987
1986
  parseSchemaCoordinate() {
1988
- const t = this._lexer.token, n = this.expectOptionalToken(a.AT), r = this.parseName();
1989
- let i;
1990
- !n && this.expectOptionalToken(a.DOT) && (i = this.parseName());
1987
+ const t = this._lexer.token, n = this.expectOptionalToken(a.AT), i = this.parseName();
1988
+ let r;
1989
+ !n && this.expectOptionalToken(a.DOT) && (r = this.parseName());
1991
1990
  let s;
1992
- return (n || i) && this.expectOptionalToken(a.PAREN_L) && (s = this.parseName(), this.expectToken(a.COLON), this.expectToken(a.PAREN_R)), n ? s ? this.node(t, {
1993
- kind: l.DIRECTIVE_ARGUMENT_COORDINATE,
1994
- name: r,
1991
+ return (n || r) && this.expectOptionalToken(a.PAREN_L) && (s = this.parseName(), this.expectToken(a.COLON), this.expectToken(a.PAREN_R)), n ? s ? this.node(t, {
1992
+ kind: u.DIRECTIVE_ARGUMENT_COORDINATE,
1993
+ name: i,
1995
1994
  argumentName: s
1996
1995
  }) : this.node(t, {
1997
- kind: l.DIRECTIVE_COORDINATE,
1998
- name: r
1999
- }) : i ? s ? this.node(t, {
2000
- kind: l.ARGUMENT_COORDINATE,
2001
- name: r,
2002
- fieldName: i,
1996
+ kind: u.DIRECTIVE_COORDINATE,
1997
+ name: i
1998
+ }) : r ? s ? this.node(t, {
1999
+ kind: u.ARGUMENT_COORDINATE,
2000
+ name: i,
2001
+ fieldName: r,
2003
2002
  argumentName: s
2004
2003
  }) : this.node(t, {
2005
- kind: l.MEMBER_COORDINATE,
2006
- name: r,
2007
- memberName: i
2004
+ kind: u.MEMBER_COORDINATE,
2005
+ name: i,
2006
+ memberName: r
2008
2007
  }) : this.node(t, {
2009
- kind: l.TYPE_COORDINATE,
2010
- name: r
2008
+ kind: u.TYPE_COORDINATE,
2009
+ name: i
2011
2010
  });
2012
2011
  }
2013
2012
  // Core parsing utility functions
@@ -2017,7 +2016,7 @@ class bt {
2017
2016
  * given parsed object.
2018
2017
  */
2019
2018
  node(t, n) {
2020
- return this._options.noLocation !== !0 && (n.loc = new nt(
2019
+ return this._options.noLocation !== !0 && (n.loc = new He(
2021
2020
  t,
2022
2021
  this._lexer.lastToken,
2023
2022
  this._lexer.source
@@ -2037,10 +2036,10 @@ class bt {
2037
2036
  const n = this._lexer.token;
2038
2037
  if (n.kind === t)
2039
2038
  return this.advanceLexer(), n;
2040
- throw k(
2039
+ throw T(
2041
2040
  this._lexer.source,
2042
2041
  n.start,
2043
- `Expected ${ze(t)}, found ${z(n)}.`
2042
+ `Expected ${Fe(t)}, found ${q(n)}.`
2044
2043
  );
2045
2044
  }
2046
2045
  /**
@@ -2059,10 +2058,10 @@ class bt {
2059
2058
  if (n.kind === a.NAME && n.value === t)
2060
2059
  this.advanceLexer();
2061
2060
  else
2062
- throw k(
2061
+ throw T(
2063
2062
  this._lexer.source,
2064
2063
  n.start,
2065
- `Expected "${t}", found ${z(n)}.`
2064
+ `Expected "${t}", found ${q(n)}.`
2066
2065
  );
2067
2066
  }
2068
2067
  /**
@@ -2078,10 +2077,10 @@ class bt {
2078
2077
  */
2079
2078
  unexpected(t) {
2080
2079
  const n = t ?? this._lexer.token;
2081
- return k(
2080
+ return T(
2082
2081
  this._lexer.source,
2083
2082
  n.start,
2084
- `Unexpected ${z(n)}.`
2083
+ `Unexpected ${q(n)}.`
2085
2084
  );
2086
2085
  }
2087
2086
  /**
@@ -2089,12 +2088,12 @@ class bt {
2089
2088
  * This list begins with a lex token of openKind and ends with a lex token of closeKind.
2090
2089
  * Advances the parser to the next lex token after the closing token.
2091
2090
  */
2092
- any(t, n, r) {
2091
+ any(t, n, i) {
2093
2092
  this.expectToken(t);
2094
- const i = [];
2095
- for (; !this.expectOptionalToken(r); )
2096
- i.push(n.call(this));
2097
- return i;
2093
+ const r = [];
2094
+ for (; !this.expectOptionalToken(i); )
2095
+ r.push(n.call(this));
2096
+ return r;
2098
2097
  }
2099
2098
  /**
2100
2099
  * Returns a list of parse nodes, determined by the parseFn.
@@ -2102,13 +2101,13 @@ class bt {
2102
2101
  * that begins with a lex token of openKind and ends with a lex token of closeKind.
2103
2102
  * Advances the parser to the next lex token after the closing token.
2104
2103
  */
2105
- optionalMany(t, n, r) {
2104
+ optionalMany(t, n, i) {
2106
2105
  if (this.expectOptionalToken(t)) {
2107
- const i = [];
2106
+ const r = [];
2108
2107
  do
2109
- i.push(n.call(this));
2110
- while (!this.expectOptionalToken(r));
2111
- return i;
2108
+ r.push(n.call(this));
2109
+ while (!this.expectOptionalToken(i));
2110
+ return r;
2112
2111
  }
2113
2112
  return [];
2114
2113
  }
@@ -2117,13 +2116,13 @@ class bt {
2117
2116
  * This list begins with a lex token of openKind and ends with a lex token of closeKind.
2118
2117
  * Advances the parser to the next lex token after the closing token.
2119
2118
  */
2120
- many(t, n, r) {
2119
+ many(t, n, i) {
2121
2120
  this.expectToken(t);
2122
- const i = [];
2121
+ const r = [];
2123
2122
  do
2124
- i.push(n.call(this));
2125
- while (!this.expectOptionalToken(r));
2126
- return i;
2123
+ r.push(n.call(this));
2124
+ while (!this.expectOptionalToken(i));
2125
+ return r;
2127
2126
  }
2128
2127
  /**
2129
2128
  * Returns a non-empty list of parse nodes, determined by the parseFn.
@@ -2132,37 +2131,37 @@ class bt {
2132
2131
  */
2133
2132
  delimitedMany(t, n) {
2134
2133
  this.expectOptionalToken(t);
2135
- const r = [];
2134
+ const i = [];
2136
2135
  do
2137
- r.push(n.call(this));
2136
+ i.push(n.call(this));
2138
2137
  while (this.expectOptionalToken(t));
2139
- return r;
2138
+ return i;
2140
2139
  }
2141
2140
  advanceLexer() {
2142
2141
  const { maxTokens: t } = this._options, n = this._lexer.advance();
2143
2142
  if (n.kind !== a.EOF && (++this._tokenCounter, t !== void 0 && this._tokenCounter > t))
2144
- throw k(
2143
+ throw T(
2145
2144
  this._lexer.source,
2146
2145
  n.start,
2147
2146
  `Document contains more that ${t} tokens. Parsing aborted.`
2148
2147
  );
2149
2148
  }
2150
2149
  }
2151
- function z(e) {
2150
+ function q(e) {
2152
2151
  const t = e.value;
2153
- return ze(e.kind) + (t != null ? ` "${t}"` : "");
2152
+ return Fe(e.kind) + (t != null ? ` "${t}"` : "");
2154
2153
  }
2155
- function ze(e) {
2156
- return dt(e) ? `"${e}"` : e;
2154
+ function Fe(e) {
2155
+ return Ke(e) ? `"${e}"` : e;
2157
2156
  }
2158
- function St(e) {
2159
- return `"${e.replace(Ct, _t)}"`;
2157
+ function vt(e) {
2158
+ return `"${e.replace(Tt, At)}"`;
2160
2159
  }
2161
- const Ct = /[\x00-\x1f\x22\x5c\x7f-\x9f]/g;
2162
- function _t(e) {
2163
- return Lt[e.charCodeAt(0)];
2160
+ const Tt = /[\x00-\x1f\x22\x5c\x7f-\x9f]/g;
2161
+ function At(e) {
2162
+ return kt[e.charCodeAt(0)];
2164
2163
  }
2165
- const Lt = [
2164
+ const kt = [
2166
2165
  "\\u0000",
2167
2166
  "\\u0001",
2168
2167
  "\\u0002",
@@ -2328,72 +2327,72 @@ const Lt = [
2328
2327
  "\\u009D",
2329
2328
  "\\u009E",
2330
2329
  "\\u009F"
2331
- ], Rt = Object.freeze({});
2332
- function Ft(e, t, n = we) {
2333
- const r = /* @__PURE__ */ new Map();
2334
- for (const T of Object.values(l))
2335
- r.set(T, wt(t, T));
2336
- let i, s = Array.isArray(e), o = [e], u = -1, h = [], p = e, c, m;
2337
- const g = [], y = [];
2330
+ ], Ot = Object.freeze({});
2331
+ function Dt(e, t, n = Pe) {
2332
+ const i = /* @__PURE__ */ new Map();
2333
+ for (const k of Object.values(u))
2334
+ i.set(k, Nt(t, k));
2335
+ let r, s = Array.isArray(e), o = [e], l = -1, f = [], p = e, g, d;
2336
+ const m = [], y = [];
2338
2337
  do {
2339
- u++;
2340
- const T = u === o.length, L = T && h.length !== 0;
2341
- if (T) {
2342
- if (c = y.length === 0 ? void 0 : g[g.length - 1], p = m, m = y.pop(), L)
2338
+ l++;
2339
+ const k = l === o.length, C = k && f.length !== 0;
2340
+ if (k) {
2341
+ if (g = y.length === 0 ? void 0 : m[m.length - 1], p = d, d = y.pop(), C)
2343
2342
  if (s) {
2344
2343
  p = p.slice();
2345
- let N = 0;
2346
- for (const [D, P] of h) {
2347
- const b = D - N;
2348
- P === null ? (p.splice(b, 1), N++) : p[b] = P;
2344
+ let A = 0;
2345
+ for (const [O, b] of f) {
2346
+ const P = O - A;
2347
+ b === null ? (p.splice(P, 1), A++) : p[P] = b;
2349
2348
  }
2350
2349
  } else {
2351
2350
  p = { ...p };
2352
- for (const [N, D] of h)
2353
- p[N] = D;
2351
+ for (const [A, O] of f)
2352
+ p[A] = O;
2354
2353
  }
2355
- u = i.index, o = i.keys, h = i.edits, s = i.inArray, i = i.prev;
2356
- } else if (m) {
2357
- if (c = s ? u : o[u], p = m[c], p == null)
2354
+ l = r.index, o = r.keys, f = r.edits, s = r.inArray, r = r.prev;
2355
+ } else if (d) {
2356
+ if (g = s ? l : o[l], p = d[g], p == null)
2358
2357
  continue;
2359
- g.push(c);
2358
+ m.push(g);
2360
2359
  }
2361
- let A;
2360
+ let x;
2362
2361
  if (!Array.isArray(p)) {
2363
- var I, O;
2364
- me(p) || G(!1, `Invalid AST Node: ${le(p)}.`);
2365
- const N = T ? (I = r.get(p.kind)) === null || I === void 0 ? void 0 : I.leave : (O = r.get(p.kind)) === null || O === void 0 ? void 0 : O.enter;
2366
- if (A = N?.call(t, p, c, m, g, y), A === Rt)
2362
+ var I, D;
2363
+ he(p) || z(!1, `Invalid AST Node: ${de(p)}.`);
2364
+ const A = k ? (I = i.get(p.kind)) === null || I === void 0 ? void 0 : I.leave : (D = i.get(p.kind)) === null || D === void 0 ? void 0 : D.enter;
2365
+ if (x = A?.call(t, p, g, d, m, y), x === Ot)
2367
2366
  break;
2368
- if (A === !1) {
2369
- if (!T) {
2370
- g.pop();
2367
+ if (x === !1) {
2368
+ if (!k) {
2369
+ m.pop();
2371
2370
  continue;
2372
2371
  }
2373
- } else if (A !== void 0 && (h.push([c, A]), !T))
2374
- if (me(A))
2375
- p = A;
2372
+ } else if (x !== void 0 && (f.push([g, x]), !k))
2373
+ if (he(x))
2374
+ p = x;
2376
2375
  else {
2377
- g.pop();
2376
+ m.pop();
2378
2377
  continue;
2379
2378
  }
2380
2379
  }
2381
- if (A === void 0 && L && h.push([c, p]), T)
2382
- g.pop();
2380
+ if (x === void 0 && C && f.push([g, p]), k)
2381
+ m.pop();
2383
2382
  else {
2384
- var x;
2385
- i = {
2383
+ var N;
2384
+ r = {
2386
2385
  inArray: s,
2387
- index: u,
2386
+ index: l,
2388
2387
  keys: o,
2389
- edits: h,
2390
- prev: i
2391
- }, s = Array.isArray(p), o = s ? p : (x = n[p.kind]) !== null && x !== void 0 ? x : [], u = -1, h = [], m && y.push(m), m = p;
2388
+ edits: f,
2389
+ prev: r
2390
+ }, s = Array.isArray(p), o = s ? p : (N = n[p.kind]) !== null && N !== void 0 ? N : [], l = -1, f = [], d && y.push(d), d = p;
2392
2391
  }
2393
- } while (i !== void 0);
2394
- return h.length !== 0 ? h[h.length - 1][1] : e;
2392
+ } while (r !== void 0);
2393
+ return f.length !== 0 ? f[f.length - 1][1] : e;
2395
2394
  }
2396
- function wt(e, t) {
2395
+ function Nt(e, t) {
2397
2396
  const n = e[t];
2398
2397
  return typeof n == "object" ? n : typeof n == "function" ? {
2399
2398
  enter: n,
@@ -2403,10 +2402,10 @@ function wt(e, t) {
2403
2402
  leave: e.leave
2404
2403
  };
2405
2404
  }
2406
- function $t(e) {
2407
- return Ft(e, Vt);
2405
+ function bt(e) {
2406
+ return Dt(e, Pt);
2408
2407
  }
2409
- const Bt = 80, Vt = {
2408
+ const xt = 80, Pt = {
2410
2409
  Name: {
2411
2410
  leave: (e) => e.value
2412
2411
  },
@@ -2415,21 +2414,21 @@ const Bt = 80, Vt = {
2415
2414
  },
2416
2415
  // Document
2417
2416
  Document: {
2418
- leave: (e) => d(e.definitions, `
2417
+ leave: (e) => c(e.definitions, `
2419
2418
 
2420
2419
  `)
2421
2420
  },
2422
2421
  OperationDefinition: {
2423
2422
  leave(e) {
2424
- const t = re(e.variableDefinitions) ? f(`(
2425
- `, d(e.variableDefinitions, `
2423
+ const t = te(e.variableDefinitions) ? h(`(
2424
+ `, c(e.variableDefinitions, `
2426
2425
  `), `
2427
- )`) : f("(", d(e.variableDefinitions, ", "), ")"), n = f("", e.description, `
2428
- `) + d(
2426
+ )`) : h("(", c(e.variableDefinitions, ", "), ")"), n = h("", e.description, `
2427
+ `) + c(
2429
2428
  [
2430
2429
  e.operation,
2431
- d([e.name, t]),
2432
- d(e.directives, " ")
2430
+ c([e.name, t]),
2431
+ c(e.directives, " ")
2433
2432
  ],
2434
2433
  " "
2435
2434
  );
@@ -2437,20 +2436,20 @@ const Bt = 80, Vt = {
2437
2436
  }
2438
2437
  },
2439
2438
  VariableDefinition: {
2440
- leave: ({ variable: e, type: t, defaultValue: n, directives: r, description: i }) => f("", i, `
2441
- `) + e + ": " + t + f(" = ", n) + f(" ", d(r, " "))
2439
+ leave: ({ variable: e, type: t, defaultValue: n, directives: i, description: r }) => h("", r, `
2440
+ `) + e + ": " + t + h(" = ", n) + h(" ", c(i, " "))
2442
2441
  },
2443
2442
  SelectionSet: {
2444
2443
  leave: ({ selections: e }) => S(e)
2445
2444
  },
2446
2445
  Field: {
2447
- leave({ alias: e, name: t, arguments: n, directives: r, selectionSet: i }) {
2448
- const s = f("", e, ": ") + t;
2449
- let o = s + f("(", d(n, ", "), ")");
2450
- return o.length > Bt && (o = s + f(`(
2451
- `, Y(d(n, `
2446
+ leave({ alias: e, name: t, arguments: n, directives: i, selectionSet: r }) {
2447
+ const s = h("", e, ": ") + t;
2448
+ let o = s + h("(", c(n, ", "), ")");
2449
+ return o.length > xt && (o = s + h(`(
2450
+ `, j(c(n, `
2452
2451
  `)), `
2453
- )`)), d([o, d(r, " "), i], " ");
2452
+ )`)), c([o, c(i, " "), r], " ");
2454
2453
  }
2455
2454
  },
2456
2455
  Argument: {
@@ -2458,14 +2457,14 @@ const Bt = 80, Vt = {
2458
2457
  },
2459
2458
  // Fragments
2460
2459
  FragmentSpread: {
2461
- leave: ({ name: e, directives: t }) => "..." + e + f(" ", d(t, " "))
2460
+ leave: ({ name: e, directives: t }) => "..." + e + h(" ", c(t, " "))
2462
2461
  },
2463
2462
  InlineFragment: {
2464
- leave: ({ typeCondition: e, directives: t, selectionSet: n }) => d(
2463
+ leave: ({ typeCondition: e, directives: t, selectionSet: n }) => c(
2465
2464
  [
2466
2465
  "...",
2467
- f("on ", e),
2468
- d(t, " "),
2466
+ h("on ", e),
2467
+ c(t, " "),
2469
2468
  n
2470
2469
  ],
2471
2470
  " "
@@ -2476,13 +2475,13 @@ const Bt = 80, Vt = {
2476
2475
  name: e,
2477
2476
  typeCondition: t,
2478
2477
  variableDefinitions: n,
2479
- directives: r,
2480
- selectionSet: i,
2478
+ directives: i,
2479
+ selectionSet: r,
2481
2480
  description: s
2482
- }) => f("", s, `
2481
+ }) => h("", s, `
2483
2482
  `) + // Note: fragment variable definitions are experimental and may be changed
2484
2483
  // or removed in the future.
2485
- `fragment ${e}${f("(", d(n, ", "), ")")} on ${t} ${f("", d(r, " "), " ")}` + i
2484
+ `fragment ${e}${h("(", c(n, ", "), ")")} on ${t} ${h("", c(i, " "), " ")}` + r
2486
2485
  },
2487
2486
  // Value
2488
2487
  IntValue: {
@@ -2492,7 +2491,7 @@ const Bt = 80, Vt = {
2492
2491
  leave: ({ value: e }) => e
2493
2492
  },
2494
2493
  StringValue: {
2495
- leave: ({ value: e, block: t }) => t ? at(e) : St(e)
2494
+ leave: ({ value: e, block: t }) => t ? We(e) : vt(e)
2496
2495
  },
2497
2496
  BooleanValue: {
2498
2497
  leave: ({ value: e }) => e ? "true" : "false"
@@ -2504,17 +2503,17 @@ const Bt = 80, Vt = {
2504
2503
  leave: ({ value: e }) => e
2505
2504
  },
2506
2505
  ListValue: {
2507
- leave: ({ values: e }) => "[" + d(e, ", ") + "]"
2506
+ leave: ({ values: e }) => "[" + c(e, ", ") + "]"
2508
2507
  },
2509
2508
  ObjectValue: {
2510
- leave: ({ fields: e }) => "{" + d(e, ", ") + "}"
2509
+ leave: ({ fields: e }) => "{" + c(e, ", ") + "}"
2511
2510
  },
2512
2511
  ObjectField: {
2513
2512
  leave: ({ name: e, value: t }) => e + ": " + t
2514
2513
  },
2515
2514
  // Directive
2516
2515
  Directive: {
2517
- leave: ({ name: e, arguments: t }) => "@" + e + f("(", d(t, ", "), ")")
2516
+ leave: ({ name: e, arguments: t }) => "@" + e + h("(", c(t, ", "), ")")
2518
2517
  },
2519
2518
  // Type
2520
2519
  NamedType: {
@@ -2528,247 +2527,247 @@ const Bt = 80, Vt = {
2528
2527
  },
2529
2528
  // Type System Definitions
2530
2529
  SchemaDefinition: {
2531
- leave: ({ description: e, directives: t, operationTypes: n }) => f("", e, `
2532
- `) + d(["schema", d(t, " "), S(n)], " ")
2530
+ leave: ({ description: e, directives: t, operationTypes: n }) => h("", e, `
2531
+ `) + c(["schema", c(t, " "), S(n)], " ")
2533
2532
  },
2534
2533
  OperationTypeDefinition: {
2535
2534
  leave: ({ operation: e, type: t }) => e + ": " + t
2536
2535
  },
2537
2536
  ScalarTypeDefinition: {
2538
- leave: ({ description: e, name: t, directives: n }) => f("", e, `
2539
- `) + d(["scalar", t, d(n, " ")], " ")
2537
+ leave: ({ description: e, name: t, directives: n }) => h("", e, `
2538
+ `) + c(["scalar", t, c(n, " ")], " ")
2540
2539
  },
2541
2540
  ObjectTypeDefinition: {
2542
- leave: ({ description: e, name: t, interfaces: n, directives: r, fields: i }) => f("", e, `
2543
- `) + d(
2541
+ leave: ({ description: e, name: t, interfaces: n, directives: i, fields: r }) => h("", e, `
2542
+ `) + c(
2544
2543
  [
2545
2544
  "type",
2546
2545
  t,
2547
- f("implements ", d(n, " & ")),
2548
- d(r, " "),
2549
- S(i)
2546
+ h("implements ", c(n, " & ")),
2547
+ c(i, " "),
2548
+ S(r)
2550
2549
  ],
2551
2550
  " "
2552
2551
  )
2553
2552
  },
2554
2553
  FieldDefinition: {
2555
- leave: ({ description: e, name: t, arguments: n, type: r, directives: i }) => f("", e, `
2556
- `) + t + (re(n) ? f(`(
2557
- `, Y(d(n, `
2554
+ leave: ({ description: e, name: t, arguments: n, type: i, directives: r }) => h("", e, `
2555
+ `) + t + (te(n) ? h(`(
2556
+ `, j(c(n, `
2558
2557
  `)), `
2559
- )`) : f("(", d(n, ", "), ")")) + ": " + r + f(" ", d(i, " "))
2558
+ )`) : h("(", c(n, ", "), ")")) + ": " + i + h(" ", c(r, " "))
2560
2559
  },
2561
2560
  InputValueDefinition: {
2562
- leave: ({ description: e, name: t, type: n, defaultValue: r, directives: i }) => f("", e, `
2563
- `) + d(
2564
- [t + ": " + n, f("= ", r), d(i, " ")],
2561
+ leave: ({ description: e, name: t, type: n, defaultValue: i, directives: r }) => h("", e, `
2562
+ `) + c(
2563
+ [t + ": " + n, h("= ", i), c(r, " ")],
2565
2564
  " "
2566
2565
  )
2567
2566
  },
2568
2567
  InterfaceTypeDefinition: {
2569
- leave: ({ description: e, name: t, interfaces: n, directives: r, fields: i }) => f("", e, `
2570
- `) + d(
2568
+ leave: ({ description: e, name: t, interfaces: n, directives: i, fields: r }) => h("", e, `
2569
+ `) + c(
2571
2570
  [
2572
2571
  "interface",
2573
2572
  t,
2574
- f("implements ", d(n, " & ")),
2575
- d(r, " "),
2576
- S(i)
2573
+ h("implements ", c(n, " & ")),
2574
+ c(i, " "),
2575
+ S(r)
2577
2576
  ],
2578
2577
  " "
2579
2578
  )
2580
2579
  },
2581
2580
  UnionTypeDefinition: {
2582
- leave: ({ description: e, name: t, directives: n, types: r }) => f("", e, `
2583
- `) + d(
2584
- ["union", t, d(n, " "), f("= ", d(r, " | "))],
2581
+ leave: ({ description: e, name: t, directives: n, types: i }) => h("", e, `
2582
+ `) + c(
2583
+ ["union", t, c(n, " "), h("= ", c(i, " | "))],
2585
2584
  " "
2586
2585
  )
2587
2586
  },
2588
2587
  EnumTypeDefinition: {
2589
- leave: ({ description: e, name: t, directives: n, values: r }) => f("", e, `
2590
- `) + d(["enum", t, d(n, " "), S(r)], " ")
2588
+ leave: ({ description: e, name: t, directives: n, values: i }) => h("", e, `
2589
+ `) + c(["enum", t, c(n, " "), S(i)], " ")
2591
2590
  },
2592
2591
  EnumValueDefinition: {
2593
- leave: ({ description: e, name: t, directives: n }) => f("", e, `
2594
- `) + d([t, d(n, " ")], " ")
2592
+ leave: ({ description: e, name: t, directives: n }) => h("", e, `
2593
+ `) + c([t, c(n, " ")], " ")
2595
2594
  },
2596
2595
  InputObjectTypeDefinition: {
2597
- leave: ({ description: e, name: t, directives: n, fields: r }) => f("", e, `
2598
- `) + d(["input", t, d(n, " "), S(r)], " ")
2596
+ leave: ({ description: e, name: t, directives: n, fields: i }) => h("", e, `
2597
+ `) + c(["input", t, c(n, " "), S(i)], " ")
2599
2598
  },
2600
2599
  DirectiveDefinition: {
2601
- leave: ({ description: e, name: t, arguments: n, repeatable: r, locations: i }) => f("", e, `
2602
- `) + "directive @" + t + (re(n) ? f(`(
2603
- `, Y(d(n, `
2600
+ leave: ({ description: e, name: t, arguments: n, repeatable: i, locations: r }) => h("", e, `
2601
+ `) + "directive @" + t + (te(n) ? h(`(
2602
+ `, j(c(n, `
2604
2603
  `)), `
2605
- )`) : f("(", d(n, ", "), ")")) + (r ? " repeatable" : "") + " on " + d(i, " | ")
2604
+ )`) : h("(", c(n, ", "), ")")) + (i ? " repeatable" : "") + " on " + c(r, " | ")
2606
2605
  },
2607
2606
  SchemaExtension: {
2608
- leave: ({ directives: e, operationTypes: t }) => d(
2609
- ["extend schema", d(e, " "), S(t)],
2607
+ leave: ({ directives: e, operationTypes: t }) => c(
2608
+ ["extend schema", c(e, " "), S(t)],
2610
2609
  " "
2611
2610
  )
2612
2611
  },
2613
2612
  ScalarTypeExtension: {
2614
- leave: ({ name: e, directives: t }) => d(["extend scalar", e, d(t, " ")], " ")
2613
+ leave: ({ name: e, directives: t }) => c(["extend scalar", e, c(t, " ")], " ")
2615
2614
  },
2616
2615
  ObjectTypeExtension: {
2617
- leave: ({ name: e, interfaces: t, directives: n, fields: r }) => d(
2616
+ leave: ({ name: e, interfaces: t, directives: n, fields: i }) => c(
2618
2617
  [
2619
2618
  "extend type",
2620
2619
  e,
2621
- f("implements ", d(t, " & ")),
2622
- d(n, " "),
2623
- S(r)
2620
+ h("implements ", c(t, " & ")),
2621
+ c(n, " "),
2622
+ S(i)
2624
2623
  ],
2625
2624
  " "
2626
2625
  )
2627
2626
  },
2628
2627
  InterfaceTypeExtension: {
2629
- leave: ({ name: e, interfaces: t, directives: n, fields: r }) => d(
2628
+ leave: ({ name: e, interfaces: t, directives: n, fields: i }) => c(
2630
2629
  [
2631
2630
  "extend interface",
2632
2631
  e,
2633
- f("implements ", d(t, " & ")),
2634
- d(n, " "),
2635
- S(r)
2632
+ h("implements ", c(t, " & ")),
2633
+ c(n, " "),
2634
+ S(i)
2636
2635
  ],
2637
2636
  " "
2638
2637
  )
2639
2638
  },
2640
2639
  UnionTypeExtension: {
2641
- leave: ({ name: e, directives: t, types: n }) => d(
2640
+ leave: ({ name: e, directives: t, types: n }) => c(
2642
2641
  [
2643
2642
  "extend union",
2644
2643
  e,
2645
- d(t, " "),
2646
- f("= ", d(n, " | "))
2644
+ c(t, " "),
2645
+ h("= ", c(n, " | "))
2647
2646
  ],
2648
2647
  " "
2649
2648
  )
2650
2649
  },
2651
2650
  EnumTypeExtension: {
2652
- leave: ({ name: e, directives: t, values: n }) => d(["extend enum", e, d(t, " "), S(n)], " ")
2651
+ leave: ({ name: e, directives: t, values: n }) => c(["extend enum", e, c(t, " "), S(n)], " ")
2653
2652
  },
2654
2653
  InputObjectTypeExtension: {
2655
- leave: ({ name: e, directives: t, fields: n }) => d(["extend input", e, d(t, " "), S(n)], " ")
2654
+ leave: ({ name: e, directives: t, fields: n }) => c(["extend input", e, c(t, " "), S(n)], " ")
2656
2655
  },
2657
2656
  // Schema Coordinates
2658
2657
  TypeCoordinate: {
2659
2658
  leave: ({ name: e }) => e
2660
2659
  },
2661
2660
  MemberCoordinate: {
2662
- leave: ({ name: e, memberName: t }) => d([e, f(".", t)])
2661
+ leave: ({ name: e, memberName: t }) => c([e, h(".", t)])
2663
2662
  },
2664
2663
  ArgumentCoordinate: {
2665
- leave: ({ name: e, fieldName: t, argumentName: n }) => d([e, f(".", t), f("(", n, ":)")])
2664
+ leave: ({ name: e, fieldName: t, argumentName: n }) => c([e, h(".", t), h("(", n, ":)")])
2666
2665
  },
2667
2666
  DirectiveCoordinate: {
2668
- leave: ({ name: e }) => d(["@", e])
2667
+ leave: ({ name: e }) => c(["@", e])
2669
2668
  },
2670
2669
  DirectiveArgumentCoordinate: {
2671
- leave: ({ name: e, argumentName: t }) => d(["@", e, f("(", t, ":)")])
2670
+ leave: ({ name: e, argumentName: t }) => c(["@", e, h("(", t, ":)")])
2672
2671
  }
2673
2672
  };
2674
- function d(e, t = "") {
2673
+ function c(e, t = "") {
2675
2674
  var n;
2676
- return (n = e?.filter((r) => r).join(t)) !== null && n !== void 0 ? n : "";
2675
+ return (n = e?.filter((i) => i).join(t)) !== null && n !== void 0 ? n : "";
2677
2676
  }
2678
2677
  function S(e) {
2679
- return f(`{
2680
- `, Y(d(e, `
2678
+ return h(`{
2679
+ `, j(c(e, `
2681
2680
  `)), `
2682
2681
  }`);
2683
2682
  }
2684
- function f(e, t, n = "") {
2683
+ function h(e, t, n = "") {
2685
2684
  return t != null && t !== "" ? e + t + n : "";
2686
2685
  }
2687
- function Y(e) {
2688
- return f(" ", e.replace(/\n/g, `
2686
+ function j(e) {
2687
+ return h(" ", e.replace(/\n/g, `
2689
2688
  `));
2690
2689
  }
2691
- function re(e) {
2690
+ function te(e) {
2692
2691
  var t;
2693
2692
  return (t = e?.some((n) => n.includes(`
2694
2693
  `))) !== null && t !== void 0 ? t : !1;
2695
2694
  }
2696
- var H = /* @__PURE__ */ new Map(), ce = /* @__PURE__ */ new Map(), je = !0, K = !1;
2697
- function Ge(e) {
2695
+ var G = /* @__PURE__ */ new Map(), ae = /* @__PURE__ */ new Map(), $e = !0, J = !1;
2696
+ function Be(e) {
2698
2697
  return e.replace(/[\s,]+/g, " ").trim();
2699
2698
  }
2700
- function Ut(e) {
2701
- return Ge(e.source.body.substring(e.start, e.end));
2699
+ function St(e) {
2700
+ return Be(e.source.body.substring(e.start, e.end));
2702
2701
  }
2703
- function Mt(e) {
2702
+ function Ct(e) {
2704
2703
  var t = /* @__PURE__ */ new Set(), n = [];
2705
- return e.definitions.forEach(function(r) {
2706
- if (r.kind === "FragmentDefinition") {
2707
- var i = r.name.value, s = Ut(r.loc), o = ce.get(i);
2708
- o && !o.has(s) ? je && console.warn("Warning: fragment with name " + i + ` already exists.
2704
+ return e.definitions.forEach(function(i) {
2705
+ if (i.kind === "FragmentDefinition") {
2706
+ var r = i.name.value, s = St(i.loc), o = ae.get(r);
2707
+ o && !o.has(s) ? $e && console.warn("Warning: fragment with name " + r + ` already exists.
2709
2708
  graphql-tag enforces all fragment names across your application to be unique; read more about
2710
- this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`) : o || ce.set(i, o = /* @__PURE__ */ new Set()), o.add(s), t.has(s) || (t.add(s), n.push(r));
2709
+ this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`) : o || ae.set(r, o = /* @__PURE__ */ new Set()), o.add(s), t.has(s) || (t.add(s), n.push(i));
2711
2710
  } else
2712
- n.push(r);
2713
- }), X(X({}, e), { definitions: n });
2711
+ n.push(i);
2712
+ }), Q(Q({}, e), { definitions: n });
2714
2713
  }
2715
- function qt(e) {
2714
+ function _t(e) {
2716
2715
  var t = new Set(e.definitions);
2717
- t.forEach(function(r) {
2718
- r.loc && delete r.loc, Object.keys(r).forEach(function(i) {
2719
- var s = r[i];
2716
+ t.forEach(function(i) {
2717
+ i.loc && delete i.loc, Object.keys(i).forEach(function(r) {
2718
+ var s = i[r];
2720
2719
  s && typeof s == "object" && t.add(s);
2721
2720
  });
2722
2721
  });
2723
2722
  var n = e.loc;
2724
2723
  return n && (delete n.startToken, delete n.endToken), e;
2725
2724
  }
2726
- function zt(e) {
2727
- var t = Ge(e);
2728
- if (!H.has(t)) {
2729
- var n = Pt(e, {
2730
- experimentalFragmentVariables: K,
2731
- allowLegacyFragmentVariables: K
2725
+ function Lt(e) {
2726
+ var t = Be(e);
2727
+ if (!G.has(t)) {
2728
+ var n = Et(e, {
2729
+ experimentalFragmentVariables: J,
2730
+ allowLegacyFragmentVariables: J
2732
2731
  });
2733
2732
  if (!n || n.kind !== "Document")
2734
2733
  throw new Error("Not a valid GraphQL document.");
2735
- H.set(t, qt(Mt(n)));
2734
+ G.set(t, _t(Ct(n)));
2736
2735
  }
2737
- return H.get(t);
2736
+ return G.get(t);
2738
2737
  }
2739
2738
  function E(e) {
2740
2739
  for (var t = [], n = 1; n < arguments.length; n++)
2741
2740
  t[n - 1] = arguments[n];
2742
2741
  typeof e == "string" && (e = [e]);
2743
- var r = e[0];
2744
- return t.forEach(function(i, s) {
2745
- i && i.kind === "Document" ? r += i.loc.source.body : r += i, r += e[s + 1];
2746
- }), zt(r);
2742
+ var i = e[0];
2743
+ return t.forEach(function(r, s) {
2744
+ r && r.kind === "Document" ? i += r.loc.source.body : i += r, i += e[s + 1];
2745
+ }), Lt(i);
2747
2746
  }
2748
- function jt() {
2749
- H.clear(), ce.clear();
2747
+ function Rt() {
2748
+ G.clear(), ae.clear();
2750
2749
  }
2751
- function Gt() {
2752
- je = !1;
2750
+ function wt() {
2751
+ $e = !1;
2753
2752
  }
2754
- function Yt() {
2755
- K = !0;
2753
+ function Ft() {
2754
+ J = !0;
2756
2755
  }
2757
- function Ht() {
2758
- K = !1;
2756
+ function $t() {
2757
+ J = !1;
2759
2758
  }
2760
- var V = {
2759
+ var B = {
2761
2760
  gql: E,
2762
- resetCaches: jt,
2763
- disableFragmentWarnings: Gt,
2764
- enableExperimentalFragmentVariables: Yt,
2765
- disableExperimentalFragmentVariables: Ht
2761
+ resetCaches: Rt,
2762
+ disableFragmentWarnings: wt,
2763
+ enableExperimentalFragmentVariables: Ft,
2764
+ disableExperimentalFragmentVariables: $t
2766
2765
  };
2767
2766
  (function(e) {
2768
- e.gql = V.gql, e.resetCaches = V.resetCaches, e.disableFragmentWarnings = V.disableFragmentWarnings, e.enableExperimentalFragmentVariables = V.enableExperimentalFragmentVariables, e.disableExperimentalFragmentVariables = V.disableExperimentalFragmentVariables;
2767
+ e.gql = B.gql, e.resetCaches = B.resetCaches, e.disableFragmentWarnings = B.disableFragmentWarnings, e.enableExperimentalFragmentVariables = B.enableExperimentalFragmentVariables, e.disableExperimentalFragmentVariables = B.disableExperimentalFragmentVariables;
2769
2768
  })(E || (E = {}));
2770
2769
  E.default = E;
2771
- const Qt = E`
2770
+ const Bt = E`
2772
2771
  query findActiveOrderById($id: String) {
2773
2772
  findOrder(id: $id) {
2774
2773
  id
@@ -2855,7 +2854,7 @@ const Qt = E`
2855
2854
  }
2856
2855
  }
2857
2856
  }
2858
- `, Jt = E`
2857
+ `, Vt = E`
2859
2858
  query findOrderById($id: String, $reference: String) {
2860
2859
  findOrder(id: $id, reference: $reference) {
2861
2860
  id
@@ -2886,7 +2885,7 @@ const Qt = E`
2886
2885
  downloadCode
2887
2886
  }
2888
2887
  }
2889
- `, Xt = E`
2888
+ `, Ut = E`
2890
2889
  mutation addToOrder($orderId: ID!, $productId: ID!, $shopId: ID, $additionalData: AdditionalDataInput, $trackerId: ID, $amount: Int) {
2891
2890
  reserveProduct(
2892
2891
  input: {orderId: $orderId, productId: $productId, additionalData: $additionalData, trackerId: $trackerId, shopId: $shopId, amountToIncrease: $amount}
@@ -2896,7 +2895,7 @@ const Qt = E`
2896
2895
  amountReserved
2897
2896
  }
2898
2897
  }
2899
- `, Kt = E`
2898
+ `, Mt = E`
2900
2899
  mutation removeFromOrder($orderId: ID!, $productId: ID!, $additionalData: AdditionalDataInput, $amount: Int) {
2901
2900
  releaseProduct(
2902
2901
  input: {orderId: $orderId, productId: $productId, additionalData: $additionalData, amountToRelease: $amount}
@@ -2905,7 +2904,7 @@ const Qt = E`
2905
2904
  amountReleased
2906
2905
  }
2907
2906
  }
2908
- `, Wt = E`
2907
+ `, qt = E`
2909
2908
  mutation configurePackage($orderId: ID!, $packageId: ID!, $amount: Int!, $items: [ReservedItem!]!, $shopId: ID, $trackerId: ID) {
2910
2909
  configurePackage(
2911
2910
  input: {orderId: $orderId, shopId: $shopId, trackerId: $trackerId, packageId: $packageId, amount: $amount, items: $items}
@@ -2915,7 +2914,7 @@ const Qt = E`
2915
2914
  amountReserved
2916
2915
  }
2917
2916
  }
2918
- `, Zt = E`
2917
+ `, zt = E`
2919
2918
  mutation reserveAdditionalPackageItem($amount: Int!, $orderId: ID!, $packageId: ID!, $eventId: ID!, $packageItemId: ID!) {
2920
2919
  reserveAdditionalPackageItem(
2921
2920
  input: {amount: $amount, eventId: $eventId, orderId: $orderId, packageId: $packageId, packageItemId: $packageItemId}
@@ -2925,641 +2924,284 @@ const Qt = E`
2925
2924
  amountReserved
2926
2925
  }
2927
2926
  }
2928
- `, en = E`
2927
+ `, jt = E`
2929
2928
  mutation configureOrderDeliveryOption($orderId: ID!, $productId: ID) {
2930
2929
  configureDeliveryOption(input: {orderId: $orderId, productId: $productId})
2931
2930
  }
2932
- `, tn = E`
2931
+ `, Gt = E`
2933
2932
  mutation createOrderCustomer($orderId: ID!, $countryCode: String, $customer: CreateCustomerInput!) {
2934
2933
  createOrderCustomer(
2935
2934
  input: {id: $orderId, countryCode: $countryCode, customer: $customer}
2936
2935
  )
2937
2936
  }
2938
- `, nn = E`
2937
+ `, Ht = E`
2939
2938
  mutation deleteOrder($orderId: ID!) {
2940
2939
  cancelOrder(id: $orderId)
2941
2940
  }
2942
- `, rn = (e, t, n, r) => e();
2943
- function sn(e, t = rn) {
2941
+ `, Yt = (e, t, n, i) => e();
2942
+ function Qt(e, t = Yt) {
2944
2943
  return {
2945
- findActiveOrderById(n, r, i) {
2946
- return t((s) => e.request({ document: Qt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "findActiveOrderById", "query", n);
2944
+ findActiveOrderById(n, i, r) {
2945
+ return t((s) => e.request({ document: Bt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findActiveOrderById", "query", n);
2947
2946
  },
2948
- findOrderById(n, r, i) {
2949
- return t((s) => e.request({ document: Jt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "findOrderById", "query", n);
2947
+ findOrderById(n, i, r) {
2948
+ return t((s) => e.request({ document: Vt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findOrderById", "query", n);
2950
2949
  },
2951
- addToOrder(n, r, i) {
2952
- return t((s) => e.request({ document: Xt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "addToOrder", "mutation", n);
2950
+ addToOrder(n, i, r) {
2951
+ return t((s) => e.request({ document: Ut, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "addToOrder", "mutation", n);
2953
2952
  },
2954
- removeFromOrder(n, r, i) {
2955
- return t((s) => e.request({ document: Kt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "removeFromOrder", "mutation", n);
2953
+ removeFromOrder(n, i, r) {
2954
+ return t((s) => e.request({ document: Mt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "removeFromOrder", "mutation", n);
2956
2955
  },
2957
- configurePackage(n, r, i) {
2958
- return t((s) => e.request({ document: Wt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "configurePackage", "mutation", n);
2956
+ configurePackage(n, i, r) {
2957
+ return t((s) => e.request({ document: qt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "configurePackage", "mutation", n);
2959
2958
  },
2960
- reserveAdditionalPackageItem(n, r, i) {
2961
- return t((s) => e.request({ document: Zt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "reserveAdditionalPackageItem", "mutation", n);
2959
+ reserveAdditionalPackageItem(n, i, r) {
2960
+ return t((s) => e.request({ document: zt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "reserveAdditionalPackageItem", "mutation", n);
2962
2961
  },
2963
- configureOrderDeliveryOption(n, r, i) {
2964
- return t((s) => e.request({ document: en, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "configureOrderDeliveryOption", "mutation", n);
2962
+ configureOrderDeliveryOption(n, i, r) {
2963
+ return t((s) => e.request({ document: jt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "configureOrderDeliveryOption", "mutation", n);
2965
2964
  },
2966
- createOrderCustomer(n, r, i) {
2967
- return t((s) => e.request({ document: tn, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "createOrderCustomer", "mutation", n);
2965
+ createOrderCustomer(n, i, r) {
2966
+ return t((s) => e.request({ document: Gt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "createOrderCustomer", "mutation", n);
2968
2967
  },
2969
- deleteOrder(n, r, i) {
2970
- return t((s) => e.request({ document: nn, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "deleteOrder", "mutation", n);
2968
+ deleteOrder(n, i, r) {
2969
+ return t((s) => e.request({ document: Ht, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "deleteOrder", "mutation", n);
2971
2970
  }
2972
2971
  };
2973
2972
  }
2974
- const Ie = {
2975
- order: null,
2976
- processing: !1,
2977
- error: null,
2978
- initialized: !0
2979
- }, Ye = Qe({
2980
- name: "basket",
2981
- initialState: {
2982
- ...Ie,
2983
- initialized: !1
2984
- },
2985
- reducers: {
2986
- setInitialized: (e, t) => {
2987
- e.initialized = t.payload;
2988
- },
2989
- setProcessing: (e, t) => {
2990
- e.processing = t.payload;
2991
- },
2992
- setError: (e, t) => {
2993
- e.error = t.payload;
2994
- },
2995
- setOrder: (e, t) => {
2996
- e.order = t.payload;
2997
- },
2998
- initializeOrder: (e, t) => {
2999
- e.order || (e.order = {
3000
- id: t.payload.id,
3001
- currency: t.payload.currency,
3002
- items: [],
3003
- expiredAt: t.payload.expiredAt
3004
- });
3005
- },
3006
- addProduct: (e, t) => {
3007
- const { input: n, amountReserved: r, expiredAt: i } = t.payload;
3008
- if (!e.order)
3009
- return;
3010
- const s = e.order.items.findIndex((o) => n.seat ? o.id === n.id && o.seats?.some((u) => u.id === n.seat?.id) : o.id === n.id);
3011
- if (s >= 0)
3012
- e.order.items[s].amount += r;
3013
- else {
3014
- const o = {
3015
- id: n.id,
3016
- type: "PRODUCT",
3017
- name: n.name,
3018
- amount: r,
3019
- price: n.price,
3020
- depositPrice: n.depositPrice,
3021
- serviceFee: n.serviceFee,
3022
- originalPrice: n.price,
3023
- seats: n.seat ? [{ id: n.seat.id, label: n.seat.label }] : void 0
3024
- };
3025
- e.order.items.push(o);
3026
- }
3027
- e.order.expiredAt = i;
3028
- },
3029
- removeProduct: (e, t) => {
3030
- if (!e.order) return;
3031
- const { id: n, amountReleased: r, seatId: i } = t.payload, s = e.order.items.findIndex(
3032
- (o) => o.type === "PRODUCT" && o.id === n
3033
- );
3034
- if (s !== -1) {
3035
- const o = e.order.items[s];
3036
- if (o.amount -= r, o.amount <= 0)
3037
- e.order.items.splice(s, 1);
3038
- else if (o.seats && i) {
3039
- const u = o.seats.findIndex((h) => h.id === i);
3040
- u !== -1 && o.seats.splice(u, 1);
3041
- }
3042
- }
3043
- e.order.items.length === 0 && (e.order = null);
3044
- },
3045
- configurePackage: (e, t) => {
3046
- const { input: n, amountReserved: r, expiredAt: i } = t.payload;
3047
- e.order || (e.order = {
3048
- id: "",
3049
- currency: n.currency,
3050
- items: [],
3051
- expiredAt: i
3052
- });
3053
- const s = e.order.items.find(
3054
- (o) => o.type === "PACKAGE" && o.id === n.id
3055
- );
3056
- s ? (s.amount = r, s.packageItems = n.items) : e.order.items.push({
3057
- id: n.id,
3058
- type: "PACKAGE",
3059
- name: n.name,
3060
- amount: r,
3061
- price: n.discountPrice ?? n.price,
3062
- depositPrice: n.depositPrice,
3063
- originalPrice: n.price,
3064
- serviceFee: n.serviceFee,
3065
- packageItems: n.items
3066
- });
3067
- },
3068
- reserveAdditionalPackageItem: (e, t) => {
3069
- const { input: n, amountReserved: r, expiredAt: i } = t.payload;
3070
- e.order || (e.order = {
3071
- id: "",
3072
- currency: n.currency,
3073
- items: [],
3074
- expiredAt: i
3075
- });
3076
- const s = e.order.items.findIndex(
3077
- (u) => u.id === n.packageItemId
3078
- ), o = e.order.items[s];
3079
- o ? (o.amount = r, o.packageItems = [
3080
- {
3081
- packageItemId: n.packageItemId,
3082
- eventId: n.eventId,
3083
- name: n.name,
3084
- startAt: n.startAt,
3085
- endAt: n.endAt
3086
- }
3087
- ], o.amount === 0 && e.order.items.splice(s, 1)) : e.order.items.push({
3088
- id: n.packageItemId,
3089
- type: _.ADD_ONS,
3090
- name: n.name,
3091
- amount: r,
3092
- price: n.discountPrice ?? n.price,
3093
- depositPrice: n.depositPrice,
3094
- originalPrice: n.price,
3095
- serviceFee: n.serviceFee,
3096
- packageItems: [
3097
- {
3098
- packageItemId: n.packageItemId,
3099
- eventId: n.eventId,
3100
- name: n.name,
3101
- startAt: n.startAt,
3102
- endAt: n.endAt
3103
- }
3104
- ]
3105
- });
3106
- },
3107
- configureDelivery: (e, t) => {
3108
- if (!e.order) return;
3109
- const n = t.payload, r = e.order.items.findIndex(
3110
- (i) => i.type === "DELIVERY"
3111
- );
3112
- if (n)
3113
- if (r !== -1) {
3114
- const i = e.order.items[r];
3115
- i.id = n.id, i.name = n.name, i.price = n.price, i.serviceFee = n.serviceFee;
3116
- } else
3117
- e.order.items.push({
3118
- id: n.id,
3119
- type: "PRODUCT",
3120
- name: n.name,
3121
- amount: 1,
3122
- price: n.price,
3123
- originalPrice: n.price,
3124
- serviceFee: n.serviceFee
3125
- });
3126
- else r !== -1 && e.order.items.splice(r, 1);
3127
- },
3128
- configureCustomer: (e, t) => {
3129
- e.order && (e.order.customer = t.payload);
3130
- },
3131
- clearBasket: () => Ie
3132
- }
3133
- }), {
3134
- setInitialized: on,
3135
- setProcessing: C,
3136
- initializeOrder: j,
3137
- addProduct: Ee,
3138
- removeProduct: an,
3139
- configurePackage: ye,
3140
- configureDelivery: cn,
3141
- configureCustomer: ve,
3142
- reserveAdditionalPackageItem: dn,
3143
- clearBasket: ke
3144
- } = Ye.actions;
3145
- class un {
3146
- orderIdKey = "ORDER_ID";
2973
+ class Jt {
3147
2974
  config;
3148
2975
  sdk;
3149
- store;
3150
2976
  constructor(t) {
3151
- this.config = t, this.store = Je({
3152
- reducer: {
3153
- basket: Ye.reducer
3154
- }
3155
- }), this.sdk = sn(new de(t.apiUrl)), this.restoreOrderFromSession().then(() => {
3156
- this.debugLog("Restore order from session"), this.store.dispatch(on(!0));
3157
- });
3158
- }
3159
- // Store functions
3160
- subscribe(t) {
3161
- return this.store.subscribe(t);
3162
- }
3163
- getProcessing() {
3164
- return this.getState().processing;
3165
- }
3166
- getCurrentOrder() {
3167
- const t = this.getState();
3168
- if (!t.order)
3169
- return null;
3170
- const n = t.order.items.reduce((r, i) => r + (i.amount || 0), 0);
3171
- return {
3172
- ...t.order,
3173
- count: n
3174
- };
3175
- }
3176
- getSelectedPackageEvent() {
3177
- return this.getState().order?.items.flatMap((n) => n.packageItems?.map((r) => r.eventId) ?? []) ?? [];
2977
+ this.config = t, this.sdk = Qt(new oe(t.apiUrl));
3178
2978
  }
3179
2979
  // Basket update functions
3180
- async addProduct(t) {
3181
- this.store.dispatch(C(!0));
2980
+ async addProduct(t, n) {
3182
2981
  try {
3183
- const r = this.getState().order?.id ?? sessionStorage.getItem(this.orderIdKey) ?? this.generateOrderId();
3184
2982
  this.debugLog("Adding product", {
3185
- productId: t.id,
3186
- orderId: r,
3187
- amount: t.amount,
3188
- seat: t.seat
3189
- });
3190
- const i = await this.sdk.addToOrder({
3191
- productId: t.id,
3192
- orderId: r,
3193
- additionalData: t.seat ? {
2983
+ productId: n.id,
2984
+ orderId: t,
2985
+ amount: n.amount,
2986
+ seat: n.seat
2987
+ }), await this.sdk.addToOrder({
2988
+ productId: n.id,
2989
+ orderId: t,
2990
+ additionalData: n.seat ? {
3194
2991
  seat: {
3195
- seatId: t.seat.id,
3196
- seatLabel: t.seat.label,
3197
- holdToken: t.seat.holdToken
2992
+ seatId: n.seat.id,
2993
+ seatLabel: n.seat.label,
2994
+ holdToken: n.seat.holdToken
3198
2995
  }
3199
2996
  } : null,
3200
2997
  trackerId: this.config.trackerId,
3201
2998
  shopId: this.config.shopId,
3202
- amount: t.amount
2999
+ amount: n.amount
3203
3000
  });
3204
- if (i?.reserveProduct) {
3205
- const { orderId: s, expiredAt: o, amountReserved: u } = i.reserveProduct;
3206
- this.debugLog("Product added successfully", i.reserveProduct), sessionStorage.setItem(this.orderIdKey, r), this.store.dispatch(
3207
- j({
3208
- id: s,
3209
- currency: t.currency,
3210
- expiredAt: o
3211
- })
3212
- ), this.store.dispatch(
3213
- Ee({
3214
- input: t,
3215
- amountReserved: u,
3216
- expiredAt: o
3217
- })
3218
- );
3219
- }
3220
- } catch (n) {
3221
- throw this.debugLog("Error adding product", n), this.handleError(n), n;
3222
- } finally {
3223
- this.store.dispatch(C(!1));
3001
+ } catch (i) {
3002
+ throw this.debugLog("Error adding product", i), this.handleError(i), i;
3224
3003
  }
3225
3004
  }
3226
- async removeProduct(t) {
3227
- const r = this.getState().order;
3228
- if (r) {
3229
- this.store.dispatch(C(!0));
3230
- try {
3231
- this.debugLog("Removing product", {
3232
- productId: t.id,
3233
- orderId: r.id,
3234
- amount: t.amount
3235
- });
3236
- const i = await this.sdk.removeFromOrder({
3237
- productId: t.id,
3238
- orderId: r.id,
3239
- additionalData: t.seat ? {
3240
- seat: {
3241
- seatId: t.seat.id,
3242
- seatLabel: t.seat.label
3243
- }
3244
- } : null,
3245
- amount: t.amount
3246
- });
3247
- if (i?.releaseProduct) {
3248
- const { amountReleased: s } = i.releaseProduct;
3249
- this.debugLog("Product removed successfully", i.releaseProduct), this.store.dispatch(
3250
- an({
3251
- id: t.id,
3252
- amountReleased: s,
3253
- seatId: t.seat?.id
3254
- })
3255
- );
3256
- const o = this.getState();
3257
- (!o.order || o.order.items.length === 0) && (this.debugLog("Basket is now empty, cancelling order and clearing session"), this.clearOrderFromSession());
3258
- }
3259
- } catch (i) {
3260
- throw this.debugLog("Error removing product", i), this.handleError(i), i;
3261
- } finally {
3262
- this.store.dispatch(C(!1));
3263
- }
3005
+ async removeProduct(t, n) {
3006
+ try {
3007
+ this.debugLog("Removing product", {
3008
+ productId: n.id,
3009
+ orderId: t,
3010
+ amount: n.amount
3011
+ }), await this.sdk.removeFromOrder({
3012
+ productId: n.id,
3013
+ orderId: t,
3014
+ additionalData: n.seat ? {
3015
+ seat: {
3016
+ seatId: n.seat.id,
3017
+ seatLabel: n.seat.label
3018
+ }
3019
+ } : null,
3020
+ amount: n.amount
3021
+ });
3022
+ } catch (i) {
3023
+ throw this.debugLog("Error removing product", i), this.handleError(i), i;
3264
3024
  }
3265
3025
  }
3266
- async configurePackage(t) {
3267
- this.store.dispatch(C(!0));
3026
+ async configurePackage(t, n) {
3268
3027
  try {
3269
- const r = this.store.getState().basket.order?.id ?? sessionStorage.getItem(this.orderIdKey) ?? this.generateOrderId(), i = t.items.map((o) => ({
3270
- packageItemId: o.packageItemId,
3271
- eventId: o.eventId
3028
+ const i = n.items.map((r) => ({
3029
+ packageItemId: r.packageItemId,
3030
+ eventId: r.eventId
3272
3031
  }));
3273
3032
  this.debugLog("Configuring package", {
3274
- packageId: t.id,
3275
- orderId: r,
3276
- amount: t.amount,
3033
+ packageId: n.id,
3034
+ orderId: t,
3035
+ amount: n.amount,
3277
3036
  items: i,
3278
3037
  shopId: this.config.shopId
3279
- });
3280
- const s = await this.sdk.configurePackage({
3038
+ }), await this.sdk.configurePackage({
3281
3039
  trackerId: this.config.trackerId,
3282
3040
  shopId: this.config.shopId,
3283
- packageId: t.id,
3284
- orderId: r,
3285
- amount: t.amount,
3041
+ packageId: n.id,
3042
+ orderId: t,
3043
+ amount: n.amount,
3286
3044
  items: i
3287
- });
3288
- if (this.debugLog("Configure package response", s), s?.configurePackage && s.configurePackage.amountReserved > 0) {
3289
- const { orderId: o, expiredAt: u, amountReserved: h } = s.configurePackage;
3290
- return h === 0 && (this.debugLog("Basket is now empty, cancelling order and clearing session"), this.clearOrderFromSession()), this.debugLog("Package configured successfully"), sessionStorage.setItem(this.orderIdKey, r), this.store.dispatch(
3291
- j({
3292
- id: o,
3293
- currency: t.currency,
3294
- expiredAt: u
3295
- })
3296
- ), this.store.dispatch(
3297
- ye({
3298
- input: t,
3299
- amountReserved: h,
3300
- expiredAt: u
3301
- })
3302
- ), null;
3303
- } else
3304
- return this.debugLog("Package configuration failed - no amount reserved"), { error: "Failed to configure package - no items reserved" };
3305
- } catch (n) {
3306
- return this.debugLog("Error configuring package", n), this.handleError(n), { error: n };
3307
- } finally {
3308
- this.store.dispatch(C(!1));
3309
- }
3310
- }
3311
- async configureDelivery(t) {
3312
- this.store.dispatch(C(!0));
3313
- try {
3314
- this.store.dispatch(cn(t));
3315
- } catch (n) {
3316
- throw this.debugLog("Error setting delivery", n), this.handleError(n), n;
3317
- } finally {
3318
- this.store.dispatch(C(!1));
3045
+ }), this.debugLog("Configure package response");
3046
+ } catch (i) {
3047
+ return this.debugLog("Error configuring package", i), this.handleError(i), { error: i };
3319
3048
  }
3049
+ return null;
3320
3050
  }
3321
- async configureCustomer(t) {
3322
- const r = this.getState().order;
3323
- if (!r)
3324
- throw new Error("No active order. Add items to basket first.");
3325
- this.debugLog("Creating/replacing customer", { orderId: r.id, email: t.email });
3051
+ async configureCustomer(t, n) {
3052
+ this.debugLog("Creating/replacing customer", { orderId: t, email: n.email });
3326
3053
  try {
3327
3054
  const i = await this.sdk.createOrderCustomer({
3328
- orderId: r.id,
3329
- customer: t
3055
+ orderId: t,
3056
+ customer: n
3330
3057
  });
3331
- this.debugLog("Customer set successfully", i), this.store.dispatch(ve(t));
3058
+ this.debugLog("Customer set successfully", i);
3332
3059
  } catch (i) {
3333
3060
  throw this.debugLog("Failed to set customer", i), new Error(`Failed to set customer: ${i.message}`);
3334
3061
  }
3335
3062
  }
3336
- async reserveAdditionalPackageItem(t) {
3337
- this.store.dispatch(C(!0));
3063
+ async reserveAdditionalPackageItem(t, n) {
3338
3064
  try {
3339
- const r = this.store.getState().basket.order?.id ?? sessionStorage.getItem(this.orderIdKey) ?? this.generateOrderId();
3340
3065
  this.debugLog("reserve additional packageItem", {
3341
- orderId: r,
3342
- eventId: t.eventId,
3343
- amount: t.amount,
3344
- packageId: t.packageId,
3345
- packageItemId: t.packageItemId
3346
- });
3347
- const i = await this.sdk.reserveAdditionalPackageItem({
3348
- orderId: r,
3349
- eventId: t.eventId,
3350
- amount: t.amount,
3351
- packageId: t.packageId,
3352
- packageItemId: t.packageItemId
3353
- });
3354
- if (this.debugLog("reserve additional packageItem", i), i?.reserveAdditionalPackageItem && i.reserveAdditionalPackageItem.amountReserved > 0) {
3355
- const { orderId: s, expiredAt: o, amountReserved: u } = i.reserveAdditionalPackageItem;
3356
- return this.debugLog("Reserve configured successfully"), sessionStorage.setItem(this.orderIdKey, r), this.store.dispatch(
3357
- j({
3358
- id: s,
3359
- currency: t.currency,
3360
- expiredAt: o
3361
- })
3362
- ), this.store.dispatch(
3363
- dn({
3364
- input: t,
3365
- amountReserved: u,
3366
- expiredAt: o
3367
- })
3368
- ), null;
3369
- } else
3370
- return this.debugLog("Package configuration failed - no amount reserved"), { error: "Failed to configure package - no items reserved" };
3371
- } catch (n) {
3372
- return this.debugLog("Error configuring package", n), this.handleError(n), { error: n };
3373
- } finally {
3374
- this.store.dispatch(C(!1));
3066
+ orderId: t,
3067
+ eventId: n.eventId,
3068
+ amount: n.amount,
3069
+ packageId: n.packageId,
3070
+ packageItemId: n.packageItemId
3071
+ }), await this.sdk.reserveAdditionalPackageItem({
3072
+ orderId: t,
3073
+ eventId: n.eventId,
3074
+ amount: n.amount,
3075
+ packageId: n.packageId,
3076
+ packageItemId: n.packageItemId
3077
+ }), this.debugLog("reserve additional packageItem");
3078
+ } catch (i) {
3079
+ return this.debugLog("Error configuring package", i), this.handleError(i), { error: i };
3375
3080
  }
3081
+ return null;
3376
3082
  }
3377
3083
  // Cancel and clear order functions
3378
- async cancelOrder() {
3379
- const t = sessionStorage.getItem(this.orderIdKey);
3380
- t && (this.debugLog("Cancelling order", { orderId: t }), await this.sdk.deleteOrder({ orderId: t }), this.clearOrderFromSession(), this.debugLog("Order cancelled successfully"));
3381
- }
3382
- clearOrderFromSession() {
3383
- this.debugLog("Clearing order from session"), sessionStorage.removeItem(this.orderIdKey), this.store.dispatch(ke());
3384
- }
3385
- // Private functions for fetching the current order from a session
3386
- async restoreOrderFromSession() {
3387
- const t = sessionStorage.getItem(this.orderIdKey);
3388
- if (t) {
3389
- this.debugLog("Found existing order ID in session, restoring...", { orderId: t });
3390
- try {
3391
- await this.fetchOrder(t), this.debugLog("Order restored successfully"), this.store.dispatch(C(!1));
3392
- } catch (n) {
3393
- this.debugLog("Failed to restore order, clearing session", n), this.clearOrderFromSession();
3394
- }
3395
- }
3084
+ async cancelOrder(t) {
3085
+ t && (this.debugLog("Cancelling order", { orderId: t }), await this.sdk.deleteOrder({ orderId: t }), this.debugLog("Order cancelled successfully"));
3396
3086
  }
3397
3087
  async findOrder(t, n) {
3398
3088
  try {
3399
- return await this.sdk.findOrderById({ id: t, reference: n });
3400
- } catch (r) {
3401
- return this.debugLog("Error finding order", r), this.handleError(r), null;
3089
+ return (await this.sdk.findOrderById({ id: t, reference: n })).findOrder ?? null;
3090
+ } catch (i) {
3091
+ return this.debugLog("Error finding order", i), this.handleError(i), null;
3402
3092
  }
3403
3093
  }
3404
- async fetchOrder(t) {
3094
+ async findActiveOrder(t) {
3405
3095
  this.debugLog("Fetching order from server", { orderId: t });
3406
3096
  try {
3407
3097
  const n = await this.sdk.findActiveOrderById({ id: t });
3408
- if (!n?.findOrder) {
3409
- this.debugLog("Order not found"), this.clearOrderFromSession();
3410
- return;
3411
- }
3412
- const r = n.findOrder;
3413
- this.debugLog("Order fetched successfully", r);
3414
- const i = r.items, s = i.filter((c) => c.product != null && c.amount > 0).map((c) => {
3098
+ if (!n?.findOrder)
3099
+ return null;
3100
+ const i = n.findOrder;
3101
+ this.debugLog("Order fetched successfully", i);
3102
+ const r = i.items, s = r.filter((d) => d.product != null && d.amount > 0).map((d) => {
3415
3103
  let m = _.PRODUCT;
3416
- return c.product.type === "PROMOTER" ? m = _.ADD_ONS : c.product.type === "PICKUP" ? m = _.PICKUP : c.product.type === "DELIVERY" && (m = _.DELIVERY), {
3417
- id: c.product.id,
3104
+ return d.product.type === "PROMOTER" ? m = _.ADD_ONS : d.product.type === "PICKUP" ? m = _.PICKUP : d.product.type === "DELIVERY" && (m = _.DELIVERY), {
3105
+ id: d.product.id,
3418
3106
  type: m,
3419
- name: c.product.name,
3420
- icon: c.product.icon,
3421
- description: c.product.description,
3422
- amount: c.amount,
3423
- price: c.price ?? 0,
3424
- depositPrice: c.depositPrice ?? 0,
3425
- originalPrice: c.originalPrice ?? 0,
3426
- serviceFee: c.serviceFee ?? 0,
3427
- seats: c.seats?.map((g) => ({
3428
- id: g.id,
3429
- label: g.label
3107
+ name: d.product.name,
3108
+ icon: d.product.icon,
3109
+ description: d.product.description,
3110
+ amount: d.amount,
3111
+ price: d.price ?? 0,
3112
+ depositPrice: d.depositPrice ?? 0,
3113
+ originalPrice: d.originalPrice ?? 0,
3114
+ serviceFee: d.serviceFee ?? 0,
3115
+ seats: d.seats?.map((y) => ({
3116
+ id: y.seatsIoId,
3117
+ label: y.label
3430
3118
  }))
3431
3119
  };
3432
- }), o = i.filter((c) => c.packageItem != null && c.amount > 0).reduce((c, m) => {
3120
+ }), o = r.filter((d) => d.packageItem != null && d.amount > 0).reduce((d, m) => {
3433
3121
  const {
3434
- packageItem: g,
3435
- event: y,
3436
- amount: I,
3437
- price: O,
3438
- serviceFee: x,
3439
- depositPrice: T,
3440
- originalPrice: L
3441
- } = m, A = g.package.id;
3442
- c[A] ? (c[A].price += O ?? 0, c[A].serviceFee += x ?? 0, c[A].originalPrice += L ?? 0, c[A].depositPrice += T ?? O ?? 0) : c[A] = {
3122
+ packageItem: y,
3123
+ event: I,
3124
+ amount: D,
3125
+ price: N,
3126
+ serviceFee: k,
3127
+ depositPrice: C,
3128
+ originalPrice: x
3129
+ } = m, A = y.package.id;
3130
+ d[A] ? (d[A].price += N ?? 0, d[A].serviceFee += k ?? 0, d[A].originalPrice += x ?? 0, d[A].depositPrice += C ?? N ?? 0) : d[A] = {
3443
3131
  id: A,
3444
3132
  type: _.PACKAGE,
3445
- name: g.package.name,
3446
- amount: I,
3447
- price: O ?? 0,
3448
- serviceFee: x ?? 0,
3449
- depositPrice: T ?? O ?? 0,
3450
- originalPrice: L ?? 0,
3133
+ name: y.package.name,
3134
+ amount: D,
3135
+ price: N ?? 0,
3136
+ serviceFee: k ?? 0,
3137
+ depositPrice: C ?? N ?? 0,
3138
+ originalPrice: x ?? 0,
3451
3139
  packageItems: []
3452
3140
  };
3453
- const N = R.fromISO(y.startAt, {
3454
- zone: y.timezone
3455
- }), D = R.fromISO(y.endAt, {
3456
- zone: y.timezone
3141
+ const O = L.fromISO(I.startAt, {
3142
+ zone: I.timezone
3143
+ }), b = L.fromISO(I.endAt, {
3144
+ zone: I.timezone
3457
3145
  });
3458
- return c[A].packageItems.push({
3459
- packageItemId: g.id,
3460
- eventId: y.id,
3461
- name: y.name,
3462
- startAt: N.toJSDate().toISOString(),
3463
- endAt: D.toJSDate().toISOString()
3464
- }), c;
3465
- }, {}), u = [
3146
+ return d[A].packageItems.push({
3147
+ packageItemId: y.id,
3148
+ eventId: I.id,
3149
+ name: I.name,
3150
+ startAt: O.toJSDate().toISOString(),
3151
+ endAt: b.toJSDate().toISOString()
3152
+ }), d;
3153
+ }, {}), l = [
3466
3154
  ...s,
3467
3155
  ...Object.values(o)
3468
3156
  ];
3469
- if (u.length === 0) {
3470
- this.debugLog("All order items have zero or negative amounts, clearing session"), this.clearOrderFromSession();
3471
- return;
3472
- }
3473
- const h = i.filter((c) => c.amount > 0).map((c) => new Date(c.expiredAt).getTime());
3474
- if (h.length === 0) {
3475
- this.debugLog("No valid items with expiration times, clearing session"), this.clearOrderFromSession();
3476
- return;
3477
- }
3478
- const p = R.fromMillis(Math.min(...h));
3479
- this.store.dispatch(ke()), this.store.dispatch(
3480
- j({
3481
- id: r.id,
3482
- currency: r.currency,
3483
- expiredAt: p.toJSDate().toISOString()
3484
- })
3485
- ), u.forEach((c) => {
3486
- c.type === _.PACKAGE ? this.store.dispatch(
3487
- ye({
3488
- input: {
3489
- id: c.id,
3490
- name: c.name,
3491
- currency: r.currency,
3492
- price: c.originalPrice ?? 0,
3493
- depositPrice: c.depositPrice,
3494
- discountPrice: (c.price ?? 0) < (c.originalPrice ?? 0) ? c.price : void 0,
3495
- serviceFee: c.serviceFee ?? 0,
3496
- amount: c.amount,
3497
- items: c.packageItems || []
3498
- },
3499
- amountReserved: c.amount,
3500
- expiredAt: p.toJSDate().toISOString()
3501
- })
3502
- ) : this.store.dispatch(
3503
- Ee({
3504
- input: {
3505
- id: c.id,
3506
- name: c.name,
3507
- price: c.originalPrice ?? 0,
3508
- depositPrice: c.depositPrice,
3509
- discountPrice: (c.price ?? 0) < (c.originalPrice ?? 0) ? c.price : void 0,
3510
- serviceFee: c.serviceFee,
3511
- currency: r.currency,
3512
- amount: c.amount
3513
- },
3514
- amountReserved: c.amount,
3515
- expiredAt: p.toJSDate().toISOString()
3516
- })
3517
- );
3518
- }), r.mainBooker && (this.debugLog("Order has customer (mainBooker)", r.mainBooker), this.store.dispatch(
3519
- ve({
3520
- firstName: r.mainBooker.firstName ?? void 0,
3521
- lastName: r.mainBooker.lastName ?? void 0,
3522
- email: r.mainBooker.email ?? void 0,
3523
- age: r.mainBooker.age ?? void 0,
3524
- gender: r.mainBooker.gender ?? void 0,
3525
- residence: r.mainBooker.residence ?? void 0,
3526
- extraInfo: r.mainBooker.extraInfo ?? void 0
3527
- })
3528
- )), this.debugLog("Order state fully synced", this.getState());
3157
+ if (l.length === 0)
3158
+ return this.debugLog("All order items have zero or negative amounts, clearing session"), null;
3159
+ const f = r.filter((d) => d.amount > 0).map((d) => new Date(d.expiredAt).getTime());
3160
+ if (f.length === 0)
3161
+ return this.debugLog("No valid items with expiration times, clearing session"), null;
3162
+ const p = L.fromMillis(Math.min(...f)), g = l.reduce((d, m) => d + (m.amount || 0), 0);
3163
+ return {
3164
+ id: i.id,
3165
+ currency: i.currency,
3166
+ expiredAt: p.toJSDate().toISOString(),
3167
+ items: l,
3168
+ customer: i.mainBooker ? {
3169
+ firstName: i.mainBooker.firstName ?? void 0,
3170
+ lastName: i.mainBooker.lastName ?? void 0,
3171
+ email: i.mainBooker.email ?? void 0,
3172
+ age: i.mainBooker.age ?? void 0,
3173
+ gender: i.mainBooker.gender ?? void 0,
3174
+ residence: i.mainBooker.residence ?? void 0,
3175
+ extraInfo: i.mainBooker.extraInfo ?? void 0
3176
+ } : null,
3177
+ count: g
3178
+ };
3529
3179
  } catch (n) {
3530
3180
  throw this.debugLog("Error fetching order", n), n;
3531
3181
  }
3532
3182
  }
3533
- // Private helper functions
3534
- generateOrderId() {
3535
- return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (t) => {
3536
- const n = Math.random() * 16 | 0;
3537
- return (t === "x" ? n : n & 3 | 8).toString(16);
3538
- });
3539
- }
3540
3183
  debugLog(t, n) {
3541
3184
  this.config.debug && console.log(`[BasketService] ${t}`, n || "");
3542
3185
  }
3543
3186
  handleError(t) {
3544
3187
  const n = t;
3545
3188
  if (n.graphQLErrors && n.graphQLErrors.length > 0) {
3546
- const r = n.graphQLErrors[0];
3547
- r.extensions?.status === "RATE_LIMIT" && console.error("Rate Limit reached"), r.extensions?.status === "SOLD_OUT" && console.error("Product sold out");
3189
+ const i = n.graphQLErrors[0];
3190
+ i.extensions?.status === "RATE_LIMIT" && console.error("Rate Limit reached"), i.extensions?.status === "SOLD_OUT" && console.error("Product sold out");
3548
3191
  }
3549
3192
  if (n.response?.errors && n.response.errors.length > 0) {
3550
- const r = n.response.errors[0];
3551
- console.error("GraphQL Error:", r.message), r.extensions?.code && console.error("Error Code:", r.extensions.code);
3193
+ const i = n.response.errors[0];
3194
+ console.error("GraphQL Error:", i.message), i.extensions?.code && console.error("Error Code:", i.extensions.code);
3552
3195
  }
3553
3196
  }
3554
- getState() {
3555
- return this.store.getState().basket;
3556
- }
3557
3197
  }
3558
- const ln = E`
3559
- query EventOverviewPage($organizationId: ID!, $hostingIds: [String!], $trackerId: String, $filterEventStatuses: [EventStatus!], $dateRange: DateRangeInput, $page: PageInput, $sorts: [SortInput!], $searchTerm: String, $priceRange: PriceRangeInput) {
3198
+ const Xt = E`
3199
+ query EventOverviewPage($organizationId: ID!, $hostingIds: [String!], $locationIds: [String!], $excludedEventIds: [String!], $trackerId: String, $filterEventStatuses: [EventStatus!], $dateRange: DateRangeInput, $page: PageInput, $sorts: [SortInput!], $searchTerm: String, $priceRange: PriceRangeInput) {
3560
3200
  findAllPublicEventByOrganizationId(
3561
3201
  id: $organizationId
3562
3202
  hostingIds: $hostingIds
3203
+ locationIds: $locationIds
3204
+ excludedEventIds: $excludedEventIds
3563
3205
  trackerLinkId: $trackerId
3564
3206
  filterEventStatuses: $filterEventStatuses
3565
3207
  date: $dateRange
@@ -3589,11 +3231,12 @@ const ln = E`
3589
3231
  }
3590
3232
  infoDescription
3591
3233
  startingPrice
3234
+ totalViews
3592
3235
  }
3593
3236
  count
3594
3237
  }
3595
3238
  }
3596
- `, pn = E`
3239
+ `, Wt = E`
3597
3240
  query EventDetailPage($eventId: ID!) {
3598
3241
  findPublicEventById(id: $eventId) {
3599
3242
  id
@@ -3618,9 +3261,10 @@ const ln = E`
3618
3261
  infoDescription
3619
3262
  maxAmountOfTicketsPerOrder
3620
3263
  startingPrice
3264
+ totalViews
3621
3265
  }
3622
3266
  }
3623
- `, hn = E`
3267
+ `, Zt = E`
3624
3268
  query findProductsByEventId($eventId: ID!, $promoCode: String, $trackerId: String, $productTypes: [ProductType!]) {
3625
3269
  findPublicProductsByEventId(
3626
3270
  eventId: $eventId
@@ -3654,30 +3298,30 @@ const ln = E`
3654
3298
  showEndSalesAtTag
3655
3299
  }
3656
3300
  }
3657
- `, fn = (e, t, n, r) => e();
3658
- function mn(e, t = fn) {
3301
+ `, Kt = (e, t, n, i) => e();
3302
+ function en(e, t = Kt) {
3659
3303
  return {
3660
- EventOverviewPage(n, r, i) {
3661
- return t((s) => e.request({ document: ln, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "EventOverviewPage", "query", n);
3304
+ EventOverviewPage(n, i, r) {
3305
+ return t((s) => e.request({ document: Xt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "EventOverviewPage", "query", n);
3662
3306
  },
3663
- EventDetailPage(n, r, i) {
3664
- return t((s) => e.request({ document: pn, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "EventDetailPage", "query", n);
3307
+ EventDetailPage(n, i, r) {
3308
+ return t((s) => e.request({ document: Wt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "EventDetailPage", "query", n);
3665
3309
  },
3666
- findProductsByEventId(n, r, i) {
3667
- return t((s) => e.request({ document: hn, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "findProductsByEventId", "query", n);
3310
+ findProductsByEventId(n, i, r) {
3311
+ return t((s) => e.request({ document: Zt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findProductsByEventId", "query", n);
3668
3312
  }
3669
3313
  };
3670
3314
  }
3671
- function gn(e) {
3315
+ function tn(e) {
3672
3316
  const t = /(query|mutation|subscription)\s+(\w+)/.exec(e);
3673
3317
  if (!t) return { type: "unknown" };
3674
- const n = t[1], r = t[2];
3675
- return { type: n, name: r };
3318
+ const n = t[1], i = t[2];
3319
+ return { type: n, name: i };
3676
3320
  }
3677
- async function In(e) {
3321
+ async function nn(e) {
3678
3322
  if (typeof globalThis < "u" && globalThis.crypto?.subtle) {
3679
- const n = new TextEncoder().encode(e), r = await globalThis.crypto.subtle.digest("SHA-256", n);
3680
- return Array.from(new Uint8Array(r)).map((i) => i.toString(16).padStart(2, "0")).join("");
3323
+ const n = new TextEncoder().encode(e), i = await globalThis.crypto.subtle.digest("SHA-256", n);
3324
+ return Array.from(new Uint8Array(i)).map((r) => r.toString(16).padStart(2, "0")).join("");
3681
3325
  }
3682
3326
  try {
3683
3327
  const { createHash: t } = await import("./__vite-browser-external-l0sNRNKZ.js");
@@ -3686,82 +3330,82 @@ async function In(e) {
3686
3330
  throw new Error("SHA-256 is not available in this environment");
3687
3331
  }
3688
3332
  }
3689
- function En(e) {
3333
+ function rn(e) {
3690
3334
  const t = { "content-type": "application/json" };
3691
3335
  if (e)
3692
- for (const [n, r] of Object.entries(e))
3693
- typeof r < "u" && (t[n] = String(r));
3336
+ for (const [n, i] of Object.entries(e))
3337
+ typeof i < "u" && (t[n] = String(i));
3694
3338
  return t;
3695
3339
  }
3696
- function Ae(e, t) {
3340
+ function me(e, t) {
3697
3341
  return e?.length ? e.some((n) => t.includes(n?.extensions?.code) || t.includes(n?.message)) : !1;
3698
3342
  }
3699
- function Oe(e, t, n, r, i) {
3343
+ function ge(e, t, n, i, r) {
3700
3344
  const s = new Error(e);
3701
- return s.response = { data: i.json?.data, errors: i.json?.errors, status: i.status }, s.request = { query: t, variables: n, operationName: r }, s.graphQLErrors = i.json?.errors, s;
3345
+ return s.response = { data: r.json?.data, errors: r.json?.errors, status: r.status }, s.request = { query: t, variables: n, operationName: i }, s.graphQLErrors = r.json?.errors, s;
3702
3346
  }
3703
- function ie(e, t, n, r, i) {
3704
- if (i.json?.errors?.length)
3705
- throw Oe(`GraphQL request failed${e ? ` (${e})` : ""}`, t, n, r, i);
3706
- if (typeof i.json?.data > "u")
3707
- throw Oe("GraphQL request failed: no data received", t, n, r, i);
3708
- return i.json.data;
3347
+ function ne(e, t, n, i, r) {
3348
+ if (r.json?.errors?.length)
3349
+ throw ge(`GraphQL request failed${e ? ` (${e})` : ""}`, t, n, i, r);
3350
+ if (typeof r.json?.data > "u")
3351
+ throw ge("GraphQL request failed: no data received", t, n, i, r);
3352
+ return r.json.data;
3709
3353
  }
3710
- class ee extends de {
3354
+ class Z extends oe {
3711
3355
  async request(t, ...n) {
3712
- let r = t, i, s, o;
3713
- t && typeof t == "object" && "document" in t ? (r = t.document, i = t.variables, s = t.requestHeaders, o = t.signal) : (i = n[0], s = n[1]);
3714
- const u = typeof r == "string" ? r : $t(r), { type: h, name: p } = gn(u), c = await In(u), m = i ?? {}, g = this.url ?? this.endpoint ?? "", y = En(s), I = async (D) => {
3715
- const P = await fetch(g, { method: "POST", headers: y, body: JSON.stringify(D), signal: o });
3716
- let b = null;
3356
+ let i = t, r, s, o;
3357
+ t && typeof t == "object" && "document" in t ? (i = t.document, r = t.variables, s = t.requestHeaders, o = t.signal) : (r = n[0], s = n[1]);
3358
+ const l = typeof i == "string" ? i : bt(i), { type: f, name: p } = tn(l), g = await nn(l), d = r ?? {}, m = this.url ?? this.endpoint ?? "", y = rn(s), I = async (O) => {
3359
+ const b = await fetch(m, { method: "POST", headers: y, body: JSON.stringify(O), signal: o });
3360
+ let P = null;
3717
3361
  try {
3718
- b = await P.json();
3362
+ P = await b.json();
3719
3363
  } catch {
3720
- b = null;
3364
+ P = null;
3721
3365
  }
3722
- return { status: P.status, json: b };
3723
- }, O = async (D) => {
3724
- const P = new URLSearchParams();
3725
- for (const [He, q] of Object.entries(D))
3726
- typeof q > "u" || P.set(He, typeof q == "string" ? q : JSON.stringify(q));
3727
- const b = g.includes("?") ? "&" : "?", B = `${g}${b}${P.toString()}`, pe = await fetch(B, { method: "GET", headers: y, signal: o });
3728
- let te = null;
3366
+ return { status: b.status, json: P };
3367
+ }, D = async (O) => {
3368
+ const b = new URLSearchParams();
3369
+ for (const [Ve, M] of Object.entries(O))
3370
+ typeof M > "u" || b.set(Ve, typeof M == "string" ? M : JSON.stringify(M));
3371
+ const P = m.includes("?") ? "&" : "?", $ = `${m}${P}${b.toString()}`, ue = await fetch($, { method: "GET", headers: y, signal: o });
3372
+ let K = null;
3729
3373
  try {
3730
- te = await pe.json();
3374
+ K = await ue.json();
3731
3375
  } catch {
3732
- te = null;
3376
+ K = null;
3733
3377
  }
3734
- return { status: pe.status, json: te };
3735
- }, x = {
3378
+ return { status: ue.status, json: K };
3379
+ }, N = {
3736
3380
  operationName: p,
3737
- variables: m,
3738
- extensions: { persistedQuery: { version: 1, sha256Hash: c } }
3739
- }, T = async (D, P, b) => {
3740
- if (Ae(D.json?.errors, ["PERSISTED_QUERY_NOT_FOUND", "PersistedQueryNotFound"])) {
3741
- const B = await P();
3742
- return ie("APQ register", u, m, p, B);
3381
+ variables: d,
3382
+ extensions: { persistedQuery: { version: 1, sha256Hash: g } }
3383
+ }, k = async (O, b, P) => {
3384
+ if (me(O.json?.errors, ["PERSISTED_QUERY_NOT_FOUND", "PersistedQueryNotFound"])) {
3385
+ const $ = await b();
3386
+ return ne("APQ register", l, d, p, $);
3743
3387
  }
3744
- if (Ae(D.json?.errors, ["PERSISTED_QUERY_NOT_SUPPORTED"])) {
3745
- const B = await b();
3746
- return ie("no APQ support", u, m, p, B);
3388
+ if (me(O.json?.errors, ["PERSISTED_QUERY_NOT_SUPPORTED"])) {
3389
+ const $ = await P();
3390
+ return ne("no APQ support", l, d, p, $);
3747
3391
  }
3748
- return ie("", u, m, p, D);
3392
+ return ne("", l, d, p, O);
3749
3393
  };
3750
- if (h === "query") {
3751
- const D = await O(x);
3752
- return T(D, () => I({ ...x, query: u }), () => I({ operationName: p, variables: m, query: u }));
3394
+ if (f === "query") {
3395
+ const O = await D(N);
3396
+ return k(O, () => I({ ...N, query: l }), () => I({ operationName: p, variables: d, query: l }));
3753
3397
  }
3754
- const L = await I(x);
3755
- return T(L, () => I({ ...x, query: u }), () => I({ operationName: p, variables: m, query: u }));
3398
+ const C = await I(N);
3399
+ return k(C, () => I({ ...N, query: l }), () => I({ operationName: p, variables: d, query: l }));
3756
3400
  }
3757
3401
  }
3758
- class yn {
3402
+ class sn {
3759
3403
  config;
3760
3404
  sdk;
3761
3405
  constructor(t) {
3762
- this.config = t, this.sdk = mn(new ee(t.apiUrl));
3406
+ this.config = t, this.sdk = en(new Z(t.apiUrl));
3763
3407
  }
3764
- async fetchEvents(t = {}) {
3408
+ async getEvents(t = {}) {
3765
3409
  try {
3766
3410
  t.page && (t.page = {
3767
3411
  index: t.page.index ?? 0,
@@ -3778,6 +3422,8 @@ class yn {
3778
3422
  const n = await this.sdk.EventOverviewPage({
3779
3423
  organizationId: this.config.organizationId,
3780
3424
  hostingIds: t.hostingIds,
3425
+ locationIds: t.locationIds,
3426
+ excludedEventIds: t.excludedEventIds,
3781
3427
  filterEventStatuses: t.statuses,
3782
3428
  dateRange: t.dateRange && t.dateRange.from && t.dateRange.till ? {
3783
3429
  from: t.dateRange.from.toISO(),
@@ -3790,65 +3436,67 @@ class yn {
3790
3436
  priceRange: t.priceRange
3791
3437
  });
3792
3438
  if (this.debugLog("Raw GraphQL response", n), n?.findAllPublicEventByOrganizationId?.data) {
3793
- const r = n.findAllPublicEventByOrganizationId.data.map((i) => ({
3794
- id: i.id,
3795
- name: i.name,
3796
- icon: i.icon,
3797
- banner: i.banner,
3798
- description: i.description,
3799
- addonDescription: i.addonDescription,
3800
- startAt: R.fromISO(i.startAt, { zone: i.timezone }).toJSDate().toISOString(),
3801
- endAt: R.fromISO(i.endAt, { zone: i.timezone }).toJSDate().toISOString(),
3802
- timezone: i.timezone,
3439
+ const i = n.findAllPublicEventByOrganizationId.data.map((r) => ({
3440
+ id: r.id,
3441
+ name: r.name,
3442
+ icon: r.icon,
3443
+ banner: r.banner,
3444
+ description: r.description,
3445
+ addonDescription: r.addonDescription,
3446
+ startAt: L.fromISO(r.startAt, { zone: r.timezone }).toJSDate().toISOString(),
3447
+ endAt: L.fromISO(r.endAt, { zone: r.timezone }).toJSDate().toISOString(),
3448
+ timezone: r.timezone,
3803
3449
  startSalesAt: null,
3804
3450
  endSalesAt: null,
3805
- slug: i.slug ?? "ERROR",
3451
+ slug: r.slug ?? "ERROR",
3806
3452
  facebookPixelId: null,
3807
- status: i.status,
3808
- location: i.location ? {
3809
- id: i.location.id,
3810
- name: i.location.name,
3811
- address: i.location.address
3453
+ status: r.status,
3454
+ location: r.location ? {
3455
+ id: r.location.id,
3456
+ name: r.location.name,
3457
+ address: r.location.address
3812
3458
  } : void 0,
3813
- infoDescription: i.infoDescription,
3814
- startingPrice: i.startingPrice
3459
+ infoDescription: r.infoDescription,
3460
+ startingPrice: r.startingPrice,
3461
+ totalViews: r.totalViews
3815
3462
  }));
3816
- return this.debugLog("Processed events", { events: r, count: r.length }), [r, n.findAllPublicEventByOrganizationId.count ?? 0];
3463
+ return this.debugLog("Processed events", { events: i, count: i.length }), [i, n.findAllPublicEventByOrganizationId.count ?? 0];
3817
3464
  } else
3818
3465
  return this.debugLog("No events found in response"), [[], 0];
3819
3466
  } catch (n) {
3820
3467
  throw this.debugLog("Error fetching events", n), n;
3821
3468
  }
3822
3469
  }
3823
- async fetchEvent(t) {
3470
+ async getEvent(t) {
3824
3471
  try {
3825
3472
  this.debugLog("Fetching single event", { eventId: t });
3826
3473
  const n = await this.sdk.EventDetailPage({ eventId: t });
3827
3474
  if (this.debugLog("Raw GraphQL response", n), n?.findPublicEventById) {
3828
- const r = n.findPublicEventById, i = {
3829
- id: r.id,
3830
- name: r.name,
3831
- icon: r.icon,
3832
- banner: r.banner,
3833
- description: r.description,
3834
- addonDescription: r.addonDescription,
3835
- startAt: R.fromISO(r.startAt, { zone: r.timezone }).toJSDate().toISOString(),
3836
- endAt: R.fromISO(r.endAt, { zone: r.timezone }).toJSDate().toISOString(),
3837
- timezone: r.timezone,
3838
- startSalesAt: r.startSalesAt,
3839
- endSalesAt: r.endSalesAt,
3840
- slug: r.slug ?? "ERROR",
3841
- facebookPixelId: r.facebookPixelId,
3842
- status: r.status,
3843
- location: r.location ? {
3844
- id: r.location.id,
3845
- name: r.location.name,
3846
- address: r.location.address
3475
+ const i = n.findPublicEventById, r = {
3476
+ id: i.id,
3477
+ name: i.name,
3478
+ icon: i.icon,
3479
+ banner: i.banner,
3480
+ description: i.description,
3481
+ addonDescription: i.addonDescription,
3482
+ startAt: L.fromISO(i.startAt, { zone: i.timezone }).toJSDate().toISOString(),
3483
+ endAt: L.fromISO(i.endAt, { zone: i.timezone }).toJSDate().toISOString(),
3484
+ timezone: i.timezone,
3485
+ startSalesAt: i.startSalesAt,
3486
+ endSalesAt: i.endSalesAt,
3487
+ slug: i.slug ?? "ERROR",
3488
+ facebookPixelId: i.facebookPixelId,
3489
+ status: i.status,
3490
+ location: i.location ? {
3491
+ id: i.location.id,
3492
+ name: i.location.name,
3493
+ address: i.location.address
3847
3494
  } : void 0,
3848
- infoDescription: r.infoDescription,
3849
- startingPrice: r.startingPrice
3495
+ infoDescription: i.infoDescription,
3496
+ startingPrice: i.startingPrice,
3497
+ totalViews: i.totalViews
3850
3498
  };
3851
- return this.debugLog("Processed single event", i), i;
3499
+ return this.debugLog("Processed single event", r), r;
3852
3500
  } else {
3853
3501
  this.debugLog("No event found for id", t);
3854
3502
  return;
@@ -3857,22 +3505,22 @@ class yn {
3857
3505
  throw this.debugLog("Error fetching single event", n), n;
3858
3506
  }
3859
3507
  }
3860
- async fetchProducts(t, n, r) {
3508
+ async getProducts(t, n, i) {
3861
3509
  try {
3862
3510
  this.debugLog("Fetching products for event", {
3863
3511
  eventId: t,
3864
- promoCode: r,
3512
+ promoCode: i,
3865
3513
  trackerId: this.config.trackerId,
3866
3514
  productTypes: n
3867
3515
  });
3868
- const i = await this.sdk.findProductsByEventId({
3516
+ const r = await this.sdk.findProductsByEventId({
3869
3517
  eventId: t,
3870
- promoCode: r,
3518
+ promoCode: i,
3871
3519
  trackerId: this.config.trackerId,
3872
3520
  productTypes: n
3873
3521
  });
3874
- if (i?.findPublicProductsByEventId) {
3875
- const s = i.findPublicProductsByEventId.map((o) => ({
3522
+ if (r?.findPublicProductsByEventId) {
3523
+ const s = r.findPublicProductsByEventId.map((o) => ({
3876
3524
  id: o.id,
3877
3525
  name: o.name,
3878
3526
  category: o.category ? {
@@ -3903,21 +3551,22 @@ class yn {
3903
3551
  }), s;
3904
3552
  }
3905
3553
  return;
3906
- } catch (i) {
3907
- throw this.debugLog("Error fetching products", { eventId: t, error: i }), i;
3554
+ } catch (r) {
3555
+ throw this.debugLog("Error fetching products", { eventId: t, error: r }), r;
3908
3556
  }
3909
3557
  }
3910
3558
  debugLog(t, n) {
3911
3559
  this.config.debug && console.log(`[EventService:${this.config.organizationId}] ${t}`, n || "");
3912
3560
  }
3913
3561
  }
3914
- const vn = E`
3915
- query findPaymentMethods($orderId: ID!, $orderItemId: String, $amountOfTickets: Int, $paymentMethodId: String) {
3562
+ const an = E`
3563
+ query findPaymentMethods($orderId: ID!, $orderItemId: String, $amountOfTickets: Int, $paymentMethodId: String, $withTicketProtection: Boolean) {
3916
3564
  findPaymentDetails(
3917
3565
  orderId: $orderId
3918
3566
  orderItemId: $orderItemId
3919
3567
  amountOfTickets: $amountOfTickets
3920
3568
  paymentMethodId: $paymentMethodId
3569
+ withTicketProtection: $withTicketProtection
3921
3570
  ) {
3922
3571
  methods {
3923
3572
  id
@@ -3939,26 +3588,26 @@ const vn = E`
3939
3588
  paymentSpesificTransactionFee
3940
3589
  }
3941
3590
  }
3942
- `, kn = E`
3591
+ `, on = E`
3943
3592
  mutation createDigitalPayment($input: CreateDigitalOrderPaymentInput!) {
3944
3593
  createDigitalOrderPayment(input: $input)
3945
3594
  }
3946
- `, An = (e, t, n, r) => e();
3947
- function On(e, t = An) {
3595
+ `, cn = (e, t, n, i) => e();
3596
+ function dn(e, t = cn) {
3948
3597
  return {
3949
- findPaymentMethods(n, r, i) {
3950
- return t((s) => e.request({ document: vn, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "findPaymentMethods", "query", n);
3598
+ findPaymentMethods(n, i, r) {
3599
+ return t((s) => e.request({ document: an, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findPaymentMethods", "query", n);
3951
3600
  },
3952
- createDigitalPayment(n, r, i) {
3953
- return t((s) => e.request({ document: kn, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "createDigitalPayment", "mutation", n);
3601
+ createDigitalPayment(n, i, r) {
3602
+ return t((s) => e.request({ document: on, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "createDigitalPayment", "mutation", n);
3954
3603
  }
3955
3604
  };
3956
3605
  }
3957
- class Tn {
3606
+ class un {
3958
3607
  config;
3959
3608
  sdk;
3960
3609
  constructor(t) {
3961
- this.config = t, this.sdk = On(new de(t.apiUrl));
3610
+ this.config = t, this.sdk = dn(new oe(t.apiUrl));
3962
3611
  }
3963
3612
  async getPaymentDetails(t) {
3964
3613
  this.debugLog("Fetching payment methods", t);
@@ -3967,31 +3616,32 @@ class Tn {
3967
3616
  orderId: t.orderId,
3968
3617
  orderItemId: t.orderItemId,
3969
3618
  amountOfTickets: t.amountOfTickets,
3970
- paymentMethodId: t.paymentMethodId
3619
+ paymentMethodId: t.paymentMethodId,
3620
+ withTicketProtection: t.withTicketProtection
3971
3621
  });
3972
3622
  if (!n?.findPaymentDetails)
3973
3623
  throw this.debugLog("No payment details found"), new Error("No payment details found for this order");
3974
- const r = n.findPaymentDetails;
3624
+ const i = n.findPaymentDetails;
3975
3625
  return this.debugLog("Payment methods fetched successfully", {
3976
- methodCount: r.methods?.length ?? 0,
3977
- transactionPrice: r.transactionPrice,
3978
- transactionDiscount: r.transactionDiscount,
3979
- transactionFee: r.transactionFee,
3980
- paymentSpesificTransactionFee: r.paymentSpesificTransactionFee
3626
+ methodCount: i.methods?.length ?? 0,
3627
+ transactionPrice: i.transactionPrice,
3628
+ transactionDiscount: i.transactionDiscount,
3629
+ transactionFee: i.transactionFee,
3630
+ paymentSpesificTransactionFee: i.paymentSpesificTransactionFee
3981
3631
  }), {
3982
- transactionPrice: r.transactionPrice,
3983
- transactionDiscount: r.transactionPrice,
3984
- transactionFee: r.transactionFee ?? null,
3985
- paymentSpesificTransactionFee: r.paymentSpesificTransactionFee ?? null,
3986
- methods: r.methods?.map((i) => ({
3987
- id: i.id,
3988
- name: i.name,
3989
- image: i.image,
3990
- fee: i.fee ? {
3991
- type: i.fee.type,
3992
- value: i.fee.value
3632
+ transactionPrice: i.transactionPrice,
3633
+ transactionDiscount: i.transactionPrice,
3634
+ transactionFee: i.transactionFee ?? null,
3635
+ paymentSpesificTransactionFee: i.paymentSpesificTransactionFee ?? null,
3636
+ methods: i.methods?.map((r) => ({
3637
+ id: r.id,
3638
+ name: r.name,
3639
+ image: r.image,
3640
+ fee: r.fee ? {
3641
+ type: r.fee.type,
3642
+ value: r.fee.value
3993
3643
  } : null,
3994
- issuers: i.issuers?.map((s) => ({
3644
+ issuers: r.issuers?.map((s) => ({
3995
3645
  id: s.id,
3996
3646
  name: s.name,
3997
3647
  image: s.image
@@ -4014,16 +3664,17 @@ class Tn {
4014
3664
  initiatedByUserId: t.initiatedByUserId,
4015
3665
  initiatedByTeamId: t.initiatedByTeamId,
4016
3666
  amountOfTickets: t.amountOfTickets,
4017
- orderItemId: t.orderItemId
3667
+ orderItemId: t.orderItemId,
3668
+ withTicketProtection: t.withTicketProtection
4018
3669
  };
4019
3670
  t.customer && (n.customer = t.customer), t.products && (n.products = t.products), t.description && (n.description = t.description), t.reference && (n.reference = t.reference), t.ipAddress && (n.ipAddress = t.ipAddress);
4020
- const r = await this.sdk.createDigitalPayment({
3671
+ const i = await this.sdk.createDigitalPayment({
4021
3672
  input: n
4022
3673
  });
4023
- if (!r?.createDigitalOrderPayment)
3674
+ if (!i?.createDigitalOrderPayment)
4024
3675
  throw this.debugLog("Failed to create payment"), new Error("Failed to create payment for this order");
4025
- const i = r.createDigitalOrderPayment;
4026
- return this.debugLog("Payment created successfully", { paymentUrl: i }), { paymentUrl: i };
3676
+ const r = i.createDigitalOrderPayment;
3677
+ return this.debugLog("Payment created successfully", { paymentUrl: r }), { paymentUrl: r };
4027
3678
  } catch (n) {
4028
3679
  throw this.debugLog("Error creating payment", n), n;
4029
3680
  }
@@ -4032,7 +3683,7 @@ class Tn {
4032
3683
  this.config.debug && console.log(`[PaymentService] ${t}`, n || "");
4033
3684
  }
4034
3685
  }
4035
- const Dn = E`
3686
+ const ln = E`
4036
3687
  query findAllPublicPackagesByOrganizationId($organizationId: ID!) {
4037
3688
  findAllPublicPackagesByOrganizationId(organizationId: $organizationId) {
4038
3689
  data {
@@ -4057,7 +3708,7 @@ const Dn = E`
4057
3708
  count
4058
3709
  }
4059
3710
  }
4060
- `, xn = E`
3711
+ `, pn = E`
4061
3712
  query findPublicPackageById($packageId: ID!) {
4062
3713
  findPublicPackageById(id: $packageId) {
4063
3714
  id
@@ -4083,7 +3734,7 @@ const Dn = E`
4083
3734
  }
4084
3735
  }
4085
3736
  }
4086
- `, Nn = E`
3737
+ `, hn = E`
4087
3738
  query findPublicItemsByPackageId($packageId: ID!, $types: [PackageItemType!], $page: PageInput) {
4088
3739
  findPublicItemsByPackageId(packageId: $packageId, types: $types, page: $page) {
4089
3740
  data {
@@ -4118,25 +3769,25 @@ const Dn = E`
4118
3769
  count
4119
3770
  }
4120
3771
  }
4121
- `, Pn = (e, t, n, r) => e();
4122
- function bn(e, t = Pn) {
3772
+ `, fn = (e, t, n, i) => e();
3773
+ function mn(e, t = fn) {
4123
3774
  return {
4124
- findAllPublicPackagesByOrganizationId(n, r, i) {
4125
- return t((s) => e.request({ document: Dn, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "findAllPublicPackagesByOrganizationId", "query", n);
3775
+ findAllPublicPackagesByOrganizationId(n, i, r) {
3776
+ return t((s) => e.request({ document: ln, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findAllPublicPackagesByOrganizationId", "query", n);
4126
3777
  },
4127
- findPublicPackageById(n, r, i) {
4128
- return t((s) => e.request({ document: xn, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "findPublicPackageById", "query", n);
3778
+ findPublicPackageById(n, i, r) {
3779
+ return t((s) => e.request({ document: pn, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findPublicPackageById", "query", n);
4129
3780
  },
4130
- findPublicItemsByPackageId(n, r, i) {
4131
- return t((s) => e.request({ document: Nn, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "findPublicItemsByPackageId", "query", n);
3781
+ findPublicItemsByPackageId(n, i, r) {
3782
+ return t((s) => e.request({ document: hn, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findPublicItemsByPackageId", "query", n);
4132
3783
  }
4133
3784
  };
4134
3785
  }
4135
- class Sn {
3786
+ class gn {
4136
3787
  config;
4137
3788
  sdk;
4138
3789
  constructor(t) {
4139
- this.config = t, this.sdk = bn(new ee(t.apiUrl));
3790
+ this.config = t, this.sdk = mn(new Z(t.apiUrl));
4140
3791
  }
4141
3792
  debugLog(t, n) {
4142
3793
  this.config.debug && console.log(`[PackageService] ${t}`, n || "");
@@ -4153,15 +3804,15 @@ class Sn {
4153
3804
  tab: t.tab,
4154
3805
  statuses: t.statuses
4155
3806
  });
4156
- const r = await this.sdk.findAllPublicPackagesByOrganizationId({
3807
+ const i = await this.sdk.findAllPublicPackagesByOrganizationId({
4157
3808
  organizationId: this.config.organizationId
4158
3809
  });
4159
- if (r?.findAllPublicPackagesByOrganizationId) {
4160
- const i = r.findAllPublicPackagesByOrganizationId;
3810
+ if (i?.findAllPublicPackagesByOrganizationId) {
3811
+ const r = i.findAllPublicPackagesByOrganizationId;
4161
3812
  return this.debugLog("Public packages fetched", {
4162
- count: i.count,
4163
- dataLength: i.data.length
4164
- }), i.data;
3813
+ count: r.count,
3814
+ dataLength: r.data.length
3815
+ }), r.data;
4165
3816
  }
4166
3817
  return null;
4167
3818
  } catch (n) {
@@ -4175,37 +3826,45 @@ class Sn {
4175
3826
  });
4176
3827
  const n = await this.sdk.findPublicPackageById({ packageId: t });
4177
3828
  if (n?.findPublicPackageById) {
4178
- const r = n.findPublicPackageById;
4179
- return this.debugLog("Public package fetched"), r;
3829
+ const i = n.findPublicPackageById;
3830
+ return this.debugLog("Public package fetched"), i;
4180
3831
  }
4181
3832
  return null;
4182
3833
  } catch (n) {
4183
3834
  throw this.debugLog("Error fetching public packages", n), n;
4184
3835
  }
4185
3836
  }
4186
- async getPackageItems(t, n = [Q.Regular, Q.AdditionalEvent]) {
3837
+ async getPackageItems(t, n = [H.Regular, H.AdditionalEvent]) {
4187
3838
  try {
4188
3839
  this.debugLog("Fetching public package items", { packageId: t, types: n });
4189
- const r = await this.sdk.findPublicItemsByPackageId({
3840
+ const i = await this.sdk.findPublicItemsByPackageId({
4190
3841
  packageId: t,
4191
3842
  types: n,
4192
3843
  page: { index: 0, size: 100 }
4193
3844
  });
4194
- if (r?.findPublicItemsByPackageId) {
4195
- const i = r.findPublicItemsByPackageId;
3845
+ if (i?.findPublicItemsByPackageId) {
3846
+ const r = i.findPublicItemsByPackageId;
4196
3847
  return this.debugLog("Public package items fetched", {
4197
- count: i.count,
4198
- dataLength: i.data.length
4199
- }), i.data;
3848
+ count: r.count,
3849
+ dataLength: r.data.length
3850
+ }), r.data;
4200
3851
  }
4201
3852
  return null;
4202
- } catch (r) {
4203
- throw this.debugLog("Error fetching public package items", r), r;
3853
+ } catch (i) {
3854
+ throw this.debugLog("Error fetching public package items", i), i;
4204
3855
  }
4205
3856
  }
4206
3857
  }
4207
- const Cn = E`
3858
+ const In = E`
4208
3859
  query findAllPublicCategoriesByOrganizationId($organizationId: ID!, $dateRange: DateRangeInput) {
3860
+ findAllPublicLocationsByOrganizationId(id: $organizationId) {
3861
+ data {
3862
+ id
3863
+ name
3864
+ amountOfActiveEvents(input: $dateRange)
3865
+ }
3866
+ count
3867
+ }
4209
3868
  findAllPublicHostingsByOrganizationId(id: $organizationId) {
4210
3869
  data {
4211
3870
  id
@@ -4216,7 +3875,7 @@ const Cn = E`
4216
3875
  count
4217
3876
  }
4218
3877
  }
4219
- `, _n = E`
3878
+ `, En = E`
4220
3879
  query findPublicCategoryById($hostingId: ID!, $dateRange: DateRangeInput) {
4221
3880
  findPublicHostingById(id: $hostingId) {
4222
3881
  id
@@ -4224,23 +3883,28 @@ const Cn = E`
4224
3883
  icon
4225
3884
  amountOfActiveEvents(input: $dateRange)
4226
3885
  }
3886
+ findPublicLocationById(id: $hostingId) {
3887
+ id
3888
+ name
3889
+ amountOfActiveEvents(input: $dateRange)
3890
+ }
4227
3891
  }
4228
- `, Ln = (e, t, n, r) => e();
4229
- function Rn(e, t = Ln) {
3892
+ `, yn = (e, t, n, i) => e();
3893
+ function vn(e, t = yn) {
4230
3894
  return {
4231
- findAllPublicCategoriesByOrganizationId(n, r, i) {
4232
- return t((s) => e.request({ document: Cn, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "findAllPublicCategoriesByOrganizationId", "query", n);
3895
+ findAllPublicCategoriesByOrganizationId(n, i, r) {
3896
+ return t((s) => e.request({ document: In, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findAllPublicCategoriesByOrganizationId", "query", n);
4233
3897
  },
4234
- findPublicCategoryById(n, r, i) {
4235
- return t((s) => e.request({ document: _n, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "findPublicCategoryById", "query", n);
3898
+ findPublicCategoryById(n, i, r) {
3899
+ return t((s) => e.request({ document: En, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findPublicCategoryById", "query", n);
4236
3900
  }
4237
3901
  };
4238
3902
  }
4239
- class Fn {
3903
+ class Tn {
4240
3904
  config;
4241
3905
  sdk;
4242
3906
  constructor(t) {
4243
- this.config = t, this.sdk = Rn(new ee(t.apiUrl));
3907
+ this.config = t, this.sdk = vn(new Z(t.apiUrl));
4244
3908
  }
4245
3909
  debugLog(t, n) {
4246
3910
  this.config.debug && console.log(`[CategoryService] ${t}`, n || "");
@@ -4250,73 +3914,81 @@ class Fn {
4250
3914
  this.debugLog("Fetching all categories", { organizationId: this.config.organizationId });
4251
3915
  const n = await this.sdk.findAllPublicCategoriesByOrganizationId({ organizationId: this.config.organizationId, dateRange: t });
4252
3916
  if (n?.findAllPublicHostingsByOrganizationId) {
4253
- const r = n.findAllPublicHostingsByOrganizationId;
4254
- return this.debugLog("Categories fetched", { count: r.count, dataLength: r.data.length }), r.data.map((i) => ({ id: i.id, name: i.name, icon: i.icon, activeEvents: i.amountOfActiveEvents }));
3917
+ const i = n.findAllPublicHostingsByOrganizationId, r = n.findAllPublicLocationsByOrganizationId;
3918
+ return this.debugLog("Categories fetched", { count: i.count + r.count, dataLength: i.data.length + r.data.length }), [
3919
+ ...i.data.map((s) => ({ id: s.id, name: s.name, icon: s.icon, activeEvents: s.amountOfActiveEvents, type: "HOSTING" })),
3920
+ ...r.data.map((s) => ({ id: s.id, name: s.name, activeEvents: s.amountOfActiveEvents, type: "LOCATION" }))
3921
+ ];
4255
3922
  }
4256
3923
  return [];
4257
3924
  } catch (n) {
4258
3925
  throw this.debugLog("Error fetching categories", n), n;
4259
3926
  }
4260
3927
  }
4261
- async getCategory(t) {
3928
+ async getCategory(t, n) {
4262
3929
  try {
4263
3930
  this.debugLog("Fetching category", { categoryId: t });
4264
- const n = await this.sdk.findPublicCategoryById({ hostingId: t });
4265
- if (n?.findPublicHostingById) {
4266
- const r = n.findPublicHostingById;
4267
- return this.debugLog("Category fetched", r), { id: r.id, name: r.name, icon: r.icon, activeEvents: r.amountOfActiveEvents };
3931
+ const i = await this.sdk.findPublicCategoryById({ hostingId: t });
3932
+ if (n === "HOSTING") {
3933
+ if (i?.findPublicHostingById) {
3934
+ const r = i.findPublicHostingById;
3935
+ return this.debugLog("Category fetched", r), { id: r.id, name: r.name, icon: r.icon, activeEvents: r.amountOfActiveEvents, type: n };
3936
+ }
3937
+ } else if (i?.findPublicLocationById) {
3938
+ const r = i.findPublicLocationById;
3939
+ return this.debugLog("Category fetched", r), { id: r.id, name: r.name, activeEvents: r.amountOfActiveEvents, type: n };
4268
3940
  }
4269
3941
  return null;
4270
- } catch (n) {
4271
- throw this.debugLog("Error fetching category", n), n;
3942
+ } catch (i) {
3943
+ throw this.debugLog("Error fetching category", i), i;
4272
3944
  }
4273
3945
  }
4274
3946
  }
4275
- const wn = E`
3947
+ const An = E`
4276
3948
  mutation CreateShopView($id: ID!, $trackerLinkId: ID) {
4277
3949
  createShopView(id: $id, trackerId: $trackerLinkId)
4278
3950
  }
4279
- `, $n = E`
3951
+ `, kn = E`
4280
3952
  mutation CreateEventView($id: ID!, $shopId: ID, $trackerLinkId: ID) {
4281
3953
  createEventView(id: $id, shopId: $shopId, trackerId: $trackerLinkId)
4282
3954
  }
4283
- `, Bn = E`
3955
+ `, On = E`
4284
3956
  mutation CreatePackageView($id: ID!, $shopId: ID, $trackerLinkId: ID) {
4285
3957
  createPackageView(id: $id, shopId: $shopId, trackerId: $trackerLinkId)
4286
3958
  }
4287
- `, Vn = (e, t, n, r) => e();
4288
- function Un(e, t = Vn) {
3959
+ `, Dn = (e, t, n, i) => e();
3960
+ function Nn(e, t = Dn) {
4289
3961
  return {
4290
- CreateShopView(n, r, i) {
4291
- return t((s) => e.request({ document: wn, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "CreateShopView", "mutation", n);
3962
+ CreateShopView(n, i, r) {
3963
+ return t((s) => e.request({ document: An, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "CreateShopView", "mutation", n);
4292
3964
  },
4293
- CreateEventView(n, r, i) {
4294
- return t((s) => e.request({ document: $n, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "CreateEventView", "mutation", n);
3965
+ CreateEventView(n, i, r) {
3966
+ return t((s) => e.request({ document: kn, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "CreateEventView", "mutation", n);
4295
3967
  },
4296
- CreatePackageView(n, r, i) {
4297
- return t((s) => e.request({ document: Bn, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "CreatePackageView", "mutation", n);
3968
+ CreatePackageView(n, i, r) {
3969
+ return t((s) => e.request({ document: On, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "CreatePackageView", "mutation", n);
4298
3970
  }
4299
3971
  };
4300
3972
  }
4301
- class Mn {
3973
+ class bn {
4302
3974
  config;
4303
3975
  sdk;
4304
3976
  constructor(t) {
4305
- this.config = t, this.sdk = Un(new ee(t.apiUrl));
3977
+ this.config = t, this.sdk = Nn(new Z(t.apiUrl));
4306
3978
  }
4307
- createMetric = async (t, n, r) => {
4308
- switch (!n && !r && await this.sdk.CreateShopView({
3979
+ createMetric = async (t, n, i) => {
3980
+ switch (!n && !i && await this.sdk.CreateShopView({
4309
3981
  id: t,
4310
3982
  trackerLinkId: this.config.trackerId
4311
- }), r) {
4312
- case J.Event:
3983
+ }), i) {
3984
+ case Y.Event:
4313
3985
  await this.sdk.CreateEventView({
4314
3986
  id: t,
4315
3987
  shopId: n,
4316
3988
  trackerLinkId: this.config.trackerId
4317
3989
  });
4318
3990
  break;
4319
- case J.Package:
3991
+ case Y.Package:
4320
3992
  await this.sdk.CreatePackageView(
4321
3993
  {
4322
3994
  id: t,
@@ -4328,8 +4000,8 @@ class Mn {
4328
4000
  }
4329
4001
  };
4330
4002
  }
4331
- const qn = "https://api.ticketapp.com/graphql", Te = "TIC_TRACKER_ID";
4332
- class Yn {
4003
+ const xn = "https://api.ticketapp.com/graphql", Ie = "TIC_TRACKER_ID";
4004
+ class Cn {
4333
4005
  basket;
4334
4006
  event;
4335
4007
  payment;
@@ -4337,10 +4009,10 @@ class Yn {
4337
4009
  category;
4338
4010
  metric;
4339
4011
  // Attach selected public types to the SDK class
4340
- static Types = Xe;
4012
+ static Types = Ue;
4341
4013
  constructor(t) {
4342
- const { organizationId: n, debug: r = !1, apiUrl: i = qn } = t, s = this.getOrInitTrackerId();
4343
- this.basket = new un({ debug: r, apiUrl: i, shopId: t.shopId, trackerId: s }), this.event = new yn({ organizationId: n, debug: r, apiUrl: i, trackerId: s }), this.payment = new Tn({ debug: r, apiUrl: i }), this.package = new Sn({ organizationId: n, debug: r, apiUrl: i }), this.category = new Fn({ organizationId: n, debug: r, apiUrl: i }), this.metric = new Mn({ apiUrl: i, trackerId: s });
4014
+ const { organizationId: n, debug: i = !1, apiUrl: r = xn } = t, s = this.getOrInitTrackerId();
4015
+ this.basket = new Jt({ debug: i, apiUrl: r, shopId: t.shopId, trackerId: s }), this.event = new sn({ organizationId: n, debug: i, apiUrl: r, trackerId: s }), this.payment = new un({ debug: i, apiUrl: r }), this.package = new gn({ organizationId: n, debug: i, apiUrl: r }), this.category = new Tn({ organizationId: n, debug: i, apiUrl: r }), this.metric = new bn({ apiUrl: r, trackerId: s });
4344
4016
  }
4345
4017
  // Resolve tracker id from (in order): explicit config, URL query, or session storage
4346
4018
  // Persist to session when found via config or URL for subsequent page loads
@@ -4353,13 +4025,13 @@ class Yn {
4353
4025
  } catch {
4354
4026
  }
4355
4027
  try {
4356
- t = window.sessionStorage?.getItem(Te) ?? null;
4028
+ t = window.sessionStorage?.getItem(Ie) ?? null;
4357
4029
  } catch {
4358
4030
  }
4359
4031
  }
4360
4032
  if (n && n.trim().length > 0) {
4361
4033
  try {
4362
- typeof window < "u" && window.sessionStorage && sessionStorage.setItem(Te, n);
4034
+ typeof window < "u" && window.sessionStorage && sessionStorage.setItem(Ie, n);
4363
4035
  } catch {
4364
4036
  }
4365
4037
  return n;
@@ -4367,8 +4039,8 @@ class Yn {
4367
4039
  if (t && t.trim().length > 0) {
4368
4040
  try {
4369
4041
  if (typeof window < "u") {
4370
- const r = new URL(window.location.href);
4371
- r.searchParams.get("trackerId") || (r.searchParams.set("trackerId", t), window.history.replaceState({}, "", r.toString()));
4042
+ const i = new URL(window.location.href);
4043
+ i.searchParams.get("trackerId") || (i.searchParams.set("trackerId", t), window.history.replaceState({}, "", i.toString()));
4372
4044
  }
4373
4045
  } catch {
4374
4046
  }
@@ -4382,16 +4054,16 @@ class Yn {
4382
4054
  }
4383
4055
  export {
4384
4056
  _ as BasketOrderType,
4385
- Le as DiscountType,
4386
- Ne as EventStatus,
4387
- J as MetricsType,
4388
- _e as OrderItemType,
4389
- Q as PackageItemType,
4390
- De as PackageStatus,
4391
- xe as PackageTabType,
4392
- Ce as PaymentMethodFeeType,
4393
- be as ProductStatus,
4394
- Se as ProductType,
4395
- Pe as SortOrder,
4396
- Yn as TicketappSDK
4057
+ Ne as DiscountType,
4058
+ ve as EventStatus,
4059
+ Y as MetricsType,
4060
+ De as OrderItemType,
4061
+ H as PackageItemType,
4062
+ Ee as PackageStatus,
4063
+ ye as PackageTabType,
4064
+ Oe as PaymentMethodFeeType,
4065
+ Ae as ProductStatus,
4066
+ ke as ProductType,
4067
+ Te as SortOrder,
4068
+ Cn as TicketappSDK
4397
4069
  };