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