framer-motion 7.6.7 → 7.6.9

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.
@@ -1 +1 @@
1
- import{useContext as t,useId as e,useEffect as n,useRef as r,createElement as o}from"react";import{p as s,q as i,t as a,u,v as l,w as c,x as p,y as d,z as h,P as f,A as m,B as v,C as g,D as y,E as b,F as w,G as V,r as A,d as S,H as M,m as x,c as C,i as E,I as T,f as O,b as P,l as F,a as I,J as j,g as k,o as R,K as D,L as B,M as N,s as U,h as L,n as H,j as z}from"./size-rollup-dom-animation-assets.js";const q=(t,e)=>n=>Boolean(s(n)&&i.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),W=(t,e,n)=>r=>{if(!s(r))return r;const[o,i,u,l]=r.match(a);return{[t]:parseFloat(o),[e]:parseFloat(i),[n]:parseFloat(u),alpha:void 0!==l?parseFloat(l):1}},$={test:q("hsl","hue"),parse:W("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+u.transform(l(e))+", "+u.transform(l(n))+", "+l(c.transform(r))+")"},K=d(0,255),Y=Object.assign(Object.assign({},p),{transform:t=>Math.round(K(t))}),X={test:q("rgb","red"),parse:W("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+Y.transform(t)+", "+Y.transform(e)+", "+Y.transform(n)+", "+l(c.transform(r))+")"};const G={test:q("#"),parse:function(t){let e="",n="",r="",o="";return t.length>5?(e=t.substr(1,2),n=t.substr(3,2),r=t.substr(5,2),o=t.substr(7,2)):(e=t.substr(1,1),n=t.substr(2,1),r=t.substr(3,1),o=t.substr(4,1),e+=e,n+=n,r+=r,o+=o),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}},transform:X.transform},Z={test:t=>X.test(t)||G.test(t)||$.test(t),parse:t=>X.test(t)?X.parse(t):$.test(t)?$.parse(t):G.parse(t),transform:t=>s(t)?t:t.hasOwnProperty("red")?X.transform(t):$.transform(t)};function J(t){"number"==typeof t&&(t=""+t);const e=[];let n=0;const r=t.match(h);r&&(n=r.length,t=t.replace(h,"${c}"),e.push(...r.map(Z.parse)));const o=t.match(a);return o&&(t=t.replace(a,"${n}"),e.push(...o.map(p.parse))),{values:e,numColors:n,tokenised:t}}function _(t){return J(t).values}function Q(t){const{values:e,numColors:n,tokenised:r}=J(t),o=e.length;return t=>{let e=r;for(let r=0;r<o;r++)e=e.replace(r<n?"${c}":"${n}",r<n?Z.transform(t[r]):l(t[r]));return e}}const tt=t=>"number"==typeof t?0:t;const et={test:function(t){var e,n,r,o;return isNaN(t)&&s(t)&&(null!==(n=null===(e=t.match(a))||void 0===e?void 0:e.length)&&void 0!==n?n:0)+(null!==(o=null===(r=t.match(h))||void 0===r?void 0:r.length)&&void 0!==o?o:0)>0},parse:_,createTransformer:Q,getAnimatableNone:function(t){const e=_(t);return Q(t)(e.map(tt))}},nt=new Set(["brightness","contrast","saturate","opacity"]);function rt(t){let[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[r]=n.match(a)||[];if(!r)return t;const o=n.replace(r,"");let s=nt.has(e)?1:0;return r!==n&&(s*=100),e+"("+s+o+")"}const ot=/([a-z-]*)\(.*?\)/g,st=Object.assign(Object.assign({},et),{getAnimatableNone:t=>{const e=t.match(ot);return e?e.map(rt).join(" "):t}});function it(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}function at(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}const ut=(t,e,n)=>Math.min(Math.max(n,t),e);function lt({duration:t=800,bounce:e=.25,velocity:n=0,mass:r=1}){let o,s,i=1-e;i=ut(.05,1,i),t=ut(.01,10,t/1e3),i<1?(o=e=>{const r=e*i,o=r*t;return.001-(r-n)/ct(e,i)*Math.exp(-o)},s=e=>{const r=e*i*t,s=r*n+n,a=Math.pow(i,2)*Math.pow(e,2)*t,u=Math.exp(-r),l=ct(Math.pow(e,2),i);return(.001-o(e)>0?-1:1)*((s-a)*u)/l}):(o=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,s=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let r=n;for(let n=1;n<12;n++)r-=t(r)/e(r);return r}(o,s,5/t);if(t*=1e3,isNaN(a))return{stiffness:100,damping:10,duration:t};{const e=Math.pow(a,2)*r;return{stiffness:e,damping:2*i*Math.sqrt(r*e),duration:t}}}function ct(t,e){return t*Math.sqrt(1-e*e)}const pt=["duration","bounce"],dt=["stiffness","damping","mass"];function ht(t,e){return e.some(e=>void 0!==t[e])}function ft(t){var{from:e=0,to:n=1,restSpeed:r=2,restDelta:o}=t,s=at(t,["from","to","restSpeed","restDelta"]);const i={done:!1,value:e};let{stiffness:a,damping:u,mass:l,velocity:c,duration:p,isResolvedFromDuration:d}=function(t){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},t);if(!ht(t,dt)&&ht(t,pt)){const n=lt(t);e=Object.assign(Object.assign(Object.assign({},e),n),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}(s),h=mt,f=mt;function m(){const t=c?-c/1e3:0,r=n-e,s=u/(2*Math.sqrt(a*l)),i=Math.sqrt(a/l)/1e3;if(void 0===o&&(o=Math.min(Math.abs(n-e)/100,.4)),s<1){const e=ct(i,s);h=o=>{const a=Math.exp(-s*i*o);return n-a*((t+s*i*r)/e*Math.sin(e*o)+r*Math.cos(e*o))},f=n=>{const o=Math.exp(-s*i*n);return s*i*o*(Math.sin(e*n)*(t+s*i*r)/e+r*Math.cos(e*n))-o*(Math.cos(e*n)*(t+s*i*r)-e*r*Math.sin(e*n))}}else if(1===s)h=e=>n-Math.exp(-i*e)*(r+(t+i*r)*e);else{const e=i*Math.sqrt(s*s-1);h=o=>{const a=Math.exp(-s*i*o),u=Math.min(e*o,300);return n-a*((t+s*i*r)*Math.sinh(u)+e*r*Math.cosh(u))/e}}}return m(),{next:t=>{const e=h(t);if(d)i.done=t>=p;else{const s=1e3*f(t),a=Math.abs(s)<=r,u=Math.abs(n-e)<=o;i.done=a&&u}return i.value=i.done?n:e,i},flipTarget:()=>{c=-c,[e,n]=[n,e],m()}}}ft.needsInterpolation=(t,e)=>"string"==typeof t||"string"==typeof e;const mt=t=>0,vt=(t,e,n)=>{const r=e-t;return 0===r?1:(n-t)/r},gt=(t,e,n)=>-n*t+n*e+t;function yt(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function bt({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,n/=100;let o=0,s=0,i=0;if(e/=100){const r=n<.5?n*(1+e):n+e-n*e,a=2*n-r;o=yt(a,r,t+1/3),s=yt(a,r,t),i=yt(a,r,t-1/3)}else o=s=i=n;return{red:Math.round(255*o),green:Math.round(255*s),blue:Math.round(255*i),alpha:r}}const wt=(t,e,n)=>{const r=t*t,o=e*e;return Math.sqrt(Math.max(0,n*(o-r)+r))},Vt=[G,X,$],At=t=>Vt.find(e=>e.test(t)),St=(t,e)=>{let n=At(t),r=At(e),o=n.parse(t),s=r.parse(e);n===$&&(o=bt(o),n=X),r===$&&(s=bt(s),r=X);const i=Object.assign({},o);return t=>{for(const e in i)"alpha"!==e&&(i[e]=wt(o[e],s[e],t));return i.alpha=gt(o.alpha,s.alpha,t),n.transform(i)}},Mt=(t,e)=>n=>e(t(n)),xt=(...t)=>t.reduce(Mt);function Ct(t,e){return"number"==typeof t?n=>gt(t,e,n):Z.test(t)?St(t,e):Pt(t,e)}const Et=(t,e)=>{const n=[...t],r=n.length,o=t.map((t,n)=>Ct(t,e[n]));return t=>{for(let e=0;e<r;e++)n[e]=o[e](t);return n}},Tt=(t,e)=>{const n=Object.assign(Object.assign({},t),e),r={};for(const o in n)void 0!==t[o]&&void 0!==e[o]&&(r[o]=Ct(t[o],e[o]));return t=>{for(const e in r)n[e]=r[e](t);return n}};function Ot(t){const e=et.parse(t),n=e.length;let r=0,o=0,s=0;for(let t=0;t<n;t++)r||"number"==typeof e[t]?r++:void 0!==e[t].hue?s++:o++;return{parsed:e,numNumbers:r,numRGB:o,numHSL:s}}const Pt=(t,e)=>{const n=et.createTransformer(e),r=Ot(t),o=Ot(e);return r.numHSL===o.numHSL&&r.numRGB===o.numRGB&&r.numNumbers>=o.numNumbers?xt(Et(r.parsed,o.parsed),n):n=>""+(n>0?e:t)},Ft=(t,e)=>n=>gt(t,e,n);function It(t,e,n){const r=[],o=n||("number"==typeof(s=t[0])?Ft:"string"==typeof s?Z.test(s)?St:Pt:Array.isArray(s)?Et:"object"==typeof s?Tt:void 0);var s;const i=t.length-1;for(let n=0;n<i;n++){let s=o(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]:e;s=xt(t,s)}r.push(s)}return r}function jt(t,e,{clamp:n=!0,ease:r,mixer:o}={}){const s=t.length;e.length,!r||!Array.isArray(r)||r.length,t[0]>t[s-1]&&(t=[].concat(t),e=[].concat(e),t.reverse(),e.reverse());const i=It(e,r,o),a=2===s?function([t,e],[n]){return r=>n(vt(t,e,r))}(t,i):function(t,e){const n=t.length,r=n-1;return o=>{let s=0,i=!1;if(o<=t[0]?i=!0:o>=t[r]&&(s=r-1,i=!0),!i){let e=1;for(;e<n&&!(t[e]>o||e===r);e++);s=e-1}const a=vt(t[s],t[s+1],o);return e[s](a)}}(t,i);return n?e=>a(ut(t[0],t[s-1],e)):a}const kt=t=>e=>1-t(1-e),Rt=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Dt=t=>e=>e*e*((t+1)*e-t),Bt=t=>t,Nt=(Ut=2,t=>Math.pow(t,Ut));var Ut;const Lt=kt(Nt),Ht=Rt(Nt),zt=t=>1-Math.sin(Math.acos(t)),qt=kt(zt),Wt=Rt(qt),$t=Dt(1.525),Kt=kt($t),Yt=Rt($t),Xt=(t=>{const e=Dt(t);return t=>(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))})(1.525),Gt=t=>{if(1===t||0===t)return t;const e=t*t;return t<4/11?7.5625*e:t<8/11?9.075*e-9.9*t+3.4:t<.9?4356/361*e-35442/1805*t+16061/1805:10.8*t*t-20.52*t+10.72},Zt=kt(Gt);function Jt(t,e){return t.map(()=>e||Ht).splice(0,t.length-1)}function _t({from:t=0,to:e=1,ease:n,offset:r,duration:o=300}){const s={done:!1,value:t},i=Array.isArray(e)?e:[t,e],a=function(t,e){return t.map(t=>t*e)}(r&&r.length===i.length?r:function(t){const e=t.length;return t.map((t,n)=>0!==n?n/(e-1):0)}(i),o);function u(){return jt(a,i,{ease:Array.isArray(n)?n:Jt(i,n)})}let l=u();return{next:t=>(s.value=l(t),s.done=t>=o,s),flipTarget:()=>{i.reverse(),l=u()}}}const Qt={keyframes:_t,spring:ft,decay:function({velocity:t=0,from:e=0,power:n=.8,timeConstant:r=350,restDelta:o=.5,modifyTarget:s}){const i={done:!1,value:e};let a=n*t;const u=e+a,l=void 0===s?u:s(u);return l!==u&&(a=l-e),{next:t=>{const e=-a*Math.exp(-t/r);return i.done=!(e>o||e<-o),i.value=i.done?l:l+e,i},flipTarget:()=>{}}}};const te="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),ee="undefined"!=typeof window?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(te()),1/60*1e3);let ne=!0,re=!1,oe=!1;const se={delta:0,timestamp:0},ie=["read","update","preRender","render","postRender"],ae=ie.reduce((t,e)=>(t[e]=function(t){let e=[],n=[],r=0,o=!1,s=!1;const i=new WeakSet,a={schedule:(t,s=!1,a=!1)=>{const u=a&&o,l=u?e:n;return s&&i.add(t),-1===l.indexOf(t)&&(l.push(t),u&&o&&(r=e.length)),t},cancel:t=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1),i.delete(t)},process:u=>{if(o)s=!0;else{if(o=!0,[e,n]=[n,e],n.length=0,r=e.length,r)for(let n=0;n<r;n++){const r=e[n];r(u),i.has(r)&&(a.schedule(r),t())}o=!1,s&&(s=!1,a.process(u))}}};return a}(()=>re=!0),t),{}),ue=ie.reduce((t,e)=>{const n=ae[e];return t[e]=(t,e=!1,r=!1)=>(re||de(),n.schedule(t,e,r)),t},{}),le=ie.reduce((t,e)=>(t[e]=ae[e].cancel,t),{});ie.reduce((t,e)=>(t[e]=()=>ae[e].process(se),t),{});const ce=t=>ae[t].process(se),pe=t=>{re=!1,se.delta=ne?1/60*1e3:Math.max(Math.min(t-se.timestamp,40),1),se.timestamp=t,oe=!0,ie.forEach(ce),oe=!1,re&&(ne=!1,ee(pe))},de=()=>{re=!0,ne=!0,oe||ee(pe)},he=()=>se;function fe(t,e,n=0){return t-e-n}const me=t=>{const e=({delta:e})=>t(e);return{start:()=>ue.update(e,!0),stop:()=>le.update(e)}};function ve(t){var e,n,{from:r,autoplay:o=!0,driver:s=me,elapsed:i=0,repeat:a=0,repeatType:u="loop",repeatDelay:l=0,onPlay:c,onStop:p,onComplete:d,onRepeat:h,onUpdate:f}=t,m=at(t,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let v,g,y,{to:b}=m,w=0,V=m.duration,A=!1,S=!0;const M=function(t){if(Array.isArray(t.to))return _t;if(Qt[t.type])return Qt[t.type];const e=new Set(Object.keys(t));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?_t:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?ft:_t}(m);(null===(n=(e=M).needsInterpolation)||void 0===n?void 0:n.call(e,r,b))&&(y=jt([0,100],[r,b],{clamp:!1}),r=0,b=100);const x=M(Object.assign(Object.assign({},m),{from:r,to:b}));function C(){w++,"reverse"===u?(S=w%2==0,i=function(t,e,n=0,r=!0){return r?fe(e+-t,e,n):e-(t-e)+n}(i,V,l,S)):(i=fe(i,V,l),"mirror"===u&&x.flipTarget()),A=!1,h&&h()}function E(t){if(S||(t=-t),i+=t,!A){const t=x.next(Math.max(0,i));g=t.value,y&&(g=y(g)),A=S?t.done:i<=0}null==f||f(g),A&&(0===w&&(null!=V||(V=i)),w<a?function(t,e,n,r){return r?t>=e+n:t<=-n}(i,V,l,S)&&C():(v.stop(),d&&d()))}return o&&(null==c||c(),v=s(E),v.start()),{stop:()=>{null==p||p(),v.stop()}}}function ge(t,e){return e?t*(1e3/e):0}const ye=(t,e)=>1-3*e+3*t,be=(t,e)=>3*e-6*t,we=t=>3*t,Ve=(t,e,n)=>((ye(e,n)*t+be(e,n))*t+we(e))*t,Ae=(t,e,n)=>3*ye(e,n)*t*t+2*be(e,n)*t+we(e);function Se(t,e,n,r){if(t===e&&n===r)return Bt;const o=new Float32Array(11);for(let e=0;e<11;++e)o[e]=Ve(.1*e,t,n);function s(e){let r=0,s=1;for(;10!==s&&o[s]<=e;++s)r+=.1;--s;const i=r+.1*((e-o[s])/(o[s+1]-o[s])),a=Ae(i,t,n);return a>=.001?function(t,e,n,r){for(let o=0;o<8;++o){const o=Ae(e,n,r);if(0===o)return e;e-=(Ve(e,n,r)-t)/o}return e}(e,i,t,n):0===a?i:function(t,e,n,r,o){let s,i,a=0;do{i=e+(n-e)/2,s=Ve(i,r,o)-t,s>0?n=i:e=i}while(Math.abs(s)>1e-7&&++a<10);return i}(e,r,r+.1,t,n)}return t=>0===t||1===t?t:Ve(s(t),e,r)}const Me=t=>1e3*t,xe={linear:Bt,easeIn:Nt,easeInOut:Ht,easeOut:Lt,circIn:zt,circInOut:Wt,circOut:qt,backIn:$t,backInOut:Yt,backOut:Kt,anticipate:Xt,bounceIn:Zt,bounceInOut:t=>t<.5?.5*(1-Gt(1-2*t)):.5*Gt(2*t-1)+.5,bounceOut:Gt},Ce=t=>{if(Array.isArray(t)){t.length;const[e,n,r,o]=t;return Se(e,n,r,o)}return"string"==typeof t?xe[t]:t},Ee=(t,e)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!et.test(e)||e.startsWith("url("))),Te=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),Oe=t=>({type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restSpeed:10}),Pe=()=>({type:"keyframes",ease:"linear",duration:.3}),Fe=t=>({type:"keyframes",duration:.8,values:t}),Ie={x:Te,y:Te,z:Te,rotate:Te,rotateX:Te,rotateY:Te,rotateZ:Te,scaleX:Oe,scaleY:Oe,scale:Oe,opacity:Pe,backgroundColor:Pe,color:Pe,default:Oe},je=(t,e)=>{let n;return n=m(e)?Fe:Ie[t]||Ie.default,{to:e,...n(e)}},ke={...v,color:Z,backgroundColor:Z,outlineColor:Z,fill:Z,stroke:Z,borderColor:Z,borderTopColor:Z,borderRightColor:Z,borderBottomColor:Z,borderLeftColor:Z,filter:st,WebkitFilter:st},Re=t=>ke[t];function De(t,e){var n;let r=Re(t);return r!==st&&(r=et),null===(n=r.getAnimatableNone)||void 0===n?void 0:n.call(r,e)}const Be=!1;function Ne({ease:t,times:e,yoyo:n,flip:r,loop:o,...s}){const i={...s};return e&&(i.offset=e),s.duration&&(i.duration=Me(s.duration)),s.repeatDelay&&(i.repeatDelay=Me(s.repeatDelay)),t&&(i.ease=(t=>Array.isArray(t)&&"number"!=typeof t[0])(t)?t.map(Ce):Ce(t)),"tween"===s.type&&(i.type="keyframes"),(n||o||r)&&(n?i.repeatType="reverse":o?i.repeatType="loop":r&&(i.repeatType="mirror"),i.repeat=o||n||r||s.repeat),"spring"!==s.type&&(i.type="keyframes"),i}function Ue(t,e,n){return Array.isArray(e.to)&&void 0===t.duration&&(t.duration=.8),function(t){Array.isArray(t.to)&&null===t.to[0]&&(t.to=[...t.to],t.to[0]=t.from)}(e),function({when:t,delay:e,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:s,repeatType:i,repeatDelay:a,from:u,...l}){return!!Object.keys(l).length}(t)||(t={...t,...je(n,e.to)}),{...e,...Ne(t)}}function Le(t,e,n,r,o){const s=qe(r,t)||{};let i=void 0!==s.from?s.from:e.get();const a=Ee(t,n);"none"===i&&a&&"string"==typeof n?i=De(t,n):He(i)&&"string"==typeof n?i=ze(n):!Array.isArray(n)&&He(n)&&"string"==typeof i&&(n=ze(i));return Ee(t,i)&&a&&!1!==s.type?function(){const r={from:i,to:n,velocity:e.getVelocity(),onComplete:o,onUpdate:t=>e.set(t)};return"inertia"===s.type||"decay"===s.type?function({from:t=0,velocity:e=0,min:n,max:r,power:o=.8,timeConstant:s=750,bounceStiffness:i=500,bounceDamping:a=10,restDelta:u=1,modifyTarget:l,driver:c,onUpdate:p,onComplete:d,onStop:h}){let f;function m(t){return void 0!==n&&t<n||void 0!==r&&t>r}function v(t){return void 0===n?r:void 0===r||Math.abs(n-t)<Math.abs(r-t)?n:r}function g(t){null==f||f.stop(),f=ve(Object.assign(Object.assign({},t),{driver:c,onUpdate:e=>{var n;null==p||p(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:d,onStop:h}))}function y(t){g(Object.assign({type:"spring",stiffness:i,damping:a,restDelta:u},t))}if(m(t))y({from:t,velocity:e,to:v(t)});else{let r=o*e+t;void 0!==l&&(r=l(r));const i=v(r),a=i===n?-1:1;let c,p;const d=t=>{c=p,p=t,e=ge(t-c,he().delta),(1===a&&t>i||-1===a&&t<i)&&y({from:t,to:i,velocity:e})};g({type:"decay",from:t,velocity:e,timeConstant:s,power:o,restDelta:u,modifyTarget:l,onUpdate:m(r)?d:void 0})}return{stop:()=>null==f?void 0:f.stop()}}({...r,...s}):ve({...Ue(s,r,t),onUpdate:t=>{r.onUpdate(t),s.onUpdate&&s.onUpdate(t)},onComplete:()=>{r.onComplete(),s.onComplete&&s.onComplete()}})}:function(){const t=g(n);return e.set(t),o(),s.onUpdate&&s.onUpdate(t),s.onComplete&&s.onComplete(),{stop:()=>{}}}}function He(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function ze(t){return"number"==typeof t?0:De("",t)}function qe(t,e){return t[e]||t.default||t}function We(t,e,n,r={}){return Be&&(r={type:!1}),e.start(o=>{let s;const i=Le(t,e,n,r,o),a=function(t,e){var n,r;return null!==(r=null!==(n=(qe(t,e)||{}).delay)&&void 0!==n?n:t.delay)&&void 0!==r?r:0}(r,t),u=()=>s=i();let l;return a?l=function(t,e){const n=performance.now(),r=({timestamp:o})=>{const s=o-n;s>=e&&(le.read(r),t(s-e))};return ue.read(r,!0),()=>le.read(r)}(u,Me(a)):u(),()=>{l&&l(),s&&s.stop()}})}const $e=t=>/^0[^.\s]+$/.test(t);class Ke{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 r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](t,e,n);else for(let o=0;o<r;o++){const r=this.subscriptions[o];r&&r(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}class Ye{constructor(t){var e;this.version="7.6.7",this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new Ke,this.velocityUpdateSubscribers=new Ke,this.renderSubscribers=new Ke,this.canTrackVelocity=!1,this.updateAndNotify=(t,e=!0)=>{this.prev=this.current,this.current=t;const{delta:n,timestamp:r}=he();this.lastUpdated!==r&&(this.timeDelta=n,this.lastUpdated=r,ue.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.updateSubscribers.notify(this.current),this.velocityUpdateSubscribers.getSize()&&this.velocityUpdateSubscribers.notify(this.getVelocity()),e&&this.renderSubscribers.notify(this.current)},this.scheduleVelocityCheck=()=>ue.postRender(this.velocityCheck),this.velocityCheck=({timestamp:t})=>{t!==this.lastUpdated&&(this.prev=this.current,this.velocityUpdateSubscribers.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e)))}onChange(t){return this.updateSubscribers.add(t)}clearListeners(){this.updateSubscribers.clear()}onRenderRequest(t){return t(this.get()),this.renderSubscribers.add(t)}attach(t){this.passiveEffect=t}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?ge(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.stopAnimation=t(e)}).then(()=>this.clearAnimation())}stop(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()}}function Xe(t){return new Ye(t)}const Ge=t=>e=>e.test(t),Ze=[p,y,u,b,w,V,{test:t=>"auto"===t,parse:t=>t}],Je=t=>Ze.find(Ge(t)),_e=[...Ze,Z,et],Qe=t=>_e.find(Ge(t));function tn(t,e,n){const r=t.getProps();return A(r,e,void 0!==n?n:r.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 en(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Xe(n))}function nn(t,e){if(!e)return;return(e[t]||e.default||e).from}function rn(t){return Boolean(S(t)&&t.add)}function on(t,e,n={}){var r;const o=tn(t,e,n.custom);let{transition:s=t.getDefaultTransition()||{}}=o||{};n.transitionOverride&&(s=n.transitionOverride);const i=o?()=>sn(t,o,n):()=>Promise.resolve(),a=(null===(r=t.variantChildren)||void 0===r?void 0:r.size)?(r=0)=>{const{delayChildren:o=0,staggerChildren:i,staggerDirection:a}=s;return function(t,e,n=0,r=0,o=1,s){const i=[],a=(t.variantChildren.size-1)*r,u=1===o?(t=0)=>t*r:(t=0)=>a-t*r;return Array.from(t.variantChildren).sort(an).forEach((t,r)=>{i.push(on(t,e,{...s,delay:n+u(r)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(i)}(t,e,o+r,i,a,n)}:()=>Promise.resolve(),{when:u}=s;if(u){const[t,e]="beforeChildren"===u?[i,a]:[a,i];return t().then(e)}return Promise.all([i(),a(n.delay)])}function sn(t,e,{delay:n=0,transitionOverride:r,type:o}={}){var s;let{transition:i=t.getDefaultTransition(),transitionEnd:a,...u}=t.makeTargetAnimatable(e);const l=t.getValue("willChange");r&&(i=r);const c=[],p=o&&(null===(s=t.animationState)||void 0===s?void 0:s.getState()[o]);for(const e in u){const r=t.getValue(e),o=u[e];if(!r||void 0===o||p&&un(p,e))continue;let s={delay:n,...i};t.shouldReduceMotion&&M.has(e)&&(s={...s,type:!1,delay:0});let a=We(e,r,o,s);rn(l)&&(l.add(e),a=a.then(()=>l.remove(e))),c.push(a)}return Promise.all(c).then(()=>{a&&function(t,e){const n=tn(t,e);let{transitionEnd:r={},transition:o={},...s}=n?t.makeTargetAnimatable(n,!1):{};s={...s,...r};for(const e in s){en(t,e,g(s[e]))}}(t,a)})}function an(t,e){return t.sortNodePosition(e)}function un({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,r}var ln;!function(t){t.Animate="animate",t.Hover="whileHover",t.Tap="whileTap",t.Drag="whileDrag",t.Focus="whileFocus",t.InView="whileInView",t.Exit="exit"}(ln||(ln={}));const cn=[ln.Animate,ln.InView,ln.Focus,ln.Hover,ln.Tap,ln.Drag,ln.Exit],pn=[...cn].reverse(),dn=cn.length;function hn(t){return e=>Promise.all(e.map(({animation:e,options:n})=>function(t,e,n={}){let r;if(t.notify("AnimationStart",e),Array.isArray(e)){const o=e.map(e=>on(t,e,n));r=Promise.all(o)}else if("string"==typeof e)r=on(t,e,n);else{const o="function"==typeof e?tn(t,e,n.custom):e;r=sn(t,o,n)}return r.then(()=>t.notify("AnimationComplete",e))}(t,e,n)))}function fn(t){let e=hn(t);const n={[ln.Animate]:vn(!0),[ln.InView]:vn(),[ln.Hover]:vn(),[ln.Tap]:vn(),[ln.Drag]:vn(),[ln.Focus]:vn(),[ln.Exit]:vn()};let r=!0;const o=(e,n)=>{const r=tn(t,n);if(r){const{transition:t,transitionEnd:n,...o}=r;e={...e,...o,...n}}return e};function s(s,i){var a;const u=t.getProps(),l=t.getVariantContext(!0)||{},c=[],p=new Set;let d={},h=1/0;for(let e=0;e<dn;e++){const f=pn[e],v=n[f],g=null!==(a=u[f])&&void 0!==a?a:l[f],y=C(g),b=f===i?v.isActive:null;!1===b&&(h=e);let w=g===l[f]&&g!==u[f]&&y;if(w&&r&&t.manuallyAnimateOnMount&&(w=!1),v.protectedKeys={...d},!v.isActive&&null===b||!g&&!v.prevProp||x(g)||"boolean"==typeof g)continue;const V=mn(v.prevProp,g);let A=V||f===i&&v.isActive&&!w&&y||e>h&&y;const S=Array.isArray(g)?g:[g];let M=S.reduce(o,{});!1===b&&(M={});const{prevResolvedValues:E={}}=v,T={...E,...M},O=t=>{A=!0,p.delete(t),v.needsAnimating[t]=!0};for(const t in T){const e=M[t],n=E[t];d.hasOwnProperty(t)||(e!==n?m(e)&&m(n)?!it(e,n)||V?O(t):v.protectedKeys[t]=!0:void 0!==e?O(t):p.add(t):void 0!==e&&p.has(t)?O(t):v.protectedKeys[t]=!0)}v.prevProp=g,v.prevResolvedValues=M,v.isActive&&(d={...d,...M}),r&&t.blockInitialAnimation&&(A=!1),A&&!w&&c.push(...S.map(t=>({animation:t,options:{type:f,...s}})))}if(p.size){const e={};p.forEach(n=>{const r=t.getBaseTarget(n);void 0!==r&&(e[n]=r)}),c.push({animation:e})}let f=Boolean(c.length);return r&&!1===u.initial&&!t.manuallyAnimateOnMount&&(f=!1),r=!1,f?e(c):Promise.resolve()}return{animateChanges:s,setActive:function(e,r,o){var i;if(n[e].isActive===r)return Promise.resolve();null===(i=t.variantChildren)||void 0===i||i.forEach(t=>{var n;return null===(n=t.animationState)||void 0===n?void 0:n.setActive(e,r)}),n[e].isActive=r;const a=s(o,e);for(const t in n)n[t].protectedKeys={};return a},setAnimateFunction:function(n){e=n(t)},getState:()=>n}}function mn(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!it(e,t)}function vn(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}const gn=t=>e=>(t(e),null),yn={animation:gn(({visualElement:t,animate:e})=>{t.animationState||(t.animationState=fn(t)),x(e)&&n(()=>e.subscribe(t),[e])}),exit:gn(r=>{const{custom:o,visualElement:s}=r,[i,a]=function(){const r=t(f);if(null===r)return[!0,null];const{isPresent:o,onExitComplete:s,register:i}=r,a=e();return n(()=>i(a),[]),!o&&s?[!1,()=>s&&s(a)]:[!0]}(),u=t(f);n(()=>{s.isPresent=i;const t=s.animationState&&s.animationState.setActive(ln.Exit,!i,{custom:u&&u.custom||o});t&&!i&&t.then(a)},[i])})};function bn(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n)}function wn(t,e,r,o){n(()=>{const n=t.current;if(r&&n)return bn(n,e,r,o)},[t,e,r,o])}function Vn(t){return!!t.touches}const An={pageX:0,pageY:0};function Sn(t,e="page"){const n=t.touches[0]||t.changedTouches[0]||An;return{x:n[e+"X"],y:n[e+"Y"]}}function Mn(t,e="page"){return{x:t[e+"X"],y:t[e+"Y"]}}const xn=(t,e=!1)=>{const n=e=>t(e,function(t,e="page"){return{point:Vn(t)?Sn(t,e):Mn(t,e)}}(e));return e?(r=n,t=>{const e=t instanceof MouseEvent;(!e||e&&0===t.button)&&r(t)}):n;var r},Cn={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},En={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function Tn(t){return E&&null===window.onpointerdown?t:E&&null===window.ontouchstart?En[t]:E&&null===window.onmousedown?Cn[t]:t}function On(t,e,n,r){return bn(t,Tn(e),xn(n,"pointerdown"===e),r)}function Pn(t,e,n,r){return wn(t,Tn(e),n&&xn(n,"pointerdown"===e),r)}function Fn(t){let e=null;return()=>{const n=()=>{e=null};return null===e&&(e=t,n)}}const In=Fn("dragHorizontal"),jn=Fn("dragVertical");function kn(){const t=function(t){let e=!1;if("y"===t)e=jn();else if("x"===t)e=In();else{const t=In(),n=jn();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}(!0);return!t||(t(),!1)}function Rn(t,e,n){return(r,o)=>{(function(t){return"undefined"!=typeof PointerEvent&&t instanceof PointerEvent?!("mouse"!==t.pointerType):t instanceof MouseEvent})(r)&&!kn()&&(t.animationState&&t.animationState.setActive(ln.Hover,e),n&&n(r,o))}}const Dn=(t,e)=>!!e&&(t===e||Dn(t,e.parentElement));const Bn=("undefined"==typeof process||process.env,"production"),Nn=new Set;const Un=new WeakMap,Ln=new WeakMap,Hn=t=>{const e=Un.get(t.target);e&&e(t)},zn=t=>{t.forEach(Hn)};function qn(t,e,n){const r=function({root:t,...e}){const n=t||document;Ln.has(n)||Ln.set(n,{});const r=Ln.get(n),o=JSON.stringify(e);return r[o]||(r[o]=new IntersectionObserver(zn,{root:t,...e})),r[o]}(e);return Un.set(t,n),r.observe(t),()=>{Un.delete(t),r.unobserve(t)}}const Wn={some:0,all:1};function $n(t,e,r,{root:o,margin:s,amount:i="some",once:a}){n(()=>{if(!t||!r.current)return;const n={root:null==o?void 0:o.current,rootMargin:s,threshold:"number"==typeof i?i:Wn[i]};return qn(r.current,n,t=>{const{isIntersecting:n}=t;if(e.isInView===n)return;if(e.isInView=n,a&&!n&&e.hasEnteredView)return;n&&(e.hasEnteredView=!0),r.animationState&&r.animationState.setActive(ln.InView,n);const o=r.getProps(),s=n?o.onViewportEnter:o.onViewportLeave;s&&s(t)})},[t,o,s,i])}function Kn(t,e,r,{fallback:o=!0}){n(()=>{var n,s;t&&o&&("production"!==Bn&&(n="IntersectionObserver not available on this device. whileInView animations will trigger on mount.",!1||Nn.has(n)||(console.warn(n),s&&console.warn(s),Nn.add(n))),requestAnimationFrame(()=>{e.hasEnteredView=!0;const{onViewportEnter:t}=r.getProps();t&&t(null),r.animationState&&r.animationState.setActive(ln.InView,!0)}))},[t])}const Yn={inView:gn((function({visualElement:t,whileInView:e,onViewportEnter:n,onViewportLeave:o,viewport:s={}}){const i=r({hasEnteredView:!1,isInView:!1});let a=Boolean(e||n||o);s.once&&i.current.hasEnteredView&&(a=!1),("undefined"==typeof IntersectionObserver?Kn:$n)(a,i.current,t,s)})),tap:gn((function({onTap:t,onTapStart:e,onTapCancel:o,whileTap:s,visualElement:i}){const a=t||e||o||s,u=r(!1),l=r(null),c={passive:!(e||t||o||m)};function p(){l.current&&l.current(),l.current=null}function d(){return p(),u.current=!1,i.animationState&&i.animationState.setActive(ln.Tap,!1),!kn()}function h(e,n){d()&&(Dn(i.current,e.target)?t&&t(e,n):o&&o(e,n))}function f(t,e){d()&&o&&o(t,e)}function m(t,n){p(),u.current||(u.current=!0,l.current=xt(On(window,"pointerup",h,c),On(window,"pointercancel",f,c)),i.animationState&&i.animationState.setActive(ln.Tap,!0),e&&e(t,n))}var v;Pn(i,"pointerdown",a?m:void 0,c),v=p,n(()=>()=>v(),[])})),focus:gn((function({whileFocus:t,visualElement:e}){const{animationState:n}=e;wn(e,"focus",t?()=>{n&&n.setActive(ln.Focus,!0)}:void 0),wn(e,"blur",t?()=>{n&&n.setActive(ln.Focus,!1)}:void 0)})),hover:gn((function({onHoverStart:t,onHoverEnd:e,whileHover:n,visualElement:r}){Pn(r,"pointerenter",t||n?Rn(r,!0,t):void 0,{passive:!t}),Pn(r,"pointerleave",e||n?Rn(r,!1,e):void 0,{passive:!e})}))};function Xn(t){return"string"==typeof t&&t.startsWith("var(--")}const Gn=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function Zn(t,e,n=1){const[r,o]=function(t){const e=Gn.exec(t);if(!e)return[,];const[,n,r]=e;return[n,r]}(t);if(!r)return;const s=window.getComputedStyle(e).getPropertyValue(r);return s?s.trim():Xn(o)?Zn(o,e,n+1):o}const Jn=new Set(["width","height","top","left","right","bottom","x","y"]),_n=t=>Jn.has(t),Qn=(t,e)=>{t.set(e,!1),t.set(e)},tr=t=>t===p||t===y;var er;!function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"}(er||(er={}));const nr=(t,e)=>parseFloat(t.split(", ")[e]),rr=(t,e)=>(n,{transform:r})=>{if("none"===r||!r)return 0;const o=r.match(/^matrix3d\((.+)\)$/);if(o)return nr(o[1],e);{const e=r.match(/^matrix\((.+)\)$/);return e?nr(e[1],t):0}},or=new Set(["x","y","z"]),sr=T.filter(t=>!or.has(t));const ir={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:rr(4,13),y:rr(5,14)},ar=(t,e,n={},r={})=>{e={...e},r={...r};const o=Object.keys(e).filter(_n);let s=[],i=!1;const a=[];if(o.forEach(o=>{const u=t.getValue(o);if(!t.hasValue(o))return;let l=n[o],c=Je(l);const p=e[o];let d;if(m(p)){const t=p.length,e=null===p[0]?1:0;l=p[e],c=Je(l);for(let n=e;n<t;n++)d?Je(p[n]):d=Je(p[n])}else d=Je(p);if(c!==d)if(tr(c)&&tr(d)){const t=u.get();"string"==typeof t&&u.set(parseFloat(t)),"string"==typeof p?e[o]=parseFloat(p):Array.isArray(p)&&d===y&&(e[o]=p.map(parseFloat))}else(null==c?void 0:c.transform)&&(null==d?void 0:d.transform)&&(0===l||0===p)?0===l?u.set(d.transform(l)):e[o]=c.transform(p):(i||(s=function(t){const e=[];return sr.forEach(n=>{const r=t.getValue(n);void 0!==r&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e.length&&t.render(),e}(t),i=!0),a.push(o),r[o]=void 0!==r[o]?r[o]:e[o],Qn(u,p))}),a.length){const n=a.indexOf("height")>=0?window.pageYOffset:null,o=((t,e,n)=>{const r=e.measureViewportBox(),o=e.current,s=getComputedStyle(o),{display:i}=s,a={};"none"===i&&e.setStaticValue("display",t.display||"block"),n.forEach(t=>{a[t]=ir[t](r,s)}),e.render();const u=e.measureViewportBox();return n.forEach(n=>{const r=e.getValue(n);Qn(r,a[n]),t[n]=ir[n](u,s)}),t})(e,t,a);return s.length&&s.forEach(([e,n])=>{t.getValue(e).set(n)}),t.render(),E&&null!==n&&window.scrollTo({top:n}),{target:o,transitionEnd:r}}return{target:e,transitionEnd:r}};function ur(t,e,n,r){return(t=>Object.keys(t).some(_n))(e)?ar(t,e,n,r):{target:e,transitionEnd:r}}const lr=(t,e,n,r)=>{const o=function(t,{...e},n){const r=t.current;if(!(r instanceof Element))return{target:e,transitionEnd:n};n&&(n={...n}),t.values.forEach(t=>{const e=t.get();if(!Xn(e))return;const n=Zn(e,r);n&&t.set(n)});for(const t in e){const o=e[t];if(!Xn(o))continue;const s=Zn(o,r);s&&(e[t]=s,n&&void 0===n[t]&&(n[t]=o))}return{target:e,transitionEnd:n}}(t,e,r);return ur(t,e=o.target,n,r=o.transitionEnd)},cr={current:null},pr={current:!1};const dr=Object.keys(O),hr=dr.length,fr=["AnimationStart","AnimationComplete","Update","Unmount","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];const mr=["initial",...cn],vr=mr.length;class gr extends class{constructor({parent:t,props:e,reducedMotionConfig:n,visualState:r},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.isPresent=!0,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=()=>ue.render(this.render,!1,!0);const{latestValues:s,renderState:i}=r;this.latestValues=s,this.baseTarget={...s},this.initialValues=e.initial?{...s}:{},this.renderState=i,this.parent=t,this.props=e,this.depth=t?t.depth+1:0,this.reducedMotionConfig=n,this.options=o,this.isControllingVariants=P(e),this.isVariantNode=F(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:a,...u}=this.scrapeMotionValuesFromProps(e);for(const t in u){const e=u[t];void 0!==s[t]&&S(e)&&(e.set(s[t],!1),rn(a)&&a.add(t))}}scrapeMotionValuesFromProps(t){return{}}mount(t){var e;this.current=t,this.projection&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=null===(e=this.parent)||void 0===e?void 0:e.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),pr.current||function(){if(pr.current=!0,E)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>cr.current=t.matches;t.addListener(e),e()}else cr.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||cr.current),this.parent&&this.parent.children.add(this),this.setProps(this.props)}unmount(){var t,e,n;null===(t=this.projection)||void 0===t||t.unmount(),le.update(this.notifyUpdate),le.render(this.render),this.valueSubscriptions.forEach(t=>t()),null===(e=this.removeFromVariantTree)||void 0===e||e.call(this),null===(n=this.parent)||void 0===n||n.children.delete(this);for(const t in this.events)this.events[t].clear();this.current=null}bindToMotionValue(t,e){const n=e.onChange(e=>{this.latestValues[t]=e,this.props.onUpdate&&ue.update(this.notifyUpdate,!1,!0)}),r=e.onRenderRequest(this.scheduleRender);this.valueSubscriptions.set(t,()=>{n(),r()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}loadFeatures(t,e,n,r,s,i){const a=[];for(let e=0;e<hr;e++){const n=dr[e],{isEnabled:r,Component:s}=O[n];r(t)&&s&&a.push(o(s,{key:n,...t,visualElement:this}))}if(!this.projection&&s){this.projection=new s(r,this.latestValues,this.parent&&this.parent.projection);const{layoutId:e,layout:n,drag:o,dragConstraints:a,layoutScroll:u}=t;this.projection.setOptions({layoutId:e,layout:n,alwaysMeasureLayout:Boolean(o)||a&&I(a),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:i,layoutScroll:u})}return a}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)}setProps(t){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.props=t;for(let e=0;e<fr.length;e++){const n=fr[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const r=t["on"+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=function(t,e,n){const{willChange:r}=e;for(const o in e){const s=e[o],i=n[o];if(S(s))t.addValue(o,s),rn(r)&&r.add(o);else if(S(i))t.addValue(o,Xe(s)),rn(r)&&r.remove(o);else if(i!==s)if(t.hasValue(o)){const e=t.getValue(o);!e.hasAnimated&&e.set(s)}else{const e=t.getStaticValue(o);t.addValue(o,Xe(void 0!==e?e:s))}}for(const r in n)void 0===e[r]&&t.removeValue(r);return e}(this,this.scrapeMotionValuesFromProps(t),this.prevMotionValues)}getProps(){return this.props}getVariant(t){var e;return null===(e=this.props.variants)||void 0===e?void 0:e[t]}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){var t;return this.isVariantNode?this:null===(t=this.parent)||void 0===t?void 0:t.getClosestVariantNode()}getVariantContext(t=!1){var e,n;if(t)return null===(e=this.parent)||void 0===e?void 0:e.getVariantContext();if(!this.isControllingVariants){const t=(null===(n=this.parent)||void 0===n?void 0:n.getVariantContext())||{};return void 0!==this.props.initial&&(t.initial=this.props.initial),t}const r={};for(let t=0;t<vr;t++){const e=mr[t],n=this.props[e];(C(n)||!1===n)&&(r[e]=n)}return r}addVariantChild(t){var e;const n=this.getClosestVariantNode();if(n)return null===(e=n.variantChildren)||void 0===e||e.add(t),()=>n.variantChildren.delete(t)}addValue(t,e){this.hasValue(t)&&this.removeValue(t),this.values.set(t,e),this.latestValues[t]=e.get(),this.bindToMotionValue(t,e)}removeValue(t){var e;this.values.delete(t),null===(e=this.valueSubscriptions.get(t))||void 0===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=Xe(e),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,r="string"==typeof n||"object"==typeof n?null===(e=A(this.props,n))||void 0===e?void 0:e[t]:void 0;if(n&&void 0!==r)return r;const o=this.getBaseTargetFromProps(this.props,t);return void 0===o||S(o)?void 0!==this.initialValues[t]&&void 0===r?void 0:this.baseTarget[t]:o}on(t,e){return this.events[t]||(this.events[t]=new Ke),this.events[t].add(e)}notify(t,...e){var n;null===(n=this.events[t])||void 0===n||n.notify(...e)}}{sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){var n;return null===(n=t.style)||void 0===n?void 0:n[e]}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:e,...n},{transformValues:r},o){let s=function(t,e,n){var r;const o={};for(const s in t){const t=nn(s,e);o[s]=void 0!==t?t:null===(r=n.getValue(s))||void 0===r?void 0:r.get()}return o}(n,t||{},this);if(r&&(e&&(e=r(e)),n&&(n=r(n)),s&&(s=r(s))),o){!function(t,e,n){var r,o;const s=Object.keys(e).filter(e=>!t.hasValue(e)),i=s.length;if(i)for(let a=0;a<i;a++){const i=s[a],u=e[i];let l=null;Array.isArray(u)&&(l=u[0]),null===l&&(l=null!==(o=null!==(r=n[i])&&void 0!==r?r:t.readValue(i))&&void 0!==o?o:e[i]),null!=l&&("string"==typeof l&&(/^\-?\d*\.?\d+$/.test(l)||$e(l))?l=parseFloat(l):!Qe(l)&&et.test(u)&&(l=De(i,u)),t.addValue(i,Xe(l)),void 0===n[i]&&(n[i]=l),null!==l&&t.setBaseTarget(i,l))}}(this,n,s);const t=lr(this,n,s,e);e=t.transitionEnd,n=t.target}return{transition:t,transitionEnd:e,...n}}}class yr extends gr{readValueFromInstance(t,e){if(M.has(e)){const t=Re(e);return t&&t.default||0}{const r=(n=t,window.getComputedStyle(n)),o=(j(e)?r.getPropertyValue(e):r[e])||0;return"string"==typeof o?o.trim():o}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return function(t,e){return function({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}(t.getBoundingClientRect(),e))}(t,e)}build(t,e,n,r){k(t,e,n,r.transformTemplate)}scrapeMotionValuesFromProps(t){return R(t)}renderInstance(t,e,n,r){D(t,e,n,r)}}class br extends gr{getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){var n;return M.has(e)?(null===(n=Re(e))||void 0===n?void 0:n.default)||0:(e=B.has(e)?e:N(e),t.getAttribute(e))}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}scrapeMotionValuesFromProps(t){return U(t)}build(t,e,n,r){L(t,e,n,r.transformTemplate)}renderInstance(t,e,n,r){H(t,e,n,r)}}const wr={renderer:(t,e)=>z(t)?new br(e,{enableHardwareAcceleration:!1}):new yr(e,{enableHardwareAcceleration:!0}),...yn,...Yn};export{wr as domAnimation};
1
+ import{useContext as t,useId as e,useEffect as n,useRef as r,createElement as o}from"react";import{p as s,q as i,t as a,u,v as l,w as c,x as p,y as d,z as h,P as f,A as m,B as v,C as g,D as y,E as b,F as w,G as V,r as A,d as S,H as M,m as x,c as C,i as E,I as T,f as O,b as P,l as F,a as I,J as j,g as k,o as R,K as D,L as B,M as N,s as U,h as L,n as H,j as z}from"./size-rollup-dom-animation-assets.js";const q=(t,e)=>n=>Boolean(s(n)&&i.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),W=(t,e,n)=>r=>{if(!s(r))return r;const[o,i,u,l]=r.match(a);return{[t]:parseFloat(o),[e]:parseFloat(i),[n]:parseFloat(u),alpha:void 0!==l?parseFloat(l):1}},$={test:q("hsl","hue"),parse:W("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+u.transform(l(e))+", "+u.transform(l(n))+", "+l(c.transform(r))+")"},K=d(0,255),Y=Object.assign(Object.assign({},p),{transform:t=>Math.round(K(t))}),X={test:q("rgb","red"),parse:W("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+Y.transform(t)+", "+Y.transform(e)+", "+Y.transform(n)+", "+l(c.transform(r))+")"};const G={test:q("#"),parse:function(t){let e="",n="",r="",o="";return t.length>5?(e=t.substr(1,2),n=t.substr(3,2),r=t.substr(5,2),o=t.substr(7,2)):(e=t.substr(1,1),n=t.substr(2,1),r=t.substr(3,1),o=t.substr(4,1),e+=e,n+=n,r+=r,o+=o),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}},transform:X.transform},Z={test:t=>X.test(t)||G.test(t)||$.test(t),parse:t=>X.test(t)?X.parse(t):$.test(t)?$.parse(t):G.parse(t),transform:t=>s(t)?t:t.hasOwnProperty("red")?X.transform(t):$.transform(t)};function J(t){"number"==typeof t&&(t=""+t);const e=[];let n=0;const r=t.match(h);r&&(n=r.length,t=t.replace(h,"${c}"),e.push(...r.map(Z.parse)));const o=t.match(a);return o&&(t=t.replace(a,"${n}"),e.push(...o.map(p.parse))),{values:e,numColors:n,tokenised:t}}function _(t){return J(t).values}function Q(t){const{values:e,numColors:n,tokenised:r}=J(t),o=e.length;return t=>{let e=r;for(let r=0;r<o;r++)e=e.replace(r<n?"${c}":"${n}",r<n?Z.transform(t[r]):l(t[r]));return e}}const tt=t=>"number"==typeof t?0:t;const et={test:function(t){var e,n,r,o;return isNaN(t)&&s(t)&&(null!==(n=null===(e=t.match(a))||void 0===e?void 0:e.length)&&void 0!==n?n:0)+(null!==(o=null===(r=t.match(h))||void 0===r?void 0:r.length)&&void 0!==o?o:0)>0},parse:_,createTransformer:Q,getAnimatableNone:function(t){const e=_(t);return Q(t)(e.map(tt))}},nt=new Set(["brightness","contrast","saturate","opacity"]);function rt(t){let[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[r]=n.match(a)||[];if(!r)return t;const o=n.replace(r,"");let s=nt.has(e)?1:0;return r!==n&&(s*=100),e+"("+s+o+")"}const ot=/([a-z-]*)\(.*?\)/g,st=Object.assign(Object.assign({},et),{getAnimatableNone:t=>{const e=t.match(ot);return e?e.map(rt).join(" "):t}});function it(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}function at(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}const ut=(t,e,n)=>Math.min(Math.max(n,t),e);function lt({duration:t=800,bounce:e=.25,velocity:n=0,mass:r=1}){let o,s,i=1-e;i=ut(.05,1,i),t=ut(.01,10,t/1e3),i<1?(o=e=>{const r=e*i,o=r*t;return.001-(r-n)/ct(e,i)*Math.exp(-o)},s=e=>{const r=e*i*t,s=r*n+n,a=Math.pow(i,2)*Math.pow(e,2)*t,u=Math.exp(-r),l=ct(Math.pow(e,2),i);return(.001-o(e)>0?-1:1)*((s-a)*u)/l}):(o=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,s=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let r=n;for(let n=1;n<12;n++)r-=t(r)/e(r);return r}(o,s,5/t);if(t*=1e3,isNaN(a))return{stiffness:100,damping:10,duration:t};{const e=Math.pow(a,2)*r;return{stiffness:e,damping:2*i*Math.sqrt(r*e),duration:t}}}function ct(t,e){return t*Math.sqrt(1-e*e)}const pt=["duration","bounce"],dt=["stiffness","damping","mass"];function ht(t,e){return e.some(e=>void 0!==t[e])}function ft(t){var{from:e=0,to:n=1,restSpeed:r=2,restDelta:o}=t,s=at(t,["from","to","restSpeed","restDelta"]);const i={done:!1,value:e};let{stiffness:a,damping:u,mass:l,velocity:c,duration:p,isResolvedFromDuration:d}=function(t){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},t);if(!ht(t,dt)&&ht(t,pt)){const n=lt(t);e=Object.assign(Object.assign(Object.assign({},e),n),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}(s),h=mt,f=mt;function m(){const t=c?-c/1e3:0,r=n-e,s=u/(2*Math.sqrt(a*l)),i=Math.sqrt(a/l)/1e3;if(void 0===o&&(o=Math.min(Math.abs(n-e)/100,.4)),s<1){const e=ct(i,s);h=o=>{const a=Math.exp(-s*i*o);return n-a*((t+s*i*r)/e*Math.sin(e*o)+r*Math.cos(e*o))},f=n=>{const o=Math.exp(-s*i*n);return s*i*o*(Math.sin(e*n)*(t+s*i*r)/e+r*Math.cos(e*n))-o*(Math.cos(e*n)*(t+s*i*r)-e*r*Math.sin(e*n))}}else if(1===s)h=e=>n-Math.exp(-i*e)*(r+(t+i*r)*e);else{const e=i*Math.sqrt(s*s-1);h=o=>{const a=Math.exp(-s*i*o),u=Math.min(e*o,300);return n-a*((t+s*i*r)*Math.sinh(u)+e*r*Math.cosh(u))/e}}}return m(),{next:t=>{const e=h(t);if(d)i.done=t>=p;else{const s=1e3*f(t),a=Math.abs(s)<=r,u=Math.abs(n-e)<=o;i.done=a&&u}return i.value=i.done?n:e,i},flipTarget:()=>{c=-c,[e,n]=[n,e],m()}}}ft.needsInterpolation=(t,e)=>"string"==typeof t||"string"==typeof e;const mt=t=>0,vt=(t,e,n)=>{const r=e-t;return 0===r?1:(n-t)/r},gt=(t,e,n)=>-n*t+n*e+t;function yt(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function bt({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,n/=100;let o=0,s=0,i=0;if(e/=100){const r=n<.5?n*(1+e):n+e-n*e,a=2*n-r;o=yt(a,r,t+1/3),s=yt(a,r,t),i=yt(a,r,t-1/3)}else o=s=i=n;return{red:Math.round(255*o),green:Math.round(255*s),blue:Math.round(255*i),alpha:r}}const wt=(t,e,n)=>{const r=t*t,o=e*e;return Math.sqrt(Math.max(0,n*(o-r)+r))},Vt=[G,X,$],At=t=>Vt.find(e=>e.test(t)),St=(t,e)=>{let n=At(t),r=At(e),o=n.parse(t),s=r.parse(e);n===$&&(o=bt(o),n=X),r===$&&(s=bt(s),r=X);const i=Object.assign({},o);return t=>{for(const e in i)"alpha"!==e&&(i[e]=wt(o[e],s[e],t));return i.alpha=gt(o.alpha,s.alpha,t),n.transform(i)}},Mt=(t,e)=>n=>e(t(n)),xt=(...t)=>t.reduce(Mt);function Ct(t,e){return"number"==typeof t?n=>gt(t,e,n):Z.test(t)?St(t,e):Pt(t,e)}const Et=(t,e)=>{const n=[...t],r=n.length,o=t.map((t,n)=>Ct(t,e[n]));return t=>{for(let e=0;e<r;e++)n[e]=o[e](t);return n}},Tt=(t,e)=>{const n=Object.assign(Object.assign({},t),e),r={};for(const o in n)void 0!==t[o]&&void 0!==e[o]&&(r[o]=Ct(t[o],e[o]));return t=>{for(const e in r)n[e]=r[e](t);return n}};function Ot(t){const e=et.parse(t),n=e.length;let r=0,o=0,s=0;for(let t=0;t<n;t++)r||"number"==typeof e[t]?r++:void 0!==e[t].hue?s++:o++;return{parsed:e,numNumbers:r,numRGB:o,numHSL:s}}const Pt=(t,e)=>{const n=et.createTransformer(e),r=Ot(t),o=Ot(e);return r.numHSL===o.numHSL&&r.numRGB===o.numRGB&&r.numNumbers>=o.numNumbers?xt(Et(r.parsed,o.parsed),n):n=>""+(n>0?e:t)},Ft=(t,e)=>n=>gt(t,e,n);function It(t,e,n){const r=[],o=n||("number"==typeof(s=t[0])?Ft:"string"==typeof s?Z.test(s)?St:Pt:Array.isArray(s)?Et:"object"==typeof s?Tt:void 0);var s;const i=t.length-1;for(let n=0;n<i;n++){let s=o(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]:e;s=xt(t,s)}r.push(s)}return r}function jt(t,e,{clamp:n=!0,ease:r,mixer:o}={}){const s=t.length;e.length,!r||!Array.isArray(r)||r.length,t[0]>t[s-1]&&(t=[].concat(t),e=[].concat(e),t.reverse(),e.reverse());const i=It(e,r,o),a=2===s?function([t,e],[n]){return r=>n(vt(t,e,r))}(t,i):function(t,e){const n=t.length,r=n-1;return o=>{let s=0,i=!1;if(o<=t[0]?i=!0:o>=t[r]&&(s=r-1,i=!0),!i){let e=1;for(;e<n&&!(t[e]>o||e===r);e++);s=e-1}const a=vt(t[s],t[s+1],o);return e[s](a)}}(t,i);return n?e=>a(ut(t[0],t[s-1],e)):a}const kt=t=>e=>1-t(1-e),Rt=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Dt=t=>e=>e*e*((t+1)*e-t),Bt=t=>t,Nt=(Ut=2,t=>Math.pow(t,Ut));var Ut;const Lt=kt(Nt),Ht=Rt(Nt),zt=t=>1-Math.sin(Math.acos(t)),qt=kt(zt),Wt=Rt(qt),$t=Dt(1.525),Kt=kt($t),Yt=Rt($t),Xt=(t=>{const e=Dt(t);return t=>(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))})(1.525),Gt=t=>{if(1===t||0===t)return t;const e=t*t;return t<4/11?7.5625*e:t<8/11?9.075*e-9.9*t+3.4:t<.9?4356/361*e-35442/1805*t+16061/1805:10.8*t*t-20.52*t+10.72},Zt=kt(Gt);function Jt(t,e){return t.map(()=>e||Ht).splice(0,t.length-1)}function _t({from:t=0,to:e=1,ease:n,offset:r,duration:o=300}){const s={done:!1,value:t},i=Array.isArray(e)?e:[t,e],a=function(t,e){return t.map(t=>t*e)}(r&&r.length===i.length?r:function(t){const e=t.length;return t.map((t,n)=>0!==n?n/(e-1):0)}(i),o);function u(){return jt(a,i,{ease:Array.isArray(n)?n:Jt(i,n)})}let l=u();return{next:t=>(s.value=l(t),s.done=t>=o,s),flipTarget:()=>{i.reverse(),l=u()}}}const Qt={keyframes:_t,spring:ft,decay:function({velocity:t=0,from:e=0,power:n=.8,timeConstant:r=350,restDelta:o=.5,modifyTarget:s}){const i={done:!1,value:e};let a=n*t;const u=e+a,l=void 0===s?u:s(u);return l!==u&&(a=l-e),{next:t=>{const e=-a*Math.exp(-t/r);return i.done=!(e>o||e<-o),i.value=i.done?l:l+e,i},flipTarget:()=>{}}}};const te="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),ee="undefined"!=typeof window?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(te()),1/60*1e3);let ne=!0,re=!1,oe=!1;const se={delta:0,timestamp:0},ie=["read","update","preRender","render","postRender"],ae=ie.reduce((t,e)=>(t[e]=function(t){let e=[],n=[],r=0,o=!1,s=!1;const i=new WeakSet,a={schedule:(t,s=!1,a=!1)=>{const u=a&&o,l=u?e:n;return s&&i.add(t),-1===l.indexOf(t)&&(l.push(t),u&&o&&(r=e.length)),t},cancel:t=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1),i.delete(t)},process:u=>{if(o)s=!0;else{if(o=!0,[e,n]=[n,e],n.length=0,r=e.length,r)for(let n=0;n<r;n++){const r=e[n];r(u),i.has(r)&&(a.schedule(r),t())}o=!1,s&&(s=!1,a.process(u))}}};return a}(()=>re=!0),t),{}),ue=ie.reduce((t,e)=>{const n=ae[e];return t[e]=(t,e=!1,r=!1)=>(re||de(),n.schedule(t,e,r)),t},{}),le=ie.reduce((t,e)=>(t[e]=ae[e].cancel,t),{});ie.reduce((t,e)=>(t[e]=()=>ae[e].process(se),t),{});const ce=t=>ae[t].process(se),pe=t=>{re=!1,se.delta=ne?1/60*1e3:Math.max(Math.min(t-se.timestamp,40),1),se.timestamp=t,oe=!0,ie.forEach(ce),oe=!1,re&&(ne=!1,ee(pe))},de=()=>{re=!0,ne=!0,oe||ee(pe)},he=()=>se;function fe(t,e,n=0){return t-e-n}const me=t=>{const e=({delta:e})=>t(e);return{start:()=>ue.update(e,!0),stop:()=>le.update(e)}};function ve(t){var e,n,{from:r,autoplay:o=!0,driver:s=me,elapsed:i=0,repeat:a=0,repeatType:u="loop",repeatDelay:l=0,onPlay:c,onStop:p,onComplete:d,onRepeat:h,onUpdate:f}=t,m=at(t,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let v,g,y,{to:b}=m,w=0,V=m.duration,A=!1,S=!0;const M=function(t){if(Array.isArray(t.to))return _t;if(Qt[t.type])return Qt[t.type];const e=new Set(Object.keys(t));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?_t:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?ft:_t}(m);(null===(n=(e=M).needsInterpolation)||void 0===n?void 0:n.call(e,r,b))&&(y=jt([0,100],[r,b],{clamp:!1}),r=0,b=100);const x=M(Object.assign(Object.assign({},m),{from:r,to:b}));function C(){w++,"reverse"===u?(S=w%2==0,i=function(t,e,n=0,r=!0){return r?fe(e+-t,e,n):e-(t-e)+n}(i,V,l,S)):(i=fe(i,V,l),"mirror"===u&&x.flipTarget()),A=!1,h&&h()}function E(t){if(S||(t=-t),i+=t,!A){const t=x.next(Math.max(0,i));g=t.value,y&&(g=y(g)),A=S?t.done:i<=0}null==f||f(g),A&&(0===w&&(null!=V||(V=i)),w<a?function(t,e,n,r){return r?t>=e+n:t<=-n}(i,V,l,S)&&C():(v.stop(),d&&d()))}return o&&(null==c||c(),v=s(E),v.start()),{stop:()=>{null==p||p(),v.stop()}}}function ge(t,e){return e?t*(1e3/e):0}const ye=(t,e)=>1-3*e+3*t,be=(t,e)=>3*e-6*t,we=t=>3*t,Ve=(t,e,n)=>((ye(e,n)*t+be(e,n))*t+we(e))*t,Ae=(t,e,n)=>3*ye(e,n)*t*t+2*be(e,n)*t+we(e);function Se(t,e,n,r){if(t===e&&n===r)return Bt;const o=new Float32Array(11);for(let e=0;e<11;++e)o[e]=Ve(.1*e,t,n);function s(e){let r=0,s=1;for(;10!==s&&o[s]<=e;++s)r+=.1;--s;const i=r+.1*((e-o[s])/(o[s+1]-o[s])),a=Ae(i,t,n);return a>=.001?function(t,e,n,r){for(let o=0;o<8;++o){const o=Ae(e,n,r);if(0===o)return e;e-=(Ve(e,n,r)-t)/o}return e}(e,i,t,n):0===a?i:function(t,e,n,r,o){let s,i,a=0;do{i=e+(n-e)/2,s=Ve(i,r,o)-t,s>0?n=i:e=i}while(Math.abs(s)>1e-7&&++a<10);return i}(e,r,r+.1,t,n)}return t=>0===t||1===t?t:Ve(s(t),e,r)}const Me=t=>1e3*t,xe={linear:Bt,easeIn:Nt,easeInOut:Ht,easeOut:Lt,circIn:zt,circInOut:Wt,circOut:qt,backIn:$t,backInOut:Yt,backOut:Kt,anticipate:Xt,bounceIn:Zt,bounceInOut:t=>t<.5?.5*(1-Gt(1-2*t)):.5*Gt(2*t-1)+.5,bounceOut:Gt},Ce=t=>{if(Array.isArray(t)){t.length;const[e,n,r,o]=t;return Se(e,n,r,o)}return"string"==typeof t?xe[t]:t},Ee=(t,e)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!et.test(e)||e.startsWith("url("))),Te=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),Oe=t=>({type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restSpeed:10}),Pe=()=>({type:"keyframes",ease:"linear",duration:.3}),Fe=t=>({type:"keyframes",duration:.8,values:t}),Ie={x:Te,y:Te,z:Te,rotate:Te,rotateX:Te,rotateY:Te,rotateZ:Te,scaleX:Oe,scaleY:Oe,scale:Oe,opacity:Pe,backgroundColor:Pe,color:Pe,default:Oe},je=(t,e)=>{let n;return n=m(e)?Fe:Ie[t]||Ie.default,{to:e,...n(e)}},ke={...v,color:Z,backgroundColor:Z,outlineColor:Z,fill:Z,stroke:Z,borderColor:Z,borderTopColor:Z,borderRightColor:Z,borderBottomColor:Z,borderLeftColor:Z,filter:st,WebkitFilter:st},Re=t=>ke[t];function De(t,e){var n;let r=Re(t);return r!==st&&(r=et),null===(n=r.getAnimatableNone)||void 0===n?void 0:n.call(r,e)}const Be=!1;function Ne({ease:t,times:e,yoyo:n,flip:r,loop:o,...s}){const i={...s};return e&&(i.offset=e),s.duration&&(i.duration=Me(s.duration)),s.repeatDelay&&(i.repeatDelay=Me(s.repeatDelay)),t&&(i.ease=(t=>Array.isArray(t)&&"number"!=typeof t[0])(t)?t.map(Ce):Ce(t)),"tween"===s.type&&(i.type="keyframes"),(n||o||r)&&(n?i.repeatType="reverse":o?i.repeatType="loop":r&&(i.repeatType="mirror"),i.repeat=o||n||r||s.repeat),"spring"!==s.type&&(i.type="keyframes"),i}function Ue(t,e,n){return Array.isArray(e.to)&&void 0===t.duration&&(t.duration=.8),function(t){Array.isArray(t.to)&&null===t.to[0]&&(t.to=[...t.to],t.to[0]=t.from)}(e),function({when:t,delay:e,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:s,repeatType:i,repeatDelay:a,from:u,...l}){return!!Object.keys(l).length}(t)||(t={...t,...je(n,e.to)}),{...e,...Ne(t)}}function Le(t,e,n,r,o){const s=qe(r,t)||{};let i=void 0!==s.from?s.from:e.get();const a=Ee(t,n);"none"===i&&a&&"string"==typeof n?i=De(t,n):He(i)&&"string"==typeof n?i=ze(n):!Array.isArray(n)&&He(n)&&"string"==typeof i&&(n=ze(i));return Ee(t,i)&&a&&!1!==s.type?function(){const r={from:i,to:n,velocity:e.getVelocity(),onComplete:o,onUpdate:t=>e.set(t)};return"inertia"===s.type||"decay"===s.type?function({from:t=0,velocity:e=0,min:n,max:r,power:o=.8,timeConstant:s=750,bounceStiffness:i=500,bounceDamping:a=10,restDelta:u=1,modifyTarget:l,driver:c,onUpdate:p,onComplete:d,onStop:h}){let f;function m(t){return void 0!==n&&t<n||void 0!==r&&t>r}function v(t){return void 0===n?r:void 0===r||Math.abs(n-t)<Math.abs(r-t)?n:r}function g(t){null==f||f.stop(),f=ve(Object.assign(Object.assign({},t),{driver:c,onUpdate:e=>{var n;null==p||p(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:d,onStop:h}))}function y(t){g(Object.assign({type:"spring",stiffness:i,damping:a,restDelta:u},t))}if(m(t))y({from:t,velocity:e,to:v(t)});else{let r=o*e+t;void 0!==l&&(r=l(r));const i=v(r),a=i===n?-1:1;let c,p;const d=t=>{c=p,p=t,e=ge(t-c,he().delta),(1===a&&t>i||-1===a&&t<i)&&y({from:t,to:i,velocity:e})};g({type:"decay",from:t,velocity:e,timeConstant:s,power:o,restDelta:u,modifyTarget:l,onUpdate:m(r)?d:void 0})}return{stop:()=>null==f?void 0:f.stop()}}({...r,...s}):ve({...Ue(s,r,t),onUpdate:t=>{r.onUpdate(t),s.onUpdate&&s.onUpdate(t)},onComplete:()=>{r.onComplete(),s.onComplete&&s.onComplete()}})}:function(){const t=g(n);return e.set(t),o(),s.onUpdate&&s.onUpdate(t),s.onComplete&&s.onComplete(),{stop:()=>{}}}}function He(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function ze(t){return"number"==typeof t?0:De("",t)}function qe(t,e){return t[e]||t.default||t}function We(t,e,n,r={}){return Be&&(r={type:!1}),e.start(o=>{let s;const i=Le(t,e,n,r,o),a=function(t,e){var n,r;return null!==(r=null!==(n=(qe(t,e)||{}).delay)&&void 0!==n?n:t.delay)&&void 0!==r?r:0}(r,t),u=()=>s=i();let l;return a?l=function(t,e){const n=performance.now(),r=({timestamp:o})=>{const s=o-n;s>=e&&(le.read(r),t(s-e))};return ue.read(r,!0),()=>le.read(r)}(u,Me(a)):u(),()=>{l&&l(),s&&s.stop()}})}const $e=t=>/^0[^.\s]+$/.test(t);class Ke{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 r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](t,e,n);else for(let o=0;o<r;o++){const r=this.subscriptions[o];r&&r(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}class Ye{constructor(t){var e;this.version="7.6.9",this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new Ke,this.velocityUpdateSubscribers=new Ke,this.renderSubscribers=new Ke,this.canTrackVelocity=!1,this.updateAndNotify=(t,e=!0)=>{this.prev=this.current,this.current=t;const{delta:n,timestamp:r}=he();this.lastUpdated!==r&&(this.timeDelta=n,this.lastUpdated=r,ue.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.updateSubscribers.notify(this.current),this.velocityUpdateSubscribers.getSize()&&this.velocityUpdateSubscribers.notify(this.getVelocity()),e&&this.renderSubscribers.notify(this.current)},this.scheduleVelocityCheck=()=>ue.postRender(this.velocityCheck),this.velocityCheck=({timestamp:t})=>{t!==this.lastUpdated&&(this.prev=this.current,this.velocityUpdateSubscribers.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e)))}onChange(t){return this.updateSubscribers.add(t)}clearListeners(){this.updateSubscribers.clear()}onRenderRequest(t){return t(this.get()),this.renderSubscribers.add(t)}attach(t){this.passiveEffect=t}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?ge(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.stopAnimation=t(e)}).then(()=>this.clearAnimation())}stop(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()}}function Xe(t){return new Ye(t)}const Ge=t=>e=>e.test(t),Ze=[p,y,u,b,w,V,{test:t=>"auto"===t,parse:t=>t}],Je=t=>Ze.find(Ge(t)),_e=[...Ze,Z,et],Qe=t=>_e.find(Ge(t));function tn(t,e,n){const r=t.getProps();return A(r,e,void 0!==n?n:r.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 en(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Xe(n))}function nn(t,e){if(!e)return;return(e[t]||e.default||e).from}function rn(t){return Boolean(S(t)&&t.add)}function on(t,e,n={}){var r;const o=tn(t,e,n.custom);let{transition:s=t.getDefaultTransition()||{}}=o||{};n.transitionOverride&&(s=n.transitionOverride);const i=o?()=>sn(t,o,n):()=>Promise.resolve(),a=(null===(r=t.variantChildren)||void 0===r?void 0:r.size)?(r=0)=>{const{delayChildren:o=0,staggerChildren:i,staggerDirection:a}=s;return function(t,e,n=0,r=0,o=1,s){const i=[],a=(t.variantChildren.size-1)*r,u=1===o?(t=0)=>t*r:(t=0)=>a-t*r;return Array.from(t.variantChildren).sort(an).forEach((t,r)=>{i.push(on(t,e,{...s,delay:n+u(r)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(i)}(t,e,o+r,i,a,n)}:()=>Promise.resolve(),{when:u}=s;if(u){const[t,e]="beforeChildren"===u?[i,a]:[a,i];return t().then(e)}return Promise.all([i(),a(n.delay)])}function sn(t,e,{delay:n=0,transitionOverride:r,type:o}={}){var s;let{transition:i=t.getDefaultTransition(),transitionEnd:a,...u}=t.makeTargetAnimatable(e);const l=t.getValue("willChange");r&&(i=r);const c=[],p=o&&(null===(s=t.animationState)||void 0===s?void 0:s.getState()[o]);for(const e in u){const r=t.getValue(e),o=u[e];if(!r||void 0===o||p&&un(p,e))continue;let s={delay:n,...i};t.shouldReduceMotion&&M.has(e)&&(s={...s,type:!1,delay:0});let a=We(e,r,o,s);rn(l)&&(l.add(e),a=a.then(()=>l.remove(e))),c.push(a)}return Promise.all(c).then(()=>{a&&function(t,e){const n=tn(t,e);let{transitionEnd:r={},transition:o={},...s}=n?t.makeTargetAnimatable(n,!1):{};s={...s,...r};for(const e in s){en(t,e,g(s[e]))}}(t,a)})}function an(t,e){return t.sortNodePosition(e)}function un({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,r}var ln;!function(t){t.Animate="animate",t.Hover="whileHover",t.Tap="whileTap",t.Drag="whileDrag",t.Focus="whileFocus",t.InView="whileInView",t.Exit="exit"}(ln||(ln={}));const cn=[ln.Animate,ln.InView,ln.Focus,ln.Hover,ln.Tap,ln.Drag,ln.Exit],pn=[...cn].reverse(),dn=cn.length;function hn(t){return e=>Promise.all(e.map(({animation:e,options:n})=>function(t,e,n={}){let r;if(t.notify("AnimationStart",e),Array.isArray(e)){const o=e.map(e=>on(t,e,n));r=Promise.all(o)}else if("string"==typeof e)r=on(t,e,n);else{const o="function"==typeof e?tn(t,e,n.custom):e;r=sn(t,o,n)}return r.then(()=>t.notify("AnimationComplete",e))}(t,e,n)))}function fn(t){let e=hn(t);const n={[ln.Animate]:vn(!0),[ln.InView]:vn(),[ln.Hover]:vn(),[ln.Tap]:vn(),[ln.Drag]:vn(),[ln.Focus]:vn(),[ln.Exit]:vn()};let r=!0;const o=(e,n)=>{const r=tn(t,n);if(r){const{transition:t,transitionEnd:n,...o}=r;e={...e,...o,...n}}return e};function s(s,i){var a;const u=t.getProps(),l=t.getVariantContext(!0)||{},c=[],p=new Set;let d={},h=1/0;for(let e=0;e<dn;e++){const f=pn[e],v=n[f],g=null!==(a=u[f])&&void 0!==a?a:l[f],y=C(g),b=f===i?v.isActive:null;!1===b&&(h=e);let w=g===l[f]&&g!==u[f]&&y;if(w&&r&&t.manuallyAnimateOnMount&&(w=!1),v.protectedKeys={...d},!v.isActive&&null===b||!g&&!v.prevProp||x(g)||"boolean"==typeof g)continue;const V=mn(v.prevProp,g);let A=V||f===i&&v.isActive&&!w&&y||e>h&&y;const S=Array.isArray(g)?g:[g];let M=S.reduce(o,{});!1===b&&(M={});const{prevResolvedValues:E={}}=v,T={...E,...M},O=t=>{A=!0,p.delete(t),v.needsAnimating[t]=!0};for(const t in T){const e=M[t],n=E[t];d.hasOwnProperty(t)||(e!==n?m(e)&&m(n)?!it(e,n)||V?O(t):v.protectedKeys[t]=!0:void 0!==e?O(t):p.add(t):void 0!==e&&p.has(t)?O(t):v.protectedKeys[t]=!0)}v.prevProp=g,v.prevResolvedValues=M,v.isActive&&(d={...d,...M}),r&&t.blockInitialAnimation&&(A=!1),A&&!w&&c.push(...S.map(t=>({animation:t,options:{type:f,...s}})))}if(p.size){const e={};p.forEach(n=>{const r=t.getBaseTarget(n);void 0!==r&&(e[n]=r)}),c.push({animation:e})}let f=Boolean(c.length);return r&&!1===u.initial&&!t.manuallyAnimateOnMount&&(f=!1),r=!1,f?e(c):Promise.resolve()}return{animateChanges:s,setActive:function(e,r,o){var i;if(n[e].isActive===r)return Promise.resolve();null===(i=t.variantChildren)||void 0===i||i.forEach(t=>{var n;return null===(n=t.animationState)||void 0===n?void 0:n.setActive(e,r)}),n[e].isActive=r;const a=s(o,e);for(const t in n)n[t].protectedKeys={};return a},setAnimateFunction:function(n){e=n(t)},getState:()=>n}}function mn(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!it(e,t)}function vn(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}const gn=t=>e=>(t(e),null),yn={animation:gn(({visualElement:t,animate:e})=>{t.animationState||(t.animationState=fn(t)),x(e)&&n(()=>e.subscribe(t),[e])}),exit:gn(r=>{const{custom:o,visualElement:s}=r,[i,a]=function(){const r=t(f);if(null===r)return[!0,null];const{isPresent:o,onExitComplete:s,register:i}=r,a=e();return n(()=>i(a),[]),!o&&s?[!1,()=>s&&s(a)]:[!0]}(),u=t(f);n(()=>{s.isPresent=i;const t=s.animationState&&s.animationState.setActive(ln.Exit,!i,{custom:u&&u.custom||o});t&&!i&&t.then(a)},[i])})};function bn(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n)}function wn(t,e,r,o){n(()=>{const n=t.current;if(r&&n)return bn(n,e,r,o)},[t,e,r,o])}function Vn(t){return!!t.touches}const An={pageX:0,pageY:0};function Sn(t,e="page"){const n=t.touches[0]||t.changedTouches[0]||An;return{x:n[e+"X"],y:n[e+"Y"]}}function Mn(t,e="page"){return{x:t[e+"X"],y:t[e+"Y"]}}const xn=(t,e=!1)=>{const n=e=>t(e,function(t,e="page"){return{point:Vn(t)?Sn(t,e):Mn(t,e)}}(e));return e?(r=n,t=>{const e=t instanceof MouseEvent;(!e||e&&0===t.button)&&r(t)}):n;var r},Cn={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},En={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function Tn(t){return E&&null===window.onpointerdown?t:E&&null===window.ontouchstart?En[t]:E&&null===window.onmousedown?Cn[t]:t}function On(t,e,n,r){return bn(t,Tn(e),xn(n,"pointerdown"===e),r)}function Pn(t,e,n,r){return wn(t,Tn(e),n&&xn(n,"pointerdown"===e),r)}function Fn(t){let e=null;return()=>{const n=()=>{e=null};return null===e&&(e=t,n)}}const In=Fn("dragHorizontal"),jn=Fn("dragVertical");function kn(){const t=function(t){let e=!1;if("y"===t)e=jn();else if("x"===t)e=In();else{const t=In(),n=jn();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}(!0);return!t||(t(),!1)}function Rn(t,e,n){return(r,o)=>{(function(t){return"undefined"!=typeof PointerEvent&&t instanceof PointerEvent?!("mouse"!==t.pointerType):t instanceof MouseEvent})(r)&&!kn()&&(t.animationState&&t.animationState.setActive(ln.Hover,e),n&&n(r,o))}}const Dn=(t,e)=>!!e&&(t===e||Dn(t,e.parentElement));const Bn=("undefined"==typeof process||process.env,"production"),Nn=new Set;const Un=new WeakMap,Ln=new WeakMap,Hn=t=>{const e=Un.get(t.target);e&&e(t)},zn=t=>{t.forEach(Hn)};function qn(t,e,n){const r=function({root:t,...e}){const n=t||document;Ln.has(n)||Ln.set(n,{});const r=Ln.get(n),o=JSON.stringify(e);return r[o]||(r[o]=new IntersectionObserver(zn,{root:t,...e})),r[o]}(e);return Un.set(t,n),r.observe(t),()=>{Un.delete(t),r.unobserve(t)}}const Wn={some:0,all:1};function $n(t,e,r,{root:o,margin:s,amount:i="some",once:a}){n(()=>{if(!t||!r.current)return;const n={root:null==o?void 0:o.current,rootMargin:s,threshold:"number"==typeof i?i:Wn[i]};return qn(r.current,n,t=>{const{isIntersecting:n}=t;if(e.isInView===n)return;if(e.isInView=n,a&&!n&&e.hasEnteredView)return;n&&(e.hasEnteredView=!0),r.animationState&&r.animationState.setActive(ln.InView,n);const o=r.getProps(),s=n?o.onViewportEnter:o.onViewportLeave;s&&s(t)})},[t,o,s,i])}function Kn(t,e,r,{fallback:o=!0}){n(()=>{var n,s;t&&o&&("production"!==Bn&&(n="IntersectionObserver not available on this device. whileInView animations will trigger on mount.",!1||Nn.has(n)||(console.warn(n),s&&console.warn(s),Nn.add(n))),requestAnimationFrame(()=>{e.hasEnteredView=!0;const{onViewportEnter:t}=r.getProps();t&&t(null),r.animationState&&r.animationState.setActive(ln.InView,!0)}))},[t])}const Yn={inView:gn((function({visualElement:t,whileInView:e,onViewportEnter:n,onViewportLeave:o,viewport:s={}}){const i=r({hasEnteredView:!1,isInView:!1});let a=Boolean(e||n||o);s.once&&i.current.hasEnteredView&&(a=!1),("undefined"==typeof IntersectionObserver?Kn:$n)(a,i.current,t,s)})),tap:gn((function({onTap:t,onTapStart:e,onTapCancel:o,whileTap:s,visualElement:i}){const a=t||e||o||s,u=r(!1),l=r(null),c={passive:!(e||t||o||m)};function p(){l.current&&l.current(),l.current=null}function d(){return p(),u.current=!1,i.animationState&&i.animationState.setActive(ln.Tap,!1),!kn()}function h(e,n){d()&&(Dn(i.current,e.target)?t&&t(e,n):o&&o(e,n))}function f(t,e){d()&&o&&o(t,e)}function m(t,n){p(),u.current||(u.current=!0,l.current=xt(On(window,"pointerup",h,c),On(window,"pointercancel",f,c)),i.animationState&&i.animationState.setActive(ln.Tap,!0),e&&e(t,n))}var v;Pn(i,"pointerdown",a?m:void 0,c),v=p,n(()=>()=>v(),[])})),focus:gn((function({whileFocus:t,visualElement:e}){const{animationState:n}=e;wn(e,"focus",t?()=>{n&&n.setActive(ln.Focus,!0)}:void 0),wn(e,"blur",t?()=>{n&&n.setActive(ln.Focus,!1)}:void 0)})),hover:gn((function({onHoverStart:t,onHoverEnd:e,whileHover:n,visualElement:r}){Pn(r,"pointerenter",t||n?Rn(r,!0,t):void 0,{passive:!t}),Pn(r,"pointerleave",e||n?Rn(r,!1,e):void 0,{passive:!e})}))};function Xn(t){return"string"==typeof t&&t.startsWith("var(--")}const Gn=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function Zn(t,e,n=1){const[r,o]=function(t){const e=Gn.exec(t);if(!e)return[,];const[,n,r]=e;return[n,r]}(t);if(!r)return;const s=window.getComputedStyle(e).getPropertyValue(r);return s?s.trim():Xn(o)?Zn(o,e,n+1):o}const Jn=new Set(["width","height","top","left","right","bottom","x","y"]),_n=t=>Jn.has(t),Qn=(t,e)=>{t.set(e,!1),t.set(e)},tr=t=>t===p||t===y;var er;!function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"}(er||(er={}));const nr=(t,e)=>parseFloat(t.split(", ")[e]),rr=(t,e)=>(n,{transform:r})=>{if("none"===r||!r)return 0;const o=r.match(/^matrix3d\((.+)\)$/);if(o)return nr(o[1],e);{const e=r.match(/^matrix\((.+)\)$/);return e?nr(e[1],t):0}},or=new Set(["x","y","z"]),sr=T.filter(t=>!or.has(t));const ir={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:rr(4,13),y:rr(5,14)},ar=(t,e,n={},r={})=>{e={...e},r={...r};const o=Object.keys(e).filter(_n);let s=[],i=!1;const a=[];if(o.forEach(o=>{const u=t.getValue(o);if(!t.hasValue(o))return;let l=n[o],c=Je(l);const p=e[o];let d;if(m(p)){const t=p.length,e=null===p[0]?1:0;l=p[e],c=Je(l);for(let n=e;n<t;n++)d?Je(p[n]):d=Je(p[n])}else d=Je(p);if(c!==d)if(tr(c)&&tr(d)){const t=u.get();"string"==typeof t&&u.set(parseFloat(t)),"string"==typeof p?e[o]=parseFloat(p):Array.isArray(p)&&d===y&&(e[o]=p.map(parseFloat))}else(null==c?void 0:c.transform)&&(null==d?void 0:d.transform)&&(0===l||0===p)?0===l?u.set(d.transform(l)):e[o]=c.transform(p):(i||(s=function(t){const e=[];return sr.forEach(n=>{const r=t.getValue(n);void 0!==r&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e.length&&t.render(),e}(t),i=!0),a.push(o),r[o]=void 0!==r[o]?r[o]:e[o],Qn(u,p))}),a.length){const n=a.indexOf("height")>=0?window.pageYOffset:null,o=((t,e,n)=>{const r=e.measureViewportBox(),o=e.current,s=getComputedStyle(o),{display:i}=s,a={};"none"===i&&e.setStaticValue("display",t.display||"block"),n.forEach(t=>{a[t]=ir[t](r,s)}),e.render();const u=e.measureViewportBox();return n.forEach(n=>{const r=e.getValue(n);Qn(r,a[n]),t[n]=ir[n](u,s)}),t})(e,t,a);return s.length&&s.forEach(([e,n])=>{t.getValue(e).set(n)}),t.render(),E&&null!==n&&window.scrollTo({top:n}),{target:o,transitionEnd:r}}return{target:e,transitionEnd:r}};function ur(t,e,n,r){return(t=>Object.keys(t).some(_n))(e)?ar(t,e,n,r):{target:e,transitionEnd:r}}const lr=(t,e,n,r)=>{const o=function(t,{...e},n){const r=t.current;if(!(r instanceof Element))return{target:e,transitionEnd:n};n&&(n={...n}),t.values.forEach(t=>{const e=t.get();if(!Xn(e))return;const n=Zn(e,r);n&&t.set(n)});for(const t in e){const o=e[t];if(!Xn(o))continue;const s=Zn(o,r);s&&(e[t]=s,n&&void 0===n[t]&&(n[t]=o))}return{target:e,transitionEnd:n}}(t,e,r);return ur(t,e=o.target,n,r=o.transitionEnd)},cr={current:null},pr={current:!1};const dr=Object.keys(O),hr=dr.length,fr=["AnimationStart","AnimationComplete","Update","Unmount","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];const mr=["initial",...cn],vr=mr.length;class gr extends class{constructor({parent:t,props:e,reducedMotionConfig:n,visualState:r},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.isPresent=!0,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=()=>ue.render(this.render,!1,!0);const{latestValues:s,renderState:i}=r;this.latestValues=s,this.baseTarget={...s},this.initialValues=e.initial?{...s}:{},this.renderState=i,this.parent=t,this.props=e,this.depth=t?t.depth+1:0,this.reducedMotionConfig=n,this.options=o,this.isControllingVariants=P(e),this.isVariantNode=F(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:a,...u}=this.scrapeMotionValuesFromProps(e);for(const t in u){const e=u[t];void 0!==s[t]&&S(e)&&(e.set(s[t],!1),rn(a)&&a.add(t))}}scrapeMotionValuesFromProps(t){return{}}mount(t){var e;this.current=t,this.projection&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=null===(e=this.parent)||void 0===e?void 0:e.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),pr.current||function(){if(pr.current=!0,E)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>cr.current=t.matches;t.addListener(e),e()}else cr.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||cr.current),this.parent&&this.parent.children.add(this),this.setProps(this.props)}unmount(){var t,e,n;null===(t=this.projection)||void 0===t||t.unmount(),le.update(this.notifyUpdate),le.render(this.render),this.valueSubscriptions.forEach(t=>t()),null===(e=this.removeFromVariantTree)||void 0===e||e.call(this),null===(n=this.parent)||void 0===n||n.children.delete(this);for(const t in this.events)this.events[t].clear();this.current=null}bindToMotionValue(t,e){const n=M.has(t),r=e.onChange(e=>{this.latestValues[t]=e,this.props.onUpdate&&ue.update(this.notifyUpdate,!1,!0),n&&this.projection&&(this.projection.isProjectionDirty=!0)}),o=e.onRenderRequest(this.scheduleRender);this.valueSubscriptions.set(t,()=>{r(),o()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}loadFeatures(t,e,n,r,s,i){const a=[];for(let e=0;e<hr;e++){const n=dr[e],{isEnabled:r,Component:s}=O[n];r(t)&&s&&a.push(o(s,{key:n,...t,visualElement:this}))}if(!this.projection&&s){this.projection=new s(r,this.latestValues,this.parent&&this.parent.projection);const{layoutId:e,layout:n,drag:o,dragConstraints:a,layoutScroll:u}=t;this.projection.setOptions({layoutId:e,layout:n,alwaysMeasureLayout:Boolean(o)||a&&I(a),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:i,layoutScroll:u})}return a}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)}setProps(t){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.props=t;for(let e=0;e<fr.length;e++){const n=fr[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const r=t["on"+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=function(t,e,n){const{willChange:r}=e;for(const o in e){const s=e[o],i=n[o];if(S(s))t.addValue(o,s),rn(r)&&r.add(o);else if(S(i))t.addValue(o,Xe(s)),rn(r)&&r.remove(o);else if(i!==s)if(t.hasValue(o)){const e=t.getValue(o);!e.hasAnimated&&e.set(s)}else{const e=t.getStaticValue(o);t.addValue(o,Xe(void 0!==e?e:s))}}for(const r in n)void 0===e[r]&&t.removeValue(r);return e}(this,this.scrapeMotionValuesFromProps(t),this.prevMotionValues)}getProps(){return this.props}getVariant(t){var e;return null===(e=this.props.variants)||void 0===e?void 0:e[t]}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){var t;return this.isVariantNode?this:null===(t=this.parent)||void 0===t?void 0:t.getClosestVariantNode()}getVariantContext(t=!1){var e,n;if(t)return null===(e=this.parent)||void 0===e?void 0:e.getVariantContext();if(!this.isControllingVariants){const t=(null===(n=this.parent)||void 0===n?void 0:n.getVariantContext())||{};return void 0!==this.props.initial&&(t.initial=this.props.initial),t}const r={};for(let t=0;t<vr;t++){const e=mr[t],n=this.props[e];(C(n)||!1===n)&&(r[e]=n)}return r}addVariantChild(t){var e;const n=this.getClosestVariantNode();if(n)return null===(e=n.variantChildren)||void 0===e||e.add(t),()=>n.variantChildren.delete(t)}addValue(t,e){this.hasValue(t)&&this.removeValue(t),this.values.set(t,e),this.latestValues[t]=e.get(),this.bindToMotionValue(t,e)}removeValue(t){var e;this.values.delete(t),null===(e=this.valueSubscriptions.get(t))||void 0===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=Xe(e),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,r="string"==typeof n||"object"==typeof n?null===(e=A(this.props,n))||void 0===e?void 0:e[t]:void 0;if(n&&void 0!==r)return r;const o=this.getBaseTargetFromProps(this.props,t);return void 0===o||S(o)?void 0!==this.initialValues[t]&&void 0===r?void 0:this.baseTarget[t]:o}on(t,e){return this.events[t]||(this.events[t]=new Ke),this.events[t].add(e)}notify(t,...e){var n;null===(n=this.events[t])||void 0===n||n.notify(...e)}}{sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){var n;return null===(n=t.style)||void 0===n?void 0:n[e]}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:e,...n},{transformValues:r},o){let s=function(t,e,n){var r;const o={};for(const s in t){const t=nn(s,e);o[s]=void 0!==t?t:null===(r=n.getValue(s))||void 0===r?void 0:r.get()}return o}(n,t||{},this);if(r&&(e&&(e=r(e)),n&&(n=r(n)),s&&(s=r(s))),o){!function(t,e,n){var r,o;const s=Object.keys(e).filter(e=>!t.hasValue(e)),i=s.length;if(i)for(let a=0;a<i;a++){const i=s[a],u=e[i];let l=null;Array.isArray(u)&&(l=u[0]),null===l&&(l=null!==(o=null!==(r=n[i])&&void 0!==r?r:t.readValue(i))&&void 0!==o?o:e[i]),null!=l&&("string"==typeof l&&(/^\-?\d*\.?\d+$/.test(l)||$e(l))?l=parseFloat(l):!Qe(l)&&et.test(u)&&(l=De(i,u)),t.addValue(i,Xe(l)),void 0===n[i]&&(n[i]=l),null!==l&&t.setBaseTarget(i,l))}}(this,n,s);const t=lr(this,n,s,e);e=t.transitionEnd,n=t.target}return{transition:t,transitionEnd:e,...n}}}class yr extends gr{readValueFromInstance(t,e){if(M.has(e)){const t=Re(e);return t&&t.default||0}{const r=(n=t,window.getComputedStyle(n)),o=(j(e)?r.getPropertyValue(e):r[e])||0;return"string"==typeof o?o.trim():o}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return function(t,e){return function({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}(t.getBoundingClientRect(),e))}(t,e)}build(t,e,n,r){k(t,e,n,r.transformTemplate)}scrapeMotionValuesFromProps(t){return R(t)}renderInstance(t,e,n,r){D(t,e,n,r)}}class br extends gr{getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){var n;return M.has(e)?(null===(n=Re(e))||void 0===n?void 0:n.default)||0:(e=B.has(e)?e:N(e),t.getAttribute(e))}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}scrapeMotionValuesFromProps(t){return U(t)}build(t,e,n,r){L(t,e,n,r.transformTemplate)}renderInstance(t,e,n,r){H(t,e,n,r)}}const wr={renderer:(t,e)=>z(t)?new br(e,{enableHardwareAcceleration:!1}):new yr(e,{enableHardwareAcceleration:!0}),...yn,...Yn};export{wr as domAnimation};