@flemo/react 1.0.0 → 1.0.2

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