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