framer-motion 9.1.2 → 9.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1077,8 +1077,9 @@ interface IProjectionNode<I = unknown> {
1077
1077
  projectionDeltaWithTransform?: Delta;
1078
1078
  latestValues: ResolvedValues;
1079
1079
  isLayoutDirty: boolean;
1080
- isTransformDirty: boolean;
1081
1080
  isProjectionDirty: boolean;
1081
+ isSharedProjectionDirty: boolean;
1082
+ isTransformDirty: boolean;
1082
1083
  shouldResetTransform: boolean;
1083
1084
  prevTransformTemplateValue: string | undefined;
1084
1085
  isUpdateBlocked(): boolean;
@@ -1119,6 +1120,7 @@ interface IProjectionNode<I = unknown> {
1119
1120
  getProjectionStyles(styles?: MotionStyle): MotionStyle | undefined;
1120
1121
  clearMeasurements(): void;
1121
1122
  resetTree(): void;
1123
+ isProjecting(): boolean;
1122
1124
  animationValues?: ResolvedValues;
1123
1125
  currentAnimation?: AnimationPlaybackControls;
1124
1126
  isTreeAnimating?: boolean;
@@ -1967,7 +1967,7 @@
1967
1967
  * This will be replaced by the build step with the latest version number.
1968
1968
  * When MotionValues are provided to motion components, warn if versions are mixed.
1969
1969
  */
1970
- this.version = "9.1.2";
1970
+ this.version = "9.1.3";
1971
1971
  /**
1972
1972
  * Duration, in milliseconds, since last updating frame.
1973
1973
  *
@@ -2889,6 +2889,12 @@
2889
2889
  hasEverUpdated: false,
2890
2890
  };
2891
2891
 
2892
+ function record(data) {
2893
+ if (window.MotionDebug) {
2894
+ window.MotionDebug.record(data);
2895
+ }
2896
+ }
2897
+
2892
2898
  const transformAxes = ["", "X", "Y", "Z"];
2893
2899
  /**
2894
2900
  * We use 1000 as the animation target as 0-1000 maps better to pixels than 0-1
@@ -2896,6 +2902,16 @@
2896
2902
  */
2897
2903
  const animationTarget = 1000;
2898
2904
  let id = 0;
2905
+ /**
2906
+ * Use a mutable data object for debug data so as to not create a new
2907
+ * object every frame.
2908
+ */
2909
+ const projectionFrameData = {
2910
+ type: "projectionFrame",
2911
+ totalNodes: 0,
2912
+ resolvedTargetDeltas: 0,
2913
+ recalculatedProjection: 0,
2914
+ };
2899
2915
  function createProjectionNode({ attachResizeListener, defaultParent, measureScroll, checkIsScrollRoot, resetTransform, }) {
2900
2916
  return class ProjectionNode {
2901
2917
  constructor(elementId, latestValues = {}, parent = defaultParent === null || defaultParent === void 0 ? void 0 : defaultParent()) {
@@ -2933,12 +2949,21 @@
2933
2949
  * and if one node is dirtied, they all are.
2934
2950
  */
2935
2951
  this.isLayoutDirty = false;
2936
- this.isTransformDirty = false;
2937
2952
  /**
2938
- * Flag to true if we think the projection calculations for this or any
2939
- * child might need recalculating as a result of an updated transform or layout animation.
2953
+ * Flag to true if we think the projection calculations for this node needs
2954
+ * recalculating as a result of an updated transform or layout animation.
2940
2955
  */
2941
2956
  this.isProjectionDirty = false;
2957
+ /**
2958
+ * Flag to true if the layout *or* transform has changed. This then gets propagated
2959
+ * throughout the projection tree, forcing any element below to recalculate on the next frame.
2960
+ */
2961
+ this.isSharedProjectionDirty = false;
2962
+ /**
2963
+ * Flag transform dirty. This gets propagated throughout the whole tree but is only
2964
+ * respected by shared nodes.
2965
+ */
2966
+ this.isTransformDirty = false;
2942
2967
  /**
2943
2968
  * Block layout updates for instant layout transitions throughout the tree.
2944
2969
  */
@@ -2989,9 +3014,19 @@
2989
3014
  * the next step.
2990
3015
  */
2991
3016
  this.updateProjection = () => {
3017
+ /**
3018
+ * Reset debug counts. Manually resetting rather than creating a new
3019
+ * object each frame.
3020
+ */
3021
+ projectionFrameData.totalNodes =
3022
+ projectionFrameData.resolvedTargetDeltas =
3023
+ projectionFrameData.recalculatedProjection =
3024
+ 0;
2992
3025
  this.nodes.forEach(propagateDirtyNodes);
2993
3026
  this.nodes.forEach(resolveTargetDelta);
2994
3027
  this.nodes.forEach(calcProjection);
3028
+ this.nodes.forEach(cleanDirtyNodes);
3029
+ record(projectionFrameData);
2995
3030
  };
2996
3031
  this.hasProjected = false;
2997
3032
  this.isVisible = true;
@@ -3447,13 +3482,10 @@
3447
3482
  }
3448
3483
  return boxWithoutTransform;
3449
3484
  }
3450
- /**
3451
- *
3452
- */
3453
3485
  setTargetDelta(delta) {
3454
3486
  this.targetDelta = delta;
3455
- this.isProjectionDirty = true;
3456
3487
  this.root.scheduleUpdateProjection();
3488
+ this.isProjectionDirty = true;
3457
3489
  }
3458
3490
  setOptions(options) {
3459
3491
  this.options = {
@@ -3475,6 +3507,7 @@
3475
3507
  * Frame calculations
3476
3508
  */
3477
3509
  resolveTargetDelta() {
3510
+ var _a;
3478
3511
  /**
3479
3512
  * Once the dirty status of nodes has been spread through the tree, we also
3480
3513
  * need to check if we have a shared node of a different depth that has itself
@@ -3483,11 +3516,17 @@
3483
3516
  const lead = this.getLead();
3484
3517
  this.isProjectionDirty || (this.isProjectionDirty = lead.isProjectionDirty);
3485
3518
  this.isTransformDirty || (this.isTransformDirty = lead.isTransformDirty);
3519
+ this.isSharedProjectionDirty || (this.isSharedProjectionDirty = lead.isSharedProjectionDirty);
3520
+ const isShared = Boolean(this.resumingFrom) || this !== lead;
3486
3521
  /**
3487
3522
  * We don't use transform for this step of processing so we don't
3488
3523
  * need to check whether any nodes have changed transform.
3489
3524
  */
3490
- if (!this.isProjectionDirty && !this.attemptToResolveRelativeTarget)
3525
+ const canSkip = !((isShared && this.isSharedProjectionDirty) ||
3526
+ this.isProjectionDirty ||
3527
+ ((_a = this.parent) === null || _a === void 0 ? void 0 : _a.isProjectionDirty) ||
3528
+ this.attemptToResolveRelativeTarget);
3529
+ if (canSkip)
3491
3530
  return;
3492
3531
  const { layout, layoutId } = this.options;
3493
3532
  /**
@@ -3577,6 +3616,10 @@
3577
3616
  this.relativeParent = this.relativeTarget = undefined;
3578
3617
  }
3579
3618
  }
3619
+ /**
3620
+ * Increase debug counter for resolved target deltas
3621
+ */
3622
+ projectionFrameData.resolvedTargetDeltas++;
3580
3623
  }
3581
3624
  getClosestProjectingParent() {
3582
3625
  if (!this.parent ||
@@ -3584,26 +3627,39 @@
3584
3627
  has2DTranslate(this.parent.latestValues)) {
3585
3628
  return undefined;
3586
3629
  }
3587
- if ((this.parent.relativeTarget ||
3588
- this.parent.targetDelta ||
3589
- this.parent.options.layoutRoot) &&
3590
- this.parent.layout) {
3630
+ if (this.parent.isProjecting()) {
3591
3631
  return this.parent;
3592
3632
  }
3593
3633
  else {
3594
3634
  return this.parent.getClosestProjectingParent();
3595
3635
  }
3596
3636
  }
3637
+ isProjecting() {
3638
+ return Boolean((this.relativeTarget ||
3639
+ this.targetDelta ||
3640
+ this.options.layoutRoot) &&
3641
+ this.layout);
3642
+ }
3597
3643
  calcProjection() {
3598
- const { isProjectionDirty, isTransformDirty } = this;
3599
- this.isProjectionDirty = this.isTransformDirty = false;
3644
+ var _a;
3600
3645
  const lead = this.getLead();
3601
3646
  const isShared = Boolean(this.resumingFrom) || this !== lead;
3602
3647
  let canSkip = true;
3603
- if (isProjectionDirty)
3648
+ /**
3649
+ * If this is a normal layout animation and neither this node nor its nearest projecting
3650
+ * is dirty then we can't skip.
3651
+ */
3652
+ if (this.isProjectionDirty || ((_a = this.parent) === null || _a === void 0 ? void 0 : _a.isProjectionDirty)) {
3604
3653
  canSkip = false;
3605
- if (isShared && isTransformDirty)
3654
+ }
3655
+ /**
3656
+ * If this is a shared layout animation and this node's shared projection is dirty then
3657
+ * we can't skip.
3658
+ */
3659
+ if (isShared &&
3660
+ (this.isSharedProjectionDirty || this.isTransformDirty)) {
3606
3661
  canSkip = false;
3662
+ }
3607
3663
  if (canSkip)
3608
3664
  return;
3609
3665
  const { layout, layoutId } = this.options;
@@ -3657,6 +3713,10 @@
3657
3713
  this.scheduleRender();
3658
3714
  this.notifyListeners("projectionUpdate", target);
3659
3715
  }
3716
+ /**
3717
+ * Increase debug counter for recalculated projections
3718
+ */
3719
+ projectionFrameData.recalculatedProjection++;
3660
3720
  }
3661
3721
  hide() {
3662
3722
  this.isVisible = false;
@@ -3699,6 +3759,7 @@
3699
3759
  this.options.crossfade === true &&
3700
3760
  !this.path.some(hasOpacityCrossfade));
3701
3761
  this.animationProgress = 0;
3762
+ let prevRelativeTarget;
3702
3763
  this.mixTargetDelta = (latest) => {
3703
3764
  const progress = latest / 1000;
3704
3765
  mixAxisDelta(targetDelta.x, delta.x, progress);
@@ -3711,6 +3772,17 @@
3711
3772
  this.relativeParent.layout) {
3712
3773
  calcRelativePosition(relativeLayout, this.layout.layoutBox, this.relativeParent.layout.layoutBox);
3713
3774
  mixBox(this.relativeTarget, this.relativeTargetOrigin, relativeLayout, progress);
3775
+ /**
3776
+ * If this is an unchanged relative target we can consider the
3777
+ * projection not dirty.
3778
+ */
3779
+ if (prevRelativeTarget &&
3780
+ boxEquals(this.relativeTarget, prevRelativeTarget)) {
3781
+ this.isProjectionDirty = false;
3782
+ }
3783
+ if (!prevRelativeTarget)
3784
+ prevRelativeTarget = createBox();
3785
+ copyBoxInto(prevRelativeTarget, this.relativeTarget);
3714
3786
  }
3715
3787
  if (isSharedLayoutAnimation) {
3716
3788
  this.animationValues = mixedValues;
@@ -4124,14 +4196,35 @@
4124
4196
  }
4125
4197
  function propagateDirtyNodes(node) {
4126
4198
  /**
4127
- * Propagate isProjectionDirty. Nodes are ordered by depth, so if the parent here
4128
- * is dirty we can simply pass this forward.
4199
+ * Increase debug counter for nodes encountered this frame
4129
4200
  */
4130
- node.isProjectionDirty || (node.isProjectionDirty = Boolean(node.parent && node.parent.isProjectionDirty));
4201
+ projectionFrameData.totalNodes++;
4202
+ if (!node.parent)
4203
+ return;
4131
4204
  /**
4132
- * Propagate isTransformDirty.
4205
+ * If this node isn't projecting, propagate isProjectionDirty. It will have
4206
+ * no performance impact but it will allow the next child that *is* projecting
4207
+ * but *isn't* dirty to just check its parent to see if *any* ancestor needs
4208
+ * correcting.
4133
4209
  */
4134
- node.isTransformDirty || (node.isTransformDirty = Boolean(node.parent && node.parent.isTransformDirty));
4210
+ if (!node.isProjecting()) {
4211
+ node.isProjectionDirty = node.parent.isProjectionDirty;
4212
+ }
4213
+ /**
4214
+ * Propagate isSharedProjectionDirty and isTransformDirty
4215
+ * throughout the whole tree. A future revision can take another look at
4216
+ * this but for safety we still recalcualte shared nodes.
4217
+ */
4218
+ node.isSharedProjectionDirty || (node.isSharedProjectionDirty = Boolean(node.isProjectionDirty ||
4219
+ node.parent.isProjectionDirty ||
4220
+ node.parent.isSharedProjectionDirty));
4221
+ node.isTransformDirty || (node.isTransformDirty = node.parent.isTransformDirty);
4222
+ }
4223
+ function cleanDirtyNodes(node) {
4224
+ node.isProjectionDirty =
4225
+ node.isSharedProjectionDirty =
4226
+ node.isTransformDirty =
4227
+ false;
4135
4228
  }
4136
4229
  function clearSnapshot(node) {
4137
4230
  node.clearSnapshot();
@@ -5074,7 +5167,7 @@
5074
5167
  * and warn against mismatches.
5075
5168
  */
5076
5169
  {
5077
- warnOnce(nextValue.version === "9.1.2", `Attempting to mix Framer Motion versions ${nextValue.version} with 9.1.2 may not work as expected.`);
5170
+ warnOnce(nextValue.version === "9.1.3", `Attempting to mix Framer Motion versions ${nextValue.version} with 9.1.3 may not work as expected.`);
5078
5171
  }
5079
5172
  }
5080
5173
  else if (isMotionValue(prevValue)) {
@@ -1 +1 @@
1
- import{q as t,t as e,u as n,v as s,w as r,x as i,y as o,z as a,A as u,B as c,C as l,D as h,E as p,F as d,r as f,G as m,d as v,H as g,I as y,n as b,J as w,c as V,K as A,L as P,i as C,f as S,M as x,b as M,m as T,a as E,N as F,g as k,p as I,O,P as N,s as D,h as L,o as R,j,k as B}from"./size-rollup-dom-animation-assets.js";function U(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}const z=t=>/^0[^.\s]+$/.test(t),q={delta:0,timestamp:0},H="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),$="undefined"!=typeof window?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(H()),1/60*1e3);let W=!0,K=!1,G=!1;const J=["read","update","preRender","render","postRender"],Y=J.reduce((t,e)=>(t[e]=function(t){let e=[],n=[],s=0,r=!1,i=!1;const o=new WeakSet,a={schedule:(t,i=!1,a=!1)=>{const u=a&&r,c=u?e:n;return i&&o.add(t),-1===c.indexOf(t)&&(c.push(t),u&&r&&(s=e.length)),t},cancel:t=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1),o.delete(t)},process:u=>{if(r)i=!0;else{if(r=!0,[e,n]=[n,e],n.length=0,s=e.length,s)for(let n=0;n<s;n++){const s=e[n];s(u),o.has(s)&&(a.schedule(s),t())}r=!1,i&&(i=!1,a.process(u))}}};return a}(()=>K=!0),t),{}),Z=J.reduce((t,e)=>{const n=Y[e];return t[e]=(t,e=!1,s=!1)=>(K||tt(),n.schedule(t,e,s)),t},{}),X=J.reduce((t,e)=>(t[e]=Y[e].cancel,t),{});J.reduce((t,e)=>(t[e]=()=>Y[e].process(q),t),{});const _=t=>Y[t].process(q),Q=t=>{K=!1,q.delta=W?1/60*1e3:Math.max(Math.min(t-q.timestamp,40),1),q.timestamp=t,G=!0,J.forEach(_),G=!1,K&&(W=!1,$(Q))},tt=()=>{K=!0,W=!0,G||$(Q)};class et{constructor(){this.subscriptions=[]}add(t){var e,n;return e=this.subscriptions,n=t,-1===e.indexOf(n)&&e.push(n),()=>function(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}(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 nt(t,e){return e?t*(1e3/e):0}class st{constructor(t,e={}){var n;this.version="9.1.2",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(t,e=!0)=>{this.prev=this.current,this.current=t;const{delta:n,timestamp:s}=q;this.lastUpdated!==s&&(this.timeDelta=n,this.lastUpdated=s,Z.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),e&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>Z.postRender(this.velocityCheck),this.velocityCheck=({timestamp:t})=>{t!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(n=this.current,!isNaN(parseFloat(n))),this.owner=e.owner}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new et);const n=this.events[t].add(e);return"change"===t?()=>{n(),Z.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=t,this.timeDelta=n}jump(t){this.updateAndNotify(t),this.prev=t,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?nt(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e)||null,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(){this.animation=null}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function rt(t,e){return new st(t,e)}const it=(n,s)=>r=>Boolean(t(r)&&e.test(r)&&r.startsWith(n)||s&&Object.prototype.hasOwnProperty.call(r,s)),ot=(e,s,r)=>i=>{if(!t(i))return i;const[o,a,u,c]=i.match(n);return{[e]:parseFloat(o),[s]:parseFloat(a),[r]:parseFloat(u),alpha:void 0!==c?parseFloat(c):1}},at={...i,transform:t=>Math.round((t=>o(0,255,t))(t))},ut={test:it("rgb","red"),parse:ot("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+at.transform(t)+", "+at.transform(e)+", "+at.transform(n)+", "+s(r.transform(i))+")"};const ct={test:it("#"),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:ut.transform},lt={test:it("hsl","hue"),parse:ot("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+a.transform(s(e))+", "+a.transform(s(n))+", "+s(r.transform(i))+")"},ht={test:t=>ut.test(t)||ct.test(t)||lt.test(t),parse:t=>ut.test(t)?ut.parse(t):lt.test(t)?lt.parse(t):ct.parse(t),transform:e=>t(e)?e:e.hasOwnProperty("red")?ut.transform(e):lt.transform(e)};function pt(t){"number"==typeof t&&(t=""+t);const e=[];let s=0,r=0;const o=t.match(u);o&&(s=o.length,t=t.replace(u,"${c}"),e.push(...o.map(ht.parse)));const a=t.match(n);return a&&(r=a.length,t=t.replace(n,"${n}"),e.push(...a.map(i.parse))),{values:e,numColors:s,numNumbers:r,tokenised:t}}function dt(t){return pt(t).values}function ft(t){const{values:e,numColors:n,tokenised:r}=pt(t),i=e.length;return t=>{let e=r;for(let r=0;r<i;r++)e=e.replace(r<n?"${c}":"${n}",r<n?ht.transform(t[r]):s(t[r]));return e}}const mt=t=>"number"==typeof t?0:t;const vt={test:function(e){var s,r;return isNaN(e)&&t(e)&&((null===(s=e.match(n))||void 0===s?void 0:s.length)||0)+((null===(r=e.match(u))||void 0===r?void 0:r.length)||0)>0},parse:dt,createTransformer:ft,getAnimatableNone:function(t){const e=dt(t);return ft(t)(e.map(mt))}},gt=new Set(["brightness","contrast","saturate","opacity"]);function yt(t){const[e,s]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[r]=s.match(n)||[];if(!r)return t;const i=s.replace(r,"");let o=gt.has(e)?1:0;return r!==s&&(o*=100),e+"("+o+i+")"}const bt=/([a-z-]*)\(.*?\)/g,wt={...vt,getAnimatableNone:t=>{const e=t.match(bt);return e?e.map(yt).join(" "):t}},Vt={...c,color:ht,backgroundColor:ht,outlineColor:ht,fill:ht,stroke:ht,borderColor:ht,borderTopColor:ht,borderRightColor:ht,borderBottomColor:ht,borderLeftColor:ht,filter:wt,WebkitFilter:wt},At=t=>Vt[t];function Pt(t,e){let n=At(t);return n!==wt&&(n=vt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Ct=t=>e=>e.test(t),St=[i,l,a,h,p,d,{test:t=>"auto"===t,parse:t=>t}],xt=t=>St.find(Ct(t)),Mt=[...St,ht,vt],Tt=t=>Mt.find(Ct(t));function Et(t,e,n){const s=t.getProps();return f(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))}function Ft(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,rt(n))}function kt(t,e){if(!e)return;return(e[t]||e.default||e).from}function It(t){return Boolean(v(t)&&t.add)}const Ot="data-"+g("framerAppearId"),Nt=t=>t;let Dt=Nt,Lt=Nt;const Rt=t=>1e3*t,jt=!1,Bt=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Ut=t=>e=>1-t(1-e),zt=t=>t*t,qt=Ut(zt),Ht=Bt(zt),$t=(t,e,n)=>-n*t+n*e+t;function Wt(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 Kt=(t,e,n)=>{const s=t*t;return Math.sqrt(Math.max(0,n*(e*e-s)+s))},Gt=[ct,ut,lt];function Jt(t){const e=(n=t,Gt.find(t=>t.test(n)));var n;let s=e.parse(t);return e===lt&&(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=Wt(a,s,t+1/3),i=Wt(a,s,t),o=Wt(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 Yt=(t,e)=>{const n=Jt(t),s=Jt(e),r={...n};return t=>(r.red=Kt(n.red,s.red,t),r.green=Kt(n.green,s.green,t),r.blue=Kt(n.blue,s.blue,t),r.alpha=$t(n.alpha,s.alpha,t),ut.transform(r))},Zt=(t,e)=>n=>e(t(n)),Xt=(...t)=>t.reduce(Zt);function _t(t,e){return"number"==typeof t?n=>$t(t,e,n):ht.test(t)?Yt(t,e):ee(t,e)}const Qt=(t,e)=>{const n=[...t],s=n.length,r=t.map((t,n)=>_t(t,e[n]));return t=>{for(let e=0;e<s;e++)n[e]=r[e](t);return n}},te=(t,e)=>{const n={...t,...e},s={};for(const r in n)void 0!==t[r]&&void 0!==e[r]&&(s[r]=_t(t[r],e[r]));return t=>{for(const e in s)n[e]=s[e](t);return n}},ee=(t,e)=>{const n=vt.createTransformer(e),s=pt(t),r=pt(e);return s.numColors===r.numColors&&s.numNumbers>=r.numNumbers?Xt(Qt(s.values,r.values),n):n=>""+(n>0?e:t)},ne=(t,e,n)=>{const s=e-t;return 0===s?1:(n-t)/s},se=(t,e)=>n=>$t(t,e,n);function re(t,e,n){const s=[],r=n||("number"==typeof(i=t[0])?se:"string"==typeof i?ht.test(i)?Yt:ee:Array.isArray(i)?Qt:"object"==typeof i?te:se);var i;const o=t.length-1;for(let n=0;n<o;n++){let i=r(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]:e;i=Xt(t,i)}s.push(i)}return s}function ie(t,e,{clamp:n=!0,ease:s,mixer:r}={}){const i=t.length;Lt(i===e.length),Lt(!s||!Array.isArray(s)||s.length===i-1),t[0]>t[i-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=re(e,s,r),u=a.length,c=e=>{let n=0;if(u>1)for(;n<t.length-2&&!(e<t[n+1]);n++);const s=ne(t[n],t[n+1],e);return a[n](s)};return n?e=>c(o(t[0],t[i-1],e)):c}function oe(t){const e=[0];return function(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const r=ne(0,e,s);t.push($t(n,1,r))}}(e,t.length-1),e}const ae=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function ue(t,e,n,s){if(t===e&&n===s)return Nt;const r=e=>function(t,e,n,s,r){let i,o,a=0;do{o=e+(n-e)/2,i=ae(o,s,r)-t,i>0?n=o:e=o}while(Math.abs(i)>1e-7&&++a<12);return o}(e,0,1,t,n);return t=>0===t||1===t?t:ae(r(t),e,s)}const ce=t=>1-Math.sin(Math.acos(t)),le=Ut(ce),he=Bt(le),pe=ue(.33,1.53,.69,.99),de=Ut(pe),fe=Bt(de),me={linear:Nt,easeIn:zt,easeInOut:Ht,easeOut:qt,circIn:ce,circInOut:he,circOut:le,backIn:de,backInOut:fe,backOut:pe,anticipate:t=>(t*=2)<1?.5*de(t):.5*(2-Math.pow(2,-10*(t-1)))},ve=t=>{if(Array.isArray(t)){Lt(4===t.length);const[e,n,s,r]=t;return ue(e,n,s,r)}return"string"==typeof t?me[t]:t};function ge({keyframes:t,ease:e=Ht,times:n,duration:s=300}){t=[...t];const r=(t=>Array.isArray(t)&&"number"!=typeof t[0])(e)?e.map(ve):ve(e),i={done:!1,value:t[0]},o=function(t,e){return t.map(t=>t*e)}(n&&n.length===t.length?n:oe(t),s);function a(){return ie(o,t,{ease:Array.isArray(r)?r:(e=t,n=r,e.map(()=>n||Ht).splice(0,e.length-1))});var e,n}let u=a();return{next:t=>(i.value=u(t),i.done=t>=s,i),flipTarget:()=>{t.reverse(),u=a()}}}function ye({duration:t=800,bounce:e=.25,velocity:n=0,mass:s=1}){let r,i;Dt(t<=1e4);let a=1-e;a=o(.05,1,a),t=o(.01,10,t/1e3),a<1?(r=e=>{const s=e*a,r=s*t;return.001-(s-n)/be(e,a)*Math.exp(-r)},i=e=>{const s=e*a*t,i=s*n+n,o=Math.pow(a,2)*Math.pow(e,2)*t,u=Math.exp(-s),c=be(Math.pow(e,2),a);return(.001-r(e)>0?-1:1)*((i-o)*u)/c}):(r=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,i=e=>Math.exp(-e*t)*(t*t*(n-e)));const u=function(t,e,n){let s=n;for(let n=1;n<12;n++)s-=t(s)/e(s);return s}(r,i,5/t);if(t*=1e3,isNaN(u))return{stiffness:100,damping:10,duration:t};{const e=Math.pow(u,2)*s;return{stiffness:e,damping:2*a*Math.sqrt(s*e),duration:t}}}function be(t,e){return t*Math.sqrt(1-e*e)}const we=["duration","bounce"],Ve=["stiffness","damping","mass"];function Ae(t,e){return e.some(e=>void 0!==t[e])}function Pe({keyframes:t,restDelta:e,restSpeed:n,...s}){let r=t[0],i=t[t.length-1];const o={done:!1,value:r},{stiffness:a,damping:u,mass:c,velocity:l,duration:h,isResolvedFromDuration:p}=function(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!Ae(t,Ve)&&Ae(t,we)){const n=ye(t);e={...e,...n,velocity:0,mass:1},e.isResolvedFromDuration=!0}return e}(s);let d=Ce,f=l?-l/1e3:0;const m=u/(2*Math.sqrt(a*c));function v(){const t=i-r,s=Math.sqrt(a/c)/1e3,o=Math.abs(t)<5;if(n||(n=o?.01:2),e||(e=o?.005:.5),m<1){const e=be(s,m);d=n=>{const r=Math.exp(-m*s*n);return i-r*((f+m*s*t)/e*Math.sin(e*n)+t*Math.cos(e*n))}}else if(1===m)d=e=>i-Math.exp(-s*e)*(t+(f+s*t)*e);else{const e=s*Math.sqrt(m*m-1);d=n=>{const r=Math.exp(-m*s*n),o=Math.min(e*n,300);return i-r*((f+m*s*t)*Math.sinh(o)+e*t*Math.cosh(o))/e}}}return v(),{next:t=>{const s=d(t);if(p)o.done=t>=h;else{let r=f;if(0!==t)if(m<1){const e=Math.max(0,t-5);r=nt(s-d(e),t-e)}else r=0;const a=Math.abs(r)<=n,u=Math.abs(i-s)<=e;o.done=a&&u}return o.value=o.done?i:s,o},flipTarget:()=>{f=-f,[r,i]=[i,r],v()}}}Pe.needsInterpolation=(t,e)=>"string"==typeof t||"string"==typeof e;const Ce=t=>0;const Se={decay:function({keyframes:t=[0],velocity:e=0,power:n=.8,timeConstant:s=350,restDelta:r=.5,modifyTarget:i}){const o=t[0],a={done:!1,value:o};let u=n*e;const c=o+u,l=void 0===i?c:i(c);return l!==c&&(u=l-o),{next:t=>{const e=-u*Math.exp(-t/s);return a.done=!(e>r||e<-r),a.value=a.done?l:l+e,a},flipTarget:()=>{}}},keyframes:ge,tween:ge,spring:Pe};function xe(t,e,n=0){return t-e-n}const Me=t=>{const e=({delta:e})=>t(e);return{start:()=>Z.update(e,!0),stop:()=>X.update(e)}};function Te({duration:t,driver:e=Me,elapsed:n=0,repeat:s=0,repeatType:r="loop",repeatDelay:i=0,keyframes:o,autoplay:a=!0,onPlay:u,onStop:c,onComplete:l,onRepeat:h,onUpdate:p,type:d="keyframes",...f}){const m=n;let v,g,y=0,b=t,w=!1,V=!0;const A=Se[o.length>2?"keyframes":d]||ge,P=o[0],C=o[o.length-1];let S={done:!1,value:P};const{needsInterpolation:x}=A;x&&x(P,C)&&(g=ie([0,100],[P,C],{clamp:!1}),o=[0,100]);const M=A({...f,duration:t,keyframes:o});function T(){y++,"reverse"===r?(V=y%2==0,n=function(t,e=0,n=0,s=!0){return s?xe(e+-t,e,n):e-(t-e)+n}(n,b,i,V)):(n=xe(n,b,i),"mirror"===r&&M.flipTarget()),w=!1,h&&h()}function E(t){V||(t=-t),n+=t,w||(S=M.next(Math.max(0,n)),g&&(S.value=g(S.value)),w=V?S.done:n<=0),p&&p(S.value),w&&(0===y&&(b=void 0!==b?b:n),y<s?function(t,e,n,s){return s?t>=e+n:t<=-n}(n,b,i,V)&&T():(v&&v.stop(),l&&l()))}return a&&(u&&u(),v=e(E),v.start()),{stop:()=>{c&&c(),v&&v.stop()},set currentTime(t){n=m,E(t)},sample:e=>{n=m;const s=t&&"number"==typeof t?Math.max(.5*t,50):50;let r=0;for(E(0);r<=e;){const t=e-r;E(Math.min(t,s)),r+=s}return S}}}const Ee=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,Fe={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ee([0,.65,.55,1]),circOut:Ee([.55,0,1,.45]),backIn:Ee([.31,.01,.66,-.59]),backOut:Ee([.33,1.53,.69,.99])};function ke(t){if(t)return Array.isArray(t)?Ee(t):Fe[t]}const Ie={waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate")},Oe={},Ne={};for(const t in Ie)Ne[t]=()=>(void 0===Oe[t]&&(Oe[t]=Ie[t]()),Oe[t]);const De=new Set(["opacity","clipPath","filter","transform"]);function Le(t,e,{onUpdate:n,onComplete:s,...r}){if(!(Ne.waapi()&&De.has(e)&&!r.repeatDelay&&"mirror"!==r.repeatType&&0!==r.damping))return!1;let{keyframes:i,duration:o=300,elapsed:a=0,ease:u}=r;if("spring"===r.type||!(!(c=r.ease)||Array.isArray(c)||"string"==typeof c&&Fe[c])){if(r.repeat===1/0)return;const t=Te({...r,elapsed:0});let e={done:!1,value:i[0]};const n=[];let s=0;for(;!e.done&&s<2e4;)e=t.sample(s),n.push(e.value),s+=10;i=n,o=s-10,u="linear"}var c;const l=function(t,e,n,{delay:s=0,duration:r,repeat:i=0,repeatType:o="loop",ease:a,times:u}={}){return t.animate({[e]:n,offset:u},{delay:s,duration:r,easing:ke(a),fill:"both",iterations:i+1,direction:"reverse"===o?"alternate":"normal"})}(t.owner.current,e,i,{...r,delay:-a,duration:o,ease:u});return l.onfinish=()=>{t.set(function(t,{repeat:e,repeatType:n="loop"}){return t[e&&"loop"!==n&&e%2==1?0:t.length-1]}(i,r)),Z.update(()=>l.cancel()),s&&s()},{get currentTime(){return l.currentTime||0},set currentTime(t){l.currentTime=t},stop:()=>{const{currentTime:e}=l;if(e){const n=Te({...r,autoplay:!1});t.setWithVelocity(n.sample(e-10).value,n.sample(e).value,10)}Z.update(()=>l.cancel())}}}function Re(t,e){const n=performance.now(),s=({timestamp:r})=>{const i=r-n;i>=e&&(X.read(s),t(i-e))};return Z.read(s,!0),()=>X.read(s)}function je({keyframes:t,elapsed:e,onUpdate:n,onComplete:s}){const r=()=>{n&&n(t[t.length-1]),s&&s()};return e?{stop:Re(r,-e)}:r()}const Be={type:"spring",stiffness:500,damping:25,restSpeed:10},Ue={type:"keyframes",duration:.8},ze={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},qe=(t,{keyframes:e})=>e.length>2?Ue:y.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Be:ze,He=(t,e)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!vt.test(e)||e.startsWith("url(")));function $e(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function We(t){return"number"==typeof t?0:Pt("",t)}const Ke=(t,e,n,s={})=>r=>{const i=function(t,e){return t[e]||t.default||t}(s,t)||{},o=i.delay||s.delay||0;let{elapsed:a=0}=s;a-=Rt(o);const u=function(t,e,n,s){const r=He(e,n);let i=void 0!==s.from?s.from:t.get();return"none"===i&&r&&"string"==typeof n?i=Pt(e,n):$e(i)&&"string"==typeof n?i=We(n):!Array.isArray(n)&&$e(n)&&"string"==typeof i&&(n=We(i)),Array.isArray(n)?(null===n[0]&&(n[0]=i),n):[i,n]}(e,t,n,i),c=u[0],l=u[u.length-1],h=He(t,c),p=He(t,l);let d={keyframes:u,velocity:e.getVelocity(),...i,elapsed:a,onUpdate:t=>{e.set(t),i.onUpdate&&i.onUpdate(t)},onComplete:()=>{r(),i.onComplete&&i.onComplete()}};if(!h||!p||jt||!1===i.type)return je(d);if("inertia"===i.type)return function({keyframes:t,velocity:e=0,min:n,max:s,power:r=.8,timeConstant:i=750,bounceStiffness:o=500,bounceDamping:a=10,restDelta:u=1,modifyTarget:c,driver:l,onUpdate:h,onComplete:p,onStop:d}){const f=t[0];let m;function v(t){return void 0!==n&&t<n||void 0!==s&&t>s}function g(t){return void 0===n?s:void 0===s||Math.abs(n-t)<Math.abs(s-t)?n:s}function y(t){m&&m.stop(),m=Te({keyframes:[0,1],velocity:0,...t,driver:l,onUpdate:e=>{h&&h(e),t.onUpdate&&t.onUpdate(e)},onComplete:p,onStop:d})}function b(t){y({type:"spring",stiffness:o,damping:a,restDelta:u,...t})}if(v(f))b({velocity:e,keyframes:[f,g(f)]});else{let t=r*e+f;void 0!==c&&(t=c(t));const s=g(t),o=s===n?-1:1;let a,l;const h=t=>{a=l,l=t,e=nt(t-a,q.delta),(1===o&&t>s||-1===o&&t<s)&&b({keyframes:[t,s],velocity:e})};y({type:"decay",keyframes:[f,0],velocity:e,timeConstant:i,power:r,restDelta:u,modifyTarget:c,onUpdate:v(t)?h:void 0})}return{stop:()=>m&&m.stop()}}(d);if(function({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:r,repeat:i,repeatType:o,repeatDelay:a,from:u,elapsed:c,...l}){return!!Object.keys(l).length}(i)||(d={...d,...qe(t,d)}),d.duration&&(d.duration=Rt(d.duration)),d.repeatDelay&&(d.repeatDelay=Rt(d.repeatDelay)),e.owner&&e.owner.current instanceof HTMLElement&&!e.owner.getProps().onUpdate){const n=Le(e,t,d);if(n)return n}return Te(d)};function Ge(t,e,n={}){const s=Et(t,e,n.custom);let{transition:r=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(r=n.transitionOverride);const i=s?()=>Je(t,s,n):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(s=0)=>{const{delayChildren:i=0,staggerChildren:o,staggerDirection:a}=r;return function(t,e,n=0,s=0,r=1,i){const o=[],a=(t.variantChildren.size-1)*s,u=1===r?(t=0)=>t*s:(t=0)=>a-t*s;return Array.from(t.variantChildren).sort(Ye).forEach((t,s)=>{t.notify("AnimationStart",e),o.push(Ge(t,e,{...i,delay:n+u(s)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(o)}(t,e,i+s,o,a,n)}:()=>Promise.resolve(),{when:a}=r;if(a){const[t,e]="beforeChildren"===a?[i,o]:[o,i];return t().then(e)}return Promise.all([i(),o(n.delay)])}function Je(t,e,{delay:n=0,transitionOverride:s,type:r}={}){let{transition:i=t.getDefaultTransition(),transitionEnd:o,...a}=t.makeTargetAnimatable(e);const u=t.getValue("willChange");s&&(i=s);const c=[],l=r&&t.animationState&&t.animationState.getState()[r];for(const e in a){const s=t.getValue(e),r=a[e];if(!s||void 0===r||l&&Ze(l,e))continue;const o={delay:n,elapsed:0,...i};if(window.HandoffAppearAnimations&&!s.hasAnimated){const n=t.getProps()[Ot];n&&(o.elapsed=window.HandoffAppearAnimations(n,e,s,Z))}let h=s.start(Ke(e,s,r,t.shouldReduceMotion&&y.has(e)?{type:!1}:o));It(u)&&(u.add(e),h=h.then(()=>u.remove(e))),c.push(h)}return Promise.all(c).then(()=>{o&&function(t,e){const n=Et(t,e);let{transitionEnd:s={},transition:r={},...i}=n?t.makeTargetAnimatable(n,!1):{};i={...i,...s};for(const e in i){Ft(t,e,m(i[e]))}}(t,o)})}function Ye(t,e){return t.sortNodePosition(e)}function Ze({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,s}const Xe=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],_e=[...Xe].reverse(),Qe=Xe.length;function tn(t){return e=>Promise.all(e.map(({animation:e,options:n})=>function(t,e,n={}){let s;if(t.notify("AnimationStart",e),Array.isArray(e)){const r=e.map(e=>Ge(t,e,n));s=Promise.all(r)}else if("string"==typeof e)s=Ge(t,e,n);else{const r="function"==typeof e?Et(t,e,n.custom):e;s=Je(t,r,n)}return s.then(()=>t.notify("AnimationComplete",e))}(t,e,n)))}function en(t){let e=tn(t);const n={animate:sn(!0),whileInView:sn(),whileHover:sn(),whileTap:sn(),whileDrag:sn(),whileFocus:sn(),exit:sn()};let s=!0;const r=(e,n)=>{const s=Et(t,n);if(s){const{transition:t,transitionEnd:n,...r}=s;e={...e,...r,...n}}return e};function i(i,o){const a=t.getProps(),u=t.getVariantContext(!0)||{},c=[],l=new Set;let h={},p=1/0;for(let e=0;e<Qe;e++){const d=_e[e],f=n[d],m=void 0!==a[d]?a[d]:u[d],v=V(m),g=d===o?f.isActive:null;!1===g&&(p=e);let y=m===u[d]&&m!==a[d]&&v;if(y&&s&&t.manuallyAnimateOnMount&&(y=!1),f.protectedKeys={...h},!f.isActive&&null===g||!m&&!f.prevProp||b(m)||"boolean"==typeof m)continue;const A=nn(f.prevProp,m);let P=A||d===o&&f.isActive&&!y&&v||e>p&&v;const C=Array.isArray(m)?m:[m];let S=C.reduce(r,{});!1===g&&(S={});const{prevResolvedValues:x={}}=f,M={...x,...S},T=t=>{P=!0,l.delete(t),f.needsAnimating[t]=!0};for(const t in M){const e=S[t],n=x[t];h.hasOwnProperty(t)||(e!==n?w(e)&&w(n)?!U(e,n)||A?T(t):f.protectedKeys[t]=!0:void 0!==e?T(t):l.add(t):void 0!==e&&l.has(t)?T(t):f.protectedKeys[t]=!0)}f.prevProp=m,f.prevResolvedValues=S,f.isActive&&(h={...h,...S}),s&&t.blockInitialAnimation&&(P=!1),P&&!y&&c.push(...C.map(t=>({animation:t,options:{type:d,...i}})))}if(l.size){const e={};l.forEach(n=>{const s=t.getBaseTarget(n);void 0!==s&&(e[n]=s)}),c.push({animation:e})}let d=Boolean(c.length);return s&&!1===a.initial&&!t.manuallyAnimateOnMount&&(d=!1),s=!1,d?e(c):Promise.resolve()}return{animateChanges:i,setActive:function(e,s,r){var o;if(n[e].isActive===s)return Promise.resolve();null===(o=t.variantChildren)||void 0===o||o.forEach(t=>{var n;return null===(n=t.animationState)||void 0===n?void 0:n.setActive(e,s)}),n[e].isActive=s;const a=i(r,e);for(const t in n)n[t].protectedKeys={};return a},setAnimateFunction:function(n){e=n(t)},getState:()=>n}}function nn(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!U(e,t)}function sn(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}class rn{constructor(t){this.isMounted=!1,this.node=t}update(){}}let on=0;const an={animation:{Feature:class extends rn{constructor(t){super(t),t.animationState||(t.animationState=en(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();this.unmount(),b(t)&&(this.unmount=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){}}},exit:{Feature:class extends rn{constructor(){super(...arguments),this.id=on++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e,custom:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===s)return;const r=this.node.animationState.setActive("exit",!t,{custom:null!=n?n:this.node.getProps().custom});e&&!t&&r.then(()=>e(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}}};function un(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}function cn(t,e="page"){return{point:{x:t[e+"X"],y:t[e+"Y"]}}}function ln(t,e,n,s){return un(t,e,(t=>e=>(t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary)(e)&&t(e,cn(e)))(n),s)}function hn(t){let e=null;return()=>{const n=()=>{e=null};return null===e&&(e=t,n)}}const pn=hn("dragHorizontal"),dn=hn("dragVertical");function fn(){const t=function(t){let e=!1;if("y"===t)e=dn();else if("x"===t)e=pn();else{const t=pn(),n=dn();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}(!0);return!t||(t(),!1)}function mn(t,e){const n="pointer"+(e?"enter":"leave"),s="onHover"+(e?"Start":"End");return ln(t.current,n,(n,r)=>{if("touch"===n.type||fn())return;const i=t.getProps();t.animationState&&i.whileHover&&t.animationState.setActive("whileHover",e),i[s]&&i[s](n,r)},{passive:!t.getProps()[s]})}const vn=(t,e)=>!!e&&(t===e||vn(t,e.parentElement));function gn(t,e){if(!e)return;const n=new PointerEvent("pointer"+t);e(n,cn(n))}const yn=new WeakMap,bn=new WeakMap,wn=t=>{const e=yn.get(t.target);e&&e(t)},Vn=t=>{t.forEach(wn)};function An(t,e,n){const s=function({root:t,...e}){const n=t||document;bn.has(n)||bn.set(n,{});const s=bn.get(n),r=JSON.stringify(e);return s[r]||(s[r]=new IntersectionObserver(Vn,{root:t,...e})),s[r]}(e);return yn.set(t,n),s.observe(t),()=>{yn.delete(t),s.unobserve(t)}}const Pn={some:0,all:1};const Cn={inView:{Feature:class extends rn{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}viewportFallback(){requestAnimationFrame(()=>{this.hasEnteredView=!0;const{onViewportEnter:t}=this.node.getProps();t&&t(null),this.node.animationState&&this.node.animationState.setActive("whileInView",!0)})}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:s="some",once:r,fallback:i=!0}=t;if("undefined"==typeof IntersectionObserver)return void(i&&this.viewportFallback());const o={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof s?s:Pn[s]};return An(this.node.current,o,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,r&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:n,onViewportLeave:s}=this.node.getProps(),i=e?n:s;i&&i(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends rn{constructor(){super(...arguments),this.removeStartListeners=Nt,this.removeEndListeners=Nt,this.removeAccessibleListeners=Nt,this.startPointerPress=(t,e)=>{if(this.removeEndListeners(),this.isPressing)return;const n=this.node.getProps(),s=ln(window,"pointerup",(t,e)=>{if(!this.checkPressEnd())return;const{onTap:n,onTapCancel:s}=this.node.getProps();vn(this.node.current,t.target)?n&&n(t,e):s&&s(t,e)},{passive:!(n.onTap||n.onPointerUp)}),r=ln(window,"pointercancel",(t,e)=>this.cancelPress(t,e),{passive:!(n.onTapCancel||n.onPointerCancel)});this.removeEndListeners=Xt(s,r),this.startPress(t,e)},this.startAccessiblePress=()=>{const t=un(this.node.current,"keydown",t=>{if("Enter"!==t.key||this.isPressing)return;this.removeEndListeners(),this.removeEndListeners=un(this.node.current,"keyup",t=>{"Enter"===t.key&&this.checkPressEnd()&&gn("up",this.node.getProps().onTap)}),gn("down",(t,e)=>{this.startPress(t,e)})}),e=un(this.node.current,"blur",()=>{this.isPressing&&gn("cancel",(t,e)=>this.cancelPress(t,e))});this.removeAccessibleListeners=Xt(t,e)}}startPress(t,e){this.isPressing=!0;const{onTapStart:n,whileTap:s}=this.node.getProps();s&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),n&&n(t,e)}checkPressEnd(){this.removeEndListeners(),this.isPressing=!1;return this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!fn()}cancelPress(t,e){if(!this.checkPressEnd())return;const{onTapCancel:n}=this.node.getProps();n&&n(t,e)}mount(){const t=this.node.getProps(),e=ln(this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),n=un(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=Xt(e,n)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}},focus:{Feature:class extends rn{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Xt(un(this.node.current,"focus",()=>this.onFocus()),un(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends rn{mount(){this.unmount=Xt(mn(this.node,!0),mn(this.node,!1))}unmount(){}}}};const Sn=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function xn(t,e,n=1){Lt(n<=4);const[s,r]=function(t){const e=Sn.exec(t);if(!e)return[,];const[,n,s]=e;return[n,s]}(t);if(!s)return;const i=window.getComputedStyle(e).getPropertyValue(s);return i?i.trim():A(r)?xn(r,e,n+1):r}const Mn=new Set(["width","height","top","left","right","bottom","x","y"]),Tn=t=>Mn.has(t),En=t=>t===i||t===l,Fn=(t,e)=>parseFloat(t.split(", ")[e]),kn=(t,e)=>(n,{transform:s})=>{if("none"===s||!s)return 0;const r=s.match(/^matrix3d\((.+)\)$/);if(r)return Fn(r[1],e);{const e=s.match(/^matrix\((.+)\)$/);return e?Fn(e[1],t):0}},In=new Set(["x","y","z"]),On=P.filter(t=>!In.has(t));const Nn={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:kn(4,13),y:kn(5,14)},Dn=(t,e,n={},s={})=>{e={...e},s={...s};const r=Object.keys(e).filter(Tn);let i=[],o=!1;const a=[];if(r.forEach(r=>{const u=t.getValue(r);if(!t.hasValue(r))return;let c=n[r],h=xt(c);const p=e[r];let d;if(w(p)){const t=p.length,e=null===p[0]?1:0;c=p[e],h=xt(c);for(let n=e;n<t;n++)d?Lt(xt(p[n])===d):(d=xt(p[n]),Lt(d===h||En(h)&&En(d)))}else d=xt(p);if(h!==d)if(En(h)&&En(d)){const t=u.get();"string"==typeof t&&u.set(parseFloat(t)),"string"==typeof p?e[r]=parseFloat(p):Array.isArray(p)&&d===l&&(e[r]=p.map(parseFloat))}else(null==h?void 0:h.transform)&&(null==d?void 0:d.transform)&&(0===c||0===p)?0===c?u.set(d.transform(c)):e[r]=h.transform(p):(o||(i=function(t){const e=[];return On.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),o=!0),a.push(r),s[r]=void 0!==s[r]?s[r]:e[r],u.jump(p))}),a.length){const n=a.indexOf("height")>=0?window.pageYOffset:null,r=((t,e,n)=>{const s=e.measureViewportBox(),r=e.current,i=getComputedStyle(r),{display:o}=i,a={};"none"===o&&e.setStaticValue("display",t.display||"block"),n.forEach(t=>{a[t]=Nn[t](s,i)}),e.render();const u=e.measureViewportBox();return n.forEach(n=>{const s=e.getValue(n);s&&s.jump(a[n]),t[n]=Nn[n](u,i)}),t})(e,t,a);return i.length&&i.forEach(([e,n])=>{t.getValue(e).set(n)}),t.render(),C&&null!==n&&window.scrollTo({top:n}),{target:r,transitionEnd:s}}return{target:e,transitionEnd:s}};function Ln(t,e,n,s){return(t=>Object.keys(t).some(Tn))(e)?Dn(t,e,n,s):{target:e,transitionEnd:s}}const Rn=(t,e,n,s)=>{const r=function(t,{...e},n){const s=t.current;if(!(s instanceof Element))return{target:e,transitionEnd:n};n&&(n={...n}),t.values.forEach(t=>{const e=t.get();if(!A(e))return;const n=xn(e,s);n&&t.set(n)});for(const t in e){const r=e[t];if(!A(r))continue;const i=xn(r,s);i&&(e[t]=i,n&&void 0===n[t]&&(n[t]=r))}return{target:e,transitionEnd:n}}(t,e,s);return Ln(t,e=r.target,n,s=r.transitionEnd)},jn={current:null},Bn={current:!1};const Un=Object.keys(S),zn=Un.length,qn=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],Hn=x.length;class $n extends class{constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:s,visualState:r},i={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,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=()=>Z.render(this.render,!1,!0);const{latestValues:o,renderState:a}=r;this.latestValues=o,this.baseTarget={...o},this.initialValues=e.initial?{...o}:{},this.renderState=a,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=i,this.isControllingVariants=M(e),this.isVariantNode=T(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:u,...c}=this.scrapeMotionValuesFromProps(e,{});for(const t in c){const e=c[t];void 0!==o[t]&&v(e)&&(e.set(o[t],!1),It(u)&&u.add(t))}}scrapeMotionValuesFromProps(t,e){return{}}mount(t){this.current=t,this.projection&&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)),Bn.current||function(){if(Bn.current=!0,C)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>jn.current=t.matches;t.addListener(e),e()}else jn.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||jn.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),X.update(this.notifyUpdate),X.render(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=y.has(t),s=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&Z.update(this.notifyUpdate,!1,!0),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,i){let o,a;for(let t=0;t<zn;t++){const n=Un[t],{isEnabled:s,Feature:r,ProjectionNode:i,MeasureLayout:u}=S[n];i&&(o=i),s(e)&&(!this.features[n]&&r&&(this.features[n]=new r(this)),u&&(a=u))}if(!this.projection&&o){this.projection=new o(r,this.latestValues,this.parent&&this.parent.projection);const{layoutId:t,layout:n,drag:s,dragConstraints:a,layoutScroll:u,layoutRoot:c}=e;this.projection.setOptions({layoutId:t,layout:n,alwaysMeasureLayout:Boolean(s)||a&&E(a),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:i,layoutScroll:u,layoutRoot:c})}return a}updateFeatures(){for(const t in this.features){const e=this.features[t];e.isMounted?e.update(this.props,this.prevProps):(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}makeTargetAnimatable(t,e=!0){return this.makeTargetAnimatableFromInstance(t,this.props,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<qn.length;e++){const n=qn[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(v(i))t.addValue(r,i),It(s)&&s.add(r);else if(v(o))t.addValue(r,rt(i,{owner:t})),It(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,rt(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<Hn;t++){const n=x[t],s=this.props[n];(V(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=rt(e,{owner:this}),this.addValue(t,n)),n}readValue(t){return void 0===this.latestValues[t]&&this.current?this.readValueFromInstance(this.current,t,this.options):this.latestValues[t]}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;const{initial:n}=this.props,s="string"==typeof n||"object"==typeof n?null===(e=f(this.props,n))||void 0===e?void 0:e[t]:void 0;if(n&&void 0!==s)return s;const r=this.getBaseTargetFromProps(this.props,t);return void 0===r||v(r)?void 0!==this.initialValues[t]&&void 0===s?void 0:this.baseTarget[t]:r}on(t,e){return this.events[t]||(this.events[t]=new et),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}{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]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:e,...n},{transformValues:s},r){let i=function(t,e,n){const s={};for(const r in t){const t=kt(r,e);if(void 0!==t)s[r]=t;else{const t=n.getValue(r);t&&(s[r]=t.get())}}return s}(n,t||{},this);if(s&&(e&&(e=s(e)),n&&(n=s(n)),i&&(i=s(i))),r){!function(t,e,n){var s,r;const i=Object.keys(e).filter(e=>!t.hasValue(e)),o=i.length;if(o)for(let a=0;a<o;a++){const o=i[a],u=e[o];let c=null;Array.isArray(u)&&(c=u[0]),null===c&&(c=null!==(r=null!==(s=n[o])&&void 0!==s?s:t.readValue(o))&&void 0!==r?r:e[o]),null!=c&&("string"==typeof c&&(/^\-?\d*\.?\d+$/.test(c)||z(c))?c=parseFloat(c):!Tt(c)&&vt.test(u)&&(c=Pt(o,u)),t.addValue(o,rt(c,{owner:t})),void 0===n[o]&&(n[o]=c),null!==c&&t.setBaseTarget(o,c))}}(this,n,i);const t=Rn(this,n,i,e);e=t.transitionEnd,n=t.target}return{transition:t,transitionEnd:e,...n}}}class Wn extends $n{readValueFromInstance(t,e){if(y.has(e)){const t=At(e);return t&&t.default||0}{const s=(n=t,window.getComputedStyle(n)),r=(F(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){k(t,e,n,s.transformTemplate)}scrapeMotionValuesFromProps(t,e){return I(t,e)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;v(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=""+t)}))}renderInstance(t,e,n,s){O(t,e,n,s)}}class Kn extends $n{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(y.has(e)){const t=At(e);return t&&t.default||0}return e=N.has(e)?e:g(e),t.getAttribute(e)}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}scrapeMotionValuesFromProps(t,e){return D(t,e)}build(t,e,n,s){L(t,e,n,this.isSVGTag,s.transformTemplate)}renderInstance(t,e,n,s){R(t,e,n,s)}mount(t){this.isSVGTag=j(t.tagName),super.mount(t)}}const Gn={renderer:(t,e)=>B(t)?new Kn(e,{enableHardwareAcceleration:!1}):new Wn(e,{enableHardwareAcceleration:!0}),...an,...Cn};export{Gn as domAnimation};
1
+ import{q as t,t as e,u as n,v as s,w as r,x as i,y as o,z as a,A as u,B as c,C as l,D as h,E as p,F as d,r as f,G as m,d as v,H as g,I as y,n as b,J as w,c as V,K as A,L as P,i as C,f as S,M as x,b as M,m as T,a as E,N as F,g as k,p as I,O,P as N,s as D,h as L,o as R,j,k as B}from"./size-rollup-dom-animation-assets.js";function U(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}const z=t=>/^0[^.\s]+$/.test(t),q={delta:0,timestamp:0},H="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),$="undefined"!=typeof window?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(H()),1/60*1e3);let W=!0,K=!1,G=!1;const J=["read","update","preRender","render","postRender"],Y=J.reduce((t,e)=>(t[e]=function(t){let e=[],n=[],s=0,r=!1,i=!1;const o=new WeakSet,a={schedule:(t,i=!1,a=!1)=>{const u=a&&r,c=u?e:n;return i&&o.add(t),-1===c.indexOf(t)&&(c.push(t),u&&r&&(s=e.length)),t},cancel:t=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1),o.delete(t)},process:u=>{if(r)i=!0;else{if(r=!0,[e,n]=[n,e],n.length=0,s=e.length,s)for(let n=0;n<s;n++){const s=e[n];s(u),o.has(s)&&(a.schedule(s),t())}r=!1,i&&(i=!1,a.process(u))}}};return a}(()=>K=!0),t),{}),Z=J.reduce((t,e)=>{const n=Y[e];return t[e]=(t,e=!1,s=!1)=>(K||tt(),n.schedule(t,e,s)),t},{}),X=J.reduce((t,e)=>(t[e]=Y[e].cancel,t),{});J.reduce((t,e)=>(t[e]=()=>Y[e].process(q),t),{});const _=t=>Y[t].process(q),Q=t=>{K=!1,q.delta=W?1/60*1e3:Math.max(Math.min(t-q.timestamp,40),1),q.timestamp=t,G=!0,J.forEach(_),G=!1,K&&(W=!1,$(Q))},tt=()=>{K=!0,W=!0,G||$(Q)};class et{constructor(){this.subscriptions=[]}add(t){var e,n;return e=this.subscriptions,n=t,-1===e.indexOf(n)&&e.push(n),()=>function(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}(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 nt(t,e){return e?t*(1e3/e):0}class st{constructor(t,e={}){var n;this.version="9.1.3",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(t,e=!0)=>{this.prev=this.current,this.current=t;const{delta:n,timestamp:s}=q;this.lastUpdated!==s&&(this.timeDelta=n,this.lastUpdated=s,Z.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),e&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>Z.postRender(this.velocityCheck),this.velocityCheck=({timestamp:t})=>{t!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(n=this.current,!isNaN(parseFloat(n))),this.owner=e.owner}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new et);const n=this.events[t].add(e);return"change"===t?()=>{n(),Z.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=t,this.timeDelta=n}jump(t){this.updateAndNotify(t),this.prev=t,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?nt(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e)||null,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(){this.animation=null}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function rt(t,e){return new st(t,e)}const it=(n,s)=>r=>Boolean(t(r)&&e.test(r)&&r.startsWith(n)||s&&Object.prototype.hasOwnProperty.call(r,s)),ot=(e,s,r)=>i=>{if(!t(i))return i;const[o,a,u,c]=i.match(n);return{[e]:parseFloat(o),[s]:parseFloat(a),[r]:parseFloat(u),alpha:void 0!==c?parseFloat(c):1}},at={...i,transform:t=>Math.round((t=>o(0,255,t))(t))},ut={test:it("rgb","red"),parse:ot("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+at.transform(t)+", "+at.transform(e)+", "+at.transform(n)+", "+s(r.transform(i))+")"};const ct={test:it("#"),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:ut.transform},lt={test:it("hsl","hue"),parse:ot("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+a.transform(s(e))+", "+a.transform(s(n))+", "+s(r.transform(i))+")"},ht={test:t=>ut.test(t)||ct.test(t)||lt.test(t),parse:t=>ut.test(t)?ut.parse(t):lt.test(t)?lt.parse(t):ct.parse(t),transform:e=>t(e)?e:e.hasOwnProperty("red")?ut.transform(e):lt.transform(e)};function pt(t){"number"==typeof t&&(t=""+t);const e=[];let s=0,r=0;const o=t.match(u);o&&(s=o.length,t=t.replace(u,"${c}"),e.push(...o.map(ht.parse)));const a=t.match(n);return a&&(r=a.length,t=t.replace(n,"${n}"),e.push(...a.map(i.parse))),{values:e,numColors:s,numNumbers:r,tokenised:t}}function dt(t){return pt(t).values}function ft(t){const{values:e,numColors:n,tokenised:r}=pt(t),i=e.length;return t=>{let e=r;for(let r=0;r<i;r++)e=e.replace(r<n?"${c}":"${n}",r<n?ht.transform(t[r]):s(t[r]));return e}}const mt=t=>"number"==typeof t?0:t;const vt={test:function(e){var s,r;return isNaN(e)&&t(e)&&((null===(s=e.match(n))||void 0===s?void 0:s.length)||0)+((null===(r=e.match(u))||void 0===r?void 0:r.length)||0)>0},parse:dt,createTransformer:ft,getAnimatableNone:function(t){const e=dt(t);return ft(t)(e.map(mt))}},gt=new Set(["brightness","contrast","saturate","opacity"]);function yt(t){const[e,s]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[r]=s.match(n)||[];if(!r)return t;const i=s.replace(r,"");let o=gt.has(e)?1:0;return r!==s&&(o*=100),e+"("+o+i+")"}const bt=/([a-z-]*)\(.*?\)/g,wt={...vt,getAnimatableNone:t=>{const e=t.match(bt);return e?e.map(yt).join(" "):t}},Vt={...c,color:ht,backgroundColor:ht,outlineColor:ht,fill:ht,stroke:ht,borderColor:ht,borderTopColor:ht,borderRightColor:ht,borderBottomColor:ht,borderLeftColor:ht,filter:wt,WebkitFilter:wt},At=t=>Vt[t];function Pt(t,e){let n=At(t);return n!==wt&&(n=vt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Ct=t=>e=>e.test(t),St=[i,l,a,h,p,d,{test:t=>"auto"===t,parse:t=>t}],xt=t=>St.find(Ct(t)),Mt=[...St,ht,vt],Tt=t=>Mt.find(Ct(t));function Et(t,e,n){const s=t.getProps();return f(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))}function Ft(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,rt(n))}function kt(t,e){if(!e)return;return(e[t]||e.default||e).from}function It(t){return Boolean(v(t)&&t.add)}const Ot="data-"+g("framerAppearId"),Nt=t=>t;let Dt=Nt,Lt=Nt;const Rt=t=>1e3*t,jt=!1,Bt=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Ut=t=>e=>1-t(1-e),zt=t=>t*t,qt=Ut(zt),Ht=Bt(zt),$t=(t,e,n)=>-n*t+n*e+t;function Wt(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 Kt=(t,e,n)=>{const s=t*t;return Math.sqrt(Math.max(0,n*(e*e-s)+s))},Gt=[ct,ut,lt];function Jt(t){const e=(n=t,Gt.find(t=>t.test(n)));var n;let s=e.parse(t);return e===lt&&(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=Wt(a,s,t+1/3),i=Wt(a,s,t),o=Wt(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 Yt=(t,e)=>{const n=Jt(t),s=Jt(e),r={...n};return t=>(r.red=Kt(n.red,s.red,t),r.green=Kt(n.green,s.green,t),r.blue=Kt(n.blue,s.blue,t),r.alpha=$t(n.alpha,s.alpha,t),ut.transform(r))},Zt=(t,e)=>n=>e(t(n)),Xt=(...t)=>t.reduce(Zt);function _t(t,e){return"number"==typeof t?n=>$t(t,e,n):ht.test(t)?Yt(t,e):ee(t,e)}const Qt=(t,e)=>{const n=[...t],s=n.length,r=t.map((t,n)=>_t(t,e[n]));return t=>{for(let e=0;e<s;e++)n[e]=r[e](t);return n}},te=(t,e)=>{const n={...t,...e},s={};for(const r in n)void 0!==t[r]&&void 0!==e[r]&&(s[r]=_t(t[r],e[r]));return t=>{for(const e in s)n[e]=s[e](t);return n}},ee=(t,e)=>{const n=vt.createTransformer(e),s=pt(t),r=pt(e);return s.numColors===r.numColors&&s.numNumbers>=r.numNumbers?Xt(Qt(s.values,r.values),n):n=>""+(n>0?e:t)},ne=(t,e,n)=>{const s=e-t;return 0===s?1:(n-t)/s},se=(t,e)=>n=>$t(t,e,n);function re(t,e,n){const s=[],r=n||("number"==typeof(i=t[0])?se:"string"==typeof i?ht.test(i)?Yt:ee:Array.isArray(i)?Qt:"object"==typeof i?te:se);var i;const o=t.length-1;for(let n=0;n<o;n++){let i=r(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]:e;i=Xt(t,i)}s.push(i)}return s}function ie(t,e,{clamp:n=!0,ease:s,mixer:r}={}){const i=t.length;Lt(i===e.length),Lt(!s||!Array.isArray(s)||s.length===i-1),t[0]>t[i-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=re(e,s,r),u=a.length,c=e=>{let n=0;if(u>1)for(;n<t.length-2&&!(e<t[n+1]);n++);const s=ne(t[n],t[n+1],e);return a[n](s)};return n?e=>c(o(t[0],t[i-1],e)):c}function oe(t){const e=[0];return function(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const r=ne(0,e,s);t.push($t(n,1,r))}}(e,t.length-1),e}const ae=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function ue(t,e,n,s){if(t===e&&n===s)return Nt;const r=e=>function(t,e,n,s,r){let i,o,a=0;do{o=e+(n-e)/2,i=ae(o,s,r)-t,i>0?n=o:e=o}while(Math.abs(i)>1e-7&&++a<12);return o}(e,0,1,t,n);return t=>0===t||1===t?t:ae(r(t),e,s)}const ce=t=>1-Math.sin(Math.acos(t)),le=Ut(ce),he=Bt(le),pe=ue(.33,1.53,.69,.99),de=Ut(pe),fe=Bt(de),me={linear:Nt,easeIn:zt,easeInOut:Ht,easeOut:qt,circIn:ce,circInOut:he,circOut:le,backIn:de,backInOut:fe,backOut:pe,anticipate:t=>(t*=2)<1?.5*de(t):.5*(2-Math.pow(2,-10*(t-1)))},ve=t=>{if(Array.isArray(t)){Lt(4===t.length);const[e,n,s,r]=t;return ue(e,n,s,r)}return"string"==typeof t?me[t]:t};function ge({keyframes:t,ease:e=Ht,times:n,duration:s=300}){t=[...t];const r=(t=>Array.isArray(t)&&"number"!=typeof t[0])(e)?e.map(ve):ve(e),i={done:!1,value:t[0]},o=function(t,e){return t.map(t=>t*e)}(n&&n.length===t.length?n:oe(t),s);function a(){return ie(o,t,{ease:Array.isArray(r)?r:(e=t,n=r,e.map(()=>n||Ht).splice(0,e.length-1))});var e,n}let u=a();return{next:t=>(i.value=u(t),i.done=t>=s,i),flipTarget:()=>{t.reverse(),u=a()}}}function ye({duration:t=800,bounce:e=.25,velocity:n=0,mass:s=1}){let r,i;Dt(t<=1e4);let a=1-e;a=o(.05,1,a),t=o(.01,10,t/1e3),a<1?(r=e=>{const s=e*a,r=s*t;return.001-(s-n)/be(e,a)*Math.exp(-r)},i=e=>{const s=e*a*t,i=s*n+n,o=Math.pow(a,2)*Math.pow(e,2)*t,u=Math.exp(-s),c=be(Math.pow(e,2),a);return(.001-r(e)>0?-1:1)*((i-o)*u)/c}):(r=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,i=e=>Math.exp(-e*t)*(t*t*(n-e)));const u=function(t,e,n){let s=n;for(let n=1;n<12;n++)s-=t(s)/e(s);return s}(r,i,5/t);if(t*=1e3,isNaN(u))return{stiffness:100,damping:10,duration:t};{const e=Math.pow(u,2)*s;return{stiffness:e,damping:2*a*Math.sqrt(s*e),duration:t}}}function be(t,e){return t*Math.sqrt(1-e*e)}const we=["duration","bounce"],Ve=["stiffness","damping","mass"];function Ae(t,e){return e.some(e=>void 0!==t[e])}function Pe({keyframes:t,restDelta:e,restSpeed:n,...s}){let r=t[0],i=t[t.length-1];const o={done:!1,value:r},{stiffness:a,damping:u,mass:c,velocity:l,duration:h,isResolvedFromDuration:p}=function(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!Ae(t,Ve)&&Ae(t,we)){const n=ye(t);e={...e,...n,velocity:0,mass:1},e.isResolvedFromDuration=!0}return e}(s);let d=Ce,f=l?-l/1e3:0;const m=u/(2*Math.sqrt(a*c));function v(){const t=i-r,s=Math.sqrt(a/c)/1e3,o=Math.abs(t)<5;if(n||(n=o?.01:2),e||(e=o?.005:.5),m<1){const e=be(s,m);d=n=>{const r=Math.exp(-m*s*n);return i-r*((f+m*s*t)/e*Math.sin(e*n)+t*Math.cos(e*n))}}else if(1===m)d=e=>i-Math.exp(-s*e)*(t+(f+s*t)*e);else{const e=s*Math.sqrt(m*m-1);d=n=>{const r=Math.exp(-m*s*n),o=Math.min(e*n,300);return i-r*((f+m*s*t)*Math.sinh(o)+e*t*Math.cosh(o))/e}}}return v(),{next:t=>{const s=d(t);if(p)o.done=t>=h;else{let r=f;if(0!==t)if(m<1){const e=Math.max(0,t-5);r=nt(s-d(e),t-e)}else r=0;const a=Math.abs(r)<=n,u=Math.abs(i-s)<=e;o.done=a&&u}return o.value=o.done?i:s,o},flipTarget:()=>{f=-f,[r,i]=[i,r],v()}}}Pe.needsInterpolation=(t,e)=>"string"==typeof t||"string"==typeof e;const Ce=t=>0;const Se={decay:function({keyframes:t=[0],velocity:e=0,power:n=.8,timeConstant:s=350,restDelta:r=.5,modifyTarget:i}){const o=t[0],a={done:!1,value:o};let u=n*e;const c=o+u,l=void 0===i?c:i(c);return l!==c&&(u=l-o),{next:t=>{const e=-u*Math.exp(-t/s);return a.done=!(e>r||e<-r),a.value=a.done?l:l+e,a},flipTarget:()=>{}}},keyframes:ge,tween:ge,spring:Pe};function xe(t,e,n=0){return t-e-n}const Me=t=>{const e=({delta:e})=>t(e);return{start:()=>Z.update(e,!0),stop:()=>X.update(e)}};function Te({duration:t,driver:e=Me,elapsed:n=0,repeat:s=0,repeatType:r="loop",repeatDelay:i=0,keyframes:o,autoplay:a=!0,onPlay:u,onStop:c,onComplete:l,onRepeat:h,onUpdate:p,type:d="keyframes",...f}){const m=n;let v,g,y=0,b=t,w=!1,V=!0;const A=Se[o.length>2?"keyframes":d]||ge,P=o[0],C=o[o.length-1];let S={done:!1,value:P};const{needsInterpolation:x}=A;x&&x(P,C)&&(g=ie([0,100],[P,C],{clamp:!1}),o=[0,100]);const M=A({...f,duration:t,keyframes:o});function T(){y++,"reverse"===r?(V=y%2==0,n=function(t,e=0,n=0,s=!0){return s?xe(e+-t,e,n):e-(t-e)+n}(n,b,i,V)):(n=xe(n,b,i),"mirror"===r&&M.flipTarget()),w=!1,h&&h()}function E(t){V||(t=-t),n+=t,w||(S=M.next(Math.max(0,n)),g&&(S.value=g(S.value)),w=V?S.done:n<=0),p&&p(S.value),w&&(0===y&&(b=void 0!==b?b:n),y<s?function(t,e,n,s){return s?t>=e+n:t<=-n}(n,b,i,V)&&T():(v&&v.stop(),l&&l()))}return a&&(u&&u(),v=e(E),v.start()),{stop:()=>{c&&c(),v&&v.stop()},set currentTime(t){n=m,E(t)},sample:e=>{n=m;const s=t&&"number"==typeof t?Math.max(.5*t,50):50;let r=0;for(E(0);r<=e;){const t=e-r;E(Math.min(t,s)),r+=s}return S}}}const Ee=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,Fe={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ee([0,.65,.55,1]),circOut:Ee([.55,0,1,.45]),backIn:Ee([.31,.01,.66,-.59]),backOut:Ee([.33,1.53,.69,.99])};function ke(t){if(t)return Array.isArray(t)?Ee(t):Fe[t]}const Ie={waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate")},Oe={},Ne={};for(const t in Ie)Ne[t]=()=>(void 0===Oe[t]&&(Oe[t]=Ie[t]()),Oe[t]);const De=new Set(["opacity","clipPath","filter","transform"]);function Le(t,e,{onUpdate:n,onComplete:s,...r}){if(!(Ne.waapi()&&De.has(e)&&!r.repeatDelay&&"mirror"!==r.repeatType&&0!==r.damping))return!1;let{keyframes:i,duration:o=300,elapsed:a=0,ease:u}=r;if("spring"===r.type||!(!(c=r.ease)||Array.isArray(c)||"string"==typeof c&&Fe[c])){if(r.repeat===1/0)return;const t=Te({...r,elapsed:0});let e={done:!1,value:i[0]};const n=[];let s=0;for(;!e.done&&s<2e4;)e=t.sample(s),n.push(e.value),s+=10;i=n,o=s-10,u="linear"}var c;const l=function(t,e,n,{delay:s=0,duration:r,repeat:i=0,repeatType:o="loop",ease:a,times:u}={}){return t.animate({[e]:n,offset:u},{delay:s,duration:r,easing:ke(a),fill:"both",iterations:i+1,direction:"reverse"===o?"alternate":"normal"})}(t.owner.current,e,i,{...r,delay:-a,duration:o,ease:u});return l.onfinish=()=>{t.set(function(t,{repeat:e,repeatType:n="loop"}){return t[e&&"loop"!==n&&e%2==1?0:t.length-1]}(i,r)),Z.update(()=>l.cancel()),s&&s()},{get currentTime(){return l.currentTime||0},set currentTime(t){l.currentTime=t},stop:()=>{const{currentTime:e}=l;if(e){const n=Te({...r,autoplay:!1});t.setWithVelocity(n.sample(e-10).value,n.sample(e).value,10)}Z.update(()=>l.cancel())}}}function Re(t,e){const n=performance.now(),s=({timestamp:r})=>{const i=r-n;i>=e&&(X.read(s),t(i-e))};return Z.read(s,!0),()=>X.read(s)}function je({keyframes:t,elapsed:e,onUpdate:n,onComplete:s}){const r=()=>{n&&n(t[t.length-1]),s&&s()};return e?{stop:Re(r,-e)}:r()}const Be={type:"spring",stiffness:500,damping:25,restSpeed:10},Ue={type:"keyframes",duration:.8},ze={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},qe=(t,{keyframes:e})=>e.length>2?Ue:y.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Be:ze,He=(t,e)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!vt.test(e)||e.startsWith("url(")));function $e(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function We(t){return"number"==typeof t?0:Pt("",t)}const Ke=(t,e,n,s={})=>r=>{const i=function(t,e){return t[e]||t.default||t}(s,t)||{},o=i.delay||s.delay||0;let{elapsed:a=0}=s;a-=Rt(o);const u=function(t,e,n,s){const r=He(e,n);let i=void 0!==s.from?s.from:t.get();return"none"===i&&r&&"string"==typeof n?i=Pt(e,n):$e(i)&&"string"==typeof n?i=We(n):!Array.isArray(n)&&$e(n)&&"string"==typeof i&&(n=We(i)),Array.isArray(n)?(null===n[0]&&(n[0]=i),n):[i,n]}(e,t,n,i),c=u[0],l=u[u.length-1],h=He(t,c),p=He(t,l);let d={keyframes:u,velocity:e.getVelocity(),...i,elapsed:a,onUpdate:t=>{e.set(t),i.onUpdate&&i.onUpdate(t)},onComplete:()=>{r(),i.onComplete&&i.onComplete()}};if(!h||!p||jt||!1===i.type)return je(d);if("inertia"===i.type)return function({keyframes:t,velocity:e=0,min:n,max:s,power:r=.8,timeConstant:i=750,bounceStiffness:o=500,bounceDamping:a=10,restDelta:u=1,modifyTarget:c,driver:l,onUpdate:h,onComplete:p,onStop:d}){const f=t[0];let m;function v(t){return void 0!==n&&t<n||void 0!==s&&t>s}function g(t){return void 0===n?s:void 0===s||Math.abs(n-t)<Math.abs(s-t)?n:s}function y(t){m&&m.stop(),m=Te({keyframes:[0,1],velocity:0,...t,driver:l,onUpdate:e=>{h&&h(e),t.onUpdate&&t.onUpdate(e)},onComplete:p,onStop:d})}function b(t){y({type:"spring",stiffness:o,damping:a,restDelta:u,...t})}if(v(f))b({velocity:e,keyframes:[f,g(f)]});else{let t=r*e+f;void 0!==c&&(t=c(t));const s=g(t),o=s===n?-1:1;let a,l;const h=t=>{a=l,l=t,e=nt(t-a,q.delta),(1===o&&t>s||-1===o&&t<s)&&b({keyframes:[t,s],velocity:e})};y({type:"decay",keyframes:[f,0],velocity:e,timeConstant:i,power:r,restDelta:u,modifyTarget:c,onUpdate:v(t)?h:void 0})}return{stop:()=>m&&m.stop()}}(d);if(function({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:r,repeat:i,repeatType:o,repeatDelay:a,from:u,elapsed:c,...l}){return!!Object.keys(l).length}(i)||(d={...d,...qe(t,d)}),d.duration&&(d.duration=Rt(d.duration)),d.repeatDelay&&(d.repeatDelay=Rt(d.repeatDelay)),e.owner&&e.owner.current instanceof HTMLElement&&!e.owner.getProps().onUpdate){const n=Le(e,t,d);if(n)return n}return Te(d)};function Ge(t,e,n={}){const s=Et(t,e,n.custom);let{transition:r=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(r=n.transitionOverride);const i=s?()=>Je(t,s,n):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(s=0)=>{const{delayChildren:i=0,staggerChildren:o,staggerDirection:a}=r;return function(t,e,n=0,s=0,r=1,i){const o=[],a=(t.variantChildren.size-1)*s,u=1===r?(t=0)=>t*s:(t=0)=>a-t*s;return Array.from(t.variantChildren).sort(Ye).forEach((t,s)=>{t.notify("AnimationStart",e),o.push(Ge(t,e,{...i,delay:n+u(s)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(o)}(t,e,i+s,o,a,n)}:()=>Promise.resolve(),{when:a}=r;if(a){const[t,e]="beforeChildren"===a?[i,o]:[o,i];return t().then(e)}return Promise.all([i(),o(n.delay)])}function Je(t,e,{delay:n=0,transitionOverride:s,type:r}={}){let{transition:i=t.getDefaultTransition(),transitionEnd:o,...a}=t.makeTargetAnimatable(e);const u=t.getValue("willChange");s&&(i=s);const c=[],l=r&&t.animationState&&t.animationState.getState()[r];for(const e in a){const s=t.getValue(e),r=a[e];if(!s||void 0===r||l&&Ze(l,e))continue;const o={delay:n,elapsed:0,...i};if(window.HandoffAppearAnimations&&!s.hasAnimated){const n=t.getProps()[Ot];n&&(o.elapsed=window.HandoffAppearAnimations(n,e,s,Z))}let h=s.start(Ke(e,s,r,t.shouldReduceMotion&&y.has(e)?{type:!1}:o));It(u)&&(u.add(e),h=h.then(()=>u.remove(e))),c.push(h)}return Promise.all(c).then(()=>{o&&function(t,e){const n=Et(t,e);let{transitionEnd:s={},transition:r={},...i}=n?t.makeTargetAnimatable(n,!1):{};i={...i,...s};for(const e in i){Ft(t,e,m(i[e]))}}(t,o)})}function Ye(t,e){return t.sortNodePosition(e)}function Ze({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,s}const Xe=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],_e=[...Xe].reverse(),Qe=Xe.length;function tn(t){return e=>Promise.all(e.map(({animation:e,options:n})=>function(t,e,n={}){let s;if(t.notify("AnimationStart",e),Array.isArray(e)){const r=e.map(e=>Ge(t,e,n));s=Promise.all(r)}else if("string"==typeof e)s=Ge(t,e,n);else{const r="function"==typeof e?Et(t,e,n.custom):e;s=Je(t,r,n)}return s.then(()=>t.notify("AnimationComplete",e))}(t,e,n)))}function en(t){let e=tn(t);const n={animate:sn(!0),whileInView:sn(),whileHover:sn(),whileTap:sn(),whileDrag:sn(),whileFocus:sn(),exit:sn()};let s=!0;const r=(e,n)=>{const s=Et(t,n);if(s){const{transition:t,transitionEnd:n,...r}=s;e={...e,...r,...n}}return e};function i(i,o){const a=t.getProps(),u=t.getVariantContext(!0)||{},c=[],l=new Set;let h={},p=1/0;for(let e=0;e<Qe;e++){const d=_e[e],f=n[d],m=void 0!==a[d]?a[d]:u[d],v=V(m),g=d===o?f.isActive:null;!1===g&&(p=e);let y=m===u[d]&&m!==a[d]&&v;if(y&&s&&t.manuallyAnimateOnMount&&(y=!1),f.protectedKeys={...h},!f.isActive&&null===g||!m&&!f.prevProp||b(m)||"boolean"==typeof m)continue;const A=nn(f.prevProp,m);let P=A||d===o&&f.isActive&&!y&&v||e>p&&v;const C=Array.isArray(m)?m:[m];let S=C.reduce(r,{});!1===g&&(S={});const{prevResolvedValues:x={}}=f,M={...x,...S},T=t=>{P=!0,l.delete(t),f.needsAnimating[t]=!0};for(const t in M){const e=S[t],n=x[t];h.hasOwnProperty(t)||(e!==n?w(e)&&w(n)?!U(e,n)||A?T(t):f.protectedKeys[t]=!0:void 0!==e?T(t):l.add(t):void 0!==e&&l.has(t)?T(t):f.protectedKeys[t]=!0)}f.prevProp=m,f.prevResolvedValues=S,f.isActive&&(h={...h,...S}),s&&t.blockInitialAnimation&&(P=!1),P&&!y&&c.push(...C.map(t=>({animation:t,options:{type:d,...i}})))}if(l.size){const e={};l.forEach(n=>{const s=t.getBaseTarget(n);void 0!==s&&(e[n]=s)}),c.push({animation:e})}let d=Boolean(c.length);return s&&!1===a.initial&&!t.manuallyAnimateOnMount&&(d=!1),s=!1,d?e(c):Promise.resolve()}return{animateChanges:i,setActive:function(e,s,r){var o;if(n[e].isActive===s)return Promise.resolve();null===(o=t.variantChildren)||void 0===o||o.forEach(t=>{var n;return null===(n=t.animationState)||void 0===n?void 0:n.setActive(e,s)}),n[e].isActive=s;const a=i(r,e);for(const t in n)n[t].protectedKeys={};return a},setAnimateFunction:function(n){e=n(t)},getState:()=>n}}function nn(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!U(e,t)}function sn(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}class rn{constructor(t){this.isMounted=!1,this.node=t}update(){}}let on=0;const an={animation:{Feature:class extends rn{constructor(t){super(t),t.animationState||(t.animationState=en(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();this.unmount(),b(t)&&(this.unmount=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){}}},exit:{Feature:class extends rn{constructor(){super(...arguments),this.id=on++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e,custom:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===s)return;const r=this.node.animationState.setActive("exit",!t,{custom:null!=n?n:this.node.getProps().custom});e&&!t&&r.then(()=>e(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}}};function un(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}function cn(t,e="page"){return{point:{x:t[e+"X"],y:t[e+"Y"]}}}function ln(t,e,n,s){return un(t,e,(t=>e=>(t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary)(e)&&t(e,cn(e)))(n),s)}function hn(t){let e=null;return()=>{const n=()=>{e=null};return null===e&&(e=t,n)}}const pn=hn("dragHorizontal"),dn=hn("dragVertical");function fn(){const t=function(t){let e=!1;if("y"===t)e=dn();else if("x"===t)e=pn();else{const t=pn(),n=dn();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}(!0);return!t||(t(),!1)}function mn(t,e){const n="pointer"+(e?"enter":"leave"),s="onHover"+(e?"Start":"End");return ln(t.current,n,(n,r)=>{if("touch"===n.type||fn())return;const i=t.getProps();t.animationState&&i.whileHover&&t.animationState.setActive("whileHover",e),i[s]&&i[s](n,r)},{passive:!t.getProps()[s]})}const vn=(t,e)=>!!e&&(t===e||vn(t,e.parentElement));function gn(t,e){if(!e)return;const n=new PointerEvent("pointer"+t);e(n,cn(n))}const yn=new WeakMap,bn=new WeakMap,wn=t=>{const e=yn.get(t.target);e&&e(t)},Vn=t=>{t.forEach(wn)};function An(t,e,n){const s=function({root:t,...e}){const n=t||document;bn.has(n)||bn.set(n,{});const s=bn.get(n),r=JSON.stringify(e);return s[r]||(s[r]=new IntersectionObserver(Vn,{root:t,...e})),s[r]}(e);return yn.set(t,n),s.observe(t),()=>{yn.delete(t),s.unobserve(t)}}const Pn={some:0,all:1};const Cn={inView:{Feature:class extends rn{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}viewportFallback(){requestAnimationFrame(()=>{this.hasEnteredView=!0;const{onViewportEnter:t}=this.node.getProps();t&&t(null),this.node.animationState&&this.node.animationState.setActive("whileInView",!0)})}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:s="some",once:r,fallback:i=!0}=t;if("undefined"==typeof IntersectionObserver)return void(i&&this.viewportFallback());const o={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof s?s:Pn[s]};return An(this.node.current,o,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,r&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:n,onViewportLeave:s}=this.node.getProps(),i=e?n:s;i&&i(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends rn{constructor(){super(...arguments),this.removeStartListeners=Nt,this.removeEndListeners=Nt,this.removeAccessibleListeners=Nt,this.startPointerPress=(t,e)=>{if(this.removeEndListeners(),this.isPressing)return;const n=this.node.getProps(),s=ln(window,"pointerup",(t,e)=>{if(!this.checkPressEnd())return;const{onTap:n,onTapCancel:s}=this.node.getProps();vn(this.node.current,t.target)?n&&n(t,e):s&&s(t,e)},{passive:!(n.onTap||n.onPointerUp)}),r=ln(window,"pointercancel",(t,e)=>this.cancelPress(t,e),{passive:!(n.onTapCancel||n.onPointerCancel)});this.removeEndListeners=Xt(s,r),this.startPress(t,e)},this.startAccessiblePress=()=>{const t=un(this.node.current,"keydown",t=>{if("Enter"!==t.key||this.isPressing)return;this.removeEndListeners(),this.removeEndListeners=un(this.node.current,"keyup",t=>{"Enter"===t.key&&this.checkPressEnd()&&gn("up",this.node.getProps().onTap)}),gn("down",(t,e)=>{this.startPress(t,e)})}),e=un(this.node.current,"blur",()=>{this.isPressing&&gn("cancel",(t,e)=>this.cancelPress(t,e))});this.removeAccessibleListeners=Xt(t,e)}}startPress(t,e){this.isPressing=!0;const{onTapStart:n,whileTap:s}=this.node.getProps();s&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),n&&n(t,e)}checkPressEnd(){this.removeEndListeners(),this.isPressing=!1;return this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!fn()}cancelPress(t,e){if(!this.checkPressEnd())return;const{onTapCancel:n}=this.node.getProps();n&&n(t,e)}mount(){const t=this.node.getProps(),e=ln(this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),n=un(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=Xt(e,n)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}},focus:{Feature:class extends rn{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Xt(un(this.node.current,"focus",()=>this.onFocus()),un(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends rn{mount(){this.unmount=Xt(mn(this.node,!0),mn(this.node,!1))}unmount(){}}}};const Sn=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function xn(t,e,n=1){Lt(n<=4);const[s,r]=function(t){const e=Sn.exec(t);if(!e)return[,];const[,n,s]=e;return[n,s]}(t);if(!s)return;const i=window.getComputedStyle(e).getPropertyValue(s);return i?i.trim():A(r)?xn(r,e,n+1):r}const Mn=new Set(["width","height","top","left","right","bottom","x","y"]),Tn=t=>Mn.has(t),En=t=>t===i||t===l,Fn=(t,e)=>parseFloat(t.split(", ")[e]),kn=(t,e)=>(n,{transform:s})=>{if("none"===s||!s)return 0;const r=s.match(/^matrix3d\((.+)\)$/);if(r)return Fn(r[1],e);{const e=s.match(/^matrix\((.+)\)$/);return e?Fn(e[1],t):0}},In=new Set(["x","y","z"]),On=P.filter(t=>!In.has(t));const Nn={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:kn(4,13),y:kn(5,14)},Dn=(t,e,n={},s={})=>{e={...e},s={...s};const r=Object.keys(e).filter(Tn);let i=[],o=!1;const a=[];if(r.forEach(r=>{const u=t.getValue(r);if(!t.hasValue(r))return;let c=n[r],h=xt(c);const p=e[r];let d;if(w(p)){const t=p.length,e=null===p[0]?1:0;c=p[e],h=xt(c);for(let n=e;n<t;n++)d?Lt(xt(p[n])===d):(d=xt(p[n]),Lt(d===h||En(h)&&En(d)))}else d=xt(p);if(h!==d)if(En(h)&&En(d)){const t=u.get();"string"==typeof t&&u.set(parseFloat(t)),"string"==typeof p?e[r]=parseFloat(p):Array.isArray(p)&&d===l&&(e[r]=p.map(parseFloat))}else(null==h?void 0:h.transform)&&(null==d?void 0:d.transform)&&(0===c||0===p)?0===c?u.set(d.transform(c)):e[r]=h.transform(p):(o||(i=function(t){const e=[];return On.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),o=!0),a.push(r),s[r]=void 0!==s[r]?s[r]:e[r],u.jump(p))}),a.length){const n=a.indexOf("height")>=0?window.pageYOffset:null,r=((t,e,n)=>{const s=e.measureViewportBox(),r=e.current,i=getComputedStyle(r),{display:o}=i,a={};"none"===o&&e.setStaticValue("display",t.display||"block"),n.forEach(t=>{a[t]=Nn[t](s,i)}),e.render();const u=e.measureViewportBox();return n.forEach(n=>{const s=e.getValue(n);s&&s.jump(a[n]),t[n]=Nn[n](u,i)}),t})(e,t,a);return i.length&&i.forEach(([e,n])=>{t.getValue(e).set(n)}),t.render(),C&&null!==n&&window.scrollTo({top:n}),{target:r,transitionEnd:s}}return{target:e,transitionEnd:s}};function Ln(t,e,n,s){return(t=>Object.keys(t).some(Tn))(e)?Dn(t,e,n,s):{target:e,transitionEnd:s}}const Rn=(t,e,n,s)=>{const r=function(t,{...e},n){const s=t.current;if(!(s instanceof Element))return{target:e,transitionEnd:n};n&&(n={...n}),t.values.forEach(t=>{const e=t.get();if(!A(e))return;const n=xn(e,s);n&&t.set(n)});for(const t in e){const r=e[t];if(!A(r))continue;const i=xn(r,s);i&&(e[t]=i,n&&void 0===n[t]&&(n[t]=r))}return{target:e,transitionEnd:n}}(t,e,s);return Ln(t,e=r.target,n,s=r.transitionEnd)},jn={current:null},Bn={current:!1};const Un=Object.keys(S),zn=Un.length,qn=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],Hn=x.length;class $n extends class{constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:s,visualState:r},i={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,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=()=>Z.render(this.render,!1,!0);const{latestValues:o,renderState:a}=r;this.latestValues=o,this.baseTarget={...o},this.initialValues=e.initial?{...o}:{},this.renderState=a,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=i,this.isControllingVariants=M(e),this.isVariantNode=T(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:u,...c}=this.scrapeMotionValuesFromProps(e,{});for(const t in c){const e=c[t];void 0!==o[t]&&v(e)&&(e.set(o[t],!1),It(u)&&u.add(t))}}scrapeMotionValuesFromProps(t,e){return{}}mount(t){this.current=t,this.projection&&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)),Bn.current||function(){if(Bn.current=!0,C)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>jn.current=t.matches;t.addListener(e),e()}else jn.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||jn.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),X.update(this.notifyUpdate),X.render(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=y.has(t),s=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&Z.update(this.notifyUpdate,!1,!0),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,i){let o,a;for(let t=0;t<zn;t++){const n=Un[t],{isEnabled:s,Feature:r,ProjectionNode:i,MeasureLayout:u}=S[n];i&&(o=i),s(e)&&(!this.features[n]&&r&&(this.features[n]=new r(this)),u&&(a=u))}if(!this.projection&&o){this.projection=new o(r,this.latestValues,this.parent&&this.parent.projection);const{layoutId:t,layout:n,drag:s,dragConstraints:a,layoutScroll:u,layoutRoot:c}=e;this.projection.setOptions({layoutId:t,layout:n,alwaysMeasureLayout:Boolean(s)||a&&E(a),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:i,layoutScroll:u,layoutRoot:c})}return a}updateFeatures(){for(const t in this.features){const e=this.features[t];e.isMounted?e.update(this.props,this.prevProps):(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}makeTargetAnimatable(t,e=!0){return this.makeTargetAnimatableFromInstance(t,this.props,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<qn.length;e++){const n=qn[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(v(i))t.addValue(r,i),It(s)&&s.add(r);else if(v(o))t.addValue(r,rt(i,{owner:t})),It(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,rt(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<Hn;t++){const n=x[t],s=this.props[n];(V(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=rt(e,{owner:this}),this.addValue(t,n)),n}readValue(t){return void 0===this.latestValues[t]&&this.current?this.readValueFromInstance(this.current,t,this.options):this.latestValues[t]}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;const{initial:n}=this.props,s="string"==typeof n||"object"==typeof n?null===(e=f(this.props,n))||void 0===e?void 0:e[t]:void 0;if(n&&void 0!==s)return s;const r=this.getBaseTargetFromProps(this.props,t);return void 0===r||v(r)?void 0!==this.initialValues[t]&&void 0===s?void 0:this.baseTarget[t]:r}on(t,e){return this.events[t]||(this.events[t]=new et),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}{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]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:e,...n},{transformValues:s},r){let i=function(t,e,n){const s={};for(const r in t){const t=kt(r,e);if(void 0!==t)s[r]=t;else{const t=n.getValue(r);t&&(s[r]=t.get())}}return s}(n,t||{},this);if(s&&(e&&(e=s(e)),n&&(n=s(n)),i&&(i=s(i))),r){!function(t,e,n){var s,r;const i=Object.keys(e).filter(e=>!t.hasValue(e)),o=i.length;if(o)for(let a=0;a<o;a++){const o=i[a],u=e[o];let c=null;Array.isArray(u)&&(c=u[0]),null===c&&(c=null!==(r=null!==(s=n[o])&&void 0!==s?s:t.readValue(o))&&void 0!==r?r:e[o]),null!=c&&("string"==typeof c&&(/^\-?\d*\.?\d+$/.test(c)||z(c))?c=parseFloat(c):!Tt(c)&&vt.test(u)&&(c=Pt(o,u)),t.addValue(o,rt(c,{owner:t})),void 0===n[o]&&(n[o]=c),null!==c&&t.setBaseTarget(o,c))}}(this,n,i);const t=Rn(this,n,i,e);e=t.transitionEnd,n=t.target}return{transition:t,transitionEnd:e,...n}}}class Wn extends $n{readValueFromInstance(t,e){if(y.has(e)){const t=At(e);return t&&t.default||0}{const s=(n=t,window.getComputedStyle(n)),r=(F(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){k(t,e,n,s.transformTemplate)}scrapeMotionValuesFromProps(t,e){return I(t,e)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;v(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=""+t)}))}renderInstance(t,e,n,s){O(t,e,n,s)}}class Kn extends $n{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(y.has(e)){const t=At(e);return t&&t.default||0}return e=N.has(e)?e:g(e),t.getAttribute(e)}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}scrapeMotionValuesFromProps(t,e){return D(t,e)}build(t,e,n,s){L(t,e,n,this.isSVGTag,s.transformTemplate)}renderInstance(t,e,n,s){R(t,e,n,s)}mount(t){this.isSVGTag=j(t.tagName),super.mount(t)}}const Gn={renderer:(t,e)=>B(t)?new Kn(e,{enableHardwareAcceleration:!1}):new Wn(e,{enableHardwareAcceleration:!0}),...an,...Cn};export{Gn as domAnimation};