framer-motion 7.3.0 → 7.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import t,{useEffect as e,useRef as n,useContext as i,useId as o,createElement as s}from"react";import{q as r,t as a,v as l,w as u,x as c,y as h,z as d,A as p,B as m,i as f,C as v,D as g,E as y,a as x,u as b,M as P,P as A,F as T,G as w,g as S,L as E,S as V,d as M,r as C,H as R,I as L,J as D,K as k,n as j,N as O,m as F,c as U,f as I,b as B,l as N,O as z,Q as $,p as G,h as H,R as W,T as Y,U as X,s as q,j as K,o as Z,k as _}from"./size-rollup-dom-max-assets.js";const J=(t,e)=>n=>Boolean(r(n)&&a.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),Q=(t,e,n)=>i=>{if(!r(i))return i;const[o,s,a,u]=i.match(l);return{[t]:parseFloat(o),[e]:parseFloat(s),[n]:parseFloat(a),alpha:void 0!==u?parseFloat(u):1}},tt={test:J("hsl","hue"),parse:Q("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+u.transform(c(e))+", "+u.transform(c(n))+", "+c(h.transform(i))+")"},et=p(0,255),nt=Object.assign(Object.assign({},d),{transform:t=>Math.round(et(t))}),it={test:J("rgb","red"),parse:Q("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+nt.transform(t)+", "+nt.transform(e)+", "+nt.transform(n)+", "+c(h.transform(i))+")"};const ot={test:J("#"),parse:function(t){let e="",n="",i="",o="";return t.length>5?(e=t.substr(1,2),n=t.substr(3,2),i=t.substr(5,2),o=t.substr(7,2)):(e=t.substr(1,1),n=t.substr(2,1),i=t.substr(3,1),o=t.substr(4,1),e+=e,n+=n,i+=i,o+=o),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:o?parseInt(o,16)/255:1}},transform:it.transform},st={test:t=>it.test(t)||ot.test(t)||tt.test(t),parse:t=>it.test(t)?it.parse(t):tt.test(t)?tt.parse(t):ot.parse(t),transform:t=>r(t)?t:t.hasOwnProperty("red")?it.transform(t):tt.transform(t)};function rt(t){"number"==typeof t&&(t=""+t);const e=[];let n=0;const i=t.match(m);i&&(n=i.length,t=t.replace(m,"${c}"),e.push(...i.map(st.parse)));const o=t.match(l);return o&&(t=t.replace(l,"${n}"),e.push(...o.map(d.parse))),{values:e,numColors:n,tokenised:t}}function at(t){return rt(t).values}function lt(t){const{values:e,numColors:n,tokenised:i}=rt(t),o=e.length;return t=>{let e=i;for(let i=0;i<o;i++)e=e.replace(i<n?"${c}":"${n}",i<n?st.transform(t[i]):c(t[i]));return e}}const ut=t=>"number"==typeof t?0:t;const ct={test:function(t){var e,n,i,o;return isNaN(t)&&r(t)&&(null!==(n=null===(e=t.match(l))||void 0===e?void 0:e.length)&&void 0!==n?n:0)+(null!==(o=null===(i=t.match(m))||void 0===i?void 0:i.length)&&void 0!==o?o:0)>0},parse:at,createTransformer:lt,getAnimatableNone:function(t){const e=at(t);return lt(t)(e.map(ut))}},ht=new Set(["brightness","contrast","saturate","opacity"]);function dt(t){let[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(l)||[];if(!i)return t;const o=n.replace(i,"");let s=ht.has(e)?1:0;return i!==n&&(s*=100),e+"("+s+o+")"}const pt=/([a-z-]*)\(.*?\)/g,mt=Object.assign(Object.assign({},ct),{getAnimatableNone:t=>{const e=t.match(pt);return e?e.map(dt).join(" "):t}});function ft(t){return"undefined"!=typeof PointerEvent&&t instanceof PointerEvent?!("mouse"!==t.pointerType):t instanceof MouseEvent}function vt(t){return!!t.touches}const gt={pageX:0,pageY:0};function yt(t,e="page"){const n=t.touches[0]||t.changedTouches[0]||gt;return{x:n[e+"X"],y:n[e+"Y"]}}function xt(t,e="page"){return{x:t[e+"X"],y:t[e+"Y"]}}function bt(t,e="page"){return{point:vt(t)?yt(t,e):xt(t,e)}}const Pt=(t,e=!1)=>{const n=e=>t(e,bt(e));return e?(i=n,t=>{const e=t instanceof MouseEvent;(!e||e&&0===t.button)&&i(t)}):n;var i},At="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),Tt="undefined"!=typeof window?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(At()),1/60*1e3);let wt=!0,St=!1,Et=!1;const Vt={delta:0,timestamp:0},Mt=["read","update","preRender","render","postRender"],Ct=Mt.reduce((t,e)=>(t[e]=function(t){let e=[],n=[],i=0,o=!1,s=!1;const r=new WeakSet,a={schedule:(t,s=!1,a=!1)=>{const l=a&&o,u=l?e:n;return s&&r.add(t),-1===u.indexOf(t)&&(u.push(t),l&&o&&(i=e.length)),t},cancel:t=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1),r.delete(t)},process:l=>{if(o)s=!0;else{if(o=!0,[e,n]=[n,e],n.length=0,i=e.length,i)for(let n=0;n<i;n++){const i=e[n];i(l),r.has(i)&&(a.schedule(i),t())}o=!1,s&&(s=!1,a.process(l))}}};return a}(()=>St=!0),t),{}),Rt=Mt.reduce((t,e)=>{const n=Ct[e];return t[e]=(t,e=!1,i=!1)=>(St||Ot(),n.schedule(t,e,i)),t},{}),Lt=Mt.reduce((t,e)=>(t[e]=Ct[e].cancel,t),{}),Dt=Mt.reduce((t,e)=>(t[e]=()=>Ct[e].process(Vt),t),{}),kt=t=>Ct[t].process(Vt),jt=t=>{St=!1,Vt.delta=wt?1/60*1e3:Math.max(Math.min(t-Vt.timestamp,40),1),Vt.timestamp=t,Et=!0,Mt.forEach(kt),Et=!1,St&&(wt=!1,Tt(jt))},Ot=()=>{St=!0,wt=!0,Et||Tt(jt)},Ft=()=>Vt,Ut=t=>1e3*t;function It(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}function Bt(t,n,i,o){e(()=>{const e=t.current;if(i&&e)return It(e,n,i,o)},[t,n,i,o])}const Nt={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},zt={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function $t(t){return f&&null===window.onpointerdown?t:f&&null===window.ontouchstart?zt[t]:f&&null===window.onmousedown?Nt[t]:t}function Gt(t,e,n,i){return It(t,$t(e),Pt(n,"pointerdown"===e),i)}function Ht(t,e,n,i){return Bt(t,$t(e),n&&Pt(n,"pointerdown"===e),i)}function Wt(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(t);o<i.length;o++)e.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(t,i[o])&&(n[i[o]]=t[i[o]])}return n}const Yt=(t,e,n)=>Math.min(Math.max(n,t),e);function Xt({duration:t=800,bounce:e=.25,velocity:n=0,mass:i=1}){let o,s,r=1-e;r=Yt(.05,1,r),t=Yt(.01,10,t/1e3),r<1?(o=e=>{const i=e*r,o=i*t;return.001-(i-n)/qt(e,r)*Math.exp(-o)},s=e=>{const i=e*r*t,s=i*n+n,a=Math.pow(r,2)*Math.pow(e,2)*t,l=Math.exp(-i),u=qt(Math.pow(e,2),r);return(.001-o(e)>0?-1:1)*((s-a)*l)/u}):(o=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,s=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let i=n;for(let n=1;n<12;n++)i-=t(i)/e(i);return i}(o,s,5/t);if(t*=1e3,isNaN(a))return{stiffness:100,damping:10,duration:t};{const e=Math.pow(a,2)*i;return{stiffness:e,damping:2*r*Math.sqrt(i*e),duration:t}}}function qt(t,e){return t*Math.sqrt(1-e*e)}const Kt=["duration","bounce"],Zt=["stiffness","damping","mass"];function _t(t,e){return e.some(e=>void 0!==t[e])}function Jt(t){var{from:e=0,to:n=1,restSpeed:i=2,restDelta:o}=t,s=Wt(t,["from","to","restSpeed","restDelta"]);const r={done:!1,value:e};let{stiffness:a,damping:l,mass:u,velocity:c,duration:h,isResolvedFromDuration:d}=function(t){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},t);if(!_t(t,Zt)&&_t(t,Kt)){const n=Xt(t);e=Object.assign(Object.assign(Object.assign({},e),n),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}(s),p=Qt,m=Qt;function f(){const t=c?-c/1e3:0,i=n-e,s=l/(2*Math.sqrt(a*u)),r=Math.sqrt(a/u)/1e3;if(void 0===o&&(o=Math.min(Math.abs(n-e)/100,.4)),s<1){const e=qt(r,s);p=o=>{const a=Math.exp(-s*r*o);return n-a*((t+s*r*i)/e*Math.sin(e*o)+i*Math.cos(e*o))},m=n=>{const o=Math.exp(-s*r*n);return s*r*o*(Math.sin(e*n)*(t+s*r*i)/e+i*Math.cos(e*n))-o*(Math.cos(e*n)*(t+s*r*i)-e*i*Math.sin(e*n))}}else if(1===s)p=e=>n-Math.exp(-r*e)*(i+(t+r*i)*e);else{const e=r*Math.sqrt(s*s-1);p=o=>{const a=Math.exp(-s*r*o),l=Math.min(e*o,300);return n-a*((t+s*r*i)*Math.sinh(l)+e*i*Math.cosh(l))/e}}}return f(),{next:t=>{const e=p(t);if(d)r.done=t>=h;else{const s=1e3*m(t),a=Math.abs(s)<=i,l=Math.abs(n-e)<=o;r.done=a&&l}return r.value=r.done?n:e,r},flipTarget:()=>{c=-c,[e,n]=[n,e],f()}}}Jt.needsInterpolation=(t,e)=>"string"==typeof t||"string"==typeof e;const Qt=t=>0,te=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i},ee=(t,e,n)=>-n*t+n*e+t;function ne(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 ie({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let o=0,s=0,r=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;o=ne(a,i,t+1/3),s=ne(a,i,t),r=ne(a,i,t-1/3)}else o=s=r=n;return{red:Math.round(255*o),green:Math.round(255*s),blue:Math.round(255*r),alpha:i}}const oe=(t,e,n)=>{const i=t*t,o=e*e;return Math.sqrt(Math.max(0,n*(o-i)+i))},se=[ot,it,tt],re=t=>se.find(e=>e.test(t)),ae=(t,e)=>{let n=re(t),i=re(e),o=n.parse(t),s=i.parse(e);n===tt&&(o=ie(o),n=it),i===tt&&(s=ie(s),i=it);const r=Object.assign({},o);return t=>{for(const e in r)"alpha"!==e&&(r[e]=oe(o[e],s[e],t));return r.alpha=ee(o.alpha,s.alpha,t),n.transform(r)}},le=t=>"number"==typeof t,ue=(t,e)=>n=>e(t(n)),ce=(...t)=>t.reduce(ue);function he(t,e){return le(t)?n=>ee(t,e,n):st.test(t)?ae(t,e):fe(t,e)}const de=(t,e)=>{const n=[...t],i=n.length,o=t.map((t,n)=>he(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=o[e](t);return n}},pe=(t,e)=>{const n=Object.assign(Object.assign({},t),e),i={};for(const o in n)void 0!==t[o]&&void 0!==e[o]&&(i[o]=he(t[o],e[o]));return t=>{for(const e in i)n[e]=i[e](t);return n}};function me(t){const e=ct.parse(t),n=e.length;let i=0,o=0,s=0;for(let t=0;t<n;t++)i||"number"==typeof e[t]?i++:void 0!==e[t].hue?s++:o++;return{parsed:e,numNumbers:i,numRGB:o,numHSL:s}}const fe=(t,e)=>{const n=ct.createTransformer(e),i=me(t),o=me(e);return i.numHSL===o.numHSL&&i.numRGB===o.numRGB&&i.numNumbers>=o.numNumbers?ce(de(i.parsed,o.parsed),n):n=>""+(n>0?e:t)},ve=(t,e)=>n=>ee(t,e,n);function ge(t,e,n){const i=[],o=n||("number"==typeof(s=t[0])?ve:"string"==typeof s?st.test(s)?ae:fe:Array.isArray(s)?de:"object"==typeof s?pe:void 0);var s;const r=t.length-1;for(let n=0;n<r;n++){let s=o(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]:e;s=ce(t,s)}i.push(s)}return i}function ye(t,e,{clamp:n=!0,ease:i,mixer:o}={}){const s=t.length;e.length,!i||!Array.isArray(i)||i.length,t[0]>t[s-1]&&(t=[].concat(t),e=[].concat(e),t.reverse(),e.reverse());const r=ge(e,i,o),a=2===s?function([t,e],[n]){return i=>n(te(t,e,i))}(t,r):function(t,e){const n=t.length,i=n-1;return o=>{let s=0,r=!1;if(o<=t[0]?r=!0:o>=t[i]&&(s=i-1,r=!0),!r){let e=1;for(;e<n&&!(t[e]>o||e===i);e++);s=e-1}const a=te(t[s],t[s+1],o);return e[s](a)}}(t,r);return n?e=>a(Yt(t[0],t[s-1],e)):a}const xe=t=>e=>1-t(1-e),be=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Pe=t=>e=>e*e*((t+1)*e-t),Ae=t=>t,Te=(we=2,t=>Math.pow(t,we));var we;const Se=xe(Te),Ee=be(Te),Ve=t=>1-Math.sin(Math.acos(t)),Me=xe(Ve),Ce=be(Me),Re=Pe(1.525),Le=xe(Re),De=be(Re),ke=(t=>{const e=Pe(t);return t=>(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))})(1.525),je=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},Oe=xe(je);function Fe(t,e){return t.map(()=>e||Ee).splice(0,t.length-1)}function Ue({from:t=0,to:e=1,ease:n,offset:i,duration:o=300}){const s={done:!1,value:t},r=Array.isArray(e)?e:[t,e],a=function(t,e){return t.map(t=>t*e)}(i&&i.length===r.length?i:function(t){const e=t.length;return t.map((t,n)=>0!==n?n/(e-1):0)}(r),o);function l(){return ye(a,r,{ease:Array.isArray(n)?n:Fe(r,n)})}let u=l();return{next:t=>(s.value=u(t),s.done=t>=o,s),flipTarget:()=>{r.reverse(),u=l()}}}const Ie={keyframes:Ue,spring:Jt,decay:function({velocity:t=0,from:e=0,power:n=.8,timeConstant:i=350,restDelta:o=.5,modifyTarget:s}){const r={done:!1,value:e};let a=n*t;const l=e+a,u=void 0===s?l:s(l);return u!==l&&(a=u-e),{next:t=>{const e=-a*Math.exp(-t/i);return r.done=!(e>o||e<-o),r.value=r.done?u:u+e,r},flipTarget:()=>{}}}};function Be(t,e,n=0){return t-e-n}const Ne=t=>{const e=({delta:e})=>t(e);return{start:()=>Rt.update(e,!0),stop:()=>Lt.update(e)}};function ze(t){var e,n,{from:i,autoplay:o=!0,driver:s=Ne,elapsed:r=0,repeat:a=0,repeatType:l="loop",repeatDelay:u=0,onPlay:c,onStop:h,onComplete:d,onRepeat:p,onUpdate:m}=t,f=Wt(t,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let v,g,y,{to:x}=f,b=0,P=f.duration,A=!1,T=!0;const w=function(t){if(Array.isArray(t.to))return Ue;if(Ie[t.type])return Ie[t.type];const e=new Set(Object.keys(t));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?Ue:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?Jt:Ue}(f);(null===(n=(e=w).needsInterpolation)||void 0===n?void 0:n.call(e,i,x))&&(y=ye([0,100],[i,x],{clamp:!1}),i=0,x=100);const S=w(Object.assign(Object.assign({},f),{from:i,to:x}));function E(){b++,"reverse"===l?(T=b%2==0,r=function(t,e,n=0,i=!0){return i?Be(e+-t,e,n):e-(t-e)+n}(r,P,u,T)):(r=Be(r,P,u),"mirror"===l&&S.flipTarget()),A=!1,p&&p()}function V(t){if(T||(t=-t),r+=t,!A){const t=S.next(Math.max(0,r));g=t.value,y&&(g=y(g)),A=T?t.done:r<=0}null==m||m(g),A&&(0===b&&(null!=P||(P=r)),b<a?function(t,e,n,i){return i?t>=e+n:t<=-n}(r,P,u,T)&&E():(v.stop(),d&&d()))}return o&&(null==c||c(),v=s(V),v.start()),{stop:()=>{null==h||h(),v.stop()}}}function $e(t,e){return e?t*(1e3/e):0}const Ge=t=>t.hasOwnProperty("x")&&t.hasOwnProperty("y"),He=t=>Ge(t)&&t.hasOwnProperty("z"),We=(t,e)=>Math.abs(t-e);function Ye(t,e){if(le(t)&&le(e))return We(t,e);if(Ge(t)&&Ge(e)){const n=We(t.x,e.x),i=We(t.y,e.y),o=He(t)&&He(e)?We(t.z,e.z):0;return Math.sqrt(Math.pow(n,2)+Math.pow(i,2)+Math.pow(o,2))}}const Xe=(t,e)=>1-3*e+3*t,qe=(t,e)=>3*e-6*t,Ke=t=>3*t,Ze=(t,e,n)=>((Xe(e,n)*t+qe(e,n))*t+Ke(e))*t,_e=(t,e,n)=>3*Xe(e,n)*t*t+2*qe(e,n)*t+Ke(e);function Je(t,e,n,i){if(t===e&&n===i)return Ae;const o=new Float32Array(11);for(let e=0;e<11;++e)o[e]=Ze(.1*e,t,n);function s(e){let i=0,s=1;for(;10!==s&&o[s]<=e;++s)i+=.1;--s;const r=i+.1*((e-o[s])/(o[s+1]-o[s])),a=_e(r,t,n);return a>=.001?function(t,e,n,i){for(let o=0;o<8;++o){const o=_e(e,n,i);if(0===o)return e;e-=(Ze(e,n,i)-t)/o}return e}(e,r,t,n):0===a?r:function(t,e,n,i,o){let s,r,a=0;do{r=e+(n-e)/2,s=Ze(r,i,o)-t,s>0?n=r:e=r}while(Math.abs(s)>1e-7&&++a<10);return r}(e,i,i+.1,t,n)}return t=>0===t||1===t?t:Ze(s(t),e,i)}class Qe{constructor(t,e,{transformPagePoint:n}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const t=nn(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=Ye(t.offset,{x:0,y:0})>=3;if(!e&&!n)return;const{point:i}=t,{timestamp:o}=Ft();this.history.push({...i,timestamp:o});const{onStart:s,onMove:r}=this.handlers;e||(s&&s(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),r&&r(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=tn(e,this.transformPagePoint),ft(t)&&0===t.buttons?this.handlePointerUp(t,e):Rt.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:n,onSessionEnd:i}=this.handlers,o=nn(tn(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,o),i&&i(t,o)},vt(t)&&t.touches.length>1)return;this.handlers=e,this.transformPagePoint=n;const i=tn(bt(t),this.transformPagePoint),{point:o}=i,{timestamp:s}=Ft();this.history=[{...o,timestamp:s}];const{onSessionStart:r}=e;r&&r(t,nn(i,this.history)),this.removeListeners=ce(Gt(window,"pointermove",this.handlePointerMove),Gt(window,"pointerup",this.handlePointerUp),Gt(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Lt.update(this.updatePoint)}}function tn(t,e){return e?{point:e(t.point)}:t}function en(t,e){return{x:t.x-e.x,y:t.y-e.y}}function nn({point:t},e){return{point:t,delta:en(t,sn(e)),offset:en(t,on(e)),velocity:rn(e,.1)}}function on(t){return t[0]}function sn(t){return t[t.length-1]}function rn(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const o=sn(t);for(;n>=0&&(i=t[n],!(o.timestamp-i.timestamp>Ut(e)));)n--;if(!i)return{x:0,y:0};const s=(o.timestamp-i.timestamp)/1e3;if(0===s)return{x:0,y:0};const r={x:(o.x-i.x)/s,y:(o.y-i.y)/s};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function an(t){let e=null;return()=>{const n=()=>{e=null};return null===e&&(e=t,n)}}const ln=an("dragHorizontal"),un=an("dragVertical");function cn(t){let e=!1;if("y"===t)e=un();else if("x"===t)e=ln();else{const t=ln(),n=un();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}function hn(){const t=cn(!0);return!t||(t(),!1)}function dn(t){return t.max-t.min}function pn(t,e=0,n=.01){return Ye(t,e)<n}function mn(t,e,n,i=.5){t.origin=i,t.originPoint=ee(e.min,e.max,t.origin),t.scale=dn(n)/dn(e),(pn(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=ee(n.min,n.max,t.origin)-t.originPoint,(pn(t.translate)||isNaN(t.translate))&&(t.translate=0)}function fn(t,e,n,i){mn(t.x,e.x,n.x,null==i?void 0:i.originX),mn(t.y,e.y,n.y,null==i?void 0:i.originY)}function vn(t,e,n){t.min=n.min+e.min,t.max=t.min+dn(e)}function gn(t,e,n){t.min=e.min-n.min,t.max=t.min+dn(e)}function yn(t,e,n){gn(t.x,e.x,n.x),gn(t.y,e.y,n.y)}function xn(t,e,n){return{min:void 0!==e?t.min+e:void 0,max:void 0!==n?t.max+n-(t.max-t.min):void 0}}function bn(t,e){let n=e.min-t.min,i=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,i]=[i,n]),{min:n,max:i}}const Pn=.35;function An(t,e,n){return{min:Tn(t,e),max:Tn(t,n)}}function Tn(t,e){var n;return"number"==typeof t?t:null!==(n=t[e])&&void 0!==n?n:0}var wn;!function(t){t.Animate="animate",t.Hover="whileHover",t.Tap="whileTap",t.Drag="whileDrag",t.Focus="whileFocus",t.InView="whileInView",t.Exit="exit"}(wn||(wn={}));function Sn(t){return[t("x"),t("y")]}function En({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function Vn(t){return void 0===t||1===t}function Mn({scale:t,scaleX:e,scaleY:n}){return!Vn(t)||!Vn(e)||!Vn(n)}function Cn(t){return Mn(t)||Rn(t.x)||Rn(t.y)||t.z||t.rotate||t.rotateX||t.rotateY}function Rn(t){return t&&"0%"!==t}function Ln(t,e,n){return n+e*(t-n)}function Dn(t,e,n,i,o){return void 0!==o&&(t=Ln(t,o,i)),Ln(t,n,i)+e}function kn(t,e=0,n=1,i,o){t.min=Dn(t.min,e,n,i,o),t.max=Dn(t.max,e,n,i,o)}function jn(t,{x:e,y:n}){kn(t.x,e.translate,e.scale,e.originPoint),kn(t.y,n.translate,n.scale,n.originPoint)}function On(t,e){t.min=t.min+e,t.max=t.max+e}function Fn(t,e,[n,i,o]){const s=void 0!==e[o]?e[o]:.5,r=ee(t.min,t.max,s);kn(t,e[n],e[i],r,e.scale)}const Un=["x","scaleX","originX"],In=["y","scaleY","originY"];function Bn(t,e){Fn(t.x,e,Un),Fn(t.y,e,In)}function Nn(t,e){return En(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}(t.getBoundingClientRect(),e))}const zn={linear:Ae,easeIn:Te,easeInOut:Ee,easeOut:Se,circIn:Ve,circInOut:Ce,circOut:Me,backIn:Re,backInOut:De,backOut:Le,anticipate:ke,bounceIn:Oe,bounceInOut:t=>t<.5?.5*(1-je(1-2*t)):.5*je(2*t-1)+.5,bounceOut:je},$n=t=>{if(Array.isArray(t)){t.length;const[e,n,i,o]=t;return Je(e,n,i,o)}return"string"==typeof t?zn[t]:t},Gn=(t,e)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!ct.test(e)||e.startsWith("url("))),Hn=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),Wn=t=>({type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restSpeed:10}),Yn=()=>({type:"keyframes",ease:"linear",duration:.3}),Xn=t=>({type:"keyframes",duration:.8,values:t}),qn={x:Hn,y:Hn,z:Hn,rotate:Hn,rotateX:Hn,rotateY:Hn,rotateZ:Hn,scaleX:Wn,scaleY:Wn,scale:Wn,opacity:Yn,backgroundColor:Yn,color:Yn,default:Wn},Kn=(t,e)=>{let n;return n=v(e)?Xn:qn[t]||qn.default,{to:e,...n(e)}},Zn={...g,color:st,backgroundColor:st,outlineColor:st,fill:st,stroke:st,borderColor:st,borderTopColor:st,borderRightColor:st,borderBottomColor:st,borderLeftColor:st,filter:mt,WebkitFilter:mt},_n=t=>Zn[t];function Jn(t,e){var n;let i=_n(t);return i!==mt&&(i=ct),null===(n=i.getAnimatableNone)||void 0===n?void 0:n.call(i,e)}const Qn=!1;function ti({ease:t,times:e,yoyo:n,flip:i,loop:o,...s}){const r={...s};return e&&(r.offset=e),s.duration&&(r.duration=Ut(s.duration)),s.repeatDelay&&(r.repeatDelay=Ut(s.repeatDelay)),t&&(r.ease=(t=>Array.isArray(t)&&"number"!=typeof t[0])(t)?t.map($n):$n(t)),"tween"===s.type&&(r.type="keyframes"),(n||o||i)&&(n?r.repeatType="reverse":o?r.repeatType="loop":i&&(r.repeatType="mirror"),r.repeat=o||n||i||s.repeat),"spring"!==s.type&&(r.type="keyframes"),r}function ei(t,e,n){return Array.isArray(e.to)&&void 0===t.duration&&(t.duration=.8),function(t){Array.isArray(t.to)&&null===t.to[0]&&(t.to=[...t.to],t.to[0]=t.from)}(e),function({when:t,delay:e,delayChildren:n,staggerChildren:i,staggerDirection:o,repeat:s,repeatType:r,repeatDelay:a,from:l,...u}){return!!Object.keys(u).length}(t)||(t={...t,...Kn(n,e.to)}),{...e,...ti(t)}}function ni(t,e,n,i,o){const s=si(i,t)||{};let r=void 0!==s.from?s.from:e.get();const a=Gn(t,n);"none"===r&&a&&"string"==typeof n?r=Jn(t,n):ii(r)&&"string"==typeof n?r=oi(n):!Array.isArray(n)&&ii(n)&&"string"==typeof r&&(n=oi(r));return Gn(t,r)&&a&&!1!==s.type?function(){const i={from:r,to:n,velocity:e.getVelocity(),onComplete:o,onUpdate:t=>e.set(t)};return"inertia"===s.type||"decay"===s.type?function({from:t=0,velocity:e=0,min:n,max:i,power:o=.8,timeConstant:s=750,bounceStiffness:r=500,bounceDamping:a=10,restDelta:l=1,modifyTarget:u,driver:c,onUpdate:h,onComplete:d,onStop:p}){let m;function f(t){return void 0!==n&&t<n||void 0!==i&&t>i}function v(t){return void 0===n?i:void 0===i||Math.abs(n-t)<Math.abs(i-t)?n:i}function g(t){null==m||m.stop(),m=ze(Object.assign(Object.assign({},t),{driver:c,onUpdate:e=>{var n;null==h||h(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:r,damping:a,restDelta:l},t))}if(f(t))y({from:t,velocity:e,to:v(t)});else{let i=o*e+t;void 0!==u&&(i=u(i));const r=v(i),a=r===n?-1:1;let c,h;const d=t=>{c=h,h=t,e=$e(t-c,Ft().delta),(1===a&&t>r||-1===a&&t<r)&&y({from:t,to:r,velocity:e})};g({type:"decay",from:t,velocity:e,timeConstant:s,power:o,restDelta:l,modifyTarget:u,onUpdate:f(i)?d:void 0})}return{stop:()=>null==m?void 0:m.stop()}}({...i,...s}):ze({...ei(s,i,t),onUpdate:t=>{i.onUpdate(t),s.onUpdate&&s.onUpdate(t)},onComplete:()=>{i.onComplete(),s.onComplete&&s.onComplete()}})}:function(){const t=y(n);return e.set(t),o(),s.onUpdate&&s.onUpdate(t),s.onComplete&&s.onComplete(),{stop:()=>{}}}}function ii(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function oi(t){return"number"==typeof t?0:Jn("",t)}function si(t,e){return t[e]||t.default||t}function ri(t,e,n,i={}){return Qn&&(i={type:!1}),e.start(o=>{let s,r;const a=ni(t,e,n,i,o),l=function(t,e){var n,i;return null!==(i=null!==(n=(si(t,e)||{}).delay)&&void 0!==n?n:t.delay)&&void 0!==i?i:0}(i,t),u=()=>r=a();return l?s=window.setTimeout(u,Ut(l)):u(),()=>{clearTimeout(s),r&&r.stop()}})}const ai=new WeakMap;class li{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.visualElement=t}start(t,{snapToCursor:e=!1}={}){if(!1===this.visualElement.isPresent)return;this.panSession=new Qe(t,{onSessionStart:t=>{this.stopAnimation(),e&&this.snapToCursor(bt(t,"page").point)},onStart:(t,e)=>{var n;const{drag:i,dragPropagation:o,onDragStart:s}=this.getProps();(!i||o||(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=cn(i),this.openGlobalLock))&&(this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Sn(t=>{var e,n;let i=this.getAxisMotionValue(t).get()||0;if(u.test(i)){const o=null===(n=null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout)||void 0===n?void 0:n.actual[t];if(o){i=dn(o)*(parseFloat(i)/100)}}this.originPoint[t]=i}),null==s||s(t,e),null===(n=this.visualElement.animationState)||void 0===n||n.setActive(wn.Drag,!0))},onMove:(t,e)=>{const{dragPropagation:n,dragDirectionLock:i,onDirectionLock:o,onDrag:s}=this.getProps();if(!n&&!this.openGlobalLock)return;const{offset:r}=e;if(i&&null===this.currentDirection)return this.currentDirection=function(t,e=10){let n=null;Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x");return n}(r),void(null!==this.currentDirection&&(null==o||o(this.currentDirection)));this.updateAxis("x",e.point,r),this.updateAxis("y",e.point,r),this.visualElement.syncRender(),null==s||s(t,e)},onSessionEnd:(t,e)=>this.stop(t,e)},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(t,e){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:i}=e;this.startAnimation(i);const{onDragEnd:o}=this.getProps();null==o||o(t,e)}cancel(){var t,e;this.isDragging=!1,this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!1),null===(t=this.panSession)||void 0===t||t.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),null===(e=this.visualElement.animationState)||void 0===e||e.setActive(wn.Drag,!1)}updateAxis(t,e,n){const{drag:i}=this.getProps();if(!n||!ui(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let s=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(s=function(t,{min:e,max:n},i){return void 0!==e&&t<e?t=i?ee(e,t,i.min):Math.max(t,e):void 0!==n&&t>n&&(t=i?ee(n,t,i.max):Math.min(t,n)),t}(s,this.constraints[t],this.elastic[t])),o.set(s)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),{layout:n}=this.visualElement.projection||{},i=this.constraints;t&&x(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:i,right:o}){return{x:xn(t.x,n,o),y:xn(t.y,e,i)}}(n.actual,t),this.elastic=function(t=Pn){return!1===t?t=0:!0===t&&(t=Pn),{x:An(t,"left","right"),y:An(t,"top","bottom")}}(e),i!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&Sn(t=>{this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(n.actual[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!x(t))return!1;const n=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=function(t,e,n){const i=Nn(t,n),{scroll:o}=e;return o&&(On(i.x,o.x),On(i.y,o.y)),i}(n,i.root,this.visualElement.getTransformPagePoint());let s=function(t,e){return{x:bn(t.x,e.x),y:bn(t.y,e.y)}}(i.layout.actual,o);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(s));this.hasMutatedConstraints=!!t,t&&(s=En(t))}return s}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:i,dragTransition:o,dragSnapToOrigin:s,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},l=Sn(r=>{var l;if(!ui(r,e,this.currentDirection))return;let u=null!==(l=null==a?void 0:a[r])&&void 0!==l?l:{};s&&(u={min:0,max:0});const c=i?200:1e6,h=i?40:1e7,d={type:"inertia",velocity:n?t[r]:0,bounceStiffness:c,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...o,...u};return this.startAxisValueAnimation(r,d)});return Promise.all(l).then(r)}startAxisValueAnimation(t,e){return ri(t,this.getAxisMotionValue(t),0,e)}stopAnimation(){Sn(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){var e,n;const i="_drag"+t.toUpperCase(),o=this.visualElement.getProps()[i];return o||this.visualElement.getValue(t,null!==(n=null===(e=this.visualElement.getProps().initial)||void 0===e?void 0:e[t])&&void 0!==n?n:0)}snapToCursor(t){Sn(e=>{const{drag:n}=this.getProps();if(!ui(e,n,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(e);if(i&&i.layout){const{min:n,max:s}=i.layout.actual[e];o.set(t[e]-ee(n,s,.5))}})}scalePositionWithinConstraints(){var t;const{drag:e,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!x(n)||!i||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Sn(t=>{const e=this.getAxisMotionValue(t);if(e){const n=e.get();o[t]=function(t,e){let n=.5;const i=dn(t),o=dn(e);return o>i?n=te(e.min,e.max-i,t.min):i>o&&(n=te(t.min,t.max-o,e.min)),Yt(0,1,n)}({min:n,max:n},this.constraints[t])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.getInstance().style.transform=s?s({},""):"none",null===(t=i.root)||void 0===t||t.updateScroll(),i.updateLayout(),this.resolveConstraints(),Sn(t=>{if(!ui(t,e,null))return;const n=this.getAxisMotionValue(t),{min:i,max:s}=this.constraints[t];n.set(ee(i,s,o[t]))})}addListeners(){var t;ai.set(this.visualElement,this);const e=Gt(this.visualElement.getInstance(),"pointerdown",t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)}),n=()=>{const{dragConstraints:t}=this.getProps();x(t)&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,o=i.addEventListener("measure",n);i&&!i.layout&&(null===(t=i.root)||void 0===t||t.updateScroll(),i.updateLayout()),n();const s=It(window,"resize",()=>this.scalePositionWithinConstraints()),r=i.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(Sn(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.syncRender())});return()=>{s(),e(),o(),null==r||r()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:s=Pn,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:i,dragConstraints:o,dragElastic:s,dragMomentum:r}}}function ui(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}function ci(t){return e(()=>()=>t(),[])}const hi=t=>e=>(t(e),null),di={pan:hi((function({onPan:t,onPanStart:o,onPanEnd:s,onPanSessionStart:r,visualElement:a}){const l=t||o||s||r,u=n(null),{transformPagePoint:c}=i(P),h={onSessionStart:r,onStart:o,onMove:t,onEnd:(t,e)=>{u.current=null,s&&s(t,e)}};e(()=>{null!==u.current&&u.current.updateHandlers(h)}),Ht(a,"pointerdown",l&&function(t){u.current=new Qe(t,h,{transformPagePoint:c})}),ci(()=>u.current&&u.current.end())})),drag:hi((function(t){const{dragControls:n,visualElement:i}=t,o=b(()=>new li(i));e(()=>n&&n.subscribe(o),[o,n]),e(()=>o.addListeners(),[o])}))};function pi(){const t=i(A);if(null===t)return[!0,null];const{isPresent:n,onExitComplete:s,register:r}=t,a=o();e(()=>r(a),[]);return!n&&s?[!1,()=>s&&s(a)]:[!0]}function mi(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const fi={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!T.test(t))return t;t=parseFloat(t)}return`${mi(t,e.target.x)}% ${mi(t,e.target.y)}%`}};function vi(t){return"string"==typeof t&&t.startsWith("var(--")}const gi=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function yi(t,e,n=1){const[i,o]=function(t){const e=gi.exec(t);if(!e)return[,];const[,n,i]=e;return[n,i]}(t);if(!i)return;const s=window.getComputedStyle(e).getPropertyValue(i);return s?s.trim():vi(o)?yi(o,e,n+1):o}const xi={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,o=t.includes("var("),s=[];o&&(t=t.replace(gi,t=>(s.push(t),"_$css")));const r=ct.parse(t);if(r.length>5)return i;const a=ct.createTransformer(t),l="number"!=typeof r[0]?1:0,u=n.x.scale*e.x,c=n.y.scale*e.y;r[0+l]/=u,r[1+l]/=c;const h=ee(u,c,.5);"number"==typeof r[2+l]&&(r[2+l]/=h),"number"==typeof r[3+l]&&(r[3+l]/=h);let d=a(r);if(o){let t=0;d=d.replace("_$css",()=>{const e=s[t];return t++,e})}return d}};class bi extends t.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:i}=this.props,{projection:o}=t;w(Pi),o&&(e.group&&e.group.add(o),n&&n.register&&i&&n.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),S.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:i,isPresent:o}=this.props,s=n.projection;return s?(s.isPresent=o,i||t.layoutDependency!==e||void 0===e?s.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?s.promote():s.relegate()||Rt.postRender(()=>{var t;(null===(t=s.getStack())||void 0===t?void 0:t.members.length)||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),!t.currentAnimation&&t.isLead()&&this.safeToRemove())}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),(null==e?void 0:e.group)&&e.group.remove(i),(null==n?void 0:n.deregister)&&n.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;null==t||t()}render(){return null}}const Pi={borderRadius:{...fi,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:fi,borderTopRightRadius:fi,borderBottomLeftRadius:fi,borderBottomRightRadius:fi,boxShadow:xi},Ai={measureLayout:function(e){const[n,o]=pi(),s=i(E);return t.createElement(bi,{...e,layoutGroup:s,switchLayoutGroup:i(V),isPresent:n,safeToRemove:o})}};function Ti(t,e){-1===t.indexOf(e)&&t.push(e)}function wi(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class Si{constructor(){this.subscriptions=[]}add(t){return Ti(this.subscriptions,t),()=>wi(this.subscriptions,t)}notify(t,e,n){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,n);else for(let o=0;o<i;o++){const i=this.subscriptions[o];i&&i(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}class Ei{constructor(t){var e;this.version="7.3.0",this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new Si,this.velocityUpdateSubscribers=new Si,this.renderSubscribers=new Si,this.canTrackVelocity=!1,this.updateAndNotify=(t,e=!0)=>{this.prev=this.current,this.current=t;const{delta:n,timestamp:i}=Ft();this.lastUpdated!==i&&(this.timeDelta=n,this.lastUpdated=i,Rt.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.updateSubscribers.notify(this.current),this.velocityUpdateSubscribers.getSize()&&this.velocityUpdateSubscribers.notify(this.getVelocity()),e&&this.renderSubscribers.notify(this.current)},this.scheduleVelocityCheck=()=>Rt.postRender(this.velocityCheck),this.velocityCheck=({timestamp:t})=>{t!==this.lastUpdated&&(this.prev=this.current,this.velocityUpdateSubscribers.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e)))}onChange(t){return this.updateSubscribers.add(t)}clearListeners(){this.updateSubscribers.clear()}onRenderRequest(t){return t(this.get()),this.renderSubscribers.add(t)}attach(t){this.passiveEffect=t}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?$e(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.stopAnimation=t(e)}).then(()=>this.clearAnimation())}stop(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()}}function Vi(t){return new Ei(t)}const Mi=["TopLeft","TopRight","BottomLeft","BottomRight"],Ci=Mi.length,Ri=t=>"string"==typeof t?parseFloat(t):t,Li=t=>"number"==typeof t||T.test(t);function Di(t,e){var n;return null!==(n=t[e])&&void 0!==n?n:t.borderRadius}const ki=Oi(0,.5,Me),ji=Oi(.5,.95,Ae);function Oi(t,e,n){return i=>i<t?0:i>e?1:n(te(t,e,i))}function Fi(t,e){t.min=e.min,t.max=e.max}function Ui(t,e){Fi(t.x,e.x),Fi(t.y,e.y)}function Ii(t,e,n,i,o){return t=Ln(t-=e,1/n,i),void 0!==o&&(t=Ln(t,1/o,i)),t}function Bi(t,e,[n,i,o],s,r){!function(t,e=0,n=1,i=.5,o,s=t,r=t){if(u.test(e)){e=parseFloat(e);e=ee(r.min,r.max,e/100)-r.min}if("number"!=typeof e)return;let a=ee(s.min,s.max,i);t===s&&(a-=e),t.min=Ii(t.min,e,n,a,o),t.max=Ii(t.max,e,n,a,o)}(t,e[n],e[i],e[o],e.scale,s,r)}const Ni=["x","scaleX","originX"],zi=["y","scaleY","originY"];function $i(t,e,n,i){Bi(t.x,e,Ni,null==n?void 0:n.x,null==i?void 0:i.x),Bi(t.y,e,zi,null==n?void 0:n.y,null==i?void 0:i.y)}function Gi(t){return 0===t.translate&&1===t.scale}function Hi(t){return Gi(t.x)&&Gi(t.y)}function Wi(t,e){return t.x.min===e.x.min&&t.x.max===e.x.max&&t.y.min===e.y.min&&t.y.max===e.y.max}function Yi(t){return dn(t.x)/dn(t.y)}class Xi{constructor(){this.members=[]}add(t){Ti(this.members,t),t.scheduleRender()}remove(t){if(wi(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){const e=this.members.findIndex(e=>t===e);if(0===e)return!1;let n;for(let t=e;t>=0;t--){const e=this.members[t];if(!1!==e.isPresent){n=e;break}}return!!n&&(this.promote(n),!0)}promote(t,e){var n;const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.instance&&i.scheduleRender(),t.scheduleRender(),t.resumeFrom=i,e&&(t.resumeFrom.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues,t.snapshot.isShared=!0),(null===(n=t.root)||void 0===n?void 0:n.isUpdating)&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;!1===o&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var e,n,i,o,s;null===(n=(e=t.options).onExitComplete)||void 0===n||n.call(e),null===(s=null===(i=t.resumingFrom)||void 0===i?void 0:(o=i.options).onExitComplete)||void 0===s||s.call(o)})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function qi(t,e,n){let i=`translate3d(${t.x.translate/e.x}px, ${t.y.translate/e.y}px, 0) `;if(i+=`scale(${1/e.x}, ${1/e.y}) `,n){const{rotate:t,rotateX:e,rotateY:o}=n;t&&(i+=`rotate(${t}deg) `),e&&(i+=`rotateX(${e}deg) `),o&&(i+=`rotateY(${o}deg) `)}return i+=`scale(${t.x.scale*e.x}, ${t.y.scale*e.y})`,"translate3d(0px, 0px, 0) scale(1, 1) scale(1, 1)"===i?"none":i}const Ki=(t,e)=>t.depth-e.depth;class Zi{constructor(){this.children=[],this.isDirty=!1}add(t){Ti(this.children,t),this.isDirty=!0}remove(t){wi(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Ki),this.isDirty=!1,this.children.forEach(t)}}const _i=["","X","Y","Z"];function Ji({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:o}){return class{constructor(t,n={},i=(null==e?void 0:e())){this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.nodes.forEach(so),this.nodes.forEach(ro)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.id=t,this.latestValues=n,this.root=i?i.root||i:this,this.path=i?[...i.path,i]:[],this.parent=i,this.depth=i?i.depth+1:0,t&&this.root.registerPotentialNode(t,this);for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new Zi)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new Si),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){const n=this.eventHandlers.get(t);null==n||n.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}registerPotentialNode(t,e){this.potentialNodes.set(t,e)}mount(e,n=!1){var i;if(this.instance)return;this.isSVG=e instanceof SVGElement&&"svg"!==e.tagName,this.instance=e;const{layoutId:o,layout:s,visualElement:r}=this.options;if(r&&!r.getInstance()&&r.mount(e),this.root.nodes.add(this),null===(i=this.parent)||void 0===i||i.children.add(this),this.id&&this.root.potentialNodes.delete(this.id),n&&(s||o)&&(this.isLayoutDirty=!0),t){let n;const i=()=>this.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,clearTimeout(n),n=window.setTimeout(i,250),S.hasAnimatedSinceResize&&(S.hasAnimatedSinceResize=!1,this.nodes.forEach(oo))})}o&&this.root.registerSharedNode(o,this),!1!==this.options.animate&&r&&(o||s)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeTargetChanged:n,layout:i})=>{var o,s,a,l,u;if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const c=null!==(s=null!==(o=this.options.transition)&&void 0!==o?o:r.getDefaultTransition())&&void 0!==s?s:po,{onLayoutAnimationStart:h,onLayoutAnimationComplete:d}=r.getProps(),p=!this.targetLayout||!Wi(this.targetLayout,i)||n,m=!e&&n;if((null===(a=this.resumeFrom)||void 0===a?void 0:a.instance)||m||e&&(p||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,m);const e={...si(c,"layout"),onPlay:h,onComplete:d};r.shouldReduceMotion&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||0!==this.animationProgress||this.finishAnimation(),this.isLead()&&(null===(u=(l=this.options).onExitComplete)||void 0===u||u.call(l));this.targetLayout=i})}unmount(){var t,e;this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),null===(t=this.getStack())||void 0===t||t.remove(this),null===(e=this.parent)||void 0===e||e.children.delete(this),this.instance=void 0,Lt.preRender(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){var t;return this.isAnimationBlocked||(null===(t=this.parent)||void 0===t?void 0:t.isTreeAnimationBlocked())||!1}startUpdate(){var t;this.isUpdateBlocked()||(this.isUpdating=!0,null===(t=this.nodes)||void 0===t||t.forEach(ao))}willUpdate(t=!0){var e,n,i;if(this.root.isUpdateBlocked())return void(null===(n=(e=this.options).onExitComplete)||void 0===n||n.call(e));if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){const e=this.path[t];e.shouldResetTransform=!0,e.updateScroll()}const{layoutId:o,layout:s}=this.options;if(void 0===o&&!s)return;const r=null===(i=this.options.visualElement)||void 0===i?void 0:i.getProps().transformTemplate;this.prevTransformTemplateValue=null==r?void 0:r(this.latestValues,""),this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}didUpdate(){if(this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(no);this.isUpdating&&(this.isUpdating=!1,this.potentialNodes.size&&(this.potentialNodes.forEach(mo),this.potentialNodes.clear()),this.nodes.forEach(io),this.nodes.forEach(Qi),this.nodes.forEach(to),this.clearAllSnapshots(),Dt.update(),Dt.preRender(),Dt.render())}clearAllSnapshots(){this.nodes.forEach(eo),this.sharedNodes.forEach(lo)}scheduleUpdateProjection(){Rt.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){Rt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){if(this.snapshot||!this.instance)return;const t=this.measure(),e=this.removeTransform(this.removeElementScroll(t));vo(e),this.snapshot={measured:t,layout:e,latestValues:{}}}updateLayout(){var t;if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t<this.path.length;t++){this.path[t].updateScroll()}const e=this.measure();vo(e);const n=this.layout;this.layout={measured:e,actual:this.removeElementScroll(e)},this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.actual),null===(t=this.options.visualElement)||void 0===t||t.notifyLayoutMeasure(this.layout.actual,null==n?void 0:n.actual)}updateScroll(){this.options.layoutScroll&&this.instance&&(this.isScrollRoot=i(this.instance),this.scroll=n(this.instance))}resetTransform(){var t;if(!o)return;const e=this.isLayoutDirty||this.shouldResetTransform,n=this.projectionDelta&&!Hi(this.projectionDelta),i=null===(t=this.options.visualElement)||void 0===t?void 0:t.getProps().transformTemplate,s=null==i?void 0:i(this.latestValues,""),r=s!==this.prevTransformTemplateValue;e&&(n||Cn(this.latestValues)||r)&&(o(this.instance,s),this.shouldResetTransform=!1,this.scheduleRender())}measure(){const{visualElement:t}=this.options;if(!t)return{x:{min:0,max:0},y:{min:0,max:0}};const e=t.measureViewportBox(),{scroll:n}=this.root;return n&&(On(e.x,n.x),On(e.y,n.y)),e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};Ui(e,t);for(let n=0;n<this.path.length;n++){const i=this.path[n],{scroll:o,options:s,isScrollRoot:r}=i;if(i!==this.root&&o&&s.layoutScroll){if(r){Ui(e,t);const{scroll:n}=this.root;n&&(On(e.x,-n.x),On(e.y,-n.y))}On(e.x,o.x),On(e.y,o.y)}}return e}applyTransform(t,e=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};Ui(n,t);for(let t=0;t<this.path.length;t++){const i=this.path[t];!e&&i.options.layoutScroll&&i.scroll&&i!==i.root&&Bn(n,{x:-i.scroll.x,y:-i.scroll.y}),Cn(i.latestValues)&&Bn(n,i.latestValues)}return Cn(this.latestValues)&&Bn(n,this.latestValues),n}removeTransform(t){var e;const n={x:{min:0,max:0},y:{min:0,max:0}};Ui(n,t);for(let t=0;t<this.path.length;t++){const i=this.path[t];if(!i.instance)continue;if(!Cn(i.latestValues))continue;Mn(i.latestValues)&&i.updateSnapshot();const o={x:{min:0,max:0},y:{min:0,max:0}};Ui(o,i.measure()),$i(n,i.latestValues,null===(e=i.snapshot)||void 0===e?void 0:e.layout,o)}return Cn(this.latestValues)&&$i(n,this.latestValues),n}setTargetDelta(t){this.targetDelta=t,this.root.scheduleUpdateProjection()}setOptions(t){this.options={...this.options,...t,crossfade:void 0===t.crossfade||t.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}resolveTargetDelta(){var t;const{layout:e,layoutId:n}=this.options;var i,o,s;this.layout&&(e||n)&&(this.targetDelta||this.relativeTarget||(this.relativeParent=this.getClosestProjectingParent(),this.relativeParent&&this.relativeParent.layout&&(this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},yn(this.relativeTargetOrigin,this.layout.actual,this.relativeParent.layout.actual),Ui(this.relativeTarget,this.relativeTargetOrigin))),(this.relativeTarget||this.targetDelta)&&(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&(null===(t=this.relativeParent)||void 0===t?void 0:t.target)?(i=this.target,o=this.relativeTarget,s=this.relativeParent.target,vn(i.x,o.x,s.x),vn(i.y,o.y,s.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.actual):Ui(this.target,this.layout.actual),jn(this.target,this.targetDelta)):Ui(this.target,this.layout.actual),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.relativeParent=this.getClosestProjectingParent(),this.relativeParent&&Boolean(this.relativeParent.resumingFrom)===Boolean(this.resumingFrom)&&!this.relativeParent.options.layoutScroll&&this.relativeParent.target&&(this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},yn(this.relativeTargetOrigin,this.target,this.relativeParent.target),Ui(this.relativeTarget,this.relativeTargetOrigin)))))}getClosestProjectingParent(){if(this.parent&&!Cn(this.parent.latestValues))return(this.parent.relativeTarget||this.parent.targetDelta)&&this.parent.layout?this.parent:this.parent.getClosestProjectingParent()}calcProjection(){var t;const{layout:e,layoutId:n}=this.options;if(this.isTreeAnimating=Boolean((null===(t=this.parent)||void 0===t?void 0:t.isTreeAnimating)||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!e&&!n)return;const i=this.getLead();Ui(this.layoutCorrected,this.layout.actual),function(t,e,n,i=!1){var o,s;const r=n.length;if(!r)return;let a,l;e.x=e.y=1;for(let u=0;u<r;u++)a=n[u],l=a.projectionDelta,"contents"!==(null===(s=null===(o=a.instance)||void 0===o?void 0:o.style)||void 0===s?void 0:s.display)&&(i&&a.options.layoutScroll&&a.scroll&&a!==a.root&&Bn(t,{x:-a.scroll.x,y:-a.scroll.y}),l&&(e.x*=l.x.scale,e.y*=l.y.scale,jn(t,l)),i&&Cn(a.latestValues)&&Bn(t,a.latestValues))}(this.layoutCorrected,this.treeScale,this.path,Boolean(this.resumingFrom)||this!==i);const{target:o}=i;if(!o)return;this.projectionDelta||(this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}});const s=this.treeScale.x,r=this.treeScale.y,a=this.projectionTransform;fn(this.projectionDelta,this.layoutCorrected,o,this.latestValues),this.projectionTransform=qi(this.projectionDelta,this.treeScale),this.projectionTransform===a&&this.treeScale.x===s&&this.treeScale.y===r||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",o))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){var e,n,i;null===(n=(e=this.options).scheduleRender)||void 0===n||n.call(e),t&&(null===(i=this.getStack())||void 0===i||i.scheduleRender()),this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(t,e=!1){var n;const i=this.snapshot,o=(null==i?void 0:i.latestValues)||{},s={...this.latestValues},r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeTarget=this.relativeTargetOrigin=void 0,this.attemptToResolveRelativeTarget=!e;const a={x:{min:0,max:0},y:{min:0,max:0}},l=null==i?void 0:i.isShared,c=((null===(n=this.getStack())||void 0===n?void 0:n.members.length)||0)<=1,h=Boolean(l&&!c&&!0===this.options.crossfade&&!this.path.some(ho));this.animationProgress=0,this.mixTargetDelta=e=>{var n;const i=e/1e3;var d,p,m,f;uo(r.x,t.x,i),uo(r.y,t.y,i),this.setTargetDelta(r),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&(null===(n=this.relativeParent)||void 0===n?void 0:n.layout)&&(yn(a,this.layout.actual,this.relativeParent.layout.actual),d=this.relativeTarget,p=this.relativeTargetOrigin,m=a,f=i,co(d.x,p.x,m.x,f),co(d.y,p.y,m.y,f)),l&&(this.animationValues=s,function(t,e,n,i,o,s){var r,a,l,c;o?(t.opacity=ee(0,null!==(r=n.opacity)&&void 0!==r?r:1,ki(i)),t.opacityExit=ee(null!==(a=e.opacity)&&void 0!==a?a:1,0,ji(i))):s&&(t.opacity=ee(null!==(l=e.opacity)&&void 0!==l?l:1,null!==(c=n.opacity)&&void 0!==c?c:1,i));for(let o=0;o<Ci;o++){const s=`border${Mi[o]}Radius`;let r=Di(e,s),a=Di(n,s);if(void 0===r&&void 0===a)continue;r||(r=0),a||(a=0);0===r||0===a||Li(r)===Li(a)?(t[s]=Math.max(ee(Ri(r),Ri(a),i),0),(u.test(a)||u.test(r))&&(t[s]+="%")):t[s]=a}(e.rotate||n.rotate)&&(t.rotate=ee(e.rotate||0,n.rotate||0,i))}(s,o,this.latestValues,i,h,c)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=i},this.mixTargetDelta(0)}startAnimation(t){var e,n;this.notifyListeners("animationStart"),null===(e=this.currentAnimation)||void 0===e||e.stop(),this.resumingFrom&&(null===(n=this.resumingFrom.currentAnimation)||void 0===n||n.stop()),this.pendingAnimation&&(Lt.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Rt.update(()=>{S.hasAnimatedSinceResize=!0,this.currentAnimation=function(t,e,n={}){const i=M(t)?t:Vi(t);return ri("",i,e,n),{stop:()=>i.stop(),isAnimating:()=>i.isAnimating()}}(0,1e3,{...t,onUpdate:e=>{var n;this.mixTargetDelta(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:()=>{var e;null===(e=t.onComplete)||void 0===e||e.call(t),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){var t;this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0),null===(t=this.getStack())||void 0===t||t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){var t;this.currentAnimation&&(null===(t=this.mixTargetDelta)||void 0===t||t.call(this,1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:n,layout:i,latestValues:o}=t;if(e&&n&&i){if(this!==t&&this.layout&&i&&go(this.options.animationType,this.layout.actual,i.actual)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=dn(this.layout.actual.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const i=dn(this.layout.actual.y);n.y.min=t.target.y.min,n.y.max=n.y.min+i}Ui(e,n),Bn(e,o),fn(this.projectionDeltaWithTransform,this.layoutCorrected,e,o)}}registerSharedNode(t,e){var n,i,o;this.sharedNodes.has(t)||this.sharedNodes.set(t,new Xi);this.sharedNodes.get(t).add(e),e.promote({transition:null===(n=e.options.initialPromotionConfig)||void 0===n?void 0:n.transition,preserveFollowOpacity:null===(o=null===(i=e.options.initialPromotionConfig)||void 0===i?void 0:i.shouldPreserveFollowOpacity)||void 0===o?void 0:o.call(i,e)})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){var t;const{layoutId:e}=this.options;return e&&(null===(t=this.getStack())||void 0===t?void 0:t.lead)||this}getPrevLead(){var t;const{layoutId:e}=this.options;return e?null===(t=this.getStack())||void 0===t?void 0:t.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const i=this.getStack();i&&i.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const n={};for(let i=0;i<_i.length;i++){const o="rotate"+_i[i];t.getStaticValue(o)&&(e=!0,n[o]=t.getStaticValue(o),t.setStaticValue(o,0))}if(e){null==t||t.syncRender();for(const e in n)t.setStaticValue(e,n[e]);t.scheduleRender()}}getProjectionStyles(t={}){var e,n,i;const o={};if(!this.instance||this.isSVG)return o;if(!this.isVisible)return{visibility:"hidden"};o.visibility="";const s=null===(e=this.options.visualElement)||void 0===e?void 0:e.getProps().transformTemplate;if(this.needsReset)return this.needsReset=!1,o.opacity="",o.pointerEvents=C(t.pointerEvents)||"",o.transform=s?s(this.latestValues,""):"none",o;const r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){const e={};return this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=C(t.pointerEvents)||""),this.hasProjected&&!Cn(this.latestValues)&&(e.transform=s?s({},""):"none",this.hasProjected=!1),e}const a=r.animationValues||r.latestValues;this.applyTransformsToTarget(),o.transform=qi(this.projectionDeltaWithTransform,this.treeScale,a),s&&(o.transform=s(a,o.transform));const{x:l,y:u}=this.projectionDelta;o.transformOrigin=`${100*l.origin}% ${100*u.origin}% 0`,r.animationValues?o.opacity=r===this?null!==(i=null!==(n=a.opacity)&&void 0!==n?n:this.latestValues.opacity)&&void 0!==i?i:1:this.preserveOpacity?this.latestValues.opacity:a.opacityExit:o.opacity=r===this?void 0!==a.opacity?a.opacity:"":void 0!==a.opacityExit?a.opacityExit:0;for(const t in R){if(void 0===a[t])continue;const{correct:e,applyTo:n}=R[t],i=e(a[t],r);if(n){const t=n.length;for(let e=0;e<t;e++)o[n[e]]=i}else o[t]=i}return this.options.layoutId&&(o.pointerEvents=r===this?C(t.pointerEvents)||"":"none"),o}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(t=>{var e;return null===(e=t.currentAnimation)||void 0===e?void 0:e.stop()}),this.root.nodes.forEach(no),this.root.sharedNodes.clear()}}}function Qi(t){t.updateLayout()}function to(t){var e,n,i;const o=(null===(e=t.resumeFrom)||void 0===e?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&o&&t.hasListeners("didUpdate")){const{actual:e,measured:n}=t.layout,{animationType:i}=t.options;"size"===i?Sn(t=>{const n=o.isShared?o.measured[t]:o.layout[t],i=dn(n);n.min=e[t].min,n.max=n.min+i}):go(i,o.layout,e)&&Sn(t=>{const n=o.isShared?o.measured[t]:o.layout[t],i=dn(e[t]);n.max=n.min+i});const s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};fn(s,e,o.layout);const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o.isShared?fn(r,t.applyTransform(n,!0),o.measured):fn(r,e,o.layout);const a=!Hi(s);let l=!1;if(!t.resumeFrom&&(t.relativeParent=t.getClosestProjectingParent(),t.relativeParent&&!t.relativeParent.resumeFrom)){const{snapshot:n,layout:i}=t.relativeParent;if(n&&i){const t={x:{min:0,max:0},y:{min:0,max:0}};yn(t,o.layout,n.layout);const s={x:{min:0,max:0},y:{min:0,max:0}};yn(s,e,i.actual),Wi(t,s)||(l=!0)}}t.notifyListeners("didUpdate",{layout:e,snapshot:o,delta:r,layoutDelta:s,hasLayoutChanged:a,hasRelativeTargetChanged:l})}else t.isLead()&&(null===(i=(n=t.options).onExitComplete)||void 0===i||i.call(n));t.options.transition=void 0}function eo(t){t.clearSnapshot()}function no(t){t.clearMeasurements()}function io(t){const{visualElement:e}=t.options;(null==e?void 0:e.getProps().onBeforeLayoutMeasure)&&e.notifyBeforeLayoutMeasure(),t.resetTransform()}function oo(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0}function so(t){t.resolveTargetDelta()}function ro(t){t.calcProjection()}function ao(t){t.resetRotation()}function lo(t){t.removeLeadSnapshot()}function uo(t,e,n){t.translate=ee(e.translate,0,n),t.scale=ee(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function co(t,e,n,i){t.min=ee(e.min,n.min,i),t.max=ee(e.max,n.max,i)}function ho(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const po={duration:.45,ease:[.4,0,.1,1]};function mo(t,e){let n=t.root;for(let e=t.path.length-1;e>=0;e--)if(Boolean(t.path[e].instance)){n=t.path[e];break}const i=(n&&n!==t.root?n.instance:document).querySelector(`[data-projection-id="${e}"]`);i&&t.mount(i,!0)}function fo(t){t.min=Math.round(t.min),t.max=Math.round(t.max)}function vo(t){fo(t.x),fo(t.y)}function go(t,e,n){return"position"===t||"preserve-aspect"===t&&!function(t,e,n=.01){return Ye(t,e)<=n}(Yi(e),Yi(n))}const yo=Ji({attachResizeListener:(t,e)=>It(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),xo={current:void 0},bo=Ji({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!xo.current){const t=new yo(0,{});t.mount(window),t.setOptions({layoutScroll:!0}),xo.current=t}return xo.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),Po={current:null},Ao={current:!1};function To(t){return Boolean(M(t)&&t.add)}function wo(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let i=0;i<n;i++)if(e[i]!==t[i])return!1;return!0}const So=t=>/^0[^.\s]+$/.test(t),Eo=t=>e=>e.test(t),Vo=[d,T,u,L,D,k,{test:t=>"auto"===t,parse:t=>t}],Mo=t=>Vo.find(Eo(t)),Co=[...Vo,st,ct],Ro=t=>Co.find(Eo(t));function Lo(t,e,n){const i=t.getProps();return j(i,e,void 0!==n?n:i.custom,function(t){const e={};return t.forEachValue((t,n)=>e[n]=t.get()),e}(t),function(t){const e={};return t.forEachValue((t,n)=>e[n]=t.getVelocity()),e}(t))}function Do(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Vi(n))}function ko(t,e){if(!e)return;return(e[t]||e.default||e).from}function jo(t,e,n={}){var i;const o=Lo(t,e,n.custom);let{transition:s=t.getDefaultTransition()||{}}=o||{};n.transitionOverride&&(s=n.transitionOverride);const r=o?()=>Oo(t,o,n):()=>Promise.resolve(),a=(null===(i=t.variantChildren)||void 0===i?void 0:i.size)?(i=0)=>{const{delayChildren:o=0,staggerChildren:r,staggerDirection:a}=s;return function(t,e,n=0,i=0,o=1,s){const r=[],a=(t.variantChildren.size-1)*i,l=1===o?(t=0)=>t*i:(t=0)=>a-t*i;return Array.from(t.variantChildren).sort(Fo).forEach((t,i)=>{r.push(jo(t,e,{...s,delay:n+l(i)}).then(()=>t.notifyAnimationComplete(e)))}),Promise.all(r)}(t,e,o+i,r,a,n)}:()=>Promise.resolve(),{when:l}=s;if(l){const[t,e]="beforeChildren"===l?[r,a]:[a,r];return t().then(e)}return Promise.all([r(),a(n.delay)])}function Oo(t,e,{delay:n=0,transitionOverride:i,type:o}={}){var s;let{transition:r=t.getDefaultTransition(),transitionEnd:a,...l}=t.makeTargetAnimatable(e);const u=t.getValue("willChange");i&&(r=i);const c=[],h=o&&(null===(s=t.animationState)||void 0===s?void 0:s.getState()[o]);for(const e in l){const i=t.getValue(e),o=l[e];if(!i||void 0===o||h&&Uo(h,e))continue;let s={delay:n,...r};t.shouldReduceMotion&&O.has(e)&&(s={...s,type:!1,delay:0});let a=ri(e,i,o,s);To(u)&&(u.add(e),a=a.then(()=>u.remove(e))),c.push(a)}return Promise.all(c).then(()=>{a&&function(t,e){const n=Lo(t,e);let{transitionEnd:i={},transition:o={},...s}=n?t.makeTargetAnimatable(n,!1):{};s={...s,...i};for(const e in s){Do(t,e,y(s[e]))}}(t,a)})}function Fo(t,e){return t.sortNodePosition(e)}function Uo({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}const Io=[wn.Animate,wn.InView,wn.Focus,wn.Hover,wn.Tap,wn.Drag,wn.Exit],Bo=[...Io].reverse(),No=Io.length;function zo(t){return e=>Promise.all(e.map(({animation:e,options:n})=>function(t,e,n={}){let i;if(t.notifyAnimationStart(e),Array.isArray(e)){const o=e.map(e=>jo(t,e,n));i=Promise.all(o)}else if("string"==typeof e)i=jo(t,e,n);else{const o="function"==typeof e?Lo(t,e,n.custom):e;i=Oo(t,o,n)}return i.then(()=>t.notifyAnimationComplete(e))}(t,e,n)))}function $o(t){let e=zo(t);const n={[wn.Animate]:Ho(!0),[wn.InView]:Ho(),[wn.Hover]:Ho(),[wn.Tap]:Ho(),[wn.Drag]:Ho(),[wn.Focus]:Ho(),[wn.Exit]:Ho()};let i=!0;const o=(e,n)=>{const i=Lo(t,n);if(i){const{transition:t,transitionEnd:n,...o}=i;e={...e,...o,...n}}return e};function s(s,r){var a;const l=t.getProps(),u=t.getVariantContext(!0)||{},c=[],h=new Set;let d={},p=1/0;for(let e=0;e<No;e++){const m=Bo[e],f=n[m],g=null!==(a=l[m])&&void 0!==a?a:u[m],y=U(g),x=m===r?f.isActive:null;!1===x&&(p=e);let b=g===u[m]&&g!==l[m]&&y;if(b&&i&&t.manuallyAnimateOnMount&&(b=!1),f.protectedKeys={...d},!f.isActive&&null===x||!g&&!f.prevProp||F(g)||"boolean"==typeof g)continue;const P=Go(f.prevProp,g);let A=P||m===r&&f.isActive&&!b&&y||e>p&&y;const T=Array.isArray(g)?g:[g];let w=T.reduce(o,{});!1===x&&(w={});const{prevResolvedValues:S={}}=f,E={...S,...w},V=t=>{A=!0,h.delete(t),f.needsAnimating[t]=!0};for(const t in E){const e=w[t],n=S[t];d.hasOwnProperty(t)||(e!==n?v(e)&&v(n)?!wo(e,n)||P?V(t):f.protectedKeys[t]=!0:void 0!==e?V(t):h.add(t):void 0!==e&&h.has(t)?V(t):f.protectedKeys[t]=!0)}f.prevProp=g,f.prevResolvedValues=w,f.isActive&&(d={...d,...w}),i&&t.blockInitialAnimation&&(A=!1),A&&!b&&c.push(...T.map(t=>({animation:t,options:{type:m,...s}})))}if(h.size){const e={};h.forEach(n=>{const i=t.getBaseTarget(n);void 0!==i&&(e[n]=i)}),c.push({animation:e})}let m=Boolean(c.length);return i&&!1===l.initial&&!t.manuallyAnimateOnMount&&(m=!1),i=!1,m?e(c):Promise.resolve()}return{animateChanges:s,setActive:function(e,i,o){var r;if(n[e].isActive===i)return Promise.resolve();null===(r=t.variantChildren)||void 0===r||r.forEach(t=>{var n;return null===(n=t.animationState)||void 0===n?void 0:n.setActive(e,i)}),n[e].isActive=i;const a=s(o,e);for(const t in n)n[t].protectedKeys={};return a},setAnimateFunction:function(n){e=n(t)},getState:()=>n}}function Go(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!wo(e,t)}function Ho(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}const Wo=["LayoutMeasure","BeforeLayoutMeasure","LayoutUpdate","ViewportBoxUpdate","Update","Render","AnimationComplete","LayoutAnimationComplete","AnimationStart","LayoutAnimationStart","SetAxisTarget","Unmount"];const Yo=new Set;const Xo=("undefined"==typeof process||process.env,"production"),qo=Object.keys(I),Ko=qo.length,Zo=({treeType:t="",build:e,getBaseTarget:n,makeTargetAnimatable:i,measureViewportBox:o,render:r,readValueFromInstance:a,removeValueFromRenderState:l,sortNodePosition:u,scrapeMotionValuesFromProps:c})=>({parent:h,props:d,presenceId:p,blockInitialAnimation:m,visualState:v,reducedMotionConfig:g},y={})=>{let b=!1;const{latestValues:P,renderState:A}=v;let T;const w=function(){const t=Wo.map(()=>new Si),e={},n={clearAllListeners:()=>t.forEach(t=>t.clear()),updatePropListeners:t=>{Wo.forEach(i=>{var o;const s="on"+i,r=t[s];null===(o=e[i])||void 0===o||o.call(e),r&&(e[i]=n[s](r))})}};return t.forEach((t,e)=>{n["on"+Wo[e]]=e=>t.add(e),n["notify"+Wo[e]]=(...e)=>t.notify(...e)}),n}(),S=new Map,E=new Map;let V={};const C={...P};let R;function L(){T&&b&&(D(),r(T,A,d.style,G.projection))}function D(){e(G,A,P,y,d)}function k(){w.notifyUpdate(P)}function j(t,e){const n=e.onChange(e=>{P[t]=e,d.onUpdate&&Rt.update(k,!1,!0)}),i=e.onRenderRequest(G.scheduleRender);E.set(t,()=>{n(),i()})}const{willChange:O,...F}=c(d);for(const t in F){const e=F[t];void 0!==P[t]&&M(e)&&(e.set(P[t],!1),To(O)&&O.add(t))}const z=B(d),$=N(d),G={treeType:t,current:null,depth:h?h.depth+1:0,parent:h,children:new Set,presenceId:p,shouldReduceMotion:null,variantChildren:$?new Set:void 0,isVisible:void 0,manuallyAnimateOnMount:Boolean(null==h?void 0:h.isMounted()),blockInitialAnimation:m,isMounted:()=>Boolean(T),mount(t){b=!0,T=G.current=t,G.projection&&G.projection.mount(t),$&&h&&!z&&(R=null==h?void 0:h.addVariantChild(G)),S.forEach((t,e)=>j(e,t)),Ao.current||function(){if(Ao.current=!0,f)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Po.current=t.matches;t.addListener(e),e()}else Po.current=!1}(),G.shouldReduceMotion="never"!==g&&("always"===g||Po.current),null==h||h.children.add(G),G.setProps(d)},unmount(){var t;null===(t=G.projection)||void 0===t||t.unmount(),Lt.update(k),Lt.render(L),E.forEach(t=>t()),null==R||R(),null==h||h.children.delete(G),w.clearAllListeners(),T=void 0,b=!1},loadFeatures(t,e,n,i,o,r){const a=[];for(let e=0;e<Ko;e++){const n=qo[e],{isEnabled:i,Component:o}=I[n];i(d)&&o&&a.push(s(o,{key:n,...t,visualElement:G}))}if(!G.projection&&o){G.projection=new o(i,G.getLatestValues(),h&&h.projection);const{layoutId:e,layout:n,drag:s,dragConstraints:a,layoutScroll:l}=t;G.projection.setOptions({layoutId:e,layout:n,alwaysMeasureLayout:Boolean(s)||a&&x(a),visualElement:G,scheduleRender:()=>G.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:r,layoutScroll:l})}return a},addVariantChild(t){var e;const n=G.getClosestVariantNode();if(n)return null===(e=n.variantChildren)||void 0===e||e.add(t),()=>n.variantChildren.delete(t)},sortNodePosition:e=>u&&t===e.treeType?u(G.getInstance(),e.getInstance()):0,getClosestVariantNode:()=>$?G:null==h?void 0:h.getClosestVariantNode(),getLayoutId:()=>d.layoutId,getInstance:()=>T,getStaticValue:t=>P[t],setStaticValue:(t,e)=>P[t]=e,getLatestValues:()=>P,setVisibility(t){G.isVisible!==t&&(G.isVisible=t,G.scheduleRender())},makeTargetAnimatable:(t,e=!0)=>i(G,t,d,e),measureViewportBox:()=>o(T,d),addValue(t,e){G.hasValue(t)&&G.removeValue(t),S.set(t,e),P[t]=e.get(),j(t,e)},removeValue(t){var e;S.delete(t),null===(e=E.get(t))||void 0===e||e(),E.delete(t),delete P[t],l(t,A)},hasValue:t=>S.has(t),getValue(t,e){let n=S.get(t);return void 0===n&&void 0!==e&&(n=Vi(e),G.addValue(t,n)),n},forEachValue:t=>S.forEach(t),readValue:t=>void 0!==P[t]?P[t]:a(T,t,y),setBaseTarget(t,e){C[t]=e},getBaseTarget(t){if(n){const e=n(d,t);if(void 0!==e&&!M(e))return e}return C[t]},...w,build:()=>(D(),A),scheduleRender(){Rt.render(L,!1,!0)},syncRender:L,setProps(t){(t.transformTemplate||d.transformTemplate)&&G.scheduleRender(),d=t,w.updatePropListeners(t),V=function(t,e,n){const{willChange:i}=e;for(const o in e){const s=e[o],r=n[o];if(M(s))t.addValue(o,s),To(i)&&i.add(o);else if(M(r))t.addValue(o,Vi(s)),To(i)&&i.remove(o);else if(r!==s)if(t.hasValue(o)){const e=t.getValue(o);!e.hasAnimated&&e.set(s)}else{const e=t.getStaticValue(o);t.addValue(o,Vi(void 0!==e?e:s))}}for(const i in n)void 0===e[i]&&t.removeValue(i);return e}(G,c(d),V)},getProps:()=>d,getVariant:t=>{var e;return null===(e=d.variants)||void 0===e?void 0:e[t]},getDefaultTransition:()=>d.transition,getTransformPagePoint:()=>d.transformPagePoint,getVariantContext(t=!1){if(t)return null==h?void 0:h.getVariantContext();if(!z){const t=(null==h?void 0:h.getVariantContext())||{};return void 0!==d.initial&&(t.initial=d.initial),t}const e={};for(let t=0;t<Jo;t++){const n=_o[t],i=d[n];(U(i)||!1===i)&&(e[n]=i)}return e}};return G},_o=["initial",...Io],Jo=_o.length,Qo=new Set(["width","height","top","left","right","bottom","x","y"]),ts=t=>Qo.has(t),es=(t,e)=>{t.set(e,!1),t.set(e)},ns=t=>t===d||t===T;var is;!function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"}(is||(is={}));const os=(t,e)=>parseFloat(t.split(", ")[e]),ss=(t,e)=>(n,{transform:i})=>{if("none"===i||!i)return 0;const o=i.match(/^matrix3d\((.+)\)$/);if(o)return os(o[1],e);{const e=i.match(/^matrix\((.+)\)$/);return e?os(e[1],t):0}},rs=new Set(["x","y","z"]),as=z.filter(t=>!rs.has(t));const ls={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:ss(4,13),y:ss(5,14)},us=(t,e,n={},i={})=>{e={...e},i={...i};const o=Object.keys(e).filter(ts);let s=[],r=!1;const a=[];if(o.forEach(o=>{const l=t.getValue(o);if(!t.hasValue(o))return;let u=n[o],c=Mo(u);const h=e[o];let d;if(v(h)){const t=h.length,e=null===h[0]?1:0;u=h[e],c=Mo(u);for(let n=e;n<t;n++)d?Mo(h[n]):d=Mo(h[n])}else d=Mo(h);if(c!==d)if(ns(c)&&ns(d)){const t=l.get();"string"==typeof t&&l.set(parseFloat(t)),"string"==typeof h?e[o]=parseFloat(h):Array.isArray(h)&&d===T&&(e[o]=h.map(parseFloat))}else(null==c?void 0:c.transform)&&(null==d?void 0:d.transform)&&(0===u||0===h)?0===u?l.set(d.transform(u)):e[o]=c.transform(h):(r||(s=function(t){const e=[];return as.forEach(n=>{const i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e.length&&t.syncRender(),e}(t),r=!0),a.push(o),i[o]=void 0!==i[o]?i[o]:e[o],es(l,h))}),a.length){const n=a.indexOf("height")>=0?window.pageYOffset:null,o=((t,e,n)=>{const i=e.measureViewportBox(),o=e.getInstance(),s=getComputedStyle(o),{display:r}=s,a={};"none"===r&&e.setStaticValue("display",t.display||"block"),n.forEach(t=>{a[t]=ls[t](i,s)}),e.syncRender();const l=e.measureViewportBox();return n.forEach(n=>{const i=e.getValue(n);es(i,a[n]),t[n]=ls[n](l,s)}),t})(e,t,a);return s.length&&s.forEach(([e,n])=>{t.getValue(e).set(n)}),t.syncRender(),f&&null!==n&&window.scrollTo({top:n}),{target:o,transitionEnd:i}}return{target:e,transitionEnd:i}};function cs(t,e,n,i){return(t=>Object.keys(t).some(ts))(e)?us(t,e,n,i):{target:e,transitionEnd:i}}const hs=(t,e,n,i)=>{const o=function(t,{...e},n){const i=t.getInstance();if(!(i instanceof Element))return{target:e,transitionEnd:n};n&&(n={...n}),t.forEachValue(t=>{const e=t.get();if(!vi(e))return;const n=yi(e,i);n&&t.set(n)});for(const t in e){const o=e[t];if(!vi(o))continue;const s=yi(o,i);s&&(e[t]=s,n&&void 0===n[t]&&(n[t]=o))}return{target:e,transitionEnd:n}}(t,e,i);return cs(t,e=o.target,n,i=o.transitionEnd)};const ds={treeType:"dom",readValueFromInstance(t,e){if(O.has(e)){const t=_n(e);return t&&t.default||0}{const i=(n=t,window.getComputedStyle(n)),o=($(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof o?o.trim():o}var n},sortNodePosition:(t,e)=>2&t.compareDocumentPosition(e)?1:-1,getBaseTarget(t,e){var n;return null===(n=t.style)||void 0===n?void 0:n[e]},measureViewportBox:(t,{transformPagePoint:e})=>Nn(t,e),resetTransform(t,e,n){const{transformTemplate:i}=n;e.style.transform=i?i({},""):"none",t.scheduleRender()},restoreTransform(t,e){t.style.transform=e.style.transform},removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]},makeTargetAnimatable(t,{transition:e,transitionEnd:n,...i},{transformValues:o},s=!0){let r=function(t,e,n){var i;const o={};for(const s in t){const t=ko(s,e);o[s]=void 0!==t?t:null===(i=n.getValue(s))||void 0===i?void 0:i.get()}return o}(i,e||{},t);if(o&&(n&&(n=o(n)),i&&(i=o(i)),r&&(r=o(r))),s){!function(t,e,n){var i,o;const s=Object.keys(e).filter(e=>!t.hasValue(e)),r=s.length;if(r)for(let a=0;a<r;a++){const r=s[a],l=e[r];let u=null;Array.isArray(l)&&(u=l[0]),null===u&&(u=null!==(o=null!==(i=n[r])&&void 0!==i?i:t.readValue(r))&&void 0!==o?o:e[r]),null!=u&&("string"==typeof u&&(/^\-?\d*\.?\d+$/.test(u)||So(u))?u=parseFloat(u):!Ro(u)&&ct.test(l)&&(u=Jn(r,l)),t.addValue(r,Vi(u)),void 0===n[r]&&(n[r]=u),t.setBaseTarget(r,u))}}(t,i,r);const e=hs(t,i,r,n);n=e.transitionEnd,i=e.target}return{transition:e,transitionEnd:n,...i}},scrapeMotionValuesFromProps:G,build(t,e,n,i,o){void 0!==t.isVisible&&(e.style.visibility=t.isVisible?"visible":"hidden"),H(e,n,i,o.transformTemplate)},render:W},ps=Zo(ds),ms={animation:hi(({visualElement:t,animate:n})=>{t.animationState||(t.animationState=$o(t)),F(n)&&e(()=>n.subscribe(t),[n])}),exit:hi(t=>{const{custom:n,visualElement:o}=t,[s,r]=pi(),a=i(A);e(()=>{o.isPresent=s;const t=o.animationState&&o.animationState.setActive(wn.Exit,!s,{custom:a&&a.custom||n});t&&!s&&t.then(r)},[s])})};function fs(t,e,n){return(i,o)=>{ft(i)&&!hn()&&(t.animationState&&t.animationState.setActive(wn.Hover,e),n&&n(i,o))}}const vs=(t,e)=>!!e&&(t===e||vs(t,e.parentElement));const gs=new WeakMap,ys=new WeakMap,xs=t=>{const e=gs.get(t.target);e&&e(t)},bs=t=>{t.forEach(xs)};function Ps(t,e,n){const i=function({root:t,...e}){const n=t||document;ys.has(n)||ys.set(n,{});const i=ys.get(n),o=JSON.stringify(e);return i[o]||(i[o]=new IntersectionObserver(bs,{root:t,...e})),i[o]}(e);return gs.set(t,n),i.observe(t),()=>{gs.delete(t),i.unobserve(t)}}const As={some:0,all:1};function Ts(t,n,i,{root:o,margin:s,amount:r="some",once:a}){e(()=>{if(!t)return;const e={root:null==o?void 0:o.current,rootMargin:s,threshold:"number"==typeof r?r:As[r]};return Ps(i.getInstance(),e,t=>{const{isIntersecting:e}=t;if(n.isInView===e)return;if(n.isInView=e,a&&!e&&n.hasEnteredView)return;e&&(n.hasEnteredView=!0),i.animationState&&i.animationState.setActive(wn.InView,e);const o=i.getProps(),s=e?o.onViewportEnter:o.onViewportLeave;s&&s(t)})},[t,o,s,r])}function ws(t,n,i,{fallback:o=!0}){e(()=>{var e,s;t&&o&&("production"!==Xo&&(e="IntersectionObserver not available on this device. whileInView animations will trigger on mount.",!1||Yo.has(e)||(console.warn(e),s&&console.warn(s),Yo.add(e))),requestAnimationFrame(()=>{n.hasEnteredView=!0;const{onViewportEnter:t}=i.getProps();t&&t(null),i.animationState&&i.animationState.setActive(wn.InView,!0)}))},[t])}const Ss={inView:hi((function({visualElement:t,whileInView:e,onViewportEnter:i,onViewportLeave:o,viewport:s={}}){const r=n({hasEnteredView:!1,isInView:!1});let a=Boolean(e||i||o);s.once&&r.current.hasEnteredView&&(a=!1),("undefined"==typeof IntersectionObserver?ws:Ts)(a,r.current,t,s)})),tap:hi((function({onTap:t,onTapStart:e,onTapCancel:i,whileTap:o,visualElement:s}){const r=t||e||i||o,a=n(!1),l=n(null),u={passive:!(e||t||i||m)};function c(){l.current&&l.current(),l.current=null}function h(){return c(),a.current=!1,s.animationState&&s.animationState.setActive(wn.Tap,!1),!hn()}function d(e,n){h()&&(vs(s.getInstance(),e.target)?t&&t(e,n):i&&i(e,n))}function p(t,e){h()&&i&&i(t,e)}function m(t,n){c(),a.current||(a.current=!0,l.current=ce(Gt(window,"pointerup",d,u),Gt(window,"pointercancel",p,u)),s.animationState&&s.animationState.setActive(wn.Tap,!0),e&&e(t,n))}Ht(s,"pointerdown",r?m:void 0,u),ci(c)})),focus:hi((function({whileFocus:t,visualElement:e}){const{animationState:n}=e;Bt(e,"focus",t?()=>{n&&n.setActive(wn.Focus,!0)}:void 0),Bt(e,"blur",t?()=>{n&&n.setActive(wn.Focus,!1)}:void 0)})),hover:hi((function({onHoverStart:t,onHoverEnd:e,whileHover:n,visualElement:i}){Ht(i,"pointerenter",t||n?fs(i,!0,t):void 0,{passive:!t}),Ht(i,"pointerleave",e||n?fs(i,!1,e):void 0,{passive:!e})}))},Es=Zo({...ds,getBaseTarget:(t,e)=>t[e],readValueFromInstance(t,e){var n;return O.has(e)?(null===(n=_n(e))||void 0===n?void 0:n.default)||0:(e=Y.has(e)?e:X(e),t.getAttribute(e))},scrapeMotionValuesFromProps:q,build(t,e,n,i,o){K(e,n,i,o.transformTemplate)},render:Z}),Vs={...{renderer:(t,e)=>_(t)?Es(e,{enableHardwareAcceleration:!1}):ps(e,{enableHardwareAcceleration:!0}),...ms,...Ss},...di,...Ai,projectionNodeConstructor:bo};export{Vs as domMax};
1
+ import t,{useEffect as e,useRef as n,useContext as i,useId as o,createElement as s}from"react";import{q as r,t as a,v as l,w as u,x as c,y as h,z as d,A as p,B as m,i as f,C as v,D as g,E as y,a as x,u as b,M as P,P as A,F as T,G as w,g as S,L as E,S as V,d as M,r as C,H as R,I as L,J as D,K as k,n as j,N as O,m as F,c as U,f as I,b as B,l as N,O as z,Q as $,p as G,h as H,R as W,T as Y,U as X,s as q,j as K,o as Z,k as _}from"./size-rollup-dom-max-assets.js";const J=(t,e)=>n=>Boolean(r(n)&&a.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),Q=(t,e,n)=>i=>{if(!r(i))return i;const[o,s,a,u]=i.match(l);return{[t]:parseFloat(o),[e]:parseFloat(s),[n]:parseFloat(a),alpha:void 0!==u?parseFloat(u):1}},tt={test:J("hsl","hue"),parse:Q("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+u.transform(c(e))+", "+u.transform(c(n))+", "+c(h.transform(i))+")"},et=p(0,255),nt=Object.assign(Object.assign({},d),{transform:t=>Math.round(et(t))}),it={test:J("rgb","red"),parse:Q("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+nt.transform(t)+", "+nt.transform(e)+", "+nt.transform(n)+", "+c(h.transform(i))+")"};const ot={test:J("#"),parse:function(t){let e="",n="",i="",o="";return t.length>5?(e=t.substr(1,2),n=t.substr(3,2),i=t.substr(5,2),o=t.substr(7,2)):(e=t.substr(1,1),n=t.substr(2,1),i=t.substr(3,1),o=t.substr(4,1),e+=e,n+=n,i+=i,o+=o),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:o?parseInt(o,16)/255:1}},transform:it.transform},st={test:t=>it.test(t)||ot.test(t)||tt.test(t),parse:t=>it.test(t)?it.parse(t):tt.test(t)?tt.parse(t):ot.parse(t),transform:t=>r(t)?t:t.hasOwnProperty("red")?it.transform(t):tt.transform(t)};function rt(t){"number"==typeof t&&(t=""+t);const e=[];let n=0;const i=t.match(m);i&&(n=i.length,t=t.replace(m,"${c}"),e.push(...i.map(st.parse)));const o=t.match(l);return o&&(t=t.replace(l,"${n}"),e.push(...o.map(d.parse))),{values:e,numColors:n,tokenised:t}}function at(t){return rt(t).values}function lt(t){const{values:e,numColors:n,tokenised:i}=rt(t),o=e.length;return t=>{let e=i;for(let i=0;i<o;i++)e=e.replace(i<n?"${c}":"${n}",i<n?st.transform(t[i]):c(t[i]));return e}}const ut=t=>"number"==typeof t?0:t;const ct={test:function(t){var e,n,i,o;return isNaN(t)&&r(t)&&(null!==(n=null===(e=t.match(l))||void 0===e?void 0:e.length)&&void 0!==n?n:0)+(null!==(o=null===(i=t.match(m))||void 0===i?void 0:i.length)&&void 0!==o?o:0)>0},parse:at,createTransformer:lt,getAnimatableNone:function(t){const e=at(t);return lt(t)(e.map(ut))}},ht=new Set(["brightness","contrast","saturate","opacity"]);function dt(t){let[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(l)||[];if(!i)return t;const o=n.replace(i,"");let s=ht.has(e)?1:0;return i!==n&&(s*=100),e+"("+s+o+")"}const pt=/([a-z-]*)\(.*?\)/g,mt=Object.assign(Object.assign({},ct),{getAnimatableNone:t=>{const e=t.match(pt);return e?e.map(dt).join(" "):t}});function ft(t){return"undefined"!=typeof PointerEvent&&t instanceof PointerEvent?!("mouse"!==t.pointerType):t instanceof MouseEvent}function vt(t){return!!t.touches}const gt={pageX:0,pageY:0};function yt(t,e="page"){const n=t.touches[0]||t.changedTouches[0]||gt;return{x:n[e+"X"],y:n[e+"Y"]}}function xt(t,e="page"){return{x:t[e+"X"],y:t[e+"Y"]}}function bt(t,e="page"){return{point:vt(t)?yt(t,e):xt(t,e)}}const Pt=(t,e=!1)=>{const n=e=>t(e,bt(e));return e?(i=n,t=>{const e=t instanceof MouseEvent;(!e||e&&0===t.button)&&i(t)}):n;var i},At="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),Tt="undefined"!=typeof window?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(At()),1/60*1e3);let wt=!0,St=!1,Et=!1;const Vt={delta:0,timestamp:0},Mt=["read","update","preRender","render","postRender"],Ct=Mt.reduce((t,e)=>(t[e]=function(t){let e=[],n=[],i=0,o=!1,s=!1;const r=new WeakSet,a={schedule:(t,s=!1,a=!1)=>{const l=a&&o,u=l?e:n;return s&&r.add(t),-1===u.indexOf(t)&&(u.push(t),l&&o&&(i=e.length)),t},cancel:t=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1),r.delete(t)},process:l=>{if(o)s=!0;else{if(o=!0,[e,n]=[n,e],n.length=0,i=e.length,i)for(let n=0;n<i;n++){const i=e[n];i(l),r.has(i)&&(a.schedule(i),t())}o=!1,s&&(s=!1,a.process(l))}}};return a}(()=>St=!0),t),{}),Rt=Mt.reduce((t,e)=>{const n=Ct[e];return t[e]=(t,e=!1,i=!1)=>(St||Ot(),n.schedule(t,e,i)),t},{}),Lt=Mt.reduce((t,e)=>(t[e]=Ct[e].cancel,t),{}),Dt=Mt.reduce((t,e)=>(t[e]=()=>Ct[e].process(Vt),t),{}),kt=t=>Ct[t].process(Vt),jt=t=>{St=!1,Vt.delta=wt?1/60*1e3:Math.max(Math.min(t-Vt.timestamp,40),1),Vt.timestamp=t,Et=!0,Mt.forEach(kt),Et=!1,St&&(wt=!1,Tt(jt))},Ot=()=>{St=!0,wt=!0,Et||Tt(jt)},Ft=()=>Vt,Ut=t=>1e3*t;function It(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}function Bt(t,n,i,o){e(()=>{const e=t.current;if(i&&e)return It(e,n,i,o)},[t,n,i,o])}const Nt={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},zt={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function $t(t){return f&&null===window.onpointerdown?t:f&&null===window.ontouchstart?zt[t]:f&&null===window.onmousedown?Nt[t]:t}function Gt(t,e,n,i){return It(t,$t(e),Pt(n,"pointerdown"===e),i)}function Ht(t,e,n,i){return Bt(t,$t(e),n&&Pt(n,"pointerdown"===e),i)}function Wt(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(t);o<i.length;o++)e.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(t,i[o])&&(n[i[o]]=t[i[o]])}return n}const Yt=(t,e,n)=>Math.min(Math.max(n,t),e);function Xt({duration:t=800,bounce:e=.25,velocity:n=0,mass:i=1}){let o,s,r=1-e;r=Yt(.05,1,r),t=Yt(.01,10,t/1e3),r<1?(o=e=>{const i=e*r,o=i*t;return.001-(i-n)/qt(e,r)*Math.exp(-o)},s=e=>{const i=e*r*t,s=i*n+n,a=Math.pow(r,2)*Math.pow(e,2)*t,l=Math.exp(-i),u=qt(Math.pow(e,2),r);return(.001-o(e)>0?-1:1)*((s-a)*l)/u}):(o=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,s=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let i=n;for(let n=1;n<12;n++)i-=t(i)/e(i);return i}(o,s,5/t);if(t*=1e3,isNaN(a))return{stiffness:100,damping:10,duration:t};{const e=Math.pow(a,2)*i;return{stiffness:e,damping:2*r*Math.sqrt(i*e),duration:t}}}function qt(t,e){return t*Math.sqrt(1-e*e)}const Kt=["duration","bounce"],Zt=["stiffness","damping","mass"];function _t(t,e){return e.some(e=>void 0!==t[e])}function Jt(t){var{from:e=0,to:n=1,restSpeed:i=2,restDelta:o}=t,s=Wt(t,["from","to","restSpeed","restDelta"]);const r={done:!1,value:e};let{stiffness:a,damping:l,mass:u,velocity:c,duration:h,isResolvedFromDuration:d}=function(t){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},t);if(!_t(t,Zt)&&_t(t,Kt)){const n=Xt(t);e=Object.assign(Object.assign(Object.assign({},e),n),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}(s),p=Qt,m=Qt;function f(){const t=c?-c/1e3:0,i=n-e,s=l/(2*Math.sqrt(a*u)),r=Math.sqrt(a/u)/1e3;if(void 0===o&&(o=Math.min(Math.abs(n-e)/100,.4)),s<1){const e=qt(r,s);p=o=>{const a=Math.exp(-s*r*o);return n-a*((t+s*r*i)/e*Math.sin(e*o)+i*Math.cos(e*o))},m=n=>{const o=Math.exp(-s*r*n);return s*r*o*(Math.sin(e*n)*(t+s*r*i)/e+i*Math.cos(e*n))-o*(Math.cos(e*n)*(t+s*r*i)-e*i*Math.sin(e*n))}}else if(1===s)p=e=>n-Math.exp(-r*e)*(i+(t+r*i)*e);else{const e=r*Math.sqrt(s*s-1);p=o=>{const a=Math.exp(-s*r*o),l=Math.min(e*o,300);return n-a*((t+s*r*i)*Math.sinh(l)+e*i*Math.cosh(l))/e}}}return f(),{next:t=>{const e=p(t);if(d)r.done=t>=h;else{const s=1e3*m(t),a=Math.abs(s)<=i,l=Math.abs(n-e)<=o;r.done=a&&l}return r.value=r.done?n:e,r},flipTarget:()=>{c=-c,[e,n]=[n,e],f()}}}Jt.needsInterpolation=(t,e)=>"string"==typeof t||"string"==typeof e;const Qt=t=>0,te=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i},ee=(t,e,n)=>-n*t+n*e+t;function ne(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 ie({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let o=0,s=0,r=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;o=ne(a,i,t+1/3),s=ne(a,i,t),r=ne(a,i,t-1/3)}else o=s=r=n;return{red:Math.round(255*o),green:Math.round(255*s),blue:Math.round(255*r),alpha:i}}const oe=(t,e,n)=>{const i=t*t,o=e*e;return Math.sqrt(Math.max(0,n*(o-i)+i))},se=[ot,it,tt],re=t=>se.find(e=>e.test(t)),ae=(t,e)=>{let n=re(t),i=re(e),o=n.parse(t),s=i.parse(e);n===tt&&(o=ie(o),n=it),i===tt&&(s=ie(s),i=it);const r=Object.assign({},o);return t=>{for(const e in r)"alpha"!==e&&(r[e]=oe(o[e],s[e],t));return r.alpha=ee(o.alpha,s.alpha,t),n.transform(r)}},le=t=>"number"==typeof t,ue=(t,e)=>n=>e(t(n)),ce=(...t)=>t.reduce(ue);function he(t,e){return le(t)?n=>ee(t,e,n):st.test(t)?ae(t,e):fe(t,e)}const de=(t,e)=>{const n=[...t],i=n.length,o=t.map((t,n)=>he(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=o[e](t);return n}},pe=(t,e)=>{const n=Object.assign(Object.assign({},t),e),i={};for(const o in n)void 0!==t[o]&&void 0!==e[o]&&(i[o]=he(t[o],e[o]));return t=>{for(const e in i)n[e]=i[e](t);return n}};function me(t){const e=ct.parse(t),n=e.length;let i=0,o=0,s=0;for(let t=0;t<n;t++)i||"number"==typeof e[t]?i++:void 0!==e[t].hue?s++:o++;return{parsed:e,numNumbers:i,numRGB:o,numHSL:s}}const fe=(t,e)=>{const n=ct.createTransformer(e),i=me(t),o=me(e);return i.numHSL===o.numHSL&&i.numRGB===o.numRGB&&i.numNumbers>=o.numNumbers?ce(de(i.parsed,o.parsed),n):n=>""+(n>0?e:t)},ve=(t,e)=>n=>ee(t,e,n);function ge(t,e,n){const i=[],o=n||("number"==typeof(s=t[0])?ve:"string"==typeof s?st.test(s)?ae:fe:Array.isArray(s)?de:"object"==typeof s?pe:void 0);var s;const r=t.length-1;for(let n=0;n<r;n++){let s=o(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]:e;s=ce(t,s)}i.push(s)}return i}function ye(t,e,{clamp:n=!0,ease:i,mixer:o}={}){const s=t.length;e.length,!i||!Array.isArray(i)||i.length,t[0]>t[s-1]&&(t=[].concat(t),e=[].concat(e),t.reverse(),e.reverse());const r=ge(e,i,o),a=2===s?function([t,e],[n]){return i=>n(te(t,e,i))}(t,r):function(t,e){const n=t.length,i=n-1;return o=>{let s=0,r=!1;if(o<=t[0]?r=!0:o>=t[i]&&(s=i-1,r=!0),!r){let e=1;for(;e<n&&!(t[e]>o||e===i);e++);s=e-1}const a=te(t[s],t[s+1],o);return e[s](a)}}(t,r);return n?e=>a(Yt(t[0],t[s-1],e)):a}const xe=t=>e=>1-t(1-e),be=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Pe=t=>e=>e*e*((t+1)*e-t),Ae=t=>t,Te=(we=2,t=>Math.pow(t,we));var we;const Se=xe(Te),Ee=be(Te),Ve=t=>1-Math.sin(Math.acos(t)),Me=xe(Ve),Ce=be(Me),Re=Pe(1.525),Le=xe(Re),De=be(Re),ke=(t=>{const e=Pe(t);return t=>(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))})(1.525),je=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},Oe=xe(je);function Fe(t,e){return t.map(()=>e||Ee).splice(0,t.length-1)}function Ue({from:t=0,to:e=1,ease:n,offset:i,duration:o=300}){const s={done:!1,value:t},r=Array.isArray(e)?e:[t,e],a=function(t,e){return t.map(t=>t*e)}(i&&i.length===r.length?i:function(t){const e=t.length;return t.map((t,n)=>0!==n?n/(e-1):0)}(r),o);function l(){return ye(a,r,{ease:Array.isArray(n)?n:Fe(r,n)})}let u=l();return{next:t=>(s.value=u(t),s.done=t>=o,s),flipTarget:()=>{r.reverse(),u=l()}}}const Ie={keyframes:Ue,spring:Jt,decay:function({velocity:t=0,from:e=0,power:n=.8,timeConstant:i=350,restDelta:o=.5,modifyTarget:s}){const r={done:!1,value:e};let a=n*t;const l=e+a,u=void 0===s?l:s(l);return u!==l&&(a=u-e),{next:t=>{const e=-a*Math.exp(-t/i);return r.done=!(e>o||e<-o),r.value=r.done?u:u+e,r},flipTarget:()=>{}}}};function Be(t,e,n=0){return t-e-n}const Ne=t=>{const e=({delta:e})=>t(e);return{start:()=>Rt.update(e,!0),stop:()=>Lt.update(e)}};function ze(t){var e,n,{from:i,autoplay:o=!0,driver:s=Ne,elapsed:r=0,repeat:a=0,repeatType:l="loop",repeatDelay:u=0,onPlay:c,onStop:h,onComplete:d,onRepeat:p,onUpdate:m}=t,f=Wt(t,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let v,g,y,{to:x}=f,b=0,P=f.duration,A=!1,T=!0;const w=function(t){if(Array.isArray(t.to))return Ue;if(Ie[t.type])return Ie[t.type];const e=new Set(Object.keys(t));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?Ue:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?Jt:Ue}(f);(null===(n=(e=w).needsInterpolation)||void 0===n?void 0:n.call(e,i,x))&&(y=ye([0,100],[i,x],{clamp:!1}),i=0,x=100);const S=w(Object.assign(Object.assign({},f),{from:i,to:x}));function E(){b++,"reverse"===l?(T=b%2==0,r=function(t,e,n=0,i=!0){return i?Be(e+-t,e,n):e-(t-e)+n}(r,P,u,T)):(r=Be(r,P,u),"mirror"===l&&S.flipTarget()),A=!1,p&&p()}function V(t){if(T||(t=-t),r+=t,!A){const t=S.next(Math.max(0,r));g=t.value,y&&(g=y(g)),A=T?t.done:r<=0}null==m||m(g),A&&(0===b&&(null!=P||(P=r)),b<a?function(t,e,n,i){return i?t>=e+n:t<=-n}(r,P,u,T)&&E():(v.stop(),d&&d()))}return o&&(null==c||c(),v=s(V),v.start()),{stop:()=>{null==h||h(),v.stop()}}}function $e(t,e){return e?t*(1e3/e):0}const Ge=t=>t.hasOwnProperty("x")&&t.hasOwnProperty("y"),He=t=>Ge(t)&&t.hasOwnProperty("z"),We=(t,e)=>Math.abs(t-e);function Ye(t,e){if(le(t)&&le(e))return We(t,e);if(Ge(t)&&Ge(e)){const n=We(t.x,e.x),i=We(t.y,e.y),o=He(t)&&He(e)?We(t.z,e.z):0;return Math.sqrt(Math.pow(n,2)+Math.pow(i,2)+Math.pow(o,2))}}const Xe=(t,e)=>1-3*e+3*t,qe=(t,e)=>3*e-6*t,Ke=t=>3*t,Ze=(t,e,n)=>((Xe(e,n)*t+qe(e,n))*t+Ke(e))*t,_e=(t,e,n)=>3*Xe(e,n)*t*t+2*qe(e,n)*t+Ke(e);function Je(t,e,n,i){if(t===e&&n===i)return Ae;const o=new Float32Array(11);for(let e=0;e<11;++e)o[e]=Ze(.1*e,t,n);function s(e){let i=0,s=1;for(;10!==s&&o[s]<=e;++s)i+=.1;--s;const r=i+.1*((e-o[s])/(o[s+1]-o[s])),a=_e(r,t,n);return a>=.001?function(t,e,n,i){for(let o=0;o<8;++o){const o=_e(e,n,i);if(0===o)return e;e-=(Ze(e,n,i)-t)/o}return e}(e,r,t,n):0===a?r:function(t,e,n,i,o){let s,r,a=0;do{r=e+(n-e)/2,s=Ze(r,i,o)-t,s>0?n=r:e=r}while(Math.abs(s)>1e-7&&++a<10);return r}(e,i,i+.1,t,n)}return t=>0===t||1===t?t:Ze(s(t),e,i)}class Qe{constructor(t,e,{transformPagePoint:n}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const t=nn(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=Ye(t.offset,{x:0,y:0})>=3;if(!e&&!n)return;const{point:i}=t,{timestamp:o}=Ft();this.history.push({...i,timestamp:o});const{onStart:s,onMove:r}=this.handlers;e||(s&&s(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),r&&r(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=tn(e,this.transformPagePoint),ft(t)&&0===t.buttons?this.handlePointerUp(t,e):Rt.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:n,onSessionEnd:i}=this.handlers,o=nn(tn(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,o),i&&i(t,o)},vt(t)&&t.touches.length>1)return;this.handlers=e,this.transformPagePoint=n;const i=tn(bt(t),this.transformPagePoint),{point:o}=i,{timestamp:s}=Ft();this.history=[{...o,timestamp:s}];const{onSessionStart:r}=e;r&&r(t,nn(i,this.history)),this.removeListeners=ce(Gt(window,"pointermove",this.handlePointerMove),Gt(window,"pointerup",this.handlePointerUp),Gt(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Lt.update(this.updatePoint)}}function tn(t,e){return e?{point:e(t.point)}:t}function en(t,e){return{x:t.x-e.x,y:t.y-e.y}}function nn({point:t},e){return{point:t,delta:en(t,sn(e)),offset:en(t,on(e)),velocity:rn(e,.1)}}function on(t){return t[0]}function sn(t){return t[t.length-1]}function rn(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const o=sn(t);for(;n>=0&&(i=t[n],!(o.timestamp-i.timestamp>Ut(e)));)n--;if(!i)return{x:0,y:0};const s=(o.timestamp-i.timestamp)/1e3;if(0===s)return{x:0,y:0};const r={x:(o.x-i.x)/s,y:(o.y-i.y)/s};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function an(t){let e=null;return()=>{const n=()=>{e=null};return null===e&&(e=t,n)}}const ln=an("dragHorizontal"),un=an("dragVertical");function cn(t){let e=!1;if("y"===t)e=un();else if("x"===t)e=ln();else{const t=ln(),n=un();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}function hn(){const t=cn(!0);return!t||(t(),!1)}function dn(t){return t.max-t.min}function pn(t,e=0,n=.01){return Ye(t,e)<n}function mn(t,e,n,i=.5){t.origin=i,t.originPoint=ee(e.min,e.max,t.origin),t.scale=dn(n)/dn(e),(pn(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=ee(n.min,n.max,t.origin)-t.originPoint,(pn(t.translate)||isNaN(t.translate))&&(t.translate=0)}function fn(t,e,n,i){mn(t.x,e.x,n.x,null==i?void 0:i.originX),mn(t.y,e.y,n.y,null==i?void 0:i.originY)}function vn(t,e,n){t.min=n.min+e.min,t.max=t.min+dn(e)}function gn(t,e,n){t.min=e.min-n.min,t.max=t.min+dn(e)}function yn(t,e,n){gn(t.x,e.x,n.x),gn(t.y,e.y,n.y)}function xn(t,e,n){return{min:void 0!==e?t.min+e:void 0,max:void 0!==n?t.max+n-(t.max-t.min):void 0}}function bn(t,e){let n=e.min-t.min,i=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,i]=[i,n]),{min:n,max:i}}const Pn=.35;function An(t,e,n){return{min:Tn(t,e),max:Tn(t,n)}}function Tn(t,e){var n;return"number"==typeof t?t:null!==(n=t[e])&&void 0!==n?n:0}var wn;!function(t){t.Animate="animate",t.Hover="whileHover",t.Tap="whileTap",t.Drag="whileDrag",t.Focus="whileFocus",t.InView="whileInView",t.Exit="exit"}(wn||(wn={}));function Sn(t){return[t("x"),t("y")]}function En({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function Vn(t){return void 0===t||1===t}function Mn({scale:t,scaleX:e,scaleY:n}){return!Vn(t)||!Vn(e)||!Vn(n)}function Cn(t){return Mn(t)||Rn(t.x)||Rn(t.y)||t.z||t.rotate||t.rotateX||t.rotateY}function Rn(t){return t&&"0%"!==t}function Ln(t,e,n){return n+e*(t-n)}function Dn(t,e,n,i,o){return void 0!==o&&(t=Ln(t,o,i)),Ln(t,n,i)+e}function kn(t,e=0,n=1,i,o){t.min=Dn(t.min,e,n,i,o),t.max=Dn(t.max,e,n,i,o)}function jn(t,{x:e,y:n}){kn(t.x,e.translate,e.scale,e.originPoint),kn(t.y,n.translate,n.scale,n.originPoint)}function On(t,e){t.min=t.min+e,t.max=t.max+e}function Fn(t,e,[n,i,o]){const s=void 0!==e[o]?e[o]:.5,r=ee(t.min,t.max,s);kn(t,e[n],e[i],r,e.scale)}const Un=["x","scaleX","originX"],In=["y","scaleY","originY"];function Bn(t,e){Fn(t.x,e,Un),Fn(t.y,e,In)}function Nn(t,e){return En(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}(t.getBoundingClientRect(),e))}const zn={linear:Ae,easeIn:Te,easeInOut:Ee,easeOut:Se,circIn:Ve,circInOut:Ce,circOut:Me,backIn:Re,backInOut:De,backOut:Le,anticipate:ke,bounceIn:Oe,bounceInOut:t=>t<.5?.5*(1-je(1-2*t)):.5*je(2*t-1)+.5,bounceOut:je},$n=t=>{if(Array.isArray(t)){t.length;const[e,n,i,o]=t;return Je(e,n,i,o)}return"string"==typeof t?zn[t]:t},Gn=(t,e)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!ct.test(e)||e.startsWith("url("))),Hn=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),Wn=t=>({type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restSpeed:10}),Yn=()=>({type:"keyframes",ease:"linear",duration:.3}),Xn=t=>({type:"keyframes",duration:.8,values:t}),qn={x:Hn,y:Hn,z:Hn,rotate:Hn,rotateX:Hn,rotateY:Hn,rotateZ:Hn,scaleX:Wn,scaleY:Wn,scale:Wn,opacity:Yn,backgroundColor:Yn,color:Yn,default:Wn},Kn=(t,e)=>{let n;return n=v(e)?Xn:qn[t]||qn.default,{to:e,...n(e)}},Zn={...g,color:st,backgroundColor:st,outlineColor:st,fill:st,stroke:st,borderColor:st,borderTopColor:st,borderRightColor:st,borderBottomColor:st,borderLeftColor:st,filter:mt,WebkitFilter:mt},_n=t=>Zn[t];function Jn(t,e){var n;let i=_n(t);return i!==mt&&(i=ct),null===(n=i.getAnimatableNone)||void 0===n?void 0:n.call(i,e)}const Qn=!1;function ti({ease:t,times:e,yoyo:n,flip:i,loop:o,...s}){const r={...s};return e&&(r.offset=e),s.duration&&(r.duration=Ut(s.duration)),s.repeatDelay&&(r.repeatDelay=Ut(s.repeatDelay)),t&&(r.ease=(t=>Array.isArray(t)&&"number"!=typeof t[0])(t)?t.map($n):$n(t)),"tween"===s.type&&(r.type="keyframes"),(n||o||i)&&(n?r.repeatType="reverse":o?r.repeatType="loop":i&&(r.repeatType="mirror"),r.repeat=o||n||i||s.repeat),"spring"!==s.type&&(r.type="keyframes"),r}function ei(t,e,n){return Array.isArray(e.to)&&void 0===t.duration&&(t.duration=.8),function(t){Array.isArray(t.to)&&null===t.to[0]&&(t.to=[...t.to],t.to[0]=t.from)}(e),function({when:t,delay:e,delayChildren:n,staggerChildren:i,staggerDirection:o,repeat:s,repeatType:r,repeatDelay:a,from:l,...u}){return!!Object.keys(u).length}(t)||(t={...t,...Kn(n,e.to)}),{...e,...ti(t)}}function ni(t,e,n,i,o){const s=si(i,t)||{};let r=void 0!==s.from?s.from:e.get();const a=Gn(t,n);"none"===r&&a&&"string"==typeof n?r=Jn(t,n):ii(r)&&"string"==typeof n?r=oi(n):!Array.isArray(n)&&ii(n)&&"string"==typeof r&&(n=oi(r));return Gn(t,r)&&a&&!1!==s.type?function(){const i={from:r,to:n,velocity:e.getVelocity(),onComplete:o,onUpdate:t=>e.set(t)};return"inertia"===s.type||"decay"===s.type?function({from:t=0,velocity:e=0,min:n,max:i,power:o=.8,timeConstant:s=750,bounceStiffness:r=500,bounceDamping:a=10,restDelta:l=1,modifyTarget:u,driver:c,onUpdate:h,onComplete:d,onStop:p}){let m;function f(t){return void 0!==n&&t<n||void 0!==i&&t>i}function v(t){return void 0===n?i:void 0===i||Math.abs(n-t)<Math.abs(i-t)?n:i}function g(t){null==m||m.stop(),m=ze(Object.assign(Object.assign({},t),{driver:c,onUpdate:e=>{var n;null==h||h(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:r,damping:a,restDelta:l},t))}if(f(t))y({from:t,velocity:e,to:v(t)});else{let i=o*e+t;void 0!==u&&(i=u(i));const r=v(i),a=r===n?-1:1;let c,h;const d=t=>{c=h,h=t,e=$e(t-c,Ft().delta),(1===a&&t>r||-1===a&&t<r)&&y({from:t,to:r,velocity:e})};g({type:"decay",from:t,velocity:e,timeConstant:s,power:o,restDelta:l,modifyTarget:u,onUpdate:f(i)?d:void 0})}return{stop:()=>null==m?void 0:m.stop()}}({...i,...s}):ze({...ei(s,i,t),onUpdate:t=>{i.onUpdate(t),s.onUpdate&&s.onUpdate(t)},onComplete:()=>{i.onComplete(),s.onComplete&&s.onComplete()}})}:function(){const t=y(n);return e.set(t),o(),s.onUpdate&&s.onUpdate(t),s.onComplete&&s.onComplete(),{stop:()=>{}}}}function ii(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function oi(t){return"number"==typeof t?0:Jn("",t)}function si(t,e){return t[e]||t.default||t}function ri(t,e,n,i={}){return Qn&&(i={type:!1}),e.start(o=>{let s,r;const a=ni(t,e,n,i,o),l=function(t,e){var n,i;return null!==(i=null!==(n=(si(t,e)||{}).delay)&&void 0!==n?n:t.delay)&&void 0!==i?i:0}(i,t),u=()=>r=a();return l?s=window.setTimeout(u,Ut(l)):u(),()=>{clearTimeout(s),r&&r.stop()}})}const ai=new WeakMap;class li{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.visualElement=t}start(t,{snapToCursor:e=!1}={}){if(!1===this.visualElement.isPresent)return;this.panSession=new Qe(t,{onSessionStart:t=>{this.stopAnimation(),e&&this.snapToCursor(bt(t,"page").point)},onStart:(t,e)=>{var n;const{drag:i,dragPropagation:o,onDragStart:s}=this.getProps();(!i||o||(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=cn(i),this.openGlobalLock))&&(this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Sn(t=>{var e,n;let i=this.getAxisMotionValue(t).get()||0;if(u.test(i)){const o=null===(n=null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout)||void 0===n?void 0:n.actual[t];if(o){i=dn(o)*(parseFloat(i)/100)}}this.originPoint[t]=i}),null==s||s(t,e),null===(n=this.visualElement.animationState)||void 0===n||n.setActive(wn.Drag,!0))},onMove:(t,e)=>{const{dragPropagation:n,dragDirectionLock:i,onDirectionLock:o,onDrag:s}=this.getProps();if(!n&&!this.openGlobalLock)return;const{offset:r}=e;if(i&&null===this.currentDirection)return this.currentDirection=function(t,e=10){let n=null;Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x");return n}(r),void(null!==this.currentDirection&&(null==o||o(this.currentDirection)));this.updateAxis("x",e.point,r),this.updateAxis("y",e.point,r),this.visualElement.syncRender(),null==s||s(t,e)},onSessionEnd:(t,e)=>this.stop(t,e)},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(t,e){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:i}=e;this.startAnimation(i);const{onDragEnd:o}=this.getProps();null==o||o(t,e)}cancel(){var t,e;this.isDragging=!1,this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!1),null===(t=this.panSession)||void 0===t||t.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),null===(e=this.visualElement.animationState)||void 0===e||e.setActive(wn.Drag,!1)}updateAxis(t,e,n){const{drag:i}=this.getProps();if(!n||!ui(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let s=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(s=function(t,{min:e,max:n},i){return void 0!==e&&t<e?t=i?ee(e,t,i.min):Math.max(t,e):void 0!==n&&t>n&&(t=i?ee(n,t,i.max):Math.min(t,n)),t}(s,this.constraints[t],this.elastic[t])),o.set(s)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),{layout:n}=this.visualElement.projection||{},i=this.constraints;t&&x(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:i,right:o}){return{x:xn(t.x,n,o),y:xn(t.y,e,i)}}(n.actual,t),this.elastic=function(t=Pn){return!1===t?t=0:!0===t&&(t=Pn),{x:An(t,"left","right"),y:An(t,"top","bottom")}}(e),i!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&Sn(t=>{this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(n.actual[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!x(t))return!1;const n=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=function(t,e,n){const i=Nn(t,n),{scroll:o}=e;return o&&(On(i.x,o.x),On(i.y,o.y)),i}(n,i.root,this.visualElement.getTransformPagePoint());let s=function(t,e){return{x:bn(t.x,e.x),y:bn(t.y,e.y)}}(i.layout.actual,o);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(s));this.hasMutatedConstraints=!!t,t&&(s=En(t))}return s}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:i,dragTransition:o,dragSnapToOrigin:s,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},l=Sn(r=>{var l;if(!ui(r,e,this.currentDirection))return;let u=null!==(l=null==a?void 0:a[r])&&void 0!==l?l:{};s&&(u={min:0,max:0});const c=i?200:1e6,h=i?40:1e7,d={type:"inertia",velocity:n?t[r]:0,bounceStiffness:c,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...o,...u};return this.startAxisValueAnimation(r,d)});return Promise.all(l).then(r)}startAxisValueAnimation(t,e){return ri(t,this.getAxisMotionValue(t),0,e)}stopAnimation(){Sn(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){var e,n;const i="_drag"+t.toUpperCase(),o=this.visualElement.getProps()[i];return o||this.visualElement.getValue(t,null!==(n=null===(e=this.visualElement.getProps().initial)||void 0===e?void 0:e[t])&&void 0!==n?n:0)}snapToCursor(t){Sn(e=>{const{drag:n}=this.getProps();if(!ui(e,n,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(e);if(i&&i.layout){const{min:n,max:s}=i.layout.actual[e];o.set(t[e]-ee(n,s,.5))}})}scalePositionWithinConstraints(){var t;const{drag:e,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!x(n)||!i||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Sn(t=>{const e=this.getAxisMotionValue(t);if(e){const n=e.get();o[t]=function(t,e){let n=.5;const i=dn(t),o=dn(e);return o>i?n=te(e.min,e.max-i,t.min):i>o&&(n=te(t.min,t.max-o,e.min)),Yt(0,1,n)}({min:n,max:n},this.constraints[t])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.getInstance().style.transform=s?s({},""):"none",null===(t=i.root)||void 0===t||t.updateScroll(),i.updateLayout(),this.resolveConstraints(),Sn(t=>{if(!ui(t,e,null))return;const n=this.getAxisMotionValue(t),{min:i,max:s}=this.constraints[t];n.set(ee(i,s,o[t]))})}addListeners(){var t;ai.set(this.visualElement,this);const e=Gt(this.visualElement.getInstance(),"pointerdown",t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)}),n=()=>{const{dragConstraints:t}=this.getProps();x(t)&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,o=i.addEventListener("measure",n);i&&!i.layout&&(null===(t=i.root)||void 0===t||t.updateScroll(),i.updateLayout()),n();const s=It(window,"resize",()=>this.scalePositionWithinConstraints()),r=i.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(Sn(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.syncRender())});return()=>{s(),e(),o(),null==r||r()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:s=Pn,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:i,dragConstraints:o,dragElastic:s,dragMomentum:r}}}function ui(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}function ci(t){return e(()=>()=>t(),[])}const hi=t=>e=>(t(e),null),di={pan:hi((function({onPan:t,onPanStart:o,onPanEnd:s,onPanSessionStart:r,visualElement:a}){const l=t||o||s||r,u=n(null),{transformPagePoint:c}=i(P),h={onSessionStart:r,onStart:o,onMove:t,onEnd:(t,e)=>{u.current=null,s&&s(t,e)}};e(()=>{null!==u.current&&u.current.updateHandlers(h)}),Ht(a,"pointerdown",l&&function(t){u.current=new Qe(t,h,{transformPagePoint:c})}),ci(()=>u.current&&u.current.end())})),drag:hi((function(t){const{dragControls:n,visualElement:i}=t,o=b(()=>new li(i));e(()=>n&&n.subscribe(o),[o,n]),e(()=>o.addListeners(),[o])}))};function pi(){const t=i(A);if(null===t)return[!0,null];const{isPresent:n,onExitComplete:s,register:r}=t,a=o();e(()=>r(a),[]);return!n&&s?[!1,()=>s&&s(a)]:[!0]}function mi(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const fi={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!T.test(t))return t;t=parseFloat(t)}return`${mi(t,e.target.x)}% ${mi(t,e.target.y)}%`}};function vi(t){return"string"==typeof t&&t.startsWith("var(--")}const gi=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function yi(t,e,n=1){const[i,o]=function(t){const e=gi.exec(t);if(!e)return[,];const[,n,i]=e;return[n,i]}(t);if(!i)return;const s=window.getComputedStyle(e).getPropertyValue(i);return s?s.trim():vi(o)?yi(o,e,n+1):o}const xi={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,o=t.includes("var("),s=[];o&&(t=t.replace(gi,t=>(s.push(t),"_$css")));const r=ct.parse(t);if(r.length>5)return i;const a=ct.createTransformer(t),l="number"!=typeof r[0]?1:0,u=n.x.scale*e.x,c=n.y.scale*e.y;r[0+l]/=u,r[1+l]/=c;const h=ee(u,c,.5);"number"==typeof r[2+l]&&(r[2+l]/=h),"number"==typeof r[3+l]&&(r[3+l]/=h);let d=a(r);if(o){let t=0;d=d.replace("_$css",()=>{const e=s[t];return t++,e})}return d}};class bi extends t.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:i}=this.props,{projection:o}=t;w(Pi),o&&(e.group&&e.group.add(o),n&&n.register&&i&&n.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),S.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:i,isPresent:o}=this.props,s=n.projection;return s?(s.isPresent=o,i||t.layoutDependency!==e||void 0===e?s.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?s.promote():s.relegate()||Rt.postRender(()=>{var t;(null===(t=s.getStack())||void 0===t?void 0:t.members.length)||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),!t.currentAnimation&&t.isLead()&&this.safeToRemove())}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),(null==e?void 0:e.group)&&e.group.remove(i),(null==n?void 0:n.deregister)&&n.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;null==t||t()}render(){return null}}const Pi={borderRadius:{...fi,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:fi,borderTopRightRadius:fi,borderBottomLeftRadius:fi,borderBottomRightRadius:fi,boxShadow:xi},Ai={measureLayout:function(e){const[n,o]=pi(),s=i(E);return t.createElement(bi,{...e,layoutGroup:s,switchLayoutGroup:i(V),isPresent:n,safeToRemove:o})}};function Ti(t,e){-1===t.indexOf(e)&&t.push(e)}function wi(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class Si{constructor(){this.subscriptions=[]}add(t){return Ti(this.subscriptions,t),()=>wi(this.subscriptions,t)}notify(t,e,n){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,n);else for(let o=0;o<i;o++){const i=this.subscriptions[o];i&&i(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}class Ei{constructor(t){var e;this.version="7.3.3",this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new Si,this.velocityUpdateSubscribers=new Si,this.renderSubscribers=new Si,this.canTrackVelocity=!1,this.updateAndNotify=(t,e=!0)=>{this.prev=this.current,this.current=t;const{delta:n,timestamp:i}=Ft();this.lastUpdated!==i&&(this.timeDelta=n,this.lastUpdated=i,Rt.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.updateSubscribers.notify(this.current),this.velocityUpdateSubscribers.getSize()&&this.velocityUpdateSubscribers.notify(this.getVelocity()),e&&this.renderSubscribers.notify(this.current)},this.scheduleVelocityCheck=()=>Rt.postRender(this.velocityCheck),this.velocityCheck=({timestamp:t})=>{t!==this.lastUpdated&&(this.prev=this.current,this.velocityUpdateSubscribers.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e)))}onChange(t){return this.updateSubscribers.add(t)}clearListeners(){this.updateSubscribers.clear()}onRenderRequest(t){return t(this.get()),this.renderSubscribers.add(t)}attach(t){this.passiveEffect=t}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?$e(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.stopAnimation=t(e)}).then(()=>this.clearAnimation())}stop(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()}}function Vi(t){return new Ei(t)}const Mi=["TopLeft","TopRight","BottomLeft","BottomRight"],Ci=Mi.length,Ri=t=>"string"==typeof t?parseFloat(t):t,Li=t=>"number"==typeof t||T.test(t);function Di(t,e){var n;return null!==(n=t[e])&&void 0!==n?n:t.borderRadius}const ki=Oi(0,.5,Me),ji=Oi(.5,.95,Ae);function Oi(t,e,n){return i=>i<t?0:i>e?1:n(te(t,e,i))}function Fi(t,e){t.min=e.min,t.max=e.max}function Ui(t,e){Fi(t.x,e.x),Fi(t.y,e.y)}function Ii(t,e,n,i,o){return t=Ln(t-=e,1/n,i),void 0!==o&&(t=Ln(t,1/o,i)),t}function Bi(t,e,[n,i,o],s,r){!function(t,e=0,n=1,i=.5,o,s=t,r=t){if(u.test(e)){e=parseFloat(e);e=ee(r.min,r.max,e/100)-r.min}if("number"!=typeof e)return;let a=ee(s.min,s.max,i);t===s&&(a-=e),t.min=Ii(t.min,e,n,a,o),t.max=Ii(t.max,e,n,a,o)}(t,e[n],e[i],e[o],e.scale,s,r)}const Ni=["x","scaleX","originX"],zi=["y","scaleY","originY"];function $i(t,e,n,i){Bi(t.x,e,Ni,null==n?void 0:n.x,null==i?void 0:i.x),Bi(t.y,e,zi,null==n?void 0:n.y,null==i?void 0:i.y)}function Gi(t){return 0===t.translate&&1===t.scale}function Hi(t){return Gi(t.x)&&Gi(t.y)}function Wi(t,e){return t.x.min===e.x.min&&t.x.max===e.x.max&&t.y.min===e.y.min&&t.y.max===e.y.max}function Yi(t){return dn(t.x)/dn(t.y)}class Xi{constructor(){this.members=[]}add(t){Ti(this.members,t),t.scheduleRender()}remove(t){if(wi(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){const e=this.members.findIndex(e=>t===e);if(0===e)return!1;let n;for(let t=e;t>=0;t--){const e=this.members[t];if(!1!==e.isPresent){n=e;break}}return!!n&&(this.promote(n),!0)}promote(t,e){var n;const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.instance&&i.scheduleRender(),t.scheduleRender(),t.resumeFrom=i,e&&(t.resumeFrom.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues,t.snapshot.isShared=!0),(null===(n=t.root)||void 0===n?void 0:n.isUpdating)&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;!1===o&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var e,n,i,o,s;null===(n=(e=t.options).onExitComplete)||void 0===n||n.call(e),null===(s=null===(i=t.resumingFrom)||void 0===i?void 0:(o=i.options).onExitComplete)||void 0===s||s.call(o)})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function qi(t,e,n){let i=`translate3d(${t.x.translate/e.x}px, ${t.y.translate/e.y}px, 0) `;if(i+=`scale(${1/e.x}, ${1/e.y}) `,n){const{rotate:t,rotateX:e,rotateY:o}=n;t&&(i+=`rotate(${t}deg) `),e&&(i+=`rotateX(${e}deg) `),o&&(i+=`rotateY(${o}deg) `)}return i+=`scale(${t.x.scale*e.x}, ${t.y.scale*e.y})`,"translate3d(0px, 0px, 0) scale(1, 1) scale(1, 1)"===i?"none":i}const Ki=(t,e)=>t.depth-e.depth;class Zi{constructor(){this.children=[],this.isDirty=!1}add(t){Ti(this.children,t),this.isDirty=!0}remove(t){wi(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Ki),this.isDirty=!1,this.children.forEach(t)}}const _i=["","X","Y","Z"];function Ji({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:o}){return class{constructor(t,n={},i=(null==e?void 0:e())){this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.nodes.forEach(so),this.nodes.forEach(ro)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.id=t,this.latestValues=n,this.root=i?i.root||i:this,this.path=i?[...i.path,i]:[],this.parent=i,this.depth=i?i.depth+1:0,t&&this.root.registerPotentialNode(t,this);for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new Zi)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new Si),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){const n=this.eventHandlers.get(t);null==n||n.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}registerPotentialNode(t,e){this.potentialNodes.set(t,e)}mount(e,n=!1){var i;if(this.instance)return;this.isSVG=e instanceof SVGElement&&"svg"!==e.tagName,this.instance=e;const{layoutId:o,layout:s,visualElement:r}=this.options;if(r&&!r.getInstance()&&r.mount(e),this.root.nodes.add(this),null===(i=this.parent)||void 0===i||i.children.add(this),this.id&&this.root.potentialNodes.delete(this.id),n&&(s||o)&&(this.isLayoutDirty=!0),t){let n;const i=()=>this.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,clearTimeout(n),n=window.setTimeout(i,250),S.hasAnimatedSinceResize&&(S.hasAnimatedSinceResize=!1,this.nodes.forEach(oo))})}o&&this.root.registerSharedNode(o,this),!1!==this.options.animate&&r&&(o||s)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeTargetChanged:n,layout:i})=>{var o,s,a,l,u;if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const c=null!==(s=null!==(o=this.options.transition)&&void 0!==o?o:r.getDefaultTransition())&&void 0!==s?s:po,{onLayoutAnimationStart:h,onLayoutAnimationComplete:d}=r.getProps(),p=!this.targetLayout||!Wi(this.targetLayout,i)||n,m=!e&&n;if((null===(a=this.resumeFrom)||void 0===a?void 0:a.instance)||m||e&&(p||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,m);const e={...si(c,"layout"),onPlay:h,onComplete:d};r.shouldReduceMotion&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||0!==this.animationProgress||this.finishAnimation(),this.isLead()&&(null===(u=(l=this.options).onExitComplete)||void 0===u||u.call(l));this.targetLayout=i})}unmount(){var t,e;this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),null===(t=this.getStack())||void 0===t||t.remove(this),null===(e=this.parent)||void 0===e||e.children.delete(this),this.instance=void 0,Lt.preRender(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){var t;return this.isAnimationBlocked||(null===(t=this.parent)||void 0===t?void 0:t.isTreeAnimationBlocked())||!1}startUpdate(){var t;this.isUpdateBlocked()||(this.isUpdating=!0,null===(t=this.nodes)||void 0===t||t.forEach(ao))}willUpdate(t=!0){var e,n,i;if(this.root.isUpdateBlocked())return void(null===(n=(e=this.options).onExitComplete)||void 0===n||n.call(e));if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){const e=this.path[t];e.shouldResetTransform=!0,e.updateScroll()}const{layoutId:o,layout:s}=this.options;if(void 0===o&&!s)return;const r=null===(i=this.options.visualElement)||void 0===i?void 0:i.getProps().transformTemplate;this.prevTransformTemplateValue=null==r?void 0:r(this.latestValues,""),this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}didUpdate(){if(this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(no);this.isUpdating&&(this.isUpdating=!1,this.potentialNodes.size&&(this.potentialNodes.forEach(mo),this.potentialNodes.clear()),this.nodes.forEach(io),this.nodes.forEach(Qi),this.nodes.forEach(to),this.clearAllSnapshots(),Dt.update(),Dt.preRender(),Dt.render())}clearAllSnapshots(){this.nodes.forEach(eo),this.sharedNodes.forEach(lo)}scheduleUpdateProjection(){Rt.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){Rt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){if(this.snapshot||!this.instance)return;const t=this.measure(),e=this.removeTransform(this.removeElementScroll(t));vo(e),this.snapshot={measured:t,layout:e,latestValues:{}}}updateLayout(){var t;if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t<this.path.length;t++){this.path[t].updateScroll()}const e=this.measure();vo(e);const n=this.layout;this.layout={measured:e,actual:this.removeElementScroll(e)},this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.actual),null===(t=this.options.visualElement)||void 0===t||t.notifyLayoutMeasure(this.layout.actual,null==n?void 0:n.actual)}updateScroll(){this.options.layoutScroll&&this.instance&&(this.isScrollRoot=i(this.instance),this.scroll=n(this.instance))}resetTransform(){var t;if(!o)return;const e=this.isLayoutDirty||this.shouldResetTransform,n=this.projectionDelta&&!Hi(this.projectionDelta),i=null===(t=this.options.visualElement)||void 0===t?void 0:t.getProps().transformTemplate,s=null==i?void 0:i(this.latestValues,""),r=s!==this.prevTransformTemplateValue;e&&(n||Cn(this.latestValues)||r)&&(o(this.instance,s),this.shouldResetTransform=!1,this.scheduleRender())}measure(){const{visualElement:t}=this.options;if(!t)return{x:{min:0,max:0},y:{min:0,max:0}};const e=t.measureViewportBox(),{scroll:n}=this.root;return n&&(On(e.x,n.x),On(e.y,n.y)),e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};Ui(e,t);for(let n=0;n<this.path.length;n++){const i=this.path[n],{scroll:o,options:s,isScrollRoot:r}=i;if(i!==this.root&&o&&s.layoutScroll){if(r){Ui(e,t);const{scroll:n}=this.root;n&&(On(e.x,-n.x),On(e.y,-n.y))}On(e.x,o.x),On(e.y,o.y)}}return e}applyTransform(t,e=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};Ui(n,t);for(let t=0;t<this.path.length;t++){const i=this.path[t];!e&&i.options.layoutScroll&&i.scroll&&i!==i.root&&Bn(n,{x:-i.scroll.x,y:-i.scroll.y}),Cn(i.latestValues)&&Bn(n,i.latestValues)}return Cn(this.latestValues)&&Bn(n,this.latestValues),n}removeTransform(t){var e;const n={x:{min:0,max:0},y:{min:0,max:0}};Ui(n,t);for(let t=0;t<this.path.length;t++){const i=this.path[t];if(!i.instance)continue;if(!Cn(i.latestValues))continue;Mn(i.latestValues)&&i.updateSnapshot();const o={x:{min:0,max:0},y:{min:0,max:0}};Ui(o,i.measure()),$i(n,i.latestValues,null===(e=i.snapshot)||void 0===e?void 0:e.layout,o)}return Cn(this.latestValues)&&$i(n,this.latestValues),n}setTargetDelta(t){this.targetDelta=t,this.root.scheduleUpdateProjection()}setOptions(t){this.options={...this.options,...t,crossfade:void 0===t.crossfade||t.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}resolveTargetDelta(){var t;const{layout:e,layoutId:n}=this.options;var i,o,s;this.layout&&(e||n)&&(this.targetDelta||this.relativeTarget||(this.relativeParent=this.getClosestProjectingParent(),this.relativeParent&&this.relativeParent.layout&&(this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},yn(this.relativeTargetOrigin,this.layout.actual,this.relativeParent.layout.actual),Ui(this.relativeTarget,this.relativeTargetOrigin))),(this.relativeTarget||this.targetDelta)&&(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&(null===(t=this.relativeParent)||void 0===t?void 0:t.target)?(i=this.target,o=this.relativeTarget,s=this.relativeParent.target,vn(i.x,o.x,s.x),vn(i.y,o.y,s.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.actual):Ui(this.target,this.layout.actual),jn(this.target,this.targetDelta)):Ui(this.target,this.layout.actual),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.relativeParent=this.getClosestProjectingParent(),this.relativeParent&&Boolean(this.relativeParent.resumingFrom)===Boolean(this.resumingFrom)&&!this.relativeParent.options.layoutScroll&&this.relativeParent.target&&(this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},yn(this.relativeTargetOrigin,this.target,this.relativeParent.target),Ui(this.relativeTarget,this.relativeTargetOrigin)))))}getClosestProjectingParent(){if(this.parent&&!Cn(this.parent.latestValues))return(this.parent.relativeTarget||this.parent.targetDelta)&&this.parent.layout?this.parent:this.parent.getClosestProjectingParent()}calcProjection(){var t;const{layout:e,layoutId:n}=this.options;if(this.isTreeAnimating=Boolean((null===(t=this.parent)||void 0===t?void 0:t.isTreeAnimating)||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!e&&!n)return;const i=this.getLead();Ui(this.layoutCorrected,this.layout.actual),function(t,e,n,i=!1){var o,s;const r=n.length;if(!r)return;let a,l;e.x=e.y=1;for(let u=0;u<r;u++)a=n[u],l=a.projectionDelta,"contents"!==(null===(s=null===(o=a.instance)||void 0===o?void 0:o.style)||void 0===s?void 0:s.display)&&(i&&a.options.layoutScroll&&a.scroll&&a!==a.root&&Bn(t,{x:-a.scroll.x,y:-a.scroll.y}),l&&(e.x*=l.x.scale,e.y*=l.y.scale,jn(t,l)),i&&Cn(a.latestValues)&&Bn(t,a.latestValues))}(this.layoutCorrected,this.treeScale,this.path,Boolean(this.resumingFrom)||this!==i);const{target:o}=i;if(!o)return;this.projectionDelta||(this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}});const s=this.treeScale.x,r=this.treeScale.y,a=this.projectionTransform;fn(this.projectionDelta,this.layoutCorrected,o,this.latestValues),this.projectionTransform=qi(this.projectionDelta,this.treeScale),this.projectionTransform===a&&this.treeScale.x===s&&this.treeScale.y===r||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",o))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){var e,n,i;null===(n=(e=this.options).scheduleRender)||void 0===n||n.call(e),t&&(null===(i=this.getStack())||void 0===i||i.scheduleRender()),this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(t,e=!1){var n;const i=this.snapshot,o=(null==i?void 0:i.latestValues)||{},s={...this.latestValues},r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeTarget=this.relativeTargetOrigin=void 0,this.attemptToResolveRelativeTarget=!e;const a={x:{min:0,max:0},y:{min:0,max:0}},l=null==i?void 0:i.isShared,c=((null===(n=this.getStack())||void 0===n?void 0:n.members.length)||0)<=1,h=Boolean(l&&!c&&!0===this.options.crossfade&&!this.path.some(ho));this.animationProgress=0,this.mixTargetDelta=e=>{var n;const i=e/1e3;var d,p,m,f;uo(r.x,t.x,i),uo(r.y,t.y,i),this.setTargetDelta(r),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&(null===(n=this.relativeParent)||void 0===n?void 0:n.layout)&&(yn(a,this.layout.actual,this.relativeParent.layout.actual),d=this.relativeTarget,p=this.relativeTargetOrigin,m=a,f=i,co(d.x,p.x,m.x,f),co(d.y,p.y,m.y,f)),l&&(this.animationValues=s,function(t,e,n,i,o,s){var r,a,l,c;o?(t.opacity=ee(0,null!==(r=n.opacity)&&void 0!==r?r:1,ki(i)),t.opacityExit=ee(null!==(a=e.opacity)&&void 0!==a?a:1,0,ji(i))):s&&(t.opacity=ee(null!==(l=e.opacity)&&void 0!==l?l:1,null!==(c=n.opacity)&&void 0!==c?c:1,i));for(let o=0;o<Ci;o++){const s=`border${Mi[o]}Radius`;let r=Di(e,s),a=Di(n,s);if(void 0===r&&void 0===a)continue;r||(r=0),a||(a=0);0===r||0===a||Li(r)===Li(a)?(t[s]=Math.max(ee(Ri(r),Ri(a),i),0),(u.test(a)||u.test(r))&&(t[s]+="%")):t[s]=a}(e.rotate||n.rotate)&&(t.rotate=ee(e.rotate||0,n.rotate||0,i))}(s,o,this.latestValues,i,h,c)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=i},this.mixTargetDelta(0)}startAnimation(t){var e,n;this.notifyListeners("animationStart"),null===(e=this.currentAnimation)||void 0===e||e.stop(),this.resumingFrom&&(null===(n=this.resumingFrom.currentAnimation)||void 0===n||n.stop()),this.pendingAnimation&&(Lt.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Rt.update(()=>{S.hasAnimatedSinceResize=!0,this.currentAnimation=function(t,e,n={}){const i=M(t)?t:Vi(t);return ri("",i,e,n),{stop:()=>i.stop(),isAnimating:()=>i.isAnimating()}}(0,1e3,{...t,onUpdate:e=>{var n;this.mixTargetDelta(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:()=>{var e;null===(e=t.onComplete)||void 0===e||e.call(t),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){var t;this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0),null===(t=this.getStack())||void 0===t||t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){var t;this.currentAnimation&&(null===(t=this.mixTargetDelta)||void 0===t||t.call(this,1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:n,layout:i,latestValues:o}=t;if(e&&n&&i){if(this!==t&&this.layout&&i&&go(this.options.animationType,this.layout.actual,i.actual)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=dn(this.layout.actual.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const i=dn(this.layout.actual.y);n.y.min=t.target.y.min,n.y.max=n.y.min+i}Ui(e,n),Bn(e,o),fn(this.projectionDeltaWithTransform,this.layoutCorrected,e,o)}}registerSharedNode(t,e){var n,i,o;this.sharedNodes.has(t)||this.sharedNodes.set(t,new Xi);this.sharedNodes.get(t).add(e),e.promote({transition:null===(n=e.options.initialPromotionConfig)||void 0===n?void 0:n.transition,preserveFollowOpacity:null===(o=null===(i=e.options.initialPromotionConfig)||void 0===i?void 0:i.shouldPreserveFollowOpacity)||void 0===o?void 0:o.call(i,e)})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){var t;const{layoutId:e}=this.options;return e&&(null===(t=this.getStack())||void 0===t?void 0:t.lead)||this}getPrevLead(){var t;const{layoutId:e}=this.options;return e?null===(t=this.getStack())||void 0===t?void 0:t.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const i=this.getStack();i&&i.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const n={};for(let i=0;i<_i.length;i++){const o="rotate"+_i[i];t.getStaticValue(o)&&(e=!0,n[o]=t.getStaticValue(o),t.setStaticValue(o,0))}if(e){null==t||t.syncRender();for(const e in n)t.setStaticValue(e,n[e]);t.scheduleRender()}}getProjectionStyles(t={}){var e,n,i;const o={};if(!this.instance||this.isSVG)return o;if(!this.isVisible)return{visibility:"hidden"};o.visibility="";const s=null===(e=this.options.visualElement)||void 0===e?void 0:e.getProps().transformTemplate;if(this.needsReset)return this.needsReset=!1,o.opacity="",o.pointerEvents=C(t.pointerEvents)||"",o.transform=s?s(this.latestValues,""):"none",o;const r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){const e={};return this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=C(t.pointerEvents)||""),this.hasProjected&&!Cn(this.latestValues)&&(e.transform=s?s({},""):"none",this.hasProjected=!1),e}const a=r.animationValues||r.latestValues;this.applyTransformsToTarget(),o.transform=qi(this.projectionDeltaWithTransform,this.treeScale,a),s&&(o.transform=s(a,o.transform));const{x:l,y:u}=this.projectionDelta;o.transformOrigin=`${100*l.origin}% ${100*u.origin}% 0`,r.animationValues?o.opacity=r===this?null!==(i=null!==(n=a.opacity)&&void 0!==n?n:this.latestValues.opacity)&&void 0!==i?i:1:this.preserveOpacity?this.latestValues.opacity:a.opacityExit:o.opacity=r===this?void 0!==a.opacity?a.opacity:"":void 0!==a.opacityExit?a.opacityExit:0;for(const t in R){if(void 0===a[t])continue;const{correct:e,applyTo:n}=R[t],i=e(a[t],r);if(n){const t=n.length;for(let e=0;e<t;e++)o[n[e]]=i}else o[t]=i}return this.options.layoutId&&(o.pointerEvents=r===this?C(t.pointerEvents)||"":"none"),o}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(t=>{var e;return null===(e=t.currentAnimation)||void 0===e?void 0:e.stop()}),this.root.nodes.forEach(no),this.root.sharedNodes.clear()}}}function Qi(t){t.updateLayout()}function to(t){var e,n,i;const o=(null===(e=t.resumeFrom)||void 0===e?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&o&&t.hasListeners("didUpdate")){const{actual:e,measured:n}=t.layout,{animationType:i}=t.options;"size"===i?Sn(t=>{const n=o.isShared?o.measured[t]:o.layout[t],i=dn(n);n.min=e[t].min,n.max=n.min+i}):go(i,o.layout,e)&&Sn(t=>{const n=o.isShared?o.measured[t]:o.layout[t],i=dn(e[t]);n.max=n.min+i});const s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};fn(s,e,o.layout);const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o.isShared?fn(r,t.applyTransform(n,!0),o.measured):fn(r,e,o.layout);const a=!Hi(s);let l=!1;if(!t.resumeFrom&&(t.relativeParent=t.getClosestProjectingParent(),t.relativeParent&&!t.relativeParent.resumeFrom)){const{snapshot:n,layout:i}=t.relativeParent;if(n&&i){const t={x:{min:0,max:0},y:{min:0,max:0}};yn(t,o.layout,n.layout);const s={x:{min:0,max:0},y:{min:0,max:0}};yn(s,e,i.actual),Wi(t,s)||(l=!0)}}t.notifyListeners("didUpdate",{layout:e,snapshot:o,delta:r,layoutDelta:s,hasLayoutChanged:a,hasRelativeTargetChanged:l})}else t.isLead()&&(null===(i=(n=t.options).onExitComplete)||void 0===i||i.call(n));t.options.transition=void 0}function eo(t){t.clearSnapshot()}function no(t){t.clearMeasurements()}function io(t){const{visualElement:e}=t.options;(null==e?void 0:e.getProps().onBeforeLayoutMeasure)&&e.notifyBeforeLayoutMeasure(),t.resetTransform()}function oo(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0}function so(t){t.resolveTargetDelta()}function ro(t){t.calcProjection()}function ao(t){t.resetRotation()}function lo(t){t.removeLeadSnapshot()}function uo(t,e,n){t.translate=ee(e.translate,0,n),t.scale=ee(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function co(t,e,n,i){t.min=ee(e.min,n.min,i),t.max=ee(e.max,n.max,i)}function ho(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const po={duration:.45,ease:[.4,0,.1,1]};function mo(t,e){let n=t.root;for(let e=t.path.length-1;e>=0;e--)if(Boolean(t.path[e].instance)){n=t.path[e];break}const i=(n&&n!==t.root?n.instance:document).querySelector(`[data-projection-id="${e}"]`);i&&t.mount(i,!0)}function fo(t){t.min=Math.round(t.min),t.max=Math.round(t.max)}function vo(t){fo(t.x),fo(t.y)}function go(t,e,n){return"position"===t||"preserve-aspect"===t&&!function(t,e,n=.01){return Ye(t,e)<=n}(Yi(e),Yi(n))}const yo=Ji({attachResizeListener:(t,e)=>It(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),xo={current:void 0},bo=Ji({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!xo.current){const t=new yo(0,{});t.mount(window),t.setOptions({layoutScroll:!0}),xo.current=t}return xo.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),Po={current:null},Ao={current:!1};function To(t){return Boolean(M(t)&&t.add)}function wo(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let i=0;i<n;i++)if(e[i]!==t[i])return!1;return!0}const So=t=>/^0[^.\s]+$/.test(t),Eo=t=>e=>e.test(t),Vo=[d,T,u,L,D,k,{test:t=>"auto"===t,parse:t=>t}],Mo=t=>Vo.find(Eo(t)),Co=[...Vo,st,ct],Ro=t=>Co.find(Eo(t));function Lo(t,e,n){const i=t.getProps();return j(i,e,void 0!==n?n:i.custom,function(t){const e={};return t.forEachValue((t,n)=>e[n]=t.get()),e}(t),function(t){const e={};return t.forEachValue((t,n)=>e[n]=t.getVelocity()),e}(t))}function Do(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Vi(n))}function ko(t,e){if(!e)return;return(e[t]||e.default||e).from}function jo(t,e,n={}){var i;const o=Lo(t,e,n.custom);let{transition:s=t.getDefaultTransition()||{}}=o||{};n.transitionOverride&&(s=n.transitionOverride);const r=o?()=>Oo(t,o,n):()=>Promise.resolve(),a=(null===(i=t.variantChildren)||void 0===i?void 0:i.size)?(i=0)=>{const{delayChildren:o=0,staggerChildren:r,staggerDirection:a}=s;return function(t,e,n=0,i=0,o=1,s){const r=[],a=(t.variantChildren.size-1)*i,l=1===o?(t=0)=>t*i:(t=0)=>a-t*i;return Array.from(t.variantChildren).sort(Fo).forEach((t,i)=>{r.push(jo(t,e,{...s,delay:n+l(i)}).then(()=>t.notifyAnimationComplete(e)))}),Promise.all(r)}(t,e,o+i,r,a,n)}:()=>Promise.resolve(),{when:l}=s;if(l){const[t,e]="beforeChildren"===l?[r,a]:[a,r];return t().then(e)}return Promise.all([r(),a(n.delay)])}function Oo(t,e,{delay:n=0,transitionOverride:i,type:o}={}){var s;let{transition:r=t.getDefaultTransition(),transitionEnd:a,...l}=t.makeTargetAnimatable(e);const u=t.getValue("willChange");i&&(r=i);const c=[],h=o&&(null===(s=t.animationState)||void 0===s?void 0:s.getState()[o]);for(const e in l){const i=t.getValue(e),o=l[e];if(!i||void 0===o||h&&Uo(h,e))continue;let s={delay:n,...r};t.shouldReduceMotion&&O.has(e)&&(s={...s,type:!1,delay:0});let a=ri(e,i,o,s);To(u)&&(u.add(e),a=a.then(()=>u.remove(e))),c.push(a)}return Promise.all(c).then(()=>{a&&function(t,e){const n=Lo(t,e);let{transitionEnd:i={},transition:o={},...s}=n?t.makeTargetAnimatable(n,!1):{};s={...s,...i};for(const e in s){Do(t,e,y(s[e]))}}(t,a)})}function Fo(t,e){return t.sortNodePosition(e)}function Uo({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}const Io=[wn.Animate,wn.InView,wn.Focus,wn.Hover,wn.Tap,wn.Drag,wn.Exit],Bo=[...Io].reverse(),No=Io.length;function zo(t){return e=>Promise.all(e.map(({animation:e,options:n})=>function(t,e,n={}){let i;if(t.notifyAnimationStart(e),Array.isArray(e)){const o=e.map(e=>jo(t,e,n));i=Promise.all(o)}else if("string"==typeof e)i=jo(t,e,n);else{const o="function"==typeof e?Lo(t,e,n.custom):e;i=Oo(t,o,n)}return i.then(()=>t.notifyAnimationComplete(e))}(t,e,n)))}function $o(t){let e=zo(t);const n={[wn.Animate]:Ho(!0),[wn.InView]:Ho(),[wn.Hover]:Ho(),[wn.Tap]:Ho(),[wn.Drag]:Ho(),[wn.Focus]:Ho(),[wn.Exit]:Ho()};let i=!0;const o=(e,n)=>{const i=Lo(t,n);if(i){const{transition:t,transitionEnd:n,...o}=i;e={...e,...o,...n}}return e};function s(s,r){var a;const l=t.getProps(),u=t.getVariantContext(!0)||{},c=[],h=new Set;let d={},p=1/0;for(let e=0;e<No;e++){const m=Bo[e],f=n[m],g=null!==(a=l[m])&&void 0!==a?a:u[m],y=U(g),x=m===r?f.isActive:null;!1===x&&(p=e);let b=g===u[m]&&g!==l[m]&&y;if(b&&i&&t.manuallyAnimateOnMount&&(b=!1),f.protectedKeys={...d},!f.isActive&&null===x||!g&&!f.prevProp||F(g)||"boolean"==typeof g)continue;const P=Go(f.prevProp,g);let A=P||m===r&&f.isActive&&!b&&y||e>p&&y;const T=Array.isArray(g)?g:[g];let w=T.reduce(o,{});!1===x&&(w={});const{prevResolvedValues:S={}}=f,E={...S,...w},V=t=>{A=!0,h.delete(t),f.needsAnimating[t]=!0};for(const t in E){const e=w[t],n=S[t];d.hasOwnProperty(t)||(e!==n?v(e)&&v(n)?!wo(e,n)||P?V(t):f.protectedKeys[t]=!0:void 0!==e?V(t):h.add(t):void 0!==e&&h.has(t)?V(t):f.protectedKeys[t]=!0)}f.prevProp=g,f.prevResolvedValues=w,f.isActive&&(d={...d,...w}),i&&t.blockInitialAnimation&&(A=!1),A&&!b&&c.push(...T.map(t=>({animation:t,options:{type:m,...s}})))}if(h.size){const e={};h.forEach(n=>{const i=t.getBaseTarget(n);void 0!==i&&(e[n]=i)}),c.push({animation:e})}let m=Boolean(c.length);return i&&!1===l.initial&&!t.manuallyAnimateOnMount&&(m=!1),i=!1,m?e(c):Promise.resolve()}return{animateChanges:s,setActive:function(e,i,o){var r;if(n[e].isActive===i)return Promise.resolve();null===(r=t.variantChildren)||void 0===r||r.forEach(t=>{var n;return null===(n=t.animationState)||void 0===n?void 0:n.setActive(e,i)}),n[e].isActive=i;const a=s(o,e);for(const t in n)n[t].protectedKeys={};return a},setAnimateFunction:function(n){e=n(t)},getState:()=>n}}function Go(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!wo(e,t)}function Ho(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}const Wo=["LayoutMeasure","BeforeLayoutMeasure","LayoutUpdate","ViewportBoxUpdate","Update","Render","AnimationComplete","LayoutAnimationComplete","AnimationStart","LayoutAnimationStart","SetAxisTarget","Unmount"];const Yo=new Set;const Xo=("undefined"==typeof process||process.env,"production"),qo=Object.keys(I),Ko=qo.length,Zo=({treeType:t="",build:e,getBaseTarget:n,makeTargetAnimatable:i,measureViewportBox:o,render:r,readValueFromInstance:a,removeValueFromRenderState:l,sortNodePosition:u,scrapeMotionValuesFromProps:c})=>({parent:h,props:d,presenceId:p,blockInitialAnimation:m,visualState:v,reducedMotionConfig:g},y={})=>{let b=!1;const{latestValues:P,renderState:A}=v;let T;const w=function(){const t=Wo.map(()=>new Si),e={},n={clearAllListeners:()=>t.forEach(t=>t.clear()),updatePropListeners:t=>{Wo.forEach(i=>{var o;const s="on"+i,r=t[s];null===(o=e[i])||void 0===o||o.call(e),r&&(e[i]=n[s](r))})}};return t.forEach((t,e)=>{n["on"+Wo[e]]=e=>t.add(e),n["notify"+Wo[e]]=(...e)=>t.notify(...e)}),n}(),S=new Map,E=new Map;let V={};const C={...P};let R;function L(){T&&b&&(D(),r(T,A,d.style,G.projection))}function D(){e(G,A,P,y,d)}function k(){w.notifyUpdate(P)}function j(t,e){const n=e.onChange(e=>{P[t]=e,d.onUpdate&&Rt.update(k,!1,!0)}),i=e.onRenderRequest(G.scheduleRender);E.set(t,()=>{n(),i()})}const{willChange:O,...F}=c(d);for(const t in F){const e=F[t];void 0!==P[t]&&M(e)&&(e.set(P[t],!1),To(O)&&O.add(t))}const z=B(d),$=N(d),G={treeType:t,current:null,depth:h?h.depth+1:0,parent:h,children:new Set,presenceId:p,shouldReduceMotion:null,variantChildren:$?new Set:void 0,isVisible:void 0,manuallyAnimateOnMount:Boolean(null==h?void 0:h.isMounted()),blockInitialAnimation:m,isMounted:()=>Boolean(T),mount(t){b=!0,T=G.current=t,G.projection&&G.projection.mount(t),$&&h&&!z&&(R=null==h?void 0:h.addVariantChild(G)),S.forEach((t,e)=>j(e,t)),Ao.current||function(){if(Ao.current=!0,f)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Po.current=t.matches;t.addListener(e),e()}else Po.current=!1}(),G.shouldReduceMotion="never"!==g&&("always"===g||Po.current),null==h||h.children.add(G),G.setProps(d)},unmount(){var t;null===(t=G.projection)||void 0===t||t.unmount(),Lt.update(k),Lt.render(L),E.forEach(t=>t()),null==R||R(),null==h||h.children.delete(G),w.clearAllListeners(),T=void 0,b=!1},loadFeatures(t,e,n,i,o,r){const a=[];for(let e=0;e<Ko;e++){const n=qo[e],{isEnabled:i,Component:o}=I[n];i(d)&&o&&a.push(s(o,{key:n,...t,visualElement:G}))}if(!G.projection&&o){G.projection=new o(i,G.getLatestValues(),h&&h.projection);const{layoutId:e,layout:n,drag:s,dragConstraints:a,layoutScroll:l}=t;G.projection.setOptions({layoutId:e,layout:n,alwaysMeasureLayout:Boolean(s)||a&&x(a),visualElement:G,scheduleRender:()=>G.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:r,layoutScroll:l})}return a},addVariantChild(t){var e;const n=G.getClosestVariantNode();if(n)return null===(e=n.variantChildren)||void 0===e||e.add(t),()=>n.variantChildren.delete(t)},sortNodePosition:e=>u&&t===e.treeType?u(G.getInstance(),e.getInstance()):0,getClosestVariantNode:()=>$?G:null==h?void 0:h.getClosestVariantNode(),getLayoutId:()=>d.layoutId,getInstance:()=>T,getStaticValue:t=>P[t],setStaticValue:(t,e)=>P[t]=e,getLatestValues:()=>P,setVisibility(t){G.isVisible!==t&&(G.isVisible=t,G.scheduleRender())},makeTargetAnimatable:(t,e=!0)=>i(G,t,d,e),measureViewportBox:()=>o(T,d),addValue(t,e){G.hasValue(t)&&G.removeValue(t),S.set(t,e),P[t]=e.get(),j(t,e)},removeValue(t){var e;S.delete(t),null===(e=E.get(t))||void 0===e||e(),E.delete(t),delete P[t],l(t,A)},hasValue:t=>S.has(t),getValue(t,e){let n=S.get(t);return void 0===n&&void 0!==e&&(n=Vi(e),G.addValue(t,n)),n},forEachValue:t=>S.forEach(t),readValue:t=>void 0!==P[t]?P[t]:a(T,t,y),setBaseTarget(t,e){C[t]=e},getBaseTarget(t){if(n){const e=n(d,t);if(void 0!==e&&!M(e))return e}return C[t]},...w,build:()=>(D(),A),scheduleRender(){Rt.render(L,!1,!0)},syncRender:L,setProps(t){(t.transformTemplate||d.transformTemplate)&&G.scheduleRender(),d=t,w.updatePropListeners(t),V=function(t,e,n){const{willChange:i}=e;for(const o in e){const s=e[o],r=n[o];if(M(s))t.addValue(o,s),To(i)&&i.add(o);else if(M(r))t.addValue(o,Vi(s)),To(i)&&i.remove(o);else if(r!==s)if(t.hasValue(o)){const e=t.getValue(o);!e.hasAnimated&&e.set(s)}else{const e=t.getStaticValue(o);t.addValue(o,Vi(void 0!==e?e:s))}}for(const i in n)void 0===e[i]&&t.removeValue(i);return e}(G,c(d),V)},getProps:()=>d,getVariant:t=>{var e;return null===(e=d.variants)||void 0===e?void 0:e[t]},getDefaultTransition:()=>d.transition,getTransformPagePoint:()=>d.transformPagePoint,getVariantContext(t=!1){if(t)return null==h?void 0:h.getVariantContext();if(!z){const t=(null==h?void 0:h.getVariantContext())||{};return void 0!==d.initial&&(t.initial=d.initial),t}const e={};for(let t=0;t<Jo;t++){const n=_o[t],i=d[n];(U(i)||!1===i)&&(e[n]=i)}return e}};return G},_o=["initial",...Io],Jo=_o.length,Qo=new Set(["width","height","top","left","right","bottom","x","y"]),ts=t=>Qo.has(t),es=(t,e)=>{t.set(e,!1),t.set(e)},ns=t=>t===d||t===T;var is;!function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"}(is||(is={}));const os=(t,e)=>parseFloat(t.split(", ")[e]),ss=(t,e)=>(n,{transform:i})=>{if("none"===i||!i)return 0;const o=i.match(/^matrix3d\((.+)\)$/);if(o)return os(o[1],e);{const e=i.match(/^matrix\((.+)\)$/);return e?os(e[1],t):0}},rs=new Set(["x","y","z"]),as=z.filter(t=>!rs.has(t));const ls={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:ss(4,13),y:ss(5,14)},us=(t,e,n={},i={})=>{e={...e},i={...i};const o=Object.keys(e).filter(ts);let s=[],r=!1;const a=[];if(o.forEach(o=>{const l=t.getValue(o);if(!t.hasValue(o))return;let u=n[o],c=Mo(u);const h=e[o];let d;if(v(h)){const t=h.length,e=null===h[0]?1:0;u=h[e],c=Mo(u);for(let n=e;n<t;n++)d?Mo(h[n]):d=Mo(h[n])}else d=Mo(h);if(c!==d)if(ns(c)&&ns(d)){const t=l.get();"string"==typeof t&&l.set(parseFloat(t)),"string"==typeof h?e[o]=parseFloat(h):Array.isArray(h)&&d===T&&(e[o]=h.map(parseFloat))}else(null==c?void 0:c.transform)&&(null==d?void 0:d.transform)&&(0===u||0===h)?0===u?l.set(d.transform(u)):e[o]=c.transform(h):(r||(s=function(t){const e=[];return as.forEach(n=>{const i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e.length&&t.syncRender(),e}(t),r=!0),a.push(o),i[o]=void 0!==i[o]?i[o]:e[o],es(l,h))}),a.length){const n=a.indexOf("height")>=0?window.pageYOffset:null,o=((t,e,n)=>{const i=e.measureViewportBox(),o=e.getInstance(),s=getComputedStyle(o),{display:r}=s,a={};"none"===r&&e.setStaticValue("display",t.display||"block"),n.forEach(t=>{a[t]=ls[t](i,s)}),e.syncRender();const l=e.measureViewportBox();return n.forEach(n=>{const i=e.getValue(n);es(i,a[n]),t[n]=ls[n](l,s)}),t})(e,t,a);return s.length&&s.forEach(([e,n])=>{t.getValue(e).set(n)}),t.syncRender(),f&&null!==n&&window.scrollTo({top:n}),{target:o,transitionEnd:i}}return{target:e,transitionEnd:i}};function cs(t,e,n,i){return(t=>Object.keys(t).some(ts))(e)?us(t,e,n,i):{target:e,transitionEnd:i}}const hs=(t,e,n,i)=>{const o=function(t,{...e},n){const i=t.getInstance();if(!(i instanceof Element))return{target:e,transitionEnd:n};n&&(n={...n}),t.forEachValue(t=>{const e=t.get();if(!vi(e))return;const n=yi(e,i);n&&t.set(n)});for(const t in e){const o=e[t];if(!vi(o))continue;const s=yi(o,i);s&&(e[t]=s,n&&void 0===n[t]&&(n[t]=o))}return{target:e,transitionEnd:n}}(t,e,i);return cs(t,e=o.target,n,i=o.transitionEnd)};const ds={treeType:"dom",readValueFromInstance(t,e){if(O.has(e)){const t=_n(e);return t&&t.default||0}{const i=(n=t,window.getComputedStyle(n)),o=($(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof o?o.trim():o}var n},sortNodePosition:(t,e)=>2&t.compareDocumentPosition(e)?1:-1,getBaseTarget(t,e){var n;return null===(n=t.style)||void 0===n?void 0:n[e]},measureViewportBox:(t,{transformPagePoint:e})=>Nn(t,e),resetTransform(t,e,n){const{transformTemplate:i}=n;e.style.transform=i?i({},""):"none",t.scheduleRender()},restoreTransform(t,e){t.style.transform=e.style.transform},removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]},makeTargetAnimatable(t,{transition:e,transitionEnd:n,...i},{transformValues:o},s=!0){let r=function(t,e,n){var i;const o={};for(const s in t){const t=ko(s,e);o[s]=void 0!==t?t:null===(i=n.getValue(s))||void 0===i?void 0:i.get()}return o}(i,e||{},t);if(o&&(n&&(n=o(n)),i&&(i=o(i)),r&&(r=o(r))),s){!function(t,e,n){var i,o;const s=Object.keys(e).filter(e=>!t.hasValue(e)),r=s.length;if(r)for(let a=0;a<r;a++){const r=s[a],l=e[r];let u=null;Array.isArray(l)&&(u=l[0]),null===u&&(u=null!==(o=null!==(i=n[r])&&void 0!==i?i:t.readValue(r))&&void 0!==o?o:e[r]),null!=u&&("string"==typeof u&&(/^\-?\d*\.?\d+$/.test(u)||So(u))?u=parseFloat(u):!Ro(u)&&ct.test(l)&&(u=Jn(r,l)),t.addValue(r,Vi(u)),void 0===n[r]&&(n[r]=u),t.setBaseTarget(r,u))}}(t,i,r);const e=hs(t,i,r,n);n=e.transitionEnd,i=e.target}return{transition:e,transitionEnd:n,...i}},scrapeMotionValuesFromProps:G,build(t,e,n,i,o){void 0!==t.isVisible&&(e.style.visibility=t.isVisible?"visible":"hidden"),H(e,n,i,o.transformTemplate)},render:W},ps=Zo(ds),ms={animation:hi(({visualElement:t,animate:n})=>{t.animationState||(t.animationState=$o(t)),F(n)&&e(()=>n.subscribe(t),[n])}),exit:hi(t=>{const{custom:n,visualElement:o}=t,[s,r]=pi(),a=i(A);e(()=>{o.isPresent=s;const t=o.animationState&&o.animationState.setActive(wn.Exit,!s,{custom:a&&a.custom||n});t&&!s&&t.then(r)},[s])})};function fs(t,e,n){return(i,o)=>{ft(i)&&!hn()&&(t.animationState&&t.animationState.setActive(wn.Hover,e),n&&n(i,o))}}const vs=(t,e)=>!!e&&(t===e||vs(t,e.parentElement));const gs=new WeakMap,ys=new WeakMap,xs=t=>{const e=gs.get(t.target);e&&e(t)},bs=t=>{t.forEach(xs)};function Ps(t,e,n){const i=function({root:t,...e}){const n=t||document;ys.has(n)||ys.set(n,{});const i=ys.get(n),o=JSON.stringify(e);return i[o]||(i[o]=new IntersectionObserver(bs,{root:t,...e})),i[o]}(e);return gs.set(t,n),i.observe(t),()=>{gs.delete(t),i.unobserve(t)}}const As={some:0,all:1};function Ts(t,n,i,{root:o,margin:s,amount:r="some",once:a}){e(()=>{if(!t)return;const e={root:null==o?void 0:o.current,rootMargin:s,threshold:"number"==typeof r?r:As[r]};return Ps(i.getInstance(),e,t=>{const{isIntersecting:e}=t;if(n.isInView===e)return;if(n.isInView=e,a&&!e&&n.hasEnteredView)return;e&&(n.hasEnteredView=!0),i.animationState&&i.animationState.setActive(wn.InView,e);const o=i.getProps(),s=e?o.onViewportEnter:o.onViewportLeave;s&&s(t)})},[t,o,s,r])}function ws(t,n,i,{fallback:o=!0}){e(()=>{var e,s;t&&o&&("production"!==Xo&&(e="IntersectionObserver not available on this device. whileInView animations will trigger on mount.",!1||Yo.has(e)||(console.warn(e),s&&console.warn(s),Yo.add(e))),requestAnimationFrame(()=>{n.hasEnteredView=!0;const{onViewportEnter:t}=i.getProps();t&&t(null),i.animationState&&i.animationState.setActive(wn.InView,!0)}))},[t])}const Ss={inView:hi((function({visualElement:t,whileInView:e,onViewportEnter:i,onViewportLeave:o,viewport:s={}}){const r=n({hasEnteredView:!1,isInView:!1});let a=Boolean(e||i||o);s.once&&r.current.hasEnteredView&&(a=!1),("undefined"==typeof IntersectionObserver?ws:Ts)(a,r.current,t,s)})),tap:hi((function({onTap:t,onTapStart:e,onTapCancel:i,whileTap:o,visualElement:s}){const r=t||e||i||o,a=n(!1),l=n(null),u={passive:!(e||t||i||m)};function c(){l.current&&l.current(),l.current=null}function h(){return c(),a.current=!1,s.animationState&&s.animationState.setActive(wn.Tap,!1),!hn()}function d(e,n){h()&&(vs(s.getInstance(),e.target)?t&&t(e,n):i&&i(e,n))}function p(t,e){h()&&i&&i(t,e)}function m(t,n){c(),a.current||(a.current=!0,l.current=ce(Gt(window,"pointerup",d,u),Gt(window,"pointercancel",p,u)),s.animationState&&s.animationState.setActive(wn.Tap,!0),e&&e(t,n))}Ht(s,"pointerdown",r?m:void 0,u),ci(c)})),focus:hi((function({whileFocus:t,visualElement:e}){const{animationState:n}=e;Bt(e,"focus",t?()=>{n&&n.setActive(wn.Focus,!0)}:void 0),Bt(e,"blur",t?()=>{n&&n.setActive(wn.Focus,!1)}:void 0)})),hover:hi((function({onHoverStart:t,onHoverEnd:e,whileHover:n,visualElement:i}){Ht(i,"pointerenter",t||n?fs(i,!0,t):void 0,{passive:!t}),Ht(i,"pointerleave",e||n?fs(i,!1,e):void 0,{passive:!e})}))},Es=Zo({...ds,getBaseTarget:(t,e)=>t[e],readValueFromInstance(t,e){var n;return O.has(e)?(null===(n=_n(e))||void 0===n?void 0:n.default)||0:(e=Y.has(e)?e:X(e),t.getAttribute(e))},scrapeMotionValuesFromProps:q,build(t,e,n,i,o){K(e,n,i,o.transformTemplate)},render:Z}),Vs={...{renderer:(t,e)=>_(t)?Es(e,{enableHardwareAcceleration:!1}):ps(e,{enableHardwareAcceleration:!0}),...ms,...Ss},...di,...Ai,projectionNodeConstructor:bo};export{Vs as domMax};
@@ -1 +1 @@
1
- import*as t from"react";import n,{createContext as e,useContext as r,useLayoutEffect as o,useEffect as a,useRef as i,useCallback as s,useMemo as c,forwardRef as l,createElement as u}from"react";const f=e({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),d=e({});const m=e(null),p="undefined"!=typeof document,g=p?o:a,y=e({strict:!1});function h(t,n,e,o){const s=r(d).visualElement,c=r(y),l=r(m),u=r(f).reducedMotion,p=i(void 0);o=o||c.renderer,!p.current&&o&&(p.current=o(t,{visualState:n,parent:s,props:e,presenceId:l?l.id:void 0,blockInitialAnimation:!!l&&!1===l.initial,reducedMotionConfig:u}));const h=p.current;return g(()=>{h&&h.syncRender()}),a(()=>{h&&h.animationState&&h.animationState.animateChanges()}),g(()=>()=>h&&h.notifyUnmount(),[]),h}function v(t,n,e){return s(r=>{var o;r&&t.mount&&t.mount(r),n&&(r?n.mount(r):n.unmount()),e&&("function"==typeof e?e(r):"object"==typeof(o=e)&&Object.prototype.hasOwnProperty.call(o,"current")&&(e.current=r))},[n])}function w(t){return"string"==typeof t||Array.isArray(t)}function b(t){return"object"==typeof t&&"function"==typeof t.start}const S=["initial","animate","exit","whileHover","whileDrag","whileTap","whileFocus","whileInView"];function x(t){return b(t.animate)||S.some(n=>w(t[n]))}function V(t){const{initial:n,animate:e}=function(t,n){if(x(t)){const{initial:n,animate:e}=t;return{initial:!1===n||w(n)?n:void 0,animate:w(e)?e:void 0}}return!1!==t.inherit?n:{}}(t,r(d));return c(()=>({initial:n,animate:e}),[O(n),O(e)])}function O(t){return Array.isArray(t)?t.join(" "):t}const T=t=>({isEnabled:n=>t.some(t=>!!n[t])}),C={measureLayout:T(["layout","layoutId","drag"]),animation:T(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:T(["exit"]),drag:T(["drag","dragControls"]),focus:T(["whileFocus"]),hover:T(["whileHover","onHoverStart","onHoverEnd"]),tap:T(["whileTap","onTap","onTapStart","onTapCancel"]),pan:T(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:T(["whileInView","onViewportEnter","onViewportLeave"])};function E(t){const n=i(null);return null===n.current&&(n.current=t()),n.current}const P=!1;let k=1;const A=e({});class j extends n.Component{getSnapshotBeforeUpdate(){const{visualElement:t,props:n}=this.props;return t&&t.setProps(n),null}componentDidUpdate(){}render(){return this.props.children}}const L=e({});function M({preloadedFeatures:n,createVisualElement:e,projectionNodeConstructor:o,useRender:a,useVisualState:i,Component:s}){return n&&function(t){for(const n in t)"projectionNodeConstructor"===n?C.projectionNodeConstructor=t[n]:C[n].Component=t[n]}(n),l((function(c,l){const u={...r(f),...c,layoutId:R(c)},{isStatic:m}=u;let g=null;const w=V(c),b=m?void 0:E(()=>{if(P)return k++}),S=i(c,m);if(!m&&p){w.visualElement=h(s,S,u,e);const t=r(y).strict,a=r(L);w.visualElement&&(g=w.visualElement.loadFeatures(c,t,n,b,o||C.projectionNodeConstructor,a))}return t.createElement(j,{visualElement:w.visualElement,props:u},g,t.createElement(d.Provider,{value:w},a(s,c,b,v(S,w.visualElement,l),S,m,w.visualElement)))}))}function R({layoutId:t}){const n=r(A).id;return n&&void 0!==t?n+"-"+t:t}const D=["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"];function B(t){return"string"==typeof t&&!t.includes("-")&&!!(D.indexOf(t)>-1||/[A-Z]/.test(t))}const W={},X=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","skew","skewX","skewY"],Y=new Set(X);function H(t,{layout:n,layoutId:e}){return Y.has(t)||t.startsWith("origin")||(n||void 0!==e)&&(!!W[t]||"opacity"===t)}const F=t=>void 0!==t&&!!t.getVelocity,I={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},$=(t,n)=>X.indexOf(t)-X.indexOf(n);function Z(t){return t.startsWith("--")}const z=(t,n)=>n&&"number"==typeof t?n.transform(t):t;const U={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},K=Object.assign(Object.assign({},U),{transform:(N=0,q=1,t=>Math.max(Math.min(t,q),N))});var N,q;const _=Object.assign(Object.assign({},U),{default:1}),G=t=>({test:n=>function(t){return"string"==typeof t}(n)&&n.endsWith(t)&&1===n.split(" ").length,parse:parseFloat,transform:n=>`${n}${t}`}),J=G("deg"),Q=G("%"),tt=G("px"),nt=Object.assign(Object.assign({},Q),{parse:t=>Q.parse(t)/100,transform:t=>Q.transform(100*t)}),et={...U,transform:Math.round},rt={borderWidth:tt,borderTopWidth:tt,borderRightWidth:tt,borderBottomWidth:tt,borderLeftWidth:tt,borderRadius:tt,radius:tt,borderTopLeftRadius:tt,borderTopRightRadius:tt,borderBottomRightRadius:tt,borderBottomLeftRadius:tt,width:tt,maxWidth:tt,height:tt,maxHeight:tt,size:tt,top:tt,right:tt,bottom:tt,left:tt,padding:tt,paddingTop:tt,paddingRight:tt,paddingBottom:tt,paddingLeft:tt,margin:tt,marginTop:tt,marginRight:tt,marginBottom:tt,marginLeft:tt,rotate:J,rotateX:J,rotateY:J,rotateZ:J,scale:_,scaleX:_,scaleY:_,scaleZ:_,skew:J,skewX:J,skewY:J,distance:tt,translateX:tt,translateY:tt,translateZ:tt,x:tt,y:tt,z:tt,perspective:tt,transformPerspective:tt,opacity:K,originX:nt,originY:nt,originZ:tt,zIndex:et,fillOpacity:K,strokeOpacity:K,numOctaves:et};function ot(t,n,e,r){const{style:o,vars:a,transform:i,transformKeys:s,transformOrigin:c}=t;s.length=0;let l=!1,u=!1,f=!0;for(const t in n){const e=n[t];if(Z(t)){a[t]=e;continue}const r=rt[t],d=z(e,r);if(Y.has(t)){if(l=!0,i[t]=d,s.push(t),!f)continue;e!==(r.default||0)&&(f=!1)}else t.startsWith("origin")?(u=!0,c[t]=d):o[t]=d}if(l||r?o.transform=function({transform:t,transformKeys:n},{enableHardwareAcceleration:e=!0,allowTransformNone:r=!0},o,a){let i="";n.sort($);for(const e of n)i+=`${I[e]||e}(${t[e]}) `;return e&&!t.z&&(i+="translateZ(0)"),i=i.trim(),a?i=a(t,o?"":i):r&&o&&(i="none"),i}(t,e,f,r):!n.transform&&o.transform&&(o.transform="none"),u){const{originX:t="50%",originY:n="50%",originZ:e=0}=c;o.transformOrigin=`${t} ${n} ${e}`}}const at=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}});function it(t,n,e){for(const r in n)F(n[r])||H(r,e)||(t[r]=n[r])}function st(t,n,e){const r={};return it(r,t.style||{},t),Object.assign(r,function({transformTemplate:t},n,e){return c(()=>{const r={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}};return ot(r,n,{enableHardwareAcceleration:!e},t),Object.assign({},r.vars,r.style)},[n])}(t,n,e)),t.transformValues?t.transformValues(r):r}function ct(t,n,e){const r={},o=st(t,n,e);return t.drag&&!1!==t.dragListener&&(r.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),r.style=o,r}const lt=new Set(["initial","style","variants","transition","transformTemplate","transformValues","custom","inherit","layout","layoutId","layoutDependency","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","drag","dragControls","dragListener","dragConstraints","dragDirectionLock","dragSnapToOrigin","_dragX","_dragY","dragElastic","dragMomentum","dragPropagation","dragTransition","onHoverStart","onHoverEnd","layoutScroll","whileInView","onViewportEnter","onViewportLeave","viewport","whileTap","onTap","onTapStart","onTapCancel","animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView","onPan","onPanStart","onPanSessionStart","onPanEnd"]);function ut(t){return lt.has(t)}let ft=t=>!ut(t);try{(dt=require("@emotion/is-prop-valid").default)&&(ft=t=>t.startsWith("on")?!ut(t):dt(t))}catch(t){}var dt;function mt(t,n,e){return"string"==typeof t?t:tt.transform(n+e*t)}const pt={offset:"stroke-dashoffset",array:"stroke-dasharray"},gt={offset:"strokeDashoffset",array:"strokeDasharray"};function yt(t,{attrX:n,attrY:e,originX:r,originY:o,pathLength:a,pathSpacing:i=1,pathOffset:s=0,...c},l,u){ot(t,c,l,u),t.attrs=t.style,t.style={};const{attrs:f,style:d,dimensions:m}=t;f.transform&&(m&&(d.transform=f.transform),delete f.transform),m&&(void 0!==r||void 0!==o||d.transform)&&(d.transformOrigin=function(t,n,e){return`${mt(n,t.x,t.width)} ${mt(e,t.y,t.height)}`}(m,void 0!==r?r:.5,void 0!==o?o:.5)),void 0!==n&&(f.x=n),void 0!==e&&(f.y=e),void 0!==a&&function(t,n,e=1,r=0,o=!0){t.pathLength=1;const a=o?pt:gt;t[a.offset]=tt.transform(-r);const i=tt.transform(n),s=tt.transform(e);t[a.array]=`${i} ${s}`}(f,a,i,s,!1)}const ht=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{},attrs:{}});function vt(t,n){const e=c(()=>{const e={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{},attrs:{}};return yt(e,n,{enableHardwareAcceleration:!1},t.transformTemplate),{...e.attrs,style:{...e.style}}},[n]);if(t.style){const n={};it(n,t.style,t),e.style={...n,...e.style}}return e}function wt(t=!1){return(n,e,r,o,{latestValues:a},i)=>{const s=(B(n)?vt:ct)(e,a,i),c={...function(t,n,e){const r={};for(const o in t)(ft(o)||!0===e&&ut(o)||!n&&!ut(o)||t.draggable&&o.startsWith("onDrag"))&&(r[o]=t[o]);return r}(e,"string"==typeof n,t),...s,ref:o};return r&&(c["data-projection-id"]=r),u(n,c)}}const bt=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength"]);function St(t,n,e,r){!function(t,{style:n,vars:e},r,o){Object.assign(t.style,n,o&&o.getProjectionStyles(r));for(const n in e)t.style.setProperty(n,e[n])}(t,n,void 0,r);for(const e in n.attrs)t.setAttribute(bt.has(e)?e:e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),n.attrs[e])}function xt(t){const{style:n}=t,e={};for(const r in n)(F(n[r])||H(r,t))&&(e[r]=n[r]);return e}function Vt(t){const n=F(t)?t.get():t;return e=n,Boolean(e&&"object"==typeof e&&e.mix&&e.toValue)?n.toValue():n;var e}const Ot=t=>(n,e)=>{const o=r(d),a=r(m),i=()=>function({scrapeMotionValuesFromProps:t,createRenderState:n,onMount:e},r,o,a){const i={latestValues:Tt(r,o,a,t),renderState:n()};return e&&(i.mount=t=>e(r,t,i)),i}(t,n,o,a);return e?i():E(i)};function Tt(t,n,e,r){const o={},a=r(t);for(const t in a)o[t]=Vt(a[t]);let{initial:i,animate:s}=t;const c=x(t),l=function(t){return Boolean(x(t)||t.variants)}(t);n&&l&&!c&&!1!==t.inherit&&(void 0===i&&(i=n.initial),void 0===s&&(s=n.animate));let u=!!e&&!1===e.initial;u=u||!1===i;const f=u?s:i;if(f&&"boolean"!=typeof f&&!b(f)){(Array.isArray(f)?f:[f]).forEach(n=>{const e=function(t,n,e,r={},o={}){return"function"==typeof n&&(n=n(void 0!==e?e:t.custom,r,o)),"string"==typeof n&&(n=t.variants&&t.variants[n]),"function"==typeof n&&(n=n(void 0!==e?e:t.custom,r,o)),n}(t,n);if(!e)return;const{transitionEnd:r,transition:a,...i}=e;for(const t in i){let n=i[t];if(Array.isArray(n)){n=n[u?n.length-1:0]}null!==n&&(o[t]=n)}for(const t in r)o[t]=r[t]})}return o}const Ct={useVisualState:Ot({scrapeMotionValuesFromProps:function(t){const n=xt(t);for(const e in t)if(F(t[e])){n["x"===e||"y"===e?"attr"+e.toUpperCase():e]=t[e]}return n},createRenderState:ht,onMount:(t,n,{renderState:e,latestValues:r})=>{try{e.dimensions="function"==typeof n.getBBox?n.getBBox():n.getBoundingClientRect()}catch(t){e.dimensions={x:0,y:0,width:0,height:0}}yt(e,r,{enableHardwareAcceleration:!1},t.transformTemplate),St(n,e)}})},Et={useVisualState:Ot({scrapeMotionValuesFromProps:xt,createRenderState:at})};const Pt=function(t){function n(n,e={}){return M(t(n,e))}if("undefined"==typeof Proxy)return n;const e=new Map;return new Proxy(n,{get:(t,r)=>(e.has(r)||e.set(r,n(r)),e.get(r))})}((function(t,{forwardMotionProps:n=!1},e,r,o){return{...B(t)?Ct:Et,preloadedFeatures:e,useRender:wt(n),createVisualElement:r,projectionNodeConstructor:o,Component:t}}));export{Pt as m};
1
+ import*as t from"react";import n,{createContext as e,useContext as r,useLayoutEffect as o,useEffect as a,useRef as i,useCallback as s,useMemo as c,forwardRef as l,createElement as u}from"react";const f=e({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),d=e({});const m=e(null),p="undefined"!=typeof document,g=p?o:a,y=e({strict:!1});function h(t,n,e,o){const s=r(d).visualElement,c=r(y),l=r(m),u=r(f).reducedMotion,p=i(void 0);o=o||c.renderer,!p.current&&o&&(p.current=o(t,{visualState:n,parent:s,props:e,presenceId:l?l.id:void 0,blockInitialAnimation:!!l&&!1===l.initial,reducedMotionConfig:u}));const h=p.current;return g(()=>{h&&h.syncRender()}),a(()=>{h&&h.animationState&&h.animationState.animateChanges()}),g(()=>()=>h&&h.notifyUnmount(),[]),h}function v(t,n,e){return s(r=>{var o;r&&t.mount&&t.mount(r),n&&(r?n.mount(r):n.unmount()),e&&("function"==typeof e?e(r):"object"==typeof(o=e)&&Object.prototype.hasOwnProperty.call(o,"current")&&(e.current=r))},[n])}function w(t){return"string"==typeof t||Array.isArray(t)}function b(t){return"object"==typeof t&&"function"==typeof t.start}const S=["initial","animate","exit","whileHover","whileDrag","whileTap","whileFocus","whileInView"];function x(t){return b(t.animate)||S.some(n=>w(t[n]))}function V(t){const{initial:n,animate:e}=function(t,n){if(x(t)){const{initial:n,animate:e}=t;return{initial:!1===n||w(n)?n:void 0,animate:w(e)?e:void 0}}return!1!==t.inherit?n:{}}(t,r(d));return c(()=>({initial:n,animate:e}),[C(n),C(e)])}function C(t){return Array.isArray(t)?t.join(" "):t}const O=t=>({isEnabled:n=>t.some(t=>!!n[t])}),T={measureLayout:O(["layout","layoutId","drag"]),animation:O(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:O(["exit"]),drag:O(["drag","dragControls"]),focus:O(["whileFocus"]),hover:O(["whileHover","onHoverStart","onHoverEnd"]),tap:O(["whileTap","onTap","onTapStart","onTapCancel"]),pan:O(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:O(["whileInView","onViewportEnter","onViewportLeave"])};function E(t){const n=i(null);return null===n.current&&(n.current=t()),n.current}const P=!1;let k=1;const A=e({});class j extends n.Component{getSnapshotBeforeUpdate(){const{visualElement:t,props:n}=this.props;return t&&t.setProps(n),null}componentDidUpdate(){}render(){return this.props.children}}const L=e({}),M=Symbol.for("motionComponentSymbol");function R({preloadedFeatures:n,createVisualElement:e,projectionNodeConstructor:o,useRender:a,useVisualState:i,Component:s}){n&&function(t){for(const n in t)"projectionNodeConstructor"===n?T.projectionNodeConstructor=t[n]:T[n].Component=t[n]}(n);const c=l((function(c,l){const u={...r(f),...c,layoutId:D(c)},{isStatic:m}=u;let g=null;const w=V(c),b=m?void 0:E(()=>{if(P)return k++}),S=i(c,m);if(!m&&p){w.visualElement=h(s,S,u,e);const t=r(y).strict,a=r(L);w.visualElement&&(g=w.visualElement.loadFeatures(u,t,n,b,o||T.projectionNodeConstructor,a))}return t.createElement(j,{visualElement:w.visualElement,props:u},g,t.createElement(d.Provider,{value:w},a(s,c,b,v(S,w.visualElement,l),S,m,w.visualElement)))}));return c[M]=s,c}function D({layoutId:t}){const n=r(A).id;return n&&void 0!==t?n+"-"+t:t}const B=["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"];function W(t){return"string"==typeof t&&!t.includes("-")&&!!(B.indexOf(t)>-1||/[A-Z]/.test(t))}const X={},Y=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],H=new Set(Y);function F(t,{layout:n,layoutId:e}){return H.has(t)||t.startsWith("origin")||(n||void 0!==e)&&(!!X[t]||"opacity"===t)}const I=t=>void 0!==t&&!!t.getVelocity,$={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Z=(t,n)=>Y.indexOf(t)-Y.indexOf(n);function z(t){return t.startsWith("--")}const U=(t,n)=>n&&"number"==typeof t?n.transform(t):t;const K={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},N=Object.assign(Object.assign({},K),{transform:(q=0,_=1,t=>Math.max(Math.min(t,_),q))});var q,_;const G=Object.assign(Object.assign({},K),{default:1}),J=t=>({test:n=>function(t){return"string"==typeof t}(n)&&n.endsWith(t)&&1===n.split(" ").length,parse:parseFloat,transform:n=>`${n}${t}`}),Q=J("deg"),tt=J("%"),nt=J("px"),et=Object.assign(Object.assign({},tt),{parse:t=>tt.parse(t)/100,transform:t=>tt.transform(100*t)}),rt={...K,transform:Math.round},ot={borderWidth:nt,borderTopWidth:nt,borderRightWidth:nt,borderBottomWidth:nt,borderLeftWidth:nt,borderRadius:nt,radius:nt,borderTopLeftRadius:nt,borderTopRightRadius:nt,borderBottomRightRadius:nt,borderBottomLeftRadius:nt,width:nt,maxWidth:nt,height:nt,maxHeight:nt,size:nt,top:nt,right:nt,bottom:nt,left:nt,padding:nt,paddingTop:nt,paddingRight:nt,paddingBottom:nt,paddingLeft:nt,margin:nt,marginTop:nt,marginRight:nt,marginBottom:nt,marginLeft:nt,rotate:Q,rotateX:Q,rotateY:Q,rotateZ:Q,scale:G,scaleX:G,scaleY:G,scaleZ:G,skew:Q,skewX:Q,skewY:Q,distance:nt,translateX:nt,translateY:nt,translateZ:nt,x:nt,y:nt,z:nt,perspective:nt,transformPerspective:nt,opacity:N,originX:et,originY:et,originZ:nt,zIndex:rt,fillOpacity:N,strokeOpacity:N,numOctaves:rt};function at(t,n,e,r){const{style:o,vars:a,transform:i,transformKeys:s,transformOrigin:c}=t;s.length=0;let l=!1,u=!1,f=!0;for(const t in n){const e=n[t];if(z(t)){a[t]=e;continue}const r=ot[t],d=U(e,r);if(H.has(t)){if(l=!0,i[t]=d,s.push(t),!f)continue;e!==(r.default||0)&&(f=!1)}else t.startsWith("origin")?(u=!0,c[t]=d):o[t]=d}if(l||r?o.transform=function({transform:t,transformKeys:n},{enableHardwareAcceleration:e=!0,allowTransformNone:r=!0},o,a){let i="";n.sort(Z);for(const e of n)i+=`${$[e]||e}(${t[e]}) `;return e&&!t.z&&(i+="translateZ(0)"),i=i.trim(),a?i=a(t,o?"":i):r&&o&&(i="none"),i}(t,e,f,r):!n.transform&&o.transform&&(o.transform="none"),u){const{originX:t="50%",originY:n="50%",originZ:e=0}=c;o.transformOrigin=`${t} ${n} ${e}`}}const it=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}});function st(t,n,e){for(const r in n)I(n[r])||F(r,e)||(t[r]=n[r])}function ct(t,n,e){const r={};return st(r,t.style||{},t),Object.assign(r,function({transformTemplate:t},n,e){return c(()=>{const r={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}};return at(r,n,{enableHardwareAcceleration:!e},t),Object.assign({},r.vars,r.style)},[n])}(t,n,e)),t.transformValues?t.transformValues(r):r}function lt(t,n,e){const r={},o=ct(t,n,e);return t.drag&&!1!==t.dragListener&&(r.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),r.style=o,r}const ut=new Set(["initial","style","variants","transition","transformTemplate","transformValues","custom","inherit","layout","layoutId","layoutDependency","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","drag","dragControls","dragListener","dragConstraints","dragDirectionLock","dragSnapToOrigin","_dragX","_dragY","dragElastic","dragMomentum","dragPropagation","dragTransition","onHoverStart","onHoverEnd","layoutScroll","whileInView","onViewportEnter","onViewportLeave","viewport","whileTap","onTap","onTapStart","onTapCancel","animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView","onPan","onPanStart","onPanSessionStart","onPanEnd"]);function ft(t){return ut.has(t)}let dt=t=>!ft(t);try{(mt=require("@emotion/is-prop-valid").default)&&(dt=t=>t.startsWith("on")?!ft(t):mt(t))}catch(t){}var mt;function pt(t,n,e){return"string"==typeof t?t:nt.transform(n+e*t)}const gt={offset:"stroke-dashoffset",array:"stroke-dasharray"},yt={offset:"strokeDashoffset",array:"strokeDasharray"};function ht(t,{attrX:n,attrY:e,originX:r,originY:o,pathLength:a,pathSpacing:i=1,pathOffset:s=0,...c},l,u){at(t,c,l,u),t.attrs=t.style,t.style={};const{attrs:f,style:d,dimensions:m}=t;f.transform&&(m&&(d.transform=f.transform),delete f.transform),m&&(void 0!==r||void 0!==o||d.transform)&&(d.transformOrigin=function(t,n,e){return`${pt(n,t.x,t.width)} ${pt(e,t.y,t.height)}`}(m,void 0!==r?r:.5,void 0!==o?o:.5)),void 0!==n&&(f.x=n),void 0!==e&&(f.y=e),void 0!==a&&function(t,n,e=1,r=0,o=!0){t.pathLength=1;const a=o?gt:yt;t[a.offset]=nt.transform(-r);const i=nt.transform(n),s=nt.transform(e);t[a.array]=`${i} ${s}`}(f,a,i,s,!1)}const vt=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{},attrs:{}});function wt(t,n){const e=c(()=>{const e={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{},attrs:{}};return ht(e,n,{enableHardwareAcceleration:!1},t.transformTemplate),{...e.attrs,style:{...e.style}}},[n]);if(t.style){const n={};st(n,t.style,t),e.style={...n,...e.style}}return e}function bt(t=!1){return(n,e,r,o,{latestValues:a},i)=>{const s=(W(n)?wt:lt)(e,a,i),c={...function(t,n,e){const r={};for(const o in t)(dt(o)||!0===e&&ft(o)||!n&&!ft(o)||t.draggable&&o.startsWith("onDrag"))&&(r[o]=t[o]);return r}(e,"string"==typeof n,t),...s,ref:o};return r&&(c["data-projection-id"]=r),u(n,c)}}const St=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength"]);function xt(t,n,e,r){!function(t,{style:n,vars:e},r,o){Object.assign(t.style,n,o&&o.getProjectionStyles(r));for(const n in e)t.style.setProperty(n,e[n])}(t,n,void 0,r);for(const e in n.attrs)t.setAttribute(St.has(e)?e:e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),n.attrs[e])}function Vt(t){const{style:n}=t,e={};for(const r in n)(I(n[r])||F(r,t))&&(e[r]=n[r]);return e}function Ct(t){const n=I(t)?t.get():t;return e=n,Boolean(e&&"object"==typeof e&&e.mix&&e.toValue)?n.toValue():n;var e}const Ot=t=>(n,e)=>{const o=r(d),a=r(m),i=()=>function({scrapeMotionValuesFromProps:t,createRenderState:n,onMount:e},r,o,a){const i={latestValues:Tt(r,o,a,t),renderState:n()};return e&&(i.mount=t=>e(r,t,i)),i}(t,n,o,a);return e?i():E(i)};function Tt(t,n,e,r){const o={},a=r(t);for(const t in a)o[t]=Ct(a[t]);let{initial:i,animate:s}=t;const c=x(t),l=function(t){return Boolean(x(t)||t.variants)}(t);n&&l&&!c&&!1!==t.inherit&&(void 0===i&&(i=n.initial),void 0===s&&(s=n.animate));let u=!!e&&!1===e.initial;u=u||!1===i;const f=u?s:i;if(f&&"boolean"!=typeof f&&!b(f)){(Array.isArray(f)?f:[f]).forEach(n=>{const e=function(t,n,e,r={},o={}){return"function"==typeof n&&(n=n(void 0!==e?e:t.custom,r,o)),"string"==typeof n&&(n=t.variants&&t.variants[n]),"function"==typeof n&&(n=n(void 0!==e?e:t.custom,r,o)),n}(t,n);if(!e)return;const{transitionEnd:r,transition:a,...i}=e;for(const t in i){let n=i[t];if(Array.isArray(n)){n=n[u?n.length-1:0]}null!==n&&(o[t]=n)}for(const t in r)o[t]=r[t]})}return o}const Et={useVisualState:Ot({scrapeMotionValuesFromProps:function(t){const n=Vt(t);for(const e in t)if(I(t[e])){n["x"===e||"y"===e?"attr"+e.toUpperCase():e]=t[e]}return n},createRenderState:vt,onMount:(t,n,{renderState:e,latestValues:r})=>{try{e.dimensions="function"==typeof n.getBBox?n.getBBox():n.getBoundingClientRect()}catch(t){e.dimensions={x:0,y:0,width:0,height:0}}ht(e,r,{enableHardwareAcceleration:!1},t.transformTemplate),xt(n,e)}})},Pt={useVisualState:Ot({scrapeMotionValuesFromProps:Vt,createRenderState:it})};const kt=function(t){function n(n,e={}){return R(t(n,e))}if("undefined"==typeof Proxy)return n;const e=new Map;return new Proxy(n,{get:(t,r)=>(e.has(r)||e.set(r,n(r)),e.get(r))})}((function(t,{forwardMotionProps:n=!1},e,r,o){return{...W(t)?Et:Pt,preloadedFeatures:e,useRender:bt(n),createVisualElement:r,projectionNodeConstructor:o,Component:t}}));export{kt as m};