@clicktap/state 0.13.6 → 0.13.8

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.
Files changed (3) hide show
  1. package/index.js +17 -17
  2. package/index.mjs +535 -532
  3. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { jsx as ze } from "react/jsx-runtime";
2
- import { createContext as Je, useContext as Ye, useState as X, useEffect as Rt, cloneElement as Tn } from "react";
1
+ import { jsx as Ge } from "react/jsx-runtime";
2
+ import { createContext as ze, useContext as Je, useState as Dt, useEffect as Rt, cloneElement as Tn } from "react";
3
3
  function _n(e, t) {
4
4
  for (var n = 0; n < t.length; n++) {
5
5
  const s = t[n];
@@ -37,7 +37,7 @@ const xn = (e) => {
37
37
  const t = Sn();
38
38
  t && t.register(e);
39
39
  };
40
- class ct {
40
+ class at {
41
41
  constructor(t) {
42
42
  this._process = t, this._active = !1, this._current = null, this._last = null;
43
43
  }
@@ -66,13 +66,13 @@ class ct {
66
66
  this._last = null;
67
67
  }
68
68
  }
69
- const Lt = ".", An = "", Mt = "", wn = "#", bn = "*", Pt = "xstate.init", On = "xstate.error", ce = "xstate.stop";
69
+ const Lt = ".", An = "", Mt = "", wn = "#", bn = "*", Pt = "xstate.init", On = "xstate.error", ae = "xstate.stop";
70
70
  function Nn(e, t) {
71
71
  return {
72
72
  type: `xstate.after.${e}.${t}`
73
73
  };
74
74
  }
75
- function Fe(e, t) {
75
+ function qe(e, t) {
76
76
  return {
77
77
  type: `xstate.done.state.${e}`,
78
78
  output: t
@@ -102,7 +102,7 @@ function q(e) {
102
102
  });
103
103
  }
104
104
  const Cn = (() => typeof Symbol == "function" && Symbol.observable || "@@observable")();
105
- function ut(e, t) {
105
+ function ct(e, t) {
106
106
  return `${e.sessionId}.${t}`;
107
107
  }
108
108
  let Dn = 0;
@@ -119,20 +119,20 @@ function Rn(e, t) {
119
119
  delay: v,
120
120
  id: S,
121
121
  startedAt: Date.now()
122
- }, R = ut(h, S);
123
- d._snapshot._scheduledEvents[R] = A;
122
+ }, R = ct(h, S);
123
+ l._snapshot._scheduledEvents[R] = A;
124
124
  const D = a.setTimeout(() => {
125
- delete o[R], delete d._snapshot._scheduledEvents[R], d._relay(h, m, y);
125
+ delete o[R], delete l._snapshot._scheduledEvents[R], l._relay(h, m, y);
126
126
  }, v);
127
127
  o[R] = D;
128
128
  },
129
129
  cancel: (h, m) => {
130
- const y = ut(h, m), v = o[y];
131
- delete o[y], delete d._snapshot._scheduledEvents[y], a.clearTimeout(v);
130
+ const y = ct(h, m), v = o[y];
131
+ delete o[y], delete l._snapshot._scheduledEvents[y], a.clearTimeout(v);
132
132
  },
133
133
  cancelAll: (h) => {
134
- for (const m in d._snapshot._scheduledEvents) {
135
- const y = d._snapshot._scheduledEvents[m];
134
+ for (const m in l._snapshot._scheduledEvents) {
135
+ const y = l._snapshot._scheduledEvents[m];
136
136
  y.source === h && u.cancel(h, y.id);
137
137
  }
138
138
  }
@@ -147,7 +147,7 @@ function Rn(e, t) {
147
147
  var v;
148
148
  return (v = y.next) == null ? void 0 : v.call(y, m);
149
149
  });
150
- }, d = {
150
+ }, l = {
151
151
  _snapshot: {
152
152
  _scheduledEvents: ((t == null ? void 0 : t.snapshot) && t.snapshot.scheduler) ?? {}
153
153
  },
@@ -170,7 +170,7 @@ function Rn(e, t) {
170
170
  },
171
171
  _sendInspectionEvent: f,
172
172
  _relay: (h, m, y) => {
173
- d._sendInspectionEvent({
173
+ l._sendInspectionEvent({
174
174
  type: "@xstate.event",
175
175
  sourceRef: h,
176
176
  actorRef: m,
@@ -180,12 +180,12 @@ function Rn(e, t) {
180
180
  scheduler: u,
181
181
  getSnapshot: () => ({
182
182
  _scheduledEvents: {
183
- ...d._snapshot._scheduledEvents
183
+ ...l._snapshot._scheduledEvents
184
184
  }
185
185
  }),
186
186
  start: () => {
187
- const h = d._snapshot._scheduledEvents;
188
- d._snapshot._scheduledEvents = {};
187
+ const h = l._snapshot._scheduledEvents;
188
+ l._snapshot._scheduledEvents = {};
189
189
  for (const m in h) {
190
190
  const {
191
191
  source: y,
@@ -200,13 +200,13 @@ function Rn(e, t) {
200
200
  _clock: a,
201
201
  _logger: c
202
202
  };
203
- return d;
203
+ return l;
204
204
  }
205
205
  function Ut(e, t) {
206
- const n = dt(e), s = dt(t);
206
+ const n = ut(e), s = ut(t);
207
207
  return typeof s == "string" ? typeof n == "string" ? s === n : !1 : typeof n == "string" ? n in s : Object.keys(n).every((r) => r in s ? Ut(n[r], s[r]) : !1);
208
208
  }
209
- function Xe(e) {
209
+ function Ye(e) {
210
210
  if (jt(e))
211
211
  return e;
212
212
  let t = [], n = "";
@@ -223,12 +223,12 @@ function Xe(e) {
223
223
  }
224
224
  return t.push(n), t;
225
225
  }
226
- function dt(e) {
226
+ function ut(e) {
227
227
  if (ds(e))
228
228
  return e.value;
229
229
  if (typeof e != "string")
230
230
  return e;
231
- const t = Xe(e);
231
+ const t = Ye(e);
232
232
  return Ln(t);
233
233
  }
234
234
  function Ln(e) {
@@ -245,7 +245,7 @@ function Ln(e) {
245
245
  }
246
246
  return t;
247
247
  }
248
- function lt(e, t) {
248
+ function dt(e, t) {
249
249
  const n = {}, s = Object.keys(e);
250
250
  for (let r = 0; r < s.length; r++) {
251
251
  const i = s[r];
@@ -259,7 +259,7 @@ function Bt(e) {
259
259
  function F(e) {
260
260
  return e === void 0 ? [] : Bt(e);
261
261
  }
262
- function Ue(e, t, n, s) {
262
+ function Fe(e, t, n, s) {
263
263
  return typeof e == "function" ? e({
264
264
  context: t,
265
265
  event: n,
@@ -272,7 +272,7 @@ function jt(e) {
272
272
  function Mn(e) {
273
273
  return e.type.startsWith("xstate.error.actor");
274
274
  }
275
- function Q(e) {
275
+ function X(e) {
276
276
  return Bt(e).map((t) => typeof t > "u" || typeof t == "string" ? {
277
277
  target: t
278
278
  } : t);
@@ -281,7 +281,7 @@ function $t(e) {
281
281
  if (!(e === void 0 || e === An))
282
282
  return F(e);
283
283
  }
284
- function ht(e, t, n) {
284
+ function lt(e, t, n) {
285
285
  var i, o, a;
286
286
  const s = typeof e == "object", r = s ? e : void 0;
287
287
  return {
@@ -290,17 +290,17 @@ function ht(e, t, n) {
290
290
  complete: (a = s ? e.complete : n) == null ? void 0 : a.bind(r)
291
291
  };
292
292
  }
293
- function ft(e, t) {
293
+ function ht(e, t) {
294
294
  return `${t}.${e}`;
295
295
  }
296
- function Qe(e, t) {
296
+ function Xe(e, t) {
297
297
  const n = t.match(/^xstate\.invoke\.(\d+)\.(.*)/);
298
298
  if (!n)
299
299
  return e.implementations.actors[t];
300
300
  const [, s, r] = n, o = e.getStateNodeById(r).config.invoke;
301
301
  return (Array.isArray(o) ? o[s] : o).src;
302
302
  }
303
- const We = 1;
303
+ const Qe = 1;
304
304
  let k = /* @__PURE__ */ function(e) {
305
305
  return e[e.NotStarted = 0] = "NotStarted", e[e.Running = 1] = "Running", e[e.Stopped = 2] = "Stopped", e;
306
306
  }({});
@@ -320,7 +320,7 @@ class qn {
320
320
  * @param options Actor options
321
321
  */
322
322
  constructor(t, n) {
323
- this.logic = t, this._snapshot = void 0, this.clock = void 0, this.options = void 0, this.id = void 0, this.mailbox = new ct(this._process.bind(this)), this.observers = /* @__PURE__ */ new Set(), this.eventListeners = /* @__PURE__ */ new Map(), this.logger = void 0, this._processingStatus = k.NotStarted, this._parent = void 0, this._syncSnapshot = void 0, this.ref = void 0, this._actorScope = void 0, this._systemId = void 0, this.sessionId = void 0, this.system = void 0, this._doneEvent = void 0, this.src = void 0, this._deferred = [];
323
+ this.logic = t, this._snapshot = void 0, this.clock = void 0, this.options = void 0, this.id = void 0, this.mailbox = new at(this._process.bind(this)), this.observers = /* @__PURE__ */ new Set(), this.eventListeners = /* @__PURE__ */ new Map(), this.logger = void 0, this._processingStatus = k.NotStarted, this._parent = void 0, this._syncSnapshot = void 0, this.ref = void 0, this._actorScope = void 0, this._systemId = void 0, this.sessionId = void 0, this.system = void 0, this._doneEvent = void 0, this.src = void 0, this._deferred = [];
324
324
  const s = {
325
325
  ...Pn,
326
326
  ...n
@@ -336,25 +336,25 @@ class qn {
336
336
  this.system = o ? o.system : Rn(this, {
337
337
  clock: r,
338
338
  logger: i
339
- }), f && !o && this.system.inspect(ht(f)), this.sessionId = this.system._bookId(), this.id = c ?? this.sessionId, this.logger = (n == null ? void 0 : n.logger) ?? this.system._logger, this.clock = (n == null ? void 0 : n.clock) ?? this.system._clock, this._parent = o, this._syncSnapshot = a, this.options = s, this.src = s.src ?? t, this.ref = this, this._actorScope = {
339
+ }), f && !o && this.system.inspect(lt(f)), this.sessionId = this.system._bookId(), this.id = c ?? this.sessionId, this.logger = (n == null ? void 0 : n.logger) ?? this.system._logger, this.clock = (n == null ? void 0 : n.clock) ?? this.system._clock, this._parent = o, this._syncSnapshot = a, this.options = s, this.src = s.src ?? t, this.ref = this, this._actorScope = {
340
340
  self: this,
341
341
  id: this.id,
342
342
  sessionId: this.sessionId,
343
343
  logger: this.logger,
344
- defer: (d) => {
345
- this._deferred.push(d);
344
+ defer: (l) => {
345
+ this._deferred.push(l);
346
346
  },
347
347
  system: this.system,
348
- stopChild: (d) => {
349
- if (d._parent !== this)
350
- throw new Error(`Cannot stop child actor ${d.id} of ${this.id} because it is not a child`);
351
- d._stop();
348
+ stopChild: (l) => {
349
+ if (l._parent !== this)
350
+ throw new Error(`Cannot stop child actor ${l.id} of ${this.id} because it is not a child`);
351
+ l._stop();
352
352
  },
353
- emit: (d) => {
354
- const h = this.eventListeners.get(d.type);
353
+ emit: (l) => {
354
+ const h = this.eventListeners.get(l.type);
355
355
  if (h)
356
356
  for (const m of Array.from(h))
357
- m(d);
357
+ m(l);
358
358
  }
359
359
  }, this.send = this.send.bind(this), this.system._sendInspectionEvent({
360
360
  type: "@xstate.actor",
@@ -466,7 +466,7 @@ class qn {
466
466
  */
467
467
  subscribe(t, n, s) {
468
468
  var i;
469
- const r = ht(t, n, s);
469
+ const r = lt(t, n, s);
470
470
  if (this._processingStatus !== k.Stopped)
471
471
  this.observers.add(r);
472
472
  else
@@ -567,11 +567,11 @@ class qn {
567
567
  }, this._error(r);
568
568
  return;
569
569
  }
570
- this.update(n, t), t.type === ce && (this._stopProcedure(), this._complete());
570
+ this.update(n, t), t.type === ae && (this._stopProcedure(), this._complete());
571
571
  }
572
572
  _stop() {
573
573
  return this._processingStatus === k.Stopped ? this : (this.mailbox.clear(), this._processingStatus === k.NotStarted ? (this._processingStatus = k.Stopped, this) : (this.mailbox.enqueue({
574
- type: ce
574
+ type: ae
575
575
  }), this));
576
576
  }
577
577
  /**
@@ -618,7 +618,7 @@ class qn {
618
618
  // right now, they are being stopped within the machine's transition
619
619
  // but that could throw and leave us with "orphaned" active actors
620
620
  _stopProcedure() {
621
- return this._processingStatus !== k.Running ? this : (this.system.scheduler.cancelAll(this), this.mailbox.clear(), this.mailbox = new ct(this._process.bind(this)), this._processingStatus = k.Stopped, this.system._unregister(this), this);
621
+ return this._processingStatus !== k.Running ? this : (this.system.scheduler.cancelAll(this), this.mailbox.clear(), this.mailbox = new at(this._process.bind(this)), this._processingStatus = k.Stopped, this.system._unregister(this), this);
622
622
  }
623
623
  /**
624
624
  * @internal
@@ -642,7 +642,7 @@ class qn {
642
642
  }
643
643
  toJSON() {
644
644
  return {
645
- xstate$$type: We,
645
+ xstate$$type: Qe,
646
646
  id: this.id
647
647
  };
648
648
  }
@@ -708,9 +708,9 @@ function jn(e, t, n, s, {
708
708
  input: a,
709
709
  syncSnapshot: c
710
710
  }) {
711
- const u = typeof o == "string" ? Qe(t.machine, o) : o, f = typeof r == "function" ? r(n) : r;
712
- let d;
713
- return u && (d = U(u, {
711
+ const u = typeof o == "string" ? Xe(t.machine, o) : o, f = typeof r == "function" ? r(n) : r;
712
+ let l;
713
+ return u && (l = U(u, {
714
714
  id: f,
715
715
  src: o,
716
716
  parent: e.self,
@@ -724,11 +724,11 @@ function jn(e, t, n, s, {
724
724
  })), [H(t, {
725
725
  children: {
726
726
  ...t.children,
727
- [f]: d
727
+ [f]: l
728
728
  }
729
729
  }), {
730
730
  id: r,
731
- actorRef: d
731
+ actorRef: l
732
732
  }];
733
733
  }
734
734
  function $n(e, {
@@ -776,14 +776,14 @@ function Vt(e) {
776
776
  }
777
777
  return t.type = "xstate.stopChild", t.actorRef = e, t.resolve = Hn, t.execute = Gn, t;
778
778
  }
779
- function Ke(e, t, n, s) {
779
+ function We(e, t, n, s) {
780
780
  const {
781
781
  machine: r
782
782
  } = s, i = typeof e == "function", o = i ? e : r.implementations.guards[typeof e == "string" ? e : e.type];
783
783
  if (!i && !o)
784
784
  throw new Error(`Guard '${typeof e == "string" ? e : e.type}' is not implemented.'.`);
785
785
  if (typeof o != "function")
786
- return Ke(o, t, n, s);
786
+ return We(o, t, n, s);
787
787
  const a = {
788
788
  context: t,
789
789
  event: n
@@ -798,11 +798,11 @@ function Ke(e, t, n, s) {
798
798
  // this holds all params
799
799
  ) : o(a, c);
800
800
  }
801
- const Ze = (e) => e.type === "atomic" || e.type === "final";
802
- function ee(e) {
801
+ const Ke = (e) => e.type === "atomic" || e.type === "final";
802
+ function Z(e) {
803
803
  return Object.values(e.states).filter((t) => t.type !== "history");
804
804
  }
805
- function de(e, t) {
805
+ function ue(e, t) {
806
806
  const n = [];
807
807
  if (t === e)
808
808
  return n;
@@ -811,15 +811,15 @@ function de(e, t) {
811
811
  n.push(s), s = s.parent;
812
812
  return n;
813
813
  }
814
- function Te(e) {
814
+ function ve(e) {
815
815
  const t = new Set(e), n = Gt(t);
816
816
  for (const s of t)
817
817
  if (s.type === "compound" && (!n.get(s) || !n.get(s).length))
818
- pt(s).forEach((r) => t.add(r));
818
+ ft(s).forEach((r) => t.add(r));
819
819
  else if (s.type === "parallel") {
820
- for (const r of ee(s))
820
+ for (const r of Z(s))
821
821
  if (r.type !== "history" && !t.has(r)) {
822
- const i = pt(r);
822
+ const i = ft(r);
823
823
  for (const o of i)
824
824
  t.add(o);
825
825
  }
@@ -838,7 +838,7 @@ function Ht(e, t) {
838
838
  if (e.type === "compound") {
839
839
  const r = n[0];
840
840
  if (r) {
841
- if (Ze(r))
841
+ if (Ke(r))
842
842
  return r.key;
843
843
  } else
844
844
  return {};
@@ -855,13 +855,13 @@ function Gt(e) {
855
855
  return t;
856
856
  }
857
857
  function zt(e, t) {
858
- const n = Te(t);
858
+ const n = ve(t);
859
859
  return Ht(e, Gt(n));
860
860
  }
861
- function et(e, t) {
862
- return t.type === "compound" ? ee(t).some((n) => n.type === "final" && e.has(n)) : t.type === "parallel" ? ee(t).every((n) => et(e, n)) : t.type === "final";
861
+ function Ze(e, t) {
862
+ return t.type === "compound" ? Z(t).some((n) => n.type === "final" && e.has(n)) : t.type === "parallel" ? Z(t).every((n) => Ze(e, n)) : t.type === "final";
863
863
  }
864
- const xe = (e) => e[0] === wn;
864
+ const Se = (e) => e[0] === wn;
865
865
  function zn(e, t) {
866
866
  return e.transitions.get(t) || [...e.transitions.keys()].filter((s) => {
867
867
  if (s === bn)
@@ -933,24 +933,24 @@ function Yn(e) {
933
933
  if (n === Mt)
934
934
  throw new Error('Null events ("") cannot be specified as a transition key. Use `always: { ... }` instead.');
935
935
  const s = e.config.on[n];
936
- t.set(n, Q(s).map((r) => $(e, n, r)));
936
+ t.set(n, X(s).map((r) => $(e, n, r)));
937
937
  }
938
938
  if (e.config.onDone) {
939
939
  const n = `xstate.done.state.${e.id}`;
940
- t.set(n, Q(e.config.onDone).map((s) => $(e, n, s)));
940
+ t.set(n, X(e.config.onDone).map((s) => $(e, n, s)));
941
941
  }
942
942
  for (const n of e.invoke) {
943
943
  if (n.onDone) {
944
944
  const s = `xstate.done.actor.${n.id}`;
945
- t.set(s, Q(n.onDone).map((r) => $(e, s, r)));
945
+ t.set(s, X(n.onDone).map((r) => $(e, s, r)));
946
946
  }
947
947
  if (n.onError) {
948
948
  const s = `xstate.error.actor.${n.id}`;
949
- t.set(s, Q(n.onError).map((r) => $(e, s, r)));
949
+ t.set(s, X(n.onError).map((r) => $(e, s, r)));
950
950
  }
951
951
  if (n.onSnapshot) {
952
952
  const s = `xstate.snapshot.${n.id}`;
953
- t.set(s, Q(n.onSnapshot).map((r) => $(e, s, r)));
953
+ t.set(s, X(n.onSnapshot).map((r) => $(e, s, r)));
954
954
  }
955
955
  }
956
956
  for (const n of e.after) {
@@ -982,15 +982,15 @@ function Qn(e, t) {
982
982
  return t.map((n) => {
983
983
  if (typeof n != "string")
984
984
  return n;
985
- if (xe(n))
985
+ if (Se(n))
986
986
  return e.machine.getStateNodeById(n);
987
987
  const s = n[0] === Lt;
988
988
  if (s && !e.parent)
989
- return _e(e, n.slice(1));
989
+ return Te(e, n.slice(1));
990
990
  const r = s ? e.key + n : n;
991
991
  if (e.parent)
992
992
  try {
993
- return _e(e.parent, r);
993
+ return Te(e.parent, r);
994
994
  } catch (i) {
995
995
  throw new Error(`Invalid transition definition for state node '${e.id}':
996
996
  ${i.message}`);
@@ -1002,16 +1002,16 @@ ${i.message}`);
1002
1002
  function Jt(e) {
1003
1003
  const t = $t(e.config.target);
1004
1004
  return t ? {
1005
- target: t.map((n) => typeof n == "string" ? _e(e.parent, n) : n)
1005
+ target: t.map((n) => typeof n == "string" ? Te(e.parent, n) : n)
1006
1006
  } : e.parent.initial;
1007
1007
  }
1008
1008
  function V(e) {
1009
1009
  return e.type === "history";
1010
1010
  }
1011
- function pt(e) {
1011
+ function ft(e) {
1012
1012
  const t = Yt(e);
1013
1013
  for (const n of t)
1014
- for (const s of de(n, e))
1014
+ for (const s of ue(n, e))
1015
1015
  t.add(s);
1016
1016
  return t;
1017
1017
  }
@@ -1022,14 +1022,14 @@ function Yt(e) {
1022
1022
  if (t.add(s), s.type === "compound")
1023
1023
  n(s.initial.target[0]);
1024
1024
  else if (s.type === "parallel")
1025
- for (const r of ee(s))
1025
+ for (const r of Z(s))
1026
1026
  n(r);
1027
1027
  }
1028
1028
  }
1029
1029
  return n(e), t;
1030
1030
  }
1031
- function te(e, t) {
1032
- if (xe(t))
1031
+ function ee(e, t) {
1032
+ if (Se(t))
1033
1033
  return e.machine.getStateNodeById(t);
1034
1034
  if (!e.states)
1035
1035
  throw new Error(`Unable to retrieve child state '${t}' from '${e.id}'; no child states exist.`);
@@ -1038,44 +1038,44 @@ function te(e, t) {
1038
1038
  throw new Error(`Child state '${t}' does not exist on '${e.id}'`);
1039
1039
  return n;
1040
1040
  }
1041
- function _e(e, t) {
1042
- if (typeof t == "string" && xe(t))
1041
+ function Te(e, t) {
1042
+ if (typeof t == "string" && Se(t))
1043
1043
  try {
1044
1044
  return e.machine.getStateNodeById(t);
1045
1045
  } catch {
1046
1046
  }
1047
- const n = Xe(t).slice();
1047
+ const n = Ye(t).slice();
1048
1048
  let s = e;
1049
1049
  for (; n.length; ) {
1050
1050
  const r = n.shift();
1051
1051
  if (!r.length)
1052
1052
  break;
1053
- s = te(s, r);
1053
+ s = ee(s, r);
1054
1054
  }
1055
1055
  return s;
1056
1056
  }
1057
- function Ie(e, t) {
1057
+ function _e(e, t) {
1058
1058
  if (typeof t == "string") {
1059
1059
  const r = e.states[t];
1060
1060
  if (!r)
1061
1061
  throw new Error(`State '${t}' does not exist on '${e.id}'`);
1062
1062
  return [e, r];
1063
1063
  }
1064
- const n = Object.keys(t), s = n.map((r) => te(e, r)).filter(Boolean);
1064
+ const n = Object.keys(t), s = n.map((r) => ee(e, r)).filter(Boolean);
1065
1065
  return [e.machine.root, e].concat(s, n.reduce((r, i) => {
1066
- const o = te(e, i);
1066
+ const o = ee(e, i);
1067
1067
  if (!o)
1068
1068
  return r;
1069
- const a = Ie(o, t[i]);
1069
+ const a = _e(o, t[i]);
1070
1070
  return r.concat(a);
1071
1071
  }, []));
1072
1072
  }
1073
1073
  function Wn(e, t, n, s) {
1074
- const i = te(e, t).next(n, s);
1074
+ const i = ee(e, t).next(n, s);
1075
1075
  return !i || !i.length ? e.next(n, s) : i;
1076
1076
  }
1077
1077
  function Kn(e, t, n, s) {
1078
- const r = Object.keys(t), i = te(e, r[0]), o = tt(i, t[r[0]], n, s);
1078
+ const r = Object.keys(t), i = ee(e, r[0]), o = et(i, t[r[0]], n, s);
1079
1079
  return !o || !o.length ? e.next(n, s) : o;
1080
1080
  }
1081
1081
  function Zn(e, t, n, s) {
@@ -1084,12 +1084,12 @@ function Zn(e, t, n, s) {
1084
1084
  const o = t[i];
1085
1085
  if (!o)
1086
1086
  continue;
1087
- const a = te(e, i), c = tt(a, o, n, s);
1087
+ const a = ee(e, i), c = et(a, o, n, s);
1088
1088
  c && r.push(...c);
1089
1089
  }
1090
1090
  return r.length ? r : e.next(n, s);
1091
1091
  }
1092
- function tt(e, t, n, s) {
1092
+ function et(e, t, n, s) {
1093
1093
  return typeof t == "string" ? Wn(e, t, n, s) : Object.keys(t).length === 1 ? Kn(e, t, n, s) : Zn(e, t, n, s);
1094
1094
  }
1095
1095
  function es(e) {
@@ -1117,7 +1117,7 @@ function Xt(e, t, n) {
1117
1117
  let i = !1;
1118
1118
  const o = /* @__PURE__ */ new Set();
1119
1119
  for (const a of s)
1120
- if (ts(Be([r], t, n), Be([a], t, n)))
1120
+ if (ts(Ue([r], t, n), Ue([a], t, n)))
1121
1121
  if (B(r.source, a.source))
1122
1122
  o.add(a);
1123
1123
  else {
@@ -1134,11 +1134,11 @@ function Xt(e, t, n) {
1134
1134
  }
1135
1135
  function ns(e) {
1136
1136
  const [t, ...n] = e;
1137
- for (const s of de(t, void 0))
1137
+ for (const s of ue(t, void 0))
1138
1138
  if (n.every((r) => B(r, s)))
1139
1139
  return s;
1140
1140
  }
1141
- function nt(e, t) {
1141
+ function tt(e, t) {
1142
1142
  if (!e.target)
1143
1143
  return [];
1144
1144
  const n = /* @__PURE__ */ new Set();
@@ -1148,14 +1148,14 @@ function nt(e, t) {
1148
1148
  for (const r of t[s.id])
1149
1149
  n.add(r);
1150
1150
  else
1151
- for (const r of nt(Jt(s), t))
1151
+ for (const r of tt(Jt(s), t))
1152
1152
  n.add(r);
1153
1153
  else
1154
1154
  n.add(s);
1155
1155
  return [...n];
1156
1156
  }
1157
1157
  function Qt(e, t) {
1158
- const n = nt(e, t);
1158
+ const n = tt(e, t);
1159
1159
  if (!n)
1160
1160
  return;
1161
1161
  if (!e.reenter && n.every((r) => r === e.source || B(r, e.source)))
@@ -1166,7 +1166,7 @@ function Qt(e, t) {
1166
1166
  if (!e.reenter)
1167
1167
  return e.source.machine.root;
1168
1168
  }
1169
- function Be(e, t, n) {
1169
+ function Ue(e, t, n) {
1170
1170
  var r;
1171
1171
  const s = /* @__PURE__ */ new Set();
1172
1172
  for (const i of e)
@@ -1186,36 +1186,36 @@ function ss(e, t) {
1186
1186
  return !1;
1187
1187
  return !0;
1188
1188
  }
1189
- function je(e, t, n, s, r, i) {
1189
+ function Be(e, t, n, s, r, i) {
1190
1190
  if (!e.length)
1191
1191
  return t;
1192
1192
  const o = new Set(t._nodes);
1193
1193
  let a = t.historyValue;
1194
1194
  const c = Xt(e, o, a);
1195
1195
  let u = t;
1196
- r || ([u, a] = as(u, s, n, c, o, a, i)), u = ne(u, s, n, c.flatMap((d) => d.actions), i), u = is(u, s, n, c, o, i, a, r);
1196
+ r || ([u, a] = as(u, s, n, c, o, a, i)), u = te(u, s, n, c.flatMap((l) => l.actions), i), u = is(u, s, n, c, o, i, a, r);
1197
1197
  const f = [...o];
1198
- u.status === "done" && (u = ne(u, s, n, f.sort((d, h) => h.order - d.order).flatMap((d) => d.exit), i));
1198
+ u.status === "done" && (u = te(u, s, n, f.sort((l, h) => h.order - l.order).flatMap((l) => l.exit), i));
1199
1199
  try {
1200
1200
  return a === t.historyValue && ss(t._nodes, o) ? u : H(u, {
1201
1201
  _nodes: f,
1202
1202
  historyValue: a
1203
1203
  });
1204
- } catch (d) {
1205
- throw d;
1204
+ } catch (l) {
1205
+ throw l;
1206
1206
  }
1207
1207
  }
1208
1208
  function rs(e, t, n, s, r) {
1209
1209
  if (s.output === void 0)
1210
1210
  return;
1211
- const i = Fe(r.id, r.output !== void 0 && r.parent ? Ue(r.output, e.context, t, n.self) : void 0);
1212
- return Ue(s.output, e.context, i, n.self);
1211
+ const i = qe(r.id, r.output !== void 0 && r.parent ? Fe(r.output, e.context, t, n.self) : void 0);
1212
+ return Fe(s.output, e.context, i, n.self);
1213
1213
  }
1214
1214
  function is(e, t, n, s, r, i, o, a) {
1215
1215
  let c = e;
1216
1216
  const u = /* @__PURE__ */ new Set(), f = /* @__PURE__ */ new Set();
1217
1217
  os(s, o, f, u), a && f.add(e.machine.root);
1218
- const d = /* @__PURE__ */ new Set();
1218
+ const l = /* @__PURE__ */ new Set();
1219
1219
  for (const h of [...u].sort((m, y) => m.order - y.order)) {
1220
1220
  r.add(h);
1221
1221
  const m = [];
@@ -1229,11 +1229,11 @@ function is(e, t, n, s, r, i, o, a) {
1229
1229
  const y = h.initial.actions;
1230
1230
  m.push(...y);
1231
1231
  }
1232
- if (c = ne(c, t, n, m, i, h.invoke.map((y) => y.id)), h.type === "final") {
1232
+ if (c = te(c, t, n, m, i, h.invoke.map((y) => y.id)), h.type === "final") {
1233
1233
  const y = h.parent;
1234
1234
  let v = (y == null ? void 0 : y.type) === "parallel" ? y : y == null ? void 0 : y.parent, S = v || h;
1235
- for ((y == null ? void 0 : y.type) === "compound" && i.push(Fe(y.id, h.output !== void 0 ? Ue(h.output, c.context, t, n.self) : void 0)); (v == null ? void 0 : v.type) === "parallel" && !d.has(v) && et(r, v); )
1236
- d.add(v), i.push(Fe(v.id)), S = v, v = v.parent;
1235
+ for ((y == null ? void 0 : y.type) === "compound" && i.push(qe(y.id, h.output !== void 0 ? Fe(h.output, c.context, t, n.self) : void 0)); (v == null ? void 0 : v.type) === "parallel" && !l.has(v) && Ze(r, v); )
1236
+ l.add(v), i.push(qe(v.id)), S = v, v = v.parent;
1237
1237
  if (v)
1238
1238
  continue;
1239
1239
  c = H(c, {
@@ -1252,63 +1252,63 @@ function os(e, t, n, s) {
1252
1252
  (r.source !== a || // we know that the domain can't lie within the source
1253
1253
  // if it's different than the source then it's outside of it and it means that the target has to be entered as well
1254
1254
  r.source !== i || // reentering transitions always enter the target, even if it's the source itself
1255
- r.reenter) && (s.add(a), n.add(a)), W(a, t, n, s);
1256
- const o = nt(r, t);
1255
+ r.reenter) && (s.add(a), n.add(a)), Q(a, t, n, s);
1256
+ const o = tt(r, t);
1257
1257
  for (const a of o) {
1258
- const c = de(a, i);
1258
+ const c = ue(a, i);
1259
1259
  (i == null ? void 0 : i.type) === "parallel" && c.push(i), Wt(s, t, n, c, !r.source.parent && r.reenter ? void 0 : i);
1260
1260
  }
1261
1261
  }
1262
1262
  }
1263
- function W(e, t, n, s) {
1263
+ function Q(e, t, n, s) {
1264
1264
  var r;
1265
1265
  if (V(e))
1266
1266
  if (t[e.id]) {
1267
1267
  const i = t[e.id];
1268
1268
  for (const o of i)
1269
- s.add(o), W(o, t, n, s);
1269
+ s.add(o), Q(o, t, n, s);
1270
1270
  for (const o of i)
1271
- ke(o, e.parent, s, t, n);
1271
+ Ne(o, e.parent, s, t, n);
1272
1272
  } else {
1273
1273
  const i = Jt(e);
1274
1274
  for (const o of i.target)
1275
- s.add(o), i === ((r = e.parent) == null ? void 0 : r.initial) && n.add(e.parent), W(o, t, n, s);
1275
+ s.add(o), i === ((r = e.parent) == null ? void 0 : r.initial) && n.add(e.parent), Q(o, t, n, s);
1276
1276
  for (const o of i.target)
1277
- ke(o, e.parent, s, t, n);
1277
+ Ne(o, e.parent, s, t, n);
1278
1278
  }
1279
1279
  else if (e.type === "compound") {
1280
1280
  const [i] = e.initial.target;
1281
- V(i) || (s.add(i), n.add(i)), W(i, t, n, s), ke(i, e, s, t, n);
1281
+ V(i) || (s.add(i), n.add(i)), Q(i, t, n, s), Ne(i, e, s, t, n);
1282
1282
  } else if (e.type === "parallel")
1283
- for (const i of ee(e).filter((o) => !V(o)))
1284
- [...s].some((o) => B(o, i)) || (V(i) || (s.add(i), n.add(i)), W(i, t, n, s));
1283
+ for (const i of Z(e).filter((o) => !V(o)))
1284
+ [...s].some((o) => B(o, i)) || (V(i) || (s.add(i), n.add(i)), Q(i, t, n, s));
1285
1285
  }
1286
1286
  function Wt(e, t, n, s, r) {
1287
1287
  for (const i of s)
1288
1288
  if ((!r || B(i, r)) && e.add(i), i.type === "parallel")
1289
- for (const o of ee(i).filter((a) => !V(a)))
1290
- [...e].some((a) => B(a, o)) || (e.add(o), W(o, t, n, e));
1289
+ for (const o of Z(i).filter((a) => !V(a)))
1290
+ [...e].some((a) => B(a, o)) || (e.add(o), Q(o, t, n, e));
1291
1291
  }
1292
- function ke(e, t, n, s, r) {
1293
- Wt(n, s, r, de(e, t));
1292
+ function Ne(e, t, n, s, r) {
1293
+ Wt(n, s, r, ue(e, t));
1294
1294
  }
1295
1295
  function as(e, t, n, s, r, i, o) {
1296
1296
  let a = e;
1297
- const c = Be(s, r, i);
1298
- c.sort((f, d) => d.order - f.order);
1297
+ const c = Ue(s, r, i);
1298
+ c.sort((f, l) => l.order - f.order);
1299
1299
  let u;
1300
1300
  for (const f of c)
1301
- for (const d of es(f)) {
1301
+ for (const l of es(f)) {
1302
1302
  let h;
1303
- d.history === "deep" ? h = (m) => Ze(m) && B(m, f) : h = (m) => m.parent === f, u ?? (u = {
1303
+ l.history === "deep" ? h = (m) => Ke(m) && B(m, f) : h = (m) => m.parent === f, u ?? (u = {
1304
1304
  ...i
1305
- }), u[d.id] = Array.from(r).filter(h);
1305
+ }), u[l.id] = Array.from(r).filter(h);
1306
1306
  }
1307
1307
  for (const f of c)
1308
- a = ne(a, t, n, [...f.exit, ...f.invoke.map((d) => Vt(d.id))], o), r.delete(f);
1308
+ a = te(a, t, n, [...f.exit, ...f.invoke.map((l) => Vt(l.id))], o), r.delete(f);
1309
1309
  return [a, u || i];
1310
1310
  }
1311
- let yt = !1;
1311
+ let pt = !1;
1312
1312
  function Kt(e, t, n, s, r, i) {
1313
1313
  const {
1314
1314
  machine: o
@@ -1325,9 +1325,9 @@ function Kt(e, t, n, s, r, i) {
1325
1325
  }
1326
1326
  });
1327
1327
  try {
1328
- yt = f, f(d, h);
1328
+ pt = f, f(l, h);
1329
1329
  } finally {
1330
- yt = !1;
1330
+ pt = !1;
1331
1331
  }
1332
1332
  };
1333
1333
  const u = typeof c == "function", f = u ? c : (
@@ -1338,7 +1338,7 @@ function Kt(e, t, n, s, r, i) {
1338
1338
  );
1339
1339
  if (!f)
1340
1340
  continue;
1341
- const d = {
1341
+ const l = {
1342
1342
  context: a.context,
1343
1343
  event: t,
1344
1344
  self: n.self,
@@ -1356,7 +1356,7 @@ function Kt(e, t, n, s, r, i) {
1356
1356
  const y = f, [v, S, A] = y.resolve(
1357
1357
  n,
1358
1358
  a,
1359
- d,
1359
+ l,
1360
1360
  h,
1361
1361
  f,
1362
1362
  // this holds all params
@@ -1366,7 +1366,7 @@ function Kt(e, t, n, s, r, i) {
1366
1366
  }
1367
1367
  return a;
1368
1368
  }
1369
- function ne(e, t, n, s, r, i) {
1369
+ function te(e, t, n, s, r, i) {
1370
1370
  const o = i ? [] : void 0, a = Kt(e, t, n, s, {
1371
1371
  internalQueue: r,
1372
1372
  deferredActorIds: i
@@ -1375,20 +1375,20 @@ function ne(e, t, n, s, r, i) {
1375
1375
  c.retryResolve(n, a, u);
1376
1376
  }), a;
1377
1377
  }
1378
- function Ce(e, t, n, s = []) {
1378
+ function ke(e, t, n, s = []) {
1379
1379
  let r = e;
1380
1380
  const i = [];
1381
- function o(u, f, d) {
1381
+ function o(u, f, l) {
1382
1382
  n.system._sendInspectionEvent({
1383
1383
  type: "@xstate.microstep",
1384
1384
  actorRef: n.self,
1385
1385
  event: f,
1386
1386
  snapshot: u,
1387
- _transitions: d
1387
+ _transitions: l
1388
1388
  }), i.push(u);
1389
1389
  }
1390
- if (t.type === ce)
1391
- return r = H(mt(r, t, n), {
1390
+ if (t.type === ae)
1391
+ return r = H(yt(r, t, n), {
1392
1392
  status: "stopped"
1393
1393
  }), o(r, t, []), {
1394
1394
  snapshot: r,
@@ -1396,8 +1396,8 @@ function Ce(e, t, n, s = []) {
1396
1396
  };
1397
1397
  let a = t;
1398
1398
  if (a.type !== Pt) {
1399
- const u = a, f = Mn(u), d = gt(u, r);
1400
- if (f && !d.length)
1399
+ const u = a, f = Mn(u), l = mt(u, r);
1400
+ if (f && !l.length)
1401
1401
  return r = H(e, {
1402
1402
  status: "error",
1403
1403
  error: u.error
@@ -1405,15 +1405,15 @@ function Ce(e, t, n, s = []) {
1405
1405
  snapshot: r,
1406
1406
  microstates: i
1407
1407
  };
1408
- r = je(
1409
- d,
1408
+ r = Be(
1409
+ l,
1410
1410
  e,
1411
1411
  n,
1412
1412
  a,
1413
1413
  !1,
1414
1414
  // isInitial
1415
1415
  s
1416
- ), o(r, u, d);
1416
+ ), o(r, u, l);
1417
1417
  }
1418
1418
  let c = !0;
1419
1419
  for (; r.status === "active"; ) {
@@ -1422,29 +1422,29 @@ function Ce(e, t, n, s = []) {
1422
1422
  if (!u.length) {
1423
1423
  if (!s.length)
1424
1424
  break;
1425
- a = s.shift(), u = gt(a, r);
1425
+ a = s.shift(), u = mt(a, r);
1426
1426
  }
1427
- r = je(u, r, n, a, !1, s), c = r !== f, o(r, a, u);
1427
+ r = Be(u, r, n, a, !1, s), c = r !== f, o(r, a, u);
1428
1428
  }
1429
- return r.status !== "active" && mt(r, a, n), {
1429
+ return r.status !== "active" && yt(r, a, n), {
1430
1430
  snapshot: r,
1431
1431
  microstates: i
1432
1432
  };
1433
1433
  }
1434
- function mt(e, t, n) {
1435
- return ne(e, t, n, Object.values(e.children).map((s) => Vt(s)), []);
1434
+ function yt(e, t, n) {
1435
+ return te(e, t, n, Object.values(e.children).map((s) => Vt(s)), []);
1436
1436
  }
1437
- function gt(e, t) {
1437
+ function mt(e, t) {
1438
1438
  return t.machine.getTransitionData(t, e);
1439
1439
  }
1440
1440
  function cs(e, t) {
1441
- const n = /* @__PURE__ */ new Set(), s = e._nodes.filter(Ze);
1441
+ const n = /* @__PURE__ */ new Set(), s = e._nodes.filter(Ke);
1442
1442
  for (const r of s)
1443
1443
  e:
1444
- for (const i of [r].concat(de(r, void 0)))
1444
+ for (const i of [r].concat(ue(r, void 0)))
1445
1445
  if (i.always) {
1446
1446
  for (const o of i.always)
1447
- if (o.guard === void 0 || Ke(o.guard, e.context, t, e)) {
1447
+ if (o.guard === void 0 || We(o.guard, e.context, t, e)) {
1448
1448
  n.add(o);
1449
1449
  break e;
1450
1450
  }
@@ -1452,7 +1452,7 @@ function cs(e, t) {
1452
1452
  return Xt(Array.from(n), new Set(e._nodes), e.historyValue);
1453
1453
  }
1454
1454
  function us(e, t) {
1455
- const n = Te(Ie(e, t));
1455
+ const n = ve(_e(e, t));
1456
1456
  return zt(e, [...n]);
1457
1457
  }
1458
1458
  function ds(e) {
@@ -1485,7 +1485,7 @@ const ls = function(t) {
1485
1485
  }, ys = function() {
1486
1486
  return this._nodes.reduce((t, n) => (n.meta !== void 0 && (t[n.id] = n.meta), t), {});
1487
1487
  };
1488
- function me(e, t) {
1488
+ function ye(e, t) {
1489
1489
  return {
1490
1490
  status: e.status,
1491
1491
  output: e.output,
@@ -1505,7 +1505,7 @@ function me(e, t) {
1505
1505
  };
1506
1506
  }
1507
1507
  function H(e, t = {}) {
1508
- return me({
1508
+ return ye({
1509
1509
  ...e,
1510
1510
  ...t
1511
1511
  }, e.machine);
@@ -1521,7 +1521,7 @@ function ms(e, t) {
1521
1521
  hasTag: c,
1522
1522
  matches: u,
1523
1523
  getMeta: f,
1524
- toJSON: d,
1524
+ toJSON: l,
1525
1525
  ...h
1526
1526
  } = e, m = {};
1527
1527
  for (const v in i) {
@@ -1548,7 +1548,7 @@ function Zt(e) {
1548
1548
  t ?? (t = Array.isArray(e) ? e.slice() : {
1549
1549
  ...e
1550
1550
  }), t[n] = {
1551
- xstate$$type: We,
1551
+ xstate$$type: Qe,
1552
1552
  id: s.id
1553
1553
  };
1554
1554
  else {
@@ -1573,8 +1573,8 @@ function gs(e, t, n, s, {
1573
1573
  const u = typeof r == "function" ? r(n, s) : r;
1574
1574
  let f;
1575
1575
  if (typeof o == "string") {
1576
- const d = c && c[o];
1577
- f = typeof d == "function" ? d(n, s) : d;
1576
+ const l = c && c[o];
1577
+ f = typeof l == "function" ? l(n, s) : l;
1578
1578
  } else
1579
1579
  f = typeof o == "function" ? o(n, s) : o;
1580
1580
  return typeof f != "number" && a.push(u), [t, {
@@ -1602,7 +1602,7 @@ function vs(e, t) {
1602
1602
  }
1603
1603
  return n.type = "xstate.raise", n.event = e, n.id = t == null ? void 0 : t.id, n.delay = t == null ? void 0 : t.delay, n.resolve = gs, n.execute = Es, n;
1604
1604
  }
1605
- const Et = /* @__PURE__ */ new WeakMap();
1605
+ const gt = /* @__PURE__ */ new WeakMap();
1606
1606
  function Ts(e) {
1607
1607
  return {
1608
1608
  config: e,
@@ -1614,7 +1614,7 @@ function Ts(e) {
1614
1614
  receivers: void 0,
1615
1615
  dispose: void 0
1616
1616
  };
1617
- Et.set(r, o), o.dispose = e({
1617
+ gt.set(r, o), o.dispose = e({
1618
1618
  input: n.input,
1619
1619
  system: i,
1620
1620
  self: r,
@@ -1628,8 +1628,8 @@ function Ts(e) {
1628
1628
  },
1629
1629
  transition: (n, s, r) => {
1630
1630
  var o, a;
1631
- const i = Et.get(r.self);
1632
- return s.type === ce ? (n = {
1631
+ const i = gt.get(r.self);
1632
+ return s.type === ae ? (n = {
1633
1633
  ...n,
1634
1634
  status: "stopped",
1635
1635
  error: void 0
@@ -1645,8 +1645,8 @@ function Ts(e) {
1645
1645
  restoreSnapshot: (n) => n
1646
1646
  };
1647
1647
  }
1648
- const vt = "xstate.promise.resolve", Tt = "xstate.promise.reject", pe = /* @__PURE__ */ new WeakMap();
1649
- function Z(e) {
1648
+ const Et = "xstate.promise.resolve", vt = "xstate.promise.reject", fe = /* @__PURE__ */ new WeakMap();
1649
+ function K(e) {
1650
1650
  return {
1651
1651
  config: e,
1652
1652
  transition: (n, s, r) => {
@@ -1654,7 +1654,7 @@ function Z(e) {
1654
1654
  if (n.status !== "active")
1655
1655
  return n;
1656
1656
  switch (s.type) {
1657
- case vt: {
1657
+ case Et: {
1658
1658
  const o = s.data;
1659
1659
  return {
1660
1660
  ...n,
@@ -1663,15 +1663,15 @@ function Z(e) {
1663
1663
  input: void 0
1664
1664
  };
1665
1665
  }
1666
- case Tt:
1666
+ case vt:
1667
1667
  return {
1668
1668
  ...n,
1669
1669
  status: "error",
1670
1670
  error: s.data,
1671
1671
  input: void 0
1672
1672
  };
1673
- case ce:
1674
- return (i = pe.get(r.self)) == null || i.abort(), {
1673
+ case ae:
1674
+ return (i = fe.get(r.self)) == null || i.abort(), {
1675
1675
  ...n,
1676
1676
  status: "stopped",
1677
1677
  input: void 0
@@ -1687,19 +1687,19 @@ function Z(e) {
1687
1687
  if (n.status !== "active")
1688
1688
  return;
1689
1689
  const i = new AbortController();
1690
- pe.set(s, i), Promise.resolve(e({
1690
+ fe.set(s, i), Promise.resolve(e({
1691
1691
  input: n.input,
1692
1692
  system: r,
1693
1693
  self: s,
1694
1694
  signal: i.signal
1695
1695
  })).then((a) => {
1696
- s.getSnapshot().status === "active" && (pe.delete(s), r._relay(s, s, {
1697
- type: vt,
1696
+ s.getSnapshot().status === "active" && (fe.delete(s), r._relay(s, s, {
1697
+ type: Et,
1698
1698
  data: a
1699
1699
  }));
1700
1700
  }, (a) => {
1701
- s.getSnapshot().status === "active" && (pe.delete(s), r._relay(s, s, {
1702
- type: Tt,
1701
+ s.getSnapshot().status === "active" && (fe.delete(s), r._relay(s, s, {
1702
+ type: vt,
1703
1703
  data: a
1704
1704
  }));
1705
1705
  });
@@ -1724,10 +1724,10 @@ function _s(e, {
1724
1724
  input: u
1725
1725
  } = a;
1726
1726
  if (typeof o == "string") {
1727
- const f = Qe(t, o);
1727
+ const f = Xe(t, o);
1728
1728
  if (!f)
1729
1729
  throw new Error(`Actor logic '${o}' not implemented in machine '${t.id}'`);
1730
- const d = U(f, {
1730
+ const l = U(f, {
1731
1731
  id: a.id,
1732
1732
  parent: e.self,
1733
1733
  syncSnapshot: a.syncSnapshot,
@@ -1739,7 +1739,7 @@ function _s(e, {
1739
1739
  src: o,
1740
1740
  systemId: c
1741
1741
  });
1742
- return r[d.id] = d, d;
1742
+ return r[l.id] = l, l;
1743
1743
  } else
1744
1744
  return U(o, {
1745
1745
  id: a.id,
@@ -1791,7 +1791,7 @@ function C(e) {
1791
1791
  }
1792
1792
  return t.type = "xstate.assign", t.assignment = e, t.resolve = Is, t;
1793
1793
  }
1794
- let _t = /* @__PURE__ */ function(e) {
1794
+ let Tt = /* @__PURE__ */ function(e) {
1795
1795
  return e.Parent = "#_parent", e.Internal = "#_internal", e;
1796
1796
  }({});
1797
1797
  function Ss(e, t, n, s, {
@@ -1805,16 +1805,16 @@ function Ss(e, t, n, s, {
1805
1805
  if (typeof i == "string")
1806
1806
  throw new Error(`Only event objects may be used with sendTo; use sendTo({ type: "${i}" }) instead`);
1807
1807
  const f = typeof i == "function" ? i(n, s) : i;
1808
- let d;
1808
+ let l;
1809
1809
  if (typeof a == "string") {
1810
1810
  const v = u && u[a];
1811
- d = typeof v == "function" ? v(n, s) : v;
1811
+ l = typeof v == "function" ? v(n, s) : v;
1812
1812
  } else
1813
- d = typeof a == "function" ? a(n, s) : a;
1813
+ l = typeof a == "function" ? a(n, s) : a;
1814
1814
  const h = typeof r == "function" ? r(n, s) : r;
1815
1815
  let m;
1816
1816
  if (typeof h == "string") {
1817
- if (h === _t.Parent ? m = e.self._parent : h === _t.Internal ? m = e.self : h.startsWith("#_") ? m = t.children[h.slice(2)] : m = (y = c.deferredActorIds) != null && y.includes(h) ? h : t.children[h], !m)
1817
+ if (h === Tt.Parent ? m = e.self._parent : h === Tt.Internal ? m = e.self : h.startsWith("#_") ? m = t.children[h.slice(2)] : m = (y = c.deferredActorIds) != null && y.includes(h) ? h : t.children[h], !m)
1818
1818
  throw new Error(`Unable to send event to actor '${h}' from machine '${t.machine.id}'.`);
1819
1819
  } else
1820
1820
  m = h || e.self;
@@ -1822,7 +1822,7 @@ function Ss(e, t, n, s, {
1822
1822
  to: m,
1823
1823
  event: f,
1824
1824
  id: o,
1825
- delay: d
1825
+ delay: l
1826
1826
  }];
1827
1827
  }
1828
1828
  function xs(e, t, n) {
@@ -1849,28 +1849,28 @@ function As(e, t) {
1849
1849
  );
1850
1850
  });
1851
1851
  }
1852
- function It(e, t, n) {
1852
+ function _t(e, t, n) {
1853
1853
  function s(r, i) {
1854
1854
  }
1855
1855
  return s.type = "xsnapshot.sendTo", s.to = e, s.event = t, s.id = n == null ? void 0 : n.id, s.delay = n == null ? void 0 : n.delay, s.resolve = Ss, s.retryResolve = xs, s.execute = As, s;
1856
1856
  }
1857
- const St = /* @__PURE__ */ new WeakMap();
1857
+ const It = /* @__PURE__ */ new WeakMap();
1858
1858
  function J(e, t, n) {
1859
- let s = St.get(e);
1859
+ let s = It.get(e);
1860
1860
  return s ? t in s || (s[t] = n()) : (s = {
1861
1861
  [t]: n()
1862
- }, St.set(e, s)), s[t];
1862
+ }, It.set(e, s)), s[t];
1863
1863
  }
1864
- const ws = {}, ie = (e) => typeof e == "string" ? {
1864
+ const ws = {}, re = (e) => typeof e == "string" ? {
1865
1865
  type: e
1866
1866
  } : typeof e == "function" ? "resolve" in e ? {
1867
1867
  type: e.type
1868
1868
  } : {
1869
1869
  type: e.name
1870
1870
  } : e;
1871
- class st {
1871
+ class nt {
1872
1872
  constructor(t, n) {
1873
- if (this.config = t, this.key = void 0, this.id = void 0, this.type = void 0, this.path = void 0, this.states = void 0, this.history = void 0, this.entry = void 0, this.exit = void 0, this.parent = void 0, this.machine = void 0, this.meta = void 0, this.output = void 0, this.order = -1, this.description = void 0, this.tags = [], this.transitions = void 0, this.always = void 0, this.parent = n._parent, this.key = n._key, this.machine = n._machine, this.path = this.parent ? this.parent.path.concat(this.key) : [], this.id = this.config.id || [this.machine.id, ...this.path].join(Lt), this.type = this.config.type || (this.config.states && Object.keys(this.config.states).length ? "compound" : this.config.history ? "history" : "atomic"), this.description = this.config.description, this.order = this.machine.idMap.size, this.machine.idMap.set(this.id, this), this.states = this.config.states ? lt(this.config.states, (s, r) => new st(s, {
1873
+ if (this.config = t, this.key = void 0, this.id = void 0, this.type = void 0, this.path = void 0, this.states = void 0, this.history = void 0, this.entry = void 0, this.exit = void 0, this.parent = void 0, this.machine = void 0, this.meta = void 0, this.output = void 0, this.order = -1, this.description = void 0, this.tags = [], this.transitions = void 0, this.always = void 0, this.parent = n._parent, this.key = n._key, this.machine = n._machine, this.path = this.parent ? this.parent.path.concat(this.key) : [], this.id = this.config.id || [this.machine.id, ...this.path].join(Lt), this.type = this.config.type || (this.config.states && Object.keys(this.config.states).length ? "compound" : this.config.history ? "history" : "atomic"), this.description = this.config.description, this.order = this.machine.idMap.size, this.machine.idMap.set(this.id, this), this.states = this.config.states ? dt(this.config.states, (s, r) => new nt(s, {
1874
1874
  _parent: this,
1875
1875
  _key: r,
1876
1876
  _machine: this.machine
@@ -1880,7 +1880,7 @@ class st {
1880
1880
  }
1881
1881
  /** @internal */
1882
1882
  _initialize() {
1883
- this.transitions = Yn(this), this.config.always && (this.always = Q(this.config.always).map((t) => $(this, Mt, t))), Object.keys(this.states).forEach((t) => {
1883
+ this.transitions = Yn(this), this.config.always && (this.always = X(this.config.always).map((t) => $(this, Mt, t))), Object.keys(this.states).forEach((t) => {
1884
1884
  this.states[t]._initialize();
1885
1885
  });
1886
1886
  }
@@ -1896,25 +1896,25 @@ class st {
1896
1896
  initial: this.initial ? {
1897
1897
  target: this.initial.target,
1898
1898
  source: this,
1899
- actions: this.initial.actions.map(ie),
1899
+ actions: this.initial.actions.map(re),
1900
1900
  eventType: null,
1901
1901
  reenter: !1,
1902
1902
  toJSON: () => ({
1903
1903
  target: this.initial.target.map((t) => `#${t.id}`),
1904
1904
  source: `#${this.id}`,
1905
- actions: this.initial.actions.map(ie),
1905
+ actions: this.initial.actions.map(re),
1906
1906
  eventType: null
1907
1907
  })
1908
1908
  } : void 0,
1909
1909
  history: this.history,
1910
- states: lt(this.states, (t) => t.definition),
1910
+ states: dt(this.states, (t) => t.definition),
1911
1911
  on: this.on,
1912
1912
  transitions: [...this.transitions.values()].flat().map((t) => ({
1913
1913
  ...t,
1914
- actions: t.actions.map(ie)
1914
+ actions: t.actions.map(re)
1915
1915
  })),
1916
- entry: this.entry.map(ie),
1917
- exit: this.exit.map(ie),
1916
+ entry: this.entry.map(re),
1917
+ exit: this.exit.map(re),
1918
1918
  meta: this.meta,
1919
1919
  order: this.order || -1,
1920
1920
  output: this.output,
@@ -1935,7 +1935,7 @@ class st {
1935
1935
  const {
1936
1936
  src: s,
1937
1937
  systemId: r
1938
- } = t, i = t.id ?? ft(this.id, n), o = typeof s == "string" ? s : `xstate.invoke.${ft(this.id, n)}`;
1938
+ } = t, i = t.id ?? ht(this.id, n), o = typeof s == "string" ? s : `xstate.invoke.${ht(this.id, n)}`;
1939
1939
  return {
1940
1940
  ...t,
1941
1941
  src: o,
@@ -1980,11 +1980,11 @@ class st {
1980
1980
  } = a, u = t.context;
1981
1981
  let f = !1;
1982
1982
  try {
1983
- f = !c || Ke(c, u, n, t);
1984
- } catch (d) {
1983
+ f = !c || We(c, u, n, t);
1984
+ } catch (l) {
1985
1985
  const h = typeof c == "string" ? c : typeof c == "object" ? c.type : void 0;
1986
1986
  throw new Error(`Unable to evaluate guard ${h ? `'${h}' ` : ""}in transition for event '${s}' in state node '${this.id}':
1987
- ${d.message}`);
1987
+ ${l.message}`);
1988
1988
  }
1989
1989
  if (f) {
1990
1990
  r.push(...a.actions), i = a;
@@ -2022,14 +2022,14 @@ ${d.message}`);
2022
2022
  }
2023
2023
  }
2024
2024
  const bs = "#";
2025
- class rt {
2025
+ class st {
2026
2026
  constructor(t, n) {
2027
2027
  this.config = t, this.version = void 0, this.schemas = void 0, this.implementations = void 0, this.__xstatenode = !0, this.idMap = /* @__PURE__ */ new Map(), this.root = void 0, this.id = void 0, this.states = void 0, this.events = void 0, this.__TResolvedTypesMeta = void 0, this.id = t.id || "(machine)", this.implementations = {
2028
2028
  actors: (n == null ? void 0 : n.actors) ?? {},
2029
2029
  actions: (n == null ? void 0 : n.actions) ?? {},
2030
2030
  delays: (n == null ? void 0 : n.delays) ?? {},
2031
2031
  guards: (n == null ? void 0 : n.guards) ?? {}
2032
- }, this.version = this.config.version, this.schemas = this.config.schemas, this.transition = this.transition.bind(this), this.getInitialSnapshot = this.getInitialSnapshot.bind(this), this.getPersistedSnapshot = this.getPersistedSnapshot.bind(this), this.restoreSnapshot = this.restoreSnapshot.bind(this), this.start = this.start.bind(this), this.root = new st(t, {
2032
+ }, this.version = this.config.version, this.schemas = this.config.schemas, this.transition = this.transition.bind(this), this.getInitialSnapshot = this.getInitialSnapshot.bind(this), this.getPersistedSnapshot = this.getPersistedSnapshot.bind(this), this.restoreSnapshot = this.restoreSnapshot.bind(this), this.start = this.start.bind(this), this.root = new nt(t, {
2033
2033
  _key: this.id,
2034
2034
  _machine: this
2035
2035
  }), this.root._initialize(), this.states = this.root.states, this.events = this.root.events;
@@ -2050,7 +2050,7 @@ class rt {
2050
2050
  actors: r,
2051
2051
  delays: i
2052
2052
  } = this.implementations;
2053
- return new rt(this.config, {
2053
+ return new st(this.config, {
2054
2054
  actions: {
2055
2055
  ...n,
2056
2056
  ...t.actions
@@ -2070,12 +2070,12 @@ class rt {
2070
2070
  });
2071
2071
  }
2072
2072
  resolveState(t) {
2073
- const n = us(this.root, t.value), s = Te(Ie(this.root, n));
2074
- return me({
2073
+ const n = us(this.root, t.value), s = ve(_e(this.root, n));
2074
+ return ye({
2075
2075
  _nodes: [...s],
2076
2076
  context: t.context || {},
2077
2077
  children: {},
2078
- status: et(s, this.root) ? "done" : t.status || "active",
2078
+ status: Ze(s, this.root) ? "done" : t.status || "active",
2079
2079
  output: t.output,
2080
2080
  error: t.error,
2081
2081
  historyValue: t.historyValue
@@ -2089,7 +2089,7 @@ class rt {
2089
2089
  * @param event The received event
2090
2090
  */
2091
2091
  transition(t, n, s) {
2092
- return Ce(t, n, s).snapshot;
2092
+ return ke(t, n, s).snapshot;
2093
2093
  }
2094
2094
  /**
2095
2095
  * Determines the next state given the current `state` and `event`.
@@ -2099,10 +2099,10 @@ class rt {
2099
2099
  * @param event The received event
2100
2100
  */
2101
2101
  microstep(t, n, s) {
2102
- return Ce(t, n, s).microstates;
2102
+ return ke(t, n, s).microstates;
2103
2103
  }
2104
2104
  getTransitionData(t, n) {
2105
- return tt(this.root, t.value, t, n) || [];
2105
+ return et(this.root, t.value, t, n) || [];
2106
2106
  }
2107
2107
  /**
2108
2108
  * The initial state _before_ evaluating any microsteps.
@@ -2111,13 +2111,13 @@ class rt {
2111
2111
  getPreInitialState(t, n, s) {
2112
2112
  const {
2113
2113
  context: r
2114
- } = this.config, i = me({
2114
+ } = this.config, i = ye({
2115
2115
  context: typeof r != "function" && r ? r : {},
2116
2116
  _nodes: [this.root],
2117
2117
  children: {},
2118
2118
  status: "active"
2119
2119
  }, this);
2120
- return typeof r == "function" ? ne(i, n, t, [C(({
2120
+ return typeof r == "function" ? te(i, n, t, [C(({
2121
2121
  spawn: a,
2122
2122
  event: c,
2123
2123
  self: u
@@ -2131,7 +2131,7 @@ class rt {
2131
2131
  * Returns the initial `State` instance, with reference to `self` as an `ActorRef`.
2132
2132
  */
2133
2133
  getInitialSnapshot(t, n) {
2134
- const s = Ft(n), r = [], i = this.getPreInitialState(t, s, r), o = je([{
2134
+ const s = Ft(n), r = [], i = this.getPreInitialState(t, s, r), o = Be([{
2135
2135
  target: [...Yt(this.root)],
2136
2136
  source: this.root,
2137
2137
  reenter: !0,
@@ -2141,7 +2141,7 @@ class rt {
2141
2141
  // TODO: fix
2142
2142
  }], i, t, s, !0, r), {
2143
2143
  snapshot: a
2144
- } = Ce(o, s, t, r);
2144
+ } = ke(o, s, t, r);
2145
2145
  return a;
2146
2146
  }
2147
2147
  start(t) {
@@ -2150,10 +2150,10 @@ class rt {
2150
2150
  });
2151
2151
  }
2152
2152
  getStateNodeById(t) {
2153
- const n = Xe(t), s = n.slice(1), r = xe(n[0]) ? n[0].slice(bs.length) : n[0], i = this.idMap.get(r);
2153
+ const n = Ye(t), s = n.slice(1), r = Se(n[0]) ? n[0].slice(bs.length) : n[0], i = this.idMap.get(r);
2154
2154
  if (!i)
2155
2155
  throw new Error(`Child state node '#${r}' does not exist on machine '${this.id}'`);
2156
- return _e(i, s);
2156
+ return Te(i, s);
2157
2157
  }
2158
2158
  get definition() {
2159
2159
  return this.root.definition;
@@ -2167,7 +2167,7 @@ class rt {
2167
2167
  restoreSnapshot(t, n) {
2168
2168
  const s = {}, r = t.children;
2169
2169
  Object.keys(r).forEach((c) => {
2170
- const u = r[c], f = u.snapshot, d = u.src, h = typeof d == "string" ? Qe(this, d) : d;
2170
+ const u = r[c], f = u.snapshot, l = u.src, h = typeof l == "string" ? Xe(this, l) : l;
2171
2171
  if (!h)
2172
2172
  return;
2173
2173
  const m = U(h, {
@@ -2175,28 +2175,28 @@ class rt {
2175
2175
  parent: n.self,
2176
2176
  syncSnapshot: u.syncSnapshot,
2177
2177
  snapshot: f,
2178
- src: d,
2178
+ src: l,
2179
2179
  systemId: u.systemId
2180
2180
  });
2181
2181
  s[c] = m;
2182
2182
  });
2183
- const i = me({
2183
+ const i = ye({
2184
2184
  ...t,
2185
2185
  children: s,
2186
- _nodes: Array.from(Te(Ie(this.root, t.value)))
2186
+ _nodes: Array.from(ve(_e(this.root, t.value)))
2187
2187
  }, this);
2188
2188
  let o = /* @__PURE__ */ new Set();
2189
2189
  function a(c, u) {
2190
2190
  if (!o.has(c)) {
2191
2191
  o.add(c);
2192
2192
  for (let f in c) {
2193
- const d = c[f];
2194
- if (d && typeof d == "object") {
2195
- if ("xstate$$type" in d && d.xstate$$type === We) {
2196
- c[f] = u[d.id];
2193
+ const l = c[f];
2194
+ if (l && typeof l == "object") {
2195
+ if ("xstate$$type" in l && l.xstate$$type === Qe) {
2196
+ c[f] = u[l.id];
2197
2197
  continue;
2198
2198
  }
2199
- a(d, u);
2199
+ a(l, u);
2200
2200
  }
2201
2201
  }
2202
2202
  }
@@ -2205,9 +2205,9 @@ class rt {
2205
2205
  }
2206
2206
  }
2207
2207
  function Os(e, t) {
2208
- return new rt(e, t);
2208
+ return new st(e, t);
2209
2209
  }
2210
- function Ae({
2210
+ function xe({
2211
2211
  schemas: e,
2212
2212
  actors: t,
2213
2213
  actions: n,
@@ -2226,14 +2226,14 @@ function Ae({
2226
2226
  })
2227
2227
  };
2228
2228
  }
2229
- async function De(e, t) {
2229
+ async function Ce(e, t) {
2230
2230
  const n = await fetch(e, t);
2231
2231
  return n.status === 200 ? n.json() : Promise.resolve({
2232
2232
  message: n.statusText,
2233
2233
  success: !1
2234
2234
  });
2235
2235
  }
2236
- const xt = Ae({
2236
+ const St = xe({
2237
2237
  types: {
2238
2238
  context: {},
2239
2239
  events: {},
@@ -2301,13 +2301,13 @@ const xt = Ae({
2301
2301
  // },
2302
2302
  },
2303
2303
  actors: {
2304
- refreshAccessToken: Z(async ({ input: e }) => {
2304
+ refreshAccessToken: K(async ({ input: e }) => {
2305
2305
  let t;
2306
2306
  if (typeof window > "u") {
2307
2307
  if (e.context.refreshToken === "")
2308
2308
  throw new Error("Unauthorized.");
2309
2309
  try {
2310
- const s = await De(
2310
+ const s = await Ce(
2311
2311
  e.context.endpoints.ssrRefresh,
2312
2312
  {
2313
2313
  method: "POST",
@@ -2331,7 +2331,7 @@ const xt = Ae({
2331
2331
  throw console.log(n), new Error("Could not complete refresh request (server)");
2332
2332
  }
2333
2333
  } else {
2334
- t = await De(
2334
+ t = await Ce(
2335
2335
  e.context.endpoints.refresh,
2336
2336
  {
2337
2337
  method: "POST",
@@ -2359,9 +2359,9 @@ const xt = Ae({
2359
2359
  };
2360
2360
  }
2361
2361
  }),
2362
- authenticate: Z(async ({ input: e }) => {
2362
+ authenticate: K(async ({ input: e }) => {
2363
2363
  var s;
2364
- const n = await De(
2364
+ const n = await Ce(
2365
2365
  e.context.endpoints.login,
2366
2366
  {
2367
2367
  method: "POST",
@@ -2388,7 +2388,7 @@ const xt = Ae({
2388
2388
  accessToken: n.accessToken
2389
2389
  };
2390
2390
  }),
2391
- unauthenticate: Z(async ({ input: e }) => (await fetch(e.context.endpoints.logout, {
2391
+ unauthenticate: K(async ({ input: e }) => (await fetch(e.context.endpoints.logout, {
2392
2392
  method: "POST",
2393
2393
  mode: "cors",
2394
2394
  credentials: "include",
@@ -2530,10 +2530,10 @@ const xt = Ae({
2530
2530
  // },
2531
2531
  // },
2532
2532
  }
2533
- }), en = Je(
2533
+ }), en = ze(
2534
2534
  {}
2535
2535
  ), jr = () => {
2536
- const e = Ye(en), [t, n] = X(
2536
+ const e = Je(en), [t, n] = Dt(
2537
2537
  typeof window < "u" && e.getSnapshot().value === "loggedIn"
2538
2538
  );
2539
2539
  return Rt(() => {
@@ -2551,14 +2551,14 @@ const xt = Ae({
2551
2551
  endpoints: { login: "", logout: "", refresh: "", ssrRefresh: "" }
2552
2552
  }) => typeof window < "u" ? (console.warn(
2553
2553
  "App.getInitialProps::getAuth should not be run on the frontend. You are probably missing getServerSideProps in your page."
2554
- ), U(xt, {
2554
+ ), U(St, {
2555
2555
  inspect: t.inspect,
2556
2556
  input: {
2557
2557
  initialContext: {
2558
2558
  endpoints: t.endpoints
2559
2559
  }
2560
2560
  }
2561
- }).start()) : U(xt, {
2561
+ }).start()) : U(St, {
2562
2562
  input: {
2563
2563
  initialContext: {
2564
2564
  endpoints: t.endpoints,
@@ -2568,10 +2568,10 @@ const xt = Ae({
2568
2568
  inspect: t.inspect
2569
2569
  }).start();
2570
2570
  function Vr({ actor: e, children: t }) {
2571
- return /* @__PURE__ */ ze(en.Provider, { value: e, children: t });
2571
+ return /* @__PURE__ */ Ge(en.Provider, { value: e, children: t });
2572
2572
  }
2573
2573
  let Ns = (e = 21) => crypto.getRandomValues(new Uint8Array(e)).reduce((t, n) => (n &= 63, n < 36 ? t += n.toString(36) : n < 62 ? t += (n - 26).toString(36).toUpperCase() : n > 62 ? t += "-" : t += "_", t), "");
2574
- const ks = Ae({
2574
+ const ks = xe({
2575
2575
  actors: {
2576
2576
  tick: Ts(
2577
2577
  ({ sendBack: e, input: t }) => {
@@ -2649,7 +2649,7 @@ const ks = Ae({
2649
2649
  type: "final"
2650
2650
  }
2651
2651
  }
2652
- }), Hr = Ae({
2652
+ }), Hr = xe({
2653
2653
  actors: {
2654
2654
  timer: ks
2655
2655
  },
@@ -2741,11 +2741,11 @@ const ks = Ae({
2741
2741
  target: "idle"
2742
2742
  },
2743
2743
  RESUME_TIMER: {
2744
- actions: It("timer", { type: "RESUME_TIMER" })
2744
+ actions: _t("timer", { type: "RESUME_TIMER" })
2745
2745
  // cond: (context) => context.duration > 0,
2746
2746
  },
2747
2747
  PAUSE_TIMER: {
2748
- actions: It("timer", { type: "PAUSE_TIMER" })
2748
+ actions: _t("timer", { type: "PAUSE_TIMER" })
2749
2749
  // cond: (context) => context.duration > 0,
2750
2750
  }
2751
2751
  }
@@ -2779,12 +2779,12 @@ const ks = Ae({
2779
2779
  }
2780
2780
  }
2781
2781
  }
2782
- }), tn = Je({}), Gr = () => Ye(tn);
2782
+ }), tn = ze({}), Gr = () => Je(tn);
2783
2783
  function zr({
2784
2784
  children: e,
2785
2785
  actor: t
2786
2786
  }) {
2787
- return /* @__PURE__ */ ze(tn.Provider, { value: t, children: e });
2787
+ return /* @__PURE__ */ Ge(tn.Provider, { value: t, children: e });
2788
2788
  }
2789
2789
  function Cs({
2790
2790
  context: e,
@@ -2821,7 +2821,7 @@ function Rs({
2821
2821
  }
2822
2822
  };
2823
2823
  }
2824
- const it = JSON, Ls = (e) => e.toUpperCase(), Ms = (e) => {
2824
+ const rt = JSON, Ls = (e) => e.toUpperCase(), Ms = (e) => {
2825
2825
  const t = {};
2826
2826
  return e.forEach((n, s) => {
2827
2827
  t[s] = n;
@@ -2850,7 +2850,7 @@ const it = JSON, Ls = (e) => e.toUpperCase(), Ms = (e) => {
2850
2850
  signal: void 0
2851
2851
  };
2852
2852
  };
2853
- function ge(e, t) {
2853
+ function me(e, t) {
2854
2854
  if (!!!e)
2855
2855
  throw new Error(t);
2856
2856
  }
@@ -2864,7 +2864,7 @@ function js(e, t) {
2864
2864
  );
2865
2865
  }
2866
2866
  const $s = /\r\n|[\n\r]/g;
2867
- function $e(e, t) {
2867
+ function je(e, t) {
2868
2868
  let n = 0, s = 1;
2869
2869
  for (const r of e.body.matchAll($s)) {
2870
2870
  if (typeof r.index == "number" || js(!1), r.index >= t)
@@ -2879,32 +2879,32 @@ function $e(e, t) {
2879
2879
  function Vs(e) {
2880
2880
  return nn(
2881
2881
  e.source,
2882
- $e(e.source, e.start)
2882
+ je(e.source, e.start)
2883
2883
  );
2884
2884
  }
2885
2885
  function nn(e, t) {
2886
2886
  const n = e.locationOffset.column - 1, s = "".padStart(n) + e.body, r = t.line - 1, i = e.locationOffset.line - 1, o = t.line + i, a = t.line === 1 ? n : 0, c = t.column + a, u = `${e.name}:${o}:${c}
2887
- `, f = s.split(/\r\n|[\n\r]/g), d = f[r];
2888
- if (d.length > 120) {
2887
+ `, f = s.split(/\r\n|[\n\r]/g), l = f[r];
2888
+ if (l.length > 120) {
2889
2889
  const h = Math.floor(c / 80), m = c % 80, y = [];
2890
- for (let v = 0; v < d.length; v += 80)
2891
- y.push(d.slice(v, v + 80));
2892
- return u + At([
2890
+ for (let v = 0; v < l.length; v += 80)
2891
+ y.push(l.slice(v, v + 80));
2892
+ return u + xt([
2893
2893
  [`${o} |`, y[0]],
2894
2894
  ...y.slice(1, h + 1).map((v) => ["|", v]),
2895
2895
  ["|", "^".padStart(m)],
2896
2896
  ["|", y[h + 1]]
2897
2897
  ]);
2898
2898
  }
2899
- return u + At([
2899
+ return u + xt([
2900
2900
  // Lines specified like this: ["prefix", "string"],
2901
2901
  [`${o - 1} |`, f[r - 1]],
2902
- [`${o} |`, d],
2902
+ [`${o} |`, l],
2903
2903
  ["|", "^".padStart(c)],
2904
2904
  [`${o + 1} |`, f[r + 1]]
2905
2905
  ]);
2906
2906
  }
2907
- function At(e) {
2907
+ function xt(e) {
2908
2908
  const t = e.filter(([s, r]) => r !== void 0), n = Math.max(...t.map(([s]) => s.length));
2909
2909
  return t.map(([s, r]) => s.padStart(n) + (r ? " " + r : "")).join(`
2910
2910
  `);
@@ -2920,7 +2920,7 @@ function Hs(e) {
2920
2920
  extensions: e[5]
2921
2921
  } : t;
2922
2922
  }
2923
- class ot extends Error {
2923
+ class it extends Error {
2924
2924
  /**
2925
2925
  * An array of `{ line, column }` locations within the source GraphQL document
2926
2926
  * which correspond to this error.
@@ -2961,18 +2961,18 @@ class ot extends Error {
2961
2961
  */
2962
2962
  constructor(t, ...n) {
2963
2963
  var s, r, i;
2964
- const { nodes: o, source: a, positions: c, path: u, originalError: f, extensions: d } = Hs(n);
2965
- super(t), this.name = "GraphQLError", this.path = u ?? void 0, this.originalError = f ?? void 0, this.nodes = wt(
2964
+ const { nodes: o, source: a, positions: c, path: u, originalError: f, extensions: l } = Hs(n);
2965
+ super(t), this.name = "GraphQLError", this.path = u ?? void 0, this.originalError = f ?? void 0, this.nodes = At(
2966
2966
  Array.isArray(o) ? o : o ? [o] : void 0
2967
2967
  );
2968
- const h = wt(
2968
+ const h = At(
2969
2969
  (s = this.nodes) === null || s === void 0 ? void 0 : s.map((y) => y.loc).filter((y) => y != null)
2970
2970
  );
2971
- this.source = a ?? (h == null || (r = h[0]) === null || r === void 0 ? void 0 : r.source), this.positions = c ?? (h == null ? void 0 : h.map((y) => y.start)), this.locations = c && a ? c.map((y) => $e(a, y)) : h == null ? void 0 : h.map((y) => $e(y.source, y.start));
2971
+ this.source = a ?? (h == null || (r = h[0]) === null || r === void 0 ? void 0 : r.source), this.positions = c ?? (h == null ? void 0 : h.map((y) => y.start)), this.locations = c && a ? c.map((y) => je(a, y)) : h == null ? void 0 : h.map((y) => je(y.source, y.start));
2972
2972
  const m = Bs(
2973
2973
  f == null ? void 0 : f.extensions
2974
2974
  ) ? f == null ? void 0 : f.extensions : void 0;
2975
- this.extensions = (i = d ?? m) !== null && i !== void 0 ? i : /* @__PURE__ */ Object.create(null), Object.defineProperties(this, {
2975
+ this.extensions = (i = l ?? m) !== null && i !== void 0 ? i : /* @__PURE__ */ Object.create(null), Object.defineProperties(this, {
2976
2976
  message: {
2977
2977
  writable: !0,
2978
2978
  enumerable: !0
@@ -2996,7 +2996,7 @@ class ot extends Error {
2996
2996
  value: f.stack,
2997
2997
  writable: !0,
2998
2998
  configurable: !0
2999
- }) : Error.captureStackTrace ? Error.captureStackTrace(this, ot) : Object.defineProperty(this, "stack", {
2999
+ }) : Error.captureStackTrace ? Error.captureStackTrace(this, it) : Object.defineProperty(this, "stack", {
3000
3000
  value: Error().stack,
3001
3001
  writable: !0,
3002
3002
  configurable: !0
@@ -3026,11 +3026,11 @@ class ot extends Error {
3026
3026
  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;
3027
3027
  }
3028
3028
  }
3029
- function wt(e) {
3029
+ function At(e) {
3030
3030
  return e === void 0 || e.length === 0 ? void 0 : e;
3031
3031
  }
3032
3032
  function b(e, t, n) {
3033
- return new ot(`Syntax Error: ${n}`, {
3033
+ return new it(`Syntax Error: ${n}`, {
3034
3034
  source: e,
3035
3035
  positions: [t]
3036
3036
  });
@@ -3181,26 +3181,26 @@ const rn = {
3181
3181
  EnumTypeExtension: ["name", "directives", "values"],
3182
3182
  InputObjectTypeExtension: ["name", "directives", "fields"]
3183
3183
  }, zs = new Set(Object.keys(rn));
3184
- function bt(e) {
3184
+ function wt(e) {
3185
3185
  const t = e == null ? void 0 : e.kind;
3186
3186
  return typeof t == "string" && zs.has(t);
3187
3187
  }
3188
- var K;
3188
+ var W;
3189
3189
  (function(e) {
3190
3190
  e.QUERY = "query", e.MUTATION = "mutation", e.SUBSCRIPTION = "subscription";
3191
- })(K || (K = {}));
3192
- var Ve;
3191
+ })(W || (W = {}));
3192
+ var $e;
3193
3193
  (function(e) {
3194
3194
  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";
3195
- })(Ve || (Ve = {}));
3195
+ })($e || ($e = {}));
3196
3196
  var T;
3197
3197
  (function(e) {
3198
3198
  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";
3199
3199
  })(T || (T = {}));
3200
- function He(e) {
3200
+ function Ve(e) {
3201
3201
  return e === 9 || e === 32;
3202
3202
  }
3203
- function ue(e) {
3203
+ function ce(e) {
3204
3204
  return e >= 48 && e <= 57;
3205
3205
  }
3206
3206
  function on(e) {
@@ -3211,7 +3211,7 @@ function an(e) {
3211
3211
  return on(e) || e === 95;
3212
3212
  }
3213
3213
  function Js(e) {
3214
- return on(e) || ue(e) || e === 95;
3214
+ return on(e) || ce(e) || e === 95;
3215
3215
  }
3216
3216
  function Ys(e) {
3217
3217
  var t;
@@ -3228,18 +3228,18 @@ function Ys(e) {
3228
3228
  }
3229
3229
  function Xs(e) {
3230
3230
  let t = 0;
3231
- for (; t < e.length && He(e.charCodeAt(t)); )
3231
+ for (; t < e.length && Ve(e.charCodeAt(t)); )
3232
3232
  ++t;
3233
3233
  return t;
3234
3234
  }
3235
3235
  function Qs(e, t) {
3236
- const n = e.replace(/"""/g, '\\"""'), s = n.split(/\r\n|[\n\r]/g), r = s.length === 1, i = s.length > 1 && s.slice(1).every((m) => m.length === 0 || He(m.charCodeAt(0))), o = n.endsWith('\\"""'), a = e.endsWith('"') && !o, c = e.endsWith("\\"), u = a || c, f = !(t != null && t.minimize) && // add leading and trailing new lines only if it improves readability
3236
+ const n = e.replace(/"""/g, '\\"""'), s = n.split(/\r\n|[\n\r]/g), r = s.length === 1, i = s.length > 1 && s.slice(1).every((m) => m.length === 0 || Ve(m.charCodeAt(0))), o = n.endsWith('\\"""'), a = e.endsWith('"') && !o, c = e.endsWith("\\"), u = a || c, f = !(t != null && t.minimize) && // add leading and trailing new lines only if it improves readability
3237
3237
  (!r || e.length > 70 || u || i || o);
3238
- let d = "";
3239
- const h = r && He(e.charCodeAt(0));
3240
- return (f && !h || i) && (d += `
3241
- `), d += n, (f || u) && (d += `
3242
- `), '"""' + d + '"""';
3238
+ let l = "";
3239
+ const h = r && Ve(e.charCodeAt(0));
3240
+ return (f && !h || i) && (l += `
3241
+ `), l += n, (f || u) && (l += `
3242
+ `), '"""' + l + '"""';
3243
3243
  }
3244
3244
  var p;
3245
3245
  (function(e) {
@@ -3292,10 +3292,10 @@ class Ws {
3292
3292
  function Ks(e) {
3293
3293
  return e === p.BANG || e === p.DOLLAR || e === p.AMP || e === p.PAREN_L || e === p.PAREN_R || e === p.SPREAD || e === p.COLON || e === p.EQUALS || e === p.AT || e === p.BRACKET_L || e === p.BRACKET_R || e === p.BRACE_L || e === p.PIPE || e === p.BRACE_R;
3294
3294
  }
3295
- function se(e) {
3295
+ function ne(e) {
3296
3296
  return e >= 0 && e <= 55295 || e >= 57344 && e <= 1114111;
3297
3297
  }
3298
- function we(e, t) {
3298
+ function Ae(e, t) {
3299
3299
  return cn(e.charCodeAt(t)) && un(e.charCodeAt(t + 1));
3300
3300
  }
3301
3301
  function cn(e) {
@@ -3371,14 +3371,14 @@ function Zs(e, t) {
3371
3371
  case 34:
3372
3372
  return n.charCodeAt(r + 1) === 34 && n.charCodeAt(r + 2) === 34 ? or(e, r) : nr(e, r);
3373
3373
  }
3374
- if (ue(i) || i === 45)
3374
+ if (ce(i) || i === 45)
3375
3375
  return tr(e, r, i);
3376
3376
  if (an(i))
3377
3377
  return ar(e, r);
3378
3378
  throw b(
3379
3379
  e.source,
3380
3380
  r,
3381
- i === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : se(i) || we(n, r) ? `Unexpected character: ${G(e, r)}.` : `Invalid character: ${G(e, r)}.`
3381
+ i === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : ne(i) || Ae(n, r) ? `Unexpected character: ${G(e, r)}.` : `Invalid character: ${G(e, r)}.`
3382
3382
  );
3383
3383
  }
3384
3384
  return w(e, p.EOF, s, s);
@@ -3390,9 +3390,9 @@ function er(e, t) {
3390
3390
  const i = n.charCodeAt(r);
3391
3391
  if (i === 10 || i === 13)
3392
3392
  break;
3393
- if (se(i))
3393
+ if (ne(i))
3394
3394
  ++r;
3395
- else if (we(n, r))
3395
+ else if (Ae(n, r))
3396
3396
  r += 2;
3397
3397
  else
3398
3398
  break;
@@ -3409,7 +3409,7 @@ function tr(e, t, n) {
3409
3409
  const s = e.source.body;
3410
3410
  let r = t, i = n, o = !1;
3411
3411
  if (i === 45 && (i = s.charCodeAt(++r)), i === 48) {
3412
- if (i = s.charCodeAt(++r), ue(i))
3412
+ if (i = s.charCodeAt(++r), ce(i))
3413
3413
  throw b(
3414
3414
  e.source,
3415
3415
  r,
@@ -3419,8 +3419,8 @@ function tr(e, t, n) {
3419
3419
  )}.`
3420
3420
  );
3421
3421
  } else
3422
- r = Re(e, r, i), i = s.charCodeAt(r);
3423
- if (i === 46 && (o = !0, i = s.charCodeAt(++r), r = Re(e, r, i), i = s.charCodeAt(r)), (i === 69 || i === 101) && (o = !0, i = s.charCodeAt(++r), (i === 43 || i === 45) && (i = s.charCodeAt(++r)), r = Re(e, r, i), i = s.charCodeAt(r)), i === 46 || an(i))
3422
+ r = De(e, r, i), i = s.charCodeAt(r);
3423
+ if (i === 46 && (o = !0, i = s.charCodeAt(++r), r = De(e, r, i), i = s.charCodeAt(r)), (i === 69 || i === 101) && (o = !0, i = s.charCodeAt(++r), (i === 43 || i === 45) && (i = s.charCodeAt(++r)), r = De(e, r, i), i = s.charCodeAt(r)), i === 46 || an(i))
3424
3424
  throw b(
3425
3425
  e.source,
3426
3426
  r,
@@ -3437,8 +3437,8 @@ function tr(e, t, n) {
3437
3437
  s.slice(t, r)
3438
3438
  );
3439
3439
  }
3440
- function Re(e, t, n) {
3441
- if (!ue(n))
3440
+ function De(e, t, n) {
3441
+ if (!ce(n))
3442
3442
  throw b(
3443
3443
  e.source,
3444
3444
  t,
@@ -3449,7 +3449,7 @@ function Re(e, t, n) {
3449
3449
  );
3450
3450
  const s = e.source.body;
3451
3451
  let r = t + 1;
3452
- for (; ue(s.charCodeAt(r)); )
3452
+ for (; ce(s.charCodeAt(r)); )
3453
3453
  ++r;
3454
3454
  return r;
3455
3455
  }
@@ -3468,9 +3468,9 @@ function nr(e, t) {
3468
3468
  }
3469
3469
  if (a === 10 || a === 13)
3470
3470
  break;
3471
- if (se(a))
3471
+ if (ne(a))
3472
3472
  ++r;
3473
- else if (we(n, r))
3473
+ else if (Ae(n, r))
3474
3474
  r += 2;
3475
3475
  else
3476
3476
  throw b(
@@ -3490,14 +3490,14 @@ function sr(e, t) {
3490
3490
  for (; r < 12; ) {
3491
3491
  const i = n.charCodeAt(t + r++);
3492
3492
  if (i === 125) {
3493
- if (r < 5 || !se(s))
3493
+ if (r < 5 || !ne(s))
3494
3494
  break;
3495
3495
  return {
3496
3496
  value: String.fromCodePoint(s),
3497
3497
  size: r
3498
3498
  };
3499
3499
  }
3500
- if (s = s << 4 | oe(i), s < 0)
3500
+ if (s = s << 4 | ie(i), s < 0)
3501
3501
  break;
3502
3502
  }
3503
3503
  throw b(
@@ -3510,14 +3510,14 @@ function sr(e, t) {
3510
3510
  );
3511
3511
  }
3512
3512
  function rr(e, t) {
3513
- const n = e.source.body, s = Ot(n, t + 2);
3514
- if (se(s))
3513
+ const n = e.source.body, s = bt(n, t + 2);
3514
+ if (ne(s))
3515
3515
  return {
3516
3516
  value: String.fromCodePoint(s),
3517
3517
  size: 6
3518
3518
  };
3519
3519
  if (cn(s) && n.charCodeAt(t + 6) === 92 && n.charCodeAt(t + 7) === 117) {
3520
- const r = Ot(n, t + 8);
3520
+ const r = bt(n, t + 8);
3521
3521
  if (un(r))
3522
3522
  return {
3523
3523
  value: String.fromCodePoint(s, r),
@@ -3530,10 +3530,10 @@ function rr(e, t) {
3530
3530
  `Invalid Unicode escape sequence: "${n.slice(t, t + 6)}".`
3531
3531
  );
3532
3532
  }
3533
- function Ot(e, t) {
3534
- return oe(e.charCodeAt(t)) << 12 | oe(e.charCodeAt(t + 1)) << 8 | oe(e.charCodeAt(t + 2)) << 4 | oe(e.charCodeAt(t + 3));
3533
+ function bt(e, t) {
3534
+ return ie(e.charCodeAt(t)) << 12 | ie(e.charCodeAt(t + 1)) << 8 | ie(e.charCodeAt(t + 2)) << 4 | ie(e.charCodeAt(t + 3));
3535
3535
  }
3536
- function oe(e) {
3536
+ function ie(e) {
3537
3537
  return e >= 48 && e <= 57 ? e - 48 : e >= 65 && e <= 70 ? e - 55 : e >= 97 && e <= 102 ? e - 87 : -1;
3538
3538
  }
3539
3539
  function ir(e, t) {
@@ -3617,9 +3617,9 @@ function or(e, t) {
3617
3617
  a += n.slice(o, i), c.push(a), u === 13 && n.charCodeAt(i + 1) === 10 ? i += 2 : ++i, a = "", o = i, r = i;
3618
3618
  continue;
3619
3619
  }
3620
- if (se(u))
3620
+ if (ne(u))
3621
3621
  ++i;
3622
- else if (we(n, i))
3622
+ else if (Ae(n, i))
3623
3623
  i += 2;
3624
3624
  else
3625
3625
  throw b(
@@ -3652,10 +3652,10 @@ function ar(e, t) {
3652
3652
  );
3653
3653
  }
3654
3654
  const cr = 10, dn = 2;
3655
- function at(e) {
3656
- return be(e, []);
3655
+ function ot(e) {
3656
+ return we(e, []);
3657
3657
  }
3658
- function be(e, t) {
3658
+ function we(e, t) {
3659
3659
  switch (typeof e) {
3660
3660
  case "string":
3661
3661
  return JSON.stringify(e);
@@ -3676,7 +3676,7 @@ function ur(e, t) {
3676
3676
  if (dr(e)) {
3677
3677
  const s = e.toJSON();
3678
3678
  if (s !== e)
3679
- return typeof s == "string" ? s : be(s, n);
3679
+ return typeof s == "string" ? s : we(s, n);
3680
3680
  } else if (Array.isArray(e))
3681
3681
  return hr(e, n);
3682
3682
  return lr(e, n);
@@ -3687,7 +3687,7 @@ function dr(e) {
3687
3687
  function lr(e, t) {
3688
3688
  const n = Object.entries(e);
3689
3689
  return n.length === 0 ? "{}" : t.length > dn ? "[" + fr(e) + "]" : "{ " + n.map(
3690
- ([r, i]) => r + ": " + be(i, t)
3690
+ ([r, i]) => r + ": " + we(i, t)
3691
3691
  ).join(", ") + " }";
3692
3692
  }
3693
3693
  function hr(e, t) {
@@ -3697,7 +3697,7 @@ function hr(e, t) {
3697
3697
  return "[Array]";
3698
3698
  const n = Math.min(cr, e.length), s = e.length - n, r = [];
3699
3699
  for (let i = 0; i < n; ++i)
3700
- r.push(be(e[i], t));
3700
+ r.push(we(e[i], t));
3701
3701
  return s === 1 ? r.push("... 1 more item") : s > 1 && r.push(`... ${s} more items`), "[" + r.join(", ") + "]";
3702
3702
  }
3703
3703
  function fr(e) {
@@ -3724,7 +3724,7 @@ const pr = (
3724
3724
  Symbol.toStringTag in t ? t[Symbol.toStringTag] : (s = t.constructor) === null || s === void 0 ? void 0 : s.name
3725
3725
  );
3726
3726
  if (r === i) {
3727
- const o = at(t);
3727
+ const o = ot(t);
3728
3728
  throw new Error(`Cannot use ${r} "${o}" from another module or realm.
3729
3729
 
3730
3730
  Ensure that there is only one instance of "graphql" in the node_modules
@@ -3747,10 +3747,10 @@ class ln {
3747
3747
  line: 1,
3748
3748
  column: 1
3749
3749
  }) {
3750
- typeof t == "string" || ge(!1, `Body must be a string. Received: ${at(t)}.`), this.body = t, this.name = n, this.locationOffset = s, this.locationOffset.line > 0 || ge(
3750
+ typeof t == "string" || me(!1, `Body must be a string. Received: ${ot(t)}.`), this.body = t, this.name = n, this.locationOffset = s, this.locationOffset.line > 0 || me(
3751
3751
  !1,
3752
3752
  "line in locationOffset is 1-indexed and must be positive."
3753
- ), this.locationOffset.column > 0 || ge(
3753
+ ), this.locationOffset.column > 0 || me(
3754
3754
  !1,
3755
3755
  "column in locationOffset is 1-indexed and must be positive."
3756
3756
  );
@@ -3870,7 +3870,7 @@ class gr {
3870
3870
  if (this.peek(p.BRACE_L))
3871
3871
  return this.node(t, {
3872
3872
  kind: T.OPERATION_DEFINITION,
3873
- operation: K.QUERY,
3873
+ operation: W.QUERY,
3874
3874
  name: void 0,
3875
3875
  variableDefinitions: [],
3876
3876
  directives: [],
@@ -3894,11 +3894,11 @@ class gr {
3894
3894
  const t = this.expectToken(p.NAME);
3895
3895
  switch (t.value) {
3896
3896
  case "query":
3897
- return K.QUERY;
3897
+ return W.QUERY;
3898
3898
  case "mutation":
3899
- return K.MUTATION;
3899
+ return W.MUTATION;
3900
3900
  case "subscription":
3901
- return K.SUBSCRIPTION;
3901
+ return W.SUBSCRIPTION;
3902
3902
  }
3903
3903
  throw this.unexpected(t);
3904
3904
  }
@@ -4465,7 +4465,7 @@ class gr {
4465
4465
  throw b(
4466
4466
  this._lexer.source,
4467
4467
  this._lexer.token.start,
4468
- `${ye(
4468
+ `${pe(
4469
4469
  this._lexer.token
4470
4470
  )} is reserved and cannot be used for an enum value.`
4471
4471
  );
@@ -4724,7 +4724,7 @@ class gr {
4724
4724
  */
4725
4725
  parseDirectiveLocation() {
4726
4726
  const t = this._lexer.token, n = this.parseName();
4727
- if (Object.prototype.hasOwnProperty.call(Ve, n.value))
4727
+ if (Object.prototype.hasOwnProperty.call($e, n.value))
4728
4728
  return n;
4729
4729
  throw this.unexpected(t);
4730
4730
  }
@@ -4758,7 +4758,7 @@ class gr {
4758
4758
  throw b(
4759
4759
  this._lexer.source,
4760
4760
  n.start,
4761
- `Expected ${hn(t)}, found ${ye(n)}.`
4761
+ `Expected ${hn(t)}, found ${pe(n)}.`
4762
4762
  );
4763
4763
  }
4764
4764
  /**
@@ -4780,7 +4780,7 @@ class gr {
4780
4780
  throw b(
4781
4781
  this._lexer.source,
4782
4782
  n.start,
4783
- `Expected "${t}", found ${ye(n)}.`
4783
+ `Expected "${t}", found ${pe(n)}.`
4784
4784
  );
4785
4785
  }
4786
4786
  /**
@@ -4799,7 +4799,7 @@ class gr {
4799
4799
  return b(
4800
4800
  this._lexer.source,
4801
4801
  n.start,
4802
- `Unexpected ${ye(n)}.`
4802
+ `Unexpected ${pe(n)}.`
4803
4803
  );
4804
4804
  }
4805
4805
  /**
@@ -4866,7 +4866,7 @@ class gr {
4866
4866
  );
4867
4867
  }
4868
4868
  }
4869
- function ye(e) {
4869
+ function pe(e) {
4870
4870
  const t = e.value;
4871
4871
  return hn(e.kind) + (t != null ? ` "${t}"` : "");
4872
4872
  }
@@ -5051,19 +5051,19 @@ function Sr(e, t, n = rn) {
5051
5051
  const s = /* @__PURE__ */ new Map();
5052
5052
  for (const A of Object.values(T))
5053
5053
  s.set(A, xr(t, A));
5054
- let r, i = Array.isArray(e), o = [e], a = -1, c = [], u = e, f, d;
5054
+ let r, i = Array.isArray(e), o = [e], a = -1, c = [], u = e, f, l;
5055
5055
  const h = [], m = [];
5056
5056
  do {
5057
5057
  a++;
5058
5058
  const A = a === o.length, R = A && c.length !== 0;
5059
5059
  if (A) {
5060
- if (f = m.length === 0 ? void 0 : h[h.length - 1], u = d, d = m.pop(), R)
5060
+ if (f = m.length === 0 ? void 0 : h[h.length - 1], u = l, l = m.pop(), R)
5061
5061
  if (i) {
5062
5062
  u = u.slice();
5063
5063
  let L = 0;
5064
- for (const [z, le] of c) {
5065
- const he = z - L;
5066
- le === null ? (u.splice(he, 1), L++) : u[he] = le;
5064
+ for (const [z, de] of c) {
5065
+ const le = z - L;
5066
+ de === null ? (u.splice(le, 1), L++) : u[le] = de;
5067
5067
  }
5068
5068
  } else {
5069
5069
  u = Object.defineProperties(
@@ -5074,17 +5074,17 @@ function Sr(e, t, n = rn) {
5074
5074
  u[L] = z;
5075
5075
  }
5076
5076
  a = r.index, o = r.keys, c = r.edits, i = r.inArray, r = r.prev;
5077
- } else if (d) {
5078
- if (f = i ? a : o[a], u = d[f], u == null)
5077
+ } else if (l) {
5078
+ if (f = i ? a : o[a], u = l[f], u == null)
5079
5079
  continue;
5080
5080
  h.push(f);
5081
5081
  }
5082
5082
  let D;
5083
5083
  if (!Array.isArray(u)) {
5084
5084
  var y, v;
5085
- bt(u) || ge(!1, `Invalid AST Node: ${at(u)}.`);
5085
+ wt(u) || me(!1, `Invalid AST Node: ${ot(u)}.`);
5086
5086
  const L = A ? (y = s.get(u.kind)) === null || y === void 0 ? void 0 : y.leave : (v = s.get(u.kind)) === null || v === void 0 ? void 0 : v.enter;
5087
- if (D = L == null ? void 0 : L.call(t, u, f, d, h, m), D === Ir)
5087
+ if (D = L == null ? void 0 : L.call(t, u, f, l, h, m), D === Ir)
5088
5088
  break;
5089
5089
  if (D === !1) {
5090
5090
  if (!A) {
@@ -5092,7 +5092,7 @@ function Sr(e, t, n = rn) {
5092
5092
  continue;
5093
5093
  }
5094
5094
  } else if (D !== void 0 && (c.push([f, D]), !A))
5095
- if (bt(D))
5095
+ if (wt(D))
5096
5096
  u = D;
5097
5097
  else {
5098
5098
  h.pop();
@@ -5109,7 +5109,7 @@ function Sr(e, t, n = rn) {
5109
5109
  keys: o,
5110
5110
  edits: c,
5111
5111
  prev: r
5112
- }, i = Array.isArray(u), o = i ? u : (S = n[u.kind]) !== null && S !== void 0 ? S : [], a = -1, c = [], d && m.push(d), d = u;
5112
+ }, i = Array.isArray(u), o = i ? u : (S = n[u.kind]) !== null && S !== void 0 ? S : [], a = -1, c = [], l && m.push(l), l = u;
5113
5113
  }
5114
5114
  } while (r !== void 0);
5115
5115
  return c.length !== 0 ? c[c.length - 1][1] : e;
@@ -5164,7 +5164,7 @@ const Ar = 80, wr = {
5164
5164
  const i = I("", e, ": ") + t;
5165
5165
  let o = i + I("(", E(n, ", "), ")");
5166
5166
  return o.length > Ar && (o = i + I(`(
5167
- `, Ee(E(n, `
5167
+ `, ge(E(n, `
5168
5168
  `)), `
5169
5169
  )`)), E([o, E(s, " "), r], " ");
5170
5170
  }
@@ -5262,8 +5262,8 @@ const Ar = 80, wr = {
5262
5262
  },
5263
5263
  FieldDefinition: {
5264
5264
  leave: ({ description: e, name: t, arguments: n, type: s, directives: r }) => I("", e, `
5265
- `) + t + (Nt(n) ? I(`(
5266
- `, Ee(E(n, `
5265
+ `) + t + (Ot(n) ? I(`(
5266
+ `, ge(E(n, `
5267
5267
  `)), `
5268
5268
  )`) : I("(", E(n, ", "), ")")) + ": " + s + I(" ", E(r, " "))
5269
5269
  },
@@ -5308,8 +5308,8 @@ const Ar = 80, wr = {
5308
5308
  },
5309
5309
  DirectiveDefinition: {
5310
5310
  leave: ({ description: e, name: t, arguments: n, repeatable: s, locations: r }) => I("", e, `
5311
- `) + "directive @" + t + (Nt(n) ? I(`(
5312
- `, Ee(E(n, `
5311
+ `) + "directive @" + t + (Ot(n) ? I(`(
5312
+ `, ge(E(n, `
5313
5313
  `)), `
5314
5314
  )`) : I("(", E(n, ", "), ")")) + (s ? " repeatable" : "") + " on " + E(r, " | ")
5315
5315
  },
@@ -5370,47 +5370,47 @@ function E(e, t = "") {
5370
5370
  }
5371
5371
  function M(e) {
5372
5372
  return I(`{
5373
- `, Ee(E(e, `
5373
+ `, ge(E(e, `
5374
5374
  `)), `
5375
5375
  }`);
5376
5376
  }
5377
5377
  function I(e, t, n = "") {
5378
5378
  return t != null && t !== "" ? e + t + n : "";
5379
5379
  }
5380
- function Ee(e) {
5380
+ function ge(e) {
5381
5381
  return I(" ", e.replace(/\n/g, `
5382
5382
  `));
5383
5383
  }
5384
- function Nt(e) {
5384
+ function Ot(e) {
5385
5385
  var t;
5386
5386
  return (t = e == null ? void 0 : e.some((n) => n.includes(`
5387
5387
  `))) !== null && t !== void 0 ? t : !1;
5388
5388
  }
5389
- const kt = (e) => {
5389
+ const Nt = (e) => {
5390
5390
  var s, r;
5391
5391
  let t;
5392
5392
  const n = e.definitions.filter((i) => i.kind === "OperationDefinition");
5393
5393
  return n.length === 1 && (t = (r = (s = n[0]) == null ? void 0 : s.name) == null ? void 0 : r.value), t;
5394
- }, Le = (e) => {
5394
+ }, Re = (e) => {
5395
5395
  if (typeof e == "string") {
5396
5396
  let n;
5397
5397
  try {
5398
5398
  const s = mr(e);
5399
- n = kt(s);
5399
+ n = Nt(s);
5400
5400
  } catch {
5401
5401
  }
5402
5402
  return { query: e, operationName: n };
5403
5403
  }
5404
- const t = kt(e);
5404
+ const t = Nt(e);
5405
5405
  return { query: fn(e), operationName: t };
5406
5406
  };
5407
- class ae extends Error {
5407
+ class oe extends Error {
5408
5408
  constructor(t, n) {
5409
- const s = `${ae.extractMessage(t)}: ${JSON.stringify({
5409
+ const s = `${oe.extractMessage(t)}: ${JSON.stringify({
5410
5410
  response: t,
5411
5411
  request: n
5412
5412
  })}`;
5413
- super(s), Object.setPrototypeOf(this, ae.prototype), this.response = t, this.request = n, typeof Error.captureStackTrace == "function" && Error.captureStackTrace(this, ae);
5413
+ super(s), Object.setPrototypeOf(this, oe.prototype), this.response = t, this.request = n, typeof Error.captureStackTrace == "function" && Error.captureStackTrace(this, oe);
5414
5414
  }
5415
5415
  static extractMessage(t) {
5416
5416
  var n, s;
@@ -5421,7 +5421,7 @@ var br = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
5421
5421
  function Or(e) {
5422
5422
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
5423
5423
  }
5424
- var Ge = { exports: {} };
5424
+ var He = { exports: {} };
5425
5425
  (function(e, t) {
5426
5426
  var n = typeof self < "u" ? self : br, s = function() {
5427
5427
  function i() {
@@ -5444,8 +5444,8 @@ var Ge = { exports: {} };
5444
5444
  formData: "FormData" in i,
5445
5445
  arrayBuffer: "ArrayBuffer" in i
5446
5446
  };
5447
- function c(l) {
5448
- return l && DataView.prototype.isPrototypeOf(l);
5447
+ function c(d) {
5448
+ return d && DataView.prototype.isPrototypeOf(d);
5449
5449
  }
5450
5450
  if (a.arrayBuffer)
5451
5451
  var u = [
@@ -5458,21 +5458,21 @@ var Ge = { exports: {} };
5458
5458
  "[object Uint32Array]",
5459
5459
  "[object Float32Array]",
5460
5460
  "[object Float64Array]"
5461
- ], f = ArrayBuffer.isView || function(l) {
5462
- return l && u.indexOf(Object.prototype.toString.call(l)) > -1;
5461
+ ], f = ArrayBuffer.isView || function(d) {
5462
+ return d && u.indexOf(Object.prototype.toString.call(d)) > -1;
5463
5463
  };
5464
- function d(l) {
5465
- if (typeof l != "string" && (l = String(l)), /[^a-z0-9\-#$%&'*+.^_`|~]/i.test(l))
5464
+ function l(d) {
5465
+ if (typeof d != "string" && (d = String(d)), /[^a-z0-9\-#$%&'*+.^_`|~]/i.test(d))
5466
5466
  throw new TypeError("Invalid character in header field name");
5467
- return l.toLowerCase();
5467
+ return d.toLowerCase();
5468
5468
  }
5469
- function h(l) {
5470
- return typeof l != "string" && (l = String(l)), l;
5469
+ function h(d) {
5470
+ return typeof d != "string" && (d = String(d)), d;
5471
5471
  }
5472
- function m(l) {
5472
+ function m(d) {
5473
5473
  var g = {
5474
5474
  next: function() {
5475
- var _ = l.shift();
5475
+ var _ = d.shift();
5476
5476
  return { done: _ === void 0, value: _ };
5477
5477
  }
5478
5478
  };
@@ -5480,86 +5480,86 @@ var Ge = { exports: {} };
5480
5480
  return g;
5481
5481
  }), g;
5482
5482
  }
5483
- function y(l) {
5484
- this.map = {}, l instanceof y ? l.forEach(function(g, _) {
5483
+ function y(d) {
5484
+ this.map = {}, d instanceof y ? d.forEach(function(g, _) {
5485
5485
  this.append(_, g);
5486
- }, this) : Array.isArray(l) ? l.forEach(function(g) {
5486
+ }, this) : Array.isArray(d) ? d.forEach(function(g) {
5487
5487
  this.append(g[0], g[1]);
5488
- }, this) : l && Object.getOwnPropertyNames(l).forEach(function(g) {
5489
- this.append(g, l[g]);
5488
+ }, this) : d && Object.getOwnPropertyNames(d).forEach(function(g) {
5489
+ this.append(g, d[g]);
5490
5490
  }, this);
5491
5491
  }
5492
- y.prototype.append = function(l, g) {
5493
- l = d(l), g = h(g);
5494
- var _ = this.map[l];
5495
- this.map[l] = _ ? _ + ", " + g : g;
5496
- }, y.prototype.delete = function(l) {
5497
- delete this.map[d(l)];
5498
- }, y.prototype.get = function(l) {
5499
- return l = d(l), this.has(l) ? this.map[l] : null;
5500
- }, y.prototype.has = function(l) {
5501
- return this.map.hasOwnProperty(d(l));
5502
- }, y.prototype.set = function(l, g) {
5503
- this.map[d(l)] = h(g);
5504
- }, y.prototype.forEach = function(l, g) {
5492
+ y.prototype.append = function(d, g) {
5493
+ d = l(d), g = h(g);
5494
+ var _ = this.map[d];
5495
+ this.map[d] = _ ? _ + ", " + g : g;
5496
+ }, y.prototype.delete = function(d) {
5497
+ delete this.map[l(d)];
5498
+ }, y.prototype.get = function(d) {
5499
+ return d = l(d), this.has(d) ? this.map[d] : null;
5500
+ }, y.prototype.has = function(d) {
5501
+ return this.map.hasOwnProperty(l(d));
5502
+ }, y.prototype.set = function(d, g) {
5503
+ this.map[l(d)] = h(g);
5504
+ }, y.prototype.forEach = function(d, g) {
5505
5505
  for (var _ in this.map)
5506
- this.map.hasOwnProperty(_) && l.call(g, this.map[_], _, this);
5506
+ this.map.hasOwnProperty(_) && d.call(g, this.map[_], _, this);
5507
5507
  }, y.prototype.keys = function() {
5508
- var l = [];
5508
+ var d = [];
5509
5509
  return this.forEach(function(g, _) {
5510
- l.push(_);
5511
- }), m(l);
5510
+ d.push(_);
5511
+ }), m(d);
5512
5512
  }, y.prototype.values = function() {
5513
- var l = [];
5513
+ var d = [];
5514
5514
  return this.forEach(function(g) {
5515
- l.push(g);
5516
- }), m(l);
5515
+ d.push(g);
5516
+ }), m(d);
5517
5517
  }, y.prototype.entries = function() {
5518
- var l = [];
5518
+ var d = [];
5519
5519
  return this.forEach(function(g, _) {
5520
- l.push([_, g]);
5521
- }), m(l);
5520
+ d.push([_, g]);
5521
+ }), m(d);
5522
5522
  }, a.iterable && (y.prototype[Symbol.iterator] = y.prototype.entries);
5523
- function v(l) {
5524
- if (l.bodyUsed)
5523
+ function v(d) {
5524
+ if (d.bodyUsed)
5525
5525
  return Promise.reject(new TypeError("Already read"));
5526
- l.bodyUsed = !0;
5526
+ d.bodyUsed = !0;
5527
5527
  }
5528
- function S(l) {
5528
+ function S(d) {
5529
5529
  return new Promise(function(g, _) {
5530
- l.onload = function() {
5531
- g(l.result);
5532
- }, l.onerror = function() {
5533
- _(l.error);
5530
+ d.onload = function() {
5531
+ g(d.result);
5532
+ }, d.onerror = function() {
5533
+ _(d.error);
5534
5534
  };
5535
5535
  });
5536
5536
  }
5537
- function A(l) {
5537
+ function A(d) {
5538
5538
  var g = new FileReader(), _ = S(g);
5539
- return g.readAsArrayBuffer(l), _;
5539
+ return g.readAsArrayBuffer(d), _;
5540
5540
  }
5541
- function R(l) {
5541
+ function R(d) {
5542
5542
  var g = new FileReader(), _ = S(g);
5543
- return g.readAsText(l), _;
5543
+ return g.readAsText(d), _;
5544
5544
  }
5545
- function D(l) {
5546
- for (var g = new Uint8Array(l), _ = new Array(g.length), N = 0; N < g.length; N++)
5545
+ function D(d) {
5546
+ for (var g = new Uint8Array(d), _ = new Array(g.length), N = 0; N < g.length; N++)
5547
5547
  _[N] = String.fromCharCode(g[N]);
5548
5548
  return _.join("");
5549
5549
  }
5550
- function L(l) {
5551
- if (l.slice)
5552
- return l.slice(0);
5553
- var g = new Uint8Array(l.byteLength);
5554
- return g.set(new Uint8Array(l)), g.buffer;
5550
+ function L(d) {
5551
+ if (d.slice)
5552
+ return d.slice(0);
5553
+ var g = new Uint8Array(d.byteLength);
5554
+ return g.set(new Uint8Array(d)), g.buffer;
5555
5555
  }
5556
5556
  function z() {
5557
- return this.bodyUsed = !1, this._initBody = function(l) {
5558
- this._bodyInit = l, l ? typeof l == "string" ? this._bodyText = l : a.blob && Blob.prototype.isPrototypeOf(l) ? this._bodyBlob = l : a.formData && FormData.prototype.isPrototypeOf(l) ? this._bodyFormData = l : a.searchParams && URLSearchParams.prototype.isPrototypeOf(l) ? this._bodyText = l.toString() : a.arrayBuffer && a.blob && c(l) ? (this._bodyArrayBuffer = L(l.buffer), this._bodyInit = new Blob([this._bodyArrayBuffer])) : a.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(l) || f(l)) ? this._bodyArrayBuffer = L(l) : this._bodyText = l = Object.prototype.toString.call(l) : this._bodyText = "", this.headers.get("content-type") || (typeof l == "string" ? this.headers.set("content-type", "text/plain;charset=UTF-8") : this._bodyBlob && this._bodyBlob.type ? this.headers.set("content-type", this._bodyBlob.type) : a.searchParams && URLSearchParams.prototype.isPrototypeOf(l) && this.headers.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"));
5557
+ return this.bodyUsed = !1, this._initBody = function(d) {
5558
+ this._bodyInit = d, d ? typeof d == "string" ? this._bodyText = d : a.blob && Blob.prototype.isPrototypeOf(d) ? this._bodyBlob = d : a.formData && FormData.prototype.isPrototypeOf(d) ? this._bodyFormData = d : a.searchParams && URLSearchParams.prototype.isPrototypeOf(d) ? this._bodyText = d.toString() : a.arrayBuffer && a.blob && c(d) ? (this._bodyArrayBuffer = L(d.buffer), this._bodyInit = new Blob([this._bodyArrayBuffer])) : a.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(d) || f(d)) ? this._bodyArrayBuffer = L(d) : this._bodyText = d = Object.prototype.toString.call(d) : this._bodyText = "", this.headers.get("content-type") || (typeof d == "string" ? this.headers.set("content-type", "text/plain;charset=UTF-8") : this._bodyBlob && this._bodyBlob.type ? this.headers.set("content-type", this._bodyBlob.type) : a.searchParams && URLSearchParams.prototype.isPrototypeOf(d) && this.headers.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"));
5559
5559
  }, a.blob && (this.blob = function() {
5560
- var l = v(this);
5561
- if (l)
5562
- return l;
5560
+ var d = v(this);
5561
+ if (d)
5562
+ return d;
5563
5563
  if (this._bodyBlob)
5564
5564
  return Promise.resolve(this._bodyBlob);
5565
5565
  if (this._bodyArrayBuffer)
@@ -5570,9 +5570,9 @@ var Ge = { exports: {} };
5570
5570
  }, this.arrayBuffer = function() {
5571
5571
  return this._bodyArrayBuffer ? v(this) || Promise.resolve(this._bodyArrayBuffer) : this.blob().then(A);
5572
5572
  }), this.text = function() {
5573
- var l = v(this);
5574
- if (l)
5575
- return l;
5573
+ var d = v(this);
5574
+ if (d)
5575
+ return d;
5576
5576
  if (this._bodyBlob)
5577
5577
  return R(this._bodyBlob);
5578
5578
  if (this._bodyArrayBuffer)
@@ -5586,49 +5586,49 @@ var Ge = { exports: {} };
5586
5586
  return this.text().then(JSON.parse);
5587
5587
  }, this;
5588
5588
  }
5589
- var le = ["DELETE", "GET", "HEAD", "OPTIONS", "POST", "PUT"];
5590
- function he(l) {
5591
- var g = l.toUpperCase();
5592
- return le.indexOf(g) > -1 ? g : l;
5589
+ var de = ["DELETE", "GET", "HEAD", "OPTIONS", "POST", "PUT"];
5590
+ function le(d) {
5591
+ var g = d.toUpperCase();
5592
+ return de.indexOf(g) > -1 ? g : d;
5593
5593
  }
5594
- function j(l, g) {
5594
+ function j(d, g) {
5595
5595
  g = g || {};
5596
5596
  var _ = g.body;
5597
- if (l instanceof j) {
5598
- if (l.bodyUsed)
5597
+ if (d instanceof j) {
5598
+ if (d.bodyUsed)
5599
5599
  throw new TypeError("Already read");
5600
- this.url = l.url, this.credentials = l.credentials, g.headers || (this.headers = new y(l.headers)), this.method = l.method, this.mode = l.mode, this.signal = l.signal, !_ && l._bodyInit != null && (_ = l._bodyInit, l.bodyUsed = !0);
5600
+ this.url = d.url, this.credentials = d.credentials, g.headers || (this.headers = new y(d.headers)), this.method = d.method, this.mode = d.mode, this.signal = d.signal, !_ && d._bodyInit != null && (_ = d._bodyInit, d.bodyUsed = !0);
5601
5601
  } else
5602
- this.url = String(l);
5603
- if (this.credentials = g.credentials || this.credentials || "same-origin", (g.headers || !this.headers) && (this.headers = new y(g.headers)), this.method = he(g.method || this.method || "GET"), this.mode = g.mode || this.mode || null, this.signal = g.signal || this.signal, this.referrer = null, (this.method === "GET" || this.method === "HEAD") && _)
5602
+ this.url = String(d);
5603
+ if (this.credentials = g.credentials || this.credentials || "same-origin", (g.headers || !this.headers) && (this.headers = new y(g.headers)), this.method = le(g.method || this.method || "GET"), this.mode = g.mode || this.mode || null, this.signal = g.signal || this.signal, this.referrer = null, (this.method === "GET" || this.method === "HEAD") && _)
5604
5604
  throw new TypeError("Body not allowed for GET or HEAD requests");
5605
5605
  this._initBody(_);
5606
5606
  }
5607
5607
  j.prototype.clone = function() {
5608
5608
  return new j(this, { body: this._bodyInit });
5609
5609
  };
5610
- function gn(l) {
5610
+ function gn(d) {
5611
5611
  var g = new FormData();
5612
- return l.trim().split("&").forEach(function(_) {
5612
+ return d.trim().split("&").forEach(function(_) {
5613
5613
  if (_) {
5614
5614
  var N = _.split("="), O = N.shift().replace(/\+/g, " "), x = N.join("=").replace(/\+/g, " ");
5615
5615
  g.append(decodeURIComponent(O), decodeURIComponent(x));
5616
5616
  }
5617
5617
  }), g;
5618
5618
  }
5619
- function En(l) {
5620
- var g = new y(), _ = l.replace(/\r?\n[\t ]+/g, " ");
5619
+ function En(d) {
5620
+ var g = new y(), _ = d.replace(/\r?\n[\t ]+/g, " ");
5621
5621
  return _.split(/\r?\n/).forEach(function(N) {
5622
5622
  var O = N.split(":"), x = O.shift().trim();
5623
5623
  if (x) {
5624
- var fe = O.join(":").trim();
5625
- g.append(x, fe);
5624
+ var he = O.join(":").trim();
5625
+ g.append(x, he);
5626
5626
  }
5627
5627
  }), g;
5628
5628
  }
5629
5629
  z.call(j.prototype);
5630
- function P(l, g) {
5631
- g || (g = {}), this.type = "default", this.status = g.status === void 0 ? 200 : g.status, this.ok = this.status >= 200 && this.status < 300, this.statusText = "statusText" in g ? g.statusText : "OK", this.headers = new y(g.headers), this.url = g.url || "", this._initBody(l);
5630
+ function P(d, g) {
5631
+ g || (g = {}), this.type = "default", this.status = g.status === void 0 ? 200 : g.status, this.ok = this.status >= 200 && this.status < 300, this.statusText = "statusText" in g ? g.statusText : "OK", this.headers = new y(g.headers), this.url = g.url || "", this._initBody(d);
5632
5632
  }
5633
5633
  z.call(P.prototype), P.prototype.clone = function() {
5634
5634
  return new P(this._bodyInit, {
@@ -5638,14 +5638,14 @@ var Ge = { exports: {} };
5638
5638
  url: this.url
5639
5639
  });
5640
5640
  }, P.error = function() {
5641
- var l = new P(null, { status: 0, statusText: "" });
5642
- return l.type = "error", l;
5641
+ var d = new P(null, { status: 0, statusText: "" });
5642
+ return d.type = "error", d;
5643
5643
  };
5644
5644
  var vn = [301, 302, 303, 307, 308];
5645
- P.redirect = function(l, g) {
5645
+ P.redirect = function(d, g) {
5646
5646
  if (vn.indexOf(g) === -1)
5647
5647
  throw new RangeError("Invalid status code");
5648
- return new P(null, { status: g, headers: { location: l } });
5648
+ return new P(null, { status: g, headers: { location: d } });
5649
5649
  }, o.DOMException = i.DOMException;
5650
5650
  try {
5651
5651
  new o.DOMException();
@@ -5656,77 +5656,77 @@ var Ge = { exports: {} };
5656
5656
  this.stack = N.stack;
5657
5657
  }, o.DOMException.prototype = Object.create(Error.prototype), o.DOMException.prototype.constructor = o.DOMException;
5658
5658
  }
5659
- function Oe(l, g) {
5659
+ function be(d, g) {
5660
5660
  return new Promise(function(_, N) {
5661
- var O = new j(l, g);
5661
+ var O = new j(d, g);
5662
5662
  if (O.signal && O.signal.aborted)
5663
5663
  return N(new o.DOMException("Aborted", "AbortError"));
5664
5664
  var x = new XMLHttpRequest();
5665
- function fe() {
5665
+ function he() {
5666
5666
  x.abort();
5667
5667
  }
5668
5668
  x.onload = function() {
5669
- var re = {
5669
+ var se = {
5670
5670
  status: x.status,
5671
5671
  statusText: x.statusText,
5672
5672
  headers: En(x.getAllResponseHeaders() || "")
5673
5673
  };
5674
- re.url = "responseURL" in x ? x.responseURL : re.headers.get("X-Request-URL");
5675
- var Ne = "response" in x ? x.response : x.responseText;
5676
- _(new P(Ne, re));
5674
+ se.url = "responseURL" in x ? x.responseURL : se.headers.get("X-Request-URL");
5675
+ var Oe = "response" in x ? x.response : x.responseText;
5676
+ _(new P(Oe, se));
5677
5677
  }, x.onerror = function() {
5678
5678
  N(new TypeError("Network request failed"));
5679
5679
  }, x.ontimeout = function() {
5680
5680
  N(new TypeError("Network request failed"));
5681
5681
  }, x.onabort = function() {
5682
5682
  N(new o.DOMException("Aborted", "AbortError"));
5683
- }, x.open(O.method, O.url, !0), O.credentials === "include" ? x.withCredentials = !0 : O.credentials === "omit" && (x.withCredentials = !1), "responseType" in x && a.blob && (x.responseType = "blob"), O.headers.forEach(function(re, Ne) {
5684
- x.setRequestHeader(Ne, re);
5685
- }), O.signal && (O.signal.addEventListener("abort", fe), x.onreadystatechange = function() {
5686
- x.readyState === 4 && O.signal.removeEventListener("abort", fe);
5683
+ }, x.open(O.method, O.url, !0), O.credentials === "include" ? x.withCredentials = !0 : O.credentials === "omit" && (x.withCredentials = !1), "responseType" in x && a.blob && (x.responseType = "blob"), O.headers.forEach(function(se, Oe) {
5684
+ x.setRequestHeader(Oe, se);
5685
+ }), O.signal && (O.signal.addEventListener("abort", he), x.onreadystatechange = function() {
5686
+ x.readyState === 4 && O.signal.removeEventListener("abort", he);
5687
5687
  }), x.send(typeof O._bodyInit > "u" ? null : O._bodyInit);
5688
5688
  });
5689
5689
  }
5690
- return Oe.polyfill = !0, i.fetch || (i.fetch = Oe, i.Headers = y, i.Request = j, i.Response = P), o.Headers = y, o.Request = j, o.Response = P, o.fetch = Oe, Object.defineProperty(o, "__esModule", { value: !0 }), o;
5690
+ return be.polyfill = !0, i.fetch || (i.fetch = be, i.Headers = y, i.Request = j, i.Response = P), o.Headers = y, o.Request = j, o.Response = P, o.fetch = be, Object.defineProperty(o, "__esModule", { value: !0 }), o;
5691
5691
  })({});
5692
5692
  })(s), s.fetch.ponyfill = !0, delete s.fetch.polyfill;
5693
5693
  var r = s;
5694
5694
  t = r.fetch, t.default = r.fetch, t.fetch = r.fetch, t.Headers = r.Headers, t.Request = r.Request, t.Response = r.Response, e.exports = t;
5695
- })(Ge, Ge.exports);
5696
- var Se = Ge.exports;
5697
- const ve = /* @__PURE__ */ Or(Se), Nr = /* @__PURE__ */ _n({
5695
+ })(He, He.exports);
5696
+ var Ie = He.exports;
5697
+ const Ee = /* @__PURE__ */ Or(Ie), Nr = /* @__PURE__ */ _n({
5698
5698
  __proto__: null,
5699
- default: ve
5700
- }, [Se]), Y = (e) => {
5699
+ default: Ee
5700
+ }, [Ie]), Y = (e) => {
5701
5701
  let t = {};
5702
- return e && (typeof Headers < "u" && e instanceof Headers || Nr && Se.Headers && e instanceof Se.Headers ? t = Ms(e) : Array.isArray(e) ? e.forEach(([n, s]) => {
5702
+ return e && (typeof Headers < "u" && e instanceof Headers || Nr && Ie.Headers && e instanceof Ie.Headers ? t = Ms(e) : Array.isArray(e) ? e.forEach(([n, s]) => {
5703
5703
  n && s !== void 0 && (t[n] = s);
5704
5704
  }) : t = e), t;
5705
- }, Ct = (e) => e.replace(/([\s,]|#[^\n\r]+)+/g, " ").trim(), kr = (e) => {
5705
+ }, kt = (e) => e.replace(/([\s,]|#[^\n\r]+)+/g, " ").trim(), kr = (e) => {
5706
5706
  if (!Array.isArray(e.query)) {
5707
- const s = e, r = [`query=${encodeURIComponent(Ct(s.query))}`];
5707
+ const s = e, r = [`query=${encodeURIComponent(kt(s.query))}`];
5708
5708
  return e.variables && r.push(`variables=${encodeURIComponent(s.jsonSerializer.stringify(s.variables))}`), s.operationName && r.push(`operationName=${encodeURIComponent(s.operationName)}`), r.join("&");
5709
5709
  }
5710
5710
  if (typeof e.variables < "u" && !Array.isArray(e.variables))
5711
5711
  throw new Error("Cannot create query with given variable type, array expected");
5712
5712
  const t = e, n = e.query.reduce((s, r, i) => (s.push({
5713
- query: Ct(r),
5713
+ query: kt(r),
5714
5714
  variables: t.variables ? t.jsonSerializer.stringify(t.variables[i]) : void 0
5715
5715
  }), s), []);
5716
5716
  return `query=${encodeURIComponent(t.jsonSerializer.stringify(n))}`;
5717
5717
  }, Cr = (e) => async (t) => {
5718
5718
  const { url: n, query: s, variables: r, operationName: i, fetch: o, fetchOptions: a, middleware: c } = t, u = { ...t.headers };
5719
- let f = "", d;
5720
- e === "POST" ? (d = Dr(s, r, i, a.jsonSerializer), typeof d == "string" && (u["Content-Type"] = "application/json")) : f = kr({
5719
+ let f = "", l;
5720
+ e === "POST" ? (l = Dr(s, r, i, a.jsonSerializer), typeof l == "string" && (u["Content-Type"] = "application/json")) : f = kr({
5721
5721
  query: s,
5722
5722
  variables: r,
5723
5723
  operationName: i,
5724
- jsonSerializer: a.jsonSerializer ?? it
5724
+ jsonSerializer: a.jsonSerializer ?? rt
5725
5725
  });
5726
5726
  const h = {
5727
5727
  method: e,
5728
5728
  headers: u,
5729
- body: d,
5729
+ body: l,
5730
5730
  ...a
5731
5731
  };
5732
5732
  let m = n, y = h;
@@ -5739,43 +5739,43 @@ const ve = /* @__PURE__ */ Or(Se), Nr = /* @__PURE__ */ _n({
5739
5739
  class pn {
5740
5740
  constructor(t, n = {}) {
5741
5741
  this.url = t, this.requestConfig = n, this.rawRequest = async (...s) => {
5742
- const [r, i, o] = s, a = qs(r, i, o), { headers: c, fetch: u = ve, method: f = "POST", requestMiddleware: d, responseMiddleware: h, ...m } = this.requestConfig, { url: y } = this;
5742
+ const [r, i, o] = s, a = qs(r, i, o), { headers: c, fetch: u = Ee, method: f = "POST", requestMiddleware: l, responseMiddleware: h, ...m } = this.requestConfig, { url: y } = this;
5743
5743
  a.signal !== void 0 && (m.signal = a.signal);
5744
- const { operationName: v } = Le(a.query);
5745
- return Me({
5744
+ const { operationName: v } = Re(a.query);
5745
+ return Le({
5746
5746
  url: y,
5747
5747
  query: a.query,
5748
5748
  variables: a.variables,
5749
5749
  headers: {
5750
- ...Y(Pe(c)),
5750
+ ...Y(Me(c)),
5751
5751
  ...Y(a.requestHeaders)
5752
5752
  },
5753
5753
  operationName: v,
5754
5754
  fetch: u,
5755
5755
  method: f,
5756
5756
  fetchOptions: m,
5757
- middleware: d
5757
+ middleware: l
5758
5758
  }).then((S) => (h && h(S), S)).catch((S) => {
5759
5759
  throw h && h(S), S;
5760
5760
  });
5761
5761
  };
5762
5762
  }
5763
5763
  async request(t, ...n) {
5764
- const [s, r] = n, i = Ps(t, s, r), { headers: o, fetch: a = ve, method: c = "POST", requestMiddleware: u, responseMiddleware: f, ...d } = this.requestConfig, { url: h } = this;
5765
- i.signal !== void 0 && (d.signal = i.signal);
5766
- const { query: m, operationName: y } = Le(i.document);
5767
- return Me({
5764
+ const [s, r] = n, i = Ps(t, s, r), { headers: o, fetch: a = Ee, method: c = "POST", requestMiddleware: u, responseMiddleware: f, ...l } = this.requestConfig, { url: h } = this;
5765
+ i.signal !== void 0 && (l.signal = i.signal);
5766
+ const { query: m, operationName: y } = Re(i.document);
5767
+ return Le({
5768
5768
  url: h,
5769
5769
  query: m,
5770
5770
  variables: i.variables,
5771
5771
  headers: {
5772
- ...Y(Pe(o)),
5772
+ ...Y(Me(o)),
5773
5773
  ...Y(i.requestHeaders)
5774
5774
  },
5775
5775
  operationName: y,
5776
5776
  fetch: a,
5777
5777
  method: c,
5778
- fetchOptions: d,
5778
+ fetchOptions: l,
5779
5779
  middleware: u
5780
5780
  }).then((v) => (f && f(v), v.data)).catch((v) => {
5781
5781
  throw f && f(v), v;
@@ -5785,18 +5785,18 @@ class pn {
5785
5785
  batchRequests(t, n) {
5786
5786
  const s = Fs(t, n), { headers: r, ...i } = this.requestConfig;
5787
5787
  s.signal !== void 0 && (i.signal = s.signal);
5788
- const o = s.documents.map(({ document: c }) => Le(c).query), a = s.documents.map(({ variables: c }) => c);
5789
- return Me({
5788
+ const o = s.documents.map(({ document: c }) => Re(c).query), a = s.documents.map(({ variables: c }) => c);
5789
+ return Le({
5790
5790
  url: this.url,
5791
5791
  query: o,
5792
5792
  // @ts-expect-error TODO reconcile batch variables into system.
5793
5793
  variables: a,
5794
5794
  headers: {
5795
- ...Y(Pe(r)),
5795
+ ...Y(Me(r)),
5796
5796
  ...Y(s.requestHeaders)
5797
5797
  },
5798
5798
  operationName: void 0,
5799
- fetch: this.requestConfig.fetch ?? ve,
5799
+ fetch: this.requestConfig.fetch ?? Ee,
5800
5800
  method: this.requestConfig.method || "POST",
5801
5801
  fetchOptions: i,
5802
5802
  middleware: this.requestConfig.requestMiddleware
@@ -5821,10 +5821,10 @@ class pn {
5821
5821
  return this.url = t, this;
5822
5822
  }
5823
5823
  }
5824
- const Me = async (e) => {
5825
- const { query: t, variables: n, fetchOptions: s } = e, r = Cr(Ls(e.method ?? "post")), i = Array.isArray(e.query), o = await r(e), a = await Rr(o, s.jsonSerializer ?? it), c = Array.isArray(a) ? !a.some(({ data: f }) => !f) : !!a.data, u = Array.isArray(a) || !a.errors || Array.isArray(a.errors) && !a.errors.length || s.errorPolicy === "all" || s.errorPolicy === "ignore";
5824
+ const Le = async (e) => {
5825
+ const { query: t, variables: n, fetchOptions: s } = e, r = Cr(Ls(e.method ?? "post")), i = Array.isArray(e.query), o = await r(e), a = await Rr(o, s.jsonSerializer ?? rt), c = Array.isArray(a) ? !a.some(({ data: f }) => !f) : !!a.data, u = Array.isArray(a) || !a.errors || Array.isArray(a.errors) && !a.errors.length || s.errorPolicy === "all" || s.errorPolicy === "ignore";
5826
5826
  if (o.ok && u && c) {
5827
- const { errors: f, ...d } = (Array.isArray(a), a), h = s.errorPolicy === "ignore" ? d : a;
5827
+ const { errors: f, ...l } = (Array.isArray(a), a), h = s.errorPolicy === "ignore" ? l : a;
5828
5828
  return {
5829
5829
  ...i ? { data: h } : h,
5830
5830
  headers: o.headers,
@@ -5834,7 +5834,7 @@ const Me = async (e) => {
5834
5834
  const f = typeof a == "string" ? {
5835
5835
  error: a
5836
5836
  } : a;
5837
- throw new ae(
5837
+ throw new oe(
5838
5838
  // @ts-expect-error TODO
5839
5839
  { ...f, status: o.status, headers: o.headers },
5840
5840
  { query: t, variables: n }
@@ -5848,7 +5848,7 @@ async function yn(e, t, ...n) {
5848
5848
  });
5849
5849
  }
5850
5850
  const Dr = (e, t, n, s) => {
5851
- const r = s ?? it;
5851
+ const r = s ?? rt;
5852
5852
  if (!Array.isArray(e))
5853
5853
  return r.stringify({ query: e, variables: t, operationName: n });
5854
5854
  if (typeof t < "u" && !Array.isArray(t))
@@ -5860,7 +5860,7 @@ const Dr = (e, t, n, s) => {
5860
5860
  return e.headers.forEach((s, r) => {
5861
5861
  r.toLowerCase() === "content-type" && (n = s);
5862
5862
  }), n && (n.toLowerCase().startsWith("application/json") || n.toLowerCase().startsWith("application/graphql+json") || n.toLowerCase().startsWith("application/graphql-response+json")) ? t.parse(await e.text()) : e.text();
5863
- }, Pe = (e) => typeof e == "function" ? e() : e, Lr = Z(
5863
+ }, Me = (e) => typeof e == "function" ? e() : e, Lr = K(
5864
5864
  async ({ input: e }) => {
5865
5865
  var t;
5866
5866
  if (!e.endpoint || e.endpoint === "")
@@ -5885,7 +5885,7 @@ const Dr = (e, t, n, s) => {
5885
5885
  throw new Error("Request to add item(s) failed.");
5886
5886
  }
5887
5887
  }
5888
- ), Mr = Z(async ({ input: e }) => {
5888
+ ), Mr = K(async ({ input: e }) => {
5889
5889
  var t;
5890
5890
  if (!e.endpoint || e.endpoint === "")
5891
5891
  throw new Error("No endpoint provided.");
@@ -5908,7 +5908,7 @@ const Dr = (e, t, n, s) => {
5908
5908
  } catch {
5909
5909
  throw new Error("Request to remove item(s) failed.");
5910
5910
  }
5911
- }), qe = typeof window > "u", Pr = Z(
5911
+ }), Pe = typeof window > "u", Pr = K(
5912
5912
  async ({ input: e }) => {
5913
5913
  var n, s, r, i;
5914
5914
  if (!e.endpoint)
@@ -5922,8 +5922,8 @@ const Dr = (e, t, n, s) => {
5922
5922
  if (!e.requestHeaders)
5923
5923
  throw console.log("no headers"), new Error("No request headers provided.");
5924
5924
  const t = new pn(
5925
- qe ? e.endpointSsr : e.endpoint,
5926
- qe ? { fetch, method: "POST" } : {
5925
+ Pe ? e.endpointSsr : e.endpoint,
5926
+ Pe ? { fetch, method: "POST" } : {
5927
5927
  credentials: "include",
5928
5928
  method: "POST",
5929
5929
  mode: "cors"
@@ -5933,24 +5933,24 @@ const Dr = (e, t, n, s) => {
5933
5933
  const { data: o, headers: a, status: c, errors: u, extensions: f } = await t.rawRequest(
5934
5934
  fn(e.document),
5935
5935
  {},
5936
- qe ? {
5936
+ Pe ? {
5937
5937
  ...e.requestHeaders,
5938
5938
  Cookie: `quote_${e.locale}=${e.quoteId ?? ""}`
5939
5939
  } : e.requestHeaders
5940
- ), d = o;
5941
- if (!((n = d.refreshQuote) != null && n.quote))
5940
+ ), l = o;
5941
+ if (!((n = l.refreshQuote) != null && n.quote))
5942
5942
  throw console.log(
5943
5943
  "userError: ",
5944
- (s = d.refreshQuote) == null ? void 0 : s.userErrors[0].code,
5945
- (r = d.refreshQuote) == null ? void 0 : r.userErrors[0].field,
5946
- (i = d.refreshQuote) == null ? void 0 : i.userErrors[0].message
5944
+ (s = l.refreshQuote) == null ? void 0 : s.userErrors[0].code,
5945
+ (r = l.refreshQuote) == null ? void 0 : r.userErrors[0].field,
5946
+ (i = l.refreshQuote) == null ? void 0 : i.userErrors[0].message
5947
5947
  ), new Error("Could not add items to quote.");
5948
- return { type: "REFRESH_SUCCESS", quote: d.refreshQuote.quote };
5948
+ return { type: "REFRESH_SUCCESS", quote: l.refreshQuote.quote };
5949
5949
  } catch (o) {
5950
5950
  throw console.log("refresh error", o), new Error("Request to add item(s) failed.");
5951
5951
  }
5952
5952
  }
5953
- ), qr = ({ context: e }) => typeof window > "u" && e.quote.id !== "" || typeof window < "u", Fr = ({ context: e }) => !!e.quote.items && e.quote.items.length > 0, Dt = Ae({
5953
+ ), qr = ({ context: e }) => typeof window > "u" && e.quote.id !== "" || typeof window < "u", Fr = ({ context: e }) => !!e.quote.items && e.quote.items.length > 0, Ct = xe({
5954
5954
  types: {
5955
5955
  context: {},
5956
5956
  events: {},
@@ -5975,7 +5975,7 @@ const Dr = (e, t, n, s) => {
5975
5975
  id: "quote",
5976
5976
  initial: "initializing",
5977
5977
  context: ({ input: e }) => {
5978
- var t, n, s, r, i, o, a, c, u, f, d, h, m, y;
5978
+ var t, n, s, r, i, o, a, c, u, f, l, h, m, y;
5979
5979
  return {
5980
5980
  quote: {
5981
5981
  id: "",
@@ -6036,7 +6036,7 @@ const Dr = (e, t, n, s) => {
6036
6036
  requestHeaders: ((c = (a = (o = e == null ? void 0 : e.initialContext) == null ? void 0 : o.graphql) == null ? void 0 : a.refresh) == null ? void 0 : c.requestHeaders) ?? void 0
6037
6037
  },
6038
6038
  addItems: {
6039
- document: ((d = (f = (u = e == null ? void 0 : e.initialContext) == null ? void 0 : u.graphql) == null ? void 0 : f.addItems) == null ? void 0 : d.document) ?? "",
6039
+ document: ((l = (f = (u = e == null ? void 0 : e.initialContext) == null ? void 0 : u.graphql) == null ? void 0 : f.addItems) == null ? void 0 : l.document) ?? "",
6040
6040
  requestHeaders: ((y = (m = (h = e == null ? void 0 : e.initialContext) == null ? void 0 : h.graphql) == null ? void 0 : m.addItems) == null ? void 0 : y.requestHeaders) ?? void 0
6041
6041
  }
6042
6042
  // removeItems: {
@@ -6231,39 +6231,42 @@ const Dr = (e, t, n, s) => {
6231
6231
  // removingGiftCard: {},
6232
6232
  // applyingSettings: {},
6233
6233
  }
6234
- }), mn = Je(
6234
+ }), mn = ze(
6235
6235
  {}
6236
6236
  ), Jr = () => {
6237
- var d;
6238
- const e = Ye(mn), [t, n] = X(
6239
- e.getSnapshot().context.quote.items ?? []
6240
- ), [s, r] = X(
6241
- ((d = e.getSnapshot().context.quote.items) == null ? void 0 : d.length) ?? 0
6242
- ), [i, o] = X(
6243
- e.getSnapshot().value === "addingItems"
6244
- ), [a, c] = X(
6245
- e.getSnapshot().value === "removingItems"
6246
- ), [u, f] = X(
6247
- e.getSnapshot().value === "addingItems" || e.getSnapshot().value === "removingItems"
6248
- );
6237
+ const e = Je(mn), [t, n] = Dt(() => {
6238
+ var r;
6239
+ const s = e.getSnapshot();
6240
+ return {
6241
+ items: s.context.quote.items ?? [],
6242
+ itemsCount: ((r = s.context.quote.items) == null ? void 0 : r.length) ?? 0,
6243
+ isAddingItems: s.value === "addingItems",
6244
+ isRemovingItems: s.value === "removingItems",
6245
+ isUpdatingItems: s.value === "addingItems" || s.value === "removingItems"
6246
+ };
6247
+ });
6249
6248
  return Rt(() => {
6250
- const h = e.getSnapshot().context.quote.items ?? [];
6251
- n(h), r(h.length);
6252
- const m = e.subscribe((y) => {
6253
- o(y.matches("addingItems")), c(y.matches("removingItems")), f(
6254
- y.matches("addingItems") || y.matches("removingItems")
6255
- );
6249
+ const s = e.subscribe((r) => {
6250
+ const i = r.context.quote.items ?? [];
6251
+ n((o) => ({
6252
+ ...o,
6253
+ items: i,
6254
+ itemsCount: i.length,
6255
+ isAddingItems: r.matches("addingItems"),
6256
+ isRemovingItems: r.matches("removingItems"),
6257
+ isUpdatingItems: r.matches("addingItems") || r.matches("removingItems")
6258
+ }));
6256
6259
  });
6257
6260
  return () => {
6258
- m.unsubscribe();
6261
+ s.unsubscribe();
6259
6262
  };
6260
6263
  }, [e]), {
6261
6264
  quoteActor: e,
6262
- isAddingItems: i,
6263
- isRemovingItems: a,
6264
- isUpdatingItems: u,
6265
- items: t,
6266
- itemsCount: s
6265
+ isAddingItems: t.isAddingItems,
6266
+ isRemovingItems: t.isRemovingItems,
6267
+ isUpdatingItems: t.isUpdatingItems,
6268
+ items: t.items,
6269
+ itemsCount: t.itemsCount
6267
6270
  };
6268
6271
  }, Yr = async (e = {
6269
6272
  inspect: void 0,
@@ -6272,14 +6275,14 @@ const Dr = (e, t, n, s) => {
6272
6275
  graphql: {}
6273
6276
  }) => typeof window < "u" ? (console.warn(
6274
6277
  "App.getInitialProps::getAuth should not be run on the frontend. You are probably missing getServerSideProps in your page."
6275
- ), U(Dt, {
6278
+ ), U(Ct, {
6276
6279
  inspect: e.inspect,
6277
6280
  input: {
6278
6281
  initialContext: {
6279
6282
  endpoints: e.endpoints
6280
6283
  }
6281
6284
  }
6282
- }).start()) : U(Dt, {
6285
+ }).start()) : U(Ct, {
6283
6286
  input: {
6284
6287
  initialContext: {
6285
6288
  endpoints: e.endpoints,
@@ -6293,7 +6296,7 @@ const Dr = (e, t, n, s) => {
6293
6296
  inspect: e.inspect
6294
6297
  }).start();
6295
6298
  function Xr({ actor: e, children: t }) {
6296
- return /* @__PURE__ */ ze(mn.Provider, { value: e, children: t });
6299
+ return /* @__PURE__ */ Ge(mn.Provider, { value: e, children: t });
6297
6300
  }
6298
6301
  export {
6299
6302
  en as AuthContext,
@@ -6302,10 +6305,10 @@ export {
6302
6305
  Xr as QuoteProvider,
6303
6306
  tn as ToastContext,
6304
6307
  zr as ToastProvider,
6305
- xt as authMachine,
6308
+ St as authMachine,
6306
6309
  $r as getAuth,
6307
6310
  Yr as getQuote,
6308
- Dt as quoteMachine,
6311
+ Ct as quoteMachine,
6309
6312
  ks as timerMachine,
6310
6313
  Hr as toastMachine,
6311
6314
  jr as useAuth,