framer-motion 6.5.0 → 7.0.1
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/README.md +14 -11
- package/dist/cjs/index.js +21 -27
- package/dist/es/components/AnimatePresence/PresenceChild.mjs +1 -2
- package/dist/es/components/AnimatePresence/use-presence.mjs +1 -2
- package/dist/es/context/MotionContext/create.mjs +1 -1
- package/dist/es/gestures/PanSession.mjs +1 -1
- package/dist/es/gestures/drag/VisualElementDragControls.mjs +2 -1
- package/dist/es/gestures/drag/utils/constraints.mjs +1 -1
- package/dist/es/projection/animation/mix-values.mjs +2 -2
- package/dist/es/projection/node/create-projection-node.mjs +1 -1
- package/dist/es/render/dom/utils/unit-conversion.mjs +1 -1
- package/dist/es/render/html/visual-element.mjs +1 -1
- package/dist/es/render/utils/motion-values.mjs +1 -1
- package/dist/es/utils/use-animation-frame.mjs +5 -7
- package/dist/es/value/index.mjs +1 -1
- package/dist/es/value/scroll/use-element-scroll.mjs +3 -0
- package/dist/es/value/scroll/use-viewport-scroll.mjs +3 -0
- package/dist/es/value/use-on-change.mjs +3 -3
- package/dist/framer-motion.dev.js +330 -182
- package/dist/framer-motion.js +1 -1
- package/dist/index.d.ts +23 -7
- package/dist/projection.dev.js +295 -118
- package/dist/size-rollup-dom-animation.js +1 -1
- package/dist/size-rollup-dom-max.js +1 -1
- package/dist/size-webpack-dom-animation.js +1 -1
- package/dist/size-webpack-dom-max.js +1 -2
- package/dist/size-webpack-m.js +1 -2
- package/dist/three-entry.d.ts +2 -2
- package/package.json +13 -18
- package/dist/es/utils/use-id.mjs +0 -15
- package/dist/size-webpack-dom-max.js.LICENSE.txt +0 -14
- package/dist/size-webpack-m.js.LICENSE.txt +0 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createContext as t,useRef as n,useContext as e,useEffect as r}from"react";var o=function(){return(o=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t}).apply(this,arguments)};function i(t,n){var e={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&n.indexOf(r)<0&&(e[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(e[r[o]]=t[r[o]])}return e}function a(t,n){var e="function"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var r,o,i=e.call(t),a=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(e=i.return)&&e.call(i)}finally{if(o)throw o.error}}return a}function u(t,n,e){if(e||2===arguments.length)for(var r,o=0,i=n.length;o<i;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return t.concat(r||Array.prototype.slice.call(n))}function s(t){return"object"==typeof t&&"function"==typeof t.start}var c=t(null);var l=0,f=function(){return l++},d=function(){return t=f,null===(e=n(null)).current&&(e.current=t()),e.current;var t,e};var p=function(t){return Array.isArray(t)};function v(t,n){if(!Array.isArray(n))return!1;var e=n.length;if(e!==t.length)return!1;for(var r=0;r<e;r++)if(n[r]!==t[r])return!1;return!0}const m=(t,n,e)=>Math.min(Math.max(e,t),n);function h({duration:t=800,bounce:n=.25,velocity:e=0,mass:r=1}){let o,i,a=1-n;a=m(.05,1,a),t=m(.01,10,t/1e3),a<1?(o=n=>{const r=n*a,o=r*t;return.001-(r-e)/g(n,a)*Math.exp(-o)},i=n=>{const r=n*a*t,i=r*e+e,u=Math.pow(a,2)*Math.pow(n,2)*t,s=Math.exp(-r),c=g(Math.pow(n,2),a);return(.001-o(n)>0?-1:1)*((i-u)*s)/c}):(o=n=>Math.exp(-n*t)*((n-e)*t+1)-.001,i=n=>Math.exp(-n*t)*(t*t*(e-n)));const u=function(t,n,e){let r=e;for(let e=1;e<12;e++)r-=t(r)/n(r);return r}(o,i,5/t);if(t*=1e3,isNaN(u))return{stiffness:100,damping:10,duration:t};{const n=Math.pow(u,2)*r;return{stiffness:n,damping:2*a*Math.sqrt(r*n),duration:t}}}function g(t,n){return t*Math.sqrt(1-n*n)}const y=["duration","bounce"],b=["stiffness","damping","mass"];function w(t,n){return n.some(n=>void 0!==t[n])}function A(t){var{from:n=0,to:e=1,restSpeed:r=2,restDelta:o}=t,a=i(t,["from","to","restSpeed","restDelta"]);const u={done:!1,value:n};let{stiffness:s,damping:c,mass:l,velocity:f,duration:d,isResolvedFromDuration:p}=function(t){let n=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},t);if(!w(t,b)&&w(t,y)){const e=h(t);n=Object.assign(Object.assign(Object.assign({},n),e),{velocity:0,mass:1}),n.isResolvedFromDuration=!0}return n}(a),v=V,m=V;function A(){const t=f?-f/1e3:0,r=e-n,i=c/(2*Math.sqrt(s*l)),a=Math.sqrt(s/l)/1e3;if(void 0===o&&(o=Math.min(Math.abs(e-n)/100,.4)),i<1){const n=g(a,i);v=o=>{const u=Math.exp(-i*a*o);return e-u*((t+i*a*r)/n*Math.sin(n*o)+r*Math.cos(n*o))},m=e=>{const o=Math.exp(-i*a*e);return i*a*o*(Math.sin(n*e)*(t+i*a*r)/n+r*Math.cos(n*e))-o*(Math.cos(n*e)*(t+i*a*r)-n*r*Math.sin(n*e))}}else if(1===i)v=n=>e-Math.exp(-a*n)*(r+(t+a*r)*n);else{const n=a*Math.sqrt(i*i-1);v=o=>{const u=Math.exp(-i*a*o),s=Math.min(n*o,300);return e-u*((t+i*a*r)*Math.sinh(s)+n*r*Math.cosh(s))/n}}}return A(),{next:t=>{const n=v(t);if(p)u.done=t>=d;else{const i=1e3*m(t),a=Math.abs(i)<=r,s=Math.abs(e-n)<=o;u.done=a&&s}return u.value=u.done?e:n,u},flipTarget:()=>{f=-f,[n,e]=[e,n],A()}}}A.needsInterpolation=(t,n)=>"string"==typeof t||"string"==typeof n;const V=t=>0,x=(t,n,e)=>{const r=n-t;return 0===r?1:(e-t)/r},O=(t,n,e)=>-e*t+e*n+t,S=(t,n)=>e=>Math.max(Math.min(e,n),t),M=t=>t%1?Number(t.toFixed(5)):t,T=/(-)?([\d]*\.?[\d])+/g,E=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))/gi,C=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))$/i;function P(t){return"string"==typeof t}const k={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},I=Object.assign(Object.assign({},k),{transform:S(0,1)}),F=Object.assign(Object.assign({},k),{default:1}),R=t=>({test:n=>P(n)&&n.endsWith(t)&&1===n.split(" ").length,parse:parseFloat,transform:n=>`${n}${t}`}),j=R("deg"),D=R("%"),B=R("px"),L=R("vh"),U=R("vw"),N=Object.assign(Object.assign({},D),{parse:t=>D.parse(t)/100,transform:t=>D.transform(100*t)}),Y=(t,n)=>e=>Boolean(P(e)&&C.test(e)&&e.startsWith(t)||n&&Object.prototype.hasOwnProperty.call(e,n)),z=(t,n,e)=>r=>{if(!P(r))return r;const[o,i,a,u]=r.match(T);return{[t]:parseFloat(o),[n]:parseFloat(i),[e]:parseFloat(a),alpha:void 0!==u?parseFloat(u):1}},X={test:Y("hsl","hue"),parse:z("hue","saturation","lightness"),transform:({hue:t,saturation:n,lightness:e,alpha:r=1})=>"hsla("+Math.round(t)+", "+D.transform(M(n))+", "+D.transform(M(e))+", "+M(I.transform(r))+")"},H=S(0,255),W=Object.assign(Object.assign({},k),{transform:t=>Math.round(H(t))}),Z={test:Y("rgb","red"),parse:z("red","green","blue"),transform:({red:t,green:n,blue:e,alpha:r=1})=>"rgba("+W.transform(t)+", "+W.transform(n)+", "+W.transform(e)+", "+M(I.transform(r))+")"};const $={test:Y("#"),parse:function(t){let n="",e="",r="",o="";return t.length>5?(n=t.substr(1,2),e=t.substr(3,2),r=t.substr(5,2),o=t.substr(7,2)):(n=t.substr(1,1),e=t.substr(2,1),r=t.substr(3,1),o=t.substr(4,1),n+=n,e+=e,r+=r,o+=o),{red:parseInt(n,16),green:parseInt(e,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}},transform:Z.transform},q={test:t=>Z.test(t)||$.test(t)||X.test(t),parse:t=>Z.test(t)?Z.parse(t):X.test(t)?X.parse(t):$.parse(t),transform:t=>P(t)?t:t.hasOwnProperty("red")?Z.transform(t):X.transform(t)};function K(t){"number"==typeof t&&(t=""+t);const n=[];let e=0;const r=t.match(E);r&&(e=r.length,t=t.replace(E,"${c}"),n.push(...r.map(q.parse)));const o=t.match(T);return o&&(t=t.replace(T,"${n}"),n.push(...o.map(k.parse))),{values:n,numColors:e,tokenised:t}}function G(t){return K(t).values}function J(t){const{values:n,numColors:e,tokenised:r}=K(t),o=n.length;return t=>{let n=r;for(let r=0;r<o;r++)n=n.replace(r<e?"${c}":"${n}",r<e?q.transform(t[r]):M(t[r]));return n}}const _=t=>"number"==typeof t?0:t;const Q={test:function(t){var n,e,r,o;return isNaN(t)&&P(t)&&(null!==(e=null===(n=t.match(T))||void 0===n?void 0:n.length)&&void 0!==e?e:0)+(null!==(o=null===(r=t.match(E))||void 0===r?void 0:r.length)&&void 0!==o?o:0)>0},parse:G,createTransformer:J,getAnimatableNone:function(t){const n=G(t);return J(t)(n.map(_))}},tt=new Set(["brightness","contrast","saturate","opacity"]);function nt(t){let[n,e]=t.slice(0,-1).split("(");if("drop-shadow"===n)return t;const[r]=e.match(T)||[];if(!r)return t;const o=e.replace(r,"");let i=tt.has(n)?1:0;return r!==e&&(i*=100),n+"("+i+o+")"}const et=/([a-z-]*)\(.*?\)/g,rt=Object.assign(Object.assign({},Q),{getAnimatableNone:t=>{const n=t.match(et);return n?n.map(nt).join(" "):t}});function ot(t,n,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?t+6*(n-t)*e:e<.5?n:e<2/3?t+(n-t)*(2/3-e)*6:t}function it({hue:t,saturation:n,lightness:e,alpha:r}){t/=360,e/=100;let o=0,i=0,a=0;if(n/=100){const r=e<.5?e*(1+n):e+n-e*n,u=2*e-r;o=ot(u,r,t+1/3),i=ot(u,r,t),a=ot(u,r,t-1/3)}else o=i=a=e;return{red:Math.round(255*o),green:Math.round(255*i),blue:Math.round(255*a),alpha:r}}const at=(t,n,e)=>{const r=t*t,o=n*n;return Math.sqrt(Math.max(0,e*(o-r)+r))},ut=[$,Z,X],st=t=>ut.find(n=>n.test(t)),ct=(t,n)=>{let e=st(t),r=st(n),o=e.parse(t),i=r.parse(n);e===X&&(o=it(o),e=Z),r===X&&(i=it(i),r=Z);const a=Object.assign({},o);return t=>{for(const n in a)"alpha"!==n&&(a[n]=at(o[n],i[n],t));return a.alpha=O(o.alpha,i.alpha,t),e.transform(a)}},lt=(t,n)=>e=>n(t(e)),ft=(...t)=>t.reduce(lt);function dt(t,n){return"number"==typeof t?e=>O(t,n,e):q.test(t)?ct(t,n):ht(t,n)}const pt=(t,n)=>{const e=[...t],r=e.length,o=t.map((t,e)=>dt(t,n[e]));return t=>{for(let n=0;n<r;n++)e[n]=o[n](t);return e}},vt=(t,n)=>{const e=Object.assign(Object.assign({},t),n),r={};for(const o in e)void 0!==t[o]&&void 0!==n[o]&&(r[o]=dt(t[o],n[o]));return t=>{for(const n in r)e[n]=r[n](t);return e}};function mt(t){const n=Q.parse(t),e=n.length;let r=0,o=0,i=0;for(let t=0;t<e;t++)r||"number"==typeof n[t]?r++:void 0!==n[t].hue?i++:o++;return{parsed:n,numNumbers:r,numRGB:o,numHSL:i}}const ht=(t,n)=>{const e=Q.createTransformer(n),r=mt(t),o=mt(n);return r.numHSL===o.numHSL&&r.numRGB===o.numRGB&&r.numNumbers>=o.numNumbers?ft(pt(r.parsed,o.parsed),e):e=>""+(e>0?n:t)},gt=(t,n)=>e=>O(t,n,e);function yt(t,n,e){const r=[],o=e||("number"==typeof(i=t[0])?gt:"string"==typeof i?q.test(i)?ct:ht:Array.isArray(i)?pt:"object"==typeof i?vt:void 0);var i;const a=t.length-1;for(let e=0;e<a;e++){let i=o(t[e],t[e+1]);if(n){const t=Array.isArray(n)?n[e]:n;i=ft(t,i)}r.push(i)}return r}function bt(t,n,{clamp:e=!0,ease:r,mixer:o}={}){const i=t.length;n.length,!r||!Array.isArray(r)||r.length,t[0]>t[i-1]&&(t=[].concat(t),n=[].concat(n),t.reverse(),n.reverse());const a=yt(n,r,o),u=2===i?function([t,n],[e]){return r=>e(x(t,n,r))}(t,a):function(t,n){const e=t.length,r=e-1;return o=>{let i=0,a=!1;if(o<=t[0]?a=!0:o>=t[r]&&(i=r-1,a=!0),!a){let n=1;for(;n<e&&!(t[n]>o||n===r);n++);i=n-1}const u=x(t[i],t[i+1],o);return n[i](u)}}(t,a);return e?n=>u(m(t[0],t[i-1],n)):u}const wt=t=>n=>1-t(1-n),At=t=>n=>n<=.5?t(2*n)/2:(2-t(2*(1-n)))/2,Vt=t=>n=>n*n*((t+1)*n-t),xt=t=>t,Ot=(St=2,t=>Math.pow(t,St));var St;const Mt=wt(Ot),Tt=At(Ot),Et=t=>1-Math.sin(Math.acos(t)),Ct=wt(Et),Pt=At(Ct),kt=Vt(1.525),It=wt(kt),Ft=At(kt),Rt=(t=>{const n=Vt(t);return t=>(t*=2)<1?.5*n(t):.5*(2-Math.pow(2,-10*(t-1)))})(1.525),jt=t=>{if(1===t||0===t)return t;const n=t*t;return t<4/11?7.5625*n:t<8/11?9.075*n-9.9*t+3.4:t<.9?4356/361*n-35442/1805*t+16061/1805:10.8*t*t-20.52*t+10.72},Dt=wt(jt);function Bt(t,n){return t.map(()=>n||Tt).splice(0,t.length-1)}function Lt({from:t=0,to:n=1,ease:e,offset:r,duration:o=300}){const i={done:!1,value:t},a=Array.isArray(n)?n:[t,n],u=function(t,n){return t.map(t=>t*n)}(r&&r.length===a.length?r:function(t){const n=t.length;return t.map((t,e)=>0!==e?e/(n-1):0)}(a),o);function s(){return bt(u,a,{ease:Array.isArray(e)?e:Bt(a,e)})}let c=s();return{next:t=>(i.value=c(t),i.done=t>=o,i),flipTarget:()=>{a.reverse(),c=s()}}}const Ut={keyframes:Lt,spring:A,decay:function({velocity:t=0,from:n=0,power:e=.8,timeConstant:r=350,restDelta:o=.5,modifyTarget:i}){const a={done:!1,value:n};let u=e*t;const s=n+u,c=void 0===i?s:i(s);return c!==s&&(u=c-n),{next:t=>{const n=-u*Math.exp(-t/r);return a.done=!(n>o||n<-o),a.value=a.done?c:c+n,a},flipTarget:()=>{}}}};const Nt="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),Yt="undefined"!=typeof window?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(Nt()),1/60*1e3);let zt=!0,Xt=!1,Ht=!1;const Wt={delta:0,timestamp:0},Zt=["read","update","preRender","render","postRender"],$t=Zt.reduce((t,n)=>(t[n]=function(t){let n=[],e=[],r=0,o=!1,i=!1;const a=new WeakSet,u={schedule:(t,i=!1,u=!1)=>{const s=u&&o,c=s?n:e;return i&&a.add(t),-1===c.indexOf(t)&&(c.push(t),s&&o&&(r=n.length)),t},cancel:t=>{const n=e.indexOf(t);-1!==n&&e.splice(n,1),a.delete(t)},process:s=>{if(o)i=!0;else{if(o=!0,[n,e]=[e,n],e.length=0,r=n.length,r)for(let e=0;e<r;e++){const r=n[e];r(s),a.has(r)&&(u.schedule(r),t())}o=!1,i&&(i=!1,u.process(s))}}};return u}(()=>Xt=!0),t),{}),qt=Zt.reduce((t,n)=>{const e=$t[n];return t[n]=(t,n=!1,r=!1)=>(Xt||_t(),e.schedule(t,n,r)),t},{}),Kt=Zt.reduce((t,n)=>(t[n]=$t[n].cancel,t),{});Zt.reduce((t,n)=>(t[n]=()=>$t[n].process(Wt),t),{});const Gt=t=>$t[t].process(Wt),Jt=t=>{Xt=!1,Wt.delta=zt?1/60*1e3:Math.max(Math.min(t-Wt.timestamp,40),1),Wt.timestamp=t,Ht=!0,Zt.forEach(Gt),Ht=!1,Xt&&(zt=!1,Yt(Jt))},_t=()=>{Xt=!0,zt=!0,Ht||Yt(Jt)},Qt=()=>Wt;function tn(t,n,e=0){return t-n-e}const nn=t=>{const n=({delta:n})=>t(n);return{start:()=>qt.update(n,!0),stop:()=>Kt.update(n)}};function en(t){var n,e,{from:r,autoplay:o=!0,driver:a=nn,elapsed:u=0,repeat:s=0,repeatType:c="loop",repeatDelay:l=0,onPlay:f,onStop:d,onComplete:p,onRepeat:v,onUpdate:m}=t,h=i(t,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let g,y,b,{to:w}=h,V=0,x=h.duration,O=!1,S=!0;const M=function(t){if(Array.isArray(t.to))return Lt;if(Ut[t.type])return Ut[t.type];const n=new Set(Object.keys(t));return n.has("ease")||n.has("duration")&&!n.has("dampingRatio")?Lt:n.has("dampingRatio")||n.has("stiffness")||n.has("mass")||n.has("damping")||n.has("restSpeed")||n.has("restDelta")?A:Lt}(h);(null===(e=(n=M).needsInterpolation)||void 0===e?void 0:e.call(n,r,w))&&(b=bt([0,100],[r,w],{clamp:!1}),r=0,w=100);const T=M(Object.assign(Object.assign({},h),{from:r,to:w}));function E(){V++,"reverse"===c?(S=V%2==0,u=function(t,n,e=0,r=!0){return r?tn(n+-t,n,e):n-(t-n)+e}(u,x,l,S)):(u=tn(u,x,l),"mirror"===c&&T.flipTarget()),O=!1,v&&v()}function C(t){if(S||(t=-t),u+=t,!O){const t=T.next(Math.max(0,u));y=t.value,b&&(y=b(y)),O=S?t.done:u<=0}null==m||m(y),O&&(0===V&&(null!=x||(x=u)),V<s?function(t,n,e,r){return r?t>=n+e:t<=-e}(u,x,l,S)&&E():(g.stop(),p&&p()))}return o&&(null==f||f(),g=a(C),g.start()),{stop:()=>{null==d||d(),g.stop()}}}function rn(t,n){return n?t*(1e3/n):0}const on=(t,n)=>1-3*n+3*t,an=(t,n)=>3*n-6*t,un=t=>3*t,sn=(t,n,e)=>((on(n,e)*t+an(n,e))*t+un(n))*t,cn=(t,n,e)=>3*on(n,e)*t*t+2*an(n,e)*t+un(n);function ln(t,n,e,r){if(t===n&&e===r)return xt;const o=new Float32Array(11);for(let n=0;n<11;++n)o[n]=sn(.1*n,t,e);function i(n){let r=0,i=1;for(;10!==i&&o[i]<=n;++i)r+=.1;--i;const a=r+.1*((n-o[i])/(o[i+1]-o[i])),u=cn(a,t,e);return u>=.001?function(t,n,e,r){for(let o=0;o<8;++o){const o=cn(n,e,r);if(0===o)return n;n-=(sn(n,e,r)-t)/o}return n}(n,a,t,e):0===u?a:function(t,n,e,r,o){let i,a,u=0;do{a=n+(e-n)/2,i=sn(a,r,o)-t,i>0?e=a:n=a}while(Math.abs(i)>1e-7&&++u<10);return a}(n,r,r+.1,t,e)}return t=>0===t||1===t?t:sn(i(t),n,r)}var fn=function(t){return 1e3*t},dn={linear:xt,easeIn:Ot,easeInOut:Tt,easeOut:Mt,circIn:Et,circInOut:Pt,circOut:Ct,backIn:kt,backInOut:Ft,backOut:It,anticipate:Rt,bounceIn:Dt,bounceInOut:t=>t<.5?.5*(1-jt(1-2*t)):.5*jt(2*t-1)+.5,bounceOut:jt},pn=function(t){if(Array.isArray(t)){t.length;var n=a(t,4);return ln(n[0],n[1],n[2],n[3])}return"string"==typeof t?dn[t]:t},vn=function(t,n){return"zIndex"!==t&&(!("number"!=typeof n&&!Array.isArray(n))||!("string"!=typeof n||!Q.test(n)||n.startsWith("url(")))},mn=function(){return{type:"spring",stiffness:500,damping:25,restSpeed:10}},hn=function(t){return{type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restSpeed:10}},gn=function(){return{type:"keyframes",ease:"linear",duration:.3}},yn=function(t){return{type:"keyframes",duration:.8,values:t}},bn={x:mn,y:mn,z:mn,rotate:mn,rotateX:mn,rotateY:mn,rotateZ:mn,scaleX:hn,scaleY:hn,scale:hn,opacity:gn,backgroundColor:gn,color:gn,default:hn},wn=o(o({},k),{transform:Math.round}),An={borderWidth:B,borderTopWidth:B,borderRightWidth:B,borderBottomWidth:B,borderLeftWidth:B,borderRadius:B,radius:B,borderTopLeftRadius:B,borderTopRightRadius:B,borderBottomRightRadius:B,borderBottomLeftRadius:B,width:B,maxWidth:B,height:B,maxHeight:B,size:B,top:B,right:B,bottom:B,left:B,padding:B,paddingTop:B,paddingRight:B,paddingBottom:B,paddingLeft:B,margin:B,marginTop:B,marginRight:B,marginBottom:B,marginLeft:B,rotate:j,rotateX:j,rotateY:j,rotateZ:j,scale:F,scaleX:F,scaleY:F,scaleZ:F,skew:j,skewX:j,skewY:j,distance:B,translateX:B,translateY:B,translateZ:B,x:B,y:B,z:B,perspective:B,transformPerspective:B,opacity:I,originX:N,originY:N,originZ:B,zIndex:wn,fillOpacity:I,strokeOpacity:I,numOctaves:wn},Vn=o(o({},An),{color:q,backgroundColor:q,outlineColor:q,fill:q,stroke:q,borderColor:q,borderTopColor:q,borderRightColor:q,borderBottomColor:q,borderLeftColor:q,filter:rt,WebkitFilter:rt}),xn=function(t){return Vn[t]};function On(t,n){var e,r=xn(t);return r!==rt&&(r=Q),null===(e=r.getAnimatableNone)||void 0===e?void 0:e.call(r,n)}var Sn=!1,Mn=function(t){return p(t)?t[t.length-1]||0:t};function Tn(t){var n=t.ease,e=t.times,r=t.yoyo,a=t.flip,u=t.loop,s=i(t,["ease","times","yoyo","flip","loop"]),c=o({},s);return e&&(c.offset=e),s.duration&&(c.duration=fn(s.duration)),s.repeatDelay&&(c.repeatDelay=fn(s.repeatDelay)),n&&(c.ease=function(t){return Array.isArray(t)&&"number"!=typeof t[0]}(n)?n.map(pn):pn(n)),"tween"===s.type&&(c.type="keyframes"),(r||u||a)&&(r?c.repeatType="reverse":u?c.repeatType="loop":a&&(c.repeatType="mirror"),c.repeat=u||r||a||s.repeat),"spring"!==s.type&&(c.type="keyframes"),c}function En(t,n,e){var r,s,c,l;return Array.isArray(n.to)&&(null!==(r=t.duration)&&void 0!==r||(t.duration=.8)),function(t){Array.isArray(t.to)&&null===t.to[0]&&(t.to=u([],a(t.to),!1),t.to[0]=t.from)}(n),function(t){t.when,t.delay,t.delayChildren,t.staggerChildren,t.staggerDirection,t.repeat,t.repeatType,t.repeatDelay,t.from;var n=i(t,["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from"]);return!!Object.keys(n).length}(t)||(t=o(o({},t),(s=e,c=n.to,l=p(c)?yn:bn[s]||bn.default,o({to:c},l(c))))),o(o({},n),Tn(t))}function Cn(t,n,e,r,i){var a,u=In(r,t),s=null!==(a=u.from)&&void 0!==a?a:n.get(),c=vn(t,e);return"none"===s&&c&&"string"==typeof e?s=On(t,e):Pn(s)&&"string"==typeof e?s=kn(e):!Array.isArray(e)&&Pn(e)&&"string"==typeof s&&(e=kn(s)),vn(t,s)&&c&&!1!==u.type?function(){var r={from:s,to:e,velocity:n.getVelocity(),onComplete:i,onUpdate:function(t){return n.set(t)}};return"inertia"===u.type||"decay"===u.type?function({from:t=0,velocity:n=0,min:e,max:r,power:o=.8,timeConstant:i=750,bounceStiffness:a=500,bounceDamping:u=10,restDelta:s=1,modifyTarget:c,driver:l,onUpdate:f,onComplete:d,onStop:p}){let v;function m(t){return void 0!==e&&t<e||void 0!==r&&t>r}function h(t){return void 0===e?r:void 0===r||Math.abs(e-t)<Math.abs(r-t)?e:r}function g(t){null==v||v.stop(),v=en(Object.assign(Object.assign({},t),{driver:l,onUpdate:n=>{var e;null==f||f(n),null===(e=t.onUpdate)||void 0===e||e.call(t,n)},onComplete:d,onStop:p}))}function y(t){g(Object.assign({type:"spring",stiffness:a,damping:u,restDelta:s},t))}if(m(t))y({from:t,velocity:n,to:h(t)});else{let r=o*n+t;void 0!==c&&(r=c(r));const a=h(r),u=a===e?-1:1;let l,f;const d=t=>{l=f,f=t,n=rn(t-l,Qt().delta),(1===u&&t>a||-1===u&&t<a)&&y({from:t,to:a,velocity:n})};g({type:"decay",from:t,velocity:n,timeConstant:i,power:o,restDelta:s,modifyTarget:c,onUpdate:m(r)?d:void 0})}return{stop:()=>null==v?void 0:v.stop()}}(o(o({},r),u)):en(o(o({},En(u,r,t)),{onUpdate:function(t){var n;r.onUpdate(t),null===(n=u.onUpdate)||void 0===n||n.call(u,t)},onComplete:function(){var t;r.onComplete(),null===(t=u.onComplete)||void 0===t||t.call(u)}}))}:function(){var t,r,o=Mn(e);return n.set(o),i(),null===(t=null==u?void 0:u.onUpdate)||void 0===t||t.call(u,o),null===(r=null==u?void 0:u.onComplete)||void 0===r||r.call(u),{stop:function(){}}}}function Pn(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function kn(t){return"number"==typeof t?0:On("",t)}function In(t,n){return t[n]||t.default||t}function Fn(t,n,e,r){return void 0===r&&(r={}),Sn&&(r={type:!1}),n.start((function(o){var i,a,u=Cn(t,n,e,r,o),s=function(t,n){var e,r;return null!==(r=null!==(e=(In(t,n)||{}).delay)&&void 0!==e?e:t.delay)&&void 0!==r?r:0}(r,t),c=function(){return a=u()};return s?i=window.setTimeout(c,fn(s)):c(),function(){clearTimeout(i),null==a||a.stop()}}))}var Rn=function(t){return/^0[^.\s]+$/.test(t)};var jn=function(){function t(){this.subscriptions=[]}return t.prototype.add=function(t){var n,e,r=this;return n=this.subscriptions,e=t,-1===n.indexOf(e)&&n.push(e),function(){return function(t,n){var e=t.indexOf(n);e>-1&&t.splice(e,1)}(r.subscriptions,t)}},t.prototype.notify=function(t,n,e){var r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](t,n,e);else for(var o=0;o<r;o++){var i=this.subscriptions[o];i&&i(t,n,e)}},t.prototype.getSize=function(){return this.subscriptions.length},t.prototype.clear=function(){this.subscriptions.length=0},t}(),Dn=function(){function t(t){var n,e=this;this.version="6.5.0",this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new jn,this.velocityUpdateSubscribers=new jn,this.renderSubscribers=new jn,this.canTrackVelocity=!1,this.updateAndNotify=function(t,n){void 0===n&&(n=!0),e.prev=e.current,e.current=t;var r=Qt(),o=r.delta,i=r.timestamp;e.lastUpdated!==i&&(e.timeDelta=o,e.lastUpdated=i,qt.postRender(e.scheduleVelocityCheck)),e.prev!==e.current&&e.updateSubscribers.notify(e.current),e.velocityUpdateSubscribers.getSize()&&e.velocityUpdateSubscribers.notify(e.getVelocity()),n&&e.renderSubscribers.notify(e.current)},this.scheduleVelocityCheck=function(){return qt.postRender(e.velocityCheck)},this.velocityCheck=function(t){t.timestamp!==e.lastUpdated&&(e.prev=e.current,e.velocityUpdateSubscribers.notify(e.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(n=this.current,!isNaN(parseFloat(n)))}return t.prototype.onChange=function(t){return this.updateSubscribers.add(t)},t.prototype.clearListeners=function(){this.updateSubscribers.clear()},t.prototype.onRenderRequest=function(t){return t(this.get()),this.renderSubscribers.add(t)},t.prototype.attach=function(t){this.passiveEffect=t},t.prototype.set=function(t,n){void 0===n&&(n=!0),n&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,n)},t.prototype.get=function(){return this.current},t.prototype.getPrevious=function(){return this.prev},t.prototype.getVelocity=function(){return this.canTrackVelocity?rn(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0},t.prototype.start=function(t){var n=this;return this.stop(),new Promise((function(e){n.hasAnimated=!0,n.stopAnimation=t(e)})).then((function(){return n.clearAnimation()}))},t.prototype.stop=function(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()},t.prototype.isAnimating=function(){return!!this.stopAnimation},t.prototype.clearAnimation=function(){this.stopAnimation=null},t.prototype.destroy=function(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()},t}();function Bn(t){return new Dn(t)}var Ln=function(t){return function(n){return n.test(t)}},Un=[k,B,D,j,U,L,{test:function(t){return"auto"===t},parse:function(t){return t}}],Nn=function(t){return Un.find(Ln(t))},Yn=u(u([],a(Un),!1),[q,Q],!1),zn=function(t){return Yn.find(Ln(t))};function Xn(t){return Array.isArray(t)}function Hn(t){return"string"==typeof t||Xn(t)}function Wn(t,n,e){var r=t.getProps();return function(t,n,e,r,o){var i;return void 0===r&&(r={}),void 0===o&&(o={}),"function"==typeof n&&(n=n(null!=e?e:t.custom,r,o)),"string"==typeof n&&(n=null===(i=t.variants)||void 0===i?void 0:i[n]),"function"==typeof n&&(n=n(null!=e?e:t.custom,r,o)),n}(r,n,null!=e?e:r.custom,function(t){var n={};return t.forEachValue((function(t,e){return n[e]=t.get()})),n}(t),function(t){var n={};return t.forEachValue((function(t,e){return n[e]=t.getVelocity()})),n}(t))}function Zn(t){var n;return"function"==typeof(null===(n=t.animate)||void 0===n?void 0:n.start)||Hn(t.initial)||Hn(t.animate)||Hn(t.whileHover)||Hn(t.whileDrag)||Hn(t.whileTap)||Hn(t.whileFocus)||Hn(t.exit)}function $n(t,n,e){t.hasValue(n)?t.getValue(n).set(e):t.addValue(n,Bn(e))}function qn(t,n){if(n)return(n[t]||n.default||n).from}var Kn=["","X","Y","Z"],Gn=["transformPerspective","x","y","z"];function Jn(t,n){return Gn.indexOf(t)-Gn.indexOf(n)}["translate","scale","rotate","skew"].forEach((function(t){return Kn.forEach((function(n){return Gn.push(t+n)}))}));var _n=new Set(Gn);function Qn(t){return _n.has(t)}var te,ne=new Set(["originX","originY","originZ"]);function ee(t){return ne.has(t)}function re(t,n,e){var r;void 0===e&&(e={});var i=Wn(t,n,e.custom),u=(i||{}).transition,s=void 0===u?t.getDefaultTransition()||{}:u;e.transitionOverride&&(s=e.transitionOverride);var c=i?function(){return oe(t,i,e)}:function(){return Promise.resolve()},l=(null===(r=t.variantChildren)||void 0===r?void 0:r.size)?function(r){void 0===r&&(r=0);var i=s.delayChildren,a=void 0===i?0:i,u=s.staggerChildren,c=s.staggerDirection;return function(t,n,e,r,i,a){void 0===e&&(e=0);void 0===r&&(r=0);void 0===i&&(i=1);var u=[],s=(t.variantChildren.size-1)*r,c=1===i?function(t){return void 0===t&&(t=0),t*r}:function(t){return void 0===t&&(t=0),s-t*r};return Array.from(t.variantChildren).sort(ie).forEach((function(t,r){u.push(re(t,n,o(o({},a),{delay:e+c(r)})).then((function(){return t.notifyAnimationComplete(n)})))})),Promise.all(u)}(t,n,a+r,u,c,e)}:function(){return Promise.resolve()},f=s.when;if(f){var d=a("beforeChildren"===f?[c,l]:[l,c],2),p=d[0],v=d[1];return p().then(v)}return Promise.all([c(),l(e.delay)])}function oe(t,n,e){var r,a=void 0===e?{}:e,u=a.delay,s=void 0===u?0:u,c=a.transitionOverride,l=a.type,f=t.makeTargetAnimatable(n),d=f.transition,p=void 0===d?t.getDefaultTransition():d,v=f.transitionEnd,m=i(f,["transition","transitionEnd"]);c&&(p=c);var h=[],g=l&&(null===(r=t.animationState)||void 0===r?void 0:r.getState()[l]);for(var y in m){var b=t.getValue(y),w=m[y];if(!(!b||void 0===w||g&&ae(g,y))){var A=o({delay:s},p);t.shouldReduceMotion&&Qn(y)&&(A=o(o({},A),{type:!1,delay:0}));var V=Fn(y,b,w,A);h.push(V)}}return Promise.all(h).then((function(){v&&function(t,n){var e=Wn(t,n),r=e?t.makeTargetAnimatable(e,!1):{},a=r.transitionEnd,u=void 0===a?{}:a;r.transition;var s=i(r,["transitionEnd","transition"]);for(var c in s=o(o({},s),u)){$n(t,c,Mn(s[c]))}}(t,v)}))}function ie(t,n){return t.sortNodePosition(n)}function ae(t,n){var e=t.protectedKeys,r=t.needsAnimating,o=e.hasOwnProperty(n)&&!0!==r[n];return r[n]=!1,o}!function(t){t.Animate="animate",t.Hover="whileHover",t.Tap="whileTap",t.Drag="whileDrag",t.Focus="whileFocus",t.InView="whileInView",t.Exit="exit"}(te||(te={}));var ue=[te.Animate,te.InView,te.Focus,te.Hover,te.Tap,te.Drag,te.Exit],se=u([],a(ue),!1).reverse(),ce=ue.length;function le(t){return function(n){return Promise.all(n.map((function(n){var e=n.animation,r=n.options;return function(t,n,e){var r;if(void 0===e&&(e={}),t.notifyAnimationStart(n),Array.isArray(n)){var o=n.map((function(n){return re(t,n,e)}));r=Promise.all(o)}else if("string"==typeof n)r=re(t,n,e);else{var i="function"==typeof n?Wn(t,n,e.custom):n;r=oe(t,i,e)}return r.then((function(){return t.notifyAnimationComplete(n)}))}(t,e,r)})))}}function fe(t){var n,e=le(t),r=((n={})[te.Animate]=de(!0),n[te.InView]=de(),n[te.Hover]=de(),n[te.Tap]=de(),n[te.Drag]=de(),n[te.Focus]=de(),n[te.Exit]=de(),n),c={},l=!0,f=function(n,e){var r=Wn(t,e);if(r){r.transition;var a=r.transitionEnd,u=i(r,["transition","transitionEnd"]);n=o(o(o({},n),u),a)}return n};function d(n,i){for(var d,m=t.getProps(),h=t.getVariantContext(!0)||{},g=[],y=new Set,b={},w=1/0,A=function(e){var c=se[e],A=r[c],V=null!==(d=m[c])&&void 0!==d?d:h[c],x=Hn(V),O=c===i?A.isActive:null;!1===O&&(w=e);var S=V===h[c]&&V!==m[c]&&x;if(S&&l&&t.manuallyAnimateOnMount&&(S=!1),A.protectedKeys=o({},b),!A.isActive&&null===O||!V&&!A.prevProp||s(V)||"boolean"==typeof V)return"continue";var M=function(t,n){if("string"==typeof n)return n!==t;if(Xn(n))return!v(n,t);return!1}(A.prevProp,V),T=M||c===i&&A.isActive&&!S&&x||e>w&&x,E=Array.isArray(V)?V:[V],C=E.reduce(f,{});!1===O&&(C={});var P=A.prevResolvedValues,k=void 0===P?{}:P,I=o(o({},k),C),F=function(t){T=!0,y.delete(t),A.needsAnimating[t]=!0};for(var R in I){var j=C[R],D=k[R];b.hasOwnProperty(R)||(j!==D?p(j)&&p(D)?!v(j,D)||M?F(R):A.protectedKeys[R]=!0:void 0!==j?F(R):y.add(R):void 0!==j&&y.has(R)?F(R):A.protectedKeys[R]=!0)}A.prevProp=V,A.prevResolvedValues=C,A.isActive&&(b=o(o({},b),C)),l&&t.blockInitialAnimation&&(T=!1),T&&!S&&g.push.apply(g,u([],a(E.map((function(t){return{animation:t,options:o({type:c},n)}}))),!1))},V=0;V<ce;V++)A(V);if(c=o({},b),y.size){var x={};y.forEach((function(n){var e=t.getBaseTarget(n);void 0!==e&&(x[n]=e)})),g.push({animation:x})}var O=Boolean(g.length);return l&&!1===m.initial&&!t.manuallyAnimateOnMount&&(O=!1),l=!1,O?e(g):Promise.resolve()}return{isAnimated:function(t){return void 0!==c[t]},animateChanges:d,setActive:function(n,e,o){var i;if(r[n].isActive===e)return Promise.resolve();null===(i=t.variantChildren)||void 0===i||i.forEach((function(t){var r;return null===(r=t.animationState)||void 0===r?void 0:r.setActive(n,e)})),r[n].isActive=e;var a=d(o,n);for(var u in r)r[u].protectedKeys={};return a},setAnimateFunction:function(n){e=n(t)},getState:function(){return r}}}function de(t){return void 0===t&&(t=!1),{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}var pe=function(t){return function(n){return t(n),null}},ve={animation:pe((function(t){var n=t.visualElement,e=t.animate;n.animationState||(n.animationState=fe(n)),s(e)&&r((function(){return e.subscribe(n)}),[e])})),exit:pe((function(t){var n=t.custom,o=t.visualElement,i=a(function(){var t=e(c);if(null===t)return[!0,null];var n=t.isPresent,o=t.onExitComplete,i=t.register,a=d();return r((function(){return i(a)}),[]),!n&&o?[!1,function(){return null==o?void 0:o(a)}]:[!0]}(),2),u=i[0],s=i[1],l=e(c);r((function(){var t,e;o.isPresent=u;var r=null===(t=o.animationState)||void 0===t?void 0:t.setActive(te.Exit,!u,{custom:null!==(e=null==l?void 0:l.custom)&&void 0!==e?e:n});!u&&(null==r||r.then(s))}),[u])}))};function me(t,n,e,r){return void 0===r&&(r={passive:!0}),t.addEventListener(n,e,r),function(){return t.removeEventListener(n,e)}}function he(t,n,e,o){r((function(){var r=t.current;if(e&&r)return me(r,n,e,o)}),[t,n,e,o])}function ge(t){return!!t.touches}var ye={pageX:0,pageY:0};function be(t,n){void 0===n&&(n="page");var e=t.touches[0]||t.changedTouches[0]||ye;return{x:e[n+"X"],y:e[n+"Y"]}}function we(t,n){return void 0===n&&(n="page"),{x:t[n+"X"],y:t[n+"Y"]}}var Ae=function(t,n){void 0===n&&(n=!1);var e,r=function(n){return t(n,function(t,n){return void 0===n&&(n="page"),{point:ge(t)?be(t,n):we(t,n)}}(n))};return n?(e=r,function(t){var n=t instanceof MouseEvent;(!n||n&&0===t.button)&&e(t)}):r},Ve="undefined"!=typeof document,xe={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},Oe={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function Se(t){return Ve&&null===window.onpointerdown?t:Ve&&null===window.ontouchstart?Oe[t]:Ve&&null===window.onmousedown?xe[t]:t}function Me(t,n,e,r){return me(t,Se(n),Ae(e,"pointerdown"===n),r)}function Te(t,n,e,r){return he(t,Se(n),e&&Ae(e,"pointerdown"===n),r)}function Ee(t){var n=null;return function(){return null===n&&(n=t,function(){n=null})}}var Ce=Ee("dragHorizontal"),Pe=Ee("dragVertical");function ke(){var t=function(t){var n=!1;if("y"===t)n=Pe();else if("x"===t)n=Ce();else{var e=Ce(),r=Pe();e&&r?n=function(){e(),r()}:(e&&e(),r&&r())}return n}(!0);return!t||(t(),!1)}function Ie(t,n,e){return function(r,o){var i;(function(t){return"undefined"!=typeof PointerEvent&&t instanceof PointerEvent?!("mouse"!==t.pointerType):t instanceof MouseEvent})(r)&&!ke()&&(null===(i=t.animationState)||void 0===i||i.setActive(te.Hover,n),null==e||e(r,o))}}var Fe=function(t,n){return!!n&&(t===n||Fe(t,n.parentElement))};var Re=("undefined"==typeof process||process.env,"production"),je=new Set;var De=new WeakMap,Be=new WeakMap,Le=function(t){var n;null===(n=De.get(t.target))||void 0===n||n(t)},Ue=function(t){t.forEach(Le)};function Ne(t,n,e){var r=function(t){var n=t.root,e=i(t,["root"]),r=n||document;Be.has(r)||Be.set(r,{});var a=Be.get(r),u=JSON.stringify(e);return a[u]||(a[u]=new IntersectionObserver(Ue,o({root:n},e))),a[u]}(n);return De.set(t,e),r.observe(t),function(){De.delete(t),r.unobserve(t)}}var Ye={some:0,all:1};function ze(t,n,e,o){var i=o.root,a=o.margin,u=o.amount,s=void 0===u?"some":u,c=o.once;r((function(){if(t){var r={root:null==i?void 0:i.current,rootMargin:a,threshold:"number"==typeof s?s:Ye[s]};return Ne(e.getInstance(),r,(function(t){var r,o=t.isIntersecting;if(n.isInView!==o&&(n.isInView=o,!c||o||!n.hasEnteredView)){o&&(n.hasEnteredView=!0),null===(r=e.animationState)||void 0===r||r.setActive(te.InView,o);var i=e.getProps(),a=o?i.onViewportEnter:i.onViewportLeave;null==a||a(t)}}))}}),[t,i,a,s])}function Xe(t,n,e,o){var i=o.fallback,a=void 0===i||i;r((function(){var r,o;t&&a&&("production"!==Re&&(r="IntersectionObserver not available on this device. whileInView animations will trigger on mount.",!1||je.has(r)||(console.warn(r),o&&console.warn(o),je.add(r))),requestAnimationFrame((function(){var t;n.hasEnteredView=!0;var r=e.getProps().onViewportEnter;null==r||r(null),null===(t=e.animationState)||void 0===t||t.setActive(te.InView,!0)})))}),[t])}var He={inView:pe((function(t){var e=t.visualElement,r=t.whileInView,o=t.onViewportEnter,i=t.onViewportLeave,a=t.viewport,u=void 0===a?{}:a,s=n({hasEnteredView:!1,isInView:!1}),c=Boolean(r||o||i);u.once&&s.current.hasEnteredView&&(c=!1),("undefined"==typeof IntersectionObserver?Xe:ze)(c,s.current,e,u)})),tap:pe((function(t){var e,o=t.onTap,i=t.onTapStart,a=t.onTapCancel,u=t.whileTap,s=t.visualElement,c=o||i||a||u,l=n(!1),f=n(null),d={passive:!(i||o||a||g)};function p(){var t;null===(t=f.current)||void 0===t||t.call(f),f.current=null}function v(){var t;return p(),l.current=!1,null===(t=s.animationState)||void 0===t||t.setActive(te.Tap,!1),!ke()}function m(t,n){v()&&(Fe(s.getInstance(),t.target)?null==o||o(t,n):null==a||a(t,n))}function h(t,n){v()&&(null==a||a(t,n))}function g(t,n){var e;p(),l.current||(l.current=!0,f.current=ft(Me(window,"pointerup",m,d),Me(window,"pointercancel",h,d)),null===(e=s.animationState)||void 0===e||e.setActive(te.Tap,!0),null==i||i(t,n))}Te(s,"pointerdown",c?g:void 0,d),e=p,r((function(){return function(){return e()}}),[])})),focus:pe((function(t){var n=t.whileFocus,e=t.visualElement;he(e,"focus",n?function(){var t;null===(t=e.animationState)||void 0===t||t.setActive(te.Focus,!0)}:void 0),he(e,"blur",n?function(){var t;null===(t=e.animationState)||void 0===t||t.setActive(te.Focus,!1)}:void 0)})),hover:pe((function(t){var n=t.onHoverStart,e=t.onHoverEnd,r=t.whileHover,o=t.visualElement;Te(o,"pointerenter",n||r?Ie(o,!0,n):void 0,{passive:!n}),Te(o,"pointerleave",e||r?Ie(o,!1,e):void 0,{passive:!e})}))},We=function(t){return Boolean(null!==t&&"object"==typeof t&&t.getVelocity)},Ze=["LayoutMeasure","BeforeLayoutMeasure","LayoutUpdate","ViewportBoxUpdate","Update","Render","AnimationComplete","LayoutAnimationComplete","AnimationStart","LayoutAnimationStart","SetAxisTarget","Unmount"];var $e=function(t){var n=t.treeType,e=void 0===n?"":n,r=t.build,i=t.getBaseTarget,s=t.makeTargetAnimatable,c=t.measureViewportBox,l=t.render,f=t.readValueFromInstance,d=t.removeValueFromRenderState,p=t.sortNodePosition,v=t.scrapeMotionValuesFromProps;return function(t,n){var m=t.parent,h=t.props,g=t.presenceId,y=t.blockInitialAnimation,b=t.visualState,w=t.shouldReduceMotion;void 0===n&&(n={});var A,V,x=!1,O=b.latestValues,S=b.renderState,M=function(){var t=Ze.map((function(){return new jn})),n={},e={clearAllListeners:function(){return t.forEach((function(t){return t.clear()}))},updatePropListeners:function(t){Ze.forEach((function(r){var o,i="on"+r,a=t[i];null===(o=n[r])||void 0===o||o.call(n),a&&(n[r]=e[i](a))}))}};return t.forEach((function(t,n){e["on"+Ze[n]]=function(n){return t.add(n)},e["notify"+Ze[n]]=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return t.notify.apply(t,u([],a(n),!1))}})),e}(),T=new Map,E=new Map,C={},P=o({},O);function k(){A&&x&&(I(),l(A,S,h.style,N.projection))}function I(){r(N,S,O,n,h)}function F(){M.notifyUpdate(O)}function R(t,n){var e=n.onChange((function(n){O[t]=n,h.onUpdate&&qt.update(F,!1,!0)})),r=n.onRenderRequest(N.scheduleRender);E.set(t,(function(){e(),r()}))}var j=v(h);for(var D in j){var B=j[D];void 0!==O[D]&&We(B)&&B.set(O[D],!1)}var L=Zn(h),U=function(t){return Boolean(Zn(t)||t.variants)}(h),N=o(o({treeType:e,current:null,depth:m?m.depth+1:0,parent:m,children:new Set,presenceId:g,shouldReduceMotion:w,variantChildren:U?new Set:void 0,isVisible:void 0,manuallyAnimateOnMount:Boolean(null==m?void 0:m.isMounted()),blockInitialAnimation:y,isMounted:function(){return Boolean(A)},mount:function(t){x=!0,A=N.current=t,N.projection&&N.projection.mount(t),U&&m&&!L&&(V=null==m?void 0:m.addVariantChild(N)),T.forEach((function(t,n){return R(n,t)})),null==m||m.children.add(N),N.setProps(h)},unmount:function(){var t;null===(t=N.projection)||void 0===t||t.unmount(),Kt.update(F),Kt.render(k),E.forEach((function(t){return t()})),null==V||V(),null==m||m.children.delete(N),M.clearAllListeners(),A=void 0,x=!1},addVariantChild:function(t){var n,e=N.getClosestVariantNode();if(e)return null===(n=e.variantChildren)||void 0===n||n.add(t),function(){return e.variantChildren.delete(t)}},sortNodePosition:function(t){return p&&e===t.treeType?p(N.getInstance(),t.getInstance()):0},getClosestVariantNode:function(){return U?N:null==m?void 0:m.getClosestVariantNode()},getLayoutId:function(){return h.layoutId},getInstance:function(){return A},getStaticValue:function(t){return O[t]},setStaticValue:function(t,n){return O[t]=n},getLatestValues:function(){return O},setVisibility:function(t){N.isVisible!==t&&(N.isVisible=t,N.scheduleRender())},makeTargetAnimatable:function(t,n){return void 0===n&&(n=!0),s(N,t,h,n)},measureViewportBox:function(){return c(A,h)},addValue:function(t,n){N.hasValue(t)&&N.removeValue(t),T.set(t,n),O[t]=n.get(),R(t,n)},removeValue:function(t){var n;T.delete(t),null===(n=E.get(t))||void 0===n||n(),E.delete(t),delete O[t],d(t,S)},hasValue:function(t){return T.has(t)},getValue:function(t,n){var e=T.get(t);return void 0===e&&void 0!==n&&(e=Bn(n),N.addValue(t,e)),e},forEachValue:function(t){return T.forEach(t)},readValue:function(t){var e;return null!==(e=O[t])&&void 0!==e?e:f(A,t,n)},setBaseTarget:function(t,n){P[t]=n},getBaseTarget:function(t){if(i){var n=i(h,t);if(void 0!==n&&!We(n))return n}return P[t]}},M),{build:function(){return I(),S},scheduleRender:function(){qt.render(k,!1,!0)},syncRender:k,setProps:function(t){(t.transformTemplate||h.transformTemplate)&&N.scheduleRender(),h=t,M.updatePropListeners(t),C=function(t,n,e){var r;for(var o in n){var i=n[o],a=e[o];if(We(i))t.addValue(o,i);else if(We(a))t.addValue(o,Bn(i));else if(a!==i)if(t.hasValue(o)){var u=t.getValue(o);!u.hasAnimated&&u.set(i)}else t.addValue(o,Bn(null!==(r=t.getStaticValue(o))&&void 0!==r?r:i))}for(var o in e)void 0===n[o]&&t.removeValue(o);return n}(N,v(h),C)},getProps:function(){return h},getVariant:function(t){var n;return null===(n=h.variants)||void 0===n?void 0:n[t]},getDefaultTransition:function(){return h.transition},getTransformPagePoint:function(){return h.transformPagePoint},getVariantContext:function(t){if(void 0===t&&(t=!1),t)return null==m?void 0:m.getVariantContext();if(!L){var n=(null==m?void 0:m.getVariantContext())||{};return void 0!==h.initial&&(n.initial=h.initial),n}for(var e={},r=0;r<Ke;r++){var o=qe[r],i=h[o];(Hn(i)||!1===i)&&(e[o]=i)}return e}});return N}},qe=u(["initial"],a(ue),!1),Ke=qe.length,Ge={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};function Je(t){return t.startsWith("--")}var _e=function(t,n){return n&&"number"==typeof t?n.transform(t):t};function Qe(t,n,e,r){var o,i=t.style,a=t.vars,u=t.transform,s=t.transformKeys,c=t.transformOrigin;s.length=0;var l=!1,f=!1,d=!0;for(var p in n){var v=n[p];if(Je(p))a[p]=v;else{var m=An[p],h=_e(v,m);if(Qn(p)){if(l=!0,u[p]=h,s.push(p),!d)continue;v!==(null!==(o=m.default)&&void 0!==o?o:0)&&(d=!1)}else ee(p)?(c[p]=h,f=!0):i[p]=h}}l?i.transform=function(t,n,e,r){var o=t.transform,i=t.transformKeys,a=n.enableHardwareAcceleration,u=void 0===a||a,s=n.allowTransformNone,c=void 0===s||s,l="";i.sort(Jn);for(var f=!1,d=i.length,p=0;p<d;p++){var v=i[p];l+="".concat(Ge[v]||v,"(").concat(o[v],") "),"z"===v&&(f=!0)}return!f&&u?l+="translateZ(0)":l=l.trim(),r?l=r(o,e?"":l):c&&e&&(l="none"),l}(t,e,d,r):r?i.transform=r({},""):!n.transform&&i.transform&&(i.transform="none"),f&&(i.transformOrigin=function(t){var n=t.originX,e=void 0===n?"50%":n,r=t.originY,o=void 0===r?"50%":r,i=t.originZ,a=void 0===i?0:i;return"".concat(e," ").concat(o," ").concat(a)}(c))}function tr(t){return"string"==typeof t&&t.startsWith("var(--")}var nr=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function er(t,n,e){var r=a(function(t){var n=nr.exec(t);if(!n)return[,];var e=a(n,3);return[e[1],e[2]]}(t),2),o=r[0],i=r[1];if(o){var u=window.getComputedStyle(n).getPropertyValue(o);return u?u.trim():tr(i)?er(i,n):i}}var rr,or=new Set(["width","height","top","left","right","bottom","x","y"]),ir=function(t){return or.has(t)},ar=function(t,n){t.set(n,!1),t.set(n)},ur=function(t){return t===k||t===B};!function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"}(rr||(rr={}));var sr=function(t,n){return parseFloat(t.split(", ")[n])},cr=function(t,n){return function(e,r){var o=r.transform;if("none"===o||!o)return 0;var i=o.match(/^matrix3d\((.+)\)$/);if(i)return sr(i[1],n);var a=o.match(/^matrix\((.+)\)$/);return a?sr(a[1],t):0}},lr=new Set(["x","y","z"]),fr=Gn.filter((function(t){return!lr.has(t)}));var dr={width:function(t,n){var e=t.x,r=n.paddingLeft,o=void 0===r?"0":r,i=n.paddingRight,a=void 0===i?"0":i;return e.max-e.min-parseFloat(o)-parseFloat(a)},height:function(t,n){var e=t.y,r=n.paddingTop,o=void 0===r?"0":r,i=n.paddingBottom,a=void 0===i?"0":i;return e.max-e.min-parseFloat(o)-parseFloat(a)},top:function(t,n){var e=n.top;return parseFloat(e)},left:function(t,n){var e=n.left;return parseFloat(e)},bottom:function(t,n){var e=t.y,r=n.top;return parseFloat(r)+(e.max-e.min)},right:function(t,n){var e=t.x,r=n.left;return parseFloat(r)+(e.max-e.min)},x:cr(4,13),y:cr(5,14)},pr=function(t,n,e,r){void 0===e&&(e={}),void 0===r&&(r={}),n=o({},n),r=o({},r);var i=Object.keys(n).filter(ir),u=[],s=!1,c=[];if(i.forEach((function(o){var i=t.getValue(o);if(t.hasValue(o)){var a,l=e[o],f=Nn(l),d=n[o];if(p(d)){var v=d.length,m=null===d[0]?1:0;l=d[m],f=Nn(l);for(var h=m;h<v;h++)a?Nn(d[h]):a=Nn(d[h])}else a=Nn(d);if(f!==a)if(ur(f)&&ur(a)){var g=i.get();"string"==typeof g&&i.set(parseFloat(g)),"string"==typeof d?n[o]=parseFloat(d):Array.isArray(d)&&a===B&&(n[o]=d.map(parseFloat))}else(null==f?void 0:f.transform)&&(null==a?void 0:a.transform)&&(0===l||0===d)?0===l?i.set(a.transform(l)):n[o]=f.transform(d):(s||(u=function(t){var n=[];return fr.forEach((function(e){var r=t.getValue(e);void 0!==r&&(n.push([e,r.get()]),r.set(e.startsWith("scale")?1:0))})),n.length&&t.syncRender(),n}(t),s=!0),c.push(o),r[o]=void 0!==r[o]?r[o]:n[o],ar(i,d))}})),c.length){var l=c.indexOf("height")>=0?window.pageYOffset:null,f=function(t,n,e){var r=n.measureViewportBox(),o=n.getInstance(),i=getComputedStyle(o),a=i.display,u={};"none"===a&&n.setStaticValue("display",t.display||"block"),e.forEach((function(t){u[t]=dr[t](r,i)})),n.syncRender();var s=n.measureViewportBox();return e.forEach((function(e){var r=n.getValue(e);ar(r,u[e]),t[e]=dr[e](s,i)})),t}(n,t,c);return u.length&&u.forEach((function(n){var e=a(n,2),r=e[0],o=e[1];t.getValue(r).set(o)})),t.syncRender(),null!==l&&window.scrollTo({top:l}),{target:f,transitionEnd:r}}return{target:n,transitionEnd:r}};function vr(t,n,e,r){return function(t){return Object.keys(t).some(ir)}(n)?pr(t,n,e,r):{target:n,transitionEnd:r}}var mr=function(t,n,e,r){var a=function(t,n,e){var r,a=i(n,[]),u=t.getInstance();if(!(u instanceof Element))return{target:a,transitionEnd:e};for(var s in e&&(e=o({},e)),t.forEachValue((function(t){var n=t.get();if(tr(n)){var e=er(n,u);e&&t.set(e)}})),a){var c=a[s];if(tr(c)){var l=er(c,u);l&&(a[s]=l,e&&(null!==(r=e[s])&&void 0!==r||(e[s]=c)))}}return{target:a,transitionEnd:e}}(t,n,r);return vr(t,n=a.target,e,r=a.transitionEnd)},hr={};function gr(t,n){var e=n.layout,r=n.layoutId;return Qn(t)||ee(t)||(e||void 0!==r)&&(!!hr[t]||"opacity"===t)}function yr(t){var n=t.style,e={};for(var r in n)(We(n[r])||gr(r,t))&&(e[r]=n[r]);return e}function br(t,n,e,r){var o=n.style,i=n.vars;for(var a in Object.assign(t.style,o,r&&r.getProjectionStyles(e)),i)t.style.setProperty(a,i[a])}var wr={treeType:"dom",readValueFromInstance:function(t,n){if(Qn(n)){var e=xn(n);return e&&e.default||0}var r,o=(r=t,window.getComputedStyle(r));return(Je(n)?o.getPropertyValue(n):o[n])||0},sortNodePosition:function(t,n){return 2&t.compareDocumentPosition(n)?1:-1},getBaseTarget:function(t,n){var e;return null===(e=t.style)||void 0===e?void 0:e[n]},measureViewportBox:function(t,n){return function(t,n){return e=function(t,n){if(!n)return t;var e=n({x:t.left,y:t.top}),r=n({x:t.right,y:t.bottom});return{top:e.y,left:e.x,bottom:r.y,right:r.x}}(t.getBoundingClientRect(),n),r=e.top,{x:{min:e.left,max:e.right},y:{min:r,max:e.bottom}};var e,r}(t,n.transformPagePoint)},resetTransform:function(t,n,e){var r=e.transformTemplate;n.style.transform=r?r({},""):"none",t.scheduleRender()},restoreTransform:function(t,n){t.style.transform=n.style.transform},removeValueFromRenderState:function(t,n){var e=n.vars,r=n.style;delete e[t],delete r[t]},makeTargetAnimatable:function(t,n,e,r){var a=e.transformValues;void 0===r&&(r=!0);var u=n.transition,s=n.transitionEnd,c=i(n,["transition","transitionEnd"]),l=function(t,n,e){var r,o,i={};for(var a in t)i[a]=null!==(r=qn(a,n))&&void 0!==r?r:null===(o=e.getValue(a))||void 0===o?void 0:o.get();return i}(c,u||{},t);if(a&&(s&&(s=a(s)),c&&(c=a(c)),l&&(l=a(l))),r){!function(t,n,e){var r,o,i,a,u=Object.keys(n).filter((function(n){return!t.hasValue(n)})),s=u.length;if(s)for(var c=0;c<s;c++){var l=u[c],f=n[l],d=null;Array.isArray(f)&&(d=f[0]),null===d&&(d=null!==(o=null!==(r=e[l])&&void 0!==r?r:t.readValue(l))&&void 0!==o?o:n[l]),null!=d&&("string"==typeof d&&(/^\-?\d*\.?\d+$/.test(d)||Rn(d))?d=parseFloat(d):!zn(d)&&Q.test(f)&&(d=On(l,f)),t.addValue(l,Bn(d)),null!==(i=(a=e)[l])&&void 0!==i||(a[l]=d),t.setBaseTarget(l,d))}}(t,c,l);var f=mr(t,c,l,s);s=f.transitionEnd,c=f.target}return o({transition:u,transitionEnd:s},c)},scrapeMotionValuesFromProps:yr,build:function(t,n,e,r,o){void 0!==t.isVisible&&(n.style.visibility=t.isVisible?"visible":"hidden"),Qe(n,e,r,o.transformTemplate)},render:br},Ar=$e(wr);function Vr(t,n,e){return"string"==typeof t?t:B.transform(n+e*t)}var xr={offset:"stroke-dashoffset",array:"stroke-dasharray"},Or={offset:"strokeDashoffset",array:"strokeDasharray"};function Sr(t,n,e,r){var o=n.attrX,a=n.attrY,u=n.originX,s=n.originY,c=n.pathLength,l=n.pathSpacing,f=void 0===l?1:l,d=n.pathOffset,p=void 0===d?0:d;Qe(t,i(n,["attrX","attrY","originX","originY","pathLength","pathSpacing","pathOffset"]),e,r),t.attrs=t.style,t.style={};var v=t.attrs,m=t.style,h=t.dimensions;v.transform&&(h&&(m.transform=v.transform),delete v.transform),h&&(void 0!==u||void 0!==s||m.transform)&&(m.transformOrigin=function(t,n,e){var r=Vr(n,t.x,t.width),o=Vr(e,t.y,t.height);return"".concat(r," ").concat(o)}(h,void 0!==u?u:.5,void 0!==s?s:.5)),void 0!==o&&(v.x=o),void 0!==a&&(v.y=a),void 0!==c&&function(t,n,e,r,o){void 0===e&&(e=1),void 0===r&&(r=0),void 0===o&&(o=!0),t.pathLength=1;var i=o?xr:Or;t[i.offset]=B.transform(-r);var a=B.transform(n),u=B.transform(e);t[i.array]="".concat(a," ").concat(u)}(v,c,f,p,!1)}var Mr=/([a-z])([A-Z])/g,Tr=function(t){return t.replace(Mr,"$1-$2").toLowerCase()},Er=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength"]);var Cr=$e(o(o({},wr),{getBaseTarget:function(t,n){return t[n]},readValueFromInstance:function(t,n){var e;return Qn(n)?(null===(e=xn(n))||void 0===e?void 0:e.default)||0:(n=Er.has(n)?n:Tr(n),t.getAttribute(n))},scrapeMotionValuesFromProps:function(t){var n=yr(t);for(var e in t){if(We(t[e]))n["x"===e||"y"===e?"attr"+e.toUpperCase():e]=t[e]}return n},build:function(t,n,e,r,o){Sr(n,e,r,o.transformTemplate)},render:function(t,n,e,r){for(var o in br(t,n,void 0,r),n.attrs)t.setAttribute(Er.has(o)?o:Tr(o),n.attrs[o])}})),Pr=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view"];var kr=o(o({renderer:function(t,n){return function(t){return"string"==typeof t&&!t.includes("-")&&!!(Pr.indexOf(t)>-1||/[A-Z]/.test(t))}(t)?Cr(n,{enableHardwareAcceleration:!1}):Ar(n,{enableHardwareAcceleration:!0})}},ve),He);export{kr as domAnimation};
|
|
1
|
+
import{createContext as t,useContext as e,useId as n,useEffect as r,useRef as o}from"react";var a=function(){return(a=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function i(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}function s(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,a=n.call(t),i=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)i.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return i}function u(t,e,n){if(n||2===arguments.length)for(var r,o=0,a=e.length;o<a;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}function l(t){return"object"==typeof t&&"function"==typeof t.start}var c=t(null);var f=function(t){return Array.isArray(t)};function d(t,e){if(!Array.isArray(e))return!1;var n=e.length;if(n!==t.length)return!1;for(var r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}const p=(t,e,n)=>Math.min(Math.max(n,t),e);function v({duration:t=800,bounce:e=.25,velocity:n=0,mass:r=1}){let o,a,i=1-e;i=p(.05,1,i),t=p(.01,10,t/1e3),i<1?(o=e=>{const r=e*i,o=r*t;return.001-(r-n)/m(e,i)*Math.exp(-o)},a=e=>{const r=e*i*t,a=r*n+n,s=Math.pow(i,2)*Math.pow(e,2)*t,u=Math.exp(-r),l=m(Math.pow(e,2),i);return(.001-o(e)>0?-1:1)*((a-s)*u)/l}):(o=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,a=e=>Math.exp(-e*t)*(t*t*(n-e)));const s=function(t,e,n){let r=n;for(let n=1;n<12;n++)r-=t(r)/e(r);return r}(o,a,5/t);if(t*=1e3,isNaN(s))return{stiffness:100,damping:10,duration:t};{const e=Math.pow(s,2)*r;return{stiffness:e,damping:2*i*Math.sqrt(r*e),duration:t}}}function m(t,e){return t*Math.sqrt(1-e*e)}const h=["duration","bounce"],g=["stiffness","damping","mass"];function y(t,e){return e.some(e=>void 0!==t[e])}function b(t){var{from:e=0,to:n=1,restSpeed:r=2,restDelta:o}=t,a=i(t,["from","to","restSpeed","restDelta"]);const s={done:!1,value:e};let{stiffness:u,damping:l,mass:c,velocity:f,duration:d,isResolvedFromDuration:p}=function(t){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},t);if(!y(t,g)&&y(t,h)){const n=v(t);e=Object.assign(Object.assign(Object.assign({},e),n),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}(a),b=w,A=w;function V(){const t=f?-f/1e3:0,r=n-e,a=l/(2*Math.sqrt(u*c)),i=Math.sqrt(u/c)/1e3;if(void 0===o&&(o=Math.min(Math.abs(n-e)/100,.4)),a<1){const e=m(i,a);b=o=>{const s=Math.exp(-a*i*o);return n-s*((t+a*i*r)/e*Math.sin(e*o)+r*Math.cos(e*o))},A=n=>{const o=Math.exp(-a*i*n);return a*i*o*(Math.sin(e*n)*(t+a*i*r)/e+r*Math.cos(e*n))-o*(Math.cos(e*n)*(t+a*i*r)-e*r*Math.sin(e*n))}}else if(1===a)b=e=>n-Math.exp(-i*e)*(r+(t+i*r)*e);else{const e=i*Math.sqrt(a*a-1);b=o=>{const s=Math.exp(-a*i*o),u=Math.min(e*o,300);return n-s*((t+a*i*r)*Math.sinh(u)+e*r*Math.cosh(u))/e}}}return V(),{next:t=>{const e=b(t);if(p)s.done=t>=d;else{const a=1e3*A(t),i=Math.abs(a)<=r,u=Math.abs(n-e)<=o;s.done=i&&u}return s.value=s.done?n:e,s},flipTarget:()=>{f=-f,[e,n]=[n,e],V()}}}b.needsInterpolation=(t,e)=>"string"==typeof t||"string"==typeof e;const w=t=>0,A=(t,e,n)=>{const r=e-t;return 0===r?1:(n-t)/r},V=(t,e,n)=>-n*t+n*e+t,x=(t,e)=>n=>Math.max(Math.min(n,e),t),O=t=>t%1?Number(t.toFixed(5)):t,S=/(-)?([\d]*\.?[\d])+/g,M=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))/gi,T=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))$/i;function E(t){return"string"==typeof t}const C={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},P=Object.assign(Object.assign({},C),{transform:x(0,1)});Object.assign(Object.assign({},C),{default:1});const k=(F="%",{test:t=>E(t)&&t.endsWith(F)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${F}`});var F;Object.assign(Object.assign({},k),{parse:t=>k.parse(t)/100,transform:t=>k.transform(100*t)});const I=(t,e)=>n=>Boolean(E(n)&&T.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),j=(t,e,n)=>r=>{if(!E(r))return r;const[o,a,i,s]=r.match(S);return{[t]:parseFloat(o),[e]:parseFloat(a),[n]:parseFloat(i),alpha:void 0!==s?parseFloat(s):1}},R={test:I("hsl","hue"),parse:j("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+k.transform(O(e))+", "+k.transform(O(n))+", "+O(P.transform(r))+")"},D=x(0,255),B=Object.assign(Object.assign({},C),{transform:t=>Math.round(D(t))}),L={test:I("rgb","red"),parse:j("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+B.transform(t)+", "+B.transform(e)+", "+B.transform(n)+", "+O(P.transform(r))+")"};const N={test:I("#"),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:L.transform},U=t=>L.test(t)||N.test(t)||R.test(t),Y=t=>L.test(t)?L.parse(t):R.test(t)?R.parse(t):N.parse(t),$=t=>E(t)?t:t.hasOwnProperty("red")?L.transform(t):R.transform(t);function z(t){"number"==typeof t&&(t=""+t);const e=[];let n=0;const r=t.match(M);r&&(n=r.length,t=t.replace(M,"${c}"),e.push(...r.map(Y)));const o=t.match(S);return o&&(t=t.replace(S,"${n}"),e.push(...o.map(C.parse))),{values:e,numColors:n,tokenised:t}}function W(t){return z(t).values}function X(t){const{values:e,numColors:n,tokenised:r}=z(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?$(t[r]):O(t[r]));return e}}const H=t=>"number"==typeof t?0:t;const Z={test:function(t){var e,n,r,o;return isNaN(t)&&E(t)&&(null!==(n=null===(e=t.match(S))||void 0===e?void 0:e.length)&&void 0!==n?n:0)+(null!==(o=null===(r=t.match(M))||void 0===r?void 0:r.length)&&void 0!==o?o:0)>0},parse:W,createTransformer:X,getAnimatableNone:function(t){const e=W(t);return X(t)(e.map(H))}};function q(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 K({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,n/=100;let o=0,a=0,i=0;if(e/=100){const r=n<.5?n*(1+e):n+e-n*e,s=2*n-r;o=q(s,r,t+1/3),a=q(s,r,t),i=q(s,r,t-1/3)}else o=a=i=n;return{red:Math.round(255*o),green:Math.round(255*a),blue:Math.round(255*i),alpha:r}}const G=(t,e,n)=>{const r=t*t,o=e*e;return Math.sqrt(Math.max(0,n*(o-r)+r))},J=[N,L,R],_=t=>J.find(e=>e.test(t)),Q=(t,e)=>{let n=_(t),r=_(e),o=n.parse(t),a=r.parse(e);n===R&&(o=K(o),n=L),r===R&&(a=K(a),r=L);const i=Object.assign({},o);return t=>{for(const e in i)"alpha"!==e&&(i[e]=G(o[e],a[e],t));return i.alpha=V(o.alpha,a.alpha,t),n.transform(i)}},tt=(t,e)=>n=>e(t(n)),et=(...t)=>t.reduce(tt);function nt(t,e){return"number"==typeof t?n=>V(t,e,n):U(t)?Q(t,e):it(t,e)}const rt=(t,e)=>{const n=[...t],r=n.length,o=t.map((t,n)=>nt(t,e[n]));return t=>{for(let e=0;e<r;e++)n[e]=o[e](t);return n}},ot=(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]=nt(t[o],e[o]));return t=>{for(const e in r)n[e]=r[e](t);return n}};function at(t){const e=Z.parse(t),n=e.length;let r=0,o=0,a=0;for(let t=0;t<n;t++)r||"number"==typeof e[t]?r++:void 0!==e[t].hue?a++:o++;return{parsed:e,numNumbers:r,numRGB:o,numHSL:a}}const it=(t,e)=>{const n=Z.createTransformer(e),r=at(t),o=at(e);return r.numHSL===o.numHSL&&r.numRGB===o.numRGB&&r.numNumbers>=o.numNumbers?et(rt(r.parsed,o.parsed),n):n=>""+(n>0?e:t)},st=(t,e)=>n=>V(t,e,n);function ut(t,e,n){const r=[],o=n||("number"==typeof(a=t[0])?st:"string"==typeof a?U(a)?Q:it:Array.isArray(a)?rt:"object"==typeof a?ot:void 0);var a;const i=t.length-1;for(let n=0;n<i;n++){let a=o(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]:e;a=et(t,a)}r.push(a)}return r}function lt(t,e,{clamp:n=!0,ease:r,mixer:o}={}){const a=t.length;e.length,!r||!Array.isArray(r)||r.length,t[0]>t[a-1]&&(t=[].concat(t),e=[].concat(e),t.reverse(),e.reverse());const i=ut(e,r,o),s=2===a?function([t,e],[n]){return r=>n(A(t,e,r))}(t,i):function(t,e){const n=t.length,r=n-1;return o=>{let a=0,i=!1;if(o<=t[0]?i=!0:o>=t[r]&&(a=r-1,i=!0),!i){let e=1;for(;e<n&&!(t[e]>o||e===r);e++);a=e-1}const s=A(t[a],t[a+1],o);return e[a](s)}}(t,i);return n?e=>s(p(t[0],t[a-1],e)):s}const ct=t=>e=>1-t(1-e),ft=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,dt=t=>e=>e*e*((t+1)*e-t),pt=t=>t,vt=(mt=2,t=>Math.pow(t,mt));var mt;const ht=ct(vt),gt=ft(vt),yt=t=>1-Math.sin(Math.acos(t)),bt=ct(yt),wt=ft(bt),At=dt(1.525),Vt=ct(At),xt=ft(At),Ot=(t=>{const e=dt(t);return t=>(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))})(1.525),St=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},Mt=ct(St);function Tt(t,e){return t.map(()=>e||gt).splice(0,t.length-1)}function Et({from:t=0,to:e=1,ease:n,offset:r,duration:o=300}){const a={done:!1,value:t},i=Array.isArray(e)?e:[t,e],s=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 lt(s,i,{ease:Array.isArray(n)?n:Tt(i,n)})}let l=u();return{next:t=>(a.value=l(t),a.done=t>=o,a),flipTarget:()=>{i.reverse(),l=u()}}}const Ct={keyframes:Et,spring:b,decay:function({velocity:t=0,from:e=0,power:n=.8,timeConstant:r=350,restDelta:o=.5,modifyTarget:a}){const i={done:!1,value:e};let s=n*t;const u=e+s,l=void 0===a?u:a(u);return l!==u&&(s=l-e),{next:t=>{const e=-s*Math.exp(-t/r);return i.done=!(e>o||e<-o),i.value=i.done?l:l+e,i},flipTarget:()=>{}}}};const Pt="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),kt="undefined"!=typeof window?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(Pt()),1/60*1e3);let Ft=!0,It=!1,jt=!1;const Rt={delta:0,timestamp:0},Dt=["read","update","preRender","render","postRender"],Bt=Dt.reduce((t,e)=>(t[e]=function(t){let e=[],n=[],r=0,o=!1,a=!1;const i=new WeakSet,s={schedule:(t,a=!1,s=!1)=>{const u=s&&o,l=u?e:n;return a&&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)a=!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)&&(s.schedule(r),t())}o=!1,a&&(a=!1,s.process(u))}}};return s}(()=>It=!0),t),{}),Lt=Dt.reduce((t,e)=>{const n=Bt[e];return t[e]=(t,e=!1,r=!1)=>(It||$t(),n.schedule(t,e,r)),t},{}),Nt=Dt.reduce((t,e)=>(t[e]=Bt[e].cancel,t),{});Dt.reduce((t,e)=>(t[e]=()=>Bt[e].process(Rt),t),{});const Ut=t=>Bt[t].process(Rt),Yt=t=>{It=!1,Rt.delta=Ft?1/60*1e3:Math.max(Math.min(t-Rt.timestamp,40),1),Rt.timestamp=t,jt=!0,Dt.forEach(Ut),jt=!1,It&&(Ft=!1,kt(Yt))},$t=()=>{It=!0,Ft=!0,jt||kt(Yt)},zt=()=>Rt;function Wt(t,e,n=0){return t-e-n}const Xt=t=>{const e=({delta:e})=>t(e);return{start:()=>Lt.update(e,!0),stop:()=>Nt.update(e)}};function Ht(t){var e,n,{from:r,autoplay:o=!0,driver:a=Xt,elapsed:s=0,repeat:u=0,repeatType:l="loop",repeatDelay:c=0,onPlay:f,onStop:d,onComplete:p,onRepeat:v,onUpdate:m}=t,h=i(t,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let g,y,w,{to:A}=h,V=0,x=h.duration,O=!1,S=!0;const M=function(t){if(Array.isArray(t.to))return Et;if(Ct[t.type])return Ct[t.type];const e=new Set(Object.keys(t));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?Et:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?b:Et}(h);(null===(n=(e=M).needsInterpolation)||void 0===n?void 0:n.call(e,r,A))&&(w=lt([0,100],[r,A],{clamp:!1}),r=0,A=100);const T=M(Object.assign(Object.assign({},h),{from:r,to:A}));function E(){V++,"reverse"===l?(S=V%2==0,s=function(t,e,n=0,r=!0){return r?Wt(e+-t,e,n):e-(t-e)+n}(s,x,c,S)):(s=Wt(s,x,c),"mirror"===l&&T.flipTarget()),O=!1,v&&v()}function C(t){if(S||(t=-t),s+=t,!O){const t=T.next(Math.max(0,s));y=t.value,w&&(y=w(y)),O=S?t.done:s<=0}null==m||m(y),O&&(0===V&&(null!=x||(x=s)),V<u?function(t,e,n,r){return r?t>=e+n:t<=-n}(s,x,c,S)&&E():(g.stop(),p&&p()))}return o&&(null==f||f(),g=a(C),g.start()),{stop:()=>{null==d||d(),g.stop()}}}function Zt(t,e){return e?t*(1e3/e):0}const qt=(t,e)=>1-3*e+3*t,Kt=(t,e)=>3*e-6*t,Gt=t=>3*t,Jt=(t,e,n)=>((qt(e,n)*t+Kt(e,n))*t+Gt(e))*t,_t=(t,e,n)=>3*qt(e,n)*t*t+2*Kt(e,n)*t+Gt(e);function Qt(t,e,n,r){if(t===e&&n===r)return pt;const o=new Float32Array(11);for(let e=0;e<11;++e)o[e]=Jt(.1*e,t,n);function a(e){let r=0,a=1;for(;10!==a&&o[a]<=e;++a)r+=.1;--a;const i=r+.1*((e-o[a])/(o[a+1]-o[a])),s=_t(i,t,n);return s>=.001?function(t,e,n,r){for(let o=0;o<8;++o){const o=_t(e,n,r);if(0===o)return e;e-=(Jt(e,n,r)-t)/o}return e}(e,i,t,n):0===s?i:function(t,e,n,r,o){let a,i,s=0;do{i=e+(n-e)/2,a=Jt(i,r,o)-t,a>0?n=i:e=i}while(Math.abs(a)>1e-7&&++s<10);return i}(e,r,r+.1,t,n)}return t=>0===t||1===t?t:Jt(a(t),e,r)}var te=function(t){return 1e3*t},ee={linear:pt,easeIn:vt,easeInOut:gt,easeOut:ht,circIn:yt,circInOut:wt,circOut:bt,backIn:At,backInOut:xt,backOut:Vt,anticipate:Ot,bounceIn:Mt,bounceInOut:t=>t<.5?.5*(1-St(1-2*t)):.5*St(2*t-1)+.5,bounceOut:St},ne=function(t){if(Array.isArray(t)){t.length;var e=s(t,4);return Qt(e[0],e[1],e[2],e[3])}return"string"==typeof t?ee[t]:t};const re=(t,e)=>n=>Math.max(Math.min(n,e),t),oe=t=>t%1?Number(t.toFixed(5)):t,ae=/(-)?([\d]*\.?[\d])+/g,ie=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))/gi,se=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))$/i;function ue(t){return"string"==typeof t}const le={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},ce=Object.assign(Object.assign({},le),{transform:re(0,1)}),fe=Object.assign(Object.assign({},le),{default:1}),de=t=>({test:e=>ue(e)&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),pe=de("deg"),ve=de("%"),me=de("px"),he=de("vh"),ge=de("vw"),ye=Object.assign(Object.assign({},ve),{parse:t=>ve.parse(t)/100,transform:t=>ve.transform(100*t)}),be=(t,e)=>n=>Boolean(ue(n)&&se.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),we=(t,e,n)=>r=>{if(!ue(r))return r;const[o,a,i,s]=r.match(ae);return{[t]:parseFloat(o),[e]:parseFloat(a),[n]:parseFloat(i),alpha:void 0!==s?parseFloat(s):1}},Ae={test:be("hsl","hue"),parse:we("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+ve.transform(oe(e))+", "+ve.transform(oe(n))+", "+oe(ce.transform(r))+")"},Ve=re(0,255),xe=Object.assign(Object.assign({},le),{transform:t=>Math.round(Ve(t))}),Oe={test:be("rgb","red"),parse:we("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+xe.transform(t)+", "+xe.transform(e)+", "+xe.transform(n)+", "+oe(ce.transform(r))+")"};const Se={test:be("#"),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:Oe.transform},Me={test:t=>Oe.test(t)||Se.test(t)||Ae.test(t),parse:t=>Oe.test(t)?Oe.parse(t):Ae.test(t)?Ae.parse(t):Se.parse(t),transform:t=>ue(t)?t:t.hasOwnProperty("red")?Oe.transform(t):Ae.transform(t)};function Te(t){"number"==typeof t&&(t=""+t);const e=[];let n=0;const r=t.match(ie);r&&(n=r.length,t=t.replace(ie,"${c}"),e.push(...r.map(Me.parse)));const o=t.match(ae);return o&&(t=t.replace(ae,"${n}"),e.push(...o.map(le.parse))),{values:e,numColors:n,tokenised:t}}function Ee(t){return Te(t).values}function Ce(t){const{values:e,numColors:n,tokenised:r}=Te(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?Me.transform(t[r]):oe(t[r]));return e}}const Pe=t=>"number"==typeof t?0:t;const ke={test:function(t){var e,n,r,o;return isNaN(t)&&ue(t)&&(null!==(n=null===(e=t.match(ae))||void 0===e?void 0:e.length)&&void 0!==n?n:0)+(null!==(o=null===(r=t.match(ie))||void 0===r?void 0:r.length)&&void 0!==o?o:0)>0},parse:Ee,createTransformer:Ce,getAnimatableNone:function(t){const e=Ee(t);return Ce(t)(e.map(Pe))}},Fe=new Set(["brightness","contrast","saturate","opacity"]);function Ie(t){let[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[r]=n.match(ae)||[];if(!r)return t;const o=n.replace(r,"");let a=Fe.has(e)?1:0;return r!==n&&(a*=100),e+"("+a+o+")"}const je=/([a-z-]*)\(.*?\)/g,Re=Object.assign(Object.assign({},ke),{getAnimatableNone:t=>{const e=t.match(je);return e?e.map(Ie).join(" "):t}});var De=function(t,e){return"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!ke.test(e)||e.startsWith("url(")))},Be=function(){return{type:"spring",stiffness:500,damping:25,restSpeed:10}},Le=function(t){return{type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restSpeed:10}},Ne=function(){return{type:"keyframes",ease:"linear",duration:.3}},Ue=function(t){return{type:"keyframes",duration:.8,values:t}},Ye={x:Be,y:Be,z:Be,rotate:Be,rotateX:Be,rotateY:Be,rotateZ:Be,scaleX:Le,scaleY:Le,scale:Le,opacity:Ne,backgroundColor:Ne,color:Ne,default:Le},$e=a(a({},le),{transform:Math.round}),ze={borderWidth:me,borderTopWidth:me,borderRightWidth:me,borderBottomWidth:me,borderLeftWidth:me,borderRadius:me,radius:me,borderTopLeftRadius:me,borderTopRightRadius:me,borderBottomRightRadius:me,borderBottomLeftRadius:me,width:me,maxWidth:me,height:me,maxHeight:me,size:me,top:me,right:me,bottom:me,left:me,padding:me,paddingTop:me,paddingRight:me,paddingBottom:me,paddingLeft:me,margin:me,marginTop:me,marginRight:me,marginBottom:me,marginLeft:me,rotate:pe,rotateX:pe,rotateY:pe,rotateZ:pe,scale:fe,scaleX:fe,scaleY:fe,scaleZ:fe,skew:pe,skewX:pe,skewY:pe,distance:me,translateX:me,translateY:me,translateZ:me,x:me,y:me,z:me,perspective:me,transformPerspective:me,opacity:ce,originX:ye,originY:ye,originZ:me,zIndex:$e,fillOpacity:ce,strokeOpacity:ce,numOctaves:$e},We=a(a({},ze),{color:Me,backgroundColor:Me,outlineColor:Me,fill:Me,stroke:Me,borderColor:Me,borderTopColor:Me,borderRightColor:Me,borderBottomColor:Me,borderLeftColor:Me,filter:Re,WebkitFilter:Re}),Xe=function(t){return We[t]};function He(t,e){var n,r=Xe(t);return r!==Re&&(r=ke),null===(n=r.getAnimatableNone)||void 0===n?void 0:n.call(r,e)}var Ze=!1,qe=function(t){return f(t)?t[t.length-1]||0:t};function Ke(t){var e=t.ease,n=t.times,r=t.yoyo,o=t.flip,s=t.loop,u=i(t,["ease","times","yoyo","flip","loop"]),l=a({},u);return n&&(l.offset=n),u.duration&&(l.duration=te(u.duration)),u.repeatDelay&&(l.repeatDelay=te(u.repeatDelay)),e&&(l.ease=function(t){return Array.isArray(t)&&"number"!=typeof t[0]}(e)?e.map(ne):ne(e)),"tween"===u.type&&(l.type="keyframes"),(r||s||o)&&(r?l.repeatType="reverse":s?l.repeatType="loop":o&&(l.repeatType="mirror"),l.repeat=s||r||o||u.repeat),"spring"!==u.type&&(l.type="keyframes"),l}function Ge(t,e,n){var r,o,l,c;return Array.isArray(e.to)&&(null!==(r=t.duration)&&void 0!==r||(t.duration=.8)),function(t){Array.isArray(t.to)&&null===t.to[0]&&(t.to=u([],s(t.to),!1),t.to[0]=t.from)}(e),function(t){t.when,t.delay,t.delayChildren,t.staggerChildren,t.staggerDirection,t.repeat,t.repeatType,t.repeatDelay,t.from;var e=i(t,["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from"]);return!!Object.keys(e).length}(t)||(t=a(a({},t),(o=n,l=e.to,c=f(l)?Ue:Ye[o]||Ye.default,a({to:l},c(l))))),a(a({},e),Ke(t))}function Je(t,e,n,r,o){var i,s=tn(r,t),u=null!==(i=s.from)&&void 0!==i?i:e.get(),l=De(t,n);return"none"===u&&l&&"string"==typeof n?u=He(t,n):_e(u)&&"string"==typeof n?u=Qe(n):!Array.isArray(n)&&_e(n)&&"string"==typeof u&&(n=Qe(u)),De(t,u)&&l&&!1!==s.type?function(){var r={from:u,to:n,velocity:e.getVelocity(),onComplete:o,onUpdate:function(t){return 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:a=750,bounceStiffness:i=500,bounceDamping:s=10,restDelta:u=1,modifyTarget:l,driver:c,onUpdate:f,onComplete:d,onStop:p}){let v;function m(t){return void 0!==n&&t<n||void 0!==r&&t>r}function h(t){return void 0===n?r:void 0===r||Math.abs(n-t)<Math.abs(r-t)?n:r}function g(t){null==v||v.stop(),v=Ht(Object.assign(Object.assign({},t),{driver:c,onUpdate:e=>{var n;null==f||f(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:d,onStop:p}))}function y(t){g(Object.assign({type:"spring",stiffness:i,damping:s,restDelta:u},t))}if(m(t))y({from:t,velocity:e,to:h(t)});else{let r=o*e+t;void 0!==l&&(r=l(r));const i=h(r),s=i===n?-1:1;let c,f;const d=t=>{c=f,f=t,e=Zt(t-c,zt().delta),(1===s&&t>i||-1===s&&t<i)&&y({from:t,to:i,velocity:e})};g({type:"decay",from:t,velocity:e,timeConstant:a,power:o,restDelta:u,modifyTarget:l,onUpdate:m(r)?d:void 0})}return{stop:()=>null==v?void 0:v.stop()}}(a(a({},r),s)):Ht(a(a({},Ge(s,r,t)),{onUpdate:function(t){var e;r.onUpdate(t),null===(e=s.onUpdate)||void 0===e||e.call(s,t)},onComplete:function(){var t;r.onComplete(),null===(t=s.onComplete)||void 0===t||t.call(s)}}))}:function(){var t,r,a=qe(n);return e.set(a),o(),null===(t=null==s?void 0:s.onUpdate)||void 0===t||t.call(s,a),null===(r=null==s?void 0:s.onComplete)||void 0===r||r.call(s),{stop:function(){}}}}function _e(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function Qe(t){return"number"==typeof t?0:He("",t)}function tn(t,e){return t[e]||t.default||t}function en(t,e,n,r){return void 0===r&&(r={}),Ze&&(r={type:!1}),e.start((function(o){var a,i,s=Je(t,e,n,r,o),u=function(t,e){var n,r;return null!==(r=null!==(n=(tn(t,e)||{}).delay)&&void 0!==n?n:t.delay)&&void 0!==r?r:0}(r,t),l=function(){return i=s()};return u?a=window.setTimeout(l,te(u)):l(),function(){clearTimeout(a),null==i||i.stop()}}))}var nn=function(t){return/^0[^.\s]+$/.test(t)};var rn=function(){function t(){this.subscriptions=[]}return t.prototype.add=function(t){var e,n,r=this;return e=this.subscriptions,n=t,-1===e.indexOf(n)&&e.push(n),function(){return function(t,e){var n=t.indexOf(e);n>-1&&t.splice(n,1)}(r.subscriptions,t)}},t.prototype.notify=function(t,e,n){var r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](t,e,n);else for(var o=0;o<r;o++){var a=this.subscriptions[o];a&&a(t,e,n)}},t.prototype.getSize=function(){return this.subscriptions.length},t.prototype.clear=function(){this.subscriptions.length=0},t}(),on=function(){function t(t){var e,n=this;this.version="7.0.1",this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new rn,this.velocityUpdateSubscribers=new rn,this.renderSubscribers=new rn,this.canTrackVelocity=!1,this.updateAndNotify=function(t,e){void 0===e&&(e=!0),n.prev=n.current,n.current=t;var r=zt(),o=r.delta,a=r.timestamp;n.lastUpdated!==a&&(n.timeDelta=o,n.lastUpdated=a,Lt.postRender(n.scheduleVelocityCheck)),n.prev!==n.current&&n.updateSubscribers.notify(n.current),n.velocityUpdateSubscribers.getSize()&&n.velocityUpdateSubscribers.notify(n.getVelocity()),e&&n.renderSubscribers.notify(n.current)},this.scheduleVelocityCheck=function(){return Lt.postRender(n.velocityCheck)},this.velocityCheck=function(t){t.timestamp!==n.lastUpdated&&(n.prev=n.current,n.velocityUpdateSubscribers.notify(n.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e)))}return t.prototype.onChange=function(t){return this.updateSubscribers.add(t)},t.prototype.clearListeners=function(){this.updateSubscribers.clear()},t.prototype.onRenderRequest=function(t){return t(this.get()),this.renderSubscribers.add(t)},t.prototype.attach=function(t){this.passiveEffect=t},t.prototype.set=function(t,e){void 0===e&&(e=!0),e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)},t.prototype.get=function(){return this.current},t.prototype.getPrevious=function(){return this.prev},t.prototype.getVelocity=function(){return this.canTrackVelocity?Zt(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0},t.prototype.start=function(t){var e=this;return this.stop(),new Promise((function(n){e.hasAnimated=!0,e.stopAnimation=t(n)})).then((function(){return e.clearAnimation()}))},t.prototype.stop=function(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()},t.prototype.isAnimating=function(){return!!this.stopAnimation},t.prototype.clearAnimation=function(){this.stopAnimation=null},t.prototype.destroy=function(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()},t}();function an(t){return new on(t)}var sn=function(t){return function(e){return e.test(t)}},un=[le,me,ve,pe,ge,he,{test:function(t){return"auto"===t},parse:function(t){return t}}],ln=function(t){return un.find(sn(t))},cn=u(u([],s(un),!1),[Me,ke],!1),fn=function(t){return cn.find(sn(t))};function dn(t){return Array.isArray(t)}function pn(t){return"string"==typeof t||dn(t)}function vn(t,e,n){var r=t.getProps();return function(t,e,n,r,o){var a;return void 0===r&&(r={}),void 0===o&&(o={}),"function"==typeof e&&(e=e(null!=n?n:t.custom,r,o)),"string"==typeof e&&(e=null===(a=t.variants)||void 0===a?void 0:a[e]),"function"==typeof e&&(e=e(null!=n?n:t.custom,r,o)),e}(r,e,null!=n?n:r.custom,function(t){var e={};return t.forEachValue((function(t,n){return e[n]=t.get()})),e}(t),function(t){var e={};return t.forEachValue((function(t,n){return e[n]=t.getVelocity()})),e}(t))}function mn(t){var e;return"function"==typeof(null===(e=t.animate)||void 0===e?void 0:e.start)||pn(t.initial)||pn(t.animate)||pn(t.whileHover)||pn(t.whileDrag)||pn(t.whileTap)||pn(t.whileFocus)||pn(t.exit)}function hn(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,an(n))}function gn(t,e){if(e)return(e[t]||e.default||e).from}var yn=["","X","Y","Z"],bn=["transformPerspective","x","y","z"];function wn(t,e){return bn.indexOf(t)-bn.indexOf(e)}["translate","scale","rotate","skew"].forEach((function(t){return yn.forEach((function(e){return bn.push(t+e)}))}));var An=new Set(bn);function Vn(t){return An.has(t)}var xn,On=new Set(["originX","originY","originZ"]);function Sn(t){return On.has(t)}function Mn(t,e,n){var r;void 0===n&&(n={});var o=vn(t,e,n.custom),i=(o||{}).transition,u=void 0===i?t.getDefaultTransition()||{}:i;n.transitionOverride&&(u=n.transitionOverride);var l=o?function(){return Tn(t,o,n)}:function(){return Promise.resolve()},c=(null===(r=t.variantChildren)||void 0===r?void 0:r.size)?function(r){void 0===r&&(r=0);var o=u.delayChildren,i=void 0===o?0:o,s=u.staggerChildren,l=u.staggerDirection;return function(t,e,n,r,o,i){void 0===n&&(n=0);void 0===r&&(r=0);void 0===o&&(o=1);var s=[],u=(t.variantChildren.size-1)*r,l=1===o?function(t){return void 0===t&&(t=0),t*r}:function(t){return void 0===t&&(t=0),u-t*r};return Array.from(t.variantChildren).sort(En).forEach((function(t,r){s.push(Mn(t,e,a(a({},i),{delay:n+l(r)})).then((function(){return t.notifyAnimationComplete(e)})))})),Promise.all(s)}(t,e,i+r,s,l,n)}:function(){return Promise.resolve()},f=u.when;if(f){var d=s("beforeChildren"===f?[l,c]:[c,l],2),p=d[0],v=d[1];return p().then(v)}return Promise.all([l(),c(n.delay)])}function Tn(t,e,n){var r,o=void 0===n?{}:n,s=o.delay,u=void 0===s?0:s,l=o.transitionOverride,c=o.type,f=t.makeTargetAnimatable(e),d=f.transition,p=void 0===d?t.getDefaultTransition():d,v=f.transitionEnd,m=i(f,["transition","transitionEnd"]);l&&(p=l);var h=[],g=c&&(null===(r=t.animationState)||void 0===r?void 0:r.getState()[c]);for(var y in m){var b=t.getValue(y),w=m[y];if(!(!b||void 0===w||g&&Cn(g,y))){var A=a({delay:u},p);t.shouldReduceMotion&&Vn(y)&&(A=a(a({},A),{type:!1,delay:0}));var V=en(y,b,w,A);h.push(V)}}return Promise.all(h).then((function(){v&&function(t,e){var n=vn(t,e),r=n?t.makeTargetAnimatable(n,!1):{},o=r.transitionEnd,s=void 0===o?{}:o;r.transition;var u=i(r,["transitionEnd","transition"]);for(var l in u=a(a({},u),s)){hn(t,l,qe(u[l]))}}(t,v)}))}function En(t,e){return t.sortNodePosition(e)}function Cn(t,e){var n=t.protectedKeys,r=t.needsAnimating,o=n.hasOwnProperty(e)&&!0!==r[e];return r[e]=!1,o}!function(t){t.Animate="animate",t.Hover="whileHover",t.Tap="whileTap",t.Drag="whileDrag",t.Focus="whileFocus",t.InView="whileInView",t.Exit="exit"}(xn||(xn={}));var Pn=[xn.Animate,xn.InView,xn.Focus,xn.Hover,xn.Tap,xn.Drag,xn.Exit],kn=u([],s(Pn),!1).reverse(),Fn=Pn.length;function In(t){return function(e){return Promise.all(e.map((function(e){var n=e.animation,r=e.options;return function(t,e,n){var r;if(void 0===n&&(n={}),t.notifyAnimationStart(e),Array.isArray(e)){var o=e.map((function(e){return Mn(t,e,n)}));r=Promise.all(o)}else if("string"==typeof e)r=Mn(t,e,n);else{var a="function"==typeof e?vn(t,e,n.custom):e;r=Tn(t,a,n)}return r.then((function(){return t.notifyAnimationComplete(e)}))}(t,n,r)})))}}function jn(t){var e,n=In(t),r=((e={})[xn.Animate]=Rn(!0),e[xn.InView]=Rn(),e[xn.Hover]=Rn(),e[xn.Tap]=Rn(),e[xn.Drag]=Rn(),e[xn.Focus]=Rn(),e[xn.Exit]=Rn(),e),o={},c=!0,p=function(e,n){var r=vn(t,n);if(r){r.transition;var o=r.transitionEnd,s=i(r,["transition","transitionEnd"]);e=a(a(a({},e),s),o)}return e};function v(e,i){for(var v,m=t.getProps(),h=t.getVariantContext(!0)||{},g=[],y=new Set,b={},w=1/0,A=function(n){var o=kn[n],A=r[o],V=null!==(v=m[o])&&void 0!==v?v:h[o],x=pn(V),O=o===i?A.isActive:null;!1===O&&(w=n);var S=V===h[o]&&V!==m[o]&&x;if(S&&c&&t.manuallyAnimateOnMount&&(S=!1),A.protectedKeys=a({},b),!A.isActive&&null===O||!V&&!A.prevProp||l(V)||"boolean"==typeof V)return"continue";var M=function(t,e){if("string"==typeof e)return e!==t;if(dn(e))return!d(e,t);return!1}(A.prevProp,V),T=M||o===i&&A.isActive&&!S&&x||n>w&&x,E=Array.isArray(V)?V:[V],C=E.reduce(p,{});!1===O&&(C={});var P=A.prevResolvedValues,k=void 0===P?{}:P,F=a(a({},k),C),I=function(t){T=!0,y.delete(t),A.needsAnimating[t]=!0};for(var j in F){var R=C[j],D=k[j];b.hasOwnProperty(j)||(R!==D?f(R)&&f(D)?!d(R,D)||M?I(j):A.protectedKeys[j]=!0:void 0!==R?I(j):y.add(j):void 0!==R&&y.has(j)?I(j):A.protectedKeys[j]=!0)}A.prevProp=V,A.prevResolvedValues=C,A.isActive&&(b=a(a({},b),C)),c&&t.blockInitialAnimation&&(T=!1),T&&!S&&g.push.apply(g,u([],s(E.map((function(t){return{animation:t,options:a({type:o},e)}}))),!1))},V=0;V<Fn;V++)A(V);if(o=a({},b),y.size){var x={};y.forEach((function(e){var n=t.getBaseTarget(e);void 0!==n&&(x[e]=n)})),g.push({animation:x})}var O=Boolean(g.length);return c&&!1===m.initial&&!t.manuallyAnimateOnMount&&(O=!1),c=!1,O?n(g):Promise.resolve()}return{isAnimated:function(t){return void 0!==o[t]},animateChanges:v,setActive:function(e,n,o){var a;if(r[e].isActive===n)return Promise.resolve();null===(a=t.variantChildren)||void 0===a||a.forEach((function(t){var r;return null===(r=t.animationState)||void 0===r?void 0:r.setActive(e,n)})),r[e].isActive=n;var i=v(o,e);for(var s in r)r[s].protectedKeys={};return i},setAnimateFunction:function(e){n=e(t)},getState:function(){return r}}}function Rn(t){return void 0===t&&(t=!1),{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}var Dn=function(t){return function(e){return t(e),null}},Bn={animation:Dn((function(t){var e=t.visualElement,n=t.animate;e.animationState||(e.animationState=jn(e)),l(n)&&r((function(){return n.subscribe(e)}),[n])})),exit:Dn((function(t){var o=t.custom,a=t.visualElement,i=s(function(){var t=e(c);if(null===t)return[!0,null];var o=t.isPresent,a=t.onExitComplete,i=t.register,s=n();return r((function(){return i(s)}),[]),!o&&a?[!1,function(){return null==a?void 0:a(s)}]:[!0]}(),2),u=i[0],l=i[1],f=e(c);r((function(){var t,e;a.isPresent=u;var n=null===(t=a.animationState)||void 0===t?void 0:t.setActive(xn.Exit,!u,{custom:null!==(e=null==f?void 0:f.custom)&&void 0!==e?e:o});!u&&(null==n||n.then(l))}),[u])}))};function Ln(t,e,n,r){return void 0===r&&(r={passive:!0}),t.addEventListener(e,n,r),function(){return t.removeEventListener(e,n)}}function Nn(t,e,n,o){r((function(){var r=t.current;if(n&&r)return Ln(r,e,n,o)}),[t,e,n,o])}function Un(t){return!!t.touches}var Yn={pageX:0,pageY:0};function $n(t,e){void 0===e&&(e="page");var n=t.touches[0]||t.changedTouches[0]||Yn;return{x:n[e+"X"],y:n[e+"Y"]}}function zn(t,e){return void 0===e&&(e="page"),{x:t[e+"X"],y:t[e+"Y"]}}var Wn=function(t,e){void 0===e&&(e=!1);var n,r=function(e){return t(e,function(t,e){return void 0===e&&(e="page"),{point:Un(t)?$n(t,e):zn(t,e)}}(e))};return e?(n=r,function(t){var e=t instanceof MouseEvent;(!e||e&&0===t.button)&&n(t)}):r},Xn="undefined"!=typeof document,Hn={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},Zn={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function qn(t){return Xn&&null===window.onpointerdown?t:Xn&&null===window.ontouchstart?Zn[t]:Xn&&null===window.onmousedown?Hn[t]:t}function Kn(t,e,n,r){return Ln(t,qn(e),Wn(n,"pointerdown"===e),r)}function Gn(t,e,n,r){return Nn(t,qn(e),n&&Wn(n,"pointerdown"===e),r)}function Jn(t){var e=null;return function(){return null===e&&(e=t,function(){e=null})}}var _n=Jn("dragHorizontal"),Qn=Jn("dragVertical");function tr(){var t=function(t){var e=!1;if("y"===t)e=Qn();else if("x"===t)e=_n();else{var n=_n(),r=Qn();n&&r?e=function(){n(),r()}:(n&&n(),r&&r())}return e}(!0);return!t||(t(),!1)}function er(t,e,n){return function(r,o){var a;(function(t){return"undefined"!=typeof PointerEvent&&t instanceof PointerEvent?!("mouse"!==t.pointerType):t instanceof MouseEvent})(r)&&!tr()&&(null===(a=t.animationState)||void 0===a||a.setActive(xn.Hover,e),null==n||n(r,o))}}var nr=function(t,e){return!!e&&(t===e||nr(t,e.parentElement))};var rr=("undefined"==typeof process||process.env,"production"),or=new Set;var ar=new WeakMap,ir=new WeakMap,sr=function(t){var e;null===(e=ar.get(t.target))||void 0===e||e(t)},ur=function(t){t.forEach(sr)};function lr(t,e,n){var r=function(t){var e=t.root,n=i(t,["root"]),r=e||document;ir.has(r)||ir.set(r,{});var o=ir.get(r),s=JSON.stringify(n);return o[s]||(o[s]=new IntersectionObserver(ur,a({root:e},n))),o[s]}(e);return ar.set(t,n),r.observe(t),function(){ar.delete(t),r.unobserve(t)}}var cr={some:0,all:1};function fr(t,e,n,o){var a=o.root,i=o.margin,s=o.amount,u=void 0===s?"some":s,l=o.once;r((function(){if(t){var r={root:null==a?void 0:a.current,rootMargin:i,threshold:"number"==typeof u?u:cr[u]};return lr(n.getInstance(),r,(function(t){var r,o=t.isIntersecting;if(e.isInView!==o&&(e.isInView=o,!l||o||!e.hasEnteredView)){o&&(e.hasEnteredView=!0),null===(r=n.animationState)||void 0===r||r.setActive(xn.InView,o);var a=n.getProps(),i=o?a.onViewportEnter:a.onViewportLeave;null==i||i(t)}}))}}),[t,a,i,u])}function dr(t,e,n,o){var a=o.fallback,i=void 0===a||a;r((function(){var r,o;t&&i&&("production"!==rr&&(r="IntersectionObserver not available on this device. whileInView animations will trigger on mount.",!1||or.has(r)||(console.warn(r),o&&console.warn(o),or.add(r))),requestAnimationFrame((function(){var t;e.hasEnteredView=!0;var r=n.getProps().onViewportEnter;null==r||r(null),null===(t=n.animationState)||void 0===t||t.setActive(xn.InView,!0)})))}),[t])}var pr={inView:Dn((function(t){var e=t.visualElement,n=t.whileInView,r=t.onViewportEnter,a=t.onViewportLeave,i=t.viewport,s=void 0===i?{}:i,u=o({hasEnteredView:!1,isInView:!1}),l=Boolean(n||r||a);s.once&&u.current.hasEnteredView&&(l=!1),("undefined"==typeof IntersectionObserver?dr:fr)(l,u.current,e,s)})),tap:Dn((function(t){var e,n=t.onTap,a=t.onTapStart,i=t.onTapCancel,s=t.whileTap,u=t.visualElement,l=n||a||i||s,c=o(!1),f=o(null),d={passive:!(a||n||i||g)};function p(){var t;null===(t=f.current)||void 0===t||t.call(f),f.current=null}function v(){var t;return p(),c.current=!1,null===(t=u.animationState)||void 0===t||t.setActive(xn.Tap,!1),!tr()}function m(t,e){v()&&(nr(u.getInstance(),t.target)?null==n||n(t,e):null==i||i(t,e))}function h(t,e){v()&&(null==i||i(t,e))}function g(t,e){var n;p(),c.current||(c.current=!0,f.current=et(Kn(window,"pointerup",m,d),Kn(window,"pointercancel",h,d)),null===(n=u.animationState)||void 0===n||n.setActive(xn.Tap,!0),null==a||a(t,e))}Gn(u,"pointerdown",l?g:void 0,d),e=p,r((function(){return function(){return e()}}),[])})),focus:Dn((function(t){var e=t.whileFocus,n=t.visualElement;Nn(n,"focus",e?function(){var t;null===(t=n.animationState)||void 0===t||t.setActive(xn.Focus,!0)}:void 0),Nn(n,"blur",e?function(){var t;null===(t=n.animationState)||void 0===t||t.setActive(xn.Focus,!1)}:void 0)})),hover:Dn((function(t){var e=t.onHoverStart,n=t.onHoverEnd,r=t.whileHover,o=t.visualElement;Gn(o,"pointerenter",e||r?er(o,!0,e):void 0,{passive:!e}),Gn(o,"pointerleave",n||r?er(o,!1,n):void 0,{passive:!n})}))},vr=function(t){return Boolean(null!==t&&"object"==typeof t&&t.getVelocity)},mr=["LayoutMeasure","BeforeLayoutMeasure","LayoutUpdate","ViewportBoxUpdate","Update","Render","AnimationComplete","LayoutAnimationComplete","AnimationStart","LayoutAnimationStart","SetAxisTarget","Unmount"];var hr=function(t){var e=t.treeType,n=void 0===e?"":e,r=t.build,o=t.getBaseTarget,i=t.makeTargetAnimatable,l=t.measureViewportBox,c=t.render,f=t.readValueFromInstance,d=t.removeValueFromRenderState,p=t.sortNodePosition,v=t.scrapeMotionValuesFromProps;return function(t,e){var m=t.parent,h=t.props,g=t.presenceId,y=t.blockInitialAnimation,b=t.visualState,w=t.shouldReduceMotion;void 0===e&&(e={});var A,V,x=!1,O=b.latestValues,S=b.renderState,M=function(){var t=mr.map((function(){return new rn})),e={},n={clearAllListeners:function(){return t.forEach((function(t){return t.clear()}))},updatePropListeners:function(t){mr.forEach((function(r){var o,a="on"+r,i=t[a];null===(o=e[r])||void 0===o||o.call(e),i&&(e[r]=n[a](i))}))}};return t.forEach((function(t,e){n["on"+mr[e]]=function(e){return t.add(e)},n["notify"+mr[e]]=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.notify.apply(t,u([],s(e),!1))}})),n}(),T=new Map,E=new Map,C={},P=a({},O);function k(){A&&x&&(F(),c(A,S,h.style,U.projection))}function F(){r(U,S,O,e,h)}function I(){M.notifyUpdate(O)}function j(t,e){var n=e.onChange((function(e){O[t]=e,h.onUpdate&&Lt.update(I,!1,!0)})),r=e.onRenderRequest(U.scheduleRender);E.set(t,(function(){n(),r()}))}var R=v(h);for(var D in R){var B=R[D];void 0!==O[D]&&vr(B)&&B.set(O[D],!1)}var L=mn(h),N=function(t){return Boolean(mn(t)||t.variants)}(h),U=a(a({treeType:n,current:null,depth:m?m.depth+1:0,parent:m,children:new Set,presenceId:g,shouldReduceMotion:w,variantChildren:N?new Set:void 0,isVisible:void 0,manuallyAnimateOnMount:Boolean(null==m?void 0:m.isMounted()),blockInitialAnimation:y,isMounted:function(){return Boolean(A)},mount:function(t){x=!0,A=U.current=t,U.projection&&U.projection.mount(t),N&&m&&!L&&(V=null==m?void 0:m.addVariantChild(U)),T.forEach((function(t,e){return j(e,t)})),null==m||m.children.add(U),U.setProps(h)},unmount:function(){var t;null===(t=U.projection)||void 0===t||t.unmount(),Nt.update(I),Nt.render(k),E.forEach((function(t){return t()})),null==V||V(),null==m||m.children.delete(U),M.clearAllListeners(),A=void 0,x=!1},addVariantChild:function(t){var e,n=U.getClosestVariantNode();if(n)return null===(e=n.variantChildren)||void 0===e||e.add(t),function(){return n.variantChildren.delete(t)}},sortNodePosition:function(t){return p&&n===t.treeType?p(U.getInstance(),t.getInstance()):0},getClosestVariantNode:function(){return N?U:null==m?void 0:m.getClosestVariantNode()},getLayoutId:function(){return h.layoutId},getInstance:function(){return A},getStaticValue:function(t){return O[t]},setStaticValue:function(t,e){return O[t]=e},getLatestValues:function(){return O},setVisibility:function(t){U.isVisible!==t&&(U.isVisible=t,U.scheduleRender())},makeTargetAnimatable:function(t,e){return void 0===e&&(e=!0),i(U,t,h,e)},measureViewportBox:function(){return l(A,h)},addValue:function(t,e){U.hasValue(t)&&U.removeValue(t),T.set(t,e),O[t]=e.get(),j(t,e)},removeValue:function(t){var e;T.delete(t),null===(e=E.get(t))||void 0===e||e(),E.delete(t),delete O[t],d(t,S)},hasValue:function(t){return T.has(t)},getValue:function(t,e){var n=T.get(t);return void 0===n&&void 0!==e&&(n=an(e),U.addValue(t,n)),n},forEachValue:function(t){return T.forEach(t)},readValue:function(t){var n;return null!==(n=O[t])&&void 0!==n?n:f(A,t,e)},setBaseTarget:function(t,e){P[t]=e},getBaseTarget:function(t){if(o){var e=o(h,t);if(void 0!==e&&!vr(e))return e}return P[t]}},M),{build:function(){return F(),S},scheduleRender:function(){Lt.render(k,!1,!0)},syncRender:k,setProps:function(t){(t.transformTemplate||h.transformTemplate)&&U.scheduleRender(),h=t,M.updatePropListeners(t),C=function(t,e,n){var r;for(var o in e){var a=e[o],i=n[o];if(vr(a))t.addValue(o,a);else if(vr(i))t.addValue(o,an(a));else if(i!==a)if(t.hasValue(o)){var s=t.getValue(o);!s.hasAnimated&&s.set(a)}else t.addValue(o,an(null!==(r=t.getStaticValue(o))&&void 0!==r?r:a))}for(var o in n)void 0===e[o]&&t.removeValue(o);return e}(U,v(h),C)},getProps:function(){return h},getVariant:function(t){var e;return null===(e=h.variants)||void 0===e?void 0:e[t]},getDefaultTransition:function(){return h.transition},getTransformPagePoint:function(){return h.transformPagePoint},getVariantContext:function(t){if(void 0===t&&(t=!1),t)return null==m?void 0:m.getVariantContext();if(!L){var e=(null==m?void 0:m.getVariantContext())||{};return void 0!==h.initial&&(e.initial=h.initial),e}for(var n={},r=0;r<yr;r++){var o=gr[r],a=h[o];(pn(a)||!1===a)&&(n[o]=a)}return n}});return U}},gr=u(["initial"],s(Pn),!1),yr=gr.length,br={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};function wr(t){return t.startsWith("--")}var Ar=function(t,e){return e&&"number"==typeof t?e.transform(t):t};function Vr(t,e,n,r){var o,a=t.style,i=t.vars,s=t.transform,u=t.transformKeys,l=t.transformOrigin;u.length=0;var c=!1,f=!1,d=!0;for(var p in e){var v=e[p];if(wr(p))i[p]=v;else{var m=ze[p],h=Ar(v,m);if(Vn(p)){if(c=!0,s[p]=h,u.push(p),!d)continue;v!==(null!==(o=m.default)&&void 0!==o?o:0)&&(d=!1)}else Sn(p)?(l[p]=h,f=!0):a[p]=h}}c?a.transform=function(t,e,n,r){var o=t.transform,a=t.transformKeys,i=e.enableHardwareAcceleration,s=void 0===i||i,u=e.allowTransformNone,l=void 0===u||u,c="";a.sort(wn);for(var f=!1,d=a.length,p=0;p<d;p++){var v=a[p];c+="".concat(br[v]||v,"(").concat(o[v],") "),"z"===v&&(f=!0)}return!f&&s?c+="translateZ(0)":c=c.trim(),r?c=r(o,n?"":c):l&&n&&(c="none"),c}(t,n,d,r):r?a.transform=r({},""):!e.transform&&a.transform&&(a.transform="none"),f&&(a.transformOrigin=function(t){var e=t.originX,n=void 0===e?"50%":e,r=t.originY,o=void 0===r?"50%":r,a=t.originZ,i=void 0===a?0:a;return"".concat(n," ").concat(o," ").concat(i)}(l))}function xr(t){return"string"==typeof t&&t.startsWith("var(--")}var Or=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function Sr(t,e,n){var r=s(function(t){var e=Or.exec(t);if(!e)return[,];var n=s(e,3);return[n[1],n[2]]}(t),2),o=r[0],a=r[1];if(o){var i=window.getComputedStyle(e).getPropertyValue(o);return i?i.trim():xr(a)?Sr(a,e):a}}var Mr,Tr=new Set(["width","height","top","left","right","bottom","x","y"]),Er=function(t){return Tr.has(t)},Cr=function(t,e){t.set(e,!1),t.set(e)},Pr=function(t){return t===le||t===me};!function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"}(Mr||(Mr={}));var kr=function(t,e){return parseFloat(t.split(", ")[e])},Fr=function(t,e){return function(n,r){var o=r.transform;if("none"===o||!o)return 0;var a=o.match(/^matrix3d\((.+)\)$/);if(a)return kr(a[1],e);var i=o.match(/^matrix\((.+)\)$/);return i?kr(i[1],t):0}},Ir=new Set(["x","y","z"]),jr=bn.filter((function(t){return!Ir.has(t)}));var Rr={width:function(t,e){var n=t.x,r=e.paddingLeft,o=void 0===r?"0":r,a=e.paddingRight,i=void 0===a?"0":a;return n.max-n.min-parseFloat(o)-parseFloat(i)},height:function(t,e){var n=t.y,r=e.paddingTop,o=void 0===r?"0":r,a=e.paddingBottom,i=void 0===a?"0":a;return n.max-n.min-parseFloat(o)-parseFloat(i)},top:function(t,e){var n=e.top;return parseFloat(n)},left:function(t,e){var n=e.left;return parseFloat(n)},bottom:function(t,e){var n=t.y,r=e.top;return parseFloat(r)+(n.max-n.min)},right:function(t,e){var n=t.x,r=e.left;return parseFloat(r)+(n.max-n.min)},x:Fr(4,13),y:Fr(5,14)},Dr=function(t,e,n,r){void 0===n&&(n={}),void 0===r&&(r={}),e=a({},e),r=a({},r);var o=Object.keys(e).filter(Er),i=[],u=!1,l=[];if(o.forEach((function(o){var a=t.getValue(o);if(t.hasValue(o)){var s,c=n[o],d=ln(c),p=e[o];if(f(p)){var v=p.length,m=null===p[0]?1:0;c=p[m],d=ln(c);for(var h=m;h<v;h++)s?ln(p[h]):s=ln(p[h])}else s=ln(p);if(d!==s)if(Pr(d)&&Pr(s)){var g=a.get();"string"==typeof g&&a.set(parseFloat(g)),"string"==typeof p?e[o]=parseFloat(p):Array.isArray(p)&&s===me&&(e[o]=p.map(parseFloat))}else(null==d?void 0:d.transform)&&(null==s?void 0:s.transform)&&(0===c||0===p)?0===c?a.set(s.transform(c)):e[o]=d.transform(p):(u||(i=function(t){var e=[];return jr.forEach((function(n){var r=t.getValue(n);void 0!==r&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))})),e.length&&t.syncRender(),e}(t),u=!0),l.push(o),r[o]=void 0!==r[o]?r[o]:e[o],Cr(a,p))}})),l.length){var c=l.indexOf("height")>=0?window.pageYOffset:null,d=function(t,e,n){var r=e.measureViewportBox(),o=e.getInstance(),a=getComputedStyle(o),i=a.display,s={};"none"===i&&e.setStaticValue("display",t.display||"block"),n.forEach((function(t){s[t]=Rr[t](r,a)})),e.syncRender();var u=e.measureViewportBox();return n.forEach((function(n){var r=e.getValue(n);Cr(r,s[n]),t[n]=Rr[n](u,a)})),t}(e,t,l);return i.length&&i.forEach((function(e){var n=s(e,2),r=n[0],o=n[1];t.getValue(r).set(o)})),t.syncRender(),null!==c&&window.scrollTo({top:c}),{target:d,transitionEnd:r}}return{target:e,transitionEnd:r}};function Br(t,e,n,r){return function(t){return Object.keys(t).some(Er)}(e)?Dr(t,e,n,r):{target:e,transitionEnd:r}}var Lr=function(t,e,n,r){var o=function(t,e,n){var r,o=i(e,[]),s=t.getInstance();if(!(s instanceof Element))return{target:o,transitionEnd:n};for(var u in n&&(n=a({},n)),t.forEachValue((function(t){var e=t.get();if(xr(e)){var n=Sr(e,s);n&&t.set(n)}})),o){var l=o[u];if(xr(l)){var c=Sr(l,s);c&&(o[u]=c,n&&(null!==(r=n[u])&&void 0!==r||(n[u]=l)))}}return{target:o,transitionEnd:n}}(t,e,r);return Br(t,e=o.target,n,r=o.transitionEnd)},Nr={};function Ur(t,e){var n=e.layout,r=e.layoutId;return Vn(t)||Sn(t)||(n||void 0!==r)&&(!!Nr[t]||"opacity"===t)}function Yr(t){var e=t.style,n={};for(var r in e)(vr(e[r])||Ur(r,t))&&(n[r]=e[r]);return n}function $r(t,e,n,r){var o=e.style,a=e.vars;for(var i in Object.assign(t.style,o,r&&r.getProjectionStyles(n)),a)t.style.setProperty(i,a[i])}var zr={treeType:"dom",readValueFromInstance:function(t,e){if(Vn(e)){var n=Xe(e);return n&&n.default||0}var r,o=(r=t,window.getComputedStyle(r));return(wr(e)?o.getPropertyValue(e):o[e])||0},sortNodePosition:function(t,e){return 2&t.compareDocumentPosition(e)?1:-1},getBaseTarget:function(t,e){var n;return null===(n=t.style)||void 0===n?void 0:n[e]},measureViewportBox:function(t,e){return function(t,e){return n=function(t,e){if(!e)return t;var 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),r=n.top,{x:{min:n.left,max:n.right},y:{min:r,max:n.bottom}};var n,r}(t,e.transformPagePoint)},resetTransform:function(t,e,n){var r=n.transformTemplate;e.style.transform=r?r({},""):"none",t.scheduleRender()},restoreTransform:function(t,e){t.style.transform=e.style.transform},removeValueFromRenderState:function(t,e){var n=e.vars,r=e.style;delete n[t],delete r[t]},makeTargetAnimatable:function(t,e,n,r){var o=e.transition,s=e.transitionEnd,u=i(e,["transition","transitionEnd"]),l=n.transformValues;void 0===r&&(r=!0);var c=function(t,e,n){var r,o,a={};for(var i in t)a[i]=null!==(r=gn(i,e))&&void 0!==r?r:null===(o=n.getValue(i))||void 0===o?void 0:o.get();return a}(u,o||{},t);if(l&&(s&&(s=l(s)),u&&(u=l(u)),c&&(c=l(c))),r){!function(t,e,n){var r,o,a,i,s=Object.keys(e).filter((function(e){return!t.hasValue(e)})),u=s.length;if(u)for(var l=0;l<u;l++){var c=s[l],f=e[c],d=null;Array.isArray(f)&&(d=f[0]),null===d&&(d=null!==(o=null!==(r=n[c])&&void 0!==r?r:t.readValue(c))&&void 0!==o?o:e[c]),null!=d&&("string"==typeof d&&(/^\-?\d*\.?\d+$/.test(d)||nn(d))?d=parseFloat(d):!fn(d)&&ke.test(f)&&(d=He(c,f)),t.addValue(c,an(d)),null!==(a=(i=n)[c])&&void 0!==a||(i[c]=d),t.setBaseTarget(c,d))}}(t,u,c);var f=Lr(t,u,c,s);s=f.transitionEnd,u=f.target}return a({transition:o,transitionEnd:s},u)},scrapeMotionValuesFromProps:Yr,build:function(t,e,n,r,o){void 0!==t.isVisible&&(e.style.visibility=t.isVisible?"visible":"hidden"),Vr(e,n,r,o.transformTemplate)},render:$r},Wr=hr(zr);function Xr(t,e,n){return"string"==typeof t?t:me.transform(e+n*t)}var Hr={offset:"stroke-dashoffset",array:"stroke-dasharray"},Zr={offset:"strokeDashoffset",array:"strokeDasharray"};function qr(t,e,n,r){var o=e.attrX,a=e.attrY,s=e.originX,u=e.originY,l=e.pathLength,c=e.pathSpacing,f=void 0===c?1:c,d=e.pathOffset,p=void 0===d?0:d;Vr(t,i(e,["attrX","attrY","originX","originY","pathLength","pathSpacing","pathOffset"]),n,r),t.attrs=t.style,t.style={};var v=t.attrs,m=t.style,h=t.dimensions;v.transform&&(h&&(m.transform=v.transform),delete v.transform),h&&(void 0!==s||void 0!==u||m.transform)&&(m.transformOrigin=function(t,e,n){var r=Xr(e,t.x,t.width),o=Xr(n,t.y,t.height);return"".concat(r," ").concat(o)}(h,void 0!==s?s:.5,void 0!==u?u:.5)),void 0!==o&&(v.x=o),void 0!==a&&(v.y=a),void 0!==l&&function(t,e,n,r,o){void 0===n&&(n=1),void 0===r&&(r=0),void 0===o&&(o=!0),t.pathLength=1;var a=o?Hr:Zr;t[a.offset]=me.transform(-r);var i=me.transform(e),s=me.transform(n);t[a.array]="".concat(i," ").concat(s)}(v,l,f,p,!1)}var Kr=/([a-z])([A-Z])/g,Gr=function(t){return t.replace(Kr,"$1-$2").toLowerCase()},Jr=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength"]);var _r=hr(a(a({},zr),{getBaseTarget:function(t,e){return t[e]},readValueFromInstance:function(t,e){var n;return Vn(e)?(null===(n=Xe(e))||void 0===n?void 0:n.default)||0:(e=Jr.has(e)?e:Gr(e),t.getAttribute(e))},scrapeMotionValuesFromProps:function(t){var e=Yr(t);for(var n in t){if(vr(t[n]))e["x"===n||"y"===n?"attr"+n.toUpperCase():n]=t[n]}return e},build:function(t,e,n,r,o){qr(e,n,r,o.transformTemplate)},render:function(t,e,n,r){for(var o in $r(t,e,void 0,r),e.attrs)t.setAttribute(Jr.has(o)?o:Gr(o),e.attrs[o])}})),Qr=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view"];var to=a(a({renderer:function(t,e){return function(t){return"string"==typeof t&&!t.includes("-")&&!!(Qr.indexOf(t)>-1||/[A-Z]/.test(t))}(t)?_r(e,{enableHardwareAcceleration:!1}):Wr(e,{enableHardwareAcceleration:!0})}},Bn),pr);export{to as domAnimation};
|