@ssgoi/core 5.2.2 → 6.1.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 (274) hide show
  1. package/README.md +5 -6
  2. package/dist/animation/animation.d.ts +68 -0
  3. package/dist/animation/animation.d.ts.map +1 -0
  4. package/dist/animation/host-animation.d.ts +45 -0
  5. package/dist/animation/host-animation.d.ts.map +1 -0
  6. package/dist/animation/index.d.ts +6 -0
  7. package/dist/animation/index.d.ts.map +1 -0
  8. package/dist/animation/integrator/double-spring-integrator.d.ts.map +1 -0
  9. package/dist/{animator → animation}/integrator/index.d.ts +1 -0
  10. package/dist/animation/integrator/index.d.ts.map +1 -0
  11. package/dist/animation/integrator/inertia-integrator.d.ts.map +1 -0
  12. package/dist/animation/integrator/linear-integrator.d.ts +23 -0
  13. package/dist/animation/integrator/linear-integrator.d.ts.map +1 -0
  14. package/dist/{animator → animation}/integrator/provider.d.ts +1 -1
  15. package/dist/animation/integrator/provider.d.ts.map +1 -0
  16. package/dist/animation/integrator/spring-integrator.d.ts.map +1 -0
  17. package/dist/animation/integrator/types.d.ts.map +1 -0
  18. package/dist/animation/multi-animation.d.ts +55 -0
  19. package/dist/animation/multi-animation.d.ts.map +1 -0
  20. package/dist/animation/web-animation.d.ts +65 -0
  21. package/dist/animation/web-animation.d.ts.map +1 -0
  22. package/dist/index.cjs +35 -1
  23. package/dist/index.d.ts +4 -7
  24. package/dist/index.d.ts.map +1 -1
  25. package/dist/index.js +1702 -1186
  26. package/dist/internal.cjs +1 -0
  27. package/dist/internal.d.ts +4 -0
  28. package/dist/internal.d.ts.map +1 -0
  29. package/dist/internal.js +511 -0
  30. package/dist/multi-animation-CnxqLEka.js +322 -0
  31. package/dist/multi-animation-Dw2JTJI2.cjs +1 -0
  32. package/dist/ssgoi-transition/create-context-manager.d.ts +1 -1
  33. package/dist/ssgoi-transition/create-context-manager.d.ts.map +1 -1
  34. package/dist/ssgoi-transition/create-ssgoi-transition-context.d.ts +18 -31
  35. package/dist/ssgoi-transition/create-ssgoi-transition-context.d.ts.map +1 -1
  36. package/dist/ssgoi-transition/find-matching-transition.d.ts +4 -4
  37. package/dist/ssgoi-transition/find-matching-transition.d.ts.map +1 -1
  38. package/dist/ssgoi-transition/navigation-detector-strategy.d.ts +5 -15
  39. package/dist/ssgoi-transition/navigation-detector-strategy.d.ts.map +1 -1
  40. package/dist/ssgoi-transition/process-symmetric-transitions.d.ts +2 -2
  41. package/dist/ssgoi-transition/process-symmetric-transitions.d.ts.map +1 -1
  42. package/dist/ssgoi-transition/unmount-observer.d.ts +17 -0
  43. package/dist/ssgoi-transition/unmount-observer.d.ts.map +1 -0
  44. package/dist/transitions/axis/index.d.ts +43 -0
  45. package/dist/transitions/axis/index.d.ts.map +1 -0
  46. package/dist/transitions/axis/provider/index.d.ts +8 -0
  47. package/dist/transitions/axis/provider/index.d.ts.map +1 -0
  48. package/dist/transitions/axis/provider/x/fluid.d.ts +3 -0
  49. package/dist/transitions/axis/provider/x/fluid.d.ts.map +1 -0
  50. package/dist/transitions/axis/provider/x/index.d.ts +3 -0
  51. package/dist/transitions/axis/provider/x/index.d.ts.map +1 -0
  52. package/dist/transitions/axis/provider/x/snappy.d.ts +3 -0
  53. package/dist/transitions/axis/provider/x/snappy.d.ts.map +1 -0
  54. package/dist/transitions/axis/provider/y.d.ts +3 -0
  55. package/dist/transitions/axis/provider/y.d.ts.map +1 -0
  56. package/dist/transitions/axis/provider/z.d.ts +3 -0
  57. package/dist/transitions/axis/provider/z.d.ts.map +1 -0
  58. package/dist/transitions/axis/transition.d.ts +5 -0
  59. package/dist/transitions/axis/transition.d.ts.map +1 -0
  60. package/dist/transitions/axis/types.d.ts +52 -0
  61. package/dist/transitions/axis/types.d.ts.map +1 -0
  62. package/dist/transitions/blind/index.d.ts +15 -0
  63. package/dist/transitions/blind/index.d.ts.map +1 -0
  64. package/dist/transitions/blind/transition.d.ts +16 -0
  65. package/dist/transitions/blind/transition.d.ts.map +1 -0
  66. package/dist/transitions/drill/index.d.ts +40 -0
  67. package/dist/transitions/drill/index.d.ts.map +1 -0
  68. package/dist/transitions/drill/provider/crossfade.d.ts +3 -0
  69. package/dist/transitions/drill/provider/crossfade.d.ts.map +1 -0
  70. package/dist/transitions/drill/provider/index.d.ts +3 -0
  71. package/dist/transitions/drill/provider/index.d.ts.map +1 -0
  72. package/dist/transitions/drill/provider/parallax.d.ts +3 -0
  73. package/dist/transitions/drill/provider/parallax.d.ts.map +1 -0
  74. package/dist/transitions/drill/transition.d.ts +5 -0
  75. package/dist/transitions/drill/transition.d.ts.map +1 -0
  76. package/dist/transitions/drill/types.d.ts +33 -0
  77. package/dist/transitions/drill/types.d.ts.map +1 -0
  78. package/dist/transitions/fade/index.d.ts +16 -0
  79. package/dist/transitions/fade/index.d.ts.map +1 -0
  80. package/dist/transitions/fade/transition.d.ts +6 -0
  81. package/dist/transitions/fade/transition.d.ts.map +1 -0
  82. package/dist/transitions/fade/types.d.ts +14 -0
  83. package/dist/transitions/fade/types.d.ts.map +1 -0
  84. package/dist/transitions/film/index.d.ts +16 -0
  85. package/dist/transitions/film/index.d.ts.map +1 -0
  86. package/dist/transitions/film/transition.d.ts +27 -0
  87. package/dist/transitions/film/transition.d.ts.map +1 -0
  88. package/dist/transitions/film/types.d.ts +16 -0
  89. package/dist/transitions/film/types.d.ts.map +1 -0
  90. package/dist/transitions/hero/index.d.ts +17 -0
  91. package/dist/transitions/hero/index.d.ts.map +1 -0
  92. package/dist/transitions/hero/transition.d.ts +7 -0
  93. package/dist/transitions/hero/transition.d.ts.map +1 -0
  94. package/dist/transitions/hero/types.d.ts +12 -0
  95. package/dist/transitions/hero/types.d.ts.map +1 -0
  96. package/dist/transitions/index.d.ts +11 -12
  97. package/dist/transitions/index.d.ts.map +1 -1
  98. package/dist/transitions/jaemin/index.d.ts +16 -0
  99. package/dist/transitions/jaemin/index.d.ts.map +1 -0
  100. package/dist/transitions/jaemin/transition.d.ts +18 -0
  101. package/dist/transitions/jaemin/transition.d.ts.map +1 -0
  102. package/dist/transitions/jaemin/types.d.ts +9 -0
  103. package/dist/transitions/jaemin/types.d.ts.map +1 -0
  104. package/dist/transitions/rotate/index.d.ts +15 -0
  105. package/dist/transitions/rotate/index.d.ts.map +1 -0
  106. package/dist/transitions/rotate/transition.d.ts +6 -0
  107. package/dist/transitions/rotate/transition.d.ts.map +1 -0
  108. package/dist/transitions/rotate/types.d.ts +9 -0
  109. package/dist/transitions/rotate/types.d.ts.map +1 -0
  110. package/dist/transitions/scroll/index.d.ts +15 -0
  111. package/dist/transitions/scroll/index.d.ts.map +1 -0
  112. package/dist/transitions/scroll/transition.d.ts +7 -0
  113. package/dist/transitions/scroll/transition.d.ts.map +1 -0
  114. package/dist/transitions/sheet/index.d.ts +41 -0
  115. package/dist/transitions/sheet/index.d.ts.map +1 -0
  116. package/dist/transitions/sheet/provider/background-scale.d.ts +3 -0
  117. package/dist/transitions/sheet/provider/background-scale.d.ts.map +1 -0
  118. package/dist/transitions/sheet/provider/index.d.ts +3 -0
  119. package/dist/transitions/sheet/provider/index.d.ts.map +1 -0
  120. package/dist/transitions/sheet/provider/static.d.ts +3 -0
  121. package/dist/transitions/sheet/provider/static.d.ts.map +1 -0
  122. package/dist/transitions/sheet/transition.d.ts +5 -0
  123. package/dist/transitions/sheet/transition.d.ts.map +1 -0
  124. package/dist/transitions/sheet/types.d.ts +29 -0
  125. package/dist/transitions/sheet/types.d.ts.map +1 -0
  126. package/dist/transitions/slide/index.d.ts +16 -0
  127. package/dist/transitions/slide/index.d.ts.map +1 -0
  128. package/dist/transitions/slide/transition.d.ts +7 -0
  129. package/dist/transitions/slide/transition.d.ts.map +1 -0
  130. package/dist/transitions/slide/types.d.ts +10 -0
  131. package/dist/transitions/slide/types.d.ts.map +1 -0
  132. package/dist/transitions/strip/index.d.ts +16 -0
  133. package/dist/transitions/strip/index.d.ts.map +1 -0
  134. package/dist/transitions/strip/transition.d.ts +6 -0
  135. package/dist/transitions/strip/transition.d.ts.map +1 -0
  136. package/dist/transitions/strip/types.d.ts +9 -0
  137. package/dist/transitions/strip/types.d.ts.map +1 -0
  138. package/dist/transitions/utils.d.ts +25 -5
  139. package/dist/transitions/utils.d.ts.map +1 -1
  140. package/dist/transitions/zoom/index.d.ts +22 -0
  141. package/dist/transitions/zoom/index.d.ts.map +1 -0
  142. package/dist/transitions/zoom/provider/blur.d.ts +14 -0
  143. package/dist/transitions/zoom/provider/blur.d.ts.map +1 -0
  144. package/dist/transitions/zoom/provider/expand.d.ts +10 -0
  145. package/dist/transitions/zoom/provider/expand.d.ts.map +1 -0
  146. package/dist/transitions/zoom/provider/index.d.ts +12 -0
  147. package/dist/transitions/zoom/provider/index.d.ts.map +1 -0
  148. package/dist/transitions/zoom/provider/static.d.ts +10 -0
  149. package/dist/transitions/zoom/provider/static.d.ts.map +1 -0
  150. package/dist/transitions/zoom/transition.d.ts +5 -0
  151. package/dist/transitions/zoom/transition.d.ts.map +1 -0
  152. package/dist/transitions/zoom/types.d.ts +109 -0
  153. package/dist/transitions/zoom/types.d.ts.map +1 -0
  154. package/dist/transitions/zoom/zoom-element.d.ts +4 -0
  155. package/dist/transitions/zoom/zoom-element.d.ts.map +1 -0
  156. package/dist/types/index.d.ts +174 -0
  157. package/dist/types/index.d.ts.map +1 -0
  158. package/dist/types.cjs +1 -1
  159. package/dist/types.d.ts +2 -504
  160. package/dist/types.js +3 -77
  161. package/dist/utils/get-viewport-rect.d.ts +17 -0
  162. package/dist/utils/get-viewport-rect.d.ts.map +1 -0
  163. package/dist/utils/index.d.ts +2 -0
  164. package/dist/utils/index.d.ts.map +1 -1
  165. package/dist/utils/prepare-outgoing.d.ts +2 -2
  166. package/dist/utils/prepare-outgoing.d.ts.map +1 -1
  167. package/dist/utils/promise-all.d.ts +18 -0
  168. package/dist/utils/promise-all.d.ts.map +1 -0
  169. package/package.json +7 -19
  170. package/dist/animator/integrator/double-spring-integrator.d.ts.map +0 -1
  171. package/dist/animator/integrator/index.d.ts.map +0 -1
  172. package/dist/animator/integrator/inertia-integrator.d.ts.map +0 -1
  173. package/dist/animator/integrator/provider.d.ts.map +0 -1
  174. package/dist/animator/integrator/spring-integrator.d.ts.map +0 -1
  175. package/dist/animator/integrator/types.d.ts.map +0 -1
  176. package/dist/animator/multi-animator.d.ts +0 -101
  177. package/dist/animator/multi-animator.d.ts.map +0 -1
  178. package/dist/animator/runner/css-runner.d.ts +0 -17
  179. package/dist/animator/runner/css-runner.d.ts.map +0 -1
  180. package/dist/animator/runner/keyframes-runner.d.ts +0 -14
  181. package/dist/animator/runner/keyframes-runner.d.ts.map +0 -1
  182. package/dist/animator/runner/provider.d.ts +0 -44
  183. package/dist/animator/runner/provider.d.ts.map +0 -1
  184. package/dist/animator/runner/tick-runner.d.ts +0 -16
  185. package/dist/animator/runner/tick-runner.d.ts.map +0 -1
  186. package/dist/animator/runner/ticker.d.ts +0 -38
  187. package/dist/animator/runner/ticker.d.ts.map +0 -1
  188. package/dist/animator/runner/types.d.ts +0 -34
  189. package/dist/animator/runner/types.d.ts.map +0 -1
  190. package/dist/animator/single-animator.d.ts +0 -65
  191. package/dist/animator/single-animator.d.ts.map +0 -1
  192. package/dist/animator/types.d.ts +0 -57
  193. package/dist/animator/types.d.ts.map +0 -1
  194. package/dist/presets/index.cjs +0 -1
  195. package/dist/presets/index.d.ts +0 -22
  196. package/dist/presets/index.d.ts.map +0 -1
  197. package/dist/presets/index.js +0 -50
  198. package/dist/provider-B2B8CK6H.js +0 -142
  199. package/dist/provider-BKaONTeg.cjs +0 -1
  200. package/dist/spring-integrator-95Mh7mdw.cjs +0 -1
  201. package/dist/spring-integrator-BM4a-82c.js +0 -33
  202. package/dist/transition/create-transition-callback.d.ts +0 -8
  203. package/dist/transition/create-transition-callback.d.ts.map +0 -1
  204. package/dist/transition/transition-scope.d.ts +0 -36
  205. package/dist/transition/transition-scope.d.ts.map +0 -1
  206. package/dist/transition/transition-strategy.d.ts +0 -75
  207. package/dist/transition/transition-strategy.d.ts.map +0 -1
  208. package/dist/transition/transition.d.ts +0 -51
  209. package/dist/transition/transition.d.ts.map +0 -1
  210. package/dist/transition/unmount-observer.d.ts +0 -43
  211. package/dist/transition/unmount-observer.d.ts.map +0 -1
  212. package/dist/transitions/blur.d.ts +0 -12
  213. package/dist/transitions/blur.d.ts.map +0 -1
  214. package/dist/transitions/bounce.d.ts +0 -13
  215. package/dist/transitions/bounce.d.ts.map +0 -1
  216. package/dist/transitions/fade.d.ts +0 -10
  217. package/dist/transitions/fade.d.ts.map +0 -1
  218. package/dist/transitions/fly.d.ts +0 -11
  219. package/dist/transitions/fly.d.ts.map +0 -1
  220. package/dist/transitions/index.cjs +0 -1
  221. package/dist/transitions/index.js +0 -285
  222. package/dist/transitions/mask.d.ts +0 -12
  223. package/dist/transitions/mask.d.ts.map +0 -1
  224. package/dist/transitions/none.d.ts +0 -8
  225. package/dist/transitions/none.d.ts.map +0 -1
  226. package/dist/transitions/rotate.d.ts +0 -15
  227. package/dist/transitions/rotate.d.ts.map +0 -1
  228. package/dist/transitions/scale.d.ts +0 -11
  229. package/dist/transitions/scale.d.ts.map +0 -1
  230. package/dist/transitions/slide.d.ts +0 -13
  231. package/dist/transitions/slide.d.ts.map +0 -1
  232. package/dist/types.d.ts.map +0 -1
  233. package/dist/view-transitions/blind.d.ts +0 -11
  234. package/dist/view-transitions/blind.d.ts.map +0 -1
  235. package/dist/view-transitions/curtain-reveal.d.ts +0 -18
  236. package/dist/view-transitions/curtain-reveal.d.ts.map +0 -1
  237. package/dist/view-transitions/depth.d.ts +0 -21
  238. package/dist/view-transitions/depth.d.ts.map +0 -1
  239. package/dist/view-transitions/drill.d.ts +0 -9
  240. package/dist/view-transitions/drill.d.ts.map +0 -1
  241. package/dist/view-transitions/fade.d.ts +0 -8
  242. package/dist/view-transitions/fade.d.ts.map +0 -1
  243. package/dist/view-transitions/film.d.ts +0 -10
  244. package/dist/view-transitions/film.d.ts.map +0 -1
  245. package/dist/view-transitions/hero.d.ts +0 -9
  246. package/dist/view-transitions/hero.d.ts.map +0 -1
  247. package/dist/view-transitions/index.cjs +0 -35
  248. package/dist/view-transitions/index.d.ts +0 -18
  249. package/dist/view-transitions/index.d.ts.map +0 -1
  250. package/dist/view-transitions/index.js +0 -1614
  251. package/dist/view-transitions/instagram.d.ts +0 -8
  252. package/dist/view-transitions/instagram.d.ts.map +0 -1
  253. package/dist/view-transitions/jaemin.d.ts +0 -21
  254. package/dist/view-transitions/jaemin.d.ts.map +0 -1
  255. package/dist/view-transitions/pinterest.d.ts +0 -8
  256. package/dist/view-transitions/pinterest.d.ts.map +0 -1
  257. package/dist/view-transitions/rotate.d.ts +0 -6
  258. package/dist/view-transitions/rotate.d.ts.map +0 -1
  259. package/dist/view-transitions/scroll.d.ts +0 -8
  260. package/dist/view-transitions/scroll.d.ts.map +0 -1
  261. package/dist/view-transitions/sheet.d.ts +0 -21
  262. package/dist/view-transitions/sheet.d.ts.map +0 -1
  263. package/dist/view-transitions/slide.d.ts +0 -8
  264. package/dist/view-transitions/slide.d.ts.map +0 -1
  265. package/dist/view-transitions/snap.d.ts +0 -16
  266. package/dist/view-transitions/snap.d.ts.map +0 -1
  267. package/dist/view-transitions/strip.d.ts +0 -7
  268. package/dist/view-transitions/strip.d.ts.map +0 -1
  269. package/dist/view-transitions/swap.d.ts +0 -15
  270. package/dist/view-transitions/swap.d.ts.map +0 -1
  271. /package/dist/{animator → animation}/integrator/double-spring-integrator.d.ts +0 -0
  272. /package/dist/{animator → animation}/integrator/inertia-integrator.d.ts +0 -0
  273. /package/dist/{animator → animation}/integrator/spring-integrator.d.ts +0 -0
  274. /package/dist/{animator → animation}/integrator/types.d.ts +0 -0
package/dist/index.js CHANGED
@@ -1,1291 +1,1807 @@
1
- var it = Object.defineProperty;
2
- var rt = (e, i, t) => i in e ? it(e, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[i] = t;
3
- var d = (e, i, t) => rt(e, typeof i != "symbol" ? i + "" : i, t);
4
- import { normalizeToMultiAnimation as F, normalizeSchedule as W } from "./types.js";
5
- import { isCssAnimation as $t, isKeyframesAnimation as Zt, isMultiAnimation as Jt, isSingleAnimation as Qt, isTickAnimation as te } from "./types.js";
6
- import { S as Z, a as ot } from "./spring-integrator-BM4a-82c.js";
7
- import { I as st } from "./provider-B2B8CK6H.js";
8
- class at {
9
- constructor() {
10
- d(this, "listeners", /* @__PURE__ */ new Set());
11
- d(this, "rafId", null);
12
- d(this, "isRunning", !1);
13
- // Timing
14
- d(this, "startTime", Date.now());
15
- d(this, "lastUpdate", this.startTime);
16
- d(this, "elapsed", 0);
17
- // Lag smoothing (mobile optimization)
18
- d(this, "lagThreshold", 500);
19
- // ms - detect tab switches, backgrounding
20
- d(this, "adjustedLag", 33);
21
- // ms - max time jump to prevent animation skip
22
- d(this, "maxDeltaTime", 33);
23
- // ms - clamp for physics stability (30fps minimum)
24
- // FPS throttling
25
- d(this, "gap", 1e3 / 240);
26
- // max 240fps
27
- d(this, "nextTime", this.gap);
28
- d(this, "tick", () => {
29
- const i = Date.now();
30
- let n = i - this.lastUpdate;
31
- n > this.lagThreshold || n < 0 ? (this.startTime += n - this.adjustedLag, n = this.adjustedLag) : n > this.maxDeltaTime && (n = this.maxDeltaTime), this.lastUpdate = i;
32
- const r = i - this.startTime, o = r - this.nextTime;
33
- if (o > 0) {
34
- const s = n / 1e3;
35
- this.elapsed = r / 1e3, this.nextTime += o + (o >= this.gap ? 4 : this.gap - o), this.listeners.forEach((m) => {
36
- m(s, this.elapsed);
37
- });
38
- }
39
- this.listeners.size > 0 ? this.rafId = requestAnimationFrame(this.tick) : (this.isRunning = !1, this.rafId = null);
40
- });
41
- }
42
- subscribe(i) {
43
- return this.listeners.add(i), this.isRunning || (this.isRunning = !0, this.rafId = requestAnimationFrame(this.tick)), () => {
44
- this.unsubscribe(i);
45
- };
46
- }
47
- unsubscribe(i) {
48
- this.listeners.delete(i), this.listeners.size === 0 && this.rafId !== null && (cancelAnimationFrame(this.rafId), this.isRunning = !1, this.rafId = null);
49
- }
50
- /**
51
- * Configure lag smoothing behavior
52
- * @param threshold - Time threshold to detect lag (default: 500ms)
53
- * @param adjustedLag - Max time jump when lag detected (default: 33ms)
54
- */
55
- lagSmoothing(i, t) {
56
- this.lagThreshold = i, this.adjustedLag = Math.min(t, i);
57
- }
58
- /**
59
- * Set maximum FPS
60
- * @param fps - Target FPS (default: 240)
61
- */
62
- fps(i) {
63
- this.gap = 1e3 / i, this.nextTime = this.elapsed * 1e3 + this.gap;
64
- }
65
- getListenerCount() {
66
- return this.listeners.size;
67
- }
68
- getElapsed() {
69
- return this.elapsed;
70
- }
71
- }
72
- const z = new at();
73
- function ct(e) {
74
- const {
75
- integrator: i,
76
- from: t,
77
- to: n,
78
- velocity: r = 0,
79
- onUpdate: o,
80
- onComplete: s,
81
- onStart: m
82
- } = e;
83
- let l = { position: t, velocity: r }, u = !0, h = 0, v = !1;
84
- const E = (S) => {
85
- if (u) {
86
- if (v || (v = !0, m == null || m()), l = i.step(l, n, S), i.isSettled(l, n)) {
87
- if (h += Math.min(S, 0.033), h >= Z) {
88
- l = { position: n, velocity: 0 }, u = !1, o(l.position), z.unsubscribe(E), s();
89
- return;
90
- }
91
- } else
92
- h = 0;
93
- o(l.position);
1
+ var xt = Object.defineProperty;
2
+ var Et = (e, t, n) => t in e ? xt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var $ = (e, t, n) => Et(e, typeof t != "symbol" ? t + "" : t, n);
4
+ import { P as Z, V as ft, W as b, M as E, S as Ct } from "./multi-animation-CnxqLEka.js";
5
+ import { A as zn } from "./multi-animation-CnxqLEka.js";
6
+ function P(e, t) {
7
+ const n = [];
8
+ for (let s = 0; s < e.length; s++)
9
+ for (let o = s + 1; o < e.length; o++) {
10
+ const i = e[s], r = e[o];
11
+ !i || !r || n.push({
12
+ from: i,
13
+ to: r,
14
+ transition: t(),
15
+ symmetric: !0
16
+ });
94
17
  }
95
- };
96
- return z.subscribe(E), {
97
- stop: () => {
98
- u && (u = !1, z.unsubscribe(E));
99
- },
100
- getPosition: () => l.position,
101
- getVelocity: () => l.velocity,
102
- isRunning: () => u
103
- };
18
+ return n;
104
19
  }
105
- const L = 1e3 / 60;
106
- function lt(e, i, t, n = 0) {
107
- let o = { position: i, velocity: n }, s = 0;
108
- const m = [];
109
- for (let l = 0; l < 600; l++) {
110
- const u = l * L;
111
- if (m.push({
112
- time: u,
113
- position: o.position,
114
- velocity: o.velocity
115
- }), o = e.step(o, t, L / 1e3), e.isSettled(o, t)) {
116
- if (s += L / 1e3, s >= Z) {
117
- m.push({
118
- time: (l + 1) * L,
119
- position: t,
120
- velocity: 0
121
- });
122
- break;
123
- }
124
- } else
125
- s = 0;
126
- }
127
- return m;
128
- }
129
- function U(e, i) {
130
- if (e.length === 0)
131
- return { position: 0, velocity: 0 };
132
- const t = e[0], n = e[e.length - 1];
133
- if (i <= 0)
134
- return { position: t.position, velocity: t.velocity };
135
- if (i >= n.time)
136
- return { position: n.position, velocity: n.velocity };
137
- let r = 0, o = e.length - 1;
138
- for (; r < o - 1; ) {
139
- const u = Math.floor((r + o) / 2);
140
- e[u].time <= i ? r = u : o = u;
141
- }
142
- const s = e[r], m = e[o], l = (i - s.time) / (m.time - s.time);
143
- return {
144
- position: s.position + (m.position - s.position) * l,
145
- velocity: s.velocity + (m.velocity - s.velocity) * l
146
- };
147
- }
148
- function ut(e, i) {
149
- return e.map((t) => i(t.position));
150
- }
151
- function ft(e) {
152
- const {
153
- integrator: i,
154
- element: t,
155
- from: n,
156
- to: r,
157
- velocity: o = 0,
158
- style: s,
159
- onComplete: m,
160
- onStart: l
161
- } = e, u = lt(i, n, r, o);
162
- if (u.length === 0)
163
- return l == null || l(), m(), {
164
- stop: () => {
165
- },
166
- getPosition: () => r,
167
- getVelocity: () => 0,
168
- isRunning: () => !1
169
- };
170
- const h = ut(u, s), v = u[u.length - 1], E = v.time, S = h[0];
171
- if (S)
172
- for (const T of Object.keys(S))
173
- t.style[T] = "";
174
- const y = t.animate(h, {
175
- duration: E,
176
- fill: "forwards",
177
- easing: "linear",
178
- composite: "replace"
179
- });
180
- let p = !0;
181
- const k = performance.now();
182
- return l == null || l(), y.onfinish = () => {
183
- p && (p = !1, m());
184
- }, {
185
- stop: () => {
186
- p && (p = !1, y.cancel());
187
- },
188
- getPosition: () => {
189
- if (!p)
190
- return v.position;
191
- const T = performance.now() - k;
192
- return U(u, T).position;
193
- },
194
- getVelocity: () => {
195
- if (!p)
196
- return 0;
197
- const T = performance.now() - k;
198
- return U(u, T).velocity;
199
- },
200
- isRunning: () => p
201
- };
202
- }
203
- function mt(e) {
204
- const {
205
- element: i,
206
- frames: t,
207
- duration: n,
208
- easing: r = "linear",
209
- from: o,
210
- to: s,
211
- onComplete: m,
212
- onStart: l
213
- } = e, u = t[0];
214
- if (u)
215
- for (const S of Object.keys(u))
216
- S === "offset" || S === "easing" || S === "composite" || (i.style[S] = "");
217
- const h = i.animate(t, {
218
- duration: n,
219
- fill: "forwards",
220
- easing: r,
221
- composite: "replace"
222
- });
223
- let v = !0;
224
- const E = performance.now();
225
- return l == null || l(), h.onfinish = () => {
226
- v && (v = !1, m());
227
- }, {
228
- stop: () => {
229
- v && (v = !1, h.cancel());
230
- },
231
- // Linear progress mapped onto [from, to] — used by MultiAnimator for
232
- // stagger thresholds. The actual visual motion is whatever the keyframes
233
- // dictate; this mapping just gives the orchestration layer a monotonic
234
- // progress signal.
235
- getPosition: () => {
236
- if (!v) return s;
237
- const S = performance.now() - E, y = Math.min(Math.max(S / n, 0), 1);
238
- return o + (s - o) * y;
239
- },
240
- // Baked animations don't expose velocity — interruption/resumption isn't
241
- // supported here (you can stop, but can't resume mid-flight with momentum).
242
- getVelocity: () => 0,
243
- isRunning: () => v
244
- };
245
- }
246
- function dt(e) {
247
- const { to: i, onStart: t, onComplete: n } = e;
248
- return t == null || t(), n(), {
249
- stop: () => {
20
+ function ht(e, t) {
21
+ return [
22
+ {
23
+ from: e.exit,
24
+ to: e.enter,
25
+ transition: t("enter")
250
26
  },
251
- getPosition: () => i,
252
- getVelocity: () => 0,
253
- isRunning: () => !1
254
- };
27
+ {
28
+ from: e.enter,
29
+ to: e.exit,
30
+ transition: t("exit")
31
+ }
32
+ ];
255
33
  }
256
- class ht {
257
- /**
258
- * Get bound runner based on animation mode
259
- *
260
- * @param options Animation mode options — exactly one of tick / css / keyframes
261
- * @returns Bound runner function (empty runner if no animation mode specified)
262
- * @throws Error if more than one mode is provided
263
- */
264
- static from(i) {
265
- const { tick: t, css: n, keyframes: r } = i;
266
- if ((t ? 1 : 0) + (n ? 1 : 0) + (r ? 1 : 0) > 1)
267
- throw new Error(
268
- "Cannot use more than one of 'tick', 'css', 'keyframes' together"
34
+ function q(e, t, n) {
35
+ const s = [];
36
+ for (let o = 0; o < e.length; o++)
37
+ for (let i = o + 1; i < e.length; i++) {
38
+ const r = e[o], l = e[i];
39
+ !r || !l || s.push(
40
+ {
41
+ from: r,
42
+ to: l,
43
+ transition: n(t.forward)
44
+ },
45
+ {
46
+ from: l,
47
+ to: r,
48
+ transition: n(t.backward)
49
+ }
269
50
  );
270
- return r ? (s) => mt({
271
- element: r.element,
272
- frames: r.frames,
273
- duration: r.duration,
274
- easing: r.easing,
275
- from: s.from,
276
- to: s.to,
277
- onComplete: s.onComplete,
278
- onStart: s.onStart
279
- }) : n ? (s) => {
280
- if (!s.integrator)
281
- throw new Error("css mode requires an integrator");
282
- return ft({
283
- integrator: s.integrator,
284
- from: s.from,
285
- to: s.to,
286
- velocity: s.velocity,
287
- onComplete: s.onComplete,
288
- onStart: s.onStart,
289
- element: n.element,
290
- style: n.style
291
- });
292
- } : t ? (s) => {
293
- if (!s.integrator)
294
- throw new Error("tick mode requires an integrator");
295
- return ct({
296
- integrator: s.integrator,
297
- from: s.from,
298
- to: s.to,
299
- velocity: s.velocity,
300
- onComplete: s.onComplete,
301
- onStart: s.onStart,
302
- onUpdate: t
303
- });
304
- } : dt;
305
- }
306
- }
307
- class J {
51
+ }
52
+ return s;
308
53
  }
309
- const gt = { stiffness: 300, damping: 30 };
310
- class B extends J {
54
+ class F {
311
55
  constructor(t) {
312
- super();
313
- d(this, "options");
314
- d(this, "runner");
315
- d(this, "controls", null);
316
- d(this, "isAnimating", !1);
317
- d(this, "currentValue");
318
- d(this, "currentVelocity", 0);
319
- d(this, "updateFn");
320
- d(this, "isKeyframesMode");
321
- if (this.options = {
322
- from: t.from ?? 0,
323
- to: t.to ?? 1,
324
- physics: t.physics,
325
- onComplete: t.onComplete ?? (() => {
326
- }),
327
- onStart: t.onStart
328
- }, this.currentValue = this.options.from, this.isKeyframesMode = !!t.keyframes, t.tick)
329
- this.updateFn = (n) => {
330
- var r;
331
- return (r = t.tick) == null ? void 0 : r.call(t, n);
332
- };
333
- else if (t.css) {
334
- const { element: n, style: r } = t.css;
335
- this.updateFn = (o) => {
336
- const s = r(o);
337
- for (const [m, l] of Object.entries(s))
338
- n.style[m] = typeof l == "number" ? String(l) : l;
339
- };
340
- } else
341
- this.updateFn = () => {
342
- };
343
- this.runner = ht.from({
344
- tick: t.tick,
345
- css: t.css,
346
- keyframes: t.keyframes
347
- });
348
- }
349
- /**
350
- * Sync element state to current progress value
351
- * Uses the update callback if provided
352
- */
353
- syncState() {
354
- var t;
355
- (t = this.updateFn) == null || t.call(this, this.currentValue);
356
- }
357
- /**
358
- * Create Integrator from physics options
359
- * Priority: integrator factory > inertia/spring config > default spring
360
- */
361
- createIntegrator() {
362
- const t = this.options.physics;
363
- return t != null && t.integrator ? t.integrator() : t != null && t.spring || t != null && t.inertia ? st.from({
364
- spring: t.spring,
365
- inertia: t.inertia
366
- }) : new ot(gt);
367
- }
368
- runAnimation(t) {
369
- this.isAnimating = !0, this.controls = this.runner({
370
- // Keyframes mode plays a pre-baked WAAPI animation — no integrator
371
- // needed. tick/css modes still require one.
372
- integrator: this.isKeyframesMode ? void 0 : this.createIntegrator(),
373
- from: this.currentValue,
374
- to: t,
375
- velocity: this.currentVelocity,
376
- onStart: this.options.onStart,
377
- onComplete: () => {
378
- this.currentValue = t, this.currentVelocity = 0, this.isAnimating = !1, this.controls = null, this.options.onComplete();
379
- }
380
- });
56
+ $(this, "omega");
57
+ // Angular frequency
58
+ $(this, "zeta");
59
+ // Damping ratio
60
+ $(this, "restDelta");
61
+ $(this, "restSpeed");
62
+ const { stiffness: n, damping: s } = t, o = 1;
63
+ this.omega = Math.sqrt(n / o), this.zeta = s / (2 * Math.sqrt(n * o)), this.restDelta = t.restDelta ?? Z, this.restSpeed = t.restSpeed ?? ft;
381
64
  }
382
- forward() {
383
- this.stop(), this.runAnimation(this.options.to);
384
- }
385
- backward() {
386
- this.stop(), this.runAnimation(this.options.from);
387
- }
388
- reverse() {
389
- const t = this.options.from;
390
- this.options.from = this.options.to, this.options.to = t, this.isAnimating && (this.stop(), this.runAnimation(this.options.to));
391
- }
392
- stop() {
393
- this.controls && (this.currentValue = this.controls.getPosition(), this.currentVelocity = this.controls.getVelocity(), this.controls.stop(), this.controls = null), this.isAnimating = !1;
394
- }
395
- getVelocity() {
396
- var t;
397
- return ((t = this.controls) == null ? void 0 : t.getVelocity()) ?? this.currentVelocity;
398
- }
399
- getCurrentValue() {
400
- var t;
401
- return ((t = this.controls) == null ? void 0 : t.getPosition()) ?? this.currentValue;
402
- }
403
- getIsAnimating() {
404
- return this.isAnimating;
405
- }
406
- getCurrentState() {
65
+ step(t, n, s) {
66
+ const o = Math.min(s, 0.033), { omega: i, zeta: r } = this, { position: l, velocity: c } = t, a = -2 * o * r * i * c, p = o * i * i * (n - l), d = c + a + p;
407
67
  return {
408
- position: this.getCurrentValue(),
409
- velocity: this.getVelocity(),
410
- from: this.options.from,
411
- to: this.options.to
68
+ position: l + o * d,
69
+ velocity: d
412
70
  };
413
71
  }
414
- setValue(t) {
415
- this.currentValue = t;
416
- }
417
- setVelocity(t) {
418
- this.currentVelocity = t;
419
- }
420
- updateOptions(t) {
421
- this.options = { ...this.options, ...t };
72
+ isSettled(t, n) {
73
+ const s = Math.abs(n - t.position), o = Math.abs(t.velocity);
74
+ return s < this.restDelta && o < this.restSpeed;
422
75
  }
423
76
  }
424
- class _ extends J {
77
+ class Pt {
425
78
  constructor(t) {
426
- super();
427
- d(this, "config");
428
- d(this, "animators", /* @__PURE__ */ new Map());
429
- d(this, "itemOrder", []);
430
- d(this, "completedCount", 0);
431
- d(this, "completedAnimators", /* @__PURE__ */ new Set());
432
- d(this, "direction", "forward");
433
- d(this, "idCounter", 0);
434
- d(this, "rafId", null);
435
- d(this, "from");
436
- d(this, "to");
437
- d(this, "initialState");
438
- this.config = t.config, this.from = t.from, this.to = t.to, this.initialState = t.state ?? {
439
- position: t.from,
440
- velocity: 0
441
- }, this.initializeAnimators();
442
- }
443
- generateId() {
444
- return `spring_${this.idCounter++}`;
445
- }
446
- initializeAnimators() {
447
- this.config.items.forEach((t, n) => {
448
- const r = this.generateId(), o = new B({
449
- from: this.from,
450
- to: this.to,
451
- physics: t.physics,
452
- tick: t.tick,
453
- css: t.css,
454
- keyframes: t.keyframes,
455
- onComplete: () => this.onAnimatorComplete(r),
456
- onStart: t.onStart
457
- });
458
- (n === 0 || t.normalizedOffset === 0) && (o.setValue(this.initialState.position), o.setVelocity(this.initialState.velocity), o.syncState()), this.animators.set(r, {
459
- id: r,
460
- item: t,
461
- animator: o,
462
- started: !1
463
- }), this.itemOrder.push(r);
79
+ $(this, "leader");
80
+ $(this, "follower");
81
+ $(this, "restDelta");
82
+ $(this, "restSpeed");
83
+ this.restDelta = t.restDelta ?? Z, this.restSpeed = t.restSpeed ?? ft, this.leader = new F({
84
+ stiffness: t.stiffness,
85
+ damping: t.damping,
86
+ restDelta: this.restDelta,
87
+ restSpeed: this.restSpeed
88
+ });
89
+ let n, s, o, i;
90
+ typeof t.follower == "number" ? (n = t.stiffness * t.follower, s = t.damping) : t.follower ? (n = t.follower.stiffness, s = t.follower.damping, o = t.follower.restDelta, i = t.follower.restSpeed) : (n = t.stiffness, s = t.damping), this.follower = new F({
91
+ stiffness: n,
92
+ damping: s,
93
+ restDelta: o ?? this.restDelta,
94
+ restSpeed: i ?? this.restSpeed
464
95
  });
465
96
  }
466
- /**
467
- * Calculate progress of an animator (0-1)
468
- * Progress = |position - from| / |to - from|
469
- */
470
- getAnimatorProgress(t) {
471
- const n = t.animator.getCurrentState(), r = Math.abs(n.to - n.from);
472
- return r === 0 ? 1 : Math.abs(n.position - n.from) / r;
97
+ step(t, n, s) {
98
+ const i = t._leader ?? {
99
+ position: t.position,
100
+ velocity: t.velocity
101
+ }, r = this.leader.step(i, n, s), l = this.follower.step(
102
+ t,
103
+ r.position,
104
+ s
105
+ );
106
+ return {
107
+ position: l.position,
108
+ velocity: l.velocity,
109
+ _leader: r
110
+ };
473
111
  }
474
- /**
475
- * Get order of springs based on direction
476
- * Forward: 0, 1, 2, ...
477
- * Backward: n-1, n-2, ..., 0
478
- */
479
- getOrderedIds() {
480
- return this.direction === "forward" ? this.itemOrder : [...this.itemOrder].reverse();
112
+ isSettled(t, n) {
113
+ const s = t, o = Math.abs(n - t.position) < this.restDelta && Math.abs(t.velocity) < this.restSpeed;
114
+ return s._leader ? Math.abs(n - s._leader.position) < this.restDelta && Math.abs(s._leader.velocity) < this.restSpeed && o : o;
481
115
  }
482
- onAnimatorComplete(t) {
483
- var r, o, s, m, l, u;
484
- const n = this.animators.get(t);
485
- !n || this.completedAnimators.has(t) || (this.completedAnimators.add(t), this.completedCount++, (o = (r = n.item).onComplete) == null || o.call(r), (m = (s = this.config).onProgress) == null || m.call(s, this.completedCount, this.config.items.length), this.completedCount === this.config.items.length && (this.stopScheduler(), (u = (l = this.config).onEnd) == null || u.call(l)));
116
+ }
117
+ const vt = 0.01, Tt = 500, Dt = 10;
118
+ class _t {
119
+ constructor(t) {
120
+ $(this, "acceleration");
121
+ $(this, "resistance");
122
+ $(this, "resistanceType");
123
+ $(this, "min");
124
+ $(this, "max");
125
+ $(this, "bounceStiffness");
126
+ $(this, "bounceDamping");
127
+ $(this, "restDelta");
128
+ this.acceleration = t.acceleration, this.resistance = t.resistance, this.resistanceType = t.resistanceType ?? "quadratic", this.min = t.min, this.max = t.max, this.bounceStiffness = t.bounceStiffness ?? Tt, this.bounceDamping = t.bounceDamping ?? Dt, this.restDelta = t.restDelta ?? vt;
486
129
  }
487
- /**
488
- * Check and start springs based on previous spring's progress
489
- * Called on each frame while animation is running
490
- */
491
- checkAndStartSprings() {
492
- const t = this.getOrderedIds();
493
- for (let n = 0; n < t.length; n++) {
494
- const r = t[n], o = this.animators.get(r);
495
- if (!o || o.started) continue;
496
- if (n === 0) {
497
- this.startAnimator(r);
498
- continue;
499
- }
500
- const s = t[n - 1], m = this.animators.get(s);
501
- if (!m || !m.started) continue;
502
- const l = this.getAnimatorProgress(m), u = o.item.normalizedOffset;
503
- l >= u && this.startAnimator(r);
130
+ step(t, n, s) {
131
+ const o = Math.min(s, 0.033), { acceleration: i, resistance: r, resistanceType: l, min: c, max: a } = this, { position: p, velocity: d } = t, u = c !== void 0 && p < c, m = a !== void 0 && p > a;
132
+ let f;
133
+ if (u || m) {
134
+ const S = p - (u ? c : a), x = -this.bounceStiffness * S, C = -this.bounceDamping * d;
135
+ f = x + C;
136
+ } else {
137
+ const w = n > p ? 1 : -1;
138
+ let S;
139
+ l === "linear" ? S = r * d : S = r * d * Math.abs(d), f = w * i - S;
504
140
  }
505
- }
506
- startAnimator(t) {
507
- const n = this.animators.get(t);
508
- !n || n.started || (n.started = !0, this.direction === "forward" ? n.animator.forward() : n.animator.backward());
509
- }
510
- /**
511
- * Start the scheduler loop that checks spring progress
512
- */
513
- startScheduler() {
514
- const t = () => {
515
- this.checkAndStartSprings(), this.getIsAnimating() && (this.rafId = requestAnimationFrame(t));
141
+ const h = d + f * o;
142
+ let y = p + h * o;
143
+ if (!u && !m) {
144
+ const w = n > p ? 1 : -1;
145
+ (w > 0 && y > n || w < 0 && y < n) && (y = n);
146
+ }
147
+ return {
148
+ position: y,
149
+ velocity: y === n ? 0 : h
516
150
  };
517
- t();
518
- }
519
- stopScheduler() {
520
- this.rafId !== null && (cancelAnimationFrame(this.rafId), this.rafId = null);
521
- }
522
- getFirstAnimator() {
523
- var n;
524
- const t = this.itemOrder[0];
525
- return t ? ((n = this.animators.get(t)) == null ? void 0 : n.animator) ?? null : null;
526
151
  }
527
- forward() {
528
- var t, n;
529
- this.stop(), this.direction = "forward", this.completedCount = 0, this.completedAnimators.clear(), this.resetStartedFlags(), (n = (t = this.config).onStart) == null || n.call(t), this.startScheduler();
530
- }
531
- backward() {
532
- var t, n;
533
- this.stop(), this.direction = "backward", this.completedCount = 0, this.completedAnimators.clear(), this.resetStartedFlags(), (n = (t = this.config).onStart) == null || n.call(t), this.startScheduler();
534
- }
535
- resetStartedFlags() {
536
- this.animators.forEach((t) => {
537
- t.started = !1;
538
- });
539
- }
540
- stop() {
541
- this.stopScheduler(), this.animators.forEach((t) => {
542
- t.animator.stop(), t.started = !1;
543
- });
544
- }
545
- reverse() {
546
- this.direction = this.direction === "forward" ? "backward" : "forward", this.animators.forEach((t) => {
547
- if (!t.started)
548
- return;
549
- const n = t.animator.getCurrentState();
550
- if (n.position === n.to) {
551
- const o = new B({
552
- from: this.to,
553
- to: this.from,
554
- physics: t.item.physics,
555
- tick: t.item.tick,
556
- css: t.item.css,
557
- keyframes: t.item.keyframes,
558
- onComplete: () => this.onAnimatorComplete(t.id),
559
- onStart: t.item.onStart
560
- });
561
- o.setValue(this.to), o.setVelocity(0), o.syncState(), o.forward(), t.animator = o;
562
- } else
563
- t.animator.reverse();
564
- });
565
- }
566
- getCurrentState() {
567
- const t = this.getFirstAnimator();
568
- return t ? t.getCurrentState() : {
569
- position: 0,
570
- velocity: 0,
571
- from: 0,
572
- to: 1
573
- };
574
- }
575
- /**
576
- * Get current position value from first animator
577
- */
578
- getCurrentValue() {
579
- const t = this.getFirstAnimator();
580
- return (t == null ? void 0 : t.getCurrentValue()) ?? 0;
152
+ isSettled(t, n) {
153
+ return Math.abs(n - t.position) < this.restDelta;
581
154
  }
155
+ }
156
+ class g {
582
157
  /**
583
- * Get current velocity from first animator
158
+ * Create an Integrator from physics config
159
+ *
160
+ * @param config Physics configuration (spring or inertia)
161
+ * @returns Appropriate Integrator instance
162
+ * @throws Error if both spring and inertia are provided
584
163
  */
585
- getVelocity() {
586
- const t = this.getFirstAnimator();
587
- return (t == null ? void 0 : t.getVelocity()) ?? 0;
164
+ static from(t) {
165
+ if (t.spring && t.inertia)
166
+ throw new Error(
167
+ "Cannot use both 'spring' and 'inertia' together. Choose one physics type."
168
+ );
169
+ if (t.inertia)
170
+ return new _t({
171
+ acceleration: t.inertia.acceleration,
172
+ resistance: t.inertia.resistance,
173
+ resistanceType: t.inertia.resistanceType,
174
+ min: t.inertia.min,
175
+ max: t.inertia.max,
176
+ bounceStiffness: t.inertia.bounceStiffness,
177
+ bounceDamping: t.inertia.bounceDamping,
178
+ restDelta: t.inertia.restDelta
179
+ });
180
+ const n = t.spring ?? { stiffness: 300, damping: 30 };
181
+ if (n.doubleSpring) {
182
+ const s = n.doubleSpring;
183
+ let o;
184
+ return typeof s == "number" ? o = s : typeof s == "object" && (o = {
185
+ stiffness: s.stiffness,
186
+ damping: s.damping
187
+ }), new Pt({
188
+ stiffness: n.stiffness,
189
+ damping: n.damping,
190
+ follower: o,
191
+ restDelta: n.restDelta,
192
+ restSpeed: n.restSpeed
193
+ });
194
+ }
195
+ return new F({
196
+ stiffness: n.stiffness,
197
+ damping: n.damping,
198
+ restDelta: n.restDelta,
199
+ restSpeed: n.restSpeed
200
+ });
588
201
  }
589
202
  /**
590
- * Set position value on first animator
591
- * TODO: Support per-spring control
203
+ * Create an Integrator from SpringConfig (legacy support)
204
+ * @deprecated Use from({ spring: config }) instead
592
205
  */
593
- setValue(t) {
594
- const n = this.getFirstAnimator();
595
- n == null || n.setValue(t);
206
+ static fromSpring(t) {
207
+ return g.from({ spring: t });
596
208
  }
597
- /**
598
- * Set velocity on first animator
599
- * TODO: Support per-spring control
600
- */
601
- setVelocity(t) {
602
- const n = this.getFirstAnimator();
603
- n == null || n.setVelocity(t);
209
+ }
210
+ class At {
211
+ constructor(t) {
212
+ $(this, "durationSec");
213
+ this.durationSec = Math.max(1 / 60, t.durationSec);
604
214
  }
605
- /**
606
- * Check if any animation is currently running
607
- */
608
- getIsAnimating() {
609
- for (const t of this.animators.values())
610
- if (t.animator.getIsAnimating())
611
- return !0;
612
- return !1;
215
+ step(t, n, s) {
216
+ const o = n - t.position;
217
+ if (o === 0) return t;
218
+ const i = Math.sign(o), r = Math.abs(o) / this.durationSec, l = i * r * s, c = t.position + l;
219
+ return (i > 0 ? c >= n : c <= n) ? { position: n, velocity: 0 } : { position: c, velocity: i * r };
613
220
  }
614
- /**
615
- * Create MultiAnimator from existing state
616
- * Uses first animator's state for initialization
617
- */
618
- static fromState(t, n) {
619
- return new _({ ...n, state: t });
221
+ isSettled(t, n) {
222
+ return Math.abs(t.position - n) < Z;
620
223
  }
621
224
  }
622
- const Q = Symbol.for("TRANSITION_STRATEGY"), yt = (e) => ({
623
- runIn: async (i) => {
624
- const { currentAnimation: t } = e;
625
- if (t && t.direction === "out") {
626
- const r = t.controller.getCurrentValue(), o = t.controller.getVelocity();
627
- if (t.controller.stop(), i.out)
628
- return {
629
- config: await i.out,
630
- state: { position: r, velocity: o },
631
- from: 1,
632
- to: 0,
633
- direction: "backward"
634
- // Will actually go 0→1 (backward means toward 'from')
635
- };
636
- }
637
- return i.in ? {
638
- config: await i.in,
639
- state: {
640
- position: 0,
641
- velocity: 0
642
- },
643
- from: 0,
644
- to: 1,
645
- direction: "forward"
646
- } : {
647
- state: {
648
- position: 0,
649
- velocity: 0
225
+ const G = 8, K = {
226
+ spring: { stiffness: 1e3, damping: 40, doubleSpring: 1.2 }
227
+ };
228
+ function It({
229
+ direction: e
230
+ }) {
231
+ const t = e === "forward" ? G : -G;
232
+ return {
233
+ out: {
234
+ willChange: "transform, opacity",
235
+ startStyle: {},
236
+ animate: (n) => ({
237
+ opacity: `${1 - n}`
238
+ })
239
+ },
240
+ in: {
241
+ willChange: "transform, opacity",
242
+ startStyle: {
243
+ transform: `translate3d(${t}px, 0, 0)`,
244
+ opacity: "0"
650
245
  },
651
- from: 0,
652
- to: 1,
653
- direction: "forward"
654
- };
655
- },
656
- runOut: async (i) => {
657
- const { currentAnimation: t } = e;
658
- if (t && t.direction === "in") {
659
- const r = t.controller.getCurrentValue(), o = t.controller.getVelocity();
660
- if (t.controller.stop(), i.in)
661
- return {
662
- config: await i.in,
663
- state: { position: r, velocity: o },
664
- from: 0,
665
- to: 1,
666
- direction: "backward"
667
- // Will actually go 1→0 (backward means toward 'from')
668
- };
246
+ animate: (n) => ({
247
+ transform: `translate3d(${t * (1 - n)}px, 0, 0)`,
248
+ opacity: `${n}`
249
+ })
669
250
  }
670
- return i.out ? {
671
- config: await i.out,
672
- state: {
673
- position: 1,
674
- velocity: 0
675
- },
676
- from: 1,
677
- to: 0,
678
- direction: "forward"
679
- } : {
680
- state: {
681
- position: 1,
682
- velocity: 0
683
- },
684
- from: 1,
685
- to: 0,
686
- direction: "forward"
687
- };
688
- }
689
- }), wt = () => ({
690
- runIn: async (e) => e.in ? {
691
- config: await e.in,
692
- state: {
693
- position: 0,
694
- velocity: 0
695
- },
696
- from: 0,
697
- to: 1,
698
- direction: "forward"
699
- } : {
700
- state: {
701
- position: 0,
702
- velocity: 0
251
+ };
252
+ }
253
+ function Ot() {
254
+ return {
255
+ outPhysics: K,
256
+ inPhysics: K,
257
+ // Both sides run together — the cross-fade is the whole point of the
258
+ // snappy feel. (fluid's sibling uses staggered fade-through.)
259
+ composition: { mode: "parallel", startAt: [0, 0] },
260
+ build: It
261
+ };
262
+ }
263
+ const J = 30, kt = {
264
+ inertia: { acceleration: 150, resistance: 1.5 }
265
+ }, Lt = {
266
+ spring: { stiffness: 180, damping: 34 }
267
+ };
268
+ function Ft({
269
+ direction: e
270
+ }) {
271
+ const t = e === "forward" ? 1 : -1, n = -J * t, s = J * t;
272
+ return {
273
+ out: {
274
+ willChange: "transform, opacity",
275
+ startStyle: {},
276
+ animate: (o) => ({
277
+ transform: `translate3d(${n * o}px, 0, 0)`,
278
+ opacity: `${1 - o}`
279
+ })
703
280
  },
704
- from: 0,
705
- to: 1,
706
- direction: "forward"
707
- },
708
- runOut: async (e) => e.out ? {
709
- config: await e.out,
710
- state: {
711
- position: 1,
712
- velocity: 0
281
+ in: {
282
+ willChange: "transform, opacity",
283
+ startStyle: {
284
+ transform: `translate3d(${s}px, 0, 0)`,
285
+ opacity: "0"
286
+ },
287
+ animate: (o) => ({
288
+ transform: `translate3d(${s * (1 - o)}px, 0, 0)`,
289
+ opacity: `${o}`
290
+ })
291
+ }
292
+ };
293
+ }
294
+ function Yt() {
295
+ return {
296
+ outPhysics: kt,
297
+ inPhysics: Lt,
298
+ // Phased motion: outgoing falls away first under inertia, then incoming
299
+ // springs in. The fade-through shape comes from the integrator curves
300
+ // plus the sequence handoff, not from FADE_SPLIT inside animate(t).
301
+ composition: { mode: "sequence" },
302
+ build: Ft
303
+ };
304
+ }
305
+ const Ht = {
306
+ snappy: Ot(),
307
+ fluid: Yt()
308
+ }, Q = {
309
+ spring: { stiffness: 2400, damping: 65, doubleSpring: 0.7 }
310
+ }, O = 8;
311
+ function Mt({ direction: e }) {
312
+ const t = e === "forward" ? -O : O, n = e === "forward" ? O : -O;
313
+ return {
314
+ out: {
315
+ willChange: "transform, opacity",
316
+ startStyle: {},
317
+ animate: (s) => ({
318
+ transform: `translate3d(0, ${t * s}px, 0)`,
319
+ opacity: `${1 - s}`
320
+ })
713
321
  },
714
- from: 1,
715
- to: 0,
716
- direction: "forward"
717
- } : {
718
- state: {
719
- position: 1,
720
- velocity: 0
322
+ in: {
323
+ willChange: "transform, opacity",
324
+ startStyle: {
325
+ transform: `translate3d(0, ${n}px, 0)`,
326
+ opacity: "0"
327
+ },
328
+ animate: (s) => ({
329
+ transform: `translate3d(0, ${n * (1 - s)}px, 0)`,
330
+ opacity: `${s}`
331
+ })
332
+ }
333
+ };
334
+ }
335
+ function zt() {
336
+ return {
337
+ outPhysics: Q,
338
+ inPhysics: Q,
339
+ composition: { mode: "parallel", startAt: [0, 0.3] },
340
+ build: Mt
341
+ };
342
+ }
343
+ const R = {
344
+ spring: { stiffness: 280, damping: 30 }
345
+ }, k = 0.05;
346
+ function Ut() {
347
+ return {
348
+ // Outgoing scales up slightly (1 → 1+s) while fading — recedes toward
349
+ // viewer feel, complementing the incoming page rising from below.
350
+ out: {
351
+ willChange: "transform, opacity",
352
+ startStyle: {},
353
+ animate: (e) => ({
354
+ transform: `scale(${1 + e * k})`,
355
+ opacity: `${1 - e}`
356
+ })
721
357
  },
722
- from: 1,
723
- to: 0,
724
- direction: "forward"
725
- }
726
- }), tt = "data-ssgoi-scope", et = "data-ssgoi-scope-ready";
358
+ // Incoming rises from below (1-s → 1) with fade in.
359
+ in: {
360
+ willChange: "transform, opacity",
361
+ startStyle: {
362
+ transform: `scale(${1 - k})`,
363
+ opacity: "0"
364
+ },
365
+ animate: (e) => ({
366
+ transform: `scale(${1 - k + e * k})`,
367
+ opacity: `${e}`
368
+ })
369
+ }
370
+ };
371
+ }
727
372
  function Xt() {
728
- return (e) => {
729
- if (e)
730
- return e.setAttribute(tt, ""), queueMicrotask(() => {
731
- queueMicrotask(() => {
732
- e.setAttribute(et, "true");
733
- });
734
- }), () => {
735
- };
373
+ return {
374
+ outPhysics: R,
375
+ inPhysics: R,
376
+ // Both pages share the canvas (in-place scale+fade), so a strict
377
+ // fade-through-with-offset would feel disjointed. Run them together
378
+ // for a cleaner cross-fade.
379
+ composition: { mode: "parallel" },
380
+ build: Ut
736
381
  };
737
382
  }
738
- function pt(e) {
739
- return e.hasAttribute(et);
383
+ const Vt = zt(), Bt = Xt(), Nt = {
384
+ x: Ht,
385
+ // y and z don't yet have a `fluid` variant — the lookup falls back to
386
+ // `snappy` if asked for `fluid` on them.
387
+ y: { snappy: Vt },
388
+ z: { snappy: Bt }
389
+ };
390
+ function Wt(e, t) {
391
+ const n = Nt[e];
392
+ return n[t] ?? n.snappy;
740
393
  }
741
- function vt(e) {
742
- return e.closest(`[${tt}]`);
394
+ const Zt = "x", qt = "snappy";
395
+ function tt(e, t) {
396
+ e.style.willChange = t.willChange, e.style.backfaceVisibility = "hidden", e.style.contain = "layout paint";
397
+ for (const [n, s] of Object.entries(t.startStyle))
398
+ e.style[n] = s;
743
399
  }
744
- const H = /* @__PURE__ */ new Set(["auto", "scroll", "overlay"]), St = (e) => {
745
- let i = e.parentElement;
746
- for (; i && i !== document.body; ) {
747
- const t = window.getComputedStyle(i);
748
- if (H.has(t.overflowY) || H.has(t.overflowX))
749
- return i;
750
- i = i.parentElement;
751
- }
752
- return document.documentElement;
753
- }, Et = (e) => {
754
- let i = e.parentElement;
755
- for (; i && i !== document.body; ) {
756
- const t = window.getComputedStyle(i).position;
757
- if (t === "relative" || t === "absolute" || t === "fixed" || t === "sticky")
758
- return i;
759
- i = i.parentElement;
760
- }
761
- return document.body;
762
- };
763
- function K(e) {
764
- return new Promise((i) => {
765
- requestAnimationFrame(() => {
766
- requestAnimationFrame(() => {
767
- i();
400
+ function jt(e) {
401
+ e.style.willChange = "auto", e.style.backfaceVisibility = "", e.style.contain = "", e.style.transform = "", e.style.opacity = "";
402
+ }
403
+ const Gt = (e = {}) => {
404
+ const t = e.direction ?? "forward", n = e.type ?? Zt, s = e.feel ?? qt, o = Wt(n, s), i = o.build({ direction: t });
405
+ return {
406
+ prepare: ({ from: r, to: l }) => (r.then((c) => {
407
+ tt(c, i.out), c.style.pointerEvents = "none";
408
+ }), l.then((c) => {
409
+ tt(c, i.in);
410
+ }), {}),
411
+ animation: ({ from: r, to: l }) => {
412
+ const c = new b({
413
+ element: r,
414
+ integrator: g.from(o.outPhysics),
415
+ style: (p) => i.out.animate(p)
416
+ }), a = new b({
417
+ element: l,
418
+ integrator: g.from(o.inPhysics),
419
+ style: (p) => i.in.animate(p),
420
+ onComplete: () => jt(l)
768
421
  });
769
- });
770
- });
422
+ return new E([c, a], o.composition);
423
+ }
424
+ };
425
+ };
426
+ function Kt(e, t, n) {
427
+ return e !== "x" || t === "snappy" || n === "snappy" ? "snappy" : "fluid";
428
+ }
429
+ function Cn(e) {
430
+ const { paths: t } = e, n = e.type ?? "x", s = e.variant, o = e.feel, i = Kt(n, s, o);
431
+ return q(
432
+ t,
433
+ { forward: "forward", backward: "backward" },
434
+ (r) => Gt({ type: n, direction: r, feel: i })
435
+ );
771
436
  }
772
- function At(e, i) {
773
- var S;
774
- let t = null, n = null, r = null, o = null;
775
- const s = {
776
- get currentAnimation() {
777
- return t;
437
+ const Jt = {
438
+ spring: { stiffness: 200, damping: 22 }
439
+ }, Qt = 10, Rt = "horizontal", te = "#000000";
440
+ function et(e, t, n, s, o, i) {
441
+ window.getComputedStyle(e).position === "static" && (e.style.position = "relative");
442
+ const l = document.createElement("div");
443
+ l.style.cssText = `
444
+ position: absolute;
445
+ top: 0;
446
+ left: 0;
447
+ width: 100%;
448
+ height: 100%;
449
+ pointer-events: none;
450
+ z-index: 9999;
451
+ overflow: hidden;
452
+ `;
453
+ const c = [];
454
+ for (let a = 0; a < t; a++) {
455
+ const p = document.createElement("div");
456
+ if (n === "horizontal") {
457
+ const d = 100 / t;
458
+ p.style.cssText = `
459
+ position: absolute;
460
+ top: ${d * a}%;
461
+ left: 0;
462
+ width: 100%;
463
+ height: calc(${d}% + 1px);
464
+ background: ${s};
465
+ transform: scaleX(${o === "hidden" ? 0 : 1});
466
+ transform-origin: ${i} center;
467
+ will-change: transform;
468
+ `;
469
+ } else {
470
+ const d = 100 / t;
471
+ p.style.cssText = `
472
+ position: absolute;
473
+ top: 0;
474
+ left: ${d * a}%;
475
+ width: calc(${d}% + 1px);
476
+ height: 100%;
477
+ background: ${s};
478
+ transform: scaleY(${o === "hidden" ? 0 : 1});
479
+ transform-origin: ${i === "left" ? "top" : "bottom"} center;
480
+ will-change: transform;
481
+ `;
778
482
  }
779
- }, m = ((S = i == null ? void 0 : i.strategy) == null ? void 0 : S.call(i, s)) || yt(s), l = async (y) => {
780
- var g, C;
781
- n && (n.remove(), n = null);
782
- const p = e(), k = p.in && p.in(y), T = !(i != null && i.strategy) && p.out ? p.out(y) : void 0;
783
- if (!k)
784
- return;
785
- const w = {
786
- in: F(k),
787
- out: T ? F(T) : void 0
788
- }, f = await m.runIn(w);
789
- if (!f.config) {
790
- t && (t.direction = "in");
791
- return;
483
+ c.push(p), l.appendChild(p);
484
+ }
485
+ return e.appendChild(l), { container: l, blinds: c };
486
+ }
487
+ const ee = (e = {}) => {
488
+ const t = e.blindCount ?? Qt, n = e.direction ?? Rt, s = e.blindColor ?? te, o = e.physics ?? Jt;
489
+ return {
490
+ prepare: async ({ from: i, to: r }) => {
491
+ const l = await i, c = await r;
492
+ l.style.zIndex = "1000";
493
+ const a = et(
494
+ l,
495
+ t,
496
+ n,
497
+ s,
498
+ "hidden",
499
+ "left"
500
+ );
501
+ c.style.position = "relative", c.style.zIndex = "0";
502
+ const p = et(
503
+ c,
504
+ t,
505
+ n,
506
+ s,
507
+ "closed",
508
+ "right"
509
+ );
510
+ return {
511
+ fromBlinds: a.blinds,
512
+ fromContainer: a.container,
513
+ toBlinds: p.blinds,
514
+ toContainer: p.container
515
+ };
516
+ },
517
+ animation: ({ fromBlinds: i, fromContainer: r, toBlinds: l, toContainer: c }) => {
518
+ const a = i.map(
519
+ (m) => new b({
520
+ element: m,
521
+ integrator: g.from(o),
522
+ style: (f) => ({
523
+ transform: n === "horizontal" ? `scaleX(${f})` : `scaleY(${f})`
524
+ })
525
+ })
526
+ ), p = l.map(
527
+ (m, f) => new b({
528
+ element: m,
529
+ integrator: g.from(o),
530
+ style: (h, y) => ({
531
+ transform: n === "horizontal" ? `scaleX(${y})` : `scaleY(${y})`
532
+ }),
533
+ onComplete: f === l.length - 1 ? () => {
534
+ c.remove(), r.remove();
535
+ } : void 0
536
+ })
537
+ ), d = new E(a, { mode: "parallel" }), u = new E(p, { mode: "parallel" });
538
+ return new E([d, u], { mode: "sequence" });
792
539
  }
793
- const a = f.config;
794
- (g = a.prepare) == null || g.call(a);
795
- const A = W(
796
- {
797
- ...a,
798
- onEnd: () => {
799
- var b;
800
- t = null, (b = a.onEnd) == null || b.call(a);
801
- }
540
+ };
541
+ };
542
+ function Pn(e) {
543
+ const { paths: t, type: n = "horizontal" } = e;
544
+ return P(
545
+ t,
546
+ () => ee({ direction: n })
547
+ );
548
+ }
549
+ const ne = {
550
+ spring: { stiffness: 200, damping: 20, doubleSpring: 0.7 }
551
+ }, D = 0.5;
552
+ function se(e) {
553
+ const t = e === "enter" ? -100 : 100, n = e === "enter" ? 100 : -100;
554
+ return {
555
+ out: {
556
+ willChange: "transform, opacity",
557
+ startStyle: {},
558
+ animate: (s) => ({
559
+ transform: `translate3d(${t * s}%, 0, 0)`,
560
+ opacity: `${D + (1 - D) * (1 - s)}`
561
+ })
562
+ },
563
+ in: {
564
+ willChange: "transform, opacity",
565
+ startStyle: {
566
+ transform: `translate3d(${n}%, 0, 0)`,
567
+ opacity: `${D}`
802
568
  },
803
- y
804
- );
805
- a.wait && await a.wait();
806
- const c = _.fromState(f.state, {
807
- config: A,
808
- from: f.from,
809
- to: f.to
810
- });
811
- t = { controller: c, direction: "in" }, (C = a.onReady) == null || C.call(a), await K(), f.direction === "forward" ? c.forward() : c.backward();
812
- }, u = async (y) => {
813
- var C, b;
814
- n = y;
815
- const p = e(), k = !(i != null && i.strategy) && p.in ? p.in(y) : void 0, T = p.out && p.out(y);
816
- if (!T)
817
- return;
818
- const w = {
819
- in: k ? F(k) : void 0,
820
- out: F(T)
821
- }, f = await m.runOut(w);
822
- if (!f.config) {
823
- t && (t.direction = "out"), n && (n.remove(), n = null);
824
- return;
569
+ animate: (s) => ({
570
+ transform: `translate3d(${n * (1 - s)}%, 0, 0)`,
571
+ opacity: `${D + (1 - D) * s}`
572
+ })
825
573
  }
826
- const a = f.config;
827
- g(), (C = a.prepare) == null || C.call(a);
828
- const A = W(
829
- {
830
- ...a,
831
- onEnd: () => {
832
- var R, M;
833
- (R = a.onEnd) == null || R.call(a), n && (n.remove(), n = null), t = null, (M = i == null ? void 0 : i.onCleanupEnd) == null || M.call(i);
834
- }
574
+ };
575
+ }
576
+ function oe() {
577
+ return {
578
+ physics: ne,
579
+ build: se
580
+ };
581
+ }
582
+ const re = {
583
+ spring: { stiffness: 170, damping: 22 }
584
+ };
585
+ function ie(e) {
586
+ const t = e === "enter" ? -20 : 100, n = e === "enter" ? 100 : -20;
587
+ return {
588
+ out: {
589
+ willChange: "transform",
590
+ startStyle: {},
591
+ animate: (s) => ({
592
+ transform: `translate3d(${t * s}%, 0, 0)`
593
+ })
594
+ },
595
+ in: {
596
+ willChange: "transform",
597
+ startStyle: {
598
+ transform: `translate3d(${n}%, 0, 0)`
835
599
  },
836
- y
837
- );
838
- a.wait && await a.wait();
839
- const c = _.fromState(f.state, {
840
- config: A,
841
- from: f.from,
842
- to: f.to
843
- });
844
- t = { controller: c, direction: "out" }, (b = a.onReady) == null || b.call(a), await K(), f.direction === "forward" ? c.forward() : c.backward();
845
- function g() {
846
- !r || !n || (o && r.contains(o) ? r.insertBefore(n, o) : r.appendChild(n));
600
+ animate: (s) => ({
601
+ transform: `translate3d(${n * (1 - s)}%, 0, 0)`
602
+ })
847
603
  }
848
604
  };
849
- let h = null, v = !1;
850
- const E = (y) => () => {
851
- if (v) return;
852
- v = !0;
853
- const p = y.cloneNode(!0);
854
- h ? queueMicrotask(() => {
855
- document.contains(h) && u(p);
856
- }) : u(p);
857
- };
858
- return (y) => {
859
- if (y)
860
- return requestAnimationFrame(() => {
861
- r = y.parentElement, o = y.nextElementSibling;
862
- }), v = !1, (i == null ? void 0 : i.scope) === "local" ? queueMicrotask(() => {
863
- h = vt(y), !(h && !pt(h)) && l(y);
864
- }) : l(y), E(y);
605
+ }
606
+ function ae() {
607
+ return {
608
+ physics: re,
609
+ build: ie
865
610
  };
866
611
  }
867
- const P = /* @__PURE__ */ new Map();
868
- let I = null, q = !1;
869
- function nt(e) {
870
- if (e instanceof HTMLElement && P.has(e)) {
871
- const t = P.get(e);
872
- P.delete(e), queueMicrotask(() => {
873
- t();
874
- });
875
- }
876
- const i = e.childNodes;
877
- for (let t = 0; t < i.length; t++) {
878
- const n = i[t];
879
- n && nt(n);
880
- }
612
+ const le = {
613
+ parallax: ae(),
614
+ crossfade: oe()
615
+ }, ce = "parallax";
616
+ function nt(e, t) {
617
+ e.style.willChange = t.willChange, e.style.backfaceVisibility = "hidden", e.style.contain = "layout paint";
618
+ for (const [n, s] of Object.entries(t.startStyle))
619
+ e.style[n] = s;
881
620
  }
882
- function Ct() {
883
- q || typeof document > "u" || (q = !0, I = new MutationObserver((e) => {
884
- for (const i of e) {
885
- const t = i.removedNodes;
886
- for (let n = 0; n < t.length; n++) {
887
- const r = t[n];
888
- r && nt(r);
889
- }
621
+ const pe = (e = {}) => {
622
+ const t = e.direction ?? "enter", n = le[e.type ?? ce], s = n.physics, o = n.build(t);
623
+ return {
624
+ prepare: ({ from: i, to: r }) => (i.then((l) => {
625
+ nt(l, o.out), l.style.pointerEvents = "none", l.style.zIndex = t === "enter" ? "-1" : "100";
626
+ }), r.then((l) => {
627
+ nt(l, o.in);
628
+ }), {}),
629
+ animation: ({ from: i, to: r }) => {
630
+ const l = new b({
631
+ element: i,
632
+ integrator: g.from(s),
633
+ style: (a) => o.out.animate(a)
634
+ }), c = new b({
635
+ element: r,
636
+ integrator: g.from(s),
637
+ style: (a) => o.in.animate(a),
638
+ onComplete: () => {
639
+ r.style.willChange = "auto", r.style.backfaceVisibility = "", r.style.contain = "", r.style.transform = "", r.style.opacity = "";
640
+ }
641
+ });
642
+ return new E([l, c], { mode: "parallel" });
890
643
  }
891
- }), document.body ? I.observe(document.body, {
892
- childList: !0,
893
- subtree: !0
894
- }) : document.addEventListener(
895
- "DOMContentLoaded",
896
- () => {
897
- I == null || I.observe(document.body, {
898
- childList: !0,
899
- subtree: !0
644
+ };
645
+ };
646
+ function de(e) {
647
+ return e === "slide" || e === "crossfade" ? "crossfade" : "parallax";
648
+ }
649
+ function vn(e) {
650
+ const { enter: t, exit: n } = e, s = e.type, o = de(s);
651
+ return ht(
652
+ { enter: t, exit: n },
653
+ (i) => pe({ direction: i, type: o })
654
+ );
655
+ }
656
+ const fe = {
657
+ spring: { stiffness: 180, damping: 20, doubleSpring: !0 }
658
+ }, he = {
659
+ spring: { stiffness: 170, damping: 20, doubleSpring: !0 }
660
+ }, ue = (e = {}) => {
661
+ const t = e.physics ?? he, n = e.physics ?? fe;
662
+ return {
663
+ prepare: ({ to: s }) => (s.then((o) => {
664
+ o.style.opacity = "0", o.style.willChange = "opacity";
665
+ }), {}),
666
+ animation: ({ from: s, to: o }) => {
667
+ const i = new b({
668
+ element: s,
669
+ integrator: g.from(n),
670
+ // Default bounds (0, 1). `u` runs 1→0 as the animation moves
671
+ // forward, mapping opacity from fully visible to invisible.
672
+ style: (l, c) => ({ opacity: c }),
673
+ onComplete: () => {
674
+ s.style.willChange = "auto";
675
+ }
676
+ }), r = new b({
677
+ element: o,
678
+ integrator: g.from(t),
679
+ style: (l) => ({ opacity: l }),
680
+ onComplete: () => {
681
+ o.style.willChange = "auto", o.style.opacity = "";
682
+ }
900
683
  });
901
- },
902
- { once: !0 }
903
- ));
684
+ return new E([i, r], { mode: "sequence" });
685
+ }
686
+ };
687
+ };
688
+ function Tn(e) {
689
+ const { paths: t } = e;
690
+ return P(t, () => ue());
904
691
  }
905
- function Tt(e, i) {
906
- Ct(), P.set(e, i);
692
+ function T(e, t) {
693
+ function n(i) {
694
+ let r = 0, l = 0;
695
+ const c = i.offsetWidth, a = i.offsetHeight;
696
+ let p = i;
697
+ for (; p; )
698
+ r += p.offsetTop, l += p.offsetLeft, p = p.offsetParent;
699
+ return r -= window.scrollY, l -= window.scrollX, { top: r, left: l, width: c, height: a };
700
+ }
701
+ const s = n(e), o = n(t);
702
+ return new DOMRect(
703
+ o.left - s.left,
704
+ o.top - s.top,
705
+ o.width,
706
+ o.height
707
+ );
907
708
  }
908
- function Wt(e) {
909
- return P.has(e);
709
+ function _(e, t) {
710
+ const { scrollingElement: n, positionedParent: s } = e, o = n !== s && n.contains(s) ? T(n, s).top : 0;
711
+ return {
712
+ top: e[t].scroll.y,
713
+ left: 0,
714
+ width: n.clientWidth,
715
+ height: n.clientHeight - o
716
+ };
910
717
  }
911
- function Ut() {
912
- return P.size;
913
- }
914
- function Bt(e) {
915
- const i = P.get(e);
916
- return i ? (P.delete(e), i(), !0) : !1;
917
- }
918
- function Ht() {
919
- P.clear(), I == null || I.disconnect(), I = null, q = !1;
920
- }
921
- const O = /* @__PURE__ */ new Map(), N = /* @__PURE__ */ new Map(), X = /* @__PURE__ */ new Map();
922
- function bt(e, i, t) {
923
- O.set(e, i);
924
- let n = N.get(e);
925
- if (n)
926
- return n;
927
- const r = i;
928
- return n = At(
929
- () => {
930
- const o = O.get(e);
931
- return o || (console.warn(`Transition "${String(e)}" not found`), {});
932
- },
933
- {
934
- strategy: t == null ? void 0 : t.strategy,
935
- scope: t == null ? void 0 : t.scope,
936
- onCleanupEnd: () => {
937
- O.get(e) === r && kt(e);
938
- }
718
+ const z = {
719
+ scaleDown: { stiffness: 20, damping: 7 },
720
+ translate: { stiffness: 15, damping: 7 },
721
+ scaleUp: { stiffness: 20, damping: 7 }
722
+ }, v = {
723
+ scaleDown: 0,
724
+ translate: 0.2,
725
+ scaleUp: 0.8
726
+ }, me = 0.8, ye = "white", st = 1e3 / 60, ge = 600;
727
+ function be(e) {
728
+ const { items: t, from: n, to: s, recordFrame: o } = e, i = st / 1e3, r = Math.abs(s - n), l = t.map((a) => ({
729
+ item: a,
730
+ integrator: new F({
731
+ stiffness: a.spring.stiffness,
732
+ damping: a.spring.damping
733
+ }),
734
+ state: { position: n, velocity: 0 },
735
+ started: !1,
736
+ settled: !1,
737
+ settleTime: 0
738
+ }));
739
+ for (let a = 0; a < l.length; a++)
740
+ (a === 0 || l[a].item.offset === 0) && (l[a].started = !0);
741
+ o(0);
742
+ let c = 0;
743
+ for (let a = 1; a <= ge; a++) {
744
+ const p = a * st;
745
+ c = p;
746
+ for (const d of l)
747
+ !d.started || d.settled || (d.state = d.integrator.step(d.state, s, i), d.integrator.isSettled(d.state, s) ? (d.settleTime += i, d.settleTime >= Ct && (d.state = { position: s, velocity: 0 }, d.settled = !0)) : d.settleTime = 0, d.item.tick(d.state.position));
748
+ for (let d = 1; d < l.length; d++) {
749
+ const u = l[d];
750
+ if (u.started) continue;
751
+ const m = l[d - 1];
752
+ if (!m.started) continue;
753
+ (r === 0 ? 1 : Math.abs(m.state.position - n) / r) >= u.item.offset && (u.started = !0);
939
754
  }
940
- ), N.set(e, n), n;
755
+ if (o(p), l.every((d) => d.settled)) return p;
756
+ }
757
+ return c;
941
758
  }
942
- function kt(e) {
943
- O.delete(e), N.delete(e), X.delete(e);
759
+ function U(e, t) {
760
+ return e != null && e.spring ? {
761
+ stiffness: e.spring.stiffness,
762
+ damping: e.spring.damping
763
+ } : t;
944
764
  }
945
- function Kt(e, i = "manual") {
946
- const t = bt(
947
- e.key,
765
+ function ot(e) {
766
+ const { rect: t, scale: n, direction: s, override: o } = e, i = s === "out" ? { scale: 1, translateY: -t.top } : { scale: n, translateY: -t.top + t.height }, r = U(o, z.scaleDown), l = U(o, z.translate), c = U(o, z.scaleUp), a = s === "out" ? 1 : 0, p = s === "out" ? 0 : 1, d = s === "out" ? [
948
767
  {
949
- in: e.in,
950
- out: e.out
768
+ spring: r,
769
+ offset: v.scaleDown,
770
+ tick: (f) => {
771
+ const h = 1 - f;
772
+ i.scale = 1 - (1 - n) * h;
773
+ }
951
774
  },
952
775
  {
953
- strategy: e[Q],
954
- scope: e.scope
776
+ spring: l,
777
+ offset: v.translate,
778
+ tick: (f) => {
779
+ const h = 1 - f;
780
+ i.translateY = -t.top - t.height * h;
781
+ }
782
+ },
783
+ {
784
+ spring: c,
785
+ offset: v.scaleUp,
786
+ tick: (f) => {
787
+ const h = 1 - f;
788
+ i.scale = n + (1 - n) * h;
789
+ }
955
790
  }
956
- );
957
- if (i === "manual")
958
- return t;
959
- let n = X.get(e.key);
960
- return n || (n = (r) => {
961
- if (r) {
962
- const o = t(r);
963
- o && Tt(r, o);
791
+ ] : [
792
+ {
793
+ spring: r,
794
+ offset: v.scaleDown,
795
+ tick: (f) => {
796
+ i.scale = 1 - (1 - n) * f;
797
+ }
798
+ },
799
+ {
800
+ spring: l,
801
+ offset: v.translate,
802
+ tick: (f) => {
803
+ i.translateY = -t.top + t.height * (1 - f);
804
+ }
805
+ },
806
+ {
807
+ spring: c,
808
+ offset: v.scaleUp,
809
+ tick: (f) => {
810
+ i.scale = n + (1 - n) * f;
811
+ }
964
812
  }
965
- }, X.set(e.key, n), n);
966
- }
967
- function Rt(e) {
968
- const i = e.filter((t) => t.symmetric).map((t) => ({
969
- from: t.to,
970
- to: t.from,
971
- transition: t.transition
972
- }));
973
- return [...e, ...i];
974
- }
975
- function V(e, i) {
976
- if (i === "*")
977
- return !0;
978
- if (i.endsWith("/*")) {
979
- const t = i.slice(0, -1);
980
- return e.startsWith(t) && e.length > t.length;
981
- }
982
- return e === i;
983
- }
984
- function It(e, i, t) {
985
- for (const n of t)
986
- if (V(e, n.from) && V(i, n.to))
987
- return n.transition;
988
- for (const n of t)
989
- if ((n.from === "*" || V(e, n.from)) && (n.to === "*" || V(i, n.to)))
990
- return n.transition;
991
- return null;
813
+ ], u = [], m = be({
814
+ items: d,
815
+ from: a,
816
+ to: p,
817
+ recordFrame: (f) => u.push({
818
+ time: f,
819
+ scale: i.scale,
820
+ translateY: i.translateY
821
+ })
822
+ });
823
+ return { snapshots: u, totalDuration: m };
992
824
  }
993
- const Pt = 768, Mt = 10, Vt = 10;
994
- function xt(e = {}) {
995
- const { preserveScroll: i = (c) => c } = e, t = typeof i == "function" ? i : () => i;
996
- let n = null, r = !1, o = !1;
997
- const s = () => {
998
- const c = (n == null ? void 0 : n.clientWidth) ?? 0, g = c > 0 ? c : typeof window < "u" ? window.innerWidth : 0;
999
- return g > 0 && g < Pt;
1000
- }, m = () => (o || (r = s(), o = !0), r), l = (c) => {
1001
- const g = t(m());
1002
- return g === !1 ? !1 : g === !0 ? !0 : !g.exclude.some((C) => V(c, C));
825
+ function we(e, t) {
826
+ if (e.length === 0) return { time: 0, scale: 1, translateY: 0 };
827
+ if (e.length === 1 || t <= 0) return e[0];
828
+ if (t >= 1) return e[e.length - 1];
829
+ const n = t * (e.length - 1), s = Math.floor(n), o = Math.ceil(n);
830
+ if (s === o) return e[s];
831
+ const i = e[s], r = e[o], l = n - s;
832
+ return {
833
+ time: i.time + (r.time - i.time) * l,
834
+ scale: i.scale + (r.scale - i.scale) * l,
835
+ translateY: i.translateY + (r.translateY - i.translateY) * l
1003
836
  };
1004
- let u = null;
1005
- const h = /* @__PURE__ */ new Map();
1006
- let v = null, E = !1, S = 0;
1007
- const y = () => {
1008
- n && v && !E && h.set(v, {
1009
- x: n.scrollLeft,
1010
- y: n.scrollTop
837
+ }
838
+ const Se = [
839
+ [1, 1],
840
+ [-1, 1],
841
+ [1, -1],
842
+ [-1, -1]
843
+ ];
844
+ function $e(e, t) {
845
+ const o = (i, r, l) => {
846
+ const c = document.createElement("div");
847
+ Object.assign(c.style, {
848
+ position: "fixed",
849
+ pointerEvents: "none",
850
+ zIndex: "9999",
851
+ width: "15px",
852
+ height: "15px",
853
+ ...i
1011
854
  });
1012
- }, p = (c) => {
1013
- if (!n) return;
1014
- const g = l(c) && h.has(c) ? h.get(c) : { x: 0, y: 0 };
1015
- let C = 0;
1016
- const b = () => {
1017
- if (!n) return;
1018
- n.scrollTo({
1019
- top: g.y,
1020
- left: g.x
1021
- }), !(Math.abs(n.scrollTop - g.y) < 1 && Math.abs(n.scrollLeft - g.x) < 1) && C < Mt && (C++, requestAnimationFrame(b));
1022
- };
1023
- requestAnimationFrame(b);
855
+ const a = document.createElement("div");
856
+ Object.assign(a.style, {
857
+ position: "absolute",
858
+ width: "15px",
859
+ height: "1px",
860
+ backgroundColor: e,
861
+ [l]: "0",
862
+ [r]: "0"
863
+ });
864
+ const p = document.createElement("div");
865
+ return Object.assign(p.style, {
866
+ position: "absolute",
867
+ width: "1px",
868
+ height: "15px",
869
+ backgroundColor: e,
870
+ [l]: "0",
871
+ [r]: "0"
872
+ }), c.appendChild(a), c.appendChild(p), c;
1024
873
  };
1025
874
  return {
1026
- initializeContext: (c, g) => {
1027
- E = !0;
1028
- const C = ++S;
1029
- u = c, n || (n = St(c), r = s(), o = !0, typeof ResizeObserver < "u" && new ResizeObserver(() => {
1030
- r = s();
1031
- }).observe(n), (n === document.documentElement ? window : n).addEventListener("scroll", y, {
1032
- passive: !0
1033
- })), v = g, p(g);
1034
- let b = 0;
1035
- const R = () => {
1036
- C === S && (b++, b >= Vt ? E = !1 : requestAnimationFrame(R));
1037
- };
1038
- requestAnimationFrame(R);
1039
- },
1040
- calculateScrollOffset: (c, g) => {
1041
- const C = c && h.has(c) ? h.get(c) : { x: 0, y: 0 }, b = g && l(g) && h.has(g) ? h.get(g) : { x: 0, y: 0 };
1042
- return {
1043
- x: -b.x + C.x,
1044
- y: -b.y + C.y
1045
- };
1046
- },
1047
- evictScrollPosition: (c) => {
1048
- h.delete(c);
875
+ topLeft: o(
876
+ {
877
+ top: `${t.top - 1}px`,
878
+ left: `${t.left - 1}px`
879
+ },
880
+ "left",
881
+ "top"
882
+ ),
883
+ topRight: o(
884
+ {
885
+ top: `${t.top - 1}px`,
886
+ left: `${t.left + t.width - 15 + 1}px`
887
+ },
888
+ "right",
889
+ "top"
890
+ ),
891
+ bottomLeft: o(
892
+ {
893
+ top: `${t.top + t.height - 15 + 1}px`,
894
+ left: `${t.left - 1}px`
895
+ },
896
+ "left",
897
+ "bottom"
898
+ ),
899
+ bottomRight: o(
900
+ {
901
+ top: `${t.top + t.height - 15 + 1}px`,
902
+ left: `${t.left + t.width - 15 + 1}px`
903
+ },
904
+ "right",
905
+ "bottom"
906
+ )
907
+ };
908
+ }
909
+ function rt(e, t) {
910
+ const n = t.left + t.width / 2, s = t.top + t.height / 2;
911
+ e.style.transformOrigin = `${n}px ${s}px`;
912
+ }
913
+ function it(e, t) {
914
+ e.style.clipPath = `polygon(
915
+ ${t.left}px ${t.top}px,
916
+ ${t.left + t.width}px ${t.top}px,
917
+ ${t.left + t.width}px ${t.top + t.height}px,
918
+ ${t.left}px ${t.top + t.height}px
919
+ )`;
920
+ }
921
+ function X(e, t, n, s, o) {
922
+ const i = n / 1e3;
923
+ return new b({
924
+ element: e,
925
+ integrator: new At({ durationSec: i }),
926
+ lowerBound: 0,
927
+ upperBound: 1,
928
+ style: (r) => s(we(t, r)),
929
+ onComplete: o
930
+ });
931
+ }
932
+ const xe = (e = {}) => {
933
+ var o;
934
+ const t = ((o = e.border) == null ? void 0 : o.color) ?? ye, n = me, s = e.physics;
935
+ return {
936
+ prepare: ({ from: i, to: r, context: l }) => {
937
+ const c = _(l, "from"), a = _(l, "to"), p = T(document.body, l.positionedParent), d = $e(t, {
938
+ ...c,
939
+ top: p.top
940
+ });
941
+ for (const u of [
942
+ "topLeft",
943
+ "topRight",
944
+ "bottomLeft",
945
+ "bottomRight"
946
+ ])
947
+ l.positionedParent.appendChild(d[u]);
948
+ return i.then((u) => {
949
+ rt(u, c), it(u, c), u.style.transform = `translateY(${-c.top}px)`;
950
+ }), r.then((u) => {
951
+ rt(u, a), it(u, a), u.style.transform = `translateY(${-a.top + a.height}px) scale(${n})`;
952
+ }), { borders: d, fromRect: c, toRect: a };
1049
953
  },
1050
- shouldPreserve: l,
1051
- getScrollContainer: () => n,
1052
- getPositionedParentElement: () => u ? Et(u) : document.body,
1053
- getScrollPosition: (c) => c && h.has(c) ? h.get(c) : { x: 0, y: 0 }
954
+ animation: ({ from: i, to: r, context: l, borders: c, fromRect: a, toRect: p }) => {
955
+ const d = ot({
956
+ rect: a,
957
+ scale: n,
958
+ direction: "out",
959
+ override: s
960
+ }), u = ot({
961
+ rect: p,
962
+ scale: n,
963
+ direction: "in",
964
+ override: s
965
+ }), m = X(
966
+ i,
967
+ d.snapshots,
968
+ d.totalDuration,
969
+ (S) => ({
970
+ transform: `translateY(${S.translateY}px) scale(${S.scale})`
971
+ }),
972
+ () => {
973
+ i.style.clipPath = "", i.style.transformOrigin = "";
974
+ }
975
+ ), f = X(
976
+ r,
977
+ u.snapshots,
978
+ u.totalDuration,
979
+ (S) => ({
980
+ transform: `translateY(${S.translateY}px) scale(${S.scale})`
981
+ }),
982
+ () => {
983
+ r.style.clipPath = "", r.style.transformOrigin = "", r.style.transform = "";
984
+ }
985
+ ), h = Se.map(([S, x], C) => {
986
+ const Y = ["topLeft", "topRight", "bottomLeft", "bottomRight"][C];
987
+ return X(
988
+ c[Y],
989
+ d.snapshots,
990
+ d.totalDuration,
991
+ (A) => {
992
+ const H = (a.width - a.width * A.scale) / 2 * 0.7 * S, M = (a.height - a.height * A.scale) / 2 * 0.7 * x;
993
+ return { transform: `translate(${H}px, ${M}px)` };
994
+ }
995
+ );
996
+ }), y = new E([m, f, ...h], {
997
+ mode: "parallel"
998
+ }), w = y.onComplete;
999
+ return y.onComplete = () => {
1000
+ w == null || w();
1001
+ const S = l.positionedParent;
1002
+ for (const x of [
1003
+ "topLeft",
1004
+ "topRight",
1005
+ "bottomLeft",
1006
+ "bottomRight"
1007
+ ]) {
1008
+ const C = c[x];
1009
+ C.parentElement === S && S.removeChild(C);
1010
+ }
1011
+ }, y;
1012
+ }
1013
+ };
1014
+ };
1015
+ function Dn(e) {
1016
+ const { paths: t, options: n } = e, s = (n == null ? void 0 : n.borderColor) !== void 0 ? { border: { color: n.borderColor } } : void 0;
1017
+ return P(t, () => xe(s));
1018
+ }
1019
+ const Ee = {
1020
+ spring: { stiffness: 300, damping: 30 }
1021
+ };
1022
+ function Ce(e, t) {
1023
+ return e.querySelector(`[data-hero-key="${t}"]`);
1024
+ }
1025
+ const Pe = (e = {}) => {
1026
+ const t = e.physics ?? Ee, n = e.maxDistance ?? 700;
1027
+ return {
1028
+ prepare: ({ from: s }) => (s.then((o) => {
1029
+ o.style.opacity = "0";
1030
+ }), {}),
1031
+ animation: ({ from: s, to: o, context: i }) => {
1032
+ const r = s, l = o, c = Array.from(
1033
+ l.querySelectorAll("[data-hero-key]")
1034
+ ), a = [];
1035
+ for (const f of c) {
1036
+ const h = f.getAttribute("data-hero-key");
1037
+ if (!h) continue;
1038
+ const y = Ce(r, h);
1039
+ y && a.push({ key: h, fromEl: y, toEl: f });
1040
+ }
1041
+ if (a.length === 0)
1042
+ return new E([], { mode: "parallel" });
1043
+ const p = [], d = [];
1044
+ for (const { fromEl: f, toEl: h } of a) {
1045
+ const y = T(r, f), w = T(l, h), S = y.left - w.left - i.scrollOffset.x, x = y.top - w.top - i.scrollOffset.y, C = y.width / w.width, Y = y.height / w.height;
1046
+ if (Math.abs(x) > n) continue;
1047
+ const A = h.style.transform, H = h.style.position, M = h.style.transformOrigin, yt = h.style.zIndex, gt = h.style.willChange;
1048
+ h.style.position = "relative", h.style.transformOrigin = "top left", h.style.zIndex = "1000", h.style.willChange = "transform", p.push(
1049
+ new b({
1050
+ element: h,
1051
+ integrator: g.from(t),
1052
+ style: (j, I) => {
1053
+ const bt = I * S, wt = I * x, St = j + I * C, $t = j + I * Y;
1054
+ return {
1055
+ transform: `translate(${bt}px, ${wt}px) scale(${St}, ${$t})`
1056
+ };
1057
+ }
1058
+ })
1059
+ ), d.push(() => {
1060
+ h.style.transform = A, h.style.position = H, h.style.transformOrigin = M, h.style.zIndex = yt, h.style.willChange = gt;
1061
+ });
1062
+ }
1063
+ const u = new E(p, {
1064
+ mode: "parallel"
1065
+ }), m = u.onComplete;
1066
+ return u.onComplete = () => {
1067
+ for (const f of d) f();
1068
+ m == null || m();
1069
+ }, u;
1070
+ }
1071
+ };
1072
+ };
1073
+ function _n(e) {
1074
+ const { paths: t } = e;
1075
+ return P(t, () => Pe());
1076
+ }
1077
+ const ve = {
1078
+ spring: { stiffness: 50, damping: 30 }
1079
+ }, Te = {
1080
+ spring: { stiffness: 80, damping: 25 }
1081
+ }, De = (e = {}) => {
1082
+ const t = e.physics ?? ve, n = e.initialRotation ?? 45, s = e.initialScale ?? 0.01, o = e.rotationTriggerPoint ?? 0.8;
1083
+ return {
1084
+ prepare: ({ from: i, to: r, context: l }) => (i.then((c) => {
1085
+ c.style.opacity = "1";
1086
+ }), r.then((c) => {
1087
+ const a = _(l, "to"), p = Math.min(a.width, a.height) * 0.4;
1088
+ c.style.setProperty("--max-border-radius", `${p}px`), c.style.setProperty("--border-radius-scale", "1"), c.style.willChange = "transform", c.style.backfaceVisibility = "hidden";
1089
+ const d = a.left + a.width / 2, u = a.top + a.height / 2;
1090
+ c.style.transformOrigin = `${d}px ${u}px`, c.style.position = "fixed", c.style.top = `${a.top}px`, c.style.left = `${a.left}px`, c.style.width = `${a.width}px`, c.style.height = `${a.height}px`, c.style.zIndex = "1000", c.style.overflow = "hidden", c.style.transform = `rotate(${n}deg) scale(${s}) translateZ(0)`, c.style.borderRadius = "calc(var(--max-border-radius) * var(--border-radius-scale))", c.style.opacity = "1";
1091
+ }), {}),
1092
+ animation: ({ from: i, to: r }) => {
1093
+ const l = new b({
1094
+ element: i,
1095
+ integrator: g.from(Te),
1096
+ style: (a, p) => ({ opacity: p })
1097
+ }), c = new b({
1098
+ element: r,
1099
+ integrator: g.from(t),
1100
+ style: (a) => {
1101
+ let p;
1102
+ if (a <= 0.05)
1103
+ p = s;
1104
+ else if (a <= o) {
1105
+ const f = (a - 0.05) / (o - 0.05), h = Math.pow(f, 9);
1106
+ p = s + (0.8 - s) * h;
1107
+ } else {
1108
+ const f = (a - o) / (1 - o);
1109
+ p = 0.8 + 0.2 * (1 - Math.pow(1 - f, 3));
1110
+ }
1111
+ const d = 0.7;
1112
+ let u;
1113
+ if (a <= d)
1114
+ u = n;
1115
+ else {
1116
+ const f = (a - d) / (1 - d), h = 1 - Math.pow(1 - f, 2);
1117
+ u = n * (1 - h);
1118
+ }
1119
+ let m;
1120
+ if (a <= d)
1121
+ m = 1;
1122
+ else {
1123
+ const f = (a - d) / (1 - d);
1124
+ m = 1 - Math.pow(f, 0.5);
1125
+ }
1126
+ return {
1127
+ transform: `rotate(${u.toFixed(2)}deg) scale(${p.toFixed(4)}) translateZ(0)`,
1128
+ "--border-radius-scale": m.toFixed(4)
1129
+ };
1130
+ },
1131
+ onComplete: () => {
1132
+ r.style.willChange = "", r.style.backfaceVisibility = "", r.style.removeProperty("--max-border-radius"), r.style.removeProperty("--border-radius-scale"), r.style.transform = "", r.style.transformOrigin = "", r.style.position = "", r.style.zIndex = "", r.style.top = "", r.style.left = "", r.style.width = "", r.style.height = "", r.style.overflow = "", r.style.borderRadius = "";
1133
+ }
1134
+ });
1135
+ return new E([l, c], { mode: "parallel" });
1136
+ }
1054
1137
  };
1138
+ };
1139
+ function An(e) {
1140
+ const { paths: t } = e;
1141
+ return P(t, () => De());
1055
1142
  }
1056
- const j = 30, Y = 8, G = 1.2, $ = 30, Ft = 600;
1057
- function Lt() {
1058
- let e = null, i = !1, t = !1, n = null, r = null, o = !1;
1059
- const s = (w, f) => {
1060
- for (let a = 0; a < w.length; a++) {
1061
- const A = w.item(a);
1062
- if (A && A.identifier === f) return A;
1143
+ const _e = {
1144
+ spring: { stiffness: 100, damping: 30 }
1145
+ }, Ae = (e = {}) => {
1146
+ const t = e.physics ?? _e;
1147
+ return {
1148
+ prepare: ({ from: n, to: s }) => (n.then((o) => {
1149
+ o.style.transformOrigin = "center center", o.style.willChange = "transform, opacity";
1150
+ }), s.then((o) => {
1151
+ o.style.opacity = "0", o.style.transform = "rotate(-180deg)", o.style.transformOrigin = "center center", o.style.willChange = "transform, opacity";
1152
+ }), {}),
1153
+ animation: ({ from: n, to: s }) => {
1154
+ const o = new b({
1155
+ element: n,
1156
+ integrator: g.from(t),
1157
+ style: (r) => ({
1158
+ transform: `rotate(${r * 180}deg)`,
1159
+ opacity: r < 0.5 ? 1 : 0
1160
+ })
1161
+ }), i = new b({
1162
+ element: s,
1163
+ integrator: g.from(t),
1164
+ // u runs 1→0, so -u*180 unwinds -180→0.
1165
+ style: (r, l) => ({
1166
+ transform: `rotate(${-l * 180}deg)`,
1167
+ opacity: r > 0.5 ? 1 : 0
1168
+ }),
1169
+ onComplete: () => {
1170
+ s.style.willChange = "auto", s.style.transform = "", s.style.transformOrigin = "", s.style.opacity = "";
1171
+ }
1172
+ });
1173
+ return new E([o, i], { mode: "parallel" });
1063
1174
  }
1064
- return null;
1065
- }, m = () => {
1066
- n !== null && (clearTimeout(n), n = null);
1067
- }, l = () => {
1068
- r !== null && (clearTimeout(r), r = null);
1069
- }, u = () => {
1070
- i = !0, t = !0, m(), l(), n = setTimeout(() => {
1071
- i = !1, t = !1, n = null;
1072
- }, Ft);
1073
- }, h = (w) => {
1074
- if (w.touches.length !== 1) {
1075
- e = null;
1076
- return;
1175
+ };
1176
+ };
1177
+ function In(e) {
1178
+ const { paths: t } = e;
1179
+ return P(t, () => Ae());
1180
+ }
1181
+ const Ie = {
1182
+ spring: {
1183
+ stiffness: 20,
1184
+ damping: 8,
1185
+ doubleSpring: 1,
1186
+ restDelta: 1e-3,
1187
+ restSpeed: 1e-3
1188
+ }
1189
+ }, at = (e = {}) => {
1190
+ const t = e.direction ?? "up", n = e.physics ?? Ie, s = t === "up";
1191
+ return {
1192
+ prepare: ({ from: o, to: i }) => (o.then((r) => {
1193
+ r.style.zIndex = s ? "-1" : "1", r.style.willChange = "transform", r.style.backfaceVisibility = "hidden", r.style.contain = "layout paint", r.style.pointerEvents = "none";
1194
+ }), i.then((r) => {
1195
+ r.style.willChange = "transform", r.style.backfaceVisibility = "hidden", r.style.contain = "layout paint";
1196
+ }), {}),
1197
+ animation: ({ from: o, to: i }) => {
1198
+ const r = o.offsetHeight, l = i.offsetHeight, c = window.innerHeight, a = Math.max(Math.min(r, l), c), p = new b({
1199
+ element: o,
1200
+ integrator: g.from(n),
1201
+ style: (u) => ({ transform: `translate3d(0, ${s ? -a * u : a * u}px, 0)` })
1202
+ }), d = new b({
1203
+ element: i,
1204
+ integrator: g.from(n),
1205
+ style: (u, m) => ({ transform: `translate3d(0, ${s ? m * a : m * -a}px, 0)` }),
1206
+ onComplete: () => {
1207
+ i.style.willChange = "auto", i.style.backfaceVisibility = "", i.style.contain = "", i.style.transform = "";
1208
+ }
1209
+ });
1210
+ return new E([p, d], { mode: "parallel" });
1077
1211
  }
1078
- const f = w.touches.item(0);
1079
- if (!f) {
1080
- e = null;
1081
- return;
1212
+ };
1213
+ };
1214
+ function On(e) {
1215
+ const { paths: t, type: n = "directional" } = e;
1216
+ return n === "non-directional" ? P(
1217
+ t,
1218
+ () => at({ direction: "up" })
1219
+ ) : q(
1220
+ t,
1221
+ { forward: "up", backward: "down" },
1222
+ (s) => at({ direction: s })
1223
+ );
1224
+ }
1225
+ const Oe = {
1226
+ spring: { stiffness: 200, damping: 24 }
1227
+ }, ke = {
1228
+ inertia: { acceleration: 25, resistance: 1.2 }
1229
+ }, V = 0.2;
1230
+ function Le() {
1231
+ return {
1232
+ enterPhysics: Oe,
1233
+ exitPhysics: ke,
1234
+ background: {
1235
+ willChange: "transform, opacity",
1236
+ enterStyle: (e, t) => ({
1237
+ transform: `scale(${1 - V * e})`,
1238
+ opacity: t
1239
+ }),
1240
+ exitStyle: (e) => ({
1241
+ transform: `scale(${1 - V + V * e})`,
1242
+ opacity: e
1243
+ })
1082
1244
  }
1083
- const a = window.innerWidth, A = f.clientX <= j, c = f.clientX >= a - j;
1084
- if (!A && !c) {
1085
- e = null;
1086
- return;
1245
+ };
1246
+ }
1247
+ const Fe = {
1248
+ spring: { stiffness: 300, damping: 30 }
1249
+ }, Ye = {
1250
+ inertia: { acceleration: 70, resistance: 1.2 }
1251
+ };
1252
+ function He() {
1253
+ return {
1254
+ enterPhysics: Fe,
1255
+ exitPhysics: Ye,
1256
+ background: {
1257
+ willChange: "",
1258
+ enterStyle: () => ({}),
1259
+ exitStyle: () => ({})
1087
1260
  }
1088
- e = {
1089
- identifier: f.identifier,
1090
- startX: f.clientX,
1091
- startY: f.clientY,
1092
- fromLeftEdge: A,
1093
- moved: !1
1094
- };
1095
- }, v = (w) => {
1096
- if (!e) return;
1097
- if (w.touches.length !== 1) {
1098
- e = null;
1099
- return;
1261
+ };
1262
+ }
1263
+ const Me = {
1264
+ static: He(),
1265
+ "background-scale": Le()
1266
+ }, ze = "static", Ue = "transform", Xe = (e = {}) => {
1267
+ const t = e.direction ?? "enter", n = Me[e.type ?? ze], s = t === "enter" ? n.enterPhysics : n.exitPhysics, o = n.background, i = o.willChange !== "";
1268
+ return {
1269
+ prepare: ({ from: r, to: l }) => {
1270
+ const c = t === "enter" ? l : r, a = t === "enter" ? r : l;
1271
+ return c.then((p) => {
1272
+ p.style.willChange = Ue, p.style.backfaceVisibility = "hidden", p.style.contain = "layout paint", t === "exit" && (p.style.pointerEvents = "none", p.style.zIndex = "100");
1273
+ }), a.then((p) => {
1274
+ i && (p.style.willChange = o.willChange, p.style.backfaceVisibility = "hidden", p.style.contain = "layout paint"), t === "enter" && (p.style.pointerEvents = "none", p.style.zIndex = "-1");
1275
+ }), {};
1276
+ },
1277
+ animation: ({ from: r, to: l, context: c }) => {
1278
+ const a = t === "enter" ? l : r, p = t === "enter" ? r : l, d = _(
1279
+ c,
1280
+ t === "enter" ? "to" : "from"
1281
+ );
1282
+ a.style.clipPath = `inset(${d.top}px 0 calc(100% - ${d.top + d.height}px) 0)`;
1283
+ const u = t === "enter" ? (x, C) => ({
1284
+ transform: `translate3d(0, ${C * d.height}px, 0)`
1285
+ }) : (x) => ({
1286
+ transform: `translate3d(0, ${x * d.height}px, 0)`
1287
+ }), m = new b({
1288
+ element: a,
1289
+ integrator: g.from(s),
1290
+ style: u,
1291
+ onComplete: () => {
1292
+ a.style.willChange = "auto", a.style.backfaceVisibility = "", a.style.contain = "", a.style.clipPath = "", a.style.transform = "";
1293
+ }
1294
+ });
1295
+ if (!i)
1296
+ return new E([m], { mode: "parallel" });
1297
+ const f = _(
1298
+ c,
1299
+ t === "enter" ? "from" : "to"
1300
+ ), h = f.left + f.width / 2, y = f.top + f.height / 2;
1301
+ p.style.clipPath = `inset(${f.top}px 0 calc(100% - ${f.top + f.height}px) 0)`, p.style.transformOrigin = `${h}px ${y}px`;
1302
+ const w = t === "enter" ? (x, C) => o.enterStyle(x, C) : (x) => o.exitStyle(x), S = new b({
1303
+ element: p,
1304
+ integrator: g.from(s),
1305
+ style: w,
1306
+ onComplete: t === "exit" ? () => {
1307
+ p.style.willChange = "auto", p.style.backfaceVisibility = "", p.style.contain = "", p.style.clipPath = "", p.style.transformOrigin = "";
1308
+ } : void 0
1309
+ });
1310
+ return new E([m, S], { mode: "parallel" });
1100
1311
  }
1101
- const f = s(w.touches, e.identifier);
1102
- if (!f) {
1103
- e = null;
1104
- return;
1312
+ };
1313
+ };
1314
+ function Ve(e) {
1315
+ return e === "scale" || e === "background-scale" ? "background-scale" : "static";
1316
+ }
1317
+ function kn(e) {
1318
+ const { enter: t, exit: n } = e, s = e.type, o = Ve(s);
1319
+ return ht(
1320
+ { enter: t, exit: n },
1321
+ (i) => Xe({ direction: i, type: o })
1322
+ );
1323
+ }
1324
+ const Be = {
1325
+ spring: { stiffness: 170, damping: 22, doubleSpring: 0.8 }
1326
+ }, Ne = (e = {}) => {
1327
+ const t = e.direction ?? "left", n = e.physics ?? Be, s = t === "left";
1328
+ return {
1329
+ prepare: ({ from: o, to: i }) => (o.then((r) => {
1330
+ r.style.willChange = "transform", r.style.backfaceVisibility = "hidden", r.style.contain = "layout paint", r.style.pointerEvents = "none";
1331
+ }), i.then((r) => {
1332
+ const l = s ? 100 : -100;
1333
+ r.style.transform = `translate3d(${l}%, 0, 0)`, r.style.willChange = "transform", r.style.backfaceVisibility = "hidden", r.style.contain = "layout paint";
1334
+ }), {}),
1335
+ animation: ({ from: o, to: i }) => {
1336
+ const r = new b({
1337
+ element: o,
1338
+ integrator: g.from(n),
1339
+ style: (c) => ({ transform: `translate3d(${s ? -100 * c : 100 * c}%, 0, 0)` })
1340
+ }), l = new b({
1341
+ element: i,
1342
+ integrator: g.from(n),
1343
+ style: (c, a) => ({ transform: `translate3d(${s ? a * 100 : a * -100}%, 0, 0)` }),
1344
+ onComplete: () => {
1345
+ i.style.willChange = "auto", i.style.backfaceVisibility = "", i.style.contain = "", i.style.transform = "";
1346
+ }
1347
+ });
1348
+ return new E([r, l], { mode: "parallel" });
1105
1349
  }
1106
- const a = f.clientX - e.startX, A = f.clientY - e.startY, c = Math.abs(a), g = Math.abs(A);
1107
- if (g > Y && g > c * G) {
1108
- e = null;
1109
- return;
1350
+ };
1351
+ };
1352
+ function Ln(e) {
1353
+ const { paths: t } = e;
1354
+ return q(
1355
+ t,
1356
+ { forward: "left", backward: "right" },
1357
+ (n) => Ne({ direction: n })
1358
+ );
1359
+ }
1360
+ const We = {
1361
+ spring: { stiffness: 17, damping: 6 }
1362
+ }, B = 20, L = 800, Ze = (e = {}) => {
1363
+ const t = e.physics ?? We;
1364
+ return {
1365
+ prepare: ({ from: n, to: s }) => (n.then((o) => {
1366
+ o.style.willChange = "transform", o.style.backfaceVisibility = "hidden", o.style.contain = "layout paint", o.style.pointerEvents = "none", o.style.transform = `perspective(${L}px) rotateY(0deg) translate3d(0%, 0, 0)`;
1367
+ }), s.then((o) => {
1368
+ o.style.willChange = "transform", o.style.backfaceVisibility = "hidden", o.style.contain = "layout paint", o.style.transform = `perspective(${L}px) rotateY(${B}deg) translate3d(-100%, 0, 0)`;
1369
+ }), {}),
1370
+ animation: ({ from: n, to: s }) => {
1371
+ const o = new b({
1372
+ element: n,
1373
+ integrator: g.from(t),
1374
+ style: (r) => {
1375
+ const l = -r * B, c = r * 100;
1376
+ return {
1377
+ transform: `perspective(${L}px) rotateY(${l}deg) translate3d(${c}%, 0, 0)`
1378
+ };
1379
+ }
1380
+ }), i = new b({
1381
+ element: s,
1382
+ integrator: g.from(t),
1383
+ style: (r, l) => {
1384
+ const c = l * B, a = -l * 100;
1385
+ return {
1386
+ transform: `perspective(${L}px) rotateY(${c}deg) translate3d(${a}%, 0, 0)`
1387
+ };
1388
+ },
1389
+ onComplete: () => {
1390
+ s.style.transform = "", s.style.willChange = "auto", s.style.backfaceVisibility = "", s.style.contain = "";
1391
+ }
1392
+ });
1393
+ return new E([o, i], { mode: "sequence" });
1110
1394
  }
1111
- const C = e.fromLeftEdge ? a > 0 : a < 0;
1112
- c > Y && c > g * G && C && (e.moved = !0);
1113
- }, E = (w) => {
1114
- if (!e) return;
1115
- const f = s(w.changedTouches, e.identifier);
1116
- if (!f) {
1117
- e = null;
1118
- return;
1395
+ };
1396
+ };
1397
+ function Fn(e) {
1398
+ const { paths: t } = e;
1399
+ return P(t, () => Ze());
1400
+ }
1401
+ function qe({
1402
+ enterRect: e,
1403
+ exitRect: t,
1404
+ pageRect: n,
1405
+ scrollOffset: s,
1406
+ enterRadius: o,
1407
+ exitRadius: i
1408
+ }) {
1409
+ const r = t.left - e.left + (t.width - e.width) / 2 - s.x, l = t.top - e.top + (t.height - e.height) / 2 - s.y, c = t.width / e.width, a = t.height / e.height, p = e.top / n.height * 100, d = (n.width - (e.left + e.width)) / n.width * 100, u = (n.height - (e.top + e.height)) / n.height * 100, m = e.left / n.width * 100;
1410
+ return {
1411
+ transformOrigin: `${e.left + e.width / 2}px ${e.top + e.height / 2}px`,
1412
+ animate: (f) => {
1413
+ const h = 1 - f, y = 1 + (c - 1) * h, w = 1 + (a - 1) * h, x = (i * h + o * (1 - h)) / ((y + w) / 2);
1414
+ return {
1415
+ clipPath: `inset(${p * h}% ${d * h}% ${u * h}% ${m * h}% round ${x}px)`,
1416
+ transform: `translate(${r * h}px, ${l * h}px) scale(${y}, ${w})`
1417
+ };
1119
1418
  }
1120
- const a = f.clientX - e.startX, A = e.fromLeftEdge ? a > 0 : a < 0;
1121
- if (e.moved && A && Math.abs(a) >= $) {
1122
- u(), e = null;
1123
- return;
1419
+ };
1420
+ }
1421
+ function je({
1422
+ enterRect: e,
1423
+ exitRect: t,
1424
+ pageRect: n,
1425
+ scrollOffset: s,
1426
+ enterRadius: o,
1427
+ exitRadius: i
1428
+ }) {
1429
+ const r = t.left - e.left + (t.width - e.width) / 2 + s.x, l = t.top - e.top + (t.height - e.height) / 2 + s.y, c = t.width / e.width, a = t.height / e.height, p = e.top / n.height * 100, d = (n.width - (e.left + e.width)) / n.width * 100, u = (n.height - (e.top + e.height)) / n.height * 100, m = e.left / n.width * 100;
1430
+ return {
1431
+ transformOrigin: `${e.left + e.width / 2}px ${e.top + e.height / 2}px`,
1432
+ animate: (f) => {
1433
+ const h = 1 - f, y = 1 + (c - 1) * h, w = 1 + (a - 1) * h, x = (o * (1 - h) + i * h) / ((y + w) / 2);
1434
+ return {
1435
+ clipPath: `inset(${p * h}% ${d * h}% ${u * h}% ${m * h}% round ${x}px)`,
1436
+ transform: `translate(${r * h - s.x}px, ${l * h}px) scale(${y}, ${w})`
1437
+ };
1124
1438
  }
1125
- e.moved && Math.abs(a) >= $ && u(), e = null;
1126
- }, S = () => {
1127
- e && (e.moved && u(), e = null);
1128
1439
  };
1129
- return { initialize: () => {
1130
- if (typeof window > "u" || o) return;
1131
- o = !0;
1132
- const w = { passive: !0, capture: !0 };
1133
- window.addEventListener("touchstart", h, w), window.addEventListener("touchmove", v, w), window.addEventListener("touchend", E, w), window.addEventListener("touchcancel", S, w);
1134
- }, destroy: () => {
1135
- if (typeof window > "u" || !o) return;
1136
- o = !1;
1137
- const w = { capture: !0 };
1138
- window.removeEventListener("touchstart", h, w), window.removeEventListener("touchmove", v, w), window.removeEventListener("touchend", E, w), window.removeEventListener("touchcancel", S, w), m(), l(), e = null, i = !1, t = !1;
1139
- }, isSwipeBack: () => {
1140
- const w = i || t;
1141
- return w && m(), w;
1142
- }, onPageEnter: () => {
1143
- i = !1, m(), l(), r = setTimeout(() => {
1144
- t = !1, r = null;
1145
- }, 0);
1146
- } };
1147
1440
  }
1148
- function Ot() {
1149
- let e = null;
1150
- function i() {
1151
- if (e != null && e.from && (e != null && e.to) && (e != null && e.outResolve) && (e != null && e.inResolve)) {
1152
- const t = { from: e.from, to: e.to };
1153
- e.outResolve(t), e.inResolve(t), e = null;
1441
+ const Ge = {
1442
+ spring: { stiffness: 200, damping: 24 }
1443
+ }, ut = 0.12, Ke = 18;
1444
+ function Je() {
1445
+ return {
1446
+ transformOrigin: "50% 50%",
1447
+ animate: (e) => {
1448
+ const t = 1 - e;
1449
+ return {
1450
+ transform: `scale(${1 - ut * t})`
1451
+ };
1154
1452
  }
1155
- }
1453
+ };
1454
+ }
1455
+ function Qe() {
1156
1456
  return {
1157
- trigger(t, n) {
1158
- e || (e = {}), n === "out" ? e.from = t : e.to = t;
1159
- },
1160
- get(t) {
1161
- return t === "in" && (!e || !e.from) ? Promise.resolve(null) : new Promise((n) => {
1162
- e || (e = {}), t === "out" ? e.outResolve = n : e.inResolve = n, i();
1163
- });
1457
+ transformOrigin: "50% 50%",
1458
+ animate: (e) => {
1459
+ const t = 1 - e;
1460
+ return {
1461
+ transform: `scale(${1 - ut * t})`
1462
+ };
1164
1463
  }
1165
1464
  };
1166
1465
  }
1167
- function _t() {
1168
- let e = null;
1169
- function i() {
1170
- var n, r;
1171
- e && ((n = e.outResolve) == null || n.call(e, null), (r = e.inResolve) == null || r.call(e, null), e = null);
1466
+ const N = {
1467
+ willChange: "backdrop-filter",
1468
+ initialStyle: {
1469
+ position: "absolute",
1470
+ inset: "0",
1471
+ pointerEvents: "none",
1472
+ // Sits above the background page but below the zoomed page (z-index 9999
1473
+ // in transition.ts). backdrop-filter therefore blurs the background,
1474
+ // while the zoom tile stays sharp as it expands on top.
1475
+ zIndex: "5000",
1476
+ backdropFilter: "blur(0px)",
1477
+ WebkitBackdropFilter: "blur(0px)"
1478
+ },
1479
+ style: (e, t) => {
1480
+ const n = e === "enter" ? t : 1 - t, s = `blur(${Ke * n}px)`;
1481
+ return {
1482
+ backdropFilter: s,
1483
+ WebkitBackdropFilter: s
1484
+ };
1172
1485
  }
1173
- function t() {
1174
- if (e != null && e.from && (e != null && e.to) && (e != null && e.outResolve) && (e != null && e.inResolve)) {
1175
- if (e.from === e.to) {
1176
- i();
1177
- return;
1178
- }
1179
- const n = { from: e.from, to: e.to };
1180
- e.outResolve(n), e.inResolve(n), e = null;
1181
- }
1486
+ };
1487
+ class Re {
1488
+ constructor() {
1489
+ $(this, "physics", Ge);
1490
+ }
1491
+ contribute(t) {
1492
+ const { from: n, to: s, resolved: o, physics: i } = t, r = o.mode === "enter", l = r ? n : s, c = r ? Je() : Qe();
1493
+ return c && (l.style.transformOrigin = c.transformOrigin), [
1494
+ new b({
1495
+ element: l,
1496
+ integrator: g.from(i),
1497
+ style: r ? (a, p) => c.animate(p) : (a) => c.animate(a)
1498
+ })
1499
+ ];
1500
+ }
1501
+ }
1502
+ class tn {
1503
+ prepare(t) {
1504
+ const n = t.createElement("zoom-overlay");
1505
+ return Object.assign(n.style, N.initialStyle), n.style.willChange = N.willChange, t.context.positionedParent.appendChild(n), { overlay: n };
1506
+ }
1507
+ contribute(t) {
1508
+ const n = t.extras.overlay;
1509
+ return n ? [
1510
+ new b({
1511
+ element: n,
1512
+ integrator: g.from(t.physics),
1513
+ style: (s) => N.style(t.resolved.mode, s)
1514
+ })
1515
+ ] : [];
1182
1516
  }
1517
+ }
1518
+ const en = {
1519
+ spring: { stiffness: 340, damping: 30, doubleSpring: 1 }
1520
+ };
1521
+ function nn({
1522
+ enterRect: e,
1523
+ exitRect: t,
1524
+ scrollOffset: n
1525
+ }) {
1526
+ const s = e.left - t.left + (e.width - t.width) / 2 + n.x, o = e.top - t.top + (e.height - t.height) / 2 + n.y, i = e.width / t.width, r = e.height / t.height, l = Math.max(i, r);
1183
1527
  return {
1184
- trigger(n, r) {
1185
- e && (r === "out" && e.from && e.from !== n || r === "in" && e.to && e.to !== n) && i(), e || (e = {}), r === "out" ? e.from = n : e.to = n;
1186
- },
1187
- get(n) {
1188
- return new Promise((r) => {
1189
- e || (e = {}), n === "out" ? e.outResolve = r : e.inResolve = r, t();
1190
- });
1528
+ transformOrigin: `${t.left + t.width / 2}px ${t.top + t.height / 2}px`,
1529
+ animate: (c) => {
1530
+ const a = 1 - c;
1531
+ return {
1532
+ transform: `translate(${s * a - n.x}px, ${o * a}px) scale(${1 + (l - 1) * a})`,
1533
+ opacity: `${1 - a}`
1534
+ };
1191
1535
  }
1192
1536
  };
1193
1537
  }
1194
- function jt(e, i) {
1195
- const {
1196
- transitions: t = [],
1197
- defaultTransition: n,
1198
- middleware: r = (f, a) => ({ from: f, to: a }),
1199
- // Identity function as default
1200
- preserveScroll: o = (f) => f
1201
- } = e, { outFirst: s = !0 } = i || {}, m = s ? Ot() : _t(), l = Rt(t), u = Lt();
1202
- u.initialize();
1203
- const {
1204
- initializeContext: h,
1205
- calculateScrollOffset: v,
1206
- evictScrollPosition: E,
1207
- shouldPreserve: S,
1208
- getScrollContainer: y,
1209
- getPositionedParentElement: p,
1210
- getScrollPosition: k
1211
- } = xt({
1212
- preserveScroll: o
1213
- }), T = async (f, a) => {
1214
- const A = u.isSwipeBack();
1215
- m.trigger(f, a);
1216
- const c = await m.get(a);
1217
- if (a === "in" && u.onPageEnter(), !c) return () => ({});
1218
- if (A)
1219
- return a === "out" && c.from && !S(c.from) && E(c.from), () => ({});
1220
- const { from: g, to: C } = r(
1221
- c.from,
1222
- c.to
1223
- ), R = It(
1224
- g,
1225
- C,
1226
- l
1227
- ) || n;
1228
- if (!R) return () => ({});
1229
- const M = v(c.from, c.to);
1230
- if (a === "out") {
1231
- const x = {
1232
- scrollOffset: M,
1233
- scroll: k(c.from),
1234
- get scrollingElement() {
1235
- return y() || document.documentElement;
1236
- },
1237
- get positionedParent() {
1238
- return p();
1239
- }
1538
+ function sn({
1539
+ enterRect: e,
1540
+ exitRect: t,
1541
+ scrollOffset: n
1542
+ }) {
1543
+ const s = e.left - t.left + (e.width - t.width) / 2 - n.x, o = e.top - t.top + (e.height - t.height) / 2 - n.y, i = e.width / t.width, r = e.height / t.height, l = Math.max(i, r);
1544
+ return {
1545
+ transformOrigin: `${t.left + t.width / 2}px ${t.top + t.height / 2}px`,
1546
+ animate: (c) => {
1547
+ const a = 1 - c;
1548
+ return {
1549
+ transform: `translate(${s * a}px, ${o * a}px) scale(${1 + (l - 1) * a})`,
1550
+ opacity: `${c}`
1240
1551
  };
1241
- return c.from && !S(c.from) && E(c.from), (D) => R.out(D, x);
1242
- } else {
1243
- const x = {
1244
- scrollOffset: M,
1245
- get scroll() {
1246
- return k(c.to);
1247
- },
1248
- get scrollingElement() {
1249
- return y() || document.documentElement;
1250
- },
1251
- get positionedParent() {
1252
- return p();
1552
+ }
1553
+ };
1554
+ }
1555
+ class on {
1556
+ constructor() {
1557
+ $(this, "physics", en);
1558
+ }
1559
+ contribute(t) {
1560
+ const { from: n, to: s, resolved: o, input: i, physics: r } = t, l = o.mode === "enter", c = l ? n : s, a = l ? nn(i) : sn(i);
1561
+ return a && (c.style.transformOrigin = a.transformOrigin), [
1562
+ new b({
1563
+ element: c,
1564
+ integrator: g.from(r),
1565
+ style: l ? (p, d) => a.animate(d) : (p) => a.animate(p)
1566
+ })
1567
+ ];
1568
+ }
1569
+ }
1570
+ const rn = {
1571
+ spring: { stiffness: 420, damping: 34 }
1572
+ };
1573
+ class an {
1574
+ constructor() {
1575
+ $(this, "physics", rn);
1576
+ }
1577
+ contribute(t) {
1578
+ return [];
1579
+ }
1580
+ }
1581
+ const ln = {
1582
+ expand: () => new on(),
1583
+ static: () => new an(),
1584
+ blur: () => new Re()
1585
+ };
1586
+ function cn(e) {
1587
+ return ln[e]();
1588
+ }
1589
+ const W = "data-zoom-enter-key", lt = "data-zoom-exit-key", pn = "data-zoom-radius";
1590
+ function ct(e) {
1591
+ const t = e.getAttribute(pn);
1592
+ if (!t) return 0;
1593
+ const n = parseFloat(t);
1594
+ return Number.isFinite(n) && n > 0 ? n : 0;
1595
+ }
1596
+ function dn(e, t) {
1597
+ const n = [];
1598
+ let s = t;
1599
+ for (; s && s !== e; ) {
1600
+ const o = s.parentElement;
1601
+ if (!o) break;
1602
+ for (const i of Array.from(o.children))
1603
+ i !== s && i instanceof HTMLElement && n.push(i);
1604
+ s = o;
1605
+ }
1606
+ return n;
1607
+ }
1608
+ function pt(e) {
1609
+ const t = e.querySelectorAll(`[${W}]`);
1610
+ return t.length !== 1 ? null : t[0];
1611
+ }
1612
+ function dt(e, t) {
1613
+ const n = e.querySelectorAll(`[${lt}]`);
1614
+ for (const s of n)
1615
+ if (s.getAttribute(lt) === t)
1616
+ return s;
1617
+ return null;
1618
+ }
1619
+ function fn(e, t) {
1620
+ const n = pt(e), s = pt(t);
1621
+ if (!n && s) {
1622
+ const o = s.getAttribute(W);
1623
+ if (!o) return null;
1624
+ const i = dt(e, o);
1625
+ return i ? { mode: "enter", enterEl: s, exitEl: i } : null;
1626
+ }
1627
+ if (n && !s) {
1628
+ const o = n.getAttribute(W);
1629
+ if (!o) return null;
1630
+ const i = dt(t, o);
1631
+ return i ? { mode: "exit", enterEl: n, exitEl: i } : null;
1632
+ }
1633
+ return null;
1634
+ }
1635
+ function hn(e, t, n, s) {
1636
+ return {
1637
+ enterRect: T(
1638
+ e.mode === "enter" ? n : t,
1639
+ e.enterEl
1640
+ ),
1641
+ exitRect: T(
1642
+ e.mode === "enter" ? t : n,
1643
+ e.exitEl
1644
+ ),
1645
+ pageRect: e.mode === "enter" ? n.getBoundingClientRect() : t.getBoundingClientRect(),
1646
+ scrollOffset: s,
1647
+ enterRadius: ct(e.enterEl),
1648
+ exitRadius: ct(e.exitEl)
1649
+ };
1650
+ }
1651
+ class un {
1652
+ prepare(t) {
1653
+ t.from.then((n) => {
1654
+ n.style.willChange = "transform, clip-path, opacity", n.style.backfaceVisibility = "hidden", n.style.contain = "layout paint";
1655
+ });
1656
+ }
1657
+ contribute(t) {
1658
+ const { from: n, to: s, resolved: o, input: i, physics: r, onComplete: l } = t, c = o.mode === "enter", a = c ? qe(i) : je(i), p = c ? s : n, d = c ? "t" : "u";
1659
+ a && (p.style.transformOrigin = a.transformOrigin);
1660
+ const u = p.style.zIndex;
1661
+ return p.style.zIndex = "9999", l(() => {
1662
+ p.style.willChange = "auto", p.style.backfaceVisibility = "", p.style.transformOrigin = "", p.style.contain = "", p.style.zIndex = u;
1663
+ }), [
1664
+ new b({
1665
+ element: p,
1666
+ integrator: g.from(r),
1667
+ // Enter: tile expands as `t` (0 → 1). Exit: tile shrinks as `u` —
1668
+ // the legacy convention from v5's outAnim path. Either way, feed
1669
+ // the progress that matches the tileConfig's authored direction.
1670
+ style: d === "t" ? (m) => a.animate(m) : (m, f) => a.animate(f)
1671
+ })
1672
+ ];
1673
+ }
1674
+ }
1675
+ class mn {
1676
+ contribute(t) {
1677
+ const { resolved: n, physics: s, from: o, to: i, onComplete: r } = t, l = n.mode === "enter" ? i : o, c = dn(l, n.enterEl);
1678
+ if (c.length === 0) return [];
1679
+ const a = c.map((p) => p.style.opacity);
1680
+ if (n.mode === "enter")
1681
+ for (const p of c) p.style.opacity = "0";
1682
+ return r(() => {
1683
+ for (let p = 0; p < c.length; p++) {
1684
+ const d = c[p];
1685
+ d && (d.style.opacity = a[p] ?? "");
1686
+ }
1687
+ }), c.map(
1688
+ (p) => new b({
1689
+ element: p,
1690
+ integrator: g.from(s),
1691
+ style: (d, u) => ({
1692
+ opacity: n.mode === "enter" ? d : u
1693
+ })
1694
+ })
1695
+ );
1696
+ }
1697
+ }
1698
+ class mt {
1699
+ contribute() {
1700
+ return [];
1701
+ }
1702
+ }
1703
+ const yn = {
1704
+ default: () => new mt(),
1705
+ fade: () => new mn()
1706
+ };
1707
+ function gn(e) {
1708
+ return yn[e]();
1709
+ }
1710
+ class bn extends mt {
1711
+ }
1712
+ function wn(e) {
1713
+ const t = cn(e.type);
1714
+ return { strategies: [
1715
+ new un(),
1716
+ t,
1717
+ gn(e.variant),
1718
+ new bn(),
1719
+ // Overlay is intrinsically tied to backdrop-filter-driven types. Today
1720
+ // that's only `blur`; the table-driven factory above owns the mapping
1721
+ // so this conditional is the single line that knows the relationship.
1722
+ ...e.type === "blur" ? [new tn()] : []
1723
+ ], physics: t.physics };
1724
+ }
1725
+ const Sn = (e) => {
1726
+ const { strategies: t, physics: n } = wn(e);
1727
+ return {
1728
+ prepare: (s) => {
1729
+ const o = {
1730
+ from: s.from,
1731
+ to: s.to,
1732
+ context: { positionedParent: s.context.positionedParent },
1733
+ // `createElement` from the dispatcher is generic over tag; the
1734
+ // strategy interface narrows the cast to keep both signatures
1735
+ // compatible.
1736
+ createElement: s.createElement
1737
+ }, i = {};
1738
+ for (const r of t) {
1739
+ if (!r.prepare) continue;
1740
+ const l = r.prepare(o);
1741
+ l && Object.assign(i, l);
1742
+ }
1743
+ return i;
1744
+ },
1745
+ animation: ({ from: s, to: o, context: i, ...r }) => {
1746
+ const l = fn(s, o);
1747
+ if (!l)
1748
+ return new E([], { mode: "parallel" });
1749
+ const c = hn(l, s, o, i.scrollOffset), a = [], d = {
1750
+ from: s,
1751
+ to: o,
1752
+ resolved: l,
1753
+ input: c,
1754
+ physics: n,
1755
+ extras: r,
1756
+ onComplete: (f) => {
1757
+ a.push(f);
1253
1758
  }
1254
- };
1255
- return (D) => R.in(D, x);
1759
+ }, u = [];
1760
+ for (const f of t)
1761
+ f.contribute && u.push(...f.contribute(d));
1762
+ const m = u[0];
1763
+ if (m) {
1764
+ const f = m.onComplete;
1765
+ m.onComplete = () => {
1766
+ f == null || f();
1767
+ for (const h of a)
1768
+ try {
1769
+ h();
1770
+ } catch (y) {
1771
+ console.error("[zoom] cleanup error", y);
1772
+ }
1773
+ };
1774
+ }
1775
+ return new E(u, { mode: "parallel" });
1256
1776
  }
1257
1777
  };
1258
- return (f) => ({
1259
- key: f,
1260
- in: async (a) => (h(a, f), (await T(f, "in"))(a)),
1261
- out: async (a) => (await T(f, "out"))(a),
1262
- // Add page transition strategy for page-level transitions
1263
- [Q]: wt
1264
- });
1778
+ };
1779
+ function $n(e) {
1780
+ const t = e.type ?? "static", n = e.variant ?? (e.fade ? "fade" : "default");
1781
+ return { type: t, variant: n };
1782
+ }
1783
+ function Yn(e) {
1784
+ const t = $n(e);
1785
+ return P(
1786
+ e.paths,
1787
+ () => Sn(t)
1788
+ );
1265
1789
  }
1266
1790
  export {
1267
- tt as SCOPE_ATTR,
1268
- et as SCOPE_READY_ATTR,
1269
- Q as TRANSITION_STRATEGY,
1270
- _t as createAnyOrderDetector,
1271
- yt as createDefaultStrategy,
1272
- Ot as createOutFirstDetector,
1273
- wt as createPageTransitionStrategy,
1274
- jt as createSggoiTransitionContext,
1275
- Xt as createTransitionScope,
1276
- vt as findScope,
1277
- Ut as getWatchedCount,
1278
- $t as isCssAnimation,
1279
- Zt as isKeyframesAnimation,
1280
- Jt as isMultiAnimation,
1281
- pt as isScopeReady,
1282
- Qt as isSingleAnimation,
1283
- te as isTickAnimation,
1284
- Wt as isWatched,
1285
- W as normalizeSchedule,
1286
- F as normalizeToMultiAnimation,
1287
- Ht as resetObserver,
1288
- Kt as transition,
1289
- Bt as triggerUnmount,
1290
- Tt as watchUnmount
1791
+ zn as Animation,
1792
+ E as MultiAnimation,
1793
+ b as WebAnimation,
1794
+ Cn as axis,
1795
+ Pn as blind,
1796
+ vn as drill,
1797
+ Tn as fade,
1798
+ Dn as film,
1799
+ _n as hero,
1800
+ An as jaemin,
1801
+ In as rotate,
1802
+ On as scroll,
1803
+ kn as sheet,
1804
+ Ln as slide,
1805
+ Fn as strip,
1806
+ Yn as zoom
1291
1807
  };