motion 12.8.2 → 12.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.js CHANGED
@@ -1865,7 +1865,6 @@ class JSAnimation extends WithPromise {
1865
1865
  this.holdTime = null;
1866
1866
  }
1867
1867
  finish() {
1868
- this.notifyFinished();
1869
1868
  this.teardown();
1870
1869
  this.state = "finished";
1871
1870
  const { onComplete } = this.options;
@@ -1878,6 +1877,7 @@ class JSAnimation extends WithPromise {
1878
1877
  this.teardown();
1879
1878
  }
1880
1879
  teardown() {
1880
+ this.notifyFinished();
1881
1881
  this.state = "idle";
1882
1882
  this.stopDriver();
1883
1883
  this.startTime = this.holdTime = null;
@@ -2330,7 +2330,7 @@ class NativeAnimation extends WithPromise {
2330
2330
  this.isStopped = false;
2331
2331
  if (!options)
2332
2332
  return;
2333
- const { element, name, keyframes, pseudoElement, allowFlatten = false, finalKeyframe, } = options;
2333
+ const { element, name, keyframes, pseudoElement, allowFlatten = false, finalKeyframe, onComplete, } = options;
2334
2334
  this.isPseudoElement = Boolean(pseudoElement);
2335
2335
  this.allowFlatten = allowFlatten;
2336
2336
  this.options = options;
@@ -2356,8 +2356,13 @@ class NativeAnimation extends WithPromise {
2356
2356
  }
2357
2357
  this.animation.cancel();
2358
2358
  }
2359
+ onComplete?.();
2359
2360
  this.notifyFinished();
2360
2361
  };
2362
+ /**
2363
+ * TODO: In a breaking change, we should replace this with `.notifyCancel()`
2364
+ */
2365
+ this.animation.oncancel = () => this.notifyFinished();
2361
2366
  }
2362
2367
  play() {
2363
2368
  if (this.isStopped)
@@ -2682,7 +2687,7 @@ class AsyncMotionValueAnimation extends WithPromise {
2682
2687
  }
2683
2688
  onKeyframesResolved(keyframes, finalKeyframe, options, sync) {
2684
2689
  this.keyframeResolver = undefined;
2685
- const { name, type, velocity, delay, isHandoff, onUpdate, onComplete } = options;
2690
+ const { name, type, velocity, delay, isHandoff, onUpdate } = options;
2686
2691
  this.resolvedAt = time.now();
2687
2692
  /**
2688
2693
  * If we can't animate this value with the resolved keyframes
@@ -2732,12 +2737,7 @@ class AsyncMotionValueAnimation extends WithPromise {
2732
2737
  element: resolvedOptions.motionValue.owner.current,
2733
2738
  })
2734
2739
  : new JSAnimation(resolvedOptions);
2735
- animation.finished
2736
- .then(() => {
2737
- onComplete?.();
2738
- this.notifyFinished();
2739
- })
2740
- .catch(noop);
2740
+ animation.finished.then(() => this.notifyFinished()).catch(noop);
2741
2741
  if (this.pendingTimeline) {
2742
2742
  this.stopTimeline = animation.attachTimeline(this.pendingTimeline);
2743
2743
  this.pendingTimeline = undefined;
@@ -3350,6 +3350,54 @@ const acceleratedValues = new Set([
3350
3350
  // "background-color"
3351
3351
  ]);
3352
3352
 
3353
+ function resolveElements(elementOrSelector, scope, selectorCache) {
3354
+ if (elementOrSelector instanceof EventTarget) {
3355
+ return [elementOrSelector];
3356
+ }
3357
+ else if (typeof elementOrSelector === "string") {
3358
+ let root = document;
3359
+ if (scope) {
3360
+ root = scope.current;
3361
+ }
3362
+ const elements = selectorCache?.[elementOrSelector] ??
3363
+ root.querySelectorAll(elementOrSelector);
3364
+ return elements ? Array.from(elements) : [];
3365
+ }
3366
+ return Array.from(elementOrSelector);
3367
+ }
3368
+
3369
+ function styleEffect(subject, values) {
3370
+ const elements = resolveElements(subject);
3371
+ const subscriptions = [];
3372
+ for (let i = 0; i < elements.length; i++) {
3373
+ const element = elements[i];
3374
+ for (const key in values) {
3375
+ const value = values[key];
3376
+ /**
3377
+ * TODO: Get specific setters for combined props (like x)
3378
+ * or values with default types (like color)
3379
+ *
3380
+ * TODO: CSS variable support
3381
+ */
3382
+ const updateStyle = () => {
3383
+ element.style[key] = value.get();
3384
+ };
3385
+ const scheduleUpdate = () => frame.render(updateStyle);
3386
+ const cancel = value.on("change", scheduleUpdate);
3387
+ scheduleUpdate();
3388
+ subscriptions.push(() => {
3389
+ cancel();
3390
+ cancelFrame(updateStyle);
3391
+ });
3392
+ }
3393
+ }
3394
+ return () => {
3395
+ for (const cancel of subscriptions) {
3396
+ cancel();
3397
+ }
3398
+ };
3399
+ }
3400
+
3353
3401
  const { schedule: microtask, cancel: cancelMicrotask } =
3354
3402
  /* @__PURE__ */ createRenderBatcher(queueMicrotask, false);
3355
3403
 
@@ -3386,22 +3434,6 @@ function setDragLock(axis) {
3386
3434
  }
3387
3435
  }
3388
3436
 
3389
- function resolveElements(elementOrSelector, scope, selectorCache) {
3390
- if (elementOrSelector instanceof EventTarget) {
3391
- return [elementOrSelector];
3392
- }
3393
- else if (typeof elementOrSelector === "string") {
3394
- let root = document;
3395
- if (scope) {
3396
- root = scope.current;
3397
- }
3398
- const elements = selectorCache?.[elementOrSelector] ??
3399
- root.querySelectorAll(elementOrSelector);
3400
- return elements ? Array.from(elements) : [];
3401
- }
3402
- return Array.from(elementOrSelector);
3403
- }
3404
-
3405
3437
  function setupGesture(elementOrSelector, options) {
3406
3438
  const elements = resolveElements(elementOrSelector);
3407
3439
  const gestureAbortController = new AbortController();
@@ -3776,7 +3808,7 @@ class MotionValue {
3776
3808
  * This will be replaced by the build step with the latest version number.
3777
3809
  * When MotionValues are provided to motion components, warn if versions are mixed.
3778
3810
  */
3779
- this.version = "12.8.1";
3811
+ this.version = "12.9.0";
3780
3812
  /**
3781
3813
  * Tracks whether this value can output a velocity. Currently this is only true
3782
3814
  * if the value is numerical, but we might be able to widen the scope here and support
@@ -3802,12 +3834,12 @@ class MotionValue {
3802
3834
  this.prev = this.current;
3803
3835
  this.setCurrent(v);
3804
3836
  // Update update subscribers
3805
- if (this.current !== this.prev && this.events.change) {
3806
- this.events.change.notify(this.current);
3837
+ if (this.current !== this.prev) {
3838
+ this.events.change?.notify(this.current);
3807
3839
  }
3808
3840
  // Update render subscribers
3809
- if (render && this.events.renderRequest) {
3810
- this.events.renderRequest.notify(this.current);
3841
+ if (render) {
3842
+ this.events.renderRequest?.notify(this.current);
3811
3843
  }
3812
3844
  };
3813
3845
  this.hasAnimated = false;
@@ -5098,6 +5130,17 @@ function animateTarget(visualElement, targetAndTransition, { delay = 0, transiti
5098
5130
  delay,
5099
5131
  ...getValueTransition$1(transition || {}, key),
5100
5132
  };
5133
+ /**
5134
+ * If the value is already at the defined target, skip the animation.
5135
+ */
5136
+ const currentValue = value.get();
5137
+ if (currentValue !== undefined &&
5138
+ !value.isAnimating &&
5139
+ !Array.isArray(valueTarget) &&
5140
+ valueTarget === currentValue &&
5141
+ !valueTransition.velocity) {
5142
+ continue;
5143
+ }
5101
5144
  /**
5102
5145
  * If this is the first time a value is being animated, check
5103
5146
  * to see if we're handling off from an existing animation.
@@ -5237,7 +5280,7 @@ function updateMotionValuesFromProps(element, next, prev) {
5237
5280
  * and warn against mismatches.
5238
5281
  */
5239
5282
  if (process.env.NODE_ENV === "development") {
5240
- warnOnce(nextValue.version === "12.8.2", `Attempting to mix Motion versions ${nextValue.version} with 12.8.2 may not work as expected.`);
5283
+ warnOnce(nextValue.version === "12.9.0", `Attempting to mix Motion versions ${nextValue.version} with 12.9.0 may not work as expected.`);
5241
5284
  }
5242
5285
  }
5243
5286
  else if (isMotionValue(prevValue)) {
@@ -7173,6 +7216,7 @@ exports.stagger = stagger;
7173
7216
  exports.startWaapiAnimation = startWaapiAnimation;
7174
7217
  exports.statsBuffer = statsBuffer;
7175
7218
  exports.steps = steps;
7219
+ exports.styleEffect = styleEffect;
7176
7220
  exports.supportedWaapiEasing = supportedWaapiEasing;
7177
7221
  exports.supportsBrowserAnimation = supportsBrowserAnimation;
7178
7222
  exports.supportsFlags = supportsFlags;
package/dist/cjs/mini.js CHANGED
@@ -317,7 +317,7 @@ class NativeAnimation extends WithPromise {
317
317
  this.isStopped = false;
318
318
  if (!options)
319
319
  return;
320
- const { element, name, keyframes, pseudoElement, allowFlatten = false, finalKeyframe, } = options;
320
+ const { element, name, keyframes, pseudoElement, allowFlatten = false, finalKeyframe, onComplete, } = options;
321
321
  this.isPseudoElement = Boolean(pseudoElement);
322
322
  this.allowFlatten = allowFlatten;
323
323
  this.options = options;
@@ -343,8 +343,13 @@ class NativeAnimation extends WithPromise {
343
343
  }
344
344
  this.animation.cancel();
345
345
  }
346
+ onComplete?.();
346
347
  this.notifyFinished();
347
348
  };
349
+ /**
350
+ * TODO: In a breaking change, we should replace this with `.notifyCancel()`
351
+ */
352
+ this.animation.oncancel = () => this.notifyFinished();
348
353
  }
349
354
  play() {
350
355
  if (this.isStopped)
@@ -1873,7 +1873,6 @@ class JSAnimation extends WithPromise {
1873
1873
  this.holdTime = null;
1874
1874
  }
1875
1875
  finish() {
1876
- this.notifyFinished();
1877
1876
  this.teardown();
1878
1877
  this.state = "finished";
1879
1878
  const { onComplete } = this.options;
@@ -1886,6 +1885,7 @@ class JSAnimation extends WithPromise {
1886
1885
  this.teardown();
1887
1886
  }
1888
1887
  teardown() {
1888
+ this.notifyFinished();
1889
1889
  this.state = "idle";
1890
1890
  this.stopDriver();
1891
1891
  this.startTime = this.holdTime = null;
@@ -2325,7 +2325,7 @@ class NativeAnimation extends WithPromise {
2325
2325
  this.isStopped = false;
2326
2326
  if (!options)
2327
2327
  return;
2328
- const { element, name, keyframes, pseudoElement, allowFlatten = false, finalKeyframe, } = options;
2328
+ const { element, name, keyframes, pseudoElement, allowFlatten = false, finalKeyframe, onComplete, } = options;
2329
2329
  this.isPseudoElement = Boolean(pseudoElement);
2330
2330
  this.allowFlatten = allowFlatten;
2331
2331
  this.options = options;
@@ -2351,8 +2351,13 @@ class NativeAnimation extends WithPromise {
2351
2351
  }
2352
2352
  this.animation.cancel();
2353
2353
  }
2354
+ onComplete?.();
2354
2355
  this.notifyFinished();
2355
2356
  };
2357
+ /**
2358
+ * TODO: In a breaking change, we should replace this with `.notifyCancel()`
2359
+ */
2360
+ this.animation.oncancel = () => this.notifyFinished();
2356
2361
  }
2357
2362
  play() {
2358
2363
  if (this.isStopped)
@@ -2677,7 +2682,7 @@ class AsyncMotionValueAnimation extends WithPromise {
2677
2682
  }
2678
2683
  onKeyframesResolved(keyframes, finalKeyframe, options, sync) {
2679
2684
  this.keyframeResolver = undefined;
2680
- const { name, type, velocity, delay, isHandoff, onUpdate, onComplete } = options;
2685
+ const { name, type, velocity, delay, isHandoff, onUpdate } = options;
2681
2686
  this.resolvedAt = time.now();
2682
2687
  /**
2683
2688
  * If we can't animate this value with the resolved keyframes
@@ -2727,12 +2732,7 @@ class AsyncMotionValueAnimation extends WithPromise {
2727
2732
  element: resolvedOptions.motionValue.owner.current,
2728
2733
  })
2729
2734
  : new JSAnimation(resolvedOptions);
2730
- animation.finished
2731
- .then(() => {
2732
- onComplete?.();
2733
- this.notifyFinished();
2734
- })
2735
- .catch(noop);
2735
+ animation.finished.then(() => this.notifyFinished()).catch(noop);
2736
2736
  if (this.pendingTimeline) {
2737
2737
  this.stopTimeline = animation.attachTimeline(this.pendingTimeline);
2738
2738
  this.pendingTimeline = undefined;
@@ -3171,6 +3171,22 @@ class DOMKeyframesResolver extends KeyframeResolver {
3171
3171
  }
3172
3172
  }
3173
3173
 
3174
+ function resolveElements(elementOrSelector, scope, selectorCache) {
3175
+ if (elementOrSelector instanceof EventTarget) {
3176
+ return [elementOrSelector];
3177
+ }
3178
+ else if (typeof elementOrSelector === "string") {
3179
+ let root = document;
3180
+ if (scope) {
3181
+ root = scope.current;
3182
+ }
3183
+ const elements = selectorCache?.[elementOrSelector] ??
3184
+ root.querySelectorAll(elementOrSelector);
3185
+ return elements ? Array.from(elements) : [];
3186
+ }
3187
+ return Array.from(elementOrSelector);
3188
+ }
3189
+
3174
3190
  const { schedule: microtask, cancel: cancelMicrotask } =
3175
3191
  /* @__PURE__ */ createRenderBatcher(queueMicrotask, false);
3176
3192
 
@@ -3207,22 +3223,6 @@ function setDragLock(axis) {
3207
3223
  }
3208
3224
  }
3209
3225
 
3210
- function resolveElements(elementOrSelector, scope, selectorCache) {
3211
- if (elementOrSelector instanceof EventTarget) {
3212
- return [elementOrSelector];
3213
- }
3214
- else if (typeof elementOrSelector === "string") {
3215
- let root = document;
3216
- if (scope) {
3217
- root = scope.current;
3218
- }
3219
- const elements = selectorCache?.[elementOrSelector] ??
3220
- root.querySelectorAll(elementOrSelector);
3221
- return elements ? Array.from(elements) : [];
3222
- }
3223
- return Array.from(elementOrSelector);
3224
- }
3225
-
3226
3226
  function setupGesture(elementOrSelector, options) {
3227
3227
  const elements = resolveElements(elementOrSelector);
3228
3228
  const gestureAbortController = new AbortController();
@@ -3449,7 +3449,7 @@ class MotionValue {
3449
3449
  * This will be replaced by the build step with the latest version number.
3450
3450
  * When MotionValues are provided to motion components, warn if versions are mixed.
3451
3451
  */
3452
- this.version = "12.8.1";
3452
+ this.version = "12.9.0";
3453
3453
  /**
3454
3454
  * Tracks whether this value can output a velocity. Currently this is only true
3455
3455
  * if the value is numerical, but we might be able to widen the scope here and support
@@ -3475,12 +3475,12 @@ class MotionValue {
3475
3475
  this.prev = this.current;
3476
3476
  this.setCurrent(v);
3477
3477
  // Update update subscribers
3478
- if (this.current !== this.prev && this.events.change) {
3479
- this.events.change.notify(this.current);
3478
+ if (this.current !== this.prev) {
3479
+ this.events.change?.notify(this.current);
3480
3480
  }
3481
3481
  // Update render subscribers
3482
- if (render && this.events.renderRequest) {
3483
- this.events.renderRequest.notify(this.current);
3482
+ if (render) {
3483
+ this.events.renderRequest?.notify(this.current);
3484
3484
  }
3485
3485
  };
3486
3486
  this.hasAnimated = false;
@@ -3984,6 +3984,17 @@ function animateTarget(visualElement, targetAndTransition, { delay = 0, transiti
3984
3984
  delay,
3985
3985
  ...getValueTransition(transition || {}, key),
3986
3986
  };
3987
+ /**
3988
+ * If the value is already at the defined target, skip the animation.
3989
+ */
3990
+ const currentValue = value.get();
3991
+ if (currentValue !== undefined &&
3992
+ !value.isAnimating &&
3993
+ !Array.isArray(valueTarget) &&
3994
+ valueTarget === currentValue &&
3995
+ !valueTransition.velocity) {
3996
+ continue;
3997
+ }
3987
3998
  /**
3988
3999
  * If this is the first time a value is being animated, check
3989
4000
  * to see if we're handling off from an existing animation.
@@ -9111,7 +9122,7 @@ function updateMotionValuesFromProps(element, next, prev) {
9111
9122
  * and warn against mismatches.
9112
9123
  */
9113
9124
  if (process.env.NODE_ENV === "development") {
9114
- warnOnce(nextValue.version === "12.8.2", `Attempting to mix Motion versions ${nextValue.version} with 12.8.2 may not work as expected.`);
9125
+ warnOnce(nextValue.version === "12.9.0", `Attempting to mix Motion versions ${nextValue.version} with 12.9.0 may not work as expected.`);
9115
9126
  }
9116
9127
  }
9117
9128
  else if (isMotionValue(prevValue)) {
@@ -231,7 +231,7 @@ class NativeAnimation extends WithPromise {
231
231
  this.isStopped = false;
232
232
  if (!options)
233
233
  return;
234
- const { element, name, keyframes, pseudoElement, allowFlatten = false, finalKeyframe, } = options;
234
+ const { element, name, keyframes, pseudoElement, allowFlatten = false, finalKeyframe, onComplete, } = options;
235
235
  this.isPseudoElement = Boolean(pseudoElement);
236
236
  this.allowFlatten = allowFlatten;
237
237
  this.options = options;
@@ -257,8 +257,13 @@ class NativeAnimation extends WithPromise {
257
257
  }
258
258
  this.animation.cancel();
259
259
  }
260
+ onComplete?.();
260
261
  this.notifyFinished();
261
262
  };
263
+ /**
264
+ * TODO: In a breaking change, we should replace this with `.notifyCancel()`
265
+ */
266
+ this.animation.oncancel = () => this.notifyFinished();
262
267
  }
263
268
  play() {
264
269
  if (this.isStopped)
@@ -37,6 +37,17 @@ function animateTarget(visualElement, targetAndTransition, { delay = 0, transiti
37
37
  delay,
38
38
  ...getValueTransition(transition || {}, key),
39
39
  };
40
+ /**
41
+ * If the value is already at the defined target, skip the animation.
42
+ */
43
+ const currentValue = value.get();
44
+ if (currentValue !== undefined &&
45
+ !value.isAnimating &&
46
+ !Array.isArray(valueTarget) &&
47
+ valueTarget === currentValue &&
48
+ !valueTransition.velocity) {
49
+ continue;
50
+ }
40
51
  /**
41
52
  * If this is the first time a value is being animated, check
42
53
  * to see if we're handling off from an existing animation.
@@ -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.8.2", `Attempting to mix Motion versions ${nextValue.version} with 12.8.2 may not work as expected.`);
20
+ warnOnce(nextValue.version === "12.9.0", `Attempting to mix Motion versions ${nextValue.version} with 12.9.0 may not work as expected.`);
21
21
  }
22
22
  }
23
23
  else if (isMotionValue(prevValue)) {
@@ -39,6 +39,7 @@ export { supportsPartialKeyframes } from '../../motion-dom/dist/es/animation/waa
39
39
  export { supportsBrowserAnimation } from '../../motion-dom/dist/es/animation/waapi/supports/waapi.mjs';
40
40
  export { acceleratedValues } from '../../motion-dom/dist/es/animation/waapi/utils/accelerated-values.mjs';
41
41
  export { generateLinearEasing } from '../../motion-dom/dist/es/animation/waapi/utils/linear.mjs';
42
+ export { styleEffect } from '../../motion-dom/dist/es/effects/style-effect.mjs';
42
43
  export { createRenderBatcher } from '../../motion-dom/dist/es/frameloop/batcher.mjs';
43
44
  export { cancelMicrotask, microtask } from '../../motion-dom/dist/es/frameloop/microtask.mjs';
44
45
  export { time } from '../../motion-dom/dist/es/frameloop/sync-time.mjs';
@@ -138,6 +138,7 @@ export { supportsPartialKeyframes } from '../../motion-dom/dist/es/animation/waa
138
138
  export { supportsBrowserAnimation } from '../../motion-dom/dist/es/animation/waapi/supports/waapi.mjs';
139
139
  export { acceleratedValues } from '../../motion-dom/dist/es/animation/waapi/utils/accelerated-values.mjs';
140
140
  export { generateLinearEasing } from '../../motion-dom/dist/es/animation/waapi/utils/linear.mjs';
141
+ export { styleEffect } from '../../motion-dom/dist/es/effects/style-effect.mjs';
141
142
  export { createRenderBatcher } from '../../motion-dom/dist/es/frameloop/batcher.mjs';
142
143
  export { cancelMicrotask, microtask } from '../../motion-dom/dist/es/frameloop/microtask.mjs';
143
144
  export { time } from '../../motion-dom/dist/es/frameloop/sync-time.mjs';
@@ -52,7 +52,7 @@ class AsyncMotionValueAnimation extends WithPromise {
52
52
  }
53
53
  onKeyframesResolved(keyframes, finalKeyframe, options, sync) {
54
54
  this.keyframeResolver = undefined;
55
- const { name, type, velocity, delay, isHandoff, onUpdate, onComplete } = options;
55
+ const { name, type, velocity, delay, isHandoff, onUpdate } = options;
56
56
  this.resolvedAt = time.now();
57
57
  /**
58
58
  * If we can't animate this value with the resolved keyframes
@@ -102,12 +102,7 @@ class AsyncMotionValueAnimation extends WithPromise {
102
102
  element: resolvedOptions.motionValue.owner.current,
103
103
  })
104
104
  : new JSAnimation(resolvedOptions);
105
- animation.finished
106
- .then(() => {
107
- onComplete?.();
108
- this.notifyFinished();
109
- })
110
- .catch(noop);
105
+ animation.finished.then(() => this.notifyFinished()).catch(noop);
111
106
  if (this.pendingTimeline) {
112
107
  this.stopTimeline = animation.attachTimeline(this.pendingTimeline);
113
108
  this.pendingTimeline = undefined;
@@ -302,7 +302,6 @@ class JSAnimation extends WithPromise {
302
302
  this.holdTime = null;
303
303
  }
304
304
  finish() {
305
- this.notifyFinished();
306
305
  this.teardown();
307
306
  this.state = "finished";
308
307
  const { onComplete } = this.options;
@@ -315,6 +314,7 @@ class JSAnimation extends WithPromise {
315
314
  this.teardown();
316
315
  }
317
316
  teardown() {
317
+ this.notifyFinished();
318
318
  this.state = "idle";
319
319
  this.stopDriver();
320
320
  this.startTime = this.holdTime = null;
@@ -18,7 +18,7 @@ class NativeAnimation extends WithPromise {
18
18
  this.isStopped = false;
19
19
  if (!options)
20
20
  return;
21
- const { element, name, keyframes, pseudoElement, allowFlatten = false, finalKeyframe, } = options;
21
+ const { element, name, keyframes, pseudoElement, allowFlatten = false, finalKeyframe, onComplete, } = options;
22
22
  this.isPseudoElement = Boolean(pseudoElement);
23
23
  this.allowFlatten = allowFlatten;
24
24
  this.options = options;
@@ -44,8 +44,13 @@ class NativeAnimation extends WithPromise {
44
44
  }
45
45
  this.animation.cancel();
46
46
  }
47
+ onComplete?.();
47
48
  this.notifyFinished();
48
49
  };
50
+ /**
51
+ * TODO: In a breaking change, we should replace this with `.notifyCancel()`
52
+ */
53
+ this.animation.oncancel = () => this.notifyFinished();
49
54
  }
50
55
  play() {
51
56
  if (this.isStopped)
@@ -0,0 +1,36 @@
1
+ import { resolveElements } from '../utils/resolve-elements.mjs';
2
+ import { frame, cancelFrame } from '../frameloop/frame.mjs';
3
+
4
+ function styleEffect(subject, values) {
5
+ const elements = resolveElements(subject);
6
+ const subscriptions = [];
7
+ for (let i = 0; i < elements.length; i++) {
8
+ const element = elements[i];
9
+ for (const key in values) {
10
+ const value = values[key];
11
+ /**
12
+ * TODO: Get specific setters for combined props (like x)
13
+ * or values with default types (like color)
14
+ *
15
+ * TODO: CSS variable support
16
+ */
17
+ const updateStyle = () => {
18
+ element.style[key] = value.get();
19
+ };
20
+ const scheduleUpdate = () => frame.render(updateStyle);
21
+ const cancel = value.on("change", scheduleUpdate);
22
+ scheduleUpdate();
23
+ subscriptions.push(() => {
24
+ cancel();
25
+ cancelFrame(updateStyle);
26
+ });
27
+ }
28
+ }
29
+ return () => {
30
+ for (const cancel of subscriptions) {
31
+ cancel();
32
+ }
33
+ };
34
+ }
35
+
36
+ export { styleEffect };
@@ -32,7 +32,7 @@ class MotionValue {
32
32
  * This will be replaced by the build step with the latest version number.
33
33
  * When MotionValues are provided to motion components, warn if versions are mixed.
34
34
  */
35
- this.version = "12.8.1";
35
+ this.version = "12.9.0";
36
36
  /**
37
37
  * Tracks whether this value can output a velocity. Currently this is only true
38
38
  * if the value is numerical, but we might be able to widen the scope here and support
@@ -58,12 +58,12 @@ class MotionValue {
58
58
  this.prev = this.current;
59
59
  this.setCurrent(v);
60
60
  // Update update subscribers
61
- if (this.current !== this.prev && this.events.change) {
62
- this.events.change.notify(this.current);
61
+ if (this.current !== this.prev) {
62
+ this.events.change?.notify(this.current);
63
63
  }
64
64
  // Update render subscribers
65
- if (render && this.events.renderRequest) {
66
- this.events.renderRequest.notify(this.current);
65
+ if (render) {
66
+ this.events.renderRequest?.notify(this.current);
67
67
  }
68
68
  };
69
69
  this.hasAnimated = false;
@@ -1866,7 +1866,6 @@
1866
1866
  this.holdTime = null;
1867
1867
  }
1868
1868
  finish() {
1869
- this.notifyFinished();
1870
1869
  this.teardown();
1871
1870
  this.state = "finished";
1872
1871
  const { onComplete } = this.options;
@@ -1879,6 +1878,7 @@
1879
1878
  this.teardown();
1880
1879
  }
1881
1880
  teardown() {
1881
+ this.notifyFinished();
1882
1882
  this.state = "idle";
1883
1883
  this.stopDriver();
1884
1884
  this.startTime = this.holdTime = null;
@@ -2331,7 +2331,7 @@
2331
2331
  this.isStopped = false;
2332
2332
  if (!options)
2333
2333
  return;
2334
- const { element, name, keyframes, pseudoElement, allowFlatten = false, finalKeyframe, } = options;
2334
+ const { element, name, keyframes, pseudoElement, allowFlatten = false, finalKeyframe, onComplete, } = options;
2335
2335
  this.isPseudoElement = Boolean(pseudoElement);
2336
2336
  this.allowFlatten = allowFlatten;
2337
2337
  this.options = options;
@@ -2357,8 +2357,13 @@
2357
2357
  }
2358
2358
  this.animation.cancel();
2359
2359
  }
2360
+ onComplete?.();
2360
2361
  this.notifyFinished();
2361
2362
  };
2363
+ /**
2364
+ * TODO: In a breaking change, we should replace this with `.notifyCancel()`
2365
+ */
2366
+ this.animation.oncancel = () => this.notifyFinished();
2362
2367
  }
2363
2368
  play() {
2364
2369
  if (this.isStopped)
@@ -2683,7 +2688,7 @@
2683
2688
  }
2684
2689
  onKeyframesResolved(keyframes, finalKeyframe, options, sync) {
2685
2690
  this.keyframeResolver = undefined;
2686
- const { name, type, velocity, delay, isHandoff, onUpdate, onComplete } = options;
2691
+ const { name, type, velocity, delay, isHandoff, onUpdate } = options;
2687
2692
  this.resolvedAt = time.now();
2688
2693
  /**
2689
2694
  * If we can't animate this value with the resolved keyframes
@@ -2733,12 +2738,7 @@
2733
2738
  element: resolvedOptions.motionValue.owner.current,
2734
2739
  })
2735
2740
  : new JSAnimation(resolvedOptions);
2736
- animation.finished
2737
- .then(() => {
2738
- onComplete?.();
2739
- this.notifyFinished();
2740
- })
2741
- .catch(noop);
2741
+ animation.finished.then(() => this.notifyFinished()).catch(noop);
2742
2742
  if (this.pendingTimeline) {
2743
2743
  this.stopTimeline = animation.attachTimeline(this.pendingTimeline);
2744
2744
  this.pendingTimeline = undefined;
@@ -3351,6 +3351,54 @@
3351
3351
  // "background-color"
3352
3352
  ]);
3353
3353
 
3354
+ function resolveElements(elementOrSelector, scope, selectorCache) {
3355
+ if (elementOrSelector instanceof EventTarget) {
3356
+ return [elementOrSelector];
3357
+ }
3358
+ else if (typeof elementOrSelector === "string") {
3359
+ let root = document;
3360
+ if (scope) {
3361
+ root = scope.current;
3362
+ }
3363
+ const elements = selectorCache?.[elementOrSelector] ??
3364
+ root.querySelectorAll(elementOrSelector);
3365
+ return elements ? Array.from(elements) : [];
3366
+ }
3367
+ return Array.from(elementOrSelector);
3368
+ }
3369
+
3370
+ function styleEffect(subject, values) {
3371
+ const elements = resolveElements(subject);
3372
+ const subscriptions = [];
3373
+ for (let i = 0; i < elements.length; i++) {
3374
+ const element = elements[i];
3375
+ for (const key in values) {
3376
+ const value = values[key];
3377
+ /**
3378
+ * TODO: Get specific setters for combined props (like x)
3379
+ * or values with default types (like color)
3380
+ *
3381
+ * TODO: CSS variable support
3382
+ */
3383
+ const updateStyle = () => {
3384
+ element.style[key] = value.get();
3385
+ };
3386
+ const scheduleUpdate = () => frame.render(updateStyle);
3387
+ const cancel = value.on("change", scheduleUpdate);
3388
+ scheduleUpdate();
3389
+ subscriptions.push(() => {
3390
+ cancel();
3391
+ cancelFrame(updateStyle);
3392
+ });
3393
+ }
3394
+ }
3395
+ return () => {
3396
+ for (const cancel of subscriptions) {
3397
+ cancel();
3398
+ }
3399
+ };
3400
+ }
3401
+
3354
3402
  const { schedule: microtask, cancel: cancelMicrotask } =
3355
3403
  /* @__PURE__ */ createRenderBatcher(queueMicrotask, false);
3356
3404
 
@@ -3387,22 +3435,6 @@
3387
3435
  }
3388
3436
  }
3389
3437
 
3390
- function resolveElements(elementOrSelector, scope, selectorCache) {
3391
- if (elementOrSelector instanceof EventTarget) {
3392
- return [elementOrSelector];
3393
- }
3394
- else if (typeof elementOrSelector === "string") {
3395
- let root = document;
3396
- if (scope) {
3397
- root = scope.current;
3398
- }
3399
- const elements = selectorCache?.[elementOrSelector] ??
3400
- root.querySelectorAll(elementOrSelector);
3401
- return elements ? Array.from(elements) : [];
3402
- }
3403
- return Array.from(elementOrSelector);
3404
- }
3405
-
3406
3438
  function setupGesture(elementOrSelector, options) {
3407
3439
  const elements = resolveElements(elementOrSelector);
3408
3440
  const gestureAbortController = new AbortController();
@@ -3777,7 +3809,7 @@
3777
3809
  * This will be replaced by the build step with the latest version number.
3778
3810
  * When MotionValues are provided to motion components, warn if versions are mixed.
3779
3811
  */
3780
- this.version = "12.8.1";
3812
+ this.version = "12.9.0";
3781
3813
  /**
3782
3814
  * Tracks whether this value can output a velocity. Currently this is only true
3783
3815
  * if the value is numerical, but we might be able to widen the scope here and support
@@ -3803,12 +3835,12 @@
3803
3835
  this.prev = this.current;
3804
3836
  this.setCurrent(v);
3805
3837
  // Update update subscribers
3806
- if (this.current !== this.prev && this.events.change) {
3807
- this.events.change.notify(this.current);
3838
+ if (this.current !== this.prev) {
3839
+ this.events.change?.notify(this.current);
3808
3840
  }
3809
3841
  // Update render subscribers
3810
- if (render && this.events.renderRequest) {
3811
- this.events.renderRequest.notify(this.current);
3842
+ if (render) {
3843
+ this.events.renderRequest?.notify(this.current);
3812
3844
  }
3813
3845
  };
3814
3846
  this.hasAnimated = false;
@@ -5099,6 +5131,17 @@
5099
5131
  delay,
5100
5132
  ...getValueTransition$1(transition || {}, key),
5101
5133
  };
5134
+ /**
5135
+ * If the value is already at the defined target, skip the animation.
5136
+ */
5137
+ const currentValue = value.get();
5138
+ if (currentValue !== undefined &&
5139
+ !value.isAnimating &&
5140
+ !Array.isArray(valueTarget) &&
5141
+ valueTarget === currentValue &&
5142
+ !valueTransition.velocity) {
5143
+ continue;
5144
+ }
5102
5145
  /**
5103
5146
  * If this is the first time a value is being animated, check
5104
5147
  * to see if we're handling off from an existing animation.
@@ -5238,7 +5281,7 @@
5238
5281
  * and warn against mismatches.
5239
5282
  */
5240
5283
  {
5241
- warnOnce(nextValue.version === "12.8.2", `Attempting to mix Motion versions ${nextValue.version} with 12.8.2 may not work as expected.`);
5284
+ warnOnce(nextValue.version === "12.9.0", `Attempting to mix Motion versions ${nextValue.version} with 12.9.0 may not work as expected.`);
5242
5285
  }
5243
5286
  }
5244
5287
  else if (isMotionValue(prevValue)) {
@@ -7174,6 +7217,7 @@
7174
7217
  exports.startWaapiAnimation = startWaapiAnimation;
7175
7218
  exports.statsBuffer = statsBuffer;
7176
7219
  exports.steps = steps;
7220
+ exports.styleEffect = styleEffect;
7177
7221
  exports.supportedWaapiEasing = supportedWaapiEasing;
7178
7222
  exports.supportsBrowserAnimation = supportsBrowserAnimation;
7179
7223
  exports.supportsFlags = supportsFlags;
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";function e(t,e){-1===t.indexOf(e)&&t.push(e)}function n(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const s=(t,e,n)=>n>e?e:n<t?t:n;let i=()=>{};const r={},o=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),a=t=>/^0[^.\s]+$/u.test(t);function l(t){let e;return()=>(void 0===e&&(e=t()),e)}const u=t=>t,c=(t,e)=>n=>e(t(n)),h=(...t)=>t.reduce(c),d=(t,e,n)=>{const s=e-t;return 0===s?1:(n-t)/s};class p{constructor(){this.subscriptions=[]}add(t){return e(this.subscriptions,t),()=>n(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}}const f=t=>1e3*t,m=t=>t/1e3;function g(t,e){return e?t*(1e3/e):0}const y=new Set;const v=(t,e,n)=>{const s=e-t;return((n-t)%s+s)%s+t},w=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function b(t,e,n,s){if(t===e&&n===s)return u;const i=e=>function(t,e,n,s,i){let r,o,a=0;do{o=e+(n-e)/2,r=w(o,s,i)-t,r>0?n=o:e=o}while(Math.abs(r)>1e-7&&++a<12);return o}(e,0,1,t,n);return t=>0===t||1===t?t:w(i(t),e,s)}const T=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,x=t=>e=>1-t(1-e),M=b(.33,1.53,.69,.99),S=x(M),V=T(S),A=t=>(t*=2)<1?.5*S(t):.5*(2-Math.pow(2,-10*(t-1))),E=t=>1-Math.sin(Math.acos(t)),k=x(E),P=T(E),C=b(.42,0,1,1),F=b(0,0,.58,1),O=b(.42,0,.58,1);const R=t=>Array.isArray(t)&&"number"!=typeof t[0];function B(t,e){return R(t)?t[v(0,t.length,e)]:t}const L=t=>Array.isArray(t)&&"number"==typeof t[0],D={linear:u,easeIn:C,easeInOut:O,easeOut:F,circIn:E,circInOut:P,circOut:k,backIn:S,backInOut:V,backOut:M,anticipate:A},I=t=>{if(L(t)){t.length;const[e,n,s,i]=t;return b(e,n,s,i)}return"string"==typeof t?D[t]:t},W=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],N={value:null,addProjectionMetrics:null};function j(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,a=W.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&&N.value&&N.value.frameloop[e].push(l),l=0,n.clear(),i=!1,r&&(r=!1,c.process(t)))}};return c}(o,e?n:void 0),t)),{}),{setup:l,read:u,resolveKeyframes:c,preUpdate:h,update:d,preRender:p,render:f,postRender:m}=a,g=()=>{const o=r.useManualTiming?i.timestamp:performance.now();n=!1,r.useManualTiming||(i.delta=s?1e3/60:Math.max(Math.min(o-i.timestamp,40),1)),i.timestamp=o,i.isProcessing=!0,l.process(i),u.process(i),c.process(i),h.process(i),d.process(i),p.process(i),f.process(i),m.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(g))};return{schedule:W.reduce(((e,r)=>{const o=a[r];return e[r]=(e,r=!1,a=!1)=>(n||(n=!0,s=!0,i.isProcessing||t(g)),o.schedule(e,r,a)),e}),{}),cancel:t=>{for(let e=0;e<W.length;e++)a[W[e]].cancel(t)},state:i,steps:a}}const{schedule:K,cancel:$,state:z,steps:U}=j("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:u,!0);let Y;function H(){Y=void 0}const X={now:()=>(void 0===Y&&X.set(z.isProcessing||r.useManualTiming?z.timestamp:performance.now()),Y),set:t=>{Y=t,queueMicrotask(H)}},q={layout:0,mainThread:0,waapi:0},G=t=>e=>"string"==typeof e&&e.startsWith(t),Z=G("--"),_=G("var(--"),J=t=>!!_(t)&&Q.test(t.split("/*")[0].trim()),Q=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,tt={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},et={...tt,transform:t=>s(0,1,t)},nt={...tt,default:1},st=t=>Math.round(1e5*t)/1e5,it=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const rt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,ot=(t,e)=>n=>Boolean("string"==typeof n&&rt.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),at=(t,e,n)=>s=>{if("string"!=typeof s)return s;const[i,r,o,a]=s.match(it);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(o),alpha:void 0!==a?parseFloat(a):1}},lt={...tt,transform:t=>Math.round((t=>s(0,255,t))(t))},ut={test:ot("rgb","red"),parse:at("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+lt.transform(t)+", "+lt.transform(e)+", "+lt.transform(n)+", "+st(et.transform(s))+")"};const ct={test:ot("#"),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:ut.transform},ht=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),dt=ht("deg"),pt=ht("%"),ft=ht("px"),mt=ht("vh"),gt=ht("vw"),yt=(()=>({...pt,parse:t=>pt.parse(t)/100,transform:t=>pt.transform(100*t)}))(),vt={test:ot("hsl","hue"),parse:at("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+pt.transform(st(e))+", "+pt.transform(st(n))+", "+st(et.transform(s))+")"},wt={test:t=>ut.test(t)||ct.test(t)||vt.test(t),parse:t=>ut.test(t)?ut.parse(t):vt.test(t)?vt.parse(t):ct.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?ut.transform(t):vt.transform(t)},bt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const Tt="number",xt="color",Mt=/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 St(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const o=e.replace(Mt,(t=>(wt.test(t)?(s.color.push(r),i.push(xt),n.push(wt.parse(t))):t.startsWith("var(")?(s.var.push(r),i.push("var"),n.push(t)):(s.number.push(r),i.push(Tt),n.push(parseFloat(t))),++r,"${}"))).split("${}");return{values:n,split:o,indexes:s,types:i}}function Vt(t){return St(t).values}function At(t){const{split:e,types:n}=St(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+=e===Tt?st(t[r]):e===xt?wt.transform(t[r]):t[r]}return i}}const Et=t=>"number"==typeof t?0:t;const kt={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(it)?.length||0)+(t.match(bt)?.length||0)>0},parse:Vt,createTransformer:At,getAnimatableNone:function(t){const e=Vt(t);return At(t)(e.map(Et))}};function Pt(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 Ct({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=Pt(a,s,t+1/3),r=Pt(a,s,t),o=Pt(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}}function Ft(t,e){return n=>n>0?e:t}const Ot=(t,e,n)=>t+(e-t)*n,Rt=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},Bt=[ct,ut,vt];function Lt(t){const e=(n=t,Bt.find((t=>t.test(n))));var n;if(!Boolean(e))return!1;let s=e.parse(t);return e===vt&&(s=Ct(s)),s}const Dt=(t,e)=>{const n=Lt(t),s=Lt(e);if(!n||!s)return Ft(t,e);const i={...n};return t=>(i.red=Rt(n.red,s.red,t),i.green=Rt(n.green,s.green,t),i.blue=Rt(n.blue,s.blue,t),i.alpha=Ot(n.alpha,s.alpha,t),ut.transform(i))},It=new Set(["none","hidden"]);function Wt(t,e){return It.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function Nt(t,e){return n=>Ot(t,e,n)}function jt(t){return"number"==typeof t?Nt:"string"==typeof t?J(t)?Ft:wt.test(t)?Dt:zt:Array.isArray(t)?Kt:"object"==typeof t?wt.test(t)?Dt:$t:Ft}function Kt(t,e){const n=[...t],s=n.length,i=t.map(((t,n)=>jt(t)(t,e[n])));return t=>{for(let e=0;e<s;e++)n[e]=i[e](t);return n}}function $t(t,e){const n={...t,...e},s={};for(const i in n)void 0!==t[i]&&void 0!==e[i]&&(s[i]=jt(t[i])(t[i],e[i]));return t=>{for(const e in s)n[e]=s[e](t);return n}}const zt=(t,e)=>{const n=kt.createTransformer(e),s=St(t),i=St(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?It.has(t)&&!i.values.length||It.has(e)&&!s.values.length?Wt(t,e):h(Kt(function(t,e){const n=[],s={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const r=e.types[i],o=t.indexes[r][s[r]],a=t.values[o]??0;n[i]=a,s[r]++}return n}(s,i),i.values),n):Ft(t,e)};function Ut(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return Ot(t,e,n);return jt(t)(t,e)}const Yt=t=>{const e=({timestamp:e})=>t(e);return{start:()=>K.update(e,!0),stop:()=>$(e),now:()=>z.isProcessing?z.timestamp:X.now()}},Ht=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let e=0;e<i;e++)s+=t(e/(i-1))+", ";return`linear(${s.substring(0,s.length-2)})`},Xt=2e4;function qt(t){let e=0;let n=t.next(e);for(;!n.done&&e<Xt;)e+=50,n=t.next(e);return e>=Xt?1/0:e}function Gt(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(qt(s),Xt);return{type:"keyframes",ease:t=>s.next(i*t).value/e,duration:m(i)}}function Zt(t,e,n){const s=Math.max(e-5,0);return g(n-t(s),e-s)}const _t=100,Jt=10,Qt=1,te=0,ee=800,ne=.3,se=.3,ie={granular:.01,default:2},re={granular:.005,default:.5},oe=.01,ae=10,le=.05,ue=1,ce=.001;function he({duration:t=ee,bounce:e=ne,velocity:n=te,mass:i=Qt}){let r,o,a=1-e;a=s(le,ue,a),t=s(oe,ae,m(t)),a<1?(r=e=>{const s=e*a,i=s*t,r=s-n,o=pe(e,a),l=Math.exp(-i);return ce-r/o*l},o=e=>{const s=e*a*t,i=s*n+n,o=Math.pow(a,2)*Math.pow(e,2)*t,l=Math.exp(-s),u=pe(Math.pow(e,2),a);return(-r(e)+ce>0?-1:1)*((i-o)*l)/u}):(r=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,o=e=>Math.exp(-e*t)*(t*t*(n-e)));const l=function(t,e,n){let s=n;for(let n=1;n<de;n++)s-=t(s)/e(s);return s}(r,o,5/t);if(t=f(t),isNaN(l))return{stiffness:_t,damping:Jt,duration:t};{const e=Math.pow(l,2)*i;return{stiffness:e,damping:2*a*Math.sqrt(i*e),duration:t}}}const de=12;function pe(t,e){return t*Math.sqrt(1-e*e)}const fe=["duration","bounce"],me=["stiffness","damping","mass"];function ge(t,e){return e.some((e=>void 0!==t[e]))}function ye(t=se,e=ne){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:r}=n;const o=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],l={done:!1,value:o},{stiffness:u,damping:c,mass:h,duration:d,velocity:p,isResolvedFromDuration:g}=function(t){let e={velocity:te,stiffness:_t,damping:Jt,mass:Qt,isResolvedFromDuration:!1,...t};if(!ge(t,me)&&ge(t,fe))if(t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(1.2*n),r=i*i,o=2*s(.05,1,1-(t.bounce||0))*Math.sqrt(r);e={...e,mass:Qt,stiffness:r,damping:o}}else{const n=he(t);e={...e,...n,mass:Qt},e.isResolvedFromDuration=!0}return e}({...n,velocity:-m(n.velocity||0)}),y=p||0,v=c/(2*Math.sqrt(u*h)),w=a-o,b=m(Math.sqrt(u/h)),T=Math.abs(w)<5;let x;if(i||(i=T?ie.granular:ie.default),r||(r=T?re.granular:re.default),v<1){const t=pe(b,v);x=e=>{const n=Math.exp(-v*b*e);return a-n*((y+v*b*w)/t*Math.sin(t*e)+w*Math.cos(t*e))}}else if(1===v)x=t=>a-Math.exp(-b*t)*(w+(y+b*w)*t);else{const t=b*Math.sqrt(v*v-1);x=e=>{const n=Math.exp(-v*b*e),s=Math.min(t*e,300);return a-n*((y+v*b*w)*Math.sinh(s)+t*w*Math.cosh(s))/t}}const M={calculatedDuration:g&&d||null,next:t=>{const e=x(t);if(g)l.done=t>=d;else{let n=0===t?y:0;v<1&&(n=0===t?f(y):Zt(x,t,e));const s=Math.abs(n)<=i,o=Math.abs(a-e)<=r;l.done=s&&o}return l.value=l.done?a:e,l},toString:()=>{const t=Math.min(qt(M),Xt),e=Ht((e=>M.next(t*e).value),t,30);return t+"ms "+e},toTransition:()=>{}};return M}function ve({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 y=t=>-f*Math.exp(-t/s),v=t=>g+y(t),w=t=>{const e=y(t),n=v(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=ye({keyframes:[d.value,p(d.value)],velocity:Zt(v,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)}}}function we(t,e,{clamp:n=!0,ease:i,mixer:o}={}){const a=t.length;if(e.length,1===a)return()=>e[0];if(2===a&&e[0]===e[1])return()=>e[1];const l=t[0]===t[1];t[0]>t[a-1]&&(t=[...t].reverse(),e=[...e].reverse());const c=function(t,e,n){const s=[],i=n||r.mix||Ut,o=t.length-1;for(let n=0;n<o;n++){let r=i(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]||u:e;r=h(t,r)}s.push(r)}return s}(e,i,o),p=c.length,f=n=>{if(l&&n<t[0])return e[0];let s=0;if(p>1)for(;s<t.length-2&&!(n<t[s+1]);s++);const i=d(t[s],t[s+1],n);return c[s](i)};return n?e=>f(s(t[0],t[a-1],e)):f}function be(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=d(0,e,s);t.push(Ot(n,1,i))}}function Te(t){const e=[0];return be(e,t.length-1),e}function xe(t,e){return t.map((t=>t*e))}function Me(t,e){return t.map((()=>e||O)).splice(0,t.length-1)}function Se({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=R(s)?s.map(I):I(s),r={done:!1,value:e[0]},o=we(xe(n&&n.length===e.length?n:Te(e),t),e,{ease:Array.isArray(i)?i:Me(e,i)});return{calculatedDuration:t,next:e=>(r.value=o(e),r.done=e>=t,r)}}ye.applyToOptions=t=>{const e=Gt(t,100,ye);return t.ease=e.ease,t.duration=f(e.duration),t.type="keyframes",t};const Ve=t=>null!==t;function Ae(t,{repeat:e,repeatType:n="loop"},s,i=1){const r=t.filter(Ve),o=i<0||e&&"loop"!==n&&e%2==1?0:r.length-1;return o&&void 0!==s?s:r[o]}const Ee={decay:ve,inertia:ve,tween:Se,keyframes:Se,spring:ye};function ke(t){"string"==typeof t.type&&(t.type=Ee[t.type])}class Pe{constructor(){this.count=0,this.updateFinished()}get finished(){return this._finished}updateFinished(){this.count++,this._finished=new Promise((t=>{this.resolve=t}))}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const Ce=t=>t/100;class Fe extends Pe{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:t}=this.options;if(t&&t.updatedAt!==X.now()&&this.tick(X.now()),this.isStopped=!0,"idle"===this.state)return;this.teardown();const{onStop:e}=this.options;e&&e()},q.mainThread++,this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;ke(t);const{type:e=Se,repeat:n=0,repeatDelay:s=0,repeatType:i,velocity:r=0}=t;let{keyframes:o}=t;const a=e||Se;a!==Se&&"number"!=typeof o[0]&&(this.mixKeyframes=h(Ce,Ut(o[0],o[1])),o=[0,100]);const l=a({...t,keyframes:o});"mirror"===i&&(this.mirroredGenerator=a({...t,keyframes:[...o].reverse(),velocity:-r})),null===l.calculatedDuration&&(l.calculatedDuration=qt(l));const{calculatedDuration:u}=l;this.calculatedDuration=u,this.resolvedDuration=u+s,this.totalDuration=this.resolvedDuration*(n+1)-s,this.generator=l}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:n,totalDuration:i,mixKeyframes:r,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:l}=this;if(null===this.startTime)return n.next(0);const{delay:u=0,keyframes:c,repeat:h,repeatType:d,repeatDelay:p,type:f,onUpdate:m,finalKeyframe:g}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const y=this.currentTime-u*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?y<0:y>i;this.currentTime=Math.max(y,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);let w=this.currentTime,b=n;if(h){const t=Math.min(this.currentTime,i)/a;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,h+1);Boolean(e%2)&&("reverse"===d?(n=1-n,p&&(n-=p/a)):"mirror"===d&&(b=o)),w=s(0,1,n)*a}const T=v?{done:!1,value:c[0]}:b.next(w);r&&(T.value=r(T.value));let{done:x}=T;v||null===l||(x=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const M=null===this.holdTime&&("finished"===this.state||"running"===this.state&&x);return M&&f!==ve&&(T.value=Ae(c,this.options,g,this.speed)),m&&m(T.value),M&&this.finish(),T}then(t,e){return this.finished.then(t,e)}get duration(){return m(this.calculatedDuration)}get time(){return m(this.currentTime)}set time(t){t=f(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(X.now());const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=m(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=Yt,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:"finished"===this.state?(this.updateFinished(),this.startTime=s):this.startTime||(this.startTime=n??s),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(X.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null,q.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),t.observe(this)}}function Oe(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const Re=t=>180*t/Math.PI,Be=t=>{const e=Re(Math.atan2(t[1],t[0]));return De(e)},Le={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Be,rotateZ:Be,skewX:t=>Re(Math.atan(t[1])),skewY:t=>Re(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},De=t=>((t%=360)<0&&(t+=360),t),Ie=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),We=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Ne={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ie,scaleY:We,scale:t=>(Ie(t)+We(t))/2,rotateX:t=>De(Re(Math.atan2(t[6],t[5]))),rotateY:t=>De(Re(Math.atan2(-t[2],t[0]))),rotateZ:Be,rotate:Be,skewX:t=>Re(Math.atan(t[4])),skewY:t=>Re(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function je(t){return t.includes("scale")?1:0}function Ke(t,e){if(!t||"none"===t)return je(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=Ne,i=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=Le,i=e}if(!i)return je(e);const r=s[e],o=i[1].split(",").map(ze);return"function"==typeof r?r(o):o[r]}const $e=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Ke(n,e)};function ze(t){return parseFloat(t.trim())}const Ue=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ye=(()=>new Set(Ue))(),He=t=>t===tt||t===ft,Xe=new Set(["x","y","z"]),qe=Ue.filter((t=>!Xe.has(t)));const Ge={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:(t,{transform:e})=>Ke(e,"x"),y:(t,{transform:e})=>Ke(e,"y")};Ge.translateX=Ge.x,Ge.translateY=Ge.y;const Ze=new Set;let _e=!1,Je=!1,Qe=!1;function tn(){if(Je){const t=Array.from(Ze).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 qe.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])=>{t.getValue(e)?.set(n)}))})),t.forEach((t=>t.measureEndState())),t.forEach((t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)}))}Je=!1,_e=!1,Ze.forEach((t=>t.complete(Qe))),Ze.clear()}function en(){Ze.forEach((t=>{t.readKeyframes(),t.needsMeasurement&&(Je=!0)}))}function nn(){Qe=!0,en(),tn(),Qe=!1}class sn{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?(Ze.add(this),_e||(_e=!0,K.read(en),K.resolveKeyframes(tn))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:s}=this;if(null===t[0]){const i=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])}Oe(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Ze.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Ze.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const rn=t=>t.startsWith("--");function on(t,e,n){rn(e)?t.style.setProperty(e,n):t.style[e]=n}const an=l((()=>void 0!==window.ScrollTimeline)),ln={};function un(t,e){const n=l(t);return()=>ln[e]??n()}const cn=un((()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0}),"linearEasing"),hn=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,dn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:hn([0,.65,.55,1]),circOut:hn([.55,0,1,.45]),backIn:hn([.31,.01,.66,-.59]),backOut:hn([.33,1.53,.69,.99])};function pn(t,e){return t?"function"==typeof t?cn()?Ht(t,e):"ease-out":L(t)?hn(t):Array.isArray(t)?t.map((t=>pn(t,e)||dn.easeOut)):dn[t]:void 0}function fn(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:o="loop",ease:a="easeOut",times:l}={},u=void 0){const c={[e]:n};l&&(c.offset=l);const h=pn(a,i);Array.isArray(h)&&(c.easing=h),N.value&&q.waapi++;const d={delay:s,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:r+1,direction:"reverse"===o?"alternate":"normal"};u&&(d.pseudoElement=u);const p=t.animate(c,d);return N.value&&p.finished.finally((()=>{q.waapi--})),p}function mn(t){return"function"==typeof t&&"applyToOptions"in t}function gn({type:t,...e}){return mn(t)&&cn()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class yn extends Pe{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:e,name:n,keyframes:s,pseudoElement:i,allowFlatten:r=!1,finalKeyframe:o}=t;this.isPseudoElement=Boolean(i),this.allowFlatten=r,this.options=t,t.type;const a=gn(t);this.animation=fn(e,n,s,a,i),!1===a.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const t=Ae(s,this.options,o,this.speed);this.updateMotionValue?this.updateMotionValue(t):on(e,n,t),this.animation.cancel()}this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return m(Number(t))}get time(){return m(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=f(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:e}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&an()?(this.animation.timeline=t,u):e(this)}}const vn={anticipate:A,backInOut:V,circInOut:P};function wn(t){"string"==typeof t.ease&&t.ease in vn&&(t.ease=vn[t.ease])}class bn extends yn{constructor(t){wn(t),ke(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:n,onComplete:s,element:i,...r}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const o=new Fe({...r,autoplay:!1}),a=f(this.finishedTime??this.time);e.setWithVelocity(o.sample(a-10).value,o.sample(a).value,10),o.stop()}}const Tn=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!kt.test(t)&&"0"!==t||t.startsWith("url(")));const xn=new Set(["opacity","clipPath","filter","transform"]),Mn=l((()=>Object.hasOwnProperty.call(Element.prototype,"animate")));function Sn(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 Mn()&&n&&xn.has(n)&&("transform"!==n||!l)&&!a&&!s&&"mirror"!==i&&0!==r&&"inertia"!==o}class Vn extends Pe{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:r="loop",keyframes:o,name:a,motionValue:l,element:u,...c}){super(),this.stop=()=>{this._animation?(this._animation.stop(),this.stopTimeline?.()):this.keyframeResolver?.cancel()},this.createdAt=X.now();const h={autoplay:t,delay:e,type:n,repeat:s,repeatDelay:i,repeatType:r,name:a,motionValue:l,element:u,...c},d=u?.KeyframeResolver||sn;this.keyframeResolver=new d(o,((t,e,n)=>this.onKeyframesResolved(t,e,h,!n)),a,l,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,e,n,s){this.keyframeResolver=void 0;const{name:i,type:o,velocity:a,delay:l,isHandoff:c,onUpdate:h,onComplete:d}=n;this.resolvedAt=X.now(),function(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=Tn(i,e),a=Tn(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||mn(n))&&s)}(t,i,o,a)||(!r.instantAnimations&&l||h?.(Ae(t,n,e)),t[0]=t[t.length-1],n.duration=0,n.repeat=0);const p={startTime:s?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:e,...n,keyframes:t},f=!c&&Sn(p)?new bn({...p,element:p.motionValue.owner.current}):new Fe(p);f.finished.then((()=>{d?.(),this.notifyFinished()})).catch(u),this.pendingTimeline&&(this.stopTimeline=f.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=f}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then((()=>{}))}get animation(){return this._animation||nn(),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this.animation.cancel()}}class An{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map((t=>t.finished)))}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){const e=this.animations.map((e=>e.attachTimeline(t)));return()=>{e.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 state(){return this.getAll("state")}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]()))}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class En extends An{then(t,e){return this.finished.finally(t).then((()=>{}))}}class kn extends yn{constructor(t){super(),this.animation=t,t.onfinish=()=>{this.finishedTime=this.time,this.notifyFinished()}}}const Pn=new WeakMap,Cn=(t,e="")=>`${t}:${e}`;function Fn(t){const e=Pn.get(t)||new Map;return Pn.set(t,e),e}const On=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Rn(t){const e=On.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}function Bn(t,e,n=1){const[s,i]=Rn(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);if(r){const t=r.trim();return o(t)?parseFloat(t):t}return J(i)?Bn(i,e,n+1):i}function Ln(t,e){return t?.[e]??t?.default??t}const Dn=new Set(["width","height","top","left","right","bottom",...Ue]),In=t=>e=>e.test(t),Wn=[tt,ft,pt,dt,gt,mt,{test:t=>"auto"===t,parse:t=>t}],Nn=t=>Wn.find(In(t));const jn=new Set(["brightness","contrast","saturate","opacity"]);function Kn(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[s]=n.match(it)||[];if(!s)return t;const i=n.replace(s,"");let r=jn.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const $n=/\b([a-z-]*)\(.*?\)/gu,zn={...kt,getAnimatableNone:t=>{const e=t.match($n);return e?e.map(Kn).join(" "):t}},Un={...tt,transform:Math.round},Yn={rotate:dt,rotateX:dt,rotateY:dt,rotateZ:dt,scale:nt,scaleX:nt,scaleY:nt,scaleZ:nt,skew:dt,skewX:dt,skewY:dt,distance:ft,translateX:ft,translateY:ft,translateZ:ft,x:ft,y:ft,z:ft,perspective:ft,transformPerspective:ft,opacity:et,originX:yt,originY:yt,originZ:ft},Hn={borderWidth:ft,borderTopWidth:ft,borderRightWidth:ft,borderBottomWidth:ft,borderLeftWidth:ft,borderRadius:ft,radius:ft,borderTopLeftRadius:ft,borderTopRightRadius:ft,borderBottomRightRadius:ft,borderBottomLeftRadius:ft,width:ft,maxWidth:ft,height:ft,maxHeight:ft,top:ft,right:ft,bottom:ft,left:ft,padding:ft,paddingTop:ft,paddingRight:ft,paddingBottom:ft,paddingLeft:ft,margin:ft,marginTop:ft,marginRight:ft,marginBottom:ft,marginLeft:ft,backgroundPositionX:ft,backgroundPositionY:ft,...Yn,zIndex:Un,fillOpacity:et,strokeOpacity:et,numOctaves:Un},Xn={...Hn,color:wt,backgroundColor:wt,outlineColor:wt,fill:wt,stroke:wt,borderColor:wt,borderTopColor:wt,borderRightColor:wt,borderBottomColor:wt,borderLeftColor:wt,filter:zn,WebkitFilter:zn},qn=t=>Xn[t];function Gn(t,e){let n=qn(t);return n!==zn&&(n=kt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Zn=new Set(["auto","none","0"]);class _n extends sn{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(),J(s))){const i=Bn(s,e.current);void 0!==i&&(t[n]=i),n===t.length-1&&(this.finalKeyframe=s)}}if(this.resolveNoneKeyframes(),!Dn.has(n)||2!==t.length)return;const[s,i]=t,r=Nn(s),o=Nn(i);if(r!==o)if(He(r)&&He(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++)(null===t[e]||("number"==typeof(s=t[e])?0===s:null===s||"none"===s||"0"===s||a(s)))&&n.push(e);var s;n.length&&function(t,e,n){let s,i=0;for(;i<t.length&&!s;){const e=t[i];"string"==typeof e&&!Zn.has(e)&&St(e).values.length&&(s=t[i]),i++}if(s&&n)for(const i of e)t[i]=Gn(n,s)}(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=Ge[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(){const{element:t,name:e,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const s=t.getValue(e);s&&s.jump(this.measuredOrigin,!1);const i=n.length-1,r=n[i];n[i]=Ge[e](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==r&&void 0===this.finalKeyframe&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach((([e,n])=>{t.getValue(e).set(n)})),this.resolveNoneKeyframes()}}const Jn=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","radius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","width","maxWidth","height","maxHeight","top","right","bottom","left","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","margin","marginTop","marginRight","marginBottom","marginLeft","backgroundPositionX","backgroundPositionY"]);function Qn(t,e){for(let n=0;n<t.length;n++)"number"==typeof t[n]&&Jn.has(e)&&(t[n]=t[n]+"px")}const ts=l((()=>{try{document.createElement("div").animate({opacity:[1]})}catch(t){return!1}return!0})),es=new Set(["opacity","clipPath","filter","transform"]),{schedule:ns,cancel:ss}=j(queueMicrotask,!1),is={x:!1,y:!1};function rs(){return is.x||is.y}function os(t,e,n){if(t instanceof EventTarget)return[t];if("string"==typeof t){let s=document;e&&(s=e.current);const i=n?.[t]??s.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t)}function as(t,e){const n=os(t),s=new AbortController;return[n,{passive:!0,...e,signal:s.signal},()=>s.abort()]}function ls(t){return!("touch"===t.pointerType||rs())}const us=(t,e)=>!!e&&(t===e||us(t,e.parentElement)),cs=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,hs=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const ds=new WeakSet;function ps(t){return e=>{"Enter"===e.key&&t(e)}}function fs(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function ms(t){return cs(t)&&!rs()}function gs(t,e){const n=window.getComputedStyle(t);return rn(e)?n.getPropertyValue(e):n[e]}function ys(t,e){let n;const s=()=>{const{currentTime:s}=e,i=(null===s?0:s.value)/100;n!==i&&t(i),n=i};return K.preUpdate(s,!0),()=>$(s)}function vs(){const{value:t}=N;null!==t?(t.frameloop.rate.push(z.delta),t.animations.mainThread.push(q.mainThread),t.animations.waapi.push(q.waapi),t.animations.layout.push(q.layout)):$(vs)}function ws(t){return t.reduce(((t,e)=>t+e),0)/t.length}function bs(t,e=ws){return 0===t.length?{min:0,max:0,avg:0}:{min:Math.min(...t),max:Math.max(...t),avg:e(t)}}const Ts=t=>Math.round(1e3/t);function xs(){N.value=null,N.addProjectionMetrics=null}function Ms(){const{value:t}=N;if(!t)throw new Error("Stats are not being measured");xs(),$(vs);const e={frameloop:{setup:bs(t.frameloop.setup),rate:bs(t.frameloop.rate),read:bs(t.frameloop.read),resolveKeyframes:bs(t.frameloop.resolveKeyframes),preUpdate:bs(t.frameloop.preUpdate),update:bs(t.frameloop.update),preRender:bs(t.frameloop.preRender),render:bs(t.frameloop.render),postRender:bs(t.frameloop.postRender)},animations:{mainThread:bs(t.animations.mainThread),waapi:bs(t.animations.waapi),layout:bs(t.animations.layout)},layoutProjection:{nodes:bs(t.layoutProjection.nodes),calculatedTargetDeltas:bs(t.layoutProjection.calculatedTargetDeltas),calculatedProjections:bs(t.layoutProjection.calculatedProjections)}},{rate:n}=e.frameloop;return n.min=Ts(n.min),n.max=Ts(n.max),n.avg=Ts(n.avg),[n.min,n.max]=[n.max,n.min],e}function Ss(...t){const e=!Array.isArray(t[0]),n=e?0:-1,s=t[0+n],i=we(t[1+n],t[2+n],t[3+n]);return e?i(s):i}const Vs={current:void 0};class As{constructor(t,e={}){this.version="12.8.1",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(t,e=!0)=>{const n=X.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=X.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 p);const n=this.events[t].add(e);return"change"===t?()=>{n(),K.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 Vs.current&&Vs.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=X.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return g(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.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Es(t,e){return new As(t,e)}function ks(t){const e=[];Vs.current=e;const n=t();Vs.current=void 0;const s=Es(n);return function(t,e,n){const s=()=>e.set(n()),i=()=>K.preRender(s,!1,!0),r=t.map((t=>t.on("change",i)));e.on("destroy",(()=>{r.forEach((t=>t())),$(s)}))}(e,s,t),s}const Ps=[...Wn,wt,kt],Cs=t=>Ps.find(In(t)),Fs=(t,e)=>e&&"number"==typeof t?e.transform(t):t;function Os(t){return"layout"===t?"group":"enter"===t||"new"===t?"new":"exit"===t||"old"===t?"old":"group"}let Rs={},Bs=null;const Ls=(t,e)=>{Rs[t]=e},Ds=()=>{Bs||(Bs=document.createElement("style"),Bs.id="motion-view");let t="";for(const e in Rs){const n=Rs[e];t+=`${e} {\n`;for(const[e,s]of Object.entries(n))t+=` ${e}: ${s};\n`;t+="}\n"}Bs.textContent=t,document.head.appendChild(Bs),Rs={}},Is=()=>{Bs&&Bs.parentElement&&Bs.parentElement.removeChild(Bs)};function Ws(t){const e=t.match(/::view-transition-(old|new|group|image-pair)\((.*?)\)/);return e?{layer:e[2],type:e[1]}:null}function Ns(t){const{effect:e}=t;return!!e&&(e.target===document.documentElement&&e.pseudoElement?.startsWith("::view-transition"))}const js=["layout","enter","exit","new","old"];function Ks(t){const{update:e,targets:n,options:s}=t;if(!document.startViewTransition)return new Promise((async t=>{await e(),t(new An([]))}));(function(t,e){return e.has(t)&&Object.keys(e.get(t)).length>0})("root",n)||Ls(":root",{"view-transition-name":"none"}),Ls("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)",{"animation-timing-function":"linear !important"}),Ds();const i=document.startViewTransition((async()=>{await e()}));return i.finished.finally((()=>{Is()})),new Promise((t=>{i.ready.then((()=>{const e=document.getAnimations().filter(Ns),i=[];n.forEach(((t,e)=>{for(const n of js){if(!t[n])continue;const{keyframes:r,options:o}=t[n];for(let[t,a]of Object.entries(r)){if(!a)continue;const r={...Ln(s,t),...Ln(o,t)},l=Os(n);if("opacity"===t&&!Array.isArray(a)){a=["new"===l?0:1,a]}"function"==typeof r.delay&&(r.delay=r.delay(0,1)),r.duration&&(r.duration=f(r.duration)),r.delay&&(r.delay=f(r.delay));const u=new yn({...r,element:document.documentElement,name:t,pseudoElement:`::view-transition-${l}(${e})`,keyframes:a});i.push(u)}}}));for(const t of e){if("finished"===t.playState)continue;const{effect:e}=t;if(!(e&&e instanceof KeyframeEffect))continue;const{pseudoElement:r}=e;if(!r)continue;const o=Ws(r);if(!o)continue;const a=n.get(o.layer);if(a)$s(a,"enter")&&$s(a,"exit")&&e.getKeyframes().some((t=>t.mixBlendMode))?i.push(new kn(t)):t.cancel();else{const n="group"===o.type?"layout":"";let r={...Ln(s,n)};r.duration&&(r.duration=f(r.duration)),r=gn(r);const a=pn(r.ease,r.duration);e.updateTiming({delay:f(r.delay??0),duration:r.duration,easing:a}),i.push(new kn(t))}}t(new An(i))}))}))}function $s(t,e){return t?.[e]?.keyframes.opacity}let zs=[],Us=null;function Ys(){Us=null;const[t]=zs;var e;t&&(n(zs,e=t),Us=e,Ks(e).then((t=>{e.notifyReady(t),t.finished.finally(Ys)})))}function Hs(){for(let t=zs.length-1;t>=0;t--){const e=zs[t],{interrupt:n}=e.options;if("immediate"===n){const n=zs.slice(0,t+1).map((t=>t.update)),s=zs.slice(t+1);e.update=()=>{n.forEach((t=>t()))},zs=[e,...s];break}}Us&&"immediate"!==zs[0]?.options.interrupt||Ys()}class Xs{constructor(t,e={}){var n;this.currentTarget="root",this.targets=new Map,this.notifyReady=u,this.readyPromise=new Promise((t=>{this.notifyReady=t})),this.update=t,this.options={interrupt:"wait",...e},n=this,zs.push(n),ns.render(Hs)}get(t){return this.currentTarget=t,this}layout(t,e){return this.updateTarget("layout",t,e),this}new(t,e){return this.updateTarget("new",t,e),this}old(t,e){return this.updateTarget("old",t,e),this}enter(t,e){return this.updateTarget("enter",t,e),this}exit(t,e){return this.updateTarget("exit",t,e),this}crossfade(t){return this.updateTarget("enter",{opacity:1},t),this.updateTarget("exit",{opacity:0},t),this}updateTarget(t,e,n={}){const{currentTarget:s,targets:i}=this;i.has(s)||i.set(s,{});i.get(s)[t]={keyframes:e,options:n}}then(t,e){return this.readyPromise.then(t,e)}}const qs=K,Gs=W.reduce(((t,e)=>(t[e]=t=>$(t),t)),{}),Zs=t=>Boolean(t&&t.getVelocity);function _s(t){return"object"==typeof t&&!Array.isArray(t)}function Js(t,e,n,s){return"string"==typeof t&&_s(e)?os(t,n,s):t instanceof NodeList?Array.from(t):Array.isArray(t)?t:[t]}function Qs(t,e,n){return t*(e+1)}function ti(t,e,n,s){return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:s.get(e)??t}function ei(t,e,s,i,r,o){!function(t,e,s){for(let i=0;i<t.length;i++){const r=t[i];r.at>e&&r.at<s&&(n(t,r),i--)}}(t,r,o);for(let n=0;n<e.length;n++)t.push({value:e[n],at:Ot(r,o,i[n]),easing:B(s,n)})}function ni(t,e){for(let n=0;n<t.length;n++)t[n]=t[n]/(e+1)}function si(t,e){return t.at===e.at?null===t.value?1:null===e.value?-1:0:t.at-e.at}function ii(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function ri(t,e){return e[t]||(e[t]=[]),e[t]}function oi(t){return Array.isArray(t)?t:[t]}function ai(t,e){return t&&t[e]?{...t,...t[e]}:{...t}}const li=t=>"number"==typeof t,ui=t=>t.every(li),ci=new WeakMap;function hi(t){const e=[{},{}];return t?.values.forEach(((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()})),e}function di(t,e,n,s){if("function"==typeof e){const[i,r]=hi(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]=hi(s);e=e(void 0!==n?n:t.custom,i,r)}return e}function pi(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Es(n))}function fi(t){return(t=>Array.isArray(t))(t)?t[t.length-1]||0:t}function mi(t,e){const n=function(t,e,n){const s=t.getProps();return di(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){pi(t,e,fi(r[e]))}}function gi(t,e){const n=t.getValue("willChange");if(s=n,Boolean(Zs(s)&&s.add))return n.add(e);if(!n&&r.WillChange){const n=new r.WillChange("auto");t.addValue("willChange",n),n.add(e)}var s}const yi=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),vi="data-"+yi("framerAppearId");function wi(t){return t.props[vi]}const bi=t=>null!==t;const Ti={type:"spring",stiffness:500,damping:25,restSpeed:10},xi={type:"keyframes",duration:.8},Mi={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Si=(t,{keyframes:e})=>e.length>2?xi:Ye.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Ti:Mi;const Vi=(t,e,n,s={},i,o)=>a=>{const l=Ln(s,t)||{},u=l.delay||s.delay||0;let{elapsed:c=0}=s;c-=f(u);const h={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-c,onUpdate:t=>{e.set(t),l.onUpdate&&l.onUpdate(t)},onComplete:()=>{a(),l.onComplete&&l.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})(l)||Object.assign(h,Si(t,h)),h.duration&&(h.duration=f(h.duration)),h.repeatDelay&&(h.repeatDelay=f(h.repeatDelay)),void 0!==h.from&&(h.keyframes[0]=h.from);let d=!1;if((!1===h.type||0===h.duration&&!h.repeatDelay)&&(h.duration=0,0===h.delay&&(d=!0)),(r.instantAnimations||r.skipAnimations)&&(d=!0,h.duration=0,h.delay=0),h.allowFlatten=!l.type&&!l.ease,d&&!o&&void 0!==e.get()){const t=function(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(bi),r=e&&"loop"!==n&&e%2==1?0:i.length-1;return r&&void 0!==s?s:i[r]}(h.keyframes,l);if(void 0!==t)return void K.update((()=>{h.onUpdate(t),h.onComplete()}))}return new Vn(h)};function Ai({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,s}function Ei(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:r=t.getDefaultTransition(),transitionEnd:o,...a}=e;s&&(r=s);const l=[],u=i&&t.animationState&&t.animationState.getState()[i];for(const e in a){const s=t.getValue(e,t.latestValues[e]??null),i=a[e];if(void 0===i||u&&Ai(u,e))continue;const o={delay:n,...Ln(r||{},e)};let c=!1;if(window.MotionHandoffAnimation){const n=wi(t);if(n){const t=window.MotionHandoffAnimation(n,e,K);null!==t&&(o.startTime=t,c=!0)}}gi(t,e),s.start(Vi(e,s,i,t.shouldReduceMotion&&Dn.has(e)?{type:!1}:o,t,c));const h=s.animation;h&&l.push(h)}return o&&Promise.all(l).then((()=>{K.update((()=>{o&&mi(t,o)}))})),l}const ki=()=>({x:{min:0,max:0},y:{min:0,max:0}}),Pi={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"]},Ci={};for(const t in Pi)Ci[t]={isEnabled:e=>Pi[t].some((t=>!!e[t]))};const Fi="undefined"!=typeof window,Oi={current:null},Ri={current:!1};const Bi=["initial","animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"];function Li(t){return null!==(e=t.animate)&&"object"==typeof e&&"function"==typeof e.start||Bi.some((e=>function(t){return"string"==typeof t||Array.isArray(t)}(t[e])));var e}const Di=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Ii{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=sn,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=X.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,K.render(this.render,!1,!0))};const{latestValues:a,renderState:l}=r;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=Li(e),this.isVariantNode=function(t){return Boolean(Li(t)||t.variants)}(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:u,...c}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in c){const e=c[t];void 0!==a[t]&&Zs(e)&&e.set(a[t],!1)}}mount(t){this.current=t,ci.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))),Ri.current||function(){if(Ri.current=!0,Fi)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Oi.current=t.matches;t.addListener(e),e()}else Oi.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Oi.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),$(this.notifyUpdate),$(this.render),this.valueSubscriptions.forEach((t=>t())),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);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=Ye.has(t);n&&this.onBindTransform&&this.onBindTransform();const s=e.on("change",(e=>{this.latestValues[t]=e,this.props.onUpdate&&K.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 Ci){const e=Ci[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<Di.length;e++){const n=Di[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(Zs(i))t.addValue(s,i);else if(Zs(r))t.addValue(s,Es(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,Es(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()}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=Es(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){let n=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];return null!=n&&("string"==typeof n&&(o(n)||a(n))?n=parseFloat(n):!Cs(n)&&kt.test(e)&&(n=Gn(t,e)),this.setBaseTarget(t,Zs(n)?n.get():n)),Zs(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let n;if("string"==typeof e||"object"==typeof e){const s=di(this.props,e,this.presenceContext?.custom);s&&(n=s[t])}if(e&&void 0!==n)return n;const s=this.getBaseTargetFromProps(this.props,t);return void 0===s||Zs(s)?void 0!==this.initialValues[t]&&void 0===n?void 0:this.baseTarget[t]:s}on(t,e){return this.events[t]||(this.events[t]=new p),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}class Wi extends Ii{constructor(){super(...arguments),this.KeyframeResolver=_n}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;Zs(t)&&(this.childSubscription=t.on("change",(t=>{this.current&&(this.current.textContent=`${t}`)})))}}const Ni={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ji=Ue.length;function Ki(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(Ye.has(t))o=!0;else if(Z(t))i[t]=n;else{const e=Fs(n,Hn[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<ji;r++){const o=Ue[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=Fs(a,Hn[o]);l||(i=!1,s+=`${Ni[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 $i={offset:"stroke-dashoffset",array:"stroke-dasharray"},zi={offset:"strokeDashoffset",array:"strokeDasharray"};function Ui(t,{attrX:e,attrY:n,attrScale:s,pathLength:i,pathSpacing:r=1,pathOffset:o=0,...a},l,u){if(Ki(t,a,u),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:c,style:h}=t;c.transform&&(h.transform=c.transform,delete c.transform),(h.transform||c.transformOrigin)&&(h.transformOrigin=c.transformOrigin??"50% 50%",delete c.transformOrigin),h.transform&&(h.transformBox="fill-box",delete c.transformBox),void 0!==e&&(c.x=e),void 0!==n&&(c.y=n),void 0!==s&&(c.scale=s),void 0!==i&&function(t,e,n=1,s=0,i=!0){t.pathLength=1;const r=i?$i:zi;t[r.offset]=ft.transform(-s);const o=ft.transform(e),a=ft.transform(n);t[r.array]=`${o} ${a}`}(c,i,r,o,!1)}const Yi=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 Hi(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 Xi={};function qi(t,{layout:e,layoutId:n}){return Ye.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!Xi[t]||"opacity"===t)}function Gi(t,e,n){const{style:s}=t,i={};for(const r in s)(Zs(s[r])||e.style&&Zs(e.style[r])||qi(r,t)||void 0!==n?.getValue(r)?.liveStyle)&&(i[r]=s[r]);return i}class Zi extends Wi{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ki}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(Ye.has(e)){const t=qn(e);return t&&t.default||0}return e=Yi.has(e)?e:yi(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return function(t,e,n){const s=Gi(t,e,n);for(const n in t)(Zs(t[n])||Zs(e[n]))&&(s[-1!==Ue.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]);return s}(t,e,n)}build(t,e,n){Ui(t,e,this.isSVGTag,n.transformTemplate)}renderInstance(t,e,n,s){!function(t,e,n,s){Hi(t,e,void 0,s);for(const n in e.attrs)t.setAttribute(Yi.has(n)?n:yi(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 _i extends Wi{constructor(){super(...arguments),this.type="html",this.renderInstance=Hi}readValueFromInstance(t,e){if(Ye.has(e))return $e(t,e);{const s=(n=t,window.getComputedStyle(n)),i=(Z(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){Ki(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return Gi(t,e,n)}}class Ji extends Ii{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 Qi(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 Zi(e):new _i(e);n.mount(t),ci.set(t,n)}function tr(t){const e=new Ji({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});e.mount(t),ci.set(t,e)}function er(t,e,n,s){const i=[];if(function(t,e){return Zs(t)||"number"==typeof t||"string"==typeof t&&!_s(e)}(t,e))i.push(function(t,e,n){const s=Zs(t)?t:Es(t);return s.start(Vi("",s,e,n)),s.animation}(t,_s(e)&&e.default||e,n&&n.default||n));else{const r=Js(t,e,s),o=r.length;for(let t=0;t<o;t++){const s=r[t],a=s instanceof Element?Qi:tr;ci.has(s)||a(s);const l=ci.get(s),u={...n};"delay"in u&&"function"==typeof u.delay&&(u.delay=u.delay(t,o)),i.push(...Ei(l,{...e,transition:u},{}))}}return i}function nr(t,e,n){const s=[],i=function(t,{defaultTransition:e={},...n}={},s,i){const r=e.duration||.3,o=new Map,a=new Map,l={},u=new Map;let c=0,h=0,p=0;for(let n=0;n<t.length;n++){const o=t[n];if("string"==typeof o){u.set(o,h);continue}if(!Array.isArray(o)){u.set(o.name,ti(h,o.at,c,u));continue}let[d,m,g={}]=o;void 0!==g.at&&(h=ti(h,g.at,c,u));let y=0;const v=(t,n,s,o=0,a=0)=>{const l=oi(t),{delay:u=0,times:c=Te(l),type:d="keyframes",repeat:m,repeatType:g,repeatDelay:v=0,...w}=n;let{ease:b=e.ease||"easeOut",duration:T}=n;const x="function"==typeof u?u(o,a):u,M=l.length,S=mn(d)?d:i?.[d];if(M<=2&&S){let t=100;if(2===M&&ui(l)){const e=l[1]-l[0];t=Math.abs(e)}const e={...w};void 0!==T&&(e.duration=f(T));const n=Gt(e,t,S);b=n.ease,T=n.duration}T??(T=r);const V=h+x;1===c.length&&0===c[0]&&(c[1]=1);const A=c.length-l.length;if(A>0&&be(c,A),1===l.length&&l.unshift(null),m){T=Qs(T,m);const t=[...l],e=[...c];b=Array.isArray(b)?[...b]:[b];const n=[...b];for(let s=0;s<m;s++){l.push(...t);for(let i=0;i<t.length;i++)c.push(e[i]+(s+1)),b.push(0===i?"linear":B(n,i-1))}ni(c,m)}const E=V+T;ei(s,l,b,c,V,E),y=Math.max(x+T,y),p=Math.max(E,p)};if(Zs(d))v(m,g,ri("default",ii(d,a)));else{const t=Js(d,m,s,l),e=t.length;for(let n=0;n<e;n++){const s=ii(t[n],a);for(const t in m)v(m[t],ai(g,t),ri(t,s),n,e)}}c=h,h+=y}return a.forEach(((t,s)=>{for(const i in t){const r=t[i];r.sort(si);const a=[],l=[],u=[];for(let t=0;t<r.length;t++){const{at:e,value:n,easing:s}=r[t];a.push(n),l.push(d(0,p,e)),u.push(s||"easeOut")}0!==l[0]&&(l.unshift(0),a.unshift(a[0]),u.unshift("easeInOut")),1!==l[l.length-1]&&(l.push(1),a.push(null)),o.has(s)||o.set(s,{keyframes:{},transition:{}});const c=o.get(s);c.keyframes[i]=a,c.transition[i]={...e,duration:p,ease:u,times:l,...n}}})),o}(t,e,n,{spring:ye});return i.forEach((({keyframes:t,transition:e},n)=>{s.push(...er(n,t,e))})),s}function sr(t){return function(e,n,s){let i=[];var r;r=e,i=Array.isArray(r)&&r.some(Array.isArray)?nr(e,n,t):er(e,n,s,t);const o=new En(i);return t&&t.animations.push(o),o}}const ir=sr();const rr=t=>function(e,n,s){return new En(function(t,e,n,s){const i=os(t,s),r=i.length,o=[];for(let t=0;t<r;t++){const s=i[t],a={...n};"function"==typeof a.delay&&(a.delay=a.delay(t,r));for(const t in e){let n=e[t];Array.isArray(n)||(n=[n]);const i={...Ln(a,t)};i.duration&&(i.duration=f(i.duration)),i.delay&&(i.delay=f(i.delay));const r=Fn(s),l=Cn(t,i.pseudoElement||""),u=r.get(l);u&&u.stop(),o.push({map:r,key:l,unresolvedKeyframes:n,options:{...i,element:s,name:t,allowFlatten:!a.type&&!a.ease}})}}for(let t=0;t<o.length;t++){const{unresolvedKeyframes:e,options:n}=o[t],{element:s,name:i,pseudoElement:r}=n;r||null!==e[0]||(e[0]=gs(s,i)),Oe(e),Qn(e,i),!r&&e.length<2&&e.unshift(gs(s,i)),n.keyframes=e}const a=[];for(let t=0;t<o.length;t++){const{map:e,key:n,options:s}=o[t],i=new yn(s);e.set(n,i),i.finished.finally((()=>e.delete(n))),a.push(i)}return a}(e,n,s,t))},or=rr(),ar=new WeakMap;let lr;function ur({target:t,contentRect:e,borderBoxSize:n}){ar.get(t)?.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 cr(t){t.forEach(ur)}function hr(t,e){lr||"undefined"!=typeof ResizeObserver&&(lr=new ResizeObserver(cr));const n=os(t);return n.forEach((t=>{let n=ar.get(t);n||(n=new Set,ar.set(t,n)),n.add(e),lr?.observe(t)})),()=>{n.forEach((t=>{const n=ar.get(t);n?.delete(e),n?.size||lr?.unobserve(t)}))}}const dr=new Set;let pr;function fr(t){return dr.add(t),pr||(pr=()=>{const t={width:window.innerWidth,height:window.innerHeight},e={target:window,size:t,contentSize:t};dr.forEach((t=>t(e)))},window.addEventListener("resize",pr)),()=>{dr.delete(t),!dr.size&&pr&&(pr=void 0)}}const mr={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function gr(t,e,n,s){const i=n[e],{length:r,position:o}=mr[e],a=i.current,l=n.time;i.current=t[`scroll${o}`],i.scrollLength=t[`scroll${r}`]-t[`client${r}`],i.offset.length=0,i.offset[0]=0,i.offset[1]=i.scrollLength,i.progress=d(0,i.scrollLength,i.current);const u=s-l;i.velocity=u>50?0:g(i.current-a,u)}const yr={start:0,center:.5,end:1};function vr(t,e,n=0){let s=0;if(t in yr&&(t=yr[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 wr=[0,0];function br(t,e,n,s){let i=Array.isArray(t)?t:wr,r=0,o=0;return"number"==typeof t?i=[t,t]:"string"==typeof t&&(i=(t=t.trim()).includes(" ")?t.split(" "):[t,yr[t]?t:"0"]),r=vr(i[0],n,s),o=vr(i[1],e),r-o}const Tr={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},xr={x:0,y:0};function Mr(t,e,n){const{offset:i=Tr.All}=n,{target:r=t,axis:o="y"}=n,a="y"===o?"height":"width",l=r!==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}(r,t):xr,u=r===t?{width:t.scrollWidth,height:t.scrollHeight}:function(t){return"getBBox"in t&&"svg"!==t.tagName?t.getBBox():{width:t.clientWidth,height:t.clientHeight}}(r),c={width:t.clientWidth,height:t.clientHeight};e[o].offset.length=0;let h=!e[o].interpolate;const d=i.length;for(let t=0;t<d;t++){const n=br(i[t],c[a],u[a],l[o]);h||n===e[o].interpolatorOffsets[t]||(h=!0),e[o].offset[t]=n}h&&(e[o].interpolate=we(e[o].offset,Te(i),{clamp:!1}),e[o].interpolatorOffsets=[...e[o].offset]),e[o].progress=s(0,1,e[o].interpolate(e[o].current))}function Sr(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){gr(t,"x",e,n),gr(t,"y",e,n),e.time=n}(t,n,e),(s.offset||s.target)&&Mr(t,n,s)},notify:()=>e(n)}}const Vr=new WeakMap,Ar=new WeakMap,Er=new WeakMap,kr=t=>t===document.documentElement?window:t;function Pr(t,{container:e=document.documentElement,...n}={}){let s=Er.get(e);s||(s=new Set,Er.set(e,s));const i=Sr(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),!Vr.has(e)){const t=()=>{for(const t of s)t.measure()},n=()=>{for(const t of s)t.update(z.timestamp)},i=()=>{for(const t of s)t.notify()},a=()=>{K.read(t,!1,!0),K.read(n,!1,!0),K.preUpdate(i,!1,!0)};Vr.set(e,a);const l=kr(e);window.addEventListener("resize",a,{passive:!0}),e!==document.documentElement&&Ar.set(e,(o=a,"function"==typeof(r=e)?fr(r):hr(r,o))),l.addEventListener("scroll",a,{passive:!0})}var r,o;const a=Vr.get(e);return K.read(a,!1,!0),()=>{$(a);const t=Er.get(e);if(!t)return;if(t.delete(i),t.size)return;const n=Vr.get(e);Vr.delete(e),n&&(kr(e).removeEventListener("scroll",n),Ar.get(e)?.(),window.removeEventListener("resize",n))}}const Cr=new Map;function Fr({source:t,container:e,...n}){const{axis:s}=n;t&&(e=t);const i=Cr.get(e)??new Map;Cr.set(e,i);const r=n.target??"self",o=i.get(r)??{},a=s+(n.offset??[]).join(",");return o[a]||(o[a]=!n.target&&an()?new ScrollTimeline({source:e,axis:s}):function(t){const e={value:0},n=Pr((n=>{e.value=100*n[t.axis].progress}),t);return{currentTime:e,cancel:n}}({container:e,...n})),o[s]}const Or={some:0,all:1};const Rr=(t,e)=>Math.abs(t-e);t.AsyncMotionValueAnimation=Vn,t.DOMKeyframesResolver=_n,t.GroupAnimation=An,t.GroupAnimationWithThen=En,t.JSAnimation=Fe,t.KeyframeResolver=sn,t.MotionGlobalConfig=r,t.MotionValue=As,t.NativeAnimation=yn,t.NativeAnimationExtended=bn,t.NativeAnimationWrapper=kn,t.SubscriptionManager=p,t.ViewTransitionBuilder=Xs,t.acceleratedValues=es,t.activeAnimations=q,t.addUniqueItem=e,t.alpha=et,t.analyseComplexValue=St,t.animate=ir,t.animateMini=or,t.animateValue=function(t){return new Fe(t)},t.animateView=function(t,e={}){return new Xs(t,e)},t.animationMapKey=Cn,t.anticipate=A,t.applyPxDefaults=Qn,t.backIn=S,t.backInOut=V,t.backOut=M,t.calcGeneratorDuration=qt,t.cancelFrame=$,t.cancelMicrotask=ss,t.cancelSync=Gs,t.circIn=E,t.circInOut=P,t.circOut=k,t.clamp=s,t.collectMotionValues=Vs,t.color=wt,t.complex=kt,t.convertOffsetToTimes=xe,t.createGeneratorEasing=Gt,t.createRenderBatcher=j,t.createScopedAnimate=sr,t.cubicBezier=b,t.cubicBezierAsString=hn,t.defaultEasing=Me,t.defaultOffset=Te,t.defaultValueTypes=Xn,t.degrees=dt,t.delay=function(t,e){return function(t,e){const n=X.now(),s=({timestamp:i})=>{const r=i-n;r>=e&&($(s),t(r-e))};return K.setup(s,!0),()=>$(s)}(t,f(e))},t.dimensionValueTypes=Wn,t.distance=Rr,t.distance2D=function(t,e){const n=Rr(t.x,e.x),s=Rr(t.y,e.y);return Math.sqrt(n**2+s**2)},t.easeIn=C,t.easeInOut=O,t.easeOut=F,t.easingDefinitionToFunction=I,t.fillOffset=be,t.fillWildcards=Oe,t.findDimensionValueType=Nn,t.findValueType=Cs,t.flushKeyframeResolvers=nn,t.frame=K,t.frameData=z,t.frameSteps=U,t.generateLinearEasing=Ht,t.getAnimatableNone=Gn,t.getAnimationMap=Fn,t.getComputedStyle=gs,t.getDefaultValueType=qn,t.getEasingForSegment=B,t.getMixer=jt,t.getValueAsType=Fs,t.getValueTransition=Ln,t.getVariableValue=Bn,t.hasWarned=function(t){return y.has(t)},t.hex=ct,t.hover=function(t,e,n={}){const[s,i,r]=as(t,n),o=t=>{if(!ls(t))return;const{target:n}=t,s=e(n,t);if("function"!=typeof s||!n)return;const r=t=>{ls(t)&&(s(t),n.removeEventListener("pointerleave",r))};n.addEventListener("pointerleave",r,i)};return s.forEach((t=>{t.addEventListener("pointerenter",o,i)})),r},t.hsla=vt,t.hslaToRgba=Ct,t.inView=function(t,e,{root:n,margin:s,amount:i="some"}={}){const r=os(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:Or[i]});return r.forEach((t=>a.observe(t))),()=>a.disconnect()},t.inertia=ve,t.interpolate=we,t.invariant=i,t.invisibleValues=It,t.isBezierDefinition=L,t.isCSSVariableName=Z,t.isCSSVariableToken=J,t.isDragActive=rs,t.isDragging=is,t.isEasingArray=R,t.isGenerator=mn,t.isNodeOrChild=us,t.isNumericalString=o,t.isPrimaryPointer=cs,t.isWaapiSupportedEasing=function t(e){return Boolean("function"==typeof e&&cn()||!e||"string"==typeof e&&(e in dn||cn())||L(e)||Array.isArray(e)&&e.every(t))},t.isZeroValueString=a,t.keyframes=Se,t.mapEasingToNativeEasing=pn,t.mapValue=function(t,e,n,s){const i=Ss(e,n,s);return ks((()=>i(t.get())))},t.maxGeneratorDuration=Xt,t.memo=l,t.microtask=ns,t.millisecondsToSeconds=m,t.mirrorEasing=T,t.mix=Ut,t.mixArray=Kt,t.mixColor=Dt,t.mixComplex=zt,t.mixImmediate=Ft,t.mixLinearColor=Rt,t.mixNumber=Ot,t.mixObject=$t,t.mixVisibility=Wt,t.motionValue=Es,t.moveItem=function([...t],e,n){const s=e<0?t.length+e:e;if(s>=0&&s<t.length){const s=n<0?t.length+n:n,[i]=t.splice(e,1);t.splice(s,0,i)}return t},t.noop=u,t.number=tt,t.numberValueTypes=Hn,t.observeTimeline=ys,t.parseCSSVariable=Rn,t.parseValueFromTransform=Ke,t.percent=pt,t.pipe=h,t.positionalKeys=Dn,t.press=function(t,e,n={}){const[s,i,r]=as(t,n),o=t=>{const s=t.currentTarget;if(!ms(t)||ds.has(s))return;ds.add(s);const r=e(s,t),o=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),ms(t)&&ds.has(s)&&(ds.delete(s),"function"==typeof r&&r(t,{success:e}))},a=t=>{o(t,s===window||s===document||n.useGlobalTarget||us(s,t.target))},l=t=>{o(t,!1)};window.addEventListener("pointerup",a,i),window.addEventListener("pointercancel",l,i)};return s.forEach((t=>{var e;(n.useGlobalTarget?window:t).addEventListener("pointerdown",o,i),t instanceof HTMLElement&&(t.addEventListener("focus",(t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const s=ps((()=>{if(ds.has(n))return;fs(n,"down");const t=ps((()=>{fs(n,"up")}));n.addEventListener("keyup",t,e),n.addEventListener("blur",(()=>fs(n,"cancel")),e)}));n.addEventListener("keydown",s,e),n.addEventListener("blur",(()=>n.removeEventListener("keydown",s)),e)})(t,i))),e=t,hs.has(e.tagName)||-1!==e.tabIndex||t.hasAttribute("tabindex")||(t.tabIndex=0))})),r},t.progress=d,t.progressPercentage=yt,t.px=ft,t.readTransformValue=$e,t.recordStats=function(){if(N.value)throw xs(),new Error("Stats are already being measured");const t=N;return t.value={frameloop:{setup:[],rate:[],read:[],resolveKeyframes:[],preUpdate:[],update:[],preRender:[],render:[],postRender:[]},animations:{mainThread:[],waapi:[],layout:[]},layoutProjection:{nodes:[],calculatedTargetDeltas:[],calculatedProjections:[]}},t.addProjectionMetrics=e=>{const{layoutProjection:n}=t.value;n.nodes.push(e.nodes),n.calculatedTargetDeltas.push(e.calculatedTargetDeltas),n.calculatedProjections.push(e.calculatedProjections)},K.postRender(vs,!0),Ms},t.removeItem=n,t.resolveElements=os,t.reverseEasing=x,t.rgbUnit=lt,t.rgba=ut,t.scale=nt,t.scroll=function(t,{axis:e="y",container:n=document.documentElement,...s}={}){const i={axis:e,container:n,...s};return"function"==typeof t?function(t,e){return function(t){return 2===t.length}(t)?Pr((n=>{t(n[e.axis].progress,n)}),e):ys(t,Fr(e))}(t,i):function(t,e){const n=Fr(e);return t.attachTimeline({timeline:e.target?void 0:n,observe:t=>(t.pause(),ys((e=>{t.time=t.duration*e}),n))})}(t,i)},t.scrollInfo=Pr,t.secondsToMilliseconds=f,t.setDragLock=function(t){return"x"===t||"y"===t?is[t]?null:(is[t]=!0,()=>{is[t]=!1}):is.x||is.y?null:(is.x=is.y=!0,()=>{is.x=is.y=!1})},t.setStyle=on,t.spring=ye,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=I(s)(l/e)*e}return e+l}},t.startWaapiAnimation=fn,t.statsBuffer=N,t.steps=function(t,e="end"){return n=>{const i=(n="end"===e?Math.min(n,.999):Math.max(n,.001))*t,r="end"===e?Math.floor(i):Math.ceil(i);return s(0,1,r/t)}},t.supportedWaapiEasing=dn,t.supportsBrowserAnimation=Sn,t.supportsFlags=ln,t.supportsLinearEasing=cn,t.supportsPartialKeyframes=ts,t.supportsScrollTimeline=an,t.sync=qs,t.testValueType=In,t.time=X,t.transform=Ss,t.transformPropOrder=Ue,t.transformProps=Ye,t.transformValue=ks,t.transformValueTypes=Yn,t.velocityPerSecond=g,t.vh=mt,t.vw=gt,t.warnOnce=function(t,e,n){t||y.has(e)||(console.warn(e),n&&console.warn(n),y.add(e))},t.warning=()=>{},t.wrap=v}));
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";function e(t,e){-1===t.indexOf(e)&&t.push(e)}function n(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const s=(t,e,n)=>n>e?e:n<t?t:n;let i=()=>{};const r={},o=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),a=t=>/^0[^.\s]+$/u.test(t);function l(t){let e;return()=>(void 0===e&&(e=t()),e)}const u=t=>t,c=(t,e)=>n=>e(t(n)),h=(...t)=>t.reduce(c),d=(t,e,n)=>{const s=e-t;return 0===s?1:(n-t)/s};class p{constructor(){this.subscriptions=[]}add(t){return e(this.subscriptions,t),()=>n(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}}const f=t=>1e3*t,m=t=>t/1e3;function g(t,e){return e?t*(1e3/e):0}const y=new Set;const v=(t,e,n)=>{const s=e-t;return((n-t)%s+s)%s+t},w=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function b(t,e,n,s){if(t===e&&n===s)return u;const i=e=>function(t,e,n,s,i){let r,o,a=0;do{o=e+(n-e)/2,r=w(o,s,i)-t,r>0?n=o:e=o}while(Math.abs(r)>1e-7&&++a<12);return o}(e,0,1,t,n);return t=>0===t||1===t?t:w(i(t),e,s)}const T=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,x=t=>e=>1-t(1-e),M=b(.33,1.53,.69,.99),S=x(M),V=T(S),A=t=>(t*=2)<1?.5*S(t):.5*(2-Math.pow(2,-10*(t-1))),E=t=>1-Math.sin(Math.acos(t)),k=x(E),P=T(E),C=b(.42,0,1,1),F=b(0,0,.58,1),O=b(.42,0,.58,1);const R=t=>Array.isArray(t)&&"number"!=typeof t[0];function B(t,e){return R(t)?t[v(0,t.length,e)]:t}const L=t=>Array.isArray(t)&&"number"==typeof t[0],D={linear:u,easeIn:C,easeInOut:O,easeOut:F,circIn:E,circInOut:P,circOut:k,backIn:S,backInOut:V,backOut:M,anticipate:A},I=t=>{if(L(t)){t.length;const[e,n,s,i]=t;return b(e,n,s,i)}return"string"==typeof t?D[t]:t},W=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],N={value:null,addProjectionMetrics:null};function j(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,a=W.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&&N.value&&N.value.frameloop[e].push(l),l=0,n.clear(),i=!1,r&&(r=!1,c.process(t)))}};return c}(o,e?n:void 0),t)),{}),{setup:l,read:u,resolveKeyframes:c,preUpdate:h,update:d,preRender:p,render:f,postRender:m}=a,g=()=>{const o=r.useManualTiming?i.timestamp:performance.now();n=!1,r.useManualTiming||(i.delta=s?1e3/60:Math.max(Math.min(o-i.timestamp,40),1)),i.timestamp=o,i.isProcessing=!0,l.process(i),u.process(i),c.process(i),h.process(i),d.process(i),p.process(i),f.process(i),m.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(g))};return{schedule:W.reduce(((e,r)=>{const o=a[r];return e[r]=(e,r=!1,a=!1)=>(n||(n=!0,s=!0,i.isProcessing||t(g)),o.schedule(e,r,a)),e}),{}),cancel:t=>{for(let e=0;e<W.length;e++)a[W[e]].cancel(t)},state:i,steps:a}}const{schedule:K,cancel:$,state:z,steps:U}=j("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:u,!0);let Y;function H(){Y=void 0}const X={now:()=>(void 0===Y&&X.set(z.isProcessing||r.useManualTiming?z.timestamp:performance.now()),Y),set:t=>{Y=t,queueMicrotask(H)}},q={layout:0,mainThread:0,waapi:0},G=t=>e=>"string"==typeof e&&e.startsWith(t),Z=G("--"),_=G("var(--"),J=t=>!!_(t)&&Q.test(t.split("/*")[0].trim()),Q=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,tt={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},et={...tt,transform:t=>s(0,1,t)},nt={...tt,default:1},st=t=>Math.round(1e5*t)/1e5,it=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const rt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,ot=(t,e)=>n=>Boolean("string"==typeof n&&rt.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),at=(t,e,n)=>s=>{if("string"!=typeof s)return s;const[i,r,o,a]=s.match(it);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(o),alpha:void 0!==a?parseFloat(a):1}},lt={...tt,transform:t=>Math.round((t=>s(0,255,t))(t))},ut={test:ot("rgb","red"),parse:at("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+lt.transform(t)+", "+lt.transform(e)+", "+lt.transform(n)+", "+st(et.transform(s))+")"};const ct={test:ot("#"),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:ut.transform},ht=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),dt=ht("deg"),pt=ht("%"),ft=ht("px"),mt=ht("vh"),gt=ht("vw"),yt=(()=>({...pt,parse:t=>pt.parse(t)/100,transform:t=>pt.transform(100*t)}))(),vt={test:ot("hsl","hue"),parse:at("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+pt.transform(st(e))+", "+pt.transform(st(n))+", "+st(et.transform(s))+")"},wt={test:t=>ut.test(t)||ct.test(t)||vt.test(t),parse:t=>ut.test(t)?ut.parse(t):vt.test(t)?vt.parse(t):ct.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?ut.transform(t):vt.transform(t)},bt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const Tt="number",xt="color",Mt=/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 St(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const o=e.replace(Mt,(t=>(wt.test(t)?(s.color.push(r),i.push(xt),n.push(wt.parse(t))):t.startsWith("var(")?(s.var.push(r),i.push("var"),n.push(t)):(s.number.push(r),i.push(Tt),n.push(parseFloat(t))),++r,"${}"))).split("${}");return{values:n,split:o,indexes:s,types:i}}function Vt(t){return St(t).values}function At(t){const{split:e,types:n}=St(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+=e===Tt?st(t[r]):e===xt?wt.transform(t[r]):t[r]}return i}}const Et=t=>"number"==typeof t?0:t;const kt={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(it)?.length||0)+(t.match(bt)?.length||0)>0},parse:Vt,createTransformer:At,getAnimatableNone:function(t){const e=Vt(t);return At(t)(e.map(Et))}};function Pt(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 Ct({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=Pt(a,s,t+1/3),r=Pt(a,s,t),o=Pt(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}}function Ft(t,e){return n=>n>0?e:t}const Ot=(t,e,n)=>t+(e-t)*n,Rt=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},Bt=[ct,ut,vt];function Lt(t){const e=(n=t,Bt.find((t=>t.test(n))));var n;if(!Boolean(e))return!1;let s=e.parse(t);return e===vt&&(s=Ct(s)),s}const Dt=(t,e)=>{const n=Lt(t),s=Lt(e);if(!n||!s)return Ft(t,e);const i={...n};return t=>(i.red=Rt(n.red,s.red,t),i.green=Rt(n.green,s.green,t),i.blue=Rt(n.blue,s.blue,t),i.alpha=Ot(n.alpha,s.alpha,t),ut.transform(i))},It=new Set(["none","hidden"]);function Wt(t,e){return It.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function Nt(t,e){return n=>Ot(t,e,n)}function jt(t){return"number"==typeof t?Nt:"string"==typeof t?J(t)?Ft:wt.test(t)?Dt:zt:Array.isArray(t)?Kt:"object"==typeof t?wt.test(t)?Dt:$t:Ft}function Kt(t,e){const n=[...t],s=n.length,i=t.map(((t,n)=>jt(t)(t,e[n])));return t=>{for(let e=0;e<s;e++)n[e]=i[e](t);return n}}function $t(t,e){const n={...t,...e},s={};for(const i in n)void 0!==t[i]&&void 0!==e[i]&&(s[i]=jt(t[i])(t[i],e[i]));return t=>{for(const e in s)n[e]=s[e](t);return n}}const zt=(t,e)=>{const n=kt.createTransformer(e),s=St(t),i=St(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?It.has(t)&&!i.values.length||It.has(e)&&!s.values.length?Wt(t,e):h(Kt(function(t,e){const n=[],s={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const r=e.types[i],o=t.indexes[r][s[r]],a=t.values[o]??0;n[i]=a,s[r]++}return n}(s,i),i.values),n):Ft(t,e)};function Ut(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return Ot(t,e,n);return jt(t)(t,e)}const Yt=t=>{const e=({timestamp:e})=>t(e);return{start:()=>K.update(e,!0),stop:()=>$(e),now:()=>z.isProcessing?z.timestamp:X.now()}},Ht=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let e=0;e<i;e++)s+=t(e/(i-1))+", ";return`linear(${s.substring(0,s.length-2)})`},Xt=2e4;function qt(t){let e=0;let n=t.next(e);for(;!n.done&&e<Xt;)e+=50,n=t.next(e);return e>=Xt?1/0:e}function Gt(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(qt(s),Xt);return{type:"keyframes",ease:t=>s.next(i*t).value/e,duration:m(i)}}function Zt(t,e,n){const s=Math.max(e-5,0);return g(n-t(s),e-s)}const _t=100,Jt=10,Qt=1,te=0,ee=800,ne=.3,se=.3,ie={granular:.01,default:2},re={granular:.005,default:.5},oe=.01,ae=10,le=.05,ue=1,ce=.001;function he({duration:t=ee,bounce:e=ne,velocity:n=te,mass:i=Qt}){let r,o,a=1-e;a=s(le,ue,a),t=s(oe,ae,m(t)),a<1?(r=e=>{const s=e*a,i=s*t,r=s-n,o=pe(e,a),l=Math.exp(-i);return ce-r/o*l},o=e=>{const s=e*a*t,i=s*n+n,o=Math.pow(a,2)*Math.pow(e,2)*t,l=Math.exp(-s),u=pe(Math.pow(e,2),a);return(-r(e)+ce>0?-1:1)*((i-o)*l)/u}):(r=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,o=e=>Math.exp(-e*t)*(t*t*(n-e)));const l=function(t,e,n){let s=n;for(let n=1;n<de;n++)s-=t(s)/e(s);return s}(r,o,5/t);if(t=f(t),isNaN(l))return{stiffness:_t,damping:Jt,duration:t};{const e=Math.pow(l,2)*i;return{stiffness:e,damping:2*a*Math.sqrt(i*e),duration:t}}}const de=12;function pe(t,e){return t*Math.sqrt(1-e*e)}const fe=["duration","bounce"],me=["stiffness","damping","mass"];function ge(t,e){return e.some((e=>void 0!==t[e]))}function ye(t=se,e=ne){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:r}=n;const o=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],l={done:!1,value:o},{stiffness:u,damping:c,mass:h,duration:d,velocity:p,isResolvedFromDuration:g}=function(t){let e={velocity:te,stiffness:_t,damping:Jt,mass:Qt,isResolvedFromDuration:!1,...t};if(!ge(t,me)&&ge(t,fe))if(t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(1.2*n),r=i*i,o=2*s(.05,1,1-(t.bounce||0))*Math.sqrt(r);e={...e,mass:Qt,stiffness:r,damping:o}}else{const n=he(t);e={...e,...n,mass:Qt},e.isResolvedFromDuration=!0}return e}({...n,velocity:-m(n.velocity||0)}),y=p||0,v=c/(2*Math.sqrt(u*h)),w=a-o,b=m(Math.sqrt(u/h)),T=Math.abs(w)<5;let x;if(i||(i=T?ie.granular:ie.default),r||(r=T?re.granular:re.default),v<1){const t=pe(b,v);x=e=>{const n=Math.exp(-v*b*e);return a-n*((y+v*b*w)/t*Math.sin(t*e)+w*Math.cos(t*e))}}else if(1===v)x=t=>a-Math.exp(-b*t)*(w+(y+b*w)*t);else{const t=b*Math.sqrt(v*v-1);x=e=>{const n=Math.exp(-v*b*e),s=Math.min(t*e,300);return a-n*((y+v*b*w)*Math.sinh(s)+t*w*Math.cosh(s))/t}}const M={calculatedDuration:g&&d||null,next:t=>{const e=x(t);if(g)l.done=t>=d;else{let n=0===t?y:0;v<1&&(n=0===t?f(y):Zt(x,t,e));const s=Math.abs(n)<=i,o=Math.abs(a-e)<=r;l.done=s&&o}return l.value=l.done?a:e,l},toString:()=>{const t=Math.min(qt(M),Xt),e=Ht((e=>M.next(t*e).value),t,30);return t+"ms "+e},toTransition:()=>{}};return M}function ve({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 y=t=>-f*Math.exp(-t/s),v=t=>g+y(t),w=t=>{const e=y(t),n=v(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=ye({keyframes:[d.value,p(d.value)],velocity:Zt(v,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)}}}function we(t,e,{clamp:n=!0,ease:i,mixer:o}={}){const a=t.length;if(e.length,1===a)return()=>e[0];if(2===a&&e[0]===e[1])return()=>e[1];const l=t[0]===t[1];t[0]>t[a-1]&&(t=[...t].reverse(),e=[...e].reverse());const c=function(t,e,n){const s=[],i=n||r.mix||Ut,o=t.length-1;for(let n=0;n<o;n++){let r=i(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]||u:e;r=h(t,r)}s.push(r)}return s}(e,i,o),p=c.length,f=n=>{if(l&&n<t[0])return e[0];let s=0;if(p>1)for(;s<t.length-2&&!(n<t[s+1]);s++);const i=d(t[s],t[s+1],n);return c[s](i)};return n?e=>f(s(t[0],t[a-1],e)):f}function be(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=d(0,e,s);t.push(Ot(n,1,i))}}function Te(t){const e=[0];return be(e,t.length-1),e}function xe(t,e){return t.map((t=>t*e))}function Me(t,e){return t.map((()=>e||O)).splice(0,t.length-1)}function Se({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=R(s)?s.map(I):I(s),r={done:!1,value:e[0]},o=we(xe(n&&n.length===e.length?n:Te(e),t),e,{ease:Array.isArray(i)?i:Me(e,i)});return{calculatedDuration:t,next:e=>(r.value=o(e),r.done=e>=t,r)}}ye.applyToOptions=t=>{const e=Gt(t,100,ye);return t.ease=e.ease,t.duration=f(e.duration),t.type="keyframes",t};const Ve=t=>null!==t;function Ae(t,{repeat:e,repeatType:n="loop"},s,i=1){const r=t.filter(Ve),o=i<0||e&&"loop"!==n&&e%2==1?0:r.length-1;return o&&void 0!==s?s:r[o]}const Ee={decay:ve,inertia:ve,tween:Se,keyframes:Se,spring:ye};function ke(t){"string"==typeof t.type&&(t.type=Ee[t.type])}class Pe{constructor(){this.count=0,this.updateFinished()}get finished(){return this._finished}updateFinished(){this.count++,this._finished=new Promise((t=>{this.resolve=t}))}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const Ce=t=>t/100;class Fe extends Pe{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:t}=this.options;if(t&&t.updatedAt!==X.now()&&this.tick(X.now()),this.isStopped=!0,"idle"===this.state)return;this.teardown();const{onStop:e}=this.options;e&&e()},q.mainThread++,this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;ke(t);const{type:e=Se,repeat:n=0,repeatDelay:s=0,repeatType:i,velocity:r=0}=t;let{keyframes:o}=t;const a=e||Se;a!==Se&&"number"!=typeof o[0]&&(this.mixKeyframes=h(Ce,Ut(o[0],o[1])),o=[0,100]);const l=a({...t,keyframes:o});"mirror"===i&&(this.mirroredGenerator=a({...t,keyframes:[...o].reverse(),velocity:-r})),null===l.calculatedDuration&&(l.calculatedDuration=qt(l));const{calculatedDuration:u}=l;this.calculatedDuration=u,this.resolvedDuration=u+s,this.totalDuration=this.resolvedDuration*(n+1)-s,this.generator=l}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:n,totalDuration:i,mixKeyframes:r,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:l}=this;if(null===this.startTime)return n.next(0);const{delay:u=0,keyframes:c,repeat:h,repeatType:d,repeatDelay:p,type:f,onUpdate:m,finalKeyframe:g}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const y=this.currentTime-u*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?y<0:y>i;this.currentTime=Math.max(y,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);let w=this.currentTime,b=n;if(h){const t=Math.min(this.currentTime,i)/a;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,h+1);Boolean(e%2)&&("reverse"===d?(n=1-n,p&&(n-=p/a)):"mirror"===d&&(b=o)),w=s(0,1,n)*a}const T=v?{done:!1,value:c[0]}:b.next(w);r&&(T.value=r(T.value));let{done:x}=T;v||null===l||(x=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const M=null===this.holdTime&&("finished"===this.state||"running"===this.state&&x);return M&&f!==ve&&(T.value=Ae(c,this.options,g,this.speed)),m&&m(T.value),M&&this.finish(),T}then(t,e){return this.finished.then(t,e)}get duration(){return m(this.calculatedDuration)}get time(){return m(this.currentTime)}set time(t){t=f(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(X.now());const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=m(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=Yt,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:"finished"===this.state?(this.updateFinished(),this.startTime=s):this.startTime||(this.startTime=n??s),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(X.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown()}teardown(){this.notifyFinished(),this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null,q.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),t.observe(this)}}function Oe(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const Re=t=>180*t/Math.PI,Be=t=>{const e=Re(Math.atan2(t[1],t[0]));return De(e)},Le={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Be,rotateZ:Be,skewX:t=>Re(Math.atan(t[1])),skewY:t=>Re(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},De=t=>((t%=360)<0&&(t+=360),t),Ie=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),We=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Ne={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ie,scaleY:We,scale:t=>(Ie(t)+We(t))/2,rotateX:t=>De(Re(Math.atan2(t[6],t[5]))),rotateY:t=>De(Re(Math.atan2(-t[2],t[0]))),rotateZ:Be,rotate:Be,skewX:t=>Re(Math.atan(t[4])),skewY:t=>Re(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function je(t){return t.includes("scale")?1:0}function Ke(t,e){if(!t||"none"===t)return je(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=Ne,i=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=Le,i=e}if(!i)return je(e);const r=s[e],o=i[1].split(",").map(ze);return"function"==typeof r?r(o):o[r]}const $e=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Ke(n,e)};function ze(t){return parseFloat(t.trim())}const Ue=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ye=(()=>new Set(Ue))(),He=t=>t===tt||t===ft,Xe=new Set(["x","y","z"]),qe=Ue.filter((t=>!Xe.has(t)));const Ge={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:(t,{transform:e})=>Ke(e,"x"),y:(t,{transform:e})=>Ke(e,"y")};Ge.translateX=Ge.x,Ge.translateY=Ge.y;const Ze=new Set;let _e=!1,Je=!1,Qe=!1;function tn(){if(Je){const t=Array.from(Ze).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 qe.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])=>{t.getValue(e)?.set(n)}))})),t.forEach((t=>t.measureEndState())),t.forEach((t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)}))}Je=!1,_e=!1,Ze.forEach((t=>t.complete(Qe))),Ze.clear()}function en(){Ze.forEach((t=>{t.readKeyframes(),t.needsMeasurement&&(Je=!0)}))}function nn(){Qe=!0,en(),tn(),Qe=!1}class sn{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?(Ze.add(this),_e||(_e=!0,K.read(en),K.resolveKeyframes(tn))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:s}=this;if(null===t[0]){const i=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])}Oe(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Ze.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Ze.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const rn=t=>t.startsWith("--");function on(t,e,n){rn(e)?t.style.setProperty(e,n):t.style[e]=n}const an=l((()=>void 0!==window.ScrollTimeline)),ln={};function un(t,e){const n=l(t);return()=>ln[e]??n()}const cn=un((()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0}),"linearEasing"),hn=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,dn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:hn([0,.65,.55,1]),circOut:hn([.55,0,1,.45]),backIn:hn([.31,.01,.66,-.59]),backOut:hn([.33,1.53,.69,.99])};function pn(t,e){return t?"function"==typeof t?cn()?Ht(t,e):"ease-out":L(t)?hn(t):Array.isArray(t)?t.map((t=>pn(t,e)||dn.easeOut)):dn[t]:void 0}function fn(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:o="loop",ease:a="easeOut",times:l}={},u=void 0){const c={[e]:n};l&&(c.offset=l);const h=pn(a,i);Array.isArray(h)&&(c.easing=h),N.value&&q.waapi++;const d={delay:s,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:r+1,direction:"reverse"===o?"alternate":"normal"};u&&(d.pseudoElement=u);const p=t.animate(c,d);return N.value&&p.finished.finally((()=>{q.waapi--})),p}function mn(t){return"function"==typeof t&&"applyToOptions"in t}function gn({type:t,...e}){return mn(t)&&cn()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class yn extends Pe{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:e,name:n,keyframes:s,pseudoElement:i,allowFlatten:r=!1,finalKeyframe:o,onComplete:a}=t;this.isPseudoElement=Boolean(i),this.allowFlatten=r,this.options=t,t.type;const l=gn(t);this.animation=fn(e,n,s,l,i),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const t=Ae(s,this.options,o,this.speed);this.updateMotionValue?this.updateMotionValue(t):on(e,n,t),this.animation.cancel()}a?.(),this.notifyFinished()},this.animation.oncancel=()=>this.notifyFinished()}play(){this.isStopped||(this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return m(Number(t))}get time(){return m(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=f(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:e}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&an()?(this.animation.timeline=t,u):e(this)}}const vn={anticipate:A,backInOut:V,circInOut:P};function wn(t){"string"==typeof t.ease&&t.ease in vn&&(t.ease=vn[t.ease])}class bn extends yn{constructor(t){wn(t),ke(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:n,onComplete:s,element:i,...r}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const o=new Fe({...r,autoplay:!1}),a=f(this.finishedTime??this.time);e.setWithVelocity(o.sample(a-10).value,o.sample(a).value,10),o.stop()}}const Tn=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!kt.test(t)&&"0"!==t||t.startsWith("url(")));const xn=new Set(["opacity","clipPath","filter","transform"]),Mn=l((()=>Object.hasOwnProperty.call(Element.prototype,"animate")));function Sn(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 Mn()&&n&&xn.has(n)&&("transform"!==n||!l)&&!a&&!s&&"mirror"!==i&&0!==r&&"inertia"!==o}class Vn extends Pe{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:r="loop",keyframes:o,name:a,motionValue:l,element:u,...c}){super(),this.stop=()=>{this._animation?(this._animation.stop(),this.stopTimeline?.()):this.keyframeResolver?.cancel()},this.createdAt=X.now();const h={autoplay:t,delay:e,type:n,repeat:s,repeatDelay:i,repeatType:r,name:a,motionValue:l,element:u,...c},d=u?.KeyframeResolver||sn;this.keyframeResolver=new d(o,((t,e,n)=>this.onKeyframesResolved(t,e,h,!n)),a,l,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,e,n,s){this.keyframeResolver=void 0;const{name:i,type:o,velocity:a,delay:l,isHandoff:c,onUpdate:h}=n;this.resolvedAt=X.now(),function(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=Tn(i,e),a=Tn(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||mn(n))&&s)}(t,i,o,a)||(!r.instantAnimations&&l||h?.(Ae(t,n,e)),t[0]=t[t.length-1],n.duration=0,n.repeat=0);const d={startTime:s?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:e,...n,keyframes:t},p=!c&&Sn(d)?new bn({...d,element:d.motionValue.owner.current}):new Fe(d);p.finished.then((()=>this.notifyFinished())).catch(u),this.pendingTimeline&&(this.stopTimeline=p.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=p}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then((()=>{}))}get animation(){return this._animation||nn(),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this.animation.cancel()}}class An{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map((t=>t.finished)))}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){const e=this.animations.map((e=>e.attachTimeline(t)));return()=>{e.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 state(){return this.getAll("state")}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]()))}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class En extends An{then(t,e){return this.finished.finally(t).then((()=>{}))}}class kn extends yn{constructor(t){super(),this.animation=t,t.onfinish=()=>{this.finishedTime=this.time,this.notifyFinished()}}}const Pn=new WeakMap,Cn=(t,e="")=>`${t}:${e}`;function Fn(t){const e=Pn.get(t)||new Map;return Pn.set(t,e),e}const On=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Rn(t){const e=On.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}function Bn(t,e,n=1){const[s,i]=Rn(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);if(r){const t=r.trim();return o(t)?parseFloat(t):t}return J(i)?Bn(i,e,n+1):i}function Ln(t,e){return t?.[e]??t?.default??t}const Dn=new Set(["width","height","top","left","right","bottom",...Ue]),In=t=>e=>e.test(t),Wn=[tt,ft,pt,dt,gt,mt,{test:t=>"auto"===t,parse:t=>t}],Nn=t=>Wn.find(In(t));const jn=new Set(["brightness","contrast","saturate","opacity"]);function Kn(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[s]=n.match(it)||[];if(!s)return t;const i=n.replace(s,"");let r=jn.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const $n=/\b([a-z-]*)\(.*?\)/gu,zn={...kt,getAnimatableNone:t=>{const e=t.match($n);return e?e.map(Kn).join(" "):t}},Un={...tt,transform:Math.round},Yn={rotate:dt,rotateX:dt,rotateY:dt,rotateZ:dt,scale:nt,scaleX:nt,scaleY:nt,scaleZ:nt,skew:dt,skewX:dt,skewY:dt,distance:ft,translateX:ft,translateY:ft,translateZ:ft,x:ft,y:ft,z:ft,perspective:ft,transformPerspective:ft,opacity:et,originX:yt,originY:yt,originZ:ft},Hn={borderWidth:ft,borderTopWidth:ft,borderRightWidth:ft,borderBottomWidth:ft,borderLeftWidth:ft,borderRadius:ft,radius:ft,borderTopLeftRadius:ft,borderTopRightRadius:ft,borderBottomRightRadius:ft,borderBottomLeftRadius:ft,width:ft,maxWidth:ft,height:ft,maxHeight:ft,top:ft,right:ft,bottom:ft,left:ft,padding:ft,paddingTop:ft,paddingRight:ft,paddingBottom:ft,paddingLeft:ft,margin:ft,marginTop:ft,marginRight:ft,marginBottom:ft,marginLeft:ft,backgroundPositionX:ft,backgroundPositionY:ft,...Yn,zIndex:Un,fillOpacity:et,strokeOpacity:et,numOctaves:Un},Xn={...Hn,color:wt,backgroundColor:wt,outlineColor:wt,fill:wt,stroke:wt,borderColor:wt,borderTopColor:wt,borderRightColor:wt,borderBottomColor:wt,borderLeftColor:wt,filter:zn,WebkitFilter:zn},qn=t=>Xn[t];function Gn(t,e){let n=qn(t);return n!==zn&&(n=kt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Zn=new Set(["auto","none","0"]);class _n extends sn{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(),J(s))){const i=Bn(s,e.current);void 0!==i&&(t[n]=i),n===t.length-1&&(this.finalKeyframe=s)}}if(this.resolveNoneKeyframes(),!Dn.has(n)||2!==t.length)return;const[s,i]=t,r=Nn(s),o=Nn(i);if(r!==o)if(He(r)&&He(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++)(null===t[e]||("number"==typeof(s=t[e])?0===s:null===s||"none"===s||"0"===s||a(s)))&&n.push(e);var s;n.length&&function(t,e,n){let s,i=0;for(;i<t.length&&!s;){const e=t[i];"string"==typeof e&&!Zn.has(e)&&St(e).values.length&&(s=t[i]),i++}if(s&&n)for(const i of e)t[i]=Gn(n,s)}(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=Ge[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(){const{element:t,name:e,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const s=t.getValue(e);s&&s.jump(this.measuredOrigin,!1);const i=n.length-1,r=n[i];n[i]=Ge[e](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==r&&void 0===this.finalKeyframe&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach((([e,n])=>{t.getValue(e).set(n)})),this.resolveNoneKeyframes()}}const Jn=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","radius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","width","maxWidth","height","maxHeight","top","right","bottom","left","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","margin","marginTop","marginRight","marginBottom","marginLeft","backgroundPositionX","backgroundPositionY"]);function Qn(t,e){for(let n=0;n<t.length;n++)"number"==typeof t[n]&&Jn.has(e)&&(t[n]=t[n]+"px")}const ts=l((()=>{try{document.createElement("div").animate({opacity:[1]})}catch(t){return!1}return!0})),es=new Set(["opacity","clipPath","filter","transform"]);function ns(t,e,n){if(t instanceof EventTarget)return[t];if("string"==typeof t){let s=document;e&&(s=e.current);const i=n?.[t]??s.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t)}const{schedule:ss,cancel:is}=j(queueMicrotask,!1),rs={x:!1,y:!1};function os(){return rs.x||rs.y}function as(t,e){const n=ns(t),s=new AbortController;return[n,{passive:!0,...e,signal:s.signal},()=>s.abort()]}function ls(t){return!("touch"===t.pointerType||os())}const us=(t,e)=>!!e&&(t===e||us(t,e.parentElement)),cs=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,hs=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const ds=new WeakSet;function ps(t){return e=>{"Enter"===e.key&&t(e)}}function fs(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function ms(t){return cs(t)&&!os()}function gs(t,e){const n=window.getComputedStyle(t);return rn(e)?n.getPropertyValue(e):n[e]}function ys(t,e){let n;const s=()=>{const{currentTime:s}=e,i=(null===s?0:s.value)/100;n!==i&&t(i),n=i};return K.preUpdate(s,!0),()=>$(s)}function vs(){const{value:t}=N;null!==t?(t.frameloop.rate.push(z.delta),t.animations.mainThread.push(q.mainThread),t.animations.waapi.push(q.waapi),t.animations.layout.push(q.layout)):$(vs)}function ws(t){return t.reduce(((t,e)=>t+e),0)/t.length}function bs(t,e=ws){return 0===t.length?{min:0,max:0,avg:0}:{min:Math.min(...t),max:Math.max(...t),avg:e(t)}}const Ts=t=>Math.round(1e3/t);function xs(){N.value=null,N.addProjectionMetrics=null}function Ms(){const{value:t}=N;if(!t)throw new Error("Stats are not being measured");xs(),$(vs);const e={frameloop:{setup:bs(t.frameloop.setup),rate:bs(t.frameloop.rate),read:bs(t.frameloop.read),resolveKeyframes:bs(t.frameloop.resolveKeyframes),preUpdate:bs(t.frameloop.preUpdate),update:bs(t.frameloop.update),preRender:bs(t.frameloop.preRender),render:bs(t.frameloop.render),postRender:bs(t.frameloop.postRender)},animations:{mainThread:bs(t.animations.mainThread),waapi:bs(t.animations.waapi),layout:bs(t.animations.layout)},layoutProjection:{nodes:bs(t.layoutProjection.nodes),calculatedTargetDeltas:bs(t.layoutProjection.calculatedTargetDeltas),calculatedProjections:bs(t.layoutProjection.calculatedProjections)}},{rate:n}=e.frameloop;return n.min=Ts(n.min),n.max=Ts(n.max),n.avg=Ts(n.avg),[n.min,n.max]=[n.max,n.min],e}function Ss(...t){const e=!Array.isArray(t[0]),n=e?0:-1,s=t[0+n],i=we(t[1+n],t[2+n],t[3+n]);return e?i(s):i}const Vs={current:void 0};class As{constructor(t,e={}){this.version="12.9.0",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(t,e=!0)=>{const n=X.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&this.events.change?.notify(this.current),e&&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=X.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 p);const n=this.events[t].add(e);return"change"===t?()=>{n(),K.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 Vs.current&&Vs.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=X.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return g(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.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Es(t,e){return new As(t,e)}function ks(t){const e=[];Vs.current=e;const n=t();Vs.current=void 0;const s=Es(n);return function(t,e,n){const s=()=>e.set(n()),i=()=>K.preRender(s,!1,!0),r=t.map((t=>t.on("change",i)));e.on("destroy",(()=>{r.forEach((t=>t())),$(s)}))}(e,s,t),s}const Ps=[...Wn,wt,kt],Cs=t=>Ps.find(In(t)),Fs=(t,e)=>e&&"number"==typeof t?e.transform(t):t;function Os(t){return"layout"===t?"group":"enter"===t||"new"===t?"new":"exit"===t||"old"===t?"old":"group"}let Rs={},Bs=null;const Ls=(t,e)=>{Rs[t]=e},Ds=()=>{Bs||(Bs=document.createElement("style"),Bs.id="motion-view");let t="";for(const e in Rs){const n=Rs[e];t+=`${e} {\n`;for(const[e,s]of Object.entries(n))t+=` ${e}: ${s};\n`;t+="}\n"}Bs.textContent=t,document.head.appendChild(Bs),Rs={}},Is=()=>{Bs&&Bs.parentElement&&Bs.parentElement.removeChild(Bs)};function Ws(t){const e=t.match(/::view-transition-(old|new|group|image-pair)\((.*?)\)/);return e?{layer:e[2],type:e[1]}:null}function Ns(t){const{effect:e}=t;return!!e&&(e.target===document.documentElement&&e.pseudoElement?.startsWith("::view-transition"))}const js=["layout","enter","exit","new","old"];function Ks(t){const{update:e,targets:n,options:s}=t;if(!document.startViewTransition)return new Promise((async t=>{await e(),t(new An([]))}));(function(t,e){return e.has(t)&&Object.keys(e.get(t)).length>0})("root",n)||Ls(":root",{"view-transition-name":"none"}),Ls("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)",{"animation-timing-function":"linear !important"}),Ds();const i=document.startViewTransition((async()=>{await e()}));return i.finished.finally((()=>{Is()})),new Promise((t=>{i.ready.then((()=>{const e=document.getAnimations().filter(Ns),i=[];n.forEach(((t,e)=>{for(const n of js){if(!t[n])continue;const{keyframes:r,options:o}=t[n];for(let[t,a]of Object.entries(r)){if(!a)continue;const r={...Ln(s,t),...Ln(o,t)},l=Os(n);if("opacity"===t&&!Array.isArray(a)){a=["new"===l?0:1,a]}"function"==typeof r.delay&&(r.delay=r.delay(0,1)),r.duration&&(r.duration=f(r.duration)),r.delay&&(r.delay=f(r.delay));const u=new yn({...r,element:document.documentElement,name:t,pseudoElement:`::view-transition-${l}(${e})`,keyframes:a});i.push(u)}}}));for(const t of e){if("finished"===t.playState)continue;const{effect:e}=t;if(!(e&&e instanceof KeyframeEffect))continue;const{pseudoElement:r}=e;if(!r)continue;const o=Ws(r);if(!o)continue;const a=n.get(o.layer);if(a)$s(a,"enter")&&$s(a,"exit")&&e.getKeyframes().some((t=>t.mixBlendMode))?i.push(new kn(t)):t.cancel();else{const n="group"===o.type?"layout":"";let r={...Ln(s,n)};r.duration&&(r.duration=f(r.duration)),r=gn(r);const a=pn(r.ease,r.duration);e.updateTiming({delay:f(r.delay??0),duration:r.duration,easing:a}),i.push(new kn(t))}}t(new An(i))}))}))}function $s(t,e){return t?.[e]?.keyframes.opacity}let zs=[],Us=null;function Ys(){Us=null;const[t]=zs;var e;t&&(n(zs,e=t),Us=e,Ks(e).then((t=>{e.notifyReady(t),t.finished.finally(Ys)})))}function Hs(){for(let t=zs.length-1;t>=0;t--){const e=zs[t],{interrupt:n}=e.options;if("immediate"===n){const n=zs.slice(0,t+1).map((t=>t.update)),s=zs.slice(t+1);e.update=()=>{n.forEach((t=>t()))},zs=[e,...s];break}}Us&&"immediate"!==zs[0]?.options.interrupt||Ys()}class Xs{constructor(t,e={}){var n;this.currentTarget="root",this.targets=new Map,this.notifyReady=u,this.readyPromise=new Promise((t=>{this.notifyReady=t})),this.update=t,this.options={interrupt:"wait",...e},n=this,zs.push(n),ss.render(Hs)}get(t){return this.currentTarget=t,this}layout(t,e){return this.updateTarget("layout",t,e),this}new(t,e){return this.updateTarget("new",t,e),this}old(t,e){return this.updateTarget("old",t,e),this}enter(t,e){return this.updateTarget("enter",t,e),this}exit(t,e){return this.updateTarget("exit",t,e),this}crossfade(t){return this.updateTarget("enter",{opacity:1},t),this.updateTarget("exit",{opacity:0},t),this}updateTarget(t,e,n={}){const{currentTarget:s,targets:i}=this;i.has(s)||i.set(s,{});i.get(s)[t]={keyframes:e,options:n}}then(t,e){return this.readyPromise.then(t,e)}}const qs=K,Gs=W.reduce(((t,e)=>(t[e]=t=>$(t),t)),{}),Zs=t=>Boolean(t&&t.getVelocity);function _s(t){return"object"==typeof t&&!Array.isArray(t)}function Js(t,e,n,s){return"string"==typeof t&&_s(e)?ns(t,n,s):t instanceof NodeList?Array.from(t):Array.isArray(t)?t:[t]}function Qs(t,e,n){return t*(e+1)}function ti(t,e,n,s){return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:s.get(e)??t}function ei(t,e,s,i,r,o){!function(t,e,s){for(let i=0;i<t.length;i++){const r=t[i];r.at>e&&r.at<s&&(n(t,r),i--)}}(t,r,o);for(let n=0;n<e.length;n++)t.push({value:e[n],at:Ot(r,o,i[n]),easing:B(s,n)})}function ni(t,e){for(let n=0;n<t.length;n++)t[n]=t[n]/(e+1)}function si(t,e){return t.at===e.at?null===t.value?1:null===e.value?-1:0:t.at-e.at}function ii(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function ri(t,e){return e[t]||(e[t]=[]),e[t]}function oi(t){return Array.isArray(t)?t:[t]}function ai(t,e){return t&&t[e]?{...t,...t[e]}:{...t}}const li=t=>"number"==typeof t,ui=t=>t.every(li),ci=new WeakMap;function hi(t){const e=[{},{}];return t?.values.forEach(((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()})),e}function di(t,e,n,s){if("function"==typeof e){const[i,r]=hi(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]=hi(s);e=e(void 0!==n?n:t.custom,i,r)}return e}function pi(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Es(n))}function fi(t){return(t=>Array.isArray(t))(t)?t[t.length-1]||0:t}function mi(t,e){const n=function(t,e,n){const s=t.getProps();return di(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){pi(t,e,fi(r[e]))}}function gi(t,e){const n=t.getValue("willChange");if(s=n,Boolean(Zs(s)&&s.add))return n.add(e);if(!n&&r.WillChange){const n=new r.WillChange("auto");t.addValue("willChange",n),n.add(e)}var s}const yi=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),vi="data-"+yi("framerAppearId");function wi(t){return t.props[vi]}const bi=t=>null!==t;const Ti={type:"spring",stiffness:500,damping:25,restSpeed:10},xi={type:"keyframes",duration:.8},Mi={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Si=(t,{keyframes:e})=>e.length>2?xi:Ye.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Ti:Mi;const Vi=(t,e,n,s={},i,o)=>a=>{const l=Ln(s,t)||{},u=l.delay||s.delay||0;let{elapsed:c=0}=s;c-=f(u);const h={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-c,onUpdate:t=>{e.set(t),l.onUpdate&&l.onUpdate(t)},onComplete:()=>{a(),l.onComplete&&l.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})(l)||Object.assign(h,Si(t,h)),h.duration&&(h.duration=f(h.duration)),h.repeatDelay&&(h.repeatDelay=f(h.repeatDelay)),void 0!==h.from&&(h.keyframes[0]=h.from);let d=!1;if((!1===h.type||0===h.duration&&!h.repeatDelay)&&(h.duration=0,0===h.delay&&(d=!0)),(r.instantAnimations||r.skipAnimations)&&(d=!0,h.duration=0,h.delay=0),h.allowFlatten=!l.type&&!l.ease,d&&!o&&void 0!==e.get()){const t=function(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(bi),r=e&&"loop"!==n&&e%2==1?0:i.length-1;return r&&void 0!==s?s:i[r]}(h.keyframes,l);if(void 0!==t)return void K.update((()=>{h.onUpdate(t),h.onComplete()}))}return new Vn(h)};function Ai({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,s}function Ei(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:r=t.getDefaultTransition(),transitionEnd:o,...a}=e;s&&(r=s);const l=[],u=i&&t.animationState&&t.animationState.getState()[i];for(const e in a){const s=t.getValue(e,t.latestValues[e]??null),i=a[e];if(void 0===i||u&&Ai(u,e))continue;const o={delay:n,...Ln(r||{},e)},c=s.get();if(void 0!==c&&!s.isAnimating&&!Array.isArray(i)&&i===c&&!o.velocity)continue;let h=!1;if(window.MotionHandoffAnimation){const n=wi(t);if(n){const t=window.MotionHandoffAnimation(n,e,K);null!==t&&(o.startTime=t,h=!0)}}gi(t,e),s.start(Vi(e,s,i,t.shouldReduceMotion&&Dn.has(e)?{type:!1}:o,t,h));const d=s.animation;d&&l.push(d)}return o&&Promise.all(l).then((()=>{K.update((()=>{o&&mi(t,o)}))})),l}const ki=()=>({x:{min:0,max:0},y:{min:0,max:0}}),Pi={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"]},Ci={};for(const t in Pi)Ci[t]={isEnabled:e=>Pi[t].some((t=>!!e[t]))};const Fi="undefined"!=typeof window,Oi={current:null},Ri={current:!1};const Bi=["initial","animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"];function Li(t){return null!==(e=t.animate)&&"object"==typeof e&&"function"==typeof e.start||Bi.some((e=>function(t){return"string"==typeof t||Array.isArray(t)}(t[e])));var e}const Di=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Ii{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=sn,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=X.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,K.render(this.render,!1,!0))};const{latestValues:a,renderState:l}=r;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=Li(e),this.isVariantNode=function(t){return Boolean(Li(t)||t.variants)}(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:u,...c}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in c){const e=c[t];void 0!==a[t]&&Zs(e)&&e.set(a[t],!1)}}mount(t){this.current=t,ci.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))),Ri.current||function(){if(Ri.current=!0,Fi)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Oi.current=t.matches;t.addListener(e),e()}else Oi.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Oi.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),$(this.notifyUpdate),$(this.render),this.valueSubscriptions.forEach((t=>t())),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);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=Ye.has(t);n&&this.onBindTransform&&this.onBindTransform();const s=e.on("change",(e=>{this.latestValues[t]=e,this.props.onUpdate&&K.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 Ci){const e=Ci[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<Di.length;e++){const n=Di[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(Zs(i))t.addValue(s,i);else if(Zs(r))t.addValue(s,Es(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,Es(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()}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=Es(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){let n=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];return null!=n&&("string"==typeof n&&(o(n)||a(n))?n=parseFloat(n):!Cs(n)&&kt.test(e)&&(n=Gn(t,e)),this.setBaseTarget(t,Zs(n)?n.get():n)),Zs(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let n;if("string"==typeof e||"object"==typeof e){const s=di(this.props,e,this.presenceContext?.custom);s&&(n=s[t])}if(e&&void 0!==n)return n;const s=this.getBaseTargetFromProps(this.props,t);return void 0===s||Zs(s)?void 0!==this.initialValues[t]&&void 0===n?void 0:this.baseTarget[t]:s}on(t,e){return this.events[t]||(this.events[t]=new p),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}class Wi extends Ii{constructor(){super(...arguments),this.KeyframeResolver=_n}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;Zs(t)&&(this.childSubscription=t.on("change",(t=>{this.current&&(this.current.textContent=`${t}`)})))}}const Ni={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ji=Ue.length;function Ki(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(Ye.has(t))o=!0;else if(Z(t))i[t]=n;else{const e=Fs(n,Hn[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<ji;r++){const o=Ue[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=Fs(a,Hn[o]);l||(i=!1,s+=`${Ni[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 $i={offset:"stroke-dashoffset",array:"stroke-dasharray"},zi={offset:"strokeDashoffset",array:"strokeDasharray"};function Ui(t,{attrX:e,attrY:n,attrScale:s,pathLength:i,pathSpacing:r=1,pathOffset:o=0,...a},l,u){if(Ki(t,a,u),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:c,style:h}=t;c.transform&&(h.transform=c.transform,delete c.transform),(h.transform||c.transformOrigin)&&(h.transformOrigin=c.transformOrigin??"50% 50%",delete c.transformOrigin),h.transform&&(h.transformBox="fill-box",delete c.transformBox),void 0!==e&&(c.x=e),void 0!==n&&(c.y=n),void 0!==s&&(c.scale=s),void 0!==i&&function(t,e,n=1,s=0,i=!0){t.pathLength=1;const r=i?$i:zi;t[r.offset]=ft.transform(-s);const o=ft.transform(e),a=ft.transform(n);t[r.array]=`${o} ${a}`}(c,i,r,o,!1)}const Yi=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 Hi(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 Xi={};function qi(t,{layout:e,layoutId:n}){return Ye.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!Xi[t]||"opacity"===t)}function Gi(t,e,n){const{style:s}=t,i={};for(const r in s)(Zs(s[r])||e.style&&Zs(e.style[r])||qi(r,t)||void 0!==n?.getValue(r)?.liveStyle)&&(i[r]=s[r]);return i}class Zi extends Wi{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ki}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(Ye.has(e)){const t=qn(e);return t&&t.default||0}return e=Yi.has(e)?e:yi(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return function(t,e,n){const s=Gi(t,e,n);for(const n in t)(Zs(t[n])||Zs(e[n]))&&(s[-1!==Ue.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]);return s}(t,e,n)}build(t,e,n){Ui(t,e,this.isSVGTag,n.transformTemplate)}renderInstance(t,e,n,s){!function(t,e,n,s){Hi(t,e,void 0,s);for(const n in e.attrs)t.setAttribute(Yi.has(n)?n:yi(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 _i extends Wi{constructor(){super(...arguments),this.type="html",this.renderInstance=Hi}readValueFromInstance(t,e){if(Ye.has(e))return $e(t,e);{const s=(n=t,window.getComputedStyle(n)),i=(Z(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){Ki(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return Gi(t,e,n)}}class Ji extends Ii{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 Qi(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 Zi(e):new _i(e);n.mount(t),ci.set(t,n)}function tr(t){const e=new Ji({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});e.mount(t),ci.set(t,e)}function er(t,e,n,s){const i=[];if(function(t,e){return Zs(t)||"number"==typeof t||"string"==typeof t&&!_s(e)}(t,e))i.push(function(t,e,n){const s=Zs(t)?t:Es(t);return s.start(Vi("",s,e,n)),s.animation}(t,_s(e)&&e.default||e,n&&n.default||n));else{const r=Js(t,e,s),o=r.length;for(let t=0;t<o;t++){const s=r[t],a=s instanceof Element?Qi:tr;ci.has(s)||a(s);const l=ci.get(s),u={...n};"delay"in u&&"function"==typeof u.delay&&(u.delay=u.delay(t,o)),i.push(...Ei(l,{...e,transition:u},{}))}}return i}function nr(t,e,n){const s=[],i=function(t,{defaultTransition:e={},...n}={},s,i){const r=e.duration||.3,o=new Map,a=new Map,l={},u=new Map;let c=0,h=0,p=0;for(let n=0;n<t.length;n++){const o=t[n];if("string"==typeof o){u.set(o,h);continue}if(!Array.isArray(o)){u.set(o.name,ti(h,o.at,c,u));continue}let[d,m,g={}]=o;void 0!==g.at&&(h=ti(h,g.at,c,u));let y=0;const v=(t,n,s,o=0,a=0)=>{const l=oi(t),{delay:u=0,times:c=Te(l),type:d="keyframes",repeat:m,repeatType:g,repeatDelay:v=0,...w}=n;let{ease:b=e.ease||"easeOut",duration:T}=n;const x="function"==typeof u?u(o,a):u,M=l.length,S=mn(d)?d:i?.[d];if(M<=2&&S){let t=100;if(2===M&&ui(l)){const e=l[1]-l[0];t=Math.abs(e)}const e={...w};void 0!==T&&(e.duration=f(T));const n=Gt(e,t,S);b=n.ease,T=n.duration}T??(T=r);const V=h+x;1===c.length&&0===c[0]&&(c[1]=1);const A=c.length-l.length;if(A>0&&be(c,A),1===l.length&&l.unshift(null),m){T=Qs(T,m);const t=[...l],e=[...c];b=Array.isArray(b)?[...b]:[b];const n=[...b];for(let s=0;s<m;s++){l.push(...t);for(let i=0;i<t.length;i++)c.push(e[i]+(s+1)),b.push(0===i?"linear":B(n,i-1))}ni(c,m)}const E=V+T;ei(s,l,b,c,V,E),y=Math.max(x+T,y),p=Math.max(E,p)};if(Zs(d))v(m,g,ri("default",ii(d,a)));else{const t=Js(d,m,s,l),e=t.length;for(let n=0;n<e;n++){const s=ii(t[n],a);for(const t in m)v(m[t],ai(g,t),ri(t,s),n,e)}}c=h,h+=y}return a.forEach(((t,s)=>{for(const i in t){const r=t[i];r.sort(si);const a=[],l=[],u=[];for(let t=0;t<r.length;t++){const{at:e,value:n,easing:s}=r[t];a.push(n),l.push(d(0,p,e)),u.push(s||"easeOut")}0!==l[0]&&(l.unshift(0),a.unshift(a[0]),u.unshift("easeInOut")),1!==l[l.length-1]&&(l.push(1),a.push(null)),o.has(s)||o.set(s,{keyframes:{},transition:{}});const c=o.get(s);c.keyframes[i]=a,c.transition[i]={...e,duration:p,ease:u,times:l,...n}}})),o}(t,e,n,{spring:ye});return i.forEach((({keyframes:t,transition:e},n)=>{s.push(...er(n,t,e))})),s}function sr(t){return function(e,n,s){let i=[];var r;r=e,i=Array.isArray(r)&&r.some(Array.isArray)?nr(e,n,t):er(e,n,s,t);const o=new En(i);return t&&t.animations.push(o),o}}const ir=sr();const rr=t=>function(e,n,s){return new En(function(t,e,n,s){const i=ns(t,s),r=i.length,o=[];for(let t=0;t<r;t++){const s=i[t],a={...n};"function"==typeof a.delay&&(a.delay=a.delay(t,r));for(const t in e){let n=e[t];Array.isArray(n)||(n=[n]);const i={...Ln(a,t)};i.duration&&(i.duration=f(i.duration)),i.delay&&(i.delay=f(i.delay));const r=Fn(s),l=Cn(t,i.pseudoElement||""),u=r.get(l);u&&u.stop(),o.push({map:r,key:l,unresolvedKeyframes:n,options:{...i,element:s,name:t,allowFlatten:!a.type&&!a.ease}})}}for(let t=0;t<o.length;t++){const{unresolvedKeyframes:e,options:n}=o[t],{element:s,name:i,pseudoElement:r}=n;r||null!==e[0]||(e[0]=gs(s,i)),Oe(e),Qn(e,i),!r&&e.length<2&&e.unshift(gs(s,i)),n.keyframes=e}const a=[];for(let t=0;t<o.length;t++){const{map:e,key:n,options:s}=o[t],i=new yn(s);e.set(n,i),i.finished.finally((()=>e.delete(n))),a.push(i)}return a}(e,n,s,t))},or=rr(),ar=new WeakMap;let lr;function ur({target:t,contentRect:e,borderBoxSize:n}){ar.get(t)?.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 cr(t){t.forEach(ur)}function hr(t,e){lr||"undefined"!=typeof ResizeObserver&&(lr=new ResizeObserver(cr));const n=ns(t);return n.forEach((t=>{let n=ar.get(t);n||(n=new Set,ar.set(t,n)),n.add(e),lr?.observe(t)})),()=>{n.forEach((t=>{const n=ar.get(t);n?.delete(e),n?.size||lr?.unobserve(t)}))}}const dr=new Set;let pr;function fr(t){return dr.add(t),pr||(pr=()=>{const t={width:window.innerWidth,height:window.innerHeight},e={target:window,size:t,contentSize:t};dr.forEach((t=>t(e)))},window.addEventListener("resize",pr)),()=>{dr.delete(t),!dr.size&&pr&&(pr=void 0)}}const mr={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function gr(t,e,n,s){const i=n[e],{length:r,position:o}=mr[e],a=i.current,l=n.time;i.current=t[`scroll${o}`],i.scrollLength=t[`scroll${r}`]-t[`client${r}`],i.offset.length=0,i.offset[0]=0,i.offset[1]=i.scrollLength,i.progress=d(0,i.scrollLength,i.current);const u=s-l;i.velocity=u>50?0:g(i.current-a,u)}const yr={start:0,center:.5,end:1};function vr(t,e,n=0){let s=0;if(t in yr&&(t=yr[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 wr=[0,0];function br(t,e,n,s){let i=Array.isArray(t)?t:wr,r=0,o=0;return"number"==typeof t?i=[t,t]:"string"==typeof t&&(i=(t=t.trim()).includes(" ")?t.split(" "):[t,yr[t]?t:"0"]),r=vr(i[0],n,s),o=vr(i[1],e),r-o}const Tr={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},xr={x:0,y:0};function Mr(t,e,n){const{offset:i=Tr.All}=n,{target:r=t,axis:o="y"}=n,a="y"===o?"height":"width",l=r!==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}(r,t):xr,u=r===t?{width:t.scrollWidth,height:t.scrollHeight}:function(t){return"getBBox"in t&&"svg"!==t.tagName?t.getBBox():{width:t.clientWidth,height:t.clientHeight}}(r),c={width:t.clientWidth,height:t.clientHeight};e[o].offset.length=0;let h=!e[o].interpolate;const d=i.length;for(let t=0;t<d;t++){const n=br(i[t],c[a],u[a],l[o]);h||n===e[o].interpolatorOffsets[t]||(h=!0),e[o].offset[t]=n}h&&(e[o].interpolate=we(e[o].offset,Te(i),{clamp:!1}),e[o].interpolatorOffsets=[...e[o].offset]),e[o].progress=s(0,1,e[o].interpolate(e[o].current))}function Sr(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){gr(t,"x",e,n),gr(t,"y",e,n),e.time=n}(t,n,e),(s.offset||s.target)&&Mr(t,n,s)},notify:()=>e(n)}}const Vr=new WeakMap,Ar=new WeakMap,Er=new WeakMap,kr=t=>t===document.documentElement?window:t;function Pr(t,{container:e=document.documentElement,...n}={}){let s=Er.get(e);s||(s=new Set,Er.set(e,s));const i=Sr(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),!Vr.has(e)){const t=()=>{for(const t of s)t.measure()},n=()=>{for(const t of s)t.update(z.timestamp)},i=()=>{for(const t of s)t.notify()},a=()=>{K.read(t,!1,!0),K.read(n,!1,!0),K.preUpdate(i,!1,!0)};Vr.set(e,a);const l=kr(e);window.addEventListener("resize",a,{passive:!0}),e!==document.documentElement&&Ar.set(e,(o=a,"function"==typeof(r=e)?fr(r):hr(r,o))),l.addEventListener("scroll",a,{passive:!0})}var r,o;const a=Vr.get(e);return K.read(a,!1,!0),()=>{$(a);const t=Er.get(e);if(!t)return;if(t.delete(i),t.size)return;const n=Vr.get(e);Vr.delete(e),n&&(kr(e).removeEventListener("scroll",n),Ar.get(e)?.(),window.removeEventListener("resize",n))}}const Cr=new Map;function Fr({source:t,container:e,...n}){const{axis:s}=n;t&&(e=t);const i=Cr.get(e)??new Map;Cr.set(e,i);const r=n.target??"self",o=i.get(r)??{},a=s+(n.offset??[]).join(",");return o[a]||(o[a]=!n.target&&an()?new ScrollTimeline({source:e,axis:s}):function(t){const e={value:0},n=Pr((n=>{e.value=100*n[t.axis].progress}),t);return{currentTime:e,cancel:n}}({container:e,...n})),o[s]}const Or={some:0,all:1};const Rr=(t,e)=>Math.abs(t-e);t.AsyncMotionValueAnimation=Vn,t.DOMKeyframesResolver=_n,t.GroupAnimation=An,t.GroupAnimationWithThen=En,t.JSAnimation=Fe,t.KeyframeResolver=sn,t.MotionGlobalConfig=r,t.MotionValue=As,t.NativeAnimation=yn,t.NativeAnimationExtended=bn,t.NativeAnimationWrapper=kn,t.SubscriptionManager=p,t.ViewTransitionBuilder=Xs,t.acceleratedValues=es,t.activeAnimations=q,t.addUniqueItem=e,t.alpha=et,t.analyseComplexValue=St,t.animate=ir,t.animateMini=or,t.animateValue=function(t){return new Fe(t)},t.animateView=function(t,e={}){return new Xs(t,e)},t.animationMapKey=Cn,t.anticipate=A,t.applyPxDefaults=Qn,t.backIn=S,t.backInOut=V,t.backOut=M,t.calcGeneratorDuration=qt,t.cancelFrame=$,t.cancelMicrotask=is,t.cancelSync=Gs,t.circIn=E,t.circInOut=P,t.circOut=k,t.clamp=s,t.collectMotionValues=Vs,t.color=wt,t.complex=kt,t.convertOffsetToTimes=xe,t.createGeneratorEasing=Gt,t.createRenderBatcher=j,t.createScopedAnimate=sr,t.cubicBezier=b,t.cubicBezierAsString=hn,t.defaultEasing=Me,t.defaultOffset=Te,t.defaultValueTypes=Xn,t.degrees=dt,t.delay=function(t,e){return function(t,e){const n=X.now(),s=({timestamp:i})=>{const r=i-n;r>=e&&($(s),t(r-e))};return K.setup(s,!0),()=>$(s)}(t,f(e))},t.dimensionValueTypes=Wn,t.distance=Rr,t.distance2D=function(t,e){const n=Rr(t.x,e.x),s=Rr(t.y,e.y);return Math.sqrt(n**2+s**2)},t.easeIn=C,t.easeInOut=O,t.easeOut=F,t.easingDefinitionToFunction=I,t.fillOffset=be,t.fillWildcards=Oe,t.findDimensionValueType=Nn,t.findValueType=Cs,t.flushKeyframeResolvers=nn,t.frame=K,t.frameData=z,t.frameSteps=U,t.generateLinearEasing=Ht,t.getAnimatableNone=Gn,t.getAnimationMap=Fn,t.getComputedStyle=gs,t.getDefaultValueType=qn,t.getEasingForSegment=B,t.getMixer=jt,t.getValueAsType=Fs,t.getValueTransition=Ln,t.getVariableValue=Bn,t.hasWarned=function(t){return y.has(t)},t.hex=ct,t.hover=function(t,e,n={}){const[s,i,r]=as(t,n),o=t=>{if(!ls(t))return;const{target:n}=t,s=e(n,t);if("function"!=typeof s||!n)return;const r=t=>{ls(t)&&(s(t),n.removeEventListener("pointerleave",r))};n.addEventListener("pointerleave",r,i)};return s.forEach((t=>{t.addEventListener("pointerenter",o,i)})),r},t.hsla=vt,t.hslaToRgba=Ct,t.inView=function(t,e,{root:n,margin:s,amount:i="some"}={}){const r=ns(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:Or[i]});return r.forEach((t=>a.observe(t))),()=>a.disconnect()},t.inertia=ve,t.interpolate=we,t.invariant=i,t.invisibleValues=It,t.isBezierDefinition=L,t.isCSSVariableName=Z,t.isCSSVariableToken=J,t.isDragActive=os,t.isDragging=rs,t.isEasingArray=R,t.isGenerator=mn,t.isNodeOrChild=us,t.isNumericalString=o,t.isPrimaryPointer=cs,t.isWaapiSupportedEasing=function t(e){return Boolean("function"==typeof e&&cn()||!e||"string"==typeof e&&(e in dn||cn())||L(e)||Array.isArray(e)&&e.every(t))},t.isZeroValueString=a,t.keyframes=Se,t.mapEasingToNativeEasing=pn,t.mapValue=function(t,e,n,s){const i=Ss(e,n,s);return ks((()=>i(t.get())))},t.maxGeneratorDuration=Xt,t.memo=l,t.microtask=ss,t.millisecondsToSeconds=m,t.mirrorEasing=T,t.mix=Ut,t.mixArray=Kt,t.mixColor=Dt,t.mixComplex=zt,t.mixImmediate=Ft,t.mixLinearColor=Rt,t.mixNumber=Ot,t.mixObject=$t,t.mixVisibility=Wt,t.motionValue=Es,t.moveItem=function([...t],e,n){const s=e<0?t.length+e:e;if(s>=0&&s<t.length){const s=n<0?t.length+n:n,[i]=t.splice(e,1);t.splice(s,0,i)}return t},t.noop=u,t.number=tt,t.numberValueTypes=Hn,t.observeTimeline=ys,t.parseCSSVariable=Rn,t.parseValueFromTransform=Ke,t.percent=pt,t.pipe=h,t.positionalKeys=Dn,t.press=function(t,e,n={}){const[s,i,r]=as(t,n),o=t=>{const s=t.currentTarget;if(!ms(t)||ds.has(s))return;ds.add(s);const r=e(s,t),o=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),ms(t)&&ds.has(s)&&(ds.delete(s),"function"==typeof r&&r(t,{success:e}))},a=t=>{o(t,s===window||s===document||n.useGlobalTarget||us(s,t.target))},l=t=>{o(t,!1)};window.addEventListener("pointerup",a,i),window.addEventListener("pointercancel",l,i)};return s.forEach((t=>{var e;(n.useGlobalTarget?window:t).addEventListener("pointerdown",o,i),t instanceof HTMLElement&&(t.addEventListener("focus",(t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const s=ps((()=>{if(ds.has(n))return;fs(n,"down");const t=ps((()=>{fs(n,"up")}));n.addEventListener("keyup",t,e),n.addEventListener("blur",(()=>fs(n,"cancel")),e)}));n.addEventListener("keydown",s,e),n.addEventListener("blur",(()=>n.removeEventListener("keydown",s)),e)})(t,i))),e=t,hs.has(e.tagName)||-1!==e.tabIndex||t.hasAttribute("tabindex")||(t.tabIndex=0))})),r},t.progress=d,t.progressPercentage=yt,t.px=ft,t.readTransformValue=$e,t.recordStats=function(){if(N.value)throw xs(),new Error("Stats are already being measured");const t=N;return t.value={frameloop:{setup:[],rate:[],read:[],resolveKeyframes:[],preUpdate:[],update:[],preRender:[],render:[],postRender:[]},animations:{mainThread:[],waapi:[],layout:[]},layoutProjection:{nodes:[],calculatedTargetDeltas:[],calculatedProjections:[]}},t.addProjectionMetrics=e=>{const{layoutProjection:n}=t.value;n.nodes.push(e.nodes),n.calculatedTargetDeltas.push(e.calculatedTargetDeltas),n.calculatedProjections.push(e.calculatedProjections)},K.postRender(vs,!0),Ms},t.removeItem=n,t.resolveElements=ns,t.reverseEasing=x,t.rgbUnit=lt,t.rgba=ut,t.scale=nt,t.scroll=function(t,{axis:e="y",container:n=document.documentElement,...s}={}){const i={axis:e,container:n,...s};return"function"==typeof t?function(t,e){return function(t){return 2===t.length}(t)?Pr((n=>{t(n[e.axis].progress,n)}),e):ys(t,Fr(e))}(t,i):function(t,e){const n=Fr(e);return t.attachTimeline({timeline:e.target?void 0:n,observe:t=>(t.pause(),ys((e=>{t.time=t.duration*e}),n))})}(t,i)},t.scrollInfo=Pr,t.secondsToMilliseconds=f,t.setDragLock=function(t){return"x"===t||"y"===t?rs[t]?null:(rs[t]=!0,()=>{rs[t]=!1}):rs.x||rs.y?null:(rs.x=rs.y=!0,()=>{rs.x=rs.y=!1})},t.setStyle=on,t.spring=ye,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=I(s)(l/e)*e}return e+l}},t.startWaapiAnimation=fn,t.statsBuffer=N,t.steps=function(t,e="end"){return n=>{const i=(n="end"===e?Math.min(n,.999):Math.max(n,.001))*t,r="end"===e?Math.floor(i):Math.ceil(i);return s(0,1,r/t)}},t.styleEffect=function(t,e){const n=ns(t),s=[];for(let t=0;t<n.length;t++){const i=n[t];for(const t in e){const n=e[t],r=()=>{i.style[t]=n.get()},o=()=>K.render(r),a=n.on("change",o);o(),s.push((()=>{a(),$(r)}))}}return()=>{for(const t of s)t()}},t.supportedWaapiEasing=dn,t.supportsBrowserAnimation=Sn,t.supportsFlags=ln,t.supportsLinearEasing=cn,t.supportsPartialKeyframes=ts,t.supportsScrollTimeline=an,t.sync=qs,t.testValueType=In,t.time=X,t.transform=Ss,t.transformPropOrder=Ue,t.transformProps=Ye,t.transformValue=ks,t.transformValueTypes=Yn,t.velocityPerSecond=g,t.vh=mt,t.vw=gt,t.warnOnce=function(t,e,n){t||y.has(e)||(console.warn(e),n&&console.warn(n),y.add(e))},t.warning=()=>{},t.wrap=v}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "motion",
3
- "version": "12.8.2",
3
+ "version": "12.9.0",
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.8.2",
79
+ "framer-motion": "^12.9.0",
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": "a95e71abca6a1e5954c7ab31029bb391713d85d6"
98
+ "gitHead": "cbc2fc41e0beb97f133ad53e509b1595e9124610"
99
99
  }