flemo 1.3.9 → 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 +201 -211
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as L, jsxs as pt } from "react/jsx-runtime";
|
|
2
|
-
import nt, { useEffect as B, createContext as
|
|
3
|
-
import { transform as
|
|
4
|
-
var _ = {},
|
|
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
5
|
function Bt() {
|
|
6
|
-
if (
|
|
7
|
-
|
|
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
8
|
const n = "/", e = (i) => i, t = /^[$_\p{ID_Start}]$/u, s = /^[$\u200c\u200d\p{ID_Continue}]$/u, r = {
|
|
9
9
|
// Groups.
|
|
10
10
|
"{": "{",
|
|
@@ -25,26 +25,26 @@ function Bt() {
|
|
|
25
25
|
return i.replace(/[.+*?^${}()[\]|/\\]/g, "\\$&");
|
|
26
26
|
}
|
|
27
27
|
class c {
|
|
28
|
-
constructor(
|
|
29
|
-
this.tokens =
|
|
28
|
+
constructor(y, g) {
|
|
29
|
+
this.tokens = y, this.originalPath = g;
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
_.TokenData = c;
|
|
33
33
|
class h extends TypeError {
|
|
34
|
-
constructor(
|
|
35
|
-
let w =
|
|
36
|
-
|
|
34
|
+
constructor(y, 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
|
-
function l(i,
|
|
41
|
-
const { encodePath:
|
|
40
|
+
function l(i, y = {}) {
|
|
41
|
+
const { encodePath: g = e } = y, w = [...i], f = [];
|
|
42
42
|
let p = 0, D = 0;
|
|
43
43
|
function v() {
|
|
44
|
-
let
|
|
44
|
+
let P = "";
|
|
45
45
|
if (t.test(w[p]))
|
|
46
46
|
do
|
|
47
|
-
|
|
47
|
+
P += w[p++];
|
|
48
48
|
while (s.test(w[p]));
|
|
49
49
|
else if (w[p] === '"') {
|
|
50
50
|
let M = p;
|
|
@@ -53,67 +53,67 @@ function Bt() {
|
|
|
53
53
|
p++, M = 0;
|
|
54
54
|
break;
|
|
55
55
|
}
|
|
56
|
-
w[p] === "\\" && p++,
|
|
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 (!
|
|
61
|
+
if (!P)
|
|
62
62
|
throw new h(`Missing parameter name at index ${p}`, i);
|
|
63
|
-
return
|
|
63
|
+
return P;
|
|
64
64
|
}
|
|
65
65
|
for (; p < w.length; ) {
|
|
66
|
-
const
|
|
67
|
-
M ? f.push({ type: M, index: p++, value:
|
|
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
69
|
f.push({ type: "end", index: p, value: "" });
|
|
70
|
-
function O(
|
|
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 =
|
|
76
|
+
if (I.type === "char" || I.type === "escape") {
|
|
77
|
+
let C = I.value, $ = f[D];
|
|
78
78
|
for (; $.type === "char" || $.type === "escape"; )
|
|
79
79
|
C += $.value, $ = f[++D];
|
|
80
80
|
M.push({
|
|
81
81
|
type: "text",
|
|
82
|
-
value:
|
|
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
|
-
function m(i,
|
|
107
|
-
const { encode:
|
|
106
|
+
function m(i, y = {}) {
|
|
107
|
+
const { encode: g = encodeURIComponent, delimiter: w = n } = y, f = typeof i == "object" ? i : l(i, y), p = d(f.tokens, w, g);
|
|
108
108
|
return function(v = {}) {
|
|
109
|
-
const [O, ...
|
|
110
|
-
if (
|
|
111
|
-
throw new TypeError(`Missing parameters: ${
|
|
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
|
-
function d(i,
|
|
116
|
-
const w = i.map((f) => u(f,
|
|
115
|
+
function d(i, y, g) {
|
|
116
|
+
const w = i.map((f) => u(f, y, g));
|
|
117
117
|
return (f) => {
|
|
118
118
|
const p = [""];
|
|
119
119
|
for (const D of w) {
|
|
@@ -123,18 +123,18 @@ function Bt() {
|
|
|
123
123
|
return p;
|
|
124
124
|
};
|
|
125
125
|
}
|
|
126
|
-
function u(i,
|
|
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 f = d(i.tokens,
|
|
130
|
+
const f = d(i.tokens, y, g);
|
|
131
131
|
return (p) => {
|
|
132
132
|
const [D, ...v] = f(p);
|
|
133
133
|
return v.length ? [""] : [D];
|
|
134
134
|
};
|
|
135
135
|
}
|
|
136
|
-
const w =
|
|
137
|
-
return i.type === "wildcard" &&
|
|
136
|
+
const w = g || e;
|
|
137
|
+
return i.type === "wildcard" && g !== !1 ? (f) => {
|
|
138
138
|
const p = f[i.name];
|
|
139
139
|
if (p == null)
|
|
140
140
|
return ["", i.name];
|
|
@@ -145,7 +145,7 @@ function Bt() {
|
|
|
145
145
|
if (typeof D != "string")
|
|
146
146
|
throw new TypeError(`Expected "${i.name}/${v}" to be a string`);
|
|
147
147
|
return w(D);
|
|
148
|
-
}).join(
|
|
148
|
+
}).join(y)
|
|
149
149
|
];
|
|
150
150
|
} : (f) => {
|
|
151
151
|
const p = f[i.name];
|
|
@@ -156,103 +156,103 @@ function Bt() {
|
|
|
156
156
|
return [w(p)];
|
|
157
157
|
};
|
|
158
158
|
}
|
|
159
|
-
function
|
|
160
|
-
const { decode:
|
|
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
169
|
const $ = p[C - 1], V = D[C - 1];
|
|
170
|
-
|
|
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:
|
|
177
|
-
for (const
|
|
178
|
-
const C = typeof
|
|
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
179
|
for (const $ of E(C.tokens, 0, []))
|
|
180
|
-
O.push(
|
|
180
|
+
O.push(N($, g, D, C.originalPath));
|
|
181
181
|
}
|
|
182
|
-
let
|
|
183
|
-
return p && (
|
|
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
|
-
for (const
|
|
188
|
-
|
|
187
|
+
for (const g of i)
|
|
188
|
+
x(g, y);
|
|
189
189
|
else
|
|
190
|
-
|
|
191
|
-
return
|
|
190
|
+
y.push(i);
|
|
191
|
+
return y;
|
|
192
192
|
}
|
|
193
|
-
function* E(i,
|
|
194
|
-
if (
|
|
195
|
-
return yield
|
|
196
|
-
const w = i[
|
|
193
|
+
function* E(i, y, g) {
|
|
194
|
+
if (y === i.length)
|
|
195
|
+
return yield g;
|
|
196
|
+
const w = i[y];
|
|
197
197
|
if (w.type === "group")
|
|
198
|
-
for (const f of E(w.tokens, 0,
|
|
199
|
-
yield* E(i,
|
|
198
|
+
for (const f of E(w.tokens, 0, g.slice()))
|
|
199
|
+
yield* E(i, y + 1, f);
|
|
200
200
|
else
|
|
201
|
-
|
|
202
|
-
yield* E(i,
|
|
201
|
+
g.push(w);
|
|
202
|
+
yield* E(i, y + 1, g);
|
|
203
203
|
}
|
|
204
|
-
function
|
|
204
|
+
function N(i, y, g, w) {
|
|
205
205
|
let f = "", p = "", D = !0;
|
|
206
206
|
for (const v of i) {
|
|
207
207
|
if (v.type === "text") {
|
|
208
|
-
f += o(v.value), p += v.value, D || (D = v.value.includes(
|
|
208
|
+
f += o(v.value), p += v.value, D || (D = v.value.includes(y));
|
|
209
209
|
continue;
|
|
210
210
|
}
|
|
211
211
|
if (v.type === "param" || v.type === "wildcard") {
|
|
212
212
|
if (!D && !p)
|
|
213
213
|
throw new h(`Missing text before "${v.name}" ${v.type}`, w);
|
|
214
|
-
v.type === "param" ? f += `(${F(
|
|
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
218
|
return f;
|
|
219
219
|
}
|
|
220
|
-
function F(i,
|
|
221
|
-
return
|
|
220
|
+
function F(i, y) {
|
|
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
|
-
let
|
|
224
|
+
let y = "", g = 0;
|
|
225
225
|
function w(f) {
|
|
226
|
-
return A(f) && b(i[
|
|
226
|
+
return A(f) && b(i[g]) ? f : JSON.stringify(f);
|
|
227
227
|
}
|
|
228
|
-
for (;
|
|
229
|
-
const f = i[
|
|
228
|
+
for (; g < i.length; ) {
|
|
229
|
+
const f = i[g++];
|
|
230
230
|
if (f.type === "text") {
|
|
231
|
-
|
|
231
|
+
y += a(f.value);
|
|
232
232
|
continue;
|
|
233
233
|
}
|
|
234
234
|
if (f.type === "group") {
|
|
235
|
-
|
|
235
|
+
y += `{${Q(f.tokens)}}`;
|
|
236
236
|
continue;
|
|
237
237
|
}
|
|
238
238
|
if (f.type === "param") {
|
|
239
|
-
|
|
239
|
+
y += `:${w(f.name)}`;
|
|
240
240
|
continue;
|
|
241
241
|
}
|
|
242
242
|
if (f.type === "wildcard") {
|
|
243
|
-
|
|
243
|
+
y += `*${w(f.name)}`;
|
|
244
244
|
continue;
|
|
245
245
|
}
|
|
246
246
|
throw new TypeError(`Unknown token type: ${f.type}`);
|
|
247
247
|
}
|
|
248
|
-
return
|
|
248
|
+
return y;
|
|
249
249
|
}
|
|
250
250
|
function H(i) {
|
|
251
251
|
return Q(i.tokens);
|
|
252
252
|
}
|
|
253
253
|
function A(i) {
|
|
254
|
-
const [
|
|
255
|
-
return t.test(
|
|
254
|
+
const [y, ...g] = i;
|
|
255
|
+
return t.test(y) && g.every((w) => s.test(w));
|
|
256
256
|
}
|
|
257
257
|
function b(i) {
|
|
258
258
|
return i && i.type === "text" ? !s.test(i.value[0]) : !0;
|
|
@@ -264,7 +264,7 @@ function Xt(n, e, t) {
|
|
|
264
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
265
|
return r ? { ...r.params, ...o } : {};
|
|
266
266
|
}
|
|
267
|
-
function
|
|
267
|
+
function St() {
|
|
268
268
|
return typeof document > "u";
|
|
269
269
|
}
|
|
270
270
|
class zt {
|
|
@@ -348,21 +348,21 @@ class zt {
|
|
|
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
357
|
for (const E of u.dependencies) {
|
|
358
|
-
const
|
|
359
|
-
if (!
|
|
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
364
|
m && m > 0 && await new Promise((E) => setTimeout(E, m));
|
|
365
|
-
const
|
|
365
|
+
const x = await u.execute(u.abortController);
|
|
366
366
|
if (u.abortController.signal.aborted) {
|
|
367
367
|
u.status = "COMPLETED", await this.onTaskStatusChange(u.id, "COMPLETED"), r({
|
|
368
368
|
success: !0,
|
|
@@ -375,38 +375,38 @@ class zt {
|
|
|
375
375
|
}
|
|
376
376
|
if (t.control) {
|
|
377
377
|
const E = t.control;
|
|
378
|
-
if (E.delay && E.delay > 0 && await new Promise((
|
|
379
|
-
u.status = "MANUAL_PENDING", u.manualResolver = { resolve: r, reject: a, result:
|
|
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
382
|
if (E.signal) {
|
|
383
|
-
u.status = "SIGNAL_PENDING", u.manualResolver = { resolve: r, reject: a, result:
|
|
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
386
|
if (E.condition && !await E.condition()) {
|
|
387
|
-
u.status = "MANUAL_PENDING", u.manualResolver = { resolve: r, reject: a, result:
|
|
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
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);
|
|
@@ -440,17 +440,17 @@ class zt {
|
|
|
440
440
|
await Promise.all(e.map((t) => this.resolveTask(t.id)));
|
|
441
441
|
}
|
|
442
442
|
}
|
|
443
|
-
const q = new zt(),
|
|
443
|
+
const q = new zt(), Pt = (n) => {
|
|
444
444
|
let e;
|
|
445
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 ?
|
|
453
|
+
}, Kt = ((n) => n ? Pt(n) : Pt), Wt = (n) => n;
|
|
454
454
|
function Jt(n, e = Wt) {
|
|
455
455
|
const t = nt.useSyncExternalStore(
|
|
456
456
|
n.subscribe,
|
|
@@ -459,10 +459,10 @@ function Jt(n, e = Wt) {
|
|
|
459
459
|
);
|
|
460
460
|
return nt.useDebugValue(t), t;
|
|
461
461
|
}
|
|
462
|
-
const
|
|
462
|
+
const Tt = (n) => {
|
|
463
463
|
const e = Kt(n), t = (s) => Jt(e, s);
|
|
464
464
|
return Object.assign(t, e), t;
|
|
465
|
-
}, st = ((n) => n ?
|
|
465
|
+
}, st = ((n) => n ? Tt(n) : Tt), X = st((n) => ({
|
|
466
466
|
index: -1,
|
|
467
467
|
histories: [],
|
|
468
468
|
addHistory: (e) => n((t) => ({
|
|
@@ -487,25 +487,25 @@ function Zt() {
|
|
|
487
487
|
const t = e.state?.id;
|
|
488
488
|
(await q.addTask(
|
|
489
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(),
|
|
491
|
-
if (!
|
|
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
492
|
s.abort();
|
|
493
493
|
return;
|
|
494
494
|
}
|
|
495
|
-
return
|
|
495
|
+
return S ? l("POPPING") : k ? (l("PUSHING"), d({
|
|
496
496
|
id: t,
|
|
497
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
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,7 +521,7 @@ function Zt() {
|
|
|
521
521
|
};
|
|
522
522
|
}, []), null;
|
|
523
523
|
}
|
|
524
|
-
const kt =
|
|
524
|
+
const kt = gt({}), Mt = gt(() => {
|
|
525
525
|
});
|
|
526
526
|
function te(n, e) {
|
|
527
527
|
switch (e.type) {
|
|
@@ -531,7 +531,7 @@ function te(n, e) {
|
|
|
531
531
|
return n;
|
|
532
532
|
}
|
|
533
533
|
}
|
|
534
|
-
const Ct =
|
|
534
|
+
const Ct = gt({
|
|
535
535
|
id: "",
|
|
536
536
|
isActive: !1,
|
|
537
537
|
isRoot: !0,
|
|
@@ -544,7 +544,7 @@ const Ct = yt({
|
|
|
544
544
|
layoutId: null
|
|
545
545
|
});
|
|
546
546
|
function Z() {
|
|
547
|
-
return
|
|
547
|
+
return yt(Ct);
|
|
548
548
|
}
|
|
549
549
|
function ee({ children: n }) {
|
|
550
550
|
const { isActive: e, params: t } = Z(), [s, r] = jt(te, t);
|
|
@@ -562,7 +562,7 @@ function ee({ children: n }) {
|
|
|
562
562
|
function ne({ children: n }) {
|
|
563
563
|
const e = X((s) => s.index), t = X((s) => s.histories);
|
|
564
564
|
return t.map(
|
|
565
|
-
(s) =>
|
|
565
|
+
(s) => Dt.toArray(n).filter(
|
|
566
566
|
(r) => W.pathToRegexp(r.props.path).regexp.test(
|
|
567
567
|
s.pathname
|
|
568
568
|
)
|
|
@@ -665,7 +665,7 @@ const se = re({
|
|
|
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
|
}));
|
|
@@ -751,7 +751,7 @@ const ae = at({
|
|
|
751
751
|
swipeDirection: "x",
|
|
752
752
|
onSwipeStart: async () => !0,
|
|
753
753
|
onSwipe: (n, e, { animate: t, currentScreen: s, prevScreen: r, onProgress: a }) => {
|
|
754
|
-
const { offset: o } = e, c = o.x, h =
|
|
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
|
{
|
|
@@ -846,7 +846,7 @@ const ae = at({
|
|
|
846
846
|
swipeDirection: "y",
|
|
847
847
|
onSwipeStart: async () => !0,
|
|
848
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 =
|
|
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
850
|
return r?.(!0, 100), t(
|
|
851
851
|
s,
|
|
852
852
|
{
|
|
@@ -856,7 +856,7 @@ const ae = at({
|
|
|
856
856
|
{
|
|
857
857
|
duration: 0
|
|
858
858
|
}
|
|
859
|
-
),
|
|
859
|
+
), S;
|
|
860
860
|
},
|
|
861
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;
|
|
@@ -887,13 +887,11 @@ const ae = at({
|
|
|
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 ae = at({
|
|
|
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 ae = at({
|
|
|
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 ae = at({
|
|
|
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 ae = at({
|
|
|
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,
|
|
@@ -943,12 +937,11 @@ const ae = at({
|
|
|
943
937
|
swipeDirection: "y",
|
|
944
938
|
onSwipeStart: async () => !0,
|
|
945
939
|
onSwipe: (n, e, { animate: t, currentScreen: s, prevScreen: r, onProgress: a }) => {
|
|
946
|
-
const { offset: o } = e, c = o.y, h = Math.max(0, Math.min(56, c)), l =
|
|
947
|
-
return a?.(!0,
|
|
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(
|
|
948
942
|
s,
|
|
949
943
|
{
|
|
950
|
-
y:
|
|
951
|
-
opacity: l
|
|
944
|
+
y: u
|
|
952
945
|
},
|
|
953
946
|
{
|
|
954
947
|
duration: 0
|
|
@@ -956,11 +949,10 @@ const ae = at({
|
|
|
956
949
|
), t(
|
|
957
950
|
r,
|
|
958
951
|
{
|
|
959
|
-
y: -56 +
|
|
960
|
-
opacity: I / 56
|
|
952
|
+
y: -56 + S
|
|
961
953
|
},
|
|
962
954
|
{ duration: 0 }
|
|
963
|
-
),
|
|
955
|
+
), S;
|
|
964
956
|
},
|
|
965
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;
|
|
@@ -968,8 +960,7 @@ const ae = at({
|
|
|
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,
|
|
@@ -979,8 +970,7 @@ const ae = at({
|
|
|
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,
|
|
@@ -1044,7 +1034,7 @@ function we({
|
|
|
1044
1034
|
transitions: s = [],
|
|
1045
1035
|
decorators: r = []
|
|
1046
1036
|
}) {
|
|
1047
|
-
const a =
|
|
1037
|
+
const a = St() ? e || "/" : window.location.pathname, o = St() ? a.split("?")[1] || "" : window.location.search;
|
|
1048
1038
|
return ft.setState({
|
|
1049
1039
|
defaultTransitionName: t
|
|
1050
1040
|
}), X.setState({
|
|
@@ -1054,7 +1044,7 @@ function we({
|
|
|
1054
1044
|
id: "root",
|
|
1055
1045
|
pathname: a,
|
|
1056
1046
|
params: Xt(
|
|
1057
|
-
|
|
1047
|
+
Dt.toArray(n).map((c) => c.props.path).flat(),
|
|
1058
1048
|
a,
|
|
1059
1049
|
o
|
|
1060
1050
|
),
|
|
@@ -1078,7 +1068,7 @@ function we({
|
|
|
1078
1068
|
}, [t]), B(() => {
|
|
1079
1069
|
s.forEach((c) => et.set(c.name, c));
|
|
1080
1070
|
}, [s]), B(() => {
|
|
1081
|
-
r.forEach((c) =>
|
|
1071
|
+
r.forEach((c) => mt.set(c.name, c));
|
|
1082
1072
|
}, [r]), /* @__PURE__ */ pt(
|
|
1083
1073
|
"div",
|
|
1084
1074
|
{
|
|
@@ -1105,18 +1095,18 @@ function Se() {
|
|
|
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 } = X.getState(), m = ft.getState().defaultTransitionName, { transitionName: d = m, layoutId: u = null } = a,
|
|
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
|
|
1102
|
+
const k = W.compile(s), x = Object.fromEntries(
|
|
1113
1103
|
Object.entries(r).map(([A, b]) => [A, String(b)])
|
|
1114
|
-
), E =
|
|
1115
|
-
Object.entries(r).filter(([A]) => !
|
|
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))
|
|
1116
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
1112
|
params: r,
|
|
@@ -1126,7 +1116,7 @@ function Se() {
|
|
|
1126
1116
|
"",
|
|
1127
1117
|
H
|
|
1128
1118
|
), l({
|
|
1129
|
-
id:
|
|
1119
|
+
id: S,
|
|
1130
1120
|
pathname: E,
|
|
1131
1121
|
params: r,
|
|
1132
1122
|
transitionName: d,
|
|
@@ -1136,7 +1126,7 @@ function Se() {
|
|
|
1136
1126
|
};
|
|
1137
1127
|
},
|
|
1138
1128
|
{
|
|
1139
|
-
id:
|
|
1129
|
+
id: S,
|
|
1140
1130
|
control: {
|
|
1141
1131
|
manual: !0
|
|
1142
1132
|
}
|
|
@@ -1147,38 +1137,38 @@ function Se() {
|
|
|
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 } = X.getState(), m = X.getState().replaceHistory, d = ft.getState().defaultTransitionName, { transitionName: u = d, layoutId:
|
|
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
|
|
1144
|
+
const x = W.compile(s), E = Object.fromEntries(
|
|
1155
1145
|
Object.entries(r).map(([b, i]) => [b, String(i)])
|
|
1156
|
-
),
|
|
1146
|
+
), N = x(E), F = W.parse(s).tokens.filter((b) => b.type === "param").map((b) => b.name), Q = Object.fromEntries(
|
|
1157
1147
|
Object.entries(r).filter(([b]) => !F.includes(b))
|
|
1158
|
-
), H = new URLSearchParams(Q).toString(), A = `${
|
|
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
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:
|
|
1161
|
+
id: k,
|
|
1162
|
+
pathname: N,
|
|
1173
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
|
}
|
|
@@ -1192,7 +1182,7 @@ function Se() {
|
|
|
1192
1182
|
};
|
|
1193
1183
|
}
|
|
1194
1184
|
function Pe() {
|
|
1195
|
-
const n =
|
|
1185
|
+
const n = yt(Mt);
|
|
1196
1186
|
return {
|
|
1197
1187
|
pushStep: async (r) => {
|
|
1198
1188
|
const a = j.getState().status;
|
|
@@ -1238,7 +1228,7 @@ function Pe() {
|
|
|
1238
1228
|
};
|
|
1239
1229
|
}
|
|
1240
1230
|
function Te() {
|
|
1241
|
-
return
|
|
1231
|
+
return yt(kt);
|
|
1242
1232
|
}
|
|
1243
1233
|
function ve({
|
|
1244
1234
|
name: n,
|
|
@@ -1317,7 +1307,7 @@ function de({
|
|
|
1317
1307
|
function bt({ freeze: n, children: e, placeholder: t }) {
|
|
1318
1308
|
return /* @__PURE__ */ L(Ft, { fallback: t, children: /* @__PURE__ */ L(de, { freeze: n, children: e }) });
|
|
1319
1309
|
}
|
|
1320
|
-
function
|
|
1310
|
+
function vt(n, e) {
|
|
1321
1311
|
const {
|
|
1322
1312
|
direction: t = "x",
|
|
1323
1313
|
markerSelector: s = "[data-swipe-at-edge]",
|
|
@@ -1326,11 +1316,11 @@ function Lt(n, e) {
|
|
|
1326
1316
|
} = e ?? {}, o = pe(n);
|
|
1327
1317
|
if (!o) return { element: null, hasMarker: !1 };
|
|
1328
1318
|
const c = o.closest?.(s);
|
|
1329
|
-
if (c instanceof HTMLElement && ht(c, t) && (!a ||
|
|
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
1322
|
for (; h && h !== document.body && l < r; ) {
|
|
1333
|
-
if (ht(h, t) && (!a ||
|
|
1323
|
+
if (ht(h, t) && (!a || Lt(h, t)))
|
|
1334
1324
|
return { element: h, hasMarker: !1 };
|
|
1335
1325
|
h = h.parentElement, l++;
|
|
1336
1326
|
}
|
|
@@ -1348,7 +1338,7 @@ function pe(n) {
|
|
|
1348
1338
|
function ht(n, e) {
|
|
1349
1339
|
return e === "y" ? n.scrollHeight - n.clientHeight > 1 : n.scrollWidth - n.clientWidth > 1;
|
|
1350
1340
|
}
|
|
1351
|
-
function
|
|
1341
|
+
function Lt(n, e) {
|
|
1352
1342
|
if (!ht(n, e)) return !1;
|
|
1353
1343
|
if (e === "y") {
|
|
1354
1344
|
const t = n.scrollTop;
|
|
@@ -1369,11 +1359,11 @@ function Dt(n, e) {
|
|
|
1369
1359
|
function fe({ children: n, ref: e, ...t }) {
|
|
1370
1360
|
const { isActive: s, transitionName: r } = Z(), [a, o] = xt();
|
|
1371
1361
|
Qt(e, () => a.current);
|
|
1372
|
-
const c = j((u) => u.status), h = et.get(r), { decoratorName: l } = h, { initial: m, variants: d } =
|
|
1362
|
+
const c = j((u) => u.status), h = et.get(r), { decoratorName: l } = h, { initial: m, variants: d } = mt.get(l);
|
|
1373
1363
|
return B(() => {
|
|
1374
1364
|
if (!a.current) return;
|
|
1375
|
-
const { value: u, options:
|
|
1376
|
-
o(a.current, u,
|
|
1365
|
+
const { value: u, options: S } = d[`${c}-${s}`];
|
|
1366
|
+
o(a.current, u, S);
|
|
1377
1367
|
}, [c, s, o, d, a]), /* @__PURE__ */ L(
|
|
1378
1368
|
Nt.div,
|
|
1379
1369
|
{
|
|
@@ -1425,19 +1415,19 @@ function Rt({
|
|
|
1425
1415
|
hideSystemNavigationBar: h,
|
|
1426
1416
|
...l
|
|
1427
1417
|
}) {
|
|
1428
|
-
const [m, d] = xt(), { id: u, isActive:
|
|
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({
|
|
1429
1419
|
element: null,
|
|
1430
1420
|
hasMarker: !1
|
|
1431
|
-
}), K = U({ element: null, hasMarker: !1 }), ot = U(0), it = U(0), ct = U(null), ut = U(null), At = async (
|
|
1432
|
-
if (!
|
|
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)
|
|
1433
1423
|
return;
|
|
1434
1424
|
const R = M.current?.previousSibling;
|
|
1435
|
-
|
|
1436
|
-
const Y = await b?.onSwipeStart(
|
|
1425
|
+
I.current = R?.querySelector("[data-screen]"), $.current = R?.querySelector("[data-decorator]");
|
|
1426
|
+
const Y = await b?.onSwipeStart(T, G, {
|
|
1437
1427
|
animate: d,
|
|
1438
1428
|
currentScreen: m.current,
|
|
1439
|
-
prevScreen:
|
|
1440
|
-
dragControls:
|
|
1429
|
+
prevScreen: I.current,
|
|
1430
|
+
dragControls: N,
|
|
1441
1431
|
onStart: (lt) => f?.onSwipeStart?.(lt, {
|
|
1442
1432
|
animate: d,
|
|
1443
1433
|
currentDecorator: C.current,
|
|
@@ -1445,89 +1435,89 @@ function Rt({
|
|
|
1445
1435
|
})
|
|
1446
1436
|
});
|
|
1447
1437
|
H(Y ? "PENDING" : "IDLE");
|
|
1448
|
-
}, Ot = (
|
|
1449
|
-
!
|
|
1438
|
+
}, Ot = (T, G) => {
|
|
1439
|
+
!g || Q !== "PENDING" || p > 10 || b?.onSwipe(T, G, {
|
|
1450
1440
|
animate: d,
|
|
1451
1441
|
currentScreen: m.current,
|
|
1452
|
-
prevScreen:
|
|
1453
|
-
dragControls:
|
|
1442
|
+
prevScreen: I.current,
|
|
1443
|
+
dragControls: N,
|
|
1454
1444
|
onProgress: (R, Y) => f?.onSwipe?.(R, Y, {
|
|
1455
1445
|
animate: d,
|
|
1456
1446
|
currentDecorator: C.current,
|
|
1457
1447
|
prevDecorator: $.current
|
|
1458
1448
|
})
|
|
1459
1449
|
});
|
|
1460
|
-
}, Gt = async (
|
|
1461
|
-
if (!
|
|
1450
|
+
}, Gt = async (T, G) => {
|
|
1451
|
+
if (!g || Q !== "PENDING" || p > 10)
|
|
1462
1452
|
return;
|
|
1463
|
-
await b?.onSwipeEnd(
|
|
1453
|
+
await b?.onSwipeEnd(T, G, {
|
|
1464
1454
|
animate: d,
|
|
1465
1455
|
currentScreen: m.current,
|
|
1466
|
-
prevScreen:
|
|
1456
|
+
prevScreen: I.current,
|
|
1467
1457
|
onStart: (Y) => f?.onSwipeEnd?.(Y, {
|
|
1468
1458
|
animate: d,
|
|
1469
1459
|
currentDecorator: C.current,
|
|
1470
1460
|
prevDecorator: $.current
|
|
1471
1461
|
})
|
|
1472
1462
|
}) ? window.history.back() : H("IDLE");
|
|
1473
|
-
}, $t = (
|
|
1474
|
-
if (!(!
|
|
1463
|
+
}, $t = (T) => {
|
|
1464
|
+
if (!(!k && S && F === "COMPLETED" && Q === "IDLE" && !!g && p < 10))
|
|
1475
1465
|
return;
|
|
1476
|
-
z.current =
|
|
1466
|
+
z.current = vt(T.target, {
|
|
1477
1467
|
direction: "x",
|
|
1478
1468
|
verifyByScroll: !0
|
|
1479
|
-
}), K.current =
|
|
1469
|
+
}), K.current = vt(T.target, {
|
|
1480
1470
|
direction: "y",
|
|
1481
1471
|
verifyByScroll: !0
|
|
1482
|
-
}), ot.current =
|
|
1483
|
-
}, Ht = (
|
|
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) => {
|
|
1484
1474
|
if (p > 10)
|
|
1485
1475
|
return;
|
|
1486
1476
|
const G = !z.current.element && !K.current.element;
|
|
1487
1477
|
if (V.current && G) {
|
|
1488
1478
|
V.current = !1, tt.current = !0;
|
|
1489
|
-
const R =
|
|
1490
|
-
(
|
|
1479
|
+
const R = T.clientY - it.current, Y = T.clientX - ot.current;
|
|
1480
|
+
(g === "y" && R > 0 || g === "x" && Y > 0) && N.start(T);
|
|
1491
1481
|
} else if (V.current && !G) {
|
|
1492
|
-
const R =
|
|
1493
|
-
(
|
|
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));
|
|
1494
1484
|
}
|
|
1495
1485
|
}, Ut = () => {
|
|
1496
1486
|
V.current = !1, tt.current = !1;
|
|
1497
1487
|
};
|
|
1498
1488
|
return B(() => {
|
|
1499
|
-
const
|
|
1500
|
-
if (!
|
|
1489
|
+
const T = m.current;
|
|
1490
|
+
if (!T) return;
|
|
1501
1491
|
const G = (R) => {
|
|
1502
1492
|
tt.current && R.preventDefault(), R.target?.dataset.swipeAtEdgeBar === "true" && R.preventDefault();
|
|
1503
1493
|
};
|
|
1504
|
-
return
|
|
1494
|
+
return T.addEventListener("touchmove", G, {
|
|
1505
1495
|
passive: !1
|
|
1506
1496
|
}), () => {
|
|
1507
|
-
|
|
1497
|
+
T.removeEventListener("touchmove", G);
|
|
1508
1498
|
};
|
|
1509
1499
|
}, [m]), B(() => {
|
|
1510
1500
|
m.current && (async () => {
|
|
1511
|
-
const { value:
|
|
1512
|
-
!
|
|
1501
|
+
const { value: T, options: G } = i[`${F}-${S}`];
|
|
1502
|
+
!S && F === "REPLACING" && E !== x && (A("PENDING"), await d(m.current, ue, {
|
|
1513
1503
|
duration: 0.1
|
|
1514
|
-
})),
|
|
1504
|
+
})), S && F === "COMPLETED" && (H("IDLE"), A("IDLE")), await d(m.current, T, G), await q.resolveTask(u);
|
|
1515
1505
|
})();
|
|
1516
1506
|
}, [
|
|
1517
1507
|
F,
|
|
1518
|
-
|
|
1508
|
+
S,
|
|
1519
1509
|
u,
|
|
1520
1510
|
E,
|
|
1521
|
-
|
|
1511
|
+
x,
|
|
1522
1512
|
d,
|
|
1523
1513
|
m,
|
|
1524
1514
|
i,
|
|
1525
1515
|
H,
|
|
1526
1516
|
A
|
|
1527
|
-
]),
|
|
1517
|
+
]), wt(() => {
|
|
1528
1518
|
ct.current && v(ct.current.offsetHeight);
|
|
1529
|
-
}, [a]),
|
|
1530
|
-
ut.current &&
|
|
1519
|
+
}, [a]), wt(() => {
|
|
1520
|
+
ut.current && P(ut.current.offsetHeight);
|
|
1531
1521
|
}, [o]), /* @__PURE__ */ pt(
|
|
1532
1522
|
"div",
|
|
1533
1523
|
{
|
|
@@ -1578,10 +1568,10 @@ function Rt({
|
|
|
1578
1568
|
{
|
|
1579
1569
|
ref: m,
|
|
1580
1570
|
...l,
|
|
1581
|
-
initial:
|
|
1582
|
-
drag:
|
|
1571
|
+
initial: y,
|
|
1572
|
+
drag: g,
|
|
1583
1573
|
dragListener: !1,
|
|
1584
|
-
dragControls:
|
|
1574
|
+
dragControls: N,
|
|
1585
1575
|
onDragStart: At,
|
|
1586
1576
|
onDrag: Ot,
|
|
1587
1577
|
onDragEnd: Gt,
|