@brett_lamy/ui 3.1.0 → 5.0.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.
Files changed (241) hide show
  1. package/README.md +4 -4
  2. package/dist/components/animated-height.d.ts +3 -1
  3. package/dist/components/animated-height.d.ts.map +1 -1
  4. package/dist/components/animated-height.js +11 -11
  5. package/dist/components/artifact-chat-container.d.ts.map +1 -1
  6. package/dist/components/artifact-chat-container.js +81 -82
  7. package/dist/components/button.d.ts +4 -3
  8. package/dist/components/button.d.ts.map +1 -1
  9. package/dist/components/button.js +22 -9
  10. package/dist/components/canvas.d.ts +91 -0
  11. package/dist/components/canvas.d.ts.map +1 -0
  12. package/dist/components/canvas.js +296 -0
  13. package/dist/components/composer/composer-cards.d.ts +55 -0
  14. package/dist/components/composer/composer-cards.d.ts.map +1 -0
  15. package/dist/components/composer/composer-cards.js +351 -0
  16. package/dist/components/composer/composer.d.ts +9 -1
  17. package/dist/components/composer/composer.d.ts.map +1 -1
  18. package/dist/components/composer/composer.js +179 -154
  19. package/dist/components/context-menu.d.ts +25 -0
  20. package/dist/components/context-menu.d.ts.map +1 -0
  21. package/dist/components/context-menu.js +127 -0
  22. package/dist/components/credenza.d.ts.map +1 -1
  23. package/dist/components/credenza.js +52 -92
  24. package/dist/components/cron-editor.d.ts +47 -0
  25. package/dist/components/cron-editor.d.ts.map +1 -0
  26. package/dist/components/cron-editor.js +297 -0
  27. package/dist/components/dropdown-menu.d.ts +3 -1
  28. package/dist/components/dropdown-menu.d.ts.map +1 -1
  29. package/dist/components/dropdown-menu.js +5 -5
  30. package/dist/components/edge-drawer.d.ts.map +1 -1
  31. package/dist/components/edge-drawer.js +1 -0
  32. package/dist/components/file-upload.d.ts +121 -0
  33. package/dist/components/file-upload.d.ts.map +1 -0
  34. package/dist/components/file-upload.js +405 -0
  35. package/dist/components/filter-input.d.ts +22 -0
  36. package/dist/components/filter-input.d.ts.map +1 -0
  37. package/dist/components/filter-input.js +126 -0
  38. package/dist/components/filter.d.ts +154 -0
  39. package/dist/components/filter.d.ts.map +1 -0
  40. package/dist/components/filter.js +815 -0
  41. package/dist/components/floating-chat.d.ts.map +1 -1
  42. package/dist/components/floating-chat.js +71 -88
  43. package/dist/components/floating-sheet.d.ts +21 -5
  44. package/dist/components/floating-sheet.d.ts.map +1 -1
  45. package/dist/components/floating-sheet.js +113 -116
  46. package/dist/components/markdown-editor.d.ts +2 -0
  47. package/dist/components/markdown-editor.d.ts.map +1 -1
  48. package/dist/components/markdown-editor.js +46 -45
  49. package/dist/components/markdown-view.d.ts +6 -1
  50. package/dist/components/markdown-view.d.ts.map +1 -1
  51. package/dist/components/markdown-view.js +13 -11
  52. package/dist/components/navigation-stack.d.ts +3 -5
  53. package/dist/components/navigation-stack.d.ts.map +1 -1
  54. package/dist/components/navigation-stack.js +212 -382
  55. package/dist/components/passkey-enroll-dialog.d.ts +36 -0
  56. package/dist/components/passkey-enroll-dialog.d.ts.map +1 -0
  57. package/dist/components/passkey-enroll-dialog.js +234 -0
  58. package/dist/components/result-table.d.ts +38 -0
  59. package/dist/components/result-table.d.ts.map +1 -0
  60. package/dist/components/result-table.js +161 -0
  61. package/dist/components/schema-tree.d.ts +19 -0
  62. package/dist/components/schema-tree.d.ts.map +1 -0
  63. package/dist/components/schema-tree.js +172 -0
  64. package/dist/components/side-drawer.d.ts.map +1 -1
  65. package/dist/components/side-drawer.js +117 -143
  66. package/dist/components/slider.d.ts.map +1 -1
  67. package/dist/components/slider.js +4 -1
  68. package/dist/components/spinner-shapes.d.ts +263 -0
  69. package/dist/components/spinner-shapes.d.ts.map +1 -0
  70. package/dist/components/spinner-shapes.js +771 -0
  71. package/dist/components/spinner.d.ts +133 -3
  72. package/dist/components/spinner.d.ts.map +1 -1
  73. package/dist/components/spinner.js +445 -29
  74. package/dist/components/sql-console.d.ts +28 -0
  75. package/dist/components/sql-console.d.ts.map +1 -0
  76. package/dist/components/sql-console.js +348 -0
  77. package/dist/components/sql-editor.d.ts +47 -0
  78. package/dist/components/sql-editor.d.ts.map +1 -0
  79. package/dist/components/sql-editor.js +170 -0
  80. package/dist/components/tab-view.d.ts +2 -2
  81. package/dist/components/tab-view.d.ts.map +1 -1
  82. package/dist/components/tab-view.js +63 -49
  83. package/dist/components/tailscale-login-button.d.ts +53 -0
  84. package/dist/components/tailscale-login-button.d.ts.map +1 -0
  85. package/dist/components/tailscale-login-button.js +197 -0
  86. package/dist/components/time-input.d.ts +46 -0
  87. package/dist/components/time-input.d.ts.map +1 -0
  88. package/dist/components/time-input.js +258 -0
  89. package/dist/components/toast.d.ts +5 -2
  90. package/dist/components/toast.d.ts.map +1 -1
  91. package/dist/components/toast.js +249 -125
  92. package/dist/components/vault-gate.d.ts +60 -0
  93. package/dist/components/vault-gate.d.ts.map +1 -0
  94. package/dist/components/vault-gate.js +382 -0
  95. package/dist/index.css +1 -1
  96. package/dist/index.d.ts +86 -7
  97. package/dist/index.d.ts.map +1 -1
  98. package/dist/index.js +129 -85
  99. package/dist/lib/back-history.d.ts +5 -0
  100. package/dist/lib/back-history.d.ts.map +1 -0
  101. package/dist/lib/back-history.js +44 -0
  102. package/dist/lib/canvas-math.d.ts +82 -0
  103. package/dist/lib/canvas-math.d.ts.map +1 -0
  104. package/dist/lib/canvas-math.js +226 -0
  105. package/dist/lib/controllable-state.d.ts +4 -0
  106. package/dist/lib/controllable-state.d.ts.map +1 -0
  107. package/dist/lib/controllable-state.js +11 -0
  108. package/dist/lib/cron.d.ts +55 -0
  109. package/dist/lib/cron.d.ts.map +1 -0
  110. package/dist/lib/cron.js +269 -0
  111. package/dist/lib/edge-swipe.d.ts +36 -0
  112. package/dist/lib/edge-swipe.d.ts.map +1 -0
  113. package/dist/lib/edge-swipe.js +73 -0
  114. package/dist/lib/file-upload.d.ts +187 -0
  115. package/dist/lib/file-upload.d.ts.map +1 -0
  116. package/dist/lib/file-upload.js +349 -0
  117. package/dist/lib/filter-query.d.ts +90 -0
  118. package/dist/lib/filter-query.d.ts.map +1 -0
  119. package/dist/lib/filter-query.js +459 -0
  120. package/dist/lib/filter.d.ts +120 -0
  121. package/dist/lib/filter.d.ts.map +1 -0
  122. package/dist/lib/filter.js +399 -0
  123. package/dist/lib/format-bytes.d.ts +3 -0
  124. package/dist/lib/format-bytes.d.ts.map +1 -0
  125. package/dist/lib/format-bytes.js +16 -0
  126. package/dist/lib/gpu-cron.d.ts +51 -0
  127. package/dist/lib/gpu-cron.d.ts.map +1 -0
  128. package/dist/lib/gpu-cron.js +81 -0
  129. package/dist/lib/gpu-query/featurize.d.ts +19 -0
  130. package/dist/lib/gpu-query/featurize.d.ts.map +1 -0
  131. package/dist/lib/gpu-query/featurize.js +88 -0
  132. package/dist/lib/gpu-query/index.d.ts +73 -0
  133. package/dist/lib/gpu-query/index.d.ts.map +1 -0
  134. package/dist/lib/gpu-query/index.js +117 -0
  135. package/dist/lib/gpu-query/kernel.wgsl.d.ts +30 -0
  136. package/dist/lib/gpu-query/kernel.wgsl.d.ts.map +1 -0
  137. package/dist/lib/gpu-query/model.d.ts +8 -0
  138. package/dist/lib/gpu-query/model.d.ts.map +1 -0
  139. package/dist/lib/gpu-query/model.js +91 -0
  140. package/dist/lib/gpu-query/schema.d.ts +40 -0
  141. package/dist/lib/gpu-query/schema.d.ts.map +1 -0
  142. package/dist/lib/gpu-query/schema.js +0 -0
  143. package/dist/lib/gpu-query/webgpu.d.ts +12 -0
  144. package/dist/lib/gpu-query/webgpu.d.ts.map +1 -0
  145. package/dist/lib/gpu-query/weights.d.ts +17 -0
  146. package/dist/lib/gpu-query/weights.d.ts.map +1 -0
  147. package/dist/lib/gpu-query/weights.js +40 -0
  148. package/dist/lib/gpu-query/weights.json.d.ts +3 -0
  149. package/dist/lib/gpu-query/weights2.js +25 -0
  150. package/dist/lib/gpu-time.d.ts +77 -0
  151. package/dist/lib/gpu-time.d.ts.map +1 -0
  152. package/dist/lib/gpu-time.js +260 -0
  153. package/dist/lib/morph-path.d.ts +22 -0
  154. package/dist/lib/morph-path.d.ts.map +1 -0
  155. package/dist/lib/morph-path.js +42 -0
  156. package/dist/lib/passkey.d.ts +120 -0
  157. package/dist/lib/passkey.d.ts.map +1 -0
  158. package/dist/lib/passkey.js +186 -0
  159. package/dist/lib/persistent-state.d.ts +9 -0
  160. package/dist/lib/persistent-state.d.ts.map +1 -0
  161. package/dist/lib/persistent-state.js +37 -0
  162. package/dist/lib/pglite-core.d.ts +219 -0
  163. package/dist/lib/pglite-core.d.ts.map +1 -0
  164. package/dist/lib/pglite-core.js +273 -0
  165. package/dist/lib/pglite-files.d.ts +7 -0
  166. package/dist/lib/pglite-files.d.ts.map +1 -0
  167. package/dist/lib/pglite-files.js +17 -0
  168. package/dist/lib/pglite-schema.d.ts +58 -0
  169. package/dist/lib/pglite-schema.d.ts.map +1 -0
  170. package/dist/lib/pglite-schema.js +105 -0
  171. package/dist/lib/pglite-storage.d.ts +33 -0
  172. package/dist/lib/pglite-storage.d.ts.map +1 -0
  173. package/dist/lib/pglite-storage.js +55 -0
  174. package/dist/lib/pglite-transfer.d.ts +53 -0
  175. package/dist/lib/pglite-transfer.d.ts.map +1 -0
  176. package/dist/lib/pglite-transfer.js +126 -0
  177. package/dist/lib/pglite.d.ts +106 -0
  178. package/dist/lib/pglite.d.ts.map +1 -0
  179. package/dist/lib/pglite.js +298 -0
  180. package/dist/lib/pull-to-refresh.d.ts +24 -0
  181. package/dist/lib/pull-to-refresh.d.ts.map +1 -0
  182. package/dist/lib/pull-to-refresh.js +74 -0
  183. package/dist/lib/scroll-hidden.d.ts +6 -0
  184. package/dist/lib/scroll-hidden.d.ts.map +1 -0
  185. package/dist/lib/scroll-hidden.js +21 -0
  186. package/dist/lib/sheet-drag.d.ts +10 -2
  187. package/dist/lib/sheet-drag.d.ts.map +1 -1
  188. package/dist/lib/sheet-drag.js +72 -69
  189. package/dist/lib/sql-format.d.ts +62 -0
  190. package/dist/lib/sql-format.d.ts.map +1 -0
  191. package/dist/lib/sql-format.js +175 -0
  192. package/dist/lib/sql-lex.d.ts +25 -0
  193. package/dist/lib/sql-lex.d.ts.map +1 -0
  194. package/dist/lib/sql-lex.js +135 -0
  195. package/dist/lib/tab-lock.d.ts +28 -0
  196. package/dist/lib/tab-lock.d.ts.map +1 -0
  197. package/dist/lib/tab-lock.js +80 -0
  198. package/dist/lib/tailscale-connect.d.ts +56 -0
  199. package/dist/lib/tailscale-connect.d.ts.map +1 -0
  200. package/dist/lib/tailscale-connect.js +99 -0
  201. package/dist/lib/tailscale-fake.d.ts +33 -0
  202. package/dist/lib/tailscale-fake.d.ts.map +1 -0
  203. package/dist/lib/tailscale-fake.js +80 -0
  204. package/dist/lib/tailscale-policy.d.ts +71 -0
  205. package/dist/lib/tailscale-policy.d.ts.map +1 -0
  206. package/dist/lib/tailscale-policy.js +244 -0
  207. package/dist/lib/tailscale-react.d.ts +20 -0
  208. package/dist/lib/tailscale-react.d.ts.map +1 -0
  209. package/dist/lib/tailscale-react.js +37 -0
  210. package/dist/lib/tailscale-router/bridge.d.ts +60 -0
  211. package/dist/lib/tailscale-router/bridge.d.ts.map +1 -0
  212. package/dist/lib/tailscale-router/bridge.js +198 -0
  213. package/dist/lib/tailscale-router/react.d.ts +19 -0
  214. package/dist/lib/tailscale-router/react.d.ts.map +1 -0
  215. package/dist/lib/tailscale-router/react.js +52 -0
  216. package/dist/lib/tailscale.d.ts +204 -0
  217. package/dist/lib/tailscale.d.ts.map +1 -0
  218. package/dist/lib/tailscale.js +443 -0
  219. package/dist/lib/title-flight.d.ts +34 -0
  220. package/dist/lib/title-flight.d.ts.map +1 -0
  221. package/dist/lib/title-flight.js +123 -0
  222. package/dist/lib/vault-react.d.ts +49 -0
  223. package/dist/lib/vault-react.d.ts.map +1 -0
  224. package/dist/lib/vault-react.js +196 -0
  225. package/dist/lib/vault-storage.d.ts +30 -0
  226. package/dist/lib/vault-storage.d.ts.map +1 -0
  227. package/dist/lib/vault-storage.js +105 -0
  228. package/dist/lib/vault.d.ts +200 -0
  229. package/dist/lib/vault.d.ts.map +1 -0
  230. package/dist/lib/vault.js +641 -0
  231. package/dist/tailscale-sw.js +332 -0
  232. package/package.json +35 -5
  233. package/dist/components/icon-button.d.ts +0 -19
  234. package/dist/components/icon-button.d.ts.map +0 -1
  235. package/dist/components/icon-button.js +0 -31
  236. package/dist/components/measure-h.d.ts +0 -7
  237. package/dist/components/measure-h.d.ts.map +0 -1
  238. package/dist/components/measure-h.js +0 -20
  239. package/dist/components/snap-sheet.d.ts +0 -13
  240. package/dist/components/snap-sheet.d.ts.map +0 -1
  241. package/dist/components/snap-sheet.js +0 -100
@@ -1,16 +1,19 @@
1
1
  "use client";
2
2
  import { cn as e } from "../lib/utils.js";
3
- import { springCss as t, springs as n } from "../lib/motion.js";
4
- import { Icon as r } from "../lib/icon.js";
5
- import { BLSafeCtx as i, BLStickyCtx as a, chromeStore as o } from "../lib/theme.js";
3
+ import { springCss as t } from "../lib/motion.js";
4
+ import { Icon as n } from "../lib/icon.js";
5
+ import { BLSafeCtx as r, BLStickyCtx as i, chromeStore as a } from "../lib/theme.js";
6
+ import { useEdgeSwipe as o } from "../lib/edge-swipe.js";
6
7
  import { Spinner as s } from "./spinner.js";
7
- import { useSplitViewBack as c } from "./split-view.js";
8
- import { animate as l } from "framer-motion";
9
- import { use as u, useEffect as d, useLayoutEffect as f, useRef as p, useState as m } from "react";
10
- import { jsx as h, jsxs as g } from "react/jsx-runtime";
11
- import { Button as ee } from "react-aria-components";
8
+ import { armBackHistory as c, useBackHistory as l } from "../lib/back-history.js";
9
+ import { usePullToRefresh as u } from "../lib/pull-to-refresh.js";
10
+ import { backLabel as d, shownTitle as f, useTitleFlight as p } from "../lib/title-flight.js";
11
+ import { useSplitViewBack as m } from "./split-view.js";
12
+ import { use as h, useEffect as g, useLayoutEffect as _, useRef as v, useState as y } from "react";
13
+ import { jsx as b, jsxs as x } from "react/jsx-runtime";
14
+ import { Button as S } from "react-aria-components";
12
15
  //#region src/components/navigation-stack.tsx
13
- var _ = {
16
+ var C = {
14
17
  off: "103%",
15
18
  under: "-28%",
16
19
  underPct: -28,
@@ -20,17 +23,17 @@ var _ = {
20
23
  flick: .55,
21
24
  settleMs: 580
22
25
  };
23
- function v({ sc: n, depth: c, top: l, ghost: v, entering: y, nav: b, backTitle: x, reg: S, defIns: C, z: w, rootBack: T }) {
24
- let E = c === 0 && !v ? T : null, D = E ? E.title ?? "Back" : x, O = p(!1), [k, A] = m(!y), [j, M] = m(!1), [N, P] = m(!1), [F, I] = m(!1), L = u(i), R = p(0), z = p(null), B = p(null), V = p(null), H = p(null), [U, W] = m(!1), G = p(null), K = p(null), q = p(null), J = p(null), [Y, X] = m({
26
+ function w({ sc: t, depth: o, top: c, ghost: l, entering: d, nav: f, backTitle: p, reg: m, defIns: w, z: T, rootBack: E }) {
27
+ let D = o === 0 && !l ? E : null, O = D ? D.title ?? "Back" : p, k = v(!1), [A, j] = y(!d), [M, N] = y(!1), [P, F] = y(!1), [I, L] = y(!1), R = h(r), z = v(0), B = v(null), V = v(null), H = v(null), U = v(null), W = v(null), G = v(null), K = v(null), [q, J] = y({
25
28
  mode: "title",
26
29
  w: 160
27
- }), Z = c > 0 || v || !!E;
28
- f(() => {
29
- let e = G.current, t = K.current, r = q.current, i = J.current;
30
- if (!Z || !e || !r || !i) return;
30
+ }), Y = o > 0 || l || !!D;
31
+ _(() => {
32
+ let e = U.current, n = W.current, r = G.current, i = K.current;
33
+ if (!Y || !e || !r || !i) return;
31
34
  let a = () => {
32
- let a = n.title != null && t ? t.offsetWidth : 0, o = Math.floor((e.clientWidth - a) / 2 - 40), s = r.offsetWidth, c = i.offsetWidth, l = s > 0 && (o >= s || o >= c + 14) ? "title" : o >= c ? "back" : "none";
33
- X((e) => e.mode === l && e.w === o ? e : {
35
+ let a = t.title != null && n ? n.offsetWidth : 0, o = Math.floor((e.clientWidth - a) / 2 - 40), s = r.offsetWidth, c = i.offsetWidth, l = s > 0 && (o >= s || o >= c + 14) ? "title" : o >= c ? "back" : "none";
36
+ J((e) => e.mode === l && e.w === o ? e : {
34
37
  mode: l,
35
38
  w: Math.max(0, o)
36
39
  });
@@ -41,466 +44,293 @@ function v({ sc: n, depth: c, top: l, ghost: v, entering: y, nav: b, backTitle:
41
44
  e,
42
45
  r,
43
46
  i
44
- ].forEach((e) => o.observe(e)), t && o.observe(t), () => o.disconnect();
47
+ ].forEach((e) => o.observe(e)), n && o.observe(n), () => o.disconnect();
45
48
  }, [
46
- Z,
47
- D,
48
- n.title
49
- ]), f(() => {
50
- y && !O.current && (O.current = !0, A(!1), requestAnimationFrame(() => requestAnimationFrame(() => A(!0))));
51
- }, [y]), d(() => {
52
- v && requestAnimationFrame(() => M(!0));
53
- }, [v]);
54
- let Q = !v && c < l, { off: $, under: te } = _, ne = v ? j ? $ : "0%" : k ? Q ? te : "0%" : $, re = n.bottomInset == null ? C || 0 : n.bottomInset, ie = L + 52, ae = n.hideChromeOnScroll !== !1;
55
- d(() => () => o.set(!1), []);
56
- let oe = (e) => {
57
- let t = e.currentTarget.scrollTop, r = t > (n.largeTitle ? 44 : 8);
58
- if (r !== N && P(r), ae && !v) {
59
- let e = t - R.current;
60
- t < ie * .7 ? F && (I(!1), o.set(!1)) : e > 5 ? F || (I(!0), o.set(!0)) : e < -5 && F && (I(!1), o.set(!1));
49
+ Y,
50
+ O,
51
+ t.title
52
+ ]), _(() => {
53
+ d && !k.current && (k.current = !0, j(!1), requestAnimationFrame(() => requestAnimationFrame(() => j(!0))));
54
+ }, [d]), g(() => {
55
+ l && requestAnimationFrame(() => N(!0));
56
+ }, [l]);
57
+ let X = !l && o < c, { off: Z, under: ee } = C, te = l ? M ? Z : "0%" : A ? X ? ee : "0%" : Z, ne = t.bottomInset == null ? w || 0 : t.bottomInset, Q = R + 52, re = t.hideChromeOnScroll !== !1;
58
+ g(() => () => a.set(!1), []);
59
+ let ie = (e) => {
60
+ let n = e.currentTarget.scrollTop, r = n > (t.largeTitle ? 44 : 8);
61
+ if (r !== P && F(r), re && !l) {
62
+ let e = n - z.current;
63
+ n < Q * .7 ? I && (L(!1), a.set(!1)) : e > 5 ? I || (L(!0), a.set(!0)) : e < -5 && I && (L(!1), a.set(!1));
61
64
  }
62
- R.current = t;
63
- }, se = n.titleOnScroll ? N : !n.largeTitle || N, ce = (e) => {
64
- if (e.key === "Escape" && b.canPop && c > 0) {
65
- b.pop();
65
+ z.current = n;
66
+ }, ae = t.titleOnScroll ? P : !t.largeTitle || P, oe = (e) => {
67
+ if (e.key === "Escape" && f.canPop && o > 0) {
68
+ f.pop();
66
69
  return;
67
70
  }
68
71
  if (e.key === "ArrowDown" || e.key === "ArrowUp") {
69
72
  let t = [...e.currentTarget.querySelectorAll("[data-tkrow]")].filter((e) => e.offsetParent), n = t.indexOf(document.activeElement), r = e.key === "ArrowDown" ? n < 0 ? 0 : Math.min(n + 1, t.length - 1) : n < 0 ? t.length - 1 : Math.max(n - 1, 0);
70
73
  t[r] && (t[r].focus(), e.preventDefault());
71
74
  }
72
- }, le = (e) => {
73
- !n.onRefresh || U || e.button || z.current.scrollTop > 2 || (H.current = {
74
- y0: e.clientY,
75
- x0: e.clientX,
76
- on: !1,
77
- armed: !1
78
- });
79
- }, ue = (e) => {
80
- let t = H.current;
81
- if (!t) return;
82
- let n = e.clientY - t.y0, r = e.clientX - t.x0;
83
- if (!t.on) {
84
- if (n > 10 && n > Math.abs(r) * 1.3 && z.current.scrollTop <= 1) {
85
- t.on = !0;
86
- try {
87
- z.current.setPointerCapture(e.pointerId);
88
- } catch {}
89
- } else if (n < -6) {
90
- H.current = null;
91
- return;
92
- } else return;
93
- }
94
- let i = Math.min(110, 56 * Math.log1p(Math.max(0, n - 10) / 40));
95
- t.t = i;
96
- let a = B.current, o = V.current;
97
- a && (a.style.transition = "none", a.style.transform = `translateY(${i}px)`), o && (o.style.opacity = String(Math.min(1, i / 58)), o.style.transform = `translateX(-50%) rotate(${i * 3.2}deg) scale(${Math.min(1, .5 + i / 90)})`), t.armed = i > 54;
98
- }, de = () => {
99
- let e = H.current;
100
- if (!e || (H.current = null, !e.on)) return;
101
- let r = B.current, i = V.current;
102
- e.armed ? (W(!0), r && (r.style.transition = t("transform", "snappy"), r.style.transform = "translateY(52px)"), i && (i.style.opacity = "1", i.style.transform = "translateX(-50%)"), setTimeout(() => {
103
- W(!1), r && (r.style.transition = t("transform", "smooth"), r.style.transform = "translateY(0)"), i && (i.style.opacity = "0"), n.onRefresh && n.onRefresh(), setTimeout(() => {
104
- r && (r.style.transition = "", r.style.transform = "");
105
- }, 560);
106
- }, 1100)) : (r && (r.style.transition = t("transform", "snappy"), r.style.transform = "translateY(0)", setTimeout(() => {
107
- r && (r.style.transition = "", r.style.transform = "");
108
- }, 400)), i && (i.style.opacity = "0"));
109
- };
110
- return /* @__PURE__ */ g("div", {
111
- ref: (e) => S(n.key, { el: e }),
75
+ }, $ = u({
76
+ onRefresh: t.onRefresh,
77
+ scroller: B,
78
+ content: V,
79
+ spinner: H
80
+ });
81
+ return /* @__PURE__ */ x("div", {
82
+ ref: (e) => m(t.key, { el: e }),
112
83
  "data-slot": "screen",
113
- "data-screen-label": typeof n.title == "string" ? n.title : n.key,
114
- className: e("absolute inset-0 z-(--screen-z) overflow-hidden will-change-transform [transform:translateX(var(--screen-x))] transition-transform duration-spring-smooth ease-spring-smooth motion-reduce:transition-none", n.grouped ? "bg-muted" : "bg-background", c > 0 && "shadow-[-10px_0_30px_black] shadow-black/16", v ? "pointer-events-none" : "pointer-events-auto"),
115
- "data-scrolled": N ? "" : void 0,
84
+ "data-screen-key": t.key,
85
+ "data-screen-label": typeof t.title == "string" ? t.title : t.key,
86
+ tabIndex: -1,
87
+ inert: X || l || void 0,
88
+ onKeyDown: oe,
89
+ className: e("outline-none absolute inset-0 z-(--screen-z) overflow-hidden will-change-transform [transform:translateX(var(--screen-x))] transition-transform duration-spring-smooth ease-spring-smooth motion-reduce:transition-none", t.grouped ? "bg-muted" : "bg-background", o > 0 && "shadow-[-10px_0_30px_black] shadow-black/16", l ? "pointer-events-none" : "pointer-events-auto"),
90
+ "data-scrolled": P ? "" : void 0,
116
91
  style: {
117
- "--screen-z": 10 + w,
118
- "--screen-x": ne,
119
- "--screen-bar-h": ie + "px",
120
- "--screen-safe-top": L + "px",
121
- "--screen-max-w": n.maxW == null || n.maxW === 0 || n.maxW === "" ? "none" : typeof n.maxW == "number" ? n.maxW + "px" : n.maxW,
122
- "--screen-inset": re + 28 + "px"
92
+ "--screen-z": 10 + T,
93
+ "--screen-x": te,
94
+ "--screen-bar-h": Q + "px",
95
+ "--screen-safe-top": R + "px",
96
+ "--screen-max-w": t.maxW == null || t.maxW === 0 || t.maxW === "" ? "none" : typeof t.maxW == "number" ? t.maxW + "px" : t.maxW,
97
+ "--screen-inset": ne + 28 + "px"
123
98
  },
124
99
  children: [
125
- /* @__PURE__ */ h("div", {
100
+ /* @__PURE__ */ b("div", {
126
101
  ref: (e) => {
127
- z.current = e, S(n.key, { scroller: e });
102
+ B.current = e, m(t.key, { scroller: e });
128
103
  },
129
104
  className: "bl-scroll absolute inset-0 overflow-x-hidden overflow-y-auto overscroll-contain [-webkit-overflow-scrolling:touch]",
130
- onScroll: oe,
131
- onKeyDown: ce,
132
- onPointerDown: le,
133
- onPointerMove: ue,
134
- onPointerUp: de,
135
- onPointerCancel: de,
136
- children: /* @__PURE__ */ g("div", {
137
- ref: B,
105
+ onScroll: ie,
106
+ ...$.bind,
107
+ children: /* @__PURE__ */ x("div", {
108
+ ref: V,
138
109
  className: "mx-auto box-border w-full max-w-(--screen-max-w)",
139
110
  children: [
140
- n.largeTitle ? /* @__PURE__ */ g("div", {
111
+ t.largeTitle ? /* @__PURE__ */ x("div", {
141
112
  className: "px-4 pt-[calc(var(--screen-bar-h)+2px)] pb-1.5",
142
- children: [/* @__PURE__ */ h("div", {
113
+ children: [/* @__PURE__ */ b("div", {
143
114
  className: "text-[34px] leading-[1.15] font-extrabold tracking-[-.5px]",
144
- children: /* @__PURE__ */ h("span", {
145
- ref: (e) => S(n.key, { large: e }),
146
- children: n.title
115
+ children: /* @__PURE__ */ b("span", {
116
+ ref: (e) => m(t.key, { large: e }),
117
+ children: t.title
147
118
  })
148
- }), n.subheader ? /* @__PURE__ */ h("div", {
119
+ }), t.subheader ? /* @__PURE__ */ b("div", {
149
120
  className: "mt-2.5",
150
- children: n.subheader
121
+ children: t.subheader
151
122
  }) : null]
152
- }) : /* @__PURE__ */ h("div", { className: "h-(--screen-bar-h)" }),
153
- /* @__PURE__ */ h(a.Provider, {
154
- value: ie,
155
- children: n.content
123
+ }) : /* @__PURE__ */ b("div", { className: "h-(--screen-bar-h)" }),
124
+ /* @__PURE__ */ b(i.Provider, {
125
+ value: Q,
126
+ children: t.content
156
127
  }),
157
- /* @__PURE__ */ h("div", { className: "h-(--screen-inset)" })
128
+ /* @__PURE__ */ b("div", { className: "h-(--screen-inset)" })
158
129
  ]
159
130
  })
160
131
  }),
161
- n.onRefresh ? /* @__PURE__ */ h("div", {
162
- ref: V,
132
+ t.onRefresh ? /* @__PURE__ */ b("div", {
133
+ ref: H,
163
134
  className: "pointer-events-none absolute top-[calc(var(--screen-bar-h)+8px)] left-1/2 z-5 [transform:translateX(-50%)] text-muted-foreground opacity-0 transition-opacity duration-spring-snappy ease-spring-snappy",
164
- children: /* @__PURE__ */ h(s, { spin: U })
135
+ children: /* @__PURE__ */ b(s, { spin: $.refreshing })
165
136
  }) : null,
166
- /* @__PURE__ */ g("div", {
167
- className: e("absolute inset-x-0 top-0 z-30 box-border flex h-(--screen-bar-h) items-end px-1.5 pt-(--screen-safe-top) transition-transform duration-spring-smooth ease-spring-smooth", F ? "[transform:translateY(calc(var(--screen-safe-top)-var(--screen-bar-h)))]" : "[transform:none]"),
137
+ /* @__PURE__ */ x("div", {
138
+ className: e("absolute inset-x-0 top-0 z-30 box-border flex h-(--screen-bar-h) items-end px-1.5 pt-(--screen-safe-top) transition-transform duration-spring-smooth ease-spring-smooth", I ? "[transform:translateY(calc(var(--screen-safe-top)-var(--screen-bar-h)))]" : "[transform:none]"),
168
139
  children: [
169
- /* @__PURE__ */ h("div", { className: e("absolute inset-0 [border-bottom:1px_solid_var(--border)] bg-bar backdrop-blur-[18px] backdrop-saturate-[1.7] transition-opacity duration-spring-snappy ease-spring-snappy", N ? "opacity-100" : "opacity-0") }),
170
- L ? /* @__PURE__ */ h("div", { className: e("absolute inset-x-0 top-0 h-(--screen-safe-top) bg-bar backdrop-blur-[18px] backdrop-saturate-[1.7] transition-transform duration-spring-smooth ease-spring-smooth", N || F ? "opacity-100" : "opacity-0", F ? "[transform:translateY(calc(var(--screen-bar-h)-var(--screen-safe-top)))]" : "[transform:none]") }) : null,
171
- /* @__PURE__ */ g("div", {
172
- ref: G,
173
- className: e("flex h-toolbar w-full items-center transition-opacity duration-spring-snappy ease-spring-snappy", F ? "opacity-0" : "opacity-100"),
140
+ /* @__PURE__ */ b("div", { className: e("absolute inset-0 [border-bottom:1px_solid_var(--border)] bg-bar backdrop-blur-[18px] backdrop-saturate-[1.7] transition-opacity duration-spring-snappy ease-spring-snappy", P ? "opacity-100" : "opacity-0") }),
141
+ R ? /* @__PURE__ */ b("div", { className: e("absolute inset-x-0 top-0 h-(--screen-safe-top) bg-bar backdrop-blur-[18px] backdrop-saturate-[1.7] transition-transform duration-spring-smooth ease-spring-smooth", P || I ? "opacity-100" : "opacity-0", I ? "[transform:translateY(calc(var(--screen-bar-h)-var(--screen-safe-top)))]" : "[transform:none]") }) : null,
142
+ /* @__PURE__ */ x("div", {
143
+ ref: U,
144
+ className: e("flex h-toolbar w-full items-center transition-opacity duration-spring-snappy ease-spring-snappy", I ? "opacity-0" : "opacity-100"),
174
145
  children: [
175
- /* @__PURE__ */ g("div", {
146
+ /* @__PURE__ */ x("div", {
176
147
  className: "relative z-1 flex min-w-[44px] items-center",
177
- children: [Z ? /* @__PURE__ */ g(ee, {
148
+ children: [Y ? /* @__PURE__ */ x(S, {
178
149
  className: "bl-btn flex cursor-pointer items-center border-0 bg-transparent py-1.5 pr-2 pl-0 [font-family:inherit] text-body text-primary",
179
- "aria-label": Y.mode === "none" ? "Back" : void 0,
180
- onPress: E ? E.onPress : b.canPop ? b.pop : void 0,
181
- children: [/* @__PURE__ */ h(r, {
150
+ "aria-label": q.mode === "none" ? "Back" : void 0,
151
+ onPress: D ? D.onPress : f.canPop ? f.pop : void 0,
152
+ children: [/* @__PURE__ */ b(n, {
182
153
  name: "chevL",
183
154
  size: 24,
184
155
  sw: 2.4
185
- }), Y.mode === "none" ? null : /* @__PURE__ */ h("span", {
186
- ref: (e) => S(n.key, { back: e }),
187
- "data-mode": Y.mode,
156
+ }), q.mode === "none" ? null : /* @__PURE__ */ b("span", {
157
+ ref: (e) => m(t.key, { back: e }),
158
+ "data-mode": q.mode,
188
159
  className: "max-w-(--back-w) truncate",
189
- style: { "--back-w": Y.w + "px" },
190
- children: Y.mode === "title" ? D : "Back"
160
+ style: { "--back-w": q.w + "px" },
161
+ children: q.mode === "title" ? O : "Back"
191
162
  })]
192
- }) : n.leading || null, Z ? /* @__PURE__ */ g("span", {
163
+ }) : t.leading || null, Y ? /* @__PURE__ */ x("span", {
193
164
  "aria-hidden": "true",
194
165
  className: "pointer-events-none invisible absolute top-0 left-0 flex text-body whitespace-nowrap",
195
- children: [/* @__PURE__ */ h("span", {
196
- ref: q,
197
- children: D
198
- }), /* @__PURE__ */ h("span", {
199
- ref: J,
166
+ children: [/* @__PURE__ */ b("span", {
167
+ ref: G,
168
+ children: O
169
+ }), /* @__PURE__ */ b("span", {
170
+ ref: K,
200
171
  children: "Back"
201
172
  })]
202
173
  }) : null]
203
174
  }),
204
- /* @__PURE__ */ h("div", {
175
+ /* @__PURE__ */ b("div", {
205
176
  ref: (e) => {
206
- K.current = e, S(n.key, { inline: e });
177
+ W.current = e, m(t.key, { inline: e });
207
178
  },
208
- className: e("pointer-events-none absolute left-1/2 max-w-[52%] -translate-x-1/2 truncate text-body font-semibold text-foreground transition-opacity duration-spring-snappy ease-spring-snappy", se ? "opacity-100" : "opacity-0"),
209
- children: n.title
179
+ className: e("pointer-events-none absolute left-1/2 max-w-[52%] -translate-x-1/2 truncate text-body font-semibold text-foreground transition-opacity duration-spring-snappy ease-spring-snappy", ae ? "opacity-100" : "opacity-0"),
180
+ children: t.title
210
181
  }),
211
- /* @__PURE__ */ h("div", {
182
+ /* @__PURE__ */ b("div", {
212
183
  className: "relative z-1 ml-auto flex items-center",
213
- children: n.trailing || null
184
+ children: t.trailing || null
214
185
  })
215
186
  ]
216
187
  })
217
188
  ]
218
189
  }),
219
- n.overlay || null,
220
- /* @__PURE__ */ h("div", {
221
- ref: (e) => S(n.key, { dim: e }),
222
- className: e("pointer-events-none absolute inset-0 z-200 bg-black transition-opacity duration-spring-smooth ease-spring-smooth", Q ? "opacity-12" : "opacity-0")
190
+ t.overlay || null,
191
+ /* @__PURE__ */ b("div", {
192
+ ref: (e) => m(t.key, { dim: e }),
193
+ className: e("pointer-events-none absolute inset-0 z-200 bg-black transition-opacity duration-spring-smooth ease-spring-smooth", X ? "opacity-12" : "opacity-0")
223
194
  })
224
195
  ]
225
196
  });
226
197
  }
227
- var y = (e, t, n) => e + (t - e) * n, b = (e) => Math.max(0, Math.min(1, e));
228
- function x(e) {
229
- return e ? e.large && !e.el?.hasAttribute("data-scrolled") ? e.large : e.inline && parseFloat(getComputedStyle(e.inline).opacity) > .5 ? e.inline : null : null;
230
- }
231
- function S(e) {
232
- return e?.back && e.back.dataset.mode === "title" ? e.back : null;
233
- }
234
- function C(e, t, n, r) {
235
- let i = e.getBoundingClientRect(), a = t.getBoundingClientRect(), o = n.getBoundingClientRect();
236
- if (!a.width || !o.width) return null;
237
- let s = r ? r.getBoundingClientRect() : i, c = {
238
- x: a.left - i.left,
239
- y: a.top - i.top,
240
- w: a.width,
241
- h: a.height
242
- }, l = {
243
- x: o.left - s.left,
244
- y: o.top - s.top,
245
- w: o.width,
246
- h: o.height
247
- }, u = getComputedStyle(t), d = getComputedStyle(n), f = (parseFloat(d.fontSize) || 17) / (parseFloat(u.fontSize) || 17), p = document.createElement("div");
248
- p.setAttribute("aria-hidden", "true"), p.dataset.slot = "navigation-title-flight", Object.assign(p.style, {
249
- position: "absolute",
250
- inset: "0",
251
- pointerEvents: "none",
252
- zIndex: "300",
253
- overflow: "hidden"
254
- });
255
- let m = (e, t, n) => {
256
- let r = document.createElement("div");
257
- return r.innerHTML = e.innerHTML, Object.assign(r.style, {
258
- position: "absolute",
259
- left: "0",
260
- top: "0",
261
- width: n.w + "px",
262
- height: n.h + "px",
263
- whiteSpace: "nowrap",
264
- overflow: "hidden",
265
- textOverflow: "ellipsis",
266
- transformOrigin: "0 50%",
267
- willChange: "transform, opacity",
268
- color: t.color,
269
- fontFamily: t.fontFamily,
270
- fontSize: t.fontSize,
271
- fontWeight: t.fontWeight,
272
- letterSpacing: t.letterSpacing,
273
- lineHeight: n.h + "px"
274
- }), p.appendChild(r), r;
275
- }, h = m(t, u, c), g = m(n, d, l);
276
- return e.appendChild(p), t.style.visibility = "hidden", n.style.visibility = "hidden", {
277
- set(e) {
278
- let t = y(c.x, l.x, e), n = y(c.y + c.h / 2, l.y + l.h / 2, e);
279
- h.style.transform = `translate(${t}px, ${n - c.h / 2}px) scale(${y(1, f, e)})`, g.style.transform = `translate(${t}px, ${n - l.h / 2}px) scale(${y(1 / f, 1, e)})`, h.style.opacity = String(b(1 - e * 1.8)), g.style.opacity = String(b((e - .2) / .6));
280
- },
281
- done() {
282
- t.style.visibility = "", n.style.visibility = "", p.remove();
283
- }
284
- };
285
- }
286
- var w = _.settleMs, T = /* @__PURE__ */ new Set(), E = !1, D = typeof matchMedia < "u" && matchMedia("(any-pointer: coarse)").matches;
287
- function O() {
288
- if (!(!D || E)) try {
289
- history.pushState({ blNav: 1 }, ""), E = !0;
290
- } catch {
291
- D = !1;
292
- }
293
- }
294
- typeof window < "u" && !window.__tkPopstate && (window.__tkPopstate = 1, window.addEventListener("popstate", () => {
295
- if (!E) return;
296
- E = !1;
297
- let e = null;
298
- T.forEach((t) => {
299
- let n = t();
300
- n.depth > 1 && (e = n);
301
- }), e && (e.pop(), setTimeout(() => {
302
- let e = !1;
303
- T.forEach((t) => {
304
- t().depth > 1 && (e = !0);
305
- }), e && O();
306
- }, 80));
307
- }));
308
- function k({ screens: r, onPop: a, defIns: o, safeTop: s, rootBack: u, className: g, style: ee }) {
309
- let y = r[0]?.title, b = c(typeof y == "string" ? y : void 0), E = u === !1 ? null : u ?? (b ? {
310
- title: b.title,
311
- onPress: b.back
312
- } : null), D = p(null), k = p({}), A = (e, t) => {
313
- k.current[e] = {
314
- ...k.current[e],
198
+ var T = C.settleMs;
199
+ function E({ screens: n, onPop: i, defIns: a, safeTop: s, rootBack: u, className: h, style: g }) {
200
+ let x = n[0]?.title, S = m(typeof x == "string" ? x : void 0), E = u === !1 ? null : u ?? (S ? {
201
+ title: S.title,
202
+ onPress: S.back
203
+ } : null), D = v(null), O = v({}), k = (e, t) => {
204
+ O.current[e] = {
205
+ ...O.current[e],
315
206
  ...t
316
207
  };
317
- }, [j, M] = m({
208
+ }, [A, j] = y({
318
209
  enter: null,
319
210
  exit: null
320
- }), N = p(r), P = p(!1), F = p(null), I = p(a);
321
- I.current = a;
322
- let L = p(null), R = p(null), z = () => {
323
- let e = R.current;
324
- R.current = null, e && (e.run?.stop(), e.f.done());
325
- }, B = () => typeof matchMedia < "u" && matchMedia("(prefers-reduced-motion: reduce)").matches, V = (e) => {
326
- z(), !B() && requestAnimationFrame(() => {
327
- let [t, r, i] = e();
328
- if (!t || !r || !D.current) return;
329
- let a = C(D.current, t, r, i);
330
- if (!a) return;
331
- a.set(0);
332
- let o = { f: a };
333
- R.current = o, o.run = l(0, 1, {
334
- ...n.smooth,
335
- onUpdate: a.set,
336
- onComplete: () => {
337
- R.current === o && z();
338
- }
339
- });
340
- });
341
- };
342
- d(() => z, []);
343
- let H = r.map((e) => e.key).join("¦");
344
- f(() => {
345
- let e = N.current;
346
- N.current = r;
347
- let t = e.map((e) => e.key), n = r.map((e) => e.key);
348
- if (t.join("¦") === H) return;
349
- clearTimeout(F.current);
211
+ }), M = v(n), N = v(!1), P = v(void 0), F = v(i);
212
+ F.current = i;
213
+ let I = p(D), L = v({}), R = () => !document.activeElement || document.activeElement === document.body || !!D.current?.contains(document.activeElement), z = n.map((e) => e.key).join("¦");
214
+ _(() => {
215
+ let e = M.current;
216
+ M.current = n;
217
+ let t = e.map((e) => e.key), r = n.map((e) => e.key);
218
+ if (t.join("¦") === z) return;
219
+ clearTimeout(P.current);
350
220
  let i = (e, t) => e.every((e, n) => t[n] === e);
351
- if (n.length > t.length && i(t, n)) {
352
- M({
353
- enter: n[n.length - 1],
221
+ if (r.length > t.length && i(t, r)) {
222
+ j({
223
+ enter: r[r.length - 1],
354
224
  exit: null
355
225
  });
356
- let e = t[t.length - 1], r = n[n.length - 1];
357
- V(() => [
358
- x(k.current[e]),
359
- S(k.current[r]),
360
- k.current[r]?.el
361
- ]), O(), F.current = setTimeout(() => M({
226
+ let e = t[t.length - 1], n = r[r.length - 1];
227
+ I.fly(() => [
228
+ f(O.current[e]),
229
+ d(O.current[n]),
230
+ O.current[n]?.el
231
+ ]), c(), R() && requestAnimationFrame(() => O.current[n]?.el?.focus({ preventScroll: !0 })), P.current = setTimeout(() => j({
362
232
  enter: null,
363
233
  exit: null
364
- }), w);
365
- } else if (n.length < t.length && i(n, t)) {
366
- if (P.current) {
367
- P.current = !1, M({
234
+ }), T);
235
+ } else if (r.length < t.length && i(r, t)) {
236
+ if (N.current) {
237
+ N.current = !1, j({
368
238
  enter: null,
369
239
  exit: null
370
240
  });
371
241
  return;
372
242
  }
373
- M({
243
+ j({
374
244
  enter: null,
375
- exit: e.slice(n.length)
245
+ exit: e.slice(r.length)
376
246
  });
377
- let r = t[t.length - 1], i = n[n.length - 1];
378
- V(() => [
379
- S(k.current[r]),
380
- x(k.current[i]),
381
- k.current[i]?.el
382
- ]), F.current = setTimeout(() => M({
247
+ let n = t[t.length - 1], i = r[r.length - 1];
248
+ I.fly(() => [
249
+ d(O.current[n]),
250
+ f(O.current[i]),
251
+ O.current[i]?.el
252
+ ]), R() && requestAnimationFrame(() => {
253
+ let e = L.current[i];
254
+ (e?.isConnected ? e : O.current[i]?.el)?.focus({ preventScroll: !0 });
255
+ }), P.current = setTimeout(() => j({
383
256
  enter: null,
384
257
  exit: null
385
- }), w);
386
- } else M({
258
+ }), T);
259
+ } else j({
387
260
  enter: null,
388
261
  exit: null
389
262
  });
390
- }, [H]);
391
- let U = j.exit || [], W = r.length > 1, G = p(0);
392
- G.current = r.length, d(() => {
393
- let e = () => ({
394
- depth: G.current,
395
- pop: () => I.current && I.current()
396
- });
397
- return T.add(e), () => {
398
- T.delete(e);
399
- };
400
- }, []);
401
- let K = (e) => {
402
- if (e.button || j.enter || j.exit || r.length < 2) return;
403
- let t = D.current.getBoundingClientRect();
404
- if (e.clientX - t.left > _.edge) return;
405
- let n = k.current[r[r.length - 1].key], i = k.current[r[r.length - 2].key];
406
- if (!(!n || !n.el || !i || !i.el)) {
407
- L.current = {
408
- x0: e.clientX,
409
- y0: e.clientY,
410
- w: t.width,
411
- topR: n,
412
- undR: i,
413
- last: e.clientX,
414
- lt: performance.now(),
415
- vel: 0,
416
- moved: !1,
417
- on: !1
263
+ }, [z]);
264
+ let B = A.exit || [], V = n.length > 1;
265
+ l(n.length, () => F.current?.());
266
+ let H = (e) => [e.top, e.under].forEach((e) => {
267
+ e.el.style.transition = "", e.el.style.transform = "", e.dim && (e.dim.style.transition = "", e.dim.style.opacity = "");
268
+ }), U = o({
269
+ target: () => D.current,
270
+ edge: C.edge,
271
+ commit: C.commit,
272
+ flick: C.flick,
273
+ begin: () => {
274
+ if (A.enter || A.exit || n.length < 2) return null;
275
+ let e = O.current[n[n.length - 1].key], t = O.current[n[n.length - 2].key];
276
+ return !e?.el || !t?.el ? null : {
277
+ top: e,
278
+ under: t,
279
+ flight: null
418
280
  };
419
- try {
420
- D.current.setPointerCapture(e.pointerId);
421
- } catch {}
422
- }
423
- }, q = (e) => {
424
- let t = L.current;
425
- if (!t) return;
426
- let n = e.clientX - t.x0, r = e.clientY - t.y0;
427
- if (!t.on) {
428
- if (n > 8 && n > Math.abs(r) * 1.2) {
429
- t.on = !0, z();
430
- let e = S(t.topR), n = x(t.undR), r = !B() && e && n ? C(D.current, e, n, t.undR.el) : null;
431
- r && (r.set(0), R.current = { f: r }, t.flight = R.current);
432
- } else {
433
- Math.abs(r) > 14 && (L.current = null);
434
- return;
435
- }
436
- }
437
- let i = Math.max(0, n);
438
- t.moved = !0, t.dx = i, t.vel = (e.clientX - t.last) / Math.max(1, performance.now() - t.lt), t.last = e.clientX, t.lt = performance.now();
439
- let a = i / t.w;
440
- try {
441
- t.topR.el.style.transition = "none", t.topR.el.style.transform = `translateX(${i}px)`, t.undR.el.style.transition = "none", t.undR.el.style.transform = `translateX(${_.underPct * (1 - a)}%)`, t.undR.dim && (t.undR.dim.style.transition = "none", t.undR.dim.style.opacity = String(_.dim * (1 - a))), t.flight && R.current === t.flight && t.flight.f.set(a);
442
- } catch {
443
- L.current = null;
444
- }
445
- }, J = () => {
446
- let e = L.current;
447
- if (!e) return;
448
- if (L.current = null, !e.moved || !e.on) {
449
- Y(e);
450
- return;
451
- }
452
- let r = (e.dx || 0) / e.w, i = r > _.commit || e.vel > _.flick, a = t("transform", "tray"), o = e.flight && R.current === e.flight ? e.flight : null;
453
- o && (o.run = l(r, +!!i, {
454
- ...n.tray,
455
- onUpdate: o.f.set,
456
- onComplete: () => {
457
- R.current === o && z();
458
- }
459
- })), i ? (e.topR.el.style.transition = a, e.topR.el.style.transform = "translateX(104%)", e.undR.el.style.transition = a, e.undR.el.style.transform = "translateX(0%)", e.undR.dim && (e.undR.dim.style.transition = t("opacity", "tray"), e.undR.dim.style.opacity = "0"), P.current = !0, setTimeout(() => {
460
- I.current && I.current(), requestAnimationFrame(() => Y(e));
461
- }, 380)) : (e.topR.el.style.transition = a, e.topR.el.style.transform = "translateX(0px)", e.undR.el.style.transition = a, e.undR.el.style.transform = `translateX(${_.under})`, e.undR.dim && (e.undR.dim.style.transition = t("opacity", "tray"), e.undR.dim.style.opacity = String(_.dim)), setTimeout(() => Y(e), 430));
462
- }, Y = (e) => [e.topR, e.undR].forEach((e) => {
463
- try {
464
- e && e.el && (e.el.style.transition = "", e.el.style.transform = ""), e && e.dim && (e.dim.style.transition = "", e.dim.style.opacity = "");
465
- } catch {}
466
- }), X = r.length - 1, Z = N.current.map((e) => e.key), Q = r.length > Z.length && Z.every((e, t) => r[t] && r[t].key === e) ? r[X].key : null, $ = [...r.map((e, t) => ({
281
+ },
282
+ engage: (e) => {
283
+ e.flight = I.scrub(d(e.top), f(e.under), e.under.el);
284
+ },
285
+ move: (e, t, n) => {
286
+ e.top.el.style.transition = "none", e.top.el.style.transform = `translateX(${n}px)`, e.under.el.style.transition = "none", e.under.el.style.transform = `translateX(${C.underPct * (1 - t)}%)`, e.under.dim && (e.under.dim.style.transition = "none", e.under.dim.style.opacity = String(C.dim * (1 - t))), I.isCurrent(e.flight) && e.flight.f.set(t);
287
+ },
288
+ release: (e, { p: n, commit: r }) => {
289
+ let i = t("transform", "tray");
290
+ I.release(e.flight, n, +!!r), r ? (e.top.el.style.transition = i, e.top.el.style.transform = "translateX(104%)", e.under.el.style.transition = i, e.under.el.style.transform = "translateX(0%)", e.under.dim && (e.under.dim.style.transition = t("opacity", "tray"), e.under.dim.style.opacity = "0"), N.current = !0, setTimeout(() => {
291
+ F.current?.(), requestAnimationFrame(() => H(e));
292
+ }, 380)) : (e.top.el.style.transition = i, e.top.el.style.transform = "translateX(0px)", e.under.el.style.transition = i, e.under.el.style.transform = `translateX(${C.under})`, e.under.dim && (e.under.dim.style.transition = t("opacity", "tray"), e.under.dim.style.opacity = String(C.dim)), setTimeout(() => H(e), 430));
293
+ },
294
+ abort: H
295
+ }), W = n.length - 1, G = M.current.map((e) => e.key), K = n.length > G.length && G.every((e, t) => n[t] && n[t].key === e) ? n[W].key : null, q = [...n.map((e, t) => ({
467
296
  sc: e,
468
297
  i: t,
469
298
  ghost: !1
470
- })), ...U.map((e, t) => ({
299
+ })), ...B.map((e, t) => ({
471
300
  sc: e,
472
- i: r.length + t,
301
+ i: n.length + t,
473
302
  ghost: !0
474
- }))], te = $.length - 1, ne = /* @__PURE__ */ h("div", {
303
+ }))], J = q.length - 1, Y = /* @__PURE__ */ b("div", {
475
304
  ref: D,
476
305
  "data-slot": "navigation-stack",
477
- onPointerDownCapture: K,
478
- onPointerMove: q,
479
- onPointerUp: J,
480
- onPointerCancel: J,
481
- className: e("absolute inset-0 touch-pan-y overflow-hidden", g),
482
- style: ee,
483
- children: $.map((e) => /* @__PURE__ */ h(v, {
306
+ ...U.bind,
307
+ onFocusCapture: (e) => {
308
+ let t = e.target.closest("[data-slot=screen]")?.getAttribute("data-screen-key");
309
+ t && e.target !== e.currentTarget && e.target.getAttribute("data-slot") !== "screen" && (L.current[t] = e.target);
310
+ },
311
+ className: e("absolute inset-0 touch-pan-y overflow-hidden", h),
312
+ style: g,
313
+ children: q.map((e) => /* @__PURE__ */ b(w, {
484
314
  sc: e.sc,
485
315
  depth: e.i,
486
- top: e.ghost ? te : X,
316
+ top: e.ghost ? J : W,
487
317
  ghost: e.ghost,
488
- entering: !e.ghost && (j.enter === e.sc.key || Q === e.sc.key) && e.i === X,
318
+ entering: !e.ghost && (A.enter === e.sc.key || K === e.sc.key) && e.i === W,
489
319
  nav: {
490
- pop: () => I.current && I.current(),
491
- canPop: W && !e.ghost
320
+ pop: () => F.current?.(),
321
+ canPop: V && !e.ghost
492
322
  },
493
- backTitle: e.i > 0 ? e.ghost ? r[r.length - 1] && r[r.length - 1].title : r[e.i - 1].title : null,
494
- reg: A,
495
- defIns: o,
323
+ backTitle: e.i > 0 ? e.ghost ? n[n.length - 1] && n[n.length - 1].title : n[e.i - 1].title : null,
324
+ reg: k,
325
+ defIns: a,
496
326
  z: e.i,
497
327
  rootBack: E
498
328
  }, e.sc.key))
499
329
  });
500
- return s == null ? ne : /* @__PURE__ */ h(i.Provider, {
330
+ return s == null ? Y : /* @__PURE__ */ b(r.Provider, {
501
331
  value: parseFloat(String(s)) || 0,
502
- children: ne
332
+ children: Y
503
333
  });
504
334
  }
505
335
  //#endregion
506
- export { k as NavigationStack, v as ScreenWrap, _ as navigationPush };
336
+ export { E as NavigationStack, w as ScreenWrap, C as navigationPush };