@debugged-development/ticketapp-sdk 0.0.3 → 1.0.2

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,86 +1,86 @@
1
- import { GraphQLClient as j } from "graphql-request";
2
- import { createSlice as ae, configureStore as ce } from "@reduxjs/toolkit";
3
- import { DateTime as x } from "luxon";
4
- const J = {
1
+ import { GraphQLClient as M } from "graphql-request";
2
+ import { createSlice as ce, configureStore as ue } from "@reduxjs/toolkit";
3
+ import { DateTime as _ } from "luxon";
4
+ const ee = {
5
5
  order: null,
6
6
  processing: !1,
7
7
  error: null
8
- }, de = ae({
8
+ }, le = ce({
9
9
  name: "basket",
10
- initialState: J,
10
+ initialState: ee,
11
11
  reducers: {
12
- setProcessing: (t, e) => {
13
- t.processing = e.payload;
12
+ setProcessing: (e, t) => {
13
+ e.processing = t.payload;
14
14
  },
15
- setError: (t, e) => {
16
- t.error = e.payload;
15
+ setError: (e, t) => {
16
+ e.error = t.payload;
17
17
  },
18
- setOrder: (t, e) => {
19
- t.order = e.payload;
18
+ setOrder: (e, t) => {
19
+ e.order = t.payload;
20
20
  },
21
- initializeOrder: (t, e) => {
22
- t.order || (t.order = {
23
- id: e.payload.id,
24
- currency: e.payload.currency,
21
+ initializeOrder: (e, t) => {
22
+ e.order || (e.order = {
23
+ id: t.payload.id,
24
+ currency: t.payload.currency,
25
25
  items: [],
26
- expiredAt: x.fromISO(e.payload.expiredAt)
26
+ expiredAt: _.fromISO(t.payload.expiredAt)
27
27
  });
28
28
  },
29
- addProductToOrder: (t, e) => {
30
- const { input: r, amountReserved: s, expiredAt: n } = e.payload;
31
- if (!t.order)
29
+ addProductToOrder: (e, t) => {
30
+ const { input: r, amountReserved: i, expiredAt: n } = t.payload;
31
+ if (!e.order)
32
32
  return;
33
- const i = t.order.items.findIndex((a) => r.seat ? a.id === r.id && a.seats?.some((u) => u.id === r.seat?.id) : a.id === r.id);
34
- if (i >= 0)
35
- t.order.items[i].amount += s;
33
+ const s = e.order.items.findIndex((o) => r.seat ? o.id === r.id && o.seats?.some((c) => c.id === r.seat?.id) : o.id === r.id);
34
+ if (s >= 0)
35
+ e.order.items[s].amount += i;
36
36
  else {
37
- const a = {
37
+ const o = {
38
38
  id: r.id,
39
39
  type: "PRODUCT",
40
40
  name: r.name,
41
- amount: s,
41
+ amount: i,
42
42
  price: r.price,
43
43
  depositPrice: r.depositPrice,
44
44
  serviceFee: r.serviceFee,
45
45
  originalPrice: r.price,
46
46
  seats: r.seat ? [{ id: r.seat.id, label: r.seat.label }] : void 0
47
47
  };
48
- t.order.items.push(a);
48
+ e.order.items.push(o);
49
49
  }
50
- t.order.expiredAt = x.fromISO(n);
50
+ e.order.expiredAt = _.fromISO(n);
51
51
  },
52
- removeProductFromOrder: (t, e) => {
53
- if (!t.order) return;
54
- const { id: r, amountReleased: s, seatId: n } = e.payload, i = t.order.items.findIndex(
55
- (a) => a.type === "PRODUCT" && a.id === r
52
+ removeProductFromOrder: (e, t) => {
53
+ if (!e.order) return;
54
+ const { id: r, amountReleased: i, seatId: n } = t.payload, s = e.order.items.findIndex(
55
+ (o) => o.type === "PRODUCT" && o.id === r
56
56
  );
57
- if (i !== -1) {
58
- const a = t.order.items[i];
59
- if (a.amount -= s, a.amount <= 0)
60
- t.order.items.splice(i, 1);
61
- else if (a.seats && n) {
62
- const u = a.seats.findIndex((l) => l.id === n);
63
- u !== -1 && a.seats.splice(u, 1);
57
+ if (s !== -1) {
58
+ const o = e.order.items[s];
59
+ if (o.amount -= i, o.amount <= 0)
60
+ e.order.items.splice(s, 1);
61
+ else if (o.seats && n) {
62
+ const c = o.seats.findIndex((l) => l.id === n);
63
+ c !== -1 && o.seats.splice(c, 1);
64
64
  }
65
65
  }
66
- t.order.items.length === 0 && (t.order = null);
66
+ e.order.items.length === 0 && (e.order = null);
67
67
  },
68
- setPackageInOrder: (t, e) => {
69
- const { input: r, amountReserved: s, expiredAt: n } = e.payload;
70
- t.order || (t.order = {
68
+ setPackageInOrder: (e, t) => {
69
+ const { input: r, amountReserved: i, expiredAt: n } = t.payload;
70
+ e.order || (e.order = {
71
71
  id: "",
72
72
  currency: r.currency,
73
73
  items: [],
74
- expiredAt: x.fromISO(n)
74
+ expiredAt: _.fromISO(n)
75
75
  });
76
- const i = t.order.items.find(
77
- (a) => a.type === "PACKAGE" && a.id === r.id
76
+ const s = e.order.items.find(
77
+ (o) => o.type === "PACKAGE" && o.id === r.id
78
78
  );
79
- i ? (i.amount = s, i.packageItems = r.items) : t.order.items.push({
79
+ s ? (s.amount = i, s.packageItems = r.items) : e.order.items.push({
80
80
  id: r.id,
81
81
  type: "PACKAGE",
82
82
  name: r.name,
83
- amount: s,
83
+ amount: i,
84
84
  price: r.discountPrice ?? r.price,
85
85
  depositPrice: r.depositPrice,
86
86
  originalPrice: r.price,
@@ -88,17 +88,17 @@ const J = {
88
88
  packageItems: r.items
89
89
  });
90
90
  },
91
- setDeliveryOption: (t, e) => {
92
- if (!t.order) return;
93
- const r = e.payload, s = t.order.items.findIndex(
91
+ setDeliveryOption: (e, t) => {
92
+ if (!e.order) return;
93
+ const r = t.payload, i = e.order.items.findIndex(
94
94
  (n) => n.type === "DELIVERY"
95
95
  );
96
96
  if (r)
97
- if (s !== -1) {
98
- const n = t.order.items[s];
97
+ if (i !== -1) {
98
+ const n = e.order.items[i];
99
99
  n.id = r.id, n.name = r.name, n.price = r.price, n.serviceFee = r.serviceFee;
100
100
  } else
101
- t.order.items.push({
101
+ e.order.items.push({
102
102
  id: r.id,
103
103
  type: "PRODUCT",
104
104
  name: r.name,
@@ -107,139 +107,149 @@ const J = {
107
107
  originalPrice: r.price,
108
108
  serviceFee: r.serviceFee
109
109
  });
110
- else s !== -1 && t.order.items.splice(s, 1);
110
+ else i !== -1 && e.order.items.splice(i, 1);
111
111
  },
112
- setCustomer: (t, e) => {
113
- t.order && (t.order.customer = e.payload);
112
+ setCustomer: (e, t) => {
113
+ e.order && (e.order.customer = t.payload);
114
114
  },
115
- clearBasket: () => J
115
+ clearBasket: () => ee
116
116
  }
117
117
  }), {
118
118
  setProcessing: N,
119
- setError: Ut,
120
- setOrder: Mt,
121
- initializeOrder: $,
122
- addProductToOrder: X,
123
- removeProductFromOrder: Ae,
124
- setPackageInOrder: K,
125
- setDeliveryOption: De,
126
- setCustomer: W,
127
- clearBasket: Z
128
- } = de.actions, ke = de.reducer, ee = {
119
+ setError: nn,
120
+ setOrder: sn,
121
+ initializeOrder: B,
122
+ addProductToOrder: te,
123
+ removeProductFromOrder: rr,
124
+ setPackageInOrder: re,
125
+ setDeliveryOption: nr,
126
+ setCustomer: ne,
127
+ clearBasket: ie
128
+ } = le.actions, ir = le.reducer, se = {
129
129
  events: [],
130
130
  processing: !1,
131
131
  error: null,
132
132
  loadingProducts: {}
133
- }, ue = ae({
133
+ }, W = ce({
134
134
  name: "event",
135
- initialState: ee,
135
+ initialState: se,
136
136
  reducers: {
137
- setProcessing: (t, e) => {
138
- t.processing = e.payload;
137
+ setProcessing: (e, t) => {
138
+ e.processing = t.payload;
139
139
  },
140
- setError: (t, e) => {
141
- t.error = e.payload;
140
+ setError: (e, t) => {
141
+ e.error = t.payload;
142
142
  },
143
- setEvents: (t, e) => {
144
- t.events = e.payload;
143
+ setEvents: (e, t) => {
144
+ e.events = t.payload;
145
145
  },
146
- setEventProducts: (t, e) => {
147
- const r = t.events.find((s) => s.id === e.payload.eventId);
148
- r && (r.products = e.payload.products);
146
+ setEventProducts: (e, t) => {
147
+ const r = e.events.find((i) => i.id === t.payload.eventId);
148
+ r && (r.products = t.payload.products);
149
149
  },
150
- setLoadingProducts: (t, e) => {
151
- t.loadingProducts[e.payload.eventId] = e.payload.loading;
150
+ setLoadingProducts: (e, t) => {
151
+ e.loadingProducts[t.payload.eventId] = t.payload.loading;
152
152
  },
153
- clearEvents: () => ee
153
+ clearEvents: () => se
154
154
  }
155
155
  }), {
156
- setProcessing: te,
157
- setError: Se,
158
- setEvents: re,
159
- setEventProducts: be,
160
- setLoadingProducts: ne,
161
- clearEvents: _e
162
- } = ue.actions, Ce = ue.reducer;
163
- var L = function() {
164
- return L = Object.assign || function(e) {
165
- for (var r, s = 1, n = arguments.length; s < n; s++) {
166
- r = arguments[s];
167
- for (var i in r) Object.prototype.hasOwnProperty.call(r, i) && (e[i] = r[i]);
156
+ setProcessing: H,
157
+ setError: he,
158
+ setEvents: z,
159
+ setEventProducts: Ee,
160
+ setLoadingProducts: Y,
161
+ clearEvents: Ie
162
+ } = W.actions, pe = W.reducer, sr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
163
+ __proto__: null,
164
+ clearEvents: Ie,
165
+ default: pe,
166
+ eventSlice: W,
167
+ setError: he,
168
+ setEventProducts: Ee,
169
+ setEvents: z,
170
+ setLoadingProducts: Y,
171
+ setProcessing: H
172
+ }, Symbol.toStringTag, { value: "Module" }));
173
+ var F = function() {
174
+ return F = Object.assign || function(t) {
175
+ for (var r, i = 1, n = arguments.length; i < n; i++) {
176
+ r = arguments[i];
177
+ for (var s in r) Object.prototype.hasOwnProperty.call(r, s) && (t[s] = r[s]);
168
178
  }
169
- return e;
170
- }, L.apply(this, arguments);
179
+ return t;
180
+ }, F.apply(this, arguments);
171
181
  };
172
- function B(t, e) {
173
- if (!!!t)
174
- throw new Error(e);
182
+ function G(e, t) {
183
+ if (!!!e)
184
+ throw new Error(t);
175
185
  }
176
- function Pe(t) {
177
- return typeof t == "object" && t !== null;
186
+ function ar(e) {
187
+ return typeof e == "object" && e !== null;
178
188
  }
179
- function Le(t, e) {
180
- if (!!!t)
189
+ function or(e, t) {
190
+ if (!!!e)
181
191
  throw new Error(
182
192
  "Unexpected invariant triggered."
183
193
  );
184
194
  }
185
- const Fe = /\r\n|[\n\r]/g;
186
- function M(t, e) {
187
- let r = 0, s = 1;
188
- for (const n of t.body.matchAll(Fe)) {
189
- if (typeof n.index == "number" || Le(!1), n.index >= e)
195
+ const dr = /\r\n|[\n\r]/g;
196
+ function q(e, t) {
197
+ let r = 0, i = 1;
198
+ for (const n of e.body.matchAll(dr)) {
199
+ if (typeof n.index == "number" || or(!1), n.index >= t)
190
200
  break;
191
- r = n.index + n[0].length, s += 1;
201
+ r = n.index + n[0].length, i += 1;
192
202
  }
193
203
  return {
194
- line: s,
195
- column: e + 1 - r
204
+ line: i,
205
+ column: t + 1 - r
196
206
  };
197
207
  }
198
- function Re(t) {
199
- return le(
200
- t.source,
201
- M(t.source, t.start)
208
+ function cr(e) {
209
+ return ge(
210
+ e.source,
211
+ q(e.source, e.start)
202
212
  );
203
213
  }
204
- function le(t, e) {
205
- const r = t.locationOffset.column - 1, s = "".padStart(r) + t.body, n = e.line - 1, i = t.locationOffset.line - 1, a = e.line + i, u = e.line === 1 ? r : 0, l = e.column + u, p = `${t.name}:${a}:${l}
206
- `, c = s.split(/\r\n|[\n\r]/g), E = c[n];
207
- if (E.length > 120) {
208
- const f = Math.floor(l / 80), T = l % 80, g = [];
209
- for (let y = 0; y < E.length; y += 80)
210
- g.push(E.slice(y, y + 80));
211
- return p + se([
212
- [`${a} |`, g[0]],
213
- ...g.slice(1, f + 1).map((y) => ["|", y]),
214
- ["|", "^".padStart(T)],
215
- ["|", g[f + 1]]
214
+ function ge(e, t) {
215
+ const r = e.locationOffset.column - 1, i = "".padStart(r) + e.body, n = t.line - 1, s = e.locationOffset.line - 1, o = t.line + s, c = t.line === 1 ? r : 0, l = t.column + c, h = `${e.name}:${o}:${l}
216
+ `, d = i.split(/\r\n|[\n\r]/g), A = d[n];
217
+ if (A.length > 120) {
218
+ const p = Math.floor(l / 80), O = l % 80, f = [];
219
+ for (let m = 0; m < A.length; m += 80)
220
+ f.push(A.slice(m, m + 80));
221
+ return h + ae([
222
+ [`${o} |`, f[0]],
223
+ ...f.slice(1, p + 1).map((m) => ["|", m]),
224
+ ["|", "^".padStart(O)],
225
+ ["|", f[p + 1]]
216
226
  ]);
217
227
  }
218
- return p + se([
228
+ return h + ae([
219
229
  // Lines specified like this: ["prefix", "string"],
220
- [`${a - 1} |`, c[n - 1]],
221
- [`${a} |`, E],
230
+ [`${o - 1} |`, d[n - 1]],
231
+ [`${o} |`, A],
222
232
  ["|", "^".padStart(l)],
223
- [`${a + 1} |`, c[n + 1]]
233
+ [`${o + 1} |`, d[n + 1]]
224
234
  ]);
225
235
  }
226
- function se(t) {
227
- const e = t.filter(([s, n]) => n !== void 0), r = Math.max(...e.map(([s]) => s.length));
228
- return e.map(([s, n]) => s.padStart(r) + (n ? " " + n : "")).join(`
236
+ function ae(e) {
237
+ const t = e.filter(([i, n]) => n !== void 0), r = Math.max(...t.map(([i]) => i.length));
238
+ return t.map(([i, n]) => i.padStart(r) + (n ? " " + n : "")).join(`
229
239
  `);
230
240
  }
231
- function we(t) {
232
- const e = t[0];
233
- return e == null || "kind" in e || "length" in e ? {
234
- nodes: e,
235
- source: t[1],
236
- positions: t[2],
237
- path: t[3],
238
- originalError: t[4],
239
- extensions: t[5]
240
- } : e;
241
+ function ur(e) {
242
+ const t = e[0];
243
+ return t == null || "kind" in t || "length" in t ? {
244
+ nodes: t,
245
+ source: e[1],
246
+ positions: e[2],
247
+ path: e[3],
248
+ originalError: e[4],
249
+ extensions: e[5]
250
+ } : t;
241
251
  }
242
- class q extends Error {
252
+ class X extends Error {
243
253
  /**
244
254
  * An array of `{ line, column }` locations within the source GraphQL document
245
255
  * which correspond to this error.
@@ -278,20 +288,20 @@ class q extends Error {
278
288
  /**
279
289
  * @deprecated Please use the `GraphQLErrorOptions` constructor overload instead.
280
290
  */
281
- constructor(e, ...r) {
282
- var s, n, i;
283
- const { nodes: a, source: u, positions: l, path: p, originalError: c, extensions: E } = we(r);
284
- super(e), this.name = "GraphQLError", this.path = p ?? void 0, this.originalError = c ?? void 0, this.nodes = ie(
285
- Array.isArray(a) ? a : a ? [a] : void 0
291
+ constructor(t, ...r) {
292
+ var i, n, s;
293
+ const { nodes: o, source: c, positions: l, path: h, originalError: d, extensions: A } = ur(r);
294
+ super(t), this.name = "GraphQLError", this.path = h ?? void 0, this.originalError = d ?? void 0, this.nodes = oe(
295
+ Array.isArray(o) ? o : o ? [o] : void 0
286
296
  );
287
- const f = ie(
288
- (s = this.nodes) === null || s === void 0 ? void 0 : s.map((g) => g.loc).filter((g) => g != null)
297
+ const p = oe(
298
+ (i = this.nodes) === null || i === void 0 ? void 0 : i.map((f) => f.loc).filter((f) => f != null)
289
299
  );
290
- this.source = u ?? (f == null || (n = f[0]) === null || n === void 0 ? void 0 : n.source), this.positions = l ?? f?.map((g) => g.start), this.locations = l && u ? l.map((g) => M(u, g)) : f?.map((g) => M(g.source, g.start));
291
- const T = Pe(
292
- c?.extensions
293
- ) ? c?.extensions : void 0;
294
- this.extensions = (i = E ?? T) !== null && i !== void 0 ? i : /* @__PURE__ */ Object.create(null), Object.defineProperties(this, {
300
+ this.source = c ?? (p == null || (n = p[0]) === null || n === void 0 ? void 0 : n.source), this.positions = l ?? p?.map((f) => f.start), this.locations = l && c ? l.map((f) => q(c, f)) : p?.map((f) => q(f.source, f.start));
301
+ const O = ar(
302
+ d?.extensions
303
+ ) ? d?.extensions : void 0;
304
+ this.extensions = (s = A ?? O) !== null && s !== void 0 ? s : /* @__PURE__ */ Object.create(null), Object.defineProperties(this, {
295
305
  message: {
296
306
  writable: !0,
297
307
  enumerable: !0
@@ -311,11 +321,11 @@ class q extends Error {
311
321
  originalError: {
312
322
  enumerable: !1
313
323
  }
314
- }), c != null && c.stack ? Object.defineProperty(this, "stack", {
315
- value: c.stack,
324
+ }), d != null && d.stack ? Object.defineProperty(this, "stack", {
325
+ value: d.stack,
316
326
  writable: !0,
317
327
  configurable: !0
318
- }) : Error.captureStackTrace ? Error.captureStackTrace(this, q) : Object.defineProperty(this, "stack", {
328
+ }) : Error.captureStackTrace ? Error.captureStackTrace(this, X) : Object.defineProperty(this, "stack", {
319
329
  value: Error().stack,
320
330
  writable: !0,
321
331
  configurable: !0
@@ -325,36 +335,36 @@ class q extends Error {
325
335
  return "GraphQLError";
326
336
  }
327
337
  toString() {
328
- let e = this.message;
338
+ let t = this.message;
329
339
  if (this.nodes)
330
340
  for (const r of this.nodes)
331
- r.loc && (e += `
341
+ r.loc && (t += `
332
342
 
333
- ` + Re(r.loc));
343
+ ` + cr(r.loc));
334
344
  else if (this.source && this.locations)
335
345
  for (const r of this.locations)
336
- e += `
346
+ t += `
337
347
 
338
- ` + le(this.source, r);
339
- return e;
348
+ ` + ge(this.source, r);
349
+ return t;
340
350
  }
341
351
  toJSON() {
342
- const e = {
352
+ const t = {
343
353
  message: this.message
344
354
  };
345
- return this.locations != null && (e.locations = this.locations), this.path != null && (e.path = this.path), this.extensions != null && Object.keys(this.extensions).length > 0 && (e.extensions = this.extensions), e;
355
+ 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;
346
356
  }
347
357
  }
348
- function ie(t) {
349
- return t === void 0 || t.length === 0 ? void 0 : t;
358
+ function oe(e) {
359
+ return e === void 0 || e.length === 0 ? void 0 : e;
350
360
  }
351
- function m(t, e, r) {
352
- return new q(`Syntax Error: ${r}`, {
353
- source: t,
354
- positions: [e]
361
+ function g(e, t, r) {
362
+ return new X(`Syntax Error: ${r}`, {
363
+ source: e,
364
+ positions: [t]
355
365
  });
356
366
  }
357
- class $e {
367
+ class lr {
358
368
  /**
359
369
  * The character offset at which this Node begins.
360
370
  */
@@ -370,8 +380,8 @@ class $e {
370
380
  /**
371
381
  * The Source document the AST represents.
372
382
  */
373
- constructor(e, r, s) {
374
- this.start = e.start, this.end = r.end, this.startToken = e, this.endToken = r, this.source = s;
383
+ constructor(t, r, i) {
384
+ this.start = t.start, this.end = r.end, this.startToken = t, this.endToken = r, this.source = i;
375
385
  }
376
386
  get [Symbol.toStringTag]() {
377
387
  return "Location";
@@ -383,7 +393,7 @@ class $e {
383
393
  };
384
394
  }
385
395
  }
386
- class he {
396
+ class fe {
387
397
  /**
388
398
  * The kind of Token.
389
399
  */
@@ -410,8 +420,8 @@ class he {
410
420
  * including ignored tokens. <SOF> is always the first node and <EOF>
411
421
  * the last.
412
422
  */
413
- constructor(e, r, s, n, i, a) {
414
- this.kind = e, this.start = r, this.end = s, this.line = n, this.column = i, this.value = a, this.prev = null, this.next = null;
423
+ constructor(t, r, i, n, s, o) {
424
+ this.kind = t, this.start = r, this.end = i, this.line = n, this.column = s, this.value = o, this.prev = null, this.next = null;
415
425
  }
416
426
  get [Symbol.toStringTag]() {
417
427
  return "Token";
@@ -425,7 +435,7 @@ class he {
425
435
  };
426
436
  }
427
437
  }
428
- const Be = {
438
+ const hr = {
429
439
  Name: [],
430
440
  Document: ["definitions"],
431
441
  OperationDefinition: [
@@ -500,59 +510,59 @@ const Be = {
500
510
  EnumTypeExtension: ["name", "directives", "values"],
501
511
  InputObjectTypeExtension: ["name", "directives", "fields"]
502
512
  };
503
- new Set(Object.keys(Be));
504
- var D;
505
- (function(t) {
506
- t.QUERY = "query", t.MUTATION = "mutation", t.SUBSCRIPTION = "subscription";
507
- })(D || (D = {}));
508
- var V;
509
- (function(t) {
510
- t.QUERY = "QUERY", t.MUTATION = "MUTATION", t.SUBSCRIPTION = "SUBSCRIPTION", t.FIELD = "FIELD", t.FRAGMENT_DEFINITION = "FRAGMENT_DEFINITION", t.FRAGMENT_SPREAD = "FRAGMENT_SPREAD", t.INLINE_FRAGMENT = "INLINE_FRAGMENT", t.VARIABLE_DEFINITION = "VARIABLE_DEFINITION", t.SCHEMA = "SCHEMA", t.SCALAR = "SCALAR", t.OBJECT = "OBJECT", t.FIELD_DEFINITION = "FIELD_DEFINITION", t.ARGUMENT_DEFINITION = "ARGUMENT_DEFINITION", t.INTERFACE = "INTERFACE", t.UNION = "UNION", t.ENUM = "ENUM", t.ENUM_VALUE = "ENUM_VALUE", t.INPUT_OBJECT = "INPUT_OBJECT", t.INPUT_FIELD_DEFINITION = "INPUT_FIELD_DEFINITION";
511
- })(V || (V = {}));
512
- var d;
513
- (function(t) {
514
- t.NAME = "Name", t.DOCUMENT = "Document", t.OPERATION_DEFINITION = "OperationDefinition", t.VARIABLE_DEFINITION = "VariableDefinition", t.SELECTION_SET = "SelectionSet", t.FIELD = "Field", t.ARGUMENT = "Argument", t.FRAGMENT_SPREAD = "FragmentSpread", t.INLINE_FRAGMENT = "InlineFragment", t.FRAGMENT_DEFINITION = "FragmentDefinition", t.VARIABLE = "Variable", t.INT = "IntValue", t.FLOAT = "FloatValue", t.STRING = "StringValue", t.BOOLEAN = "BooleanValue", t.NULL = "NullValue", t.ENUM = "EnumValue", t.LIST = "ListValue", t.OBJECT = "ObjectValue", t.OBJECT_FIELD = "ObjectField", t.DIRECTIVE = "Directive", t.NAMED_TYPE = "NamedType", t.LIST_TYPE = "ListType", t.NON_NULL_TYPE = "NonNullType", t.SCHEMA_DEFINITION = "SchemaDefinition", t.OPERATION_TYPE_DEFINITION = "OperationTypeDefinition", t.SCALAR_TYPE_DEFINITION = "ScalarTypeDefinition", t.OBJECT_TYPE_DEFINITION = "ObjectTypeDefinition", t.FIELD_DEFINITION = "FieldDefinition", t.INPUT_VALUE_DEFINITION = "InputValueDefinition", t.INTERFACE_TYPE_DEFINITION = "InterfaceTypeDefinition", t.UNION_TYPE_DEFINITION = "UnionTypeDefinition", t.ENUM_TYPE_DEFINITION = "EnumTypeDefinition", t.ENUM_VALUE_DEFINITION = "EnumValueDefinition", t.INPUT_OBJECT_TYPE_DEFINITION = "InputObjectTypeDefinition", t.DIRECTIVE_DEFINITION = "DirectiveDefinition", t.SCHEMA_EXTENSION = "SchemaExtension", t.SCALAR_TYPE_EXTENSION = "ScalarTypeExtension", t.OBJECT_TYPE_EXTENSION = "ObjectTypeExtension", t.INTERFACE_TYPE_EXTENSION = "InterfaceTypeExtension", t.UNION_TYPE_EXTENSION = "UnionTypeExtension", t.ENUM_TYPE_EXTENSION = "EnumTypeExtension", t.INPUT_OBJECT_TYPE_EXTENSION = "InputObjectTypeExtension";
515
- })(d || (d = {}));
516
- function Ue(t) {
517
- return t === 9 || t === 32;
518
- }
519
- function _(t) {
520
- return t >= 48 && t <= 57;
521
- }
522
- function pe(t) {
523
- return t >= 97 && t <= 122 || // A-Z
524
- t >= 65 && t <= 90;
525
- }
526
- function fe(t) {
527
- return pe(t) || t === 95;
528
- }
529
- function Me(t) {
530
- return pe(t) || _(t) || t === 95;
531
- }
532
- function Ve(t) {
533
- var e;
534
- let r = Number.MAX_SAFE_INTEGER, s = null, n = -1;
535
- for (let a = 0; a < t.length; ++a) {
536
- var i;
537
- const u = t[a], l = Ge(u);
538
- l !== u.length && (s = (i = s) !== null && i !== void 0 ? i : a, n = a, a !== 0 && l < r && (r = l));
539
- }
540
- return t.map((a, u) => u === 0 ? a : a.slice(r)).slice(
541
- (e = s) !== null && e !== void 0 ? e : 0,
513
+ new Set(Object.keys(hr));
514
+ var v;
515
+ (function(e) {
516
+ e.QUERY = "query", e.MUTATION = "mutation", e.SUBSCRIPTION = "subscription";
517
+ })(v || (v = {}));
518
+ var K;
519
+ (function(e) {
520
+ 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";
521
+ })(K || (K = {}));
522
+ var u;
523
+ (function(e) {
524
+ 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";
525
+ })(u || (u = {}));
526
+ function Er(e) {
527
+ return e === 9 || e === 32;
528
+ }
529
+ function C(e) {
530
+ return e >= 48 && e <= 57;
531
+ }
532
+ function Ae(e) {
533
+ return e >= 97 && e <= 122 || // A-Z
534
+ e >= 65 && e <= 90;
535
+ }
536
+ function me(e) {
537
+ return Ae(e) || e === 95;
538
+ }
539
+ function Ir(e) {
540
+ return Ae(e) || C(e) || e === 95;
541
+ }
542
+ function pr(e) {
543
+ var t;
544
+ let r = Number.MAX_SAFE_INTEGER, i = null, n = -1;
545
+ for (let o = 0; o < e.length; ++o) {
546
+ var s;
547
+ const c = e[o], l = gr(c);
548
+ l !== c.length && (i = (s = i) !== null && s !== void 0 ? s : o, n = o, o !== 0 && l < r && (r = l));
549
+ }
550
+ return e.map((o, c) => c === 0 ? o : o.slice(r)).slice(
551
+ (t = i) !== null && t !== void 0 ? t : 0,
542
552
  n + 1
543
553
  );
544
554
  }
545
- function Ge(t) {
546
- let e = 0;
547
- for (; e < t.length && Ue(t.charCodeAt(e)); )
548
- ++e;
549
- return e;
555
+ function gr(e) {
556
+ let t = 0;
557
+ for (; t < e.length && Er(e.charCodeAt(t)); )
558
+ ++t;
559
+ return t;
550
560
  }
551
- var o;
552
- (function(t) {
553
- t.SOF = "<SOF>", t.EOF = "<EOF>", t.BANG = "!", t.DOLLAR = "$", t.AMP = "&", t.PAREN_L = "(", t.PAREN_R = ")", t.SPREAD = "...", t.COLON = ":", t.EQUALS = "=", t.AT = "@", t.BRACKET_L = "[", t.BRACKET_R = "]", t.BRACE_L = "{", t.PIPE = "|", t.BRACE_R = "}", t.NAME = "Name", t.INT = "Int", t.FLOAT = "Float", t.STRING = "String", t.BLOCK_STRING = "BlockString", t.COMMENT = "Comment";
554
- })(o || (o = {}));
555
- class je {
561
+ var a;
562
+ (function(e) {
563
+ e.SOF = "<SOF>", e.EOF = "<EOF>", e.BANG = "!", e.DOLLAR = "$", e.AMP = "&", e.PAREN_L = "(", e.PAREN_R = ")", e.SPREAD = "...", e.COLON = ":", e.EQUALS = "=", e.AT = "@", e.BRACKET_L = "[", e.BRACKET_R = "]", e.BRACE_L = "{", e.PIPE = "|", e.BRACE_R = "}", e.NAME = "Name", e.INT = "Int", e.FLOAT = "Float", e.STRING = "String", e.BLOCK_STRING = "BlockString", e.COMMENT = "Comment";
564
+ })(a || (a = {}));
565
+ class fr {
556
566
  /**
557
567
  * The previously focused non-ignored token.
558
568
  */
@@ -565,9 +575,9 @@ class je {
565
575
  /**
566
576
  * The character offset at which the current line begins.
567
577
  */
568
- constructor(e) {
569
- const r = new he(o.SOF, 0, 0, 0, 0);
570
- this.source = e, this.lastToken = r, this.token = r, this.line = 1, this.lineStart = 0;
578
+ constructor(t) {
579
+ const r = new fe(a.SOF, 0, 0, 0, 0);
580
+ this.source = t, this.lastToken = r, this.token = r, this.line = 1, this.lineStart = 0;
571
581
  }
572
582
  get [Symbol.toStringTag]() {
573
583
  return "Lexer";
@@ -583,54 +593,54 @@ class je {
583
593
  * the state of Lexer.
584
594
  */
585
595
  lookahead() {
586
- let e = this.token;
587
- if (e.kind !== o.EOF)
596
+ let t = this.token;
597
+ if (t.kind !== a.EOF)
588
598
  do
589
- if (e.next)
590
- e = e.next;
599
+ if (t.next)
600
+ t = t.next;
591
601
  else {
592
- const r = Ye(this, e.end);
593
- e.next = r, r.prev = e, e = r;
602
+ const r = mr(this, t.end);
603
+ t.next = r, r.prev = t, t = r;
594
604
  }
595
- while (e.kind === o.COMMENT);
596
- return e;
605
+ while (t.kind === a.COMMENT);
606
+ return t;
597
607
  }
598
608
  }
599
- function qe(t) {
600
- return t === o.BANG || t === o.DOLLAR || t === o.AMP || t === o.PAREN_L || t === o.PAREN_R || t === o.SPREAD || t === o.COLON || t === o.EQUALS || t === o.AT || t === o.BRACKET_L || t === o.BRACKET_R || t === o.BRACE_L || t === o.PIPE || t === o.BRACE_R;
609
+ function Ar(e) {
610
+ return e === a.BANG || e === a.DOLLAR || e === a.AMP || e === a.PAREN_L || e === a.PAREN_R || 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;
601
611
  }
602
- function k(t) {
603
- return t >= 0 && t <= 55295 || t >= 57344 && t <= 1114111;
612
+ function L(e) {
613
+ return e >= 0 && e <= 55295 || e >= 57344 && e <= 1114111;
604
614
  }
605
- function R(t, e) {
606
- return me(t.charCodeAt(e)) && ge(t.charCodeAt(e + 1));
615
+ function V(e, t) {
616
+ return Oe(e.charCodeAt(t)) && Te(e.charCodeAt(t + 1));
607
617
  }
608
- function me(t) {
609
- return t >= 55296 && t <= 56319;
618
+ function Oe(e) {
619
+ return e >= 55296 && e <= 56319;
610
620
  }
611
- function ge(t) {
612
- return t >= 56320 && t <= 57343;
621
+ function Te(e) {
622
+ return e >= 56320 && e <= 57343;
613
623
  }
614
- function A(t, e) {
615
- const r = t.source.body.codePointAt(e);
624
+ function R(e, t) {
625
+ const r = e.source.body.codePointAt(t);
616
626
  if (r === void 0)
617
- return o.EOF;
627
+ return a.EOF;
618
628
  if (r >= 32 && r <= 126) {
619
- const s = String.fromCodePoint(r);
620
- return s === '"' ? `'"'` : `"${s}"`;
629
+ const i = String.fromCodePoint(r);
630
+ return i === '"' ? `'"'` : `"${i}"`;
621
631
  }
622
632
  return "U+" + r.toString(16).toUpperCase().padStart(4, "0");
623
633
  }
624
- function h(t, e, r, s, n) {
625
- const i = t.line, a = 1 + r - t.lineStart;
626
- return new he(e, r, s, i, a, n);
634
+ function I(e, t, r, i, n) {
635
+ const s = e.line, o = 1 + r - e.lineStart;
636
+ return new fe(t, r, i, s, o, n);
627
637
  }
628
- function Ye(t, e) {
629
- const r = t.source.body, s = r.length;
630
- let n = e;
631
- for (; n < s; ) {
632
- const i = r.charCodeAt(n);
633
- switch (i) {
638
+ function mr(e, t) {
639
+ const r = e.source.body, i = r.length;
640
+ let n = t;
641
+ for (; n < i; ) {
642
+ const s = r.charCodeAt(n);
643
+ switch (s) {
634
644
  // Ignored ::
635
645
  // - UnicodeBOM
636
646
  // - WhiteSpace
@@ -659,14 +669,14 @@ function Ye(t, e) {
659
669
  // - "Carriage Return (U+000D)" [lookahead != "New Line (U+000A)"]
660
670
  // - "Carriage Return (U+000D)" "New Line (U+000A)"
661
671
  case 10:
662
- ++n, ++t.line, t.lineStart = n;
672
+ ++n, ++e.line, e.lineStart = n;
663
673
  continue;
664
674
  case 13:
665
- r.charCodeAt(n + 1) === 10 ? n += 2 : ++n, ++t.line, t.lineStart = n;
675
+ r.charCodeAt(n + 1) === 10 ? n += 2 : ++n, ++e.line, e.lineStart = n;
666
676
  continue;
667
677
  // Comment
668
678
  case 35:
669
- return ze(t, n);
679
+ return Or(e, n);
670
680
  // Token ::
671
681
  // - Punctuator
672
682
  // - Name
@@ -676,207 +686,207 @@ function Ye(t, e) {
676
686
  //
677
687
  // Punctuator :: one of ! $ & ( ) ... : = @ [ ] { | }
678
688
  case 33:
679
- return h(t, o.BANG, n, n + 1);
689
+ return I(e, a.BANG, n, n + 1);
680
690
  case 36:
681
- return h(t, o.DOLLAR, n, n + 1);
691
+ return I(e, a.DOLLAR, n, n + 1);
682
692
  case 38:
683
- return h(t, o.AMP, n, n + 1);
693
+ return I(e, a.AMP, n, n + 1);
684
694
  case 40:
685
- return h(t, o.PAREN_L, n, n + 1);
695
+ return I(e, a.PAREN_L, n, n + 1);
686
696
  case 41:
687
- return h(t, o.PAREN_R, n, n + 1);
697
+ return I(e, a.PAREN_R, n, n + 1);
688
698
  case 46:
689
699
  if (r.charCodeAt(n + 1) === 46 && r.charCodeAt(n + 2) === 46)
690
- return h(t, o.SPREAD, n, n + 3);
700
+ return I(e, a.SPREAD, n, n + 3);
691
701
  break;
692
702
  case 58:
693
- return h(t, o.COLON, n, n + 1);
703
+ return I(e, a.COLON, n, n + 1);
694
704
  case 61:
695
- return h(t, o.EQUALS, n, n + 1);
705
+ return I(e, a.EQUALS, n, n + 1);
696
706
  case 64:
697
- return h(t, o.AT, n, n + 1);
707
+ return I(e, a.AT, n, n + 1);
698
708
  case 91:
699
- return h(t, o.BRACKET_L, n, n + 1);
709
+ return I(e, a.BRACKET_L, n, n + 1);
700
710
  case 93:
701
- return h(t, o.BRACKET_R, n, n + 1);
711
+ return I(e, a.BRACKET_R, n, n + 1);
702
712
  case 123:
703
- return h(t, o.BRACE_L, n, n + 1);
713
+ return I(e, a.BRACE_L, n, n + 1);
704
714
  case 124:
705
- return h(t, o.PIPE, n, n + 1);
715
+ return I(e, a.PIPE, n, n + 1);
706
716
  case 125:
707
- return h(t, o.BRACE_R, n, n + 1);
717
+ return I(e, a.BRACE_R, n, n + 1);
708
718
  // StringValue
709
719
  case 34:
710
- return r.charCodeAt(n + 1) === 34 && r.charCodeAt(n + 2) === 34 ? We(t, n) : Qe(t, n);
720
+ return r.charCodeAt(n + 1) === 34 && r.charCodeAt(n + 2) === 34 ? vr(e, n) : Nr(e, n);
711
721
  }
712
- if (_(i) || i === 45)
713
- return He(t, n, i);
714
- if (fe(i))
715
- return Ze(t, n);
716
- throw m(
717
- t.source,
722
+ if (C(s) || s === 45)
723
+ return Tr(e, n, s);
724
+ if (me(s))
725
+ return Lr(e, n);
726
+ throw g(
727
+ e.source,
718
728
  n,
719
- i === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : k(i) || R(r, n) ? `Unexpected character: ${A(t, n)}.` : `Invalid character: ${A(t, n)}.`
729
+ s === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : L(s) || V(r, n) ? `Unexpected character: ${R(e, n)}.` : `Invalid character: ${R(e, n)}.`
720
730
  );
721
731
  }
722
- return h(t, o.EOF, s, s);
732
+ return I(e, a.EOF, i, i);
723
733
  }
724
- function ze(t, e) {
725
- const r = t.source.body, s = r.length;
726
- let n = e + 1;
727
- for (; n < s; ) {
728
- const i = r.charCodeAt(n);
729
- if (i === 10 || i === 13)
734
+ function Or(e, t) {
735
+ const r = e.source.body, i = r.length;
736
+ let n = t + 1;
737
+ for (; n < i; ) {
738
+ const s = r.charCodeAt(n);
739
+ if (s === 10 || s === 13)
730
740
  break;
731
- if (k(i))
741
+ if (L(s))
732
742
  ++n;
733
- else if (R(r, n))
743
+ else if (V(r, n))
734
744
  n += 2;
735
745
  else
736
746
  break;
737
747
  }
738
- return h(
739
- t,
740
- o.COMMENT,
748
+ return I(
741
749
  e,
750
+ a.COMMENT,
751
+ t,
742
752
  n,
743
- r.slice(e + 1, n)
753
+ r.slice(t + 1, n)
744
754
  );
745
755
  }
746
- function He(t, e, r) {
747
- const s = t.source.body;
748
- let n = e, i = r, a = !1;
749
- if (i === 45 && (i = s.charCodeAt(++n)), i === 48) {
750
- if (i = s.charCodeAt(++n), _(i))
751
- throw m(
752
- t.source,
756
+ function Tr(e, t, r) {
757
+ const i = e.source.body;
758
+ let n = t, s = r, o = !1;
759
+ if (s === 45 && (s = i.charCodeAt(++n)), s === 48) {
760
+ if (s = i.charCodeAt(++n), C(s))
761
+ throw g(
762
+ e.source,
753
763
  n,
754
- `Invalid number, unexpected digit after 0: ${A(
755
- t,
764
+ `Invalid number, unexpected digit after 0: ${R(
765
+ e,
756
766
  n
757
767
  )}.`
758
768
  );
759
769
  } else
760
- n = U(t, n, i), i = s.charCodeAt(n);
761
- if (i === 46 && (a = !0, i = s.charCodeAt(++n), n = U(t, n, i), i = s.charCodeAt(n)), (i === 69 || i === 101) && (a = !0, i = s.charCodeAt(++n), (i === 43 || i === 45) && (i = s.charCodeAt(++n)), n = U(t, n, i), i = s.charCodeAt(n)), i === 46 || fe(i))
762
- throw m(
763
- t.source,
770
+ n = $(e, n, s), s = i.charCodeAt(n);
771
+ if (s === 46 && (o = !0, s = i.charCodeAt(++n), n = $(e, n, s), s = i.charCodeAt(n)), (s === 69 || s === 101) && (o = !0, s = i.charCodeAt(++n), (s === 43 || s === 45) && (s = i.charCodeAt(++n)), n = $(e, n, s), s = i.charCodeAt(n)), s === 46 || me(s))
772
+ throw g(
773
+ e.source,
764
774
  n,
765
- `Invalid number, expected digit but got: ${A(
766
- t,
775
+ `Invalid number, expected digit but got: ${R(
776
+ e,
767
777
  n
768
778
  )}.`
769
779
  );
770
- return h(
771
- t,
772
- a ? o.FLOAT : o.INT,
780
+ return I(
773
781
  e,
782
+ o ? a.FLOAT : a.INT,
783
+ t,
774
784
  n,
775
- s.slice(e, n)
785
+ i.slice(t, n)
776
786
  );
777
787
  }
778
- function U(t, e, r) {
779
- if (!_(r))
780
- throw m(
781
- t.source,
782
- e,
783
- `Invalid number, expected digit but got: ${A(
784
- t,
785
- e
788
+ function $(e, t, r) {
789
+ if (!C(r))
790
+ throw g(
791
+ e.source,
792
+ t,
793
+ `Invalid number, expected digit but got: ${R(
794
+ e,
795
+ t
786
796
  )}.`
787
797
  );
788
- const s = t.source.body;
789
- let n = e + 1;
790
- for (; _(s.charCodeAt(n)); )
798
+ const i = e.source.body;
799
+ let n = t + 1;
800
+ for (; C(i.charCodeAt(n)); )
791
801
  ++n;
792
802
  return n;
793
803
  }
794
- function Qe(t, e) {
795
- const r = t.source.body, s = r.length;
796
- let n = e + 1, i = n, a = "";
797
- for (; n < s; ) {
798
- const u = r.charCodeAt(n);
799
- if (u === 34)
800
- return a += r.slice(i, n), h(t, o.STRING, e, n + 1, a);
801
- if (u === 92) {
802
- a += r.slice(i, n);
803
- const l = r.charCodeAt(n + 1) === 117 ? r.charCodeAt(n + 2) === 123 ? Je(t, n) : Xe(t, n) : Ke(t, n);
804
- a += l.value, n += l.size, i = n;
804
+ function Nr(e, t) {
805
+ const r = e.source.body, i = r.length;
806
+ let n = t + 1, s = n, o = "";
807
+ for (; n < i; ) {
808
+ const c = r.charCodeAt(n);
809
+ if (c === 34)
810
+ return o += r.slice(s, n), I(e, a.STRING, t, n + 1, o);
811
+ if (c === 92) {
812
+ o += r.slice(s, n);
813
+ const l = r.charCodeAt(n + 1) === 117 ? r.charCodeAt(n + 2) === 123 ? Dr(e, n) : _r(e, n) : Rr(e, n);
814
+ o += l.value, n += l.size, s = n;
805
815
  continue;
806
816
  }
807
- if (u === 10 || u === 13)
817
+ if (c === 10 || c === 13)
808
818
  break;
809
- if (k(u))
819
+ if (L(c))
810
820
  ++n;
811
- else if (R(r, n))
821
+ else if (V(r, n))
812
822
  n += 2;
813
823
  else
814
- throw m(
815
- t.source,
824
+ throw g(
825
+ e.source,
816
826
  n,
817
- `Invalid character within String: ${A(
818
- t,
827
+ `Invalid character within String: ${R(
828
+ e,
819
829
  n
820
830
  )}.`
821
831
  );
822
832
  }
823
- throw m(t.source, n, "Unterminated string.");
833
+ throw g(e.source, n, "Unterminated string.");
824
834
  }
825
- function Je(t, e) {
826
- const r = t.source.body;
827
- let s = 0, n = 3;
835
+ function Dr(e, t) {
836
+ const r = e.source.body;
837
+ let i = 0, n = 3;
828
838
  for (; n < 12; ) {
829
- const i = r.charCodeAt(e + n++);
830
- if (i === 125) {
831
- if (n < 5 || !k(s))
839
+ const s = r.charCodeAt(t + n++);
840
+ if (s === 125) {
841
+ if (n < 5 || !L(i))
832
842
  break;
833
843
  return {
834
- value: String.fromCodePoint(s),
844
+ value: String.fromCodePoint(i),
835
845
  size: n
836
846
  };
837
847
  }
838
- if (s = s << 4 | b(i), s < 0)
848
+ if (i = i << 4 | k(s), i < 0)
839
849
  break;
840
850
  }
841
- throw m(
842
- t.source,
843
- e,
851
+ throw g(
852
+ e.source,
853
+ t,
844
854
  `Invalid Unicode escape sequence: "${r.slice(
845
- e,
846
- e + n
855
+ t,
856
+ t + n
847
857
  )}".`
848
858
  );
849
859
  }
850
- function Xe(t, e) {
851
- const r = t.source.body, s = oe(r, e + 2);
852
- if (k(s))
860
+ function _r(e, t) {
861
+ const r = e.source.body, i = de(r, t + 2);
862
+ if (L(i))
853
863
  return {
854
- value: String.fromCodePoint(s),
864
+ value: String.fromCodePoint(i),
855
865
  size: 6
856
866
  };
857
- if (me(s) && r.charCodeAt(e + 6) === 92 && r.charCodeAt(e + 7) === 117) {
858
- const n = oe(r, e + 8);
859
- if (ge(n))
867
+ if (Oe(i) && r.charCodeAt(t + 6) === 92 && r.charCodeAt(t + 7) === 117) {
868
+ const n = de(r, t + 8);
869
+ if (Te(n))
860
870
  return {
861
- value: String.fromCodePoint(s, n),
871
+ value: String.fromCodePoint(i, n),
862
872
  size: 12
863
873
  };
864
874
  }
865
- throw m(
866
- t.source,
867
- e,
868
- `Invalid Unicode escape sequence: "${r.slice(e, e + 6)}".`
875
+ throw g(
876
+ e.source,
877
+ t,
878
+ `Invalid Unicode escape sequence: "${r.slice(t, t + 6)}".`
869
879
  );
870
880
  }
871
- function oe(t, e) {
872
- return b(t.charCodeAt(e)) << 12 | b(t.charCodeAt(e + 1)) << 8 | b(t.charCodeAt(e + 2)) << 4 | b(t.charCodeAt(e + 3));
881
+ function de(e, t) {
882
+ return k(e.charCodeAt(t)) << 12 | k(e.charCodeAt(t + 1)) << 8 | k(e.charCodeAt(t + 2)) << 4 | k(e.charCodeAt(t + 3));
873
883
  }
874
- function b(t) {
875
- return t >= 48 && t <= 57 ? t - 48 : t >= 65 && t <= 70 ? t - 55 : t >= 97 && t <= 102 ? t - 87 : -1;
884
+ function k(e) {
885
+ return e >= 48 && e <= 57 ? e - 48 : e >= 65 && e <= 70 ? e - 55 : e >= 97 && e <= 102 ? e - 87 : -1;
876
886
  }
877
- function Ke(t, e) {
878
- const r = t.source.body;
879
- switch (r.charCodeAt(e + 1)) {
887
+ function Rr(e, t) {
888
+ const r = e.source.body;
889
+ switch (r.charCodeAt(t + 1)) {
880
890
  case 34:
881
891
  return {
882
892
  value: '"',
@@ -919,152 +929,152 @@ function Ke(t, e) {
919
929
  size: 2
920
930
  };
921
931
  }
922
- throw m(
923
- t.source,
924
- e,
932
+ throw g(
933
+ e.source,
934
+ t,
925
935
  `Invalid character escape sequence: "${r.slice(
926
- e,
927
- e + 2
936
+ t,
937
+ t + 2
928
938
  )}".`
929
939
  );
930
940
  }
931
- function We(t, e) {
932
- const r = t.source.body, s = r.length;
933
- let n = t.lineStart, i = e + 3, a = i, u = "";
941
+ function vr(e, t) {
942
+ const r = e.source.body, i = r.length;
943
+ let n = e.lineStart, s = t + 3, o = s, c = "";
934
944
  const l = [];
935
- for (; i < s; ) {
936
- const p = r.charCodeAt(i);
937
- if (p === 34 && r.charCodeAt(i + 1) === 34 && r.charCodeAt(i + 2) === 34) {
938
- u += r.slice(a, i), l.push(u);
939
- const c = h(
940
- t,
941
- o.BLOCK_STRING,
945
+ for (; s < i; ) {
946
+ const h = r.charCodeAt(s);
947
+ if (h === 34 && r.charCodeAt(s + 1) === 34 && r.charCodeAt(s + 2) === 34) {
948
+ c += r.slice(o, s), l.push(c);
949
+ const d = I(
942
950
  e,
943
- i + 3,
951
+ a.BLOCK_STRING,
952
+ t,
953
+ s + 3,
944
954
  // Return a string of the lines joined with U+000A.
945
- Ve(l).join(`
955
+ pr(l).join(`
946
956
  `)
947
957
  );
948
- return t.line += l.length - 1, t.lineStart = n, c;
958
+ return e.line += l.length - 1, e.lineStart = n, d;
949
959
  }
950
- if (p === 92 && r.charCodeAt(i + 1) === 34 && r.charCodeAt(i + 2) === 34 && r.charCodeAt(i + 3) === 34) {
951
- u += r.slice(a, i), a = i + 1, i += 4;
960
+ if (h === 92 && r.charCodeAt(s + 1) === 34 && r.charCodeAt(s + 2) === 34 && r.charCodeAt(s + 3) === 34) {
961
+ c += r.slice(o, s), o = s + 1, s += 4;
952
962
  continue;
953
963
  }
954
- if (p === 10 || p === 13) {
955
- u += r.slice(a, i), l.push(u), p === 13 && r.charCodeAt(i + 1) === 10 ? i += 2 : ++i, u = "", a = i, n = i;
964
+ if (h === 10 || h === 13) {
965
+ c += r.slice(o, s), l.push(c), h === 13 && r.charCodeAt(s + 1) === 10 ? s += 2 : ++s, c = "", o = s, n = s;
956
966
  continue;
957
967
  }
958
- if (k(p))
959
- ++i;
960
- else if (R(r, i))
961
- i += 2;
968
+ if (L(h))
969
+ ++s;
970
+ else if (V(r, s))
971
+ s += 2;
962
972
  else
963
- throw m(
964
- t.source,
965
- i,
966
- `Invalid character within String: ${A(
967
- t,
968
- i
973
+ throw g(
974
+ e.source,
975
+ s,
976
+ `Invalid character within String: ${R(
977
+ e,
978
+ s
969
979
  )}.`
970
980
  );
971
981
  }
972
- throw m(t.source, i, "Unterminated string.");
982
+ throw g(e.source, s, "Unterminated string.");
973
983
  }
974
- function Ze(t, e) {
975
- const r = t.source.body, s = r.length;
976
- let n = e + 1;
977
- for (; n < s; ) {
978
- const i = r.charCodeAt(n);
979
- if (Me(i))
984
+ function Lr(e, t) {
985
+ const r = e.source.body, i = r.length;
986
+ let n = t + 1;
987
+ for (; n < i; ) {
988
+ const s = r.charCodeAt(n);
989
+ if (Ir(s))
980
990
  ++n;
981
991
  else
982
992
  break;
983
993
  }
984
- return h(
985
- t,
986
- o.NAME,
994
+ return I(
987
995
  e,
996
+ a.NAME,
997
+ t,
988
998
  n,
989
- r.slice(e, n)
999
+ r.slice(t, n)
990
1000
  );
991
1001
  }
992
- const et = 10, Ie = 2;
993
- function Ee(t) {
994
- return w(t, []);
1002
+ const Pr = 10, Ne = 2;
1003
+ function De(e) {
1004
+ return w(e, []);
995
1005
  }
996
- function w(t, e) {
997
- switch (typeof t) {
1006
+ function w(e, t) {
1007
+ switch (typeof e) {
998
1008
  case "string":
999
- return JSON.stringify(t);
1009
+ return JSON.stringify(e);
1000
1010
  case "function":
1001
- return t.name ? `[function ${t.name}]` : "[function]";
1011
+ return e.name ? `[function ${e.name}]` : "[function]";
1002
1012
  case "object":
1003
- return tt(t, e);
1013
+ return kr(e, t);
1004
1014
  default:
1005
- return String(t);
1015
+ return String(e);
1006
1016
  }
1007
1017
  }
1008
- function tt(t, e) {
1009
- if (t === null)
1018
+ function kr(e, t) {
1019
+ if (e === null)
1010
1020
  return "null";
1011
- if (e.includes(t))
1021
+ if (t.includes(e))
1012
1022
  return "[Circular]";
1013
- const r = [...e, t];
1014
- if (rt(t)) {
1015
- const s = t.toJSON();
1016
- if (s !== t)
1017
- return typeof s == "string" ? s : w(s, r);
1018
- } else if (Array.isArray(t))
1019
- return st(t, r);
1020
- return nt(t, r);
1021
- }
1022
- function rt(t) {
1023
- return typeof t.toJSON == "function";
1024
- }
1025
- function nt(t, e) {
1026
- const r = Object.entries(t);
1027
- return r.length === 0 ? "{}" : e.length > Ie ? "[" + it(t) + "]" : "{ " + r.map(
1028
- ([n, i]) => n + ": " + w(i, e)
1023
+ const r = [...t, e];
1024
+ if (Cr(e)) {
1025
+ const i = e.toJSON();
1026
+ if (i !== e)
1027
+ return typeof i == "string" ? i : w(i, r);
1028
+ } else if (Array.isArray(e))
1029
+ return xr(e, r);
1030
+ return Sr(e, r);
1031
+ }
1032
+ function Cr(e) {
1033
+ return typeof e.toJSON == "function";
1034
+ }
1035
+ function Sr(e, t) {
1036
+ const r = Object.entries(e);
1037
+ return r.length === 0 ? "{}" : t.length > Ne ? "[" + br(e) + "]" : "{ " + r.map(
1038
+ ([n, s]) => n + ": " + w(s, t)
1029
1039
  ).join(", ") + " }";
1030
1040
  }
1031
- function st(t, e) {
1032
- if (t.length === 0)
1041
+ function xr(e, t) {
1042
+ if (e.length === 0)
1033
1043
  return "[]";
1034
- if (e.length > Ie)
1044
+ if (t.length > Ne)
1035
1045
  return "[Array]";
1036
- const r = Math.min(et, t.length), s = t.length - r, n = [];
1037
- for (let i = 0; i < r; ++i)
1038
- n.push(w(t[i], e));
1039
- return s === 1 ? n.push("... 1 more item") : s > 1 && n.push(`... ${s} more items`), "[" + n.join(", ") + "]";
1040
- }
1041
- function it(t) {
1042
- const e = Object.prototype.toString.call(t).replace(/^\[object /, "").replace(/]$/, "");
1043
- if (e === "Object" && typeof t.constructor == "function") {
1044
- const r = t.constructor.name;
1046
+ const r = Math.min(Pr, e.length), i = e.length - r, n = [];
1047
+ for (let s = 0; s < r; ++s)
1048
+ n.push(w(e[s], t));
1049
+ return i === 1 ? n.push("... 1 more item") : i > 1 && n.push(`... ${i} more items`), "[" + n.join(", ") + "]";
1050
+ }
1051
+ function br(e) {
1052
+ const t = Object.prototype.toString.call(e).replace(/^\[object /, "").replace(/]$/, "");
1053
+ if (t === "Object" && typeof e.constructor == "function") {
1054
+ const r = e.constructor.name;
1045
1055
  if (typeof r == "string" && r !== "")
1046
1056
  return r;
1047
1057
  }
1048
- return e;
1058
+ return t;
1049
1059
  }
1050
- const ot = globalThis.process && // eslint-disable-next-line no-undef
1051
- process.env.NODE_ENV === "production", at = (
1060
+ const Fr = globalThis.process && // eslint-disable-next-line no-undef
1061
+ process.env.NODE_ENV === "production", yr = (
1052
1062
  /* c8 ignore next 6 */
1053
1063
  // FIXME: https://github.com/graphql/graphql-js/issues/2317
1054
- ot ? function(e, r) {
1055
- return e instanceof r;
1056
- } : function(e, r) {
1057
- if (e instanceof r)
1064
+ Fr ? function(t, r) {
1065
+ return t instanceof r;
1066
+ } : function(t, r) {
1067
+ if (t instanceof r)
1058
1068
  return !0;
1059
- if (typeof e == "object" && e !== null) {
1060
- var s;
1061
- const n = r.prototype[Symbol.toStringTag], i = (
1069
+ if (typeof t == "object" && t !== null) {
1070
+ var i;
1071
+ const n = r.prototype[Symbol.toStringTag], s = (
1062
1072
  // We still need to support constructor's name to detect conflicts with older versions of this library.
1063
- Symbol.toStringTag in e ? e[Symbol.toStringTag] : (s = e.constructor) === null || s === void 0 ? void 0 : s.name
1073
+ Symbol.toStringTag in t ? t[Symbol.toStringTag] : (i = t.constructor) === null || i === void 0 ? void 0 : i.name
1064
1074
  );
1065
- if (n === i) {
1066
- const a = Ee(e);
1067
- throw new Error(`Cannot use ${n} "${a}" from another module or realm.
1075
+ if (n === s) {
1076
+ const o = De(t);
1077
+ throw new Error(`Cannot use ${n} "${o}" from another module or realm.
1068
1078
 
1069
1079
  Ensure that there is only one instance of "graphql" in the node_modules
1070
1080
  directory. If different versions of "graphql" are the dependencies of other
@@ -1081,15 +1091,15 @@ spurious results.`);
1081
1091
  return !1;
1082
1092
  }
1083
1093
  );
1084
- class ye {
1085
- constructor(e, r = "GraphQL request", s = {
1094
+ class _e {
1095
+ constructor(t, r = "GraphQL request", i = {
1086
1096
  line: 1,
1087
1097
  column: 1
1088
1098
  }) {
1089
- typeof e == "string" || B(!1, `Body must be a string. Received: ${Ee(e)}.`), this.body = e, this.name = r, this.locationOffset = s, this.locationOffset.line > 0 || B(
1099
+ typeof t == "string" || G(!1, `Body must be a string. Received: ${De(t)}.`), this.body = t, this.name = r, this.locationOffset = i, this.locationOffset.line > 0 || G(
1090
1100
  !1,
1091
1101
  "line in locationOffset is 1-indexed and must be positive."
1092
- ), this.locationOffset.column > 0 || B(
1102
+ ), this.locationOffset.column > 0 || G(
1093
1103
  !1,
1094
1104
  "column in locationOffset is 1-indexed and must be positive."
1095
1105
  );
@@ -1098,20 +1108,20 @@ class ye {
1098
1108
  return "Source";
1099
1109
  }
1100
1110
  }
1101
- function ct(t) {
1102
- return at(t, ye);
1111
+ function Ur(e) {
1112
+ return yr(e, _e);
1103
1113
  }
1104
- function dt(t, e) {
1105
- const r = new ut(t, e), s = r.parseDocument();
1106
- return Object.defineProperty(s, "tokenCount", {
1114
+ function Mr(e, t) {
1115
+ const r = new Vr(e, t), i = r.parseDocument();
1116
+ return Object.defineProperty(i, "tokenCount", {
1107
1117
  enumerable: !1,
1108
1118
  value: r.tokenCount
1109
- }), s;
1119
+ }), i;
1110
1120
  }
1111
- class ut {
1112
- constructor(e, r = {}) {
1113
- const s = ct(e) ? e : new ye(e);
1114
- this._lexer = new je(s), this._options = r, this._tokenCounter = 0;
1121
+ class Vr {
1122
+ constructor(t, r = {}) {
1123
+ const i = Ur(t) ? t : new _e(t);
1124
+ this._lexer = new fr(i), this._options = r, this._tokenCounter = 0;
1115
1125
  }
1116
1126
  get tokenCount() {
1117
1127
  return this._tokenCounter;
@@ -1120,10 +1130,10 @@ class ut {
1120
1130
  * Converts a name lex token into a name parse node.
1121
1131
  */
1122
1132
  parseName() {
1123
- const e = this.expectToken(o.NAME);
1124
- return this.node(e, {
1125
- kind: d.NAME,
1126
- value: e.value
1133
+ const t = this.expectToken(a.NAME);
1134
+ return this.node(t, {
1135
+ kind: u.NAME,
1136
+ value: t.value
1127
1137
  });
1128
1138
  }
1129
1139
  // Implements the parsing rules in the Document section.
@@ -1132,11 +1142,11 @@ class ut {
1132
1142
  */
1133
1143
  parseDocument() {
1134
1144
  return this.node(this._lexer.token, {
1135
- kind: d.DOCUMENT,
1145
+ kind: u.DOCUMENT,
1136
1146
  definitions: this.many(
1137
- o.SOF,
1147
+ a.SOF,
1138
1148
  this.parseDefinition,
1139
- o.EOF
1149
+ a.EOF
1140
1150
  )
1141
1151
  });
1142
1152
  }
@@ -1164,10 +1174,10 @@ class ut {
1164
1174
  * - InputObjectTypeDefinition
1165
1175
  */
1166
1176
  parseDefinition() {
1167
- if (this.peek(o.BRACE_L))
1177
+ if (this.peek(a.BRACE_L))
1168
1178
  return this.parseOperationDefinition();
1169
- const e = this.peekDescription(), r = e ? this._lexer.lookahead() : this._lexer.token;
1170
- if (r.kind === o.NAME) {
1179
+ const t = this.peekDescription(), r = t ? this._lexer.lookahead() : this._lexer.token;
1180
+ if (r.kind === a.NAME) {
1171
1181
  switch (r.value) {
1172
1182
  case "schema":
1173
1183
  return this.parseSchemaDefinition();
@@ -1186,8 +1196,8 @@ class ut {
1186
1196
  case "directive":
1187
1197
  return this.parseDirectiveDefinition();
1188
1198
  }
1189
- if (e)
1190
- throw m(
1199
+ if (t)
1200
+ throw g(
1191
1201
  this._lexer.source,
1192
1202
  this._lexer.token.start,
1193
1203
  "Unexpected description, descriptions are supported only on type definitions."
@@ -1212,22 +1222,22 @@ class ut {
1212
1222
  * - OperationType Name? VariableDefinitions? Directives? SelectionSet
1213
1223
  */
1214
1224
  parseOperationDefinition() {
1215
- const e = this._lexer.token;
1216
- if (this.peek(o.BRACE_L))
1217
- return this.node(e, {
1218
- kind: d.OPERATION_DEFINITION,
1219
- operation: D.QUERY,
1225
+ const t = this._lexer.token;
1226
+ if (this.peek(a.BRACE_L))
1227
+ return this.node(t, {
1228
+ kind: u.OPERATION_DEFINITION,
1229
+ operation: v.QUERY,
1220
1230
  name: void 0,
1221
1231
  variableDefinitions: [],
1222
1232
  directives: [],
1223
1233
  selectionSet: this.parseSelectionSet()
1224
1234
  });
1225
1235
  const r = this.parseOperationType();
1226
- let s;
1227
- return this.peek(o.NAME) && (s = this.parseName()), this.node(e, {
1228
- kind: d.OPERATION_DEFINITION,
1236
+ let i;
1237
+ return this.peek(a.NAME) && (i = this.parseName()), this.node(t, {
1238
+ kind: u.OPERATION_DEFINITION,
1229
1239
  operation: r,
1230
- name: s,
1240
+ name: i,
1231
1241
  variableDefinitions: this.parseVariableDefinitions(),
1232
1242
  directives: this.parseDirectives(!1),
1233
1243
  selectionSet: this.parseSelectionSet()
@@ -1237,25 +1247,25 @@ class ut {
1237
1247
  * OperationType : one of query mutation subscription
1238
1248
  */
1239
1249
  parseOperationType() {
1240
- const e = this.expectToken(o.NAME);
1241
- switch (e.value) {
1250
+ const t = this.expectToken(a.NAME);
1251
+ switch (t.value) {
1242
1252
  case "query":
1243
- return D.QUERY;
1253
+ return v.QUERY;
1244
1254
  case "mutation":
1245
- return D.MUTATION;
1255
+ return v.MUTATION;
1246
1256
  case "subscription":
1247
- return D.SUBSCRIPTION;
1257
+ return v.SUBSCRIPTION;
1248
1258
  }
1249
- throw this.unexpected(e);
1259
+ throw this.unexpected(t);
1250
1260
  }
1251
1261
  /**
1252
1262
  * VariableDefinitions : ( VariableDefinition+ )
1253
1263
  */
1254
1264
  parseVariableDefinitions() {
1255
1265
  return this.optionalMany(
1256
- o.PAREN_L,
1266
+ a.PAREN_L,
1257
1267
  this.parseVariableDefinition,
1258
- o.PAREN_R
1268
+ a.PAREN_R
1259
1269
  );
1260
1270
  }
1261
1271
  /**
@@ -1263,10 +1273,10 @@ class ut {
1263
1273
  */
1264
1274
  parseVariableDefinition() {
1265
1275
  return this.node(this._lexer.token, {
1266
- kind: d.VARIABLE_DEFINITION,
1276
+ kind: u.VARIABLE_DEFINITION,
1267
1277
  variable: this.parseVariable(),
1268
- type: (this.expectToken(o.COLON), this.parseTypeReference()),
1269
- defaultValue: this.expectOptionalToken(o.EQUALS) ? this.parseConstValueLiteral() : void 0,
1278
+ type: (this.expectToken(a.COLON), this.parseTypeReference()),
1279
+ defaultValue: this.expectOptionalToken(a.EQUALS) ? this.parseConstValueLiteral() : void 0,
1270
1280
  directives: this.parseConstDirectives()
1271
1281
  });
1272
1282
  }
@@ -1274,9 +1284,9 @@ class ut {
1274
1284
  * Variable : $ Name
1275
1285
  */
1276
1286
  parseVariable() {
1277
- const e = this._lexer.token;
1278
- return this.expectToken(o.DOLLAR), this.node(e, {
1279
- kind: d.VARIABLE,
1287
+ const t = this._lexer.token;
1288
+ return this.expectToken(a.DOLLAR), this.node(t, {
1289
+ kind: u.VARIABLE,
1280
1290
  name: this.parseName()
1281
1291
  });
1282
1292
  }
@@ -1287,11 +1297,11 @@ class ut {
1287
1297
  */
1288
1298
  parseSelectionSet() {
1289
1299
  return this.node(this._lexer.token, {
1290
- kind: d.SELECTION_SET,
1300
+ kind: u.SELECTION_SET,
1291
1301
  selections: this.many(
1292
- o.BRACE_L,
1302
+ a.BRACE_L,
1293
1303
  this.parseSelection,
1294
- o.BRACE_R
1304
+ a.BRACE_R
1295
1305
  )
1296
1306
  });
1297
1307
  }
@@ -1302,7 +1312,7 @@ class ut {
1302
1312
  * - InlineFragment
1303
1313
  */
1304
1314
  parseSelection() {
1305
- return this.peek(o.SPREAD) ? this.parseFragment() : this.parseField();
1315
+ return this.peek(a.SPREAD) ? this.parseFragment() : this.parseField();
1306
1316
  }
1307
1317
  /**
1308
1318
  * Field : Alias? Name Arguments? Directives? SelectionSet?
@@ -1310,33 +1320,33 @@ class ut {
1310
1320
  * Alias : Name :
1311
1321
  */
1312
1322
  parseField() {
1313
- const e = this._lexer.token, r = this.parseName();
1314
- let s, n;
1315
- return this.expectOptionalToken(o.COLON) ? (s = r, n = this.parseName()) : n = r, this.node(e, {
1316
- kind: d.FIELD,
1317
- alias: s,
1323
+ const t = this._lexer.token, r = this.parseName();
1324
+ let i, n;
1325
+ return this.expectOptionalToken(a.COLON) ? (i = r, n = this.parseName()) : n = r, this.node(t, {
1326
+ kind: u.FIELD,
1327
+ alias: i,
1318
1328
  name: n,
1319
1329
  arguments: this.parseArguments(!1),
1320
1330
  directives: this.parseDirectives(!1),
1321
- selectionSet: this.peek(o.BRACE_L) ? this.parseSelectionSet() : void 0
1331
+ selectionSet: this.peek(a.BRACE_L) ? this.parseSelectionSet() : void 0
1322
1332
  });
1323
1333
  }
1324
1334
  /**
1325
1335
  * Arguments[Const] : ( Argument[?Const]+ )
1326
1336
  */
1327
- parseArguments(e) {
1328
- const r = e ? this.parseConstArgument : this.parseArgument;
1329
- return this.optionalMany(o.PAREN_L, r, o.PAREN_R);
1337
+ parseArguments(t) {
1338
+ const r = t ? this.parseConstArgument : this.parseArgument;
1339
+ return this.optionalMany(a.PAREN_L, r, a.PAREN_R);
1330
1340
  }
1331
1341
  /**
1332
1342
  * Argument[Const] : Name : Value[?Const]
1333
1343
  */
1334
- parseArgument(e = !1) {
1335
- const r = this._lexer.token, s = this.parseName();
1336
- return this.expectToken(o.COLON), this.node(r, {
1337
- kind: d.ARGUMENT,
1338
- name: s,
1339
- value: this.parseValueLiteral(e)
1344
+ parseArgument(t = !1) {
1345
+ const r = this._lexer.token, i = this.parseName();
1346
+ return this.expectToken(a.COLON), this.node(r, {
1347
+ kind: u.ARGUMENT,
1348
+ name: i,
1349
+ value: this.parseValueLiteral(t)
1340
1350
  });
1341
1351
  }
1342
1352
  parseConstArgument() {
@@ -1351,15 +1361,15 @@ class ut {
1351
1361
  * InlineFragment : ... TypeCondition? Directives? SelectionSet
1352
1362
  */
1353
1363
  parseFragment() {
1354
- const e = this._lexer.token;
1355
- this.expectToken(o.SPREAD);
1364
+ const t = this._lexer.token;
1365
+ this.expectToken(a.SPREAD);
1356
1366
  const r = this.expectOptionalKeyword("on");
1357
- return !r && this.peek(o.NAME) ? this.node(e, {
1358
- kind: d.FRAGMENT_SPREAD,
1367
+ return !r && this.peek(a.NAME) ? this.node(t, {
1368
+ kind: u.FRAGMENT_SPREAD,
1359
1369
  name: this.parseFragmentName(),
1360
1370
  directives: this.parseDirectives(!1)
1361
- }) : this.node(e, {
1362
- kind: d.INLINE_FRAGMENT,
1371
+ }) : this.node(t, {
1372
+ kind: u.INLINE_FRAGMENT,
1363
1373
  typeCondition: r ? this.parseNamedType() : void 0,
1364
1374
  directives: this.parseDirectives(!1),
1365
1375
  selectionSet: this.parseSelectionSet()
@@ -1372,16 +1382,16 @@ class ut {
1372
1382
  * TypeCondition : NamedType
1373
1383
  */
1374
1384
  parseFragmentDefinition() {
1375
- const e = this._lexer.token;
1376
- return this.expectKeyword("fragment"), this._options.allowLegacyFragmentVariables === !0 ? this.node(e, {
1377
- kind: d.FRAGMENT_DEFINITION,
1385
+ const t = this._lexer.token;
1386
+ return this.expectKeyword("fragment"), this._options.allowLegacyFragmentVariables === !0 ? this.node(t, {
1387
+ kind: u.FRAGMENT_DEFINITION,
1378
1388
  name: this.parseFragmentName(),
1379
1389
  variableDefinitions: this.parseVariableDefinitions(),
1380
1390
  typeCondition: (this.expectKeyword("on"), this.parseNamedType()),
1381
1391
  directives: this.parseDirectives(!1),
1382
1392
  selectionSet: this.parseSelectionSet()
1383
- }) : this.node(e, {
1384
- kind: d.FRAGMENT_DEFINITION,
1393
+ }) : this.node(t, {
1394
+ kind: u.FRAGMENT_DEFINITION,
1385
1395
  name: this.parseFragmentName(),
1386
1396
  typeCondition: (this.expectKeyword("on"), this.parseNamedType()),
1387
1397
  directives: this.parseDirectives(!1),
@@ -1415,56 +1425,56 @@ class ut {
1415
1425
  *
1416
1426
  * EnumValue : Name but not `true`, `false` or `null`
1417
1427
  */
1418
- parseValueLiteral(e) {
1428
+ parseValueLiteral(t) {
1419
1429
  const r = this._lexer.token;
1420
1430
  switch (r.kind) {
1421
- case o.BRACKET_L:
1422
- return this.parseList(e);
1423
- case o.BRACE_L:
1424
- return this.parseObject(e);
1425
- case o.INT:
1431
+ case a.BRACKET_L:
1432
+ return this.parseList(t);
1433
+ case a.BRACE_L:
1434
+ return this.parseObject(t);
1435
+ case a.INT:
1426
1436
  return this.advanceLexer(), this.node(r, {
1427
- kind: d.INT,
1437
+ kind: u.INT,
1428
1438
  value: r.value
1429
1439
  });
1430
- case o.FLOAT:
1440
+ case a.FLOAT:
1431
1441
  return this.advanceLexer(), this.node(r, {
1432
- kind: d.FLOAT,
1442
+ kind: u.FLOAT,
1433
1443
  value: r.value
1434
1444
  });
1435
- case o.STRING:
1436
- case o.BLOCK_STRING:
1445
+ case a.STRING:
1446
+ case a.BLOCK_STRING:
1437
1447
  return this.parseStringLiteral();
1438
- case o.NAME:
1448
+ case a.NAME:
1439
1449
  switch (this.advanceLexer(), r.value) {
1440
1450
  case "true":
1441
1451
  return this.node(r, {
1442
- kind: d.BOOLEAN,
1452
+ kind: u.BOOLEAN,
1443
1453
  value: !0
1444
1454
  });
1445
1455
  case "false":
1446
1456
  return this.node(r, {
1447
- kind: d.BOOLEAN,
1457
+ kind: u.BOOLEAN,
1448
1458
  value: !1
1449
1459
  });
1450
1460
  case "null":
1451
1461
  return this.node(r, {
1452
- kind: d.NULL
1462
+ kind: u.NULL
1453
1463
  });
1454
1464
  default:
1455
1465
  return this.node(r, {
1456
- kind: d.ENUM,
1466
+ kind: u.ENUM,
1457
1467
  value: r.value
1458
1468
  });
1459
1469
  }
1460
- case o.DOLLAR:
1461
- if (e)
1462
- if (this.expectToken(o.DOLLAR), this._lexer.token.kind === o.NAME) {
1463
- const s = this._lexer.token.value;
1464
- throw m(
1470
+ case a.DOLLAR:
1471
+ if (t)
1472
+ if (this.expectToken(a.DOLLAR), this._lexer.token.kind === a.NAME) {
1473
+ const i = this._lexer.token.value;
1474
+ throw g(
1465
1475
  this._lexer.source,
1466
1476
  r.start,
1467
- `Unexpected variable "$${s}" in constant value.`
1477
+ `Unexpected variable "$${i}" in constant value.`
1468
1478
  );
1469
1479
  } else
1470
1480
  throw this.unexpected(r);
@@ -1477,11 +1487,11 @@ class ut {
1477
1487
  return this.parseValueLiteral(!0);
1478
1488
  }
1479
1489
  parseStringLiteral() {
1480
- const e = this._lexer.token;
1481
- return this.advanceLexer(), this.node(e, {
1482
- kind: d.STRING,
1483
- value: e.value,
1484
- block: e.kind === o.BLOCK_STRING
1490
+ const t = this._lexer.token;
1491
+ return this.advanceLexer(), this.node(t, {
1492
+ kind: u.STRING,
1493
+ value: t.value,
1494
+ block: t.kind === a.BLOCK_STRING
1485
1495
  });
1486
1496
  }
1487
1497
  /**
@@ -1489,11 +1499,11 @@ class ut {
1489
1499
  * - [ ]
1490
1500
  * - [ Value[?Const]+ ]
1491
1501
  */
1492
- parseList(e) {
1493
- const r = () => this.parseValueLiteral(e);
1502
+ parseList(t) {
1503
+ const r = () => this.parseValueLiteral(t);
1494
1504
  return this.node(this._lexer.token, {
1495
- kind: d.LIST,
1496
- values: this.any(o.BRACKET_L, r, o.BRACKET_R)
1505
+ kind: u.LIST,
1506
+ values: this.any(a.BRACKET_L, r, a.BRACKET_R)
1497
1507
  });
1498
1508
  }
1499
1509
  /**
@@ -1503,32 +1513,32 @@ class ut {
1503
1513
  * - { ObjectField[?Const]+ }
1504
1514
  * ```
1505
1515
  */
1506
- parseObject(e) {
1507
- const r = () => this.parseObjectField(e);
1516
+ parseObject(t) {
1517
+ const r = () => this.parseObjectField(t);
1508
1518
  return this.node(this._lexer.token, {
1509
- kind: d.OBJECT,
1510
- fields: this.any(o.BRACE_L, r, o.BRACE_R)
1519
+ kind: u.OBJECT,
1520
+ fields: this.any(a.BRACE_L, r, a.BRACE_R)
1511
1521
  });
1512
1522
  }
1513
1523
  /**
1514
1524
  * ObjectField[Const] : Name : Value[?Const]
1515
1525
  */
1516
- parseObjectField(e) {
1517
- const r = this._lexer.token, s = this.parseName();
1518
- return this.expectToken(o.COLON), this.node(r, {
1519
- kind: d.OBJECT_FIELD,
1520
- name: s,
1521
- value: this.parseValueLiteral(e)
1526
+ parseObjectField(t) {
1527
+ const r = this._lexer.token, i = this.parseName();
1528
+ return this.expectToken(a.COLON), this.node(r, {
1529
+ kind: u.OBJECT_FIELD,
1530
+ name: i,
1531
+ value: this.parseValueLiteral(t)
1522
1532
  });
1523
1533
  }
1524
1534
  // Implements the parsing rules in the Directives section.
1525
1535
  /**
1526
1536
  * Directives[Const] : Directive[?Const]+
1527
1537
  */
1528
- parseDirectives(e) {
1538
+ parseDirectives(t) {
1529
1539
  const r = [];
1530
- for (; this.peek(o.AT); )
1531
- r.push(this.parseDirective(e));
1540
+ for (; this.peek(a.AT); )
1541
+ r.push(this.parseDirective(t));
1532
1542
  return r;
1533
1543
  }
1534
1544
  parseConstDirectives() {
@@ -1539,12 +1549,12 @@ class ut {
1539
1549
  * Directive[Const] : @ Name Arguments[?Const]?
1540
1550
  * ```
1541
1551
  */
1542
- parseDirective(e) {
1552
+ parseDirective(t) {
1543
1553
  const r = this._lexer.token;
1544
- return this.expectToken(o.AT), this.node(r, {
1545
- kind: d.DIRECTIVE,
1554
+ return this.expectToken(a.AT), this.node(r, {
1555
+ kind: u.DIRECTIVE,
1546
1556
  name: this.parseName(),
1547
- arguments: this.parseArguments(e)
1557
+ arguments: this.parseArguments(t)
1548
1558
  });
1549
1559
  }
1550
1560
  // Implements the parsing rules in the Types section.
@@ -1555,18 +1565,18 @@ class ut {
1555
1565
  * - NonNullType
1556
1566
  */
1557
1567
  parseTypeReference() {
1558
- const e = this._lexer.token;
1568
+ const t = this._lexer.token;
1559
1569
  let r;
1560
- if (this.expectOptionalToken(o.BRACKET_L)) {
1561
- const s = this.parseTypeReference();
1562
- this.expectToken(o.BRACKET_R), r = this.node(e, {
1563
- kind: d.LIST_TYPE,
1564
- type: s
1570
+ if (this.expectOptionalToken(a.BRACKET_L)) {
1571
+ const i = this.parseTypeReference();
1572
+ this.expectToken(a.BRACKET_R), r = this.node(t, {
1573
+ kind: u.LIST_TYPE,
1574
+ type: i
1565
1575
  });
1566
1576
  } else
1567
1577
  r = this.parseNamedType();
1568
- return this.expectOptionalToken(o.BANG) ? this.node(e, {
1569
- kind: d.NON_NULL_TYPE,
1578
+ return this.expectOptionalToken(a.BANG) ? this.node(t, {
1579
+ kind: u.NON_NULL_TYPE,
1570
1580
  type: r
1571
1581
  }) : r;
1572
1582
  }
@@ -1575,13 +1585,13 @@ class ut {
1575
1585
  */
1576
1586
  parseNamedType() {
1577
1587
  return this.node(this._lexer.token, {
1578
- kind: d.NAMED_TYPE,
1588
+ kind: u.NAMED_TYPE,
1579
1589
  name: this.parseName()
1580
1590
  });
1581
1591
  }
1582
1592
  // Implements the parsing rules in the Type Definition section.
1583
1593
  peekDescription() {
1584
- return this.peek(o.STRING) || this.peek(o.BLOCK_STRING);
1594
+ return this.peek(a.STRING) || this.peek(a.BLOCK_STRING);
1585
1595
  }
1586
1596
  /**
1587
1597
  * Description : StringValue
@@ -1596,17 +1606,17 @@ class ut {
1596
1606
  * ```
1597
1607
  */
1598
1608
  parseSchemaDefinition() {
1599
- const e = this._lexer.token, r = this.parseDescription();
1609
+ const t = this._lexer.token, r = this.parseDescription();
1600
1610
  this.expectKeyword("schema");
1601
- const s = this.parseConstDirectives(), n = this.many(
1602
- o.BRACE_L,
1611
+ const i = this.parseConstDirectives(), n = this.many(
1612
+ a.BRACE_L,
1603
1613
  this.parseOperationTypeDefinition,
1604
- o.BRACE_R
1614
+ a.BRACE_R
1605
1615
  );
1606
- return this.node(e, {
1607
- kind: d.SCHEMA_DEFINITION,
1616
+ return this.node(t, {
1617
+ kind: u.SCHEMA_DEFINITION,
1608
1618
  description: r,
1609
- directives: s,
1619
+ directives: i,
1610
1620
  operationTypes: n
1611
1621
  });
1612
1622
  }
@@ -1614,26 +1624,26 @@ class ut {
1614
1624
  * OperationTypeDefinition : OperationType : NamedType
1615
1625
  */
1616
1626
  parseOperationTypeDefinition() {
1617
- const e = this._lexer.token, r = this.parseOperationType();
1618
- this.expectToken(o.COLON);
1619
- const s = this.parseNamedType();
1620
- return this.node(e, {
1621
- kind: d.OPERATION_TYPE_DEFINITION,
1627
+ const t = this._lexer.token, r = this.parseOperationType();
1628
+ this.expectToken(a.COLON);
1629
+ const i = this.parseNamedType();
1630
+ return this.node(t, {
1631
+ kind: u.OPERATION_TYPE_DEFINITION,
1622
1632
  operation: r,
1623
- type: s
1633
+ type: i
1624
1634
  });
1625
1635
  }
1626
1636
  /**
1627
1637
  * ScalarTypeDefinition : Description? scalar Name Directives[Const]?
1628
1638
  */
1629
1639
  parseScalarTypeDefinition() {
1630
- const e = this._lexer.token, r = this.parseDescription();
1640
+ const t = this._lexer.token, r = this.parseDescription();
1631
1641
  this.expectKeyword("scalar");
1632
- const s = this.parseName(), n = this.parseConstDirectives();
1633
- return this.node(e, {
1634
- kind: d.SCALAR_TYPE_DEFINITION,
1642
+ const i = this.parseName(), n = this.parseConstDirectives();
1643
+ return this.node(t, {
1644
+ kind: u.SCALAR_TYPE_DEFINITION,
1635
1645
  description: r,
1636
- name: s,
1646
+ name: i,
1637
1647
  directives: n
1638
1648
  });
1639
1649
  }
@@ -1643,16 +1653,16 @@ class ut {
1643
1653
  * type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition?
1644
1654
  */
1645
1655
  parseObjectTypeDefinition() {
1646
- const e = this._lexer.token, r = this.parseDescription();
1656
+ const t = this._lexer.token, r = this.parseDescription();
1647
1657
  this.expectKeyword("type");
1648
- const s = this.parseName(), n = this.parseImplementsInterfaces(), i = this.parseConstDirectives(), a = this.parseFieldsDefinition();
1649
- return this.node(e, {
1650
- kind: d.OBJECT_TYPE_DEFINITION,
1658
+ const i = this.parseName(), n = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), o = this.parseFieldsDefinition();
1659
+ return this.node(t, {
1660
+ kind: u.OBJECT_TYPE_DEFINITION,
1651
1661
  description: r,
1652
- name: s,
1662
+ name: i,
1653
1663
  interfaces: n,
1654
- directives: i,
1655
- fields: a
1664
+ directives: s,
1665
+ fields: o
1656
1666
  });
1657
1667
  }
1658
1668
  /**
@@ -1661,7 +1671,7 @@ class ut {
1661
1671
  * - ImplementsInterfaces & NamedType
1662
1672
  */
1663
1673
  parseImplementsInterfaces() {
1664
- return this.expectOptionalKeyword("implements") ? this.delimitedMany(o.AMP, this.parseNamedType) : [];
1674
+ return this.expectOptionalKeyword("implements") ? this.delimitedMany(a.AMP, this.parseNamedType) : [];
1665
1675
  }
1666
1676
  /**
1667
1677
  * ```
@@ -1670,9 +1680,9 @@ class ut {
1670
1680
  */
1671
1681
  parseFieldsDefinition() {
1672
1682
  return this.optionalMany(
1673
- o.BRACE_L,
1683
+ a.BRACE_L,
1674
1684
  this.parseFieldDefinition,
1675
- o.BRACE_R
1685
+ a.BRACE_R
1676
1686
  );
1677
1687
  }
1678
1688
  /**
@@ -1680,16 +1690,16 @@ class ut {
1680
1690
  * - Description? Name ArgumentsDefinition? : Type Directives[Const]?
1681
1691
  */
1682
1692
  parseFieldDefinition() {
1683
- const e = this._lexer.token, r = this.parseDescription(), s = this.parseName(), n = this.parseArgumentDefs();
1684
- this.expectToken(o.COLON);
1685
- const i = this.parseTypeReference(), a = this.parseConstDirectives();
1686
- return this.node(e, {
1687
- kind: d.FIELD_DEFINITION,
1693
+ const t = this._lexer.token, r = this.parseDescription(), i = this.parseName(), n = this.parseArgumentDefs();
1694
+ this.expectToken(a.COLON);
1695
+ const s = this.parseTypeReference(), o = this.parseConstDirectives();
1696
+ return this.node(t, {
1697
+ kind: u.FIELD_DEFINITION,
1688
1698
  description: r,
1689
- name: s,
1699
+ name: i,
1690
1700
  arguments: n,
1691
- type: i,
1692
- directives: a
1701
+ type: s,
1702
+ directives: o
1693
1703
  });
1694
1704
  }
1695
1705
  /**
@@ -1697,9 +1707,9 @@ class ut {
1697
1707
  */
1698
1708
  parseArgumentDefs() {
1699
1709
  return this.optionalMany(
1700
- o.PAREN_L,
1710
+ a.PAREN_L,
1701
1711
  this.parseInputValueDef,
1702
- o.PAREN_R
1712
+ a.PAREN_R
1703
1713
  );
1704
1714
  }
1705
1715
  /**
@@ -1707,19 +1717,19 @@ class ut {
1707
1717
  * - Description? Name : Type DefaultValue? Directives[Const]?
1708
1718
  */
1709
1719
  parseInputValueDef() {
1710
- const e = this._lexer.token, r = this.parseDescription(), s = this.parseName();
1711
- this.expectToken(o.COLON);
1720
+ const t = this._lexer.token, r = this.parseDescription(), i = this.parseName();
1721
+ this.expectToken(a.COLON);
1712
1722
  const n = this.parseTypeReference();
1713
- let i;
1714
- this.expectOptionalToken(o.EQUALS) && (i = this.parseConstValueLiteral());
1715
- const a = this.parseConstDirectives();
1716
- return this.node(e, {
1717
- kind: d.INPUT_VALUE_DEFINITION,
1723
+ let s;
1724
+ this.expectOptionalToken(a.EQUALS) && (s = this.parseConstValueLiteral());
1725
+ const o = this.parseConstDirectives();
1726
+ return this.node(t, {
1727
+ kind: u.INPUT_VALUE_DEFINITION,
1718
1728
  description: r,
1719
- name: s,
1729
+ name: i,
1720
1730
  type: n,
1721
- defaultValue: i,
1722
- directives: a
1731
+ defaultValue: s,
1732
+ directives: o
1723
1733
  });
1724
1734
  }
1725
1735
  /**
@@ -1727,16 +1737,16 @@ class ut {
1727
1737
  * - Description? interface Name Directives[Const]? FieldsDefinition?
1728
1738
  */
1729
1739
  parseInterfaceTypeDefinition() {
1730
- const e = this._lexer.token, r = this.parseDescription();
1740
+ const t = this._lexer.token, r = this.parseDescription();
1731
1741
  this.expectKeyword("interface");
1732
- const s = this.parseName(), n = this.parseImplementsInterfaces(), i = this.parseConstDirectives(), a = this.parseFieldsDefinition();
1733
- return this.node(e, {
1734
- kind: d.INTERFACE_TYPE_DEFINITION,
1742
+ const i = this.parseName(), n = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), o = this.parseFieldsDefinition();
1743
+ return this.node(t, {
1744
+ kind: u.INTERFACE_TYPE_DEFINITION,
1735
1745
  description: r,
1736
- name: s,
1746
+ name: i,
1737
1747
  interfaces: n,
1738
- directives: i,
1739
- fields: a
1748
+ directives: s,
1749
+ fields: o
1740
1750
  });
1741
1751
  }
1742
1752
  /**
@@ -1744,15 +1754,15 @@ class ut {
1744
1754
  * - Description? union Name Directives[Const]? UnionMemberTypes?
1745
1755
  */
1746
1756
  parseUnionTypeDefinition() {
1747
- const e = this._lexer.token, r = this.parseDescription();
1757
+ const t = this._lexer.token, r = this.parseDescription();
1748
1758
  this.expectKeyword("union");
1749
- const s = this.parseName(), n = this.parseConstDirectives(), i = this.parseUnionMemberTypes();
1750
- return this.node(e, {
1751
- kind: d.UNION_TYPE_DEFINITION,
1759
+ const i = this.parseName(), n = this.parseConstDirectives(), s = this.parseUnionMemberTypes();
1760
+ return this.node(t, {
1761
+ kind: u.UNION_TYPE_DEFINITION,
1752
1762
  description: r,
1753
- name: s,
1763
+ name: i,
1754
1764
  directives: n,
1755
- types: i
1765
+ types: s
1756
1766
  });
1757
1767
  }
1758
1768
  /**
@@ -1761,22 +1771,22 @@ class ut {
1761
1771
  * - UnionMemberTypes | NamedType
1762
1772
  */
1763
1773
  parseUnionMemberTypes() {
1764
- return this.expectOptionalToken(o.EQUALS) ? this.delimitedMany(o.PIPE, this.parseNamedType) : [];
1774
+ return this.expectOptionalToken(a.EQUALS) ? this.delimitedMany(a.PIPE, this.parseNamedType) : [];
1765
1775
  }
1766
1776
  /**
1767
1777
  * EnumTypeDefinition :
1768
1778
  * - Description? enum Name Directives[Const]? EnumValuesDefinition?
1769
1779
  */
1770
1780
  parseEnumTypeDefinition() {
1771
- const e = this._lexer.token, r = this.parseDescription();
1781
+ const t = this._lexer.token, r = this.parseDescription();
1772
1782
  this.expectKeyword("enum");
1773
- const s = this.parseName(), n = this.parseConstDirectives(), i = this.parseEnumValuesDefinition();
1774
- return this.node(e, {
1775
- kind: d.ENUM_TYPE_DEFINITION,
1783
+ const i = this.parseName(), n = this.parseConstDirectives(), s = this.parseEnumValuesDefinition();
1784
+ return this.node(t, {
1785
+ kind: u.ENUM_TYPE_DEFINITION,
1776
1786
  description: r,
1777
- name: s,
1787
+ name: i,
1778
1788
  directives: n,
1779
- values: i
1789
+ values: s
1780
1790
  });
1781
1791
  }
1782
1792
  /**
@@ -1786,20 +1796,20 @@ class ut {
1786
1796
  */
1787
1797
  parseEnumValuesDefinition() {
1788
1798
  return this.optionalMany(
1789
- o.BRACE_L,
1799
+ a.BRACE_L,
1790
1800
  this.parseEnumValueDefinition,
1791
- o.BRACE_R
1801
+ a.BRACE_R
1792
1802
  );
1793
1803
  }
1794
1804
  /**
1795
1805
  * EnumValueDefinition : Description? EnumValue Directives[Const]?
1796
1806
  */
1797
1807
  parseEnumValueDefinition() {
1798
- const e = this._lexer.token, r = this.parseDescription(), s = this.parseEnumValueName(), n = this.parseConstDirectives();
1799
- return this.node(e, {
1800
- kind: d.ENUM_VALUE_DEFINITION,
1808
+ const t = this._lexer.token, r = this.parseDescription(), i = this.parseEnumValueName(), n = this.parseConstDirectives();
1809
+ return this.node(t, {
1810
+ kind: u.ENUM_VALUE_DEFINITION,
1801
1811
  description: r,
1802
- name: s,
1812
+ name: i,
1803
1813
  directives: n
1804
1814
  });
1805
1815
  }
@@ -1808,10 +1818,10 @@ class ut {
1808
1818
  */
1809
1819
  parseEnumValueName() {
1810
1820
  if (this._lexer.token.value === "true" || this._lexer.token.value === "false" || this._lexer.token.value === "null")
1811
- throw m(
1821
+ throw g(
1812
1822
  this._lexer.source,
1813
1823
  this._lexer.token.start,
1814
- `${C(
1824
+ `${x(
1815
1825
  this._lexer.token
1816
1826
  )} is reserved and cannot be used for an enum value.`
1817
1827
  );
@@ -1822,15 +1832,15 @@ class ut {
1822
1832
  * - Description? input Name Directives[Const]? InputFieldsDefinition?
1823
1833
  */
1824
1834
  parseInputObjectTypeDefinition() {
1825
- const e = this._lexer.token, r = this.parseDescription();
1835
+ const t = this._lexer.token, r = this.parseDescription();
1826
1836
  this.expectKeyword("input");
1827
- const s = this.parseName(), n = this.parseConstDirectives(), i = this.parseInputFieldsDefinition();
1828
- return this.node(e, {
1829
- kind: d.INPUT_OBJECT_TYPE_DEFINITION,
1837
+ const i = this.parseName(), n = this.parseConstDirectives(), s = this.parseInputFieldsDefinition();
1838
+ return this.node(t, {
1839
+ kind: u.INPUT_OBJECT_TYPE_DEFINITION,
1830
1840
  description: r,
1831
- name: s,
1841
+ name: i,
1832
1842
  directives: n,
1833
- fields: i
1843
+ fields: s
1834
1844
  });
1835
1845
  }
1836
1846
  /**
@@ -1840,9 +1850,9 @@ class ut {
1840
1850
  */
1841
1851
  parseInputFieldsDefinition() {
1842
1852
  return this.optionalMany(
1843
- o.BRACE_L,
1853
+ a.BRACE_L,
1844
1854
  this.parseInputValueDef,
1845
- o.BRACE_R
1855
+ a.BRACE_R
1846
1856
  );
1847
1857
  }
1848
1858
  /**
@@ -1859,9 +1869,9 @@ class ut {
1859
1869
  * - InputObjectTypeDefinition
1860
1870
  */
1861
1871
  parseTypeSystemExtension() {
1862
- const e = this._lexer.lookahead();
1863
- if (e.kind === o.NAME)
1864
- switch (e.value) {
1872
+ const t = this._lexer.lookahead();
1873
+ if (t.kind === a.NAME)
1874
+ switch (t.value) {
1865
1875
  case "schema":
1866
1876
  return this.parseSchemaExtension();
1867
1877
  case "scalar":
@@ -1877,7 +1887,7 @@ class ut {
1877
1887
  case "input":
1878
1888
  return this.parseInputObjectTypeExtension();
1879
1889
  }
1880
- throw this.unexpected(e);
1890
+ throw this.unexpected(t);
1881
1891
  }
1882
1892
  /**
1883
1893
  * ```
@@ -1887,19 +1897,19 @@ class ut {
1887
1897
  * ```
1888
1898
  */
1889
1899
  parseSchemaExtension() {
1890
- const e = this._lexer.token;
1900
+ const t = this._lexer.token;
1891
1901
  this.expectKeyword("extend"), this.expectKeyword("schema");
1892
- const r = this.parseConstDirectives(), s = this.optionalMany(
1893
- o.BRACE_L,
1902
+ const r = this.parseConstDirectives(), i = this.optionalMany(
1903
+ a.BRACE_L,
1894
1904
  this.parseOperationTypeDefinition,
1895
- o.BRACE_R
1905
+ a.BRACE_R
1896
1906
  );
1897
- if (r.length === 0 && s.length === 0)
1907
+ if (r.length === 0 && i.length === 0)
1898
1908
  throw this.unexpected();
1899
- return this.node(e, {
1900
- kind: d.SCHEMA_EXTENSION,
1909
+ return this.node(t, {
1910
+ kind: u.SCHEMA_EXTENSION,
1901
1911
  directives: r,
1902
- operationTypes: s
1912
+ operationTypes: i
1903
1913
  });
1904
1914
  }
1905
1915
  /**
@@ -1907,15 +1917,15 @@ class ut {
1907
1917
  * - extend scalar Name Directives[Const]
1908
1918
  */
1909
1919
  parseScalarTypeExtension() {
1910
- const e = this._lexer.token;
1920
+ const t = this._lexer.token;
1911
1921
  this.expectKeyword("extend"), this.expectKeyword("scalar");
1912
- const r = this.parseName(), s = this.parseConstDirectives();
1913
- if (s.length === 0)
1922
+ const r = this.parseName(), i = this.parseConstDirectives();
1923
+ if (i.length === 0)
1914
1924
  throw this.unexpected();
1915
- return this.node(e, {
1916
- kind: d.SCALAR_TYPE_EXTENSION,
1925
+ return this.node(t, {
1926
+ kind: u.SCALAR_TYPE_EXTENSION,
1917
1927
  name: r,
1918
- directives: s
1928
+ directives: i
1919
1929
  });
1920
1930
  }
1921
1931
  /**
@@ -1925,17 +1935,17 @@ class ut {
1925
1935
  * - extend type Name ImplementsInterfaces
1926
1936
  */
1927
1937
  parseObjectTypeExtension() {
1928
- const e = this._lexer.token;
1938
+ const t = this._lexer.token;
1929
1939
  this.expectKeyword("extend"), this.expectKeyword("type");
1930
- const r = this.parseName(), s = this.parseImplementsInterfaces(), n = this.parseConstDirectives(), i = this.parseFieldsDefinition();
1931
- if (s.length === 0 && n.length === 0 && i.length === 0)
1940
+ const r = this.parseName(), i = this.parseImplementsInterfaces(), n = this.parseConstDirectives(), s = this.parseFieldsDefinition();
1941
+ if (i.length === 0 && n.length === 0 && s.length === 0)
1932
1942
  throw this.unexpected();
1933
- return this.node(e, {
1934
- kind: d.OBJECT_TYPE_EXTENSION,
1943
+ return this.node(t, {
1944
+ kind: u.OBJECT_TYPE_EXTENSION,
1935
1945
  name: r,
1936
- interfaces: s,
1946
+ interfaces: i,
1937
1947
  directives: n,
1938
- fields: i
1948
+ fields: s
1939
1949
  });
1940
1950
  }
1941
1951
  /**
@@ -1945,17 +1955,17 @@ class ut {
1945
1955
  * - extend interface Name ImplementsInterfaces
1946
1956
  */
1947
1957
  parseInterfaceTypeExtension() {
1948
- const e = this._lexer.token;
1958
+ const t = this._lexer.token;
1949
1959
  this.expectKeyword("extend"), this.expectKeyword("interface");
1950
- const r = this.parseName(), s = this.parseImplementsInterfaces(), n = this.parseConstDirectives(), i = this.parseFieldsDefinition();
1951
- if (s.length === 0 && n.length === 0 && i.length === 0)
1960
+ const r = this.parseName(), i = this.parseImplementsInterfaces(), n = this.parseConstDirectives(), s = this.parseFieldsDefinition();
1961
+ if (i.length === 0 && n.length === 0 && s.length === 0)
1952
1962
  throw this.unexpected();
1953
- return this.node(e, {
1954
- kind: d.INTERFACE_TYPE_EXTENSION,
1963
+ return this.node(t, {
1964
+ kind: u.INTERFACE_TYPE_EXTENSION,
1955
1965
  name: r,
1956
- interfaces: s,
1966
+ interfaces: i,
1957
1967
  directives: n,
1958
- fields: i
1968
+ fields: s
1959
1969
  });
1960
1970
  }
1961
1971
  /**
@@ -1964,15 +1974,15 @@ class ut {
1964
1974
  * - extend union Name Directives[Const]
1965
1975
  */
1966
1976
  parseUnionTypeExtension() {
1967
- const e = this._lexer.token;
1977
+ const t = this._lexer.token;
1968
1978
  this.expectKeyword("extend"), this.expectKeyword("union");
1969
- const r = this.parseName(), s = this.parseConstDirectives(), n = this.parseUnionMemberTypes();
1970
- if (s.length === 0 && n.length === 0)
1979
+ const r = this.parseName(), i = this.parseConstDirectives(), n = this.parseUnionMemberTypes();
1980
+ if (i.length === 0 && n.length === 0)
1971
1981
  throw this.unexpected();
1972
- return this.node(e, {
1973
- kind: d.UNION_TYPE_EXTENSION,
1982
+ return this.node(t, {
1983
+ kind: u.UNION_TYPE_EXTENSION,
1974
1984
  name: r,
1975
- directives: s,
1985
+ directives: i,
1976
1986
  types: n
1977
1987
  });
1978
1988
  }
@@ -1982,15 +1992,15 @@ class ut {
1982
1992
  * - extend enum Name Directives[Const]
1983
1993
  */
1984
1994
  parseEnumTypeExtension() {
1985
- const e = this._lexer.token;
1995
+ const t = this._lexer.token;
1986
1996
  this.expectKeyword("extend"), this.expectKeyword("enum");
1987
- const r = this.parseName(), s = this.parseConstDirectives(), n = this.parseEnumValuesDefinition();
1988
- if (s.length === 0 && n.length === 0)
1997
+ const r = this.parseName(), i = this.parseConstDirectives(), n = this.parseEnumValuesDefinition();
1998
+ if (i.length === 0 && n.length === 0)
1989
1999
  throw this.unexpected();
1990
- return this.node(e, {
1991
- kind: d.ENUM_TYPE_EXTENSION,
2000
+ return this.node(t, {
2001
+ kind: u.ENUM_TYPE_EXTENSION,
1992
2002
  name: r,
1993
- directives: s,
2003
+ directives: i,
1994
2004
  values: n
1995
2005
  });
1996
2006
  }
@@ -2000,15 +2010,15 @@ class ut {
2000
2010
  * - extend input Name Directives[Const]
2001
2011
  */
2002
2012
  parseInputObjectTypeExtension() {
2003
- const e = this._lexer.token;
2013
+ const t = this._lexer.token;
2004
2014
  this.expectKeyword("extend"), this.expectKeyword("input");
2005
- const r = this.parseName(), s = this.parseConstDirectives(), n = this.parseInputFieldsDefinition();
2006
- if (s.length === 0 && n.length === 0)
2015
+ const r = this.parseName(), i = this.parseConstDirectives(), n = this.parseInputFieldsDefinition();
2016
+ if (i.length === 0 && n.length === 0)
2007
2017
  throw this.unexpected();
2008
- return this.node(e, {
2009
- kind: d.INPUT_OBJECT_TYPE_EXTENSION,
2018
+ return this.node(t, {
2019
+ kind: u.INPUT_OBJECT_TYPE_EXTENSION,
2010
2020
  name: r,
2011
- directives: s,
2021
+ directives: i,
2012
2022
  fields: n
2013
2023
  });
2014
2024
  }
@@ -2019,18 +2029,18 @@ class ut {
2019
2029
  * ```
2020
2030
  */
2021
2031
  parseDirectiveDefinition() {
2022
- const e = this._lexer.token, r = this.parseDescription();
2023
- this.expectKeyword("directive"), this.expectToken(o.AT);
2024
- const s = this.parseName(), n = this.parseArgumentDefs(), i = this.expectOptionalKeyword("repeatable");
2032
+ const t = this._lexer.token, r = this.parseDescription();
2033
+ this.expectKeyword("directive"), this.expectToken(a.AT);
2034
+ const i = this.parseName(), n = this.parseArgumentDefs(), s = this.expectOptionalKeyword("repeatable");
2025
2035
  this.expectKeyword("on");
2026
- const a = this.parseDirectiveLocations();
2027
- return this.node(e, {
2028
- kind: d.DIRECTIVE_DEFINITION,
2036
+ const o = this.parseDirectiveLocations();
2037
+ return this.node(t, {
2038
+ kind: u.DIRECTIVE_DEFINITION,
2029
2039
  description: r,
2030
- name: s,
2040
+ name: i,
2031
2041
  arguments: n,
2032
- repeatable: i,
2033
- locations: a
2042
+ repeatable: s,
2043
+ locations: o
2034
2044
  });
2035
2045
  }
2036
2046
  /**
@@ -2039,7 +2049,7 @@ class ut {
2039
2049
  * - DirectiveLocations | DirectiveLocation
2040
2050
  */
2041
2051
  parseDirectiveLocations() {
2042
- return this.delimitedMany(o.PIPE, this.parseDirectiveLocation);
2052
+ return this.delimitedMany(a.PIPE, this.parseDirectiveLocation);
2043
2053
  }
2044
2054
  /*
2045
2055
  * DirectiveLocation :
@@ -2069,10 +2079,10 @@ class ut {
2069
2079
  * `INPUT_FIELD_DEFINITION`
2070
2080
  */
2071
2081
  parseDirectiveLocation() {
2072
- const e = this._lexer.token, r = this.parseName();
2073
- if (Object.prototype.hasOwnProperty.call(V, r.value))
2082
+ const t = this._lexer.token, r = this.parseName();
2083
+ if (Object.prototype.hasOwnProperty.call(K, r.value))
2074
2084
  return r;
2075
- throw this.unexpected(e);
2085
+ throw this.unexpected(t);
2076
2086
  }
2077
2087
  // Core parsing utility functions
2078
2088
  /**
@@ -2080,9 +2090,9 @@ class ut {
2080
2090
  * location object, used to identify the place in the source that created a
2081
2091
  * given parsed object.
2082
2092
  */
2083
- node(e, r) {
2084
- return this._options.noLocation !== !0 && (r.loc = new $e(
2085
- e,
2093
+ node(t, r) {
2094
+ return this._options.noLocation !== !0 && (r.loc = new lr(
2095
+ t,
2086
2096
  this._lexer.lastToken,
2087
2097
  this._lexer.source
2088
2098
  )), r;
@@ -2090,62 +2100,62 @@ class ut {
2090
2100
  /**
2091
2101
  * Determines if the next token is of a given kind
2092
2102
  */
2093
- peek(e) {
2094
- return this._lexer.token.kind === e;
2103
+ peek(t) {
2104
+ return this._lexer.token.kind === t;
2095
2105
  }
2096
2106
  /**
2097
2107
  * If the next token is of the given kind, return that token after advancing the lexer.
2098
2108
  * Otherwise, do not change the parser state and throw an error.
2099
2109
  */
2100
- expectToken(e) {
2110
+ expectToken(t) {
2101
2111
  const r = this._lexer.token;
2102
- if (r.kind === e)
2112
+ if (r.kind === t)
2103
2113
  return this.advanceLexer(), r;
2104
- throw m(
2114
+ throw g(
2105
2115
  this._lexer.source,
2106
2116
  r.start,
2107
- `Expected ${Te(e)}, found ${C(r)}.`
2117
+ `Expected ${Re(t)}, found ${x(r)}.`
2108
2118
  );
2109
2119
  }
2110
2120
  /**
2111
2121
  * If the next token is of the given kind, return "true" after advancing the lexer.
2112
2122
  * Otherwise, do not change the parser state and return "false".
2113
2123
  */
2114
- expectOptionalToken(e) {
2115
- return this._lexer.token.kind === e ? (this.advanceLexer(), !0) : !1;
2124
+ expectOptionalToken(t) {
2125
+ return this._lexer.token.kind === t ? (this.advanceLexer(), !0) : !1;
2116
2126
  }
2117
2127
  /**
2118
2128
  * If the next token is a given keyword, advance the lexer.
2119
2129
  * Otherwise, do not change the parser state and throw an error.
2120
2130
  */
2121
- expectKeyword(e) {
2131
+ expectKeyword(t) {
2122
2132
  const r = this._lexer.token;
2123
- if (r.kind === o.NAME && r.value === e)
2133
+ if (r.kind === a.NAME && r.value === t)
2124
2134
  this.advanceLexer();
2125
2135
  else
2126
- throw m(
2136
+ throw g(
2127
2137
  this._lexer.source,
2128
2138
  r.start,
2129
- `Expected "${e}", found ${C(r)}.`
2139
+ `Expected "${t}", found ${x(r)}.`
2130
2140
  );
2131
2141
  }
2132
2142
  /**
2133
2143
  * If the next token is a given keyword, return "true" after advancing the lexer.
2134
2144
  * Otherwise, do not change the parser state and return "false".
2135
2145
  */
2136
- expectOptionalKeyword(e) {
2146
+ expectOptionalKeyword(t) {
2137
2147
  const r = this._lexer.token;
2138
- return r.kind === o.NAME && r.value === e ? (this.advanceLexer(), !0) : !1;
2148
+ return r.kind === a.NAME && r.value === t ? (this.advanceLexer(), !0) : !1;
2139
2149
  }
2140
2150
  /**
2141
2151
  * Helper function for creating an error when an unexpected lexed token is encountered.
2142
2152
  */
2143
- unexpected(e) {
2144
- const r = e ?? this._lexer.token;
2145
- return m(
2153
+ unexpected(t) {
2154
+ const r = t ?? this._lexer.token;
2155
+ return g(
2146
2156
  this._lexer.source,
2147
2157
  r.start,
2148
- `Unexpected ${C(r)}.`
2158
+ `Unexpected ${x(r)}.`
2149
2159
  );
2150
2160
  }
2151
2161
  /**
@@ -2153,10 +2163,10 @@ class ut {
2153
2163
  * This list begins with a lex token of openKind and ends with a lex token of closeKind.
2154
2164
  * Advances the parser to the next lex token after the closing token.
2155
2165
  */
2156
- any(e, r, s) {
2157
- this.expectToken(e);
2166
+ any(t, r, i) {
2167
+ this.expectToken(t);
2158
2168
  const n = [];
2159
- for (; !this.expectOptionalToken(s); )
2169
+ for (; !this.expectOptionalToken(i); )
2160
2170
  n.push(r.call(this));
2161
2171
  return n;
2162
2172
  }
@@ -2166,12 +2176,12 @@ class ut {
2166
2176
  * that begins with a lex token of openKind and ends with a lex token of closeKind.
2167
2177
  * Advances the parser to the next lex token after the closing token.
2168
2178
  */
2169
- optionalMany(e, r, s) {
2170
- if (this.expectOptionalToken(e)) {
2179
+ optionalMany(t, r, i) {
2180
+ if (this.expectOptionalToken(t)) {
2171
2181
  const n = [];
2172
2182
  do
2173
2183
  n.push(r.call(this));
2174
- while (!this.expectOptionalToken(s));
2184
+ while (!this.expectOptionalToken(i));
2175
2185
  return n;
2176
2186
  }
2177
2187
  return [];
@@ -2181,12 +2191,12 @@ class ut {
2181
2191
  * This list begins with a lex token of openKind and ends with a lex token of closeKind.
2182
2192
  * Advances the parser to the next lex token after the closing token.
2183
2193
  */
2184
- many(e, r, s) {
2185
- this.expectToken(e);
2194
+ many(t, r, i) {
2195
+ this.expectToken(t);
2186
2196
  const n = [];
2187
2197
  do
2188
2198
  n.push(r.call(this));
2189
- while (!this.expectOptionalToken(s));
2199
+ while (!this.expectOptionalToken(i));
2190
2200
  return n;
2191
2201
  }
2192
2202
  /**
@@ -2194,107 +2204,108 @@ class ut {
2194
2204
  * This list may begin with a lex token of delimiterKind followed by items separated by lex tokens of tokenKind.
2195
2205
  * Advances the parser to the next lex token after last item in the list.
2196
2206
  */
2197
- delimitedMany(e, r) {
2198
- this.expectOptionalToken(e);
2199
- const s = [];
2207
+ delimitedMany(t, r) {
2208
+ this.expectOptionalToken(t);
2209
+ const i = [];
2200
2210
  do
2201
- s.push(r.call(this));
2202
- while (this.expectOptionalToken(e));
2203
- return s;
2211
+ i.push(r.call(this));
2212
+ while (this.expectOptionalToken(t));
2213
+ return i;
2204
2214
  }
2205
2215
  advanceLexer() {
2206
- const { maxTokens: e } = this._options, r = this._lexer.advance();
2207
- if (r.kind !== o.EOF && (++this._tokenCounter, e !== void 0 && this._tokenCounter > e))
2208
- throw m(
2216
+ const { maxTokens: t } = this._options, r = this._lexer.advance();
2217
+ if (r.kind !== a.EOF && (++this._tokenCounter, t !== void 0 && this._tokenCounter > t))
2218
+ throw g(
2209
2219
  this._lexer.source,
2210
2220
  r.start,
2211
- `Document contains more that ${e} tokens. Parsing aborted.`
2221
+ `Document contains more that ${t} tokens. Parsing aborted.`
2212
2222
  );
2213
2223
  }
2214
2224
  }
2215
- function C(t) {
2216
- const e = t.value;
2217
- return Te(t.kind) + (e != null ? ` "${e}"` : "");
2225
+ function x(e) {
2226
+ const t = e.value;
2227
+ return Re(e.kind) + (t != null ? ` "${t}"` : "");
2218
2228
  }
2219
- function Te(t) {
2220
- return qe(t) ? `"${t}"` : t;
2229
+ function Re(e) {
2230
+ return Ar(e) ? `"${e}"` : e;
2221
2231
  }
2222
- var P = /* @__PURE__ */ new Map(), G = /* @__PURE__ */ new Map(), Oe = !0, F = !1;
2223
- function Ne(t) {
2224
- return t.replace(/[\s,]+/g, " ").trim();
2232
+ var b = /* @__PURE__ */ new Map(), j = /* @__PURE__ */ new Map(), ve = !0, y = !1;
2233
+ function Le(e) {
2234
+ return e.replace(/[\s,]+/g, " ").trim();
2225
2235
  }
2226
- function lt(t) {
2227
- return Ne(t.source.body.substring(t.start, t.end));
2236
+ function wr(e) {
2237
+ return Le(e.source.body.substring(e.start, e.end));
2228
2238
  }
2229
- function ht(t) {
2230
- var e = /* @__PURE__ */ new Set(), r = [];
2231
- return t.definitions.forEach(function(s) {
2232
- if (s.kind === "FragmentDefinition") {
2233
- var n = s.name.value, i = lt(s.loc), a = G.get(n);
2234
- a && !a.has(i) ? Oe && console.warn("Warning: fragment with name " + n + ` already exists.
2239
+ function Br(e) {
2240
+ var t = /* @__PURE__ */ new Set(), r = [];
2241
+ return e.definitions.forEach(function(i) {
2242
+ if (i.kind === "FragmentDefinition") {
2243
+ var n = i.name.value, s = wr(i.loc), o = j.get(n);
2244
+ o && !o.has(s) ? ve && console.warn("Warning: fragment with name " + n + ` already exists.
2235
2245
  graphql-tag enforces all fragment names across your application to be unique; read more about
2236
- this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`) : a || G.set(n, a = /* @__PURE__ */ new Set()), a.add(i), e.has(i) || (e.add(i), r.push(s));
2246
+ this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`) : o || j.set(n, o = /* @__PURE__ */ new Set()), o.add(s), t.has(s) || (t.add(s), r.push(i));
2237
2247
  } else
2238
- r.push(s);
2239
- }), L(L({}, t), { definitions: r });
2240
- }
2241
- function pt(t) {
2242
- var e = new Set(t.definitions);
2243
- e.forEach(function(s) {
2244
- s.loc && delete s.loc, Object.keys(s).forEach(function(n) {
2245
- var i = s[n];
2246
- i && typeof i == "object" && e.add(i);
2248
+ r.push(i);
2249
+ }), F(F({}, e), { definitions: r });
2250
+ }
2251
+ function Gr(e) {
2252
+ var t = new Set(e.definitions);
2253
+ t.forEach(function(i) {
2254
+ i.loc && delete i.loc, Object.keys(i).forEach(function(n) {
2255
+ var s = i[n];
2256
+ s && typeof s == "object" && t.add(s);
2247
2257
  });
2248
2258
  });
2249
- var r = t.loc;
2250
- return r && (delete r.startToken, delete r.endToken), t;
2251
- }
2252
- function ft(t) {
2253
- var e = Ne(t);
2254
- if (!P.has(e)) {
2255
- var r = dt(t, {
2256
- experimentalFragmentVariables: F,
2257
- allowLegacyFragmentVariables: F
2259
+ var r = e.loc;
2260
+ return r && (delete r.startToken, delete r.endToken), e;
2261
+ }
2262
+ function $r(e) {
2263
+ var t = Le(e);
2264
+ if (!b.has(t)) {
2265
+ var r = Mr(e, {
2266
+ experimentalFragmentVariables: y,
2267
+ allowLegacyFragmentVariables: y
2258
2268
  });
2259
2269
  if (!r || r.kind !== "Document")
2260
2270
  throw new Error("Not a valid GraphQL document.");
2261
- P.set(e, pt(ht(r)));
2271
+ b.set(t, Gr(Br(r)));
2262
2272
  }
2263
- return P.get(e);
2273
+ return b.get(t);
2264
2274
  }
2265
- function I(t) {
2266
- for (var e = [], r = 1; r < arguments.length; r++)
2267
- e[r - 1] = arguments[r];
2268
- typeof t == "string" && (t = [t]);
2269
- var s = t[0];
2270
- return e.forEach(function(n, i) {
2271
- n && n.kind === "Document" ? s += n.loc.source.body : s += n, s += t[i + 1];
2272
- }), ft(s);
2275
+ function E(e) {
2276
+ for (var t = [], r = 1; r < arguments.length; r++)
2277
+ t[r - 1] = arguments[r];
2278
+ typeof e == "string" && (e = [e]);
2279
+ var i = e[0];
2280
+ return t.forEach(function(n, s) {
2281
+ n && n.kind === "Document" ? i += n.loc.source.body : i += n, i += e[s + 1];
2282
+ }), $r(i);
2273
2283
  }
2274
- function mt() {
2275
- P.clear(), G.clear();
2284
+ function Hr() {
2285
+ b.clear(), j.clear();
2276
2286
  }
2277
- function gt() {
2278
- Oe = !1;
2287
+ function zr() {
2288
+ ve = !1;
2279
2289
  }
2280
- function It() {
2281
- F = !0;
2290
+ function Yr() {
2291
+ y = !0;
2282
2292
  }
2283
- function Et() {
2284
- F = !1;
2293
+ function qr() {
2294
+ y = !1;
2285
2295
  }
2286
- var S = {
2287
- gql: I,
2288
- resetCaches: mt,
2289
- disableFragmentWarnings: gt,
2290
- enableExperimentalFragmentVariables: It,
2291
- disableExperimentalFragmentVariables: Et
2296
+ var P = {
2297
+ gql: E,
2298
+ resetCaches: Hr,
2299
+ disableFragmentWarnings: zr,
2300
+ enableExperimentalFragmentVariables: Yr,
2301
+ disableExperimentalFragmentVariables: qr
2292
2302
  };
2293
- (function(t) {
2294
- t.gql = S.gql, t.resetCaches = S.resetCaches, t.disableFragmentWarnings = S.disableFragmentWarnings, t.enableExperimentalFragmentVariables = S.enableExperimentalFragmentVariables, t.disableExperimentalFragmentVariables = S.disableExperimentalFragmentVariables;
2295
- })(I || (I = {}));
2296
- I.default = I;
2297
- const yt = I`
2303
+ (function(e) {
2304
+ e.gql = P.gql, e.resetCaches = P.resetCaches, e.disableFragmentWarnings = P.disableFragmentWarnings, e.enableExperimentalFragmentVariables = P.enableExperimentalFragmentVariables, e.disableExperimentalFragmentVariables = P.disableExperimentalFragmentVariables;
2305
+ })(E || (E = {}));
2306
+ E.default = E;
2307
+ var Pe = /* @__PURE__ */ ((e) => (e.Private = "PRIVATE", e.Public = "PUBLIC", e))(Pe || {}), 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 || {}), Ce = /* @__PURE__ */ ((e) => (e.Fixed = "FIXED", e.Percentage = "PERCENTAGE", e))(Ce || {}), Se = /* @__PURE__ */ ((e) => (e.Progressive = "PROGRESSIVE", e.Retroactive = "RETROACTIVE", e))(Se || {}), xe = /* @__PURE__ */ ((e) => (e.AllEvents = "ALL_EVENTS", e.PerEvent = "PER_EVENT", e))(xe || {}), be = /* @__PURE__ */ ((e) => (e.Collect = "COLLECT", e.Sale = "SALE", e.Scan = "SCAN", e))(be || {}), Fe = /* @__PURE__ */ ((e) => (e.Aed = "AED", e.Afn = "AFN", e.All = "ALL", e.Amd = "AMD", e.Ars = "ARS", e.Aud = "AUD", e.Azn = "AZN", e.Bam = "BAM", e.Bdt = "BDT", e.Bgn = "BGN", e.Bhd = "BHD", e.Bif = "BIF", e.Bnd = "BND", e.Bob = "BOB", e.Brl = "BRL", e.Bwp = "BWP", e.Byn = "BYN", e.Bzd = "BZD", e.Cad = "CAD", e.Cdf = "CDF", e.Chf = "CHF", e.Clp = "CLP", e.Cny = "CNY", e.Cop = "COP", e.Crc = "CRC", e.Cve = "CVE", e.Czk = "CZK", e.Djf = "DJF", e.Dkk = "DKK", e.Dop = "DOP", e.Dzd = "DZD", e.Eek = "EEK", e.Egp = "EGP", e.Ern = "ERN", e.Etb = "ETB", e.Eur = "EUR", e.Gbp = "GBP", e.Gel = "GEL", e.Ghs = "GHS", e.Gnf = "GNF", e.Gtq = "GTQ", e.Hkd = "HKD", e.Hnl = "HNL", e.Hrk = "HRK", e.Huf = "HUF", e.Idr = "IDR", e.Ils = "ILS", e.Inr = "INR", e.Iqd = "IQD", e.Irr = "IRR", e.Isk = "ISK", e.Jmd = "JMD", e.Jod = "JOD", e.Jpy = "JPY", e.Kes = "KES", e.Khr = "KHR", e.Kmf = "KMF", e.Krw = "KRW", e.Kwd = "KWD", e.Kzt = "KZT", e.Lbp = "LBP", e.Lkr = "LKR", e.Ltl = "LTL", e.Lvl = "LVL", e.Lyd = "LYD", e.Mad = "MAD", e.Mdl = "MDL", e.Mga = "MGA", e.Mkd = "MKD", e.Mmk = "MMK", e.Mop = "MOP", e.Mur = "MUR", e.Mxn = "MXN", e.Myr = "MYR", e.Mzn = "MZN", e.Nad = "NAD", e.Ngn = "NGN", e.Nio = "NIO", e.Nok = "NOK", e.Npr = "NPR", e.Nzd = "NZD", e.Omr = "OMR", e.Pab = "PAB", e.Pen = "PEN", e.Php = "PHP", e.Pkr = "PKR", e.Pln = "PLN", e.Pyg = "PYG", e.Qar = "QAR", e.Ron = "RON", e.Rsd = "RSD", e.Rub = "RUB", e.Rwf = "RWF", e.Sar = "SAR", e.Sdg = "SDG", e.Sek = "SEK", e.Sgd = "SGD", e.Sos = "SOS", e.Syp = "SYP", e.Thb = "THB", e.Tnd = "TND", e.Top = "TOP", e.Try = "TRY", e.Ttd = "TTD", e.Twd = "TWD", e.Tzs = "TZS", e.Uah = "UAH", e.Ugx = "UGX", e.Usd = "USD", e.Uyu = "UYU", e.Uzs = "UZS", e.Vef = "VEF", e.Vnd = "VND", e.Xaf = "XAF", e.Xof = "XOF", e.Yer = "YER", e.Zar = "ZAR", e.Zmk = "ZMK", e.Zwl = "ZWL", e))(Fe || {}), ye = /* @__PURE__ */ ((e) => (e.Age = "AGE", e.Email = "EMAIL", e.FirstName = "FIRST_NAME", e.Gender = "GENDER", e.GooglePlace = "GOOGLE_PLACE", e.LastName = "LAST_NAME", e.Residence = "RESIDENCE", e))(ye || {}), Ue = /* @__PURE__ */ ((e) => (e.Checkbox = "CHECKBOX", e.Date = "DATE", e.Dropdown = "DROPDOWN", e.Email = "EMAIL", e.Numeric = "NUMERIC", e.PhoneNumber = "PHONE_NUMBER", e.RadioButton = "RADIO_BUTTON", e.Text = "TEXT", e.TextArea = "TEXT_AREA", e.Time = "TIME", e))(Ue || {}), Me = /* @__PURE__ */ ((e) => (e.Banner = "Banner", e.Icon = "Icon", e))(Me || {}), Ve = /* @__PURE__ */ ((e) => (e.Active = "ACTIVE", e.Inactive = "INACTIVE", e.Paused = "PAUSED", e.SoldOut = "SOLD_OUT", e))(Ve || {}), we = /* @__PURE__ */ ((e) => (e.Txt = "TXT", e.Xlsx = "XLSX", e))(we || {}), Be = /* @__PURE__ */ ((e) => (e.Completed = "COMPLETED", e.Failed = "FAILED", e.Initial = "INITIAL", e.Processing = "PROCESSING", e))(Be || {}), Ge = /* @__PURE__ */ ((e) => (e.Collector = "COLLECTOR", e.Event = "EVENT", e.Organization = "ORGANIZATION", e.Payout = "PAYOUT", e.Profit = "PROFIT", e.Promoter = "PROMOTER", e.Seller = "SELLER", e))(Ge || {}), $e = /* @__PURE__ */ ((e) => (e.Admin = "ADMIN", e.CashCollector = "CASH_COLLECTOR", e.Collector = "COLLECTOR", e.EventManager = "EVENT_MANAGER", e.HostingManager = "HOSTING_MANAGER", e.LocationManager = "LOCATION_MANAGER", e.OfflineVendor = "OFFLINE_VENDOR", e.OnlineVendor = "ONLINE_VENDOR", e.OrganizationManager = "ORGANIZATION_MANAGER", e.Scanner = "SCANNER", e))($e || {}), He = /* @__PURE__ */ ((e) => (e.Day = "DAY", e.Hour = "HOUR", e.Minute = "MINUTE", e.Month = "MONTH", e.Quarter = "QUARTER", e.Week = "WEEK", e.Year = "YEAR", e))(He || {}), ze = /* @__PURE__ */ ((e) => (e.Expired = "EXPIRED", e.Valid = "VALID", e))(ze || {}), Ye = /* @__PURE__ */ ((e) => (e.Addons = "ADDONS", e.AppCustomerHistory = "APP_CUSTOMER_HISTORY", e.Arrivals = "ARRIVALS", e.CalculateCashPayout = "CALCULATE_CASH_PAYOUT", e.Cash = "CASH", e.CashHistory = "CASH_HISTORY", e.Collector = "COLLECTOR", e.Commission = "COMMISSION", e.CountryStatistics = "COUNTRY_STATISTICS", e.CustomField = "CUSTOM_FIELD", e.DepositPrice = "DEPOSIT_PRICE", e.DetailStatistics = "DETAIL_STATISTICS", e.DiscountPrice = "DISCOUNT_PRICE", e.DoorSale = "DOOR_SALE", e.DynamicEvents = "DYNAMIC_EVENTS", e.EmailMarketing = "EMAIL_MARKETING", e.EventCapacity = "EVENT_CAPACITY", e.EventDeliveryOptions = "EVENT_DELIVERY_OPTIONS", e.EventPercentage = "EVENT_PERCENTAGE", e.EventSeatsIntegration = "EVENT_SEATS_INTEGRATION", e.GroupTickets = "GROUP_TICKETS", e.Guest = "GUEST", e.Hosting = "HOSTING", e.Location = "LOCATION", e.Marketing = "MARKETING", e.MobileRefund = "MOBILE_REFUND", e.OrderDetail = "ORDER_DETAIL", e.OrderPending = "ORDER_PENDING", e.OrderRefund = "ORDER_REFUND", e.Override = "OVERRIDE", e.Package = "PACKAGE", e.PaidInAdvance = "PAID_IN_ADVANCE", e.ProductAdditionalInfo = "PRODUCT_ADDITIONAL_INFO", e.ProductPurchasePrice = "PRODUCT_PURCHASE_PRICE", e.Promoter = "PROMOTER", e.Reporting = "REPORTING", e.Role = "ROLE", e.Shop = "SHOP", e.SingleTickets = "SINGLE_TICKETS", e.TapToPay = "TAP_TO_PAY", e.Team = "TEAM", e.TicketLimit = "TICKET_LIMIT", e.TicketSeller = "TICKET_SELLER", e.Token = "TOKEN", e.ViewStatistics = "VIEW_STATISTICS", e))(Ye || {}), qe = /* @__PURE__ */ ((e) => (e.AddOn = "ADD_ON", e.DeliveryOption = "DELIVERY_OPTION", e.EntranceTicket = "ENTRANCE_TICKET", e))(qe || {}), Ke = /* @__PURE__ */ ((e) => (e.Dashboard = "DASHBOARD", e.Offline = "OFFLINE", e.Online = "ONLINE", e.Ticketswap = "TICKETSWAP", e))(Ke || {}), je = /* @__PURE__ */ ((e) => (e.Canceled = "CANCELED", e.Finalized = "FINALIZED", e.PendingFinalization = "PENDING_FINALIZATION", e))(je || {}), We = /* @__PURE__ */ ((e) => (e.Default = "DEFAULT", e.Door = "DOOR", e.Email = "EMAIL", e.Guest = "GUEST", e.Promoter = "PROMOTER", e.Swap = "SWAP", e.Tracker = "TRACKER", e))(We || {}), Xe = /* @__PURE__ */ ((e) => (e.CustomField = "CUSTOM_FIELD", e.Event = "EVENT", e.Guest = "GUEST", e.Hosting = "HOSTING", e.Location = "LOCATION", e.Marketing = "MARKETING", e.Module = "MODULE", e.Organization = "ORGANIZATION", e.Permission = "PERMISSION", e.Product = "PRODUCT", e.Role = "ROLE", e.Shop = "SHOP", e.Team = "TEAM", e.User = "USER", e))(Xe || {}), U = /* @__PURE__ */ ((e) => (e.AdditionalEvent = "ADDITIONAL_EVENT", e.Addon = "ADDON", e.Regular = "REGULAR", e))(U || {}), Qe = /* @__PURE__ */ ((e) => (e.Active = "ACTIVE", e.Concept = "CONCEPT", e.Paused = "PAUSED", e.SoldOut = "SOLD_OUT", e))(Qe || {}), Je = /* @__PURE__ */ ((e) => (e.Active = "ACTIVE", e.Inactive = "INACTIVE", e))(Je || {}), Ze = /* @__PURE__ */ ((e) => (e.Fixed = "FIXED", e.Percentage = "PERCENTAGE", e))(Ze || {}), et = /* @__PURE__ */ ((e) => (e.Collect = "COLLECT", e.Initial = "INITIAL", e))(et || {}), tt = /* @__PURE__ */ ((e) => (e.Canceled = "CANCELED", e.ChargedBack = "CHARGED_BACK", e.Denied = "DENIED", e.Expired = "EXPIRED", e.Failure = "FAILURE", e.Paid = "PAID", e.Refunded = "REFUNDED", e.Rejected = "REJECTED", e))(tt || {}), rt = /* @__PURE__ */ ((e) => (e.Cash = "CASH", e.Digital = "DIGITAL", e.Other = "OTHER", e.TapToPay = "TAP_TO_PAY", e))(rt || {}), nt = /* @__PURE__ */ ((e) => (e.AccessDashboard = "ACCESS_DASHBOARD", e.AccessSale = "ACCESS_SALE", e.AccessScan = "ACCESS_SCAN", e.AdminModuleUpdate = "ADMIN_MODULE_UPDATE", e.AdminModuleView = "ADMIN_MODULE_VIEW", e.AdminOrganizationCreate = "ADMIN_ORGANIZATION_CREATE", e.AdminOrganizationDelete = "ADMIN_ORGANIZATION_DELETE", e.AdminOrganizationView = "ADMIN_ORGANIZATION_VIEW", e.AdminPermissionUpdate = "ADMIN_PERMISSION_UPDATE", e.AdminPermissionView = "ADMIN_PERMISSION_VIEW", e.AdminSuper = "ADMIN_SUPER", e.AdminUserCreate = "ADMIN_USER_CREATE", e.AdminUserDelete = "ADMIN_USER_DELETE", e.AdminUserView = "ADMIN_USER_VIEW", e.CashCollectorStatistics = "CASH_COLLECTOR_STATISTICS", e.CashCollectorView = "CASH_COLLECTOR_VIEW", e.CashDepositCreate = "CASH_DEPOSIT_CREATE", e.CashDepositView = "CASH_DEPOSIT_VIEW", e.CashOnHandView = "CASH_ON_HAND_VIEW", e.CollectorManage = "COLLECTOR_MANAGE", e.CollectorStatistics = "COLLECTOR_STATISTICS", e.CollectorView = "COLLECTOR_VIEW", e.CommissionManage = "COMMISSION_MANAGE", e.CommissionPayoutCreate = "COMMISSION_PAYOUT_CREATE", e.CommissionPayoutView = "COMMISSION_PAYOUT_VIEW", e.CommissionStatistics = "COMMISSION_STATISTICS", e.CommissionView = "COMMISSION_VIEW", e.CustomFieldManage = "CUSTOM_FIELD_MANAGE", e.CustomFieldView = "CUSTOM_FIELD_VIEW", e.EmailRuleManage = "EMAIL_RULE_MANAGE", e.EmailRuleStatistics = "EMAIL_RULE_STATISTICS", e.EmailRuleView = "EMAIL_RULE_VIEW", e.EmailRunStatistics = "EMAIL_RUN_STATISTICS", e.EmailRunView = "EMAIL_RUN_VIEW", e.EventManage = "EVENT_MANAGE", e.EventStatistics = "EVENT_STATISTICS", e.EventView = "EVENT_VIEW", e.GuestManage = "GUEST_MANAGE", e.GuestProductManage = "GUEST_PRODUCT_MANAGE", e.GuestProductStatistics = "GUEST_PRODUCT_STATISTICS", e.GuestProductView = "GUEST_PRODUCT_VIEW", e.GuestView = "GUEST_VIEW", e.HostingManage = "HOSTING_MANAGE", e.HostingStatistics = "HOSTING_STATISTICS", e.HostingView = "HOSTING_VIEW", e.LocationManage = "LOCATION_MANAGE", e.LocationStatistics = "LOCATION_STATISTICS", e.LocationView = "LOCATION_VIEW", e.NoteManage = "NOTE_MANAGE", e.NoteView = "NOTE_VIEW", e.OrderCreateDoor = "ORDER_CREATE_DOOR", e.OrderCreateSeller = "ORDER_CREATE_SELLER", e.OrderManage = "ORDER_MANAGE", e.OrderView = "ORDER_VIEW", e.OrganizationManage = "ORGANIZATION_MANAGE", e.OrganizationStatistics = "ORGANIZATION_STATISTICS", e.OrganizationSuper = "ORGANIZATION_SUPER", e.OverrideManage = "OVERRIDE_MANAGE", e.PackageManage = "PACKAGE_MANAGE", e.PackageStatistics = "PACKAGE_STATISTICS", e.PackageView = "PACKAGE_VIEW", e.ProductManage = "PRODUCT_MANAGE", e.ProductStatistics = "PRODUCT_STATISTICS", e.ProductView = "PRODUCT_VIEW", e.PromoterManage = "PROMOTER_MANAGE", e.PromoterStatistics = "PROMOTER_STATISTICS", e.PromoterView = "PROMOTER_VIEW", e.ReportingManage = "REPORTING_MANAGE", e.ReportingView = "REPORTING_VIEW", e.RoleAssign = "ROLE_ASSIGN", e.RoleManage = "ROLE_MANAGE", e.RoleView = "ROLE_VIEW", e.SellerManage = "SELLER_MANAGE", e.SellerStatistics = "SELLER_STATISTICS", e.SellerView = "SELLER_VIEW", e.ShopManage = "SHOP_MANAGE", e.ShopView = "SHOP_VIEW", e.TeamManage = "TEAM_MANAGE", e.TeamStatistics = "TEAM_STATISTICS", e.TeamUserInvite = "TEAM_USER_INVITE", e.TeamUserRemove = "TEAM_USER_REMOVE", e.TeamView = "TEAM_VIEW", e.TemplateManage = "TEMPLATE_MANAGE", e.TemplateView = "TEMPLATE_VIEW", e.TicketLimitManage = "TICKET_LIMIT_MANAGE", e.TicketLimitView = "TICKET_LIMIT_VIEW", e.TokenManage = "TOKEN_MANAGE", e.TokenView = "TOKEN_VIEW", e.TrackerManage = "TRACKER_MANAGE", e.TrackerStatistics = "TRACKER_STATISTICS", e.TrackerView = "TRACKER_VIEW", e.UserInviteManage = "USER_INVITE_MANAGE", e.UserInviteView = "USER_INVITE_VIEW", e.UserManage = "USER_MANAGE", e.UserView = "USER_VIEW", e))(nt || {}), it = /* @__PURE__ */ ((e) => (e.AllReserved = "ALL_RESERVED", e.Available = "AVAILABLE", e.SoldOut = "SOLD_OUT", e))(it || {}), st = /* @__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))(st || {}), at = /* @__PURE__ */ ((e) => (e.Other = "OTHER", e.Ticketapp = "TICKETAPP", e))(at || {}), ot = /* @__PURE__ */ ((e) => (e.Email = "EMAIL", e.Phone = "PHONE", e))(ot || {}), dt = /* @__PURE__ */ ((e) => (e.Cancelled = "CANCELLED", e.Completed = "COMPLETED", e.Failed = "FAILED", e.Pending = "PENDING", e.Processing = "PROCESSING", e))(dt || {}), ct = /* @__PURE__ */ ((e) => (e.Csv = "CSV", e.Txt = "TXT", e))(ct || {}), ut = /* @__PURE__ */ ((e) => (e.Active = "ACTIVE", e.Inactive = "INACTIVE", e))(ut || {}), lt = /* @__PURE__ */ ((e) => (e.NonPaid = "NON_PAID", e.Paid = "PAID", e))(lt || {}), ht = /* @__PURE__ */ ((e) => (e.CashCollector = "CASH_COLLECTOR", e.Collector = "COLLECTOR", e.CommissionPayouts = "COMMISSION_PAYOUTS", e.GuestManager = "GUEST_MANAGER", e.OfflineVendor = "OFFLINE_VENDOR", e.OnlineVendor = "ONLINE_VENDOR", e))(ht || {}), Et = /* @__PURE__ */ ((e) => (e.Offline = "OFFLINE", e.Online = "ONLINE", e))(Et || {}), It = /* @__PURE__ */ ((e) => (e.Door = "DOOR", e.Promoter = "PROMOTER", e.Seller = "SELLER", e.Web = "WEB", e))(It || {}), pt = /* @__PURE__ */ ((e) => (e.AlreadyScanned = "ALREADY_SCANNED", e.AlreadyScannedByGroup = "ALREADY_SCANNED_BY_GROUP", e.InvalidDate = "INVALID_DATE", e.MaxScanAmountReached = "MAX_SCAN_AMOUNT_REACHED", e.NotFinalized = "NOT_FINALIZED", e.NotFoundForEvent = "NOT_FOUND_FOR_EVENT", e.TicketSwapped = "TICKET_SWAPPED", e))(pt || {}), gt = /* @__PURE__ */ ((e) => (e.Default = "DEFAULT", e.Transparent = "TRANSPARENT", e))(gt || {}), ft = /* @__PURE__ */ ((e) => (e.Calendar = "CALENDAR", e.Large = "LARGE", e.Small = "SMALL", e))(ft || {}), At = /* @__PURE__ */ ((e) => (e.Asc = "ASC", e.Desc = "DESC", e))(At || {}), mt = /* @__PURE__ */ ((e) => (e.Canceled = "CANCELED", e.CashTransaction = "CASH_TRANSACTION", e.CashTransactionDeposit = "CASH_TRANSACTION_DEPOSIT", e.Collect = "COLLECT", e.Commission = "COMMISSION", e.CommissionPayout = "COMMISSION_PAYOUT", e.Refunded = "REFUNDED", e.Sale = "SALE", e.Scan = "SCAN", e))(mt || {}), Ot = /* @__PURE__ */ ((e) => (e.Past = "PAST", e.Upcoming = "UPCOMING", e))(Ot || {}), Tt = /* @__PURE__ */ ((e) => (e.Collector = "COLLECTOR", e.Offline = "OFFLINE", e.Online = "ONLINE", e))(Tt || {}), Nt = /* @__PURE__ */ ((e) => (e.Active = "ACTIVE", e.Expired = "EXPIRED", e.Inactive = "INACTIVE", e))(Nt || {}), Dt = /* @__PURE__ */ ((e) => (e.Team = "TEAM", e.User = "USER", e))(Dt || {}), _t = /* @__PURE__ */ ((e) => (e.Event = "EVENT", e.Hosting = "HOSTING", e.Location = "LOCATION", e.Package = "PACKAGE", e))(_t || {}), Rt = /* @__PURE__ */ ((e) => (e.FullyPickedUp = "FULLY_PICKED_UP", e.NotPicketUp = "NOT_PICKET_UP", e.PartialPicketUp = "PARTIAL_PICKET_UP", e))(Rt || {}), vt = /* @__PURE__ */ ((e) => (e.Email = "EMAIL", e.Facebook = "FACEBOOK", e.Instagram = "INSTAGRAM", e.Qr = "QR", e.Sms = "SMS", e.Snapchat = "SNAPCHAT", e.Tiktok = "TIKTOK", e.Twitter = "TWITTER", e.Website = "WEBSITE", e))(vt || {}), Lt = /* @__PURE__ */ ((e) => (e.Active = "ACTIVE", e.Inactive = "INACTIVE", e))(Lt || {}), Pt = /* @__PURE__ */ ((e) => (e.Default = "DEFAULT", e.DiscountedPrices = "DISCOUNTED_PRICES", e.DiscountedProducts = "DISCOUNTED_PRODUCTS", e))(Pt || {}), kt = /* @__PURE__ */ ((e) => (e.Active = "ACTIVE", e.Inactive = "INACTIVE", e.Invited = "INVITED", e))(kt || {});
2308
+ const Ct = E`
2298
2309
  query findActiveOrderById($id: String) {
2299
2310
  findOrder(id: $id) {
2300
2311
  id
@@ -2368,7 +2379,7 @@ const yt = I`
2368
2379
  }
2369
2380
  }
2370
2381
  }
2371
- `, Tt = I`
2382
+ `, St = E`
2372
2383
  mutation addToOrder($orderId: ID!, $productId: ID!, $shopId: ID!, $additionalData: AdditionalDataInput, $trackerId: ID, $amount: Int) {
2373
2384
  reserveProduct(
2374
2385
  input: {orderId: $orderId, productId: $productId, additionalData: $additionalData, trackerId: $trackerId, shopId: $shopId, amountToIncrease: $amount}
@@ -2378,7 +2389,7 @@ const yt = I`
2378
2389
  amountReserved
2379
2390
  }
2380
2391
  }
2381
- `, Ot = I`
2392
+ `, xt = E`
2382
2393
  mutation removeFromOrder($orderId: ID!, $productId: ID!, $additionalData: AdditionalDataInput, $amount: Int) {
2383
2394
  releaseProduct(
2384
2395
  input: {orderId: $orderId, productId: $productId, additionalData: $additionalData, amountToRelease: $amount}
@@ -2387,7 +2398,7 @@ const yt = I`
2387
2398
  amountReleased
2388
2399
  }
2389
2400
  }
2390
- `, Nt = I`
2401
+ `, bt = E`
2391
2402
  mutation configurePackage($orderId: ID!, $packageId: ID!, $amount: Int!, $items: [ReservedItem!]!, $shopId: ID!, $trackerId: ID) {
2392
2403
  configurePackage(
2393
2404
  input: {orderId: $orderId, shopId: $shopId, trackerId: $trackerId, packageId: $packageId, amount: $amount, items: $items}
@@ -2397,21 +2408,21 @@ const yt = I`
2397
2408
  amountReserved
2398
2409
  }
2399
2410
  }
2400
- `, xt = I`
2411
+ `, Ft = E`
2401
2412
  mutation configureOrderDeliveryOption($orderId: ID!, $productId: ID) {
2402
2413
  configureDeliveryOption(input: {orderId: $orderId, productId: $productId})
2403
2414
  }
2404
- `, vt = I`
2415
+ `, yt = E`
2405
2416
  mutation createOrderCustomer($orderId: ID!, $countryCode: String, $customer: CreateCustomerInput!) {
2406
2417
  createOrderCustomer(
2407
2418
  input: {id: $orderId, countryCode: $countryCode, customer: $customer}
2408
2419
  )
2409
2420
  }
2410
- `, At = I`
2421
+ `, Ut = E`
2411
2422
  mutation deleteOrder($orderId: ID!) {
2412
2423
  cancelOrder(id: $orderId)
2413
2424
  }
2414
- `, Dt = I`
2425
+ `, Mt = E`
2415
2426
  query EventOverviewPage($organizationId: ID!, $locationIds: [String!], $hostingIds: [String!], $trackerId: String, $showDoorTickets: Boolean) {
2416
2427
  findAllPublicEventByOrganizationId(
2417
2428
  id: $organizationId
@@ -2444,7 +2455,7 @@ const yt = I`
2444
2455
  }
2445
2456
  }
2446
2457
  }
2447
- `, kt = I`
2458
+ `, Vt = E`
2448
2459
  query findProductsByEventId($eventId: ID!, $promoCode: String, $trackerId: String, $productTypes: [ProductType!]) {
2449
2460
  findPublicProductsByEventId(
2450
2461
  eventId: $eventId
@@ -2478,7 +2489,227 @@ const yt = I`
2478
2489
  showEndSalesAtTag
2479
2490
  }
2480
2491
  }
2481
- `, St = I`
2492
+ `, wt = E`
2493
+ query findAllPackages($page: PageInput, $tab: PackageTabType, $statuses: [PackageStatus!]) {
2494
+ findAllPackages(page: $page, tab: $tab, statuses: $statuses) {
2495
+ data {
2496
+ id
2497
+ slug
2498
+ status
2499
+ name
2500
+ description
2501
+ shortTitle
2502
+ shortDescription
2503
+ startAvailabilityAt
2504
+ endAvailabilityAt
2505
+ maxAmountOfPersonsPerOrder
2506
+ icon
2507
+ banner
2508
+ currency
2509
+ amountOfEvents
2510
+ amountOfAddons
2511
+ prices {
2512
+ price
2513
+ deposit
2514
+ discount
2515
+ serviceFee
2516
+ }
2517
+ allowedPaymentTypes
2518
+ }
2519
+ count
2520
+ }
2521
+ }
2522
+ `, Bt = E`
2523
+ query findAllPackageItems($packageId: ID!, $types: [PackageItemType!]) {
2524
+ findAllPackageItems(packageId: $packageId, types: $types) {
2525
+ data {
2526
+ id
2527
+ name
2528
+ description
2529
+ type
2530
+ price
2531
+ depositPrice
2532
+ discountPrice
2533
+ serviceFee
2534
+ banner
2535
+ package {
2536
+ id
2537
+ name
2538
+ }
2539
+ activeEvents {
2540
+ id
2541
+ name
2542
+ startAt
2543
+ endAt
2544
+ timezone
2545
+ icon
2546
+ banner
2547
+ location {
2548
+ id
2549
+ name
2550
+ address
2551
+ }
2552
+ }
2553
+ }
2554
+ count
2555
+ }
2556
+ }
2557
+ `, Gt = E`
2558
+ mutation setPackageItemToOrder($sessionId: ID!, $amount: Int!, $items: [SetPackageItem!]!) {
2559
+ setPackageItemToOrder(
2560
+ input: {sessionId: $sessionId, amount: $amount, items: $items}
2561
+ ) {
2562
+ id
2563
+ currency
2564
+ items {
2565
+ id
2566
+ price
2567
+ depositPrice
2568
+ originalPrice
2569
+ serviceFee
2570
+ amount
2571
+ expiredAt
2572
+ event {
2573
+ id
2574
+ name
2575
+ startAt
2576
+ endAt
2577
+ timezone
2578
+ icon
2579
+ banner
2580
+ location {
2581
+ id
2582
+ name
2583
+ address
2584
+ }
2585
+ }
2586
+ product {
2587
+ id
2588
+ name
2589
+ icon
2590
+ description
2591
+ type
2592
+ }
2593
+ packageItem {
2594
+ id
2595
+ name
2596
+ type
2597
+ package {
2598
+ id
2599
+ name
2600
+ }
2601
+ }
2602
+ seats {
2603
+ id
2604
+ label
2605
+ }
2606
+ }
2607
+ }
2608
+ }
2609
+ `, $t = E`
2610
+ mutation setAdditionalPackageItemToOrder($sessionId: ID!, $packageItemId: ID!, $eventId: ID!, $amount: Int!) {
2611
+ setAdditionalPackageItemToOrder(
2612
+ input: {sessionId: $sessionId, packageItemId: $packageItemId, eventId: $eventId, amount: $amount}
2613
+ ) {
2614
+ id
2615
+ currency
2616
+ items {
2617
+ id
2618
+ price
2619
+ depositPrice
2620
+ originalPrice
2621
+ serviceFee
2622
+ amount
2623
+ expiredAt
2624
+ event {
2625
+ id
2626
+ name
2627
+ startAt
2628
+ endAt
2629
+ timezone
2630
+ }
2631
+ product {
2632
+ id
2633
+ name
2634
+ type
2635
+ }
2636
+ packageItem {
2637
+ id
2638
+ name
2639
+ type
2640
+ package {
2641
+ id
2642
+ name
2643
+ }
2644
+ }
2645
+ }
2646
+ }
2647
+ }
2648
+ `, Ht = E`
2649
+ query findAllPublicPackagesByOrganizationId($organizationId: ID!) {
2650
+ findAllPublicPackagesByOrganizationId(organizationId: $organizationId) {
2651
+ data {
2652
+ id
2653
+ slug
2654
+ status
2655
+ name
2656
+ description
2657
+ shortTitle
2658
+ shortDescription
2659
+ startAvailabilityAt
2660
+ endAvailabilityAt
2661
+ maxAmountOfPersonsPerOrder
2662
+ icon
2663
+ banner
2664
+ currency
2665
+ amountOfEvents
2666
+ amountOfAddons
2667
+ prices {
2668
+ price
2669
+ deposit
2670
+ discount
2671
+ serviceFee
2672
+ }
2673
+ }
2674
+ count
2675
+ }
2676
+ }
2677
+ `, zt = E`
2678
+ query findPublicItemsByPackageId($packageId: ID!, $types: [PackageItemType!], $page: PageInput) {
2679
+ findPublicItemsByPackageId(packageId: $packageId, types: $types, page: $page) {
2680
+ data {
2681
+ id
2682
+ name
2683
+ description
2684
+ type
2685
+ price
2686
+ depositPrice
2687
+ discountPrice
2688
+ serviceFee
2689
+ banner
2690
+ package {
2691
+ id
2692
+ name
2693
+ }
2694
+ activeEvents {
2695
+ id
2696
+ name
2697
+ startAt
2698
+ endAt
2699
+ timezone
2700
+ icon
2701
+ banner
2702
+ location {
2703
+ id
2704
+ name
2705
+ address
2706
+ }
2707
+ }
2708
+ }
2709
+ count
2710
+ }
2711
+ }
2712
+ `, Yt = E`
2482
2713
  query findPaymentMethods($orderId: ID!, $orderItemId: String, $amountOfTickets: Int, $paymentMethodId: String) {
2483
2714
  findPaymentDetails(
2484
2715
  orderId: $orderId
@@ -2505,93 +2736,188 @@ const yt = I`
2505
2736
  additionalTransactionFee
2506
2737
  }
2507
2738
  }
2508
- `, bt = I`
2739
+ `, qt = E`
2509
2740
  mutation createDigitalPayment($input: CreateDigitalOrderPaymentInput!) {
2510
2741
  createDigitalOrderPayment(input: $input)
2511
2742
  }
2512
- `, _t = (t, e, r, s) => t();
2513
- function Y(t, e = _t) {
2743
+ `, Kr = (e, t, r, i) => e();
2744
+ function S(e, t = Kr) {
2514
2745
  return {
2515
- findActiveOrderById(r, s, n) {
2516
- return e((i) => t.request({ document: yt, variables: r, requestHeaders: { ...s, ...i }, signal: n }), "findActiveOrderById", "query", r);
2746
+ findActiveOrderById(r, i, n) {
2747
+ return t((s) => e.request({ document: Ct, variables: r, requestHeaders: { ...i, ...s }, signal: n }), "findActiveOrderById", "query", r);
2748
+ },
2749
+ addToOrder(r, i, n) {
2750
+ return t((s) => e.request({ document: St, variables: r, requestHeaders: { ...i, ...s }, signal: n }), "addToOrder", "mutation", r);
2751
+ },
2752
+ removeFromOrder(r, i, n) {
2753
+ return t((s) => e.request({ document: xt, variables: r, requestHeaders: { ...i, ...s }, signal: n }), "removeFromOrder", "mutation", r);
2754
+ },
2755
+ configurePackage(r, i, n) {
2756
+ return t((s) => e.request({ document: bt, variables: r, requestHeaders: { ...i, ...s }, signal: n }), "configurePackage", "mutation", r);
2517
2757
  },
2518
- addToOrder(r, s, n) {
2519
- return e((i) => t.request({ document: Tt, variables: r, requestHeaders: { ...s, ...i }, signal: n }), "addToOrder", "mutation", r);
2758
+ configureOrderDeliveryOption(r, i, n) {
2759
+ return t((s) => e.request({ document: Ft, variables: r, requestHeaders: { ...i, ...s }, signal: n }), "configureOrderDeliveryOption", "mutation", r);
2520
2760
  },
2521
- removeFromOrder(r, s, n) {
2522
- return e((i) => t.request({ document: Ot, variables: r, requestHeaders: { ...s, ...i }, signal: n }), "removeFromOrder", "mutation", r);
2761
+ createOrderCustomer(r, i, n) {
2762
+ return t((s) => e.request({ document: yt, variables: r, requestHeaders: { ...i, ...s }, signal: n }), "createOrderCustomer", "mutation", r);
2523
2763
  },
2524
- configurePackage(r, s, n) {
2525
- return e((i) => t.request({ document: Nt, variables: r, requestHeaders: { ...s, ...i }, signal: n }), "configurePackage", "mutation", r);
2764
+ deleteOrder(r, i, n) {
2765
+ return t((s) => e.request({ document: Ut, variables: r, requestHeaders: { ...i, ...s }, signal: n }), "deleteOrder", "mutation", r);
2526
2766
  },
2527
- configureOrderDeliveryOption(r, s, n) {
2528
- return e((i) => t.request({ document: xt, variables: r, requestHeaders: { ...s, ...i }, signal: n }), "configureOrderDeliveryOption", "mutation", r);
2767
+ EventOverviewPage(r, i, n) {
2768
+ return t((s) => e.request({ document: Mt, variables: r, requestHeaders: { ...i, ...s }, signal: n }), "EventOverviewPage", "query", r);
2529
2769
  },
2530
- createOrderCustomer(r, s, n) {
2531
- return e((i) => t.request({ document: vt, variables: r, requestHeaders: { ...s, ...i }, signal: n }), "createOrderCustomer", "mutation", r);
2770
+ findProductsByEventId(r, i, n) {
2771
+ return t((s) => e.request({ document: Vt, variables: r, requestHeaders: { ...i, ...s }, signal: n }), "findProductsByEventId", "query", r);
2532
2772
  },
2533
- deleteOrder(r, s, n) {
2534
- return e((i) => t.request({ document: At, variables: r, requestHeaders: { ...s, ...i }, signal: n }), "deleteOrder", "mutation", r);
2773
+ findAllPackages(r, i, n) {
2774
+ return t((s) => e.request({ document: wt, variables: r, requestHeaders: { ...i, ...s }, signal: n }), "findAllPackages", "query", r);
2535
2775
  },
2536
- EventOverviewPage(r, s, n) {
2537
- return e((i) => t.request({ document: Dt, variables: r, requestHeaders: { ...s, ...i }, signal: n }), "EventOverviewPage", "query", r);
2776
+ findAllPackageItems(r, i, n) {
2777
+ return t((s) => e.request({ document: Bt, variables: r, requestHeaders: { ...i, ...s }, signal: n }), "findAllPackageItems", "query", r);
2538
2778
  },
2539
- findProductsByEventId(r, s, n) {
2540
- return e((i) => t.request({ document: kt, variables: r, requestHeaders: { ...s, ...i }, signal: n }), "findProductsByEventId", "query", r);
2779
+ setPackageItemToOrder(r, i, n) {
2780
+ return t((s) => e.request({ document: Gt, variables: r, requestHeaders: { ...i, ...s }, signal: n }), "setPackageItemToOrder", "mutation", r);
2541
2781
  },
2542
- findPaymentMethods(r, s, n) {
2543
- return e((i) => t.request({ document: St, variables: r, requestHeaders: { ...s, ...i }, signal: n }), "findPaymentMethods", "query", r);
2782
+ setAdditionalPackageItemToOrder(r, i, n) {
2783
+ return t((s) => e.request({ document: $t, variables: r, requestHeaders: { ...i, ...s }, signal: n }), "setAdditionalPackageItemToOrder", "mutation", r);
2544
2784
  },
2545
- createDigitalPayment(r, s, n) {
2546
- return e((i) => t.request({ document: bt, variables: r, requestHeaders: { ...s, ...i }, signal: n }), "createDigitalPayment", "mutation", r);
2785
+ findAllPublicPackagesByOrganizationId(r, i, n) {
2786
+ return t((s) => e.request({ document: Ht, variables: r, requestHeaders: { ...i, ...s }, signal: n }), "findAllPublicPackagesByOrganizationId", "query", r);
2787
+ },
2788
+ findPublicItemsByPackageId(r, i, n) {
2789
+ return t((s) => e.request({ document: zt, variables: r, requestHeaders: { ...i, ...s }, signal: n }), "findPublicItemsByPackageId", "query", r);
2790
+ },
2791
+ findPaymentMethods(r, i, n) {
2792
+ return t((s) => e.request({ document: Yt, variables: r, requestHeaders: { ...i, ...s }, signal: n }), "findPaymentMethods", "query", r);
2793
+ },
2794
+ createDigitalPayment(r, i, n) {
2795
+ return t((s) => e.request({ document: qt, variables: r, requestHeaders: { ...i, ...s }, signal: n }), "createDigitalPayment", "mutation", r);
2547
2796
  }
2548
2797
  };
2549
2798
  }
2550
- const Ct = "http://localhost:3001/graphql";
2551
- class Vt {
2799
+ const jr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2800
+ __proto__: null,
2801
+ AddToOrderDocument: St,
2802
+ CacheControlScope: Pe,
2803
+ CategoryType: ke,
2804
+ CommissionPriceType: Ce,
2805
+ CommissionTierApplicationMethod: Se,
2806
+ CommissionTierCalculationScope: xe,
2807
+ CommissionType: be,
2808
+ ConfigureOrderDeliveryOptionDocument: Ft,
2809
+ ConfigurePackageDocument: bt,
2810
+ CreateDigitalPaymentDocument: qt,
2811
+ CreateOrderCustomerDocument: yt,
2812
+ Currency: Fe,
2813
+ CustomFieldMandatoryType: ye,
2814
+ CustomFieldType: Ue,
2815
+ DeleteOrderDocument: Ut,
2816
+ EventContentType: Me,
2817
+ EventOverviewPageDocument: Mt,
2818
+ EventStatus: Ve,
2819
+ ExportFormatType: we,
2820
+ ExportStatus: Be,
2821
+ ExportType: Ge,
2822
+ FindActiveOrderByIdDocument: Ct,
2823
+ FindAllPackageItemsDocument: Bt,
2824
+ FindAllPackagesDocument: wt,
2825
+ FindAllPublicPackagesByOrganizationIdDocument: Ht,
2826
+ FindPaymentMethodsDocument: Yt,
2827
+ FindProductsByEventIdDocument: Vt,
2828
+ FindPublicItemsByPackageIdDocument: zt,
2829
+ GlobalRoleType: $e,
2830
+ IntervalType: He,
2831
+ InviteStatus: ze,
2832
+ ModuleScope: Ye,
2833
+ OrderItemType: qe,
2834
+ OrderSaleLocation: Ke,
2835
+ OrderTicketStatus: je,
2836
+ OrderType: We,
2837
+ OverrideType: Xe,
2838
+ PackageItemType: U,
2839
+ PackageStatus: Qe,
2840
+ PackageTabType: Je,
2841
+ PaymentMethodFeeType: Ze,
2842
+ PaymentSalesType: et,
2843
+ PaymentStatus: tt,
2844
+ PaymentType: rt,
2845
+ PermissionScope: nt,
2846
+ ProductStatus: it,
2847
+ ProductType: st,
2848
+ RefundType: at,
2849
+ RemoveFromOrderDocument: xt,
2850
+ ReportDeliveryMethod: ot,
2851
+ ReportExecutionStatus: dt,
2852
+ ReportFormat: ct,
2853
+ ReportStatus: ut,
2854
+ RevenueType: lt,
2855
+ RoleType: ht,
2856
+ SalesLocations: Et,
2857
+ SalesType: It,
2858
+ ScannedTicketStatus: pt,
2859
+ SetAdditionalPackageItemToOrderDocument: $t,
2860
+ SetPackageItemToOrderDocument: Gt,
2861
+ ShopTemplateType: gt,
2862
+ ShopVariationType: ft,
2863
+ SortOrder: At,
2864
+ StatisticType: mt,
2865
+ TabType: Ot,
2866
+ TeamType: Tt,
2867
+ TerminalStatus: Nt,
2868
+ TicketLimitAppliedForType: Dt,
2869
+ TicketLimitType: _t,
2870
+ TicketStatus: Rt,
2871
+ TrackerMediaType: vt,
2872
+ TrackerTabType: Lt,
2873
+ TrackerType: Pt,
2874
+ UserStatus: kt,
2875
+ getSdk: S
2876
+ }, Symbol.toStringTag, { value: "Module" })), Wr = "https://api.ticketapp.com/graphql";
2877
+ class Kt {
2552
2878
  config;
2553
2879
  sdk;
2554
2880
  store;
2555
- constructor(e) {
2881
+ constructor(t) {
2556
2882
  this.config = {
2557
- ...e
2558
- }, this.store = ce({
2883
+ ...t
2884
+ }, this.store = ue({
2559
2885
  reducer: {
2560
- event: Ce
2886
+ event: pe
2561
2887
  }
2562
2888
  });
2563
- const r = new j(Ct);
2564
- this.sdk = Y(r);
2889
+ const r = new M(t.apiUrl ?? Wr);
2890
+ this.sdk = S(r);
2565
2891
  }
2566
2892
  getState() {
2567
2893
  return this.store.getState().event;
2568
2894
  }
2569
- subscribe(e) {
2570
- return this.store.subscribe(e);
2895
+ subscribe(t) {
2896
+ return this.store.subscribe(t);
2571
2897
  }
2572
- debugLog(e, r) {
2573
- this.config.debug && console.log(`[EventService:${this.config.organizationId}] ${e}`, r || "");
2898
+ debugLog(t, r) {
2899
+ this.config.debug && console.log(`[EventService:${this.config.organizationId}] ${t}`, r || "");
2574
2900
  }
2575
2901
  async fetchEvents() {
2576
- this.store.dispatch(te(!0));
2902
+ this.store.dispatch(H(!0));
2577
2903
  try {
2578
- const e = sessionStorage.getItem("TIC_TRACKER_ID") || void 0;
2904
+ const t = sessionStorage.getItem("TIC_TRACKER_ID") || void 0;
2579
2905
  this.debugLog("Fetching events with parameters", {
2580
2906
  organizationId: this.config.organizationId,
2581
2907
  locationIds: this.config.filteredLocationIds,
2582
2908
  hostingIds: this.config.filteredHostingIds,
2583
- trackerId: e,
2909
+ trackerId: t,
2584
2910
  showDoorTickets: this.config.enableDoorTickets
2585
2911
  });
2586
2912
  const r = await this.sdk.EventOverviewPage({
2587
2913
  organizationId: this.config.organizationId,
2588
2914
  locationIds: this.config.filteredLocationIds,
2589
2915
  hostingIds: this.config.filteredHostingIds,
2590
- trackerId: e,
2916
+ trackerId: t,
2591
2917
  showDoorTickets: this.config.enableDoorTickets
2592
2918
  });
2593
2919
  if (this.debugLog("Raw GraphQL response", r), r?.findAllPublicEventByOrganizationId?.data) {
2594
- const s = r.findAllPublicEventByOrganizationId.data.map((n) => ({
2920
+ const i = r.findAllPublicEventByOrganizationId.data.map((n) => ({
2595
2921
  id: n.id,
2596
2922
  name: n.name,
2597
2923
  icon: n.icon ?? null,
@@ -2599,8 +2925,8 @@ class Vt {
2599
2925
  description: n.description ?? null,
2600
2926
  addonDescription: n.addonDescription ?? null,
2601
2927
  infoDescription: n.infoDescription ?? null,
2602
- startAt: x.fromISO(n.startAt, { zone: n.timezone }),
2603
- endAt: x.fromISO(n.endAt, { zone: n.timezone }),
2928
+ startAt: _.fromISO(n.startAt, { zone: n.timezone }),
2929
+ endAt: _.fromISO(n.endAt, { zone: n.timezone }),
2604
2930
  timezone: n.timezone,
2605
2931
  startSalesAt: n.startSalesAt ?? null,
2606
2932
  endSalesAt: n.endSalesAt ?? null,
@@ -2614,88 +2940,88 @@ class Vt {
2614
2940
  } : { id: "", name: "", address: null },
2615
2941
  products: []
2616
2942
  }));
2617
- this.debugLog("Processed events", { events: s, count: s.length }), this.store.dispatch(re(s)), this.debugLog("Redux state after setEvents", this.getState());
2943
+ this.debugLog("Processed events", { events: i, count: i.length }), this.store.dispatch(z(i)), this.debugLog("Redux state after setEvents", this.getState());
2618
2944
  } else
2619
- this.debugLog("No events found in response"), this.store.dispatch(re([]));
2620
- } catch (e) {
2621
- throw this.debugLog("Error fetching events", e), this.store.dispatch(Se(e.message || "Failed to fetch events")), e;
2945
+ this.debugLog("No events found in response"), this.store.dispatch(z([]));
2946
+ } catch (t) {
2947
+ throw this.debugLog("Error fetching events", t), this.store.dispatch(he(t.message || "Failed to fetch events")), t;
2622
2948
  } finally {
2623
- this.store.dispatch(te(!1));
2949
+ this.store.dispatch(H(!1));
2624
2950
  }
2625
2951
  }
2626
- async fetchProductsForEvent(e, r, s) {
2627
- this.store.dispatch(ne({ eventId: e, loading: !0 }));
2952
+ async fetchProductsForEvent(t, r, i) {
2953
+ this.store.dispatch(Y({ eventId: t, loading: !0 }));
2628
2954
  try {
2629
- const n = sessionStorage.getItem("TIC_TRACKER_ID") || void 0, i = this.config.enableDoorTickets && r ? r : void 0;
2955
+ const n = sessionStorage.getItem("TIC_TRACKER_ID") || void 0, s = this.config.enableDoorTickets && r ? r : void 0;
2630
2956
  this.debugLog("Fetching products for event", {
2631
- eventId: e,
2632
- promoCode: s,
2957
+ eventId: t,
2958
+ promoCode: i,
2633
2959
  trackerId: n,
2634
- productTypes: i
2960
+ productTypes: s
2635
2961
  });
2636
- const a = await this.sdk.findProductsByEventId({
2637
- eventId: e,
2638
- promoCode: s,
2962
+ const o = await this.sdk.findProductsByEventId({
2963
+ eventId: t,
2964
+ promoCode: i,
2639
2965
  trackerId: n,
2640
- productTypes: i
2966
+ productTypes: s
2641
2967
  });
2642
- if (a?.findPublicProductsByEventId) {
2643
- const u = a.findPublicProductsByEventId.map((l) => ({
2968
+ if (o?.findPublicProductsByEventId) {
2969
+ const c = o.findPublicProductsByEventId.map((l) => ({
2644
2970
  ...l
2645
2971
  }));
2646
2972
  return this.debugLog("Products fetched", {
2647
- eventId: e,
2648
- count: u.length,
2649
- types: u.map((l) => l.type)
2650
- }), this.store.dispatch(be({ eventId: e, products: u })), u;
2973
+ eventId: t,
2974
+ count: c.length,
2975
+ types: c.map((l) => l.type)
2976
+ }), this.store.dispatch(Ee({ eventId: t, products: c })), c;
2651
2977
  }
2652
2978
  return;
2653
2979
  } catch (n) {
2654
- throw this.debugLog("Error fetching products", { eventId: e, error: n }), n;
2980
+ throw this.debugLog("Error fetching products", { eventId: t, error: n }), n;
2655
2981
  } finally {
2656
- this.store.dispatch(ne({ eventId: e, loading: !1 }));
2982
+ this.store.dispatch(Y({ eventId: t, loading: !1 }));
2657
2983
  }
2658
2984
  }
2659
2985
  clearEvents() {
2660
- this.debugLog("Clearing events"), this.store.dispatch(_e());
2986
+ this.debugLog("Clearing events"), this.store.dispatch(Ie());
2661
2987
  }
2662
2988
  }
2663
- const Pt = "http://localhost:3001/graphql";
2664
- class Gt {
2989
+ const Xr = "https://api.ticketapp.com/graphql";
2990
+ class jt {
2665
2991
  config;
2666
2992
  sdk;
2667
- constructor(e = {}) {
2668
- this.config = e;
2669
- const r = new j(Pt, {
2670
- headers: e.headers
2993
+ constructor(t = {}) {
2994
+ this.config = t;
2995
+ const r = new M(t.apiUrl ?? Xr, {
2996
+ headers: t.headers
2671
2997
  });
2672
- this.sdk = Y(r);
2998
+ this.sdk = S(r);
2673
2999
  }
2674
- debugLog(e, r) {
2675
- this.config.debug && console.log(`[PaymentService] ${e}`, r || "");
3000
+ debugLog(t, r) {
3001
+ this.config.debug && console.log(`[PaymentService] ${t}`, r || "");
2676
3002
  }
2677
- async getPaymentMethods(e) {
2678
- this.debugLog("Fetching payment methods", e);
3003
+ async getPaymentMethods(t) {
3004
+ this.debugLog("Fetching payment methods", t);
2679
3005
  try {
2680
3006
  const r = await this.sdk.findPaymentMethods({
2681
- orderId: e.orderId,
2682
- orderItemId: e.orderItemId,
2683
- amountOfTickets: e.amountOfTickets,
2684
- paymentMethodId: e.paymentMethodId
3007
+ orderId: t.orderId,
3008
+ orderItemId: t.orderItemId,
3009
+ amountOfTickets: t.amountOfTickets,
3010
+ paymentMethodId: t.paymentMethodId
2685
3011
  });
2686
3012
  if (!r?.findPaymentDetails)
2687
3013
  throw this.debugLog("No payment details found"), new Error("No payment details found for this order");
2688
- const s = r.findPaymentDetails;
3014
+ const i = r.findPaymentDetails;
2689
3015
  return this.debugLog("Payment methods fetched successfully", {
2690
- methodCount: s.methods?.length ?? 0,
2691
- transactionPrice: s.transactionPrice,
2692
- baseTransactionFee: s.baseTransactionFee,
2693
- additionalTransactionFee: s.additionalTransactionFee
3016
+ methodCount: i.methods?.length ?? 0,
3017
+ transactionPrice: i.transactionPrice,
3018
+ baseTransactionFee: i.baseTransactionFee,
3019
+ additionalTransactionFee: i.additionalTransactionFee
2694
3020
  }), {
2695
- transactionPrice: s.transactionPrice,
2696
- baseTransactionFee: s.baseTransactionFee ?? null,
2697
- additionalTransactionFee: s.additionalTransactionFee ?? null,
2698
- methods: s.methods?.map((n) => ({
3021
+ transactionPrice: i.transactionPrice,
3022
+ baseTransactionFee: i.baseTransactionFee ?? null,
3023
+ additionalTransactionFee: i.additionalTransactionFee ?? null,
3024
+ methods: i.methods?.map((n) => ({
2699
3025
  id: n.id,
2700
3026
  name: n.name,
2701
3027
  image: n.image,
@@ -2703,10 +3029,10 @@ class Gt {
2703
3029
  type: n.fee.type,
2704
3030
  value: n.fee.value
2705
3031
  } : null,
2706
- issuers: n.issuers?.map((i) => ({
2707
- id: i.id,
2708
- name: i.name,
2709
- image: i.image
3032
+ issuers: n.issuers?.map((s) => ({
3033
+ id: s.id,
3034
+ name: s.name,
3035
+ image: s.image
2710
3036
  })) ?? null
2711
3037
  })) ?? null
2712
3038
  };
@@ -2714,26 +3040,26 @@ class Gt {
2714
3040
  throw this.debugLog("Error fetching payment methods", r), r;
2715
3041
  }
2716
3042
  }
2717
- async createPayment(e) {
2718
- this.debugLog("Creating payment", e);
3043
+ async createPayment(t) {
3044
+ this.debugLog("Creating payment", t);
2719
3045
  try {
2720
3046
  const r = {
2721
- orderId: e.orderId,
2722
- paymentMethodId: e.paymentMethodId,
2723
- issuerId: e.issuerId,
2724
- redirectUrl: e.redirectUrl,
2725
- initiatedByUserId: e.initiatedByUserId,
2726
- initiatedByTeamId: e.initiatedByTeamId,
2727
- orderItemId: e.orderItemId,
2728
- amountOfTickets: e.amountOfTickets
3047
+ orderId: t.orderId,
3048
+ paymentMethodId: t.paymentMethodId,
3049
+ issuerId: t.issuerId,
3050
+ redirectUrl: t.redirectUrl,
3051
+ initiatedByUserId: t.initiatedByUserId,
3052
+ initiatedByTeamId: t.initiatedByTeamId,
3053
+ orderItemId: t.orderItemId,
3054
+ amountOfTickets: t.amountOfTickets
2729
3055
  };
2730
- e.customer && (r.customer = e.customer), e.products && (r.products = e.products), e.description && (r.description = e.description), e.reference && (r.reference = e.reference), e.ipAddress && (r.ipAddress = e.ipAddress);
2731
- const s = await this.sdk.createDigitalPayment({
3056
+ t.customer && (r.customer = t.customer), t.products && (r.products = t.products), t.description && (r.description = t.description), t.reference && (r.reference = t.reference), t.ipAddress && (r.ipAddress = t.ipAddress);
3057
+ const i = await this.sdk.createDigitalPayment({
2732
3058
  input: r
2733
3059
  });
2734
- if (!s?.createDigitalOrderPayment)
3060
+ if (!i?.createDigitalOrderPayment)
2735
3061
  throw this.debugLog("Failed to create payment"), new Error("Failed to create payment for this order");
2736
- const n = s.createDigitalOrderPayment;
3062
+ const n = i.createDigitalOrderPayment;
2737
3063
  return this.debugLog("Payment created successfully", {
2738
3064
  paymentUrl: n
2739
3065
  }), {
@@ -2743,40 +3069,137 @@ class Gt {
2743
3069
  throw this.debugLog("Error creating payment", r), r;
2744
3070
  }
2745
3071
  }
2746
- calculateTotalWithFee(e, r) {
2747
- return r.fee ? r.fee.type === "FIXED" ? e + r.fee.value : r.fee.type === "PERCENTAGE" ? e + e * (r.fee.value / 100) : e : e;
3072
+ calculateTotalWithFee(t, r) {
3073
+ return r.fee ? r.fee.type === "FIXED" ? t + r.fee.value : r.fee.type === "PERCENTAGE" ? t + t * (r.fee.value / 100) : t : t;
2748
3074
  }
2749
- calculateFee(e, r) {
2750
- return r.fee ? r.fee.type === "FIXED" ? r.fee.value : r.fee.type === "PERCENTAGE" ? e * (r.fee.value / 100) : 0 : 0;
3075
+ calculateFee(t, r) {
3076
+ return r.fee ? r.fee.type === "FIXED" ? r.fee.value : r.fee.type === "PERCENTAGE" ? t * (r.fee.value / 100) : 0 : 0;
2751
3077
  }
2752
- formatFee(e, r = "€") {
2753
- return e.fee ? e.fee.type === "FIXED" ? `${r}${e.fee.value.toFixed(2)}` : e.fee.type === "PERCENTAGE" ? `${e.fee.value}%` : "Free" : "Free";
3078
+ formatFee(t, r = "€") {
3079
+ return t.fee ? t.fee.type === "FIXED" ? `${r}${t.fee.value.toFixed(2)}` : t.fee.type === "PERCENTAGE" ? `${t.fee.value}%` : "Free" : "Free";
2754
3080
  }
2755
3081
  }
2756
- var v = /* @__PURE__ */ ((t) => (t.PACKAGE = "PACKAGE", t.PRODUCT = "PRODUCT", t.ADD_ONS = "ADD_ONS", t.DELIVERY = "DELIVERY", t.PICKUP = "PICKUP", t))(v || {}), Lt = /* @__PURE__ */ ((t) => (t.Ticket = "Ticket", t.Door = "Door", t.Addon = "Addon", t.Promoter = "Promoter", t.Pickup = "Pickup", t.Delivery = "Delivery", t))(Lt || {}), Ft = /* @__PURE__ */ ((t) => (t.FIXED = "FIXED", t.PERCENTAGE = "PERCENTAGE", t))(Ft || {});
2757
- const Rt = "http://localhost:3001/graphql";
2758
- class jt {
3082
+ const Qr = "https://api.ticketapp.com/graphql";
3083
+ class Wt {
3084
+ config;
3085
+ sdk;
3086
+ constructor(t) {
3087
+ if (!t.organizationId)
3088
+ throw new Error("organizationId is required for public package queries");
3089
+ this.config = {
3090
+ ...t
3091
+ };
3092
+ const r = new M(t.apiUrl ?? Qr);
3093
+ this.sdk = S(r);
3094
+ }
3095
+ debugLog(t, r) {
3096
+ this.config.debug && console.log(`[PackageService] ${t}`, r || "");
3097
+ }
3098
+ async getPackages(t, r, i) {
3099
+ try {
3100
+ this.debugLog("Fetching public packages", { organizationId: this.config.organizationId, page: t, tab: r, statuses: i });
3101
+ const n = await this.sdk.findAllPublicPackagesByOrganizationId({
3102
+ organizationId: this.config.organizationId
3103
+ });
3104
+ if (n?.findAllPublicPackagesByOrganizationId) {
3105
+ const s = n.findAllPublicPackagesByOrganizationId;
3106
+ return this.debugLog("Public packages fetched", {
3107
+ count: s.count,
3108
+ dataLength: s.data.length
3109
+ }), s;
3110
+ }
3111
+ return null;
3112
+ } catch (n) {
3113
+ throw this.debugLog("Error fetching public packages", n), n;
3114
+ }
3115
+ }
3116
+ async getPackageItems(t, r = [U.Regular, U.AdditionalEvent]) {
3117
+ try {
3118
+ this.debugLog("Fetching public package items", { packageId: t, types: r });
3119
+ const i = await this.sdk.findPublicItemsByPackageId({
3120
+ packageId: t,
3121
+ types: r,
3122
+ page: { index: 0, size: 100 }
3123
+ });
3124
+ if (i?.findPublicItemsByPackageId) {
3125
+ const n = i.findPublicItemsByPackageId;
3126
+ return this.debugLog("Public package items fetched", {
3127
+ count: n.count,
3128
+ dataLength: n.data.length
3129
+ }), n;
3130
+ }
3131
+ return null;
3132
+ } catch (i) {
3133
+ throw this.debugLog("Error fetching public package items", i), i;
3134
+ }
3135
+ }
3136
+ async setPackageToOrder(t, r, i) {
3137
+ try {
3138
+ this.debugLog("Setting package to order", { sessionId: t, items: r, amount: i });
3139
+ const n = await this.sdk.setPackageItemToOrder({
3140
+ sessionId: t,
3141
+ amount: i,
3142
+ items: r
3143
+ });
3144
+ return n?.setPackageItemToOrder ? (this.debugLog("Package set successfully", n.setPackageItemToOrder), n.setPackageItemToOrder) : null;
3145
+ } catch (n) {
3146
+ throw this.debugLog("Error setting package to order", n), n;
3147
+ }
3148
+ }
3149
+ async setAdditionalPackageItem(t, r, i, n) {
3150
+ try {
3151
+ this.debugLog("Setting additional package item", {
3152
+ sessionId: t,
3153
+ packageItemId: r,
3154
+ eventId: i,
3155
+ amount: n
3156
+ });
3157
+ const s = await this.sdk.setAdditionalPackageItemToOrder({
3158
+ sessionId: t,
3159
+ packageItemId: r,
3160
+ eventId: i,
3161
+ amount: n
3162
+ });
3163
+ return s?.setAdditionalPackageItemToOrder ? (this.debugLog("Additional package item set successfully", s.setAdditionalPackageItemToOrder), s.setAdditionalPackageItemToOrder) : null;
3164
+ } catch (s) {
3165
+ throw this.debugLog("Error setting additional package item", s), s;
3166
+ }
3167
+ }
3168
+ }
3169
+ var D = /* @__PURE__ */ ((e) => (e.PACKAGE = "PACKAGE", e.PRODUCT = "PRODUCT", e.ADD_ONS = "ADD_ONS", e.DELIVERY = "DELIVERY", e.PICKUP = "PICKUP", e))(D || {}), Xt = /* @__PURE__ */ ((e) => (e.Ticket = "Ticket", e.Door = "Door", e.Addon = "Addon", e.Promoter = "Promoter", e.Pickup = "Pickup", e.Delivery = "Delivery", e))(Xt || {}), Qt = /* @__PURE__ */ ((e) => (e.FIXED = "FIXED", e.PERCENTAGE = "PERCENTAGE", e))(Qt || {}), Jt = /* @__PURE__ */ ((e) => (e.AdditionalEvent = "ADDITIONAL_EVENT", e.Addon = "ADDON", e.Regular = "REGULAR", e))(Jt || {});
3170
+ const Jr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3171
+ __proto__: null,
3172
+ BasketOrderType: D,
3173
+ BasketService: Zt,
3174
+ EventService: Kt,
3175
+ PackageItemType: Jt,
3176
+ PackageService: Wt,
3177
+ PaymentMethodFeeType: Qt,
3178
+ PaymentService: jt,
3179
+ ProductType: Xt
3180
+ }, Symbol.toStringTag, { value: "Module" })), Zr = "https://api.ticketapp.com/graphql";
3181
+ class Zt {
2759
3182
  config;
2760
3183
  orderIdKey;
2761
3184
  sdk;
2762
3185
  store;
2763
- constructor(e) {
3186
+ constructor(t) {
2764
3187
  this.config = {
2765
- ...e
2766
- }, this.orderIdKey = `ORDER_ID_${e.shopSlug}`, this.store = ce({
3188
+ ...t
3189
+ }, this.orderIdKey = `ORDER_ID_${t.shopSlug}`, this.store = ue({
2767
3190
  reducer: {
2768
- basket: ke
3191
+ basket: ir
2769
3192
  }
2770
3193
  });
2771
- const r = new j(Rt);
2772
- this.sdk = Y(r), this.restoreOrderFromSession();
3194
+ const r = new M(t.apiUrl ?? Zr);
3195
+ this.sdk = S(r), this.restoreOrderFromSession();
2773
3196
  }
2774
3197
  async restoreOrderFromSession() {
2775
- const e = this.getOrderId();
2776
- if (e) {
2777
- this.debugLog("Found existing order ID in session, restoring...", { orderId: e });
3198
+ const t = this.getOrderId();
3199
+ if (t) {
3200
+ this.debugLog("Found existing order ID in session, restoring...", { orderId: t });
2778
3201
  try {
2779
- await this.fetchOrder(e), this.debugLog("Order restored successfully");
3202
+ await this.fetchOrder(t), this.debugLog("Order restored successfully");
2780
3203
  } catch (r) {
2781
3204
  this.debugLog("Failed to restore order, clearing session", r), this.clearOrderFromSession();
2782
3205
  }
@@ -2785,78 +3208,74 @@ class jt {
2785
3208
  getState() {
2786
3209
  return this.store.getState().basket;
2787
3210
  }
2788
- subscribe(e) {
2789
- return this.store.subscribe(e);
3211
+ subscribe(t) {
3212
+ return this.store.subscribe(t);
2790
3213
  }
2791
- /**
2792
- * Get the current order with a count of total items
2793
- * @returns CurrentOrder object with count property, or null if no order exists
2794
- */
2795
3214
  getCurrentOrder() {
2796
- const e = this.getState();
2797
- if (!e.order)
3215
+ const t = this.getState();
3216
+ if (!t.order)
2798
3217
  return null;
2799
- const r = e.order.items.reduce((s, n) => s + (n.amount || 0), 0);
3218
+ const r = t.order.items.reduce((i, n) => i + (n.amount || 0), 0);
2800
3219
  return {
2801
- ...e.order,
3220
+ ...t.order,
2802
3221
  count: r
2803
3222
  };
2804
3223
  }
2805
3224
  getOrderId() {
2806
3225
  return sessionStorage.getItem(this.orderIdKey);
2807
3226
  }
2808
- setOrderId(e) {
2809
- sessionStorage.setItem(this.orderIdKey, e);
3227
+ setOrderId(t) {
3228
+ sessionStorage.setItem(this.orderIdKey, t);
2810
3229
  }
2811
3230
  getTrackerId() {
2812
3231
  return sessionStorage.getItem("TIC_TRACKER_ID");
2813
3232
  }
2814
3233
  generateOrderId() {
2815
- return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (e) => {
3234
+ return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (t) => {
2816
3235
  const r = Math.random() * 16 | 0;
2817
- return (e === "x" ? r : r & 3 | 8).toString(16);
3236
+ return (t === "x" ? r : r & 3 | 8).toString(16);
2818
3237
  });
2819
3238
  }
2820
- debugLog(e, r) {
2821
- this.config.debug && console.log(`[BasketService:${this.config.shopSlug}] ${e}`, r || "");
3239
+ debugLog(t, r) {
3240
+ this.config.debug && console.log(`[BasketService:${this.config.shopSlug}] ${t}`, r || "");
2822
3241
  }
2823
- async addProduct(e) {
3242
+ async addProduct(t) {
2824
3243
  this.store.dispatch(N(!0));
2825
3244
  try {
2826
- const s = this.store.getState().basket.order?.id ?? this.getOrderId() ?? this.generateOrderId(), n = this.getTrackerId();
3245
+ const i = this.store.getState().basket.order?.id ?? this.getOrderId() ?? this.generateOrderId(), n = this.getTrackerId();
2827
3246
  this.debugLog("Adding product", {
2828
- productId: e.id,
2829
- orderId: s,
2830
- amount: e.amount,
2831
- seat: e.seat
3247
+ productId: t.id,
3248
+ orderId: i,
3249
+ amount: t.amount,
3250
+ seat: t.seat
2832
3251
  });
2833
- const i = await this.sdk.addToOrder({
2834
- productId: e.id,
2835
- orderId: s,
2836
- additionalData: e.seat ? {
3252
+ const s = await this.sdk.addToOrder({
3253
+ productId: t.id,
3254
+ orderId: i,
3255
+ additionalData: t.seat ? {
2837
3256
  seat: {
2838
- seatId: e.seat.id,
2839
- seatLabel: e.seat.label,
2840
- holdToken: e.seat.holdToken
3257
+ seatId: t.seat.id,
3258
+ seatLabel: t.seat.label,
3259
+ holdToken: t.seat.holdToken
2841
3260
  }
2842
3261
  } : null,
2843
3262
  trackerId: n || void 0,
2844
3263
  shopId: this.config.shopId,
2845
- amount: e.amount
3264
+ amount: t.amount
2846
3265
  });
2847
- if (i?.reserveProduct) {
2848
- const { orderId: a, expiredAt: u, amountReserved: l } = i.reserveProduct;
2849
- this.debugLog("Product added successfully", i.reserveProduct), this.setOrderId(a), this.store.dispatch(
2850
- $({
2851
- id: a,
2852
- currency: e.currency,
2853
- expiredAt: u
3266
+ if (s?.reserveProduct) {
3267
+ const { orderId: o, expiredAt: c, amountReserved: l } = s.reserveProduct;
3268
+ this.debugLog("Product added successfully", s.reserveProduct), this.setOrderId(o), this.store.dispatch(
3269
+ B({
3270
+ id: o,
3271
+ currency: t.currency,
3272
+ expiredAt: c
2854
3273
  })
2855
3274
  ), this.store.dispatch(
2856
- X({
2857
- input: e,
3275
+ te({
3276
+ input: t,
2858
3277
  amountReserved: l,
2859
- expiredAt: u
3278
+ expiredAt: c
2860
3279
  })
2861
3280
  );
2862
3281
  }
@@ -2866,38 +3285,38 @@ class jt {
2866
3285
  this.store.dispatch(N(!1));
2867
3286
  }
2868
3287
  }
2869
- async removeProduct(e) {
2870
- const s = this.getState().order;
2871
- if (s) {
3288
+ async removeProduct(t) {
3289
+ const i = this.getState().order;
3290
+ if (i) {
2872
3291
  this.store.dispatch(N(!0));
2873
3292
  try {
2874
3293
  this.debugLog("Removing product", {
2875
- productId: e.id,
2876
- orderId: s.id,
2877
- amount: e.amount
3294
+ productId: t.id,
3295
+ orderId: i.id,
3296
+ amount: t.amount
2878
3297
  });
2879
3298
  const n = await this.sdk.removeFromOrder({
2880
- productId: e.id,
2881
- orderId: s.id,
2882
- additionalData: e.seat ? {
3299
+ productId: t.id,
3300
+ orderId: i.id,
3301
+ additionalData: t.seat ? {
2883
3302
  seat: {
2884
- seatId: e.seat.id,
2885
- seatLabel: e.seat.label
3303
+ seatId: t.seat.id,
3304
+ seatLabel: t.seat.label
2886
3305
  }
2887
3306
  } : null,
2888
- amount: e.amount
3307
+ amount: t.amount
2889
3308
  });
2890
3309
  if (n?.releaseProduct) {
2891
- const { amountReleased: i } = n.releaseProduct;
3310
+ const { amountReleased: s } = n.releaseProduct;
2892
3311
  this.debugLog("Product removed successfully", n.releaseProduct), this.store.dispatch(
2893
- Ae({
2894
- id: e.id,
2895
- amountReleased: i,
2896
- seatId: e.seat?.id
3312
+ rr({
3313
+ id: t.id,
3314
+ amountReleased: s,
3315
+ seatId: t.seat?.id
2897
3316
  })
2898
3317
  );
2899
- const a = this.getState();
2900
- (!a.order || a.order.items.length === 0) && (this.debugLog("Basket is now empty, cancelling order and clearing session"), await this.cancelOrder());
3318
+ const o = this.getState();
3319
+ (!o.order || o.order.items.length === 0) && (this.debugLog("Basket is now empty, cancelling order and clearing session"), await this.cancelOrder());
2901
3320
  }
2902
3321
  } catch (n) {
2903
3322
  throw this.debugLog("Error removing product", n), this.handleError(n), n;
@@ -2906,40 +3325,40 @@ class jt {
2906
3325
  }
2907
3326
  }
2908
3327
  }
2909
- async configurePackage(e) {
3328
+ async configurePackage(t) {
2910
3329
  this.store.dispatch(N(!0));
2911
3330
  try {
2912
- const s = this.store.getState().basket.order?.id ?? this.getOrderId() ?? this.generateOrderId(), n = this.getTrackerId(), i = e.items.map((u) => ({
2913
- packageItemId: u.packageItemId,
2914
- eventId: u.eventId
3331
+ const i = this.store.getState().basket.order?.id ?? this.getOrderId() ?? this.generateOrderId(), n = this.getTrackerId(), s = t.items.map((c) => ({
3332
+ packageItemId: c.packageItemId,
3333
+ eventId: c.eventId
2915
3334
  }));
2916
3335
  this.debugLog("Configuring package", {
2917
- packageId: e.id,
2918
- orderId: s,
2919
- amount: e.amount,
2920
- items: i,
3336
+ packageId: t.id,
3337
+ orderId: i,
3338
+ amount: t.amount,
3339
+ items: s,
2921
3340
  shopId: this.config.shopId
2922
3341
  });
2923
- const a = await this.sdk.configurePackage({
3342
+ const o = await this.sdk.configurePackage({
2924
3343
  trackerId: n || void 0,
2925
3344
  shopId: this.config.shopId,
2926
- packageId: e.id,
2927
- orderId: s,
2928
- amount: e.amount,
2929
- items: i
3345
+ packageId: t.id,
3346
+ orderId: i,
3347
+ amount: t.amount,
3348
+ items: s
2930
3349
  });
2931
- if (this.debugLog("Configure package response", a), a?.configurePackage && a.configurePackage.amountReserved > 0) {
2932
- const { orderId: u, expiredAt: l, amountReserved: p } = a.configurePackage;
2933
- return this.debugLog("Package configured successfully"), this.setOrderId(u), this.store.dispatch(
2934
- $({
2935
- id: u,
2936
- currency: e.currency,
3350
+ if (this.debugLog("Configure package response", o), o?.configurePackage && o.configurePackage.amountReserved > 0) {
3351
+ const { orderId: c, expiredAt: l, amountReserved: h } = o.configurePackage;
3352
+ return this.debugLog("Package configured successfully"), this.setOrderId(c), this.store.dispatch(
3353
+ B({
3354
+ id: c,
3355
+ currency: t.currency,
2937
3356
  expiredAt: l
2938
3357
  })
2939
3358
  ), this.store.dispatch(
2940
- K({
2941
- input: e,
2942
- amountReserved: p,
3359
+ re({
3360
+ input: t,
3361
+ amountReserved: h,
2943
3362
  expiredAt: l
2944
3363
  })
2945
3364
  ), null;
@@ -2951,191 +3370,225 @@ class jt {
2951
3370
  this.store.dispatch(N(!1));
2952
3371
  }
2953
3372
  }
2954
- async setDelivery(e) {
3373
+ async setDelivery(t) {
2955
3374
  this.store.dispatch(N(!0));
2956
3375
  try {
2957
- this.store.dispatch(De(e));
3376
+ this.store.dispatch(nr(t));
2958
3377
  } catch (r) {
2959
3378
  throw this.debugLog("Error setting delivery", r), this.handleError(r), r;
2960
3379
  } finally {
2961
3380
  this.store.dispatch(N(!1));
2962
3381
  }
2963
3382
  }
2964
- async fetchOrder(e) {
2965
- this.debugLog("Fetching order from server", { orderId: e });
3383
+ async fetchOrder(t) {
3384
+ this.debugLog("Fetching order from server", { orderId: t });
2966
3385
  try {
2967
- const r = await this.sdk.findActiveOrderById({ id: e });
3386
+ const r = await this.sdk.findActiveOrderById({ id: t });
2968
3387
  if (!r?.findOrder) {
2969
3388
  this.debugLog("Order not found"), this.clearOrderFromSession();
2970
3389
  return;
2971
3390
  }
2972
- const s = r.findOrder;
2973
- this.debugLog("Order fetched successfully", s);
2974
- const n = s.items, i = n.filter((c) => c.product != null && c.amount > 0).map((c) => {
2975
- let E = v.PRODUCT;
2976
- return c.product.type === "PROMOTER" ? E = v.ADD_ONS : c.product.type === "PICKUP" ? E = v.PICKUP : c.product.type === "DELIVERY" && (E = v.DELIVERY), {
2977
- id: c.product.id,
2978
- type: E,
2979
- name: c.product.name,
2980
- icon: c.product.icon,
2981
- description: c.product.description,
2982
- amount: c.amount,
2983
- price: c.price ?? 0,
2984
- depositPrice: c.depositPrice ?? 0,
2985
- originalPrice: c.originalPrice ?? 0,
2986
- serviceFee: c.serviceFee ?? 0,
2987
- seats: c.seats?.map((f) => ({
2988
- id: f.id,
2989
- label: f.label
3391
+ const i = r.findOrder;
3392
+ this.debugLog("Order fetched successfully", i);
3393
+ const n = i.items, s = n.filter((d) => d.product != null && d.amount > 0).map((d) => {
3394
+ let A = D.PRODUCT;
3395
+ return d.product.type === "PROMOTER" ? A = D.ADD_ONS : d.product.type === "PICKUP" ? A = D.PICKUP : d.product.type === "DELIVERY" && (A = D.DELIVERY), {
3396
+ id: d.product.id,
3397
+ type: A,
3398
+ name: d.product.name,
3399
+ icon: d.product.icon,
3400
+ description: d.product.description,
3401
+ amount: d.amount,
3402
+ price: d.price ?? 0,
3403
+ depositPrice: d.depositPrice ?? 0,
3404
+ originalPrice: d.originalPrice ?? 0,
3405
+ serviceFee: d.serviceFee ?? 0,
3406
+ seats: d.seats?.map((p) => ({
3407
+ id: p.id,
3408
+ label: p.label
2990
3409
  }))
2991
3410
  };
2992
- }), a = n.filter((c) => c.packageItem != null && c.amount > 0).reduce((c, E) => {
3411
+ }), o = n.filter((d) => d.packageItem != null && d.amount > 0).reduce((d, A) => {
2993
3412
  const {
2994
- packageItem: f,
2995
- event: T,
2996
- amount: g,
2997
- price: y,
2998
- serviceFee: z,
2999
- depositPrice: H,
3000
- originalPrice: Q
3001
- } = E, O = f.package.id;
3002
- c[O] ? (c[O].price += y ?? 0, c[O].serviceFee += z ?? 0, c[O].originalPrice += Q ?? 0, c[O].depositPrice += H ?? y ?? 0) : c[O] = {
3003
- id: O,
3004
- type: v.PACKAGE,
3005
- name: f.package.name,
3006
- amount: g,
3007
- price: y ?? 0,
3008
- serviceFee: z ?? 0,
3009
- depositPrice: H ?? y ?? 0,
3010
- originalPrice: Q ?? 0,
3413
+ packageItem: p,
3414
+ event: O,
3415
+ amount: f,
3416
+ price: m,
3417
+ serviceFee: Q,
3418
+ depositPrice: J,
3419
+ originalPrice: Z
3420
+ } = A, T = p.package.id;
3421
+ d[T] ? (d[T].price += m ?? 0, d[T].serviceFee += Q ?? 0, d[T].originalPrice += Z ?? 0, d[T].depositPrice += J ?? m ?? 0) : d[T] = {
3422
+ id: T,
3423
+ type: D.PACKAGE,
3424
+ name: p.package.name,
3425
+ amount: f,
3426
+ price: m ?? 0,
3427
+ serviceFee: Q ?? 0,
3428
+ depositPrice: J ?? m ?? 0,
3429
+ originalPrice: Z ?? 0,
3011
3430
  packageItems: []
3012
3431
  };
3013
- const xe = x.fromISO(T.startAt, {
3014
- zone: T.timezone
3015
- }), ve = x.fromISO(T.endAt, {
3016
- zone: T.timezone
3432
+ const er = _.fromISO(O.startAt, {
3433
+ zone: O.timezone
3434
+ }), tr = _.fromISO(O.endAt, {
3435
+ zone: O.timezone
3017
3436
  });
3018
- return c[O].packageItems.push({
3019
- packageItemId: f.id,
3020
- eventId: T.id,
3021
- name: T.name,
3022
- startAt: xe,
3023
- endAt: ve
3024
- }), c;
3025
- }, {}), u = [
3026
- ...i,
3027
- ...Object.values(a)
3437
+ return d[T].packageItems.push({
3438
+ packageItemId: p.id,
3439
+ eventId: O.id,
3440
+ name: O.name,
3441
+ startAt: er,
3442
+ endAt: tr
3443
+ }), d;
3444
+ }, {}), c = [
3445
+ ...s,
3446
+ ...Object.values(o)
3028
3447
  ];
3029
- if (u.length === 0) {
3448
+ if (c.length === 0) {
3030
3449
  this.debugLog("All order items have zero or negative amounts, clearing session"), this.clearOrderFromSession();
3031
3450
  return;
3032
3451
  }
3033
- const l = n.filter((c) => c.amount > 0).map((c) => new Date(c.expiredAt).getTime());
3452
+ const l = n.filter((d) => d.amount > 0).map((d) => new Date(d.expiredAt).getTime());
3034
3453
  if (l.length === 0) {
3035
3454
  this.debugLog("No valid items with expiration times, clearing session"), this.clearOrderFromSession();
3036
3455
  return;
3037
3456
  }
3038
- const p = x.fromMillis(Math.min(...l));
3039
- this.store.dispatch(Z()), this.store.dispatch(
3040
- $({
3041
- id: s.id,
3042
- currency: s.currency,
3043
- expiredAt: p.toISO()
3457
+ const h = _.fromMillis(Math.min(...l));
3458
+ this.store.dispatch(ie()), this.store.dispatch(
3459
+ B({
3460
+ id: i.id,
3461
+ currency: i.currency,
3462
+ expiredAt: h.toISO()
3044
3463
  })
3045
- ), u.forEach((c) => {
3046
- c.type === v.PACKAGE ? this.store.dispatch(
3047
- K({
3464
+ ), c.forEach((d) => {
3465
+ d.type === D.PACKAGE ? this.store.dispatch(
3466
+ re({
3048
3467
  input: {
3049
- id: c.id,
3050
- name: c.name,
3051
- currency: s.currency,
3052
- price: c.originalPrice ?? 0,
3053
- depositPrice: c.depositPrice,
3054
- serviceFee: c.serviceFee ?? 0,
3055
- amount: c.amount,
3056
- items: c.packageItems || []
3468
+ id: d.id,
3469
+ name: d.name,
3470
+ currency: i.currency,
3471
+ price: d.originalPrice ?? 0,
3472
+ depositPrice: d.depositPrice,
3473
+ serviceFee: d.serviceFee ?? 0,
3474
+ amount: d.amount,
3475
+ items: d.packageItems || []
3057
3476
  },
3058
- amountReserved: c.amount,
3059
- expiredAt: p.toISO()
3477
+ amountReserved: d.amount,
3478
+ expiredAt: h.toISO()
3060
3479
  })
3061
3480
  ) : this.store.dispatch(
3062
- X({
3481
+ te({
3063
3482
  input: {
3064
- id: c.id,
3065
- name: c.name,
3066
- price: c.originalPrice,
3067
- depositPrice: c.depositPrice,
3068
- serviceFee: c.serviceFee,
3069
- currency: s.currency,
3070
- amount: c.amount
3483
+ id: d.id,
3484
+ name: d.name,
3485
+ price: d.originalPrice,
3486
+ depositPrice: d.depositPrice,
3487
+ serviceFee: d.serviceFee,
3488
+ currency: i.currency,
3489
+ amount: d.amount
3071
3490
  },
3072
- amountReserved: c.amount,
3073
- expiredAt: p.toISO()
3491
+ amountReserved: d.amount,
3492
+ expiredAt: h.toISO()
3074
3493
  })
3075
3494
  );
3076
- }), s.mainBooker && (this.debugLog("Order has customer (mainBooker)", s.mainBooker), this.store.dispatch(
3077
- W({
3078
- firstName: s.mainBooker.firstName ?? void 0,
3079
- lastName: s.mainBooker.lastName ?? void 0,
3080
- email: s.mainBooker.email ?? void 0,
3081
- age: s.mainBooker.age ?? void 0
3495
+ }), i.mainBooker && (this.debugLog("Order has customer (mainBooker)", i.mainBooker), this.store.dispatch(
3496
+ ne({
3497
+ firstName: i.mainBooker.firstName ?? void 0,
3498
+ lastName: i.mainBooker.lastName ?? void 0,
3499
+ email: i.mainBooker.email ?? void 0,
3500
+ age: i.mainBooker.age ?? void 0
3082
3501
  })
3083
3502
  )), this.debugLog("Order state fully synced", this.getState());
3084
3503
  } catch (r) {
3085
3504
  throw this.debugLog("Error fetching order", r), r;
3086
3505
  }
3087
3506
  }
3088
- async createCustomer(e) {
3089
- const s = this.store.getState().basket.order;
3090
- if (!s)
3507
+ async createCustomer(t) {
3508
+ const i = this.store.getState().basket.order;
3509
+ if (!i)
3091
3510
  throw new Error("No active order. Add items to basket first.");
3092
- await this.fetchOrder(s.id);
3511
+ await this.fetchOrder(i.id);
3093
3512
  const n = this.store.getState().basket;
3094
3513
  if (n.order?.customer)
3095
3514
  throw this.debugLog("Order already has a customer after fetching", n.order.customer), new Error("Order already has a customer associated with it.");
3096
3515
  this.debugLog("Creating customer", {
3097
- orderId: s.id,
3098
- email: e.email,
3099
- orderHasItems: s.items.length > 0
3516
+ orderId: i.id,
3517
+ email: t.email,
3518
+ orderHasItems: i.items.length > 0
3100
3519
  });
3101
3520
  try {
3102
- const i = await this.sdk.createOrderCustomer({
3103
- orderId: s.id,
3104
- customer: e
3521
+ const s = await this.sdk.createOrderCustomer({
3522
+ orderId: i.id,
3523
+ customer: t
3105
3524
  });
3106
- this.debugLog("Customer created successfully", i), this.store.dispatch(W(e));
3107
- } catch (i) {
3525
+ this.debugLog("Customer created successfully", s), this.store.dispatch(ne(t));
3526
+ } catch (s) {
3108
3527
  throw this.debugLog("Failed to create customer", {
3109
- error: i.message,
3110
- response: i.response,
3111
- graphQLErrors: i.response?.errors
3112
- }), new Error(`Failed to create customer: ${i.message}`);
3528
+ error: s.message,
3529
+ response: s.response,
3530
+ graphQLErrors: s.response?.errors
3531
+ }), new Error(`Failed to create customer: ${s.message}`);
3113
3532
  }
3114
3533
  }
3115
3534
  async cancelOrder() {
3116
- const e = this.getOrderId();
3117
- e && (this.debugLog("Cancelling order", { orderId: e }), await this.sdk.deleteOrder({ orderId: e }), this.clearOrderFromSession(), this.debugLog("Order cancelled successfully"));
3535
+ const t = this.getOrderId();
3536
+ t && (this.debugLog("Cancelling order", { orderId: t }), await this.sdk.deleteOrder({ orderId: t }), this.clearOrderFromSession(), this.debugLog("Order cancelled successfully"));
3118
3537
  }
3119
3538
  clearOrderFromSession() {
3120
- this.debugLog("Clearing order from session"), sessionStorage.removeItem(this.orderIdKey), this.store.dispatch(Z());
3539
+ this.debugLog("Clearing order from session"), sessionStorage.removeItem(this.orderIdKey), this.store.dispatch(ie());
3121
3540
  }
3122
- handleError(e) {
3123
- const r = e;
3541
+ handleError(t) {
3542
+ const r = t;
3124
3543
  if (r.graphQLErrors && r.graphQLErrors.length > 0) {
3125
- const s = r.graphQLErrors[0];
3126
- s.extensions?.status === "RATE_LIMIT" && console.error("Rate Limit reached"), s.extensions?.status === "SOLD_OUT" && console.error("Product sold out");
3544
+ const i = r.graphQLErrors[0];
3545
+ i.extensions?.status === "RATE_LIMIT" && console.error("Rate Limit reached"), i.extensions?.status === "SOLD_OUT" && console.error("Product sold out");
3127
3546
  }
3128
3547
  if (r.response?.errors && r.response.errors.length > 0) {
3129
- const s = r.response.errors[0];
3130
- console.error("GraphQL Error:", s.message), s.extensions?.code && console.error("Error Code:", s.extensions.code);
3548
+ const i = r.response.errors[0];
3549
+ console.error("GraphQL Error:", i.message), i.extensions?.code && console.error("Error Code:", i.extensions.code);
3131
3550
  }
3132
3551
  }
3133
3552
  }
3553
+ class an {
3554
+ basket;
3555
+ event;
3556
+ payment;
3557
+ package;
3558
+ // Attach all types to the SDK class
3559
+ static Types = Jr;
3560
+ static GraphQL = jr;
3561
+ static EventStore = sr;
3562
+ constructor(t) {
3563
+ const {
3564
+ organizationId: r,
3565
+ shopId: i,
3566
+ shopSlug: n,
3567
+ debug: s = !1,
3568
+ filteredLocationIds: o = [],
3569
+ filteredHostingIds: c = [],
3570
+ enableDoorTickets: l = !1,
3571
+ apiUrl: h
3572
+ } = t;
3573
+ this.basket = new Zt({ shopId: i, shopSlug: n, debug: s, apiUrl: h }), this.event = new Kt({
3574
+ organizationId: r,
3575
+ shopId: i,
3576
+ debug: s,
3577
+ filteredLocationIds: o,
3578
+ filteredHostingIds: c,
3579
+ enableDoorTickets: l,
3580
+ apiUrl: h
3581
+ }), this.payment = new jt({ debug: s, apiUrl: h }), this.package = new Wt({ organizationId: r, debug: s, apiUrl: h });
3582
+ }
3583
+ }
3134
3584
  export {
3135
- v as BasketOrderType,
3136
- jt as BasketService,
3137
- Vt as EventService,
3138
- Ft as PaymentMethodFeeType,
3139
- Gt as PaymentService,
3140
- Lt as ProductType
3585
+ D as BasketOrderType,
3586
+ Zt as BasketService,
3587
+ Kt as EventService,
3588
+ Jt as PackageItemType,
3589
+ Wt as PackageService,
3590
+ Qt as PaymentMethodFeeType,
3591
+ jt as PaymentService,
3592
+ Xt as ProductType,
3593
+ an as TicketappSDK
3141
3594
  };