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