@clicktap/state 0.12.15 → 0.12.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +5 -5
- package/index.mjs +358 -362
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as
|
|
3
|
-
function
|
|
1
|
+
import { jsx as Se } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as Ee, useContext as we, useState as ln, useEffect as dn, cloneElement as hn } from "react";
|
|
3
|
+
function pn() {
|
|
4
4
|
if (typeof globalThis < "u")
|
|
5
5
|
return globalThis;
|
|
6
6
|
if (typeof self < "u")
|
|
@@ -10,15 +10,15 @@ function yn() {
|
|
|
10
10
|
if (typeof global < "u")
|
|
11
11
|
return global;
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
const t =
|
|
13
|
+
function yn() {
|
|
14
|
+
const t = pn();
|
|
15
15
|
if (t.__xstate__)
|
|
16
16
|
return t.__xstate__;
|
|
17
17
|
}
|
|
18
|
-
const
|
|
18
|
+
const mn = (t) => {
|
|
19
19
|
if (typeof window > "u")
|
|
20
20
|
return;
|
|
21
|
-
const e =
|
|
21
|
+
const e = yn();
|
|
22
22
|
e && e.register(t);
|
|
23
23
|
};
|
|
24
24
|
class qt {
|
|
@@ -50,8 +50,8 @@ class qt {
|
|
|
50
50
|
this._last = null;
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
const
|
|
54
|
-
function
|
|
53
|
+
const _e = ".", gn = "", Te = "", Sn = "#", En = "*", ve = "xstate.init", wn = "xstate.error", W = "xstate.stop";
|
|
54
|
+
function _n(t, e) {
|
|
55
55
|
return {
|
|
56
56
|
type: `xstate.after.${t}.${e}`
|
|
57
57
|
};
|
|
@@ -62,21 +62,21 @@ function wt(t, e) {
|
|
|
62
62
|
output: e
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
|
-
function
|
|
65
|
+
function Tn(t, e) {
|
|
66
66
|
return {
|
|
67
67
|
type: `xstate.done.actor.${t}`,
|
|
68
68
|
output: e
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
|
-
function
|
|
71
|
+
function be(t, e) {
|
|
72
72
|
return {
|
|
73
73
|
type: `xstate.error.actor.${t}`,
|
|
74
74
|
error: e
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
function Ae(t) {
|
|
78
78
|
return {
|
|
79
|
-
type:
|
|
79
|
+
type: ve,
|
|
80
80
|
input: t
|
|
81
81
|
};
|
|
82
82
|
}
|
|
@@ -85,12 +85,12 @@ function x(t) {
|
|
|
85
85
|
throw t;
|
|
86
86
|
});
|
|
87
87
|
}
|
|
88
|
-
const
|
|
88
|
+
const vn = (() => typeof Symbol == "function" && Symbol.observable || "@@observable")();
|
|
89
89
|
function Wt(t, e) {
|
|
90
90
|
return `${t.sessionId}.${e}`;
|
|
91
91
|
}
|
|
92
|
-
let
|
|
93
|
-
function
|
|
92
|
+
let bn = 0;
|
|
93
|
+
function An(t, e) {
|
|
94
94
|
const n = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new WeakMap(), i = /* @__PURE__ */ new Set(), o = {}, a = e.clock, u = {
|
|
95
95
|
schedule: (f, p, y, h, m = Math.random().toString(36).slice(2)) => {
|
|
96
96
|
const S = {
|
|
@@ -132,7 +132,7 @@ function xn(t, e) {
|
|
|
132
132
|
_snapshot: {
|
|
133
133
|
_scheduledEvents: ((e == null ? void 0 : e.snapshot) && e.snapshot.scheduler) ?? {}
|
|
134
134
|
},
|
|
135
|
-
_bookId: () => `x:${
|
|
135
|
+
_bookId: () => `x:${bn++}`,
|
|
136
136
|
_register: (f, p) => (n.set(f, p), f),
|
|
137
137
|
_unregister: (f) => {
|
|
138
138
|
n.delete(f.sessionId);
|
|
@@ -181,12 +181,12 @@ function xn(t, e) {
|
|
|
181
181
|
};
|
|
182
182
|
return l;
|
|
183
183
|
}
|
|
184
|
-
function
|
|
184
|
+
function xe(t, e) {
|
|
185
185
|
const n = Kt(t), s = Kt(e);
|
|
186
|
-
return typeof s == "string" ? typeof n == "string" ? s === n : !1 : typeof n == "string" ? n in s : Object.keys(n).every((r) => r in s ?
|
|
186
|
+
return typeof s == "string" ? typeof n == "string" ? s === n : !1 : typeof n == "string" ? n in s : Object.keys(n).every((r) => r in s ? xe(n[r], s[r]) : !1);
|
|
187
187
|
}
|
|
188
188
|
function Ot(t) {
|
|
189
|
-
if (
|
|
189
|
+
if (Oe(t))
|
|
190
190
|
return t;
|
|
191
191
|
let e = [], n = "";
|
|
192
192
|
for (let s = 0; s < t.length; s++) {
|
|
@@ -203,14 +203,14 @@ function Ot(t) {
|
|
|
203
203
|
return e.push(n), e;
|
|
204
204
|
}
|
|
205
205
|
function Kt(t) {
|
|
206
|
-
if (
|
|
206
|
+
if (ns(t))
|
|
207
207
|
return t.value;
|
|
208
208
|
if (typeof t != "string")
|
|
209
209
|
return t;
|
|
210
210
|
const e = Ot(t);
|
|
211
|
-
return
|
|
211
|
+
return xn(e);
|
|
212
212
|
}
|
|
213
|
-
function
|
|
213
|
+
function xn(t) {
|
|
214
214
|
if (t.length === 1)
|
|
215
215
|
return t[0];
|
|
216
216
|
const e = {};
|
|
@@ -232,11 +232,11 @@ function Vt(t, e) {
|
|
|
232
232
|
}
|
|
233
233
|
return n;
|
|
234
234
|
}
|
|
235
|
-
function
|
|
236
|
-
return
|
|
235
|
+
function Re(t) {
|
|
236
|
+
return Oe(t) ? t : [t];
|
|
237
237
|
}
|
|
238
238
|
function I(t) {
|
|
239
|
-
return t === void 0 ? [] :
|
|
239
|
+
return t === void 0 ? [] : Re(t);
|
|
240
240
|
}
|
|
241
241
|
function _t(t, e, n, s) {
|
|
242
242
|
return typeof t == "function" ? t({
|
|
@@ -245,19 +245,19 @@ function _t(t, e, n, s) {
|
|
|
245
245
|
self: s
|
|
246
246
|
}) : t;
|
|
247
247
|
}
|
|
248
|
-
function
|
|
248
|
+
function Oe(t) {
|
|
249
249
|
return Array.isArray(t);
|
|
250
250
|
}
|
|
251
|
-
function
|
|
251
|
+
function Rn(t) {
|
|
252
252
|
return t.type.startsWith("xstate.error.actor");
|
|
253
253
|
}
|
|
254
254
|
function N(t) {
|
|
255
|
-
return
|
|
255
|
+
return Re(t).map((e) => typeof e > "u" || typeof e == "string" ? {
|
|
256
256
|
target: e
|
|
257
257
|
} : e);
|
|
258
258
|
}
|
|
259
|
-
function
|
|
260
|
-
if (!(t === void 0 || t ===
|
|
259
|
+
function ke(t) {
|
|
260
|
+
if (!(t === void 0 || t === gn))
|
|
261
261
|
return I(t);
|
|
262
262
|
}
|
|
263
263
|
function Gt(t, e, n) {
|
|
@@ -283,7 +283,7 @@ const It = 1;
|
|
|
283
283
|
let _ = /* @__PURE__ */ function(t) {
|
|
284
284
|
return t[t.NotStarted = 0] = "NotStarted", t[t.Running = 1] = "Running", t[t.Stopped = 2] = "Stopped", t;
|
|
285
285
|
}({});
|
|
286
|
-
const
|
|
286
|
+
const On = {
|
|
287
287
|
clock: {
|
|
288
288
|
setTimeout: (t, e) => setTimeout(t, e),
|
|
289
289
|
clearTimeout: (t) => clearTimeout(t)
|
|
@@ -291,7 +291,7 @@ const kn = {
|
|
|
291
291
|
logger: console.log.bind(console),
|
|
292
292
|
devTools: !1
|
|
293
293
|
};
|
|
294
|
-
class
|
|
294
|
+
class kn {
|
|
295
295
|
/**
|
|
296
296
|
* Creates a new actor instance for the given logic with the provided options, if any.
|
|
297
297
|
*
|
|
@@ -301,7 +301,7 @@ class In {
|
|
|
301
301
|
constructor(e, n) {
|
|
302
302
|
this.logic = e, this._snapshot = void 0, this.clock = void 0, this.options = void 0, this.id = void 0, this.mailbox = new qt(this._process.bind(this)), this.observers = /* @__PURE__ */ new Set(), this.eventListeners = /* @__PURE__ */ new Map(), this.logger = void 0, this._processingStatus = _.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 = [];
|
|
303
303
|
const s = {
|
|
304
|
-
...
|
|
304
|
+
...On,
|
|
305
305
|
...n
|
|
306
306
|
}, {
|
|
307
307
|
clock: r,
|
|
@@ -312,7 +312,7 @@ class In {
|
|
|
312
312
|
systemId: c,
|
|
313
313
|
inspect: l
|
|
314
314
|
} = s;
|
|
315
|
-
this.system = o ? o.system :
|
|
315
|
+
this.system = o ? o.system : An(this, {
|
|
316
316
|
clock: r
|
|
317
317
|
}), l && !o && this.system.inspect(Gt(l)), this.sessionId = this.system._bookId(), this.id = u ?? this.sessionId, this.logger = i, this.clock = r, this._parent = o, this._syncSnapshot = a, this.options = s, this.src = s.src ?? e, this.ref = this, this._actorScope = {
|
|
318
318
|
self: this,
|
|
@@ -381,7 +381,7 @@ class In {
|
|
|
381
381
|
} catch (a) {
|
|
382
382
|
x(a);
|
|
383
383
|
}
|
|
384
|
-
this._stopProcedure(), this._complete(), this._doneEvent =
|
|
384
|
+
this._stopProcedure(), this._complete(), this._doneEvent = Tn(this.id, this._snapshot.output), this._parent && this.system._relay(this, this._parent, this._doneEvent);
|
|
385
385
|
break;
|
|
386
386
|
case "error":
|
|
387
387
|
this._error(this._snapshot.error);
|
|
@@ -501,7 +501,7 @@ class In {
|
|
|
501
501
|
error: () => {
|
|
502
502
|
}
|
|
503
503
|
}), this.system._register(this.sessionId, this), this._systemId && this.system._set(this._systemId, this), this._processingStatus = _.Running;
|
|
504
|
-
const e =
|
|
504
|
+
const e = Ae(this.options.input);
|
|
505
505
|
switch (this.system._sendInspectionEvent({
|
|
506
506
|
type: "@xstate.event",
|
|
507
507
|
sourceRef: this._parent,
|
|
@@ -588,7 +588,7 @@ class In {
|
|
|
588
588
|
this.observers.clear(), n && x(e);
|
|
589
589
|
}
|
|
590
590
|
_error(e) {
|
|
591
|
-
this._stopProcedure(), this._reportError(e), this._parent && this.system._relay(this, this._parent,
|
|
591
|
+
this._stopProcedure(), this._reportError(e), this._parent && this.system._relay(this, this._parent, be(this.id, e));
|
|
592
592
|
}
|
|
593
593
|
// TODO: atm children don't belong entirely to the actor so
|
|
594
594
|
// in a way - it's not even super aware of them
|
|
@@ -616,7 +616,7 @@ class In {
|
|
|
616
616
|
const {
|
|
617
617
|
devTools: e
|
|
618
618
|
} = this.options;
|
|
619
|
-
e && (typeof e == "function" ? e :
|
|
619
|
+
e && (typeof e == "function" ? e : mn)(this);
|
|
620
620
|
}
|
|
621
621
|
toJSON() {
|
|
622
622
|
return {
|
|
@@ -639,7 +639,7 @@ class In {
|
|
|
639
639
|
getPersistedSnapshot(e) {
|
|
640
640
|
return this.logic.getPersistedSnapshot(this._snapshot, e);
|
|
641
641
|
}
|
|
642
|
-
[
|
|
642
|
+
[vn]() {
|
|
643
643
|
return this;
|
|
644
644
|
}
|
|
645
645
|
/**
|
|
@@ -661,25 +661,25 @@ class In {
|
|
|
661
661
|
}
|
|
662
662
|
}
|
|
663
663
|
function $(t, ...[e]) {
|
|
664
|
-
return new
|
|
664
|
+
return new kn(t, e);
|
|
665
665
|
}
|
|
666
|
-
function
|
|
666
|
+
function In(t, e, n, s, {
|
|
667
667
|
sendId: r
|
|
668
668
|
}) {
|
|
669
669
|
const i = typeof r == "function" ? r(n, s) : r;
|
|
670
670
|
return [e, i];
|
|
671
671
|
}
|
|
672
|
-
function
|
|
672
|
+
function Cn(t, e) {
|
|
673
673
|
t.defer(() => {
|
|
674
674
|
t.system.scheduler.cancel(t.self, e);
|
|
675
675
|
});
|
|
676
676
|
}
|
|
677
|
-
function
|
|
677
|
+
function Pn(t) {
|
|
678
678
|
function e(n, s) {
|
|
679
679
|
}
|
|
680
|
-
return e.type = "xstate.cancel", e.sendId = t, e.resolve =
|
|
680
|
+
return e.type = "xstate.cancel", e.sendId = t, e.resolve = In, e.execute = Cn, e;
|
|
681
681
|
}
|
|
682
|
-
function
|
|
682
|
+
function Dn(t, e, n, s, {
|
|
683
683
|
id: r,
|
|
684
684
|
systemId: i,
|
|
685
685
|
src: o,
|
|
@@ -709,7 +709,7 @@ function Mn(t, e, n, s, {
|
|
|
709
709
|
actorRef: f
|
|
710
710
|
}];
|
|
711
711
|
}
|
|
712
|
-
function
|
|
712
|
+
function Mn(t, {
|
|
713
713
|
id: e,
|
|
714
714
|
actorRef: n
|
|
715
715
|
}) {
|
|
@@ -717,7 +717,7 @@ function Un(t, {
|
|
|
717
717
|
n._processingStatus !== _.Stopped && n.start();
|
|
718
718
|
});
|
|
719
719
|
}
|
|
720
|
-
function
|
|
720
|
+
function Un(...[t, {
|
|
721
721
|
id: e,
|
|
722
722
|
systemId: n,
|
|
723
723
|
input: s,
|
|
@@ -725,9 +725,9 @@ function Nn(...[t, {
|
|
|
725
725
|
} = {}]) {
|
|
726
726
|
function i(o, a) {
|
|
727
727
|
}
|
|
728
|
-
return i.type = "snapshot.spawnChild", i.id = e, i.systemId = n, i.src = t, i.input = s, i.syncSnapshot = r, i.resolve =
|
|
728
|
+
return i.type = "snapshot.spawnChild", i.id = e, i.systemId = n, i.src = t, i.input = s, i.syncSnapshot = r, i.resolve = Dn, i.execute = Mn, i;
|
|
729
729
|
}
|
|
730
|
-
function
|
|
730
|
+
function Nn(t, e, n, s, {
|
|
731
731
|
actorRef: r
|
|
732
732
|
}) {
|
|
733
733
|
const i = typeof r == "function" ? r(n, s) : r, o = typeof i == "string" ? e.children[i] : i;
|
|
@@ -738,7 +738,7 @@ function jn(t, e, n, s, {
|
|
|
738
738
|
children: a
|
|
739
739
|
}), o];
|
|
740
740
|
}
|
|
741
|
-
function
|
|
741
|
+
function jn(t, e) {
|
|
742
742
|
if (e) {
|
|
743
743
|
if (t.system._unregister(e), e._processingStatus !== _.Running) {
|
|
744
744
|
t.stopChild(e);
|
|
@@ -749,10 +749,10 @@ function $n(t, e) {
|
|
|
749
749
|
});
|
|
750
750
|
}
|
|
751
751
|
}
|
|
752
|
-
function
|
|
752
|
+
function Ie(t) {
|
|
753
753
|
function e(n, s) {
|
|
754
754
|
}
|
|
755
|
-
return e.type = "xstate.stopChild", e.actorRef = t, e.resolve =
|
|
755
|
+
return e.type = "xstate.stopChild", e.actorRef = t, e.resolve = Nn, e.execute = jn, e;
|
|
756
756
|
}
|
|
757
757
|
function Ct(t, e, n, s) {
|
|
758
758
|
const {
|
|
@@ -790,7 +790,7 @@ function V(t, e) {
|
|
|
790
790
|
return n;
|
|
791
791
|
}
|
|
792
792
|
function st(t) {
|
|
793
|
-
const e = new Set(t), n =
|
|
793
|
+
const e = new Set(t), n = Pe(e);
|
|
794
794
|
for (const s of e)
|
|
795
795
|
if (s.type === "compound" && (!n.get(s) || !n.get(s).length))
|
|
796
796
|
Yt(s).forEach((r) => e.add(r));
|
|
@@ -809,7 +809,7 @@ function st(t) {
|
|
|
809
809
|
}
|
|
810
810
|
return e;
|
|
811
811
|
}
|
|
812
|
-
function
|
|
812
|
+
function Ce(t, e) {
|
|
813
813
|
const n = e.get(t);
|
|
814
814
|
if (!n)
|
|
815
815
|
return {};
|
|
@@ -823,26 +823,26 @@ function Pe(t, e) {
|
|
|
823
823
|
}
|
|
824
824
|
const s = {};
|
|
825
825
|
for (const r of n)
|
|
826
|
-
s[r.key] =
|
|
826
|
+
s[r.key] = Ce(r, e);
|
|
827
827
|
return s;
|
|
828
828
|
}
|
|
829
|
-
function
|
|
829
|
+
function Pe(t) {
|
|
830
830
|
const e = /* @__PURE__ */ new Map();
|
|
831
831
|
for (const n of t)
|
|
832
832
|
e.has(n) || e.set(n, []), n.parent && (e.has(n.parent) || e.set(n.parent, []), e.get(n.parent).push(n));
|
|
833
833
|
return e;
|
|
834
834
|
}
|
|
835
|
-
function
|
|
835
|
+
function De(t, e) {
|
|
836
836
|
const n = st(e);
|
|
837
|
-
return
|
|
837
|
+
return Ce(t, Pe(n));
|
|
838
838
|
}
|
|
839
839
|
function Dt(t, e) {
|
|
840
840
|
return e.type === "compound" ? L(e).some((n) => n.type === "final" && t.has(n)) : e.type === "parallel" ? L(e).every((n) => Dt(t, n)) : e.type === "final";
|
|
841
841
|
}
|
|
842
|
-
const at = (t) => t[0] ===
|
|
843
|
-
function
|
|
842
|
+
const at = (t) => t[0] === Sn;
|
|
843
|
+
function $n(t, e) {
|
|
844
844
|
return t.transitions.get(e) || [...t.transitions.keys()].filter((s) => {
|
|
845
|
-
if (s ===
|
|
845
|
+
if (s === En)
|
|
846
846
|
return !0;
|
|
847
847
|
if (!s.endsWith(".*"))
|
|
848
848
|
return !1;
|
|
@@ -857,16 +857,16 @@ function Ln(t, e) {
|
|
|
857
857
|
return !0;
|
|
858
858
|
}).sort((s, r) => r.length - s.length).flatMap((s) => t.transitions.get(s));
|
|
859
859
|
}
|
|
860
|
-
function
|
|
860
|
+
function Ln(t) {
|
|
861
861
|
const e = t.config.after;
|
|
862
862
|
if (!e)
|
|
863
863
|
return [];
|
|
864
864
|
const n = (r, i) => {
|
|
865
|
-
const o =
|
|
866
|
-
return t.entry.push(
|
|
865
|
+
const o = _n(r, t.id), a = o.type;
|
|
866
|
+
return t.entry.push(ls(o, {
|
|
867
867
|
id: a,
|
|
868
868
|
delay: r
|
|
869
|
-
})), t.exit.push(
|
|
869
|
+
})), t.exit.push(Pn(a)), a;
|
|
870
870
|
};
|
|
871
871
|
return Object.keys(e).flatMap((r, i) => {
|
|
872
872
|
const o = e[r], a = typeof o == "string" ? {
|
|
@@ -888,7 +888,7 @@ function Bn(t) {
|
|
|
888
888
|
});
|
|
889
889
|
}
|
|
890
890
|
function P(t, e, n) {
|
|
891
|
-
const s =
|
|
891
|
+
const s = ke(n.target), r = n.reenter ?? !1, i = Hn(t, s), o = {
|
|
892
892
|
...n,
|
|
893
893
|
actions: I(n.actions),
|
|
894
894
|
guard: n.guard,
|
|
@@ -904,11 +904,11 @@ function P(t, e, n) {
|
|
|
904
904
|
};
|
|
905
905
|
return o;
|
|
906
906
|
}
|
|
907
|
-
function
|
|
907
|
+
function Bn(t) {
|
|
908
908
|
const e = /* @__PURE__ */ new Map();
|
|
909
909
|
if (t.config.on)
|
|
910
910
|
for (const n of Object.keys(t.config.on)) {
|
|
911
|
-
if (n ===
|
|
911
|
+
if (n === Te)
|
|
912
912
|
throw new Error('Null events ("") cannot be specified as a transition key. Use `always: { ... }` instead.');
|
|
913
913
|
const s = t.config.on[n];
|
|
914
914
|
e.set(n, N(s).map((r) => P(t, n, r)));
|
|
@@ -937,7 +937,7 @@ function Fn(t) {
|
|
|
937
937
|
}
|
|
938
938
|
return e;
|
|
939
939
|
}
|
|
940
|
-
function
|
|
940
|
+
function Fn(t, e) {
|
|
941
941
|
const n = typeof e == "string" ? t.states[e] : e ? t.states[e.target] : void 0;
|
|
942
942
|
if (!n && e)
|
|
943
943
|
throw new Error(`Initial state node "${e}" not found on parent state node #${t.id}`);
|
|
@@ -955,14 +955,14 @@ function Hn(t, e) {
|
|
|
955
955
|
};
|
|
956
956
|
return s;
|
|
957
957
|
}
|
|
958
|
-
function
|
|
958
|
+
function Hn(t, e) {
|
|
959
959
|
if (e !== void 0)
|
|
960
960
|
return e.map((n) => {
|
|
961
961
|
if (typeof n != "string")
|
|
962
962
|
return n;
|
|
963
963
|
if (at(n))
|
|
964
964
|
return t.machine.getStateNodeById(n);
|
|
965
|
-
const s = n[0] ===
|
|
965
|
+
const s = n[0] === _e;
|
|
966
966
|
if (s && !t.parent)
|
|
967
967
|
return rt(t, n.slice(1));
|
|
968
968
|
const r = s ? t.key + n : n;
|
|
@@ -977,8 +977,8 @@ ${i.message}`);
|
|
|
977
977
|
throw new Error(`Invalid target: "${n}" is not a valid target from the root node. Did you mean ".${n}"?`);
|
|
978
978
|
});
|
|
979
979
|
}
|
|
980
|
-
function
|
|
981
|
-
const e =
|
|
980
|
+
function Me(t) {
|
|
981
|
+
const e = ke(t.config.target);
|
|
982
982
|
return e ? {
|
|
983
983
|
target: e.map((n) => typeof n == "string" ? rt(t.parent, n) : n)
|
|
984
984
|
} : t.parent.initial;
|
|
@@ -987,13 +987,13 @@ function D(t) {
|
|
|
987
987
|
return t.type === "history";
|
|
988
988
|
}
|
|
989
989
|
function Yt(t) {
|
|
990
|
-
const e =
|
|
990
|
+
const e = Ue(t);
|
|
991
991
|
for (const n of e)
|
|
992
992
|
for (const s of V(n, t))
|
|
993
993
|
e.add(s);
|
|
994
994
|
return e;
|
|
995
995
|
}
|
|
996
|
-
function
|
|
996
|
+
function Ue(t) {
|
|
997
997
|
const e = /* @__PURE__ */ new Set();
|
|
998
998
|
function n(s) {
|
|
999
999
|
if (!e.has(s)) {
|
|
@@ -1048,15 +1048,15 @@ function it(t, e) {
|
|
|
1048
1048
|
return r.concat(a);
|
|
1049
1049
|
}, []));
|
|
1050
1050
|
}
|
|
1051
|
-
function
|
|
1051
|
+
function zn(t, e, n, s) {
|
|
1052
1052
|
const i = B(t, e).next(n, s);
|
|
1053
1053
|
return !i || !i.length ? t.next(n, s) : i;
|
|
1054
1054
|
}
|
|
1055
|
-
function
|
|
1055
|
+
function Jn(t, e, n, s) {
|
|
1056
1056
|
const r = Object.keys(e), i = B(t, r[0]), o = Mt(i, e[r[0]], n, s);
|
|
1057
1057
|
return !o || !o.length ? t.next(n, s) : o;
|
|
1058
1058
|
}
|
|
1059
|
-
function
|
|
1059
|
+
function qn(t, e, n, s) {
|
|
1060
1060
|
const r = [];
|
|
1061
1061
|
for (const i of Object.keys(e)) {
|
|
1062
1062
|
const o = e[i];
|
|
@@ -1068,9 +1068,9 @@ function Wn(t, e, n, s) {
|
|
|
1068
1068
|
return r.length ? r : t.next(n, s);
|
|
1069
1069
|
}
|
|
1070
1070
|
function Mt(t, e, n, s) {
|
|
1071
|
-
return typeof e == "string" ?
|
|
1071
|
+
return typeof e == "string" ? zn(t, e, n, s) : Object.keys(e).length === 1 ? Jn(t, e, n, s) : qn(t, e, n, s);
|
|
1072
1072
|
}
|
|
1073
|
-
function
|
|
1073
|
+
function Wn(t) {
|
|
1074
1074
|
return Object.keys(t.states).map((e) => t.states[e]).filter((e) => e.type === "history");
|
|
1075
1075
|
}
|
|
1076
1076
|
function C(t, e) {
|
|
@@ -1079,7 +1079,7 @@ function C(t, e) {
|
|
|
1079
1079
|
n = n.parent;
|
|
1080
1080
|
return n.parent === e;
|
|
1081
1081
|
}
|
|
1082
|
-
function
|
|
1082
|
+
function Kn(t, e) {
|
|
1083
1083
|
const n = new Set(t), s = new Set(e);
|
|
1084
1084
|
for (const r of n)
|
|
1085
1085
|
if (s.has(r))
|
|
@@ -1089,13 +1089,13 @@ function Vn(t, e) {
|
|
|
1089
1089
|
return !0;
|
|
1090
1090
|
return !1;
|
|
1091
1091
|
}
|
|
1092
|
-
function
|
|
1092
|
+
function Ne(t, e, n) {
|
|
1093
1093
|
const s = /* @__PURE__ */ new Set();
|
|
1094
1094
|
for (const r of t) {
|
|
1095
1095
|
let i = !1;
|
|
1096
1096
|
const o = /* @__PURE__ */ new Set();
|
|
1097
1097
|
for (const a of s)
|
|
1098
|
-
if (
|
|
1098
|
+
if (Kn(Tt([r], e, n), Tt([a], e, n)))
|
|
1099
1099
|
if (C(r.source, a.source))
|
|
1100
1100
|
o.add(a);
|
|
1101
1101
|
else {
|
|
@@ -1110,7 +1110,7 @@ function je(t, e, n) {
|
|
|
1110
1110
|
}
|
|
1111
1111
|
return Array.from(s);
|
|
1112
1112
|
}
|
|
1113
|
-
function
|
|
1113
|
+
function Vn(t) {
|
|
1114
1114
|
const [e, ...n] = t;
|
|
1115
1115
|
for (const s of V(e, void 0))
|
|
1116
1116
|
if (n.every((r) => C(r, s)))
|
|
@@ -1126,19 +1126,19 @@ function Ut(t, e) {
|
|
|
1126
1126
|
for (const r of e[s.id])
|
|
1127
1127
|
n.add(r);
|
|
1128
1128
|
else
|
|
1129
|
-
for (const r of Ut(
|
|
1129
|
+
for (const r of Ut(Me(s), e))
|
|
1130
1130
|
n.add(r);
|
|
1131
1131
|
else
|
|
1132
1132
|
n.add(s);
|
|
1133
1133
|
return [...n];
|
|
1134
1134
|
}
|
|
1135
|
-
function
|
|
1135
|
+
function je(t, e) {
|
|
1136
1136
|
const n = Ut(t, e);
|
|
1137
1137
|
if (!n)
|
|
1138
1138
|
return;
|
|
1139
1139
|
if (!t.reenter && n.every((r) => r === t.source || C(r, t.source)))
|
|
1140
1140
|
return t.source;
|
|
1141
|
-
const s =
|
|
1141
|
+
const s = Vn(n.concat(t.source));
|
|
1142
1142
|
if (s)
|
|
1143
1143
|
return s;
|
|
1144
1144
|
if (!t.reenter)
|
|
@@ -1149,14 +1149,14 @@ function Tt(t, e, n) {
|
|
|
1149
1149
|
const s = /* @__PURE__ */ new Set();
|
|
1150
1150
|
for (const i of t)
|
|
1151
1151
|
if ((r = i.target) != null && r.length) {
|
|
1152
|
-
const o =
|
|
1152
|
+
const o = je(i, n);
|
|
1153
1153
|
i.reenter && i.source === o && s.add(o);
|
|
1154
1154
|
for (const a of e)
|
|
1155
1155
|
C(a, o) && s.add(a);
|
|
1156
1156
|
}
|
|
1157
1157
|
return [...s];
|
|
1158
1158
|
}
|
|
1159
|
-
function
|
|
1159
|
+
function Gn(t, e) {
|
|
1160
1160
|
if (t.length !== e.size)
|
|
1161
1161
|
return !1;
|
|
1162
1162
|
for (const n of t)
|
|
@@ -1169,13 +1169,13 @@ function vt(t, e, n, s, r, i) {
|
|
|
1169
1169
|
return e;
|
|
1170
1170
|
const o = new Set(e._nodes);
|
|
1171
1171
|
let a = e.historyValue;
|
|
1172
|
-
const u =
|
|
1172
|
+
const u = Ne(t, o, a);
|
|
1173
1173
|
let c = e;
|
|
1174
|
-
r || ([c, a] =
|
|
1174
|
+
r || ([c, a] = Qn(c, s, n, u, o, a, i)), c = F(c, s, n, u.flatMap((f) => f.actions), i), c = Yn(c, s, n, u, o, i, a, r);
|
|
1175
1175
|
const l = [...o];
|
|
1176
1176
|
c.status === "done" && (c = F(c, s, n, l.sort((f, p) => p.order - f.order).flatMap((f) => f.exit), i));
|
|
1177
1177
|
try {
|
|
1178
|
-
return a === e.historyValue &&
|
|
1178
|
+
return a === e.historyValue && Gn(e._nodes, o) ? c : M(c, {
|
|
1179
1179
|
_nodes: l,
|
|
1180
1180
|
historyValue: a
|
|
1181
1181
|
});
|
|
@@ -1183,23 +1183,23 @@ function vt(t, e, n, s, r, i) {
|
|
|
1183
1183
|
throw f;
|
|
1184
1184
|
}
|
|
1185
1185
|
}
|
|
1186
|
-
function
|
|
1186
|
+
function Xn(t, e, n, s, r) {
|
|
1187
1187
|
if (s.output === void 0)
|
|
1188
1188
|
return;
|
|
1189
1189
|
const i = wt(r.id, r.output !== void 0 && r.parent ? _t(r.output, t.context, e, n.self) : void 0);
|
|
1190
1190
|
return _t(s.output, t.context, i, n.self);
|
|
1191
1191
|
}
|
|
1192
|
-
function
|
|
1192
|
+
function Yn(t, e, n, s, r, i, o, a) {
|
|
1193
1193
|
let u = t;
|
|
1194
1194
|
const c = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Set();
|
|
1195
|
-
|
|
1195
|
+
Zn(s, o, l, c), a && l.add(t.machine.root);
|
|
1196
1196
|
const f = /* @__PURE__ */ new Set();
|
|
1197
1197
|
for (const p of [...c].sort((y, h) => y.order - h.order)) {
|
|
1198
1198
|
r.add(p);
|
|
1199
1199
|
const y = [];
|
|
1200
1200
|
y.push(...p.entry);
|
|
1201
1201
|
for (const h of p.invoke)
|
|
1202
|
-
y.push(
|
|
1202
|
+
y.push(Un(h.src, {
|
|
1203
1203
|
...h,
|
|
1204
1204
|
syncSnapshot: !!h.onSnapshot
|
|
1205
1205
|
}));
|
|
@@ -1216,15 +1216,15 @@ function Zn(t, e, n, s, r, i, o, a) {
|
|
|
1216
1216
|
continue;
|
|
1217
1217
|
u = M(u, {
|
|
1218
1218
|
status: "done",
|
|
1219
|
-
output:
|
|
1219
|
+
output: Xn(u, e, n, u.machine.root, S)
|
|
1220
1220
|
});
|
|
1221
1221
|
}
|
|
1222
1222
|
}
|
|
1223
1223
|
return u;
|
|
1224
1224
|
}
|
|
1225
|
-
function
|
|
1225
|
+
function Zn(t, e, n, s) {
|
|
1226
1226
|
for (const r of t) {
|
|
1227
|
-
const i =
|
|
1227
|
+
const i = je(r, e);
|
|
1228
1228
|
for (const a of r.target || [])
|
|
1229
1229
|
!D(a) && // if the target is different than the source then it will *definitely* be entered
|
|
1230
1230
|
(r.source !== a || // we know that the domain can't lie within the source
|
|
@@ -1234,7 +1234,7 @@ function Qn(t, e, n, s) {
|
|
|
1234
1234
|
const o = Ut(r, e);
|
|
1235
1235
|
for (const a of o) {
|
|
1236
1236
|
const u = V(a, i);
|
|
1237
|
-
(i == null ? void 0 : i.type) === "parallel" && u.push(i),
|
|
1237
|
+
(i == null ? void 0 : i.type) === "parallel" && u.push(i), $e(s, e, n, u, !r.source.parent && r.reenter ? void 0 : i);
|
|
1238
1238
|
}
|
|
1239
1239
|
}
|
|
1240
1240
|
}
|
|
@@ -1248,7 +1248,7 @@ function j(t, e, n, s) {
|
|
|
1248
1248
|
for (const o of i)
|
|
1249
1249
|
ht(o, t.parent, s, e, n);
|
|
1250
1250
|
} else {
|
|
1251
|
-
const i =
|
|
1251
|
+
const i = Me(t);
|
|
1252
1252
|
for (const o of i.target)
|
|
1253
1253
|
s.add(o), i === ((r = t.parent) == null ? void 0 : r.initial) && n.add(t.parent), j(o, e, n, s);
|
|
1254
1254
|
for (const o of i.target)
|
|
@@ -1261,32 +1261,32 @@ function j(t, e, n, s) {
|
|
|
1261
1261
|
for (const i of L(t).filter((o) => !D(o)))
|
|
1262
1262
|
[...s].some((o) => C(o, i)) || (D(i) || (s.add(i), n.add(i)), j(i, e, n, s));
|
|
1263
1263
|
}
|
|
1264
|
-
function
|
|
1264
|
+
function $e(t, e, n, s, r) {
|
|
1265
1265
|
for (const i of s)
|
|
1266
1266
|
if ((!r || C(i, r)) && t.add(i), i.type === "parallel")
|
|
1267
1267
|
for (const o of L(i).filter((a) => !D(a)))
|
|
1268
1268
|
[...t].some((a) => C(a, o)) || (t.add(o), j(o, e, n, t));
|
|
1269
1269
|
}
|
|
1270
1270
|
function ht(t, e, n, s, r) {
|
|
1271
|
-
|
|
1271
|
+
$e(n, s, r, V(t, e));
|
|
1272
1272
|
}
|
|
1273
|
-
function
|
|
1273
|
+
function Qn(t, e, n, s, r, i, o) {
|
|
1274
1274
|
let a = t;
|
|
1275
1275
|
const u = Tt(s, r, i);
|
|
1276
1276
|
u.sort((l, f) => f.order - l.order);
|
|
1277
1277
|
let c;
|
|
1278
1278
|
for (const l of u)
|
|
1279
|
-
for (const f of
|
|
1279
|
+
for (const f of Wn(l)) {
|
|
1280
1280
|
let p;
|
|
1281
1281
|
f.history === "deep" ? p = (y) => Pt(y) && C(y, l) : p = (y) => y.parent === l, c ?? (c = {
|
|
1282
1282
|
...i
|
|
1283
1283
|
}), c[f.id] = Array.from(r).filter(p);
|
|
1284
1284
|
}
|
|
1285
1285
|
for (const l of u)
|
|
1286
|
-
a = F(a, e, n, [...l.exit, ...l.invoke.map((f) =>
|
|
1286
|
+
a = F(a, e, n, [...l.exit, ...l.invoke.map((f) => Ie(f.id))], o), r.delete(l);
|
|
1287
1287
|
return [a, c || i];
|
|
1288
1288
|
}
|
|
1289
|
-
function
|
|
1289
|
+
function Le(t, e, n, s, r, i) {
|
|
1290
1290
|
const {
|
|
1291
1291
|
machine: o
|
|
1292
1292
|
} = t;
|
|
@@ -1334,12 +1334,12 @@ function Be(t, e, n, s, r, i) {
|
|
|
1334
1334
|
// this holds all params
|
|
1335
1335
|
r
|
|
1336
1336
|
);
|
|
1337
|
-
a = m, "retryResolve" in h && (i == null || i.push([h, S])), "execute" in h && (n.self._processingStatus === _.Running ? h.execute(n, S) : n.defer(h.execute.bind(null, n, S))), E && (a =
|
|
1337
|
+
a = m, "retryResolve" in h && (i == null || i.push([h, S])), "execute" in h && (n.self._processingStatus === _.Running ? h.execute(n, S) : n.defer(h.execute.bind(null, n, S))), E && (a = Le(a, e, n, E, r, i));
|
|
1338
1338
|
}
|
|
1339
1339
|
return a;
|
|
1340
1340
|
}
|
|
1341
1341
|
function F(t, e, n, s, r, i) {
|
|
1342
|
-
const o = i ? [] : void 0, a =
|
|
1342
|
+
const o = i ? [] : void 0, a = Le(t, e, n, s, {
|
|
1343
1343
|
internalQueue: r,
|
|
1344
1344
|
deferredActorIds: i
|
|
1345
1345
|
}, o);
|
|
@@ -1367,8 +1367,8 @@ function pt(t, e, n, s = []) {
|
|
|
1367
1367
|
microstates: i
|
|
1368
1368
|
};
|
|
1369
1369
|
let a = e;
|
|
1370
|
-
if (a.type !==
|
|
1371
|
-
const c = a, l =
|
|
1370
|
+
if (a.type !== ve) {
|
|
1371
|
+
const c = a, l = Rn(c), f = Qt(c, r);
|
|
1372
1372
|
if (l && !f.length)
|
|
1373
1373
|
return r = M(t, {
|
|
1374
1374
|
status: "error",
|
|
@@ -1389,7 +1389,7 @@ function pt(t, e, n, s = []) {
|
|
|
1389
1389
|
}
|
|
1390
1390
|
let u = !0;
|
|
1391
1391
|
for (; r.status === "active"; ) {
|
|
1392
|
-
let c = u ?
|
|
1392
|
+
let c = u ? ts(r, a) : [];
|
|
1393
1393
|
const l = c.length ? r : void 0;
|
|
1394
1394
|
if (!c.length) {
|
|
1395
1395
|
if (!s.length)
|
|
@@ -1404,12 +1404,12 @@ function pt(t, e, n, s = []) {
|
|
|
1404
1404
|
};
|
|
1405
1405
|
}
|
|
1406
1406
|
function Zt(t, e, n) {
|
|
1407
|
-
return F(t, e, n, Object.values(t.children).map((s) =>
|
|
1407
|
+
return F(t, e, n, Object.values(t.children).map((s) => Ie(s)), []);
|
|
1408
1408
|
}
|
|
1409
1409
|
function Qt(t, e) {
|
|
1410
1410
|
return e.machine.getTransitionData(e, t);
|
|
1411
1411
|
}
|
|
1412
|
-
function
|
|
1412
|
+
function ts(t, e) {
|
|
1413
1413
|
const n = /* @__PURE__ */ new Set(), s = t._nodes.filter(Pt);
|
|
1414
1414
|
for (const r of s)
|
|
1415
1415
|
t:
|
|
@@ -1421,24 +1421,24 @@ function es(t, e) {
|
|
|
1421
1421
|
break t;
|
|
1422
1422
|
}
|
|
1423
1423
|
}
|
|
1424
|
-
return
|
|
1424
|
+
return Ne(Array.from(n), new Set(t._nodes), t.historyValue);
|
|
1425
1425
|
}
|
|
1426
|
-
function
|
|
1426
|
+
function es(t, e) {
|
|
1427
1427
|
const n = st(it(t, e));
|
|
1428
|
-
return
|
|
1428
|
+
return De(t, [...n]);
|
|
1429
1429
|
}
|
|
1430
|
-
function
|
|
1430
|
+
function ns(t) {
|
|
1431
1431
|
return !!t && typeof t == "object" && "machine" in t && "value" in t;
|
|
1432
1432
|
}
|
|
1433
|
-
const
|
|
1434
|
-
return
|
|
1435
|
-
},
|
|
1433
|
+
const ss = function(e) {
|
|
1434
|
+
return xe(e, this.value);
|
|
1435
|
+
}, rs = function(e) {
|
|
1436
1436
|
return this.tags.has(e);
|
|
1437
|
-
},
|
|
1437
|
+
}, is = function(e) {
|
|
1438
1438
|
const n = this.machine.getTransitionData(this, e);
|
|
1439
1439
|
return !!(n != null && n.length) && // Check that at least one transition is not forbidden
|
|
1440
1440
|
n.some((s) => s.target !== void 0 || s.actions.length);
|
|
1441
|
-
},
|
|
1441
|
+
}, os = function() {
|
|
1442
1442
|
const {
|
|
1443
1443
|
_nodes: e,
|
|
1444
1444
|
tags: n,
|
|
@@ -1454,7 +1454,7 @@ const rs = function(e) {
|
|
|
1454
1454
|
...c,
|
|
1455
1455
|
tags: Array.from(n)
|
|
1456
1456
|
};
|
|
1457
|
-
},
|
|
1457
|
+
}, as = function() {
|
|
1458
1458
|
return this._nodes.reduce((e, n) => (n.meta !== void 0 && (e[n.id] = n.meta), e), {});
|
|
1459
1459
|
};
|
|
1460
1460
|
function Z(t, e) {
|
|
@@ -1465,15 +1465,15 @@ function Z(t, e) {
|
|
|
1465
1465
|
machine: e,
|
|
1466
1466
|
context: t.context,
|
|
1467
1467
|
_nodes: t._nodes,
|
|
1468
|
-
value:
|
|
1468
|
+
value: De(e.root, t._nodes),
|
|
1469
1469
|
tags: new Set(t._nodes.flatMap((n) => n.tags)),
|
|
1470
1470
|
children: t.children,
|
|
1471
1471
|
historyValue: t.historyValue || {},
|
|
1472
|
-
matches:
|
|
1473
|
-
hasTag:
|
|
1474
|
-
can:
|
|
1475
|
-
getMeta:
|
|
1476
|
-
toJSON:
|
|
1472
|
+
matches: ss,
|
|
1473
|
+
hasTag: rs,
|
|
1474
|
+
can: is,
|
|
1475
|
+
getMeta: as,
|
|
1476
|
+
toJSON: os
|
|
1477
1477
|
};
|
|
1478
1478
|
}
|
|
1479
1479
|
function M(t, e = {}) {
|
|
@@ -1482,7 +1482,7 @@ function M(t, e = {}) {
|
|
|
1482
1482
|
...e
|
|
1483
1483
|
}, t.machine);
|
|
1484
1484
|
}
|
|
1485
|
-
function
|
|
1485
|
+
function cs(t, e) {
|
|
1486
1486
|
const {
|
|
1487
1487
|
_nodes: n,
|
|
1488
1488
|
tags: s,
|
|
@@ -1507,11 +1507,11 @@ function us(t, e) {
|
|
|
1507
1507
|
}
|
|
1508
1508
|
return {
|
|
1509
1509
|
...p,
|
|
1510
|
-
context:
|
|
1510
|
+
context: Be(o),
|
|
1511
1511
|
children: y
|
|
1512
1512
|
};
|
|
1513
1513
|
}
|
|
1514
|
-
function
|
|
1514
|
+
function Be(t) {
|
|
1515
1515
|
let e;
|
|
1516
1516
|
for (const n in t) {
|
|
1517
1517
|
const s = t[n];
|
|
@@ -1524,7 +1524,7 @@ function Fe(t) {
|
|
|
1524
1524
|
id: s.id
|
|
1525
1525
|
};
|
|
1526
1526
|
else {
|
|
1527
|
-
const r =
|
|
1527
|
+
const r = Be(s);
|
|
1528
1528
|
r !== s && (e ?? (e = Array.isArray(t) ? t.slice() : {
|
|
1529
1529
|
...t
|
|
1530
1530
|
}), e[n] = r);
|
|
@@ -1532,7 +1532,7 @@ function Fe(t) {
|
|
|
1532
1532
|
}
|
|
1533
1533
|
return e ?? t;
|
|
1534
1534
|
}
|
|
1535
|
-
function
|
|
1535
|
+
function us(t, e, n, s, {
|
|
1536
1536
|
event: r,
|
|
1537
1537
|
id: i,
|
|
1538
1538
|
delay: o
|
|
@@ -1555,7 +1555,7 @@ function fs(t, e, n, s, {
|
|
|
1555
1555
|
delay: l
|
|
1556
1556
|
}];
|
|
1557
1557
|
}
|
|
1558
|
-
function
|
|
1558
|
+
function fs(t, e) {
|
|
1559
1559
|
const {
|
|
1560
1560
|
event: n,
|
|
1561
1561
|
delay: s,
|
|
@@ -1569,13 +1569,13 @@ function ls(t, e) {
|
|
|
1569
1569
|
return;
|
|
1570
1570
|
}
|
|
1571
1571
|
}
|
|
1572
|
-
function
|
|
1572
|
+
function ls(t, e) {
|
|
1573
1573
|
function n(s, r) {
|
|
1574
1574
|
}
|
|
1575
|
-
return n.type = "xstate.raise", n.event = t, n.id = e == null ? void 0 : e.id, n.delay = e == null ? void 0 : e.delay, n.resolve =
|
|
1575
|
+
return n.type = "xstate.raise", n.event = t, n.id = e == null ? void 0 : e.id, n.delay = e == null ? void 0 : e.delay, n.resolve = us, n.execute = fs, n;
|
|
1576
1576
|
}
|
|
1577
1577
|
const te = /* @__PURE__ */ new WeakMap();
|
|
1578
|
-
function
|
|
1578
|
+
function ds(t) {
|
|
1579
1579
|
return {
|
|
1580
1580
|
config: t,
|
|
1581
1581
|
start: (n, s) => {
|
|
@@ -1683,7 +1683,7 @@ function yt(t) {
|
|
|
1683
1683
|
restoreSnapshot: (n) => n
|
|
1684
1684
|
};
|
|
1685
1685
|
}
|
|
1686
|
-
function
|
|
1686
|
+
function hs(t, {
|
|
1687
1687
|
machine: e,
|
|
1688
1688
|
context: n
|
|
1689
1689
|
}, s, r) {
|
|
@@ -1726,7 +1726,7 @@ function ps(t, {
|
|
|
1726
1726
|
}), u;
|
|
1727
1727
|
};
|
|
1728
1728
|
}
|
|
1729
|
-
function
|
|
1729
|
+
function ps(t, e, n, s, {
|
|
1730
1730
|
assignment: r
|
|
1731
1731
|
}) {
|
|
1732
1732
|
if (!e.context)
|
|
@@ -1734,7 +1734,7 @@ function ys(t, e, n, s, {
|
|
|
1734
1734
|
const i = {}, o = {
|
|
1735
1735
|
context: e.context,
|
|
1736
1736
|
event: n.event,
|
|
1737
|
-
spawn:
|
|
1737
|
+
spawn: hs(t, e, n.event, i),
|
|
1738
1738
|
self: t.self,
|
|
1739
1739
|
system: t.system
|
|
1740
1740
|
};
|
|
@@ -1758,12 +1758,12 @@ function ys(t, e, n, s, {
|
|
|
1758
1758
|
function v(t) {
|
|
1759
1759
|
function e(n, s) {
|
|
1760
1760
|
}
|
|
1761
|
-
return e.type = "xstate.assign", e.assignment = t, e.resolve =
|
|
1761
|
+
return e.type = "xstate.assign", e.assignment = t, e.resolve = ps, e;
|
|
1762
1762
|
}
|
|
1763
1763
|
let se = /* @__PURE__ */ function(t) {
|
|
1764
1764
|
return t.Parent = "#_parent", t.Internal = "#_internal", t;
|
|
1765
1765
|
}({});
|
|
1766
|
-
function
|
|
1766
|
+
function ys(t, e, n, s, {
|
|
1767
1767
|
to: r,
|
|
1768
1768
|
event: i,
|
|
1769
1769
|
id: o,
|
|
@@ -1794,10 +1794,10 @@ function ms(t, e, n, s, {
|
|
|
1794
1794
|
delay: f
|
|
1795
1795
|
}];
|
|
1796
1796
|
}
|
|
1797
|
-
function
|
|
1797
|
+
function ms(t, e, n) {
|
|
1798
1798
|
typeof n.to == "string" && (n.to = e.children[n.to]);
|
|
1799
1799
|
}
|
|
1800
|
-
function
|
|
1800
|
+
function gs(t, e) {
|
|
1801
1801
|
t.defer(() => {
|
|
1802
1802
|
const {
|
|
1803
1803
|
to: n,
|
|
@@ -1814,14 +1814,14 @@ function Ss(t, e) {
|
|
|
1814
1814
|
// at this point, in a deferred task, it should already be mutated by retryResolveSendTo
|
|
1815
1815
|
// if it initially started as a string
|
|
1816
1816
|
n,
|
|
1817
|
-
s.type ===
|
|
1817
|
+
s.type === wn ? be(t.self.id, s.data) : s
|
|
1818
1818
|
);
|
|
1819
1819
|
});
|
|
1820
1820
|
}
|
|
1821
1821
|
function re(t, e, n) {
|
|
1822
1822
|
function s(r, i) {
|
|
1823
1823
|
}
|
|
1824
|
-
return s.type = "xsnapshot.sendTo", s.to = t, s.event = e, s.id = n == null ? void 0 : n.id, s.delay = n == null ? void 0 : n.delay, s.resolve =
|
|
1824
|
+
return s.type = "xsnapshot.sendTo", s.to = t, s.event = e, s.id = n == null ? void 0 : n.id, s.delay = n == null ? void 0 : n.delay, s.resolve = ys, s.retryResolve = ms, s.execute = gs, s;
|
|
1825
1825
|
}
|
|
1826
1826
|
const ie = /* @__PURE__ */ new WeakMap();
|
|
1827
1827
|
function U(t, e, n) {
|
|
@@ -1830,7 +1830,7 @@ function U(t, e, n) {
|
|
|
1830
1830
|
[e]: n()
|
|
1831
1831
|
}, ie.set(t, s)), s[e];
|
|
1832
1832
|
}
|
|
1833
|
-
const
|
|
1833
|
+
const Ss = {}, J = (t) => typeof t == "string" ? {
|
|
1834
1834
|
type: t
|
|
1835
1835
|
} : typeof t == "function" ? "resolve" in t ? {
|
|
1836
1836
|
type: t.type
|
|
@@ -1839,17 +1839,17 @@ const Es = {}, J = (t) => typeof t == "string" ? {
|
|
|
1839
1839
|
} : t;
|
|
1840
1840
|
class Nt {
|
|
1841
1841
|
constructor(e, n) {
|
|
1842
|
-
if (this.config = e, 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(
|
|
1842
|
+
if (this.config = e, 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(_e), 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 ? Vt(this.config.states, (s, r) => new Nt(s, {
|
|
1843
1843
|
_parent: this,
|
|
1844
1844
|
_key: r,
|
|
1845
1845
|
_machine: this.machine
|
|
1846
|
-
})) :
|
|
1846
|
+
})) : Ss, this.type === "compound" && !this.config.initial)
|
|
1847
1847
|
throw new Error(`No initial state specified for compound state node "#${this.id}". Try adding { initial: "${Object.keys(this.states)[0]}" } to the state config.`);
|
|
1848
1848
|
this.history = this.config.history === !0 ? "shallow" : this.config.history || !1, this.entry = I(this.config.entry).slice(), this.exit = I(this.config.exit).slice(), this.meta = this.config.meta, this.output = this.type === "final" || !this.parent ? this.config.output : void 0, this.tags = I(e.tags).slice();
|
|
1849
1849
|
}
|
|
1850
1850
|
/** @internal */
|
|
1851
1851
|
_initialize() {
|
|
1852
|
-
this.transitions =
|
|
1852
|
+
this.transitions = Bn(this), this.config.always && (this.always = N(this.config.always).map((e) => P(this, Te, e))), Object.keys(this.states).forEach((e) => {
|
|
1853
1853
|
this.states[e]._initialize();
|
|
1854
1854
|
});
|
|
1855
1855
|
}
|
|
@@ -1933,16 +1933,16 @@ class Nt {
|
|
|
1933
1933
|
return U(this, "on", () => [...this.transitions].flatMap(([n, s]) => s.map((r) => [n, r])).reduce((n, [s, r]) => (n[s] = n[s] || [], n[s].push(r), n), {}));
|
|
1934
1934
|
}
|
|
1935
1935
|
get after() {
|
|
1936
|
-
return U(this, "delayedTransitions", () =>
|
|
1936
|
+
return U(this, "delayedTransitions", () => Ln(this));
|
|
1937
1937
|
}
|
|
1938
1938
|
get initial() {
|
|
1939
|
-
return U(this, "initial", () =>
|
|
1939
|
+
return U(this, "initial", () => Fn(this, this.config.initial));
|
|
1940
1940
|
}
|
|
1941
1941
|
/** @internal */
|
|
1942
1942
|
next(e, n) {
|
|
1943
1943
|
const s = n.type, r = [];
|
|
1944
1944
|
let i;
|
|
1945
|
-
const o = U(this, `candidates-${s}`, () =>
|
|
1945
|
+
const o = U(this, `candidates-${s}`, () => $n(this, s));
|
|
1946
1946
|
for (const a of o) {
|
|
1947
1947
|
const {
|
|
1948
1948
|
guard: u
|
|
@@ -1990,7 +1990,7 @@ ${f.message}`);
|
|
|
1990
1990
|
return Array.from(e);
|
|
1991
1991
|
}
|
|
1992
1992
|
}
|
|
1993
|
-
const
|
|
1993
|
+
const Es = "#";
|
|
1994
1994
|
class jt {
|
|
1995
1995
|
constructor(e, n) {
|
|
1996
1996
|
this.config = e, 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 = e.id || "(machine)", this.implementations = {
|
|
@@ -2039,7 +2039,7 @@ class jt {
|
|
|
2039
2039
|
});
|
|
2040
2040
|
}
|
|
2041
2041
|
resolveState(e) {
|
|
2042
|
-
const n =
|
|
2042
|
+
const n = es(this.root, e.value), s = st(it(this.root, n));
|
|
2043
2043
|
return Z({
|
|
2044
2044
|
_nodes: [...s],
|
|
2045
2045
|
context: e.context || {},
|
|
@@ -2100,8 +2100,8 @@ class jt {
|
|
|
2100
2100
|
* Returns the initial `State` instance, with reference to `self` as an `ActorRef`.
|
|
2101
2101
|
*/
|
|
2102
2102
|
getInitialSnapshot(e, n) {
|
|
2103
|
-
const s =
|
|
2104
|
-
target: [...
|
|
2103
|
+
const s = Ae(n), r = [], i = this.getPreInitialState(e, s, r), o = vt([{
|
|
2104
|
+
target: [...Ue(this.root)],
|
|
2105
2105
|
source: this.root,
|
|
2106
2106
|
reenter: !0,
|
|
2107
2107
|
actions: [],
|
|
@@ -2119,7 +2119,7 @@ class jt {
|
|
|
2119
2119
|
});
|
|
2120
2120
|
}
|
|
2121
2121
|
getStateNodeById(e) {
|
|
2122
|
-
const n = Ot(e), s = n.slice(1), r = at(n[0]) ? n[0].slice(
|
|
2122
|
+
const n = Ot(e), s = n.slice(1), r = at(n[0]) ? n[0].slice(Es.length) : n[0], i = this.idMap.get(r);
|
|
2123
2123
|
if (!i)
|
|
2124
2124
|
throw new Error(`Child state node '#${r}' does not exist on machine '${this.id}'`);
|
|
2125
2125
|
return rt(i, s);
|
|
@@ -2131,7 +2131,7 @@ class jt {
|
|
|
2131
2131
|
return this.definition;
|
|
2132
2132
|
}
|
|
2133
2133
|
getPersistedSnapshot(e, n) {
|
|
2134
|
-
return
|
|
2134
|
+
return cs(e, n);
|
|
2135
2135
|
}
|
|
2136
2136
|
restoreSnapshot(e, n) {
|
|
2137
2137
|
const s = {}, r = e.children;
|
|
@@ -2173,7 +2173,7 @@ class jt {
|
|
|
2173
2173
|
return a(i.context, s), i;
|
|
2174
2174
|
}
|
|
2175
2175
|
}
|
|
2176
|
-
function
|
|
2176
|
+
function ws(t, e) {
|
|
2177
2177
|
return new jt(t, e);
|
|
2178
2178
|
}
|
|
2179
2179
|
function $t({
|
|
@@ -2184,7 +2184,7 @@ function $t({
|
|
|
2184
2184
|
delays: r
|
|
2185
2185
|
}) {
|
|
2186
2186
|
return {
|
|
2187
|
-
createMachine: (i) =>
|
|
2187
|
+
createMachine: (i) => ws({
|
|
2188
2188
|
...i,
|
|
2189
2189
|
schemas: t
|
|
2190
2190
|
}, {
|
|
@@ -2195,33 +2195,33 @@ function $t({
|
|
|
2195
2195
|
})
|
|
2196
2196
|
};
|
|
2197
2197
|
}
|
|
2198
|
-
function
|
|
2198
|
+
function Fe(t, e) {
|
|
2199
2199
|
return function() {
|
|
2200
2200
|
return t.apply(e, arguments);
|
|
2201
2201
|
};
|
|
2202
2202
|
}
|
|
2203
|
-
const { toString:
|
|
2204
|
-
const n =
|
|
2203
|
+
const { toString: _s } = Object.prototype, { getPrototypeOf: Lt } = Object, ct = ((t) => (e) => {
|
|
2204
|
+
const n = _s.call(e);
|
|
2205
2205
|
return t[n] || (t[n] = n.slice(8, -1).toLowerCase());
|
|
2206
2206
|
})(/* @__PURE__ */ Object.create(null)), A = (t) => (t = t.toLowerCase(), (e) => ct(e) === t), ut = (t) => (e) => typeof e === t, { isArray: z } = Array, K = ut("undefined");
|
|
2207
|
-
function
|
|
2207
|
+
function Ts(t) {
|
|
2208
2208
|
return t !== null && !K(t) && t.constructor !== null && !K(t.constructor) && T(t.constructor.isBuffer) && t.constructor.isBuffer(t);
|
|
2209
2209
|
}
|
|
2210
|
-
const
|
|
2211
|
-
function
|
|
2210
|
+
const He = A("ArrayBuffer");
|
|
2211
|
+
function vs(t) {
|
|
2212
2212
|
let e;
|
|
2213
|
-
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? e = ArrayBuffer.isView(t) : e = t && t.buffer &&
|
|
2213
|
+
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? e = ArrayBuffer.isView(t) : e = t && t.buffer && He(t.buffer), e;
|
|
2214
2214
|
}
|
|
2215
|
-
const
|
|
2215
|
+
const bs = ut("string"), T = ut("function"), ze = ut("number"), ft = (t) => t !== null && typeof t == "object", As = (t) => t === !0 || t === !1, Q = (t) => {
|
|
2216
2216
|
if (ct(t) !== "object")
|
|
2217
2217
|
return !1;
|
|
2218
2218
|
const e = Lt(t);
|
|
2219
2219
|
return (e === null || e === Object.prototype || Object.getPrototypeOf(e) === null) && !(Symbol.toStringTag in t) && !(Symbol.iterator in t);
|
|
2220
|
-
},
|
|
2220
|
+
}, xs = A("Date"), Rs = A("File"), Os = A("Blob"), ks = A("FileList"), Is = (t) => ft(t) && T(t.pipe), Cs = (t) => {
|
|
2221
2221
|
let e;
|
|
2222
2222
|
return t && (typeof FormData == "function" && t instanceof FormData || T(t.append) && ((e = ct(t)) === "formdata" || // detect form-data instance
|
|
2223
2223
|
e === "object" && T(t.toString) && t.toString() === "[object FormData]"));
|
|
2224
|
-
},
|
|
2224
|
+
}, Ps = A("URLSearchParams"), Ds = (t) => t.trim ? t.trim() : t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
2225
2225
|
function G(t, e, { allOwnKeys: n = !1 } = {}) {
|
|
2226
2226
|
if (t === null || typeof t > "u")
|
|
2227
2227
|
return;
|
|
@@ -2236,7 +2236,7 @@ function G(t, e, { allOwnKeys: n = !1 } = {}) {
|
|
|
2236
2236
|
a = i[s], e.call(null, t[a], a, t);
|
|
2237
2237
|
}
|
|
2238
2238
|
}
|
|
2239
|
-
function
|
|
2239
|
+
function Je(t, e) {
|
|
2240
2240
|
e = e.toLowerCase();
|
|
2241
2241
|
const n = Object.keys(t);
|
|
2242
2242
|
let s = n.length, r;
|
|
@@ -2245,23 +2245,23 @@ function qe(t, e) {
|
|
|
2245
2245
|
return r;
|
|
2246
2246
|
return null;
|
|
2247
2247
|
}
|
|
2248
|
-
const
|
|
2248
|
+
const qe = (() => typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global)(), We = (t) => !K(t) && t !== qe;
|
|
2249
2249
|
function bt() {
|
|
2250
|
-
const { caseless: t } =
|
|
2251
|
-
const i = t &&
|
|
2250
|
+
const { caseless: t } = We(this) && this || {}, e = {}, n = (s, r) => {
|
|
2251
|
+
const i = t && Je(e, r) || r;
|
|
2252
2252
|
Q(e[i]) && Q(s) ? e[i] = bt(e[i], s) : Q(s) ? e[i] = bt({}, s) : z(s) ? e[i] = s.slice() : e[i] = s;
|
|
2253
2253
|
};
|
|
2254
2254
|
for (let s = 0, r = arguments.length; s < r; s++)
|
|
2255
2255
|
arguments[s] && G(arguments[s], n);
|
|
2256
2256
|
return e;
|
|
2257
2257
|
}
|
|
2258
|
-
const
|
|
2259
|
-
n && T(r) ? t[i] =
|
|
2260
|
-
}, { allOwnKeys: s }), t),
|
|
2258
|
+
const Ms = (t, e, n, { allOwnKeys: s } = {}) => (G(e, (r, i) => {
|
|
2259
|
+
n && T(r) ? t[i] = Fe(r, n) : t[i] = r;
|
|
2260
|
+
}, { allOwnKeys: s }), t), Us = (t) => (t.charCodeAt(0) === 65279 && (t = t.slice(1)), t), Ns = (t, e, n, s) => {
|
|
2261
2261
|
t.prototype = Object.create(e.prototype, s), t.prototype.constructor = t, Object.defineProperty(t, "super", {
|
|
2262
2262
|
value: e.prototype
|
|
2263
2263
|
}), n && Object.assign(t.prototype, n);
|
|
2264
|
-
},
|
|
2264
|
+
}, js = (t, e, n, s) => {
|
|
2265
2265
|
let r, i, o;
|
|
2266
2266
|
const a = {};
|
|
2267
2267
|
if (e = e || {}, t == null)
|
|
@@ -2272,48 +2272,48 @@ const Us = (t, e, n, { allOwnKeys: s } = {}) => (G(e, (r, i) => {
|
|
|
2272
2272
|
t = n !== !1 && Lt(t);
|
|
2273
2273
|
} while (t && (!n || n(t, e)) && t !== Object.prototype);
|
|
2274
2274
|
return e;
|
|
2275
|
-
},
|
|
2275
|
+
}, $s = (t, e, n) => {
|
|
2276
2276
|
t = String(t), (n === void 0 || n > t.length) && (n = t.length), n -= e.length;
|
|
2277
2277
|
const s = t.indexOf(e, n);
|
|
2278
2278
|
return s !== -1 && s === n;
|
|
2279
|
-
},
|
|
2279
|
+
}, Ls = (t) => {
|
|
2280
2280
|
if (!t)
|
|
2281
2281
|
return null;
|
|
2282
2282
|
if (z(t))
|
|
2283
2283
|
return t;
|
|
2284
2284
|
let e = t.length;
|
|
2285
|
-
if (!
|
|
2285
|
+
if (!ze(e))
|
|
2286
2286
|
return null;
|
|
2287
2287
|
const n = new Array(e);
|
|
2288
2288
|
for (; e-- > 0; )
|
|
2289
2289
|
n[e] = t[e];
|
|
2290
2290
|
return n;
|
|
2291
|
-
},
|
|
2291
|
+
}, Bs = ((t) => (e) => t && e instanceof t)(typeof Uint8Array < "u" && Lt(Uint8Array)), Fs = (t, e) => {
|
|
2292
2292
|
const s = (t && t[Symbol.iterator]).call(t);
|
|
2293
2293
|
let r;
|
|
2294
2294
|
for (; (r = s.next()) && !r.done; ) {
|
|
2295
2295
|
const i = r.value;
|
|
2296
2296
|
e.call(t, i[0], i[1]);
|
|
2297
2297
|
}
|
|
2298
|
-
},
|
|
2298
|
+
}, Hs = (t, e) => {
|
|
2299
2299
|
let n;
|
|
2300
2300
|
const s = [];
|
|
2301
2301
|
for (; (n = t.exec(e)) !== null; )
|
|
2302
2302
|
s.push(n);
|
|
2303
2303
|
return s;
|
|
2304
|
-
},
|
|
2304
|
+
}, zs = A("HTMLFormElement"), Js = (t) => t.toLowerCase().replace(
|
|
2305
2305
|
/[-_\s]([a-z\d])(\w*)/g,
|
|
2306
2306
|
function(n, s, r) {
|
|
2307
2307
|
return s.toUpperCase() + r;
|
|
2308
2308
|
}
|
|
2309
|
-
), oe = (({ hasOwnProperty: t }) => (e, n) => t.call(e, n))(Object.prototype),
|
|
2309
|
+
), oe = (({ hasOwnProperty: t }) => (e, n) => t.call(e, n))(Object.prototype), qs = A("RegExp"), Ke = (t, e) => {
|
|
2310
2310
|
const n = Object.getOwnPropertyDescriptors(t), s = {};
|
|
2311
2311
|
G(n, (r, i) => {
|
|
2312
2312
|
let o;
|
|
2313
2313
|
(o = e(r, i, t)) !== !1 && (s[i] = o || r);
|
|
2314
2314
|
}), Object.defineProperties(t, s);
|
|
2315
|
-
},
|
|
2316
|
-
|
|
2315
|
+
}, Ws = (t) => {
|
|
2316
|
+
Ke(t, (e, n) => {
|
|
2317
2317
|
if (T(t) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
|
|
2318
2318
|
return !1;
|
|
2319
2319
|
const s = t[n];
|
|
@@ -2327,29 +2327,29 @@ const Us = (t, e, n, { allOwnKeys: s } = {}) => (G(e, (r, i) => {
|
|
|
2327
2327
|
});
|
|
2328
2328
|
}
|
|
2329
2329
|
});
|
|
2330
|
-
},
|
|
2330
|
+
}, Ks = (t, e) => {
|
|
2331
2331
|
const n = {}, s = (r) => {
|
|
2332
2332
|
r.forEach((i) => {
|
|
2333
2333
|
n[i] = !0;
|
|
2334
2334
|
});
|
|
2335
2335
|
};
|
|
2336
2336
|
return z(t) ? s(t) : s(String(t).split(e)), n;
|
|
2337
|
-
},
|
|
2338
|
-
},
|
|
2337
|
+
}, Vs = () => {
|
|
2338
|
+
}, Gs = (t, e) => (t = +t, Number.isFinite(t) ? t : e), mt = "abcdefghijklmnopqrstuvwxyz", ae = "0123456789", Ve = {
|
|
2339
2339
|
DIGIT: ae,
|
|
2340
2340
|
ALPHA: mt,
|
|
2341
2341
|
ALPHA_DIGIT: mt + mt.toUpperCase() + ae
|
|
2342
|
-
},
|
|
2342
|
+
}, Xs = (t = 16, e = Ve.ALPHA_DIGIT) => {
|
|
2343
2343
|
let n = "";
|
|
2344
2344
|
const { length: s } = e;
|
|
2345
2345
|
for (; t--; )
|
|
2346
2346
|
n += e[Math.random() * s | 0];
|
|
2347
2347
|
return n;
|
|
2348
2348
|
};
|
|
2349
|
-
function
|
|
2349
|
+
function Ys(t) {
|
|
2350
2350
|
return !!(t && T(t.append) && t[Symbol.toStringTag] === "FormData" && t[Symbol.iterator]);
|
|
2351
2351
|
}
|
|
2352
|
-
const
|
|
2352
|
+
const Zs = (t) => {
|
|
2353
2353
|
const e = new Array(10), n = (s, r) => {
|
|
2354
2354
|
if (ft(s)) {
|
|
2355
2355
|
if (e.indexOf(s) >= 0)
|
|
@@ -2366,59 +2366,59 @@ const Qs = (t) => {
|
|
|
2366
2366
|
return s;
|
|
2367
2367
|
};
|
|
2368
2368
|
return n(t, 0);
|
|
2369
|
-
},
|
|
2369
|
+
}, Qs = A("AsyncFunction"), tr = (t) => t && (ft(t) || T(t)) && T(t.then) && T(t.catch), d = {
|
|
2370
2370
|
isArray: z,
|
|
2371
|
-
isArrayBuffer:
|
|
2372
|
-
isBuffer:
|
|
2373
|
-
isFormData:
|
|
2374
|
-
isArrayBufferView:
|
|
2375
|
-
isString:
|
|
2376
|
-
isNumber:
|
|
2377
|
-
isBoolean:
|
|
2371
|
+
isArrayBuffer: He,
|
|
2372
|
+
isBuffer: Ts,
|
|
2373
|
+
isFormData: Cs,
|
|
2374
|
+
isArrayBufferView: vs,
|
|
2375
|
+
isString: bs,
|
|
2376
|
+
isNumber: ze,
|
|
2377
|
+
isBoolean: As,
|
|
2378
2378
|
isObject: ft,
|
|
2379
2379
|
isPlainObject: Q,
|
|
2380
2380
|
isUndefined: K,
|
|
2381
|
-
isDate:
|
|
2382
|
-
isFile:
|
|
2383
|
-
isBlob:
|
|
2384
|
-
isRegExp:
|
|
2381
|
+
isDate: xs,
|
|
2382
|
+
isFile: Rs,
|
|
2383
|
+
isBlob: Os,
|
|
2384
|
+
isRegExp: qs,
|
|
2385
2385
|
isFunction: T,
|
|
2386
|
-
isStream:
|
|
2387
|
-
isURLSearchParams:
|
|
2388
|
-
isTypedArray:
|
|
2389
|
-
isFileList:
|
|
2386
|
+
isStream: Is,
|
|
2387
|
+
isURLSearchParams: Ps,
|
|
2388
|
+
isTypedArray: Bs,
|
|
2389
|
+
isFileList: ks,
|
|
2390
2390
|
forEach: G,
|
|
2391
2391
|
merge: bt,
|
|
2392
|
-
extend:
|
|
2393
|
-
trim:
|
|
2394
|
-
stripBOM:
|
|
2395
|
-
inherits:
|
|
2396
|
-
toFlatObject:
|
|
2392
|
+
extend: Ms,
|
|
2393
|
+
trim: Ds,
|
|
2394
|
+
stripBOM: Us,
|
|
2395
|
+
inherits: Ns,
|
|
2396
|
+
toFlatObject: js,
|
|
2397
2397
|
kindOf: ct,
|
|
2398
2398
|
kindOfTest: A,
|
|
2399
|
-
endsWith:
|
|
2400
|
-
toArray:
|
|
2401
|
-
forEachEntry:
|
|
2402
|
-
matchAll:
|
|
2403
|
-
isHTMLForm:
|
|
2399
|
+
endsWith: $s,
|
|
2400
|
+
toArray: Ls,
|
|
2401
|
+
forEachEntry: Fs,
|
|
2402
|
+
matchAll: Hs,
|
|
2403
|
+
isHTMLForm: zs,
|
|
2404
2404
|
hasOwnProperty: oe,
|
|
2405
2405
|
hasOwnProp: oe,
|
|
2406
2406
|
// an alias to avoid ESLint no-prototype-builtins detection
|
|
2407
|
-
reduceDescriptors:
|
|
2408
|
-
freezeMethods:
|
|
2409
|
-
toObjectSet:
|
|
2410
|
-
toCamelCase:
|
|
2411
|
-
noop:
|
|
2412
|
-
toFiniteNumber:
|
|
2413
|
-
findKey:
|
|
2414
|
-
global:
|
|
2415
|
-
isContextDefined:
|
|
2416
|
-
ALPHABET:
|
|
2417
|
-
generateString:
|
|
2418
|
-
isSpecCompliantForm:
|
|
2419
|
-
toJSONObject:
|
|
2420
|
-
isAsyncFn:
|
|
2421
|
-
isThenable:
|
|
2407
|
+
reduceDescriptors: Ke,
|
|
2408
|
+
freezeMethods: Ws,
|
|
2409
|
+
toObjectSet: Ks,
|
|
2410
|
+
toCamelCase: Js,
|
|
2411
|
+
noop: Vs,
|
|
2412
|
+
toFiniteNumber: Gs,
|
|
2413
|
+
findKey: Je,
|
|
2414
|
+
global: qe,
|
|
2415
|
+
isContextDefined: We,
|
|
2416
|
+
ALPHABET: Ve,
|
|
2417
|
+
generateString: Xs,
|
|
2418
|
+
isSpecCompliantForm: Ys,
|
|
2419
|
+
toJSONObject: Zs,
|
|
2420
|
+
isAsyncFn: Qs,
|
|
2421
|
+
isThenable: tr
|
|
2422
2422
|
};
|
|
2423
2423
|
function g(t, e, n, s, r) {
|
|
2424
2424
|
Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = t, this.name = "AxiosError", e && (this.code = e), n && (this.config = n), s && (this.request = s), r && (this.response = r);
|
|
@@ -2444,7 +2444,7 @@ d.inherits(g, Error, {
|
|
|
2444
2444
|
};
|
|
2445
2445
|
}
|
|
2446
2446
|
});
|
|
2447
|
-
const
|
|
2447
|
+
const Ge = g.prototype, Xe = {};
|
|
2448
2448
|
[
|
|
2449
2449
|
"ERR_BAD_OPTION_VALUE",
|
|
2450
2450
|
"ERR_BAD_OPTION",
|
|
@@ -2460,32 +2460,32 @@ const Xe = g.prototype, Ye = {};
|
|
|
2460
2460
|
"ERR_INVALID_URL"
|
|
2461
2461
|
// eslint-disable-next-line func-names
|
|
2462
2462
|
].forEach((t) => {
|
|
2463
|
-
|
|
2463
|
+
Xe[t] = { value: t };
|
|
2464
2464
|
});
|
|
2465
|
-
Object.defineProperties(g,
|
|
2466
|
-
Object.defineProperty(
|
|
2465
|
+
Object.defineProperties(g, Xe);
|
|
2466
|
+
Object.defineProperty(Ge, "isAxiosError", { value: !0 });
|
|
2467
2467
|
g.from = (t, e, n, s, r, i) => {
|
|
2468
|
-
const o = Object.create(
|
|
2468
|
+
const o = Object.create(Ge);
|
|
2469
2469
|
return d.toFlatObject(t, o, function(u) {
|
|
2470
2470
|
return u !== Error.prototype;
|
|
2471
2471
|
}, (a) => a !== "isAxiosError"), g.call(o, t.message, e, n, s, r), o.cause = t, o.name = t.name, i && Object.assign(o, i), o;
|
|
2472
2472
|
};
|
|
2473
|
-
const
|
|
2473
|
+
const er = null;
|
|
2474
2474
|
function At(t) {
|
|
2475
2475
|
return d.isPlainObject(t) || d.isArray(t);
|
|
2476
2476
|
}
|
|
2477
|
-
function
|
|
2477
|
+
function Ye(t) {
|
|
2478
2478
|
return d.endsWith(t, "[]") ? t.slice(0, -2) : t;
|
|
2479
2479
|
}
|
|
2480
2480
|
function ce(t, e, n) {
|
|
2481
2481
|
return t ? t.concat(e).map(function(r, i) {
|
|
2482
|
-
return r =
|
|
2482
|
+
return r = Ye(r), !n && i ? "[" + r + "]" : r;
|
|
2483
2483
|
}).join(n ? "." : "") : e;
|
|
2484
2484
|
}
|
|
2485
|
-
function
|
|
2485
|
+
function nr(t) {
|
|
2486
2486
|
return d.isArray(t) && !t.some(At);
|
|
2487
2487
|
}
|
|
2488
|
-
const
|
|
2488
|
+
const sr = d.toFlatObject(d, {}, null, function(e) {
|
|
2489
2489
|
return /^is[A-Z]/.test(e);
|
|
2490
2490
|
});
|
|
2491
2491
|
function lt(t, e, n) {
|
|
@@ -2515,18 +2515,18 @@ function lt(t, e, n) {
|
|
|
2515
2515
|
if (h && !S && typeof h == "object") {
|
|
2516
2516
|
if (d.endsWith(m, "{}"))
|
|
2517
2517
|
m = s ? m : m.slice(0, -2), h = JSON.stringify(h);
|
|
2518
|
-
else if (d.isArray(h) &&
|
|
2519
|
-
return m =
|
|
2518
|
+
else if (d.isArray(h) && nr(h) || (d.isFileList(h) || d.endsWith(m, "[]")) && (E = d.toArray(h)))
|
|
2519
|
+
return m = Ye(m), E.forEach(function(Y, fn) {
|
|
2520
2520
|
!(d.isUndefined(Y) || Y === null) && e.append(
|
|
2521
2521
|
// eslint-disable-next-line no-nested-ternary
|
|
2522
|
-
o === !0 ? ce([m],
|
|
2522
|
+
o === !0 ? ce([m], fn, i) : o === null ? m : m + "[]",
|
|
2523
2523
|
c(Y)
|
|
2524
2524
|
);
|
|
2525
2525
|
}), !1;
|
|
2526
2526
|
}
|
|
2527
2527
|
return At(h) ? !0 : (e.append(ce(S, m, i), c(h)), !1);
|
|
2528
2528
|
}
|
|
2529
|
-
const f = [], p = Object.assign(
|
|
2529
|
+
const f = [], p = Object.assign(sr, {
|
|
2530
2530
|
defaultVisitor: l,
|
|
2531
2531
|
convertValue: c,
|
|
2532
2532
|
isVisitable: At
|
|
@@ -2567,11 +2567,11 @@ function ue(t) {
|
|
|
2567
2567
|
function Bt(t, e) {
|
|
2568
2568
|
this._pairs = [], t && lt(t, this, e);
|
|
2569
2569
|
}
|
|
2570
|
-
const
|
|
2571
|
-
|
|
2570
|
+
const Ze = Bt.prototype;
|
|
2571
|
+
Ze.append = function(e, n) {
|
|
2572
2572
|
this._pairs.push([e, n]);
|
|
2573
2573
|
};
|
|
2574
|
-
|
|
2574
|
+
Ze.toString = function(e) {
|
|
2575
2575
|
const n = e ? function(s) {
|
|
2576
2576
|
return e.call(this, s, ue);
|
|
2577
2577
|
} : ue;
|
|
@@ -2579,13 +2579,13 @@ Qe.toString = function(e) {
|
|
|
2579
2579
|
return n(r[0]) + "=" + n(r[1]);
|
|
2580
2580
|
}, "").join("&");
|
|
2581
2581
|
};
|
|
2582
|
-
function
|
|
2582
|
+
function rr(t) {
|
|
2583
2583
|
return encodeURIComponent(t).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
|
|
2584
2584
|
}
|
|
2585
|
-
function
|
|
2585
|
+
function Qe(t, e, n) {
|
|
2586
2586
|
if (!e)
|
|
2587
2587
|
return t;
|
|
2588
|
-
const s = n && n.encode ||
|
|
2588
|
+
const s = n && n.encode || rr, r = n && n.serialize;
|
|
2589
2589
|
let i;
|
|
2590
2590
|
if (r ? i = r(e, n) : i = d.isURLSearchParams(e) ? e.toString() : new Bt(e, n).toString(s), i) {
|
|
2591
2591
|
const o = t.indexOf("#");
|
|
@@ -2593,7 +2593,7 @@ function tn(t, e, n) {
|
|
|
2593
2593
|
}
|
|
2594
2594
|
return t;
|
|
2595
2595
|
}
|
|
2596
|
-
class
|
|
2596
|
+
class ir {
|
|
2597
2597
|
constructor() {
|
|
2598
2598
|
this.handlers = [];
|
|
2599
2599
|
}
|
|
@@ -2647,36 +2647,36 @@ class or {
|
|
|
2647
2647
|
});
|
|
2648
2648
|
}
|
|
2649
2649
|
}
|
|
2650
|
-
const fe =
|
|
2650
|
+
const fe = ir, tn = {
|
|
2651
2651
|
silentJSONParsing: !0,
|
|
2652
2652
|
forcedJSONParsing: !0,
|
|
2653
2653
|
clarifyTimeoutError: !1
|
|
2654
|
-
},
|
|
2654
|
+
}, or = typeof URLSearchParams < "u" ? URLSearchParams : Bt, ar = typeof FormData < "u" ? FormData : null, cr = typeof Blob < "u" ? Blob : null, ur = (() => {
|
|
2655
2655
|
let t;
|
|
2656
2656
|
return typeof navigator < "u" && ((t = navigator.product) === "ReactNative" || t === "NativeScript" || t === "NS") ? !1 : typeof window < "u" && typeof document < "u";
|
|
2657
|
-
})(),
|
|
2657
|
+
})(), fr = (() => typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
|
|
2658
2658
|
self instanceof WorkerGlobalScope && typeof self.importScripts == "function")(), b = {
|
|
2659
2659
|
isBrowser: !0,
|
|
2660
2660
|
classes: {
|
|
2661
|
-
URLSearchParams:
|
|
2662
|
-
FormData:
|
|
2663
|
-
Blob:
|
|
2661
|
+
URLSearchParams: or,
|
|
2662
|
+
FormData: ar,
|
|
2663
|
+
Blob: cr
|
|
2664
2664
|
},
|
|
2665
|
-
isStandardBrowserEnv:
|
|
2666
|
-
isStandardBrowserWebWorkerEnv:
|
|
2665
|
+
isStandardBrowserEnv: ur,
|
|
2666
|
+
isStandardBrowserWebWorkerEnv: fr,
|
|
2667
2667
|
protocols: ["http", "https", "file", "blob", "url", "data"]
|
|
2668
2668
|
};
|
|
2669
|
-
function
|
|
2669
|
+
function lr(t, e) {
|
|
2670
2670
|
return lt(t, new b.classes.URLSearchParams(), Object.assign({
|
|
2671
2671
|
visitor: function(n, s, r, i) {
|
|
2672
2672
|
return b.isNode && d.isBuffer(n) ? (this.append(s, n.toString("base64")), !1) : i.defaultVisitor.apply(this, arguments);
|
|
2673
2673
|
}
|
|
2674
2674
|
}, e));
|
|
2675
2675
|
}
|
|
2676
|
-
function
|
|
2676
|
+
function dr(t) {
|
|
2677
2677
|
return d.matchAll(/\w+|\[(\w*)]/g, t).map((e) => e[0] === "[]" ? "" : e[1] || e[0]);
|
|
2678
2678
|
}
|
|
2679
|
-
function
|
|
2679
|
+
function hr(t) {
|
|
2680
2680
|
const e = {}, n = Object.keys(t);
|
|
2681
2681
|
let s;
|
|
2682
2682
|
const r = n.length;
|
|
@@ -2685,21 +2685,21 @@ function pr(t) {
|
|
|
2685
2685
|
i = n[s], e[i] = t[i];
|
|
2686
2686
|
return e;
|
|
2687
2687
|
}
|
|
2688
|
-
function
|
|
2688
|
+
function en(t) {
|
|
2689
2689
|
function e(n, s, r, i) {
|
|
2690
2690
|
let o = n[i++];
|
|
2691
2691
|
const a = Number.isFinite(+o), u = i >= n.length;
|
|
2692
|
-
return o = !o && d.isArray(r) ? r.length : o, u ? (d.hasOwnProp(r, o) ? r[o] = [r[o], s] : r[o] = s, !a) : ((!r[o] || !d.isObject(r[o])) && (r[o] = []), e(n, s, r[o], i) && d.isArray(r[o]) && (r[o] =
|
|
2692
|
+
return o = !o && d.isArray(r) ? r.length : o, u ? (d.hasOwnProp(r, o) ? r[o] = [r[o], s] : r[o] = s, !a) : ((!r[o] || !d.isObject(r[o])) && (r[o] = []), e(n, s, r[o], i) && d.isArray(r[o]) && (r[o] = hr(r[o])), !a);
|
|
2693
2693
|
}
|
|
2694
2694
|
if (d.isFormData(t) && d.isFunction(t.entries)) {
|
|
2695
2695
|
const n = {};
|
|
2696
2696
|
return d.forEachEntry(t, (s, r) => {
|
|
2697
|
-
e(
|
|
2697
|
+
e(dr(s), r, n, 0);
|
|
2698
2698
|
}), n;
|
|
2699
2699
|
}
|
|
2700
2700
|
return null;
|
|
2701
2701
|
}
|
|
2702
|
-
function
|
|
2702
|
+
function pr(t, e, n) {
|
|
2703
2703
|
if (d.isString(t))
|
|
2704
2704
|
try {
|
|
2705
2705
|
return (e || JSON.parse)(t), d.trim(t);
|
|
@@ -2710,12 +2710,12 @@ function yr(t, e, n) {
|
|
|
2710
2710
|
return (n || JSON.stringify)(t);
|
|
2711
2711
|
}
|
|
2712
2712
|
const Ft = {
|
|
2713
|
-
transitional:
|
|
2713
|
+
transitional: tn,
|
|
2714
2714
|
adapter: b.isNode ? "http" : "xhr",
|
|
2715
2715
|
transformRequest: [function(e, n) {
|
|
2716
2716
|
const s = n.getContentType() || "", r = s.indexOf("application/json") > -1, i = d.isObject(e);
|
|
2717
2717
|
if (i && d.isHTMLForm(e) && (e = new FormData(e)), d.isFormData(e))
|
|
2718
|
-
return r && r ? JSON.stringify(
|
|
2718
|
+
return r && r ? JSON.stringify(en(e)) : e;
|
|
2719
2719
|
if (d.isArrayBuffer(e) || d.isBuffer(e) || d.isStream(e) || d.isFile(e) || d.isBlob(e))
|
|
2720
2720
|
return e;
|
|
2721
2721
|
if (d.isArrayBufferView(e))
|
|
@@ -2725,7 +2725,7 @@ const Ft = {
|
|
|
2725
2725
|
let a;
|
|
2726
2726
|
if (i) {
|
|
2727
2727
|
if (s.indexOf("application/x-www-form-urlencoded") > -1)
|
|
2728
|
-
return
|
|
2728
|
+
return lr(e, this.formSerializer).toString();
|
|
2729
2729
|
if ((a = d.isFileList(e)) || s.indexOf("multipart/form-data") > -1) {
|
|
2730
2730
|
const u = this.env && this.env.FormData;
|
|
2731
2731
|
return lt(
|
|
@@ -2735,7 +2735,7 @@ const Ft = {
|
|
|
2735
2735
|
);
|
|
2736
2736
|
}
|
|
2737
2737
|
}
|
|
2738
|
-
return i || r ? (n.setContentType("application/json", !1),
|
|
2738
|
+
return i || r ? (n.setContentType("application/json", !1), pr(e)) : e;
|
|
2739
2739
|
}],
|
|
2740
2740
|
transformResponse: [function(e) {
|
|
2741
2741
|
const n = this.transitional || Ft.transitional, s = n && n.forcedJSONParsing, r = this.responseType === "json";
|
|
@@ -2776,7 +2776,7 @@ const Ft = {
|
|
|
2776
2776
|
d.forEach(["delete", "get", "head", "post", "put", "patch"], (t) => {
|
|
2777
2777
|
Ft.headers[t] = {};
|
|
2778
2778
|
});
|
|
2779
|
-
const Ht = Ft,
|
|
2779
|
+
const Ht = Ft, yr = d.toObjectSet([
|
|
2780
2780
|
"age",
|
|
2781
2781
|
"authorization",
|
|
2782
2782
|
"content-length",
|
|
@@ -2794,12 +2794,12 @@ const Ht = Ft, mr = d.toObjectSet([
|
|
|
2794
2794
|
"referer",
|
|
2795
2795
|
"retry-after",
|
|
2796
2796
|
"user-agent"
|
|
2797
|
-
]),
|
|
2797
|
+
]), mr = (t) => {
|
|
2798
2798
|
const e = {};
|
|
2799
2799
|
let n, s, r;
|
|
2800
2800
|
return t && t.split(`
|
|
2801
2801
|
`).forEach(function(o) {
|
|
2802
|
-
r = o.indexOf(":"), n = o.substring(0, r).trim().toLowerCase(), s = o.substring(r + 1).trim(), !(!n || e[n] &&
|
|
2802
|
+
r = o.indexOf(":"), n = o.substring(0, r).trim().toLowerCase(), s = o.substring(r + 1).trim(), !(!n || e[n] && yr[n]) && (n === "set-cookie" ? e[n] ? e[n].push(s) : e[n] = [s] : e[n] = e[n] ? e[n] + ", " + s : s);
|
|
2803
2803
|
}), e;
|
|
2804
2804
|
}, le = Symbol("internals");
|
|
2805
2805
|
function q(t) {
|
|
@@ -2808,14 +2808,14 @@ function q(t) {
|
|
|
2808
2808
|
function tt(t) {
|
|
2809
2809
|
return t === !1 || t == null ? t : d.isArray(t) ? t.map(tt) : String(t);
|
|
2810
2810
|
}
|
|
2811
|
-
function
|
|
2811
|
+
function gr(t) {
|
|
2812
2812
|
const e = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
2813
2813
|
let s;
|
|
2814
2814
|
for (; s = n.exec(t); )
|
|
2815
2815
|
e[s[1]] = s[2];
|
|
2816
2816
|
return e;
|
|
2817
2817
|
}
|
|
2818
|
-
const
|
|
2818
|
+
const Sr = (t) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());
|
|
2819
2819
|
function gt(t, e, n, s, r) {
|
|
2820
2820
|
if (d.isFunction(s))
|
|
2821
2821
|
return s.call(this, e, n);
|
|
@@ -2826,10 +2826,10 @@ function gt(t, e, n, s, r) {
|
|
|
2826
2826
|
return s.test(e);
|
|
2827
2827
|
}
|
|
2828
2828
|
}
|
|
2829
|
-
function
|
|
2829
|
+
function Er(t) {
|
|
2830
2830
|
return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (e, n, s) => n.toUpperCase() + s);
|
|
2831
2831
|
}
|
|
2832
|
-
function
|
|
2832
|
+
function wr(t, e) {
|
|
2833
2833
|
const n = d.toCamelCase(" " + e);
|
|
2834
2834
|
["get", "set", "has"].forEach((s) => {
|
|
2835
2835
|
Object.defineProperty(t, s + n, {
|
|
@@ -2854,7 +2854,7 @@ class dt {
|
|
|
2854
2854
|
(!f || r[f] === void 0 || c === !0 || c === void 0 && r[f] !== !1) && (r[f || u] = tt(a));
|
|
2855
2855
|
}
|
|
2856
2856
|
const o = (a, u) => d.forEach(a, (c, l) => i(c, l, u));
|
|
2857
|
-
return d.isPlainObject(e) || e instanceof this.constructor ? o(e, n) : d.isString(e) && (e = e.trim()) && !
|
|
2857
|
+
return d.isPlainObject(e) || e instanceof this.constructor ? o(e, n) : d.isString(e) && (e = e.trim()) && !Sr(e) ? o(mr(e), n) : e != null && i(n, e, s), this;
|
|
2858
2858
|
}
|
|
2859
2859
|
get(e, n) {
|
|
2860
2860
|
if (e = q(e), e) {
|
|
@@ -2864,7 +2864,7 @@ class dt {
|
|
|
2864
2864
|
if (!n)
|
|
2865
2865
|
return r;
|
|
2866
2866
|
if (n === !0)
|
|
2867
|
-
return
|
|
2867
|
+
return gr(r);
|
|
2868
2868
|
if (d.isFunction(n))
|
|
2869
2869
|
return n.call(this, r, s);
|
|
2870
2870
|
if (d.isRegExp(n))
|
|
@@ -2908,7 +2908,7 @@ class dt {
|
|
|
2908
2908
|
n[o] = tt(r), delete n[i];
|
|
2909
2909
|
return;
|
|
2910
2910
|
}
|
|
2911
|
-
const a = e ?
|
|
2911
|
+
const a = e ? Er(i) : String(i).trim();
|
|
2912
2912
|
a !== i && delete n[i], n[a] = tt(r), s[a] = !0;
|
|
2913
2913
|
}), this;
|
|
2914
2914
|
}
|
|
@@ -2944,7 +2944,7 @@ class dt {
|
|
|
2944
2944
|
}).accessors, r = this.prototype;
|
|
2945
2945
|
function i(o) {
|
|
2946
2946
|
const a = q(o);
|
|
2947
|
-
s[a] || (
|
|
2947
|
+
s[a] || (wr(r, o), s[a] = !0);
|
|
2948
2948
|
}
|
|
2949
2949
|
return d.isArray(e) ? e.forEach(i) : i(e), this;
|
|
2950
2950
|
}
|
|
@@ -2968,7 +2968,7 @@ function St(t, e) {
|
|
|
2968
2968
|
i = a.call(n, i, r.normalize(), e ? e.status : void 0);
|
|
2969
2969
|
}), r.normalize(), i;
|
|
2970
2970
|
}
|
|
2971
|
-
function
|
|
2971
|
+
function nn(t) {
|
|
2972
2972
|
return !!(t && t.__CANCEL__);
|
|
2973
2973
|
}
|
|
2974
2974
|
function X(t, e, n) {
|
|
@@ -2977,7 +2977,7 @@ function X(t, e, n) {
|
|
|
2977
2977
|
d.inherits(X, g, {
|
|
2978
2978
|
__CANCEL__: !0
|
|
2979
2979
|
});
|
|
2980
|
-
function
|
|
2980
|
+
function _r(t, e, n) {
|
|
2981
2981
|
const s = n.config.validateStatus;
|
|
2982
2982
|
!n.status || !s || s(n.status) ? t(n) : e(new g(
|
|
2983
2983
|
"Request failed with status code " + n.status,
|
|
@@ -2987,7 +2987,7 @@ function Tr(t, e, n) {
|
|
|
2987
2987
|
n
|
|
2988
2988
|
));
|
|
2989
2989
|
}
|
|
2990
|
-
const
|
|
2990
|
+
const Tr = b.isStandardBrowserEnv ? (
|
|
2991
2991
|
// Standard browser envs support document.cookie
|
|
2992
2992
|
function() {
|
|
2993
2993
|
return {
|
|
@@ -3018,16 +3018,16 @@ const vr = b.isStandardBrowserEnv ? (
|
|
|
3018
3018
|
};
|
|
3019
3019
|
}()
|
|
3020
3020
|
);
|
|
3021
|
-
function
|
|
3021
|
+
function vr(t) {
|
|
3022
3022
|
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);
|
|
3023
3023
|
}
|
|
3024
|
-
function
|
|
3024
|
+
function br(t, e) {
|
|
3025
3025
|
return e ? t.replace(/\/+$/, "") + "/" + e.replace(/^\/+/, "") : t;
|
|
3026
3026
|
}
|
|
3027
|
-
function
|
|
3028
|
-
return t && !
|
|
3027
|
+
function sn(t, e) {
|
|
3028
|
+
return t && !vr(e) ? br(t, e) : e;
|
|
3029
3029
|
}
|
|
3030
|
-
const
|
|
3030
|
+
const Ar = b.isStandardBrowserEnv ? (
|
|
3031
3031
|
// Standard browser envs have full support of the APIs needed to test
|
|
3032
3032
|
// whether the request URL is of the same origin as current location.
|
|
3033
3033
|
function() {
|
|
@@ -3059,11 +3059,11 @@ const xr = b.isStandardBrowserEnv ? (
|
|
|
3059
3059
|
};
|
|
3060
3060
|
}()
|
|
3061
3061
|
);
|
|
3062
|
-
function
|
|
3062
|
+
function xr(t) {
|
|
3063
3063
|
const e = /^([-+\w]{1,25})(:?\/\/|:)/.exec(t);
|
|
3064
3064
|
return e && e[1] || "";
|
|
3065
3065
|
}
|
|
3066
|
-
function
|
|
3066
|
+
function Rr(t, e) {
|
|
3067
3067
|
t = t || 10;
|
|
3068
3068
|
const n = new Array(t), s = new Array(t);
|
|
3069
3069
|
let r = 0, i = 0, o;
|
|
@@ -3081,7 +3081,7 @@ function Or(t, e) {
|
|
|
3081
3081
|
}
|
|
3082
3082
|
function de(t, e) {
|
|
3083
3083
|
let n = 0;
|
|
3084
|
-
const s =
|
|
3084
|
+
const s = Rr(50, 250);
|
|
3085
3085
|
return (r) => {
|
|
3086
3086
|
const i = r.loaded, o = r.lengthComputable ? r.total : void 0, a = i - n, u = s(a), c = i <= o;
|
|
3087
3087
|
n = i;
|
|
@@ -3097,7 +3097,7 @@ function de(t, e) {
|
|
|
3097
3097
|
l[e ? "download" : "upload"] = !0, t(l);
|
|
3098
3098
|
};
|
|
3099
3099
|
}
|
|
3100
|
-
const
|
|
3100
|
+
const Or = typeof XMLHttpRequest < "u", kr = Or && function(t) {
|
|
3101
3101
|
return new Promise(function(n, s) {
|
|
3102
3102
|
let r = t.data;
|
|
3103
3103
|
const i = R.from(t.headers).normalize(), o = t.responseType;
|
|
@@ -3111,8 +3111,8 @@ const kr = typeof XMLHttpRequest < "u", Ir = kr && function(t) {
|
|
|
3111
3111
|
const y = t.auth.username || "", h = t.auth.password ? unescape(encodeURIComponent(t.auth.password)) : "";
|
|
3112
3112
|
i.set("Authorization", "Basic " + btoa(y + ":" + h));
|
|
3113
3113
|
}
|
|
3114
|
-
const l =
|
|
3115
|
-
c.open(t.method.toUpperCase(),
|
|
3114
|
+
const l = sn(t.baseURL, t.url);
|
|
3115
|
+
c.open(t.method.toUpperCase(), Qe(l, t.params, t.paramsSerializer), !0), c.timeout = t.timeout;
|
|
3116
3116
|
function f() {
|
|
3117
3117
|
if (!c)
|
|
3118
3118
|
return;
|
|
@@ -3126,7 +3126,7 @@ const kr = typeof XMLHttpRequest < "u", Ir = kr && function(t) {
|
|
|
3126
3126
|
config: t,
|
|
3127
3127
|
request: c
|
|
3128
3128
|
};
|
|
3129
|
-
|
|
3129
|
+
_r(function(E) {
|
|
3130
3130
|
n(E), u();
|
|
3131
3131
|
}, function(E) {
|
|
3132
3132
|
s(E), u();
|
|
@@ -3140,7 +3140,7 @@ const kr = typeof XMLHttpRequest < "u", Ir = kr && function(t) {
|
|
|
3140
3140
|
s(new g("Network Error", g.ERR_NETWORK, t, c)), c = null;
|
|
3141
3141
|
}, c.ontimeout = function() {
|
|
3142
3142
|
let h = t.timeout ? "timeout of " + t.timeout + "ms exceeded" : "timeout exceeded";
|
|
3143
|
-
const m = t.transitional ||
|
|
3143
|
+
const m = t.transitional || tn;
|
|
3144
3144
|
t.timeoutErrorMessage && (h = t.timeoutErrorMessage), s(new g(
|
|
3145
3145
|
h,
|
|
3146
3146
|
m.clarifyTimeoutError ? g.ETIMEDOUT : g.ECONNABORTED,
|
|
@@ -3148,7 +3148,7 @@ const kr = typeof XMLHttpRequest < "u", Ir = kr && function(t) {
|
|
|
3148
3148
|
c
|
|
3149
3149
|
)), c = null;
|
|
3150
3150
|
}, b.isStandardBrowserEnv) {
|
|
3151
|
-
const y = (t.withCredentials ||
|
|
3151
|
+
const y = (t.withCredentials || Ar(l)) && t.xsrfCookieName && Tr.read(t.xsrfCookieName);
|
|
3152
3152
|
y && i.set(t.xsrfHeaderName, y);
|
|
3153
3153
|
}
|
|
3154
3154
|
r === void 0 && i.setContentType(null), "setRequestHeader" in c && d.forEach(i.toJSON(), function(h, m) {
|
|
@@ -3156,7 +3156,7 @@ const kr = typeof XMLHttpRequest < "u", Ir = kr && function(t) {
|
|
|
3156
3156
|
}), d.isUndefined(t.withCredentials) || (c.withCredentials = !!t.withCredentials), o && o !== "json" && (c.responseType = t.responseType), typeof t.onDownloadProgress == "function" && c.addEventListener("progress", de(t.onDownloadProgress, !0)), typeof t.onUploadProgress == "function" && c.upload && c.upload.addEventListener("progress", de(t.onUploadProgress)), (t.cancelToken || t.signal) && (a = (y) => {
|
|
3157
3157
|
c && (s(!y || y.type ? new X(null, t, c) : y), c.abort(), c = null);
|
|
3158
3158
|
}, t.cancelToken && t.cancelToken.subscribe(a), t.signal && (t.signal.aborted ? a() : t.signal.addEventListener("abort", a)));
|
|
3159
|
-
const p =
|
|
3159
|
+
const p = xr(l);
|
|
3160
3160
|
if (p && b.protocols.indexOf(p) === -1) {
|
|
3161
3161
|
s(new g("Unsupported protocol " + p + ":", g.ERR_BAD_REQUEST, t));
|
|
3162
3162
|
return;
|
|
@@ -3164,8 +3164,8 @@ const kr = typeof XMLHttpRequest < "u", Ir = kr && function(t) {
|
|
|
3164
3164
|
c.send(r || null);
|
|
3165
3165
|
});
|
|
3166
3166
|
}, et = {
|
|
3167
|
-
http:
|
|
3168
|
-
xhr:
|
|
3167
|
+
http: er,
|
|
3168
|
+
xhr: kr
|
|
3169
3169
|
};
|
|
3170
3170
|
d.forEach(et, (t, e) => {
|
|
3171
3171
|
if (t) {
|
|
@@ -3176,7 +3176,7 @@ d.forEach(et, (t, e) => {
|
|
|
3176
3176
|
Object.defineProperty(t, "adapterName", { value: e });
|
|
3177
3177
|
}
|
|
3178
3178
|
});
|
|
3179
|
-
const
|
|
3179
|
+
const rn = {
|
|
3180
3180
|
getAdapter: (t) => {
|
|
3181
3181
|
t = d.isArray(t) ? t : [t];
|
|
3182
3182
|
const { length: e } = t;
|
|
@@ -3204,14 +3204,14 @@ function he(t) {
|
|
|
3204
3204
|
return Et(t), t.headers = R.from(t.headers), t.data = St.call(
|
|
3205
3205
|
t,
|
|
3206
3206
|
t.transformRequest
|
|
3207
|
-
), ["post", "put", "patch"].indexOf(t.method) !== -1 && t.headers.setContentType("application/x-www-form-urlencoded", !1),
|
|
3207
|
+
), ["post", "put", "patch"].indexOf(t.method) !== -1 && t.headers.setContentType("application/x-www-form-urlencoded", !1), rn.getAdapter(t.adapter || Ht.adapter)(t).then(function(s) {
|
|
3208
3208
|
return Et(t), s.data = St.call(
|
|
3209
3209
|
t,
|
|
3210
3210
|
t.transformResponse,
|
|
3211
3211
|
s
|
|
3212
3212
|
), s.headers = R.from(s.headers), s;
|
|
3213
3213
|
}, function(s) {
|
|
3214
|
-
return
|
|
3214
|
+
return nn(s) || (Et(t), s && s.response && (s.response.data = St.call(
|
|
3215
3215
|
t,
|
|
3216
3216
|
t.transformResponse,
|
|
3217
3217
|
s.response
|
|
@@ -3284,7 +3284,7 @@ function H(t, e) {
|
|
|
3284
3284
|
d.isUndefined(p) && f !== a || (n[l] = p);
|
|
3285
3285
|
}), n;
|
|
3286
3286
|
}
|
|
3287
|
-
const
|
|
3287
|
+
const on = "1.5.0", zt = {};
|
|
3288
3288
|
["object", "boolean", "number", "function", "string", "symbol"].forEach((t, e) => {
|
|
3289
3289
|
zt[t] = function(s) {
|
|
3290
3290
|
return typeof s === t || "a" + (e < 1 ? "n " : " ") + t;
|
|
@@ -3293,7 +3293,7 @@ const an = "1.5.0", zt = {};
|
|
|
3293
3293
|
const ye = {};
|
|
3294
3294
|
zt.transitional = function(e, n, s) {
|
|
3295
3295
|
function r(i, o) {
|
|
3296
|
-
return "[Axios v" +
|
|
3296
|
+
return "[Axios v" + on + "] Transitional option '" + i + "'" + o + (s ? ". " + s : "");
|
|
3297
3297
|
}
|
|
3298
3298
|
return (i, o, a) => {
|
|
3299
3299
|
if (e === !1)
|
|
@@ -3309,7 +3309,7 @@ zt.transitional = function(e, n, s) {
|
|
|
3309
3309
|
)), e ? e(i, o, a) : !0;
|
|
3310
3310
|
};
|
|
3311
3311
|
};
|
|
3312
|
-
function
|
|
3312
|
+
function Ir(t, e, n) {
|
|
3313
3313
|
if (typeof t != "object")
|
|
3314
3314
|
throw new g("options must be an object", g.ERR_BAD_OPTION_VALUE);
|
|
3315
3315
|
const s = Object.keys(t);
|
|
@@ -3327,7 +3327,7 @@ function Cr(t, e, n) {
|
|
|
3327
3327
|
}
|
|
3328
3328
|
}
|
|
3329
3329
|
const xt = {
|
|
3330
|
-
assertOptions:
|
|
3330
|
+
assertOptions: Ir,
|
|
3331
3331
|
validators: zt
|
|
3332
3332
|
}, k = xt.validators;
|
|
3333
3333
|
class ot {
|
|
@@ -3406,8 +3406,8 @@ class ot {
|
|
|
3406
3406
|
}
|
|
3407
3407
|
getUri(e) {
|
|
3408
3408
|
e = H(this.defaults, e);
|
|
3409
|
-
const n =
|
|
3410
|
-
return
|
|
3409
|
+
const n = sn(e.baseURL, e.url);
|
|
3410
|
+
return Qe(n, e.params, e.paramsSerializer);
|
|
3411
3411
|
}
|
|
3412
3412
|
}
|
|
3413
3413
|
d.forEach(["delete", "get", "head", "options"], function(e) {
|
|
@@ -3503,13 +3503,13 @@ class Jt {
|
|
|
3503
3503
|
};
|
|
3504
3504
|
}
|
|
3505
3505
|
}
|
|
3506
|
-
const
|
|
3507
|
-
function
|
|
3506
|
+
const Cr = Jt;
|
|
3507
|
+
function Pr(t) {
|
|
3508
3508
|
return function(n) {
|
|
3509
3509
|
return t.apply(null, n);
|
|
3510
3510
|
};
|
|
3511
3511
|
}
|
|
3512
|
-
function
|
|
3512
|
+
function Dr(t) {
|
|
3513
3513
|
return d.isObject(t) && t.isAxiosError === !0;
|
|
3514
3514
|
}
|
|
3515
3515
|
const Rt = {
|
|
@@ -3580,42 +3580,42 @@ const Rt = {
|
|
|
3580
3580
|
Object.entries(Rt).forEach(([t, e]) => {
|
|
3581
3581
|
Rt[e] = t;
|
|
3582
3582
|
});
|
|
3583
|
-
const
|
|
3584
|
-
function
|
|
3585
|
-
const e = new nt(t), n =
|
|
3583
|
+
const Mr = Rt;
|
|
3584
|
+
function an(t) {
|
|
3585
|
+
const e = new nt(t), n = Fe(nt.prototype.request, e);
|
|
3586
3586
|
return d.extend(n, nt.prototype, e, { allOwnKeys: !0 }), d.extend(n, e, null, { allOwnKeys: !0 }), n.create = function(r) {
|
|
3587
|
-
return
|
|
3587
|
+
return an(H(t, r));
|
|
3588
3588
|
}, n;
|
|
3589
3589
|
}
|
|
3590
|
-
const w =
|
|
3590
|
+
const w = an(Ht);
|
|
3591
3591
|
w.Axios = nt;
|
|
3592
3592
|
w.CanceledError = X;
|
|
3593
|
-
w.CancelToken =
|
|
3594
|
-
w.isCancel =
|
|
3595
|
-
w.VERSION =
|
|
3593
|
+
w.CancelToken = Cr;
|
|
3594
|
+
w.isCancel = nn;
|
|
3595
|
+
w.VERSION = on;
|
|
3596
3596
|
w.toFormData = lt;
|
|
3597
3597
|
w.AxiosError = g;
|
|
3598
3598
|
w.Cancel = w.CanceledError;
|
|
3599
3599
|
w.all = function(e) {
|
|
3600
3600
|
return Promise.all(e);
|
|
3601
3601
|
};
|
|
3602
|
-
w.spread =
|
|
3603
|
-
w.isAxiosError =
|
|
3602
|
+
w.spread = Pr;
|
|
3603
|
+
w.isAxiosError = Dr;
|
|
3604
3604
|
w.mergeConfig = H;
|
|
3605
3605
|
w.AxiosHeaders = R;
|
|
3606
|
-
w.formToJSON = (t) =>
|
|
3607
|
-
w.getAdapter =
|
|
3608
|
-
w.HttpStatusCode =
|
|
3606
|
+
w.formToJSON = (t) => en(d.isHTMLForm(t) ? new FormData(t) : t);
|
|
3607
|
+
w.getAdapter = rn.getAdapter;
|
|
3608
|
+
w.HttpStatusCode = Mr;
|
|
3609
3609
|
w.default = w;
|
|
3610
|
-
const
|
|
3611
|
-
async function
|
|
3610
|
+
const Ur = w;
|
|
3611
|
+
async function me(t, e) {
|
|
3612
3612
|
const n = await fetch(t, e);
|
|
3613
3613
|
return n.status === 200 ? n.json() : Promise.resolve({
|
|
3614
3614
|
message: n.statusText,
|
|
3615
3615
|
success: !1
|
|
3616
3616
|
});
|
|
3617
3617
|
}
|
|
3618
|
-
const
|
|
3618
|
+
const ge = $t({
|
|
3619
3619
|
types: {
|
|
3620
3620
|
context: {},
|
|
3621
3621
|
events: {},
|
|
@@ -3685,17 +3685,13 @@ const Se = $t({
|
|
|
3685
3685
|
actors: {
|
|
3686
3686
|
refreshAccessToken: yt(async ({ input: t }) => {
|
|
3687
3687
|
let e;
|
|
3688
|
-
if (
|
|
3689
|
-
if (
|
|
3690
|
-
"refreshAccessToken input.context.refreshToken",
|
|
3691
|
-
t.context.refreshToken
|
|
3692
|
-
), t.context.refreshToken === "")
|
|
3688
|
+
if (typeof window > "u") {
|
|
3689
|
+
if (t.context.refreshToken === "")
|
|
3693
3690
|
throw new Error("Unauthorized.");
|
|
3694
|
-
console.log("refreshAccessToken after refreshToken check");
|
|
3695
3691
|
try {
|
|
3696
|
-
const n = await
|
|
3692
|
+
const n = await Ur.post(
|
|
3697
3693
|
t.context.endpoints.ssrRefresh,
|
|
3698
|
-
{
|
|
3694
|
+
{},
|
|
3699
3695
|
{
|
|
3700
3696
|
headers: {
|
|
3701
3697
|
Cookie: `refresh_token=${t.context.refreshToken}`,
|
|
@@ -3714,11 +3710,11 @@ const Se = $t({
|
|
|
3714
3710
|
type: "REFRESH_TOKEN_SUCCESS",
|
|
3715
3711
|
accessToken: s.accessToken
|
|
3716
3712
|
};
|
|
3717
|
-
} catch {
|
|
3718
|
-
throw new Error("Could not complete refresh request (server)");
|
|
3713
|
+
} catch (n) {
|
|
3714
|
+
throw console.log(n), new Error("Could not complete refresh request (server)");
|
|
3719
3715
|
}
|
|
3720
3716
|
} else {
|
|
3721
|
-
e = await
|
|
3717
|
+
e = await me(
|
|
3722
3718
|
t.context.endpoints.refresh,
|
|
3723
3719
|
{
|
|
3724
3720
|
method: "POST",
|
|
@@ -3748,7 +3744,7 @@ const Se = $t({
|
|
|
3748
3744
|
}),
|
|
3749
3745
|
authenticate: yt(async ({ input: t }) => {
|
|
3750
3746
|
var s;
|
|
3751
|
-
const n = await
|
|
3747
|
+
const n = await me(
|
|
3752
3748
|
t.context.endpoints.login,
|
|
3753
3749
|
{
|
|
3754
3750
|
method: "POST",
|
|
@@ -3917,13 +3913,13 @@ const Se = $t({
|
|
|
3917
3913
|
// },
|
|
3918
3914
|
// },
|
|
3919
3915
|
}
|
|
3920
|
-
}),
|
|
3916
|
+
}), cn = Ee(
|
|
3921
3917
|
{}
|
|
3922
3918
|
), Br = () => {
|
|
3923
|
-
const t =
|
|
3919
|
+
const t = we(cn), [e, n] = ln(
|
|
3924
3920
|
typeof window < "u" && t.getSnapshot().value === "loggedIn"
|
|
3925
3921
|
);
|
|
3926
|
-
return
|
|
3922
|
+
return dn(() => {
|
|
3927
3923
|
if (typeof window > "u")
|
|
3928
3924
|
return;
|
|
3929
3925
|
const s = t.subscribe((r) => {
|
|
@@ -3938,14 +3934,14 @@ const Se = $t({
|
|
|
3938
3934
|
endpoints: { login: "", logout: "", refresh: "", ssrRefresh: "" }
|
|
3939
3935
|
}) => typeof window < "u" ? (console.warn(
|
|
3940
3936
|
"App.getInitialProps::getAuth should not be run on the frontend. You are probably missing getServerSideProps in your page."
|
|
3941
|
-
), $(
|
|
3937
|
+
), $(ge, {
|
|
3942
3938
|
inspect: e.inspect,
|
|
3943
3939
|
input: {
|
|
3944
3940
|
initialContext: {
|
|
3945
3941
|
endpoints: e.endpoints
|
|
3946
3942
|
}
|
|
3947
3943
|
}
|
|
3948
|
-
}).start()) : $(
|
|
3944
|
+
}).start()) : $(ge, {
|
|
3949
3945
|
input: {
|
|
3950
3946
|
initialContext: {
|
|
3951
3947
|
endpoints: e.endpoints,
|
|
@@ -3955,12 +3951,12 @@ const Se = $t({
|
|
|
3955
3951
|
inspect: e.inspect
|
|
3956
3952
|
}).start();
|
|
3957
3953
|
function Hr({ actor: t, children: e }) {
|
|
3958
|
-
return /* @__PURE__ */
|
|
3954
|
+
return /* @__PURE__ */ Se(cn.Provider, { value: t, children: e });
|
|
3959
3955
|
}
|
|
3960
3956
|
let Nr = (t = 21) => crypto.getRandomValues(new Uint8Array(t)).reduce((e, n) => (n &= 63, n < 36 ? e += n.toString(36) : n < 62 ? e += (n - 26).toString(36).toUpperCase() : n > 62 ? e += "-" : e += "_", e), "");
|
|
3961
3957
|
const jr = $t({
|
|
3962
3958
|
actors: {
|
|
3963
|
-
tick:
|
|
3959
|
+
tick: ds(
|
|
3964
3960
|
({ sendBack: t, input: e }) => {
|
|
3965
3961
|
const n = setInterval(() => {
|
|
3966
3962
|
t({ type: "TICK" });
|
|
@@ -4049,7 +4045,7 @@ const jr = $t({
|
|
|
4049
4045
|
addItem: v(({ context: t, event: e }) => {
|
|
4050
4046
|
if (e.type !== "ADD_ITEM")
|
|
4051
4047
|
return t;
|
|
4052
|
-
const n = `notification-${Nr()}`, s = e.duration ?? t.duration, r =
|
|
4048
|
+
const n = `notification-${Nr()}`, s = e.duration ?? t.duration, r = hn(e.item, {
|
|
4053
4049
|
duration: s,
|
|
4054
4050
|
id: n,
|
|
4055
4051
|
key: e.item.key ?? n,
|
|
@@ -4166,19 +4162,19 @@ const jr = $t({
|
|
|
4166
4162
|
}
|
|
4167
4163
|
}
|
|
4168
4164
|
}
|
|
4169
|
-
}),
|
|
4165
|
+
}), un = Ee({}), Jr = () => we(un);
|
|
4170
4166
|
function qr({
|
|
4171
4167
|
children: t,
|
|
4172
4168
|
actor: e
|
|
4173
4169
|
}) {
|
|
4174
|
-
return /* @__PURE__ */
|
|
4170
|
+
return /* @__PURE__ */ Se(un.Provider, { value: e, children: t });
|
|
4175
4171
|
}
|
|
4176
4172
|
export {
|
|
4177
|
-
|
|
4173
|
+
cn as AuthContext,
|
|
4178
4174
|
Hr as AuthProvider,
|
|
4179
|
-
|
|
4175
|
+
un as ToastContext,
|
|
4180
4176
|
qr as ToastProvider,
|
|
4181
|
-
|
|
4177
|
+
ge as authMachine,
|
|
4182
4178
|
Fr as getAuth,
|
|
4183
4179
|
jr as timerMachine,
|
|
4184
4180
|
zr as toastMachine,
|