UNPKG

framer-motion

Version:

A simple and powerful JavaScript animation library

2 lines • 217 kB
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={},t.React)}(this,function(t,e){"use strict";function n(t){var e=Object.create(null);return t&&Object.keys(t).forEach(function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}}),e.default=t,Object.freeze(e)}var i=n(e),s=React,o=Symbol.for("react.element"),r=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,c=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function u(t,e,n){var i,s={},r=null,u=null;for(i in void 0!==n&&(r=""+n),void 0!==e.key&&(r=""+e.key),void 0!==e.ref&&(u=e.ref),e)a.call(e,i)&&!l.hasOwnProperty(i)&&(s[i]=e[i]);if(t&&t.defaultProps)for(i in e=t.defaultProps)void 0===s[i]&&(s[i]=e[i]);return{$$typeof:o,type:t,key:r,ref:u,props:s,_owner:c.current}}const h=r,d=u,p=u,f=e.createContext({});function m(t){const n=e.useRef(null);return null===n.current&&(n.current=t()),n.current}const g="undefined"!=typeof window,y=g?e.useLayoutEffect:e.useEffect,v=e.createContext(null);function x(t,e){-1===t.indexOf(e)&&t.push(e)}function w(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}function b([...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}const S=(t,e,n)=>n>e?e:n<t?t:n;const T={},P=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),A=t=>"object"==typeof t&&null!==t,E=t=>/^0[^.\s]+$/u.test(t);function M(t){let e;return()=>(void 0===e&&(e=t()),e)}const C=t=>t,V=(...t)=>t.reduce((t,e)=>n=>e(t(n))),k=(t,e,n)=>{const i=e-t;return i?(n-t)/i:1};class D{constructor(){this.subscriptions=[]}add(t){return x(this.subscriptions,t),()=>this.remove(t)}remove(t){w(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 R=t=>1e3*t,L=t=>t/1e3,O=(t,e)=>e?t*(1e3/e):0,B=new Set;function I(t,e,n){t||B.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)),B.add(e))}const j=(t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t},F=(t,e,n)=>t*(3*(1-t)*((1-t)*e+t*n)+t*t);function W(t,e,n,i){return t===e&&n===i?C:s=>{let o=0,r=1,a=s;for(let e=0;;e++){a>=o&&a<=r||(a=(o+r)/2);const i=F(a,t,n)-s;if(i*i<1e-28||40===e)break;i>0?r=a:o=a,a-=1e-7*i/(F(a+1e-7,t,n)-s-i)}return F(a,e,i)}}const U=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,N=t=>e=>1-t(1-e),$=W(.33,1.53,.69,.99),z=N($),K=U(z),Y=t=>t>=1?1:(t*=2)<1?.5*z(t):.5*(2-Math.pow(2,-10*(t-1))),H=t=>1-Math.sin(Math.acos(t)),X=N(H),G=U(H),_=W(.42,0,1,1),q=W(0,0,.58,1),Z=W(.42,0,.58,1);const J=t=>Array.isArray(t)&&"number"!=typeof t[0];function Q(t,e){return J(t)?t[j(0,t.length,e)]:t}const tt=t=>Array.isArray(t)&&"number"==typeof t[0],et={linear:C,easeIn:_,easeInOut:Z,easeOut:q,circIn:H,circInOut:G,circOut:X,backIn:z,backInOut:K,backOut:$,anticipate:Y},nt=t=>{if(tt(t)){const[e,n,i,s]=t;return W(e,n,i,s)}return"string"==typeof t?et[t]:t},it={delta:0,timestamp:0,isProcessing:!1};let st;function ot(){st=void 0}const rt={now:()=>(void 0===st&&rt.set(it.isProcessing||T.useManualTiming?it.timestamp:performance.now()),st),set:t=>{st=t,queueMicrotask(ot)}},at=t=>Math.round(1e5*t)/1e5,ct=t=>e=>"string"==typeof e&&e.startsWith(t),lt=ct("--"),ut=ct("var(--"),ht=t=>!!ut(t)&&dt.test(t.split("/*")[0].trim()),dt=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function pt(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const ft={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},mt={...ft,transform:t=>S(0,1,t)},gt={...ft,default:1},yt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const vt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,xt=(t,e)=>n=>Boolean("string"==typeof n&&vt.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),wt=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[s,o,r,a]=i.match(yt);return{[t]:parseFloat(s),[e]:parseFloat(o),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},bt={...ft,transform:t=>Math.round((t=>S(0,255,t))(t))},St={test:xt("rgb","red"),parse:wt("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+bt.transform(t)+", "+bt.transform(e)+", "+bt.transform(n)+", "+at(mt.transform(i))+")"},Tt=(t,e,n)=>{const i=t.substring(1+e*n,1+(e+1)*n);return n>1?i:i+i};const Pt={test:xt("#"),parse:function(t){const e=t.length>5?2:1,n=Tt(t,3,e);return{red:parseInt(Tt(t,0,e),16),green:parseInt(Tt(t,1,e),16),blue:parseInt(Tt(t,2,e),16),alpha:n?parseInt(n,16)/255:1}},transform:St.transform},At=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),Et=At("deg"),Mt=At("%"),Ct=At("px"),Vt=At("vh"),kt=At("vw"),Dt=(()=>({...Mt,parse:t=>Mt.parse(t)/100,transform:t=>Mt.transform(100*t)}))(),Rt={test:xt("hsl","hue"),parse:wt("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+Mt.transform(at(e))+", "+Mt.transform(at(n))+", "+at(mt.transform(i))+")"},Lt={test:t=>St.test(t)||Pt.test(t)||Rt.test(t),parse:t=>St.test(t)?St.parse(t):Rt.test(t)?Rt.parse(t):Pt.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?St.transform(t):Rt.transform(t),getAnimatableNone:t=>{const e=Lt.parse(t);return e.alpha=0,Lt.transform(e)}},Ot=new RegExp(yt.source),Bt=new RegExp(/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu.source,"i");const It="number",jt="color",Ft=/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 Ot.test(e)||Bt.test(e)}function Ut(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let o=0;const r=e.replace(Ft,t=>(Lt.test(t)?(i.color.push(o),s.push(jt),n.push(Lt.parse(t))):t.startsWith("var(")?(i.var.push(o),s.push("var"),n.push(t)):(i.number.push(o),s.push(It),n.push(parseFloat(t))),++o,"${}")).split("${}");return{values:n,split:r,indexes:i,types:s}}function Nt({split:t,types:e}){const n=t.length;return i=>{let s="";for(let o=0;o<n;o++)if(s+=t[o],void 0!==i[o]){const t=e[o];s+=t===It?at(i[o]):t===jt?Lt.transform(i[o]):i[o]}return s}}const $t=(t,e)=>{return"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof(n=t)?0:Lt.test(n)?Lt.getAnimatableNone(n):n;var n};const zt={test:function(t){return isNaN(t)&&"string"==typeof t&&(Ot.test(t)||Bt.test(t))},parse:function(t){return Ut(t).values},createTransformer:function(t){return Nt(Ut(t))},getAnimatableNone:function(t){const e=Ut(t);return Nt(e)(e.values.map((t,n)=>$t(t,e.split[n])))}};function Kt(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 Yt({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=Kt(a,i,t+1/3),o=Kt(a,i,t),r=Kt(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 Ht(t,e){return n=>n>0?e:t}const Xt=(t,e,n)=>t+(e-t)*n,Gt=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},_t=[Pt,St,Rt];function qt(t){const e=(n=t,_t.find(t=>t.test(n)));var n;if(!e)return!1;let i=e.parse(t);return e===Rt&&(i=Yt(i)),i}const Zt=(t,e)=>{const n=qt(t),i=qt(e);if(!n||!i)return Ht(t,e);const s={...n};return t=>(s.red=Gt(n.red,i.red,t),s.green=Gt(n.green,i.green,t),s.blue=Gt(n.blue,i.blue,t),s.alpha=Xt(n.alpha,i.alpha,t),St.transform(s))},Jt=new Set(["none","hidden"]);function Qt(t,e){return Jt.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function te(t,e){return n=>Xt(t,e,n)}function ee(t){return"number"==typeof t?te:"string"==typeof t?ht(t)?Ht:Lt.test(t)?Zt:se:Array.isArray(t)?ne:"object"==typeof t?Lt.test(t)?Zt:ie:Ht}function ne(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>ee(t)(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=s[e](t);return n}}function ie(t,e){const n={...t,...e},i={};for(const s in n)void 0!==t[s]&&void 0!==e[s]&&(i[s]=ee(t[s])(t[s],e[s]));return t=>{for(const e in i)n[e]=i[e](t);return n}}const se=(t,e)=>{const n=Ut(t),i=Ut(e);return n.indexes.var.length===i.indexes.var.length&&n.indexes.color.length===i.indexes.color.length&&n.indexes.number.length>=i.indexes.number.length?Jt.has(t)&&!i.values.length||Jt.has(e)&&!n.values.length?Qt(t,e):V(ne(function(t,e){const n=[],i={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const o=e.types[s],r=t.indexes[o][i[o]],a=t.values[r]??0;n[s]=a,i[o]++}return n}(n,i),i.values),Nt(i)):Ht(t,e)},oe=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function re(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return Xt(t,e,n);if("string"==typeof t&&"string"==typeof e){const n=function(t,e){const n=oe.exec(t);if(!n)return;const i=oe.exec(e);if(!i||n[2]!==i[2])return;const s=n[2],o=parseFloat(n[1]),r=parseFloat(i[1]);return t=>at(Xt(o,r,t))+s}(t,e);if(n)return n}return ee(t)(t,e)}const ae=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function ce(t,e,n={delta:0,timestamp:0,isProcessing:!1}){let i=!1,s=!0;const o=()=>i=!0,r=ae.reduce((t,e)=>(t[e]=function(t){let e,n=new Set,i=new Set,s=!1,o=!1;const r=new Set;let a={delta:0,timestamp:0,isProcessing:!1};function c(n){r.has(n)&&(i.add(n),t()),(e=n)(a)}const l={schedule:(t,o=!1,a=!1)=>{const c=a&&s,l=c?n:i;return o&&r.add(t),c&&t!==e&&l.delete(t),l.add(t),t},cancel:t=>{i.delete(t),r.delete(t)},process:t=>{if(a=t,s)return void(o=!0);s=!0;const r=n;n=i,i=r,n.forEach(c),n.clear(),e=void 0,s=!1,o&&(o=!1,l.process(t))}};return l}(o),t),{}),{setup:a,read:c,resolveKeyframes:l,preUpdate:u,update:h,preRender:d,render:p,postRender:f}=r,m=()=>{const o=T.useManualTiming,r=o?n.timestamp:performance.now();i=!1,o||(n.delta=s?1e3/60:Math.max(Math.min(r-n.timestamp,40),1)),n.timestamp=r,n.isProcessing=!0,a.process(n),c.process(n),l.process(n),u.process(n),h.process(n),d.process(n),p.process(n),f.process(n),n.isProcessing=!1,i&&e&&(s=!1,t(m))};return{schedule:ae.reduce((e,o)=>{const a=r[o];return e[o]=(e,o=!1,r=!1)=>(i||(i=!0,s=!0,n.isProcessing||t(m)),a.schedule(e,o,r)),e},{}),cancel:t=>{for(let e=0;e<ae.length;e++)r[ae[e]].cancel(t)},state:n,steps:r}}const{schedule:le,cancel:ue,steps:he}=ce("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:C,!0,it),de=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>le.update(e,t),stop:()=>ue(e),now:()=>it.isProcessing?it.timestamp:rt.now()}},pe=(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)})`},fe=2e4;function me(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 ge(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(me(r),fe);return{type:"keyframes",ease:t=>r.next(a*t).value/e,duration:L(a)}}const ye=t=>t<0?1/Math.max(1+t,.05):Math.max(1-t,.05);function ve(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 be(t=>s*Math.exp(-i*t)-i*Math.exp(-s*t)-o,t=>Math.exp(-s*t)-Math.exp(-i*t),e)/e}function xe(t,e){return t*Math.sqrt(1-e*e)}const we=12;function be(t,e,n){let i=n;for(let n=1;n<we;n++)i-=t(i)/e(i);return i}const Se=.001;const Te=(t,e)=>(e?t>=0:t>0)&&t<1/0;function Pe(t,e){if(Te(t,e))return t}function Ae(t){const e=Pe(t.stiffness),n=Pe(t.damping,!0),i=Pe(t.mass),s={...t,stiffness:e??100,damping:n??10,mass:i??1,isResolvedFromDuration:!1,isTimeDefined:void 0===(e??n??i)&&(void 0!==t.duration||void 0!==t.bounce)};if(s.isTimeDefined){if(t.visualDuration){const e=ye(t.bounce||0),n=2*Math.PI/(1.2*t.visualDuration)*ve(e,2*Math.PI/1.2);s.stiffness=n*n,s.damping=2*e*Math.sqrt(s.stiffness)}else Object.assign(s,function({duration:t=800,bounce:e=.3}){let n,i;const s=ye(e);t=S(.01,10,L(t)),s<1?(n=e=>{const n=e*s,i=n*t,o=xe(e,s),r=Math.exp(-i);return Se-n/o*r},i=e=>{const i=e*s*t,o=s*s*e*e*t,r=Math.exp(-i),a=xe(e*e,s);return(-n(e)+Se>0?-1:1)*-o*r/a}):(n=e=>Math.exp(-e*t)*(e*t+1)-.001,i=e=>Math.exp(-e*t)*(t*t*-e));const o=be(n,i,5/t),r=o*ve(s,o*t),a=r*r;return{stiffness:a,damping:2*s*Math.sqrt(a),duration:R(t)}}(s)),s.isResolvedFromDuration=!0;Te(s.stiffness)&&Te(s.damping,!0)||(s.stiffness=100,s.damping=10)}return s}function Ee(t=.3,e=.3){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t,i=n.keyframes[0],s=n.keyframes[n.keyframes.length-1],o={done:!1,value:i},{stiffness:r,damping:a,mass:c,duration:l,isResolvedFromDuration:u,isTimeDefined:h}=Ae({...n}),d=t=>h?0:-L(t),p=a/(2*Math.sqrt(r*c)),f=L(Math.sqrt(r/c)),m=p*f,g={target:s,delta:s-i,velocity:d(n.velocity||0)||0,restSpeed:0,restDelta:0},y=()=>{const t=Math.abs(g.delta)<5;g.restSpeed=n.restSpeed||(t?.01:2),g.restDelta=n.restDelta||(t?.005:.5)};let v,x,w;if(y(),p<1){const t=xe(f,p),e={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};w=()=>{e.A=(g.velocity+m*g.delta)/t,e.sinC=m*e.A+g.delta*t,e.cosC=m*g.delta-e.A*t};const n=n=>{n!==e.t&&(e.t=n,e.env=Math.exp(-m*n),e.sin=Math.sin(t*n),e.cos=Math.cos(t*n))};v=t=>(n(t),g.target-e.env*(e.A*e.sin+g.delta*e.cos)),x=t=>(n(t),e.env*(e.sinC*e.sin+e.cosC*e.cos))}else if(1===p){v=t=>g.target-Math.exp(-f*t)*(g.delta+(g.velocity+f*g.delta)*t);const t={C:0};w=()=>{t.C=g.velocity+f*g.delta},x=e=>Math.exp(-f*e)*(f*t.C*e-g.velocity)}else{const t=f*Math.sqrt(p*p-1),e=m-t,n=m+t,i=t<1||h?1/0:300/t,s=(t,e)=>Math.exp(e>i?(m-t)*i-m*e:-t*e),o={S:0,F:0};w=()=>{const e=(g.velocity+m*g.delta)/t;o.S=(g.delta+e)/2,o.F=(g.delta-e)/2},v=t=>g.target-o.S*s(e,t)-o.F*s(n,t),x=t=>e*o.S*s(e,t)+n*o.F*s(n,t)}w();const b=u&&l||null,S={calculatedDuration:b,retarget:(t,e)=>{g.target=t[t.length-1],g.delta=g.target-t[0],g.velocity=d(e),n.restSpeed&&n.restDelta||y(),S.calculatedDuration=b,o.done=!1,w()},velocity:t=>R(x(t)),next:t=>{const e=v(t);if(u)o.done=t>=l;else{const n=R(x(t));o.done=Math.abs(n)<=g.restSpeed&&Math.abs(g.target-e)<=g.restDelta}return o.value=o.done?g.target:e,o},toString:()=>{const t=Math.min(me(S),fe),e=pe(e=>S.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return S}const Me=Object.assign(Ee,{applyToOptions:t=>{const e=ge(t,100,Ee);return t.ease=e.ease,t.duration=R(e.duration),t.type="keyframes",t}});function Ce({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:c,restDelta:l=.5,restSpeed:u}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?c:void 0===c||Math.abs(a-t)<Math.abs(c-t)?a:c;let f=n*e;const m=h+f,g=r?r(m):m;g!==m&&(f=g-h);const y=t=>-f*Math.exp(-t/i),v=t=>{const e=y(t);d.done=Math.abs(e)<=l,d.value=d.done?g:t?g+e:h};let x,w;const b=t=>{var e;((e=d.value)<a||e>c)&&(x=t,w=Me({keyframes:[d.value,p(d.value)],velocity:-y(t)/i*1e3,damping:s,stiffness:o,restDelta:l,restSpeed:u}))};return b(0),{calculatedDuration:null,next:t=>{let e=!1;return w||void 0!==x||(e=!0,v(t),b(t)),void 0!==x&&t>=x?w.next(t-x):(!e&&v(t),d)}}}function Ve(t,e,{clamp:n=!0,ease:i,mixer:s}={}){const o=t.length;if(1===o)return()=>e[0];if(2===o&&e[0]===e[1])return()=>e[1];const r=t[0]===t[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=function(t,e,n){const i=[],s=n||T.mix||re,o=t.length-1;for(let n=0;n<o;n++){let o=s(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]||C:e;o=V(t,o)}i.push(o)}return i}(e,i,s),c=a.length,l=n=>{if(r&&n<t[0])return e[0];let i=0;if(c>1)for(;i<t.length-2&&!(n<t[i+1]);i++);const s=k(t[i],t[i+1],n);return a[i](s)};return n?e=>l(S(t[0],t[o-1],e)):l}function ke(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=k(0,e,i);t.push(Xt(n,1,s))}}function De(t){const e=[0];return ke(e,t.length-1),e}function Re(t,e){return t.map(t=>t*e)}function Le(t,e){return t.map(()=>e||Z).splice(0,t.length-1)}function Oe({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const s=J(i)?i.map(nt):nt(i)||Z,o={done:!1,value:e[0]};if(2===e.length&&!Array.isArray(s)&&(!n||2!==n.length||0===n[0]&&1===n[1])){const[n,i]=e,r=n===i?void 0:(T.mix||re)(n,i);return{calculatedDuration:t,next:e=>(o.value=r?r(s(t>0?S(0,1,e/t):1)):i,o.done=e>=t,o)}}const r=Ve(Re(n&&n.length===e.length?n:De(e),t),e,{ease:Array.isArray(s)?s:Le(e,s)});return{calculatedDuration:t,next:e=>(o.value=r(e),o.done=e>=t,o)}}function Be(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 O(n-t(i),e-i)}(e=>t.next(e).value,e,t.next(e).value)}const Ie=t=>null!==t;function je(t,{repeat:e,repeatType:n="loop"},i,s=1){const o=t.filter(Ie),r=s<0||e&&"loop"!==n&&e%2==1?0:o.length-1;return r&&void 0!==i?i:o[r]}const Fe={decay:Ce,inertia:Ce,tween:Oe,keyframes:Oe,spring:Me};function We(t){"string"==typeof t.type&&(t.type=Fe[t.type])}const Ue=(t,e)=>e-t>40&&!T.useManualTiming?e:t;function Ne(t,e){return{kind:t,animation:e,timestamp:rt.now(),frameTimestamp:it.timestamp,frameIsProcessing:it.isProcessing}}function $e(t,e,n){const i=globalThis.__MOTION_INSPECT__;if(i)try{i({...Ne("animation-start",t),options:n?{...e,...n}:e})}catch{}}class ze{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 Ke=t=>t/100,Ye=t=>Math.round(1e4*t)/1e4;class He extends ze{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!==rt.now()&&this.tick(rt.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause(),$e(this,this.options)}initAnimation(){const{options:t}=this;We(t);const{type:e=Oe,repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=t;let{keyframes:r}=t;const a=e||Oe;a!==Oe&&"number"!=typeof r[0]&&(this.mixKeyframes=V(Ke,re(r[0],r[1])),r=[0,100]);const c=a(r===t.keyframes?t:{...t,keyframes:r});"mirror"===s&&(this.mirroredGenerator=a({...t,keyframes:[...r].reverse(),velocity:-o})),null===c.calculatedDuration&&(c.calculatedDuration=me(c));const{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=c}updateTime(t){this.currentTime=this.holdTime??Math.round(t-this.startTime)*this.playbackSpeed}tick(t,e=!1){const{generator:n,totalDuration:i,calculatedDuration:s}=this;if(null===this.startTime)return n.next(0);const{delay:o=0,keyframes:r,type:a,onUpdate:c,finalKeyframe:l}=this.options;this.startTime===this.pendingStartTime&&(this.startTime=Ue(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||(p=this.playbackSpeed>=0?s<1/0?this.currentTime>=i:p:this.currentTime<=0);const f=null===this.holdTime&&("finished"===this.state||"running"===this.state&&p);return f&&a!==Ce&&(d.value=je(r,this.options,l,this.speed)),c&&c(d.value),f&&this.finish(),d}at(t){return this.holdTime??Ye((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!==Ce?je(n.keyframes,n,e?void 0:n.finalKeyframe):this.generate(Math.max(s,0),s<0).value}generate(t,e){const{generator:n,totalDuration:i,mixKeyframes:s,mirroredGenerator:o,resolvedDuration:r}=this,{keyframes:a,repeat:c,repeatType:l,repeatDelay:u}=this.options;let h,d=t,p=n;if(c){const e=Math.min(t,i)/r;let n=Math.floor(e),s=e%1;!s&&e>=1&&(s=1),1===s&&n--,n=Math.min(n,c+1);Boolean(n%2)&&("reverse"===l?(s=1-s,u&&(s-=u/r)):"mirror"===l&&(p=o)),d=S(0,1,s)*r}return e?(this.delayState.value=a[0],h=this.delayState):h=p.next(d),s&&!e&&(h.value=s(h.value)),h}get duration(){return L(this.calculatedDuration)}get iterationDuration(){return this.duration+L(this.options.delay??0)}get time(){return L(this.currentTime)}set time(t){t=R(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 Be(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(rt.now()),this.playbackSpeed=t,e&&this.driver&&(this.time=L(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=de,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(rt.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.driver?.stop(),this.driver=void 0,this.startTime=this.holdTime=null}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}const Xe=new Set(["brightness","contrast","saturate","opacity"]);function Ge(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(yt)||[];if(!i)return t;const s=n.replace(i,"");let o=Xe.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+s+")"}const _e=/\b([a-z-]*)\(.*?\)/gu,qe={...zt,getAnimatableNone:t=>{const e=t.match(_e);return e?e.map(Ge).join(" "):t}},Ze={...zt,getAnimatableNone:t=>{const e=zt.parse(t);return zt.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},Je={...ft,transform:Math.round},Qe={rotate:Et,pathRotation:Et,rotateX:Et,rotateY:Et,rotateZ:Et,scale:gt,scaleX:gt,scaleY:gt,scaleZ:gt,skew:Et,skewX:Et,skewY:Et,distance:Ct,translateX:Ct,translateY:Ct,translateZ:Ct,x:Ct,y:Ct,z:Ct,perspective:Ct,transformPerspective:Ct,opacity:mt,originX:Dt,originY:Dt,originZ:Ct},tn={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,...Qe,zIndex:Je,fillOpacity:mt,strokeOpacity:mt,numOctaves:Je},en={...tn,color:Lt,backgroundColor:Lt,outlineColor:Lt,fill:Lt,stroke:Lt,borderColor:Lt,borderTopColor:Lt,borderRightColor:Lt,borderBottomColor:Lt,borderLeftColor:Lt,filter:qe,WebkitFilter:qe,mask:Ze,WebkitMask:Ze},nn=t=>en[t],sn=new Set([qe,Ze]);function on(t,e){let n=nn(t);return sn.has(n)||(n=zt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}function rn(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const an=t=>180*t/Math.PI,cn=t=>{const e=an(Math.atan2(t[1],t[0]));return un(e)},ln={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:cn,rotateZ:cn,skewX:t=>an(Math.atan(t[1])),skewY:t=>an(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},un=t=>((t%=360)<0&&(t+=360),t),hn=t=>Math.hypot(t[0],t[1]),dn=t=>Math.hypot(t[4],t[5]),pn={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:hn,scaleY:dn,scaleZ:t=>Math.hypot(t[8],t[9],t[10]),scale:t=>(hn(t)+dn(t))/2,rotateX:t=>un(an(Math.atan2(t[6],t[5]))),rotateY:t=>un(an(Math.atan2(-t[2],t[0]))),rotateZ:cn,rotate:cn,skewX:t=>an(Math.atan(t[4])),skewY:t=>an(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function fn(t){return t.includes("scale")?1:0}function mn(t,e){if(!t||"none"===t)return fn(e);const n=t.match(/^matrix(3d)?\(([-\d.e\s,]+)\)$/u);if(!n)return fn(e);const i=(n[1]?pn:ln)[e],s=n[2].split(",").map(t=>parseFloat(t));return"function"==typeof i?i(s):s[i]}const gn=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return mn(n,e)},yn=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","scaleZ","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],vn=(()=>new Set([...yn,"pathRotation"]))(),xn=t=>t===ft||t===Ct,wn=new Set(["x","y","z"]),bn=yn.filter(t=>!wn.has(t));const Sn=new Set(["bottom","right"]);function Tn(t,e,n,i,s,o){const r=parseFloat(t);if(!isNaN(r))return r;const{min:a,max:c}=e()[n],l=c-a;return"border-box"===o?l:l-parseFloat(i)-parseFloat(s)}const Pn=({transform:t})=>mn(t,"x"),An=({transform:t})=>mn(t,"y"),En={width:({width:t,paddingLeft:e="0",paddingRight:n="0",boxSizing:i},s)=>Tn(t,s,"x",e,n,i),height:({height:t,paddingTop:e="0",paddingBottom:n="0",boxSizing:i},s)=>Tn(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:Pn,y:An,translateX:Pn,translateY:An},Mn=new Set;let Cn=!1,Vn=!1,kn=!1;function Dn(){if(Vn){const t=[],e=new Set,n=new Set;Mn.forEach(i=>{i.needsMeasurement&&(t.push(i),e.add(i.element),Sn.has(i.name)&&n.add(i.element))});const i=new Map;n.forEach(t=>{const e=function(t){const e=[];return bn.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)})}Vn=!1,Cn=!1,Mn.forEach(t=>t.complete(kn)),Mn.clear()}function Rn(){Mn.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Vn=!0)})}function Ln(){kn=!0,Rn(),Dn(),kn=!1}class On{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?(Mn.add(this),Cn||(Cn=!0,le.read(Rn),le.resolveKeyframes(Dn))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:i}=this;if(null===t[0]){const s=i?.get(),o=t[t.length-1];if(void 0!==s)t[0]=s;else if(n&&e){const i=function(t,e,n){if("string"==typeof t){if(P(t)||E(t))return parseFloat(t);if(!zt.test(t)&&zt.test(n))return on(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])}rn(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Mn.delete(this)}cancel(){"scheduled"===this.state&&(Mn.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const Bn=t=>t.startsWith("--");function In(t,e,n){Bn(e)?t.style.setProperty(e,n):t.style[e]=n}const jn={};function Fn(t,e){const n=M(t);return()=>jn[e]??n()}const Wn=Fn(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),Un=Fn(()=>void 0!==window.ViewTimeline,"viewTimeline"),Nn=Fn(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),$n=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,zn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:$n([0,.65,.55,1]),circOut:$n([.55,0,1,.45]),backIn:$n([.31,.01,.66,-.59]),backOut:$n([.33,1.53,.69,.99])};function Kn(t,e){return t?"function"==typeof t?Nn()?pe(t,e):"ease-out":tt(t)?$n(t):Array.isArray(t)?t.map(t=>Kn(t,e)||zn.easeOut):zn[t]:void 0}function Yn(t,e,n,{delay:i=0,duration:s=300,repeat:o=0,repeatType:r="loop",ease:a="easeOut",times:c}={},l=void 0){const u={[e]:n};c&&(u.offset=c);const h=Kn(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 l&&(d.pseudoElement=l),t.animate(u,d)}function Hn(t){return"function"==typeof t&&"applyToOptions"in t}function Xn({type:t,...e}){return Hn(t)&&Nn()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class Gn extends ze{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:n,keyframes:i,pseudoElement:s,allowFlatten:o=!1,finalKeyframe:r,onComplete:a}=t;this.isPseudoElement=Boolean(s),this.allowFlatten=o,this.options=t;const c=Xn(t);this.animation=Yn(e,n,i,c,s),!1===c.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const t=je(i,this.options,r,this.speed);this.updateMotionValue?.(t),In(e,n,t),this.animation.cancel()}a?.(),this.notifyFinished()},$e(this,t,c)}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){this.isStopped||(this.isStopped=!0,"idle"!==this.state&&null===this.finishedTime&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||(this.animation.onfinish=null,this.cancel())))}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return L(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+L(t)}get time(){return L(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=R(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&&Wn()?(this.animation.timeline=t,e?.(this.animation),C):n(this)}}const _n={anticipate:Y,backInOut:K,circInOut:G};function qn(t){"string"==typeof t.ease&&t.ease in _n&&(t.ease=_n[t.ease])}const Zn=10;class Jn extends Gn{constructor(t){qn(t),We(t),super(t),void 0!==t.startTime&&!1!==t.autoplay&&(this.startTime=t.startTime),this.options=t}elapsed(){return"running"===this.state?(rt.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 He({...r,autoplay:!1}),this.sampler.stop()}return this.sampler.sample(Math.max(0,t)).value}liveValue(){const{state:t}=this;if("running"===t||"paused"===t)return this.sample(this.elapsed())}updateMotionValue(t){const{motionValue:e,element:n,name:i}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const{speed:s}=this,o=this.elapsed(),r="running"===this.state&&s?S(0,10,o):0,a=this.sample(o);n&&i&&In(n,i,a),e.setWithVelocity(this.sample(o-r*Math.sign(s)),a,r/Math.abs(s||1))}}const Qn=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!zt.test(t)&&"0"!==t||t.startsWith("url(")));function ti(t){t.duration=0,t.type="keyframes"}const ei=new Set(["opacity","clipPath","filter","transform"]),ni=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;const ii=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),si=()=>!T.useManualTiming&&Object.hasOwnProperty.call(Element.prototype,"animate");function oi(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:o,type:r,keyframes:a}=t;if(!n||!ei.has(n)&&!ii.has(n))return!1;const c=e?.owner?.current;if(!(c instanceof HTMLElement||c instanceof SVGElement))return!1;const{onUpdate:l,transformTemplate:u}=e.owner.getProps();return si()&&(ei.has(n)||ii.has(n)&&function(t){for(let e=0;e<t.length;e++)if("string"==typeof t[e]&&ni.test(t[e]))return!0;return!1}(a))&&("transform"!==n||!u)&&!l&&!i&&"mirror"!==s&&0!==o&&"inertia"!==r}const ri=(t,e)=>e&&"number"==typeof t?e.transform(t):t,ai={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ci=yn.length,li={},ui=(t,e,n=ri(e,Qe[t]))=>(li[t]||(li[t]=(ai[t]||t)+"("))+n+")",hi=(t,e)=>("number"==typeof e?e:parseFloat(e))===(t.startsWith("scale")?1:0);function di(t,e,n){let i="";for(let s=0;s<ci;s++){const o=yn[s],r=t[o];if(void 0===r)continue;const a=n&&(e[o]=ri(r,tn[o]));hi(o,r)||(i+=ui(o,r,a||void 0)+" ")}const s=t.pathRotation;return s&&(i+=ui("rotate",s)),i=i.trim(),n?n(e,i):i||"none"}const pi=new WeakMap,fi=.001,mi=(t,e)=>t-e,gi=(t,e,n)=>{const i=[];for(let s=0;s<=n;s++)i.push(Xt(t,e,s/n));return i},yi=t=>t.motionValue.owner,vi=t=>pi.get(t),xi=(t,e)=>t.latestValues?t.latestValues[e]:t.getValue(e)?.get();class wi extends He{constructor(t){const e=yi(t).current,{driver:n=de}=t;let i;const s=function(t){const e=yi(t),{onUpdate:n,transformTemplate:i}=e.getProps();return!(t.isHandoff||n||t.hasOnUpdate||i||"inertia"===t.type||"none"!==(xi(e,"transform")||"none")||xi(e,"pathRotation")||e.projection?.isProjecting())}(t);t.driver=t=>{const s=n(t);return{js:s,now:s.now,start:(t=!0)=>{const n=vi(e);!n||n.isJS?s.start(t):n.schedule(!1,!t)},stop:()=>{s.stop();const t=vi(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 vi(yi(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(rt.now()):void 0}tween(){const{keyframes:t,type:e,ease:n,times:i,repeat:s,delay:o=0}=this.options,r=tt(n)?$n(n):(t=>/^(linear|ease(In|Out|InOut))$/.test(t))(n)&&zn[n];if(r&&!s&&!i&&2===t.length&&e===Oe&&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:c=0,repeatType:l,times:u,keyframes:h,type:d}=o,p=(d||Oe)===Oe?u||De(h):[0,1],f=n+r/i,m=[];if(null!==this.holdTime||!(s>0))return m;for(let n=Math.max(0,Math.floor((t-f)*i/s));n<=a;n++){const o=f+n*s/i;if(o>e)break;for(const r of p){const a=o+(n%2&&l&&"loop"!==l?1-r:r)*(s-c)/i;a>t&&a<e&&m.push(a)}}return m}numberAt(t){return parseFloat(this.sampleAt(t,!0))}sync(){const t=rt.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=[],c=!1,l=!1,u=!1,h=!1,d=-1/0;const p=t=>{for(const e of n)if(e.name===t)return!0},f=(e,n)=>{const r={};for(const a of void 0===e?yn:o){const o=i.get(a),c=void 0===e?xi(t,a):o?o.sampleAt(n>e&&!o.timing()[1]?n:e):s[a];void 0!==c&&(r[a]=c)}return r},m=(t,e)=>{let n="";for(const i in t){const s=t[i];e&&hi(i,s)||(n+=ui(i,s)+" ")}return(e?n.trim():n)||"none"},g=(t,e)=>m(f(t,e)),y=(t=f())=>{e.style.transform=m(t,!0)},v=(t=!0)=>{t&&y(),a.forEach(({animation:t})=>t.cancel()),a=[]},x=(t,n)=>new Animation(new KeyframeEffect(e,t,n)),w=(t,e,n=1/0)=>{const i={animation:t,offset:e,end:n};t.startTime=rt.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)),D.schedule(!1)}),t.oncancel=()=>a.includes(i)&&D.demote(),a.push(i)},b=(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]:[]},S=(t,e,n,i)=>{const s=Math.min(200,Math.max(2,Math.ceil((n-e)/Zn)));if(4*i.length>s)return;const o=gi(e,n,s).concat(i).sort(mi),r=t=>k(e,n,t);let a,c;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)*fi>Math.abs(s))?0:s,l=i.map(t=>r?t/r:t);if(r)if(a){if(l.some((t,e)=>!(Math.abs(t-a[e])<=fi)))return}else a=l,c=t=>(e.numberAt(t)-n)/r;else if(l.some(t=>!(Math.abs(t)<=fi)))return}if(!a||a.every((t,e)=>Math.abs(t-r(o[e]))<=fi))return"linear";const l=[],u=(t,e=c(t))=>l.push(Ye(e)+" "+Ye(100*r(t))+"%");return a.forEach((t,e)=>{e&&Math.abs(t-a[e-1])>.2&&b(c,o[e-1],o[e]).forEach(t=>u(t)),u(o[e],t)}),"linear("+l+")"},T=(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(...b(t=>i.numberAt(t),e,n));s.push(n)}},a=gi(e,n,Math.ceil((n-e)/100));for(const t of i)a.push(t,Math.min(t+.01,n));let c=e;for(const t of a.sort(mi))t>c&&r(c,t,0),c=t;return s.sort(mi)},P=t=>{let e;for(const n of t){const t=n.tween();if(!t||e?.some((e,n)=>n<2?Math.abs(t[n]-e)>1:t[n]!==e))return;e=t}return e},A=(t,e,n,i={fill:"both"},s,o)=>{const r=t.flatMap(t=>t.boundaries(e,n)),a=o||S(t,e,n,r),c=a?[e,n]:T(t,e,n,r),l=c.map(t=>g(t,s));let u={transform:l};return a||(u.offset=c.map(t=>k(e,n,t))),l.every(t=>t===l[0])&&(y(f(e,s)),u=null),x(u,{...i,duration:n-e,easing:a||"linear"})},E=e=>{let c=e,l=0,u=0;const h=[],d=[],p=new Set;i.clear(),r=new Map;for(const t of n){i.set(t.name,t);const[n,s]=t.timing(),o=n===1/0;if(r.set(t,[t.at(e),t.speed,o]),o)t.sync();else{if(t.speed<0)return;if(s){if(l){const t=(n-u)/s;if(Math.abs(s-l)>1||Math.abs(t-Math.round(t))*l>1)return}else l=s,u=n;d.push(t)}else p.add(n);h.push(t),c=Math.max(c,n)}}s={},o=yn.filter(e=>{if(i.has(e))return!0;const n=s[e]=xi(t,e);return void 0!==n&&parseFloat(n)!==(e.startsWith("scale")?1:0)}),v(!1);const f=!l&&P(h);try{if(f&&f[1]>e){const[t,n,i]=f;w(A(h,t,n,void 0,void 0,i),t-e,n-t)}else c>e&&(w(A(h,e,c),0,c-e),p.forEach(t=>t<c-1&&w(x(null,{duration:t-e}),0,t-e)));if(l){const t=u+Math.floor((c-u)/l)*l;w(A(d,t,t+l,{iterations:1/0,iterationStart:(c-t)/l,fill:"forwards"},c),c-e)}}catch{return}return a.length||v(),!0},M=t=>{let e,i=0;for(const s of n){const n=r.get(s);if(!n)return!1;const[o,a,c]=n,l=s.at(t),u=s.timing()[0]===1/0;if(c){if(u&&l===o)continue;return!1}const h=(l-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.updatePlaybackRate&&"running"===n.playState&&Math.abs(Number(n.currentTime)-r)<20?n.playbackRate!==i&&n.updatePlaybackRate(i):i?(n.playbackRate=i,n.startTime=t-r/i):(n.startTime=null,n.currentTime=r)}return!0},C=()=>!n.size&&(u=!0,vi(e)===D&&pi.delete(e),D.isJS||v(),!0),V=()=>{const e=rt.now();if(D.isJS||(D.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]=xi(t,n.name),r.has(n)||(c=!0))}),D.isFinishing=!1),l=!1,u)return;if(n.forEach(({state:t},e)=>{"idle"!==t&&"finished"!==t||n.delete(e)}),C())return;for(const t of n)if(!t.canAccelerate)return D.demote(!0);D.isJS&&(D.isJS=!1,c=!0,n.forEach(t=>t.js?.stop()));const i=c,o=h;if(c=h=!1,i||!M(e)){if(o){if(e-d<100)return D.demote();d=e}if(!E(e))return D.demote()}},D={tracks:n,isJS:!1,isFinishing:!1,schedule(t,e){u||(c||(c=t),h||(h=!!e),l||(l=!0,it.isProcessing?le.render(V,!1,!0):queueMicrotask(V)))},release(t){const{state:e}=t;"idle"!==e&&"finished"!==e||n.delete(t),C()||D.schedule(!0)},check(){if(!D.isJS)for(const e in s)if(xi(t,e)!==s[e]&&!p(e))return D.schedule(!0,!0)},demote(t){D.isJS||u||(n.forEach(e=>{e.isAccelerated()&&e.sync(),t||(e.canAccelerate=!1)}),D.isJS=!0,r=new Map,v(),n.forEach(t=>"running"===t.state&&t.js?.start()))}};return pi.set(e,D),D}(yi(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(rt.now())}get time(){return this.isAccelerated()?L(S(0,this.totalDuration,this.at(rt.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 bi extends ze{constructor(t){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=rt.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||On;this.keyframeResolver=new r(e,(t,e,n)=>this.onKeyframesResolved(t,e,o,!n),n,i,s),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,e,n,i){this.keyframeResolver=void 0;const{name:s,type:o,velocity:r,delay:a,isHandoff:c,onUpdate:l}=n;this.resolvedAt=rt.now();const u=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=Qn(s,e),a=Qn(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||Hn(n))&&i)}(t,s,o,r);u||(!T.instantAnimations&&a||l?.(je(t,n,e)),t[0]=t[t.length-1],ti(n),n.repeat=0);const{onComplete:h}=n;n.finalKeyframe=e,n.keyframes=t,n.onComplete=()=>{h?.(),this.notifyFinished()};const d=u&&!c&&oi(n),p=!d&&(({name:t,motionValue:e})=>t&&yn.includes(t)&&e?.owner?.current instanceof HTMLElement&&si()&&Nn())(n);let f;if(i&&(d||p||this.resolvedAt!==this.createdAt)&&(n.startTime??(n.startTime=Ue(this.createdAt,this.resolvedAt))),d){n.element=n.motionValue?.owner?.current;try{f=new Jn(n)}catch{f=new He(n)}}else f=p?new wi(n):new He(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(),Ln()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation?.cancel(),this.keyframeResolver?.cancel()}}class Si{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 Ti(this.animations,"duration")}get iterationDuration(){return Ti(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 Ti(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 Pi extends Si{then(t,e){return this.finished.finally(t).then(()=>{})}}class Ai extends Gn{constructor(t){super(),this.animation=t,t.onfinish=()=>{this.finishedTime=this.time,this.notifyFinished()},$e(this,{})}}const Ei=new WeakMap,Mi=(t,e="")=>`${t}:${e}`;function Ci(t){let e=Ei.get(t);return e||(e=new Map,Ei.set(t,e)),e}function Vi(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 ki={current:void 0};class Di{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=rt.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.dirty(),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=rt.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 D)).add(e)}onChangeSubscribe(t){const{events:e}=this;return e.change||this.changeSubscriber?(e.change||(e.change=new D,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(){le.read(()=>{this.changeSubscriber||this.events.change?.getSize()||this.stop()})}clearListeners(){this.changeSubscriber=void 0;for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect?.()}dirty(){const{current:t,changeSubscriber:e}=this;e?e(t):this.events.change?.notify(t)}addDependent(t){(this.dependents||(this.dependents=new Set)).add(t)}removeDependent(t){this.dependents?.delete(t)}get(){ki.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=rt.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return O(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0;let n,i=!1;n=t(()=>{i=!0,this.events.animationComplete?.notify(),this.animation===n&&(this.animation=void 0),e()}),i||(this.animation=n),this.events.animationStart?.notify()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel?.notify()),this.animation=void 0}isAnimating(){return!!this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect?.()}}function Ri(t,e){return new Di(t,e)}function Li(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}function Oi(t,e){const n=t?.[e]??t?.default??t;return n!==t?Li(n,t):n}const Bi={type:"spring",stiffness:500,damping:25,restSpeed:10},Ii={type:"keyframes",duration:.8},ji={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Fi=(t,{keyframes:e})=>e.length>2?Ii:vn.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Bi:ji,Wi=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed","out"]);function Ui(t){for(const e in t)if(!Wi.has(e))return!0;return!1}const Ni=(t,e,n,i={},s,o)=>r=>{const a=Oi(i,t)||{},c=a.delay||i.delay||0;let{elapsed:l=0}=i;l-=R(c);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-l,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:o?void 0:s,hasOnUpdate:!!a.onUpdate};Ui(a)||Object.assign(u,Fi(t,u)),u.duration&&(u.duration=R(u.duration)),u.repeatDelay&&(u.repeatDelay=R(u.repeatDelay)),void 0!==u.from&&(u.keyframes[0]=u.from);let h=!1;if((!1===u.type||0===u.duration&&!u.repeatDelay)&&(ti(u),0===u.delay&&(h=!0)),(T.instantAnimations||T.skipAnimations||s?.shouldSkipAnimations||a.skipAnimations)&&(h=!0,ti(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,h&&!o&&void 0!==e.get()){const t=je(u.keyframes,a);if(void 0!==t)return void le.update(()=>{u.onUpdate(t),u.onComplete()})}return a.isSync?new He(u):new bi(u)};function $i(t,e,n,i){const s=1-t;return s*s*e+2*s*t*n+t*t*i}function zi(t,e,n,i,s,o,r){const a=2*(1-t)*(n-e)+2*t*(i-n),c=2*(1-t)*(o-s)+2*t*(r-o);return Math.atan2(c,a)*(180/Math.PI)}function Ki(t,e,n,i,s,o){const r=n-t,a=i-e,c=Math.sqrt(r*r+a*a);if(c>0){const n=s*c;return{x:t+r*o+-a/c*n,y:e+a*o+r/c*n}}return{x:t,y:e}}const Yi=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Hi(t){const e=Yi.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n??i}`,s]}function Xi(t,e,n=1){const[i,s]=Hi(t);if(!i)return;const o=window.getComputedStyle(e).getPropertyValue(i);if(o){const t=o.trim();return P(t)?parseFloat(t):t}return ht(s)?Xi(s,e,n+1):s}function Gi(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 _i(t,e,n){return Gi(t.getProps(),e,n,t)}const qi=(t,e)=>"exit"===e?t.presenceContext?.custom:void 0,Zi=new Set(["width","height","top","left","right","bottom",...yn]),Ji=t=>Array.isArray(t);function Qi(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Ri(n))}function ts(t){return Ji(t)?t[t.length-1]||0:t}function es(t,e){const n=_i(t,e);let{transitionEnd:i={},transition:s={},...o}=n||{};o={...o,...i};for(const e in o){Qi(t,e,ts(o[e]))}}const ns=t=>Boolean(t&&t.getVelocity);function is(t){return Boolean(ns(t)&&t.add)}function ss(t,e){const n=t.getValue("willChange");if(is(n))return n.add(e);if(!n&&T.WillChange){const n=new T.WillChange("auto");t.addValue("willChange",n),n.add(e)}}const os="framerAppearId",rs="data-framer-appear-id";function as(t){return t.props[rs]}const cs="undefined"!=typeof window;function ls({protectedKeys:t,needsAnimating:e},n){const i=n in t&&!e[n];return e[n]=!1,i}function us(t,e,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:o,transitionEnd:r,...a}=e;const c=t.getDefaultTransition();o=o?Li(o,c):c;const l=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&&ls(d,e))continue;const r={delay:n,...Oi(d?.out[e]||o||{},e)};u&&(r.skipAnimations=!0);const c=i.get();if(void 0!==c&&!i.isAnimating()&&!Array.isArray(s)&&s===c&&!r.velocity){le.update(()=>i.set(s));continue}let p=!1;if(cs&&window.MotionHandoffAnimation){const n=as(t);if(n){const t=window.MotionHandoffAnimation(n,e,le);null!==t&&(r.startTime=t,p=!0)}}ss(t,e);const f=l??t.shouldReduceMotion;i.start(Ni(e,i,s,f&&Zi.has(e)?{type:!1}:r,t,p));const m=i.animation;m&&h.push(m)}if(r){const e=()=>le.update(()=>{r&&es(t,r)});h.length?Promise.all(h).then(e):e()}return h}function hs(t,e,n={}){const i=_i(t,e,qi(t,n.type)),s=n.transitionOverride||(i?.transition??(t.getDefaultTransition()||{})),o=()=>Promise.all(i?us(t,i,n):[]),r=(i=0)=>{const{variantChildren:o}=t,{delayChildren:r=0,staggerChildren:a,staggerDirection:c}=s,l=[];return o?.forEach(t=>{t.notify("AnimationStart",e),l.push(hs(t,e,{...n,delay:i+("function"==typeof r?0:r)+Vi(o,t,r,a,c)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(l)},{when:a}=s;return a?"beforeChildren"===a?o().then(()=>r()):r().then(o):Promise.all([o(),r(n.delay)])}function ds(t,e,n={}){t.notify("AnimationStart",e);return(Array.isArray(e)?Promise.all(e.map(e=>hs(t,e,n))):"string"==typeof e?hs(t,e,n):Promise.all(us(t,_i(t,e,n.custom),n))).then(()=>{t.notify("AnimationComplete",e)})}const ps=t=>e=>e.test(t),fs=[ft,Ct,Mt,Et,kt,Vt,{test:t=>"auto"===t,parse:t=>t}],ms=t=>fs.find(ps(t));function gs(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||E(t))}const ys=new Set(["auto","none","0"]);class vs extends On{constructor(){super(...arguments),this.isAsync=!0}scheduleResolve(){if(this.canReadNow()&&(this.readKeyframes(),!this.needsMeasurement))return this.complete();super.scheduleResolve()}canReadNow(){const{unresolvedKeyframes:t,element:e,motionValue:n}=this,i=t[0]??n?.get();if(!e?.current||void 0===i)return!1;for(let e=0;e<t.length;e++)if(pt(e?t[e]:i))return!1;return!0}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e?.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){let i=t[n];if("string"==typeof i&&(i=i.trim(),ht(i))){const s=Xi(i,e.current);void 0!==s&&(t[n]=s),n===t.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!Zi.has(n)||2!==t.length)return;const[i,s]=t;if("number"==typeof i&&"number"==typeof s)return;const o=ms(i),r=ms(s);if(pt(i)!==pt(s)&&En[n])this.needsMeasurement=!0;else if(o!==r)if(xn(o)&&xn(r))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else En[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)(null===t[e]||gs(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&&!ys.has(e)&&Wt(e)&&(i=t[s]),s++}if(i&&n)for(const s of e)t[s]!==i&&(t[s]=on(n,i))}(t,n,e)}measure(){const{element:t,name:e}=this;return En[e](window.getComputedStyle(t.current),()=>t.measureViewportBox())}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t?.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),e[0]=this.measuredOrigin;const i=e[e.length-1];void 0!==i&&this.motionValue?.jump(i,!1)}measureEndState(){const{element:t,unresolvedKeyframes:e}=this;if(!t?.current)return;this.motionValue?.jump(this.measuredOrigin,!1);const n=e.length-1,i=e[n];e[n]=this.measure(),null!==i&&void 0===this.finalKeyframe&&(this.finalKeyframe=i),this.resolveNoneKeyframes()}}const xs=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],ws=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius",...xs,"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 bs(t,e){for(let n=0;n<t.length;n++)"number"==typeof t[n]&&ws.has(e)&&(t[n]=t[n]+"px")}const Ss=M(()=>{try{document.createElement("div").animate({opacity:[1]})}catch(t){return!1}return!0}),Ts=[];function Ps(t){As(t),Ts.unshift(t)}function As(t){w(Ts,t)}function Es(t){return Ts.find(e=>e.test(t))}function Ms(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 c=e[r];if(void 0===c)continue;const l=t(r),u=l.get();void 0===u||l.isAnimating()||Array.isArray(c)||c!==u||o?(l.start(Ni(r,l,c,a&&Zi.has(r)?{type:!1}:n,i)),l.animation&&s.push(l.animation)):le.update(()=>l.set(c))}const{transitionEnd:c}=e;if(c){const e=()=>le.update(()=>{for(const e in c)t(e).set(c[e])});s.length?Promise.all(s).then(e):e()}return s}function Cs(t,e,n,i,s){return Ms(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=Ri(r,{owner:s}),t(e,{[i]:o})}return o},n,i,s)}function Vs(t){return A(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}function ks(t){return A(t)&&"ownerSVGElement"in t}const Ds={};function Rs(t){return Ds.current?.add(t),t}function Ls(t){const e=Ds.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 Os=t=>Ds.current?Ds.current.bind(t):t;function Bs(t,e,n){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){const i=e?e.current:Ds.current?.root||document,s=n?.[t]??i.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t).filter(t=>null!=t)}function Is(t){const{test:e,read:n,get:i,flush:s,state:o}=t;return Object.assign((e,n)=>{const i=Bs(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 js{constructor(t=le.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 Fs(t,{step:e,...n}={}){const i=new WeakMap;return Object.assign((n,s)=>{const o=i.get(n)??new js(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 Ws=new Set(["originX","originY","originZ"]),Us=(t,e)=>ri(t.get(e)?.get(),tn[e]),Ns=(t,e,n,i)=>{let s,o;if(vn.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)=>yn.indexOf(t)-yn.indexOf(e)))}e.get("transform")||(Vs(t)||e.get("transformBox")||Ns(t,e,"transformBox",new Di("fill-box")),e.set("transform",new Di("none"),()=>{pi.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&&(hi(s,o)||(e+=(e&&" ")+ui(s,o)))}const s=t.get("pathRotation")?.get();return s&&(e+=(e&&" ")+ui("rotate",s)),e||"none"}(e)})),o=e.get("transform")}else Ws.has(n)?(e.get("transformOrigin")||e.set("transformOrigin",new Di(""),()=>{const n=Us(e,"originX")??"50%",i=Us(e,"originY")??"50%",s=Us(e,"originZ")??0;t.style.transformOrigin=`${n} ${i} ${s}`}),o=e.get("transformOrigin")):s=Bn(n)?()=>{t.style.setProperty(n,i.getCurrent())}:()=>{t.style[n]=ri(i.getCurrent(),tn[n])};return e.set(n,i,s,o)},$s=(t,e)=>{if(vn.has(e))return gn(t,e);const n=getComputedStyle(t),i=Bn(e)?n.getPropertyValue(e):n[e];return"string"==typeof i&&i.trim()||0},zs=Fs(Ns,{test:t=>Vs(t)||ks(t),read:$s}),Ks=Is(zs);function Ys(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}function Hs(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(vn.has(t))r=!0;else if(lt(t))s[t]=n;else{const e=ri(n,tn[t]);t.startsWith("origin")?(a=!0,o[t]=e):i[t]=e}}if(e.transform||(r||n?i.transform=di(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 Xs={offset:"stroke-dashoffset",array:"stroke-dasharray"},Gs={offset:"strokeDashoffset",array:"strokeDasharray"};function _s(t,e,n=1,i=0,s=!0){t.pathLength=1;const o=s?Xs:Gs;t[o.offset]=""+-i,t[o.array]=`${e} ${n}`}const qs=["transform","opacity","clipPath","filter","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Zs(t,{attrX:e,attrY:n,attrScale:i,pathLength:s,pathSpacing:o=1,pathOffset:r=0,...a},c,l,u){if(Hs(t,a,l),c)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 qs)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&&_s(h,s,o,r,!1)}const Js=(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=Ys(s));const r=tn[n]||tn[s],a=o?()=>{t[s]=ri(i.get(),tn[n])}:()=>{const e=ri(i.get(),r);null==e?t.removeAttribute(s):t.setAttribute(s,String(e))};return e.set(n,i,a)},Qs=Is(Fs(Js));const to=(t,e,n,i)=>{if(n.startsWith("path")&&!vn.has(n))return function(t,e,n,i){return le.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 Di("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 Js(t,e,n,i,so(n));return(vn.has(n)||Ws.has(n)||Bn(n)||n in t.style?Ns:Js)(t,e,n,i)},eo=(t,e)=>vn.has(e)?tn[e]?.default||0:Bn(e)||qs.includes(e)?$s(t,e)||t.getAttribute(Ys(e))||0:(e=so(e),t.getAttribute(Ys(e))??t.getAttribute(e)??void 0),no=Fs(to,{test:ks,read:eo}),io=Is(no);function so(t){return t.replace(/^attr([A-Z])/,(t,e)=>e.toLowerCase())}function oo({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function ro({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function ao(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 co(t){return void 0===t||1===t}function lo({scale:t,scaleX:e,scaleY:n}){return!co(t)||!co(e)||!co(n)}const uo=["rotate","rotateX","rotateY","rotateZ","skewX","skewY"];function ho(t){return lo(t)||fo(t)||po(t)}function po(t){return t.z||t.rotate||t.rotateX||t.rotateY||t.rotateZ||t.skewX||t.skewY}function fo(t){return mo(t.x)||mo(t.y)}function mo(t){return t&&"0%"!==t}function go(t,e,n){return n+e*(t-n)}function yo(t,e,n,i,s){return void 0!==s&&(t=go(t,s,i)),go(t,n,i)+e}function vo(t,e=0,n=1,i,s){t.min=yo(t.min,e,n,i,s),t.max=yo(t.max,e,n,i,s)}function xo(t,{x:e,y:n}){vo(t.x,e.translate,e.scale,e.originPoint),vo(t.y,n.translate,n.scale,n.originPoint)}const wo=.999999999999,bo=1.0000000000001;function So(t,e,n,i=!1){const s=n.length;if(!s)return;let o,r;e.x=e.y=1;for(let a=0;a<s;a++)o=n[a],r=o.projectionDelta,"contents"!==o.options.visualElement?.props.style?.display&&(!0===i&&o.options.layoutScroll&&o.scroll&&o!==o.root&&(To(t.x,-o.scroll.offset.x),To(t.y,-o.scroll.offset.y)),r&&(e.x*=r.x.scale,e.y*=r.y.scale,xo(t,r)),i&&(i.path?.[a]||i)!==o&&ho(o.latestValues)&&Eo(t,o.latestValues,o.layout?.layoutBox));e.x<bo&&e.x>wo&&(e.x=1),e.y<bo&&e.y>wo&&(e.y=1)}function To(t,e){t.min+=e,t.max+=e}function Po(t,e,n,i,s=.5){vo(t,e,n,Xt(t.min,t.max,s),i)}function Ao(t,e){return"string"==typeof t?parseFloat(t)/100*(e.max-e.min):t}function Eo(t,e,n){const i=n??t;Po(t.x,Ao(e.x,i.x),e.scaleX,e.scale,e.originX),Po(t.y,Ao(e.y,i.y),e.scaleY,e.scale,e.originY)}function Mo(t,e){return oo(ao(t.getBoundingClientRect(),e))}function Co(t,e,n){const i=Mo(t,n),{scroll:s}=e;return s&&(To(i.x,s.offset.x),To(i.y,s.offset.y)),i}const Vo={},ko=t=>ks(t)?no:zs;class Do{constructor(t,e){this.effect=t,this.current=e,this.KeyframeResolver=vs}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 Mo(this.current)}getProps(){return Vo}}function Ro(t,e,n,i){if(Ds.current?.track(t),i)return Ms(t=>i.getValue(t,null),e,n,i);const s=ko(t);return Cs(s,t,e,n,new Do(s,t))}const Lo=t=>ko(t).state(t)?.release();function Oo(t,e){const n=ko(t).state(t);if(!n)return;const i=pi.get(t);i&&(i.demote(),pi.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 Bo=Fs((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:Io,cancel:jo}=ce(queueMicrotask,!1);function Fo(t,e,n){const i=ns(t)?t:Ri(t);return i.start(Ni("",i,e,n)),i.animation}const Wo={};const Uo={value:null,addProjectionMetrics:null};function No(t,e){const n=rt.now();t=Os(t);const i=({timestamp:s})=>{const o=s-n;o>=e&&(ue(i),t(o-e))};return le.setup(i,!0),Rs(()=>ue(i))}function $o(t){return ks(t)&&"svg"===t.tagName}function zo(t){return ns(t)?t.get():t}const Ko=t=>"number"==typeof t?t:parseFloat(t),Yo=xs.length,Ho=t=>"number"==typeof t||Ct.test(t);function Xo(t,e,n,i,s,o){s?(t.opacity=Xt(0,n.opacity??1,_o(i)),t.opacityExit=Xt(e.opacity??1,0,qo(i))):o&&(t.opacity=Xt(e.opacity??1,n.opacity??1,i));for(let s=0;s<Yo;s++){const o=xs[s];let r=Go(e,o),a=Go(n,o);if(void 0===r&&void 0===a)continue;r||(r=0),a||(a=0);0===r||0===a||Ho(r)===Ho(a)?(t[o]=Math.max(Xt(Ko(r),Ko(a),i),0),(Mt.test(a)||Mt.test(r))&&(t[o]+="%")):t[o]=a}for(let s=0;s<uo.length;s++){const o=uo[s];(e[o]||n[o])&&(t[o]=Xt(e[o]||0,n[o]||0,i))}}function Go(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const _o=Zo(0,.5,X),qo=Zo(.5,.95,C);function Zo(t,e,n){return i=>i<t?0:i>e?1:n(k(t,e,i))}function Jo(t,e){t.min=e.min,t.max=e.max}function Qo(t,e){Jo(t.x,e.x),Jo(t.y,e.y)}function tr(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function er(t){return t.max-t.min}function nr(t,e,n){return Math.abs(t-e)<=n}function ir(t,e,n,i=.5){t.origin=i,t.originPoint=Xt(e.min,e.max,t.origin),t.scale=er(n)/er(e),t.translate=Xt(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 sr(t,e,n,i){ir(t.x,e.x,n.x,i?.originX),ir(t.y,e.y,n.y,i?.originY)}function or(t,e,n,i=0){const s=i?Xt(n.min,n.max,i):n.min;t.min=s+e.min,t.max=t.min+er(e)}function rr(t,e,n,i){or(t.x,e.x,n.x,i?.x),or(t.y,e.y,n.y,i?.y)}function ar(t,e,n,i=0){const s=i?Xt(n.min,n.max,i):n.min;t.min=e.min-s,t.max=t.min+er(e)}function cr(t,e,n,i){ar(t.x,e.x,n.x,i?.x),ar(t.y,e.y,n.y,i?.y)}function lr(t,e,n,i,s){return t=go(t-=e,1/n,i),void 0!==s&&(t=go(t,1/s,i)),t}function ur(t,e=0,n=1,i=.5,s,o=t,r=t){if(Mt.test(e)){e=parseFloat(e);e=Xt(r.min,r.max,e/100)-r.min}if("number"!=typeof e)return;let a=Xt(o.min,o.max,i);t===o&&(a-=e),t.min=lr(t.min,e,n,a,s),t.max=lr(t.max,e,n,a,s)}function hr(t,e,[n,i,s],o,r){ur(t,e[n],e[i],e[s],e.scale,o,r)}const dr=["x","scaleX","originX"],pr=["y","scaleY","originY"];function fr(t,e,n,i){hr(t.x,e,dr,n?.x,i?.x),hr(t.y,e,pr,n?.y,i?.y)}const mr=()=>({translate:0,scale:1,origin:0,originPoint:0}),gr=()=>({x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}),yr=()=>({min:0,max:0}),vr=()=>({x:{min:0,max:0},y:{min:0,max:0}});function xr(t){return 0===t.translate&&1===t.scale}function wr(t){return xr(t.x)&&xr(t.y)}function br(t,e){return t.min===e.min&&t.max===e.max}function Sr(t,e){return br(t.x,e.x)&&br(t.y,e.y)}function Tr(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Pr(t,e){return Tr(t.x,e.x)&&Tr(t.y,e.y)}function Ar(t){return er(t.x)/er(t.y)}function Er(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class Mr{constructor(){this.members=[]}add(t){x(this.members,t);for(let e=this.members.length-1;e>=0;e--){const n=this.members[e];if(n===t||n===this.lead||n===this.prevLead)continue;const i=n.instance;i&&!1!==i.isConnected||n.snapshot||(w(this.members,n),n.unmount())}t.scheduleRender()}remove(t){if(w(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 Cr(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`${Cr(t,e.target.x)}% ${Cr(t,e.target.y)}%`}},kr={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=zt.parse(t);if(s.length>5)return i;const o=zt.createTransformer(t),r="number"!=typeof s[0]?1:0,a=n.x.scale*e.x,c=n.y.scale*e.y;s[0+r]/=a,s[1+r]/=c;const l=Xt(a,c,.5);return"number"==typeof s[2+r]&&(s[2+r]/=l),"number"==typeof s[3+r]&&(s[3+r]/=l),o(s)}},Dr={borderRadius:Object.assign({},Vr,{applyTo:xs.slice()}),borderTopLeftRadius:Vr,borderTopRightRadius:Vr,borderBottomLeftRadius:Vr,borderBottomRightRadius:Vr,boxShadow:kr};function Rr(t,e,n){let i="";const s=t.x.translate/e.x,o=t.y.translate/e.y,r=n?.z||0;if((s||o||r)&&(i=`translate3d(${s}px, ${o}px, ${r}px) `),1===e.x&&1===e.y||(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:t}=n;t&&(i=`perspective(${t}px) ${i}`);for(let t=0;t<uo.length;t++){const e=uo[t],s=n[e];s&&(i+=`${e}(${s}deg) `),!t&&n.pathRotation&&(i+=`rotate(${n.pathRotation}deg) `)}}const a=t.x.scale*e.x,c=t.y.scale*e.y;return 1===a&&1===c||(i+=`scale(${a}, ${c})`),i||"none"}function Lr(t){return[t("x"),t("y")]}const Or=(t,e)=>t.depth-e.depth;class Br{constructor(){this.children=[],this.isDirty=!1}add(t){x(this.children,t),this.isDirty=!0}remove(t){w(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Or),this.isDirty=!1,this.children.forEach(t)}}const Ir={hasAnimatedSinceResize:!0,hasEverUpdated:!1},jr={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},Fr=["z","skew","skewZ"];let Wr=0;function Ur(t,e,n,i){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),i&&(i[t]=0))}const Nr=({instance:t})=>t&&pi.get(t)?.demote();function $r(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=as(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:e,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",le,!(e||i))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&$r(i)}function zr({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:s}){return Object.assign(Wo,{...Dr,...Wo}),class{constructor(t={},n=e?.()){this.id=Wr++,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,Uo.value&&(jr.nodes=jr.calculatedTargetDeltas=jr.calculatedProjections=0),this.nodes.forEach(Hr),this.nodes.forEach(na),this.nodes.forEach(ia),this.nodes.forEach(Xr),Uo.addProjectionMetrics&&Uo.addProjectionMetrics(jr)},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 Br)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new D),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){this.eventHandlers.get(t)?.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}mount(e){if(this.instance)return;this.isSVG=ks(e)&&!$o(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?.children.add(this),this.root.hasTreeAnimated&&(i||n)&&(this.isLayoutDirty=!0),t){let n,i=0;const s=()=>this.root.updateBlockedByResize=!1;le.read(()=>{i=window.innerWidth}),t(e,()=>{const t=window.innerWidth;t!==i&&(i=t,this.root.updateBlockedByResize=!0,n?.(),n=No(s,250),Ir.hasAnimatedSinceResize&&(Ir.hasAnimatedSinceResize=!1,this.nodes.forEach(ea)))})}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()||ca,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=n.getProps(),c=!this.targetLayout||!Pr(this.targetLayout,s),l=!e&&i;if(this.options.layoutRoot||this.resumeFrom||l||e&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const e={...Oi(o,"layout"),onPlay:r,onComplete:a};(n.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e),this.setAnimationOrigin(t,l,e.path)}else e||ea(this),this.isLead()&&this.options.onExitComplete?.();this.targetLayout=s}))}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),this.getStack()?.remove(this),this.parent?.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),this.hasLayoutListener=!1,ue(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes?.forEach(sa),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void this.options.onExitComplete?.();if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&$r(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;Nr(this),this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){const e=this.path[t];e.shouldResetTransform=!0,Nr(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(qr),void this.nodes.forEach(_r)}if(this.animationId<=this.animationCommitId)return void this.nodes.forEach(Zr);this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Jr),this.nodes.forEach(Qr),this.nodes.forEach(ta),this.nodes.forEach(Kr),this.nodes.forEach(Yr)):this.nodes.forEach(Zr),this.clearAllSnapshots();const t=rt.now();it.delta=S(0,1e3/60,t-it.timestamp),it.timestamp=t,it.isProcessing=!0,he.update.process(it),he.preRender.process(it),he.render.process(it),it.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Io.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Gr),this.sharedNodes.forEach((t,e)=>t.members.length?t.removeLeadSnapshot():this.sharedNodes.delete(e))}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,le.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){le.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||er(this.snapshot.measuredBox.x)||er(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t<this.path.length;t++){this.path[t].updateScroll()}const t=this.layout;this.layout=this.measure(!1),this.layoutCorrected||(this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}}),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:e}=this.options;e?.notify("LayoutMeasure",this.layout.layoutBox,t?.layoutBox)}updateScroll(t="measure"){const{scroll:e,instance:s}=this,{animationId:o}=this.root;if(this.options.layoutScroll&&s&&(!e||e.animationId!==o||e.phase!==t)){const r=i(s);this.scroll={animationId:o,phase:t,isRoot:r,offset:n(s),wasRoot:e?e.isRoot:r}}}resetTransform(){if(!s)return;const t=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout;t&&Nr(this);const e=this.projectionDelta&&!wr(this.projectionDelta),n=this.getTransformTemplate(),i=n?n(this.latestValues,""):void 0,o=i!==this.prevTransformTemplateValue;t&&this.instance&&(e||ho(this.latestValues)||o)&&(s(this.instance,i),this.shouldResetTransform=!1,this.scheduleRender())}measure(t=!0){const e=this.measurePageBox();let n=this.removeElementScroll(e);var i;return t&&(n=this.removeTransform(n)),ha((i=n).x),ha(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(fa))){const{scroll:t}=this.root;t&&(To(e.x,t.offset.x),To(e.y,t.offset.y))}return e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};if(Qo(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&&Qo(e,t),To(e.x,s.offset.x),To(e.y,s.offset.y))}return e}applyTransform(t,e=!1,n,i,s=0){const o=n||{x:{min:0,max:0},y:{min:0,max:0}};Qo(o,t);for(let t=s;t<this.path.length;t++){const n=this.path[t];!e&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(To(o.x,-n.scroll.offset.x),To(o.y,-n.scroll.offset.y)),ho(n.latestValues)&&Eo(o,n.latestValues,n.layout?.layoutBox)}return!i&&ho(this.latestValues)&&Eo(o,this.latestValues,this.layout?.layoutBox),o}removeTransform(t){const e={x:{min:0,max:0},y:{min:0,max:0}};Qo(e,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];if(!ho(n.latestValues))continue;let i;n.instance&&(lo(n.latestValues)&&n.updateSnapshot(),i=vr(),Qo(i,n.measurePageBox())),fr(e,n.latestValues,n.snapshot?.layoutBox,i)}return ho(this.latestValues)&&fr(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!==it.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=it.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(),rr(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,!0):Qo(this.target,this.layout.layoutBox),xo(this.target,this.targetDelta)):Qo(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,!1!==this.options.layoutAnchor&&o&&(!o.resumingFrom==!this.resumingFrom||o.options.layoutRoot&&!o.resumingFrom)&&!o.options.layoutScroll&&o.target&&1!==this.animationProgress?this.createRelativeTarget(o,this.target,o.target):this.relativeParent=this.relativeTarget=void 0),Uo.value&&jr.calculatedTargetDeltas++)}getClosestProjectingParent(){if(this.parent&&!lo(this.parent.latestValues)&&!fo(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}},cr(this.relativeTargetOrigin,e,n,this.options.layoutAnchor||void 0),Qo(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===it.timestamp&&(n=!1),n)return;const{layout:i,layoutId:s}=this.options;if(this.isTreeAnimating=Boolean(this.parent?.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!i&&!s)return;Qo(this.layoutCorrected,this.layout.layoutBox);const o=this.treeScale.x,r=this.treeScale.y;So(this.layoutCorrected,this.treeScale,this.path,e&&(!(t.relativeTarget&&!t.relativeParent.resumingFrom)||t.relativeParent)),!t.layout||t.target||1===this.treeScale.x&&1===this.treeScale.y||(t.target=t.layout.layoutBox,t.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:a}=t;a?(this.projectionDelta&&this.prevProjectionDelta?(tr(this.prevProjectionDelta.x,this.projectionDelta.x),tr(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),sr(this.projectionDelta,this.layoutCorrected,a,this.latestValues),this.treeScale.x===o&&this.treeScale.y===r&&Er(this.projectionDelta.x,this.prevProjectionDelta.x)&&Er(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",a)),Uo.value&&jr.calculatedProjections++):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){this.options.visualElement?.scheduleRender(),t&&this.getStack()?.scheduleRender(),this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}}setAnimationOrigin(t,e=!1,n){const i=this.snapshot,s=i?i.latestValues:{},o={...this.latestValues},r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;const a={x:{min:0,max:0},y:{min:0,max:0}},c=i?.source!==this.layout?.source,l=this.getStack(),u=!l||l.members.length<=1,h=Boolean(c&&!u&&!0===this.options.crossfade&&!this.path.some(aa));let d;this.animationProgress=0;const p=n?.interpolateProjection(t);this.mixTargetDelta=e=>{const n=e/1e3,i=p?.(n);oa(r.x,t.x,n),oa(r.y,t.y,n),i&&(r.x.translate=i.x,r.y.translate=i.y),this.setTargetDelta(r),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(cr(a,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),function(t,e,n,i){ra(t.x,e.x,n.x,i),ra(t.y,e.y,n.y,i)}(this.relativeTarget,this.relativeTargetOrigin,a,n),d&&Sr(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),Qo(d,this.relativeTarget)),c&&(this.animationValues=o,Xo(o,s,this.latestValues,n,h,u)),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&&(ue(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=le.update(()=>{Ir.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Ri(0)),this.motionValue.jump(0,!1),this.currentAnimation=Fo(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({...Ne("layout-animation-start",t),node:e})}catch{}}(this.currentAnimation,this),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta?.(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead(),{targetWithTransforms:e,layout:n,latestValues:i}=t;let{target:s}=t;if(e&&s&&n){if(this!==t&&this.layout&&n&&pa(this.options.animationType,this.layout.layoutBox,n.layoutBox)){const{layoutBox:t}=this.layout,e=s;s=this.target||{x:{min:0,max:0},y:{min:0,max:0}},da(s.x,e.x,t.x),da(s.y,e.y,t.y)}Qo(e,s),Eo(e,i),sr(this.projectionDeltaWithTransform,this.layoutCorrected,e,i)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new Mr);this.sharedNodes.get(t).add(e);const n=e.options.initialPromotionConfig;e.promote({transition:n?.transition,preserveFollowOpacity:n?.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){const{layoutId:t}=this.options;return t&&this.getStack()?.lead||this}getPrevLead(){const{layoutId:t}=this.options;return t?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){this.getStack()?.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){return this.getStack()?.relegate(this)||!1}resetSkewAndRotation(){const{visualElement:t}=this.options;if(!t)return;const{latestValues:e}=t;if(!po(e))return;const n={};for(let e=0;e<Fr.length;e++)Ur(Fr[e],t,n,this.animationValues);for(let e=0;e<uo.length;e++)Ur(uo[e],t,n,this.animationValues);t.render();for(const e in n)t.setStaticValue(e,n[e]),this.animationValues&&(this.animationValues[e]=n[e]);t.scheduleRender()}applyProjectionStyles(t,e){if(!this.instance||this.isSVG)return;const n=this.getLead();if(!this.isVisible&&n!==this)return void(t.visibility="hidden");const i=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,t.visibility="",t.opacity="",t.pointerEvents=zo(e?.pointerEvents)||"",void(t.transform=i?i(this.latestValues,""):"none");if(!this.projectionDelta||!this.layout||!n.target)return(this.options.layoutId||this.needsShow)&&(this.needsShow=!1,t.visibility="",t.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,t.pointerEvents=zo(e?.pointerEvents)||""),void(this.hasProjected&&!ho(this.latestValues)&&(t.transform=i?i({},""):"none",this.hasProjected=!1));t.visibility="";const s=n.animationValues||n.latestValues;this.applyTransformsToTarget();let o=Rr(this.projectionDeltaWithTransform,this.treeScale,s);i&&(o=i(s,o)),t.transform=o;const{x:r,y:a}=this.projectionDelta;t.transformOrigin=`${100*r.origin}% ${100*a.origin}% 0`,n.animationValues?t.opacity=n===this?s.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:s.opacityExit:t.opacity=n===this?void 0!==s.opacity?s.opacity:"":void 0!==s.opacityExit?s.opacityExit:0;for(const e in Wo){if(void 0===s[e])continue;const{correct:i,applyTo:r,isCSSVariable:a}=Wo[e],c="none"===o?s[e]:i(s[e],n);if(r){const e=r.length;for(let n=0;n<e;n++)t[r[n]]=c}else a?this.options.visualElement.renderState.vars[e]=c:t[e]=c}this.options.layoutId&&(t.pointerEvents=n===this?zo(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(_r),this.root.sharedNodes.clear()}}}function Kr(t){t.updateLayout(),function(t){const{snapshot:e,dragAncestor:n}=t,i=n?.isAnimationBlocked&&n.layout;if(!e||!i||t.resumeFrom||t.isAnimationBlocked)return;const s=n.dragSnapshot;Lr(t=>To(e.layoutBox[t],i.layoutBox[t].min-s.layoutBox[t].min))}(t)}function Yr(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=t.layout,{animationType:s}=t.options,o=e.source!==t.layout.source,r=(i,o)=>{if("size"===s)Lr(t=>{const e=er(i[t]);i[t].min=o[t].min,i[t].max=i[t].min+e});else if("x"===s||"y"===s){const t="x"===s?"y":"x";Jo(i[t],o[t])}else pa(s,e.layoutBox,n)&&Lr(e=>{const n=er(o[e]);i[e].max=i[e].min+n,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[e].max=t.relativeTarget[e].min+n)})},a=o?e.measuredBox:e.layoutBox;r(a,n);const c={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};sr(c,n,e.layoutBox);const l={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};sr(l,o?t.applyTransform(i,!0):n,a);const u=!wr(c);let h=!1;const d=t.getClosestProjectingParent();if((!t.resumeFrom||d?.options.layoutRoot&&t.resumeFrom.path.includes(d))&&d&&!d.resumeFrom){const{snapshot:i,layout:s}=d;if(i&&s){const a=t.options.layoutAnchor||void 0,c={x:{min:0,max:0},y:{min:0,max:0}};cr(c,o?t.resumeFrom.applyTransform(e.layoutBox,!0,void 0,!0,d.depth+1):e.layoutBox,i.layoutBox,a);const l={x:{min:0,max:0},y:{min:0,max:0}};cr(l,n,s.layoutBox,a),o&&r(c,l),Pr(c,l)||(h=!0),d.options.layoutRoot&&(t.relativeTarget=l,t.relativeTargetOrigin=c,t.relativeParent=d)}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:l,layoutDelta:c,hasLayoutChanged:u,hasRelativeLayoutChanged:h})}else t.isLead()&&t.options.onExitComplete?.();t.options.transition=void 0}function Hr(t){Uo.value&&jr.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 Xr(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Gr(t){t.clearSnapshot()}function _r(t){t.clearMeasurements()}function qr(t){t.isLayoutDirty=!0,t.updateLayout()}function Zr(t){t.isLayoutDirty=!1}function Jr(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.dragSnapshot||t.layout,t.isLayoutDirty=!0)}function Qr(t){t.relativeTarget&&t.relativeParent?.isLayoutDirty&&(t.currentAnimation?t.isLayoutDirty=!0:(t.targetDelta=void 0,t.removeRelativeTarget()))}function ta(t){const{visualElement:e}=t.options;e?.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function ea(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function na(t){t.resolveTargetDelta()}function ia(t){t.calcProjection()}function sa(t){t.resetSkewAndRotation()}function oa(t,e,n){t.translate=Xt(e.translate,0,n),t.scale=Xt(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function ra(t,e,n,i){t.min=Xt(e.min,n.min,i),t.max=Xt(e.max,n.max,i)}function aa(t){return void 0!==t.animationValues?.opacityExit}const ca={duration:.45,ease:[.4,0,.1,1]},la=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),ua=la("applewebkit/")&&!la("chrome/")?Math.round:C;function ha(t){t.min=ua(t.min),t.max=ua(t.max)}function da(t,e,n){t.max=er(n)+(t.min=e.min)}function pa(t,e,n){return"position"===t||"preserve-aspect"===t&&!nr(Ar(e),Ar(n),.2)}function fa(t){return t!==t.root&&t.scroll?.wasRoot}function ma(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n,i)}const ga=zr({attachResizeListener:(t,e)=>ma(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),ya={current:void 0},va=zr({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!ya.current){const t=new ga({});t.mount(window),t.setOptions({layoutScroll:!0}),ya.current=t}return ya.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>"fixed"===window.getComputedStyle(t).position}),xa=new WeakMap;function wa(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function ba(t){return"string"==typeof t||Array.isArray(t)}const Sa=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ta=["initial"].concat(Sa);function Pa(t){if(wa(t.animate))return!0;for(let e=0;e<Ta.length;e++)if(ba(t[Ta[e]]))return!0;return!1}function Aa(t){return Boolean(Pa(t)||t.variants)}function Ea(t,e,n){for(const i in e){const s=e[i],o=n[i];if(ns(s))t.addValue(i,s);else if(ns(o))t.addValue(i,Ri(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,Ri(void 0!==e?e:s,{owner:t}))}}for(const i in n)void 0===e[i]&&t.removeValue(i);return e}const Ma={current:null},Ca={current:!1},Va="undefined"!=typeof window;function ka(){if(Ca.current=!0,Va)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Ma.current=t.matches;t.addEventListener("change",e),e()}else Ma.current=!1}const Da=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Ra={};function La(t){Ra=t}function Oa(){return Ra}class Ba{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=On,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=rt.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,le.render(this.render,!1,!0))};const{latestValues:c,renderState:l}=r;this.latestValues=c,this.baseTarget={...c},this.initialValues=e.initial?{...c}:{},this.renderState=l,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=Pa(e),this.isVariantNode=Aa(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!==c[t]&&ns(e)&&e.set(c[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,xa.set(t,this),this.projection?.instance||this.projection?.mount(t),this.isVariantNode&&!this.isControllingVariants){let t=this;do{t=!1!==t.props.inherit&&t.parent}while(t&&!t.isVariantNode);if(t){const{variantChildren:e}=t;e.add(this),this.removeFromVariantTree=()=>e.delete(this)}}this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(Ca.current||ka(),this.shouldReduceMotion=Ma.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection?.unmount(),ue(this.notifyUpdate),ue(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree?.(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),(this.enteringChildren||(this.enteringChildren=new Set)).add(t)}removeChild(t){this.children.delete(t),this.enteringChildren?.delete(t)}bindToMotionValue(t,e){if(this.valueSubscriptions.get(t)?.(),e.accelerate&&ei.has(t)&&this.current instanceof HTMLElement){const{factory:n,keyframes:i,times:s,ease:o,duration:r}=e.accelerate,a=new Gn({element:this.current,name:t,keyframes:i,times:s,ease:o,duration:R(r)}),c=n(a);return void this.valueSubscriptions.set(t,()=>{c(),a.cancel()})}const n=vn.has(t);n&&this.onBindTransform&&this.onBindTransform();const i=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&le.preRender(this.notifyUpdate),n&&(this.projection&&(this.projection.isTransformDirty=!0),pi.get(this.current)?.check()),this.scheduleRender()});let s;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{i(),s?.()})}sortNodePosition(t){return this.current&&t.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in Ra){const e=Ra[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)&&pi.get(this.current)?.demote(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<Da.length;e++){const n=Da[e];this.propEventSubscriptions[n]?.(),delete this.propEventSubscriptions[n];const i=t["on"+n];i&&(this.propEventSubscriptions[n]=this.on(n,i))}this.prevMotionValues=Ea(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue?.()}getProps(){return this.props}getVariant(t){return this.props.variants?.[t]}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}addValue(t,e){const n=this.values.get(t);if(e!==n){n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e);const i=e.get();void 0!==i&&(this.latestValues[t]=i)}}removeValue(t){this.values.delete(t),this.valueSubscriptions.get(t)?.(),this.valueSubscriptions.delete(t),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){let n=this.props.values?.[t];return n||(n=this.values.get(t),void 0===n&&void 0!==e&&(n=Ri(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&&(P(n)||E(n))?n=parseFloat(n):"number"!=typeof n&&!zt.test(n)&&zt.test(e)&&(n=on(t,e)),this.setBaseTarget(t,ns(n)?n.get():n)),ns(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}on(t,e){return(this.events[t]||(this.events[t]=new D)).add(e)}notify(t,...e){this.events[t]?.notify(...e)}scheduleRenderMicrotask(){Io.render(this.render)}}class Ia extends Ba{constructor(){super(...arguments),this.KeyframeResolver=vs}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;ns(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}function ja(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 Fa(t,{layout:e,layoutId:n}){return vn.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)(ns(i[e])||s&&ns(s[e])||Fa(e,t)||void 0!==n?.getValue(e)?.liveStyle)&&(o[e]=i[e]);return o}class Ua extends Ia{constructor(){super(...arguments),this.type="html",this.renderInstance=ja}mount(t){super.mount(t)}readValueFromInstance(t,e){if(vn.has(e))return this.projection?.isProjecting?fn(e):gn(t,e);{const i=(n=t,window.getComputedStyle(n)),s=(lt(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return Mo(t,e)}build(t,e,n){Hs(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return Wa(t,e,n)}}const Na="[data-layout],[data-layout-id]",$a=new WeakMap;let za;function Ka(t){const e=[];return t instanceof HTMLElement&&t.matches(Na)&&e.push(t),t.querySelectorAll(Na).forEach(t=>{t instanceof HTMLElement&&e.push(t)}),e}function Ya(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 Ha(t,e){let n=$a.get(t);if(n)n.setOptions(Ya(t,e));else{let i=xa.get(t);i||(i=new Ua({props:{},presenceContext:null,visualState:{latestValues:{},renderState:{transform:{},transformOrigin:{},style:{},vars:{}}}},{allowProjection:!0}),Oo(t,i)),t.style.transform&&!ho(i.latestValues)&&(t.style.transform=""),n=new va(i.latestValues,function(t){let e=t.parentElement;for(;e;){const t=$a.get(e);if(t?.instance)return t;e=e.parentElement}}(t)),i.projection=n,n.setOptions({...Ya(t,e),visualElement:i}),n.mount(t),$a.set(t,n)}return n.isPresent=!0,n.options.onExitComplete&&n.setOptions({onExitComplete:void 0}),n}function Xa(t,e){e.setOptions({onExitComplete:void 0});e.getStack()&&!e.isLead()||e.currentAnimation?.stop(),e.unmount(),$a.delete(t)}function Ga(){const t=za;za=void 0,function(){if(it.isProcessing)return;const t=rt.now();it.delta=S(0,1e3/60,t-it.timestamp),it.timestamp=t,it.isProcessing=!0,he.update.process(it),he.preRender.process(it),he.render.process(it),it.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(i=e.keys(),[...i].sort((t,e)=>t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1))){const i=e.get(t),s=Ha(t,i[i.length-1].transitionFor(t));for(const e of i)e.adopt(t,s);n.set(t,s)}var i;n.forEach(t=>{t.isLayoutDirty=!1,t.willUpdate()});const s=[];for(const e of t){const t=e.runUpdate();t&&s.push(t)}const o=()=>{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(),Io.render(()=>{for(const e of t)e.finalize()})};s.length?Promise.all(s).then(o):o()}class _a{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}),za||(za=[],queueMicrotask(Ga)),za.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 Ka(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 Ka(this.scope)){if(this.tracked.has(e))continue;const n=Ha(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?.parentNode===i.parent?i.next:null),e.isPresent=!1,e.setOptions({onExitComplete:()=>{n.remove(),Xa(n,e)}}),e.relegate())return;n.remove()}Xa(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 Si([...t]))}}function qa(t,e,n){if("function"==typeof t)return{scope:Ds.current?.root||document,updateDom:t,defaultOptions:e};return{scope:t instanceof Document?t:Bs(t)[0]??document,updateDom:e,defaultOptions:n}}const Za=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary;function Ja(t){return{point:{x:t.pageX,y:t.pageY}}}const Qa=t=>e=>Za(e)&&t(e,Ja(e));function tc(t,e,n,i){return ma(t,e,Qa(n),i)}const ec=new WeakMap;let nc;const ic=(t,e,n)=>(i,s)=>s&&s[0]?s[0][t+"Size"]:ks(i)&&"getBBox"in i?i.getBBox()[e]:i[n],sc=ic("inline","width","offsetWidth"),oc=ic("block","height","offsetHeight");function rc({target:t,borderBoxSize:e}){ec.get(t)?.forEach(n=>{n(t,{get width(){return sc(t,e)},get height(){return oc(t,e)}})})}function ac(t){t.forEach(rc)}function cc(t,e){nc||"undefined"!=typeof ResizeObserver&&(nc=new ResizeObserver(ac));const n=Bs(t);return n.forEach(t=>{let n=ec.get(t);n||(n=new Set,ec.set(t,n)),n.add(e),nc?.observe(t)}),()=>{n.forEach(t=>{const n=ec.get(t);n?.delete(e),n?.size||nc?.unobserve(t)})}}const lc=new Set;let uc;function hc(t){return lc.add(t),uc||(uc=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};lc.forEach(e=>e(t))},window.addEventListener("resize",uc)),()=>{lc.delete(t),lc.size||"function"!=typeof uc||(window.removeEventListener("resize",uc),uc=void 0)}}function dc(t,e){return Rs("function"==typeof t?hc(t):cc(t,e))}const pc=(t,e)=>Math.abs(t-e);function fc(t,e){const n=pc(t.x,e.x),i=pc(t.y,e.y);return Math.sqrt(n**2+i**2)}const mc=new Set(["auto","scroll"]);class gc{constructor(t,e,{transformPagePoint:n,contextWindow:i=window,dragSnapToOrigin:s=!1,distanceThreshold:o=3,element:r}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.onElementScroll=t=>{this.handleScroll(t.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;this.hasPendingMove=!1,this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=vc(this.lastRawMoveEventInfo,this.transformPagePoint));const t=wc(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=fc(t.offset,{x:0,y:0})>=this.distanceThreshold;if(!e&&!n)return;const{point:i}=t;this.history.push({...i,timestamp:rt.now()});const{onStart:s,onMove:o}=this.handlers;e||(s?.(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),o?.(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.handleScroll(window),this.lastMoveEvent=t,this.lastRawMoveEventInfo=e,this.lastMoveEventInfo=vc(e,this.transformPagePoint),this.hasPendingMove=!0,le.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.hasPendingMove&&this.updatePoint(),this.end();const{onEnd:n,onSessionEnd:i,resumeAnimation:s}=this.handlers;if(!this.dragSnapToOrigin&&this.startEvent||s?.(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const o=wc("pointercancel"===t.type?this.lastMoveEventInfo:vc(e,this.transformPagePoint),this.history);this.startEvent&&n?.(t,o),i?.(t,o)},!Za(t))return;this.dragSnapToOrigin=s,this.handlers=e,this.transformPagePoint=n,this.distanceThreshold=o,this.contextWindow=i||window;const a=vc(Ja(t),this.transformPagePoint),{point:c}=a;this.history=[{...c,timestamp:rt.now()}];const{onSessionStart:l}=e;l&&l(t,wc(a,this.history));const u={passive:!0,capture:!0};this.removeListeners=V(tc(this.contextWindow,"pointermove",this.handlePointerMove,u),tc(this.contextWindow,"pointerup",this.handlePointerUp,u),tc(this.contextWindow,"pointercancel",this.handlePointerUp,u)),r&&this.startScrollTracking(r)}startScrollTracking(t){let e=t.parentElement;for(;e;){const t=getComputedStyle(e);(mc.has(t.overflowX)||mc.has(t.overflowY))&&this.scrollPositions.set(e,yc(e)),e=e.parentElement}this.scrollPositions.set(window,yc(window)),this.removeScrollListeners=V(ma(window,"scroll",this.onElementScroll,{capture:!0}),ma(window,"scroll",this.onWindowScroll,{}))}handleScroll(t){const e=this.scrollPositions.get(t);if(!e)return;const n=t===window,i=yc(t),s=i.x-e.x,o=i.y-e.y;0===s&&0===o||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s,this.lastMoveEventInfo.point.y+=o):this.history.length>0&&(this.history[0].x-=s,this.history[0].y-=o),this.scrollPositions.set(t,i),le.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners?.(),this.removeScrollListeners?.(),this.scrollPositions.clear(),ue(this.updatePoint)}}const yc=t=>t===window?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop};function vc(t,e){return e?{point:e(t.point)}:t}function xc(t,e){return{x:t.x-e.x,y:t.y-e.y}}function wc({point:t},e){return{point:t,delta:xc(t,Sc(e)),offset:xc(t,bc(e)),velocity:Tc(e,.1)}}function bc(t){return t[0]}function Sc(t){return t[t.length-1]}function Tc(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const s=Sc(t);for(;n>=0&&(i=t[n],!(s.timestamp-i.timestamp>R(e)));)n--;if(!i)return{x:0,y:0};i===t[0]&&t.length>2&&s.timestamp-i.timestamp>2*R(e)&&(i=t[1]);const o=L(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 Pc=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Ac(t){return Pc.has(t.tagName)||!0===t.isContentEditable}const Ec=new Set(["INPUT","SELECT","TEXTAREA"]);function Mc(t){return Ec.has(t.tagName)||!0===t.isContentEditable}const Cc={x:!1,y:!1};function Vc(){return Cc.x||Cc.y}function kc(t){return"x"===t||"y"===t?Cc[t]?null:(Cc[t]=!0,()=>{Cc[t]=!1}):Cc.x||Cc.y?null:(Cc.x=Cc.y=!0,()=>{Cc.x=Cc.y=!1})}function Dc(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 Rc(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 Lc=.35;function Oc(t,e,n){return{min:Bc(t,e),max:Bc(t,n)}}function Bc(t,e){return"number"==typeof t?t:t[e]||0}function Ic(t){let e="";for(const n of t.path){n.scroll=void 0,n.updateScroll();const{scroll:i}=n;n!==t.root&&i&&(e+=i.offset.x+","+i.offset.y+",")}return e}const jc=new WeakMap;class Fc{constructor(t,e=()=>t.getProps()){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t,this.readProps=e}start(t,{snapToCursor:e=!1,distanceThreshold:n}={}){if(!1===this.visualElement.presenceContext?.isPresent)return;const{dragSnapToOrigin:i}=this.getProps();this.panSession=new gc(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=kc(n),!this.openDragLock))return;this.latestPointerEvent=t,this.latestPanInfo=e,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints();const{projection:o}=this.visualElement;o&&(o.isAnimationBlocked=!0,o.target=void 0),Lr(t=>{let e=this.getAxisMotionValue(t).get()||0;if(ht(e)&&(e=Xi(e,this.visualElement.current)||0),Ct.test(e))e=parseFloat(e);else if(Mt.test(e)){const n=o?.layout?.layoutBox[t];n&&(e=er(n)*(parseFloat(e)/100))}this.originPoint[t]=e}),s&&le.update(()=>s(t,e),!1,!0),ss(this.visualElement,"transform"),this.visualElement.animationState?.setActive("whileDrag",!0)},onMove:(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e;const{dragPropagation:n,dragDirectionLock:i,onDirectionLock:s,onDrag:o}=this.getProps();if(!n&&!this.openDragLock)return;const{offset:r}=e;if(i&&null===this.currentDirection){if(this.currentDirection=function(t,e=10){let n=null;Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x");return n}(r),null===this.currentDirection)return;s&&s(this.currentDirection)}this.updateAxis("x",r),this.updateAxis("y",r),this.visualElement.render(),o&&le.update(()=>o(t,e),!1,!0)},onSessionEnd:(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e,this.stop(t,e),this.latestPointerEvent=null,this.latestPanInfo=null},resumeAnimation:()=>{const{dragSnapToOrigin:t}=this.getProps();(t||this.constraints)&&this.startAnimation({x:0,y:0})}},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:i,distanceThreshold:n,contextWindow:this.visualElement.current?.ownerDocument.defaultView,element:this.visualElement.current})}stop(t,e,n){const i=t||this.latestPointerEvent,s=e||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!s||!i)return;const{velocity:r}=s;this.startAnimation(r,n);const{onDragEnd:a}=this.getProps();a&&le.postRender(()=>a(i,s))}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession(),!this.getProps().dragPropagation&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),e?.setActive("whileDrag",!1)}endPanSession(){this.panSession?.end(),this.panSession=void 0}updateAxis(t,e){const{drag:n}=this.readProps();if(!e||!$c(t,n,this.currentDirection))return;const i=this.getAxisMotionValue(t);let s=this.originPoint[t]+e[t];const o=this.constraints&&this.constraints[t];o&&(s=function(t,{min:e,max:n},i){return void 0!==e&&t<e?t=i?Xt(e,t,i.min):Math.max(t,e):void 0!==n&&t>n&&(t=i?Xt(n,t,i.max):Math.min(t,n)),t}(s,o,this.elastic[t])),i.set(s)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),{projection:n}=this.visualElement,i=n&&(n.layout||n.measure(!1)),s=this.constraints;Wc(t)?this.constraints&&this.scroll===Ic(n)||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!i)&&function(t,{top:e,left:n,bottom:i,right:s}){return{x:Dc(t.x,n,s),y:Dc(t.y,e,i)}}(i.layoutBox,t),this.elastic=function(t=Lc){return!1===t?t=0:!0===t&&(t=Lc),{x:Oc(t,"left","right"),y:Oc(t,"top","bottom")}}(e),s!==this.constraints&&!Wc(t)&&i&&this.constraints&&!this.hasMutatedConstraints&&Lr(t=>{!1!==this.constraints&&this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(i.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!Wc(t))return!1;const n=Uc(t),{projection:i}=this.visualElement;if(!i||!i.layout)return!1;this.scroll=Ic(i);const s=Co(n,i.root,this.visualElement.getTransformPagePoint());let o=function(t,e){return{x:Rc(t.x,e.x),y:Rc(t.y,e.y)}}(i.layout.layoutBox,i.removeElementScroll(s));if(e){const t=e(ro(o));this.hasMutatedConstraints=!!t,t&&(o=oo(t))}return o}startAnimation(t,e){const{drag:n,dragMomentum:i,dragElastic:s,dragTransition:o,dragSnapToOrigin:r,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},l=Lr(a=>{if(!$c(a,e||n,this.currentDirection))return;let l=c[a]||{};!0!==r&&r!==a||(l={min:0,max:0});const u=s?200:1e6,h=s?40:1e7,d={type:"inertia",velocity:i?t[a]:0,bounceStiffness:u,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...o,...l};return this.startAxisValueAnimation(a,d)});return Promise.all(l).then(a)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return ss(this.visualElement,t),n.start(Ni(t,n,0,e,this.visualElement,!1))}stopAnimation(){Lr(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();Lr(t=>{if(!$c(t,n,this.currentDirection))return;const e=this.getAxisMotionValue(t),{min:i,max:r}=o[t];e.set((e.get()||0)+s[t]-Xt(i,r,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:n}=this.visualElement;if(!Wc(e)||!n||!this.constraints)return;this.stopAnimation();const i=this.constraints,s={x:0,y:0};Lr(t=>{const e=this.getAxisMotionValue(t).get();s[t]=function(t,e){let n=.5;const i=er(t),s=er(e);return s>i?n=k(e.min,e.max-i,t.min):i>s&&(n=k(t.min,t.max-s,e.min)),S(0,1,n)}({min:e,max:e},i[t])});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",n.root?.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),Lr(e=>{const n=this.getAxisMotionValue(e);if(!$c(e,t,null)||!n.get())return;const{min:i,max:o}=this.constraints[e];n.set(Xt(i,o,s[e]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;jc.set(this.visualElement,this);const t=this.visualElement.current,e=tc(t,"pointerdown",e=>{const{drag:n,dragListener:i=!0}=this.getProps(),s=e.target,o=s!==t&&Mc(s);n&&i&&!o&&this.start(e)});let n;const i=()=>{const{dragConstraints:e}=this.getProps(),i=Wc(e)&&Uc(e);i&&(this.constraints=this.resolveRefConstraints(),n||(n=function(t,e,n){const i=dc(t,Nc(n)),s=dc(e,Nc(n));return()=>{i(),s()}}(t,i,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,o=s.addEventListener("measure",i);s.layout||(s.root?.updateScroll(),s.updateLayout()),le.read(i);const r=ma(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(Lr(e=>{if(!$c(e,this.getProps().drag,this.currentDirection))return;const n=this.getAxisMotionValue(e);this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate)}),this.visualElement.render())});return()=>{r(),e(),o(),a(),n?.()}}getProps(){const t=this.readProps(),{dragElastic:e=Lc,dragMomentum:n=!0}=t;return{...t,dragElastic:e,dragMomentum:n}}}function Wc(t){return!!t&&"object"==typeof t&&("current"in t||"nodeType"in t)}const Uc=t=>"current"in t?t.current:t;function Nc(t){let e=!0;return()=>{e?e=!1:t()}}function $c(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const zc=["user-select","-webkit-user-select","-webkit-touch-callout","touch-action"];function Kc(t,e){const n=Bs(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},Rs(()=>i.abort())]}function Yc(t,e,n={}){e=Os(e);const[i,s,o]=Kc(t,n);return i.forEach(t=>{let n,i=!1,o=!1;const r=e=>{n&&(n(e),n=void 0),t.removeEventListener("pointerleave",c)},a=t=>{i=!1,window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a),o&&(o=!1,r(t))},c=t=>{"touch"!==t.pointerType&&(i?o=!0:r(t))};t.addEventListener("pointerenter",i=>{if("touch"===i.pointerType||Vc())return;o=!1;const r=e(t,i);"function"==typeof r&&(n=r,t.addEventListener("pointerleave",c,s))},s),t.addEventListener("pointerdown",()=>{i=!0,window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",a,s)},s)}),o}const Hc=(t,e)=>!!e&&(t===e||Hc(t,e.parentElement)),Xc=new WeakSet;function Gc(t){return e=>{"Enter"===e.key&&t(e)}}function _c(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function qc(t){return Za(t)&&!Vc()}const Zc=new WeakSet;function Jc(t,e,n={}){e=Os(e);const[i,s,o]=Kc(t,n),r=t=>{const i=t.currentTarget;if(!qc(t))return;if(Zc.has(t))return;Xc.add(i),n.stopPropagation&&Zc.add(t);const o=e(i,t),r={...s,capture:!0},a=(t,e)=>{window.removeEventListener("pointerup",c,r),window.removeEventListener("pointercancel",l,r),Xc.has(i)&&Xc.delete(i),qc(t)&&"function"==typeof o&&o(t,{success:e})},c=t=>{a(t,i===window||i===document||n.useGlobalTarget||Hc(i,t.target))},l=t=>{a(t,!1)};window.addEventListener("pointerup",c,r),window.addEventListener("pointercancel",l,r)};return i.forEach(t=>{(n.useGlobalTarget?window:t).addEventListener("pointerdown",r,s),Vs(t)&&(t.addEventListener("focus",()=>((t,e)=>{let n=!1;const i=Gc(()=>{Xc.has(t)||(n=!0,_c(t,"down"))}),s=Gc(()=>{n&&(n=!1,_c(t,"up"))});t.addEventListener("keydown",i,e),t.addEventListener("keyup",s,e),t.addEventListener("blur",()=>{t.removeEventListener("keydown",i),t.removeEventListener("keyup",s),n&&_c(t,"cancel")},{...e,once:!0})})(t,s),s),Ac(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),o}function Qc(t,e){const n=window.getComputedStyle(t);return Bn(e)?n.getPropertyValue(e):n[e]}const tl={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 el(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"})`:tl[t]||t;return e?`(not (${i}))`:i}).join(" and ")}function nl(...t){const e="function"==typeof t[0]?void 0:t.shift(),[n,i={}]=t,{transition:s,matchMedia:o}=i,r=[],a=new Map;let c=[],l=!1;const u={root:Bs(e)[0],transition:s,add:t=>(c.push(t),()=>w(c,t)),bind:t=>(...e)=>{const n=g.run(()=>t(...e));return"function"==typeof n?u.bind(n):n},track(t){a.has(t)||a.set(t,t.getAttribute("style"))}},h=t=>{const e=c;c=[];for(let t=e.length-1;t>=0;t--)e[t]();t&&a.forEach((t,e)=>{Lo(e),null===t?e.removeAttribute("style"):e.setAttribute("style",t)}),a.clear()},d=()=>{g.state="active";let t=!r.length;g.media={};for(const[e,n]of r)t=(g.media[e]=n.matches)||t;if(t&&n){const t=g.run(()=>n(g));"function"==typeof t&&u.add(t)}},p=()=>{l||(l=!0,queueMicrotask(()=>{l=!1,r.length&&g.refresh()}))},f=t=>{g.state=t?"cancelled":"stopped";for(const[,t]of r)t.removeEventListener("change",p);r.length=0,h(t)},m=(t,e)=>{const n=Ds.current;Ds.current=t;try{return e()}finally{Ds.current=n}},g={state:"active",media:{},run:t=>m(u,t),ignore:t=>m(void 0,t),bind:u.bind,stop:()=>f(),cancel:()=>f(!0),refresh(){h(!0),d()}};if(o&&"undefined"!=typeof window){const t="string"==typeof o?{matches:o}:o;for(const e in t){const n=window.matchMedia(el(t[e]));n.addEventListener("change",p),r.push([e,n])}}return Rs(g.cancel),d(),g}function il(...t){const e=!Array.isArray(t[0]),n=e?0:-1,i=t[0+n],s=Ve(t[1+n],t[2+n],t[3+n]);return e?s(i):s}const sl=new Set,ol=({timestamp:t})=>{sl.forEach(e=>e.tick(t))};class rl extends ze{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():(sl.size||le.update(ol,!0),sl.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=Ue(this.startTime,t));const r=Math.round(t-this.startTime)-i,a=this.currentTime=Math.max(0,r),c=this.generator.next(a),l=r<0?e.keyframes[0]:c.value;if(n){this.hasNextTarget=!1;const{keyframes:t}=e;t[0]=l,t[1]=this.nextTarget,this.retarget(t,this.nextVelocity??this.getGeneratorVelocity())}!n&&this.started||(this.started=!0,o?.()),"running"===this.state&&(s?.(l),c.done&&r>=0&&!n&&!this.hasNextTarget&&"running"===this.state&&(this.notifyFinished(),this.teardown(),this.state="finished",e.onComplete?.()))}getGeneratorVelocity(){return Be(this.generator,this.currentTime,this.options.velocity)}now(){return this.driver?this.driver.now():rt.now()}teardown(){this.state="idle",this.driver?this.driver.stop():(sl.delete(this),sl.size||ue(ol))}}function al(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),c=()=>t.events.animationStart?.notify(),l=()=>{o&&(o.stop(),o=null),t.animation=void 0};if(t.attach((e,i)=>{s=i;const r=Ko(e);if("running"===o?.state)return void o.setTarget(r,n.velocity);const u=Ko(t.get()),h=o?o.getGeneratorVelocity():t.getVelocity();if(l(),u===r)return;const d={keyframes:[u,r],velocity:h,restDelta:.001,restSpeed:.01,...n,onUpdate:a},p=o=new rl({...d,onPlay:c});t.animation=p,p.then(()=>{o===p&&(o=null,t.animation=void 0,t.events.animationComplete?.notify())})},l),ns(e)){let i=!0===n.skipInitialAnimation;const s=e=>{i?(i=!1,t.jump(cl(e,r),!1)):t.set(cl(e,r))},o=e.on("change",s),a=e.get();Ko(a)-Ko(t.get())&&s(a);const c=t.on("destroy",o);return()=>{o(),c(),l()}}return l}function cl(t,e){return e?t+e:t}function ll(t,e,n={}){const i={type:"spring",...n};return We(i),i.type=i.type||Oe,al(t,e,i)}function ul(t){const e=[];ki.current=e;const n=t();ki.current=void 0;const i=Ri(n);return function(t,e,n){const i=()=>e.set(n()),s=()=>le.preRender(i,!1,!0),o=t.map(t=>t.on("change",s));e.on("destroy",()=>{o.forEach(t=>t()),ue(i)})}(e,i,t),i}function hl(t,e,n){return al(t,e,{...n,type:Me})}const dl=[...fs,Lt,zt];let pl=0;const fl=()=>"motion-view-"+pl++;function ml(t,e,n){e&&(t.style?.setProperty("view-transition-class",e),n.push(t))}function gl(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=[],c){const l=Bs(t);if(i)return l.map((t,l)=>{const u=e.get(t);if(u)return u;const h=i[l]??fl();return t.style?.setProperty("view-transition-name",h),n.push(t),e.set(t,h),ml(t,s,o),gl(t,h,r,a,c),h});const u=l.map(t=>e.has(t)?void 0:getComputedStyle(t).getPropertyValue("view-transition-name"));return l.map((t,i)=>{const l=e.get(t);if(l)return l;const h=u[i];let d;return h&&"none"!==h&&"auto"!==h&&"match-element"!==h&&!(t=>t.startsWith("motion-view-"))(h)?d=h:(d=fl(),t.style?.setProperty("view-transition-name",d),n.push(t)),e.set(t,d),ml(t,s,o),gl(t,d,r,a,c),d})}function vl(t){return"layout"===t?"group":"enter"===t||"new"===t?"new":"old"}let xl={},wl=null;const bl=(t,e)=>{xl[t]=e},Sl=()=>{wl||(wl=document.createElement("style"),wl.id="motion-view");let t="";for(const e in xl){const n=xl[e];t+=`${e} {\n`;for(const[e,i]of Object.entries(n))t+=`  ${e}: ${i};\n`;t+="}\n"}wl.textContent=t,document.head.appendChild(wl),xl={}},Tl=()=>{wl&&wl.parentElement&&wl.parentElement.removeChild(wl)};function Pl(t){const e=t.match(/::view-transition-(old|new|group-children|group|image-pair)\((.*?)\)/);return e?{layer:e[2],type:e[1]}:null}function Al(){return document.getAnimations().filter(t=>{const{effect:e}=t;return!!e&&e.target===document.documentElement&&e.pseudoElement?.startsWith("::view-transition")})}const El=["layout","enter","exit","new","old"],Ml=t=>t.split(" ").every(t=>0===parseFloat(t)),Cl={group:["layout"],new:["new","enter"],old:["old","exit"]},Vl={new:{opacity:0,scale:.85},old:{opacity:1,scale:1}};function kl(t){const{update:e,targets:n,resolveDefs:i,cropOverride:s,pairs:o,classNames:r,flatGroups:a,options:c}=t;if(!document.startViewTransition)return(async()=>(await e(),new Si([])))();const l=new Map,u=[],h=[],d=[],p=new Set,f=new Map,m=new Set,g=new Map,y=new Map,v=new Map,x=new Map,w=t=>{n.forEach((e,n)=>{const c=r.get(n),m="root"!==n&&i.has(n)?a.has(n)?"none":"contain":void 0;let w;if("root"!==n&&i.has(n))if(o.has(n))if("old"===t)x.set(n,Bs(n)),w=yl(n,l,u,void 0,c,h,m,d,p),v.set(n,w);else{for(const t of x.get(n)??[])t.style?.removeProperty("view-transition-name"),l.delete(t);w=yl(o.get(n),l,u,v.get(n),c,h,m,d,p)}else w=yl(n,l,u,void 0,c,h,m,d,p);else w=[n];const b=s.get(n);w.forEach((n,i)=>{const s=f.get(n);f.set(n,s&&s!==e?{...s,...e}:e),void 0!==b&&g.set(n,b);const o=y.get(n)??{};o[t]=[i,w.length],y.set(n,o)})})},b=(t,e)=>{const n=y.get(t);return("old"===e?n?.old:"new"===e?n?.new:n?.new??n?.old)??[-1,1]},S=(t,e,n,i,s)=>{const o=Dl(Oi(c,n),Oi(function(t,e){for(const n of Cl[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},T=t=>{const[e,n]=b(t,"group"),i=S(f.get(t),"group","layout",-1===e?0:e,n);i.duration&&(i.duration=R(i.duration));const{delay:s=0,duration:o,ease:r}=Xn(i);return{delay:R(s),duration:o,ease:r}},P=new Map,A=t=>l.forEach((e,n)=>{const i=n,s=i.getBoundingClientRect?.();if(s&&s.height){const n=getComputedStyle(i),o={};for(const t of xs)o[t]=n[t];const r=P.get(e)??{};r[t]={width:s.width,height:s.height,radii:o},P.set(e,r)}}),E=t=>{const e=P.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},M=()=>{(function(t,e){return e.has(t)&&Object.keys(e.get(t)).length>0})("root",n)||bl(":root",{"view-transition-name":"none"}),bl("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)",{"animation-timing-function":"linear !important"}),m.forEach(t=>{bl(`::view-transition-group(${t})`,{overflow:"clip"}),bl(`::view-transition-old(${t}), ::view-transition-new(${t})`,{width:"100%",height:"100%","object-fit":"cover"})}),p.forEach(t=>{bl(`::view-transition-group-children(${t})`,{overflow:"clip"})}),Sl()},C=()=>{!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),Tl()},V=async()=>{await e(),w("new"),A("new"),(()=>{m.clear();for(const t of y.keys())"root"!==t&&(g.get(t)??E(t))&&m.add(t)})(),M()};let k;try{w("old"),A("old"),M(),k=document.startViewTransition(V)}catch(t){return C(),Promise.reject(t)}return k.finished.finally(C),new Promise((t,e)=>{k.ready.then(()=>{const e=Al(),n=[],i=new Set,s=new Set;f.forEach((t,e)=>{const o=y.get(e),r=!!o?.new&&!o?.old,a=!!o?.old&&!o?.new;for(const o of El){if(!t[o])continue;if("enter"===o&&!r)continue;if("exit"===o&&!a)continue;const l=vl(o),[u,h]=b(e,l);if(-1===u)continue;const{keyframes:d,options:p}=t[o];for(let[f,m]of Object.entries(d)){if(null==m)continue;if("x"===f||"y"===f){I(!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=Dl(Oi(c,f),Oi(p,f));if(!Array.isArray(m)){const e="enter"===o?t.exit?.keyframes[f]:void 0,n="opacity"===f||("new"===l?r:a),i=null!=e?Array.isArray(e)?e[e.length-1]:e:n?Vl[l]?.[f]:void 0;void 0!==i&&(m=[i,m])}"function"==typeof d.delay&&(d.delay=d.delay(u,h)),d.duration&&(d.duration=R(d.duration)),d.delay&&(d.delay=R(d.delay)),n.push(new Gn({...d,element:document.documentElement,name:f,pseudoElement:`::view-transition-${l}(${e})`,keyframes:m})),i.add(`${e}:${l}`),"opacity"===f&&s.add(`${e}:${l}`)}}});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=Pl(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 Ai(t)):t.cancel();continue}const c="old"===r.type?"new":"new"===r.type?"old":void 0;if(c&&i.has(`${r.layer}:${c}`)&&!s.has(`${r.layer}:${c}`)){t.cancel();continue}const l=y.get(r.layer),u=!("old"!==r.type&&"new"!==r.type||!l?.old||!l?.new);let h;if(r.type.startsWith("group")){const{delay:t,duration:e,ease:n}=T(r.layer);h={delay:t,duration:e,easing:Kn(n,e)}}else{const t=u?"group":r.type,[e,n]=b(r.layer,t);let i=S(a,t,"group"===t?"layout":"",-1===e?0:e,n);const s=i.visualDuration;i.duration&&(i.duration=R(i.duration)),i=Xn(i),h={delay:R(i.delay??0),duration:u&&void 0!==s?R(s):i.duration,easing:u?"linear":Kn(i.ease,i.duration)}}e.updateTiming(h),n.push(new Ai(t))}P.forEach((t,e)=>{if(!m.has(e))return;const{delay:i,duration:s,ease:o}=T(e);for(const r of xs){const a=t.old?.radii[r]||t.new?.radii[r]||"0px",c=t.new?.radii[r]||t.old?.radii[r]||"0px";Ml(a)&&Ml(c)||n.push(new Gn({element:document.documentElement,name:r,pseudoElement:`::view-transition-group(${e})`,keyframes:[a,c],delay:i,duration:s,ease:o}))}}),t(new Si(n))}).catch(()=>k.updateCallbackDone.then(()=>t(new Si([])),e))})}function Dl(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 Rl=[],Ll=null;function Ol(){Ll=null;const[t]=Rl;var e;t&&(w(Rl,e=t),Ll=e,kl(e).then(t=>(e.notifyReady(t),t.finished)).catch(t=>e.notifyReject(t)).finally(Ol))}function Bl(){for(let t=Rl.length-1;t>=0;t--){const e=Rl[t],{interrupt:n}=e.options;if("immediate"===n){const n=Rl.slice(0,t+1).map(t=>t.update),i=Rl.slice(t+1);e.update=()=>{n.forEach(t=>t())},Rl=[e,...i];break}}Ll&&"immediate"!==Rl[0]?.options.interrupt||Ol()}class Il{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=C,this.notifyReject=C,this.readyPromise=new Promise((t,e)=>{this.notifyReady=t,this.notifyReject=e}),this.update=t,this.options={interrupt:"wait",...e},this.readyPromise.catch(C),n=this,Rl.push(n),Io.render(Bl)}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)}}class jl{constructor(t){this.isMounted=!1,this.node=t}update(){}}const Fl=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"]),Wl=t=>"string"==typeof t&&"svg"===t.toLowerCase();function Ul(t,e,n,i){ja(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(Fl.has(n)?n:Ys(n),e.attrs[n])}function Nl(t,e,n){const i=Wa(t,e,n);for(const n in t)if("children"!==n&&(ns(t[n])||ns(e[n]))){i[-1!==yn.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return i}class $l extends Ia{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=vr}getBaseTargetFromProps(t,e){return vn.has(e)?super.getBaseTargetFromProps(t,e)??fn(e):t[e]}getDefaultValue(t){return vn.has(t)?this.latestValues[t]??fn(t):void 0}readValueFromInstance(t,e){if(vn.has(e)){const t=nn(e);return t&&t.default||0}if(qs.includes(e)){const n=getComputedStyle(t)[e];if("string"==typeof n&&n)return n.trim()}return e=Fl.has(e)?e:Ys(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return Nl(t,e,n)}build(t,e,n){Zs(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){Ul(t,e,0,i)}mount(t){this.isSVGTag=Wl(t.tagName),super.mount(t)}}function zl(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 Kl=[...Sa].reverse(),Yl=t=>!0===t?.out?t:t?.out;function Hl(t){let e=e=>Promise.all(e.map(({animation:e,options:n})=>ds(t,e,n))),n=Gl(),i=!0,s=!1;function o(o){const{props:r,parent:a,manuallyAnimateOnMount:c}=t,{initial:l}=r,u=i||s,h=[],d=(e=l)=>"boolean"!=typeof e&&_i(t,Array.isArray(e)?e[0]:e,t.presenceContext?.custom)||void 0,p=new Map;let f={},m=1/0,g=t;do{g=!1!==g.props.inherit&&g.parent}while(g&&!g.isControllingVariants);const y=u&&Yl(d(l??(g&&g.props.initial))?.transition);if(Kl.forEach((e,i)=>{const s=n[e],l=r[e],d=g&&g.props[e],v=void 0!==l?l:ba(d)||!1===d?d:void 0,x=ba(v),w=e===o?s.isActive:null,b=x&&void 0===l&&!(u&&c);if(s.protectedKeys={...f},!s.isActive&&null===w||!v&&!s.prevProp||wa(v)||"boolean"==typeof v)return;if(!1===w&&(m=i),"exit"===e&&s.isActive&&!0!==w)return void(f={...f,...s.prevResolvedValues});const S=Xl(s.prevProp,v);let T=S||x&&(w&&!b||i>m),P=!1;const A=Array.isArray(v)?v:[v];let E,M={};if(!1!==w)for(const n of A){const{transition:i,transitionEnd:s,...o}=_i(t,n,qi(t,e))||{};M={...M,...o,...s},E=Yl(i)||E}const{prevResolvedValues:C}=s;for(const e in{...C,...M}){if(e in f)continue;const n=M[e],i=C[e],o=Array.isArray(n)&&Array.isArray(i)?!zl(n,i)||S:n!==i;let r;if(o&&null==n)p.has(e)||p.set(e,s.prevOut);else if(o||void 0!==n&&p.has(e)){T=!0,r=p.get(e)||y,p.delete(e)&&(P=!0),s.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)}else s.protectedKeys[e]=!0;s.out[e]=r}if(s.prevProp=v,s.prevResolvedValues=M,s.prevOut=E,s.isActive&&(f={...f,...M}),T&&(!b||!S||P))for(const n of A){const i={type:e};if("string"==typeof n&&u&&c&&a?.enteringChildren){const e=_i(a,n)?.transition?.delayChildren;i.delay=Vi(a.enteringChildren,t,e)}h.push({animation:n,options:i})}}),p.size){const e={},n=d();let i=n?.transition;p.forEach((s,o)=>{s&&(i={...i||t.getDefaultTransition(),[o]:s});const a=t.getValue(o);a&&(a.liveStyle=!0);const c=n&&!Array.isArray(l)?n[o]:void 0,u=t.getBaseTargetFromProps(r,o);e[o]=(void 0!==c?c:void 0===u||ns(u)?void 0===t.initialValues[o]?t.baseTarget[o]:void 0:u)??null}),i&&(e.transition=i),h.push({animation:e})}const v=u&&t.blockInitialAnimation||i&&!c&&(!1===r.initial||r.initial===r.animate);return i=s=!1,!v&&h.length?e(h):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=Gl(),s=!0}}}function Xl(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!zl(e,t)}function Gl(){const t={};for(const e of Sa)t[e]={isActive:"animate"===e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{},out:{}};return t}const _l=Ta.length;const ql=t=>!t.isLayoutDirty&&t.willUpdate(!1);function Zl(){const t=new Set,e=new WeakMap,n=()=>t.forEach(ql);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}}const Jl=le,Ql=ae.reduce((t,e)=>(t[e]=t=>ue(t),t),{}),tu=e.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function eu(t,e){if("function"==typeof t)return t(e);null!=t&&(t.current=e)}function nu(...t){return i.useCallback(function(...t){return e=>{let n=!1;const i=t.map(t=>{const i=eu(t,e);return n||"function"!=typeof i||(n=!0),i});if(n)return()=>{for(let e=0;e<i.length;e++){const n=i[e];"function"==typeof n?n():eu(t[e],null)}}}}(...t),t)}const iu=t=>{const{width:e,height:n}=t?.getBoundingClientRect()||{};return[e/t?.offsetWidth||1,n/t?.offsetHeight||1]},su=t=>{let{left:e,top:n}=t.getBoundingClientRect(),i=t;for(;i=i.parentElement||i.parentNode?.host;){const{scrollLeft:t,scrollTop:s}=i;if(t||s){const[o,r]=iu(i);e+=t*o,n+=s*r}if("fixed"===getComputedStyle(i).position)break}const[s,o]=iu(t.offsetParent);return[e/s,n/o]};class ou extends i.Component{getSnapshotBeforeUpdate(t){const e=this.props.getElement();if(Vs(e)&&t.isPresent&&!this.props.isPresent&&!1!==this.props.pop){const t=e.offsetParent,n=Vs(t)&&t.offsetWidth||0,i=Vs(t)&&t.offsetHeight||0,s=getComputedStyle(e),o=this.props.sizeRef.current;o.height=parseFloat(s.height),o.width=parseFloat(s.width),o.top=e.offsetTop,o.left=e.offsetLeft,o.right=n-o.width-o.left,o.bottom=i-o.height-o.top,o.direction=s.direction,o.point=su(e)}return null}componentDidUpdate(){}render(){return this.props.children}}function ru({children:t,isPresent:n,anchorX:s,anchorY:o,root:r,pop:a,popNode:c}){const l=e.useId(),u=e.useRef(null),h=e.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:p}=e.useContext(tu),f=!1!==a?t.props?.ref??t?.ref:void 0,m=nu(u,f),g=()=>u.current||c?.current?.current,y=t=>{const{width:e,height:n,top:i,left:r,right:a,bottom:c,direction:u}=h.current,d="rtl"===u,p="left"===s?d?`right:${a}`:`left:${r}`:d?`left:${r}`:`right:${a}`,f="bottom"===o?`bottom:${c}`:`top:${i}`;t?.insertRule(`[data-motion-pop-id="${l}"]{position:absolute!important;width:${e}px!important;height:${n}px!important;${p}px!important;${f}px!important}`)};return e.useInsertionEffect(()=>{const{width:t,height:e}=h.current,i=g();if(n||!1===a||!i||!t||!e)return;i.dataset.motionPopId=l;const s=i.ownerDocument,o=s.createElement("style");p&&(o.nonce=p);const c=r??s.head;c.appendChild(o),y(o.sheet);let u=0,d=0;return Io.setup(()=>{const[t,e]=su(i);u=h.current.point[0]-t,d=h.current.point[1]-e}),Io.read(()=>{const{sheet:t}=o;if(!t||!u&&!d)return;const e=h.current;e.left+=u,e.right-=u,e.top+=d,e.bottom-=d,t.deleteRule(0),y(t)}),()=>{i.removeAttribute("data-motion-pop-id"),c.contains(o)&&c.removeChild(o)}},[n]),d(ou,{isPresent:n,getElement:g,sizeRef:h,pop:a,children:!1===a?t:i.cloneElement(t,{ref:m})})}const au=({children:t,initial:n,isPresent:s,onExitComplete:o,custom:r,presenceAffectsLayout:a,mode:c,anchorX:l,anchorY:u,root:h})=>{const p=m(cu),f=e.useId(),g=e.useRef(),x=e.useRef(s),w=e.useRef(o);y(()=>{x.current=s,w.current=o});let b=!0,S=e.useMemo(()=>(b=!1,{id:f,initial:n,isPresent:s,custom:r,onExitComplete:t=>{p.set(t,!0);for(const t of p.values())if(!t)return;o&&o()},register:(t,e)=>(p.set(t,!1),e&&e.parent?.presenceContext?.id!==f&&(g.current=e),()=>{p.delete(t),!x.current&&!p.size&&w.current?.()})}),[s,p,o]);return a&&b&&(S={...S}),e.useMemo(()=>{p.forEach((t,e)=>p.set(e,!1))},[s]),i.useEffect(()=>{!s&&!p.size&&o&&o()},[s]),t=d(ru,{pop:"popLayout"===c,isPresent:s,anchorX:l,anchorY:u,root:h,popNode:g,children:t}),d(v.Provider,{value:S,children:t})};function cu(){return new Map}function lu(t=!0){const n=e.useContext(v);if(null===n)return[!0,null];const{isPresent:i,onExitComplete:s,register:o}=n,r=e.useId();e.useEffect(()=>{if(t)return o(r)},[t]);const a=e.useCallback(()=>t&&s&&s(r),[r,s,t]);return!i&&s?[!1,a]:[!0]}const uu=t=>t.key||"";function hu(t){const n=[];return e.Children.forEach(t,t=>{e.isValidElement(t)&&n.push(t)}),n}const du=e.createContext(null);function pu(){const t=function(){const t=e.useRef(!1);return y(()=>(t.current=!0,()=>{t.current=!1}),[]),t}(),[n,i]=e.useState(0),s=e.useCallback(()=>{t.current&&i(n+1)},[n]);return[e.useCallback(()=>le.postRender(s),[s]),n]}const fu=t=>!0===t,mu=({children:t,id:n,inherit:i=!0})=>{const s=e.useContext(f),o=e.useContext(du),[r,a]=pu(),c=e.useRef(null),l=s.id||o;null===c.current&&((t=>fu(!0===t)||"id"===t)(i)&&l&&(n=n?l+"-"+n:l),c.current={id:n,group:fu(i)&&s.group||Zl()});const u=e.useMemo(()=>({...c.current,forceRender:r}),[a]);return d(f.Provider,{value:u,children:t})},gu=e.createContext({strict:!1}),yu={animation:["variants",...Sa],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let vu=!1;function xu(){return function(){if(vu)return;const t={};for(const e in yu)t[e]={isEnabled:t=>yu[e].some(e=>!!t[e])};La(t),vu=!0}(),Oa()}function wu(t){const e=xu();for(const n in t)e[n]={...e[n],...t[n]};La(e)}function bu(t){return"function"==typeof t}const Su=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Tu(t){return"string"==typeof t&&!t.includes("-")&&!!(Su.indexOf(t)>-1||/[A-Z]/u.test(t))}const Pu=(t,n)=>n.isSVG??Tu(t)?new $l(n):new Ua(n,{allowProjection:t!==e.Fragment}),Au=e.createContext({});function Eu(t){const{initial:n,animate:i}=function(t,e){if(Pa(t)){const{initial:e,animate:n}=t;return{initial:!1===e||ba(e)?e:void 0,animate:ba(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,e.useContext(Au));return e.useMemo(()=>({initial:n,animate:i}),[Mu(n),Mu(i)])}function Mu(t){return Array.isArray(t)?t.join(" "):t}const Cu=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Vu(t,e,n){for(const i in e)ns(e[i])||Fa(i,n)||(t[i]=e[i])}function ku(t,n){const i={};return Vu(i,t.style||{},t),Object.assign(i,function({transformTemplate:t},n){return e.useMemo(()=>{const e={style:{},transform:{},transformOrigin:{},vars:{}};return Hs(e,n,t),Object.assign({},e.vars,e.style)},[n])}(t,n)),i}function Du(t,e){const n={},i=ku(t,e);return t.drag&&!1!==t.dragListener&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=i,n}const Ru=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}});function Lu(t,n,i,s){const o=e.useMemo(()=>{const e={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return Zs(e,n,Wl(s),t.transformTemplate,t.style),{...e.attrs,style:{...e.style}}},[n]);if(t.style){const e={};return Vu(e,t.style,t),{...o,style:{...e,...o.style}}}return o}const Ou=new Set(["animate","exit","variants","initial","style","values","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Bu(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Ou.has(t)}function Iu(t,e){return t.startsWith("on")?!Bu(t):e?.(t)??!Bu(t)}function ju(t,e,n,i){const s={};for(const o in t)"values"===o&&"object"==typeof t.values||ns(t[o])||(Iu(o,i)||!0===n&&Bu(o)||!e&&!Bu(o)||t.draggable&&o.startsWith("onDrag"))&&(s[o]=t[o]);return s}function Fu(t,n,i,{latestValues:s},o,r=!1,a,c){const l=(a??Tu(t)?Lu:Du)(n,s,o,t),u=ju(n,"string"==typeof t,r,c),h=t!==e.Fragment?{...u,...l,ref:i}:{},{children:d}=n,p=e.useMemo(()=>ns(d)?d.get():d,[d]);return e.createElement(t,{...h,children:p})}function Wu(t,e,n,i){const s={},o=i(t,{});for(const t in o)s[t]=zo(o[t]);let{initial:r,animate:a}=t;const c=Pa(t),l=Aa(t);e&&l&&!c&&!1!==t.inherit&&(void 0===r&&(r=e.initial),void 0===a&&(a=e.animate));let u=!!n&&!1===n.initial;u=u||!1===r;const h=u?a:r;if(h&&"boolean"!=typeof h&&!wa(h)){const e=Array.isArray(h)?h:[h];for(let n=0;n<e.length;n++){const i=Gi(t,e[n]);if(i){const{transitionEnd:t,transition:e,...n}=i;for(const t in n){let e=n[t];if(Array.isArray(e)){e=e[u?e.length-1:0]}null!==e&&(s[t]=e)}for(const e in t)s[e]=t[e]}}}return s}const Uu=t=>(n,i)=>{const s=e.useContext(Au),o=e.useContext(v),r=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e},n,i,s){return{latestValues:Wu(n,i,s,t),renderState:e()}}(t,n,s,o);return i?r():m(r)},Nu=Uu({scrapeMotionValuesFromProps:Wa,createRenderState:Cu}),$u=Uu({scrapeMotionValuesFromProps:Nl,createRenderState:Ru}),zu=Symbol.for("motionComponentSymbol");function Ku(t,n,i){const s=e.useRef(i);e.useInsertionEffect(()=>{s.current=i});const o=e.useRef(null);return e.useCallback(e=>{e&&t.onMount?.(e),n&&(e?n.mount(e):n.unmount());const i=s.current;if("function"==typeof i)if(e){const t=i(e);"function"==typeof t&&(o.current=t)}else o.current?(o.current(),o.current=null):i(e);else i&&(i.current=e)},[n])}const Yu=e.createContext({});function Hu(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function Xu(t,n,i,s,o,r){const{visualElement:a}=e.useContext(Au),c=e.useContext(gu),l=e.useContext(v),u=e.useContext(tu),h=u.reducedMotion,d=u.skipAnimations,p=e.useRef(null),f=e.useRef(!1);s=s||c.renderer,!p.current&&s&&(p.current=s(t,{visualState:n,parent:a,props:i,presenceContext:l,blockInitialAnimation:!!l&&!1===l.initial,reducedMotionConfig:h,skipAnimations:d,isSVG:r}),f.current&&p.current&&(p.current.manuallyAnimateOnMount=!0));const m=p.current,g=e.useContext(Yu);!m||m.projection||!o||"html"!==m.type&&"svg"!==m.type||function(t,e,n,i){const{layoutId:s,layout:o,drag:r,dragConstraints:a,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:h}=e,d=t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:Gu(t.parent));d.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:Boolean(r)||a&&Hu(a),visualElement:t,animationType:"string"==typeof o?o:"both",initialPromotionConfig:i,crossfade:h,layoutScroll:c,layoutRoot:l,layoutAnchor:u});const p=d.getStack()?.lead;p&&!d.root.isUpdateBlocked()&&(p.willUpdate(),p.scheduleCheckAfterUnmount())}(p.current,i,o,g),e.useInsertionEffect(()=>{m&&m.props!==i&&m.update(i,l)});const x=i[rs],w=e.useRef(Boolean(x)&&"undefined"!=typeof window&&!window.MotionHandoffIsComplete?.(x)&&window.MotionHasOptimisedAnimation?.(x));return y(()=>{f.current&&m&&(m.animationState?.animateChanges(),m.enteringChildren=void 0)},[]),y(()=>{f.current=!0,m&&(window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),w.current&&m.animationState&&m.animationState.animateChanges())}),e.useEffect(()=>{m&&(!w.current&&m.animationState&&m.animationState.animateChanges(),w.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(x)}),w.current=!1),m.enteringChildren=void 0)}),m}function Gu(t){if(t)return!1!==t.options.allowProjection?t.projection:Gu(t.parent)}function _u(t,{forwardMotionProps:n=!1,type:i}={},s,o){s&&wu(s);const r=i?"svg"===i:Tu(t),a=r?$u:Nu;function c(i,s){let c;const l=function({layoutId:t}){const n=e.useContext(f).id;return n&&void 0!==t?n+"-"+t:t}(i);m(()=>!!ya.current?.sharedNodes.get(l)?.lead&&i.initial)&&(i={...i,initial:!1});const u={...e.useContext(tu),...i,layoutId:l},{isStatic:h,isValidProp:g}=u,y=Eu(i),v=a(i,h);if(!h&&"undefined"!=typeof window){e.useContext(gu).strict;const n=function(t){const e=xu(),{drag:n,layout:i}=e;if(!n&&!i)return{};const s={...n,...i};return{MeasureLayout:s.MeasureLayout,isEnabled:n?.isEnabled(t)||i?.isEnabled(t),ProjectionNode:s.ProjectionNode}}(u);y.visualElement=Xu(t,v,u,o,n.ProjectionNode,r),(n.isEnabled||y.visualElement?.projection?.options.layoutId)&&(c=n.MeasureLayout)}return p(Au.Provider,{value:y,children:[c&&y.visualElement?d(c,{visualElement:y.visualElement,...u}):null,Fu(t,i,Ku(v,y.visualElement,s),v,h,n,r,g)]})}c.displayName=`motion.${"string"==typeof t?t:`create(${t.displayName??t.name??""})`}`;const l=e.forwardRef(c);return l[zu]=t,l}function qu(t,e){if("undefined"==typeof Proxy)return _u;const n=new Map,i=(n,i)=>_u(n,i,t,e);return new Proxy((t,e)=>i(t,e),{get:(s,o)=>"create"===o?i:(n.has(o)||n.set(o,_u(o,void 0,t,e)),n.get(o))})}let Zu=0;const Ju={animation:{Feature:class extends jl{constructor(t){super(t),t.animationState||(t.animationState=Hl(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();wa(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){this.node.getProps().animate!==this.node.prevProps?.animate&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}},exit:{Feature:class extends jl{constructor(){super(...arguments),this.id=Zu++}update(){const{presenceContext:t,prevPresenceContext:e,animationState:n}=this.node;if(!t||!n)return;const{isPresent:i,onExitComplete:s}=t,o=e?.isPresent;if(i===o)return;if(i&&!1===o){if(!0===this.exit){const{initial:t}=this.node.getProps();if(t&&!Array.isArray(t)){const{transition:e,transitionEnd:n,...i}=_i(this.node,t)||{};for(const t in i)this.node.getValue(t)?.jump(i[t])}this.node.blockInitialAnimation=!1,n.reset(),n.animateChanges()}else n.setActive("exit",!1);return void(this.exit=void 0)}const r=this.exit=n.setActive("exit",!i);s&&!i&&r.then(()=>{this.exit===r&&(this.exit=!0,s(this.id))})}mount(){const{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id,this.node))}unmount(){}}}};const Qu=t=>(e,n)=>{t&&le.update(()=>t(e,n),!1,!0)};let th=!1;const eh=({layout:t,layoutDependency:e,layoutAnchor:n})=>({layout:t,layoutDependency:e,layoutAnchor:n,animationType:"string"==typeof t?t:"both"}),nh=(t,e)=>{const{snapshot:n}=t,i=t.getStack();i?.remove(t);const s=i?.lead;if(i?.prevLead===t&&s.resumeFrom===t&&(s.resumeFrom=s.currentAnimation=t.resumingFrom=void 0),t.options.layoutId=e,e)return t.root.registerSharedNode(e,t),()=>{const{resumeFrom:e}=t;!1!==e?.isPresent&&t.getStack().members.includes(e)&&(e.hide(),t.resumeFrom=void 0,t.snapshot=n)};t.needsShow=!0};class ih extends e.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:i}=this.props,{projection:s}=t;s&&(e.group?.add(s),i&&n?.register?.(s),th&&s.root.didUpdate(),s.options.layoutId!==i&&nh(s,i)?.(),s.addEventListener("animationComplete",()=>this.safeToRemove()),s.setOptions({...s.options,...eh(this.props),onExitComplete:()=>this.safeToRemove()})),Ir.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,layoutId:n,visualElement:i,drag:s,isPresent:o}=this.props,{projection:r}=i;return r?(r.isPresent=o,this.takeOver=t.layoutId!==n?(r.willUpdate(),nh(r,n)):void 0,r.setOptions({...r.options,...eh(this.props)}),th=!0,s||t.layoutDependency!==e||void 0===e||t.isPresent!==o?r.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?r.promote():r.relegate()||le.postRender(()=>{r.getStack()?.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(this.takeOver?.(),t.root.didUpdate(),Io.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:i}=t;th=!0,i&&(i.scheduleCheckAfterUnmount(),e.group?.remove(i),n?.deregister?.(i))}safeToRemove(){this.props.safeToRemove?.()}render(){return null}}function sh(t){const[n,i]=lu(),s=e.useContext(f);return d(ih,{...t,layoutGroup:s,switchLayoutGroup:e.useContext(Yu),isPresent:n,safeToRemove:i})}const oh={pan:{Feature:class extends jl{constructor(){super(...arguments),this.removePointerDownListener=C}onPointerDown(t){this.session=new gc(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:this.node.current?.ownerDocument.defaultView})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:Qu(t),onStart:Qu(e),onMove:Qu(n),onEnd:(t,e)=>{delete this.session,i&&le.postRender(()=>i(t,e))}}}mount(){this.removePointerDownListener=tc(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session?.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session?.end()}}},drag:{Feature:class extends jl{constructor(t){super(t),this.removeGroupControls=C,this.removeListeners=C,this.controls=new Fc(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||C}update(){const{dragControls:t,drag:e}=this.node.getProps(),{dragControls:n,drag:i}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls))),i&&!e&&this.controls.stop(void 0,void 0,i)}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},ProjectionNode:va,MeasureLayout:sh}};function rh(t,e,n,i){const{props:s}=t,o="while"+n;t.animationState&&s[o]&&t.animationState.setActive(o,"Start"===i);const r=s["on"+n+i];r&&le.postRender(()=>r(e,Ja(e)))}function ah(t,e,n){t.current instanceof HTMLButtonElement&&t.current.disabled||rh(t,e,"Tap",n)}const ch=new WeakMap,lh=new WeakMap,uh=t=>{const e=ch.get(t.target);e&&e(t)},hh=t=>{t.forEach(uh)};function dh(t,e,n){const i=function({root:t,...e}){const n=t||document;lh.has(n)||lh.set(n,{});const i=lh.get(n),s=JSON.stringify(e);return i[s]||(i[s]=new IntersectionObserver(hh,{root:t,...e})),i[s]}(e);return ch.set(t,n),i.observe(t),()=>{ch.delete(t),i.unobserve(t)}}const ph={some:0,all:1};const fh={inView:{Feature:class extends jl{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:i="some",once:s}=t,o={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof i?i:ph[i]};this.stopObserver=dh(this.node.current,o,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,s&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:n,onViewportLeave:i}=this.node.getProps(),o=e?n:i;o&&o(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}},tap:{Feature:class extends jl{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:e,propagate:n}=this.node.props;this.unmount=Jc(t,(t,e)=>(ah(this.node,e,"Start"),(t,{success:e})=>ah(this.node,t,e?"":"Cancel")),{useGlobalTarget:e,stopPropagation:!1===n?.tap})}unmount(){}}},focus:{Feature:class extends jl{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=V(ma(this.node.current,"focus",()=>this.onFocus()),ma(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends jl{mount(){const{current:t}=this.node;t&&(this.unmount=Yc(t,(t,e)=>(rh(this.node,e,"Hover","Start"),t=>rh(this.node,t,"Hover","End"))))}unmount(){}}}},mh={layout:{ProjectionNode:va,MeasureLayout:sh}},gh=qu(Object.assign({},Ju,fh,oh,mh),Pu),yh=e.createContext(null);function vh(t,e,n,i,s,o="ltr"){const r=t.findIndex(t=>t.value===e);if(-1===r)return t;if("xy"===s){const{layout:e}=t[r],i={x:Xt(e.x.min,e.x.max,.5)+n.x,y:Xt(e.y.min,e.y.max,.5)+n.y},s=function(t){const e=[];return t.forEach(t=>{const{min:n,max:i}=t.layout.y,s=e[e.length-1];!s||n>=s.max||i<=s.min?e.push({items:[t],min:n,max:i}):(s.items.push(t),s.min=Math.min(s.min,n),s.max=Math.max(s.max,i))}),e}(t),a=s.find(e=>e.items.includes(t[r])),c=s.reduce((t,e)=>xh(i.y,e)<xh(i.y,t)?e:t);if(c!==a)return function(t,e,n,i,s){const o=t.filter((t,n)=>n!==e),r=i.items.find(t=>{const e=Xt(t.layout.x.min,t.layout.x.max,.5);return"ltr"===s?n<e:n>e}),a=r?o.indexOf(r):o.indexOf(i.items[i.items.length-1])+1,c=[...o];return c.splice(a,0,t[e]),c.every((e,n)=>e===t[n])?t:c}(t,r,i.x,c,o);const l=wh(i,e);let u=-1,h=l;return t.forEach((t,e)=>{if(e===r)return;const n=wh(i,t.layout);n<h&&(u=e,h=n)}),-1===u?t:b(t,r,r+Math.sign(u-r))}if(!i[s])return t;const a=i[s]>0?1:-1,c=t[r+a];if(!c)return t;const l=t[r].layout[s],u=c.layout[s],h=Xt(u.min,u.max,.5);return 1===a&&l.max+n[s]>h||-1===a&&l.min+n[s]<h?b(t,r,r+a):t}function xh(t,e){return t<e.min?e.min-t:t>e.max?t-e.max:0}function wh(t,e){const n=Math.max(e.x.min-t.x,0,t.x-e.x.max),i=Math.max(e.y.min-t.y,0,t.y-e.y.max);return n*n+i*i}const bh=(t,e)=>t.max<=e.min||e.max<=t.min;function Sh({children:t,as:n="ul",axis:i,onReorder:s,values:o,onPointerDownCapture:r,onClickCapture:a,...c},l,u){const h=m(()=>u[n]),p=e.useRef(new Map),[f,g]=e.useState("y"),y=e.useRef(!1),v=e.useRef(!1),x=e.useRef(null),w=i||f,S=new Set(o);p.current.forEach((t,e)=>{S.has(e)||p.current.delete(e)});const T=()=>o.flatMap(t=>{const e=p.current.get(t);return e?[{value:t,layout:e}]:[]}),P=()=>"rtl"===x.current?.ownerDocument.defaultView?.getComputedStyle(x.current).direction,A=(t,e)=>{let n=0;const i=o.map(e=>p.current.has(e)?t[n++].value:e);i.some((t,e)=>t!==o[e])&&s(i,e)},E={axis:w,proxy:u,groupRef:x,hasReordered:v,onKeyDown:(t,e,n,i)=>{const{key:s,currentTarget:r}=t;if(t.defaultPrevented||t.target!==r||t.altKey||t.ctrlKey||t.metaKey)return;const a=T(),c=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight"].indexOf(s),l=c%2;if(" "===s)t.repeat||i(r,n?void 0:o);else{if(!n)return;if("Escape"===s){const t=n.flatMap(t=>a.filter(e=>e.value===t));A(a.map(e=>n.includes(e.value)?t.shift():e),e),i(r)}else{if(c<0||"xy"!==w&&w!==(l?"x":"y"))return;{const t=a.findIndex(({value:t})=>t===e),n=t+(c>1!=!(!l||!P())?1:-1);t>-1&&a[n]&&A(b(a,t,n),e)}}}t.preventDefault()},registerItem:(t,e)=>{if(p.current.set(t,e),!i){const t=function(t){let e=!1,n=!1;for(let i=0;i<t.length;i++)for(let s=i+1;s<t.length;s++)if(e||(e=bh(t[i].x,t[s].x)),n||(n=bh(t[i].y,t[s].y)),e&&n)return"xy";return e?"x":"y"}(o.flatMap(t=>{const e=p.current.get(t);return e?[e]:[]}));t!==f&&g(t)}},updateOrder:(t,e,n)=>{if(y.current)return;const i=T(),s=vh(i,t,e,n,w,P()?"rtl":"ltr");i!==s&&(y.current=!0,v.current=!0,A(s,t))}};e.useEffect(()=>{y.current=!1},[o]);const M={overflowAnchor:"none",...c.style};return d(h,{...c,style:M,ref:t=>{x.current=t,"function"==typeof l?l(t):l&&(l.current=t)},onPointerDownCapture:t=>{v.current=!1,r?.(t)},onClickCapture:t=>{v.current&&t.detail&&(v.current=!1,t.stopPropagation(),t.preventDefault()),a?.(t)},ignoreStrict:!0,children:d(yh.Provider,{value:E,children:t})})}const Th=t=>e.forwardRef((e,n)=>Sh(e,n,t));function Ph(t){const n=m(()=>Ri(t)),{isStatic:i}=e.useContext(tu);if(i){const[,i]=e.useState(t);e.useEffect(()=>n.on("change",i),[])}return n}function Ah(t,e){const n=Ph(e()),i=()=>n.set(e());return i(),y(()=>{const e=()=>le.preRender(i,!1,!0),n=t.map(t=>t.on("change",e));return i(),()=>{n.forEach(t=>t()),ue(i)}}),n}function Eh(t){ki.current=[],t();const e=Ah(ki.current,t);return ki.current=void 0,e}function Mh(t,e,n,i){if("function"==typeof t)return Eh(t);if(void 0!==n&&!Array.isArray(n)&&"function"!=typeof e)return function(t,e,n,i){const s=m(()=>Object.keys(n)),o=m(()=>({}));for(const r of s)o[r]=Mh(t,e,n[r],i);return o}(t,e,n,i);const s="function"==typeof e?e:il(e,n,i),o=Array.isArray(t)?Ch(t,s):Ch([t],([t])=>s(t)),r=Array.isArray(t)?void 0:t.accelerate;if(r&&!r.isTransformed&&"function"!=typeof e&&Array.isArray(n)&&!1!==i?.clamp){const t=i?.ease;o.accelerate={...r,times:[0,...e,1],keyframes:[n[0],...n,n[n.length-1]],isTransformed:!0,...t?{ease:Array.isArray(t)?[t[0],...t]:t}:{}}}return o}function Ch(t,e){const n=m(()=>[]);return Ah(t,()=>{n.length=0;const i=t.length;for(let e=0;e<i;e++)n[e]=t[e].get();return e(n)})}const Vh=new Set(["auto","scroll"]),kh=new WeakMap,Dh=new WeakMap;let Rh=null;function Lh(t,e){const n=getComputedStyle(t),i="x"===e?n.overflowX:n.overflowY,s=t===document.body||t===document.documentElement;return Vh.has(i)||s}function Oh(t,e){let n=t?.parentElement;for(;n;){if(Lh(n,e))return n;n=n.parentElement}return null}function Bh(t){const e=Math.min(1,1-t/50);return 1.5*e*e*it.delta}function Ih(t,e,n,i){if(!t)return;Rh=t;const s=Oh(t,n);if(!s)return;const o=e-("x"===n?window.scrollX:window.scrollY),{amount:r,edge:a}=function(t,e,n){const i=e.getBoundingClientRect(),s=t-("x"===n?Math.max(0,i.left):Math.max(0,i.top)),o=("x"===n?Math.min(window.innerWidth,i.right):Math.min(window.innerHeight,i.bottom))-t;return s<50?{amount:-Bh(s),edge:"start"}:o<50?{amount:Bh(o),edge:"end"}:{amount:0,edge:null}}(o,s,n);if(null===a)return Dh.delete(s),void kh.delete(s);const c=Dh.get(s),l=s===document.body||s===document.documentElement;if(c!==a){if(!("start"===a&&i<0||"end"===a&&i>0))return;Dh.set(s,a);const t="x"===n?s.scrollWidth-(l?window.innerWidth:s.clientWidth):s.scrollHeight-(l?window.innerHeight:s.clientHeight);kh.set(s,t)}if(r>0){const t=kh.get(s);if(("x"===n?l?window.scrollX:s.scrollLeft:l?window.scrollY:s.scrollTop)>=t)return}"x"===n?l?window.scrollBy({left:r}):s.scrollLeft+=r:l?window.scrollBy({top:r}):s.scrollTop+=r}function jh(t,e=0){return ns(t)?t:Ph(e)}function Fh({children:t,style:n={},value:i,as:s="li",onDrag:o,onDragEnd:r,onKeyDown:a,onBlur:c,layout:l=!0,...u},h){const p=e.useContext(yh),f=m(()=>p.proxy[s]),[g,y]=e.useState(),v={x:jh(n.x),y:jh(n.y)},x=Mh([v.x,v.y],([t,e])=>t||e?1:"unset"),{axis:w,registerItem:b,updateOrder:S,groupRef:T,hasReordered:P,onKeyDown:A}=p,E=(t,e)=>{y(e),xa.get(t)?.animationState?.setActive("whileDrag",!!e)};return d(f,{drag:"xy"===w||w,tabIndex:0,...u,dragSnapToOrigin:!0,style:{...n,x:v.x,y:v.y,zIndex:x},layout:l,onDrag:(t,e)=>{const{velocity:n,point:s}=e,r={x:v.x.get(),y:v.y.get()};S(i,r,n);const a="xy"===w?Math.abs(n.x)>Math.abs(n.y)?"x":"y":w;Ih(T.current,s[a],a,n[a]),o&&o(t,e)},onDragEnd:(t,e)=>{P.current=!1,function(){if(Rh){const t=Oh(Rh,"y");t&&(Dh.delete(t),kh.delete(t));const e=Oh(Rh,"x");e&&e!==t&&(Dh.delete(e),kh.delete(e)),Rh=null}}(),r&&r(t,e)},onKeyDown:t=>{a?.(t),A(t,i,g,E)},onBlur:t=>{c?.(t),g&&E(t.currentTarget)},onLayoutMeasure:t=>{b(i,t)},ref:h,ignoreStrict:!0,children:t})}const Wh=e.forwardRef(Fh),Uh=Th(gh);var Nh=Object.freeze({__proto__:null,Group:Uh,Item:Wh});function $h(t){return"object"==typeof t&&!Array.isArray(t)}function zh(t,e,n,i){return null==t?[]:"string"==typeof t&&$h(e)?Bs(t,n,i):t instanceof NodeList?Array.from(t):Array.isArray(t)?t.filter(t=>null!=t):[t]}function Kh(t,e,n){return t*(e+1)+n*e}function Yh(t,e){if(e.has(t))return e.get(t);const[,n,i]=t.match(/^(.+?)([+-][\d.]+)$/)||[];return e.has(n)?Math.max(0,e.get(n)+parseFloat(i)):void 0}function Hh(t,e,n,i,s,o){!function(t,e,n){for(let i=0;i<t.length;i++){const s=t[i];s.at>e&&s.at<n&&(w(t,s),i--)}}(t,s,o);for(let r=0;r<e.length;r++)t.push({value:e[r],at:Xt(s,o,i[r]),easing:Q(n,r)})}function Xh(t,e,n=0){const i=e+1+e*n;for(let e=0;e<t.length;e++)t[e]=t[e]/i}function Gh(t,e){return t.at===e.at?null===t.value?1:null===e.value?-1:0:t.at-e.at}function _h(t,{defaultTransition:e={},...n}={},i,s,o){const r=e.duration||.3,a=new Map,c=new Map,l={},u=new Map;let h=0,d=0,p=0;const f=(t,n)=>{let o=n;const a=t=>"number"==typeof t?n+t:function(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))):Yh(e,i)??t}(d,t,h,u);for(let n=0;n<t.length;n++){const m=t[n];if("string"==typeof m){u.set(m,d);continue}if(!Array.isArray(m)){const t=void 0===m.at?d:a(m.at);"sequence"in m?(h=d=t,d=f(m.sequence,t),h=t,o=Math.max(o,d)):u.set(m.name,t);continue}let[g,y,v={}]=m;void 0!==v.at&&(d=a(v.at));let x=0;const w=(t,n,i,o=0,a=0)=>{const c=Jh(t),{delay:l=0,times:u=De(c),type:h=e.type||"keyframes",repeat:f,repeatType:m,repeatDelay:g=0,...y}=n;let{ease:v=e.ease||"easeOut",duration:w}=n;const b="function"==typeof l?l(o,a):l,S=c.length,T=Hn(h)?h:s?.[h||"keyframes"];if(S<=2&&T){let t=100;if(2===S&&ed(c)){const e=c[1]-c[0];t=Math.abs(e)}const n={...e,...y};void 0!==w&&(n.duration=R(w));const i=ge(n,t,T);v=i.ease,w=i.duration}w??(w=r);const P=d+b;1===u.length&&0===u[0]&&(u[1]=1);const A=u.length-c.length;if(A>0&&ke(u,A),1===c.length&&c.unshift(null),f&&f<20){const t=w>0?g/w:0;w=Kh(w,f,g);const e=[...c],n=[...u];v=Array.isArray(v)?[...v]:[v];const i=[...v],s="reverse"===m||"mirror"===m;let o=e,r=i;s&&(o=[...e].reverse(),"reverse"===m&&(r=[...i].reverse().map(t=>"function"==typeof t?N(t):t)));for(let a=0;a<f;a++){const l=s&&a%2==0,h=l?o:e,d=l?r:i,p=(a+1)*(1+t);t>0&&(c.push(c[c.length-1]),u.push(p),v.push("linear")),c.push(...h);for(let t=0;t<h.length;t++)u.push(n[t]+p),v.push(0===t?"linear":Q(d,t-1))}Xh(u,f,t)}const E=P+w;Hh(i,c,v,u,P,E),x=Math.max(b+w,x),p=Math.max(E,p)};if(ns(g)){w(y,v,Zh("default",qh(g,c)))}else{const t=zh(g,y,i,l),e=t.length;for(let n=0;n<e;n++){const i=qh(t[n],c);for(const t in y)w(y[t],Qh(v,t),Zh(t,i),n,e)}}h=d,d+=x,o=Math.max(o,d)}return o};return f(t,0),o&&(o.duration=p,o.labels=u),c.forEach((t,i)=>{for(const s in t){const o=t[s];o.sort(Gh);const r=[],c=[],l=[];for(let t=0;t<o.length;t++){const{at:e,value:n,easing:i}=o[t];r.push(n),c.push(k(0,p,e)),l.push(i||"easeOut")}0!==c[0]&&(c.unshift(0),r.unshift(r[0]),l.unshift("easeInOut")),1!==c[c.length-1]&&(c.push(1),r.push(null)),a.has(i)||a.set(i,{keyframes:{},transition:{}});const u=a.get(i);u.keyframes[s]=r;const{type:h,...d}=e;u.transition[s]={...d,duration:p,ease:l,times:c,...n}}}),a}function qh(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function Zh(t,e){return e[t]||(e[t]=[]),e[t]}function Jh(t){return Array.isArray(t)?t:[t]}function Qh(t,e){return t&&t[e]?{...t,...t[e]}:{...t}}const td=t=>"number"==typeof t,ed=t=>t.every(td);function nd(t,e,n,i){const s=[];if(function(t,e){return ns(t)||"number"==typeof t||"string"==typeof t&&!$h(e)}(t,e))s.push(Fo(t,$h(e)&&e.default||e,n&&n.default||n));else{if(null==t)return s;const o=zh(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(...Ro(i,e,a,xa.get(i))):s.push(...Cs(Es(i)??Bo,i,e,a))}}return s}let id=0;const sd=(t,e)=>void 0===e?t:{name:t,at:e};function od(t){t.pause(),t.time=0,t.stop()}class rd{constructor(t=[],e={},n){this.options=e,this.entries=[],this.repeatIndex=0,this.prevTime=0,this.markers=[],this.labels=new Map,this.totalDuration=0,this.isDirty=!1,this.isDone=!1,this.isRebuilding=!1,this.playbackSpeed=1,this.isWrapped=!1,this.stop=()=>{this.flush(),this.group?.stop()},this.isPaused=!1===e.autoplay,this.newFinished(),t.forEach(t=>this.add(t)),n?(this.isDirty=!1,this.isWrapped=!0,this.group=new Pi(n),this.watch()):(this.invalidate(),this.flush());const{scope:i}=e;i&&(i.animations.push(this),this.finished.then(()=>w(i.animations,this)))}add(t,e){return t instanceof rd&&t.adopt(this),this.push({item:t,at:e})}call(t,e){return this.push({item:t,at:e,marker:{name:"_m"+id++,time:0,callback:t}})}addPause(t,e){return this.push({item:e||{},at:t,marker:{name:"_m"+id++,time:0,callback:e,pause:!0}})}move(t,e){return this.entries.forEach(n=>{n.item===t&&(n.at=e)}),this.invalidate()}remove(t){return t instanceof rd&&(t.parent=void 0),this.entries=this.entries.filter(e=>e.item!==t),this.invalidate()}clear(){return this.entries=[],this.invalidate()}getLabelTime(t){return this.flush(),this.labels.get(t)}seek(t){return this.time=this.resolve(t),this}playTo(t){const e=this.resolve(t),n=Math.abs(this.speed);return this.speed=e<this.time?-n:n,this.stopAt=e,this.clock||this.invalidate(),this.play(),this}reverse(){return this.speed=-this.speed,this.play(),this}get progress(){return this.duration?this.time/this.duration:0}set progress(t){this.time=t*this.duration}get time(){return this.active()?.time??0}set time(t){this.flush(),this.prevTime=t,this.group&&(this.group.time=t),this.repeatIndex=this.currentRepeat()}get speed(){return this.playbackSpeed}set speed(t){this.playbackSpeed=t,this.group&&(this.group.speed=t)}get duration(){return this.flush(),this.isWrapped?this.group.duration:this.totalDuration}get iterationDuration(){return this.flush(),this.isWrapped?this.group.iterationDuration:this.totalDuration}get state(){return this.active()?.state??"idle"}get startTime(){return this.active()?.startTime??null}play(){this.flush(),this.isPaused=!1,this.group?.play(),this.isDone&&(this.newFinished(),this.watch())}pause(){this.flush(),this.isPaused=!0,this.group?.pause()}cancel(){this.flush(),this.group?.cancel()}complete(){this.flush(),this.group?.complete()}attachTimeline(t){return this.flush(),this.scrollTimeline=t,this.detachScroll=this.group?.attachTimeline(t),()=>{this.scrollTimeline=void 0,this.detachScroll?.()}}then(t,e){return this.finished.then(t,e)}active(){return this.flush(),this.group?.animations.length?this.group:void 0}push(t){return this.entries.push(t),this.invalidate()}invalidate(){return this.parent?this.parent.invalidate():this.isDirty||(this.isDirty=!0,queueMicrotask(()=>this.flush())),this}flush(){this.isDirty&&!this.parent&&this.build()}adopt(t){this.group&&(od(this.group),this.group=void 0),this.isDirty=!1,this.parent=t}build(){this.isDirty=!1,this.isWrapped=!1;const t=this.group;let e=0;t&&(this.isRebuilding=!0,this.scrollTimeline?(this.detachScroll?.(),t.cancel()):(e=t.animations.length?t.time:0,od(t)),this.isRebuilding=!1);const{defaultTransition:n,onComplete:i,onUpdate:s,onRepeat:o,onReverseComplete:r,autoplay:a,scope:c,...l}=this.options,u={};void 0!==c?.reduceMotion&&(u.reduceMotion=c.reduceMotion),void 0!==c?.skipAnimations&&(u.skipAnimations=c.skipAnimations),Object.assign(u,l);const h=new Map,d={},p=function(t,e,n,i){const s=[];return _h(t.map(t=>{if(Array.isArray(t)&&"function"==typeof t[0]){const e=t[0],n=Ri(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:Me},i).forEach(({keyframes:t,transition:e},n)=>{s.push(...nd(n,t,e))}),s}(this.toSequence(h),{defaultTransition:n,...u},c,d),f=d.labels;let m=u.duration??d.duration;const g=d.duration?m/d.duration:1;if(f.forEach((t,e)=>f.set(e,t*g)),this.markers=[],h.forEach((t,e)=>{t.time=f.get(e),f.delete(e),m=Math.max(m,t.time),this.markers.push(t)}),this.markers.sort((t,e)=>t.time-e.time),this.labels=f,this.totalDuration=m,this.clock=this.clockAnimation=void 0,this.markers.length||void 0!==this.stopAt||s||o){const t=this.clock=Ri(0);t.on("change",e=>t===this.clock&&this.onClock(e)),p.unshift(this.clockAnimation=Fo(t,[0,m],{...u,duration:m,ease:"linear"}))}const y=this.group=new Pi(p);e=Math.min(e,m),this.isDone&&e<m&&this.newFinished(),this.scrollTimeline?this.detachScroll=y.attachTimeline(this.scrollTimeline):(y.speed=this.playbackSpeed,this.isPaused&&y.pause(),e&&(y.time=e)),this.repeatIndex=this.currentRepeat(),this.prevTime=e||-1,this.watch()}toSequence(t){return this.entries.map(({item:e,at:n,marker:i})=>i?(t.set(i.name,i),sd(i.name,n)):e instanceof rd?{sequence:e.toSequence(t),at:n}:"string"==typeof e?sd(e,n):void 0===n?e:Array.isArray(e)?function(t,e){const n=[...t],i="function"==typeof n[0]?Math.max(1,n.length-1):2;return n[i]={...n[i],at:e},n}(e,n):{...e,at:n})}resolve(t){return this.flush(),"number"==typeof t?t:Yh(t,this.labels)??this.time}currentRepeat(){const{repeat:t=0,repeatDelay:e=0,delay:n=0}=this.options,i=this.totalDuration+e,s=(this.clockAnimation?.time??0)-n;return i&&s>0?Math.min(t,Math.floor(s/i)):0}onClock(t){let e=this.prevTime;if(this.prevTime=t,this.isRebuilding)return;const{onUpdate:n,onRepeat:i,repeatType:s="loop"}=this.options;n?.(t);const o=this.currentRepeat();if(o!==this.repeatIndex&&(this.repeatIndex=o,i?.(),"loop"===s)){const t=this.speed>0;if(this.cross(e,t?this.totalDuration:0))return;e=t?-1:1/0}this.cross(e,t)}cross(t,e){if(t===e)return;const n=e>t,i=i=>n?i>t&&i<=e:i<t&&i>=e,s=n?this.markers:[...this.markers].reverse();for(const t of s)if(i(t.time)&&(t.callback?.(n?1:-1),t.pause))return this.pauseAt(t.time);return void 0!==this.stopAt&&i(this.stopAt)?(this.pauseAt(this.stopAt),this.stopAt=void 0,!0):void 0}pauseAt(t){return this.pause(),this.time=t,!0}watch(){const t=this.group;t.finished.then(()=>{if(t!==this.group||this.isDone)return;this.isDone=!0;const{onComplete:e,onReverseComplete:n}=this.options,i=this.speed<0&&n||e;i?.(),this.resolveFinished()})}newFinished(){this.isDone=!1,this.finished=new Promise(t=>{this.resolveFinished=t})}}function ad(t={}){const{scope:e,reduceMotion:n,skipAnimations:i}=t;return function(t,s,o){const r=Ds.current,a=r?.transition,c={};let l;if(void 0!==n&&(c.reduceMotion=n),void 0!==i&&(c.skipAnimations=i),u=t,Array.isArray(u)&&u.some(Array.isArray)){const n={...c,...s,scope:e};a&&(n.defaultTransition={...a,...n.defaultTransition}),l=new rd(t,n)}else{const{onComplete:n,...i}=o||{},r={...c,...a,...i},{onUpdate:u}=i,h="number"==typeof t||"string"==typeof t&&("string"==typeof s||Array.isArray(s))?[u||(()=>{}),Array.isArray(s)?s:[t,s],{...r,onUpdate:void 0}]:[t,s,r];l=new rd([h],{...c,onComplete:n,scope:e},nd(t,s,r,e))}var u;return r&&l.finished.then(r.add(()=>l.stop())),l}}const cd=Object.assign(ad(),{addEffect:Ps,removeEffect:As});const ld=t=>function(e,n,i){return new Pi(function(t,e,n,i){if(null==t)return[];const s=Bs(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={...Oi(a,t)};s.duration&&(s.duration=R(s.duration)),s.delay&&(s.delay=R(s.delay));const o=Ci(i),c=Mi(t,s.pseudoElement||""),l=o.get(c);l&&l.stop(),r.push({map:o,key:c,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]=Qc(i,s)),rn(e),bs(e,s),!o&&e.length<2&&e.unshift(Qc(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 Gn(i);e.set(n,s),s.finished.finally(()=>e.delete(n)),a.push(s)}return a}(e,n,i,t))},ud=ld(),hd={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}},dd=new WeakMap;function pd(t,e,n,i){const s=n[e],{length:o,position:r}=hd[e],a=s.current,c=n.time,l=t[`scroll${r}`];s.current=function(t,e){const n=t===document.scrollingElement,i=n&&document.body||t;let s=dd.get(i);s||dd.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)?-l||0:l,s.containerLength=t[`client${o}`],s.targetLength=t[`scroll${o}`],s.scrollLength=s.targetLength-s.containerLength,s.offset.length=0,s.offset[0]=0,s.offset[1]=s.scrollLength,s.progress=S(0,1,k(0,s.scrollLength,s.current));const u=i-c;s.velocity=u>50?0:O(s.current-a,u)}const fd={start:0,center:.5,end:1};function md(t,e,n=0){let i=0;if(t in fd&&(t=fd[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 gd=[0,0];function yd(t,e,n,i){let s=Array.isArray(t)?t:gd,o=0,r=0;return"number"==typeof t?s=[t,t]:"string"==typeof t&&(s=(t=t.trim()).includes(" ")?t.split(" "):[t,fd[t]?t:"0"]),o=md(s[0],n,i),r=md(s[1],e),o-r}const vd=[[0,0],[1,1]];function xd(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+k(s(o),s(o+1),e))/n;return i?1-r:r}function wd(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 hd){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(Vs(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}!function(t,{offset:e=vd}){for(const n in hd){const i=t[n];i.offset.length=0;for(let t=0;t<e.length;t++)i.offset[t]=yd(e[t],i.containerLength,i.targetLength,i.targetOffset);i.progress=S(0,1,xd(i.offset,i.current))}}(n,i)}},notify:t=>e(o?n:t)}}const bd=new WeakMap,Sd=new WeakMap,Td=new WeakMap,Pd=new WeakMap,Ad=t=>t===document.scrollingElement?window:t;function Ed(t,{container:e=document.scrollingElement,trackContentSize:n=!1,...i}={}){if(!e)return C;let s=Td.get(e);s||(s=new Set,Td.set(e,s));const o=wd(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),!bd.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 hd)pd(t,i,e,n);e.time=n}(e,t,it.timestamp);for(const e of s)e.measure(t);le.preUpdate(i)},i=()=>{for(const e of s)e.notify(t)},o=()=>le.read(n);bd.set(e,o);const r=Ad(e);window.addEventListener("resize",o),e!==document.documentElement&&Sd.set(e,dc(e,o)),r.addEventListener("scroll",o),o()}if(n&&!Pd.has(e)){const t=bd.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=le.read(i,!0);Pd.set(e,s)}const r=bd.get(e);return le.read(r,!1,!0),()=>{ue(r);const t=Td.get(e);if(!t)return;if(t.delete(o),t.size)return;Td.delete(e);const n=bd.get(e);bd.delete(e),n&&(Ad(e).removeEventListener("scroll",n),Sd.get(e)?.(),window.removeEventListener("resize",n));const i=Pd.get(e);i&&(ue(i),Pd.delete(e))}}const Md=new Map;const Cd=t=>{if(/v/u.test(t))return[];const e=yd(t,0,0,0);return[yd(t,0,1,0)-e,e-yd(t,1,0,0),e]},Vd=([t,e,n])=>!n&&(0===e||1===e)&&`${e?"entry":"exit"}-crossing ${100*t}%`;function kd(t=vd){if(2!==t.length)return;const[e,n]=t.map(Cd),i=[Vd(e),Vd(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}function Dd(t,e){const{target:n,container:i,axis:s}=e,o=n&&kd(e.offset),r=function(t){return"undefined"!=typeof window&&(t?Un():Wn())}(n)&&(n?!!o:!e.offset),a=new Map,c=new Set;let l,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=Md.get(t);i||(i=new Map,Md.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(),c.add(t),l||(l=Ed(t=>{c.forEach(e=>{e.time=e.iterationDuration*t[s].progress})},e)),()=>c.delete(t))})];if(r&&o){const{a:t,b:e}=o,r="y"===s?"clientHeight":"clientWidth",c=()=>{u!==(u=t*n[r]+e*i[r]<0)&&a.forEach(h)};c(),t*e<0&&d.push(dc(c),dc([n,i],c))}return()=>{d.forEach(t=>t()),l?.()}}function Rd(t,{axis:e="y",source:n,container:i=document.scrollingElement,...s}={}){if(!i)return C;const o={axis:e,container:n||i,...s};if("function"==typeof t){const n=Os(t);return Rs(Ed(t=>n(t[e].progress,t),o))}return Rs(Dd(t,o))}const Ld={some:0,all:1};function Od(t,e,{root:n,margin:i,amount:s="some"}={}){const o=Bs(t);e=Os(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:Ld[s]});return o.forEach(t=>a.observe(t)),Rs(()=>a.disconnect())}const Bd=qu();function Id(t){return e.useEffect(()=>()=>t(),[])}const jd=Object.assign({renderer:Pu},Ju,fh),Fd=Object.assign({},jd,oh,mh),Wd={renderer:Pu,...Ju};function Ud(t,n,i){e.useInsertionEffect(()=>t.on(n,i),[t,n,i])}const Nd=()=>({scrollX:Ri(0),scrollY:Ri(0),scrollXProgress:Ri(0),scrollYProgress:Ri(0),scrollXLength:Ri(0),scrollYLength:Ri(0)}),$d=t=>!!t&&!t.current;function zd(t,e,n,i){return{factory:s=>{let o;const r=()=>{$d(n)||$d(i)?Io.read(r):o=Rd(s,{...e,axis:t,container:n?.current||void 0,target:i?.current||void 0})};return Io.read(r),()=>{jo(r),o?.()}},times:[0,1],keyframes:[0,1],ease:t=>t,duration:1}}function Kd({container:t,target:n,...i}={}){const s=m(Nd);(function(t,e){return"undefined"!=typeof window&&(t?Un()&&!!kd(e):Wn()&&!e)})(n,i.offset)&&(s.scrollXProgress.accelerate=zd("x",i,t,n),s.scrollYProgress.accelerate=zd("y",i,t,n));const o=e.useRef(null),r=e.useRef(!1),a=e.useCallback(()=>(o.current=Rd((t,{x:e,y:n})=>{s.scrollX.set(e.current),s.scrollXProgress.set(e.progress),s.scrollXLength.set(e.scrollLength),s.scrollY.set(n.current),s.scrollYProgress.set(n.progress),s.scrollYLength.set(n.scrollLength)},{...i,container:t?.current||void 0,target:n?.current||void 0}),()=>{o.current?.()}),[t,n,JSON.stringify(i.offset)]);return y(()=>(r.current=!1,$d(t)||$d(n)?void(r.current=!0):a()),[a]),e.useEffect(()=>{if(!r.current)return;let e;const i=()=>{const i=$d(t),s=$d(n);i||s||(e=a())};return Io.read(i),()=>{jo(i),e?.()}},[a]),s}function Yd(t,n,i){const{isStatic:s}=e.useContext(tu),o=()=>ns(t)?t.get():t;if(s)return Eh(o);const r=Ph(o());return e.useInsertionEffect(()=>i(r,t,n),[r,JSON.stringify(n)]),r}function Hd(t){const n=e.useRef(0),{isStatic:i}=e.useContext(tu);e.useEffect(()=>{if(i)return;const e=({timestamp:e,delta:i})=>{n.current||(n.current=e),t(e-n.current,i)};return le.update(e,!0),()=>ue(e)},[t])}class Xd extends Di{constructor(){super(...arguments),this.isEnabled=!1}add(t){(vn.has(t)||ei.has(t))&&(this.isEnabled=!0,this.update())}update(){this.set(this.isEnabled?"transform":"auto")}}function Gd(){!Ca.current&&ka();const[t]=e.useState(Ma.current);return t}function _d(){const t=Gd(),{reducedMotion:n}=e.useContext(tu);return"never"!==n&&("always"===n||t)}function qd(t,e){[...e].reverse().forEach(n=>{const i=t.getVariant(n);i&&es(t,i),t.variantChildren&&t.variantChildren.forEach(t=>{qd(t,e)})})}function Zd(){const t=new Set,e={subscribe:e=>(t.add(e),()=>{t.delete(e)}),start(e,n){const i=[];return t.forEach(t=>{i.push(ds(t,e,{transitionOverride:n}))}),Promise.all(i)},set:e=>t.forEach(t=>{!function(t,e){Array.isArray(e)?qd(t,e):"string"==typeof e?qd(t,[e]):es(t,e)}(t,e)}),stop(){t.forEach(t=>{!function(t){t.values.forEach(t=>t.stop())}(t)})},mount:()=>()=>{e.stop()}};return e}function Jd(){const t=m(Zd);return y(t.mount,[]),t}const Qd=Jd;class tp{constructor(){this.componentControls=new Set}subscribe(t){return this.componentControls.add(t),()=>this.componentControls.delete(t)}start(t,e){this.componentControls.forEach(n=>{n.start(t.nativeEvent||t,e)})}cancel(){this.componentControls.forEach(t=>{t.cancel()})}stop(){this.componentControls.forEach(t=>{t.stop()})}}const ep=()=>new tp;function np(t){return null!==t&&"object"==typeof t&&zu in t}function ip(){return sp}function sp(t){ya.current&&(ya.current.isUpdating=!1,ya.current.blockUpdate(),t&&t())}const op=new Map,rp=new Map,ap=(t,e)=>`${t}: ${vn.has(e)?"transform":e}`;function cp(t,e,n){const i=ap(t,e),s=op.get(i);if(!s)return null;const{animation:o,startTime:r}=s;function a(){window.MotionCancelOptimisedAnimation?.(t,e,n)}return o.onfinish=a,null===r||window.MotionHandoffIsComplete?.(t)?(a(),null):r}let lp,up;const hp=new Set;function dp(){hp.forEach(t=>{t.animation.play(),t.animation.startTime=t.startTime}),hp.clear()}const pp=()=>({});class fp extends Ba{constructor(){super(...arguments),this.measureInstanceViewportBox=vr}build(){}resetTransform(){}restoreTransform(){}removeValueFromRenderState(){}renderInstance(){}scrapeMotionValuesFromProps(){return{}}getBaseTargetFromProps(){}readValueFromInstance(t,e,n){return n.initialState[e]||0}sortInstanceNodePosition(){return 0}}const mp=Uu({scrapeMotionValuesFromProps:pp,createRenderState:pp});let gp=0;const yp=t=>t>.001?1/t:1e5;t.AnimatePresence=({children:t,custom:n,initial:i=!0,onExitComplete:s,presenceAffectsLayout:o=!0,mode:r="sync",propagate:a=!1,anchorX:c="left",anchorY:l="top",root:u})=>{const[p,g]=lu(a),v=e.useMemo(()=>hu(t),[t]),x=a&&!p?[]:v.map(uu),w=e.useRef(!0),b=m(()=>new Map),S=e.useRef(new Set),[T,P]=e.useState(v),[A,E]=e.useState(v);y(()=>{!a||p||A.length||g?.()},[p,a,A.length,g]);const M=e.useRef();e.useEffect(()=>()=>{const t=M.current;M.current=void 0,t?.()},[A]),y(()=>{w.current=!1;for(let t=0;t<A.length;t++){const e=uu(A[t]);x.includes(e)?(b.delete(e),S.current.delete(e)):!0!==b.get(e)&&b.set(e,!1)}},[A,x.length,x.join("-")]);const C=[];if(v!==T){let t=[...v],e=0;for(const n of A){const i=x.indexOf(uu(n));-1===i?(t.splice(e++,0,n),C.push(n)):e=i+C.length+1}return C.every(t=>b.get(uu(t)))?t=v:"wait"===r&&(t=C),E(hu(t)),P(v),null}const{forceRender:V}=e.useContext(f);return d(h,{children:A.map(t=>{const e=uu(t),h=!(a&&!p)&&(v===A||x.includes(e));return d(au,{isPresent:h,initial:!(w.current&&!i)&&void 0,custom:n,presenceAffectsLayout:o,mode:r,root:u,onExitComplete:h?void 0:()=>{if(S.current.has(e))return;if(!b.has(e))return;S.current.add(e),b.set(e,!0);let t=!0;b.forEach(e=>{e||(t=!1)}),t&&(V?.(),P([]),a&&g?.(),M.current=s)},anchorX:c,anchorY:l,children:t},e)})})},t.AnimateSharedLayout=({children:t})=>(i.useEffect(()=>{},[]),d(mu,{id:m(()=>"asl-"+gp++),children:t})),t.AsyncMotionValueAnimation=bi,t.DOMKeyframesResolver=vs,t.DOMVisualElement=Ia,t.DeprecatedLayoutGroupContext=du,t.DocumentProjectionNode=ga,t.DragControls=tp,t.Feature=jl,t.FlatTree=Br,t.GroupAnimation=Si,t.GroupAnimationWithThen=Pi,t.HTMLProjectionNode=va,t.HTMLVisualElement=Ua,t.JSAnimation=He,t.KeyframeResolver=On,t.LayoutAnimationBuilder=_a,t.LayoutGroup=mu,t.LayoutGroupContext=f,t.LazyMotion=function({children:t,features:n,strict:i=!1}){const[,s]=e.useState(!bu(n)),o=e.useRef(void 0);if(!bu(n)){const{renderer:t,...e}=n;o.current=t,wu(e)}return e.useEffect(()=>{bu(n)&&n().then(({renderer:t,...e})=>{wu(e),o.current=t,s(!0)})},[]),d(gu.Provider,{value:{renderer:o.current,strict:i},children:t})},t.MotionConfig=function({children:t,...n}){const i=e.useContext(tu);(n={...i,...n}).transition=Li(n.transition,i.transition),n.isStatic=m(()=>n.isStatic);const s=e.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion,n.skipAnimations,n.isValidProp]);return d(tu.Provider,{value:s,children:t})},t.MotionConfigContext=tu,t.MotionContext=Au,t.MotionGlobalConfig=T,t.MotionValue=Di,t.MotionValueState=js,t.NativeAnimation=Gn,t.NativeAnimationExtended=Jn,t.NativeAnimationWrapper=Ai,t.NodeStack=Mr,t.ObjectVisualElement=class extends Ba{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=gc,t.PopChild=ru,t.PresenceChild=au,t.PresenceContext=v,t.Reorder=Nh,t.SVGVisualElement=$l,t.SubscriptionManager=D,t.SwitchLayoutGroupContext=Yu,t.ViewTransitionBuilder=Il,t.VisualElement=Ba,t.VisualElementDragControls=Fc,t.WillChangeMotionValue=Xd,t.acceleratedValues=ei,t.activeScope=Ds,t.addAttrValue=Js,t.addBuilderToScope=Ls,t.addDomEvent=ma,t.addEffect=Ps,t.addPointerEvent=tc,t.addPointerInfo=Qa,t.addSVGValue=to,t.addScaleCorrector=function(t){for(const e in t)Wo[e]=t[e],lt(e)&&(Wo[e].isCSSVariable=!0)},t.addStyleValue=Ns,t.addToScope=Rs,t.addUniqueItem=x,t.addValueToWillChange=ss,t.alpha=mt,t.analyseComplexValue=Ut,t.animate=cd,t.animateEffectSubject=Cs,t.animateElement=Ro,t.animateLayout=function(t,e,n){const{scope:i,updateDom:s,defaultOptions:o}=qa(t,e,n),r=new _a(i,s,{...Ds.current?.transition,...o});return Ls(r),r},t.animateMini=ud,t.animateMotionValue=Ni,t.animateSingleValue=Fo,t.animateTarget=us,t.animateValue=function(t){return new He(t)},t.animateValues=Ms,t.animateVariant=hs,t.animateView=function(t,e={}){const n=new Il(t,e);return Ls(n),n},t.animateVisualElement=ds,t.animationControls=Zd,t.animationMapKey=Mi,t.animations=Ju,t.anticipate=Y,t.applyAxisDelta=vo,t.applyBoxDelta=xo,t.applyGeneratorOptions=Xn,t.applyPointDelta=yo,t.applyPxDefaults=bs,t.applyTreeDeltas=So,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,c=r.y-i.y;let l;l="cw"===n?-t:"ccw"===n?t:(Math.abs(a)>=Math.abs(c)?a:c)<0?-t:t;let u=Ki(i.x,i.y,r.x,r.y,l,e);if(void 0===n){const t=Math.abs(a)<Math.abs(c),n=i.x+a*e,s=i.y+c*e,h=t?Math.sign(u.x-n):Math.sign(u.y-s);void 0!==o&&0!==h&&h!==o?(l=-l,u=Ki(i.x,i.y,r.x,r.y,l,e)):0!==h&&(o=h)}const h=s?zi(0,i.x,u.x,r.x,i.y,u.y,r.y):0,d=s?zi(1,i.x,u.x,r.x,i.y,u.y,r.y):0,p=s?j(-180,180,d-h):0;return t=>{const e={x:$i(t,i.x,u.x,r.x),y:$i(t,i.y,u.y,r.y)};if(s){const n=zi(t,i.x,u.x,r.x,i.y,u.y,r.y),o=h+p*t;e.rotate=j(-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"),c=n.x,l=n.y,u=(Array.isArray(c)&&null!=c[0]?c[0]:r?.get())??0,h=(Array.isArray(l)&&null!=l[0]?l[0]:a?.get())??0,d=Array.isArray(c)?c[c.length-1]:c??u,p=Array.isArray(l)?l[l.length-1]:l??h,f=e({x:u,y:h},{x:d,y:p}),m=void 0!==f(0).rotate?t("pathRotation"):void 0,g={delay:s,...Oi(i||{},"x")};delete g.path;const y=Ri(0);y.start(Ni("",y,[0,1e3],{...g,isSync:!0,velocity:0,onUpdate:t=>{const e=f(t/1e3);r?.set(e.x),a?.set(e.y),m&&void 0!==e.rotate&&m.set(e.rotate)},onComplete:()=>{r?.set(d),a?.set(p),m?.set(0)},onStop:()=>m?.set(0),onCancel:()=>m?.set(0)})),y.animation&&o.push(y.animation),delete n.x,delete n.y}};return n},t.aspectRatio=Ar,t.attachFollow=ll,t.attachSpring=hl,t.attrEffect=Qs,t.axisDeltaEquals=Er,t.axisEquals=br,t.axisEqualsRounded=Tr,t.backIn=z,t.backInOut=K,t.backOut=$,t.bindToScope=Os,t.boxEquals=Sr,t.boxEqualsRounded=Pr,t.buildHTMLStyles=Hs,t.buildProjectionTransform=Rr,t.buildSVGAttrs=Zs,t.buildSVGPath=_s,t.buildTransform=di,t.buildTransformer=Nt,t.calcAxisDelta=ir,t.calcBoxDelta=sr,t.calcChildStagger=Vi,t.calcGeneratorDuration=me,t.calcLength=er,t.calcRelativeAxis=or,t.calcRelativeAxisPosition=ar,t.calcRelativeBox=rr,t.calcRelativePosition=cr,t.camelCaseAttributes=Fl,t.camelToDash=Ys,t.cancelFrame=ue,t.cancelMicrotask=jo,t.cancelSync=Ql,t.checkVariantsDidChange=Xl,t.circIn=H,t.circInOut=G,t.circOut=X,t.clamp=S,t.cleanDirtyNodes=Xr,t.collectMotionValues=ki,t.color=Lt,t.compareByDepth=Or,t.complex=zt,t.containsCSSVariable=pt,t.convertBoundingBoxToBox=oo,t.convertBoxToBoundingBox=ro,t.convertOffsetToTimes=Re,t.copyAxisDeltaInto=tr,t.copyAxisInto=Jo,t.copyBoxInto=Qo,t.correctBorderRadius=Vr,t.correctBoxShadow=kr,t.correctParentTransform=function(t){return e=>{const n=t.current;if(!n)return e;const i=function(t){const{transform:e}=getComputedStyle(t);if(!e||"none"===e)return null;const n=e.match(/^matrix3d\((.*)\)$/u)||e.match(/^matrix\((.*)\)$/u);if(!n)return null;const i=n[1].split(",").map(Number),s=e.startsWith("matrix3d"),o=i[0],r=i[1],a=s?i[4]:i[2],c=s?i[5]:i[3],l=o*c-r*a;return Math.abs(l)<1e-10?null:{a:c/l,b:-r/l,c:-a/l,d:o/l}}(n);if(!i)return e;const s=n.getBoundingClientRect(),o=s.left+window.scrollX+s.width/2,r=s.top+window.scrollY+s.height/2,a=e.x-o,c=e.y-r;return{x:o+i.a*a+i.c*c,y:r+i.b*a+i.d*c}}},t.createAnimationState=Hl,t.createAxis=yr,t.createAxisDelta=mr,t.createBox=vr,t.createDelta=gr,t.createEffect=Fs,t.createGeneratorEasing=ge,t.createProjectionNode=zr,t.createRenderBatcher=ce,t.createScopedAnimate=ad,t.cubicBezier=W,t.cubicBezierAsString=$n,t.defaultEasing=Le,t.defaultOffset=De,t.defaultTransformValue=fn,t.defaultValueTypes=en,t.degrees=Et,t.delay=No,t.delayInSeconds=function(t,e){return No(t,R(e))},t.dimensionValueTypes=fs,t.disableInstantTransitions=function(){T.instantAnimations=!1},t.distance=pc,t.distance2D=fc,t.domAnimation=jd,t.domMax=Fd,t.domMin=Wd,t.drag=function(t,e={}){const n=(({axis:t,constraints:e,elastic:n,momentum:i,transition:s,snapToOrigin:o,directionLock:r,propagation:a,onStart:c,onMove:l,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:c,onDrag:l,onDragEnd:u,onDirectionLock:h,onDragTransitionEnd:d,onMeasureDragConstraints:p}))(e),i=Ds.current;if(i)for(const t in n){const e=n[t];"function"==typeof e&&(n[t]=i.bind(e))}const s=Bs(t).map(t=>{i?.track(t);const[s,o]=function(t){const e=$a.get(t)||xa.get(t)?.projection;if(e?.instance)return[e,()=>{}];const n=Ha(t);return[n,()=>$a.get(t)===n&&Xa(t,n)]}(t);s.setOptions({alwaysMeasureLayout:!0});const r=new Fc(s.options.visualElement,()=>n),a=r.addListeners(),c=function(t,e){const{style:n}=t,i=t.getAttribute("draggable"),s=zc.map(t=>n.getPropertyValue(t)),o=e?"pan-"+("x"===e?"y":"x"):"none";return zc.forEach((t,e)=>n.setProperty(t,e<3?"none":o)),t.setAttribute("draggable","false"),()=>{zc.forEach((t,e)=>n.setProperty(t,s[e])),null===i?t.removeAttribute("draggable"):t.setAttribute("draggable",i)}}(t,e.axis);return()=>{c(),a?.(),r.cancel(),r.stopAnimation(),o()}});return Rs(()=>s.forEach(t=>t()))},t.eachAxis=Lr,t.easeIn=_,t.easeInOut=Z,t.easeOut=q,t.easingDefinitionToFunction=nt,t.elementDragControls=jc,t.expectsResolvedDragConstraints=function({dragConstraints:t,onMeasureDragConstraints:e}){return Wc(t)&&!!e},t.extractEventInfo=Ja,t.fillOffset=ke,t.fillWildcards=rn,t.filterProps=ju,t.findDimensionValueType=ms,t.findEffect=Es,t.findValueType=t=>dl.find(ps(t)),t.flushKeyframeResolvers=Ln,t.followValue=function(t,e){const n=Ri(ns(t)?t.get():t);return ll(n,t,e),n},t.frame=le,t.frameData=it,t.frameSteps=he,t.generateLinearEasing=pe,t.getAnimatableNone=on,t.getAnimationMap=Ci,t.getComputedStyle=Qc,t.getDefaultTransition=Fi,t.getDefaultValueType=nn,t.getEasingForSegment=Q,t.getFeatureDefinitions=Oa,t.getFinalKeyframe=je,t.getMixer=ee,t.getOptimisedAppearId=as,t.getOriginIndex=function(t,e){if("first"===t)return 0;{const n=e-1;return"last"===t?n:n/2}},t.getValueAsType=ri,t.getValueTransition=Oi,t.getVariableValue=Xi,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<_l;t++){const i=Ta[t],s=e.props[i];(ba(s)||!1===s)&&(n[i]=s)}return n},t.getViewAnimationLayerInfo=Pl,t.getViewAnimations=Al,t.globalProjectionState=Ir,t.handOffElementState=Oo,t.has2DTranslate=fo,t.hasComplexValues=Wt,t.hasReducedMotionListener=Ca,t.hasScale=lo,t.hasTransform=ho,t.hasWarned=function(t){return B.has(t)},t.hex=Pt,t.hover=Yc,t.hsla=Rt,t.hslaToRgba=Yt,t.inView=Od,t.inertia=Ce,t.initPrefersReducedMotion=ka,t.interpolate=Ve,t.invariant=()=>{},t.invisibleValues=Jt,t.isAnimationControls=wa,t.isBezierDefinition=tt,t.isBrowser=g,t.isCSSVariableName=lt,t.isCSSVariableToken=ht,t.isControllingVariants=Pa,t.isDeltaZero=wr,t.isDragActive=Vc,t.isDragging=Cc,t.isEasingArray=J,t.isElementKeyboardAccessible=Ac,t.isElementTextInput=Mc,t.isForcedMotionValue=Fa,t.isGenerator=Hn,t.isHTMLElement=Vs,t.isKeyframesTarget=Ji,t.isMotionComponent=np,t.isMotionValue=ns,t.isNear=nr,t.isNodeOrChild=Hc,t.isNumericalString=P,t.isObject=A,t.isPrimaryPointer=Za,t.isSVGElement=ks,t.isSVGSVGElement=$o,t.isSVGTag=Wl,t.isTransitionDefined=Ui,t.isValidMotionProp=Bu,t.isVariantLabel=ba,t.isVariantNode=Aa,t.isWaapiSupportedEasing=function t(e){return Boolean("function"==typeof e&&Nn()||!e||"string"==typeof e&&(e in zn||Nn())||tt(e)||Array.isArray(e)&&e.every(t))},t.isWillChangeMotionValue=is,t.isZeroValueString=E,t.keyframes=Oe,t.m=Bd,t.makeAnimationInstant=ti,t.makeUseVisualState=Uu,t.mapEasingToNativeEasing=Kn,t.mapValue=function(t,e,n,i){const s=il(e,n,i);return ul(()=>s(t.get()))},t.maxGeneratorDuration=fe,t.measurePageBox=Co,t.measureViewportBox=Mo,t.memo=M,t.microtask=Io,t.millisecondsToSeconds=L,t.mirrorEasing=U,t.mix=re,t.mixArray=ne,t.mixColor=Zt,t.mixComplex=se,t.mixImmediate=Ht,t.mixLinearColor=Gt,t.mixNumber=Xt,t.mixObject=ie,t.mixValues=Xo,t.mixVisibility=Qt,t.motion=gh,t.motionValue=Ri,t.moveItem=b,t.nodeGroup=Zl,t.noop=C,t.number=ft,t.numberValueTypes=tn,t.optimizedAppearDataAttribute=rs,t.optimizedAppearDataId=os,t.originProps=Ws,t.parseAnimateLayoutArgs=qa,t.parseCSSVariable=Hi,t.parseValueFromTransform=mn,t.percent=Mt,t.pipe=V,t.pixelsToPercent=Cr,t.positionalKeys=Zi,t.prefersReducedMotion=Ma,t.press=Jc,t.processFrame=(t=rt.now())=>{if(it.isProcessing)return;const e=t-it.timestamp;it.delta=T.useManualTiming?e:Math.max(Math.min(e,40),1),rt.set(it.timestamp=t),it.isProcessing=!0;for(const t in he)he[t].process(it);it.isProcessing=!1},t.progress=k,t.progressPercentage=Dt,t.propEffect=Bo,t.propagateDirtyNodes=Hr,t.px=Ct,t.readSVGValue=eo,t.readStyleValue=$s,t.readTransformValue=gn,t.recordStats=function(){if(Uo.value)throw Uo.value=null,Uo.addProjectionMetrics=null,new Error("Stats are already being measured");const t=Uo;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=Lo,t.removeAxisDelta=ur,t.removeAxisTransforms=hr,t.removeBoxTransforms=fr,t.removeEffect=As,t.removeItem=w,t.removePointDelta=lr,t.renderHTML=ja,t.renderSVG=Ul,t.resize=dc,t.resolveElements=Bs,t.resolveMotionValue=zo,t.resolveTransition=Li,t.resolveVariant=_i,t.resolveVariantFromProps=Gi,t.reverseEasing=N,t.rgbUnit=bt,t.rgba=St,t.rootProjectionNode=ya,t.round=Ye,t.sampleDelta=Zn,t.scale=gt,t.scaleCorrectors=Wo,t.scalePoint=go,t.scopeMotion=nl,t.scrapeHTMLMotionValuesFromProps=Wa,t.scrapeSVGMotionValuesFromProps=Nl,t.scroll=Rd,t.scrollInfo=Ed,t.secondsToMilliseconds=R,t.setDragLock=kc,t.setFeatureDefinitions=La,t.setStyle=In,t.setTarget=es,t.spring=Me,t.springValue=function(t,e){const n=Ri(ns(t)?t.get():t);return hl(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 c=o[a];if(!c){const[t,e]=s||[1/0,1],i=Math.min(t,a)-1,r=Math.max(e,Math.ceil(a/t))-1,l="number"==typeof n,u="first"===n?0:"last"===n?1:.5,h=l?n%t:i*u,d=l?Math.floor(n/t):r*u;c=o[a]=[];for(let e=0;e<a;e++){const s=e%t,o=Math.floor(e/t),a=Math.min(s,i-s),l=Math.min(o,r-o);if("random"===n){const t=Math.random()*(e+1)|0;c[e]=c[t],c[t]=e}else c[e]="edges"===n?Math.min(i?a:l,r?l:a):Math.hypot(s-h,o-d)}c.push(s?Math.max(...c):a)}let l=t*c[r];const u=t*c[a];if(i&&u){l=nt(i)(l/u)*u}return e+l}},t.startOptimizedAppearAnimation=function(t,e,n,i,s){if(window.MotionIsMounted)return;const o=t.dataset[os];if(!o)return;window.MotionHandoffAnimation=cp;const r=ap(o,e);up||(up=Yn(t,e,[n[0],n[0]],{duration:1e4,ease:"linear"}),op.set(r,{animation:up,startTime:null}),window.MotionHandoffAnimation=cp,window.MotionHasOptimisedAnimation=(t,e)=>{if(!t)return!1;if(!e)return rp.has(t);const n=ap(t,e);return Boolean(op.get(n))},window.MotionHandoffMarkAsComplete=t=>{rp.has(t)&&rp.set(t,!0)},window.MotionHandoffIsComplete=t=>!0===rp.get(t),window.MotionCancelOptimisedAnimation=(t,e,n,i)=>{const s=ap(t,e),o=op.get(s);o&&(n&&void 0===i?n.postRender(()=>{n.postRender(()=>{o.animation.cancel()})}):o.animation.cancel(),n&&i?(hp.add(o),n.render(dp)):(op.delete(s),op.size||(window.MotionCancelOptimisedAnimation=void 0)))},window.MotionCheckAppearSync=(t,e,n)=>{const i=as(t);if(!i)return;const s=window.MotionHasOptimisedAnimation?.(i,e),o=t.props.values?.[e];if(!s||!o)return;const r=n.on("change",t=>{o.get()!==t&&(window.MotionCancelOptimisedAnimation?.(i,e),r())});return r});const a=()=>{up.cancel();const o=Yn(t,e,n,i);void 0===lp&&(lp=performance.now()),o.startTime=lp,op.set(r,{animation:o,startTime:lp}),s&&s(o)};rp.set(o,!1),up.ready?up.ready.then(a).catch(C):a()},t.startWaapiAnimation=Yn,t.statsBuffer=Uo,t.steps=function(t,e="end"){return n=>{const i=(n="end"===e?Math.min(n,.999):Math.max(n,.001))*t,s="end"===e?Math.floor(i):Math.ceil(i);return S(0,1,s/t)}},t.styleEffect=Ks,t.styleSubjectEffect=zs,t.supportedWaapiEasing=zn,t.supportsBrowserAnimation=oi,t.supportsFlags=jn,t.supportsLinearEasing=Nn,t.supportsPartialKeyframes=Ss,t.supportsScrollTimeline=Wn,t.supportsViewTimeline=Un,t.supportsWaapi=si,t.svgEffect=io,t.svgSubjectEffect=no,t.sync=Jl,t.testValueType=ps,t.time=rt,t.toMediaQuery=el,t.transform=il,t.transformAxis=Po,t.transformBox=Eo,t.transformBoxPoints=ao,t.transformPropOrder=yn,t.transformProps=vn,t.transformValue=ul,t.transformValueTypes=Qe,t.transformViewBoxPoint=function(t){return e=>{const n=t.current;if(!n)return e;const i=n.viewBox?.baseVal;if(!i||0===i.width&&0===i.height)return e;const s=n.getBoundingClientRect();if(0===s.width||0===s.height)return e;const o=i.width/s.width,r=i.height/s.height,a=s.left+window.scrollX,c=s.top+window.scrollY;return{x:(e.x-a)*o+a,y:(e.y-c)*r+c}}},t.translateAxis=To,t.unwrapMotionComponent=function(t){if(np(t))return t[zu]},t.updateMotionValuesFromProps=Ea,t.useAnimate=function(){const t=m(()=>({current:null,animations:[]})),n=_d()??void 0,{skipAnimations:i}=e.useContext(tu);t.reduceMotion=n,t.skipAnimations=i;const s=e.useMemo(()=>ad({scope:t,reduceMotion:n,skipAnimations:i}),[t,n,i]);return Id(()=>{t.animations.forEach(t=>t.stop()),t.animations.length=0}),[t,s]},t.useAnimateMini=function(){const t=m(()=>({current:null,animations:[]})),e=m(()=>ld(t));return Id(()=>{t.animations.forEach(t=>t.stop())}),[t,e]},t.useAnimation=Qd,t.useAnimationControls=Jd,t.useAnimationFrame=Hd,t.useComposedRefs=nu,t.useCycle=function(...t){const n=e.useRef(0),[i,s]=e.useState(t[n.current]),o=e.useCallback(e=>{n.current="number"!=typeof e?j(0,t.length,n.current+1):e,s(t[n.current])},[t.length,...t]);return[i,o]},t.useDeprecatedAnimatedState=function(t){const[n,i]=e.useState(t),s=mp({},!1),o=m(()=>new fp({props:{onUpdate:t=>{i({...t})}},visualState:s,presenceContext:null},{initialState:t}));return e.useLayoutEffect(()=>(o.mount({}),()=>o.unmount()),[o]),[n,m(()=>t=>ds(o,t))]},t.useDeprecatedInvertedScale=function(t){let n=Ph(1),i=Ph(1);const{visualElement:s}=e.useContext(Au);return t?(n=t.scaleX||n,i=t.scaleY||i):s&&(n=s.getValue("scaleX",1),i=s.getValue("scaleY",1)),{scaleX:Mh(n,yp),scaleY:Mh(i,yp)}},t.useDomEvent=function(t,n,i,s){e.useEffect(()=>{const e=t.current;if(i&&e)return ma(e,n,i,s)},[t,n,i,s])},t.useDragControls=function(){return m(ep)},t.useElementScroll=function(t){return Kd({container:t})},t.useFollowValue=function(t,e={}){return Yd(t,e,ll)},t.useForceUpdate=pu,t.useInView=function(t,{root:n,margin:i,amount:s,once:o=!1,initial:r=!1}={}){const[a,c]=e.useState(r),[l,u]=e.useState({});return e.useEffect(()=>{const e=l.current=t.current;if(!e||o&&a)return;return Od(e,()=>(c(!0),o?void 0:()=>c(!1)),{root:n&&n.current||void 0,margin:i,amount:s})},[n,t,i,o,s,l]),e.useEffect(()=>{t.current!==l.current&&(o||c(!1),u({}))}),a},t.useInstantLayoutTransition=ip,t.useInstantTransition=function(){const[t,n]=pu(),i=ip(),s=e.useRef(-1);return e.useEffect(()=>{le.postRender(()=>le.postRender(()=>{n===s.current&&(T.instantAnimations=!1)}))},[n]),e=>{i(()=>{T.instantAnimations=!0,t(),e(),s.current=n+1})}},t.useIsPresent=function(){return null===(t=e.useContext(v))||t.isPresent;var t},t.useIsomorphicLayoutEffect=y,t.useMotionTemplate=function(t,...e){const n=t.length;return Ah(e.filter(ns),function(){let i="";for(let s=0;s<n;s++){i+=t[s];const n=e[s];n&&(i+=ns(n)?n.get():n)}return i})},t.useMotionValue=Ph,t.useMotionValueEvent=Ud,t.usePageInView=function(){const[t,n]=e.useState(!0);return e.useEffect(()=>{const t=()=>n(!document.hidden);return document.hidden&&t(),document.addEventListener("visibilitychange",t),()=>{document.removeEventListener("visibilitychange",t)}},[]),t},t.usePresence=lu,t.usePresenceData=function(){const t=e.useContext(v);return t?t.custom:void 0},t.useReducedMotion=Gd,t.useReducedMotionConfig=_d,t.useResetProjection=function(){return e.useCallback(()=>{const t=ya.current;t&&t.resetTree()},[])},t.useScopeMotion=function(t,n,{deps:i=[],...s}={}){const o=e.useRef(null),r=e.useRef(n);return r.current=n,y(()=>{const e=o.current=nl(t?.current||void 0,t=>r.current(t),s);return()=>{e.cancel(),o.current===e&&(o.current=null)}},i),o},t.useScroll=Kd,t.useSpring=function(t,e={}){return Yd(t,e,hl)},t.useTime=function(){const t=Ph(0);return Hd(e=>t.set(e)),t},t.useTransform=Mh,t.useUnmountEffect=Id,t.useVelocity=function(t){const e=Ph(t.getVelocity()),n=()=>{const i=t.getVelocity();e.set(i),i&&le.update(n)};return Ud(t,"change",()=>{le.update(n,!1,!0)}),e},t.useViewportScroll=function(){return Kd()},t.useWillChange=function(){return m(()=>new Xd("auto"))},t.variantPriorityOrder=Sa,t.variantProps=Ta,t.velocityPerSecond=O,t.vh=Vt,t.visualElementStore=xa,t.vw=kt,t.warnOnce=I,t.warning=()=>{},t.wrap=j});