@flemo/react 2.1.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,25 +1,25 @@
1
- import e, { Activity as t, Children as n, createContext as r, createElement as i, isValidElement as a, useCallback as o, useContext as s, useEffect as c, useId as l, useImperativeHandle as u, useInsertionEffect as d, useLayoutEffect as f, useReducer as ee, useRef as p, useState as m, useSyncExternalStore as te } from "react";
2
- import { ACTIVE_ATTR as ne, ANIM_HOLD as h, ANIM_HOLD_ATTR as g, LAYER_HOST_ATTR as re, LAYER_OWNER_ATTR as ie, LAYER_SLOT_ATTR as ae, OVERLAY_LEVEL as oe, STATUS_ATTR as _, TRANSITION_ATTR as v, animHoldKey as se, appendParamsQuery as ce, attachMorph as le, beginMorphSwipe as y, buildRoutePath as ue, computeBarRiding as de, computeScreenFreeze as fe, computeScreenFreezeMode as pe, consumeSelfInducedPop as b, createAnimHoldCoordinator as x, createBrowserHistoryDriver as S, createBrowserHistoryDriver as me, createDecorator as C, createHistoryStore as w, createMorphTransition as T, createNavigateStore as E, createNavigationController as D, createPartTransition as O, createRawDecorator as k, createRawMorphTransition as A, createRawPartTransition as he, createRawTransition as ge, createRouterScope as j, createScreenSelector as _e, createScreenStore as ve, createStepController as ye, createSwipeController as be, createTransition as xe, createTransitionEngine as Se, createTransitionStore as M, decoratorMap as Ce, eagerlyDecodeImages as we, ensureScopeHistorySync as Te, enteringInitialStyle as Ee, getMatchedPathPattern as N, isDesktopBlink as De, isOpaqueColor as Oe, isServer as ke, markSelfInducedPop as Ae, matchesPathname as je, morphTransitionMap as Me, observeBarHeight as Ne, observeViewportScrollHeight as Pe, partTransitionMap as Fe, publishRideBox as Ie, readStepParams as Le, registerMorphLayer as Re, registerTransitionDefinitions as ze, releaseScopeHistorySync as Be, resolvePlatformProfile as Ve, resolveTransition as He, restLayerPromotionEnabled as Ue, seedRouterEntry as We, sharedBarsMatch as Ge, startFlemoRuntime as Ke, subscribeStepParamsRestore as qe } from "@flemo/core";
3
- import { Fragment as Je, jsx as P, jsxs as Ye } from "react/jsx-runtime";
4
- import { createPortal as Xe, flushSync as Ze } from "react-dom";
1
+ import e, { Activity as t, Children as n, createContext as r, createElement as i, isValidElement as a, useCallback as o, useContext as s, useEffect as c, useId as l, useImperativeHandle as u, useInsertionEffect as d, useLayoutEffect as f, useReducer as ee, useRef as p, useState as m } from "react";
2
+ import { ACTIVE_ATTR as te, ANIM_HOLD as h, ANIM_HOLD_ATTR as ne, LAYER_HOST_ATTR as re, LAYER_OWNER_ATTR as ie, LAYER_SLOT_ATTR as ae, OVERLAY_LEVEL as oe, STATUS_ATTR as se, TRANSITION_ATTR as g, animHoldKey as _, appendParamsQuery as ce, attachMorph as v, beginMorphSwipe as le, buildRoutePath as y, computeBarRiding as ue, computeScreenFreeze as de, computeScreenFreezeMode as b, consumeSelfInducedPop as fe, createAnimHoldCoordinator as x, createBrowserHistoryDriver as S, createBrowserHistoryDriver as pe, createDecorator as C, createHistoryStore as w, createMorphTransition as T, createNavigateStore as E, createNavigationController as me, createPartTransition as D, createRawDecorator as O, createRawMorphTransition as k, createRawPartTransition as A, createRawTransition as he, createRouterScope as ge, createScreenSelector as j, createScreenStore as _e, createStepController as ve, createSwipeController as ye, createTransition as be, createTransitionEngine as xe, createTransitionStore as Se, decoratorMap as Ce, eagerlyDecodeImages as we, ensureScopeHistorySync as M, enteringInitialStyle as Te, getMatchedPathPattern as Ee, isDesktopBlink as De, isOpaqueColor as Oe, isServer as ke, markSelfInducedPop as Ae, matchesPathname as je, morphTransitionMap as Me, observeBarHeight as Ne, observeViewportScrollHeight as Pe, partTransitionMap as Fe, publishRideBox as Ie, readStepParams as Le, registerMorphLayer as Re, registerPartLayer as ze, registerTransitionDefinitions as Be, releaseScopeHistorySync as Ve, resolvePartLayer as He, resolvePlatformProfile as Ue, resolveTransition as We, seedRouterEntry as Ge, sharedBarsMatch as Ke, startFlemoRuntime as qe, subscribeStepParamsRestore as Je } from "@flemo/core";
3
+ import { Fragment as Ye, jsx as N, jsxs as Xe } from "react/jsx-runtime";
4
+ import { createPortal as Ze, flushSync as Qe } from "react-dom";
5
5
  //#region src/stores/StoreContext.ts
6
- var Qe = r(null);
6
+ var $e = r(null);
7
7
  //#endregion
8
8
  //#region src/stores/useStores.ts
9
- function F() {
10
- let e = s(Qe);
9
+ function P() {
10
+ let e = s($e);
11
11
  if (!e) throw Error("flemo stores are missing. Render inside a <Router>.");
12
12
  return e;
13
13
  }
14
14
  //#endregion
15
15
  //#region src/history/HistoryListener.tsx
16
- function $e() {
17
- let e = F();
18
- return c(() => (Te(e), () => Be(e)), [e]), null;
16
+ function et() {
17
+ let e = P();
18
+ return c(() => (M(e), () => Ve(e)), [e]), null;
19
19
  }
20
20
  //#endregion
21
21
  //#region src/screen/ScreenContext.ts
22
- var I = r({
22
+ var tt = r({
23
23
  id: "",
24
24
  isActive: !1,
25
25
  isRoot: !0,
@@ -33,15 +33,15 @@ var I = r({
33
33
  });
34
34
  //#endregion
35
35
  //#region src/screen/useScreen.ts
36
- function L() {
37
- return s(I);
36
+ function F() {
37
+ return s(tt);
38
38
  }
39
39
  //#endregion
40
40
  //#region src/screen/ParamsProvider/ParamsContext.ts
41
- var et = r({}), R = r(() => {});
41
+ var nt = r({}), I = r(() => {});
42
42
  //#endregion
43
43
  //#region src/screen/ParamsProvider/ParamsReducer.ts
44
- function z(e, t) {
44
+ function L(e, t) {
45
45
  switch (t.type) {
46
46
  case "SET": return t.params;
47
47
  default: return e;
@@ -49,10 +49,10 @@ function z(e, t) {
49
49
  }
50
50
  //#endregion
51
51
  //#region src/screen/ParamsProvider/ParamsProvider.tsx
52
- function B({ children: e }) {
53
- let { isActive: t, params: n } = L(), { driver: r } = F(), [i, a] = ee(z, n);
52
+ function R({ children: e }) {
53
+ let { isActive: t, params: n } = F(), { driver: r } = P(), [i, a] = ee(L, n);
54
54
  return c(() => {
55
- if (t) return qe(r, (e) => a({
55
+ if (t) return Je(r, (e) => a({
56
56
  type: "SET",
57
57
  params: e
58
58
  }));
@@ -60,9 +60,9 @@ function B({ children: e }) {
60
60
  t,
61
61
  a,
62
62
  r
63
- ]), /* @__PURE__ */ P(R.Provider, {
63
+ ]), /* @__PURE__ */ N(I.Provider, {
64
64
  value: a,
65
- children: /* @__PURE__ */ P(et.Provider, {
65
+ children: /* @__PURE__ */ N(nt.Provider, {
66
66
  value: i,
67
67
  children: e
68
68
  })
@@ -70,42 +70,42 @@ function B({ children: e }) {
70
70
  }
71
71
  //#endregion
72
72
  //#region ../../node_modules/.pnpm/zustand@5.0.15_@types+react@19.2.18_react@19.2.8/node_modules/zustand/esm/react.mjs
73
- var V = (e) => e;
74
- function H(t, n = V) {
73
+ var z = (e) => e;
74
+ function B(t, n = z) {
75
75
  let r = e.useSyncExternalStore(t.subscribe, e.useCallback(() => n(t.getState()), [t, n]), e.useCallback(() => n(t.getInitialState()), [t, n]));
76
76
  return e.useDebugValue(r), r;
77
77
  }
78
78
  //#endregion
79
79
  //#region src/stores/useHistoryStore.ts
80
- function U(e) {
81
- return H(F().history, e);
80
+ function V(e) {
81
+ return B(P().history, e);
82
82
  }
83
83
  //#endregion
84
84
  //#region src/RouterIdContext.ts
85
- var tt = r(null);
85
+ var rt = r(null);
86
86
  //#endregion
87
87
  //#region src/renderer/Renderer.tsx
88
- function nt({ children: e }) {
89
- let t = U((e) => e.index), r = U((e) => e.histories), i = F(), a = s(I), o = s(tt);
90
- return _e(r, t).map((t) => {
88
+ function it({ children: e }) {
89
+ let t = V((e) => e.index), r = V((e) => e.histories), i = P(), a = s(tt), o = s(rt);
90
+ return j(r, t).map((t) => {
91
91
  let [r] = n.toArray(e).filter((e) => je(e.props.path, t.pathname));
92
- return r ? /* @__PURE__ */ P(I.Provider, {
92
+ return r ? /* @__PURE__ */ N(tt.Provider, {
93
93
  value: {
94
94
  ...t,
95
95
  isPrev: t.isPrev || a.isPrev,
96
96
  navigateStore: i.navigate,
97
97
  routerId: o ?? void 0,
98
- routePath: N(r.props.path, t.pathname)
98
+ routePath: Ee(r.props.path, t.pathname)
99
99
  },
100
- children: /* @__PURE__ */ P(B, { children: r })
100
+ children: /* @__PURE__ */ N(R, { children: r })
101
101
  }, t.id) : null;
102
102
  });
103
103
  }
104
104
  //#endregion
105
105
  //#region src/screen/MorphLayer/MorphLayer.tsx
106
- function rt({ stores: e }) {
106
+ function at({ stores: e }) {
107
107
  let t = p(null);
108
- return f(() => (Re(e.navigate, t.current), () => Re(e.navigate, null)), [e.navigate]), /* @__PURE__ */ P("div", {
108
+ return f(() => (Re(e.navigate, t.current), () => Re(e.navigate, null)), [e.navigate]), /* @__PURE__ */ N("div", {
109
109
  ref: t,
110
110
  "data-flemo-morph-layer": "",
111
111
  "aria-hidden": "true",
@@ -117,15 +117,30 @@ function rt({ stores: e }) {
117
117
  });
118
118
  }
119
119
  //#endregion
120
+ //#region src/screen/PartLayer/PartLayer.tsx
121
+ function ot({ stores: e }) {
122
+ let t = p(null);
123
+ return f(() => (ze(e.navigate, t.current), () => ze(e.navigate, null)), [e.navigate]), /* @__PURE__ */ N("div", {
124
+ ref: t,
125
+ "data-flemo-part-layer": "",
126
+ "aria-hidden": "true",
127
+ style: {
128
+ position: "absolute",
129
+ inset: 0,
130
+ pointerEvents: "none"
131
+ }
132
+ });
133
+ }
134
+ //#endregion
120
135
  //#region src/screen/ScreenViewportContext.ts
121
- var it = r({ contained: !1 });
122
- function at() {
123
- return s(it);
136
+ var st = r({ contained: !1 });
137
+ function ct() {
138
+ return s(st);
124
139
  }
125
140
  //#endregion
126
141
  //#region src/transition/styles.ts
127
- function ot(e, t, n = [], r = []) {
128
- d(() => ze(e, t, n, r), [
142
+ function lt(e, t, n = [], r = []) {
143
+ d(() => Be(e, t, n, r), [
129
144
  e,
130
145
  t,
131
146
  n,
@@ -134,50 +149,50 @@ function ot(e, t, n = [], r = []) {
134
149
  }
135
150
  //#endregion
136
151
  //#region src/utils/devDiagnostics.ts
137
- function st() {
152
+ function ut() {
138
153
  return typeof process < "u" && process.env.NODE_ENV !== "production";
139
154
  }
140
- function ct(e) {
141
- !st() || typeof console > "u" || console.error(`[flemo] ${e}`);
155
+ function dt(e) {
156
+ !ut() || typeof console > "u" || console.error(`[flemo] ${e}`);
142
157
  }
143
- function lt(e) {
144
- if (st()) throw Error(`[flemo] ${e}`);
158
+ function ft(e) {
159
+ if (ut()) throw Error(`[flemo] ${e}`);
145
160
  }
146
161
  //#endregion
147
162
  //#region src/RouterDepthContext.ts
148
- var ut = r(0), dt = r(null), ft = [
163
+ var pt = r(0), mt = r(null), ht = [
149
164
  "current",
150
165
  "parent",
151
166
  "root",
152
167
  "nearest-owner"
153
- ], pt = (e) => ft.includes(e), W = (e) => {
168
+ ], H = (e) => ht.includes(e), U = (e) => {
154
169
  let t = [];
155
170
  for (let n = e; n; n = n.parent) t.push(n);
156
171
  return t;
157
172
  };
158
- function G(e, t, n) {
173
+ function W(e, t, n) {
159
174
  return e.routePaths.length === 0 || e.routePaths.some((e) => e === t) ? !0 : n ? je(e.routePaths, n) : !1;
160
175
  }
161
- function K(e) {
162
- return W(e).map((e, t) => {
176
+ function gt(e) {
177
+ return U(e).map((e, t) => {
163
178
  let n = t === 0 ? "current" : `${t} level(s) up`;
164
179
  return e.name ? `"${e.name}" (${n})` : `<unnamed> (${n})`;
165
180
  }).join(", ");
166
181
  }
167
- function mt({ from: e, target: t, path: n, pathname: r }) {
182
+ function _t({ from: e, target: t, path: n, pathname: r }) {
168
183
  if (t === void 0) return {
169
184
  node: e,
170
185
  message: null
171
186
  };
172
187
  let i = null, a = null;
173
- if (typeof t == "string" ? pt(t) ? i = t : a = t : "scope" in t ? i = t.scope : a = t.name, a !== null) {
174
- let t = W(e).find((e) => e.name === a);
188
+ if (typeof t == "string" ? H(t) ? i = t : a = t : "scope" in t ? i = t.scope : a = t.name, a !== null) {
189
+ let t = U(e).find((e) => e.name === a);
175
190
  return t ? {
176
191
  node: t,
177
192
  message: null
178
193
  } : {
179
194
  node: null,
180
- message: `no <Router name="${a}"> encloses this call. Routers in scope: ${K(e)}.`
195
+ message: `no <Router name="${a}"> encloses this call. Routers in scope: ${gt(e)}.`
181
196
  };
182
197
  }
183
198
  switch (i) {
@@ -189,7 +204,7 @@ function mt({ from: e, target: t, path: n, pathname: r }) {
189
204
  message: "router: \"parent\" was requested, but the enclosing <Router> is the outermost one (it has no parent Router)."
190
205
  };
191
206
  case "root": {
192
- let t = W(e);
207
+ let t = U(e);
193
208
  return {
194
209
  node: t[t.length - 1],
195
210
  message: null
@@ -200,13 +215,13 @@ function mt({ from: e, target: t, path: n, pathname: r }) {
200
215
  node: e,
201
216
  message: "router: \"nearest-owner\" needs a route to search for, and pop() carries none. Falling back to \"current\" — name the Router explicitly for a cross-Router pop."
202
217
  };
203
- let t = W(e).find((e) => G(e, n, r));
218
+ let t = U(e).find((e) => W(e, n, r));
204
219
  return t ? {
205
220
  node: t,
206
221
  message: null
207
222
  } : {
208
223
  node: null,
209
- message: `no <Router> in scope declares a <Route path="${n}">. Routers in scope: ${K(e)}.`
224
+ message: `no <Router> in scope declares a <Route path="${n}">. Routers in scope: ${gt(e)}.`
210
225
  };
211
226
  }
212
227
  default: return {
@@ -215,137 +230,145 @@ function mt({ from: e, target: t, path: n, pathname: r }) {
215
230
  };
216
231
  }
217
232
  }
218
- function ht(e) {
233
+ function G(e) {
219
234
  if (!e.name) return null;
220
235
  for (let t = e.parent; t; t = t.parent) if (t.name === e.name) return t;
221
236
  return null;
222
237
  }
223
238
  //#endregion
224
239
  //#region src/Slot.tsx
225
- var q = { contained: !0 };
226
- function J({ children: e, className: t, style: n }) {
227
- return /* @__PURE__ */ P("div", {
240
+ var K = { contained: !0 };
241
+ function q({ children: e, className: t, style: n }) {
242
+ return /* @__PURE__ */ N("div", {
228
243
  className: t,
229
244
  style: {
230
245
  position: "relative",
231
246
  overflow: "hidden",
232
247
  ...n
233
248
  },
234
- children: /* @__PURE__ */ P(it.Provider, {
235
- value: q,
236
- children: /* @__PURE__ */ P(nt, { children: e })
249
+ children: /* @__PURE__ */ N(st.Provider, {
250
+ value: K,
251
+ children: /* @__PURE__ */ N(it, { children: e })
237
252
  })
238
253
  });
239
254
  }
240
255
  //#endregion
241
256
  //#region src/Router.tsx
242
- function gt(e) {
257
+ function J(e) {
243
258
  let t = null;
244
259
  return n.forEach(e, (e) => {
245
260
  if (t || !a(e)) return;
246
- if (e.type === J) {
261
+ if (e.type === q) {
247
262
  t = n.toArray(e.props.children).filter(a);
248
263
  return;
249
264
  }
250
265
  let r = e.props.children;
251
266
  if (r) {
252
- let e = gt(r);
267
+ let e = J(r);
253
268
  e && (t = e);
254
269
  }
255
270
  }), t;
256
271
  }
257
- var _t = typeof window > "u" ? c : f, vt = typeof window > "u" ? c : d, yt = [], Y = [], bt = [], xt = [], X = { contained: !0 };
258
- function St({ children: e, name: t, strictRoutes: r = !1, initPath: i = "/", defaultTransitionName: o = "cupertino", transitions: u = yt, decorators: d = Y, partTransitions: f = bt, morphTransitions: ee = xt, history: p = "browser", createDriver: te, className: ne, style: h }) {
259
- let g = s(ut), re = l(), [ie, ae] = m(!1);
260
- c(() => ae(!0), []);
261
- let oe = ie ? re : null, _ = g > 0, v = p === "memory", se = l(), ce = s(I), le = s(Qe), y = _ && ce.id ? `_F_${le?.routerKey ?? ""}${ce.id}_` : se, ue = gt(e), de = ue !== null, fe = (ue ?? n.toArray(e).filter(a)).flatMap((e) => e.props?.path ? [e.props.path].flat() : []), pe = _ ? null : le, b = pe !== null, x = te ?? me, [S] = m(() => v ? null : x(b ? void 0 : y)), C = !_ && !v && !ke(), w = C && S ? S.readPathname() : i || "/", T = w.indexOf("?"), E = (T >= 0 ? w.slice(0, T) : w) || "/", D = C ? window.location.search : T >= 0 ? w.slice(T) : "", [O] = m(() => j({
262
- routePaths: fe,
263
- pathname: E,
272
+ var vt = typeof window > "u" ? c : f, yt = typeof window > "u" ? c : d, Y = [], bt = [], xt = [], X = [], St = { contained: !0 };
273
+ function Ct({ children: e, name: t, strictRoutes: r = !1, initPath: i = "/", defaultTransitionName: o = "cupertino", transitions: u = Y, decorators: d = bt, partTransitions: f = xt, morphTransitions: ee = X, history: p = "browser", createDriver: te, className: h, style: ne }) {
274
+ let re = s(pt), ie = l(), [ae, oe] = m(!1);
275
+ c(() => oe(!0), []);
276
+ let se = ae ? ie : null, g = re > 0, _ = p === "memory", ce = l(), v = s(tt), le = s($e), y = g && v.id ? `_F_${le?.routerKey ?? ""}${v.id}_` : ce, ue = J(e), de = ue !== null, b = (ue ?? n.toArray(e).filter(a)).flatMap((e) => e.props?.path ? [e.props.path].flat() : []), fe = g ? null : le, x = fe !== null, S = te ?? pe, [C] = m(() => _ ? null : S(x ? void 0 : y)), w = !g && !_ && !ke(), T = w && C ? C.readPathname() : i || "/", E = T.indexOf("?"), me = (E >= 0 ? T.slice(0, E) : T) || "/", D = w ? window.location.search : E >= 0 ? T.slice(E) : "", [O] = m(() => ge({
277
+ routePaths: b,
278
+ pathname: me,
264
279
  search: D,
265
280
  defaultTransitionName: o,
266
- memory: v,
267
- browserDriver: S,
268
- hostedScope: pe,
269
- routerKey: b ? void 0 : y,
270
- zoneEntryId: _ && !b && ce.id || void 0,
271
- persistKey: _ && !v && !b ? y : void 0
281
+ memory: _,
282
+ browserDriver: C,
283
+ hostedScope: fe,
284
+ routerKey: x ? void 0 : y,
285
+ zoneEntryId: g && !x && v.id || void 0,
286
+ persistKey: g && !_ && !x ? y : void 0
272
287
  }));
273
- _t(() => {
288
+ vt(() => {
274
289
  O.transition.getState().defaultTransitionName !== o && O.transition.setState({ defaultTransitionName: o });
275
290
  });
276
- let k = s(dt), [A] = m(() => ({
291
+ let k = s(mt), [A] = m(() => ({
277
292
  name: t,
278
293
  stores: O,
279
- routePaths: fe,
294
+ routePaths: b,
280
295
  strictRoutes: r,
281
296
  parent: k,
282
- depth: g
297
+ depth: re
283
298
  }));
284
- vt(() => {
285
- A.name = t, A.stores = O, A.routePaths = fe, A.strictRoutes = r, A.parent = k;
299
+ yt(() => {
300
+ A.name = t, A.stores = O, A.routePaths = b, A.strictRoutes = r, A.parent = k;
286
301
  }), c(() => {
287
- ht(A) && ct(`duplicate <Router name="${A.name}">: an enclosing <Router> already uses that name, so \`router\` targets resolve to the nearer one. Give each nested Router a unique name.`);
288
- }, [A, t]), _t(() => (O.life.alive = !0, () => {
302
+ G(A) && dt(`duplicate <Router name="${A.name}">: an enclosing <Router> already uses that name, so \`router\` targets resolve to the nearer one. Give each nested Router a unique name.`);
303
+ }, [A, t]), vt(() => (O.life.alive = !0, () => {
289
304
  O.life.alive = !1;
290
- }), [O]), ot(u, d, f, ee), c(() => Ke(), []), c(() => {
291
- v || !S || We({
292
- driver: S,
293
- routerKey: b ? null : y,
294
- nested: _ && !b,
295
- seedPathname: E,
305
+ }), [O]), lt(u, d, f, ee), c(() => qe(), []), c(() => {
306
+ _ || !C || Ge({
307
+ driver: C,
308
+ routerKey: x ? null : y,
309
+ nested: g && !x,
310
+ seedPathname: me,
296
311
  defaultTransitionName: o,
297
312
  rootParams: O.history.getState().histories[0]?.params ?? {}
298
313
  });
299
314
  }, [
300
- v,
301
- b,
302
315
  _,
316
+ x,
317
+ g,
303
318
  y,
304
- E,
319
+ me,
305
320
  o,
306
321
  O.history,
307
- S
322
+ C
308
323
  ]);
309
- let he = de ? e : /* @__PURE__ */ P(nt, { children: e }), ge = /* @__PURE__ */ P(tt.Provider, {
310
- value: oe,
311
- children: /* @__PURE__ */ P(ut.Provider, {
312
- value: g + 1,
313
- children: /* @__PURE__ */ P(dt.Provider, {
324
+ let he = de ? e : /* @__PURE__ */ N(it, { children: e }), j = /* @__PURE__ */ N(rt.Provider, {
325
+ value: se,
326
+ children: /* @__PURE__ */ N(pt.Provider, {
327
+ value: re + 1,
328
+ children: /* @__PURE__ */ N(mt.Provider, {
314
329
  value: A,
315
- children: /* @__PURE__ */ Ye(Qe.Provider, {
330
+ children: /* @__PURE__ */ Xe($e.Provider, {
316
331
  value: O,
317
- children: [/* @__PURE__ */ P($e, {}), _ ? /* @__PURE__ */ P(it.Provider, {
318
- value: X,
332
+ children: [/* @__PURE__ */ N(et, {}), g ? /* @__PURE__ */ N(st.Provider, {
333
+ value: St,
319
334
  children: he
320
335
  }) : he]
321
336
  })
322
337
  })
323
338
  })
324
339
  });
325
- return _ ? /* @__PURE__ */ Ye("div", {
326
- className: ne,
340
+ return g ? /* @__PURE__ */ Xe("div", {
341
+ className: h,
327
342
  style: {
328
343
  position: "relative",
329
344
  overflow: "hidden",
330
- ...h
345
+ ...ne
331
346
  },
332
- children: [ge, /* @__PURE__ */ P(rt, { stores: O })]
333
- }) : /* @__PURE__ */ Ye(Je, { children: [ge, /* @__PURE__ */ P(rt, { stores: O })] });
347
+ children: [
348
+ j,
349
+ /* @__PURE__ */ N(at, { stores: O }),
350
+ /* @__PURE__ */ N(ot, { stores: O })
351
+ ]
352
+ }) : /* @__PURE__ */ Xe(Ye, { children: [
353
+ j,
354
+ /* @__PURE__ */ N(at, { stores: O }),
355
+ /* @__PURE__ */ N(ot, { stores: O })
356
+ ] });
334
357
  }
335
358
  //#endregion
336
359
  //#region src/Route.tsx
337
- function Ct({ element: e }) {
360
+ function wt({ element: e }) {
338
361
  return e;
339
362
  }
340
363
  //#endregion
341
364
  //#region src/utils/buildRoutePath.ts
342
- function wt(e, t) {
343
- return ue(e, t);
365
+ function Tt(e, t) {
366
+ return y(e, t);
344
367
  }
345
368
  //#endregion
346
369
  //#region src/navigate/useNavigate.ts
347
- function Tt(e) {
348
- let t = F(), n = s(dt) ?? {
370
+ function Et(e) {
371
+ let t = P(), n = s(mt) ?? {
349
372
  stores: t,
350
373
  routePaths: [],
351
374
  strictRoutes: !1,
@@ -354,24 +377,24 @@ function Tt(e) {
354
377
  }, r = (t, r, i) => {
355
378
  let a = t ?? e?.router, o;
356
379
  if (r) try {
357
- o = wt(r, i).toPathname;
380
+ o = Tt(r, i).toPathname;
358
381
  } catch {
359
382
  o = void 0;
360
383
  }
361
- let { node: s, message: c } = mt({
384
+ let { node: s, message: c } = _t({
362
385
  from: n,
363
386
  target: a,
364
387
  path: r,
365
388
  pathname: o
366
389
  });
367
- if (!s) return lt(c ?? "the requested Router could not be resolved."), null;
368
- if (c && ct(c), r && !G(s, r, o)) {
390
+ if (!s) return ft(c ?? "the requested Router could not be resolved."), null;
391
+ if (c && dt(c), r && !W(s, r, o)) {
369
392
  let e = `"${r}" is not declared by ${s.name ? `<Router name="${s.name}">` : "the target <Router>"}, so the navigation cannot mount a screen there. Declare a matching <Route>, target the Router that owns it, or use \`router: "nearest-owner"\`.`;
370
- a !== void 0 || s.strictRoutes ? lt(e) : ct(e);
393
+ a !== void 0 || s.strictRoutes ? ft(e) : dt(e);
371
394
  }
372
- return D({
395
+ return me({
373
396
  stores: s.stores,
374
- buildPathname: (e, t) => wt(e, t),
397
+ buildPathname: (e, t) => Tt(e, t),
375
398
  driver: s.stores.driver,
376
399
  markSelfInduced: s.stores.markSelfInduced
377
400
  });
@@ -393,21 +416,21 @@ function Tt(e) {
393
416
  }
394
417
  //#endregion
395
418
  //#region src/navigate/usePathname.ts
396
- function Et() {
397
- return U((e) => e.histories[e.pendingIndex]?.pathname ?? "/");
419
+ function Dt() {
420
+ return V((e) => e.histories[e.pendingIndex]?.pathname ?? "/");
398
421
  }
399
422
  //#endregion
400
423
  //#region src/navigate/useStep.ts
401
- function Dt() {
402
- let { routePath: e } = L(), t = F(), n = s(R), { driver: r, markSelfInduced: i } = t, [a, o] = m(null);
424
+ function Ot() {
425
+ let { routePath: e } = F(), t = P(), n = s(I), { driver: r, markSelfInduced: i } = t, [a, o] = m(null);
403
426
  c(() => {
404
427
  if (!e) return o(Le(r.readState())), r.subscribe((e) => o(Le(e.state)));
405
428
  }, [e, r]);
406
- let l = ye({
429
+ let l = ve({
407
430
  stores: t,
408
431
  driver: r,
409
432
  markSelfInduced: i,
410
- buildStepPathname: (t) => e ? wt(e, t).pathname : ce(r.readPathname(), t),
433
+ buildStepPathname: (t) => e ? Tt(e, t).pathname : ce(r.readPathname(), t),
411
434
  applyParams: (t) => {
412
435
  n({
413
436
  type: "SET",
@@ -424,13 +447,13 @@ function Dt() {
424
447
  }
425
448
  //#endregion
426
449
  //#region src/screen/ParamsProvider/useParams.ts
427
- function Ot() {
428
- return s(et);
450
+ function kt() {
451
+ return s(nt);
429
452
  }
430
453
  //#endregion
431
454
  //#region src/screen/ScreenFreeze.tsx
432
- var kt = 3e3;
433
- function At({ freeze: e, mode: n = "deferred", children: r }) {
455
+ var At = 3e3;
456
+ function Z({ freeze: e, mode: n = "deferred", children: r }) {
434
457
  let [i, a] = m(e), o = p(null);
435
458
  return !e && i && a(!1), c(() => {
436
459
  if (!(!e || i)) {
@@ -440,7 +463,7 @@ function At({ freeze: e, mode: n = "deferred", children: r }) {
440
463
  }
441
464
  return o.current = setTimeout(() => {
442
465
  o.current = null, a(!0);
443
- }, kt), () => {
466
+ }, At), () => {
444
467
  o.current !== null && (clearTimeout(o.current), o.current = null);
445
468
  };
446
469
  }
@@ -448,7 +471,7 @@ function At({ freeze: e, mode: n = "deferred", children: r }) {
448
471
  e,
449
472
  i,
450
473
  n
451
- ]), /* @__PURE__ */ P(t, {
474
+ ]), /* @__PURE__ */ N(t, {
452
475
  mode: e && i ? "hidden" : "visible",
453
476
  children: r
454
477
  });
@@ -460,28 +483,28 @@ function Mt() {
460
483
  return s(jt);
461
484
  }
462
485
  var Nt = r(null);
463
- function Z() {
486
+ function Pt() {
464
487
  return s(Nt);
465
488
  }
466
489
  //#endregion
467
490
  //#region src/screen/scopeAnimHoldCoordinator.ts
468
- var Pt = /* @__PURE__ */ new WeakMap();
469
- function Ft(e) {
470
- let t = Pt.get(e);
471
- return t || (t = x(), Pt.set(e, t)), t;
491
+ var Ft = /* @__PURE__ */ new WeakMap();
492
+ function It(e) {
493
+ let t = Ft.get(e);
494
+ return t || (t = x(), Ft.set(e, t)), t;
472
495
  }
473
496
  //#endregion
474
497
  //#region src/stores/useNavigateStore.ts
475
- function It(e) {
476
- return H(F().navigate, e);
498
+ function Lt(e) {
499
+ return B(P().navigate, e);
477
500
  }
478
501
  //#endregion
479
502
  //#region src/screen/ScreenDecorator.tsx
480
- function Lt({ ref: e, style: t, ...n }) {
481
- let { isActive: r, isPrev: i, transitionName: a } = L(), o = p(null);
503
+ function Rt({ ref: e, style: t, ...n }) {
504
+ let { isActive: r, isPrev: i, transitionName: a } = F(), o = p(null);
482
505
  u(e, () => o.current);
483
- let s = It((e) => i ? "COMPLETED" : e.status), c = He(a), { decoratorName: l } = c, d = Ce.get(l);
484
- return d ? /* @__PURE__ */ P("div", {
506
+ let s = Lt((e) => i ? "COMPLETED" : e.status), c = We(a), { decoratorName: l } = c, d = Ce.get(l);
507
+ return d ? /* @__PURE__ */ N("div", {
485
508
  ref: o,
486
509
  "data-flemo-decorator": !0,
487
510
  "data-flemo-decorator-name": d.name,
@@ -502,7 +525,7 @@ function Lt({ ref: e, style: t, ...n }) {
502
525
  }
503
526
  //#endregion
504
527
  //#region src/screen/useViewportScrollHeight.ts
505
- function Rt() {
528
+ function zt() {
506
529
  let [e, t] = m(0), [n, r] = m(0);
507
530
  return c(() => Pe((e, n) => {
508
531
  r(n), t(e);
@@ -512,105 +535,100 @@ function Rt() {
512
535
  };
513
536
  }
514
537
  //#endregion
515
- //#region src/utils/useHydrationSafeFlag.ts
516
- var zt = () => () => {}, Bt = () => !1;
517
- function Vt(e) {
518
- return te(zt, e, Bt);
519
- }
520
- //#endregion
521
538
  //#region src/stores/useScreenStore.ts
522
539
  function Q(e) {
523
- return H(F().screen, e);
540
+ return B(P().screen, e);
524
541
  }
525
542
  //#endregion
526
543
  //#region src/screen/ScreenMotion.tsx
527
- function Ht({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigationBarHeight: r, systemNavigationBarColor: i, sharedTopBar: a, sharedTopBarId: l, sharedBottomBar: u, sharedBottomBarId: d, topBar: ee, bottomBar: te, hideStatusBar: ie, hideSystemNavigationBar: ae, backgroundColor: ce = "white", contentScrollable: le = !0, paintHidden: ue = !1, ...pe }) {
528
- let { id: b, isActive: x, isRoot: S, isPrev: me, zIndex: C, transitionName: w, prevTransitionName: T } = L(), { contained: E } = at(), D = E ? "absolute" : "fixed", O = F(), k = s(tt), A = U((e) => e.index), he = U((e) => e.histories), ge = x || C === A - 1, j = It((e) => ge ? e.status : "COMPLETED"), _e = Q((e) => e.dragStatus), ve = Q((e) => e.replaceTransitionStatus), ye = O.screen.getState().setDragStatus, xe = O.screen.getState().setReplaceTransitionStatus, M = x ? he[A - 1]?.id : he[A]?.id, Te = Q((e) => M ? e.sharedBars[M] : void 0), N = Q((e) => M ? e.sharedBarMetadata[M] : void 0), De = Q((e) => M ? e.screenSurfaces[M] : void 0), ke = p(null);
529
- ke.current ||= Se({
544
+ function Bt({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigationBarHeight: r, systemNavigationBarColor: i, sharedTopBar: a, sharedTopBarId: l, sharedBottomBar: u, sharedBottomBarId: d, topBar: ee, bottomBar: ie, hideStatusBar: ae, hideSystemNavigationBar: ce, backgroundColor: v = "white", contentScrollable: y = !0, paintHidden: b = !1, ...fe }) {
545
+ let { id: x, isActive: S, isRoot: pe, isPrev: C, zIndex: w, transitionName: T, prevTransitionName: E } = F(), { contained: me } = ct(), D = me ? "absolute" : "fixed", O = P(), k = s(rt), A = V((e) => e.index), he = V((e) => e.histories), ge = S || w === A - 1, j = Lt((e) => ge ? e.status : "COMPLETED"), _e = Q((e) => e.dragStatus), ve = Q((e) => e.replaceTransitionStatus), be = O.screen.getState().setDragStatus, Se = O.screen.getState().setReplaceTransitionStatus, M = S ? he[A - 1]?.id : he[A]?.id, Ee = Q((e) => M ? e.sharedBars[M] : void 0), De = Q((e) => M ? e.sharedBarMetadata[M] : void 0), ke = Q((e) => M ? e.screenSurfaces[M] : void 0), Ae = p(null);
546
+ Ae.current ||= xe({
530
547
  getTransitionTaskId: () => O.navigate.getState().transitionTaskId,
531
- setDragStatus: ye,
532
- setReplaceTransitionStatus: xe
548
+ setDragStatus: be,
549
+ setReplaceTransitionStatus: Se
533
550
  });
534
- let Ae = ke.current, je = p(null);
535
- je.current ||= Ft(O.navigate);
536
- let Me = He(w), { initial: Pe, swipeDirection: Fe, decoratorName: Le } = Me, Re = Ce.get(Le), { viewportScrollHeight: ze } = Rt(), Be = ze > 0, [We, Ke] = m(null), qe = Mt(), Je = qe ?? We, Qe = p(/* @__PURE__ */ new Set()), [$e, I] = m(!1), et = o((e) => {
537
- let t = Qe.current;
538
- e ? t.add(e) : t.clear(), I(t.size > 0);
539
- }, []), R = !!a, z = !!u, B = R ? `${typeof l}:${String(l)}` : null, V = z ? `${typeof d}:${String(d)}` : null, [H, nt] = m({
540
- key: B,
551
+ let je = Ae.current, Me = p(null);
552
+ Me.current ||= It(O.navigate);
553
+ let Pe = We(T), { initial: Fe, swipeDirection: Le, decoratorName: Re } = Pe, ze = Ce.get(Re), { viewportScrollHeight: Be } = zt(), Ve = Be > 0, [Ge, qe] = m(null), Je = Mt(), Ye = Je ?? Ge, $e = p(/* @__PURE__ */ new Set()), [et, tt] = m(!1), nt = o((e) => {
554
+ let t = $e.current;
555
+ e ? t.add(e) : t.clear(), tt(t.size > 0);
556
+ }, []), I = !!a, L = !!u, R = I ? `${typeof l}:${String(l)}` : null, z = L ? `${typeof d}:${String(d)}` : null, [B, it] = m({
557
+ key: R,
541
558
  height: 0
542
- }), [rt, it] = m({
543
- key: V,
559
+ }), [at, ot] = m({
560
+ key: z,
544
561
  height: 0
545
- }), ot = p(H), st = p(rt), ct = H.key === B ? H.height : 0, lt = rt.key === V ? rt.height : 0, ut = Ge(R ? { id: l } : void 0, N?.topBar) ? N?.topBar?.height ?? 0 : 0, dt = Ge(z ? { id: d } : void 0, N?.bottomBar) ? N?.bottomBar?.height ?? 0 : 0, ft = ct || ut, pt = lt || dt, W = p(null), G = p(null), K = p(null), mt = p(null), ht = p(null), q = p(null), J = p(null), gt = o((e) => {
546
- e <= 0 || B === null || (mt.current && (mt.current.style.minHeight = `${e}px`), ot.current = {
547
- key: B,
562
+ }), st = p(B), lt = p(at), ut = B.key === R ? B.height : 0, dt = at.key === z ? at.height : 0, ft = Ke(I ? { id: l } : void 0, De?.topBar) ? De?.topBar?.height ?? 0 : 0, pt = Ke(L ? { id: d } : void 0, De?.bottomBar) ? De?.bottomBar?.height ?? 0 : 0, mt = ut || ft, ht = dt || pt, H = p(null), U = p(null), W = p(null), gt = p(null), _t = p(null), G = p(null), K = p(null), q = o((e) => {
563
+ e <= 0 || R === null || (gt.current && (gt.current.style.minHeight = `${e}px`), st.current = {
564
+ key: R,
548
565
  height: e
549
- }, nt((t) => t.key === B && t.height === e ? t : {
550
- key: B,
566
+ }, it((t) => t.key === R && t.height === e ? t : {
567
+ key: R,
551
568
  height: e
552
- }), O.screen.getState().updateSharedBarHeight(b, "topBar", e));
569
+ }), O.screen.getState().updateSharedBarHeight(x, "topBar", e));
553
570
  }, [
554
- b,
571
+ x,
555
572
  O.screen,
556
- B
557
- ]), _t = o((e) => {
558
- e <= 0 || V === null || (ht.current && (ht.current.style.minHeight = `${e}px`), st.current = {
559
- key: V,
573
+ R
574
+ ]), J = o((e) => {
575
+ e <= 0 || z === null || (_t.current && (_t.current.style.minHeight = `${e}px`), lt.current = {
576
+ key: z,
560
577
  height: e
561
- }, it((t) => t.key === V && t.height === e ? t : {
562
- key: V,
578
+ }, ot((t) => t.key === z && t.height === e ? t : {
579
+ key: z,
563
580
  height: e
564
- }), O.screen.getState().updateSharedBarHeight(b, "bottomBar", e));
581
+ }), O.screen.getState().updateSharedBarHeight(x, "bottomBar", e));
565
582
  }, [
566
- V,
567
- b,
583
+ z,
584
+ x,
568
585
  O.screen
569
586
  ]), vt = o((e) => {
570
- q.current = e, e?.offsetHeight && gt(e.offsetHeight);
571
- }, [gt]), yt = o((e) => {
572
- J.current = e, e?.offsetHeight && _t(e.offsetHeight);
573
- }, [_t]), Y = p({
574
- transition: Me,
575
- decorator: Re,
587
+ G.current = e, e?.offsetHeight && q(e.offsetHeight);
588
+ }, [q]), yt = o((e) => {
589
+ K.current = e, e?.offsetHeight && J(e.offsetHeight);
590
+ }, [J]), Y = p({
591
+ transition: Pe,
592
+ decorator: ze,
576
593
  hasSharedTopBar: !!a,
577
594
  hasSharedBottomBar: !!u,
578
595
  sharedTopBarId: l,
579
596
  sharedBottomBarId: d,
580
- viewportScrollHeight: ze,
581
- isRoot: S,
582
- isActive: x,
597
+ viewportScrollHeight: Be,
598
+ isRoot: pe,
599
+ isActive: S,
583
600
  status: j,
584
601
  dragStatus: _e,
585
602
  index: A
586
603
  });
587
604
  Y.current = {
588
- transition: Me,
589
- decorator: Re,
605
+ transition: Pe,
606
+ decorator: ze,
590
607
  hasSharedTopBar: !!a,
591
608
  hasSharedBottomBar: !!u,
592
609
  sharedTopBarId: l,
593
610
  sharedBottomBarId: d,
594
- viewportScrollHeight: ze,
595
- isRoot: S,
596
- isActive: x,
611
+ viewportScrollHeight: Be,
612
+ isRoot: pe,
613
+ isActive: S,
597
614
  status: j,
598
615
  dragStatus: _e,
599
616
  index: A
600
617
  };
601
618
  let bt = p(null), xt = p(null);
602
- bt.current ||= be({
619
+ bt.current ||= ye({
603
620
  getTransition: () => Y.current.transition,
604
621
  getDecorator: () => Y.current.decorator,
605
622
  getElements: () => ({
606
- scope: G.current,
607
- screenContainer: W.current,
608
- decorator: K.current,
609
- sharedTopBar: q.current,
610
- sharedBottomBar: J.current
623
+ scope: U.current,
624
+ screenContainer: H.current,
625
+ decorator: W.current,
626
+ sharedTopBar: G.current,
627
+ sharedBottomBar: K.current
611
628
  }),
612
629
  hasSharedTopBar: () => Y.current.hasSharedTopBar,
613
630
  hasSharedBottomBar: () => Y.current.hasSharedBottomBar,
631
+ getPartLayer: () => He(O.navigate),
614
632
  getSharedTopBarId: () => Y.current.sharedTopBarId,
615
633
  getSharedBottomBarId: () => Y.current.sharedBottomBarId,
616
634
  getViewportScrollHeight: () => Y.current.viewportScrollHeight,
@@ -626,10 +644,10 @@ function Ht({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
626
644
  let e = Y.current, t = O.history.getState().histories, n = e.isActive ? t[e.index - 1]?.id : t[e.index]?.id;
627
645
  return n ? O.screen.getState().sharedBarMetadata[n] : void 0;
628
646
  },
629
- setDragStatus: ye,
647
+ setDragStatus: be,
630
648
  back: () => O.driver.back(),
631
649
  onDragStart: () => {
632
- xt.current = y(O.navigate, "POPPING");
650
+ xt.current = le(O.navigate, "POPPING");
633
651
  },
634
652
  onDragProgress: (e) => {
635
653
  xt.current?.scrub(e);
@@ -642,9 +660,9 @@ function Ht({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
642
660
  (j === "PUSHING" || j === "REPLACING") && (e.preventDefault(), e.stopPropagation());
643
661
  };
644
662
  c(() => {
645
- we(G.current);
663
+ we(U.current);
646
664
  }, []), c(() => {
647
- let e = G.current;
665
+ let e = U.current;
648
666
  if (!e) return;
649
667
  let t = (e) => {
650
668
  X.shouldPreventTouch() && e.preventDefault();
@@ -653,156 +671,163 @@ function Ht({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
653
671
  e.removeEventListener("touchmove", t), X.abandon();
654
672
  };
655
673
  }, [X]), f(() => {
656
- let { registerSharedBars: e, unregisterSharedBars: t } = O.screen.getState(), n = ot.current, r = st.current;
657
- return e(b, {
658
- topBar: R,
659
- bottomBar: z
674
+ let { registerSharedBars: e, unregisterSharedBars: t } = O.screen.getState(), n = st.current, r = lt.current;
675
+ return e(x, {
676
+ topBar: I,
677
+ bottomBar: L
660
678
  }, {
661
- topBar: R ? {
679
+ topBar: I ? {
662
680
  id: l,
663
- height: n.key === B ? n.height : void 0
681
+ height: n.key === R ? n.height : void 0
664
682
  } : void 0,
665
- bottomBar: z ? {
683
+ bottomBar: L ? {
666
684
  id: d,
667
- height: r.key === V ? r.height : void 0
685
+ height: r.key === z ? r.height : void 0
668
686
  } : void 0
669
- }), () => t(b);
687
+ }), () => t(x);
670
688
  }, [
671
- V,
672
689
  z,
673
- R,
674
- b,
690
+ L,
691
+ I,
692
+ x,
675
693
  d,
676
694
  l,
677
695
  O.screen,
678
- B
696
+ R
679
697
  ]), f(() => {
680
- let e = q.current;
681
- if (e) return Ne(e, gt);
682
- }, [gt, R]), f(() => {
683
- let e = J.current;
684
- if (e) return Ne(e, _t);
685
- }, [_t, z]), f(() => {
686
- let e = W.current;
687
- if (e && !(!R && !z)) return Ie(e);
688
- }, [z, R]), f(() => {
689
698
  let e = G.current;
699
+ if (e) return Ne(e, q);
700
+ }, [q, I]), f(() => {
701
+ let e = K.current;
702
+ if (e) return Ne(e, J);
703
+ }, [J, L]), f(() => {
704
+ let e = H.current;
705
+ if (e && !(!I && !L)) return Ie(e);
706
+ }, [L, I]), f(() => {
707
+ let e = U.current;
690
708
  if (!e) return;
691
709
  let { registerScreenSurface: t, unregisterScreenSurface: n } = O.screen.getState();
692
- return t(b, { opaqueBackground: Oe(getComputedStyle(e).backgroundColor) }), () => n(b);
710
+ return t(x, { opaqueBackground: Oe(getComputedStyle(e).backgroundColor) }), () => n(x);
693
711
  }, [
694
- b,
695
- ce,
712
+ x,
713
+ v,
696
714
  j,
697
715
  O.screen
698
716
  ]);
699
- let Ot = ge, { app: kt, nav: At } = de({
717
+ let Ot = ge, { app: kt, nav: At } = ue({
700
718
  status: j,
701
719
  isTopOrTopPrev: Ot,
702
- hasTopBar: R,
703
- hasNavBar: z,
720
+ hasTopBar: I,
721
+ hasNavBar: L,
704
722
  topBarId: l,
705
723
  bottomBarId: d,
706
- partnerBars: Te,
707
- partnerMetadata: N
708
- }), Z = se({
724
+ partnerBars: Ee,
725
+ partnerMetadata: De
726
+ }), Z = _({
709
727
  status: j,
710
728
  isTopOrTopPrev: Ot,
711
- transitionName: w
712
- }), Pt = fe({
713
- isActive: x,
714
- isPrev: me,
715
- zIndex: C,
729
+ transitionName: T
730
+ }), Pt = de({
731
+ isActive: S,
732
+ isPrev: C,
733
+ zIndex: w,
716
734
  index: A,
717
735
  status: j,
718
736
  dragStatus: _e,
719
737
  replaceTransitionStatus: ve
720
- }), zt = p(Pt), Bt = p(Z !== null && Pt), Ht = p(null), [Ut, Wt] = m({
738
+ }), Ft = p(Pt), Bt = p(Z !== null && Pt), Vt = p(null), Ht = p(null), Ut = p(!1);
739
+ Z === null && (Ut.current = !0);
740
+ let Wt = !Ut.current, [Gt, Kt] = m({
721
741
  key: Z,
722
742
  released: Z === null
723
743
  });
724
- Ut.key !== Z && (Wt({
744
+ Gt.key !== Z && (Kt({
725
745
  key: Z,
726
746
  released: Z === null
727
- }), Ht.current = null, Bt.current = Z !== null && zt.current), zt.current = Pt;
728
- let Gt = Z !== null && Ut.key === Z && !Ut.released && Ht.current !== Z, $ = Gt ? !x && De?.opaqueBackground ? h.PARK : x && (j === "PUSHING" || j === "REPLACING") && De?.opaqueBackground ? Ve().parkOver ? h.PARK_OVER : h.PARK_UNDER : h.HELD : h.RELEASED, Kt = {
729
- zIndex: C,
730
- paintHidden: ue,
731
- transitionName: w,
747
+ }), Vt.current = null, Ht.current = null, Bt.current = Z !== null && Ft.current), Ft.current = Pt;
748
+ let qt = Z !== null && Gt.key === Z && !Gt.released && Vt.current !== Z, $ = qt ? !S && ke?.opaqueBackground ? h.PARK : S && (j === "PUSHING" || j === "REPLACING") && ke?.opaqueBackground ? Ue().parkOver ? h.PARK_OVER : h.PARK_UNDER : h.HELD : h.RELEASED;
749
+ Ht.current !== Z && ($ === h.PARK_OVER || $ === h.PARK) && (Ht.current = Z);
750
+ let Jt = Z !== null && Ht.current === Z, Yt = {
751
+ zIndex: w,
752
+ paintHidden: b,
753
+ transitionName: T,
732
754
  status: j,
733
- isActive: x,
755
+ isActive: S,
734
756
  animHold: $,
735
- rendersHost: !qe,
736
- screenId: b,
737
- registerSlot: et
738
- }, qt = Vt(Ue);
739
- f(() => Ae.driveScreenLifecycle({
757
+ rendersHost: !Je,
758
+ screenId: x,
759
+ registerSlot: nt
760
+ };
761
+ f(() => je.driveScreenLifecycle({
740
762
  getElements: () => ({
741
- scope: G.current,
742
- decorator: K.current,
743
- bars: [q.current, J.current],
744
- screenContainer: W.current
763
+ scope: U.current,
764
+ decorator: W.current,
765
+ bars: [G.current, K.current],
766
+ screenContainer: H.current,
767
+ partLayer: He(O.navigate)
745
768
  }),
746
- transitionName: w,
747
- prevTransitionName: T,
769
+ transitionName: T,
770
+ prevTransitionName: E,
748
771
  status: j,
749
- isActive: x,
750
- animHoldReleased: !Gt
772
+ isActive: S,
773
+ animHoldReleased: !qt
751
774
  }), [
752
- Ae,
775
+ je,
753
776
  j,
754
- x,
777
+ S,
778
+ E,
755
779
  T,
756
- w,
757
- Gt
780
+ qt,
781
+ O.navigate
758
782
  ]), c(() => {
759
- if (!Gt || Z === null) return;
783
+ if (!qt || Z === null) return;
760
784
  let e = Z, t = O.navigate.getState().transitionTaskId, n = t === null ? e : `${e}#${t}`;
761
- return je.current.join(n, () => {
762
- let t = Y.current.transition.driver === "native", n = Ve({ authoredNativeDriver: t }).atomicReleaseFlip;
785
+ return Me.current.join(n, () => {
786
+ let t = Y.current.transition.driver === "native", n = Ue({ authoredNativeDriver: t }).atomicReleaseFlip;
763
787
  if (n) {
764
788
  for (let e of [
789
+ U.current,
765
790
  G.current,
766
- q.current,
767
- J.current,
768
- K.current
769
- ]) e?.isConnected && e.getAttribute(g) !== null && e.setAttribute(g, h.RELEASED);
770
- W.current && (W.current.style.zIndex = String(C + 1)), Ht.current = e;
791
+ K.current,
792
+ W.current
793
+ ]) e?.isConnected && e.getAttribute(ne) !== null && e.setAttribute(ne, h.RELEASED);
794
+ H.current && (H.current.style.zIndex = String(w + 1)), Vt.current = e;
771
795
  }
772
796
  {
773
- let t = () => Wt((t) => t.key === e && !t.released ? {
797
+ let t = () => Kt((t) => t.key === e && !t.released ? {
774
798
  key: e,
775
799
  released: !0
776
800
  } : t);
777
- n && Ve().deferReleaseCommit && typeof requestAnimationFrame == "function" ? requestAnimationFrame(() => t()) : Ze(t);
801
+ n && Ue().deferReleaseCommit && typeof requestAnimationFrame == "function" ? requestAnimationFrame(() => t()) : Qe(t);
778
802
  }
779
803
  }, {
780
- scope: G.current,
804
+ scope: U.current,
781
805
  decodeWait: Bt.current,
782
- contentSettle: Ve().renderSettleGate && (x && j === "PUSHING" || j === "POPPING") ? {
806
+ contentSettle: Ue().renderSettleGate && (S && j === "PUSHING" || j === "POPPING") ? {
783
807
  firstWaitMs: 120,
784
808
  capMs: 700,
785
- graceMs: 60,
786
- minNodes: x ? 30 : 1,
809
+ graceMs: Wt ? 60 : 0,
810
+ minNodes: S ? 30 : 1,
787
811
  renderSettleOnly: !0
788
812
  } : void 0
789
813
  });
790
814
  }, [
791
- Gt,
815
+ qt,
792
816
  Z,
793
817
  $,
794
- x,
818
+ S,
819
+ Wt,
795
820
  j,
796
821
  O.navigate,
797
- C
822
+ w
798
823
  ]);
799
- let Jt = $ === h.PARK_UNDER || $ === h.PARK_OVER ? {} : Ee({
800
- initial: Pe,
801
- isActive: x,
824
+ let Xt = $ === h.PARK_UNDER || $ === h.PARK_OVER ? {} : Te({
825
+ initial: Fe,
826
+ isActive: S,
802
827
  status: j
803
828
  });
804
- return /* @__PURE__ */ Ye("div", {
805
- ref: W,
829
+ return /* @__PURE__ */ Xe("div", {
830
+ ref: H,
806
831
  onClickCapture: Dt,
807
832
  style: {
808
833
  position: D,
@@ -811,8 +836,8 @@ function Ht({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
811
836
  width: "100%",
812
837
  height: "100%",
813
838
  display: "flex",
814
- visibility: ue ? "hidden" : void 0,
815
- zIndex: $ === h.PARK_UNDER ? C - 1 : C + 1,
839
+ visibility: b ? "hidden" : void 0,
840
+ zIndex: $ === h.PARK_UNDER ? w - 1 : w + 1,
816
841
  isolation: "isolate",
817
842
  contain: "style",
818
843
  flexDirection: "column",
@@ -820,35 +845,35 @@ function Ht({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
820
845
  overscrollBehavior: "contain"
821
846
  },
822
847
  children: [
823
- /* @__PURE__ */ Ye("div", {
824
- ref: G,
825
- ...pe,
848
+ /* @__PURE__ */ Xe("div", {
849
+ ref: U,
850
+ ...fe,
826
851
  onPointerDown: St,
827
852
  onPointerMove: Ct,
828
853
  onPointerUp: wt,
829
854
  onPointerCancel: Tt,
830
855
  onLostPointerCapture: Et,
831
- "data-flemo-screen": b,
856
+ "data-flemo-screen": x,
832
857
  "data-flemo-router": k ?? void 0,
833
- "data-flemo-transition": w,
858
+ "data-flemo-transition": T,
834
859
  "data-flemo-status": j,
835
- "data-flemo-active": x ? "true" : "false",
860
+ "data-flemo-active": S ? "true" : "false",
836
861
  "data-flemo-anim-hold": $,
862
+ "data-flemo-park-head": Jt ? "true" : void 0,
837
863
  style: {
838
864
  display: "flex",
839
865
  flexDirection: "column",
840
866
  height: "100%",
841
- backgroundColor: ce,
842
- overflowY: le ? void 0 : "auto",
843
- touchAction: Fe === "x" ? "pan-y" : Fe === "y" ? "pan-x" : "auto",
844
- ...qt && C === A && !E ? { willChange: "transform" } : {},
845
- ...Jt,
846
- ...pe.style
867
+ backgroundColor: v,
868
+ overflowY: y ? void 0 : "auto",
869
+ touchAction: Le === "x" ? "pan-y" : Le === "y" ? "pan-x" : "auto",
870
+ ...Xt,
871
+ ...fe.style
847
872
  },
848
873
  children: [
849
- !ie && t && /* @__PURE__ */ P("div", {
874
+ !ae && t && /* @__PURE__ */ N("div", {
850
875
  style: { minHeight: t },
851
- children: /* @__PURE__ */ P("div", { style: {
876
+ children: /* @__PURE__ */ N("div", { style: {
852
877
  position: D,
853
878
  top: 0,
854
879
  width: "100%",
@@ -856,46 +881,46 @@ function Ht({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
856
881
  backgroundColor: n
857
882
  } })
858
883
  }),
859
- a && /* @__PURE__ */ P("div", {
860
- ref: mt,
884
+ a && /* @__PURE__ */ N("div", {
885
+ ref: gt,
861
886
  "data-flemo-bar-spacer": "app",
862
887
  style: {
863
888
  width: "100%",
864
- minHeight: ft
889
+ minHeight: mt
865
890
  }
866
891
  }),
867
892
  ee,
868
- /* @__PURE__ */ P("div", {
893
+ /* @__PURE__ */ N("div", {
869
894
  style: {
870
895
  display: "flex",
871
896
  flexDirection: "column",
872
897
  flexGrow: 1,
873
- overflowY: le ? "auto" : void 0
898
+ overflowY: y ? "auto" : void 0
874
899
  },
875
- children: /* @__PURE__ */ P(jt.Provider, {
876
- value: Je,
877
- children: /* @__PURE__ */ P(Nt.Provider, {
878
- value: Kt,
900
+ children: /* @__PURE__ */ N(jt.Provider, {
901
+ value: Ye,
902
+ children: /* @__PURE__ */ N(Nt.Provider, {
903
+ value: Yt,
879
904
  children: e
880
905
  })
881
906
  })
882
907
  }),
883
- te,
884
- u && /* @__PURE__ */ P("div", {
885
- ref: ht,
908
+ ie,
909
+ u && /* @__PURE__ */ N("div", {
910
+ ref: _t,
886
911
  "data-flemo-bar-spacer": "nav",
887
912
  style: {
888
- display: Be ? "none" : void 0,
913
+ display: Ve ? "none" : void 0,
889
914
  width: "100%",
890
- minHeight: pt
915
+ minHeight: ht
891
916
  }
892
917
  }),
893
- !ae && r && /* @__PURE__ */ P("div", {
918
+ !ce && r && /* @__PURE__ */ N("div", {
894
919
  style: {
895
- display: Be ? "none" : void 0,
920
+ display: Ve ? "none" : void 0,
896
921
  minHeight: r
897
922
  },
898
- children: /* @__PURE__ */ P("div", { style: {
923
+ children: /* @__PURE__ */ N("div", { style: {
899
924
  position: D,
900
925
  bottom: 0,
901
926
  width: "100%",
@@ -905,60 +930,60 @@ function Ht({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
905
930
  })
906
931
  ]
907
932
  }),
908
- a && /* @__PURE__ */ P("div", {
933
+ a && /* @__PURE__ */ N("div", {
909
934
  ref: vt,
910
935
  "data-flemo-bar": "app",
911
936
  "data-flemo-bar-id": l,
912
937
  "data-flemo-bar-id-type": l === void 0 ? void 0 : typeof l,
913
938
  "data-flemo-router": k ?? void 0,
914
- "data-flemo-bar-transition": w,
939
+ "data-flemo-bar-transition": T,
915
940
  "data-flemo-bar-status": j,
916
- "data-flemo-bar-active": x ? "true" : "false",
941
+ "data-flemo-bar-active": S ? "true" : "false",
917
942
  "data-flemo-bar-riding": kt ? "true" : "false",
918
943
  "data-flemo-anim-hold": $,
919
944
  style: {
920
945
  position: D,
921
- top: ie ? 0 : t,
946
+ top: ae ? 0 : t,
922
947
  left: 0,
923
948
  width: "100%"
924
949
  },
925
950
  children: a
926
951
  }),
927
- u && /* @__PURE__ */ P("div", {
952
+ u && /* @__PURE__ */ N("div", {
928
953
  ref: yt,
929
954
  "data-flemo-bar": "nav",
930
955
  "data-flemo-bar-id": d,
931
956
  "data-flemo-bar-id-type": d === void 0 ? void 0 : typeof d,
932
957
  "data-flemo-router": k ?? void 0,
933
- "data-flemo-bar-transition": w,
958
+ "data-flemo-bar-transition": T,
934
959
  "data-flemo-bar-status": j,
935
- "data-flemo-bar-active": x ? "true" : "false",
960
+ "data-flemo-bar-active": S ? "true" : "false",
936
961
  "data-flemo-bar-riding": At ? "true" : "false",
937
962
  "data-flemo-anim-hold": $,
938
963
  style: {
939
- display: Be ? "none" : void 0,
964
+ display: Ve ? "none" : void 0,
940
965
  position: D,
941
- bottom: ae ? 0 : r,
966
+ bottom: ce ? 0 : r,
942
967
  left: 0,
943
968
  width: "100%"
944
969
  },
945
970
  children: u
946
971
  }),
947
- Re && /* @__PURE__ */ P(Lt, {
948
- ref: K,
972
+ ze && /* @__PURE__ */ N(Rt, {
973
+ ref: W,
949
974
  "data-flemo-anim-hold": $
950
975
  }),
951
- Re && $e && Je ? Xe(/* @__PURE__ */ P(Lt, {
976
+ ze && et && Ye ? Ze(/* @__PURE__ */ N(Rt, {
952
977
  "data-flemo-anim-hold": $,
953
- style: { zIndex: C * 2 + 1 }
954
- }), Je) : null,
955
- !qe && /* @__PURE__ */ P("div", {
956
- ref: Ke,
978
+ style: { zIndex: w * 2 + 1 }
979
+ }), Ye) : null,
980
+ !Je && /* @__PURE__ */ N("div", {
981
+ ref: qe,
957
982
  [re]: "",
958
- [v]: w,
959
- [_]: j,
960
- [ne]: x ? "true" : "false",
961
- [g]: $,
983
+ [g]: T,
984
+ [se]: j,
985
+ [te]: S ? "true" : "false",
986
+ [ne]: $,
962
987
  style: {
963
988
  position: "absolute",
964
989
  inset: 0,
@@ -971,8 +996,8 @@ function Ht({ children: e, statusBarHeight: t, statusBarColor: n, systemNavigati
971
996
  }
972
997
  //#endregion
973
998
  //#region src/screen/Screen.tsx
974
- function Ut({ children: e, ...t }) {
975
- let { isActive: n, isPrev: r, zIndex: i } = L(), a = U((e) => e.index), o = It((e) => e.status), s = Q((e) => e.dragStatus), l = Q((e) => e.replaceTransitionStatus), u = pe({
999
+ function Vt({ children: e, ...t }) {
1000
+ let { isActive: n, isPrev: r, zIndex: i } = F(), a = V((e) => e.index), o = Lt((e) => e.status), s = Q((e) => e.dragStatus), l = Q((e) => e.replaceTransitionStatus), u = b({
976
1001
  isActive: n,
977
1002
  isPrev: r,
978
1003
  zIndex: i,
@@ -983,28 +1008,29 @@ function Ut({ children: e, ...t }) {
983
1008
  }), [d, f] = m(u !== "live");
984
1009
  return u === "live" && d && f(!1), u === "immediate" && !d && f(!0), c(() => {
985
1010
  if (u !== "deferred" || d) return;
986
- let e = setTimeout(() => f(!0), Wt);
1011
+ let e = setTimeout(() => f(!0), Ht);
987
1012
  return () => clearTimeout(e);
988
- }, [u, d]), /* @__PURE__ */ P(At, {
1013
+ }, [u, d]), /* @__PURE__ */ N(Z, {
989
1014
  freeze: d,
990
1015
  mode: u,
991
- children: /* @__PURE__ */ P(Ht, {
1016
+ children: /* @__PURE__ */ N(Bt, {
992
1017
  paintHidden: d,
993
1018
  ...t,
994
1019
  children: e
995
1020
  })
996
1021
  });
997
1022
  }
998
- var Wt = 600;
1023
+ var Ht = 600;
999
1024
  //#endregion
1000
1025
  //#region src/screen/Part.tsx
1001
- function Gt({ ref: e, name: t, style: n, children: r, ...i }) {
1002
- let { isActive: a, isPrev: o, navigateStore: c, routerId: l } = L(), u = s(tt), d = l ?? u ?? void 0, f = F(), ee = H(c ?? f.navigate, (e) => o ? "COMPLETED" : e.status);
1003
- return /* @__PURE__ */ P("div", {
1026
+ function Ut({ ref: e, name: t, style: n, children: r, ...i }) {
1027
+ let { isActive: a, isPrev: o, navigateStore: c, routerId: l, transitionName: u } = F(), d = s(rt), f = l ?? d ?? void 0, ee = P(), p = B(c ?? ee.navigate, (e) => o ? "COMPLETED" : e.status);
1028
+ return /* @__PURE__ */ N("div", {
1004
1029
  ref: e,
1005
1030
  "data-flemo-part-name": t,
1006
- "data-flemo-router": d,
1007
- "data-flemo-status": ee,
1031
+ "data-flemo-transition": u,
1032
+ "data-flemo-router": f,
1033
+ "data-flemo-status": p,
1008
1034
  "data-flemo-active": a ? "true" : "false",
1009
1035
  style: n,
1010
1036
  ...i,
@@ -1013,17 +1039,17 @@ function Gt({ ref: e, name: t, style: n, children: r, ...i }) {
1013
1039
  }
1014
1040
  //#endregion
1015
1041
  //#region src/screen/Layer.tsx
1016
- function $({ children: e }) {
1017
- let t = Mt(), n = Z();
1018
- return !t || !n ? null : Xe(/* @__PURE__ */ P("div", {
1042
+ function Wt({ children: e }) {
1043
+ let t = Mt(), n = Pt();
1044
+ return !t || !n ? null : Ze(/* @__PURE__ */ N("div", {
1019
1045
  ref: n.registerSlot,
1020
1046
  [ae]: "",
1021
1047
  [ie]: n.screenId,
1022
1048
  ...n.rendersHost ? {} : {
1023
- [v]: n.transitionName,
1024
- [_]: n.status,
1025
- [ne]: n.isActive ? "true" : "false",
1026
- [g]: n.animHold
1049
+ [g]: n.transitionName,
1050
+ [se]: n.status,
1051
+ [te]: n.isActive ? "true" : "false",
1052
+ [ne]: n.animHold
1027
1053
  },
1028
1054
  style: {
1029
1055
  position: "absolute",
@@ -1032,7 +1058,7 @@ function $({ children: e }) {
1032
1058
  zIndex: n.zIndex * 2,
1033
1059
  visibility: n.paintHidden ? "hidden" : void 0
1034
1060
  },
1035
- children: /* @__PURE__ */ P("div", {
1061
+ children: /* @__PURE__ */ N("div", {
1036
1062
  style: {
1037
1063
  display: "contents",
1038
1064
  pointerEvents: "auto"
@@ -1043,13 +1069,13 @@ function $({ children: e }) {
1043
1069
  }
1044
1070
  //#endregion
1045
1071
  //#region src/screen/Morph.tsx
1046
- function Kt({ ref: e, layoutId: t, name: n, as: r = "div", style: a, children: s, ...c }) {
1047
- let { isActive: l, isPrev: u, navigateStore: d } = L(), ee = F(), m = d ?? ee.navigate, te = H(m, (e) => u ? "COMPLETED" : e.status), ne = p(null), h = o((t) => {
1048
- ne.current = t, typeof e == "function" ? e(t) : e && (e.current = t);
1072
+ function Gt({ ref: e, layoutId: t, name: n, as: r = "div", style: a, children: s, ...c }) {
1073
+ let { isActive: l, isPrev: u, navigateStore: d } = F(), ee = P(), m = d ?? ee.navigate, te = B(m, (e) => u ? "COMPLETED" : e.status), h = p(null), ne = o((t) => {
1074
+ h.current = t, typeof e == "function" ? e(t) : e && (e.current = t);
1049
1075
  }, [e]);
1050
1076
  return f(() => {
1051
- let e = ne.current;
1052
- if (e) return le(e, {
1077
+ let e = h.current;
1078
+ if (e) return v(e, {
1053
1079
  layoutId: t,
1054
1080
  name: n,
1055
1081
  navigateStore: m
@@ -1064,7 +1090,7 @@ function Kt({ ref: e, layoutId: t, name: n, as: r = "div", style: a, children: s
1064
1090
  "data-flemo-morph-slot": "",
1065
1091
  style: { display: "contents" }
1066
1092
  }, i(r, {
1067
- ref: h,
1093
+ ref: ne,
1068
1094
  "data-flemo-morph": "",
1069
1095
  "data-flemo-morph-name": n,
1070
1096
  style: a,
@@ -1073,22 +1099,22 @@ function Kt({ ref: e, layoutId: t, name: n, as: r = "div", style: a, children: s
1073
1099
  }
1074
1100
  //#endregion
1075
1101
  //#region src/stores/RouterScopeProvider.tsx
1076
- function qt({ children: e }) {
1102
+ function Kt({ children: e }) {
1077
1103
  let [t] = m(() => ({
1078
1104
  history: w(),
1079
1105
  navigate: E(),
1080
- transition: M(),
1081
- screen: ve(),
1082
- driver: me(),
1106
+ transition: Se(),
1107
+ screen: _e(),
1108
+ driver: pe(),
1083
1109
  memory: !1,
1084
1110
  markSelfInduced: Ae,
1085
- consume: b,
1111
+ consume: fe,
1086
1112
  life: { alive: !0 }
1087
1113
  }));
1088
- return /* @__PURE__ */ P(Qe.Provider, {
1114
+ return /* @__PURE__ */ N($e.Provider, {
1089
1115
  value: t,
1090
1116
  children: e
1091
1117
  });
1092
1118
  }
1093
1119
  //#endregion
1094
- export { $ as Layer, Kt as Morph, Gt as Part, Ct as Route, St as Router, qt as RouterScopeProvider, Ut as Screen, I as ScreenContext, Lt as ScreenDecorator, At as ScreenFreeze, Ht as ScreenMotion, J as Slot, S as createBrowserHistoryDriver, C as createDecorator, T as createMorphTransition, O as createPartTransition, k as createRawDecorator, A as createRawMorphTransition, he as createRawPartTransition, ge as createRawTransition, xe as createTransition, Me as morphTransitionMap, Fe as partTransitionMap, U as useHistoryStore, Tt as useNavigate, It as useNavigateStore, Ot as useParams, Et as usePathname, L as useScreen, Q as useScreenStore, Dt as useStep, F as useStores, Rt as useViewportScrollHeight };
1120
+ export { Wt as Layer, Gt as Morph, Ut as Part, wt as Route, Ct as Router, Kt as RouterScopeProvider, Vt as Screen, tt as ScreenContext, Rt as ScreenDecorator, Z as ScreenFreeze, Bt as ScreenMotion, q as Slot, S as createBrowserHistoryDriver, C as createDecorator, T as createMorphTransition, D as createPartTransition, O as createRawDecorator, k as createRawMorphTransition, A as createRawPartTransition, he as createRawTransition, be as createTransition, Me as morphTransitionMap, Fe as partTransitionMap, V as useHistoryStore, Et as useNavigate, Lt as useNavigateStore, kt as useParams, Dt as usePathname, F as useScreen, Q as useScreenStore, Ot as useStep, P as useStores, zt as useViewportScrollHeight };