@g4rcez/components 3.0.0 → 3.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (303) hide show
  1. package/dist/MotionConfigContext-C7MqlSdv.js +2713 -0
  2. package/dist/MotionConfigContext-C7MqlSdv.js.map +1 -0
  3. package/dist/ai/SKILL.md +266 -0
  4. package/dist/ai/docs/Alert.md +167 -0
  5. package/dist/ai/docs/AnimatedList.md +205 -0
  6. package/dist/ai/docs/Autocomplete.md +225 -0
  7. package/dist/ai/docs/Button.md +182 -0
  8. package/dist/ai/docs/Calendar.md +219 -0
  9. package/dist/ai/docs/Card.md +174 -0
  10. package/dist/ai/docs/Checkbox.md +199 -0
  11. package/dist/ai/docs/CommandPalette.md +293 -0
  12. package/dist/ai/docs/DatePicker.md +171 -0
  13. package/dist/ai/docs/Dropdown.md +223 -0
  14. package/dist/ai/docs/Empty.md +163 -0
  15. package/dist/ai/docs/Expand.md +143 -0
  16. package/dist/ai/docs/FileUpload.md +225 -0
  17. package/dist/ai/docs/Form.md +107 -0
  18. package/dist/ai/docs/FormReset.md +117 -0
  19. package/dist/ai/docs/Heading.md +88 -0
  20. package/dist/ai/docs/Input.md +237 -0
  21. package/dist/ai/docs/InputField.md +170 -0
  22. package/dist/ai/docs/List.md +205 -0
  23. package/dist/ai/docs/Menu.md +166 -0
  24. package/dist/ai/docs/Modal.md +280 -0
  25. package/dist/ai/docs/MultiSelect.md +196 -0
  26. package/dist/ai/docs/Notifications.md +231 -0
  27. package/dist/ai/docs/PageCalendar.md +271 -0
  28. package/dist/ai/docs/Polymorph.md +159 -0
  29. package/dist/ai/docs/Progress.md +145 -0
  30. package/dist/ai/docs/Radiobox.md +128 -0
  31. package/dist/ai/docs/RenderOnView.md +138 -0
  32. package/dist/ai/docs/Resizable.md +159 -0
  33. package/dist/ai/docs/Select.md +284 -0
  34. package/dist/ai/docs/Shortcut.md +105 -0
  35. package/dist/ai/docs/Skeleton.md +166 -0
  36. package/dist/ai/docs/Slider.md +144 -0
  37. package/dist/ai/docs/Slot.md +173 -0
  38. package/dist/ai/docs/Spinner.md +118 -0
  39. package/dist/ai/docs/Stats.md +137 -0
  40. package/dist/ai/docs/Step.md +159 -0
  41. package/dist/ai/docs/Switch.md +167 -0
  42. package/dist/ai/docs/Table.md +298 -0
  43. package/dist/ai/docs/Tabs.md +191 -0
  44. package/dist/ai/docs/Tag.md +224 -0
  45. package/dist/ai/docs/TaskList.md +144 -0
  46. package/dist/ai/docs/Textarea.md +167 -0
  47. package/dist/ai/docs/Timeline.md +210 -0
  48. package/dist/ai/docs/Toolbar.md +132 -0
  49. package/dist/ai/docs/Tooltip.md +231 -0
  50. package/dist/ai/docs/TransferList.md +142 -0
  51. package/dist/ai/docs/Typography.md +187 -0
  52. package/dist/ai/docs/Wizard.md +213 -0
  53. package/dist/ai/docs/index.md +183 -0
  54. package/dist/autocomplete-Boida9R7.js +375 -0
  55. package/dist/autocomplete-Boida9R7.js.map +1 -0
  56. package/dist/calendar-BswV66Nx.js +1719 -0
  57. package/dist/calendar-BswV66Nx.js.map +1 -0
  58. package/dist/chevron-down-BBFYYzZq.js +6 -0
  59. package/dist/chevron-down-BBFYYzZq.js.map +1 -0
  60. package/dist/chevron-right-DvXGOiS_.js +6 -0
  61. package/dist/chevron-right-DvXGOiS_.js.map +1 -0
  62. package/dist/circle-check-big-3M5lhTxx.js +9 -0
  63. package/dist/circle-check-big-3M5lhTxx.js.map +1 -0
  64. package/dist/components/core/button.js +76 -0
  65. package/dist/components/core/button.js.map +1 -0
  66. package/dist/components/core/tag.d.ts +1 -1
  67. package/dist/components/core/tag.d.ts.map +1 -1
  68. package/dist/components/core/tag.js +67 -0
  69. package/dist/components/core/tag.js.map +1 -0
  70. package/dist/components/display/alert.js +94 -0
  71. package/dist/components/display/alert.js.map +1 -0
  72. package/dist/components/display/calendar.js +15 -0
  73. package/dist/components/display/calendar.js.map +1 -0
  74. package/dist/components/display/card.js +84 -0
  75. package/dist/components/display/card.js.map +1 -0
  76. package/dist/components/display/list.d.ts.map +1 -1
  77. package/dist/components/display/list.js +93 -0
  78. package/dist/components/display/list.js.map +1 -0
  79. package/dist/components/display/notifications.js +15 -0
  80. package/dist/components/display/notifications.js.map +1 -0
  81. package/dist/components/display/stats.js +16 -0
  82. package/dist/components/display/stats.js.map +1 -0
  83. package/dist/components/display/tabs.js +12 -0
  84. package/dist/components/display/tabs.js.map +1 -0
  85. package/dist/components/display/timeline.js +29 -0
  86. package/dist/components/display/timeline.js.map +1 -0
  87. package/dist/components/floating/dropdown.d.ts +1 -0
  88. package/dist/components/floating/dropdown.d.ts.map +1 -1
  89. package/dist/components/floating/dropdown.js +58 -0
  90. package/dist/components/floating/dropdown.js.map +1 -0
  91. package/dist/components/floating/expand.js +41 -0
  92. package/dist/components/floating/expand.js.map +1 -0
  93. package/dist/components/floating/menu.d.ts.map +1 -1
  94. package/dist/components/floating/menu.js +177 -0
  95. package/dist/components/floating/menu.js.map +1 -0
  96. package/dist/components/floating/modal.js +297 -0
  97. package/dist/components/floating/modal.js.map +1 -0
  98. package/dist/components/floating/tooltip.js +73 -0
  99. package/dist/components/floating/tooltip.js.map +1 -0
  100. package/dist/components/form/autocomplete.js +16 -0
  101. package/dist/components/form/autocomplete.js.map +1 -0
  102. package/dist/components/form/checkbox.js +44 -0
  103. package/dist/components/form/checkbox.js.map +1 -0
  104. package/dist/components/form/date-picker.js +12 -0
  105. package/dist/components/form/date-picker.js.map +1 -0
  106. package/dist/components/form/file-upload.js +11 -0
  107. package/dist/components/form/file-upload.js.map +1 -0
  108. package/dist/components/form/form.js +8 -0
  109. package/dist/components/form/form.js.map +1 -0
  110. package/dist/components/form/input.js +5 -0
  111. package/dist/components/form/input.js.map +1 -0
  112. package/dist/components/form/radiobox.js +30 -0
  113. package/dist/components/form/radiobox.js.map +1 -0
  114. package/dist/components/form/select.js +106 -0
  115. package/dist/components/form/select.js.map +1 -0
  116. package/dist/components/form/switch.js +65 -0
  117. package/dist/components/form/switch.js.map +1 -0
  118. package/dist/components/form/task-list.js +68 -0
  119. package/dist/components/form/task-list.js.map +1 -0
  120. package/dist/components/form/transfer-list.js +55 -0
  121. package/dist/components/form/transfer-list.js.map +1 -0
  122. package/dist/components/table/table.js +10 -0
  123. package/dist/components/table/table.js.map +1 -0
  124. package/dist/config/default-translations.d.ts +4 -4
  125. package/dist/constants-r-AHn273.js +6 -0
  126. package/dist/constants-r-AHn273.js.map +1 -0
  127. package/dist/context-BFXNJVn2.js +161 -0
  128. package/dist/context-BFXNJVn2.js.map +1 -0
  129. package/dist/createLucideIcon-CP-mMPfa.js +76 -0
  130. package/dist/createLucideIcon-CP-mMPfa.js.map +1 -0
  131. package/dist/date-picker-BxPTdZPy.js +1598 -0
  132. package/dist/date-picker-BxPTdZPy.js.map +1 -0
  133. package/dist/dom-Dl8XH0CK.js +2833 -0
  134. package/dist/dom-Dl8XH0CK.js.map +1 -0
  135. package/dist/file-CBCP85VI.js +15 -0
  136. package/dist/file-CBCP85VI.js.map +1 -0
  137. package/dist/file-upload-BB6BdGcE.js +3118 -0
  138. package/dist/file-upload-BB6BdGcE.js.map +1 -0
  139. package/dist/floating-ui.react-DycKASR0.js +3706 -0
  140. package/dist/floating-ui.react-DycKASR0.js.map +1 -0
  141. package/dist/fns-D2eyJKd5.js +33 -0
  142. package/dist/fns-D2eyJKd5.js.map +1 -0
  143. package/dist/hooks/use-translations.d.ts +4 -4
  144. package/dist/hooks/use-translations.d.ts.map +1 -1
  145. package/dist/index-0YMC-_Lt.js +20 -0
  146. package/dist/index-0YMC-_Lt.js.map +1 -0
  147. package/dist/index-BJ1ayTam.js +126 -0
  148. package/dist/index-BJ1ayTam.js.map +1 -0
  149. package/dist/index-BtlhELJ3.js +3416 -0
  150. package/dist/index-BtlhELJ3.js.map +1 -0
  151. package/dist/index-ChfR6F8d.js +1590 -0
  152. package/dist/index-ChfR6F8d.js.map +1 -0
  153. package/dist/index-DE4shK8D.js +215 -0
  154. package/dist/index-DE4shK8D.js.map +1 -0
  155. package/dist/index-DJSMaZR4.js +35 -0
  156. package/dist/index-DJSMaZR4.js.map +1 -0
  157. package/dist/index-t1qLJTt5.js +351 -0
  158. package/dist/index-t1qLJTt5.js.map +1 -0
  159. package/dist/index.css +1 -1
  160. package/dist/index.esm-BaIwleSE.js +343 -0
  161. package/dist/index.esm-BaIwleSE.js.map +1 -0
  162. package/dist/index.js +8050 -20
  163. package/dist/index.js.map +1 -1
  164. package/dist/info-N5jWZg2A.js +10 -0
  165. package/dist/info-N5jWZg2A.js.map +1 -0
  166. package/dist/input-CoJoHIhd.js +441 -0
  167. package/dist/input-CoJoHIhd.js.map +1 -0
  168. package/dist/input-field-DTeIrwpK.js +146 -0
  169. package/dist/input-field-DTeIrwpK.js.map +1 -0
  170. package/dist/notifications-NPuFDsBp.js +2550 -0
  171. package/dist/notifications-NPuFDsBp.js.map +1 -0
  172. package/dist/polymorph-B5n9fs_K.js +10 -0
  173. package/dist/polymorph-B5n9fs_K.js.map +1 -0
  174. package/dist/proxy-BZcQiBrp.js +2495 -0
  175. package/dist/proxy-BZcQiBrp.js.map +1 -0
  176. package/dist/skeleton-D75GFBV6.js +10 -0
  177. package/dist/skeleton-D75GFBV6.js.map +1 -0
  178. package/dist/slot-CQW8ZzBb.js +79 -0
  179. package/dist/slot-CQW8ZzBb.js.map +1 -0
  180. package/dist/styles/common.js +3 -3
  181. package/dist/styles/dark.js +4 -4
  182. package/dist/styles/design-tokens.js +89 -60
  183. package/dist/styles/light.js +4 -4
  184. package/dist/styles/theme.js +2 -2
  185. package/dist/tabs-ccIA7vMo.js +106 -0
  186. package/dist/tabs-ccIA7vMo.js.map +1 -0
  187. package/dist/triangle-alert-CHMhQ6yd.js +16 -0
  188. package/dist/triangle-alert-CHMhQ6yd.js.map +1 -0
  189. package/dist/use-motion-value-eGwNuWuw.js +14 -0
  190. package/dist/use-motion-value-eGwNuWuw.js.map +1 -0
  191. package/dist/use-stable-ref-CYh-YkID.js +11 -0
  192. package/dist/use-stable-ref-CYh-YkID.js.map +1 -0
  193. package/dist/use-translations-BwLKTrZv.js +10 -0
  194. package/dist/use-translations-BwLKTrZv.js.map +1 -0
  195. package/dist/x-B9bYxG31.js +9 -0
  196. package/dist/x-B9bYxG31.js.map +1 -0
  197. package/package.json +6 -7
  198. package/dist/components/core/button.jsx +0 -79
  199. package/dist/components/core/heading.jsx +0 -4
  200. package/dist/components/core/polymorph.jsx +0 -5
  201. package/dist/components/core/render-on-view.jsx +0 -31
  202. package/dist/components/core/resizable.jsx +0 -51
  203. package/dist/components/core/slot.jsx +0 -156
  204. package/dist/components/core/tag.jsx +0 -51
  205. package/dist/components/core/typography.jsx +0 -22
  206. package/dist/components/display/alert.jsx +0 -58
  207. package/dist/components/display/calendar.jsx +0 -299
  208. package/dist/components/display/card.jsx +0 -43
  209. package/dist/components/display/empty.jsx +0 -11
  210. package/dist/components/display/list.jsx +0 -81
  211. package/dist/components/display/notifications.jsx +0 -126
  212. package/dist/components/display/progress.jsx +0 -11
  213. package/dist/components/display/shortcut.jsx +0 -23
  214. package/dist/components/display/skeleton.jsx +0 -12
  215. package/dist/components/display/spinner.jsx +0 -7
  216. package/dist/components/display/stats.jsx +0 -20
  217. package/dist/components/display/step.jsx +0 -131
  218. package/dist/components/display/tabs.jsx +0 -98
  219. package/dist/components/display/timeline.jsx +0 -25
  220. package/dist/components/floating/command-palette.jsx +0 -194
  221. package/dist/components/floating/dropdown.jsx +0 -53
  222. package/dist/components/floating/expand.jsx +0 -44
  223. package/dist/components/floating/menu.jsx +0 -147
  224. package/dist/components/floating/modal.jsx +0 -299
  225. package/dist/components/floating/toolbar.jsx +0 -5
  226. package/dist/components/floating/tooltip.jsx +0 -58
  227. package/dist/components/floating/wizard.jsx +0 -161
  228. package/dist/components/form/autocomplete.jsx +0 -279
  229. package/dist/components/form/checkbox.jsx +0 -12
  230. package/dist/components/form/date-picker.jsx +0 -115
  231. package/dist/components/form/file-upload.jsx +0 -133
  232. package/dist/components/form/form.jsx +0 -10
  233. package/dist/components/form/formReset.jsx +0 -17
  234. package/dist/components/form/free-text.jsx +0 -41
  235. package/dist/components/form/input-field.jsx +0 -56
  236. package/dist/components/form/input.jsx +0 -36
  237. package/dist/components/form/multi-select.jsx +0 -328
  238. package/dist/components/form/radiobox.jsx +0 -6
  239. package/dist/components/form/select.jsx +0 -42
  240. package/dist/components/form/slider.jsx +0 -45
  241. package/dist/components/form/switch.jsx +0 -46
  242. package/dist/components/form/task-list.jsx +0 -26
  243. package/dist/components/form/textarea.jsx +0 -12
  244. package/dist/components/form/transfer-list.jsx +0 -39
  245. package/dist/components/index.js +0 -45
  246. package/dist/components/page-calendar/calendar-header.jsx +0 -81
  247. package/dist/components/page-calendar/day-view.jsx +0 -87
  248. package/dist/components/page-calendar/event-pill.jsx +0 -25
  249. package/dist/components/page-calendar/index.js +0 -2
  250. package/dist/components/page-calendar/month-view.jsx +0 -47
  251. package/dist/components/page-calendar/page-calendar.jsx +0 -41
  252. package/dist/components/page-calendar/page-calendar.types.js +0 -1
  253. package/dist/components/page-calendar/page-calendar.utils.js +0 -71
  254. package/dist/components/page-calendar/week-view.jsx +0 -64
  255. package/dist/components/table/filter.jsx +0 -141
  256. package/dist/components/table/group.jsx +0 -68
  257. package/dist/components/table/index.jsx +0 -60
  258. package/dist/components/table/inner-table.jsx +0 -104
  259. package/dist/components/table/metadata.jsx +0 -36
  260. package/dist/components/table/pagination.jsx +0 -73
  261. package/dist/components/table/row.jsx +0 -58
  262. package/dist/components/table/sort.jsx +0 -105
  263. package/dist/components/table/table-lib.js +0 -83
  264. package/dist/components/table/table.context.jsx +0 -4
  265. package/dist/components/table/thead.jsx +0 -103
  266. package/dist/config/context.js +0 -12
  267. package/dist/config/default-translations.jsx +0 -83
  268. package/dist/config/default-tweaks.js +0 -4
  269. package/dist/constants.js +0 -2
  270. package/dist/hooks/use-click-outside.js +0 -17
  271. package/dist/hooks/use-color-parser.js +0 -9
  272. package/dist/hooks/use-components-provider.jsx +0 -19
  273. package/dist/hooks/use-debounce.js +0 -12
  274. package/dist/hooks/use-floating-ref.js +0 -6
  275. package/dist/hooks/use-form.js +0 -550
  276. package/dist/hooks/use-hover.js +0 -18
  277. package/dist/hooks/use-input-id.js +0 -5
  278. package/dist/hooks/use-is-coarse-device.js +0 -12
  279. package/dist/hooks/use-locale.js +0 -10
  280. package/dist/hooks/use-media-query.js +0 -25
  281. package/dist/hooks/use-on-event.js +0 -7
  282. package/dist/hooks/use-parent.js +0 -21
  283. package/dist/hooks/use-preferences.js +0 -23
  284. package/dist/hooks/use-previous.js +0 -9
  285. package/dist/hooks/use-reactive.js +0 -9
  286. package/dist/hooks/use-remove-scroll.js +0 -61
  287. package/dist/hooks/use-resize-observer.js +0 -17
  288. package/dist/hooks/use-stable-ref.js +0 -9
  289. package/dist/hooks/use-swipe.js +0 -17
  290. package/dist/hooks/use-translations.js +0 -9
  291. package/dist/hooks/use-tweaks.js +0 -9
  292. package/dist/hooks/use-window-size.js +0 -14
  293. package/dist/index.mjs +0 -37103
  294. package/dist/index.mjs.map +0 -1
  295. package/dist/index.umd.js +0 -28
  296. package/dist/index.umd.js.map +0 -1
  297. package/dist/lib/combi-keys.js +0 -60
  298. package/dist/lib/dict.js +0 -39
  299. package/dist/lib/dom.js +0 -62
  300. package/dist/lib/fns.js +0 -46
  301. package/dist/lib/fzf.js +0 -117
  302. package/dist/lib/keyboard-area.js +0 -14
  303. package/dist/types.js +0 -1
@@ -0,0 +1,2713 @@
1
+ import { useRef as On, createContext as Nn } from "react";
2
+ function Fr(t) {
3
+ const e = On(null);
4
+ return e.current === null && (e.current = t()), e.current;
5
+ }
6
+ function In(t, e) {
7
+ t.indexOf(e) === -1 && t.push(e);
8
+ }
9
+ function Kn(t, e) {
10
+ const n = t.indexOf(e);
11
+ n > -1 && t.splice(n, 1);
12
+ }
13
+ function Rr([...t], e, n) {
14
+ const s = e < 0 ? t.length + e : e;
15
+ if (s >= 0 && s < t.length) {
16
+ const i = n < 0 ? t.length + n : n, [r] = t.splice(e, 1);
17
+ t.splice(i, 0, r);
18
+ }
19
+ return t;
20
+ }
21
+ const $ = (t, e, n) => n > e ? e : n < t ? t : n;
22
+ function vt(t, e) {
23
+ return e ? `${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}` : t;
24
+ }
25
+ let it = () => {
26
+ }, j = () => {
27
+ };
28
+ typeof process < "u" && process.env?.NODE_ENV !== "production" && (it = (t, e, n) => {
29
+ !t && typeof console < "u" && console.warn(vt(e, n));
30
+ }, j = (t, e, n) => {
31
+ if (!t)
32
+ throw new Error(vt(e, n));
33
+ });
34
+ const O = {}, Pe = (t) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);
35
+ function $n(t) {
36
+ return typeof t == "object" && t !== null;
37
+ }
38
+ const Ee = (t) => /^0[^.\s]+$/u.test(t);
39
+ // @__NO_SIDE_EFFECTS__
40
+ function ke(t) {
41
+ let e;
42
+ return () => (e === void 0 && (e = t()), e);
43
+ }
44
+ const X = /* @__NO_SIDE_EFFECTS__ */ (t) => t, Ln = (t, e) => (n) => e(t(n)), $t = (...t) => t.reduce(Ln), Be = /* @__NO_SIDE_EFFECTS__ */ (t, e, n) => {
45
+ const s = e - t;
46
+ return s === 0 ? 1 : (n - t) / s;
47
+ };
48
+ class Oe {
49
+ constructor() {
50
+ this.subscriptions = [];
51
+ }
52
+ add(e) {
53
+ return In(this.subscriptions, e), () => Kn(this.subscriptions, e);
54
+ }
55
+ notify(e, n, s) {
56
+ const i = this.subscriptions.length;
57
+ if (i)
58
+ if (i === 1)
59
+ this.subscriptions[0](e, n, s);
60
+ else
61
+ for (let r = 0; r < i; r++) {
62
+ const a = this.subscriptions[r];
63
+ a && a(e, n, s);
64
+ }
65
+ }
66
+ getSize() {
67
+ return this.subscriptions.length;
68
+ }
69
+ clear() {
70
+ this.subscriptions.length = 0;
71
+ }
72
+ }
73
+ const k = /* @__NO_SIDE_EFFECTS__ */ (t) => t * 1e3, P = /* @__NO_SIDE_EFFECTS__ */ (t) => t / 1e3;
74
+ function Ne(t, e) {
75
+ return e ? t * (1e3 / e) : 0;
76
+ }
77
+ const Qt = /* @__PURE__ */ new Set();
78
+ function Ie(t, e, n) {
79
+ t || Qt.has(e) || (console.warn(vt(e, n)), Qt.add(e));
80
+ }
81
+ const Ke = (t, e, n) => (((1 - 3 * n + 3 * e) * t + (3 * n - 6 * e)) * t + 3 * e) * t, _n = 1e-7, Wn = 12;
82
+ function jn(t, e, n, s, i) {
83
+ let r, a, o = 0;
84
+ do
85
+ a = e + (n - e) / 2, r = Ke(a, s, i) - t, r > 0 ? n = a : e = a;
86
+ while (Math.abs(r) > _n && ++o < Wn);
87
+ return a;
88
+ }
89
+ function rt(t, e, n, s) {
90
+ if (t === e && n === s)
91
+ return X;
92
+ const i = (r) => jn(r, 0, 1, t, n);
93
+ return (r) => r === 0 || r === 1 ? r : Ke(i(r), e, s);
94
+ }
95
+ const $e = (t) => (e) => e <= 0.5 ? t(2 * e) / 2 : (2 - t(2 * (1 - e))) / 2, Le = (t) => (e) => 1 - t(1 - e), _e = /* @__PURE__ */ rt(0.33, 1.53, 0.69, 0.99), Lt = /* @__PURE__ */ Le(_e), We = /* @__PURE__ */ $e(Lt), je = (t) => (t *= 2) < 1 ? 0.5 * Lt(t) : 0.5 * (2 - Math.pow(2, -10 * (t - 1))), _t = (t) => 1 - Math.sin(Math.acos(t)), Un = Le(_t), Ue = $e(_t), Yn = /* @__PURE__ */ rt(0.42, 0, 1, 1), Gn = /* @__PURE__ */ rt(0, 0, 0.58, 1), Ye = /* @__PURE__ */ rt(0.42, 0, 0.58, 1), Xn = (t) => Array.isArray(t) && typeof t[0] != "number", Ge = (t) => Array.isArray(t) && typeof t[0] == "number", te = {
96
+ linear: X,
97
+ easeIn: Yn,
98
+ easeInOut: Ye,
99
+ easeOut: Gn,
100
+ circIn: _t,
101
+ circInOut: Ue,
102
+ circOut: Un,
103
+ backIn: Lt,
104
+ backInOut: We,
105
+ backOut: _e,
106
+ anticipate: je
107
+ }, zn = (t) => typeof t == "string", ee = (t) => {
108
+ if (Ge(t)) {
109
+ j(t.length === 4, "Cubic bezier arrays must contain four numerical values.", "cubic-bezier-length");
110
+ const [e, n, s, i] = t;
111
+ return rt(e, n, s, i);
112
+ } else if (zn(t))
113
+ return j(te[t] !== void 0, `Invalid easing type '${t}'`, "invalid-easing-type"), te[t];
114
+ return t;
115
+ }, ot = [
116
+ "setup",
117
+ // Compute
118
+ "read",
119
+ // Read
120
+ "resolveKeyframes",
121
+ // Write/Read/Write/Read
122
+ "preUpdate",
123
+ // Compute
124
+ "update",
125
+ // Compute
126
+ "preRender",
127
+ // Compute
128
+ "render",
129
+ // Write
130
+ "postRender"
131
+ // Compute
132
+ ];
133
+ function qn(t, e) {
134
+ let n = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set(), i = !1, r = !1;
135
+ const a = /* @__PURE__ */ new WeakSet();
136
+ let o = {
137
+ delta: 0,
138
+ timestamp: 0,
139
+ isProcessing: !1
140
+ };
141
+ function u(l) {
142
+ a.has(l) && (c.schedule(l), t()), l(o);
143
+ }
144
+ const c = {
145
+ /**
146
+ * Schedule a process to run on the next frame.
147
+ */
148
+ schedule: (l, f = !1, h = !1) => {
149
+ const T = h && i ? n : s;
150
+ return f && a.add(l), T.has(l) || T.add(l), l;
151
+ },
152
+ /**
153
+ * Cancel the provided callback from running on the next frame.
154
+ */
155
+ cancel: (l) => {
156
+ s.delete(l), a.delete(l);
157
+ },
158
+ /**
159
+ * Execute all schedule callbacks.
160
+ */
161
+ process: (l) => {
162
+ if (o = l, i) {
163
+ r = !0;
164
+ return;
165
+ }
166
+ i = !0, [n, s] = [s, n], n.forEach(u), n.clear(), i = !1, r && (r = !1, c.process(l));
167
+ }
168
+ };
169
+ return c;
170
+ }
171
+ const Zn = 40;
172
+ function Xe(t, e) {
173
+ let n = !1, s = !0;
174
+ const i = {
175
+ delta: 0,
176
+ timestamp: 0,
177
+ isProcessing: !1
178
+ }, r = () => n = !0, a = ot.reduce((b, M) => (b[M] = qn(r), b), {}), { setup: o, read: u, resolveKeyframes: c, preUpdate: l, update: f, preRender: h, render: m, postRender: T } = a, g = () => {
179
+ const b = O.useManualTiming ? i.timestamp : performance.now();
180
+ n = !1, O.useManualTiming || (i.delta = s ? 1e3 / 60 : Math.max(Math.min(b - i.timestamp, Zn), 1)), i.timestamp = b, i.isProcessing = !0, o.process(i), u.process(i), c.process(i), l.process(i), f.process(i), h.process(i), m.process(i), T.process(i), i.isProcessing = !1, n && e && (s = !1, t(g));
181
+ }, v = () => {
182
+ n = !0, s = !0, i.isProcessing || t(g);
183
+ };
184
+ return { schedule: ot.reduce((b, M) => {
185
+ const p = a[M];
186
+ return b[M] = (S, A = !1, y = !1) => (n || v(), p.schedule(S, A, y)), b;
187
+ }, {}), cancel: (b) => {
188
+ for (let M = 0; M < ot.length; M++)
189
+ a[ot[M]].cancel(b);
190
+ }, state: i, steps: a };
191
+ }
192
+ const { schedule: N, cancel: xt, state: ct, steps: Pr } = /* @__PURE__ */ Xe(typeof requestAnimationFrame < "u" ? requestAnimationFrame : X, !0);
193
+ let ut;
194
+ function Hn() {
195
+ ut = void 0;
196
+ }
197
+ const C = {
198
+ now: () => (ut === void 0 && C.set(ct.isProcessing || O.useManualTiming ? ct.timestamp : performance.now()), ut),
199
+ set: (t) => {
200
+ ut = t, queueMicrotask(Hn);
201
+ }
202
+ }, ze = (t) => (e) => typeof e == "string" && e.startsWith(t), qe = /* @__PURE__ */ ze("--"), Jn = /* @__PURE__ */ ze("var(--"), Wt = (t) => Jn(t) ? Qn.test(t.split("/*")[0].trim()) : !1, Qn = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;
203
+ function ne(t) {
204
+ return typeof t != "string" ? !1 : t.split("/*")[0].includes("var(--");
205
+ }
206
+ const z = {
207
+ test: (t) => typeof t == "number",
208
+ parse: parseFloat,
209
+ transform: (t) => t
210
+ }, et = {
211
+ ...z,
212
+ transform: (t) => $(0, 1, t)
213
+ }, lt = {
214
+ ...z,
215
+ default: 1
216
+ }, tt = (t) => Math.round(t * 1e5) / 1e5, jt = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu;
217
+ function ts(t) {
218
+ return t == null;
219
+ }
220
+ const es = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu, Ut = (t, e) => (n) => !!(typeof n == "string" && es.test(n) && n.startsWith(t) || e && !ts(n) && Object.prototype.hasOwnProperty.call(n, e)), Ze = (t, e, n) => (s) => {
221
+ if (typeof s != "string")
222
+ return s;
223
+ const [i, r, a, o] = s.match(jt);
224
+ return {
225
+ [t]: parseFloat(i),
226
+ [e]: parseFloat(r),
227
+ [n]: parseFloat(a),
228
+ alpha: o !== void 0 ? parseFloat(o) : 1
229
+ };
230
+ }, ns = (t) => $(0, 255, t), mt = {
231
+ ...z,
232
+ transform: (t) => Math.round(ns(t))
233
+ }, L = {
234
+ test: /* @__PURE__ */ Ut("rgb", "red"),
235
+ parse: /* @__PURE__ */ Ze("red", "green", "blue"),
236
+ transform: ({ red: t, green: e, blue: n, alpha: s = 1 }) => "rgba(" + mt.transform(t) + ", " + mt.transform(e) + ", " + mt.transform(n) + ", " + tt(et.transform(s)) + ")"
237
+ };
238
+ function ss(t) {
239
+ let e = "", n = "", s = "", i = "";
240
+ return t.length > 5 ? (e = t.substring(1, 3), n = t.substring(3, 5), s = t.substring(5, 7), i = t.substring(7, 9)) : (e = t.substring(1, 2), n = t.substring(2, 3), s = t.substring(3, 4), i = t.substring(4, 5), e += e, n += n, s += s, i += i), {
241
+ red: parseInt(e, 16),
242
+ green: parseInt(n, 16),
243
+ blue: parseInt(s, 16),
244
+ alpha: i ? parseInt(i, 16) / 255 : 1
245
+ };
246
+ }
247
+ const Mt = {
248
+ test: /* @__PURE__ */ Ut("#"),
249
+ parse: ss,
250
+ transform: L.transform
251
+ }, at = /* @__NO_SIDE_EFFECTS__ */ (t) => ({
252
+ test: (e) => typeof e == "string" && e.endsWith(t) && e.split(" ").length === 1,
253
+ parse: parseFloat,
254
+ transform: (e) => `${e}${t}`
255
+ }), I = /* @__PURE__ */ at("deg"), G = /* @__PURE__ */ at("%"), d = /* @__PURE__ */ at("px"), is = /* @__PURE__ */ at("vh"), rs = /* @__PURE__ */ at("vw"), se = {
256
+ ...G,
257
+ parse: (t) => G.parse(t) / 100,
258
+ transform: (t) => G.transform(t * 100)
259
+ }, U = {
260
+ test: /* @__PURE__ */ Ut("hsl", "hue"),
261
+ parse: /* @__PURE__ */ Ze("hue", "saturation", "lightness"),
262
+ transform: ({ hue: t, saturation: e, lightness: n, alpha: s = 1 }) => "hsla(" + Math.round(t) + ", " + G.transform(tt(e)) + ", " + G.transform(tt(n)) + ", " + tt(et.transform(s)) + ")"
263
+ }, w = {
264
+ test: (t) => L.test(t) || Mt.test(t) || U.test(t),
265
+ parse: (t) => L.test(t) ? L.parse(t) : U.test(t) ? U.parse(t) : Mt.parse(t),
266
+ transform: (t) => typeof t == "string" ? t : t.hasOwnProperty("red") ? L.transform(t) : U.transform(t),
267
+ getAnimatableNone: (t) => {
268
+ const e = w.parse(t);
269
+ return e.alpha = 0, w.transform(e);
270
+ }
271
+ }, as = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;
272
+ function os(t) {
273
+ return isNaN(t) && typeof t == "string" && (t.match(jt)?.length || 0) + (t.match(as)?.length || 0) > 0;
274
+ }
275
+ const He = "number", Je = "color", ls = "var", us = "var(", ie = "${}", cs = /var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;
276
+ function nt(t) {
277
+ const e = t.toString(), n = [], s = {
278
+ color: [],
279
+ number: [],
280
+ var: []
281
+ }, i = [];
282
+ let r = 0;
283
+ const o = e.replace(cs, (u) => (w.test(u) ? (s.color.push(r), i.push(Je), n.push(w.parse(u))) : u.startsWith(us) ? (s.var.push(r), i.push(ls), n.push(u)) : (s.number.push(r), i.push(He), n.push(parseFloat(u))), ++r, ie)).split(ie);
284
+ return { values: n, split: o, indexes: s, types: i };
285
+ }
286
+ function Qe(t) {
287
+ return nt(t).values;
288
+ }
289
+ function tn(t) {
290
+ const { split: e, types: n } = nt(t), s = e.length;
291
+ return (i) => {
292
+ let r = "";
293
+ for (let a = 0; a < s; a++)
294
+ if (r += e[a], i[a] !== void 0) {
295
+ const o = n[a];
296
+ o === He ? r += tt(i[a]) : o === Je ? r += w.transform(i[a]) : r += i[a];
297
+ }
298
+ return r;
299
+ };
300
+ }
301
+ const fs = (t) => typeof t == "number" ? 0 : w.test(t) ? w.getAnimatableNone(t) : t;
302
+ function hs(t) {
303
+ const e = Qe(t);
304
+ return tn(t)(e.map(fs));
305
+ }
306
+ const E = {
307
+ test: os,
308
+ parse: Qe,
309
+ createTransformer: tn,
310
+ getAnimatableNone: hs
311
+ };
312
+ function gt(t, e, n) {
313
+ return n < 0 && (n += 1), n > 1 && (n -= 1), n < 1 / 6 ? t + (e - t) * 6 * n : n < 1 / 2 ? e : n < 2 / 3 ? t + (e - t) * (2 / 3 - n) * 6 : t;
314
+ }
315
+ function ds({ hue: t, saturation: e, lightness: n, alpha: s }) {
316
+ t /= 360, e /= 100, n /= 100;
317
+ let i = 0, r = 0, a = 0;
318
+ if (!e)
319
+ i = r = a = n;
320
+ else {
321
+ const o = n < 0.5 ? n * (1 + e) : n + e - n * e, u = 2 * n - o;
322
+ i = gt(u, o, t + 1 / 3), r = gt(u, o, t), a = gt(u, o, t - 1 / 3);
323
+ }
324
+ return {
325
+ red: Math.round(i * 255),
326
+ green: Math.round(r * 255),
327
+ blue: Math.round(a * 255),
328
+ alpha: s
329
+ };
330
+ }
331
+ function ft(t, e) {
332
+ return (n) => n > 0 ? e : t;
333
+ }
334
+ const q = (t, e, n) => t + (e - t) * n, yt = (t, e, n) => {
335
+ const s = t * t, i = n * (e * e - s) + s;
336
+ return i < 0 ? 0 : Math.sqrt(i);
337
+ }, ps = [Mt, L, U], ms = (t) => ps.find((e) => e.test(t));
338
+ function re(t) {
339
+ const e = ms(t);
340
+ if (it(!!e, `'${t}' is not an animatable color. Use the equivalent color code instead.`, "color-not-animatable"), !e)
341
+ return !1;
342
+ let n = e.parse(t);
343
+ return e === U && (n = ds(n)), n;
344
+ }
345
+ const ae = (t, e) => {
346
+ const n = re(t), s = re(e);
347
+ if (!n || !s)
348
+ return ft(t, e);
349
+ const i = { ...n };
350
+ return (r) => (i.red = yt(n.red, s.red, r), i.green = yt(n.green, s.green, r), i.blue = yt(n.blue, s.blue, r), i.alpha = q(n.alpha, s.alpha, r), L.transform(i));
351
+ }, St = /* @__PURE__ */ new Set(["none", "hidden"]);
352
+ function gs(t, e) {
353
+ return St.has(t) ? (n) => n <= 0 ? t : e : (n) => n >= 1 ? e : t;
354
+ }
355
+ function ys(t, e) {
356
+ return (n) => q(t, e, n);
357
+ }
358
+ function Yt(t) {
359
+ return typeof t == "number" ? ys : typeof t == "string" ? Wt(t) ? ft : w.test(t) ? ae : Vs : Array.isArray(t) ? en : typeof t == "object" ? w.test(t) ? ae : Ts : ft;
360
+ }
361
+ function en(t, e) {
362
+ const n = [...t], s = n.length, i = t.map((r, a) => Yt(r)(r, e[a]));
363
+ return (r) => {
364
+ for (let a = 0; a < s; a++)
365
+ n[a] = i[a](r);
366
+ return n;
367
+ };
368
+ }
369
+ function Ts(t, e) {
370
+ const n = { ...t, ...e }, s = {};
371
+ for (const i in n)
372
+ t[i] !== void 0 && e[i] !== void 0 && (s[i] = Yt(t[i])(t[i], e[i]));
373
+ return (i) => {
374
+ for (const r in s)
375
+ n[r] = s[r](i);
376
+ return n;
377
+ };
378
+ }
379
+ function bs(t, e) {
380
+ const n = [], s = { color: 0, var: 0, number: 0 };
381
+ for (let i = 0; i < e.values.length; i++) {
382
+ const r = e.types[i], a = t.indexes[r][s[r]], o = t.values[a] ?? 0;
383
+ n[i] = o, s[r]++;
384
+ }
385
+ return n;
386
+ }
387
+ const Vs = (t, e) => {
388
+ const n = E.createTransformer(e), s = nt(t), i = nt(e);
389
+ return s.indexes.var.length === i.indexes.var.length && s.indexes.color.length === i.indexes.color.length && s.indexes.number.length >= i.indexes.number.length ? St.has(t) && !i.values.length || St.has(e) && !s.values.length ? gs(t, e) : $t(en(bs(s, i), i.values), n) : (it(!0, `Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`, "complex-values-different"), ft(t, e));
390
+ };
391
+ function nn(t, e, n) {
392
+ return typeof t == "number" && typeof e == "number" && typeof n == "number" ? q(t, e, n) : Yt(t)(t, e);
393
+ }
394
+ const vs = (t) => {
395
+ const e = ({ timestamp: n }) => t(n);
396
+ return {
397
+ start: (n = !0) => N.update(e, n),
398
+ stop: () => xt(e),
399
+ /**
400
+ * If we're processing this frame we can use the
401
+ * framelocked timestamp to keep things in sync.
402
+ */
403
+ now: () => ct.isProcessing ? ct.timestamp : C.now()
404
+ };
405
+ }, sn = (t, e, n = 10) => {
406
+ let s = "";
407
+ const i = Math.max(Math.round(e / n), 2);
408
+ for (let r = 0; r < i; r++)
409
+ s += Math.round(t(r / (i - 1)) * 1e4) / 1e4 + ", ";
410
+ return `linear(${s.substring(0, s.length - 2)})`;
411
+ }, ht = 2e4;
412
+ function Gt(t) {
413
+ let e = 0;
414
+ const n = 50;
415
+ let s = t.next(e);
416
+ for (; !s.done && e < ht; )
417
+ e += n, s = t.next(e);
418
+ return e >= ht ? 1 / 0 : e;
419
+ }
420
+ function xs(t, e = 100, n) {
421
+ const s = n({ ...t, keyframes: [0, e] }), i = Math.min(Gt(s), ht);
422
+ return {
423
+ type: "keyframes",
424
+ ease: (r) => s.next(i * r).value / e,
425
+ duration: /* @__PURE__ */ P(i)
426
+ };
427
+ }
428
+ const Ms = 5;
429
+ function rn(t, e, n) {
430
+ const s = Math.max(e - Ms, 0);
431
+ return Ne(n - t(s), e - s);
432
+ }
433
+ const V = {
434
+ // Default spring physics
435
+ stiffness: 100,
436
+ damping: 10,
437
+ mass: 1,
438
+ velocity: 0,
439
+ // Default duration/bounce-based options
440
+ duration: 800,
441
+ // in ms
442
+ bounce: 0.3,
443
+ visualDuration: 0.3,
444
+ // in seconds
445
+ // Rest thresholds
446
+ restSpeed: {
447
+ granular: 0.01,
448
+ default: 2
449
+ },
450
+ restDelta: {
451
+ granular: 5e-3,
452
+ default: 0.5
453
+ },
454
+ // Limits
455
+ minDuration: 0.01,
456
+ // in seconds
457
+ maxDuration: 10,
458
+ // in seconds
459
+ minDamping: 0.05,
460
+ maxDamping: 1
461
+ }, Tt = 1e-3;
462
+ function Ss({ duration: t = V.duration, bounce: e = V.bounce, velocity: n = V.velocity, mass: s = V.mass }) {
463
+ let i, r;
464
+ it(t <= /* @__PURE__ */ k(V.maxDuration), "Spring duration must be 10 seconds or less", "spring-duration-limit");
465
+ let a = 1 - e;
466
+ a = $(V.minDamping, V.maxDamping, a), t = $(V.minDuration, V.maxDuration, /* @__PURE__ */ P(t)), a < 1 ? (i = (c) => {
467
+ const l = c * a, f = l * t, h = l - n, m = wt(c, a), T = Math.exp(-f);
468
+ return Tt - h / m * T;
469
+ }, r = (c) => {
470
+ const f = c * a * t, h = f * n + n, m = Math.pow(a, 2) * Math.pow(c, 2) * t, T = Math.exp(-f), g = wt(Math.pow(c, 2), a);
471
+ return (-i(c) + Tt > 0 ? -1 : 1) * ((h - m) * T) / g;
472
+ }) : (i = (c) => {
473
+ const l = Math.exp(-c * t), f = (c - n) * t + 1;
474
+ return -Tt + l * f;
475
+ }, r = (c) => {
476
+ const l = Math.exp(-c * t), f = (n - c) * (t * t);
477
+ return l * f;
478
+ });
479
+ const o = 5 / t, u = As(i, r, o);
480
+ if (t = /* @__PURE__ */ k(t), isNaN(u))
481
+ return {
482
+ stiffness: V.stiffness,
483
+ damping: V.damping,
484
+ duration: t
485
+ };
486
+ {
487
+ const c = Math.pow(u, 2) * s;
488
+ return {
489
+ stiffness: c,
490
+ damping: a * 2 * Math.sqrt(s * c),
491
+ duration: t
492
+ };
493
+ }
494
+ }
495
+ const ws = 12;
496
+ function As(t, e, n) {
497
+ let s = n;
498
+ for (let i = 1; i < ws; i++)
499
+ s = s - t(s) / e(s);
500
+ return s;
501
+ }
502
+ function wt(t, e) {
503
+ return t * Math.sqrt(1 - e * e);
504
+ }
505
+ const Cs = ["duration", "bounce"], Ds = ["stiffness", "damping", "mass"];
506
+ function oe(t, e) {
507
+ return e.some((n) => t[n] !== void 0);
508
+ }
509
+ function Fs(t) {
510
+ let e = {
511
+ velocity: V.velocity,
512
+ stiffness: V.stiffness,
513
+ damping: V.damping,
514
+ mass: V.mass,
515
+ isResolvedFromDuration: !1,
516
+ ...t
517
+ };
518
+ if (!oe(t, Ds) && oe(t, Cs))
519
+ if (e.velocity = 0, t.visualDuration) {
520
+ const n = t.visualDuration, s = 2 * Math.PI / (n * 1.2), i = s * s, r = 2 * $(0.05, 1, 1 - (t.bounce || 0)) * Math.sqrt(i);
521
+ e = {
522
+ ...e,
523
+ mass: V.mass,
524
+ stiffness: i,
525
+ damping: r
526
+ };
527
+ } else {
528
+ const n = Ss({ ...t, velocity: 0 });
529
+ e = {
530
+ ...e,
531
+ ...n,
532
+ mass: V.mass
533
+ }, e.isResolvedFromDuration = !0;
534
+ }
535
+ return e;
536
+ }
537
+ function dt(t = V.visualDuration, e = V.bounce) {
538
+ const n = typeof t != "object" ? {
539
+ visualDuration: t,
540
+ keyframes: [0, 1],
541
+ bounce: e
542
+ } : t;
543
+ let { restSpeed: s, restDelta: i } = n;
544
+ const r = n.keyframes[0], a = n.keyframes[n.keyframes.length - 1], o = { done: !1, value: r }, { stiffness: u, damping: c, mass: l, duration: f, velocity: h, isResolvedFromDuration: m } = Fs({
545
+ ...n,
546
+ velocity: -/* @__PURE__ */ P(n.velocity || 0)
547
+ }), T = h || 0, g = c / (2 * Math.sqrt(u * l)), v = a - r, x = /* @__PURE__ */ P(Math.sqrt(u / l)), F = Math.abs(v) < 5;
548
+ s || (s = F ? V.restSpeed.granular : V.restSpeed.default), i || (i = F ? V.restDelta.granular : V.restDelta.default);
549
+ let b;
550
+ if (g < 1) {
551
+ const p = wt(x, g);
552
+ b = (S) => {
553
+ const A = Math.exp(-g * x * S);
554
+ return a - A * ((T + g * x * v) / p * Math.sin(p * S) + v * Math.cos(p * S));
555
+ };
556
+ } else if (g === 1)
557
+ b = (p) => a - Math.exp(-x * p) * (v + (T + x * v) * p);
558
+ else {
559
+ const p = x * Math.sqrt(g * g - 1);
560
+ b = (S) => {
561
+ const A = Math.exp(-g * x * S), y = Math.min(p * S, 300);
562
+ return a - A * ((T + g * x * v) * Math.sinh(y) + p * v * Math.cosh(y)) / p;
563
+ };
564
+ }
565
+ const M = {
566
+ calculatedDuration: m && f || null,
567
+ next: (p) => {
568
+ const S = b(p);
569
+ if (m)
570
+ o.done = p >= f;
571
+ else {
572
+ let A = p === 0 ? T : 0;
573
+ g < 1 && (A = p === 0 ? /* @__PURE__ */ k(T) : rn(b, p, S));
574
+ const y = Math.abs(A) <= s, R = Math.abs(a - S) <= i;
575
+ o.done = y && R;
576
+ }
577
+ return o.value = o.done ? a : S, o;
578
+ },
579
+ toString: () => {
580
+ const p = Math.min(Gt(M), ht), S = sn((A) => M.next(p * A).value, p, 30);
581
+ return p + "ms " + S;
582
+ },
583
+ toTransition: () => {
584
+ }
585
+ };
586
+ return M;
587
+ }
588
+ dt.applyToOptions = (t) => {
589
+ const e = xs(t, 100, dt);
590
+ return t.ease = e.ease, t.duration = /* @__PURE__ */ k(e.duration), t.type = "keyframes", t;
591
+ };
592
+ function At({ keyframes: t, velocity: e = 0, power: n = 0.8, timeConstant: s = 325, bounceDamping: i = 10, bounceStiffness: r = 500, modifyTarget: a, min: o, max: u, restDelta: c = 0.5, restSpeed: l }) {
593
+ const f = t[0], h = {
594
+ done: !1,
595
+ value: f
596
+ }, m = (y) => o !== void 0 && y < o || u !== void 0 && y > u, T = (y) => o === void 0 ? u : u === void 0 || Math.abs(o - y) < Math.abs(u - y) ? o : u;
597
+ let g = n * e;
598
+ const v = f + g, x = a === void 0 ? v : a(v);
599
+ x !== v && (g = x - f);
600
+ const F = (y) => -g * Math.exp(-y / s), b = (y) => x + F(y), M = (y) => {
601
+ const R = F(y), B = b(y);
602
+ h.done = Math.abs(R) <= c, h.value = h.done ? x : B;
603
+ };
604
+ let p, S;
605
+ const A = (y) => {
606
+ m(h.value) && (p = y, S = dt({
607
+ keyframes: [h.value, T(h.value)],
608
+ velocity: rn(b, y, h.value),
609
+ // TODO: This should be passing * 1000
610
+ damping: i,
611
+ stiffness: r,
612
+ restDelta: c,
613
+ restSpeed: l
614
+ }));
615
+ };
616
+ return A(0), {
617
+ calculatedDuration: null,
618
+ next: (y) => {
619
+ let R = !1;
620
+ return !S && p === void 0 && (R = !0, M(y), A(y)), p !== void 0 && y >= p ? S.next(y - p) : (!R && M(y), h);
621
+ }
622
+ };
623
+ }
624
+ function Rs(t, e, n) {
625
+ const s = [], i = n || O.mix || nn, r = t.length - 1;
626
+ for (let a = 0; a < r; a++) {
627
+ let o = i(t[a], t[a + 1]);
628
+ if (e) {
629
+ const u = Array.isArray(e) ? e[a] || X : e;
630
+ o = $t(u, o);
631
+ }
632
+ s.push(o);
633
+ }
634
+ return s;
635
+ }
636
+ function Ps(t, e, { clamp: n = !0, ease: s, mixer: i } = {}) {
637
+ const r = t.length;
638
+ if (j(r === e.length, "Both input and output ranges must be the same length", "range-length"), r === 1)
639
+ return () => e[0];
640
+ if (r === 2 && e[0] === e[1])
641
+ return () => e[1];
642
+ const a = t[0] === t[1];
643
+ t[0] > t[r - 1] && (t = [...t].reverse(), e = [...e].reverse());
644
+ const o = Rs(e, s, i), u = o.length, c = (l) => {
645
+ if (a && l < t[0])
646
+ return e[0];
647
+ let f = 0;
648
+ if (u > 1)
649
+ for (; f < t.length - 2 && !(l < t[f + 1]); f++)
650
+ ;
651
+ const h = /* @__PURE__ */ Be(t[f], t[f + 1], l);
652
+ return o[f](h);
653
+ };
654
+ return n ? (l) => c($(t[0], t[r - 1], l)) : c;
655
+ }
656
+ function Es(t, e) {
657
+ const n = t[t.length - 1];
658
+ for (let s = 1; s <= e; s++) {
659
+ const i = /* @__PURE__ */ Be(0, e, s);
660
+ t.push(q(n, 1, i));
661
+ }
662
+ }
663
+ function ks(t) {
664
+ const e = [0];
665
+ return Es(e, t.length - 1), e;
666
+ }
667
+ function Bs(t, e) {
668
+ return t.map((n) => n * e);
669
+ }
670
+ function Os(t, e) {
671
+ return t.map(() => e || Ye).splice(0, t.length - 1);
672
+ }
673
+ function Y({ duration: t = 300, keyframes: e, times: n, ease: s = "easeInOut" }) {
674
+ const i = Xn(s) ? s.map(ee) : ee(s), r = {
675
+ done: !1,
676
+ value: e[0]
677
+ }, a = Bs(
678
+ // Only use the provided offsets if they're the correct length
679
+ // TODO Maybe we should warn here if there's a length mismatch
680
+ n && n.length === e.length ? n : ks(e),
681
+ t
682
+ ), o = Ps(a, e, {
683
+ ease: Array.isArray(i) ? i : Os(e, i)
684
+ });
685
+ return {
686
+ calculatedDuration: t,
687
+ next: (u) => (r.value = o(u), r.done = u >= t, r)
688
+ };
689
+ }
690
+ const Ns = (t) => t !== null;
691
+ function Xt(t, { repeat: e, repeatType: n = "loop" }, s, i = 1) {
692
+ const r = t.filter(Ns), o = i < 0 || e && n !== "loop" && e % 2 === 1 ? 0 : r.length - 1;
693
+ return !o || s === void 0 ? r[o] : s;
694
+ }
695
+ const Is = {
696
+ decay: At,
697
+ inertia: At,
698
+ tween: Y,
699
+ keyframes: Y,
700
+ spring: dt
701
+ };
702
+ function an(t) {
703
+ typeof t.type == "string" && (t.type = Is[t.type]);
704
+ }
705
+ class zt {
706
+ constructor() {
707
+ this.updateFinished();
708
+ }
709
+ get finished() {
710
+ return this._finished;
711
+ }
712
+ updateFinished() {
713
+ this._finished = new Promise((e) => {
714
+ this.resolve = e;
715
+ });
716
+ }
717
+ notifyFinished() {
718
+ this.resolve();
719
+ }
720
+ /**
721
+ * Allows the animation to be awaited.
722
+ *
723
+ * @deprecated Use `finished` instead.
724
+ */
725
+ then(e, n) {
726
+ return this.finished.then(e, n);
727
+ }
728
+ }
729
+ const Ks = (t) => t / 100;
730
+ class qt extends zt {
731
+ constructor(e) {
732
+ super(), this.state = "idle", this.startTime = null, this.isStopped = !1, this.currentTime = 0, this.holdTime = null, this.playbackSpeed = 1, this.stop = () => {
733
+ const { motionValue: n } = this.options;
734
+ n && n.updatedAt !== C.now() && this.tick(C.now()), this.isStopped = !0, this.state !== "idle" && (this.teardown(), this.options.onStop?.());
735
+ }, this.options = e, this.initAnimation(), this.play(), e.autoplay === !1 && this.pause();
736
+ }
737
+ initAnimation() {
738
+ const { options: e } = this;
739
+ an(e);
740
+ const { type: n = Y, repeat: s = 0, repeatDelay: i = 0, repeatType: r, velocity: a = 0 } = e;
741
+ let { keyframes: o } = e;
742
+ const u = n || Y;
743
+ process.env.NODE_ENV !== "production" && u !== Y && j(o.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${o}`, "spring-two-frames"), u !== Y && typeof o[0] != "number" && (this.mixKeyframes = $t(Ks, nn(o[0], o[1])), o = [0, 100]);
744
+ const c = u({ ...e, keyframes: o });
745
+ r === "mirror" && (this.mirroredGenerator = u({
746
+ ...e,
747
+ keyframes: [...o].reverse(),
748
+ velocity: -a
749
+ })), c.calculatedDuration === null && (c.calculatedDuration = Gt(c));
750
+ const { calculatedDuration: l } = c;
751
+ this.calculatedDuration = l, this.resolvedDuration = l + i, this.totalDuration = this.resolvedDuration * (s + 1) - i, this.generator = c;
752
+ }
753
+ updateTime(e) {
754
+ const n = Math.round(e - this.startTime) * this.playbackSpeed;
755
+ this.holdTime !== null ? this.currentTime = this.holdTime : this.currentTime = n;
756
+ }
757
+ tick(e, n = !1) {
758
+ const { generator: s, totalDuration: i, mixKeyframes: r, mirroredGenerator: a, resolvedDuration: o, calculatedDuration: u } = this;
759
+ if (this.startTime === null)
760
+ return s.next(0);
761
+ const { delay: c = 0, keyframes: l, repeat: f, repeatType: h, repeatDelay: m, type: T, onUpdate: g, finalKeyframe: v } = this.options;
762
+ this.speed > 0 ? this.startTime = Math.min(this.startTime, e) : this.speed < 0 && (this.startTime = Math.min(e - i / this.speed, this.startTime)), n ? this.currentTime = e : this.updateTime(e);
763
+ const x = this.currentTime - c * (this.playbackSpeed >= 0 ? 1 : -1), F = this.playbackSpeed >= 0 ? x < 0 : x > i;
764
+ this.currentTime = Math.max(x, 0), this.state === "finished" && this.holdTime === null && (this.currentTime = i);
765
+ let b = this.currentTime, M = s;
766
+ if (f) {
767
+ const y = Math.min(this.currentTime, i) / o;
768
+ let R = Math.floor(y), B = y % 1;
769
+ !B && y >= 1 && (B = 1), B === 1 && R--, R = Math.min(R, f + 1), R % 2 && (h === "reverse" ? (B = 1 - B, m && (B -= m / o)) : h === "mirror" && (M = a)), b = $(0, 1, B) * o;
770
+ }
771
+ const p = F ? { done: !1, value: l[0] } : M.next(b);
772
+ r && (p.value = r(p.value));
773
+ let { done: S } = p;
774
+ !F && u !== null && (S = this.playbackSpeed >= 0 ? this.currentTime >= i : this.currentTime <= 0);
775
+ const A = this.holdTime === null && (this.state === "finished" || this.state === "running" && S);
776
+ return A && T !== At && (p.value = Xt(l, this.options, v, this.speed)), g && g(p.value), A && this.finish(), p;
777
+ }
778
+ /**
779
+ * Allows the returned animation to be awaited or promise-chained. Currently
780
+ * resolves when the animation finishes at all but in a future update could/should
781
+ * reject if its cancels.
782
+ */
783
+ then(e, n) {
784
+ return this.finished.then(e, n);
785
+ }
786
+ get duration() {
787
+ return /* @__PURE__ */ P(this.calculatedDuration);
788
+ }
789
+ get iterationDuration() {
790
+ const { delay: e = 0 } = this.options || {};
791
+ return this.duration + /* @__PURE__ */ P(e);
792
+ }
793
+ get time() {
794
+ return /* @__PURE__ */ P(this.currentTime);
795
+ }
796
+ set time(e) {
797
+ e = /* @__PURE__ */ k(e), this.currentTime = e, this.startTime === null || this.holdTime !== null || this.playbackSpeed === 0 ? this.holdTime = e : this.driver && (this.startTime = this.driver.now() - e / this.playbackSpeed), this.driver?.start(!1);
798
+ }
799
+ get speed() {
800
+ return this.playbackSpeed;
801
+ }
802
+ set speed(e) {
803
+ this.updateTime(C.now());
804
+ const n = this.playbackSpeed !== e;
805
+ this.playbackSpeed = e, n && (this.time = /* @__PURE__ */ P(this.currentTime));
806
+ }
807
+ play() {
808
+ if (this.isStopped)
809
+ return;
810
+ const { driver: e = vs, startTime: n } = this.options;
811
+ this.driver || (this.driver = e((i) => this.tick(i))), this.options.onPlay?.();
812
+ const s = this.driver.now();
813
+ this.state === "finished" ? (this.updateFinished(), this.startTime = s) : this.holdTime !== null ? this.startTime = s - this.holdTime : this.startTime || (this.startTime = n ?? s), this.state === "finished" && this.speed < 0 && (this.startTime += this.calculatedDuration), this.holdTime = null, this.state = "running", this.driver.start();
814
+ }
815
+ pause() {
816
+ this.state = "paused", this.updateTime(C.now()), this.holdTime = this.currentTime;
817
+ }
818
+ complete() {
819
+ this.state !== "running" && this.play(), this.state = "finished", this.holdTime = null;
820
+ }
821
+ finish() {
822
+ this.notifyFinished(), this.teardown(), this.state = "finished", this.options.onComplete?.();
823
+ }
824
+ cancel() {
825
+ this.holdTime = null, this.startTime = 0, this.tick(0), this.teardown(), this.options.onCancel?.();
826
+ }
827
+ teardown() {
828
+ this.state = "idle", this.stopDriver(), this.startTime = this.holdTime = null;
829
+ }
830
+ stopDriver() {
831
+ this.driver && (this.driver.stop(), this.driver = void 0);
832
+ }
833
+ sample(e) {
834
+ return this.startTime = 0, this.tick(e, !0);
835
+ }
836
+ attachTimeline(e) {
837
+ return this.options.allowFlatten && (this.options.type = "keyframes", this.options.ease = "linear", this.initAnimation()), this.driver?.stop(), e.observe(this);
838
+ }
839
+ }
840
+ function $s(t) {
841
+ for (let e = 1; e < t.length; e++)
842
+ t[e] ?? (t[e] = t[e - 1]);
843
+ }
844
+ const _ = (t) => t * 180 / Math.PI, Ct = (t) => {
845
+ const e = _(Math.atan2(t[1], t[0]));
846
+ return Dt(e);
847
+ }, Ls = {
848
+ x: 4,
849
+ y: 5,
850
+ translateX: 4,
851
+ translateY: 5,
852
+ scaleX: 0,
853
+ scaleY: 3,
854
+ scale: (t) => (Math.abs(t[0]) + Math.abs(t[3])) / 2,
855
+ rotate: Ct,
856
+ rotateZ: Ct,
857
+ skewX: (t) => _(Math.atan(t[1])),
858
+ skewY: (t) => _(Math.atan(t[2])),
859
+ skew: (t) => (Math.abs(t[1]) + Math.abs(t[2])) / 2
860
+ }, Dt = (t) => (t = t % 360, t < 0 && (t += 360), t), le = Ct, ue = (t) => Math.sqrt(t[0] * t[0] + t[1] * t[1]), ce = (t) => Math.sqrt(t[4] * t[4] + t[5] * t[5]), _s = {
861
+ x: 12,
862
+ y: 13,
863
+ z: 14,
864
+ translateX: 12,
865
+ translateY: 13,
866
+ translateZ: 14,
867
+ scaleX: ue,
868
+ scaleY: ce,
869
+ scale: (t) => (ue(t) + ce(t)) / 2,
870
+ rotateX: (t) => Dt(_(Math.atan2(t[6], t[5]))),
871
+ rotateY: (t) => Dt(_(Math.atan2(-t[2], t[0]))),
872
+ rotateZ: le,
873
+ rotate: le,
874
+ skewX: (t) => _(Math.atan(t[4])),
875
+ skewY: (t) => _(Math.atan(t[1])),
876
+ skew: (t) => (Math.abs(t[1]) + Math.abs(t[4])) / 2
877
+ };
878
+ function Ft(t) {
879
+ return t.includes("scale") ? 1 : 0;
880
+ }
881
+ function Rt(t, e) {
882
+ if (!t || t === "none")
883
+ return Ft(e);
884
+ const n = t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);
885
+ let s, i;
886
+ if (n)
887
+ s = _s, i = n;
888
+ else {
889
+ const o = t.match(/^matrix\(([-\d.e\s,]+)\)$/u);
890
+ s = Ls, i = o;
891
+ }
892
+ if (!i)
893
+ return Ft(e);
894
+ const r = s[e], a = i[1].split(",").map(js);
895
+ return typeof r == "function" ? r(a) : a[r];
896
+ }
897
+ const Ws = (t, e) => {
898
+ const { transform: n = "none" } = getComputedStyle(t);
899
+ return Rt(n, e);
900
+ };
901
+ function js(t) {
902
+ return parseFloat(t.trim());
903
+ }
904
+ const Z = [
905
+ "transformPerspective",
906
+ "x",
907
+ "y",
908
+ "z",
909
+ "translateX",
910
+ "translateY",
911
+ "translateZ",
912
+ "scale",
913
+ "scaleX",
914
+ "scaleY",
915
+ "rotate",
916
+ "rotateX",
917
+ "rotateY",
918
+ "rotateZ",
919
+ "skew",
920
+ "skewX",
921
+ "skewY"
922
+ ], H = new Set(Z), fe = (t) => t === z || t === d, Us = /* @__PURE__ */ new Set(["x", "y", "z"]), Ys = Z.filter((t) => !Us.has(t));
923
+ function Gs(t) {
924
+ const e = [];
925
+ return Ys.forEach((n) => {
926
+ const s = t.getValue(n);
927
+ s !== void 0 && (e.push([n, s.get()]), s.set(n.startsWith("scale") ? 1 : 0));
928
+ }), e;
929
+ }
930
+ const K = {
931
+ // Dimensions
932
+ width: ({ x: t }, { paddingLeft: e = "0", paddingRight: n = "0" }) => t.max - t.min - parseFloat(e) - parseFloat(n),
933
+ height: ({ y: t }, { paddingTop: e = "0", paddingBottom: n = "0" }) => t.max - t.min - parseFloat(e) - parseFloat(n),
934
+ top: (t, { top: e }) => parseFloat(e),
935
+ left: (t, { left: e }) => parseFloat(e),
936
+ bottom: ({ y: t }, { top: e }) => parseFloat(e) + (t.max - t.min),
937
+ right: ({ x: t }, { left: e }) => parseFloat(e) + (t.max - t.min),
938
+ // Transform
939
+ x: (t, { transform: e }) => Rt(e, "x"),
940
+ y: (t, { transform: e }) => Rt(e, "y")
941
+ };
942
+ K.translateX = K.x;
943
+ K.translateY = K.y;
944
+ const W = /* @__PURE__ */ new Set();
945
+ let Pt = !1, Et = !1, kt = !1;
946
+ function on() {
947
+ if (Et) {
948
+ const t = Array.from(W).filter((s) => s.needsMeasurement), e = new Set(t.map((s) => s.element)), n = /* @__PURE__ */ new Map();
949
+ e.forEach((s) => {
950
+ const i = Gs(s);
951
+ i.length && (n.set(s, i), s.render());
952
+ }), t.forEach((s) => s.measureInitialState()), e.forEach((s) => {
953
+ s.render();
954
+ const i = n.get(s);
955
+ i && i.forEach(([r, a]) => {
956
+ s.getValue(r)?.set(a);
957
+ });
958
+ }), t.forEach((s) => s.measureEndState()), t.forEach((s) => {
959
+ s.suspendedScrollY !== void 0 && window.scrollTo(0, s.suspendedScrollY);
960
+ });
961
+ }
962
+ Et = !1, Pt = !1, W.forEach((t) => t.complete(kt)), W.clear();
963
+ }
964
+ function ln() {
965
+ W.forEach((t) => {
966
+ t.readKeyframes(), t.needsMeasurement && (Et = !0);
967
+ });
968
+ }
969
+ function Xs() {
970
+ kt = !0, ln(), on(), kt = !1;
971
+ }
972
+ class Zt {
973
+ constructor(e, n, s, i, r, a = !1) {
974
+ this.state = "pending", this.isAsync = !1, this.needsMeasurement = !1, this.unresolvedKeyframes = [...e], this.onComplete = n, this.name = s, this.motionValue = i, this.element = r, this.isAsync = a;
975
+ }
976
+ scheduleResolve() {
977
+ this.state = "scheduled", this.isAsync ? (W.add(this), Pt || (Pt = !0, N.read(ln), N.resolveKeyframes(on))) : (this.readKeyframes(), this.complete());
978
+ }
979
+ readKeyframes() {
980
+ const { unresolvedKeyframes: e, name: n, element: s, motionValue: i } = this;
981
+ if (e[0] === null) {
982
+ const r = i?.get(), a = e[e.length - 1];
983
+ if (r !== void 0)
984
+ e[0] = r;
985
+ else if (s && n) {
986
+ const o = s.readValue(n, a);
987
+ o != null && (e[0] = o);
988
+ }
989
+ e[0] === void 0 && (e[0] = a), i && r === void 0 && i.set(e[0]);
990
+ }
991
+ $s(e);
992
+ }
993
+ setFinalKeyframe() {
994
+ }
995
+ measureInitialState() {
996
+ }
997
+ renderEndStyles() {
998
+ }
999
+ measureEndState() {
1000
+ }
1001
+ complete(e = !1) {
1002
+ this.state = "complete", this.onComplete(this.unresolvedKeyframes, this.finalKeyframe, e), W.delete(this);
1003
+ }
1004
+ cancel() {
1005
+ this.state === "scheduled" && (W.delete(this), this.state = "pending");
1006
+ }
1007
+ resume() {
1008
+ this.state === "pending" && this.scheduleResolve();
1009
+ }
1010
+ }
1011
+ const zs = (t) => t.startsWith("--");
1012
+ function qs(t, e, n) {
1013
+ zs(e) ? t.style.setProperty(e, n) : t.style[e] = n;
1014
+ }
1015
+ const Zs = {};
1016
+ function un(t, e) {
1017
+ const n = /* @__PURE__ */ ke(t);
1018
+ return () => Zs[e] ?? n();
1019
+ }
1020
+ const Hs = /* @__PURE__ */ un(() => window.ScrollTimeline !== void 0, "scrollTimeline"), cn = /* @__PURE__ */ un(() => {
1021
+ try {
1022
+ document.createElement("div").animate({ opacity: 0 }, { easing: "linear(0, 1)" });
1023
+ } catch {
1024
+ return !1;
1025
+ }
1026
+ return !0;
1027
+ }, "linearEasing"), Q = ([t, e, n, s]) => `cubic-bezier(${t}, ${e}, ${n}, ${s})`, he = {
1028
+ linear: "linear",
1029
+ ease: "ease",
1030
+ easeIn: "ease-in",
1031
+ easeOut: "ease-out",
1032
+ easeInOut: "ease-in-out",
1033
+ circIn: /* @__PURE__ */ Q([0, 0.65, 0.55, 1]),
1034
+ circOut: /* @__PURE__ */ Q([0.55, 0, 1, 0.45]),
1035
+ backIn: /* @__PURE__ */ Q([0.31, 0.01, 0.66, -0.59]),
1036
+ backOut: /* @__PURE__ */ Q([0.33, 1.53, 0.69, 0.99])
1037
+ };
1038
+ function fn(t, e) {
1039
+ if (t)
1040
+ return typeof t == "function" ? cn() ? sn(t, e) : "ease-out" : Ge(t) ? Q(t) : Array.isArray(t) ? t.map((n) => fn(n, e) || he.easeOut) : he[t];
1041
+ }
1042
+ function Js(t, e, n, { delay: s = 0, duration: i = 300, repeat: r = 0, repeatType: a = "loop", ease: o = "easeOut", times: u } = {}, c = void 0) {
1043
+ const l = {
1044
+ [e]: n
1045
+ };
1046
+ u && (l.offset = u);
1047
+ const f = fn(o, i);
1048
+ Array.isArray(f) && (l.easing = f);
1049
+ const h = {
1050
+ delay: s,
1051
+ duration: i,
1052
+ easing: Array.isArray(f) ? "linear" : f,
1053
+ fill: "both",
1054
+ iterations: r + 1,
1055
+ direction: a === "reverse" ? "alternate" : "normal"
1056
+ };
1057
+ return c && (h.pseudoElement = c), t.animate(l, h);
1058
+ }
1059
+ function hn(t) {
1060
+ return typeof t == "function" && "applyToOptions" in t;
1061
+ }
1062
+ function Qs({ type: t, ...e }) {
1063
+ return hn(t) && cn() ? t.applyToOptions(e) : (e.duration ?? (e.duration = 300), e.ease ?? (e.ease = "easeOut"), e);
1064
+ }
1065
+ class dn extends zt {
1066
+ constructor(e) {
1067
+ if (super(), this.finishedTime = null, this.isStopped = !1, this.manualStartTime = null, !e)
1068
+ return;
1069
+ const { element: n, name: s, keyframes: i, pseudoElement: r, allowFlatten: a = !1, finalKeyframe: o, onComplete: u } = e;
1070
+ this.isPseudoElement = !!r, this.allowFlatten = a, this.options = e, j(typeof e.type != "string", `Mini animate() doesn't support "type" as a string.`, "mini-spring");
1071
+ const c = Qs(e);
1072
+ this.animation = Js(n, s, i, c, r), c.autoplay === !1 && this.animation.pause(), this.animation.onfinish = () => {
1073
+ if (this.finishedTime = this.time, !r) {
1074
+ const l = Xt(i, this.options, o, this.speed);
1075
+ this.updateMotionValue ? this.updateMotionValue(l) : qs(n, s, l), this.animation.cancel();
1076
+ }
1077
+ u?.(), this.notifyFinished();
1078
+ };
1079
+ }
1080
+ play() {
1081
+ this.isStopped || (this.manualStartTime = null, this.animation.play(), this.state === "finished" && this.updateFinished());
1082
+ }
1083
+ pause() {
1084
+ this.animation.pause();
1085
+ }
1086
+ complete() {
1087
+ this.animation.finish?.();
1088
+ }
1089
+ cancel() {
1090
+ try {
1091
+ this.animation.cancel();
1092
+ } catch {
1093
+ }
1094
+ }
1095
+ stop() {
1096
+ if (this.isStopped)
1097
+ return;
1098
+ this.isStopped = !0;
1099
+ const { state: e } = this;
1100
+ e === "idle" || e === "finished" || (this.updateMotionValue ? this.updateMotionValue() : this.commitStyles(), this.isPseudoElement || this.cancel());
1101
+ }
1102
+ /**
1103
+ * WAAPI doesn't natively have any interruption capabilities.
1104
+ *
1105
+ * In this method, we commit styles back to the DOM before cancelling
1106
+ * the animation.
1107
+ *
1108
+ * This is designed to be overridden by NativeAnimationExtended, which
1109
+ * will create a renderless JS animation and sample it twice to calculate
1110
+ * its current value, "previous" value, and therefore allow
1111
+ * Motion to also correctly calculate velocity for any subsequent animation
1112
+ * while deferring the commit until the next animation frame.
1113
+ */
1114
+ commitStyles() {
1115
+ const e = this.options?.element;
1116
+ !this.isPseudoElement && e?.isConnected && this.animation.commitStyles?.();
1117
+ }
1118
+ get duration() {
1119
+ const e = this.animation.effect?.getComputedTiming?.().duration || 0;
1120
+ return /* @__PURE__ */ P(Number(e));
1121
+ }
1122
+ get iterationDuration() {
1123
+ const { delay: e = 0 } = this.options || {};
1124
+ return this.duration + /* @__PURE__ */ P(e);
1125
+ }
1126
+ get time() {
1127
+ return /* @__PURE__ */ P(Number(this.animation.currentTime) || 0);
1128
+ }
1129
+ set time(e) {
1130
+ this.manualStartTime = null, this.finishedTime = null, this.animation.currentTime = /* @__PURE__ */ k(e);
1131
+ }
1132
+ /**
1133
+ * The playback speed of the animation.
1134
+ * 1 = normal speed, 2 = double speed, 0.5 = half speed.
1135
+ */
1136
+ get speed() {
1137
+ return this.animation.playbackRate;
1138
+ }
1139
+ set speed(e) {
1140
+ e < 0 && (this.finishedTime = null), this.animation.playbackRate = e;
1141
+ }
1142
+ get state() {
1143
+ return this.finishedTime !== null ? "finished" : this.animation.playState;
1144
+ }
1145
+ get startTime() {
1146
+ return this.manualStartTime ?? Number(this.animation.startTime);
1147
+ }
1148
+ set startTime(e) {
1149
+ this.manualStartTime = this.animation.startTime = e;
1150
+ }
1151
+ /**
1152
+ * Attaches a timeline to the animation, for instance the `ScrollTimeline`.
1153
+ */
1154
+ attachTimeline({ timeline: e, observe: n }) {
1155
+ return this.allowFlatten && this.animation.effect?.updateTiming({ easing: "linear" }), this.animation.onfinish = null, e && Hs() ? (this.animation.timeline = e, X) : n(this);
1156
+ }
1157
+ }
1158
+ const pn = {
1159
+ anticipate: je,
1160
+ backInOut: We,
1161
+ circInOut: Ue
1162
+ };
1163
+ function ti(t) {
1164
+ return t in pn;
1165
+ }
1166
+ function ei(t) {
1167
+ typeof t.ease == "string" && ti(t.ease) && (t.ease = pn[t.ease]);
1168
+ }
1169
+ const bt = 10;
1170
+ class ni extends dn {
1171
+ constructor(e) {
1172
+ ei(e), an(e), super(e), e.startTime !== void 0 && (this.startTime = e.startTime), this.options = e;
1173
+ }
1174
+ /**
1175
+ * WAAPI doesn't natively have any interruption capabilities.
1176
+ *
1177
+ * Rather than read committed styles back out of the DOM, we can
1178
+ * create a renderless JS animation and sample it twice to calculate
1179
+ * its current value, "previous" value, and therefore allow
1180
+ * Motion to calculate velocity for any subsequent animation.
1181
+ */
1182
+ updateMotionValue(e) {
1183
+ const { motionValue: n, onUpdate: s, onComplete: i, element: r, ...a } = this.options;
1184
+ if (!n)
1185
+ return;
1186
+ if (e !== void 0) {
1187
+ n.set(e);
1188
+ return;
1189
+ }
1190
+ const o = new qt({
1191
+ ...a,
1192
+ autoplay: !1
1193
+ }), u = Math.max(bt, C.now() - this.startTime), c = $(0, bt, u - bt);
1194
+ n.setWithVelocity(o.sample(Math.max(0, u - c)).value, o.sample(u).value, c), o.stop();
1195
+ }
1196
+ }
1197
+ const de = (t, e) => e === "zIndex" ? !1 : !!(typeof t == "number" || Array.isArray(t) || typeof t == "string" && // It's animatable if we have a string
1198
+ (E.test(t) || t === "0") && // And it contains numbers and/or colors
1199
+ !t.startsWith("url("));
1200
+ function si(t) {
1201
+ const e = t[0];
1202
+ if (t.length === 1)
1203
+ return !0;
1204
+ for (let n = 0; n < t.length; n++)
1205
+ if (t[n] !== e)
1206
+ return !0;
1207
+ }
1208
+ function ii(t, e, n, s) {
1209
+ const i = t[0];
1210
+ if (i === null)
1211
+ return !1;
1212
+ if (e === "display" || e === "visibility")
1213
+ return !0;
1214
+ const r = t[t.length - 1], a = de(i, e), o = de(r, e);
1215
+ return it(a === o, `You are trying to animate ${e} from "${i}" to "${r}". "${a ? r : i}" is not an animatable value.`, "value-not-animatable"), !a || !o ? !1 : si(t) || (n === "spring" || hn(n)) && s;
1216
+ }
1217
+ function Bt(t) {
1218
+ t.duration = 0, t.type = "keyframes";
1219
+ }
1220
+ const ri = /* @__PURE__ */ new Set([
1221
+ "opacity",
1222
+ "clipPath",
1223
+ "filter",
1224
+ "transform"
1225
+ // TODO: Could be re-enabled now we have support for linear() easing
1226
+ // "background-color"
1227
+ ]), ai = /* @__PURE__ */ ke(() => Object.hasOwnProperty.call(Element.prototype, "animate"));
1228
+ function oi(t) {
1229
+ const { motionValue: e, name: n, repeatDelay: s, repeatType: i, damping: r, type: a } = t;
1230
+ if (!(e?.owner?.current instanceof HTMLElement))
1231
+ return !1;
1232
+ const { onUpdate: u, transformTemplate: c } = e.owner.getProps();
1233
+ return ai() && n && ri.has(n) && (n !== "transform" || !c) && /**
1234
+ * If we're outputting values to onUpdate then we can't use WAAPI as there's
1235
+ * no way to read the value from WAAPI every frame.
1236
+ */
1237
+ !u && !s && i !== "mirror" && r !== 0 && a !== "inertia";
1238
+ }
1239
+ const li = 40;
1240
+ class ui extends zt {
1241
+ constructor({ autoplay: e = !0, delay: n = 0, type: s = "keyframes", repeat: i = 0, repeatDelay: r = 0, repeatType: a = "loop", keyframes: o, name: u, motionValue: c, element: l, ...f }) {
1242
+ super(), this.stop = () => {
1243
+ this._animation && (this._animation.stop(), this.stopTimeline?.()), this.keyframeResolver?.cancel();
1244
+ }, this.createdAt = C.now();
1245
+ const h = {
1246
+ autoplay: e,
1247
+ delay: n,
1248
+ type: s,
1249
+ repeat: i,
1250
+ repeatDelay: r,
1251
+ repeatType: a,
1252
+ name: u,
1253
+ motionValue: c,
1254
+ element: l,
1255
+ ...f
1256
+ }, m = l?.KeyframeResolver || Zt;
1257
+ this.keyframeResolver = new m(o, (T, g, v) => this.onKeyframesResolved(T, g, h, !v), u, c, l), this.keyframeResolver?.scheduleResolve();
1258
+ }
1259
+ onKeyframesResolved(e, n, s, i) {
1260
+ this.keyframeResolver = void 0;
1261
+ const { name: r, type: a, velocity: o, delay: u, isHandoff: c, onUpdate: l } = s;
1262
+ this.resolvedAt = C.now(), ii(e, r, a, o) || ((O.instantAnimations || !u) && l?.(Xt(e, s, n)), e[0] = e[e.length - 1], Bt(s), s.repeat = 0);
1263
+ const h = {
1264
+ startTime: i ? this.resolvedAt ? this.resolvedAt - this.createdAt > li ? this.resolvedAt : this.createdAt : this.createdAt : void 0,
1265
+ finalKeyframe: n,
1266
+ ...s,
1267
+ keyframes: e
1268
+ }, m = !c && oi(h), T = h.motionValue?.owner?.current, g = m ? new ni({
1269
+ ...h,
1270
+ element: T
1271
+ }) : new qt(h);
1272
+ g.finished.then(() => {
1273
+ this.notifyFinished();
1274
+ }).catch(X), this.pendingTimeline && (this.stopTimeline = g.attachTimeline(this.pendingTimeline), this.pendingTimeline = void 0), this._animation = g;
1275
+ }
1276
+ get finished() {
1277
+ return this._animation ? this.animation.finished : this._finished;
1278
+ }
1279
+ then(e, n) {
1280
+ return this.finished.finally(e).then(() => {
1281
+ });
1282
+ }
1283
+ get animation() {
1284
+ return this._animation || (this.keyframeResolver?.resume(), Xs()), this._animation;
1285
+ }
1286
+ get duration() {
1287
+ return this.animation.duration;
1288
+ }
1289
+ get iterationDuration() {
1290
+ return this.animation.iterationDuration;
1291
+ }
1292
+ get time() {
1293
+ return this.animation.time;
1294
+ }
1295
+ set time(e) {
1296
+ this.animation.time = e;
1297
+ }
1298
+ get speed() {
1299
+ return this.animation.speed;
1300
+ }
1301
+ get state() {
1302
+ return this.animation.state;
1303
+ }
1304
+ set speed(e) {
1305
+ this.animation.speed = e;
1306
+ }
1307
+ get startTime() {
1308
+ return this.animation.startTime;
1309
+ }
1310
+ attachTimeline(e) {
1311
+ return this._animation ? this.stopTimeline = this.animation.attachTimeline(e) : this.pendingTimeline = e, () => this.stop();
1312
+ }
1313
+ play() {
1314
+ this.animation.play();
1315
+ }
1316
+ pause() {
1317
+ this.animation.pause();
1318
+ }
1319
+ complete() {
1320
+ this.animation.complete();
1321
+ }
1322
+ cancel() {
1323
+ this._animation && this.animation.cancel(), this.keyframeResolver?.cancel();
1324
+ }
1325
+ }
1326
+ const ci = (
1327
+ // eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words
1328
+ /^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u
1329
+ );
1330
+ function fi(t) {
1331
+ const e = ci.exec(t);
1332
+ if (!e)
1333
+ return [,];
1334
+ const [, n, s, i] = e;
1335
+ return [`--${n ?? s}`, i];
1336
+ }
1337
+ const hi = 4;
1338
+ function mn(t, e, n = 1) {
1339
+ j(n <= hi, `Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`, "max-css-var-depth");
1340
+ const [s, i] = fi(t);
1341
+ if (!s)
1342
+ return;
1343
+ const r = window.getComputedStyle(e).getPropertyValue(s);
1344
+ if (r) {
1345
+ const a = r.trim();
1346
+ return Pe(a) ? parseFloat(a) : a;
1347
+ }
1348
+ return Wt(i) ? mn(i, e, n + 1) : i;
1349
+ }
1350
+ const di = {
1351
+ type: "spring",
1352
+ stiffness: 500,
1353
+ damping: 25,
1354
+ restSpeed: 10
1355
+ }, pi = (t) => ({
1356
+ type: "spring",
1357
+ stiffness: 550,
1358
+ damping: t === 0 ? 2 * Math.sqrt(550) : 30,
1359
+ restSpeed: 10
1360
+ }), mi = {
1361
+ type: "keyframes",
1362
+ duration: 0.8
1363
+ }, gi = {
1364
+ type: "keyframes",
1365
+ ease: [0.25, 0.1, 0.35, 1],
1366
+ duration: 0.3
1367
+ }, yi = (t, { keyframes: e }) => e.length > 2 ? mi : H.has(t) ? t.startsWith("scale") ? pi(e[1]) : di : gi, Ti = (t) => t !== null;
1368
+ function bi(t, { repeat: e, repeatType: n = "loop" }, s) {
1369
+ const i = t.filter(Ti), r = e && n !== "loop" && e % 2 === 1 ? 0 : i.length - 1;
1370
+ return i[r];
1371
+ }
1372
+ function gn(t, e) {
1373
+ if (t?.inherit && e) {
1374
+ const { inherit: n, ...s } = t;
1375
+ return { ...e, ...s };
1376
+ }
1377
+ return t;
1378
+ }
1379
+ function yn(t, e) {
1380
+ const n = t?.[e] ?? t?.default ?? t;
1381
+ return n !== t ? gn(n, t) : n;
1382
+ }
1383
+ function Vi({ when: t, delay: e, delayChildren: n, staggerChildren: s, staggerDirection: i, repeat: r, repeatType: a, repeatDelay: o, from: u, elapsed: c, ...l }) {
1384
+ return !!Object.keys(l).length;
1385
+ }
1386
+ const Tn = (t, e, n, s = {}, i, r) => (a) => {
1387
+ const o = yn(s, t) || {}, u = o.delay || s.delay || 0;
1388
+ let { elapsed: c = 0 } = s;
1389
+ c = c - /* @__PURE__ */ k(u);
1390
+ const l = {
1391
+ keyframes: Array.isArray(n) ? n : [null, n],
1392
+ ease: "easeOut",
1393
+ velocity: e.getVelocity(),
1394
+ ...o,
1395
+ delay: -c,
1396
+ onUpdate: (h) => {
1397
+ e.set(h), o.onUpdate && o.onUpdate(h);
1398
+ },
1399
+ onComplete: () => {
1400
+ a(), o.onComplete && o.onComplete();
1401
+ },
1402
+ name: t,
1403
+ motionValue: e,
1404
+ element: r ? void 0 : i
1405
+ };
1406
+ Vi(o) || Object.assign(l, yi(t, l)), l.duration && (l.duration = /* @__PURE__ */ k(l.duration)), l.repeatDelay && (l.repeatDelay = /* @__PURE__ */ k(l.repeatDelay)), l.from !== void 0 && (l.keyframes[0] = l.from);
1407
+ let f = !1;
1408
+ if ((l.type === !1 || l.duration === 0 && !l.repeatDelay) && (Bt(l), l.delay === 0 && (f = !0)), (O.instantAnimations || O.skipAnimations || i?.shouldSkipAnimations) && (f = !0, Bt(l), l.delay = 0), l.allowFlatten = !o.type && !o.ease, f && !r && e.get() !== void 0) {
1409
+ const h = bi(l.keyframes, o);
1410
+ if (h !== void 0) {
1411
+ N.update(() => {
1412
+ l.onUpdate(h), l.onComplete();
1413
+ });
1414
+ return;
1415
+ }
1416
+ }
1417
+ return o.isSync ? new qt(l) : new ui(l);
1418
+ };
1419
+ function pe(t) {
1420
+ const e = [{}, {}];
1421
+ return t?.values.forEach((n, s) => {
1422
+ e[0][s] = n.get(), e[1][s] = n.getVelocity();
1423
+ }), e;
1424
+ }
1425
+ function bn(t, e, n, s) {
1426
+ if (typeof e == "function") {
1427
+ const [i, r] = pe(s);
1428
+ e = e(n !== void 0 ? n : t.custom, i, r);
1429
+ }
1430
+ if (typeof e == "string" && (e = t.variants && t.variants[e]), typeof e == "function") {
1431
+ const [i, r] = pe(s);
1432
+ e = e(n !== void 0 ? n : t.custom, i, r);
1433
+ }
1434
+ return e;
1435
+ }
1436
+ function vi(t, e, n) {
1437
+ const s = t.getProps();
1438
+ return bn(s, e, n !== void 0 ? n : s.custom, t);
1439
+ }
1440
+ const Vn = /* @__PURE__ */ new Set([
1441
+ "width",
1442
+ "height",
1443
+ "top",
1444
+ "left",
1445
+ "right",
1446
+ "bottom",
1447
+ ...Z
1448
+ ]), me = 30, xi = (t) => !isNaN(parseFloat(t)), ge = {
1449
+ current: void 0
1450
+ };
1451
+ class Mi {
1452
+ /**
1453
+ * @param init - The initiating value
1454
+ * @param config - Optional configuration options
1455
+ *
1456
+ * - `transformer`: A function to transform incoming values with.
1457
+ */
1458
+ constructor(e, n = {}) {
1459
+ this.canTrackVelocity = null, this.events = {}, this.updateAndNotify = (s) => {
1460
+ const i = C.now();
1461
+ if (this.updatedAt !== i && this.setPrevFrameValue(), this.prev = this.current, this.setCurrent(s), this.current !== this.prev && (this.events.change?.notify(this.current), this.dependents))
1462
+ for (const r of this.dependents)
1463
+ r.dirty();
1464
+ }, this.hasAnimated = !1, this.setCurrent(e), this.owner = n.owner;
1465
+ }
1466
+ setCurrent(e) {
1467
+ this.current = e, this.updatedAt = C.now(), this.canTrackVelocity === null && e !== void 0 && (this.canTrackVelocity = xi(this.current));
1468
+ }
1469
+ setPrevFrameValue(e = this.current) {
1470
+ this.prevFrameValue = e, this.prevUpdatedAt = this.updatedAt;
1471
+ }
1472
+ /**
1473
+ * Adds a function that will be notified when the `MotionValue` is updated.
1474
+ *
1475
+ * It returns a function that, when called, will cancel the subscription.
1476
+ *
1477
+ * When calling `onChange` inside a React component, it should be wrapped with the
1478
+ * `useEffect` hook. As it returns an unsubscribe function, this should be returned
1479
+ * from the `useEffect` function to ensure you don't add duplicate subscribers..
1480
+ *
1481
+ * ```jsx
1482
+ * export const MyComponent = () => {
1483
+ * const x = useMotionValue(0)
1484
+ * const y = useMotionValue(0)
1485
+ * const opacity = useMotionValue(1)
1486
+ *
1487
+ * useEffect(() => {
1488
+ * function updateOpacity() {
1489
+ * const maxXY = Math.max(x.get(), y.get())
1490
+ * const newOpacity = transform(maxXY, [0, 100], [1, 0])
1491
+ * opacity.set(newOpacity)
1492
+ * }
1493
+ *
1494
+ * const unsubscribeX = x.on("change", updateOpacity)
1495
+ * const unsubscribeY = y.on("change", updateOpacity)
1496
+ *
1497
+ * return () => {
1498
+ * unsubscribeX()
1499
+ * unsubscribeY()
1500
+ * }
1501
+ * }, [])
1502
+ *
1503
+ * return <motion.div style={{ x }} />
1504
+ * }
1505
+ * ```
1506
+ *
1507
+ * @param subscriber - A function that receives the latest value.
1508
+ * @returns A function that, when called, will cancel this subscription.
1509
+ *
1510
+ * @deprecated
1511
+ */
1512
+ onChange(e) {
1513
+ return process.env.NODE_ENV !== "production" && Ie(!1, 'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'), this.on("change", e);
1514
+ }
1515
+ on(e, n) {
1516
+ this.events[e] || (this.events[e] = new Oe());
1517
+ const s = this.events[e].add(n);
1518
+ return e === "change" ? () => {
1519
+ s(), N.read(() => {
1520
+ this.events.change.getSize() || this.stop();
1521
+ });
1522
+ } : s;
1523
+ }
1524
+ clearListeners() {
1525
+ for (const e in this.events)
1526
+ this.events[e].clear();
1527
+ }
1528
+ /**
1529
+ * Attaches a passive effect to the `MotionValue`.
1530
+ */
1531
+ attach(e, n) {
1532
+ this.passiveEffect = e, this.stopPassiveEffect = n;
1533
+ }
1534
+ /**
1535
+ * Sets the state of the `MotionValue`.
1536
+ *
1537
+ * @remarks
1538
+ *
1539
+ * ```jsx
1540
+ * const x = useMotionValue(0)
1541
+ * x.set(10)
1542
+ * ```
1543
+ *
1544
+ * @param latest - Latest value to set.
1545
+ * @param render - Whether to notify render subscribers. Defaults to `true`
1546
+ *
1547
+ * @public
1548
+ */
1549
+ set(e) {
1550
+ this.passiveEffect ? this.passiveEffect(e, this.updateAndNotify) : this.updateAndNotify(e);
1551
+ }
1552
+ setWithVelocity(e, n, s) {
1553
+ this.set(n), this.prev = void 0, this.prevFrameValue = e, this.prevUpdatedAt = this.updatedAt - s;
1554
+ }
1555
+ /**
1556
+ * Set the state of the `MotionValue`, stopping any active animations,
1557
+ * effects, and resets velocity to `0`.
1558
+ */
1559
+ jump(e, n = !0) {
1560
+ this.updateAndNotify(e), this.prev = e, this.prevUpdatedAt = this.prevFrameValue = void 0, n && this.stop(), this.stopPassiveEffect && this.stopPassiveEffect();
1561
+ }
1562
+ dirty() {
1563
+ this.events.change?.notify(this.current);
1564
+ }
1565
+ addDependent(e) {
1566
+ this.dependents || (this.dependents = /* @__PURE__ */ new Set()), this.dependents.add(e);
1567
+ }
1568
+ removeDependent(e) {
1569
+ this.dependents && this.dependents.delete(e);
1570
+ }
1571
+ /**
1572
+ * Returns the latest state of `MotionValue`
1573
+ *
1574
+ * @returns - The latest state of `MotionValue`
1575
+ *
1576
+ * @public
1577
+ */
1578
+ get() {
1579
+ return ge.current && ge.current.push(this), this.current;
1580
+ }
1581
+ /**
1582
+ * @public
1583
+ */
1584
+ getPrevious() {
1585
+ return this.prev;
1586
+ }
1587
+ /**
1588
+ * Returns the latest velocity of `MotionValue`
1589
+ *
1590
+ * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical.
1591
+ *
1592
+ * @public
1593
+ */
1594
+ getVelocity() {
1595
+ const e = C.now();
1596
+ if (!this.canTrackVelocity || this.prevFrameValue === void 0 || e - this.updatedAt > me)
1597
+ return 0;
1598
+ const n = Math.min(this.updatedAt - this.prevUpdatedAt, me);
1599
+ return Ne(parseFloat(this.current) - parseFloat(this.prevFrameValue), n);
1600
+ }
1601
+ /**
1602
+ * Registers a new animation to control this `MotionValue`. Only one
1603
+ * animation can drive a `MotionValue` at one time.
1604
+ *
1605
+ * ```jsx
1606
+ * value.start()
1607
+ * ```
1608
+ *
1609
+ * @param animation - A function that starts the provided animation
1610
+ */
1611
+ start(e) {
1612
+ return this.stop(), new Promise((n) => {
1613
+ this.hasAnimated = !0, this.animation = e(n), this.events.animationStart && this.events.animationStart.notify();
1614
+ }).then(() => {
1615
+ this.events.animationComplete && this.events.animationComplete.notify(), this.clearAnimation();
1616
+ });
1617
+ }
1618
+ /**
1619
+ * Stop the currently active animation.
1620
+ *
1621
+ * @public
1622
+ */
1623
+ stop() {
1624
+ this.animation && (this.animation.stop(), this.events.animationCancel && this.events.animationCancel.notify()), this.clearAnimation();
1625
+ }
1626
+ /**
1627
+ * Returns `true` if this value is currently animating.
1628
+ *
1629
+ * @public
1630
+ */
1631
+ isAnimating() {
1632
+ return !!this.animation;
1633
+ }
1634
+ clearAnimation() {
1635
+ delete this.animation;
1636
+ }
1637
+ /**
1638
+ * Destroy and clean up subscribers to this `MotionValue`.
1639
+ *
1640
+ * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically
1641
+ * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually
1642
+ * created a `MotionValue` via the `motionValue` function.
1643
+ *
1644
+ * @public
1645
+ */
1646
+ destroy() {
1647
+ this.dependents?.clear(), this.events.destroy?.notify(), this.clearListeners(), this.stop(), this.stopPassiveEffect && this.stopPassiveEffect();
1648
+ }
1649
+ }
1650
+ function st(t, e) {
1651
+ return new Mi(t, e);
1652
+ }
1653
+ const Si = (t) => Array.isArray(t);
1654
+ function wi(t, e, n) {
1655
+ t.hasValue(e) ? t.getValue(e).set(n) : t.addValue(e, st(n));
1656
+ }
1657
+ function Ai(t) {
1658
+ return Si(t) ? t[t.length - 1] || 0 : t;
1659
+ }
1660
+ function Ci(t, e) {
1661
+ const n = vi(t, e);
1662
+ let { transitionEnd: s = {}, transition: i = {}, ...r } = n || {};
1663
+ r = { ...r, ...s };
1664
+ for (const a in r) {
1665
+ const o = Ai(r[a]);
1666
+ wi(t, a, o);
1667
+ }
1668
+ }
1669
+ const D = (t) => !!(t && t.getVelocity);
1670
+ function Di(t) {
1671
+ return !!(D(t) && t.add);
1672
+ }
1673
+ function Fi(t, e) {
1674
+ const n = t.getValue("willChange");
1675
+ if (Di(n))
1676
+ return n.add(e);
1677
+ if (!n && O.WillChange) {
1678
+ const s = new O.WillChange("auto");
1679
+ t.addValue("willChange", s), s.add(e);
1680
+ }
1681
+ }
1682
+ function Ht(t) {
1683
+ return t.replace(/([A-Z])/g, (e) => `-${e.toLowerCase()}`);
1684
+ }
1685
+ const Ri = "framerAppearId", Pi = "data-" + Ht(Ri);
1686
+ function Ei(t) {
1687
+ return t.props[Pi];
1688
+ }
1689
+ function ki({ protectedKeys: t, needsAnimating: e }, n) {
1690
+ const s = t.hasOwnProperty(n) && e[n] !== !0;
1691
+ return e[n] = !1, s;
1692
+ }
1693
+ function Er(t, e, { delay: n = 0, transitionOverride: s, type: i } = {}) {
1694
+ let { transition: r, transitionEnd: a, ...o } = e;
1695
+ const u = t.getDefaultTransition();
1696
+ r = r ? gn(r, u) : u;
1697
+ const c = r?.reduceMotion;
1698
+ s && (r = s);
1699
+ const l = [], f = i && t.animationState && t.animationState.getState()[i];
1700
+ for (const h in o) {
1701
+ const m = t.getValue(h, t.latestValues[h] ?? null), T = o[h];
1702
+ if (T === void 0 || f && ki(f, h))
1703
+ continue;
1704
+ const g = {
1705
+ delay: n,
1706
+ ...yn(r || {}, h)
1707
+ }, v = m.get();
1708
+ if (v !== void 0 && !m.isAnimating && !Array.isArray(T) && T === v && !g.velocity)
1709
+ continue;
1710
+ let x = !1;
1711
+ if (window.MotionHandoffAnimation) {
1712
+ const M = Ei(t);
1713
+ if (M) {
1714
+ const p = window.MotionHandoffAnimation(M, h, N);
1715
+ p !== null && (g.startTime = p, x = !0);
1716
+ }
1717
+ }
1718
+ Fi(t, h);
1719
+ const F = c ?? t.shouldReduceMotion;
1720
+ m.start(Tn(h, m, T, F && Vn.has(h) ? { type: !1 } : g, t, x));
1721
+ const b = m.animation;
1722
+ b && l.push(b);
1723
+ }
1724
+ if (a) {
1725
+ const h = () => N.update(() => {
1726
+ a && Ci(t, a);
1727
+ });
1728
+ l.length ? Promise.all(l).then(h) : h();
1729
+ }
1730
+ return l;
1731
+ }
1732
+ const Bi = {
1733
+ test: (t) => t === "auto",
1734
+ parse: (t) => t
1735
+ }, vn = (t) => (e) => e.test(t), xn = [z, d, G, I, rs, is, Bi], ye = (t) => xn.find(vn(t));
1736
+ function Oi(t) {
1737
+ return typeof t == "number" ? t === 0 : t !== null ? t === "none" || t === "0" || Ee(t) : !0;
1738
+ }
1739
+ const Ni = /* @__PURE__ */ new Set(["brightness", "contrast", "saturate", "opacity"]);
1740
+ function Ii(t) {
1741
+ const [e, n] = t.slice(0, -1).split("(");
1742
+ if (e === "drop-shadow")
1743
+ return t;
1744
+ const [s] = n.match(jt) || [];
1745
+ if (!s)
1746
+ return t;
1747
+ const i = n.replace(s, "");
1748
+ let r = Ni.has(e) ? 1 : 0;
1749
+ return s !== n && (r *= 100), e + "(" + r + i + ")";
1750
+ }
1751
+ const Ki = /\b([a-z-]*)\(.*?\)/gu, Ot = {
1752
+ ...E,
1753
+ getAnimatableNone: (t) => {
1754
+ const e = t.match(Ki);
1755
+ return e ? e.map(Ii).join(" ") : t;
1756
+ }
1757
+ }, Nt = {
1758
+ ...E,
1759
+ getAnimatableNone: (t) => {
1760
+ const e = E.parse(t);
1761
+ return E.createTransformer(t)(e.map((s) => typeof s == "number" ? 0 : typeof s == "object" ? { ...s, alpha: 1 } : s));
1762
+ }
1763
+ }, Te = {
1764
+ ...z,
1765
+ transform: Math.round
1766
+ }, $i = {
1767
+ rotate: I,
1768
+ rotateX: I,
1769
+ rotateY: I,
1770
+ rotateZ: I,
1771
+ scale: lt,
1772
+ scaleX: lt,
1773
+ scaleY: lt,
1774
+ scaleZ: lt,
1775
+ skew: I,
1776
+ skewX: I,
1777
+ skewY: I,
1778
+ distance: d,
1779
+ translateX: d,
1780
+ translateY: d,
1781
+ translateZ: d,
1782
+ x: d,
1783
+ y: d,
1784
+ z: d,
1785
+ perspective: d,
1786
+ transformPerspective: d,
1787
+ opacity: et,
1788
+ originX: se,
1789
+ originY: se,
1790
+ originZ: d
1791
+ }, Jt = {
1792
+ // Border props
1793
+ borderWidth: d,
1794
+ borderTopWidth: d,
1795
+ borderRightWidth: d,
1796
+ borderBottomWidth: d,
1797
+ borderLeftWidth: d,
1798
+ borderRadius: d,
1799
+ borderTopLeftRadius: d,
1800
+ borderTopRightRadius: d,
1801
+ borderBottomRightRadius: d,
1802
+ borderBottomLeftRadius: d,
1803
+ // Positioning props
1804
+ width: d,
1805
+ maxWidth: d,
1806
+ height: d,
1807
+ maxHeight: d,
1808
+ top: d,
1809
+ right: d,
1810
+ bottom: d,
1811
+ left: d,
1812
+ inset: d,
1813
+ insetBlock: d,
1814
+ insetBlockStart: d,
1815
+ insetBlockEnd: d,
1816
+ insetInline: d,
1817
+ insetInlineStart: d,
1818
+ insetInlineEnd: d,
1819
+ // Spacing props
1820
+ padding: d,
1821
+ paddingTop: d,
1822
+ paddingRight: d,
1823
+ paddingBottom: d,
1824
+ paddingLeft: d,
1825
+ paddingBlock: d,
1826
+ paddingBlockStart: d,
1827
+ paddingBlockEnd: d,
1828
+ paddingInline: d,
1829
+ paddingInlineStart: d,
1830
+ paddingInlineEnd: d,
1831
+ margin: d,
1832
+ marginTop: d,
1833
+ marginRight: d,
1834
+ marginBottom: d,
1835
+ marginLeft: d,
1836
+ marginBlock: d,
1837
+ marginBlockStart: d,
1838
+ marginBlockEnd: d,
1839
+ marginInline: d,
1840
+ marginInlineStart: d,
1841
+ marginInlineEnd: d,
1842
+ // Typography
1843
+ fontSize: d,
1844
+ // Misc
1845
+ backgroundPositionX: d,
1846
+ backgroundPositionY: d,
1847
+ ...$i,
1848
+ zIndex: Te,
1849
+ // SVG
1850
+ fillOpacity: et,
1851
+ strokeOpacity: et,
1852
+ numOctaves: Te
1853
+ }, Li = {
1854
+ ...Jt,
1855
+ // Color props
1856
+ color: w,
1857
+ backgroundColor: w,
1858
+ outlineColor: w,
1859
+ fill: w,
1860
+ stroke: w,
1861
+ // Border props
1862
+ borderColor: w,
1863
+ borderTopColor: w,
1864
+ borderRightColor: w,
1865
+ borderBottomColor: w,
1866
+ borderLeftColor: w,
1867
+ filter: Ot,
1868
+ WebkitFilter: Ot,
1869
+ mask: Nt,
1870
+ WebkitMask: Nt
1871
+ }, Mn = (t) => Li[t], _i = /* @__PURE__ */ new Set([Ot, Nt]);
1872
+ function Sn(t, e) {
1873
+ let n = Mn(t);
1874
+ return _i.has(n) || (n = E), n.getAnimatableNone ? n.getAnimatableNone(e) : void 0;
1875
+ }
1876
+ const Wi = /* @__PURE__ */ new Set(["auto", "none", "0"]);
1877
+ function ji(t, e, n) {
1878
+ let s = 0, i;
1879
+ for (; s < t.length && !i; ) {
1880
+ const r = t[s];
1881
+ typeof r == "string" && !Wi.has(r) && nt(r).values.length && (i = t[s]), s++;
1882
+ }
1883
+ if (i && n)
1884
+ for (const r of e)
1885
+ t[r] = Sn(n, i);
1886
+ }
1887
+ class Ui extends Zt {
1888
+ constructor(e, n, s, i, r) {
1889
+ super(e, n, s, i, r, !0);
1890
+ }
1891
+ readKeyframes() {
1892
+ const { unresolvedKeyframes: e, element: n, name: s } = this;
1893
+ if (!n || !n.current)
1894
+ return;
1895
+ super.readKeyframes();
1896
+ for (let l = 0; l < e.length; l++) {
1897
+ let f = e[l];
1898
+ if (typeof f == "string" && (f = f.trim(), Wt(f))) {
1899
+ const h = mn(f, n.current);
1900
+ h !== void 0 && (e[l] = h), l === e.length - 1 && (this.finalKeyframe = f);
1901
+ }
1902
+ }
1903
+ if (this.resolveNoneKeyframes(), !Vn.has(s) || e.length !== 2)
1904
+ return;
1905
+ const [i, r] = e, a = ye(i), o = ye(r), u = ne(i), c = ne(r);
1906
+ if (u !== c && K[s]) {
1907
+ this.needsMeasurement = !0;
1908
+ return;
1909
+ }
1910
+ if (a !== o)
1911
+ if (fe(a) && fe(o))
1912
+ for (let l = 0; l < e.length; l++) {
1913
+ const f = e[l];
1914
+ typeof f == "string" && (e[l] = parseFloat(f));
1915
+ }
1916
+ else K[s] && (this.needsMeasurement = !0);
1917
+ }
1918
+ resolveNoneKeyframes() {
1919
+ const { unresolvedKeyframes: e, name: n } = this, s = [];
1920
+ for (let i = 0; i < e.length; i++)
1921
+ (e[i] === null || Oi(e[i])) && s.push(i);
1922
+ s.length && ji(e, s, n);
1923
+ }
1924
+ measureInitialState() {
1925
+ const { element: e, unresolvedKeyframes: n, name: s } = this;
1926
+ if (!e || !e.current)
1927
+ return;
1928
+ s === "height" && (this.suspendedScrollY = window.pageYOffset), this.measuredOrigin = K[s](e.measureViewportBox(), window.getComputedStyle(e.current)), n[0] = this.measuredOrigin;
1929
+ const i = n[n.length - 1];
1930
+ i !== void 0 && e.getValue(s, i).jump(i, !1);
1931
+ }
1932
+ measureEndState() {
1933
+ const { element: e, name: n, unresolvedKeyframes: s } = this;
1934
+ if (!e || !e.current)
1935
+ return;
1936
+ const i = e.getValue(n);
1937
+ i && i.jump(this.measuredOrigin, !1);
1938
+ const r = s.length - 1, a = s[r];
1939
+ s[r] = K[n](e.measureViewportBox(), window.getComputedStyle(e.current)), a !== null && this.finalKeyframe === void 0 && (this.finalKeyframe = a), this.removedTransforms?.length && this.removedTransforms.forEach(([o, u]) => {
1940
+ e.getValue(o).set(u);
1941
+ }), this.resolveNoneKeyframes();
1942
+ }
1943
+ }
1944
+ const Yi = /* @__PURE__ */ new Set([
1945
+ "opacity",
1946
+ "clipPath",
1947
+ "filter",
1948
+ "transform"
1949
+ // TODO: Can be accelerated but currently disabled until https://issues.chromium.org/issues/41491098 is resolved
1950
+ // or until we implement support for linear() easing.
1951
+ // "background-color"
1952
+ ]);
1953
+ function kr(t, e, n) {
1954
+ if (t == null)
1955
+ return [];
1956
+ if (t instanceof EventTarget)
1957
+ return [t];
1958
+ if (typeof t == "string") {
1959
+ let s = document;
1960
+ e && (s = e.current);
1961
+ const i = n?.[t] ?? s.querySelectorAll(t);
1962
+ return i ? Array.from(i) : [];
1963
+ }
1964
+ return Array.from(t).filter((s) => s != null);
1965
+ }
1966
+ const wn = (t, e) => e && typeof t == "number" ? e.transform(t) : t, { schedule: Gi } = /* @__PURE__ */ Xe(queueMicrotask, !1);
1967
+ function Xi(t) {
1968
+ return $n(t) && "ownerSVGElement" in t;
1969
+ }
1970
+ function Br(t) {
1971
+ return Xi(t) && t.tagName === "svg";
1972
+ }
1973
+ const zi = [...xn, w, E], qi = (t) => zi.find(vn(t)), be = () => ({
1974
+ translate: 0,
1975
+ scale: 1,
1976
+ origin: 0,
1977
+ originPoint: 0
1978
+ }), Or = () => ({
1979
+ x: be(),
1980
+ y: be()
1981
+ }), Ve = () => ({ min: 0, max: 0 }), An = () => ({
1982
+ x: Ve(),
1983
+ y: Ve()
1984
+ }), Zi = /* @__PURE__ */ new WeakMap();
1985
+ function Hi(t) {
1986
+ return t !== null && typeof t == "object" && typeof t.start == "function";
1987
+ }
1988
+ function Ji(t) {
1989
+ return typeof t == "string" || Array.isArray(t);
1990
+ }
1991
+ const Qi = [
1992
+ "animate",
1993
+ "whileInView",
1994
+ "whileFocus",
1995
+ "whileHover",
1996
+ "whileTap",
1997
+ "whileDrag",
1998
+ "exit"
1999
+ ], tr = ["initial", ...Qi];
2000
+ function Cn(t) {
2001
+ return Hi(t.animate) || tr.some((e) => Ji(t[e]));
2002
+ }
2003
+ function er(t) {
2004
+ return !!(Cn(t) || t.variants);
2005
+ }
2006
+ function nr(t, e, n) {
2007
+ for (const s in e) {
2008
+ const i = e[s], r = n[s];
2009
+ if (D(i))
2010
+ t.addValue(s, i);
2011
+ else if (D(r))
2012
+ t.addValue(s, st(i, { owner: t }));
2013
+ else if (r !== i)
2014
+ if (t.hasValue(s)) {
2015
+ const a = t.getValue(s);
2016
+ a.liveStyle === !0 ? a.jump(i) : a.hasAnimated || a.set(i);
2017
+ } else {
2018
+ const a = t.getStaticValue(s);
2019
+ t.addValue(s, st(a !== void 0 ? a : i, { owner: t }));
2020
+ }
2021
+ }
2022
+ for (const s in n)
2023
+ e[s] === void 0 && t.removeValue(s);
2024
+ return e;
2025
+ }
2026
+ const It = { current: null }, Dn = { current: !1 }, sr = typeof window < "u";
2027
+ function ir() {
2028
+ if (Dn.current = !0, !!sr)
2029
+ if (window.matchMedia) {
2030
+ const t = window.matchMedia("(prefers-reduced-motion)"), e = () => It.current = t.matches;
2031
+ t.addEventListener("change", e), e();
2032
+ } else
2033
+ It.current = !1;
2034
+ }
2035
+ const ve = [
2036
+ "AnimationStart",
2037
+ "AnimationComplete",
2038
+ "Update",
2039
+ "BeforeLayoutMeasure",
2040
+ "LayoutMeasure",
2041
+ "LayoutAnimationStart",
2042
+ "LayoutAnimationComplete"
2043
+ ];
2044
+ let pt = {};
2045
+ function Nr(t) {
2046
+ pt = t;
2047
+ }
2048
+ function Ir() {
2049
+ return pt;
2050
+ }
2051
+ class rr {
2052
+ /**
2053
+ * This method takes React props and returns found MotionValues. For example, HTML
2054
+ * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays.
2055
+ *
2056
+ * This isn't an abstract method as it needs calling in the constructor, but it is
2057
+ * intended to be one.
2058
+ */
2059
+ scrapeMotionValuesFromProps(e, n, s) {
2060
+ return {};
2061
+ }
2062
+ constructor({ parent: e, props: n, presenceContext: s, reducedMotionConfig: i, skipAnimations: r, blockInitialAnimation: a, visualState: o }, u = {}) {
2063
+ this.current = null, this.children = /* @__PURE__ */ new Set(), this.isVariantNode = !1, this.isControllingVariants = !1, this.shouldReduceMotion = null, this.shouldSkipAnimations = !1, this.values = /* @__PURE__ */ new Map(), this.KeyframeResolver = Zt, this.features = {}, this.valueSubscriptions = /* @__PURE__ */ new Map(), this.prevMotionValues = {}, this.hasBeenMounted = !1, this.events = {}, this.propEventSubscriptions = {}, this.notifyUpdate = () => this.notify("Update", this.latestValues), this.render = () => {
2064
+ this.current && (this.triggerBuild(), this.renderInstance(this.current, this.renderState, this.props.style, this.projection));
2065
+ }, this.renderScheduledAt = 0, this.scheduleRender = () => {
2066
+ const m = C.now();
2067
+ this.renderScheduledAt < m && (this.renderScheduledAt = m, N.render(this.render, !1, !0));
2068
+ };
2069
+ const { latestValues: c, renderState: l } = o;
2070
+ this.latestValues = c, this.baseTarget = { ...c }, this.initialValues = n.initial ? { ...c } : {}, this.renderState = l, this.parent = e, this.props = n, this.presenceContext = s, this.depth = e ? e.depth + 1 : 0, this.reducedMotionConfig = i, this.skipAnimationsConfig = r, this.options = u, this.blockInitialAnimation = !!a, this.isControllingVariants = Cn(n), this.isVariantNode = er(n), this.isVariantNode && (this.variantChildren = /* @__PURE__ */ new Set()), this.manuallyAnimateOnMount = !!(e && e.current);
2071
+ const { willChange: f, ...h } = this.scrapeMotionValuesFromProps(n, {}, this);
2072
+ for (const m in h) {
2073
+ const T = h[m];
2074
+ c[m] !== void 0 && D(T) && T.set(c[m]);
2075
+ }
2076
+ }
2077
+ mount(e) {
2078
+ if (this.hasBeenMounted)
2079
+ for (const n in this.initialValues)
2080
+ this.values.get(n)?.jump(this.initialValues[n]), this.latestValues[n] = this.initialValues[n];
2081
+ this.current = e, Zi.set(e, this), this.projection && !this.projection.instance && this.projection.mount(e), this.parent && this.isVariantNode && !this.isControllingVariants && (this.removeFromVariantTree = this.parent.addVariantChild(this)), this.values.forEach((n, s) => this.bindToMotionValue(s, n)), this.reducedMotionConfig === "never" ? this.shouldReduceMotion = !1 : this.reducedMotionConfig === "always" ? this.shouldReduceMotion = !0 : (Dn.current || ir(), this.shouldReduceMotion = It.current), process.env.NODE_ENV !== "production" && Ie(this.shouldReduceMotion !== !0, "You have Reduced Motion enabled on your device. Animations may not appear as expected.", "reduced-motion-disabled"), this.shouldSkipAnimations = this.skipAnimationsConfig ?? !1, this.parent?.addChild(this), this.update(this.props, this.presenceContext), this.hasBeenMounted = !0;
2082
+ }
2083
+ unmount() {
2084
+ this.projection && this.projection.unmount(), xt(this.notifyUpdate), xt(this.render), this.valueSubscriptions.forEach((e) => e()), this.valueSubscriptions.clear(), this.removeFromVariantTree && this.removeFromVariantTree(), this.parent?.removeChild(this);
2085
+ for (const e in this.events)
2086
+ this.events[e].clear();
2087
+ for (const e in this.features) {
2088
+ const n = this.features[e];
2089
+ n && (n.unmount(), n.isMounted = !1);
2090
+ }
2091
+ this.current = null;
2092
+ }
2093
+ addChild(e) {
2094
+ this.children.add(e), this.enteringChildren ?? (this.enteringChildren = /* @__PURE__ */ new Set()), this.enteringChildren.add(e);
2095
+ }
2096
+ removeChild(e) {
2097
+ this.children.delete(e), this.enteringChildren && this.enteringChildren.delete(e);
2098
+ }
2099
+ bindToMotionValue(e, n) {
2100
+ if (this.valueSubscriptions.has(e) && this.valueSubscriptions.get(e)(), n.accelerate && Yi.has(e) && this.current instanceof HTMLElement) {
2101
+ const { factory: a, keyframes: o, times: u, ease: c, duration: l } = n.accelerate, f = new dn({
2102
+ element: this.current,
2103
+ name: e,
2104
+ keyframes: o,
2105
+ times: u,
2106
+ ease: c,
2107
+ duration: /* @__PURE__ */ k(l)
2108
+ }), h = a(f);
2109
+ this.valueSubscriptions.set(e, () => {
2110
+ h(), f.cancel();
2111
+ });
2112
+ return;
2113
+ }
2114
+ const s = H.has(e);
2115
+ s && this.onBindTransform && this.onBindTransform();
2116
+ const i = n.on("change", (a) => {
2117
+ this.latestValues[e] = a, this.props.onUpdate && N.preRender(this.notifyUpdate), s && this.projection && (this.projection.isTransformDirty = !0), this.scheduleRender();
2118
+ });
2119
+ let r;
2120
+ typeof window < "u" && window.MotionCheckAppearSync && (r = window.MotionCheckAppearSync(this, e, n)), this.valueSubscriptions.set(e, () => {
2121
+ i(), r && r(), n.owner && n.stop();
2122
+ });
2123
+ }
2124
+ sortNodePosition(e) {
2125
+ return !this.current || !this.sortInstanceNodePosition || this.type !== e.type ? 0 : this.sortInstanceNodePosition(this.current, e.current);
2126
+ }
2127
+ updateFeatures() {
2128
+ let e = "animation";
2129
+ for (e in pt) {
2130
+ const n = pt[e];
2131
+ if (!n)
2132
+ continue;
2133
+ const { isEnabled: s, Feature: i } = n;
2134
+ if (!this.features[e] && i && s(this.props) && (this.features[e] = new i(this)), this.features[e]) {
2135
+ const r = this.features[e];
2136
+ r.isMounted ? r.update() : (r.mount(), r.isMounted = !0);
2137
+ }
2138
+ }
2139
+ }
2140
+ triggerBuild() {
2141
+ this.build(this.renderState, this.latestValues, this.props);
2142
+ }
2143
+ /**
2144
+ * Measure the current viewport box with or without transforms.
2145
+ * Only measures axis-aligned boxes, rotate and skew must be manually
2146
+ * removed with a re-render to work.
2147
+ */
2148
+ measureViewportBox() {
2149
+ return this.current ? this.measureInstanceViewportBox(this.current, this.props) : An();
2150
+ }
2151
+ getStaticValue(e) {
2152
+ return this.latestValues[e];
2153
+ }
2154
+ setStaticValue(e, n) {
2155
+ this.latestValues[e] = n;
2156
+ }
2157
+ /**
2158
+ * Update the provided props. Ensure any newly-added motion values are
2159
+ * added to our map, old ones removed, and listeners updated.
2160
+ */
2161
+ update(e, n) {
2162
+ (e.transformTemplate || this.props.transformTemplate) && this.scheduleRender(), this.prevProps = this.props, this.props = e, this.prevPresenceContext = this.presenceContext, this.presenceContext = n;
2163
+ for (let s = 0; s < ve.length; s++) {
2164
+ const i = ve[s];
2165
+ this.propEventSubscriptions[i] && (this.propEventSubscriptions[i](), delete this.propEventSubscriptions[i]);
2166
+ const r = "on" + i, a = e[r];
2167
+ a && (this.propEventSubscriptions[i] = this.on(i, a));
2168
+ }
2169
+ this.prevMotionValues = nr(this, this.scrapeMotionValuesFromProps(e, this.prevProps || {}, this), this.prevMotionValues), this.handleChildMotionValue && this.handleChildMotionValue();
2170
+ }
2171
+ getProps() {
2172
+ return this.props;
2173
+ }
2174
+ /**
2175
+ * Returns the variant definition with a given name.
2176
+ */
2177
+ getVariant(e) {
2178
+ return this.props.variants ? this.props.variants[e] : void 0;
2179
+ }
2180
+ /**
2181
+ * Returns the defined default transition on this component.
2182
+ */
2183
+ getDefaultTransition() {
2184
+ return this.props.transition;
2185
+ }
2186
+ getTransformPagePoint() {
2187
+ return this.props.transformPagePoint;
2188
+ }
2189
+ getClosestVariantNode() {
2190
+ return this.isVariantNode ? this : this.parent ? this.parent.getClosestVariantNode() : void 0;
2191
+ }
2192
+ /**
2193
+ * Add a child visual element to our set of children.
2194
+ */
2195
+ addVariantChild(e) {
2196
+ const n = this.getClosestVariantNode();
2197
+ if (n)
2198
+ return n.variantChildren && n.variantChildren.add(e), () => n.variantChildren.delete(e);
2199
+ }
2200
+ /**
2201
+ * Add a motion value and bind it to this visual element.
2202
+ */
2203
+ addValue(e, n) {
2204
+ const s = this.values.get(e);
2205
+ n !== s && (s && this.removeValue(e), this.bindToMotionValue(e, n), this.values.set(e, n), this.latestValues[e] = n.get());
2206
+ }
2207
+ /**
2208
+ * Remove a motion value and unbind any active subscriptions.
2209
+ */
2210
+ removeValue(e) {
2211
+ this.values.delete(e);
2212
+ const n = this.valueSubscriptions.get(e);
2213
+ n && (n(), this.valueSubscriptions.delete(e)), delete this.latestValues[e], this.removeValueFromRenderState(e, this.renderState);
2214
+ }
2215
+ /**
2216
+ * Check whether we have a motion value for this key
2217
+ */
2218
+ hasValue(e) {
2219
+ return this.values.has(e);
2220
+ }
2221
+ getValue(e, n) {
2222
+ if (this.props.values && this.props.values[e])
2223
+ return this.props.values[e];
2224
+ let s = this.values.get(e);
2225
+ return s === void 0 && n !== void 0 && (s = st(n === null ? void 0 : n, { owner: this }), this.addValue(e, s)), s;
2226
+ }
2227
+ /**
2228
+ * If we're trying to animate to a previously unencountered value,
2229
+ * we need to check for it in our state and as a last resort read it
2230
+ * directly from the instance (which might have performance implications).
2231
+ */
2232
+ readValue(e, n) {
2233
+ let s = this.latestValues[e] !== void 0 || !this.current ? this.latestValues[e] : this.getBaseTargetFromProps(this.props, e) ?? this.readValueFromInstance(this.current, e, this.options);
2234
+ return s != null && (typeof s == "string" && (Pe(s) || Ee(s)) ? s = parseFloat(s) : !qi(s) && E.test(n) && (s = Sn(e, n)), this.setBaseTarget(e, D(s) ? s.get() : s)), D(s) ? s.get() : s;
2235
+ }
2236
+ /**
2237
+ * Set the base target to later animate back to. This is currently
2238
+ * only hydrated on creation and when we first read a value.
2239
+ */
2240
+ setBaseTarget(e, n) {
2241
+ this.baseTarget[e] = n;
2242
+ }
2243
+ /**
2244
+ * Find the base target for a value thats been removed from all animation
2245
+ * props.
2246
+ */
2247
+ getBaseTarget(e) {
2248
+ const { initial: n } = this.props;
2249
+ let s;
2250
+ if (typeof n == "string" || typeof n == "object") {
2251
+ const r = bn(this.props, n, this.presenceContext?.custom);
2252
+ r && (s = r[e]);
2253
+ }
2254
+ if (n && s !== void 0)
2255
+ return s;
2256
+ const i = this.getBaseTargetFromProps(this.props, e);
2257
+ return i !== void 0 && !D(i) ? i : this.initialValues[e] !== void 0 && s === void 0 ? void 0 : this.baseTarget[e];
2258
+ }
2259
+ on(e, n) {
2260
+ return this.events[e] || (this.events[e] = new Oe()), this.events[e].add(n);
2261
+ }
2262
+ notify(e, ...n) {
2263
+ this.events[e] && this.events[e].notify(...n);
2264
+ }
2265
+ scheduleRenderMicrotask() {
2266
+ Gi.render(this.render);
2267
+ }
2268
+ }
2269
+ class Fn extends rr {
2270
+ constructor() {
2271
+ super(...arguments), this.KeyframeResolver = Ui;
2272
+ }
2273
+ sortInstanceNodePosition(e, n) {
2274
+ return e.compareDocumentPosition(n) & 2 ? 1 : -1;
2275
+ }
2276
+ getBaseTargetFromProps(e, n) {
2277
+ const s = e.style;
2278
+ return s ? s[n] : void 0;
2279
+ }
2280
+ removeValueFromRenderState(e, { vars: n, style: s }) {
2281
+ delete n[e], delete s[e];
2282
+ }
2283
+ handleChildMotionValue() {
2284
+ this.childSubscription && (this.childSubscription(), delete this.childSubscription);
2285
+ const { children: e } = this.props;
2286
+ D(e) && (this.childSubscription = e.on("change", (n) => {
2287
+ this.current && (this.current.textContent = `${n}`);
2288
+ }));
2289
+ }
2290
+ }
2291
+ function ar({ top: t, left: e, right: n, bottom: s }) {
2292
+ return {
2293
+ x: { min: e, max: n },
2294
+ y: { min: t, max: s }
2295
+ };
2296
+ }
2297
+ function Kr({ x: t, y: e }) {
2298
+ return { top: e.min, right: t.max, bottom: e.max, left: t.min };
2299
+ }
2300
+ function or(t, e) {
2301
+ if (!e)
2302
+ return t;
2303
+ const n = e({ x: t.left, y: t.top }), s = e({ x: t.right, y: t.bottom });
2304
+ return {
2305
+ top: n.y,
2306
+ left: n.x,
2307
+ bottom: s.y,
2308
+ right: s.x
2309
+ };
2310
+ }
2311
+ function Vt(t) {
2312
+ return t === void 0 || t === 1;
2313
+ }
2314
+ function lr({ scale: t, scaleX: e, scaleY: n }) {
2315
+ return !Vt(t) || !Vt(e) || !Vt(n);
2316
+ }
2317
+ function ur(t) {
2318
+ return lr(t) || cr(t) || t.z || t.rotate || t.rotateX || t.rotateY || t.skewX || t.skewY;
2319
+ }
2320
+ function cr(t) {
2321
+ return xe(t.x) || xe(t.y);
2322
+ }
2323
+ function xe(t) {
2324
+ return t && t !== "0%";
2325
+ }
2326
+ function Me(t, e, n) {
2327
+ const s = t - n, i = e * s;
2328
+ return n + i;
2329
+ }
2330
+ function Se(t, e, n, s, i) {
2331
+ return i !== void 0 && (t = Me(t, i, s)), Me(t, n, s) + e;
2332
+ }
2333
+ function Kt(t, e = 0, n = 1, s, i) {
2334
+ t.min = Se(t.min, e, n, s, i), t.max = Se(t.max, e, n, s, i);
2335
+ }
2336
+ function fr(t, { x: e, y: n }) {
2337
+ Kt(t.x, e.translate, e.scale, e.originPoint), Kt(t.y, n.translate, n.scale, n.originPoint);
2338
+ }
2339
+ const we = 0.999999999999, Ae = 1.0000000000001;
2340
+ function $r(t, e, n, s = !1) {
2341
+ const i = n.length;
2342
+ if (!i)
2343
+ return;
2344
+ e.x = e.y = 1;
2345
+ let r, a;
2346
+ for (let o = 0; o < i; o++) {
2347
+ r = n[o], a = r.projectionDelta;
2348
+ const { visualElement: u } = r.options;
2349
+ u && u.props.style && u.props.style.display === "contents" || (s && r.options.layoutScroll && r.scroll && r !== r.root && Fe(t, {
2350
+ x: -r.scroll.offset.x,
2351
+ y: -r.scroll.offset.y
2352
+ }), a && (e.x *= a.x.scale, e.y *= a.y.scale, fr(t, a)), s && ur(r.latestValues) && Fe(t, r.latestValues));
2353
+ }
2354
+ e.x < Ae && e.x > we && (e.x = 1), e.y < Ae && e.y > we && (e.y = 1);
2355
+ }
2356
+ function Ce(t, e) {
2357
+ t.min = t.min + e, t.max = t.max + e;
2358
+ }
2359
+ function De(t, e, n, s, i = 0.5) {
2360
+ const r = q(t.min, t.max, i);
2361
+ Kt(t, e, n, r, s);
2362
+ }
2363
+ function Fe(t, e) {
2364
+ De(t.x, e.x, e.scaleX, e.scale, e.originX), De(t.y, e.y, e.scaleY, e.scale, e.originY);
2365
+ }
2366
+ function Rn(t, e) {
2367
+ return ar(or(t.getBoundingClientRect(), e));
2368
+ }
2369
+ function Lr(t, e, n) {
2370
+ const s = Rn(t, n), { scroll: i } = e;
2371
+ return i && (Ce(s.x, i.offset.x), Ce(s.y, i.offset.y)), s;
2372
+ }
2373
+ const hr = {
2374
+ x: "translateX",
2375
+ y: "translateY",
2376
+ z: "translateZ",
2377
+ transformPerspective: "perspective"
2378
+ }, dr = Z.length;
2379
+ function pr(t, e, n) {
2380
+ let s = "", i = !0;
2381
+ for (let r = 0; r < dr; r++) {
2382
+ const a = Z[r], o = t[a];
2383
+ if (o === void 0)
2384
+ continue;
2385
+ let u = !0;
2386
+ if (typeof o == "number")
2387
+ u = o === (a.startsWith("scale") ? 1 : 0);
2388
+ else {
2389
+ const c = parseFloat(o);
2390
+ u = a.startsWith("scale") ? c === 1 : c === 0;
2391
+ }
2392
+ if (!u || n) {
2393
+ const c = wn(o, Jt[a]);
2394
+ if (!u) {
2395
+ i = !1;
2396
+ const l = hr[a] || a;
2397
+ s += `${l}(${c}) `;
2398
+ }
2399
+ n && (e[a] = c);
2400
+ }
2401
+ }
2402
+ return s = s.trim(), n ? s = n(e, i ? "" : s) : i && (s = "none"), s;
2403
+ }
2404
+ function Pn(t, e, n) {
2405
+ const { style: s, vars: i, transformOrigin: r } = t;
2406
+ let a = !1, o = !1;
2407
+ for (const u in e) {
2408
+ const c = e[u];
2409
+ if (H.has(u)) {
2410
+ a = !0;
2411
+ continue;
2412
+ } else if (qe(u)) {
2413
+ i[u] = c;
2414
+ continue;
2415
+ } else {
2416
+ const l = wn(c, Jt[u]);
2417
+ u.startsWith("origin") ? (o = !0, r[u] = l) : s[u] = l;
2418
+ }
2419
+ }
2420
+ if (e.transform || (a || n ? s.transform = pr(e, t.transform, n) : s.transform && (s.transform = "none")), o) {
2421
+ const { originX: u = "50%", originY: c = "50%", originZ: l = 0 } = r;
2422
+ s.transformOrigin = `${u} ${c} ${l}`;
2423
+ }
2424
+ }
2425
+ function En(t, { style: e, vars: n }, s, i) {
2426
+ const r = t.style;
2427
+ let a;
2428
+ for (a in e)
2429
+ r[a] = e[a];
2430
+ i?.applyProjectionStyles(r, s);
2431
+ for (a in n)
2432
+ r.setProperty(a, n[a]);
2433
+ }
2434
+ function Re(t, e) {
2435
+ return e.max === e.min ? 0 : t / (e.max - e.min) * 100;
2436
+ }
2437
+ const J = {
2438
+ correct: (t, e) => {
2439
+ if (!e.target)
2440
+ return t;
2441
+ if (typeof t == "string")
2442
+ if (d.test(t))
2443
+ t = parseFloat(t);
2444
+ else
2445
+ return t;
2446
+ const n = Re(t, e.target.x), s = Re(t, e.target.y);
2447
+ return `${n}% ${s}%`;
2448
+ }
2449
+ }, mr = {
2450
+ correct: (t, { treeScale: e, projectionDelta: n }) => {
2451
+ const s = t, i = E.parse(t);
2452
+ if (i.length > 5)
2453
+ return s;
2454
+ const r = E.createTransformer(t), a = typeof i[0] != "number" ? 1 : 0, o = n.x.scale * e.x, u = n.y.scale * e.y;
2455
+ i[0 + a] /= o, i[1 + a] /= u;
2456
+ const c = q(o, u, 0.5);
2457
+ return typeof i[2 + a] == "number" && (i[2 + a] /= c), typeof i[3 + a] == "number" && (i[3 + a] /= c), r(i);
2458
+ }
2459
+ }, gr = {
2460
+ borderRadius: {
2461
+ ...J,
2462
+ applyTo: [
2463
+ "borderTopLeftRadius",
2464
+ "borderTopRightRadius",
2465
+ "borderBottomLeftRadius",
2466
+ "borderBottomRightRadius"
2467
+ ]
2468
+ },
2469
+ borderTopLeftRadius: J,
2470
+ borderTopRightRadius: J,
2471
+ borderBottomLeftRadius: J,
2472
+ borderBottomRightRadius: J,
2473
+ boxShadow: mr
2474
+ };
2475
+ function yr(t, { layout: e, layoutId: n }) {
2476
+ return H.has(t) || t.startsWith("origin") || (e || n !== void 0) && (!!gr[t] || t === "opacity");
2477
+ }
2478
+ function kn(t, e, n) {
2479
+ const s = t.style, i = e?.style, r = {};
2480
+ if (!s)
2481
+ return r;
2482
+ for (const a in s)
2483
+ (D(s[a]) || i && D(i[a]) || yr(a, t) || n?.getValue(a)?.liveStyle !== void 0) && (r[a] = s[a]);
2484
+ return r;
2485
+ }
2486
+ function Tr(t) {
2487
+ return window.getComputedStyle(t);
2488
+ }
2489
+ class _r extends Fn {
2490
+ constructor() {
2491
+ super(...arguments), this.type = "html", this.renderInstance = En;
2492
+ }
2493
+ readValueFromInstance(e, n) {
2494
+ if (H.has(n))
2495
+ return this.projection?.isProjecting ? Ft(n) : Ws(e, n);
2496
+ {
2497
+ const s = Tr(e), i = (qe(n) ? s.getPropertyValue(n) : s[n]) || 0;
2498
+ return typeof i == "string" ? i.trim() : i;
2499
+ }
2500
+ }
2501
+ measureInstanceViewportBox(e, { transformPagePoint: n }) {
2502
+ return Rn(e, n);
2503
+ }
2504
+ build(e, n, s) {
2505
+ Pn(e, n, s.transformTemplate);
2506
+ }
2507
+ scrapeMotionValuesFromProps(e, n, s) {
2508
+ return kn(e, n, s);
2509
+ }
2510
+ }
2511
+ const br = {
2512
+ offset: "stroke-dashoffset",
2513
+ array: "stroke-dasharray"
2514
+ }, Vr = {
2515
+ offset: "strokeDashoffset",
2516
+ array: "strokeDasharray"
2517
+ };
2518
+ function vr(t, e, n = 1, s = 0, i = !0) {
2519
+ t.pathLength = 1;
2520
+ const r = i ? br : Vr;
2521
+ t[r.offset] = `${-s}`, t[r.array] = `${e} ${n}`;
2522
+ }
2523
+ const xr = [
2524
+ "offsetDistance",
2525
+ "offsetPath",
2526
+ "offsetRotate",
2527
+ "offsetAnchor"
2528
+ ];
2529
+ function Mr(t, {
2530
+ attrX: e,
2531
+ attrY: n,
2532
+ attrScale: s,
2533
+ pathLength: i,
2534
+ pathSpacing: r = 1,
2535
+ pathOffset: a = 0,
2536
+ // This is object creation, which we try to avoid per-frame.
2537
+ ...o
2538
+ }, u, c, l) {
2539
+ if (Pn(t, o, c), u) {
2540
+ t.style.viewBox && (t.attrs.viewBox = t.style.viewBox);
2541
+ return;
2542
+ }
2543
+ t.attrs = t.style, t.style = {};
2544
+ const { attrs: f, style: h } = t;
2545
+ f.transform && (h.transform = f.transform, delete f.transform), (h.transform || f.transformOrigin) && (h.transformOrigin = f.transformOrigin ?? "50% 50%", delete f.transformOrigin), h.transform && (h.transformBox = l?.transformBox ?? "fill-box", delete f.transformBox);
2546
+ for (const m of xr)
2547
+ f[m] !== void 0 && (h[m] = f[m], delete f[m]);
2548
+ e !== void 0 && (f.x = e), n !== void 0 && (f.y = n), s !== void 0 && (f.scale = s), i !== void 0 && vr(f, i, r, a, !1);
2549
+ }
2550
+ const Bn = /* @__PURE__ */ new Set([
2551
+ "baseFrequency",
2552
+ "diffuseConstant",
2553
+ "kernelMatrix",
2554
+ "kernelUnitLength",
2555
+ "keySplines",
2556
+ "keyTimes",
2557
+ "limitingConeAngle",
2558
+ "markerHeight",
2559
+ "markerWidth",
2560
+ "numOctaves",
2561
+ "targetX",
2562
+ "targetY",
2563
+ "surfaceScale",
2564
+ "specularConstant",
2565
+ "specularExponent",
2566
+ "stdDeviation",
2567
+ "tableValues",
2568
+ "viewBox",
2569
+ "gradientTransform",
2570
+ "pathLength",
2571
+ "startOffset",
2572
+ "textLength",
2573
+ "lengthAdjust"
2574
+ ]), Sr = (t) => typeof t == "string" && t.toLowerCase() === "svg";
2575
+ function wr(t, e, n, s) {
2576
+ En(t, e, void 0, s);
2577
+ for (const i in e.attrs)
2578
+ t.setAttribute(Bn.has(i) ? i : Ht(i), e.attrs[i]);
2579
+ }
2580
+ function Ar(t, e, n) {
2581
+ const s = kn(t, e, n);
2582
+ for (const i in t)
2583
+ if (D(t[i]) || D(e[i])) {
2584
+ const r = Z.indexOf(i) !== -1 ? "attr" + i.charAt(0).toUpperCase() + i.substring(1) : i;
2585
+ s[r] = t[i];
2586
+ }
2587
+ return s;
2588
+ }
2589
+ class Wr extends Fn {
2590
+ constructor() {
2591
+ super(...arguments), this.type = "svg", this.isSVGTag = !1, this.measureInstanceViewportBox = An;
2592
+ }
2593
+ getBaseTargetFromProps(e, n) {
2594
+ return e[n];
2595
+ }
2596
+ readValueFromInstance(e, n) {
2597
+ if (H.has(n)) {
2598
+ const s = Mn(n);
2599
+ return s && s.default || 0;
2600
+ }
2601
+ return n = Bn.has(n) ? n : Ht(n), e.getAttribute(n);
2602
+ }
2603
+ scrapeMotionValuesFromProps(e, n, s) {
2604
+ return Ar(e, n, s);
2605
+ }
2606
+ build(e, n, s) {
2607
+ Mr(e, n, this.isSVGTag, s.transformTemplate, s.style);
2608
+ }
2609
+ renderInstance(e, n, s, i) {
2610
+ wr(e, n, s, i);
2611
+ }
2612
+ mount(e) {
2613
+ this.isSVGTag = Sr(e.tagName), super.mount(e);
2614
+ }
2615
+ }
2616
+ function jr(t, e, n) {
2617
+ const s = D(t) ? t : st(t);
2618
+ return s.start(Tn("", s, e, n)), s.animation;
2619
+ }
2620
+ const Ur = Nn({
2621
+ transformPagePoint: (t) => t,
2622
+ isStatic: !1,
2623
+ reducedMotion: "never"
2624
+ });
2625
+ export {
2626
+ ct as $,
2627
+ gn as A,
2628
+ Ps as B,
2629
+ N as C,
2630
+ xt as D,
2631
+ ge as E,
2632
+ Rr as F,
2633
+ vi as G,
2634
+ _r as H,
2635
+ $n as I,
2636
+ Ji as J,
2637
+ tr as K,
2638
+ Hi as L,
2639
+ Ur as M,
2640
+ Si as N,
2641
+ Qi as O,
2642
+ G as P,
2643
+ Me as Q,
2644
+ d as R,
2645
+ Wr as S,
2646
+ X as T,
2647
+ Un as U,
2648
+ rr as V,
2649
+ In as W,
2650
+ C as X,
2651
+ Oe as Y,
2652
+ yn as Z,
2653
+ $ as _,
2654
+ Xn as a,
2655
+ Pr as a0,
2656
+ Gi as a1,
2657
+ ur as a2,
2658
+ Ce as a3,
2659
+ Fe as a4,
2660
+ lr as a5,
2661
+ fr as a6,
2662
+ cr as a7,
2663
+ $r as a8,
2664
+ Or as a9,
2665
+ gr as aa,
2666
+ Ei as ab,
2667
+ Ir as ac,
2668
+ Nr as ad,
2669
+ Cn as ae,
2670
+ yr as af,
2671
+ Pn as ag,
2672
+ Mr as ah,
2673
+ Sr as ai,
2674
+ er as aj,
2675
+ bn as ak,
2676
+ kn as al,
2677
+ Ar as am,
2678
+ Pi as an,
2679
+ it as ao,
2680
+ $t as ap,
2681
+ P as aq,
2682
+ Lr as ar,
2683
+ Kr as as,
2684
+ ar as at,
2685
+ Fi as au,
2686
+ Tn as av,
2687
+ Kn as b,
2688
+ An as c,
2689
+ D as d,
2690
+ ee as e,
2691
+ ks as f,
2692
+ xs as g,
2693
+ Dn as h,
2694
+ ir as i,
2695
+ Es as j,
2696
+ hn as k,
2697
+ j as l,
2698
+ q as m,
2699
+ Be as n,
2700
+ Xi as o,
2701
+ It as p,
2702
+ Br as q,
2703
+ kr as r,
2704
+ k as s,
2705
+ jr as t,
2706
+ Fr as u,
2707
+ Zi as v,
2708
+ Ie as w,
2709
+ Er as x,
2710
+ st as y,
2711
+ dt as z
2712
+ };
2713
+ //# sourceMappingURL=MotionConfigContext-C7MqlSdv.js.map