framer-motion
Version:
A simple and powerful JavaScript animation library
3 lines • 140 kB
JavaScript
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 c,useEffect as u,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<t?t:n,v={},x=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),w=t=>"object"==typeof t&&null!==t,S=t=>/^0[^.\s]+$/u.test(t);const T=t=>t,b=(...t)=>t.reduce((t,e)=>n=>e(t(n))),P=(t,e,n)=>{const i=e-t;return i?(n-t)/i:1};class A{constructor(){this.subscriptions=[]}add(t){return f(this.subscriptions,t),()=>this.remove(t)}remove(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;s<i;s++){const i=this.subscriptions[s];i&&i(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const E=t=>1e3*t,M=t=>t/1e3,V=(t,e)=>e?t*(1e3/e):0,k=(t,e,n)=>t*(3*(1-t)*((1-t)*e+t*n)+t*t);function D(t,e,n,i){return t===e&&n===i?T:s=>{let o=0,r=1,a=s;for(let e=0;;e++){a>=o&&a<=r||(a=(o+r)/2);const i=k(a,t,n)-s;if(i*i<1e-28||40===e)break;i>0?r=a:o=a,a-=1e-7*i/(k(a+1e-7,t,n)-s-i)}return k(a,e,i)}}const C=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,R=t=>e=>1-t(1-e),L=D(.33,1.53,.69,.99),B=R(L),F=C(B),j=t=>t>=1?1:(t*=2)<1?.5*B(t):.5*(2-Math.pow(2,-10*(t-1))),O=t=>1-Math.sin(Math.acos(t)),I=R(O),U=C(O),N=D(.42,0,1,1),W=D(0,0,.58,1),z=D(.42,0,.58,1),$=t=>Array.isArray(t)&&"number"!=typeof t[0],K=t=>Array.isArray(t)&&"number"==typeof t[0],Y={linear:T,easeIn:N,easeInOut:z,easeOut:W,circIn:O,circInOut:U,circOut:I,backIn:B,backInOut:F,backOut:L,anticipate:j},X=t=>{if(K(t)){const[e,n,i,s]=t;return D(e,n,i,s)}return"string"==typeof t?Y[t]:t},H={delta:0,timestamp:0,isProcessing:!1};let _;function G(){_=void 0}const q={now:()=>(void 0===_&&q.set(H.isProcessing||v.useManualTiming?H.timestamp:performance.now()),_),set:t=>{_=t,queueMicrotask(G)}},Z=t=>Math.round(1e5*t)/1e5,J=t=>e=>"string"==typeof e&&e.startsWith(t),Q=J("--"),tt=J("var(--"),et=t=>!!tt(t)&&nt.test(t.split("/*")[0].trim()),nt=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function it(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const st={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},ot={...st,transform:t=>g(0,1,t)},rt={...st,default:1},at=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const lt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,ht=(t,e)=>n=>Boolean("string"==typeof n&<.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),ct=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[s,o,r,a]=i.match(at);return{[t]:parseFloat(s),[e]:parseFloat(o),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},ut={...st,transform:t=>Math.round((t=>g(0,255,t))(t))},dt={test:ht("rgb","red"),parse:ct("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+ut.transform(t)+", "+ut.transform(e)+", "+ut.transform(n)+", "+Z(ot.transform(i))+")"},pt=(t,e,n)=>{const i=t.substring(1+e*n,1+(e+1)*n);return n>1?i:i+i};const mt={test:ht("#"),parse:function(t){const e=t.length>5?2:1,n=pt(t,3,e);return{red:parseInt(pt(t,0,e),16),green:parseInt(pt(t,1,e),16),blue:parseInt(pt(t,2,e),16),alpha:n?parseInt(n,16)/255:1}},transform:dt.transform},ft=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),yt=ft("deg"),gt=ft("%"),vt=ft("px"),xt=ft("vh"),wt=ft("vw"),St=(()=>({...gt,parse:t=>gt.parse(t)/100,transform:t=>gt.transform(100*t)}))(),Tt={test:ht("hsl","hue"),parse:ct("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+gt.transform(Z(e))+", "+gt.transform(Z(n))+", "+Z(ot.transform(i))+")"},bt={test:t=>dt.test(t)||mt.test(t)||Tt.test(t),parse:t=>dt.test(t)?dt.parse(t):Tt.test(t)?Tt.parse(t):mt.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?dt.transform(t):Tt.transform(t),getAnimatableNone:t=>{const e=bt.parse(t);return e.alpha=0,bt.transform(e)}},Pt=new RegExp(at.source),At=new RegExp(/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu.source,"i");const Et="number",Mt="color",Vt=/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+)(?![a-z]*\()/giu;function kt(t){const e=t.toString();return Pt.test(e)||At.test(e)}function Dt(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let o=0;const r=e.replace(Vt,t=>(bt.test(t)?(i.color.push(o),s.push(Mt),n.push(bt.parse(t))):t.startsWith("var(")?(i.var.push(o),s.push("var"),n.push(t)):(i.number.push(o),s.push(Et),n.push(parseFloat(t))),++o,"${}")).split("${}");return{values:n,split:r,indexes:i,types:s}}function Ct({split:t,types:e}){const n=t.length;return i=>{let s="";for(let o=0;o<n;o++)if(s+=t[o],void 0!==i[o]){const t=e[o];s+=t===Et?Z(i[o]):t===Mt?bt.transform(i[o]):i[o]}return s}}const Rt=(t,e)=>{return"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof(n=t)?0:bt.test(n)?bt.getAnimatableNone(n):n;var n};const Lt={test:function(t){return isNaN(t)&&"string"==typeof t&&(Pt.test(t)||At.test(t))},parse:function(t){return Dt(t).values},createTransformer:function(t){return Ct(Dt(t))},getAnimatableNone:function(t){const e=Dt(t);return Ct(e)(e.values.map((t,n)=>Rt(t,e.split[n])))}};function Bt(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 Ft(t,e){return n=>n>0?e:t}const jt=(t,e,n)=>t+(e-t)*n,Ot=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},It=[mt,dt,Tt];function Ut(t){const e=(n=t,It.find(t=>t.test(n)));var n;if(!e)return!1;let i=e.parse(t);return e===Tt&&(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=Bt(a,i,t+1/3),o=Bt(a,i,t),r=Bt(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 Nt=(t,e)=>{const n=Ut(t),i=Ut(e);if(!n||!i)return Ft(t,e);const s={...n};return t=>(s.red=Ot(n.red,i.red,t),s.green=Ot(n.green,i.green,t),s.blue=Ot(n.blue,i.blue,t),s.alpha=jt(n.alpha,i.alpha,t),dt.transform(s))},Wt=new Set(["none","hidden"]);function zt(t,e){return n=>jt(t,e,n)}function $t(t){return"number"==typeof t?zt:"string"==typeof t?et(t)?Ft:bt.test(t)?Nt:Xt:Array.isArray(t)?Kt:"object"==typeof t?bt.test(t)?Nt:Yt:Ft}function Kt(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>$t(t)(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=s[e](t);return n}}function Yt(t,e){const n={...t,...e},i={};for(const s in n)void 0!==t[s]&&void 0!==e[s]&&(i[s]=$t(t[s])(t[s],e[s]));return t=>{for(const e in i)n[e]=i[e](t);return n}}const Xt=(t,e)=>{const n=Dt(t),i=Dt(e);return n.indexes.var.length===i.indexes.var.length&&n.indexes.color.length===i.indexes.color.length&&n.indexes.number.length>=i.indexes.number.length?Wt.has(t)&&!i.values.length||Wt.has(e)&&!n.values.length?function(t,e){return Wt.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):b(Kt(function(t,e){const n=[],i={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const o=e.types[s],r=t.indexes[o][i[o]],a=t.values[r]??0;n[s]=a,i[o]++}return n}(n,i),i.values),Ct(i)):Ft(t,e)},Ht=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function _t(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return jt(t,e,n);if("string"==typeof t&&"string"==typeof e){const n=function(t,e){const n=Ht.exec(t);if(!n)return;const i=Ht.exec(e);if(!i||n[2]!==i[2])return;const s=n[2],o=parseFloat(n[1]),r=parseFloat(i[1]);return t=>Z(jt(o,r,t))+s}(t,e);if(n)return n}return $t(t)(t,e)}const Gt=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function qt(t,e,n={delta:0,timestamp:0,isProcessing:!1}){let i=!1,s=!0;const o=()=>i=!0,r=Gt.reduce((t,e)=>(t[e]=function(t){let e,n=new Set,i=new Set,s=!1,o=!1;const r=new Set;let a={delta:0,timestamp:0,isProcessing:!1};function l(n){r.has(n)&&(i.add(n),t()),(e=n)(a)}const h={schedule:(t,o=!1,a=!1)=>{const l=a&&s,h=l?n:i;return o&&r.add(t),l&&t!==e&&h.delete(t),h.add(t),t},cancel:t=>{i.delete(t),r.delete(t)},process:t=>{if(a=t,s)return void(o=!0);s=!0;const r=n;n=i,i=r,n.forEach(l),n.clear(),e=void 0,s=!1,o&&(o=!1,h.process(t))}};return h}(o),t),{}),{setup:a,read:l,resolveKeyframes:h,preUpdate:c,update:u,preRender:d,render:p,postRender:m}=r,f=()=>{const o=v.useManualTiming,r=o?n.timestamp:performance.now();i=!1,o||(n.delta=s?1e3/60:Math.max(Math.min(r-n.timestamp,40),1)),n.timestamp=r,n.isProcessing=!0,a.process(n),l.process(n),h.process(n),c.process(n),u.process(n),d.process(n),p.process(n),m.process(n),n.isProcessing=!1,i&&e&&(s=!1,t(f))};return{schedule:Gt.reduce((e,o)=>{const a=r[o];return e[o]=(e,o=!1,r=!1)=>(i||(i=!0,s=!0,n.isProcessing||t(f)),a.schedule(e,o,r)),e},{}),cancel:t=>{for(let e=0;e<Gt.length;e++)r[Gt[e]].cancel(t)},state:n,steps:r}}const{schedule:Zt,cancel:Jt,steps:Qt}=qt("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:T,!0,H),te=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>Zt.update(e,t),stop:()=>Jt(e),now:()=>H.isProcessing?H.timestamp:q.now()}},ee=(t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let e=0;e<s;e++)i+=Math.round(1e4*t(e/(s-1)))/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},ne=2e4;function ie(t,e=50,n=2e4,i){let s=0,o=t.next(s);for(;!o.done&&s<n;)s+=e,o=t.next(s);return s>=n?1/0:s}const se=t=>t<0?1/Math.max(1+t,.05):Math.max(1-t,.05);function oe(t,e){if(!(t>1))return 1;const n=Math.sqrt(t*t-1),i=t-n,s=t+n,o=2*n*Math.exp(-e)*(1+e);return le(t=>s*Math.exp(-i*t)-i*Math.exp(-s*t)-o,t=>Math.exp(-s*t)-Math.exp(-i*t),e)/e}function re(t,e){return t*Math.sqrt(1-e*e)}const ae=12;function le(t,e,n){let i=n;for(let n=1;n<ae;n++)i-=t(i)/e(i);return i}const he=.001;const ce=(t,e)=>(e?t>=0:t>0)&&t<1/0;function ue(t,e){if(ce(t,e))return t}function de(t){const e=ue(t.stiffness),n=ue(t.damping,!0),i=ue(t.mass),s={...t,stiffness:e??100,damping:n??10,mass:i??1,isResolvedFromDuration:!1,isTimeDefined:void 0===(e??n??i)&&(void 0!==t.duration||void 0!==t.bounce)};if(s.isTimeDefined){if(t.visualDuration){const e=se(t.bounce||0),n=2*Math.PI/(1.2*t.visualDuration)*oe(e,2*Math.PI/1.2);s.stiffness=n*n,s.damping=2*e*Math.sqrt(s.stiffness)}else Object.assign(s,function({duration:t=800,bounce:e=.3}){let n,i;const s=se(e);t=g(.01,10,M(t)),s<1?(n=e=>{const n=e*s,i=n*t,o=re(e,s),r=Math.exp(-i);return he-n/o*r},i=e=>{const i=e*s*t,o=s*s*e*e*t,r=Math.exp(-i),a=re(e*e,s);return(-n(e)+he>0?-1:1)*-o*r/a}):(n=e=>Math.exp(-e*t)*(e*t+1)-.001,i=e=>Math.exp(-e*t)*(t*t*-e));const o=le(n,i,5/t),r=o*oe(s,o*t),a=r*r;return{stiffness:a,damping:2*s*Math.sqrt(a),duration:E(t)}}(s)),s.isResolvedFromDuration=!0;ce(s.stiffness)&&ce(s.damping,!0)||(s.stiffness=100,s.damping=10)}return s}function pe(t=.3,e=.3){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t,i=n.keyframes[0],s=n.keyframes[n.keyframes.length-1],o={done:!1,value:i},{stiffness:r,damping:a,mass:l,duration:h,isResolvedFromDuration:c,isTimeDefined:u}=de({...n}),d=t=>c?0:-M(t),p=a/(2*Math.sqrt(r*l)),m=M(Math.sqrt(r/l)),f=p*m,y={target:s,delta:s-i,velocity:d(n.velocity)||0,restSpeed:0,restDelta:0},g=()=>{const t=Math.abs(y.delta)<5;y.restSpeed=n.restSpeed||(t?.01:2),y.restDelta=n.restDelta||(t?.005:.5)};let v,x,w;if(g(),p<1){const t=re(m,p),e={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};w=()=>{e.A=(y.velocity+f*y.delta)/t,e.sinC=f*e.A+y.delta*t,e.cosC=f*y.delta-e.A*t};const n=n=>{n!==e.t&&(e.t=n,e.env=Math.exp(-f*n),e.sin=Math.sin(t*n),e.cos=Math.cos(t*n))};v=t=>(n(t),y.target-e.env*(e.A*e.sin+y.delta*e.cos)),x=t=>(n(t),e.env*(e.sinC*e.sin+e.cosC*e.cos))}else if(1===p){v=t=>y.target-Math.exp(-m*t)*(y.delta+(y.velocity+m*y.delta)*t);const t={C:0};w=()=>{t.C=y.velocity+m*y.delta},x=e=>Math.exp(-m*e)*(m*t.C*e-y.velocity)}else{const t=m*Math.sqrt(p*p-1),e=f-t,n=f+t,i=t<1||u?1/0:300/t,s=(t,e)=>Math.exp(e>i?(f-t)*i-f*e:-t*e),o={S:0,F:0};w=()=>{const e=(y.velocity+f*y.delta)/t;o.S=(y.delta+e)/2,o.F=(y.delta-e)/2},v=t=>y.target-o.S*s(e,t)-o.F*s(n,t),x=t=>e*o.S*s(e,t)+n*o.F*s(n,t)}w();const S=c&&h||null,T={calculatedDuration:S,retarget:(t,e)=>{y.target=t[t.length-1],y.delta=y.target-t[0],y.velocity=d(e),n.restSpeed&&n.restDelta||g(),T.calculatedDuration=S,o.done=!1,w()},velocity:t=>E(x(t)),next:t=>{const e=v(t);if(c)o.done=t>=h;else{const n=E(x(t));o.done=Math.abs(n)<=y.restSpeed&&Math.abs(y.target-e)<=y.restDelta}return o.value=o.done?y.target:e,o},toString:()=>{const t=Math.min(ie(T),ne),e=ee(e=>T.next(t*e).value,t,30);return t+"ms "+e}};return T}const me=Object.assign(pe,{applyToOptions:t=>{const e=function(t,e=100,n){const{keyframes:i,velocity:s}=t,o=i&&i[i.length-1]-i[0],r=n({...t,velocity:s&&o?s*e/o:s,keyframes:[0,e]}),a=Math.min(ie(r),ne);return{type:"keyframes",ease:t=>r.next(a*t).value/e,duration:M(a)}}(t,100,pe);return t.ease=e.ease,t.duration=E(e.duration),t.type="keyframes",t}});function fe({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:c}){const u=t[0],d={done:!1,value:u},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)<Math.abs(l-t)?a:l;let m=n*e;const f=u+m,y=r?r(f):f;y!==f&&(m=y-u);const g=t=>-m*Math.exp(-t/i),v=t=>{const e=g(t);d.done=Math.abs(e)<=h,d.value=d.done?y:t?y+e:u};let x,w;const S=t=>{var e;((e=d.value)<a||e>l)&&(x=t,w=me({keyframes:[d.value,p(d.value)],velocity:-g(t)/i*1e3,damping:s,stiffness:o,restDelta:h,restSpeed:c}))};return S(0),{calculatedDuration:null,next:t=>{let e=!1;return w||void 0!==x||(e=!0,v(t),S(t)),void 0!==x&&t>=x?w.next(t-x):(!e&&v(t),d)}}}function ye(t,e,{clamp:n=!0,ease:i,mixer:s}={}){const o=t.length;if(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=v.mix||_t,o=t.length-1;for(let r=0;r<o;r++){let o=n?.(t[r],t[r+1])||s(t[r],t[r+1]);if(e){const t=Array.isArray(e)?e[r]||T:e;o=b(t,o)}i.push(o)}return i}(e,i,s),l=a.length,h=n=>{if(r&&n<t[0])return e[0];let i=0;if(l>1)for(;i<t.length-2&&!(n<t[i+1]);i++);const s=P(t[i],t[i+1],n);return a[i](s)};return n?e=>h(g(t[0],t[o-1],e)):h}function ge(t){const e=[0];return function(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=P(0,e,i);t.push(jt(n,1,s))}}(e,t.length-1),e}function ve({duration:t=300,keyframes:e,times:n,ease:i="easeInOut",mixer:s}){const o="number"==typeof e[0]?void 0:s,r=$(i)?i.map(X):X(i)||z,a={done:!1,value:e[0]};let l=-1;if(!o)for(let t=1;t<e.length;t++)if(e[t]!==e[t-1]){if(l>=0){l=-2;break}l=t-1}if(l>=0){const i=n&&n.length===e.length?n:ge(e),s=i[l]*t,o=i[l+1]*t,h=e[l],c=e[l+1],u=Array.isArray(r)?r[l]:r,d=(v.mix||_t)(h,c),p=e.length-2;return{calculatedDuration:t,next:e=>(a.value=l&&e<s?d(0):l<p&&(e>=o||!t)?"number"==typeof c?c:d(1):d(u(e>=o||!t?1:e<=s?0:(e-s)/(o-s))),a.done=e>=t,a)}}const h=function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:ge(e),t),c=ye(h,e,{ease:Array.isArray(r)?r:(u=e,d=r,u.map(()=>d||z).splice(0,u.length-1)),mixer:o});var u,d;return{calculatedDuration:t,next:e=>(a.value=c(e),a.done=e>=t,a)}}function xe(t,e,n=0){return e<=0?n:t.velocity?t.velocity(e):function(t,e,n){const i=Math.max(e-5,0);return V(n-t(i),e-i)}(e=>t.next(e).value,e,t.next(e).value)}function we(t,{repeat:e,repeatType:n="loop"},i,s=1){let o,r,a=0;for(let e=0;e<t.length;e++){const n=t[e];null!==n&&(a++||(o=n),r=n)}const l=s<0||e&&"loop"!==n&&e%2==1?0:a-1;return l&&void 0!==i?i:l?r:o}const Se={decay:fe,inertia:fe,tween:ve,keyframes:ve,spring:me};function Te(t){"string"==typeof t.type&&(t.type=Se[t.type])}const be=(t,e)=>e-t>40&&!v.useManualTiming?e:t;function Pe(t,e){return{kind:t,animation:e,timestamp:q.now(),frameTimestamp:H.timestamp,frameIsProcessing:H.isProcessing}}function Ae(t,e,n){const i=globalThis.__MOTION_INSPECT__;if(i)try{i({...Pe("animation-start",t),options:n?{...e,...n}:e})}catch{}}class Ee{constructor(){this.isResolved=!1}get finished(){return this._finished||(this._finished=this.isResolved?Promise.resolve():new Promise(t=>{this._resolve=t})),this._finished}updateFinished(){this._finished=this._resolve=void 0,this.isResolved=!1}notifyFinished(){this.isResolved=!0,this._resolve?.()}then(t,e){return this.finished.then(t,e)}}const Me=t=>t/100,Ve=t=>Math.round(1e4*t)/1e4;class ke extends Ee{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:t}=this.options,e=q.now();t&&t.updatedAt!==e&&this.tick(t.updatedAt=e),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause(),Ae(this,this.options)}initAnimation(){const{options:t}=this;Te(t);const{type:e=ve,repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=t;let{keyframes:r}=t;const a=e||ve;this.mixKeyframes=void 0,a!==ve&&"number"!=typeof r[0]&&(this.mixKeyframes=b(Me,t.mixer?.(r[0],r[1])||_t(r[0],r[1])),r=[0,100]);const l=a(r===t.keyframes?t:{...t,keyframes:r});"mirror"===s&&(this.mirroredGenerator=a({...t,keyframes:[...r].reverse(),velocity:-o})),null===l.calculatedDuration&&(l.calculatedDuration=ie(l));const{calculatedDuration:h}=l;this.calculatedDuration=h,this.resolvedDuration=h+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=l}updateTime(t){this.currentTime=this.holdTime??Math.round(t-this.startTime)*this.playbackSpeed}tick(t,e=!1){const{generator:n,totalDuration:i,calculatedDuration:s}=this;if(null===this.startTime)return n.next(0);const{delay:o=0,keyframes:r,type:a,onUpdate:l,finalKeyframe:h}=this.options;this.startTime===this.pendingStartTime&&(this.startTime=be(this.startTime,t)),this.pendingStartTime=void 0,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 c=this.currentTime-o*(this.playbackSpeed>=0?1:-1),u=this.playbackSpeed>=0?c<0:c>i;this.currentTime=Math.max(c,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);const d=this.generate(this.currentTime,u);let{done:p}=d;u||(p=this.playbackSpeed>=0?s<1/0?this.currentTime>=i:p:this.currentTime<=0);const m=null===this.holdTime&&("finished"===this.state||"running"===this.state&&p);return m&&a!==fe&&(d.value=we(r,this.options,h,this.speed)),l&&l(d.value),m&&this.finish(),d}at(t){return this.holdTime??Ve((t-this.startTime)*this.playbackSpeed)}sampleAt(t,e){const{options:n,totalDuration:i}=this,s=this.at(t)-(n.delay||0);return s>=i&&n.type!==fe?we(n.keyframes,n,e?void 0:n.finalKeyframe):this.generate(Math.max(s,0),s<0).value}generate(t,e){const{generator:n,totalDuration:i,mixKeyframes:s,mirroredGenerator:o,resolvedDuration:r}=this,{keyframes:a,repeat:l,repeatType:h,repeatDelay:c}=this.options;let u,d=t,p=n;if(l){const e=Math.min(t,i)/r;let n=Math.floor(e),s=e%1;!s&&e>=1&&(s=1),1===s&&n--,n=Math.min(n,l+1);Boolean(n%2)&&("reverse"===h?(s=1-s,c&&(s-=c/r)):"mirror"===h&&(p=o)),d=g(0,1,s)*r}return e?(this.delayState.value=a[0],u=this.delayState):u=p.next(d),s&&!e&&(u.value=s(u.value)),u}get duration(){return M(this.calculatedDuration)}get iterationDuration(){return this.duration+M(this.options.delay??0)}get time(){return M(this.currentTime)}set time(t){"finished"===this.state&&this.updateFinished(),t=E(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(){return xe(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;e&&this.driver&&this.updateTime(q.now()),this.playbackSpeed=t,e&&this.driver&&(this.time=M(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=te,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.playbackSpeed||1):this.startTime||(this.startTime=e??(this.pendingStartTime=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(q.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.driver?.stop(),this.driver=void 0,this.startTime=this.holdTime=null}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 De=new Set(["brightness","contrast","saturate","opacity"]);function Ce(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(at)||[];if(!i)return t;const s=n.replace(i,"");let o=De.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+s+")"}const Re=/\b([a-z-]*)\(.*?\)/gu,Le={...Lt,getAnimatableNone:t=>{const e=t.match(Re);return e?e.map(Ce).join(" "):t}},Be={...Lt,getAnimatableNone:t=>{const e=Lt.parse(t);return Lt.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},Fe={...st,transform:Math.round},je={rotate:yt,pathRotation:yt,rotateX:yt,rotateY:yt,rotateZ:yt,scale:rt,scaleX:rt,scaleY:rt,scaleZ:rt,skew:yt,skewX:yt,skewY:yt,distance:vt,translateX:vt,translateY:vt,translateZ:vt,x:vt,y:vt,z:vt,perspective:vt,transformPerspective:vt,opacity:ot,originX:St,originY:St,originZ:vt},Oe={borderWidth:vt,borderTopWidth:vt,borderRightWidth:vt,borderBottomWidth:vt,borderLeftWidth:vt,borderRadius:vt,borderTopLeftRadius:vt,borderTopRightRadius:vt,borderBottomRightRadius:vt,borderBottomLeftRadius:vt,width:vt,maxWidth:vt,height:vt,maxHeight:vt,top:vt,right:vt,bottom:vt,left:vt,inset:vt,insetBlock:vt,insetBlockStart:vt,insetBlockEnd:vt,insetInline:vt,insetInlineStart:vt,insetInlineEnd:vt,padding:vt,paddingTop:vt,paddingRight:vt,paddingBottom:vt,paddingLeft:vt,paddingBlock:vt,paddingBlockStart:vt,paddingBlockEnd:vt,paddingInline:vt,paddingInlineStart:vt,paddingInlineEnd:vt,margin:vt,marginTop:vt,marginRight:vt,marginBottom:vt,marginLeft:vt,marginBlock:vt,marginBlockStart:vt,marginBlockEnd:vt,marginInline:vt,marginInlineStart:vt,marginInlineEnd:vt,fontSize:vt,backgroundPositionX:vt,backgroundPositionY:vt,...je,zIndex:Fe,fillOpacity:ot,strokeOpacity:ot,numOctaves:Fe},Ie={...Oe,color:bt,backgroundColor:bt,outlineColor:bt,fill:bt,stroke:bt,borderColor:bt,borderTopColor:bt,borderRightColor:bt,borderBottomColor:bt,borderLeftColor:bt,filter:Le,WebkitFilter:Le,mask:Be,WebkitMask:Be},Ue=t=>Ie[t],Ne=new Set([Le,Be]);let We,ze,$e;function Ke(t,e){if(t===We&&e===ze)return $e;let n=Ue(t);return Ne.has(n)||(n=Lt),$e=n.getAnimatableNone?n.getAnimatableNone(e):void 0,We=t,ze=e,$e}const Ye=t=>180*t/Math.PI,Xe=t=>{const e=Ye(Math.atan2(t[1],t[0]));return _e(e)},He={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scaleZ:()=>1,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Xe,rotateZ:Xe,skewX:t=>Ye(Math.atan(t[1])),skewY:t=>Ye(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},_e=t=>((t%=360)<0&&(t+=360),t),Ge=t=>Math.hypot(t[0],t[1]),qe=t=>Math.hypot(t[4],t[5]),Ze={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ge,scaleY:qe,scaleZ:t=>Math.hypot(t[8],t[9],t[10]),scale:t=>(Ge(t)+qe(t))/2,rotateX:t=>_e(Ye(Math.atan2(t[6],t[5]))),rotateY:t=>_e(Ye(Math.atan2(-t[2],t[0]))),rotateZ:Xe,rotate:Xe,skewX:t=>Ye(Math.atan(t[4])),skewY:t=>Ye(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Je(t){return t.includes("scale")?1:0}function Qe(t,e){if(!t||"none"===t)return Je(e);const n=t.match(/^matrix(3d)?\(([-\d.e\s,]+)\)$/u);if(!n)return Je(e);const i=(n[1]?Ze:He)[e],s=n[2].split(",").map(t=>parseFloat(t));return"function"==typeof i?i(s):s[i]}const tn=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","scaleZ","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],en=(()=>new Set([...tn,"pathRotation"]))(),nn=t=>t===st||t===vt,sn=new Set(["x","y","z"]),on=tn.filter(t=>!sn.has(t));const rn=new Set(["bottom","right"]);function an(t,e,n,i,s,o){const r=parseFloat(t);if(!isNaN(r))return r;const{min:a,max:l}=e()[n],h=l-a;return"border-box"===o?h:h-parseFloat(i)-parseFloat(s)}const ln=({transform:t})=>Qe(t,"x"),hn=({transform:t})=>Qe(t,"y"),cn={width:({width:t,paddingLeft:e="0",paddingRight:n="0",boxSizing:i},s)=>an(t,s,"x",e,n,i),height:({height:t,paddingTop:e="0",paddingBottom:n="0",boxSizing:i},s)=>an(t,s,"y",e,n,i),top:({top:t})=>parseFloat(t),left:({left:t})=>parseFloat(t),bottom:({top:t},e)=>{const{y:n}=e();return parseFloat(t)+(n.max-n.min)},right:({left:t},e)=>{const{x:n}=e();return parseFloat(t)+(n.max-n.min)},x:ln,y:hn,translateX:ln,translateY:hn},un=new Set;let dn=!1,pn=!1,mn=!1;function fn(){if(pn){const t=[],e=new Set,n=new Set;un.forEach(i=>{i.needsMeasurement&&(t.push(i),e.add(i.element),rn.has(i.name)&&n.add(i.element))});const i=new Map;n.forEach(t=>{const e=function(t){const e=[];return on.forEach(n=>{const i=t.getValue(n);if(void 0!==i){const t=i.get(),s=n.startsWith("scale")?1:0;if(t===s)return;e.push([n,t]),i.set(s)}}),e}(t);e.length&&(i.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=i.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)})}pn=!1,dn=!1,un.forEach(t=>t.complete(mn)),un.clear()}function yn(){un.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(pn=!0)})}class gn{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?(un.add(this),dn||(dn=!0,Zt.read(yn),Zt.resolveKeyframes(fn))):(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=function(t,e,n){if("string"==typeof t){if(x(t)||S(t))return parseFloat(t);if(!Lt.test(t)&&Lt.test(n))return Ke(e,n)}return t??void 0}(n.readValue(e,o),e,o);void 0!==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;e<t.length;e++)t[e]??(t[e]=t[e-1])}(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),un.delete(this)}cancel(){"scheduled"===this.state&&(un.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}function vn(t,e,n){(t=>t.startsWith("--"))(e)?t.style.setProperty(e,n):t.style[e]=n}const xn={};function wn(t,e){const n=function(t){let e;return()=>(void 0===e&&(e=t()),e)}(t);return()=>xn[e]??n()}const Sn=wn(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),Tn=wn(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),bn=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,Pn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:bn([0,.65,.55,1]),circOut:bn([.55,0,1,.45]),backIn:bn([.31,.01,.66,-.59]),backOut:bn([.33,1.53,.69,.99])};function An(t,e){return t?"function"==typeof t?Tn()?ee(t,e):"ease-out":K(t)?bn(t):Array.isArray(t)?t.map(t=>An(t,e)||Pn.easeOut):Pn[t]:void 0}function En(t,e,n,{delay:i=0,duration:s=300,repeat:o=0,repeatType:r="loop",ease:a="easeOut",times:l}={},h=void 0){const c={[e]:n};l&&(c.offset=l);const u=An(a,s);Array.isArray(u)&&(c.easing=u);const d={delay:i,duration:s,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:o+1,direction:"reverse"===r?"alternate":"normal"};return h&&(d.pseudoElement=h),t.animate(c,d)}function Mn(t){return"function"==typeof t&&"applyToOptions"in t}class Vn extends Ee{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;const l=function({type:t,...e}){return Mn(t)&&Tn()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=En(e,n,i,l,s),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=this.onFinish=()=>{if(this.animation.onfinish=null,this.finishedTime=this.time,!s){const t=we(i,this.options,r,this.speed);this.updateMotionValue?.(t),vn(e,n,t),this.animation.cancel()}a?.(),this.notifyFinished()},Ae(this,t,l)}play(){this.isStopped||(this.manualStartTime=null,this.animation.onfinish=this.onFinish,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.isStopped||(this.animation.onfinish=this.onFinish),this.animation.finish?.()}cancel(){this.animation.onfinish=null;try{this.animation.cancel()}catch(t){}}stop(){this.isStopped||(this.isStopped=!0,"idle"!==this.state&&null===this.finishedTime&&(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 M(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+M(t)}get time(){return M(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=E(t),e&&(this.animation.pause(),this.updateFinished())}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,onAttach:e,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=this.onFinish=null,t&&Sn()?(this.animation.timeline=t,e?.(this.animation),T):n(this)}}const kn={anticipate:j,backInOut:F,circInOut:U};function Dn(t){"string"==typeof t.ease&&t.ease in kn&&(t.ease=kn[t.ease])}class Cn extends Vn{constructor(t){Dn(t),Te(t),super(t),void 0!==t.startTime&&!1!==t.autoplay&&(this.startTime=t.startTime),this.options=t}elapsed(){return"running"===this.state?(q.now()-this.startTime)*this.speed:1e3*this.time}sample(t){if(!this.sampler){const{motionValue:t,onUpdate:e,onComplete:n,onPlay:i,onStop:s,element:o,...r}=this.options;this.sampler=new ke({...r,autoplay:!1}),this.sampler.stop()}return this.sampler.sample(Math.max(0,t)).value}liveValue(){const{state:t}=this;if("running"===t||"paused"===t)return this.sample(this.elapsed())}updateMotionValue(t){const{motionValue:e,element:n,name:i}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const{speed:s}=this,o=this.elapsed(),r="running"===this.state&&s?g(0,10,o):0,a=this.sample(o);n&&i&&vn(n,i,a),e.setWithVelocity(this.sample(o-r*Math.sign(s)),a,r/Math.abs(s||1))}}const Rn=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Lt.test(t)&&"0"!==t||t.startsWith("url(")));function Ln(t){t.duration=0,t.type="keyframes"}const Bn=new Set(["opacity","clipPath","filter","transform"]),Fn=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;const jn=({mixer:t,keyframes:e})=>t&&"number"!=typeof e[0]&&e.some((n,i)=>i&&t(e[i-1],n)),On=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),In=()=>!v.useManualTiming&&Object.hasOwnProperty.call(Element.prototype,"animate");function Un(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:o,type:r,keyframes:a}=t;if(!n||!Bn.has(n)&&!On.has(n))return!1;const l=e?.owner?.current;if(!(l instanceof HTMLElement||l instanceof SVGElement))return!1;const{onUpdate:h,transformTemplate:c}=e.owner.getProps();return In()&&(Bn.has(n)||On.has(n)&&function(t){for(let e=0;e<t.length;e++)if("string"==typeof t[e]&&Fn.test(t[e]))return!0;return!1}(a))&&("transform"!==n||!c)&&!h&&!i&&"mirror"!==s&&0!==o&&"inertia"!==r&&!jn(t)}const Nn=(t,e)=>e&&"number"==typeof t?e.transform(t):t,Wn={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},zn=tn.length,$n={},Kn=(t,e,n=Nn(e,je[t]))=>($n[t]||($n[t]=(Wn[t]||t)+"("))+n+")",Yn=(t,e)=>("number"==typeof e?e:parseFloat(e))===(t.startsWith("scale")?1:0);const Xn=new WeakMap,Hn=.001,_n=100,Gn=new Set(["linear","easeIn","easeOut","easeInOut"]),qn=new WeakMap,Zn=(t,e)=>Math.min(200,Math.max(2,Math.ceil((e-t)/10))),Jn=(t,e)=>Math.abs(t-e)<=.001,Qn=(t,e)=>t-e,ti=(t,e,n)=>ge(Array(n+1)).map(n=>jt(t,e,n)),ei=t=>t.motionValue.owner,ni=t=>Xn.get(t),ii=({state:t})=>"idle"===t||"finished"===t,si=(t,e)=>t.latestValues?t.latestValues[e]:t.getValue(e)?.get();class oi{constructor(t,e,n,i){this.element=t,this.update=e,this.makeDriver=n,this.animation=i}get js(){return this.driver||(this.driver=this.makeDriver(this.update))}now(){return this.driver||this.makeDriver!==te?this.js.now():H.isProcessing?H.timestamp:q.now()}start(t=!0){const e=ni(this.element);!e||e.isJS?this.js.start(t):e.schedule(!1,!t)}stopJS(){this.driver?.stop()}stop(){this.stopJS();const t=ni(this.element);t&&!t.isFinishing&&t.release(this.animation)}}let ri,ai;class li extends ke{constructor(t){const e=ei(t).current,{driver:n=te}=t;let i;const s=function(t){const e=ei(t),{onUpdate:n,transformTemplate:i}=e.getProps();return!(t.isHandoff||n||t.hasOnUpdate||i||"inertia"===t.type||"none"!==(si(e,"transform")||"none")||si(e,"pathRotation")||e.projection?.isProjecting()||jn(t))}(t);t.driver=t=>new oi(e,t,n,i),super(t),i=this;const o=this.driver;o&&(o.animation=this),this.canAccelerate=s;const{stop:r}=this;this.stop=()=>{this.isAccelerated()&&this.sync(),r()}}offsets(){const{keyframes:t,times:e}=this.options;return e||(this.offsetsOf!==t&&(this.offsetsOf=t,this.cachedOffsets=ge(t)),this.cachedOffsets)}get group(){return ni(ei(this.options).current)}get js(){return this.driver?.js}stopJS(){this.driver?.stopJS()}get name(){return this.options.name}timing(){const{startTime:t,speed:e,totalDuration:n}=this,{delay:i=0,repeatType:s}=this.options;return null!==this.holdTime?[1/0,0]:n===1/0?[t+i/e,this.resolvedDuration*("loop"===s?1:2)/e||1]:[t+(i+n)/e,0]}isAccelerated(){const{group:t,state:e}=this;return t?.tracks.has(this)&&!t.isJS&&this.canAccelerate&&("running"===e||"paused"===e)}liveValue(){return this.isAccelerated()?this.sampleAt(q.now()):void 0}tween(){const{keyframes:t,type:e,repeat:n,delay:i=0}=this.options;let s=-1;if(n||e!==ve||null!==this.holdTime)return;for(let e=1;e<t.length;e++)if(t[e]!==t[e-1]){if(s>=0)return;s=e-1}let{ease:o}=this.options;$(o)&&(o=o[s]);const r=this.offsets(),a=t=>this.startTime+(i+r[t]*this.totalDuration)/this.speed;if(s>=0){const t=K(o)?bn(o):(t=>Gn.has(t))(o)?Pn[o]:X(o);return[a(s),a(s+1),"string"==typeof t||Jn(t(0),0)&&Jn(t(1),1)?t:void 0]}}boundaries(t,e){const{startTime:n,speed:i,resolvedDuration:s,options:o}=this,{delay:r=0,repeat:a=0,repeatDelay:l=0,repeatType:h,type:c}=o,u=(c||ve)===ve?this.offsets():[0,1],d=n+r/i,p=[];if(null!==this.holdTime||!(s>0))return p;for(let n=Math.max(0,Math.floor((t-d)*i/s));n<=a;n++){const o=d+n*s/i;if(o>e)break;for(const r of u){const a=o+(n%2&&h&&"loop"!==h?1-r:r)*(s-l)/i;a>t&&a<e&&p.push(a)}}return p}numberAt(t){return parseFloat(this.sampleAt(t,!0))}sync(){const t=q.now(),e=this.sampleAt(t,!0);this.options.motionValue.setWithVelocity(null===this.holdTime?this.sampleAt(t-10,!0):e,e,10)}play(){this.isStopped||((this.group||function(t){const e=t.current,n=new Set,i=new Map;let s,o,r={},a=[],l=new Map,h=[],c=!1,u=!1,d=!1,p=!1,m=-1/0,f=1/0;const y=t=>{for(const e of n)if(e.name===t)return!0},g=(e,n)=>{const s={};for(const o of void 0===e?tn:a){const a=i.get(o),l=void 0===e?si(t,o):a?a.sampleAt(n>e&&!a.timing()[1]?n:e):r[o];void 0!==l&&(s[o]=l)}return s},v=(t,e)=>{let n="";for(const i in t){const s=t[i];e&&Yn(i,s)||(n+=Kn(i,s)+" ")}return(e?n.trim():n)||"none"},x=(t,e)=>v(g(t,e)),w=(t=g())=>{e.style.transform=v(t,!0)},S=t=>{t.onfinish=t.oncancel=null,t.cancel()},T=(t=!0)=>{clearTimeout(s),f=1/0,o=void 0,t&&w(),h.forEach(({animation:t})=>S(t)),h=[]},b=(t,n)=>new Animation(new KeyframeEffect(e,t,n)),A=(t,e,n=1/0)=>{const i={animation:t,offset:e,end:n};t.startTime=q.now()+e,n<1/0&&(t.onfinish=()=>{i.isDone=!0,h.some(t=>t.end===1/0)&&(S(t),h=h.filter(t=>t!==i)),j.schedule(!1)}),t.oncancel=()=>h.includes(i)&&j.demote(),h.push(i)},E=(t,e,n)=>{const i=(e,n)=>Math.abs(t(n)-t(e)),s=i(e,n);for(;n-e>.01;){const t=(e+n)/2;i(e,t)>i(t,n)?n=t:e=t}return i(e,n)>s/2?[e,n]:[]},M=(t,e,n,i)=>{const s=Zn(e,n);if(4*i.length>s)return;let o;for(const i of t){const t=i.numberAt(e),s=(i.numberAt((e+n)/2)-t)/(i.numberAt(n)-t);if(s==s)if(void 0===o)o=s;else if(!Jn(s,o))return}const r=ti(e,n,s).concat(i).sort(Qn),a=t=>P(e,n,t);let l,h;for(const n of t){const t=n.numberAt(e),i=r.map(e=>n.numberAt(e)-t),s=i[i.length-1],o=i.some(t=>Math.abs(t)*Hn>Math.abs(s))?0:s,a=i.map(t=>o?t/o:t);if(o&&!l)l=a,h=e=>(n.numberAt(e)-t)/o;else if(a.some((t,e)=>!Jn(t,o&&l[e])))return}if(!l||l.every((t,e)=>Jn(t,a(r[e]))))return"linear";const c=[],u=(t,e=h(t))=>c.push(Ve(e)+" "+Ve(100*a(t))+"%");return l.forEach((t,e)=>{e&&Math.abs(t-l[e-1])>.2&&E(h,r[e-1],r[e]).forEach(t=>u(t)),u(r[e],t)}),"linear("+c+")"},V=(t,e,n,i)=>{const s=[e],o=[];let r=n,a=e;for(const i of t){const t=i.tween();if("linear"!==t?.[2]){const[s,l]=i.timing(),[h,c]=t||[e,l?n:s];r=Math.min(r,h),a=Math.max(a,c),o.push(i)}}r=Math.max(e,r),a=Math.min(n,a);const l=(t,e)=>o.every(n=>!(Math.abs(n.numberAt((t+e)/2)-(n.numberAt(t)+n.numberAt(e))/2)>(n.name.startsWith("scale")?.001:.1))),h=(e,n,i)=>{if(n-e<1||l(e,n))s.push(n);else if(i<4)h(e,(e+n)/2,i+1),h((e+n)/2,n,i+1);else{for(const i of t)s.push(...E(t=>i.numberAt(t),e,n));s.push(n)}},c=a>r?ti(r,a,Math.ceil((a-r)/100)):[];c.push(n);for(const t of i)c.push(t,Math.min(t+.01,n));let u=e;for(const t of c.sort(Qn))t>u&&h(u,t,0),u=t;return s.sort(Qn)},k=t=>{let e;for(const n of t){const t=n.tween();if(!t||e&&(Math.abs(t[0]-e[0])>1||Math.abs(t[1]-e[1])>1))return;e=[t[0],t[1],e&&t[2]!==e[2]?void 0:t[2]]}return e},D=(t,e,n,i,s={fill:"both"},o)=>{const r=i?[]:t.flatMap(t=>t.boundaries(e,n)),a=i||M(t,e,n,r),l=a?[e,n]:V(t,e,n,r),h=l.map(t=>x(t,o));let c={transform:h};return a||(c.offset=l.map(t=>P(e,n,t))),h.every(t=>t===h[0])&&(w(g(e,o)),c=null),b(c,{...s,duration:n-e,easing:a||"linear"})},C=t=>{const e=q.now()+t;e<f&&(clearTimeout(s),f=e,s=setTimeout(()=>{f=1/0,j.schedule(!1)},t))},R=e=>{let s=e,c=0,u=0;const d=[],p=[],m=new Set;i.clear(),l=new Map;for(const t of n){i.set(t.name,t);const[n,o]=t.timing(),r=n===1/0;if(l.set(t,[t.at(e),t.speed,r]),!r){if(t.speed<0)return;if(o){if(c){const t=(n-u)/o;if(Math.abs(o-c)>1||Math.abs(t-Math.round(t))*c>1)return}else c=o,u=n;p.push(t)}else m.add(n);d.push(t),s=Math.max(s,n)}}r={},a=tn.filter(e=>{if(i.has(e))return!0;const n=r[e]=si(t,e);return void 0!==n&&!Yn(e,n)}),T(!1);const f=!c&&k(d);try{if(s>e){let t;if(f&&f[1]>e){const[n,i,r]=f;if(n-e>_n)return d.forEach(t=>t.sync()),C(o=n-e-_n),!0;t="string"==typeof r?r:r?((t,e)=>{let n=qn.get(t);return n?.[0]!==e&&(n=[e,"linear("+ge(Array(e+1)).map(e=>Ve(t(e))+" "+Ve(100*e)+"%")+")"],qn.set(t,n)),n[1]})(r,Zn(n,i)):M(d,n,i,[]),t&&A(D(d,n,i,t,{fill:"both",endDelay:s-i}),n-e,s-n)}t||A(D(d,e,s),0,s-e),m.forEach(t=>t<s-1&&A(b(null,{duration:t-e}),0,t-e))}if(c){const t=u+Math.floor((s-u)/c)*c;A(D(p,t,t+c,void 0,{iterations:1/0,iterationStart:(s-t)/c,fill:"forwards"},s),s-e)}}catch{return}return h.length||T(),!0},L=(t,e)=>{let i,s=0;for(const e of n){const n=l.get(e);if(!n)return!1;const[o,r,a]=n,c=e.at(t),u=e.timing()[0]===1/0;if(a){if(u&&(c===o||!h.length))continue;return!1}const d=(c-o)/r,p=u?0:e.speed/r;if(void 0===i)i=d,s=p;else if(Math.abs(d-i)>1||p!==s)return!1}if(void 0===i)return!0;if(!h.length){if(void 0===o||e&&s)return!1;if(s){const t=(o-i)/s;if(t<1)return!1;C(t)}return!0}for(const{offset:t,end:n,isDone:s}of h){const o=i-t;if(n<1/0&&(s?o<n-1:o<0&&(e||t<=0)||o>=n))return!1}for(const{animation:e,offset:n,isDone:o}of h){if(o)continue;const r=i-n;s&&e.updatePlaybackRate&&"running"===e.playState&&Math.abs(Number(e.currentTime)-r)<20?e.playbackRate!==s&&e.updatePlaybackRate(s):s?(e.playbackRate!==s&&(e.playbackRate=s),e.startTime=t-r/s):(e.startTime=null,e.currentTime=r)}return!0},B=()=>!n.size&&(d=!0,ni(e)===j&&Xn.delete(e),j.isJS||T(),!0),F=()=>{const e=q.now();if(j.isJS||(j.isFinishing=!0,n.forEach(n=>{const[i,s]=n.timing();"running"===n.state&&n.speed>0&&!s&&i<=e+1&&(n.complete(),r[n.name]=si(t,n.name),l.has(n)||(c=!0))}),j.isFinishing=!1),u=!1,d)return;if(n.forEach(t=>ii(t)&&n.delete(t)),B())return;for(const t of n)if(!t.canAccelerate)return j.demote(!0);j.isJS&&(j.isJS=!1,c=!0,n.forEach(t=>t.stopJS()));const i=c,s=p;if(c=p=!1,i||!L(e,s)){if(s){if(e-m<100)return j.demote();m=e}if(!R(e))return j.demote()}else if(void 0!==o&&!s)return;n.forEach(t=>t.timing()[0]===1/0&&t.sync())},j={tracks:n,isJS:!1,isFinishing:!1,schedule(t,e){d||(c||(c=t),p||(p=!!e),u||(u=!0,H.isProcessing?Zt.render(F,!1,!0):hi(F)))},release(t){ii(t)&&n.delete(t),B()||j.schedule(!0)},check(){if(!j.isJS)for(const e in r)if(si(t,e)!==r[e]&&!y(e))return j.schedule(!0,!0)},demote(t){if(!j.isJS&&!d)return n.forEach(e=>{e.isAccelerated()&&e.sync(),t||(e.canAccelerate=!1)}),j.isJS=!0,l=new Map,T(),n.forEach(t=>"running"===t.state&&t.js?.start()),!0}};return Xn.set(e,j),j}(ei(this.options))).tracks.add(this),super.play())}pause(){super.pause(),this.isAccelerated()&&this.group.schedule(!1)}complete(){super.complete();const{group:t}=this;t&&!t.isJS&&this.tick(q.now())}get time(){return this.isAccelerated()?M(g(0,this.totalDuration,this.at(q.now())-(this.options.delay||0))):super.time}set time(t){(ri??(ri=Object.getOwnPropertyDescriptor(ke.prototype,"time").set)).call(this,t)}attachTimeline(t){return this.canAccelerate=!1,this.group?.demote(!0),super.attachTimeline(t)}}const hi=t=>{ai||queueMicrotask(()=>{const t=ai;ai=void 0,t.forEach(t=>t())}),(ai||(ai=[])).push(t)};class ci extends Ee{constructor(t){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=q.now();const{keyframes:e,name:n,motionValue:i,element:s}=t,o=t;o.autoplay??(o.autoplay=!0),o.delay??(o.delay=0),o.type??(o.type="keyframes"),o.repeat??(o.repeat=0),o.repeatDelay??(o.repeatDelay=0),o.repeatType??(o.repeatType="loop");const r=s?.KeyframeResolver||gn;this.keyframeResolver=new r(e,(t,e,n)=>this.onKeyframesResolved(t,e,o,!n),n,i,s),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=q.now();const c=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=Rn(s,e),a=Rn(o,e);return!(!r||!a)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}(t)||("spring"===n||Mn(n))&&i)}(t,s,o,r);c||(!v.instantAnimations&&a||h?.(we(t,n,e)),t[0]=t[t.length-1],Ln(n),n.repeat=0);const{onComplete:u}=n;n.finalKeyframe=e,n.keyframes=t,n.onComplete=()=>{u?.(),this.notifyFinished()};const d=c&&!l&&Un(n),p=!d&&(({name:t,motionValue:e})=>t&&tn.includes(t)&&e?.owner?.current instanceof HTMLElement&&In()&&Tn())(n);let m;if(i&&(d||p||this.resolvedAt!==this.createdAt)&&(n.startTime??(n.startTime=be(this.createdAt,this.resolvedAt))),d){n.element=n.motionValue?.owner?.current;try{m=new Cn(n)}catch{m=new ke(n)}}else m=p?new li(n):new ke(n);this.pendingTimeline&&(this.stopTimeline=m.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=m}get finished(){return this._animation?this._animation.finished:super.finished}then(t,e){return this.finished.finally(t).then(()=>{})}liveValue(){return this._animation?.liveValue?.()}get animation(){return this._animation||(this.keyframeResolver?.resume(),mn=!0,yn(),fn(),mn=!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?.cancel(),this.keyframeResolver?.cancel()}}function ui(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}class di{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=q.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.dirty(),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=q.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){var n;return"change"===t?this.onChangeSubscribe(e):((n=this.events)[t]||(n[t]=new A)).add(e)}onChangeSubscribe(t){const{events:e}=this;return e.change||this.changeSubscriber?(e.change||(e.change=new A,e.change.add(this.changeSubscriber),this.changeSubscriber=void 0),e.change.add(t)):this.changeSubscriber=t,()=>{this.changeSubscriber===t?this.changeSubscriber=void 0:e.change?.remove(t),this.stopIfUnobserved()}}stopIfUnobserved(){Zt.read(()=>{this.changeSubscriber||this.events.change?.getSize()||this.stop()})}clearListeners(){this.changeSubscriber=void 0;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){e&&(this.updatedAt=q.now(),this.stop()),this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,this.stopPassiveEffect?.()}dirty(){const{current:t,changeSubscriber:e}=this;e?e(t):this.events.change?.notify(t)}addDependent(t){(this.dependents||(this.dependents=new Set)).add(t)}removeDependent(t){this.dependents?.delete(t)}get(){const t=this.animation?.liveValue?.();return void 0===t?this.current:t}getCurrent(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=q.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return V(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return new Promise(e=>this.run(t,e))}run(t,e){this.stop(),this.hasAnimated=!0;let n,i=!1;n=t(()=>{i=!0,this.events.animationComplete?.notify(),this.animation===n&&(this.animation=void 0),e?.()}),i||(this.animation=n),this.events.animationStart?.notify()}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel?.notify()),this.animation=void 0}isAnimating(){return!!this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect?.()}}function pi(t,e){return new di(t,e)}function mi(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}function fi(t,e){const n=t?.[e]??t?.default??t;return n!==t?mi(n,t):n}const yi={type:"spring",stiffness:500,damping:25,restSpeed:10},gi={type:"keyframes",duration:.8},vi={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},xi=(t,{keyframes:e})=>e.length>2?gi:en.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:yi:vi,wi=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed","out","mixer"]);const Si=(t,e,n,i={},s,o)=>r=>{const a=fi(i,t)||{},l=a.delay||i.delay||0;let{elapsed:h=0}=i;h-=E(l);const c={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,hasOnUpdate:!!a.onUpdate};(function(t){for(const e in t)if(!wi.has(e))return!0;return!1})(a)||Object.assign(c,xi(t,c)),c.duration&&(c.duration=E(c.duration)),c.repeatDelay&&(c.repeatDelay=E(c.repeatDelay)),void 0!==c.from&&(c.keyframes[0]=c.from);let u=!1;if((!1===c.type||0===c.duration&&!c.repeatDelay)&&(Ln(c),0===c.delay&&(u=!0)),(v.instantAnimations||v.skipAnimations||s?.shouldSkipAnimations||a.skipAnimations)&&(u=!0,Ln(c),c.delay=0),c.allowFlatten=!a.type&&!a.ease,u&&!o&&void 0!==e.get()){const t=we(c.keyframes,a);if(void 0!==t)return void Zt.update(()=>{c.onUpdate(t),c.onComplete()})}return a.isSync?new ke(c):new ci(c)},Ti=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function bi(t,e,n=1){const[i,s]=function(t){const e=Ti.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 x(t)?parseFloat(t):t}return et(s)?bi(s,e,n+1):s}function Pi(t,e,n,i){const s=e=>"function"==typeof e?e(void 0!==n?n:t.custom,...function(t){const e=[{},{}];return t?.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}(i)):e;return"string"==typeof(e=s(e))&&(e=t.variants&&t.variants[e]),s(e)}function Ai(t,e,n){return Pi(t.getProps(),e,n,t)}const Ei=(t,e)=>"exit"===e?t.presenceContext?.custom:void 0,Mi=new Set(["width","height","top","left","right","bottom",...tn]);function Vi(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,pi(n))}function ki(t){return(t=>Array.isArray(t))(t)?t[t.length-1]||0:t}const Di=t=>Boolean(t&&t.getVelocity);function Ci(t,e){const n=t.getValue("willChange");if(i=n,Boolean(Di(i)&&i.add))return n.add(e);if(!n&&v.WillChange){const n=new v.WillChange("auto");t.addValue("willChange",n),n.add(e)}var i}const Ri="data-framer-appear-id";function Li(t){return t.props[Ri]}const Bi="undefined"!=typeof window;function Fi({protectedKeys:t,needsAnimating:e},n){const i=n in t&&!e[n];return e[n]=!1,i}function ji(t,e,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:o,transitionEnd:r,...a}=e;const l=t.getDefaultTransition();o=o?mi(o,l):l;const h=o?.reduceMotion,c=o?.skipAnimations;i&&(o=i);const u=[],d=s&&t.animationState?.getState()[s],p=o?.path;p&&(p.animateValues?p.animateValues(e=>t.getValue(e,t.latestValues[e]??0),a,o,n,u):p.animateVisualElement?.(t,a,o,n,u));for(const e in a){const i=t.getValue(e,t.latestValues[e]??null),s=a[e];if(void 0===s||d&&Fi(d,e))continue;const r={delay:n,...fi(d?.out[e]||o||{},e)};c&&(r.skipAnimations=!0);const l=i.get();if(void 0!==l&&!i.isAnimating()&&!Array.isArray(s)&&s===l&&!r.velocity){Zt.update(()=>i.set(s));continue}let p=!1;if(Bi&&window.MotionHandoffAnimation){const n=Li(t);if(n){const t=window.MotionHandoffAnimation(n,e,Zt);null!==t&&(r.startTime=t,p=!0)}}Ci(t,e);const m=h??t.shouldReduceMotion;i.run(Si(e,i,s,m&&Mi.has(e)?{type:!1}:r,t,p));const f=i.animation;f&&u.push(f)}if(r){const e=()=>Zt.update(()=>{r&&function(t,e){const n=Ai(t,e);let{transitionEnd:i={},transition:s={},...o}=n||{};o={...o,...i};for(const e in o)Vi(t,e,ki(o[e]))}(t,r)});u.length?Promise.all(u).then(e):e()}return u}function Oi(t,e,n={}){const i=Ai(t,e,Ei(t,n.type)),s=n.transitionOverride||(i?.transition??(t.getDefaultTransition()||{})),o=()=>Promise.all(i?ji(t,i,n):[]),r=(i=0)=>{const{variantChildren:o}=t,{delayChildren:r=0,staggerChildren:a,staggerDirection:l}=s,h=[];return o?.forEach(t=>{t.notify("AnimationStart",e),h.push(Oi(t,e,{...n,delay:i+("function"==typeof r?0:r)+ui(o,t,r,a,l)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(h)},{when:a}=s;return a?"beforeChildren"===a?o().then(()=>r()):r().then(o):Promise.all([o(),r(n.delay)])}const Ii=[st,vt,gt,yt,wt,xt,{test:t=>"auto"===t,parse:t=>t}],Ui=t=>Ii.find((t=>e=>e.test(t))(t));function Ni(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||S(t))}const Wi=new Set(["auto","none","0"]);class zi extends gn{constructor(t,e,n,i,s){super(t,e,n,i,s,!0)}scheduleResolve(){if(this.canReadNow()&&(this.readKeyframes(),!this.needsMeasurement))return this.complete();super.scheduleResolve()}canReadNow(){const{unresolvedKeyframes:t,element:e,motionValue:n}=this,i=t[0]??n?.get();if(!e?.current||void 0===i)return!1;for(let e=0;e<t.length;e++)if(it(e?t[e]:i))return!1;return!0}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e?.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){let i=t[n];if("string"==typeof i&&(i=i.trim(),et(i))){const s=bi(i,e.current);void 0!==s&&(t[n]=s),n===t.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!Mi.has(n)||2!==t.length)return;const[i,s]=t;if("number"==typeof i&&"number"==typeof s)return;const o=Ui(i),r=Ui(s);if(it(i)!==it(s)&&cn[n])this.needsMeasurement=!0;else if(o!==r)if(nn(o)&&nn(r))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else cn[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)(null===t[e]||Ni(t[e]))&&n.push(e);n.length&&function(t,e,n){let i,s=0;for(;s<t.length&&!i;){const e=t[s];"string"==typeof e&&!Wi.has(e)&&kt(e)&&(i=t[s]),s++}if(i&&n)for(const s of e)t[s]!==i&&(t[s]=Ke(n,i))}(t,n,e)}measure(){const{element:t,name:e}=this;return cn[e](window.getComputedStyle(t.current),()=>t.measureViewportBox())}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t?.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),e[0]=this.measuredOrigin;const i=e[e.length-1];void 0!==i&&this.motionValue?.jump(i,!1)}measureEndState(){const{element:t,unresolvedKeyframes:e}=this;if(!t?.current)return;this.motionValue?.jump(this.measuredOrigin,!1);const n=e.length-1,i=e[n];e[n]=this.measure(),null!==i&&void 0===this.finalKeyframe&&(this.finalKeyframe=i),this.resolveNoneKeyframes()}}const $i=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function Ki(t){return w(t)&&"ownerSVGElement"in t}const Yi={};function Xi(t){return Yi.current?.add(t),t}const Hi=t=>Yi.current?Yi.current.bind(t):t;function _i(t,e,n){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){const i=e?e.current:Yi.current?.root||document,s=n?.[t]??i.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t).filter(t=>null!=t)}function Gi(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}function qi(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(en.has(t))r=!0;else if(Q(t))s[t]=n;else{const e=Nn(n,Oe[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="";for(let s=0;s<zn;s++){const o=tn[s],r=t[o];if(void 0===r)continue;const a=n&&(e[o]=Nn(r,Oe[o]));Yn(o,r)||(i+=Kn(o,r,a||void 0)+" ")}const s=t.pathRotation;return s&&(i+=Kn("rotate",s)),i=i.trim(),n?n(e,i):i||"none"}(e,t.transform,n):i.transform&&(i.transform="none")),a){const{originX:t="50%",originY:e="50%",originZ:n=0}=o;i.transformOrigin=`${t} ${e} ${n}`}}const Zi={offset:"stroke-dashoffset",array:"stroke-dasharray"},Ji={offset:"strokeDashoffset",array:"strokeDasharray"};const Qi=["transform","opacity","clipPath","filter","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function ts(t,{attrX:e,attrY:n,attrScale:i,pathLength:s,pathSpacing:o=1,pathOffset:r=0,...a},l,h,c){if(qi(t,a,h),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:u,style:d}=t;for(const t of Qi)void 0!==u[t]&&(d[t]=u[t],delete u[t]);(d.transform||u.transformOrigin)&&(d.transformOrigin=u.transformOrigin??"50% 50%",delete u.transformOrigin),d.transform&&(d.transformBox=c?.transformBox??"fill-box",delete u.transformBox),void 0!==e&&(u.x=e),void 0!==n&&(u.y=n),void 0!==i&&(u.scale=i),void 0!==s&&function(t,e,n=1,i=0,s=!0){t.pathLength=1;const o=s?Zi:Ji;t[o.offset]=""+-i,t[o.array]=`${e} ${n}`}(u,s,o,r,!1)}function es({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function ns(t){return void 0===t||1===t}function is({scale:t,scaleX:e,scaleY:n}){return!ns(t)||!ns(e)||!ns(n)}const ss=["rotate","rotateX","rotateY","rotateZ","skewX","skewY"];function os(t){return is(t)||as(t)||rs(t)}function rs(t){return t.z||t.rotate||t.rotateX||t.rotateY||t.rotateZ||t.skewX||t.skewY}function as(t){return ls(t.x)||ls(t.y)}function ls(t){return t&&"0%"!==t}function hs(t,e,n){return n+e*(t-n)}function cs(t,e,n,i,s){return void 0!==s&&(t=hs(t,s,i)),hs(t,n,i)+e}function us(t,e=0,n=1,i,s){t.min=cs(t.min,e,n,i,s),t.max=cs(t.max,e,n,i,s)}function ds(t,{x:e,y:n}){us(t.x,e.translate,e.scale,e.originPoint),us(t.y,n.translate,n.scale,n.originPoint)}const ps=.999999999999,ms=1.0000000000001;function fs(t,e){t.min+=e,t.max+=e}function ys(t,e,n,i,s=.5){us(t,e,n,jt(t.min,t.max,s),i)}function gs(t,e){return"string"==typeof t?parseFloat(t)/100*(e.max-e.min):t}function vs(t,e,n){const i=n??t;ys(t.x,gs(e.x,i.x),e.scaleX,e.scale,e.originX),ys(t.y,gs(e.y,i.y),e.scaleY,e.scale,e.originY)}function xs(t,e){return es(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{schedule:ws}=qt(queueMicrotask,!1);const Ss={};function Ts(t){return Di(t)?t.get():t}const bs=t=>"number"==typeof t?t:parseFloat(t),Ps=$i.length,As=t=>"number"==typeof t||vt.test(t);function Es(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const Ms=ks(0,.5,I),Vs=ks(.5,.95,T);function ks(t,e,n){return i=>i<t?0:i>e?1:n(P(t,e,i))}function Ds(t,e){t.min=e.min,t.max=e.max}function Cs(t,e){Ds(t.x,e.x),Ds(t.y,e.y)}function Rs(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function Ls(t){return t.max-t.min}function Bs(t,e,n,i=.5){t.origin=i,t.originPoint=jt(e.min,e.max,t.origin),t.scale=Ls(n)/Ls(e),t.translate=jt(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 Fs(t,e,n,i){Bs(t.x,e.x,n.x,i?.originX),Bs(t.y,e.y,n.y,i?.originY)}function js(t,e,n,i=0){const s=i?jt(n.min,n.max,i):n.min;t.min=s+e.min,t.max=t.min+Ls(e)}function Os(t,e,n,i=0){const s=i?jt(n.min,n.max,i):n.min;t.min=e.min-s,t.max=t.min+Ls(e)}function Is(t,e,n,i){Os(t.x,e.x,n.x,i?.x),Os(t.y,e.y,n.y,i?.y)}function Us(t,e,n,i,s){return t=hs(t-=e,1/n,i),void 0!==s&&(t=hs(t,1/s,i)),t}function Ns(t,e,[n,i,s],o,r){!function(t,e=0,n=1,i=.5,s,o=t,r=t){gt.test(e)&&(e=parseFloat(e),e=jt(r.min,r.max,e/100)-r.min);if("number"!=typeof e)return;let a=jt(o.min,o.max,i);t===o&&(a-=e),t.min=Us(t.min,e,n,a,s),t.max=Us(t.max,e,n,a,s)}(t,e[n],e[i],e[s],e.scale,o,r)}const Ws=["x","scaleX","originX"],zs=["y","scaleY","originY"];function $s(t,e,n,i){Ns(t.x,e,Ws,n?.x,i?.x),Ns(t.y,e,zs,n?.y,i?.y)}const Ks=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Ys=Ks("applewebkit/")&&!Ks("chrome/")?Math.round:T;function Xs(t){t.min=Ys(t.min),t.max=Ys(t.max)}const Hs=()=>({x:{min:0,max:0},y:{min:0,max:0}});function _s(t){return 0===t.translate&&1===t.scale}function Gs(t){return _s(t.x)&&_s(t.y)}function qs(t,e){return t.min===e.min&&t.max===e.max}function Zs(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Js(t,e){return Zs(t.x,e.x)&&Zs(t.y,e.y)}function Qs(t){return Ls(t.x)/Ls(t.y)}function to(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class eo{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)}}function no(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const io={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!vt.test(t))return t;t=parseFloat(t)}return`${no(t,e.target.x)}% ${no(t,e.target.y)}%`}},so={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=Lt.parse(t);if(s.length>5)return i;const o=Lt.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=jt(a,l,.5);return"number"==typeof s[2+r]&&(s[2+r]/=h),"number"==typeof s[3+r]&&(s[3+r]/=h),o(s)}},oo={borderRadius:Object.assign({},io,{applyTo:$i.slice()}),borderTopLeftRadius:io,borderTopRightRadius:io,borderBottomLeftRadius:io,borderBottomRightRadius:io,boxShadow:so};function ro(t){return[t("x"),t("y")]}const ao=(t,e)=>t.depth-e.depth;class lo{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(ao),this.isDirty=!1,this.children.forEach(t)}}const ho={hasAnimatedSinceResize:!0,hasEverUpdated:!1},co=["z","skew","skewZ"];let uo=0;function po(t,e,n,i){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),i&&(i[t]=0))}const mo=t=>t.instance&&Xn.get(t.instance)?.demote()&&t.resetSkewAndRotation();function fo(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Li(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:e,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",Zt,!(e||i))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&fo(i)}function yo(t){if(t)return!1!==t.options.allowProjection?t.projection:yo(t.parent)}function go({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:s}){return Object.assign(Ss,{...oo,...Ss}),class{static create(t,e,n){const{layoutId:i,layout:s,drag:o,dragConstraints:r,layoutScroll:a,layoutRoot:l,layoutAnchor:h,layoutCrossfade:c}=e,u=t.projection=new this(t.latestValues,e["data-framer-portal-id"]?void 0:yo(t.parent));var d;u.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:Boolean(o)||r&&(d=r,d&&"object"==typeof d&&Object.prototype.hasOwnProperty.call(d,"current")),visualElement:t,animationType:"string"==typeof s?s:"both",initialPromotionConfig:n,crossfade:c,layoutScroll:a,layoutRoot:l,layoutAnchor:h});const p=u.getStack()?.lead;p&&!u.root.isUpdateBlocked()&&(p.willUpdate(),p.scheduleCheckAfterUnmount())}constructor(t={},n=e?.()){this.id=uo++,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.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(wo),this.nodes.forEach(Do),this.nodes.forEach(Co),this.nodes.forEach(So)},this.resolvedRelativeTargetAt=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;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new lo)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new A),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){this.eventHandlers.get(t)?.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}mount(e){if(this.instance)return;var n;this.isSVG=Ki(e)&&!(Ki(n=e)&&"svg"===n.tagName),this.instance=e;const{layoutId:i,layout:s,visualElement:o}=this.options;if(o&&!o.current&&o.mount(e),this.root.nodes.add(this),this.parent?.children.add(this),this.root.hasTreeAnimated&&(s||i)&&(this.isLayoutDirty=!0),t){let n,i=0;const s=()=>this.root.updateBlockedByResize=!1;Zt.read(()=>{i=window.innerWidth}),t(e,()=>{const t=window.innerWidth;t!==i&&(i=t,this.root.updateBlockedByResize=!0,n?.(),n=function(t,e){const n=q.now();t=Hi(t);const i=({timestamp:s})=>{const o=s-n;o>=e&&(Jt(i),t(o-e))};return Zt.setup(i,!0),Xi(()=>Jt(i))}(s,250),ho.hasAnimatedSinceResize&&(ho.hasAnimatedSinceResize=!1,this.nodes.forEach(ko)))})}i&&this.root.registerSharedNode(i,this),this.addLayoutListener()}addLayoutListener(){const{layoutId:t,layout:e,visualElement:n,animate:i}=this.options;this.instance&&!this.hasLayoutListener&&!1!==i&&n&&(t||e)&&(this.hasLayoutListener=!0,this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeLayoutChanged:i,layout:s})=>{if(this.isAnimationBlocked)return this.target=void 0,void(this.relativeTarget=void 0);const o=this.options.transition||n.getDefaultTransition()||Oo,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=n.getProps(),l=!this.targetLayout||!Js(this.targetLayout,s),h=!e&&i;if(this.options.layoutRoot||this.resumeFrom||h||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const e={...fi(o,"layout"),onPlay:r,onComplete:a};(n.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e),this.setAnimationOrigin(t,h,e.path)}else e||ko(this),this.isLead()&&this.options.onExitComplete?.();this.targetLayout=s}))}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),this.getStack()?.remove(this),this.parent?.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),this.hasLayoutListener=!1,Jt(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes?.forEach(Ro),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?.();if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&fo(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;mo(this),this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){const e=this.path[t];e.shouldResetTransform=!0,mo(e),"string"!=typeof e.latestValues.x&&"string"!=typeof e.latestValues.y||(e.isLayoutDirty=!0),e.updateScroll("snapshot"),e.options.layoutRoot&&e.willUpdate(!1),e.isAnimationBlocked&&(e.dragSnapshot||(e.dragSnapshot=e.measure()),this.dragAncestor=e)}const{layoutId:e,layout:n}=this.options;if(void 0===e&&!n)return;const i=this.getTransformTemplate();this.prevTransformTemplateValue=i?i(this.latestValues,""):void 0,this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}update(){this.updateScheduled=!1;if(this.isUpdateBlocked()){const t=this.updateBlockedByResize;return this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),t&&this.nodes.forEach(Po),void this.nodes.forEach(bo)}if(this.animationId<=this.animationCommitId)return void this.nodes.forEach(Ao);this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Eo),this.nodes.forEach(Mo),this.nodes.forEach(Vo),this.nodes.forEach(vo),this.nodes.forEach(xo)):this.nodes.forEach(Ao),this.clearAllSnapshots();const t=q.now();H.delta=g(0,1e3/60,t-H.timestamp),H.timestamp=t,H.isProcessing=!0,Qt.update.process(H),Qt.preRender.process(H),Qt.render.process(H),H.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,ws.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(To),this.sharedNodes.forEach((t,e)=>t.members.length?t.removeLeadSnapshot():this.sharedNodes.delete(e))}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Zt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Zt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){if(!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||Ls(this.snapshot.measuredBox.x)||Ls(this.snapshot.measuredBox.y)||(this.snapshot=void 0),this.snapshot)){const{visualElement:t}=this.options,e="running"===this.currentAnimation?.state,n=e&&this.animationEdges;e&&this.relativeTarget&&(this.snapshot.relativeVelocity=this.relativeVelocity?.slice()||[]);const i=n&&this.motionValue?.getVelocity()||0,s=[0,1,2,3,4,5].map(e=>(e<4?n&&(this.edgeValues?this.edgeVelocity(e):-n[e]*i/1e3):t?.getValue(e<5?"x":"y")?.getVelocity())||0);s.some(Boolean)&&(this.snapshot.velocity=s)}}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;t<this.path.length;t++){this.path[t].updateScroll()}const t=this.layout;this.layout=this.measure(!1),this.layoutCorrected||(this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}}),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:e}=this.options;e?.notify("LayoutMeasure",this.layout.layoutBox,t?.layoutBox)}updateScroll(t="measure"){const{scroll:e,instance:s}=this,{animationId:o}=this.root;if(this.options.layoutScroll&&s&&(!e||e.animationId!==o||e.phase!==t)){const r=i(s);this.scroll={animationId:o,phase:t,isRoot:r,offset:n(s),wasRoot:e?e.isRoot:r}}}resetTransform(){if(!s)return;const t=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout;t&&mo(this);const e=this.projectionDelta&&!Gs(this.projectionDelta),n=this.getTransformTemplate(),i=n?n(this.latestValues,""):void 0,o=i!==this.prevTransformTemplateValue;t&&this.instance&&(e||os(this.latestValues)||o)&&(s(this.instance,i),this.shouldResetTransform=!1,this.scheduleRender())}measure(t=!0){const e=this.measurePageBox();let n=this.removeElementScroll(e);var i;return t&&(n=this.removeTransform(n)),Xs((i=n).x),Xs(i.y),{animationId:this.root.animationId,measuredBox:e,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:t}=this.options;if(!t)return{x:{min:0,max:0},y:{min:0,max:0}};const e=t.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(No))){const{scroll:t}=this.root;t&&(fs(e.x,t.offset.x),fs(e.y,t.offset.y))}return e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};if(Cs(e,t),this.scroll?.wasRoot)return e;for(let n=0;n<this.path.length;n++){const i=this.path[n],{scroll:s,options:o}=i;i!==this.root&&s&&o.layoutScroll&&(s.wasRoot&&Cs(e,t),fs(e.x,s.offset.x),fs(e.y,s.offset.y))}return e}applyTransform(t,e=!1,n,i,s=0){const o=n||{x:{min:0,max:0},y:{min:0,max:0}};Cs(o,t);for(let t=s;t<this.path.length;t++){const n=this.path[t];!e&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(fs(o.x,-n.scroll.offset.x),fs(o.y,-n.scroll.offset.y)),os(n.latestValues)&&vs(o,n.latestValues,n.layout?.layoutBox)}return!i&&os(this.latestValues)&&vs(o,this.latestValues,this.layout?.layoutBox),o}removeTransform(t){const e={x:{min:0,max:0},y:{min:0,max:0}};Cs(e,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];if(!os(n.latestValues))continue;let i;n.instance&&(is(n.latestValues)&&n.updateSnapshot(),i=Hs(),Cs(i,n.measurePageBox())),$s(e,n.latestValues,n.snapshot?.layoutBox,i)}return os(this.latestValues)&&$s(e,this.latestValues),e}setTargetDelta(t){this.targetDelta=t,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(t){this.options={...this.options,...t,crossfade:void 0===t.crossfade||t.crossfade},this.addLayoutListener()}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==H.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(t=!1){const e=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=e.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=e.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=e.isSharedProjectionDirty);const n=Boolean(this.resumingFrom)||this!==e;if(!(t||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:i,layoutId:s}=this.options;if(!this.layout||!i&&!s)return;this.resolvedRelativeTargetAt=H.timestamp;const o=this.getClosestProjectingParent();var r,a,l,h;(this.targetDelta||this.relativeTarget||(!1!==this.options.layoutAnchor&&o&&o.layout?this.createRelativeTarget(o,this.layout.layoutBox,o.layout.layoutBox):this.removeRelativeTarget()),this.relativeTarget||this.targetDelta)&&(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),r=this.target,a=this.relativeTarget,l=this.relativeParent.target,h=this.options.layoutAnchor||void 0,js(r.x,a.x,l.x,h?.x),js(r.y,a.y,l.y,h?.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.applyTransform(this.layout.layoutBox,!1,this.target,!0):Cs(this.target,this.layout.layoutBox),ds(this.target,this.targetDelta)):Cs(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,!1!==this.options.layoutAnchor&&o&&(!o.resumingFrom==!this.resumingFrom||o.options.layoutRoot&&!o.resumingFrom)&&!o.options.layoutScroll&&o.target&&1!==this.animationProgress?this.createRelativeTarget(o,this.target,o.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(this.parent&&!is(this.parent.latestValues)&&!as(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(t,e,n){this.relativeParent=t,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},Is(this.relativeTargetOrigin,e,n,this.options.layoutAnchor||void 0),Cs(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const t=this.getLead(),e=Boolean(this.resumingFrom)||this!==t;let n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),e&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===H.timestamp&&(n=!1),n)return;const{layout:i,layoutId:s}=this.options;if(this.isTreeAnimating=Boolean(this.parent?.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!i&&!s)return;Cs(this.layoutCorrected,this.layout.layoutBox);const o=this.treeScale.x,r=this.treeScale.y;!function(t,e,n,i=!1){const s=n.length;if(!s)return;let o,r;e.x=e.y=1;for(let a=0;a<s;a++)o=n[a],r=o.projectionDelta,"contents"!==o.options.visualElement?.props.style?.display&&(!0===i&&o.options.layoutScroll&&o.scroll&&o!==o.root&&(fs(t.x,-o.scroll.offset.x),fs(t.y,-o.scroll.offset.y)),r&&(e.x*=r.x.scale,e.y*=r.y.scale,ds(t,r)),i&&(i.path?.[a]||i)!==o&&os(o.latestValues)&&vs(t,o.latestValues,o.layout?.layoutBox));e.x<ms&&e.x>ps&&(e.x=1),e.y<ms&&e.y>ps&&(e.y=1)}(this.layoutCorrected,this.treeScale,this.path,e&&(!(t.relativeTarget&&!t.relativeParent.resumingFrom)||t.relativeParent)),!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?(Rs(this.prevProjectionDelta.x,this.projectionDelta.x),Rs(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),Fs(this.projectionDelta,this.layoutCorrected,a,this.latestValues),this.treeScale.x===o&&this.treeScale.y===r&&to(this.projectionDelta.x,this.prevProjectionDelta.x)&&to(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){this.options.visualElement?.scheduleRender(),t&&this.getStack()?.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,n){const i=this.snapshot,s=i?i.latestValues:{},o={...this.latestValues},r={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 a={x:{min:0,max:0},y:{min:0,max:0}},l=i?.source!==this.layout?.source,h=this.getStack(),c=!h||h.members.length<=1,u=Boolean(l&&!c&&!0===this.options.crossfade&&!this.path.some(jo));let d;this.animationProgress=0;const p=n?.interpolateProjection(t),m=this.layout?.layoutBox;let f=m&&[m.x.min,m.x.max,m.y.min,m.y.max].map((e,n)=>{const{translate:i,scale:s,originPoint:o}=t[n<2?"x":"y"];return(e-o)*(s-1)+i});f?.every(isFinite)||(f=void 0),this.animationEdges=f,this.edgeValues=this.startVelocity=this.impulse=this.relativeVelocity=this.relativeStart=void 0;const y=i?.velocity,g=i?.relativeVelocity||y;if(g?.slice(0,4).some(Boolean)&&this.getClosestProjectingParent()&&(this.relativeStart=g),y&&f){const e=y.slice(0,4).map((t,e)=>t+(l?y[4+(e>>1)]:0));e.some(Boolean)&&(this.startVelocity=p?((t,e,{x:n,y:i})=>{const s=t*t+e*e;return s<1?0:-1e3*(n*t+i*e)/s})(t.x.translate,t.y.translate,{x:(e[0]+e[1])/2,y:(e[2]+e[3])/2}):e)}this.mixTargetDelta=e=>{const n=e/1e3,i=p?.(n),h=this.edgeValues;for(let e=0;e<2;e++){const i=e?"y":"x";h?Lo(r[i],t[i],this.layout.layoutBox[i],h[2*e],h[2*e+1]):Bo(r[i],t[i],n)}if(i&&(r.x.translate=i.x,r.y.translate=i.y),this.setTargetDelta(r),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout){Is(a,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0);const t=this.relativeTargetOrigin,e=a;if(function(t,e,n,i){Fo(t.x,e.x,n.x,i),Fo(t.y,e.y,n.y,i)}(this.relativeTarget,t,e,n),this.isSpringLayout){const t=this.relativeTarget,e=this.impulse||0,n=this.relativeStart,i=q.now(),s=(i-this.relativeTime)/1e3;this.relativeTime=i;const o=this.relativeVelocity||(this.relativeVelocity=[0,0,0,0]);for(let i=0;i<4;i++){const r=i<2?"x":"y",a=1&i?"max":"min";n&&(t[r][a]+=n[i]*e),d&&s>0&&(o[i]=(t[r][a]-d[r][a])/s)}}d&&(m=this.relativeTarget,f=d,qs(m.x,f.x)&&qs(m.y,f.y))&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),Cs(d,this.relativeTarget)}var m,f;l&&(this.animationValues=o,function(t,e,n,i,s,o){s?(t.opacity=jt(0,n.opacity??1,Ms(i)),t.opacityExit=jt(e.opacity??1,0,Vs(i))):o&&(t.opacity=jt(e.opacity??1,n.opacity??1,i));for(let s=0;s<Ps;s++){const o=$i[s];let r=Es(e,o),a=Es(n,o);void 0===r&&void 0===a||(r||(r=0),a||(a=0),0===r||0===a||As(r)===As(a)?(t[o]=Math.max(jt(bs(r),bs(a),i),0),(gt.test(a)||gt.test(r))&&(t[o]+="%")):t[o]=a)}for(let s=0;s<ss.length;s++){const o=ss[s];(e[o]||n[o])&&(t[o]=jt(e[o]||0,n[o]||0,i))}}(o,s,this.latestValues,n,u,c)),void 0!==i?.rotate&&(this.animationValues||(this.animationValues=o),this.animationValues.pathRotation=i.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart");const e=this.isSpringLayout="spring"===t.type;this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.resumingFrom&&(this.resumingFrom.edgeValues=void 0),this.pendingAnimation&&(Jt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Zt.update(()=>{ho.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=pi(0)),this.motionValue.jump(0,!1);const n=this.startVelocity;this.startVelocity=void 0;let i=t,s=0;if(e){if("auto"===t.mass){const e=this.layout?.layoutBox;i=((t,e=300)=>{const n=g(.25,2,e/300),{stiffness:i,damping:s}=de({...t,duration:t.duration&&E(t.duration)});return{...t,stiffness:i,damping:s*Math.sqrt(n),mass:n}})(t,e&&Math.sqrt(Ls(e.x)*Ls(e.y)))}const e=this.relativeStart;if((n||e)&&!t.repeat)if("number"==typeof n)s=n;else{const t=n&&this.animationEdges;i={...i,type:i=>{const s=[i.velocity,...n||[]].map((e,n)=>me({...i,keyframes:n?[t[n-1],0]:i.keyframes,velocity:e})),o=s.length;e&&s.push(me({...i,keyframes:[0,0],velocity:1e3,restDelta:.5,restSpeed:5}));let r=0;const a=[],l={calculatedDuration:null,next:e=>{r=e;const n=s[0].next(e);let i=n.done;for(let t=1;t<s.length;t++){const{value:n,done:r}=s[t].next(e);t<o?a[t-1]=n:this.impulse=n/1e3,i=i&&r}return t&&(this.edgeValues=a),n.done=i,n}};return l.calculatedDuration=ie(l),l.next(0),this.edgeVelocity=t=>s[t+1].velocity(r),l}}}}const o=function(t,e,n){const i=Di(t)?t:pi(t);return i.run(Si("",i,e,n)),i.animation}(this.motionValue,[0,1e3],{...i,velocity:s,isSync:!0,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onComplete:()=>{t.onComplete&&t.onComplete(),this.completeAnimation()}});this.currentAnimation=o,function(t,e){const n=globalThis.__MOTION_INSPECT__;if(n)try{n({...Pe("layout-animation-start",t),node:e})}catch{}}(this.currentAnimation,this),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=this.edgeValues=this.edgeVelocity=this.impulse=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.edgeValues=this.impulse=void 0,this.mixTargetDelta?.(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead(),{targetWithTransforms:e,layout:n,latestValues:i}=t;let{target:s}=t;if(e&&s&&n){if(this!==t&&this.layout&&n&&Uo(this.options.animationType,this.layout.layoutBox,n.layoutBox)){const{layoutBox:t}=this.layout,e=s;s=this.target||{x:{min:0,max:0},y:{min:0,max:0}},Io(s.x,e.x,t.x),Io(s.y,e.y,t.y)}Cs(e,s),vs(e,i),Fs(this.projectionDeltaWithTransform,this.layoutCorrected,e,i)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new eo);this.sharedNodes.get(t).add(e);const n=e.options.initialPromotionConfig;e.promote({transition:n?.transition,preserveFollowOpacity: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}={}){this.getStack()?.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){return this.getStack()?.relegate(this)||!1}resetSkewAndRotation(){const{visualElement:t}=this.options;if(!t)return;const{latestValues:e}=t;if(!rs(e))return;const n={};for(let e=0;e<co.length;e++)po(co[e],t,n,this.animationValues);for(let e=0;e<ss.length;e++)po(ss[e],t,n,this.animationValues);t.render();for(const e in n)t.setStaticValue(e,n[e]),this.animationValues&&(this.animationValues[e]=n[e]);t.scheduleRender()}applyProjectionStyles(t,e){if(!this.instance||this.isSVG)return;const n=this.getLead();if(!this.isVisible&&n!==this)return void(t.visibility="hidden");const i=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,t.visibility="",t.opacity="",t.pointerEvents=Ts(e?.pointerEvents)||"",void(t.transform=i?i(this.latestValues,""):"none");if(!this.projectionDelta||!this.layout||!n.target)return(this.options.layoutId||this.needsShow)&&(this.needsShow=!1,t.visibility="",t.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,t.pointerEvents=Ts(e?.pointerEvents)||""),void(this.hasProjected&&!os(this.latestValues)&&(t.transform=i?i({},""):"none",this.hasProjected=!1));t.visibility="";const s=n.animationValues||n.latestValues;this.applyTransformsToTarget();let o=function(t,e,n){let i="";const s=t.x.translate/e.x,o=t.y.translate/e.y,r=n?.z||0;(s||o||r)&&(i=`translate3d(${s}px, ${o}px, ${r}px) `);let a="";if(n){const{transformPerspective:t}=n;t&&(i=`perspective(${t}px) ${i}`);for(let t=0;t<ss.length;t++){const e=ss[t],i=n[e];i&&(a+=`${e}(${i}deg) `),!t&&n.pathRotation&&(a+=`rotate(${n.pathRotation}deg) `)}}if(a){1===e.x&&1===e.y||(i+=`scale(${1/e.x}, ${1/e.y}) `),i+=a;const n=t.x.scale*e.x,s=t.y.scale*e.y;1===n&&1===s||(i+=`scale(${n}, ${s})`)}else 1!==t.x.scale||1!==t.y.scale?i+=`scale(${t.x.scale}, ${t.y.scale})`:i||1===e.x&&1===e.y||(i="scale(1, 1)");return i||"none"}(this.projectionDeltaWithTransform,this.treeScale,s);i&&(o=i(s,o)),t.transform=o;const{x:r,y:a}=this.projectionDelta;t.transformOrigin=`${100*r.origin}% ${100*a.origin}% 0`,n.animationValues?t.opacity=n===this?s.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:s.opacityExit:t.opacity=n===this?void 0!==s.opacity?s.opacity:"":void 0!==s.opacityExit?s.opacityExit:0;for(const e in Ss){if(void 0===s[e])continue;const{correct:i,applyTo:r,isCSSVariable:a}=Ss[e],l="none"===o?s[e]:i(s[e],n);if(r){const e=r.length;for(let n=0;n<e;n++)t[r[n]]=l}else a?this.options.visualElement.renderState.vars[e]=l:t[e]=l}this.options.layoutId&&(t.pointerEvents=n===this?Ts(e?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=this.dragSnapshot=this.dragAncestor=void 0}resetTree(){this.root.nodes.forEach(t=>t.currentAnimation?.stop()),this.root.nodes.forEach(bo),this.root.sharedNodes.clear()}}}function vo(t){t.updateLayout(),function(t){const{snapshot:e,dragAncestor:n}=t,i=n?.isAnimationBlocked&&n.layout;if(!e||!i||t.resumeFrom||t.isAnimationBlocked)return;const s=n.dragSnapshot;ro(t=>fs(e.layoutBox[t],i.layoutBox[t].min-s.layoutBox[t].min))}(t)}function xo(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,r=(i,o)=>{if("size"===s)ro(t=>{const e=Ls(i[t]);i[t].min=o[t].min,i[t].max=i[t].min+e});else if("x"===s||"y"===s){const t="x"===s?"y":"x";Ds(i[t],o[t])}else Uo(s,e.layoutBox,n)&&ro(e=>{const n=Ls(o[e]);i[e].max=i[e].min+n,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[e].max=t.relativeTarget[e].min+n)})},a=o?e.measuredBox:e.layoutBox;r(a,n);const l={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};Fs(l,n,e.layoutBox);const h={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};Fs(h,o?t.applyTransform(i,!0):n,a);const c=!Gs(l);let u=!1;const d=t.getClosestProjectingParent();if((!o||d?.options.layoutRoot&&t.resumeFrom?.path.includes(d))&&d&&!d.resumeFrom){const{snapshot:i,layout:s}=d;if(i&&s){const a=t.options.layoutAnchor||void 0,l={x:{min:0,max:0},y:{min:0,max:0}};Is(l,o?t.resumeFrom.applyTransform(e.layoutBox,!0,void 0,!0,d.depth+1):e.layoutBox,i.layoutBox,a);const h={x:{min:0,max:0},y:{min:0,max:0}};Is(h,n,s.layoutBox,a),o&&r(l,h),Js(l,h)||(u=!0),d.options.layoutRoot&&(t.relativeTarget=h,t.relativeTargetOrigin=l,t.relativeParent=d)}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:h,layoutDelta:l,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else t.isLead()&&t.options.onExitComplete?.();t.options.transition=void 0}function wo(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 So(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function To(t){t.clearSnapshot()}function bo(t){t.clearMeasurements()}function Po(t){t.isLayoutDirty=!0,t.updateLayout()}function Ao(t){t.isLayoutDirty=!1}function Eo(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.dragSnapshot||t.layout,t.isLayoutDirty=!0)}function Mo(t){t.relativeTarget&&t.relativeParent?.isLayoutDirty&&(t.currentAnimation?t.isLayoutDirty=!0:(t.targetDelta=void 0,t.removeRelativeTarget()))}function Vo(t){const{visualElement:e}=t.options;e?.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function ko(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Do(t){t.resolveTargetDelta()}function Co(t){t.calcProjection()}function Ro(t){t.resetSkewAndRotation()}function Lo(t,e,n,i,s){const o=n.max-n.min,r=o?Math.max(0,(o+s-i)/o):1,a=t.originPoint=e.originPoint;t.origin=e.origin,t.scale=r,t.translate=n.min+i-(a+(n.min-a)*r)}function Bo(t,e,n){t.translate=jt(e.translate,0,n),t.scale=jt(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Fo(t,e,n,i){t.min=jt(e.min,n.min,i),t.max=jt(e.max,n.max,i)}function jo(t){return void 0!==t.animationValues?.opacityExit}const Oo={duration:.45,ease:[.4,0,.1,1]};function Io(t,e,n){t.max=Ls(n)+(t.min=e.min)}function Uo(t,e,n){return"position"===t||"preserve-aspect"===t&&(i=Qs(e),s=Qs(n),o=.2,!(Math.abs(i-s)<=o));var i,s,o}function No(t){return t!==t.root&&t.scroll?.wasRoot}function Wo(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n,i)}const zo=go({attachResizeListener:(t,e)=>Wo(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),$o={current:void 0},Ko=go({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!$o.current){const t=new zo({});t.mount(window),t.setOptions({layoutScroll:!0}),$o.current=t}return $o.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>"fixed"===window.getComputedStyle(t).position}),Yo=new WeakMap;function Xo(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function Ho(t){return"string"==typeof t||Array.isArray(t)}const _o=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","whilePinch","exit"],Go=["initial"].concat(_o);function qo(t){if(Xo(t.animate))return!0;for(let e=0;e<Go.length;e++)if(Ho(t[Go[e]]))return!0;return!1}function Zo(t){return Boolean(qo(t)||t.variants)}const Jo={current:null},Qo={current:!1},tr="undefined"!=typeof window;const er=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let nr={};function ir(t){nr=t}class sr{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=gn,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=q.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,Zt.render(this.render,!1,!0))};const{latestValues:l,renderState:h}=r;this.latestValues=l,this.baseTarget={...l},this.initialValues=e.initial?{...l}:{},this.renderState=h,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=s,this.options=a,this.blockInitialAnimation=Boolean(o),this.isControllingVariants=qo(e),this.isVariantNode=Zo(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:c,...u}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in u){const e=u[t];void 0!==l[t]&&Di(e)&&e.set(l[t])}}mount(t){const e=this.presenceContext;if(this.hasBeenMounted&&!1!==e?.isPresent&&!e?.keepValuesOnRemount)for(const t in this.initialValues)this.values.get(t)?.jump(this.initialValues[t]),this.latestValues[t]=this.initialValues[t];if(this.current=t,Yo.set(t,this),this.projection?.instance||this.projection?.mount(t),this.isVariantNode&&!this.isControllingVariants){let t=this;do{t=!1!==t.props.inherit&&t.parent}while(t&&!t.isVariantNode);if(t){const{variantChildren:e}=t;e.add(this),this.removeFromVariantTree=()=>e.delete(this)}}this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(Qo.current||function(){if(Qo.current=!0,tr)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Jo.current=t.matches;t.addEventListener("change",e),e()}else Jo.current=!1}(),this.shouldReduceMotion=Jo.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection?.unmount(),Jt(this.notifyUpdate),Jt(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),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)).add(t)}removeChild(t){this.children.delete(t),this.enteringChildren?.delete(t)}bindToMotionValue(t,e){if(this.valueSubscriptions.get(t)?.(),e.accelerate&&Bn.has(t)&&this.current instanceof HTMLElement){const{factory:n,keyframes:i,times:s,ease:o,duration:r}=e.accelerate,a=new Vn({element:this.current,name:t,keyframes:i,times:s,ease:o,duration:E(r)}),l=n(a);return void this.valueSubscriptions.set(t,()=>{l(),a.cancel()})}const n=en.has(t);n&&this.onBindTransform&&this.onBindTransform();const i=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&Zt.preRender(this.notifyUpdate),n&&(this.projection&&(this.projection.isTransformDirty=!0),Xn.get(this.current)?.check()),this.scheduleRender()});let s;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{i(),s?.()})}sortNodePosition(t){return this.current&&t.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in nr){const e=nr[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){const{transformTemplate:n,onUpdate:i}=this.props;(t.transformTemplate||n)&&this.scheduleRender(),(t.transformTemplate&&!n||t.onUpdate&&!i)&&Xn.get(this.current)?.demote(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<er.length;e++){const n=er[e];this.propEventSubscriptions[n]?.(),delete this.propEventSubscriptions[n];const i=t["on"+n];i&&(this.propEventSubscriptions[n]=this.on(n,i))}this.prevMotionValues=function(t,e,n){for(const i in e){const s=e[i],o=n[i];if(Di(s))t.addValue(i,s);else if(Di(o))t.addValue(i,pi(s,{owner:t}));else if(o!==s)if(t.hasValue(i)){const e=t.getValue(i);!0===e.liveStyle?e.jump(s):e.hasAnimated||e.set(s)}else{const e=t.getStaticValue(i);t.addValue(i,pi(void 0!==e?e:s,{owner:t}))}}for(const i in n)void 0===e[i]&&t.removeValue(i);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue?.()}getProps(){return this.props}getVariant(t){return this.props.variants?.[t]}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}addValue(t,e){const n=this.values.get(t);if(e!==n){n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e);const i=e.get();void 0!==i&&(this.latestValues[t]=i)}}removeValue(t){this.values.delete(t),this.valueSubscriptions.get(t)?.(),this.valueSubscriptions.delete(t),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){let n=this.props.values?.[t];return n||(n=this.values.get(t),void 0===n&&void 0!==e&&(n=pi(e??this.getDefaultValue?.(t),{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];return null!=n&&("string"==typeof n&&(x(n)||S(n))?n=parseFloat(n):"number"!=typeof n&&!Lt.test(n)&&Lt.test(e)&&(n=Ke(t,e)),this.setBaseTarget(t,Di(n)?n.get():n)),Di(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}on(t,e){return(this.events[t]||(this.events[t]=new A)).add(e)}notify(t,...e){this.events[t]?.notify(...e)}scheduleRenderMicrotask(){ws.render(this.render)}}class or extends sr{constructor(){super(...arguments),this.KeyframeResolver=zi}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;Di(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}function rr(t,{style:e,vars:n},i,s){const o=t.style;let r;for(r in e)o[r]=e[r];for(r in s?.applyProjectionStyles(o,i),n)o.setProperty(r,n[r])}function ar(t,{layout:e,layoutId:n}){return en.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!Ss[t]||"opacity"===t)}function lr(t,e,n){const i=t.style,s=e?.style,o={};if(!i)return o;for(const e in i)(Di(i[e])||s&&Di(s[e])||ar(e,t)||void 0!==n?.getValue(e)?.liveStyle)&&(o[e]=i[e]);return o}class hr extends or{constructor(){super(...arguments),this.type="html",this.renderInstance=rr}mount(t){super.mount(t)}readValueFromInstance(t,e){if(en.has(e))return this.projection?.isProjecting?Je(e):((t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Qe(n,e)})(t,e);{const i=(n=t,window.getComputedStyle(n)),s=(Q(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return xs(t,e)}build(t,e,n){qi(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return lr(t,e,n)}}const cr=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary;function ur(t){return{point:{x:t.pageX,y:t.pageY}}}function dr(t,e,n,i){return Wo(t,e,(t=>e=>cr(e)&&t(e,ur(e)))(n),i)}const pr=new WeakMap;let mr;const fr=(t,e,n)=>(i,s)=>s&&s[0]?s[0][t+"Size"]:Ki(i)&&"getBBox"in i?i.getBBox()[e]:i[n],yr=fr("inline","width","offsetWidth"),gr=fr("block","height","offsetHeight");function vr({target:t,borderBoxSize:e}){pr.get(t)?.forEach(n=>{n(t,{get width(){return yr(t,e)},get height(){return gr(t,e)}})})}function xr(t){t.forEach(vr)}function wr(t,e){mr||"undefined"!=typeof ResizeObserver&&(mr=new ResizeObserver(xr));const n=_i(t);return n.forEach(t=>{let n=pr.get(t);n||(n=new Set,pr.set(t,n)),n.add(e),mr?.observe(t)}),()=>{n.forEach(t=>{const n=pr.get(t);n?.delete(e),n?.size||mr?.unobserve(t)})}}const Sr=new Set;let Tr;function br(t){return Sr.add(t),Tr||(Tr=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Sr.forEach(e=>e(t))},window.addEventListener("resize",Tr)),()=>{Sr.delete(t),Sr.size||"function"!=typeof Tr||(window.removeEventListener("resize",Tr),Tr=void 0)}}function Pr(t,e){return Xi("function"==typeof t?br(t):wr(t,e))}const Ar=(t,e)=>Math.abs(t-e);const Er=new Set(["auto","scroll"]);class Mr{constructor(t,e,{transformPagePoint:n,contextWindow:i=window,dragSnapToOrigin:s=!1,distanceThreshold:o=3,element:r,immediate:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.onElementScroll=t=>{this.handleScroll(t.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;this.hasPendingMove=!1,this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=kr(this.lastRawMoveEventInfo,this.transformPagePoint));const t=Cr(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=function(t,e){const n=Ar(t.x,e.x),i=Ar(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;this.history.push({...i,timestamp:q.now()});const{onStart:s,onMove:o}=this.handlers;e||(s?.(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),o?.(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.handleScroll(window),this.lastMoveEvent=t,this.lastRawMoveEventInfo=e,this.lastMoveEventInfo=kr(e,this.transformPagePoint),this.hasPendingMove=!0,Zt.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.hasPendingMove&&this.updatePoint(),this.end();const{onEnd:n,onSessionEnd:i,resumeAnimation:s}=this.handlers;if(!this.dragSnapToOrigin&&this.startEvent||s?.(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const o=Cr("pointercancel"===t.type?this.lastMoveEventInfo:kr(e,this.transformPagePoint),this.history);this.startEvent&&n?.(t,o),i?.(t,o)},!cr(t))return;this.dragSnapToOrigin=s,this.handlers=e,this.transformPagePoint=n,this.distanceThreshold=a?0:o,this.contextWindow=i||window;const l=ur(t),h=kr(l,this.transformPagePoint),{point:c}=h;this.history=[{...c,timestamp:q.now()}];const{onSessionStart:u}=e;u&&u(t,Cr(h,this.history));const d={passive:!0,capture:!0};this.removeListeners=b(dr(this.contextWindow,"pointermove",this.handlePointerMove,d),dr(this.contextWindow,"pointerup",this.handlePointerUp,d),dr(this.contextWindow,"pointercancel",this.handlePointerUp,d)),r&&this.startScrollTracking(r),a&&(this.handlePointerMove(t,l),this.updatePoint())}startScrollTracking(t){let e=t.parentElement;for(;e;){const t=getComputedStyle(e);(Er.has(t.overflowX)||Er.has(t.overflowY))&&this.scrollPositions.set(e,Vr(e)),e=e.parentElement}this.scrollPositions.set(window,Vr(window)),this.removeScrollListeners=b(Wo(window,"scroll",this.onElementScroll,{capture:!0}),Wo(window,"scroll",this.onWindowScroll,{}))}handleScroll(t){const e=this.scrollPositions.get(t);if(!e)return;const n=t===window,i=Vr(t),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),Zt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners?.(),this.removeScrollListeners?.(),this.scrollPositions.clear(),Jt(this.updatePoint)}}const Vr=t=>t===window?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop};function kr(t,e){return e?{point:e(t.point)}:t}function Dr(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Cr({point:t},e){return{point:t,delta:Dr(t,Lr(e)),offset:Dr(t,Rr(e)),velocity:Br(e,.1)}}function Rr(t){return t[0]}function Lr(t){return t[t.length-1]}function Br(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const s=Lr(t);for(;n>=0&&(i=t[n],!(s.timestamp-i.timestamp>E(e)));)n--;if(!i)return{x:0,y:0};i===t[0]&&t.length>2&&s.timestamp-i.timestamp>2*E(e)&&(i=t[1]);const o=M(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}const Fr=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const jr=new Set(["INPUT","SELECT","TEXTAREA"]);const Or={x:!1,y:!1};function Ir(){return Or.x||Or.y}function Ur(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 Nr(t,e){let n=e.min-t.min,i=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,i]=[i,n]),{min:n,max:i}}const Wr=.35;function zr(t,e,n){return{min:$r(t,e),max:$r(t,n)}}function $r(t,e){return"number"==typeof t?t:t[e]||0}function Kr(t){let e="";for(const n of t.path){n.scroll=void 0,n.updateScroll();const{scroll:i}=n;n!==t.root&&i&&(e+=i.offset.x+","+i.offset.y+",")}return e}const Yr=new WeakMap;class Xr{constructor(t,e=()=>t.getProps()){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t,this.readProps=e}start(t,e={}){if(!1===this.visualElement.presenceContext?.isPresent)return;const{dragSnapToOrigin:n}=this.getProps();this.panSession=new Mr(t,{onSessionStart:t=>{e.snapToCursor&&this.snapToCursor(t),this.stopAnimation()},onStart:(t,e)=>{const{drag:n,dragConstraints:i,dragPropagation:s,onDragStart:o}=this.getProps();if(n&&!s&&(this.openDragLock?.(),this.openDragLock="x"===(r=n)||"y"===r?Or[r]?null:(Or[r]=!0,()=>{Or[r]=!1}):Or.x||Or.y?null:(Or.x=Or.y=!0,()=>{Or.x=Or.y=!1}),!this.openDragLock))return;var r;this.latestPointerEvent=t,this.latestPanInfo=e,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints();const{projection:a}=this.visualElement;a&&(a.isAnimationBlocked=!0,a.target=void 0),ro(t=>{let e=this.getAxisMotionValue(t).get()||0;if(et(e)&&(e=bi(e,this.visualElement.current)||0),vt.test(e))e=parseFloat(e);else if(gt.test(e)){const n=a?.layout?.layoutBox[t];n&&(e=Ls(n)*(parseFloat(e)/100))}this.originPoint[t]=e}),this.point="function"==typeof i&&i(this),o&&Zt.update(()=>o(t,e),!1,!0),Ci(this.visualElement,"transform"),this.visualElement.animationState?.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){if(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),null===this.currentDirection)return;s&&s(this.currentDirection)}this.updateAxis("x",r),this.updateAxis("y",r),this.point&&this.point.move(),this.visualElement.render(),o&&Zt.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.point)&&this.startAnimation({x:0,y:0})}},{...e,transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:n,contextWindow:this.visualElement.current?.ownerDocument.defaultView,element:this.visualElement.current})}stop(t,e,n){const i=t||this.latestPointerEvent,s=e||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!s||!i)return;const{velocity:r}=s;this.startAnimation(r,n);const{onDragEnd:a}=this.getProps();a&&Zt.postRender(()=>a(i,s))}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession(),!this.getProps().dragPropagation&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),e?.setActive("whileDrag",!1)}endPanSession(){this.panSession?.end(),this.panSession=void 0}updateAxis(t,e){const{drag:n}=this.readProps();if(!e||!qr(t,n,this.currentDirection))return;const i=this.getAxisMotionValue(t);let s=this.originPoint[t]+e[t];const o=this.constraints&&this.constraints[t];o&&(s=function(t,{min:e,max:n},i){return void 0!==e&&t<e?t=i?jt(e,t,i.min):Math.max(t,e):void 0!==n&&t>n&&(t=i?jt(n,t,i.max):Math.min(t,n)),t}(s,o,this.elastic[t])),this.point?this.point[t]=s:i.set(s)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),{projection:n}=this.visualElement,i=n&&(n.layout||n.measure(!1)),s=this.constraints;Hr(t)?this.constraints&&this.scroll===Kr(n)||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!i||"object"!=typeof t)&&function(t,{top:e,left:n,bottom:i,right:s}){return{x:Ur(t.x,n,s),y:Ur(t.y,e,i)}}(i.layoutBox,t),this.elastic=function(t=Wr){return!1===t?t=0:!0===t&&(t=Wr),{x:zr(t,"left","right"),y:zr(t,"top","bottom")}}(e),s!==this.constraints&&!Hr(t)&&i&&this.constraints&&!this.hasMutatedConstraints&&ro(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}(i.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!Hr(t))return!1;const n=_r(t),{projection:i}=this.visualElement;if(!i||!i.layout)return!1;this.scroll=Kr(i);const s=function(t,e,n){const i=xs(t,n),{scroll:s}=e;return s&&(fs(i.x,s.offset.x),fs(i.y,s.offset.y)),i}(n,i.root,this.visualElement.getTransformPagePoint());let o=function(t,e){return{x:Nr(t.x,e.x),y:Nr(t.y,e.y)}}(i.layout.layoutBox,i.removeElementScroll(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=es(t))}return o}startAnimation(t,e){const{drag:n,dragMomentum:i,dragElastic:s,dragTransition:o,dragSnapToOrigin:r,onDragTransitionEnd:a}=this.getProps(),l={bounceStiffness:s?200:1e6,bounceDamping:s?40:1e7,timeConstant:750,restDelta:1,restSpeed:10,...o},h=s=>!i||this.point&&r||!qr(s,e||n,this.currentDirection)?0:t[s];if(this.point&&!r)return this.point.release({x:h("x"),y:h("y")},l).then(a);const c=this.constraints||{},u=ro(t=>{if(!qr(t,e||n,this.currentDirection))return;let i=c[t]||{};!0!==r&&r!==t||(i={min:0,max:0});const s={type:"inertia",velocity:h(t),...l,...i};return this.startAxisValueAnimation(t,s)});return Promise.all(u).then(a)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return Ci(this.visualElement,t),n.start(Si(t,n,0,e,this.visualElement,!1))}stopAnimation(){ro(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const e=`_drag${t.toUpperCase()}`,n=this.readProps()[e];return n||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor({clientX:t,clientY:e}){const{drag:n}=this.getProps(),i={x:t,y:e},s=this.visualElement.getTransformPagePoint()?.(i)||i,o=this.visualElement.measureViewportBox();ro(t=>{if(!qr(t,n,this.currentDirection))return;const e=this.getAxisMotionValue(t),{min:i,max:r}=o[t];e.set((e.get()||0)+s[t]-jt(i,r,.5))})}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=this.constraints,s={x:0,y:0};ro(t=>{const e=this.getAxisMotionValue(t).get();s[t]=function(t,e){let n=.5;const i=Ls(t),s=Ls(e);return s>i?n=P(e.min,e.max-i,t.min):i>s&&(n=P(t.min,t.max-s,e.min)),g(0,1,n)}({min:e,max:e},i[t])});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",n.root?.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),ro(e=>{const n=this.getAxisMotionValue(e);if(!qr(e,t,null)||!n.get())return;const{min:i,max:o}=this.constraints[e];n.set(jt(i,o,s[e]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Yr.set(this.visualElement,this);const t=this.visualElement.current,e=dr(t,"pointerdown",e=>{const{drag:n,dragListener:i=!0}=this.getProps(),s=e.target,o=s!==t&&function(t){return jr.has(t.tagName)||!0===t.isContentEditable}(s);n&&i&&!o&&this.start(e)});let n;const i=()=>{const{dragConstraints:e}=this.getProps(),i=Hr(e)&&_r(e);i&&(this.constraints=this.resolveRefConstraints(),n||(n=function(t,e,n){const i=Pr(t,Gr(n)),s=Pr(e,Gr(n));return()=>{i(),s()}}(t,i,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,o=s.addEventListener("measure",i);s.layout||(s.root?.updateScroll(),s.updateLayout()),Zt.read(i);const r=Wo(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(ro(e=>{if(!qr(e,this.getProps().drag,this.currentDirection))return;const n=this.getAxisMotionValue(e);this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate)}),this.visualElement.render())});return()=>{r(),e(),o(),a(),n?.()}}getProps(){const t=this.readProps(),{dragElastic:e=Wr,dragMomentum:n=!0}=t;return{...t,dragElastic:e,dragMomentum:n}}}function Hr(t){return!!t&&"object"==typeof t&&("current"in t||"nodeType"in t)}const _r=t=>"current"in t?t.current:t;function Gr(t){let e=!0;return()=>{e?e=!1:t()}}function qr(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}function Zr(t,e){const n=_i(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},Xi(()=>i.abort())]}function Jr(t,e,n={}){e=Hi(e);const[i,s,o]=Zr(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||Ir())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 Qr=(t,e)=>!!e&&(t===e||Qr(t,e.parentElement)),ta=new WeakSet;function ea(t){return e=>{"Enter"===e.key&&t(e)}}function na(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const ia=new WeakSet,sa=(t,e,n)=>Math.hypot(t.clientX-e.clientX,t.clientY-e.clientY)>n,oa=t=>t.preventDefault();function ra(t,e,n={}){e=Hi(e);const[i,s,o]=Zr(t,n),r=new WeakMap,a=t=>{const i=t.currentTarget;if(!cr(t)||Ir())return;if(ia.has(t))return;n.stopPropagation&&ia.add(t);const{count:o=1,countTimeout:a=.3,hold:l=0,repeat:h}=n,c=q.now(),u=E(l),d=E(a);let p=r.get(i);p?.expire(sa(p.event,t,100))?p=void 0:p&&(Jt(p.expire),r.delete(i));const m=p?p.count+1:1,f=m>=o,y=f&&(l||h);let g,v=!l,x=0;if(ta.add(i),p)g=p.handlers;else{const n=e(i,t);g="function"==typeof n?{onComplete:n}:n||{}}f&&v&&g.onActive?.();const w=E(h);let S=u||w,T=c+S,b=!0;const P=()=>{if(s.signal.aborted)return Jt(P);let t=Math.min(1-(T-q.now())/S,1);b&&t<1&&(t=0),b=!1,g.onHold?.(t),t<1||(v?g.onRepeat?.(++x):(v=!0,g.onActive?.()),h?(b=!0,T+=S=w):Jt(P))},A={...s,capture:!0},M=(e,n)=>{if(cr(e))if(window.removeEventListener("pointerup",V,A),window.removeEventListener("pointercancel",k,A),window.removeEventListener("pointermove",D,A),i.removeEventListener("contextmenu",oa),Jt(P),ta.delete(i),Ir()&&(n=!1),n&&!f){const n=q.now(),o=t=>{const a=s.signal.aborted;if(a||!0===t||q.now()-n>d)return Jt(o),r.delete(i),a||g.onComplete?.(e,{success:!1}),!0};r.set(i,{count:m,event:t,handlers:g,expire:o}),Zt.update(o,!0)}else g.onComplete?.(e,{success:n&&v})},V=t=>{M(t,i===window||i===document||n.useGlobalTarget||Qr(i,t.target))},k=t=>{M(t,!1)},D=e=>{cr(e)&&((h||!v)&&sa(t,e,8)||o>1&&Ir())&&k(e)};window.addEventListener("pointerup",V,A),window.addEventListener("pointercancel",k,A),(y||o>1)&&window.addEventListener("pointermove",D,A),y&&(Zt.update(P,!0),i.addEventListener("contextmenu",oa,{...s,passive:!1}))};return i.forEach(t=>{var e;(n.useGlobalTarget?window:t).addEventListener("pointerdown",a,s),w(e=t)&&"offsetHeight"in e&&!("ownerSVGElement"in e)&&(t.addEventListener("focus",()=>((t,e)=>{let n=!1;const i=ea(()=>{n||ta.has(t)||(n=!0,na(t,"down"))}),s=ea(()=>{n&&(n=!1,na(t,"up"))});t.addEventListener("keydown",i,e),t.addEventListener("keyup",s,e),t.addEventListener("blur",()=>{t.removeEventListener("keydown",i),t.removeEventListener("keyup",s),n&&na(t,"cancel")},{...e,once:!0})})(t,s),s),function(t){return Fr.has(t.tagName)||!0===t.isContentEditable}(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),o}class aa{constructor(t){this.isMounted=!1,this.node=t}update(){}}const la=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"]),ha=t=>"string"==typeof t&&"svg"===t.toLowerCase();function ca(t,e,n){const i=lr(t,e,n);for(const n in t)if("children"!==n&&(Di(t[n])||Di(e[n]))){i[-1!==tn.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return i}class ua extends or{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Hs}getBaseTargetFromProps(t,e){return en.has(e)?super.getBaseTargetFromProps(t,e)??Je(e):t[e]}getDefaultValue(t){return en.has(t)?this.latestValues[t]??Je(t):void 0}readValueFromInstance(t,e){if(en.has(e)){const t=Ue(e);return t&&t.default||0}if(Qi.includes(e)){const n=getComputedStyle(t)[e];if("string"==typeof n&&n)return n.trim()}return e=la.has(e)?e:Gi(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return ca(t,e,n)}build(t,e,n){ts(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){!function(t,e,n,i){rr(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(la.has(n)?n:Gi(n),e.attrs[n])}(t,e,0,i)}mount(t){this.isSVGTag=ha(t.tagName),super.mount(t)}}function da(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let i=0;i<n;i++)if(e[i]!==t[i])return!1;return!0}const pa=[..._o].reverse(),ma=t=>!0===t?.out?t:t?.out;function fa(t){let e=e=>Promise.all(e.map(({animation:e,options:n})=>function(t,e,n={}){return t.notify("AnimationStart",e),(Array.isArray(e)?Promise.all(e.map(e=>Oi(t,e,n))):"string"==typeof e?Oi(t,e,n):Promise.all(ji(t,Ai(t,e,n.custom),n))).then(()=>{t.notify("AnimationComplete",e)})}(t,e,n))),n=ya(),i=!0,s=!1;function o(o){const{props:r,parent:a,manuallyAnimateOnMount:l}=t,{initial:h}=r,c=i||s,u=[],d=(e=h)=>"boolean"!=typeof e&&Ai(t,Array.isArray(e)?e[0]:e,t.presenceContext?.custom)||void 0,p=new Map;let m={},f=1/0,y=t;do{y=!1!==y.props.inherit&&y.parent}while(y&&!y.isControllingVariants);const g=c&&ma(d(h??(y&&y.props.initial))?.transition);if(pa.forEach((e,i)=>{const s=n[e],h=r[e],d=y&&y.props[e],v=void 0!==h?h:Ho(d)||!1===d?d:void 0,x=Ho(v),w=e===o?s.isActive:null,S=x&&void 0===h&&!(c&&l);if(s.protectedKeys={...m},!s.isActive&&null===w||!v&&!s.prevProp||Xo(v)||"boolean"==typeof v)return;if(!1===w&&(f=i),"exit"===e&&s.isActive&&!0!==w)return void(m={...m,...s.prevResolvedValues});const T=function(t,e){if("string"==typeof e)return e!==t;if(Array.isArray(e))return!da(e,t);return!1}(s.prevProp,v);let b=T||x&&(w&&!S||i>f),P=!1;const A=Array.isArray(v)?v:[v];let E,M={};if(!1!==w)for(const n of A){const{transition:i,transitionEnd:s,...o}=Ai(t,n,Ei(t,e))||{};M={...M,...o,...s},E=ma(i)||E}const{prevResolvedValues:V}=s;for(const e in{...V,...M}){if(e in m)continue;const n=M[e],i=V[e],o=Array.isArray(n)&&Array.isArray(i)?!da(n,i)||T:n!==i;let r;if(o&&null==n)p.has(e)||p.set(e,s.prevOut);else if(o||void 0!==n&&p.has(e)){b=!0,r=p.get(e)||g,p.delete(e)&&(P=!0),s.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)}else s.protectedKeys[e]=!0;s.out[e]=r}if(s.prevProp=v,s.prevResolvedValues=M,s.prevOut=E,s.isActive&&(m={...m,...M}),b&&(!S||!T||P))for(const n of A){const i={type:e};if("string"==typeof n&&c&&l&&a?.enteringChildren){const e=Ai(a,n)?.transition?.delayChildren;i.delay=ui(a.enteringChildren,t,e)}u.push({animation:n,options:i})}}),p.size){const e={},n=d();let i=n?.transition;p.forEach((s,o)=>{s&&(i={...i||t.getDefaultTransition(),[o]:s});const a=t.getValue(o);a&&(a.liveStyle=!0);const l=n&&!Array.isArray(h)?n[o]:void 0,c=t.getBaseTargetFromProps(r,o);e[o]=(void 0!==l?l:void 0===c||Di(c)?void 0===t.initialValues[o]?t.baseTarget[o]:void 0:c)??null}),i&&(e.transition=i),u.push({animation:e})}const v=c&&t.blockInitialAnimation||i&&!l&&(!1===r.initial||r.initial===r.animate);return i=s=!1,!v&&u.length?e(u):Promise.resolve()}return{animateChanges:o,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=o(e);for(const t in n)n[t].protectedKeys={};return s},setAnimateFunction:n=>{e=n(t)},getState:()=>n,reset:()=>{n=ya(),s=!0}}}function ya(){const t={};for(const e of _o)t[e]={isActive:"animate"===e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{},out:{}};return t}const ga=n({}),va=n({strict:!1}),xa=n({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),wa=n({});function Sa(t){const{initial:e,animate:n}=function(t,e){if(qo(t)){const{initial:e,animate:n}=t;return{initial:!1===e||Ho(e)?e:void 0,animate:Ho(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,i(wa));return s(()=>({initial:e,animate:n}),[Ta(e),Ta(n)])}function Ta(t){return Array.isArray(t)?t.join(" "):t}const ba=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Pa(t,e,n){for(const i in e)Di(e[i])||ar(i,n)||(t[i]=e[i])}function Aa(t,e){const n={};return Pa(n,t.style||{},t),Object.assign(n,function({transformTemplate:t},e){return s(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{}};return qi(n,e,t),Object.assign({},n.vars,n.style)},[e])}(t,e)),n}function Ea(t,e){const n={},i=Aa(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 Ma=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}});function Va(t,e,n,i){const o=s(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return ts(n,e,ha(i),t.transformTemplate,t.style),{...n.attrs,style:{...n.style}}},[e]);if(t.style){const e={};return Pa(e,t.style,t),{...o,style:{...e,...o.style}}}return o}const ka=new Set(["animate","exit","variants","initial","style","values","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","tap","propagate","ignoreStrict","viewport","pinch"]);function Da(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||ka.has(t)}function Ca(t,e){return t.startsWith("on")?!Da(t):e?.(t)??!Da(t)}const Ra=["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 La(t){return"string"==typeof t&&!t.includes("-")&&!!(Ra.indexOf(t)>-1||/[A-Z]/u.test(t))}function Ba(t,e,n,{latestValues:i},a,l=!1,h,c){const u=(h??La(t)?Va:Ea)(e,i,a,t),d=function(t,e,n,i){const s={};for(const o in t)"values"===o&&"object"==typeof t.values||Di(t[o])||("fx"!==o?(Ca(o,i)||!0===n&&Da(o)||!e&&!Da(o)||t.draggable&&o.startsWith("onDrag"))&&(s[o]=t[o]):t.fx&&(s.fx=""));return s}(e,"string"==typeof t,l,c),p=t!==o?{...d,...u,ref:n}:{},{children:m}=e,f=s(()=>Di(m)?m.get():m,[m]);return r(t,{...p,children:f})}const Fa=n(null);function ja(t){const e=a(null);return null===e.current&&(e.current=t()),e.current}function Oa(t,e,n,i){const s={},o=i(t,{});for(const t in o)s[t]=Ts(o[t]);let{initial:r,animate:a}=t;const l=qo(t),h=Zo(t);e&&h&&!l&&!1!==t.inherit&&(void 0===r&&(r=e.initial),void 0===a&&(a=e.animate));let c=!!n&&!1===n.initial;c=c||!1===r;const u=c?a:r;if(u&&"boolean"!=typeof u&&!Xo(u)){const e=Array.isArray(u)?u:[u];for(let n=0;n<e.length;n++){const i=Pi(t,e[n]);if(i){const{transitionEnd:t,transition:e,...n}=i;for(const t in n){let e=n[t];if(Array.isArray(e)){e=e[c?e.length-1:0]}null!==e&&(s[t]=e)}for(const e in t)s[e]=t[e]}}}return s}const Ia=t=>(e,n)=>{const s=i(wa),o=i(Fa),r=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e},n,i,s){return{latestValues:Oa(n,i,s,t),renderState:e()}}(t,e,s,o);return n?r():ja(r)},Ua=Ia({scrapeMotionValuesFromProps:lr,createRenderState:ba}),Na=Ia({scrapeMotionValuesFromProps:ca,createRenderState:Ma}),Wa={animation:["variants",..._o],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 za=!1;function $a(){return function(){if(za)return;const t={};for(const e in Wa)t[e]={isEnabled:t=>Wa[e].some(e=>!!t[e])};ir(t),za=!0}(),nr}const Ka=Symbol.for("motionComponentSymbol");function Ya(t,e,n){const i=a(n);l(()=>{i.current=n});const s=a(null);return h(n=>{n&&t.onMount?.(n),e&&(n?e.mount(n):e.unmount());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])}const Xa=n({}),Ha="undefined"!=typeof window?c:u;function _a(n,{forwardMotionProps:s=!1,type:o}={},r,h){r&&function(t){const e=$a();for(const n in t)e[n]={...e[n],...t[n]};ir(e)}(r);const c=o?"svg"===o:La(n),p=c?Na:Ua;function m(o,r){let d;const m=function({layoutId:t}){const e=i(ga).id;return e&&void 0!==t?e+"-"+t:t}(o);ja(()=>!!$o.current?.sharedNodes.get(m)?.lead&&o.initial)&&(o={...o,initial:!1});const f={...i(xa),...o,layoutId:m},{isStatic:y,isValidProp:g}=f,v=Sa(o),x=p(o,y);if(!y&&"undefined"!=typeof window){i(va).strict;const t=function(t){const e=$a(),{drag:n,layout:i}=e;if(!n&&!i)return{};const s={...n,...i};return{MeasureLayout:s.MeasureLayout,isEnabled:n?.isEnabled(t)||i?.isEnabled(t),ProjectionNode:s.ProjectionNode}}(f);v.visualElement=function(t,e,n,s,o,r){const{visualElement:h}=i(wa),c=i(va),d=i(Fa),p=i(xa),m=p.reducedMotion,f=p.skipAnimations,y=a(null),g=a(!1);s=s||c.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(Xa);!v||v.projection||!o||"html"!==v.type&&"svg"!==v.type||o.create(v,n,x),l(()=>{v&&v.props!==n&&v.update(n,d)});const w=n[Ri],S=a(Boolean(w)&&"undefined"!=typeof window&&!window.MotionHandoffIsComplete?.(w)&&window.MotionHasOptimisedAnimation?.(w));return Ha(()=>{g.current&&v&&(v.animationState?.animateChanges(),v.enteringChildren=void 0)},[]),Ha(()=>{g.current=!0,v&&(window.MotionIsMounted=!0,v.updateFeatures(),v.scheduleRenderMicrotask(),S.current&&v.animationState&&v.animationState.animateChanges())}),u(()=>{v&&(!S.current&&v.animationState&&v.animationState.animateChanges(),S.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(w)}),S.current=!1),v.enteringChildren=void 0)}),v}(n,x,f,h,t.ProjectionNode,c),(t.isEnabled||v.visualElement?.projection?.options.layoutId)&&(d=t.MeasureLayout)}return t(wa.Provider,{value:v,children:[d&&v.visualElement?e(d,{visualElement:v.visualElement,...f}):null,Ba(n,o,Ya(x,v.visualElement,r),x,y,s,c,g)]})}m.displayName=`motion.${"string"==typeof n?n:`create(${n.displayName??n.name??""})`}`;const f=d(m);return f[Ka]=n,f}const Ga=(t,e)=>e.isSVG??La(t)?new ua(e):new hr(e,{allowProjection:t!==o});let qa=0;const Za={animation:{Feature:class extends aa{constructor(t){super(t),t.animationState||(t.animationState=fa(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Xo(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){this.node.getProps().animate!==this.node.prevProps?.animate&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}},exit:{Feature:class extends aa{constructor(){super(...arguments),this.id=qa++}update(){const{presenceContext:t,animationState:e}=this.node;if(!t||!e)return;const{isPresent:n,onExitComplete:i}=t;if(n===!this.exit)return;if(n){if(!0===this.exit){const{initial:t}=this.node.getProps();if(t&&!Array.isArray(t)){const{transition:e,transitionEnd:n,...i}=Ai(this.node,t)||{};for(const t in i)this.node.getValue(t)?.jump(i[t])}this.node.blockInitialAnimation=!1,e.reset(),e.animateChanges()}else e.setActive("exit",!1);return void(this.exit=void 0)}const s=this.exit=e.setActive("exit",!0);i&&s.then(()=>{this.exit===s&&(this.exit=!0,i(this.id))})}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id,this.node)),this.update()}unmount(){}}}};const Ja=t=>(e,n)=>{t&&Zt.update(()=>t(e,n),!1,!0)};let Qa=!1;const tl=({layout:t,layoutDependency:e,layoutAnchor:n})=>({layout:t,layoutDependency:e,layoutAnchor:n,animationType:"string"==typeof t?t:"both"}),el=(t,e)=>{const{snapshot:n}=t,i=t.getStack();i?.remove(t);const s=i?.lead;if(i?.prevLead===t&&s.resumeFrom===t&&(s.resumeFrom=s.currentAnimation=t.resumingFrom=void 0),t.options.layoutId=e,e)return t.root.registerSharedNode(e,t),()=>{const{resumeFrom:e}=t;!1!==e?.isPresent&&t.getStack().members.includes(e)&&(e.hide(),t.resumeFrom=void 0,t.snapshot=n)};t.needsShow=!0};class nl extends m{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:i}=this.props,{projection:s}=t;s&&(e.group?.add(s),i&&n?.register?.(s),Qa&&s.root.didUpdate(),s.options.layoutId!==i&&el(s,i)?.(),s.addEventListener("animationComplete",()=>this.safeToRemove()),s.setOptions({...s.options,...tl(this.props),onExitComplete:()=>this.safeToRemove()})),ho.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,layoutId:n,visualElement:i,drag:s,isPresent:o}=this.props,{projection:r}=i;return r?(r.isPresent=o,this.takeOver=t.layoutId!==n?(r.willUpdate(),el(r,n)):void 0,r.setOptions({...r.options,...tl(this.props)}),Qa=!0,s||t.layoutDependency!==e||void 0===e||t.isPresent!==o?r.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?r.promote():r.relegate()||Zt.postRender(()=>{r.getStack()?.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(this.takeOver?.(),t.root.didUpdate(),ws.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:i}=t;Qa=!0,i&&(i.scheduleCheckAfterUnmount(),e.group?.remove(i),n?.deregister?.(i))}safeToRemove(){this.props.safeToRemove?.()}render(){return null}}function il(t){const[n,s]=function(t=!0){const e=i(Fa);if(null===e)return[!0,null];const{isPresent:n,onExitComplete:s,register:o}=e,r=p();u(()=>{if(t)return o(r)},[t]);const a=h(()=>t&&s&&s(r),[r,s,t]);return!n&&s?[!1,a]:[!0]}(),o=i(ga);return e(nl,{...t,layoutGroup:o,switchLayoutGroup:i(Xa),isPresent:n,safeToRemove:s})}const sl={pan:{Feature:class extends aa{constructor(){super(...arguments),this.removePointerDownListener=T}onPointerDown(t){this.session=new Mr(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:this.node.current?.ownerDocument.defaultView})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:Ja(t),onStart:Ja(e),onMove:Ja(n),onEnd:(t,e)=>{delete this.session,i&&Zt.postRender(()=>i(t,e))}}}mount(){this.removePointerDownListener=dr(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session?.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session?.end()}}},drag:{Feature:class extends aa{constructor(t){super(t),this.removeGroupControls=T,this.removeListeners=T,this.controls=new Xr(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||T}update(){const{dragControls:t,drag:e}=this.node.getProps(),{dragControls:n,drag:i}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls))),i&&!e&&this.controls.stop(void 0,void 0,i)}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},ProjectionNode:Ko,MeasureLayout:il}};function ol(t,e,n,i,s){const{props:o}=t,r="while"+n;!s&&t.animationState&&o[r]&&t.animationState.setActive(r,"Start"===i);const a=o["on"+n+i];a&&Zt.postRender(()=>a(e,ur(e)))}function rl(t,e,n,i){t.current instanceof HTMLButtonElement&&t.current.disabled||ol(t,e,"Tap",n,i)}const al=new WeakMap,ll=new WeakMap,hl=t=>{const e=al.get(t.target);e&&e(t)},cl=t=>{t.forEach(hl)};function ul(t,e,n){const i=function({root:t,...e}){const n=t||document;ll.has(n)||ll.set(n,{});const i=ll.get(n),s=JSON.stringify(e);return i[s]||(i[s]=new IntersectionObserver(cl,{root:t,...e})),i[s]}(e);return al.set(t,n),i.observe(t),()=>{al.delete(t),i.unobserve(t)}}const dl={some:0,all:1};const pl={inView:{Feature:class extends aa{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();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:dl[i]};this.stopObserver=ul(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(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}},tap:{Feature:class extends aa{constructor(){super(...arguments),this.options={}}mount(){const{current:t}=this.node;t&&(this.update(),this.unmount=ra(t,(t,e)=>(rl(this.node,e,"Start"),{onComplete:(t,{success:e})=>rl(this.node,t,e?"":"Cancel"),onRepeat:()=>rl(this.node,e,"",!0)}),this.options))}update(){const{options:t,node:e}=this,{globalTapTarget:n,propagate:i,tap:s}=e.props;for(const e in t)delete t[e];Object.assign(t,s,{useGlobalTarget:n,stopPropagation:!1===i?.tap})}unmount(){}}},focus:{Feature:class extends aa{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=b(Wo(this.node.current,"focus",()=>this.onFocus()),Wo(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends aa{mount(){const{current:t}=this.node;t&&(this.unmount=Jr(t,(t,e)=>(ol(this.node,e,"Hover","Start"),t=>ol(this.node,t,"Hover","End"))))}unmount(){}}}},ml={layout:{ProjectionNode:Ko,MeasureLayout:il}},fl=Object.assign({},Za,pl,sl,ml);function yl(t,e){return _a(t,e,fl,Ga)}const gl=yl("div");export{gl as MotionDiv};
//# sourceMappingURL=size-rollup-motion.js.map