import{r as P}from"./index-JhL3uwfD.js";import{j as Te}from"./jsx-runtime-D_zvdyIk.js";const Os=P.createContext({});function br(t){const e=P.useRef(null);return e.current===null&&(e.current=t()),e.current}const Ar=typeof window<"u",Vr=Ar?P.useLayoutEffect:P.useEffect,$e=P.createContext(null);function Ge(t,e){t.indexOf(e)===-1&&t.push(e)}function Gt(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const X=(t,e,n)=>n>e?e:n{};const Y={},js=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function Ns(t){return typeof t=="object"&&t!==null}const Us=t=>/^0[^.\s]+$/u.test(t);function Ws(t){let e;return()=>(e===void 0&&(e=t()),e)}const W=t=>t,Cr=(t,e)=>n=>e(t(n)),Rt=(...t)=>t.reduce(Cr),Vt=(t,e,n)=>{const s=e-t;return s===0?1:(n-t)/s};class ze{constructor(){this.subscriptions=[]}add(e){return Ge(this.subscriptions,e),()=>Gt(this.subscriptions,e)}notify(e,n,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,s);else for(let o=0;ot*1e3,U=t=>t/1e3;function Ks(t,e){return e?t*(1e3/e):0}const $s=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Mr=1e-7,Dr=12;function Er(t,e,n,s,i){let o,r,a=0;do r=e+(n-e)/2,o=$s(r,s,i)-t,o>0?n=r:e=r;while(Math.abs(o)>Mr&&++aEr(o,0,1,t,n);return o=>o===0||o===1?o:$s(i(o),e,s)}const Gs=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Hs=t=>e=>1-t(1-e),zs=Lt(.33,1.53,.69,.99),_e=Hs(zs),_s=Gs(_e),Xs=t=>(t*=2)<1?.5*_e(t):.5*(2-Math.pow(2,-10*(t-1))),Xe=t=>1-Math.sin(Math.acos(t)),Ys=Hs(Xe),qs=Gs(Xe),Rr=Lt(.42,0,1,1),Lr=Lt(0,0,.58,1),Zs=Lt(.42,0,.58,1),kr=t=>Array.isArray(t)&&typeof t[0]!="number",Js=t=>Array.isArray(t)&&typeof t[0]=="number",Fr={linear:W,easeIn:Rr,easeInOut:Zs,easeOut:Lr,circIn:Xe,circInOut:qs,circOut:Ys,backIn:_e,backInOut:_s,backOut:zs,anticipate:Xs},Br=t=>typeof t=="string",Sn=t=>{if(Js(t)){He(t.length===4);const[e,n,s,i]=t;return Lt(e,n,s,i)}else if(Br(t))return Fr[t];return t},Bt=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Ir(t,e){let n=new Set,s=new Set,i=!1,o=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function l(c){r.has(c)&&(u.schedule(c),t()),c(a)}const u={schedule:(c,h=!1,f=!1)=>{const m=f&&i?n:s;return h&&r.add(c),m.has(c)||m.add(c),c},cancel:c=>{s.delete(c),r.delete(c)},process:c=>{if(a=c,i){o=!0;return}i=!0,[n,s]=[s,n],n.forEach(l),n.clear(),i=!1,o&&(o=!1,u.process(c))}};return u}const Or=40;function Qs(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,r=Bt.reduce((g,S)=>(g[S]=Ir(o),g),{}),{setup:a,read:l,resolveKeyframes:u,preUpdate:c,update:h,preRender:f,render:d,postRender:m}=r,p=()=>{const g=Y.useManualTiming?i.timestamp:performance.now();n=!1,Y.useManualTiming||(i.delta=s?1e3/60:Math.max(Math.min(g-i.timestamp,Or),1)),i.timestamp=g,i.isProcessing=!0,a.process(i),l.process(i),u.process(i),c.process(i),h.process(i),f.process(i),d.process(i),m.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(p))},y=()=>{n=!0,s=!0,i.isProcessing||t(p)};return{schedule:Bt.reduce((g,S)=>{const w=r[S];return g[S]=(A,D=!1,b=!1)=>(n||y(),w.schedule(A,D,b)),g},{}),cancel:g=>{for(let S=0;S(jt===void 0&&I.set(k.isProcessing||Y.useManualTiming?k.timestamp:performance.now()),jt),set:t=>{jt=t,queueMicrotask(jr)}},ti=t=>e=>typeof e=="string"&&e.startsWith(t),ei=ti("--"),Nr=ti("var(--"),Ye=t=>Nr(t)?Ur.test(t.split("/*")[0].trim()):!1,Ur=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Pn(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const gt={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Ct={...gt,transform:t=>X(0,1,t)},It={...gt,default:1},St=t=>Math.round(t*1e5)/1e5,qe=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Wr(t){return t==null}const Kr=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ze=(t,e)=>n=>!!(typeof n=="string"&&Kr.test(n)&&n.startsWith(t)||e&&!Wr(n)&&Object.prototype.hasOwnProperty.call(n,e)),ni=(t,e,n)=>s=>{if(typeof s!="string")return s;const[i,o,r,a]=s.match(qe);return{[t]:parseFloat(i),[e]:parseFloat(o),[n]:parseFloat(r),alpha:a!==void 0?parseFloat(a):1}},$r=t=>X(0,255,t),se={...gt,transform:t=>Math.round($r(t))},it={test:Ze("rgb","red"),parse:ni("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+se.transform(t)+", "+se.transform(e)+", "+se.transform(n)+", "+St(Ct.transform(s))+")"};function Gr(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const xe={test:Ze("#"),parse:Gr,transform:it.transform},kt=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),q=kt("deg"),_=kt("%"),T=kt("px"),Hr=kt("vh"),zr=kt("vw"),bn={..._,parse:t=>_.parse(t)/100,transform:t=>_.transform(t*100)},ct={test:Ze("hsl","hue"),parse:ni("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+_.transform(St(e))+", "+_.transform(St(n))+", "+St(Ct.transform(s))+")"},E={test:t=>it.test(t)||xe.test(t)||ct.test(t),parse:t=>it.test(t)?it.parse(t):ct.test(t)?ct.parse(t):xe.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?it.transform(t):ct.transform(t),getAnimatableNone:t=>{const e=E.parse(t);return e.alpha=0,E.transform(e)}},_r=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Xr(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(qe))==null?void 0:e.length)||0)+(((n=t.match(_r))==null?void 0:n.length)||0)>0}const si="number",ii="color",Yr="var",qr="var(",An="${}",Zr=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Mt(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let o=0;const a=e.replace(Zr,l=>(E.test(l)?(s.color.push(o),i.push(ii),n.push(E.parse(l))):l.startsWith(qr)?(s.var.push(o),i.push(Yr),n.push(l)):(s.number.push(o),i.push(si),n.push(parseFloat(l))),++o,An)).split(An);return{values:n,split:a,indexes:s,types:i}}function ri(t){return Mt(t).values}function oi(t){const{split:e,types:n}=Mt(t),s=e.length;return i=>{let o="";for(let r=0;rtypeof t=="number"?0:E.test(t)?E.getAnimatableNone(t):t;function Qr(t){const e=ri(t);return oi(t)(e.map(Jr))}const H={test:Xr,parse:ri,createTransformer:oi,getAnimatableNone:Qr};function ie(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function to({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,e/=100,n/=100;let i=0,o=0,r=0;if(!e)i=o=r=n;else{const a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;i=ie(l,a,t+1/3),o=ie(l,a,t),r=ie(l,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(r*255),alpha:s}}function Ht(t,e){return n=>n>0?e:t}const C=(t,e,n)=>t+(e-t)*n,re=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},eo=[xe,it,ct],no=t=>eo.find(e=>e.test(t));function Vn(t){const e=no(t);if(!e)return!1;let n=e.parse(t);return e===ct&&(n=to(n)),n}const Cn=(t,e)=>{const n=Vn(t),s=Vn(e);if(!n||!s)return Ht(t,e);const i={...n};return o=>(i.red=re(n.red,s.red,o),i.green=re(n.green,s.green,o),i.blue=re(n.blue,s.blue,o),i.alpha=C(n.alpha,s.alpha,o),it.transform(i))},we=new Set(["none","hidden"]);function so(t,e){return we.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function io(t,e){return n=>C(t,e,n)}function Je(t){return typeof t=="number"?io:typeof t=="string"?Ye(t)?Ht:E.test(t)?Cn:ao:Array.isArray(t)?ai:typeof t=="object"?E.test(t)?Cn:ro:Ht}function ai(t,e){const n=[...t],s=n.length,i=t.map((o,r)=>Je(o)(o,e[r]));return o=>{for(let r=0;r{for(const o in s)n[o]=s[o](i);return n}}function oo(t,e){const n=[],s={color:0,var:0,number:0};for(let i=0;i{const n=H.createTransformer(e),s=Mt(t),i=Mt(e);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?we.has(t)&&!i.values.length||we.has(e)&&!s.values.length?so(t,e):Rt(ai(oo(s,i),i.values),n):Ht(t,e)};function li(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?C(t,e,n):Je(t)(t,e)}const lo=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>V.update(e,n),stop:()=>Q(e),now:()=>k.isProcessing?k.timestamp:I.now()}},ci=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let o=0;o=zt?1/0:e}function co(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(Qe(s),zt);return{type:"keyframes",ease:o=>s.next(i*o).value/e,duration:U(i)}}const uo=5;function ui(t,e,n){const s=Math.max(e-uo,0);return Ks(n-t(s),e-s)}const M={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},oe=.001;function ho({duration:t=M.duration,bounce:e=M.bounce,velocity:n=M.velocity,mass:s=M.mass}){let i,o,r=1-e;r=X(M.minDamping,M.maxDamping,r),t=X(M.minDuration,M.maxDuration,U(t)),r<1?(i=u=>{const c=u*r,h=c*t,f=c-n,d=Se(u,r),m=Math.exp(-h);return oe-f/d*m},o=u=>{const h=u*r*t,f=h*n+n,d=Math.pow(r,2)*Math.pow(u,2)*t,m=Math.exp(-h),p=Se(Math.pow(u,2),r);return(-i(u)+oe>0?-1:1)*((f-d)*m)/p}):(i=u=>{const c=Math.exp(-u*t),h=(u-n)*t+1;return-oe+c*h},o=u=>{const c=Math.exp(-u*t),h=(n-u)*(t*t);return c*h});const a=5/t,l=mo(i,o,a);if(t=G(t),isNaN(l))return{stiffness:M.stiffness,damping:M.damping,duration:t};{const u=Math.pow(l,2)*s;return{stiffness:u,damping:r*2*Math.sqrt(s*u),duration:t}}}const fo=12;function mo(t,e,n){let s=n;for(let i=1;it[n]!==void 0)}function yo(t){let e={velocity:M.velocity,stiffness:M.stiffness,damping:M.damping,mass:M.mass,isResolvedFromDuration:!1,...t};if(!Mn(t,go)&&Mn(t,po))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,o=2*X(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:M.mass,stiffness:i,damping:o}}else{const n=ho({...t,velocity:0});e={...e,...n,mass:M.mass},e.isResolvedFromDuration=!0}return e}function _t(t=M.visualDuration,e=M.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const o=n.keyframes[0],r=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:l,damping:u,mass:c,duration:h,velocity:f,isResolvedFromDuration:d}=yo({...n,velocity:-U(n.velocity||0)}),m=f||0,p=u/(2*Math.sqrt(l*c)),y=r-o,v=U(Math.sqrt(l/c)),x=Math.abs(y)<5;s||(s=x?M.restSpeed.granular:M.restSpeed.default),i||(i=x?M.restDelta.granular:M.restDelta.default);let g;if(p<1){const w=Se(v,p);g=A=>{const D=Math.exp(-p*v*A);return r-D*((m+p*v*y)/w*Math.sin(w*A)+y*Math.cos(w*A))}}else if(p===1)g=w=>r-Math.exp(-v*w)*(y+(m+v*y)*w);else{const w=v*Math.sqrt(p*p-1);g=A=>{const D=Math.exp(-p*v*A),b=Math.min(w*A,300);return r-D*((m+p*v*y)*Math.sinh(b)+w*y*Math.cosh(b))/w}}const S={calculatedDuration:d&&h||null,next:w=>{const A=g(w);if(d)a.done=w>=h;else{let D=w===0?m:0;p<1&&(D=w===0?G(m):ui(g,w,A));const b=Math.abs(D)<=s,B=Math.abs(r-A)<=i;a.done=b&&B}return a.value=a.done?r:A,a},toString:()=>{const w=Math.min(Qe(S),zt),A=ci(D=>S.next(w*D).value,w,30);return w+"ms "+A},toTransition:()=>{}};return S}_t.applyToOptions=t=>{const e=co(t,100,_t);return t.ease=e.ease,t.duration=G(e.duration),t.type="keyframes",t};function Pe({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:u=.5,restSpeed:c}){const h=t[0],f={done:!1,value:h},d=b=>a!==void 0&&bl,m=b=>a===void 0?l:l===void 0||Math.abs(a-b)-p*Math.exp(-b/s),g=b=>v+x(b),S=b=>{const B=x(b),j=g(b);f.done=Math.abs(B)<=u,f.value=f.done?v:j};let w,A;const D=b=>{d(f.value)&&(w=b,A=_t({keyframes:[f.value,m(f.value)],velocity:ui(g,b,f.value),damping:i,stiffness:o,restDelta:u,restSpeed:c}))};return D(0),{calculatedDuration:null,next:b=>{let B=!1;return!A&&w===void 0&&(B=!0,S(b),D(b)),w!==void 0&&b>=w?A.next(b-w):(!B&&S(b),f)}}}function vo(t,e,n){const s=[],i=n||Y.mix||li,o=t.length-1;for(let r=0;re[0];if(o===2&&e[0]===e[1])return()=>e[1];const r=t[0]===t[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=vo(e,s,i),l=a.length,u=c=>{if(r&&c1)for(;hu(X(t[0],t[o-1],c)):u}function xo(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=Vt(0,e,s);t.push(C(n,1,i))}}function wo(t){const e=[0];return xo(e,t.length-1),e}function So(t,e){return t.map(n=>n*e)}function Po(t,e){return t.map(()=>e||Zs).splice(0,t.length-1)}function Pt({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=kr(s)?s.map(Sn):Sn(s),o={done:!1,value:e[0]},r=So(n&&n.length===e.length?n:wo(e),t),a=To(r,e,{ease:Array.isArray(i)?i:Po(e,i)});return{calculatedDuration:t,next:l=>(o.value=a(l),o.done=l>=t,o)}}const bo=t=>t!==null;function tn(t,{repeat:e,repeatType:n="loop"},s,i=1){const o=t.filter(bo),a=i<0||e&&n!=="loop"&&e%2===1?0:o.length-1;return!a||s===void 0?o[a]:s}const Ao={decay:Pe,inertia:Pe,tween:Pt,keyframes:Pt,spring:_t};function hi(t){typeof t.type=="string"&&(t.type=Ao[t.type])}class en{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const Vo=t=>t/100;class nn extends en{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var s,i;const{motionValue:n}=this.options;n&&n.updatedAt!==I.now()&&this.tick(I.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(s=this.options).onStop)==null||i.call(s))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;hi(e);const{type:n=Pt,repeat:s=0,repeatDelay:i=0,repeatType:o,velocity:r=0}=e;let{keyframes:a}=e;const l=n||Pt;l!==Pt&&typeof a[0]!="number"&&(this.mixKeyframes=Rt(Vo,li(a[0],a[1])),a=[0,100]);const u=l({...e,keyframes:a});o==="mirror"&&(this.mirroredGenerator=l({...e,keyframes:[...a].reverse(),velocity:-r})),u.calculatedDuration===null&&(u.calculatedDuration=Qe(u));const{calculatedDuration:c}=u;this.calculatedDuration=c,this.resolvedDuration=c+i,this.totalDuration=this.resolvedDuration*(s+1)-i,this.generator=u}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:s,totalDuration:i,mixKeyframes:o,mirroredGenerator:r,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return s.next(0);const{delay:u=0,keyframes:c,repeat:h,repeatType:f,repeatDelay:d,type:m,onUpdate:p,finalKeyframe:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-i/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const v=this.currentTime-u*(this.playbackSpeed>=0?1:-1),x=this.playbackSpeed>=0?v<0:v>i;this.currentTime=Math.max(v,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let g=this.currentTime,S=s;if(h){const b=Math.min(this.currentTime,i)/a;let B=Math.floor(b),j=b%1;!j&&b>=1&&(j=1),j===1&&B--,B=Math.min(B,h+1),!!(B%2)&&(f==="reverse"?(j=1-j,d&&(j-=d/a)):f==="mirror"&&(S=r)),g=X(0,1,j)*a}const w=x?{done:!1,value:c[0]}:S.next(g);o&&(w.value=o(w.value));let{done:A}=w;!x&&l!==null&&(A=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const D=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&A);return D&&m!==Pe&&(w.value=tn(c,this.options,y,this.speed)),p&&p(w.value),D&&this.finish(),w}then(e,n){return this.finished.then(e,n)}get duration(){return U(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+U(e)}get time(){return U(this.currentTime)}set time(e){var n;e=G(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(I.now());const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=U(this.currentTime))}play(){var i,o;if(this.isStopped)return;const{driver:e=lo,startTime:n}=this.options;this.driver||(this.driver=e(r=>this.tick(r))),(o=(i=this.options).onPlay)==null||o.call(i);const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=n??s),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(I.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(e=this.options).onComplete)==null||n.call(e)}cancel(){var e,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(e=this.options).onCancel)==null||n.call(e)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),e.observe(this)}}function Co(t){for(let e=1;et*180/Math.PI,be=t=>{const e=rt(Math.atan2(t[1],t[0]));return Ae(e)},Mo={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:be,rotateZ:be,skewX:t=>rt(Math.atan(t[1])),skewY:t=>rt(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Ae=t=>(t=t%360,t<0&&(t+=360),t),Dn=be,En=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Rn=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Do={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:En,scaleY:Rn,scale:t=>(En(t)+Rn(t))/2,rotateX:t=>Ae(rt(Math.atan2(t[6],t[5]))),rotateY:t=>Ae(rt(Math.atan2(-t[2],t[0]))),rotateZ:Dn,rotate:Dn,skewX:t=>rt(Math.atan(t[4])),skewY:t=>rt(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Ve(t){return t.includes("scale")?1:0}function Ce(t,e){if(!t||t==="none")return Ve(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=Do,i=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=Mo,i=a}if(!i)return Ve(e);const o=s[e],r=i[1].split(",").map(Ro);return typeof o=="function"?o(r):r[o]}const Eo=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Ce(n,e)};function Ro(t){return parseFloat(t.trim())}const yt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],vt=new Set(yt),Ln=t=>t===gt||t===T,Lo=new Set(["x","y","z"]),ko=yt.filter(t=>!Lo.has(t));function Fo(t){const e=[];return ko.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}const J={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:(t,{transform:e})=>Ce(e,"x"),y:(t,{transform:e})=>Ce(e,"y")};J.translateX=J.x;J.translateY=J.y;const ot=new Set;let Me=!1,De=!1,Ee=!1;function fi(){if(De){const t=Array.from(ot).filter(s=>s.needsMeasurement),e=new Set(t.map(s=>s.element)),n=new Map;e.forEach(s=>{const i=Fo(s);i.length&&(n.set(s,i),s.render())}),t.forEach(s=>s.measureInitialState()),e.forEach(s=>{s.render();const i=n.get(s);i&&i.forEach(([o,r])=>{var a;(a=s.getValue(o))==null||a.set(r)})}),t.forEach(s=>s.measureEndState()),t.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}De=!1,Me=!1,ot.forEach(t=>t.complete(Ee)),ot.clear()}function di(){ot.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(De=!0)})}function Bo(){Ee=!0,di(),fi(),Ee=!1}class sn{constructor(e,n,s,i,o,r=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=s,this.motionValue=i,this.element=o,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?(ot.add(this),Me||(Me=!0,V.read(di),V.resolveKeyframes(fi))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:s,motionValue:i}=this;if(e[0]===null){const o=i==null?void 0:i.get(),r=e[e.length-1];if(o!==void 0)e[0]=o;else if(s&&n){const a=s.readValue(n,r);a!=null&&(e[0]=a)}e[0]===void 0&&(e[0]=r),i&&o===void 0&&i.set(e[0])}Co(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),ot.delete(this)}cancel(){this.state==="scheduled"&&(ot.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Io=t=>t.startsWith("--");function Oo(t,e,n){Io(e)?t.style.setProperty(e,n):t.style[e]=n}const jo={};function mi(t,e){const n=Ws(t);return()=>jo[e]??n()}const No=mi(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),pi=mi(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),wt=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,kn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:wt([0,.65,.55,1]),circOut:wt([.55,0,1,.45]),backIn:wt([.31,.01,.66,-.59]),backOut:wt([.33,1.53,.69,.99])};function gi(t,e){if(t)return typeof t=="function"?pi()?ci(t,e):"ease-out":Js(t)?wt(t):Array.isArray(t)?t.map(n=>gi(n,e)||kn.easeOut):kn[t]}function Uo(t,e,n,{delay:s=0,duration:i=300,repeat:o=0,repeatType:r="loop",ease:a="easeOut",times:l}={},u=void 0){const c={[e]:n};l&&(c.offset=l);const h=gi(a,i);Array.isArray(h)&&(c.easing=h);const f={delay:s,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:o+1,direction:r==="reverse"?"alternate":"normal"};return u&&(f.pseudoElement=u),t.animate(c,f)}function yi(t){return typeof t=="function"&&"applyToOptions"in t}function Wo({type:t,...e}){return yi(t)&&pi()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class vi extends en{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:s,keyframes:i,pseudoElement:o,allowFlatten:r=!1,finalKeyframe:a,onComplete:l}=e;this.isPseudoElement=!!o,this.allowFlatten=r,this.options=e,He(typeof e.type!="string");const u=Wo(e);this.animation=Uo(n,s,i,u,o),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const c=tn(i,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(c),Oo(n,s,c),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,n;(n=(e=this.animation).finish)==null||n.call(e)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,s,i;const e=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(e!=null&&e.isConnected)&&((i=(s=this.animation).commitStyles)==null||i.call(s))}get duration(){var n,s;const e=((s=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:s.call(n).duration)||0;return U(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+U(e)}get time(){return U(Number(this.animation.currentTime)||0)}set time(e){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=G(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:n,rangeEnd:s,observe:i}){var o;return this.allowFlatten&&((o=this.animation.effect)==null||o.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&No()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),s&&(this.animation.rangeEnd=s),W):i(this)}}const Ti={anticipate:Xs,backInOut:_s,circInOut:qs};function Ko(t){return t in Ti}function $o(t){typeof t.ease=="string"&&Ko(t.ease)&&(t.ease=Ti[t.ease])}const ae=10;class Go extends vi{constructor(e){$o(e),hi(e),super(e),e.startTime!==void 0&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:s,onComplete:i,element:o,...r}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const a=new nn({...r,autoplay:!1}),l=Math.max(ae,I.now()-this.startTime),u=X(0,ae,l-ae);n.setWithVelocity(a.sample(Math.max(0,l-u)).value,a.sample(l).value,u),a.stop()}}const Fn=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(H.test(t)||t==="0")&&!t.startsWith("url("));function Ho(t){const e=t[0];if(t.length===1)return!0;for(let n=0;nObject.hasOwnProperty.call(Element.prototype,"animate"));function Yo(t){var c;const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:o,type:r}=t;if(!(((c=e==null?void 0:e.owner)==null?void 0:c.current)instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=e.owner.getProps();return Xo()&&n&&_o.has(n)&&(n!=="transform"||!u)&&!l&&!s&&i!=="mirror"&&o!==0&&r!=="inertia"}const qo=40;class Zo extends en{constructor({autoplay:e=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:o=0,repeatType:r="loop",keyframes:a,name:l,motionValue:u,element:c,...h}){var m;super(),this.stop=()=>{var p,y;this._animation&&(this._animation.stop(),(p=this.stopTimeline)==null||p.call(this)),(y=this.keyframeResolver)==null||y.cancel()},this.createdAt=I.now();const f={autoplay:e,delay:n,type:s,repeat:i,repeatDelay:o,repeatType:r,name:l,motionValue:u,element:c,...h},d=(c==null?void 0:c.KeyframeResolver)||sn;this.keyframeResolver=new d(a,(p,y,v)=>this.onKeyframesResolved(p,y,f,!v),l,u,c),(m=this.keyframeResolver)==null||m.scheduleResolve()}onKeyframesResolved(e,n,s,i){var y,v;this.keyframeResolver=void 0;const{name:o,type:r,velocity:a,delay:l,isHandoff:u,onUpdate:c}=s;this.resolvedAt=I.now(),zo(e,o,r,a)||((Y.instantAnimations||!l)&&(c==null||c(tn(e,s,n))),e[0]=e[e.length-1],Re(s),s.repeat=0);const f={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>qo?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:e},d=!u&&Yo(f),m=(v=(y=f.motionValue)==null?void 0:y.owner)==null?void 0:v.current,p=d?new Go({...f,element:m}):new nn(f);p.finished.then(()=>{this.notifyFinished()}).catch(W),this.pendingTimeline&&(this.stopTimeline=p.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=p}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),Bo()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var e;this._animation&&this.animation.cancel(),(e=this.keyframeResolver)==null||e.cancel()}}function xi(t,e,n,s=0,i=1){const o=Array.from(t).sort((u,c)=>u.sortNodePosition(c)).indexOf(e),r=t.size,a=(r-1)*s;return typeof n=="function"?n(o,r):i===1?o*s:a-o*s}const Jo=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Qo(t){const e=Jo.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}function wi(t,e,n=1){const[s,i]=Qo(t);if(!s)return;const o=window.getComputedStyle(e).getPropertyValue(s);if(o){const r=o.trim();return js(r)?parseFloat(r):r}return Ye(i)?wi(i,e,n+1):i}const ta={type:"spring",stiffness:500,damping:25,restSpeed:10},ea=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),na={type:"keyframes",duration:.8},sa={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ia=(t,{keyframes:e})=>e.length>2?na:vt.has(t)?t.startsWith("scale")?ea(e[1]):ta:sa,ra=t=>t!==null;function oa(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(ra),o=e&&n!=="loop"&&e%2===1?0:i.length-1;return i[o]}function Si(t,e){if(t!=null&&t.inherit&&e){const{inherit:n,...s}=t;return{...e,...s}}return t}function rn(t,e){const n=(t==null?void 0:t[e])??(t==null?void 0:t.default)??t;return n!==t?Si(n,t):n}function aa({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length}const on=(t,e,n,s={},i,o)=>r=>{const a=rn(s,t)||{},l=a.delay||s.delay||0;let{elapsed:u=0}=s;u=u-G(l);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:f=>{e.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:o?void 0:i};aa(a)||Object.assign(c,ia(t,c)),c.duration&&(c.duration=G(c.duration)),c.repeatDelay&&(c.repeatDelay=G(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let h=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(Re(c),c.delay===0&&(h=!0)),(Y.instantAnimations||Y.skipAnimations||i!=null&&i.shouldSkipAnimations)&&(h=!0,Re(c),c.delay=0),c.allowFlatten=!a.type&&!a.ease,h&&!o&&e.get()!==void 0){const f=oa(c.keyframes,a);if(f!==void 0){V.update(()=>{c.onUpdate(f),c.onComplete()});return}}return a.isSync?new nn(c):new Zo(c)};function Bn(t){const e=[{},{}];return t==null||t.values.forEach((n,s)=>{e[0][s]=n.get(),e[1][s]=n.getVelocity()}),e}function an(t,e,n,s){if(typeof e=="function"){const[i,o]=Bn(s);e=e(n!==void 0?n:t.custom,i,o)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,o]=Bn(s);e=e(n!==void 0?n:t.custom,i,o)}return e}function mt(t,e,n){const s=t.getProps();return an(s,e,n!==void 0?n:s.custom,t)}const Pi=new Set(["width","height","top","left","right","bottom",...yt]),In=30,la=t=>!isNaN(parseFloat(t));class ca{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{var o;const i=I.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&((o=this.events.change)==null||o.notify(this.current),this.dependents))for(const r of this.dependents)r.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=I.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=la(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new ze);const s=this.events[e].add(n);return e==="change"?()=>{s(),V.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-s}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var e;(e=this.events.change)==null||e.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=I.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>In)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,In);return Ks(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var e,n;(e=this.dependents)==null||e.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function pt(t,e){return new ca(t,e)}const Le=t=>Array.isArray(t);function ua(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,pt(n))}function ha(t){return Le(t)?t[t.length-1]||0:t}function fa(t,e){const n=mt(t,e);let{transitionEnd:s={},transition:i={},...o}=n||{};o={...o,...s};for(const r in o){const a=ha(o[r]);ua(t,r,a)}}const F=t=>!!(t&&t.getVelocity);function da(t){return!!(F(t)&&t.add)}function ke(t,e){const n=t.getValue("willChange");if(da(n))return n.add(e);if(!n&&Y.WillChange){const s=new Y.WillChange("auto");t.addValue("willChange",s),s.add(e)}}function ln(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const ma="framerAppearId",bi="data-"+ln(ma);function Ai(t){return t.props[bi]}function pa({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function Vi(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:o,transitionEnd:r,...a}=e;const l=t.getDefaultTransition();o=o?Si(o,l):l;const u=o==null?void 0:o.reduceMotion;s&&(o=s);const c=[],h=i&&t.animationState&&t.animationState.getState()[i];for(const f in a){const d=t.getValue(f,t.latestValues[f]??null),m=a[f];if(m===void 0||h&&pa(h,f))continue;const p={delay:n,...rn(o||{},f)},y=d.get();if(y!==void 0&&!d.isAnimating&&!Array.isArray(m)&&m===y&&!p.velocity)continue;let v=!1;if(window.MotionHandoffAnimation){const S=Ai(t);if(S){const w=window.MotionHandoffAnimation(S,f,V);w!==null&&(p.startTime=w,v=!0)}}ke(t,f);const x=u??t.shouldReduceMotion;d.start(on(f,d,m,x&&Pi.has(f)?{type:!1}:p,t,v));const g=d.animation;g&&c.push(g)}if(r){const f=()=>V.update(()=>{r&&fa(t,r)});c.length?Promise.all(c).then(f):f()}return c}function Fe(t,e,n={}){var l;const s=mt(t,e,n.type==="exit"?(l=t.presenceContext)==null?void 0:l.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const o=s?()=>Promise.all(Vi(t,s,n)):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:c=0,staggerChildren:h,staggerDirection:f}=i;return ga(t,e,u,c,h,f,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[u,c]=a==="beforeChildren"?[o,r]:[r,o];return u().then(()=>c())}else return Promise.all([o(),r(n.delay)])}function ga(t,e,n=0,s=0,i=0,o=1,r){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(Fe(l,e,{...r,delay:n+(typeof s=="function"?0:s)+xi(t.variantChildren,l,s,i,o)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}function ya(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(o=>Fe(t,o,n));s=Promise.all(i)}else if(typeof e=="string")s=Fe(t,e,n);else{const i=typeof e=="function"?mt(t,e,n.custom):e;s=Promise.all(Vi(t,i,n))}return s.then(()=>{t.notify("AnimationComplete",e)})}const va={test:t=>t==="auto",parse:t=>t},Ci=t=>e=>e.test(t),Mi=[gt,T,_,q,zr,Hr,va],On=t=>Mi.find(Ci(t));function Ta(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||Us(t):!0}const xa=new Set(["brightness","contrast","saturate","opacity"]);function wa(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(qe)||[];if(!s)return t;const i=n.replace(s,"");let o=xa.has(e)?1:0;return s!==n&&(o*=100),e+"("+o+i+")"}const Sa=/\b([a-z-]*)\(.*?\)/gu,Be={...H,getAnimatableNone:t=>{const e=t.match(Sa);return e?e.map(wa).join(" "):t}},Ie={...H,getAnimatableNone:t=>{const e=H.parse(t);return H.createTransformer(t)(e.map(s=>typeof s=="number"?0:typeof s=="object"?{...s,alpha:1}:s))}},jn={...gt,transform:Math.round},Pa={rotate:q,rotateX:q,rotateY:q,rotateZ:q,scale:It,scaleX:It,scaleY:It,scaleZ:It,skew:q,skewX:q,skewY:q,distance:T,translateX:T,translateY:T,translateZ:T,x:T,y:T,z:T,perspective:T,transformPerspective:T,opacity:Ct,originX:bn,originY:bn,originZ:T},cn={borderWidth:T,borderTopWidth:T,borderRightWidth:T,borderBottomWidth:T,borderLeftWidth:T,borderRadius:T,borderTopLeftRadius:T,borderTopRightRadius:T,borderBottomRightRadius:T,borderBottomLeftRadius:T,width:T,maxWidth:T,height:T,maxHeight:T,top:T,right:T,bottom:T,left:T,inset:T,insetBlock:T,insetBlockStart:T,insetBlockEnd:T,insetInline:T,insetInlineStart:T,insetInlineEnd:T,padding:T,paddingTop:T,paddingRight:T,paddingBottom:T,paddingLeft:T,paddingBlock:T,paddingBlockStart:T,paddingBlockEnd:T,paddingInline:T,paddingInlineStart:T,paddingInlineEnd:T,margin:T,marginTop:T,marginRight:T,marginBottom:T,marginLeft:T,marginBlock:T,marginBlockStart:T,marginBlockEnd:T,marginInline:T,marginInlineStart:T,marginInlineEnd:T,fontSize:T,backgroundPositionX:T,backgroundPositionY:T,...Pa,zIndex:jn,fillOpacity:Ct,strokeOpacity:Ct,numOctaves:jn},ba={...cn,color:E,backgroundColor:E,outlineColor:E,fill:E,stroke:E,borderColor:E,borderTopColor:E,borderRightColor:E,borderBottomColor:E,borderLeftColor:E,filter:Be,WebkitFilter:Be,mask:Ie,WebkitMask:Ie},Di=t=>ba[t],Aa=new Set([Be,Ie]);function Ei(t,e){let n=Di(t);return Aa.has(n)||(n=H),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Va=new Set(["auto","none","0"]);function Ca(t,e,n){let s=0,i;for(;s{e.getValue(l).set(u)}),this.resolveNoneKeyframes()}}const Da=new Set(["opacity","clipPath","filter","transform"]);function Ri(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let s=document;e&&(s=e.current);const i=(n==null?void 0:n[t])??s.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t).filter(s=>s!=null)}const Li=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function Ea(t){return Ns(t)&&"offsetHeight"in t}const{schedule:un}=Qs(queueMicrotask,!1),$={x:!1,y:!1};function ki(){return $.x||$.y}function Ra(t){return t==="x"||t==="y"?$[t]?null:($[t]=!0,()=>{$[t]=!1}):$.x||$.y?null:($.x=$.y=!0,()=>{$.x=$.y=!1})}function Fi(t,e){const n=Ri(t),s=new AbortController,i={passive:!0,...e,signal:s.signal};return[n,i,()=>s.abort()]}function La(t){return!(t.pointerType==="touch"||ki())}function ka(t,e,n={}){const[s,i,o]=Fi(t,n);return s.forEach(r=>{let a=!1,l=!1,u;const c=()=>{r.removeEventListener("pointerleave",m)},h=y=>{u&&(u(y),u=void 0),c()},f=y=>{a=!1,window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f),l&&(l=!1,h(y))},d=()=>{a=!0,window.addEventListener("pointerup",f,i),window.addEventListener("pointercancel",f,i)},m=y=>{if(y.pointerType!=="touch"){if(a){l=!0;return}h(y)}},p=y=>{if(!La(y))return;l=!1;const v=e(r,y);typeof v=="function"&&(u=v,r.addEventListener("pointerleave",m,i))};r.addEventListener("pointerenter",p,i),r.addEventListener("pointerdown",d,i)}),o}const Bi=(t,e)=>e?t===e?!0:Bi(t,e.parentElement):!1,hn=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,Fa=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Ba(t){return Fa.has(t.tagName)||t.isContentEditable===!0}const Ia=new Set(["INPUT","SELECT","TEXTAREA"]);function Oa(t){return Ia.has(t.tagName)||t.isContentEditable===!0}const Nt=new WeakSet;function Nn(t){return e=>{e.key==="Enter"&&t(e)}}function le(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const ja=(t,e)=>{const n=t.currentTarget;if(!n)return;const s=Nn(()=>{if(Nt.has(n))return;le(n,"down");const i=Nn(()=>{le(n,"up")}),o=()=>le(n,"cancel");n.addEventListener("keyup",i,e),n.addEventListener("blur",o,e)});n.addEventListener("keydown",s,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),e)};function Un(t){return hn(t)&&!ki()}const Wn=new WeakSet;function Na(t,e,n={}){const[s,i,o]=Fi(t,n),r=a=>{const l=a.currentTarget;if(!Un(a)||Wn.has(a))return;Nt.add(l),n.stopPropagation&&Wn.add(a);const u=e(l,a),c=(d,m)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",f),Nt.has(l)&&Nt.delete(l),Un(d)&&typeof u=="function"&&u(d,{success:m})},h=d=>{c(d,l===window||l===document||n.useGlobalTarget||Bi(l,d.target))},f=d=>{c(d,!1)};window.addEventListener("pointerup",h,i),window.addEventListener("pointercancel",f,i)};return s.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",r,i),Ea(a)&&(a.addEventListener("focus",u=>ja(u,i)),!Ba(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),o}function fn(t){return Ns(t)&&"ownerSVGElement"in t}const Ut=new WeakMap;let Z;const Ii=(t,e,n)=>(s,i)=>i&&i[0]?i[0][t+"Size"]:fn(s)&&"getBBox"in s?s.getBBox()[e]:s[n],Ua=Ii("inline","width","offsetWidth"),Wa=Ii("block","height","offsetHeight");function Ka({target:t,borderBoxSize:e}){var n;(n=Ut.get(t))==null||n.forEach(s=>{s(t,{get width(){return Ua(t,e)},get height(){return Wa(t,e)}})})}function $a(t){t.forEach(Ka)}function Ga(){typeof ResizeObserver>"u"||(Z=new ResizeObserver($a))}function Ha(t,e){Z||Ga();const n=Ri(t);return n.forEach(s=>{let i=Ut.get(s);i||(i=new Set,Ut.set(s,i)),i.add(e),Z==null||Z.observe(s)}),()=>{n.forEach(s=>{const i=Ut.get(s);i==null||i.delete(e),i!=null&&i.size||Z==null||Z.unobserve(s)})}}const Wt=new Set;let ut;function za(){ut=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Wt.forEach(e=>e(t))},window.addEventListener("resize",ut)}function _a(t){return Wt.add(t),ut||za(),()=>{Wt.delete(t),!Wt.size&&typeof ut=="function"&&(window.removeEventListener("resize",ut),ut=void 0)}}function Kn(t,e){return typeof t=="function"?_a(t):Ha(t,e)}function Xa(t){return fn(t)&&t.tagName==="svg"}const Ya=[...Mi,E,H],qa=t=>Ya.find(Ci(t)),$n=()=>({translate:0,scale:1,origin:0,originPoint:0}),ht=()=>({x:$n(),y:$n()}),Gn=()=>({min:0,max:0}),R=()=>({x:Gn(),y:Gn()}),Za=new WeakMap;function Jt(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Dt(t){return typeof t=="string"||Array.isArray(t)}const dn=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],mn=["initial",...dn];function Qt(t){return Jt(t.animate)||mn.some(e=>Dt(t[e]))}function Oi(t){return!!(Qt(t)||t.variants)}function Ja(t,e,n){for(const s in e){const i=e[s],o=n[s];if(F(i))t.addValue(s,i);else if(F(o))t.addValue(s,pt(i,{owner:t}));else if(o!==i)if(t.hasValue(s)){const r=t.getValue(s);r.liveStyle===!0?r.jump(i):r.hasAnimated||r.set(i)}else{const r=t.getStaticValue(s);t.addValue(s,pt(r!==void 0?r:i,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const Oe={current:null},ji={current:!1},Qa=typeof window<"u";function tl(){if(ji.current=!0,!!Qa)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Oe.current=t.matches;t.addEventListener("change",e),e()}else Oe.current=!1}const Hn=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Xt={};function Ni(t){Xt=t}function el(){return Xt}class nl{scrapeMotionValuesFromProps(e,n,s){return{}}constructor({parent:e,props:n,presenceContext:s,reducedMotionConfig:i,skipAnimations:o,blockInitialAnimation:r,visualState:a},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=sn,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const d=I.now();this.renderScheduledAtthis.bindToMotionValue(o,i)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(ji.current||tl(),this.shouldReduceMotion=Oe.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(s=this.parent)==null||s.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var e;this.projection&&this.projection.unmount(),Q(this.notifyUpdate),Q(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(e=this.parent)==null||e.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const s=this.features[n];s&&(s.unmount(),s.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),n.accelerate&&Da.has(e)&&this.current instanceof HTMLElement){const{factory:r,keyframes:a,times:l,ease:u,duration:c}=n.accelerate,h=new vi({element:this.current,name:e,keyframes:a,times:l,ease:u,duration:G(c)}),f=r(h);this.valueSubscriptions.set(e,()=>{f(),h.cancel()});return}const s=vt.has(e);s&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",r=>{this.latestValues[e]=r,this.props.onUpdate&&V.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;typeof window<"u"&&window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),o&&o(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in Xt){const n=Xt[e];if(!n)continue;const{isEnabled:s,Feature:i}=n;if(!this.features[e]&&i&&s(this.props)&&(this.features[e]=new i(this)),this.features[e]){const o=this.features[e];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):R()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;sn.variantChildren.delete(e)}addValue(e,n){const s=this.values.get(e);n!==s&&(s&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let s=this.values.get(e);return s===void 0&&n!==void 0&&(s=pt(n===null?void 0:n,{owner:this}),this.addValue(e,s)),s}readValue(e,n){let s=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return s!=null&&(typeof s=="string"&&(js(s)||Us(s))?s=parseFloat(s):!qa(s)&&H.test(n)&&(s=Ei(e,n)),this.setBaseTarget(e,F(s)?s.get():s)),F(s)?s.get():s}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var o;const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const r=an(this.props,n,(o=this.presenceContext)==null?void 0:o.custom);r&&(s=r[e])}if(n&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!F(i)?i:this.initialValues[e]!==void 0&&s===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new ze),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){un.render(this.render)}}class Ui extends nl{constructor(){super(...arguments),this.KeyframeResolver=Ma}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){const s=e.style;return s?s[n]:void 0}removeValueFromRenderState(e,{vars:n,style:s}){delete n[e],delete s[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;F(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class tt{constructor(e){this.isMounted=!1,this.node=e}update(){}}function Wi({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function sl({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function il(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function ce(t){return t===void 0||t===1}function je({scale:t,scaleX:e,scaleY:n}){return!ce(t)||!ce(e)||!ce(n)}function st(t){return je(t)||Ki(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Ki(t){return zn(t.x)||zn(t.y)}function zn(t){return t&&t!=="0%"}function Yt(t,e,n){const s=t-n,i=e*s;return n+i}function _n(t,e,n,s,i){return i!==void 0&&(t=Yt(t,i,s)),Yt(t,n,s)+e}function Ne(t,e=0,n=1,s,i){t.min=_n(t.min,e,n,s,i),t.max=_n(t.max,e,n,s,i)}function $i(t,{x:e,y:n}){Ne(t.x,e.translate,e.scale,e.originPoint),Ne(t.y,n.translate,n.scale,n.originPoint)}const Xn=.999999999999,Yn=1.0000000000001;function rl(t,e,n,s=!1){const i=n.length;if(!i)return;e.x=e.y=1;let o,r;for(let a=0;aXn&&(e.x=1),e.yXn&&(e.y=1)}function ft(t,e){t.min=t.min+e,t.max=t.max+e}function qn(t,e,n,s,i=.5){const o=C(t.min,t.max,i);Ne(t,e,n,o,s)}function Zn(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function dt(t,e){qn(t.x,Zn(e.x,t.x),e.scaleX,e.scale,e.originX),qn(t.y,Zn(e.y,t.y),e.scaleY,e.scale,e.originY)}function Gi(t,e){return Wi(il(t.getBoundingClientRect(),e))}function ol(t,e,n){const s=Gi(t,n),{scroll:i}=e;return i&&(ft(s.x,i.offset.x),ft(s.y,i.offset.y)),s}const al={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ll=yt.length;function cl(t,e,n){let s="",i=!0;for(let o=0;o{if(!e.target)return t;if(typeof t=="string")if(T.test(t))t=parseFloat(t);else return t;const n=Jn(t,e.target.x),s=Jn(t,e.target.y);return`${n}% ${s}%`}},ul={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=H.parse(t);if(i.length>5)return s;const o=H.createTransformer(t),r=typeof i[0]!="number"?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;i[0+r]/=a,i[1+r]/=l;const u=C(a,l,.5);return typeof i[2+r]=="number"&&(i[2+r]/=u),typeof i[3+r]=="number"&&(i[3+r]/=u),o(i)}},Ue={borderRadius:{...xt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:xt,borderTopRightRadius:xt,borderBottomLeftRadius:xt,borderBottomRightRadius:xt,boxShadow:ul};function zi(t,{layout:e,layoutId:n}){return vt.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!Ue[t]||t==="opacity")}function gn(t,e,n){var r;const s=t.style,i=e==null?void 0:e.style,o={};if(!s)return o;for(const a in s)(F(s[a])||i&&F(i[a])||zi(a,t)||((r=n==null?void 0:n.getValue(a))==null?void 0:r.liveStyle)!==void 0)&&(o[a]=s[a]);return o}function hl(t){return window.getComputedStyle(t)}class fl extends Ui{constructor(){super(...arguments),this.type="html",this.renderInstance=Hi}readValueFromInstance(e,n){var s;if(vt.has(n))return(s=this.projection)!=null&&s.isProjecting?Ve(n):Eo(e,n);{const i=hl(e),o=(ei(n)?i.getPropertyValue(n):i[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(e,{transformPagePoint:n}){return Gi(e,n)}build(e,n,s){pn(e,n,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return gn(e,n,s)}}const dl={offset:"stroke-dashoffset",array:"stroke-dasharray"},ml={offset:"strokeDashoffset",array:"strokeDasharray"};function pl(t,e,n=1,s=0,i=!0){t.pathLength=1;const o=i?dl:ml;t[o.offset]=`${-s}`,t[o.array]=`${e} ${n}`}const gl=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function _i(t,{attrX:e,attrY:n,attrScale:s,pathLength:i,pathSpacing:o=1,pathOffset:r=0,...a},l,u,c){if(pn(t,a,u),l){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:h,style:f}=t;h.transform&&(f.transform=h.transform,delete h.transform),(f.transform||h.transformOrigin)&&(f.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),f.transform&&(f.transformBox=(c==null?void 0:c.transformBox)??"fill-box",delete h.transformBox);for(const d of gl)h[d]!==void 0&&(f[d]=h[d],delete h[d]);e!==void 0&&(h.x=e),n!==void 0&&(h.y=n),s!==void 0&&(h.scale=s),i!==void 0&&pl(h,i,o,r,!1)}const Xi=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),Yi=t=>typeof t=="string"&&t.toLowerCase()==="svg";function yl(t,e,n,s){Hi(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(Xi.has(i)?i:ln(i),e.attrs[i])}function qi(t,e,n){const s=gn(t,e,n);for(const i in t)if(F(t[i])||F(e[i])){const o=yt.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[o]=t[i]}return s}class vl extends Ui{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=R}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(vt.has(n)){const s=Di(n);return s&&s.default||0}return n=Xi.has(n)?n:ln(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,s){return qi(e,n,s)}build(e,n,s){_i(e,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(e,n,s,i){yl(e,n,s,i)}mount(e){this.isSVGTag=Yi(e.tagName),super.mount(e)}}const Tl=mn.length;function Zi(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?Zi(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;nPromise.all(e.map(({animation:n,options:s})=>ya(t,n,s)))}function Pl(t){let e=Sl(t),n=Qn(),s=!0,i=!1;const o=u=>(c,h)=>{var d;const f=mt(t,h,u==="exit"?(d=t.presenceContext)==null?void 0:d.custom:void 0);if(f){const{transition:m,transitionEnd:p,...y}=f;c={...c,...y,...p}}return c};function r(u){e=u(t)}function a(u){const{props:c}=t,h=Zi(t.parent)||{},f=[],d=new Set;let m={},p=1/0;for(let v=0;vp&&w,j=!1;const ee=Array.isArray(S)?S:[S];let Tt=ee.reduce(o(x),{});A===!1&&(Tt={});const{prevResolvedValues:Tn={}}=g,Sr={...Tn,...Tt},xn=L=>{B=!0,d.has(L)&&(j=!0,d.delete(L)),g.needsAnimating[L]=!0;const N=t.getValue(L);N&&(N.liveStyle=!1)};for(const L in Sr){const N=Tt[L],et=Tn[L];if(m.hasOwnProperty(L))continue;let at=!1;Le(N)&&Le(et)?at=!Ji(N,et):at=N!==et,at?N!=null?xn(L):d.add(L):N!==void 0&&d.has(L)?xn(L):g.protectedKeys[L]=!0}g.prevProp=S,g.prevResolvedValues=Tt,g.isActive&&(m={...m,...Tt}),(s||i)&&t.blockInitialAnimation&&(B=!1);const wn=D&&b;B&&(!wn||j)&&f.push(...ee.map(L=>{const N={type:x};if(typeof L=="string"&&(s||i)&&!wn&&t.manuallyAnimateOnMount&&t.parent){const{parent:et}=t,at=mt(et,L);if(et.enteringChildren&&at){const{delayChildren:Pr}=at.transition||{};N.delay=xi(et.enteringChildren,t,Pr)}}return{animation:L,options:N}}))}if(d.size){const v={};if(typeof c.initial!="boolean"){const x=mt(t,Array.isArray(c.initial)?c.initial[0]:c.initial);x&&x.transition&&(v.transition=x.transition)}d.forEach(x=>{const g=t.getBaseTarget(x),S=t.getValue(x);S&&(S.liveStyle=!0),v[x]=g??null}),f.push({animation:v})}let y=!!f.length;return s&&(c.initial===!1||c.initial===c.animate)&&!t.manuallyAnimateOnMount&&(y=!1),s=!1,i=!1,y?e(f):Promise.resolve()}function l(u,c){var f;if(n[u].isActive===c)return Promise.resolve();(f=t.variantChildren)==null||f.forEach(d=>{var m;return(m=d.animationState)==null?void 0:m.setActive(u,c)}),n[u].isActive=c;const h=a(u);for(const d in n)n[d].protectedKeys={};return h}return{animateChanges:a,setActive:l,setAnimateFunction:r,getState:()=>n,reset:()=>{n=Qn(),i=!0}}}function bl(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!Ji(e,t):!1}function nt(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Qn(){return{animate:nt(!0),whileInView:nt(),whileHover:nt(),whileTap:nt(),whileDrag:nt(),whileFocus:nt(),exit:nt()}}function ts(t,e){t.min=e.min,t.max=e.max}function K(t,e){ts(t.x,e.x),ts(t.y,e.y)}function es(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const Qi=1e-4,Al=1-Qi,Vl=1+Qi,tr=.01,Cl=0-tr,Ml=0+tr;function O(t){return t.max-t.min}function Dl(t,e,n){return Math.abs(t-e)<=n}function ns(t,e,n,s=.5){t.origin=s,t.originPoint=C(e.min,e.max,t.origin),t.scale=O(n)/O(e),t.translate=C(n.min,n.max,t.origin)-t.originPoint,(t.scale>=Al&&t.scale<=Vl||isNaN(t.scale))&&(t.scale=1),(t.translate>=Cl&&t.translate<=Ml||isNaN(t.translate))&&(t.translate=0)}function bt(t,e,n,s){ns(t.x,e.x,n.x,s?s.originX:void 0),ns(t.y,e.y,n.y,s?s.originY:void 0)}function ss(t,e,n){t.min=n.min+e.min,t.max=t.min+O(e)}function El(t,e,n){ss(t.x,e.x,n.x),ss(t.y,e.y,n.y)}function is(t,e,n){t.min=e.min-n.min,t.max=t.min+O(e)}function qt(t,e,n){is(t.x,e.x,n.x),is(t.y,e.y,n.y)}function rs(t,e,n,s,i){return t-=e,t=Yt(t,1/n,s),i!==void 0&&(t=Yt(t,1/i,s)),t}function Rl(t,e=0,n=1,s=.5,i,o=t,r=t){if(_.test(e)&&(e=parseFloat(e),e=C(r.min,r.max,e/100)-r.min),typeof e!="number")return;let a=C(o.min,o.max,s);t===o&&(a-=e),t.min=rs(t.min,e,n,a,i),t.max=rs(t.max,e,n,a,i)}function os(t,e,[n,s,i],o,r){Rl(t,e[n],e[s],e[i],e.scale,o,r)}const Ll=["x","scaleX","originX"],kl=["y","scaleY","originY"];function as(t,e,n,s){os(t.x,e,Ll,n?n.x:void 0,s?s.x:void 0),os(t.y,e,kl,n?n.y:void 0,s?s.y:void 0)}function ls(t){return t.translate===0&&t.scale===1}function er(t){return ls(t.x)&&ls(t.y)}function cs(t,e){return t.min===e.min&&t.max===e.max}function Fl(t,e){return cs(t.x,e.x)&&cs(t.y,e.y)}function us(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function nr(t,e){return us(t.x,e.x)&&us(t.y,e.y)}function hs(t){return O(t.x)/O(t.y)}function fs(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function z(t){return[t("x"),t("y")]}function Bl(t,e,n){let s="";const i=t.x.translate/e.x,o=t.y.translate/e.y,r=(n==null?void 0:n.z)||0;if((i||o||r)&&(s=`translate3d(${i}px, ${o}px, ${r}px) `),(e.x!==1||e.y!==1)&&(s+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:u,rotate:c,rotateX:h,rotateY:f,skewX:d,skewY:m}=n;u&&(s=`perspective(${u}px) ${s}`),c&&(s+=`rotate(${c}deg) `),h&&(s+=`rotateX(${h}deg) `),f&&(s+=`rotateY(${f}deg) `),d&&(s+=`skewX(${d}deg) `),m&&(s+=`skewY(${m}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return(a!==1||l!==1)&&(s+=`scale(${a}, ${l})`),s||"none"}const sr=["TopLeft","TopRight","BottomLeft","BottomRight"],Il=sr.length,ds=t=>typeof t=="string"?parseFloat(t):t,ms=t=>typeof t=="number"||T.test(t);function Ol(t,e,n,s,i,o){i?(t.opacity=C(0,n.opacity??1,jl(s)),t.opacityExit=C(e.opacity??1,0,Nl(s))):o&&(t.opacity=C(e.opacity??1,n.opacity??1,s));for(let r=0;rse?1:n(Vt(t,e,s))}function Ul(t,e,n){const s=F(t)?t:pt(t);return s.start(on("",s,e,n)),s.animation}function Et(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}const Wl=(t,e)=>t.depth-e.depth;class Kl{constructor(){this.children=[],this.isDirty=!1}add(e){Ge(this.children,e),this.isDirty=!0}remove(e){Gt(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Wl),this.isDirty=!1,this.children.forEach(e)}}function $l(t,e){const n=I.now(),s=({timestamp:i})=>{const o=i-n;o>=e&&(Q(s),t(o-e))};return V.setup(s,!0),()=>Q(s)}function Kt(t){return F(t)?t.get():t}class Gl{constructor(){this.members=[]}add(e){Ge(this.members,e);for(let n=this.members.length-1;n>=0;n--){const s=this.members[n];if(s===e||s===this.lead||s===this.prevLead)continue;const i=s.instance;(!i||i.isConnected===!1)&&!s.snapshot&&(Gt(this.members,s),s.unmount())}e.scheduleRender()}remove(e){if(Gt(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){var n;for(let s=this.members.indexOf(e)-1;s>=0;s--){const i=this.members[s];if(i.isPresent!==!1&&((n=i.instance)==null?void 0:n.isConnected)!==!1)return this.promote(i),!0}return!1}promote(e,n){var i;const s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.updateSnapshot(),e.scheduleRender();const{layoutDependency:o}=s.options,{layoutDependency:r}=e.options;(o===void 0||o!==r)&&(e.resumeFrom=s,n&&(s.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),(i=e.root)!=null&&i.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{var n,s,i,o,r;(s=(n=e.options).onExitComplete)==null||s.call(n),(r=(i=e.resumingFrom)==null?void 0:(o=i.options).onExitComplete)==null||r.call(o)})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){var e;(e=this.lead)!=null&&e.snapshot&&(this.lead.snapshot=void 0)}}const $t={hasAnimatedSinceResize:!0,hasEverUpdated:!1},ue=["","X","Y","Z"],Hl=1e3;let zl=0;function he(t,e,n,s){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),s&&(s[t]=0))}function rr(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Ai(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:o}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",V,!(i||o))}const{parent:s}=t;s&&!s.hasCheckedOptimisedAppear&&rr(s)}function or({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(r={},a=e==null?void 0:e()){this.id=zl++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Yl),this.nodes.forEach(Ql),this.nodes.forEach(tc),this.nodes.forEach(ql)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=r,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;lthis.root.updateBlockedByResize=!1;V.read(()=>{h=window.innerWidth}),t(r,()=>{const d=window.innerWidth;d!==h&&(h=d,this.root.updateBlockedByResize=!0,c&&c(),c=$l(f,250),$t.hasAnimatedSinceResize&&($t.hasAnimatedSinceResize=!1,this.nodes.forEach(vs)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&u&&(a||l)&&this.addEventListener("didUpdate",({delta:c,hasLayoutChanged:h,hasRelativeLayoutChanged:f,layout:d})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||u.getDefaultTransition()||rc,{onLayoutAnimationStart:p,onLayoutAnimationComplete:y}=u.getProps(),v=!this.targetLayout||!nr(this.targetLayout,d),x=!h&&f;if(this.options.layoutRoot||this.resumeFrom||x||h&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const g={...rn(m,"layout"),onPlay:p,onComplete:y};(u.shouldReduceMotion||this.options.layoutRoot)&&(g.delay=0,g.type=!1),this.startAnimation(g),this.setAnimationOrigin(c,x)}else h||vs(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=d})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const r=this.getStack();r&&r.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Q(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(ec),this.animationId++)}getTransformTemplate(){const{visualElement:r}=this.options;return r&&r.getProps().transformTemplate}willUpdate(r=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&rr(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!O(this.snapshot.measuredBox.x)&&!O(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{const w=S/1e3;Ts(h.x,r.x,w),Ts(h.y,r.y,w),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(qt(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),sc(this.relativeTarget,this.relativeTargetOrigin,f,w),g&&Fl(this.relativeTarget,g)&&(this.isProjectionDirty=!1),g||(g=R()),K(g,this.relativeTarget)),p&&(this.animationValues=c,Ol(c,u,this.latestValues,w,x,v)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=w},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(r){var a,l,u;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(u=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||u.stop(),this.pendingAnimation&&(Q(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=V.update(()=>{$t.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=pt(0)),this.motionValue.jump(0,!1),this.currentAnimation=Ul(this.motionValue,[0,1e3],{...r,velocity:0,isSync:!0,onUpdate:c=>{this.mixTargetDelta(c),r.onUpdate&&r.onUpdate(c)},onStop:()=>{},onComplete:()=>{r.onComplete&&r.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const r=this.getStack();r&&r.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Hl),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const r=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:c}=r;if(!(!a||!l||!u)){if(this!==r&&this.layout&&u&&ar(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||R();const h=O(this.layout.layoutBox.x);l.x.min=r.target.x.min,l.x.max=l.x.min+h;const f=O(this.layout.layoutBox.y);l.y.min=r.target.y.min,l.y.max=l.y.min+f}K(a,l),dt(a,c),bt(this.projectionDeltaWithTransform,this.layoutCorrected,a,c)}}registerSharedNode(r,a){this.sharedNodes.has(r)||this.sharedNodes.set(r,new Gl),this.sharedNodes.get(r).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const r=this.getStack();return r?r.lead===this:!0}getLead(){var a;const{layoutId:r}=this.options;return r?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:r}=this.options;return r?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:r}=this.options;if(r)return this.root.sharedNodes.get(r)}promote({needsReset:r,transition:a,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),r&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const r=this.getStack();return r?r.relegate(this):!1}resetSkewAndRotation(){const{visualElement:r}=this.options;if(!r)return;let a=!1;const{latestValues:l}=r;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const u={};l.z&&he("z",r,u,this.animationValues);for(let c=0;c{var a;return(a=r.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(gs),this.root.sharedNodes.clear()}}}function _l(t){t.updateLayout()}function Xl(t){var n;const e=((n=t.resumeFrom)==null?void 0:n.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:i}=t.layout,{animationType:o}=t.options,r=e.source!==t.layout.source;o==="size"?z(h=>{const f=r?e.measuredBox[h]:e.layoutBox[h],d=O(f);f.min=s[h].min,f.max=f.min+d}):ar(o,e.layoutBox,s)&&z(h=>{const f=r?e.measuredBox[h]:e.layoutBox[h],d=O(s[h]);f.max=f.min+d,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[h].max=t.relativeTarget[h].min+d)});const a=ht();bt(a,s,e.layoutBox);const l=ht();r?bt(l,t.applyTransform(i,!0),e.measuredBox):bt(l,s,e.layoutBox);const u=!er(a);let c=!1;if(!t.resumeFrom){const h=t.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:f,layout:d}=h;if(f&&d){const m=R();qt(m,e.layoutBox,f.layoutBox);const p=R();qt(p,s,d.layoutBox),nr(m,p)||(c=!0),h.options.layoutRoot&&(t.relativeTarget=p,t.relativeTargetOrigin=m,t.relativeParent=h)}}}t.notifyListeners("didUpdate",{layout:s,snapshot:e,delta:l,layoutDelta:a,hasLayoutChanged:u,hasRelativeLayoutChanged:c})}else if(t.isLead()){const{onExitComplete:s}=t.options;s&&s()}t.options.transition=void 0}function Yl(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function ql(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Zl(t){t.clearSnapshot()}function gs(t){t.clearMeasurements()}function ys(t){t.isLayoutDirty=!1}function Jl(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function vs(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Ql(t){t.resolveTargetDelta()}function tc(t){t.calcProjection()}function ec(t){t.resetSkewAndRotation()}function nc(t){t.removeLeadSnapshot()}function Ts(t,e,n){t.translate=C(e.translate,0,n),t.scale=C(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function xs(t,e,n,s){t.min=C(e.min,n.min,s),t.max=C(e.max,n.max,s)}function sc(t,e,n,s){xs(t.x,e.x,n.x,s),xs(t.y,e.y,n.y,s)}function ic(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const rc={duration:.45,ease:[.4,0,.1,1]},ws=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Ss=ws("applewebkit/")&&!ws("chrome/")?Math.round:W;function Ps(t){t.min=Ss(t.min),t.max=Ss(t.max)}function oc(t){Ps(t.x),Ps(t.y)}function ar(t,e,n){return t==="position"||t==="preserve-aspect"&&!Dl(hs(e),hs(n),.2)}function ac(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const lc=or({attachResizeListener:(t,e)=>Et(t,"resize",e),measureScroll:()=>{var t,e;return{x:document.documentElement.scrollLeft||((t=document.body)==null?void 0:t.scrollLeft)||0,y:document.documentElement.scrollTop||((e=document.body)==null?void 0:e.scrollTop)||0}},checkIsScrollRoot:()=>!0}),fe={current:void 0},lr=or({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!fe.current){const t=new lc({});t.mount(window),t.setOptions({layoutScroll:!0}),fe.current=t}return fe.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),cr=P.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function cc(t=!0){const e=P.useContext($e);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:i}=e,o=P.useId();P.useEffect(()=>{if(t)return i(o)},[t]);const r=P.useCallback(()=>t&&s&&s(o),[o,s,t]);return!n&&s?[!1,r]:[!0]}const ur=P.createContext({strict:!1}),bs={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let As=!1;function uc(){if(As)return;const t={};for(const e in bs)t[e]={isEnabled:n=>bs[e].some(s=>!!n[s])};Ni(t),As=!0}function hr(){return uc(),el()}function hc(t){const e=hr();for(const n in t)e[n]={...e[n],...t[n]};Ni(e)}const fc=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Zt(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||fc.has(t)}let fr=t=>!Zt(t);function dc(t){typeof t=="function"&&(fr=e=>e.startsWith("on")?!Zt(e):t(e))}try{dc(require("@emotion/is-prop-valid").default)}catch{}function mc(t,e,n){const s={};for(const i in t)i==="values"&&typeof t.values=="object"||(fr(i)||n===!0&&Zt(i)||!e&&!Zt(i)||t.draggable&&i.startsWith("onDrag"))&&(s[i]=t[i]);return s}const te=P.createContext({});function pc(t,e){if(Qt(t)){const{initial:n,animate:s}=t;return{initial:n===!1||Dt(n)?n:void 0,animate:Dt(s)?s:void 0}}return t.inherit!==!1?e:{}}function gc(t){const{initial:e,animate:n}=pc(t,P.useContext(te));return P.useMemo(()=>({initial:e,animate:n}),[Vs(e),Vs(n)])}function Vs(t){return Array.isArray(t)?t.join(" "):t}const yn=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function dr(t,e,n){for(const s in e)!F(e[s])&&!zi(s,n)&&(t[s]=e[s])}function yc({transformTemplate:t},e){return P.useMemo(()=>{const n=yn();return pn(n,e,t),Object.assign({},n.vars,n.style)},[e])}function vc(t,e){const n=t.style||{},s={};return dr(s,n,t),Object.assign(s,yc(t,e)),s}function Tc(t,e){const n={},s=vc(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=s,n}const mr=()=>({...yn(),attrs:{}});function xc(t,e,n,s){const i=P.useMemo(()=>{const o=mr();return _i(o,e,Yi(s),t.transformTemplate,t.style),{...o.attrs,style:{...o.style}}},[e]);if(t.style){const o={};dr(o,t.style,t),i.style={...o,...i.style}}return i}const wc=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function vn(t){return typeof t!="string"||t.includes("-")?!1:!!(wc.indexOf(t)>-1||/[A-Z]/u.test(t))}function Sc(t,e,n,{latestValues:s},i,o=!1,r){const l=(r??vn(t)?xc:Tc)(e,s,i,t),u=mc(e,typeof t=="string",o),c=t!==P.Fragment?{...u,...l,ref:n}:{},{children:h}=e,f=P.useMemo(()=>F(h)?h.get():h,[h]);return P.createElement(t,{...c,children:f})}function Pc({scrapeMotionValuesFromProps:t,createRenderState:e},n,s,i){return{latestValues:bc(n,s,i,t),renderState:e()}}function bc(t,e,n,s){const i={},o=s(t,{});for(const f in o)i[f]=Kt(o[f]);let{initial:r,animate:a}=t;const l=Qt(t),u=Oi(t);e&&u&&!l&&t.inherit!==!1&&(r===void 0&&(r=e.initial),a===void 0&&(a=e.animate));let c=n?n.initial===!1:!1;c=c||r===!1;const h=c?a:r;if(h&&typeof h!="boolean"&&!Jt(h)){const f=Array.isArray(h)?h:[h];for(let d=0;d(e,n)=>{const s=P.useContext(te),i=P.useContext($e),o=()=>Pc(t,e,s,i);return n?o():br(o)},Ac=pr({scrapeMotionValuesFromProps:gn,createRenderState:yn}),Vc=pr({scrapeMotionValuesFromProps:qi,createRenderState:mr}),Cc=Symbol.for("motionComponentSymbol");function Mc(t,e,n){const s=P.useRef(n);P.useInsertionEffect(()=>{s.current=n});const i=P.useRef(null);return P.useCallback(o=>{var a;o&&((a=t.onMount)==null||a.call(t,o));const r=s.current;if(typeof r=="function")if(o){const l=r(o);typeof l=="function"&&(i.current=l)}else i.current?(i.current(),i.current=null):r(o);else r&&(r.current=o);e&&(o?e.mount(o):e.unmount())},[e])}const gr=P.createContext({});function lt(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Dc(t,e,n,s,i,o){var g,S;const{visualElement:r}=P.useContext(te),a=P.useContext(ur),l=P.useContext($e),u=P.useContext(cr),c=u.reducedMotion,h=u.skipAnimations,f=P.useRef(null),d=P.useRef(!1);s=s||a.renderer,!f.current&&s&&(f.current=s(t,{visualState:e,parent:r,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:c,skipAnimations:h,isSVG:o}),d.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));const m=f.current,p=P.useContext(gr);m&&!m.projection&&i&&(m.type==="html"||m.type==="svg")&&Ec(f.current,n,i,p);const y=P.useRef(!1);P.useInsertionEffect(()=>{m&&y.current&&m.update(n,l)});const v=n[bi],x=P.useRef(!!v&&typeof window<"u"&&!((g=window.MotionHandoffIsComplete)!=null&&g.call(window,v))&&((S=window.MotionHasOptimisedAnimation)==null?void 0:S.call(window,v)));return Vr(()=>{d.current=!0,m&&(y.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),x.current&&m.animationState&&m.animationState.animateChanges())}),P.useEffect(()=>{m&&(!x.current&&m.animationState&&m.animationState.animateChanges(),x.current&&(queueMicrotask(()=>{var w;(w=window.MotionHandoffMarkAsComplete)==null||w.call(window,v)}),x.current=!1),m.enteringChildren=void 0)}),m}function Ec(t,e,n,s){const{layoutId:i,layout:o,drag:r,dragConstraints:a,layoutScroll:l,layoutRoot:u,layoutCrossfade:c}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:yr(t.parent)),t.projection.setOptions({layoutId:i,layout:o,alwaysMeasureLayout:!!r||a&<(a),visualElement:t,animationType:typeof o=="string"?o:"both",initialPromotionConfig:s,crossfade:c,layoutScroll:l,layoutRoot:u})}function yr(t){if(t)return t.options.allowProjection!==!1?t.projection:yr(t.parent)}function de(t,{forwardMotionProps:e=!1,type:n}={},s,i){s&&hc(s);const o=n?n==="svg":vn(t),r=o?Vc:Ac;function a(u,c){let h;const f={...P.useContext(cr),...u,layoutId:Rc(u)},{isStatic:d}=f,m=gc(u),p=r(u,d);if(!d&&typeof window<"u"){Lc();const y=kc(f);h=y.MeasureLayout,m.visualElement=Dc(t,p,f,i,y.ProjectionNode,o)}return Te.jsxs(te.Provider,{value:m,children:[h&&m.visualElement?Te.jsx(h,{visualElement:m.visualElement,...f}):null,Sc(t,u,Mc(p,m.visualElement,c),p,d,e,o)]})}a.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const l=P.forwardRef(a);return l[Cc]=t,l}function Rc({layoutId:t}){const e=P.useContext(Os).id;return e&&t!==void 0?e+"-"+t:t}function Lc(t,e){P.useContext(ur).strict}function kc(t){const e=hr(),{drag:n,layout:s}=e;if(!n&&!s)return{};const i={...n,...s};return{MeasureLayout:n!=null&&n.isEnabled(t)||s!=null&&s.isEnabled(t)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}function Fc(t,e){if(typeof Proxy>"u")return de;const n=new Map,s=(o,r)=>de(o,r,t,e),i=(o,r)=>s(o,r);return new Proxy(i,{get:(o,r)=>r==="create"?s:(n.has(r)||n.set(r,de(r,void 0,t,e)),n.get(r))})}const Bc=(t,e)=>e.isSVG??vn(t)?new vl(e):new fl(e,{allowProjection:t!==P.Fragment});class Ic extends tt{constructor(e){super(e),e.animationState||(e.animationState=Pl(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Jt(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)==null||e.call(this)}}let Oc=0;class jc extends tt{constructor(){super(...arguments),this.id=Oc++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===s)return;const i=this.node.animationState.setActive("exit",!e);n&&!e&&i.then(()=>{n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const Nc={animation:{Feature:Ic},exit:{Feature:jc}};function Ft(t){return{point:{x:t.pageX,y:t.pageY}}}const Uc=t=>e=>hn(e)&&t(e,Ft(e));function At(t,e,n,s){return Et(t,e,Uc(n),s)}const vr=({current:t})=>t?t.ownerDocument.defaultView:null,Cs=(t,e)=>Math.abs(t-e);function Wc(t,e){const n=Cs(t.x,e.x),s=Cs(t.y,e.y);return Math.sqrt(n**2+s**2)}const Ms=new Set(["auto","scroll"]);class Tr{constructor(e,n,{transformPagePoint:s,contextWindow:i=window,dragSnapToOrigin:o=!1,distanceThreshold:r=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=d=>{this.handleScroll(d.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=pe(this.lastMoveEventInfo,this.history),m=this.startEvent!==null,p=Wc(d.offset,{x:0,y:0})>=this.distanceThreshold;if(!m&&!p)return;const{point:y}=d,{timestamp:v}=k;this.history.push({...y,timestamp:v});const{onStart:x,onMove:g}=this.handlers;m||(x&&x(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),g&&g(this.lastMoveEvent,d)},this.handlePointerMove=(d,m)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=me(m,this.transformPagePoint),V.update(this.updatePoint,!0)},this.handlePointerUp=(d,m)=>{this.end();const{onEnd:p,onSessionEnd:y,resumeAnimation:v}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&v&&v(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=pe(d.type==="pointercancel"?this.lastMoveEventInfo:me(m,this.transformPagePoint),this.history);this.startEvent&&p&&p(d,x),y&&y(d,x)},!hn(e))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=s,this.distanceThreshold=r,this.contextWindow=i||window;const l=Ft(e),u=me(l,this.transformPagePoint),{point:c}=u,{timestamp:h}=k;this.history=[{...c,timestamp:h}];const{onSessionStart:f}=n;f&&f(e,pe(u,this.history)),this.removeListeners=Rt(At(this.contextWindow,"pointermove",this.handlePointerMove),At(this.contextWindow,"pointerup",this.handlePointerUp),At(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(e){let n=e.parentElement;for(;n;){const s=getComputedStyle(n);(Ms.has(s.overflowX)||Ms.has(s.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const n=this.scrollPositions.get(e);if(!n)return;const s=e===window,i=s?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},o={x:i.x-n.x,y:i.y-n.y};o.x===0&&o.y===0||(s?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=o.x,this.lastMoveEventInfo.point.y+=o.y):this.history.length>0&&(this.history[0].x-=o.x,this.history[0].y-=o.y),this.scrollPositions.set(e,i),V.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Q(this.updatePoint)}}function me(t,e){return e?{point:e(t.point)}:t}function Ds(t,e){return{x:t.x-e.x,y:t.y-e.y}}function pe({point:t},e){return{point:t,delta:Ds(t,xr(e)),offset:Ds(t,Kc(e)),velocity:$c(e,.1)}}function Kc(t){return t[0]}function xr(t){return t[t.length-1]}function $c(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const i=xr(t);for(;n>=0&&(s=t[n],!(i.timestamp-s.timestamp>G(e)));)n--;if(!s)return{x:0,y:0};s===t[0]&&t.length>2&&i.timestamp-s.timestamp>G(e)*2&&(s=t[1]);const o=U(i.timestamp-s.timestamp);if(o===0)return{x:0,y:0};const r={x:(i.x-s.x)/o,y:(i.y-s.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function Gc(t,{min:e,max:n},s){return e!==void 0&&tn&&(t=s?C(n,t,s.max):Math.min(t,n)),t}function Es(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function Hc(t,{top:e,left:n,bottom:s,right:i}){return{x:Es(t.x,n,i),y:Es(t.y,e,s)}}function Rs(t,e){let n=e.min-t.min,s=e.max-t.max;return e.max-e.mins?n=Vt(e.min,e.max-s,t.min):s>i&&(n=Vt(t.min,t.max-i,e.min)),X(0,1,n)}function Xc(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const We=.35;function Yc(t=We){return t===!1?t=0:t===!0&&(t=We),{x:Ls(t,"left","right"),y:Ls(t,"top","bottom")}}function Ls(t,e,n){return{min:ks(t,e),max:ks(t,n)}}function ks(t,e){return typeof t=="number"?t:t[e]||0}const qc=new WeakMap;class Zc{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=R(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:s}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const o=h=>{n&&this.snapToCursor(Ft(h).point),this.stopAnimation()},r=(h,f)=>{const{drag:d,dragPropagation:m,onDragStart:p}=this.getProps();if(d&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Ra(d),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),z(v=>{let x=this.getAxisMotionValue(v).get()||0;if(_.test(x)){const{projection:g}=this.visualElement;if(g&&g.layout){const S=g.layout.layoutBox[v];S&&(x=O(S)*(parseFloat(x)/100))}}this.originPoint[v]=x}),p&&V.update(()=>p(h,f),!1,!0),ke(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},a=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f;const{dragPropagation:d,dragDirectionLock:m,onDirectionLock:p,onDrag:y}=this.getProps();if(!d&&!this.openDragLock)return;const{offset:v}=f;if(m&&this.currentDirection===null){this.currentDirection=Qc(v),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",f.point,v),this.updateAxis("y",f.point,v),this.visualElement.render(),y&&V.update(()=>y(h,f),!1,!0)},l=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f,this.stop(h,f),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>{const{dragSnapToOrigin:h}=this.getProps();(h||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:c}=this.getProps();this.panSession=new Tr(e,{onSessionStart:o,onStart:r,onMove:a,onSessionEnd:l,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,distanceThreshold:s,contextWindow:vr(this.visualElement),element:this.visualElement.current})}stop(e,n){const s=e||this.latestPointerEvent,i=n||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!i||!s)return;const{velocity:r}=i;this.startAnimation(r);const{onDragEnd:a}=this.getProps();a&&V.postRender(()=>a(s,i))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,s){const{drag:i}=this.getProps();if(!s||!Ot(e,i,this.currentDirection))return;const o=this.getAxisMotionValue(e);let r=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(r=Gc(r,this.constraints[e],this.elastic[e])),o.set(r)}resolveConstraints(){var o;const{dragConstraints:e,dragElastic:n}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(o=this.visualElement.projection)==null?void 0:o.layout,i=this.constraints;e&<(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&s?this.constraints=Hc(s.layoutBox,e):this.constraints=!1,this.elastic=Yc(n),i!==this.constraints&&!lt(e)&&s&&this.constraints&&!this.hasMutatedConstraints&&z(r=>{this.constraints!==!1&&this.getAxisMotionValue(r)&&(this.constraints[r]=Xc(s.layoutBox[r],this.constraints[r]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!lt(e))return!1;const s=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=ol(s,i.root,this.visualElement.getTransformPagePoint());let r=zc(i.layout.layoutBox,o);if(n){const a=n(sl(r));this.hasMutatedConstraints=!!a,a&&(r=Wi(a))}return r}startAnimation(e){const{drag:n,dragMomentum:s,dragElastic:i,dragTransition:o,dragSnapToOrigin:r,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=z(c=>{if(!Ot(c,n,this.currentDirection))return;let h=l&&l[c]||{};r&&(h={min:0,max:0});const f=i?200:1e6,d=i?40:1e7,m={type:"inertia",velocity:s?e[c]:0,bounceStiffness:f,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...o,...h};return this.startAxisValueAnimation(c,m)});return Promise.all(u).then(a)}startAxisValueAnimation(e,n){const s=this.getAxisMotionValue(e);return ke(this.visualElement,e),s.start(on(e,s,0,n,this.visualElement,!1))}stopAnimation(){z(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,s=this.visualElement.getProps(),i=s[n];return i||this.visualElement.getValue(e,(s.initial?s.initial[e]:void 0)||0)}snapToCursor(e){z(n=>{const{drag:s}=this.getProps();if(!Ot(n,s,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(n);if(i&&i.layout){const{min:r,max:a}=i.layout.layoutBox[n],l=o.get()||0;o.set(e[n]-C(r,a,.5)+l)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!lt(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};z(r=>{const a=this.getAxisMotionValue(r);if(a&&this.constraints!==!1){const l=a.get();i[r]=_c({min:l,max:l},this.constraints[r])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.constraints=!1,this.resolveConstraints(),z(r=>{if(!Ot(r,e,null))return;const a=this.getAxisMotionValue(r),{min:l,max:u}=this.constraints[r];a.set(C(l,u,i[r]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;qc.set(this.visualElement,this);const e=this.visualElement.current,n=At(e,"pointerdown",u=>{const{drag:c,dragListener:h=!0}=this.getProps(),f=u.target,d=f!==e&&Oa(f);c&&h&&!d&&this.start(u)});let s;const i=()=>{const{dragConstraints:u}=this.getProps();lt(u)&&u.current&&(this.constraints=this.resolveRefConstraints(),s||(s=Jc(e,u.current,()=>this.scalePositionWithinConstraints())))},{projection:o}=this.visualElement,r=o.addEventListener("measure",i);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),V.read(i);const a=Et(window,"resize",()=>this.scalePositionWithinConstraints()),l=o.addEventListener("didUpdate",(({delta:u,hasLayoutChanged:c})=>{this.isDragging&&c&&(z(h=>{const f=this.getAxisMotionValue(h);f&&(this.originPoint[h]+=u[h].translate,f.set(f.get()+u[h].translate))}),this.visualElement.render())}));return()=>{a(),n(),r(),l&&l(),s&&s()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:r=We,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:s,dragPropagation:i,dragConstraints:o,dragElastic:r,dragMomentum:a}}}function Fs(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function Jc(t,e,n){const s=Kn(t,Fs(n)),i=Kn(e,Fs(n));return()=>{s(),i()}}function Ot(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function Qc(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class tu extends tt{constructor(e){super(e),this.removeGroupControls=W,this.removeListeners=W,this.controls=new Zc(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||W}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const ge=t=>(e,n)=>{t&&V.update(()=>t(e,n),!1,!0)};class eu extends tt{constructor(){super(...arguments),this.removePointerDownListener=W}onPointerDown(e){this.session=new Tr(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:vr(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:ge(e),onStart:ge(n),onMove:ge(s),onEnd:(o,r)=>{delete this.session,i&&V.postRender(()=>i(o,r))}}}mount(){this.removePointerDownListener=At(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let ye=!1;class nu extends P.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s,layoutId:i}=this.props,{projection:o}=e;o&&(n.group&&n.group.add(o),s&&s.register&&i&&s.register(o),ye&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),$t.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:s,drag:i,isPresent:o}=this.props,{projection:r}=s;return r&&(r.isPresent=o,e.layoutDependency!==n&&r.setOptions({...r.options,layoutDependency:n}),ye=!0,i||e.layoutDependency!==n||n===void 0||e.isPresent!==o?r.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?r.promote():r.relegate()||V.postRender(()=>{const a=r.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),un.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:i}=e;ye=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),s&&s.deregister&&s.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function wr(t){const[e,n]=cc(),s=P.useContext(Os);return Te.jsx(nu,{...t,layoutGroup:s,switchLayoutGroup:P.useContext(gr),isPresent:e,safeToRemove:n})}const su={pan:{Feature:eu},drag:{Feature:tu,ProjectionNode:lr,MeasureLayout:wr}};function Bs(t,e,n){const{props:s}=t;t.animationState&&s.whileHover&&t.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,o=s[i];o&&V.postRender(()=>o(e,Ft(e)))}class iu extends tt{mount(){const{current:e}=this.node;e&&(this.unmount=ka(e,(n,s)=>(Bs(this.node,s,"Start"),i=>Bs(this.node,i,"End"))))}unmount(){}}class ru extends tt{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Rt(Et(this.node.current,"focus",()=>this.onFocus()),Et(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Is(t,e,n){const{props:s}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&s.whileTap&&t.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),o=s[i];o&&V.postRender(()=>o(e,Ft(e)))}class ou extends tt{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:s}=this.node.props;this.unmount=Na(e,(i,o)=>(Is(this.node,o,"Start"),(r,{success:a})=>Is(this.node,r,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(s==null?void 0:s.tap)===!1})}unmount(){}}const Ke=new WeakMap,ve=new WeakMap,au=t=>{const e=Ke.get(t.target);e&&e(t)},lu=t=>{t.forEach(au)};function cu({root:t,...e}){const n=t||document;ve.has(n)||ve.set(n,{});const s=ve.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(lu,{root:t,...e})),s[i]}function uu(t,e,n){const s=cu(e);return Ke.set(t,n),s.observe(t),()=>{Ke.delete(t),s.unobserve(t)}}const hu={some:0,all:1};class fu extends tt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:s,amount:i="some",once:o}=e,r={root:n?n.current:void 0,rootMargin:s,threshold:typeof i=="number"?i:hu[i]},a=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,o&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:c,onViewportLeave:h}=this.node.getProps(),f=u?c:h;f&&f(l)};return uu(this.node.current,r,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(du(e,n))&&this.startObserver()}unmount(){}}function du({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const mu={inView:{Feature:fu},tap:{Feature:ou},focus:{Feature:ru},hover:{Feature:iu}},pu={layout:{ProjectionNode:lr,MeasureLayout:wr}},gu={...Nc,...mu,...su,...pu},wu=Fc(gu,Bc);export{_t as A,fl as H,Os as L,cr as M,$e as P,vl as S,nl as V,cc as a,Vr as b,kr as c,R as d,tl as e,C as f,Gt as g,ji as h,Ea as i,F as j,wo as k,co as l,wu as m,xo as n,yi as o,Oe as p,Vt as q,Ri as r,G as s,fn as t,br as u,Xa as v,Za as w,Ul as x,Vi as y,pt as z};