motion 14.4.0 → 14.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/motion.js CHANGED
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={})}(this,function(t){"use strict";function e(t,e){-1===t.indexOf(e)&&t.push(e)}function n(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const i=(t,e,n)=>n>e?e:n<t?t:n;let s=()=>{};const o={},r=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),a=t=>"object"==typeof t&&null!==t,l=t=>/^0[^.\s]+$/u.test(t);function c(t){let e;return()=>(void 0===e&&(e=t()),e)}const u=t=>t,h=(...t)=>t.reduce((t,e)=>n=>e(t(n))),d=(t,e,n)=>{const i=e-t;return i?(n-t)/i:1};class p{constructor(){this.subscriptions=[]}add(t){return e(this.subscriptions,t),()=>this.remove(t)}remove(t){n(this.subscriptions,t)}notify(t,e,n){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,n);else for(let s=0;s<i;s++){const i=this.subscriptions[s];i&&i(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const m=t=>1e3*t,f=t=>t/1e3,g=(t,e)=>e?t*(1e3/e):0,y=new Set;function v(t,e,n){t||y.has(e)||(console.warn(function(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}(e,n)),y.add(e))}const x=(t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t},w=(t,e,n)=>t*(3*(1-t)*((1-t)*e+t*n)+t*t);function T(t,e,n,i){return t===e&&n===i?u:s=>{let o=0,r=1,a=s;for(let e=0;;e++){a>=o&&a<=r||(a=(o+r)/2);const i=w(a,t,n)-s;if(i*i<1e-28||40===e)break;i>0?r=a:o=a,a-=1e-7*i/(w(a+1e-7,t,n)-s-i)}return w(a,e,i)}}const b=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,S=t=>e=>1-t(1-e),A=T(.33,1.53,.69,.99),P=S(A),E=b(P),M=t=>t>=1?1:(t*=2)<1?.5*P(t):.5*(2-Math.pow(2,-10*(t-1))),V=t=>1-Math.sin(Math.acos(t)),k=S(V),D=b(V),C=T(.42,0,1,1),L=T(0,0,.58,1),R=T(.42,0,.58,1);const B=t=>Array.isArray(t)&&"number"!=typeof t[0];function j(t,e){return B(t)?t[x(0,t.length,e)]:t}const O=t=>Array.isArray(t)&&"number"==typeof t[0],I={linear:u,easeIn:C,easeInOut:R,easeOut:L,circIn:V,circInOut:D,circOut:k,backIn:P,backInOut:E,backOut:A,anticipate:M},F=t=>{if(O(t)){t.length;const[e,n,i,s]=t;return T(e,n,i,s)}return"string"==typeof t?I[t]:t},W={delta:0,timestamp:0,isProcessing:!1};let N;function U(){N=void 0}const $={now:()=>(void 0===N&&$.set(W.isProcessing||o.useManualTiming?W.timestamp:performance.now()),N),set:t=>{N=t,queueMicrotask(U)}},z=t=>Math.round(1e5*t)/1e5,K=t=>e=>"string"==typeof e&&e.startsWith(t),Y=K("--"),X=K("var(--"),G=t=>!!X(t)&&H.test(t.split("/*")[0].trim()),H=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function _(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const q={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},Z={...q,transform:t=>i(0,1,t)},J={...q,default:1},Q=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const tt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,et=(t,e)=>n=>Boolean("string"==typeof n&&tt.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),nt=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[s,o,r,a]=i.match(Q);return{[t]:parseFloat(s),[e]:parseFloat(o),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},it={...q,transform:t=>Math.round((t=>i(0,255,t))(t))},st={test:et("rgb","red"),parse:nt("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+it.transform(t)+", "+it.transform(e)+", "+it.transform(n)+", "+z(Z.transform(i))+")"};const ot={test:et("#"),parse:function(t){let e="",n="",i="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}},transform:st.transform},rt=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),at=rt("deg"),lt=rt("%"),ct=rt("px"),ut=rt("vh"),ht=rt("vw"),dt=(()=>({...lt,parse:t=>lt.parse(t)/100,transform:t=>lt.transform(100*t)}))(),pt={test:et("hsl","hue"),parse:nt("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+lt.transform(z(e))+", "+lt.transform(z(n))+", "+z(Z.transform(i))+")"},mt={test:t=>st.test(t)||ot.test(t)||pt.test(t),parse:t=>st.test(t)?st.parse(t):pt.test(t)?pt.parse(t):ot.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?st.transform(t):pt.transform(t),getAnimatableNone:t=>{const e=mt.parse(t);return e.alpha=0,mt.transform(e)}},ft=new RegExp(Q.source),gt=new RegExp(/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu.source,"i");const yt="number",vt="color",xt=/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 wt(t){const e=t.toString();return ft.test(e)||gt.test(e)}function Tt(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let o=0;const r=e.replace(xt,t=>(mt.test(t)?(i.color.push(o),s.push(vt),n.push(mt.parse(t))):t.startsWith("var(")?(i.var.push(o),s.push("var"),n.push(t)):(i.number.push(o),s.push(yt),n.push(parseFloat(t))),++o,"${}")).split("${}");return{values:n,split:r,indexes:i,types:s}}function bt({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===yt?z(i[o]):t===vt?mt.transform(i[o]):i[o]}return s}}const St=(t,e)=>{return"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof(n=t)?0:mt.test(n)?mt.getAnimatableNone(n):n;var n};const At={test:function(t){return isNaN(t)&&"string"==typeof t&&(ft.test(t)||gt.test(t))},parse:function(t){return Tt(t).values},createTransformer:function(t){return bt(Tt(t))},getAnimatableNone:function(t){const e=Tt(t);return bt(e)(e.values.map((t,n)=>St(t,e.split[n])))}};function Pt(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 Et({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=Pt(a,i,t+1/3),o=Pt(a,i,t),r=Pt(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}}function Mt(t,e){return n=>n>0?e:t}const Vt=(t,e,n)=>t+(e-t)*n,kt=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},Dt=[ot,st,pt];function Ct(t){const e=(n=t,Dt.find(t=>t.test(n)));var n;if(!e)return!1;let i=e.parse(t);return e===pt&&(i=Et(i)),i}const Lt=(t,e)=>{const n=Ct(t),i=Ct(e);if(!n||!i)return Mt(t,e);const s={...n};return t=>(s.red=kt(n.red,i.red,t),s.green=kt(n.green,i.green,t),s.blue=kt(n.blue,i.blue,t),s.alpha=Vt(n.alpha,i.alpha,t),st.transform(s))},Rt=new Set(["none","hidden"]);function Bt(t,e){return Rt.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function jt(t,e){return n=>Vt(t,e,n)}function Ot(t){return"number"==typeof t?jt:"string"==typeof t?G(t)?Mt:mt.test(t)?Lt:Wt:Array.isArray(t)?It:"object"==typeof t?mt.test(t)?Lt:Ft:Mt}function It(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>Ot(t)(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=s[e](t);return n}}function Ft(t,e){const n={...t,...e},i={};for(const s in n)void 0!==t[s]&&void 0!==e[s]&&(i[s]=Ot(t[s])(t[s],e[s]));return t=>{for(const e in i)n[e]=i[e](t);return n}}const Wt=(t,e)=>{const n=At.createTransformer(e),i=Tt(t),s=Tt(e);return i.indexes.var.length===s.indexes.var.length&&i.indexes.color.length===s.indexes.color.length&&i.indexes.number.length>=s.indexes.number.length?Rt.has(t)&&!s.values.length||Rt.has(e)&&!i.values.length?Bt(t,e):h(It(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}(i,s),s.values),n):Mt(t,e)},Nt=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function Ut(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return Vt(t,e,n);if("string"==typeof t&&"string"==typeof e){const n=function(t,e){const n=Nt.exec(t);if(!n)return;const i=Nt.exec(e);if(!i||n[2]!==i[2])return;const s=n[2],o=parseFloat(n[1]),r=parseFloat(i[1]);return t=>z(Vt(o,r,t))+s}(t,e);if(n)return n}return Ot(t)(t,e)}const $t=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function zt(t,e,n={delta:0,timestamp:0,isProcessing:!1}){let i=!1,s=!0;const r=()=>i=!0,a=$t.reduce((t,e)=>(t[e]=function(t){let e=new Set,n=new Set,i=!1,s=!1;const o=new Set;let r={delta:0,timestamp:0,isProcessing:!1};function a(e){o.has(e)&&(n.add(e),t()),e(r)}const l={schedule:(t,s=!1,r=!1)=>{const a=r&&i?e:n;return s&&o.add(t),a.add(t),t},cancel:t=>{n.delete(t),o.delete(t)},process:t=>{if(r=t,i)return void(s=!0);i=!0;const o=e;e=n,n=o,e.forEach(a),e.clear(),i=!1,s&&(s=!1,l.process(t))}};return l}(r),t),{}),{setup:l,read:c,resolveKeyframes:u,preUpdate:h,update:d,preRender:p,render:m,postRender:f}=a,g=()=>{const r=o.useManualTiming,a=r?n.timestamp:performance.now();i=!1,r||(n.delta=s?1e3/60:Math.max(Math.min(a-n.timestamp,40),1)),n.timestamp=a,n.isProcessing=!0,l.process(n),c.process(n),u.process(n),h.process(n),d.process(n),p.process(n),m.process(n),f.process(n),n.isProcessing=!1,i&&e&&(s=!1,t(g))};return{schedule:$t.reduce((e,o)=>{const r=a[o];return e[o]=(e,o=!1,a=!1)=>(i||(i=!0,s=!0,n.isProcessing||t(g)),r.schedule(e,o,a)),e},{}),cancel:t=>{for(let e=0;e<$t.length;e++)a[$t[e]].cancel(t)},state:n,steps:a}}const{schedule:Kt,cancel:Yt,steps:Xt}=zt("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:u,!0,W),Gt=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>Kt.update(e,t),stop:()=>Yt(e),now:()=>W.isProcessing?W.timestamp:$.now()}},Ht=(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)})`},_t=2e4;function qt(t,e=50,n=2e4,i){let s=0,o=t.next(s);for(i?.push(o.value);!o.done&&s<n;)s+=e,o=t.next(s),i?.push(o.value);return s>=n?1/0:s}function Zt(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(qt(r),_t);return{type:"keyframes",ease:t=>r.next(a*t).value/e,duration:f(a)}}const Jt=100,Qt=10,te=1,ee=800,ne=.3,ie=.3,se={granular:.01,default:2},oe={granular:.005,default:.5},re=.01,ae=10,le=.05,ce=t=>t<0?1/Math.max(1+t,le):Math.max(1-t,le);function ue(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 pe(t=>s*Math.exp(-i*t)-i*Math.exp(-s*t)-o,t=>Math.exp(-s*t)-Math.exp(-i*t),e)/e}function he(t,e){return t*Math.sqrt(1-e*e)}const de=12;function pe(t,e,n){let i=n;for(let n=1;n<de;n++)i-=t(i)/e(i);return i}const me=.001;const fe=(t,e)=>(e?t>=0:t>0)&&t<1/0;function ge(t,e){if(fe(t,e))return t}function ye(t){const e=ge(t.stiffness),n=ge(t.damping,!0),s=ge(t.mass),o={...t,stiffness:e??Jt,damping:n??Qt,mass:s??te,isResolvedFromDuration:!1,isTimeDefined:void 0===(e??n??s)&&(void 0!==t.duration||void 0!==t.bounce)};if(o.isTimeDefined){if(t.visualDuration){const e=ce(t.bounce||0),n=2*Math.PI/(1.2*t.visualDuration)*ue(e,2*Math.PI/1.2);o.stiffness=n*n,o.damping=2*e*Math.sqrt(o.stiffness)}else Object.assign(o,function({duration:t=ee,bounce:e=ne}){let n,s;const o=ce(e);t=i(re,ae,f(t)),o<1?(n=e=>{const n=e*o,i=n*t,s=he(e,o),r=Math.exp(-i);return me-n/s*r},s=e=>{const i=e*o*t,s=o*o*e*e*t,r=Math.exp(-i),a=he(e*e,o);return(-n(e)+me>0?-1:1)*-s*r/a}):(n=e=>Math.exp(-e*t)*(e*t+1)-.001,s=e=>Math.exp(-e*t)*(t*t*-e));const r=pe(n,s,5/t),a=r*ue(o,r*t),l=a*a;return{stiffness:l,damping:2*o*Math.sqrt(l),duration:m(t)}}(o)),o.isResolvedFromDuration=!0;fe(o.stiffness)&&fe(o.damping,!0)||(o.stiffness=Jt,o.damping=Qt)}return o}function ve(t=ie,e=ne){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:c,isResolvedFromDuration:u,isTimeDefined:h}=ye({...n}),d=t=>h?0:-f(t),p=a/(2*Math.sqrt(r*l)),g=f(Math.sqrt(r/l)),y=p*g,v={target:s,delta:s-i,velocity:d(n.velocity||0)||0,restSpeed:0,restDelta:0},x=()=>{const t=Math.abs(v.delta)<5;v.restSpeed=n.restSpeed||(t?se.granular:se.default),v.restDelta=n.restDelta||(t?oe.granular:oe.default)};let w,T,b;if(x(),p<1){const t=he(g,p),e={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};b=()=>{e.A=(v.velocity+y*v.delta)/t,e.sinC=y*e.A+v.delta*t,e.cosC=y*v.delta-e.A*t};const n=n=>{n!==e.t&&(e.t=n,e.env=Math.exp(-y*n),e.sin=Math.sin(t*n),e.cos=Math.cos(t*n))};w=t=>(n(t),v.target-e.env*(e.A*e.sin+v.delta*e.cos)),T=t=>(n(t),e.env*(e.sinC*e.sin+e.cosC*e.cos))}else if(1===p){w=t=>v.target-Math.exp(-g*t)*(v.delta+(v.velocity+g*v.delta)*t);const t={C:0};b=()=>{t.C=v.velocity+g*v.delta},T=e=>Math.exp(-g*e)*(g*t.C*e-v.velocity)}else{const t=g*Math.sqrt(p*p-1),e=y-t,n=y+t,i=h?1/0:300/t,s=(t,e)=>Math.exp(e>i?-t*i-y*(e-i):-t*e),o={S:0,F:0};b=()=>{const e=(v.velocity+y*v.delta)/t;o.S=(v.delta+e)/2,o.F=(v.delta-e)/2},w=t=>v.target-o.S*s(e,t)-o.F*s(n,t),T=t=>e*o.S*s(e,t)+n*o.F*s(n,t)}b();const S=u&&c||null,A={calculatedDuration:S,retarget:(t,e)=>{v.target=t[t.length-1],v.delta=v.target-t[0],v.velocity=d(e),n.restSpeed&&n.restDelta||x(),A.calculatedDuration=S,o.done=!1,b()},velocity:t=>m(T(t)),next:t=>{const e=w(t);if(u)o.done=t>=c;else{const n=m(T(t));o.done=Math.abs(n)<=v.restSpeed&&Math.abs(v.target-e)<=v.restDelta}return o.value=o.done?v.target:e,o},toString:()=>{const t=Math.min(qt(A),_t),e=Ht(e=>A.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return A}function xe({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:c=.5,restSpeed:u}){const h=t[0],d={done:!1,value:h},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=h+m,g=void 0===r?f:r(f);g!==f&&(m=g-h);const y=t=>-m*Math.exp(-t/i),v=t=>{const e=y(t);d.done=Math.abs(e)<=c,d.value=d.done?g:g+e};let x,w;const T=t=>{var e;((e=d.value)<a||e>l)&&(x=t,w=ve({keyframes:[d.value,p(d.value)],velocity:-y(t)/i*1e3,damping:s,stiffness:o,restDelta:c,restSpeed:u}))};return T(0),{calculatedDuration:null,next:t=>{let e=!1;return w||void 0!==x||(e=!0,v(t),T(t)),void 0!==x&&t>=x?w.next(t-x):(!e&&v(t),d)}}}function we(t,e,{clamp:n=!0,ease:s,mixer:r}={}){const a=t.length;if(e.length,1===a)return()=>e[0];if(2===a&&e[0]===e[1])return()=>e[1];const l=t[0]===t[1];t[0]>t[a-1]&&(t=[...t].reverse(),e=[...e].reverse());const c=function(t,e,n){const i=[],s=n||o.mix||Ut,r=t.length-1;for(let n=0;n<r;n++){let o=s(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]||u:e;o=h(t,o)}i.push(o)}return i}(e,s,r),p=c.length,m=n=>{if(l&&n<t[0])return e[0];let i=0;if(p>1)for(;i<t.length-2&&!(n<t[i+1]);i++);const s=d(t[i],t[i+1],n);return c[i](s)};return n?e=>m(i(t[0],t[a-1],e)):m}function Te(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=d(0,e,i);t.push(Vt(n,1,s))}}function be(t){const e=[0];return Te(e,t.length-1),e}function Se(t,e){return t.map(t=>t*e)}function Ae(t,e){return t.map(()=>e||R).splice(0,t.length-1)}function Pe({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const r=B(s)?s.map(F):F(s)||R,a={done:!1,value:e[0]};if(2===e.length&&!Array.isArray(r)&&(!n||2!==n.length||0===n[0]&&1===n[1])){const[n,s]=e,l=n===s?void 0:(o.mix||Ut)(n,s);return{calculatedDuration:t,next:e=>(a.value=l?l(r(t>0?i(0,1,e/t):1)):s,a.done=e>=t,a)}}const l=we(Se(n&&n.length===e.length?n:be(e),t),e,{ease:Array.isArray(r)?r:Ae(e,r)});return{calculatedDuration:t,next:e=>(a.value=l(e),a.done=e>=t,a)}}ve.applyToOptions=t=>{const e=Zt(t,100,ve);return t.ease=e.ease,t.duration=m(e.duration),t.type="keyframes",t};function Ee(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 g(n-t(i),e-i)}(e=>t.next(e).value,e,t.next(e).value)}const Me=t=>null!==t;function Ve(t,{repeat:e,repeatType:n="loop"},i,s=1){const o=t.filter(Me),r=s<0||e&&"loop"!==n&&e%2==1?0:o.length-1;return r&&void 0!==i?i:o[r]}const ke={decay:xe,inertia:xe,tween:Pe,keyframes:Pe,spring:ve};function De(t){"string"==typeof t.type&&(t.type=ke[t.type])}const Ce=(t,e)=>e-t>40&&!o.useManualTiming?e:t;function Le(t,e){return{kind:t,animation:e,timestamp:$.now(),frameTimestamp:W.timestamp,frameIsProcessing:W.isProcessing}}function Re(t,e,n){const i=globalThis.__MOTION_INSPECT__;if(i)try{i({...Le("animation-start",t),options:n?{...e,...n}:e})}catch{}}class Be{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 je=t=>t/100,Oe=t=>Math.round(1e4*t)/1e4;class Ie extends Be{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!==$.now()&&this.tick($.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause(),Re(this,this.options)}initAnimation(){const{options:t}=this;De(t);const{type:e=Pe,repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=t;let{keyframes:r}=t;const a=e||Pe;a!==Pe&&"number"!=typeof r[0]&&(this.mixKeyframes=h(je,Ut(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=qt(l));const{calculatedDuration:c}=l;this.calculatedDuration=c,this.resolvedDuration=c+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=l}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:n,totalDuration:i,calculatedDuration:s}=this;if(null===this.startTime)return n.next(0);const{delay:o=0,keyframes:r,type:a,onUpdate:l,finalKeyframe:c}=this.options;this.startTime===this.pendingStartTime&&(this.startTime=Ce(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 u=this.currentTime-o*(this.playbackSpeed>=0?1:-1),h=this.playbackSpeed>=0?u<0:u>i;this.currentTime=Math.max(u,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);const d=this.generate(this.currentTime,h);let{done:p}=d;h||null===s||(p=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const m=null===this.holdTime&&("finished"===this.state||"running"===this.state&&p);return m&&a!==xe&&(d.value=Ve(r,this.options,c,this.speed)),l&&l(d.value),m&&this.finish(),d}at(t){return this.holdTime??Oe((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!==xe?Ve(n.keyframes,n,e?void 0:n.finalKeyframe):this.generate(Math.max(s,0),s<0).value}generate(t,e){const{generator:n,totalDuration:s,mixKeyframes:o,mirroredGenerator:r,resolvedDuration:a}=this,{keyframes:l,repeat:c,repeatType:u,repeatDelay:h}=this.options;let d,p=t,m=n;if(c){const e=Math.min(t,s)/a;let n=Math.floor(e),o=e%1;!o&&e>=1&&(o=1),1===o&&n--,n=Math.min(n,c+1);Boolean(n%2)&&("reverse"===u?(o=1-o,h&&(o-=h/a)):"mirror"===u&&(m=r)),p=i(0,1,o)*a}return e?(this.delayState.value=l[0],d=this.delayState):d=m.next(p),o&&!e&&(d.value=o(d.value)),d}then(t,e){return this.finished.then(t,e)}get duration(){return f(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+f(t)}get time(){return f(this.currentTime)}set time(t){t=m(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){return Ee(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($.now()),this.playbackSpeed=t,e&&this.driver&&(this.time=f(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=Gt,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($.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}const Fe=new Set(["brightness","contrast","saturate","opacity"]);function We(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(Q)||[];if(!i)return t;const s=n.replace(i,"");let o=Fe.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+s+")"}const Ne=/\b([a-z-]*)\(.*?\)/gu,Ue={...At,getAnimatableNone:t=>{const e=t.match(Ne);return e?e.map(We).join(" "):t}},$e={...At,getAnimatableNone:t=>{const e=At.parse(t);return At.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},ze={...q,transform:Math.round},Ke={rotate:at,pathRotation:at,rotateX:at,rotateY:at,rotateZ:at,scale:J,scaleX:J,scaleY:J,scaleZ:J,skew:at,skewX:at,skewY:at,distance:ct,translateX:ct,translateY:ct,translateZ:ct,x:ct,y:ct,z:ct,perspective:ct,transformPerspective:ct,opacity:Z,originX:dt,originY:dt,originZ:ct},Ye={borderWidth:ct,borderTopWidth:ct,borderRightWidth:ct,borderBottomWidth:ct,borderLeftWidth:ct,borderRadius:ct,borderTopLeftRadius:ct,borderTopRightRadius:ct,borderBottomRightRadius:ct,borderBottomLeftRadius:ct,width:ct,maxWidth:ct,height:ct,maxHeight:ct,top:ct,right:ct,bottom:ct,left:ct,inset:ct,insetBlock:ct,insetBlockStart:ct,insetBlockEnd:ct,insetInline:ct,insetInlineStart:ct,insetInlineEnd:ct,padding:ct,paddingTop:ct,paddingRight:ct,paddingBottom:ct,paddingLeft:ct,paddingBlock:ct,paddingBlockStart:ct,paddingBlockEnd:ct,paddingInline:ct,paddingInlineStart:ct,paddingInlineEnd:ct,margin:ct,marginTop:ct,marginRight:ct,marginBottom:ct,marginLeft:ct,marginBlock:ct,marginBlockStart:ct,marginBlockEnd:ct,marginInline:ct,marginInlineStart:ct,marginInlineEnd:ct,fontSize:ct,backgroundPositionX:ct,backgroundPositionY:ct,...Ke,zIndex:ze,fillOpacity:Z,strokeOpacity:Z,numOctaves:ze},Xe={...Ye,color:mt,backgroundColor:mt,outlineColor:mt,fill:mt,stroke:mt,borderColor:mt,borderTopColor:mt,borderRightColor:mt,borderBottomColor:mt,borderLeftColor:mt,filter:Ue,WebkitFilter:Ue,mask:$e,WebkitMask:$e},Ge=t=>Xe[t],He=new Set([Ue,$e]);function _e(t,e){let n=Ge(t);return He.has(n)||(n=At),n.getAnimatableNone?n.getAnimatableNone(e):void 0}function qe(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const Ze=t=>180*t/Math.PI,Je=t=>{const e=Ze(Math.atan2(t[1],t[0]));return tn(e)},Qe={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:Je,rotateZ:Je,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},tn=t=>((t%=360)<0&&(t+=360),t),en=t=>Math.hypot(t[0],t[1]),nn=t=>Math.hypot(t[4],t[5]),sn={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:en,scaleY:nn,scaleZ:t=>Math.hypot(t[8],t[9],t[10]),scale:t=>(en(t)+nn(t))/2,rotateX:t=>tn(Ze(Math.atan2(t[6],t[5]))),rotateY:t=>tn(Ze(Math.atan2(-t[2],t[0]))),rotateZ:Je,rotate:Je,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 on(t){return t.includes("scale")?1:0}function rn(t,e){if(!t||"none"===t)return on(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,s;if(n)i=sn,s=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=Qe,s=e}if(!s)return on(e);const o=i[e],r=s[1].split(",").map(ln);return"function"==typeof o?o(r):r[o]}const an=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return rn(n,e)};function ln(t){return parseFloat(t.trim())}const cn=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","scaleZ","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],un=(()=>new Set([...cn,"pathRotation"]))(),hn=t=>t===q||t===ct,dn=new Set(["x","y","z"]),pn=cn.filter(t=>!dn.has(t));const mn=new Set(["bottom","right"]);function fn(t,e,n,i,s,o){const r=parseFloat(t);if(!isNaN(r))return r;const{min:a,max:l}=e()[n],c=l-a;return"border-box"===o?c:c-parseFloat(i)-parseFloat(s)}const gn={width:({width:t,paddingLeft:e="0",paddingRight:n="0",boxSizing:i},s)=>fn(t,s,"x",e,n,i),height:({height:t,paddingTop:e="0",paddingBottom:n="0",boxSizing:i},s)=>fn(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:({transform:t})=>rn(t,"x"),y:({transform:t})=>rn(t,"y")};gn.translateX=gn.x,gn.translateY=gn.y;const yn=new Set;let vn=!1,xn=!1,wn=!1;function Tn(){if(xn){const t=[],e=new Set,n=new Set;yn.forEach(i=>{i.needsMeasurement&&(t.push(i),e.add(i.element),mn.has(i.name)&&n.add(i.element))});const i=new Map;n.forEach(t=>{const e=function(t){const e=[];return pn.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)})}xn=!1,vn=!1,yn.forEach(t=>t.complete(wn)),yn.clear()}function bn(){yn.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(xn=!0)})}function Sn(){wn=!0,bn(),Tn(),wn=!1}class An{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?(yn.add(this),vn||(vn=!0,Kt.read(bn),Kt.resolveKeyframes(Tn))):(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(r(t)||l(t))return parseFloat(t);if(!At.test(t)&&At.test(n))return _e(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])}qe(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),yn.delete(this)}cancel(){"scheduled"===this.state&&(yn.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const Pn=t=>t.startsWith("--");function En(t,e,n){Pn(e)?t.style.setProperty(e,n):t.style[e]=n}const Mn={};function Vn(t,e){const n=c(t);return()=>Mn[e]??n()}const kn=Vn(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),Dn=Vn(()=>void 0!==window.ViewTimeline,"viewTimeline"),Cn=Vn(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),Ln=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,Rn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ln([0,.65,.55,1]),circOut:Ln([.55,0,1,.45]),backIn:Ln([.31,.01,.66,-.59]),backOut:Ln([.33,1.53,.69,.99])};function Bn(t,e){return t?"function"==typeof t?Cn()?Ht(t,e):"ease-out":O(t)?Ln(t):Array.isArray(t)?t.map(t=>Bn(t,e)||Rn.easeOut):Rn[t]:void 0}function jn(t,e,n,{delay:i=0,duration:s=300,repeat:o=0,repeatType:r="loop",ease:a="easeOut",times:l}={},c=void 0){const u={[e]:n};l&&(u.offset=l);const h=Bn(a,s);Array.isArray(h)&&(u.easing=h);const d={delay:i,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:o+1,direction:"reverse"===r?"alternate":"normal"};return c&&(d.pseudoElement=c),t.animate(u,d)}function On(t){return"function"==typeof t&&"applyToOptions"in t}function In({type:t,...e}){return On(t)&&Cn()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class Fn extends Be{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,t.type;const l=In(t);this.animation=jn(e,n,i,l,s),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const t=Ve(i,this.options,r,this.speed);this.updateMotionValue&&this.updateMotionValue(t),En(e,n,t),this.animation.cancel()}a?.(),this.notifyFinished()},Re(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(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return f(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+f(t)}get time(){return f(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=m(t),e&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,onAttach:e,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&kn()?(this.animation.timeline=t,e?.(this.animation),u):n(this)}}const Wn={anticipate:M,backInOut:E,circInOut:D};function Nn(t){"string"==typeof t.ease&&t.ease in Wn&&(t.ease=Wn[t.ease])}const Un=10;class $n extends Fn{constructor(t){Nn(t),De(t),super(t),void 0!==t.startTime&&!1!==t.autoplay&&(this.startTime=t.startTime),this.options=t}elapsed(){return"running"===this.state?($.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 Ie({...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:s}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const{speed:o}=this,r=this.elapsed(),a="running"===this.state&&o?i(0,10,r):0,l=this.sample(r);n&&s&&En(n,s,l),e.setWithVelocity(this.sample(r-a*Math.sign(o)),l,a/Math.abs(o||1))}}const zn=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!At.test(t)&&"0"!==t||t.startsWith("url(")));function Kn(t){t.duration=0,t.type="keyframes"}const Yn=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),Xn=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;const Gn=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Hn=c(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function _n(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:o,type:r,keyframes:a}=t;if(!n||!Yn.has(n)&&!Gn.has(n))return!1;const l=e?.owner?.current;if(!(l instanceof HTMLElement||l instanceof SVGElement))return!1;const{onUpdate:c,transformTemplate:u}=e.owner.getProps();return Hn()&&(Yn.has(n)||Gn.has(n)&&function(t){for(let e=0;e<t.length;e++)if("string"==typeof t[e]&&Xn.test(t[e]))return!0;return!1}(a))&&("transform"!==n||!u)&&!c&&!i&&"mirror"!==s&&0!==o&&"inertia"!==r}const qn=(t,e)=>e&&"number"==typeof t?e.transform(t):t,Zn={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Jn=cn.length;function Qn(t,e,n){let i="",s=!0;for(let o=0;o<Jn;o++){const r=cn[o],a=t[r];if(void 0===a)continue;let l=!0;if("number"==typeof a)l=a===(r.startsWith("scale")?1:0);else{const t=parseFloat(a);l=r.startsWith("scale")?1===t:0===t}if(!l||n){const t=qn(a,Ye[r]);if(!l){s=!1;i+=`${Zn[r]||r}(${t}) `}n&&(e[r]=t)}}const o=t.pathRotation;return o&&(s=!1,i+=`rotate(${qn(o,Ye.pathRotation)}) `),i=i.trim(),n?i=n(e,s?"":i):s&&(i="none"),i}const ti=new WeakMap,ei=.001,ni=(t,e)=>t-e,ii=(t,e,n)=>{const i=[];for(let s=0;s<=n;s++)i.push(Vt(t,e,s/n));return i},si=t=>t.motionValue.owner,oi=t=>ti.get(t),ri=(t,e)=>t.latestValues?t.latestValues[e]:t.getValue(e)?.get();class ai extends Ie{constructor(t){const e=si(t).current,{driver:n=Gt}=t;let i;const s=function(t){const e=si(t),{onUpdate:n,transformTemplate:i}=e.getProps();return!(t.isHandoff||n||t.hasOnUpdate||i||"inertia"===t.type||"none"!==(ri(e,"transform")||"none")||ri(e,"pathRotation")||e.projection?.isProjecting())}(t);t.driver=t=>{const s=n(t);return{js:s,now:s.now,start:(t=!0)=>{const n=oi(e);!n||n.isJS?s.start(t):n.schedule(!1,!t)},stop:()=>{s.stop();const t=oi(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 oi(si(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($.now()):void 0}tween(){const{keyframes:t,type:e,ease:n,times:i,repeat:s,delay:o=0}=this.options,r=O(n)?Ln(n):(t=>/^(linear|ease(In|Out|InOut))$/.test(t))(n)&&Rn[n];if(r&&!s&&!i&&2===t.length&&e===Pe&&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:c,times:u,keyframes:h,type:d}=o,p=(d||Pe)===Pe?u||be(h):[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&&c&&"loop"!==c?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=$.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,c=!1,u=!1,h=!1,p=-1/0;const m=t=>{for(const e of n)if(e.name===t)return!0},f=(e,n)=>{const r={};for(const a of void 0===e?cn:o){const o=i.get(a),l=void 0===e?ri(t,a):o?o.sampleAt(n>e&&!o.timing()[1]?n:e):s[a];void 0!==l&&(r[a]=l)}return r},g=(t,e)=>{let n="";const i=f(t,e);for(const t in i)n+=(Zn[t]||t)+"("+qn(i[t],Ye[t])+") ";return n||"none"},y=(t=f())=>{e.style.transform=Qn(t,{})},v=(t=!0)=>{t&&y(),a.forEach(({animation:t})=>t.cancel()),a=[]},x=(t,e,n=1/0)=>{const i={animation:t,offset:e,end:n};t.startTime=$.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)),k.schedule(!1)}),t.oncancel=()=>a.includes(i)&&k.demote(),a.push(i)},w=(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)/Un)));if(4*i.length>s)return;const o=ii(e,n,s).concat(i).sort(ni),r=t=>d(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)*ei>Math.abs(s))?0:s,c=i.map(t=>r?t/r:t);if(r)if(a){if(c.some((t,e)=>!(Math.abs(t-a[e])<=ei)))return}else a=c,l=t=>(e.numberAt(t)-n)/r;else if(c.some(t=>!(Math.abs(t)<=ei)))return}if(!a||a.every((t,e)=>Math.abs(t-r(o[e]))<=ei))return"linear";const c=[],u=(t,e=l(t))=>c.push(Oe(e)+" "+Oe(100*r(t))+"%");return a.forEach((t,e)=>{e&&Math.abs(t-a[e-1])>.2&&w(l,o[e-1],o[e]).forEach(t=>u(t)),u(o[e],t)}),"linear("+c+")"},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(...w(t=>i.numberAt(t),e,n));s.push(n)}},a=ii(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(ni))t>l&&r(l,t,0),l=t;return s.sort(ni)},S=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},A=(t,n,i,s={fill:"both"},o,r)=>{const a=t.flatMap(t=>t.boundaries(n,i)),l=r||T(t,n,i,a),c=l?[n,i]:b(t,n,i,a),u=c.map(t=>g(t,o));let h={transform:u};return l||(h.offset=c.map(t=>d(n,i,t))),u.every(t=>t===u[0])&&(y(f(n,o)),h=null),e.animate(h,{...s,duration:i-n,easing:l||"linear"})},P=l=>{let c=l,u=0,h=0;const d=[],p=[],m=new Set;i.clear(),r=new Map;for(const t of n){i.set(t.name,t);const[e,n]=t.timing(),s=e===1/0;if(r.set(t,[t.at(l),t.speed,s]),s)t.sync();else{if(t.speed<0)return;if(n){if(u){const t=(e-h)/n;if(Math.abs(n-u)>1||Math.abs(t-Math.round(t))*u>1)return}else u=n,h=e;p.push(t)}else m.add(e);d.push(t),c=Math.max(c,e)}}s={},o=cn.filter(e=>{if(i.has(e))return!0;const n=s[e]=ri(t,e);return void 0!==n&&parseFloat(n)!==(e.startsWith("scale")?1:0)}),v(!1);const f=!u&&S(d);try{if(f&&f[1]>l){const[t,e,n]=f;x(A(d,t,e,void 0,void 0,n),t-l,e-t)}else c>l&&(x(A(d,l,c),0,c-l),m.forEach(t=>t<c-1&&x(e.animate(null,{duration:t-l}),0,t-l)));if(u){const t=h+Math.floor((c-h)/u)*u;x(A(p,t,t+u,{iterations:1/0,iterationStart:(c-t)/u,fill:"forwards"},c),c-l)}}catch{return}return a.length||v(),!0},E=t=>{let e,i=0;for(const s of n){const n=r.get(s);if(!n)return!1;const[o,a,l]=n,c=s.at(t),u=s.timing()[0]===1/0;if(l){if(u&&c===o)continue;return!1}const h=(c-o)/a,d=u?0:s.speed/a;if(void 0===e)e=h,i=d;else if(Math.abs(h-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.playbackRate=i,n.startTime=t-r/i):(n.pause(),n.currentTime=r)}return!0},M=()=>!n.size&&(u=!0,oi(e)===k&&ti.delete(e),k.isJS||v(),!0),V=()=>{const e=$.now();if(k.isJS||(k.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]=ri(t,n.name),r.has(n)||(l=!0))}),k.isFinishing=!1),c=!1,u)return;if(n.forEach(({state:t},e)=>{"idle"!==t&&"finished"!==t||n.delete(e)}),M())return;for(const t of n)if(!t.canAccelerate)return k.demote(!0);k.isJS&&(k.isJS=!1,l=!0,n.forEach(t=>t.js?.stop()));const i=l,o=h;if(l=h=!1,i||!E(e)){if(o){if(e-p<100)return k.demote();p=e}if(!P(e))return k.demote()}},k={tracks:n,isJS:!1,isFinishing:!1,schedule(t,e){u||(l||(l=t),h||(h=!!e),c||(c=!0,W.isProcessing?Kt.render(V,!1,!0):queueMicrotask(V)))},release(t){const{state:e}=t;"idle"!==e&&"finished"!==e||n.delete(t),M()||k.schedule(!0)},check(){if(!k.isJS)for(const e in s)if(ri(t,e)!==s[e]&&!m(e))return k.schedule(!0,!0)},demote(t){k.isJS||u||(n.forEach(e=>{e.isAccelerated()&&e.sync(),t||(e.canAccelerate=!1)}),k.isJS=!0,r=new Map,v(),n.forEach(t=>"running"===t.state&&t.js?.start()))}};return ti.set(e,k),k}(si(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($.now())}get time(){return this.isAccelerated()?f(i(0,this.totalDuration,this.at($.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 li extends Be{constructor(t){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=$.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||An;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:r,velocity:a,delay:l,isHandoff:c,onUpdate:u}=n;this.resolvedAt=$.now();let h=!0;(function(t,e,n,i){const s=t[0];if(null===s)return!1;if("display"===e||"visibility"===e)return!0;const o=t[t.length-1],r=zn(s,e),a=zn(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||On(n))&&i)})(t,s,r,a)||(h=!1,!o.instantAnimations&&l||u?.(Ve(t,n,e)),t[0]=t[t.length-1],Kn(n),n.repeat=0);const{onComplete:d}=n;n.finalKeyframe=e,n.keyframes=t,n.onComplete=()=>{d?.(),this.notifyFinished()};const p=h&&!c&&_n(n),m=!p&&(({name:t,motionValue:e})=>t&&cn.includes(t)&&e?.owner?.current instanceof HTMLElement&&Hn()&&Cn())(n);let f;if(i&&(p||m||this.resolvedAt!==this.createdAt)&&(n.startTime??(n.startTime=Ce(this.createdAt,this.resolvedAt))),p){n.element=n.motionValue?.owner?.current;try{f=new $n(n)}catch{f=new Ie(n)}}else f=m?new ai(n):new Ie(n);this.pendingTimeline&&(this.stopTimeline=f.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=f}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(),Sn()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}class ci{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;n<this.animations.length;n++)this.animations[n][t]=e}attachTimeline(t){const e=this.animations.map(e=>e.attachTimeline(t));return()=>{e.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return ui(this.animations,"duration")}get iterationDuration(){return ui(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(e=>e[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function ui(t,e){let n=0;for(let i=0;i<t.length;i++){const s=t[i][e];null!==s&&s>n&&(n=s)}return n}class hi extends ci{then(t,e){return this.finished.finally(t).then(()=>{})}}class di extends Fn{constructor(t){super(),this.animation=t,t.onfinish=()=>{this.finishedTime=this.time,this.notifyFinished()},Re(this,{})}}const pi=new WeakMap,mi=(t,e="")=>`${t}:${e}`;function fi(t){let e=pi.get(t);return e||(e=new Map,pi.set(t,e)),e}function gi(t,e,n,i=0,s=1){const o=Array.from(t).sort((t,e)=>t.sortNodePosition(e)).indexOf(e),r=t.size,a=(r-1)*i;return"function"==typeof n?n(o,r):1===s?o*i:a-o*i}const yi={current:void 0};class vi{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=$.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.notifyChange(),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=$.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 p)).add(e)}onChangeSubscribe(t){const{events:e}=this;return e.change||this.changeSubscriber?(e.change||(e.change=new p,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(){Kt.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&&this.stopPassiveEffect()}dirty(){this.notifyChange()}notifyChange(){const{current:t,changeSubscriber:e}=this;e?e(t):this.events.change?.notify(t)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){yi.current&&yi.current.push(this);const t=this.animation?.liveValue?.();return void 0===t?this.current:t}getCurrent(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=$.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return g(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.clearAnimation(),e()}),i||(this.animation=n),this.events.animationStart?.notify()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){this.animation=void 0}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function xi(t,e){return new vi(t,e)}function wi(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}function Ti(t,e){const n=t?.[e]??t?.default??t;return n!==t?wi(n,t):n}const bi={type:"spring",stiffness:500,damping:25,restSpeed:10},Si={type:"keyframes",duration:.8},Ai={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Pi=(t,{keyframes:e})=>e.length>2?Si:un.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:bi:Ai,Ei=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function Mi(t){for(const e in t)if(!Ei.has(e))return!0;return!1}const Vi=(t,e,n,i={},s,r)=>a=>{const l=Ti(i,t)||{},c=l.delay||i.delay||0;let{elapsed:u=0}=i;u-=m(c);const h={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-u,onUpdate:t=>{e.set(t),l.onUpdate&&l.onUpdate(t)},onComplete:()=>{a(),l.onComplete&&l.onComplete()},name:t,motionValue:e,element:r?void 0:s,hasOnUpdate:!!l.onUpdate};Mi(l)||Object.assign(h,Pi(t,h)),h.duration&&(h.duration=m(h.duration)),h.repeatDelay&&(h.repeatDelay=m(h.repeatDelay)),void 0!==h.from&&(h.keyframes[0]=h.from);let d=!1;if((!1===h.type||0===h.duration&&!h.repeatDelay)&&(Kn(h),0===h.delay&&(d=!0)),(o.instantAnimations||o.skipAnimations||s?.shouldSkipAnimations||l.skipAnimations)&&(d=!0,Kn(h),h.delay=0),h.allowFlatten=!l.type&&!l.ease,d&&!r&&void 0!==e.get()){const t=Ve(h.keyframes,l);if(void 0!==t)return void Kt.update(()=>{h.onUpdate(t),h.onComplete()})}return l.isSync?new Ie(h):new li(h)};function ki(t,e,n,i){const s=1-t;return s*s*e+2*s*t*n+t*t*i}function Di(t,e,n,i,s,o,r){const a=2*(1-t)*(n-e)+2*t*(i-n),l=2*(1-t)*(o-s)+2*t*(r-o);return Math.atan2(l,a)*(180/Math.PI)}function Ci(t,e,n,i,s,o){const r=n-t,a=i-e,l=Math.sqrt(r*r+a*a);if(l>0){const n=s*l;return{x:t+r*o+-a/l*n,y:e+a*o+r/l*n}}return{x:t,y:e}}const Li=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Ri(t){const e=Li.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n??i}`,s]}function Bi(t,e,n=1){const[i,s]=Ri(t);if(!i)return;const o=window.getComputedStyle(e).getPropertyValue(i);if(o){const t=o.trim();return r(t)?parseFloat(t):t}return G(s)?Bi(s,e,n+1):s}function ji(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 Oi(t,e,n){return ji(t.getProps(),e,n,t)}const Ii=(t,e)=>"exit"===e?t.presenceContext?.custom:void 0,Fi=new Set(["width","height","top","left","right","bottom",...cn]),Wi=t=>Array.isArray(t);function Ni(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,xi(n))}function Ui(t){return Wi(t)?t[t.length-1]||0:t}function $i(t,e){const n=Oi(t,e);let{transitionEnd:i={},transition:s={},...o}=n||{};o={...o,...i};for(const e in o){Ni(t,e,Ui(o[e]))}}const zi=t=>Boolean(t&&t.getVelocity);function Ki(t){return Boolean(zi(t)&&t.add)}function Yi(t,e){const n=t.getValue("willChange");if(Ki(n))return n.add(e);if(!n&&o.WillChange){const n=new o.WillChange("auto");t.addValue("willChange",n),n.add(e)}}function Xi(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const Gi="framerAppearId",Hi="data-"+Xi(Gi);function _i(t){return t.props[Hi]}const qi="undefined"!=typeof window;function Zi({protectedKeys:t,needsAnimating:e},n){const i=n in t&&!e[n];return e[n]=!1,i}function Ji(t,e,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:o,transitionEnd:r,...a}=e;const l=t.getDefaultTransition();o=o?wi(o,l):l;const c=o?.reduceMotion,u=o?.skipAnimations;i&&(o=i);const h=[],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,h):p.animateVisualElement?.(t,a,o,n,h));for(const e in a){const i=t.getValue(e,t.latestValues[e]??null),s=a[e];if(void 0===s||d&&Zi(d,e))continue;const r={delay:n,...Ti(o||{},e)};u&&(r.skipAnimations=!0);const l=i.get();if(void 0!==l&&!i.isAnimating()&&!Array.isArray(s)&&s===l&&!r.velocity){Kt.update(()=>i.set(s));continue}let p=!1;if(qi&&window.MotionHandoffAnimation){const n=_i(t);if(n){const t=window.MotionHandoffAnimation(n,e,Kt);null!==t&&(r.startTime=t,p=!0)}}Yi(t,e);const m=c??t.shouldReduceMotion;i.start(Vi(e,i,s,m&&Fi.has(e)?{type:!1}:r,t,p));const f=i.animation;f&&h.push(f)}if(r){const e=()=>Kt.update(()=>{r&&$i(t,r)});h.length?Promise.all(h).then(e):e()}return h}function Qi(t,e,n={}){const i=Oi(t,e,Ii(t,n.type)),s=n.transitionOverride||(i?.transition??(t.getDefaultTransition()||{})),o=()=>Promise.all(i?Ji(t,i,n):[]),r=(i=0)=>{const{variantChildren:o}=t,{delayChildren:r=0,staggerChildren:a,staggerDirection:l}=s,c=[];return o?.forEach(t=>{t.notify("AnimationStart",e),c.push(Qi(t,e,{...n,delay:i+("function"==typeof r?0:r)+gi(o,t,r,a,l)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(c)},{when:a}=s;return a?"beforeChildren"===a?o().then(()=>r()):r().then(o):Promise.all([o(),r(n.delay)])}function ts(t,e,n={}){t.notify("AnimationStart",e);return(Array.isArray(e)?Promise.all(e.map(e=>Qi(t,e,n))):"string"==typeof e?Qi(t,e,n):Promise.all(Ji(t,Oi(t,e,n.custom),n))).then(()=>{t.notify("AnimationComplete",e)})}const es=t=>e=>e.test(t),ns=[q,ct,lt,at,ht,ut,{test:t=>"auto"===t,parse:t=>t}],is=t=>ns.find(es(t));function ss(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||l(t))}const os=new Set(["auto","none","0"]);class rs extends An{constructor(t,e,n,i,s){super(t,e,n,i,s,!0)}scheduleResolve(){if(this.canReadNow()&&(this.readKeyframes(),!this.needsMeasurement))return this.complete();super.scheduleResolve()}canReadNow(){const{unresolvedKeyframes:t,element:e,motionValue:n}=this,i=t[0]??n?.get();if(!e?.current||void 0===i)return!1;for(let e=0;e<t.length;e++)if(_(e?t[e]:i))return!1;return!0}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){let i=t[n];if("string"==typeof i&&(i=i.trim(),G(i))){const s=Bi(i,e.current);void 0!==s&&(t[n]=s),n===t.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!Fi.has(n)||2!==t.length)return;const[i,s]=t;if("number"==typeof i&&"number"==typeof s)return;const o=is(i),r=is(s);if(_(i)!==_(s)&&gn[n])this.needsMeasurement=!0;else if(o!==r)if(hn(o)&&hn(r))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else gn[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)(null===t[e]||ss(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&&!os.has(e)&&wt(e)&&(i=t[s]),s++}if(i&&n)for(const s of e)t[s]!==i&&(t[s]=_e(n,i))}(t,n,e)}measure(){const{element:t,name:e}=this;return gn[e](window.getComputedStyle(t.current),()=>t.measureViewportBox())}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!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||!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.removedTransforms?.length&&this.removedTransforms.forEach(([e,n])=>{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const as=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],ls=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius",...as,"width","maxWidth","height","maxHeight","top","right","bottom","left","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInline","insetInlineStart","insetInlineEnd","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingBlock","paddingBlockStart","paddingBlockEnd","paddingInline","paddingInlineStart","paddingInlineEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockStart","marginBlockEnd","marginInline","marginInlineStart","marginInlineEnd","fontSize","backgroundPositionX","backgroundPositionY"]);function cs(t,e){for(let n=0;n<t.length;n++)"number"==typeof t[n]&&ls.has(e)&&(t[n]=t[n]+"px")}const us=c(()=>{try{document.createElement("div").animate({opacity:[1]})}catch(t){return!1}return!0}),hs=[];function ds(t){"function"==typeof t.test&&t.read,ps(t),hs.unshift(t)}function ps(t){n(hs,t)}function ms(t){return hs.find(e=>e.test(t))}function fs(t,e,n={},i){const s=[],{velocity:o,path:r}=n,a=n.reduceMotion??i?.shouldReduceMotion;r?.animateValues&&i&&(e={...e},r.animateValues(t,e,n,0,s));for(const r in e){if("transition"===r||"transitionEnd"===r)continue;const l=e[r];if(void 0===l)continue;const c=t(r),u=c.get();void 0===u||c.isAnimating()||Array.isArray(l)||l!==u||o?(c.start(Vi(r,c,l,a&&Fi.has(r)?{type:!1}:n,i)),c.animation&&s.push(c.animation)):Kt.update(()=>c.set(l))}const{transitionEnd:l}=e;if(l){const e=()=>Kt.update(()=>{for(const e in l)t(e).set(l[e])});s.length?Promise.all(s).then(e):e()}return s}function gs(t,e,n,i,s){return fs(i=>{let o=t.get(e,i);if(!o){let r;if(!s){const s=n[i];r=function(t){const e=Array.isArray(t)?t[0]:void 0;return null===e?void 0:e}(s)??t.read(e,i,s)}o=xi(r,{owner:s}),t(e,{[i]:o})}return o},n,i,s)}function ys(t){return a(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}function vs(t){return a(t)&&"ownerSVGElement"in t}function xs(t,e,n){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let i=document;e&&(i=e.current);const s=n?.[t]??i.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t).filter(t=>null!=t)}function ws(t){const{test:e,read:n,get:i,flush:s,state:o}=t;return Object.assign((e,n)=>{const i=xs(e),s=[];for(const e of i){const i=t(e,n);s.push(i)}return()=>{for(const t of s)t()}},{test:e,read:n,get:i,flush:s,state:o})}class Ts{constructor(t=Kt.render){this.step=t,this.values=new Map,this.pending=[],this.numPending=0,this.flush=()=>{const{pending:t,numPending:e}=this;this.numPending=0;for(let n=0;n<e;n++)t[n]()}}set(t,e,n,i){if(this.values.get(t)?.onRemove(),i)for(const t of this.values.values())t.value===i&&(n=t.render);const s=()=>n&&this.schedule(n);void 0!==e.get()&&s();const o=e.on("change",s),r=()=>{o(),n&&!i&&this.cancel(n),this.values.get(t)?.onRemove===r&&this.values.delete(t)};return this.values.set(t,{value:e,render:i?void 0:n,onRemove:r}),r}get(t){return this.values.get(t)?.value}release(){const t=new Map;return this.values.forEach((e,n)=>{t.set(n,e.value),e.onRemove()}),this.transformKeys=this.transformValues=void 0,t}schedule(t){const{pending:e,numPending:n}=this;for(let i=0;i<n;i++)if(e[i]===t)return;n||this.step(this.flush),e[this.numPending++]=t}cancel(t){const{pending:e}=this;for(let n=0;n<this.numPending;n++)if(e[n]===t)return void(e[n]=e[--this.numPending])}}function bs(t,{step:e,...n}={}){const i=new WeakMap;return Object.assign((n,s)=>{const o=i.get(n)??new Ts(e);i.set(n,o);const r=[];for(const e in s){const i=s[e],a=t(n,o,e,i);r.push(a)}return()=>{for(const t of r)t()}},n,{get:(t,e)=>i.get(t)?.get(e),flush:t=>i.get(t)?.flush(),state:t=>i.get(t)})}const Ss={};const As=new Set(["originX","originY","originZ"]),Ps=(t,e)=>qn(t.get(e)?.get(),Ye[e]),Es=(t,e,n,i)=>{let s,o;if(un.has(n)){if("pathRotation"!==n){const t=e.transformKeys??(e.transformKeys=[]);(e.transformValues??(e.transformValues={}))[n]=i,t.includes(n)||(t.push(n),t.sort((t,e)=>cn.indexOf(t)-cn.indexOf(e)))}e.get("transform")||(ys(t)||e.get("transformBox")||Es(t,e,"transformBox",new vi("fill-box")),e.set("transform",new vi("none"),()=>{ti.get(t)?.check(),t.style.transform=function(t){let e="";const{transformKeys:n=[],transformValues:i={}}=t;for(let t=0;t<n.length;t++){const s=n[t],o=i[s].getCurrent();void 0!==o&&(("number"==typeof o?o:parseFloat(o))!==(s.startsWith("scale")?1:0)&&(e+=(e&&" ")+(Ss[s]||(Ss[s]=(Zn[s]||s)+"("))+qn(o,Ke[s])+")"))}const s=t.get("pathRotation")?.get();return s&&(e+=(e&&" ")+"rotate("+qn(s,Ke.pathRotation)+")"),e||"none"}(e)})),o=e.get("transform")}else As.has(n)?(e.get("transformOrigin")||e.set("transformOrigin",new vi(""),()=>{const n=Ps(e,"originX")??"50%",i=Ps(e,"originY")??"50%",s=Ps(e,"originZ")??0;t.style.transformOrigin=`${n} ${i} ${s}`}),o=e.get("transformOrigin")):s=Pn(n)?()=>{t.style.setProperty(n,i.getCurrent())}:()=>{t.style[n]=qn(i.getCurrent(),Ye[n])};return e.set(n,i,s,o)},Ms=(t,e)=>{if(un.has(e))return an(t,e);const n=getComputedStyle(t),i=Pn(e)?n.getPropertyValue(e):n[e];return"string"==typeof i&&i.trim()||0},Vs=bs(Es,{test:t=>ys(t)||vs(t),read:Ms}),ks=ws(Vs);function Ds(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(un.has(t))r=!0;else if(Y(t))s[t]=n;else{const e=qn(n,Ye[t]);t.startsWith("origin")?(a=!0,o[t]=e):i[t]=e}}if(e.transform||(r||n?i.transform=Qn(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 Cs={offset:"stroke-dashoffset",array:"stroke-dasharray"},Ls={offset:"strokeDashoffset",array:"strokeDasharray"};function Rs(t,e,n=1,i=0,s=!0){t.pathLength=1;const o=s?Cs:Ls;t[o.offset]=""+-i,t[o.array]=`${e} ${n}`}const Bs=["transform","opacity","clipPath","filter","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function js(t,{attrX:e,attrY:n,attrScale:i,pathLength:s,pathSpacing:o=1,pathOffset:r=0,...a},l,c,u){if(Ds(t,a,c),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:h,style:d}=t;for(const t of Bs)void 0!==h[t]&&(d[t]=h[t],delete h[t]);(d.transform||h.transformOrigin)&&(d.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete h.transformBox),void 0!==e&&(h.x=e),void 0!==n&&(h.y=n),void 0!==i&&(h.scale=i),void 0!==s&&Rs(h,s,o,r,!1)}const Os=(t,e,n,i,s=n)=>{const o=function(t,e){if(!(e in t))return!1;const n=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t),e)||Object.getOwnPropertyDescriptor(t,e);return n&&"function"==typeof n.set}(t,s);o||!s.startsWith("data")&&!s.startsWith("aria")||(s=Xi(s));const r=Ye[n]||Ye[s],a=o?()=>{t[s]=qn(i.get(),Ye[n])}:()=>{const e=qn(i.get(),r);null==e?t.removeAttribute(s):t.setAttribute(s,String(e))};return e.set(n,i,a)},Is=ws(bs(Os));const Fs=(t,e,n,i)=>{if(n.startsWith("path")&&!un.has(n))return function(t,e,n,i){return Kt.render(()=>t.setAttribute("pathLength","1")),"pathOffset"===n?e.set(n,i,()=>{const e=i.get();t.setAttribute("stroke-dashoffset",""+-e)}):(e.get("stroke-dasharray")||e.set("stroke-dasharray",new vi("1 1"),()=>{const n=e.get("pathLength")?.get()??1,i=e.get("pathSpacing")?.get();t.setAttribute("stroke-dasharray",`${n} ${i??1-Number(n)}`)}),e.set(n,i,void 0,e.get("stroke-dasharray")))}(t,e,n,i);if(n.startsWith("attr"))return Os(t,e,n,i,$s(n));return(un.has(n)||As.has(n)||Pn(n)||n in t.style?Es:Os)(t,e,n,i)},Ws=(t,e)=>un.has(e)?Ye[e]?.default||0:Pn(e)||Bs.includes(e)?Ms(t,e)||t.getAttribute(Xi(e))||0:(e=$s(e),t.getAttribute(Xi(e))??t.getAttribute(e)??void 0),Ns=bs(Fs,{test:vs,read:Ws}),Us=ws(Ns);function $s(t){return t.replace(/^attr([A-Z])/,(t,e)=>e.toLowerCase())}function zs({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function Ks({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function Ys(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}}function Xs(t){return void 0===t||1===t}function Gs({scale:t,scaleX:e,scaleY:n}){return!Xs(t)||!Xs(e)||!Xs(n)}function Hs(t){return Gs(t)||_s(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.rotateZ||t.skewX||t.skewY}function _s(t){return qs(t.x)||qs(t.y)}function qs(t){return t&&"0%"!==t}function Zs(t,e,n){return n+e*(t-n)}function Js(t,e,n,i,s){return void 0!==s&&(t=Zs(t,s,i)),Zs(t,n,i)+e}function Qs(t,e=0,n=1,i,s){t.min=Js(t.min,e,n,i,s),t.max=Js(t.max,e,n,i,s)}function to(t,{x:e,y:n}){Qs(t.x,e.translate,e.scale,e.originPoint),Qs(t.y,n.translate,n.scale,n.originPoint)}const eo=.999999999999,no=1.0000000000001;function io(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;const{visualElement:s}=o.options;s&&s.props.style&&"contents"===s.props.style.display||(i&&o.options.layoutScroll&&o.scroll&&o!==o.root&&(so(t.x,-o.scroll.offset.x),so(t.y,-o.scroll.offset.y)),r&&(e.x*=r.x.scale,e.y*=r.y.scale,to(t,r)),i&&Hs(o.latestValues)&&ao(t,o.latestValues,o.layout?.layoutBox))}e.x<no&&e.x>eo&&(e.x=1),e.y<no&&e.y>eo&&(e.y=1)}function so(t,e){t.min+=e,t.max+=e}function oo(t,e,n,i,s=.5){Qs(t,e,n,Vt(t.min,t.max,s),i)}function ro(t,e){return"string"==typeof t?parseFloat(t)/100*(e.max-e.min):t}function ao(t,e,n){const i=n??t;oo(t.x,ro(e.x,i.x),e.scaleX,e.scale,e.originX),oo(t.y,ro(e.y,i.y),e.scaleY,e.scale,e.originY)}function lo(t,e){return zs(Ys(t.getBoundingClientRect(),e))}function co(t,e,n){const i=lo(t,n),{scroll:s}=e;return s&&(so(i.x,s.offset.x),so(i.y,s.offset.y)),i}const uo={},ho=t=>vs(t)?Ns:Vs;class po{constructor(t,e){this.effect=t,this.current=e,this.KeyframeResolver=rs}getValue(t){return this.effect.get(this.current,t)}readValue(t,e){return this.effect.read(this.current,t,e)}render(){this.effect.flush(this.current)}measureViewportBox(){return lo(this.current)}getProps(){return uo}}function mo(t,e,n,i){if(i)return fs(t=>i.getValue(t,null),e,n,i);const s=ho(t);return gs(s,t,e,n,new po(s,t))}function fo(t,e){const n=ho(t).state(t);if(!n)return;const i=ti.get(t);i&&(i.demote(),ti.delete(t));const{transformKeys:s}=n;n.release().forEach((t,n)=>{"transformBox"===n||"transform"===n&&s?.length||(t.owner=e,e.addValue(n,t))})}const go=bs((t,e,n,i)=>e.set(n,i,()=>{t[n]=i.get()}),{test:t=>a(t),read:(t,e)=>{const n=t[e];return"string"==typeof n||"number"==typeof n?n:void 0}}),{schedule:yo,cancel:vo}=zt(queueMicrotask,!1);function xo(t,e,n){const i=zi(t)?t:xi(t);return i.start(Vi("",i,e,n)),i.animation}const wo={};const To={value:null,addProjectionMetrics:null};function bo(t,e){const n=$.now(),i=({timestamp:s})=>{const o=s-n;o>=e&&(Yt(i),t(o-e))};return Kt.setup(i,!0),()=>Yt(i)}function So(t,e){return bo(t,m(e))}function Ao(t){return vs(t)&&"svg"===t.tagName}function Po(t){return zi(t)?t.get():t}const Eo=t=>"number"==typeof t?t:parseFloat(t),Mo=as.length,Vo=["rotate","rotateX","rotateY","rotateZ","skewX","skewY"],ko=Vo.length,Do=t=>"number"==typeof t||ct.test(t);function Co(t,e,n,i,s,o){s?(t.opacity=Vt(0,n.opacity??1,Ro(i)),t.opacityExit=Vt(e.opacity??1,0,Bo(i))):o&&(t.opacity=Vt(e.opacity??1,n.opacity??1,i));for(let s=0;s<Mo;s++){const o=as[s];let r=Lo(e,o),a=Lo(n,o);if(void 0===r&&void 0===a)continue;r||(r=0),a||(a=0);0===r||0===a||Do(r)===Do(a)?(t[o]=Math.max(Vt(Eo(r),Eo(a),i),0),(lt.test(a)||lt.test(r))&&(t[o]+="%")):t[o]=a}for(let s=0;s<ko;s++){const o=Vo[s];(e[o]||n[o])&&(t[o]=Vt(e[o]||0,n[o]||0,i))}}function Lo(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const Ro=jo(0,.5,k),Bo=jo(.5,.95,u);function jo(t,e,n){return i=>i<t?0:i>e?1:n(d(t,e,i))}function Oo(t,e){t.min=e.min,t.max=e.max}function Io(t,e){Oo(t.x,e.x),Oo(t.y,e.y)}function Fo(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function Wo(t){return t.max-t.min}function No(t,e,n){return Math.abs(t-e)<=n}function Uo(t,e,n,i=.5){t.origin=i,t.originPoint=Vt(e.min,e.max,t.origin),t.scale=Wo(n)/Wo(e),t.translate=Vt(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 $o(t,e,n,i){Uo(t.x,e.x,n.x,i?i.originX:void 0),Uo(t.y,e.y,n.y,i?i.originY:void 0)}function zo(t,e,n,i=0){const s=i?Vt(n.min,n.max,i):n.min;t.min=s+e.min,t.max=t.min+Wo(e)}function Ko(t,e,n,i){zo(t.x,e.x,n.x,i?.x),zo(t.y,e.y,n.y,i?.y)}function Yo(t,e,n,i=0){const s=i?Vt(n.min,n.max,i):n.min;t.min=e.min-s,t.max=t.min+Wo(e)}function Xo(t,e,n,i){Yo(t.x,e.x,n.x,i?.x),Yo(t.y,e.y,n.y,i?.y)}function Go(t,e,n,i,s){return t=Zs(t-=e,1/n,i),void 0!==s&&(t=Zs(t,1/s,i)),t}function Ho(t,e=0,n=1,i=.5,s,o=t,r=t){if(lt.test(e)){e=parseFloat(e);e=Vt(r.min,r.max,e/100)-r.min}if("number"!=typeof e)return;let a=Vt(o.min,o.max,i);t===o&&(a-=e),t.min=Go(t.min,e,n,a,s),t.max=Go(t.max,e,n,a,s)}function _o(t,e,[n,i,s],o,r){Ho(t,e[n],e[i],e[s],e.scale,o,r)}const qo=["x","scaleX","originX"],Zo=["y","scaleY","originY"];function Jo(t,e,n,i){_o(t.x,e,qo,n?n.x:void 0,i?i.x:void 0),_o(t.y,e,Zo,n?n.y:void 0,i?i.y:void 0)}const Qo=()=>({translate:0,scale:1,origin:0,originPoint:0}),tr=()=>({x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}),er=()=>({min:0,max:0}),nr=()=>({x:{min:0,max:0},y:{min:0,max:0}});function ir(t){return 0===t.translate&&1===t.scale}function sr(t){return ir(t.x)&&ir(t.y)}function or(t,e){return t.min===e.min&&t.max===e.max}function rr(t,e){return or(t.x,e.x)&&or(t.y,e.y)}function ar(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function lr(t,e){return ar(t.x,e.x)&&ar(t.y,e.y)}function cr(t){return Wo(t.x)/Wo(t.y)}function ur(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class hr{constructor(){this.members=[]}add(t){e(this.members,t);for(let e=this.members.length-1;e>=0;e--){const i=this.members[e];if(i===t||i===this.lead||i===this.prevLead)continue;const s=i.instance;s&&!1!==s.isConnected||i.snapshot||(n(this.members,i),i.unmount())}t.scheduleRender()}remove(t){if(n(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 dr(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const pr={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!ct.test(t))return t;t=parseFloat(t)}return`${dr(t,e.target.x)}% ${dr(t,e.target.y)}%`}},mr={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=At.parse(t);if(s.length>5)return i;const o=At.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 c=Vt(a,l,.5);return"number"==typeof s[2+r]&&(s[2+r]/=c),"number"==typeof s[3+r]&&(s[3+r]/=c),o(s)}},fr={borderRadius:{...pr,applyTo:[...as]},borderTopLeftRadius:pr,borderTopRightRadius:pr,borderBottomLeftRadius:pr,borderBottomRightRadius:pr,boxShadow:mr};function gr(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,rotate:e,pathRotation:s,rotateX:o,rotateY:r,rotateZ:a,skewX:l,skewY:c}=n;t&&(i=`perspective(${t}px) ${i}`),e&&(i+=`rotate(${e}deg) `),s&&(i+=`rotate(${s}deg) `),o&&(i+=`rotateX(${o}deg) `),r&&(i+=`rotateY(${r}deg) `),a&&(i+=`rotateZ(${a}deg) `),l&&(i+=`skewX(${l}deg) `),c&&(i+=`skewY(${c}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"}function yr(t){return[t("x"),t("y")]}const vr=(t,e)=>t.depth-e.depth;class xr{constructor(){this.children=[],this.isDirty=!1}add(t){e(this.children,t),this.isDirty=!0}remove(t){n(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(vr),this.isDirty=!1,this.children.forEach(t)}}const wr={hasAnimatedSinceResize:!0,hasEverUpdated:!1};Object.assign(wo,{...fr,...wo});const Tr={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},br=["","X","Y","Z"];let Sr=0;function Ar(t,e,n,i){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),i&&(i[t]=0))}const Pr=({instance:t})=>t&&ti.get(t)?.demote();function Er(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=_i(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:e,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",Kt,!(e||i))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&Er(i)}function Mr({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:o}){return class{constructor(t={},n=e?.()){this.id=Sr++,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,To.value&&(Tr.nodes=Tr.calculatedTargetDeltas=Tr.calculatedProjections=0),this.nodes.forEach(Dr),this.nodes.forEach(Nr),this.nodes.forEach(Ur),this.nodes.forEach(Cr),To.addProjectionMetrics&&To.addProjectionMetrics(Tr)},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 xr)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new p),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){const n=this.eventHandlers.get(t);n&&n.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}mount(e){if(this.instance)return;this.isSVG=vs(e)&&!Ao(e),this.instance=e;const{layoutId:n,layout:i,visualElement:s}=this.options;if(s&&!s.current&&s.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(i||n)&&(this.isLayoutDirty=!0),t){let n,i=0;const s=()=>this.root.updateBlockedByResize=!1;Kt.read(()=>{i=window.innerWidth}),t(e,()=>{const t=window.innerWidth;t!==i&&(i=t,this.root.updateBlockedByResize=!0,n&&n(),n=bo(s,250),wr.hasAnimatedSinceResize&&(wr.hasAnimatedSinceResize=!1,this.nodes.forEach(Wr)))})}n&&this.root.registerSharedNode(n,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()||Xr,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=n.getProps(),l=!this.targetLayout||!lr(this.targetLayout,s),c=!e&&i;if(this.options.layoutRoot||this.resumeFrom||c||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const e={...Ti(o,"layout"),onPlay:r,onComplete:a};(n.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e),this.setAnimationOrigin(t,c,e.path)}else e||Wr(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=s}))}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),this.hasLayoutListener=!1,Yt(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach($r),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Er(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;Pr(this),this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){const e=this.path[t];e.shouldResetTransform=!0,Pr(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(Br),void this.nodes.forEach(Rr)}if(this.animationId<=this.animationCommitId)return void this.nodes.forEach(jr);this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Or),this.nodes.forEach(Ir),this.nodes.forEach(Fr),this.nodes.forEach(Vr),this.nodes.forEach(kr)):this.nodes.forEach(jr),this.clearAllSnapshots();const t=$.now();W.delta=i(0,1e3/60,t-W.timestamp),W.timestamp=t,W.isProcessing=!0,Xt.update.process(W),Xt.preRender.process(W),Xt.render.process(W),W.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,yo.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Lr),this.sharedNodes.forEach((t,e)=>t.members.length?t.removeLeadSnapshot():this.sharedNodes.delete(e))}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Kt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Kt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||Wo(this.snapshot.measuredBox.x)||Wo(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&&e.notify("LayoutMeasure",this.layout.layoutBox,t?t.layoutBox:void 0)}updateScroll(t="measure"){let e=Boolean(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===t&&(e=!1),e&&this.instance){const e=s(this.instance);this.scroll={animationId:this.root.animationId,phase:t,isRoot:e,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:e}}}resetTransform(){if(!o)return;const t=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout;t&&Pr(this);const e=this.projectionDelta&&!sr(this.projectionDelta),n=this.getTransformTemplate(),i=n?n(this.latestValues,""):void 0,s=i!==this.prevTransformTemplateValue;t&&this.instance&&(e||Hs(this.latestValues)||s)&&(o(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)),_r((i=n).x),_r(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(Zr))){const{scroll:t}=this.root;t&&(so(e.x,t.offset.x),so(e.y,t.offset.y))}return e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};if(Io(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&&Io(e,t),so(e.x,s.offset.x),so(e.y,s.offset.y))}return e}applyTransform(t,e=!1,n){const i=n||{x:{min:0,max:0},y:{min:0,max:0}};Io(i,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];!e&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(so(i.x,-n.scroll.offset.x),so(i.y,-n.scroll.offset.y)),Hs(n.latestValues)&&ao(i,n.latestValues,n.layout?.layoutBox)}return Hs(this.latestValues)&&ao(i,this.latestValues,this.layout?.layoutBox),i}removeTransform(t){const e={x:{min:0,max:0},y:{min:0,max:0}};Io(e,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];if(!Hs(n.latestValues))continue;let i;n.instance&&(Gs(n.latestValues)&&n.updateSnapshot(),i=nr(),Io(i,n.measurePageBox())),Jo(e,n.latestValues,n.snapshot?.layoutBox,i)}return Hs(this.latestValues)&&Jo(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!==W.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=W.timestamp;const o=this.getClosestProjectingParent();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(),Ko(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(Boolean(this.resumingFrom)?this.applyTransform(this.layout.layoutBox,!1,this.target):Io(this.target,this.layout.layoutBox),to(this.target,this.targetDelta)):Io(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,!1!==this.options.layoutAnchor&&o&&Boolean(o.resumingFrom)===Boolean(this.resumingFrom)&&!o.options.layoutScroll&&o.target&&1!==this.animationProgress?this.createRelativeTarget(o,this.target,o.target):this.relativeParent=this.relativeTarget=void 0),To.value&&Tr.calculatedTargetDeltas++)}getClosestProjectingParent(){if(this.parent&&!Gs(this.parent.latestValues)&&!_s(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}},Xo(this.relativeTargetOrigin,e,n,this.options.layoutAnchor||void 0),Io(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===W.timestamp&&(n=!1),n)return;const{layout:i,layoutId:s}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!i&&!s)return;Io(this.layoutCorrected,this.layout.layoutBox);const o=this.treeScale.x,r=this.treeScale.y;io(this.layoutCorrected,this.treeScale,this.path,e),!t.layout||t.target||1===this.treeScale.x&&1===this.treeScale.y||(t.target=t.layout.layoutBox,t.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:a}=t;a?(this.projectionDelta&&this.prevProjectionDelta?(Fo(this.prevProjectionDelta.x,this.projectionDelta.x),Fo(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),$o(this.projectionDelta,this.layoutCorrected,a,this.latestValues),this.treeScale.x===o&&this.treeScale.y===r&&ur(this.projectionDelta.x,this.prevProjectionDelta.x)&&ur(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",a)),To.value&&Tr.calculatedProjections++):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){if(this.options.visualElement?.scheduleRender(),t){const t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}}setAnimationOrigin(t,e=!1,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?i.source:void 0)!==(this.layout?this.layout.source:void 0),c=this.getStack(),u=!c||c.members.length<=1,h=Boolean(l&&!u&&!0===this.options.crossfade&&!this.path.some(Yr));let d;this.animationProgress=0;const p=n?.interpolateProjection(t);this.mixTargetDelta=e=>{const n=e/1e3,i=p?.(n);var c,m,f,g;i?(r.x.translate=i.x,r.x.scale=Vt(t.x.scale,1,n),r.x.origin=t.x.origin,r.x.originPoint=t.x.originPoint,r.y.translate=i.y,r.y.scale=Vt(t.y.scale,1,n),r.y.origin=t.y.origin,r.y.originPoint=t.y.originPoint):(zr(r.x,t.x,n),zr(r.y,t.y,n)),this.setTargetDelta(r),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Xo(a,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),c=this.relativeTarget,m=this.relativeTargetOrigin,f=a,g=n,Kr(c.x,m.x,f.x,g),Kr(c.y,m.y,f.y,g),d&&rr(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),Io(d,this.relativeTarget)),l&&(this.animationValues=o,Co(o,s,this.latestValues,n,h,u)),i&&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&&(Yt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Kt.update(()=>{wr.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=xi(0)),this.motionValue.jump(0,!1),this.currentAnimation=xo(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({...Le("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&&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&&qr(this.options.animationType,this.layout.layoutBox,n.layoutBox)){s=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=Wo(this.layout.layoutBox.x);s.x.min=t.target.x.min,s.x.max=s.x.min+e;const n=Wo(this.layout.layoutBox.y);s.y.min=t.target.y.min,s.y.max=s.y.min+n}Io(e,s),ao(e,i),$o(this.projectionDeltaWithTransform,this.layoutCorrected,e,i)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new hr);this.sharedNodes.get(t).add(e);const n=e.options.initialPromotionConfig;e.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){const{layoutId:t}=this.options;return t&&this.getStack()?.lead||this}getPrevLead(){const{layoutId:t}=this.options;return t?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const i=this.getStack();i&&i.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:n}=t;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(e=!0),!e)return;const i={};n.z&&Ar("z",t,i,this.animationValues);for(let e=0;e<br.length;e++)Ar(`rotate${br[e]}`,t,i,this.animationValues),Ar(`skew${br[e]}`,t,i,this.animationValues);t.render();for(const e in i)t.setStaticValue(e,i[e]),this.animationValues&&(this.animationValues[e]=i[e]);t.scheduleRender()}applyProjectionStyles(t,e){if(!this.instance||this.isSVG)return;if(!this.isVisible)return void(t.visibility="hidden");const n=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,t.visibility="",t.opacity="",t.pointerEvents=Po(e?.pointerEvents)||"",void(t.transform=n?n(this.latestValues,""):"none");const i=this.getLead();if(!this.projectionDelta||!this.layout||!i.target)return this.options.layoutId&&(t.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,t.pointerEvents=Po(e?.pointerEvents)||""),void(this.hasProjected&&!Hs(this.latestValues)&&(t.transform=n?n({},""):"none",this.hasProjected=!1));t.visibility="";const s=i.animationValues||i.latestValues;this.applyTransformsToTarget();let o=gr(this.projectionDeltaWithTransform,this.treeScale,s);n&&(o=n(s,o)),t.transform=o;const{x:r,y:a}=this.projectionDelta;t.transformOrigin=`${100*r.origin}% ${100*a.origin}% 0`,i.animationValues?t.opacity=i===this?s.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:s.opacityExit:t.opacity=i===this?void 0!==s.opacity?s.opacity:"":void 0!==s.opacityExit?s.opacityExit:0;for(const e in wo){if(void 0===s[e])continue;const{correct:n,applyTo:r,isCSSVariable:a}=wo[e],l="none"===o?s[e]:n(s[e],i);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=i===this?Po(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(Rr),this.root.sharedNodes.clear()}}}function Vr(t){t.updateLayout(),function(t){const{snapshot:e,dragAncestor:n}=t,i=n?.layout;if(!e||!i||t.resumeFrom||t.isAnimationBlocked)return;const s=n.dragSnapshot;yr(t=>so(e.layoutBox[t],i.layoutBox[t].min-s.layoutBox[t].min))}(t)}function kr(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=t.layout,{animationType:s}=t.options,o=e.source!==t.layout.source;if("size"===s)yr(t=>{const i=o?e.measuredBox[t]:e.layoutBox[t],s=Wo(i);i.min=n[t].min,i.max=i.min+s});else if("x"===s||"y"===s){const t="x"===s?"y":"x";Oo(o?e.measuredBox[t]:e.layoutBox[t],n[t])}else qr(s,e.layoutBox,n)&&yr(i=>{const s=o?e.measuredBox[i]:e.layoutBox[i],r=Wo(n[i]);s.max=s.min+r,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[i].max=t.relativeTarget[i].min+r)});const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};$o(r,n,e.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?$o(a,t.applyTransform(i,!0),e.measuredBox):$o(a,n,e.layoutBox);const l=!sr(r);let c=!1;if(!t.resumeFrom){const i=t.getClosestProjectingParent();if(i&&!i.resumeFrom){const{snapshot:s,layout:o}=i;if(s&&o){const r=t.options.layoutAnchor||void 0,a={x:{min:0,max:0},y:{min:0,max:0}};Xo(a,e.layoutBox,s.layoutBox,r);const l={x:{min:0,max:0},y:{min:0,max:0}};Xo(l,n,o.layoutBox,r),lr(a,l)||(c=!0),i.options.layoutRoot&&(t.relativeTarget=l,t.relativeTargetOrigin=a,t.relativeParent=i)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function Dr(t){To.value&&Tr.nodes++,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 Cr(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Lr(t){t.clearSnapshot()}function Rr(t){t.clearMeasurements()}function Br(t){t.isLayoutDirty=!0,t.updateLayout()}function jr(t){t.isLayoutDirty=!1}function Or(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.dragSnapshot||t.layout,t.isLayoutDirty=!0)}function Ir(t){t.relativeTarget&&t.relativeParent?.isLayoutDirty&&(t.currentAnimation?t.isLayoutDirty=!0:(t.targetDelta=void 0,t.removeRelativeTarget()))}function Fr(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Wr(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Nr(t){t.resolveTargetDelta()}function Ur(t){t.calcProjection()}function $r(t){t.resetSkewAndRotation()}function zr(t,e,n){t.translate=Vt(e.translate,0,n),t.scale=Vt(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Kr(t,e,n,i){t.min=Vt(e.min,n.min,i),t.max=Vt(e.max,n.max,i)}function Yr(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const Xr={duration:.45,ease:[.4,0,.1,1]},Gr=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Hr=Gr("applewebkit/")&&!Gr("chrome/")?Math.round:u;function _r(t){t.min=Hr(t.min),t.max=Hr(t.max)}function qr(t,e,n){return"position"===t||"preserve-aspect"===t&&!No(cr(e),cr(n),.2)}function Zr(t){return t!==t.root&&t.scroll?.wasRoot}function Jr(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n,i)}const Qr=Mr({attachResizeListener:(t,e)=>Jr(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),ta={current:void 0},ea=Mr({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!ta.current){const t=new Qr({});t.mount(window),t.setOptions({layoutScroll:!0}),ta.current=t}return ta.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),na=new WeakMap;function ia(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function sa(t){return"string"==typeof t||Array.isArray(t)}const oa=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ra=["initial",...oa];function aa(t){if(ia(t.animate))return!0;for(let e=0;e<ra.length;e++)if(sa(t[ra[e]]))return!0;return!1}function la(t){return Boolean(aa(t)||t.variants)}function ca(t,e,n){for(const i in e){const s=e[i],o=n[i];if(zi(s))t.addValue(i,s);else if(zi(o))t.addValue(i,xi(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,xi(void 0!==e?e:s,{owner:t}))}}for(const i in n)void 0===e[i]&&t.removeValue(i);return e}const ua={current:null},ha={current:!1},da="undefined"!=typeof window;function pa(){if(ha.current=!0,da)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>ua.current=t.matches;t.addEventListener("change",e),e()}else ua.current=!1}const ma=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let fa={};class ga{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=An,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=$.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,Kt.render(this.render,!1,!0))};const{latestValues:l,renderState:c}=r;this.latestValues=l,this.baseTarget={...l},this.initialValues=e.initial?{...l}:{},this.renderState=c,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=aa(e),this.isVariantNode=la(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:u,...h}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in h){const e=h[t];void 0!==l[t]&&zi(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,na.set(t,this),this.projection&&!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:(ha.current||pa(),this.shouldReduceMotion=ua.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),Yt(this.notifyUpdate),Yt(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),e.accelerate&&Yn.has(t)&&this.current instanceof HTMLElement){const{factory:n,keyframes:i,times:s,ease:o,duration:r}=e.accelerate,a=new Fn({element:this.current,name:t,keyframes:i,times:s,ease:o,duration:m(r)}),l=n(a);return void this.valueSubscriptions.set(t,()=>{l(),a.cancel()})}const n=un.has(t);n&&this.onBindTransform&&this.onBindTransform();const i=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&Kt.preRender(this.notifyUpdate),n&&(this.projection&&(this.projection.isTransformDirty=!0),ti.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&&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 fa){const e=fa[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)&&ti.get(this.current)?.demote(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<ma.length;e++){const n=ma[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const i=t["on"+n];i&&(this.propEventSubscriptions[n]=this.on(n,i))}this.prevMotionValues=ca(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}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);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=xi(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&&(r(n)||l(n))?n=parseFloat(n):"number"!=typeof n&&!At.test(n)&&At.test(e)&&(n=_e(t,e)),this.setBaseTarget(t,zi(n)?n.get():n)),zi(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}on(t,e){return this.events[t]||(this.events[t]=new p),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){yo.render(this.render)}}class ya extends ga{constructor(){super(...arguments),this.KeyframeResolver=rs}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;zi(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}function va(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 xa(t,{layout:e,layoutId:n}){return un.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!wo[t]||"opacity"===t)}function wa(t,e,n){const i=t.style,s=e?.style,o={};if(!i)return o;for(const e in i)(zi(i[e])||s&&zi(s[e])||xa(e,t)||void 0!==n?.getValue(e)?.liveStyle)&&(o[e]=i[e]);return o}class Ta extends ya{constructor(){super(...arguments),this.type="html",this.renderInstance=va}mount(t){Boolean(t.style),super.mount(t)}readValueFromInstance(t,e){if(un.has(e))return this.projection?.isProjecting?on(e):an(t,e);{const i=(n=t,window.getComputedStyle(n)),s=(Y(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return lo(t,e)}build(t,e,n){Ds(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return wa(t,e,n)}}const ba="[data-layout],[data-layout-id]",Sa=new WeakMap;let Aa;function Pa(t){const e=[];return t instanceof HTMLElement&&t.matches(ba)&&e.push(t),t.querySelectorAll(ba).forEach(t=>{t instanceof HTMLElement&&e.push(t)}),e}function Ea(t,e){const n=t.getAttribute("data-layout");return{layoutId:t.getAttribute("data-layout-id")??void 0,layout:null!==n||void 0,animationType:n&&"true"!==n?n:"both",transition:e}}function Ma(t,e){let n=Sa.get(t);if(n)n.setOptions(Ea(t,e));else{let i=na.get(t);i||(i=new Ta({props:{},presenceContext:null,visualState:{latestValues:{},renderState:{transform:{},transformOrigin:{},style:{},vars:{}}}},{allowProjection:!0}),fo(t,i)),t.style.transform&&!Hs(i.latestValues)&&(t.style.transform=""),n=new ea(i.latestValues,function(t){let e=t.parentElement;for(;e;){const t=Sa.get(e);if(t&&t.instance)return t;e=e.parentElement}}(t)),i.projection=n,n.setOptions({...Ea(t,e),visualElement:i}),n.mount(t),Sa.set(t,n)}return n.isPresent=!0,n.options.onExitComplete&&n.setOptions({onExitComplete:void 0}),n}function Va(t,e){e.setOptions({onExitComplete:void 0});e.getStack()&&!e.isLead()||e.currentAnimation?.stop(),e.unmount(),Sa.delete(t)}function ka(){const t=Aa;Aa=void 0,function(){if(W.isProcessing)return;const t=$.now();W.delta=i(0,1e3/60,t-W.timestamp),W.timestamp=t,W.isProcessing=!0,Xt.update.process(W),Xt.preRender.process(W),Xt.render.process(W),W.isProcessing=!1}();const e=new Map;for(const n of t)for(const t of n.collectTargets()){const i=e.get(t);i?i.push(n):e.set(t,[n])}const n=new Map;for(const t of(s=e.keys(),[...s].sort((t,e)=>t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1))){const i=e.get(t),s=Ma(t,i[i.length-1].transitionFor(t));for(const e of i)e.adopt(t,s);n.set(t,s)}var s;n.forEach(t=>{t.isLayoutDirty=!1,t.willUpdate()});const o=[];for(const e of t){const t=e.runUpdate();t&&o.push(t)}const r=()=>{const e=new Set;for(const n of t)n.reconcileAdditions(e);for(const n of t)n.reconcileRemovals(e);let i;n.forEach(t=>i||(i=t.root));for(const e of t)i||(i=e.getRoot());i?.didUpdate(),yo.render(()=>{for(const e of t)e.finalize()})};o.length?Promise.all(o).then(r):r()}class Da{constructor(t,e,n){this.scope=t,this.updateDom=e,this.defaultOptions=n,this.sharedTransitions=new Map,this.notifyReady=()=>{},this.rejectReady=()=>{},this.tracked=new Map,this.restorePoints=new Map,this.readyPromise=new Promise((t,e)=>{this.notifyReady=t,this.rejectReady=e}),Aa||(Aa=[],queueMicrotask(ka)),Aa.push(this)}shared(t,e){return this.sharedTransitions.set(t,e),this}then(t,e){return this.readyPromise.then(t,e)}transitionFor(t){const e=t.getAttribute("data-layout-id");return e&&this.sharedTransitions.get(e)||this.defaultOptions}adopt(t,e){this.tracked.set(t,e),this.restorePoints.set(t,{parent:t.parentElement,next:t.nextSibling})}collectTargets(){return Pa(this.scope)}runUpdate(){try{const t=this.updateDom();if(t&&"function"==typeof t.then)return t.then(void 0,t=>{this.updateError=t})}catch(t){this.updateError=t}}reconcileAdditions(t){for(const e of Pa(this.scope)){if(this.tracked.has(e))continue;const n=Ma(e,this.transitionFor(e));this.adopt(e,n),n.options.layoutId&&t.add(n.options.layoutId)}}reconcileRemovals(t){this.tracked.forEach((e,n)=>{if(n.isConnected)return;const i=this.restorePoints.get(n);this.restorePoints.delete(n);const{layoutId:s}=e.options,o=e.getStack(),r=o&&o.members.some(t=>t!==e&&t.instance?.isConnected);if(s&&e.isLead()&&r&&!t.has(s)&&i&&i.parent.isConnected){if(i.parent.insertBefore(n,i.next&&i.next.parentNode===i.parent?i.next:null),e.isPresent=!1,e.setOptions({onExitComplete:()=>{n.remove(),Va(n,e)}}),e.relegate())return;n.remove()}Va(n,e),this.tracked.delete(n)})}getRoot(){let t;return this.tracked.forEach(e=>t||(t=e.root)),t}finalize(){if(this.updateError)return void this.rejectReady(this.updateError);const t=new Set;this.tracked.forEach(e=>{e.instance&&e.currentAnimation&&t.add(e.currentAnimation)}),this.notifyReady(new ci([...t]))}}function Ca(t,e,n){if("function"==typeof t)return{scope:document,updateDom:t,defaultOptions:e};return{scope:t instanceof Document?t:xs(t)[0]??document,updateDom:e,defaultOptions:n}}const La=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary;function Ra(t){return{point:{x:t.pageX,y:t.pageY}}}const Ba=t=>e=>La(e)&&t(e,Ra(e));function ja(t,e,n,i){return Jr(t,e,Ba(n),i)}const Oa=new WeakMap;let Ia;const Fa=(t,e,n)=>(i,s)=>s&&s[0]?s[0][t+"Size"]:vs(i)&&"getBBox"in i?i.getBBox()[e]:i[n],Wa=Fa("inline","width","offsetWidth"),Na=Fa("block","height","offsetHeight");function Ua({target:t,borderBoxSize:e}){Oa.get(t)?.forEach(n=>{n(t,{get width(){return Wa(t,e)},get height(){return Na(t,e)}})})}function $a(t){t.forEach(Ua)}function za(t,e){Ia||"undefined"!=typeof ResizeObserver&&(Ia=new ResizeObserver($a));const n=xs(t);return n.forEach(t=>{let n=Oa.get(t);n||(n=new Set,Oa.set(t,n)),n.add(e),Ia?.observe(t)}),()=>{n.forEach(t=>{const n=Oa.get(t);n?.delete(e),n?.size||Ia?.unobserve(t)})}}const Ka=new Set;let Ya;function Xa(t){return Ka.add(t),Ya||(Ya=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Ka.forEach(e=>e(t))},window.addEventListener("resize",Ya)),()=>{Ka.delete(t),Ka.size||"function"!=typeof Ya||(window.removeEventListener("resize",Ya),Ya=void 0)}}function Ga(t,e){return"function"==typeof t?Xa(t):za(t,e)}const Ha=(t,e)=>Math.abs(t-e);function _a(t,e){const n=Ha(t.x,e.x),i=Ha(t.y,e.y);return Math.sqrt(n**2+i**2)}const qa=new Set(["auto","scroll"]);class Za{constructor(t,e,{transformPagePoint:n,contextWindow:i=window,dragSnapToOrigin:s=!1,distanceThreshold:o=3,element:r}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=t=>{this.handleScroll(t.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;this.hasPendingMove=!1,this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Ja(this.lastRawMoveEventInfo,this.transformPagePoint));const t=tl(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=_a(t.offset,{x:0,y:0})>=this.distanceThreshold;if(!e&&!n)return;const{point:i}=t;this.history.push({...i,timestamp:$.now()});const{onStart:s,onMove:o}=this.handlers;e||(s&&s(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastRawMoveEventInfo=e,this.lastMoveEventInfo=Ja(e,this.transformPagePoint),this.hasPendingMove=!0,Kt.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&&s(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const o=tl("pointercancel"===t.type?this.lastMoveEventInfo:Ja(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,o),i&&i(t,o)},!La(t))return;this.dragSnapToOrigin=s,this.handlers=e,this.transformPagePoint=n,this.distanceThreshold=o,this.contextWindow=i||window;const a=Ja(Ra(t),this.transformPagePoint),{point:l}=a,{timestamp:c}=W;this.history=[{...l,timestamp:c}];const{onSessionStart:u}=e;u&&u(t,tl(a,this.history));const d={passive:!0,capture:!0};this.removeListeners=h(ja(this.contextWindow,"pointermove",this.handlePointerMove,d),ja(this.contextWindow,"pointerup",this.handlePointerUp,d),ja(this.contextWindow,"pointercancel",this.handlePointerUp,d)),r&&this.startScrollTracking(r)}startScrollTracking(t){let e=t.parentElement;for(;e;){const t=getComputedStyle(e);(qa.has(t.overflowX)||qa.has(t.overflowY))&&this.scrollPositions.set(e,{x:e.scrollLeft,y:e.scrollTop}),e=e.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const e=this.scrollPositions.get(t);if(!e)return;const n=t===window,i=n?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},s=i.x-e.x,o=i.y-e.y;0===s&&0===o||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s,this.lastMoveEventInfo.point.y+=o):this.history.length>0&&(this.history[0].x-=s,this.history[0].y-=o),this.scrollPositions.set(t,i),Kt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Yt(this.updatePoint)}}function Ja(t,e){return e?{point:e(t.point)}:t}function Qa(t,e){return{x:t.x-e.x,y:t.y-e.y}}function tl({point:t},e){return{point:t,delta:Qa(t,nl(e)),offset:Qa(t,el(e)),velocity:il(e,.1)}}function el(t){return t[0]}function nl(t){return t[t.length-1]}function il(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const s=nl(t);for(;n>=0&&(i=t[n],!(s.timestamp-i.timestamp>m(e)));)n--;if(!i)return{x:0,y:0};i===t[0]&&t.length>2&&s.timestamp-i.timestamp>2*m(e)&&(i=t[1]);const o=f(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 sl=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function ol(t){return sl.has(t.tagName)||!0===t.isContentEditable}const rl=new Set(["INPUT","SELECT","TEXTAREA"]);function al(t){return rl.has(t.tagName)||!0===t.isContentEditable}const ll={x:!1,y:!1};function cl(){return ll.x||ll.y}function ul(t){return"x"===t||"y"===t?ll[t]?null:(ll[t]=!0,()=>{ll[t]=!1}):ll.x||ll.y?null:(ll.x=ll.y=!0,()=>{ll.x=ll.y=!1})}function hl(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 dl(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 pl=.35;function ml(t,e,n){return{min:fl(t,e),max:fl(t,n)}}function fl(t,e){return"number"==typeof t?t:t[e]||0}const gl=new WeakMap;class yl{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}={}){const{presenceContext:i}=this.visualElement;if(i&&!1===i.isPresent)return;const{dragSnapToOrigin:s}=this.getProps();this.panSession=new Za(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(),this.openDragLock=ul(n),!this.openDragLock))return;this.latestPointerEvent=t,this.latestPanInfo=e,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),yr(t=>{let e=this.getAxisMotionValue(t).get()||0;if(G(e)&&(e=Bi(e,this.visualElement.current)||0),ct.test(e))e=parseFloat(e);else if(lt.test(e)){const{projection:n}=this.visualElement;if(n&&n.layout){const i=n.layout.layoutBox[t];if(i){e=Wo(i)*(parseFloat(e)/100)}}}this.originPoint[t]=e}),s&&Kt.update(()=>s(t,e),!1,!0),Yi(this.visualElement,"transform");const{animationState:o}=this.visualElement;o&&o.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",e.point,r),this.updateAxis("y",e.point,r),this.visualElement.render(),o&&Kt.update(()=>o(t,e),!1,!0)},onSessionEnd:(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e,this.stop(t,e),this.latestPointerEvent=null,this.latestPanInfo=null},resumeAnimation:()=>{const{dragSnapToOrigin:t}=this.getProps();(t||this.constraints)&&this.startAnimation({x:0,y:0})}},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:s,distanceThreshold:n,contextWindow:this.visualElement.current?.ownerDocument.defaultView,element:this.visualElement.current})}stop(t,e){const n=t||this.latestPointerEvent,i=e||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!i||!n)return;const{velocity:o}=i;this.startAnimation(o);const{onDragEnd:r}=this.getProps();r&&Kt.postRender(()=>r(n,i))}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),e&&e.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,e,n){const{drag:i}=this.getProps();if(!n||!Tl(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(o=function(t,{min:e,max:n},i){return void 0!==e&&t<e?t=i?Vt(e,t,i.min):Math.max(t,e):void 0!==n&&t>n&&(t=i?Vt(n,t,i.max):Math.min(t,n)),t}(o,this.constraints[t],this.elastic[t])),s.set(o)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;vl(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:i,right:s}){return{x:hl(t.x,n,s),y:hl(t.y,e,i)}}(n.layoutBox,t),this.elastic=function(t=pl){return!1===t?t=0:!0===t&&(t=pl),{x:ml(t,"left","right"),y:ml(t,"top","bottom")}}(e),i!==this.constraints&&!vl(t)&&n&&this.constraints&&!this.hasMutatedConstraints&&yr(t=>{!1!==this.constraints&&this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(n.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!vl(t))return!1;const n=xl(t),{projection:i}=this.visualElement;if(!i||!i.layout)return!1;i.root&&(i.root.scroll=void 0,i.root.updateScroll());const s=co(n,i.root,this.visualElement.getTransformPagePoint());let o=function(t,e){return{x:dl(t.x,e.x),y:dl(t.y,e.y)}}(i.layout.layoutBox,s);if(e){const t=e(Ks(o));this.hasMutatedConstraints=!!t,t&&(o=zs(t))}return o}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},l=yr(r=>{if(!Tl(r,e,this.currentDirection))return;let l=a&&a[r]||{};!0!==o&&o!==r||(l={min:0,max:0});const c=i?200:1e6,u=i?40:1e7,h={type:"inertia",velocity:n?t[r]:0,bounceStiffness:c,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...s,...l};return this.startAxisValueAnimation(r,h)});return Promise.all(l).then(r)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return Yi(this.visualElement,t),n.start(Vi(t,n,0,e,this.visualElement,!1))}stopAnimation(){yr(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();yr(t=>{if(!Tl(t,n,this.currentDirection))return;const e=this.getAxisMotionValue(t),{min:i,max:r}=o[t];e.set((e.get()||0)+s[t]-Vt(i,r,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:n}=this.visualElement;if(!vl(e)||!n||!this.constraints)return;this.stopAnimation();const s=this.constraints,o={x:0,y:0};yr(t=>{const e=this.getAxisMotionValue(t).get();o[t]=function(t,e){let n=.5;const s=Wo(t),o=Wo(e);return o>s?n=d(e.min,e.max-s,t.min):s>o&&(n=d(t.min,t.max-o,e.min)),i(0,1,n)}({min:e,max:e},s[t])});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),yr(e=>{const n=this.getAxisMotionValue(e);if(!Tl(e,t,null)||!n.get())return;const{min:i,max:s}=this.constraints[e];n.set(Vt(i,s,o[e]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;gl.set(this.visualElement,this);const t=this.visualElement.current,e=ja(t,"pointerdown",e=>{const{drag:n,dragListener:i=!0}=this.getProps(),s=e.target,o=s!==t&&al(s);n&&i&&!o&&this.start(e)});let n;const i=()=>{const{dragConstraints:e}=this.getProps(),i=vl(e)&&xl(e);i&&(this.constraints=this.resolveRefConstraints(),n||(n=function(t,e,n){const i=Ga(t,wl(n)),s=Ga(e,wl(n));return()=>{i(),s()}}(t,i,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,o=s.addEventListener("measure",i);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),Kt.read(i);const r=Jr(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(yr(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.render())});return()=>{r(),e(),o(),a&&a(),n&&n()}}getProps(){const t=this.readProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=pl,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:r}}}function vl(t){return!!t&&"object"==typeof t&&("current"in t||"nodeType"in t)}const xl=t=>"current"in t?t.current:t;function wl(t){let e=!0;return()=>{e?e=!1:t()}}function Tl(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const bl=["user-select","-webkit-user-select","-webkit-touch-callout","touch-action"];function Sl(t,e){const n=xs(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}const Al=(t,e)=>!!e&&(t===e||Al(t,e.parentElement)),Pl=new WeakSet;function El(t){return e=>{"Enter"===e.key&&t(e)}}function Ml(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function Vl(t){return La(t)&&!cl()}const kl=new WeakSet;function Dl(t,e){const n=window.getComputedStyle(t);return Pn(e)?n.getPropertyValue(e):n[e]}function Cl(...t){const e=!Array.isArray(t[0]),n=e?0:-1,i=t[0+n],s=we(t[1+n],t[2+n],t[3+n]);return e?s(i):s}const Ll=new Set,Rl=({timestamp:t})=>{Ll.forEach(e=>e.tick(t))};class Bl extends Be{constructor(t){super(),this.state="idle",this.startTime=0,this.currentTime=0,this.started=!1,this.hasNextTarget=!1,this.nextTarget=0,this.stop=()=>{"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.factory=t.type,this.generator=this.factory(t);const{driver:e}=t;e&&(this.driver=e(t=>this.tick(t))),this.startTime=this.now(),this.state="running",this.driver?this.driver.start():(Ll.size||Kt.update(Rl,!0),Ll.add(this))}setTarget(t,e){this.nextTarget=t,this.nextVelocity=e,this.hasNextTarget=!0}retarget(t,e){const{options:n,generator:i}=this;n.keyframes=t,n.velocity=e,this.startTime=this.now(),this.currentTime=0,i.retarget?i.retarget(t,e):this.generator=this.factory(n)}tick(t){const{options:e,hasNextTarget:n}=this,{delay:i=0,onUpdate:s,onPlay:o}=e;this.started||(this.startTime=Ce(this.startTime,t));const r=Math.round(t-this.startTime)-i,a=this.currentTime=Math.max(0,r),l=this.generator.next(a),c=r<0?e.keyframes[0]:l.value;if(n){this.hasNextTarget=!1;const{keyframes:t}=e;t[0]=c,t[1]=this.nextTarget,this.retarget(t,this.nextVelocity??this.getGeneratorVelocity())}!n&&this.started||(this.started=!0,o?.()),"running"===this.state&&(s?.(c),l.done&&r>=0&&!n&&!this.hasNextTarget&&"running"===this.state&&(this.notifyFinished(),this.teardown(),this.state="finished",e.onComplete?.()))}getGeneratorVelocity(){return Ee(this.generator,this.currentTime,this.options.velocity)}now(){return this.driver?this.driver.now():$.now()}teardown(){this.state="idle",this.driver?this.driver.stop():(Ll.delete(this),Ll.size||Yt(Rl))}}function jl(t,e,n){const i=t.get();let s,o=null;const r="string"==typeof i?i.replace(/[\d.-]/g,""):void 0,a=t=>s(r?t+r:t),l=()=>t.events.animationStart?.notify(),c=()=>{o&&(o.stop(),o=null),t.animation=void 0};if(t.attach((e,i)=>{s=i;const r=Eo(e);if("running"===o?.state)return void o.setTarget(r,n.velocity);const u=Eo(t.get()),h=o?o.getGeneratorVelocity():t.getVelocity();if(c(),u===r)return;const d={keyframes:[u,r],velocity:h,restDelta:.001,restSpeed:.01,...n,onUpdate:a},p=o=new Bl({...d,onPlay:l});t.animation=p,p.then(()=>{o===p&&(o=null,t.animation=void 0,t.events.animationComplete?.notify())})},c),zi(e)){let i=!0===n.skipInitialAnimation;const s=e=>{i?(i=!1,t.jump(Ol(e,r),!1)):t.set(Ol(e,r))},o=e.on("change",s),a=e.get();Eo(a)-Eo(t.get())&&s(a);const l=t.on("destroy",o);return()=>{o(),l(),c()}}return c}function Ol(t,e){return e?t+e:t}function Il(t,e,n={}){const i={type:"spring",...n};return De(i),i.type=i.type||Pe,jl(t,e,i)}function Fl(t){const e=[];yi.current=e;const n=t();yi.current=void 0;const i=xi(n);return function(t,e,n){const i=()=>e.set(n()),s=()=>Kt.preRender(i,!1,!0),o=t.map(t=>t.on("change",s));e.on("destroy",()=>{o.forEach(t=>t()),Yt(i)})}(e,i,t),i}function Wl(t,e,n){return jl(t,e,{...n,type:ve})}const Nl=[...ns,mt,At];let Ul=0;const $l=()=>"motion-view-"+Ul++;function zl(t,e,n){e&&(t.style?.setProperty("view-transition-class",e),n.push(t))}function Kl(t,e,n,i,s){if(n&&(t.style?.setProperty("view-transition-group",n),i.push(t),"none"!==n&&s)){const n=getComputedStyle(t);"visible"===n.overflowX&&"visible"===n.overflowY||s.add(e)}}function Yl(t,e,n,i,s,o=[],r,a=[],l){const c=xs(t);if(i)return c.map((t,c)=>{const u=e.get(t);if(u)return u;const h=i[c]??$l();return t.style?.setProperty("view-transition-name",h),n.push(t),e.set(t,h),zl(t,s,o),Kl(t,h,r,a,l),h});const u=c.map(t=>e.has(t)?void 0:getComputedStyle(t).getPropertyValue("view-transition-name"));return c.map((t,i)=>{const c=e.get(t);if(c)return c;const h=u[i];let d;return h&&"none"!==h&&"auto"!==h&&"match-element"!==h&&!(t=>t.startsWith("motion-view-"))(h)?d=h:(d=$l(),t.style?.setProperty("view-transition-name",d),n.push(t)),e.set(t,d),zl(t,s,o),Kl(t,d,r,a,l),d})}function Xl(t){return"layout"===t?"group":"enter"===t||"new"===t?"new":"old"}let Gl={},Hl=null;const _l=(t,e)=>{Gl[t]=e},ql=()=>{Hl||(Hl=document.createElement("style"),Hl.id="motion-view");let t="";for(const e in Gl){const n=Gl[e];t+=`${e} {\n`;for(const[e,i]of Object.entries(n))t+=` ${e}: ${i};\n`;t+="}\n"}Hl.textContent=t,document.head.appendChild(Hl),Gl={}},Zl=()=>{Hl&&Hl.parentElement&&Hl.parentElement.removeChild(Hl)};function Jl(t){const e=t.match(/::view-transition-(old|new|group-children|group|image-pair)\((.*?)\)/);return e?{layer:e[2],type:e[1]}:null}function Ql(){return document.getAnimations().filter(t=>{const{effect:e}=t;return!!e&&e.target===document.documentElement&&e.pseudoElement?.startsWith("::view-transition")})}const tc=["layout","enter","exit","new","old"],ec=t=>t.split(" ").every(t=>0===parseFloat(t)),nc={group:["layout"],new:["new","enter"],old:["old","exit"]},ic={new:{opacity:0,scale:.85},old:{opacity:1,scale:1}};function sc(t){const{update:e,targets:n,resolveDefs:i,cropOverride:s,pairs:o,classNames:r,flatGroups:a,options:l}=t;if(!document.startViewTransition)return(async()=>(await e(),new ci([])))();const c=new Map,u=[],h=[],d=[],p=new Set,f=new Map,g=new Set,y=new Map,x=new Map,w=new Map,T=new Map,b=t=>{n.forEach((e,n)=>{const l=r.get(n),m="root"!==n&&i.has(n)?a.has(n)?"none":"contain":void 0;let g;if("root"!==n&&i.has(n))if(o.has(n))if("old"===t)T.set(n,xs(n)),g=Yl(n,c,u,void 0,l,h,m,d,p),w.set(n,g);else{for(const t of T.get(n)??[])t.style?.removeProperty("view-transition-name"),c.delete(t);g=Yl(o.get(n),c,u,w.get(n),l,h,m,d,p)}else g=Yl(n,c,u,void 0,l,h,m,d,p);else g=[n];const v=s.get(n);g.forEach((n,i)=>{const s=f.get(n);f.set(n,s&&s!==e?{...s,...e}:e),void 0!==v&&y.set(n,v);const o=x.get(n)??{};o[t]=[i,g.length],x.set(n,o)})})},S=(t,e)=>{const n=x.get(t);return("old"===e?n?.old:"new"===e?n?.new:n?.new??n?.old)??[-1,1]},A=(t,e,n,i,s)=>{const o=oc(Ti(l,n),Ti(function(t,e){for(const n of nc[e]??[]){const e=t?.[n]?.options;if(e)return e}}(t,e)??{},n));return"function"==typeof o.delay&&(o.delay=o.delay(i,s)),o},P=t=>{const[e,n]=S(t,"group"),i=A(f.get(t),"group","layout",-1===e?0:e,n);i.duration&&(i.duration=m(i.duration));const{delay:s=0,duration:o,ease:r}=In(i);return{delay:m(s),duration:o,ease:r}},E=new Map,M=t=>c.forEach((e,n)=>{const i=n,s=i.getBoundingClientRect?.();if(s&&s.height){const n=getComputedStyle(i),o={};for(const t of as)o[t]=n[t];const r=E.get(e)??{};r[t]={width:s.width,height:s.height,radii:o},E.set(e,r)}}),V=t=>{const e=E.get(t);return!!(e?.old&&e?.new&&e.old.height&&e.new.height)&&Math.abs(e.old.width/e.old.height-e.new.width/e.new.height)>.2},k=()=>{(function(t,e){return e.has(t)&&Object.keys(e.get(t)).length>0})("root",n)||_l(":root",{"view-transition-name":"none"}),_l("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)",{"animation-timing-function":"linear !important"}),g.forEach(t=>{_l(`::view-transition-group(${t})`,{overflow:"clip"}),_l(`::view-transition-old(${t}), ::view-transition-new(${t})`,{width:"100%",height:"100%","object-fit":"cover"})}),p.forEach(t=>{_l(`::view-transition-group-children(${t})`,{overflow:"clip"})}),ql()},D=()=>{!function(t,e=[],n=[]){for(const e of t)e.style?.removeProperty("view-transition-name");for(const t of e)t.style?.removeProperty("view-transition-class");for(const t of n)t.style?.removeProperty("view-transition-group")}(u,h,d),Zl()},C=async()=>{await e(),b("new"),M("new"),(()=>{g.clear();for(const t of x.keys())"root"!==t&&(y.get(t)??V(t))&&g.add(t)})(),k()};let L;try{b("old"),M("old"),k(),L=document.startViewTransition(C)}catch(t){return D(),Promise.reject(t)}return L.finished.finally(D),new Promise((t,e)=>{L.ready.then(()=>{const e=Ql(),n=[],i=new Set,s=new Set;f.forEach((t,e)=>{const o=x.get(e),r=!!o?.new&&!o?.old,a=!!o?.old&&!o?.new;for(const o of tc){if(!t[o])continue;if("enter"===o&&!r)continue;if("exit"===o&&!a)continue;const c=Xl(o),[u,h]=S(e,c);if(-1===u)continue;const{keyframes:d,options:p}=t[o];for(let[f,g]of Object.entries(d)){if(null==g)continue;if("x"===f||"y"===f){v(!1,`animateView() animates view-transition layers with CSS properties; the "${f}" shorthand has no effect - use transform, e.g. { transform: "translateX(40px)" }.`);continue}if("new"===o&&r&&null!=t.enter?.keyframes[f])continue;if("old"===o&&a&&null!=t.exit?.keyframes[f])continue;const d=oc(Ti(l,f),Ti(p,f));if(!Array.isArray(g)){const e="enter"===o?t.exit?.keyframes[f]:void 0,n="opacity"===f||("new"===c?r:a),i=null!=e?Array.isArray(e)?e[e.length-1]:e:n?ic[c]?.[f]:void 0;void 0!==i&&(g=[i,g])}"function"==typeof d.delay&&(d.delay=d.delay(u,h)),d.duration&&(d.duration=m(d.duration)),d.delay&&(d.delay=m(d.delay)),n.push(new Fn({...d,element:document.documentElement,name:f,pseudoElement:`::view-transition-${c}(${e})`,keyframes:g})),i.add(`${e}:${c}`),"opacity"===f&&s.add(`${e}:${c}`)}}});for(const t of e){if("finished"===t.playState)continue;const{effect:e}=t;if(!(e&&e instanceof KeyframeEffect))continue;const{pseudoElement:o}=e;if(!o)continue;const r=Jl(o);if(!r)continue;const a=f.get(r.layer);if(i.has(`${r.layer}:${r.type}`)){s.has(`${r.layer}:new`)&&s.has(`${r.layer}:old`)&&e.getKeyframes().some(t=>t.mixBlendMode)?n.push(new di(t)):t.cancel();continue}const l="old"===r.type?"new":"new"===r.type?"old":void 0;if(l&&i.has(`${r.layer}:${l}`)&&!s.has(`${r.layer}:${l}`)){t.cancel();continue}const c=x.get(r.layer),u=!("old"!==r.type&&"new"!==r.type||!c?.old||!c?.new);let h;if(r.type.startsWith("group")){const{delay:t,duration:e,ease:n}=P(r.layer);h={delay:t,duration:e,easing:Bn(n,e)}}else{const t=u?"group":r.type,[e,n]=S(r.layer,t);let i=A(a,t,"group"===t?"layout":"",-1===e?0:e,n);const s=i.visualDuration;i.duration&&(i.duration=m(i.duration)),i=In(i),h={delay:m(i.delay??0),duration:u&&void 0!==s?m(s):i.duration,easing:u?"linear":Bn(i.ease,i.duration)}}e.updateTiming(h),n.push(new di(t))}E.forEach((t,e)=>{if(!g.has(e))return;const{delay:i,duration:s,ease:o}=P(e);for(const r of as){const a=t.old?.radii[r]||t.new?.radii[r]||"0px",l=t.new?.radii[r]||t.old?.radii[r]||"0px";ec(a)&&ec(l)||n.push(new Fn({element:document.documentElement,name:r,pseudoElement:`::view-transition-group(${e})`,keyframes:[a,l],delay:i,duration:s,ease:o}))}}),t(new ci(n))}).catch(()=>L.updateCallbackDone.then(()=>t(new ci([])),e))})}function oc(t,e){const n={...t,...e};return void 0!==e.duration&&(void 0===e.visualDuration&&delete n.visualDuration,void 0===e.type&&delete n.type),n}let rc=[],ac=null;function lc(){ac=null;const[t]=rc;var e;t&&(n(rc,e=t),ac=e,sc(e).then(t=>(e.notifyReady(t),t.finished)).catch(t=>e.notifyReject(t)).finally(lc))}function cc(){for(let t=rc.length-1;t>=0;t--){const e=rc[t],{interrupt:n}=e.options;if("immediate"===n){const n=rc.slice(0,t+1).map(t=>t.update),i=rc.slice(t+1);e.update=()=>{n.forEach(t=>t())},rc=[e,...i];break}}ac&&"immediate"!==rc[0]?.options.interrupt||lc()}class uc{constructor(t,e={}){var n;this.currentSubject="root",this.targets=new Map,this.resolveDefs=new Set,this.cropOverride=new Map,this.pairs=new Map,this.classNames=new Map,this.flatGroups=new Set,this.notifyReady=u,this.notifyReject=u,this.readyPromise=new Promise((t,e)=>{this.notifyReady=t,this.notifyReject=e}),this.update=t,this.options={interrupt:"wait",...e},this.readyPromise.catch(u),n=this,rc.push(n),yo.render(cc)}add(t,e){return this.currentSubject=t,this.resolveDefs.add(t),void 0!==e&&this.pairs.set(t,e),this.targets.has(t)||this.targets.set(t,{}),this}crop(t=!0){return this.cropOverride.set(this.currentSubject,t),this}group(t=!0){return t?this.flatGroups.delete(this.currentSubject):this.flatGroups.add(this.currentSubject),this}class(t){return this.classNames.set(this.currentSubject,t),this}layout(t={}){return this.updateTarget("layout",{},t),this}enter(t,e){return this.updateTarget("enter",t,e),this}exit(t,e){return this.updateTarget("exit",t,e),this}new(t,e){return this.updateTarget("new",t,e),this}old(t,e){return this.updateTarget("old",t,e),this}updateTarget(t,e,n={}){const{currentSubject:i,targets:s}=this;s.has(i)||s.set(i,{});s.get(i)[t]={keyframes:e,options:n}}then(t,e){return this.readyPromise.then(t,e)}}const hc=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"]),dc=t=>"string"==typeof t&&"svg"===t.toLowerCase();function pc(t,e,n,i){va(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(hc.has(n)?n:Xi(n),e.attrs[n])}function mc(t,e,n){const i=wa(t,e,n);for(const n in t)if("children"!==n&&(zi(t[n])||zi(e[n]))){i[-1!==cn.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return i}function fc(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 gc=[...oa].reverse();function yc(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!fc(e,t)}function vc(){const t={};for(const e of oa)t[e]={isActive:"animate"===e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}};return t}const xc=ra.length;const wc=t=>!t.isLayoutDirty&&t.willUpdate(!1);const Tc=Kt,bc=$t.reduce((t,e)=>(t[e]=t=>Yt(t),t),{});function Sc(t){return"object"==typeof t&&!Array.isArray(t)}function Ac(t,e,n,i){return null==t?[]:"string"==typeof t&&Sc(e)?xs(t,n,i):t instanceof NodeList?Array.from(t):Array.isArray(t)?t.filter(t=>null!=t):[t]}function Pc(t,e,n){return t*(e+1)+n*e}function Ec(t,e,n,i){return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:e.startsWith("<")?Math.max(0,n+parseFloat(e.slice(1))):i.get(e)??t}function Mc(t,e,i,s,o,r){!function(t,e,i){for(let s=0;s<t.length;s++){const o=t[s];o.at>e&&o.at<i&&(n(t,o),s--)}}(t,o,r);for(let n=0;n<e.length;n++)t.push({value:e[n],at:Vt(o,r,s[n]),easing:j(i,n)})}function Vc(t,e,n=0){const i=e+1+e*n;for(let e=0;e<t.length;e++)t[e]=t[e]/i}function kc(t,e){return t.at===e.at?null===t.value?1:null===e.value?-1:0:t.at-e.at}function Dc(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function Cc(t,e){return e[t]||(e[t]=[]),e[t]}function Lc(t){return Array.isArray(t)?t:[t]}function Rc(t,e){return t&&t[e]?{...t,...t[e]}:{...t}}const Bc=t=>"number"==typeof t,jc=t=>t.every(Bc);function Oc(t,e,n,i){const s=[];if(function(t,e){return zi(t)||"number"==typeof t||"string"==typeof t&&!Sc(e)}(t,e))s.push(xo(t,Sc(e)&&e.default||e,n&&n.default||n));else{if(null==t)return s;const o=Ac(t,e,i),r=o.length;for(let t=0;t<r;t++){const i=o[t],a={...n};"delay"in a&&"function"==typeof a.delay&&(a.delay=a.delay(t,r)),i instanceof Element?s.push(...mo(i,e,a,na.get(i))):s.push(...gs(ms(i)??go,i,e,a))}}return s}function Ic(t,e,n){const i=[],s=function(t,{defaultTransition:e={},...n}={},i,s){const o=e.duration||.3,r=new Map,a=new Map,l={},c=new Map;let u=0,h=0,p=0;for(let n=0;n<t.length;n++){const r=t[n];if("string"==typeof r){c.set(r,h);continue}if(!Array.isArray(r)){c.set(r.name,Ec(h,r.at,u,c));continue}let[d,f,g={}]=r;void 0!==g.at&&(h=Ec(h,g.at,u,c));let y=0;const v=(t,n,i,r=0,a=0)=>{const l=Lc(t),{delay:c=0,times:u=be(l),type:d=e.type||"keyframes",repeat:f,repeatType:g,repeatDelay:v=0,...x}=n;let{ease:w=e.ease||"easeOut",duration:T}=n;const b="function"==typeof c?c(r,a):c,A=l.length,P=On(d)?d:s?.[d||"keyframes"];if(A<=2&&P){let t=100;if(2===A&&jc(l)){const e=l[1]-l[0];t=Math.abs(e)}const n={...e,...x};void 0!==T&&(n.duration=m(T));const i=Zt(n,t,P);w=i.ease,T=i.duration}T??(T=o);const E=h+b;1===u.length&&0===u[0]&&(u[1]=1);const M=u.length-l.length;if(M>0&&Te(u,M),1===l.length&&l.unshift(null),f&&f<20){const t=T>0?v/T:0;T=Pc(T,f,v);const e=[...l],n=[...u];w=Array.isArray(w)?[...w]:[w];const i=[...w],s="reverse"===g||"mirror"===g;let o=e,r=i;s&&(o=[...e].reverse(),"reverse"===g&&(r=[...i].reverse().map(t=>"function"==typeof t?S(t):t)));for(let a=0;a<f;a++){const c=s&&a%2==0,h=c?o:e,d=c?r:i,p=(a+1)*(1+t);t>0&&(l.push(l[l.length-1]),u.push(p),w.push("linear")),l.push(...h);for(let t=0;t<h.length;t++)u.push(n[t]+p),w.push(0===t?"linear":j(d,t-1))}Vc(u,f,t)}const V=E+T;Mc(i,l,w,u,E,V),y=Math.max(b+T,y),p=Math.max(V,p)};if(zi(d))v(f,g,Cc("default",Dc(d,a)));else{const t=Ac(d,f,i,l),e=t.length;for(let n=0;n<e;n++){const i=Dc(t[n],a);for(const t in f)v(f[t],Rc(g,t),Cc(t,i),n,e)}}u=h,h+=y}return a.forEach((t,i)=>{for(const s in t){const o=t[s];o.sort(kc);const a=[],l=[],c=[];for(let t=0;t<o.length;t++){const{at:e,value:n,easing:i}=o[t];a.push(n),l.push(d(0,p,e)),c.push(i||"easeOut")}0!==l[0]&&(l.unshift(0),a.unshift(a[0]),c.unshift("easeInOut")),1!==l[l.length-1]&&(l.push(1),a.push(null)),r.has(i)||r.set(i,{keyframes:{},transition:{}});const u=r.get(i);u.keyframes[s]=a;const{type:h,...m}=e;u.transition[s]={...m,duration:p,ease:c,times:l,...n}}}),r}(t.map(t=>{if(Array.isArray(t)&&"function"==typeof t[0]){const e=t[0],n=xi(0);return n.on("change",e),1===t.length?[n,[0,1]]:2===t.length?[n,[0,1],t[1]]:[n,t[1],t[2]]}return t}),e,n,{spring:ve});return s.forEach(({keyframes:t,transition:e},n)=>{i.push(...Oc(n,t,e))}),i}function Fc(t={}){const{scope:e,reduceMotion:i,skipAnimations:s}=t;return function(t,o,r){let a,l=[];const c={};if(void 0!==i&&(c.reduceMotion=i),void 0!==s&&(c.skipAnimations=s),u=t,Array.isArray(u)&&u.some(Array.isArray)){const{onComplete:n,...i}=o||{};"function"==typeof n&&(a=n),l=Ic(t,{...c,...i},e)}else{const{onComplete:n,...i}=r||{};"function"==typeof n&&(a=n),l=Oc(t,o,{...c,...i},e)}var u;const h=new hi(l);return a&&h.finished.then(a),e&&(e.animations.push(h),h.finished.then(()=>{n(e.animations,h)})),h}}const Wc=Object.assign(Fc(),{addEffect:ds,removeEffect:ps});const Nc=t=>function(e,n,i){return new hi(function(t,e,n,i){if(null==t)return[];const s=xs(t,i),o=s.length,r=[];for(let t=0;t<o;t++){const i=s[t],a={...n};"function"==typeof a.delay&&(a.delay=a.delay(t,o));for(const t in e){let n=e[t];Array.isArray(n)||(n=[n]);const s={...Ti(a,t)};s.duration&&(s.duration=m(s.duration)),s.delay&&(s.delay=m(s.delay));const o=fi(i),l=mi(t,s.pseudoElement||""),c=o.get(l);c&&c.stop(),r.push({map:o,key:l,unresolvedKeyframes:n,options:{...s,element:i,name:t,allowFlatten:!a.type&&!a.ease}})}}for(let t=0;t<r.length;t++){const{unresolvedKeyframes:e,options:n}=r[t],{element:i,name:s,pseudoElement:o}=n;o||null!==e[0]||(e[0]=Dl(i,s)),qe(e),cs(e,s),!o&&e.length<2&&e.unshift(Dl(i,s)),n.keyframes=e}const a=[];for(let t=0;t<r.length;t++){const{map:e,key:n,options:i}=r[t],s=new Fn(i);e.set(n,s),s.finished.finally(()=>e.delete(n)),a.push(s)}return a}(e,n,i,t))},Uc=Nc(),$c={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}},zc=new WeakMap;function Kc(t,e,n,s){const o=n[e],{length:r,position:a}=$c[e],l=o.current,c=n.time,u=t[`scroll${a}`];o.current=function(t,e){const n=t===document.scrollingElement,i=n&&document.body||t;let s=zc.get(i);s||zc.set(i,s=getComputedStyle(i));const{writingMode:o,flexDirection:r}=s,a="x"===e!==/^[vs]/.test(o);return(a?"rtl"===s.direction!=("sideways-lr"===o):o.endsWith("rl"))!==(!n&&s.display.includes("flex")&&(a!==("c"===r[0])?r:s.flexWrap).endsWith("reverse"))}(t,e)?-u||0:u,o.containerLength=t[`client${r}`],o.targetLength=t[`scroll${r}`],o.scrollLength=o.targetLength-o.containerLength,o.offset.length=0,o.offset[0]=0,o.offset[1]=o.scrollLength,o.progress=i(0,1,d(0,o.scrollLength,o.current));const h=s-c;o.velocity=h>50?0:g(o.current-l,h)}const Yc={start:0,center:.5,end:1};function Xc(t,e,n=0){let i=0;if(t in Yc&&(t=Yc[t]),"string"==typeof t){const e=parseFloat(t);t.endsWith("px")?i=e:t.endsWith("%")?t=e/100:t.endsWith("vw")?i=e/100*document.documentElement.clientWidth:t.endsWith("vh")?i=e/100*document.documentElement.clientHeight:t=e}return"number"==typeof t&&(i=e*t),n+i}const Gc=[0,0];function Hc(t,e,n,i){let s=Array.isArray(t)?t:Gc,o=0,r=0;return"number"==typeof t?s=[t,t]:"string"==typeof t&&(s=(t=t.trim()).includes(" ")?t.split(" "):[t,Yc[t]?t:"0"]),o=Xc(s[0],n,i),r=Xc(s[1],e),o-r}const _c={All:[[0,0],[1,1]]};function qc(t,e){const{offset:n=_c.All,axis:s="y"}=e,o=t[s];o.offset.length=0;const r=n.length;for(let t=0;t<r;t++)o.offset[t]=Hc(n[t],o.containerLength,o.targetLength,o.targetOffset);o.progress=i(0,1,function(t,e){const n=t.length-1;if(n<1)return 0;const i=t[0]>t[n],s=e=>t[i?n-e:e];if(t[0]===t[1]&&e<s(0))return i?1:0;let o=0;for(;o<n-1&&e>=s(o+1);)o++;const r=(o+d(s(o),s(o+1),e))/n;return i?1-r:r}(o.offset,o.current))}function Zc(t,e,n,i={}){const{target:s}=i,o=s||i.offset;return{measure:e=>{if(o){n.time=e.time;for(const t in $c){const i=t,{offset:s}=n[i];Object.assign(n[i],e[i]),n[i].offset=s}if(s&&s!==t){const e=function(t,e){const n={x:0,y:0};let i=t;for(;i&&i!==e;)if(ys(i))n.x+=i.offsetLeft,n.y+=i.offsetTop,i=i.offsetParent;else if("svg"===i.tagName){const t=i.getBoundingClientRect();i=i.parentElement;const e=i.getBoundingClientRect();n.x+=t.left-e.left,n.y+=t.top-e.top}else{if(!(i instanceof SVGGraphicsElement))break;{const{x:t,y:e}=i.getBBox();n.x+=t,n.y+=e;let s=null,o=i.parentNode;for(;!s;)"svg"===o.tagName&&(s=o),o=i.parentNode;i=s}}return n}(s,t),i=function(t){return"getBBox"in t&&"svg"!==t.tagName?t.getBBox():{width:t.clientWidth,height:t.clientHeight}}(s);n.x.targetOffset=e.x,n.y.targetOffset=e.y,n.x.targetLength=i.width,n.y.targetLength=i.height}qc(n,i)}},notify:t=>e(o?n:t)}}const Jc=new WeakMap,Qc=new WeakMap,tu=new WeakMap,eu=new WeakMap,nu=t=>t===document.scrollingElement?window:t;function iu(t,{container:e=document.scrollingElement,trackContentSize:n=!1,...i}={}){if(!e)return u;let s=tu.get(e);s||(s=new Set,tu.set(e,s));const o=Zc(e,t,{time:0,x:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0},y:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}},i);if(s.add(o),!Jc.has(e)){const t={time:0,x:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0},y:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}},n=()=>{!function(t,e,n){for(const i in $c)Kc(t,i,e,n);e.time=n}(e,t,W.timestamp);for(const e of s)e.measure(t);Kt.preUpdate(i)},i=()=>{for(const e of s)e.notify(t)},o=()=>Kt.read(n);Jc.set(e,o);const r=nu(e);window.addEventListener("resize",o),e!==document.documentElement&&Qc.set(e,Ga(e,o)),r.addEventListener("scroll",o),o()}if(n&&!eu.has(e)){const t=Jc.get(e),n={width:e.scrollWidth,height:e.scrollHeight},i=()=>{const i=e.scrollWidth,s=e.scrollHeight;n.width===i&&n.height===s||(t(),n.width=i,n.height=s)},s=Kt.read(i,!0);eu.set(e,s)}const r=Jc.get(e);return Kt.read(r,!1,!0),()=>{Yt(r);const t=tu.get(e);if(!t)return;if(t.delete(o),t.size)return;tu.delete(e);const n=Jc.get(e);Jc.delete(e),n&&(nu(e).removeEventListener("scroll",n),Qc.get(e)?.(),window.removeEventListener("resize",n));const i=eu.get(e);i&&(Yt(i),eu.delete(e))}}const su=new Map;const ou=t=>{if(/v/u.test(t))return[];const e=Hc(t,0,0,0);return[Hc(t,0,1,0)-e,e-Hc(t,1,0,0),e]},ru=([t,e,n])=>!n&&(0===e||1===e)&&`${e?"entry":"exit"}-crossing ${100*t}%`;function au(t,e){const{target:n,container:i,axis:s}=e,o=n&&function(t=_c.All){if(2!==t.length)return;const[e,n]=t.map(ou),i=[ru(e),ru(n)],s=n[0]-e[0],o=e[1]-n[1];return i[0]&&i[1]&&(s||o)?{points:i,a:s,b:o,cover:!e[0]&&1===s&&1===o}:void 0}(e.offset),r=function(t){return"undefined"!=typeof window&&(t?Dn():kn())}(n)&&(n?!!o:!e.offset),a=new Map,l=new Set;let c,u=!1;const h=(t,e)=>{const[n,i]=o.points;e.effect.updateTiming({direction:u?"normal"===t?"reverse":"alternate-reverse":t}),Object.assign(e,{rangeStart:u?i:n,rangeEnd:u?n:i}),e.play()},d=[t.attachTimeline({get timeline(){return r?function({container:t,target:e,axis:n}){let i=su.get(t);i||(i=new Map,su.set(t,i));const s=e??"self";let o=i.get(s);return o||(o={},i.set(s,o)),o[n]||(o[n]=e?new ViewTimeline({subject:e,axis:n}):new ScrollTimeline({source:t,axis:n}))}(e):void 0},onAttach:o&&(t=>{const e=t.effect.getTiming().direction;a.set(t,e),h(e,t)}),observe:t=>(t.pause(),l.add(t),c||(c=iu(t=>{l.forEach(e=>{e.time=e.iterationDuration*t[s].progress})},e)),()=>l.delete(t))})];if(r&&o){const{a:t,b:e}=o,r="y"===s?"clientHeight":"clientWidth",l=()=>{u!==(u=t*n[r]+e*i[r]<0)&&a.forEach(h)};l(),t*e<0&&d.push(Ga(l),Ga([n,i],l))}return()=>{d.forEach(t=>t()),c?.()}}const lu={some:0,all:1};t.AsyncMotionValueAnimation=li,t.DOMKeyframesResolver=rs,t.DOMVisualElement=ya,t.DocumentProjectionNode=Qr,t.Feature=class{constructor(t){this.isMounted=!1,this.node=t}update(){}},t.FlatTree=xr,t.GroupAnimation=ci,t.GroupAnimationWithThen=hi,t.HTMLProjectionNode=ea,t.HTMLVisualElement=Ta,t.JSAnimation=Ie,t.KeyframeResolver=An,t.LayoutAnimationBuilder=Da,t.MotionGlobalConfig=o,t.MotionValue=vi,t.MotionValueState=Ts,t.NativeAnimation=Fn,t.NativeAnimationExtended=$n,t.NativeAnimationWrapper=di,t.NodeStack=hr,t.ObjectVisualElement=class extends ga{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,e){if(function(t,e){return t in e}(e,t)){const n=t[e];if("string"==typeof n||"number"==typeof n)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(t,e){delete e.output[t]}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}build(t,e){Object.assign(t.output,e)}renderInstance(t,{output:e}){Object.assign(t,e)}sortInstanceNodePosition(){return 0}},t.PanSession=Za,t.SVGVisualElement=class extends ya{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=nr}getBaseTargetFromProps(t,e){return un.has(e)?super.getBaseTargetFromProps(t,e)??on(e):t[e]}getDefaultValue(t){return un.has(t)?this.latestValues[t]??on(t):void 0}readValueFromInstance(t,e){if(un.has(e)){const t=Ge(e);return t&&t.default||0}if(Bs.includes(e)){const n=getComputedStyle(t)[e];if("string"==typeof n&&n)return n.trim()}return e=hc.has(e)?e:Xi(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return mc(t,e,n)}build(t,e,n){js(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){pc(t,e,0,i)}mount(t){this.isSVGTag=dc(t.tagName),super.mount(t)}},t.SubscriptionManager=p,t.ViewTransitionBuilder=uc,t.VisualElement=ga,t.VisualElementDragControls=yl,t.acceleratedValues=Yn,t.addAttrValue=Os,t.addDomEvent=Jr,t.addEffect=ds,t.addPointerEvent=ja,t.addPointerInfo=Ba,t.addSVGValue=Fs,t.addScaleCorrector=function(t){for(const e in t)wo[e]=t[e],Y(e)&&(wo[e].isCSSVariable=!0)},t.addStyleValue=Es,t.addUniqueItem=e,t.addValueToWillChange=Yi,t.alpha=Z,t.analyseComplexValue=Tt,t.animate=Wc,t.animateEffectSubject=gs,t.animateElement=mo,t.animateLayout=function(t,e,n){const{scope:i,updateDom:s,defaultOptions:o}=Ca(t,e,n);return new Da(i,s,o)},t.animateMini=Uc,t.animateMotionValue=Vi,t.animateSingleValue=xo,t.animateTarget=Ji,t.animateValue=function(t){return new Ie(t)},t.animateValues=fs,t.animateVariant=Qi,t.animateView=function(t,e={}){return new uc(t,e)},t.animateVisualElement=ts,t.animationMapKey=mi,t.anticipate=M,t.applyAxisDelta=Qs,t.applyBoxDelta=to,t.applyGeneratorOptions=In,t.applyPointDelta=Js,t.applyPxDefaults=cs,t.applyTreeDeltas=io,t.arc=function(t={}){const e=function({strength:t=.5,peak:e=.5,direction:n,rotate:i=!1}={}){const s=!0===i?1:"number"==typeof i?i:0;let o;return(i,r)=>{const a=r.x-i.x,l=r.y-i.y;let c;c="cw"===n?-t:"ccw"===n?t:(Math.abs(a)>=Math.abs(l)?a:l)<0?-t:t;let u=Ci(i.x,i.y,r.x,r.y,c,e);if(void 0===n){const t=Math.abs(a)<Math.abs(l),n=i.x+a*e,s=i.y+l*e,h=t?Math.sign(u.x-n):Math.sign(u.y-s);void 0!==o&&0!==h&&h!==o?(c=-c,u=Ci(i.x,i.y,r.x,r.y,c,e)):0!==h&&(o=h)}const h=s?Di(0,i.x,u.x,r.x,i.y,u.y,r.y):0,d=s?Di(1,i.x,u.x,r.x,i.y,u.y,r.y):0,p=s?x(-180,180,d-h):0;return t=>{const e={x:ki(t,i.x,u.x,r.x),y:ki(t,i.y,u.y,r.y)};if(s){const n=Di(t,i.x,u.x,r.x,i.y,u.y,r.y),o=h+p*t;e.rotate=x(-180,180,n-o)*s}return e}}}(t),n={interpolateProjection(t){const n=t.x.translate,i=t.y.translate;if(!(Math.sqrt(n*n+i*i)<20))return e({x:n,y:i},{x:0,y:0})},animateValues(t,n,i,s,o){if(!("x"in n)&&!("y"in n))return;const r=t("x"),a=t("y"),l=n.x,c=n.y,u=(Array.isArray(l)&&null!=l[0]?l[0]:r?.get())??0,h=(Array.isArray(c)&&null!=c[0]?c[0]:a?.get())??0,d=Array.isArray(l)?l[l.length-1]:l??u,p=Array.isArray(c)?c[c.length-1]:c??h,m=e({x:u,y:h},{x:d,y:p}),f=void 0!==m(0).rotate?t("pathRotation"):void 0,g={delay:s,...Ti(i||{},"x")};delete g.path;const y=xi(0);y.start(Vi("",y,[0,1e3],{...g,isSync:!0,velocity:0,onUpdate:t=>{const e=m(t/1e3);r?.set(e.x),a?.set(e.y),f&&void 0!==e.rotate&&f.set(e.rotate)},onComplete:()=>{r?.set(d),a?.set(p),f?.set(0)},onStop:()=>f?.set(0),onCancel:()=>f?.set(0)})),y.animation&&o.push(y.animation),delete n.x,delete n.y}};return n},t.aspectRatio=cr,t.attachFollow=Il,t.attachSpring=Wl,t.attrEffect=Is,t.axisDeltaEquals=ur,t.axisEquals=or,t.axisEqualsRounded=ar,t.backIn=P,t.backInOut=E,t.backOut=A,t.boxEquals=rr,t.boxEqualsRounded=lr,t.buildHTMLStyles=Ds,t.buildProjectionTransform=gr,t.buildSVGAttrs=js,t.buildSVGPath=Rs,t.buildTransform=Qn,t.calcAxisDelta=Uo,t.calcBoxDelta=$o,t.calcChildStagger=gi,t.calcGeneratorDuration=qt,t.calcLength=Wo,t.calcRelativeAxis=zo,t.calcRelativeAxisPosition=Yo,t.calcRelativeBox=Ko,t.calcRelativePosition=Xo,t.camelCaseAttributes=hc,t.camelToDash=Xi,t.cancelFrame=Yt,t.cancelMicrotask=vo,t.cancelSync=bc,t.checkVariantsDidChange=yc,t.circIn=V,t.circInOut=D,t.circOut=k,t.clamp=i,t.cleanDirtyNodes=Cr,t.collectMotionValues=yi,t.color=mt,t.compareByDepth=vr,t.complex=At,t.containsCSSVariable=_,t.convertBoundingBoxToBox=zs,t.convertBoxToBoundingBox=Ks,t.convertOffsetToTimes=Se,t.copyAxisDeltaInto=Fo,t.copyAxisInto=Oo,t.copyBoxInto=Io,t.correctBorderRadius=pr,t.correctBoxShadow=mr,t.createAnimationState=function(t){let e=e=>Promise.all(e.map(({animation:e,options:n})=>ts(t,e,n))),n=vc(),i=!0,s=!1;function o(o){const{props:r,parent:a,manuallyAnimateOnMount:l}=t,c=i||s,u=[],h=new Set;let d={},p=1/0,m=t;do{m=!1!==m.props.inherit&&m.parent}while(m&&!m.isControllingVariants);if(gc.forEach((e,i)=>{const s=n[e],f=r[e],g=m&&m.props[e],y=void 0!==f?f:sa(g)||!1===g?g:void 0,v=sa(y),x=e===o?s.isActive:null;!1===x&&(p=i);const w=v&&void 0===f&&!(c&&l);if(s.protectedKeys={...d},!s.isActive&&null===x||!y&&!s.prevProp||ia(y)||"boolean"==typeof y)return;if("exit"===e&&s.isActive&&!0!==x)return void(d={...d,...s.prevResolvedValues});const T=yc(s.prevProp,y);let b=T||v&&(x&&!w||i>p),S=!1;const A=Array.isArray(y)?y:[y];let P={};if(!1!==x)for(const n of A){const{transition:i,transitionEnd:s,...o}=Oi(t,n,Ii(t,e))||{};P={...P,...o,...s}}const{prevResolvedValues:E}=s;for(const e in{...E,...P}){if(e in d)continue;const n=P[e],i=E[e],o=Array.isArray(n)&&Array.isArray(i)?!fc(n,i)||T:n!==i;if(o&&null==n)h.add(e);else if(o||void 0!==n&&h.has(e)){b=!0,h.delete(e)&&(S=!0),s.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)}else s.protectedKeys[e]=!0}if(s.prevProp=y,s.prevResolvedValues=P,s.isActive&&(d={...d,...P}),b&&(!w||!T||S))for(const n of A){const i={type:e};if("string"==typeof n&&c&&l&&a?.enteringChildren){const e=Oi(a,n)?.transition?.delayChildren;i.delay=gi(a.enteringChildren,t,e)}u.push({animation:n,options:i})}}),h.size){const{initial:e}=r,n={},i="boolean"!=typeof e&&Oi(t,Array.isArray(e)?e[0]:e,t.presenceContext?.custom);i&&i.transition&&(n.transition=i.transition),h.forEach(s=>{const o=t.getValue(s);o&&(o.liveStyle=!0);const a=i&&!Array.isArray(e)?i[s]:void 0,l=t.getBaseTargetFromProps(r,s);n[s]=(void 0!==a?a:void 0===l||zi(l)?void 0===t.initialValues[s]?t.baseTarget[s]:void 0:l)??null}),u.push({animation:n})}const f=c&&t.blockInitialAnimation||i&&!l&&(!1===r.initial||r.initial===r.animate);return i=s=!1,!f&&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=vc(),s=!0}}},t.createAxis=er,t.createAxisDelta=Qo,t.createBox=nr,t.createDelta=tr,t.createEffect=bs,t.createGeneratorEasing=Zt,t.createProjectionNode=Mr,t.createRenderBatcher=zt,t.createScopedAnimate=Fc,t.cubicBezier=T,t.cubicBezierAsString=Ln,t.defaultEasing=Ae,t.defaultOffset=be,t.defaultTransformValue=on,t.defaultValueTypes=Xe,t.degrees=at,t.delay=So,t.delayInSeconds=So,t.dimensionValueTypes=ns,t.distance=Ha,t.distance2D=_a,t.drag=function(t,e={}){const n=(({axis:t,constraints:e,elastic:n,momentum:i,transition:s,snapToOrigin:o,directionLock:r,propagation:a,onStart:l,onMove:c,onEnd:u,onDirectionLock:h,onTransitionEnd:d,onMeasureConstraints:p})=>({drag:t||!0,dragConstraints:e,dragElastic:n,dragMomentum:i,dragTransition:s,dragSnapToOrigin:o,dragDirectionLock:r,dragPropagation:a,onDragStart:l,onDrag:c,onDragEnd:u,onDirectionLock:h,onDragTransitionEnd:d,onMeasureDragConstraints:p}))(e),i=xs(t).map(t=>{const[i,s]=function(t){const e=Sa.get(t)||na.get(t)?.projection;if(e?.instance)return[e,()=>{}];const n=Ma(t);return[n,()=>Sa.get(t)===n&&Va(t,n)]}(t);i.setOptions({alwaysMeasureLayout:!0});const o=new yl(i.options.visualElement,()=>n),r=o.addListeners(),a=function(t,e){const{style:n}=t,i=t.getAttribute("draggable"),s=bl.map(t=>n.getPropertyValue(t)),o=e?"pan-"+("x"===e?"y":"x"):"none";return bl.forEach((t,e)=>n.setProperty(t,e<3?"none":o)),t.setAttribute("draggable","false"),()=>{bl.forEach((t,e)=>n.setProperty(t,s[e])),null===i?t.removeAttribute("draggable"):t.setAttribute("draggable",i)}}(t,e.axis);return()=>{a(),r?.(),o.cancel(),s()}});return()=>i.forEach(t=>t())},t.eachAxis=yr,t.easeIn=C,t.easeInOut=R,t.easeOut=L,t.easingDefinitionToFunction=F,t.elementDragControls=gl,t.expectsResolvedDragConstraints=function({dragConstraints:t,onMeasureDragConstraints:e}){return vl(t)&&!!e},t.extractEventInfo=Ra,t.fillOffset=Te,t.fillWildcards=qe,t.findDimensionValueType=is,t.findEffect=ms,t.findValueType=t=>Nl.find(es(t)),t.flushKeyframeResolvers=Sn,t.followValue=function(t,e){const n=xi(zi(t)?t.get():t);return Il(n,t,e),n},t.frame=Kt,t.frameData=W,t.frameSteps=Xt,t.generateLinearEasing=Ht,t.getAnimatableNone=_e,t.getAnimationMap=fi,t.getComputedStyle=Dl,t.getDefaultTransition=Pi,t.getDefaultValueType=Ge,t.getEasingForSegment=j,t.getFeatureDefinitions=function(){return fa},t.getFinalKeyframe=Ve,t.getMixer=Ot,t.getOptimisedAppearId=_i,t.getOriginIndex=function(t,e){if("first"===t)return 0;{const n=e-1;return"last"===t?n:n/2}},t.getValueAsType=qn,t.getValueTransition=Ti,t.getVariableValue=Bi,t.getVariantContext=function t(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent&&t(e.parent)||{};return void 0!==e.props.initial&&(n.initial=e.props.initial),n}const n={};for(let t=0;t<xc;t++){const i=ra[t],s=e.props[i];(sa(s)||!1===s)&&(n[i]=s)}return n},t.getViewAnimationLayerInfo=Jl,t.getViewAnimations=Ql,t.globalProjectionState=wr,t.handOffElementState=fo,t.has2DTranslate=_s,t.hasComplexValues=wt,t.hasReducedMotionListener=ha,t.hasScale=Gs,t.hasTransform=Hs,t.hasWarned=function(t){return y.has(t)},t.hex=ot,t.hover=function(t,e,n={}){const[i,s,o]=Sl(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||cl())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},t.hsla=pt,t.hslaToRgba=Et,t.inView=function(t,e,{root:n,margin:i,amount:s="some"}={}){const o=xs(t),r=new WeakMap,a=new IntersectionObserver(t=>{t.forEach(t=>{const n=r.get(t.target);if(t.isIntersecting!==Boolean(n))if(t.isIntersecting){const n=e(t.target,t);"function"==typeof n?r.set(t.target,n):a.unobserve(t.target)}else"function"==typeof n&&(n(t),r.delete(t.target))})},{root:n,rootMargin:i,threshold:"number"==typeof s?s:lu[s]});return o.forEach(t=>a.observe(t)),()=>a.disconnect()},t.inertia=xe,t.initPrefersReducedMotion=pa,t.interpolate=we,t.invariant=s,t.invisibleValues=Rt,t.isAnimationControls=ia,t.isBezierDefinition=O,t.isCSSVariableName=Y,t.isCSSVariableToken=G,t.isControllingVariants=aa,t.isDeltaZero=sr,t.isDragActive=cl,t.isDragging=ll,t.isEasingArray=B,t.isElementKeyboardAccessible=ol,t.isElementTextInput=al,t.isForcedMotionValue=xa,t.isGenerator=On,t.isHTMLElement=ys,t.isKeyframesTarget=Wi,t.isMotionValue=zi,t.isNear=No,t.isNodeOrChild=Al,t.isNumericalString=r,t.isObject=a,t.isPrimaryPointer=La,t.isSVGElement=vs,t.isSVGSVGElement=Ao,t.isSVGTag=dc,t.isTransitionDefined=Mi,t.isVariantLabel=sa,t.isVariantNode=la,t.isWaapiSupportedEasing=function t(e){return Boolean("function"==typeof e&&Cn()||!e||"string"==typeof e&&(e in Rn||Cn())||O(e)||Array.isArray(e)&&e.every(t))},t.isWillChangeMotionValue=Ki,t.isZeroValueString=l,t.keyframes=Pe,t.makeAnimationInstant=Kn,t.mapEasingToNativeEasing=Bn,t.mapValue=function(t,e,n,i){const s=Cl(e,n,i);return Fl(()=>s(t.get()))},t.maxGeneratorDuration=_t,t.measurePageBox=co,t.measureViewportBox=lo,t.memo=c,t.microtask=yo,t.millisecondsToSeconds=f,t.mirrorEasing=b,t.mix=Ut,t.mixArray=It,t.mixColor=Lt,t.mixComplex=Wt,t.mixImmediate=Mt,t.mixLinearColor=kt,t.mixNumber=Vt,t.mixObject=Ft,t.mixValues=Co,t.mixVisibility=Bt,t.motionValue=xi,t.moveItem=function([...t],e,n){const i=e<0?t.length+e:e;if(i>=0&&i<t.length){const i=n<0?t.length+n:n,[s]=t.splice(e,1);t.splice(i,0,s)}return t},t.nodeGroup=function(){const t=new Set,e=new WeakMap,n=()=>t.forEach(wc);return{add:i=>{t.add(i),e.set(i,i.addEventListener("willUpdate",n))},remove:i=>{t.delete(i);const s=e.get(i);s&&(s(),e.delete(i)),n()},dirty:n}},t.noop=u,t.number=q,t.numberValueTypes=Ye,t.optimizedAppearDataAttribute=Hi,t.optimizedAppearDataId=Gi,t.originProps=As,t.parseAnimateLayoutArgs=Ca,t.parseCSSVariable=Ri,t.parseValueFromTransform=rn,t.percent=lt,t.pipe=h,t.pixelsToPercent=dr,t.positionalKeys=Fi,t.prefersReducedMotion=ua,t.press=function(t,e,n={}){const[i,s,o]=Sl(t,n),r=t=>{const i=t.currentTarget;if(!Vl(t))return;if(kl.has(t))return;Pl.add(i),n.stopPropagation&&kl.add(t);const o=e(i,t),r={...s,capture:!0},a=(t,e)=>{window.removeEventListener("pointerup",l,r),window.removeEventListener("pointercancel",c,r),Pl.has(i)&&Pl.delete(i),Vl(t)&&"function"==typeof o&&o(t,{success:e})},l=t=>{a(t,i===window||i===document||n.useGlobalTarget||Al(i,t.target))},c=t=>{a(t,!1)};window.addEventListener("pointerup",l,r),window.addEventListener("pointercancel",c,r)};return i.forEach(t=>{(n.useGlobalTarget?window:t).addEventListener("pointerdown",r,s),ys(t)&&(t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const i=El(()=>{if(Pl.has(n))return;Ml(n,"down");const t=El(()=>{Ml(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>Ml(n,"cancel"),e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)})(t,s)),ol(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),o},t.progress=d,t.progressPercentage=dt,t.propEffect=go,t.propagateDirtyNodes=Dr,t.px=ct,t.readSVGValue=Ws,t.readStyleValue=Ms,t.readTransformValue=an,t.recordStats=function(){if(To.value)throw To.value=null,To.addProjectionMetrics=null,new Error("Stats are already being measured");const t=To;t.value={layoutProjection:{nodes:[],calculatedTargetDeltas:[],calculatedProjections:[]}},t.addProjectionMetrics=e=>{const{layoutProjection:n}=t.value;n.nodes.push(e.nodes),n.calculatedTargetDeltas.push(e.calculatedTargetDeltas),n.calculatedProjections.push(e.calculatedProjections)}},t.removeAxisDelta=Ho,t.removeAxisTransforms=_o,t.removeBoxTransforms=Jo,t.removeEffect=ps,t.removeItem=n,t.removePointDelta=Go,t.renderHTML=va,t.renderSVG=pc,t.resize=Ga,t.resolveElements=xs,t.resolveMotionValue=Po,t.resolveTransition=wi,t.resolveVariant=Oi,t.resolveVariantFromProps=ji,t.reverseEasing=S,t.rgbUnit=it,t.rgba=st,t.rootProjectionNode=ta,t.round=Oe,t.sampleDelta=Un,t.scale=J,t.scaleCorrectors=wo,t.scalePoint=Zs,t.scrapeHTMLMotionValuesFromProps=wa,t.scrapeSVGMotionValuesFromProps=mc,t.scroll=function(t,{axis:e="y",source:n,container:i=document.scrollingElement,...s}={}){if(!i)return u;const o={axis:e,container:n||i,...s};return"function"==typeof t?iu(n=>t(n[e].progress,n),o):au(t,o)},t.scrollInfo=iu,t.secondsToMilliseconds=m,t.setDragLock=ul,t.setFeatureDefinitions=function(t){fa=t},t.setStyle=En,t.setTarget=$i,t.spring=ve,t.springValue=function(t,e){const n=xi(zi(t)?t.get():t);return Wl(n,t,e),n},t.stagger=function(t=.1,{startDelay:e=0,from:n=0,ease:i,grid:s}={}){const o={};return(r,a)=>{let l=o[a];if(!l){const[t,e]=s||[1/0,1],i=Math.min(t,a)-1,r=Math.max(e,Math.ceil(a/t))-1,c="number"==typeof n,u="first"===n?0:"last"===n?1:.5,h=c?n%t:i*u,d=c?Math.floor(n/t):r*u;l=o[a]=[];for(let e=0;e<a;e++){const s=e%t,o=Math.floor(e/t),a=Math.min(s,i-s),c=Math.min(o,r-o);if("random"===n){const t=Math.random()*(e+1)|0;l[e]=l[t],l[t]=e}else l[e]="edges"===n?Math.min(i?a:c,r?c:a):Math.hypot(s-h,o-d)}l.push(s?Math.max(...l):a)}let c=t*l[r];const u=t*l[a];if(i&&u){c=F(i)(c/u)*u}return e+c}},t.startWaapiAnimation=jn,t.statsBuffer=To,t.steps=function(t,e="end"){return n=>{const s=(n="end"===e?Math.min(n,.999):Math.max(n,.001))*t,o="end"===e?Math.floor(s):Math.ceil(s);return i(0,1,o/t)}},t.styleEffect=ks,t.styleSubjectEffect=Vs,t.supportedWaapiEasing=Rn,t.supportsBrowserAnimation=_n,t.supportsFlags=Mn,t.supportsLinearEasing=Cn,t.supportsPartialKeyframes=us,t.supportsScrollTimeline=kn,t.supportsViewTimeline=Dn,t.supportsWaapi=Hn,t.svgEffect=Us,t.svgSubjectEffect=Ns,t.sync=Tc,t.testValueType=es,t.time=$,t.transform=Cl,t.transformAxis=oo,t.transformBox=ao,t.transformBoxPoints=Ys,t.transformPropOrder=cn,t.transformProps=un,t.transformValue=Fl,t.transformValueTypes=Ke,t.translateAxis=so,t.updateMotionValuesFromProps=ca,t.variantPriorityOrder=oa,t.variantProps=ra,t.velocityPerSecond=g,t.vh=ut,t.visualElementStore=na,t.vw=ht,t.warnOnce=v,t.warning=()=>{},t.wrap=x});
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={})}(this,function(t){"use strict";function e(t,e){-1===t.indexOf(e)&&t.push(e)}function n(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const i=(t,e,n)=>n>e?e:n<t?t:n;let s=()=>{};const o={},r=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),a=t=>"object"==typeof t&&null!==t,l=t=>/^0[^.\s]+$/u.test(t);function c(t){let e;return()=>(void 0===e&&(e=t()),e)}const u=t=>t,h=(...t)=>t.reduce((t,e)=>n=>e(t(n))),d=(t,e,n)=>{const i=e-t;return i?(n-t)/i:1};class p{constructor(){this.subscriptions=[]}add(t){return e(this.subscriptions,t),()=>this.remove(t)}remove(t){n(this.subscriptions,t)}notify(t,e,n){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,n);else for(let s=0;s<i;s++){const i=this.subscriptions[s];i&&i(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const m=t=>1e3*t,f=t=>t/1e3,g=(t,e)=>e?t*(1e3/e):0,y=new Set;function v(t,e,n){t||y.has(e)||(console.warn(function(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}(e,n)),y.add(e))}const x=(t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t},w=(t,e,n)=>t*(3*(1-t)*((1-t)*e+t*n)+t*t);function T(t,e,n,i){return t===e&&n===i?u:s=>{let o=0,r=1,a=s;for(let e=0;;e++){a>=o&&a<=r||(a=(o+r)/2);const i=w(a,t,n)-s;if(i*i<1e-28||40===e)break;i>0?r=a:o=a,a-=1e-7*i/(w(a+1e-7,t,n)-s-i)}return w(a,e,i)}}const b=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,S=t=>e=>1-t(1-e),A=T(.33,1.53,.69,.99),P=S(A),E=b(P),M=t=>t>=1?1:(t*=2)<1?.5*P(t):.5*(2-Math.pow(2,-10*(t-1))),V=t=>1-Math.sin(Math.acos(t)),k=S(V),D=b(V),C=T(.42,0,1,1),L=T(0,0,.58,1),R=T(.42,0,.58,1);const B=t=>Array.isArray(t)&&"number"!=typeof t[0];function j(t,e){return B(t)?t[x(0,t.length,e)]:t}const O=t=>Array.isArray(t)&&"number"==typeof t[0],I={linear:u,easeIn:C,easeInOut:R,easeOut:L,circIn:V,circInOut:D,circOut:k,backIn:P,backInOut:E,backOut:A,anticipate:M},F=t=>{if(O(t)){t.length;const[e,n,i,s]=t;return T(e,n,i,s)}return"string"==typeof t?I[t]:t},W={delta:0,timestamp:0,isProcessing:!1};let N;function U(){N=void 0}const $={now:()=>(void 0===N&&$.set(W.isProcessing||o.useManualTiming?W.timestamp:performance.now()),N),set:t=>{N=t,queueMicrotask(U)}},z=t=>Math.round(1e5*t)/1e5,K=t=>e=>"string"==typeof e&&e.startsWith(t),Y=K("--"),X=K("var(--"),G=t=>!!X(t)&&H.test(t.split("/*")[0].trim()),H=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function _(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const q={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},Z={...q,transform:t=>i(0,1,t)},J={...q,default:1},Q=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const tt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,et=(t,e)=>n=>Boolean("string"==typeof n&&tt.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),nt=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[s,o,r,a]=i.match(Q);return{[t]:parseFloat(s),[e]:parseFloat(o),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},it={...q,transform:t=>Math.round((t=>i(0,255,t))(t))},st={test:et("rgb","red"),parse:nt("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+it.transform(t)+", "+it.transform(e)+", "+it.transform(n)+", "+z(Z.transform(i))+")"};const ot={test:et("#"),parse:function(t){let e="",n="",i="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}},transform:st.transform},rt=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),at=rt("deg"),lt=rt("%"),ct=rt("px"),ut=rt("vh"),ht=rt("vw"),dt=(()=>({...lt,parse:t=>lt.parse(t)/100,transform:t=>lt.transform(100*t)}))(),pt={test:et("hsl","hue"),parse:nt("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+lt.transform(z(e))+", "+lt.transform(z(n))+", "+z(Z.transform(i))+")"},mt={test:t=>st.test(t)||ot.test(t)||pt.test(t),parse:t=>st.test(t)?st.parse(t):pt.test(t)?pt.parse(t):ot.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?st.transform(t):pt.transform(t),getAnimatableNone:t=>{const e=mt.parse(t);return e.alpha=0,mt.transform(e)}},ft=new RegExp(Q.source),gt=new RegExp(/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu.source,"i");const yt="number",vt="color",xt=/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 wt(t){const e=t.toString();return ft.test(e)||gt.test(e)}function Tt(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let o=0;const r=e.replace(xt,t=>(mt.test(t)?(i.color.push(o),s.push(vt),n.push(mt.parse(t))):t.startsWith("var(")?(i.var.push(o),s.push("var"),n.push(t)):(i.number.push(o),s.push(yt),n.push(parseFloat(t))),++o,"${}")).split("${}");return{values:n,split:r,indexes:i,types:s}}function bt({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===yt?z(i[o]):t===vt?mt.transform(i[o]):i[o]}return s}}const St=(t,e)=>{return"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof(n=t)?0:mt.test(n)?mt.getAnimatableNone(n):n;var n};const At={test:function(t){return isNaN(t)&&"string"==typeof t&&(ft.test(t)||gt.test(t))},parse:function(t){return Tt(t).values},createTransformer:function(t){return bt(Tt(t))},getAnimatableNone:function(t){const e=Tt(t);return bt(e)(e.values.map((t,n)=>St(t,e.split[n])))}};function Pt(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 Et({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=Pt(a,i,t+1/3),o=Pt(a,i,t),r=Pt(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}}function Mt(t,e){return n=>n>0?e:t}const Vt=(t,e,n)=>t+(e-t)*n,kt=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},Dt=[ot,st,pt];function Ct(t){const e=(n=t,Dt.find(t=>t.test(n)));var n;if(!e)return!1;let i=e.parse(t);return e===pt&&(i=Et(i)),i}const Lt=(t,e)=>{const n=Ct(t),i=Ct(e);if(!n||!i)return Mt(t,e);const s={...n};return t=>(s.red=kt(n.red,i.red,t),s.green=kt(n.green,i.green,t),s.blue=kt(n.blue,i.blue,t),s.alpha=Vt(n.alpha,i.alpha,t),st.transform(s))},Rt=new Set(["none","hidden"]);function Bt(t,e){return Rt.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function jt(t,e){return n=>Vt(t,e,n)}function Ot(t){return"number"==typeof t?jt:"string"==typeof t?G(t)?Mt:mt.test(t)?Lt:Wt:Array.isArray(t)?It:"object"==typeof t?mt.test(t)?Lt:Ft:Mt}function It(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>Ot(t)(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=s[e](t);return n}}function Ft(t,e){const n={...t,...e},i={};for(const s in n)void 0!==t[s]&&void 0!==e[s]&&(i[s]=Ot(t[s])(t[s],e[s]));return t=>{for(const e in i)n[e]=i[e](t);return n}}const Wt=(t,e)=>{const n=At.createTransformer(e),i=Tt(t),s=Tt(e);return i.indexes.var.length===s.indexes.var.length&&i.indexes.color.length===s.indexes.color.length&&i.indexes.number.length>=s.indexes.number.length?Rt.has(t)&&!s.values.length||Rt.has(e)&&!i.values.length?Bt(t,e):h(It(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}(i,s),s.values),n):Mt(t,e)},Nt=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function Ut(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return Vt(t,e,n);if("string"==typeof t&&"string"==typeof e){const n=function(t,e){const n=Nt.exec(t);if(!n)return;const i=Nt.exec(e);if(!i||n[2]!==i[2])return;const s=n[2],o=parseFloat(n[1]),r=parseFloat(i[1]);return t=>z(Vt(o,r,t))+s}(t,e);if(n)return n}return Ot(t)(t,e)}const $t=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function zt(t,e,n={delta:0,timestamp:0,isProcessing:!1}){let i=!1,s=!0;const r=()=>i=!0,a=$t.reduce((t,e)=>(t[e]=function(t){let e=new Set,n=new Set,i=!1,s=!1;const o=new Set;let r={delta:0,timestamp:0,isProcessing:!1};function a(e){o.has(e)&&(n.add(e),t()),e(r)}const l={schedule:(t,s=!1,r=!1)=>{const a=r&&i?e:n;return s&&o.add(t),a.add(t),t},cancel:t=>{n.delete(t),o.delete(t)},process:t=>{if(r=t,i)return void(s=!0);i=!0;const o=e;e=n,n=o,e.forEach(a),e.clear(),i=!1,s&&(s=!1,l.process(t))}};return l}(r),t),{}),{setup:l,read:c,resolveKeyframes:u,preUpdate:h,update:d,preRender:p,render:m,postRender:f}=a,g=()=>{const r=o.useManualTiming,a=r?n.timestamp:performance.now();i=!1,r||(n.delta=s?1e3/60:Math.max(Math.min(a-n.timestamp,40),1)),n.timestamp=a,n.isProcessing=!0,l.process(n),c.process(n),u.process(n),h.process(n),d.process(n),p.process(n),m.process(n),f.process(n),n.isProcessing=!1,i&&e&&(s=!1,t(g))};return{schedule:$t.reduce((e,o)=>{const r=a[o];return e[o]=(e,o=!1,a=!1)=>(i||(i=!0,s=!0,n.isProcessing||t(g)),r.schedule(e,o,a)),e},{}),cancel:t=>{for(let e=0;e<$t.length;e++)a[$t[e]].cancel(t)},state:n,steps:a}}const{schedule:Kt,cancel:Yt,steps:Xt}=zt("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:u,!0,W),Gt=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>Kt.update(e,t),stop:()=>Yt(e),now:()=>W.isProcessing?W.timestamp:$.now()}},Ht=(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)})`},_t=2e4;function qt(t,e=50,n=2e4,i){let s=0,o=t.next(s);for(i?.push(o.value);!o.done&&s<n;)s+=e,o=t.next(s),i?.push(o.value);return s>=n?1/0:s}function Zt(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(qt(r),_t);return{type:"keyframes",ease:t=>r.next(a*t).value/e,duration:f(a)}}const Jt=100,Qt=10,te=1,ee=800,ne=.3,ie=.3,se={granular:.01,default:2},oe={granular:.005,default:.5},re=.01,ae=10,le=.05,ce=t=>t<0?1/Math.max(1+t,le):Math.max(1-t,le);function ue(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 pe(t=>s*Math.exp(-i*t)-i*Math.exp(-s*t)-o,t=>Math.exp(-s*t)-Math.exp(-i*t),e)/e}function he(t,e){return t*Math.sqrt(1-e*e)}const de=12;function pe(t,e,n){let i=n;for(let n=1;n<de;n++)i-=t(i)/e(i);return i}const me=.001;const fe=(t,e)=>(e?t>=0:t>0)&&t<1/0;function ge(t,e){if(fe(t,e))return t}function ye(t){const e=ge(t.stiffness),n=ge(t.damping,!0),s=ge(t.mass),o={...t,stiffness:e??Jt,damping:n??Qt,mass:s??te,isResolvedFromDuration:!1,isTimeDefined:void 0===(e??n??s)&&(void 0!==t.duration||void 0!==t.bounce)};if(o.isTimeDefined){if(t.visualDuration){const e=ce(t.bounce||0),n=2*Math.PI/(1.2*t.visualDuration)*ue(e,2*Math.PI/1.2);o.stiffness=n*n,o.damping=2*e*Math.sqrt(o.stiffness)}else Object.assign(o,function({duration:t=ee,bounce:e=ne}){let n,s;const o=ce(e);t=i(re,ae,f(t)),o<1?(n=e=>{const n=e*o,i=n*t,s=he(e,o),r=Math.exp(-i);return me-n/s*r},s=e=>{const i=e*o*t,s=o*o*e*e*t,r=Math.exp(-i),a=he(e*e,o);return(-n(e)+me>0?-1:1)*-s*r/a}):(n=e=>Math.exp(-e*t)*(e*t+1)-.001,s=e=>Math.exp(-e*t)*(t*t*-e));const r=pe(n,s,5/t),a=r*ue(o,r*t),l=a*a;return{stiffness:l,damping:2*o*Math.sqrt(l),duration:m(t)}}(o)),o.isResolvedFromDuration=!0;fe(o.stiffness)&&fe(o.damping,!0)||(o.stiffness=Jt,o.damping=Qt)}return o}function ve(t=ie,e=ne){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:c,isResolvedFromDuration:u,isTimeDefined:h}=ye({...n}),d=t=>h?0:-f(t),p=a/(2*Math.sqrt(r*l)),g=f(Math.sqrt(r/l)),y=p*g,v={target:s,delta:s-i,velocity:d(n.velocity||0)||0,restSpeed:0,restDelta:0},x=()=>{const t=Math.abs(v.delta)<5;v.restSpeed=n.restSpeed||(t?se.granular:se.default),v.restDelta=n.restDelta||(t?oe.granular:oe.default)};let w,T,b;if(x(),p<1){const t=he(g,p),e={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};b=()=>{e.A=(v.velocity+y*v.delta)/t,e.sinC=y*e.A+v.delta*t,e.cosC=y*v.delta-e.A*t};const n=n=>{n!==e.t&&(e.t=n,e.env=Math.exp(-y*n),e.sin=Math.sin(t*n),e.cos=Math.cos(t*n))};w=t=>(n(t),v.target-e.env*(e.A*e.sin+v.delta*e.cos)),T=t=>(n(t),e.env*(e.sinC*e.sin+e.cosC*e.cos))}else if(1===p){w=t=>v.target-Math.exp(-g*t)*(v.delta+(v.velocity+g*v.delta)*t);const t={C:0};b=()=>{t.C=v.velocity+g*v.delta},T=e=>Math.exp(-g*e)*(g*t.C*e-v.velocity)}else{const t=g*Math.sqrt(p*p-1),e=y-t,n=y+t,i=h?1/0:300/t,s=(t,e)=>Math.exp(e>i?-t*i-y*(e-i):-t*e),o={S:0,F:0};b=()=>{const e=(v.velocity+y*v.delta)/t;o.S=(v.delta+e)/2,o.F=(v.delta-e)/2},w=t=>v.target-o.S*s(e,t)-o.F*s(n,t),T=t=>e*o.S*s(e,t)+n*o.F*s(n,t)}b();const S=u&&c||null,A={calculatedDuration:S,retarget:(t,e)=>{v.target=t[t.length-1],v.delta=v.target-t[0],v.velocity=d(e),n.restSpeed&&n.restDelta||x(),A.calculatedDuration=S,o.done=!1,b()},velocity:t=>m(T(t)),next:t=>{const e=w(t);if(u)o.done=t>=c;else{const n=m(T(t));o.done=Math.abs(n)<=v.restSpeed&&Math.abs(v.target-e)<=v.restDelta}return o.value=o.done?v.target:e,o},toString:()=>{const t=Math.min(qt(A),_t),e=Ht(e=>A.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return A}function xe({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:c=.5,restSpeed:u}){const h=t[0],d={done:!1,value:h},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=h+m,g=void 0===r?f:r(f);g!==f&&(m=g-h);const y=t=>-m*Math.exp(-t/i),v=t=>{const e=y(t);d.done=Math.abs(e)<=c,d.value=d.done?g:g+e};let x,w;const T=t=>{var e;((e=d.value)<a||e>l)&&(x=t,w=ve({keyframes:[d.value,p(d.value)],velocity:-y(t)/i*1e3,damping:s,stiffness:o,restDelta:c,restSpeed:u}))};return T(0),{calculatedDuration:null,next:t=>{let e=!1;return w||void 0!==x||(e=!0,v(t),T(t)),void 0!==x&&t>=x?w.next(t-x):(!e&&v(t),d)}}}function we(t,e,{clamp:n=!0,ease:s,mixer:r}={}){const a=t.length;if(e.length,1===a)return()=>e[0];if(2===a&&e[0]===e[1])return()=>e[1];const l=t[0]===t[1];t[0]>t[a-1]&&(t=[...t].reverse(),e=[...e].reverse());const c=function(t,e,n){const i=[],s=n||o.mix||Ut,r=t.length-1;for(let n=0;n<r;n++){let o=s(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]||u:e;o=h(t,o)}i.push(o)}return i}(e,s,r),p=c.length,m=n=>{if(l&&n<t[0])return e[0];let i=0;if(p>1)for(;i<t.length-2&&!(n<t[i+1]);i++);const s=d(t[i],t[i+1],n);return c[i](s)};return n?e=>m(i(t[0],t[a-1],e)):m}function Te(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=d(0,e,i);t.push(Vt(n,1,s))}}function be(t){const e=[0];return Te(e,t.length-1),e}function Se(t,e){return t.map(t=>t*e)}function Ae(t,e){return t.map(()=>e||R).splice(0,t.length-1)}function Pe({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const r=B(s)?s.map(F):F(s)||R,a={done:!1,value:e[0]};if(2===e.length&&!Array.isArray(r)&&(!n||2!==n.length||0===n[0]&&1===n[1])){const[n,s]=e,l=n===s?void 0:(o.mix||Ut)(n,s);return{calculatedDuration:t,next:e=>(a.value=l?l(r(t>0?i(0,1,e/t):1)):s,a.done=e>=t,a)}}const l=we(Se(n&&n.length===e.length?n:be(e),t),e,{ease:Array.isArray(r)?r:Ae(e,r)});return{calculatedDuration:t,next:e=>(a.value=l(e),a.done=e>=t,a)}}ve.applyToOptions=t=>{const e=Zt(t,100,ve);return t.ease=e.ease,t.duration=m(e.duration),t.type="keyframes",t};function Ee(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 g(n-t(i),e-i)}(e=>t.next(e).value,e,t.next(e).value)}const Me=t=>null!==t;function Ve(t,{repeat:e,repeatType:n="loop"},i,s=1){const o=t.filter(Me),r=s<0||e&&"loop"!==n&&e%2==1?0:o.length-1;return r&&void 0!==i?i:o[r]}const ke={decay:xe,inertia:xe,tween:Pe,keyframes:Pe,spring:ve};function De(t){"string"==typeof t.type&&(t.type=ke[t.type])}const Ce=(t,e)=>e-t>40&&!o.useManualTiming?e:t;function Le(t,e){return{kind:t,animation:e,timestamp:$.now(),frameTimestamp:W.timestamp,frameIsProcessing:W.isProcessing}}function Re(t,e,n){const i=globalThis.__MOTION_INSPECT__;if(i)try{i({...Le("animation-start",t),options:n?{...e,...n}:e})}catch{}}class Be{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 je=t=>t/100,Oe=t=>Math.round(1e4*t)/1e4;class Ie extends Be{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!==$.now()&&this.tick($.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause(),Re(this,this.options)}initAnimation(){const{options:t}=this;De(t);const{type:e=Pe,repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=t;let{keyframes:r}=t;const a=e||Pe;a!==Pe&&"number"!=typeof r[0]&&(this.mixKeyframes=h(je,Ut(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=qt(l));const{calculatedDuration:c}=l;this.calculatedDuration=c,this.resolvedDuration=c+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=l}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:n,totalDuration:i,calculatedDuration:s}=this;if(null===this.startTime)return n.next(0);const{delay:o=0,keyframes:r,type:a,onUpdate:l,finalKeyframe:c}=this.options;this.startTime===this.pendingStartTime&&(this.startTime=Ce(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 u=this.currentTime-o*(this.playbackSpeed>=0?1:-1),h=this.playbackSpeed>=0?u<0:u>i;this.currentTime=Math.max(u,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);const d=this.generate(this.currentTime,h);let{done:p}=d;h||null===s||(p=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const m=null===this.holdTime&&("finished"===this.state||"running"===this.state&&p);return m&&a!==xe&&(d.value=Ve(r,this.options,c,this.speed)),l&&l(d.value),m&&this.finish(),d}at(t){return this.holdTime??Oe((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!==xe?Ve(n.keyframes,n,e?void 0:n.finalKeyframe):this.generate(Math.max(s,0),s<0).value}generate(t,e){const{generator:n,totalDuration:s,mixKeyframes:o,mirroredGenerator:r,resolvedDuration:a}=this,{keyframes:l,repeat:c,repeatType:u,repeatDelay:h}=this.options;let d,p=t,m=n;if(c){const e=Math.min(t,s)/a;let n=Math.floor(e),o=e%1;!o&&e>=1&&(o=1),1===o&&n--,n=Math.min(n,c+1);Boolean(n%2)&&("reverse"===u?(o=1-o,h&&(o-=h/a)):"mirror"===u&&(m=r)),p=i(0,1,o)*a}return e?(this.delayState.value=l[0],d=this.delayState):d=m.next(p),o&&!e&&(d.value=o(d.value)),d}then(t,e){return this.finished.then(t,e)}get duration(){return f(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+f(t)}get time(){return f(this.currentTime)}set time(t){t=m(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){return Ee(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($.now()),this.playbackSpeed=t,e&&this.driver&&(this.time=f(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=Gt,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($.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}const Fe=new Set(["brightness","contrast","saturate","opacity"]);function We(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(Q)||[];if(!i)return t;const s=n.replace(i,"");let o=Fe.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+s+")"}const Ne=/\b([a-z-]*)\(.*?\)/gu,Ue={...At,getAnimatableNone:t=>{const e=t.match(Ne);return e?e.map(We).join(" "):t}},$e={...At,getAnimatableNone:t=>{const e=At.parse(t);return At.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},ze={...q,transform:Math.round},Ke={rotate:at,pathRotation:at,rotateX:at,rotateY:at,rotateZ:at,scale:J,scaleX:J,scaleY:J,scaleZ:J,skew:at,skewX:at,skewY:at,distance:ct,translateX:ct,translateY:ct,translateZ:ct,x:ct,y:ct,z:ct,perspective:ct,transformPerspective:ct,opacity:Z,originX:dt,originY:dt,originZ:ct},Ye={borderWidth:ct,borderTopWidth:ct,borderRightWidth:ct,borderBottomWidth:ct,borderLeftWidth:ct,borderRadius:ct,borderTopLeftRadius:ct,borderTopRightRadius:ct,borderBottomRightRadius:ct,borderBottomLeftRadius:ct,width:ct,maxWidth:ct,height:ct,maxHeight:ct,top:ct,right:ct,bottom:ct,left:ct,inset:ct,insetBlock:ct,insetBlockStart:ct,insetBlockEnd:ct,insetInline:ct,insetInlineStart:ct,insetInlineEnd:ct,padding:ct,paddingTop:ct,paddingRight:ct,paddingBottom:ct,paddingLeft:ct,paddingBlock:ct,paddingBlockStart:ct,paddingBlockEnd:ct,paddingInline:ct,paddingInlineStart:ct,paddingInlineEnd:ct,margin:ct,marginTop:ct,marginRight:ct,marginBottom:ct,marginLeft:ct,marginBlock:ct,marginBlockStart:ct,marginBlockEnd:ct,marginInline:ct,marginInlineStart:ct,marginInlineEnd:ct,fontSize:ct,backgroundPositionX:ct,backgroundPositionY:ct,...Ke,zIndex:ze,fillOpacity:Z,strokeOpacity:Z,numOctaves:ze},Xe={...Ye,color:mt,backgroundColor:mt,outlineColor:mt,fill:mt,stroke:mt,borderColor:mt,borderTopColor:mt,borderRightColor:mt,borderBottomColor:mt,borderLeftColor:mt,filter:Ue,WebkitFilter:Ue,mask:$e,WebkitMask:$e},Ge=t=>Xe[t],He=new Set([Ue,$e]);function _e(t,e){let n=Ge(t);return He.has(n)||(n=At),n.getAnimatableNone?n.getAnimatableNone(e):void 0}function qe(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const Ze=t=>180*t/Math.PI,Je=t=>{const e=Ze(Math.atan2(t[1],t[0]));return tn(e)},Qe={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:Je,rotateZ:Je,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},tn=t=>((t%=360)<0&&(t+=360),t),en=t=>Math.hypot(t[0],t[1]),nn=t=>Math.hypot(t[4],t[5]),sn={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:en,scaleY:nn,scaleZ:t=>Math.hypot(t[8],t[9],t[10]),scale:t=>(en(t)+nn(t))/2,rotateX:t=>tn(Ze(Math.atan2(t[6],t[5]))),rotateY:t=>tn(Ze(Math.atan2(-t[2],t[0]))),rotateZ:Je,rotate:Je,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 on(t){return t.includes("scale")?1:0}function rn(t,e){if(!t||"none"===t)return on(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,s;if(n)i=sn,s=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=Qe,s=e}if(!s)return on(e);const o=i[e],r=s[1].split(",").map(ln);return"function"==typeof o?o(r):r[o]}const an=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return rn(n,e)};function ln(t){return parseFloat(t.trim())}const cn=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","scaleZ","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],un=(()=>new Set([...cn,"pathRotation"]))(),hn=t=>t===q||t===ct,dn=new Set(["x","y","z"]),pn=cn.filter(t=>!dn.has(t));const mn=new Set(["bottom","right"]);function fn(t,e,n,i,s,o){const r=parseFloat(t);if(!isNaN(r))return r;const{min:a,max:l}=e()[n],c=l-a;return"border-box"===o?c:c-parseFloat(i)-parseFloat(s)}const gn={width:({width:t,paddingLeft:e="0",paddingRight:n="0",boxSizing:i},s)=>fn(t,s,"x",e,n,i),height:({height:t,paddingTop:e="0",paddingBottom:n="0",boxSizing:i},s)=>fn(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:({transform:t})=>rn(t,"x"),y:({transform:t})=>rn(t,"y")};gn.translateX=gn.x,gn.translateY=gn.y;const yn=new Set;let vn=!1,xn=!1,wn=!1;function Tn(){if(xn){const t=[],e=new Set,n=new Set;yn.forEach(i=>{i.needsMeasurement&&(t.push(i),e.add(i.element),mn.has(i.name)&&n.add(i.element))});const i=new Map;n.forEach(t=>{const e=function(t){const e=[];return pn.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)})}xn=!1,vn=!1,yn.forEach(t=>t.complete(wn)),yn.clear()}function bn(){yn.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(xn=!0)})}function Sn(){wn=!0,bn(),Tn(),wn=!1}class An{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?(yn.add(this),vn||(vn=!0,Kt.read(bn),Kt.resolveKeyframes(Tn))):(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(r(t)||l(t))return parseFloat(t);if(!At.test(t)&&At.test(n))return _e(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])}qe(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),yn.delete(this)}cancel(){"scheduled"===this.state&&(yn.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const Pn=t=>t.startsWith("--");function En(t,e,n){Pn(e)?t.style.setProperty(e,n):t.style[e]=n}const Mn={};function Vn(t,e){const n=c(t);return()=>Mn[e]??n()}const kn=Vn(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),Dn=Vn(()=>void 0!==window.ViewTimeline,"viewTimeline"),Cn=Vn(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),Ln=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,Rn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ln([0,.65,.55,1]),circOut:Ln([.55,0,1,.45]),backIn:Ln([.31,.01,.66,-.59]),backOut:Ln([.33,1.53,.69,.99])};function Bn(t,e){return t?"function"==typeof t?Cn()?Ht(t,e):"ease-out":O(t)?Ln(t):Array.isArray(t)?t.map(t=>Bn(t,e)||Rn.easeOut):Rn[t]:void 0}function jn(t,e,n,{delay:i=0,duration:s=300,repeat:o=0,repeatType:r="loop",ease:a="easeOut",times:l}={},c=void 0){const u={[e]:n};l&&(u.offset=l);const h=Bn(a,s);Array.isArray(h)&&(u.easing=h);const d={delay:i,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:o+1,direction:"reverse"===r?"alternate":"normal"};return c&&(d.pseudoElement=c),t.animate(u,d)}function On(t){return"function"==typeof t&&"applyToOptions"in t}function In({type:t,...e}){return On(t)&&Cn()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class Fn extends Be{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,t.type;const l=In(t);this.animation=jn(e,n,i,l,s),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const t=Ve(i,this.options,r,this.speed);this.updateMotionValue&&this.updateMotionValue(t),En(e,n,t),this.animation.cancel()}a?.(),this.notifyFinished()},Re(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(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return f(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+f(t)}get time(){return f(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=m(t),e&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,onAttach:e,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&kn()?(this.animation.timeline=t,e?.(this.animation),u):n(this)}}const Wn={anticipate:M,backInOut:E,circInOut:D};function Nn(t){"string"==typeof t.ease&&t.ease in Wn&&(t.ease=Wn[t.ease])}const Un=10;class $n extends Fn{constructor(t){Nn(t),De(t),super(t),void 0!==t.startTime&&!1!==t.autoplay&&(this.startTime=t.startTime),this.options=t}elapsed(){return"running"===this.state?($.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 Ie({...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:s}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const{speed:o}=this,r=this.elapsed(),a="running"===this.state&&o?i(0,10,r):0,l=this.sample(r);n&&s&&En(n,s,l),e.setWithVelocity(this.sample(r-a*Math.sign(o)),l,a/Math.abs(o||1))}}const zn=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!At.test(t)&&"0"!==t||t.startsWith("url(")));function Kn(t){t.duration=0,t.type="keyframes"}const Yn=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),Xn=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;const Gn=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Hn=c(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function _n(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:o,type:r,keyframes:a}=t;if(!n||!Yn.has(n)&&!Gn.has(n))return!1;const l=e?.owner?.current;if(!(l instanceof HTMLElement||l instanceof SVGElement))return!1;const{onUpdate:c,transformTemplate:u}=e.owner.getProps();return Hn()&&(Yn.has(n)||Gn.has(n)&&function(t){for(let e=0;e<t.length;e++)if("string"==typeof t[e]&&Xn.test(t[e]))return!0;return!1}(a))&&("transform"!==n||!u)&&!c&&!i&&"mirror"!==s&&0!==o&&"inertia"!==r}const qn=(t,e)=>e&&"number"==typeof t?e.transform(t):t,Zn={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Jn=cn.length;function Qn(t,e,n){let i="",s=!0;for(let o=0;o<Jn;o++){const r=cn[o],a=t[r];if(void 0===a)continue;let l=!0;if("number"==typeof a)l=a===(r.startsWith("scale")?1:0);else{const t=parseFloat(a);l=r.startsWith("scale")?1===t:0===t}if(!l||n){const t=qn(a,Ye[r]);if(!l){s=!1;i+=`${Zn[r]||r}(${t}) `}n&&(e[r]=t)}}const o=t.pathRotation;return o&&(s=!1,i+=`rotate(${qn(o,Ye.pathRotation)}) `),i=i.trim(),n?i=n(e,s?"":i):s&&(i="none"),i}const ti=new WeakMap,ei=.001,ni=(t,e)=>t-e,ii=(t,e,n)=>{const i=[];for(let s=0;s<=n;s++)i.push(Vt(t,e,s/n));return i},si=t=>t.motionValue.owner,oi=t=>ti.get(t),ri=(t,e)=>t.latestValues?t.latestValues[e]:t.getValue(e)?.get();class ai extends Ie{constructor(t){const e=si(t).current,{driver:n=Gt}=t;let i;const s=function(t){const e=si(t),{onUpdate:n,transformTemplate:i}=e.getProps();return!(t.isHandoff||n||t.hasOnUpdate||i||"inertia"===t.type||"none"!==(ri(e,"transform")||"none")||ri(e,"pathRotation")||e.projection?.isProjecting())}(t);t.driver=t=>{const s=n(t);return{js:s,now:s.now,start:(t=!0)=>{const n=oi(e);!n||n.isJS?s.start(t):n.schedule(!1,!t)},stop:()=>{s.stop();const t=oi(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 oi(si(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($.now()):void 0}tween(){const{keyframes:t,type:e,ease:n,times:i,repeat:s,delay:o=0}=this.options,r=O(n)?Ln(n):(t=>/^(linear|ease(In|Out|InOut))$/.test(t))(n)&&Rn[n];if(r&&!s&&!i&&2===t.length&&e===Pe&&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:c,times:u,keyframes:h,type:d}=o,p=(d||Pe)===Pe?u||be(h):[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&&c&&"loop"!==c?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=$.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,c=!1,u=!1,h=!1,p=-1/0;const m=t=>{for(const e of n)if(e.name===t)return!0},f=(e,n)=>{const r={};for(const a of void 0===e?cn:o){const o=i.get(a),l=void 0===e?ri(t,a):o?o.sampleAt(n>e&&!o.timing()[1]?n:e):s[a];void 0!==l&&(r[a]=l)}return r},g=(t,e)=>{let n="";const i=f(t,e);for(const t in i)n+=(Zn[t]||t)+"("+qn(i[t],Ye[t])+") ";return n||"none"},y=(t=f())=>{e.style.transform=Qn(t,{})},v=(t=!0)=>{t&&y(),a.forEach(({animation:t})=>t.cancel()),a=[]},x=(t,e,n=1/0)=>{const i={animation:t,offset:e,end:n};t.startTime=$.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)),k.schedule(!1)}),t.oncancel=()=>a.includes(i)&&k.demote(),a.push(i)},w=(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)/Un)));if(4*i.length>s)return;const o=ii(e,n,s).concat(i).sort(ni),r=t=>d(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)*ei>Math.abs(s))?0:s,c=i.map(t=>r?t/r:t);if(r)if(a){if(c.some((t,e)=>!(Math.abs(t-a[e])<=ei)))return}else a=c,l=t=>(e.numberAt(t)-n)/r;else if(c.some(t=>!(Math.abs(t)<=ei)))return}if(!a||a.every((t,e)=>Math.abs(t-r(o[e]))<=ei))return"linear";const c=[],u=(t,e=l(t))=>c.push(Oe(e)+" "+Oe(100*r(t))+"%");return a.forEach((t,e)=>{e&&Math.abs(t-a[e-1])>.2&&w(l,o[e-1],o[e]).forEach(t=>u(t)),u(o[e],t)}),"linear("+c+")"},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(...w(t=>i.numberAt(t),e,n));s.push(n)}},a=ii(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(ni))t>l&&r(l,t,0),l=t;return s.sort(ni)},S=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},A=(t,n,i,s={fill:"both"},o,r)=>{const a=t.flatMap(t=>t.boundaries(n,i)),l=r||T(t,n,i,a),c=l?[n,i]:b(t,n,i,a),u=c.map(t=>g(t,o));let h={transform:u};return l||(h.offset=c.map(t=>d(n,i,t))),u.every(t=>t===u[0])&&(y(f(n,o)),h=null),e.animate(h,{...s,duration:i-n,easing:l||"linear"})},P=l=>{let c=l,u=0,h=0;const d=[],p=[],m=new Set;i.clear(),r=new Map;for(const t of n){i.set(t.name,t);const[e,n]=t.timing(),s=e===1/0;if(r.set(t,[t.at(l),t.speed,s]),s)t.sync();else{if(t.speed<0)return;if(n){if(u){const t=(e-h)/n;if(Math.abs(n-u)>1||Math.abs(t-Math.round(t))*u>1)return}else u=n,h=e;p.push(t)}else m.add(e);d.push(t),c=Math.max(c,e)}}s={},o=cn.filter(e=>{if(i.has(e))return!0;const n=s[e]=ri(t,e);return void 0!==n&&parseFloat(n)!==(e.startsWith("scale")?1:0)}),v(!1);const f=!u&&S(d);try{if(f&&f[1]>l){const[t,e,n]=f;x(A(d,t,e,void 0,void 0,n),t-l,e-t)}else c>l&&(x(A(d,l,c),0,c-l),m.forEach(t=>t<c-1&&x(e.animate(null,{duration:t-l}),0,t-l)));if(u){const t=h+Math.floor((c-h)/u)*u;x(A(p,t,t+u,{iterations:1/0,iterationStart:(c-t)/u,fill:"forwards"},c),c-l)}}catch{return}return a.length||v(),!0},E=t=>{let e,i=0;for(const s of n){const n=r.get(s);if(!n)return!1;const[o,a,l]=n,c=s.at(t),u=s.timing()[0]===1/0;if(l){if(u&&c===o)continue;return!1}const h=(c-o)/a,d=u?0:s.speed/a;if(void 0===e)e=h,i=d;else if(Math.abs(h-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.playbackRate=i,n.startTime=t-r/i):(n.pause(),n.currentTime=r)}return!0},M=()=>!n.size&&(u=!0,oi(e)===k&&ti.delete(e),k.isJS||v(),!0),V=()=>{const e=$.now();if(k.isJS||(k.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]=ri(t,n.name),r.has(n)||(l=!0))}),k.isFinishing=!1),c=!1,u)return;if(n.forEach(({state:t},e)=>{"idle"!==t&&"finished"!==t||n.delete(e)}),M())return;for(const t of n)if(!t.canAccelerate)return k.demote(!0);k.isJS&&(k.isJS=!1,l=!0,n.forEach(t=>t.js?.stop()));const i=l,o=h;if(l=h=!1,i||!E(e)){if(o){if(e-p<100)return k.demote();p=e}if(!P(e))return k.demote()}},k={tracks:n,isJS:!1,isFinishing:!1,schedule(t,e){u||(l||(l=t),h||(h=!!e),c||(c=!0,W.isProcessing?Kt.render(V,!1,!0):queueMicrotask(V)))},release(t){const{state:e}=t;"idle"!==e&&"finished"!==e||n.delete(t),M()||k.schedule(!0)},check(){if(!k.isJS)for(const e in s)if(ri(t,e)!==s[e]&&!m(e))return k.schedule(!0,!0)},demote(t){k.isJS||u||(n.forEach(e=>{e.isAccelerated()&&e.sync(),t||(e.canAccelerate=!1)}),k.isJS=!0,r=new Map,v(),n.forEach(t=>"running"===t.state&&t.js?.start()))}};return ti.set(e,k),k}(si(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($.now())}get time(){return this.isAccelerated()?f(i(0,this.totalDuration,this.at($.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 li extends Be{constructor(t){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=$.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||An;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:r,velocity:a,delay:l,isHandoff:c,onUpdate:u}=n;this.resolvedAt=$.now();let h=!0;(function(t,e,n,i){const s=t[0];if(null===s)return!1;if("display"===e||"visibility"===e)return!0;const o=t[t.length-1],r=zn(s,e),a=zn(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||On(n))&&i)})(t,s,r,a)||(h=!1,!o.instantAnimations&&l||u?.(Ve(t,n,e)),t[0]=t[t.length-1],Kn(n),n.repeat=0);const{onComplete:d}=n;n.finalKeyframe=e,n.keyframes=t,n.onComplete=()=>{d?.(),this.notifyFinished()};const p=h&&!c&&_n(n),m=!p&&(({name:t,motionValue:e})=>t&&cn.includes(t)&&e?.owner?.current instanceof HTMLElement&&Hn()&&Cn())(n);let f;if(i&&(p||m||this.resolvedAt!==this.createdAt)&&(n.startTime??(n.startTime=Ce(this.createdAt,this.resolvedAt))),p){n.element=n.motionValue?.owner?.current;try{f=new $n(n)}catch{f=new Ie(n)}}else f=m?new ai(n):new Ie(n);this.pendingTimeline&&(this.stopTimeline=f.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=f}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(),Sn()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}class ci{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;n<this.animations.length;n++)this.animations[n][t]=e}attachTimeline(t){const e=this.animations.map(e=>e.attachTimeline(t));return()=>{e.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return ui(this.animations,"duration")}get iterationDuration(){return ui(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(e=>e[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function ui(t,e){let n=0;for(let i=0;i<t.length;i++){const s=t[i][e];null!==s&&s>n&&(n=s)}return n}class hi extends ci{then(t,e){return this.finished.finally(t).then(()=>{})}}class di extends Fn{constructor(t){super(),this.animation=t,t.onfinish=()=>{this.finishedTime=this.time,this.notifyFinished()},Re(this,{})}}const pi=new WeakMap,mi=(t,e="")=>`${t}:${e}`;function fi(t){let e=pi.get(t);return e||(e=new Map,pi.set(t,e)),e}function gi(t,e,n,i=0,s=1){const o=Array.from(t).sort((t,e)=>t.sortNodePosition(e)).indexOf(e),r=t.size,a=(r-1)*i;return"function"==typeof n?n(o,r):1===s?o*i:a-o*i}const yi={current:void 0};class vi{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=$.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.notifyChange(),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=$.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 p)).add(e)}onChangeSubscribe(t){const{events:e}=this;return e.change||this.changeSubscriber?(e.change||(e.change=new p,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(){Kt.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&&this.stopPassiveEffect()}dirty(){this.notifyChange()}notifyChange(){const{current:t,changeSubscriber:e}=this;e?e(t):this.events.change?.notify(t)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){yi.current&&yi.current.push(this);const t=this.animation?.liveValue?.();return void 0===t?this.current:t}getCurrent(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=$.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return g(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.clearAnimation(),e()}),i||(this.animation=n),this.events.animationStart?.notify()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){this.animation=void 0}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function xi(t,e){return new vi(t,e)}function wi(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}function Ti(t,e){const n=t?.[e]??t?.default??t;return n!==t?wi(n,t):n}const bi={type:"spring",stiffness:500,damping:25,restSpeed:10},Si={type:"keyframes",duration:.8},Ai={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Pi=(t,{keyframes:e})=>e.length>2?Si:un.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:bi:Ai,Ei=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function Mi(t){for(const e in t)if(!Ei.has(e))return!0;return!1}const Vi=(t,e,n,i={},s,r)=>a=>{const l=Ti(i,t)||{},c=l.delay||i.delay||0;let{elapsed:u=0}=i;u-=m(c);const h={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-u,onUpdate:t=>{e.set(t),l.onUpdate&&l.onUpdate(t)},onComplete:()=>{a(),l.onComplete&&l.onComplete()},name:t,motionValue:e,element:r?void 0:s,hasOnUpdate:!!l.onUpdate};Mi(l)||Object.assign(h,Pi(t,h)),h.duration&&(h.duration=m(h.duration)),h.repeatDelay&&(h.repeatDelay=m(h.repeatDelay)),void 0!==h.from&&(h.keyframes[0]=h.from);let d=!1;if((!1===h.type||0===h.duration&&!h.repeatDelay)&&(Kn(h),0===h.delay&&(d=!0)),(o.instantAnimations||o.skipAnimations||s?.shouldSkipAnimations||l.skipAnimations)&&(d=!0,Kn(h),h.delay=0),h.allowFlatten=!l.type&&!l.ease,d&&!r&&void 0!==e.get()){const t=Ve(h.keyframes,l);if(void 0!==t)return void Kt.update(()=>{h.onUpdate(t),h.onComplete()})}return l.isSync?new Ie(h):new li(h)};function ki(t,e,n,i){const s=1-t;return s*s*e+2*s*t*n+t*t*i}function Di(t,e,n,i,s,o,r){const a=2*(1-t)*(n-e)+2*t*(i-n),l=2*(1-t)*(o-s)+2*t*(r-o);return Math.atan2(l,a)*(180/Math.PI)}function Ci(t,e,n,i,s,o){const r=n-t,a=i-e,l=Math.sqrt(r*r+a*a);if(l>0){const n=s*l;return{x:t+r*o+-a/l*n,y:e+a*o+r/l*n}}return{x:t,y:e}}const Li=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Ri(t){const e=Li.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n??i}`,s]}function Bi(t,e,n=1){const[i,s]=Ri(t);if(!i)return;const o=window.getComputedStyle(e).getPropertyValue(i);if(o){const t=o.trim();return r(t)?parseFloat(t):t}return G(s)?Bi(s,e,n+1):s}function ji(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 Oi(t,e,n){return ji(t.getProps(),e,n,t)}const Ii=(t,e)=>"exit"===e?t.presenceContext?.custom:void 0,Fi=new Set(["width","height","top","left","right","bottom",...cn]),Wi=t=>Array.isArray(t);function Ni(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,xi(n))}function Ui(t){return Wi(t)?t[t.length-1]||0:t}function $i(t,e){const n=Oi(t,e);let{transitionEnd:i={},transition:s={},...o}=n||{};o={...o,...i};for(const e in o){Ni(t,e,Ui(o[e]))}}const zi=t=>Boolean(t&&t.getVelocity);function Ki(t){return Boolean(zi(t)&&t.add)}function Yi(t,e){const n=t.getValue("willChange");if(Ki(n))return n.add(e);if(!n&&o.WillChange){const n=new o.WillChange("auto");t.addValue("willChange",n),n.add(e)}}function Xi(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const Gi="framerAppearId",Hi="data-"+Xi(Gi);function _i(t){return t.props[Hi]}const qi="undefined"!=typeof window;function Zi({protectedKeys:t,needsAnimating:e},n){const i=n in t&&!e[n];return e[n]=!1,i}function Ji(t,e,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:o,transitionEnd:r,...a}=e;const l=t.getDefaultTransition();o=o?wi(o,l):l;const c=o?.reduceMotion,u=o?.skipAnimations;i&&(o=i);const h=[],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,h):p.animateVisualElement?.(t,a,o,n,h));for(const e in a){const i=t.getValue(e,t.latestValues[e]??null),s=a[e];if(void 0===s||d&&Zi(d,e))continue;const r={delay:n,...Ti(o||{},e)};u&&(r.skipAnimations=!0);const l=i.get();if(void 0!==l&&!i.isAnimating()&&!Array.isArray(s)&&s===l&&!r.velocity){Kt.update(()=>i.set(s));continue}let p=!1;if(qi&&window.MotionHandoffAnimation){const n=_i(t);if(n){const t=window.MotionHandoffAnimation(n,e,Kt);null!==t&&(r.startTime=t,p=!0)}}Yi(t,e);const m=c??t.shouldReduceMotion;i.start(Vi(e,i,s,m&&Fi.has(e)?{type:!1}:r,t,p));const f=i.animation;f&&h.push(f)}if(r){const e=()=>Kt.update(()=>{r&&$i(t,r)});h.length?Promise.all(h).then(e):e()}return h}function Qi(t,e,n={}){const i=Oi(t,e,Ii(t,n.type)),s=n.transitionOverride||(i?.transition??(t.getDefaultTransition()||{})),o=()=>Promise.all(i?Ji(t,i,n):[]),r=(i=0)=>{const{variantChildren:o}=t,{delayChildren:r=0,staggerChildren:a,staggerDirection:l}=s,c=[];return o?.forEach(t=>{t.notify("AnimationStart",e),c.push(Qi(t,e,{...n,delay:i+("function"==typeof r?0:r)+gi(o,t,r,a,l)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(c)},{when:a}=s;return a?"beforeChildren"===a?o().then(()=>r()):r().then(o):Promise.all([o(),r(n.delay)])}function ts(t,e,n={}){t.notify("AnimationStart",e);return(Array.isArray(e)?Promise.all(e.map(e=>Qi(t,e,n))):"string"==typeof e?Qi(t,e,n):Promise.all(Ji(t,Oi(t,e,n.custom),n))).then(()=>{t.notify("AnimationComplete",e)})}const es=t=>e=>e.test(t),ns=[q,ct,lt,at,ht,ut,{test:t=>"auto"===t,parse:t=>t}],is=t=>ns.find(es(t));function ss(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||l(t))}const os=new Set(["auto","none","0"]);class rs extends An{constructor(t,e,n,i,s){super(t,e,n,i,s,!0)}scheduleResolve(){if(this.canReadNow()&&(this.readKeyframes(),!this.needsMeasurement))return this.complete();super.scheduleResolve()}canReadNow(){const{unresolvedKeyframes:t,element:e,motionValue:n}=this,i=t[0]??n?.get();if(!e?.current||void 0===i)return!1;for(let e=0;e<t.length;e++)if(_(e?t[e]:i))return!1;return!0}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){let i=t[n];if("string"==typeof i&&(i=i.trim(),G(i))){const s=Bi(i,e.current);void 0!==s&&(t[n]=s),n===t.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!Fi.has(n)||2!==t.length)return;const[i,s]=t;if("number"==typeof i&&"number"==typeof s)return;const o=is(i),r=is(s);if(_(i)!==_(s)&&gn[n])this.needsMeasurement=!0;else if(o!==r)if(hn(o)&&hn(r))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else gn[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)(null===t[e]||ss(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&&!os.has(e)&&wt(e)&&(i=t[s]),s++}if(i&&n)for(const s of e)t[s]!==i&&(t[s]=_e(n,i))}(t,n,e)}measure(){const{element:t,name:e}=this;return gn[e](window.getComputedStyle(t.current),()=>t.measureViewportBox())}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!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||!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.removedTransforms?.length&&this.removedTransforms.forEach(([e,n])=>{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const as=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],ls=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius",...as,"width","maxWidth","height","maxHeight","top","right","bottom","left","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInline","insetInlineStart","insetInlineEnd","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingBlock","paddingBlockStart","paddingBlockEnd","paddingInline","paddingInlineStart","paddingInlineEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockStart","marginBlockEnd","marginInline","marginInlineStart","marginInlineEnd","fontSize","backgroundPositionX","backgroundPositionY"]);function cs(t,e){for(let n=0;n<t.length;n++)"number"==typeof t[n]&&ls.has(e)&&(t[n]=t[n]+"px")}const us=c(()=>{try{document.createElement("div").animate({opacity:[1]})}catch(t){return!1}return!0}),hs=[];function ds(t){"function"==typeof t.test&&t.read,ps(t),hs.unshift(t)}function ps(t){n(hs,t)}function ms(t){return hs.find(e=>e.test(t))}function fs(t,e,n={},i){const s=[],{velocity:o,path:r}=n,a=n.reduceMotion??i?.shouldReduceMotion;r?.animateValues&&i&&(e={...e},r.animateValues(t,e,n,0,s));for(const r in e){if("transition"===r||"transitionEnd"===r)continue;const l=e[r];if(void 0===l)continue;const c=t(r),u=c.get();void 0===u||c.isAnimating()||Array.isArray(l)||l!==u||o?(c.start(Vi(r,c,l,a&&Fi.has(r)?{type:!1}:n,i)),c.animation&&s.push(c.animation)):Kt.update(()=>c.set(l))}const{transitionEnd:l}=e;if(l){const e=()=>Kt.update(()=>{for(const e in l)t(e).set(l[e])});s.length?Promise.all(s).then(e):e()}return s}function gs(t,e,n,i,s){return fs(i=>{let o=t.get(e,i);if(!o){let r;if(!s){const s=n[i];r=function(t){const e=Array.isArray(t)?t[0]:void 0;return null===e?void 0:e}(s)??t.read(e,i,s)}o=xi(r,{owner:s}),t(e,{[i]:o})}return o},n,i,s)}function ys(t){return a(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}function vs(t){return a(t)&&"ownerSVGElement"in t}const xs={};function ws(t){return xs.current?.add(t),t}function Ts(t){const e=xs.current;if(!e)return;let n,i=!1;const s=e.add(()=>{i=!0,n?.()});t.then(t=>{t&&(n=()=>t.stop(),i?n():t.finished.then(s))},s)}const bs=t=>xs.current?xs.current.bind(t):t;function Ss(t,e,n){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){const i=e?e.current:xs.current?.root||document,s=n?.[t]??i.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t).filter(t=>null!=t)}function As(t){const{test:e,read:n,get:i,flush:s,state:o}=t;return Object.assign((e,n)=>{const i=Ss(e),s=[];for(const e of i){const i=t(e,n);s.push(i)}return()=>{for(const t of s)t()}},{test:e,read:n,get:i,flush:s,state:o})}class Ps{constructor(t=Kt.render){this.step=t,this.values=new Map,this.pending=[],this.numPending=0,this.flush=()=>{const{pending:t,numPending:e}=this;this.numPending=0;for(let n=0;n<e;n++)t[n]()}}set(t,e,n,i){if(this.values.get(t)?.onRemove(),i)for(const t of this.values.values())t.value===i&&(n=t.render);const s=()=>n&&this.schedule(n);void 0!==e.get()&&s();const o=e.on("change",s),r=()=>{o(),n&&!i&&this.cancel(n),this.values.get(t)?.onRemove===r&&this.values.delete(t)};return this.values.set(t,{value:e,render:i?void 0:n,onRemove:r}),r}get(t){return this.values.get(t)?.value}release(){const t=new Map;return this.values.forEach((e,n)=>{t.set(n,e.value),e.onRemove()}),this.transformKeys=this.transformValues=void 0,t}schedule(t){const{pending:e,numPending:n}=this;for(let i=0;i<n;i++)if(e[i]===t)return;n||this.step(this.flush),e[this.numPending++]=t}cancel(t){const{pending:e}=this;for(let n=0;n<this.numPending;n++)if(e[n]===t)return void(e[n]=e[--this.numPending])}}function Es(t,{step:e,...n}={}){const i=new WeakMap;return Object.assign((n,s)=>{const o=i.get(n)??new Ps(e);i.set(n,o);const r=[];for(const e in s){const i=s[e],a=t(n,o,e,i);r.push(a)}return()=>{for(const t of r)t()}},n,{get:(t,e)=>i.get(t)?.get(e),flush:t=>i.get(t)?.flush(),state:t=>i.get(t)})}const Ms={};const Vs=new Set(["originX","originY","originZ"]),ks=(t,e)=>qn(t.get(e)?.get(),Ye[e]),Ds=(t,e,n,i)=>{let s,o;if(un.has(n)){if("pathRotation"!==n){const t=e.transformKeys??(e.transformKeys=[]);(e.transformValues??(e.transformValues={}))[n]=i,t.includes(n)||(t.push(n),t.sort((t,e)=>cn.indexOf(t)-cn.indexOf(e)))}e.get("transform")||(ys(t)||e.get("transformBox")||Ds(t,e,"transformBox",new vi("fill-box")),e.set("transform",new vi("none"),()=>{ti.get(t)?.check(),t.style.transform=function(t){let e="";const{transformKeys:n=[],transformValues:i={}}=t;for(let t=0;t<n.length;t++){const s=n[t],o=i[s].getCurrent();void 0!==o&&(("number"==typeof o?o:parseFloat(o))!==(s.startsWith("scale")?1:0)&&(e+=(e&&" ")+(Ms[s]||(Ms[s]=(Zn[s]||s)+"("))+qn(o,Ke[s])+")"))}const s=t.get("pathRotation")?.get();return s&&(e+=(e&&" ")+"rotate("+qn(s,Ke.pathRotation)+")"),e||"none"}(e)})),o=e.get("transform")}else Vs.has(n)?(e.get("transformOrigin")||e.set("transformOrigin",new vi(""),()=>{const n=ks(e,"originX")??"50%",i=ks(e,"originY")??"50%",s=ks(e,"originZ")??0;t.style.transformOrigin=`${n} ${i} ${s}`}),o=e.get("transformOrigin")):s=Pn(n)?()=>{t.style.setProperty(n,i.getCurrent())}:()=>{t.style[n]=qn(i.getCurrent(),Ye[n])};return e.set(n,i,s,o)},Cs=(t,e)=>{if(un.has(e))return an(t,e);const n=getComputedStyle(t),i=Pn(e)?n.getPropertyValue(e):n[e];return"string"==typeof i&&i.trim()||0},Ls=Es(Ds,{test:t=>ys(t)||vs(t),read:Cs}),Rs=As(Ls);function Bs(t,e,n){const{style:i,vars:s,transformOrigin:o}=t;let r=!1,a=!1;for(const t in e){const n=e[t];if(un.has(t))r=!0;else if(Y(t))s[t]=n;else{const e=qn(n,Ye[t]);t.startsWith("origin")?(a=!0,o[t]=e):i[t]=e}}if(e.transform||(r||n?i.transform=Qn(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 js={offset:"stroke-dashoffset",array:"stroke-dasharray"},Os={offset:"strokeDashoffset",array:"strokeDasharray"};function Is(t,e,n=1,i=0,s=!0){t.pathLength=1;const o=s?js:Os;t[o.offset]=""+-i,t[o.array]=`${e} ${n}`}const Fs=["transform","opacity","clipPath","filter","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Ws(t,{attrX:e,attrY:n,attrScale:i,pathLength:s,pathSpacing:o=1,pathOffset:r=0,...a},l,c,u){if(Bs(t,a,c),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:h,style:d}=t;for(const t of Fs)void 0!==h[t]&&(d[t]=h[t],delete h[t]);(d.transform||h.transformOrigin)&&(d.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete h.transformBox),void 0!==e&&(h.x=e),void 0!==n&&(h.y=n),void 0!==i&&(h.scale=i),void 0!==s&&Is(h,s,o,r,!1)}const Ns=(t,e,n,i,s=n)=>{const o=function(t,e){if(!(e in t))return!1;const n=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t),e)||Object.getOwnPropertyDescriptor(t,e);return n&&"function"==typeof n.set}(t,s);o||!s.startsWith("data")&&!s.startsWith("aria")||(s=Xi(s));const r=Ye[n]||Ye[s],a=o?()=>{t[s]=qn(i.get(),Ye[n])}:()=>{const e=qn(i.get(),r);null==e?t.removeAttribute(s):t.setAttribute(s,String(e))};return e.set(n,i,a)},Us=As(Es(Ns));const $s=(t,e,n,i)=>{if(n.startsWith("path")&&!un.has(n))return function(t,e,n,i){return Kt.render(()=>t.setAttribute("pathLength","1")),"pathOffset"===n?e.set(n,i,()=>{const e=i.get();t.setAttribute("stroke-dashoffset",""+-e)}):(e.get("stroke-dasharray")||e.set("stroke-dasharray",new vi("1 1"),()=>{const n=e.get("pathLength")?.get()??1,i=e.get("pathSpacing")?.get();t.setAttribute("stroke-dasharray",`${n} ${i??1-Number(n)}`)}),e.set(n,i,void 0,e.get("stroke-dasharray")))}(t,e,n,i);if(n.startsWith("attr"))return Ns(t,e,n,i,Xs(n));return(un.has(n)||Vs.has(n)||Pn(n)||n in t.style?Ds:Ns)(t,e,n,i)},zs=(t,e)=>un.has(e)?Ye[e]?.default||0:Pn(e)||Fs.includes(e)?Cs(t,e)||t.getAttribute(Xi(e))||0:(e=Xs(e),t.getAttribute(Xi(e))??t.getAttribute(e)??void 0),Ks=Es($s,{test:vs,read:zs}),Ys=As(Ks);function Xs(t){return t.replace(/^attr([A-Z])/,(t,e)=>e.toLowerCase())}function Gs({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function Hs({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function _s(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}}function qs(t){return void 0===t||1===t}function Zs({scale:t,scaleX:e,scaleY:n}){return!qs(t)||!qs(e)||!qs(n)}function Js(t){return Zs(t)||Qs(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.rotateZ||t.skewX||t.skewY}function Qs(t){return to(t.x)||to(t.y)}function to(t){return t&&"0%"!==t}function eo(t,e,n){return n+e*(t-n)}function no(t,e,n,i,s){return void 0!==s&&(t=eo(t,s,i)),eo(t,n,i)+e}function io(t,e=0,n=1,i,s){t.min=no(t.min,e,n,i,s),t.max=no(t.max,e,n,i,s)}function so(t,{x:e,y:n}){io(t.x,e.translate,e.scale,e.originPoint),io(t.y,n.translate,n.scale,n.originPoint)}const oo=.999999999999,ro=1.0000000000001;function ao(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;const{visualElement:s}=o.options;s&&s.props.style&&"contents"===s.props.style.display||(i&&o.options.layoutScroll&&o.scroll&&o!==o.root&&(lo(t.x,-o.scroll.offset.x),lo(t.y,-o.scroll.offset.y)),r&&(e.x*=r.x.scale,e.y*=r.y.scale,so(t,r)),i&&Js(o.latestValues)&&ho(t,o.latestValues,o.layout?.layoutBox))}e.x<ro&&e.x>oo&&(e.x=1),e.y<ro&&e.y>oo&&(e.y=1)}function lo(t,e){t.min+=e,t.max+=e}function co(t,e,n,i,s=.5){io(t,e,n,Vt(t.min,t.max,s),i)}function uo(t,e){return"string"==typeof t?parseFloat(t)/100*(e.max-e.min):t}function ho(t,e,n){const i=n??t;co(t.x,uo(e.x,i.x),e.scaleX,e.scale,e.originX),co(t.y,uo(e.y,i.y),e.scaleY,e.scale,e.originY)}function po(t,e){return Gs(_s(t.getBoundingClientRect(),e))}function mo(t,e,n){const i=po(t,n),{scroll:s}=e;return s&&(lo(i.x,s.offset.x),lo(i.y,s.offset.y)),i}const fo={},go=t=>vs(t)?Ks:Ls;class yo{constructor(t,e){this.effect=t,this.current=e,this.KeyframeResolver=rs}getValue(t){return this.effect.get(this.current,t)}readValue(t,e){return this.effect.read(this.current,t,e)}render(){this.effect.flush(this.current)}measureViewportBox(){return po(this.current)}getProps(){return fo}}function vo(t,e,n,i){if(xs.current?.track(t),i)return fs(t=>i.getValue(t,null),e,n,i);const s=go(t);return gs(s,t,e,n,new yo(s,t))}const xo=t=>go(t).state(t)?.release();function wo(t,e){const n=go(t).state(t);if(!n)return;const i=ti.get(t);i&&(i.demote(),ti.delete(t));const{transformKeys:s}=n;n.release().forEach((t,n)=>{"transformBox"===n||"transform"===n&&s?.length||(t.owner=e,e.addValue(n,t))})}const To=Es((t,e,n,i)=>e.set(n,i,()=>{t[n]=i.get()}),{test:t=>a(t),read:(t,e)=>{const n=t[e];return"string"==typeof n||"number"==typeof n?n:void 0}}),{schedule:bo,cancel:So}=zt(queueMicrotask,!1);function Ao(t,e,n){const i=zi(t)?t:xi(t);return i.start(Vi("",i,e,n)),i.animation}const Po={};const Eo={value:null,addProjectionMetrics:null};function Mo(t,e){const n=$.now();t=bs(t);const i=({timestamp:s})=>{const o=s-n;o>=e&&(Yt(i),t(o-e))};return Kt.setup(i,!0),ws(()=>Yt(i))}function Vo(t,e){return Mo(t,m(e))}function ko(t){return vs(t)&&"svg"===t.tagName}function Do(t){return zi(t)?t.get():t}const Co=t=>"number"==typeof t?t:parseFloat(t),Lo=as.length,Ro=["rotate","rotateX","rotateY","rotateZ","skewX","skewY"],Bo=Ro.length,jo=t=>"number"==typeof t||ct.test(t);function Oo(t,e,n,i,s,o){s?(t.opacity=Vt(0,n.opacity??1,Fo(i)),t.opacityExit=Vt(e.opacity??1,0,Wo(i))):o&&(t.opacity=Vt(e.opacity??1,n.opacity??1,i));for(let s=0;s<Lo;s++){const o=as[s];let r=Io(e,o),a=Io(n,o);if(void 0===r&&void 0===a)continue;r||(r=0),a||(a=0);0===r||0===a||jo(r)===jo(a)?(t[o]=Math.max(Vt(Co(r),Co(a),i),0),(lt.test(a)||lt.test(r))&&(t[o]+="%")):t[o]=a}for(let s=0;s<Bo;s++){const o=Ro[s];(e[o]||n[o])&&(t[o]=Vt(e[o]||0,n[o]||0,i))}}function Io(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const Fo=No(0,.5,k),Wo=No(.5,.95,u);function No(t,e,n){return i=>i<t?0:i>e?1:n(d(t,e,i))}function Uo(t,e){t.min=e.min,t.max=e.max}function $o(t,e){Uo(t.x,e.x),Uo(t.y,e.y)}function zo(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function Ko(t){return t.max-t.min}function Yo(t,e,n){return Math.abs(t-e)<=n}function Xo(t,e,n,i=.5){t.origin=i,t.originPoint=Vt(e.min,e.max,t.origin),t.scale=Ko(n)/Ko(e),t.translate=Vt(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 Go(t,e,n,i){Xo(t.x,e.x,n.x,i?i.originX:void 0),Xo(t.y,e.y,n.y,i?i.originY:void 0)}function Ho(t,e,n,i=0){const s=i?Vt(n.min,n.max,i):n.min;t.min=s+e.min,t.max=t.min+Ko(e)}function _o(t,e,n,i){Ho(t.x,e.x,n.x,i?.x),Ho(t.y,e.y,n.y,i?.y)}function qo(t,e,n,i=0){const s=i?Vt(n.min,n.max,i):n.min;t.min=e.min-s,t.max=t.min+Ko(e)}function Zo(t,e,n,i){qo(t.x,e.x,n.x,i?.x),qo(t.y,e.y,n.y,i?.y)}function Jo(t,e,n,i,s){return t=eo(t-=e,1/n,i),void 0!==s&&(t=eo(t,1/s,i)),t}function Qo(t,e=0,n=1,i=.5,s,o=t,r=t){if(lt.test(e)){e=parseFloat(e);e=Vt(r.min,r.max,e/100)-r.min}if("number"!=typeof e)return;let a=Vt(o.min,o.max,i);t===o&&(a-=e),t.min=Jo(t.min,e,n,a,s),t.max=Jo(t.max,e,n,a,s)}function tr(t,e,[n,i,s],o,r){Qo(t,e[n],e[i],e[s],e.scale,o,r)}const er=["x","scaleX","originX"],nr=["y","scaleY","originY"];function ir(t,e,n,i){tr(t.x,e,er,n?n.x:void 0,i?i.x:void 0),tr(t.y,e,nr,n?n.y:void 0,i?i.y:void 0)}const sr=()=>({translate:0,scale:1,origin:0,originPoint:0}),or=()=>({x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}),rr=()=>({min:0,max:0}),ar=()=>({x:{min:0,max:0},y:{min:0,max:0}});function lr(t){return 0===t.translate&&1===t.scale}function cr(t){return lr(t.x)&&lr(t.y)}function ur(t,e){return t.min===e.min&&t.max===e.max}function hr(t,e){return ur(t.x,e.x)&&ur(t.y,e.y)}function dr(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function pr(t,e){return dr(t.x,e.x)&&dr(t.y,e.y)}function mr(t){return Ko(t.x)/Ko(t.y)}function fr(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class gr{constructor(){this.members=[]}add(t){e(this.members,t);for(let e=this.members.length-1;e>=0;e--){const i=this.members[e];if(i===t||i===this.lead||i===this.prevLead)continue;const s=i.instance;s&&!1!==s.isConnected||i.snapshot||(n(this.members,i),i.unmount())}t.scheduleRender()}remove(t){if(n(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 yr(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const vr={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!ct.test(t))return t;t=parseFloat(t)}return`${yr(t,e.target.x)}% ${yr(t,e.target.y)}%`}},xr={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=At.parse(t);if(s.length>5)return i;const o=At.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 c=Vt(a,l,.5);return"number"==typeof s[2+r]&&(s[2+r]/=c),"number"==typeof s[3+r]&&(s[3+r]/=c),o(s)}},wr={borderRadius:{...vr,applyTo:[...as]},borderTopLeftRadius:vr,borderTopRightRadius:vr,borderBottomLeftRadius:vr,borderBottomRightRadius:vr,boxShadow:xr};function Tr(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,rotate:e,pathRotation:s,rotateX:o,rotateY:r,rotateZ:a,skewX:l,skewY:c}=n;t&&(i=`perspective(${t}px) ${i}`),e&&(i+=`rotate(${e}deg) `),s&&(i+=`rotate(${s}deg) `),o&&(i+=`rotateX(${o}deg) `),r&&(i+=`rotateY(${r}deg) `),a&&(i+=`rotateZ(${a}deg) `),l&&(i+=`skewX(${l}deg) `),c&&(i+=`skewY(${c}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"}function br(t){return[t("x"),t("y")]}const Sr=(t,e)=>t.depth-e.depth;class Ar{constructor(){this.children=[],this.isDirty=!1}add(t){e(this.children,t),this.isDirty=!0}remove(t){n(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Sr),this.isDirty=!1,this.children.forEach(t)}}const Pr={hasAnimatedSinceResize:!0,hasEverUpdated:!1};Object.assign(Po,{...wr,...Po});const Er={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},Mr=["","X","Y","Z"];let Vr=0;function kr(t,e,n,i){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),i&&(i[t]=0))}const Dr=({instance:t})=>t&&ti.get(t)?.demote();function Cr(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=_i(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:e,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",Kt,!(e||i))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&Cr(i)}function Lr({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:o}){return class{constructor(t={},n=e?.()){this.id=Vr++,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,Eo.value&&(Er.nodes=Er.calculatedTargetDeltas=Er.calculatedProjections=0),this.nodes.forEach(jr),this.nodes.forEach(Yr),this.nodes.forEach(Xr),this.nodes.forEach(Or),Eo.addProjectionMetrics&&Eo.addProjectionMetrics(Er)},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 Ar)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new p),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){const n=this.eventHandlers.get(t);n&&n.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}mount(e){if(this.instance)return;this.isSVG=vs(e)&&!ko(e),this.instance=e;const{layoutId:n,layout:i,visualElement:s}=this.options;if(s&&!s.current&&s.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(i||n)&&(this.isLayoutDirty=!0),t){let n,i=0;const s=()=>this.root.updateBlockedByResize=!1;Kt.read(()=>{i=window.innerWidth}),t(e,()=>{const t=window.innerWidth;t!==i&&(i=t,this.root.updateBlockedByResize=!0,n&&n(),n=Mo(s,250),Pr.hasAnimatedSinceResize&&(Pr.hasAnimatedSinceResize=!1,this.nodes.forEach(Kr)))})}n&&this.root.registerSharedNode(n,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()||Zr,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=n.getProps(),l=!this.targetLayout||!pr(this.targetLayout,s),c=!e&&i;if(this.options.layoutRoot||this.resumeFrom||c||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const e={...Ti(o,"layout"),onPlay:r,onComplete:a};(n.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e),this.setAnimationOrigin(t,c,e.path)}else e||Kr(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=s}))}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),this.hasLayoutListener=!1,Yt(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Gr),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Cr(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;Dr(this),this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){const e=this.path[t];e.shouldResetTransform=!0,Dr(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(Wr),void this.nodes.forEach(Fr)}if(this.animationId<=this.animationCommitId)return void this.nodes.forEach(Nr);this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Ur),this.nodes.forEach($r),this.nodes.forEach(zr),this.nodes.forEach(Rr),this.nodes.forEach(Br)):this.nodes.forEach(Nr),this.clearAllSnapshots();const t=$.now();W.delta=i(0,1e3/60,t-W.timestamp),W.timestamp=t,W.isProcessing=!0,Xt.update.process(W),Xt.preRender.process(W),Xt.render.process(W),W.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,bo.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Ir),this.sharedNodes.forEach((t,e)=>t.members.length?t.removeLeadSnapshot():this.sharedNodes.delete(e))}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Kt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Kt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||Ko(this.snapshot.measuredBox.x)||Ko(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&&e.notify("LayoutMeasure",this.layout.layoutBox,t?t.layoutBox:void 0)}updateScroll(t="measure"){let e=Boolean(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===t&&(e=!1),e&&this.instance){const e=s(this.instance);this.scroll={animationId:this.root.animationId,phase:t,isRoot:e,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:e}}}resetTransform(){if(!o)return;const t=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout;t&&Dr(this);const e=this.projectionDelta&&!cr(this.projectionDelta),n=this.getTransformTemplate(),i=n?n(this.latestValues,""):void 0,s=i!==this.prevTransformTemplateValue;t&&this.instance&&(e||Js(this.latestValues)||s)&&(o(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)),ta((i=n).x),ta(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(na))){const{scroll:t}=this.root;t&&(lo(e.x,t.offset.x),lo(e.y,t.offset.y))}return e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};if($o(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&&$o(e,t),lo(e.x,s.offset.x),lo(e.y,s.offset.y))}return e}applyTransform(t,e=!1,n){const i=n||{x:{min:0,max:0},y:{min:0,max:0}};$o(i,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];!e&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(lo(i.x,-n.scroll.offset.x),lo(i.y,-n.scroll.offset.y)),Js(n.latestValues)&&ho(i,n.latestValues,n.layout?.layoutBox)}return Js(this.latestValues)&&ho(i,this.latestValues,this.layout?.layoutBox),i}removeTransform(t){const e={x:{min:0,max:0},y:{min:0,max:0}};$o(e,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];if(!Js(n.latestValues))continue;let i;n.instance&&(Zs(n.latestValues)&&n.updateSnapshot(),i=ar(),$o(i,n.measurePageBox())),ir(e,n.latestValues,n.snapshot?.layoutBox,i)}return Js(this.latestValues)&&ir(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!==W.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=W.timestamp;const o=this.getClosestProjectingParent();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(),_o(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(Boolean(this.resumingFrom)?this.applyTransform(this.layout.layoutBox,!1,this.target):$o(this.target,this.layout.layoutBox),so(this.target,this.targetDelta)):$o(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,!1!==this.options.layoutAnchor&&o&&Boolean(o.resumingFrom)===Boolean(this.resumingFrom)&&!o.options.layoutScroll&&o.target&&1!==this.animationProgress?this.createRelativeTarget(o,this.target,o.target):this.relativeParent=this.relativeTarget=void 0),Eo.value&&Er.calculatedTargetDeltas++)}getClosestProjectingParent(){if(this.parent&&!Zs(this.parent.latestValues)&&!Qs(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}},Zo(this.relativeTargetOrigin,e,n,this.options.layoutAnchor||void 0),$o(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===W.timestamp&&(n=!1),n)return;const{layout:i,layoutId:s}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!i&&!s)return;$o(this.layoutCorrected,this.layout.layoutBox);const o=this.treeScale.x,r=this.treeScale.y;ao(this.layoutCorrected,this.treeScale,this.path,e),!t.layout||t.target||1===this.treeScale.x&&1===this.treeScale.y||(t.target=t.layout.layoutBox,t.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:a}=t;a?(this.projectionDelta&&this.prevProjectionDelta?(zo(this.prevProjectionDelta.x,this.projectionDelta.x),zo(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),Go(this.projectionDelta,this.layoutCorrected,a,this.latestValues),this.treeScale.x===o&&this.treeScale.y===r&&fr(this.projectionDelta.x,this.prevProjectionDelta.x)&&fr(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",a)),Eo.value&&Er.calculatedProjections++):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){if(this.options.visualElement?.scheduleRender(),t){const t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}}setAnimationOrigin(t,e=!1,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?i.source:void 0)!==(this.layout?this.layout.source:void 0),c=this.getStack(),u=!c||c.members.length<=1,h=Boolean(l&&!u&&!0===this.options.crossfade&&!this.path.some(qr));let d;this.animationProgress=0;const p=n?.interpolateProjection(t);this.mixTargetDelta=e=>{const n=e/1e3,i=p?.(n);var c,m,f,g;i?(r.x.translate=i.x,r.x.scale=Vt(t.x.scale,1,n),r.x.origin=t.x.origin,r.x.originPoint=t.x.originPoint,r.y.translate=i.y,r.y.scale=Vt(t.y.scale,1,n),r.y.origin=t.y.origin,r.y.originPoint=t.y.originPoint):(Hr(r.x,t.x,n),Hr(r.y,t.y,n)),this.setTargetDelta(r),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Zo(a,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),c=this.relativeTarget,m=this.relativeTargetOrigin,f=a,g=n,_r(c.x,m.x,f.x,g),_r(c.y,m.y,f.y,g),d&&hr(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),$o(d,this.relativeTarget)),l&&(this.animationValues=o,Oo(o,s,this.latestValues,n,h,u)),i&&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&&(Yt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Kt.update(()=>{Pr.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=xi(0)),this.motionValue.jump(0,!1),this.currentAnimation=Ao(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({...Le("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&&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&&ea(this.options.animationType,this.layout.layoutBox,n.layoutBox)){s=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=Ko(this.layout.layoutBox.x);s.x.min=t.target.x.min,s.x.max=s.x.min+e;const n=Ko(this.layout.layoutBox.y);s.y.min=t.target.y.min,s.y.max=s.y.min+n}$o(e,s),ho(e,i),Go(this.projectionDeltaWithTransform,this.layoutCorrected,e,i)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new gr);this.sharedNodes.get(t).add(e);const n=e.options.initialPromotionConfig;e.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){const{layoutId:t}=this.options;return t&&this.getStack()?.lead||this}getPrevLead(){const{layoutId:t}=this.options;return t?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const i=this.getStack();i&&i.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:n}=t;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(e=!0),!e)return;const i={};n.z&&kr("z",t,i,this.animationValues);for(let e=0;e<Mr.length;e++)kr(`rotate${Mr[e]}`,t,i,this.animationValues),kr(`skew${Mr[e]}`,t,i,this.animationValues);t.render();for(const e in i)t.setStaticValue(e,i[e]),this.animationValues&&(this.animationValues[e]=i[e]);t.scheduleRender()}applyProjectionStyles(t,e){if(!this.instance||this.isSVG)return;if(!this.isVisible)return void(t.visibility="hidden");const n=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,t.visibility="",t.opacity="",t.pointerEvents=Do(e?.pointerEvents)||"",void(t.transform=n?n(this.latestValues,""):"none");const i=this.getLead();if(!this.projectionDelta||!this.layout||!i.target)return this.options.layoutId&&(t.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,t.pointerEvents=Do(e?.pointerEvents)||""),void(this.hasProjected&&!Js(this.latestValues)&&(t.transform=n?n({},""):"none",this.hasProjected=!1));t.visibility="";const s=i.animationValues||i.latestValues;this.applyTransformsToTarget();let o=Tr(this.projectionDeltaWithTransform,this.treeScale,s);n&&(o=n(s,o)),t.transform=o;const{x:r,y:a}=this.projectionDelta;t.transformOrigin=`${100*r.origin}% ${100*a.origin}% 0`,i.animationValues?t.opacity=i===this?s.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:s.opacityExit:t.opacity=i===this?void 0!==s.opacity?s.opacity:"":void 0!==s.opacityExit?s.opacityExit:0;for(const e in Po){if(void 0===s[e])continue;const{correct:n,applyTo:r,isCSSVariable:a}=Po[e],l="none"===o?s[e]:n(s[e],i);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=i===this?Do(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(Fr),this.root.sharedNodes.clear()}}}function Rr(t){t.updateLayout(),function(t){const{snapshot:e,dragAncestor:n}=t,i=n?.layout;if(!e||!i||t.resumeFrom||t.isAnimationBlocked)return;const s=n.dragSnapshot;br(t=>lo(e.layoutBox[t],i.layoutBox[t].min-s.layoutBox[t].min))}(t)}function Br(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=t.layout,{animationType:s}=t.options,o=e.source!==t.layout.source;if("size"===s)br(t=>{const i=o?e.measuredBox[t]:e.layoutBox[t],s=Ko(i);i.min=n[t].min,i.max=i.min+s});else if("x"===s||"y"===s){const t="x"===s?"y":"x";Uo(o?e.measuredBox[t]:e.layoutBox[t],n[t])}else ea(s,e.layoutBox,n)&&br(i=>{const s=o?e.measuredBox[i]:e.layoutBox[i],r=Ko(n[i]);s.max=s.min+r,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[i].max=t.relativeTarget[i].min+r)});const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};Go(r,n,e.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?Go(a,t.applyTransform(i,!0),e.measuredBox):Go(a,n,e.layoutBox);const l=!cr(r);let c=!1;if(!t.resumeFrom){const i=t.getClosestProjectingParent();if(i&&!i.resumeFrom){const{snapshot:s,layout:o}=i;if(s&&o){const r=t.options.layoutAnchor||void 0,a={x:{min:0,max:0},y:{min:0,max:0}};Zo(a,e.layoutBox,s.layoutBox,r);const l={x:{min:0,max:0},y:{min:0,max:0}};Zo(l,n,o.layoutBox,r),pr(a,l)||(c=!0),i.options.layoutRoot&&(t.relativeTarget=l,t.relativeTargetOrigin=a,t.relativeParent=i)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function jr(t){Eo.value&&Er.nodes++,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 Or(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Ir(t){t.clearSnapshot()}function Fr(t){t.clearMeasurements()}function Wr(t){t.isLayoutDirty=!0,t.updateLayout()}function Nr(t){t.isLayoutDirty=!1}function Ur(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.dragSnapshot||t.layout,t.isLayoutDirty=!0)}function $r(t){t.relativeTarget&&t.relativeParent?.isLayoutDirty&&(t.currentAnimation?t.isLayoutDirty=!0:(t.targetDelta=void 0,t.removeRelativeTarget()))}function zr(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Kr(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Yr(t){t.resolveTargetDelta()}function Xr(t){t.calcProjection()}function Gr(t){t.resetSkewAndRotation()}function Hr(t,e,n){t.translate=Vt(e.translate,0,n),t.scale=Vt(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function _r(t,e,n,i){t.min=Vt(e.min,n.min,i),t.max=Vt(e.max,n.max,i)}function qr(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const Zr={duration:.45,ease:[.4,0,.1,1]},Jr=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Qr=Jr("applewebkit/")&&!Jr("chrome/")?Math.round:u;function ta(t){t.min=Qr(t.min),t.max=Qr(t.max)}function ea(t,e,n){return"position"===t||"preserve-aspect"===t&&!Yo(mr(e),mr(n),.2)}function na(t){return t!==t.root&&t.scroll?.wasRoot}function ia(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n,i)}const sa=Lr({attachResizeListener:(t,e)=>ia(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),oa={current:void 0},ra=Lr({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!oa.current){const t=new sa({});t.mount(window),t.setOptions({layoutScroll:!0}),oa.current=t}return oa.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),aa=new WeakMap;function la(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function ca(t){return"string"==typeof t||Array.isArray(t)}const ua=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ha=["initial",...ua];function da(t){if(la(t.animate))return!0;for(let e=0;e<ha.length;e++)if(ca(t[ha[e]]))return!0;return!1}function pa(t){return Boolean(da(t)||t.variants)}function ma(t,e,n){for(const i in e){const s=e[i],o=n[i];if(zi(s))t.addValue(i,s);else if(zi(o))t.addValue(i,xi(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,xi(void 0!==e?e:s,{owner:t}))}}for(const i in n)void 0===e[i]&&t.removeValue(i);return e}const fa={current:null},ga={current:!1},ya="undefined"!=typeof window;function va(){if(ga.current=!0,ya)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>fa.current=t.matches;t.addEventListener("change",e),e()}else fa.current=!1}const xa=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let wa={};class Ta{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=An,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=$.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,Kt.render(this.render,!1,!0))};const{latestValues:l,renderState:c}=r;this.latestValues=l,this.baseTarget={...l},this.initialValues=e.initial?{...l}:{},this.renderState=c,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=da(e),this.isVariantNode=pa(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:u,...h}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in h){const e=h[t];void 0!==l[t]&&zi(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,aa.set(t,this),this.projection&&!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:(ga.current||va(),this.shouldReduceMotion=fa.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),Yt(this.notifyUpdate),Yt(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),e.accelerate&&Yn.has(t)&&this.current instanceof HTMLElement){const{factory:n,keyframes:i,times:s,ease:o,duration:r}=e.accelerate,a=new Fn({element:this.current,name:t,keyframes:i,times:s,ease:o,duration:m(r)}),l=n(a);return void this.valueSubscriptions.set(t,()=>{l(),a.cancel()})}const n=un.has(t);n&&this.onBindTransform&&this.onBindTransform();const i=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&Kt.preRender(this.notifyUpdate),n&&(this.projection&&(this.projection.isTransformDirty=!0),ti.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&&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 wa){const e=wa[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)&&ti.get(this.current)?.demote(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<xa.length;e++){const n=xa[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const i=t["on"+n];i&&(this.propEventSubscriptions[n]=this.on(n,i))}this.prevMotionValues=ma(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}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);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=xi(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&&(r(n)||l(n))?n=parseFloat(n):"number"!=typeof n&&!At.test(n)&&At.test(e)&&(n=_e(t,e)),this.setBaseTarget(t,zi(n)?n.get():n)),zi(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}on(t,e){return this.events[t]||(this.events[t]=new p),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){bo.render(this.render)}}class ba extends Ta{constructor(){super(...arguments),this.KeyframeResolver=rs}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;zi(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}function Sa(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 Aa(t,{layout:e,layoutId:n}){return un.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!Po[t]||"opacity"===t)}function Pa(t,e,n){const i=t.style,s=e?.style,o={};if(!i)return o;for(const e in i)(zi(i[e])||s&&zi(s[e])||Aa(e,t)||void 0!==n?.getValue(e)?.liveStyle)&&(o[e]=i[e]);return o}class Ea extends ba{constructor(){super(...arguments),this.type="html",this.renderInstance=Sa}mount(t){Boolean(t.style),super.mount(t)}readValueFromInstance(t,e){if(un.has(e))return this.projection?.isProjecting?on(e):an(t,e);{const i=(n=t,window.getComputedStyle(n)),s=(Y(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return po(t,e)}build(t,e,n){Bs(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return Pa(t,e,n)}}const Ma="[data-layout],[data-layout-id]",Va=new WeakMap;let ka;function Da(t){const e=[];return t instanceof HTMLElement&&t.matches(Ma)&&e.push(t),t.querySelectorAll(Ma).forEach(t=>{t instanceof HTMLElement&&e.push(t)}),e}function Ca(t,e){const n=t.getAttribute("data-layout");return{layoutId:t.getAttribute("data-layout-id")??void 0,layout:null!==n||void 0,animationType:n&&"true"!==n?n:"both",transition:e}}function La(t,e){let n=Va.get(t);if(n)n.setOptions(Ca(t,e));else{let i=aa.get(t);i||(i=new Ea({props:{},presenceContext:null,visualState:{latestValues:{},renderState:{transform:{},transformOrigin:{},style:{},vars:{}}}},{allowProjection:!0}),wo(t,i)),t.style.transform&&!Js(i.latestValues)&&(t.style.transform=""),n=new ra(i.latestValues,function(t){let e=t.parentElement;for(;e;){const t=Va.get(e);if(t&&t.instance)return t;e=e.parentElement}}(t)),i.projection=n,n.setOptions({...Ca(t,e),visualElement:i}),n.mount(t),Va.set(t,n)}return n.isPresent=!0,n.options.onExitComplete&&n.setOptions({onExitComplete:void 0}),n}function Ra(t,e){e.setOptions({onExitComplete:void 0});e.getStack()&&!e.isLead()||e.currentAnimation?.stop(),e.unmount(),Va.delete(t)}function Ba(){const t=ka;ka=void 0,function(){if(W.isProcessing)return;const t=$.now();W.delta=i(0,1e3/60,t-W.timestamp),W.timestamp=t,W.isProcessing=!0,Xt.update.process(W),Xt.preRender.process(W),Xt.render.process(W),W.isProcessing=!1}();const e=new Map;for(const n of t)for(const t of n.collectTargets()){const i=e.get(t);i?i.push(n):e.set(t,[n])}const n=new Map;for(const t of(s=e.keys(),[...s].sort((t,e)=>t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1))){const i=e.get(t),s=La(t,i[i.length-1].transitionFor(t));for(const e of i)e.adopt(t,s);n.set(t,s)}var s;n.forEach(t=>{t.isLayoutDirty=!1,t.willUpdate()});const o=[];for(const e of t){const t=e.runUpdate();t&&o.push(t)}const r=()=>{const e=new Set;for(const n of t)n.reconcileAdditions(e);for(const n of t)n.reconcileRemovals(e);let i;n.forEach(t=>i||(i=t.root));for(const e of t)i||(i=e.getRoot());i?.didUpdate(),bo.render(()=>{for(const e of t)e.finalize()})};o.length?Promise.all(o).then(r):r()}class ja{constructor(t,e,n){this.scope=t,this.updateDom=e,this.defaultOptions=n,this.sharedTransitions=new Map,this.notifyReady=()=>{},this.rejectReady=()=>{},this.tracked=new Map,this.restorePoints=new Map,this.readyPromise=new Promise((t,e)=>{this.notifyReady=t,this.rejectReady=e}),ka||(ka=[],queueMicrotask(Ba)),ka.push(this)}shared(t,e){return this.sharedTransitions.set(t,e),this}then(t,e){return this.readyPromise.then(t,e)}transitionFor(t){const e=t.getAttribute("data-layout-id");return e&&this.sharedTransitions.get(e)||this.defaultOptions}adopt(t,e){this.tracked.set(t,e),this.restorePoints.set(t,{parent:t.parentElement,next:t.nextSibling})}collectTargets(){return Da(this.scope)}runUpdate(){try{const t=this.updateDom();if(t&&"function"==typeof t.then)return t.then(void 0,t=>{this.updateError=t})}catch(t){this.updateError=t}}reconcileAdditions(t){for(const e of Da(this.scope)){if(this.tracked.has(e))continue;const n=La(e,this.transitionFor(e));this.adopt(e,n),n.options.layoutId&&t.add(n.options.layoutId)}}reconcileRemovals(t){this.tracked.forEach((e,n)=>{if(n.isConnected)return;const i=this.restorePoints.get(n);this.restorePoints.delete(n);const{layoutId:s}=e.options,o=e.getStack(),r=o&&o.members.some(t=>t!==e&&t.instance?.isConnected);if(s&&e.isLead()&&r&&!t.has(s)&&i&&i.parent.isConnected){if(i.parent.insertBefore(n,i.next&&i.next.parentNode===i.parent?i.next:null),e.isPresent=!1,e.setOptions({onExitComplete:()=>{n.remove(),Ra(n,e)}}),e.relegate())return;n.remove()}Ra(n,e),this.tracked.delete(n)})}getRoot(){let t;return this.tracked.forEach(e=>t||(t=e.root)),t}finalize(){if(this.updateError)return void this.rejectReady(this.updateError);const t=new Set;this.tracked.forEach(e=>{e.instance&&e.currentAnimation&&t.add(e.currentAnimation)}),this.notifyReady(new ci([...t]))}}function Oa(t,e,n){if("function"==typeof t)return{scope:xs.current?.root||document,updateDom:t,defaultOptions:e};return{scope:t instanceof Document?t:Ss(t)[0]??document,updateDom:e,defaultOptions:n}}const Ia=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary;function Fa(t){return{point:{x:t.pageX,y:t.pageY}}}const Wa=t=>e=>Ia(e)&&t(e,Fa(e));function Na(t,e,n,i){return ia(t,e,Wa(n),i)}const Ua=new WeakMap;let $a;const za=(t,e,n)=>(i,s)=>s&&s[0]?s[0][t+"Size"]:vs(i)&&"getBBox"in i?i.getBBox()[e]:i[n],Ka=za("inline","width","offsetWidth"),Ya=za("block","height","offsetHeight");function Xa({target:t,borderBoxSize:e}){Ua.get(t)?.forEach(n=>{n(t,{get width(){return Ka(t,e)},get height(){return Ya(t,e)}})})}function Ga(t){t.forEach(Xa)}function Ha(t,e){$a||"undefined"!=typeof ResizeObserver&&($a=new ResizeObserver(Ga));const n=Ss(t);return n.forEach(t=>{let n=Ua.get(t);n||(n=new Set,Ua.set(t,n)),n.add(e),$a?.observe(t)}),()=>{n.forEach(t=>{const n=Ua.get(t);n?.delete(e),n?.size||$a?.unobserve(t)})}}const _a=new Set;let qa;function Za(t){return _a.add(t),qa||(qa=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};_a.forEach(e=>e(t))},window.addEventListener("resize",qa)),()=>{_a.delete(t),_a.size||"function"!=typeof qa||(window.removeEventListener("resize",qa),qa=void 0)}}function Ja(t,e){return ws("function"==typeof t?Za(t):Ha(t,e))}const Qa=(t,e)=>Math.abs(t-e);function tl(t,e){const n=Qa(t.x,e.x),i=Qa(t.y,e.y);return Math.sqrt(n**2+i**2)}const el=new Set(["auto","scroll"]);class nl{constructor(t,e,{transformPagePoint:n,contextWindow:i=window,dragSnapToOrigin:s=!1,distanceThreshold:o=3,element:r}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=t=>{this.handleScroll(t.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;this.hasPendingMove=!1,this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=il(this.lastRawMoveEventInfo,this.transformPagePoint));const t=ol(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=tl(t.offset,{x:0,y:0})>=this.distanceThreshold;if(!e&&!n)return;const{point:i}=t;this.history.push({...i,timestamp:$.now()});const{onStart:s,onMove:o}=this.handlers;e||(s&&s(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.handleScroll(window),this.lastMoveEvent=t,this.lastRawMoveEventInfo=e,this.lastMoveEventInfo=il(e,this.transformPagePoint),this.hasPendingMove=!0,Kt.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&&s(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const o=ol("pointercancel"===t.type?this.lastMoveEventInfo:il(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,o),i&&i(t,o)},!Ia(t))return;this.dragSnapToOrigin=s,this.handlers=e,this.transformPagePoint=n,this.distanceThreshold=o,this.contextWindow=i||window;const a=il(Fa(t),this.transformPagePoint),{point:l}=a,{timestamp:c}=W;this.history=[{...l,timestamp:c}];const{onSessionStart:u}=e;u&&u(t,ol(a,this.history));const d={passive:!0,capture:!0};this.removeListeners=h(Na(this.contextWindow,"pointermove",this.handlePointerMove,d),Na(this.contextWindow,"pointerup",this.handlePointerUp,d),Na(this.contextWindow,"pointercancel",this.handlePointerUp,d)),r&&this.startScrollTracking(r)}startScrollTracking(t){let e=t.parentElement;for(;e;){const t=getComputedStyle(e);(el.has(t.overflowX)||el.has(t.overflowY))&&this.scrollPositions.set(e,{x:e.scrollLeft,y:e.scrollTop}),e=e.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const e=this.scrollPositions.get(t);if(!e)return;const n=t===window,i=n?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},s=i.x-e.x,o=i.y-e.y;0===s&&0===o||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s,this.lastMoveEventInfo.point.y+=o):this.history.length>0&&(this.history[0].x-=s,this.history[0].y-=o),this.scrollPositions.set(t,i),Kt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Yt(this.updatePoint)}}function il(t,e){return e?{point:e(t.point)}:t}function sl(t,e){return{x:t.x-e.x,y:t.y-e.y}}function ol({point:t},e){return{point:t,delta:sl(t,al(e)),offset:sl(t,rl(e)),velocity:ll(e,.1)}}function rl(t){return t[0]}function al(t){return t[t.length-1]}function ll(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const s=al(t);for(;n>=0&&(i=t[n],!(s.timestamp-i.timestamp>m(e)));)n--;if(!i)return{x:0,y:0};i===t[0]&&t.length>2&&s.timestamp-i.timestamp>2*m(e)&&(i=t[1]);const o=f(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 cl=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function ul(t){return cl.has(t.tagName)||!0===t.isContentEditable}const hl=new Set(["INPUT","SELECT","TEXTAREA"]);function dl(t){return hl.has(t.tagName)||!0===t.isContentEditable}const pl={x:!1,y:!1};function ml(){return pl.x||pl.y}function fl(t){return"x"===t||"y"===t?pl[t]?null:(pl[t]=!0,()=>{pl[t]=!1}):pl.x||pl.y?null:(pl.x=pl.y=!0,()=>{pl.x=pl.y=!1})}function gl(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 yl(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 vl=.35;function xl(t,e,n){return{min:wl(t,e),max:wl(t,n)}}function wl(t,e){return"number"==typeof t?t:t[e]||0}const Tl=new WeakMap;class bl{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}={}){const{presenceContext:i}=this.visualElement;if(i&&!1===i.isPresent)return;const{dragSnapToOrigin:s}=this.getProps();this.panSession=new nl(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(),this.openDragLock=fl(n),!this.openDragLock))return;this.latestPointerEvent=t,this.latestPanInfo=e,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),br(t=>{let e=this.getAxisMotionValue(t).get()||0;if(G(e)&&(e=Bi(e,this.visualElement.current)||0),ct.test(e))e=parseFloat(e);else if(lt.test(e)){const{projection:n}=this.visualElement;if(n&&n.layout){const i=n.layout.layoutBox[t];if(i){e=Ko(i)*(parseFloat(e)/100)}}}this.originPoint[t]=e}),s&&Kt.update(()=>s(t,e),!1,!0),Yi(this.visualElement,"transform");const{animationState:o}=this.visualElement;o&&o.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",e.point,r),this.updateAxis("y",e.point,r),this.visualElement.render(),o&&Kt.update(()=>o(t,e),!1,!0)},onSessionEnd:(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e,this.stop(t,e),this.latestPointerEvent=null,this.latestPanInfo=null},resumeAnimation:()=>{const{dragSnapToOrigin:t}=this.getProps();(t||this.constraints)&&this.startAnimation({x:0,y:0})}},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:s,distanceThreshold:n,contextWindow:this.visualElement.current?.ownerDocument.defaultView,element:this.visualElement.current})}stop(t,e){const n=t||this.latestPointerEvent,i=e||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!i||!n)return;const{velocity:o}=i;this.startAnimation(o);const{onDragEnd:r}=this.getProps();r&&Kt.postRender(()=>r(n,i))}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),e&&e.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,e,n){const{drag:i}=this.getProps();if(!n||!El(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(o=function(t,{min:e,max:n},i){return void 0!==e&&t<e?t=i?Vt(e,t,i.min):Math.max(t,e):void 0!==n&&t>n&&(t=i?Vt(n,t,i.max):Math.min(t,n)),t}(o,this.constraints[t],this.elastic[t])),s.set(o)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;Sl(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:i,right:s}){return{x:gl(t.x,n,s),y:gl(t.y,e,i)}}(n.layoutBox,t),this.elastic=function(t=vl){return!1===t?t=0:!0===t&&(t=vl),{x:xl(t,"left","right"),y:xl(t,"top","bottom")}}(e),i!==this.constraints&&!Sl(t)&&n&&this.constraints&&!this.hasMutatedConstraints&&br(t=>{!1!==this.constraints&&this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(n.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!Sl(t))return!1;const n=Al(t),{projection:i}=this.visualElement;if(!i||!i.layout)return!1;i.root&&(i.root.scroll=void 0,i.root.updateScroll());const s=mo(n,i.root,this.visualElement.getTransformPagePoint());let o=function(t,e){return{x:yl(t.x,e.x),y:yl(t.y,e.y)}}(i.layout.layoutBox,s);if(e){const t=e(Hs(o));this.hasMutatedConstraints=!!t,t&&(o=Gs(t))}return o}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},l=br(r=>{if(!El(r,e,this.currentDirection))return;let l=a&&a[r]||{};!0!==o&&o!==r||(l={min:0,max:0});const c=i?200:1e6,u=i?40:1e7,h={type:"inertia",velocity:n?t[r]:0,bounceStiffness:c,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...s,...l};return this.startAxisValueAnimation(r,h)});return Promise.all(l).then(r)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return Yi(this.visualElement,t),n.start(Vi(t,n,0,e,this.visualElement,!1))}stopAnimation(){br(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();br(t=>{if(!El(t,n,this.currentDirection))return;const e=this.getAxisMotionValue(t),{min:i,max:r}=o[t];e.set((e.get()||0)+s[t]-Vt(i,r,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:n}=this.visualElement;if(!Sl(e)||!n||!this.constraints)return;this.stopAnimation();const s=this.constraints,o={x:0,y:0};br(t=>{const e=this.getAxisMotionValue(t).get();o[t]=function(t,e){let n=.5;const s=Ko(t),o=Ko(e);return o>s?n=d(e.min,e.max-s,t.min):s>o&&(n=d(t.min,t.max-o,e.min)),i(0,1,n)}({min:e,max:e},s[t])});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),br(e=>{const n=this.getAxisMotionValue(e);if(!El(e,t,null)||!n.get())return;const{min:i,max:s}=this.constraints[e];n.set(Vt(i,s,o[e]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Tl.set(this.visualElement,this);const t=this.visualElement.current,e=Na(t,"pointerdown",e=>{const{drag:n,dragListener:i=!0}=this.getProps(),s=e.target,o=s!==t&&dl(s);n&&i&&!o&&this.start(e)});let n;const i=()=>{const{dragConstraints:e}=this.getProps(),i=Sl(e)&&Al(e);i&&(this.constraints=this.resolveRefConstraints(),n||(n=function(t,e,n){const i=Ja(t,Pl(n)),s=Ja(e,Pl(n));return()=>{i(),s()}}(t,i,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,o=s.addEventListener("measure",i);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),Kt.read(i);const r=ia(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(br(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.render())});return()=>{r(),e(),o(),a&&a(),n&&n()}}getProps(){const t=this.readProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=vl,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:r}}}function Sl(t){return!!t&&"object"==typeof t&&("current"in t||"nodeType"in t)}const Al=t=>"current"in t?t.current:t;function Pl(t){let e=!0;return()=>{e?e=!1:t()}}function El(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const Ml=["user-select","-webkit-user-select","-webkit-touch-callout","touch-action"];function Vl(t,e){const n=Ss(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},ws(()=>i.abort())]}const kl=(t,e)=>!!e&&(t===e||kl(t,e.parentElement)),Dl=new WeakSet;function Cl(t){return e=>{"Enter"===e.key&&t(e)}}function Ll(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function Rl(t){return Ia(t)&&!ml()}const Bl=new WeakSet;function jl(t,e){const n=window.getComputedStyle(t);return Pn(e)?n.getPropertyValue(e):n[e]}const Ol={reducedMotion:"(prefers-reduced-motion: reduce)",motion:"(prefers-reduced-motion: no-preference)",dark:"(prefers-color-scheme: dark)",light:"(prefers-color-scheme: light)",hover:"(hover: hover) and (pointer: fine)",touch:"(pointer: coarse)",portrait:"(orientation: portrait)",landscape:"(orientation: landscape)"};function Il(t){return t.includes("(")?t:t.replace(/([<>!]=?)\s+/g,"$1").trim().split(/\s+/).map(t=>{const e="!"===t[0];e&&(t=t.slice(1));const n=/^([<>]=?)([\d.]+)([a-z]*)$/.exec(t),i=n?`(width ${n[1]} ${n[2]}${n[3]||"px"})`:Ol[t]||t;return e?`(not (${i}))`:i}).join(" and ")}function Fl(...t){const e=!Array.isArray(t[0]),n=e?0:-1,i=t[0+n],s=we(t[1+n],t[2+n],t[3+n]);return e?s(i):s}const Wl=new Set,Nl=({timestamp:t})=>{Wl.forEach(e=>e.tick(t))};class Ul extends Be{constructor(t){super(),this.state="idle",this.startTime=0,this.currentTime=0,this.started=!1,this.hasNextTarget=!1,this.nextTarget=0,this.stop=()=>{"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.factory=t.type,this.generator=this.factory(t);const{driver:e}=t;e&&(this.driver=e(t=>this.tick(t))),this.startTime=this.now(),this.state="running",this.driver?this.driver.start():(Wl.size||Kt.update(Nl,!0),Wl.add(this))}setTarget(t,e){this.nextTarget=t,this.nextVelocity=e,this.hasNextTarget=!0}retarget(t,e){const{options:n,generator:i}=this;n.keyframes=t,n.velocity=e,this.startTime=this.now(),this.currentTime=0,i.retarget?i.retarget(t,e):this.generator=this.factory(n)}tick(t){const{options:e,hasNextTarget:n}=this,{delay:i=0,onUpdate:s,onPlay:o}=e;this.started||(this.startTime=Ce(this.startTime,t));const r=Math.round(t-this.startTime)-i,a=this.currentTime=Math.max(0,r),l=this.generator.next(a),c=r<0?e.keyframes[0]:l.value;if(n){this.hasNextTarget=!1;const{keyframes:t}=e;t[0]=c,t[1]=this.nextTarget,this.retarget(t,this.nextVelocity??this.getGeneratorVelocity())}!n&&this.started||(this.started=!0,o?.()),"running"===this.state&&(s?.(c),l.done&&r>=0&&!n&&!this.hasNextTarget&&"running"===this.state&&(this.notifyFinished(),this.teardown(),this.state="finished",e.onComplete?.()))}getGeneratorVelocity(){return Ee(this.generator,this.currentTime,this.options.velocity)}now(){return this.driver?this.driver.now():$.now()}teardown(){this.state="idle",this.driver?this.driver.stop():(Wl.delete(this),Wl.size||Yt(Nl))}}function $l(t,e,n){const i=t.get();let s,o=null;const r="string"==typeof i?i.replace(/[\d.-]/g,""):void 0,a=t=>s(r?t+r:t),l=()=>t.events.animationStart?.notify(),c=()=>{o&&(o.stop(),o=null),t.animation=void 0};if(t.attach((e,i)=>{s=i;const r=Co(e);if("running"===o?.state)return void o.setTarget(r,n.velocity);const u=Co(t.get()),h=o?o.getGeneratorVelocity():t.getVelocity();if(c(),u===r)return;const d={keyframes:[u,r],velocity:h,restDelta:.001,restSpeed:.01,...n,onUpdate:a},p=o=new Ul({...d,onPlay:l});t.animation=p,p.then(()=>{o===p&&(o=null,t.animation=void 0,t.events.animationComplete?.notify())})},c),zi(e)){let i=!0===n.skipInitialAnimation;const s=e=>{i?(i=!1,t.jump(zl(e,r),!1)):t.set(zl(e,r))},o=e.on("change",s),a=e.get();Co(a)-Co(t.get())&&s(a);const l=t.on("destroy",o);return()=>{o(),l(),c()}}return c}function zl(t,e){return e?t+e:t}function Kl(t,e,n={}){const i={type:"spring",...n};return De(i),i.type=i.type||Pe,$l(t,e,i)}function Yl(t){const e=[];yi.current=e;const n=t();yi.current=void 0;const i=xi(n);return function(t,e,n){const i=()=>e.set(n()),s=()=>Kt.preRender(i,!1,!0),o=t.map(t=>t.on("change",s));e.on("destroy",()=>{o.forEach(t=>t()),Yt(i)})}(e,i,t),i}function Xl(t,e,n){return $l(t,e,{...n,type:ve})}const Gl=[...ns,mt,At];let Hl=0;const _l=()=>"motion-view-"+Hl++;function ql(t,e,n){e&&(t.style?.setProperty("view-transition-class",e),n.push(t))}function Zl(t,e,n,i,s){if(n&&(t.style?.setProperty("view-transition-group",n),i.push(t),"none"!==n&&s)){const n=getComputedStyle(t);"visible"===n.overflowX&&"visible"===n.overflowY||s.add(e)}}function Jl(t,e,n,i,s,o=[],r,a=[],l){const c=Ss(t);if(i)return c.map((t,c)=>{const u=e.get(t);if(u)return u;const h=i[c]??_l();return t.style?.setProperty("view-transition-name",h),n.push(t),e.set(t,h),ql(t,s,o),Zl(t,h,r,a,l),h});const u=c.map(t=>e.has(t)?void 0:getComputedStyle(t).getPropertyValue("view-transition-name"));return c.map((t,i)=>{const c=e.get(t);if(c)return c;const h=u[i];let d;return h&&"none"!==h&&"auto"!==h&&"match-element"!==h&&!(t=>t.startsWith("motion-view-"))(h)?d=h:(d=_l(),t.style?.setProperty("view-transition-name",d),n.push(t)),e.set(t,d),ql(t,s,o),Zl(t,d,r,a,l),d})}function Ql(t){return"layout"===t?"group":"enter"===t||"new"===t?"new":"old"}let tc={},ec=null;const nc=(t,e)=>{tc[t]=e},ic=()=>{ec||(ec=document.createElement("style"),ec.id="motion-view");let t="";for(const e in tc){const n=tc[e];t+=`${e} {\n`;for(const[e,i]of Object.entries(n))t+=` ${e}: ${i};\n`;t+="}\n"}ec.textContent=t,document.head.appendChild(ec),tc={}},sc=()=>{ec&&ec.parentElement&&ec.parentElement.removeChild(ec)};function oc(t){const e=t.match(/::view-transition-(old|new|group-children|group|image-pair)\((.*?)\)/);return e?{layer:e[2],type:e[1]}:null}function rc(){return document.getAnimations().filter(t=>{const{effect:e}=t;return!!e&&e.target===document.documentElement&&e.pseudoElement?.startsWith("::view-transition")})}const ac=["layout","enter","exit","new","old"],lc=t=>t.split(" ").every(t=>0===parseFloat(t)),cc={group:["layout"],new:["new","enter"],old:["old","exit"]},uc={new:{opacity:0,scale:.85},old:{opacity:1,scale:1}};function hc(t){const{update:e,targets:n,resolveDefs:i,cropOverride:s,pairs:o,classNames:r,flatGroups:a,options:l}=t;if(!document.startViewTransition)return(async()=>(await e(),new ci([])))();const c=new Map,u=[],h=[],d=[],p=new Set,f=new Map,g=new Set,y=new Map,x=new Map,w=new Map,T=new Map,b=t=>{n.forEach((e,n)=>{const l=r.get(n),m="root"!==n&&i.has(n)?a.has(n)?"none":"contain":void 0;let g;if("root"!==n&&i.has(n))if(o.has(n))if("old"===t)T.set(n,Ss(n)),g=Jl(n,c,u,void 0,l,h,m,d,p),w.set(n,g);else{for(const t of T.get(n)??[])t.style?.removeProperty("view-transition-name"),c.delete(t);g=Jl(o.get(n),c,u,w.get(n),l,h,m,d,p)}else g=Jl(n,c,u,void 0,l,h,m,d,p);else g=[n];const v=s.get(n);g.forEach((n,i)=>{const s=f.get(n);f.set(n,s&&s!==e?{...s,...e}:e),void 0!==v&&y.set(n,v);const o=x.get(n)??{};o[t]=[i,g.length],x.set(n,o)})})},S=(t,e)=>{const n=x.get(t);return("old"===e?n?.old:"new"===e?n?.new:n?.new??n?.old)??[-1,1]},A=(t,e,n,i,s)=>{const o=dc(Ti(l,n),Ti(function(t,e){for(const n of cc[e]??[]){const e=t?.[n]?.options;if(e)return e}}(t,e)??{},n));return"function"==typeof o.delay&&(o.delay=o.delay(i,s)),o},P=t=>{const[e,n]=S(t,"group"),i=A(f.get(t),"group","layout",-1===e?0:e,n);i.duration&&(i.duration=m(i.duration));const{delay:s=0,duration:o,ease:r}=In(i);return{delay:m(s),duration:o,ease:r}},E=new Map,M=t=>c.forEach((e,n)=>{const i=n,s=i.getBoundingClientRect?.();if(s&&s.height){const n=getComputedStyle(i),o={};for(const t of as)o[t]=n[t];const r=E.get(e)??{};r[t]={width:s.width,height:s.height,radii:o},E.set(e,r)}}),V=t=>{const e=E.get(t);return!!(e?.old&&e?.new&&e.old.height&&e.new.height)&&Math.abs(e.old.width/e.old.height-e.new.width/e.new.height)>.2},k=()=>{(function(t,e){return e.has(t)&&Object.keys(e.get(t)).length>0})("root",n)||nc(":root",{"view-transition-name":"none"}),nc("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)",{"animation-timing-function":"linear !important"}),g.forEach(t=>{nc(`::view-transition-group(${t})`,{overflow:"clip"}),nc(`::view-transition-old(${t}), ::view-transition-new(${t})`,{width:"100%",height:"100%","object-fit":"cover"})}),p.forEach(t=>{nc(`::view-transition-group-children(${t})`,{overflow:"clip"})}),ic()},D=()=>{!function(t,e=[],n=[]){for(const e of t)e.style?.removeProperty("view-transition-name");for(const t of e)t.style?.removeProperty("view-transition-class");for(const t of n)t.style?.removeProperty("view-transition-group")}(u,h,d),sc()},C=async()=>{await e(),b("new"),M("new"),(()=>{g.clear();for(const t of x.keys())"root"!==t&&(y.get(t)??V(t))&&g.add(t)})(),k()};let L;try{b("old"),M("old"),k(),L=document.startViewTransition(C)}catch(t){return D(),Promise.reject(t)}return L.finished.finally(D),new Promise((t,e)=>{L.ready.then(()=>{const e=rc(),n=[],i=new Set,s=new Set;f.forEach((t,e)=>{const o=x.get(e),r=!!o?.new&&!o?.old,a=!!o?.old&&!o?.new;for(const o of ac){if(!t[o])continue;if("enter"===o&&!r)continue;if("exit"===o&&!a)continue;const c=Ql(o),[u,h]=S(e,c);if(-1===u)continue;const{keyframes:d,options:p}=t[o];for(let[f,g]of Object.entries(d)){if(null==g)continue;if("x"===f||"y"===f){v(!1,`animateView() animates view-transition layers with CSS properties; the "${f}" shorthand has no effect - use transform, e.g. { transform: "translateX(40px)" }.`);continue}if("new"===o&&r&&null!=t.enter?.keyframes[f])continue;if("old"===o&&a&&null!=t.exit?.keyframes[f])continue;const d=dc(Ti(l,f),Ti(p,f));if(!Array.isArray(g)){const e="enter"===o?t.exit?.keyframes[f]:void 0,n="opacity"===f||("new"===c?r:a),i=null!=e?Array.isArray(e)?e[e.length-1]:e:n?uc[c]?.[f]:void 0;void 0!==i&&(g=[i,g])}"function"==typeof d.delay&&(d.delay=d.delay(u,h)),d.duration&&(d.duration=m(d.duration)),d.delay&&(d.delay=m(d.delay)),n.push(new Fn({...d,element:document.documentElement,name:f,pseudoElement:`::view-transition-${c}(${e})`,keyframes:g})),i.add(`${e}:${c}`),"opacity"===f&&s.add(`${e}:${c}`)}}});for(const t of e){if("finished"===t.playState)continue;const{effect:e}=t;if(!(e&&e instanceof KeyframeEffect))continue;const{pseudoElement:o}=e;if(!o)continue;const r=oc(o);if(!r)continue;const a=f.get(r.layer);if(i.has(`${r.layer}:${r.type}`)){s.has(`${r.layer}:new`)&&s.has(`${r.layer}:old`)&&e.getKeyframes().some(t=>t.mixBlendMode)?n.push(new di(t)):t.cancel();continue}const l="old"===r.type?"new":"new"===r.type?"old":void 0;if(l&&i.has(`${r.layer}:${l}`)&&!s.has(`${r.layer}:${l}`)){t.cancel();continue}const c=x.get(r.layer),u=!("old"!==r.type&&"new"!==r.type||!c?.old||!c?.new);let h;if(r.type.startsWith("group")){const{delay:t,duration:e,ease:n}=P(r.layer);h={delay:t,duration:e,easing:Bn(n,e)}}else{const t=u?"group":r.type,[e,n]=S(r.layer,t);let i=A(a,t,"group"===t?"layout":"",-1===e?0:e,n);const s=i.visualDuration;i.duration&&(i.duration=m(i.duration)),i=In(i),h={delay:m(i.delay??0),duration:u&&void 0!==s?m(s):i.duration,easing:u?"linear":Bn(i.ease,i.duration)}}e.updateTiming(h),n.push(new di(t))}E.forEach((t,e)=>{if(!g.has(e))return;const{delay:i,duration:s,ease:o}=P(e);for(const r of as){const a=t.old?.radii[r]||t.new?.radii[r]||"0px",l=t.new?.radii[r]||t.old?.radii[r]||"0px";lc(a)&&lc(l)||n.push(new Fn({element:document.documentElement,name:r,pseudoElement:`::view-transition-group(${e})`,keyframes:[a,l],delay:i,duration:s,ease:o}))}}),t(new ci(n))}).catch(()=>L.updateCallbackDone.then(()=>t(new ci([])),e))})}function dc(t,e){const n={...t,...e};return void 0!==e.duration&&(void 0===e.visualDuration&&delete n.visualDuration,void 0===e.type&&delete n.type),n}let pc=[],mc=null;function fc(){mc=null;const[t]=pc;var e;t&&(n(pc,e=t),mc=e,hc(e).then(t=>(e.notifyReady(t),t.finished)).catch(t=>e.notifyReject(t)).finally(fc))}function gc(){for(let t=pc.length-1;t>=0;t--){const e=pc[t],{interrupt:n}=e.options;if("immediate"===n){const n=pc.slice(0,t+1).map(t=>t.update),i=pc.slice(t+1);e.update=()=>{n.forEach(t=>t())},pc=[e,...i];break}}mc&&"immediate"!==pc[0]?.options.interrupt||fc()}class yc{constructor(t,e={}){var n;this.currentSubject="root",this.targets=new Map,this.resolveDefs=new Set,this.cropOverride=new Map,this.pairs=new Map,this.classNames=new Map,this.flatGroups=new Set,this.notifyReady=u,this.notifyReject=u,this.readyPromise=new Promise((t,e)=>{this.notifyReady=t,this.notifyReject=e}),this.update=t,this.options={interrupt:"wait",...e},this.readyPromise.catch(u),n=this,pc.push(n),bo.render(gc)}add(t,e){return this.currentSubject=t,this.resolveDefs.add(t),void 0!==e&&this.pairs.set(t,e),this.targets.has(t)||this.targets.set(t,{}),this}crop(t=!0){return this.cropOverride.set(this.currentSubject,t),this}group(t=!0){return t?this.flatGroups.delete(this.currentSubject):this.flatGroups.add(this.currentSubject),this}class(t){return this.classNames.set(this.currentSubject,t),this}layout(t={}){return this.updateTarget("layout",{},t),this}enter(t,e){return this.updateTarget("enter",t,e),this}exit(t,e){return this.updateTarget("exit",t,e),this}new(t,e){return this.updateTarget("new",t,e),this}old(t,e){return this.updateTarget("old",t,e),this}updateTarget(t,e,n={}){const{currentSubject:i,targets:s}=this;s.has(i)||s.set(i,{});s.get(i)[t]={keyframes:e,options:n}}then(t,e){return this.readyPromise.then(t,e)}}const vc=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"]),xc=t=>"string"==typeof t&&"svg"===t.toLowerCase();function wc(t,e,n,i){Sa(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(vc.has(n)?n:Xi(n),e.attrs[n])}function Tc(t,e,n){const i=Pa(t,e,n);for(const n in t)if("children"!==n&&(zi(t[n])||zi(e[n]))){i[-1!==cn.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return i}function bc(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 Sc=[...ua].reverse();function Ac(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!bc(e,t)}function Pc(){const t={};for(const e of ua)t[e]={isActive:"animate"===e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}};return t}const Ec=ha.length;const Mc=t=>!t.isLayoutDirty&&t.willUpdate(!1);const Vc=Kt,kc=$t.reduce((t,e)=>(t[e]=t=>Yt(t),t),{});function Dc(t){return"object"==typeof t&&!Array.isArray(t)}function Cc(t,e,n,i){return null==t?[]:"string"==typeof t&&Dc(e)?Ss(t,n,i):t instanceof NodeList?Array.from(t):Array.isArray(t)?t.filter(t=>null!=t):[t]}function Lc(t,e,n){return t*(e+1)+n*e}function Rc(t,e,n,i){return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:e.startsWith("<")?Math.max(0,n+parseFloat(e.slice(1))):i.get(e)??t}function Bc(t,e,i,s,o,r){!function(t,e,i){for(let s=0;s<t.length;s++){const o=t[s];o.at>e&&o.at<i&&(n(t,o),s--)}}(t,o,r);for(let n=0;n<e.length;n++)t.push({value:e[n],at:Vt(o,r,s[n]),easing:j(i,n)})}function jc(t,e,n=0){const i=e+1+e*n;for(let e=0;e<t.length;e++)t[e]=t[e]/i}function Oc(t,e){return t.at===e.at?null===t.value?1:null===e.value?-1:0:t.at-e.at}function Ic(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function Fc(t,e){return e[t]||(e[t]=[]),e[t]}function Wc(t){return Array.isArray(t)?t:[t]}function Nc(t,e){return t&&t[e]?{...t,...t[e]}:{...t}}const Uc=t=>"number"==typeof t,$c=t=>t.every(Uc);function zc(t,e,n,i){const s=[];if(function(t,e){return zi(t)||"number"==typeof t||"string"==typeof t&&!Dc(e)}(t,e))s.push(Ao(t,Dc(e)&&e.default||e,n&&n.default||n));else{if(null==t)return s;const o=Cc(t,e,i),r=o.length;for(let t=0;t<r;t++){const i=o[t],a={...n};"delay"in a&&"function"==typeof a.delay&&(a.delay=a.delay(t,r)),i instanceof Element?s.push(...vo(i,e,a,aa.get(i))):s.push(...gs(ms(i)??To,i,e,a))}}return s}function Kc(t,e,n){const i=[],s=function(t,{defaultTransition:e={},...n}={},i,s){const o=e.duration||.3,r=new Map,a=new Map,l={},c=new Map;let u=0,h=0,p=0;for(let n=0;n<t.length;n++){const r=t[n];if("string"==typeof r){c.set(r,h);continue}if(!Array.isArray(r)){c.set(r.name,Rc(h,r.at,u,c));continue}let[d,f,g={}]=r;void 0!==g.at&&(h=Rc(h,g.at,u,c));let y=0;const v=(t,n,i,r=0,a=0)=>{const l=Wc(t),{delay:c=0,times:u=be(l),type:d=e.type||"keyframes",repeat:f,repeatType:g,repeatDelay:v=0,...x}=n;let{ease:w=e.ease||"easeOut",duration:T}=n;const b="function"==typeof c?c(r,a):c,A=l.length,P=On(d)?d:s?.[d||"keyframes"];if(A<=2&&P){let t=100;if(2===A&&$c(l)){const e=l[1]-l[0];t=Math.abs(e)}const n={...e,...x};void 0!==T&&(n.duration=m(T));const i=Zt(n,t,P);w=i.ease,T=i.duration}T??(T=o);const E=h+b;1===u.length&&0===u[0]&&(u[1]=1);const M=u.length-l.length;if(M>0&&Te(u,M),1===l.length&&l.unshift(null),f&&f<20){const t=T>0?v/T:0;T=Lc(T,f,v);const e=[...l],n=[...u];w=Array.isArray(w)?[...w]:[w];const i=[...w],s="reverse"===g||"mirror"===g;let o=e,r=i;s&&(o=[...e].reverse(),"reverse"===g&&(r=[...i].reverse().map(t=>"function"==typeof t?S(t):t)));for(let a=0;a<f;a++){const c=s&&a%2==0,h=c?o:e,d=c?r:i,p=(a+1)*(1+t);t>0&&(l.push(l[l.length-1]),u.push(p),w.push("linear")),l.push(...h);for(let t=0;t<h.length;t++)u.push(n[t]+p),w.push(0===t?"linear":j(d,t-1))}jc(u,f,t)}const V=E+T;Bc(i,l,w,u,E,V),y=Math.max(b+T,y),p=Math.max(V,p)};if(zi(d))v(f,g,Fc("default",Ic(d,a)));else{const t=Cc(d,f,i,l),e=t.length;for(let n=0;n<e;n++){const i=Ic(t[n],a);for(const t in f)v(f[t],Nc(g,t),Fc(t,i),n,e)}}u=h,h+=y}return a.forEach((t,i)=>{for(const s in t){const o=t[s];o.sort(Oc);const a=[],l=[],c=[];for(let t=0;t<o.length;t++){const{at:e,value:n,easing:i}=o[t];a.push(n),l.push(d(0,p,e)),c.push(i||"easeOut")}0!==l[0]&&(l.unshift(0),a.unshift(a[0]),c.unshift("easeInOut")),1!==l[l.length-1]&&(l.push(1),a.push(null)),r.has(i)||r.set(i,{keyframes:{},transition:{}});const u=r.get(i);u.keyframes[s]=a;const{type:h,...m}=e;u.transition[s]={...m,duration:p,ease:c,times:l,...n}}}),r}(t.map(t=>{if(Array.isArray(t)&&"function"==typeof t[0]){const e=t[0],n=xi(0);return n.on("change",e),1===t.length?[n,[0,1]]:2===t.length?[n,[0,1],t[1]]:[n,t[1],t[2]]}return t}),e,n,{spring:ve});return s.forEach(({keyframes:t,transition:e},n)=>{i.push(...zc(n,t,e))}),i}function Yc(t={}){const{scope:e,reduceMotion:i,skipAnimations:s}=t;return function(t,o,r){let a,l=[];const c=xs.current,u=c?.transition,h={};if(void 0!==i&&(h.reduceMotion=i),void 0!==s&&(h.skipAnimations=s),d=t,Array.isArray(d)&&d.some(Array.isArray)){const{onComplete:n,...i}=o||{};"function"==typeof n&&(a=n),u&&(i.defaultTransition={...u,...i.defaultTransition}),l=Kc(t,{...h,...i},e)}else{const{onComplete:n,...i}=r||{};"function"==typeof n&&(a=n),l=zc(t,o,{...h,...u,...i},e)}var d;const p=new hi(l);return a&&p.finished.then(a),c&&p.finished.then(c.add(()=>p.stop())),e&&(e.animations.push(p),p.finished.then(()=>{n(e.animations,p)})),p}}const Xc=Object.assign(Yc(),{addEffect:ds,removeEffect:ps});const Gc=t=>function(e,n,i){return new hi(function(t,e,n,i){if(null==t)return[];const s=Ss(t,i),o=s.length,r=[];for(let t=0;t<o;t++){const i=s[t],a={...n};"function"==typeof a.delay&&(a.delay=a.delay(t,o));for(const t in e){let n=e[t];Array.isArray(n)||(n=[n]);const s={...Ti(a,t)};s.duration&&(s.duration=m(s.duration)),s.delay&&(s.delay=m(s.delay));const o=fi(i),l=mi(t,s.pseudoElement||""),c=o.get(l);c&&c.stop(),r.push({map:o,key:l,unresolvedKeyframes:n,options:{...s,element:i,name:t,allowFlatten:!a.type&&!a.ease}})}}for(let t=0;t<r.length;t++){const{unresolvedKeyframes:e,options:n}=r[t],{element:i,name:s,pseudoElement:o}=n;o||null!==e[0]||(e[0]=jl(i,s)),qe(e),cs(e,s),!o&&e.length<2&&e.unshift(jl(i,s)),n.keyframes=e}const a=[];for(let t=0;t<r.length;t++){const{map:e,key:n,options:i}=r[t],s=new Fn(i);e.set(n,s),s.finished.finally(()=>e.delete(n)),a.push(s)}return a}(e,n,i,t))},Hc=Gc(),_c={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}},qc=new WeakMap;function Zc(t,e,n,s){const o=n[e],{length:r,position:a}=_c[e],l=o.current,c=n.time,u=t[`scroll${a}`];o.current=function(t,e){const n=t===document.scrollingElement,i=n&&document.body||t;let s=qc.get(i);s||qc.set(i,s=getComputedStyle(i));const{writingMode:o,flexDirection:r}=s,a="x"===e!==/^[vs]/.test(o);return(a?"rtl"===s.direction!=("sideways-lr"===o):o.endsWith("rl"))!==(!n&&s.display.includes("flex")&&(a!==("c"===r[0])?r:s.flexWrap).endsWith("reverse"))}(t,e)?-u||0:u,o.containerLength=t[`client${r}`],o.targetLength=t[`scroll${r}`],o.scrollLength=o.targetLength-o.containerLength,o.offset.length=0,o.offset[0]=0,o.offset[1]=o.scrollLength,o.progress=i(0,1,d(0,o.scrollLength,o.current));const h=s-c;o.velocity=h>50?0:g(o.current-l,h)}const Jc={start:0,center:.5,end:1};function Qc(t,e,n=0){let i=0;if(t in Jc&&(t=Jc[t]),"string"==typeof t){const e=parseFloat(t);t.endsWith("px")?i=e:t.endsWith("%")?t=e/100:t.endsWith("vw")?i=e/100*document.documentElement.clientWidth:t.endsWith("vh")?i=e/100*document.documentElement.clientHeight:t=e}return"number"==typeof t&&(i=e*t),n+i}const tu=[0,0];function eu(t,e,n,i){let s=Array.isArray(t)?t:tu,o=0,r=0;return"number"==typeof t?s=[t,t]:"string"==typeof t&&(s=(t=t.trim()).includes(" ")?t.split(" "):[t,Jc[t]?t:"0"]),o=Qc(s[0],n,i),r=Qc(s[1],e),o-r}const nu={All:[[0,0],[1,1]]};function iu(t,e){const{offset:n=nu.All,axis:s="y"}=e,o=t[s];o.offset.length=0;const r=n.length;for(let t=0;t<r;t++)o.offset[t]=eu(n[t],o.containerLength,o.targetLength,o.targetOffset);o.progress=i(0,1,function(t,e){const n=t.length-1;if(n<1)return 0;const i=t[0]>t[n],s=e=>t[i?n-e:e];if(t[0]===t[1]&&e<s(0))return i?1:0;let o=0;for(;o<n-1&&e>=s(o+1);)o++;const r=(o+d(s(o),s(o+1),e))/n;return i?1-r:r}(o.offset,o.current))}function su(t,e,n,i={}){const{target:s}=i,o=s||i.offset;return{measure:e=>{if(o){n.time=e.time;for(const t in _c){const i=t,{offset:s}=n[i];Object.assign(n[i],e[i]),n[i].offset=s}if(s&&s!==t){const e=function(t,e){const n={x:0,y:0};let i=t;for(;i&&i!==e;)if(ys(i))n.x+=i.offsetLeft,n.y+=i.offsetTop,i=i.offsetParent;else if("svg"===i.tagName){const t=i.getBoundingClientRect();i=i.parentElement;const e=i.getBoundingClientRect();n.x+=t.left-e.left,n.y+=t.top-e.top}else{if(!(i instanceof SVGGraphicsElement))break;{const{x:t,y:e}=i.getBBox();n.x+=t,n.y+=e;let s=null,o=i.parentNode;for(;!s;)"svg"===o.tagName&&(s=o),o=i.parentNode;i=s}}return n}(s,t),i=function(t){return"getBBox"in t&&"svg"!==t.tagName?t.getBBox():{width:t.clientWidth,height:t.clientHeight}}(s);n.x.targetOffset=e.x,n.y.targetOffset=e.y,n.x.targetLength=i.width,n.y.targetLength=i.height}iu(n,i)}},notify:t=>e(o?n:t)}}const ou=new WeakMap,ru=new WeakMap,au=new WeakMap,lu=new WeakMap,cu=t=>t===document.scrollingElement?window:t;function uu(t,{container:e=document.scrollingElement,trackContentSize:n=!1,...i}={}){if(!e)return u;let s=au.get(e);s||(s=new Set,au.set(e,s));const o=su(e,t,{time:0,x:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0},y:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}},i);if(s.add(o),!ou.has(e)){const t={time:0,x:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0},y:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}},n=()=>{!function(t,e,n){for(const i in _c)Zc(t,i,e,n);e.time=n}(e,t,W.timestamp);for(const e of s)e.measure(t);Kt.preUpdate(i)},i=()=>{for(const e of s)e.notify(t)},o=()=>Kt.read(n);ou.set(e,o);const r=cu(e);window.addEventListener("resize",o),e!==document.documentElement&&ru.set(e,Ja(e,o)),r.addEventListener("scroll",o),o()}if(n&&!lu.has(e)){const t=ou.get(e),n={width:e.scrollWidth,height:e.scrollHeight},i=()=>{const i=e.scrollWidth,s=e.scrollHeight;n.width===i&&n.height===s||(t(),n.width=i,n.height=s)},s=Kt.read(i,!0);lu.set(e,s)}const r=ou.get(e);return Kt.read(r,!1,!0),()=>{Yt(r);const t=au.get(e);if(!t)return;if(t.delete(o),t.size)return;au.delete(e);const n=ou.get(e);ou.delete(e),n&&(cu(e).removeEventListener("scroll",n),ru.get(e)?.(),window.removeEventListener("resize",n));const i=lu.get(e);i&&(Yt(i),lu.delete(e))}}const hu=new Map;const du=t=>{if(/v/u.test(t))return[];const e=eu(t,0,0,0);return[eu(t,0,1,0)-e,e-eu(t,1,0,0),e]},pu=([t,e,n])=>!n&&(0===e||1===e)&&`${e?"entry":"exit"}-crossing ${100*t}%`;function mu(t,e){const{target:n,container:i,axis:s}=e,o=n&&function(t=nu.All){if(2!==t.length)return;const[e,n]=t.map(du),i=[pu(e),pu(n)],s=n[0]-e[0],o=e[1]-n[1];return i[0]&&i[1]&&(s||o)?{points:i,a:s,b:o,cover:!e[0]&&1===s&&1===o}:void 0}(e.offset),r=function(t){return"undefined"!=typeof window&&(t?Dn():kn())}(n)&&(n?!!o:!e.offset),a=new Map,l=new Set;let c,u=!1;const h=(t,e)=>{const[n,i]=o.points;e.effect.updateTiming({direction:u?"normal"===t?"reverse":"alternate-reverse":t}),Object.assign(e,{rangeStart:u?i:n,rangeEnd:u?n:i}),e.play()},d=[t.attachTimeline({get timeline(){return r?function({container:t,target:e,axis:n}){let i=hu.get(t);i||(i=new Map,hu.set(t,i));const s=e??"self";let o=i.get(s);return o||(o={},i.set(s,o)),o[n]||(o[n]=e?new ViewTimeline({subject:e,axis:n}):new ScrollTimeline({source:t,axis:n}))}(e):void 0},onAttach:o&&(t=>{const e=t.effect.getTiming().direction;a.set(t,e),h(e,t)}),observe:t=>(t.pause(),l.add(t),c||(c=uu(t=>{l.forEach(e=>{e.time=e.iterationDuration*t[s].progress})},e)),()=>l.delete(t))})];if(r&&o){const{a:t,b:e}=o,r="y"===s?"clientHeight":"clientWidth",l=()=>{u!==(u=t*n[r]+e*i[r]<0)&&a.forEach(h)};l(),t*e<0&&d.push(Ja(l),Ja([n,i],l))}return()=>{d.forEach(t=>t()),c?.()}}const fu={some:0,all:1};t.AsyncMotionValueAnimation=li,t.DOMKeyframesResolver=rs,t.DOMVisualElement=ba,t.DocumentProjectionNode=sa,t.Feature=class{constructor(t){this.isMounted=!1,this.node=t}update(){}},t.FlatTree=Ar,t.GroupAnimation=ci,t.GroupAnimationWithThen=hi,t.HTMLProjectionNode=ra,t.HTMLVisualElement=Ea,t.JSAnimation=Ie,t.KeyframeResolver=An,t.LayoutAnimationBuilder=ja,t.MotionGlobalConfig=o,t.MotionValue=vi,t.MotionValueState=Ps,t.NativeAnimation=Fn,t.NativeAnimationExtended=$n,t.NativeAnimationWrapper=di,t.NodeStack=gr,t.ObjectVisualElement=class extends Ta{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,e){if(function(t,e){return t in e}(e,t)){const n=t[e];if("string"==typeof n||"number"==typeof n)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(t,e){delete e.output[t]}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}build(t,e){Object.assign(t.output,e)}renderInstance(t,{output:e}){Object.assign(t,e)}sortInstanceNodePosition(){return 0}},t.PanSession=nl,t.SVGVisualElement=class extends ba{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ar}getBaseTargetFromProps(t,e){return un.has(e)?super.getBaseTargetFromProps(t,e)??on(e):t[e]}getDefaultValue(t){return un.has(t)?this.latestValues[t]??on(t):void 0}readValueFromInstance(t,e){if(un.has(e)){const t=Ge(e);return t&&t.default||0}if(Fs.includes(e)){const n=getComputedStyle(t)[e];if("string"==typeof n&&n)return n.trim()}return e=vc.has(e)?e:Xi(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return Tc(t,e,n)}build(t,e,n){Ws(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){wc(t,e,0,i)}mount(t){this.isSVGTag=xc(t.tagName),super.mount(t)}},t.SubscriptionManager=p,t.ViewTransitionBuilder=yc,t.VisualElement=Ta,t.VisualElementDragControls=bl,t.acceleratedValues=Yn,t.activeScope=xs,t.addAttrValue=Ns,t.addBuilderToScope=Ts,t.addDomEvent=ia,t.addEffect=ds,t.addPointerEvent=Na,t.addPointerInfo=Wa,t.addSVGValue=$s,t.addScaleCorrector=function(t){for(const e in t)Po[e]=t[e],Y(e)&&(Po[e].isCSSVariable=!0)},t.addStyleValue=Ds,t.addToScope=ws,t.addUniqueItem=e,t.addValueToWillChange=Yi,t.alpha=Z,t.analyseComplexValue=Tt,t.animate=Xc,t.animateEffectSubject=gs,t.animateElement=vo,t.animateLayout=function(t,e,n){const{scope:i,updateDom:s,defaultOptions:o}=Oa(t,e,n),r=new ja(i,s,{...xs.current?.transition,...o});return Ts(r),r},t.animateMini=Hc,t.animateMotionValue=Vi,t.animateSingleValue=Ao,t.animateTarget=Ji,t.animateValue=function(t){return new Ie(t)},t.animateValues=fs,t.animateVariant=Qi,t.animateView=function(t,e={}){const n=new yc(t,e);return Ts(n),n},t.animateVisualElement=ts,t.animationMapKey=mi,t.anticipate=M,t.applyAxisDelta=io,t.applyBoxDelta=so,t.applyGeneratorOptions=In,t.applyPointDelta=no,t.applyPxDefaults=cs,t.applyTreeDeltas=ao,t.arc=function(t={}){const e=function({strength:t=.5,peak:e=.5,direction:n,rotate:i=!1}={}){const s=!0===i?1:"number"==typeof i?i:0;let o;return(i,r)=>{const a=r.x-i.x,l=r.y-i.y;let c;c="cw"===n?-t:"ccw"===n?t:(Math.abs(a)>=Math.abs(l)?a:l)<0?-t:t;let u=Ci(i.x,i.y,r.x,r.y,c,e);if(void 0===n){const t=Math.abs(a)<Math.abs(l),n=i.x+a*e,s=i.y+l*e,h=t?Math.sign(u.x-n):Math.sign(u.y-s);void 0!==o&&0!==h&&h!==o?(c=-c,u=Ci(i.x,i.y,r.x,r.y,c,e)):0!==h&&(o=h)}const h=s?Di(0,i.x,u.x,r.x,i.y,u.y,r.y):0,d=s?Di(1,i.x,u.x,r.x,i.y,u.y,r.y):0,p=s?x(-180,180,d-h):0;return t=>{const e={x:ki(t,i.x,u.x,r.x),y:ki(t,i.y,u.y,r.y)};if(s){const n=Di(t,i.x,u.x,r.x,i.y,u.y,r.y),o=h+p*t;e.rotate=x(-180,180,n-o)*s}return e}}}(t),n={interpolateProjection(t){const n=t.x.translate,i=t.y.translate;if(!(Math.sqrt(n*n+i*i)<20))return e({x:n,y:i},{x:0,y:0})},animateValues(t,n,i,s,o){if(!("x"in n)&&!("y"in n))return;const r=t("x"),a=t("y"),l=n.x,c=n.y,u=(Array.isArray(l)&&null!=l[0]?l[0]:r?.get())??0,h=(Array.isArray(c)&&null!=c[0]?c[0]:a?.get())??0,d=Array.isArray(l)?l[l.length-1]:l??u,p=Array.isArray(c)?c[c.length-1]:c??h,m=e({x:u,y:h},{x:d,y:p}),f=void 0!==m(0).rotate?t("pathRotation"):void 0,g={delay:s,...Ti(i||{},"x")};delete g.path;const y=xi(0);y.start(Vi("",y,[0,1e3],{...g,isSync:!0,velocity:0,onUpdate:t=>{const e=m(t/1e3);r?.set(e.x),a?.set(e.y),f&&void 0!==e.rotate&&f.set(e.rotate)},onComplete:()=>{r?.set(d),a?.set(p),f?.set(0)},onStop:()=>f?.set(0),onCancel:()=>f?.set(0)})),y.animation&&o.push(y.animation),delete n.x,delete n.y}};return n},t.aspectRatio=mr,t.attachFollow=Kl,t.attachSpring=Xl,t.attrEffect=Us,t.axisDeltaEquals=fr,t.axisEquals=ur,t.axisEqualsRounded=dr,t.backIn=P,t.backInOut=E,t.backOut=A,t.bindToScope=bs,t.boxEquals=hr,t.boxEqualsRounded=pr,t.buildHTMLStyles=Bs,t.buildProjectionTransform=Tr,t.buildSVGAttrs=Ws,t.buildSVGPath=Is,t.buildTransform=Qn,t.calcAxisDelta=Xo,t.calcBoxDelta=Go,t.calcChildStagger=gi,t.calcGeneratorDuration=qt,t.calcLength=Ko,t.calcRelativeAxis=Ho,t.calcRelativeAxisPosition=qo,t.calcRelativeBox=_o,t.calcRelativePosition=Zo,t.camelCaseAttributes=vc,t.camelToDash=Xi,t.cancelFrame=Yt,t.cancelMicrotask=So,t.cancelSync=kc,t.checkVariantsDidChange=Ac,t.circIn=V,t.circInOut=D,t.circOut=k,t.clamp=i,t.cleanDirtyNodes=Or,t.collectMotionValues=yi,t.color=mt,t.compareByDepth=Sr,t.complex=At,t.containsCSSVariable=_,t.convertBoundingBoxToBox=Gs,t.convertBoxToBoundingBox=Hs,t.convertOffsetToTimes=Se,t.copyAxisDeltaInto=zo,t.copyAxisInto=Uo,t.copyBoxInto=$o,t.correctBorderRadius=vr,t.correctBoxShadow=xr,t.createAnimationState=function(t){let e=e=>Promise.all(e.map(({animation:e,options:n})=>ts(t,e,n))),n=Pc(),i=!0,s=!1;function o(o){const{props:r,parent:a,manuallyAnimateOnMount:l}=t,c=i||s,u=[],h=new Set;let d={},p=1/0,m=t;do{m=!1!==m.props.inherit&&m.parent}while(m&&!m.isControllingVariants);if(Sc.forEach((e,i)=>{const s=n[e],f=r[e],g=m&&m.props[e],y=void 0!==f?f:ca(g)||!1===g?g:void 0,v=ca(y),x=e===o?s.isActive:null;!1===x&&(p=i);const w=v&&void 0===f&&!(c&&l);if(s.protectedKeys={...d},!s.isActive&&null===x||!y&&!s.prevProp||la(y)||"boolean"==typeof y)return;if("exit"===e&&s.isActive&&!0!==x)return void(d={...d,...s.prevResolvedValues});const T=Ac(s.prevProp,y);let b=T||v&&(x&&!w||i>p),S=!1;const A=Array.isArray(y)?y:[y];let P={};if(!1!==x)for(const n of A){const{transition:i,transitionEnd:s,...o}=Oi(t,n,Ii(t,e))||{};P={...P,...o,...s}}const{prevResolvedValues:E}=s;for(const e in{...E,...P}){if(e in d)continue;const n=P[e],i=E[e],o=Array.isArray(n)&&Array.isArray(i)?!bc(n,i)||T:n!==i;if(o&&null==n)h.add(e);else if(o||void 0!==n&&h.has(e)){b=!0,h.delete(e)&&(S=!0),s.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)}else s.protectedKeys[e]=!0}if(s.prevProp=y,s.prevResolvedValues=P,s.isActive&&(d={...d,...P}),b&&(!w||!T||S))for(const n of A){const i={type:e};if("string"==typeof n&&c&&l&&a?.enteringChildren){const e=Oi(a,n)?.transition?.delayChildren;i.delay=gi(a.enteringChildren,t,e)}u.push({animation:n,options:i})}}),h.size){const{initial:e}=r,n={},i="boolean"!=typeof e&&Oi(t,Array.isArray(e)?e[0]:e,t.presenceContext?.custom);i&&i.transition&&(n.transition=i.transition),h.forEach(s=>{const o=t.getValue(s);o&&(o.liveStyle=!0);const a=i&&!Array.isArray(e)?i[s]:void 0,l=t.getBaseTargetFromProps(r,s);n[s]=(void 0!==a?a:void 0===l||zi(l)?void 0===t.initialValues[s]?t.baseTarget[s]:void 0:l)??null}),u.push({animation:n})}const f=c&&t.blockInitialAnimation||i&&!l&&(!1===r.initial||r.initial===r.animate);return i=s=!1,!f&&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=Pc(),s=!0}}},t.createAxis=rr,t.createAxisDelta=sr,t.createBox=ar,t.createDelta=or,t.createEffect=Es,t.createGeneratorEasing=Zt,t.createProjectionNode=Lr,t.createRenderBatcher=zt,t.createScopedAnimate=Yc,t.cubicBezier=T,t.cubicBezierAsString=Ln,t.defaultEasing=Ae,t.defaultOffset=be,t.defaultTransformValue=on,t.defaultValueTypes=Xe,t.degrees=at,t.delay=Vo,t.delayInSeconds=Vo,t.dimensionValueTypes=ns,t.distance=Qa,t.distance2D=tl,t.drag=function(t,e={}){const n=(({axis:t,constraints:e,elastic:n,momentum:i,transition:s,snapToOrigin:o,directionLock:r,propagation:a,onStart:l,onMove:c,onEnd:u,onDirectionLock:h,onTransitionEnd:d,onMeasureConstraints:p})=>({drag:t||!0,dragConstraints:e,dragElastic:n,dragMomentum:i,dragTransition:s,dragSnapToOrigin:o,dragDirectionLock:r,dragPropagation:a,onDragStart:l,onDrag:c,onDragEnd:u,onDirectionLock:h,onDragTransitionEnd:d,onMeasureDragConstraints:p}))(e),i=xs.current;if(i)for(const t in n){const e=n[t];"function"==typeof e&&(n[t]=i.bind(e))}const s=Ss(t).map(t=>{i?.track(t);const[s,o]=function(t){const e=Va.get(t)||aa.get(t)?.projection;if(e?.instance)return[e,()=>{}];const n=La(t);return[n,()=>Va.get(t)===n&&Ra(t,n)]}(t);s.setOptions({alwaysMeasureLayout:!0});const r=new bl(s.options.visualElement,()=>n),a=r.addListeners(),l=function(t,e){const{style:n}=t,i=t.getAttribute("draggable"),s=Ml.map(t=>n.getPropertyValue(t)),o=e?"pan-"+("x"===e?"y":"x"):"none";return Ml.forEach((t,e)=>n.setProperty(t,e<3?"none":o)),t.setAttribute("draggable","false"),()=>{Ml.forEach((t,e)=>n.setProperty(t,s[e])),null===i?t.removeAttribute("draggable"):t.setAttribute("draggable",i)}}(t,e.axis);return()=>{l(),a?.(),r.cancel(),r.stopAnimation(),o()}});return ws(()=>s.forEach(t=>t()))},t.eachAxis=br,t.easeIn=C,t.easeInOut=R,t.easeOut=L,t.easingDefinitionToFunction=F,t.elementDragControls=Tl,t.expectsResolvedDragConstraints=function({dragConstraints:t,onMeasureDragConstraints:e}){return Sl(t)&&!!e},t.extractEventInfo=Fa,t.fillOffset=Te,t.fillWildcards=qe,t.findDimensionValueType=is,t.findEffect=ms,t.findValueType=t=>Gl.find(es(t)),t.flushKeyframeResolvers=Sn,t.followValue=function(t,e){const n=xi(zi(t)?t.get():t);return Kl(n,t,e),n},t.frame=Kt,t.frameData=W,t.frameSteps=Xt,t.generateLinearEasing=Ht,t.getAnimatableNone=_e,t.getAnimationMap=fi,t.getComputedStyle=jl,t.getDefaultTransition=Pi,t.getDefaultValueType=Ge,t.getEasingForSegment=j,t.getFeatureDefinitions=function(){return wa},t.getFinalKeyframe=Ve,t.getMixer=Ot,t.getOptimisedAppearId=_i,t.getOriginIndex=function(t,e){if("first"===t)return 0;{const n=e-1;return"last"===t?n:n/2}},t.getValueAsType=qn,t.getValueTransition=Ti,t.getVariableValue=Bi,t.getVariantContext=function t(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent&&t(e.parent)||{};return void 0!==e.props.initial&&(n.initial=e.props.initial),n}const n={};for(let t=0;t<Ec;t++){const i=ha[t],s=e.props[i];(ca(s)||!1===s)&&(n[i]=s)}return n},t.getViewAnimationLayerInfo=oc,t.getViewAnimations=rc,t.globalProjectionState=Pr,t.handOffElementState=wo,t.has2DTranslate=Qs,t.hasComplexValues=wt,t.hasReducedMotionListener=ga,t.hasScale=Zs,t.hasTransform=Js,t.hasWarned=function(t){return y.has(t)},t.hex=ot,t.hover=function(t,e,n={}){e=bs(e);const[i,s,o]=Vl(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||ml())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},t.hsla=pt,t.hslaToRgba=Et,t.inView=function(t,e,{root:n,margin:i,amount:s="some"}={}){const o=Ss(t);e=bs(e);const r=new WeakMap,a=new IntersectionObserver(t=>{t.forEach(t=>{const n=r.get(t.target);if(t.isIntersecting!==Boolean(n))if(t.isIntersecting){const n=e(t.target,t);"function"==typeof n?r.set(t.target,n):a.unobserve(t.target)}else"function"==typeof n&&(n(t),r.delete(t.target))})},{root:n,rootMargin:i,threshold:"number"==typeof s?s:fu[s]});return o.forEach(t=>a.observe(t)),ws(()=>a.disconnect())},t.inertia=xe,t.initPrefersReducedMotion=va,t.interpolate=we,t.invariant=s,t.invisibleValues=Rt,t.isAnimationControls=la,t.isBezierDefinition=O,t.isCSSVariableName=Y,t.isCSSVariableToken=G,t.isControllingVariants=da,t.isDeltaZero=cr,t.isDragActive=ml,t.isDragging=pl,t.isEasingArray=B,t.isElementKeyboardAccessible=ul,t.isElementTextInput=dl,t.isForcedMotionValue=Aa,t.isGenerator=On,t.isHTMLElement=ys,t.isKeyframesTarget=Wi,t.isMotionValue=zi,t.isNear=Yo,t.isNodeOrChild=kl,t.isNumericalString=r,t.isObject=a,t.isPrimaryPointer=Ia,t.isSVGElement=vs,t.isSVGSVGElement=ko,t.isSVGTag=xc,t.isTransitionDefined=Mi,t.isVariantLabel=ca,t.isVariantNode=pa,t.isWaapiSupportedEasing=function t(e){return Boolean("function"==typeof e&&Cn()||!e||"string"==typeof e&&(e in Rn||Cn())||O(e)||Array.isArray(e)&&e.every(t))},t.isWillChangeMotionValue=Ki,t.isZeroValueString=l,t.keyframes=Pe,t.makeAnimationInstant=Kn,t.mapEasingToNativeEasing=Bn,t.mapValue=function(t,e,n,i){const s=Fl(e,n,i);return Yl(()=>s(t.get()))},t.maxGeneratorDuration=_t,t.measurePageBox=mo,t.measureViewportBox=po,t.memo=c,t.microtask=bo,t.millisecondsToSeconds=f,t.mirrorEasing=b,t.mix=Ut,t.mixArray=It,t.mixColor=Lt,t.mixComplex=Wt,t.mixImmediate=Mt,t.mixLinearColor=kt,t.mixNumber=Vt,t.mixObject=Ft,t.mixValues=Oo,t.mixVisibility=Bt,t.motionValue=xi,t.moveItem=function([...t],e,n){const i=e<0?t.length+e:e;if(i>=0&&i<t.length){const i=n<0?t.length+n:n,[s]=t.splice(e,1);t.splice(i,0,s)}return t},t.nodeGroup=function(){const t=new Set,e=new WeakMap,n=()=>t.forEach(Mc);return{add:i=>{t.add(i),e.set(i,i.addEventListener("willUpdate",n))},remove:i=>{t.delete(i);const s=e.get(i);s&&(s(),e.delete(i)),n()},dirty:n}},t.noop=u,t.number=q,t.numberValueTypes=Ye,t.optimizedAppearDataAttribute=Hi,t.optimizedAppearDataId=Gi,t.originProps=Vs,t.parseAnimateLayoutArgs=Oa,t.parseCSSVariable=Ri,t.parseValueFromTransform=rn,t.percent=lt,t.pipe=h,t.pixelsToPercent=yr,t.positionalKeys=Fi,t.prefersReducedMotion=fa,t.press=function(t,e,n={}){e=bs(e);const[i,s,o]=Vl(t,n),r=t=>{const i=t.currentTarget;if(!Rl(t))return;if(Bl.has(t))return;Dl.add(i),n.stopPropagation&&Bl.add(t);const o=e(i,t),r={...s,capture:!0},a=(t,e)=>{window.removeEventListener("pointerup",l,r),window.removeEventListener("pointercancel",c,r),Dl.has(i)&&Dl.delete(i),Rl(t)&&"function"==typeof o&&o(t,{success:e})},l=t=>{a(t,i===window||i===document||n.useGlobalTarget||kl(i,t.target))},c=t=>{a(t,!1)};window.addEventListener("pointerup",l,r),window.addEventListener("pointercancel",c,r)};return i.forEach(t=>{(n.useGlobalTarget?window:t).addEventListener("pointerdown",r,s),ys(t)&&(t.addEventListener("focus",()=>((t,e)=>{let n=!1;const i=Cl(()=>{Dl.has(t)||(n=!0,Ll(t,"down"))}),s=Cl(()=>{n&&(n=!1,Ll(t,"up"))});t.addEventListener("keydown",i,e),t.addEventListener("keyup",s,e),t.addEventListener("blur",()=>{t.removeEventListener("keydown",i),t.removeEventListener("keyup",s),n&&Ll(t,"cancel")},{...e,once:!0})})(t,s),s),ul(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),o},t.progress=d,t.progressPercentage=dt,t.propEffect=To,t.propagateDirtyNodes=jr,t.px=ct,t.readSVGValue=zs,t.readStyleValue=Cs,t.readTransformValue=an,t.recordStats=function(){if(Eo.value)throw Eo.value=null,Eo.addProjectionMetrics=null,new Error("Stats are already being measured");const t=Eo;t.value={layoutProjection:{nodes:[],calculatedTargetDeltas:[],calculatedProjections:[]}},t.addProjectionMetrics=e=>{const{layoutProjection:n}=t.value;n.nodes.push(e.nodes),n.calculatedTargetDeltas.push(e.calculatedTargetDeltas),n.calculatedProjections.push(e.calculatedProjections)}},t.releaseElement=xo,t.removeAxisDelta=Qo,t.removeAxisTransforms=tr,t.removeBoxTransforms=ir,t.removeEffect=ps,t.removeItem=n,t.removePointDelta=Jo,t.renderHTML=Sa,t.renderSVG=wc,t.resize=Ja,t.resolveElements=Ss,t.resolveMotionValue=Do,t.resolveTransition=wi,t.resolveVariant=Oi,t.resolveVariantFromProps=ji,t.reverseEasing=S,t.rgbUnit=it,t.rgba=st,t.rootProjectionNode=oa,t.round=Oe,t.sampleDelta=Un,t.scale=J,t.scaleCorrectors=Po,t.scalePoint=eo,t.scopeMotion=function(...t){const e="function"==typeof t[0]?void 0:t.shift(),[i,s={}]=t,{transition:o,matchMedia:r}=s,a=[],l=new Map;let c=[],u=!1;const h={root:Ss(e)[0],transition:o,add:t=>(c.push(t),()=>n(c,t)),bind:t=>(...e)=>{const n=y.run(()=>t(...e));return"function"==typeof n?h.bind(n):n},track(t){l.has(t)||l.set(t,t.getAttribute("style"))}},d=t=>{const e=c;c=[];for(let t=e.length-1;t>=0;t--)e[t]();t&&l.forEach((t,e)=>{xo(e),null===t?e.removeAttribute("style"):e.setAttribute("style",t)}),l.clear()},p=()=>{y.state="active";let t=!a.length;y.media={};for(const[e,n]of a)t=(y.media[e]=n.matches)||t;if(t&&i){const t=y.run(()=>i(y));"function"==typeof t&&h.add(t)}},m=()=>{u||(u=!0,queueMicrotask(()=>{u=!1,a.length&&y.refresh()}))},f=t=>{y.state=t?"cancelled":"stopped";for(const[,t]of a)t.removeEventListener("change",m);a.length=0,d(t)},g=(t,e)=>{const n=xs.current;xs.current=t;try{return e()}finally{xs.current=n}},y={state:"active",media:{},run:t=>g(h,t),ignore:t=>g(void 0,t),bind:h.bind,stop:()=>f(),cancel:()=>f(!0),refresh(){d(!0),p()}};if(r&&"undefined"!=typeof window){const t="string"==typeof r?{matches:r}:r;for(const e in t){const n=window.matchMedia(Il(t[e]));n.addEventListener("change",m),a.push([e,n])}}return ws(y.cancel),p(),y},t.scrapeHTMLMotionValuesFromProps=Pa,t.scrapeSVGMotionValuesFromProps=Tc,t.scroll=function(t,{axis:e="y",source:n,container:i=document.scrollingElement,...s}={}){if(!i)return u;const o={axis:e,container:n||i,...s};if("function"==typeof t){const n=bs(t);return ws(uu(t=>n(t[e].progress,t),o))}return ws(mu(t,o))},t.scrollInfo=uu,t.secondsToMilliseconds=m,t.setDragLock=fl,t.setFeatureDefinitions=function(t){wa=t},t.setStyle=En,t.setTarget=$i,t.spring=ve,t.springValue=function(t,e){const n=xi(zi(t)?t.get():t);return Xl(n,t,e),n},t.stagger=function(t=.1,{startDelay:e=0,from:n=0,ease:i,grid:s}={}){const o={};return(r,a)=>{let l=o[a];if(!l){const[t,e]=s||[1/0,1],i=Math.min(t,a)-1,r=Math.max(e,Math.ceil(a/t))-1,c="number"==typeof n,u="first"===n?0:"last"===n?1:.5,h=c?n%t:i*u,d=c?Math.floor(n/t):r*u;l=o[a]=[];for(let e=0;e<a;e++){const s=e%t,o=Math.floor(e/t),a=Math.min(s,i-s),c=Math.min(o,r-o);if("random"===n){const t=Math.random()*(e+1)|0;l[e]=l[t],l[t]=e}else l[e]="edges"===n?Math.min(i?a:c,r?c:a):Math.hypot(s-h,o-d)}l.push(s?Math.max(...l):a)}let c=t*l[r];const u=t*l[a];if(i&&u){c=F(i)(c/u)*u}return e+c}},t.startWaapiAnimation=jn,t.statsBuffer=Eo,t.steps=function(t,e="end"){return n=>{const s=(n="end"===e?Math.min(n,.999):Math.max(n,.001))*t,o="end"===e?Math.floor(s):Math.ceil(s);return i(0,1,o/t)}},t.styleEffect=Rs,t.styleSubjectEffect=Ls,t.supportedWaapiEasing=Rn,t.supportsBrowserAnimation=_n,t.supportsFlags=Mn,t.supportsLinearEasing=Cn,t.supportsPartialKeyframes=us,t.supportsScrollTimeline=kn,t.supportsViewTimeline=Dn,t.supportsWaapi=Hn,t.svgEffect=Ys,t.svgSubjectEffect=Ks,t.sync=Vc,t.testValueType=es,t.time=$,t.toMediaQuery=Il,t.transform=Fl,t.transformAxis=co,t.transformBox=ho,t.transformBoxPoints=_s,t.transformPropOrder=cn,t.transformProps=un,t.transformValue=Yl,t.transformValueTypes=Ke,t.translateAxis=lo,t.updateMotionValuesFromProps=ma,t.variantPriorityOrder=ua,t.variantProps=ha,t.velocityPerSecond=g,t.vh=ut,t.visualElementStore=aa,t.vw=ht,t.warnOnce=v,t.warning=()=>{},t.wrap=x});