@flemo/react 1.0.1 → 1.0.3

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.
Files changed (3) hide show
  1. package/README.md +2 -2
  2. package/dist/index.mjs +590 -583
  3. package/package.json +7 -5
package/dist/index.mjs CHANGED
@@ -1,34 +1,34 @@
1
- import { jsx as L, jsxs as Ot, Fragment as de } from "react/jsx-runtime";
2
- import xt, { useEffect as ut, createContext as Vt, useContext as Yt, useReducer as pe, Children as Zt, useInsertionEffect as fe, useRef as $, useImperativeHandle as me, useState as bt, useLayoutEffect as mt } from "react";
3
- import { consumeSelfInducedPop as ye, TaskManger as U, useNavigateStore as q, useHistoryStore as O, getMatchedPathPattern as he, transitionMap as ot, decoratorMap as yt, isServer as Mt, compileTransitionStyles as ge, useTransitionStore as Gt, getParams as we, markSelfInducedPop as te, targetToDecls as Se, easingToCss as ve, variantHasAnimation as Ee, animationName as Te, collectAnimatedProperties as Pe, findScrollable as qt } from "@flemo/core";
4
- import { createDecorator as Qe, createRawDecorator as Ze, createRawTransition as tn, createTransition as en } from "@flemo/core";
5
- function xe() {
6
- return ut(() => {
1
+ import { jsx as N, jsxs as Ht, Fragment as fe } from "react/jsx-runtime";
2
+ import Pt, { useEffect as dt, createContext as Gt, useContext as Yt, useReducer as me, Children as te, useInsertionEffect as ye, useRef as L, useImperativeHandle as he, useState as bt, useLayoutEffect as xt } from "react";
3
+ import { consumeSelfInducedPop as ge, TaskManger as G, useNavigateStore as W, useHistoryStore as O, getMatchedPathPattern as we, transitionMap as ct, decoratorMap as yt, isServer as Mt, compileTransitionStyles as Se, useTransitionStore as Ot, getParams as ve, markSelfInducedPop as ee, targetToDecls as Te, easingToCss as Ee, variantHasAnimation as Pe, animationName as xe, findScrollable as qt, collectAnimatedProperties as be } from "@flemo/core";
4
+ import { createDecorator as tn, createRawDecorator as en, createRawTransition as nn, createTransition as rn } from "@flemo/core";
5
+ function Ie() {
6
+ return dt(() => {
7
7
  const n = async (e) => {
8
- if (ye())
8
+ if (ge())
9
9
  return;
10
- const o = e.state?.id, a = U.generateTaskId();
11
- (await U.addTask(
10
+ const r = e.state?.id, a = G.generateTaskId();
11
+ (await G.addTask(
12
12
  async (u) => {
13
- const i = e.state?.index, s = e.state?.status, E = e.state?.params, T = e.state?.transitionName, m = e.state?.layoutId, { setStatus: x, setTransitionTaskId: h } = q.getState(), { index: R, addHistory: N, popHistory: A } = O.getState(), b = i < R, F = s === "PUSHING" && i > R, H = s === "REPLACING" && i > R, V = window.location.pathname;
14
- if (!b && !F && !H) {
13
+ const i = e.state?.index, s = e.state?.status, T = e.state?.params, E = e.state?.transitionName, m = e.state?.layoutId, { setStatus: x, setTransitionTaskId: h } = W.getState(), { index: R, addHistory: $, popHistory: C } = O.getState(), D = i < R, q = s === "PUSHING" && i > R, M = s === "REPLACING" && i > R, Y = window.location.pathname;
14
+ if (!D && !q && !M) {
15
15
  u.abort();
16
16
  return;
17
17
  }
18
- return h(a), b ? x("POPPING") : F ? (x("PUSHING"), N({
19
- id: o,
20
- pathname: V,
21
- params: E,
22
- transitionName: T,
18
+ return h(a), D ? x("POPPING") : q ? (x("PUSHING"), $({
19
+ id: r,
20
+ pathname: Y,
21
+ params: T,
22
+ transitionName: E,
23
23
  layoutId: m
24
- })) : H && (x("REPLACING"), N({
25
- id: o,
26
- pathname: V,
27
- params: E,
28
- transitionName: T,
24
+ })) : M && (x("REPLACING"), $({
25
+ id: r,
26
+ pathname: Y,
27
+ params: T,
28
+ transitionName: E,
29
29
  layoutId: m
30
30
  })), async () => {
31
- b && A(i + 1), x("COMPLETED");
31
+ D && C(i + 1), x("COMPLETED");
32
32
  };
33
33
  },
34
34
  {
@@ -44,267 +44,267 @@ function xe() {
44
44
  };
45
45
  }, []), null;
46
46
  }
47
- var _ = {}, zt;
48
- function Ie() {
49
- if (zt) return _;
50
- zt = 1, Object.defineProperty(_, "__esModule", { value: !0 }), _.PathError = _.TokenData = void 0, _.parse = m, _.compile = x, _.match = N, _.pathToRegexp = A, _.stringify = gt;
51
- const n = "/", e = (r) => r, o = /^[$_\p{ID_Start}]$/u, a = /^[$\u200c\u200d\p{ID_Continue}]$/u, u = /^[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*$/u;
52
- function i(r) {
53
- return r.replace(/[{}()\[\]+?!:*\\]/g, "\\$&");
47
+ var j = {}, zt;
48
+ function Re() {
49
+ if (zt) return j;
50
+ zt = 1, Object.defineProperty(j, "__esModule", { value: !0 }), j.PathError = j.TokenData = void 0, j.parse = m, j.compile = x, j.match = $, j.pathToRegexp = C, j.stringify = gt;
51
+ const n = "/", e = (o) => o, r = /^[$_\p{ID_Start}]$/u, a = /^[$\u200c\u200d\p{ID_Continue}]$/u, u = /^[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*$/u;
52
+ function i(o) {
53
+ return o.replace(/[{}()\[\]+?!:*\\]/g, "\\$&");
54
54
  }
55
- function s(r) {
56
- return r.replace(/[.+*?^${}()[\]|/\\]/g, "\\$&");
55
+ function s(o) {
56
+ return o.replace(/[.+*?^${}()[\]|/\\]/g, "\\$&");
57
57
  }
58
- class E {
58
+ class T {
59
59
  constructor(c, y) {
60
60
  this.tokens = c, this.originalPath = y;
61
61
  }
62
62
  }
63
- _.TokenData = E;
64
- class T extends TypeError {
63
+ j.TokenData = T;
64
+ class E extends TypeError {
65
65
  constructor(c, y) {
66
- let d = c;
67
- y && (d += `: ${y}`), d += "; visit https://git.new/pathToRegexpError for info", super(d), this.originalPath = y;
66
+ let p = c;
67
+ y && (p += `: ${y}`), p += "; visit https://git.new/pathToRegexpError for info", super(p), this.originalPath = y;
68
68
  }
69
69
  }
70
- _.PathError = T;
71
- function m(r, c = {}) {
72
- const { encodePath: y = e } = c, d = [...r];
70
+ j.PathError = E;
71
+ function m(o, c = {}) {
72
+ const { encodePath: y = e } = c, p = [...o];
73
73
  let l = 0;
74
- function w(f) {
74
+ function g(d) {
75
75
  const P = [];
76
- let S = "";
77
- function D() {
78
- S && (P.push({
76
+ let w = "";
77
+ function I() {
78
+ w && (P.push({
79
79
  type: "text",
80
- value: y(S)
81
- }), S = "");
80
+ value: y(w)
81
+ }), w = "");
82
82
  }
83
- for (; l < d.length; ) {
84
- const I = d[l++];
85
- if (I === f)
86
- return D(), P;
87
- if (I === "\\") {
88
- if (l === d.length)
89
- throw new T(`Unexpected end after \\ at index ${l}`, r);
90
- S += d[l++];
83
+ for (; l < p.length; ) {
84
+ const b = p[l++];
85
+ if (b === d)
86
+ return I(), P;
87
+ if (b === "\\") {
88
+ if (l === p.length)
89
+ throw new E(`Unexpected end after \\ at index ${l}`, o);
90
+ w += p[l++];
91
91
  continue;
92
92
  }
93
- if (I === ":" || I === "*") {
94
- const G = I === ":" ? "param" : "wildcard";
95
- let v = "";
96
- if (o.test(d[l]))
93
+ if (b === ":" || b === "*") {
94
+ const U = b === ":" ? "param" : "wildcard";
95
+ let S = "";
96
+ if (r.test(p[l]))
97
97
  do
98
- v += d[l++];
99
- while (a.test(d[l]));
100
- else if (d[l] === '"') {
101
- let k = l;
102
- for (; l < d.length; ) {
103
- if (d[++l] === '"') {
104
- l++, k = 0;
98
+ S += p[l++];
99
+ while (a.test(p[l]));
100
+ else if (p[l] === '"') {
101
+ let H = l;
102
+ for (; l < p.length; ) {
103
+ if (p[++l] === '"') {
104
+ l++, H = 0;
105
105
  break;
106
106
  }
107
- d[l] === "\\" && l++, v += d[l];
107
+ p[l] === "\\" && l++, S += p[l];
108
108
  }
109
- if (k)
110
- throw new T(`Unterminated quote at index ${k}`, r);
109
+ if (H)
110
+ throw new E(`Unterminated quote at index ${H}`, o);
111
111
  }
112
- if (!v)
113
- throw new T(`Missing parameter name at index ${l}`, r);
114
- D(), P.push({ type: G, name: v });
112
+ if (!S)
113
+ throw new E(`Missing parameter name at index ${l}`, o);
114
+ I(), P.push({ type: U, name: S });
115
115
  continue;
116
116
  }
117
- if (I === "{") {
118
- D(), P.push({
117
+ if (b === "{") {
118
+ I(), P.push({
119
119
  type: "group",
120
- tokens: w("}")
120
+ tokens: g("}")
121
121
  });
122
122
  continue;
123
123
  }
124
- if (I === "}" || I === "(" || I === ")" || I === "[" || I === "]" || I === "+" || I === "?" || I === "!")
125
- throw new T(`Unexpected ${I} at index ${l - 1}`, r);
126
- S += I;
124
+ if (b === "}" || b === "(" || b === ")" || b === "[" || b === "]" || b === "+" || b === "?" || b === "!")
125
+ throw new E(`Unexpected ${b} at index ${l - 1}`, o);
126
+ w += b;
127
127
  }
128
- if (f)
129
- throw new T(`Unexpected end at index ${l}, expected ${f}`, r);
130
- return D(), P;
128
+ if (d)
129
+ throw new E(`Unexpected end at index ${l}, expected ${d}`, o);
130
+ return I(), P;
131
131
  }
132
- return new E(w(""), r);
132
+ return new T(g(""), o);
133
133
  }
134
- function x(r, c = {}) {
135
- const { encode: y = encodeURIComponent, delimiter: d = n } = c, l = typeof r == "object" ? r : m(r, c), w = h(l.tokens, d, y);
134
+ function x(o, c = {}) {
135
+ const { encode: y = encodeURIComponent, delimiter: p = n } = c, l = typeof o == "object" ? o : m(o, c), g = h(l.tokens, p, y);
136
136
  return function(P = {}) {
137
- const S = [], D = w(P, S);
138
- if (S.length)
139
- throw new TypeError(`Missing parameters: ${S.join(", ")}`);
140
- return D;
137
+ const w = [], I = g(P, w);
138
+ if (w.length)
139
+ throw new TypeError(`Missing parameters: ${w.join(", ")}`);
140
+ return I;
141
141
  };
142
142
  }
143
- function h(r, c, y) {
144
- const d = r.map((l) => R(l, c, y));
145
- return (l, w) => {
146
- let f = "";
147
- for (const P of d)
148
- f += P(l, w);
149
- return f;
143
+ function h(o, c, y) {
144
+ const p = o.map((l) => R(l, c, y));
145
+ return (l, g) => {
146
+ let d = "";
147
+ for (const P of p)
148
+ d += P(l, g);
149
+ return d;
150
150
  };
151
151
  }
152
- function R(r, c, y) {
153
- if (r.type === "text")
154
- return () => r.value;
155
- if (r.type === "group") {
156
- const l = h(r.tokens, c, y);
157
- return (w, f) => {
158
- const P = f.length, S = l(w, f);
159
- return f.length === P ? S : (f.length = P, "");
152
+ function R(o, c, y) {
153
+ if (o.type === "text")
154
+ return () => o.value;
155
+ if (o.type === "group") {
156
+ const l = h(o.tokens, c, y);
157
+ return (g, d) => {
158
+ const P = d.length, w = l(g, d);
159
+ return d.length === P ? w : (d.length = P, "");
160
160
  };
161
161
  }
162
- const d = y || e;
163
- return r.type === "wildcard" && y !== !1 ? (l, w) => {
164
- const f = l[r.name];
165
- if (f == null)
166
- return w.push(r.name), "";
167
- if (!Array.isArray(f) || f.length === 0)
168
- throw new TypeError(`Expected "${r.name}" to be a non-empty array`);
162
+ const p = y || e;
163
+ return o.type === "wildcard" && y !== !1 ? (l, g) => {
164
+ const d = l[o.name];
165
+ if (d == null)
166
+ return g.push(o.name), "";
167
+ if (!Array.isArray(d) || d.length === 0)
168
+ throw new TypeError(`Expected "${o.name}" to be a non-empty array`);
169
169
  let P = "";
170
- for (let S = 0; S < f.length; S++) {
171
- if (typeof f[S] != "string")
172
- throw new TypeError(`Expected "${r.name}/${S}" to be a string`);
173
- S > 0 && (P += c), P += d(f[S]);
170
+ for (let w = 0; w < d.length; w++) {
171
+ if (typeof d[w] != "string")
172
+ throw new TypeError(`Expected "${o.name}/${w}" to be a string`);
173
+ w > 0 && (P += c), P += p(d[w]);
174
174
  }
175
175
  return P;
176
- } : (l, w) => {
177
- const f = l[r.name];
178
- if (f == null)
179
- return w.push(r.name), "";
180
- if (typeof f != "string")
181
- throw new TypeError(`Expected "${r.name}" to be a string`);
182
- return d(f);
176
+ } : (l, g) => {
177
+ const d = l[o.name];
178
+ if (d == null)
179
+ return g.push(o.name), "";
180
+ if (typeof d != "string")
181
+ throw new TypeError(`Expected "${o.name}" to be a string`);
182
+ return p(d);
183
183
  };
184
184
  }
185
- function N(r, c = {}) {
186
- const { decode: y = decodeURIComponent, delimiter: d = n } = c, { regexp: l, keys: w } = A(r, c), f = w.map((P) => y === !1 ? e : P.type === "param" ? y : (S) => S.split(d).map(y));
187
- return function(S) {
188
- const D = l.exec(S);
189
- if (!D)
185
+ function $(o, c = {}) {
186
+ const { decode: y = decodeURIComponent, delimiter: p = n } = c, { regexp: l, keys: g } = C(o, c), d = g.map((P) => y === !1 ? e : P.type === "param" ? y : (w) => w.split(p).map(y));
187
+ return function(w) {
188
+ const I = l.exec(w);
189
+ if (!I)
190
190
  return !1;
191
- const I = D[0], G = /* @__PURE__ */ Object.create(null);
192
- for (let v = 1; v < D.length; v++) {
193
- if (D[v] === void 0)
191
+ const b = I[0], U = /* @__PURE__ */ Object.create(null);
192
+ for (let S = 1; S < I.length; S++) {
193
+ if (I[S] === void 0)
194
194
  continue;
195
- const k = w[v - 1], Y = f[v - 1];
196
- G[k.name] = Y(D[v]);
195
+ const H = g[S - 1], _ = d[S - 1];
196
+ U[H.name] = _(I[S]);
197
197
  }
198
- return { path: I, params: G };
198
+ return { path: b, params: U };
199
199
  };
200
200
  }
201
- function A(r, c = {}) {
202
- const { delimiter: y = n, end: d = !0, sensitive: l = !1, trailing: w = !0 } = c, f = [];
203
- let P = "", S = 0;
204
- function D(G) {
205
- if (Array.isArray(G)) {
206
- for (const k of G)
207
- D(k);
201
+ function C(o, c = {}) {
202
+ const { delimiter: y = n, end: p = !0, sensitive: l = !1, trailing: g = !0 } = c, d = [];
203
+ let P = "", w = 0;
204
+ function I(U) {
205
+ if (Array.isArray(U)) {
206
+ for (const H of U)
207
+ I(H);
208
208
  return;
209
209
  }
210
- const v = typeof G == "object" ? G : m(G, c);
211
- b(v.tokens, 0, [], (k) => {
212
- if (S >= 256)
213
- throw new T("Too many path combinations", v.originalPath);
214
- S > 0 && (P += "|"), P += F(k, y, f, v.originalPath), S++;
210
+ const S = typeof U == "object" ? U : m(U, c);
211
+ D(S.tokens, 0, [], (H) => {
212
+ if (w >= 256)
213
+ throw new E("Too many path combinations", S.originalPath);
214
+ w > 0 && (P += "|"), P += q(H, y, d, S.originalPath), w++;
215
215
  });
216
216
  }
217
- D(r);
218
- let I = `^(?:${P})`;
219
- return w && (I += "(?:" + s(y) + "$)?"), I += d ? "$" : "(?=" + s(y) + "|$)", { regexp: new RegExp(I, l ? "" : "i"), keys: f };
217
+ I(o);
218
+ let b = `^(?:${P})`;
219
+ return g && (b += "(?:" + s(y) + "$)?"), b += p ? "$" : "(?=" + s(y) + "|$)", { regexp: new RegExp(b, l ? "" : "i"), keys: d };
220
220
  }
221
- function b(r, c, y, d) {
222
- for (; c < r.length; ) {
223
- const l = r[c++];
221
+ function D(o, c, y, p) {
222
+ for (; c < o.length; ) {
223
+ const l = o[c++];
224
224
  if (l.type === "group") {
225
- const w = y.length;
226
- b(l.tokens, 0, y, (f) => b(r, c, f, d)), y.length = w;
225
+ const g = y.length;
226
+ D(l.tokens, 0, y, (d) => D(o, c, d, p)), y.length = g;
227
227
  continue;
228
228
  }
229
229
  y.push(l);
230
230
  }
231
- d(y);
231
+ p(y);
232
232
  }
233
- function F(r, c, y, d) {
234
- let l = "", w = "", f = "", P = 0, S = 0, D = 0;
235
- function I(v, k) {
236
- for (; v < r.length; ) {
237
- const Y = r[v++];
238
- if (Y.type === k)
233
+ function q(o, c, y, p) {
234
+ let l = "", g = "", d = "", P = 0, w = 0, I = 0;
235
+ function b(S, H) {
236
+ for (; S < o.length; ) {
237
+ const _ = o[S++];
238
+ if (_.type === H)
239
239
  return !0;
240
- if (Y.type === "text" && Y.value.includes(c))
240
+ if (_.type === "text" && _.value.includes(c))
241
241
  break;
242
242
  }
243
243
  return !1;
244
244
  }
245
- function G(v) {
246
- let k = "";
247
- for (; v < r.length; ) {
248
- const Y = r[v++];
249
- if (Y.type !== "text")
245
+ function U(S) {
246
+ let H = "";
247
+ for (; S < o.length; ) {
248
+ const _ = o[S++];
249
+ if (_.type !== "text")
250
250
  break;
251
- k += Y.value;
251
+ H += _.value;
252
252
  }
253
- return k;
253
+ return H;
254
254
  }
255
- for (; D < r.length; ) {
256
- const v = r[D++];
257
- if (v.type === "text") {
258
- l += s(v.value), w += v.value, P === 2 && (f += v.value), v.value.includes(c) && (S = 0);
255
+ for (; I < o.length; ) {
256
+ const S = o[I++];
257
+ if (S.type === "text") {
258
+ l += s(S.value), g += S.value, P === 2 && (d += S.value), S.value.includes(c) && (w = 0);
259
259
  continue;
260
260
  }
261
- if (v.type === "param" || v.type === "wildcard") {
262
- if (P && !w)
263
- throw new T(`Missing text before "${v.name}" ${v.type}`, d);
264
- v.type === "param" ? (l += S & 2 ? `(${H(c, w)}+)` : I(D, "wildcard") ? `(${H(c, G(D))}+)` : S & 1 ? `(${H(c, w)}+|${s(w)})` : `(${H(c, "")}+)`, S |= P = 1) : (l += S & 2 ? `(${H(w, "")}+)` : f ? `(${H(f, "")}+|${H(c, "")}+)` : "([^]+)", f = "", S |= P = 2), y.push(v), w = "";
261
+ if (S.type === "param" || S.type === "wildcard") {
262
+ if (P && !g)
263
+ throw new E(`Missing text before "${S.name}" ${S.type}`, p);
264
+ S.type === "param" ? (l += w & 2 ? `(${M(c, g)}+)` : b(I, "wildcard") ? `(${M(c, U(I))}+)` : w & 1 ? `(${M(c, g)}+|${s(g)})` : `(${M(c, "")}+)`, w |= P = 1) : (l += w & 2 ? `(${M(g, "")}+)` : d ? `(${M(d, "")}+|${M(c, "")}+)` : "([^]+)", d = "", w |= P = 2), y.push(S), g = "";
265
265
  continue;
266
266
  }
267
- throw new TypeError(`Unknown token type: ${v.type}`);
267
+ throw new TypeError(`Unknown token type: ${S.type}`);
268
268
  }
269
269
  return l;
270
270
  }
271
- function H(r, c) {
272
- return c.length > r.length ? H(c, r) : (r === c && (c = ""), c.length > 1 ? `(?:(?!${s(r)}|${s(c)})[^])` : r.length > 1 ? `(?:(?!${s(r)})[^${s(c)}])` : `[^${s(r + c)}]`);
271
+ function M(o, c) {
272
+ return c.length > o.length ? M(c, o) : (o === c && (c = ""), c.length > 1 ? `(?:(?!${s(o)}|${s(c)})[^])` : o.length > 1 ? `(?:(?!${s(o)})[^${s(c)}])` : `[^${s(o + c)}]`);
273
273
  }
274
- function V(r, c) {
274
+ function Y(o, c) {
275
275
  let y = "";
276
- for (; c < r.length; ) {
277
- const d = r[c++];
278
- if (d.type === "text") {
279
- y += i(d.value);
276
+ for (; c < o.length; ) {
277
+ const p = o[c++];
278
+ if (p.type === "text") {
279
+ y += i(p.value);
280
280
  continue;
281
281
  }
282
- if (d.type === "group") {
283
- y += "{" + V(d.tokens, 0) + "}";
282
+ if (p.type === "group") {
283
+ y += "{" + Y(p.tokens, 0) + "}";
284
284
  continue;
285
285
  }
286
- if (d.type === "param") {
287
- y += ":" + M(d.name, r[c]);
286
+ if (p.type === "param") {
287
+ y += ":" + B(p.name, o[c]);
288
288
  continue;
289
289
  }
290
- if (d.type === "wildcard") {
291
- y += "*" + M(d.name, r[c]);
290
+ if (p.type === "wildcard") {
291
+ y += "*" + B(p.name, o[c]);
292
292
  continue;
293
293
  }
294
- throw new TypeError(`Unknown token type: ${d.type}`);
294
+ throw new TypeError(`Unknown token type: ${p.type}`);
295
295
  }
296
296
  return y;
297
297
  }
298
- function gt(r) {
299
- return V(r.tokens, 0);
298
+ function gt(o) {
299
+ return Y(o.tokens, 0);
300
300
  }
301
- function M(r, c) {
302
- return !u.test(r) || c?.type === "text" && a.test(c.value[0]) ? JSON.stringify(r) : r;
301
+ function B(o, c) {
302
+ return !u.test(o) || c?.type === "text" && a.test(c.value[0]) ? JSON.stringify(o) : o;
303
303
  }
304
- return _;
304
+ return j;
305
305
  }
306
- var Ut = Ie();
307
- const ee = Vt({
306
+ var Bt = Re();
307
+ const ne = Gt({
308
308
  id: "",
309
309
  isActive: !1,
310
310
  isRoot: !0,
@@ -318,161 +318,161 @@ const ee = Vt({
318
318
  routePath: ""
319
319
  });
320
320
  function ht() {
321
- return Yt(ee);
321
+ return Yt(ne);
322
322
  }
323
- const ne = Vt({}), re = Vt(() => {
323
+ const re = Gt({}), oe = Gt(() => {
324
324
  });
325
- function be(n, e) {
325
+ function De(n, e) {
326
326
  return e.type === "SET" ? e.params : n;
327
327
  }
328
- function De({ children: n }) {
329
- const { isActive: e, params: o } = ht(), [a, u] = pe(be, o);
330
- return ut(() => {
328
+ function Le({ children: n }) {
329
+ const { isActive: e, params: r } = ht(), [a, u] = me(De, r);
330
+ return dt(() => {
331
331
  const i = async (s) => {
332
- s.state?.step && await U.addTask(async () => {
332
+ s.state?.step && await G.addTask(async () => {
333
333
  u({ type: "SET", params: s.state?.params || {} });
334
334
  });
335
335
  };
336
336
  return e && window.addEventListener("popstate", i), () => {
337
337
  window.removeEventListener("popstate", i);
338
338
  };
339
- }, [e, u]), /* @__PURE__ */ L(re.Provider, { value: u, children: /* @__PURE__ */ L(ne.Provider, { value: a, children: n }) });
339
+ }, [e, u]), /* @__PURE__ */ N(oe.Provider, { value: u, children: /* @__PURE__ */ N(re.Provider, { value: a, children: n }) });
340
340
  }
341
- function Re({ children: n }) {
342
- const e = O((a) => a.index), o = O((a) => a.histories);
343
- return o.map(
344
- (a) => Zt.toArray(n).filter(
345
- (u) => Ut.pathToRegexp(u.props.path).regexp.test(
341
+ function Ne({ children: n }) {
342
+ const e = O((a) => a.index), r = O((a) => a.histories);
343
+ return r.map(
344
+ (a) => te.toArray(n).filter(
345
+ (u) => Bt.pathToRegexp(u.props.path).regexp.test(
346
346
  a.pathname
347
347
  )
348
348
  )
349
- ).map(([a], u) => /* @__PURE__ */ L(
350
- ee.Provider,
349
+ ).map(([a], u) => /* @__PURE__ */ N(
350
+ ne.Provider,
351
351
  {
352
352
  value: {
353
- id: o[u].id,
353
+ id: r[u].id,
354
354
  isActive: u === e,
355
355
  isRoot: u === 0,
356
356
  isPrev: u < e - 1,
357
357
  zIndex: u,
358
- pathname: o[u].pathname,
359
- params: o[u].params,
360
- transitionName: o[e].transitionName,
361
- prevTransitionName: o[e - 1]?.transitionName,
362
- layoutId: o[u].layoutId,
363
- routePath: he(
358
+ pathname: r[u].pathname,
359
+ params: r[u].params,
360
+ transitionName: r[e].transitionName,
361
+ prevTransitionName: r[e - 1]?.transitionName,
362
+ layoutId: r[u].layoutId,
363
+ routePath: we(
364
364
  a.props.path,
365
- o[u].pathname
365
+ r[u].pathname
366
366
  )
367
367
  },
368
- children: /* @__PURE__ */ L(De, { children: a })
368
+ children: /* @__PURE__ */ N(Le, { children: a })
369
369
  },
370
- o[u].id
370
+ r[u].id
371
371
  ));
372
372
  }
373
- const Kt = "data-flemo", Jt = () => {
373
+ const Kt = "data-flemo", Wt = () => {
374
374
  if (Mt()) return;
375
- const n = ge(ot.values(), yt.values());
375
+ const n = Se(ct.values(), yt.values());
376
376
  let e = document.head.querySelector(`style[${Kt}]`);
377
377
  e || (e = document.createElement("style"), e.setAttribute(Kt, ""), document.head.appendChild(e)), e.textContent !== n && (e.textContent = n);
378
378
  };
379
- function Le(n, e) {
380
- fe(() => {
381
- for (const o of n) ot.set(o.name, o);
382
- for (const o of e) yt.set(o.name, o);
383
- return Jt(), () => {
384
- for (const o of n) ot.delete(o.name);
385
- for (const o of e) yt.delete(o.name);
386
- Jt();
379
+ function $e(n, e) {
380
+ ye(() => {
381
+ for (const r of n) ct.set(r.name, r);
382
+ for (const r of e) yt.set(r.name, r);
383
+ return Wt(), () => {
384
+ for (const r of n) ct.delete(r.name);
385
+ for (const r of e) yt.delete(r.name);
386
+ Wt();
387
387
  };
388
388
  }, [n, e]);
389
389
  }
390
- const Ne = [], $e = [];
391
- function je({
390
+ const Ae = [], ke = [];
391
+ function Fe({
392
392
  children: n,
393
393
  initPath: e = "/",
394
- defaultTransitionName: o = "cupertino",
395
- transitions: a = Ne,
396
- decorators: u = $e
394
+ defaultTransitionName: r = "cupertino",
395
+ transitions: a = Ae,
396
+ decorators: u = ke
397
397
  }) {
398
398
  const i = Mt() ? e || "/" : window.location.pathname, s = Mt() ? i.split("?")[1] || "" : window.location.search;
399
- return Gt.setState({
400
- defaultTransitionName: o
399
+ return Ot.setState({
400
+ defaultTransitionName: r
401
401
  }), O.setState({
402
402
  index: 0,
403
403
  histories: [
404
404
  {
405
405
  id: "root",
406
406
  pathname: i,
407
- params: we(
408
- Zt.toArray(n).map((E) => E.props.path).flat(),
407
+ params: ve(
408
+ te.toArray(n).map((T) => T.props.path).flat(),
409
409
  i,
410
410
  s
411
411
  ),
412
- transitionName: o,
412
+ transitionName: r,
413
413
  layoutId: null
414
414
  }
415
415
  ]
416
- }), Le(a, u), ut(() => {
416
+ }), $e(a, u), dt(() => {
417
417
  window.history.state?.index || window.history.replaceState(
418
418
  {
419
419
  id: "root",
420
420
  index: 0,
421
421
  status: "IDLE",
422
422
  params: {},
423
- transitionName: o,
423
+ transitionName: r,
424
424
  layoutId: null
425
425
  },
426
426
  "",
427
427
  window.location.href
428
428
  );
429
- }, [o]), /* @__PURE__ */ Ot(de, { children: [
430
- /* @__PURE__ */ L(xe, {}),
431
- /* @__PURE__ */ L(Re, { children: n })
429
+ }, [r]), /* @__PURE__ */ Ht(fe, { children: [
430
+ /* @__PURE__ */ N(Ie, {}),
431
+ /* @__PURE__ */ N(Ne, { children: n })
432
432
  ] });
433
433
  }
434
- function Fe({ element: n }) {
434
+ function qe({ element: n }) {
435
435
  return n;
436
436
  }
437
- function Dt(n, e) {
438
- const o = e ?? {}, a = Ut.compile(n), u = Object.fromEntries(
439
- Object.entries(o).map(([h, R]) => [h, String(R)])
440
- ), i = a(u), E = (typeof n == "string" ? Ut.parse(n) : n).tokens.filter((h) => h.type === "param").map((h) => h.name), T = Object.fromEntries(
441
- Object.entries(o).filter(([h]) => !E.includes(h))
442
- ), m = new URLSearchParams(T).toString();
437
+ function It(n, e) {
438
+ const r = e ?? {}, a = Bt.compile(n), u = Object.fromEntries(
439
+ Object.entries(r).map(([h, R]) => [h, String(R)])
440
+ ), i = a(u), T = (typeof n == "string" ? Bt.parse(n) : n).tokens.filter((h) => h.type === "param").map((h) => h.name), E = Object.fromEntries(
441
+ Object.entries(r).filter(([h]) => !T.includes(h))
442
+ ), m = new URLSearchParams(E).toString();
443
443
  return { pathname: `${i}${m ? `?${m}` : ""}`, toPathname: i };
444
444
  }
445
- function Xe() {
445
+ function ze() {
446
446
  return {
447
447
  push: async (a, u, i) => {
448
- const { status: s } = q.getState();
448
+ const { status: s } = W.getState();
449
449
  if (s !== "COMPLETED" && s !== "IDLE")
450
450
  return;
451
- const { index: E, addHistory: T } = O.getState(), m = Gt.getState().defaultTransitionName, { transitionName: x = m, layoutId: h = null } = i ?? {}, R = U.generateTaskId();
452
- (await U.addTask(
451
+ const { index: T, addHistory: E } = O.getState(), m = Ot.getState().defaultTransitionName, { transitionName: x = m, layoutId: h = null } = i ?? {}, R = G.generateTaskId();
452
+ (await G.addTask(
453
453
  async () => {
454
- const { setStatus: N, setTransitionTaskId: A } = q.getState();
455
- N("PUSHING"), A(R);
456
- const { pathname: b, toPathname: F } = Dt(a, u ?? {});
454
+ const { setStatus: $, setTransitionTaskId: C } = W.getState();
455
+ $("PUSHING"), C(R);
456
+ const { pathname: D, toPathname: q } = It(a, u ?? {});
457
457
  return window.history.pushState(
458
458
  {
459
459
  id: R,
460
- index: E + 1,
460
+ index: T + 1,
461
461
  status: "PUSHING",
462
462
  params: u,
463
463
  transitionName: x,
464
464
  layoutId: h
465
465
  },
466
466
  "",
467
- b
468
- ), T({
467
+ D
468
+ ), E({
469
469
  id: R,
470
- pathname: F,
470
+ pathname: q,
471
471
  params: u ?? {},
472
472
  transitionName: x,
473
473
  layoutId: h
474
474
  }), () => {
475
- N("COMPLETED");
475
+ $("COMPLETED");
476
476
  };
477
477
  },
478
478
  {
@@ -484,38 +484,38 @@ function Xe() {
484
484
  )).result?.();
485
485
  },
486
486
  replace: async (a, u, i) => {
487
- const { status: s } = q.getState();
487
+ const { status: s } = W.getState();
488
488
  if (s !== "COMPLETED" && s !== "IDLE")
489
489
  return;
490
- const { index: E, addHistory: T } = O.getState(), m = O.getState().replaceHistory, x = Gt.getState().defaultTransitionName, { transitionName: h = x, layoutId: R = null } = i ?? {}, N = U.generateTaskId();
491
- (await U.addTask(
490
+ const { index: T, addHistory: E } = O.getState(), m = O.getState().replaceHistory, x = Ot.getState().defaultTransitionName, { transitionName: h = x, layoutId: R = null } = i ?? {}, $ = G.generateTaskId();
491
+ (await G.addTask(
492
492
  async () => {
493
- const { setStatus: A, setTransitionTaskId: b } = q.getState();
494
- A("REPLACING"), b(N);
495
- const { pathname: F, toPathname: H } = Dt(a, u ?? {});
493
+ const { setStatus: C, setTransitionTaskId: D } = W.getState();
494
+ C("REPLACING"), D($);
495
+ const { pathname: q, toPathname: M } = It(a, u ?? {});
496
496
  return window.history.replaceState(
497
497
  {
498
- id: N,
499
- index: E,
498
+ id: $,
499
+ index: T,
500
500
  status: "REPLACING",
501
501
  params: u,
502
502
  transitionName: h,
503
503
  layoutId: R
504
504
  },
505
505
  "",
506
- F
507
- ), T({
508
- id: N,
509
- pathname: H,
506
+ q
507
+ ), E({
508
+ id: $,
509
+ pathname: M,
510
510
  params: u ?? {},
511
511
  transitionName: h,
512
512
  layoutId: R
513
513
  }), async () => {
514
- m(E), A("COMPLETED");
514
+ m(T), C("COMPLETED");
515
515
  };
516
516
  },
517
517
  {
518
- id: N,
518
+ id: $,
519
519
  control: {
520
520
  manual: !0
521
521
  }
@@ -523,17 +523,17 @@ function Xe() {
523
523
  )).result?.();
524
524
  },
525
525
  pop: async () => {
526
- const a = U.generateTaskId();
527
- (await U.addTask(
526
+ const a = G.generateTaskId();
527
+ (await G.addTask(
528
528
  async (u) => {
529
529
  const { index: i, popHistory: s } = O.getState();
530
530
  if (i <= 0) {
531
531
  u.abort();
532
532
  return;
533
533
  }
534
- const { setStatus: E, setTransitionTaskId: T } = q.getState();
535
- return E("POPPING"), T(a), te(), window.history.back(), async () => {
536
- s(i), E("COMPLETED");
534
+ const { setStatus: T, setTransitionTaskId: E } = W.getState();
535
+ return T("POPPING"), E(a), ee(), window.history.back(), async () => {
536
+ s(i), T("COMPLETED");
537
537
  };
538
538
  },
539
539
  {
@@ -546,12 +546,12 @@ function Xe() {
546
546
  }
547
547
  };
548
548
  }
549
- function qe() {
550
- const { routePath: n } = ht(), e = Yt(re);
549
+ function Ke() {
550
+ const { routePath: n } = ht(), e = Yt(oe);
551
551
  return {
552
552
  pushStep: async (i) => {
553
- (await U.addTask(async () => {
554
- const { pathname: s } = Dt(n, i);
553
+ (await G.addTask(async () => {
554
+ const { pathname: s } = It(n, i);
555
555
  return window.history.state?.step || window.history.replaceState(
556
556
  {
557
557
  ...window.history.state,
@@ -571,8 +571,8 @@ function qe() {
571
571
  })).result?.();
572
572
  },
573
573
  replaceStep: async (i) => {
574
- (await U.addTask(async () => {
575
- const { pathname: s } = Dt(n, i);
574
+ (await G.addTask(async () => {
575
+ const { pathname: s } = It(n, i);
576
576
  return window.history.replaceState(
577
577
  {
578
578
  ...window.history.state,
@@ -585,22 +585,22 @@ function qe() {
585
585
  })).result?.();
586
586
  },
587
587
  popStep: async () => {
588
- const i = U.generateTaskId();
589
- (await U.addTask(
588
+ const i = G.generateTaskId();
589
+ (await G.addTask(
590
590
  async (s) => {
591
- const E = new Promise((A) => {
591
+ const T = new Promise((C) => {
592
592
  window.addEventListener(
593
593
  "popstate",
594
- (b) => A(b.state),
594
+ (D) => C(D.state),
595
595
  { once: !0 }
596
596
  );
597
- }), T = new Promise(
598
- (A) => setTimeout(() => A(void 0), 200)
597
+ }), E = new Promise(
598
+ (C) => setTimeout(() => C(void 0), 200)
599
599
  );
600
- te(), window.history.back();
600
+ ee(), window.history.back();
601
601
  const m = await Promise.race([
602
- E,
603
- T
602
+ T,
603
+ E
604
604
  ]);
605
605
  if (!m) {
606
606
  s.abort();
@@ -610,9 +610,9 @@ function qe() {
610
610
  e({ type: "SET", params: m.params ?? {} }), s.abort();
611
611
  return;
612
612
  }
613
- const { setStatus: x, setTransitionTaskId: h } = q.getState(), { index: R, popHistory: N } = O.getState();
613
+ const { setStatus: x, setTransitionTaskId: h } = W.getState(), { index: R, popHistory: $ } = O.getState();
614
614
  return x("POPPING"), h(i), async () => {
615
- N(R), x("COMPLETED");
615
+ $(R), x("COMPLETED");
616
616
  };
617
617
  },
618
618
  {
@@ -625,26 +625,26 @@ function qe() {
625
625
  }
626
626
  };
627
627
  }
628
- function ze() {
629
- return Yt(ne);
628
+ function We() {
629
+ return Yt(re);
630
630
  }
631
- function Ae({ freeze: n, children: e }) {
632
- const o = $(e);
633
- return n || (o.current = e), /* @__PURE__ */ L(
631
+ function Ce({ freeze: n, children: e }) {
632
+ const r = L(e);
633
+ return n || (r.current = e), /* @__PURE__ */ N(
634
634
  "div",
635
635
  {
636
636
  style: {
637
637
  display: n ? "none" : void 0
638
638
  },
639
- children: o.current
639
+ children: r.current
640
640
  }
641
641
  );
642
642
  }
643
- function Ce({ ref: n, style: e, ...o }) {
644
- const { isActive: a, transitionName: u } = ht(), i = $(null);
645
- me(n, () => i.current);
646
- const s = q((x) => x.status), E = ot.get(u) ?? ot.get("none"), { decoratorName: T } = E, m = yt.get(T);
647
- return m ? /* @__PURE__ */ L(
643
+ function He({ ref: n, style: e, ...r }) {
644
+ const { isActive: a, transitionName: u } = ht(), i = L(null);
645
+ he(n, () => i.current);
646
+ const s = W((x) => x.status), T = ct.get(u) ?? ct.get("none"), { decoratorName: E } = T, m = yt.get(E);
647
+ return m ? /* @__PURE__ */ N(
648
648
  "div",
649
649
  {
650
650
  ref: i,
@@ -662,346 +662,353 @@ function Ce({ ref: n, style: e, ...o }) {
662
662
  zIndex: 1,
663
663
  ...e
664
664
  },
665
- ...o
665
+ ...r
666
666
  }
667
667
  ) : null;
668
668
  }
669
- const Wt = (n) => {
669
+ const Jt = (n) => {
670
670
  let e;
671
- const o = /* @__PURE__ */ new Set(), a = (m, x) => {
671
+ const r = /* @__PURE__ */ new Set(), a = (m, x) => {
672
672
  const h = typeof m == "function" ? m(e) : m;
673
673
  if (!Object.is(h, e)) {
674
674
  const R = e;
675
- e = x ?? (typeof h != "object" || h === null) ? h : Object.assign({}, e, h), o.forEach((N) => N(e, R));
675
+ e = x ?? (typeof h != "object" || h === null) ? h : Object.assign({}, e, h), r.forEach(($) => $(e, R));
676
676
  }
677
- }, u = () => e, E = { setState: a, getState: u, getInitialState: () => T, subscribe: (m) => (o.add(m), () => o.delete(m)) }, T = e = n(a, u, E);
678
- return E;
679
- }, ke = ((n) => n ? Wt(n) : Wt), He = (n) => n;
680
- function Oe(n, e = He) {
681
- const o = xt.useSyncExternalStore(
677
+ }, u = () => e, T = { setState: a, getState: u, getInitialState: () => E, subscribe: (m) => (r.add(m), () => r.delete(m)) }, E = e = n(a, u, T);
678
+ return T;
679
+ }, Me = ((n) => n ? Jt(n) : Jt), Oe = (n) => n;
680
+ function Be(n, e = Oe) {
681
+ const r = Pt.useSyncExternalStore(
682
682
  n.subscribe,
683
- xt.useCallback(() => e(n.getState()), [n, e]),
684
- xt.useCallback(() => e(n.getInitialState()), [n, e])
683
+ Pt.useCallback(() => e(n.getState()), [n, e]),
684
+ Pt.useCallback(() => e(n.getInitialState()), [n, e])
685
685
  );
686
- return xt.useDebugValue(o), o;
686
+ return Pt.useDebugValue(r), r;
687
687
  }
688
688
  const Qt = (n) => {
689
- const e = ke(n), o = (a) => Oe(e, a);
690
- return Object.assign(o, e), o;
691
- }, Me = ((n) => n ? Qt(n) : Qt), J = Me((n) => ({
689
+ const e = Me(n), r = (a) => Be(e, a);
690
+ return Object.assign(r, e), r;
691
+ }, Ue = ((n) => n ? Qt(n) : Qt), Q = Ue((n) => ({
692
692
  dragStatus: "IDLE",
693
693
  replaceTransitionStatus: "IDLE",
694
694
  sharedBars: {},
695
695
  setDragStatus: (e) => n({ dragStatus: e }),
696
696
  setReplaceTransitionStatus: (e) => n({ replaceTransitionStatus: e }),
697
- registerSharedBars: (e, o) => n((a) => ({ sharedBars: { ...a.sharedBars, [e]: o } })),
698
- unregisterSharedBars: (e) => n((o) => {
699
- const a = { ...o.sharedBars };
697
+ registerSharedBars: (e, r) => n((a) => ({ sharedBars: { ...a.sharedBars, [e]: r } })),
698
+ unregisterSharedBars: (e) => n((r) => {
699
+ const a = { ...r.sharedBars };
700
700
  return delete a[e], { sharedBars: a };
701
701
  })
702
702
  }));
703
- let kt = 0;
703
+ let Ct = 0;
704
704
  function Ge() {
705
- const [n, e] = bt(0), [o, a] = bt(0);
706
- return ut(() => {
705
+ const [n, e] = bt(0), [r, a] = bt(0);
706
+ return dt(() => {
707
707
  let u = 0;
708
708
  const i = () => {
709
709
  cancelAnimationFrame(u), u = requestAnimationFrame(() => {
710
710
  let s = document.documentElement.scrollHeight - (window.visualViewport?.height || 0);
711
711
  s = s < 0 ? 0 : s;
712
- let E = s - kt;
713
- E = E < 0 ? 0 : E, kt || (kt = s), a(E), e(s);
712
+ let T = s - Ct;
713
+ T = T < 0 ? 0 : T, Ct || (Ct = s), a(T), e(s);
714
714
  });
715
715
  };
716
716
  return window.visualViewport?.addEventListener("resize", i), window.visualViewport?.addEventListener("scroll", i), () => {
717
717
  cancelAnimationFrame(u), window.visualViewport?.removeEventListener("resize", i), window.visualViewport?.removeEventListener("scroll", i);
718
718
  };
719
- }, []), { viewportScrollHeight: n, changedViewportScrollHeight: o };
719
+ }, []), { viewportScrollHeight: n, changedViewportScrollHeight: r };
720
720
  }
721
- const Ue = (n) => typeof HTMLElement < "u" && n instanceof HTMLElement, It = (n, e) => {
721
+ const Ye = (n) => typeof HTMLElement < "u" && n instanceof HTMLElement, Ut = /* @__PURE__ */ new WeakMap(), Zt = (n, e) => {
722
+ let r = Ut.get(n);
723
+ r || (r = /* @__PURE__ */ new Set(), Ut.set(n, r)), r.add(e);
724
+ }, F = (n, e) => {
722
725
  n.style.transition = "";
723
- {
724
- n.style.removeProperty("transform"), n.style.removeProperty("opacity");
726
+ const r = Ut.get(n);
727
+ if (r && r.size > 0) {
728
+ for (const a of r)
729
+ n.style.removeProperty(a);
730
+ r.clear();
725
731
  return;
726
732
  }
727
- }, st = (n, e, o = {}) => {
728
- if (!Ue(n)) return Promise.resolve();
729
- const a = n, u = Se(e);
733
+ n.style.removeProperty("transform"), n.style.removeProperty("opacity");
734
+ }, lt = (n, e, r = {}) => {
735
+ if (!Ye(n)) return Promise.resolve();
736
+ const a = n, u = Te(e);
730
737
  if (u.length === 0) return Promise.resolve();
731
- const i = typeof o.duration == "number" ? o.duration : 0, s = typeof o.delay == "number" && o.delay > 0 ? o.delay : 0, E = ve(o.ease);
738
+ const i = typeof r.duration == "number" ? r.duration : 0, s = typeof r.delay == "number" && r.delay > 0 ? r.delay : 0, T = Ee(r.ease);
732
739
  if (i <= 0 && s <= 0) {
733
740
  a.style.transition = "none";
734
- for (const m of u) a.style.setProperty(m.property, m.value);
741
+ for (const m of u)
742
+ a.style.setProperty(m.property, m.value), Zt(a, m.property);
735
743
  return Promise.resolve();
736
744
  }
737
- const T = u.map((m) => `${m.property} ${i}s ${E} ${s}s`).join(", ");
738
- a.style.transition = T, a.offsetWidth;
739
- for (const m of u) a.style.setProperty(m.property, m.value);
745
+ const E = u.map((m) => `${m.property} ${i}s ${T} ${s}s`).join(", ");
746
+ a.style.transition = E, a.offsetWidth;
747
+ for (const m of u)
748
+ a.style.setProperty(m.property, m.value), Zt(a, m.property);
740
749
  return new Promise((m) => {
741
750
  let x = !1;
742
751
  const h = () => {
743
752
  x || (x = !0, a.removeEventListener("transitionend", R), m());
744
- }, R = (N) => {
745
- N.target === a && h();
753
+ }, R = ($) => {
754
+ $.target === a && h();
746
755
  };
747
756
  a.addEventListener("transitionend", R), setTimeout(h, (i + s) * 1e3 + 60);
748
757
  });
749
- }, ct = q, Ht = "data-flemo-skip-animation";
758
+ }, pt = W, mt = "data-flemo-skip-animation";
750
759
  function Ve({
751
760
  children: n,
752
761
  statusBarHeight: e,
753
- statusBarColor: o,
762
+ statusBarColor: r,
754
763
  systemNavigationBarHeight: a,
755
764
  systemNavigationBarColor: u,
756
765
  sharedAppBar: i,
757
766
  sharedNavigationBar: s,
758
- appBar: E,
759
- navigationBar: T,
767
+ appBar: T,
768
+ navigationBar: E,
760
769
  hideStatusBar: m,
761
770
  hideSystemNavigationBar: x,
762
771
  backgroundColor: h = "white",
763
772
  contentScrollable: R = !0,
764
- ...N
773
+ ...$
765
774
  }) {
766
- const { id: A, isActive: b, isRoot: F, zIndex: H, transitionName: V, prevTransitionName: gt } = ht(), M = ct((t) => t.status), r = J((t) => t.dragStatus), c = J.getState().setDragStatus, y = J.getState().setReplaceTransitionStatus, d = O((t) => t.index), l = ot.get(V) ?? ot.get("none"), { initial: w, swipeDirection: f, decoratorName: P } = l, S = yt.get(P), { viewportScrollHeight: D } = Ge(), I = D > 0, [G, v] = bt(0), [k, Y] = bt(0), Bt = $(null), X = $(null), Z = $(null), tt = $(null), at = $(null), W = $(!1), lt = $(!1), et = $(!1), oe = $(0), Rt = $({ x: 0, y: 0 }), wt = $({ x: 0, y: 0 }), Lt = $(0), Nt = $({ x: 0, y: 0 }), Q = $({
775
+ const { id: C, isActive: D, isRoot: q, zIndex: M, transitionName: Y, prevTransitionName: gt } = ht(), B = pt((t) => t.status), o = Q((t) => t.dragStatus), c = Q.getState().setDragStatus, y = Q.getState().setReplaceTransitionStatus, p = O((t) => t.index), l = ct.get(Y) ?? ct.get("none"), { initial: g, swipeDirection: d, decoratorName: P } = l, w = yt.get(P), { viewportScrollHeight: I } = Ge(), b = I > 0, [U, S] = bt(0), [H, _] = bt(0), Vt = L(null), V = L(null), Z = L(null), z = L(null), ut = L(null), J = L({
776
+ current: [],
777
+ prev: []
778
+ }), tt = L(!1), ft = L(!1), rt = L(!1), ae = L(0), Rt = L({ x: 0, y: 0 }), wt = L({ x: 0, y: 0 }), Dt = L(0), Lt = L({ x: 0, y: 0 }), et = L({
767
779
  element: null,
768
780
  hasMarker: !1
769
- }), nt = $({ element: null, hasMarker: !1 }), $t = $(0), At = $(0), St = $(null), vt = $(null), Ct = (t) => {
770
- const p = wt.current;
781
+ }), ot = L({ element: null, hasMarker: !1 }), Nt = L(0), $t = L(0), at = L(null), it = L(null), At = (t) => {
782
+ const f = wt.current;
771
783
  return {
772
784
  point: { x: t.clientX, y: t.clientY },
773
785
  offset: {
774
786
  x: t.clientX - Rt.current.x,
775
787
  y: t.clientY - Rt.current.y
776
788
  },
777
- delta: { x: t.clientX - p.x, y: t.clientY - p.y },
778
- velocity: Nt.current
789
+ delta: { x: t.clientX - f.x, y: t.clientY - f.y },
790
+ velocity: Lt.current
779
791
  };
780
- }, ae = (t) => {
781
- const p = t.timeStamp, g = Math.max(1, p - Lt.current), C = wt.current;
782
- Nt.current = {
783
- x: (t.clientX - C.x) / g * 1e3,
784
- y: (t.clientY - C.y) / g * 1e3
785
- }, wt.current = { x: t.clientX, y: t.clientY }, Lt.current = p;
786
- }, Et = async (t) => {
787
- if (!f || D > 10) return;
788
- const p = X.current;
789
- if (!p) return;
790
- const g = Bt.current?.parentElement?.previousElementSibling;
791
- if (Z.current = g?.querySelector("[data-flemo-screen]") ?? null, at.current = g?.querySelector("[data-flemo-decorator]") ?? null, !Z.current) return;
792
- et.current = !0, oe.current = t.timeStamp, Rt.current = { x: t.clientX, y: t.clientY }, wt.current = { x: t.clientX, y: t.clientY }, Lt.current = t.timeStamp, Nt.current = { x: 0, y: 0 }, p.setPointerCapture(t.pointerId), await l?.onSwipeStart(t, Ct(t), {
793
- animate: st,
794
- currentScreen: p,
792
+ }, ie = (t) => {
793
+ const f = t.timeStamp, v = Math.max(1, f - Dt.current), k = wt.current;
794
+ Lt.current = {
795
+ x: (t.clientX - k.x) / v * 1e3,
796
+ y: (t.clientY - k.y) / v * 1e3
797
+ }, wt.current = { x: t.clientX, y: t.clientY }, Dt.current = f;
798
+ }, kt = (t, f, v) => {
799
+ const k = lt(t, f, v);
800
+ if (t === V.current)
801
+ for (const A of J.current.current)
802
+ lt(A, f, v);
803
+ else if (t === Z.current)
804
+ for (const A of J.current.prev)
805
+ lt(A, f, v);
806
+ return k;
807
+ }, se = (t) => {
808
+ const f = D ? O.getState().histories[p - 1]?.id : O.getState().histories[p]?.id, v = f ? Q.getState().sharedBars[f] : void 0, k = [], A = at.current, st = it.current;
809
+ A && vt && !v?.appBar && k.push(A), st && Tt && !v?.navigationBar && k.push(st);
810
+ const X = [];
811
+ if (t) {
812
+ const nt = t.querySelector('[data-flemo-bar="app"]'), Ft = t.querySelector('[data-flemo-bar="nav"]');
813
+ nt && !vt && X.push(nt), Ft && !Tt && X.push(Ft);
814
+ }
815
+ J.current = { current: k, prev: X };
816
+ const Et = be(l).join(", ");
817
+ for (const nt of k) nt.style.willChange = Et;
818
+ for (const nt of X) nt.style.willChange = Et;
819
+ }, _t = () => {
820
+ for (const t of J.current.current)
821
+ F(t), t.style.removeProperty("will-change");
822
+ for (const t of J.current.prev)
823
+ F(t), t.style.removeProperty("will-change");
824
+ J.current = { current: [], prev: [] };
825
+ }, St = async (t) => {
826
+ if (!d || I > 10) return;
827
+ const f = V.current;
828
+ if (!f) return;
829
+ const v = Vt.current?.parentElement?.previousElementSibling;
830
+ if (Z.current = v?.querySelector("[data-flemo-screen]") ?? null, ut.current = v?.querySelector("[data-flemo-decorator]") ?? null, !Z.current) return;
831
+ rt.current = !0, ae.current = t.timeStamp, Rt.current = { x: t.clientX, y: t.clientY }, wt.current = { x: t.clientX, y: t.clientY }, Dt.current = t.timeStamp, Lt.current = { x: 0, y: 0 }, f.setPointerCapture(t.pointerId), se(v), await l?.onSwipeStart(t, At(t), {
832
+ animate: kt,
833
+ currentScreen: f,
795
834
  prevScreen: Z.current,
796
- onStart: (j) => S?.onSwipeStart?.(j, {
797
- animate: st,
798
- currentDecorator: tt.current,
799
- prevDecorator: at.current
835
+ onStart: (A) => w?.onSwipeStart?.(A, {
836
+ animate: lt,
837
+ currentDecorator: z.current,
838
+ prevDecorator: ut.current
800
839
  })
801
- }) ? c("PENDING") : (c("IDLE"), et.current = !1);
802
- }, ie = (t) => {
803
- !f || !et.current || D > 10 || (ae(t), l.onSwipe(t, Ct(t), {
804
- animate: st,
805
- currentScreen: X.current,
840
+ }) ? c("PENDING") : (c("IDLE"), rt.current = !1, _t());
841
+ }, ce = (t) => {
842
+ !d || !rt.current || I > 10 || (ie(t), l.onSwipe(t, At(t), {
843
+ animate: kt,
844
+ currentScreen: V.current,
806
845
  prevScreen: Z.current,
807
- onProgress: (p, g) => S?.onSwipe?.(p, g, {
808
- animate: st,
809
- currentDecorator: tt.current,
810
- prevDecorator: at.current
846
+ onProgress: (f, v) => w?.onSwipe?.(f, v, {
847
+ animate: lt,
848
+ currentDecorator: z.current,
849
+ prevDecorator: ut.current
811
850
  })
812
851
  }));
813
- }, se = async (t) => {
814
- if (!f || !et.current) return;
815
- et.current = !1;
816
- const p = X.current;
817
- p && p.hasPointerCapture(t.pointerId) && p.releasePointerCapture(t.pointerId);
818
- const g = Ct(t);
819
- await l?.onSwipeEnd(t, g, {
820
- animate: st,
821
- currentScreen: X.current,
852
+ }, ue = async (t) => {
853
+ if (!d || !rt.current) return;
854
+ rt.current = !1;
855
+ const f = V.current;
856
+ f && f.hasPointerCapture(t.pointerId) && f.releasePointerCapture(t.pointerId);
857
+ const v = At(t);
858
+ if (await l?.onSwipeEnd(t, v, {
859
+ animate: kt,
860
+ currentScreen: V.current,
822
861
  prevScreen: Z.current,
823
- onStart: (j) => S?.onSwipeEnd?.(j, {
824
- animate: st,
825
- currentDecorator: tt.current,
826
- prevDecorator: at.current
862
+ onStart: (A) => w?.onSwipeEnd?.(A, {
863
+ animate: lt,
864
+ currentDecorator: z.current,
865
+ prevDecorator: ut.current
827
866
  })
828
- }) ? (X.current?.setAttribute(Ht, "true"), tt.current?.setAttribute(Ht, "true"), window.history.back()) : (It(X.current), Z.current && It(Z.current), tt.current && It(tt.current), at.current && It(at.current), c("IDLE"));
829
- }, ce = (t) => {
830
- if (!(!F && b && M === "COMPLETED" && r === "IDLE" && !!f && D < 10))
867
+ })) {
868
+ V.current?.setAttribute(mt, "true"), z.current?.setAttribute(mt, "true");
869
+ for (const A of J.current.current)
870
+ A.style.removeProperty("will-change");
871
+ for (const A of J.current.prev)
872
+ F(A), A.style.removeProperty("will-change");
873
+ J.current = { current: [], prev: [] }, window.history.back();
874
+ } else
875
+ F(V.current), Z.current && F(Z.current), z.current && F(z.current), ut.current && F(ut.current), _t(), c("IDLE");
876
+ }, le = (t) => {
877
+ if (!(!q && D && B === "COMPLETED" && o === "IDLE" && !!d && I < 10))
831
878
  return;
832
- Q.current = qt(t.target, {
879
+ et.current = qt(t.target, {
833
880
  direction: "x",
834
881
  verifyByScroll: !0
835
- }), nt.current = qt(t.target, {
882
+ }), ot.current = qt(t.target, {
836
883
  direction: "y",
837
884
  verifyByScroll: !0
838
- }), $t.current = t.clientX, At.current = t.clientY, (!Q.current.element && !nt.current.element || Q.current.element || nt.current.element) && (W.current = !0);
839
- }, ue = (t) => {
840
- if (D > 10)
885
+ }), Nt.current = t.clientX, $t.current = t.clientY, (!et.current.element && !ot.current.element || et.current.element || ot.current.element) && (tt.current = !0);
886
+ }, pe = (t) => {
887
+ if (I > 10)
841
888
  return;
842
- if (et.current) {
843
- ie(t.nativeEvent);
889
+ if (rt.current) {
890
+ ce(t.nativeEvent);
844
891
  return;
845
892
  }
846
- const p = !Q.current.element && !nt.current.element;
847
- if (W.current && p) {
848
- W.current = !1, lt.current = !0;
849
- const g = t.clientY - At.current, C = t.clientX - $t.current;
850
- (f === "y" && g > 0 || f === "x" && C > 0) && Et(t.nativeEvent);
851
- } else if (W.current && !p) {
852
- const g = t.clientX - $t.current, C = t.clientY - At.current, j = nt.current.element && nt.current.element.scrollTop <= 0, z = Q.current.element && Q.current.element.scrollLeft <= 0 && Q.current.hasMarker;
853
- (f === "y" && (j || Q.current.element) && C > 0 && Math.abs(g) < 2 || f === "x" && (z || nt.current.element) && g > 0 && Math.abs(C) < 2) && (W.current = !1, lt.current = !0, Et(t.nativeEvent));
893
+ const f = !et.current.element && !ot.current.element;
894
+ if (tt.current && f) {
895
+ tt.current = !1, ft.current = !0;
896
+ const v = t.clientY - $t.current, k = t.clientX - Nt.current;
897
+ (d === "y" && v > 0 || d === "x" && k > 0) && St(t.nativeEvent);
898
+ } else if (tt.current && !f) {
899
+ const v = t.clientX - Nt.current, k = t.clientY - $t.current, A = ot.current.element && ot.current.element.scrollTop <= 0, st = et.current.element && et.current.element.scrollLeft <= 0 && et.current.hasMarker;
900
+ (d === "y" && (A || et.current.element) && k > 0 && Math.abs(v) < 2 || d === "x" && (st || ot.current.element) && v > 0 && Math.abs(k) < 2) && (tt.current = !1, ft.current = !0, St(t.nativeEvent));
854
901
  }
855
- }, _t = (t) => {
856
- W.current = !1, lt.current = !1, et.current && se(t.nativeEvent);
902
+ }, jt = (t) => {
903
+ tt.current = !1, ft.current = !1, rt.current && ue(t.nativeEvent);
857
904
  };
858
- ut(() => {
859
- const t = X.current;
905
+ dt(() => {
906
+ const t = V.current;
860
907
  if (!t) return;
861
- const p = (g) => {
862
- lt.current && g.preventDefault(), g.target?.dataset.swipeAtEdgeBar === "true" && g.preventDefault();
908
+ const f = (v) => {
909
+ ft.current && v.preventDefault(), v.target?.dataset.swipeAtEdgeBar === "true" && v.preventDefault();
863
910
  };
864
- return t.addEventListener("touchmove", p, {
911
+ return t.addEventListener("touchmove", f, {
865
912
  passive: !1
866
913
  }), () => {
867
- t.removeEventListener("touchmove", p);
914
+ t.removeEventListener("touchmove", f);
868
915
  };
869
- }, []), ut(() => {
870
- if (!b) {
871
- M === "REPLACING" && gt !== V && y("PENDING");
916
+ }, []), dt(() => {
917
+ if (!D) {
918
+ B === "REPLACING" && gt !== Y && y("PENDING");
872
919
  return;
873
920
  }
874
- if (M === "COMPLETED") {
875
- c("IDLE"), y("IDLE");
921
+ if (B === "COMPLETED") {
922
+ c("IDLE"), y("IDLE"), V.current && (F(V.current), V.current.removeAttribute(mt)), z.current && (F(z.current), z.current.removeAttribute(mt)), at.current && (F(at.current), at.current.style.removeProperty("will-change")), it.current && (F(it.current), it.current.style.removeProperty("will-change"));
876
923
  return;
877
924
  }
878
- if (M === "IDLE") return;
879
- const t = X.current;
925
+ if (B === "IDLE") return;
926
+ const t = V.current;
880
927
  if (!t) return;
881
- const p = () => {
882
- const B = ct.getState().transitionTaskId;
883
- B && U.resolveTask(B);
884
- }, g = `${M}-true`;
885
- if (!(!(t.getAttribute(Ht) === "true") && Ee(l, g))) {
886
- queueMicrotask(p);
928
+ const f = () => {
929
+ const K = pt.getState().transitionTaskId;
930
+ K && G.resolveTask(K);
931
+ }, v = `${B}-true`;
932
+ if (!(!(t.getAttribute(mt) === "true") && Pe(l, v))) {
933
+ queueMicrotask(f);
887
934
  return;
888
935
  }
889
- const z = Te("screen", V, g), K = (B) => {
890
- B.target === t && B.animationName === z && (t.removeEventListener("animationend", K), p());
936
+ const st = xe("screen", Y, v), X = (K) => {
937
+ K.target === t && K.animationName === st && (t.removeEventListener("animationend", X), f());
891
938
  };
892
- return t.addEventListener("animationend", K), () => {
893
- t.removeEventListener("animationend", K);
939
+ return t.addEventListener("animationend", X), () => {
940
+ t.removeEventListener("animationend", X);
894
941
  };
895
942
  }, [
896
- M,
897
- b,
898
- A,
943
+ B,
944
+ D,
945
+ C,
899
946
  gt,
900
- V,
947
+ Y,
901
948
  l,
902
949
  c,
903
950
  y
904
- ]), mt(() => {
905
- const t = St.current;
951
+ ]), xt(() => {
952
+ const t = at.current;
906
953
  if (!t) {
907
- v(0);
954
+ S(0);
908
955
  return;
909
956
  }
910
- v(t.offsetHeight);
911
- const p = new ResizeObserver(([g]) => {
912
- v(g.contentRect.height);
957
+ S(t.offsetHeight);
958
+ const f = new ResizeObserver(([v]) => {
959
+ S(v.contentRect.height);
913
960
  });
914
- return p.observe(t), () => {
915
- p.disconnect();
961
+ return f.observe(t), () => {
962
+ f.disconnect();
916
963
  };
917
- }, [i]), mt(() => {
918
- const t = vt.current;
964
+ }, [i]), xt(() => {
965
+ const t = it.current;
919
966
  if (!t) {
920
- Y(0);
967
+ _(0);
921
968
  return;
922
969
  }
923
- Y(t.offsetHeight);
924
- const p = new ResizeObserver(([g]) => {
925
- Y(g.contentRect.height);
970
+ _(t.offsetHeight);
971
+ const f = new ResizeObserver(([v]) => {
972
+ _(v.contentRect.height);
926
973
  });
927
- return p.observe(t), () => {
928
- p.disconnect();
974
+ return f.observe(t), () => {
975
+ f.disconnect();
929
976
  };
930
- }, [s]), mt(() => {
931
- const { registerSharedBars: t, unregisterSharedBars: p } = J.getState();
932
- return t(A, {
977
+ }, [s]), xt(() => {
978
+ const { registerSharedBars: t, unregisterSharedBars: f } = Q.getState();
979
+ return t(C, {
933
980
  appBar: !!i,
934
981
  navigationBar: !!s
935
- }), () => p(A);
936
- }, [A, i, s]);
937
- const jt = r === "PENDING", Tt = b || H === d - 1, dt = !!i, pt = !!s;
938
- mt(() => {
939
- const t = St.current, p = vt.current;
940
- if (!t && !p) return;
941
- const g = () => {
942
- if (!(ct.getState().status === "PUSHING" || ct.getState().status === "POPPING" || ct.getState().status === "REPLACING") || !Tt) {
943
- t?.removeAttribute("data-flemo-bar-riding"), p?.removeAttribute("data-flemo-bar-riding");
982
+ }), () => f(C);
983
+ }, [C, i, s]);
984
+ const Xt = D || M === p - 1, vt = !!i, Tt = !!s;
985
+ xt(() => {
986
+ const t = at.current, f = it.current;
987
+ if (!t && !f) return;
988
+ const v = () => {
989
+ if (!(pt.getState().status === "PUSHING" || pt.getState().status === "POPPING" || pt.getState().status === "REPLACING") || !Xt) {
990
+ t?.removeAttribute("data-flemo-bar-riding"), f?.removeAttribute("data-flemo-bar-riding");
944
991
  return;
945
992
  }
946
- const K = b ? O.getState().histories[d - 1]?.id : O.getState().histories[d]?.id, B = K ? J.getState().sharedBars[K] : void 0, rt = dt && !B?.appBar, it = pt && !B?.navigationBar;
947
- t && t.setAttribute("data-flemo-bar-riding", rt ? "true" : "false"), p && p.setAttribute("data-flemo-bar-riding", it ? "true" : "false");
993
+ const X = D ? O.getState().histories[p - 1]?.id : O.getState().histories[p]?.id, K = X ? Q.getState().sharedBars[X] : void 0, Et = vt && !K?.appBar, nt = Tt && !K?.navigationBar;
994
+ t && t.setAttribute("data-flemo-bar-riding", Et ? "true" : "false"), f && f.setAttribute("data-flemo-bar-riding", nt ? "true" : "false");
948
995
  };
949
- g();
950
- const C = J.subscribe(g), j = ct.subscribe(g);
996
+ v();
997
+ const k = Q.subscribe(v), A = pt.subscribe(v);
951
998
  return () => {
952
- C(), j(), t?.removeAttribute("data-flemo-bar-riding"), p?.removeAttribute("data-flemo-bar-riding");
953
- };
954
- }, [Tt, b, d, dt, pt]), mt(() => {
955
- if (!jt || !Tt || !dt && !pt) return;
956
- const t = X.current;
957
- if (!t) return;
958
- const p = St.current, g = vt.current, C = Pe(l);
959
- if (C.length === 0) return;
960
- const j = C.join(", ");
961
- p && (p.style.willChange = j), g && (g.style.willChange = j);
962
- const z = (rt) => {
963
- if (rt)
964
- for (const it of C) rt.style.removeProperty(it);
965
- };
966
- let K = 0;
967
- const B = () => {
968
- const rt = b ? O.getState().histories[d - 1]?.id : O.getState().histories[d]?.id, it = rt ? J.getState().sharedBars[rt] : void 0, Ft = dt && !it?.appBar, Xt = pt && !it?.navigationBar, Pt = Ft || Xt ? getComputedStyle(t) : null;
969
- if (p)
970
- if (Ft && Pt)
971
- for (const ft of C)
972
- p.style.setProperty(ft, Pt.getPropertyValue(ft));
973
- else
974
- z(p);
975
- if (g)
976
- if (Xt && Pt)
977
- for (const ft of C)
978
- g.style.setProperty(ft, Pt.getPropertyValue(ft));
979
- else
980
- z(g);
981
- K = requestAnimationFrame(B);
982
- };
983
- return B(), () => {
984
- cancelAnimationFrame(K), z(p), z(g), p && p.style.removeProperty("will-change"), g && g.style.removeProperty("will-change");
999
+ k(), A(), t?.removeAttribute("data-flemo-bar-riding"), f?.removeAttribute("data-flemo-bar-riding");
985
1000
  };
986
- }, [
987
- jt,
988
- Tt,
989
- dt,
990
- pt,
991
- b,
992
- d,
993
- l
994
- ]);
995
- const le = (() => {
996
- if (!b) return {};
997
- if (M !== "PUSHING" && M !== "REPLACING") return {};
1001
+ }, [Xt, D, p, vt, Tt]);
1002
+ const de = (() => {
1003
+ if (!D) return {};
1004
+ if (B !== "PUSHING" && B !== "REPLACING") return {};
998
1005
  const t = {};
999
- return typeof w.x == "number" && (t.transform = `translateX(${w.x}px)`), typeof w.x == "string" && (t.transform = `translateX(${w.x})`), typeof w.y == "number" && (t.transform = `translateY(${w.y}px)`), typeof w.y == "string" && (t.transform = `translateY(${w.y})`), typeof w.opacity == "number" && (t.opacity = `${w.opacity}`), t;
1006
+ return typeof g.x == "number" && (t.transform = `translateX(${g.x}px)`), typeof g.x == "string" && (t.transform = `translateX(${g.x})`), typeof g.y == "number" && (t.transform = `translateY(${g.y}px)`), typeof g.y == "string" && (t.transform = `translateY(${g.y})`), typeof g.opacity == "number" && (t.opacity = `${g.opacity}`), t;
1000
1007
  })();
1001
- return /* @__PURE__ */ Ot(
1008
+ return /* @__PURE__ */ Ht(
1002
1009
  "div",
1003
1010
  {
1004
- ref: Bt,
1011
+ ref: Vt,
1005
1012
  style: {
1006
1013
  position: "fixed",
1007
1014
  top: 0,
@@ -1019,7 +1026,7 @@ function Ve({
1019
1026
  overscrollBehavior: "contain"
1020
1027
  },
1021
1028
  children: [
1022
- /* @__PURE__ */ L(
1029
+ /* @__PURE__ */ N(
1023
1030
  "div",
1024
1031
  {
1025
1032
  "data-swipe-at-edge-bar": !0,
@@ -1033,31 +1040,31 @@ function Ve({
1033
1040
  }
1034
1041
  }
1035
1042
  ),
1036
- /* @__PURE__ */ Ot(
1043
+ /* @__PURE__ */ Ht(
1037
1044
  "div",
1038
1045
  {
1039
- ref: X,
1040
- ...N,
1041
- onPointerDown: ce,
1042
- onPointerMove: ue,
1043
- onPointerUp: _t,
1044
- onPointerCancel: _t,
1046
+ ref: V,
1047
+ ...$,
1048
+ onPointerDown: le,
1049
+ onPointerMove: pe,
1050
+ onPointerUp: jt,
1051
+ onPointerCancel: jt,
1045
1052
  "data-flemo-screen": !0,
1046
- "data-flemo-transition": V,
1047
- "data-flemo-status": M,
1048
- "data-flemo-active": b ? "true" : "false",
1053
+ "data-flemo-transition": Y,
1054
+ "data-flemo-status": B,
1055
+ "data-flemo-active": D ? "true" : "false",
1049
1056
  style: {
1050
1057
  display: "flex",
1051
1058
  flexDirection: "column",
1052
1059
  height: "100%",
1053
1060
  backgroundColor: h,
1054
1061
  overflowY: R ? void 0 : "auto",
1055
- touchAction: f === "x" ? "pan-y" : f === "y" ? "pan-x" : "auto",
1056
- ...le,
1057
- ...N.style
1062
+ touchAction: d === "x" ? "pan-y" : d === "y" ? "pan-x" : "auto",
1063
+ ...de,
1064
+ ...$.style
1058
1065
  },
1059
1066
  children: [
1060
- !m && e && /* @__PURE__ */ L("div", { style: { minHeight: e }, children: /* @__PURE__ */ L(
1067
+ !m && e && /* @__PURE__ */ N("div", { style: { minHeight: e }, children: /* @__PURE__ */ N(
1061
1068
  "div",
1062
1069
  {
1063
1070
  style: {
@@ -1065,21 +1072,21 @@ function Ve({
1065
1072
  top: 0,
1066
1073
  width: "100%",
1067
1074
  minHeight: e,
1068
- backgroundColor: o
1075
+ backgroundColor: r
1069
1076
  }
1070
1077
  }
1071
1078
  ) }),
1072
- i && /* @__PURE__ */ L(
1079
+ i && /* @__PURE__ */ N(
1073
1080
  "div",
1074
1081
  {
1075
1082
  style: {
1076
1083
  width: "100%",
1077
- minHeight: G
1084
+ minHeight: U
1078
1085
  }
1079
1086
  }
1080
1087
  ),
1081
- E,
1082
- /* @__PURE__ */ L(
1088
+ T,
1089
+ /* @__PURE__ */ N(
1083
1090
  "div",
1084
1091
  {
1085
1092
  style: {
@@ -1091,25 +1098,25 @@ function Ve({
1091
1098
  children: n
1092
1099
  }
1093
1100
  ),
1094
- T,
1095
- s && /* @__PURE__ */ L(
1101
+ E,
1102
+ s && /* @__PURE__ */ N(
1096
1103
  "div",
1097
1104
  {
1098
1105
  style: {
1099
- display: I ? "none" : void 0,
1106
+ display: b ? "none" : void 0,
1100
1107
  width: "100%",
1101
- minHeight: k
1108
+ minHeight: H
1102
1109
  }
1103
1110
  }
1104
1111
  ),
1105
- !x && a && /* @__PURE__ */ L(
1112
+ !x && a && /* @__PURE__ */ N(
1106
1113
  "div",
1107
1114
  {
1108
1115
  style: {
1109
- display: I ? "none" : void 0,
1116
+ display: b ? "none" : void 0,
1110
1117
  minHeight: a
1111
1118
  },
1112
- children: /* @__PURE__ */ L(
1119
+ children: /* @__PURE__ */ N(
1113
1120
  "div",
1114
1121
  {
1115
1122
  style: {
@@ -1126,14 +1133,14 @@ function Ve({
1126
1133
  ]
1127
1134
  }
1128
1135
  ),
1129
- i && /* @__PURE__ */ L(
1136
+ i && /* @__PURE__ */ N(
1130
1137
  "div",
1131
1138
  {
1132
- ref: St,
1139
+ ref: at,
1133
1140
  "data-flemo-bar": "app",
1134
- "data-flemo-bar-transition": V,
1135
- "data-flemo-bar-status": M,
1136
- "data-flemo-bar-active": b ? "true" : "false",
1141
+ "data-flemo-bar-transition": Y,
1142
+ "data-flemo-bar-status": B,
1143
+ "data-flemo-bar-active": D ? "true" : "false",
1137
1144
  style: {
1138
1145
  position: "fixed",
1139
1146
  top: m ? 0 : e,
@@ -1144,16 +1151,16 @@ function Ve({
1144
1151
  children: i
1145
1152
  }
1146
1153
  ),
1147
- s && /* @__PURE__ */ L(
1154
+ s && /* @__PURE__ */ N(
1148
1155
  "div",
1149
1156
  {
1150
- ref: vt,
1157
+ ref: it,
1151
1158
  "data-flemo-bar": "nav",
1152
- "data-flemo-bar-transition": V,
1153
- "data-flemo-bar-status": M,
1154
- "data-flemo-bar-active": b ? "true" : "false",
1159
+ "data-flemo-bar-transition": Y,
1160
+ "data-flemo-bar-status": B,
1161
+ "data-flemo-bar-active": D ? "true" : "false",
1155
1162
  style: {
1156
- display: I ? "none" : void 0,
1163
+ display: b ? "none" : void 0,
1157
1164
  position: "fixed",
1158
1165
  bottom: x ? 0 : a,
1159
1166
  left: 0,
@@ -1163,8 +1170,8 @@ function Ve({
1163
1170
  children: s
1164
1171
  }
1165
1172
  ),
1166
- S && /* @__PURE__ */ L(Ce, { ref: tt }),
1167
- /* @__PURE__ */ L(
1173
+ w && /* @__PURE__ */ N(He, { ref: z }),
1174
+ /* @__PURE__ */ N(
1168
1175
  "div",
1169
1176
  {
1170
1177
  "data-swipe-at-edge-bar": !0,
@@ -1182,26 +1189,26 @@ function Ve({
1182
1189
  }
1183
1190
  );
1184
1191
  }
1185
- function Ke({ children: n, ...e }) {
1186
- const { isActive: o, isPrev: a, zIndex: u } = ht(), i = O((h) => h.index), s = q((h) => h.status), E = J((h) => h.dragStatus), T = J((h) => h.replaceTransitionStatus), x = !o && (s === "COMPLETED" && E === "IDLE") || a && i - 2 <= u && T === "IDLE" || a && i - 2 > u;
1187
- return /* @__PURE__ */ L(Ae, { freeze: x, children: /* @__PURE__ */ L(Ve, { ...e, children: n }) });
1192
+ function Je({ children: n, ...e }) {
1193
+ const { isActive: r, isPrev: a, zIndex: u } = ht(), i = O((h) => h.index), s = W((h) => h.status), T = Q((h) => h.dragStatus), E = Q((h) => h.replaceTransitionStatus), x = !r && (s === "COMPLETED" && T === "IDLE") || a && i - 2 <= u && E === "IDLE" || a && i - 2 > u;
1194
+ return /* @__PURE__ */ N(Ce, { freeze: x, children: /* @__PURE__ */ N(Ve, { ...e, children: n }) });
1188
1195
  }
1189
1196
  export {
1190
- Fe as Route,
1191
- je as Router,
1192
- Ke as Screen,
1193
- ee as ScreenContext,
1194
- Ce as ScreenDecorator,
1195
- Ae as ScreenFreeze,
1197
+ qe as Route,
1198
+ Fe as Router,
1199
+ Je as Screen,
1200
+ ne as ScreenContext,
1201
+ He as ScreenDecorator,
1202
+ Ce as ScreenFreeze,
1196
1203
  Ve as ScreenMotion,
1197
- Qe as createDecorator,
1198
- Ze as createRawDecorator,
1199
- tn as createRawTransition,
1200
- en as createTransition,
1201
- Xe as useNavigate,
1202
- ze as useParams,
1204
+ tn as createDecorator,
1205
+ en as createRawDecorator,
1206
+ nn as createRawTransition,
1207
+ rn as createTransition,
1208
+ ze as useNavigate,
1209
+ We as useParams,
1203
1210
  ht as useScreen,
1204
- J as useScreenStore,
1205
- qe as useStep,
1211
+ Q as useScreenStore,
1212
+ Ke as useStep,
1206
1213
  Ge as useViewportScrollHeight
1207
1214
  };