motion-v 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/LICENSE +21 -0
  2. package/dist/index.js +3722 -0
  3. package/dist/index.umd.cjs +1 -0
  4. package/dist/src/components/AnimatePresence.d.ts +51 -0
  5. package/dist/src/components/Motion.d.ts +29 -0
  6. package/dist/src/components/Primitive.d.ts +39 -0
  7. package/dist/src/components/Slot.d.ts +5 -0
  8. package/dist/src/components/context.d.ts +7 -0
  9. package/dist/src/components/presence.d.ts +7 -0
  10. package/dist/src/components/renderSlotFragments.d.ts +2 -0
  11. package/dist/src/components/usePrimitiveElement.d.ts +5 -0
  12. package/dist/src/components/utils.d.ts +3 -0
  13. package/dist/src/index.d.ts +3 -0
  14. package/dist/src/shared/index.d.ts +0 -0
  15. package/dist/src/state/event.d.ts +6 -0
  16. package/dist/src/state/features/events.d.ts +6 -0
  17. package/dist/src/state/features/feature.d.ts +15 -0
  18. package/dist/src/state/features/gestures/base.d.ts +10 -0
  19. package/dist/src/state/features/gestures/hover.d.ts +10 -0
  20. package/dist/src/state/features/gestures/in-view.d.ts +8 -0
  21. package/dist/src/state/features/gestures/index.d.ts +4 -0
  22. package/dist/src/state/features/gestures/press.d.ts +8 -0
  23. package/dist/src/state/features/gestures/types.d.ts +9 -0
  24. package/dist/src/state/features/index.d.ts +3 -0
  25. package/dist/src/state/index.d.ts +1 -0
  26. package/dist/src/state/motion-state.d.ts +31 -0
  27. package/dist/src/state/schedule.d.ts +3 -0
  28. package/dist/src/state/style.d.ts +6 -0
  29. package/dist/src/state/transform.d.ts +25 -0
  30. package/dist/src/state/types.d.ts +56 -0
  31. package/dist/src/state/utils.d.ts +16 -0
  32. package/dist/src/types/index.d.ts +14 -0
  33. package/dist/src/utils/createContext.d.ts +8 -0
  34. package/dist/src/utils/events.d.ts +2 -0
  35. package/dist/src/utils/index.d.ts +1 -0
  36. package/package.json +42 -0
package/dist/index.js ADDED
@@ -0,0 +1,3722 @@
1
+ import { unref as Cn, ref as Fn, computed as zs, inject as js, provide as Us, Fragment as Hs, defineComponent as Pt, Comment as qs, mergeProps as ee, cloneVNode as Ys, h as Rt, mergeDefaults as Xs, onMounted as Zs, onUnmounted as Qs, onUpdated as Js, openBlock as On, createBlock as Dn, withCtx as Rn, renderSlot as In, toRefs as ti, resolveDynamicComponent as ei, TransitionGroup as ni, Transition as si } from "vue";
2
+ function ii(e, t) {
3
+ e.indexOf(t) === -1 && e.push(t);
4
+ }
5
+ function Bn(e, t) {
6
+ const n = e.indexOf(t);
7
+ n > -1 && e.splice(n, 1);
8
+ }
9
+ class Ln {
10
+ constructor() {
11
+ this.subscriptions = [];
12
+ }
13
+ add(t) {
14
+ return ii(this.subscriptions, t), () => Bn(this.subscriptions, t);
15
+ }
16
+ notify(t, n, s) {
17
+ const i = this.subscriptions.length;
18
+ if (i)
19
+ if (i === 1)
20
+ this.subscriptions[0](t, n, s);
21
+ else
22
+ for (let r = 0; r < i; r++) {
23
+ const o = this.subscriptions[r];
24
+ o && o(t, n, s);
25
+ }
26
+ }
27
+ getSize() {
28
+ return this.subscriptions.length;
29
+ }
30
+ clear() {
31
+ this.subscriptions.length = 0;
32
+ }
33
+ }
34
+ function ne(e, t) {
35
+ return t ? e * (1e3 / t) : 0;
36
+ }
37
+ const Ne = /* @__PURE__ */ new Set();
38
+ function Ct(e, t, n) {
39
+ e || Ne.has(t) || (console.warn(t), Ne.add(t));
40
+ }
41
+ const ri = {
42
+ skipAnimations: !1,
43
+ useManualTiming: !1
44
+ }, N = (e) => e;
45
+ function oi(e) {
46
+ let t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), s = !1, i = !1;
47
+ const r = /* @__PURE__ */ new WeakSet();
48
+ let o = {
49
+ delta: 0,
50
+ timestamp: 0,
51
+ isProcessing: !1
52
+ };
53
+ function a(u) {
54
+ r.has(u) && (l.schedule(u), e()), u(o);
55
+ }
56
+ const l = {
57
+ /**
58
+ * Schedule a process to run on the next frame.
59
+ */
60
+ schedule: (u, c = !1, f = !1) => {
61
+ const p = f && s ? t : n;
62
+ return c && r.add(u), p.has(u) || p.add(u), u;
63
+ },
64
+ /**
65
+ * Cancel the provided callback from running on the next frame.
66
+ */
67
+ cancel: (u) => {
68
+ n.delete(u), r.delete(u);
69
+ },
70
+ /**
71
+ * Execute all schedule callbacks.
72
+ */
73
+ process: (u) => {
74
+ if (o = u, s) {
75
+ i = !0;
76
+ return;
77
+ }
78
+ s = !0, [t, n] = [n, t], n.clear(), t.forEach(a), s = !1, i && (i = !1, l.process(u));
79
+ }
80
+ };
81
+ return l;
82
+ }
83
+ const J = [
84
+ "read",
85
+ // Read
86
+ "resolveKeyframes",
87
+ // Write/Read/Write/Read
88
+ "update",
89
+ // Compute
90
+ "preRender",
91
+ // Compute
92
+ "render",
93
+ // Write
94
+ "postRender"
95
+ // Compute
96
+ ], ai = 40;
97
+ function li(e, t) {
98
+ let n = !1, s = !0;
99
+ const i = {
100
+ delta: 0,
101
+ timestamp: 0,
102
+ isProcessing: !1
103
+ }, r = () => n = !0, o = J.reduce((g, y) => (g[y] = oi(r), g), {}), { read: a, resolveKeyframes: l, update: u, preRender: c, render: f, postRender: h } = o, p = () => {
104
+ const g = performance.now();
105
+ n = !1, i.delta = s ? 1e3 / 60 : Math.max(Math.min(g - i.timestamp, ai), 1), i.timestamp = g, i.isProcessing = !0, a.process(i), l.process(i), u.process(i), c.process(i), f.process(i), h.process(i), i.isProcessing = !1, n && t && (s = !1, e(p));
106
+ }, m = () => {
107
+ n = !0, s = !0, i.isProcessing || e(p);
108
+ };
109
+ return { schedule: J.reduce((g, y) => {
110
+ const S = o[y];
111
+ return g[y] = (x, T = !1, A = !1) => (n || m(), S.schedule(x, T, A)), g;
112
+ }, {}), cancel: (g) => {
113
+ for (let y = 0; y < J.length; y++)
114
+ o[J[y]].cancel(g);
115
+ }, state: i, steps: o };
116
+ }
117
+ const { schedule: M, cancel: _, state: st, steps: yl } = li(typeof requestAnimationFrame < "u" ? requestAnimationFrame : N, !0);
118
+ let vt;
119
+ function ui() {
120
+ vt = void 0;
121
+ }
122
+ const B = {
123
+ now: () => (vt === void 0 && B.set(st.isProcessing || ri.useManualTiming ? st.timestamp : performance.now()), vt),
124
+ set: (e) => {
125
+ vt = e, queueMicrotask(ui);
126
+ }
127
+ }, $e = 30, ci = (e) => !isNaN(parseFloat(e));
128
+ class fi {
129
+ /**
130
+ * @param init - The initiating value
131
+ * @param config - Optional configuration options
132
+ *
133
+ * - `transformer`: A function to transform incoming values with.
134
+ *
135
+ * @internal
136
+ */
137
+ constructor(t, n = {}) {
138
+ this.version = "11.11.11", this.canTrackVelocity = null, this.events = {}, this.updateAndNotify = (s, i = !0) => {
139
+ const r = B.now();
140
+ this.updatedAt !== r && this.setPrevFrameValue(), this.prev = this.current, this.setCurrent(s), this.current !== this.prev && this.events.change && this.events.change.notify(this.current), i && this.events.renderRequest && this.events.renderRequest.notify(this.current);
141
+ }, this.hasAnimated = !1, this.setCurrent(t), this.owner = n.owner;
142
+ }
143
+ setCurrent(t) {
144
+ this.current = t, this.updatedAt = B.now(), this.canTrackVelocity === null && t !== void 0 && (this.canTrackVelocity = ci(this.current));
145
+ }
146
+ setPrevFrameValue(t = this.current) {
147
+ this.prevFrameValue = t, this.prevUpdatedAt = this.updatedAt;
148
+ }
149
+ /**
150
+ * Adds a function that will be notified when the `MotionValue` is updated.
151
+ *
152
+ * It returns a function that, when called, will cancel the subscription.
153
+ *
154
+ * When calling `onChange` inside a React component, it should be wrapped with the
155
+ * `useEffect` hook. As it returns an unsubscribe function, this should be returned
156
+ * from the `useEffect` function to ensure you don't add duplicate subscribers..
157
+ *
158
+ * ```jsx
159
+ * export const MyComponent = () => {
160
+ * const x = useMotionValue(0)
161
+ * const y = useMotionValue(0)
162
+ * const opacity = useMotionValue(1)
163
+ *
164
+ * useEffect(() => {
165
+ * function updateOpacity() {
166
+ * const maxXY = Math.max(x.get(), y.get())
167
+ * const newOpacity = transform(maxXY, [0, 100], [1, 0])
168
+ * opacity.set(newOpacity)
169
+ * }
170
+ *
171
+ * const unsubscribeX = x.on("change", updateOpacity)
172
+ * const unsubscribeY = y.on("change", updateOpacity)
173
+ *
174
+ * return () => {
175
+ * unsubscribeX()
176
+ * unsubscribeY()
177
+ * }
178
+ * }, [])
179
+ *
180
+ * return <motion.div style={{ x }} />
181
+ * }
182
+ * ```
183
+ *
184
+ * @param subscriber - A function that receives the latest value.
185
+ * @returns A function that, when called, will cancel this subscription.
186
+ *
187
+ * @deprecated
188
+ */
189
+ onChange(t) {
190
+ return process.env.NODE_ENV !== "production" && Ct(!1, 'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'), this.on("change", t);
191
+ }
192
+ on(t, n) {
193
+ this.events[t] || (this.events[t] = new Ln());
194
+ const s = this.events[t].add(n);
195
+ return t === "change" ? () => {
196
+ s(), M.read(() => {
197
+ this.events.change.getSize() || this.stop();
198
+ });
199
+ } : s;
200
+ }
201
+ clearListeners() {
202
+ for (const t in this.events)
203
+ this.events[t].clear();
204
+ }
205
+ /**
206
+ * Attaches a passive effect to the `MotionValue`.
207
+ *
208
+ * @internal
209
+ */
210
+ attach(t, n) {
211
+ this.passiveEffect = t, this.stopPassiveEffect = n;
212
+ }
213
+ /**
214
+ * Sets the state of the `MotionValue`.
215
+ *
216
+ * @remarks
217
+ *
218
+ * ```jsx
219
+ * const x = useMotionValue(0)
220
+ * x.set(10)
221
+ * ```
222
+ *
223
+ * @param latest - Latest value to set.
224
+ * @param render - Whether to notify render subscribers. Defaults to `true`
225
+ *
226
+ * @public
227
+ */
228
+ set(t, n = !0) {
229
+ !n || !this.passiveEffect ? this.updateAndNotify(t, n) : this.passiveEffect(t, this.updateAndNotify);
230
+ }
231
+ setWithVelocity(t, n, s) {
232
+ this.set(n), this.prev = void 0, this.prevFrameValue = t, this.prevUpdatedAt = this.updatedAt - s;
233
+ }
234
+ /**
235
+ * Set the state of the `MotionValue`, stopping any active animations,
236
+ * effects, and resets velocity to `0`.
237
+ */
238
+ jump(t, n = !0) {
239
+ this.updateAndNotify(t), this.prev = t, this.prevUpdatedAt = this.prevFrameValue = void 0, n && this.stop(), this.stopPassiveEffect && this.stopPassiveEffect();
240
+ }
241
+ /**
242
+ * Returns the latest state of `MotionValue`
243
+ *
244
+ * @returns - The latest state of `MotionValue`
245
+ *
246
+ * @public
247
+ */
248
+ get() {
249
+ return this.current;
250
+ }
251
+ /**
252
+ * @public
253
+ */
254
+ getPrevious() {
255
+ return this.prev;
256
+ }
257
+ /**
258
+ * Returns the latest velocity of `MotionValue`
259
+ *
260
+ * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical.
261
+ *
262
+ * @public
263
+ */
264
+ getVelocity() {
265
+ const t = B.now();
266
+ if (!this.canTrackVelocity || this.prevFrameValue === void 0 || t - this.updatedAt > $e)
267
+ return 0;
268
+ const n = Math.min(this.updatedAt - this.prevUpdatedAt, $e);
269
+ return ne(parseFloat(this.current) - parseFloat(this.prevFrameValue), n);
270
+ }
271
+ /**
272
+ * Registers a new animation to control this `MotionValue`. Only one
273
+ * animation can drive a `MotionValue` at one time.
274
+ *
275
+ * ```jsx
276
+ * value.start()
277
+ * ```
278
+ *
279
+ * @param animation - A function that starts the provided animation
280
+ *
281
+ * @internal
282
+ */
283
+ start(t) {
284
+ return this.stop(), new Promise((n) => {
285
+ this.hasAnimated = !0, this.animation = t(n), this.events.animationStart && this.events.animationStart.notify();
286
+ }).then(() => {
287
+ this.events.animationComplete && this.events.animationComplete.notify(), this.clearAnimation();
288
+ });
289
+ }
290
+ /**
291
+ * Stop the currently active animation.
292
+ *
293
+ * @public
294
+ */
295
+ stop() {
296
+ this.animation && (this.animation.stop(), this.events.animationCancel && this.events.animationCancel.notify()), this.clearAnimation();
297
+ }
298
+ /**
299
+ * Returns `true` if this value is currently animating.
300
+ *
301
+ * @public
302
+ */
303
+ isAnimating() {
304
+ return !!this.animation;
305
+ }
306
+ clearAnimation() {
307
+ delete this.animation;
308
+ }
309
+ /**
310
+ * Destroy and clean up subscribers to this `MotionValue`.
311
+ *
312
+ * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically
313
+ * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually
314
+ * created a `MotionValue` via the `motionValue` function.
315
+ *
316
+ * @public
317
+ */
318
+ destroy() {
319
+ this.clearListeners(), this.stop(), this.stopPassiveEffect && this.stopPassiveEffect();
320
+ }
321
+ }
322
+ function it(e, t) {
323
+ return new fi(e, t);
324
+ }
325
+ function Ft(e) {
326
+ let t;
327
+ return () => (t === void 0 && (t = e()), t);
328
+ }
329
+ const Nn = Ft(() => window.ScrollTimeline !== void 0);
330
+ class se {
331
+ constructor(t) {
332
+ this.stop = () => this.runAll("stop"), this.animations = t.filter(Boolean);
333
+ }
334
+ then(t, n) {
335
+ return Promise.all(this.animations).then(t).catch(n);
336
+ }
337
+ /**
338
+ * TODO: Filter out cancelled or stopped animations before returning
339
+ */
340
+ getAll(t) {
341
+ return this.animations[0][t];
342
+ }
343
+ setAll(t, n) {
344
+ for (let s = 0; s < this.animations.length; s++)
345
+ this.animations[s][t] = n;
346
+ }
347
+ attachTimeline(t, n) {
348
+ const s = this.animations.map((i) => Nn() && i.attachTimeline ? i.attachTimeline(t) : n(i));
349
+ return () => {
350
+ s.forEach((i, r) => {
351
+ i && i(), this.animations[r].stop();
352
+ });
353
+ };
354
+ }
355
+ get time() {
356
+ return this.getAll("time");
357
+ }
358
+ set time(t) {
359
+ this.setAll("time", t);
360
+ }
361
+ get speed() {
362
+ return this.getAll("speed");
363
+ }
364
+ set speed(t) {
365
+ this.setAll("speed", t);
366
+ }
367
+ get startTime() {
368
+ return this.getAll("startTime");
369
+ }
370
+ get duration() {
371
+ let t = 0;
372
+ for (let n = 0; n < this.animations.length; n++)
373
+ t = Math.max(t, this.animations[n].duration);
374
+ return t;
375
+ }
376
+ runAll(t) {
377
+ this.animations.forEach((n) => n[t]());
378
+ }
379
+ play() {
380
+ this.runAll("play");
381
+ }
382
+ pause() {
383
+ this.runAll("pause");
384
+ }
385
+ cancel() {
386
+ this.runAll("cancel");
387
+ }
388
+ complete() {
389
+ this.runAll("complete");
390
+ }
391
+ }
392
+ const C = (e) => e * 1e3, D = (e) => e / 1e3, hi = 5;
393
+ function $n(e, t, n) {
394
+ const s = Math.max(t - hi, 0);
395
+ return ne(n - e(s), t - s);
396
+ }
397
+ let ut = N, R = N;
398
+ process.env.NODE_ENV !== "production" && (ut = (e, t) => {
399
+ !e && typeof console < "u" && console.warn(t);
400
+ }, R = (e, t) => {
401
+ if (!e)
402
+ throw new Error(t);
403
+ });
404
+ const j = (e, t, n) => n > t ? t : n < e ? e : n, It = 1e-3, di = 0.01, Ke = 10, pi = 0.05, mi = 1;
405
+ function gi({ duration: e = 800, bounce: t = 0.25, velocity: n = 0, mass: s = 1 }) {
406
+ let i, r;
407
+ ut(e <= C(Ke), "Spring duration must be 10 seconds or less");
408
+ let o = 1 - t;
409
+ o = j(pi, mi, o), e = j(di, Ke, D(e)), o < 1 ? (i = (u) => {
410
+ const c = u * o, f = c * e, h = c - n, p = _t(u, o), m = Math.exp(-f);
411
+ return It - h / p * m;
412
+ }, r = (u) => {
413
+ const f = u * o * e, h = f * n + n, p = Math.pow(o, 2) * Math.pow(u, 2) * e, m = Math.exp(-f), w = _t(Math.pow(u, 2), o);
414
+ return (-i(u) + It > 0 ? -1 : 1) * ((h - p) * m) / w;
415
+ }) : (i = (u) => {
416
+ const c = Math.exp(-u * e), f = (u - n) * e + 1;
417
+ return -It + c * f;
418
+ }, r = (u) => {
419
+ const c = Math.exp(-u * e), f = (n - u) * (e * e);
420
+ return c * f;
421
+ });
422
+ const a = 5 / e, l = vi(i, r, a);
423
+ if (e = C(e), isNaN(l))
424
+ return {
425
+ stiffness: 100,
426
+ damping: 10,
427
+ duration: e
428
+ };
429
+ {
430
+ const u = Math.pow(l, 2) * s;
431
+ return {
432
+ stiffness: u,
433
+ damping: o * 2 * Math.sqrt(s * u),
434
+ duration: e
435
+ };
436
+ }
437
+ }
438
+ const yi = 12;
439
+ function vi(e, t, n) {
440
+ let s = n;
441
+ for (let i = 1; i < yi; i++)
442
+ s = s - e(s) / t(s);
443
+ return s;
444
+ }
445
+ function _t(e, t) {
446
+ return e * Math.sqrt(1 - t * t);
447
+ }
448
+ const bi = ["duration", "bounce"], wi = ["stiffness", "damping", "mass"];
449
+ function We(e, t) {
450
+ return t.some((n) => e[n] !== void 0);
451
+ }
452
+ function Ti(e) {
453
+ let t = {
454
+ velocity: 0,
455
+ stiffness: 100,
456
+ damping: 10,
457
+ mass: 1,
458
+ isResolvedFromDuration: !1,
459
+ ...e
460
+ };
461
+ if (!We(e, wi) && We(e, bi)) {
462
+ const n = gi(e);
463
+ t = {
464
+ ...t,
465
+ ...n,
466
+ mass: 1
467
+ }, t.isResolvedFromDuration = !0;
468
+ }
469
+ return t;
470
+ }
471
+ function ie({ keyframes: e, restDelta: t, restSpeed: n, ...s }) {
472
+ const i = e[0], r = e[e.length - 1], o = { done: !1, value: i }, { stiffness: a, damping: l, mass: u, duration: c, velocity: f, isResolvedFromDuration: h } = Ti({
473
+ ...s,
474
+ velocity: -D(s.velocity || 0)
475
+ }), p = f || 0, m = l / (2 * Math.sqrt(a * u)), w = r - i, b = D(Math.sqrt(a / u)), g = Math.abs(w) < 5;
476
+ n || (n = g ? 0.01 : 2), t || (t = g ? 5e-3 : 0.5);
477
+ let y;
478
+ if (m < 1) {
479
+ const S = _t(b, m);
480
+ y = (x) => {
481
+ const T = Math.exp(-m * b * x);
482
+ return r - T * ((p + m * b * w) / S * Math.sin(S * x) + w * Math.cos(S * x));
483
+ };
484
+ } else if (m === 1)
485
+ y = (S) => r - Math.exp(-b * S) * (w + (p + b * w) * S);
486
+ else {
487
+ const S = b * Math.sqrt(m * m - 1);
488
+ y = (x) => {
489
+ const T = Math.exp(-m * b * x), A = Math.min(S * x, 300);
490
+ return r - T * ((p + m * b * w) * Math.sinh(A) + S * w * Math.cosh(A)) / S;
491
+ };
492
+ }
493
+ return {
494
+ calculatedDuration: h && c || null,
495
+ next: (S) => {
496
+ const x = y(S);
497
+ if (h)
498
+ o.done = S >= c;
499
+ else {
500
+ let T = 0;
501
+ m < 1 && (T = S === 0 ? C(p) : $n(y, S, x));
502
+ const A = Math.abs(T) <= n, F = Math.abs(r - x) <= t;
503
+ o.done = A && F;
504
+ }
505
+ return o.value = o.done ? r : x, o;
506
+ }
507
+ };
508
+ }
509
+ const Gt = 2e4;
510
+ function Kn(e) {
511
+ let t = 0;
512
+ const n = 50;
513
+ let s = e.next(t);
514
+ for (; !s.done && t < Gt; )
515
+ t += n, s = e.next(t);
516
+ return t >= Gt ? 1 / 0 : t;
517
+ }
518
+ function Wn(e, t = 100, n) {
519
+ const s = n({ ...e, keyframes: [0, t] }), i = Math.min(Kn(s), Gt);
520
+ return {
521
+ type: "keyframes",
522
+ ease: (r) => s.next(i * r).value / t,
523
+ duration: D(i)
524
+ };
525
+ }
526
+ const ct = (e, t, n) => e + (t - e) * n, ft = (e, t, n) => {
527
+ const s = t - e;
528
+ return s === 0 ? 1 : (n - e) / s;
529
+ };
530
+ function _n(e, t) {
531
+ const n = e[e.length - 1];
532
+ for (let s = 1; s <= t; s++) {
533
+ const i = ft(0, t, s);
534
+ e.push(ct(n, 1, i));
535
+ }
536
+ }
537
+ function re(e) {
538
+ const t = [0];
539
+ return _n(t, e.length - 1), t;
540
+ }
541
+ const P = (e) => !!(e && e.getVelocity);
542
+ function Ot(e, t, n) {
543
+ var s;
544
+ if (typeof e == "string") {
545
+ let i = document;
546
+ t && (R(!!t.current, "Scope provided, but no element detected."), i = t.current), n ? ((s = n[e]) !== null && s !== void 0 || (n[e] = i.querySelectorAll(e)), e = n[e]) : e = i.querySelectorAll(e);
547
+ } else e instanceof Element && (e = [e]);
548
+ return Array.from(e || []);
549
+ }
550
+ function oe(e) {
551
+ return typeof e == "object" && !Array.isArray(e);
552
+ }
553
+ function Gn(e, t, n, s) {
554
+ return typeof e == "string" && oe(t) ? Ot(e, n, s) : e instanceof NodeList ? Array.from(e) : Array.isArray(e) ? e : [e];
555
+ }
556
+ function ht(e) {
557
+ return typeof e == "function";
558
+ }
559
+ function _e(e, t, n, s) {
560
+ var i;
561
+ return typeof t == "number" ? t : t.startsWith("-") || t.startsWith("+") ? Math.max(0, e + parseFloat(t)) : t === "<" ? n : (i = s.get(t)) !== null && i !== void 0 ? i : e;
562
+ }
563
+ const Si = (e, t, n) => {
564
+ const s = t - e;
565
+ return ((n - e) % s + s) % s + e;
566
+ }, kn = (e) => Array.isArray(e) && typeof e[0] != "number";
567
+ function xi(e, t) {
568
+ return kn(e) ? e[Si(0, e.length, t)] : e;
569
+ }
570
+ function Vi(e, t, n) {
571
+ for (let s = 0; s < e.length; s++) {
572
+ const i = e[s];
573
+ i.at > t && i.at < n && (Bn(e, i), s--);
574
+ }
575
+ }
576
+ function Ai(e, t, n, s, i, r) {
577
+ Vi(e, i, r);
578
+ for (let o = 0; o < t.length; o++)
579
+ e.push({
580
+ value: t[o],
581
+ at: ct(i, r, s[o]),
582
+ easing: xi(n, o)
583
+ });
584
+ }
585
+ function Ei(e, t) {
586
+ return e.at === t.at ? e.value === null ? 1 : t.value === null ? -1 : 0 : e.at - t.at;
587
+ }
588
+ const Mi = "easeInOut";
589
+ function Pi(e, { defaultTransition: t = {}, ...n } = {}, s, i) {
590
+ const r = t.duration || 0.3, o = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), l = {}, u = /* @__PURE__ */ new Map();
591
+ let c = 0, f = 0, h = 0;
592
+ for (let p = 0; p < e.length; p++) {
593
+ const m = e[p];
594
+ if (typeof m == "string") {
595
+ u.set(m, f);
596
+ continue;
597
+ } else if (!Array.isArray(m)) {
598
+ u.set(m.name, _e(f, m.at, c, u));
599
+ continue;
600
+ }
601
+ let [w, b, g = {}] = m;
602
+ g.at !== void 0 && (f = _e(f, g.at, c, u));
603
+ let y = 0;
604
+ const S = (x, T, A, F = 0, v = 0) => {
605
+ const V = Ci(x), { delay: O = 0, times: G = re(V), type: Dt = "keyframes", ...Gs } = T;
606
+ let { ease: Me = t.ease || "easeOut", duration: I } = T;
607
+ const Pe = typeof O == "function" ? O(F, v) : O, Ce = V.length, Fe = ht(Dt) ? Dt : i == null ? void 0 : i[Dt];
608
+ if (Ce <= 2 && Fe) {
609
+ let Ie = 100;
610
+ if (Ce === 2 && Di(V)) {
611
+ const ks = V[1] - V[0];
612
+ Ie = Math.abs(ks);
613
+ }
614
+ const Be = { ...Gs };
615
+ I !== void 0 && (Be.duration = C(I));
616
+ const Le = Wn(Be, Ie, Fe);
617
+ Me = Le.ease, I = Le.duration;
618
+ }
619
+ I ?? (I = r);
620
+ const Oe = f + Pe, De = Oe + I;
621
+ G.length === 1 && G[0] === 0 && (G[1] = 1);
622
+ const Re = G.length - V.length;
623
+ Re > 0 && _n(G, Re), V.length === 1 && V.unshift(null), Ai(A, V, Me, G, Oe, De), y = Math.max(Pe + I, y), h = Math.max(De, h);
624
+ };
625
+ if (P(w)) {
626
+ const x = Ge(w, a);
627
+ S(b, g, ke("default", x));
628
+ } else {
629
+ const x = Gn(w, b, s, l), T = x.length;
630
+ for (let A = 0; A < T; A++) {
631
+ b = b, g = g;
632
+ const F = x[A], v = Ge(F, a);
633
+ for (const V in b)
634
+ S(b[V], Fi(g, V), ke(V, v), A, T);
635
+ }
636
+ }
637
+ c = f, f += y;
638
+ }
639
+ return a.forEach((p, m) => {
640
+ for (const w in p) {
641
+ const b = p[w];
642
+ b.sort(Ei);
643
+ const g = [], y = [], S = [];
644
+ for (let T = 0; T < b.length; T++) {
645
+ const { at: A, value: F, easing: v } = b[T];
646
+ g.push(F), y.push(ft(0, h, A)), S.push(v || "easeOut");
647
+ }
648
+ y[0] !== 0 && (y.unshift(0), g.unshift(g[0]), S.unshift(Mi)), y[y.length - 1] !== 1 && (y.push(1), g.push(null)), o.has(m) || o.set(m, {
649
+ keyframes: {},
650
+ transition: {}
651
+ });
652
+ const x = o.get(m);
653
+ x.keyframes[w] = g, x.transition[w] = {
654
+ ...t,
655
+ duration: h,
656
+ ease: S,
657
+ times: y,
658
+ ...n
659
+ };
660
+ }
661
+ }), o;
662
+ }
663
+ function Ge(e, t) {
664
+ return !t.has(e) && t.set(e, {}), t.get(e);
665
+ }
666
+ function ke(e, t) {
667
+ return t[e] || (t[e] = []), t[e];
668
+ }
669
+ function Ci(e) {
670
+ return Array.isArray(e) ? e : [e];
671
+ }
672
+ function Fi(e, t) {
673
+ return e && e[t] ? {
674
+ ...e,
675
+ ...e[t]
676
+ } : { ...e };
677
+ }
678
+ const Oi = (e) => typeof e == "number", Di = (e) => e.every(Oi), L = /* @__PURE__ */ new WeakMap(), dt = [
679
+ "transformPerspective",
680
+ "x",
681
+ "y",
682
+ "z",
683
+ "translateX",
684
+ "translateY",
685
+ "translateZ",
686
+ "scale",
687
+ "scaleX",
688
+ "scaleY",
689
+ "rotate",
690
+ "rotateX",
691
+ "rotateY",
692
+ "rotateZ",
693
+ "skew",
694
+ "skewX",
695
+ "skewY"
696
+ ], U = new Set(dt), Ri = {
697
+ type: "spring",
698
+ stiffness: 500,
699
+ damping: 25,
700
+ restSpeed: 10
701
+ }, Ii = (e) => ({
702
+ type: "spring",
703
+ stiffness: 550,
704
+ damping: e === 0 ? 2 * Math.sqrt(550) : 30,
705
+ restSpeed: 10
706
+ }), Bi = {
707
+ type: "keyframes",
708
+ duration: 0.8
709
+ }, Li = {
710
+ type: "keyframes",
711
+ ease: [0.25, 0.1, 0.35, 1],
712
+ duration: 0.3
713
+ }, Ni = (e, { keyframes: t }) => t.length > 2 ? Bi : U.has(e) ? e.startsWith("scale") ? Ii(t[1]) : Ri : Li;
714
+ function ae(e, t) {
715
+ return e ? e[t] || e.default || e : void 0;
716
+ }
717
+ const $i = (e) => e !== null;
718
+ function pt(e, { repeat: t, repeatType: n = "loop" }, s) {
719
+ const i = e.filter($i), r = t && n !== "loop" && t % 2 === 1 ? 0 : i.length - 1;
720
+ return !r || s === void 0 ? i[r] : s;
721
+ }
722
+ const zn = (e, t, n) => (((1 - 3 * n + 3 * t) * e + (3 * n - 6 * t)) * e + 3 * t) * e, Ki = 1e-7, Wi = 12;
723
+ function _i(e, t, n, s, i) {
724
+ let r, o, a = 0;
725
+ do
726
+ o = t + (n - t) / 2, r = zn(o, s, i) - e, r > 0 ? n = o : t = o;
727
+ while (Math.abs(r) > Ki && ++a < Wi);
728
+ return o;
729
+ }
730
+ function mt(e, t, n, s) {
731
+ if (e === t && n === s)
732
+ return N;
733
+ const i = (r) => _i(r, 0, 1, e, n);
734
+ return (r) => r === 0 || r === 1 ? r : zn(i(r), t, s);
735
+ }
736
+ const jn = (e) => (t) => t <= 0.5 ? e(2 * t) / 2 : (2 - e(2 * (1 - t))) / 2, Un = (e) => (t) => 1 - e(1 - t), Hn = /* @__PURE__ */ mt(0.33, 1.53, 0.69, 0.99), le = /* @__PURE__ */ Un(Hn), qn = /* @__PURE__ */ jn(le), Yn = (e) => (e *= 2) < 1 ? 0.5 * le(e) : 0.5 * (2 - Math.pow(2, -10 * (e - 1))), ue = (e) => 1 - Math.sin(Math.acos(e)), Gi = Un(ue), Xn = jn(ue), Zn = (e) => /^0[^.\s]+$/u.test(e);
737
+ function ki(e) {
738
+ return typeof e == "number" ? e === 0 : e !== null ? e === "none" || e === "0" || Zn(e) : !0;
739
+ }
740
+ const Qn = (e) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e), Jn = (e) => (t) => typeof t == "string" && t.startsWith(e), ts = /* @__PURE__ */ Jn("--"), zi = /* @__PURE__ */ Jn("var(--"), ce = (e) => zi(e) ? ji.test(e.split("/*")[0].trim()) : !1, ji = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu, Ui = (
741
+ // eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words
742
+ /^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u
743
+ );
744
+ function Hi(e) {
745
+ const t = Ui.exec(e);
746
+ if (!t)
747
+ return [,];
748
+ const [, n, s, i] = t;
749
+ return [`--${n ?? s}`, i];
750
+ }
751
+ const qi = 4;
752
+ function es(e, t, n = 1) {
753
+ R(n <= qi, `Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);
754
+ const [s, i] = Hi(e);
755
+ if (!s)
756
+ return;
757
+ const r = window.getComputedStyle(t).getPropertyValue(s);
758
+ if (r) {
759
+ const o = r.trim();
760
+ return Qn(o) ? parseFloat(o) : o;
761
+ }
762
+ return ce(i) ? es(i, t, n + 1) : i;
763
+ }
764
+ const X = {
765
+ test: (e) => typeof e == "number",
766
+ parse: parseFloat,
767
+ transform: (e) => e
768
+ }, rt = {
769
+ ...X,
770
+ transform: (e) => j(0, 1, e)
771
+ }, yt = {
772
+ ...X,
773
+ default: 1
774
+ }, gt = (e) => ({
775
+ test: (t) => typeof t == "string" && t.endsWith(e) && t.split(" ").length === 1,
776
+ parse: parseFloat,
777
+ transform: (t) => `${t}${e}`
778
+ }), $ = /* @__PURE__ */ gt("deg"), q = /* @__PURE__ */ gt("%"), d = /* @__PURE__ */ gt("px"), Yi = /* @__PURE__ */ gt("vh"), Xi = /* @__PURE__ */ gt("vw"), ze = {
779
+ ...q,
780
+ parse: (e) => q.parse(e) / 100,
781
+ transform: (e) => q.transform(e * 100)
782
+ }, Zi = /* @__PURE__ */ new Set([
783
+ "width",
784
+ "height",
785
+ "top",
786
+ "left",
787
+ "right",
788
+ "bottom",
789
+ "x",
790
+ "y",
791
+ "translateX",
792
+ "translateY"
793
+ ]), je = (e) => e === X || e === d, Ue = (e, t) => parseFloat(e.split(", ")[t]), He = (e, t) => (n, { transform: s }) => {
794
+ if (s === "none" || !s)
795
+ return 0;
796
+ const i = s.match(/^matrix3d\((.+)\)$/u);
797
+ if (i)
798
+ return Ue(i[1], t);
799
+ {
800
+ const r = s.match(/^matrix\((.+)\)$/u);
801
+ return r ? Ue(r[1], e) : 0;
802
+ }
803
+ }, Qi = /* @__PURE__ */ new Set(["x", "y", "z"]), Ji = dt.filter((e) => !Qi.has(e));
804
+ function tr(e) {
805
+ const t = [];
806
+ return Ji.forEach((n) => {
807
+ const s = e.getValue(n);
808
+ s !== void 0 && (t.push([n, s.get()]), s.set(n.startsWith("scale") ? 1 : 0));
809
+ }), t;
810
+ }
811
+ const Y = {
812
+ // Dimensions
813
+ width: ({ x: e }, { paddingLeft: t = "0", paddingRight: n = "0" }) => e.max - e.min - parseFloat(t) - parseFloat(n),
814
+ height: ({ y: e }, { paddingTop: t = "0", paddingBottom: n = "0" }) => e.max - e.min - parseFloat(t) - parseFloat(n),
815
+ top: (e, { top: t }) => parseFloat(t),
816
+ left: (e, { left: t }) => parseFloat(t),
817
+ bottom: ({ y: e }, { top: t }) => parseFloat(t) + (e.max - e.min),
818
+ right: ({ x: e }, { left: t }) => parseFloat(t) + (e.max - e.min),
819
+ // Transform
820
+ x: He(4, 13),
821
+ y: He(5, 14)
822
+ };
823
+ Y.translateX = Y.x;
824
+ Y.translateY = Y.y;
825
+ const ns = (e) => (t) => t.test(e), er = {
826
+ test: (e) => e === "auto",
827
+ parse: (e) => e
828
+ }, ss = [X, d, q, $, Xi, Yi, er], qe = (e) => ss.find(ns(e)), z = /* @__PURE__ */ new Set();
829
+ let kt = !1, zt = !1;
830
+ function is() {
831
+ if (zt) {
832
+ const e = Array.from(z).filter((s) => s.needsMeasurement), t = new Set(e.map((s) => s.element)), n = /* @__PURE__ */ new Map();
833
+ t.forEach((s) => {
834
+ const i = tr(s);
835
+ i.length && (n.set(s, i), s.render());
836
+ }), e.forEach((s) => s.measureInitialState()), t.forEach((s) => {
837
+ s.render();
838
+ const i = n.get(s);
839
+ i && i.forEach(([r, o]) => {
840
+ var a;
841
+ (a = s.getValue(r)) === null || a === void 0 || a.set(o);
842
+ });
843
+ }), e.forEach((s) => s.measureEndState()), e.forEach((s) => {
844
+ s.suspendedScrollY !== void 0 && window.scrollTo(0, s.suspendedScrollY);
845
+ });
846
+ }
847
+ zt = !1, kt = !1, z.forEach((e) => e.complete()), z.clear();
848
+ }
849
+ function rs() {
850
+ z.forEach((e) => {
851
+ e.readKeyframes(), e.needsMeasurement && (zt = !0);
852
+ });
853
+ }
854
+ function nr() {
855
+ rs(), is();
856
+ }
857
+ class fe {
858
+ constructor(t, n, s, i, r, o = !1) {
859
+ this.isComplete = !1, this.isAsync = !1, this.needsMeasurement = !1, this.isScheduled = !1, this.unresolvedKeyframes = [...t], this.onComplete = n, this.name = s, this.motionValue = i, this.element = r, this.isAsync = o;
860
+ }
861
+ scheduleResolve() {
862
+ this.isScheduled = !0, this.isAsync ? (z.add(this), kt || (kt = !0, M.read(rs), M.resolveKeyframes(is))) : (this.readKeyframes(), this.complete());
863
+ }
864
+ readKeyframes() {
865
+ const { unresolvedKeyframes: t, name: n, element: s, motionValue: i } = this;
866
+ for (let r = 0; r < t.length; r++)
867
+ if (t[r] === null)
868
+ if (r === 0) {
869
+ const o = i == null ? void 0 : i.get(), a = t[t.length - 1];
870
+ if (o !== void 0)
871
+ t[0] = o;
872
+ else if (s && n) {
873
+ const l = s.readValue(n, a);
874
+ l != null && (t[0] = l);
875
+ }
876
+ t[0] === void 0 && (t[0] = a), i && o === void 0 && i.set(t[0]);
877
+ } else
878
+ t[r] = t[r - 1];
879
+ }
880
+ setFinalKeyframe() {
881
+ }
882
+ measureInitialState() {
883
+ }
884
+ renderEndStyles() {
885
+ }
886
+ measureEndState() {
887
+ }
888
+ complete() {
889
+ this.isComplete = !0, this.onComplete(this.unresolvedKeyframes, this.finalKeyframe), z.delete(this);
890
+ }
891
+ cancel() {
892
+ this.isComplete || (this.isScheduled = !1, z.delete(this));
893
+ }
894
+ resume() {
895
+ this.isComplete || this.scheduleResolve();
896
+ }
897
+ }
898
+ const et = (e) => Math.round(e * 1e5) / 1e5, he = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu;
899
+ function sr(e) {
900
+ return e == null;
901
+ }
902
+ const ir = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu, de = (e, t) => (n) => !!(typeof n == "string" && ir.test(n) && n.startsWith(e) || t && !sr(n) && Object.prototype.hasOwnProperty.call(n, t)), os = (e, t, n) => (s) => {
903
+ if (typeof s != "string")
904
+ return s;
905
+ const [i, r, o, a] = s.match(he);
906
+ return {
907
+ [e]: parseFloat(i),
908
+ [t]: parseFloat(r),
909
+ [n]: parseFloat(o),
910
+ alpha: a !== void 0 ? parseFloat(a) : 1
911
+ };
912
+ }, rr = (e) => j(0, 255, e), Bt = {
913
+ ...X,
914
+ transform: (e) => Math.round(rr(e))
915
+ }, k = {
916
+ test: /* @__PURE__ */ de("rgb", "red"),
917
+ parse: /* @__PURE__ */ os("red", "green", "blue"),
918
+ transform: ({ red: e, green: t, blue: n, alpha: s = 1 }) => "rgba(" + Bt.transform(e) + ", " + Bt.transform(t) + ", " + Bt.transform(n) + ", " + et(rt.transform(s)) + ")"
919
+ };
920
+ function or(e) {
921
+ let t = "", n = "", s = "", i = "";
922
+ return e.length > 5 ? (t = e.substring(1, 3), n = e.substring(3, 5), s = e.substring(5, 7), i = e.substring(7, 9)) : (t = e.substring(1, 2), n = e.substring(2, 3), s = e.substring(3, 4), i = e.substring(4, 5), t += t, n += n, s += s, i += i), {
923
+ red: parseInt(t, 16),
924
+ green: parseInt(n, 16),
925
+ blue: parseInt(s, 16),
926
+ alpha: i ? parseInt(i, 16) / 255 : 1
927
+ };
928
+ }
929
+ const jt = {
930
+ test: /* @__PURE__ */ de("#"),
931
+ parse: or,
932
+ transform: k.transform
933
+ }, H = {
934
+ test: /* @__PURE__ */ de("hsl", "hue"),
935
+ parse: /* @__PURE__ */ os("hue", "saturation", "lightness"),
936
+ transform: ({ hue: e, saturation: t, lightness: n, alpha: s = 1 }) => "hsla(" + Math.round(e) + ", " + q.transform(et(t)) + ", " + q.transform(et(n)) + ", " + et(rt.transform(s)) + ")"
937
+ }, E = {
938
+ test: (e) => k.test(e) || jt.test(e) || H.test(e),
939
+ parse: (e) => k.test(e) ? k.parse(e) : H.test(e) ? H.parse(e) : jt.parse(e),
940
+ transform: (e) => typeof e == "string" ? e : e.hasOwnProperty("red") ? k.transform(e) : H.transform(e)
941
+ }, ar = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;
942
+ function lr(e) {
943
+ var t, n;
944
+ return isNaN(e) && typeof e == "string" && (((t = e.match(he)) === null || t === void 0 ? void 0 : t.length) || 0) + (((n = e.match(ar)) === null || n === void 0 ? void 0 : n.length) || 0) > 0;
945
+ }
946
+ const as = "number", ls = "color", ur = "var", cr = "var(", Ye = "${}", fr = /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;
947
+ function ot(e) {
948
+ const t = e.toString(), n = [], s = {
949
+ color: [],
950
+ number: [],
951
+ var: []
952
+ }, i = [];
953
+ let r = 0;
954
+ const a = t.replace(fr, (l) => (E.test(l) ? (s.color.push(r), i.push(ls), n.push(E.parse(l))) : l.startsWith(cr) ? (s.var.push(r), i.push(ur), n.push(l)) : (s.number.push(r), i.push(as), n.push(parseFloat(l))), ++r, Ye)).split(Ye);
955
+ return { values: n, split: a, indexes: s, types: i };
956
+ }
957
+ function us(e) {
958
+ return ot(e).values;
959
+ }
960
+ function cs(e) {
961
+ const { split: t, types: n } = ot(e), s = t.length;
962
+ return (i) => {
963
+ let r = "";
964
+ for (let o = 0; o < s; o++)
965
+ if (r += t[o], i[o] !== void 0) {
966
+ const a = n[o];
967
+ a === as ? r += et(i[o]) : a === ls ? r += E.transform(i[o]) : r += i[o];
968
+ }
969
+ return r;
970
+ };
971
+ }
972
+ const hr = (e) => typeof e == "number" ? 0 : e;
973
+ function dr(e) {
974
+ const t = us(e);
975
+ return cs(e)(t.map(hr));
976
+ }
977
+ const Z = {
978
+ test: lr,
979
+ parse: us,
980
+ createTransformer: cs,
981
+ getAnimatableNone: dr
982
+ }, pr = /* @__PURE__ */ new Set(["brightness", "contrast", "saturate", "opacity"]);
983
+ function mr(e) {
984
+ const [t, n] = e.slice(0, -1).split("(");
985
+ if (t === "drop-shadow")
986
+ return e;
987
+ const [s] = n.match(he) || [];
988
+ if (!s)
989
+ return e;
990
+ const i = n.replace(s, "");
991
+ let r = pr.has(t) ? 1 : 0;
992
+ return s !== n && (r *= 100), t + "(" + r + i + ")";
993
+ }
994
+ const gr = /\b([a-z-]*)\(.*?\)/gu, Ut = {
995
+ ...Z,
996
+ getAnimatableNone: (e) => {
997
+ const t = e.match(gr);
998
+ return t ? t.map(mr).join(" ") : e;
999
+ }
1000
+ }, Ht = {
1001
+ // Border props
1002
+ borderWidth: d,
1003
+ borderTopWidth: d,
1004
+ borderRightWidth: d,
1005
+ borderBottomWidth: d,
1006
+ borderLeftWidth: d,
1007
+ borderRadius: d,
1008
+ radius: d,
1009
+ borderTopLeftRadius: d,
1010
+ borderTopRightRadius: d,
1011
+ borderBottomRightRadius: d,
1012
+ borderBottomLeftRadius: d,
1013
+ // Positioning props
1014
+ width: d,
1015
+ maxWidth: d,
1016
+ height: d,
1017
+ maxHeight: d,
1018
+ top: d,
1019
+ right: d,
1020
+ bottom: d,
1021
+ left: d,
1022
+ // Spacing props
1023
+ padding: d,
1024
+ paddingTop: d,
1025
+ paddingRight: d,
1026
+ paddingBottom: d,
1027
+ paddingLeft: d,
1028
+ margin: d,
1029
+ marginTop: d,
1030
+ marginRight: d,
1031
+ marginBottom: d,
1032
+ marginLeft: d,
1033
+ // Misc
1034
+ backgroundPositionX: d,
1035
+ backgroundPositionY: d
1036
+ }, yr = {
1037
+ rotate: $,
1038
+ rotateX: $,
1039
+ rotateY: $,
1040
+ rotateZ: $,
1041
+ scale: yt,
1042
+ scaleX: yt,
1043
+ scaleY: yt,
1044
+ scaleZ: yt,
1045
+ skew: $,
1046
+ skewX: $,
1047
+ skewY: $,
1048
+ distance: d,
1049
+ translateX: d,
1050
+ translateY: d,
1051
+ translateZ: d,
1052
+ x: d,
1053
+ y: d,
1054
+ z: d,
1055
+ perspective: d,
1056
+ transformPerspective: d,
1057
+ opacity: rt,
1058
+ originX: ze,
1059
+ originY: ze,
1060
+ originZ: d
1061
+ }, Xe = {
1062
+ ...X,
1063
+ transform: Math.round
1064
+ }, pe = {
1065
+ ...Ht,
1066
+ ...yr,
1067
+ zIndex: Xe,
1068
+ size: d,
1069
+ // SVG
1070
+ fillOpacity: rt,
1071
+ strokeOpacity: rt,
1072
+ numOctaves: Xe
1073
+ }, vr = {
1074
+ ...pe,
1075
+ // Color props
1076
+ color: E,
1077
+ backgroundColor: E,
1078
+ outlineColor: E,
1079
+ fill: E,
1080
+ stroke: E,
1081
+ // Border props
1082
+ borderColor: E,
1083
+ borderTopColor: E,
1084
+ borderRightColor: E,
1085
+ borderBottomColor: E,
1086
+ borderLeftColor: E,
1087
+ filter: Ut,
1088
+ WebkitFilter: Ut
1089
+ }, me = (e) => vr[e];
1090
+ function fs(e, t) {
1091
+ let n = me(e);
1092
+ return n !== Ut && (n = Z), n.getAnimatableNone ? n.getAnimatableNone(t) : void 0;
1093
+ }
1094
+ const br = /* @__PURE__ */ new Set(["auto", "none", "0"]);
1095
+ function wr(e, t, n) {
1096
+ let s = 0, i;
1097
+ for (; s < e.length && !i; ) {
1098
+ const r = e[s];
1099
+ typeof r == "string" && !br.has(r) && ot(r).values.length && (i = e[s]), s++;
1100
+ }
1101
+ if (i && n)
1102
+ for (const r of t)
1103
+ e[r] = fs(n, i);
1104
+ }
1105
+ class hs extends fe {
1106
+ constructor(t, n, s, i, r) {
1107
+ super(t, n, s, i, r, !0);
1108
+ }
1109
+ readKeyframes() {
1110
+ const { unresolvedKeyframes: t, element: n, name: s } = this;
1111
+ if (!n || !n.current)
1112
+ return;
1113
+ super.readKeyframes();
1114
+ for (let l = 0; l < t.length; l++) {
1115
+ let u = t[l];
1116
+ if (typeof u == "string" && (u = u.trim(), ce(u))) {
1117
+ const c = es(u, n.current);
1118
+ c !== void 0 && (t[l] = c), l === t.length - 1 && (this.finalKeyframe = u);
1119
+ }
1120
+ }
1121
+ if (this.resolveNoneKeyframes(), !Zi.has(s) || t.length !== 2)
1122
+ return;
1123
+ const [i, r] = t, o = qe(i), a = qe(r);
1124
+ if (o !== a)
1125
+ if (je(o) && je(a))
1126
+ for (let l = 0; l < t.length; l++) {
1127
+ const u = t[l];
1128
+ typeof u == "string" && (t[l] = parseFloat(u));
1129
+ }
1130
+ else
1131
+ this.needsMeasurement = !0;
1132
+ }
1133
+ resolveNoneKeyframes() {
1134
+ const { unresolvedKeyframes: t, name: n } = this, s = [];
1135
+ for (let i = 0; i < t.length; i++)
1136
+ ki(t[i]) && s.push(i);
1137
+ s.length && wr(t, s, n);
1138
+ }
1139
+ measureInitialState() {
1140
+ const { element: t, unresolvedKeyframes: n, name: s } = this;
1141
+ if (!t || !t.current)
1142
+ return;
1143
+ s === "height" && (this.suspendedScrollY = window.pageYOffset), this.measuredOrigin = Y[s](t.measureViewportBox(), window.getComputedStyle(t.current)), n[0] = this.measuredOrigin;
1144
+ const i = n[n.length - 1];
1145
+ i !== void 0 && t.getValue(s, i).jump(i, !1);
1146
+ }
1147
+ measureEndState() {
1148
+ var t;
1149
+ const { element: n, name: s, unresolvedKeyframes: i } = this;
1150
+ if (!n || !n.current)
1151
+ return;
1152
+ const r = n.getValue(s);
1153
+ r && r.jump(this.measuredOrigin, !1);
1154
+ const o = i.length - 1, a = i[o];
1155
+ i[o] = Y[s](n.measureViewportBox(), window.getComputedStyle(n.current)), a !== null && this.finalKeyframe === void 0 && (this.finalKeyframe = a), !((t = this.removedTransforms) === null || t === void 0) && t.length && this.removedTransforms.forEach(([l, u]) => {
1156
+ n.getValue(l).set(u);
1157
+ }), this.resolveNoneKeyframes();
1158
+ }
1159
+ }
1160
+ const Ze = (e, t) => t === "zIndex" ? !1 : !!(typeof e == "number" || Array.isArray(e) || typeof e == "string" && // It's animatable if we have a string
1161
+ (Z.test(e) || e === "0") && // And it contains numbers and/or colors
1162
+ !e.startsWith("url("));
1163
+ function Tr(e) {
1164
+ const t = e[0];
1165
+ if (e.length === 1)
1166
+ return !0;
1167
+ for (let n = 0; n < e.length; n++)
1168
+ if (e[n] !== t)
1169
+ return !0;
1170
+ }
1171
+ function Sr(e, t, n, s) {
1172
+ const i = e[0];
1173
+ if (i === null)
1174
+ return !1;
1175
+ if (t === "display" || t === "visibility")
1176
+ return !0;
1177
+ const r = e[e.length - 1], o = Ze(i, t), a = Ze(r, t);
1178
+ return ut(o === a, `You are trying to animate ${t} from "${i}" to "${r}". ${i} is not an animatable value - to enable this animation set ${i} to a value animatable to ${r} via the \`style\` property.`), !o || !a ? !1 : Tr(e) || (n === "spring" || ht(n)) && s;
1179
+ }
1180
+ const xr = 40;
1181
+ class ds {
1182
+ constructor({ autoplay: t = !0, delay: n = 0, type: s = "keyframes", repeat: i = 0, repeatDelay: r = 0, repeatType: o = "loop", ...a }) {
1183
+ this.isStopped = !1, this.hasAttemptedResolve = !1, this.createdAt = B.now(), this.options = {
1184
+ autoplay: t,
1185
+ delay: n,
1186
+ type: s,
1187
+ repeat: i,
1188
+ repeatDelay: r,
1189
+ repeatType: o,
1190
+ ...a
1191
+ }, this.updateFinishedPromise();
1192
+ }
1193
+ /**
1194
+ * This method uses the createdAt and resolvedAt to calculate the
1195
+ * animation startTime. *Ideally*, we would use the createdAt time as t=0
1196
+ * as the following frame would then be the first frame of the animation in
1197
+ * progress, which would feel snappier.
1198
+ *
1199
+ * However, if there's a delay (main thread work) between the creation of
1200
+ * the animation and the first commited frame, we prefer to use resolvedAt
1201
+ * to avoid a sudden jump into the animation.
1202
+ */
1203
+ calcStartTime() {
1204
+ return this.resolvedAt ? this.resolvedAt - this.createdAt > xr ? this.resolvedAt : this.createdAt : this.createdAt;
1205
+ }
1206
+ /**
1207
+ * A getter for resolved data. If keyframes are not yet resolved, accessing
1208
+ * this.resolved will synchronously flush all pending keyframe resolvers.
1209
+ * This is a deoptimisation, but at its worst still batches read/writes.
1210
+ */
1211
+ get resolved() {
1212
+ return !this._resolved && !this.hasAttemptedResolve && nr(), this._resolved;
1213
+ }
1214
+ /**
1215
+ * A method to be called when the keyframes resolver completes. This method
1216
+ * will check if its possible to run the animation and, if not, skip it.
1217
+ * Otherwise, it will call initPlayback on the implementing class.
1218
+ */
1219
+ onKeyframesResolved(t, n) {
1220
+ this.resolvedAt = B.now(), this.hasAttemptedResolve = !0;
1221
+ const { name: s, type: i, velocity: r, delay: o, onComplete: a, onUpdate: l, isGenerator: u } = this.options;
1222
+ if (!u && !Sr(t, s, i, r))
1223
+ if (o)
1224
+ this.options.duration = 0;
1225
+ else {
1226
+ l == null || l(pt(t, this.options, n)), a == null || a(), this.resolveFinishedPromise();
1227
+ return;
1228
+ }
1229
+ const c = this.initPlayback(t, n);
1230
+ c !== !1 && (this._resolved = {
1231
+ keyframes: t,
1232
+ finalKeyframe: n,
1233
+ ...c
1234
+ }, this.onPostResolved());
1235
+ }
1236
+ onPostResolved() {
1237
+ }
1238
+ /**
1239
+ * Allows the returned animation to be awaited or promise-chained. Currently
1240
+ * resolves when the animation finishes at all but in a future update could/should
1241
+ * reject if its cancels.
1242
+ */
1243
+ then(t, n) {
1244
+ return this.currentFinishedPromise.then(t, n);
1245
+ }
1246
+ updateFinishedPromise() {
1247
+ this.currentFinishedPromise = new Promise((t) => {
1248
+ this.resolveFinishedPromise = t;
1249
+ });
1250
+ }
1251
+ }
1252
+ function Qe({ keyframes: e, velocity: t = 0, power: n = 0.8, timeConstant: s = 325, bounceDamping: i = 10, bounceStiffness: r = 500, modifyTarget: o, min: a, max: l, restDelta: u = 0.5, restSpeed: c }) {
1253
+ const f = e[0], h = {
1254
+ done: !1,
1255
+ value: f
1256
+ }, p = (v) => a !== void 0 && v < a || l !== void 0 && v > l, m = (v) => a === void 0 ? l : l === void 0 || Math.abs(a - v) < Math.abs(l - v) ? a : l;
1257
+ let w = n * t;
1258
+ const b = f + w, g = o === void 0 ? b : o(b);
1259
+ g !== b && (w = g - f);
1260
+ const y = (v) => -w * Math.exp(-v / s), S = (v) => g + y(v), x = (v) => {
1261
+ const V = y(v), O = S(v);
1262
+ h.done = Math.abs(V) <= u, h.value = h.done ? g : O;
1263
+ };
1264
+ let T, A;
1265
+ const F = (v) => {
1266
+ p(h.value) && (T = v, A = ie({
1267
+ keyframes: [h.value, m(h.value)],
1268
+ velocity: $n(S, v, h.value),
1269
+ // TODO: This should be passing * 1000
1270
+ damping: i,
1271
+ stiffness: r,
1272
+ restDelta: u,
1273
+ restSpeed: c
1274
+ }));
1275
+ };
1276
+ return F(0), {
1277
+ calculatedDuration: null,
1278
+ next: (v) => {
1279
+ let V = !1;
1280
+ return !A && T === void 0 && (V = !0, x(v), F(v)), T !== void 0 && v >= T ? A.next(v - T) : (!V && x(v), h);
1281
+ }
1282
+ };
1283
+ }
1284
+ const Vr = /* @__PURE__ */ mt(0.42, 0, 1, 1), Ar = /* @__PURE__ */ mt(0, 0, 0.58, 1), ps = /* @__PURE__ */ mt(0.42, 0, 0.58, 1), ge = (e) => Array.isArray(e) && typeof e[0] == "number", Je = {
1285
+ linear: N,
1286
+ easeIn: Vr,
1287
+ easeInOut: ps,
1288
+ easeOut: Ar,
1289
+ circIn: ue,
1290
+ circInOut: Xn,
1291
+ circOut: Gi,
1292
+ backIn: le,
1293
+ backInOut: qn,
1294
+ backOut: Hn,
1295
+ anticipate: Yn
1296
+ }, qt = (e) => {
1297
+ if (ge(e)) {
1298
+ R(e.length === 4, "Cubic bezier arrays must contain four numerical values.");
1299
+ const [t, n, s, i] = e;
1300
+ return mt(t, n, s, i);
1301
+ } else if (typeof e == "string")
1302
+ return R(Je[e] !== void 0, `Invalid easing type '${e}'`), Je[e];
1303
+ return e;
1304
+ }, Er = (e, t) => (n) => t(e(n)), ye = (...e) => e.reduce(Er);
1305
+ function Lt(e, t, n) {
1306
+ return n < 0 && (n += 1), n > 1 && (n -= 1), n < 1 / 6 ? e + (t - e) * 6 * n : n < 1 / 2 ? t : n < 2 / 3 ? e + (t - e) * (2 / 3 - n) * 6 : e;
1307
+ }
1308
+ function Mr({ hue: e, saturation: t, lightness: n, alpha: s }) {
1309
+ e /= 360, t /= 100, n /= 100;
1310
+ let i = 0, r = 0, o = 0;
1311
+ if (!t)
1312
+ i = r = o = n;
1313
+ else {
1314
+ const a = n < 0.5 ? n * (1 + t) : n + t - n * t, l = 2 * n - a;
1315
+ i = Lt(l, a, e + 1 / 3), r = Lt(l, a, e), o = Lt(l, a, e - 1 / 3);
1316
+ }
1317
+ return {
1318
+ red: Math.round(i * 255),
1319
+ green: Math.round(r * 255),
1320
+ blue: Math.round(o * 255),
1321
+ alpha: s
1322
+ };
1323
+ }
1324
+ function St(e, t) {
1325
+ return (n) => n > 0 ? t : e;
1326
+ }
1327
+ const Nt = (e, t, n) => {
1328
+ const s = e * e, i = n * (t * t - s) + s;
1329
+ return i < 0 ? 0 : Math.sqrt(i);
1330
+ }, Pr = [jt, k, H], Cr = (e) => Pr.find((t) => t.test(e));
1331
+ function tn(e) {
1332
+ const t = Cr(e);
1333
+ if (ut(!!t, `'${e}' is not an animatable color. Use the equivalent color code instead.`), !t)
1334
+ return !1;
1335
+ let n = t.parse(e);
1336
+ return t === H && (n = Mr(n)), n;
1337
+ }
1338
+ const en = (e, t) => {
1339
+ const n = tn(e), s = tn(t);
1340
+ if (!n || !s)
1341
+ return St(e, t);
1342
+ const i = { ...n };
1343
+ return (r) => (i.red = Nt(n.red, s.red, r), i.green = Nt(n.green, s.green, r), i.blue = Nt(n.blue, s.blue, r), i.alpha = ct(n.alpha, s.alpha, r), k.transform(i));
1344
+ }, Yt = /* @__PURE__ */ new Set(["none", "hidden"]);
1345
+ function Fr(e, t) {
1346
+ return Yt.has(e) ? (n) => n <= 0 ? e : t : (n) => n >= 1 ? t : e;
1347
+ }
1348
+ function Or(e, t) {
1349
+ return (n) => ct(e, t, n);
1350
+ }
1351
+ function ve(e) {
1352
+ return typeof e == "number" ? Or : typeof e == "string" ? ce(e) ? St : E.test(e) ? en : Ir : Array.isArray(e) ? ms : typeof e == "object" ? E.test(e) ? en : Dr : St;
1353
+ }
1354
+ function ms(e, t) {
1355
+ const n = [...e], s = n.length, i = e.map((r, o) => ve(r)(r, t[o]));
1356
+ return (r) => {
1357
+ for (let o = 0; o < s; o++)
1358
+ n[o] = i[o](r);
1359
+ return n;
1360
+ };
1361
+ }
1362
+ function Dr(e, t) {
1363
+ const n = { ...e, ...t }, s = {};
1364
+ for (const i in n)
1365
+ e[i] !== void 0 && t[i] !== void 0 && (s[i] = ve(e[i])(e[i], t[i]));
1366
+ return (i) => {
1367
+ for (const r in s)
1368
+ n[r] = s[r](i);
1369
+ return n;
1370
+ };
1371
+ }
1372
+ function Rr(e, t) {
1373
+ var n;
1374
+ const s = [], i = { color: 0, var: 0, number: 0 };
1375
+ for (let r = 0; r < t.values.length; r++) {
1376
+ const o = t.types[r], a = e.indexes[o][i[o]], l = (n = e.values[a]) !== null && n !== void 0 ? n : 0;
1377
+ s[r] = l, i[o]++;
1378
+ }
1379
+ return s;
1380
+ }
1381
+ const Ir = (e, t) => {
1382
+ const n = Z.createTransformer(t), s = ot(e), i = ot(t);
1383
+ 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 ? Yt.has(e) && !i.values.length || Yt.has(t) && !s.values.length ? Fr(e, t) : ye(ms(Rr(s, i), i.values), n) : (ut(!0, `Complex values '${e}' and '${t}' 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.`), St(e, t));
1384
+ };
1385
+ function gs(e, t, n) {
1386
+ return typeof e == "number" && typeof t == "number" && typeof n == "number" ? ct(e, t, n) : ve(e)(e, t);
1387
+ }
1388
+ function Br(e, t, n) {
1389
+ const s = [], i = n || gs, r = e.length - 1;
1390
+ for (let o = 0; o < r; o++) {
1391
+ let a = i(e[o], e[o + 1]);
1392
+ if (t) {
1393
+ const l = Array.isArray(t) ? t[o] || N : t;
1394
+ a = ye(l, a);
1395
+ }
1396
+ s.push(a);
1397
+ }
1398
+ return s;
1399
+ }
1400
+ function be(e, t, { clamp: n = !0, ease: s, mixer: i } = {}) {
1401
+ const r = e.length;
1402
+ if (R(r === t.length, "Both input and output ranges must be the same length"), r === 1)
1403
+ return () => t[0];
1404
+ if (r === 2 && e[0] === e[1])
1405
+ return () => t[1];
1406
+ e[0] > e[r - 1] && (e = [...e].reverse(), t = [...t].reverse());
1407
+ const o = Br(t, s, i), a = o.length, l = (u) => {
1408
+ let c = 0;
1409
+ if (a > 1)
1410
+ for (; c < e.length - 2 && !(u < e[c + 1]); c++)
1411
+ ;
1412
+ const f = ft(e[c], e[c + 1], u);
1413
+ return o[c](f);
1414
+ };
1415
+ return n ? (u) => l(j(e[0], e[r - 1], u)) : l;
1416
+ }
1417
+ function Lr(e, t) {
1418
+ return e.map((n) => n * t);
1419
+ }
1420
+ function Nr(e, t) {
1421
+ return e.map(() => t || ps).splice(0, e.length - 1);
1422
+ }
1423
+ function xt({ duration: e = 300, keyframes: t, times: n, ease: s = "easeInOut" }) {
1424
+ const i = kn(s) ? s.map(qt) : qt(s), r = {
1425
+ done: !1,
1426
+ value: t[0]
1427
+ }, o = Lr(
1428
+ // Only use the provided offsets if they're the correct length
1429
+ // TODO Maybe we should warn here if there's a length mismatch
1430
+ n && n.length === t.length ? n : re(t),
1431
+ e
1432
+ ), a = be(o, t, {
1433
+ ease: Array.isArray(i) ? i : Nr(t, i)
1434
+ });
1435
+ return {
1436
+ calculatedDuration: e,
1437
+ next: (l) => (r.value = a(l), r.done = l >= e, r)
1438
+ };
1439
+ }
1440
+ const $r = (e) => {
1441
+ const t = ({ timestamp: n }) => e(n);
1442
+ return {
1443
+ start: () => M.update(t, !0),
1444
+ stop: () => _(t),
1445
+ /**
1446
+ * If we're processing this frame we can use the
1447
+ * framelocked timestamp to keep things in sync.
1448
+ */
1449
+ now: () => st.isProcessing ? st.timestamp : B.now()
1450
+ };
1451
+ }, Kr = {
1452
+ decay: Qe,
1453
+ inertia: Qe,
1454
+ tween: xt,
1455
+ keyframes: xt,
1456
+ spring: ie
1457
+ }, Wr = (e) => e / 100;
1458
+ class we extends ds {
1459
+ constructor(t) {
1460
+ super(t), this.holdTime = null, this.cancelTime = null, this.currentTime = 0, this.playbackSpeed = 1, this.pendingPlayState = "running", this.startTime = null, this.state = "idle", this.stop = () => {
1461
+ if (this.resolver.cancel(), this.isStopped = !0, this.state === "idle")
1462
+ return;
1463
+ this.teardown();
1464
+ const { onStop: l } = this.options;
1465
+ l && l();
1466
+ };
1467
+ const { name: n, motionValue: s, element: i, keyframes: r } = this.options, o = (i == null ? void 0 : i.KeyframeResolver) || fe, a = (l, u) => this.onKeyframesResolved(l, u);
1468
+ this.resolver = new o(r, a, n, s, i), this.resolver.scheduleResolve();
1469
+ }
1470
+ initPlayback(t) {
1471
+ const { type: n = "keyframes", repeat: s = 0, repeatDelay: i = 0, repeatType: r, velocity: o = 0 } = this.options, a = ht(n) ? n : Kr[n] || xt;
1472
+ let l, u;
1473
+ a !== xt && typeof t[0] != "number" && (process.env.NODE_ENV !== "production" && R(t.length === 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${t}`), l = ye(Wr, gs(t[0], t[1])), t = [0, 100]);
1474
+ const c = a({ ...this.options, keyframes: t });
1475
+ r === "mirror" && (u = a({
1476
+ ...this.options,
1477
+ keyframes: [...t].reverse(),
1478
+ velocity: -o
1479
+ })), c.calculatedDuration === null && (c.calculatedDuration = Kn(c));
1480
+ const { calculatedDuration: f } = c, h = f + i, p = h * (s + 1) - i;
1481
+ return {
1482
+ generator: c,
1483
+ mirroredGenerator: u,
1484
+ mapPercentToKeyframes: l,
1485
+ calculatedDuration: f,
1486
+ resolvedDuration: h,
1487
+ totalDuration: p
1488
+ };
1489
+ }
1490
+ onPostResolved() {
1491
+ const { autoplay: t = !0 } = this.options;
1492
+ this.play(), this.pendingPlayState === "paused" || !t ? this.pause() : this.state = this.pendingPlayState;
1493
+ }
1494
+ tick(t, n = !1) {
1495
+ const { resolved: s } = this;
1496
+ if (!s) {
1497
+ const { keyframes: v } = this.options;
1498
+ return { done: !0, value: v[v.length - 1] };
1499
+ }
1500
+ const { finalKeyframe: i, generator: r, mirroredGenerator: o, mapPercentToKeyframes: a, keyframes: l, calculatedDuration: u, totalDuration: c, resolvedDuration: f } = s;
1501
+ if (this.startTime === null)
1502
+ return r.next(0);
1503
+ const { delay: h, repeat: p, repeatType: m, repeatDelay: w, onUpdate: b } = this.options;
1504
+ this.speed > 0 ? this.startTime = Math.min(this.startTime, t) : this.speed < 0 && (this.startTime = Math.min(t - c / this.speed, this.startTime)), n ? this.currentTime = t : this.holdTime !== null ? this.currentTime = this.holdTime : this.currentTime = Math.round(t - this.startTime) * this.speed;
1505
+ const g = this.currentTime - h * (this.speed >= 0 ? 1 : -1), y = this.speed >= 0 ? g < 0 : g > c;
1506
+ this.currentTime = Math.max(g, 0), this.state === "finished" && this.holdTime === null && (this.currentTime = c);
1507
+ let S = this.currentTime, x = r;
1508
+ if (p) {
1509
+ const v = Math.min(this.currentTime, c) / f;
1510
+ let V = Math.floor(v), O = v % 1;
1511
+ !O && v >= 1 && (O = 1), O === 1 && V--, V = Math.min(V, p + 1), !!(V % 2) && (m === "reverse" ? (O = 1 - O, w && (O -= w / f)) : m === "mirror" && (x = o)), S = j(0, 1, O) * f;
1512
+ }
1513
+ const T = y ? { done: !1, value: l[0] } : x.next(S);
1514
+ a && (T.value = a(T.value));
1515
+ let { done: A } = T;
1516
+ !y && u !== null && (A = this.speed >= 0 ? this.currentTime >= c : this.currentTime <= 0);
1517
+ const F = this.holdTime === null && (this.state === "finished" || this.state === "running" && A);
1518
+ return F && i !== void 0 && (T.value = pt(l, this.options, i)), b && b(T.value), F && this.finish(), T;
1519
+ }
1520
+ get duration() {
1521
+ const { resolved: t } = this;
1522
+ return t ? D(t.calculatedDuration) : 0;
1523
+ }
1524
+ get time() {
1525
+ return D(this.currentTime);
1526
+ }
1527
+ set time(t) {
1528
+ t = C(t), this.currentTime = t, this.holdTime !== null || this.speed === 0 ? this.holdTime = t : this.driver && (this.startTime = this.driver.now() - t / this.speed);
1529
+ }
1530
+ get speed() {
1531
+ return this.playbackSpeed;
1532
+ }
1533
+ set speed(t) {
1534
+ const n = this.playbackSpeed !== t;
1535
+ this.playbackSpeed = t, n && (this.time = D(this.currentTime));
1536
+ }
1537
+ play() {
1538
+ if (this.resolver.isScheduled || this.resolver.resume(), !this._resolved) {
1539
+ this.pendingPlayState = "running";
1540
+ return;
1541
+ }
1542
+ if (this.isStopped)
1543
+ return;
1544
+ const { driver: t = $r, onPlay: n, startTime: s } = this.options;
1545
+ this.driver || (this.driver = t((r) => this.tick(r))), n && n();
1546
+ const i = this.driver.now();
1547
+ this.holdTime !== null ? this.startTime = i - this.holdTime : this.startTime ? this.state === "finished" && (this.startTime = i) : this.startTime = s ?? this.calcStartTime(), this.state === "finished" && this.updateFinishedPromise(), this.cancelTime = this.startTime, this.holdTime = null, this.state = "running", this.driver.start();
1548
+ }
1549
+ pause() {
1550
+ var t;
1551
+ if (!this._resolved) {
1552
+ this.pendingPlayState = "paused";
1553
+ return;
1554
+ }
1555
+ this.state = "paused", this.holdTime = (t = this.currentTime) !== null && t !== void 0 ? t : 0;
1556
+ }
1557
+ complete() {
1558
+ this.state !== "running" && this.play(), this.pendingPlayState = this.state = "finished", this.holdTime = null;
1559
+ }
1560
+ finish() {
1561
+ this.teardown(), this.state = "finished";
1562
+ const { onComplete: t } = this.options;
1563
+ t && t();
1564
+ }
1565
+ cancel() {
1566
+ this.cancelTime !== null && this.tick(this.cancelTime), this.teardown(), this.updateFinishedPromise();
1567
+ }
1568
+ teardown() {
1569
+ this.state = "idle", this.stopDriver(), this.resolveFinishedPromise(), this.updateFinishedPromise(), this.startTime = this.cancelTime = null, this.resolver.cancel();
1570
+ }
1571
+ stopDriver() {
1572
+ this.driver && (this.driver.stop(), this.driver = void 0);
1573
+ }
1574
+ sample(t) {
1575
+ return this.startTime = 0, this.tick(t, !0);
1576
+ }
1577
+ }
1578
+ const _r = /* @__PURE__ */ new Set([
1579
+ "opacity",
1580
+ "clipPath",
1581
+ "filter",
1582
+ "transform"
1583
+ // TODO: Can be accelerated but currently disabled until https://issues.chromium.org/issues/41491098 is resolved
1584
+ // or until we implement support for linear() easing.
1585
+ // "background-color"
1586
+ ]), Gr = 10, kr = (e, t) => {
1587
+ let n = "";
1588
+ const s = Math.max(Math.round(t / Gr), 2);
1589
+ for (let i = 0; i < s; i++)
1590
+ n += e(ft(0, s - 1, i)) + ", ";
1591
+ return `linear(${n.substring(0, n.length - 2)})`;
1592
+ }, zr = {
1593
+ linearEasing: void 0
1594
+ };
1595
+ function jr(e, t) {
1596
+ const n = Ft(e);
1597
+ return () => {
1598
+ var s;
1599
+ return (s = zr[t]) !== null && s !== void 0 ? s : n();
1600
+ };
1601
+ }
1602
+ const at = /* @__PURE__ */ jr(() => {
1603
+ try {
1604
+ document.createElement("div").animate({ opacity: 0 }, { easing: "linear(0, 1)" });
1605
+ } catch {
1606
+ return !1;
1607
+ }
1608
+ return !0;
1609
+ }, "linearEasing");
1610
+ function ys(e) {
1611
+ return !!(typeof e == "function" && at() || !e || typeof e == "string" && (e in Xt || at()) || ge(e) || Array.isArray(e) && e.every(ys));
1612
+ }
1613
+ const tt = ([e, t, n, s]) => `cubic-bezier(${e}, ${t}, ${n}, ${s})`, Xt = {
1614
+ linear: "linear",
1615
+ ease: "ease",
1616
+ easeIn: "ease-in",
1617
+ easeOut: "ease-out",
1618
+ easeInOut: "ease-in-out",
1619
+ circIn: /* @__PURE__ */ tt([0, 0.65, 0.55, 1]),
1620
+ circOut: /* @__PURE__ */ tt([0.55, 0, 1, 0.45]),
1621
+ backIn: /* @__PURE__ */ tt([0.31, 0.01, 0.66, -0.59]),
1622
+ backOut: /* @__PURE__ */ tt([0.33, 1.53, 0.69, 0.99])
1623
+ };
1624
+ function vs(e, t) {
1625
+ if (e)
1626
+ return typeof e == "function" && at() ? kr(e, t) : ge(e) ? tt(e) : Array.isArray(e) ? e.map((n) => vs(n, t) || Xt.easeOut) : Xt[e];
1627
+ }
1628
+ function bs(e, t, n, { delay: s = 0, duration: i = 300, repeat: r = 0, repeatType: o = "loop", ease: a, times: l } = {}) {
1629
+ const u = { [t]: n };
1630
+ l && (u.offset = l);
1631
+ const c = vs(a, i);
1632
+ return Array.isArray(c) && (u.easing = c), e.animate(u, {
1633
+ delay: s,
1634
+ duration: i,
1635
+ easing: Array.isArray(c) ? "linear" : c,
1636
+ fill: "both",
1637
+ iterations: r + 1,
1638
+ direction: o === "reverse" ? "alternate" : "normal"
1639
+ });
1640
+ }
1641
+ function Vt(e, t) {
1642
+ e.timeline = t, e.onfinish = null;
1643
+ }
1644
+ const ws = /* @__PURE__ */ Ft(() => Object.hasOwnProperty.call(Element.prototype, "animate")), At = 10, Ur = 2e4;
1645
+ function Hr(e) {
1646
+ return ht(e.type) || e.type === "spring" || !ys(e.ease);
1647
+ }
1648
+ function qr(e, t) {
1649
+ const n = new we({
1650
+ ...t,
1651
+ keyframes: e,
1652
+ repeat: 0,
1653
+ delay: 0,
1654
+ isGenerator: !0
1655
+ });
1656
+ let s = { done: !1, value: e[0] };
1657
+ const i = [];
1658
+ let r = 0;
1659
+ for (; !s.done && r < Ur; )
1660
+ s = n.sample(r), i.push(s.value), r += At;
1661
+ return {
1662
+ times: void 0,
1663
+ keyframes: i,
1664
+ duration: r - At,
1665
+ ease: "linear"
1666
+ };
1667
+ }
1668
+ const Ts = {
1669
+ anticipate: Yn,
1670
+ backInOut: qn,
1671
+ circInOut: Xn
1672
+ };
1673
+ function Yr(e) {
1674
+ return e in Ts;
1675
+ }
1676
+ class nn extends ds {
1677
+ constructor(t) {
1678
+ super(t);
1679
+ const { name: n, motionValue: s, element: i, keyframes: r } = this.options;
1680
+ this.resolver = new hs(r, (o, a) => this.onKeyframesResolved(o, a), n, s, i), this.resolver.scheduleResolve();
1681
+ }
1682
+ initPlayback(t, n) {
1683
+ var s;
1684
+ let { duration: i = 300, times: r, ease: o, type: a, motionValue: l, name: u, startTime: c } = this.options;
1685
+ if (!(!((s = l.owner) === null || s === void 0) && s.current))
1686
+ return !1;
1687
+ if (typeof o == "string" && at() && Yr(o) && (o = Ts[o]), Hr(this.options)) {
1688
+ const { onComplete: h, onUpdate: p, motionValue: m, element: w, ...b } = this.options, g = qr(t, b);
1689
+ t = g.keyframes, t.length === 1 && (t[1] = t[0]), i = g.duration, r = g.times, o = g.ease, a = "keyframes";
1690
+ }
1691
+ const f = bs(l.owner.current, u, t, { ...this.options, duration: i, times: r, ease: o });
1692
+ return f.startTime = c ?? this.calcStartTime(), this.pendingTimeline ? (Vt(f, this.pendingTimeline), this.pendingTimeline = void 0) : f.onfinish = () => {
1693
+ const { onComplete: h } = this.options;
1694
+ l.set(pt(t, this.options, n)), h && h(), this.cancel(), this.resolveFinishedPromise();
1695
+ }, {
1696
+ animation: f,
1697
+ duration: i,
1698
+ times: r,
1699
+ type: a,
1700
+ ease: o,
1701
+ keyframes: t
1702
+ };
1703
+ }
1704
+ get duration() {
1705
+ const { resolved: t } = this;
1706
+ if (!t)
1707
+ return 0;
1708
+ const { duration: n } = t;
1709
+ return D(n);
1710
+ }
1711
+ get time() {
1712
+ const { resolved: t } = this;
1713
+ if (!t)
1714
+ return 0;
1715
+ const { animation: n } = t;
1716
+ return D(n.currentTime || 0);
1717
+ }
1718
+ set time(t) {
1719
+ const { resolved: n } = this;
1720
+ if (!n)
1721
+ return;
1722
+ const { animation: s } = n;
1723
+ s.currentTime = C(t);
1724
+ }
1725
+ get speed() {
1726
+ const { resolved: t } = this;
1727
+ if (!t)
1728
+ return 1;
1729
+ const { animation: n } = t;
1730
+ return n.playbackRate;
1731
+ }
1732
+ set speed(t) {
1733
+ const { resolved: n } = this;
1734
+ if (!n)
1735
+ return;
1736
+ const { animation: s } = n;
1737
+ s.playbackRate = t;
1738
+ }
1739
+ get state() {
1740
+ const { resolved: t } = this;
1741
+ if (!t)
1742
+ return "idle";
1743
+ const { animation: n } = t;
1744
+ return n.playState;
1745
+ }
1746
+ get startTime() {
1747
+ const { resolved: t } = this;
1748
+ if (!t)
1749
+ return null;
1750
+ const { animation: n } = t;
1751
+ return n.startTime;
1752
+ }
1753
+ /**
1754
+ * Replace the default DocumentTimeline with another AnimationTimeline.
1755
+ * Currently used for scroll animations.
1756
+ */
1757
+ attachTimeline(t) {
1758
+ if (!this._resolved)
1759
+ this.pendingTimeline = t;
1760
+ else {
1761
+ const { resolved: n } = this;
1762
+ if (!n)
1763
+ return N;
1764
+ const { animation: s } = n;
1765
+ Vt(s, t);
1766
+ }
1767
+ return N;
1768
+ }
1769
+ play() {
1770
+ if (this.isStopped)
1771
+ return;
1772
+ const { resolved: t } = this;
1773
+ if (!t)
1774
+ return;
1775
+ const { animation: n } = t;
1776
+ n.playState === "finished" && this.updateFinishedPromise(), n.play();
1777
+ }
1778
+ pause() {
1779
+ const { resolved: t } = this;
1780
+ if (!t)
1781
+ return;
1782
+ const { animation: n } = t;
1783
+ n.pause();
1784
+ }
1785
+ stop() {
1786
+ if (this.resolver.cancel(), this.isStopped = !0, this.state === "idle")
1787
+ return;
1788
+ this.resolveFinishedPromise(), this.updateFinishedPromise();
1789
+ const { resolved: t } = this;
1790
+ if (!t)
1791
+ return;
1792
+ const { animation: n, keyframes: s, duration: i, type: r, ease: o, times: a } = t;
1793
+ if (n.playState === "idle" || n.playState === "finished")
1794
+ return;
1795
+ if (this.time) {
1796
+ const { motionValue: u, onUpdate: c, onComplete: f, element: h, ...p } = this.options, m = new we({
1797
+ ...p,
1798
+ keyframes: s,
1799
+ duration: i,
1800
+ type: r,
1801
+ ease: o,
1802
+ times: a,
1803
+ isGenerator: !0
1804
+ }), w = C(this.time);
1805
+ u.setWithVelocity(m.sample(w - At).value, m.sample(w).value, At);
1806
+ }
1807
+ const { onStop: l } = this.options;
1808
+ l && l(), this.cancel();
1809
+ }
1810
+ complete() {
1811
+ const { resolved: t } = this;
1812
+ t && t.animation.finish();
1813
+ }
1814
+ cancel() {
1815
+ const { resolved: t } = this;
1816
+ t && t.animation.cancel();
1817
+ }
1818
+ static supports(t) {
1819
+ const { motionValue: n, name: s, repeatDelay: i, repeatType: r, damping: o, type: a } = t;
1820
+ return ws() && s && _r.has(s) && n && n.owner && n.owner.current instanceof HTMLElement && /**
1821
+ * If we're outputting values to onUpdate then we can't use WAAPI as there's
1822
+ * no way to read the value from WAAPI every frame.
1823
+ */
1824
+ !n.owner.getProps().onUpdate && !i && r !== "mirror" && o !== 0 && a !== "inertia";
1825
+ }
1826
+ }
1827
+ function Xr({ when: e, delay: t, delayChildren: n, staggerChildren: s, staggerDirection: i, repeat: r, repeatType: o, repeatDelay: a, from: l, elapsed: u, ...c }) {
1828
+ return !!Object.keys(c).length;
1829
+ }
1830
+ const Ss = (e, t, n, s = {}, i, r) => (o) => {
1831
+ const a = ae(s, e) || {}, l = a.delay || s.delay || 0;
1832
+ let { elapsed: u = 0 } = s;
1833
+ u = u - C(l);
1834
+ let c = {
1835
+ keyframes: Array.isArray(n) ? n : [null, n],
1836
+ ease: "easeOut",
1837
+ velocity: t.getVelocity(),
1838
+ ...a,
1839
+ delay: -u,
1840
+ onUpdate: (h) => {
1841
+ t.set(h), a.onUpdate && a.onUpdate(h);
1842
+ },
1843
+ onComplete: () => {
1844
+ o(), a.onComplete && a.onComplete();
1845
+ },
1846
+ name: e,
1847
+ motionValue: t,
1848
+ element: r ? void 0 : i
1849
+ };
1850
+ Xr(a) || (c = {
1851
+ ...c,
1852
+ ...Ni(e, c)
1853
+ }), c.duration && (c.duration = C(c.duration)), c.repeatDelay && (c.repeatDelay = C(c.repeatDelay)), c.from !== void 0 && (c.keyframes[0] = c.from);
1854
+ let f = !1;
1855
+ if ((c.type === !1 || c.duration === 0 && !c.repeatDelay) && (c.duration = 0, c.delay === 0 && (f = !0)), f && !r && t.get() !== void 0) {
1856
+ const h = pt(c.keyframes, a);
1857
+ if (h !== void 0)
1858
+ return M.update(() => {
1859
+ c.onUpdate(h), c.onComplete();
1860
+ }), new se([]);
1861
+ }
1862
+ return !r && nn.supports(c) ? new nn(c) : new we(c);
1863
+ }, Zr = (e) => Array.isArray(e), Qr = (e) => Zr(e) ? e[e.length - 1] || 0 : e;
1864
+ function sn(e) {
1865
+ const t = [{}, {}];
1866
+ return e == null || e.values.forEach((n, s) => {
1867
+ t[0][s] = n.get(), t[1][s] = n.getVelocity();
1868
+ }), t;
1869
+ }
1870
+ function xs(e, t, n, s) {
1871
+ if (typeof t == "function") {
1872
+ const [i, r] = sn(s);
1873
+ t = t(n !== void 0 ? n : e.custom, i, r);
1874
+ }
1875
+ if (typeof t == "string" && (t = e.variants && e.variants[t]), typeof t == "function") {
1876
+ const [i, r] = sn(s);
1877
+ t = t(n !== void 0 ? n : e.custom, i, r);
1878
+ }
1879
+ return t;
1880
+ }
1881
+ function Jr(e, t, n) {
1882
+ const s = e.getProps();
1883
+ return xs(s, t, s.custom, e);
1884
+ }
1885
+ function to(e, t, n) {
1886
+ e.hasValue(t) ? e.getValue(t).set(n) : e.addValue(t, it(n));
1887
+ }
1888
+ function eo(e, t) {
1889
+ const n = Jr(e, t);
1890
+ let { transitionEnd: s = {}, transition: i = {}, ...r } = n || {};
1891
+ r = { ...r, ...s };
1892
+ for (const o in r) {
1893
+ const a = Qr(r[o]);
1894
+ to(e, o, a);
1895
+ }
1896
+ }
1897
+ const Te = (e) => e.replace(/([a-z])([A-Z])/gu, "$1-$2").toLowerCase(), no = "framerAppearId", so = "data-" + Te(no);
1898
+ function io(e) {
1899
+ return e.props[so];
1900
+ }
1901
+ function ro(e) {
1902
+ return !!(P(e) && e.add);
1903
+ }
1904
+ function oo(e, t) {
1905
+ const n = e.getValue("willChange");
1906
+ if (ro(n))
1907
+ return n.add(t);
1908
+ }
1909
+ function ao({ protectedKeys: e, needsAnimating: t }, n) {
1910
+ const s = e.hasOwnProperty(n) && t[n] !== !0;
1911
+ return t[n] = !1, s;
1912
+ }
1913
+ function lo(e, t, { delay: n = 0, transitionOverride: s, type: i } = {}) {
1914
+ var r;
1915
+ let { transition: o = e.getDefaultTransition(), transitionEnd: a, ...l } = t;
1916
+ s && (o = s);
1917
+ const u = [], c = i && e.animationState && e.animationState.getState()[i];
1918
+ for (const f in l) {
1919
+ const h = e.getValue(f, (r = e.latestValues[f]) !== null && r !== void 0 ? r : null), p = l[f];
1920
+ if (p === void 0 || c && ao(c, f))
1921
+ continue;
1922
+ const m = {
1923
+ delay: n,
1924
+ ...ae(o || {}, f)
1925
+ };
1926
+ let w = !1;
1927
+ if (window.MotionHandoffAnimation) {
1928
+ const g = io(e);
1929
+ if (g) {
1930
+ const y = window.MotionHandoffAnimation(g, f, M);
1931
+ y !== null && (m.startTime = y, w = !0);
1932
+ }
1933
+ }
1934
+ oo(e, f), h.start(Ss(f, h, p, e.shouldReduceMotion && U.has(f) ? { type: !1 } : m, e, w));
1935
+ const b = h.animation;
1936
+ b && u.push(b);
1937
+ }
1938
+ return a && Promise.all(u).then(() => {
1939
+ M.update(() => {
1940
+ a && eo(e, a);
1941
+ });
1942
+ }), u;
1943
+ }
1944
+ function uo(e) {
1945
+ return e instanceof SVGElement && e.tagName !== "svg";
1946
+ }
1947
+ const co = {};
1948
+ function fo(e, { layout: t, layoutId: n }) {
1949
+ return U.has(e) || e.startsWith("origin") || (t || n !== void 0) && (!!co[e] || e === "opacity");
1950
+ }
1951
+ function Vs(e, t, n) {
1952
+ var s;
1953
+ const { style: i } = e, r = {};
1954
+ for (const o in i)
1955
+ (P(i[o]) || t.style && P(t.style[o]) || fo(o, e) || ((s = n == null ? void 0 : n.getValue(o)) === null || s === void 0 ? void 0 : s.liveStyle) !== void 0) && (r[o] = i[o]);
1956
+ return r;
1957
+ }
1958
+ function ho(e, t, n) {
1959
+ const s = Vs(e, t, n);
1960
+ for (const i in e)
1961
+ if (P(e[i]) || P(t[i])) {
1962
+ const r = dt.indexOf(i) !== -1 ? "attr" + i.charAt(0).toUpperCase() + i.substring(1) : i;
1963
+ s[r] = e[i];
1964
+ }
1965
+ return s;
1966
+ }
1967
+ const po = typeof window < "u", Zt = { current: null }, As = { current: !1 };
1968
+ function mo() {
1969
+ if (As.current = !0, !!po)
1970
+ if (window.matchMedia) {
1971
+ const e = window.matchMedia("(prefers-reduced-motion)"), t = () => Zt.current = e.matches;
1972
+ e.addListener(t), t();
1973
+ } else
1974
+ Zt.current = !1;
1975
+ }
1976
+ function go(e) {
1977
+ return e !== null && typeof e == "object" && typeof e.start == "function";
1978
+ }
1979
+ function yo(e) {
1980
+ return typeof e == "string" || Array.isArray(e);
1981
+ }
1982
+ const vo = [
1983
+ "animate",
1984
+ "whileInView",
1985
+ "whileFocus",
1986
+ "whileHover",
1987
+ "whileTap",
1988
+ "whileDrag",
1989
+ "exit"
1990
+ ], bo = ["initial", ...vo];
1991
+ function Es(e) {
1992
+ return go(e.animate) || bo.some((t) => yo(e[t]));
1993
+ }
1994
+ function wo(e) {
1995
+ return !!(Es(e) || e.variants);
1996
+ }
1997
+ function To(e, t, n) {
1998
+ for (const s in t) {
1999
+ const i = t[s], r = n[s];
2000
+ if (P(i))
2001
+ e.addValue(s, i), process.env.NODE_ENV === "development" && Ct(i.version === "11.11.11", `Attempting to mix Framer Motion versions ${i.version} with 11.11.11 may not work as expected.`);
2002
+ else if (P(r))
2003
+ e.addValue(s, it(i, { owner: e }));
2004
+ else if (r !== i)
2005
+ if (e.hasValue(s)) {
2006
+ const o = e.getValue(s);
2007
+ o.liveStyle === !0 ? o.jump(i) : o.hasAnimated || o.set(i);
2008
+ } else {
2009
+ const o = e.getStaticValue(s);
2010
+ e.addValue(s, it(o !== void 0 ? o : i, { owner: e }));
2011
+ }
2012
+ }
2013
+ for (const s in n)
2014
+ t[s] === void 0 && e.removeValue(s);
2015
+ return t;
2016
+ }
2017
+ const rn = {
2018
+ animation: [
2019
+ "animate",
2020
+ "variants",
2021
+ "whileHover",
2022
+ "whileTap",
2023
+ "exit",
2024
+ "whileInView",
2025
+ "whileFocus",
2026
+ "whileDrag"
2027
+ ],
2028
+ exit: ["exit"],
2029
+ drag: ["drag", "dragControls"],
2030
+ focus: ["whileFocus"],
2031
+ hover: ["whileHover", "onHoverStart", "onHoverEnd"],
2032
+ tap: ["whileTap", "onTap", "onTapStart", "onTapCancel"],
2033
+ pan: ["onPan", "onPanStart", "onPanSessionStart", "onPanEnd"],
2034
+ inView: ["whileInView", "onViewportEnter", "onViewportLeave"],
2035
+ layout: ["layout", "layoutId"]
2036
+ }, Qt = {};
2037
+ for (const e in rn)
2038
+ Qt[e] = {
2039
+ isEnabled: (t) => rn[e].some((n) => !!t[n])
2040
+ };
2041
+ const So = [...ss, E, Z], xo = (e) => So.find(ns(e)), on = () => ({ min: 0, max: 0 }), Se = () => ({
2042
+ x: on(),
2043
+ y: on()
2044
+ }), an = [
2045
+ "AnimationStart",
2046
+ "AnimationComplete",
2047
+ "Update",
2048
+ "BeforeLayoutMeasure",
2049
+ "LayoutMeasure",
2050
+ "LayoutAnimationStart",
2051
+ "LayoutAnimationComplete"
2052
+ ];
2053
+ class Ms {
2054
+ /**
2055
+ * This method takes React props and returns found MotionValues. For example, HTML
2056
+ * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays.
2057
+ *
2058
+ * This isn't an abstract method as it needs calling in the constructor, but it is
2059
+ * intended to be one.
2060
+ */
2061
+ scrapeMotionValuesFromProps(t, n, s) {
2062
+ return {};
2063
+ }
2064
+ constructor({ parent: t, props: n, presenceContext: s, reducedMotionConfig: i, blockInitialAnimation: r, visualState: o }, a = {}) {
2065
+ this.current = null, this.children = /* @__PURE__ */ new Set(), this.isVariantNode = !1, this.isControllingVariants = !1, this.shouldReduceMotion = null, this.values = /* @__PURE__ */ new Map(), this.KeyframeResolver = fe, this.features = {}, this.valueSubscriptions = /* @__PURE__ */ new Map(), this.prevMotionValues = {}, this.events = {}, this.propEventSubscriptions = {}, this.notifyUpdate = () => this.notify("Update", this.latestValues), this.render = () => {
2066
+ this.current && (this.triggerBuild(), this.renderInstance(this.current, this.renderState, this.props.style, this.projection));
2067
+ }, this.renderScheduledAt = 0, this.scheduleRender = () => {
2068
+ const h = B.now();
2069
+ this.renderScheduledAt < h && (this.renderScheduledAt = h, M.render(this.render, !1, !0));
2070
+ };
2071
+ const { latestValues: l, renderState: u } = o;
2072
+ this.latestValues = l, this.baseTarget = { ...l }, this.initialValues = n.initial ? { ...l } : {}, this.renderState = u, this.parent = t, this.props = n, this.presenceContext = s, this.depth = t ? t.depth + 1 : 0, this.reducedMotionConfig = i, this.options = a, this.blockInitialAnimation = !!r, this.isControllingVariants = Es(n), this.isVariantNode = wo(n), this.isVariantNode && (this.variantChildren = /* @__PURE__ */ new Set()), this.manuallyAnimateOnMount = !!(t && t.current);
2073
+ const { willChange: c, ...f } = this.scrapeMotionValuesFromProps(n, {}, this);
2074
+ for (const h in f) {
2075
+ const p = f[h];
2076
+ l[h] !== void 0 && P(p) && p.set(l[h], !1);
2077
+ }
2078
+ }
2079
+ mount(t) {
2080
+ this.current = t, L.set(t, this), this.projection && !this.projection.instance && this.projection.mount(t), this.parent && this.isVariantNode && !this.isControllingVariants && (this.removeFromVariantTree = this.parent.addVariantChild(this)), this.values.forEach((n, s) => this.bindToMotionValue(s, n)), As.current || mo(), this.shouldReduceMotion = this.reducedMotionConfig === "never" ? !1 : this.reducedMotionConfig === "always" ? !0 : Zt.current, process.env.NODE_ENV !== "production" && Ct(this.shouldReduceMotion !== !0, "You have Reduced Motion enabled on your device. Animations may not appear as expected."), this.parent && this.parent.children.add(this), this.update(this.props, this.presenceContext);
2081
+ }
2082
+ unmount() {
2083
+ L.delete(this.current), this.projection && this.projection.unmount(), _(this.notifyUpdate), _(this.render), this.valueSubscriptions.forEach((t) => t()), this.valueSubscriptions.clear(), this.removeFromVariantTree && this.removeFromVariantTree(), this.parent && this.parent.children.delete(this);
2084
+ for (const t in this.events)
2085
+ this.events[t].clear();
2086
+ for (const t in this.features) {
2087
+ const n = this.features[t];
2088
+ n && (n.unmount(), n.isMounted = !1);
2089
+ }
2090
+ this.current = null;
2091
+ }
2092
+ bindToMotionValue(t, n) {
2093
+ this.valueSubscriptions.has(t) && this.valueSubscriptions.get(t)();
2094
+ const s = U.has(t), i = n.on("change", (a) => {
2095
+ this.latestValues[t] = a, this.props.onUpdate && M.preRender(this.notifyUpdate), s && this.projection && (this.projection.isTransformDirty = !0);
2096
+ }), r = n.on("renderRequest", this.scheduleRender);
2097
+ let o;
2098
+ window.MotionCheckAppearSync && (o = window.MotionCheckAppearSync(this, t, n)), this.valueSubscriptions.set(t, () => {
2099
+ i(), r(), o && o(), n.owner && n.stop();
2100
+ });
2101
+ }
2102
+ sortNodePosition(t) {
2103
+ return !this.current || !this.sortInstanceNodePosition || this.type !== t.type ? 0 : this.sortInstanceNodePosition(this.current, t.current);
2104
+ }
2105
+ updateFeatures() {
2106
+ let t = "animation";
2107
+ for (t in Qt) {
2108
+ const n = Qt[t];
2109
+ if (!n)
2110
+ continue;
2111
+ const { isEnabled: s, Feature: i } = n;
2112
+ if (!this.features[t] && i && s(this.props) && (this.features[t] = new i(this)), this.features[t]) {
2113
+ const r = this.features[t];
2114
+ r.isMounted ? r.update() : (r.mount(), r.isMounted = !0);
2115
+ }
2116
+ }
2117
+ }
2118
+ triggerBuild() {
2119
+ this.build(this.renderState, this.latestValues, this.props);
2120
+ }
2121
+ /**
2122
+ * Measure the current viewport box with or without transforms.
2123
+ * Only measures axis-aligned boxes, rotate and skew must be manually
2124
+ * removed with a re-render to work.
2125
+ */
2126
+ measureViewportBox() {
2127
+ return this.current ? this.measureInstanceViewportBox(this.current, this.props) : Se();
2128
+ }
2129
+ getStaticValue(t) {
2130
+ return this.latestValues[t];
2131
+ }
2132
+ setStaticValue(t, n) {
2133
+ this.latestValues[t] = n;
2134
+ }
2135
+ /**
2136
+ * Update the provided props. Ensure any newly-added motion values are
2137
+ * added to our map, old ones removed, and listeners updated.
2138
+ */
2139
+ update(t, n) {
2140
+ (t.transformTemplate || this.props.transformTemplate) && this.scheduleRender(), this.prevProps = this.props, this.props = t, this.prevPresenceContext = this.presenceContext, this.presenceContext = n;
2141
+ for (let s = 0; s < an.length; s++) {
2142
+ const i = an[s];
2143
+ this.propEventSubscriptions[i] && (this.propEventSubscriptions[i](), delete this.propEventSubscriptions[i]);
2144
+ const r = "on" + i, o = t[r];
2145
+ o && (this.propEventSubscriptions[i] = this.on(i, o));
2146
+ }
2147
+ this.prevMotionValues = To(this, this.scrapeMotionValuesFromProps(t, this.prevProps, this), this.prevMotionValues), this.handleChildMotionValue && this.handleChildMotionValue();
2148
+ }
2149
+ getProps() {
2150
+ return this.props;
2151
+ }
2152
+ /**
2153
+ * Returns the variant definition with a given name.
2154
+ */
2155
+ getVariant(t) {
2156
+ return this.props.variants ? this.props.variants[t] : void 0;
2157
+ }
2158
+ /**
2159
+ * Returns the defined default transition on this component.
2160
+ */
2161
+ getDefaultTransition() {
2162
+ return this.props.transition;
2163
+ }
2164
+ getTransformPagePoint() {
2165
+ return this.props.transformPagePoint;
2166
+ }
2167
+ getClosestVariantNode() {
2168
+ return this.isVariantNode ? this : this.parent ? this.parent.getClosestVariantNode() : void 0;
2169
+ }
2170
+ /**
2171
+ * Add a child visual element to our set of children.
2172
+ */
2173
+ addVariantChild(t) {
2174
+ const n = this.getClosestVariantNode();
2175
+ if (n)
2176
+ return n.variantChildren && n.variantChildren.add(t), () => n.variantChildren.delete(t);
2177
+ }
2178
+ /**
2179
+ * Add a motion value and bind it to this visual element.
2180
+ */
2181
+ addValue(t, n) {
2182
+ const s = this.values.get(t);
2183
+ n !== s && (s && this.removeValue(t), this.bindToMotionValue(t, n), this.values.set(t, n), this.latestValues[t] = n.get());
2184
+ }
2185
+ /**
2186
+ * Remove a motion value and unbind any active subscriptions.
2187
+ */
2188
+ removeValue(t) {
2189
+ this.values.delete(t);
2190
+ const n = this.valueSubscriptions.get(t);
2191
+ n && (n(), this.valueSubscriptions.delete(t)), delete this.latestValues[t], this.removeValueFromRenderState(t, this.renderState);
2192
+ }
2193
+ /**
2194
+ * Check whether we have a motion value for this key
2195
+ */
2196
+ hasValue(t) {
2197
+ return this.values.has(t);
2198
+ }
2199
+ getValue(t, n) {
2200
+ if (this.props.values && this.props.values[t])
2201
+ return this.props.values[t];
2202
+ let s = this.values.get(t);
2203
+ return s === void 0 && n !== void 0 && (s = it(n === null ? void 0 : n, { owner: this }), this.addValue(t, s)), s;
2204
+ }
2205
+ /**
2206
+ * If we're trying to animate to a previously unencountered value,
2207
+ * we need to check for it in our state and as a last resort read it
2208
+ * directly from the instance (which might have performance implications).
2209
+ */
2210
+ readValue(t, n) {
2211
+ var s;
2212
+ let i = this.latestValues[t] !== void 0 || !this.current ? this.latestValues[t] : (s = this.getBaseTargetFromProps(this.props, t)) !== null && s !== void 0 ? s : this.readValueFromInstance(this.current, t, this.options);
2213
+ return i != null && (typeof i == "string" && (Qn(i) || Zn(i)) ? i = parseFloat(i) : !xo(i) && Z.test(n) && (i = fs(t, n)), this.setBaseTarget(t, P(i) ? i.get() : i)), P(i) ? i.get() : i;
2214
+ }
2215
+ /**
2216
+ * Set the base target to later animate back to. This is currently
2217
+ * only hydrated on creation and when we first read a value.
2218
+ */
2219
+ setBaseTarget(t, n) {
2220
+ this.baseTarget[t] = n;
2221
+ }
2222
+ /**
2223
+ * Find the base target for a value thats been removed from all animation
2224
+ * props.
2225
+ */
2226
+ getBaseTarget(t) {
2227
+ var n;
2228
+ const { initial: s } = this.props;
2229
+ let i;
2230
+ if (typeof s == "string" || typeof s == "object") {
2231
+ const o = xs(this.props, s, (n = this.presenceContext) === null || n === void 0 ? void 0 : n.custom);
2232
+ o && (i = o[t]);
2233
+ }
2234
+ if (s && i !== void 0)
2235
+ return i;
2236
+ const r = this.getBaseTargetFromProps(this.props, t);
2237
+ return r !== void 0 && !P(r) ? r : this.initialValues[t] !== void 0 && i === void 0 ? void 0 : this.baseTarget[t];
2238
+ }
2239
+ on(t, n) {
2240
+ return this.events[t] || (this.events[t] = new Ln()), this.events[t].add(n);
2241
+ }
2242
+ notify(t, ...n) {
2243
+ this.events[t] && this.events[t].notify(...n);
2244
+ }
2245
+ }
2246
+ class Ps extends Ms {
2247
+ constructor() {
2248
+ super(...arguments), this.KeyframeResolver = hs;
2249
+ }
2250
+ sortInstanceNodePosition(t, n) {
2251
+ return t.compareDocumentPosition(n) & 2 ? 1 : -1;
2252
+ }
2253
+ getBaseTargetFromProps(t, n) {
2254
+ return t.style ? t.style[n] : void 0;
2255
+ }
2256
+ removeValueFromRenderState(t, { vars: n, style: s }) {
2257
+ delete n[t], delete s[t];
2258
+ }
2259
+ }
2260
+ const Cs = (e, t) => t && typeof e == "number" ? t.transform(e) : e, Vo = {
2261
+ x: "translateX",
2262
+ y: "translateY",
2263
+ z: "translateZ",
2264
+ transformPerspective: "perspective"
2265
+ }, Ao = dt.length;
2266
+ function Eo(e, t, n) {
2267
+ let s = "", i = !0;
2268
+ for (let r = 0; r < Ao; r++) {
2269
+ const o = dt[r], a = e[o];
2270
+ if (a === void 0)
2271
+ continue;
2272
+ let l = !0;
2273
+ if (typeof a == "number" ? l = a === (o.startsWith("scale") ? 1 : 0) : l = parseFloat(a) === 0, !l || n) {
2274
+ const u = Cs(a, pe[o]);
2275
+ if (!l) {
2276
+ i = !1;
2277
+ const c = Vo[o] || o;
2278
+ s += `${c}(${u}) `;
2279
+ }
2280
+ n && (t[o] = u);
2281
+ }
2282
+ }
2283
+ return s = s.trim(), n ? s = n(t, i ? "" : s) : i && (s = "none"), s;
2284
+ }
2285
+ function Fs(e, t, n) {
2286
+ const { style: s, vars: i, transformOrigin: r } = e;
2287
+ let o = !1, a = !1;
2288
+ for (const l in t) {
2289
+ const u = t[l];
2290
+ if (U.has(l)) {
2291
+ o = !0;
2292
+ continue;
2293
+ } else if (ts(l)) {
2294
+ i[l] = u;
2295
+ continue;
2296
+ } else {
2297
+ const c = Cs(u, pe[l]);
2298
+ l.startsWith("origin") ? (a = !0, r[l] = c) : s[l] = c;
2299
+ }
2300
+ }
2301
+ if (t.transform || (o || n ? s.transform = Eo(t, e.transform, n) : s.transform && (s.transform = "none")), a) {
2302
+ const { originX: l = "50%", originY: u = "50%", originZ: c = 0 } = r;
2303
+ s.transformOrigin = `${l} ${u} ${c}`;
2304
+ }
2305
+ }
2306
+ function ln(e, t, n) {
2307
+ return typeof e == "string" ? e : d.transform(t + n * e);
2308
+ }
2309
+ function Mo(e, t, n) {
2310
+ const s = ln(t, e.x, e.width), i = ln(n, e.y, e.height);
2311
+ return `${s} ${i}`;
2312
+ }
2313
+ const Po = {
2314
+ offset: "stroke-dashoffset",
2315
+ array: "stroke-dasharray"
2316
+ }, Co = {
2317
+ offset: "strokeDashoffset",
2318
+ array: "strokeDasharray"
2319
+ };
2320
+ function Fo(e, t, n = 1, s = 0, i = !0) {
2321
+ e.pathLength = 1;
2322
+ const r = i ? Po : Co;
2323
+ e[r.offset] = d.transform(-s);
2324
+ const o = d.transform(t), a = d.transform(n);
2325
+ e[r.array] = `${o} ${a}`;
2326
+ }
2327
+ function Oo(e, {
2328
+ attrX: t,
2329
+ attrY: n,
2330
+ attrScale: s,
2331
+ originX: i,
2332
+ originY: r,
2333
+ pathLength: o,
2334
+ pathSpacing: a = 1,
2335
+ pathOffset: l = 0,
2336
+ // This is object creation, which we try to avoid per-frame.
2337
+ ...u
2338
+ }, c, f) {
2339
+ if (Fs(e, u, f), c) {
2340
+ e.style.viewBox && (e.attrs.viewBox = e.style.viewBox);
2341
+ return;
2342
+ }
2343
+ e.attrs = e.style, e.style = {};
2344
+ const { attrs: h, style: p, dimensions: m } = e;
2345
+ h.transform && (m && (p.transform = h.transform), delete h.transform), m && (i !== void 0 || r !== void 0 || p.transform) && (p.transformOrigin = Mo(m, i !== void 0 ? i : 0.5, r !== void 0 ? r : 0.5)), t !== void 0 && (h.x = t), n !== void 0 && (h.y = n), s !== void 0 && (h.scale = s), o !== void 0 && Fo(h, o, a, l, !1);
2346
+ }
2347
+ const Os = /* @__PURE__ */ new Set([
2348
+ "baseFrequency",
2349
+ "diffuseConstant",
2350
+ "kernelMatrix",
2351
+ "kernelUnitLength",
2352
+ "keySplines",
2353
+ "keyTimes",
2354
+ "limitingConeAngle",
2355
+ "markerHeight",
2356
+ "markerWidth",
2357
+ "numOctaves",
2358
+ "targetX",
2359
+ "targetY",
2360
+ "surfaceScale",
2361
+ "specularConstant",
2362
+ "specularExponent",
2363
+ "stdDeviation",
2364
+ "tableValues",
2365
+ "viewBox",
2366
+ "gradientTransform",
2367
+ "pathLength",
2368
+ "startOffset",
2369
+ "textLength",
2370
+ "lengthAdjust"
2371
+ ]);
2372
+ function Ds(e, { style: t, vars: n }, s, i) {
2373
+ Object.assign(e.style, t, i && i.getProjectionStyles(s));
2374
+ for (const r in n)
2375
+ e.style.setProperty(r, n[r]);
2376
+ }
2377
+ function Do(e, t, n, s) {
2378
+ Ds(e, t, void 0, s);
2379
+ for (const i in t.attrs)
2380
+ e.setAttribute(Os.has(i) ? i : Te(i), t.attrs[i]);
2381
+ }
2382
+ const Ro = (e) => typeof e == "string" && e.toLowerCase() === "svg";
2383
+ class Io extends Ps {
2384
+ constructor() {
2385
+ super(...arguments), this.type = "svg", this.isSVGTag = !1, this.measureInstanceViewportBox = Se;
2386
+ }
2387
+ getBaseTargetFromProps(t, n) {
2388
+ return t[n];
2389
+ }
2390
+ readValueFromInstance(t, n) {
2391
+ if (U.has(n)) {
2392
+ const s = me(n);
2393
+ return s && s.default || 0;
2394
+ }
2395
+ return n = Os.has(n) ? n : Te(n), t.getAttribute(n);
2396
+ }
2397
+ scrapeMotionValuesFromProps(t, n, s) {
2398
+ return ho(t, n, s);
2399
+ }
2400
+ build(t, n, s) {
2401
+ Oo(t, n, this.isSVGTag, s.transformTemplate);
2402
+ }
2403
+ renderInstance(t, n, s, i) {
2404
+ Do(t, n, s, i);
2405
+ }
2406
+ mount(t) {
2407
+ this.isSVGTag = Ro(t.tagName), super.mount(t);
2408
+ }
2409
+ }
2410
+ function Bo({ top: e, left: t, right: n, bottom: s }) {
2411
+ return {
2412
+ x: { min: t, max: n },
2413
+ y: { min: e, max: s }
2414
+ };
2415
+ }
2416
+ function Lo(e, t) {
2417
+ if (!t)
2418
+ return e;
2419
+ const n = t({ x: e.left, y: e.top }), s = t({ x: e.right, y: e.bottom });
2420
+ return {
2421
+ top: n.y,
2422
+ left: n.x,
2423
+ bottom: s.y,
2424
+ right: s.x
2425
+ };
2426
+ }
2427
+ function No(e, t) {
2428
+ return Bo(Lo(e.getBoundingClientRect(), t));
2429
+ }
2430
+ function $o(e) {
2431
+ return window.getComputedStyle(e);
2432
+ }
2433
+ class Ko extends Ps {
2434
+ constructor() {
2435
+ super(...arguments), this.type = "html", this.renderInstance = Ds;
2436
+ }
2437
+ readValueFromInstance(t, n) {
2438
+ if (U.has(n)) {
2439
+ const s = me(n);
2440
+ return s && s.default || 0;
2441
+ } else {
2442
+ const s = $o(t), i = (ts(n) ? s.getPropertyValue(n) : s[n]) || 0;
2443
+ return typeof i == "string" ? i.trim() : i;
2444
+ }
2445
+ }
2446
+ measureInstanceViewportBox(t, { transformPagePoint: n }) {
2447
+ return No(t, n);
2448
+ }
2449
+ build(t, n, s) {
2450
+ Fs(t, n, s.transformTemplate);
2451
+ }
2452
+ scrapeMotionValuesFromProps(t, n, s) {
2453
+ return Vs(t, n, s);
2454
+ }
2455
+ handleChildMotionValue() {
2456
+ this.childSubscription && (this.childSubscription(), delete this.childSubscription);
2457
+ const { children: t } = this.props;
2458
+ P(t) && (this.childSubscription = t.on("change", (n) => {
2459
+ this.current && (this.current.textContent = `${n}`);
2460
+ }));
2461
+ }
2462
+ }
2463
+ function Wo(e, t) {
2464
+ return e in t;
2465
+ }
2466
+ class _o extends Ms {
2467
+ constructor() {
2468
+ super(...arguments), this.type = "object";
2469
+ }
2470
+ readValueFromInstance(t, n) {
2471
+ if (Wo(n, t)) {
2472
+ const s = t[n];
2473
+ if (typeof s == "string" || typeof s == "number")
2474
+ return s;
2475
+ }
2476
+ }
2477
+ getBaseTargetFromProps() {
2478
+ }
2479
+ removeValueFromRenderState(t, n) {
2480
+ delete n.output[t];
2481
+ }
2482
+ measureInstanceViewportBox() {
2483
+ return Se();
2484
+ }
2485
+ build(t, n) {
2486
+ Object.assign(t.output, n);
2487
+ }
2488
+ renderInstance(t, { output: n }) {
2489
+ Object.assign(t, n);
2490
+ }
2491
+ sortInstanceNodePosition() {
2492
+ return 0;
2493
+ }
2494
+ }
2495
+ function Rs(e) {
2496
+ const t = {
2497
+ presenceContext: null,
2498
+ props: {},
2499
+ visualState: {
2500
+ renderState: {
2501
+ transform: {},
2502
+ transformOrigin: {},
2503
+ style: {},
2504
+ vars: {},
2505
+ attrs: {}
2506
+ },
2507
+ latestValues: {}
2508
+ }
2509
+ }, n = uo(e) ? new Io(t) : new Ko(t);
2510
+ n.mount(e), L.set(e, n);
2511
+ }
2512
+ function Go(e) {
2513
+ const t = {
2514
+ presenceContext: null,
2515
+ props: {},
2516
+ visualState: {
2517
+ renderState: {
2518
+ output: {}
2519
+ },
2520
+ latestValues: {}
2521
+ }
2522
+ }, n = new _o(t);
2523
+ n.mount(e), L.set(e, n);
2524
+ }
2525
+ function ko(e, t, n) {
2526
+ const s = P(e) ? e : it(e);
2527
+ return s.start(Ss("", s, t, n)), s.animation;
2528
+ }
2529
+ function zo(e, t) {
2530
+ return P(e) || typeof e == "number" || typeof e == "string" && !oe(t);
2531
+ }
2532
+ function Is(e, t, n, s) {
2533
+ const i = [];
2534
+ if (zo(e, t))
2535
+ i.push(ko(e, oe(t) && t.default || t, n && (n.default || n)));
2536
+ else {
2537
+ const r = Gn(e, t, s), o = r.length;
2538
+ R(!!o, "No valid elements provided.");
2539
+ for (let a = 0; a < o; a++) {
2540
+ const l = r[a], u = l instanceof Element ? Rs : Go;
2541
+ L.has(l) || u(l);
2542
+ const c = L.get(l), f = { ...n };
2543
+ "delay" in f && typeof f.delay == "function" && (f.delay = f.delay(a, o)), i.push(...lo(c, { ...t, transition: f }, {}));
2544
+ }
2545
+ }
2546
+ return i;
2547
+ }
2548
+ function jo(e, t, n) {
2549
+ const s = [];
2550
+ return Pi(e, t, n, { spring: ie }).forEach(({ keyframes: r, transition: o }, a) => {
2551
+ s.push(...Is(a, r, o));
2552
+ }), s;
2553
+ }
2554
+ function Uo(e) {
2555
+ return Array.isArray(e) && Array.isArray(e[0]);
2556
+ }
2557
+ function Ho(e) {
2558
+ function t(n, s, i) {
2559
+ let r = [];
2560
+ Uo(n) ? r = jo(n, s, e) : r = Is(n, s, i, e);
2561
+ const o = new se(r);
2562
+ return e && e.animations.push(o), o;
2563
+ }
2564
+ return t;
2565
+ }
2566
+ const qo = Ho();
2567
+ function Yo(e, t, n) {
2568
+ e.style.setProperty(`--${t}`, n);
2569
+ }
2570
+ function Xo(e, t, n) {
2571
+ e.style[t] = n;
2572
+ }
2573
+ const Zo = /* @__PURE__ */ Ft(() => {
2574
+ try {
2575
+ document.createElement("div").animate({ opacity: [1] });
2576
+ } catch {
2577
+ return !1;
2578
+ }
2579
+ return !0;
2580
+ }), bt = /* @__PURE__ */ new WeakMap();
2581
+ function Qo(e, t, n) {
2582
+ for (let s = 0; s < t.length; s++)
2583
+ t[s] === null && (t[s] = s === 0 ? n() : t[s - 1]), typeof t[s] == "number" && Ht[e] && (t[s] = Ht[e].transform(t[s]));
2584
+ !Zo() && t.length < 2 && t.unshift(n());
2585
+ }
2586
+ const un = "easeOut";
2587
+ function cn(e) {
2588
+ const t = bt.get(e) || /* @__PURE__ */ new Map();
2589
+ return bt.set(e, t), bt.get(e);
2590
+ }
2591
+ class Jo {
2592
+ constructor(t, n, s, i) {
2593
+ const r = n.startsWith("--");
2594
+ this.setValue = r ? Yo : Xo, this.options = i, this.updateFinishedPromise(), R(typeof i.type != "string", `animateMini doesn't support "type" as a string. Did you mean to import { spring } from "framer-motion"?`);
2595
+ const o = cn(t).get(n);
2596
+ o && o.stop();
2597
+ const a = () => n.startsWith("--") ? t.style.getPropertyValue(n) : window.getComputedStyle(t)[n];
2598
+ if (Array.isArray(s) || (s = [s]), Qo(n, s, a), ht(i.type)) {
2599
+ const u = Wn(i, 100, i.type);
2600
+ i.ease = at() ? u.ease : un, i.duration = C(u.duration), i.type = "keyframes";
2601
+ } else
2602
+ i.ease = i.ease || un;
2603
+ this.removeAnimation = () => {
2604
+ var u;
2605
+ return (u = bt.get(t)) === null || u === void 0 ? void 0 : u.delete(n);
2606
+ };
2607
+ const l = () => {
2608
+ this.setValue(t, n, pt(s, this.options)), this.cancel(), this.resolveFinishedPromise();
2609
+ };
2610
+ ws() ? (this.animation = bs(t, n, s, i), i.autoplay === !1 && this.animation.pause(), this.animation.onfinish = l, this.pendingTimeline && Vt(this.animation, this.pendingTimeline), cn(t).set(n, this)) : l();
2611
+ }
2612
+ get duration() {
2613
+ return D(this.options.duration || 300);
2614
+ }
2615
+ get time() {
2616
+ var t;
2617
+ return this.animation ? D(((t = this.animation) === null || t === void 0 ? void 0 : t.currentTime) || 0) : 0;
2618
+ }
2619
+ set time(t) {
2620
+ this.animation && (this.animation.currentTime = C(t));
2621
+ }
2622
+ get speed() {
2623
+ return this.animation ? this.animation.playbackRate : 1;
2624
+ }
2625
+ set speed(t) {
2626
+ this.animation && (this.animation.playbackRate = t);
2627
+ }
2628
+ get state() {
2629
+ return this.animation ? this.animation.playState : "finished";
2630
+ }
2631
+ get startTime() {
2632
+ return this.animation ? this.animation.startTime : null;
2633
+ }
2634
+ play() {
2635
+ this.state === "finished" && this.updateFinishedPromise(), this.animation && this.animation.play();
2636
+ }
2637
+ pause() {
2638
+ this.animation && this.animation.pause();
2639
+ }
2640
+ stop() {
2641
+ !this.animation || this.state === "idle" || this.state === "finished" || (this.animation.commitStyles && this.animation.commitStyles(), this.cancel());
2642
+ }
2643
+ complete() {
2644
+ this.animation && this.animation.finish();
2645
+ }
2646
+ cancel() {
2647
+ this.removeAnimation();
2648
+ try {
2649
+ this.animation && this.animation.cancel();
2650
+ } catch {
2651
+ }
2652
+ }
2653
+ /**
2654
+ * Allows the returned animation to be awaited or promise-chained. Currently
2655
+ * resolves when the animation finishes at all but in a future update could/should
2656
+ * reject if its cancels.
2657
+ */
2658
+ then(t, n) {
2659
+ return this.currentFinishedPromise.then(t, n);
2660
+ }
2661
+ updateFinishedPromise() {
2662
+ this.currentFinishedPromise = new Promise((t) => {
2663
+ this.resolveFinishedPromise = t;
2664
+ });
2665
+ }
2666
+ attachTimeline(t) {
2667
+ return this.animation ? Vt(this.animation, t) : this.pendingTimeline = t, N;
2668
+ }
2669
+ }
2670
+ function ta(e, t, n, s) {
2671
+ const i = Ot(e, s), r = i.length;
2672
+ R(!!r, "No valid element provided.");
2673
+ const o = [];
2674
+ for (let a = 0; a < r; a++) {
2675
+ const l = i[a], u = { ...n };
2676
+ typeof u.delay == "function" && (u.delay = u.delay(a, r));
2677
+ for (const c in t) {
2678
+ const f = t[c], h = {
2679
+ ...ae(n, c)
2680
+ };
2681
+ h.duration = h.duration ? C(h.duration) : h.duration, h.delay = C(h.delay || 0), o.push(new Jo(l, c, f, h));
2682
+ }
2683
+ }
2684
+ return o;
2685
+ }
2686
+ const ea = (e) => {
2687
+ function t(n, s, i) {
2688
+ return new se(ta(n, s, i, e));
2689
+ }
2690
+ return t;
2691
+ }, vl = /* @__PURE__ */ ea(), wt = /* @__PURE__ */ new WeakMap();
2692
+ let K;
2693
+ function na(e, t) {
2694
+ if (t) {
2695
+ const { inlineSize: n, blockSize: s } = t[0];
2696
+ return { width: n, height: s };
2697
+ } else return e instanceof SVGElement && "getBBox" in e ? e.getBBox() : {
2698
+ width: e.offsetWidth,
2699
+ height: e.offsetHeight
2700
+ };
2701
+ }
2702
+ function sa({ target: e, contentRect: t, borderBoxSize: n }) {
2703
+ var s;
2704
+ (s = wt.get(e)) === null || s === void 0 || s.forEach((i) => {
2705
+ i({
2706
+ target: e,
2707
+ contentSize: t,
2708
+ get size() {
2709
+ return na(e, n);
2710
+ }
2711
+ });
2712
+ });
2713
+ }
2714
+ function ia(e) {
2715
+ e.forEach(sa);
2716
+ }
2717
+ function ra() {
2718
+ typeof ResizeObserver > "u" || (K = new ResizeObserver(ia));
2719
+ }
2720
+ function oa(e, t) {
2721
+ K || ra();
2722
+ const n = Ot(e);
2723
+ return n.forEach((s) => {
2724
+ let i = wt.get(s);
2725
+ i || (i = /* @__PURE__ */ new Set(), wt.set(s, i)), i.add(t), K == null || K.observe(s);
2726
+ }), () => {
2727
+ n.forEach((s) => {
2728
+ const i = wt.get(s);
2729
+ i == null || i.delete(t), i != null && i.size || K == null || K.unobserve(s);
2730
+ });
2731
+ };
2732
+ }
2733
+ const Tt = /* @__PURE__ */ new Set();
2734
+ let nt;
2735
+ function aa() {
2736
+ nt = () => {
2737
+ const e = {
2738
+ width: window.innerWidth,
2739
+ height: window.innerHeight
2740
+ }, t = {
2741
+ target: window,
2742
+ size: e,
2743
+ contentSize: e
2744
+ };
2745
+ Tt.forEach((n) => n(t));
2746
+ }, window.addEventListener("resize", nt);
2747
+ }
2748
+ function la(e) {
2749
+ return Tt.add(e), nt || aa(), () => {
2750
+ Tt.delete(e), !Tt.size && nt && (nt = void 0);
2751
+ };
2752
+ }
2753
+ function ua(e, t) {
2754
+ return typeof e == "function" ? la(e) : oa(e, t);
2755
+ }
2756
+ const ca = 50, fn = () => ({
2757
+ current: 0,
2758
+ offset: [],
2759
+ progress: 0,
2760
+ scrollLength: 0,
2761
+ targetOffset: 0,
2762
+ targetLength: 0,
2763
+ containerLength: 0,
2764
+ velocity: 0
2765
+ }), fa = () => ({
2766
+ time: 0,
2767
+ x: fn(),
2768
+ y: fn()
2769
+ }), ha = {
2770
+ x: {
2771
+ length: "Width",
2772
+ position: "Left"
2773
+ },
2774
+ y: {
2775
+ length: "Height",
2776
+ position: "Top"
2777
+ }
2778
+ };
2779
+ function hn(e, t, n, s) {
2780
+ const i = n[t], { length: r, position: o } = ha[t], a = i.current, l = n.time;
2781
+ i.current = e[`scroll${o}`], i.scrollLength = e[`scroll${r}`] - e[`client${r}`], i.offset.length = 0, i.offset[0] = 0, i.offset[1] = i.scrollLength, i.progress = ft(0, i.scrollLength, i.current);
2782
+ const u = s - l;
2783
+ i.velocity = u > ca ? 0 : ne(i.current - a, u);
2784
+ }
2785
+ function da(e, t, n) {
2786
+ hn(e, "x", t, n), hn(e, "y", t, n), t.time = n;
2787
+ }
2788
+ function pa(e, t) {
2789
+ const n = { x: 0, y: 0 };
2790
+ let s = e;
2791
+ for (; s && s !== t; )
2792
+ if (s instanceof HTMLElement)
2793
+ n.x += s.offsetLeft, n.y += s.offsetTop, s = s.offsetParent;
2794
+ else if (s.tagName === "svg") {
2795
+ const i = s.getBoundingClientRect();
2796
+ s = s.parentElement;
2797
+ const r = s.getBoundingClientRect();
2798
+ n.x += i.left - r.left, n.y += i.top - r.top;
2799
+ } else if (s instanceof SVGGraphicsElement) {
2800
+ const { x: i, y: r } = s.getBBox();
2801
+ n.x += i, n.y += r;
2802
+ let o = null, a = s.parentNode;
2803
+ for (; !o; )
2804
+ a.tagName === "svg" && (o = a), a = s.parentNode;
2805
+ s = o;
2806
+ } else
2807
+ break;
2808
+ return n;
2809
+ }
2810
+ const ma = {
2811
+ Enter: [
2812
+ [0, 1],
2813
+ [1, 1]
2814
+ ],
2815
+ Exit: [
2816
+ [0, 0],
2817
+ [1, 0]
2818
+ ],
2819
+ Any: [
2820
+ [1, 0],
2821
+ [0, 1]
2822
+ ],
2823
+ All: [
2824
+ [0, 0],
2825
+ [1, 1]
2826
+ ]
2827
+ }, Jt = {
2828
+ start: 0,
2829
+ center: 0.5,
2830
+ end: 1
2831
+ };
2832
+ function dn(e, t, n = 0) {
2833
+ let s = 0;
2834
+ if (e in Jt && (e = Jt[e]), typeof e == "string") {
2835
+ const i = parseFloat(e);
2836
+ e.endsWith("px") ? s = i : e.endsWith("%") ? e = i / 100 : e.endsWith("vw") ? s = i / 100 * document.documentElement.clientWidth : e.endsWith("vh") ? s = i / 100 * document.documentElement.clientHeight : e = i;
2837
+ }
2838
+ return typeof e == "number" && (s = t * e), n + s;
2839
+ }
2840
+ const ga = [0, 0];
2841
+ function ya(e, t, n, s) {
2842
+ let i = Array.isArray(e) ? e : ga, r = 0, o = 0;
2843
+ return typeof e == "number" ? i = [e, e] : typeof e == "string" && (e = e.trim(), e.includes(" ") ? i = e.split(" ") : i = [e, Jt[e] ? e : "0"]), r = dn(i[0], n, s), o = dn(i[1], t), r - o;
2844
+ }
2845
+ const va = { x: 0, y: 0 };
2846
+ function ba(e) {
2847
+ return "getBBox" in e && e.tagName !== "svg" ? e.getBBox() : { width: e.clientWidth, height: e.clientHeight };
2848
+ }
2849
+ function wa(e, t, n) {
2850
+ const { offset: s = ma.All } = n, { target: i = e, axis: r = "y" } = n, o = r === "y" ? "height" : "width", a = i !== e ? pa(i, e) : va, l = i === e ? { width: e.scrollWidth, height: e.scrollHeight } : ba(i), u = {
2851
+ width: e.clientWidth,
2852
+ height: e.clientHeight
2853
+ };
2854
+ t[r].offset.length = 0;
2855
+ let c = !t[r].interpolate;
2856
+ const f = s.length;
2857
+ for (let h = 0; h < f; h++) {
2858
+ const p = ya(s[h], u[o], l[o], a[r]);
2859
+ !c && p !== t[r].interpolatorOffsets[h] && (c = !0), t[r].offset[h] = p;
2860
+ }
2861
+ c && (t[r].interpolate = be(t[r].offset, re(s)), t[r].interpolatorOffsets = [...t[r].offset]), t[r].progress = t[r].interpolate(t[r].current);
2862
+ }
2863
+ function Ta(e, t = e, n) {
2864
+ if (n.x.targetOffset = 0, n.y.targetOffset = 0, t !== e) {
2865
+ let s = t;
2866
+ for (; s && s !== e; )
2867
+ n.x.targetOffset += s.offsetLeft, n.y.targetOffset += s.offsetTop, s = s.offsetParent;
2868
+ }
2869
+ n.x.targetLength = t === e ? t.scrollWidth : t.clientWidth, n.y.targetLength = t === e ? t.scrollHeight : t.clientHeight, n.x.containerLength = e.clientWidth, n.y.containerLength = e.clientHeight, process.env.NODE_ENV !== "production" && e && t && t !== e && Ct(getComputedStyle(e).position !== "static", "Please ensure that the container has a non-static position, like 'relative', 'fixed', or 'absolute' to ensure scroll offset is calculated correctly.");
2870
+ }
2871
+ function Sa(e, t, n, s = {}) {
2872
+ return {
2873
+ measure: () => Ta(e, s.target, n),
2874
+ update: (i) => {
2875
+ da(e, n, i), (s.offset || s.target) && wa(e, n, s);
2876
+ },
2877
+ notify: () => t(n)
2878
+ };
2879
+ }
2880
+ const Q = /* @__PURE__ */ new WeakMap(), pn = /* @__PURE__ */ new WeakMap(), $t = /* @__PURE__ */ new WeakMap(), mn = (e) => e === document.documentElement ? window : e;
2881
+ function xe(e, { container: t = document.documentElement, ...n } = {}) {
2882
+ let s = $t.get(t);
2883
+ s || (s = /* @__PURE__ */ new Set(), $t.set(t, s));
2884
+ const i = fa(), r = Sa(t, e, i, n);
2885
+ if (s.add(r), !Q.has(t)) {
2886
+ const a = () => {
2887
+ for (const h of s)
2888
+ h.measure();
2889
+ }, l = () => {
2890
+ for (const h of s)
2891
+ h.update(st.timestamp);
2892
+ }, u = () => {
2893
+ for (const h of s)
2894
+ h.notify();
2895
+ }, c = () => {
2896
+ M.read(a, !1, !0), M.read(l, !1, !0), M.update(u, !1, !0);
2897
+ };
2898
+ Q.set(t, c);
2899
+ const f = mn(t);
2900
+ window.addEventListener("resize", c, { passive: !0 }), t !== document.documentElement && pn.set(t, ua(t, c)), f.addEventListener("scroll", c, { passive: !0 });
2901
+ }
2902
+ const o = Q.get(t);
2903
+ return M.read(o, !1, !0), () => {
2904
+ var a;
2905
+ _(o);
2906
+ const l = $t.get(t);
2907
+ if (!l || (l.delete(r), l.size))
2908
+ return;
2909
+ const u = Q.get(t);
2910
+ Q.delete(t), u && (mn(t).removeEventListener("scroll", u), (a = pn.get(t)) === null || a === void 0 || a(), window.removeEventListener("resize", u));
2911
+ };
2912
+ }
2913
+ function Bs(e, t) {
2914
+ let n;
2915
+ const s = () => {
2916
+ const { currentTime: i } = t, o = (i === null ? 0 : i.value) / 100;
2917
+ n !== o && e(o), n = o;
2918
+ };
2919
+ return M.update(s, !0), () => _(s);
2920
+ }
2921
+ function xa({ source: e, container: t, axis: n = "y" }) {
2922
+ e && (t = e);
2923
+ const s = { value: 0 }, i = xe((r) => {
2924
+ s.value = r[n].progress * 100;
2925
+ }, { container: t, axis: n });
2926
+ return { currentTime: s, cancel: i };
2927
+ }
2928
+ const Kt = /* @__PURE__ */ new Map();
2929
+ function Ls({ source: e, container: t = document.documentElement, axis: n = "y" } = {}) {
2930
+ e && (t = e), Kt.has(t) || Kt.set(t, {});
2931
+ const s = Kt.get(t);
2932
+ return s[n] || (s[n] = Nn() ? new ScrollTimeline({ source: t, axis: n }) : xa({ source: t, axis: n })), s[n];
2933
+ }
2934
+ function Va(e) {
2935
+ return e.length === 2;
2936
+ }
2937
+ function Ns(e) {
2938
+ return e && (e.target || e.offset);
2939
+ }
2940
+ function Aa(e, t) {
2941
+ return Va(e) || Ns(t) ? xe((n) => {
2942
+ e(n[t.axis].progress, n);
2943
+ }, t) : Bs(e, Ls(t));
2944
+ }
2945
+ function Ea(e, t) {
2946
+ if (Ns(t))
2947
+ return e.pause(), xe((n) => {
2948
+ e.time = e.duration * n[t.axis].progress;
2949
+ }, t);
2950
+ {
2951
+ const n = Ls(t);
2952
+ return e.attachTimeline(n, (s) => (s.pause(), Bs((i) => {
2953
+ s.time = s.duration * i;
2954
+ }, n)));
2955
+ }
2956
+ }
2957
+ function bl(e, { axis: t = "y", ...n } = {}) {
2958
+ const s = { axis: t, ...n };
2959
+ return typeof e == "function" ? Aa(e, s) : Ea(e, s);
2960
+ }
2961
+ const Ma = {
2962
+ some: 0,
2963
+ all: 1
2964
+ };
2965
+ function Pa(e, t, { root: n, margin: s, amount: i = "some" } = {}) {
2966
+ const r = Ot(e), o = /* @__PURE__ */ new WeakMap(), a = (u) => {
2967
+ u.forEach((c) => {
2968
+ const f = o.get(c.target);
2969
+ if (c.isIntersecting !== !!f)
2970
+ if (c.isIntersecting) {
2971
+ const h = t(c);
2972
+ typeof h == "function" ? o.set(c.target, h) : l.unobserve(c.target);
2973
+ } else f && (f(c), o.delete(c.target));
2974
+ });
2975
+ }, l = new IntersectionObserver(a, {
2976
+ root: n,
2977
+ rootMargin: s,
2978
+ threshold: typeof i == "number" ? i : Ma[i]
2979
+ });
2980
+ return r.forEach((u) => l.observe(u)), () => l.disconnect();
2981
+ }
2982
+ function wl(e, t = "end") {
2983
+ return (n) => {
2984
+ n = t === "end" ? Math.min(n, 0.999) : Math.max(n, 1e-3);
2985
+ const s = n * e, i = t === "end" ? Math.floor(s) : Math.ceil(s);
2986
+ return j(0, 1, i / e);
2987
+ };
2988
+ }
2989
+ function Ca(e, t) {
2990
+ if (e === "first")
2991
+ return 0;
2992
+ {
2993
+ const n = t - 1;
2994
+ return e === "last" ? n : n / 2;
2995
+ }
2996
+ }
2997
+ function Tl(e = 0.1, { startDelay: t = 0, from: n = 0, ease: s } = {}) {
2998
+ return (i, r) => {
2999
+ const o = typeof n == "number" ? n : Ca(n, r), a = Math.abs(o - i);
3000
+ let l = e * a;
3001
+ if (s) {
3002
+ const u = r * e;
3003
+ l = qt(s)(l / u) * u;
3004
+ }
3005
+ return t + l;
3006
+ };
3007
+ }
3008
+ const Fa = (e) => e && typeof e == "object" && e.mix, Oa = (e) => Fa(e) ? e.mix : void 0;
3009
+ function Sl(...e) {
3010
+ const t = !Array.isArray(e[0]), n = t ? 0 : -1, s = e[0 + n], i = e[1 + n], r = e[2 + n], o = e[3 + n], a = be(i, r, {
3011
+ mixer: Oa(r[0]),
3012
+ ...o
3013
+ });
3014
+ return t ? a(s) : a;
3015
+ }
3016
+ function Da(e, t) {
3017
+ const n = B.now(), s = ({ timestamp: i }) => {
3018
+ const r = i - n;
3019
+ r >= t && (_(s), e(r - t));
3020
+ };
3021
+ return M.read(s, !0), () => _(s);
3022
+ }
3023
+ function xl(e, t) {
3024
+ return Da(e, C(t));
3025
+ }
3026
+ const gn = (e, t) => Math.abs(e - t);
3027
+ function Vl(e, t) {
3028
+ const n = gn(e.x, t.x), s = gn(e.y, t.y);
3029
+ return Math.sqrt(n ** 2 + s ** 2);
3030
+ }
3031
+ const Al = M, El = J.reduce((e, t) => (e[t] = (n) => _(n), e), {});
3032
+ function Ra(e) {
3033
+ return typeof e == "function" ? e() : Cn(e);
3034
+ }
3035
+ typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
3036
+ const yn = (e) => typeof e < "u";
3037
+ function Ia(e) {
3038
+ var t;
3039
+ const n = Ra(e);
3040
+ return (t = n == null ? void 0 : n.$el) != null ? t : n;
3041
+ }
3042
+ function Ba() {
3043
+ const e = Fn(), t = zs(() => {
3044
+ var n, s;
3045
+ return ["#text", "#comment"].includes((n = e.value) == null ? void 0 : n.$el.nodeName) ? (s = e.value) == null ? void 0 : s.$el.nextElementSibling : Ia(e);
3046
+ });
3047
+ return {
3048
+ primitiveElement: e,
3049
+ currentElement: t
3050
+ };
3051
+ }
3052
+ function Ve(e, t) {
3053
+ const n = typeof e == "string" && !t ? `${e}Context` : t, s = Symbol(n);
3054
+ return [(o) => {
3055
+ const a = js(s, o);
3056
+ if (a || a === null)
3057
+ return a;
3058
+ throw new Error(
3059
+ `Injection \`${s.toString()}\` not found. Component must be used within ${Array.isArray(e) ? `one of the following components: ${e.join(
3060
+ ", "
3061
+ )}` : `\`${e}\``}`
3062
+ );
3063
+ }, (o) => (Us(s, o), o)];
3064
+ }
3065
+ const [La, Na] = Ve("Motion"), [$a, Ml] = Ve("AnimatePresenceContext");
3066
+ function vn(e, t) {
3067
+ if (typeof e == "object")
3068
+ return e;
3069
+ if (e && t)
3070
+ return t[e];
3071
+ }
3072
+ function Ka(e, t) {
3073
+ return typeof e != typeof t ? !0 : Array.isArray(e) && Array.isArray(t) ? !Wa(e, t) : e !== t;
3074
+ }
3075
+ function Wa(e, t) {
3076
+ const n = t.length;
3077
+ if (n !== e.length)
3078
+ return !1;
3079
+ for (let s = 0; s < n; s++)
3080
+ if (t[s] !== e[s])
3081
+ return !1;
3082
+ return !0;
3083
+ }
3084
+ function _a(e, t) {
3085
+ !e.includes(t) && e.push(t);
3086
+ }
3087
+ function Ga(e, t) {
3088
+ const n = e.indexOf(t);
3089
+ n !== -1 && e.splice(n, 1);
3090
+ }
3091
+ function ka(e, t) {
3092
+ return e[t] ? { ...e, ...e[t] } : { ...e };
3093
+ }
3094
+ function bn(e) {
3095
+ return e == null ? void 0 : e.startsWith("--");
3096
+ }
3097
+ function za() {
3098
+ }
3099
+ const ja = (e) => e;
3100
+ function Ua(e) {
3101
+ return typeof e == "number";
3102
+ }
3103
+ const wn = {
3104
+ syntax: "<angle>",
3105
+ initialValue: "0deg",
3106
+ toDefaultUnit: (e) => `${e}deg`
3107
+ }, Ha = {
3108
+ translate: {
3109
+ syntax: "<length-percentage>",
3110
+ initialValue: "0px",
3111
+ toDefaultUnit: (e) => `${e}px`
3112
+ },
3113
+ rotate: wn,
3114
+ scale: {
3115
+ syntax: "<number>",
3116
+ initialValue: 1,
3117
+ toDefaultUnit: ja
3118
+ },
3119
+ skew: wn
3120
+ }, qa = ["translate", "scale", "rotate", "skew"], Ya = ["", "X", "Y", "Z"], Ae = /* @__PURE__ */ new Map(), Et = ["x", "y", "z"];
3121
+ qa.forEach((e) => {
3122
+ Ya.forEach((t) => {
3123
+ Et.push(e + t), Ae.set(
3124
+ e + t,
3125
+ Ha[e]
3126
+ );
3127
+ });
3128
+ });
3129
+ const Xa = new Set(Et), Za = (e) => Xa.has(e), Tn = {
3130
+ x: "translateX",
3131
+ y: "translateY",
3132
+ z: "translateZ"
3133
+ };
3134
+ function Qa([e], [t]) {
3135
+ return Et.indexOf(e) - Et.indexOf(t);
3136
+ }
3137
+ function Ja(e, [t, n]) {
3138
+ return `${e} ${t}(${n})`;
3139
+ }
3140
+ function tl(e) {
3141
+ return e.sort(Qa).reduce(Ja, "").trim();
3142
+ }
3143
+ const el = {
3144
+ translate: [0, 0],
3145
+ rotate: 0,
3146
+ scale: 1,
3147
+ skew: 0,
3148
+ x: 0,
3149
+ y: 0,
3150
+ z: 0
3151
+ }, $s = {
3152
+ get: (e, t) => {
3153
+ let n = bn(t) ? e.style.getPropertyValue(t) : getComputedStyle(e)[t];
3154
+ if (!n && n !== "0") {
3155
+ const s = Ae.get(t);
3156
+ s && (n = s.initialValue);
3157
+ }
3158
+ return n;
3159
+ },
3160
+ set: (e, t, n) => {
3161
+ bn(t) ? e.style.setProperty(t, n) : e.style[t] = n;
3162
+ }
3163
+ };
3164
+ function Wt(e) {
3165
+ var s;
3166
+ const t = {}, n = [];
3167
+ for (let i in e) {
3168
+ const r = e[i];
3169
+ Za(i) && i in Tn && (i = Tn[i]);
3170
+ let o = Array.isArray(r) ? r[0] : r;
3171
+ const a = Ae.get(i);
3172
+ a ? (o = Ua(r) ? (s = a.toDefaultUnit) == null ? void 0 : s.call(a, r) : r, n.push([i, o])) : t[i] = o;
3173
+ }
3174
+ return n.length && (t.transform = tl(n)), t;
3175
+ }
3176
+ function Ks(e) {
3177
+ return e ? e.flatMap((t) => t.type === Hs ? Ks(t.children) : [t]) : [];
3178
+ }
3179
+ const nl = Pt({
3180
+ name: "PrimitiveSlot",
3181
+ inheritAttrs: !1,
3182
+ setup(e, { attrs: t, slots: n }) {
3183
+ return () => {
3184
+ var l, u;
3185
+ if (!n.default)
3186
+ return null;
3187
+ const s = Ks(n.default()), i = s.findIndex((c) => c.type !== qs);
3188
+ if (i === -1)
3189
+ return s;
3190
+ const r = s[i];
3191
+ (l = r.props) == null || delete l.ref;
3192
+ const o = r.props ? ee(t, r.props) : t;
3193
+ t.class && ((u = r.props) != null && u.class) && delete r.props.class;
3194
+ const a = Ys(r, o);
3195
+ for (const c in o)
3196
+ c.startsWith("on") && (a.props || (a.props = {}), a.props[c] = o[c]);
3197
+ return s.length === 1 ? a : (s[i] = a, s);
3198
+ };
3199
+ }
3200
+ }), sl = Pt({
3201
+ name: "Primitive",
3202
+ inheritAttrs: !1,
3203
+ props: {
3204
+ asChild: {
3205
+ type: Boolean,
3206
+ default: !1
3207
+ },
3208
+ as: {
3209
+ type: [String, Object],
3210
+ default: "div"
3211
+ }
3212
+ },
3213
+ setup(e, { attrs: t, slots: n }) {
3214
+ const s = e.asChild ? "template" : e.as;
3215
+ return typeof s == "string" && ["area", "img", "input"].includes(s) ? () => Rt(s, t) : s !== "template" ? () => Rt(e.as, t, { default: n.default }) : () => Rt(nl, t, { default: n.default });
3216
+ }
3217
+ }), il = [
3218
+ "path",
3219
+ "rect",
3220
+ "circle",
3221
+ "ellipse",
3222
+ "line",
3223
+ "polyline",
3224
+ "polygon",
3225
+ "text",
3226
+ "g",
3227
+ "defs",
3228
+ "use",
3229
+ "symbol",
3230
+ "linearGradient",
3231
+ "radialGradient",
3232
+ "stop",
3233
+ "clipPath",
3234
+ "mask",
3235
+ "pattern",
3236
+ "image",
3237
+ "tspan",
3238
+ "textPath"
3239
+ ];
3240
+ function Sn(e) {
3241
+ return il.includes(e);
3242
+ }
3243
+ var Ws = function() {
3244
+ };
3245
+ process.env.NODE_ENV !== "production" && (Ws = function(e, t) {
3246
+ if (!e)
3247
+ throw new Error(t);
3248
+ });
3249
+ class _s {
3250
+ constructor(t) {
3251
+ this.state = t;
3252
+ }
3253
+ update() {
3254
+ }
3255
+ }
3256
+ class rl {
3257
+ constructor(t) {
3258
+ this.features = [], this.features = [
3259
+ new ol(t),
3260
+ new al(t),
3261
+ new ll(t),
3262
+ new ul(t)
3263
+ ];
3264
+ }
3265
+ mount() {
3266
+ this.features.forEach((t) => t.mount());
3267
+ }
3268
+ unmount() {
3269
+ this.features.forEach((t) => t.unmount());
3270
+ }
3271
+ update() {
3272
+ this.features.forEach((t) => t.update());
3273
+ }
3274
+ }
3275
+ function lt(e, t, n) {
3276
+ e.dispatchEvent(
3277
+ new CustomEvent(t, { detail: { originalEvent: n } })
3278
+ );
3279
+ }
3280
+ class Ee extends _s {
3281
+ updateGestureSubscriptions() {
3282
+ const t = this.isActive();
3283
+ t && !this.removeGestureSubscriptions ? this.removeGestureSubscriptions = this.subscribeEvents() : !t && this.removeGestureSubscriptions && (this.removeGestureSubscriptions(), this.removeGestureSubscriptions = void 0);
3284
+ }
3285
+ unmount() {
3286
+ var t;
3287
+ (t = this.removeGestureSubscriptions) == null || t.call(this);
3288
+ }
3289
+ }
3290
+ function xn(e, t, n) {
3291
+ return (s) => {
3292
+ s.pointerType && s.pointerType !== "mouse" || (n(), lt(e, t, s));
3293
+ };
3294
+ }
3295
+ class ol extends Ee {
3296
+ isActive() {
3297
+ return !!this.state.getOptions().hover;
3298
+ }
3299
+ constructor(t) {
3300
+ super(t), this.subscribeEvents = () => {
3301
+ const n = this.state.getElement(), s = xn(n, "hoverstart", () => {
3302
+ this.state.setActive("hover", !0);
3303
+ }), i = xn(n, "hoverend", () => {
3304
+ this.state.setActive("hover", !1);
3305
+ });
3306
+ return n.addEventListener("pointerenter", s), n.addEventListener("pointerleave", i), () => {
3307
+ n.removeEventListener("pointerenter", s), n.removeEventListener("pointerleave", i);
3308
+ };
3309
+ };
3310
+ }
3311
+ mount() {
3312
+ this.updateGestureSubscriptions();
3313
+ }
3314
+ update() {
3315
+ this.updateGestureSubscriptions();
3316
+ }
3317
+ }
3318
+ class al extends Ee {
3319
+ isActive() {
3320
+ return !!this.state.getOptions().press;
3321
+ }
3322
+ constructor(t) {
3323
+ super(t), this.subscribeEvents = () => {
3324
+ const n = this.state.getElement(), s = (r) => {
3325
+ this.state.setActive("press", !1), lt(n, "pressend", r), window.removeEventListener("pointerup", s);
3326
+ }, i = (r) => {
3327
+ this.state.setActive("press", !0), lt(n, "pressstart", r), window.addEventListener("pointerup", s);
3328
+ };
3329
+ return n.addEventListener("pointerdown", i), () => {
3330
+ n.removeEventListener("pointerdown", i), window.removeEventListener("pointerup", s);
3331
+ };
3332
+ };
3333
+ }
3334
+ mount() {
3335
+ this.updateGestureSubscriptions();
3336
+ }
3337
+ update() {
3338
+ this.updateGestureSubscriptions();
3339
+ }
3340
+ }
3341
+ class ll extends Ee {
3342
+ isActive() {
3343
+ return !!this.state.getOptions().inView;
3344
+ }
3345
+ constructor(t) {
3346
+ super(t), this.subscribeEvents = () => {
3347
+ var r;
3348
+ const n = this.state.getElement(), { once: s, ...i } = ((r = this.state.getOptions()) == null ? void 0 : r.inViewOptions) || {};
3349
+ return Pa(n, (o) => {
3350
+ if (this.state.setActive("inView", !0), lt(n, "viewenter", o), !s)
3351
+ return (a) => {
3352
+ this.state.setActive("inView", !1), lt(n, "viewleave", a);
3353
+ };
3354
+ }, i);
3355
+ };
3356
+ }
3357
+ mount() {
3358
+ this.updateGestureSubscriptions();
3359
+ }
3360
+ update() {
3361
+ this.updateGestureSubscriptions();
3362
+ }
3363
+ }
3364
+ class ul extends _s {
3365
+ constructor() {
3366
+ super(...arguments), this.handlers = {};
3367
+ }
3368
+ mount() {
3369
+ const t = this.state.getElement();
3370
+ t && (this.handlers.motionstart = (n) => {
3371
+ var i, r;
3372
+ const s = n.detail.target;
3373
+ (r = (i = this.state.getOptions()).onMotionStart) == null || r.call(i, s);
3374
+ }, this.handlers.motioncomplete = (n) => {
3375
+ var i, r;
3376
+ const s = n.detail.target;
3377
+ (r = (i = this.state.getOptions()).onMotionComplete) == null || r.call(i, s);
3378
+ }, this.handlers.hoverstart = (n) => {
3379
+ var i, r;
3380
+ const s = n.detail;
3381
+ (r = (i = this.state.getOptions()).onHoverStart) == null || r.call(i, s);
3382
+ }, this.handlers.hoverend = (n) => {
3383
+ var i, r;
3384
+ const s = n.detail;
3385
+ (r = (i = this.state.getOptions()).onHoverEnd) == null || r.call(i, s);
3386
+ }, this.handlers.pressstart = (n) => {
3387
+ var i, r;
3388
+ const s = n.detail;
3389
+ (r = (i = this.state.getOptions()).onPressStart) == null || r.call(i, s);
3390
+ }, this.handlers.pressend = (n) => {
3391
+ var i, r;
3392
+ const s = n.detail;
3393
+ (r = (i = this.state.getOptions()).onPressEnd) == null || r.call(i, s);
3394
+ }, this.handlers.viewenter = (n) => {
3395
+ var i, r;
3396
+ const s = n.detail.target;
3397
+ (r = (i = this.state.getOptions()).onViewEnter) == null || r.call(i, s);
3398
+ }, this.handlers.viewleave = (n) => {
3399
+ var i, r;
3400
+ const s = n.detail.target;
3401
+ (r = (i = this.state.getOptions()).onViewLeave) == null || r.call(i, s);
3402
+ }, Object.entries(this.handlers).forEach(([n, s]) => {
3403
+ t.addEventListener(n, s);
3404
+ }));
3405
+ }
3406
+ unmount() {
3407
+ const t = this.state.getElement();
3408
+ t && Object.entries(this.handlers).forEach(([n, s]) => {
3409
+ s && (t.removeEventListener(n, s), delete this.handlers[n]);
3410
+ });
3411
+ }
3412
+ }
3413
+ let W;
3414
+ const Vn = (e) => e.next(), cl = (e) => e.animateUpdates();
3415
+ function fl() {
3416
+ if (!W)
3417
+ return;
3418
+ const e = W.sort(dl).map(cl);
3419
+ e.forEach(Vn), e.forEach(Vn), W = void 0;
3420
+ }
3421
+ function An(e) {
3422
+ W ? _a(W, e) : (W = [e], requestAnimationFrame(fl));
3423
+ }
3424
+ function hl(e) {
3425
+ W && Ga(W, e);
3426
+ }
3427
+ function dl(e, t) {
3428
+ return e.getDepth() - t.getDepth();
3429
+ }
3430
+ function En(e, t, n) {
3431
+ return new CustomEvent(e, { detail: { target: t, isExit: n } });
3432
+ }
3433
+ const Mn = ["initial", "animate", "inView", "hover", "press", "exit"], Mt = /* @__PURE__ */ new WeakMap();
3434
+ class pl {
3435
+ constructor(t, n) {
3436
+ this.element = null, this.context = {}, this.activeStates = {
3437
+ initial: !0,
3438
+ animate: !0
3439
+ }, this.options = t, this.parent = n, this.depth = (n == null ? void 0 : n.depth) + 1 || 0, this.initContext();
3440
+ const s = t.initial === !1 ? "animate" : "initial";
3441
+ this.featureManager = new rl(this), this.initTarget(s);
3442
+ }
3443
+ initContext() {
3444
+ var t;
3445
+ for (const n of Mn)
3446
+ this.context[n] = typeof this.options[n] == "string" ? this.options[n] : (t = this.parent) == null ? void 0 : t.context[n];
3447
+ }
3448
+ initTarget(t) {
3449
+ this.baseTarget = vn(this.options[t] || this.context[t], this.options.variants) || {}, this.target = { ...this.baseTarget };
3450
+ }
3451
+ get initial() {
3452
+ return yn(this.options.initial) ? this.options.initial : this.context.initial;
3453
+ }
3454
+ mount(t) {
3455
+ var s;
3456
+ Ws(
3457
+ !!t,
3458
+ "Animation state must be mounted with valid Element"
3459
+ ), this.element = t, Mt.set(t, this), L.get(t) || Rs(t);
3460
+ const n = L.get(t);
3461
+ if (n.update(this.options, (s = this.parent) == null ? void 0 : s.context), typeof this.initial == "object")
3462
+ for (const i in this.initial)
3463
+ n.setStaticValue(i, this.initial[i]);
3464
+ else if (typeof this.initial == "string" && this.options.variants)
3465
+ for (const i in this.options.variants[this.initial])
3466
+ n.setStaticValue(i, this.options.variants[this.initial][i]);
3467
+ this.featureManager.mount();
3468
+ }
3469
+ unmount() {
3470
+ var t;
3471
+ Mt.delete(this.element), hl(this), (t = L.get(this.element)) == null || t.unmount(), this.featureManager.unmount();
3472
+ }
3473
+ update(t) {
3474
+ this.options = t, this.featureManager.update(), An(this);
3475
+ }
3476
+ setActive(t, n) {
3477
+ this.element && (this.activeStates[t] = n, An(this));
3478
+ }
3479
+ *animateUpdates() {
3480
+ const t = this.target;
3481
+ this.target = {};
3482
+ const n = {};
3483
+ for (const l of Mn) {
3484
+ if (!this.activeStates[l])
3485
+ continue;
3486
+ const u = vn(
3487
+ yn(this.options[l]) ? this.options[l] : this.context[l],
3488
+ this.options.variants
3489
+ );
3490
+ if (!u)
3491
+ continue;
3492
+ const c = { ...t, ...u };
3493
+ for (const f in c)
3494
+ f !== "transition" && (this.target[f] = u[f], n[f] = ka(
3495
+ u.transition ?? this.options.transition ?? {},
3496
+ f
3497
+ ));
3498
+ }
3499
+ const s = /* @__PURE__ */ new Set([
3500
+ ...Object.keys(this.target),
3501
+ ...Object.keys(t)
3502
+ ]), i = [];
3503
+ s.forEach((l) => {
3504
+ var u;
3505
+ this.target[l] === void 0 && (this.target[l] = this.baseTarget[l]), Ka(t[l], this.target[l]) && ((u = this.baseTarget)[l] ?? (u[l] = $s.get(this.element, l)), i.push(
3506
+ () => qo(
3507
+ this.element,
3508
+ {
3509
+ [l]: this.target[l] === "none" ? el[l] : this.target[l]
3510
+ },
3511
+ n[l] || {}
3512
+ )
3513
+ ));
3514
+ }), yield;
3515
+ const r = i.map((l) => l()).filter(Boolean);
3516
+ if (!r.length)
3517
+ return;
3518
+ const o = this.target;
3519
+ this.element.dispatchEvent(En("motionstart", o));
3520
+ const a = this.activeStates.exit;
3521
+ Promise.all(r).then(() => {
3522
+ this.element.dispatchEvent(En("motioncomplete", {
3523
+ ...o
3524
+ }, a));
3525
+ }).catch(za);
3526
+ }
3527
+ isMounted() {
3528
+ return !!this.element;
3529
+ }
3530
+ getDepth() {
3531
+ return this.depth;
3532
+ }
3533
+ getOptions() {
3534
+ return this.options;
3535
+ }
3536
+ getElement() {
3537
+ return this.element;
3538
+ }
3539
+ getTarget() {
3540
+ return this.target;
3541
+ }
3542
+ }
3543
+ const Pl = /* @__PURE__ */ Pt({
3544
+ __name: "Motion",
3545
+ props: /* @__PURE__ */ Xs({
3546
+ as: {},
3547
+ asChild: { type: Boolean },
3548
+ style: {},
3549
+ hover: {},
3550
+ press: {},
3551
+ inView: {},
3552
+ inViewOptions: {},
3553
+ initial: { type: [String, Object, Boolean] },
3554
+ animate: {},
3555
+ exit: {},
3556
+ variants: {},
3557
+ transition: {},
3558
+ onMotionStart: { type: Function },
3559
+ onMotionComplete: { type: Function },
3560
+ onHoverStart: { type: Function },
3561
+ onHoverEnd: { type: Function },
3562
+ onPressStart: { type: Function },
3563
+ onPressEnd: { type: Function },
3564
+ onViewEnter: { type: Function },
3565
+ onViewLeave: { type: Function }
3566
+ }, {
3567
+ as: "div",
3568
+ asChild: !1,
3569
+ initial: void 0,
3570
+ animate: void 0,
3571
+ hover: void 0,
3572
+ inView: void 0
3573
+ }),
3574
+ setup(e) {
3575
+ const t = e, { initial: n } = $a({ initial: Fn(void 0) }), s = La(null), i = new pl(
3576
+ {
3577
+ ...t
3578
+ },
3579
+ s
3580
+ );
3581
+ Na(i);
3582
+ const { primitiveElement: r, currentElement: o } = Ba();
3583
+ Zs(() => {
3584
+ i.mount(o.value), i.update({
3585
+ ...t,
3586
+ style: { ...t.style, ...Wt(i.getTarget()) },
3587
+ initial: n.value === !1 ? n.value : t.initial === !0 ? void 0 : t.initial
3588
+ });
3589
+ }), Qs(() => {
3590
+ });
3591
+ let a = !1;
3592
+ Js(() => {
3593
+ if (!a && o.value) {
3594
+ a = !0;
3595
+ const c = Wt(i.getTarget());
3596
+ for (const f in c)
3597
+ $s.set(o.value, f, c[f]);
3598
+ }
3599
+ i.update({
3600
+ ...t,
3601
+ initial: n.value === !1 ? n.value : t.initial === !0 ? void 0 : t.initial
3602
+ });
3603
+ });
3604
+ function l() {
3605
+ if (!i.isMounted() && Sn(t.as))
3606
+ return i.getTarget();
3607
+ }
3608
+ function u() {
3609
+ return Sn(t.as) || i.isMounted() ? t.style : { ...t.style, ...Wt(i.getTarget()) };
3610
+ }
3611
+ return (c, f) => (On(), Dn(Cn(sl), ee({
3612
+ ref_key: "primitiveElement",
3613
+ ref: r,
3614
+ as: c.as,
3615
+ "as-child": c.asChild
3616
+ }, l(), {
3617
+ style: u()
3618
+ }), {
3619
+ default: Rn(() => [
3620
+ In(c.$slots, "default")
3621
+ ]),
3622
+ _: 3
3623
+ }, 16, ["as", "as-child", "style"]));
3624
+ }
3625
+ }), te = /* @__PURE__ */ new WeakMap();
3626
+ function Pn(e) {
3627
+ const t = te.get(e);
3628
+ t && e.removeEventListener("motioncomplete", t), te.delete(e);
3629
+ }
3630
+ const [Cl, ml] = Ve("AnimatePresenceContext"), Fl = /* @__PURE__ */ Pt({
3631
+ name: "AnimatePresence",
3632
+ inheritAttrs: !1,
3633
+ __name: "AnimatePresence",
3634
+ props: {
3635
+ mode: { default: "sync" },
3636
+ initial: { type: Boolean, default: !0 },
3637
+ multiple: { type: Boolean, default: !1 },
3638
+ as: {}
3639
+ },
3640
+ setup(e) {
3641
+ const t = e, { initial: n } = ti(t);
3642
+ ml({
3643
+ initial: n
3644
+ });
3645
+ function s(r) {
3646
+ const o = Mt.get(r);
3647
+ o && (Pn(r), o.setActive("exit", !1));
3648
+ }
3649
+ function i(r, o) {
3650
+ const a = Mt.get(r);
3651
+ if (!a)
3652
+ return o();
3653
+ a.setActive("exit", !0), Pn(r);
3654
+ function l(u) {
3655
+ var c;
3656
+ (c = u == null ? void 0 : u.detail) != null && c.isExit && o();
3657
+ }
3658
+ te.set(r, l), r.addEventListener("motioncomplete", l);
3659
+ }
3660
+ return (r, o) => (On(), Dn(ei(r.multiple ? ni : si), ee({
3661
+ tag: r.multiple ? r.as : void 0,
3662
+ css: !1,
3663
+ mode: r.mode === "wait" ? "out-in" : void 0
3664
+ }, r.$attrs, {
3665
+ onEnter: s,
3666
+ onLeave: i
3667
+ }), {
3668
+ default: Rn(() => [
3669
+ In(r.$slots, "default")
3670
+ ]),
3671
+ _: 3
3672
+ }, 16, ["tag", "mode"]));
3673
+ }
3674
+ });
3675
+ export {
3676
+ Fl as AnimatePresence,
3677
+ Pl as Motion,
3678
+ fi as MotionValue,
3679
+ qo as animate,
3680
+ vl as animateMini,
3681
+ Yn as anticipate,
3682
+ le as backIn,
3683
+ qn as backInOut,
3684
+ Hn as backOut,
3685
+ _ as cancelFrame,
3686
+ El as cancelSync,
3687
+ ue as circIn,
3688
+ Xn as circInOut,
3689
+ Gi as circOut,
3690
+ j as clamp,
3691
+ Ho as createScopedAnimate,
3692
+ mt as cubicBezier,
3693
+ xl as delay,
3694
+ gn as distance,
3695
+ Vl as distance2D,
3696
+ Vr as easeIn,
3697
+ ps as easeInOut,
3698
+ Ar as easeOut,
3699
+ M as frame,
3700
+ st as frameData,
3701
+ yl as frameSteps,
3702
+ Pa as inView,
3703
+ Qe as inertia,
3704
+ be as interpolate,
3705
+ R as invariant,
3706
+ xt as keyframes,
3707
+ jn as mirrorEasing,
3708
+ gs as mix,
3709
+ it as motionValue,
3710
+ ye as pipe,
3711
+ ft as progress,
3712
+ Un as reverseEasing,
3713
+ bl as scroll,
3714
+ xe as scrollInfo,
3715
+ ie as spring,
3716
+ Tl as stagger,
3717
+ wl as steps,
3718
+ Al as sync,
3719
+ Sl as transform,
3720
+ ut as warning,
3721
+ Si as wrap
3722
+ };