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