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