flemo 1.3.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { jsx as M, jsxs as
|
|
2
|
-
import W, { useEffect as
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
var G = {}, ot;
|
|
1
|
+
import { jsx as M, jsxs as dt } from "react/jsx-runtime";
|
|
2
|
+
import W, { useEffect as j, createContext as et, useReducer as Tt, Children as pt, useContext as nt, Suspense as Dt, useImperativeHandle as Lt, useRef as U } from "react";
|
|
3
|
+
import { transform as st, useAnimate as ft, motion as ht, useDragControls as It, AnimatePresence as vt, MotionConfig as Nt } from "motion/react";
|
|
4
|
+
var G = {}, at;
|
|
6
5
|
function xt() {
|
|
7
|
-
if (
|
|
8
|
-
|
|
9
|
-
const n = "/", e = (
|
|
6
|
+
if (at) return G;
|
|
7
|
+
at = 1, Object.defineProperty(G, "__esModule", { value: !0 }), G.PathError = G.TokenData = void 0, G.parse = l, G.compile = S, G.match = L, G.pathToRegexp = D, G.stringify = O;
|
|
8
|
+
const n = "/", e = (o) => o, t = /^[$_\p{ID_Start}]$/u, r = /^[$\u200c\u200d\p{ID_Continue}]$/u, s = {
|
|
10
9
|
// Groups.
|
|
11
10
|
"{": "{",
|
|
12
11
|
"}": "}",
|
|
@@ -19,256 +18,256 @@ function xt() {
|
|
|
19
18
|
"?": "?",
|
|
20
19
|
"!": "!"
|
|
21
20
|
};
|
|
22
|
-
function a(
|
|
23
|
-
return
|
|
21
|
+
function a(o) {
|
|
22
|
+
return o.replace(/[{}()\[\]+?!:*\\]/g, "\\$&");
|
|
24
23
|
}
|
|
25
|
-
function
|
|
26
|
-
return
|
|
24
|
+
function i(o) {
|
|
25
|
+
return o.replace(/[.+*?^${}()[\]|/\\]/g, "\\$&");
|
|
27
26
|
}
|
|
28
|
-
class
|
|
29
|
-
constructor(p,
|
|
30
|
-
this.tokens = p, this.originalPath =
|
|
27
|
+
class u {
|
|
28
|
+
constructor(p, g) {
|
|
29
|
+
this.tokens = p, this.originalPath = g;
|
|
31
30
|
}
|
|
32
31
|
}
|
|
33
|
-
G.TokenData =
|
|
34
|
-
class
|
|
35
|
-
constructor(p,
|
|
36
|
-
let
|
|
37
|
-
|
|
32
|
+
G.TokenData = u;
|
|
33
|
+
class f extends TypeError {
|
|
34
|
+
constructor(p, g) {
|
|
35
|
+
let m = p;
|
|
36
|
+
g && (m += `: ${g}`), m += "; visit https://git.new/pathToRegexpError for info", super(m), this.originalPath = g;
|
|
38
37
|
}
|
|
39
38
|
}
|
|
40
|
-
G.PathError =
|
|
41
|
-
function o
|
|
42
|
-
const { encodePath:
|
|
43
|
-
let d = 0,
|
|
39
|
+
G.PathError = f;
|
|
40
|
+
function l(o, p = {}) {
|
|
41
|
+
const { encodePath: g = e } = p, m = [...o], y = [];
|
|
42
|
+
let d = 0, I = 0;
|
|
44
43
|
function T() {
|
|
45
44
|
let P = "";
|
|
46
|
-
if (t.test(
|
|
45
|
+
if (t.test(m[d]))
|
|
47
46
|
do
|
|
48
|
-
P +=
|
|
49
|
-
while (r.test(
|
|
50
|
-
else if (
|
|
51
|
-
let
|
|
52
|
-
for (; d++ <
|
|
53
|
-
if (
|
|
54
|
-
d++,
|
|
47
|
+
P += m[d++];
|
|
48
|
+
while (r.test(m[d]));
|
|
49
|
+
else if (m[d] === '"') {
|
|
50
|
+
let C = d;
|
|
51
|
+
for (; d++ < m.length; ) {
|
|
52
|
+
if (m[d] === '"') {
|
|
53
|
+
d++, C = 0;
|
|
55
54
|
break;
|
|
56
55
|
}
|
|
57
|
-
|
|
56
|
+
m[d] === "\\" && d++, P += m[d];
|
|
58
57
|
}
|
|
59
|
-
if (
|
|
60
|
-
throw new
|
|
58
|
+
if (C)
|
|
59
|
+
throw new f(`Unterminated quote at index ${C}`, o);
|
|
61
60
|
}
|
|
62
61
|
if (!P)
|
|
63
|
-
throw new
|
|
62
|
+
throw new f(`Missing parameter name at index ${d}`, o);
|
|
64
63
|
return P;
|
|
65
64
|
}
|
|
66
|
-
for (; d <
|
|
67
|
-
const P =
|
|
68
|
-
|
|
65
|
+
for (; d < m.length; ) {
|
|
66
|
+
const P = m[d], C = s[P];
|
|
67
|
+
C ? y.push({ type: C, index: d++, value: P }) : P === "\\" ? y.push({ type: "escape", index: d++, value: m[d++] }) : P === ":" ? y.push({ type: "param", index: d++, value: T() }) : P === "*" ? y.push({ type: "wildcard", index: d++, value: T() }) : y.push({ type: "char", index: d++, value: P });
|
|
69
68
|
}
|
|
70
|
-
|
|
71
|
-
function
|
|
72
|
-
const
|
|
69
|
+
y.push({ type: "end", index: d, value: "" });
|
|
70
|
+
function R(P) {
|
|
71
|
+
const C = [];
|
|
73
72
|
for (; ; ) {
|
|
74
|
-
const
|
|
75
|
-
if (
|
|
73
|
+
const k = y[I++];
|
|
74
|
+
if (k.type === P)
|
|
76
75
|
break;
|
|
77
|
-
if (
|
|
78
|
-
let
|
|
79
|
-
for (;
|
|
80
|
-
|
|
81
|
-
|
|
76
|
+
if (k.type === "char" || k.type === "escape") {
|
|
77
|
+
let E = k.value, v = y[I];
|
|
78
|
+
for (; v.type === "char" || v.type === "escape"; )
|
|
79
|
+
E += v.value, v = y[++I];
|
|
80
|
+
C.push({
|
|
82
81
|
type: "text",
|
|
83
|
-
value:
|
|
82
|
+
value: g(E)
|
|
84
83
|
});
|
|
85
84
|
continue;
|
|
86
85
|
}
|
|
87
|
-
if (
|
|
88
|
-
|
|
89
|
-
type:
|
|
90
|
-
name:
|
|
86
|
+
if (k.type === "param" || k.type === "wildcard") {
|
|
87
|
+
C.push({
|
|
88
|
+
type: k.type,
|
|
89
|
+
name: k.value
|
|
91
90
|
});
|
|
92
91
|
continue;
|
|
93
92
|
}
|
|
94
|
-
if (
|
|
95
|
-
|
|
93
|
+
if (k.type === "{") {
|
|
94
|
+
C.push({
|
|
96
95
|
type: "group",
|
|
97
|
-
tokens:
|
|
96
|
+
tokens: R("}")
|
|
98
97
|
});
|
|
99
98
|
continue;
|
|
100
99
|
}
|
|
101
|
-
throw new
|
|
100
|
+
throw new f(`Unexpected ${k.type} at index ${k.index}, expected ${P}`, o);
|
|
102
101
|
}
|
|
103
|
-
return
|
|
102
|
+
return C;
|
|
104
103
|
}
|
|
105
|
-
return new
|
|
104
|
+
return new u(R("end"), o);
|
|
106
105
|
}
|
|
107
|
-
function S(
|
|
108
|
-
const { encode:
|
|
106
|
+
function S(o, p = {}) {
|
|
107
|
+
const { encode: g = encodeURIComponent, delimiter: m = n } = p, y = typeof o == "object" ? o : l(o, p), d = h(y.tokens, m, g);
|
|
109
108
|
return function(T = {}) {
|
|
110
|
-
const [
|
|
109
|
+
const [R, ...P] = d(T);
|
|
111
110
|
if (P.length)
|
|
112
111
|
throw new TypeError(`Missing parameters: ${P.join(", ")}`);
|
|
113
|
-
return
|
|
112
|
+
return R;
|
|
114
113
|
};
|
|
115
114
|
}
|
|
116
|
-
function
|
|
117
|
-
const
|
|
118
|
-
return (
|
|
115
|
+
function h(o, p, g) {
|
|
116
|
+
const m = o.map((y) => c(y, p, g));
|
|
117
|
+
return (y) => {
|
|
119
118
|
const d = [""];
|
|
120
|
-
for (const
|
|
121
|
-
const [T, ...
|
|
122
|
-
d[0] += T, d.push(...
|
|
119
|
+
for (const I of m) {
|
|
120
|
+
const [T, ...R] = I(y);
|
|
121
|
+
d[0] += T, d.push(...R);
|
|
123
122
|
}
|
|
124
123
|
return d;
|
|
125
124
|
};
|
|
126
125
|
}
|
|
127
|
-
function
|
|
128
|
-
if (
|
|
129
|
-
return () => [
|
|
130
|
-
if (
|
|
131
|
-
const
|
|
126
|
+
function c(o, p, g) {
|
|
127
|
+
if (o.type === "text")
|
|
128
|
+
return () => [o.value];
|
|
129
|
+
if (o.type === "group") {
|
|
130
|
+
const y = h(o.tokens, p, g);
|
|
132
131
|
return (d) => {
|
|
133
|
-
const [
|
|
134
|
-
return T.length ? [""] : [
|
|
132
|
+
const [I, ...T] = y(d);
|
|
133
|
+
return T.length ? [""] : [I];
|
|
135
134
|
};
|
|
136
135
|
}
|
|
137
|
-
const
|
|
138
|
-
return
|
|
139
|
-
const d =
|
|
136
|
+
const m = g || e;
|
|
137
|
+
return o.type === "wildcard" && g !== !1 ? (y) => {
|
|
138
|
+
const d = y[o.name];
|
|
140
139
|
if (d == null)
|
|
141
|
-
return ["",
|
|
140
|
+
return ["", o.name];
|
|
142
141
|
if (!Array.isArray(d) || d.length === 0)
|
|
143
|
-
throw new TypeError(`Expected "${
|
|
142
|
+
throw new TypeError(`Expected "${o.name}" to be a non-empty array`);
|
|
144
143
|
return [
|
|
145
|
-
d.map((
|
|
146
|
-
if (typeof
|
|
147
|
-
throw new TypeError(`Expected "${
|
|
148
|
-
return
|
|
144
|
+
d.map((I, T) => {
|
|
145
|
+
if (typeof I != "string")
|
|
146
|
+
throw new TypeError(`Expected "${o.name}/${T}" to be a string`);
|
|
147
|
+
return m(I);
|
|
149
148
|
}).join(p)
|
|
150
149
|
];
|
|
151
|
-
} : (
|
|
152
|
-
const d =
|
|
150
|
+
} : (y) => {
|
|
151
|
+
const d = y[o.name];
|
|
153
152
|
if (d == null)
|
|
154
|
-
return ["",
|
|
153
|
+
return ["", o.name];
|
|
155
154
|
if (typeof d != "string")
|
|
156
|
-
throw new TypeError(`Expected "${
|
|
157
|
-
return [
|
|
155
|
+
throw new TypeError(`Expected "${o.name}" to be a string`);
|
|
156
|
+
return [m(d)];
|
|
158
157
|
};
|
|
159
158
|
}
|
|
160
|
-
function
|
|
161
|
-
const { decode:
|
|
162
|
-
return function(
|
|
163
|
-
const P =
|
|
159
|
+
function L(o, p = {}) {
|
|
160
|
+
const { decode: g = decodeURIComponent, delimiter: m = n } = p, { regexp: y, keys: d } = D(o, p), I = d.map((T) => g === !1 ? e : T.type === "param" ? g : (R) => R.split(m).map(g));
|
|
161
|
+
return function(R) {
|
|
162
|
+
const P = y.exec(R);
|
|
164
163
|
if (!P)
|
|
165
164
|
return !1;
|
|
166
|
-
const
|
|
167
|
-
for (let
|
|
168
|
-
if (P[
|
|
165
|
+
const C = P[0], k = /* @__PURE__ */ Object.create(null);
|
|
166
|
+
for (let E = 1; E < P.length; E++) {
|
|
167
|
+
if (P[E] === void 0)
|
|
169
168
|
continue;
|
|
170
|
-
const
|
|
171
|
-
|
|
169
|
+
const v = d[E - 1], b = I[E - 1];
|
|
170
|
+
k[v.name] = b(P[E]);
|
|
172
171
|
}
|
|
173
|
-
return { path:
|
|
172
|
+
return { path: C, params: k };
|
|
174
173
|
};
|
|
175
174
|
}
|
|
176
|
-
function
|
|
177
|
-
const { delimiter:
|
|
178
|
-
for (const
|
|
179
|
-
const
|
|
180
|
-
for (const
|
|
181
|
-
|
|
175
|
+
function D(o, p = {}) {
|
|
176
|
+
const { delimiter: g = n, end: m = !0, sensitive: y = !1, trailing: d = !0 } = p, I = [], T = y ? "" : "i", R = [];
|
|
177
|
+
for (const k of N(o, [])) {
|
|
178
|
+
const E = typeof k == "object" ? k : l(k, p);
|
|
179
|
+
for (const v of w(E.tokens, 0, []))
|
|
180
|
+
R.push(x(v, g, I, E.originalPath));
|
|
182
181
|
}
|
|
183
|
-
let P = `^(?:${
|
|
184
|
-
return d && (P += `(?:${
|
|
182
|
+
let P = `^(?:${R.join("|")})`;
|
|
183
|
+
return d && (P += `(?:${i(g)}$)?`), P += m ? "$" : `(?=${i(g)}|$)`, { regexp: new RegExp(P, T), keys: I };
|
|
185
184
|
}
|
|
186
|
-
function N(
|
|
187
|
-
if (Array.isArray(
|
|
188
|
-
for (const
|
|
189
|
-
N(
|
|
185
|
+
function N(o, p) {
|
|
186
|
+
if (Array.isArray(o))
|
|
187
|
+
for (const g of o)
|
|
188
|
+
N(g, p);
|
|
190
189
|
else
|
|
191
|
-
p.push(
|
|
190
|
+
p.push(o);
|
|
192
191
|
return p;
|
|
193
192
|
}
|
|
194
|
-
function* w(
|
|
195
|
-
if (p ===
|
|
196
|
-
return yield
|
|
197
|
-
const
|
|
198
|
-
if (
|
|
199
|
-
for (const
|
|
200
|
-
yield* w(
|
|
193
|
+
function* w(o, p, g) {
|
|
194
|
+
if (p === o.length)
|
|
195
|
+
return yield g;
|
|
196
|
+
const m = o[p];
|
|
197
|
+
if (m.type === "group")
|
|
198
|
+
for (const y of w(m.tokens, 0, g.slice()))
|
|
199
|
+
yield* w(o, p + 1, y);
|
|
201
200
|
else
|
|
202
|
-
|
|
203
|
-
yield* w(
|
|
201
|
+
g.push(m);
|
|
202
|
+
yield* w(o, p + 1, g);
|
|
204
203
|
}
|
|
205
|
-
function
|
|
206
|
-
let
|
|
207
|
-
for (const T of
|
|
204
|
+
function x(o, p, g, m) {
|
|
205
|
+
let y = "", d = "", I = !0;
|
|
206
|
+
for (const T of o) {
|
|
208
207
|
if (T.type === "text") {
|
|
209
|
-
|
|
208
|
+
y += i(T.value), d += T.value, I || (I = T.value.includes(p));
|
|
210
209
|
continue;
|
|
211
210
|
}
|
|
212
211
|
if (T.type === "param" || T.type === "wildcard") {
|
|
213
|
-
if (!
|
|
214
|
-
throw new
|
|
215
|
-
T.type === "param" ?
|
|
212
|
+
if (!I && !d)
|
|
213
|
+
throw new f(`Missing text before "${T.name}" ${T.type}`, m);
|
|
214
|
+
T.type === "param" ? y += `(${F(p, I ? "" : d)}+)` : y += "([\\s\\S]+)", g.push(T), d = "", I = !1;
|
|
216
215
|
continue;
|
|
217
216
|
}
|
|
218
217
|
}
|
|
219
|
-
return
|
|
218
|
+
return y;
|
|
220
219
|
}
|
|
221
|
-
function
|
|
222
|
-
return p.length < 2 ?
|
|
220
|
+
function F(o, p) {
|
|
221
|
+
return p.length < 2 ? o.length < 2 ? `[^${i(o + p)}]` : `(?:(?!${i(o)})[^${i(p)}])` : o.length < 2 ? `(?:(?!${i(p)})[^${i(o)}])` : `(?:(?!${i(p)}|${i(o)})[\\s\\S])`;
|
|
223
222
|
}
|
|
224
|
-
function
|
|
225
|
-
let p = "",
|
|
226
|
-
function
|
|
227
|
-
return Y(
|
|
223
|
+
function A(o) {
|
|
224
|
+
let p = "", g = 0;
|
|
225
|
+
function m(y) {
|
|
226
|
+
return Y(y) && X(o[g]) ? y : JSON.stringify(y);
|
|
228
227
|
}
|
|
229
|
-
for (;
|
|
230
|
-
const
|
|
231
|
-
if (
|
|
232
|
-
p += a(
|
|
228
|
+
for (; g < o.length; ) {
|
|
229
|
+
const y = o[g++];
|
|
230
|
+
if (y.type === "text") {
|
|
231
|
+
p += a(y.value);
|
|
233
232
|
continue;
|
|
234
233
|
}
|
|
235
|
-
if (
|
|
236
|
-
p += `{${
|
|
234
|
+
if (y.type === "group") {
|
|
235
|
+
p += `{${A(y.tokens)}}`;
|
|
237
236
|
continue;
|
|
238
237
|
}
|
|
239
|
-
if (
|
|
240
|
-
p += `:${
|
|
238
|
+
if (y.type === "param") {
|
|
239
|
+
p += `:${m(y.name)}`;
|
|
241
240
|
continue;
|
|
242
241
|
}
|
|
243
|
-
if (
|
|
244
|
-
p += `*${
|
|
242
|
+
if (y.type === "wildcard") {
|
|
243
|
+
p += `*${m(y.name)}`;
|
|
245
244
|
continue;
|
|
246
245
|
}
|
|
247
|
-
throw new TypeError(`Unknown token type: ${
|
|
246
|
+
throw new TypeError(`Unknown token type: ${y.type}`);
|
|
248
247
|
}
|
|
249
248
|
return p;
|
|
250
249
|
}
|
|
251
|
-
function O(
|
|
252
|
-
return
|
|
250
|
+
function O(o) {
|
|
251
|
+
return A(o.tokens);
|
|
253
252
|
}
|
|
254
|
-
function Y(
|
|
255
|
-
const [p, ...
|
|
256
|
-
return t.test(p) &&
|
|
253
|
+
function Y(o) {
|
|
254
|
+
const [p, ...g] = o;
|
|
255
|
+
return t.test(p) && g.every((m) => r.test(m));
|
|
257
256
|
}
|
|
258
|
-
function X(
|
|
259
|
-
return
|
|
257
|
+
function X(o) {
|
|
258
|
+
return o && o.type === "text" ? !r.test(o.value[0]) : !0;
|
|
260
259
|
}
|
|
261
260
|
return G;
|
|
262
261
|
}
|
|
263
|
-
var
|
|
264
|
-
function
|
|
265
|
-
const r = Array.isArray(n) ? n.find((
|
|
266
|
-
return s ? { ...s.params, ...
|
|
262
|
+
var B = xt();
|
|
263
|
+
function kt(n, e, t) {
|
|
264
|
+
const r = Array.isArray(n) ? n.find((u) => B.pathToRegexp(u).regexp.test(e)) || "" : B.pathToRegexp(n).regexp.test(e) ? n : "", s = B.match(r)(e), a = new URLSearchParams(t), i = Object.fromEntries(a.entries());
|
|
265
|
+
return s ? { ...s.params, ...i } : {};
|
|
267
266
|
}
|
|
268
|
-
function
|
|
267
|
+
function ot() {
|
|
269
268
|
return typeof document > "u";
|
|
270
269
|
}
|
|
271
|
-
class
|
|
270
|
+
class Mt {
|
|
272
271
|
tasks = /* @__PURE__ */ new Map();
|
|
273
272
|
instanceId = Date.now().toString();
|
|
274
273
|
isLocked = !1;
|
|
@@ -336,39 +335,39 @@ class Ct {
|
|
|
336
335
|
return new Promise((s, a) => {
|
|
337
336
|
this.taskQueue = this.taskQueue.then(async () => {
|
|
338
337
|
try {
|
|
339
|
-
const { control:
|
|
338
|
+
const { control: i, validate: u, rollback: f, dependencies: l = [], delay: S } = t, h = new AbortController(), c = {
|
|
340
339
|
id: r,
|
|
341
340
|
execute: e,
|
|
342
341
|
timestamp: Date.now(),
|
|
343
342
|
retryCount: 0,
|
|
344
343
|
status: "PENDING",
|
|
345
|
-
dependencies:
|
|
344
|
+
dependencies: l,
|
|
346
345
|
instanceId: this.instanceId,
|
|
347
|
-
validate:
|
|
348
|
-
rollback:
|
|
349
|
-
control:
|
|
350
|
-
abortController:
|
|
346
|
+
validate: u,
|
|
347
|
+
rollback: f,
|
|
348
|
+
control: i,
|
|
349
|
+
abortController: h
|
|
351
350
|
};
|
|
352
|
-
this.tasks.set(
|
|
351
|
+
this.tasks.set(c.id, c), this.pendingTaskQueue.length > 0 && (this.pendingTaskQueue.push(c), await this.waitForPendingTasks(), this.pendingTaskQueue = this.pendingTaskQueue.filter((D) => D.id !== c.id));
|
|
353
352
|
try {
|
|
354
|
-
if (!await this.acquireLock(
|
|
355
|
-
throw
|
|
353
|
+
if (!await this.acquireLock(c.id))
|
|
354
|
+
throw c.status = "FAILED", new Error("FAILED");
|
|
356
355
|
try {
|
|
357
|
-
|
|
358
|
-
for (const w of
|
|
359
|
-
const
|
|
360
|
-
if (!
|
|
361
|
-
throw
|
|
356
|
+
c.status = "PROCESSING";
|
|
357
|
+
for (const w of c.dependencies) {
|
|
358
|
+
const x = this.tasks.get(w);
|
|
359
|
+
if (!x || x.status !== "COMPLETED")
|
|
360
|
+
throw c.status = "FAILED", new Error("FAILED");
|
|
362
361
|
}
|
|
363
|
-
if (
|
|
364
|
-
throw
|
|
362
|
+
if (c.validate && !await c.validate())
|
|
363
|
+
throw c.status = "FAILED", new Error("FAILED");
|
|
365
364
|
S && S > 0 && await new Promise((w) => setTimeout(w, S));
|
|
366
|
-
const N = await
|
|
367
|
-
if (
|
|
368
|
-
|
|
365
|
+
const N = await c.execute(c.abortController);
|
|
366
|
+
if (c.abortController.signal.aborted) {
|
|
367
|
+
c.status = "COMPLETED", await this.onTaskStatusChange(c.id, "COMPLETED"), s({
|
|
369
368
|
success: !0,
|
|
370
369
|
result: void 0,
|
|
371
|
-
taskId:
|
|
370
|
+
taskId: c.id,
|
|
372
371
|
timestamp: Date.now(),
|
|
373
372
|
instanceId: this.instanceId
|
|
374
373
|
});
|
|
@@ -376,41 +375,41 @@ class Ct {
|
|
|
376
375
|
}
|
|
377
376
|
if (t.control) {
|
|
378
377
|
const w = t.control;
|
|
379
|
-
if (w.delay && w.delay > 0 && await new Promise((
|
|
380
|
-
|
|
378
|
+
if (w.delay && w.delay > 0 && await new Promise((x) => setTimeout(x, w.delay)), w.manual) {
|
|
379
|
+
c.status = "MANUAL_PENDING", c.manualResolver = { resolve: s, reject: a, result: N }, this.pendingTaskQueue.push(c), await this.onTaskStatusChange(c.id, "MANUAL_PENDING");
|
|
381
380
|
return;
|
|
382
381
|
}
|
|
383
382
|
if (w.signal) {
|
|
384
|
-
|
|
383
|
+
c.status = "SIGNAL_PENDING", c.manualResolver = { resolve: s, reject: a, result: N }, this.signalListeners.has(w.signal) || this.signalListeners.set(w.signal, /* @__PURE__ */ new Set()), this.signalListeners.get(w.signal).add(c.id), this.pendingTaskQueue.push(c), await this.onTaskStatusChange(c.id, "SIGNAL_PENDING");
|
|
385
384
|
return;
|
|
386
385
|
}
|
|
387
386
|
if (w.condition && !await w.condition()) {
|
|
388
|
-
|
|
387
|
+
c.status = "MANUAL_PENDING", c.manualResolver = { resolve: s, reject: a, result: N }, this.pendingTaskQueue.push(c), await this.onTaskStatusChange(c.id, "MANUAL_PENDING");
|
|
389
388
|
return;
|
|
390
389
|
}
|
|
391
390
|
}
|
|
392
|
-
|
|
391
|
+
c.status = "COMPLETED", await this.onTaskStatusChange(c.id, "COMPLETED"), s({
|
|
393
392
|
success: !0,
|
|
394
393
|
result: N,
|
|
395
|
-
taskId:
|
|
394
|
+
taskId: c.id,
|
|
396
395
|
timestamp: Date.now(),
|
|
397
396
|
instanceId: this.instanceId
|
|
398
397
|
});
|
|
399
398
|
} catch (N) {
|
|
400
|
-
if (
|
|
399
|
+
if (c.status = "FAILED", c.rollback)
|
|
401
400
|
try {
|
|
402
|
-
await
|
|
401
|
+
await c.rollback(), c.status = "ROLLEDBACK";
|
|
403
402
|
} catch {
|
|
404
403
|
}
|
|
405
|
-
throw await this.onTaskStatusChange(
|
|
404
|
+
throw await this.onTaskStatusChange(c.id, c.status), N;
|
|
406
405
|
} finally {
|
|
407
|
-
this.releaseLock(
|
|
406
|
+
this.releaseLock(c.id);
|
|
408
407
|
}
|
|
409
|
-
} catch (
|
|
410
|
-
a(
|
|
408
|
+
} catch (D) {
|
|
409
|
+
a(D);
|
|
411
410
|
}
|
|
412
|
-
} catch (
|
|
413
|
-
a(
|
|
411
|
+
} catch (i) {
|
|
412
|
+
a(i);
|
|
414
413
|
}
|
|
415
414
|
}).catch(a);
|
|
416
415
|
});
|
|
@@ -441,18 +440,18 @@ class Ct {
|
|
|
441
440
|
await Promise.all(e.map((t) => this.resolveTask(t.id)));
|
|
442
441
|
}
|
|
443
442
|
}
|
|
444
|
-
const _ = new
|
|
443
|
+
const _ = new Mt(), it = (n) => {
|
|
445
444
|
let e;
|
|
446
|
-
const t = /* @__PURE__ */ new Set(), r = (
|
|
447
|
-
const
|
|
448
|
-
if (!Object.is(
|
|
449
|
-
const
|
|
450
|
-
e = S ?? (typeof
|
|
445
|
+
const t = /* @__PURE__ */ new Set(), r = (l, S) => {
|
|
446
|
+
const h = typeof l == "function" ? l(e) : l;
|
|
447
|
+
if (!Object.is(h, e)) {
|
|
448
|
+
const c = e;
|
|
449
|
+
e = S ?? (typeof h != "object" || h === null) ? h : Object.assign({}, e, h), t.forEach((L) => L(e, c));
|
|
451
450
|
}
|
|
452
|
-
}, s = () => e,
|
|
453
|
-
return
|
|
454
|
-
},
|
|
455
|
-
function
|
|
451
|
+
}, s = () => e, u = { setState: r, getState: s, getInitialState: () => f, subscribe: (l) => (t.add(l), () => t.delete(l)) }, f = e = n(r, s, u);
|
|
452
|
+
return u;
|
|
453
|
+
}, Ct = ((n) => n ? it(n) : it), At = (n) => n;
|
|
454
|
+
function Rt(n, e = At) {
|
|
456
455
|
const t = W.useSyncExternalStore(
|
|
457
456
|
n.subscribe,
|
|
458
457
|
W.useCallback(() => e(n.getState()), [n, e]),
|
|
@@ -460,10 +459,10 @@ function bt(n, e = Rt) {
|
|
|
460
459
|
);
|
|
461
460
|
return W.useDebugValue(t), t;
|
|
462
461
|
}
|
|
463
|
-
const
|
|
464
|
-
const e =
|
|
462
|
+
const ct = (n) => {
|
|
463
|
+
const e = Ct(n), t = (r) => Rt(e, r);
|
|
465
464
|
return Object.assign(t, e), t;
|
|
466
|
-
}, z = ((n) => n ?
|
|
465
|
+
}, z = ((n) => n ? ct(n) : ct), H = z((n) => ({
|
|
467
466
|
index: -1,
|
|
468
467
|
histories: [],
|
|
469
468
|
addHistory: (e) => n((t) => ({
|
|
@@ -482,31 +481,31 @@ const ut = (n) => {
|
|
|
482
481
|
status: "IDLE",
|
|
483
482
|
setStatus: (e) => n({ status: e })
|
|
484
483
|
}));
|
|
485
|
-
function
|
|
486
|
-
return
|
|
484
|
+
function bt() {
|
|
485
|
+
return j(() => {
|
|
487
486
|
const n = async (e) => {
|
|
488
487
|
const t = e.state?.id;
|
|
489
488
|
(await _.addTask(
|
|
490
489
|
async (r) => {
|
|
491
|
-
const s = e.state?.index, a = e.state?.status,
|
|
492
|
-
if (!
|
|
490
|
+
const s = e.state?.index, a = e.state?.status, i = e.state?.params, u = e.state?.transitionName, f = e.state?.layoutId, l = $.getState().setStatus, { index: S, addHistory: h, popHistory: c } = H.getState(), L = s < S, D = a === "PUSHING" && s > S, N = a === "REPLACING" && s > S, w = window.location.pathname;
|
|
491
|
+
if (!L && !D && !N) {
|
|
493
492
|
r.abort();
|
|
494
493
|
return;
|
|
495
494
|
}
|
|
496
|
-
return
|
|
495
|
+
return L ? l("POPPING") : D ? (l("PUSHING"), h({
|
|
497
496
|
id: t,
|
|
498
497
|
pathname: w,
|
|
499
|
-
params:
|
|
500
|
-
transitionName:
|
|
501
|
-
layoutId:
|
|
502
|
-
})) : N && (
|
|
498
|
+
params: i,
|
|
499
|
+
transitionName: u,
|
|
500
|
+
layoutId: f
|
|
501
|
+
})) : N && (l("REPLACING"), h({
|
|
503
502
|
id: t,
|
|
504
503
|
pathname: w,
|
|
505
|
-
params:
|
|
506
|
-
transitionName:
|
|
507
|
-
layoutId:
|
|
504
|
+
params: i,
|
|
505
|
+
transitionName: u,
|
|
506
|
+
layoutId: f
|
|
508
507
|
})), async () => {
|
|
509
|
-
|
|
508
|
+
L && c(s + 1), l("COMPLETED");
|
|
510
509
|
};
|
|
511
510
|
},
|
|
512
511
|
{
|
|
@@ -522,9 +521,9 @@ function Ot() {
|
|
|
522
521
|
};
|
|
523
522
|
}, []), null;
|
|
524
523
|
}
|
|
525
|
-
const
|
|
524
|
+
const yt = et({}), gt = et(() => {
|
|
526
525
|
});
|
|
527
|
-
function
|
|
526
|
+
function Ot(n, e) {
|
|
528
527
|
switch (e.type) {
|
|
529
528
|
case "SET":
|
|
530
529
|
return e.params;
|
|
@@ -532,24 +531,24 @@ function Gt(n, e) {
|
|
|
532
531
|
return n;
|
|
533
532
|
}
|
|
534
533
|
}
|
|
535
|
-
function
|
|
534
|
+
function Gt({
|
|
536
535
|
children: n,
|
|
537
536
|
active: e,
|
|
538
537
|
params: t
|
|
539
538
|
}) {
|
|
540
|
-
const [r, s] =
|
|
541
|
-
return
|
|
542
|
-
const a = async (
|
|
543
|
-
|
|
544
|
-
s({ type: "SET", params:
|
|
539
|
+
const [r, s] = Tt(Ot, t);
|
|
540
|
+
return j(() => {
|
|
541
|
+
const a = async (i) => {
|
|
542
|
+
i.state?.step && await _.addTask(async () => {
|
|
543
|
+
s({ type: "SET", params: i.state?.params || {} });
|
|
545
544
|
});
|
|
546
545
|
};
|
|
547
546
|
return e && window.addEventListener("popstate", a), () => {
|
|
548
547
|
window.removeEventListener("popstate", a);
|
|
549
548
|
};
|
|
550
|
-
}, [e, s]), /* @__PURE__ */ M(
|
|
549
|
+
}, [e, s]), /* @__PURE__ */ M(gt.Provider, { value: s, children: /* @__PURE__ */ M(yt.Provider, { value: r, children: n }) });
|
|
551
550
|
}
|
|
552
|
-
const
|
|
551
|
+
const mt = et({
|
|
553
552
|
id: "",
|
|
554
553
|
isActive: !1,
|
|
555
554
|
isRoot: !0,
|
|
@@ -561,16 +560,16 @@ const Et = nt({
|
|
|
561
560
|
prevTransitionName: "none",
|
|
562
561
|
layoutId: null
|
|
563
562
|
});
|
|
564
|
-
function
|
|
565
|
-
const e =
|
|
563
|
+
function $t({ children: n }) {
|
|
564
|
+
const e = H((r) => r.index), t = H((r) => r.histories);
|
|
566
565
|
return t.map(
|
|
567
|
-
(r) =>
|
|
568
|
-
(s) =>
|
|
566
|
+
(r) => pt.toArray(n).filter(
|
|
567
|
+
(s) => B.pathToRegexp(s.props.path).regexp.test(
|
|
569
568
|
r.pathname
|
|
570
569
|
)
|
|
571
570
|
)
|
|
572
571
|
).map(([r], s) => /* @__PURE__ */ M(
|
|
573
|
-
|
|
572
|
+
mt.Provider,
|
|
574
573
|
{
|
|
575
574
|
value: {
|
|
576
575
|
id: t[s].id,
|
|
@@ -584,12 +583,12 @@ function Ut({ children: n }) {
|
|
|
584
583
|
prevTransitionName: t[e - 1]?.transitionName,
|
|
585
584
|
layoutId: t[s].layoutId
|
|
586
585
|
},
|
|
587
|
-
children: /* @__PURE__ */ M(
|
|
586
|
+
children: /* @__PURE__ */ M(Gt, { active: s === e, params: t[s].params, children: r })
|
|
588
587
|
},
|
|
589
588
|
t[s].id
|
|
590
589
|
));
|
|
591
590
|
}
|
|
592
|
-
function
|
|
591
|
+
function Ut({
|
|
593
592
|
name: n,
|
|
594
593
|
initial: e,
|
|
595
594
|
enter: t,
|
|
@@ -614,7 +613,7 @@ function _t({
|
|
|
614
613
|
...s
|
|
615
614
|
};
|
|
616
615
|
}
|
|
617
|
-
const
|
|
616
|
+
const _t = Ut({
|
|
618
617
|
name: "overlay",
|
|
619
618
|
initial: {
|
|
620
619
|
opacity: 0,
|
|
@@ -639,8 +638,8 @@ const Ht = _t({
|
|
|
639
638
|
}
|
|
640
639
|
},
|
|
641
640
|
options: {
|
|
642
|
-
onSwipeStart: (n, {
|
|
643
|
-
|
|
641
|
+
onSwipeStart: (n, { animate: e, prevDecorator: t }) => e(
|
|
642
|
+
t,
|
|
644
643
|
{
|
|
645
644
|
opacity: n ? 1 : 0
|
|
646
645
|
},
|
|
@@ -648,8 +647,8 @@ const Ht = _t({
|
|
|
648
647
|
duration: 0.3
|
|
649
648
|
}
|
|
650
649
|
),
|
|
651
|
-
onSwipe: (n, e, {
|
|
652
|
-
|
|
650
|
+
onSwipe: (n, e, { animate: t, prevDecorator: r }) => t(
|
|
651
|
+
r,
|
|
653
652
|
{
|
|
654
653
|
opacity: Math.max(0, 1 - e / 100)
|
|
655
654
|
},
|
|
@@ -657,8 +656,8 @@ const Ht = _t({
|
|
|
657
656
|
duration: 0
|
|
658
657
|
}
|
|
659
658
|
),
|
|
660
|
-
onSwipeEnd: (n, {
|
|
661
|
-
|
|
659
|
+
onSwipeEnd: (n, { animate: e, prevDecorator: t }) => e(
|
|
660
|
+
t,
|
|
662
661
|
{
|
|
663
662
|
opacity: n ? 0 : 1
|
|
664
663
|
},
|
|
@@ -667,7 +666,7 @@ const Ht = _t({
|
|
|
667
666
|
}
|
|
668
667
|
)
|
|
669
668
|
}
|
|
670
|
-
}),
|
|
669
|
+
}), rt = /* @__PURE__ */ new Map([["overlay", _t]]), Z = z((n) => ({
|
|
671
670
|
defaultTransitionName: "cupertino",
|
|
672
671
|
setDefaultTransitionName: (e) => n({ defaultTransitionName: e })
|
|
673
672
|
}));
|
|
@@ -678,8 +677,8 @@ function J({
|
|
|
678
677
|
enter: r,
|
|
679
678
|
enterBack: s,
|
|
680
679
|
exit: a,
|
|
681
|
-
exitBack:
|
|
682
|
-
options:
|
|
680
|
+
exitBack: i,
|
|
681
|
+
options: u
|
|
683
682
|
}) {
|
|
684
683
|
return {
|
|
685
684
|
name: n,
|
|
@@ -691,15 +690,15 @@ function J({
|
|
|
691
690
|
"PUSHING-true": r,
|
|
692
691
|
"REPLACING-false": a,
|
|
693
692
|
"REPLACING-true": r,
|
|
694
|
-
"POPPING-false":
|
|
693
|
+
"POPPING-false": i,
|
|
695
694
|
"POPPING-true": s,
|
|
696
695
|
"COMPLETED-false": a,
|
|
697
696
|
"COMPLETED-true": r
|
|
698
697
|
},
|
|
699
|
-
...
|
|
698
|
+
...u
|
|
700
699
|
};
|
|
701
700
|
}
|
|
702
|
-
const
|
|
701
|
+
const Ht = J({
|
|
703
702
|
name: "cupertino",
|
|
704
703
|
initial: {
|
|
705
704
|
x: "100%"
|
|
@@ -753,11 +752,11 @@ const Ft = J({
|
|
|
753
752
|
swipeDirection: "x",
|
|
754
753
|
onSwipeStart: async () => !0,
|
|
755
754
|
onSwipe: (n, e, { animate: t, currentScreen: r, prevScreen: s, onProgress: a }) => {
|
|
756
|
-
const { offset:
|
|
757
|
-
return a?.(!0,
|
|
755
|
+
const { offset: i } = e, u = i.x, f = st(u, [0, window.innerWidth], [0, 100]);
|
|
756
|
+
return a?.(!0, f), t(
|
|
758
757
|
r,
|
|
759
758
|
{
|
|
760
|
-
x: Math.max(0,
|
|
759
|
+
x: Math.max(0, u)
|
|
761
760
|
},
|
|
762
761
|
{
|
|
763
762
|
duration: 0
|
|
@@ -765,20 +764,20 @@ const Ft = J({
|
|
|
765
764
|
), t(
|
|
766
765
|
s,
|
|
767
766
|
{
|
|
768
|
-
x: -100 +
|
|
767
|
+
x: -100 + f
|
|
769
768
|
},
|
|
770
769
|
{
|
|
771
770
|
duration: 0
|
|
772
771
|
}
|
|
773
|
-
),
|
|
772
|
+
), f;
|
|
774
773
|
},
|
|
775
774
|
onSwipeEnd: async (n, e, { animate: t, currentScreen: r, prevScreen: s, onStart: a }) => {
|
|
776
|
-
const { offset:
|
|
777
|
-
return a?.(
|
|
775
|
+
const { offset: i, velocity: u } = e, l = i.x > 50 || u.x > 20;
|
|
776
|
+
return a?.(l), await Promise.all([
|
|
778
777
|
t(
|
|
779
778
|
r,
|
|
780
779
|
{
|
|
781
|
-
x:
|
|
780
|
+
x: l ? "100%" : 0
|
|
782
781
|
},
|
|
783
782
|
{
|
|
784
783
|
duration: 0.3,
|
|
@@ -788,17 +787,17 @@ const Ft = J({
|
|
|
788
787
|
t(
|
|
789
788
|
s,
|
|
790
789
|
{
|
|
791
|
-
x:
|
|
790
|
+
x: l ? 0 : -100
|
|
792
791
|
},
|
|
793
792
|
{
|
|
794
793
|
duration: 0.3,
|
|
795
794
|
ease: [0.32, 0.72, 0, 1]
|
|
796
795
|
}
|
|
797
796
|
)
|
|
798
|
-
]),
|
|
797
|
+
]), l;
|
|
799
798
|
}
|
|
800
799
|
}
|
|
801
|
-
}),
|
|
800
|
+
}), Ft = J({
|
|
802
801
|
name: "layout",
|
|
803
802
|
initial: {
|
|
804
803
|
opacity: 0.97
|
|
@@ -848,26 +847,26 @@ const Ft = J({
|
|
|
848
847
|
swipeDirection: "y",
|
|
849
848
|
onSwipeStart: async () => !0,
|
|
850
849
|
onSwipe: (n, e, { animate: t, currentScreen: r, onProgress: s }) => {
|
|
851
|
-
const { offset: a } = e,
|
|
850
|
+
const { offset: a } = e, i = a.y, u = Math.max(0, Math.min(56, i)), f = st(u, [0, 56], [1, 0.96]), l = Math.max(0, i - 56), S = Math.min(1, l / 160), h = Math.sqrt(S) * 12, c = Math.max(0, u + h), L = Math.min(56, c);
|
|
852
851
|
return s?.(!0, 100), t(
|
|
853
852
|
r,
|
|
854
853
|
{
|
|
855
|
-
y:
|
|
856
|
-
opacity:
|
|
854
|
+
y: c,
|
|
855
|
+
opacity: f
|
|
857
856
|
},
|
|
858
857
|
{
|
|
859
858
|
duration: 0
|
|
860
859
|
}
|
|
861
|
-
),
|
|
860
|
+
), L;
|
|
862
861
|
},
|
|
863
862
|
onSwipeEnd: async (n, e, { animate: t, currentScreen: r, prevScreen: s, onStart: a }) => {
|
|
864
|
-
const { offset:
|
|
865
|
-
return a?.(
|
|
863
|
+
const { offset: i, velocity: u } = e, l = i.y > 56 || u.y > 20;
|
|
864
|
+
return a?.(l), await Promise.all([
|
|
866
865
|
t(
|
|
867
866
|
r,
|
|
868
867
|
{
|
|
869
|
-
y:
|
|
870
|
-
opacity:
|
|
868
|
+
y: l ? "100%" : 0,
|
|
869
|
+
opacity: l ? 0.96 : 1
|
|
871
870
|
},
|
|
872
871
|
{
|
|
873
872
|
duration: 0.3
|
|
@@ -877,16 +876,16 @@ const Ft = J({
|
|
|
877
876
|
s,
|
|
878
877
|
{
|
|
879
878
|
y: 0,
|
|
880
|
-
opacity:
|
|
879
|
+
opacity: l ? 1 : 0.97
|
|
881
880
|
},
|
|
882
881
|
{
|
|
883
882
|
duration: 0.3
|
|
884
883
|
}
|
|
885
884
|
)
|
|
886
|
-
]),
|
|
885
|
+
]), l;
|
|
887
886
|
}
|
|
888
887
|
}
|
|
889
|
-
}),
|
|
888
|
+
}), Qt = J({
|
|
890
889
|
name: "material",
|
|
891
890
|
initial: {
|
|
892
891
|
y: "100%",
|
|
@@ -945,12 +944,12 @@ const Ft = J({
|
|
|
945
944
|
swipeDirection: "y",
|
|
946
945
|
onSwipeStart: async () => !0,
|
|
947
946
|
onSwipe: (n, e, { animate: t, currentScreen: r, prevScreen: s, onProgress: a }) => {
|
|
948
|
-
const { offset:
|
|
949
|
-
return a?.(!0,
|
|
947
|
+
const { offset: i } = e, u = i.y, f = Math.max(0, Math.min(56, u)), l = st(f, [0, 56], [1, 0.96]), S = Math.max(0, u - 56), h = Math.min(1, S / 160), c = Math.sqrt(h) * 12, L = Math.max(0, f + c), D = Math.min(56, L);
|
|
948
|
+
return a?.(!0, D), t(
|
|
950
949
|
r,
|
|
951
950
|
{
|
|
952
|
-
y:
|
|
953
|
-
opacity:
|
|
951
|
+
y: L,
|
|
952
|
+
opacity: l
|
|
954
953
|
},
|
|
955
954
|
{
|
|
956
955
|
duration: 0
|
|
@@ -958,41 +957,41 @@ const Ft = J({
|
|
|
958
957
|
), t(
|
|
959
958
|
s,
|
|
960
959
|
{
|
|
961
|
-
y: -56 +
|
|
962
|
-
opacity:
|
|
960
|
+
y: -56 + D,
|
|
961
|
+
opacity: D / 56
|
|
963
962
|
},
|
|
964
963
|
{ duration: 0 }
|
|
965
|
-
),
|
|
964
|
+
), D;
|
|
966
965
|
},
|
|
967
966
|
onSwipeEnd: async (n, e, { animate: t, currentScreen: r, prevScreen: s, onStart: a }) => {
|
|
968
|
-
const { offset:
|
|
969
|
-
return a?.(
|
|
967
|
+
const { offset: i, velocity: u } = e, l = i.y > 56 || u.y > 20;
|
|
968
|
+
return a?.(l), await Promise.all([
|
|
970
969
|
t(
|
|
971
970
|
r,
|
|
972
971
|
{
|
|
973
|
-
y:
|
|
974
|
-
opacity:
|
|
972
|
+
y: l ? "100%" : 0,
|
|
973
|
+
opacity: l ? 0.96 : 1
|
|
975
974
|
},
|
|
976
975
|
{
|
|
977
|
-
duration:
|
|
978
|
-
ease:
|
|
976
|
+
duration: l ? 0.22 : 0.24,
|
|
977
|
+
ease: l ? [0.4, 0, 1, 1] : [0, 0, 0.2, 1]
|
|
979
978
|
}
|
|
980
979
|
),
|
|
981
980
|
t(
|
|
982
981
|
s,
|
|
983
982
|
{
|
|
984
|
-
y:
|
|
985
|
-
opacity:
|
|
983
|
+
y: l ? 0 : -56,
|
|
984
|
+
opacity: l ? 1 : 0.96
|
|
986
985
|
},
|
|
987
986
|
{
|
|
988
|
-
duration:
|
|
989
|
-
ease:
|
|
987
|
+
duration: l ? 0.22 : 0.24,
|
|
988
|
+
ease: l ? [0, 0, 0.2, 1] : [0.4, 0, 1, 1]
|
|
990
989
|
}
|
|
991
990
|
)
|
|
992
|
-
]),
|
|
991
|
+
]), l;
|
|
993
992
|
}
|
|
994
993
|
}
|
|
995
|
-
}),
|
|
994
|
+
}), Bt = J({
|
|
996
995
|
name: "none",
|
|
997
996
|
initial: {},
|
|
998
997
|
idle: {
|
|
@@ -1026,11 +1025,11 @@ const Ft = J({
|
|
|
1026
1025
|
}
|
|
1027
1026
|
}
|
|
1028
1027
|
}), K = /* @__PURE__ */ new Map([
|
|
1029
|
-
["none",
|
|
1030
|
-
["cupertino",
|
|
1031
|
-
["material",
|
|
1032
|
-
["layout",
|
|
1033
|
-
]),
|
|
1028
|
+
["none", Bt],
|
|
1029
|
+
["cupertino", Ht],
|
|
1030
|
+
["material", Qt],
|
|
1031
|
+
["layout", Ft]
|
|
1032
|
+
]), jt = (() => {
|
|
1034
1033
|
const n = /* @__PURE__ */ Object.create(null), e = Object.prototype.hasOwnProperty;
|
|
1035
1034
|
for (const t of K.values()) {
|
|
1036
1035
|
const r = t.variants["IDLE-true"].value;
|
|
@@ -1039,36 +1038,49 @@ const Ft = J({
|
|
|
1039
1038
|
}
|
|
1040
1039
|
return n;
|
|
1041
1040
|
})();
|
|
1042
|
-
function
|
|
1041
|
+
function Jt({
|
|
1043
1042
|
children: n,
|
|
1044
1043
|
initPath: e = "/",
|
|
1045
1044
|
defaultTransitionName: t = "cupertino",
|
|
1046
1045
|
transitions: r = [],
|
|
1047
1046
|
decorators: s = []
|
|
1048
1047
|
}) {
|
|
1049
|
-
const a =
|
|
1050
|
-
return
|
|
1048
|
+
const a = ot() ? e || "/" : window.location.pathname, i = ot() ? a.split("?")[1] || "" : window.location.search;
|
|
1049
|
+
return Z.setState({
|
|
1051
1050
|
defaultTransitionName: t
|
|
1052
|
-
}),
|
|
1051
|
+
}), H.setState({
|
|
1053
1052
|
index: 0,
|
|
1054
1053
|
histories: [
|
|
1055
1054
|
{
|
|
1056
1055
|
id: "root",
|
|
1057
1056
|
pathname: a,
|
|
1058
|
-
params:
|
|
1059
|
-
|
|
1057
|
+
params: kt(
|
|
1058
|
+
pt.toArray(n).map((u) => u.props.path).flat(),
|
|
1060
1059
|
a,
|
|
1061
|
-
|
|
1060
|
+
i
|
|
1062
1061
|
),
|
|
1063
1062
|
transitionName: t,
|
|
1064
1063
|
layoutId: null
|
|
1065
1064
|
}
|
|
1066
1065
|
]
|
|
1067
|
-
}),
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1066
|
+
}), j(() => {
|
|
1067
|
+
window.history.state?.index || window.history.replaceState(
|
|
1068
|
+
{
|
|
1069
|
+
id: "root",
|
|
1070
|
+
index: 0,
|
|
1071
|
+
status: "IDLE",
|
|
1072
|
+
params: {},
|
|
1073
|
+
transitionName: t,
|
|
1074
|
+
layoutId: null
|
|
1075
|
+
},
|
|
1076
|
+
"",
|
|
1077
|
+
window.location.pathname
|
|
1078
|
+
);
|
|
1079
|
+
}, [t]), j(() => {
|
|
1080
|
+
r.forEach((u) => K.set(u.name, u));
|
|
1081
|
+
}, [r]), j(() => {
|
|
1082
|
+
s.forEach((u) => rt.set(u.name, u));
|
|
1083
|
+
}, [s]), /* @__PURE__ */ dt(
|
|
1072
1084
|
"div",
|
|
1073
1085
|
{
|
|
1074
1086
|
style: {
|
|
@@ -1079,62 +1091,51 @@ function te({
|
|
|
1079
1091
|
height: "100%"
|
|
1080
1092
|
},
|
|
1081
1093
|
children: [
|
|
1082
|
-
/* @__PURE__ */ M(
|
|
1083
|
-
/* @__PURE__ */ M(
|
|
1094
|
+
/* @__PURE__ */ M(bt, {}),
|
|
1095
|
+
/* @__PURE__ */ M($t, { children: n })
|
|
1084
1096
|
]
|
|
1085
1097
|
}
|
|
1086
1098
|
);
|
|
1087
1099
|
}
|
|
1088
|
-
function
|
|
1100
|
+
function Zt({ element: n }) {
|
|
1089
1101
|
return n;
|
|
1090
1102
|
}
|
|
1091
|
-
function
|
|
1103
|
+
function te() {
|
|
1092
1104
|
return {
|
|
1093
1105
|
push: async (r, s, a = {}) => {
|
|
1094
|
-
const { status:
|
|
1095
|
-
if (
|
|
1106
|
+
const { status: i, setStatus: u } = $.getState();
|
|
1107
|
+
if (i !== "COMPLETED" && i !== "IDLE")
|
|
1096
1108
|
return;
|
|
1097
|
-
const { index:
|
|
1109
|
+
const { index: f, addHistory: l } = H.getState(), S = Z.getState().defaultTransitionName, { transitionName: h = S, layoutId: c = null } = a, L = _.generateTaskId();
|
|
1098
1110
|
(await _.addTask(
|
|
1099
1111
|
async () => {
|
|
1100
|
-
|
|
1101
|
-
const
|
|
1102
|
-
Object.entries(s).filter(([
|
|
1103
|
-
),
|
|
1104
|
-
return window.history.
|
|
1105
|
-
{
|
|
1106
|
-
id: "root",
|
|
1107
|
-
index: 0,
|
|
1108
|
-
status: "IDLE",
|
|
1109
|
-
params: {},
|
|
1110
|
-
transitionName: E,
|
|
1111
|
-
layoutId: u
|
|
1112
|
-
},
|
|
1113
|
-
"",
|
|
1114
|
-
window.location.pathname
|
|
1115
|
-
), window.history.pushState(
|
|
1112
|
+
u("PUSHING");
|
|
1113
|
+
const D = B.compile(r)(s), N = B.parse(r).tokens.filter((A) => A.type === "param").map((A) => A.name), w = Object.fromEntries(
|
|
1114
|
+
Object.entries(s).filter(([A]) => !N.includes(A))
|
|
1115
|
+
), x = new URLSearchParams(w).toString(), F = `${D}${x ? `?${x}` : ""}`;
|
|
1116
|
+
return window.history.pushState(
|
|
1116
1117
|
{
|
|
1117
|
-
id:
|
|
1118
|
-
index:
|
|
1118
|
+
id: L,
|
|
1119
|
+
index: f + 1,
|
|
1119
1120
|
status: "PUSHING",
|
|
1120
1121
|
params: s,
|
|
1121
|
-
transitionName:
|
|
1122
|
-
layoutId:
|
|
1122
|
+
transitionName: h,
|
|
1123
|
+
layoutId: c
|
|
1123
1124
|
},
|
|
1124
1125
|
"",
|
|
1125
|
-
|
|
1126
|
-
),
|
|
1127
|
-
id:
|
|
1128
|
-
pathname:
|
|
1126
|
+
F
|
|
1127
|
+
), l({
|
|
1128
|
+
id: L,
|
|
1129
|
+
pathname: D,
|
|
1129
1130
|
params: s,
|
|
1130
|
-
transitionName:
|
|
1131
|
-
layoutId:
|
|
1131
|
+
transitionName: h,
|
|
1132
|
+
layoutId: c
|
|
1132
1133
|
}), () => {
|
|
1133
|
-
|
|
1134
|
+
u("COMPLETED");
|
|
1134
1135
|
};
|
|
1135
1136
|
},
|
|
1136
1137
|
{
|
|
1137
|
-
id:
|
|
1138
|
+
id: L,
|
|
1138
1139
|
control: {
|
|
1139
1140
|
manual: !0
|
|
1140
1141
|
}
|
|
@@ -1142,39 +1143,39 @@ function ne() {
|
|
|
1142
1143
|
)).result?.();
|
|
1143
1144
|
},
|
|
1144
1145
|
replace: async (r, s, a = {}) => {
|
|
1145
|
-
const { status:
|
|
1146
|
-
if (
|
|
1146
|
+
const { status: i, setStatus: u } = $.getState();
|
|
1147
|
+
if (i !== "COMPLETED" && i !== "IDLE")
|
|
1147
1148
|
return;
|
|
1148
|
-
const { index:
|
|
1149
|
+
const { index: f, addHistory: l } = H.getState(), S = H.getState().replaceHistory, h = Z.getState().defaultTransitionName, { transitionName: c = h, layoutId: L = null } = a, D = _.generateTaskId();
|
|
1149
1150
|
(await _.addTask(
|
|
1150
1151
|
async () => {
|
|
1151
|
-
|
|
1152
|
-
const N =
|
|
1152
|
+
u("REPLACING");
|
|
1153
|
+
const N = B.compile(r)(s), w = B.parse(r).tokens.filter((O) => O.type === "param").map((O) => O.name), x = Object.fromEntries(
|
|
1153
1154
|
Object.entries(s).filter(([O]) => !w.includes(O))
|
|
1154
|
-
),
|
|
1155
|
+
), F = new URLSearchParams(x).toString(), A = `${N}${F ? `?${F}` : ""}`;
|
|
1155
1156
|
return window.history.replaceState(
|
|
1156
1157
|
{
|
|
1157
|
-
id:
|
|
1158
|
-
index:
|
|
1158
|
+
id: D,
|
|
1159
|
+
index: f,
|
|
1159
1160
|
status: "REPLACING",
|
|
1160
1161
|
params: s,
|
|
1161
|
-
transitionName:
|
|
1162
|
-
layoutId:
|
|
1162
|
+
transitionName: c,
|
|
1163
|
+
layoutId: L
|
|
1163
1164
|
},
|
|
1164
1165
|
"",
|
|
1165
|
-
|
|
1166
|
-
),
|
|
1167
|
-
id:
|
|
1166
|
+
A
|
|
1167
|
+
), l({
|
|
1168
|
+
id: D,
|
|
1168
1169
|
pathname: N,
|
|
1169
1170
|
params: s,
|
|
1170
|
-
transitionName:
|
|
1171
|
-
layoutId:
|
|
1171
|
+
transitionName: c,
|
|
1172
|
+
layoutId: L
|
|
1172
1173
|
}), async () => {
|
|
1173
|
-
S(
|
|
1174
|
+
S(f), u("COMPLETED");
|
|
1174
1175
|
};
|
|
1175
1176
|
},
|
|
1176
1177
|
{
|
|
1177
|
-
id:
|
|
1178
|
+
id: D,
|
|
1178
1179
|
control: {
|
|
1179
1180
|
manual: !0
|
|
1180
1181
|
}
|
|
@@ -1187,13 +1188,13 @@ function ne() {
|
|
|
1187
1188
|
}
|
|
1188
1189
|
};
|
|
1189
1190
|
}
|
|
1190
|
-
function
|
|
1191
|
-
const n =
|
|
1191
|
+
function ee() {
|
|
1192
|
+
const n = nt(gt);
|
|
1192
1193
|
return {
|
|
1193
1194
|
pushStep: async (s) => {
|
|
1194
1195
|
const a = $.getState().status;
|
|
1195
1196
|
a !== "COMPLETED" && a !== "IDLE" || (await _.addTask(async () => {
|
|
1196
|
-
const
|
|
1197
|
+
const i = new URLSearchParams(s).toString(), u = `${window.location.pathname}${i ? `?${i}` : ""}`;
|
|
1197
1198
|
return window.history.state?.step || window.history.replaceState(
|
|
1198
1199
|
{
|
|
1199
1200
|
...window.history.state,
|
|
@@ -1208,14 +1209,14 @@ function se() {
|
|
|
1208
1209
|
params: s
|
|
1209
1210
|
},
|
|
1210
1211
|
"",
|
|
1211
|
-
|
|
1212
|
+
u
|
|
1212
1213
|
), async () => n({ type: "SET", params: s });
|
|
1213
1214
|
})).result?.();
|
|
1214
1215
|
},
|
|
1215
1216
|
replaceStep: async (s) => {
|
|
1216
1217
|
const a = $.getState().status;
|
|
1217
1218
|
a !== "COMPLETED" && a !== "IDLE" || (await _.addTask(async () => {
|
|
1218
|
-
const
|
|
1219
|
+
const i = new URLSearchParams(s).toString(), u = `${window.location.pathname}${i ? `?${i}` : ""}`;
|
|
1219
1220
|
return window.history.replaceState(
|
|
1220
1221
|
{
|
|
1221
1222
|
...window.history.state,
|
|
@@ -1223,7 +1224,7 @@ function se() {
|
|
|
1223
1224
|
params: s
|
|
1224
1225
|
},
|
|
1225
1226
|
"",
|
|
1226
|
-
|
|
1227
|
+
u
|
|
1227
1228
|
), async () => n({ type: "SET", params: s });
|
|
1228
1229
|
})).result?.();
|
|
1229
1230
|
},
|
|
@@ -1234,24 +1235,24 @@ function se() {
|
|
|
1234
1235
|
};
|
|
1235
1236
|
}
|
|
1236
1237
|
function V() {
|
|
1237
|
-
return
|
|
1238
|
+
return nt(mt);
|
|
1238
1239
|
}
|
|
1239
|
-
function
|
|
1240
|
-
return
|
|
1240
|
+
function ne() {
|
|
1241
|
+
return nt(yt);
|
|
1241
1242
|
}
|
|
1242
|
-
function
|
|
1243
|
+
function se({
|
|
1243
1244
|
name: n,
|
|
1244
1245
|
initial: e,
|
|
1245
1246
|
idle: t,
|
|
1246
1247
|
pushOnEnter: r,
|
|
1247
1248
|
pushOnExit: s,
|
|
1248
1249
|
replaceOnEnter: a,
|
|
1249
|
-
replaceOnExit:
|
|
1250
|
-
popOnEnter:
|
|
1251
|
-
popOnExit:
|
|
1252
|
-
completedOnExit:
|
|
1250
|
+
replaceOnExit: i,
|
|
1251
|
+
popOnEnter: u,
|
|
1252
|
+
popOnExit: f,
|
|
1253
|
+
completedOnExit: l,
|
|
1253
1254
|
completedOnEnter: S,
|
|
1254
|
-
options:
|
|
1255
|
+
options: h
|
|
1255
1256
|
}) {
|
|
1256
1257
|
return {
|
|
1257
1258
|
name: n,
|
|
@@ -1261,29 +1262,29 @@ function ae({
|
|
|
1261
1262
|
"IDLE-false": t,
|
|
1262
1263
|
"PUSHING-false": s,
|
|
1263
1264
|
"PUSHING-true": r,
|
|
1264
|
-
"REPLACING-false":
|
|
1265
|
+
"REPLACING-false": i,
|
|
1265
1266
|
"REPLACING-true": a,
|
|
1266
|
-
"POPPING-false":
|
|
1267
|
-
"POPPING-true":
|
|
1268
|
-
"COMPLETED-false":
|
|
1267
|
+
"POPPING-false": f,
|
|
1268
|
+
"POPPING-true": u,
|
|
1269
|
+
"COMPLETED-false": l,
|
|
1269
1270
|
"COMPLETED-true": S
|
|
1270
1271
|
},
|
|
1271
|
-
...
|
|
1272
|
+
...h
|
|
1272
1273
|
};
|
|
1273
1274
|
}
|
|
1274
|
-
function
|
|
1275
|
+
function re({
|
|
1275
1276
|
name: n,
|
|
1276
1277
|
initial: e,
|
|
1277
1278
|
idle: t,
|
|
1278
1279
|
pushOnEnter: r,
|
|
1279
1280
|
pushOnExit: s,
|
|
1280
1281
|
replaceOnEnter: a,
|
|
1281
|
-
replaceOnExit:
|
|
1282
|
-
popOnEnter:
|
|
1283
|
-
popOnExit:
|
|
1284
|
-
completedOnEnter:
|
|
1282
|
+
replaceOnExit: i,
|
|
1283
|
+
popOnEnter: u,
|
|
1284
|
+
popOnExit: f,
|
|
1285
|
+
completedOnEnter: l,
|
|
1285
1286
|
completedOnExit: S,
|
|
1286
|
-
options:
|
|
1287
|
+
options: h
|
|
1287
1288
|
}) {
|
|
1288
1289
|
return {
|
|
1289
1290
|
name: n,
|
|
@@ -1293,49 +1294,49 @@ function oe({
|
|
|
1293
1294
|
"IDLE-false": t,
|
|
1294
1295
|
"PUSHING-false": s,
|
|
1295
1296
|
"PUSHING-true": r,
|
|
1296
|
-
"REPLACING-false":
|
|
1297
|
+
"REPLACING-false": i,
|
|
1297
1298
|
"REPLACING-true": a,
|
|
1298
|
-
"POPPING-false":
|
|
1299
|
-
"POPPING-true":
|
|
1299
|
+
"POPPING-false": f,
|
|
1300
|
+
"POPPING-true": u,
|
|
1300
1301
|
"COMPLETED-false": S,
|
|
1301
|
-
"COMPLETED-true":
|
|
1302
|
+
"COMPLETED-true": l
|
|
1302
1303
|
},
|
|
1303
|
-
...
|
|
1304
|
+
...h
|
|
1304
1305
|
};
|
|
1305
1306
|
}
|
|
1306
|
-
const
|
|
1307
|
+
const qt = { then() {
|
|
1307
1308
|
} };
|
|
1308
|
-
function
|
|
1309
|
+
function Yt({
|
|
1309
1310
|
freeze: n,
|
|
1310
1311
|
children: e
|
|
1311
1312
|
}) {
|
|
1312
1313
|
if (n)
|
|
1313
|
-
throw
|
|
1314
|
+
throw qt;
|
|
1314
1315
|
return e;
|
|
1315
1316
|
}
|
|
1316
|
-
function
|
|
1317
|
-
return /* @__PURE__ */ M(Dt, { fallback: t, children: /* @__PURE__ */ M(
|
|
1317
|
+
function Et({ freeze: n, children: e, placeholder: t }) {
|
|
1318
|
+
return /* @__PURE__ */ M(Dt, { fallback: t, children: /* @__PURE__ */ M(Yt, { freeze: n, children: e }) });
|
|
1318
1319
|
}
|
|
1319
|
-
function
|
|
1320
|
+
function ut(n, e) {
|
|
1320
1321
|
const {
|
|
1321
1322
|
direction: t = "x",
|
|
1322
1323
|
markerSelector: r = "[data-swipe-at-edge]",
|
|
1323
1324
|
depthLimit: s = 24,
|
|
1324
1325
|
verifyByScroll: a = !1
|
|
1325
|
-
} = e ?? {},
|
|
1326
|
-
if (!
|
|
1327
|
-
const
|
|
1328
|
-
if (
|
|
1329
|
-
return { element:
|
|
1330
|
-
let
|
|
1331
|
-
for (;
|
|
1332
|
-
if (
|
|
1333
|
-
return { element:
|
|
1334
|
-
|
|
1326
|
+
} = e ?? {}, i = Xt(n);
|
|
1327
|
+
if (!i) return { element: null, hasMarker: !1 };
|
|
1328
|
+
const u = i.closest?.(r);
|
|
1329
|
+
if (u instanceof HTMLElement && tt(u, t) && (!a || lt(u, t)))
|
|
1330
|
+
return { element: u, hasMarker: !0 };
|
|
1331
|
+
let f = i, l = 0;
|
|
1332
|
+
for (; f && f !== document.body && l < s; ) {
|
|
1333
|
+
if (tt(f, t) && (!a || lt(f, t)))
|
|
1334
|
+
return { element: f, hasMarker: !1 };
|
|
1335
|
+
f = f.parentElement, l++;
|
|
1335
1336
|
}
|
|
1336
1337
|
return { element: null, hasMarker: !1 };
|
|
1337
1338
|
}
|
|
1338
|
-
function
|
|
1339
|
+
function Xt(n) {
|
|
1339
1340
|
if (!n) return null;
|
|
1340
1341
|
const e = n, t = typeof e.composedPath == "function" ? e.composedPath() : void 0;
|
|
1341
1342
|
if (t && t.length) {
|
|
@@ -1344,11 +1345,11 @@ function Kt(n) {
|
|
|
1344
1345
|
}
|
|
1345
1346
|
return n;
|
|
1346
1347
|
}
|
|
1347
|
-
function
|
|
1348
|
+
function tt(n, e) {
|
|
1348
1349
|
return e === "y" ? n.scrollHeight - n.clientHeight > 1 : n.scrollWidth - n.clientWidth > 1;
|
|
1349
1350
|
}
|
|
1350
|
-
function
|
|
1351
|
-
if (!
|
|
1351
|
+
function lt(n, e) {
|
|
1352
|
+
if (!tt(n, e)) return !1;
|
|
1352
1353
|
if (e === "y") {
|
|
1353
1354
|
const t = n.scrollTop;
|
|
1354
1355
|
if (n.scrollTop = t + 1, n.scrollTop !== t)
|
|
@@ -1365,16 +1366,16 @@ function dt(n, e) {
|
|
|
1365
1366
|
return n.scrollLeft = t, s;
|
|
1366
1367
|
}
|
|
1367
1368
|
}
|
|
1368
|
-
function
|
|
1369
|
-
const { isActive: r, transitionName: s } = V(), [a,
|
|
1370
|
-
|
|
1371
|
-
const
|
|
1372
|
-
return
|
|
1369
|
+
function Kt({ children: n, ref: e, ...t }) {
|
|
1370
|
+
const { isActive: r, transitionName: s } = V(), [a, i] = ft();
|
|
1371
|
+
Lt(e, () => a.current);
|
|
1372
|
+
const u = $((c) => c.status), f = K.get(s), { decoratorName: l } = f, { initial: S, variants: h } = rt.get(l);
|
|
1373
|
+
return j(() => {
|
|
1373
1374
|
if (!a.current) return;
|
|
1374
|
-
const { value:
|
|
1375
|
-
|
|
1376
|
-
}, [
|
|
1377
|
-
|
|
1375
|
+
const { value: c, options: L } = h[`${u}-${r}`];
|
|
1376
|
+
i(a.current, c, L);
|
|
1377
|
+
}, [u, r, i, h, a]), /* @__PURE__ */ M(
|
|
1378
|
+
ht.div,
|
|
1378
1379
|
{
|
|
1379
1380
|
ref: a,
|
|
1380
1381
|
initial: S,
|
|
@@ -1391,125 +1392,125 @@ function Vt({ children: n, ref: e, ...t }) {
|
|
|
1391
1392
|
}
|
|
1392
1393
|
);
|
|
1393
1394
|
}
|
|
1394
|
-
const
|
|
1395
|
+
const q = z((n) => ({
|
|
1395
1396
|
dragStatus: "IDLE",
|
|
1396
1397
|
replaceTransitionStatus: "IDLE",
|
|
1397
1398
|
setDragStatus: (e) => n({ dragStatus: e }),
|
|
1398
1399
|
setReplaceTransitionStatus: (e) => n({ replaceTransitionStatus: e })
|
|
1399
1400
|
}));
|
|
1400
|
-
function
|
|
1401
|
+
function St({
|
|
1401
1402
|
children: n,
|
|
1402
1403
|
...e
|
|
1403
1404
|
}) {
|
|
1404
|
-
const [t, r] =
|
|
1405
|
+
const [t, r] = ft(), { id: s, isActive: a, isRoot: i, transitionName: u, prevTransitionName: f } = V(), l = It(), S = $((E) => E.status), h = q((E) => E.dragStatus), c = q.getState().setDragStatus, L = q.getState().setReplaceTransitionStatus, D = K.get(u), { variants: N, initial: w, swipeDirection: x, decoratorName: F } = D, A = rt.get(F), O = U(null), Y = U(null), X = U(null), o = U(!1), p = U(!1), g = U({
|
|
1405
1406
|
element: null,
|
|
1406
1407
|
hasMarker: !1
|
|
1407
|
-
}),
|
|
1408
|
-
if (!
|
|
1408
|
+
}), m = U({ element: null, hasMarker: !1 }), y = U(0), d = U(0), I = async (E, v) => {
|
|
1409
|
+
if (!x)
|
|
1409
1410
|
return;
|
|
1410
1411
|
O.current = t.current?.previousSibling, X.current = t.current?.previousSibling?.querySelector("[data-decorator]");
|
|
1411
|
-
const
|
|
1412
|
+
const b = await D?.onSwipeStart(E, v, {
|
|
1412
1413
|
animate: r,
|
|
1413
1414
|
currentScreen: t.current,
|
|
1414
1415
|
prevScreen: O.current,
|
|
1415
|
-
dragControls:
|
|
1416
|
-
onStart: (
|
|
1416
|
+
dragControls: l,
|
|
1417
|
+
onStart: (Q) => A?.onSwipeStart?.(Q, {
|
|
1417
1418
|
animate: r,
|
|
1418
1419
|
currentDecorator: Y.current,
|
|
1419
1420
|
prevDecorator: X.current
|
|
1420
1421
|
})
|
|
1421
1422
|
});
|
|
1422
|
-
|
|
1423
|
-
}, T = (
|
|
1424
|
-
!
|
|
1423
|
+
c(b ? "PENDING" : "IDLE");
|
|
1424
|
+
}, T = (E, v) => {
|
|
1425
|
+
!x || h !== "PENDING" || D?.onSwipe(E, v, {
|
|
1425
1426
|
animate: r,
|
|
1426
1427
|
currentScreen: t.current,
|
|
1427
1428
|
prevScreen: O.current,
|
|
1428
|
-
dragControls:
|
|
1429
|
-
onProgress: (
|
|
1429
|
+
dragControls: l,
|
|
1430
|
+
onProgress: (b, Q) => A?.onSwipe?.(b, Q, {
|
|
1430
1431
|
animate: r,
|
|
1431
1432
|
currentDecorator: Y.current,
|
|
1432
1433
|
prevDecorator: X.current
|
|
1433
1434
|
})
|
|
1434
1435
|
});
|
|
1435
|
-
},
|
|
1436
|
-
if (!
|
|
1436
|
+
}, R = async (E, v) => {
|
|
1437
|
+
if (!x || h !== "PENDING")
|
|
1437
1438
|
return;
|
|
1438
|
-
await
|
|
1439
|
+
await D?.onSwipeEnd(E, v, {
|
|
1439
1440
|
animate: r,
|
|
1440
1441
|
currentScreen: t.current,
|
|
1441
1442
|
prevScreen: O.current,
|
|
1442
|
-
onStart: (
|
|
1443
|
+
onStart: (Q) => A?.onSwipeEnd?.(Q, {
|
|
1443
1444
|
animate: r,
|
|
1444
1445
|
currentDecorator: Y.current,
|
|
1445
1446
|
prevDecorator: X.current
|
|
1446
1447
|
})
|
|
1447
|
-
}) ? window.history.back() :
|
|
1448
|
-
}, P = (
|
|
1449
|
-
if (!(!
|
|
1448
|
+
}) ? window.history.back() : c("IDLE");
|
|
1449
|
+
}, P = (E) => {
|
|
1450
|
+
if (!(!i && a && S === "COMPLETED" && h === "IDLE" && !!x))
|
|
1450
1451
|
return;
|
|
1451
|
-
|
|
1452
|
+
g.current = ut(E.target, {
|
|
1452
1453
|
direction: "x",
|
|
1453
1454
|
verifyByScroll: !0
|
|
1454
|
-
}),
|
|
1455
|
+
}), m.current = ut(E.target, {
|
|
1455
1456
|
direction: "y",
|
|
1456
1457
|
verifyByScroll: !0
|
|
1457
|
-
}),
|
|
1458
|
-
},
|
|
1459
|
-
const
|
|
1460
|
-
if (
|
|
1461
|
-
|
|
1462
|
-
else if (
|
|
1463
|
-
const
|
|
1464
|
-
(
|
|
1458
|
+
}), y.current = E.clientX, d.current = E.clientY, (!g.current.element && !m.current.element || g.current.element || m.current.element) && (o.current = !0);
|
|
1459
|
+
}, C = (E) => {
|
|
1460
|
+
const v = !g.current.element && !m.current.element;
|
|
1461
|
+
if (o.current && v)
|
|
1462
|
+
o.current = !1, p.current = !0, l.start(E);
|
|
1463
|
+
else if (o.current && !v) {
|
|
1464
|
+
const b = E.clientX - y.current, Q = E.clientY - d.current, wt = m.current.element && m.current.element.scrollTop <= 0 && m.current.hasMarker, Pt = g.current.element && g.current.element.scrollLeft <= 0 && g.current.hasMarker;
|
|
1465
|
+
(x === "y" && (wt || g.current.element) && Q > 0 && Math.abs(b) < 4 || x === "x" && (Pt || m.current.element) && b > 0 && Math.abs(Q) < 4) && (o.current = !1, p.current = !0, l.start(E));
|
|
1465
1466
|
}
|
|
1466
|
-
},
|
|
1467
|
-
|
|
1467
|
+
}, k = () => {
|
|
1468
|
+
o.current = !1, p.current = !1;
|
|
1468
1469
|
};
|
|
1469
|
-
return
|
|
1470
|
-
const
|
|
1471
|
-
if (!
|
|
1472
|
-
const
|
|
1473
|
-
p.current &&
|
|
1470
|
+
return j(() => {
|
|
1471
|
+
const E = t.current;
|
|
1472
|
+
if (!E) return;
|
|
1473
|
+
const v = (b) => {
|
|
1474
|
+
p.current && b.preventDefault(), b.target?.dataset.swipeAtEdgeBar === "true" && b.preventDefault();
|
|
1474
1475
|
};
|
|
1475
|
-
return
|
|
1476
|
+
return E.addEventListener("touchmove", v, {
|
|
1476
1477
|
passive: !1
|
|
1477
1478
|
}), () => {
|
|
1478
|
-
|
|
1479
|
+
E.removeEventListener("touchmove", v);
|
|
1479
1480
|
};
|
|
1480
|
-
}, [t]),
|
|
1481
|
+
}, [t]), j(() => {
|
|
1481
1482
|
t.current && (async () => {
|
|
1482
|
-
const { value:
|
|
1483
|
-
!a && S === "REPLACING" &&
|
|
1483
|
+
const { value: E, options: v } = N[`${S}-${a}`];
|
|
1484
|
+
!a && S === "REPLACING" && f !== u && (L("PENDING"), await r(t.current, jt, {
|
|
1484
1485
|
duration: 0.1
|
|
1485
|
-
})),
|
|
1486
|
+
})), a && S === "COMPLETED" && (c("IDLE"), L("IDLE")), await r(t.current, E, v), await _.resolveTask(s);
|
|
1486
1487
|
})();
|
|
1487
1488
|
}, [
|
|
1488
1489
|
S,
|
|
1489
1490
|
a,
|
|
1490
1491
|
s,
|
|
1491
|
-
|
|
1492
|
-
|
|
1492
|
+
f,
|
|
1493
|
+
u,
|
|
1493
1494
|
r,
|
|
1494
1495
|
t,
|
|
1495
1496
|
N,
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
]), /* @__PURE__ */
|
|
1499
|
-
|
|
1497
|
+
c,
|
|
1498
|
+
L
|
|
1499
|
+
]), /* @__PURE__ */ dt(
|
|
1500
|
+
ht.div,
|
|
1500
1501
|
{
|
|
1501
1502
|
ref: t,
|
|
1502
1503
|
...e,
|
|
1503
1504
|
initial: w,
|
|
1504
|
-
drag:
|
|
1505
|
+
drag: x,
|
|
1505
1506
|
dragListener: !1,
|
|
1506
|
-
dragControls:
|
|
1507
|
-
onDragStart:
|
|
1507
|
+
dragControls: l,
|
|
1508
|
+
onDragStart: I,
|
|
1508
1509
|
onDrag: T,
|
|
1509
|
-
onDragEnd:
|
|
1510
|
+
onDragEnd: R,
|
|
1510
1511
|
onPointerDown: P,
|
|
1511
|
-
onPointerMove:
|
|
1512
|
-
onPointerUp:
|
|
1512
|
+
onPointerMove: C,
|
|
1513
|
+
onPointerUp: k,
|
|
1513
1514
|
style: {
|
|
1514
1515
|
position: "absolute",
|
|
1515
1516
|
top: 0,
|
|
@@ -1554,7 +1555,7 @@ function wt({
|
|
|
1554
1555
|
children: n
|
|
1555
1556
|
}
|
|
1556
1557
|
),
|
|
1557
|
-
|
|
1558
|
+
A && /* @__PURE__ */ M(Kt, { ref: Y }),
|
|
1558
1559
|
/* @__PURE__ */ M(
|
|
1559
1560
|
"div",
|
|
1560
1561
|
{
|
|
@@ -1573,34 +1574,34 @@ function wt({
|
|
|
1573
1574
|
}
|
|
1574
1575
|
);
|
|
1575
1576
|
}
|
|
1576
|
-
function
|
|
1577
|
+
function ae({
|
|
1577
1578
|
children: n,
|
|
1578
1579
|
...e
|
|
1579
1580
|
}) {
|
|
1580
|
-
const { isActive: t, isPrev: r } = V(),
|
|
1581
|
-
return /* @__PURE__ */ M(
|
|
1581
|
+
const { isActive: t, isPrev: r, zIndex: s } = V(), a = H((h) => h.index), i = $((h) => h.status), u = q((h) => h.dragStatus), f = q((h) => h.replaceTransitionStatus), S = !t && (i === "COMPLETED" && u === "IDLE") || r && a - 2 <= s && f === "IDLE" || r && a - 2 > s;
|
|
1582
|
+
return /* @__PURE__ */ M(Et, { freeze: S, children: /* @__PURE__ */ M(St, { ...e, children: n }) });
|
|
1582
1583
|
}
|
|
1583
|
-
function
|
|
1584
|
+
function oe({
|
|
1584
1585
|
children: n,
|
|
1585
1586
|
...e
|
|
1586
1587
|
}) {
|
|
1587
|
-
const { isActive: t, isPrev: r } = V(),
|
|
1588
|
-
return /* @__PURE__ */ M(
|
|
1589
|
-
|
|
1588
|
+
const { isActive: t, isPrev: r, zIndex: s } = V(), a = H((h) => h.index), i = $((h) => h.status), u = q((h) => h.dragStatus), f = q((h) => h.replaceTransitionStatus), S = !t && (i === "COMPLETED" && u === "IDLE") || r && a - 2 <= s && f === "IDLE" || r && a - 2 > s;
|
|
1589
|
+
return /* @__PURE__ */ M(Et, { freeze: S, children: /* @__PURE__ */ M(
|
|
1590
|
+
St,
|
|
1590
1591
|
{
|
|
1591
1592
|
...e,
|
|
1592
1593
|
style: {
|
|
1593
1594
|
backgroundColor: "transparent",
|
|
1594
1595
|
...e.style
|
|
1595
1596
|
},
|
|
1596
|
-
children: /* @__PURE__ */ M(
|
|
1597
|
+
children: /* @__PURE__ */ M(vt, { children: n })
|
|
1597
1598
|
}
|
|
1598
1599
|
) });
|
|
1599
1600
|
}
|
|
1600
|
-
function
|
|
1601
|
-
const { isActive: t, transitionName: r } = V(), s = $((
|
|
1601
|
+
function ie({ children: n, ...e }) {
|
|
1602
|
+
const { isActive: t, transitionName: r } = V(), s = $((i) => i.status), a = K.get(r);
|
|
1602
1603
|
return /* @__PURE__ */ M(
|
|
1603
|
-
|
|
1604
|
+
Nt,
|
|
1604
1605
|
{
|
|
1605
1606
|
transition: a?.variants[`${s}-${t}`]?.options,
|
|
1606
1607
|
...e,
|
|
@@ -1609,17 +1610,17 @@ function ue({ children: n, ...e }) {
|
|
|
1609
1610
|
);
|
|
1610
1611
|
}
|
|
1611
1612
|
export {
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1613
|
+
ie as LayoutConfig,
|
|
1614
|
+
oe as LayoutScreen,
|
|
1615
|
+
Zt as Route,
|
|
1616
|
+
Jt as Router,
|
|
1617
|
+
ae as Screen,
|
|
1618
|
+
Ut as createDecorator,
|
|
1619
|
+
re as createRawDecorator,
|
|
1620
|
+
se as createRawTransition,
|
|
1620
1621
|
J as createTransition,
|
|
1621
|
-
|
|
1622
|
-
|
|
1622
|
+
te as useNavigate,
|
|
1623
|
+
ne as useParams,
|
|
1623
1624
|
V as useScreen,
|
|
1624
|
-
|
|
1625
|
+
ee as useStep
|
|
1625
1626
|
};
|