motionary 10.0.0 → 10.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (287) hide show
  1. package/AGENTS.md +61 -0
  2. package/CHANGELOG.md +36 -0
  3. package/README.md +82 -0
  4. package/bin/create-motionary-plugin.mjs +124 -0
  5. package/dist/chunks/keyframes-W-474DMc.js +183 -0
  6. package/dist/chunks/keyframes-W-474DMc.js.map +1 -0
  7. package/dist/chunks/keyframes-ZheOkpt0.cjs +187 -0
  8. package/dist/chunks/keyframes-ZheOkpt0.cjs.map +1 -0
  9. package/dist/chunks/registry-BIEjKngP.js +69 -0
  10. package/dist/chunks/registry-BIEjKngP.js.map +1 -0
  11. package/dist/chunks/registry-eJgpFAzI.cjs +81 -0
  12. package/dist/chunks/registry-eJgpFAzI.cjs.map +1 -0
  13. package/dist/chunks/ticker-CM_56oVy.js +70 -0
  14. package/dist/chunks/ticker-CM_56oVy.js.map +1 -0
  15. package/dist/chunks/ticker-D4o6enH0.cjs +72 -0
  16. package/dist/chunks/ticker-D4o6enH0.cjs.map +1 -0
  17. package/dist/chunks/tween-CBuWYpI-.cjs +487 -0
  18. package/dist/chunks/tween-CBuWYpI-.cjs.map +1 -0
  19. package/dist/chunks/tween-CqX1JBuj.js +476 -0
  20. package/dist/chunks/tween-CqX1JBuj.js.map +1 -0
  21. package/dist/components/core.cjs +106 -0
  22. package/dist/components/core.cjs.map +1 -1
  23. package/dist/components/core.d.cts +44 -2
  24. package/dist/components/core.d.ts +44 -2
  25. package/dist/components/core.js +105 -1
  26. package/dist/components/core.js.map +1 -1
  27. package/dist/components/marketplace.cjs +104 -0
  28. package/dist/components/marketplace.cjs.map +1 -1
  29. package/dist/components/marketplace.d.cts +33 -2
  30. package/dist/components/marketplace.d.ts +33 -2
  31. package/dist/components/marketplace.js +101 -1
  32. package/dist/components/marketplace.js.map +1 -1
  33. package/dist/components/widgets.cjs +623 -199
  34. package/dist/components/widgets.cjs.map +1 -1
  35. package/dist/components/widgets.d.cts +186 -2
  36. package/dist/components/widgets.d.ts +186 -2
  37. package/dist/components/widgets.js +620 -201
  38. package/dist/components/widgets.js.map +1 -1
  39. package/dist/llms-full.txt +3115 -0
  40. package/dist/llms.txt +211 -0
  41. package/dist/manifest.json +7820 -0
  42. package/dist/manifest.schema.json +85 -0
  43. package/dist/runtime/format-css.cjs +185 -0
  44. package/dist/runtime/format-css.cjs.map +1 -0
  45. package/dist/runtime/format-css.d.cts +174 -0
  46. package/dist/runtime/format-css.d.ts +174 -0
  47. package/dist/runtime/format-css.iife.js +2 -0
  48. package/dist/runtime/format-css.iife.js.map +1 -0
  49. package/dist/runtime/format-css.js +177 -0
  50. package/dist/runtime/format-css.js.map +1 -0
  51. package/dist/runtime/format-motion.cjs +139 -0
  52. package/dist/runtime/format-motion.cjs.map +1 -0
  53. package/dist/runtime/format-motion.d.cts +208 -0
  54. package/dist/runtime/format-motion.d.ts +208 -0
  55. package/dist/runtime/format-motion.iife.js +2 -0
  56. package/dist/runtime/format-motion.iife.js.map +1 -0
  57. package/dist/runtime/format-motion.js +133 -0
  58. package/dist/runtime/format-motion.js.map +1 -0
  59. package/dist/runtime/format-svg.cjs +457 -0
  60. package/dist/runtime/format-svg.cjs.map +1 -0
  61. package/dist/runtime/format-svg.d.cts +214 -0
  62. package/dist/runtime/format-svg.d.ts +214 -0
  63. package/dist/runtime/format-svg.iife.js +2 -0
  64. package/dist/runtime/format-svg.iife.js.map +1 -0
  65. package/dist/runtime/format-svg.js +446 -0
  66. package/dist/runtime/format-svg.js.map +1 -0
  67. package/dist/runtime/scroll.cjs +301 -0
  68. package/dist/runtime/scroll.cjs.map +1 -0
  69. package/dist/runtime/scroll.d.cts +236 -0
  70. package/dist/runtime/scroll.d.ts +236 -0
  71. package/dist/runtime/scroll.iife.js +2 -0
  72. package/dist/runtime/scroll.iife.js.map +1 -0
  73. package/dist/runtime/scroll.js +292 -0
  74. package/dist/runtime/scroll.js.map +1 -0
  75. package/dist/runtime.cjs +79 -0
  76. package/dist/runtime.cjs.map +1 -0
  77. package/dist/runtime.d.cts +236 -0
  78. package/dist/runtime.d.ts +236 -0
  79. package/dist/runtime.iife.js +2 -0
  80. package/dist/runtime.iife.js.map +1 -0
  81. package/dist/runtime.js +55 -0
  82. package/dist/runtime.js.map +1 -0
  83. package/dist/widgets.umd.js +1 -1
  84. package/dist/widgets.umd.js.map +1 -1
  85. package/docs/ROADMAP.md +69 -38
  86. package/docs/ai-prompt-guide.md +54 -0
  87. package/docs/components/README.md +253 -0
  88. package/docs/components/usa-accordion.md +38 -0
  89. package/docs/components/usa-acrylic.md +38 -0
  90. package/docs/components/usa-add-to-cart.md +40 -0
  91. package/docs/components/usa-ambient.md +32 -0
  92. package/docs/components/usa-anim-icon.md +34 -0
  93. package/docs/components/usa-audio.md +38 -0
  94. package/docs/components/usa-aurora.md +36 -0
  95. package/docs/components/usa-auto-animate.md +44 -0
  96. package/docs/components/usa-auto-skeleton.md +38 -0
  97. package/docs/components/usa-avatar-stack.md +38 -0
  98. package/docs/components/usa-back-to-top.md +32 -0
  99. package/docs/components/usa-badge-wall.md +39 -0
  100. package/docs/components/usa-badge.md +36 -0
  101. package/docs/components/usa-bar-chart.md +33 -0
  102. package/docs/components/usa-bg-generator.md +32 -0
  103. package/docs/components/usa-blobs.md +32 -0
  104. package/docs/components/usa-bottom-sheet.md +32 -0
  105. package/docs/components/usa-button.md +78 -0
  106. package/docs/components/usa-card-stack.md +40 -0
  107. package/docs/components/usa-card.md +94 -0
  108. package/docs/components/usa-carousel-3d.md +40 -0
  109. package/docs/components/usa-carousel.md +40 -0
  110. package/docs/components/usa-cart-drawer.md +33 -0
  111. package/docs/components/usa-chapter-nav.md +40 -0
  112. package/docs/components/usa-chat-composer.md +33 -0
  113. package/docs/components/usa-check.md +32 -0
  114. package/docs/components/usa-checkbox.md +32 -0
  115. package/docs/components/usa-click.md +36 -0
  116. package/docs/components/usa-clock-control.md +37 -0
  117. package/docs/components/usa-code-export.md +36 -0
  118. package/docs/components/usa-color-picker.md +32 -0
  119. package/docs/components/usa-command-palette.md +39 -0
  120. package/docs/components/usa-compare.md +38 -0
  121. package/docs/components/usa-countdown.md +32 -0
  122. package/docs/components/usa-counter.md +32 -0
  123. package/docs/components/usa-cube-gallery.md +40 -0
  124. package/docs/components/usa-cube.md +36 -0
  125. package/docs/components/usa-cursor.md +32 -0
  126. package/docs/components/usa-date-picker.md +32 -0
  127. package/docs/components/usa-depth.md +44 -0
  128. package/docs/components/usa-dialog.md +40 -0
  129. package/docs/components/usa-disclosure.md +38 -0
  130. package/docs/components/usa-distort.md +36 -0
  131. package/docs/components/usa-dock.md +40 -0
  132. package/docs/components/usa-dot-network.md +32 -0
  133. package/docs/components/usa-double-tap.md +36 -0
  134. package/docs/components/usa-draggable.md +38 -0
  135. package/docs/components/usa-draw.md +36 -0
  136. package/docs/components/usa-drawer.md +34 -0
  137. package/docs/components/usa-equalizer.md +33 -0
  138. package/docs/components/usa-fab.md +40 -0
  139. package/docs/components/usa-festival-banner.md +32 -0
  140. package/docs/components/usa-field.md +34 -0
  141. package/docs/components/usa-file-drop.md +35 -0
  142. package/docs/components/usa-fullpage.md +38 -0
  143. package/docs/components/usa-fx.md +851 -0
  144. package/docs/components/usa-gauge.md +32 -0
  145. package/docs/components/usa-gen-art.md +32 -0
  146. package/docs/components/usa-gesture-fx.md +36 -0
  147. package/docs/components/usa-gesture-sticker.md +36 -0
  148. package/docs/components/usa-glitch.md +32 -0
  149. package/docs/components/usa-globe.md +33 -0
  150. package/docs/components/usa-gradient-text.md +32 -0
  151. package/docs/components/usa-grain.md +36 -0
  152. package/docs/components/usa-grid-glow.md +36 -0
  153. package/docs/components/usa-gyro-card.md +38 -0
  154. package/docs/components/usa-handwriting.md +32 -0
  155. package/docs/components/usa-hero-video.md +38 -0
  156. package/docs/components/usa-hold.md +32 -0
  157. package/docs/components/usa-hud-panel.md +38 -0
  158. package/docs/components/usa-hydrate.md +42 -0
  159. package/docs/components/usa-icon-morph.md +34 -0
  160. package/docs/components/usa-install-button.md +32 -0
  161. package/docs/components/usa-kanban.md +46 -0
  162. package/docs/components/usa-keyframe-editor.md +37 -0
  163. package/docs/components/usa-kpi.md +32 -0
  164. package/docs/components/usa-leaderboard.md +41 -0
  165. package/docs/components/usa-like.md +32 -0
  166. package/docs/components/usa-liquid-nav.md +36 -0
  167. package/docs/components/usa-liquid.md +36 -0
  168. package/docs/components/usa-loading-bar.md +35 -0
  169. package/docs/components/usa-location-card.md +34 -0
  170. package/docs/components/usa-lottie-icon.md +34 -0
  171. package/docs/components/usa-lottie.md +32 -0
  172. package/docs/components/usa-lyrics.md +38 -0
  173. package/docs/components/usa-magnetic.md +32 -0
  174. package/docs/components/usa-marquee.md +38 -0
  175. package/docs/components/usa-mask-reveal.md +36 -0
  176. package/docs/components/usa-masonry-flow.md +42 -0
  177. package/docs/components/usa-masonry.md +38 -0
  178. package/docs/components/usa-menu-toggle.md +34 -0
  179. package/docs/components/usa-menu.md +44 -0
  180. package/docs/components/usa-message-list.md +39 -0
  181. package/docs/components/usa-milestones.md +40 -0
  182. package/docs/components/usa-modal.md +42 -0
  183. package/docs/components/usa-morph.md +34 -0
  184. package/docs/components/usa-motion-inspector.md +32 -0
  185. package/docs/components/usa-motion-prefs.md +32 -0
  186. package/docs/components/usa-motion-spec.md +32 -0
  187. package/docs/components/usa-motion-switch.md +34 -0
  188. package/docs/components/usa-motion-theme.md +40 -0
  189. package/docs/components/usa-motion.md +42 -0
  190. package/docs/components/usa-music-player.md +36 -0
  191. package/docs/components/usa-native-preview.md +36 -0
  192. package/docs/components/usa-nav-morph.md +40 -0
  193. package/docs/components/usa-navbar.md +36 -0
  194. package/docs/components/usa-notification-bell.md +37 -0
  195. package/docs/components/usa-odometer.md +34 -0
  196. package/docs/components/usa-organic-card.md +36 -0
  197. package/docs/components/usa-otp.md +33 -0
  198. package/docs/components/usa-overscroll.md +36 -0
  199. package/docs/components/usa-pack.md +111 -0
  200. package/docs/components/usa-pagination.md +32 -0
  201. package/docs/components/usa-panorama.md +32 -0
  202. package/docs/components/usa-particles.md +32 -0
  203. package/docs/components/usa-pause-all.md +32 -0
  204. package/docs/components/usa-perf-monitor.md +32 -0
  205. package/docs/components/usa-pinch-zoom.md +36 -0
  206. package/docs/components/usa-player.md +38 -0
  207. package/docs/components/usa-plugin-card.md +61 -0
  208. package/docs/components/usa-plugin-store.md +36 -0
  209. package/docs/components/usa-popover.md +38 -0
  210. package/docs/components/usa-post-fx.md +36 -0
  211. package/docs/components/usa-presence.md +36 -0
  212. package/docs/components/usa-press.md +32 -0
  213. package/docs/components/usa-prize-wheel.md +32 -0
  214. package/docs/components/usa-product-gallery.md +40 -0
  215. package/docs/components/usa-progress-ring.md +38 -0
  216. package/docs/components/usa-progress.md +34 -0
  217. package/docs/components/usa-prop-panel.md +34 -0
  218. package/docs/components/usa-pull-cord.md +32 -0
  219. package/docs/components/usa-pull-refresh.md +37 -0
  220. package/docs/components/usa-radar.md +32 -0
  221. package/docs/components/usa-reactions.md +32 -0
  222. package/docs/components/usa-red-envelope.md +32 -0
  223. package/docs/components/usa-retro-button.md +34 -0
  224. package/docs/components/usa-reveal.md +36 -0
  225. package/docs/components/usa-ripple.md +32 -0
  226. package/docs/components/usa-scene.md +38 -0
  227. package/docs/components/usa-scramble.md +32 -0
  228. package/docs/components/usa-scroll-highlight.md +34 -0
  229. package/docs/components/usa-scroll-progress.md +36 -0
  230. package/docs/components/usa-scroll-scene.md +66 -0
  231. package/docs/components/usa-scrolly.md +40 -0
  232. package/docs/components/usa-segmented.md +40 -0
  233. package/docs/components/usa-shader.md +74 -0
  234. package/docs/components/usa-sheet.md +42 -0
  235. package/docs/components/usa-shimmer-text.md +32 -0
  236. package/docs/components/usa-shortcut.md +34 -0
  237. package/docs/components/usa-skeleton-reveal.md +42 -0
  238. package/docs/components/usa-skeleton.md +36 -0
  239. package/docs/components/usa-sketch-chart.md +32 -0
  240. package/docs/components/usa-slider.md +32 -0
  241. package/docs/components/usa-sparkline.md +32 -0
  242. package/docs/components/usa-spatial-card.md +40 -0
  243. package/docs/components/usa-spinner.md +34 -0
  244. package/docs/components/usa-splash.md +36 -0
  245. package/docs/components/usa-split-text.md +32 -0
  246. package/docs/components/usa-spotlight.md +40 -0
  247. package/docs/components/usa-spring.md +42 -0
  248. package/docs/components/usa-stagger.md +40 -0
  249. package/docs/components/usa-star-rating.md +34 -0
  250. package/docs/components/usa-stepper.md +42 -0
  251. package/docs/components/usa-sticky-stack.md +40 -0
  252. package/docs/components/usa-sticky-wall.md +40 -0
  253. package/docs/components/usa-stories.md +38 -0
  254. package/docs/components/usa-story.md +80 -0
  255. package/docs/components/usa-suggestion-chips.md +32 -0
  256. package/docs/components/usa-swipe-deck.md +40 -0
  257. package/docs/components/usa-swipeable.md +36 -0
  258. package/docs/components/usa-switch.md +32 -0
  259. package/docs/components/usa-tab-bar.md +46 -0
  260. package/docs/components/usa-tabs.md +40 -0
  261. package/docs/components/usa-terminal.md +38 -0
  262. package/docs/components/usa-text-rotate.md +32 -0
  263. package/docs/components/usa-theme-surface.md +36 -0
  264. package/docs/components/usa-theme-switcher.md +32 -0
  265. package/docs/components/usa-tilt.md +36 -0
  266. package/docs/components/usa-timeline.md +40 -0
  267. package/docs/components/usa-tip.md +44 -0
  268. package/docs/components/usa-toast-stack.md +36 -0
  269. package/docs/components/usa-toaster.md +36 -0
  270. package/docs/components/usa-typewriter.md +32 -0
  271. package/docs/components/usa-upload-progress.md +33 -0
  272. package/docs/components/usa-video-card.md +40 -0
  273. package/docs/components/usa-view-switch.md +38 -0
  274. package/docs/components/usa-voice-button.md +33 -0
  275. package/docs/components/usa-volume-knob.md +32 -0
  276. package/docs/components/usa-water-ripple.md +36 -0
  277. package/docs/components/usa-wave-text.md +32 -0
  278. package/docs/components/usa-weather-card.md +32 -0
  279. package/docs/components/usa-worker-canvas.md +32 -0
  280. package/docs/components/usa-xp-bar.md +33 -0
  281. package/docs/components.md +105 -0
  282. package/docs/runtime/core.md +55 -0
  283. package/docs/runtime/format-css.md +59 -0
  284. package/docs/runtime/format-motion.md +56 -0
  285. package/docs/runtime/format-svg.md +62 -0
  286. package/docs/runtime/scroll.md +61 -0
  287. package/package.json +71 -7
@@ -0,0 +1,476 @@
1
+ import { g as getTicker } from './ticker-CM_56oVy.js';
2
+
3
+ const out = (f) => (t) => 1 - f(1 - t);
4
+ const inOut = (f) => (t) => (t < 0.5 ? f(t * 2) / 2 : 1 - f((1 - t) * 2) / 2);
5
+ const pow = (p) => (t) => Math.pow(t, p);
6
+ const sine = (t) => 1 - Math.cos((t * Math.PI) / 2);
7
+ const expo = (t) => (t === 0 ? 0 : Math.pow(2, 10 * t - 10));
8
+ const circ = (t) => 1 - Math.sqrt(1 - t * t);
9
+ const back = (s = 1.70158) => (t) => t * t * ((s + 1) * t - s);
10
+ const elastic = (t) => (t === 0 || t === 1 ? t : -Math.pow(2, 10 * t - 10) * Math.sin((t * 10 - 10.75) * ((2 * Math.PI) / 3)));
11
+ const bounceOut = (t) => {
12
+ const n = 7.5625, d = 2.75;
13
+ if (t < 1 / d)
14
+ return n * t * t;
15
+ if (t < 2 / d)
16
+ return n * (t -= 1.5 / d) * t + 0.75;
17
+ if (t < 2.5 / d)
18
+ return n * (t -= 2.25 / d) * t + 0.9375;
19
+ return n * (t -= 2.625 / d) * t + 0.984375;
20
+ };
21
+ /** cubic-bezier(x1, y1, x2, y2), solved with Newton steps + bisection fallback. */
22
+ function cubicBezier(x1, y1, x2, y2) {
23
+ const a = (p1, p2) => 1 - 3 * p2 + 3 * p1;
24
+ const b = (p1, p2) => 3 * p2 - 6 * p1;
25
+ const c = (p1) => 3 * p1;
26
+ const at = (t, p1, p2) => ((a(p1, p2) * t + b(p1, p2)) * t + c(p1)) * t;
27
+ const slope = (t, p1, p2) => 3 * a(p1, p2) * t * t + 2 * b(p1, p2) * t + c(p1);
28
+ return (x) => {
29
+ if (x <= 0 || x >= 1)
30
+ return x <= 0 ? 0 : 1;
31
+ let t = x;
32
+ for (let i = 0; i < 6; i++) {
33
+ const s = slope(t, x1, x2);
34
+ if (Math.abs(s) < 1e-6)
35
+ break;
36
+ t -= (at(t, x1, x2) - x) / s;
37
+ }
38
+ if (t < 0 || t > 1 || Math.abs(at(t, x1, x2) - x) > 1e-4) {
39
+ let lo = 0, hi = 1;
40
+ t = x;
41
+ for (let i = 0; i < 30; i++) {
42
+ const v = at(t, x1, x2);
43
+ if (Math.abs(v - x) < 1e-6)
44
+ break;
45
+ if (v < x)
46
+ lo = t;
47
+ else
48
+ hi = t;
49
+ t = (lo + hi) / 2;
50
+ }
51
+ }
52
+ return at(t, y1, y2);
53
+ };
54
+ }
55
+ /** steps(n, 'end' | 'start'). */
56
+ const steps = (n, pos = 'end') => (t) => {
57
+ const k = pos === 'start' ? Math.ceil(t * n) : Math.floor(t * n);
58
+ return Math.min(1, Math.max(0, k / n));
59
+ };
60
+ /** Named eases: linear, quad/cubic/quart/quint, sine, expo, circ, back, elastic, bounce — each `.in`, `.out`, `.inOut` via 'name-in' | 'name-out' | 'name-in-out'. */
61
+ const BASE = { quad: pow(2), cubic: pow(3), quart: pow(4), quint: pow(5), sine, expo, circ, back: back(), elastic, bounce: out(bounceOut) };
62
+ const EASES = { linear: (t) => t, ease: cubicBezier(0.25, 0.1, 0.25, 1), 'ease-in': cubicBezier(0.42, 0, 1, 1), 'ease-out': cubicBezier(0, 0, 0.58, 1), 'ease-in-out': cubicBezier(0.42, 0, 0.58, 1), smooth: cubicBezier(0.22, 1, 0.36, 1) };
63
+ for (const [k, f] of Object.entries(BASE)) {
64
+ EASES[`${k}-in`] = f;
65
+ EASES[`${k}-out`] = out(f);
66
+ EASES[`${k}-in-out`] = inOut(f);
67
+ }
68
+ /** Resolve an ease: a function, a name ('cubic-out', 'ease-in-out', 'linear'), 'cubic-bezier(a,b,c,d)' or 'steps(n[, start|end])'. Unknown names throw. */
69
+ function parseEase(e) {
70
+ if (typeof e === 'function')
71
+ return e;
72
+ if (!e)
73
+ return EASES['cubic-out'];
74
+ const s = e.trim();
75
+ if (EASES[s])
76
+ return EASES[s];
77
+ let m = /^cubic-bezier\(\s*([-\d.]+)\s*,\s*([-\d.]+)\s*,\s*([-\d.]+)\s*,\s*([-\d.]+)\s*\)$/.exec(s);
78
+ if (m)
79
+ return cubicBezier(+m[1], +m[2], +m[3], +m[4]);
80
+ m = /^steps\(\s*(\d+)\s*(?:,\s*(jump-)?(start|end)\s*)?\)$/.exec(s);
81
+ if (m)
82
+ return steps(+m[1], m[3] || 'end');
83
+ if (s === 'step-start')
84
+ return steps(1, 'start');
85
+ if (s === 'step-end')
86
+ return steps(1, 'end');
87
+ throw new Error(`[motionary] unknown ease "${s}" — use a name from EASES, cubic-bezier(…) or steps(…)`);
88
+ }
89
+
90
+ /**
91
+ * Tween + timeline engine (original implementation). Times are in
92
+ * milliseconds. Targets are plain objects (numeric props) or elements
93
+ * (CSS: numbers with units, colours, `opacity`, custom properties, and the
94
+ * transform shorthands `x y rotate scale scaleX scaleY skewX skewY`,
95
+ * composed in that order). Driven by the shared ticker; a tween placed in a
96
+ * timeline is driven by the timeline instead.
97
+ */
98
+ const TRANSFORM = ['x', 'y', 'rotate', 'scale', 'scaleX', 'scaleY', 'skewX', 'skewY'];
99
+ const DEFAULT_UNIT = { x: 'px', y: 'px', rotate: 'deg', skewX: 'deg', skewY: 'deg', scale: '', scaleX: '', scaleY: '' };
100
+ const tstate = new WeakMap();
101
+ const isEl = (t) => typeof Element !== 'undefined' && t instanceof Element;
102
+ /** Parse '12px', '-3.5', '50%', '#0af', 'rgb(1 2 3 / .5)', 'rgba(…)'. */
103
+ function parseValue(v) {
104
+ if (typeof v === 'number')
105
+ return { kind: 'num', v, u: '' };
106
+ const s = v.trim();
107
+ let m = /^#([0-9a-f]{3,8})$/i.exec(s);
108
+ if (m) {
109
+ let h = m[1];
110
+ if (h.length <= 4)
111
+ h = h.split('').map((c) => c + c).join('');
112
+ const n = (i) => parseInt(h.slice(i, i + 2), 16);
113
+ return { kind: 'col', c: [n(0), n(2), n(4), h.length === 8 ? n(6) / 255 : 1] };
114
+ }
115
+ m = /^rgba?\(([^)]+)\)$/i.exec(s);
116
+ if (m) {
117
+ const p = m[1].split(/[\s,/]+/).filter(Boolean).map((x) => (x.endsWith('%') ? (parseFloat(x) / 100) * 255 : parseFloat(x)));
118
+ return { kind: 'col', c: [p[0], p[1], p[2], p[3] === undefined ? 1 : p[3] > 1 ? p[3] / 255 : p[3]] };
119
+ }
120
+ if (s === 'transparent')
121
+ return { kind: 'col', c: [0, 0, 0, 0] };
122
+ m = /^(-?[\d.]+(?:e-?\d+)?)([a-z%]*)$/i.exec(s);
123
+ if (m)
124
+ return { kind: 'num', v: parseFloat(m[1]), u: m[2] };
125
+ throw new Error(`[motionary] cannot tween value "${s}"`);
126
+ }
127
+ const lerpVal = (a, b, p) => {
128
+ if (a.kind === 'col' || b.kind === 'col') {
129
+ const ca = a.kind === 'col' ? a.c : [0, 0, 0, 0], cb = b.kind === 'col' ? b.c : [0, 0, 0, 0];
130
+ const c = ca.map((x, i) => x + (cb[i] - x) * p);
131
+ return `rgba(${Math.round(c[0])}, ${Math.round(c[1])}, ${Math.round(c[2])}, ${+c[3].toFixed(3)})`;
132
+ }
133
+ const v = a.v + (b.v - a.v) * p;
134
+ const u = b.u || a.u;
135
+ return u ? `${+v.toFixed(4)}${u}` : +v.toFixed(6);
136
+ };
137
+ const kebab = (k) => (k.startsWith('--') ? k : k.replace(/[A-Z]/g, (c) => '-' + c.toLowerCase()));
138
+ function readProp(t, k) {
139
+ if (!isEl(t))
140
+ return t[k] ?? 0;
141
+ if (TRANSFORM.includes(k)) {
142
+ const s = tstate.get(t)?.[k];
143
+ return s ? s.v + s.u : k.startsWith('scale') ? 1 : 0;
144
+ }
145
+ const inline = t.style.getPropertyValue(kebab(k));
146
+ if (inline)
147
+ return inline;
148
+ const cs = typeof getComputedStyle === 'function' ? getComputedStyle(t).getPropertyValue(kebab(k)) : '';
149
+ return cs || (k === 'opacity' ? 1 : 0);
150
+ }
151
+ function writeTransform(el) {
152
+ const s = tstate.get(el);
153
+ const g = (k, d) => (s[k] ? s[k].v : d);
154
+ const u = (k) => (s[k]?.u ?? DEFAULT_UNIT[k]);
155
+ const parts = [];
156
+ if (s.x || s.y)
157
+ parts.push(`translate(${g('x', 0)}${u('x') || 'px'}, ${g('y', 0)}${u('y') || 'px'})`);
158
+ if (s.rotate)
159
+ parts.push(`rotate(${g('rotate', 0)}${u('rotate') || 'deg'})`);
160
+ if (s.scale)
161
+ parts.push(`scale(${g('scale', 1)})`);
162
+ if (s.scaleX || s.scaleY)
163
+ parts.push(`scale(${g('scaleX', 1)}, ${g('scaleY', 1)})`);
164
+ if (s.skewX)
165
+ parts.push(`skewX(${g('skewX', 0)}${u('skewX') || 'deg'})`);
166
+ if (s.skewY)
167
+ parts.push(`skewY(${g('skewY', 0)}${u('skewY') || 'deg'})`);
168
+ el.style.transform = parts.join(' ');
169
+ }
170
+ function writeProp(t, k, v) {
171
+ if (!isEl(t)) {
172
+ t[k] = typeof v === 'string' && typeof t[k] === 'number' ? parseFloat(v) : v;
173
+ return;
174
+ }
175
+ if (TRANSFORM.includes(k)) {
176
+ const p = parseValue(v);
177
+ const s = tstate.get(t) || {};
178
+ s[k] = { v: p.v, u: p.u };
179
+ tstate.set(t, s);
180
+ return;
181
+ }
182
+ t.style.setProperty(kebab(k), typeof v === 'number' && !['opacity', 'zIndex', 'z-index'].includes(k) && !k.startsWith('--') ? v + 'px' : String(v));
183
+ }
184
+ /** Common playback: delay, repeat, yoyo, direction, ticker attachment, promise. */
185
+ class Playable {
186
+ constructor(o) {
187
+ /** Playback rate multiplier. */
188
+ this.timeScale = 1;
189
+ this._t = 0;
190
+ this._dir = 1;
191
+ this._off = null;
192
+ this._done = false;
193
+ /** Set when owned by a timeline (then the ticker never drives it). */
194
+ this.parent = null;
195
+ this.delay = o.delay || 0;
196
+ this.repeat = o.repeat || 0;
197
+ this.yoyo = !!o.yoyo;
198
+ this.onUpdate = o.onUpdate;
199
+ this.onComplete = o.onComplete;
200
+ this.finished = new Promise((r) => (this._resolve = r));
201
+ }
202
+ get totalDuration() {
203
+ return this.repeat < 0 ? Infinity : this.delay + this.duration * (this.repeat + 1);
204
+ }
205
+ get time() {
206
+ return this._t;
207
+ }
208
+ get progress() {
209
+ const td = this.totalDuration;
210
+ return td === Infinity ? ((this._t - this.delay) % this.duration) / this.duration : td ? this._t / td : 1;
211
+ }
212
+ set progress(p) {
213
+ this.seek(p * (this.totalDuration === Infinity ? this.delay + this.duration : this.totalDuration));
214
+ }
215
+ get isActive() {
216
+ return !!this._off;
217
+ }
218
+ get reversed() {
219
+ return this._dir < 0;
220
+ }
221
+ /** Jump to `ms` (total time, including the delay) and render. */
222
+ seek(ms) {
223
+ const td = this.totalDuration;
224
+ this._t = Math.max(0, Math.min(ms, td));
225
+ const t = this._t - this.delay;
226
+ const d = this.duration || 0;
227
+ if (t < 0)
228
+ this.renderLocal(0, false);
229
+ else if (!d)
230
+ this.renderLocal(0, true);
231
+ else {
232
+ let it = d === Infinity ? 0 : Math.floor(t / d);
233
+ let local = d === Infinity ? t : t - it * d;
234
+ if (t >= td - this.delay && td !== Infinity) {
235
+ it = this.repeat;
236
+ local = d;
237
+ }
238
+ const back = this.yoyo && it % 2 === 1;
239
+ this.renderLocal(back ? d - local : local, local === d);
240
+ }
241
+ this.onUpdate?.(this.progress);
242
+ return this;
243
+ }
244
+ play() {
245
+ this._dir = 1;
246
+ if (this._t >= this.totalDuration)
247
+ this._t = 0;
248
+ return this.attach();
249
+ }
250
+ pause() {
251
+ this._off?.();
252
+ this._off = null;
253
+ return this;
254
+ }
255
+ /** Play backwards from the current time. */
256
+ reverse() {
257
+ this._dir = -1;
258
+ if (this._t <= 0)
259
+ this._t = this.totalDuration === Infinity ? this.delay + this.duration : this.totalDuration;
260
+ return this.attach();
261
+ }
262
+ restart() {
263
+ this._done = false;
264
+ this.seek(0);
265
+ return this.play();
266
+ }
267
+ /** Stop and detach for good. */
268
+ kill() {
269
+ this.pause();
270
+ this.parent?.remove(this);
271
+ }
272
+ /** Promise-like: `await tween(...)`. */
273
+ then(ok, err) {
274
+ return this.finished.then(ok, err);
275
+ }
276
+ attach() {
277
+ if (this.parent || this._off)
278
+ return this;
279
+ this._done = false;
280
+ this._off = getTicker().add((_, dt) => this.advance(dt));
281
+ return this;
282
+ }
283
+ advance(dt) {
284
+ const td = this.totalDuration;
285
+ this.seek(this._t + dt * this._dir * this.timeScale);
286
+ if ((this._dir > 0 && this._t >= td) || (this._dir < 0 && this._t <= 0))
287
+ this.complete();
288
+ }
289
+ complete() {
290
+ this.pause();
291
+ if (this._done)
292
+ return;
293
+ this._done = true;
294
+ this.onComplete?.();
295
+ this._resolve();
296
+ }
297
+ }
298
+ /** A tween of one target. */
299
+ class Tween extends Playable {
300
+ constructor(target, o) {
301
+ super(o);
302
+ this.tracks = null;
303
+ this.target = target;
304
+ this._dur = o.duration ?? 600;
305
+ this.ease = parseEase(o.ease);
306
+ this.toProps = o.to || {};
307
+ this.fromProps = o.from || {};
308
+ }
309
+ get duration() {
310
+ return this._dur;
311
+ }
312
+ /** Capture start values (first render). */
313
+ init() {
314
+ const keys = Array.from(new Set([...Object.keys(this.fromProps), ...Object.keys(this.toProps)]));
315
+ return keys.map((k) => {
316
+ const fromRaw = k in this.fromProps ? this.fromProps[k] : readProp(this.target, k);
317
+ const toRaw = k in this.toProps ? this.toProps[k] : readProp(this.target, k);
318
+ return { k, fromRaw, toRaw, from: parseValue(fromRaw), to: parseValue(toRaw) };
319
+ });
320
+ }
321
+ renderLocal(ms, ended) {
322
+ this.tracks || (this.tracks = this.init());
323
+ const p = this._dur ? (ended ? this.ease(ms >= this._dur ? 1 : 0) : this.ease(ms / this._dur)) : 1;
324
+ let tr = false;
325
+ for (const t of this.tracks) {
326
+ writeProp(this.target, t.k, lerpVal(t.from, t.to, p));
327
+ if (TRANSFORM.includes(t.k))
328
+ tr = true;
329
+ }
330
+ if (tr && isEl(this.target))
331
+ writeTransform(this.target);
332
+ }
333
+ }
334
+ /** A sequence of tweens, nested timelines and callbacks. */
335
+ class Timeline extends Playable {
336
+ constructor(o = {}) {
337
+ super(o);
338
+ this.children = [];
339
+ this.labels = {};
340
+ this.prevStart = 0;
341
+ this.prevEnd = 0;
342
+ this.lastLocal = 0;
343
+ this.defaults = o.defaults;
344
+ }
345
+ get duration() {
346
+ let d = 0;
347
+ for (const c of this.children)
348
+ d = Math.max(d, c.start + (typeof c.item === 'function' ? 0 : c.item.totalDuration));
349
+ return d;
350
+ }
351
+ resolve(pos) {
352
+ if (pos === undefined || pos === '>')
353
+ return this.prevEnd;
354
+ if (typeof pos === 'number')
355
+ return Math.max(0, pos);
356
+ const m = /^([<>]|[\w-]+)?\s*(?:([+-])=\s*([\d.]+))?$/.exec(pos.trim());
357
+ if (!m)
358
+ throw new Error(`[motionary] bad timeline position "${pos}"`);
359
+ let base = this.prevEnd;
360
+ if (m[1] === '<')
361
+ base = this.prevStart;
362
+ else if (m[1] && m[1] !== '>') {
363
+ if (!(m[1] in this.labels))
364
+ throw new Error(`[motionary] unknown timeline label "${m[1]}"`);
365
+ base = this.labels[m[1]];
366
+ }
367
+ const off = m[2] ? (m[2] === '+' ? 1 : -1) * parseFloat(m[3]) : 0;
368
+ return Math.max(0, base + off);
369
+ }
370
+ /** Add a tween, timeline or callback at a position. */
371
+ add(item, position) {
372
+ const start = this.resolve(position);
373
+ if (typeof item !== 'function') {
374
+ item.pause();
375
+ item.parent = this;
376
+ }
377
+ this.children.push({ item, start });
378
+ this.prevStart = start;
379
+ this.prevEnd = start + (typeof item === 'function' ? 0 : item.totalDuration);
380
+ return this;
381
+ }
382
+ /** `tween(target, vars)` placed at `position` (stagger across several targets). */
383
+ to(target, vars, position) {
384
+ const list = toList(target);
385
+ const start = this.resolve(position);
386
+ let end = start;
387
+ list.forEach((t, i) => {
388
+ const tw = new Tween(t, { ...this.defaults, ...vars, delay: (vars.delay || 0) + (vars.stagger || 0) * i, paused: true });
389
+ tw.parent = this;
390
+ this.children.push({ item: tw, start });
391
+ end = Math.max(end, start + tw.totalDuration);
392
+ });
393
+ this.prevStart = start;
394
+ this.prevEnd = end;
395
+ return this;
396
+ }
397
+ call(fn, position) {
398
+ return this.add(fn, position);
399
+ }
400
+ label(name, position) {
401
+ this.labels[name] = this.resolve(position);
402
+ return this;
403
+ }
404
+ /** Time of a label, ms. */
405
+ labelTime(name) {
406
+ return this.labels[name];
407
+ }
408
+ remove(item) {
409
+ this.children = this.children.filter((c) => c.item !== item);
410
+ }
411
+ /** Children in start order (callbacks excluded). */
412
+ getChildren() {
413
+ return this.children.filter((c) => typeof c.item !== 'function').map((c) => c.item);
414
+ }
415
+ renderLocal(ms) {
416
+ const forward = ms >= this.lastLocal;
417
+ const list = [...this.children].sort((a, b) => (forward ? a.start - b.start : b.start - a.start));
418
+ for (const c of list) {
419
+ if (typeof c.item === 'function') {
420
+ if (forward && !c.fired && ms >= c.start && this.lastLocal <= c.start) {
421
+ c.fired = true;
422
+ c.item();
423
+ }
424
+ else if (!forward && ms < c.start)
425
+ c.fired = false;
426
+ continue;
427
+ }
428
+ const local = ms - c.start;
429
+ const p = c.item;
430
+ if (local < 0) {
431
+ if (p._started)
432
+ p.seek(0);
433
+ continue;
434
+ }
435
+ p._started = true;
436
+ p.seek(Math.min(local, p.totalDuration));
437
+ }
438
+ this.lastLocal = ms;
439
+ }
440
+ }
441
+ function toList(t) {
442
+ if (Array.isArray(t))
443
+ return t;
444
+ if (t && typeof t.length === 'number' && !isEl(t))
445
+ return Array.from(t);
446
+ return [t];
447
+ }
448
+ /**
449
+ * Tween one or more targets. Returns a `Tween` (or a `Timeline` holding one
450
+ * tween per target when several are given) that starts on the next frame
451
+ * unless `paused`. `await` it for completion.
452
+ */
453
+ function tween(target, o) {
454
+ const list = toList(target);
455
+ let p;
456
+ if (list.length === 1)
457
+ p = new Tween(list[0], o);
458
+ else {
459
+ const tl = new Timeline({ repeat: o.repeat, yoyo: o.yoyo, onUpdate: o.onUpdate, onComplete: o.onComplete, delay: o.delay });
460
+ tl.to(list, { ...o, delay: 0, repeat: 0, yoyo: false, onUpdate: undefined, onComplete: undefined }, 0);
461
+ p = tl;
462
+ }
463
+ if (!o.paused)
464
+ p.play();
465
+ return p;
466
+ }
467
+ /** A new timeline (plays on the next frame unless `paused`). */
468
+ function timeline(o = {}) {
469
+ const tl = new Timeline(o);
470
+ if (!o.paused)
471
+ tl.play();
472
+ return tl;
473
+ }
474
+
475
+ export { EASES as E, Playable as P, Timeline as T, Tween as a, tween as b, cubicBezier as c, parseValue as d, parseEase as p, steps as s, timeline as t };
476
+ //# sourceMappingURL=tween-CqX1JBuj.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tween-CqX1JBuj.js","sources":["../../src/runtime/ease.ts","../../src/runtime/tween.ts"],"sourcesContent":["/** Easing functions (t ∈ [0, 1] → progress). Original implementations of the standard Penner-style curves. */\nexport type Ease = (t: number) => number;\n\nconst out = (f: Ease): Ease => (t) => 1 - f(1 - t);\nconst inOut = (f: Ease): Ease => (t) => (t < 0.5 ? f(t * 2) / 2 : 1 - f((1 - t) * 2) / 2);\nconst pow = (p: number): Ease => (t) => Math.pow(t, p);\nconst sine: Ease = (t) => 1 - Math.cos((t * Math.PI) / 2);\nconst expo: Ease = (t) => (t === 0 ? 0 : Math.pow(2, 10 * t - 10));\nconst circ: Ease = (t) => 1 - Math.sqrt(1 - t * t);\nconst back = (s = 1.70158): Ease => (t) => t * t * ((s + 1) * t - s);\nconst elastic: Ease = (t) => (t === 0 || t === 1 ? t : -Math.pow(2, 10 * t - 10) * Math.sin((t * 10 - 10.75) * ((2 * Math.PI) / 3)));\nconst bounceOut: Ease = (t) => {\n const n = 7.5625, d = 2.75;\n if (t < 1 / d) return n * t * t;\n if (t < 2 / d) return n * (t -= 1.5 / d) * t + 0.75;\n if (t < 2.5 / d) return n * (t -= 2.25 / d) * t + 0.9375;\n return n * (t -= 2.625 / d) * t + 0.984375;\n};\n\n/** cubic-bezier(x1, y1, x2, y2), solved with Newton steps + bisection fallback. */\nexport function cubicBezier(x1: number, y1: number, x2: number, y2: number): Ease {\n const a = (p1: number, p2: number) => 1 - 3 * p2 + 3 * p1;\n const b = (p1: number, p2: number) => 3 * p2 - 6 * p1;\n const c = (p1: number) => 3 * p1;\n const at = (t: number, p1: number, p2: number) => ((a(p1, p2) * t + b(p1, p2)) * t + c(p1)) * t;\n const slope = (t: number, p1: number, p2: number) => 3 * a(p1, p2) * t * t + 2 * b(p1, p2) * t + c(p1);\n return (x) => {\n if (x <= 0 || x >= 1) return x <= 0 ? 0 : 1;\n let t = x;\n for (let i = 0; i < 6; i++) {\n const s = slope(t, x1, x2);\n if (Math.abs(s) < 1e-6) break;\n t -= (at(t, x1, x2) - x) / s;\n }\n if (t < 0 || t > 1 || Math.abs(at(t, x1, x2) - x) > 1e-4) {\n let lo = 0, hi = 1;\n t = x;\n for (let i = 0; i < 30; i++) {\n const v = at(t, x1, x2);\n if (Math.abs(v - x) < 1e-6) break;\n if (v < x) lo = t; else hi = t;\n t = (lo + hi) / 2;\n }\n }\n return at(t, y1, y2);\n };\n}\n\n/** steps(n, 'end' | 'start'). */\nexport const steps = (n: number, pos: 'start' | 'end' = 'end'): Ease => (t) => {\n const k = pos === 'start' ? Math.ceil(t * n) : Math.floor(t * n);\n return Math.min(1, Math.max(0, k / n));\n};\n\n/** Named eases: linear, quad/cubic/quart/quint, sine, expo, circ, back, elastic, bounce — each `.in`, `.out`, `.inOut` via 'name-in' | 'name-out' | 'name-in-out'. */\nconst BASE: Record<string, Ease> = { quad: pow(2), cubic: pow(3), quart: pow(4), quint: pow(5), sine, expo, circ, back: back(), elastic, bounce: out(bounceOut) };\nexport const EASES: Record<string, Ease> = { linear: (t) => t, ease: cubicBezier(0.25, 0.1, 0.25, 1), 'ease-in': cubicBezier(0.42, 0, 1, 1), 'ease-out': cubicBezier(0, 0, 0.58, 1), 'ease-in-out': cubicBezier(0.42, 0, 0.58, 1), smooth: cubicBezier(0.22, 1, 0.36, 1) };\nfor (const [k, f] of Object.entries(BASE)) {\n EASES[`${k}-in`] = f;\n EASES[`${k}-out`] = out(f);\n EASES[`${k}-in-out`] = inOut(f);\n}\n\n/** Resolve an ease: a function, a name ('cubic-out', 'ease-in-out', 'linear'), 'cubic-bezier(a,b,c,d)' or 'steps(n[, start|end])'. Unknown names throw. */\nexport function parseEase(e?: string | Ease): Ease {\n if (typeof e === 'function') return e;\n if (!e) return EASES['cubic-out'];\n const s = e.trim();\n if (EASES[s]) return EASES[s];\n let m = /^cubic-bezier\\(\\s*([-\\d.]+)\\s*,\\s*([-\\d.]+)\\s*,\\s*([-\\d.]+)\\s*,\\s*([-\\d.]+)\\s*\\)$/.exec(s);\n if (m) return cubicBezier(+m[1], +m[2], +m[3], +m[4]);\n m = /^steps\\(\\s*(\\d+)\\s*(?:,\\s*(jump-)?(start|end)\\s*)?\\)$/.exec(s);\n if (m) return steps(+m[1], (m[3] as 'start' | 'end') || 'end');\n if (s === 'step-start') return steps(1, 'start');\n if (s === 'step-end') return steps(1, 'end');\n throw new Error(`[motionary] unknown ease \"${s}\" — use a name from EASES, cubic-bezier(…) or steps(…)`);\n}\n","/**\n * Tween + timeline engine (original implementation). Times are in\n * milliseconds. Targets are plain objects (numeric props) or elements\n * (CSS: numbers with units, colours, `opacity`, custom properties, and the\n * transform shorthands `x y rotate scale scaleX scaleY skewX skewY`,\n * composed in that order). Driven by the shared ticker; a tween placed in a\n * timeline is driven by the timeline instead.\n */\nimport { getTicker } from './ticker';\nimport { parseEase, type Ease } from './ease';\n\nexport type Target = object | Element;\nexport type Props = Record<string, number | string>;\n\nexport interface PlayOptions {\n /** Delay before the first iteration, ms. */\n delay?: number;\n /** Extra iterations (-1 = forever). */\n repeat?: number;\n /** Alternate direction on every other iteration. */\n yoyo?: boolean;\n /** Start paused (`play()` to start). */\n paused?: boolean;\n onUpdate?: (progress: number) => void;\n onComplete?: () => void;\n}\n\nexport interface TweenOptions extends PlayOptions {\n to?: Props;\n from?: Props;\n /** ms (default 600). */\n duration?: number;\n ease?: string | Ease;\n /** Delay added per target index (ms) when several targets are given. */\n stagger?: number;\n}\n\nconst TRANSFORM = ['x', 'y', 'rotate', 'scale', 'scaleX', 'scaleY', 'skewX', 'skewY'];\nconst DEFAULT_UNIT: Record<string, string> = { x: 'px', y: 'px', rotate: 'deg', skewX: 'deg', skewY: 'deg', scale: '', scaleX: '', scaleY: '' };\ntype TState = Record<string, { v: number; u: string }>;\nconst tstate = new WeakMap<Element, TState>();\n\nconst isEl = (t: unknown): t is HTMLElement => typeof Element !== 'undefined' && t instanceof Element;\n\ninterface Num { kind: 'num'; v: number; u: string }\ninterface Col { kind: 'col'; c: number[] }\ntype Val = Num | Col;\n\n/** Parse '12px', '-3.5', '50%', '#0af', 'rgb(1 2 3 / .5)', 'rgba(…)'. */\nexport function parseValue(v: number | string): Val {\n if (typeof v === 'number') return { kind: 'num', v, u: '' };\n const s = v.trim();\n let m = /^#([0-9a-f]{3,8})$/i.exec(s);\n if (m) {\n let h = m[1];\n if (h.length <= 4) h = h.split('').map((c) => c + c).join('');\n const n = (i: number) => parseInt(h.slice(i, i + 2), 16);\n return { kind: 'col', c: [n(0), n(2), n(4), h.length === 8 ? n(6) / 255 : 1] };\n }\n m = /^rgba?\\(([^)]+)\\)$/i.exec(s);\n if (m) {\n const p = m[1].split(/[\\s,/]+/).filter(Boolean).map((x) => (x.endsWith('%') ? (parseFloat(x) / 100) * 255 : parseFloat(x)));\n return { kind: 'col', c: [p[0], p[1], p[2], p[3] === undefined ? 1 : p[3] > 1 ? p[3] / 255 : p[3]] };\n }\n if (s === 'transparent') return { kind: 'col', c: [0, 0, 0, 0] };\n m = /^(-?[\\d.]+(?:e-?\\d+)?)([a-z%]*)$/i.exec(s);\n if (m) return { kind: 'num', v: parseFloat(m[1]), u: m[2] };\n throw new Error(`[motionary] cannot tween value \"${s}\"`);\n}\n\nconst lerpVal = (a: Val, b: Val, p: number): string | number => {\n if (a.kind === 'col' || b.kind === 'col') {\n const ca = a.kind === 'col' ? a.c : [0, 0, 0, 0], cb = b.kind === 'col' ? b.c : [0, 0, 0, 0];\n const c = ca.map((x, i) => x + (cb[i] - x) * p);\n return `rgba(${Math.round(c[0])}, ${Math.round(c[1])}, ${Math.round(c[2])}, ${+c[3].toFixed(3)})`;\n }\n const v = a.v + (b.v - a.v) * p;\n const u = b.u || a.u;\n return u ? `${+v.toFixed(4)}${u}` : +v.toFixed(6);\n};\n\nconst kebab = (k: string) => (k.startsWith('--') ? k : k.replace(/[A-Z]/g, (c) => '-' + c.toLowerCase()));\n\nfunction readProp(t: Target, k: string): number | string {\n if (!isEl(t)) return (t as any)[k] ?? 0;\n if (TRANSFORM.includes(k)) {\n const s = tstate.get(t)?.[k];\n return s ? s.v + s.u : k.startsWith('scale') ? 1 : 0;\n }\n const inline = t.style.getPropertyValue(kebab(k));\n if (inline) return inline;\n const cs = typeof getComputedStyle === 'function' ? getComputedStyle(t).getPropertyValue(kebab(k)) : '';\n return cs || (k === 'opacity' ? 1 : 0);\n}\n\nfunction writeTransform(el: HTMLElement): void {\n const s = tstate.get(el)!;\n const g = (k: string, d: number) => (s[k] ? s[k].v : d);\n const u = (k: string) => (s[k]?.u ?? DEFAULT_UNIT[k]);\n const parts: string[] = [];\n if (s.x || s.y) parts.push(`translate(${g('x', 0)}${u('x') || 'px'}, ${g('y', 0)}${u('y') || 'px'})`);\n if (s.rotate) parts.push(`rotate(${g('rotate', 0)}${u('rotate') || 'deg'})`);\n if (s.scale) parts.push(`scale(${g('scale', 1)})`);\n if (s.scaleX || s.scaleY) parts.push(`scale(${g('scaleX', 1)}, ${g('scaleY', 1)})`);\n if (s.skewX) parts.push(`skewX(${g('skewX', 0)}${u('skewX') || 'deg'})`);\n if (s.skewY) parts.push(`skewY(${g('skewY', 0)}${u('skewY') || 'deg'})`);\n el.style.transform = parts.join(' ');\n}\n\nfunction writeProp(t: Target, k: string, v: string | number): void {\n if (!isEl(t)) {\n (t as any)[k] = typeof v === 'string' && typeof (t as any)[k] === 'number' ? parseFloat(v) : v;\n return;\n }\n if (TRANSFORM.includes(k)) {\n const p = parseValue(v) as Num;\n const s = tstate.get(t) || {};\n s[k] = { v: p.v, u: p.u };\n tstate.set(t, s);\n return;\n }\n t.style.setProperty(kebab(k), typeof v === 'number' && !['opacity', 'zIndex', 'z-index'].includes(k) && !k.startsWith('--') ? v + 'px' : String(v));\n}\n\n/** Common playback: delay, repeat, yoyo, direction, ticker attachment, promise. */\nexport abstract class Playable {\n delay: number;\n repeat: number;\n yoyo: boolean;\n /** Playback rate multiplier. */\n timeScale = 1;\n onUpdate?: (progress: number) => void;\n onComplete?: () => void;\n protected _t = 0;\n private _dir = 1;\n private _off: (() => void) | null = null;\n private _done = false;\n private _resolve!: () => void;\n /** Resolves on completion (forward end, or start when reversed). */\n finished: Promise<void>;\n /** Set when owned by a timeline (then the ticker never drives it). */\n parent: Timeline | null = null;\n\n constructor(o: PlayOptions) {\n this.delay = o.delay || 0;\n this.repeat = o.repeat || 0;\n this.yoyo = !!o.yoyo;\n this.onUpdate = o.onUpdate;\n this.onComplete = o.onComplete;\n this.finished = new Promise((r) => (this._resolve = r));\n }\n /** One iteration, ms. */\n abstract get duration(): number;\n /** Render at `ms` into one iteration. */\n protected abstract renderLocal(ms: number, iterationEnded: boolean): void;\n\n get totalDuration(): number {\n return this.repeat < 0 ? Infinity : this.delay + this.duration * (this.repeat + 1);\n }\n get time(): number {\n return this._t;\n }\n get progress(): number {\n const td = this.totalDuration;\n return td === Infinity ? ((this._t - this.delay) % this.duration) / this.duration : td ? this._t / td : 1;\n }\n set progress(p: number) {\n this.seek(p * (this.totalDuration === Infinity ? this.delay + this.duration : this.totalDuration));\n }\n get isActive(): boolean {\n return !!this._off;\n }\n get reversed(): boolean {\n return this._dir < 0;\n }\n\n /** Jump to `ms` (total time, including the delay) and render. */\n seek(ms: number): this {\n const td = this.totalDuration;\n this._t = Math.max(0, Math.min(ms, td));\n const t = this._t - this.delay;\n const d = this.duration || 0;\n if (t < 0) this.renderLocal(0, false);\n else if (!d) this.renderLocal(0, true);\n else {\n let it = d === Infinity ? 0 : Math.floor(t / d);\n let local = d === Infinity ? t : t - it * d;\n if (t >= td - this.delay && td !== Infinity) {\n it = this.repeat;\n local = d;\n }\n const back = this.yoyo && it % 2 === 1;\n this.renderLocal(back ? d - local : local, local === d);\n }\n this.onUpdate?.(this.progress);\n return this;\n }\n\n play(): this {\n this._dir = 1;\n if (this._t >= this.totalDuration) this._t = 0;\n return this.attach();\n }\n pause(): this {\n this._off?.();\n this._off = null;\n return this;\n }\n /** Play backwards from the current time. */\n reverse(): this {\n this._dir = -1;\n if (this._t <= 0) this._t = this.totalDuration === Infinity ? this.delay + this.duration : this.totalDuration;\n return this.attach();\n }\n restart(): this {\n this._done = false;\n this.seek(0);\n return this.play();\n }\n /** Stop and detach for good. */\n kill(): void {\n this.pause();\n this.parent?.remove(this);\n }\n /** Promise-like: `await tween(...)`. */\n then<R>(ok?: (v: void) => R, err?: (e: unknown) => R): Promise<R> {\n return this.finished.then(ok, err);\n }\n\n private attach(): this {\n if (this.parent || this._off) return this;\n this._done = false;\n this._off = getTicker().add((_, dt) => this.advance(dt));\n return this;\n }\n private advance(dt: number): void {\n const td = this.totalDuration;\n this.seek(this._t + dt * this._dir * this.timeScale);\n if ((this._dir > 0 && this._t >= td) || (this._dir < 0 && this._t <= 0)) this.complete();\n }\n protected complete(): void {\n this.pause();\n if (this._done) return;\n this._done = true;\n this.onComplete?.();\n this._resolve();\n }\n}\n\ninterface Track { k: string; from?: Val; to: Val; fromRaw?: number | string; toRaw: number | string }\n\n/** A tween of one target. */\nexport class Tween extends Playable {\n readonly target: Target;\n private _dur: number;\n private ease: Ease;\n private tracks: Track[] | null = null;\n private toProps: Props;\n private fromProps: Props;\n constructor(target: Target, o: TweenOptions) {\n super(o);\n this.target = target;\n this._dur = o.duration ?? 600;\n this.ease = parseEase(o.ease);\n this.toProps = o.to || {};\n this.fromProps = o.from || {};\n }\n get duration(): number {\n return this._dur;\n }\n /** Capture start values (first render). */\n private init(): Track[] {\n const keys = Array.from(new Set([...Object.keys(this.fromProps), ...Object.keys(this.toProps)]));\n return keys.map((k) => {\n const fromRaw = k in this.fromProps ? this.fromProps[k] : readProp(this.target, k);\n const toRaw = k in this.toProps ? this.toProps[k] : readProp(this.target, k);\n return { k, fromRaw, toRaw, from: parseValue(fromRaw), to: parseValue(toRaw) };\n });\n }\n protected renderLocal(ms: number, ended: boolean): void {\n this.tracks ||= this.init();\n const p = this._dur ? (ended ? this.ease(ms >= this._dur ? 1 : 0) : this.ease(ms / this._dur)) : 1;\n let tr = false;\n for (const t of this.tracks) {\n writeProp(this.target, t.k, lerpVal(t.from!, t.to, p));\n if (TRANSFORM.includes(t.k)) tr = true;\n }\n if (tr && isEl(this.target)) writeTransform(this.target);\n }\n}\n\ntype Child = { item: Playable | (() => void); start: number; fired?: boolean };\n\n/** Position: ms number, '<' (start of previous), '>' (end of previous, default), '+=200' / '-=200' (relative to the end), 'label', 'label+=100', '<+=100'. */\nexport type Position = number | string;\n\nexport interface TimelineOptions extends PlayOptions {\n /** Defaults merged into every `.to()`. */\n defaults?: Omit<TweenOptions, 'to' | 'from'>;\n}\n\n/** A sequence of tweens, nested timelines and callbacks. */\nexport class Timeline extends Playable {\n private children: Child[] = [];\n private labels: Record<string, number> = {};\n private prevStart = 0;\n private prevEnd = 0;\n private defaults: TimelineOptions['defaults'];\n private lastLocal = 0;\n constructor(o: TimelineOptions = {}) {\n super(o);\n this.defaults = o.defaults;\n }\n get duration(): number {\n let d = 0;\n for (const c of this.children) d = Math.max(d, c.start + (typeof c.item === 'function' ? 0 : c.item.totalDuration));\n return d;\n }\n private resolve(pos: Position | undefined): number {\n if (pos === undefined || pos === '>') return this.prevEnd;\n if (typeof pos === 'number') return Math.max(0, pos);\n const m = /^([<>]|[\\w-]+)?\\s*(?:([+-])=\\s*([\\d.]+))?$/.exec(pos.trim());\n if (!m) throw new Error(`[motionary] bad timeline position \"${pos}\"`);\n let base = this.prevEnd;\n if (m[1] === '<') base = this.prevStart;\n else if (m[1] && m[1] !== '>') {\n if (!(m[1] in this.labels)) throw new Error(`[motionary] unknown timeline label \"${m[1]}\"`);\n base = this.labels[m[1]];\n }\n const off = m[2] ? (m[2] === '+' ? 1 : -1) * parseFloat(m[3]) : 0;\n return Math.max(0, base + off);\n }\n /** Add a tween, timeline or callback at a position. */\n add(item: Playable | (() => void), position?: Position): this {\n const start = this.resolve(position);\n if (typeof item !== 'function') {\n item.pause();\n item.parent = this;\n }\n this.children.push({ item, start });\n this.prevStart = start;\n this.prevEnd = start + (typeof item === 'function' ? 0 : item.totalDuration);\n return this;\n }\n /** `tween(target, vars)` placed at `position` (stagger across several targets). */\n to(target: Target | Target[] | ArrayLike<Target>, vars: TweenOptions, position?: Position): this {\n const list = toList(target);\n const start = this.resolve(position);\n let end = start;\n list.forEach((t, i) => {\n const tw = new Tween(t, { ...this.defaults, ...vars, delay: (vars.delay || 0) + (vars.stagger || 0) * i, paused: true });\n tw.parent = this;\n this.children.push({ item: tw, start });\n end = Math.max(end, start + tw.totalDuration);\n });\n this.prevStart = start;\n this.prevEnd = end;\n return this;\n }\n call(fn: () => void, position?: Position): this {\n return this.add(fn, position);\n }\n label(name: string, position?: Position): this {\n this.labels[name] = this.resolve(position);\n return this;\n }\n /** Time of a label, ms. */\n labelTime(name: string): number | undefined {\n return this.labels[name];\n }\n remove(item: Playable): void {\n this.children = this.children.filter((c) => c.item !== item);\n }\n /** Children in start order (callbacks excluded). */\n getChildren(): Playable[] {\n return this.children.filter((c) => typeof c.item !== 'function').map((c) => c.item as Playable);\n }\n protected renderLocal(ms: number): void {\n const forward = ms >= this.lastLocal;\n const list = [...this.children].sort((a, b) => (forward ? a.start - b.start : b.start - a.start));\n for (const c of list) {\n if (typeof c.item === 'function') {\n if (forward && !c.fired && ms >= c.start && this.lastLocal <= c.start) {\n c.fired = true;\n c.item();\n } else if (!forward && ms < c.start) c.fired = false;\n continue;\n }\n const local = ms - c.start;\n const p = c.item as Playable & { _started?: boolean };\n if (local < 0) {\n if (p._started) p.seek(0);\n continue;\n }\n p._started = true;\n p.seek(Math.min(local, p.totalDuration));\n }\n this.lastLocal = ms;\n }\n}\n\nfunction toList(t: Target | Target[] | ArrayLike<Target>): Target[] {\n if (Array.isArray(t)) return t;\n if (t && typeof (t as ArrayLike<Target>).length === 'number' && !isEl(t)) return Array.from(t as ArrayLike<Target>);\n return [t as Target];\n}\n\n/**\n * Tween one or more targets. Returns a `Tween` (or a `Timeline` holding one\n * tween per target when several are given) that starts on the next frame\n * unless `paused`. `await` it for completion.\n */\nexport function tween(target: Target | Target[] | ArrayLike<Target>, o: TweenOptions): Playable {\n const list = toList(target);\n let p: Playable;\n if (list.length === 1) p = new Tween(list[0], o);\n else {\n const tl = new Timeline({ repeat: o.repeat, yoyo: o.yoyo, onUpdate: o.onUpdate, onComplete: o.onComplete, delay: o.delay });\n tl.to(list, { ...o, delay: 0, repeat: 0, yoyo: false, onUpdate: undefined, onComplete: undefined }, 0);\n p = tl;\n }\n if (!o.paused) p.play();\n return p;\n}\n\n/** A new timeline (plays on the next frame unless `paused`). */\nexport function timeline(o: TimelineOptions = {}): Timeline {\n const tl = new Timeline(o);\n if (!o.paused) tl.play();\n return tl;\n}\n"],"names":[],"mappings":";;AAGA,MAAM,GAAG,GAAG,CAAC,CAAO,KAAW,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,KAAK,GAAG,CAAC,CAAO,KAAW,CAAC,CAAC,MAAM,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;AACzF,MAAM,GAAG,GAAG,CAAC,CAAS,KAAW,CAAC,CAAC,KAAK,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;AACtD,M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