motion 12.4.10 → 12.4.12

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.
package/dist/cjs/index.js CHANGED
@@ -256,10 +256,10 @@ class NativeAnimationControls {
256
256
  this.cancel();
257
257
  }
258
258
  flatten() {
259
- var _a;
260
- if (!this.animation)
259
+ var _a, _b;
260
+ if (!this.animation || !((_a = this.options) === null || _a === void 0 ? void 0 : _a.allowFlatten))
261
261
  return;
262
- (_a = this.animation.effect) === null || _a === void 0 ? void 0 : _a.updateTiming({ easing: "linear" });
262
+ (_b = this.animation.effect) === null || _b === void 0 ? void 0 : _b.updateTiming({ easing: "linear" });
263
263
  }
264
264
  attachTimeline(timeline) {
265
265
  if (this.animation)
@@ -1628,7 +1628,7 @@ class MotionValue {
1628
1628
  * This will be replaced by the build step with the latest version number.
1629
1629
  * When MotionValues are provided to motion components, warn if versions are mixed.
1630
1630
  */
1631
- this.version = "12.4.10";
1631
+ this.version = "12.4.12";
1632
1632
  /**
1633
1633
  * Tracks whether this value can output a velocity. Currently this is only true
1634
1634
  * if the value is numerical, but we might be able to widen the scope here and support
@@ -3077,6 +3077,8 @@ class BaseAnimation {
3077
3077
  return this.currentFinishedPromise.then(resolve, reject);
3078
3078
  }
3079
3079
  flatten() {
3080
+ if (!this.options.allowFlatten)
3081
+ return;
3080
3082
  this.options.type = "keyframes";
3081
3083
  this.options.ease = "linear";
3082
3084
  }
@@ -4324,7 +4326,7 @@ const animateMotionValue = (name, value, target, transition = {}, element, isHan
4324
4326
  };
4325
4327
  /**
4326
4328
  * If there's no transition defined for this value, we can generate
4327
- * unqiue transition settings for this value.
4329
+ * unique transition settings for this value.
4328
4330
  */
4329
4331
  if (!isTransitionDefined(valueTransition)) {
4330
4332
  options = {
@@ -4354,6 +4356,11 @@ const animateMotionValue = (name, value, target, transition = {}, element, isHan
4354
4356
  shouldSkip = true;
4355
4357
  }
4356
4358
  }
4359
+ /**
4360
+ * If the transition type or easing has been explicitly set by the user
4361
+ * then we don't want to allow flattening the animation.
4362
+ */
4363
+ options.allowFlatten = !valueTransition.type && !valueTransition.ease;
4357
4364
  /**
4358
4365
  * If we can or must skip creating the animation, and apply only
4359
4366
  * the final keyframe, do so. We also check once keyframes are resolved but
@@ -4564,7 +4571,7 @@ function updateMotionValuesFromProps(element, next, prev) {
4564
4571
  * and warn against mismatches.
4565
4572
  */
4566
4573
  if (process.env.NODE_ENV === "development") {
4567
- warnOnce(nextValue.version === "12.4.10", `Attempting to mix Motion versions ${nextValue.version} with 12.4.10 may not work as expected.`);
4574
+ warnOnce(nextValue.version === "12.4.12", `Attempting to mix Motion versions ${nextValue.version} with 12.4.12 may not work as expected.`);
4568
4575
  }
4569
4576
  }
4570
4577
  else if (isMotionValue(prevValue)) {
@@ -5828,6 +5835,8 @@ function animateElements(elementOrSelector, keyframes, options, scope) {
5828
5835
  ? secondsToMilliseconds(valueOptions.duration)
5829
5836
  : valueOptions.duration;
5830
5837
  valueOptions.delay = secondsToMilliseconds(valueOptions.delay || 0);
5838
+ valueOptions.allowFlatten =
5839
+ !elementTransition.type && !elementTransition.ease;
5831
5840
  animations.push(new NativeAnimation(element, valueName, valueKeyframes, valueOptions));
5832
5841
  }
5833
5842
  }
package/dist/cjs/mini.js CHANGED
@@ -250,10 +250,10 @@ class NativeAnimationControls {
250
250
  this.cancel();
251
251
  }
252
252
  flatten() {
253
- var _a;
254
- if (!this.animation)
253
+ var _a, _b;
254
+ if (!this.animation || !((_a = this.options) === null || _a === void 0 ? void 0 : _a.allowFlatten))
255
255
  return;
256
- (_a = this.animation.effect) === null || _a === void 0 ? void 0 : _a.updateTiming({ easing: "linear" });
256
+ (_b = this.animation.effect) === null || _b === void 0 ? void 0 : _b.updateTiming({ easing: "linear" });
257
257
  }
258
258
  attachTimeline(timeline) {
259
259
  if (this.animation)
@@ -975,6 +975,8 @@ function animateElements(elementOrSelector, keyframes, options, scope) {
975
975
  ? secondsToMilliseconds(valueOptions.duration)
976
976
  : valueOptions.duration;
977
977
  valueOptions.delay = secondsToMilliseconds(valueOptions.delay || 0);
978
+ valueOptions.allowFlatten =
979
+ !elementTransition.type && !elementTransition.ease;
978
980
  animations.push(new NativeAnimation(element, valueName, valueKeyframes, valueOptions));
979
981
  }
980
982
  }
@@ -944,7 +944,7 @@ class MotionValue {
944
944
  * This will be replaced by the build step with the latest version number.
945
945
  * When MotionValues are provided to motion components, warn if versions are mixed.
946
946
  */
947
- this.version = "12.4.10";
947
+ this.version = "12.4.12";
948
948
  /**
949
949
  * Tracks whether this value can output a velocity. Currently this is only true
950
950
  * if the value is numerical, but we might be able to widen the scope here and support
@@ -2363,6 +2363,8 @@ class BaseAnimation {
2363
2363
  return this.currentFinishedPromise.then(resolve, reject);
2364
2364
  }
2365
2365
  flatten() {
2366
+ if (!this.options.allowFlatten)
2367
+ return;
2366
2368
  this.options.type = "keyframes";
2367
2369
  this.options.ease = "linear";
2368
2370
  }
@@ -3923,7 +3925,7 @@ const animateMotionValue = (name, value, target, transition = {}, element, isHan
3923
3925
  };
3924
3926
  /**
3925
3927
  * If there's no transition defined for this value, we can generate
3926
- * unqiue transition settings for this value.
3928
+ * unique transition settings for this value.
3927
3929
  */
3928
3930
  if (!isTransitionDefined(valueTransition)) {
3929
3931
  options = {
@@ -3953,6 +3955,11 @@ const animateMotionValue = (name, value, target, transition = {}, element, isHan
3953
3955
  shouldSkip = true;
3954
3956
  }
3955
3957
  }
3958
+ /**
3959
+ * If the transition type or easing has been explicitly set by the user
3960
+ * then we don't want to allow flattening the animation.
3961
+ */
3962
+ options.allowFlatten = !valueTransition.type && !valueTransition.ease;
3956
3963
  /**
3957
3964
  * If we can or must skip creating the animation, and apply only
3958
3965
  * the final keyframe, do so. We also check once keyframes are resolved but
@@ -4882,6 +4889,11 @@ function measurePageBox(element, rootProjectionNode, transformPagePoint) {
4882
4889
  return viewportBox;
4883
4890
  }
4884
4891
 
4892
+ // Fixes https://github.com/motiondivision/motion/issues/2270
4893
+ const getContextWindow = ({ current }) => {
4894
+ return current ? current.ownerDocument.defaultView : null;
4895
+ };
4896
+
4885
4897
  function isRefObject(ref) {
4886
4898
  return (ref &&
4887
4899
  typeof ref === "object" &&
@@ -4900,7 +4912,7 @@ function distance2D(a, b) {
4900
4912
  * @internal
4901
4913
  */
4902
4914
  class PanSession {
4903
- constructor(event, handlers, { transformPagePoint, dragSnapToOrigin = false } = {}) {
4915
+ constructor(event, handlers, { transformPagePoint, contextWindow, dragSnapToOrigin = false, } = {}) {
4904
4916
  /**
4905
4917
  * @internal
4906
4918
  */
@@ -4917,6 +4929,10 @@ class PanSession {
4917
4929
  * @internal
4918
4930
  */
4919
4931
  this.handlers = {};
4932
+ /**
4933
+ * @internal
4934
+ */
4935
+ this.contextWindow = window;
4920
4936
  this.updatePoint = () => {
4921
4937
  if (!(this.lastMoveEvent && this.lastMoveEventInfo))
4922
4938
  return;
@@ -4939,32 +4955,19 @@ class PanSession {
4939
4955
  onMove && onMove(this.lastMoveEvent, info);
4940
4956
  };
4941
4957
  this.handlePointerMove = (event, info) => {
4942
- this.index = getElementIndex(event.currentTarget);
4943
- if (event.target instanceof Element &&
4944
- event.target.hasPointerCapture &&
4945
- event.pointerId !== undefined) {
4946
- try {
4947
- if (!event.target.hasPointerCapture(event.pointerId)) {
4948
- return;
4949
- }
4950
- }
4951
- catch (e) { }
4952
- }
4953
4958
  this.lastMoveEvent = event;
4954
4959
  this.lastMoveEventInfo = transformPoint(info, this.transformPagePoint);
4955
4960
  // Throttle mouse move event to once per frame
4956
4961
  frame.update(this.updatePoint, true);
4957
4962
  };
4958
4963
  this.handlePointerUp = (event, info) => {
4959
- capturePointer(event, "release");
4960
4964
  this.end();
4961
4965
  const { onEnd, onSessionEnd, resumeAnimation } = this.handlers;
4962
4966
  if (this.dragSnapToOrigin)
4963
4967
  resumeAnimation && resumeAnimation();
4964
4968
  if (!(this.lastMoveEvent && this.lastMoveEventInfo))
4965
4969
  return;
4966
- const panInfo = getPanInfo(event.type === "pointercancel" ||
4967
- event.type === "lostpointercapture"
4970
+ const panInfo = getPanInfo(event.type === "pointercancel"
4968
4971
  ? this.lastMoveEventInfo
4969
4972
  : transformPoint(info, this.transformPagePoint), this.history);
4970
4973
  if (this.startEvent && onEnd) {
@@ -4978,6 +4981,7 @@ class PanSession {
4978
4981
  this.dragSnapToOrigin = dragSnapToOrigin;
4979
4982
  this.handlers = handlers;
4980
4983
  this.transformPagePoint = transformPagePoint;
4984
+ this.contextWindow = contextWindow || window;
4981
4985
  const info = extractEventInfo(event);
4982
4986
  const initialInfo = transformPoint(info, this.transformPagePoint);
4983
4987
  const { point } = initialInfo;
@@ -4986,20 +4990,7 @@ class PanSession {
4986
4990
  const { onSessionStart } = handlers;
4987
4991
  onSessionStart &&
4988
4992
  onSessionStart(event, getPanInfo(initialInfo, this.history));
4989
- capturePointer(event, "set");
4990
- this.removeListeners = pipe(addPointerEvent(event.currentTarget, "pointermove", this.handlePointerMove), addPointerEvent(event.currentTarget, "pointerup", this.handlePointerUp), addPointerEvent(event.currentTarget, "pointercancel", this.handlePointerUp), addPointerEvent(event.currentTarget, "lostpointercapture", (lostPointerEvent, lostPointerInfo) => {
4991
- const index = getElementIndex(lostPointerEvent.currentTarget);
4992
- /**
4993
- * If the pointer has lost capture because it's moved in the DOM
4994
- * then we need to re-capture it.
4995
- */
4996
- if (index !== this.index) {
4997
- capturePointer(lostPointerEvent, "set");
4998
- }
4999
- else {
5000
- this.handlePointerUp(lostPointerEvent, lostPointerInfo);
5001
- }
5002
- }));
4993
+ this.removeListeners = pipe(addPointerEvent(this.contextWindow, "pointermove", this.handlePointerMove), addPointerEvent(this.contextWindow, "pointerup", this.handlePointerUp), addPointerEvent(this.contextWindow, "pointercancel", this.handlePointerUp));
5003
4994
  }
5004
4995
  updateHandlers(handlers) {
5005
4996
  this.handlers = handlers;
@@ -5063,11 +5054,6 @@ function getVelocity(history, timeDelta) {
5063
5054
  }
5064
5055
  return currentVelocity;
5065
5056
  }
5066
- function getElementIndex(element) {
5067
- if (!element.parentNode)
5068
- return -1;
5069
- return Array.from(element.parentNode.children).indexOf(element);
5070
- }
5071
5057
 
5072
5058
  /**
5073
5059
  * Apply constraints to a point. These constraints are both physical along an
@@ -5324,6 +5310,7 @@ class VisualElementDragControls {
5324
5310
  }, {
5325
5311
  transformPagePoint: this.visualElement.getTransformPagePoint(),
5326
5312
  dragSnapToOrigin,
5313
+ contextWindow: getContextWindow(this.visualElement),
5327
5314
  });
5328
5315
  }
5329
5316
  stop(event, info) {
@@ -5689,6 +5676,7 @@ class PanGesture extends Feature {
5689
5676
  onPointerDown(pointerDownEvent) {
5690
5677
  this.session = new PanSession(pointerDownEvent, this.createPanHandlers(), {
5691
5678
  transformPagePoint: this.node.getTransformPagePoint(),
5679
+ contextWindow: getContextWindow(this.node),
5692
5680
  });
5693
5681
  }
5694
5682
  createPanHandlers() {
@@ -9327,7 +9315,7 @@ function updateMotionValuesFromProps(element, next, prev) {
9327
9315
  * and warn against mismatches.
9328
9316
  */
9329
9317
  if (process.env.NODE_ENV === "development") {
9330
- warnOnce(nextValue.version === "12.4.10", `Attempting to mix Motion versions ${nextValue.version} with 12.4.10 may not work as expected.`);
9318
+ warnOnce(nextValue.version === "12.4.12", `Attempting to mix Motion versions ${nextValue.version} with 12.4.12 may not work as expected.`);
9331
9319
  }
9332
9320
  }
9333
9321
  else if (isMotionValue(prevValue)) {
@@ -271,10 +271,10 @@ class NativeAnimationControls {
271
271
  this.cancel();
272
272
  }
273
273
  flatten() {
274
- var _a;
275
- if (!this.animation)
274
+ var _a, _b;
275
+ if (!this.animation || !((_a = this.options) === null || _a === void 0 ? void 0 : _a.allowFlatten))
276
276
  return;
277
- (_a = this.animation.effect) === null || _a === void 0 ? void 0 : _a.updateTiming({ easing: "linear" });
277
+ (_b = this.animation.effect) === null || _b === void 0 ? void 0 : _b.updateTiming({ easing: "linear" });
278
278
  }
279
279
  attachTimeline(timeline) {
280
280
  if (this.animation)
@@ -603,6 +603,8 @@ function animateElements(elementOrSelector, keyframes, options, scope) {
603
603
  ? secondsToMilliseconds(valueOptions.duration)
604
604
  : valueOptions.duration;
605
605
  valueOptions.delay = secondsToMilliseconds(valueOptions.delay || 0);
606
+ valueOptions.allowFlatten =
607
+ !elementTransition.type && !elementTransition.ease;
606
608
  animations.push(new NativeAnimation(element, valueName, valueKeyframes, valueOptions));
607
609
  }
608
610
  }
@@ -105,6 +105,8 @@ class BaseAnimation {
105
105
  return this.currentFinishedPromise.then(resolve, reject);
106
106
  }
107
107
  flatten() {
108
+ if (!this.options.allowFlatten)
109
+ return;
108
110
  this.options.type = "keyframes";
109
111
  this.options.ease = "linear";
110
112
  }
@@ -27,6 +27,8 @@ function animateElements(elementOrSelector, keyframes, options, scope) {
27
27
  ? secondsToMilliseconds(valueOptions.duration)
28
28
  : valueOptions.duration;
29
29
  valueOptions.delay = secondsToMilliseconds(valueOptions.delay || 0);
30
+ valueOptions.allowFlatten =
31
+ !elementTransition.type && !elementTransition.ease;
30
32
  animations.push(new NativeAnimation(element, valueName, valueKeyframes, valueOptions));
31
33
  }
32
34
  }
@@ -45,7 +45,7 @@ const animateMotionValue = (name, value, target, transition = {}, element, isHan
45
45
  };
46
46
  /**
47
47
  * If there's no transition defined for this value, we can generate
48
- * unqiue transition settings for this value.
48
+ * unique transition settings for this value.
49
49
  */
50
50
  if (!isTransitionDefined(valueTransition)) {
51
51
  options = {
@@ -81,6 +81,11 @@ const animateMotionValue = (name, value, target, transition = {}, element, isHan
81
81
  options.duration = 0;
82
82
  options.delay = 0;
83
83
  }
84
+ /**
85
+ * If the transition type or easing has been explicitly set by the user
86
+ * then we don't want to allow flattening the animation.
87
+ */
88
+ options.allowFlatten = !valueTransition.type && !valueTransition.ease;
84
89
  /**
85
90
  * If we can or must skip creating the animation, and apply only
86
91
  * the final keyframe, do so. We also check once keyframes are resolved but
@@ -9,6 +9,7 @@ import { calcLength } from '../../projection/geometry/delta-calc.mjs';
9
9
  import { createBox } from '../../projection/geometry/models.mjs';
10
10
  import { eachAxis } from '../../projection/utils/each-axis.mjs';
11
11
  import { measurePageBox } from '../../projection/utils/measure.mjs';
12
+ import { getContextWindow } from '../../utils/get-context-window.mjs';
12
13
  import { isRefObject } from '../../utils/is-ref-object.mjs';
13
14
  import { mixNumber } from '../../utils/mix/number.mjs';
14
15
  import { percent } from '../../value/types/numbers/units.mjs';
@@ -149,6 +150,7 @@ class VisualElementDragControls {
149
150
  }, {
150
151
  transformPagePoint: this.visualElement.getTransformPagePoint(),
151
152
  dragSnapToOrigin,
153
+ contextWindow: getContextWindow(this.visualElement),
152
154
  });
153
155
  }
154
156
  stop(event, info) {
@@ -1,6 +1,5 @@
1
1
  import '../../../../../motion-utils/dist/es/errors.mjs';
2
2
  import { secondsToMilliseconds, millisecondsToSeconds } from '../../../../../motion-utils/dist/es/time-conversion.mjs';
3
- import { capturePointer } from '../../../../../motion-dom/dist/es/gestures/utils/capture-pointer.mjs';
4
3
  import { isPrimaryPointer } from '../../../../../motion-dom/dist/es/gestures/utils/is-primary-pointer.mjs';
5
4
  import { addPointerEvent } from '../../events/add-pointer-event.mjs';
6
5
  import { extractEventInfo } from '../../events/event-info.mjs';
@@ -12,7 +11,7 @@ import { frame, cancelFrame, frameData } from '../../frameloop/frame.mjs';
12
11
  * @internal
13
12
  */
14
13
  class PanSession {
15
- constructor(event, handlers, { transformPagePoint, dragSnapToOrigin = false } = {}) {
14
+ constructor(event, handlers, { transformPagePoint, contextWindow, dragSnapToOrigin = false, } = {}) {
16
15
  /**
17
16
  * @internal
18
17
  */
@@ -29,6 +28,10 @@ class PanSession {
29
28
  * @internal
30
29
  */
31
30
  this.handlers = {};
31
+ /**
32
+ * @internal
33
+ */
34
+ this.contextWindow = window;
32
35
  this.updatePoint = () => {
33
36
  if (!(this.lastMoveEvent && this.lastMoveEventInfo))
34
37
  return;
@@ -51,32 +54,19 @@ class PanSession {
51
54
  onMove && onMove(this.lastMoveEvent, info);
52
55
  };
53
56
  this.handlePointerMove = (event, info) => {
54
- this.index = getElementIndex(event.currentTarget);
55
- if (event.target instanceof Element &&
56
- event.target.hasPointerCapture &&
57
- event.pointerId !== undefined) {
58
- try {
59
- if (!event.target.hasPointerCapture(event.pointerId)) {
60
- return;
61
- }
62
- }
63
- catch (e) { }
64
- }
65
57
  this.lastMoveEvent = event;
66
58
  this.lastMoveEventInfo = transformPoint(info, this.transformPagePoint);
67
59
  // Throttle mouse move event to once per frame
68
60
  frame.update(this.updatePoint, true);
69
61
  };
70
62
  this.handlePointerUp = (event, info) => {
71
- capturePointer(event, "release");
72
63
  this.end();
73
64
  const { onEnd, onSessionEnd, resumeAnimation } = this.handlers;
74
65
  if (this.dragSnapToOrigin)
75
66
  resumeAnimation && resumeAnimation();
76
67
  if (!(this.lastMoveEvent && this.lastMoveEventInfo))
77
68
  return;
78
- const panInfo = getPanInfo(event.type === "pointercancel" ||
79
- event.type === "lostpointercapture"
69
+ const panInfo = getPanInfo(event.type === "pointercancel"
80
70
  ? this.lastMoveEventInfo
81
71
  : transformPoint(info, this.transformPagePoint), this.history);
82
72
  if (this.startEvent && onEnd) {
@@ -90,6 +80,7 @@ class PanSession {
90
80
  this.dragSnapToOrigin = dragSnapToOrigin;
91
81
  this.handlers = handlers;
92
82
  this.transformPagePoint = transformPagePoint;
83
+ this.contextWindow = contextWindow || window;
93
84
  const info = extractEventInfo(event);
94
85
  const initialInfo = transformPoint(info, this.transformPagePoint);
95
86
  const { point } = initialInfo;
@@ -98,20 +89,7 @@ class PanSession {
98
89
  const { onSessionStart } = handlers;
99
90
  onSessionStart &&
100
91
  onSessionStart(event, getPanInfo(initialInfo, this.history));
101
- capturePointer(event, "set");
102
- this.removeListeners = pipe(addPointerEvent(event.currentTarget, "pointermove", this.handlePointerMove), addPointerEvent(event.currentTarget, "pointerup", this.handlePointerUp), addPointerEvent(event.currentTarget, "pointercancel", this.handlePointerUp), addPointerEvent(event.currentTarget, "lostpointercapture", (lostPointerEvent, lostPointerInfo) => {
103
- const index = getElementIndex(lostPointerEvent.currentTarget);
104
- /**
105
- * If the pointer has lost capture because it's moved in the DOM
106
- * then we need to re-capture it.
107
- */
108
- if (index !== this.index) {
109
- capturePointer(lostPointerEvent, "set");
110
- }
111
- else {
112
- this.handlePointerUp(lostPointerEvent, lostPointerInfo);
113
- }
114
- }));
92
+ this.removeListeners = pipe(addPointerEvent(this.contextWindow, "pointermove", this.handlePointerMove), addPointerEvent(this.contextWindow, "pointerup", this.handlePointerUp), addPointerEvent(this.contextWindow, "pointercancel", this.handlePointerUp));
115
93
  }
116
94
  updateHandlers(handlers) {
117
95
  this.handlers = handlers;
@@ -175,10 +153,5 @@ function getVelocity(history, timeDelta) {
175
153
  }
176
154
  return currentVelocity;
177
155
  }
178
- function getElementIndex(element) {
179
- if (!element.parentNode)
180
- return -1;
181
- return Array.from(element.parentNode.children).indexOf(element);
182
- }
183
156
 
184
157
  export { PanSession };
@@ -2,6 +2,7 @@ import '../../../../../motion-utils/dist/es/errors.mjs';
2
2
  import { noop } from '../../../../../motion-utils/dist/es/noop.mjs';
3
3
  import { addPointerEvent } from '../../events/add-pointer-event.mjs';
4
4
  import { Feature } from '../../motion/features/Feature.mjs';
5
+ import { getContextWindow } from '../../utils/get-context-window.mjs';
5
6
  import { PanSession } from './PanSession.mjs';
6
7
  import { frame } from '../../frameloop/frame.mjs';
7
8
 
@@ -18,6 +19,7 @@ class PanGesture extends Feature {
18
19
  onPointerDown(pointerDownEvent) {
19
20
  this.session = new PanSession(pointerDownEvent, this.createPanHandlers(), {
20
21
  transformPagePoint: this.node.getTransformPagePoint(),
22
+ contextWindow: getContextWindow(this.node),
21
23
  });
22
24
  }
23
25
  createPanHandlers() {
@@ -17,7 +17,7 @@ function updateMotionValuesFromProps(element, next, prev) {
17
17
  * and warn against mismatches.
18
18
  */
19
19
  if (process.env.NODE_ENV === "development") {
20
- warnOnce(nextValue.version === "12.4.10", `Attempting to mix Motion versions ${nextValue.version} with 12.4.10 may not work as expected.`);
20
+ warnOnce(nextValue.version === "12.4.12", `Attempting to mix Motion versions ${nextValue.version} with 12.4.12 may not work as expected.`);
21
21
  }
22
22
  }
23
23
  else if (isMotionValue(prevValue)) {
@@ -0,0 +1,6 @@
1
+ // Fixes https://github.com/motiondivision/motion/issues/2270
2
+ const getContextWindow = ({ current }) => {
3
+ return current ? current.ownerDocument.defaultView : null;
4
+ };
5
+
6
+ export { getContextWindow };
@@ -34,7 +34,7 @@ class MotionValue {
34
34
  * This will be replaced by the build step with the latest version number.
35
35
  * When MotionValues are provided to motion components, warn if versions are mixed.
36
36
  */
37
- this.version = "12.4.10";
37
+ this.version = "12.4.12";
38
38
  /**
39
39
  * Tracks whether this value can output a velocity. Currently this is only true
40
40
  * if the value is numerical, but we might be able to widen the scope here and support
@@ -61,10 +61,10 @@ class NativeAnimationControls {
61
61
  this.cancel();
62
62
  }
63
63
  flatten() {
64
- var _a;
65
- if (!this.animation)
64
+ var _a, _b;
65
+ if (!this.animation || !((_a = this.options) === null || _a === void 0 ? void 0 : _a.allowFlatten))
66
66
  return;
67
- (_a = this.animation.effect) === null || _a === void 0 ? void 0 : _a.updateTiming({ easing: "linear" });
67
+ (_b = this.animation.effect) === null || _b === void 0 ? void 0 : _b.updateTiming({ easing: "linear" });
68
68
  }
69
69
  attachTimeline(timeline) {
70
70
  if (this.animation)
@@ -258,10 +258,10 @@
258
258
  this.cancel();
259
259
  }
260
260
  flatten() {
261
- var _a;
262
- if (!this.animation)
261
+ var _a, _b;
262
+ if (!this.animation || !((_a = this.options) === null || _a === void 0 ? void 0 : _a.allowFlatten))
263
263
  return;
264
- (_a = this.animation.effect) === null || _a === void 0 ? void 0 : _a.updateTiming({ easing: "linear" });
264
+ (_b = this.animation.effect) === null || _b === void 0 ? void 0 : _b.updateTiming({ easing: "linear" });
265
265
  }
266
266
  attachTimeline(timeline) {
267
267
  if (this.animation)
@@ -1630,7 +1630,7 @@
1630
1630
  * This will be replaced by the build step with the latest version number.
1631
1631
  * When MotionValues are provided to motion components, warn if versions are mixed.
1632
1632
  */
1633
- this.version = "12.4.10";
1633
+ this.version = "12.4.12";
1634
1634
  /**
1635
1635
  * Tracks whether this value can output a velocity. Currently this is only true
1636
1636
  * if the value is numerical, but we might be able to widen the scope here and support
@@ -3079,6 +3079,8 @@
3079
3079
  return this.currentFinishedPromise.then(resolve, reject);
3080
3080
  }
3081
3081
  flatten() {
3082
+ if (!this.options.allowFlatten)
3083
+ return;
3082
3084
  this.options.type = "keyframes";
3083
3085
  this.options.ease = "linear";
3084
3086
  }
@@ -4325,7 +4327,7 @@
4325
4327
  };
4326
4328
  /**
4327
4329
  * If there's no transition defined for this value, we can generate
4328
- * unqiue transition settings for this value.
4330
+ * unique transition settings for this value.
4329
4331
  */
4330
4332
  if (!isTransitionDefined(valueTransition)) {
4331
4333
  options = {
@@ -4355,6 +4357,11 @@
4355
4357
  shouldSkip = true;
4356
4358
  }
4357
4359
  }
4360
+ /**
4361
+ * If the transition type or easing has been explicitly set by the user
4362
+ * then we don't want to allow flattening the animation.
4363
+ */
4364
+ options.allowFlatten = !valueTransition.type && !valueTransition.ease;
4358
4365
  /**
4359
4366
  * If we can or must skip creating the animation, and apply only
4360
4367
  * the final keyframe, do so. We also check once keyframes are resolved but
@@ -4565,7 +4572,7 @@
4565
4572
  * and warn against mismatches.
4566
4573
  */
4567
4574
  {
4568
- warnOnce(nextValue.version === "12.4.10", `Attempting to mix Motion versions ${nextValue.version} with 12.4.10 may not work as expected.`);
4575
+ warnOnce(nextValue.version === "12.4.12", `Attempting to mix Motion versions ${nextValue.version} with 12.4.12 may not work as expected.`);
4569
4576
  }
4570
4577
  }
4571
4578
  else if (isMotionValue(prevValue)) {
@@ -5829,6 +5836,8 @@
5829
5836
  ? secondsToMilliseconds(valueOptions.duration)
5830
5837
  : valueOptions.duration;
5831
5838
  valueOptions.delay = secondsToMilliseconds(valueOptions.delay || 0);
5839
+ valueOptions.allowFlatten =
5840
+ !elementTransition.type && !elementTransition.ease;
5832
5841
  animations.push(new NativeAnimation(element, valueName, valueKeyframes, valueOptions));
5833
5842
  }
5834
5843
  }
package/dist/motion.js CHANGED
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={})}(this,(function(t){"use strict";const e=t=>t;let n=e;function s(t){let e;return()=>(void 0===e&&(e=t()),e)}const i=(t,e,n)=>{const s=e-t;return 0===s?1:(n-t)/s},r=t=>1e3*t,o=t=>t/1e3,a=s(()=>void 0!==window.ScrollTimeline);class l extends class{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;n<this.animations.length;n++)this.animations[n][t]=e}attachTimeline(t,e){const n=this.animations.map(n=>a()&&n.attachTimeline?n.attachTimeline(t):"function"==typeof e?e(n):void 0);return()=>{n.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let e=0;e<this.animations.length;e++)t=Math.max(t,this.animations[e].duration);return t}runAll(t){this.animations.forEach(e=>e[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}{then(t,e){return Promise.all(this.animations).then(t).catch(e)}}function u(t,e){return t?t[e]||t.default||t:void 0}function c(t){let e=0;let n=t.next(e);for(;!n.done&&e<2e4;)e+=50,n=t.next(e);return e>=2e4?1/0:e}function h(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(c(s),2e4);return{type:"keyframes",ease:t=>s.next(i*t).value/e,duration:o(i)}}function d(t){return"function"==typeof t}function p(t,e){t.timeline=e,t.onfinish=null}const f=t=>Array.isArray(t)&&"number"==typeof t[0],m={linearEasing:void 0};function g(t,e){const n=s(t);return()=>{var t;return null!==(t=m[e])&&void 0!==t?t:n()}}const v=g(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),y=(t,e,n=10)=>{let s="";const r=Math.max(Math.round(e/n),2);for(let e=0;e<r;e++)s+=t(i(0,r-1,e))+", ";return`linear(${s.substring(0,s.length-2)})`};function w(t){return Boolean("function"==typeof t&&v()||!t||"string"==typeof t&&(t in T||v())||f(t)||Array.isArray(t)&&t.every(w))}const b=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,T={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:b([0,.65,.55,1]),circOut:b([.55,0,1,.45]),backIn:b([.31,.01,.66,-.59]),backOut:b([.33,1.53,.69,.99])};const x=!1,S=!1;function A(){return x||S}function V(t,e,n){var s;if(t instanceof EventTarget)return[t];if("string"==typeof t){let i=document;e&&(i=e.current);const r=null!==(s=null==n?void 0:n[t])&&void 0!==s?s:i.querySelectorAll(t);return r?Array.from(r):[]}return Array.from(t)}function M(t,e){const n=V(t),s=new AbortController;return[n,{passive:!0,...e,signal:s.signal},()=>s.abort()]}function P(t){return!("touch"===t.pointerType||A())}function k(t,e){const n=e+"PointerCapture";if(t.target instanceof Element&&n in t.target&&void 0!==t.pointerId)try{t.target[n](t.pointerId)}catch(t){}}const E=(t,e)=>!!e&&(t===e||E(t,e.parentElement)),C=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const F=new WeakSet;function O(t){return e=>{"Enter"===e.key&&t(e)}}function B(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function I(t){return(t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary)(t)&&!A()}const L=(t,e,n)=>n>e?e:n<t?t:n;function R(t,e){return e?t*(1e3/e):0}function D(t,e,n){const s=Math.max(e-5,0);return R(n-t(s),e-s)}const W=100,N=10,K=1,j=0,z=800,U=.3,$=.3,H={granular:.01,default:2},Y={granular:.005,default:.5},X=.01,q=10,G=.05,Z=1;function _({duration:t=z,bounce:e=U,velocity:n=j,mass:s=K}){let i,a,l=1-e;l=L(G,Z,l),t=L(X,q,o(t)),l<1?(i=e=>{const s=e*l,i=s*t;return.001-(s-n)/J(e,l)*Math.exp(-i)},a=e=>{const s=e*l*t,r=s*n+n,o=Math.pow(l,2)*Math.pow(e,2)*t,a=Math.exp(-s),u=J(Math.pow(e,2),l);return(.001-i(e)>0?-1:1)*((r-o)*a)/u}):(i=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,a=e=>Math.exp(-e*t)*(t*t*(n-e)));const u=function(t,e,n){let s=n;for(let n=1;n<12;n++)s-=t(s)/e(s);return s}(i,a,5/t);if(t=r(t),isNaN(u))return{stiffness:W,damping:N,duration:t};{const e=Math.pow(u,2)*s;return{stiffness:e,damping:2*l*Math.sqrt(s*e),duration:t}}}function J(t,e){return t*Math.sqrt(1-e*e)}const Q=["duration","bounce"],tt=["stiffness","damping","mass"];function et(t,e){return e.some(e=>void 0!==t[e])}function nt(t=$,e=U){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const a=n.keyframes[0],l=n.keyframes[n.keyframes.length-1],u={done:!1,value:a},{stiffness:h,damping:d,mass:p,duration:f,velocity:m,isResolvedFromDuration:g}=function(t){let e={velocity:j,stiffness:W,damping:N,mass:K,isResolvedFromDuration:!1,...t};if(!et(t,tt)&&et(t,Q))if(t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(1.2*n),i=s*s,r=2*L(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:K,stiffness:i,damping:r}}else{const n=_(t);e={...e,...n,mass:K},e.isResolvedFromDuration=!0}return e}({...n,velocity:-o(n.velocity||0)}),v=m||0,w=d/(2*Math.sqrt(h*p)),b=l-a,T=o(Math.sqrt(h/p)),x=Math.abs(b)<5;let S;if(s||(s=x?H.granular:H.default),i||(i=x?Y.granular:Y.default),w<1){const t=J(T,w);S=e=>{const n=Math.exp(-w*T*e);return l-n*((v+w*T*b)/t*Math.sin(t*e)+b*Math.cos(t*e))}}else if(1===w)S=t=>l-Math.exp(-T*t)*(b+(v+T*b)*t);else{const t=T*Math.sqrt(w*w-1);S=e=>{const n=Math.exp(-w*T*e),s=Math.min(t*e,300);return l-n*((v+w*T*b)*Math.sinh(s)+t*b*Math.cosh(s))/t}}const A={calculatedDuration:g&&f||null,next:t=>{const e=S(t);if(g)u.done=t>=f;else{let n=0;w<1&&(n=0===t?r(v):D(S,t,e));const o=Math.abs(n)<=s,a=Math.abs(l-e)<=i;u.done=o&&a}return u.value=u.done?l:e,u},toString:()=>{const t=Math.min(c(A),2e4),e=y(e=>A.next(t*e).value,t,30);return t+"ms "+e}};return A}const st=(t,e,n)=>{const s=e-t;return((n-t)%s+s)%s+t},it=t=>Array.isArray(t)&&"number"!=typeof t[0];function rt(t,e){return it(t)?t[st(0,t.length,e)]:t}const ot=(t,e,n)=>t+(e-t)*n;function at(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const r=i(0,e,s);t.push(ot(n,1,r))}}function lt(t){const e=[0];return at(e,t.length-1),e}const ut=t=>Boolean(t&&t.getVelocity);function ct(t){return"object"==typeof t&&!Array.isArray(t)}function ht(t,e,n,s){return"string"==typeof t&&ct(e)?V(t,n,s):t instanceof NodeList?Array.from(t):Array.isArray(t)?t:[t]}function dt(t,e,n){return t*(e+1)}function pt(t,e,n,s){var i;return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:null!==(i=s.get(e))&&void 0!==i?i:t}function ft(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}function mt(t,e,n,s,i,r){!function(t,e,n){for(let s=0;s<t.length;s++){const i=t[s];i.at>e&&i.at<n&&(ft(t,i),s--)}}(t,i,r);for(let o=0;o<e.length;o++)t.push({value:e[o],at:ot(i,r,s[o]),easing:rt(n,o)})}function gt(t,e){for(let n=0;n<t.length;n++)t[n]=t[n]/(e+1)}function vt(t,e){return t.at===e.at?null===t.value?1:null===e.value?-1:0:t.at-e.at}function yt(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function wt(t,e){return e[t]||(e[t]=[]),e[t]}function bt(t){return Array.isArray(t)?t:[t]}function Tt(t,e){return t&&t[e]?{...t,...t[e]}:{...t}}const xt=t=>"number"==typeof t,St=t=>t.every(xt),At=new WeakMap,Vt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Mt=new Set(Vt),Pt=new Set(["width","height","top","left","right","bottom",...Vt]),kt=t=>(t=>Array.isArray(t))(t)?t[t.length-1]||0:t,Et=!1,Ct=["read","resolveKeyframes","update","preRender","render","postRender"],Ft={value:null,addProjectionMetrics:null};const{schedule:Ot,cancel:Bt,state:It,steps:Lt}=function(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,o=Ct.reduce((t,n)=>(t[n]=function(t,e){let n=new Set,s=new Set,i=!1,r=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function u(e){o.has(e)&&(c.schedule(e),t()),l++,e(a)}const c={schedule:(t,e=!1,r=!1)=>{const a=r&&i?n:s;return e&&o.add(t),a.has(t)||a.add(t),t},cancel:t=>{s.delete(t),o.delete(t)},process:t=>{a=t,i?r=!0:(i=!0,[n,s]=[s,n],n.forEach(u),e&&Ft.value&&Ft.value.frameloop[e].push(l),l=0,n.clear(),i=!1,r&&(r=!1,c.process(t)))}};return c}(r,e?n:void 0),t),{}),{read:a,resolveKeyframes:l,update:u,preRender:c,render:h,postRender:d}=o,p=()=>{const r=performance.now();n=!1,i.delta=s?1e3/60:Math.max(Math.min(r-i.timestamp,40),1),i.timestamp=r,i.isProcessing=!0,a.process(i),l.process(i),u.process(i),c.process(i),h.process(i),d.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(p))};return{schedule:Ct.reduce((e,r)=>{const a=o[r];return e[r]=(e,r=!1,o=!1)=>(n||(n=!0,s=!0,i.isProcessing||t(p)),a.schedule(e,r,o)),e},{}),cancel:t=>{for(let e=0;e<Ct.length;e++)o[Ct[e]].cancel(t)},state:i,steps:o}}("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:e,!0);let Rt;function Dt(){Rt=void 0}const Wt={now:()=>(void 0===Rt&&Wt.set(It.isProcessing||Et?It.timestamp:performance.now()),Rt),set:t=>{Rt=t,queueMicrotask(Dt)}};class Nt{constructor(){this.subscriptions=[]}add(t){var e,n;return e=this.subscriptions,n=t,-1===e.indexOf(n)&&e.push(n),()=>ft(this.subscriptions,t)}notify(t,e,n){const s=this.subscriptions.length;if(s)if(1===s)this.subscriptions[0](t,e,n);else for(let i=0;i<s;i++){const s=this.subscriptions[i];s&&s(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}class Kt{constructor(t,e={}){this.version="12.4.10",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(t,e=!0)=>{const n=Wt.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),e&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=Wt.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new Nt);const n=this.events[t].add(e);return"change"===t?()=>{n(),Ot.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Wt.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return R(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function jt(t,e){return new Kt(t,e)}function zt(t){const e=[{},{}];return null==t||t.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function Ut(t,e,n,s){if("function"==typeof e){const[i,r]=zt(s);e=e(void 0!==n?n:t.custom,i,r)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[i,r]=zt(s);e=e(void 0!==n?n:t.custom,i,r)}return e}function $t(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,jt(n))}function Ht(t,e){const n=function(t,e,n){const s=t.getProps();return Ut(s,e,void 0!==n?n:s.custom,t)}(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const e in r){$t(t,e,kt(r[e]))}}function Yt(t,e){const n=t.getValue("willChange");if(s=n,Boolean(ut(s)&&s.add))return n.add(e);var s}const Xt=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),qt="data-"+Xt("framerAppearId");function Gt(t){return t.props[qt]}const Zt=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function _t(t,n,s,i){if(t===n&&s===i)return e;const r=e=>function(t,e,n,s,i){let r,o,a=0;do{o=e+(n-e)/2,r=Zt(o,s,i)-t,r>0?n=o:e=o}while(Math.abs(r)>1e-7&&++a<12);return o}(e,0,1,t,s);return t=>0===t||1===t?t:Zt(r(t),n,i)}const Jt=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Qt=t=>e=>1-t(1-e),te=_t(.33,1.53,.69,.99),ee=Qt(te),ne=Jt(ee),se=t=>(t*=2)<1?.5*ee(t):.5*(2-Math.pow(2,-10*(t-1))),ie=t=>1-Math.sin(Math.acos(t)),re=Qt(ie),oe=Jt(ie),ae=t=>/^0[^.\s]+$/u.test(t);const le={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},ue={...le,transform:t=>L(0,1,t)},ce={...le,default:1},he=t=>Math.round(1e5*t)/1e5,de=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const pe=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,fe=(t,e)=>n=>Boolean("string"==typeof n&&pe.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),me=(t,e,n)=>s=>{if("string"!=typeof s)return s;const[i,r,o,a]=s.match(de);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(o),alpha:void 0!==a?parseFloat(a):1}},ge={...le,transform:t=>Math.round((t=>L(0,255,t))(t))},ve={test:fe("rgb","red"),parse:me("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+ge.transform(t)+", "+ge.transform(e)+", "+ge.transform(n)+", "+he(ue.transform(s))+")"};const ye={test:fe("#"),parse:function(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}},transform:ve.transform},we=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),be=we("deg"),Te=we("%"),xe=we("px"),Se=we("vh"),Ae=we("vw"),Ve={...Te,parse:t=>Te.parse(t)/100,transform:t=>Te.transform(100*t)},Me={test:fe("hsl","hue"),parse:me("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+Te.transform(he(e))+", "+Te.transform(he(n))+", "+he(ue.transform(s))+")"},Pe={test:t=>ve.test(t)||ye.test(t)||Me.test(t),parse:t=>ve.test(t)?ve.parse(t):Me.test(t)?Me.parse(t):ye.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?ve.transform(t):Me.transform(t)},ke=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const Ee=/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;function Ce(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const o=e.replace(Ee,t=>(Pe.test(t)?(s.color.push(r),i.push("color"),n.push(Pe.parse(t))):t.startsWith("var(")?(s.var.push(r),i.push("var"),n.push(t)):(s.number.push(r),i.push("number"),n.push(parseFloat(t))),++r,"${}")).split("${}");return{values:n,split:o,indexes:s,types:i}}function Fe(t){return Ce(t).values}function Oe(t){const{split:e,types:n}=Ce(t),s=e.length;return t=>{let i="";for(let r=0;r<s;r++)if(i+=e[r],void 0!==t[r]){const e=n[r];i+="number"===e?he(t[r]):"color"===e?Pe.transform(t[r]):t[r]}return i}}const Be=t=>"number"==typeof t?0:t;const Ie={test:function(t){var e,n;return isNaN(t)&&"string"==typeof t&&((null===(e=t.match(de))||void 0===e?void 0:e.length)||0)+((null===(n=t.match(ke))||void 0===n?void 0:n.length)||0)>0},parse:Fe,createTransformer:Oe,getAnimatableNone:function(t){const e=Fe(t);return Oe(t)(e.map(Be))}},Le=new Set(["brightness","contrast","saturate","opacity"]);function Re(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[s]=n.match(de)||[];if(!s)return t;const i=n.replace(s,"");let r=Le.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const De=/\b([a-z-]*)\(.*?\)/gu,We={...Ie,getAnimatableNone:t=>{const e=t.match(De);return e?e.map(Re).join(" "):t}},Ne={borderWidth:xe,borderTopWidth:xe,borderRightWidth:xe,borderBottomWidth:xe,borderLeftWidth:xe,borderRadius:xe,radius:xe,borderTopLeftRadius:xe,borderTopRightRadius:xe,borderBottomRightRadius:xe,borderBottomLeftRadius:xe,width:xe,maxWidth:xe,height:xe,maxHeight:xe,top:xe,right:xe,bottom:xe,left:xe,padding:xe,paddingTop:xe,paddingRight:xe,paddingBottom:xe,paddingLeft:xe,margin:xe,marginTop:xe,marginRight:xe,marginBottom:xe,marginLeft:xe,backgroundPositionX:xe,backgroundPositionY:xe},Ke={rotate:be,rotateX:be,rotateY:be,rotateZ:be,scale:ce,scaleX:ce,scaleY:ce,scaleZ:ce,skew:be,skewX:be,skewY:be,distance:xe,translateX:xe,translateY:xe,translateZ:xe,x:xe,y:xe,z:xe,perspective:xe,transformPerspective:xe,opacity:ue,originX:Ve,originY:Ve,originZ:xe},je={...le,transform:Math.round},ze={...Ne,...Ke,zIndex:je,size:xe,fillOpacity:ue,strokeOpacity:ue,numOctaves:je},Ue={...ze,color:Pe,backgroundColor:Pe,outlineColor:Pe,fill:Pe,stroke:Pe,borderColor:Pe,borderTopColor:Pe,borderRightColor:Pe,borderBottomColor:Pe,borderLeftColor:Pe,filter:We,WebkitFilter:We},$e=t=>Ue[t];function He(t,e){let n=$e(t);return n!==We&&(n=Ie),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Ye=new Set(["auto","none","0"]);const Xe=t=>t===le||t===xe,qe=(t,e)=>parseFloat(t.split(", ")[e]),Ge=(t,e)=>(n,{transform:s})=>{if("none"===s||!s)return 0;const i=s.match(/^matrix3d\((.+)\)$/u);if(i)return qe(i[1],e);{const e=s.match(/^matrix\((.+)\)$/u);return e?qe(e[1],t):0}},Ze=new Set(["x","y","z"]),_e=Vt.filter(t=>!Ze.has(t));const Je={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:Ge(4,13),y:Ge(5,14)};Je.translateX=Je.x,Je.translateY=Je.y;const Qe=new Set;let tn=!1,en=!1;function nn(){if(en){const t=Array.from(Qe).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),n=new Map;e.forEach(t=>{const e=function(t){const e=[];return _e.forEach(n=>{const s=t.getValue(n);void 0!==s&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}(t);e.length&&(n.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=n.get(t);e&&e.forEach(([e,n])=>{var s;null===(s=t.getValue(e))||void 0===s||s.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}en=!1,tn=!1,Qe.forEach(t=>t.complete()),Qe.clear()}function sn(){Qe.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(en=!0)})}class rn{constructor(t,e,n,s,i,r=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=s,this.element=i,this.isAsync=r}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Qe.add(this),tn||(tn=!0,Ot.read(sn),Ot.resolveKeyframes(nn))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:s}=this;for(let i=0;i<t.length;i++)if(null===t[i])if(0===i){const i=null==s?void 0:s.get(),r=t[t.length-1];if(void 0!==i)t[0]=i;else if(n&&e){const s=n.readValue(e,r);null!=s&&(t[0]=s)}void 0===t[0]&&(t[0]=r),s&&void 0===i&&s.set(t[0])}else t[i]=t[i-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Qe.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Qe.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const on=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),an=t=>e=>"string"==typeof e&&e.startsWith(t),ln=an("--"),un=an("var(--"),cn=t=>!!un(t)&&hn.test(t.split("/*")[0].trim()),hn=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,dn=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function pn(t,e,n=1){const[s,i]=function(t){const e=dn.exec(t);if(!e)return[,];const[,n,s,i]=e;return["--"+(null!=n?n:s),i]}(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);if(r){const t=r.trim();return on(t)?parseFloat(t):t}return cn(i)?pn(i,e,n+1):i}const fn=t=>e=>e.test(t),mn=[le,xe,Te,be,Ae,Se,{test:t=>"auto"===t,parse:t=>t}],gn=t=>mn.find(fn(t));class vn extends rn{constructor(t,e,n,s,i){super(t,e,n,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){let s=t[n];if("string"==typeof s&&(s=s.trim(),cn(s))){const i=pn(s,e.current);void 0!==i&&(t[n]=i),n===t.length-1&&(this.finalKeyframe=s)}}if(this.resolveNoneKeyframes(),!Pt.has(n)||2!==t.length)return;const[s,i]=t,r=gn(s),o=gn(i);if(r!==o)if(Xe(r)&&Xe(o))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)("number"==typeof(s=t[e])?0===s:null===s||"none"===s||"0"===s||ae(s))&&n.push(e);var s;n.length&&function(t,e,n){let s=0,i=void 0;for(;s<t.length&&!i;){const e=t[s];"string"==typeof e&&!Ye.has(e)&&Ce(e).values.length&&(i=t[s]),s++}if(i&&n)for(const s of e)t[s]=He(n,i)}(t,n,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Je[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const s=e[e.length-1];void 0!==s&&t.getValue(n,s).jump(s,!1)}measureEndState(){var t;const{element:e,name:n,unresolvedKeyframes:s}=this;if(!e||!e.current)return;const i=e.getValue(n);i&&i.jump(this.measuredOrigin,!1);const r=s.length-1,o=s[r];s[r]=Je[n](e.measureViewportBox(),window.getComputedStyle(e.current)),null!==o&&void 0===this.finalKeyframe&&(this.finalKeyframe=o),(null===(t=this.removedTransforms)||void 0===t?void 0:t.length)&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}}const yn=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Ie.test(t)&&"0"!==t||t.startsWith("url(")));function wn(t,e,n,s){const i=t[0];if(null===i)return!1;if("display"===e||"visibility"===e)return!0;const r=t[t.length-1],o=yn(i,e),a=yn(r,e);return!(!o||!a)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}(t)||("spring"===n||d(n))&&s)}const bn=t=>null!==t;function Tn(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(bn),r=e&&"loop"!==n&&e%2==1?0:i.length-1;return r&&void 0!==s?s:i[r]}class xn{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:r="loop",...o}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Wt.now(),this.options={autoplay:t,delay:e,type:n,repeat:s,repeatDelay:i,repeatType:r,...o},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return this._resolved||this.hasAttemptedResolve||(sn(),nn()),this._resolved}onKeyframesResolved(t,e){this.resolvedAt=Wt.now(),this.hasAttemptedResolve=!0;const{name:n,type:s,velocity:i,delay:r,onComplete:o,onUpdate:a,isGenerator:l}=this.options;if(!l&&!wn(t,n,s,i)){if(!r)return a&&a(Tn(t,this.options,e)),o&&o(),void this.resolveFinishedPromise();this.options.duration=0}const u=this.initPlayback(t,e);!1!==u&&(this._resolved={keyframes:t,finalKeyframe:e,...u},this.onPostResolved())}onPostResolved(){}then(t,e){return this.currentFinishedPromise.then(t,e)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}function Sn(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function An(t,e){return n=>n>0?e:t}const Vn=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},Mn=[ye,ve,Me];function Pn(t){const e=(n=t,Mn.find(t=>t.test(n)));var n;if(!Boolean(e))return!1;let s=e.parse(t);return e===Me&&(s=function({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,n/=100;let i=0,r=0,o=0;if(e/=100){const s=n<.5?n*(1+e):n+e-n*e,a=2*n-s;i=Sn(a,s,t+1/3),r=Sn(a,s,t),o=Sn(a,s,t-1/3)}else i=r=o=n;return{red:Math.round(255*i),green:Math.round(255*r),blue:Math.round(255*o),alpha:s}}(s)),s}const kn=(t,e)=>{const n=Pn(t),s=Pn(e);if(!n||!s)return An(t,e);const i={...n};return t=>(i.red=Vn(n.red,s.red,t),i.green=Vn(n.green,s.green,t),i.blue=Vn(n.blue,s.blue,t),i.alpha=ot(n.alpha,s.alpha,t),ve.transform(i))},En=(t,e)=>n=>e(t(n)),Cn=(...t)=>t.reduce(En),Fn=new Set(["none","hidden"]);function On(t,e){return n=>ot(t,e,n)}function Bn(t){return"number"==typeof t?On:"string"==typeof t?cn(t)?An:Pe.test(t)?kn:Rn:Array.isArray(t)?In:"object"==typeof t?Pe.test(t)?kn:Ln:An}function In(t,e){const n=[...t],s=n.length,i=t.map((t,n)=>Bn(t)(t,e[n]));return t=>{for(let e=0;e<s;e++)n[e]=i[e](t);return n}}function Ln(t,e){const n={...t,...e},s={};for(const i in n)void 0!==t[i]&&void 0!==e[i]&&(s[i]=Bn(t[i])(t[i],e[i]));return t=>{for(const e in s)n[e]=s[e](t);return n}}const Rn=(t,e)=>{const n=Ie.createTransformer(e),s=Ce(t),i=Ce(e);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?Fn.has(t)&&!i.values.length||Fn.has(e)&&!s.values.length?function(t,e){return Fn.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):Cn(In(function(t,e){var n;const s=[],i={color:0,var:0,number:0};for(let r=0;r<e.values.length;r++){const o=e.types[r],a=t.indexes[o][i[o]],l=null!==(n=t.values[a])&&void 0!==n?n:0;s[r]=l,i[o]++}return s}(s,i),i.values),n):An(t,e)};function Dn(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return ot(t,e,n);return Bn(t)(t,e)}function Wn({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:c}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)<Math.abs(l-t)?a:l;let f=n*e;const m=h+f,g=void 0===o?m:o(m);g!==m&&(f=g-h);const v=t=>-f*Math.exp(-t/s),y=t=>g+v(t),w=t=>{const e=v(t),n=y(t);d.done=Math.abs(e)<=u,d.value=d.done?g:n};let b,T;const x=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==l&&e>l)&&(b=t,T=nt({keyframes:[d.value,p(d.value)],velocity:D(y,t,d.value),damping:i,stiffness:r,restDelta:u,restSpeed:c}))};return x(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==b||(e=!0,w(t),x(t)),void 0!==b&&t>=b?T.next(t-b):(!e&&w(t),d)}}}const Nn=_t(.42,0,1,1),Kn=_t(0,0,.58,1),jn=_t(.42,0,.58,1),zn={linear:e,easeIn:Nn,easeInOut:jn,easeOut:Kn,circIn:ie,circInOut:oe,circOut:re,backIn:ee,backInOut:ne,backOut:te,anticipate:se},Un=t=>{if(f(t)){n(4===t.length);const[e,s,i,r]=t;return _t(e,s,i,r)}return"string"==typeof t?zn[t]:t};function $n(t,s,{clamp:r=!0,ease:o,mixer:a}={}){const l=t.length;if(n(l===s.length),1===l)return()=>s[0];if(2===l&&s[0]===s[1])return()=>s[1];const u=t[0]===t[1];t[0]>t[l-1]&&(t=[...t].reverse(),s=[...s].reverse());const c=function(t,n,s){const i=[],r=s||Dn,o=t.length-1;for(let s=0;s<o;s++){let o=r(t[s],t[s+1]);if(n){const t=Array.isArray(n)?n[s]||e:n;o=Cn(t,o)}i.push(o)}return i}(s,o,a),h=c.length,d=e=>{if(u&&e<t[0])return s[0];let n=0;if(h>1)for(;n<t.length-2&&!(e<t[n+1]);n++);const r=i(t[n],t[n+1],e);return c[n](r)};return r?e=>d(L(t[0],t[l-1],e)):d}function Hn({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=it(s)?s.map(Un):Un(s),r={done:!1,value:e[0]},o=$n(function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:lt(e),t),e,{ease:Array.isArray(i)?i:(a=e,l=i,a.map(()=>l||jn).splice(0,a.length-1))});var a,l;return{calculatedDuration:t,next:e=>(r.value=o(e),r.done=e>=t,r)}}const Yn=t=>{const e=({timestamp:e})=>t(e);return{start:()=>Ot.update(e,!0),stop:()=>Bt(e),now:()=>It.isProcessing?It.timestamp:Wt.now()}},Xn={decay:Wn,inertia:Wn,tween:Hn,keyframes:Hn,spring:nt},qn=t=>t/100;class Gn extends xn{constructor(t){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=()=>{if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.teardown();const{onStop:t}=this.options;t&&t()};const{name:e,motionValue:n,element:s,keyframes:i}=this.options,r=(null==s?void 0:s.KeyframeResolver)||rn;this.resolver=new r(i,(t,e)=>this.onKeyframesResolved(t,e),e,n,s),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:e="keyframes",repeat:n=0,repeatDelay:s=0,repeatType:i,velocity:r=0}=this.options,o=d(e)?e:Xn[e]||Hn;let a,l;o!==Hn&&"number"!=typeof t[0]&&(a=Cn(qn,Dn(t[0],t[1])),t=[0,100]);const u=o({...this.options,keyframes:t});"mirror"===i&&(l=o({...this.options,keyframes:[...t].reverse(),velocity:-r})),null===u.calculatedDuration&&(u.calculatedDuration=c(u));const{calculatedDuration:h}=u,p=h+s;return{generator:u,mirroredGenerator:l,mapPercentToKeyframes:a,calculatedDuration:h,resolvedDuration:p,totalDuration:p*(n+1)-s}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&t?this.state=this.pendingPlayState:this.pause()}tick(t,e=!1){const{resolved:n}=this;if(!n){const{keyframes:t}=this.options;return{done:!0,value:t[t.length-1]}}const{finalKeyframe:s,generator:i,mirroredGenerator:r,mapPercentToKeyframes:o,keyframes:a,calculatedDuration:l,totalDuration:u,resolvedDuration:c}=n;if(null===this.startTime)return i.next(0);const{delay:h,repeat:d,repeatType:p,repeatDelay:f,onUpdate:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-u/this.speed,this.startTime)),e?this.currentTime=t:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const g=this.currentTime-h*(this.speed>=0?1:-1),v=this.speed>=0?g<0:g>u;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=u);let y=this.currentTime,w=i;if(d){const t=Math.min(this.currentTime,u)/c;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,d+1);Boolean(e%2)&&("reverse"===p?(n=1-n,f&&(n-=f/c)):"mirror"===p&&(w=r)),y=L(0,1,n)*c}const b=v?{done:!1,value:a[0]}:w.next(y);o&&(b.value=o(b.value));let{done:T}=b;v||null===l||(T=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const x=null===this.holdTime&&("finished"===this.state||"running"===this.state&&T);return x&&void 0!==s&&(b.value=Tn(a,this.options,s)),m&&m(b.value),x&&this.finish(),b}get duration(){const{resolved:t}=this;return t?o(t.calculatedDuration):0}get time(){return o(this.currentTime)}set time(t){t=r(t),this.currentTime=t,null!==this.holdTime||0===this.speed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=o(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:t=Yn,onPlay:e,startTime:n}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),e&&e();const s=this.driver.now();null!==this.holdTime?this.startTime=s-this.holdTime:this.startTime?"finished"===this.state&&(this.startTime=s):this.startTime=null!=n?n:this.calcStartTime(),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;this._resolved?(this.state="paused",this.holdTime=null!==(t=this.currentTime)&&void 0!==t?t:0):this.pendingPlayState="paused"}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){null!==this.cancelTime&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const Zn=new Set(["opacity","clipPath","filter","transform"]);function _n(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:o="loop",ease:a="easeInOut",times:l}={}){const u={[e]:n};l&&(u.offset=l);const c=function t(e,n){return e?"function"==typeof e&&v()?y(e,n):f(e)?b(e):Array.isArray(e)?e.map(e=>t(e,n)||T.easeOut):T[e]:void 0}(a,i);Array.isArray(c)&&(u.easing=c);return t.animate(u,{delay:s,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:r+1,direction:"reverse"===o?"alternate":"normal"})}const Jn=s(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));const Qn={anticipate:se,backInOut:ne,circInOut:oe};class ts extends xn{constructor(t){super(t);const{name:e,motionValue:n,element:s,keyframes:i}=this.options;this.resolver=new vn(i,(t,e)=>this.onKeyframesResolved(t,e),e,n,s),this.resolver.scheduleResolve()}initPlayback(t,e){let{duration:n=300,times:s,ease:i,type:r,motionValue:o,name:a,startTime:l}=this.options;if(!o.owner||!o.owner.current)return!1;var u;if("string"==typeof i&&v()&&i in Qn&&(i=Qn[i]),d((u=this.options).type)||"spring"===u.type||!w(u.ease)){const{onComplete:e,onUpdate:o,motionValue:a,element:l,...u}=this.options,c=function(t,e){const n=new Gn({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let s={done:!1,value:t[0]};const i=[];let r=0;for(;!s.done&&r<2e4;)s=n.sample(r),i.push(s.value),r+=10;return{times:void 0,keyframes:i,duration:r-10,ease:"linear"}}(t,u);1===(t=c.keyframes).length&&(t[1]=t[0]),n=c.duration,s=c.times,i=c.ease,r="keyframes"}const c=_n(o.owner.current,a,t,{...this.options,duration:n,times:s,ease:i});return c.startTime=null!=l?l:this.calcStartTime(),this.pendingTimeline?(p(c,this.pendingTimeline),this.pendingTimeline=void 0):c.onfinish=()=>{const{onComplete:n}=this.options;o.set(Tn(t,this.options,e)),n&&n(),this.cancel(),this.resolveFinishedPromise()},{animation:c,duration:n,times:s,type:r,ease:i,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:e}=t;return o(e)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:e}=t;return o(e.currentTime||0)}set time(t){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.currentTime=r(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:e}=t;return e.playbackRate}set speed(t){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:e}=t;return e.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:e}=t;return e.startTime}attachTimeline(t){if(this._resolved){const{resolved:n}=this;if(!n)return e;const{animation:s}=n;p(s,t)}else this.pendingTimeline=t;return e}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:e}=t;"finished"===e.playState&&this.updateFinishedPromise(),e.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:e}=t;e.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:e,keyframes:n,duration:s,type:i,ease:o,times:a}=t;if("idle"===e.playState||"finished"===e.playState)return;if(this.time){const{motionValue:t,onUpdate:e,onComplete:l,element:u,...c}=this.options,h=new Gn({...c,keyframes:n,duration:s,type:i,ease:o,times:a,isGenerator:!0}),d=r(this.time);t.setWithVelocity(h.sample(d-10).value,h.sample(d).value,10)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:r,type:o}=t;if(!(e&&e.owner&&e.owner.current instanceof HTMLElement))return!1;const{onUpdate:a,transformTemplate:l}=e.owner.getProps();return Jn()&&n&&Zn.has(n)&&!a&&!l&&!s&&"mirror"!==i&&0!==r&&"inertia"!==o}}const es={type:"spring",stiffness:500,damping:25,restSpeed:10},ns={type:"keyframes",duration:.8},ss={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},is=(t,{keyframes:e})=>e.length>2?ns:Mt.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:es:ss;const rs=(t,e,n,s={},i,o)=>a=>{const c=u(s,t)||{},h=c.delay||s.delay||0;let{elapsed:d=0}=s;d-=r(h);let p={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...c,delay:-d,onUpdate:t=>{e.set(t),c.onUpdate&&c.onUpdate(t)},onComplete:()=>{a(),c.onComplete&&c.onComplete()},name:t,motionValue:e,element:o?void 0:i};(function({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:r,repeatType:o,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length})(c)||(p={...p,...is(t,p)}),p.duration&&(p.duration=r(p.duration)),p.repeatDelay&&(p.repeatDelay=r(p.repeatDelay)),void 0!==p.from&&(p.keyframes[0]=p.from);let f=!1;if((!1===p.type||0===p.duration&&!p.repeatDelay)&&(p.duration=0,0===p.delay&&(f=!0)),f&&!o&&void 0!==e.get()){const t=Tn(p.keyframes,c);if(void 0!==t)return Ot.update(()=>{p.onUpdate(t),p.onComplete()}),new l([])}return!o&&ts.supports(p)?new ts(p):new Gn(p)};function os({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,s}function as(t,e,{delay:n=0,transitionOverride:s,type:i}={}){var r;let{transition:o=t.getDefaultTransition(),transitionEnd:a,...l}=e;s&&(o=s);const c=[],h=i&&t.animationState&&t.animationState.getState()[i];for(const e in l){const s=t.getValue(e,null!==(r=t.latestValues[e])&&void 0!==r?r:null),i=l[e];if(void 0===i||h&&os(h,e))continue;const a={delay:n,...u(o||{},e)};let d=!1;if(window.MotionHandoffAnimation){const n=Gt(t);if(n){const t=window.MotionHandoffAnimation(n,e,Ot);null!==t&&(a.startTime=t,d=!0)}}Yt(t,e),s.start(rs(e,s,i,t.shouldReduceMotion&&Pt.has(e)?{type:!1}:a,t,d));const p=s.animation;p&&c.push(p)}return a&&Promise.all(c).then(()=>{Ot.update(()=>{a&&Ht(t,a)})}),c}const ls=()=>({x:{min:0,max:0},y:{min:0,max:0}}),us={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},cs={};for(const t in us)cs[t]={isEnabled:e=>us[t].some(t=>!!e[t])};const hs="undefined"!=typeof window,ds={current:null},ps={current:!1};const fs=[...mn,Pe,Ie];const ms=["initial","animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"];function gs(t){return null!==(e=t.animate)&&"object"==typeof e&&"function"==typeof e.start||ms.some(e=>function(t){return"string"==typeof t||Array.isArray(t)}(t[e]));var e}const vs=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class ys{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:s,blockInitialAnimation:i,visualState:r},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=rn,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=Wt.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,Ot.render(this.render,!1,!0))};const{latestValues:a,renderState:l,onUpdate:u}=r;this.onUpdate=u,this.latestValues=a,this.baseTarget={...a},this.initialValues=e.initial?{...a}:{},this.renderState=l,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=o,this.blockInitialAnimation=Boolean(i),this.isControllingVariants=gs(e),this.isVariantNode=function(t){return Boolean(gs(t)||t.variants)}(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:c,...h}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in h){const e=h[t];void 0!==a[t]&&ut(e)&&e.set(a[t],!1)}}mount(t){this.current=t,At.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((t,e)=>this.bindToMotionValue(e,t)),ps.current||function(){if(ps.current=!0,hs)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>ds.current=t.matches;t.addListener(e),e()}else ds.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||ds.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Bt(this.notifyUpdate),Bt(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}bindToMotionValue(t,e){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const n=Mt.has(t);n&&this.onBindTransform&&this.onBindTransform();const s=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&Ot.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)}),i=e.on("renderRequest",this.scheduleRender);let r;window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{s(),i(),r&&r(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in cs){const e=cs[t];if(!e)continue;const{isEnabled:n,Feature:s}=e;if(!this.features[t]&&s&&n(this.props)&&(this.features[t]=new s(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<vs.length;e++){const n=vs[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const s=t["on"+n];s&&(this.propEventSubscriptions[n]=this.on(n,s))}this.prevMotionValues=function(t,e,n){for(const s in e){const i=e[s],r=n[s];if(ut(i))t.addValue(s,i);else if(ut(r))t.addValue(s,jt(i,{owner:t}));else if(r!==i)if(t.hasValue(s)){const e=t.getValue(s);!0===e.liveStyle?e.jump(i):e.hasAnimated||e.set(i)}else{const e=t.getStaticValue(s);t.addValue(s,jt(void 0!==e?e:i,{owner:t}))}}for(const s in n)void 0===e[s]&&t.removeValue(s);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=jt(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){var n;let s=void 0===this.latestValues[t]&&this.current?null!==(n=this.getBaseTargetFromProps(this.props,t))&&void 0!==n?n:this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var i;return null!=s&&("string"==typeof s&&(on(s)||ae(s))?s=parseFloat(s):(i=s,!fs.find(fn(i))&&Ie.test(e)&&(s=He(t,e))),this.setBaseTarget(t,ut(s)?s.get():s)),ut(s)?s.get():s}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;const{initial:n}=this.props;let s;if("string"==typeof n||"object"==typeof n){const i=Ut(this.props,n,null===(e=this.presenceContext)||void 0===e?void 0:e.custom);i&&(s=i[t])}if(n&&void 0!==s)return s;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||ut(i)?void 0!==this.initialValues[t]&&void 0===s?void 0:this.baseTarget[t]:i}on(t,e){return this.events[t]||(this.events[t]=new Nt),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}class ws extends ys{constructor(){super(...arguments),this.KeyframeResolver=vn}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;ut(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=""+t)}))}}const bs=(t,e)=>e&&"number"==typeof t?e.transform(t):t,Ts={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},xs=Vt.length;function Ss(t,e,n){const{style:s,vars:i,transformOrigin:r}=t;let o=!1,a=!1;for(const t in e){const n=e[t];if(Mt.has(t))o=!0;else if(ln(t))i[t]=n;else{const e=bs(n,ze[t]);t.startsWith("origin")?(a=!0,r[t]=e):s[t]=e}}if(e.transform||(o||n?s.transform=function(t,e,n){let s="",i=!0;for(let r=0;r<xs;r++){const o=Vt[r],a=t[o];if(void 0===a)continue;let l=!0;if(l="number"==typeof a?a===(o.startsWith("scale")?1:0):0===parseFloat(a),!l||n){const t=bs(a,ze[o]);if(!l){i=!1;s+=`${Ts[o]||o}(${t}) `}n&&(e[o]=t)}}return s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}(e,t.transform,n):s.transform&&(s.transform="none")),a){const{originX:t="50%",originY:e="50%",originZ:n=0}=r;s.transformOrigin=`${t} ${e} ${n}`}}const As={offset:"stroke-dashoffset",array:"stroke-dasharray"},Vs={offset:"strokeDashoffset",array:"strokeDasharray"};function Ms(t,e,n){return"string"==typeof t?t:xe.transform(e+n*t)}function Ps(t,{attrX:e,attrY:n,attrScale:s,originX:i,originY:r,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...u},c,h){if(Ss(t,u,h),c)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:d,style:p,dimensions:f}=t;d.transform&&(f&&(p.transform=d.transform),delete d.transform),f&&(void 0!==i||void 0!==r||p.transform)&&(p.transformOrigin=function(t,e,n){return`${Ms(e,t.x,t.width)} ${Ms(n,t.y,t.height)}`}(f,void 0!==i?i:.5,void 0!==r?r:.5)),void 0!==e&&(d.x=e),void 0!==n&&(d.y=n),void 0!==s&&(d.scale=s),void 0!==o&&function(t,e,n=1,s=0,i=!0){t.pathLength=1;const r=i?As:Vs;t[r.offset]=xe.transform(-s);const o=xe.transform(e),a=xe.transform(n);t[r.array]=`${o} ${a}`}(d,o,a,l,!1)}const ks=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Es(t,{style:e,vars:n},s,i){Object.assign(t.style,e,i&&i.getProjectionStyles(s));for(const e in n)t.style.setProperty(e,n[e])}const Cs={};function Fs(t,{layout:e,layoutId:n}){return Mt.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!Cs[t]||"opacity"===t)}function Os(t,e,n){var s;const{style:i}=t,r={};for(const o in i)(ut(i[o])||e.style&&ut(e.style[o])||Fs(o,t)||void 0!==(null===(s=null==n?void 0:n.getValue(o))||void 0===s?void 0:s.liveStyle))&&(r[o]=i[o]);return r}class Bs extends ws{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ls,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&function(t,e){try{e.dimensions="function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}catch(t){e.dimensions={x:0,y:0,width:0,height:0}}}(this.current,this.renderState)}}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(Mt.has(e)){const t=$e(e);return t&&t.default||0}return e=ks.has(e)?e:Xt(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return function(t,e,n){const s=Os(t,e,n);for(const n in t)if(ut(t[n])||ut(e[n])){s[-1!==Vt.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return s}(t,e,n)}onBindTransform(){this.current&&!this.renderState.dimensions&&Ot.postRender(this.updateDimensions)}build(t,e,n){Ps(t,e,this.isSVGTag,n.transformTemplate)}renderInstance(t,e,n,s){!function(t,e,n,s){Es(t,e,void 0,s);for(const n in e.attrs)t.setAttribute(ks.has(n)?n:Xt(n),e.attrs[n])}(t,e,0,s)}mount(t){var e;this.isSVGTag="string"==typeof(e=t.tagName)&&"svg"===e.toLowerCase(),super.mount(t)}}class Is extends ws{constructor(){super(...arguments),this.type="html",this.renderInstance=Es}readValueFromInstance(t,e){if(Mt.has(e)){const t=$e(e);return t&&t.default||0}{const s=(n=t,window.getComputedStyle(n)),i=(ln(e)?s.getPropertyValue(e):s[e])||0;return"string"==typeof i?i.trim():i}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return function(t,e){return function({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}(t.getBoundingClientRect(),e))}(t,e)}build(t,e,n){Ss(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return Os(t,e,n)}}class Ls extends ys{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,e){if(function(t,e){return t in e}(e,t)){const n=t[e];if("string"==typeof n||"number"==typeof n)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(t,e){delete e.output[t]}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}build(t,e){Object.assign(t.output,e)}renderInstance(t,{output:e}){Object.assign(t,e)}sortInstanceNodePosition(){return 0}}function Rs(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=function(t){return t instanceof SVGElement&&"svg"!==t.tagName}(t)?new Bs(e):new Is(e);n.mount(t),At.set(t,n)}function Ds(t){const e=new Ls({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});e.mount(t),At.set(t,e)}function Ws(t,e,n,s){const i=[];if(function(t,e){return ut(t)||"number"==typeof t||"string"==typeof t&&!ct(e)}(t,e))i.push(function(t,e,n){const s=ut(t)?t:jt(t);return s.start(rs("",s,e,n)),s.animation}(t,ct(e)&&e.default||e,n&&n.default||n));else{const r=ht(t,e,s),o=r.length;for(let t=0;t<o;t++){const s=r[t],a=s instanceof Element?Rs:Ds;At.has(s)||a(s);const l=At.get(s),u={...n};"delay"in u&&"function"==typeof u.delay&&(u.delay=u.delay(t,o)),i.push(...as(l,{...e,transition:u},{}))}}return i}function Ns(t,e,n){const s=[];return function(t,{defaultTransition:e={},...n}={},s,o){const a=e.duration||.3,l=new Map,u=new Map,c={},p=new Map;let f=0,m=0,g=0;for(let n=0;n<t.length;n++){const i=t[n];if("string"==typeof i){p.set(i,m);continue}if(!Array.isArray(i)){p.set(i.name,pt(m,i.at,f,p));continue}let[l,v,y={}]=i;void 0!==y.at&&(m=pt(m,y.at,f,p));let w=0;const b=(t,n,s,i=0,l=0)=>{const u=bt(t),{delay:c=0,times:p=lt(u),type:f="keyframes",repeat:v,repeatType:y,repeatDelay:b=0,...T}=n;let{ease:x=e.ease||"easeOut",duration:S}=n;const A="function"==typeof c?c(i,l):c,V=u.length,M=d(f)?f:null==o?void 0:o[f];if(V<=2&&M){let t=100;if(2===V&&St(u)){const e=u[1]-u[0];t=Math.abs(e)}const e={...T};void 0!==S&&(e.duration=r(S));const n=h(e,t,M);x=n.ease,S=n.duration}null!=S||(S=a);const P=m+A;1===p.length&&0===p[0]&&(p[1]=1);const k=p.length-u.length;if(k>0&&at(p,k),1===u.length&&u.unshift(null),v){S=dt(S,v);const t=[...u],e=[...p];x=Array.isArray(x)?[...x]:[x];const n=[...x];for(let s=0;s<v;s++){u.push(...t);for(let i=0;i<t.length;i++)p.push(e[i]+(s+1)),x.push(0===i?"linear":rt(n,i-1))}gt(p,v)}const E=P+S;mt(s,u,x,p,P,E),w=Math.max(A+S,w),g=Math.max(E,g)};if(ut(l)){b(v,y,wt("default",yt(l,u)))}else{const t=ht(l,v,s,c),e=t.length;for(let n=0;n<e;n++){v=v,y=y;const s=yt(t[n],u);for(const t in v)b(v[t],Tt(y,t),wt(t,s),n,e)}}f=m,m+=w}return u.forEach((t,s)=>{for(const r in t){const o=t[r];o.sort(vt);const a=[],u=[],c=[];for(let t=0;t<o.length;t++){const{at:e,value:n,easing:s}=o[t];a.push(n),u.push(i(0,g,e)),c.push(s||"easeOut")}0!==u[0]&&(u.unshift(0),a.unshift(a[0]),c.unshift("easeInOut")),1!==u[u.length-1]&&(u.push(1),a.push(null)),l.has(s)||l.set(s,{keyframes:{},transition:{}});const h=l.get(s);h.keyframes[r]=a,h.transition[r]={...e,duration:g,ease:c,times:u,...n}}}),l}(t,e,n,{spring:nt}).forEach(({keyframes:t,transition:e},n)=>{s.push(...Ws(n,t,e))}),s}function Ks(t){return function(e,n,s){let i=[];var r;r=e,i=Array.isArray(r)&&r.some(Array.isArray)?Ns(e,n,t):Ws(e,n,s,t);const o=new l(i);return t&&t.animations.push(o),o}}const js=Ks();function zs(t,e,n){t.style.setProperty(e,n)}function Us(t,e,n){t.style[e]=n}const $s=s(()=>{try{document.createElement("div").animate({opacity:[1]})}catch(t){return!1}return!0}),Hs=new WeakMap;function Ys(t){const e=Hs.get(t)||new Map;return Hs.set(t,e),Hs.get(t)}class Xs extends class{constructor(t){this.animation=t}get duration(){var t,e,n;const s=(null===(e=null===(t=this.animation)||void 0===t?void 0:t.effect)||void 0===e?void 0:e.getComputedTiming().duration)||(null===(n=this.options)||void 0===n?void 0:n.duration)||300;return o(Number(s))}get time(){var t;return this.animation?o((null===(t=this.animation)||void 0===t?void 0:t.currentTime)||0):0}set time(t){this.animation&&(this.animation.currentTime=r(t))}get speed(){return this.animation?this.animation.playbackRate:1}set speed(t){this.animation&&(this.animation.playbackRate=t)}get state(){return this.animation?this.animation.playState:"finished"}get startTime(){return this.animation?this.animation.startTime:null}get finished(){return this.animation?this.animation.finished:Promise.resolve()}play(){this.animation&&this.animation.play()}pause(){this.animation&&this.animation.pause()}stop(){this.animation&&"idle"!==this.state&&"finished"!==this.state&&(this.animation.commitStyles&&this.animation.commitStyles(),this.cancel())}flatten(){var t;this.animation&&(null===(t=this.animation.effect)||void 0===t||t.updateTiming({easing:"linear"}))}attachTimeline(t){return this.animation&&p(this.animation,t),e}complete(){this.animation&&this.animation.finish()}cancel(){try{this.animation&&this.animation.cancel()}catch(t){}}}{constructor(t,e,s,i){const o=e.startsWith("--");n("string"!=typeof i.type);const a=Ys(t).get(e);a&&a.stop();if(Array.isArray(s)||(s=[s]),function(t,e,n){for(let s=0;s<e.length;s++)null===e[s]&&(e[s]=0===s?n():e[s-1]),"number"==typeof e[s]&&Ne[t]&&(e[s]=Ne[t].transform(e[s]));!$s()&&e.length<2&&e.unshift(n())}(e,s,()=>e.startsWith("--")?t.style.getPropertyValue(e):window.getComputedStyle(t)[e]),d(i.type)){const t=h(i,100,i.type);i.ease=v()?t.ease:"easeOut",i.duration=r(t.duration),i.type="keyframes"}else i.ease=i.ease||"easeOut";const l=()=>{this.setValue(t,e,Tn(s,i)),this.cancel(),this.resolveFinishedPromise()},u=()=>{this.setValue=o?zs:Us,this.options=i,this.updateFinishedPromise(),this.removeAnimation=()=>{const n=Hs.get(t);n&&n.delete(e)}};Jn()?(super(_n(t,e,s,i)),u(),!1===i.autoplay&&this.animation.pause(),this.animation.onfinish=l,Ys(t).set(e,this)):(super(),u(),l())}then(t,e){return this.currentFinishedPromise.then(t,e)}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}play(){"finished"===this.state&&this.updateFinishedPromise(),super.play()}cancel(){this.removeAnimation(),super.cancel()}}const qs=(t=>function(e,n,s){return new l(function(t,e,n,s){const i=V(t,s),o=i.length,a=[];for(let t=0;t<o;t++){const s=i[t],l={...n};"function"==typeof l.delay&&(l.delay=l.delay(t,o));for(const t in e){const n=e[t],i={...u(l,t)};i.duration=i.duration?r(i.duration):i.duration,i.delay=r(i.delay||0),a.push(new Xs(s,t,n,i))}}return a}(e,n,s,t))})();function Gs(t,e){let n;const s=()=>{const{currentTime:s}=e,i=(null===s?0:s.value)/100;n!==i&&t(i),n=i};return Ot.update(s,!0),()=>Bt(s)}const Zs=new WeakMap;let _s;function Js({target:t,contentRect:e,borderBoxSize:n}){var s;null===(s=Zs.get(t))||void 0===s||s.forEach(s=>{s({target:t,contentSize:e,get size(){return function(t,e){if(e){const{inlineSize:t,blockSize:n}=e[0];return{width:t,height:n}}return t instanceof SVGElement&&"getBBox"in t?t.getBBox():{width:t.offsetWidth,height:t.offsetHeight}}(t,n)}})})}function Qs(t){t.forEach(Js)}function ti(t,e){_s||"undefined"!=typeof ResizeObserver&&(_s=new ResizeObserver(Qs));const n=V(t);return n.forEach(t=>{let n=Zs.get(t);n||(n=new Set,Zs.set(t,n)),n.add(e),null==_s||_s.observe(t)}),()=>{n.forEach(t=>{const n=Zs.get(t);null==n||n.delete(e),(null==n?void 0:n.size)||null==_s||_s.unobserve(t)})}}const ei=new Set;let ni;function si(t){return ei.add(t),ni||(ni=()=>{const t={width:window.innerWidth,height:window.innerHeight},e={target:window,size:t,contentSize:t};ei.forEach(t=>t(e))},window.addEventListener("resize",ni)),()=>{ei.delete(t),!ei.size&&ni&&(ni=void 0)}}const ii={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function ri(t,e,n,s){const r=n[e],{length:o,position:a}=ii[e],l=r.current,u=n.time;r.current=t["scroll"+a],r.scrollLength=t["scroll"+o]-t["client"+o],r.offset.length=0,r.offset[0]=0,r.offset[1]=r.scrollLength,r.progress=i(0,r.scrollLength,r.current);const c=s-u;r.velocity=c>50?0:R(r.current-l,c)}const oi={start:0,center:.5,end:1};function ai(t,e,n=0){let s=0;if(t in oi&&(t=oi[t]),"string"==typeof t){const e=parseFloat(t);t.endsWith("px")?s=e:t.endsWith("%")?t=e/100:t.endsWith("vw")?s=e/100*document.documentElement.clientWidth:t.endsWith("vh")?s=e/100*document.documentElement.clientHeight:t=e}return"number"==typeof t&&(s=e*t),n+s}const li=[0,0];function ui(t,e,n,s){let i=Array.isArray(t)?t:li,r=0,o=0;return"number"==typeof t?i=[t,t]:"string"==typeof t&&(i=(t=t.trim()).includes(" ")?t.split(" "):[t,oi[t]?t:"0"]),r=ai(i[0],n,s),o=ai(i[1],e),r-o}const ci={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},hi={x:0,y:0};function di(t,e,n){const{offset:s=ci.All}=n,{target:i=t,axis:r="y"}=n,o="y"===r?"height":"width",a=i!==t?function(t,e){const n={x:0,y:0};let s=t;for(;s&&s!==e;)if(s instanceof HTMLElement)n.x+=s.offsetLeft,n.y+=s.offsetTop,s=s.offsetParent;else if("svg"===s.tagName){const t=s.getBoundingClientRect();s=s.parentElement;const e=s.getBoundingClientRect();n.x+=t.left-e.left,n.y+=t.top-e.top}else{if(!(s instanceof SVGGraphicsElement))break;{const{x:t,y:e}=s.getBBox();n.x+=t,n.y+=e;let i=null,r=s.parentNode;for(;!i;)"svg"===r.tagName&&(i=r),r=s.parentNode;s=i}}return n}(i,t):hi,l=i===t?{width:t.scrollWidth,height:t.scrollHeight}:function(t){return"getBBox"in t&&"svg"!==t.tagName?t.getBBox():{width:t.clientWidth,height:t.clientHeight}}(i),u={width:t.clientWidth,height:t.clientHeight};e[r].offset.length=0;let c=!e[r].interpolate;const h=s.length;for(let t=0;t<h;t++){const n=ui(s[t],u[o],l[o],a[r]);c||n===e[r].interpolatorOffsets[t]||(c=!0),e[r].offset[t]=n}c&&(e[r].interpolate=$n(e[r].offset,lt(s),{clamp:!1}),e[r].interpolatorOffsets=[...e[r].offset]),e[r].progress=L(0,1,e[r].interpolate(e[r].current))}function pi(t,e,n,s={}){return{measure:()=>function(t,e=t,n){if(n.x.targetOffset=0,n.y.targetOffset=0,e!==t){let s=e;for(;s&&s!==t;)n.x.targetOffset+=s.offsetLeft,n.y.targetOffset+=s.offsetTop,s=s.offsetParent}n.x.targetLength=e===t?e.scrollWidth:e.clientWidth,n.y.targetLength=e===t?e.scrollHeight:e.clientHeight,n.x.containerLength=t.clientWidth,n.y.containerLength=t.clientHeight}(t,s.target,n),update:e=>{!function(t,e,n){ri(t,"x",e,n),ri(t,"y",e,n),e.time=n}(t,n,e),(s.offset||s.target)&&di(t,n,s)},notify:()=>e(n)}}const fi=new WeakMap,mi=new WeakMap,gi=new WeakMap,vi=t=>t===document.documentElement?window:t;function yi(t,{container:e=document.documentElement,...n}={}){let s=gi.get(e);s||(s=new Set,gi.set(e,s));const i=pi(e,t,{time:0,x:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0},y:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}},n);if(s.add(i),!fi.has(e)){const t=()=>{for(const t of s)t.measure()},n=()=>{for(const t of s)t.update(It.timestamp)},i=()=>{for(const t of s)t.notify()},a=()=>{Ot.read(t,!1,!0),Ot.read(n,!1,!0),Ot.update(i,!1,!0)};fi.set(e,a);const l=vi(e);window.addEventListener("resize",a,{passive:!0}),e!==document.documentElement&&mi.set(e,(o=a,"function"==typeof(r=e)?si(r):ti(r,o))),l.addEventListener("scroll",a,{passive:!0})}var r,o;const a=fi.get(e);return Ot.read(a,!1,!0),()=>{var t;Bt(a);const n=gi.get(e);if(!n)return;if(n.delete(i),n.size)return;const s=fi.get(e);fi.delete(e),s&&(vi(e).removeEventListener("scroll",s),null===(t=mi.get(e))||void 0===t||t(),window.removeEventListener("resize",s))}}const wi=new Map;function bi({source:t,container:e=document.documentElement,axis:n="y"}={}){t&&(e=t),wi.has(e)||wi.set(e,{});const s=wi.get(e);return s[n]||(s[n]=a()?new ScrollTimeline({source:e,axis:n}):function({source:t,container:e,axis:n="y"}){t&&(e=t);const s={value:0},i=yi(t=>{s.value=100*t[n].progress},{container:e,axis:n});return{currentTime:s,cancel:i}}({source:e,axis:n})),s[n]}function Ti(t){return t&&(t.target||t.offset)}const xi={some:0,all:1};const Si=(t,e)=>Math.abs(t-e);const Ai=Ot,Vi=Ct.reduce((t,e)=>(t[e]=t=>Bt(t),t),{});t.MotionValue=Kt,t.animate=js,t.animateMini=qs,t.anticipate=se,t.backIn=ee,t.backInOut=ne,t.backOut=te,t.cancelFrame=Bt,t.cancelSync=Vi,t.circIn=ie,t.circInOut=oe,t.circOut=re,t.clamp=L,t.createScopedAnimate=Ks,t.cubicBezier=_t,t.delay=function(t,e){return function(t,e){const n=Wt.now(),s=({timestamp:i})=>{const r=i-n;r>=e&&(Bt(s),t(r-e))};return Ot.read(s,!0),()=>Bt(s)}(t,r(e))},t.distance=Si,t.distance2D=function(t,e){const n=Si(t.x,e.x),s=Si(t.y,e.y);return Math.sqrt(n**2+s**2)},t.easeIn=Nn,t.easeInOut=jn,t.easeOut=Kn,t.frame=Ot,t.frameData=It,t.frameSteps=Lt,t.hover=function(t,e,n={}){const[s,i,r]=M(t,n),o=t=>{if(!P(t))return;const{target:n}=t,s=e(n,t);if("function"!=typeof s||!n)return;const r=t=>{P(t)&&(s(t),n.removeEventListener("pointerleave",r))};n.addEventListener("pointerleave",r,i)};return s.forEach(t=>{t.addEventListener("pointerenter",o,i)}),r},t.inView=function(t,e,{root:n,margin:s,amount:i="some"}={}){const r=V(t),o=new WeakMap,a=new IntersectionObserver(t=>{t.forEach(t=>{const n=o.get(t.target);if(t.isIntersecting!==Boolean(n))if(t.isIntersecting){const n=e(t.target,t);"function"==typeof n?o.set(t.target,n):a.unobserve(t.target)}else"function"==typeof n&&(n(t),o.delete(t.target))})},{root:n,rootMargin:s,threshold:"number"==typeof i?i:xi[i]});return r.forEach(t=>a.observe(t)),()=>a.disconnect()},t.inertia=Wn,t.interpolate=$n,t.invariant=n,t.isDragActive=A,t.keyframes=Hn,t.mirrorEasing=Jt,t.mix=Dn,t.motionValue=jt,t.noop=e,t.pipe=Cn,t.press=function(t,e,n={}){const[s,i,r]=M(t,n),o=t=>{const n=t.currentTarget;if(!n||!I(t)||F.has(n))return;F.add(n),k(t,"set");const s=e(n,t),r=(t,e)=>{n.removeEventListener("pointerup",o),n.removeEventListener("pointercancel",a),k(t,"release"),I(t)&&F.has(n)&&(F.delete(n),"function"==typeof s&&s(t,{success:e}))},o=t=>{const e=!!t.isTrusted&&(s=t,i=n instanceof Element?n.getBoundingClientRect():{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight},s.clientX<i.left||s.clientX>i.right||s.clientY<i.top||s.clientY>i.bottom);var s,i;r(t,!e&&(!(n instanceof Element)||E(n,t.target)))},a=t=>{r(t,!1)};n.addEventListener("pointerup",o,i),n.addEventListener("pointercancel",a,i),n.addEventListener("lostpointercapture",a,i)};return s.forEach(t=>{let e=!1;var s;(t=n.useGlobalTarget?window:t)instanceof HTMLElement&&(e=!0,s=t,C.has(s.tagName)||-1!==s.tabIndex||null!==t.getAttribute("tabindex")||(t.tabIndex=0)),t.addEventListener("pointerdown",o,i),e&&t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const s=O(()=>{if(F.has(n))return;B(n,"down");const t=O(()=>{B(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>B(n,"cancel"),e)});n.addEventListener("keydown",s,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),e)})(t,i),i)}),r},t.progress=i,t.reverseEasing=Qt,t.scroll=function(t,{axis:n="y",...s}={}){const i={axis:n,...s};return"function"==typeof t?function(t,e){return function(t){return 2===t.length}(t)||Ti(e)?yi(n=>{t(n[e.axis].progress,n)},e):Gs(t,bi(e))}(t,i):function(t,n){if(t.flatten(),Ti(n))return t.pause(),yi(e=>{t.time=t.duration*e[n.axis].progress},n);{const s=bi(n);return t.attachTimeline?t.attachTimeline(s,t=>(t.pause(),Gs(e=>{t.time=t.duration*e},s))):e}}(t,i)},t.scrollInfo=yi,t.spring=nt,t.stagger=function(t=.1,{startDelay:e=0,from:n=0,ease:s}={}){return(i,r)=>{const o="number"==typeof n?n:function(t,e){if("first"===t)return 0;{const n=e-1;return"last"===t?n:n/2}}(n,r),a=Math.abs(o-i);let l=t*a;if(s){const e=r*t;l=Un(s)(l/e)*e}return e+l}},t.steps=function(t,e="end"){return n=>{const s=(n="end"===e?Math.min(n,.999):Math.max(n,.001))*t,i="end"===e?Math.floor(s):Math.ceil(s);return L(0,1,i/t)}},t.sync=Ai,t.time=Wt,t.transform=function(...t){const e=!Array.isArray(t[0]),n=e?0:-1,s=t[0+n],i=t[1+n],r=t[2+n],o=t[3+n],a=$n(i,r,{mixer:(l=r[0],(t=>t&&"object"==typeof t&&t.mix)(l)?l.mix:void 0),...o});var l;return e?a(s):a},t.wrap=st}));
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={})}(this,(function(t){"use strict";const e=t=>t;let n=e;function s(t){let e;return()=>(void 0===e&&(e=t()),e)}const i=(t,e,n)=>{const s=e-t;return 0===s?1:(n-t)/s},r=t=>1e3*t,o=t=>t/1e3,a=s(()=>void 0!==window.ScrollTimeline);class l extends class{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;n<this.animations.length;n++)this.animations[n][t]=e}attachTimeline(t,e){const n=this.animations.map(n=>a()&&n.attachTimeline?n.attachTimeline(t):"function"==typeof e?e(n):void 0);return()=>{n.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let e=0;e<this.animations.length;e++)t=Math.max(t,this.animations[e].duration);return t}runAll(t){this.animations.forEach(e=>e[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}{then(t,e){return Promise.all(this.animations).then(t).catch(e)}}function u(t,e){return t?t[e]||t.default||t:void 0}function c(t){let e=0;let n=t.next(e);for(;!n.done&&e<2e4;)e+=50,n=t.next(e);return e>=2e4?1/0:e}function h(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(c(s),2e4);return{type:"keyframes",ease:t=>s.next(i*t).value/e,duration:o(i)}}function d(t){return"function"==typeof t}function p(t,e){t.timeline=e,t.onfinish=null}const f=t=>Array.isArray(t)&&"number"==typeof t[0],m={linearEasing:void 0};function g(t,e){const n=s(t);return()=>{var t;return null!==(t=m[e])&&void 0!==t?t:n()}}const v=g(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),y=(t,e,n=10)=>{let s="";const r=Math.max(Math.round(e/n),2);for(let e=0;e<r;e++)s+=t(i(0,r-1,e))+", ";return`linear(${s.substring(0,s.length-2)})`};function w(t){return Boolean("function"==typeof t&&v()||!t||"string"==typeof t&&(t in T||v())||f(t)||Array.isArray(t)&&t.every(w))}const b=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,T={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:b([0,.65,.55,1]),circOut:b([.55,0,1,.45]),backIn:b([.31,.01,.66,-.59]),backOut:b([.33,1.53,.69,.99])};const x=!1,S=!1;function A(){return x||S}function V(t,e,n){var s;if(t instanceof EventTarget)return[t];if("string"==typeof t){let i=document;e&&(i=e.current);const r=null!==(s=null==n?void 0:n[t])&&void 0!==s?s:i.querySelectorAll(t);return r?Array.from(r):[]}return Array.from(t)}function M(t,e){const n=V(t),s=new AbortController;return[n,{passive:!0,...e,signal:s.signal},()=>s.abort()]}function P(t){return!("touch"===t.pointerType||A())}function k(t,e){const n=e+"PointerCapture";if(t.target instanceof Element&&n in t.target&&void 0!==t.pointerId)try{t.target[n](t.pointerId)}catch(t){}}const E=(t,e)=>!!e&&(t===e||E(t,e.parentElement)),F=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const C=new WeakSet;function O(t){return e=>{"Enter"===e.key&&t(e)}}function B(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function I(t){return(t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary)(t)&&!A()}const L=(t,e,n)=>n>e?e:n<t?t:n;function R(t,e){return e?t*(1e3/e):0}function D(t,e,n){const s=Math.max(e-5,0);return R(n-t(s),e-s)}const W=100,N=10,K=1,j=0,z=800,U=.3,$=.3,H={granular:.01,default:2},Y={granular:.005,default:.5},X=.01,q=10,G=.05,Z=1;function _({duration:t=z,bounce:e=U,velocity:n=j,mass:s=K}){let i,a,l=1-e;l=L(G,Z,l),t=L(X,q,o(t)),l<1?(i=e=>{const s=e*l,i=s*t;return.001-(s-n)/J(e,l)*Math.exp(-i)},a=e=>{const s=e*l*t,r=s*n+n,o=Math.pow(l,2)*Math.pow(e,2)*t,a=Math.exp(-s),u=J(Math.pow(e,2),l);return(.001-i(e)>0?-1:1)*((r-o)*a)/u}):(i=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,a=e=>Math.exp(-e*t)*(t*t*(n-e)));const u=function(t,e,n){let s=n;for(let n=1;n<12;n++)s-=t(s)/e(s);return s}(i,a,5/t);if(t=r(t),isNaN(u))return{stiffness:W,damping:N,duration:t};{const e=Math.pow(u,2)*s;return{stiffness:e,damping:2*l*Math.sqrt(s*e),duration:t}}}function J(t,e){return t*Math.sqrt(1-e*e)}const Q=["duration","bounce"],tt=["stiffness","damping","mass"];function et(t,e){return e.some(e=>void 0!==t[e])}function nt(t=$,e=U){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const a=n.keyframes[0],l=n.keyframes[n.keyframes.length-1],u={done:!1,value:a},{stiffness:h,damping:d,mass:p,duration:f,velocity:m,isResolvedFromDuration:g}=function(t){let e={velocity:j,stiffness:W,damping:N,mass:K,isResolvedFromDuration:!1,...t};if(!et(t,tt)&&et(t,Q))if(t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(1.2*n),i=s*s,r=2*L(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:K,stiffness:i,damping:r}}else{const n=_(t);e={...e,...n,mass:K},e.isResolvedFromDuration=!0}return e}({...n,velocity:-o(n.velocity||0)}),v=m||0,w=d/(2*Math.sqrt(h*p)),b=l-a,T=o(Math.sqrt(h/p)),x=Math.abs(b)<5;let S;if(s||(s=x?H.granular:H.default),i||(i=x?Y.granular:Y.default),w<1){const t=J(T,w);S=e=>{const n=Math.exp(-w*T*e);return l-n*((v+w*T*b)/t*Math.sin(t*e)+b*Math.cos(t*e))}}else if(1===w)S=t=>l-Math.exp(-T*t)*(b+(v+T*b)*t);else{const t=T*Math.sqrt(w*w-1);S=e=>{const n=Math.exp(-w*T*e),s=Math.min(t*e,300);return l-n*((v+w*T*b)*Math.sinh(s)+t*b*Math.cosh(s))/t}}const A={calculatedDuration:g&&f||null,next:t=>{const e=S(t);if(g)u.done=t>=f;else{let n=0;w<1&&(n=0===t?r(v):D(S,t,e));const o=Math.abs(n)<=s,a=Math.abs(l-e)<=i;u.done=o&&a}return u.value=u.done?l:e,u},toString:()=>{const t=Math.min(c(A),2e4),e=y(e=>A.next(t*e).value,t,30);return t+"ms "+e}};return A}const st=(t,e,n)=>{const s=e-t;return((n-t)%s+s)%s+t},it=t=>Array.isArray(t)&&"number"!=typeof t[0];function rt(t,e){return it(t)?t[st(0,t.length,e)]:t}const ot=(t,e,n)=>t+(e-t)*n;function at(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const r=i(0,e,s);t.push(ot(n,1,r))}}function lt(t){const e=[0];return at(e,t.length-1),e}const ut=t=>Boolean(t&&t.getVelocity);function ct(t){return"object"==typeof t&&!Array.isArray(t)}function ht(t,e,n,s){return"string"==typeof t&&ct(e)?V(t,n,s):t instanceof NodeList?Array.from(t):Array.isArray(t)?t:[t]}function dt(t,e,n){return t*(e+1)}function pt(t,e,n,s){var i;return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:null!==(i=s.get(e))&&void 0!==i?i:t}function ft(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}function mt(t,e,n,s,i,r){!function(t,e,n){for(let s=0;s<t.length;s++){const i=t[s];i.at>e&&i.at<n&&(ft(t,i),s--)}}(t,i,r);for(let o=0;o<e.length;o++)t.push({value:e[o],at:ot(i,r,s[o]),easing:rt(n,o)})}function gt(t,e){for(let n=0;n<t.length;n++)t[n]=t[n]/(e+1)}function vt(t,e){return t.at===e.at?null===t.value?1:null===e.value?-1:0:t.at-e.at}function yt(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function wt(t,e){return e[t]||(e[t]=[]),e[t]}function bt(t){return Array.isArray(t)?t:[t]}function Tt(t,e){return t&&t[e]?{...t,...t[e]}:{...t}}const xt=t=>"number"==typeof t,St=t=>t.every(xt),At=new WeakMap,Vt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Mt=new Set(Vt),Pt=new Set(["width","height","top","left","right","bottom",...Vt]),kt=t=>(t=>Array.isArray(t))(t)?t[t.length-1]||0:t,Et=!1,Ft=["read","resolveKeyframes","update","preRender","render","postRender"],Ct={value:null,addProjectionMetrics:null};const{schedule:Ot,cancel:Bt,state:It,steps:Lt}=function(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,o=Ft.reduce((t,n)=>(t[n]=function(t,e){let n=new Set,s=new Set,i=!1,r=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function u(e){o.has(e)&&(c.schedule(e),t()),l++,e(a)}const c={schedule:(t,e=!1,r=!1)=>{const a=r&&i?n:s;return e&&o.add(t),a.has(t)||a.add(t),t},cancel:t=>{s.delete(t),o.delete(t)},process:t=>{a=t,i?r=!0:(i=!0,[n,s]=[s,n],n.forEach(u),e&&Ct.value&&Ct.value.frameloop[e].push(l),l=0,n.clear(),i=!1,r&&(r=!1,c.process(t)))}};return c}(r,e?n:void 0),t),{}),{read:a,resolveKeyframes:l,update:u,preRender:c,render:h,postRender:d}=o,p=()=>{const r=performance.now();n=!1,i.delta=s?1e3/60:Math.max(Math.min(r-i.timestamp,40),1),i.timestamp=r,i.isProcessing=!0,a.process(i),l.process(i),u.process(i),c.process(i),h.process(i),d.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(p))};return{schedule:Ft.reduce((e,r)=>{const a=o[r];return e[r]=(e,r=!1,o=!1)=>(n||(n=!0,s=!0,i.isProcessing||t(p)),a.schedule(e,r,o)),e},{}),cancel:t=>{for(let e=0;e<Ft.length;e++)o[Ft[e]].cancel(t)},state:i,steps:o}}("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:e,!0);let Rt;function Dt(){Rt=void 0}const Wt={now:()=>(void 0===Rt&&Wt.set(It.isProcessing||Et?It.timestamp:performance.now()),Rt),set:t=>{Rt=t,queueMicrotask(Dt)}};class Nt{constructor(){this.subscriptions=[]}add(t){var e,n;return e=this.subscriptions,n=t,-1===e.indexOf(n)&&e.push(n),()=>ft(this.subscriptions,t)}notify(t,e,n){const s=this.subscriptions.length;if(s)if(1===s)this.subscriptions[0](t,e,n);else for(let i=0;i<s;i++){const s=this.subscriptions[i];s&&s(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}class Kt{constructor(t,e={}){this.version="12.4.12",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(t,e=!0)=>{const n=Wt.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),e&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=Wt.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new Nt);const n=this.events[t].add(e);return"change"===t?()=>{n(),Ot.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Wt.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return R(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function jt(t,e){return new Kt(t,e)}function zt(t){const e=[{},{}];return null==t||t.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function Ut(t,e,n,s){if("function"==typeof e){const[i,r]=zt(s);e=e(void 0!==n?n:t.custom,i,r)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[i,r]=zt(s);e=e(void 0!==n?n:t.custom,i,r)}return e}function $t(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,jt(n))}function Ht(t,e){const n=function(t,e,n){const s=t.getProps();return Ut(s,e,void 0!==n?n:s.custom,t)}(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const e in r){$t(t,e,kt(r[e]))}}function Yt(t,e){const n=t.getValue("willChange");if(s=n,Boolean(ut(s)&&s.add))return n.add(e);var s}const Xt=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),qt="data-"+Xt("framerAppearId");function Gt(t){return t.props[qt]}const Zt=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function _t(t,n,s,i){if(t===n&&s===i)return e;const r=e=>function(t,e,n,s,i){let r,o,a=0;do{o=e+(n-e)/2,r=Zt(o,s,i)-t,r>0?n=o:e=o}while(Math.abs(r)>1e-7&&++a<12);return o}(e,0,1,t,s);return t=>0===t||1===t?t:Zt(r(t),n,i)}const Jt=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Qt=t=>e=>1-t(1-e),te=_t(.33,1.53,.69,.99),ee=Qt(te),ne=Jt(ee),se=t=>(t*=2)<1?.5*ee(t):.5*(2-Math.pow(2,-10*(t-1))),ie=t=>1-Math.sin(Math.acos(t)),re=Qt(ie),oe=Jt(ie),ae=t=>/^0[^.\s]+$/u.test(t);const le={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},ue={...le,transform:t=>L(0,1,t)},ce={...le,default:1},he=t=>Math.round(1e5*t)/1e5,de=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const pe=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,fe=(t,e)=>n=>Boolean("string"==typeof n&&pe.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),me=(t,e,n)=>s=>{if("string"!=typeof s)return s;const[i,r,o,a]=s.match(de);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(o),alpha:void 0!==a?parseFloat(a):1}},ge={...le,transform:t=>Math.round((t=>L(0,255,t))(t))},ve={test:fe("rgb","red"),parse:me("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+ge.transform(t)+", "+ge.transform(e)+", "+ge.transform(n)+", "+he(ue.transform(s))+")"};const ye={test:fe("#"),parse:function(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}},transform:ve.transform},we=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),be=we("deg"),Te=we("%"),xe=we("px"),Se=we("vh"),Ae=we("vw"),Ve={...Te,parse:t=>Te.parse(t)/100,transform:t=>Te.transform(100*t)},Me={test:fe("hsl","hue"),parse:me("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+Te.transform(he(e))+", "+Te.transform(he(n))+", "+he(ue.transform(s))+")"},Pe={test:t=>ve.test(t)||ye.test(t)||Me.test(t),parse:t=>ve.test(t)?ve.parse(t):Me.test(t)?Me.parse(t):ye.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?ve.transform(t):Me.transform(t)},ke=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const Ee=/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;function Fe(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const o=e.replace(Ee,t=>(Pe.test(t)?(s.color.push(r),i.push("color"),n.push(Pe.parse(t))):t.startsWith("var(")?(s.var.push(r),i.push("var"),n.push(t)):(s.number.push(r),i.push("number"),n.push(parseFloat(t))),++r,"${}")).split("${}");return{values:n,split:o,indexes:s,types:i}}function Ce(t){return Fe(t).values}function Oe(t){const{split:e,types:n}=Fe(t),s=e.length;return t=>{let i="";for(let r=0;r<s;r++)if(i+=e[r],void 0!==t[r]){const e=n[r];i+="number"===e?he(t[r]):"color"===e?Pe.transform(t[r]):t[r]}return i}}const Be=t=>"number"==typeof t?0:t;const Ie={test:function(t){var e,n;return isNaN(t)&&"string"==typeof t&&((null===(e=t.match(de))||void 0===e?void 0:e.length)||0)+((null===(n=t.match(ke))||void 0===n?void 0:n.length)||0)>0},parse:Ce,createTransformer:Oe,getAnimatableNone:function(t){const e=Ce(t);return Oe(t)(e.map(Be))}},Le=new Set(["brightness","contrast","saturate","opacity"]);function Re(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[s]=n.match(de)||[];if(!s)return t;const i=n.replace(s,"");let r=Le.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const De=/\b([a-z-]*)\(.*?\)/gu,We={...Ie,getAnimatableNone:t=>{const e=t.match(De);return e?e.map(Re).join(" "):t}},Ne={borderWidth:xe,borderTopWidth:xe,borderRightWidth:xe,borderBottomWidth:xe,borderLeftWidth:xe,borderRadius:xe,radius:xe,borderTopLeftRadius:xe,borderTopRightRadius:xe,borderBottomRightRadius:xe,borderBottomLeftRadius:xe,width:xe,maxWidth:xe,height:xe,maxHeight:xe,top:xe,right:xe,bottom:xe,left:xe,padding:xe,paddingTop:xe,paddingRight:xe,paddingBottom:xe,paddingLeft:xe,margin:xe,marginTop:xe,marginRight:xe,marginBottom:xe,marginLeft:xe,backgroundPositionX:xe,backgroundPositionY:xe},Ke={rotate:be,rotateX:be,rotateY:be,rotateZ:be,scale:ce,scaleX:ce,scaleY:ce,scaleZ:ce,skew:be,skewX:be,skewY:be,distance:xe,translateX:xe,translateY:xe,translateZ:xe,x:xe,y:xe,z:xe,perspective:xe,transformPerspective:xe,opacity:ue,originX:Ve,originY:Ve,originZ:xe},je={...le,transform:Math.round},ze={...Ne,...Ke,zIndex:je,size:xe,fillOpacity:ue,strokeOpacity:ue,numOctaves:je},Ue={...ze,color:Pe,backgroundColor:Pe,outlineColor:Pe,fill:Pe,stroke:Pe,borderColor:Pe,borderTopColor:Pe,borderRightColor:Pe,borderBottomColor:Pe,borderLeftColor:Pe,filter:We,WebkitFilter:We},$e=t=>Ue[t];function He(t,e){let n=$e(t);return n!==We&&(n=Ie),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Ye=new Set(["auto","none","0"]);const Xe=t=>t===le||t===xe,qe=(t,e)=>parseFloat(t.split(", ")[e]),Ge=(t,e)=>(n,{transform:s})=>{if("none"===s||!s)return 0;const i=s.match(/^matrix3d\((.+)\)$/u);if(i)return qe(i[1],e);{const e=s.match(/^matrix\((.+)\)$/u);return e?qe(e[1],t):0}},Ze=new Set(["x","y","z"]),_e=Vt.filter(t=>!Ze.has(t));const Je={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:Ge(4,13),y:Ge(5,14)};Je.translateX=Je.x,Je.translateY=Je.y;const Qe=new Set;let tn=!1,en=!1;function nn(){if(en){const t=Array.from(Qe).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),n=new Map;e.forEach(t=>{const e=function(t){const e=[];return _e.forEach(n=>{const s=t.getValue(n);void 0!==s&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}(t);e.length&&(n.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=n.get(t);e&&e.forEach(([e,n])=>{var s;null===(s=t.getValue(e))||void 0===s||s.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}en=!1,tn=!1,Qe.forEach(t=>t.complete()),Qe.clear()}function sn(){Qe.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(en=!0)})}class rn{constructor(t,e,n,s,i,r=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=s,this.element=i,this.isAsync=r}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Qe.add(this),tn||(tn=!0,Ot.read(sn),Ot.resolveKeyframes(nn))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:s}=this;for(let i=0;i<t.length;i++)if(null===t[i])if(0===i){const i=null==s?void 0:s.get(),r=t[t.length-1];if(void 0!==i)t[0]=i;else if(n&&e){const s=n.readValue(e,r);null!=s&&(t[0]=s)}void 0===t[0]&&(t[0]=r),s&&void 0===i&&s.set(t[0])}else t[i]=t[i-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Qe.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Qe.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const on=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),an=t=>e=>"string"==typeof e&&e.startsWith(t),ln=an("--"),un=an("var(--"),cn=t=>!!un(t)&&hn.test(t.split("/*")[0].trim()),hn=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,dn=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function pn(t,e,n=1){const[s,i]=function(t){const e=dn.exec(t);if(!e)return[,];const[,n,s,i]=e;return["--"+(null!=n?n:s),i]}(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);if(r){const t=r.trim();return on(t)?parseFloat(t):t}return cn(i)?pn(i,e,n+1):i}const fn=t=>e=>e.test(t),mn=[le,xe,Te,be,Ae,Se,{test:t=>"auto"===t,parse:t=>t}],gn=t=>mn.find(fn(t));class vn extends rn{constructor(t,e,n,s,i){super(t,e,n,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){let s=t[n];if("string"==typeof s&&(s=s.trim(),cn(s))){const i=pn(s,e.current);void 0!==i&&(t[n]=i),n===t.length-1&&(this.finalKeyframe=s)}}if(this.resolveNoneKeyframes(),!Pt.has(n)||2!==t.length)return;const[s,i]=t,r=gn(s),o=gn(i);if(r!==o)if(Xe(r)&&Xe(o))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)("number"==typeof(s=t[e])?0===s:null===s||"none"===s||"0"===s||ae(s))&&n.push(e);var s;n.length&&function(t,e,n){let s=0,i=void 0;for(;s<t.length&&!i;){const e=t[s];"string"==typeof e&&!Ye.has(e)&&Fe(e).values.length&&(i=t[s]),s++}if(i&&n)for(const s of e)t[s]=He(n,i)}(t,n,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Je[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const s=e[e.length-1];void 0!==s&&t.getValue(n,s).jump(s,!1)}measureEndState(){var t;const{element:e,name:n,unresolvedKeyframes:s}=this;if(!e||!e.current)return;const i=e.getValue(n);i&&i.jump(this.measuredOrigin,!1);const r=s.length-1,o=s[r];s[r]=Je[n](e.measureViewportBox(),window.getComputedStyle(e.current)),null!==o&&void 0===this.finalKeyframe&&(this.finalKeyframe=o),(null===(t=this.removedTransforms)||void 0===t?void 0:t.length)&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}}const yn=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Ie.test(t)&&"0"!==t||t.startsWith("url(")));function wn(t,e,n,s){const i=t[0];if(null===i)return!1;if("display"===e||"visibility"===e)return!0;const r=t[t.length-1],o=yn(i,e),a=yn(r,e);return!(!o||!a)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}(t)||("spring"===n||d(n))&&s)}const bn=t=>null!==t;function Tn(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(bn),r=e&&"loop"!==n&&e%2==1?0:i.length-1;return r&&void 0!==s?s:i[r]}class xn{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:r="loop",...o}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Wt.now(),this.options={autoplay:t,delay:e,type:n,repeat:s,repeatDelay:i,repeatType:r,...o},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return this._resolved||this.hasAttemptedResolve||(sn(),nn()),this._resolved}onKeyframesResolved(t,e){this.resolvedAt=Wt.now(),this.hasAttemptedResolve=!0;const{name:n,type:s,velocity:i,delay:r,onComplete:o,onUpdate:a,isGenerator:l}=this.options;if(!l&&!wn(t,n,s,i)){if(!r)return a&&a(Tn(t,this.options,e)),o&&o(),void this.resolveFinishedPromise();this.options.duration=0}const u=this.initPlayback(t,e);!1!==u&&(this._resolved={keyframes:t,finalKeyframe:e,...u},this.onPostResolved())}onPostResolved(){}then(t,e){return this.currentFinishedPromise.then(t,e)}flatten(){this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear")}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}function Sn(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function An(t,e){return n=>n>0?e:t}const Vn=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},Mn=[ye,ve,Me];function Pn(t){const e=(n=t,Mn.find(t=>t.test(n)));var n;if(!Boolean(e))return!1;let s=e.parse(t);return e===Me&&(s=function({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,n/=100;let i=0,r=0,o=0;if(e/=100){const s=n<.5?n*(1+e):n+e-n*e,a=2*n-s;i=Sn(a,s,t+1/3),r=Sn(a,s,t),o=Sn(a,s,t-1/3)}else i=r=o=n;return{red:Math.round(255*i),green:Math.round(255*r),blue:Math.round(255*o),alpha:s}}(s)),s}const kn=(t,e)=>{const n=Pn(t),s=Pn(e);if(!n||!s)return An(t,e);const i={...n};return t=>(i.red=Vn(n.red,s.red,t),i.green=Vn(n.green,s.green,t),i.blue=Vn(n.blue,s.blue,t),i.alpha=ot(n.alpha,s.alpha,t),ve.transform(i))},En=(t,e)=>n=>e(t(n)),Fn=(...t)=>t.reduce(En),Cn=new Set(["none","hidden"]);function On(t,e){return n=>ot(t,e,n)}function Bn(t){return"number"==typeof t?On:"string"==typeof t?cn(t)?An:Pe.test(t)?kn:Rn:Array.isArray(t)?In:"object"==typeof t?Pe.test(t)?kn:Ln:An}function In(t,e){const n=[...t],s=n.length,i=t.map((t,n)=>Bn(t)(t,e[n]));return t=>{for(let e=0;e<s;e++)n[e]=i[e](t);return n}}function Ln(t,e){const n={...t,...e},s={};for(const i in n)void 0!==t[i]&&void 0!==e[i]&&(s[i]=Bn(t[i])(t[i],e[i]));return t=>{for(const e in s)n[e]=s[e](t);return n}}const Rn=(t,e)=>{const n=Ie.createTransformer(e),s=Fe(t),i=Fe(e);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?Cn.has(t)&&!i.values.length||Cn.has(e)&&!s.values.length?function(t,e){return Cn.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):Fn(In(function(t,e){var n;const s=[],i={color:0,var:0,number:0};for(let r=0;r<e.values.length;r++){const o=e.types[r],a=t.indexes[o][i[o]],l=null!==(n=t.values[a])&&void 0!==n?n:0;s[r]=l,i[o]++}return s}(s,i),i.values),n):An(t,e)};function Dn(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return ot(t,e,n);return Bn(t)(t,e)}function Wn({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:c}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)<Math.abs(l-t)?a:l;let f=n*e;const m=h+f,g=void 0===o?m:o(m);g!==m&&(f=g-h);const v=t=>-f*Math.exp(-t/s),y=t=>g+v(t),w=t=>{const e=v(t),n=y(t);d.done=Math.abs(e)<=u,d.value=d.done?g:n};let b,T;const x=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==l&&e>l)&&(b=t,T=nt({keyframes:[d.value,p(d.value)],velocity:D(y,t,d.value),damping:i,stiffness:r,restDelta:u,restSpeed:c}))};return x(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==b||(e=!0,w(t),x(t)),void 0!==b&&t>=b?T.next(t-b):(!e&&w(t),d)}}}const Nn=_t(.42,0,1,1),Kn=_t(0,0,.58,1),jn=_t(.42,0,.58,1),zn={linear:e,easeIn:Nn,easeInOut:jn,easeOut:Kn,circIn:ie,circInOut:oe,circOut:re,backIn:ee,backInOut:ne,backOut:te,anticipate:se},Un=t=>{if(f(t)){n(4===t.length);const[e,s,i,r]=t;return _t(e,s,i,r)}return"string"==typeof t?zn[t]:t};function $n(t,s,{clamp:r=!0,ease:o,mixer:a}={}){const l=t.length;if(n(l===s.length),1===l)return()=>s[0];if(2===l&&s[0]===s[1])return()=>s[1];const u=t[0]===t[1];t[0]>t[l-1]&&(t=[...t].reverse(),s=[...s].reverse());const c=function(t,n,s){const i=[],r=s||Dn,o=t.length-1;for(let s=0;s<o;s++){let o=r(t[s],t[s+1]);if(n){const t=Array.isArray(n)?n[s]||e:n;o=Fn(t,o)}i.push(o)}return i}(s,o,a),h=c.length,d=e=>{if(u&&e<t[0])return s[0];let n=0;if(h>1)for(;n<t.length-2&&!(e<t[n+1]);n++);const r=i(t[n],t[n+1],e);return c[n](r)};return r?e=>d(L(t[0],t[l-1],e)):d}function Hn({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=it(s)?s.map(Un):Un(s),r={done:!1,value:e[0]},o=$n(function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:lt(e),t),e,{ease:Array.isArray(i)?i:(a=e,l=i,a.map(()=>l||jn).splice(0,a.length-1))});var a,l;return{calculatedDuration:t,next:e=>(r.value=o(e),r.done=e>=t,r)}}const Yn=t=>{const e=({timestamp:e})=>t(e);return{start:()=>Ot.update(e,!0),stop:()=>Bt(e),now:()=>It.isProcessing?It.timestamp:Wt.now()}},Xn={decay:Wn,inertia:Wn,tween:Hn,keyframes:Hn,spring:nt},qn=t=>t/100;class Gn extends xn{constructor(t){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=()=>{if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.teardown();const{onStop:t}=this.options;t&&t()};const{name:e,motionValue:n,element:s,keyframes:i}=this.options,r=(null==s?void 0:s.KeyframeResolver)||rn;this.resolver=new r(i,(t,e)=>this.onKeyframesResolved(t,e),e,n,s),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:e="keyframes",repeat:n=0,repeatDelay:s=0,repeatType:i,velocity:r=0}=this.options,o=d(e)?e:Xn[e]||Hn;let a,l;o!==Hn&&"number"!=typeof t[0]&&(a=Fn(qn,Dn(t[0],t[1])),t=[0,100]);const u=o({...this.options,keyframes:t});"mirror"===i&&(l=o({...this.options,keyframes:[...t].reverse(),velocity:-r})),null===u.calculatedDuration&&(u.calculatedDuration=c(u));const{calculatedDuration:h}=u,p=h+s;return{generator:u,mirroredGenerator:l,mapPercentToKeyframes:a,calculatedDuration:h,resolvedDuration:p,totalDuration:p*(n+1)-s}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&t?this.state=this.pendingPlayState:this.pause()}tick(t,e=!1){const{resolved:n}=this;if(!n){const{keyframes:t}=this.options;return{done:!0,value:t[t.length-1]}}const{finalKeyframe:s,generator:i,mirroredGenerator:r,mapPercentToKeyframes:o,keyframes:a,calculatedDuration:l,totalDuration:u,resolvedDuration:c}=n;if(null===this.startTime)return i.next(0);const{delay:h,repeat:d,repeatType:p,repeatDelay:f,onUpdate:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-u/this.speed,this.startTime)),e?this.currentTime=t:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const g=this.currentTime-h*(this.speed>=0?1:-1),v=this.speed>=0?g<0:g>u;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=u);let y=this.currentTime,w=i;if(d){const t=Math.min(this.currentTime,u)/c;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,d+1);Boolean(e%2)&&("reverse"===p?(n=1-n,f&&(n-=f/c)):"mirror"===p&&(w=r)),y=L(0,1,n)*c}const b=v?{done:!1,value:a[0]}:w.next(y);o&&(b.value=o(b.value));let{done:T}=b;v||null===l||(T=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const x=null===this.holdTime&&("finished"===this.state||"running"===this.state&&T);return x&&void 0!==s&&(b.value=Tn(a,this.options,s)),m&&m(b.value),x&&this.finish(),b}get duration(){const{resolved:t}=this;return t?o(t.calculatedDuration):0}get time(){return o(this.currentTime)}set time(t){t=r(t),this.currentTime=t,null!==this.holdTime||0===this.speed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=o(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:t=Yn,onPlay:e,startTime:n}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),e&&e();const s=this.driver.now();null!==this.holdTime?this.startTime=s-this.holdTime:this.startTime?"finished"===this.state&&(this.startTime=s):this.startTime=null!=n?n:this.calcStartTime(),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;this._resolved?(this.state="paused",this.holdTime=null!==(t=this.currentTime)&&void 0!==t?t:0):this.pendingPlayState="paused"}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){null!==this.cancelTime&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const Zn=new Set(["opacity","clipPath","filter","transform"]);function _n(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:o="loop",ease:a="easeInOut",times:l}={}){const u={[e]:n};l&&(u.offset=l);const c=function t(e,n){return e?"function"==typeof e&&v()?y(e,n):f(e)?b(e):Array.isArray(e)?e.map(e=>t(e,n)||T.easeOut):T[e]:void 0}(a,i);Array.isArray(c)&&(u.easing=c);return t.animate(u,{delay:s,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:r+1,direction:"reverse"===o?"alternate":"normal"})}const Jn=s(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));const Qn={anticipate:se,backInOut:ne,circInOut:oe};class ts extends xn{constructor(t){super(t);const{name:e,motionValue:n,element:s,keyframes:i}=this.options;this.resolver=new vn(i,(t,e)=>this.onKeyframesResolved(t,e),e,n,s),this.resolver.scheduleResolve()}initPlayback(t,e){let{duration:n=300,times:s,ease:i,type:r,motionValue:o,name:a,startTime:l}=this.options;if(!o.owner||!o.owner.current)return!1;var u;if("string"==typeof i&&v()&&i in Qn&&(i=Qn[i]),d((u=this.options).type)||"spring"===u.type||!w(u.ease)){const{onComplete:e,onUpdate:o,motionValue:a,element:l,...u}=this.options,c=function(t,e){const n=new Gn({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let s={done:!1,value:t[0]};const i=[];let r=0;for(;!s.done&&r<2e4;)s=n.sample(r),i.push(s.value),r+=10;return{times:void 0,keyframes:i,duration:r-10,ease:"linear"}}(t,u);1===(t=c.keyframes).length&&(t[1]=t[0]),n=c.duration,s=c.times,i=c.ease,r="keyframes"}const c=_n(o.owner.current,a,t,{...this.options,duration:n,times:s,ease:i});return c.startTime=null!=l?l:this.calcStartTime(),this.pendingTimeline?(p(c,this.pendingTimeline),this.pendingTimeline=void 0):c.onfinish=()=>{const{onComplete:n}=this.options;o.set(Tn(t,this.options,e)),n&&n(),this.cancel(),this.resolveFinishedPromise()},{animation:c,duration:n,times:s,type:r,ease:i,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:e}=t;return o(e)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:e}=t;return o(e.currentTime||0)}set time(t){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.currentTime=r(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:e}=t;return e.playbackRate}set speed(t){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:e}=t;return e.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:e}=t;return e.startTime}attachTimeline(t){if(this._resolved){const{resolved:n}=this;if(!n)return e;const{animation:s}=n;p(s,t)}else this.pendingTimeline=t;return e}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:e}=t;"finished"===e.playState&&this.updateFinishedPromise(),e.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:e}=t;e.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:e,keyframes:n,duration:s,type:i,ease:o,times:a}=t;if("idle"===e.playState||"finished"===e.playState)return;if(this.time){const{motionValue:t,onUpdate:e,onComplete:l,element:u,...c}=this.options,h=new Gn({...c,keyframes:n,duration:s,type:i,ease:o,times:a,isGenerator:!0}),d=r(this.time);t.setWithVelocity(h.sample(d-10).value,h.sample(d).value,10)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:r,type:o}=t;if(!(e&&e.owner&&e.owner.current instanceof HTMLElement))return!1;const{onUpdate:a,transformTemplate:l}=e.owner.getProps();return Jn()&&n&&Zn.has(n)&&!a&&!l&&!s&&"mirror"!==i&&0!==r&&"inertia"!==o}}const es={type:"spring",stiffness:500,damping:25,restSpeed:10},ns={type:"keyframes",duration:.8},ss={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},is=(t,{keyframes:e})=>e.length>2?ns:Mt.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:es:ss;const rs=(t,e,n,s={},i,o)=>a=>{const c=u(s,t)||{},h=c.delay||s.delay||0;let{elapsed:d=0}=s;d-=r(h);let p={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...c,delay:-d,onUpdate:t=>{e.set(t),c.onUpdate&&c.onUpdate(t)},onComplete:()=>{a(),c.onComplete&&c.onComplete()},name:t,motionValue:e,element:o?void 0:i};(function({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:r,repeatType:o,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length})(c)||(p={...p,...is(t,p)}),p.duration&&(p.duration=r(p.duration)),p.repeatDelay&&(p.repeatDelay=r(p.repeatDelay)),void 0!==p.from&&(p.keyframes[0]=p.from);let f=!1;if((!1===p.type||0===p.duration&&!p.repeatDelay)&&(p.duration=0,0===p.delay&&(f=!0)),p.allowFlatten=!c.type&&!c.ease,f&&!o&&void 0!==e.get()){const t=Tn(p.keyframes,c);if(void 0!==t)return Ot.update(()=>{p.onUpdate(t),p.onComplete()}),new l([])}return!o&&ts.supports(p)?new ts(p):new Gn(p)};function os({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,s}function as(t,e,{delay:n=0,transitionOverride:s,type:i}={}){var r;let{transition:o=t.getDefaultTransition(),transitionEnd:a,...l}=e;s&&(o=s);const c=[],h=i&&t.animationState&&t.animationState.getState()[i];for(const e in l){const s=t.getValue(e,null!==(r=t.latestValues[e])&&void 0!==r?r:null),i=l[e];if(void 0===i||h&&os(h,e))continue;const a={delay:n,...u(o||{},e)};let d=!1;if(window.MotionHandoffAnimation){const n=Gt(t);if(n){const t=window.MotionHandoffAnimation(n,e,Ot);null!==t&&(a.startTime=t,d=!0)}}Yt(t,e),s.start(rs(e,s,i,t.shouldReduceMotion&&Pt.has(e)?{type:!1}:a,t,d));const p=s.animation;p&&c.push(p)}return a&&Promise.all(c).then(()=>{Ot.update(()=>{a&&Ht(t,a)})}),c}const ls=()=>({x:{min:0,max:0},y:{min:0,max:0}}),us={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},cs={};for(const t in us)cs[t]={isEnabled:e=>us[t].some(t=>!!e[t])};const hs="undefined"!=typeof window,ds={current:null},ps={current:!1};const fs=[...mn,Pe,Ie];const ms=["initial","animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"];function gs(t){return null!==(e=t.animate)&&"object"==typeof e&&"function"==typeof e.start||ms.some(e=>function(t){return"string"==typeof t||Array.isArray(t)}(t[e]));var e}const vs=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class ys{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:s,blockInitialAnimation:i,visualState:r},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=rn,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=Wt.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,Ot.render(this.render,!1,!0))};const{latestValues:a,renderState:l,onUpdate:u}=r;this.onUpdate=u,this.latestValues=a,this.baseTarget={...a},this.initialValues=e.initial?{...a}:{},this.renderState=l,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=o,this.blockInitialAnimation=Boolean(i),this.isControllingVariants=gs(e),this.isVariantNode=function(t){return Boolean(gs(t)||t.variants)}(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:c,...h}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in h){const e=h[t];void 0!==a[t]&&ut(e)&&e.set(a[t],!1)}}mount(t){this.current=t,At.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((t,e)=>this.bindToMotionValue(e,t)),ps.current||function(){if(ps.current=!0,hs)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>ds.current=t.matches;t.addListener(e),e()}else ds.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||ds.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Bt(this.notifyUpdate),Bt(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}bindToMotionValue(t,e){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const n=Mt.has(t);n&&this.onBindTransform&&this.onBindTransform();const s=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&Ot.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)}),i=e.on("renderRequest",this.scheduleRender);let r;window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{s(),i(),r&&r(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in cs){const e=cs[t];if(!e)continue;const{isEnabled:n,Feature:s}=e;if(!this.features[t]&&s&&n(this.props)&&(this.features[t]=new s(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<vs.length;e++){const n=vs[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const s=t["on"+n];s&&(this.propEventSubscriptions[n]=this.on(n,s))}this.prevMotionValues=function(t,e,n){for(const s in e){const i=e[s],r=n[s];if(ut(i))t.addValue(s,i);else if(ut(r))t.addValue(s,jt(i,{owner:t}));else if(r!==i)if(t.hasValue(s)){const e=t.getValue(s);!0===e.liveStyle?e.jump(i):e.hasAnimated||e.set(i)}else{const e=t.getStaticValue(s);t.addValue(s,jt(void 0!==e?e:i,{owner:t}))}}for(const s in n)void 0===e[s]&&t.removeValue(s);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=jt(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){var n;let s=void 0===this.latestValues[t]&&this.current?null!==(n=this.getBaseTargetFromProps(this.props,t))&&void 0!==n?n:this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var i;return null!=s&&("string"==typeof s&&(on(s)||ae(s))?s=parseFloat(s):(i=s,!fs.find(fn(i))&&Ie.test(e)&&(s=He(t,e))),this.setBaseTarget(t,ut(s)?s.get():s)),ut(s)?s.get():s}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;const{initial:n}=this.props;let s;if("string"==typeof n||"object"==typeof n){const i=Ut(this.props,n,null===(e=this.presenceContext)||void 0===e?void 0:e.custom);i&&(s=i[t])}if(n&&void 0!==s)return s;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||ut(i)?void 0!==this.initialValues[t]&&void 0===s?void 0:this.baseTarget[t]:i}on(t,e){return this.events[t]||(this.events[t]=new Nt),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}class ws extends ys{constructor(){super(...arguments),this.KeyframeResolver=vn}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;ut(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=""+t)}))}}const bs=(t,e)=>e&&"number"==typeof t?e.transform(t):t,Ts={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},xs=Vt.length;function Ss(t,e,n){const{style:s,vars:i,transformOrigin:r}=t;let o=!1,a=!1;for(const t in e){const n=e[t];if(Mt.has(t))o=!0;else if(ln(t))i[t]=n;else{const e=bs(n,ze[t]);t.startsWith("origin")?(a=!0,r[t]=e):s[t]=e}}if(e.transform||(o||n?s.transform=function(t,e,n){let s="",i=!0;for(let r=0;r<xs;r++){const o=Vt[r],a=t[o];if(void 0===a)continue;let l=!0;if(l="number"==typeof a?a===(o.startsWith("scale")?1:0):0===parseFloat(a),!l||n){const t=bs(a,ze[o]);if(!l){i=!1;s+=`${Ts[o]||o}(${t}) `}n&&(e[o]=t)}}return s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}(e,t.transform,n):s.transform&&(s.transform="none")),a){const{originX:t="50%",originY:e="50%",originZ:n=0}=r;s.transformOrigin=`${t} ${e} ${n}`}}const As={offset:"stroke-dashoffset",array:"stroke-dasharray"},Vs={offset:"strokeDashoffset",array:"strokeDasharray"};function Ms(t,e,n){return"string"==typeof t?t:xe.transform(e+n*t)}function Ps(t,{attrX:e,attrY:n,attrScale:s,originX:i,originY:r,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...u},c,h){if(Ss(t,u,h),c)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:d,style:p,dimensions:f}=t;d.transform&&(f&&(p.transform=d.transform),delete d.transform),f&&(void 0!==i||void 0!==r||p.transform)&&(p.transformOrigin=function(t,e,n){return`${Ms(e,t.x,t.width)} ${Ms(n,t.y,t.height)}`}(f,void 0!==i?i:.5,void 0!==r?r:.5)),void 0!==e&&(d.x=e),void 0!==n&&(d.y=n),void 0!==s&&(d.scale=s),void 0!==o&&function(t,e,n=1,s=0,i=!0){t.pathLength=1;const r=i?As:Vs;t[r.offset]=xe.transform(-s);const o=xe.transform(e),a=xe.transform(n);t[r.array]=`${o} ${a}`}(d,o,a,l,!1)}const ks=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Es(t,{style:e,vars:n},s,i){Object.assign(t.style,e,i&&i.getProjectionStyles(s));for(const e in n)t.style.setProperty(e,n[e])}const Fs={};function Cs(t,{layout:e,layoutId:n}){return Mt.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!Fs[t]||"opacity"===t)}function Os(t,e,n){var s;const{style:i}=t,r={};for(const o in i)(ut(i[o])||e.style&&ut(e.style[o])||Cs(o,t)||void 0!==(null===(s=null==n?void 0:n.getValue(o))||void 0===s?void 0:s.liveStyle))&&(r[o]=i[o]);return r}class Bs extends ws{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ls,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&function(t,e){try{e.dimensions="function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}catch(t){e.dimensions={x:0,y:0,width:0,height:0}}}(this.current,this.renderState)}}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(Mt.has(e)){const t=$e(e);return t&&t.default||0}return e=ks.has(e)?e:Xt(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return function(t,e,n){const s=Os(t,e,n);for(const n in t)if(ut(t[n])||ut(e[n])){s[-1!==Vt.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return s}(t,e,n)}onBindTransform(){this.current&&!this.renderState.dimensions&&Ot.postRender(this.updateDimensions)}build(t,e,n){Ps(t,e,this.isSVGTag,n.transformTemplate)}renderInstance(t,e,n,s){!function(t,e,n,s){Es(t,e,void 0,s);for(const n in e.attrs)t.setAttribute(ks.has(n)?n:Xt(n),e.attrs[n])}(t,e,0,s)}mount(t){var e;this.isSVGTag="string"==typeof(e=t.tagName)&&"svg"===e.toLowerCase(),super.mount(t)}}class Is extends ws{constructor(){super(...arguments),this.type="html",this.renderInstance=Es}readValueFromInstance(t,e){if(Mt.has(e)){const t=$e(e);return t&&t.default||0}{const s=(n=t,window.getComputedStyle(n)),i=(ln(e)?s.getPropertyValue(e):s[e])||0;return"string"==typeof i?i.trim():i}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return function(t,e){return function({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}(t.getBoundingClientRect(),e))}(t,e)}build(t,e,n){Ss(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return Os(t,e,n)}}class Ls extends ys{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,e){if(function(t,e){return t in e}(e,t)){const n=t[e];if("string"==typeof n||"number"==typeof n)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(t,e){delete e.output[t]}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}build(t,e){Object.assign(t.output,e)}renderInstance(t,{output:e}){Object.assign(t,e)}sortInstanceNodePosition(){return 0}}function Rs(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=function(t){return t instanceof SVGElement&&"svg"!==t.tagName}(t)?new Bs(e):new Is(e);n.mount(t),At.set(t,n)}function Ds(t){const e=new Ls({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});e.mount(t),At.set(t,e)}function Ws(t,e,n,s){const i=[];if(function(t,e){return ut(t)||"number"==typeof t||"string"==typeof t&&!ct(e)}(t,e))i.push(function(t,e,n){const s=ut(t)?t:jt(t);return s.start(rs("",s,e,n)),s.animation}(t,ct(e)&&e.default||e,n&&n.default||n));else{const r=ht(t,e,s),o=r.length;for(let t=0;t<o;t++){const s=r[t],a=s instanceof Element?Rs:Ds;At.has(s)||a(s);const l=At.get(s),u={...n};"delay"in u&&"function"==typeof u.delay&&(u.delay=u.delay(t,o)),i.push(...as(l,{...e,transition:u},{}))}}return i}function Ns(t,e,n){const s=[];return function(t,{defaultTransition:e={},...n}={},s,o){const a=e.duration||.3,l=new Map,u=new Map,c={},p=new Map;let f=0,m=0,g=0;for(let n=0;n<t.length;n++){const i=t[n];if("string"==typeof i){p.set(i,m);continue}if(!Array.isArray(i)){p.set(i.name,pt(m,i.at,f,p));continue}let[l,v,y={}]=i;void 0!==y.at&&(m=pt(m,y.at,f,p));let w=0;const b=(t,n,s,i=0,l=0)=>{const u=bt(t),{delay:c=0,times:p=lt(u),type:f="keyframes",repeat:v,repeatType:y,repeatDelay:b=0,...T}=n;let{ease:x=e.ease||"easeOut",duration:S}=n;const A="function"==typeof c?c(i,l):c,V=u.length,M=d(f)?f:null==o?void 0:o[f];if(V<=2&&M){let t=100;if(2===V&&St(u)){const e=u[1]-u[0];t=Math.abs(e)}const e={...T};void 0!==S&&(e.duration=r(S));const n=h(e,t,M);x=n.ease,S=n.duration}null!=S||(S=a);const P=m+A;1===p.length&&0===p[0]&&(p[1]=1);const k=p.length-u.length;if(k>0&&at(p,k),1===u.length&&u.unshift(null),v){S=dt(S,v);const t=[...u],e=[...p];x=Array.isArray(x)?[...x]:[x];const n=[...x];for(let s=0;s<v;s++){u.push(...t);for(let i=0;i<t.length;i++)p.push(e[i]+(s+1)),x.push(0===i?"linear":rt(n,i-1))}gt(p,v)}const E=P+S;mt(s,u,x,p,P,E),w=Math.max(A+S,w),g=Math.max(E,g)};if(ut(l)){b(v,y,wt("default",yt(l,u)))}else{const t=ht(l,v,s,c),e=t.length;for(let n=0;n<e;n++){v=v,y=y;const s=yt(t[n],u);for(const t in v)b(v[t],Tt(y,t),wt(t,s),n,e)}}f=m,m+=w}return u.forEach((t,s)=>{for(const r in t){const o=t[r];o.sort(vt);const a=[],u=[],c=[];for(let t=0;t<o.length;t++){const{at:e,value:n,easing:s}=o[t];a.push(n),u.push(i(0,g,e)),c.push(s||"easeOut")}0!==u[0]&&(u.unshift(0),a.unshift(a[0]),c.unshift("easeInOut")),1!==u[u.length-1]&&(u.push(1),a.push(null)),l.has(s)||l.set(s,{keyframes:{},transition:{}});const h=l.get(s);h.keyframes[r]=a,h.transition[r]={...e,duration:g,ease:c,times:u,...n}}}),l}(t,e,n,{spring:nt}).forEach(({keyframes:t,transition:e},n)=>{s.push(...Ws(n,t,e))}),s}function Ks(t){return function(e,n,s){let i=[];var r;r=e,i=Array.isArray(r)&&r.some(Array.isArray)?Ns(e,n,t):Ws(e,n,s,t);const o=new l(i);return t&&t.animations.push(o),o}}const js=Ks();function zs(t,e,n){t.style.setProperty(e,n)}function Us(t,e,n){t.style[e]=n}const $s=s(()=>{try{document.createElement("div").animate({opacity:[1]})}catch(t){return!1}return!0}),Hs=new WeakMap;function Ys(t){const e=Hs.get(t)||new Map;return Hs.set(t,e),Hs.get(t)}class Xs extends class{constructor(t){this.animation=t}get duration(){var t,e,n;const s=(null===(e=null===(t=this.animation)||void 0===t?void 0:t.effect)||void 0===e?void 0:e.getComputedTiming().duration)||(null===(n=this.options)||void 0===n?void 0:n.duration)||300;return o(Number(s))}get time(){var t;return this.animation?o((null===(t=this.animation)||void 0===t?void 0:t.currentTime)||0):0}set time(t){this.animation&&(this.animation.currentTime=r(t))}get speed(){return this.animation?this.animation.playbackRate:1}set speed(t){this.animation&&(this.animation.playbackRate=t)}get state(){return this.animation?this.animation.playState:"finished"}get startTime(){return this.animation?this.animation.startTime:null}get finished(){return this.animation?this.animation.finished:Promise.resolve()}play(){this.animation&&this.animation.play()}pause(){this.animation&&this.animation.pause()}stop(){this.animation&&"idle"!==this.state&&"finished"!==this.state&&(this.animation.commitStyles&&this.animation.commitStyles(),this.cancel())}flatten(){var t,e;this.animation&&(null===(t=this.options)||void 0===t?void 0:t.allowFlatten)&&(null===(e=this.animation.effect)||void 0===e||e.updateTiming({easing:"linear"}))}attachTimeline(t){return this.animation&&p(this.animation,t),e}complete(){this.animation&&this.animation.finish()}cancel(){try{this.animation&&this.animation.cancel()}catch(t){}}}{constructor(t,e,s,i){const o=e.startsWith("--");n("string"!=typeof i.type);const a=Ys(t).get(e);a&&a.stop();if(Array.isArray(s)||(s=[s]),function(t,e,n){for(let s=0;s<e.length;s++)null===e[s]&&(e[s]=0===s?n():e[s-1]),"number"==typeof e[s]&&Ne[t]&&(e[s]=Ne[t].transform(e[s]));!$s()&&e.length<2&&e.unshift(n())}(e,s,()=>e.startsWith("--")?t.style.getPropertyValue(e):window.getComputedStyle(t)[e]),d(i.type)){const t=h(i,100,i.type);i.ease=v()?t.ease:"easeOut",i.duration=r(t.duration),i.type="keyframes"}else i.ease=i.ease||"easeOut";const l=()=>{this.setValue(t,e,Tn(s,i)),this.cancel(),this.resolveFinishedPromise()},u=()=>{this.setValue=o?zs:Us,this.options=i,this.updateFinishedPromise(),this.removeAnimation=()=>{const n=Hs.get(t);n&&n.delete(e)}};Jn()?(super(_n(t,e,s,i)),u(),!1===i.autoplay&&this.animation.pause(),this.animation.onfinish=l,Ys(t).set(e,this)):(super(),u(),l())}then(t,e){return this.currentFinishedPromise.then(t,e)}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}play(){"finished"===this.state&&this.updateFinishedPromise(),super.play()}cancel(){this.removeAnimation(),super.cancel()}}const qs=(t=>function(e,n,s){return new l(function(t,e,n,s){const i=V(t,s),o=i.length,a=[];for(let t=0;t<o;t++){const s=i[t],l={...n};"function"==typeof l.delay&&(l.delay=l.delay(t,o));for(const t in e){const n=e[t],i={...u(l,t)};i.duration=i.duration?r(i.duration):i.duration,i.delay=r(i.delay||0),i.allowFlatten=!l.type&&!l.ease,a.push(new Xs(s,t,n,i))}}return a}(e,n,s,t))})();function Gs(t,e){let n;const s=()=>{const{currentTime:s}=e,i=(null===s?0:s.value)/100;n!==i&&t(i),n=i};return Ot.update(s,!0),()=>Bt(s)}const Zs=new WeakMap;let _s;function Js({target:t,contentRect:e,borderBoxSize:n}){var s;null===(s=Zs.get(t))||void 0===s||s.forEach(s=>{s({target:t,contentSize:e,get size(){return function(t,e){if(e){const{inlineSize:t,blockSize:n}=e[0];return{width:t,height:n}}return t instanceof SVGElement&&"getBBox"in t?t.getBBox():{width:t.offsetWidth,height:t.offsetHeight}}(t,n)}})})}function Qs(t){t.forEach(Js)}function ti(t,e){_s||"undefined"!=typeof ResizeObserver&&(_s=new ResizeObserver(Qs));const n=V(t);return n.forEach(t=>{let n=Zs.get(t);n||(n=new Set,Zs.set(t,n)),n.add(e),null==_s||_s.observe(t)}),()=>{n.forEach(t=>{const n=Zs.get(t);null==n||n.delete(e),(null==n?void 0:n.size)||null==_s||_s.unobserve(t)})}}const ei=new Set;let ni;function si(t){return ei.add(t),ni||(ni=()=>{const t={width:window.innerWidth,height:window.innerHeight},e={target:window,size:t,contentSize:t};ei.forEach(t=>t(e))},window.addEventListener("resize",ni)),()=>{ei.delete(t),!ei.size&&ni&&(ni=void 0)}}const ii={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function ri(t,e,n,s){const r=n[e],{length:o,position:a}=ii[e],l=r.current,u=n.time;r.current=t["scroll"+a],r.scrollLength=t["scroll"+o]-t["client"+o],r.offset.length=0,r.offset[0]=0,r.offset[1]=r.scrollLength,r.progress=i(0,r.scrollLength,r.current);const c=s-u;r.velocity=c>50?0:R(r.current-l,c)}const oi={start:0,center:.5,end:1};function ai(t,e,n=0){let s=0;if(t in oi&&(t=oi[t]),"string"==typeof t){const e=parseFloat(t);t.endsWith("px")?s=e:t.endsWith("%")?t=e/100:t.endsWith("vw")?s=e/100*document.documentElement.clientWidth:t.endsWith("vh")?s=e/100*document.documentElement.clientHeight:t=e}return"number"==typeof t&&(s=e*t),n+s}const li=[0,0];function ui(t,e,n,s){let i=Array.isArray(t)?t:li,r=0,o=0;return"number"==typeof t?i=[t,t]:"string"==typeof t&&(i=(t=t.trim()).includes(" ")?t.split(" "):[t,oi[t]?t:"0"]),r=ai(i[0],n,s),o=ai(i[1],e),r-o}const ci={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},hi={x:0,y:0};function di(t,e,n){const{offset:s=ci.All}=n,{target:i=t,axis:r="y"}=n,o="y"===r?"height":"width",a=i!==t?function(t,e){const n={x:0,y:0};let s=t;for(;s&&s!==e;)if(s instanceof HTMLElement)n.x+=s.offsetLeft,n.y+=s.offsetTop,s=s.offsetParent;else if("svg"===s.tagName){const t=s.getBoundingClientRect();s=s.parentElement;const e=s.getBoundingClientRect();n.x+=t.left-e.left,n.y+=t.top-e.top}else{if(!(s instanceof SVGGraphicsElement))break;{const{x:t,y:e}=s.getBBox();n.x+=t,n.y+=e;let i=null,r=s.parentNode;for(;!i;)"svg"===r.tagName&&(i=r),r=s.parentNode;s=i}}return n}(i,t):hi,l=i===t?{width:t.scrollWidth,height:t.scrollHeight}:function(t){return"getBBox"in t&&"svg"!==t.tagName?t.getBBox():{width:t.clientWidth,height:t.clientHeight}}(i),u={width:t.clientWidth,height:t.clientHeight};e[r].offset.length=0;let c=!e[r].interpolate;const h=s.length;for(let t=0;t<h;t++){const n=ui(s[t],u[o],l[o],a[r]);c||n===e[r].interpolatorOffsets[t]||(c=!0),e[r].offset[t]=n}c&&(e[r].interpolate=$n(e[r].offset,lt(s),{clamp:!1}),e[r].interpolatorOffsets=[...e[r].offset]),e[r].progress=L(0,1,e[r].interpolate(e[r].current))}function pi(t,e,n,s={}){return{measure:()=>function(t,e=t,n){if(n.x.targetOffset=0,n.y.targetOffset=0,e!==t){let s=e;for(;s&&s!==t;)n.x.targetOffset+=s.offsetLeft,n.y.targetOffset+=s.offsetTop,s=s.offsetParent}n.x.targetLength=e===t?e.scrollWidth:e.clientWidth,n.y.targetLength=e===t?e.scrollHeight:e.clientHeight,n.x.containerLength=t.clientWidth,n.y.containerLength=t.clientHeight}(t,s.target,n),update:e=>{!function(t,e,n){ri(t,"x",e,n),ri(t,"y",e,n),e.time=n}(t,n,e),(s.offset||s.target)&&di(t,n,s)},notify:()=>e(n)}}const fi=new WeakMap,mi=new WeakMap,gi=new WeakMap,vi=t=>t===document.documentElement?window:t;function yi(t,{container:e=document.documentElement,...n}={}){let s=gi.get(e);s||(s=new Set,gi.set(e,s));const i=pi(e,t,{time:0,x:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0},y:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}},n);if(s.add(i),!fi.has(e)){const t=()=>{for(const t of s)t.measure()},n=()=>{for(const t of s)t.update(It.timestamp)},i=()=>{for(const t of s)t.notify()},a=()=>{Ot.read(t,!1,!0),Ot.read(n,!1,!0),Ot.update(i,!1,!0)};fi.set(e,a);const l=vi(e);window.addEventListener("resize",a,{passive:!0}),e!==document.documentElement&&mi.set(e,(o=a,"function"==typeof(r=e)?si(r):ti(r,o))),l.addEventListener("scroll",a,{passive:!0})}var r,o;const a=fi.get(e);return Ot.read(a,!1,!0),()=>{var t;Bt(a);const n=gi.get(e);if(!n)return;if(n.delete(i),n.size)return;const s=fi.get(e);fi.delete(e),s&&(vi(e).removeEventListener("scroll",s),null===(t=mi.get(e))||void 0===t||t(),window.removeEventListener("resize",s))}}const wi=new Map;function bi({source:t,container:e=document.documentElement,axis:n="y"}={}){t&&(e=t),wi.has(e)||wi.set(e,{});const s=wi.get(e);return s[n]||(s[n]=a()?new ScrollTimeline({source:e,axis:n}):function({source:t,container:e,axis:n="y"}){t&&(e=t);const s={value:0},i=yi(t=>{s.value=100*t[n].progress},{container:e,axis:n});return{currentTime:s,cancel:i}}({source:e,axis:n})),s[n]}function Ti(t){return t&&(t.target||t.offset)}const xi={some:0,all:1};const Si=(t,e)=>Math.abs(t-e);const Ai=Ot,Vi=Ft.reduce((t,e)=>(t[e]=t=>Bt(t),t),{});t.MotionValue=Kt,t.animate=js,t.animateMini=qs,t.anticipate=se,t.backIn=ee,t.backInOut=ne,t.backOut=te,t.cancelFrame=Bt,t.cancelSync=Vi,t.circIn=ie,t.circInOut=oe,t.circOut=re,t.clamp=L,t.createScopedAnimate=Ks,t.cubicBezier=_t,t.delay=function(t,e){return function(t,e){const n=Wt.now(),s=({timestamp:i})=>{const r=i-n;r>=e&&(Bt(s),t(r-e))};return Ot.read(s,!0),()=>Bt(s)}(t,r(e))},t.distance=Si,t.distance2D=function(t,e){const n=Si(t.x,e.x),s=Si(t.y,e.y);return Math.sqrt(n**2+s**2)},t.easeIn=Nn,t.easeInOut=jn,t.easeOut=Kn,t.frame=Ot,t.frameData=It,t.frameSteps=Lt,t.hover=function(t,e,n={}){const[s,i,r]=M(t,n),o=t=>{if(!P(t))return;const{target:n}=t,s=e(n,t);if("function"!=typeof s||!n)return;const r=t=>{P(t)&&(s(t),n.removeEventListener("pointerleave",r))};n.addEventListener("pointerleave",r,i)};return s.forEach(t=>{t.addEventListener("pointerenter",o,i)}),r},t.inView=function(t,e,{root:n,margin:s,amount:i="some"}={}){const r=V(t),o=new WeakMap,a=new IntersectionObserver(t=>{t.forEach(t=>{const n=o.get(t.target);if(t.isIntersecting!==Boolean(n))if(t.isIntersecting){const n=e(t.target,t);"function"==typeof n?o.set(t.target,n):a.unobserve(t.target)}else"function"==typeof n&&(n(t),o.delete(t.target))})},{root:n,rootMargin:s,threshold:"number"==typeof i?i:xi[i]});return r.forEach(t=>a.observe(t)),()=>a.disconnect()},t.inertia=Wn,t.interpolate=$n,t.invariant=n,t.isDragActive=A,t.keyframes=Hn,t.mirrorEasing=Jt,t.mix=Dn,t.motionValue=jt,t.noop=e,t.pipe=Fn,t.press=function(t,e,n={}){const[s,i,r]=M(t,n),o=t=>{const n=t.currentTarget;if(!n||!I(t)||C.has(n))return;C.add(n),k(t,"set");const s=e(n,t),r=(t,e)=>{n.removeEventListener("pointerup",o),n.removeEventListener("pointercancel",a),k(t,"release"),I(t)&&C.has(n)&&(C.delete(n),"function"==typeof s&&s(t,{success:e}))},o=t=>{const e=!!t.isTrusted&&(s=t,i=n instanceof Element?n.getBoundingClientRect():{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight},s.clientX<i.left||s.clientX>i.right||s.clientY<i.top||s.clientY>i.bottom);var s,i;r(t,!e&&(!(n instanceof Element)||E(n,t.target)))},a=t=>{r(t,!1)};n.addEventListener("pointerup",o,i),n.addEventListener("pointercancel",a,i),n.addEventListener("lostpointercapture",a,i)};return s.forEach(t=>{let e=!1;var s;(t=n.useGlobalTarget?window:t)instanceof HTMLElement&&(e=!0,s=t,F.has(s.tagName)||-1!==s.tabIndex||null!==t.getAttribute("tabindex")||(t.tabIndex=0)),t.addEventListener("pointerdown",o,i),e&&t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const s=O(()=>{if(C.has(n))return;B(n,"down");const t=O(()=>{B(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>B(n,"cancel"),e)});n.addEventListener("keydown",s,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),e)})(t,i),i)}),r},t.progress=i,t.reverseEasing=Qt,t.scroll=function(t,{axis:n="y",...s}={}){const i={axis:n,...s};return"function"==typeof t?function(t,e){return function(t){return 2===t.length}(t)||Ti(e)?yi(n=>{t(n[e.axis].progress,n)},e):Gs(t,bi(e))}(t,i):function(t,n){if(t.flatten(),Ti(n))return t.pause(),yi(e=>{t.time=t.duration*e[n.axis].progress},n);{const s=bi(n);return t.attachTimeline?t.attachTimeline(s,t=>(t.pause(),Gs(e=>{t.time=t.duration*e},s))):e}}(t,i)},t.scrollInfo=yi,t.spring=nt,t.stagger=function(t=.1,{startDelay:e=0,from:n=0,ease:s}={}){return(i,r)=>{const o="number"==typeof n?n:function(t,e){if("first"===t)return 0;{const n=e-1;return"last"===t?n:n/2}}(n,r),a=Math.abs(o-i);let l=t*a;if(s){const e=r*t;l=Un(s)(l/e)*e}return e+l}},t.steps=function(t,e="end"){return n=>{const s=(n="end"===e?Math.min(n,.999):Math.max(n,.001))*t,i="end"===e?Math.floor(s):Math.ceil(s);return L(0,1,i/t)}},t.sync=Ai,t.time=Wt,t.transform=function(...t){const e=!Array.isArray(t[0]),n=e?0:-1,s=t[0+n],i=t[1+n],r=t[2+n],o=t[3+n],a=$n(i,r,{mixer:(l=r[0],(t=>t&&"object"==typeof t&&t.mix)(l)?l.mix:void 0),...o});var l;return e?a(s):a},t.wrap=st}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "motion",
3
- "version": "12.4.10",
3
+ "version": "12.4.12",
4
4
  "description": "An animation library for JavaScript and React.",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/es/motion/lib/index.mjs",
@@ -76,7 +76,7 @@
76
76
  "postpublish": "git push --tags"
77
77
  },
78
78
  "dependencies": {
79
- "framer-motion": "^12.4.10",
79
+ "framer-motion": "^12.4.12",
80
80
  "tslib": "^2.4.0"
81
81
  },
82
82
  "peerDependencies": {
@@ -95,5 +95,5 @@
95
95
  "optional": true
96
96
  }
97
97
  },
98
- "gitHead": "18b71d1395e692a13545e85f21bffcbf4a38538b"
98
+ "gitHead": "758d29466b5ddcbda356c2269da33a6c7696318e"
99
99
  }