framer-motion 11.0.13 → 11.0.14

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.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var indexLegacy = require('./index-legacy-2230e399.js');
5
+ var indexLegacy = require('./index-legacy-c9b3fc9b.js');
6
6
 
7
7
 
8
8
 
@@ -1069,13 +1069,10 @@ function readAllKeyframes() {
1069
1069
  anyNeedsMeasurement = true;
1070
1070
  }
1071
1071
  });
1072
- frame.resolveKeyframes(measureAllKeyframes);
1073
1072
  }
1074
1073
  function flushKeyframeResolvers() {
1075
1074
  readAllKeyframes();
1076
1075
  measureAllKeyframes();
1077
- cancelFrame(readAllKeyframes);
1078
- cancelFrame(measureAllKeyframes);
1079
1076
  }
1080
1077
  class KeyframeResolver {
1081
1078
  constructor(unresolvedKeyframes, onComplete, name, motionValue, element, isAsync = false) {
@@ -1114,6 +1111,7 @@ class KeyframeResolver {
1114
1111
  if (!isScheduled) {
1115
1112
  isScheduled = true;
1116
1113
  frame.read(readAllKeyframes);
1114
+ frame.resolveKeyframes(measureAllKeyframes);
1117
1115
  }
1118
1116
  }
1119
1117
  else {
@@ -2613,7 +2611,13 @@ class MainThreadAnimation extends BaseAnimation {
2613
2611
  }
2614
2612
  }
2615
2613
  tick(timestamp, sample = false) {
2616
- const { finalKeyframe, generator, mirroredGenerator, mapPercentToKeyframes, keyframes, calculatedDuration, totalDuration, resolvedDuration, } = this.resolved;
2614
+ const { resolved } = this;
2615
+ // If the animations has failed to resolve, return the final keyframe.
2616
+ if (!resolved) {
2617
+ const { keyframes } = this.options;
2618
+ return { done: true, value: keyframes[keyframes.length - 1] };
2619
+ }
2620
+ const { finalKeyframe, generator, mirroredGenerator, mapPercentToKeyframes, keyframes, calculatedDuration, totalDuration, resolvedDuration, } = resolved;
2617
2621
  if (this.startTime === null)
2618
2622
  return generator.next(0);
2619
2623
  const { delay, repeat, repeatType, repeatDelay, onUpdate } = this.options;
@@ -2730,7 +2734,8 @@ class MainThreadAnimation extends BaseAnimation {
2730
2734
  return state;
2731
2735
  }
2732
2736
  get duration() {
2733
- return millisecondsToSeconds(this.resolved.calculatedDuration);
2737
+ const { resolved } = this;
2738
+ return resolved ? millisecondsToSeconds(resolved.calculatedDuration) : 0;
2734
2739
  }
2735
2740
  get time() {
2736
2741
  return millisecondsToSeconds(this.currentTime);
@@ -3019,27 +3024,45 @@ class AcceleratedAnimation extends BaseAnimation {
3019
3024
  };
3020
3025
  }
3021
3026
  get duration() {
3022
- const { duration } = this.resolved;
3027
+ const { resolved } = this;
3028
+ if (!resolved)
3029
+ return 0;
3030
+ const { duration } = resolved;
3023
3031
  return millisecondsToSeconds(duration);
3024
3032
  }
3025
3033
  get time() {
3026
- const { animation } = this.resolved;
3034
+ const { resolved } = this;
3035
+ if (!resolved)
3036
+ return 0;
3037
+ const { animation } = resolved;
3027
3038
  return millisecondsToSeconds(animation.currentTime || 0);
3028
3039
  }
3029
3040
  set time(newTime) {
3030
- const { animation } = this.resolved;
3041
+ const { resolved } = this;
3042
+ if (!resolved)
3043
+ return;
3044
+ const { animation } = resolved;
3031
3045
  animation.currentTime = secondsToMilliseconds(newTime);
3032
3046
  }
3033
3047
  get speed() {
3034
- const { animation } = this.resolved;
3048
+ const { resolved } = this;
3049
+ if (!resolved)
3050
+ return 1;
3051
+ const { animation } = resolved;
3035
3052
  return animation.playbackRate;
3036
3053
  }
3037
3054
  set speed(newSpeed) {
3038
- const { animation } = this.resolved;
3055
+ const { resolved } = this;
3056
+ if (!resolved)
3057
+ return;
3058
+ const { animation } = resolved;
3039
3059
  animation.playbackRate = newSpeed;
3040
3060
  }
3041
3061
  get state() {
3042
- const { animation } = this.resolved;
3062
+ const { resolved } = this;
3063
+ if (!resolved)
3064
+ return "idle";
3065
+ const { animation } = resolved;
3043
3066
  return animation.playState;
3044
3067
  }
3045
3068
  /**
@@ -3051,7 +3074,10 @@ class AcceleratedAnimation extends BaseAnimation {
3051
3074
  this.pendingTimeline = timeline;
3052
3075
  }
3053
3076
  else {
3054
- const { animation } = this.resolved;
3077
+ const { resolved } = this;
3078
+ if (!resolved)
3079
+ return noop;
3080
+ const { animation } = resolved;
3055
3081
  animation.timeline = timeline;
3056
3082
  animation.onfinish = null;
3057
3083
  }
@@ -3060,16 +3086,25 @@ class AcceleratedAnimation extends BaseAnimation {
3060
3086
  play() {
3061
3087
  if (this.isStopped)
3062
3088
  return;
3063
- const { animation } = this.resolved;
3089
+ const { resolved } = this;
3090
+ if (!resolved)
3091
+ return;
3092
+ const { animation } = resolved;
3064
3093
  animation.play();
3065
3094
  }
3066
3095
  pause() {
3067
- const { animation } = this.resolved;
3096
+ const { resolved } = this;
3097
+ if (!resolved)
3098
+ return;
3099
+ const { animation } = resolved;
3068
3100
  animation.pause();
3069
3101
  }
3070
3102
  stop() {
3071
3103
  this.isStopped = true;
3072
- const { animation, keyframes } = this.resolved;
3104
+ const { resolved } = this;
3105
+ if (!resolved)
3106
+ return;
3107
+ const { animation, keyframes } = resolved;
3073
3108
  if (animation.playState === "idle" ||
3074
3109
  animation.playState === "finished") {
3075
3110
  return;
@@ -3093,10 +3128,16 @@ class AcceleratedAnimation extends BaseAnimation {
3093
3128
  this.cancel();
3094
3129
  }
3095
3130
  complete() {
3096
- this.resolved.animation.finish();
3131
+ const { resolved } = this;
3132
+ if (!resolved)
3133
+ return;
3134
+ resolved.animation.finish();
3097
3135
  }
3098
3136
  cancel() {
3099
- this.resolved.animation.cancel();
3137
+ const { resolved } = this;
3138
+ if (!resolved)
3139
+ return;
3140
+ resolved.animation.cancel();
3100
3141
  }
3101
3142
  static supports(options) {
3102
3143
  const { motionValue, name, repeatDelay, repeatType, damping, type } = options;
@@ -3316,7 +3357,7 @@ class MotionValue {
3316
3357
  * This will be replaced by the build step with the latest version number.
3317
3358
  * When MotionValues are provided to motion components, warn if versions are mixed.
3318
3359
  */
3319
- this.version = "11.0.13";
3360
+ this.version = "11.0.14";
3320
3361
  /**
3321
3362
  * Tracks whether this value can output a velocity. Currently this is only true
3322
3363
  * if the value is numerical, but we might be able to widen the scope here and support
@@ -4082,7 +4123,7 @@ function updateMotionValuesFromProps(element, next, prev) {
4082
4123
  * and warn against mismatches.
4083
4124
  */
4084
4125
  if (process.env.NODE_ENV === "development") {
4085
- warnOnce(nextValue.version === "11.0.13", `Attempting to mix Framer Motion versions ${nextValue.version} with 11.0.13 may not work as expected.`);
4126
+ warnOnce(nextValue.version === "11.0.14", `Attempting to mix Framer Motion versions ${nextValue.version} with 11.0.14 may not work as expected.`);
4086
4127
  }
4087
4128
  }
4088
4129
  else if (isMotionValue(prevValue)) {
package/dist/cjs/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
- var indexLegacy = require('./index-legacy-2230e399.js');
6
+ var indexLegacy = require('./index-legacy-c9b3fc9b.js');
7
7
 
8
8
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
9
9
 
package/dist/dom.js CHANGED
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={})}(this,(function(t){"use strict";const e=t=>t,n=!1,s=!1;class r{constructor(){this.order=[],this.scheduled=new Set}add(t){if(!this.scheduled.has(t))return this.scheduled.add(t),this.order.push(t),!0}remove(t){const e=this.order.indexOf(t);-1!==e&&(this.order.splice(e,1),this.scheduled.delete(t))}clear(){this.order.length=0,this.scheduled.clear()}}const i=["read","resolveKeyframes","update","preRender","render","postRender"];const{schedule:o,cancel:a,state:l,steps:u}=function(t,e){let n=!1,s=!0;const o={delta:0,timestamp:0,isProcessing:!1},a=i.reduce((t,e)=>(t[e]=function(t){let e=new r,n=new r,s=0,i=!1,o=!1;const a=new WeakSet,l={schedule:(t,r=!1,o=!1)=>{const l=o&&i,u=l?e:n;return r&&a.add(t),u.add(t)&&l&&i&&(s=e.order.length),t},cancel:t=>{n.remove(t),a.delete(t)},process:r=>{if(i)o=!0;else{if(i=!0,[e,n]=[n,e],n.clear(),s=e.order.length,s)for(let n=0;n<s;n++){const s=e.order[n];a.has(s)&&(l.schedule(s),t()),s(r)}i=!1,o&&(o=!1,l.process(r))}}};return l}(()=>n=!0),t),{}),l=t=>{a[t].process(o)},u=()=>{const r=performance.now();n=!1,o.delta=s?1e3/60:Math.max(Math.min(r-o.timestamp,40),1),o.timestamp=r,o.isProcessing=!0,i.forEach(l),o.isProcessing=!1,n&&e&&(s=!1,t(u))};return{schedule:i.reduce((e,r)=>{const i=a[r];return e[r]=(e,r=!1,a=!1)=>(n||(n=!0,s=!0,o.isProcessing||t(u)),i.schedule(e,r,a)),e},{}),cancel:t=>i.forEach(e=>a[e].cancel(t)),state:o,steps:a}}("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:e,!0);function c(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class h{constructor(){this.subscriptions=[]}add(t){var e,n;return e=this.subscriptions,n=t,-1===e.indexOf(n)&&e.push(n),()=>c(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 r=0;r<s;r++){const s=this.subscriptions[r];s&&s(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function d(t,e){return e?t*(1e3/e):0}let p;function f(){p=void 0}const m={now:()=>(void 0===p&&m.set(l.isProcessing||s?l.timestamp:performance.now()),p),set:t=>{p=t,queueMicrotask(f)}};class g{constructor(t,e={}){var n;this.version="11.0.13",this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(t,e=!0)=>{const n=m.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.canTrackVelocity=(n=this.current,!isNaN(parseFloat(n))),this.owner=e.owner}setCurrent(t){this.current=t,this.updatedAt=m.now()}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 h);const n=this.events[t].add(e);return"change"===t?()=>{n(),o.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=m.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return d(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function v(t,e){return new g(t,e)}let y=e,w=e;function b(t,e,n){var s;if("string"==typeof t){let r=document;e&&(w(Boolean(e.current)),r=e.current),n?(null!==(s=n[t])&&void 0!==s||(n[t]=r.querySelectorAll(t)),t=n[t]):t=r.querySelectorAll(t)}else t instanceof Element&&(t=[t]);return Array.from(t||[])}const x=new WeakMap;function T(t,e){let n;const s=()=>{const{currentTime:s}=e,r=(null===s?0:s.value)/100;n!==r&&t(r),n=r};return o.update(s,!0),()=>a(s)}function V(t){let e;return()=>(void 0===e&&(e=t()),e)}const S=V(()=>void 0!==window.ScrollTimeline);class M{constructor(t){this.animations=t.filter(Boolean)}then(t,e){return Promise.all(this.animations).then(t).catch(e)}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=>{if(!S()||!e.attachTimeline)return e.pause(),T(t=>{e.time=e.duration*t},t);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 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")}stop(){this.runAll("stop")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}const A=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],P=new Set(A),k=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),C="data-"+k("framerAppearId"),E=t=>1e3*t,F=t=>t/1e3,O={type:"spring",stiffness:500,damping:25,restSpeed:10},R={type:"keyframes",duration:.8},B={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},I=(t,{keyframes:e})=>e.length>2?R:P.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:O:B;function L(t,e){return t[e]||t.default||t}const D=!1,W=t=>null!==t;function N(t,{repeat:e,repeatType:n="loop"},s){const r=t.filter(W),i=e&&"loop"!==n&&e%2==1?0:r.length-1;return i&&void 0!==s?s:r[i]}const K=t=>/^0[^.\s]+$/u.test(t);const j=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),z=t=>e=>"string"==typeof e&&e.startsWith(t),$=z("--"),H=z("var(--"),U=t=>!!H(t)&&Y.test(t.split("/*")[0].trim()),Y=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,q=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function X(t,e,n=1){const[s,r]=function(t){const e=q.exec(t);if(!e)return[,];const[,n,s,r]=e;return["--"+(null!=n?n:s),r]}(t);if(!s)return;const i=window.getComputedStyle(e).getPropertyValue(s);if(i){const t=i.trim();return j(t)?parseFloat(t):t}return U(r)?X(r,e,n+1):r}const Z=(t,e,n)=>n>e?e:n<t?t:n,G={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},_={...G,transform:t=>Z(0,1,t)},J={...G,default:1},Q=t=>Math.round(1e5*t)/1e5,tt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,et=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,nt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;function st(t){return"string"==typeof t}const rt=t=>({test:e=>st(e)&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),it=rt("deg"),ot=rt("%"),at=rt("px"),lt=rt("vh"),ut=rt("vw"),ct={...ot,parse:t=>ot.parse(t)/100,transform:t=>ot.transform(100*t)},ht=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),dt=t=>t===G||t===at,pt=(t,e)=>parseFloat(t.split(", ")[e]),ft=(t,e)=>(n,{transform:s})=>{if("none"===s||!s)return 0;const r=s.match(/^matrix3d\((.+)\)$/u);if(r)return pt(r[1],e);{const e=s.match(/^matrix\((.+)\)$/u);return e?pt(e[1],t):0}},mt=new Set(["x","y","z"]),gt=A.filter(t=>!mt.has(t));const vt={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:ft(4,13),y:ft(5,14)};vt.translateX=vt.x,vt.translateY=vt.y;const yt=t=>e=>e.test(t),wt=[G,at,ot,it,ut,lt,{test:t=>"auto"===t,parse:t=>t}],bt=t=>wt.find(yt(t)),xt=new Set;let Tt=!1,Vt=!1;function St(){Vt&&(xt.forEach(t=>{t.needsMeasurement&&t.unsetTransforms()}),xt.forEach(t=>{t.needsMeasurement&&t.measureInitialState()}),xt.forEach(t=>{t.needsMeasurement&&t.renderEndStyles()}),xt.forEach(t=>{t.needsMeasurement&&t.measureEndState()})),Vt=!1,Tt=!1,xt.forEach(t=>t.complete()),xt.clear()}function Mt(){xt.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Vt=!0)}),o.resolveKeyframes(St)}class At{constructor(t,e,n,s,r,i=!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=r,this.isAsync=i}scheduleResolve(){this.isScheduled=!0,this.isAsync?(xt.add(this),Tt||(Tt=!0,o.read(Mt))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:s}=this;for(let r=0;r<t.length;r++)if(null===t[r])if(0===r){const r=null==s?void 0:s.get(),i=t[t.length-1];if(void 0!==r)t[0]=r;else if(n&&e){const s=n.readValue(e,i);null!=s&&(t[0]=s)}void 0===t[0]&&(t[0]=i),s&&void 0===r&&s.set(t[0])}else t[r]=t[r-1]}unsetTransforms(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),xt.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,xt.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Pt=(t,e)=>n=>Boolean(st(n)&&nt.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),kt=(t,e,n)=>s=>{if(!st(s))return s;const[r,i,o,a]=s.match(tt);return{[t]:parseFloat(r),[e]:parseFloat(i),[n]:parseFloat(o),alpha:void 0!==a?parseFloat(a):1}},Ct={...G,transform:t=>Math.round((t=>Z(0,255,t))(t))},Et={test:Pt("rgb","red"),parse:kt("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+Ct.transform(t)+", "+Ct.transform(e)+", "+Ct.transform(n)+", "+Q(_.transform(s))+")"};const Ft={test:Pt("#"),parse:function(t){let e="",n="",s="",r="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),r=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),r=t.substring(4,5),e+=e,n+=n,s+=s,r+=r),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:r?parseInt(r,16)/255:1}},transform:Et.transform},Ot={test:Pt("hsl","hue"),parse:kt("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+ot.transform(Q(e))+", "+ot.transform(Q(n))+", "+Q(_.transform(s))+")"},Rt={test:t=>Et.test(t)||Ft.test(t)||Ot.test(t),parse:t=>Et.test(t)?Et.parse(t):Ot.test(t)?Ot.parse(t):Ft.parse(t),transform:t=>st(t)?t:t.hasOwnProperty("red")?Et.transform(t):Ot.transform(t)};const Bt=/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 It(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},r=[];let i=0;const o=e.replace(Bt,t=>(Rt.test(t)?(s.color.push(i),r.push("color"),n.push(Rt.parse(t))):t.startsWith("var(")?(s.var.push(i),r.push("var"),n.push(t)):(s.number.push(i),r.push("number"),n.push(parseFloat(t))),++i,"${}")).split("${}");return{values:n,split:o,indexes:s,types:r}}function Lt(t){return It(t).values}function Dt(t){const{split:e,types:n}=It(t),s=e.length;return t=>{let r="";for(let i=0;i<s;i++)if(r+=e[i],void 0!==t[i]){const e=n[i];r+="number"===e?Q(t[i]):"color"===e?Rt.transform(t[i]):t[i]}return r}}const Wt=t=>"number"==typeof t?0:t;const Nt={test:function(t){var e,n;return isNaN(t)&&st(t)&&((null===(e=t.match(tt))||void 0===e?void 0:e.length)||0)+((null===(n=t.match(et))||void 0===n?void 0:n.length)||0)>0},parse:Lt,createTransformer:Dt,getAnimatableNone:function(t){const e=Lt(t);return Dt(t)(e.map(Wt))}},Kt=new Set(["brightness","contrast","saturate","opacity"]);function jt(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[s]=n.match(tt)||[];if(!s)return t;const r=n.replace(s,"");let i=Kt.has(e)?1:0;return s!==n&&(i*=100),e+"("+i+r+")"}const zt=/\b([a-z-]*)\(.*?\)/gu,$t={...Nt,getAnimatableNone:t=>{const e=t.match(zt);return e?e.map(jt).join(" "):t}},Ht={...G,transform:Math.round},Ut={borderWidth:at,borderTopWidth:at,borderRightWidth:at,borderBottomWidth:at,borderLeftWidth:at,borderRadius:at,radius:at,borderTopLeftRadius:at,borderTopRightRadius:at,borderBottomRightRadius:at,borderBottomLeftRadius:at,width:at,maxWidth:at,height:at,maxHeight:at,size:at,top:at,right:at,bottom:at,left:at,padding:at,paddingTop:at,paddingRight:at,paddingBottom:at,paddingLeft:at,margin:at,marginTop:at,marginRight:at,marginBottom:at,marginLeft:at,rotate:it,rotateX:it,rotateY:it,rotateZ:it,scale:J,scaleX:J,scaleY:J,scaleZ:J,skew:it,skewX:it,skewY:it,distance:at,translateX:at,translateY:at,translateZ:at,x:at,y:at,z:at,perspective:at,transformPerspective:at,opacity:_,originX:ct,originY:ct,originZ:at,zIndex:Ht,backgroundPositionX:at,backgroundPositionY:at,fillOpacity:_,strokeOpacity:_,numOctaves:Ht},Yt={...Ut,color:Rt,backgroundColor:Rt,outlineColor:Rt,fill:Rt,stroke:Rt,borderColor:Rt,borderTopColor:Rt,borderRightColor:Rt,borderBottomColor:Rt,borderLeftColor:Rt,filter:$t,WebkitFilter:$t},qt=t=>Yt[t];function Xt(t,e){let n=qt(t);return n!==$t&&(n=Nt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}class Zt extends At{constructor(t,e,n,s){super(t,e,n,s,null==s?void 0:s.owner,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){const s=t[n];if("string"==typeof s&&U(s)){const r=X(s,e.current);void 0!==r&&(t[n]=r)}}if(!ht.has(n)||2!==t.length)return this.resolveNoneKeyframes();const[s,r]=t,i=bt(s),o=bt(r);if(i!==o)if(dt(i)&&dt(o))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)("number"==typeof(s=t[e])?0===s:null===s||"none"===s||"0"===s||K(s))&&n.push(e);var s;n.length&&function(t,e,n){let s=0,r=void 0;for(;s<t.length&&!r;)"string"==typeof t[s]&&"none"!==t[s]&&"0"!==t[s]&&(r=t[s]),s++;if(r&&n)for(const s of e)t[s]=Xt(n,r)}(t,n,e)}unsetTransforms(){const{element:t,name:e,unresolvedKeyframes:n}=this;if(!t.current)return;this.removedTransforms=function(t){const e=[];return gt.forEach(n=>{const s=t.getValue(n);void 0!==s&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e.length&&t.render(),e}(t);const s=n[n.length-1];t.getValue(e,s).jump(s,!1)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;t.current&&("height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=vt[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin)}renderEndStyles(){this.element.render()}measureEndState(){var t;const{element:e,name:n,unresolvedKeyframes:s}=this;if(!e.current)return;const r=e.getValue(n);r&&r.jump(this.measuredOrigin,!1);const i=s.length-1,o=s[i];s[i]=vt[n](e.measureViewportBox(),window.getComputedStyle(e.current)),null!==o&&(this.finalKeyframe=o),"height"===n&&void 0!==this.suspendedScrollY&&window.scrollTo(0,this.suspendedScrollY),(null===(t=this.removedTransforms)||void 0===t?void 0:t.length)&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}}const Gt=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Nt.test(t)&&"0"!==t||t.startsWith("url(")));class _t{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:s=0,repeatDelay:r=0,repeatType:i="loop",...o}){this.isStopped=!1,this.options={autoplay:t,delay:e,type:n,repeat:s,repeatDelay:r,repeatType:i,...o},this.updateFinishedPromise()}get resolved(){return this._resolved||(Mt(),St(),a(Mt),a(St)),this._resolved}onKeyframesResolved(t,e){const{name:n,type:s,velocity:r,delay:i,onComplete:o,onUpdate:a}=this.options;if(!function(t,e,n,s){const r=t[0];if(null===r)return!1;const i=t[t.length-1],o=Gt(r,e),a=Gt(i,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&&s)}(t,n,s,r)){if(!i)return null==a||a(N(t,this.options,e)),null==o||o(),this.resolveFinishedPromise(),void this.updateFinishedPromise();this.options.duration=0}this._resolved={keyframes:t,finalKeyframe:e,...this.initPlayback(t,e)},this.onPostResolved()}onPostResolved(){}then(t,e){return this.currentFinishedPromise.then(t,e)}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=()=>{t(),this.updateFinishedPromise()}})}}function Jt(t,e,n){const s=Math.max(e-5,0);return d(n-t(s),e-s)}function Qt({duration:t=800,bounce:e=.25,velocity:n=0,mass:s=1}){let r,i;y(t<=E(10));let o=1-e;o=Z(.05,1,o),t=Z(.01,10,F(t)),o<1?(r=e=>{const s=e*o,r=s*t;return.001-(s-n)/te(e,o)*Math.exp(-r)},i=e=>{const s=e*o*t,i=s*n+n,a=Math.pow(o,2)*Math.pow(e,2)*t,l=Math.exp(-s),u=te(Math.pow(e,2),o);return(.001-r(e)>0?-1:1)*((i-a)*l)/u}):(r=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,i=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let s=n;for(let n=1;n<12;n++)s-=t(s)/e(s);return s}(r,i,5/t);if(t=E(t),isNaN(a))return{stiffness:100,damping:10,duration:t};{const e=Math.pow(a,2)*s;return{stiffness:e,damping:2*o*Math.sqrt(s*e),duration:t}}}function te(t,e){return t*Math.sqrt(1-e*e)}const ee=["duration","bounce"],ne=["stiffness","damping","mass"];function se(t,e){return e.some(e=>void 0!==t[e])}function re({keyframes:t,restDelta:e,restSpeed:n,...s}){const r=t[0],i=t[t.length-1],o={done:!1,value:r},{stiffness:a,damping:l,mass:u,duration:c,velocity:h,isResolvedFromDuration:d}=function(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!se(t,ne)&&se(t,ee)){const n=Qt(t);e={...e,...n,mass:1},e.isResolvedFromDuration=!0}return e}({...s,velocity:-F(s.velocity||0)}),p=h||0,f=l/(2*Math.sqrt(a*u)),m=i-r,g=F(Math.sqrt(a/u)),v=Math.abs(m)<5;let y;if(n||(n=v?.01:2),e||(e=v?.005:.5),f<1){const t=te(g,f);y=e=>{const n=Math.exp(-f*g*e);return i-n*((p+f*g*m)/t*Math.sin(t*e)+m*Math.cos(t*e))}}else if(1===f)y=t=>i-Math.exp(-g*t)*(m+(p+g*m)*t);else{const t=g*Math.sqrt(f*f-1);y=e=>{const n=Math.exp(-f*g*e),s=Math.min(t*e,300);return i-n*((p+f*g*m)*Math.sinh(s)+t*m*Math.cosh(s))/t}}return{calculatedDuration:d&&c||null,next:t=>{const s=y(t);if(d)o.done=t>=c;else{let r=p;0!==t&&(r=f<1?Jt(y,t,s):0);const a=Math.abs(r)<=n,l=Math.abs(i-s)<=e;o.done=a&&l}return o.value=o.done?i:s,o}}}function ie({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:r=10,bounceStiffness:i=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:c}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)<Math.abs(l-t)?a:l;let f=n*e;const m=h+f,g=void 0===o?m:o(m);g!==m&&(f=g-h);const v=t=>-f*Math.exp(-t/s),y=t=>g+v(t),w=t=>{const e=v(t),n=y(t);d.done=Math.abs(e)<=u,d.value=d.done?g:n};let b,x;const T=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==l&&e>l)&&(b=t,x=re({keyframes:[d.value,p(d.value)],velocity:Jt(y,t,d.value),damping:r,stiffness:i,restDelta:u,restSpeed:c}))};return T(0),{calculatedDuration:null,next:t=>{let e=!1;return x||void 0!==b||(e=!0,w(t),T(t)),void 0!==b&&t>=b?x.next(t-b):(!e&&w(t),d)}}}const oe=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function ae(t,n,s,r){if(t===n&&s===r)return e;const i=e=>function(t,e,n,s,r){let i,o,a=0;do{o=e+(n-e)/2,i=oe(o,s,r)-t,i>0?n=o:e=o}while(Math.abs(i)>1e-7&&++a<12);return o}(e,0,1,t,s);return t=>0===t||1===t?t:oe(i(t),n,r)}const le=ae(.42,0,1,1),ue=ae(0,0,.58,1),ce=ae(.42,0,.58,1),he=t=>Array.isArray(t)&&"number"!=typeof t[0],de=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,pe=t=>e=>1-t(1-e),fe=t=>1-Math.sin(Math.acos(t)),me=pe(fe),ge=de(fe),ve=ae(.33,1.53,.69,.99),ye=pe(ve),we=de(ye),be=t=>(t*=2)<1?.5*ye(t):.5*(2-Math.pow(2,-10*(t-1))),xe={linear:e,easeIn:le,easeInOut:ce,easeOut:ue,circIn:fe,circInOut:ge,circOut:me,backIn:ye,backInOut:we,backOut:ve,anticipate:be},Te=t=>{if(Array.isArray(t)){w(4===t.length);const[e,n,s,r]=t;return ae(e,n,s,r)}return"string"==typeof t?xe[t]:t},Ve=(t,e)=>n=>e(t(n)),Se=(...t)=>t.reduce(Ve),Me=(t,e,n)=>{const s=e-t;return 0===s?1:(n-t)/s},Ae=(t,e,n)=>t+(e-t)*n;function Pe(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}const ke=(t,e,n)=>{const s=t*t,r=n*(e*e-s)+s;return r<0?0:Math.sqrt(r)},Ce=[Ft,Et,Ot];function Ee(t){const e=(n=t,Ce.find(t=>t.test(n)));var n;let s=e.parse(t);return e===Ot&&(s=function({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,n/=100;let r=0,i=0,o=0;if(e/=100){const s=n<.5?n*(1+e):n+e-n*e,a=2*n-s;r=Pe(a,s,t+1/3),i=Pe(a,s,t),o=Pe(a,s,t-1/3)}else r=i=o=n;return{red:Math.round(255*r),green:Math.round(255*i),blue:Math.round(255*o),alpha:s}}(s)),s}const Fe=(t,e)=>{const n=Ee(t),s=Ee(e),r={...n};return t=>(r.red=ke(n.red,s.red,t),r.green=ke(n.green,s.green,t),r.blue=ke(n.blue,s.blue,t),r.alpha=Ae(n.alpha,s.alpha,t),Et.transform(r))};function Oe(t,e){return n=>n>0?e:t}function Re(t,e){return n=>Ae(t,e,n)}function Be(t){return"number"==typeof t?Re:"string"==typeof t?U(t)?Oe:Rt.test(t)?Fe:De:Array.isArray(t)?Ie:"object"==typeof t?Rt.test(t)?Fe:Le:Oe}function Ie(t,e){const n=[...t],s=n.length,r=t.map((t,n)=>Be(t)(t,e[n]));return t=>{for(let e=0;e<s;e++)n[e]=r[e](t);return n}}function Le(t,e){const n={...t,...e},s={};for(const r in n)void 0!==t[r]&&void 0!==e[r]&&(s[r]=Be(t[r])(t[r],e[r]));return t=>{for(const e in s)n[e]=s[e](t);return n}}const De=(t,e)=>{const n=Nt.createTransformer(e),s=It(t),r=It(e);return s.indexes.var.length===r.indexes.var.length&&s.indexes.color.length===r.indexes.color.length&&s.indexes.number.length>=r.indexes.number.length?Se(Ie(function(t,e){var n;const s=[],r={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const o=e.types[i],a=t.indexes[o][r[o]],l=null!==(n=t.values[a])&&void 0!==n?n:0;s[i]=l,r[o]++}return s}(s,r),r.values),n):Oe(t,e)};function We(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return Ae(t,e,n);return Be(t)(t,e)}function Ne(t,n,{clamp:s=!0,ease:r,mixer:i}={}){const o=t.length;if(w(o===n.length),1===o)return()=>n[0];if(2===o&&t[0]===t[1])return()=>n[1];t[0]>t[o-1]&&(t=[...t].reverse(),n=[...n].reverse());const a=function(t,n,s){const r=[],i=s||We,o=t.length-1;for(let s=0;s<o;s++){let o=i(t[s],t[s+1]);if(n){const t=Array.isArray(n)?n[s]||e:n;o=Se(t,o)}r.push(o)}return r}(n,r,i),l=a.length,u=e=>{let n=0;if(l>1)for(;n<t.length-2&&!(e<t[n+1]);n++);const s=Me(t[n],t[n+1],e);return a[n](s)};return s?e=>u(Z(t[0],t[o-1],e)):u}function Ke(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const r=Me(0,e,s);t.push(Ae(n,1,r))}}function je(t){const e=[0];return Ke(e,t.length-1),e}function ze({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const r=he(s)?s.map(Te):Te(s),i={done:!1,value:e[0]},o=Ne(function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:je(e),t),e,{ease:Array.isArray(r)?r:(a=e,l=r,a.map(()=>l||ce).splice(0,a.length-1))});var a,l;return{calculatedDuration:t,next:e=>(i.value=o(e),i.done=e>=t,i)}}function $e(t){let e=0;let n=t.next(e);for(;!n.done&&e<2e4;)e+=50,n=t.next(e);return e>=2e4?1/0:e}const He=t=>{const e=({timestamp:e})=>t(e);return{start:()=>o.update(e,!0),stop:()=>a(e),now:()=>l.isProcessing?l.timestamp:m.now()}},Ue={decay:ie,inertia:ie,tween:ze,keyframes:ze,spring:re},Ye=t=>t/100;class qe extends _t{constructor({KeyframeResolver:t=At,...e}){super(e),this.holdTime=null,this.startTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.state="idle";const{name:n,motionValue:s,keyframes:r}=this.options,i=(t,e)=>this.onKeyframesResolved(t,e);n&&s&&s.owner?this.resolver=s.owner.resolveKeyframes(r,i,n,s):this.resolver=new t(r,i,n,s),this.resolver.scheduleResolve()}initPlayback(t){const{type:e="keyframes",repeat:n=0,repeatDelay:s=0,repeatType:r,velocity:i=0}=this.options,o=Ue[e]||ze;let a,l;o!==ze&&"number"!=typeof t[0]&&(a=Se(Ye,We(t[0],t[1])),t=[0,100]);const u=o({...this.options,keyframes:t});"mirror"===r&&(l=o({...this.options,keyframes:[...t].reverse(),velocity:-i})),null===u.calculatedDuration&&(u.calculatedDuration=$e(u));const{calculatedDuration:c}=u,h=c+s;return{generator:u,mirroredGenerator:l,mapPercentToKeyframes:a,calculatedDuration:c,resolvedDuration:h,totalDuration:h*(n+1)-s}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&t?this.state=this.pendingPlayState:this.pause()}tick(t,e=!1){const{finalKeyframe:n,generator:s,mirroredGenerator:r,mapPercentToKeyframes:i,keyframes:o,calculatedDuration:a,totalDuration:l,resolvedDuration:u}=this.resolved;if(null===this.startTime)return s.next(0);const{delay:c,repeat:h,repeatType:d,repeatDelay:p,onUpdate:f}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-l/this.speed,this.startTime)),e?this.currentTime=t:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const m=this.currentTime-c*(this.speed>=0?1:-1),g=this.speed>=0?m<0:m>l;this.currentTime=Math.max(m,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=l);let v=this.currentTime,y=s;if(h){const t=Math.min(this.currentTime,l)/u;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/u)):"mirror"===d&&(y=r)),v=Z(0,1,n)*u}const w=g?{done:!1,value:o[0]}:y.next(v);i&&(w.value=i(w.value));let{done:b}=w;g||null===a||(b=this.speed>=0?this.currentTime>=l:this.currentTime<=0);const x=null===this.holdTime&&("finished"===this.state||"running"===this.state&&b);return x&&void 0!==n&&(w.value=N(o,this.options,n)),f&&f(w.value),x&&this.finish(),w}get duration(){return F(this.resolved.calculatedDuration)}get time(){return F(this.currentTime)}set time(t){t=E(t),this.currentTime=t,null!==this.holdTime||0===this.speed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=F(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:t=He,onPlay:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),e&&e();const n=this.driver.now();null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime&&"finished"!==this.state||(this.startTime=n),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;this._resolved?(this.state="paused",this.holdTime=null!==(t=this.currentTime)&&void 0!==t?t:0):this.pendingPlayState="paused"}stop(){if(this.isStopped=!0,"idle"===this.state)return;this.state="idle";const{onStop:t}=this.options;t&&t(),this.teardown()}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){null!==this.cancelTime&&this.tick(this.cancelTime),this.teardown()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const Xe=t=>Array.isArray(t)&&"number"==typeof t[0];function Ze(t){return Boolean(!t||"string"==typeof t&&_e[t]||Xe(t)||Array.isArray(t)&&t.every(Ze))}const Ge=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,_e={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ge([0,.65,.55,1]),circOut:Ge([.55,0,1,.45]),backIn:Ge([.31,.01,.66,-.59]),backOut:Ge([.33,1.53,.69,.99])};function Je(t){if(t)return Xe(t)?Ge(t):Array.isArray(t)?t.map(Je):_e[t]}const Qe=V(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),tn=new Set(["opacity","clipPath","filter","transform"]);class en extends _t{constructor(t){super(t);const{name:e,motionValue:n,keyframes:s}=this.options;this.resolver=new Zt(s,(t,e)=>this.onKeyframesResolved(t,e),e,n),this.resolver.scheduleResolve()}initPlayback(t,e){let n=this.options.duration||300;if("spring"===(s=this.options).type||"backgroundColor"===s.name||!Ze(s.ease)){const{onComplete:e,onUpdate:s,motionValue:r,...i}=this.options,o=function(t,e){const n=new qe({...e,keyframes:t,repeat:0,delay:0});let s={done:!1,value:t[0]};const r=[];let i=0;for(;!s.done&&i<2e4;)s=n.sample(i),r.push(s.value),i+=10;return{times:void 0,keyframes:r,duration:i-10,ease:"linear"}}(t,i);t=o.keyframes,n=o.duration,this.options.times=o.times,this.options.ease=o.ease}var s;const{motionValue:r,name:i}=this.options,o=function(t,e,n,{delay:s=0,duration:r=300,repeat:i=0,repeatType:o="loop",ease:a,times:l}={}){const u={[e]:n};l&&(u.offset=l);const c=Je(a);return Array.isArray(c)&&(u.easing=c),t.animate(u,{delay:s,duration:r,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:i+1,direction:"reverse"===o?"alternate":"normal"})}(r.owner.current,i,t,{...this.options,duration:n});return o.startTime=m.now(),this.pendingTimeline?(o.timeline=this.pendingTimeline,this.pendingTimeline=void 0):o.onfinish=()=>{const{onComplete:n}=this.options;r.set(N(t,this.options,e)),n&&n(),this.cancel(),this.resolveFinishedPromise(),this.updateFinishedPromise()},{animation:o,duration:n,keyframes:t}}get duration(){const{duration:t}=this.resolved;return F(t)}get time(){const{animation:t}=this.resolved;return F(t.currentTime||0)}set time(t){const{animation:e}=this.resolved;e.currentTime=E(t)}get speed(){const{animation:t}=this.resolved;return t.playbackRate}set speed(t){const{animation:e}=this.resolved;e.playbackRate=t}get state(){const{animation:t}=this.resolved;return t.playState}attachTimeline(t){if(this._resolved){const{animation:e}=this.resolved;e.timeline=t,e.onfinish=null}else this.pendingTimeline=t;return e}play(){if(this.isStopped)return;const{animation:t}=this.resolved;t.play()}pause(){const{animation:t}=this.resolved;t.pause()}stop(){this.isStopped=!0;const{animation:t,keyframes:e}=this.resolved;if("idle"!==t.playState&&"finished"!==t.playState){if(this.time){const{motionValue:t,onUpdate:n,onComplete:s,...r}=this.options,i=new qe({...r,keyframes:e});t.setWithVelocity(i.sample(this.time-10).value,i.sample(this.time).value,10)}this.cancel()}}complete(){this.resolved.animation.finish()}cancel(){this.resolved.animation.cancel()}static supports(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:r,damping:i,type:o}=t;return Qe()&&n&&tn.has(n)&&e&&e.owner&&e.owner.current instanceof HTMLElement&&!e.owner.getProps().onUpdate&&!s&&"mirror"!==r&&0!==i&&"inertia"!==o}}const nn=(t,e,s,r={},i,a)=>l=>{const u=L(r,t)||{},c=u.delay||r.delay||0;let{elapsed:h=0}=r;h-=E(c);let d={keyframes:Array.isArray(s)?s:[null,s],ease:"easeOut",velocity:e.getVelocity(),...u,delay:-h,onUpdate:t=>{e.set(t),u.onUpdate&&u.onUpdate(t)},onComplete:()=>{l(),u.onComplete&&u.onComplete()},name:t,motionValue:e,element:a?void 0:i};(function({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:r,repeat:i,repeatType:o,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length})(u)||(d={...d,...I(t,d)}),d.duration&&(d.duration=E(d.duration)),d.repeatDelay&&(d.repeatDelay=E(d.repeatDelay)),void 0!==d.from&&(d.keyframes[0]=d.from);let p=!1;if(!1===d.type&&(d.duration=0,0===d.delay&&(p=!0)),(D||n)&&(p=!0,d.duration=0,d.delay=0),p&&!a&&void 0!==e.get()){const t=N(d.keyframes,u);if(void 0!==t)return void o.update(()=>{d.onUpdate(t),d.onComplete()})}return!a&&en.supports(d)?new en(d):new qe(d)},sn=t=>Boolean(t&&t.getVelocity);function rn(t){return Boolean(sn(t)&&t.add)}const on=t=>(t=>Array.isArray(t))(t)?t[t.length-1]||0:t;function an(t,e,n,s={},r={}){return"function"==typeof e&&(e=e(void 0!==n?n:t.custom,s,r)),"string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e&&(e=e(void 0!==n?n:t.custom,s,r)),e}function ln(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,v(n))}function un(t,e){const n=function(t,e,n){const s=t.getProps();return an(s,e,void 0!==n?n:s.custom,function(t){const e={};return t.values.forEach((t,n)=>e[n]=t.get()),e}(t),function(t){const e={};return t.values.forEach((t,n)=>e[n]=t.getVelocity()),e}(t))}(t,e);let{transitionEnd:s={},transition:r={},...i}=n||{};i={...i,...s};for(const e in i){ln(t,e,on(i[e]))}}function cn({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,s}function hn(t,e,{delay:n=0,transitionOverride:s,type:r}={}){var i;let{transition:a=t.getDefaultTransition(),transitionEnd:l,...u}=e;const c=t.getValue("willChange");s&&(a=s);const h=[],d=r&&t.animationState&&t.animationState.getState()[r];for(const e in u){const s=t.getValue(e,null!==(i=t.latestValues[e])&&void 0!==i?i:null),r=u[e];if(void 0===r||d&&cn(d,e))continue;const o={delay:n,elapsed:0,...L(a||{},e)};let l=!1;if(window.HandoffAppearAnimations){const n=t.getProps()[C];if(n){const t=window.HandoffAppearAnimations(n,e);null!==t&&(o.elapsed=t,l=!0)}}s.start(nn(e,s,r,t.shouldReduceMotion&&P.has(e)?{type:!1}:o,t,l));const p=s.animation;p&&(rn(c)&&(c.add(e),p.then(()=>c.remove(e))),h.push(p))}return l&&Promise.all(h).then(()=>{o.update(()=>{l&&un(t,l)})}),h}const dn={};function pn(t,{layout:e,layoutId:n}){return P.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!dn[t]||"opacity"===t)}function fn(t,e){const{style:n}=t,s={};for(const r in n)(sn(n[r])||e.style&&sn(e.style[r])||pn(r,t))&&(s[r]=n[r]);return s}const mn="undefined"!=typeof document,gn={current:null},vn={current:!1};function yn(t){return"string"==typeof t||Array.isArray(t)}const wn=["initial","animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"];function bn(t){return null!==(e=t.animate)&&"object"==typeof e&&"function"==typeof e.start||wn.some(e=>yn(t[e]));var e}const xn={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"]},Tn={};for(const t in xn)Tn[t]={isEnabled:e=>xn[t].some(t=>!!e[t])};const Vn=[...wt,Rt,Nt],Sn=Object.keys(Tn),Mn=Sn.length,An=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],Pn=wn.length;class kn extends class{constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:s,blockInitialAnimation:r,visualState:i},a={}){this.resolveKeyframes=(t,e,n,s)=>new this.KeyframeResolver(t,e,n,s,this),this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=At,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.scheduleRender=()=>o.render(this.render,!1,!0);const{latestValues:l,renderState:u}=i;this.latestValues=l,this.baseTarget={...l},this.initialValues=e.initial?{...l}:{},this.renderState=u,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=a,this.blockInitialAnimation=Boolean(r),this.isControllingVariants=bn(e),this.isVariantNode=function(t){return Boolean(bn(t)||t.variants)}(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:c,...h}=this.scrapeMotionValuesFromProps(e,{});for(const t in h){const e=h[t];void 0!==l[t]&&sn(e)&&(e.set(l[t],!1),rn(c)&&c.add(t))}}scrapeMotionValuesFromProps(t,e){return{}}mount(t){this.current=t,x.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)),vn.current||function(){if(vn.current=!0,mn)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>gn.current=t.matches;t.addListener(e),e()}else gn.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||gn.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){x.delete(this.current),this.projection&&this.projection.unmount(),a(this.notifyUpdate),a(this.render),this.valueSubscriptions.forEach(t=>t()),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)this.features[t].unmount();this.current=null}bindToMotionValue(t,e){const n=P.has(t),s=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&o.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)}),r=e.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,()=>{s(),r()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}loadFeatures({children:t,...e},n,s,r){let i,o;for(let t=0;t<Mn;t++){const n=Sn[t],{isEnabled:s,Feature:r,ProjectionNode:a,MeasureLayout:l}=Tn[n];a&&(i=a),s(e)&&(!this.features[n]&&r&&(this.features[n]=new r(this)),l&&(o=l))}if(("html"===this.type||"svg"===this.type)&&!this.projection&&i){this.projection=new i(this.latestValues,this.parent&&this.parent.projection);const{layoutId:t,layout:n,drag:s,dragConstraints:o,layoutScroll:l,layoutRoot:u}=e;this.projection.setOptions({layoutId:t,layout:n,alwaysMeasureLayout:Boolean(s)||o&&(a=o,a&&"object"==typeof a&&Object.prototype.hasOwnProperty.call(a,"current")),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:u})}var a;return o}updateFeatures(){for(const t in this.features){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,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<An.length;e++){const n=An[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){const{willChange:s}=e;for(const r in e){const i=e[r],o=n[r];if(sn(i))t.addValue(r,i),rn(s)&&s.add(r);else if(sn(o))t.addValue(r,v(i,{owner:t})),rn(s)&&s.remove(r);else if(o!==i)if(t.hasValue(r)){const e=t.getValue(r);!e.hasAnimated&&e.set(i)}else{const e=t.getStaticValue(r);t.addValue(r,v(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.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}getVariantContext(t=!1){if(t)return this.parent?this.parent.getVariantContext():void 0;if(!this.isControllingVariants){const t=this.parent&&this.parent.getVariantContext()||{};return void 0!==this.props.initial&&(t.initial=this.props.initial),t}const e={};for(let t=0;t<Pn;t++){const n=wn[t],s=this.props[n];(yn(s)||!1===s)&&(e[n]=s)}return e}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){e!==this.values.get(t)&&(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=v(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){var n;let s=void 0===this.latestValues[t]&&this.current?null!==(n=this.getBaseTargetFromProps(this.props,t))&&void 0!==n?n:this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var r;return null!=s&&("string"==typeof s&&(j(s)||K(s))?s=parseFloat(s):(r=s,!Vn.find(yt(r))&&Nt.test(e)&&(s=Xt(t,e))),this.setBaseTarget(t,sn(s)?s.get():s)),sn(s)?s.get():s}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e,n;const{initial:s}=this.props,r="string"==typeof s||"object"==typeof s?null===(n=an(this.props,s,null===(e=this.presenceContext)||void 0===e?void 0:e.custom))||void 0===n?void 0:n[t]:void 0;if(s&&void 0!==r)return r;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||sn(i)?void 0!==this.initialValues[t]&&void 0===r?void 0:this.baseTarget[t]:i}on(t,e){return this.events[t]||(this.events[t]=new h),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}{constructor(){super(...arguments),this.KeyframeResolver=Zt}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]}}const Cn={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},En=A.length;const Fn=(t,e)=>e&&"number"==typeof t?e.transform(t):t;function On(t,e,n,s){const{style:r,vars:i,transform:o,transformOrigin:a}=t;let l=!1,u=!1,c=!0;for(const t in e){const n=e[t];if($(t)){i[t]=n;continue}const s=Ut[t],h=Fn(n,s);if(P.has(t)){if(l=!0,o[t]=h,!c)continue;n!==(s.default||0)&&(c=!1)}else t.startsWith("origin")?(u=!0,a[t]=h):r[t]=h}if(e.transform||(l||s?r.transform=function(t,{enableHardwareAcceleration:e=!0,allowTransformNone:n=!0},s,r){let i="";for(let e=0;e<En;e++){const n=A[e];if(void 0!==t[n]){i+=`${Cn[n]||n}(${t[n]}) `}}return e&&!t.z&&(i+="translateZ(0)"),i=i.trim(),r?i=r(t,s?"":i):n&&s&&(i="none"),i}(t.transform,n,c,s):r.transform&&(r.transform="none")),u){const{originX:t="50%",originY:e="50%",originZ:n=0}=a;r.transformOrigin=`${t} ${e} ${n}`}}function Rn(t,e,n){return"string"==typeof t?t:at.transform(e+n*t)}const Bn={offset:"stroke-dashoffset",array:"stroke-dasharray"},In={offset:"strokeDashoffset",array:"strokeDasharray"};function Ln(t,{attrX:e,attrY:n,attrScale:s,originX:r,originY:i,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...u},c,h,d){if(On(t,u,c,d),h)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:p,style:f,dimensions:m}=t;p.transform&&(m&&(f.transform=p.transform),delete p.transform),m&&(void 0!==r||void 0!==i||f.transform)&&(f.transformOrigin=function(t,e,n){return`${Rn(e,t.x,t.width)} ${Rn(n,t.y,t.height)}`}(m,void 0!==r?r:.5,void 0!==i?i:.5)),void 0!==e&&(p.x=e),void 0!==n&&(p.y=n),void 0!==s&&(p.scale=s),void 0!==o&&function(t,e,n=1,s=0,r=!0){t.pathLength=1;const i=r?Bn:In;t[i.offset]=at.transform(-s);const o=at.transform(e),a=at.transform(n);t[i.array]=`${o} ${a}`}(p,o,a,l,!1)}const Dn=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 Wn(t,{style:e,vars:n},s,r){Object.assign(t.style,e,r&&r.getProjectionStyles(s));for(const e in n)t.style.setProperty(e,n[e])}class Nn extends kn{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(P.has(e)){const t=qt(e);return t&&t.default||0}return e=Dn.has(e)?e:k(e),t.getAttribute(e)}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}scrapeMotionValuesFromProps(t,e){return function(t,e){const n=fn(t,e);for(const s in t)if(sn(t[s])||sn(e[s])){n[-1!==A.indexOf(s)?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s]=t[s]}return n}(t,e)}build(t,e,n,s){Ln(t,e,n,this.isSVGTag,s.transformTemplate)}renderInstance(t,e,n,s){!function(t,e,n,s){Wn(t,e,void 0,s);for(const n in e.attrs)t.setAttribute(Dn.has(n)?n:k(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 Kn extends kn{constructor(){super(...arguments),this.type="html"}readValueFromInstance(t,e){if(P.has(e)){const t=qt(e);return t&&t.default||0}{const s=(n=t,window.getComputedStyle(n)),r=($(e)?s.getPropertyValue(e):s[e])||0;return"string"==typeof r?r.trim():r}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,s){On(t,e,n,s.transformTemplate)}scrapeMotionValuesFromProps(t,e){return fn(t,e)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;sn(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=""+t)}))}renderInstance(t,e,n,s){Wn(t,e,n,s)}}function jn(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 Nn(e,{enableHardwareAcceleration:!1}):new Kn(e,{enableHardwareAcceleration:!0});n.mount(t),x.set(t,n)}function zn(t,e,n){const s=sn(t)?t:v(t);return s.start(nn("",s,e,n)),s.animation}function $n(t,e=100){const n=re({keyframes:[0,e],...t}),s=Math.min($e(n),2e4);return{type:"keyframes",ease:t=>n.next(s*t).value/e,duration:F(s)}}function Hn(t,e,n,s){var r;return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:null!==(r=s.get(e))&&void 0!==r?r:t}const Un=(t,e,n)=>{const s=e-t;return((n-t)%s+s)%s+t};function Yn(t,e){return he(t)?t[Un(0,t.length,e)]:t}function qn(t,e,n,s,r,i){!function(t,e,n){for(let s=0;s<t.length;s++){const r=t[s];r.at>e&&r.at<n&&(c(t,r),s--)}}(t,r,i);for(let o=0;o<e.length;o++)t.push({value:e[o],at:Ae(r,i,s[o]),easing:Yn(n,o)})}function Xn(t,e){return t.at===e.at?null===t.value?1:null===e.value?-1:0:t.at-e.at}function Zn(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function Gn(t,e){return e[t]||(e[t]=[]),e[t]}function _n(t){return Array.isArray(t)?t:[t]}function Jn(t,e){return t[e]?{...t,...t[e]}:{...t}}const Qn=t=>"number"==typeof t,ts=t=>t.every(Qn);function es(t,e,n,s){const r=b(t,s),i=r.length,o=[];for(let t=0;t<i;t++){const s=r[t];x.has(s)||jn(s);const a=x.get(s),l={...n};"function"==typeof l.delay&&(l.delay=l.delay(t,i)),o.push(...hn(a,{...e,transition:l},{}))}return new M(o)}function ns(t,e,n){const s=[];return function(t,{defaultTransition:e={},...n}={},s){const r=e.duration||.3,i=new Map,o=new Map,a={},l=new Map;let u=0,c=0,h=0;for(let n=0;n<t.length;n++){const i=t[n];if("string"==typeof i){l.set(i,c);continue}if(!Array.isArray(i)){l.set(i.name,Hn(c,i.at,u,l));continue}let[d,p,f={}]=i;void 0!==f.at&&(c=Hn(c,f.at,u,l));let m=0;const g=(t,n,s,i=0,o=0)=>{const a=_n(t),{delay:l=0,times:u=je(a),type:d="keyframes",...p}=n;let{ease:f=e.ease||"easeOut",duration:g}=n;const v="function"==typeof l?l(i,o):l,y=a.length;if(y<=2&&"spring"===d){let t=100;if(2===y&&ts(a)){const e=a[1]-a[0];t=Math.abs(e)}const e={...p};void 0!==g&&(e.duration=E(g));const n=$n(e,t);f=n.ease,g=n.duration}null!=g||(g=r);const w=c+v,b=w+g;1===u.length&&0===u[0]&&(u[1]=1);const x=u.length-a.length;x>0&&Ke(u,x),1===a.length&&a.unshift(null),qn(s,a,f,u,w,b),m=Math.max(v+g,m),h=Math.max(b,h)};if(sn(d)){g(p,f,Gn("default",Zn(d,o)))}else{const t=b(d,s,a),e=t.length;for(let n=0;n<e;n++){p=p,f=f;const s=Zn(t[n],o);for(const t in p)g(p[t],Jn(f,t),Gn(t,s),n,e)}}u=c,c+=m}return o.forEach((t,s)=>{for(const r in t){const o=t[r];o.sort(Xn);const a=[],l=[],u=[];for(let t=0;t<o.length;t++){const{at:e,value:n,easing:s}=o[t];a.push(n),l.push(Me(0,h,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)),i.has(s)||i.set(s,{keyframes:{},transition:{}});const c=i.get(s);c.keyframes[r]=a,c.transition[r]={...e,duration:h,ease:u,times:l,...n}}}),i}(t,e,n).forEach(({keyframes:t,transition:e},n)=>{let r;r=sn(n)?zn(n,t.default,e.default):es(n,t,e),s.push(r)}),new M(s)}const ss=t=>function(e,n,s){let r;var i;return i=e,r=Array.isArray(i)&&Array.isArray(i[0])?ns(e,n,t):function(t){return"object"==typeof t&&!Array.isArray(t)}(n)?es(e,n,s,t):zn(e,n,s),t&&t.animations.push(r),r},rs=ss(),is=new WeakMap;let os;function as({target:t,contentRect:e,borderBoxSize:n}){var s;null===(s=is.get(t))||void 0===s||s.forEach(s=>{s({target:t,contentSize:e,get size(){return function(t,e){if(e){const{inlineSize:t,blockSize:n}=e[0];return{width:t,height:n}}return t instanceof SVGElement&&"getBBox"in t?t.getBBox():{width:t.offsetWidth,height:t.offsetHeight}}(t,n)}})})}function ls(t){t.forEach(as)}function us(t,e){os||"undefined"!=typeof ResizeObserver&&(os=new ResizeObserver(ls));const n=b(t);return n.forEach(t=>{let n=is.get(t);n||(n=new Set,is.set(t,n)),n.add(e),null==os||os.observe(t)}),()=>{n.forEach(t=>{const n=is.get(t);null==n||n.delete(e),(null==n?void 0:n.size)||null==os||os.unobserve(t)})}}const cs=new Set;let hs;function ds(t){return cs.add(t),hs||(hs=()=>{const t={width:window.innerWidth,height:window.innerHeight},e={target:window,size:t,contentSize:t};cs.forEach(t=>t(e))},window.addEventListener("resize",hs)),()=>{cs.delete(t),!cs.size&&hs&&(hs=void 0)}}const ps={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function fs(t,e,n,s){const r=n[e],{length:i,position:o}=ps[e],a=r.current,l=n.time;r.current=t["scroll"+o],r.scrollLength=t["scroll"+i]-t["client"+i],r.offset.length=0,r.offset[0]=0,r.offset[1]=r.scrollLength,r.progress=Me(0,r.scrollLength,r.current);const u=s-l;r.velocity=u>50?0:d(r.current-a,u)}const ms={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},gs={start:0,center:.5,end:1};function vs(t,e,n=0){let s=0;if(void 0!==gs[t]&&(t=gs[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 ys=[0,0];function ws(t,e,n,s){let r=Array.isArray(t)?t:ys,i=0,o=0;return"number"==typeof t?r=[t,t]:"string"==typeof t&&(r=(t=t.trim()).includes(" ")?t.split(" "):[t,gs[t]?t:"0"]),i=vs(r[0],n,s),o=vs(r[1],e),i-o}const bs={x:0,y:0};function xs(t,e,n){const{offset:s=ms.All}=n,{target:r=t,axis:i="y"}=n,o="y"===i?"height":"width",a=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 r=null,i=s.parentNode;for(;!r;)"svg"===i.tagName&&(r=i),i=s.parentNode;s=r}}return n}(r,t):bs,l=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),u={width:t.clientWidth,height:t.clientHeight};e[i].offset.length=0;let c=!e[i].interpolate;const h=s.length;for(let t=0;t<h;t++){const n=ws(s[t],u[o],l[o],a[i]);c||n===e[i].interpolatorOffsets[t]||(c=!0),e[i].offset[t]=n}c&&(e[i].interpolate=Ne(e[i].offset,je(s)),e[i].interpolatorOffsets=[...e[i].offset]),e[i].progress=e[i].interpolate(e[i].current)}function Ts(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){fs(t,"x",e,n),fs(t,"y",e,n),e.time=n}(t,n,e),(s.offset||s.target)&&xs(t,n,s)},notify:()=>e(n)}}const Vs=new WeakMap,Ss=new WeakMap,Ms=new WeakMap,As=t=>t===document.documentElement?window:t;function Ps(t,{container:e=document.documentElement,...n}={}){let s=Ms.get(e);s||(s=new Set,Ms.set(e,s));const r=Ts(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(r),!Vs.has(e)){const t=()=>{for(const t of s)t.measure()},n=()=>{for(const t of s)t.update(l.timestamp)},r=()=>{for(const t of s)t.notify()},a=()=>{o.read(t,!1,!0),o.read(n,!1,!0),o.update(r,!1,!0)};Vs.set(e,a);const c=As(e);window.addEventListener("resize",a,{passive:!0}),e!==document.documentElement&&Ss.set(e,(u=a,"function"==typeof(i=e)?ds(i):us(i,u))),c.addEventListener("scroll",a,{passive:!0})}var i,u;const c=Vs.get(e);return o.read(c,!1,!0),()=>{var t;a(c);const n=Ms.get(e);if(!n)return;if(n.delete(r),n.size)return;const s=Vs.get(e);Vs.delete(e),s&&(As(e).removeEventListener("scroll",s),null===(t=Ss.get(e))||void 0===t||t(),window.removeEventListener("resize",s))}}const ks=new Map;function Cs({source:t=document.documentElement,axis:e="y"}={}){ks.has(t)||ks.set(t,{});const n=ks.get(t);return n[e]||(n[e]=S()?new ScrollTimeline({source:t,axis:e}):function({source:t,axis:e="y"}){const n={value:0},s=Ps(t=>{n.value=100*t[e].progress},{container:t,axis:e});return{currentTime:n,cancel:s}}({source:t,axis:e})),n[e]}const Es={some:0,all:1};const Fs=(t,e)=>Math.abs(t-e);const Os=o,Rs=i.reduce((t,e)=>(t[e]=t=>a(t),t),{});t.MotionValue=g,t.animate=rs,t.anticipate=be,t.backIn=ye,t.backInOut=we,t.backOut=ve,t.cancelFrame=a,t.cancelSync=Rs,t.circIn=fe,t.circInOut=ge,t.circOut=me,t.clamp=Z,t.createScopedAnimate=ss,t.cubicBezier=ae,t.delay=function(t,e){const n=m.now(),s=({timestamp:r})=>{const i=r-n;i>=e&&(a(s),t(i-e))};return o.read(s,!0),()=>a(s)},t.distance=Fs,t.distance2D=function(t,e){const n=Fs(t.x,e.x),s=Fs(t.y,e.y);return Math.sqrt(n**2+s**2)},t.easeIn=le,t.easeInOut=ce,t.easeOut=ue,t.frame=o,t.frameData=l,t.inView=function(t,e,{root:n,margin:s,amount:r="some"}={}){const i=b(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);"function"==typeof n?o.set(t.target,n):a.unobserve(t.target)}else n&&(n(t),o.delete(t.target))})},{root:n,rootMargin:s,threshold:"number"==typeof r?r:Es[r]});return i.forEach(t=>a.observe(t)),()=>a.disconnect()},t.interpolate=Ne,t.invariant=w,t.mirrorEasing=de,t.mix=We,t.motionValue=v,t.pipe=Se,t.progress=Me,t.reverseEasing=pe,t.scroll=function(t,e){const n=Cs(e);return"function"==typeof t?T(t,n):t.attachTimeline(n)},t.scrollInfo=Ps,t.stagger=function(t=.1,{startDelay:e=0,from:n=0,ease:s}={}){return(r,i)=>{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,i),a=Math.abs(o-r);let l=t*a;if(s){const e=i*t;l=Te(s)(l/e)*e}return e+l}},t.steps=u,t.sync=Os,t.transform=function(...t){const e=!Array.isArray(t[0]),n=e?0:-1,s=t[0+n],r=t[1+n],i=t[2+n],o=t[3+n],a=Ne(r,i,{mixer:(l=i[0],(t=>t&&"object"==typeof t&&t.mix)(l)?l.mix:void 0),...o});var l;return e?a(s):a},t.warning=y,t.wrap=Un,Object.defineProperty(t,"__esModule",{value:!0})}));
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={})}(this,(function(t){"use strict";const e=t=>t,n=!1,s=!1;class r{constructor(){this.order=[],this.scheduled=new Set}add(t){if(!this.scheduled.has(t))return this.scheduled.add(t),this.order.push(t),!0}remove(t){const e=this.order.indexOf(t);-1!==e&&(this.order.splice(e,1),this.scheduled.delete(t))}clear(){this.order.length=0,this.scheduled.clear()}}const i=["read","resolveKeyframes","update","preRender","render","postRender"];const{schedule:o,cancel:a,state:l,steps:u}=function(t,e){let n=!1,s=!0;const o={delta:0,timestamp:0,isProcessing:!1},a=i.reduce((t,e)=>(t[e]=function(t){let e=new r,n=new r,s=0,i=!1,o=!1;const a=new WeakSet,l={schedule:(t,r=!1,o=!1)=>{const l=o&&i,u=l?e:n;return r&&a.add(t),u.add(t)&&l&&i&&(s=e.order.length),t},cancel:t=>{n.remove(t),a.delete(t)},process:r=>{if(i)o=!0;else{if(i=!0,[e,n]=[n,e],n.clear(),s=e.order.length,s)for(let n=0;n<s;n++){const s=e.order[n];a.has(s)&&(l.schedule(s),t()),s(r)}i=!1,o&&(o=!1,l.process(r))}}};return l}(()=>n=!0),t),{}),l=t=>{a[t].process(o)},u=()=>{const r=performance.now();n=!1,o.delta=s?1e3/60:Math.max(Math.min(r-o.timestamp,40),1),o.timestamp=r,o.isProcessing=!0,i.forEach(l),o.isProcessing=!1,n&&e&&(s=!1,t(u))};return{schedule:i.reduce((e,r)=>{const i=a[r];return e[r]=(e,r=!1,a=!1)=>(n||(n=!0,s=!0,o.isProcessing||t(u)),i.schedule(e,r,a)),e},{}),cancel:t=>i.forEach(e=>a[e].cancel(t)),state:o,steps:a}}("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:e,!0);function c(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class h{constructor(){this.subscriptions=[]}add(t){var e,n;return e=this.subscriptions,n=t,-1===e.indexOf(n)&&e.push(n),()=>c(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 r=0;r<s;r++){const s=this.subscriptions[r];s&&s(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function d(t,e){return e?t*(1e3/e):0}let p;function f(){p=void 0}const m={now:()=>(void 0===p&&m.set(l.isProcessing||s?l.timestamp:performance.now()),p),set:t=>{p=t,queueMicrotask(f)}};class g{constructor(t,e={}){var n;this.version="11.0.14",this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(t,e=!0)=>{const n=m.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.canTrackVelocity=(n=this.current,!isNaN(parseFloat(n))),this.owner=e.owner}setCurrent(t){this.current=t,this.updatedAt=m.now()}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 h);const n=this.events[t].add(e);return"change"===t?()=>{n(),o.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=m.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return d(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function v(t,e){return new g(t,e)}let y=e,w=e;function b(t,e,n){var s;if("string"==typeof t){let r=document;e&&(w(Boolean(e.current)),r=e.current),n?(null!==(s=n[t])&&void 0!==s||(n[t]=r.querySelectorAll(t)),t=n[t]):t=r.querySelectorAll(t)}else t instanceof Element&&(t=[t]);return Array.from(t||[])}const x=new WeakMap;function T(t,e){let n;const s=()=>{const{currentTime:s}=e,r=(null===s?0:s.value)/100;n!==r&&t(r),n=r};return o.update(s,!0),()=>a(s)}function V(t){let e;return()=>(void 0===e&&(e=t()),e)}const S=V(()=>void 0!==window.ScrollTimeline);class M{constructor(t){this.animations=t.filter(Boolean)}then(t,e){return Promise.all(this.animations).then(t).catch(e)}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=>{if(!S()||!e.attachTimeline)return e.pause(),T(t=>{e.time=e.duration*t},t);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 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")}stop(){this.runAll("stop")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}const A=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],P=new Set(A),k=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),C="data-"+k("framerAppearId"),E=t=>1e3*t,F=t=>t/1e3,O={type:"spring",stiffness:500,damping:25,restSpeed:10},R={type:"keyframes",duration:.8},B={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},I=(t,{keyframes:e})=>e.length>2?R:P.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:O:B;function L(t,e){return t[e]||t.default||t}const D=!1,W=t=>null!==t;function N(t,{repeat:e,repeatType:n="loop"},s){const r=t.filter(W),i=e&&"loop"!==n&&e%2==1?0:r.length-1;return i&&void 0!==s?s:r[i]}const K=t=>/^0[^.\s]+$/u.test(t);const j=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),z=t=>e=>"string"==typeof e&&e.startsWith(t),$=z("--"),H=z("var(--"),U=t=>!!H(t)&&Y.test(t.split("/*")[0].trim()),Y=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,q=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function X(t,e,n=1){const[s,r]=function(t){const e=q.exec(t);if(!e)return[,];const[,n,s,r]=e;return["--"+(null!=n?n:s),r]}(t);if(!s)return;const i=window.getComputedStyle(e).getPropertyValue(s);if(i){const t=i.trim();return j(t)?parseFloat(t):t}return U(r)?X(r,e,n+1):r}const Z=(t,e,n)=>n>e?e:n<t?t:n,G={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},_={...G,transform:t=>Z(0,1,t)},J={...G,default:1},Q=t=>Math.round(1e5*t)/1e5,tt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,et=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,nt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;function st(t){return"string"==typeof t}const rt=t=>({test:e=>st(e)&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),it=rt("deg"),ot=rt("%"),at=rt("px"),lt=rt("vh"),ut=rt("vw"),ct={...ot,parse:t=>ot.parse(t)/100,transform:t=>ot.transform(100*t)},ht=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),dt=t=>t===G||t===at,pt=(t,e)=>parseFloat(t.split(", ")[e]),ft=(t,e)=>(n,{transform:s})=>{if("none"===s||!s)return 0;const r=s.match(/^matrix3d\((.+)\)$/u);if(r)return pt(r[1],e);{const e=s.match(/^matrix\((.+)\)$/u);return e?pt(e[1],t):0}},mt=new Set(["x","y","z"]),gt=A.filter(t=>!mt.has(t));const vt={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:ft(4,13),y:ft(5,14)};vt.translateX=vt.x,vt.translateY=vt.y;const yt=t=>e=>e.test(t),wt=[G,at,ot,it,ut,lt,{test:t=>"auto"===t,parse:t=>t}],bt=t=>wt.find(yt(t)),xt=new Set;let Tt=!1,Vt=!1;function St(){Vt&&(xt.forEach(t=>{t.needsMeasurement&&t.unsetTransforms()}),xt.forEach(t=>{t.needsMeasurement&&t.measureInitialState()}),xt.forEach(t=>{t.needsMeasurement&&t.renderEndStyles()}),xt.forEach(t=>{t.needsMeasurement&&t.measureEndState()})),Vt=!1,Tt=!1,xt.forEach(t=>t.complete()),xt.clear()}function Mt(){xt.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Vt=!0)})}class At{constructor(t,e,n,s,r,i=!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=r,this.isAsync=i}scheduleResolve(){this.isScheduled=!0,this.isAsync?(xt.add(this),Tt||(Tt=!0,o.read(Mt),o.resolveKeyframes(St))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:s}=this;for(let r=0;r<t.length;r++)if(null===t[r])if(0===r){const r=null==s?void 0:s.get(),i=t[t.length-1];if(void 0!==r)t[0]=r;else if(n&&e){const s=n.readValue(e,i);null!=s&&(t[0]=s)}void 0===t[0]&&(t[0]=i),s&&void 0===r&&s.set(t[0])}else t[r]=t[r-1]}unsetTransforms(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),xt.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,xt.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Pt=(t,e)=>n=>Boolean(st(n)&&nt.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),kt=(t,e,n)=>s=>{if(!st(s))return s;const[r,i,o,a]=s.match(tt);return{[t]:parseFloat(r),[e]:parseFloat(i),[n]:parseFloat(o),alpha:void 0!==a?parseFloat(a):1}},Ct={...G,transform:t=>Math.round((t=>Z(0,255,t))(t))},Et={test:Pt("rgb","red"),parse:kt("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+Ct.transform(t)+", "+Ct.transform(e)+", "+Ct.transform(n)+", "+Q(_.transform(s))+")"};const Ft={test:Pt("#"),parse:function(t){let e="",n="",s="",r="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),r=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),r=t.substring(4,5),e+=e,n+=n,s+=s,r+=r),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:r?parseInt(r,16)/255:1}},transform:Et.transform},Ot={test:Pt("hsl","hue"),parse:kt("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+ot.transform(Q(e))+", "+ot.transform(Q(n))+", "+Q(_.transform(s))+")"},Rt={test:t=>Et.test(t)||Ft.test(t)||Ot.test(t),parse:t=>Et.test(t)?Et.parse(t):Ot.test(t)?Ot.parse(t):Ft.parse(t),transform:t=>st(t)?t:t.hasOwnProperty("red")?Et.transform(t):Ot.transform(t)};const Bt=/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 It(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},r=[];let i=0;const o=e.replace(Bt,t=>(Rt.test(t)?(s.color.push(i),r.push("color"),n.push(Rt.parse(t))):t.startsWith("var(")?(s.var.push(i),r.push("var"),n.push(t)):(s.number.push(i),r.push("number"),n.push(parseFloat(t))),++i,"${}")).split("${}");return{values:n,split:o,indexes:s,types:r}}function Lt(t){return It(t).values}function Dt(t){const{split:e,types:n}=It(t),s=e.length;return t=>{let r="";for(let i=0;i<s;i++)if(r+=e[i],void 0!==t[i]){const e=n[i];r+="number"===e?Q(t[i]):"color"===e?Rt.transform(t[i]):t[i]}return r}}const Wt=t=>"number"==typeof t?0:t;const Nt={test:function(t){var e,n;return isNaN(t)&&st(t)&&((null===(e=t.match(tt))||void 0===e?void 0:e.length)||0)+((null===(n=t.match(et))||void 0===n?void 0:n.length)||0)>0},parse:Lt,createTransformer:Dt,getAnimatableNone:function(t){const e=Lt(t);return Dt(t)(e.map(Wt))}},Kt=new Set(["brightness","contrast","saturate","opacity"]);function jt(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[s]=n.match(tt)||[];if(!s)return t;const r=n.replace(s,"");let i=Kt.has(e)?1:0;return s!==n&&(i*=100),e+"("+i+r+")"}const zt=/\b([a-z-]*)\(.*?\)/gu,$t={...Nt,getAnimatableNone:t=>{const e=t.match(zt);return e?e.map(jt).join(" "):t}},Ht={...G,transform:Math.round},Ut={borderWidth:at,borderTopWidth:at,borderRightWidth:at,borderBottomWidth:at,borderLeftWidth:at,borderRadius:at,radius:at,borderTopLeftRadius:at,borderTopRightRadius:at,borderBottomRightRadius:at,borderBottomLeftRadius:at,width:at,maxWidth:at,height:at,maxHeight:at,size:at,top:at,right:at,bottom:at,left:at,padding:at,paddingTop:at,paddingRight:at,paddingBottom:at,paddingLeft:at,margin:at,marginTop:at,marginRight:at,marginBottom:at,marginLeft:at,rotate:it,rotateX:it,rotateY:it,rotateZ:it,scale:J,scaleX:J,scaleY:J,scaleZ:J,skew:it,skewX:it,skewY:it,distance:at,translateX:at,translateY:at,translateZ:at,x:at,y:at,z:at,perspective:at,transformPerspective:at,opacity:_,originX:ct,originY:ct,originZ:at,zIndex:Ht,backgroundPositionX:at,backgroundPositionY:at,fillOpacity:_,strokeOpacity:_,numOctaves:Ht},Yt={...Ut,color:Rt,backgroundColor:Rt,outlineColor:Rt,fill:Rt,stroke:Rt,borderColor:Rt,borderTopColor:Rt,borderRightColor:Rt,borderBottomColor:Rt,borderLeftColor:Rt,filter:$t,WebkitFilter:$t},qt=t=>Yt[t];function Xt(t,e){let n=qt(t);return n!==$t&&(n=Nt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}class Zt extends At{constructor(t,e,n,s){super(t,e,n,s,null==s?void 0:s.owner,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){const s=t[n];if("string"==typeof s&&U(s)){const r=X(s,e.current);void 0!==r&&(t[n]=r)}}if(!ht.has(n)||2!==t.length)return this.resolveNoneKeyframes();const[s,r]=t,i=bt(s),o=bt(r);if(i!==o)if(dt(i)&&dt(o))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)("number"==typeof(s=t[e])?0===s:null===s||"none"===s||"0"===s||K(s))&&n.push(e);var s;n.length&&function(t,e,n){let s=0,r=void 0;for(;s<t.length&&!r;)"string"==typeof t[s]&&"none"!==t[s]&&"0"!==t[s]&&(r=t[s]),s++;if(r&&n)for(const s of e)t[s]=Xt(n,r)}(t,n,e)}unsetTransforms(){const{element:t,name:e,unresolvedKeyframes:n}=this;if(!t.current)return;this.removedTransforms=function(t){const e=[];return gt.forEach(n=>{const s=t.getValue(n);void 0!==s&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e.length&&t.render(),e}(t);const s=n[n.length-1];t.getValue(e,s).jump(s,!1)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;t.current&&("height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=vt[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin)}renderEndStyles(){this.element.render()}measureEndState(){var t;const{element:e,name:n,unresolvedKeyframes:s}=this;if(!e.current)return;const r=e.getValue(n);r&&r.jump(this.measuredOrigin,!1);const i=s.length-1,o=s[i];s[i]=vt[n](e.measureViewportBox(),window.getComputedStyle(e.current)),null!==o&&(this.finalKeyframe=o),"height"===n&&void 0!==this.suspendedScrollY&&window.scrollTo(0,this.suspendedScrollY),(null===(t=this.removedTransforms)||void 0===t?void 0:t.length)&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}}const Gt=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Nt.test(t)&&"0"!==t||t.startsWith("url(")));class _t{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:s=0,repeatDelay:r=0,repeatType:i="loop",...o}){this.isStopped=!1,this.options={autoplay:t,delay:e,type:n,repeat:s,repeatDelay:r,repeatType:i,...o},this.updateFinishedPromise()}get resolved(){return this._resolved||(Mt(),St()),this._resolved}onKeyframesResolved(t,e){const{name:n,type:s,velocity:r,delay:i,onComplete:o,onUpdate:a}=this.options;if(!function(t,e,n,s){const r=t[0];if(null===r)return!1;const i=t[t.length-1],o=Gt(r,e),a=Gt(i,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&&s)}(t,n,s,r)){if(!i)return null==a||a(N(t,this.options,e)),null==o||o(),this.resolveFinishedPromise(),void this.updateFinishedPromise();this.options.duration=0}this._resolved={keyframes:t,finalKeyframe:e,...this.initPlayback(t,e)},this.onPostResolved()}onPostResolved(){}then(t,e){return this.currentFinishedPromise.then(t,e)}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=()=>{t(),this.updateFinishedPromise()}})}}function Jt(t,e,n){const s=Math.max(e-5,0);return d(n-t(s),e-s)}function Qt({duration:t=800,bounce:e=.25,velocity:n=0,mass:s=1}){let r,i;y(t<=E(10));let o=1-e;o=Z(.05,1,o),t=Z(.01,10,F(t)),o<1?(r=e=>{const s=e*o,r=s*t;return.001-(s-n)/te(e,o)*Math.exp(-r)},i=e=>{const s=e*o*t,i=s*n+n,a=Math.pow(o,2)*Math.pow(e,2)*t,l=Math.exp(-s),u=te(Math.pow(e,2),o);return(.001-r(e)>0?-1:1)*((i-a)*l)/u}):(r=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,i=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let s=n;for(let n=1;n<12;n++)s-=t(s)/e(s);return s}(r,i,5/t);if(t=E(t),isNaN(a))return{stiffness:100,damping:10,duration:t};{const e=Math.pow(a,2)*s;return{stiffness:e,damping:2*o*Math.sqrt(s*e),duration:t}}}function te(t,e){return t*Math.sqrt(1-e*e)}const ee=["duration","bounce"],ne=["stiffness","damping","mass"];function se(t,e){return e.some(e=>void 0!==t[e])}function re({keyframes:t,restDelta:e,restSpeed:n,...s}){const r=t[0],i=t[t.length-1],o={done:!1,value:r},{stiffness:a,damping:l,mass:u,duration:c,velocity:h,isResolvedFromDuration:d}=function(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!se(t,ne)&&se(t,ee)){const n=Qt(t);e={...e,...n,mass:1},e.isResolvedFromDuration=!0}return e}({...s,velocity:-F(s.velocity||0)}),p=h||0,f=l/(2*Math.sqrt(a*u)),m=i-r,g=F(Math.sqrt(a/u)),v=Math.abs(m)<5;let y;if(n||(n=v?.01:2),e||(e=v?.005:.5),f<1){const t=te(g,f);y=e=>{const n=Math.exp(-f*g*e);return i-n*((p+f*g*m)/t*Math.sin(t*e)+m*Math.cos(t*e))}}else if(1===f)y=t=>i-Math.exp(-g*t)*(m+(p+g*m)*t);else{const t=g*Math.sqrt(f*f-1);y=e=>{const n=Math.exp(-f*g*e),s=Math.min(t*e,300);return i-n*((p+f*g*m)*Math.sinh(s)+t*m*Math.cosh(s))/t}}return{calculatedDuration:d&&c||null,next:t=>{const s=y(t);if(d)o.done=t>=c;else{let r=p;0!==t&&(r=f<1?Jt(y,t,s):0);const a=Math.abs(r)<=n,l=Math.abs(i-s)<=e;o.done=a&&l}return o.value=o.done?i:s,o}}}function ie({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:r=10,bounceStiffness:i=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:c}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)<Math.abs(l-t)?a:l;let f=n*e;const m=h+f,g=void 0===o?m:o(m);g!==m&&(f=g-h);const v=t=>-f*Math.exp(-t/s),y=t=>g+v(t),w=t=>{const e=v(t),n=y(t);d.done=Math.abs(e)<=u,d.value=d.done?g:n};let b,x;const T=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==l&&e>l)&&(b=t,x=re({keyframes:[d.value,p(d.value)],velocity:Jt(y,t,d.value),damping:r,stiffness:i,restDelta:u,restSpeed:c}))};return T(0),{calculatedDuration:null,next:t=>{let e=!1;return x||void 0!==b||(e=!0,w(t),T(t)),void 0!==b&&t>=b?x.next(t-b):(!e&&w(t),d)}}}const oe=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function ae(t,n,s,r){if(t===n&&s===r)return e;const i=e=>function(t,e,n,s,r){let i,o,a=0;do{o=e+(n-e)/2,i=oe(o,s,r)-t,i>0?n=o:e=o}while(Math.abs(i)>1e-7&&++a<12);return o}(e,0,1,t,s);return t=>0===t||1===t?t:oe(i(t),n,r)}const le=ae(.42,0,1,1),ue=ae(0,0,.58,1),ce=ae(.42,0,.58,1),he=t=>Array.isArray(t)&&"number"!=typeof t[0],de=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,pe=t=>e=>1-t(1-e),fe=t=>1-Math.sin(Math.acos(t)),me=pe(fe),ge=de(fe),ve=ae(.33,1.53,.69,.99),ye=pe(ve),we=de(ye),be=t=>(t*=2)<1?.5*ye(t):.5*(2-Math.pow(2,-10*(t-1))),xe={linear:e,easeIn:le,easeInOut:ce,easeOut:ue,circIn:fe,circInOut:ge,circOut:me,backIn:ye,backInOut:we,backOut:ve,anticipate:be},Te=t=>{if(Array.isArray(t)){w(4===t.length);const[e,n,s,r]=t;return ae(e,n,s,r)}return"string"==typeof t?xe[t]:t},Ve=(t,e)=>n=>e(t(n)),Se=(...t)=>t.reduce(Ve),Me=(t,e,n)=>{const s=e-t;return 0===s?1:(n-t)/s},Ae=(t,e,n)=>t+(e-t)*n;function Pe(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}const ke=(t,e,n)=>{const s=t*t,r=n*(e*e-s)+s;return r<0?0:Math.sqrt(r)},Ce=[Ft,Et,Ot];function Ee(t){const e=(n=t,Ce.find(t=>t.test(n)));var n;let s=e.parse(t);return e===Ot&&(s=function({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,n/=100;let r=0,i=0,o=0;if(e/=100){const s=n<.5?n*(1+e):n+e-n*e,a=2*n-s;r=Pe(a,s,t+1/3),i=Pe(a,s,t),o=Pe(a,s,t-1/3)}else r=i=o=n;return{red:Math.round(255*r),green:Math.round(255*i),blue:Math.round(255*o),alpha:s}}(s)),s}const Fe=(t,e)=>{const n=Ee(t),s=Ee(e),r={...n};return t=>(r.red=ke(n.red,s.red,t),r.green=ke(n.green,s.green,t),r.blue=ke(n.blue,s.blue,t),r.alpha=Ae(n.alpha,s.alpha,t),Et.transform(r))};function Oe(t,e){return n=>n>0?e:t}function Re(t,e){return n=>Ae(t,e,n)}function Be(t){return"number"==typeof t?Re:"string"==typeof t?U(t)?Oe:Rt.test(t)?Fe:De:Array.isArray(t)?Ie:"object"==typeof t?Rt.test(t)?Fe:Le:Oe}function Ie(t,e){const n=[...t],s=n.length,r=t.map((t,n)=>Be(t)(t,e[n]));return t=>{for(let e=0;e<s;e++)n[e]=r[e](t);return n}}function Le(t,e){const n={...t,...e},s={};for(const r in n)void 0!==t[r]&&void 0!==e[r]&&(s[r]=Be(t[r])(t[r],e[r]));return t=>{for(const e in s)n[e]=s[e](t);return n}}const De=(t,e)=>{const n=Nt.createTransformer(e),s=It(t),r=It(e);return s.indexes.var.length===r.indexes.var.length&&s.indexes.color.length===r.indexes.color.length&&s.indexes.number.length>=r.indexes.number.length?Se(Ie(function(t,e){var n;const s=[],r={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const o=e.types[i],a=t.indexes[o][r[o]],l=null!==(n=t.values[a])&&void 0!==n?n:0;s[i]=l,r[o]++}return s}(s,r),r.values),n):Oe(t,e)};function We(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return Ae(t,e,n);return Be(t)(t,e)}function Ne(t,n,{clamp:s=!0,ease:r,mixer:i}={}){const o=t.length;if(w(o===n.length),1===o)return()=>n[0];if(2===o&&t[0]===t[1])return()=>n[1];t[0]>t[o-1]&&(t=[...t].reverse(),n=[...n].reverse());const a=function(t,n,s){const r=[],i=s||We,o=t.length-1;for(let s=0;s<o;s++){let o=i(t[s],t[s+1]);if(n){const t=Array.isArray(n)?n[s]||e:n;o=Se(t,o)}r.push(o)}return r}(n,r,i),l=a.length,u=e=>{let n=0;if(l>1)for(;n<t.length-2&&!(e<t[n+1]);n++);const s=Me(t[n],t[n+1],e);return a[n](s)};return s?e=>u(Z(t[0],t[o-1],e)):u}function Ke(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const r=Me(0,e,s);t.push(Ae(n,1,r))}}function je(t){const e=[0];return Ke(e,t.length-1),e}function ze({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const r=he(s)?s.map(Te):Te(s),i={done:!1,value:e[0]},o=Ne(function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:je(e),t),e,{ease:Array.isArray(r)?r:(a=e,l=r,a.map(()=>l||ce).splice(0,a.length-1))});var a,l;return{calculatedDuration:t,next:e=>(i.value=o(e),i.done=e>=t,i)}}function $e(t){let e=0;let n=t.next(e);for(;!n.done&&e<2e4;)e+=50,n=t.next(e);return e>=2e4?1/0:e}const He=t=>{const e=({timestamp:e})=>t(e);return{start:()=>o.update(e,!0),stop:()=>a(e),now:()=>l.isProcessing?l.timestamp:m.now()}},Ue={decay:ie,inertia:ie,tween:ze,keyframes:ze,spring:re},Ye=t=>t/100;class qe extends _t{constructor({KeyframeResolver:t=At,...e}){super(e),this.holdTime=null,this.startTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.state="idle";const{name:n,motionValue:s,keyframes:r}=this.options,i=(t,e)=>this.onKeyframesResolved(t,e);n&&s&&s.owner?this.resolver=s.owner.resolveKeyframes(r,i,n,s):this.resolver=new t(r,i,n,s),this.resolver.scheduleResolve()}initPlayback(t){const{type:e="keyframes",repeat:n=0,repeatDelay:s=0,repeatType:r,velocity:i=0}=this.options,o=Ue[e]||ze;let a,l;o!==ze&&"number"!=typeof t[0]&&(a=Se(Ye,We(t[0],t[1])),t=[0,100]);const u=o({...this.options,keyframes:t});"mirror"===r&&(l=o({...this.options,keyframes:[...t].reverse(),velocity:-i})),null===u.calculatedDuration&&(u.calculatedDuration=$e(u));const{calculatedDuration:c}=u,h=c+s;return{generator:u,mirroredGenerator:l,mapPercentToKeyframes:a,calculatedDuration:c,resolvedDuration:h,totalDuration:h*(n+1)-s}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&t?this.state=this.pendingPlayState:this.pause()}tick(t,e=!1){const{resolved:n}=this;if(!n){const{keyframes:t}=this.options;return{done:!0,value:t[t.length-1]}}const{finalKeyframe:s,generator:r,mirroredGenerator:i,mapPercentToKeyframes:o,keyframes:a,calculatedDuration:l,totalDuration:u,resolvedDuration:c}=n;if(null===this.startTime)return r.next(0);const{delay:h,repeat:d,repeatType:p,repeatDelay:f,onUpdate:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-u/this.speed,this.startTime)),e?this.currentTime=t:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const g=this.currentTime-h*(this.speed>=0?1:-1),v=this.speed>=0?g<0:g>u;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=u);let y=this.currentTime,w=r;if(d){const t=Math.min(this.currentTime,u)/c;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,d+1);Boolean(e%2)&&("reverse"===p?(n=1-n,f&&(n-=f/c)):"mirror"===p&&(w=i)),y=Z(0,1,n)*c}const b=v?{done:!1,value:a[0]}:w.next(y);o&&(b.value=o(b.value));let{done:x}=b;v||null===l||(x=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const T=null===this.holdTime&&("finished"===this.state||"running"===this.state&&x);return T&&void 0!==s&&(b.value=N(a,this.options,s)),m&&m(b.value),T&&this.finish(),b}get duration(){const{resolved:t}=this;return t?F(t.calculatedDuration):0}get time(){return F(this.currentTime)}set time(t){t=E(t),this.currentTime=t,null!==this.holdTime||0===this.speed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=F(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:t=He,onPlay:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),e&&e();const n=this.driver.now();null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime&&"finished"!==this.state||(this.startTime=n),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;this._resolved?(this.state="paused",this.holdTime=null!==(t=this.currentTime)&&void 0!==t?t:0):this.pendingPlayState="paused"}stop(){if(this.isStopped=!0,"idle"===this.state)return;this.state="idle";const{onStop:t}=this.options;t&&t(),this.teardown()}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){null!==this.cancelTime&&this.tick(this.cancelTime),this.teardown()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const Xe=t=>Array.isArray(t)&&"number"==typeof t[0];function Ze(t){return Boolean(!t||"string"==typeof t&&_e[t]||Xe(t)||Array.isArray(t)&&t.every(Ze))}const Ge=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,_e={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ge([0,.65,.55,1]),circOut:Ge([.55,0,1,.45]),backIn:Ge([.31,.01,.66,-.59]),backOut:Ge([.33,1.53,.69,.99])};function Je(t){if(t)return Xe(t)?Ge(t):Array.isArray(t)?t.map(Je):_e[t]}const Qe=V(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),tn=new Set(["opacity","clipPath","filter","transform"]);class en extends _t{constructor(t){super(t);const{name:e,motionValue:n,keyframes:s}=this.options;this.resolver=new Zt(s,(t,e)=>this.onKeyframesResolved(t,e),e,n),this.resolver.scheduleResolve()}initPlayback(t,e){let n=this.options.duration||300;if("spring"===(s=this.options).type||"backgroundColor"===s.name||!Ze(s.ease)){const{onComplete:e,onUpdate:s,motionValue:r,...i}=this.options,o=function(t,e){const n=new qe({...e,keyframes:t,repeat:0,delay:0});let s={done:!1,value:t[0]};const r=[];let i=0;for(;!s.done&&i<2e4;)s=n.sample(i),r.push(s.value),i+=10;return{times:void 0,keyframes:r,duration:i-10,ease:"linear"}}(t,i);t=o.keyframes,n=o.duration,this.options.times=o.times,this.options.ease=o.ease}var s;const{motionValue:r,name:i}=this.options,o=function(t,e,n,{delay:s=0,duration:r=300,repeat:i=0,repeatType:o="loop",ease:a,times:l}={}){const u={[e]:n};l&&(u.offset=l);const c=Je(a);return Array.isArray(c)&&(u.easing=c),t.animate(u,{delay:s,duration:r,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:i+1,direction:"reverse"===o?"alternate":"normal"})}(r.owner.current,i,t,{...this.options,duration:n});return o.startTime=m.now(),this.pendingTimeline?(o.timeline=this.pendingTimeline,this.pendingTimeline=void 0):o.onfinish=()=>{const{onComplete:n}=this.options;r.set(N(t,this.options,e)),n&&n(),this.cancel(),this.resolveFinishedPromise(),this.updateFinishedPromise()},{animation:o,duration:n,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:e}=t;return F(e)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:e}=t;return F(e.currentTime||0)}set time(t){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.currentTime=E(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:e}=t;return e.playbackRate}set speed(t){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:e}=t;return e.playState}attachTimeline(t){if(this._resolved){const{resolved:n}=this;if(!n)return e;const{animation:s}=n;s.timeline=t,s.onfinish=null}else this.pendingTimeline=t;return e}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:e}=t;e.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:e}=t;e.pause()}stop(){this.isStopped=!0;const{resolved:t}=this;if(!t)return;const{animation:e,keyframes:n}=t;if("idle"!==e.playState&&"finished"!==e.playState){if(this.time){const{motionValue:t,onUpdate:e,onComplete:s,...r}=this.options,i=new qe({...r,keyframes:n});t.setWithVelocity(i.sample(this.time-10).value,i.sample(this.time).value,10)}this.cancel()}}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:r,damping:i,type:o}=t;return Qe()&&n&&tn.has(n)&&e&&e.owner&&e.owner.current instanceof HTMLElement&&!e.owner.getProps().onUpdate&&!s&&"mirror"!==r&&0!==i&&"inertia"!==o}}const nn=(t,e,s,r={},i,a)=>l=>{const u=L(r,t)||{},c=u.delay||r.delay||0;let{elapsed:h=0}=r;h-=E(c);let d={keyframes:Array.isArray(s)?s:[null,s],ease:"easeOut",velocity:e.getVelocity(),...u,delay:-h,onUpdate:t=>{e.set(t),u.onUpdate&&u.onUpdate(t)},onComplete:()=>{l(),u.onComplete&&u.onComplete()},name:t,motionValue:e,element:a?void 0:i};(function({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:r,repeat:i,repeatType:o,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length})(u)||(d={...d,...I(t,d)}),d.duration&&(d.duration=E(d.duration)),d.repeatDelay&&(d.repeatDelay=E(d.repeatDelay)),void 0!==d.from&&(d.keyframes[0]=d.from);let p=!1;if(!1===d.type&&(d.duration=0,0===d.delay&&(p=!0)),(D||n)&&(p=!0,d.duration=0,d.delay=0),p&&!a&&void 0!==e.get()){const t=N(d.keyframes,u);if(void 0!==t)return void o.update(()=>{d.onUpdate(t),d.onComplete()})}return!a&&en.supports(d)?new en(d):new qe(d)},sn=t=>Boolean(t&&t.getVelocity);function rn(t){return Boolean(sn(t)&&t.add)}const on=t=>(t=>Array.isArray(t))(t)?t[t.length-1]||0:t;function an(t,e,n,s={},r={}){return"function"==typeof e&&(e=e(void 0!==n?n:t.custom,s,r)),"string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e&&(e=e(void 0!==n?n:t.custom,s,r)),e}function ln(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,v(n))}function un(t,e){const n=function(t,e,n){const s=t.getProps();return an(s,e,void 0!==n?n:s.custom,function(t){const e={};return t.values.forEach((t,n)=>e[n]=t.get()),e}(t),function(t){const e={};return t.values.forEach((t,n)=>e[n]=t.getVelocity()),e}(t))}(t,e);let{transitionEnd:s={},transition:r={},...i}=n||{};i={...i,...s};for(const e in i){ln(t,e,on(i[e]))}}function cn({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,s}function hn(t,e,{delay:n=0,transitionOverride:s,type:r}={}){var i;let{transition:a=t.getDefaultTransition(),transitionEnd:l,...u}=e;const c=t.getValue("willChange");s&&(a=s);const h=[],d=r&&t.animationState&&t.animationState.getState()[r];for(const e in u){const s=t.getValue(e,null!==(i=t.latestValues[e])&&void 0!==i?i:null),r=u[e];if(void 0===r||d&&cn(d,e))continue;const o={delay:n,elapsed:0,...L(a||{},e)};let l=!1;if(window.HandoffAppearAnimations){const n=t.getProps()[C];if(n){const t=window.HandoffAppearAnimations(n,e);null!==t&&(o.elapsed=t,l=!0)}}s.start(nn(e,s,r,t.shouldReduceMotion&&P.has(e)?{type:!1}:o,t,l));const p=s.animation;p&&(rn(c)&&(c.add(e),p.then(()=>c.remove(e))),h.push(p))}return l&&Promise.all(h).then(()=>{o.update(()=>{l&&un(t,l)})}),h}const dn={};function pn(t,{layout:e,layoutId:n}){return P.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!dn[t]||"opacity"===t)}function fn(t,e){const{style:n}=t,s={};for(const r in n)(sn(n[r])||e.style&&sn(e.style[r])||pn(r,t))&&(s[r]=n[r]);return s}const mn="undefined"!=typeof document,gn={current:null},vn={current:!1};function yn(t){return"string"==typeof t||Array.isArray(t)}const wn=["initial","animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"];function bn(t){return null!==(e=t.animate)&&"object"==typeof e&&"function"==typeof e.start||wn.some(e=>yn(t[e]));var e}const xn={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"]},Tn={};for(const t in xn)Tn[t]={isEnabled:e=>xn[t].some(t=>!!e[t])};const Vn=[...wt,Rt,Nt],Sn=Object.keys(Tn),Mn=Sn.length,An=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],Pn=wn.length;class kn extends class{constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:s,blockInitialAnimation:r,visualState:i},a={}){this.resolveKeyframes=(t,e,n,s)=>new this.KeyframeResolver(t,e,n,s,this),this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=At,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.scheduleRender=()=>o.render(this.render,!1,!0);const{latestValues:l,renderState:u}=i;this.latestValues=l,this.baseTarget={...l},this.initialValues=e.initial?{...l}:{},this.renderState=u,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=a,this.blockInitialAnimation=Boolean(r),this.isControllingVariants=bn(e),this.isVariantNode=function(t){return Boolean(bn(t)||t.variants)}(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:c,...h}=this.scrapeMotionValuesFromProps(e,{});for(const t in h){const e=h[t];void 0!==l[t]&&sn(e)&&(e.set(l[t],!1),rn(c)&&c.add(t))}}scrapeMotionValuesFromProps(t,e){return{}}mount(t){this.current=t,x.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)),vn.current||function(){if(vn.current=!0,mn)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>gn.current=t.matches;t.addListener(e),e()}else gn.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||gn.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){x.delete(this.current),this.projection&&this.projection.unmount(),a(this.notifyUpdate),a(this.render),this.valueSubscriptions.forEach(t=>t()),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)this.features[t].unmount();this.current=null}bindToMotionValue(t,e){const n=P.has(t),s=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&o.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)}),r=e.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,()=>{s(),r()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}loadFeatures({children:t,...e},n,s,r){let i,o;for(let t=0;t<Mn;t++){const n=Sn[t],{isEnabled:s,Feature:r,ProjectionNode:a,MeasureLayout:l}=Tn[n];a&&(i=a),s(e)&&(!this.features[n]&&r&&(this.features[n]=new r(this)),l&&(o=l))}if(("html"===this.type||"svg"===this.type)&&!this.projection&&i){this.projection=new i(this.latestValues,this.parent&&this.parent.projection);const{layoutId:t,layout:n,drag:s,dragConstraints:o,layoutScroll:l,layoutRoot:u}=e;this.projection.setOptions({layoutId:t,layout:n,alwaysMeasureLayout:Boolean(s)||o&&(a=o,a&&"object"==typeof a&&Object.prototype.hasOwnProperty.call(a,"current")),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:u})}var a;return o}updateFeatures(){for(const t in this.features){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,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<An.length;e++){const n=An[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){const{willChange:s}=e;for(const r in e){const i=e[r],o=n[r];if(sn(i))t.addValue(r,i),rn(s)&&s.add(r);else if(sn(o))t.addValue(r,v(i,{owner:t})),rn(s)&&s.remove(r);else if(o!==i)if(t.hasValue(r)){const e=t.getValue(r);!e.hasAnimated&&e.set(i)}else{const e=t.getStaticValue(r);t.addValue(r,v(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.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}getVariantContext(t=!1){if(t)return this.parent?this.parent.getVariantContext():void 0;if(!this.isControllingVariants){const t=this.parent&&this.parent.getVariantContext()||{};return void 0!==this.props.initial&&(t.initial=this.props.initial),t}const e={};for(let t=0;t<Pn;t++){const n=wn[t],s=this.props[n];(yn(s)||!1===s)&&(e[n]=s)}return e}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){e!==this.values.get(t)&&(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=v(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){var n;let s=void 0===this.latestValues[t]&&this.current?null!==(n=this.getBaseTargetFromProps(this.props,t))&&void 0!==n?n:this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var r;return null!=s&&("string"==typeof s&&(j(s)||K(s))?s=parseFloat(s):(r=s,!Vn.find(yt(r))&&Nt.test(e)&&(s=Xt(t,e))),this.setBaseTarget(t,sn(s)?s.get():s)),sn(s)?s.get():s}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e,n;const{initial:s}=this.props,r="string"==typeof s||"object"==typeof s?null===(n=an(this.props,s,null===(e=this.presenceContext)||void 0===e?void 0:e.custom))||void 0===n?void 0:n[t]:void 0;if(s&&void 0!==r)return r;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||sn(i)?void 0!==this.initialValues[t]&&void 0===r?void 0:this.baseTarget[t]:i}on(t,e){return this.events[t]||(this.events[t]=new h),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}{constructor(){super(...arguments),this.KeyframeResolver=Zt}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]}}const Cn={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},En=A.length;const Fn=(t,e)=>e&&"number"==typeof t?e.transform(t):t;function On(t,e,n,s){const{style:r,vars:i,transform:o,transformOrigin:a}=t;let l=!1,u=!1,c=!0;for(const t in e){const n=e[t];if($(t)){i[t]=n;continue}const s=Ut[t],h=Fn(n,s);if(P.has(t)){if(l=!0,o[t]=h,!c)continue;n!==(s.default||0)&&(c=!1)}else t.startsWith("origin")?(u=!0,a[t]=h):r[t]=h}if(e.transform||(l||s?r.transform=function(t,{enableHardwareAcceleration:e=!0,allowTransformNone:n=!0},s,r){let i="";for(let e=0;e<En;e++){const n=A[e];if(void 0!==t[n]){i+=`${Cn[n]||n}(${t[n]}) `}}return e&&!t.z&&(i+="translateZ(0)"),i=i.trim(),r?i=r(t,s?"":i):n&&s&&(i="none"),i}(t.transform,n,c,s):r.transform&&(r.transform="none")),u){const{originX:t="50%",originY:e="50%",originZ:n=0}=a;r.transformOrigin=`${t} ${e} ${n}`}}function Rn(t,e,n){return"string"==typeof t?t:at.transform(e+n*t)}const Bn={offset:"stroke-dashoffset",array:"stroke-dasharray"},In={offset:"strokeDashoffset",array:"strokeDasharray"};function Ln(t,{attrX:e,attrY:n,attrScale:s,originX:r,originY:i,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...u},c,h,d){if(On(t,u,c,d),h)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:p,style:f,dimensions:m}=t;p.transform&&(m&&(f.transform=p.transform),delete p.transform),m&&(void 0!==r||void 0!==i||f.transform)&&(f.transformOrigin=function(t,e,n){return`${Rn(e,t.x,t.width)} ${Rn(n,t.y,t.height)}`}(m,void 0!==r?r:.5,void 0!==i?i:.5)),void 0!==e&&(p.x=e),void 0!==n&&(p.y=n),void 0!==s&&(p.scale=s),void 0!==o&&function(t,e,n=1,s=0,r=!0){t.pathLength=1;const i=r?Bn:In;t[i.offset]=at.transform(-s);const o=at.transform(e),a=at.transform(n);t[i.array]=`${o} ${a}`}(p,o,a,l,!1)}const Dn=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 Wn(t,{style:e,vars:n},s,r){Object.assign(t.style,e,r&&r.getProjectionStyles(s));for(const e in n)t.style.setProperty(e,n[e])}class Nn extends kn{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(P.has(e)){const t=qt(e);return t&&t.default||0}return e=Dn.has(e)?e:k(e),t.getAttribute(e)}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}scrapeMotionValuesFromProps(t,e){return function(t,e){const n=fn(t,e);for(const s in t)if(sn(t[s])||sn(e[s])){n[-1!==A.indexOf(s)?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s]=t[s]}return n}(t,e)}build(t,e,n,s){Ln(t,e,n,this.isSVGTag,s.transformTemplate)}renderInstance(t,e,n,s){!function(t,e,n,s){Wn(t,e,void 0,s);for(const n in e.attrs)t.setAttribute(Dn.has(n)?n:k(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 Kn extends kn{constructor(){super(...arguments),this.type="html"}readValueFromInstance(t,e){if(P.has(e)){const t=qt(e);return t&&t.default||0}{const s=(n=t,window.getComputedStyle(n)),r=($(e)?s.getPropertyValue(e):s[e])||0;return"string"==typeof r?r.trim():r}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,s){On(t,e,n,s.transformTemplate)}scrapeMotionValuesFromProps(t,e){return fn(t,e)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;sn(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=""+t)}))}renderInstance(t,e,n,s){Wn(t,e,n,s)}}function jn(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 Nn(e,{enableHardwareAcceleration:!1}):new Kn(e,{enableHardwareAcceleration:!0});n.mount(t),x.set(t,n)}function zn(t,e,n){const s=sn(t)?t:v(t);return s.start(nn("",s,e,n)),s.animation}function $n(t,e=100){const n=re({keyframes:[0,e],...t}),s=Math.min($e(n),2e4);return{type:"keyframes",ease:t=>n.next(s*t).value/e,duration:F(s)}}function Hn(t,e,n,s){var r;return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:null!==(r=s.get(e))&&void 0!==r?r:t}const Un=(t,e,n)=>{const s=e-t;return((n-t)%s+s)%s+t};function Yn(t,e){return he(t)?t[Un(0,t.length,e)]:t}function qn(t,e,n,s,r,i){!function(t,e,n){for(let s=0;s<t.length;s++){const r=t[s];r.at>e&&r.at<n&&(c(t,r),s--)}}(t,r,i);for(let o=0;o<e.length;o++)t.push({value:e[o],at:Ae(r,i,s[o]),easing:Yn(n,o)})}function Xn(t,e){return t.at===e.at?null===t.value?1:null===e.value?-1:0:t.at-e.at}function Zn(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function Gn(t,e){return e[t]||(e[t]=[]),e[t]}function _n(t){return Array.isArray(t)?t:[t]}function Jn(t,e){return t[e]?{...t,...t[e]}:{...t}}const Qn=t=>"number"==typeof t,ts=t=>t.every(Qn);function es(t,e,n,s){const r=b(t,s),i=r.length,o=[];for(let t=0;t<i;t++){const s=r[t];x.has(s)||jn(s);const a=x.get(s),l={...n};"function"==typeof l.delay&&(l.delay=l.delay(t,i)),o.push(...hn(a,{...e,transition:l},{}))}return new M(o)}function ns(t,e,n){const s=[];return function(t,{defaultTransition:e={},...n}={},s){const r=e.duration||.3,i=new Map,o=new Map,a={},l=new Map;let u=0,c=0,h=0;for(let n=0;n<t.length;n++){const i=t[n];if("string"==typeof i){l.set(i,c);continue}if(!Array.isArray(i)){l.set(i.name,Hn(c,i.at,u,l));continue}let[d,p,f={}]=i;void 0!==f.at&&(c=Hn(c,f.at,u,l));let m=0;const g=(t,n,s,i=0,o=0)=>{const a=_n(t),{delay:l=0,times:u=je(a),type:d="keyframes",...p}=n;let{ease:f=e.ease||"easeOut",duration:g}=n;const v="function"==typeof l?l(i,o):l,y=a.length;if(y<=2&&"spring"===d){let t=100;if(2===y&&ts(a)){const e=a[1]-a[0];t=Math.abs(e)}const e={...p};void 0!==g&&(e.duration=E(g));const n=$n(e,t);f=n.ease,g=n.duration}null!=g||(g=r);const w=c+v,b=w+g;1===u.length&&0===u[0]&&(u[1]=1);const x=u.length-a.length;x>0&&Ke(u,x),1===a.length&&a.unshift(null),qn(s,a,f,u,w,b),m=Math.max(v+g,m),h=Math.max(b,h)};if(sn(d)){g(p,f,Gn("default",Zn(d,o)))}else{const t=b(d,s,a),e=t.length;for(let n=0;n<e;n++){p=p,f=f;const s=Zn(t[n],o);for(const t in p)g(p[t],Jn(f,t),Gn(t,s),n,e)}}u=c,c+=m}return o.forEach((t,s)=>{for(const r in t){const o=t[r];o.sort(Xn);const a=[],l=[],u=[];for(let t=0;t<o.length;t++){const{at:e,value:n,easing:s}=o[t];a.push(n),l.push(Me(0,h,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)),i.has(s)||i.set(s,{keyframes:{},transition:{}});const c=i.get(s);c.keyframes[r]=a,c.transition[r]={...e,duration:h,ease:u,times:l,...n}}}),i}(t,e,n).forEach(({keyframes:t,transition:e},n)=>{let r;r=sn(n)?zn(n,t.default,e.default):es(n,t,e),s.push(r)}),new M(s)}const ss=t=>function(e,n,s){let r;var i;return i=e,r=Array.isArray(i)&&Array.isArray(i[0])?ns(e,n,t):function(t){return"object"==typeof t&&!Array.isArray(t)}(n)?es(e,n,s,t):zn(e,n,s),t&&t.animations.push(r),r},rs=ss(),is=new WeakMap;let os;function as({target:t,contentRect:e,borderBoxSize:n}){var s;null===(s=is.get(t))||void 0===s||s.forEach(s=>{s({target:t,contentSize:e,get size(){return function(t,e){if(e){const{inlineSize:t,blockSize:n}=e[0];return{width:t,height:n}}return t instanceof SVGElement&&"getBBox"in t?t.getBBox():{width:t.offsetWidth,height:t.offsetHeight}}(t,n)}})})}function ls(t){t.forEach(as)}function us(t,e){os||"undefined"!=typeof ResizeObserver&&(os=new ResizeObserver(ls));const n=b(t);return n.forEach(t=>{let n=is.get(t);n||(n=new Set,is.set(t,n)),n.add(e),null==os||os.observe(t)}),()=>{n.forEach(t=>{const n=is.get(t);null==n||n.delete(e),(null==n?void 0:n.size)||null==os||os.unobserve(t)})}}const cs=new Set;let hs;function ds(t){return cs.add(t),hs||(hs=()=>{const t={width:window.innerWidth,height:window.innerHeight},e={target:window,size:t,contentSize:t};cs.forEach(t=>t(e))},window.addEventListener("resize",hs)),()=>{cs.delete(t),!cs.size&&hs&&(hs=void 0)}}const ps={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function fs(t,e,n,s){const r=n[e],{length:i,position:o}=ps[e],a=r.current,l=n.time;r.current=t["scroll"+o],r.scrollLength=t["scroll"+i]-t["client"+i],r.offset.length=0,r.offset[0]=0,r.offset[1]=r.scrollLength,r.progress=Me(0,r.scrollLength,r.current);const u=s-l;r.velocity=u>50?0:d(r.current-a,u)}const ms={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},gs={start:0,center:.5,end:1};function vs(t,e,n=0){let s=0;if(void 0!==gs[t]&&(t=gs[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 ys=[0,0];function ws(t,e,n,s){let r=Array.isArray(t)?t:ys,i=0,o=0;return"number"==typeof t?r=[t,t]:"string"==typeof t&&(r=(t=t.trim()).includes(" ")?t.split(" "):[t,gs[t]?t:"0"]),i=vs(r[0],n,s),o=vs(r[1],e),i-o}const bs={x:0,y:0};function xs(t,e,n){const{offset:s=ms.All}=n,{target:r=t,axis:i="y"}=n,o="y"===i?"height":"width",a=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 r=null,i=s.parentNode;for(;!r;)"svg"===i.tagName&&(r=i),i=s.parentNode;s=r}}return n}(r,t):bs,l=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),u={width:t.clientWidth,height:t.clientHeight};e[i].offset.length=0;let c=!e[i].interpolate;const h=s.length;for(let t=0;t<h;t++){const n=ws(s[t],u[o],l[o],a[i]);c||n===e[i].interpolatorOffsets[t]||(c=!0),e[i].offset[t]=n}c&&(e[i].interpolate=Ne(e[i].offset,je(s)),e[i].interpolatorOffsets=[...e[i].offset]),e[i].progress=e[i].interpolate(e[i].current)}function Ts(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){fs(t,"x",e,n),fs(t,"y",e,n),e.time=n}(t,n,e),(s.offset||s.target)&&xs(t,n,s)},notify:()=>e(n)}}const Vs=new WeakMap,Ss=new WeakMap,Ms=new WeakMap,As=t=>t===document.documentElement?window:t;function Ps(t,{container:e=document.documentElement,...n}={}){let s=Ms.get(e);s||(s=new Set,Ms.set(e,s));const r=Ts(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(r),!Vs.has(e)){const t=()=>{for(const t of s)t.measure()},n=()=>{for(const t of s)t.update(l.timestamp)},r=()=>{for(const t of s)t.notify()},a=()=>{o.read(t,!1,!0),o.read(n,!1,!0),o.update(r,!1,!0)};Vs.set(e,a);const c=As(e);window.addEventListener("resize",a,{passive:!0}),e!==document.documentElement&&Ss.set(e,(u=a,"function"==typeof(i=e)?ds(i):us(i,u))),c.addEventListener("scroll",a,{passive:!0})}var i,u;const c=Vs.get(e);return o.read(c,!1,!0),()=>{var t;a(c);const n=Ms.get(e);if(!n)return;if(n.delete(r),n.size)return;const s=Vs.get(e);Vs.delete(e),s&&(As(e).removeEventListener("scroll",s),null===(t=Ss.get(e))||void 0===t||t(),window.removeEventListener("resize",s))}}const ks=new Map;function Cs({source:t=document.documentElement,axis:e="y"}={}){ks.has(t)||ks.set(t,{});const n=ks.get(t);return n[e]||(n[e]=S()?new ScrollTimeline({source:t,axis:e}):function({source:t,axis:e="y"}){const n={value:0},s=Ps(t=>{n.value=100*t[e].progress},{container:t,axis:e});return{currentTime:n,cancel:s}}({source:t,axis:e})),n[e]}const Es={some:0,all:1};const Fs=(t,e)=>Math.abs(t-e);const Os=o,Rs=i.reduce((t,e)=>(t[e]=t=>a(t),t),{});t.MotionValue=g,t.animate=rs,t.anticipate=be,t.backIn=ye,t.backInOut=we,t.backOut=ve,t.cancelFrame=a,t.cancelSync=Rs,t.circIn=fe,t.circInOut=ge,t.circOut=me,t.clamp=Z,t.createScopedAnimate=ss,t.cubicBezier=ae,t.delay=function(t,e){const n=m.now(),s=({timestamp:r})=>{const i=r-n;i>=e&&(a(s),t(i-e))};return o.read(s,!0),()=>a(s)},t.distance=Fs,t.distance2D=function(t,e){const n=Fs(t.x,e.x),s=Fs(t.y,e.y);return Math.sqrt(n**2+s**2)},t.easeIn=le,t.easeInOut=ce,t.easeOut=ue,t.frame=o,t.frameData=l,t.inView=function(t,e,{root:n,margin:s,amount:r="some"}={}){const i=b(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);"function"==typeof n?o.set(t.target,n):a.unobserve(t.target)}else n&&(n(t),o.delete(t.target))})},{root:n,rootMargin:s,threshold:"number"==typeof r?r:Es[r]});return i.forEach(t=>a.observe(t)),()=>a.disconnect()},t.interpolate=Ne,t.invariant=w,t.mirrorEasing=de,t.mix=We,t.motionValue=v,t.pipe=Se,t.progress=Me,t.reverseEasing=pe,t.scroll=function(t,e){const n=Cs(e);return"function"==typeof t?T(t,n):t.attachTimeline(n)},t.scrollInfo=Ps,t.stagger=function(t=.1,{startDelay:e=0,from:n=0,ease:s}={}){return(r,i)=>{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,i),a=Math.abs(o-r);let l=t*a;if(s){const e=i*t;l=Te(s)(l/e)*e}return e+l}},t.steps=u,t.sync=Os,t.transform=function(...t){const e=!Array.isArray(t[0]),n=e?0:-1,s=t[0+n],r=t[1+n],i=t[2+n],o=t[3+n],a=Ne(r,i,{mixer:(l=i[0],(t=>t&&"object"==typeof t&&t.mix)(l)?l.mix:void 0),...o});var l;return e?a(s):a},t.warning=y,t.wrap=Un,Object.defineProperty(t,"__esModule",{value:!0})}));
@@ -128,27 +128,45 @@ class AcceleratedAnimation extends BaseAnimation {
128
128
  };
129
129
  }
130
130
  get duration() {
131
- const { duration } = this.resolved;
131
+ const { resolved } = this;
132
+ if (!resolved)
133
+ return 0;
134
+ const { duration } = resolved;
132
135
  return millisecondsToSeconds(duration);
133
136
  }
134
137
  get time() {
135
- const { animation } = this.resolved;
138
+ const { resolved } = this;
139
+ if (!resolved)
140
+ return 0;
141
+ const { animation } = resolved;
136
142
  return millisecondsToSeconds(animation.currentTime || 0);
137
143
  }
138
144
  set time(newTime) {
139
- const { animation } = this.resolved;
145
+ const { resolved } = this;
146
+ if (!resolved)
147
+ return;
148
+ const { animation } = resolved;
140
149
  animation.currentTime = secondsToMilliseconds(newTime);
141
150
  }
142
151
  get speed() {
143
- const { animation } = this.resolved;
152
+ const { resolved } = this;
153
+ if (!resolved)
154
+ return 1;
155
+ const { animation } = resolved;
144
156
  return animation.playbackRate;
145
157
  }
146
158
  set speed(newSpeed) {
147
- const { animation } = this.resolved;
159
+ const { resolved } = this;
160
+ if (!resolved)
161
+ return;
162
+ const { animation } = resolved;
148
163
  animation.playbackRate = newSpeed;
149
164
  }
150
165
  get state() {
151
- const { animation } = this.resolved;
166
+ const { resolved } = this;
167
+ if (!resolved)
168
+ return "idle";
169
+ const { animation } = resolved;
152
170
  return animation.playState;
153
171
  }
154
172
  /**
@@ -160,7 +178,10 @@ class AcceleratedAnimation extends BaseAnimation {
160
178
  this.pendingTimeline = timeline;
161
179
  }
162
180
  else {
163
- const { animation } = this.resolved;
181
+ const { resolved } = this;
182
+ if (!resolved)
183
+ return noop;
184
+ const { animation } = resolved;
164
185
  animation.timeline = timeline;
165
186
  animation.onfinish = null;
166
187
  }
@@ -169,16 +190,25 @@ class AcceleratedAnimation extends BaseAnimation {
169
190
  play() {
170
191
  if (this.isStopped)
171
192
  return;
172
- const { animation } = this.resolved;
193
+ const { resolved } = this;
194
+ if (!resolved)
195
+ return;
196
+ const { animation } = resolved;
173
197
  animation.play();
174
198
  }
175
199
  pause() {
176
- const { animation } = this.resolved;
200
+ const { resolved } = this;
201
+ if (!resolved)
202
+ return;
203
+ const { animation } = resolved;
177
204
  animation.pause();
178
205
  }
179
206
  stop() {
180
207
  this.isStopped = true;
181
- const { animation, keyframes } = this.resolved;
208
+ const { resolved } = this;
209
+ if (!resolved)
210
+ return;
211
+ const { animation, keyframes } = resolved;
182
212
  if (animation.playState === "idle" ||
183
213
  animation.playState === "finished") {
184
214
  return;
@@ -202,10 +232,16 @@ class AcceleratedAnimation extends BaseAnimation {
202
232
  this.cancel();
203
233
  }
204
234
  complete() {
205
- this.resolved.animation.finish();
235
+ const { resolved } = this;
236
+ if (!resolved)
237
+ return;
238
+ resolved.animation.finish();
206
239
  }
207
240
  cancel() {
208
- this.resolved.animation.cancel();
241
+ const { resolved } = this;
242
+ if (!resolved)
243
+ return;
244
+ resolved.animation.cancel();
209
245
  }
210
246
  static supports(options) {
211
247
  const { motionValue, name, repeatDelay, repeatType, damping, type } = options;
@@ -130,7 +130,13 @@ class MainThreadAnimation extends BaseAnimation {
130
130
  }
131
131
  }
132
132
  tick(timestamp, sample = false) {
133
- const { finalKeyframe, generator, mirroredGenerator, mapPercentToKeyframes, keyframes, calculatedDuration, totalDuration, resolvedDuration, } = this.resolved;
133
+ const { resolved } = this;
134
+ // If the animations has failed to resolve, return the final keyframe.
135
+ if (!resolved) {
136
+ const { keyframes } = this.options;
137
+ return { done: true, value: keyframes[keyframes.length - 1] };
138
+ }
139
+ const { finalKeyframe, generator, mirroredGenerator, mapPercentToKeyframes, keyframes, calculatedDuration, totalDuration, resolvedDuration, } = resolved;
134
140
  if (this.startTime === null)
135
141
  return generator.next(0);
136
142
  const { delay, repeat, repeatType, repeatDelay, onUpdate } = this.options;
@@ -247,7 +253,8 @@ class MainThreadAnimation extends BaseAnimation {
247
253
  return state;
248
254
  }
249
255
  get duration() {
250
- return millisecondsToSeconds(this.resolved.calculatedDuration);
256
+ const { resolved } = this;
257
+ return resolved ? millisecondsToSeconds(resolved.calculatedDuration) : 0;
251
258
  }
252
259
  get time() {
253
260
  return millisecondsToSeconds(this.currentTime);