UNPKG

framer-motion

Version:

A simple and powerful JavaScript animation library

3 lines • 133 kB
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,useState as p,useId as m,Component as f}from"react";function y(t,e){-1===t.indexOf(e)&&t.push(e)}function g(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const v=(t,e,n)=>n>e?e:n<t?t:n,x={},w=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),S=t=>"object"==typeof t&&null!==t,T=t=>/^0[^.\s]+$/u.test(t);const b=t=>t,P=(...t)=>t.reduce((t,e)=>n=>e(t(n))),A=(t,e,n)=>{const i=e-t;return i?(n-t)/i:1};class E{constructor(){this.subscriptions=[]}add(t){return y(this.subscriptions,t),()=>this.remove(t)}remove(t){g(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 M=t=>1e3*t,V=t=>t/1e3,k=(t,e)=>e?t*(1e3/e):0,D=(t,e,n)=>t*(3*(1-t)*((1-t)*e+t*n)+t*t);function C(t,e,n,i){return t===e&&n===i?b:s=>{let o=0,r=1,a=s;for(let e=0;;e++){a>=o&&a<=r||(a=(o+r)/2);const i=D(a,t,n)-s;if(i*i<1e-28||40===e)break;i>0?r=a:o=a,a-=1e-7*i/(D(a+1e-7,t,n)-s-i)}return D(a,e,i)}}const R=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,L=t=>e=>1-t(1-e),B=C(.33,1.53,.69,.99),F=L(B),j=R(F),I=t=>t>=1?1:(t*=2)<1?.5*F(t):.5*(2-Math.pow(2,-10*(t-1))),O=t=>1-Math.sin(Math.acos(t)),U=L(O),N=R(O),W=C(.42,0,1,1),z=C(0,0,.58,1),$=C(.42,0,.58,1),K=t=>Array.isArray(t)&&"number"==typeof t[0],Y={linear:b,easeIn:W,easeInOut:$,easeOut:z,circIn:O,circInOut:N,circOut:U,backIn:F,backInOut:j,backOut:B,anticipate:I},X=t=>{if(K(t)){const[e,n,i,s]=t;return C(e,n,i,s)}return"string"==typeof t?Y[t]:t},H={delta:0,timestamp:0,isProcessing:!1};let _;function G(){_=void 0}const Z={now:()=>(void 0===_&&Z.set(H.isProcessing||x.useManualTiming?H.timestamp:performance.now()),_),set:t=>{_=t,queueMicrotask(G)}},q=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=>v(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&&lt.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=>v(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)+", "+q(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(q(e))+", "+gt.transform(q(n))+", "+q(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?q(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,It=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},Ot=[mt,dt,Tt];function Ut(t){const e=(n=t,Ot.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=It(n.red,i.red,t),s.green=It(n.green,i.green,t),s.blue=It(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):P(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=>q(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 Zt(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=x.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:qt,cancel:Jt,steps:Qt}=Zt("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:b,!0,H),te=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>qt.update(e,t),stop:()=>Jt(e),now:()=>H.isProcessing?H.timestamp:Z.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=v(.01,10,V(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:M(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=>u?0:-V(t),p=a/(2*Math.sqrt(r*l)),m=V(Math.sqrt(r/l)),f=p*m,y={target:s,delta:s-i,velocity:d(n.velocity||0)||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=>M(x(t)),next:t=>{const e=v(t);if(c)o.done=t>=h;else{const n=M(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},toTransition:()=>{}};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:V(a)}}(t,100,pe);return t.ease=e.ease,t.duration=M(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=n||x.mix||_t,o=t.length-1;for(let n=0;n<o;n++){let o=s(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]||b:e;o=P(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=A(t[i],t[i+1],n);return a[i](s)};return n?e=>h(v(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=A(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"}){const s=(t=>Array.isArray(t)&&"number"!=typeof t[0])(i)?i.map(X):X(i)||$,o={done:!1,value:e[0]};if(2===e.length&&!Array.isArray(s)&&(!n||2!==n.length||0===n[0]&&1===n[1])){const[n,i]=e,r=n===i?void 0:(x.mix||_t)(n,i);return{calculatedDuration:t,next:e=>(o.value=r?r(s(t>0?v(0,1,e/t):1)):i,o.done=e>=t,o)}}const r=function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:ge(e),t),a=ye(r,e,{ease:Array.isArray(s)?s:(l=e,h=s,l.map(()=>h||$).splice(0,l.length-1))});var l,h;return{calculatedDuration:t,next:e=>(o.value=a(e),o.done=e>=t,o)}}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 k(n-t(i),e-i)}(e=>t.next(e).value,e,t.next(e).value)}const we=t=>null!==t;function Se(t,{repeat:e,repeatType:n="loop"},i,s=1){const o=t.filter(we),r=s<0||e&&"loop"!==n&&e%2==1?0:o.length-1;return r&&void 0!==i?i:o[r]}const Te={decay:fe,inertia:fe,tween:ve,keyframes:ve,spring:me};function be(t){"string"==typeof t.type&&(t.type=Te[t.type])}const Pe=(t,e)=>e-t>40&&!x.useManualTiming?e:t;function Ae(t,e){return{kind:t,animation:e,timestamp:Z.now(),frameTimestamp:H.timestamp,frameIsProcessing:H.isProcessing}}function Ee(t,e,n){const i=globalThis.__MOTION_INSPECT__;if(i)try{i({...Ae("animation-start",t),options:n?{...e,...n}:e})}catch{}}class Me{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 Ve=t=>t/100,ke=t=>Math.round(1e4*t)/1e4;class De extends Me{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;t&&t.updatedAt!==Z.now()&&this.tick(Z.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause(),Ee(this,this.options)}initAnimation(){const{options:t}=this;be(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;a!==ve&&"number"!=typeof r[0]&&(this.mixKeyframes=P(Ve,_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=Pe(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=Se(r,this.options,h,this.speed)),l&&l(d.value),m&&this.finish(),d}at(t){return this.holdTime??ke((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?Se(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=v(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 V(this.calculatedDuration)}get iterationDuration(){return this.duration+V(this.options.delay??0)}get time(){return V(this.currentTime)}set time(t){t=M(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(Z.now()),this.playbackSpeed=t,e&&this.driver&&(this.time=V(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(Z.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 Ce=new Set(["brightness","contrast","saturate","opacity"]);function Re(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=Ce.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+s+")"}const Le=/\b([a-z-]*)\(.*?\)/gu,Be={...Lt,getAnimatableNone:t=>{const e=t.match(Le);return e?e.map(Re).join(" "):t}},Fe={...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))}},je={...st,transform:Math.round},Ie={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,...Ie,zIndex:je,fillOpacity:ot,strokeOpacity:ot,numOctaves:je},Ue={...Oe,color:bt,backgroundColor:bt,outlineColor:bt,fill:bt,stroke:bt,borderColor:bt,borderTopColor:bt,borderRightColor:bt,borderBottomColor:bt,borderLeftColor:bt,filter:Be,WebkitFilter:Be,mask:Fe,WebkitMask:Fe},Ne=t=>Ue[t],We=new Set([Be,Fe]);function ze(t,e){let n=Ne(t);return We.has(n)||(n=Lt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const $e=t=>180*t/Math.PI,Ke=t=>{const e=$e(Math.atan2(t[1],t[0]));return Xe(e)},Ye={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:Ke,rotateZ:Ke,skewX:t=>$e(Math.atan(t[1])),skewY:t=>$e(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Xe=t=>((t%=360)<0&&(t+=360),t),He=t=>Math.hypot(t[0],t[1]),_e=t=>Math.hypot(t[4],t[5]),Ge={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:He,scaleY:_e,scaleZ:t=>Math.hypot(t[8],t[9],t[10]),scale:t=>(He(t)+_e(t))/2,rotateX:t=>Xe($e(Math.atan2(t[6],t[5]))),rotateY:t=>Xe($e(Math.atan2(-t[2],t[0]))),rotateZ:Ke,rotate:Ke,skewX:t=>$e(Math.atan(t[4])),skewY:t=>$e(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Ze(t){return t.includes("scale")?1:0}function qe(t,e){if(!t||"none"===t)return Ze(e);const n=t.match(/^matrix(3d)?\(([-\d.e\s,]+)\)$/u);if(!n)return Ze(e);const i=(n[1]?Ge:Ye)[e],s=n[2].split(",").map(t=>parseFloat(t));return"function"==typeof i?i(s):s[i]}const Je=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","scaleZ","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Qe=(()=>new Set([...Je,"pathRotation"]))(),tn=t=>t===st||t===vt,en=new Set(["x","y","z"]),nn=Je.filter(t=>!en.has(t));const sn=new Set(["bottom","right"]);function on(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 rn=({transform:t})=>qe(t,"x"),an=({transform:t})=>qe(t,"y"),ln={width:({width:t,paddingLeft:e="0",paddingRight:n="0",boxSizing:i},s)=>on(t,s,"x",e,n,i),height:({height:t,paddingTop:e="0",paddingBottom:n="0",boxSizing:i},s)=>on(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:rn,y:an,translateX:rn,translateY:an},hn=new Set;let cn=!1,un=!1,dn=!1;function pn(){if(un){const t=[],e=new Set,n=new Set;hn.forEach(i=>{i.needsMeasurement&&(t.push(i),e.add(i.element),sn.has(i.name)&&n.add(i.element))});const i=new Map;n.forEach(t=>{const e=function(t){const e=[];return nn.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)})}un=!1,cn=!1,hn.forEach(t=>t.complete(dn)),hn.clear()}function mn(){hn.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(un=!0)})}class fn{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?(hn.add(this),cn||(cn=!0,qt.read(mn),qt.resolveKeyframes(pn))):(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(w(t)||T(t))return parseFloat(t);if(!Lt.test(t)&&Lt.test(n))return ze(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),hn.delete(this)}cancel(){"scheduled"===this.state&&(hn.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}function yn(t,e,n){(t=>t.startsWith("--"))(e)?t.style.setProperty(e,n):t.style[e]=n}const gn={};function vn(t,e){const n=function(t){let e;return()=>(void 0===e&&(e=t()),e)}(t);return()=>gn[e]??n()}const xn=vn(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),wn=vn(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),Sn=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,Tn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Sn([0,.65,.55,1]),circOut:Sn([.55,0,1,.45]),backIn:Sn([.31,.01,.66,-.59]),backOut:Sn([.33,1.53,.69,.99])};function bn(t,e){return t?"function"==typeof t?wn()?ee(t,e):"ease-out":K(t)?Sn(t):Array.isArray(t)?t.map(t=>bn(t,e)||Tn.easeOut):Tn[t]:void 0}function Pn(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=bn(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 An(t){return"function"==typeof t&&"applyToOptions"in t}class En extends Me{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 An(t)&&wn()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=Pn(e,n,i,l,s),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const t=Se(i,this.options,r,this.speed);this.updateMotionValue?.(t),yn(e,n,t),this.animation.cancel()}a?.(),this.notifyFinished()},Ee(this,t,l)}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){this.isStopped||(this.isStopped=!0,"idle"!==this.state&&null===this.finishedTime&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||(this.animation.onfinish=null,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 V(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+V(t)}get time(){return V(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=M(t),e&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,onAttach:e,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&xn()?(this.animation.timeline=t,e?.(this.animation),b):n(this)}}const Mn={anticipate:I,backInOut:j,circInOut:N};function Vn(t){"string"==typeof t.ease&&t.ease in Mn&&(t.ease=Mn[t.ease])}class kn extends En{constructor(t){Vn(t),be(t),super(t),void 0!==t.startTime&&!1!==t.autoplay&&(this.startTime=t.startTime),this.options=t}elapsed(){return"running"===this.state?(Z.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 De({...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?v(0,10,o):0,a=this.sample(o);n&&i&&yn(n,i,a),e.setWithVelocity(this.sample(o-r*Math.sign(s)),a,r/Math.abs(s||1))}}const Dn=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Lt.test(t)&&"0"!==t||t.startsWith("url(")));function Cn(t){t.duration=0,t.type="keyframes"}const Rn=new Set(["opacity","clipPath","filter","transform"]),Ln=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;const Bn=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Fn=()=>!x.useManualTiming&&Object.hasOwnProperty.call(Element.prototype,"animate");function jn(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:o,type:r,keyframes:a}=t;if(!n||!Rn.has(n)&&!Bn.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 Fn()&&(Rn.has(n)||Bn.has(n)&&function(t){for(let e=0;e<t.length;e++)if("string"==typeof t[e]&&Ln.test(t[e]))return!0;return!1}(a))&&("transform"!==n||!c)&&!h&&!i&&"mirror"!==s&&0!==o&&"inertia"!==r}const In=(t,e)=>e&&"number"==typeof t?e.transform(t):t,On={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Un=Je.length,Nn={},Wn=(t,e,n=In(e,Ie[t]))=>(Nn[t]||(Nn[t]=(On[t]||t)+"("))+n+")",zn=(t,e)=>("number"==typeof e?e:parseFloat(e))===(t.startsWith("scale")?1:0);const $n=new WeakMap,Kn=.001,Yn=(t,e)=>t-e,Xn=(t,e,n)=>{const i=[];for(let s=0;s<=n;s++)i.push(jt(t,e,s/n));return i},Hn=t=>t.motionValue.owner,_n=t=>$n.get(t),Gn=(t,e)=>t.latestValues?t.latestValues[e]:t.getValue(e)?.get();class Zn extends De{constructor(t){const e=Hn(t).current,{driver:n=te}=t;let i;const s=function(t){const e=Hn(t),{onUpdate:n,transformTemplate:i}=e.getProps();return!(t.isHandoff||n||t.hasOnUpdate||i||"inertia"===t.type||"none"!==(Gn(e,"transform")||"none")||Gn(e,"pathRotation")||e.projection?.isProjecting())}(t);t.driver=t=>{const s=n(t);return{js:s,now:s.now,start:(t=!0)=>{const n=_n(e);!n||n.isJS?s.start(t):n.schedule(!1,!t)},stop:()=>{s.stop();const t=_n(e);t&&!t.isFinishing&&t.release(i)}}},super(t),i=this,this.canAccelerate=s;const{stop:o}=this;this.stop=()=>{this.isAccelerated()&&this.sync(),o()}}get group(){return _n(Hn(this.options).current)}get js(){return this.driver?.js}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(Z.now()):void 0}tween(){const{keyframes:t,type:e,ease:n,times:i,repeat:s,delay:o=0}=this.options,r=K(n)?Sn(n):(t=>/^(linear|ease(In|Out|InOut))$/.test(t))(n)&&Tn[n];if(r&&!s&&!i&&2===t.length&&e===ve&&null===this.holdTime){const t=this.startTime+o/this.speed;return[t,t+this.resolvedDuration/this.speed,r]}}boundaries(t,e){const{startTime:n,speed:i,resolvedDuration:s,options:o}=this,{delay:r=0,repeat:a=0,repeatDelay:l=0,repeatType:h,times:c,keyframes:u,type:d}=o,p=(d||ve)===ve?c||ge(u):[0,1],m=n+r/i,f=[];if(null!==this.holdTime||!(s>0))return f;for(let n=Math.max(0,Math.floor((t-m)*i/s));n<=a;n++){const o=m+n*s/i;if(o>e)break;for(const r of p){const a=o+(n%2&&h&&"loop"!==h?1-r:r)*(s-l)/i;a>t&&a<e&&f.push(a)}}return f}numberAt(t){return parseFloat(this.sampleAt(t,!0))}sync(){const t=Z.now();this.options.motionValue.setWithVelocity(this.sampleAt(t-10,!0),this.sampleAt(t,!0),10)}play(){this.isStopped||((this.group||function(t){const e=t.current,n=new Set,i=new Map;let s={},o=[],r=new Map,a=[],l=!1,h=!1,c=!1,u=!1,d=-1/0;const p=t=>{for(const e of n)if(e.name===t)return!0},m=(e,n)=>{const r={};for(const a of void 0===e?Je:o){const o=i.get(a),l=void 0===e?Gn(t,a):o?o.sampleAt(n>e&&!o.timing()[1]?n:e):s[a];void 0!==l&&(r[a]=l)}return r},f=(t,e)=>{let n="";for(const i in t){const s=t[i];e&&zn(i,s)||(n+=Wn(i,s)+" ")}return(e?n.trim():n)||"none"},y=(t,e)=>f(m(t,e)),g=(t=m())=>{e.style.transform=f(t,!0)},v=(t=!0)=>{t&&g(),a.forEach(({animation:t})=>t.cancel()),a=[]},x=(t,n)=>new Animation(new KeyframeEffect(e,t,n)),w=(t,e,n=1/0)=>{const i={animation:t,offset:e,end:n};t.startTime=Z.now()+e,n<1/0&&(t.onfinish=()=>{i.isDone=!0,a.some(t=>t.end===1/0)&&(t.cancel(),a=a.filter(t=>t!==i)),C.schedule(!1)}),t.oncancel=()=>a.includes(i)&&C.demote(),a.push(i)},S=(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]:[]},T=(t,e,n,i)=>{const s=Math.min(200,Math.max(2,Math.ceil((n-e)/10)));if(4*i.length>s)return;const o=Xn(e,n,s).concat(i).sort(Yn),r=t=>A(e,n,t);let a,l;for(const e of t){const t=o.map(t=>e.numberAt(t)),[n]=t,i=t.map(t=>t-n),s=i[i.length-1],r=i.some(t=>Math.abs(t)*Kn>Math.abs(s))?0:s,h=i.map(t=>r?t/r:t);if(r)if(a){if(h.some((t,e)=>!(Math.abs(t-a[e])<=Kn)))return}else a=h,l=t=>(e.numberAt(t)-n)/r;else if(h.some(t=>!(Math.abs(t)<=Kn)))return}if(!a||a.every((t,e)=>Math.abs(t-r(o[e]))<=Kn))return"linear";const h=[],c=(t,e=l(t))=>h.push(ke(e)+" "+ke(100*r(t))+"%");return a.forEach((t,e)=>{e&&Math.abs(t-a[e-1])>.2&&S(l,o[e-1],o[e]).forEach(t=>c(t)),c(o[e],t)}),"linear("+h+")"},b=(t,e,n,i)=>{const s=[e],o=(e,n)=>t.every(t=>!(Math.abs(t.numberAt((e+n)/2)-(t.numberAt(e)+t.numberAt(n))/2)>(t.name.startsWith("scale")?.001:.1))),r=(e,n,i)=>{if(n-e<1||o(e,n))s.push(n);else if(i<4)r(e,(e+n)/2,i+1),r((e+n)/2,n,i+1);else{for(const i of t)s.push(...S(t=>i.numberAt(t),e,n));s.push(n)}},a=Xn(e,n,Math.ceil((n-e)/100));for(const t of i)a.push(t,Math.min(t+.01,n));let l=e;for(const t of a.sort(Yn))t>l&&r(l,t,0),l=t;return s.sort(Yn)},P=t=>{let e;for(const n of t){const t=n.tween();if(!t||e?.some((e,n)=>n<2?Math.abs(t[n]-e)>1:t[n]!==e))return;e=t}return e},E=(t,e,n,i={fill:"both"},s,o)=>{const r=t.flatMap(t=>t.boundaries(e,n)),a=o||T(t,e,n,r),l=a?[e,n]:b(t,e,n,r),h=l.map(t=>y(t,s));let c={transform:h};return a||(c.offset=l.map(t=>A(e,n,t))),h.every(t=>t===h[0])&&(g(m(e,s)),c=null),x(c,{...i,duration:n-e,easing:a||"linear"})},M=e=>{let l=e,h=0,c=0;const u=[],d=[],p=new Set;i.clear(),r=new Map;for(const t of n){i.set(t.name,t);const[n,s]=t.timing(),o=n===1/0;if(r.set(t,[t.at(e),t.speed,o]),o)t.sync();else{if(t.speed<0)return;if(s){if(h){const t=(n-c)/s;if(Math.abs(s-h)>1||Math.abs(t-Math.round(t))*h>1)return}else h=s,c=n;d.push(t)}else p.add(n);u.push(t),l=Math.max(l,n)}}s={},o=Je.filter(e=>{if(i.has(e))return!0;const n=s[e]=Gn(t,e);return void 0!==n&&parseFloat(n)!==(e.startsWith("scale")?1:0)}),v(!1);const m=!h&&P(u);try{if(m&&m[1]>e){const[t,n,i]=m;w(E(u,t,n,void 0,void 0,i),t-e,n-t)}else l>e&&(w(E(u,e,l),0,l-e),p.forEach(t=>t<l-1&&w(x(null,{duration:t-e}),0,t-e)));if(h){const t=c+Math.floor((l-c)/h)*h;w(E(d,t,t+h,{iterations:1/0,iterationStart:(l-t)/h,fill:"forwards"},l),l-e)}}catch{return}return a.length||v(),!0},V=t=>{let e,i=0;for(const s of n){const n=r.get(s);if(!n)return!1;const[o,a,l]=n,h=s.at(t),c=s.timing()[0]===1/0;if(l){if(c&&h===o)continue;return!1}const u=(h-o)/a,d=c?0:s.speed/a;if(void 0===e)e=u,i=d;else if(Math.abs(u-e)>1||d!==i)return!1}if(void 0===e)return!0;if(!a.length)return!1;for(const{offset:t,end:n,isDone:i}of a){const s=e-t;if(n<1/0&&(i?s<n-1:s<0||s>=n))return!1}for(const{animation:n,offset:s,isDone:o}of a){if(o)continue;const r=e-s;i&&n.updatePlaybackRate&&"running"===n.playState&&Math.abs(Number(n.currentTime)-r)<20?n.playbackRate!==i&&n.updatePlaybackRate(i):i?(n.playbackRate=i,n.startTime=t-r/i):(n.startTime=null,n.currentTime=r)}return!0},k=()=>!n.size&&(c=!0,_n(e)===C&&$n.delete(e),C.isJS||v(),!0),D=()=>{const e=Z.now();if(C.isJS||(C.isFinishing=!0,n.forEach(n=>{const[i,o]=n.timing();"running"===n.state&&n.speed>0&&!o&&i<=e+1&&(n.complete(),s[n.name]=Gn(t,n.name),r.has(n)||(l=!0))}),C.isFinishing=!1),h=!1,c)return;if(n.forEach(({state:t},e)=>{"idle"!==t&&"finished"!==t||n.delete(e)}),k())return;for(const t of n)if(!t.canAccelerate)return C.demote(!0);C.isJS&&(C.isJS=!1,l=!0,n.forEach(t=>t.js?.stop()));const i=l,o=u;if(l=u=!1,i||!V(e)){if(o){if(e-d<100)return C.demote();d=e}if(!M(e))return C.demote()}},C={tracks:n,isJS:!1,isFinishing:!1,schedule(t,e){c||(l||(l=t),u||(u=!!e),h||(h=!0,H.isProcessing?qt.render(D,!1,!0):queueMicrotask(D)))},release(t){const{state:e}=t;"idle"!==e&&"finished"!==e||n.delete(t),k()||C.schedule(!0)},check(){if(!C.isJS)for(const e in s)if(Gn(t,e)!==s[e]&&!p(e))return C.schedule(!0,!0)},demote(t){if(!C.isJS&&!c)return n.forEach(e=>{e.isAccelerated()&&e.sync(),t||(e.canAccelerate=!1)}),C.isJS=!0,r=new Map,v(),n.forEach(t=>"running"===t.state&&t.js?.start()),!0}};return $n.set(e,C),C}(Hn(this.options))).tracks.add(this),super.play())}pause(){super.pause(),this.isAccelerated()&&(this.sync(),this.group.schedule(!1))}complete(){super.complete();const{group:t}=this;t&&!t.isJS&&this.canAccelerate&&this.tick(Z.now())}get time(){return this.isAccelerated()?V(v(0,this.totalDuration,this.at(Z.now())-(this.options.delay||0))):super.time}set time(t){super.time=t,this.isAccelerated()&&this.sync()}attachTimeline(t){return this.canAccelerate=!1,this.group?.demote(!0),super.attachTimeline(t)}}class qn extends Me{constructor(t){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Z.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||fn;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=Z.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=Dn(s,e),a=Dn(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||An(n))&&i)}(t,s,o,r);c||(!x.instantAnimations&&a||h?.(Se(t,n,e)),t[0]=t[t.length-1],Cn(n),n.repeat=0);const{onComplete:u}=n;n.finalKeyframe=e,n.keyframes=t,n.onComplete=()=>{u?.(),this.notifyFinished()};const d=c&&!l&&jn(n),p=!d&&(({name:t,motionValue:e})=>t&&Je.includes(t)&&e?.owner?.current instanceof HTMLElement&&Fn()&&wn())(n);let m;if(i&&(d||p||this.resolvedAt!==this.createdAt)&&(n.startTime??(n.startTime=Pe(this.createdAt,this.resolvedAt))),d){n.element=n.motionValue?.owner?.current;try{m=new kn(n)}catch{m=new De(n)}}else m=p?new Zn(n):new De(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(),dn=!0,mn(),pn(),dn=!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 Jn(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 Qn{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=Z.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=Z.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 E)).add(e)}onChangeSubscribe(t){const{events:e}=this;return e.change||this.changeSubscriber?(e.change||(e.change=new E,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(){qt.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){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),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=Z.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return k(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{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 ti(t,e){return new Qn(t,e)}function ei(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}function ni(t,e){const n=t?.[e]??t?.default??t;return n!==t?ei(n,t):n}const ii={type:"spring",stiffness:500,damping:25,restSpeed:10},si={type:"keyframes",duration:.8},oi={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ri=(t,{keyframes:e})=>e.length>2?si:Qe.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:ii:oi,ai=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed","out"]);const li=(t,e,n,i={},s,o)=>r=>{const a=ni(i,t)||{},l=a.delay||i.delay||0;let{elapsed:h=0}=i;h-=M(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(!ai.has(e))return!0;return!1})(a)||Object.assign(c,ri(t,c)),c.duration&&(c.duration=M(c.duration)),c.repeatDelay&&(c.repeatDelay=M(c.repeatDelay)),void 0!==c.from&&(c.keyframes[0]=c.from);let u=!1;if((!1===c.type||0===c.duration&&!c.repeatDelay)&&(Cn(c),0===c.delay&&(u=!0)),(x.instantAnimations||x.skipAnimations||s?.shouldSkipAnimations||a.skipAnimations)&&(u=!0,Cn(c),c.delay=0),c.allowFlatten=!a.type&&!a.ease,u&&!o&&void 0!==e.get()){const t=Se(c.keyframes,a);if(void 0!==t)return void qt.update(()=>{c.onUpdate(t),c.onComplete()})}return a.isSync?new De(c):new qn(c)},hi=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ci(t,e,n=1){const[i,s]=function(t){const e=hi.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 w(t)?parseFloat(t):t}return et(s)?ci(s,e,n+1):s}function ui(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 di(t,e,n){return ui(t.getProps(),e,n,t)}const pi=(t,e)=>"exit"===e?t.presenceContext?.custom:void 0,mi=new Set(["width","height","top","left","right","bottom",...Je]);function fi(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,ti(n))}function yi(t){return(t=>Array.isArray(t))(t)?t[t.length-1]||0:t}const gi=t=>Boolean(t&&t.getVelocity);function vi(t,e){const n=t.getValue("willChange");if(i=n,Boolean(gi(i)&&i.add))return n.add(e);if(!n&&x.WillChange){const n=new x.WillChange("auto");t.addValue("willChange",n),n.add(e)}var i}const xi="data-framer-appear-id";function wi(t){return t.props[xi]}const Si="undefined"!=typeof window;function Ti({protectedKeys:t,needsAnimating:e},n){const i=n in t&&!e[n];return e[n]=!1,i}function bi(t,e,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:o,transitionEnd:r,...a}=e;const l=t.getDefaultTransition();o=o?ei(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&&Ti(d,e))continue;const r={delay:n,...ni(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){qt.update(()=>i.set(s));continue}let p=!1;if(Si&&window.MotionHandoffAnimation){const n=wi(t);if(n){const t=window.MotionHandoffAnimation(n,e,qt);null!==t&&(r.startTime=t,p=!0)}}vi(t,e);const m=h??t.shouldReduceMotion;i.start(li(e,i,s,m&&mi.has(e)?{type:!1}:r,t,p));const f=i.animation;f&&u.push(f)}if(r){const e=()=>qt.update(()=>{r&&function(t,e){const n=di(t,e);let{transitionEnd:i={},transition:s={},...o}=n||{};o={...o,...i};for(const e in o)fi(t,e,yi(o[e]))}(t,r)});u.length?Promise.all(u).then(e):e()}return u}function Pi(t,e,n={}){const i=di(t,e,pi(t,n.type)),s=n.transitionOverride||(i?.transition??(t.getDefaultTransition()||{})),o=()=>Promise.all(i?bi(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(Pi(t,e,{...n,delay:i+("function"==typeof r?0:r)+Jn(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 Ai=[st,vt,gt,yt,wt,xt,{test:t=>"auto"===t,parse:t=>t}],Ei=t=>Ai.find((t=>e=>e.test(t))(t));function Mi(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||T(t))}const Vi=new Set(["auto","none","0"]);class ki extends fn{constructor(){super(...arguments),this.isAsync=!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=ci(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=Ei(i),r=Ei(s);if(it(i)!==it(s)&&ln[n])this.needsMeasurement=!0;else if(o!==r)if(tn(o)&&tn(r))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else ln[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)(null===t[e]||Mi(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&&!Vi.has(e)&&kt(e)&&(i=t[s]),s++}if(i&&n)for(const s of e)t[s]!==i&&(t[s]=ze(n,i))}(t,n,e)}measure(){const{element:t,name:e}=this;return ln[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 Di=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function Ci(t){return S(t)&&"ownerSVGElement"in t}const Ri={};function Li(t){return Ri.current?.add(t),t}const Bi=t=>Ri.current?Ri.current.bind(t):t;function Fi(t,e,n){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){const i=e?e.current:Ri.current?.root||document,s=n?.[t]??i.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t).filter(t=>null!=t)}function ji(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}function Ii(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(Qe.has(t))r=!0;else if(Q(t))s[t]=n;else{const e=In(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<Un;s++){const o=Je[s],r=t[o];if(void 0===r)continue;const a=n&&(e[o]=In(r,Oe[o]));zn(o,r)||(i+=Wn(o,r,a||void 0)+" ")}const s=t.pathRotation;return s&&(i+=Wn("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 Oi={offset:"stroke-dashoffset",array:"stroke-dasharray"},Ui={offset:"strokeDashoffset",array:"strokeDasharray"};const Ni=["transform","opacity","clipPath","filter","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Wi(t,{attrX:e,attrY:n,attrScale:i,pathLength:s,pathSpacing:o=1,pathOffset:r=0,...a},l,h,c){if(Ii(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 Ni)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?Oi:Ui;t[o.offset]=""+-i,t[o.array]=`${e} ${n}`}(u,s,o,r,!1)}function zi({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function $i(t){return void 0===t||1===t}function Ki({scale:t,scaleX:e,scaleY:n}){return!$i(t)||!$i(e)||!$i(n)}const Yi=["rotate","rotateX","rotateY","rotateZ","skewX","skewY"];function Xi(t){return Ki(t)||_i(t)||Hi(t)}function Hi(t){return t.z||t.rotate||t.rotateX||t.rotateY||t.rotateZ||t.skewX||t.skewY}function _i(t){return Gi(t.x)||Gi(t.y)}function Gi(t){return t&&"0%"!==t}function Zi(t,e,n){return n+e*(t-n)}function qi(t,e,n,i,s){return void 0!==s&&(t=Zi(t,s,i)),Zi(t,n,i)+e}function Ji(t,e=0,n=1,i,s){t.min=qi(t.min,e,n,i,s),t.max=qi(t.max,e,n,i,s)}function Qi(t,{x:e,y:n}){Ji(t.x,e.translate,e.scale,e.originPoint),Ji(t.y,n.translate,n.scale,n.originPoint)}const ts=.999999999999,es=1.0000000000001;function ns(t,e){t.min+=e,t.max+=e}function is(t,e,n,i,s=.5){Ji(t,e,n,jt(t.min,t.max,s),i)}function ss(t,e){return"string"==typeof t?parseFloat(t)/100*(e.max-e.min):t}function os(t,e,n){const i=n??t;is(t.x,ss(e.x,i.x),e.scaleX,e.scale,e.originX),is(t.y,ss(e.y,i.y),e.scaleY,e.scale,e.originY)}function rs(t,e){return zi(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:as}=Zt(queueMicrotask,!1);const ls={};function hs(t){return gi(t)?t.get():t}const cs=t=>"number"==typeof t?t:parseFloat(t),us=Di.length,ds=t=>"number"==typeof t||vt.test(t);function ps(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const ms=ys(0,.5,U),fs=ys(.5,.95,b);function ys(t,e,n){return i=>i<t?0:i>e?1:n(A(t,e,i))}function gs(t,e){t.min=e.min,t.max=e.max}function vs(t,e){gs(t.x,e.x),gs(t.y,e.y)}function xs(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function ws(t){return t.max-t.min}function Ss(t,e,n,i=.5){t.origin=i,t.originPoint=jt(e.min,e.max,t.origin),t.scale=ws(n)/ws(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 Ts(t,e,n,i){Ss(t.x,e.x,n.x,i?.originX),Ss(t.y,e.y,n.y,i?.originY)}function bs(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+ws(e)}function Ps(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+ws(e)}function As(t,e,n,i){Ps(t.x,e.x,n.x,i?.x),Ps(t.y,e.y,n.y,i?.y)}function Es(t,e,n,i,s){return t=Zi(t-=e,1/n,i),void 0!==s&&(t=Zi(t,1/s,i)),t}function Ms(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=Es(t.min,e,n,a,s),t.max=Es(t.max,e,n,a,s)}(t,e[n],e[i],e[s],e.scale,o,r)}const Vs=["x","scaleX","originX"],ks=["y","scaleY","originY"];function Ds(t,e,n,i){Ms(t.x,e,Vs,n?.x,i?.x),Ms(t.y,e,ks,n?.y,i?.y)}const Cs=()=>({x:{min:0,max:0},y:{min:0,max:0}});function Rs(t){return 0===t.translate&&1===t.scale}function Ls(t){return Rs(t.x)&&Rs(t.y)}function Bs(t,e){return t.min===e.min&&t.max===e.max}function Fs(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function js(t,e){return Fs(t.x,e.x)&&Fs(t.y,e.y)}function Is(t){return ws(t.x)/ws(t.y)}function Os(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class Us{constructor(){this.members=[]}add(t){y(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||(g(this.members,n),n.unmount())}t.scheduleRender()}remove(t){if(g(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 Ns(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Ws={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!vt.test(t))return t;t=parseFloat(t)}return`${Ns(t,e.target.x)}% ${Ns(t,e.target.y)}%`}},zs={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)}},$s={borderRadius:Object.assign({},Ws,{applyTo:Di.slice()}),borderTopLeftRadius:Ws,borderTopRightRadius:Ws,borderBottomLeftRadius:Ws,borderBottomRightRadius:Ws,boxShadow:zs};function Ks(t){return[t("x"),t("y")]}const Ys=(t,e)=>t.depth-e.depth;class Xs{constructor(){this.children=[],this.isDirty=!1}add(t){y(this.children,t),this.isDirty=!0}remove(t){g(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Ys),this.isDirty=!1,this.children.forEach(t)}}const Hs={hasAnimatedSinceResize:!0,hasEverUpdated:!1},_s=["z","skew","skewZ"];let Gs=0;function Zs(t,e,n,i){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),i&&(i[t]=0))}const qs=t=>t.instance&&$n.get(t.instance)?.demote()&&t.resetSkewAndRotation();function Js(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=wi(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:e,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",qt,!(e||i))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&Js(i)}function Qs({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:s}){return Object.assign(ls,{...$s,...ls}),class{constructor(t={},n=e?.()){this.id=Gs++,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(no),this.nodes.forEach(po),this.nodes.forEach(mo),this.nodes.forEach(io)},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 Xs)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new E),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=Ci(e)&&!(Ci(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;qt.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=Z.now();t=Bi(t);const i=({timestamp:s})=>{const o=s-n;o>=e&&(Jt(i),t(o-e))};return qt.setup(i,!0),Li(()=>Jt(i))}(s,250),Hs.hasAnimatedSinceResize&&(Hs.hasAnimatedSinceResize=!1,this.nodes.forEach(uo)))})}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()||xo,{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={...ni(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||uo(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(fo),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&&Js(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;qs(this),this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){const e=this.path[t];e.shouldResetTransform=!0,qs(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(ro),void this.nodes.forEach(oo)}if(this.animationId<=this.animationCommitId)return void this.nodes.forEach(ao);this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(lo),this.nodes.forEach(ho),this.nodes.forEach(co),this.nodes.forEach(to),this.nodes.forEach(eo)):this.nodes.forEach(ao),this.clearAllSnapshots();const t=Z.now();H.delta=v(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,as.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(so),this.sharedNodes.forEach((t,e)=>t.members.length?t.removeLeadSnapshot():this.sharedNodes.delete(e))}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,qt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){qt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||ws(this.snapshot.measuredBox.x)||ws(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;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&&qs(this);const e=this.projectionDelta&&!Ls(this.projectionDelta),n=this.getTransformTemplate(),i=n?n(this.latestValues,""):void 0,o=i!==this.prevTransformTemplateValue;t&&this.instance&&(e||Xi(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)),To((i=n).x),To(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(Ao))){const{scroll:t}=this.root;t&&(ns(e.x,t.offset.x),ns(e.y,t.offset.y))}return e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};if(vs(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&&vs(e,t),ns(e.x,s.offset.x),ns(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}};vs(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&&(ns(o.x,-n.scroll.offset.x),ns(o.y,-n.scroll.offset.y)),Xi(n.latestValues)&&os(o,n.latestValues,n.layout?.layoutBox)}return!i&&Xi(this.latestValues)&&os(o,this.latestValues,this.layout?.layoutBox),o}removeTransform(t){const e={x:{min:0,max:0},y:{min:0,max:0}};vs(e,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];if(!Xi(n.latestValues))continue;let i;n.instance&&(Ki(n.latestValues)&&n.updateSnapshot(),i=Cs(),vs(i,n.measurePageBox())),Ds(e,n.latestValues,n.snapshot?.layoutBox,i)}return Xi(this.latestValues)&&Ds(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,bs(r.x,a.x,l.x,h?.x),bs(r.y,a.y,l.y,h?.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.applyTransform(this.layout.layoutBox,!1,this.target,!0):vs(this.target,this.layout.layoutBox),Qi(this.target,this.targetDelta)):vs(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&&!Ki(this.parent.latestValues)&&!_i(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}},As(this.relativeTargetOrigin,e,n,this.options.layoutAnchor||void 0),vs(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;vs(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&&(ns(t.x,-o.scroll.offset.x),ns(t.y,-o.scroll.offset.y)),r&&(e.x*=r.x.scale,e.y*=r.y.scale,Qi(t,r)),i&&(i.path?.[a]||i)!==o&&Xi(o.latestValues)&&os(t,o.latestValues,o.layout?.layoutBox));e.x<es&&e.x>ts&&(e.x=1),e.y<es&&e.y>ts&&(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?(xs(this.prevProjectionDelta.x,this.projectionDelta.x),xs(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),Ts(this.projectionDelta,this.layoutCorrected,a,this.latestValues),this.treeScale.x===o&&this.treeScale.y===r&&Os(this.projectionDelta.x,this.prevProjectionDelta.x)&&Os(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(vo));let d;this.animationProgress=0;const p=n?.interpolateProjection(t);this.mixTargetDelta=e=>{const n=e/1e3,i=p?.(n);var h,m,f,y,g,v;yo(r.x,t.x,n),yo(r.y,t.y,n),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&&(As(a,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),f=this.relativeTarget,y=this.relativeTargetOrigin,g=a,v=n,go(f.x,y.x,g.x,v),go(f.y,y.y,g.y,v),d&&(h=this.relativeTarget,m=d,Bs(h.x,m.x)&&Bs(h.y,m.y))&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),vs(d,this.relativeTarget)),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,fs(i))):o&&(t.opacity=jt(e.opacity??1,n.opacity??1,i));for(let s=0;s<us;s++){const o=Di[s];let r=ps(e,o),a=ps(n,o);void 0===r&&void 0===a||(r||(r=0),a||(a=0),0===r||0===a||ds(r)===ds(a)?(t[o]=Math.max(jt(cs(r),cs(a),i),0),(gt.test(a)||gt.test(r))&&(t[o]+="%")):t[o]=a)}for(let s=0;s<Yi.length;s++){const o=Yi[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"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Jt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=qt.update(()=>{Hs.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=ti(0)),this.motionValue.jump(0,!1),this.currentAnimation=function(t,e,n){const i=gi(t)?t:ti(t);return i.start(li("",i,e,n)),i.animation}(this.motionValue,[0,1e3],{...t,velocity:0,isSync:!0,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onComplete:()=>{t.onComplete&&t.onComplete(),this.completeAnimation()}}),function(t,e){const n=globalThis.__MOTION_INSPECT__;if(n)try{n({...Ae("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=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(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&&Po(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}},bo(s.x,e.x,t.x),bo(s.y,e.y,t.y)}vs(e,s),os(e,i),Ts(this.projectionDeltaWithTransform,this.layoutCorrected,e,i)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new Us);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(!Hi(e))return;const n={};for(let e=0;e<_s.length;e++)Zs(_s[e],t,n,this.animationValues);for(let e=0;e<Yi.length;e++)Zs(Yi[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=hs(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=hs(e?.pointerEvents)||""),void(this.hasProjected&&!Xi(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;if((s||o||r)&&(i=`translate3d(${s}px, ${o}px, ${r}px) `),1===e.x&&1===e.y||(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:t}=n;t&&(i=`perspective(${t}px) ${i}`);for(let t=0;t<Yi.length;t++){const e=Yi[t],s=n[e];s&&(i+=`${e}(${s}deg) `),!t&&n.pathRotation&&(i+=`rotate(${n.pathRotation}deg) `)}}const a=t.x.scale*e.x,l=t.y.scale*e.y;return 1===a&&1===l||(i+=`scale(${a}, ${l})`),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 ls){if(void 0===s[e])continue;const{correct:i,applyTo:r,isCSSVariable:a}=ls[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?hs(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(oo),this.root.sharedNodes.clear()}}}function to(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;Ks(t=>ns(e.layoutBox[t],i.layoutBox[t].min-s.layoutBox[t].min))}(t)}function eo(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)Ks(t=>{const e=ws(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";gs(i[t],o[t])}else Po(s,e.layoutBox,n)&&Ks(e=>{const n=ws(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}};Ts(l,n,e.layoutBox);const h={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};Ts(h,o?t.applyTransform(i,!0):n,a);const c=!Ls(l);let u=!1;const d=t.getClosestProjectingParent();if((!t.resumeFrom||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}};As(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}};As(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 no(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 io(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function so(t){t.clearSnapshot()}function oo(t){t.clearMeasurements()}function ro(t){t.isLayoutDirty=!0,t.updateLayout()}function ao(t){t.isLayoutDirty=!1}function lo(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.dragSnapshot||t.layout,t.isLayoutDirty=!0)}function ho(t){t.relativeTarget&&t.relativeParent?.isLayoutDirty&&(t.currentAnimation?t.isLayoutDirty=!0:(t.targetDelta=void 0,t.removeRelativeTarget()))}function co(t){const{visualElement:e}=t.options;e?.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function uo(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function po(t){t.resolveTargetDelta()}function mo(t){t.calcProjection()}function fo(t){t.resetSkewAndRotation()}function yo(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 go(t,e,n,i){t.min=jt(e.min,n.min,i),t.max=jt(e.max,n.max,i)}function vo(t){return void 0!==t.animationValues?.opacityExit}const xo={duration:.45,ease:[.4,0,.1,1]},wo=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),So=wo("applewebkit/")&&!wo("chrome/")?Math.round:b;function To(t){t.min=So(t.min),t.max=So(t.max)}function bo(t,e,n){t.max=ws(n)+(t.min=e.min)}function Po(t,e,n){return"position"===t||"preserve-aspect"===t&&(i=Is(e),s=Is(n),o=.2,!(Math.abs(i-s)<=o));var i,s,o}function Ao(t){return t!==t.root&&t.scroll?.wasRoot}function Eo(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n,i)}const Mo=Qs({attachResizeListener:(t,e)=>Eo(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Vo={current:void 0},ko=Qs({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Vo.current){const t=new Mo({});t.mount(window),t.setOptions({layoutScroll:!0}),Vo.current=t}return Vo.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>"fixed"===window.getComputedStyle(t).position}),Do=new WeakMap;function Co(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function Ro(t){return"string"==typeof t||Array.isArray(t)}const Lo=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Bo=["initial"].concat(Lo);function Fo(t){if(Co(t.animate))return!0;for(let e=0;e<Bo.length;e++)if(Ro(t[Bo[e]]))return!0;return!1}function jo(t){return Boolean(Fo(t)||t.variants)}const Io={current:null},Oo={current:!1},Uo="undefined"!=typeof window;const No=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Wo={};function zo(t){Wo=t}class $o{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=fn,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=Z.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,qt.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=Fo(e),this.isVariantNode=jo(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]&&gi(e)&&e.set(l[t])}}mount(t){if(this.hasBeenMounted)for(const t in this.initialValues)this.values.get(t)?.jump(this.initialValues[t]),this.latestValues[t]=this.initialValues[t];if(this.current=t,Do.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:(Oo.current||function(){if(Oo.current=!0,Uo)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Io.current=t.matches;t.addEventListener("change",e),e()}else Io.current=!1}(),this.shouldReduceMotion=Io.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&&Rn.has(t)&&this.current instanceof HTMLElement){const{factory:n,keyframes:i,times:s,ease:o,duration:r}=e.accelerate,a=new En({element:this.current,name:t,keyframes:i,times:s,ease:o,duration:M(r)}),l=n(a);return void this.valueSubscriptions.set(t,()=>{l(),a.cancel()})}const n=Qe.has(t);n&&this.onBindTransform&&this.onBindTransform();const i=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&qt.preRender(this.notifyUpdate),n&&(this.projection&&(this.projection.isTransformDirty=!0),$n.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 Wo){const e=Wo[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)&&$n.get(this.current)?.demote(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<No.length;e++){const n=No[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(gi(s))t.addValue(i,s);else if(gi(o))t.addValue(i,ti(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,ti(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=ti(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&&(w(n)||T(n))?n=parseFloat(n):"number"!=typeof n&&!Lt.test(n)&&Lt.test(e)&&(n=ze(t,e)),this.setBaseTarget(t,gi(n)?n.get():n)),gi(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}on(t,e){return(this.events[t]||(this.events[t]=new E)).add(e)}notify(t,...e){this.events[t]?.notify(...e)}scheduleRenderMicrotask(){as.render(this.render)}}class Ko extends $o{constructor(){super(...arguments),this.KeyframeResolver=ki}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;gi(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}function Yo(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 Xo(t,{layout:e,layoutId:n}){return Qe.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!ls[t]||"opacity"===t)}function Ho(t,e,n){const i=t.style,s=e?.style,o={};if(!i)return o;for(const e in i)(gi(i[e])||s&&gi(s[e])||Xo(e,t)||void 0!==n?.getValue(e)?.liveStyle)&&(o[e]=i[e]);return o}class _o extends Ko{constructor(){super(...arguments),this.type="html",this.renderInstance=Yo}mount(t){super.mount(t)}readValueFromInstance(t,e){if(Qe.has(e))return this.projection?.isProjecting?Ze(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 rs(t,e)}build(t,e,n){Ii(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return Ho(t,e,n)}}const Go=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary;function Zo(t){return{point:{x:t.pageX,y:t.pageY}}}function qo(t,e,n,i){return Eo(t,e,(t=>e=>Go(e)&&t(e,Zo(e)))(n),i)}const Jo=new WeakMap;let Qo;const tr=(t,e,n)=>(i,s)=>s&&s[0]?s[0][t+"Size"]:Ci(i)&&"getBBox"in i?i.getBBox()[e]:i[n],er=tr("inline","width","offsetWidth"),nr=tr("block","height","offsetHeight");function ir({target:t,borderBoxSize:e}){Jo.get(t)?.forEach(n=>{n(t,{get width(){return er(t,e)},get height(){return nr(t,e)}})})}function sr(t){t.forEach(ir)}function or(t,e){Qo||"undefined"!=typeof ResizeObserver&&(Qo=new ResizeObserver(sr));const n=Fi(t);return n.forEach(t=>{let n=Jo.get(t);n||(n=new Set,Jo.set(t,n)),n.add(e),Qo?.observe(t)}),()=>{n.forEach(t=>{const n=Jo.get(t);n?.delete(e),n?.size||Qo?.unobserve(t)})}}const rr=new Set;let ar;function lr(t){return rr.add(t),ar||(ar=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};rr.forEach(e=>e(t))},window.addEventListener("resize",ar)),()=>{rr.delete(t),rr.size||"function"!=typeof ar||(window.removeEventListener("resize",ar),ar=void 0)}}function hr(t,e){return Li("function"==typeof t?lr(t):or(t,e))}const cr=(t,e)=>Math.abs(t-e);const ur=new Set(["auto","scroll"]);class dr{constructor(t,e,{transformPagePoint:n,contextWindow:i=window,dragSnapToOrigin:s=!1,distanceThreshold:o=3,element:r}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.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=mr(this.lastRawMoveEventInfo,this.transformPagePoint));const t=yr(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=function(t,e){const n=cr(t.x,e.x),i=cr(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:Z.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=mr(e,this.transformPagePoint),this.hasPendingMove=!0,qt.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=yr("pointercancel"===t.type?this.lastMoveEventInfo:mr(e,this.transformPagePoint),this.history);this.startEvent&&n?.(t,o),i?.(t,o)},!Go(t))return;this.dragSnapToOrigin=s,this.handlers=e,this.transformPagePoint=n,this.distanceThreshold=o,this.contextWindow=i||window;const a=mr(Zo(t),this.transformPagePoint),{point:l}=a;this.history=[{...l,timestamp:Z.now()}];const{onSessionStart:h}=e;h&&h(t,yr(a,this.history));const c={passive:!0,capture:!0};this.removeListeners=P(qo(this.contextWindow,"pointermove",this.handlePointerMove,c),qo(this.contextWindow,"pointerup",this.handlePointerUp,c),qo(this.contextWindow,"pointercancel",this.handlePointerUp,c)),r&&this.startScrollTracking(r)}startScrollTracking(t){let e=t.parentElement;for(;e;){const t=getComputedStyle(e);(ur.has(t.overflowX)||ur.has(t.overflowY))&&this.scrollPositions.set(e,pr(e)),e=e.parentElement}this.scrollPositions.set(window,pr(window)),this.removeScrollListeners=P(Eo(window,"scroll",this.onElementScroll,{capture:!0}),Eo(window,"scroll",this.onWindowScroll,{}))}handleScroll(t){const e=this.scrollPositions.get(t);if(!e)return;const n=t===window,i=pr(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),qt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners?.(),this.removeScrollListeners?.(),this.scrollPositions.clear(),Jt(this.updatePoint)}}const pr=t=>t===window?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop};function mr(t,e){return e?{point:e(t.point)}:t}function fr(t,e){return{x:t.x-e.x,y:t.y-e.y}}function yr({point:t},e){return{point:t,delta:fr(t,vr(e)),offset:fr(t,gr(e)),velocity:xr(e,.1)}}function gr(t){return t[0]}function vr(t){return t[t.length-1]}function xr(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const s=vr(t);for(;n>=0&&(i=t[n],!(s.timestamp-i.timestamp>M(e)));)n--;if(!i)return{x:0,y:0};i===t[0]&&t.length>2&&s.timestamp-i.timestamp>2*M(e)&&(i=t[1]);const o=V(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 wr=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const Sr=new Set(["INPUT","SELECT","TEXTAREA"]);const Tr={x:!1,y:!1};function br(){return Tr.x||Tr.y}function Pr(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 Ar(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 Er=.35;function Mr(t,e,n){return{min:Vr(t,e),max:Vr(t,n)}}function Vr(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 Dr=new WeakMap;class Cr{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,{snapToCursor:e=!1,distanceThreshold:n}={}){if(!1===this.visualElement.presenceContext?.isPresent)return;const{dragSnapToOrigin:i}=this.getProps();this.panSession=new dr(t,{onSessionStart:t=>{e&&this.snapToCursor(t),this.stopAnimation()},onStart:(t,e)=>{const{drag:n,dragPropagation:i,onDragStart:s}=this.getProps();if(n&&!i&&(this.openDragLock?.(),this.openDragLock="x"===(o=n)||"y"===o?Tr[o]?null:(Tr[o]=!0,()=>{Tr[o]=!1}):Tr.x||Tr.y?null:(Tr.x=Tr.y=!0,()=>{Tr.x=Tr.y=!1}),!this.openDragLock))return;var o;this.latestPointerEvent=t,this.latestPanInfo=e,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints();const{projection:r}=this.visualElement;r&&(r.isAnimationBlocked=!0,r.target=void 0),Ks(t=>{let e=this.getAxisMotionValue(t).get()||0;if(et(e)&&(e=ci(e,this.visualElement.current)||0),vt.test(e))e=parseFloat(e);else if(gt.test(e)){const n=r?.layout?.layoutBox[t];n&&(e=ws(n)*(parseFloat(e)/100))}this.originPoint[t]=e}),s&&qt.update(()=>s(t,e),!1,!0),vi(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.visualElement.render(),o&&qt.update(()=>o(t,e),!1,!0)},onSessionEnd:(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e,this.stop(t,e),this.latestPointerEvent=null,this.latestPanInfo=null},resumeAnimation:()=>{const{dragSnapToOrigin:t}=this.getProps();(t||this.constraints)&&this.startAnimation({x:0,y:0})}},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:i,distanceThreshold: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&&qt.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||!Fr(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])),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;Rr(t)?this.constraints&&this.scroll===kr(n)||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!i)&&function(t,{top:e,left:n,bottom:i,right:s}){return{x:Pr(t.x,n,s),y:Pr(t.y,e,i)}}(i.layoutBox,t),this.elastic=function(t=Er){return!1===t?t=0:!0===t&&(t=Er),{x:Mr(t,"left","right"),y:Mr(t,"top","bottom")}}(e),s!==this.constraints&&!Rr(t)&&i&&this.constraints&&!this.hasMutatedConstraints&&Ks(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(!Rr(t))return!1;const n=Lr(t),{projection:i}=this.visualElement;if(!i||!i.layout)return!1;this.scroll=kr(i);const s=function(t,e,n){const i=rs(t,n),{scroll:s}=e;return s&&(ns(i.x,s.offset.x),ns(i.y,s.offset.y)),i}(n,i.root,this.visualElement.getTransformPagePoint());let o=function(t,e){return{x:Ar(t.x,e.x),y:Ar(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=zi(t))}return o}startAnimation(t,e){const{drag:n,dragMomentum:i,dragElastic:s,dragTransition:o,dragSnapToOrigin:r,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},h=Ks(a=>{if(!Fr(a,e||n,this.currentDirection))return;let h=l[a]||{};!0!==r&&r!==a||(h={min:0,max:0});const c=s?200:1e6,u=s?40:1e7,d={type:"inertia",velocity:i?t[a]:0,bounceStiffness:c,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...o,...h};return this.startAxisValueAnimation(a,d)});return Promise.all(h).then(a)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return vi(this.visualElement,t),n.start(li(t,n,0,e,this.visualElement,!1))}stopAnimation(){Ks(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();Ks(t=>{if(!Fr(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(!Rr(e)||!n||!this.constraints)return;this.stopAnimation();const i=this.constraints,s={x:0,y:0};Ks(t=>{const e=this.getAxisMotionValue(t).get();s[t]=function(t,e){let n=.5;const i=ws(t),s=ws(e);return s>i?n=A(e.min,e.max-i,t.min):i>s&&(n=A(t.min,t.max-s,e.min)),v(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(),Ks(e=>{const n=this.getAxisMotionValue(e);if(!Fr(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;Dr.set(this.visualElement,this);const t=this.visualElement.current,e=qo(t,"pointerdown",e=>{const{drag:n,dragListener:i=!0}=this.getProps(),s=e.target,o=s!==t&&function(t){return Sr.has(t.tagName)||!0===t.isContentEditable}(s);n&&i&&!o&&this.start(e)});let n;const i=()=>{const{dragConstraints:e}=this.getProps(),i=Rr(e)&&Lr(e);i&&(this.constraints=this.resolveRefConstraints(),n||(n=function(t,e,n){const i=hr(t,Br(n)),s=hr(e,Br(n));return()=>{i(),s()}}(t,i,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,o=s.addEventListener("measure",i);s.layout||(s.root?.updateScroll(),s.updateLayout()),qt.read(i);const r=Eo(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(Ks(e=>{if(!Fr(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=Er,dragMomentum:n=!0}=t;return{...t,dragElastic:e,dragMomentum:n}}}function Rr(t){return!!t&&"object"==typeof t&&("current"in t||"nodeType"in t)}const Lr=t=>"current"in t?t.current:t;function Br(t){let e=!0;return()=>{e?e=!1:t()}}function Fr(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}function jr(t,e){const n=Fi(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},Li(()=>i.abort())]}function Ir(t,e,n={}){e=Bi(e);const[i,s,o]=jr(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||br())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 Or=(t,e)=>!!e&&(t===e||Or(t,e.parentElement)),Ur=new WeakSet;function Nr(t){return e=>{"Enter"===e.key&&t(e)}}function Wr(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function zr(t){return Go(t)&&!br()}const $r=new WeakSet;function Kr(t,e,n={}){e=Bi(e);const[i,s,o]=jr(t,n),r=t=>{const i=t.currentTarget;if(!zr(t))return;if($r.has(t))return;Ur.add(i),n.stopPropagation&&$r.add(t);const o=e(i,t),r={...s,capture:!0},a=(t,e)=>{window.removeEventListener("pointerup",l,r),window.removeEventListener("pointercancel",h,r),Ur.has(i)&&Ur.delete(i),zr(t)&&"function"==typeof o&&o(t,{success:e})},l=t=>{a(t,i===window||i===document||n.useGlobalTarget||Or(i,t.target))},h=t=>{a(t,!1)};window.addEventListener("pointerup",l,r),window.addEventListener("pointercancel",h,r)};return i.forEach(t=>{var e;(n.useGlobalTarget?window:t).addEventListener("pointerdown",r,s),S(e=t)&&"offsetHeight"in e&&!("ownerSVGElement"in e)&&(t.addEventListener("focus",()=>((t,e)=>{let n=!1;const i=Nr(()=>{Ur.has(t)||(n=!0,Wr(t,"down"))}),s=Nr(()=>{n&&(n=!1,Wr(t,"up"))});t.addEventListener("keydown",i,e),t.addEventListener("keyup",s,e),t.addEventListener("blur",()=>{t.removeEventListener("keydown",i),t.removeEventListener("keyup",s),n&&Wr(t,"cancel")},{...e,once:!0})})(t,s),s),function(t){return wr.has(t.tagName)||!0===t.isContentEditable}(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),o}class Yr{constructor(t){this.isMounted=!1,this.node=t}update(){}}const Xr=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"]),Hr=t=>"string"==typeof t&&"svg"===t.toLowerCase();function _r(t,e,n){const i=Ho(t,e,n);for(const n in t)if("children"!==n&&(gi(t[n])||gi(e[n]))){i[-1!==Je.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return i}class Gr extends Ko{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Cs}getBaseTargetFromProps(t,e){return Qe.has(e)?super.getBaseTargetFromProps(t,e)??Ze(e):t[e]}getDefaultValue(t){return Qe.has(t)?this.latestValues[t]??Ze(t):void 0}readValueFromInstance(t,e){if(Qe.has(e)){const t=Ne(e);return t&&t.default||0}if(Ni.includes(e)){const n=getComputedStyle(t)[e];if("string"==typeof n&&n)return n.trim()}return e=Xr.has(e)?e:ji(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return _r(t,e,n)}build(t,e,n){Wi(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){!function(t,e,n,i){Yo(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(Xr.has(n)?n:ji(n),e.attrs[n])}(t,e,0,i)}mount(t){this.isSVGTag=Hr(t.tagName),super.mount(t)}}function Zr(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 qr=[...Lo].reverse(),Jr=t=>!0===t?.out?t:t?.out;function Qr(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=>Pi(t,e,n))):"string"==typeof e?Pi(t,e,n):Promise.all(bi(t,di(t,e,n.custom),n))).then(()=>{t.notify("AnimationComplete",e)})}(t,e,n))),n=ta(),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&&di(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&&Jr(d(h??(y&&y.props.initial))?.transition);if(qr.forEach((e,i)=>{const s=n[e],h=r[e],d=y&&y.props[e],v=void 0!==h?h:Ro(d)||!1===d?d:void 0,x=Ro(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||Co(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!Zr(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}=di(t,n,pi(t,e))||{};M={...M,...o,...s},E=Jr(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)?!Zr(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=di(a,n)?.transition?.delayChildren;i.delay=Jn(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||gi(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=ta(),s=!0}}}function ta(){const t={};for(const e of Lo)t[e]={isActive:"animate"===e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{},out:{}};return t}const ea=n({}),na=n({strict:!1}),ia=n({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),sa=n({});function oa(t){const{initial:e,animate:n}=function(t,e){if(Fo(t)){const{initial:e,animate:n}=t;return{initial:!1===e||Ro(e)?e:void 0,animate:Ro(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,i(sa));return s(()=>({initial:e,animate:n}),[ra(e),ra(n)])}function ra(t){return Array.isArray(t)?t.join(" "):t}const aa=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function la(t,e,n){for(const i in e)gi(e[i])||Xo(i,n)||(t[i]=e[i])}function ha(t,e){const n={};return la(n,t.style||{},t),Object.assign(n,function({transformTemplate:t},e){return s(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{}};return Ii(n,e,t),Object.assign({},n.vars,n.style)},[e])}(t,e)),n}function ca(t,e){const n={},i=ha(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 ua=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}});function da(t,e,n,i){const o=s(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return Wi(n,e,Hr(i),t.transformTemplate,t.style),{...n.attrs,style:{...n.style}}},[e]);if(t.style){const e={};return la(e,t.style,t),{...o,style:{...e,...o.style}}}return o}const pa=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","propagate","ignoreStrict","viewport"]);function ma(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||pa.has(t)}function fa(t,e){return t.startsWith("on")?!ma(t):e?.(t)??!ma(t)}const ya=["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 ga(t){return"string"==typeof t&&!t.includes("-")&&!!(ya.indexOf(t)>-1||/[A-Z]/u.test(t))}function va(t,e,n,{latestValues:i},a,l=!1,h,c){const u=(h??ga(t)?da:ca)(e,i,a,t),d=function(t,e,n,i){const s={};for(const o in t)"values"===o&&"object"==typeof t.values||gi(t[o])||(fa(o,i)||!0===n&&ma(o)||!e&&!ma(o)||t.draggable&&o.startsWith("onDrag"))&&(s[o]=t[o]);return s}(e,"string"==typeof t,l,c),p=t!==o?{...d,...u,ref:n}:{},{children:m}=e,f=s(()=>gi(m)?m.get():m,[m]);return r(t,{...p,children:f})}const xa=n(null);function wa(t){const e=a(null);return null===e.current&&(e.current=t()),e.current}function Sa(t,e,n,i){const s={},o=i(t,{});for(const t in o)s[t]=hs(o[t]);let{initial:r,animate:a}=t;const l=Fo(t),h=jo(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&&!Co(u)){const e=Array.isArray(u)?u:[u];for(let n=0;n<e.length;n++){const i=ui(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 Ta=t=>(e,n)=>{const s=i(sa),o=i(xa),r=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e},n,i,s){return{latestValues:Sa(n,i,s,t),renderState:e()}}(t,e,s,o);return n?r():wa(r)},ba=Ta({scrapeMotionValuesFromProps:Ho,createRenderState:aa}),Pa=Ta({scrapeMotionValuesFromProps:_r,createRenderState:ua}),Aa={animation:["variants",...Lo],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 Ea=!1;function Ma(){return function(){if(Ea)return;const t={};for(const e in Aa)t[e]={isEnabled:t=>Aa[e].some(e=>!!t[e])};zo(t),Ea=!0}(),Wo}function Va(t){const e=Ma();for(const n in t)e[n]={...e[n],...t[n]};zo(e)}const ka=Symbol.for("motionComponentSymbol");function Da(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 Ca=n({});function Ra(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}const La="undefined"!=typeof window?c:u;function Ba(t,e,n,s,o,r){const{visualElement:h}=i(sa),c=i(na),d=i(xa),p=i(ia),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(Ca);!v||v.projection||!o||"html"!==v.type&&"svg"!==v.type||function(t,e,n,i){const{layoutId:s,layout:o,drag:r,dragConstraints:a,layoutScroll:l,layoutRoot:h,layoutAnchor:c,layoutCrossfade:u}=e,d=t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:Fa(t.parent));d.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:Boolean(r)||a&&Ra(a),visualElement:t,animationType:"string"==typeof o?o:"both",initialPromotionConfig:i,crossfade:u,layoutScroll:l,layoutRoot:h,layoutAnchor:c});const p=d.getStack()?.lead;p&&!d.root.isUpdateBlocked()&&(p.willUpdate(),p.scheduleCheckAfterUnmount())}(y.current,n,o,x),l(()=>{v&&v.props!==n&&v.update(n,d)});const w=n[xi],S=a(Boolean(w)&&"undefined"!=typeof window&&!window.MotionHandoffIsComplete?.(w)&&window.MotionHasOptimisedAnimation?.(w));return La(()=>{g.current&&v&&(v.animationState?.animateChanges(),v.enteringChildren=void 0)},[]),La(()=>{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}function Fa(t){if(t)return!1!==t.options.allowProjection?t.projection:Fa(t.parent)}function ja(n,{forwardMotionProps:s=!1,type:o}={},r,a){const l=o?"svg"===o:ga(n),h=l?Pa:ba;function c(o,r){let c;const u=function({layoutId:t}){const e=i(ea).id;return e&&void 0!==t?e+"-"+t:t}(o);wa(()=>!!Vo.current?.sharedNodes.get(u)?.lead&&o.initial)&&(o={...o,initial:!1});const d={...i(ia),...o,layoutId:u},{isStatic:p,isValidProp:m}=d,f=oa(o),y=h(o,p);if(!p&&"undefined"!=typeof window){i(na).strict;const t=function(t){const e=Ma(),{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}}(d);f.visualElement=Ba(n,y,d,a,t.ProjectionNode,l),(t.isEnabled||f.visualElement?.projection?.options.layoutId)&&(c=t.MeasureLayout)}return t(sa.Provider,{value:f,children:[c&&f.visualElement?e(c,{visualElement:f.visualElement,...d}):null,va(n,o,Da(y,f.visualElement,r),y,p,s,l,m)]})}c.displayName=`motion.${"string"==typeof n?n:`create(${n.displayName??n.name??""})`}`;const u=d(c);return u[ka]=n,u}function Ia(t,e){return ja(t,e)}const Oa=Ia("div");function Ua({children:t,features:n,strict:i=!1}){const[,s]=p(!Na(n)),o=a(void 0);if(!Na(n)){const{renderer:t,...e}=n;o.current=t,Va(e)}return u(()=>{Na(n)&&n().then(({renderer:t,...e})=>{Va(e),o.current=t,s(!0)})},[]),e(na.Provider,{value:{renderer:o.current,strict:i},children:t})}function Na(t){return"function"==typeof t}const Wa=t=>(e,n)=>{t&&qt.update(()=>t(e,n),!1,!0)};let za=!1;const $a=({layout:t,layoutDependency:e,layoutAnchor:n})=>({layout:t,layoutDependency:e,layoutAnchor:n,animationType:"string"==typeof t?t:"both"}),Ka=(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 Ya extends f{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:i}=this.props,{projection:s}=t;s&&(e.group?.add(s),i&&n?.register?.(s),za&&s.root.didUpdate(),s.options.layoutId!==i&&Ka(s,i)?.(),s.addEventListener("animationComplete",()=>this.safeToRemove()),s.setOptions({...s.options,...$a(this.props),onExitComplete:()=>this.safeToRemove()})),Hs.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(),Ka(r,n)):void 0,r.setOptions({...r.options,...$a(this.props)}),za=!0,s||t.layoutDependency!==e||void 0===e||t.isPresent!==o?r.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?r.promote():r.relegate()||qt.postRender(()=>{r.getStack()?.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(this.takeOver?.(),t.root.didUpdate(),as.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:i}=t;za=!0,i&&(i.scheduleCheckAfterUnmount(),e.group?.remove(i),n?.deregister?.(i))}safeToRemove(){this.props.safeToRemove?.()}render(){return null}}function Xa(t){const[n,s]=function(t=!0){const e=i(xa);if(null===e)return[!0,null];const{isPresent:n,onExitComplete:s,register:o}=e,r=m();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(ea);return e(Ya,{...t,layoutGroup:o,switchLayoutGroup:i(Ca),isPresent:n,safeToRemove:s})}const Ha={pan:{Feature:class extends Yr{constructor(){super(...arguments),this.removePointerDownListener=b}onPointerDown(t){this.session=new dr(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:Wa(t),onStart:Wa(e),onMove:Wa(n),onEnd:(t,e)=>{delete this.session,i&&qt.postRender(()=>i(t,e))}}}mount(){this.removePointerDownListener=qo(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session?.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session?.end()}}},drag:{Feature:class extends Yr{constructor(t){super(t),this.removeGroupControls=b,this.removeListeners=b,this.controls=new Cr(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||b}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:Xa}},_a={layout:{ProjectionNode:ko,MeasureLayout:Xa}};let Ga=0;const Za={animation:{Feature:class extends Yr{constructor(t){super(t),t.animationState||(t.animationState=Qr(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Co(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 Yr{constructor(){super(...arguments),this.id=Ga++}update(){const{presenceContext:t,prevPresenceContext:e,animationState:n}=this.node;if(!t||!n)return;const{isPresent:i,onExitComplete:s}=t,o=e?.isPresent;if(i===o)return;if(i&&!1===o){if(!0===this.exit){const{initial:t}=this.node.getProps();if(t&&!Array.isArray(t)){const{transition:e,transitionEnd:n,...i}=di(this.node,t)||{};for(const t in i)this.node.getValue(t)?.jump(i[t])}this.node.blockInitialAnimation=!1,n.reset(),n.animateChanges()}else n.setActive("exit",!1);return void(this.exit=void 0)}const r=this.exit=n.setActive("exit",!i);s&&!i&&r.then(()=>{this.exit===r&&(this.exit=!0,s(this.id))})}mount(){const{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id,this.node))}unmount(){}}}};function qa(t,e,n,i){const{props:s}=t,o="while"+n;t.animationState&&s[o]&&t.animationState.setActive(o,"Start"===i);const r=s["on"+n+i];r&&qt.postRender(()=>r(e,Zo(e)))}function Ja(t,e,n){t.current instanceof HTMLButtonElement&&t.current.disabled||qa(t,e,"Tap",n)}const Qa=new WeakMap,tl=new WeakMap,el=t=>{const e=Qa.get(t.target);e&&e(t)},nl=t=>{t.forEach(el)};function il(t,e,n){const i=function({root:t,...e}){const n=t||document;tl.has(n)||tl.set(n,{});const i=tl.get(n),s=JSON.stringify(e);return i[s]||(i[s]=new IntersectionObserver(nl,{root:t,...e})),i[s]}(e);return Qa.set(t,n),i.observe(t),()=>{Qa.delete(t),i.unobserve(t)}}const sl={some:0,all:1};const ol={inView:{Feature:class extends Yr{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:sl[i]};this.stopObserver=il(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 Yr{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:e,propagate:n}=this.node.props;this.unmount=Kr(t,(t,e)=>(Ja(this.node,e,"Start"),(t,{success:e})=>Ja(this.node,t,e?"":"Cancel")),{useGlobalTarget:e,stopPropagation:!1===n?.tap})}unmount(){}}},focus:{Feature:class extends Yr{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=P(Eo(this.node.current,"focus",()=>this.onFocus()),Eo(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends Yr{mount(){const{current:t}=this.node;t&&(this.unmount=Ir(t,(t,e)=>(qa(this.node,e,"Hover","Start"),t=>qa(this.node,t,"Hover","End"))))}unmount(){}}}},rl=Object.assign({renderer:(t,e)=>e.isSVG??ga(t)?new Gr(e):new _o(e,{allowProjection:t!==o})},Za,ol),al=Object.assign({},rl,Ha,_a);export{Ua as LazyMotion,Oa as MotionDiv,al as domMax};
//# sourceMappingURL=size-rollup-m-dom-max.js.map