motion-dom 14.1.1 → 14.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/cjs/index.js +1151 -186
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/es/animation/AsyncMotionValueAnimation.mjs +19 -1
  4. package/dist/es/animation/AsyncMotionValueAnimation.mjs.map +1 -1
  5. package/dist/es/animation/JSAnimation.mjs +54 -24
  6. package/dist/es/animation/JSAnimation.mjs.map +1 -1
  7. package/dist/es/animation/NativeAnimationExtended.mjs +47 -20
  8. package/dist/es/animation/NativeAnimationExtended.mjs.map +1 -1
  9. package/dist/es/animation/interfaces/motion-value.mjs +1 -0
  10. package/dist/es/animation/interfaces/motion-value.mjs.map +1 -1
  11. package/dist/es/animation/keyframes/DOMKeyframesResolver.mjs +25 -1
  12. package/dist/es/animation/keyframes/DOMKeyframesResolver.mjs.map +1 -1
  13. package/dist/es/animation/waapi/supports/waapi.mjs +1 -1
  14. package/dist/es/animation/waapi/supports/waapi.mjs.map +1 -1
  15. package/dist/es/animation/waapi/transforms/TransformAnimation.mjs +854 -0
  16. package/dist/es/animation/waapi/transforms/TransformAnimation.mjs.map +1 -0
  17. package/dist/es/animation/waapi/transforms/groups.mjs +4 -0
  18. package/dist/es/animation/waapi/transforms/groups.mjs.map +1 -0
  19. package/dist/es/effects/style/index.mjs +6 -3
  20. package/dist/es/effects/style/index.mjs.map +1 -1
  21. package/dist/es/effects/style/transform.mjs +2 -7
  22. package/dist/es/effects/style/transform.mjs.map +1 -1
  23. package/dist/es/index.mjs +3 -3
  24. package/dist/es/projection/node/create-projection-node.mjs +10 -0
  25. package/dist/es/projection/node/create-projection-node.mjs.map +1 -1
  26. package/dist/es/render/VisualElement.mjs +16 -3
  27. package/dist/es/render/VisualElement.mjs.map +1 -1
  28. package/dist/es/render/html/utils/build-transform.mjs +1 -1
  29. package/dist/es/render/html/utils/build-transform.mjs.map +1 -1
  30. package/dist/es/value/index.mjs +12 -0
  31. package/dist/es/value/index.mjs.map +1 -1
  32. package/dist/index.d.ts +77 -12
  33. package/dist/motion-dom.dev.js +1151 -186
  34. package/dist/motion-dom.js +1 -1
  35. package/dist/size-rollup-motion-value.js +1 -1
  36. package/dist/size-rollup-motion-value.js.map +1 -1
  37. package/dist/size-rollup-style-effect.js +1 -1
  38. package/dist/size-rollup-style-effect.js.map +1 -1
  39. package/package.json +2 -2
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("motion-utils")):"function"==typeof define&&define.amd?define(["exports","motion-utils"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).MotionDom={},t.MotionUtils)}(this,function(t,e){"use strict";const n={delta:0,timestamp:0,isProcessing:!1};let i;function s(){i=void 0}const o={now:()=>(void 0===i&&o.set(n.isProcessing||e.MotionGlobalConfig.useManualTiming?n.timestamp:performance.now()),i),set:t=>{i=t,queueMicrotask(s)}},r=t=>Math.round(1e5*t)/1e5,a=t=>e=>"string"==typeof e&&e.startsWith(t),l=a("--"),c=a("var(--"),u=t=>!!c(t)&&h.test(t.split("/*")[0].trim()),h=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function d(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const p={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},m={...p,transform:t=>e.clamp(0,1,t)},f={...p,default:1},y=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const g=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,v=(t,e)=>n=>Boolean("string"==typeof n&&g.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),x=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[s,o,r,a]=i.match(y);return{[t]:parseFloat(s),[e]:parseFloat(o),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},T={...p,transform:t=>Math.round((t=>e.clamp(0,255,t))(t))},w={test:v("rgb","red"),parse:x("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+T.transform(t)+", "+T.transform(e)+", "+T.transform(n)+", "+r(m.transform(i))+")"};const b={test:v("#"),parse:function(t){let e="",n="",i="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}},transform:w.transform},S=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),A=S("deg"),P=S("%"),V=S("px"),M=S("vh"),E=S("vw"),k=(()=>({...P,parse:t=>P.parse(t)/100,transform:t=>P.transform(100*t)}))(),D={test:v("hsl","hue"),parse:x("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+P.transform(r(e))+", "+P.transform(r(n))+", "+r(m.transform(i))+")"},C={test:t=>w.test(t)||b.test(t)||D.test(t),parse:t=>w.test(t)?w.parse(t):D.test(t)?D.parse(t):b.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?w.transform(t):D.transform(t),getAnimatableNone:t=>{const e=C.parse(t);return e.alpha=0,C.transform(e)}},R=new RegExp(y.source),B=new RegExp(/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu.source,"i");const j="number",L="color",F=/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+)/giu;function O(t){const e=t.toString();return R.test(e)||B.test(e)}function I(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let o=0;const r=e.replace(F,t=>(C.test(t)?(i.color.push(o),s.push(L),n.push(C.parse(t))):t.startsWith("var(")?(i.var.push(o),s.push("var"),n.push(t)):(i.number.push(o),s.push(j),n.push(parseFloat(t))),++o,"${}")).split("${}");return{values:n,split:r,indexes:i,types:s}}function N({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===j?r(i[o]):t===L?C.transform(i[o]):i[o]}return s}}const U=(t,e)=>{return"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof(n=t)?0:C.test(n)?C.getAnimatableNone(n):n;var n};const $={test:function(t){return isNaN(t)&&"string"==typeof t&&(R.test(t)||B.test(t))},parse:function(t){return I(t).values},createTransformer:function(t){return N(I(t))},getAnimatableNone:function(t){const e=I(t);return N(e)(e.values.map((t,n)=>U(t,e.split[n])))}};function W(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 z({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=W(a,i,t+1/3),o=W(a,i,t),r=W(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 K(t,e){return n=>n>0?e:t}const G=(t,e,n)=>t+(e-t)*n,Y=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},X=[b,w,D];function q(t){const n=(i=t,X.find(t=>t.test(i)));var i;if(!n)return e.warning(!1,`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!1;let s=n.parse(t);return n===D&&(s=z(s)),s}const H=(t,e)=>{const n=q(t),i=q(e);if(!n||!i)return K(t,e);const s={...n};return t=>(s.red=Y(n.red,i.red,t),s.green=Y(n.green,i.green,t),s.blue=Y(n.blue,i.blue,t),s.alpha=G(n.alpha,i.alpha,t),w.transform(s))},_=new Set(["none","hidden"]);function Z(t,e){return _.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function J(t,e){return n=>G(t,e,n)}function Q(t){return"number"==typeof t?J:"string"==typeof t?u(t)?K:C.test(t)?H:nt:Array.isArray(t)?tt:"object"==typeof t?C.test(t)?H:et:K}function tt(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>Q(t)(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=s[e](t);return n}}function et(t,e){const n={...t,...e},i={};for(const s in n)void 0!==t[s]&&void 0!==e[s]&&(i[s]=Q(t[s])(t[s],e[s]));return t=>{for(const e in i)n[e]=i[e](t);return n}}const nt=(t,n)=>{const i=$.createTransformer(n),s=I(t),o=I(n);return s.indexes.var.length===o.indexes.var.length&&s.indexes.color.length===o.indexes.color.length&&s.indexes.number.length>=o.indexes.number.length?_.has(t)&&!o.values.length||_.has(n)&&!s.values.length?Z(t,n):e.pipe(tt(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}(s,o),o.values),i):(e.warning(!0,`Complex values '${t}' and '${n}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),K(t,n))},it=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function st(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return G(t,e,n);if("string"==typeof t&&"string"==typeof e){const n=function(t,e){const n=it.exec(t);if(!n)return;const i=it.exec(e);if(!i||n[2]!==i[2])return;const s=n[2],o=parseFloat(n[1]),a=parseFloat(i[1]);return t=>r(G(o,a,t))+s}(t,e);if(n)return n}return Q(t)(t,e)}const ot=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function rt(t,n,i={delta:0,timestamp:0,isProcessing:!1}){let s=!1,o=!0;const r=()=>s=!0,a=ot.reduce((t,e)=>(t[e]=function(t){let e=new Set,n=new Set,i=!1,s=!1;const o=new Set;let r={delta:0,timestamp:0,isProcessing:!1};function a(e){o.has(e)&&(n.add(e),t()),e(r)}const l={schedule:(t,s=!1,r=!1)=>{const a=r&&i?e:n;return s&&o.add(t),a.add(t),t},cancel:t=>{n.delete(t),o.delete(t)},process:t=>{if(r=t,i)return void(s=!0);i=!0;const o=e;e=n,n=o,e.forEach(a),e.clear(),i=!1,s&&(s=!1,l.process(t))}};return l}(r),t),{}),{setup:l,read:c,resolveKeyframes:u,preUpdate:h,update:d,preRender:p,render:m,postRender:f}=a,y=()=>{const r=e.MotionGlobalConfig.useManualTiming,a=r?i.timestamp:performance.now();s=!1,r||(i.delta=o?1e3/60:Math.max(Math.min(a-i.timestamp,40),1)),i.timestamp=a,i.isProcessing=!0,l.process(i),c.process(i),u.process(i),h.process(i),d.process(i),p.process(i),m.process(i),f.process(i),i.isProcessing=!1,s&&n&&(o=!1,t(y))};return{schedule:ot.reduce((e,n)=>{const r=a[n];return e[n]=(e,n=!1,a=!1)=>(s||(s=!0,o=!0,i.isProcessing||t(y)),r.schedule(e,n,a)),e},{}),cancel:t=>{for(let e=0;e<ot.length;e++)a[ot[e]].cancel(t)},state:i,steps:a}}const{schedule:at,cancel:lt,steps:ct}=rt("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:e.noop,!0,n),ut=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>at.update(e,t),stop:()=>lt(e),now:()=>n.isProcessing?n.timestamp:o.now()}},ht=(t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let e=0;e<s;e++)i+=Math.round(1e4*t(e/(s-1)))/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},dt=2e4;function pt(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 mt(t,n=100,i){const{keyframes:s,velocity:o}=t,r=s&&s[s.length-1]-s[0],a=i({...t,velocity:o&&r?o*n/r:o,keyframes:[0,n]}),l=Math.min(pt(a),dt);return{type:"keyframes",ease:t=>a.next(l*t).value/n,duration:e.millisecondsToSeconds(l)}}const ft=100,yt=10,gt=1,vt=800,xt=.3,Tt=.3,wt={granular:.01,default:2},bt={granular:.005,default:.5},St=.01,At=10,Pt=.05,Vt=t=>t<0?1/Math.max(1+t,Pt):Math.max(1-t,Pt);function Mt(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 Dt(t=>s*Math.exp(-i*t)-i*Math.exp(-s*t)-o,t=>Math.exp(-s*t)-Math.exp(-i*t),e)/e}function Et(t,e){return t*Math.sqrt(1-e*e)}const kt=12;function Dt(t,e,n){let i=n;for(let n=1;n<kt;n++)i-=t(i)/e(i);return i}const Ct=.001;const Rt=(t,e)=>(e?t>=0:t>0)&&t<1/0;function Bt(t,e){if(Rt(t,e))return t}function jt(t){const n=Bt(t.stiffness),i=Bt(t.damping,!0),s=Bt(t.mass),o={...t,stiffness:n??ft,damping:i??yt,mass:s??gt,isResolvedFromDuration:!1,isTimeDefined:void 0===(n??i??s)&&(void 0!==t.duration||void 0!==t.bounce)};if(o.isTimeDefined){if(t.visualDuration){const e=Vt(t.bounce||0),n=2*Math.PI/(1.2*t.visualDuration)*Mt(e,2*Math.PI/1.2);o.stiffness=n*n,o.damping=2*e*Math.sqrt(o.stiffness)}else Object.assign(o,function({duration:t=vt,bounce:n=xt}){let i,s;e.warning(t<=e.secondsToMilliseconds(At),"Spring duration must be 10 seconds or less","spring-duration-limit");const o=Vt(n);t=e.clamp(St,At,e.millisecondsToSeconds(t)),o<1?(i=e=>{const n=e*o,i=n*t,s=Et(e,o),r=Math.exp(-i);return Ct-n/s*r},s=e=>{const n=e*o*t,s=o*o*e*e*t,r=Math.exp(-n),a=Et(e*e,o);return(-i(e)+Ct>0?-1:1)*-s*r/a}):(i=e=>Math.exp(-e*t)*(e*t+1)-.001,s=e=>Math.exp(-e*t)*(t*t*-e));const r=Dt(i,s,5/t),a=r*Mt(o,r*t),l=a*a;return{stiffness:l,damping:2*o*Math.sqrt(l),duration:e.secondsToMilliseconds(t)}}(o)),o.isResolvedFromDuration=!0;Rt(o.stiffness)&&Rt(o.damping,!0)||(o.stiffness=ft,o.damping=yt)}return o}function Lt(t=Tt,n=xt){const i="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:n}:t,s=i.keyframes[0],o=i.keyframes[i.keyframes.length-1],r={done:!1,value:s},{stiffness:a,damping:l,mass:c,duration:u,isResolvedFromDuration:h,isTimeDefined:d}=jt({...i}),p=t=>d?0:-e.millisecondsToSeconds(t),m=l/(2*Math.sqrt(a*c)),f=e.millisecondsToSeconds(Math.sqrt(a/c)),y=m*f,g={target:o,delta:o-s,velocity:p(i.velocity||0)||0,restSpeed:0,restDelta:0},v=()=>{const t=Math.abs(g.delta)<5;g.restSpeed=i.restSpeed||(t?wt.granular:wt.default),g.restDelta=i.restDelta||(t?bt.granular:bt.default)};let x,T,w;if(v(),m<1){const t=Et(f,m),e={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};w=()=>{e.A=(g.velocity+y*g.delta)/t,e.sinC=y*e.A+g.delta*t,e.cosC=y*g.delta-e.A*t};const n=n=>{n!==e.t&&(e.t=n,e.env=Math.exp(-y*n),e.sin=Math.sin(t*n),e.cos=Math.cos(t*n))};x=t=>(n(t),g.target-e.env*(e.A*e.sin+g.delta*e.cos)),T=t=>(n(t),e.env*(e.sinC*e.sin+e.cosC*e.cos))}else if(1===m){x=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},T=e=>Math.exp(-f*e)*(f*t.C*e-g.velocity)}else{const t=f*Math.sqrt(m*m-1),e=y-t,n=y+t,i=d?1/0:300/t,s=(t,e)=>Math.exp(e>i?-t*i-y*(e-i):-t*e),o={S:0,F:0};w=()=>{const e=(g.velocity+y*g.delta)/t;o.S=(g.delta+e)/2,o.F=(g.delta-e)/2},x=t=>g.target-o.S*s(e,t)-o.F*s(n,t),T=t=>e*o.S*s(e,t)+n*o.F*s(n,t)}w();const b=h&&u||null,S={calculatedDuration:b,retarget:(t,e)=>{g.target=t[t.length-1],g.delta=g.target-t[0],g.velocity=p(e),i.restSpeed&&i.restDelta||v(),S.calculatedDuration=b,r.done=!1,w()},velocity:t=>e.secondsToMilliseconds(T(t)),next:t=>{const n=x(t);if(h)r.done=t>=u;else{const i=e.secondsToMilliseconds(T(t));r.done=Math.abs(i)<=g.restSpeed&&Math.abs(g.target-n)<=g.restDelta}return r.value=r.done?g.target:n,r},toString:()=>{const t=Math.min(pt(S),dt),e=ht(e=>S.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return S}function Ft({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:c=.5,restSpeed:u}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)<Math.abs(l-t)?a:l;let m=n*e;const f=h+m,y=void 0===r?f:r(f);y!==f&&(m=y-h);const g=t=>-m*Math.exp(-t/i),v=t=>{const e=g(t);d.done=Math.abs(e)<=c,d.value=d.done?y:y+e};let x,T;const w=t=>{var e;((e=d.value)<a||e>l)&&(x=t,T=Lt({keyframes:[d.value,p(d.value)],velocity:-g(t)/i*1e3,damping:s,stiffness:o,restDelta:c,restSpeed:u}))};return w(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==x||(e=!0,v(t),w(t)),void 0!==x&&t>=x?T.next(t-x):(!e&&v(t),d)}}}function Ot(t,n,{clamp:i=!0,ease:s,mixer:o}={}){const r=t.length;if(e.invariant(r===n.length,"Both input and output ranges must be the same length","range-length"),1===r)return()=>n[0];if(2===r&&n[0]===n[1])return()=>n[1];const a=t[0]===t[1];t[0]>t[r-1]&&(t=[...t].reverse(),n=[...n].reverse());const l=function(t,n,i){const s=[],o=i||e.MotionGlobalConfig.mix||st,r=t.length-1;for(let i=0;i<r;i++){let r=o(t[i],t[i+1]);if(n){const t=Array.isArray(n)?n[i]||e.noop:n;r=e.pipe(t,r)}s.push(r)}return s}(n,s,o),c=l.length,u=i=>{if(a&&i<t[0])return n[0];let s=0;if(c>1)for(;s<t.length-2&&!(i<t[s+1]);s++);const o=e.progress(t[s],t[s+1],i);return l[s](o)};return i?n=>u(e.clamp(t[0],t[r-1],n)):u}function It(t,n){const i=t[t.length-1];for(let s=1;s<=n;s++){const o=e.progress(0,n,s);t.push(G(i,1,o))}}function Nt(t){const e=[0];return It(e,t.length-1),e}function Ut(t,e){return t.map(t=>t*e)}function $t(t,n){return t.map(()=>n||e.easeInOut).splice(0,t.length-1)}function Wt({duration:t=300,keyframes:n,times:i,ease:s="easeInOut"}){const o=e.isEasingArray(s)?s.map(e.easingDefinitionToFunction):e.easingDefinitionToFunction(s)||e.easeInOut,r={done:!1,value:n[0]};if(2===n.length&&!Array.isArray(o)&&(!i||2!==i.length||0===i[0]&&1===i[1])){const[i,s]=n,a=i===s?void 0:(e.MotionGlobalConfig.mix||st)(i,s);return{calculatedDuration:t,next:n=>(r.value=a?a(o(t>0?e.clamp(0,1,n/t):1)):s,r.done=n>=t,r)}}const a=Ot(Ut(i&&i.length===n.length?i:Nt(n),t),n,{ease:Array.isArray(o)?o:$t(n,o)});return{calculatedDuration:t,next:e=>(r.value=a(e),r.done=e>=t,r)}}Lt.applyToOptions=t=>{const n=mt(t,100,Lt);return t.ease=n.ease,t.duration=e.secondsToMilliseconds(n.duration),t.type="keyframes",t};function zt(t,n,i=0){return n<=0?i:t.velocity?t.velocity(n):function(t,n,i){const s=Math.max(n-5,0);return e.velocityPerSecond(i-t(s),n-s)}(e=>t.next(e).value,n,t.next(n).value)}const Kt=t=>null!==t;function Gt(t,{repeat:e,repeatType:n="loop"},i,s=1){const o=t.filter(Kt),r=s<0||e&&"loop"!==n&&e%2==1?0:o.length-1;return r&&void 0!==i?i:o[r]}const Yt={decay:Ft,inertia:Ft,tween:Wt,keyframes:Wt,spring:Lt};function Xt(t){"string"==typeof t.type&&(t.type=Yt[t.type])}const qt=(t,n)=>n-t>40&&!e.MotionGlobalConfig.useManualTiming?n:t;function Ht(t,e){return{kind:t,animation:e,timestamp:o.now(),frameTimestamp:n.timestamp,frameIsProcessing:n.isProcessing}}function _t(t,e,n){const i=globalThis.__MOTION_INSPECT__;if(i)try{i({...Ht("animation-start",t),options:n?{...e,...n}:e})}catch{}}class Zt{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 Jt=t=>t/100;class Qt extends Zt{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!==o.now()&&this.tick(o.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause(),_t(this,this.options)}initAnimation(){const{options:t}=this;Xt(t);const{type:n=Wt,repeat:i=0,repeatDelay:s=0,repeatType:o,velocity:r=0}=t;let{keyframes:a}=t;const l=n||Wt;l!==Wt&&"number"!=typeof a[0]&&(this.mixKeyframes=e.pipe(Jt,st(a[0],a[1])),a=[0,100]);const c=l(a===t.keyframes?t:{...t,keyframes:a});"mirror"===o&&(this.mirroredGenerator=l({...t,keyframes:[...a].reverse(),velocity:-r})),null===c.calculatedDuration&&(c.calculatedDuration=pt(c));const{calculatedDuration:u}=c;this.calculatedDuration=u,this.resolvedDuration=u+s,this.totalDuration=this.resolvedDuration*(i+1)-s,this.generator=c}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,n=!1){const{generator:i,totalDuration:s,mixKeyframes:o,mirroredGenerator:r,resolvedDuration:a,calculatedDuration:l}=this;if(null===this.startTime)return i.next(0);const{delay:c=0,keyframes:u,repeat:h,repeatType:d,repeatDelay:p,type:m,onUpdate:f,finalKeyframe:y}=this.options;this.startTime===this.pendingStartTime&&(this.startTime=qt(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-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?g<0:g>s;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=s);let x,T=this.currentTime,w=i;if(h){const t=Math.min(this.currentTime,s)/a;let n=Math.floor(t),i=t%1;!i&&t>=1&&(i=1),1===i&&n--,n=Math.min(n,h+1);Boolean(n%2)&&("reverse"===d?(i=1-i,p&&(i-=p/a)):"mirror"===d&&(w=r)),T=e.clamp(0,1,i)*a}v?(this.delayState.value=u[0],x=this.delayState):x=w.next(T),o&&!v&&(x.value=o(x.value));let{done:b}=x;v||null===l||(b=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&b);return S&&m!==Ft&&(x.value=Gt(u,this.options,y,this.speed)),f&&f(x.value),S&&this.finish(),x}then(t,e){return this.finished.then(t,e)}get duration(){return e.millisecondsToSeconds(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+e.millisecondsToSeconds(t)}get time(){return e.millisecondsToSeconds(this.currentTime)}set time(t){t=e.secondsToMilliseconds(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 zt(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(o.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=e.millisecondsToSeconds(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=ut,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(o.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}const te=new Set(["brightness","contrast","saturate","opacity"]);function ee(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(y)||[];if(!i)return t;const s=n.replace(i,"");let o=te.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+s+")"}const ne=/\b([a-z-]*)\(.*?\)/gu,ie={...$,getAnimatableNone:t=>{const e=t.match(ne);return e?e.map(ee).join(" "):t}},se={...$,getAnimatableNone:t=>{const e=$.parse(t);return $.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},oe={...p,transform:Math.round},re={rotate:A,pathRotation:A,rotateX:A,rotateY:A,rotateZ:A,scale:f,scaleX:f,scaleY:f,scaleZ:f,skew:A,skewX:A,skewY:A,distance:V,translateX:V,translateY:V,translateZ:V,x:V,y:V,z:V,perspective:V,transformPerspective:V,opacity:m,originX:k,originY:k,originZ:V},ae={borderWidth:V,borderTopWidth:V,borderRightWidth:V,borderBottomWidth:V,borderLeftWidth:V,borderRadius:V,borderTopLeftRadius:V,borderTopRightRadius:V,borderBottomRightRadius:V,borderBottomLeftRadius:V,width:V,maxWidth:V,height:V,maxHeight:V,top:V,right:V,bottom:V,left:V,inset:V,insetBlock:V,insetBlockStart:V,insetBlockEnd:V,insetInline:V,insetInlineStart:V,insetInlineEnd:V,padding:V,paddingTop:V,paddingRight:V,paddingBottom:V,paddingLeft:V,paddingBlock:V,paddingBlockStart:V,paddingBlockEnd:V,paddingInline:V,paddingInlineStart:V,paddingInlineEnd:V,margin:V,marginTop:V,marginRight:V,marginBottom:V,marginLeft:V,marginBlock:V,marginBlockStart:V,marginBlockEnd:V,marginInline:V,marginInlineStart:V,marginInlineEnd:V,fontSize:V,backgroundPositionX:V,backgroundPositionY:V,...re,zIndex:oe,fillOpacity:m,strokeOpacity:m,numOctaves:oe},le={...ae,color:C,backgroundColor:C,outlineColor:C,fill:C,stroke:C,borderColor:C,borderTopColor:C,borderRightColor:C,borderBottomColor:C,borderLeftColor:C,filter:ie,WebkitFilter:ie,mask:se,WebkitMask:se},ce=t=>le[t],ue=new Set([ie,se]);function he(t,e){let n=ce(t);return ue.has(n)||(n=$),n.getAnimatableNone?n.getAnimatableNone(e):void 0}function de(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const pe=t=>180*t/Math.PI,me=t=>{const e=pe(Math.atan2(t[1],t[0]));return ye(e)},fe={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:me,rotateZ:me,skewX:t=>pe(Math.atan(t[1])),skewY:t=>pe(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},ye=t=>((t%=360)<0&&(t+=360),t),ge=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),ve=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),xe={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ge,scaleY:ve,scale:t=>(ge(t)+ve(t))/2,rotateX:t=>ye(pe(Math.atan2(t[6],t[5]))),rotateY:t=>ye(pe(Math.atan2(-t[2],t[0]))),rotateZ:me,rotate:me,skewX:t=>pe(Math.atan(t[4])),skewY:t=>pe(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Te(t){return t.includes("scale")?1:0}function we(t,e){if(!t||"none"===t)return Te(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,s;if(n)i=xe,s=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=fe,s=e}if(!s)return Te(e);const o=i[e],r=s[1].split(",").map(Se);return"function"==typeof o?o(r):r[o]}const be=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return we(n,e)};function Se(t){return parseFloat(t.trim())}const Ae=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Pe=(()=>new Set([...Ae,"pathRotation"]))(),Ve=t=>t===p||t===V,Me=new Set(["x","y","z"]),Ee=Ae.filter(t=>!Me.has(t));const ke=new Set(["bottom","right"]);function De(t,e,n,i,s,o){const r=parseFloat(t);if(!isNaN(r))return r;const{min:a,max:l}=e()[n],c=l-a;return"border-box"===o?c:c-parseFloat(i)-parseFloat(s)}const Ce={width:({width:t,paddingLeft:e="0",paddingRight:n="0",boxSizing:i},s)=>De(t,s,"x",e,n,i),height:({height:t,paddingTop:e="0",paddingBottom:n="0",boxSizing:i},s)=>De(t,s,"y",e,n,i),top:({top:t})=>parseFloat(t),left:({left:t})=>parseFloat(t),bottom:({top:t},e)=>{const{y:n}=e();return parseFloat(t)+(n.max-n.min)},right:({left:t},e)=>{const{x:n}=e();return parseFloat(t)+(n.max-n.min)},x:({transform:t})=>we(t,"x"),y:({transform:t})=>we(t,"y")};Ce.translateX=Ce.x,Ce.translateY=Ce.y;const Re=new Set;let Be=!1,je=!1,Le=!1;function Fe(){if(je){const t=[],e=new Set,n=new Set;Re.forEach(i=>{i.needsMeasurement&&(t.push(i),e.add(i.element),ke.has(i.name)&&n.add(i.element))});const i=new Map;n.forEach(t=>{const e=function(t){const e=[];return Ee.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)})}je=!1,Be=!1,Re.forEach(t=>t.complete(Le)),Re.clear()}function Oe(){Re.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(je=!0)})}function Ie(){Le=!0,Oe(),Fe(),Le=!1}class Ne{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?(Re.add(this),Be||(Be=!0,at.read(Oe),at.resolveKeyframes(Fe))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:i,motionValue:s}=this;if(null===t[0]){const o=s?.get(),r=t[t.length-1];if(void 0!==o)t[0]=o;else if(i&&n){const s=function(t,n,i){if("string"==typeof t){if(e.isNumericalString(t)||e.isZeroValueString(t))return parseFloat(t);if(!$.test(t)&&$.test(i))return he(n,i)}return t??void 0}(i.readValue(n,r),n,r);void 0!==s&&(t[0]=s)}void 0===t[0]&&(t[0]=r),s&&void 0===o&&s.set(t[0])}de(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Re.delete(this)}cancel(){"scheduled"===this.state&&(Re.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const Ue=t=>t.startsWith("--");function $e(t,e,n){Ue(e)?t.style.setProperty(e,n):t.style[e]=n}const We={};function ze(t,n){const i=e.memo(t);return()=>We[n]??i()}const Ke=ze(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),Ge=ze(()=>void 0!==window.ViewTimeline,"viewTimeline"),Ye=ze(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),Xe=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,qe={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Xe([0,.65,.55,1]),circOut:Xe([.55,0,1,.45]),backIn:Xe([.31,.01,.66,-.59]),backOut:Xe([.33,1.53,.69,.99])};function He(t,n){return t?"function"==typeof t?Ye()?ht(t,n):"ease-out":e.isBezierDefinition(t)?Xe(t):Array.isArray(t)?t.map(t=>He(t,n)||qe.easeOut):qe[t]:void 0}function _e(t,e,n,{delay:i=0,duration:s=300,repeat:o=0,repeatType:r="loop",ease:a="easeOut",times:l}={},c=void 0){const u={[e]:n};l&&(u.offset=l);const h=He(a,s);Array.isArray(h)&&(u.easing=h);const d={delay:i,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:o+1,direction:"reverse"===r?"alternate":"normal"};return c&&(d.pseudoElement=c),t.animate(u,d)}function Ze(t){return"function"==typeof t&&"applyToOptions"in t}function Je({type:t,...e}){return Ze(t)&&Ye()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class Qe extends Zt{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:i,keyframes:s,pseudoElement:o,allowFlatten:r=!1,finalKeyframe:a,onComplete:l}=t;this.isPseudoElement=Boolean(o),this.allowFlatten=r,this.options=t,e.invariant("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const c=Je(t);this.animation=_e(n,i,s,c,o),!1===c.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const t=Gt(s,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(t),$e(n,i,t),this.animation.cancel()}l?.(),this.notifyFinished()},_t(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(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return e.millisecondsToSeconds(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+e.millisecondsToSeconds(t)}get time(){return e.millisecondsToSeconds(Number(this.animation.currentTime)||0)}set time(t){const n=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=e.secondsToMilliseconds(t),n&&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:n,observe:i}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&Ke()?(this.animation.timeline=t,n?.(this.animation),e.noop):i(this)}}const tn={anticipate:e.anticipate,backInOut:e.backInOut,circInOut:e.circInOut};function en(t){"string"==typeof t.ease&&t.ease in tn&&(t.ease=tn[t.ease])}class nn extends Qe{constructor(t){en(t),Xt(t),super(t),void 0!==t.startTime&&!1!==t.autoplay&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:i,onComplete:s,element:r,...a}=this.options;if(!n)return;if(void 0!==t)return void n.set(t);const l=new Qt({...a,autoplay:!1}),c=Math.max(10,o.now()-this.startTime),u=e.clamp(0,10,c-10),h=l.sample(c).value,{name:d}=this.options;r&&d&&$e(r,d,h),n.setWithVelocity(l.sample(Math.max(0,c-u)).value,h,u),l.stop()}}const sn=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!$.test(t)&&"0"!==t||t.startsWith("url(")));function on(t){t.duration=0,t.type="keyframes"}const rn=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),an=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;const ln=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),cn=e.memo(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function un(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:o,type:r,keyframes:a}=t;if(!n||!rn.has(n)&&!ln.has(n))return!1;const l=e?.owner?.current;if(!(l instanceof HTMLElement||l instanceof SVGElement))return!1;const{onUpdate:c,transformTemplate:u}=e.owner.getProps();return cn()&&(rn.has(n)||ln.has(n)&&function(t){for(let e=0;e<t.length;e++)if("string"==typeof t[e]&&an.test(t[e]))return!0;return!1}(a))&&("transform"!==n||!u)&&!c&&!i&&"mirror"!==s&&0!==o&&"inertia"!==r}class hn extends Zt{constructor(t){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=o.now();const{keyframes:e,name:n,motionValue:i,element:s}=t,r=t;r.autoplay??(r.autoplay=!0),r.delay??(r.delay=0),r.type??(r.type="keyframes"),r.repeat??(r.repeat=0),r.repeatDelay??(r.repeatDelay=0),r.repeatType??(r.repeatType="loop");const a=s?.KeyframeResolver||Ne;this.keyframeResolver=new a(e,(t,e,n)=>this.onKeyframesResolved(t,e,r,!n),n,i,s),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,i,s){this.keyframeResolver=void 0;const{name:r,type:a,velocity:l,delay:c,isHandoff:u,onUpdate:h}=i;this.resolvedAt=o.now();let d=!0;(function(t,n,i,s){const o=t[0];if(null===o)return!1;if("display"===n||"visibility"===n)return!0;const r=t[t.length-1],a=sn(o,n),l=sn(r,n);return a&&l?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"===i||Ze(i))&&s:(a!==l&&e.warning(!1,`You are trying to animate ${n} from "${o}" to "${r}". "${a?r:o}" is not an animatable value.`,"value-not-animatable"),!1)})(t,r,a,l)||(d=!1,!e.MotionGlobalConfig.instantAnimations&&c||h?.(Gt(t,i,n)),t[0]=t[t.length-1],on(i),i.repeat=0);const{onComplete:p}=i;i.finalKeyframe=n,i.keyframes=t,i.onComplete=()=>{p?.(),this.notifyFinished()};const m=d&&!u&&un(i);let f;if(s&&(m||this.resolvedAt!==this.createdAt)&&(i.startTime??(i.startTime=qt(this.createdAt,this.resolvedAt))),m){i.element=i.motionValue?.owner?.current;try{f=new nn(i)}catch{f=new Qt(i)}}else f=new Qt(i);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(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Ie()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}class dn{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 pn(this.animations,"duration")}get iterationDuration(){return pn(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 pn(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 mn extends Qe{constructor(t){super(),this.animation=t,t.onfinish=()=>{this.finishedTime=this.time,this.notifyFinished()},_t(this,{})}}const fn=new WeakMap;function yn(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 gn={current:void 0};class vn{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=o.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.notifyChange(),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=o.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,n){var i;return"change"===t?this.onChangeSubscribe(n):((i=this.events)[t]||(i[t]=new e.SubscriptionManager)).add(n)}onChangeSubscribe(t){const{events:n}=this;return n.change||this.changeSubscriber?(n.change||(n.change=new e.SubscriptionManager,n.change.add(this.changeSubscriber),this.changeSubscriber=void 0),n.change.add(t)):this.changeSubscriber=t,()=>{this.changeSubscriber===t?this.changeSubscriber=void 0:n.change?.remove(t),this.stopIfUnobserved()}}stopIfUnobserved(){at.read(()=>{this.changeSubscriber||this.events.change?.getSize()||this.stop()})}clearListeners(){this.changeSubscriber=void 0;for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.notifyChange()}notifyChange(){const{current:t,changeSubscriber:e}=this;e?e(t):this.events.change?.notify(t)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return gn.current&&gn.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=o.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,30);return e.velocityPerSecond(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0;let n,i=!1;n=t(()=>{i=!0,this.events.animationComplete?.notify(),this.animation===n&&this.clearAnimation(),e()}),i||(this.animation=n),this.events.animationStart?.notify()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){this.animation=void 0}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function xn(t,e){return new vn(t,e)}function Tn(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}function wn(t,e){const n=t?.[e]??t?.default??t;return n!==t?Tn(n,t):n}const bn={type:"spring",stiffness:500,damping:25,restSpeed:10},Sn={type:"keyframes",duration:.8},An={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Pn=(t,{keyframes:e})=>e.length>2?Sn:Pe.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:bn:An,Vn=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function Mn(t){for(const e in t)if(!Vn.has(e))return!0;return!1}const En=(t,n,i,s={},o,r)=>a=>{const l=wn(s,t)||{},c=l.delay||s.delay||0;let{elapsed:u=0}=s;u-=e.secondsToMilliseconds(c);const h={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:n.getVelocity(),...l,delay:-u,onUpdate:t=>{n.set(t),l.onUpdate&&l.onUpdate(t)},onComplete:()=>{a(),l.onComplete&&l.onComplete()},name:t,motionValue:n,element:r?void 0:o};Mn(l)||Object.assign(h,Pn(t,h)),h.duration&&(h.duration=e.secondsToMilliseconds(h.duration)),h.repeatDelay&&(h.repeatDelay=e.secondsToMilliseconds(h.repeatDelay)),void 0!==h.from&&(h.keyframes[0]=h.from);let d=!1;if((!1===h.type||0===h.duration&&!h.repeatDelay)&&(on(h),0===h.delay&&(d=!0)),(e.MotionGlobalConfig.instantAnimations||e.MotionGlobalConfig.skipAnimations||o?.shouldSkipAnimations||l.skipAnimations)&&(d=!0,on(h),h.delay=0),h.allowFlatten=!l.type&&!l.ease,d&&!r&&void 0!==n.get()){const t=Gt(h.keyframes,l);if(void 0!==t)return void at.update(()=>{h.onUpdate(t),h.onComplete()})}return l.isSync?new Qt(h):new hn(h)};function kn(t,e,n,i){const s=1-t;return s*s*e+2*s*t*n+t*t*i}function Dn(t,e,n,i,s,o,r){const a=2*(1-t)*(n-e)+2*t*(i-n),l=2*(1-t)*(o-s)+2*t*(r-o);return Math.atan2(l,a)*(180/Math.PI)}function Cn(t,e,n,i,s,o){const r=n-t,a=i-e,l=Math.sqrt(r*r+a*a);if(l>0){const n=s*l;return{x:t+r*o+-a/l*n,y:e+a*o+r/l*n}}return{x:t,y:e}}const Rn=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Bn(t){const e=Rn.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n??i}`,s]}function jn(t,n,i=1){e.invariant(i<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,o]=Bn(t);if(!s)return;const r=window.getComputedStyle(n).getPropertyValue(s);if(r){const t=r.trim();return e.isNumericalString(t)?parseFloat(t):t}return u(o)?jn(o,n,i+1):o}function Ln(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 Fn(t,e,n){return Ln(t.getProps(),e,n,t)}const On=(t,e)=>"exit"===e?t.presenceContext?.custom:void 0,In=new Set(["width","height","top","left","right","bottom",...Ae]),Nn=t=>Array.isArray(t);function Un(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,xn(n))}function $n(t){return Nn(t)?t[t.length-1]||0:t}function Wn(t,e){const n=Fn(t,e);let{transitionEnd:i={},transition:s={},...o}=n||{};o={...o,...i};for(const e in o){Un(t,e,$n(o[e]))}}const zn=t=>Boolean(t&&t.getVelocity);function Kn(t){return Boolean(zn(t)&&t.add)}function Gn(t,n){const i=t.getValue("willChange");if(Kn(i))return i.add(n);if(!i&&e.MotionGlobalConfig.WillChange){const i=new e.MotionGlobalConfig.WillChange("auto");t.addValue("willChange",i),i.add(n)}}function Yn(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const Xn="framerAppearId",qn="data-"+Yn(Xn);function Hn(t){return t.props[qn]}const _n="undefined"!=typeof window;function Zn({protectedKeys:t,needsAnimating:e},n){const i=n in t&&!e[n];return e[n]=!1,i}function Jn(t,e,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:o,transitionEnd:r,...a}=e;const l=t.getDefaultTransition();o=o?Tn(o,l):l;const c=o?.reduceMotion,u=o?.skipAnimations;i&&(o=i);const h=[],d=s&&t.animationState?.getState()[s],p=o?.path;p&&p.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&&Zn(d,e))continue;const r={delay:n,...wn(o||{},e)};u&&(r.skipAnimations=!0);const l=i.get();if(void 0!==l&&!i.isAnimating()&&!Array.isArray(s)&&s===l&&!r.velocity){at.update(()=>i.set(s));continue}let p=!1;if(_n&&window.MotionHandoffAnimation){const n=Hn(t);if(n){const t=window.MotionHandoffAnimation(n,e,at);null!==t&&(r.startTime=t,p=!0)}}Gn(t,e);const m=c??t.shouldReduceMotion;i.start(En(e,i,s,m&&In.has(e)?{type:!1}:r,t,p));const f=i.animation;f&&h.push(f)}if(r){const e=()=>at.update(()=>{r&&Wn(t,r)});h.length?Promise.all(h).then(e):e()}return h}function Qn(t,e,n={}){const i=Fn(t,e,On(t,n.type)),s=n.transitionOverride||(i?.transition??(t.getDefaultTransition()||{})),o=()=>Promise.all(i?Jn(t,i,n):[]),r=(i=0)=>{const{variantChildren:o}=t,{delayChildren:r=0,staggerChildren:a,staggerDirection:l}=s,c=[];return o?.forEach(t=>{t.notify("AnimationStart",e),c.push(Qn(t,e,{...n,delay:i+("function"==typeof r?0:r)+yn(o,t,r,a,l)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(c)},{when:a}=s;return a?"beforeChildren"===a?o().then(()=>r()):r().then(o):Promise.all([o(),r(n.delay)])}function ti(t,e,n={}){t.notify("AnimationStart",e);return(Array.isArray(e)?Promise.all(e.map(e=>Qn(t,e,n))):"string"==typeof e?Qn(t,e,n):Promise.all(Jn(t,Fn(t,e,n.custom),n))).then(()=>{t.notify("AnimationComplete",e)})}const ei=t=>e=>e.test(t),ni=[p,V,P,A,E,M,{test:t=>"auto"===t,parse:t=>t}],ii=t=>ni.find(ei(t));function si(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||e.isZeroValueString(t))}const oi=new Set(["auto","none","0"]);class ri extends Ne{constructor(t,e,n,i,s){super(t,e,n,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){let i=t[n];if("string"==typeof i&&(i=i.trim(),u(i))){const s=jn(i,e.current);void 0!==s&&(t[n]=s),n===t.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!In.has(n)||2!==t.length)return;const[i,s]=t;if("number"==typeof i&&"number"==typeof s)return;const o=ii(i),r=ii(s);if(d(i)!==d(s)&&Ce[n])this.needsMeasurement=!0;else if(o!==r)if(Ve(o)&&Ve(r))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else Ce[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)(null===t[e]||si(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&&!oi.has(e)&&O(e)&&(i=t[s]),s++}if(i&&n)for(const s of e)t[s]!==i&&(t[s]=he(n,i))}(t,n,e)}measure(){const{element:t,name:e}=this;return Ce[e](window.getComputedStyle(t.current),()=>t.measureViewportBox())}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),e[0]=this.measuredOrigin;const i=e[e.length-1];void 0!==i&&this.motionValue?.jump(i,!1)}measureEndState(){const{element:t,unresolvedKeyframes:e}=this;if(!t||!t.current)return;this.motionValue?.jump(this.measuredOrigin,!1);const n=e.length-1,i=e[n];e[n]=this.measure(),null!==i&&void 0===this.finalKeyframe&&(this.finalKeyframe=i),this.removedTransforms?.length&&this.removedTransforms.forEach(([e,n])=>{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const ai=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],li=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius",...ai,"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"]);const ci=e.memo(()=>{try{document.createElement("div").animate({opacity:[1]})}catch(t){return!1}return!0}),ui=[];function hi(t){e.removeItem(ui,t)}function di(t,e,n={},i){const s=[],{velocity:o}=n,r=n.reduceMotion??i?.shouldReduceMotion;for(const a in e){if("transition"===a||"transitionEnd"===a)continue;const l=e[a];if(void 0===l)continue;const c=t(a),u=c.get();void 0===u||c.isAnimating()||Array.isArray(l)||l!==u||o?(c.start(En(a,c,l,r&&In.has(a)?{type:!1}:n,i)),c.animation&&s.push(c.animation)):at.update(()=>c.set(l))}const{transitionEnd:a}=e;if(a){const e=()=>at.update(()=>{for(const e in a)t(e).set(a[e])});s.length?Promise.all(s).then(e):e()}return s}function pi(t,n,i,s,o){return di(s=>{let r=t.get(n,s);if(!r){let a;if(!o){const o=i[s];a=function(t){const e=Array.isArray(t)?t[0]:void 0;return null===e?void 0:e}(o)??t.read(n,s,o),e.invariant(void 0!==a,`"${s}" can't be read from the animated subject. Provide [from, to] keyframes.`,"effect-unreadable-value")}r=xn(a,{owner:o}),t(n,{[s]:r})}return r},i,s,o)}function mi(t){return e.isObject(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}function fi(t){return e.isObject(t)&&"ownerSVGElement"in t}const yi=(t,e)=>e&&"number"==typeof t?e.transform(t):t;function gi(t,e,n){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let i=document;e&&(i=e.current);const s=n?.[t]??i.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t).filter(t=>null!=t)}function vi(t){const{test:e,read:n,get:i,flush:s,state:o}=t;return Object.assign((e,n)=>{const i=gi(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 xi{constructor(t=at.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 Ti(t,{step:e,...n}={}){const i=new WeakMap;return Object.assign((n,s)=>{const o=i.get(n)??new xi(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 wi={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},bi={};const Si=new Set(["originX","originY","originZ"]),Ai=(t,e)=>yi(t.get(e)?.get(),ae[e]),Pi=(t,e,n,i)=>{let s,o;if(Pe.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)=>Ae.indexOf(t)-Ae.indexOf(e)))}e.get("transform")||(mi(t)||e.get("transformBox")||Pi(t,e,"transformBox",new vn("fill-box")),e.set("transform",new vn("none"),()=>{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].get();void 0!==o&&(("number"==typeof o?o:parseFloat(o))!==(s.startsWith("scale")?1:0)&&(e+=(e&&" ")+(bi[s]||(bi[s]=(wi[s]||s)+"("))+yi(o,re[s])+")"))}const s=t.get("pathRotation")?.get();return s&&(e+=(e&&" ")+"rotate("+yi(s,re.pathRotation)+")"),e||"none"}(e)})),o=e.get("transform")}else Si.has(n)?(e.get("transformOrigin")||e.set("transformOrigin",new vn(""),()=>{const n=Ai(e,"originX")??"50%",i=Ai(e,"originY")??"50%",s=Ai(e,"originZ")??0;t.style.transformOrigin=`${n} ${i} ${s}`}),o=e.get("transformOrigin")):s=Ue(n)?()=>{t.style.setProperty(n,i.get())}:()=>{t.style[n]=yi(i.get(),ae[n])};return e.set(n,i,s,o)},Vi=(t,e)=>{if(Pe.has(e))return be(t,e);const n=getComputedStyle(t),i=Ue(e)?n.getPropertyValue(e):n[e];return"string"==typeof i&&i.trim()||0},Mi=Ti(Pi,{test:t=>mi(t)||fi(t),read:Vi}),Ei=vi(Mi),ki={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Di=Ae.length;function Ci(t,e,n){let i="",s=!0;for(let o=0;o<Di;o++){const r=Ae[o],a=t[r];if(void 0===a)continue;let l=!0;if("number"==typeof a)l=a===(r.startsWith("scale")?1:0);else{const t=parseFloat(a);l=r.startsWith("scale")?1===t:0===t}if(!l||n){const t=yi(a,ae[r]);if(!l){s=!1;i+=`${ki[r]||r}(${t}) `}n&&(e[r]=t)}}const o=t.pathRotation;return o&&(s=!1,i+=`rotate(${yi(o,ae.pathRotation)}) `),i=i.trim(),n?i=n(e,s?"":i):s&&(i="none"),i}function Ri(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(Pe.has(t))r=!0;else if(l(t))s[t]=n;else{const e=yi(n,ae[t]);t.startsWith("origin")?(a=!0,o[t]=e):i[t]=e}}if(e.transform||(r||n?i.transform=Ci(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 Bi={offset:"stroke-dashoffset",array:"stroke-dasharray"},ji={offset:"strokeDashoffset",array:"strokeDasharray"};function Li(t,e,n=1,i=0,s=!0){t.pathLength=1;const o=s?Bi:ji;t[o.offset]=""+-i,t[o.array]=`${e} ${n}`}const Fi=["transform","opacity","clipPath","filter","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Oi(t,{attrX:e,attrY:n,attrScale:i,pathLength:s,pathSpacing:o=1,pathOffset:r=0,...a},l,c,u){if(Ri(t,a,c),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:h,style:d}=t;for(const t of Fi)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&&Li(h,s,o,r,!1)}const Ii=(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=Yn(s));const r=ae[n]||ae[s],a=o?()=>{t[s]=yi(i.get(),ae[n])}:()=>{const e=yi(i.get(),r);null==e?t.removeAttribute(s):t.setAttribute(s,String(e))};return e.set(n,i,a)},Ni=vi(Ti(Ii));const Ui=(t,e,n,i)=>{if(n.startsWith("path"))return function(t,e,n,i){return at.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 vn("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 Ii(t,e,n,i,Ki(n));return(Pe.has(n)||Si.has(n)||Ue(n)||n in t.style?Pi:Ii)(t,e,n,i)},$i=(t,e)=>Pe.has(e)?ae[e]?.default||0:Ue(e)||Fi.includes(e)?Vi(t,e)||t.getAttribute(Yn(e))||0:(e=Ki(e),t.getAttribute(Yn(e))??t.getAttribute(e)??void 0),Wi=Ti(Ui,{test:fi,read:$i}),zi=vi(Wi);function Ki(t){return t.replace(/^attr([A-Z])/,(t,e)=>e.toLowerCase())}function Gi({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function Yi(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 Xi(t){return void 0===t||1===t}function qi({scale:t,scaleX:e,scaleY:n}){return!Xi(t)||!Xi(e)||!Xi(n)}function Hi(t){return qi(t)||_i(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function _i(t){return Zi(t.x)||Zi(t.y)}function Zi(t){return t&&"0%"!==t}function Ji(t,e,n){return n+e*(t-n)}function Qi(t,e,n,i,s){return void 0!==s&&(t=Ji(t,s,i)),Ji(t,n,i)+e}function ts(t,e=0,n=1,i,s){t.min=Qi(t.min,e,n,i,s),t.max=Qi(t.max,e,n,i,s)}function es(t,{x:e,y:n}){ts(t.x,e.translate,e.scale,e.originPoint),ts(t.y,n.translate,n.scale,n.originPoint)}const ns=.999999999999,is=1.0000000000001;function ss(t,e,n,i=!1){const s=n.length;if(!s)return;let o,r;e.x=e.y=1;for(let a=0;a<s;a++){o=n[a],r=o.projectionDelta;const{visualElement:s}=o.options;s&&s.props.style&&"contents"===s.props.style.display||(i&&o.options.layoutScroll&&o.scroll&&o!==o.root&&(os(t.x,-o.scroll.offset.x),os(t.y,-o.scroll.offset.y)),r&&(e.x*=r.x.scale,e.y*=r.y.scale,es(t,r)),i&&Hi(o.latestValues)&&ls(t,o.latestValues,o.layout?.layoutBox))}e.x<is&&e.x>ns&&(e.x=1),e.y<is&&e.y>ns&&(e.y=1)}function os(t,e){t.min+=e,t.max+=e}function rs(t,e,n,i,s=.5){ts(t,e,n,G(t.min,t.max,s),i)}function as(t,e){return"string"==typeof t?parseFloat(t)/100*(e.max-e.min):t}function ls(t,e,n){const i=n??t;rs(t.x,as(e.x,i.x),e.scaleX,e.scale,e.originX),rs(t.y,as(e.y,i.y),e.scaleY,e.scale,e.originY)}function cs(t,e){return Gi(Yi(t.getBoundingClientRect(),e))}const us={},hs=t=>fi(t)?Wi:Mi;class ds{constructor(t,e){this.effect=t,this.current=e,this.KeyframeResolver=ri}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 cs(this.current)}getProps(){return us}}function ps(t,e){const n=hs(t).state(t);if(!n)return;const{transformKeys:i}=n;n.release().forEach((t,n)=>{"transformBox"===n||"transform"===n&&i?.length||e.addValue(n,t)})}const ms=Ti((t,e,n,i)=>e.set(n,i,()=>{t[n]=i.get()}),{test:t=>e.isObject(t),read:(t,e)=>{const n=t[e];return"string"==typeof n||"number"==typeof n?n:void 0}}),{schedule:fs,cancel:ys}=rt(queueMicrotask,!1),gs={x:!1,y:!1};function vs(){return gs.x||gs.y}function xs(t,e){const n=gi(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}const Ts=(t,e)=>!!e&&(t===e||Ts(t,e.parentElement)),ws=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,bs=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Ss(t){return bs.has(t.tagName)||!0===t.isContentEditable}const As=new Set(["INPUT","SELECT","TEXTAREA"]);const Ps=new WeakSet;function Vs(t){return e=>{"Enter"===e.key&&t(e)}}function Ms(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function Es(t){return ws(t)&&!vs()}const ks=new WeakSet;const Ds=new WeakMap;let Cs;const Rs=(t,e,n)=>(i,s)=>s&&s[0]?s[0][t+"Size"]:fi(i)&&"getBBox"in i?i.getBBox()[e]:i[n],Bs=Rs("inline","width","offsetWidth"),js=Rs("block","height","offsetHeight");function Ls({target:t,borderBoxSize:e}){Ds.get(t)?.forEach(n=>{n(t,{get width(){return Bs(t,e)},get height(){return js(t,e)}})})}function Fs(t){t.forEach(Ls)}function Os(t,e){Cs||"undefined"!=typeof ResizeObserver&&(Cs=new ResizeObserver(Fs));const n=gi(t);return n.forEach(t=>{let n=Ds.get(t);n||(n=new Set,Ds.set(t,n)),n.add(e),Cs?.observe(t)}),()=>{n.forEach(t=>{const n=Ds.get(t);n?.delete(e),n?.size||Cs?.unobserve(t)})}}const Is=new Set;let Ns;function Us(t){return Is.add(t),Ns||(Ns=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Is.forEach(e=>e(t))},window.addEventListener("resize",Ns)),()=>{Is.delete(t),Is.size||"function"!=typeof Ns||(window.removeEventListener("resize",Ns),Ns=void 0)}}const $s={value:null,addProjectionMetrics:null};function Ws(t){return fi(t)&&"svg"===t.tagName}function zs(t,e){if("first"===t)return 0;{const n=e-1;return"last"===t?n:n/2}}function Ks(...t){const e=!Array.isArray(t[0]),n=e?0:-1,i=t[0+n],s=Ot(t[1+n],t[2+n],t[3+n]);return e?s(i):s}const Gs=new Set,Ys=({timestamp:t})=>{Gs.forEach(e=>e.tick(t))};class Xs extends Zt{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():(Gs.size||at.update(Ys,!0),Gs.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=qt(this.startTime,t));const r=Math.round(t-this.startTime)-i,a=this.currentTime=Math.max(0,r),l=this.generator.next(a),c=r<0?e.keyframes[0]:l.value;if(n){this.hasNextTarget=!1;const{keyframes:t}=e;t[0]=c,t[1]=this.nextTarget,this.retarget(t,this.nextVelocity??this.getGeneratorVelocity())}!n&&this.started||(this.started=!0,o?.()),"running"===this.state&&(s?.(c),l.done&&r>=0&&!n&&!this.hasNextTarget&&"running"===this.state&&(this.notifyFinished(),this.teardown(),this.state="finished",e.onComplete?.()))}getGeneratorVelocity(){return zt(this.generator,this.currentTime,this.options.velocity)}now(){return this.driver?this.driver.now():o.now()}teardown(){this.state="idle",this.driver?this.driver.stop():(Gs.delete(this),Gs.size||lt(Ys))}}const qs=t=>"number"==typeof t?t:parseFloat(t);function Hs(t,e,n){const i=t.get();let s,o=null;const r="string"==typeof i?i.replace(/[\d.-]/g,""):void 0,a=t=>s(r?t+r:t),l=()=>t.events.animationStart?.notify(),c=()=>{o&&(o.stop(),o=null),t.animation=void 0};if(t.attach((e,i)=>{s=i;const r=qs(e);if("running"===o?.state)return void o.setTarget(r,n.velocity);const u=qs(t.get()),h=o?o.getGeneratorVelocity():t.getVelocity();if(c(),u===r)return;const d={keyframes:[u,r],velocity:h,restDelta:.001,restSpeed:.01,...n,onUpdate:a},p=o=new Xs({...d,onPlay:l});t.animation=p,p.then(()=>{o===p&&(o=null,t.animation=void 0,t.events.animationComplete?.notify())})},c),zn(e)){let i=!0===n.skipInitialAnimation;const s=e.on("change",e=>{i?(i=!1,t.jump(_s(e,r),!1)):t.set(_s(e,r))}),o=t.on("destroy",s);return()=>{s(),o()}}return c}function _s(t,e){return e?t+e:t}function Zs(t,e,n={}){const i={type:"spring",...n};return Xt(i),i.type=i.type||Wt,Hs(t,e,i)}function Js(t){const e=[];gn.current=e;const n=t();gn.current=void 0;const i=xn(n);return function(t,e,n){const i=()=>e.set(n()),s=()=>at.preRender(i,!1,!0),o=t.map(t=>t.on("change",s));e.on("destroy",()=>{o.forEach(t=>t()),lt(i)})}(e,i,t),i}function Qs(t,e,n){return Hs(t,e,{...n,type:Lt})}const to=[...ni,C,$];let eo=0;const no=()=>"motion-view-"+eo++;function io(t,e,n){e&&(t.style?.setProperty("view-transition-class",e),n.push(t))}function so(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 oo(t,e,n,i,s,o=[],r,a=[],l){const c=gi(t);if(i)return c.map((t,c)=>{const u=e.get(t);if(u)return u;const h=i[c]??no();return t.style?.setProperty("view-transition-name",h),n.push(t),e.set(t,h),io(t,s,o),so(t,h,r,a,l),h});const u=c.map(t=>e.has(t)?void 0:getComputedStyle(t).getPropertyValue("view-transition-name"));return c.map((t,i)=>{const c=e.get(t);if(c)return c;const h=u[i];let d;return h&&"none"!==h&&"auto"!==h&&"match-element"!==h&&!(t=>t.startsWith("motion-view-"))(h)?d=h:(d=no(),t.style?.setProperty("view-transition-name",d),n.push(t)),e.set(t,d),io(t,s,o),so(t,d,r,a,l),d})}function ro(t){return"layout"===t?"group":"enter"===t||"new"===t?"new":"old"}let ao={},lo=null;const co=(t,e)=>{ao[t]=e},uo=()=>{lo||(lo=document.createElement("style"),lo.id="motion-view");let t="";for(const e in ao){const n=ao[e];t+=`${e} {\n`;for(const[e,i]of Object.entries(n))t+=` ${e}: ${i};\n`;t+="}\n"}lo.textContent=t,document.head.appendChild(lo),ao={}},ho=()=>{lo&&lo.parentElement&&lo.parentElement.removeChild(lo)};function po(t){const e=t.match(/::view-transition-(old|new|group-children|group|image-pair)\((.*?)\)/);return e?{layer:e[2],type:e[1]}:null}function mo(){return document.getAnimations().filter(t=>{const{effect:e}=t;return!!e&&e.target===document.documentElement&&e.pseudoElement?.startsWith("::view-transition")})}const fo=["layout","enter","exit","new","old"],yo=t=>t.split(" ").every(t=>0===parseFloat(t)),go={group:["layout"],new:["new","enter"],old:["old","exit"]},vo={new:{opacity:0,scale:.85},old:{opacity:1,scale:1}};function xo(t){const{update:n,targets:i,resolveDefs:s,cropOverride:o,pairs:r,classNames:a,flatGroups:l,options:c}=t;if(!document.startViewTransition)return(async()=>(await n(),new dn([])))();const u=new Map,h=[],d=[],p=[],m=new Set,f=new Map,y=new Set,g=new Map,v=new Map,x=new Map,T=new Map,w=t=>{i.forEach((e,n)=>{const i=a.get(n),c="root"!==n&&s.has(n)?l.has(n)?"none":"contain":void 0;let y;if("root"!==n&&s.has(n))if(r.has(n))if("old"===t)T.set(n,gi(n)),y=oo(n,u,h,void 0,i,d,c,p,m),x.set(n,y);else{for(const t of T.get(n)??[])t.style?.removeProperty("view-transition-name"),u.delete(t);y=oo(r.get(n),u,h,x.get(n),i,d,c,p,m)}else y=oo(n,u,h,void 0,i,d,c,p,m);else y=[n];const w=o.get(n);y.forEach((n,i)=>{const s=f.get(n);f.set(n,s&&s!==e?{...s,...e}:e),void 0!==w&&g.set(n,w);const o=v.get(n)??{};o[t]=[i,y.length],v.set(n,o)})})},b=(t,e)=>{const n=v.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=To(wn(c,n),wn(function(t,e){for(const n of go[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},A=t=>{const[n,i]=b(t,"group"),s=S(f.get(t),"group","layout",-1===n?0:n,i);s.duration&&(s.duration=e.secondsToMilliseconds(s.duration));const{delay:o=0,duration:r,ease:a}=Je(s);return{delay:e.secondsToMilliseconds(o),duration:r,ease:a}},P=new Map,V=t=>u.forEach((e,n)=>{const i=n,s=i.getBoundingClientRect?.();if(s&&s.height){const n=getComputedStyle(i),o={};for(const t of ai)o[t]=n[t];const r=P.get(e)??{};r[t]={width:s.width,height:s.height,radii:o},P.set(e,r)}}),M=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},E=()=>{(function(t,e){return e.has(t)&&Object.keys(e.get(t)).length>0})("root",i)||co(":root",{"view-transition-name":"none"}),co("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)",{"animation-timing-function":"linear !important"}),y.forEach(t=>{co(`::view-transition-group(${t})`,{overflow:"clip"}),co(`::view-transition-old(${t}), ::view-transition-new(${t})`,{width:"100%",height:"100%","object-fit":"cover"})}),m.forEach(t=>{co(`::view-transition-group-children(${t})`,{overflow:"clip"})}),uo()},k=()=>{!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")}(h,d,p),ho()},D=async()=>{await n(),w("new"),V("new"),(()=>{y.clear();for(const t of v.keys())"root"!==t&&(g.get(t)??M(t))&&y.add(t)})(),E()};let C;try{w("old"),V("old"),E(),C=document.startViewTransition(D)}catch(t){return k(),Promise.reject(t)}return C.finished.finally(k),new Promise((t,n)=>{C.ready.then(()=>{const n=mo(),i=[],s=new Set,o=new Set;f.forEach((t,n)=>{const r=v.get(n),a=!!r?.new&&!r?.old,l=!!r?.old&&!r?.new;for(const r of fo){if(!t[r])continue;if("enter"===r&&!a)continue;if("exit"===r&&!l)continue;const u=ro(r),[h,d]=b(n,u);if(-1===h)continue;const{keyframes:p,options:m}=t[r];for(let[f,y]of Object.entries(p)){if(null==y)continue;if("x"===f||"y"===f){e.warnOnce(!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"===r&&a&&null!=t.enter?.keyframes[f])continue;if("old"===r&&l&&null!=t.exit?.keyframes[f])continue;const p=To(wn(c,f),wn(m,f));if(!Array.isArray(y)){const e="enter"===r?t.exit?.keyframes[f]:void 0,n="opacity"===f||("new"===u?a:l),i=null!=e?Array.isArray(e)?e[e.length-1]:e:n?vo[u]?.[f]:void 0;void 0!==i&&(y=[i,y])}"function"==typeof p.delay&&(p.delay=p.delay(h,d)),p.duration&&(p.duration=e.secondsToMilliseconds(p.duration)),p.delay&&(p.delay=e.secondsToMilliseconds(p.delay)),i.push(new Qe({...p,element:document.documentElement,name:f,pseudoElement:`::view-transition-${u}(${n})`,keyframes:y})),s.add(`${n}:${u}`),"opacity"===f&&o.add(`${n}:${u}`)}}});for(const t of n){if("finished"===t.playState)continue;const{effect:n}=t;if(!(n&&n instanceof KeyframeEffect))continue;const{pseudoElement:r}=n;if(!r)continue;const a=po(r);if(!a)continue;const l=f.get(a.layer);if(s.has(`${a.layer}:${a.type}`)){o.has(`${a.layer}:new`)&&o.has(`${a.layer}:old`)&&n.getKeyframes().some(t=>t.mixBlendMode)?i.push(new mn(t)):t.cancel();continue}const c="old"===a.type?"new":"new"===a.type?"old":void 0;if(c&&s.has(`${a.layer}:${c}`)&&!o.has(`${a.layer}:${c}`)){t.cancel();continue}const u=v.get(a.layer),h=!("old"!==a.type&&"new"!==a.type||!u?.old||!u?.new);let d;if(a.type.startsWith("group")){const{delay:t,duration:e,ease:n}=A(a.layer);d={delay:t,duration:e,easing:He(n,e)}}else{const t=h?"group":a.type,[n,i]=b(a.layer,t);let s=S(l,t,"group"===t?"layout":"",-1===n?0:n,i);const o=s.visualDuration;s.duration&&(s.duration=e.secondsToMilliseconds(s.duration)),s=Je(s),d={delay:e.secondsToMilliseconds(s.delay??0),duration:h&&void 0!==o?e.secondsToMilliseconds(o):s.duration,easing:h?"linear":He(s.ease,s.duration)}}n.updateTiming(d),i.push(new mn(t))}P.forEach((t,e)=>{if(!y.has(e))return;const{delay:n,duration:s,ease:o}=A(e);for(const r of ai){const a=t.old?.radii[r]||t.new?.radii[r]||"0px",l=t.new?.radii[r]||t.old?.radii[r]||"0px";yo(a)&&yo(l)||i.push(new Qe({element:document.documentElement,name:r,pseudoElement:`::view-transition-group(${e})`,keyframes:[a,l],delay:n,duration:s,ease:o}))}}),t(new dn(i))}).catch(()=>C.updateCallbackDone.then(()=>t(new dn([])),n))})}function To(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 wo=[],bo=null;function So(){bo=null;const[t]=wo;var n;t&&(n=t,e.removeItem(wo,n),bo=n,xo(n).then(t=>(n.notifyReady(t),t.finished)).catch(t=>n.notifyReject(t)).finally(So))}function Ao(){for(let t=wo.length-1;t>=0;t--){const e=wo[t],{interrupt:n}=e.options;if("immediate"===n){const n=wo.slice(0,t+1).map(t=>t.update),i=wo.slice(t+1);e.update=()=>{n.forEach(t=>t())},wo=[e,...i];break}}bo&&"immediate"!==wo[0]?.options.interrupt||So()}class Po{constructor(t,n={}){var i;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=e.noop,this.notifyReject=e.noop,this.readyPromise=new Promise((t,e)=>{this.notifyReady=t,this.notifyReject=e}),this.update=t,this.options={interrupt:"wait",...n},this.readyPromise.catch(e.noop),i=this,wo.push(i),fs.render(Ao)}add(t,e){return this.currentSubject=t,this.resolveDefs.add(t),void 0!==e&&this.pairs.set(t,e),this.targets.has(t)||this.targets.set(t,{}),this}crop(t=!0){return this.cropOverride.set(this.currentSubject,t),this}group(t=!0){return t?this.flatGroups.delete(this.currentSubject):this.flatGroups.add(this.currentSubject),this}class(t){return this.classNames.set(this.currentSubject,t),this}layout(t={}){return this.updateTarget("layout",{},t),this}enter(t,e){return this.updateTarget("enter",t,e),this}exit(t,e){return this.updateTarget("exit",t,e),this}new(t,e){return this.updateTarget("new",t,e),this}old(t,e){return this.updateTarget("old",t,e),this}updateTarget(t,e,n={}){const{currentSubject:i,targets:s}=this;s.has(i)||s.set(i,{});s.get(i)[t]={keyframes:e,options:n}}then(t,e){return this.readyPromise.then(t,e)}}const Vo=()=>({translate:0,scale:1,origin:0,originPoint:0}),Mo=()=>({x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}),Eo=()=>({min:0,max:0}),ko=()=>({x:{min:0,max:0},y:{min:0,max:0}}),Do=new WeakMap;function Co(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function Ro(t){return"string"==typeof t||Array.isArray(t)}const Bo=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],jo=["initial",...Bo];function Lo(t){if(Co(t.animate))return!0;for(let e=0;e<jo.length;e++)if(Ro(t[jo[e]]))return!0;return!1}function Fo(t){return Boolean(Lo(t)||t.variants)}function Oo(t,e,n){for(const i in e){const s=e[i],o=n[i];if(zn(s))t.addValue(i,s);else if(zn(o))t.addValue(i,xn(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,xn(void 0!==e?e:s,{owner:t}))}}for(const i in n)void 0===e[i]&&t.removeValue(i);return e}const Io={current:null},No={current:!1},Uo="undefined"!=typeof window;function $o(){if(No.current=!0,Uo)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Io.current=t.matches;t.addEventListener("change",e),e()}else Io.current=!1}const Wo=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let zo={};class Ko{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:i,skipAnimations:s,blockInitialAnimation:r,visualState:a},l={}){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=Ne,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=o.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,at.render(this.render,!1,!0))};const{latestValues:c,renderState:u}=a;this.latestValues=c,this.baseTarget={...c},this.initialValues=e.initial?{...c}:{},this.renderState=u,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=s,this.options=l,this.blockInitialAnimation=Boolean(r),this.isControllingVariants=Lo(e),this.isVariantNode=Fo(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:h,...d}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in d){const e=d[t];void 0!==c[t]&&zn(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,Do.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.isVariantNode&&!this.isControllingVariants){let t=this;do{t=!1!==t.props.inherit&&t.parent}while(t&&!t.isVariantNode);if(t){const{variantChildren:e}=t;e.add(this),this.removeFromVariantTree=()=>e.delete(this)}}this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(No.current||$o(),this.shouldReduceMotion=Io.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),lt(this.notifyUpdate),lt(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&rn.has(t)&&this.current instanceof HTMLElement){const{factory:i,keyframes:s,times:o,ease:r,duration:a}=n.accelerate,l=new Qe({element:this.current,name:t,keyframes:s,times:o,ease:r,duration:e.secondsToMilliseconds(a)}),c=i(l);return void this.valueSubscriptions.set(t,()=>{c(),l.cancel()})}const i=Pe.has(t);i&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&at.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),o&&o()})}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 zo){const e=zo[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){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<Wo.length;e++){const n=Wo[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const i=t["on"+n];i&&(this.propEventSubscriptions[n]=this.on(n,i))}this.prevMotionValues=Oo(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}addValue(t,e){const n=this.values.get(t);if(e!==n){n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e);const i=e.get();void 0!==i&&(this.latestValues[t]=i)}}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=xn(e??this.getDefaultValue?.(t),{owner:this}),this.addValue(t,n)),n}readValue(t,n){let i=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];return null!=i&&("string"==typeof i&&(e.isNumericalString(i)||e.isZeroValueString(i))?i=parseFloat(i):"number"!=typeof i&&!$.test(i)&&$.test(n)&&(i=he(t,n)),this.setBaseTarget(t,zn(i)?i.get():i)),zn(i)?i.get():i}setBaseTarget(t,e){this.baseTarget[t]=e}on(t,n){return this.events[t]||(this.events[t]=new e.SubscriptionManager),this.events[t].add(n)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){fs.render(this.render)}}class Go extends Ko{constructor(){super(...arguments),this.KeyframeResolver=ri}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;zn(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}function Yo(t,{style:e,vars:n},i,s){const o=t.style;let r;for(r in e)o[r]=e[r];for(r in s?.applyProjectionStyles(o,i),n)o.setProperty(r,n[r])}const Xo={};function qo(t,{layout:e,layoutId:n}){return Pe.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!Xo[t]||"opacity"===t)}function Ho(t,e,n){const i=t.style,s=e?.style,o={};if(!i)return o;for(const e in i)(zn(i[e])||s&&zn(s[e])||qo(e,t)||void 0!==n?.getValue(e)?.liveStyle)&&(o[e]=i[e]);return o}class _o extends Go{constructor(){super(...arguments),this.type="html",this.renderInstance=Yo}mount(t){e.invariant(Boolean(t.style),"motion.create() components must forward their ref to a HTML or SVG element","custom-component-ref"),super.mount(t)}readValueFromInstance(t,e){if(Pe.has(e))return this.projection?.isProjecting?Te(e):be(t,e);{const i=(n=t,window.getComputedStyle(n)),s=(l(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return cs(t,e)}build(t,e,n){Ri(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return Ho(t,e,n)}}const Zo=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"]),Jo=t=>"string"==typeof t&&"svg"===t.toLowerCase();function Qo(t,e,n,i){Yo(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(Zo.has(n)?n:Yn(n),e.attrs[n])}function tr(t,e,n){const i=Ho(t,e,n);for(const n in t)if(zn(t[n])||zn(e[n])){i[-1!==Ae.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return i}function er(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 nr=[...Bo].reverse();function ir(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!er(e,t)}function sr(){const t={};for(const e of Bo)t[e]={isActive:"animate"===e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}};return t}const or=jo.length;function rr(t,e){t.min=e.min,t.max=e.max}function ar(t,e){rr(t.x,e.x),rr(t.y,e.y)}function lr(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function cr(t){return t.max-t.min}function ur(t,e,n){return Math.abs(t-e)<=n}function hr(t,e,n,i=.5){t.origin=i,t.originPoint=G(e.min,e.max,t.origin),t.scale=cr(n)/cr(e),t.translate=G(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 dr(t,e,n,i){hr(t.x,e.x,n.x,i?i.originX:void 0),hr(t.y,e.y,n.y,i?i.originY:void 0)}function pr(t,e,n,i=0){const s=i?G(n.min,n.max,i):n.min;t.min=s+e.min,t.max=t.min+cr(e)}function mr(t,e,n,i){pr(t.x,e.x,n.x,i?.x),pr(t.y,e.y,n.y,i?.y)}function fr(t,e,n,i=0){const s=i?G(n.min,n.max,i):n.min;t.min=e.min-s,t.max=t.min+cr(e)}function yr(t,e,n,i){fr(t.x,e.x,n.x,i?.x),fr(t.y,e.y,n.y,i?.y)}function gr(t,e,n,i,s){return t=Ji(t-=e,1/n,i),void 0!==s&&(t=Ji(t,1/s,i)),t}function vr(t,e=0,n=1,i=.5,s,o=t,r=t){if(P.test(e)){e=parseFloat(e);e=G(r.min,r.max,e/100)-r.min}if("number"!=typeof e)return;let a=G(o.min,o.max,i);t===o&&(a-=e),t.min=gr(t.min,e,n,a,s),t.max=gr(t.max,e,n,a,s)}function xr(t,e,[n,i,s],o,r){vr(t,e[n],e[i],e[s],e.scale,o,r)}const Tr=["x","scaleX","originX"],wr=["y","scaleY","originY"];function br(t,e,n,i){xr(t.x,e,Tr,n?n.x:void 0,i?i.x:void 0),xr(t.y,e,wr,n?n.y:void 0,i?i.y:void 0)}function Sr(t){return 0===t.translate&&1===t.scale}function Ar(t){return Sr(t.x)&&Sr(t.y)}function Pr(t,e){return t.min===e.min&&t.max===e.max}function Vr(t,e){return Pr(t.x,e.x)&&Pr(t.y,e.y)}function Mr(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Er(t,e){return Mr(t.x,e.x)&&Mr(t.y,e.y)}function kr(t){return cr(t.x)/cr(t.y)}function Dr(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Cr(t){return[t("x"),t("y")]}function Rr(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Br={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!V.test(t))return t;t=parseFloat(t)}return`${Rr(t,e.target.x)}% ${Rr(t,e.target.y)}%`}},jr={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=$.parse(t);if(s.length>5)return i;const o=$.createTransformer(t),r="number"!=typeof s[0]?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;s[0+r]/=a,s[1+r]/=l;const c=G(a,l,.5);return"number"==typeof s[2+r]&&(s[2+r]/=c),"number"==typeof s[3+r]&&(s[3+r]/=c),o(s)}};function Lr(t,e,n){let i="";const s=t.x.translate/e.x,o=t.y.translate/e.y,r=n?.z||0;if((s||o||r)&&(i=`translate3d(${s}px, ${o}px, ${r}px) `),1===e.x&&1===e.y||(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:t,rotate:e,pathRotation:s,rotateX:o,rotateY:r,skewX:a,skewY:l}=n;t&&(i=`perspective(${t}px) ${i}`),e&&(i+=`rotate(${e}deg) `),s&&(i+=`rotate(${s}deg) `),o&&(i+=`rotateX(${o}deg) `),r&&(i+=`rotateY(${r}deg) `),a&&(i+=`skewX(${a}deg) `),l&&(i+=`skewY(${l}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return 1===a&&1===l||(i+=`scale(${a}, ${l})`),i||"none"}const Fr=ai.length,Or=t=>"number"==typeof t||V.test(t);function Ir(t,e,n,i,s,o){s?(t.opacity=G(0,n.opacity??1,Ur(i)),t.opacityExit=G(e.opacity??1,0,$r(i))):o&&(t.opacity=G(e.opacity??1,n.opacity??1,i));for(let s=0;s<Fr;s++){const o=ai[s];let r=Nr(e,o),a=Nr(n,o);if(void 0===r&&void 0===a)continue;r||(r=0),a||(a=0);0===r||0===a||Or(r)===Or(a)?(t[o]=Math.max(G(qs(r),qs(a),i),0),(P.test(a)||P.test(r))&&(t[o]+="%")):t[o]=a}(e.rotate||n.rotate)&&(t.rotate=G(e.rotate||0,n.rotate||0,i))}function Nr(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const Ur=Wr(0,.5,e.circOut),$r=Wr(.5,.95,e.noop);function Wr(t,n,i){return s=>s<t?0:s>n?1:i(e.progress(t,n,s))}function zr(t,e,n){const i=zn(t)?t:xn(t);return i.start(En("",i,e,n)),i.animation}function Kr(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n,i)}const Gr=(t,e)=>t.depth-e.depth;class Yr{constructor(){this.children=[],this.isDirty=!1}add(t){e.addUniqueItem(this.children,t),this.isDirty=!0}remove(t){e.removeItem(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Gr),this.isDirty=!1,this.children.forEach(t)}}function Xr(t,e){const n=o.now(),i=({timestamp:s})=>{const o=s-n;o>=e&&(lt(i),t(o-e))};return at.setup(i,!0),()=>lt(i)}function qr(t){return zn(t)?t.get():t}class Hr{constructor(){this.members=[]}add(t){e.addUniqueItem(this.members,t);for(let n=this.members.length-1;n>=0;n--){const i=this.members[n];if(i===t||i===this.lead||i===this.prevLead)continue;const s=i.instance;s&&!1!==s.isConnected||i.snapshot||(e.removeItem(this.members,i),i.unmount())}t.scheduleRender()}remove(t){if(e.removeItem(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)}}const _r={borderRadius:{...Br,applyTo:[...ai]},borderTopLeftRadius:Br,borderTopRightRadius:Br,borderBottomLeftRadius:Br,borderBottomRightRadius:Br,boxShadow:jr},Zr={hasAnimatedSinceResize:!0,hasEverUpdated:!1};Object.assign(Xo,{..._r,...Xo});const Jr={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},Qr=["","X","Y","Z"];let ta=0;function ea(t,e,n,i){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),i&&(i[t]=0))}function na(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Hn(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:e,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",at,!(e||i))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&na(i)}function ia({attachResizeListener:t,defaultParent:i,measureScroll:s,checkIsScrollRoot:r,resetTransform:a}){return class{constructor(t={},e=i?.()){this.id=ta++,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,$s.value&&(Jr.nodes=Jr.calculatedTargetDeltas=Jr.calculatedProjections=0),this.nodes.forEach(ra),this.nodes.forEach(ya),this.nodes.forEach(ga),this.nodes.forEach(aa),$s.addProjectionMetrics&&$s.addProjectionMetrics(Jr)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=e?e.root||e:this,this.path=e?[...e.path,e]:[],this.parent=e,this.depth=e?e.depth+1:0;for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new Yr)}addEventListener(t,n){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new e.SubscriptionManager),this.eventHandlers.get(t).add(n)}notifyListeners(t,...e){const n=this.eventHandlers.get(t);n&&n.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}mount(e){if(this.instance)return;this.isSVG=fi(e)&&!Ws(e),this.instance=e;const{layoutId:n,layout:i,visualElement:s}=this.options;if(s&&!s.current&&s.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(i||n)&&(this.isLayoutDirty=!0),t){let n,i=0;const s=()=>this.root.updateBlockedByResize=!1;at.read(()=>{i=window.innerWidth}),t(e,()=>{const t=window.innerWidth;t!==i&&(i=t,this.root.updateBlockedByResize=!0,n&&n(),n=Xr(s,250),Zr.hasAnimatedSinceResize&&(Zr.hasAnimatedSinceResize=!1,this.nodes.forEach(fa)))})}n&&this.root.registerSharedNode(n,this),!1!==this.options.animate&&s&&(n||i)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeLayoutChanged:n,layout:i})=>{if(this.isAnimationBlocked)return this.target=void 0,void(this.relativeTarget=void 0);const o=this.options.transition||s.getDefaultTransition()||Sa,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=s.getProps(),l=!this.targetLayout||!Er(this.targetLayout,i),c=!e&&n;if(this.options.layoutRoot||this.resumeFrom||c||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const e={...wn(o,"layout"),onPlay:r,onComplete:a};(s.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e),this.setAnimationOrigin(t,c,e.path)}else e||fa(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=i})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),lt(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(va),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&na(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){const e=this.path[t];e.shouldResetTransform=!0,"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(ua),void this.nodes.forEach(ca)}if(this.animationId<=this.animationCommitId)return void this.nodes.forEach(ha);this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(da),this.nodes.forEach(pa),this.nodes.forEach(ma),this.nodes.forEach(sa),this.nodes.forEach(oa)):this.nodes.forEach(ha),this.clearAllSnapshots();const t=o.now();n.delta=e.clamp(0,1e3/60,t-n.timestamp),n.timestamp=t,n.isProcessing=!0,ct.update.process(n),ct.preRender.process(n),ct.render.process(n),n.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,fs.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(la),this.sharedNodes.forEach(xa)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,at.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){at.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||cr(this.snapshot.measuredBox.x)||cr(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t<this.path.length;t++){this.path[t].updateScroll()}const t=this.layout;this.layout=this.measure(!1),this.layoutCorrected||(this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}}),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:e}=this.options;e&&e.notify("LayoutMeasure",this.layout.layoutBox,t?t.layoutBox:void 0)}updateScroll(t="measure"){let e=Boolean(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===t&&(e=!1),e&&this.instance){const e=r(this.instance);this.scroll={animationId:this.root.animationId,phase:t,isRoot:e,offset:s(this.instance),wasRoot:this.scroll?this.scroll.isRoot:e}}}resetTransform(){if(!a)return;const t=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,e=this.projectionDelta&&!Ar(this.projectionDelta),n=this.getTransformTemplate(),i=n?n(this.latestValues,""):void 0,s=i!==this.prevTransformTemplateValue;t&&this.instance&&(e||Hi(this.latestValues)||s)&&(a(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)),Va((i=n).x),Va(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(Ea))){const{scroll:t}=this.root;t&&(os(e.x,t.offset.x),os(e.y,t.offset.y))}return e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};if(ar(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&&ar(e,t),os(e.x,s.offset.x),os(e.y,s.offset.y))}return e}applyTransform(t,e=!1,n){const i=n||{x:{min:0,max:0},y:{min:0,max:0}};ar(i,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];!e&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(os(i.x,-n.scroll.offset.x),os(i.y,-n.scroll.offset.y)),Hi(n.latestValues)&&ls(i,n.latestValues,n.layout?.layoutBox)}return Hi(this.latestValues)&&ls(i,this.latestValues,this.layout?.layoutBox),i}removeTransform(t){const e={x:{min:0,max:0},y:{min:0,max:0}};ar(e,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];if(!Hi(n.latestValues))continue;let i;n.instance&&(qi(n.latestValues)&&n.updateSnapshot(),i=ko(),ar(i,n.measurePageBox())),br(e,n.latestValues,n.snapshot?.layoutBox,i)}return Hi(this.latestValues)&&br(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}}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!==n.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 i=Boolean(this.resumingFrom)||this!==e;if(!(t||i&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:s,layoutId:o}=this.options;if(!this.layout||!s&&!o)return;this.resolvedRelativeTargetAt=n.timestamp;const r=this.getClosestProjectingParent();this.targetDelta||this.relativeTarget||(!1!==this.options.layoutAnchor&&r&&r.layout?this.createRelativeTarget(r,this.layout.layoutBox,r.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(),mr(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):ar(this.target,this.layout.layoutBox),es(this.target,this.targetDelta)):ar(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,!1!==this.options.layoutAnchor&&r&&Boolean(r.resumingFrom)===Boolean(this.resumingFrom)&&!r.options.layoutScroll&&r.target&&1!==this.animationProgress?this.createRelativeTarget(r,this.target,r.target):this.relativeParent=this.relativeTarget=void 0),$s.value&&Jr.calculatedTargetDeltas++)}getClosestProjectingParent(){if(this.parent&&!qi(this.parent.latestValues)&&!_i(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(t,e,n){this.relativeParent=t,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},yr(this.relativeTargetOrigin,e,n,this.options.layoutAnchor||void 0),ar(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const t=this.getLead(),e=Boolean(this.resumingFrom)||this!==t;let i=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(i=!1),e&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(i=!1),this.resolvedRelativeTargetAt===n.timestamp&&(i=!1),i)return;const{layout:s,layoutId:o}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!s&&!o)return;ar(this.layoutCorrected,this.layout.layoutBox);const r=this.treeScale.x,a=this.treeScale.y;ss(this.layoutCorrected,this.treeScale,this.path,e),!t.layout||t.target||1===this.treeScale.x&&1===this.treeScale.y||(t.target=t.layout.layoutBox,t.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:l}=t;l?(this.projectionDelta&&this.prevProjectionDelta?(lr(this.prevProjectionDelta.x,this.projectionDelta.x),lr(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),dr(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.treeScale.x===r&&this.treeScale.y===a&&Dr(this.projectionDelta.x,this.prevProjectionDelta.x)&&Dr(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l)),$s.value&&Jr.calculatedProjections++):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){if(this.options.visualElement?.scheduleRender(),t){const t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}}setAnimationOrigin(t,e=!1,n){const i=this.snapshot,s=i?i.latestValues:{},o={...this.latestValues},r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;const a={x:{min:0,max:0},y:{min:0,max:0}},l=(i?i.source:void 0)!==(this.layout?this.layout.source:void 0),c=this.getStack(),u=!c||c.members.length<=1,h=Boolean(l&&!u&&!0===this.options.crossfade&&!this.path.some(ba));let d;this.animationProgress=0;const p=n?.interpolateProjection(t);this.mixTargetDelta=e=>{const n=e/1e3,i=p?.(n);var c,m,f,y;i?(r.x.translate=i.x,r.x.scale=G(t.x.scale,1,n),r.x.origin=t.x.origin,r.x.originPoint=t.x.originPoint,r.y.translate=i.y,r.y.scale=G(t.y.scale,1,n),r.y.origin=t.y.origin,r.y.originPoint=t.y.originPoint):(Ta(r.x,t.x,n),Ta(r.y,t.y,n)),this.setTargetDelta(r),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(yr(a,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),c=this.relativeTarget,m=this.relativeTargetOrigin,f=a,y=n,wa(c.x,m.x,f.x,y),wa(c.y,m.y,f.y,y),d&&Vr(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),ar(d,this.relativeTarget)),l&&(this.animationValues=o,Ir(o,s,this.latestValues,n,h,u)),i&&void 0!==i.rotate&&(this.animationValues||(this.animationValues=o),this.animationValues.pathRotation=i.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(lt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=at.update(()=>{Zr.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=xn(0)),this.motionValue.jump(0,!1),this.currentAnimation=zr(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({...Ht("layout-animation-start",t),node:e})}catch{}}(this.currentAnimation,this),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead(),{targetWithTransforms:e,layout:n,latestValues:i}=t;let{target:s}=t;if(e&&s&&n){if(this!==t&&this.layout&&n&&Ma(this.options.animationType,this.layout.layoutBox,n.layoutBox)){s=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=cr(this.layout.layoutBox.x);s.x.min=t.target.x.min,s.x.max=s.x.min+e;const n=cr(this.layout.layoutBox.y);s.y.min=t.target.y.min,s.y.max=s.y.min+n}ar(e,s),ls(e,i),dr(this.projectionDeltaWithTransform,this.layoutCorrected,e,i)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new Hr);this.sharedNodes.get(t).add(e);const n=e.options.initialPromotionConfig;e.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){const{layoutId:t}=this.options;return t&&this.getStack()?.lead||this}getPrevLead(){const{layoutId:t}=this.options;return t?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const i=this.getStack();i&&i.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:n}=t;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(e=!0),!e)return;const i={};n.z&&ea("z",t,i,this.animationValues);for(let e=0;e<Qr.length;e++)ea(`rotate${Qr[e]}`,t,i,this.animationValues),ea(`skew${Qr[e]}`,t,i,this.animationValues);t.render();for(const e in i)t.setStaticValue(e,i[e]),this.animationValues&&(this.animationValues[e]=i[e]);t.scheduleRender()}applyProjectionStyles(t,e){if(!this.instance||this.isSVG)return;if(!this.isVisible)return void(t.visibility="hidden");const n=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,t.visibility="",t.opacity="",t.pointerEvents=qr(e?.pointerEvents)||"",void(t.transform=n?n(this.latestValues,""):"none");const i=this.getLead();if(!this.projectionDelta||!this.layout||!i.target)return this.options.layoutId&&(t.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,t.pointerEvents=qr(e?.pointerEvents)||""),void(this.hasProjected&&!Hi(this.latestValues)&&(t.transform=n?n({},""):"none",this.hasProjected=!1));t.visibility="";const s=i.animationValues||i.latestValues;this.applyTransformsToTarget();let o=Lr(this.projectionDeltaWithTransform,this.treeScale,s);n&&(o=n(s,o)),t.transform=o;const{x:r,y:a}=this.projectionDelta;t.transformOrigin=`${100*r.origin}% ${100*a.origin}% 0`,i.animationValues?t.opacity=i===this?s.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:s.opacityExit:t.opacity=i===this?void 0!==s.opacity?s.opacity:"":void 0!==s.opacityExit?s.opacityExit:0;for(const e in Xo){if(void 0===s[e])continue;const{correct:n,applyTo:r,isCSSVariable:a}=Xo[e],l="none"===o?s[e]:n(s[e],i);if(r){const e=r.length;for(let n=0;n<e;n++)t[r[n]]=l}else a?this.options.visualElement.renderState.vars[e]=l:t[e]=l}this.options.layoutId&&(t.pointerEvents=i===this?qr(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(ca),this.root.sharedNodes.clear()}}}function sa(t){t.updateLayout(),function(t){const{snapshot:e,dragAncestor:n}=t,i=n?.layout;if(!e||!i||t.resumeFrom||t.isAnimationBlocked)return;const s=n.dragSnapshot;Cr(t=>os(e.layoutBox[t],i.layoutBox[t].min-s.layoutBox[t].min))}(t)}function oa(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=t.layout,{animationType:s}=t.options,o=e.source!==t.layout.source;if("size"===s)Cr(t=>{const i=o?e.measuredBox[t]:e.layoutBox[t],s=cr(i);i.min=n[t].min,i.max=i.min+s});else if("x"===s||"y"===s){const t="x"===s?"y":"x";rr(o?e.measuredBox[t]:e.layoutBox[t],n[t])}else Ma(s,e.layoutBox,n)&&Cr(i=>{const s=o?e.measuredBox[i]:e.layoutBox[i],r=cr(n[i]);s.max=s.min+r,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[i].max=t.relativeTarget[i].min+r)});const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};dr(r,n,e.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?dr(a,t.applyTransform(i,!0),e.measuredBox):dr(a,n,e.layoutBox);const l=!Ar(r);let c=!1;if(!t.resumeFrom){const i=t.getClosestProjectingParent();if(i&&!i.resumeFrom){const{snapshot:s,layout:o}=i;if(s&&o){const r=t.options.layoutAnchor||void 0,a={x:{min:0,max:0},y:{min:0,max:0}};yr(a,e.layoutBox,s.layoutBox,r);const l={x:{min:0,max:0},y:{min:0,max:0}};yr(l,n,o.layoutBox,r),Er(a,l)||(c=!0),i.options.layoutRoot&&(t.relativeTarget=l,t.relativeTargetOrigin=a,t.relativeParent=i)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function ra(t){$s.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 aa(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function la(t){t.clearSnapshot()}function ca(t){t.clearMeasurements()}function ua(t){t.isLayoutDirty=!0,t.updateLayout()}function ha(t){t.isLayoutDirty=!1}function da(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.dragSnapshot||t.layout,t.isLayoutDirty=!0)}function pa(t){t.relativeTarget&&t.relativeParent?.isLayoutDirty&&(t.currentAnimation?t.isLayoutDirty=!0:(t.targetDelta=void 0,t.removeRelativeTarget()))}function ma(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function fa(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function ya(t){t.resolveTargetDelta()}function ga(t){t.calcProjection()}function va(t){t.resetSkewAndRotation()}function xa(t){t.removeLeadSnapshot()}function Ta(t,e,n){t.translate=G(e.translate,0,n),t.scale=G(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function wa(t,e,n,i){t.min=G(e.min,n.min,i),t.max=G(e.max,n.max,i)}function ba(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const Sa={duration:.45,ease:[.4,0,.1,1]},Aa=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Pa=Aa("applewebkit/")&&!Aa("chrome/")?Math.round:e.noop;function Va(t){t.min=Pa(t.min),t.max=Pa(t.max)}function Ma(t,e,n){return"position"===t||"preserve-aspect"===t&&!ur(kr(e),kr(n),.2)}function Ea(t){return t!==t.root&&t.scroll?.wasRoot}const ka=ia({attachResizeListener:(t,e)=>Kr(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Da=t=>!t.isLayoutDirty&&t.willUpdate(!1);const Ca={current:void 0},Ra=ia({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Ca.current){const t=new ka({});t.mount(window),t.setOptions({layoutScroll:!0}),Ca.current=t}return Ca.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),Ba="[data-layout],[data-layout-id]",ja=new WeakMap;let La;function Fa(t){const e=[];return t instanceof HTMLElement&&t.matches(Ba)&&e.push(t),t.querySelectorAll(Ba).forEach(t=>{t instanceof HTMLElement&&e.push(t)}),e}function Oa(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 Ia(t,e){let n=ja.get(t);if(n)n.setOptions(Oa(t,e));else{let i=Do.get(t);i||(i=new _o({props:{},presenceContext:null,visualState:{latestValues:{},renderState:{transform:{},transformOrigin:{},style:{},vars:{}}}},{allowProjection:!0}),ps(t,i)),t.style.transform&&!Hi(i.latestValues)&&(t.style.transform=""),n=new Ra(i.latestValues,function(t){let e=t.parentElement;for(;e;){const t=ja.get(e);if(t&&t.instance)return t;e=e.parentElement}}(t)),i.projection=n,n.setOptions({...Oa(t,e),visualElement:i}),n.mount(t),ja.set(t,n)}return n.isPresent=!0,n.options.onExitComplete&&n.setOptions({onExitComplete:void 0}),n}function Na(t,e){e.setOptions({onExitComplete:void 0});e.getStack()&&!e.isLead()||e.currentAnimation?.stop(),e.unmount(),ja.delete(t)}function Ua(){const t=La;La=void 0,function(){if(n.isProcessing)return;const t=o.now();n.delta=e.clamp(0,1e3/60,t-n.timestamp),n.timestamp=t,n.isProcessing=!0,ct.update.process(n),ct.preRender.process(n),ct.render.process(n),n.isProcessing=!1}();const i=new Map;for(const e of t)for(const t of e.collectTargets()){const n=i.get(t);n?n.push(e):i.set(t,[e])}const s=new Map;for(const t of(r=i.keys(),[...r].sort((t,e)=>t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1))){const e=i.get(t),n=Ia(t,e[e.length-1].transitionFor(t));for(const i of e)i.adopt(t,n);s.set(t,n)}var r;s.forEach(t=>{t.isLayoutDirty=!1,t.willUpdate()});const a=[];for(const e of t){const t=e.runUpdate();t&&a.push(t)}const l=()=>{const e=new Set;for(const n of t)n.reconcileAdditions(e);for(const n of t)n.reconcileRemovals(e);let n;s.forEach(t=>n||(n=t.root));for(const e of t)n||(n=e.getRoot());n?.didUpdate(),fs.render(()=>{for(const e of t)e.finalize()})};a.length?Promise.all(a).then(l):l()}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}),La||(La=[],queueMicrotask(Ua)),La.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 Fa(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 Fa(this.scope)){if(this.tracked.has(e))continue;const n=Ia(e,this.transitionFor(e));this.adopt(e,n),n.options.layoutId&&t.add(n.options.layoutId)}}reconcileRemovals(t){this.tracked.forEach((e,n)=>{if(n.isConnected)return;const i=this.restorePoints.get(n);this.restorePoints.delete(n);const{layoutId:s}=e.options,o=e.getStack(),r=o&&o.members.some(t=>t!==e&&t.instance?.isConnected);if(s&&e.isLead()&&r&&!t.has(s)&&i&&i.parent.isConnected){if(i.parent.insertBefore(n,i.next&&i.next.parentNode===i.parent?i.next:null),e.isPresent=!1,e.setOptions({onExitComplete:()=>{n.remove(),Na(n,e)}}),e.relegate())return;n.remove()}Na(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 dn([...t]))}}function Wa(t,e,n){if("function"==typeof t)return{scope:document,updateDom:t,defaultOptions:e};return{scope:t instanceof Document?t:gi(t)[0]??document,updateDom:e,defaultOptions:n}}const za=at,Ka=ot.reduce((t,e)=>(t[e]=t=>lt(t),t),{});t.AsyncMotionValueAnimation=hn,t.DOMKeyframesResolver=ri,t.DOMVisualElement=Go,t.DocumentProjectionNode=ka,t.Feature=class{constructor(t){this.isMounted=!1,this.node=t}update(){}},t.FlatTree=Yr,t.GroupAnimation=dn,t.GroupAnimationWithThen=class extends dn{then(t,e){return this.finished.finally(t).then(()=>{})}},t.HTMLProjectionNode=Ra,t.HTMLVisualElement=_o,t.JSAnimation=Qt,t.KeyframeResolver=Ne,t.LayoutAnimationBuilder=$a,t.MotionValue=vn,t.MotionValueState=xi,t.NativeAnimation=Qe,t.NativeAnimationExtended=nn,t.NativeAnimationWrapper=mn,t.NodeStack=Hr,t.ObjectVisualElement=class extends Ko{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.SVGVisualElement=class extends Go{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ko}getBaseTargetFromProps(t,e){return Pe.has(e)?super.getBaseTargetFromProps(t,e)??Te(e):t[e]}getDefaultValue(t){return Pe.has(t)?this.latestValues[t]??Te(t):void 0}readValueFromInstance(t,e){if(Pe.has(e)){const t=ce(e);return t&&t.default||0}if(Fi.includes(e)){const n=getComputedStyle(t)[e];if("string"==typeof n&&n)return n.trim()}return e=Zo.has(e)?e:Yn(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return tr(t,e,n)}build(t,e,n){Oi(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){Qo(t,e,0,i)}mount(t){this.isSVGTag=Jo(t.tagName),super.mount(t)}},t.ViewTransitionBuilder=Po,t.VisualElement=Ko,t.acceleratedValues=rn,t.addAttrValue=Ii,t.addDomEvent=Kr,t.addEffect=function(t){e.invariant("function"==typeof t.test&&"function"==typeof t.read,"Effects passed to animate.addEffect() need test() and read().","effect-missing-test"),hi(t),ui.unshift(t)},t.addSVGValue=Ui,t.addScaleCorrector=function(t){for(const e in t)Xo[e]=t[e],l(e)&&(Xo[e].isCSSVariable=!0)},t.addStyleValue=Pi,t.addValueToWillChange=Gn,t.alpha=m,t.analyseComplexValue=I,t.animateEffectSubject=pi,t.animateElement=function(t,e,n,i){if(i)return di(t=>i.getValue(t,null),e,n,i);const s=hs(t);return pi(s,t,e,n,new ds(s,t))},t.animateLayout=function(t,e,n){const{scope:i,updateDom:s,defaultOptions:o}=Wa(t,e,n);return new $a(i,s,o)},t.animateMotionValue=En,t.animateSingleValue=zr,t.animateTarget=Jn,t.animateValue=function(t){return new Qt(t)},t.animateValues=di,t.animateVariant=Qn,t.animateView=function(t,e={}){return new Po(t,e)},t.animateVisualElement=ti,t.animationMapKey=(t,e="")=>`${t}:${e}`,t.applyAxisDelta=ts,t.applyBoxDelta=es,t.applyGeneratorOptions=Je,t.applyPointDelta=Qi,t.applyPxDefaults=function(t,e){for(let n=0;n<t.length;n++)"number"==typeof t[n]&&li.has(e)&&(t[n]=t[n]+"px")},t.applyTreeDeltas=ss,t.arc=function(t={}){const n=function({strength:t=.5,peak:n=.5,direction:i,rotate:s=!1}={}){const o=!0===s?1:"number"==typeof s?s:0;let r;return(s,a)=>{const l=a.x-s.x,c=a.y-s.y;let u;u="cw"===i?-t:"ccw"===i?t:(Math.abs(l)>=Math.abs(c)?l:c)<0?-t:t;let h=Cn(s.x,s.y,a.x,a.y,u,n);if(void 0===i){const t=Math.abs(l)<Math.abs(c),e=s.x+l*n,i=s.y+c*n,o=t?Math.sign(h.x-e):Math.sign(h.y-i);void 0!==r&&0!==o&&o!==r?(u=-u,h=Cn(s.x,s.y,a.x,a.y,u,n)):0!==o&&(r=o)}const d=o?Dn(0,s.x,h.x,a.x,s.y,h.y,a.y):0,p=o?Dn(1,s.x,h.x,a.x,s.y,h.y,a.y):0,m=o?e.wrap(-180,180,p-d):0;return t=>{const n={x:kn(t,s.x,h.x,a.x),y:kn(t,s.y,h.y,a.y)};if(o){const i=Dn(t,s.x,h.x,a.x,s.y,h.y,a.y),r=d+m*t;n.rotate=e.wrap(-180,180,i-r)*o}return n}}}(t),i={interpolateProjection(t){const e=t.x.translate,i=t.y.translate;if(!(Math.sqrt(e*e+i*i)<20))return n({x:e,y:i},{x:0,y:0})},animateVisualElement(t,e,i,s,o){if(!("x"in e)&&!("y"in e))return;const r=t.getValue("x",t.latestValues.x??0),a=t.getValue("y",t.latestValues.y??0),l=e.x,c=e.y,u=(Array.isArray(l)&&null!=l[0]?l[0]:r?.get())??0,h=(Array.isArray(c)&&null!=c[0]?c[0]:a?.get())??0,d=Array.isArray(l)?l[l.length-1]:l??u,p=Array.isArray(c)?c[c.length-1]:c??h,m=n({x:u,y:h},{x:d,y:p}),f=void 0!==m(0).rotate?t.getValue("pathRotation",0):void 0,y={delay:s,...wn(i||{},"x")};delete y.path;const g=xn(0);g.start(En("",g,[0,1e3],{...y,isSync:!0,velocity:0,onUpdate:t=>{const e=m(t/1e3);r?.set(e.x),a?.set(e.y),f&&void 0!==e.rotate&&f.set(e.rotate)},onComplete:()=>{r?.set(d),a?.set(p),f?.set(0)},onStop:()=>f?.set(0),onCancel:()=>f?.set(0)})),g.animation&&o.push(g.animation),delete e.x,delete e.y}};return i},t.aspectRatio=kr,t.attachFollow=Zs,t.attachSpring=Qs,t.attrEffect=Ni,t.axisDeltaEquals=Dr,t.axisEquals=Pr,t.axisEqualsRounded=Mr,t.boxEquals=Vr,t.boxEqualsRounded=Er,t.buildHTMLStyles=Ri,t.buildProjectionTransform=Lr,t.buildSVGAttrs=Oi,t.buildSVGPath=Li,t.buildTransform=Ci,t.calcAxisDelta=hr,t.calcBoxDelta=dr,t.calcChildStagger=yn,t.calcGeneratorDuration=pt,t.calcLength=cr,t.calcRelativeAxis=pr,t.calcRelativeAxisPosition=fr,t.calcRelativeBox=mr,t.calcRelativePosition=yr,t.camelCaseAttributes=Zo,t.camelToDash=Yn,t.cancelFrame=lt,t.cancelMicrotask=ys,t.cancelSync=Ka,t.checkVariantsDidChange=ir,t.cleanDirtyNodes=aa,t.collectMotionValues=gn,t.color=C,t.compareByDepth=Gr,t.complex=$,t.containsCSSVariable=d,t.convertBoundingBoxToBox=Gi,t.convertBoxToBoundingBox=function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}},t.convertOffsetToTimes=Ut,t.copyAxisDeltaInto=lr,t.copyAxisInto=rr,t.copyBoxInto=ar,t.correctBorderRadius=Br,t.correctBoxShadow=jr,t.createAnimationState=function(t){let e=e=>Promise.all(e.map(({animation:e,options:n})=>ti(t,e,n))),n=sr(),i=!0,s=!1;function o(o){const{props:r,parent:a,manuallyAnimateOnMount:l}=t,c=i||s,u=[],h=new Set;let d={},p=1/0,m=t;do{m=!1!==m.props.inherit&&m.parent}while(m&&!m.isControllingVariants);if(nr.forEach((e,i)=>{const s=n[e],f=r[e],y=m&&m.props[e],g=void 0!==f?f:Ro(y)||!1===y?y:void 0,v=Ro(g),x=e===o?s.isActive:null;!1===x&&(p=i);const T=v&&void 0===f&&!(c&&l);if(s.protectedKeys={...d},!s.isActive&&null===x||!g&&!s.prevProp||Co(g)||"boolean"==typeof g)return;if("exit"===e&&s.isActive&&!0!==x)return void(d={...d,...s.prevResolvedValues});const w=ir(s.prevProp,g);let b=w||v&&(x&&!T||i>p),S=!1;const A=Array.isArray(g)?g:[g];let P={};if(!1!==x)for(const n of A){const{transition:i,transitionEnd:s,...o}=Fn(t,n,On(t,e))||{};P={...P,...o,...s}}const{prevResolvedValues:V}=s;for(const e in{...V,...P}){if(e in d)continue;const n=P[e],i=V[e],o=Array.isArray(n)&&Array.isArray(i)?!er(n,i)||w:n!==i;if(o&&null==n)h.add(e);else if(o||void 0!==n&&h.has(e)){b=!0,h.delete(e)&&(S=!0),s.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)}else s.protectedKeys[e]=!0}if(s.prevProp=g,s.prevResolvedValues=P,s.isActive&&(d={...d,...P}),b&&(!T||!w||S))for(const n of A){const i={type:e};if("string"==typeof n&&c&&l&&a?.enteringChildren){const e=Fn(a,n)?.transition?.delayChildren;i.delay=yn(a.enteringChildren,t,e)}u.push({animation:n,options:i})}}),h.size){const{initial:e}=r,n={},i="boolean"!=typeof e&&Fn(t,Array.isArray(e)?e[0]:e,t.presenceContext?.custom);i&&i.transition&&(n.transition=i.transition),h.forEach(s=>{const o=t.getValue(s);o&&(o.liveStyle=!0);const a=i&&!Array.isArray(e)?i[s]:void 0,l=t.getBaseTargetFromProps(r,s);n[s]=(void 0!==a?a:void 0===l||zn(l)?void 0===t.initialValues[s]?t.baseTarget[s]:void 0:l)??null}),u.push({animation:n})}const f=c&&t.blockInitialAnimation||i&&!l&&(!1===r.initial||r.initial===r.animate);return i=s=!1,!f&&u.length?e(u):Promise.resolve()}return{animateChanges:o,setActive:function(e,i){if(n[e].isActive===i)return Promise.resolve();t.variantChildren?.forEach(t=>t.animationState?.setActive(e,i)),n[e].isActive=i;const s=o(e);for(const t in n)n[t].protectedKeys={};return s},setAnimateFunction:n=>{e=n(t)},getState:()=>n,reset:()=>{n=sr(),s=!0}}},t.createAxis=Eo,t.createAxisDelta=Vo,t.createBox=ko,t.createDelta=Mo,t.createEffect=Ti,t.createGeneratorEasing=mt,t.createProjectionNode=ia,t.createRenderBatcher=rt,t.cubicBezierAsString=Xe,t.defaultEasing=$t,t.defaultOffset=Nt,t.defaultTransformValue=Te,t.defaultValueTypes=le,t.degrees=A,t.delay=Xr,t.delayInSeconds=function(t,n){return Xr(t,e.secondsToMilliseconds(n))},t.dimensionValueTypes=ni,t.eachAxis=Cr,t.fillOffset=It,t.fillWildcards=de,t.findDimensionValueType=ii,t.findEffect=function(t){return ui.find(e=>e.test(t))},t.findValueType=t=>to.find(ei(t)),t.flushKeyframeResolvers=Ie,t.followValue=function(t,e){const n=xn(zn(t)?t.get():t);return Zs(n,t,e),n},t.frame=at,t.frameData=n,t.frameSteps=ct,t.generateLinearEasing=ht,t.getAnimatableNone=he,t.getAnimationMap=function(t){let e=fn.get(t);return e||(e=new Map,fn.set(t,e)),e},t.getComputedStyle=function(t,e){const n=window.getComputedStyle(t);return Ue(e)?n.getPropertyValue(e):n[e]},t.getDefaultTransition=Pn,t.getDefaultValueType=ce,t.getFeatureDefinitions=function(){return zo},t.getFinalKeyframe=Gt,t.getMixer=Q,t.getOptimisedAppearId=Hn,t.getOriginIndex=zs,t.getValueAsType=yi,t.getValueTransition=wn,t.getVariableValue=jn,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<or;t++){const i=jo[t],s=e.props[i];(Ro(s)||!1===s)&&(n[i]=s)}return n},t.getViewAnimationLayerInfo=po,t.getViewAnimations=mo,t.globalProjectionState=Zr,t.handOffElementState=ps,t.has2DTranslate=_i,t.hasComplexValues=O,t.hasReducedMotionListener=No,t.hasScale=qi,t.hasTransform=Hi,t.hex=b,t.hover=function(t,e,n={}){const[i,s,o]=xs(t,n);return i.forEach(t=>{let n,i=!1,o=!1;const r=e=>{n&&(n(e),n=void 0),t.removeEventListener("pointerleave",l)},a=t=>{i=!1,window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a),o&&(o=!1,r(t))},l=t=>{"touch"!==t.pointerType&&(i?o=!0:r(t))};t.addEventListener("pointerenter",i=>{if("touch"===i.pointerType||vs())return;o=!1;const r=e(t,i);"function"==typeof r&&(n=r,t.addEventListener("pointerleave",l,s))},s),t.addEventListener("pointerdown",()=>{i=!0,window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",a,s)},s)}),o},t.hsla=D,t.hslaToRgba=z,t.inertia=Ft,t.initPrefersReducedMotion=$o,t.interpolate=Ot,t.invisibleValues=_,t.isAnimationControls=Co,t.isCSSVariableName=l,t.isCSSVariableToken=u,t.isControllingVariants=Lo,t.isDeltaZero=Ar,t.isDragActive=vs,t.isDragging=gs,t.isElementKeyboardAccessible=Ss,t.isElementTextInput=function(t){return As.has(t.tagName)||!0===t.isContentEditable},t.isForcedMotionValue=qo,t.isGenerator=Ze,t.isHTMLElement=mi,t.isKeyframesTarget=Nn,t.isMotionValue=zn,t.isNear=ur,t.isNodeOrChild=Ts,t.isPrimaryPointer=ws,t.isSVGElement=fi,t.isSVGSVGElement=Ws,t.isSVGTag=Jo,t.isTransitionDefined=Mn,t.isVariantLabel=Ro,t.isVariantNode=Fo,t.isWaapiSupportedEasing=function t(n){return Boolean("function"==typeof n&&Ye()||!n||"string"==typeof n&&(n in qe||Ye())||e.isBezierDefinition(n)||Array.isArray(n)&&n.every(t))},t.isWillChangeMotionValue=Kn,t.keyframes=Wt,t.makeAnimationInstant=on,t.mapEasingToNativeEasing=He,t.mapValue=function(t,e,n,i){const s=Ks(e,n,i);return Js(()=>s(t.get()))},t.maxGeneratorDuration=dt,t.measurePageBox=function(t,e,n){const i=cs(t,n),{scroll:s}=e;return s&&(os(i.x,s.offset.x),os(i.y,s.offset.y)),i},t.measureViewportBox=cs,t.microtask=fs,t.mix=st,t.mixArray=tt,t.mixColor=H,t.mixComplex=nt,t.mixImmediate=K,t.mixLinearColor=Y,t.mixNumber=G,t.mixObject=et,t.mixValues=Ir,t.mixVisibility=Z,t.motionValue=xn,t.nodeGroup=function(){const t=new Set,e=new WeakMap,n=()=>t.forEach(Da);return{add:i=>{t.add(i),e.set(i,i.addEventListener("willUpdate",n))},remove:i=>{t.delete(i);const s=e.get(i);s&&(s(),e.delete(i)),n()},dirty:n}},t.number=p,t.numberValueTypes=ae,t.optimizedAppearDataAttribute=qn,t.optimizedAppearDataId=Xn,t.originProps=Si,t.parseAnimateLayoutArgs=Wa,t.parseCSSVariable=Bn,t.parseValueFromTransform=we,t.percent=P,t.pixelsToPercent=Rr,t.positionalKeys=In,t.prefersReducedMotion=Io,t.press=function(t,e,n={}){const[i,s,o]=xs(t,n),r=t=>{const i=t.currentTarget;if(!Es(t))return;if(ks.has(t))return;Ps.add(i),n.stopPropagation&&ks.add(t);const o=e(i,t),r={...s,capture:!0},a=(t,e)=>{window.removeEventListener("pointerup",l,r),window.removeEventListener("pointercancel",c,r),Ps.has(i)&&Ps.delete(i),Es(t)&&"function"==typeof o&&o(t,{success:e})},l=t=>{a(t,i===window||i===document||n.useGlobalTarget||Ts(i,t.target))},c=t=>{a(t,!1)};window.addEventListener("pointerup",l,r),window.addEventListener("pointercancel",c,r)};return i.forEach(t=>{(n.useGlobalTarget?window:t).addEventListener("pointerdown",r,s),mi(t)&&(t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const i=Vs(()=>{if(Ps.has(n))return;Ms(n,"down");const t=Vs(()=>{Ms(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>Ms(n,"cancel"),e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)})(t,s)),Ss(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),o},t.progressPercentage=k,t.propEffect=ms,t.propagateDirtyNodes=ra,t.px=V,t.readSVGValue=$i,t.readStyleValue=Vi,t.readTransformValue=be,t.recordStats=function(){if($s.value)throw $s.value=null,$s.addProjectionMetrics=null,new Error("Stats are already being measured");const t=$s;t.value={layoutProjection:{nodes:[],calculatedTargetDeltas:[],calculatedProjections:[]}},t.addProjectionMetrics=e=>{const{layoutProjection:n}=t.value;n.nodes.push(e.nodes),n.calculatedTargetDeltas.push(e.calculatedTargetDeltas),n.calculatedProjections.push(e.calculatedProjections)}},t.removeAxisDelta=vr,t.removeAxisTransforms=xr,t.removeBoxTransforms=br,t.removeEffect=hi,t.removePointDelta=gr,t.renderHTML=Yo,t.renderSVG=Qo,t.resize=function(t,e){return"function"==typeof t?Us(t):Os(t,e)},t.resolveElements=gi,t.resolveMotionValue=qr,t.resolveTransition=Tn,t.resolveVariant=Fn,t.resolveVariantFromProps=Ln,t.rgbUnit=T,t.rgba=w,t.rootProjectionNode=Ca,t.scale=f,t.scaleCorrectors=Xo,t.scalePoint=Ji,t.scrapeHTMLMotionValuesFromProps=Ho,t.scrapeSVGMotionValuesFromProps=tr,t.setDragLock=function(t){return"x"===t||"y"===t?gs[t]?null:(gs[t]=!0,()=>{gs[t]=!1}):gs.x||gs.y?null:(gs.x=gs.y=!0,()=>{gs.x=gs.y=!1})},t.setFeatureDefinitions=function(t){zo=t},t.setStyle=$e,t.setTarget=Wn,t.spring=Lt,t.springValue=function(t,e){const n=xn(zn(t)?t.get():t);return Qs(n,t,e),n},t.stagger=function(t=.1,{startDelay:n=0,from:i=0,ease:s}={}){return(o,r)=>{const a="number"==typeof i?i:zs(i,r),l=Math.abs(a-o);let c=t*l;if(s){const n=r*t;c=e.easingDefinitionToFunction(s)(c/n)*n}return n+c}},t.startWaapiAnimation=_e,t.statsBuffer=$s,t.styleEffect=Ei,t.styleSubjectEffect=Mi,t.supportedWaapiEasing=qe,t.supportsBrowserAnimation=un,t.supportsFlags=We,t.supportsLinearEasing=Ye,t.supportsPartialKeyframes=ci,t.supportsScrollTimeline=Ke,t.supportsViewTimeline=Ge,t.svgEffect=zi,t.svgSubjectEffect=Wi,t.sync=za,t.testValueType=ei,t.time=o,t.transform=Ks,t.transformAxis=rs,t.transformBox=ls,t.transformBoxPoints=Yi,t.transformPropOrder=Ae,t.transformProps=Pe,t.transformValue=Js,t.transformValueTypes=re,t.translateAxis=os,t.updateMotionValuesFromProps=Oo,t.variantPriorityOrder=Bo,t.variantProps=jo,t.vh=M,t.visualElementStore=Do,t.vw=E});
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("motion-utils")):"function"==typeof define&&define.amd?define(["exports","motion-utils"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).MotionDom={},t.MotionUtils)}(this,function(t,e){"use strict";const n={delta:0,timestamp:0,isProcessing:!1};let i;function s(){i=void 0}const o={now:()=>(void 0===i&&o.set(n.isProcessing||e.MotionGlobalConfig.useManualTiming?n.timestamp:performance.now()),i),set:t=>{i=t,queueMicrotask(s)}},r=t=>Math.round(1e5*t)/1e5,a=t=>e=>"string"==typeof e&&e.startsWith(t),l=a("--"),c=a("var(--"),u=t=>!!c(t)&&h.test(t.split("/*")[0].trim()),h=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function d(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const p={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},m={...p,transform:t=>e.clamp(0,1,t)},f={...p,default:1},y=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const g=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,v=(t,e)=>n=>Boolean("string"==typeof n&&g.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),x=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[s,o,r,a]=i.match(y);return{[t]:parseFloat(s),[e]:parseFloat(o),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},T={...p,transform:t=>Math.round((t=>e.clamp(0,255,t))(t))},w={test:v("rgb","red"),parse:x("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+T.transform(t)+", "+T.transform(e)+", "+T.transform(n)+", "+r(m.transform(i))+")"};const b={test:v("#"),parse:function(t){let e="",n="",i="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}},transform:w.transform},S=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),A=S("deg"),V=S("%"),P=S("px"),M=S("vh"),E=S("vw"),k=(()=>({...V,parse:t=>V.parse(t)/100,transform:t=>V.transform(100*t)}))(),D={test:v("hsl","hue"),parse:x("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+V.transform(r(e))+", "+V.transform(r(n))+", "+r(m.transform(i))+")"},C={test:t=>w.test(t)||b.test(t)||D.test(t),parse:t=>w.test(t)?w.parse(t):D.test(t)?D.parse(t):b.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?w.transform(t):D.transform(t),getAnimatableNone:t=>{const e=C.parse(t);return e.alpha=0,C.transform(e)}},R=new RegExp(y.source),B=new RegExp(/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu.source,"i");const j="number",L="color",F=/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+)/giu;function O(t){const e=t.toString();return R.test(e)||B.test(e)}function I(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let o=0;const r=e.replace(F,t=>(C.test(t)?(i.color.push(o),s.push(L),n.push(C.parse(t))):t.startsWith("var(")?(i.var.push(o),s.push("var"),n.push(t)):(i.number.push(o),s.push(j),n.push(parseFloat(t))),++o,"${}")).split("${}");return{values:n,split:r,indexes:i,types:s}}function N({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===j?r(i[o]):t===L?C.transform(i[o]):i[o]}return s}}const U=(t,e)=>{return"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof(n=t)?0:C.test(n)?C.getAnimatableNone(n):n;var n};const $={test:function(t){return isNaN(t)&&"string"==typeof t&&(R.test(t)||B.test(t))},parse:function(t){return I(t).values},createTransformer:function(t){return N(I(t))},getAnimatableNone:function(t){const e=I(t);return N(e)(e.values.map((t,n)=>U(t,e.split[n])))}};function W(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 z({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=W(a,i,t+1/3),o=W(a,i,t),r=W(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 K(t,e){return n=>n>0?e:t}const G=(t,e,n)=>t+(e-t)*n,Y=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},X=[b,w,D];function q(t){const n=(i=t,X.find(t=>t.test(i)));var i;if(!n)return e.warning(!1,`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!1;let s=n.parse(t);return n===D&&(s=z(s)),s}const H=(t,e)=>{const n=q(t),i=q(e);if(!n||!i)return K(t,e);const s={...n};return t=>(s.red=Y(n.red,i.red,t),s.green=Y(n.green,i.green,t),s.blue=Y(n.blue,i.blue,t),s.alpha=G(n.alpha,i.alpha,t),w.transform(s))},_=new Set(["none","hidden"]);function Z(t,e){return _.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function J(t,e){return n=>G(t,e,n)}function Q(t){return"number"==typeof t?J:"string"==typeof t?u(t)?K:C.test(t)?H:nt:Array.isArray(t)?tt:"object"==typeof t?C.test(t)?H:et:K}function tt(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>Q(t)(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=s[e](t);return n}}function et(t,e){const n={...t,...e},i={};for(const s in n)void 0!==t[s]&&void 0!==e[s]&&(i[s]=Q(t[s])(t[s],e[s]));return t=>{for(const e in i)n[e]=i[e](t);return n}}const nt=(t,n)=>{const i=$.createTransformer(n),s=I(t),o=I(n);return s.indexes.var.length===o.indexes.var.length&&s.indexes.color.length===o.indexes.color.length&&s.indexes.number.length>=o.indexes.number.length?_.has(t)&&!o.values.length||_.has(n)&&!s.values.length?Z(t,n):e.pipe(tt(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}(s,o),o.values),i):(e.warning(!0,`Complex values '${t}' and '${n}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),K(t,n))},it=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function st(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return G(t,e,n);if("string"==typeof t&&"string"==typeof e){const n=function(t,e){const n=it.exec(t);if(!n)return;const i=it.exec(e);if(!i||n[2]!==i[2])return;const s=n[2],o=parseFloat(n[1]),a=parseFloat(i[1]);return t=>r(G(o,a,t))+s}(t,e);if(n)return n}return Q(t)(t,e)}const ot=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function rt(t,n,i={delta:0,timestamp:0,isProcessing:!1}){let s=!1,o=!0;const r=()=>s=!0,a=ot.reduce((t,e)=>(t[e]=function(t){let e=new Set,n=new Set,i=!1,s=!1;const o=new Set;let r={delta:0,timestamp:0,isProcessing:!1};function a(e){o.has(e)&&(n.add(e),t()),e(r)}const l={schedule:(t,s=!1,r=!1)=>{const a=r&&i?e:n;return s&&o.add(t),a.add(t),t},cancel:t=>{n.delete(t),o.delete(t)},process:t=>{if(r=t,i)return void(s=!0);i=!0;const o=e;e=n,n=o,e.forEach(a),e.clear(),i=!1,s&&(s=!1,l.process(t))}};return l}(r),t),{}),{setup:l,read:c,resolveKeyframes:u,preUpdate:h,update:d,preRender:p,render:m,postRender:f}=a,y=()=>{const r=e.MotionGlobalConfig.useManualTiming,a=r?i.timestamp:performance.now();s=!1,r||(i.delta=o?1e3/60:Math.max(Math.min(a-i.timestamp,40),1)),i.timestamp=a,i.isProcessing=!0,l.process(i),c.process(i),u.process(i),h.process(i),d.process(i),p.process(i),m.process(i),f.process(i),i.isProcessing=!1,s&&n&&(o=!1,t(y))};return{schedule:ot.reduce((e,n)=>{const r=a[n];return e[n]=(e,n=!1,a=!1)=>(s||(s=!0,o=!0,i.isProcessing||t(y)),r.schedule(e,n,a)),e},{}),cancel:t=>{for(let e=0;e<ot.length;e++)a[ot[e]].cancel(t)},state:i,steps:a}}const{schedule:at,cancel:lt,steps:ct}=rt("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:e.noop,!0,n),ut=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>at.update(e,t),stop:()=>lt(e),now:()=>n.isProcessing?n.timestamp:o.now()}},ht=(t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let e=0;e<s;e++)i+=Math.round(1e4*t(e/(s-1)))/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},dt=2e4;function pt(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 mt(t,n=100,i){const{keyframes:s,velocity:o}=t,r=s&&s[s.length-1]-s[0],a=i({...t,velocity:o&&r?o*n/r:o,keyframes:[0,n]}),l=Math.min(pt(a),dt);return{type:"keyframes",ease:t=>a.next(l*t).value/n,duration:e.millisecondsToSeconds(l)}}const ft=100,yt=10,gt=1,vt=800,xt=.3,Tt=.3,wt={granular:.01,default:2},bt={granular:.005,default:.5},St=.01,At=10,Vt=.05,Pt=t=>t<0?1/Math.max(1+t,Vt):Math.max(1-t,Vt);function Mt(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 Dt(t=>s*Math.exp(-i*t)-i*Math.exp(-s*t)-o,t=>Math.exp(-s*t)-Math.exp(-i*t),e)/e}function Et(t,e){return t*Math.sqrt(1-e*e)}const kt=12;function Dt(t,e,n){let i=n;for(let n=1;n<kt;n++)i-=t(i)/e(i);return i}const Ct=.001;const Rt=(t,e)=>(e?t>=0:t>0)&&t<1/0;function Bt(t,e){if(Rt(t,e))return t}function jt(t){const n=Bt(t.stiffness),i=Bt(t.damping,!0),s=Bt(t.mass),o={...t,stiffness:n??ft,damping:i??yt,mass:s??gt,isResolvedFromDuration:!1,isTimeDefined:void 0===(n??i??s)&&(void 0!==t.duration||void 0!==t.bounce)};if(o.isTimeDefined){if(t.visualDuration){const e=Pt(t.bounce||0),n=2*Math.PI/(1.2*t.visualDuration)*Mt(e,2*Math.PI/1.2);o.stiffness=n*n,o.damping=2*e*Math.sqrt(o.stiffness)}else Object.assign(o,function({duration:t=vt,bounce:n=xt}){let i,s;e.warning(t<=e.secondsToMilliseconds(At),"Spring duration must be 10 seconds or less","spring-duration-limit");const o=Pt(n);t=e.clamp(St,At,e.millisecondsToSeconds(t)),o<1?(i=e=>{const n=e*o,i=n*t,s=Et(e,o),r=Math.exp(-i);return Ct-n/s*r},s=e=>{const n=e*o*t,s=o*o*e*e*t,r=Math.exp(-n),a=Et(e*e,o);return(-i(e)+Ct>0?-1:1)*-s*r/a}):(i=e=>Math.exp(-e*t)*(e*t+1)-.001,s=e=>Math.exp(-e*t)*(t*t*-e));const r=Dt(i,s,5/t),a=r*Mt(o,r*t),l=a*a;return{stiffness:l,damping:2*o*Math.sqrt(l),duration:e.secondsToMilliseconds(t)}}(o)),o.isResolvedFromDuration=!0;Rt(o.stiffness)&&Rt(o.damping,!0)||(o.stiffness=ft,o.damping=yt)}return o}function Lt(t=Tt,n=xt){const i="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:n}:t,s=i.keyframes[0],o=i.keyframes[i.keyframes.length-1],r={done:!1,value:s},{stiffness:a,damping:l,mass:c,duration:u,isResolvedFromDuration:h,isTimeDefined:d}=jt({...i}),p=t=>d?0:-e.millisecondsToSeconds(t),m=l/(2*Math.sqrt(a*c)),f=e.millisecondsToSeconds(Math.sqrt(a/c)),y=m*f,g={target:o,delta:o-s,velocity:p(i.velocity||0)||0,restSpeed:0,restDelta:0},v=()=>{const t=Math.abs(g.delta)<5;g.restSpeed=i.restSpeed||(t?wt.granular:wt.default),g.restDelta=i.restDelta||(t?bt.granular:bt.default)};let x,T,w;if(v(),m<1){const t=Et(f,m),e={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};w=()=>{e.A=(g.velocity+y*g.delta)/t,e.sinC=y*e.A+g.delta*t,e.cosC=y*g.delta-e.A*t};const n=n=>{n!==e.t&&(e.t=n,e.env=Math.exp(-y*n),e.sin=Math.sin(t*n),e.cos=Math.cos(t*n))};x=t=>(n(t),g.target-e.env*(e.A*e.sin+g.delta*e.cos)),T=t=>(n(t),e.env*(e.sinC*e.sin+e.cosC*e.cos))}else if(1===m){x=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},T=e=>Math.exp(-f*e)*(f*t.C*e-g.velocity)}else{const t=f*Math.sqrt(m*m-1),e=y-t,n=y+t,i=d?1/0:300/t,s=(t,e)=>Math.exp(e>i?-t*i-y*(e-i):-t*e),o={S:0,F:0};w=()=>{const e=(g.velocity+y*g.delta)/t;o.S=(g.delta+e)/2,o.F=(g.delta-e)/2},x=t=>g.target-o.S*s(e,t)-o.F*s(n,t),T=t=>e*o.S*s(e,t)+n*o.F*s(n,t)}w();const b=h&&u||null,S={calculatedDuration:b,retarget:(t,e)=>{g.target=t[t.length-1],g.delta=g.target-t[0],g.velocity=p(e),i.restSpeed&&i.restDelta||v(),S.calculatedDuration=b,r.done=!1,w()},velocity:t=>e.secondsToMilliseconds(T(t)),next:t=>{const n=x(t);if(h)r.done=t>=u;else{const i=e.secondsToMilliseconds(T(t));r.done=Math.abs(i)<=g.restSpeed&&Math.abs(g.target-n)<=g.restDelta}return r.value=r.done?g.target:n,r},toString:()=>{const t=Math.min(pt(S),dt),e=ht(e=>S.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return S}function Ft({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:c=.5,restSpeed:u}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)<Math.abs(l-t)?a:l;let m=n*e;const f=h+m,y=void 0===r?f:r(f);y!==f&&(m=y-h);const g=t=>-m*Math.exp(-t/i),v=t=>{const e=g(t);d.done=Math.abs(e)<=c,d.value=d.done?y:y+e};let x,T;const w=t=>{var e;((e=d.value)<a||e>l)&&(x=t,T=Lt({keyframes:[d.value,p(d.value)],velocity:-g(t)/i*1e3,damping:s,stiffness:o,restDelta:c,restSpeed:u}))};return w(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==x||(e=!0,v(t),w(t)),void 0!==x&&t>=x?T.next(t-x):(!e&&v(t),d)}}}function Ot(t,n,{clamp:i=!0,ease:s,mixer:o}={}){const r=t.length;if(e.invariant(r===n.length,"Both input and output ranges must be the same length","range-length"),1===r)return()=>n[0];if(2===r&&n[0]===n[1])return()=>n[1];const a=t[0]===t[1];t[0]>t[r-1]&&(t=[...t].reverse(),n=[...n].reverse());const l=function(t,n,i){const s=[],o=i||e.MotionGlobalConfig.mix||st,r=t.length-1;for(let i=0;i<r;i++){let r=o(t[i],t[i+1]);if(n){const t=Array.isArray(n)?n[i]||e.noop:n;r=e.pipe(t,r)}s.push(r)}return s}(n,s,o),c=l.length,u=i=>{if(a&&i<t[0])return n[0];let s=0;if(c>1)for(;s<t.length-2&&!(i<t[s+1]);s++);const o=e.progress(t[s],t[s+1],i);return l[s](o)};return i?n=>u(e.clamp(t[0],t[r-1],n)):u}function It(t,n){const i=t[t.length-1];for(let s=1;s<=n;s++){const o=e.progress(0,n,s);t.push(G(i,1,o))}}function Nt(t){const e=[0];return It(e,t.length-1),e}function Ut(t,e){return t.map(t=>t*e)}function $t(t,n){return t.map(()=>n||e.easeInOut).splice(0,t.length-1)}function Wt({duration:t=300,keyframes:n,times:i,ease:s="easeInOut"}){const o=e.isEasingArray(s)?s.map(e.easingDefinitionToFunction):e.easingDefinitionToFunction(s)||e.easeInOut,r={done:!1,value:n[0]};if(2===n.length&&!Array.isArray(o)&&(!i||2!==i.length||0===i[0]&&1===i[1])){const[i,s]=n,a=i===s?void 0:(e.MotionGlobalConfig.mix||st)(i,s);return{calculatedDuration:t,next:n=>(r.value=a?a(o(t>0?e.clamp(0,1,n/t):1)):s,r.done=n>=t,r)}}const a=Ot(Ut(i&&i.length===n.length?i:Nt(n),t),n,{ease:Array.isArray(o)?o:$t(n,o)});return{calculatedDuration:t,next:e=>(r.value=a(e),r.done=e>=t,r)}}Lt.applyToOptions=t=>{const n=mt(t,100,Lt);return t.ease=n.ease,t.duration=e.secondsToMilliseconds(n.duration),t.type="keyframes",t};function zt(t,n,i=0){return n<=0?i:t.velocity?t.velocity(n):function(t,n,i){const s=Math.max(n-5,0);return e.velocityPerSecond(i-t(s),n-s)}(e=>t.next(e).value,n,t.next(n).value)}const Kt=t=>null!==t;function Gt(t,{repeat:e,repeatType:n="loop"},i,s=1){const o=t.filter(Kt),r=s<0||e&&"loop"!==n&&e%2==1?0:o.length-1;return r&&void 0!==i?i:o[r]}const Yt={decay:Ft,inertia:Ft,tween:Wt,keyframes:Wt,spring:Lt};function Xt(t){"string"==typeof t.type&&(t.type=Yt[t.type])}const qt=(t,n)=>n-t>40&&!e.MotionGlobalConfig.useManualTiming?n:t;function Ht(t,e){return{kind:t,animation:e,timestamp:o.now(),frameTimestamp:n.timestamp,frameIsProcessing:n.isProcessing}}function _t(t,e,n){const i=globalThis.__MOTION_INSPECT__;if(i)try{i({...Ht("animation-start",t),options:n?{...e,...n}:e})}catch{}}class Zt{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 Jt=t=>t/100,Qt=t=>Math.round(1e4*t)/1e4;class te extends Zt{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!==o.now()&&this.tick(o.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause(),_t(this,this.options)}initAnimation(){const{options:t}=this;Xt(t);const{type:n=Wt,repeat:i=0,repeatDelay:s=0,repeatType:o,velocity:r=0}=t;let{keyframes:a}=t;const l=n||Wt;l!==Wt&&"number"!=typeof a[0]&&(this.mixKeyframes=e.pipe(Jt,st(a[0],a[1])),a=[0,100]);const c=l(a===t.keyframes?t:{...t,keyframes:a});"mirror"===o&&(this.mirroredGenerator=l({...t,keyframes:[...a].reverse(),velocity:-r})),null===c.calculatedDuration&&(c.calculatedDuration=pt(c));const{calculatedDuration:u}=c;this.calculatedDuration=u,this.resolvedDuration=u+s,this.totalDuration=this.resolvedDuration*(i+1)-s,this.generator=c}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:n,totalDuration:i,calculatedDuration:s}=this;if(null===this.startTime)return n.next(0);const{delay:o=0,keyframes:r,type:a,onUpdate:l,finalKeyframe:c}=this.options;this.startTime===this.pendingStartTime&&(this.startTime=qt(this.startTime,t)),this.pendingStartTime=void 0,this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const u=this.currentTime-o*(this.playbackSpeed>=0?1:-1),h=this.playbackSpeed>=0?u<0:u>i;this.currentTime=Math.max(u,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);const d=this.generate(this.currentTime,h);let{done:p}=d;h||null===s||(p=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const m=null===this.holdTime&&("finished"===this.state||"running"===this.state&&p);return m&&a!==Ft&&(d.value=Gt(r,this.options,c,this.speed)),l&&l(d.value),m&&this.finish(),d}at(t){return this.holdTime??Qt((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!==Ft?Gt(n.keyframes,n,e?void 0:n.finalKeyframe):this.generate(Math.max(s,0),s<0).value}generate(t,n){const{generator:i,totalDuration:s,mixKeyframes:o,mirroredGenerator:r,resolvedDuration:a}=this,{keyframes:l,repeat:c,repeatType:u,repeatDelay:h}=this.options;let d,p=t,m=i;if(c){const n=Math.min(t,s)/a;let i=Math.floor(n),o=n%1;!o&&n>=1&&(o=1),1===o&&i--,i=Math.min(i,c+1);Boolean(i%2)&&("reverse"===u?(o=1-o,h&&(o-=h/a)):"mirror"===u&&(m=r)),p=e.clamp(0,1,o)*a}return n?(this.delayState.value=l[0],d=this.delayState):d=m.next(p),o&&!n&&(d.value=o(d.value)),d}then(t,e){return this.finished.then(t,e)}get duration(){return e.millisecondsToSeconds(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+e.millisecondsToSeconds(t)}get time(){return e.millisecondsToSeconds(this.currentTime)}set time(t){t=e.secondsToMilliseconds(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 zt(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(o.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=e.millisecondsToSeconds(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=ut,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(o.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}const ee=new Set(["brightness","contrast","saturate","opacity"]);function ne(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(y)||[];if(!i)return t;const s=n.replace(i,"");let o=ee.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+s+")"}const ie=/\b([a-z-]*)\(.*?\)/gu,se={...$,getAnimatableNone:t=>{const e=t.match(ie);return e?e.map(ne).join(" "):t}},oe={...$,getAnimatableNone:t=>{const e=$.parse(t);return $.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},re={...p,transform:Math.round},ae={rotate:A,pathRotation:A,rotateX:A,rotateY:A,rotateZ:A,scale:f,scaleX:f,scaleY:f,scaleZ:f,skew:A,skewX:A,skewY:A,distance:P,translateX:P,translateY:P,translateZ:P,x:P,y:P,z:P,perspective:P,transformPerspective:P,opacity:m,originX:k,originY:k,originZ:P},le={borderWidth:P,borderTopWidth:P,borderRightWidth:P,borderBottomWidth:P,borderLeftWidth:P,borderRadius:P,borderTopLeftRadius:P,borderTopRightRadius:P,borderBottomRightRadius:P,borderBottomLeftRadius:P,width:P,maxWidth:P,height:P,maxHeight:P,top:P,right:P,bottom:P,left:P,inset:P,insetBlock:P,insetBlockStart:P,insetBlockEnd:P,insetInline:P,insetInlineStart:P,insetInlineEnd:P,padding:P,paddingTop:P,paddingRight:P,paddingBottom:P,paddingLeft:P,paddingBlock:P,paddingBlockStart:P,paddingBlockEnd:P,paddingInline:P,paddingInlineStart:P,paddingInlineEnd:P,margin:P,marginTop:P,marginRight:P,marginBottom:P,marginLeft:P,marginBlock:P,marginBlockStart:P,marginBlockEnd:P,marginInline:P,marginInlineStart:P,marginInlineEnd:P,fontSize:P,backgroundPositionX:P,backgroundPositionY:P,...ae,zIndex:re,fillOpacity:m,strokeOpacity:m,numOctaves:re},ce={...le,color:C,backgroundColor:C,outlineColor:C,fill:C,stroke:C,borderColor:C,borderTopColor:C,borderRightColor:C,borderBottomColor:C,borderLeftColor:C,filter:se,WebkitFilter:se,mask:oe,WebkitMask:oe},ue=t=>ce[t],he=new Set([se,oe]);function de(t,e){let n=ue(t);return he.has(n)||(n=$),n.getAnimatableNone?n.getAnimatableNone(e):void 0}function pe(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const me=t=>180*t/Math.PI,fe=t=>{const e=me(Math.atan2(t[1],t[0]));return ge(e)},ye={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:fe,rotateZ:fe,skewX:t=>me(Math.atan(t[1])),skewY:t=>me(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},ge=t=>((t%=360)<0&&(t+=360),t),ve=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),xe=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Te={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ve,scaleY:xe,scale:t=>(ve(t)+xe(t))/2,rotateX:t=>ge(me(Math.atan2(t[6],t[5]))),rotateY:t=>ge(me(Math.atan2(-t[2],t[0]))),rotateZ:fe,rotate:fe,skewX:t=>me(Math.atan(t[4])),skewY:t=>me(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function we(t){return t.includes("scale")?1:0}function be(t,e){if(!t||"none"===t)return we(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,s;if(n)i=Te,s=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=ye,s=e}if(!s)return we(e);const o=i[e],r=s[1].split(",").map(Ae);return"function"==typeof o?o(r):r[o]}const Se=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return be(n,e)};function Ae(t){return parseFloat(t.trim())}const Ve=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Pe=(()=>new Set([...Ve,"pathRotation"]))(),Me=t=>t===p||t===P,Ee=new Set(["x","y","z"]),ke=Ve.filter(t=>!Ee.has(t));const De=new Set(["bottom","right"]);function Ce(t,e,n,i,s,o){const r=parseFloat(t);if(!isNaN(r))return r;const{min:a,max:l}=e()[n],c=l-a;return"border-box"===o?c:c-parseFloat(i)-parseFloat(s)}const Re={width:({width:t,paddingLeft:e="0",paddingRight:n="0",boxSizing:i},s)=>Ce(t,s,"x",e,n,i),height:({height:t,paddingTop:e="0",paddingBottom:n="0",boxSizing:i},s)=>Ce(t,s,"y",e,n,i),top:({top:t})=>parseFloat(t),left:({left:t})=>parseFloat(t),bottom:({top:t},e)=>{const{y:n}=e();return parseFloat(t)+(n.max-n.min)},right:({left:t},e)=>{const{x:n}=e();return parseFloat(t)+(n.max-n.min)},x:({transform:t})=>be(t,"x"),y:({transform:t})=>be(t,"y")};Re.translateX=Re.x,Re.translateY=Re.y;const Be=new Set;let je=!1,Le=!1,Fe=!1;function Oe(){if(Le){const t=[],e=new Set,n=new Set;Be.forEach(i=>{i.needsMeasurement&&(t.push(i),e.add(i.element),De.has(i.name)&&n.add(i.element))});const i=new Map;n.forEach(t=>{const e=function(t){const e=[];return ke.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)})}Le=!1,je=!1,Be.forEach(t=>t.complete(Fe)),Be.clear()}function Ie(){Be.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Le=!0)})}function Ne(){Fe=!0,Ie(),Oe(),Fe=!1}class Ue{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?(Be.add(this),je||(je=!0,at.read(Ie),at.resolveKeyframes(Oe))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:i,motionValue:s}=this;if(null===t[0]){const o=s?.get(),r=t[t.length-1];if(void 0!==o)t[0]=o;else if(i&&n){const s=function(t,n,i){if("string"==typeof t){if(e.isNumericalString(t)||e.isZeroValueString(t))return parseFloat(t);if(!$.test(t)&&$.test(i))return de(n,i)}return t??void 0}(i.readValue(n,r),n,r);void 0!==s&&(t[0]=s)}void 0===t[0]&&(t[0]=r),s&&void 0===o&&s.set(t[0])}pe(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Be.delete(this)}cancel(){"scheduled"===this.state&&(Be.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const $e=t=>t.startsWith("--");function We(t,e,n){$e(e)?t.style.setProperty(e,n):t.style[e]=n}const ze={};function Ke(t,n){const i=e.memo(t);return()=>ze[n]??i()}const Ge=Ke(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),Ye=Ke(()=>void 0!==window.ViewTimeline,"viewTimeline"),Xe=Ke(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),qe=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,He={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:qe([0,.65,.55,1]),circOut:qe([.55,0,1,.45]),backIn:qe([.31,.01,.66,-.59]),backOut:qe([.33,1.53,.69,.99])};function _e(t,n){return t?"function"==typeof t?Xe()?ht(t,n):"ease-out":e.isBezierDefinition(t)?qe(t):Array.isArray(t)?t.map(t=>_e(t,n)||He.easeOut):He[t]:void 0}function Ze(t,e,n,{delay:i=0,duration:s=300,repeat:o=0,repeatType:r="loop",ease:a="easeOut",times:l}={},c=void 0){const u={[e]:n};l&&(u.offset=l);const h=_e(a,s);Array.isArray(h)&&(u.easing=h);const d={delay:i,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:o+1,direction:"reverse"===r?"alternate":"normal"};return c&&(d.pseudoElement=c),t.animate(u,d)}function Je(t){return"function"==typeof t&&"applyToOptions"in t}function Qe({type:t,...e}){return Je(t)&&Xe()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class tn extends Zt{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:i,keyframes:s,pseudoElement:o,allowFlatten:r=!1,finalKeyframe:a,onComplete:l}=t;this.isPseudoElement=Boolean(o),this.allowFlatten=r,this.options=t,e.invariant("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const c=Qe(t);this.animation=Ze(n,i,s,c,o),!1===c.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const t=Gt(s,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(t),We(n,i,t),this.animation.cancel()}l?.(),this.notifyFinished()},_t(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(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return e.millisecondsToSeconds(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+e.millisecondsToSeconds(t)}get time(){return e.millisecondsToSeconds(Number(this.animation.currentTime)||0)}set time(t){const n=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=e.secondsToMilliseconds(t),n&&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:n,observe:i}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&Ge()?(this.animation.timeline=t,n?.(this.animation),e.noop):i(this)}}const en={anticipate:e.anticipate,backInOut:e.backInOut,circInOut:e.circInOut};function nn(t){"string"==typeof t.ease&&t.ease in en&&(t.ease=en[t.ease])}const sn=10;class on extends tn{constructor(t){nn(t),Xt(t),super(t),void 0!==t.startTime&&!1!==t.autoplay&&(this.startTime=t.startTime),this.options=t}elapsed(){return"running"===this.state?(o.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 te({...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:n,element:i,name:s}=this.options;if(!n)return;if(void 0!==t)return void n.set(t);const{speed:o}=this,r=this.elapsed(),a="running"===this.state&&o?e.clamp(0,10,r):0,l=this.sample(r);i&&s&&We(i,s,l),n.setWithVelocity(this.sample(r-a*Math.sign(o)),l,a/Math.abs(o||1))}}const rn=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!$.test(t)&&"0"!==t||t.startsWith("url(")));function an(t){t.duration=0,t.type="keyframes"}const ln=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),cn=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;const un=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),hn=e.memo(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function dn(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:o,type:r,keyframes:a}=t;if(!n||!ln.has(n)&&!un.has(n))return!1;const l=e?.owner?.current;if(!(l instanceof HTMLElement||l instanceof SVGElement))return!1;const{onUpdate:c,transformTemplate:u}=e.owner.getProps();return hn()&&(ln.has(n)||un.has(n)&&function(t){for(let e=0;e<t.length;e++)if("string"==typeof t[e]&&cn.test(t[e]))return!0;return!1}(a))&&("transform"!==n||!u)&&!c&&!i&&"mirror"!==s&&0!==o&&"inertia"!==r}const pn=(t,e)=>e&&"number"==typeof t?e.transform(t):t,mn={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},fn=Ve.length;function yn(t,e,n){let i="",s=!0;for(let o=0;o<fn;o++){const r=Ve[o],a=t[r];if(void 0===a)continue;let l=!0;if("number"==typeof a)l=a===(r.startsWith("scale")?1:0);else{const t=parseFloat(a);l=r.startsWith("scale")?1===t:0===t}if(!l||n){const t=pn(a,le[r]);if(!l){s=!1;i+=`${mn[r]||r}(${t}) `}n&&(e[r]=t)}}const o=t.pathRotation;return o&&(s=!1,i+=`rotate(${pn(o,le.pathRotation)}) `),i=i.trim(),n?i=n(e,s?"":i):s&&(i="none"),i}const gn=new WeakMap,vn=.001,xn=(t,e)=>t-e,Tn=(t,e,n)=>{const i=[];for(let s=0;s<=n;s++)i.push(G(t,e,s/n));return i},wn=t=>t.motionValue.owner,bn=t=>gn.get(t),Sn=(t,e)=>t.latestValues?t.latestValues[e]:t.getValue(e)?.get();class An extends te{constructor(t){const e=wn(t).current,{driver:n=ut}=t,i=function(t){const e=wn(t),{onUpdate:n,transformTemplate:i}=e.getProps();return!(t.isHandoff||n||t.hasOnUpdate||i||"inertia"===t.type||"none"!==(Sn(e,"transform")||"none")||Sn(e,"pathRotation")||e.projection?.isProjecting())}(t);t.driver=t=>{const i=n(t);return{js:i,now:i.now,start:(t=!0)=>{const n=bn(e);!n||n.isJS?i.start(t):n.schedule(!1,!t)},stop:()=>{i.stop();const t=bn(e);t?.schedule(!t.isFinishing)}}},super(t),this.canAccelerate=i;const{stop:s}=this;this.stop=()=>{this.isAccelerated()&&this.sync(),s()}}get group(){return bn(wn(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(o.now()):void 0}tween(){const{keyframes:t,type:n,ease:i,times:s,repeat:o,delay:r=0}=this.options,a=e.isBezierDefinition(i)?qe(i):(t=>/^(linear|ease(In|Out|InOut))$/.test(t))(i)&&He[i];if(a&&!o&&!s&&2===t.length&&n===Wt&&null===this.holdTime){const t=this.startTime+r/this.speed;return[t,t+this.resolvedDuration/this.speed,a]}}boundaries(t,e){const{startTime:n,speed:i,resolvedDuration:s,options:o}=this,{delay:r=0,repeat:a=0,repeatDelay:l=0,repeatType:c,times:u,keyframes:h,type:d}=o,p=(d||Wt)===Wt?u||Nt(h):[0,1],m=n+r/i,f=[];if(null!==this.holdTime||!(s>0))return f;for(let n=Math.max(0,Math.floor((t-m)*i/s));n<=a;n++){const o=m+n*s/i;if(o>e)break;for(const r of p){const a=o+(n%2&&c&&"loop"!==c?1-r:r)*(s-l)/i;a>t&&a<e&&f.push(a)}}return f}numberAt(t){return parseFloat(this.sampleAt(t,!0))}sync(){const t=o.now();this.options.motionValue.setWithVelocity(this.sampleAt(t-10,!0),this.sampleAt(t,!0),10)}play(){this.isStopped||((this.group||function(t){const i=t.current,s=new Set,r=new Map;let a={},l=[],c=new Map,u=[],h=!1,d=!1,p=!1,m=-1/0;const f=t=>{for(const e of s)if(e.name===t)return!0},y=(e,n)=>{const i={};for(const s of void 0===e?Ve:l){const o=r.get(s),l=void 0===e?Sn(t,s):o?o.sampleAt(n>e&&!o.timing()[1]?n:e):a[s];void 0!==l&&(i[s]=l)}return i},g=(t,e)=>{let n="";const i=y(t,e);for(const t in i)n+=(mn[t]||t)+"("+pn(i[t],le[t])+") ";return n||"none"},v=(t=y())=>{i.style.transform=yn(t,{})},x=(t=!0)=>{t&&v(),u.forEach(({animation:t})=>t.cancel()),u=[]},T=(t,e,n=1/0)=>{const i={animation:t,offset:e,end:n};t.startTime=o.now()+e,n<1/0&&(t.onfinish=()=>{i.isDone=!0,u.some(t=>t.end===1/0)&&(t.cancel(),u=u.filter(t=>t!==i)),k.schedule(!1)}),t.oncancel=()=>u.includes(i)&&k.demote(),u.push(i)},w=(t,e,n)=>{const i=(e,n)=>Math.abs(t(n)-t(e)),s=i(e,n);for(;n-e>.01;){const t=(e+n)/2;i(e,t)>i(t,n)?n=t:e=t}return i(e,n)>s/2?[e,n]:[]},b=(t,n,i,s)=>{const o=Math.min(200,Math.max(2,Math.ceil((i-n)/sn)));if(4*s.length>o)return;const r=Tn(n,i,o).concat(s).sort(xn),a=t=>e.progress(n,i,t);let l,c;for(const e of t){const t=r.map(t=>e.numberAt(t)),[n]=t,i=t[t.length-1]-n,s=t.map(t=>i?(t-n)/i:t-n);if(i)if(l){if(s.some((t,e)=>!(Math.abs(t-l[e])<=vn)))return}else l=s,c=t=>(e.numberAt(t)-n)/i;else if(s.some(t=>!(Math.abs(t)<=vn)))return}if(!l||l.every((t,e)=>Math.abs(t-a(r[e]))<=vn))return"linear";const u=[],h=(t,e=c(t))=>u.push(Qt(e)+" "+Qt(100*a(t))+"%");return l.forEach((t,e)=>{e&&Math.abs(t-l[e-1])>.2&&w(c,r[e-1],r[e]).forEach(t=>h(t)),h(r[e],t)}),"linear("+u+")"},S=(t,e,n,i)=>{const s=[e],o=(e,n)=>t.every(t=>!(Math.abs(t.numberAt((e+n)/2)-(t.numberAt(e)+t.numberAt(n))/2)>(t.name.startsWith("scale")?.001:.1))),r=(e,n,i)=>{if(n-e<1||o(e,n))s.push(n);else if(i<4)r(e,(e+n)/2,i+1),r((e+n)/2,n,i+1);else{for(const i of t)s.push(...w(t=>i.numberAt(t),e,n));s.push(n)}},a=Tn(e,n,Math.ceil((n-e)/100));for(const t of i)a.push(t,Math.min(t+.01,n));let l=e;for(const t of a.sort(xn))t>l&&r(l,t,0),l=t;return s.sort(xn)},A=t=>{let e;for(const n of t){const t=n.tween();if(!t||e?.some((e,n)=>n<2?Math.abs(t[n]-e)>1:t[n]!==e))return;e=t}return e},V=(t,n,s,o={fill:"both"},r,a)=>{const l=t.flatMap(t=>t.boundaries(n,s)),c=a||b(t,n,s,l),u=c?[n,s]:S(t,n,s,l),h=u.map(t=>g(t,r));let d={transform:h};return c||(d.offset=u.map(t=>e.progress(n,s,t))),h.every(t=>t===h[0])&&(v(y(n,r)),d=null),i.animate(d,{...o,duration:s-n,easing:c||"linear"})},P=e=>{let n=e,o=0,h=0;const d=[],p=[],m=new Set;r.clear(),c=new Map;for(const t of s){r.set(t.name,t);const[i,s]=t.timing(),a=i===1/0;if(c.set(t,[t.at(e),t.speed,a]),a)t.sync();else{if(t.speed<0)return;if(s){if(o){const t=(i-h)/s;if(Math.abs(s-o)>1||Math.abs(t-Math.round(t))*o>1)return}else o=s,h=i;p.push(t)}else m.add(i);d.push(t),n=Math.max(n,i)}}a={},l=Ve.filter(e=>{if(r.has(e))return!0;const n=a[e]=Sn(t,e);return void 0!==n&&parseFloat(n)!==(e.startsWith("scale")?1:0)}),x(!1);const f=!o&&A(d);try{if(f&&f[1]>e){const[t,n,i]=f;T(V(d,t,n,void 0,void 0,i),t-e,n-t)}else n>e&&(T(V(d,e,n),0,n-e),m.forEach(t=>t<n-1&&T(i.animate(null,{duration:t-e}),0,t-e)));if(o){const t=h+Math.floor((n-h)/o)*o;T(V(p,t,t+o,{iterations:1/0,iterationStart:(n-t)/o,fill:"forwards"},n),n-e)}}catch{return}return u.length||x(),!0},M=t=>{let e,n=0;for(const i of s){const s=c.get(i);if(!s)return!1;const[o,r,a]=s,l=i.at(t),u=i.timing()[0]===1/0;if(a){if(u&&l===o)continue;return!1}const h=(l-o)/r,d=u?0:i.speed/r;if(void 0===e)e=h,n=d;else if(Math.abs(h-e)>1||d!==n)return!1}if(void 0===e)return!0;if(!u.length)return!1;for(const{offset:t,end:n,isDone:i}of u){const s=e-t;if(n<1/0&&(i?s<n-1:s<0||s>=n))return!1}for(const{animation:i,offset:s,isDone:o}of u){if(o)continue;const r=e-s;n?(i.playbackRate=n,i.startTime=t-r/n):(i.pause(),i.currentTime=r)}return!0},E=()=>{const e=o.now();if(k.isJS||(k.isFinishing=!0,s.forEach(n=>{const[i,s]=n.timing();"running"===n.state&&n.speed>0&&!s&&i<=e+1&&(n.complete(),a[n.name]=Sn(t,n.name),c.has(n)||(h=!0))}),k.isFinishing=!1),d=!1,s.forEach(({state:t},e)=>{"idle"!==t&&"finished"!==t||s.delete(e)}),!s.size)return gn.delete(i),void(k.isJS||x());for(const t of s)if(!t.canAccelerate)return k.demote(!0);k.isJS&&(k.isJS=!1,h=!0,s.forEach(t=>t.js?.stop()));const n=h,r=p;if(h=p=!1,n||!M(e)){if(r){if(e-m<100)return k.demote();m=e}if(!P(e))return k.demote()}},k={tracks:s,isJS:!1,isFinishing:!1,schedule(t,e){h||(h=t),p||(p=!!e),d||(d=!0,n.isProcessing?at.render(E,!1,!0):queueMicrotask(E))},check(){if(!k.isJS)for(const e in a)if(Sn(t,e)!==a[e]&&!f(e))return k.schedule(!0,!0)},demote(t){k.isJS||(s.forEach(e=>{e.isAccelerated()&&e.sync(),t||(e.canAccelerate=!1)}),k.isJS=!0,c=new Map,x(),s.forEach(t=>"running"===t.state&&t.js?.start()))}};return gn.set(i,k),k}(wn(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(o.now())}get time(){return this.isAccelerated()?e.millisecondsToSeconds(e.clamp(0,this.totalDuration,this.at(o.now())-(this.options.delay||0))):super.time}set time(t){super.time=t}attachTimeline(t){return this.canAccelerate=!1,this.group?.demote(!0),super.attachTimeline(t)}}class Vn extends Zt{constructor(t){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=o.now();const{keyframes:e,name:n,motionValue:i,element:s}=t,r=t;r.autoplay??(r.autoplay=!0),r.delay??(r.delay=0),r.type??(r.type="keyframes"),r.repeat??(r.repeat=0),r.repeatDelay??(r.repeatDelay=0),r.repeatType??(r.repeatType="loop");const a=s?.KeyframeResolver||Ue;this.keyframeResolver=new a(e,(t,e,n)=>this.onKeyframesResolved(t,e,r,!n),n,i,s),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,i,s){this.keyframeResolver=void 0;const{name:r,type:a,velocity:l,delay:c,isHandoff:u,onUpdate:h}=i;this.resolvedAt=o.now();let d=!0;(function(t,n,i,s){const o=t[0];if(null===o)return!1;if("display"===n||"visibility"===n)return!0;const r=t[t.length-1],a=rn(o,n),l=rn(r,n);return a&&l?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"===i||Je(i))&&s:(a!==l&&e.warning(!1,`You are trying to animate ${n} from "${o}" to "${r}". "${a?r:o}" is not an animatable value.`,"value-not-animatable"),!1)})(t,r,a,l)||(d=!1,!e.MotionGlobalConfig.instantAnimations&&c||h?.(Gt(t,i,n)),t[0]=t[t.length-1],an(i),i.repeat=0);const{onComplete:p}=i;i.finalKeyframe=n,i.keyframes=t,i.onComplete=()=>{p?.(),this.notifyFinished()};const m=d&&!u&&dn(i),f=!m&&(({name:t,motionValue:e})=>t&&Ve.includes(t)&&e?.owner?.current instanceof HTMLElement&&hn()&&Xe())(i);let y;if(s&&(m||f||this.resolvedAt!==this.createdAt)&&(i.startTime??(i.startTime=qt(this.createdAt,this.resolvedAt))),m){i.element=i.motionValue?.owner?.current;try{y=new on(i)}catch{y=new te(i)}}else y=f?new An(i):new te(i);this.pendingTimeline&&(this.stopTimeline=y.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=y}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(),Ne()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}class Pn{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 Mn(this.animations,"duration")}get iterationDuration(){return Mn(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 Mn(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 En extends tn{constructor(t){super(),this.animation=t,t.onfinish=()=>{this.finishedTime=this.time,this.notifyFinished()},_t(this,{})}}const kn=new WeakMap;function Dn(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 Cn={current:void 0};class Rn{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=o.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.notifyChange(),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=o.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,n){var i;return"change"===t?this.onChangeSubscribe(n):((i=this.events)[t]||(i[t]=new e.SubscriptionManager)).add(n)}onChangeSubscribe(t){const{events:n}=this;return n.change||this.changeSubscriber?(n.change||(n.change=new e.SubscriptionManager,n.change.add(this.changeSubscriber),this.changeSubscriber=void 0),n.change.add(t)):this.changeSubscriber=t,()=>{this.changeSubscriber===t?this.changeSubscriber=void 0:n.change?.remove(t),this.stopIfUnobserved()}}stopIfUnobserved(){at.read(()=>{this.changeSubscriber||this.events.change?.getSize()||this.stop()})}clearListeners(){this.changeSubscriber=void 0;for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.notifyChange()}notifyChange(){const{current:t,changeSubscriber:e}=this;e?e(t):this.events.change?.notify(t)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){Cn.current&&Cn.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=o.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,30);return e.velocityPerSecond(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0;let n,i=!1;n=t(()=>{i=!0,this.events.animationComplete?.notify(),this.animation===n&&this.clearAnimation(),e()}),i||(this.animation=n),this.events.animationStart?.notify()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){this.animation=void 0}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Bn(t,e){return new Rn(t,e)}function jn(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}function Ln(t,e){const n=t?.[e]??t?.default??t;return n!==t?jn(n,t):n}const Fn={type:"spring",stiffness:500,damping:25,restSpeed:10},On={type:"keyframes",duration:.8},In={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Nn=(t,{keyframes:e})=>e.length>2?On:Pe.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Fn:In,Un=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function $n(t){for(const e in t)if(!Un.has(e))return!0;return!1}const Wn=(t,n,i,s={},o,r)=>a=>{const l=Ln(s,t)||{},c=l.delay||s.delay||0;let{elapsed:u=0}=s;u-=e.secondsToMilliseconds(c);const h={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:n.getVelocity(),...l,delay:-u,onUpdate:t=>{n.set(t),l.onUpdate&&l.onUpdate(t)},onComplete:()=>{a(),l.onComplete&&l.onComplete()},name:t,motionValue:n,element:r?void 0:o,hasOnUpdate:!!l.onUpdate};$n(l)||Object.assign(h,Nn(t,h)),h.duration&&(h.duration=e.secondsToMilliseconds(h.duration)),h.repeatDelay&&(h.repeatDelay=e.secondsToMilliseconds(h.repeatDelay)),void 0!==h.from&&(h.keyframes[0]=h.from);let d=!1;if((!1===h.type||0===h.duration&&!h.repeatDelay)&&(an(h),0===h.delay&&(d=!0)),(e.MotionGlobalConfig.instantAnimations||e.MotionGlobalConfig.skipAnimations||o?.shouldSkipAnimations||l.skipAnimations)&&(d=!0,an(h),h.delay=0),h.allowFlatten=!l.type&&!l.ease,d&&!r&&void 0!==n.get()){const t=Gt(h.keyframes,l);if(void 0!==t)return void at.update(()=>{h.onUpdate(t),h.onComplete()})}return l.isSync?new te(h):new Vn(h)};function zn(t,e,n,i){const s=1-t;return s*s*e+2*s*t*n+t*t*i}function Kn(t,e,n,i,s,o,r){const a=2*(1-t)*(n-e)+2*t*(i-n),l=2*(1-t)*(o-s)+2*t*(r-o);return Math.atan2(l,a)*(180/Math.PI)}function Gn(t,e,n,i,s,o){const r=n-t,a=i-e,l=Math.sqrt(r*r+a*a);if(l>0){const n=s*l;return{x:t+r*o+-a/l*n,y:e+a*o+r/l*n}}return{x:t,y:e}}const Yn=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Xn(t){const e=Yn.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n??i}`,s]}function qn(t,n,i=1){e.invariant(i<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,o]=Xn(t);if(!s)return;const r=window.getComputedStyle(n).getPropertyValue(s);if(r){const t=r.trim();return e.isNumericalString(t)?parseFloat(t):t}return u(o)?qn(o,n,i+1):o}function Hn(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 _n(t,e,n){return Hn(t.getProps(),e,n,t)}const Zn=(t,e)=>"exit"===e?t.presenceContext?.custom:void 0,Jn=new Set(["width","height","top","left","right","bottom",...Ve]),Qn=t=>Array.isArray(t);function ti(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Bn(n))}function ei(t){return Qn(t)?t[t.length-1]||0:t}function ni(t,e){const n=_n(t,e);let{transitionEnd:i={},transition:s={},...o}=n||{};o={...o,...i};for(const e in o){ti(t,e,ei(o[e]))}}const ii=t=>Boolean(t&&t.getVelocity);function si(t){return Boolean(ii(t)&&t.add)}function oi(t,n){const i=t.getValue("willChange");if(si(i))return i.add(n);if(!i&&e.MotionGlobalConfig.WillChange){const i=new e.MotionGlobalConfig.WillChange("auto");t.addValue("willChange",i),i.add(n)}}function ri(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const ai="framerAppearId",li="data-"+ri(ai);function ci(t){return t.props[li]}const ui="undefined"!=typeof window;function hi({protectedKeys:t,needsAnimating:e},n){const i=n in t&&!e[n];return e[n]=!1,i}function di(t,e,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:o,transitionEnd:r,...a}=e;const l=t.getDefaultTransition();o=o?jn(o,l):l;const c=o?.reduceMotion,u=o?.skipAnimations;i&&(o=i);const h=[],d=s&&t.animationState?.getState()[s],p=o?.path;p&&p.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&&hi(d,e))continue;const r={delay:n,...Ln(o||{},e)};u&&(r.skipAnimations=!0);const l=i.get();if(void 0!==l&&!i.isAnimating()&&!Array.isArray(s)&&s===l&&!r.velocity){at.update(()=>i.set(s));continue}let p=!1;if(ui&&window.MotionHandoffAnimation){const n=ci(t);if(n){const t=window.MotionHandoffAnimation(n,e,at);null!==t&&(r.startTime=t,p=!0)}}oi(t,e);const m=c??t.shouldReduceMotion;i.start(Wn(e,i,s,m&&Jn.has(e)?{type:!1}:r,t,p));const f=i.animation;f&&h.push(f)}if(r){const e=()=>at.update(()=>{r&&ni(t,r)});h.length?Promise.all(h).then(e):e()}return h}function pi(t,e,n={}){const i=_n(t,e,Zn(t,n.type)),s=n.transitionOverride||(i?.transition??(t.getDefaultTransition()||{})),o=()=>Promise.all(i?di(t,i,n):[]),r=(i=0)=>{const{variantChildren:o}=t,{delayChildren:r=0,staggerChildren:a,staggerDirection:l}=s,c=[];return o?.forEach(t=>{t.notify("AnimationStart",e),c.push(pi(t,e,{...n,delay:i+("function"==typeof r?0:r)+Dn(o,t,r,a,l)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(c)},{when:a}=s;return a?"beforeChildren"===a?o().then(()=>r()):r().then(o):Promise.all([o(),r(n.delay)])}function mi(t,e,n={}){t.notify("AnimationStart",e);return(Array.isArray(e)?Promise.all(e.map(e=>pi(t,e,n))):"string"==typeof e?pi(t,e,n):Promise.all(di(t,_n(t,e,n.custom),n))).then(()=>{t.notify("AnimationComplete",e)})}const fi=t=>e=>e.test(t),yi=[p,P,V,A,E,M,{test:t=>"auto"===t,parse:t=>t}],gi=t=>yi.find(fi(t));function vi(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||e.isZeroValueString(t))}const xi=new Set(["auto","none","0"]);class Ti extends Ue{constructor(t,e,n,i,s){super(t,e,n,i,s,!0)}scheduleResolve(){if(this.canReadNow()&&(this.readKeyframes(),!this.needsMeasurement))return this.complete();super.scheduleResolve()}canReadNow(){const{unresolvedKeyframes:t,element:e,motionValue:n}=this,i=t[0]??n?.get();if(!e?.current||void 0===i)return!1;for(let e=0;e<t.length;e++)if(d(e?t[e]:i))return!1;return!0}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){let i=t[n];if("string"==typeof i&&(i=i.trim(),u(i))){const s=qn(i,e.current);void 0!==s&&(t[n]=s),n===t.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!Jn.has(n)||2!==t.length)return;const[i,s]=t;if("number"==typeof i&&"number"==typeof s)return;const o=gi(i),r=gi(s);if(d(i)!==d(s)&&Re[n])this.needsMeasurement=!0;else if(o!==r)if(Me(o)&&Me(r))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else Re[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)(null===t[e]||vi(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&&!xi.has(e)&&O(e)&&(i=t[s]),s++}if(i&&n)for(const s of e)t[s]!==i&&(t[s]=de(n,i))}(t,n,e)}measure(){const{element:t,name:e}=this;return Re[e](window.getComputedStyle(t.current),()=>t.measureViewportBox())}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),e[0]=this.measuredOrigin;const i=e[e.length-1];void 0!==i&&this.motionValue?.jump(i,!1)}measureEndState(){const{element:t,unresolvedKeyframes:e}=this;if(!t||!t.current)return;this.motionValue?.jump(this.measuredOrigin,!1);const n=e.length-1,i=e[n];e[n]=this.measure(),null!==i&&void 0===this.finalKeyframe&&(this.finalKeyframe=i),this.removedTransforms?.length&&this.removedTransforms.forEach(([e,n])=>{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const wi=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],bi=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius",...wi,"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"]);const Si=e.memo(()=>{try{document.createElement("div").animate({opacity:[1]})}catch(t){return!1}return!0}),Ai=[];function Vi(t){e.removeItem(Ai,t)}function Pi(t,e,n={},i){const s=[],{velocity:o}=n,r=n.reduceMotion??i?.shouldReduceMotion;for(const a in e){if("transition"===a||"transitionEnd"===a)continue;const l=e[a];if(void 0===l)continue;const c=t(a),u=c.get();void 0===u||c.isAnimating()||Array.isArray(l)||l!==u||o?(c.start(Wn(a,c,l,r&&Jn.has(a)?{type:!1}:n,i)),c.animation&&s.push(c.animation)):at.update(()=>c.set(l))}const{transitionEnd:a}=e;if(a){const e=()=>at.update(()=>{for(const e in a)t(e).set(a[e])});s.length?Promise.all(s).then(e):e()}return s}function Mi(t,n,i,s,o){return Pi(s=>{let r=t.get(n,s);if(!r){let a;if(!o){const o=i[s];a=function(t){const e=Array.isArray(t)?t[0]:void 0;return null===e?void 0:e}(o)??t.read(n,s,o),e.invariant(void 0!==a,`"${s}" can't be read from the animated subject. Provide [from, to] keyframes.`,"effect-unreadable-value")}r=Bn(a,{owner:o}),t(n,{[s]:r})}return r},i,s,o)}function Ei(t){return e.isObject(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}function ki(t){return e.isObject(t)&&"ownerSVGElement"in t}function Di(t,e,n){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let i=document;e&&(i=e.current);const s=n?.[t]??i.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t).filter(t=>null!=t)}function Ci(t){const{test:e,read:n,get:i,flush:s,state:o}=t;return Object.assign((e,n)=>{const i=Di(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 Ri{constructor(t=at.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 Bi(t,{step:e,...n}={}){const i=new WeakMap;return Object.assign((n,s)=>{const o=i.get(n)??new Ri(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 ji={};const Li=new Set(["originX","originY","originZ"]),Fi=(t,e)=>pn(t.get(e)?.get(),le[e]),Oi=(t,e,n,i)=>{let s,o;if(Pe.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)=>Ve.indexOf(t)-Ve.indexOf(e)))}e.get("transform")||(Ei(t)||e.get("transformBox")||Oi(t,e,"transformBox",new Rn("fill-box")),e.set("transform",new Rn("none"),()=>{gn.get(t)?.check(),t.style.transform=function(t){let e="";const{transformKeys:n=[],transformValues:i={}}=t;for(let t=0;t<n.length;t++){const s=n[t],o=i[s].getCurrent();void 0!==o&&(("number"==typeof o?o:parseFloat(o))!==(s.startsWith("scale")?1:0)&&(e+=(e&&" ")+(ji[s]||(ji[s]=(mn[s]||s)+"("))+pn(o,ae[s])+")"))}const s=t.get("pathRotation")?.get();return s&&(e+=(e&&" ")+"rotate("+pn(s,ae.pathRotation)+")"),e||"none"}(e)})),o=e.get("transform")}else Li.has(n)?(e.get("transformOrigin")||e.set("transformOrigin",new Rn(""),()=>{const n=Fi(e,"originX")??"50%",i=Fi(e,"originY")??"50%",s=Fi(e,"originZ")??0;t.style.transformOrigin=`${n} ${i} ${s}`}),o=e.get("transformOrigin")):s=$e(n)?()=>{t.style.setProperty(n,i.getCurrent())}:()=>{t.style[n]=pn(i.getCurrent(),le[n])};return e.set(n,i,s,o)},Ii=(t,e)=>{if(Pe.has(e))return Se(t,e);const n=getComputedStyle(t),i=$e(e)?n.getPropertyValue(e):n[e];return"string"==typeof i&&i.trim()||0},Ni=Bi(Oi,{test:t=>Ei(t)||ki(t),read:Ii}),Ui=Ci(Ni);function $i(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(Pe.has(t))r=!0;else if(l(t))s[t]=n;else{const e=pn(n,le[t]);t.startsWith("origin")?(a=!0,o[t]=e):i[t]=e}}if(e.transform||(r||n?i.transform=yn(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 Wi={offset:"stroke-dashoffset",array:"stroke-dasharray"},zi={offset:"strokeDashoffset",array:"strokeDasharray"};function Ki(t,e,n=1,i=0,s=!0){t.pathLength=1;const o=s?Wi:zi;t[o.offset]=""+-i,t[o.array]=`${e} ${n}`}const Gi=["transform","opacity","clipPath","filter","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Yi(t,{attrX:e,attrY:n,attrScale:i,pathLength:s,pathSpacing:o=1,pathOffset:r=0,...a},l,c,u){if($i(t,a,c),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:h,style:d}=t;for(const t of Gi)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&&Ki(h,s,o,r,!1)}const Xi=(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=ri(s));const r=le[n]||le[s],a=o?()=>{t[s]=pn(i.get(),le[n])}:()=>{const e=pn(i.get(),r);null==e?t.removeAttribute(s):t.setAttribute(s,String(e))};return e.set(n,i,a)},qi=Ci(Bi(Xi));const Hi=(t,e,n,i)=>{if(n.startsWith("path"))return function(t,e,n,i){return at.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 Rn("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 Xi(t,e,n,i,Qi(n));return(Pe.has(n)||Li.has(n)||$e(n)||n in t.style?Oi:Xi)(t,e,n,i)},_i=(t,e)=>Pe.has(e)?le[e]?.default||0:$e(e)||Gi.includes(e)?Ii(t,e)||t.getAttribute(ri(e))||0:(e=Qi(e),t.getAttribute(ri(e))??t.getAttribute(e)??void 0),Zi=Bi(Hi,{test:ki,read:_i}),Ji=Ci(Zi);function Qi(t){return t.replace(/^attr([A-Z])/,(t,e)=>e.toLowerCase())}function ts({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function es(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 ns(t){return void 0===t||1===t}function is({scale:t,scaleX:e,scaleY:n}){return!ns(t)||!ns(e)||!ns(n)}function ss(t){return is(t)||os(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function os(t){return rs(t.x)||rs(t.y)}function rs(t){return t&&"0%"!==t}function as(t,e,n){return n+e*(t-n)}function ls(t,e,n,i,s){return void 0!==s&&(t=as(t,s,i)),as(t,n,i)+e}function cs(t,e=0,n=1,i,s){t.min=ls(t.min,e,n,i,s),t.max=ls(t.max,e,n,i,s)}function us(t,{x:e,y:n}){cs(t.x,e.translate,e.scale,e.originPoint),cs(t.y,n.translate,n.scale,n.originPoint)}const hs=.999999999999,ds=1.0000000000001;function ps(t,e,n,i=!1){const s=n.length;if(!s)return;let o,r;e.x=e.y=1;for(let a=0;a<s;a++){o=n[a],r=o.projectionDelta;const{visualElement:s}=o.options;s&&s.props.style&&"contents"===s.props.style.display||(i&&o.options.layoutScroll&&o.scroll&&o!==o.root&&(ms(t.x,-o.scroll.offset.x),ms(t.y,-o.scroll.offset.y)),r&&(e.x*=r.x.scale,e.y*=r.y.scale,us(t,r)),i&&ss(o.latestValues)&&gs(t,o.latestValues,o.layout?.layoutBox))}e.x<ds&&e.x>hs&&(e.x=1),e.y<ds&&e.y>hs&&(e.y=1)}function ms(t,e){t.min+=e,t.max+=e}function fs(t,e,n,i,s=.5){cs(t,e,n,G(t.min,t.max,s),i)}function ys(t,e){return"string"==typeof t?parseFloat(t)/100*(e.max-e.min):t}function gs(t,e,n){const i=n??t;fs(t.x,ys(e.x,i.x),e.scaleX,e.scale,e.originX),fs(t.y,ys(e.y,i.y),e.scaleY,e.scale,e.originY)}function vs(t,e){return ts(es(t.getBoundingClientRect(),e))}const xs={},Ts=t=>ki(t)?Zi:Ni;class ws{constructor(t,e){this.effect=t,this.current=e,this.KeyframeResolver=Ti}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 vs(this.current)}getProps(){return xs}}function bs(t,e){const n=Ts(t).state(t);if(!n)return;const{transformKeys:i}=n;n.release().forEach((t,n)=>{"transformBox"===n||"transform"===n&&i?.length||e.addValue(n,t)})}const Ss=Bi((t,e,n,i)=>e.set(n,i,()=>{t[n]=i.get()}),{test:t=>e.isObject(t),read:(t,e)=>{const n=t[e];return"string"==typeof n||"number"==typeof n?n:void 0}}),{schedule:As,cancel:Vs}=rt(queueMicrotask,!1),Ps={x:!1,y:!1};function Ms(){return Ps.x||Ps.y}function Es(t,e){const n=Di(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}const ks=(t,e)=>!!e&&(t===e||ks(t,e.parentElement)),Ds=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,Cs=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Rs(t){return Cs.has(t.tagName)||!0===t.isContentEditable}const Bs=new Set(["INPUT","SELECT","TEXTAREA"]);const js=new WeakSet;function Ls(t){return e=>{"Enter"===e.key&&t(e)}}function Fs(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function Os(t){return Ds(t)&&!Ms()}const Is=new WeakSet;const Ns=new WeakMap;let Us;const $s=(t,e,n)=>(i,s)=>s&&s[0]?s[0][t+"Size"]:ki(i)&&"getBBox"in i?i.getBBox()[e]:i[n],Ws=$s("inline","width","offsetWidth"),zs=$s("block","height","offsetHeight");function Ks({target:t,borderBoxSize:e}){Ns.get(t)?.forEach(n=>{n(t,{get width(){return Ws(t,e)},get height(){return zs(t,e)}})})}function Gs(t){t.forEach(Ks)}function Ys(t,e){Us||"undefined"!=typeof ResizeObserver&&(Us=new ResizeObserver(Gs));const n=Di(t);return n.forEach(t=>{let n=Ns.get(t);n||(n=new Set,Ns.set(t,n)),n.add(e),Us?.observe(t)}),()=>{n.forEach(t=>{const n=Ns.get(t);n?.delete(e),n?.size||Us?.unobserve(t)})}}const Xs=new Set;let qs;function Hs(t){return Xs.add(t),qs||(qs=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Xs.forEach(e=>e(t))},window.addEventListener("resize",qs)),()=>{Xs.delete(t),Xs.size||"function"!=typeof qs||(window.removeEventListener("resize",qs),qs=void 0)}}const _s={value:null,addProjectionMetrics:null};function Zs(t){return ki(t)&&"svg"===t.tagName}function Js(t,e){if("first"===t)return 0;{const n=e-1;return"last"===t?n:n/2}}function Qs(...t){const e=!Array.isArray(t[0]),n=e?0:-1,i=t[0+n],s=Ot(t[1+n],t[2+n],t[3+n]);return e?s(i):s}const to=new Set,eo=({timestamp:t})=>{to.forEach(e=>e.tick(t))};class no extends Zt{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():(to.size||at.update(eo,!0),to.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=qt(this.startTime,t));const r=Math.round(t-this.startTime)-i,a=this.currentTime=Math.max(0,r),l=this.generator.next(a),c=r<0?e.keyframes[0]:l.value;if(n){this.hasNextTarget=!1;const{keyframes:t}=e;t[0]=c,t[1]=this.nextTarget,this.retarget(t,this.nextVelocity??this.getGeneratorVelocity())}!n&&this.started||(this.started=!0,o?.()),"running"===this.state&&(s?.(c),l.done&&r>=0&&!n&&!this.hasNextTarget&&"running"===this.state&&(this.notifyFinished(),this.teardown(),this.state="finished",e.onComplete?.()))}getGeneratorVelocity(){return zt(this.generator,this.currentTime,this.options.velocity)}now(){return this.driver?this.driver.now():o.now()}teardown(){this.state="idle",this.driver?this.driver.stop():(to.delete(this),to.size||lt(eo))}}const io=t=>"number"==typeof t?t:parseFloat(t);function so(t,e,n){const i=t.get();let s,o=null;const r="string"==typeof i?i.replace(/[\d.-]/g,""):void 0,a=t=>s(r?t+r:t),l=()=>t.events.animationStart?.notify(),c=()=>{o&&(o.stop(),o=null),t.animation=void 0};if(t.attach((e,i)=>{s=i;const r=io(e);if("running"===o?.state)return void o.setTarget(r,n.velocity);const u=io(t.get()),h=o?o.getGeneratorVelocity():t.getVelocity();if(c(),u===r)return;const d={keyframes:[u,r],velocity:h,restDelta:.001,restSpeed:.01,...n,onUpdate:a},p=o=new no({...d,onPlay:l});t.animation=p,p.then(()=>{o===p&&(o=null,t.animation=void 0,t.events.animationComplete?.notify())})},c),ii(e)){let i=!0===n.skipInitialAnimation;const s=e.on("change",e=>{i?(i=!1,t.jump(oo(e,r),!1)):t.set(oo(e,r))}),o=t.on("destroy",s);return()=>{s(),o()}}return c}function oo(t,e){return e?t+e:t}function ro(t,e,n={}){const i={type:"spring",...n};return Xt(i),i.type=i.type||Wt,so(t,e,i)}function ao(t){const e=[];Cn.current=e;const n=t();Cn.current=void 0;const i=Bn(n);return function(t,e,n){const i=()=>e.set(n()),s=()=>at.preRender(i,!1,!0),o=t.map(t=>t.on("change",s));e.on("destroy",()=>{o.forEach(t=>t()),lt(i)})}(e,i,t),i}function lo(t,e,n){return so(t,e,{...n,type:Lt})}const co=[...yi,C,$];let uo=0;const ho=()=>"motion-view-"+uo++;function po(t,e,n){e&&(t.style?.setProperty("view-transition-class",e),n.push(t))}function mo(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 fo(t,e,n,i,s,o=[],r,a=[],l){const c=Di(t);if(i)return c.map((t,c)=>{const u=e.get(t);if(u)return u;const h=i[c]??ho();return t.style?.setProperty("view-transition-name",h),n.push(t),e.set(t,h),po(t,s,o),mo(t,h,r,a,l),h});const u=c.map(t=>e.has(t)?void 0:getComputedStyle(t).getPropertyValue("view-transition-name"));return c.map((t,i)=>{const c=e.get(t);if(c)return c;const h=u[i];let d;return h&&"none"!==h&&"auto"!==h&&"match-element"!==h&&!(t=>t.startsWith("motion-view-"))(h)?d=h:(d=ho(),t.style?.setProperty("view-transition-name",d),n.push(t)),e.set(t,d),po(t,s,o),mo(t,d,r,a,l),d})}function yo(t){return"layout"===t?"group":"enter"===t||"new"===t?"new":"old"}let go={},vo=null;const xo=(t,e)=>{go[t]=e},To=()=>{vo||(vo=document.createElement("style"),vo.id="motion-view");let t="";for(const e in go){const n=go[e];t+=`${e} {\n`;for(const[e,i]of Object.entries(n))t+=` ${e}: ${i};\n`;t+="}\n"}vo.textContent=t,document.head.appendChild(vo),go={}},wo=()=>{vo&&vo.parentElement&&vo.parentElement.removeChild(vo)};function bo(t){const e=t.match(/::view-transition-(old|new|group-children|group|image-pair)\((.*?)\)/);return e?{layer:e[2],type:e[1]}:null}function So(){return document.getAnimations().filter(t=>{const{effect:e}=t;return!!e&&e.target===document.documentElement&&e.pseudoElement?.startsWith("::view-transition")})}const Ao=["layout","enter","exit","new","old"],Vo=t=>t.split(" ").every(t=>0===parseFloat(t)),Po={group:["layout"],new:["new","enter"],old:["old","exit"]},Mo={new:{opacity:0,scale:.85},old:{opacity:1,scale:1}};function Eo(t){const{update:n,targets:i,resolveDefs:s,cropOverride:o,pairs:r,classNames:a,flatGroups:l,options:c}=t;if(!document.startViewTransition)return(async()=>(await n(),new Pn([])))();const u=new Map,h=[],d=[],p=[],m=new Set,f=new Map,y=new Set,g=new Map,v=new Map,x=new Map,T=new Map,w=t=>{i.forEach((e,n)=>{const i=a.get(n),c="root"!==n&&s.has(n)?l.has(n)?"none":"contain":void 0;let y;if("root"!==n&&s.has(n))if(r.has(n))if("old"===t)T.set(n,Di(n)),y=fo(n,u,h,void 0,i,d,c,p,m),x.set(n,y);else{for(const t of T.get(n)??[])t.style?.removeProperty("view-transition-name"),u.delete(t);y=fo(r.get(n),u,h,x.get(n),i,d,c,p,m)}else y=fo(n,u,h,void 0,i,d,c,p,m);else y=[n];const w=o.get(n);y.forEach((n,i)=>{const s=f.get(n);f.set(n,s&&s!==e?{...s,...e}:e),void 0!==w&&g.set(n,w);const o=v.get(n)??{};o[t]=[i,y.length],v.set(n,o)})})},b=(t,e)=>{const n=v.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=ko(Ln(c,n),Ln(function(t,e){for(const n of Po[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},A=t=>{const[n,i]=b(t,"group"),s=S(f.get(t),"group","layout",-1===n?0:n,i);s.duration&&(s.duration=e.secondsToMilliseconds(s.duration));const{delay:o=0,duration:r,ease:a}=Qe(s);return{delay:e.secondsToMilliseconds(o),duration:r,ease:a}},V=new Map,P=t=>u.forEach((e,n)=>{const i=n,s=i.getBoundingClientRect?.();if(s&&s.height){const n=getComputedStyle(i),o={};for(const t of wi)o[t]=n[t];const r=V.get(e)??{};r[t]={width:s.width,height:s.height,radii:o},V.set(e,r)}}),M=t=>{const e=V.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},E=()=>{(function(t,e){return e.has(t)&&Object.keys(e.get(t)).length>0})("root",i)||xo(":root",{"view-transition-name":"none"}),xo("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)",{"animation-timing-function":"linear !important"}),y.forEach(t=>{xo(`::view-transition-group(${t})`,{overflow:"clip"}),xo(`::view-transition-old(${t}), ::view-transition-new(${t})`,{width:"100%",height:"100%","object-fit":"cover"})}),m.forEach(t=>{xo(`::view-transition-group-children(${t})`,{overflow:"clip"})}),To()},k=()=>{!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")}(h,d,p),wo()},D=async()=>{await n(),w("new"),P("new"),(()=>{y.clear();for(const t of v.keys())"root"!==t&&(g.get(t)??M(t))&&y.add(t)})(),E()};let C;try{w("old"),P("old"),E(),C=document.startViewTransition(D)}catch(t){return k(),Promise.reject(t)}return C.finished.finally(k),new Promise((t,n)=>{C.ready.then(()=>{const n=So(),i=[],s=new Set,o=new Set;f.forEach((t,n)=>{const r=v.get(n),a=!!r?.new&&!r?.old,l=!!r?.old&&!r?.new;for(const r of Ao){if(!t[r])continue;if("enter"===r&&!a)continue;if("exit"===r&&!l)continue;const u=yo(r),[h,d]=b(n,u);if(-1===h)continue;const{keyframes:p,options:m}=t[r];for(let[f,y]of Object.entries(p)){if(null==y)continue;if("x"===f||"y"===f){e.warnOnce(!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"===r&&a&&null!=t.enter?.keyframes[f])continue;if("old"===r&&l&&null!=t.exit?.keyframes[f])continue;const p=ko(Ln(c,f),Ln(m,f));if(!Array.isArray(y)){const e="enter"===r?t.exit?.keyframes[f]:void 0,n="opacity"===f||("new"===u?a:l),i=null!=e?Array.isArray(e)?e[e.length-1]:e:n?Mo[u]?.[f]:void 0;void 0!==i&&(y=[i,y])}"function"==typeof p.delay&&(p.delay=p.delay(h,d)),p.duration&&(p.duration=e.secondsToMilliseconds(p.duration)),p.delay&&(p.delay=e.secondsToMilliseconds(p.delay)),i.push(new tn({...p,element:document.documentElement,name:f,pseudoElement:`::view-transition-${u}(${n})`,keyframes:y})),s.add(`${n}:${u}`),"opacity"===f&&o.add(`${n}:${u}`)}}});for(const t of n){if("finished"===t.playState)continue;const{effect:n}=t;if(!(n&&n instanceof KeyframeEffect))continue;const{pseudoElement:r}=n;if(!r)continue;const a=bo(r);if(!a)continue;const l=f.get(a.layer);if(s.has(`${a.layer}:${a.type}`)){o.has(`${a.layer}:new`)&&o.has(`${a.layer}:old`)&&n.getKeyframes().some(t=>t.mixBlendMode)?i.push(new En(t)):t.cancel();continue}const c="old"===a.type?"new":"new"===a.type?"old":void 0;if(c&&s.has(`${a.layer}:${c}`)&&!o.has(`${a.layer}:${c}`)){t.cancel();continue}const u=v.get(a.layer),h=!("old"!==a.type&&"new"!==a.type||!u?.old||!u?.new);let d;if(a.type.startsWith("group")){const{delay:t,duration:e,ease:n}=A(a.layer);d={delay:t,duration:e,easing:_e(n,e)}}else{const t=h?"group":a.type,[n,i]=b(a.layer,t);let s=S(l,t,"group"===t?"layout":"",-1===n?0:n,i);const o=s.visualDuration;s.duration&&(s.duration=e.secondsToMilliseconds(s.duration)),s=Qe(s),d={delay:e.secondsToMilliseconds(s.delay??0),duration:h&&void 0!==o?e.secondsToMilliseconds(o):s.duration,easing:h?"linear":_e(s.ease,s.duration)}}n.updateTiming(d),i.push(new En(t))}V.forEach((t,e)=>{if(!y.has(e))return;const{delay:n,duration:s,ease:o}=A(e);for(const r of wi){const a=t.old?.radii[r]||t.new?.radii[r]||"0px",l=t.new?.radii[r]||t.old?.radii[r]||"0px";Vo(a)&&Vo(l)||i.push(new tn({element:document.documentElement,name:r,pseudoElement:`::view-transition-group(${e})`,keyframes:[a,l],delay:n,duration:s,ease:o}))}}),t(new Pn(i))}).catch(()=>C.updateCallbackDone.then(()=>t(new Pn([])),n))})}function ko(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 Do=[],Co=null;function Ro(){Co=null;const[t]=Do;var n;t&&(n=t,e.removeItem(Do,n),Co=n,Eo(n).then(t=>(n.notifyReady(t),t.finished)).catch(t=>n.notifyReject(t)).finally(Ro))}function Bo(){for(let t=Do.length-1;t>=0;t--){const e=Do[t],{interrupt:n}=e.options;if("immediate"===n){const n=Do.slice(0,t+1).map(t=>t.update),i=Do.slice(t+1);e.update=()=>{n.forEach(t=>t())},Do=[e,...i];break}}Co&&"immediate"!==Do[0]?.options.interrupt||Ro()}class jo{constructor(t,n={}){var i;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=e.noop,this.notifyReject=e.noop,this.readyPromise=new Promise((t,e)=>{this.notifyReady=t,this.notifyReject=e}),this.update=t,this.options={interrupt:"wait",...n},this.readyPromise.catch(e.noop),i=this,Do.push(i),As.render(Bo)}add(t,e){return this.currentSubject=t,this.resolveDefs.add(t),void 0!==e&&this.pairs.set(t,e),this.targets.has(t)||this.targets.set(t,{}),this}crop(t=!0){return this.cropOverride.set(this.currentSubject,t),this}group(t=!0){return t?this.flatGroups.delete(this.currentSubject):this.flatGroups.add(this.currentSubject),this}class(t){return this.classNames.set(this.currentSubject,t),this}layout(t={}){return this.updateTarget("layout",{},t),this}enter(t,e){return this.updateTarget("enter",t,e),this}exit(t,e){return this.updateTarget("exit",t,e),this}new(t,e){return this.updateTarget("new",t,e),this}old(t,e){return this.updateTarget("old",t,e),this}updateTarget(t,e,n={}){const{currentSubject:i,targets:s}=this;s.has(i)||s.set(i,{});s.get(i)[t]={keyframes:e,options:n}}then(t,e){return this.readyPromise.then(t,e)}}const Lo=()=>({translate:0,scale:1,origin:0,originPoint:0}),Fo=()=>({x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}),Oo=()=>({min:0,max:0}),Io=()=>({x:{min:0,max:0},y:{min:0,max:0}}),No=new WeakMap;function Uo(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function $o(t){return"string"==typeof t||Array.isArray(t)}const Wo=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],zo=["initial",...Wo];function Ko(t){if(Uo(t.animate))return!0;for(let e=0;e<zo.length;e++)if($o(t[zo[e]]))return!0;return!1}function Go(t){return Boolean(Ko(t)||t.variants)}function Yo(t,e,n){for(const i in e){const s=e[i],o=n[i];if(ii(s))t.addValue(i,s);else if(ii(o))t.addValue(i,Bn(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,Bn(void 0!==e?e:s,{owner:t}))}}for(const i in n)void 0===e[i]&&t.removeValue(i);return e}const Xo={current:null},qo={current:!1},Ho="undefined"!=typeof window;function _o(){if(qo.current=!0,Ho)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Xo.current=t.matches;t.addEventListener("change",e),e()}else Xo.current=!1}const Zo=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Jo={};class Qo{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:i,skipAnimations:s,blockInitialAnimation:r,visualState:a},l={}){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=Ue,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=o.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,at.render(this.render,!1,!0))};const{latestValues:c,renderState:u}=a;this.latestValues=c,this.baseTarget={...c},this.initialValues=e.initial?{...c}:{},this.renderState=u,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=s,this.options=l,this.blockInitialAnimation=Boolean(r),this.isControllingVariants=Ko(e),this.isVariantNode=Go(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:h,...d}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in d){const e=d[t];void 0!==c[t]&&ii(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,No.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.isVariantNode&&!this.isControllingVariants){let t=this;do{t=!1!==t.props.inherit&&t.parent}while(t&&!t.isVariantNode);if(t){const{variantChildren:e}=t;e.add(this),this.removeFromVariantTree=()=>e.delete(this)}}this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(qo.current||_o(),this.shouldReduceMotion=Xo.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),lt(this.notifyUpdate),lt(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&ln.has(t)&&this.current instanceof HTMLElement){const{factory:i,keyframes:s,times:o,ease:r,duration:a}=n.accelerate,l=new tn({element:this.current,name:t,keyframes:s,times:o,ease:r,duration:e.secondsToMilliseconds(a)}),c=i(l);return void this.valueSubscriptions.set(t,()=>{c(),l.cancel()})}const i=Pe.has(t);i&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&at.preRender(this.notifyUpdate),i&&(this.projection&&(this.projection.isTransformDirty=!0),gn.get(this.current)?.check()),this.scheduleRender()});let o;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),o&&o()})}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 Jo){const e=Jo[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)&&gn.get(this.current)?.demote(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<Zo.length;e++){const n=Zo[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const i=t["on"+n];i&&(this.propEventSubscriptions[n]=this.on(n,i))}this.prevMotionValues=Yo(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}addValue(t,e){const n=this.values.get(t);if(e!==n){n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e);const i=e.get();void 0!==i&&(this.latestValues[t]=i)}}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=Bn(e??this.getDefaultValue?.(t),{owner:this}),this.addValue(t,n)),n}readValue(t,n){let i=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];return null!=i&&("string"==typeof i&&(e.isNumericalString(i)||e.isZeroValueString(i))?i=parseFloat(i):"number"!=typeof i&&!$.test(i)&&$.test(n)&&(i=de(t,n)),this.setBaseTarget(t,ii(i)?i.get():i)),ii(i)?i.get():i}setBaseTarget(t,e){this.baseTarget[t]=e}on(t,n){return this.events[t]||(this.events[t]=new e.SubscriptionManager),this.events[t].add(n)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){As.render(this.render)}}class tr extends Qo{constructor(){super(...arguments),this.KeyframeResolver=Ti}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;ii(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}function er(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])}const nr={};function ir(t,{layout:e,layoutId:n}){return Pe.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!nr[t]||"opacity"===t)}function sr(t,e,n){const i=t.style,s=e?.style,o={};if(!i)return o;for(const e in i)(ii(i[e])||s&&ii(s[e])||ir(e,t)||void 0!==n?.getValue(e)?.liveStyle)&&(o[e]=i[e]);return o}class or extends tr{constructor(){super(...arguments),this.type="html",this.renderInstance=er}mount(t){e.invariant(Boolean(t.style),"motion.create() components must forward their ref to a HTML or SVG element","custom-component-ref"),super.mount(t)}readValueFromInstance(t,e){if(Pe.has(e))return this.projection?.isProjecting?we(e):Se(t,e);{const i=(n=t,window.getComputedStyle(n)),s=(l(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return vs(t,e)}build(t,e,n){$i(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return sr(t,e,n)}}const rr=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"]),ar=t=>"string"==typeof t&&"svg"===t.toLowerCase();function lr(t,e,n,i){er(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(rr.has(n)?n:ri(n),e.attrs[n])}function cr(t,e,n){const i=sr(t,e,n);for(const n in t)if(ii(t[n])||ii(e[n])){i[-1!==Ve.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return i}function ur(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 hr=[...Wo].reverse();function dr(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!ur(e,t)}function pr(){const t={};for(const e of Wo)t[e]={isActive:"animate"===e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}};return t}const mr=zo.length;function fr(t,e){t.min=e.min,t.max=e.max}function yr(t,e){fr(t.x,e.x),fr(t.y,e.y)}function gr(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function vr(t){return t.max-t.min}function xr(t,e,n){return Math.abs(t-e)<=n}function Tr(t,e,n,i=.5){t.origin=i,t.originPoint=G(e.min,e.max,t.origin),t.scale=vr(n)/vr(e),t.translate=G(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 wr(t,e,n,i){Tr(t.x,e.x,n.x,i?i.originX:void 0),Tr(t.y,e.y,n.y,i?i.originY:void 0)}function br(t,e,n,i=0){const s=i?G(n.min,n.max,i):n.min;t.min=s+e.min,t.max=t.min+vr(e)}function Sr(t,e,n,i){br(t.x,e.x,n.x,i?.x),br(t.y,e.y,n.y,i?.y)}function Ar(t,e,n,i=0){const s=i?G(n.min,n.max,i):n.min;t.min=e.min-s,t.max=t.min+vr(e)}function Vr(t,e,n,i){Ar(t.x,e.x,n.x,i?.x),Ar(t.y,e.y,n.y,i?.y)}function Pr(t,e,n,i,s){return t=as(t-=e,1/n,i),void 0!==s&&(t=as(t,1/s,i)),t}function Mr(t,e=0,n=1,i=.5,s,o=t,r=t){if(V.test(e)){e=parseFloat(e);e=G(r.min,r.max,e/100)-r.min}if("number"!=typeof e)return;let a=G(o.min,o.max,i);t===o&&(a-=e),t.min=Pr(t.min,e,n,a,s),t.max=Pr(t.max,e,n,a,s)}function Er(t,e,[n,i,s],o,r){Mr(t,e[n],e[i],e[s],e.scale,o,r)}const kr=["x","scaleX","originX"],Dr=["y","scaleY","originY"];function Cr(t,e,n,i){Er(t.x,e,kr,n?n.x:void 0,i?i.x:void 0),Er(t.y,e,Dr,n?n.y:void 0,i?i.y:void 0)}function Rr(t){return 0===t.translate&&1===t.scale}function Br(t){return Rr(t.x)&&Rr(t.y)}function jr(t,e){return t.min===e.min&&t.max===e.max}function Lr(t,e){return jr(t.x,e.x)&&jr(t.y,e.y)}function Fr(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Or(t,e){return Fr(t.x,e.x)&&Fr(t.y,e.y)}function Ir(t){return vr(t.x)/vr(t.y)}function Nr(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Ur(t){return[t("x"),t("y")]}function $r(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Wr={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!P.test(t))return t;t=parseFloat(t)}return`${$r(t,e.target.x)}% ${$r(t,e.target.y)}%`}},zr={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=$.parse(t);if(s.length>5)return i;const o=$.createTransformer(t),r="number"!=typeof s[0]?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;s[0+r]/=a,s[1+r]/=l;const c=G(a,l,.5);return"number"==typeof s[2+r]&&(s[2+r]/=c),"number"==typeof s[3+r]&&(s[3+r]/=c),o(s)}};function Kr(t,e,n){let i="";const s=t.x.translate/e.x,o=t.y.translate/e.y,r=n?.z||0;if((s||o||r)&&(i=`translate3d(${s}px, ${o}px, ${r}px) `),1===e.x&&1===e.y||(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:t,rotate:e,pathRotation:s,rotateX:o,rotateY:r,skewX:a,skewY:l}=n;t&&(i=`perspective(${t}px) ${i}`),e&&(i+=`rotate(${e}deg) `),s&&(i+=`rotate(${s}deg) `),o&&(i+=`rotateX(${o}deg) `),r&&(i+=`rotateY(${r}deg) `),a&&(i+=`skewX(${a}deg) `),l&&(i+=`skewY(${l}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return 1===a&&1===l||(i+=`scale(${a}, ${l})`),i||"none"}const Gr=wi.length,Yr=t=>"number"==typeof t||P.test(t);function Xr(t,e,n,i,s,o){s?(t.opacity=G(0,n.opacity??1,Hr(i)),t.opacityExit=G(e.opacity??1,0,_r(i))):o&&(t.opacity=G(e.opacity??1,n.opacity??1,i));for(let s=0;s<Gr;s++){const o=wi[s];let r=qr(e,o),a=qr(n,o);if(void 0===r&&void 0===a)continue;r||(r=0),a||(a=0);0===r||0===a||Yr(r)===Yr(a)?(t[o]=Math.max(G(io(r),io(a),i),0),(V.test(a)||V.test(r))&&(t[o]+="%")):t[o]=a}(e.rotate||n.rotate)&&(t.rotate=G(e.rotate||0,n.rotate||0,i))}function qr(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const Hr=Zr(0,.5,e.circOut),_r=Zr(.5,.95,e.noop);function Zr(t,n,i){return s=>s<t?0:s>n?1:i(e.progress(t,n,s))}function Jr(t,e,n){const i=ii(t)?t:Bn(t);return i.start(Wn("",i,e,n)),i.animation}function Qr(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n,i)}const ta=(t,e)=>t.depth-e.depth;class ea{constructor(){this.children=[],this.isDirty=!1}add(t){e.addUniqueItem(this.children,t),this.isDirty=!0}remove(t){e.removeItem(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(ta),this.isDirty=!1,this.children.forEach(t)}}function na(t,e){const n=o.now(),i=({timestamp:s})=>{const o=s-n;o>=e&&(lt(i),t(o-e))};return at.setup(i,!0),()=>lt(i)}function ia(t){return ii(t)?t.get():t}class sa{constructor(){this.members=[]}add(t){e.addUniqueItem(this.members,t);for(let n=this.members.length-1;n>=0;n--){const i=this.members[n];if(i===t||i===this.lead||i===this.prevLead)continue;const s=i.instance;s&&!1!==s.isConnected||i.snapshot||(e.removeItem(this.members,i),i.unmount())}t.scheduleRender()}remove(t){if(e.removeItem(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)}}const oa={borderRadius:{...Wr,applyTo:[...wi]},borderTopLeftRadius:Wr,borderTopRightRadius:Wr,borderBottomLeftRadius:Wr,borderBottomRightRadius:Wr,boxShadow:zr},ra={hasAnimatedSinceResize:!0,hasEverUpdated:!1};Object.assign(nr,{...oa,...nr});const aa={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},la=["","X","Y","Z"];let ca=0;function ua(t,e,n,i){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),i&&(i[t]=0))}const ha=({instance:t})=>t&&gn.get(t)?.demote();function da(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=ci(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:e,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",at,!(e||i))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&da(i)}function pa({attachResizeListener:t,defaultParent:i,measureScroll:s,checkIsScrollRoot:r,resetTransform:a}){return class{constructor(t={},e=i?.()){this.id=ca++,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,_s.value&&(aa.nodes=aa.calculatedTargetDeltas=aa.calculatedProjections=0),this.nodes.forEach(ya),this.nodes.forEach(Pa),this.nodes.forEach(Ma),this.nodes.forEach(ga),_s.addProjectionMetrics&&_s.addProjectionMetrics(aa)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=e?e.root||e:this,this.path=e?[...e.path,e]:[],this.parent=e,this.depth=e?e.depth+1:0;for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new ea)}addEventListener(t,n){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new e.SubscriptionManager),this.eventHandlers.get(t).add(n)}notifyListeners(t,...e){const n=this.eventHandlers.get(t);n&&n.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}mount(e){if(this.instance)return;this.isSVG=ki(e)&&!Zs(e),this.instance=e;const{layoutId:n,layout:i,visualElement:s}=this.options;if(s&&!s.current&&s.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(i||n)&&(this.isLayoutDirty=!0),t){let n,i=0;const s=()=>this.root.updateBlockedByResize=!1;at.read(()=>{i=window.innerWidth}),t(e,()=>{const t=window.innerWidth;t!==i&&(i=t,this.root.updateBlockedByResize=!0,n&&n(),n=na(s,250),ra.hasAnimatedSinceResize&&(ra.hasAnimatedSinceResize=!1,this.nodes.forEach(Va)))})}n&&this.root.registerSharedNode(n,this),!1!==this.options.animate&&s&&(n||i)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeLayoutChanged:n,layout:i})=>{if(this.isAnimationBlocked)return this.target=void 0,void(this.relativeTarget=void 0);const o=this.options.transition||s.getDefaultTransition()||Ba,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=s.getProps(),l=!this.targetLayout||!Or(this.targetLayout,i),c=!e&&n;if(this.options.layoutRoot||this.resumeFrom||c||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const e={...Ln(o,"layout"),onPlay:r,onComplete:a};(s.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e),this.setAnimationOrigin(t,c,e.path)}else e||Va(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=i})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),lt(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Ea),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&da(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;ha(this),this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){const e=this.path[t];e.shouldResetTransform=!0,ha(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(Ta),void this.nodes.forEach(xa)}if(this.animationId<=this.animationCommitId)return void this.nodes.forEach(wa);this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(ba),this.nodes.forEach(Sa),this.nodes.forEach(Aa),this.nodes.forEach(ma),this.nodes.forEach(fa)):this.nodes.forEach(wa),this.clearAllSnapshots();const t=o.now();n.delta=e.clamp(0,1e3/60,t-n.timestamp),n.timestamp=t,n.isProcessing=!0,ct.update.process(n),ct.preRender.process(n),ct.render.process(n),n.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,As.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(va),this.sharedNodes.forEach(ka)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,at.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){at.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||vr(this.snapshot.measuredBox.x)||vr(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t<this.path.length;t++){this.path[t].updateScroll()}const t=this.layout;this.layout=this.measure(!1),this.layoutCorrected||(this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}}),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:e}=this.options;e&&e.notify("LayoutMeasure",this.layout.layoutBox,t?t.layoutBox:void 0)}updateScroll(t="measure"){let e=Boolean(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===t&&(e=!1),e&&this.instance){const e=r(this.instance);this.scroll={animationId:this.root.animationId,phase:t,isRoot:e,offset:s(this.instance),wasRoot:this.scroll?this.scroll.isRoot:e}}}resetTransform(){if(!a)return;const t=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout;t&&ha(this);const e=this.projectionDelta&&!Br(this.projectionDelta),n=this.getTransformTemplate(),i=n?n(this.latestValues,""):void 0,s=i!==this.prevTransformTemplateValue;t&&this.instance&&(e||ss(this.latestValues)||s)&&(a(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)),Fa((i=n).x),Fa(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(Ia))){const{scroll:t}=this.root;t&&(ms(e.x,t.offset.x),ms(e.y,t.offset.y))}return e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};if(yr(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&&yr(e,t),ms(e.x,s.offset.x),ms(e.y,s.offset.y))}return e}applyTransform(t,e=!1,n){const i=n||{x:{min:0,max:0},y:{min:0,max:0}};yr(i,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];!e&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(ms(i.x,-n.scroll.offset.x),ms(i.y,-n.scroll.offset.y)),ss(n.latestValues)&&gs(i,n.latestValues,n.layout?.layoutBox)}return ss(this.latestValues)&&gs(i,this.latestValues,this.layout?.layoutBox),i}removeTransform(t){const e={x:{min:0,max:0},y:{min:0,max:0}};yr(e,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];if(!ss(n.latestValues))continue;let i;n.instance&&(is(n.latestValues)&&n.updateSnapshot(),i=Io(),yr(i,n.measurePageBox())),Cr(e,n.latestValues,n.snapshot?.layoutBox,i)}return ss(this.latestValues)&&Cr(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}}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!==n.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 i=Boolean(this.resumingFrom)||this!==e;if(!(t||i&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:s,layoutId:o}=this.options;if(!this.layout||!s&&!o)return;this.resolvedRelativeTargetAt=n.timestamp;const r=this.getClosestProjectingParent();this.targetDelta||this.relativeTarget||(!1!==this.options.layoutAnchor&&r&&r.layout?this.createRelativeTarget(r,this.layout.layoutBox,r.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(),Sr(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):yr(this.target,this.layout.layoutBox),us(this.target,this.targetDelta)):yr(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,!1!==this.options.layoutAnchor&&r&&Boolean(r.resumingFrom)===Boolean(this.resumingFrom)&&!r.options.layoutScroll&&r.target&&1!==this.animationProgress?this.createRelativeTarget(r,this.target,r.target):this.relativeParent=this.relativeTarget=void 0),_s.value&&aa.calculatedTargetDeltas++)}getClosestProjectingParent(){if(this.parent&&!is(this.parent.latestValues)&&!os(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}},Vr(this.relativeTargetOrigin,e,n,this.options.layoutAnchor||void 0),yr(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const t=this.getLead(),e=Boolean(this.resumingFrom)||this!==t;let i=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(i=!1),e&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(i=!1),this.resolvedRelativeTargetAt===n.timestamp&&(i=!1),i)return;const{layout:s,layoutId:o}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!s&&!o)return;yr(this.layoutCorrected,this.layout.layoutBox);const r=this.treeScale.x,a=this.treeScale.y;ps(this.layoutCorrected,this.treeScale,this.path,e),!t.layout||t.target||1===this.treeScale.x&&1===this.treeScale.y||(t.target=t.layout.layoutBox,t.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:l}=t;l?(this.projectionDelta&&this.prevProjectionDelta?(gr(this.prevProjectionDelta.x,this.projectionDelta.x),gr(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),wr(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.treeScale.x===r&&this.treeScale.y===a&&Nr(this.projectionDelta.x,this.prevProjectionDelta.x)&&Nr(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l)),_s.value&&aa.calculatedProjections++):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){if(this.options.visualElement?.scheduleRender(),t){const t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}}setAnimationOrigin(t,e=!1,n){const i=this.snapshot,s=i?i.latestValues:{},o={...this.latestValues},r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;const a={x:{min:0,max:0},y:{min:0,max:0}},l=(i?i.source:void 0)!==(this.layout?this.layout.source:void 0),c=this.getStack(),u=!c||c.members.length<=1,h=Boolean(l&&!u&&!0===this.options.crossfade&&!this.path.some(Ra));let d;this.animationProgress=0;const p=n?.interpolateProjection(t);this.mixTargetDelta=e=>{const n=e/1e3,i=p?.(n);var c,m,f,y;i?(r.x.translate=i.x,r.x.scale=G(t.x.scale,1,n),r.x.origin=t.x.origin,r.x.originPoint=t.x.originPoint,r.y.translate=i.y,r.y.scale=G(t.y.scale,1,n),r.y.origin=t.y.origin,r.y.originPoint=t.y.originPoint):(Da(r.x,t.x,n),Da(r.y,t.y,n)),this.setTargetDelta(r),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Vr(a,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),c=this.relativeTarget,m=this.relativeTargetOrigin,f=a,y=n,Ca(c.x,m.x,f.x,y),Ca(c.y,m.y,f.y,y),d&&Lr(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),yr(d,this.relativeTarget)),l&&(this.animationValues=o,Xr(o,s,this.latestValues,n,h,u)),i&&void 0!==i.rotate&&(this.animationValues||(this.animationValues=o),this.animationValues.pathRotation=i.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(lt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=at.update(()=>{ra.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Bn(0)),this.motionValue.jump(0,!1),this.currentAnimation=Jr(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({...Ht("layout-animation-start",t),node:e})}catch{}}(this.currentAnimation,this),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead(),{targetWithTransforms:e,layout:n,latestValues:i}=t;let{target:s}=t;if(e&&s&&n){if(this!==t&&this.layout&&n&&Oa(this.options.animationType,this.layout.layoutBox,n.layoutBox)){s=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=vr(this.layout.layoutBox.x);s.x.min=t.target.x.min,s.x.max=s.x.min+e;const n=vr(this.layout.layoutBox.y);s.y.min=t.target.y.min,s.y.max=s.y.min+n}yr(e,s),gs(e,i),wr(this.projectionDeltaWithTransform,this.layoutCorrected,e,i)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new sa);this.sharedNodes.get(t).add(e);const n=e.options.initialPromotionConfig;e.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){const{layoutId:t}=this.options;return t&&this.getStack()?.lead||this}getPrevLead(){const{layoutId:t}=this.options;return t?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const i=this.getStack();i&&i.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:n}=t;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(e=!0),!e)return;const i={};n.z&&ua("z",t,i,this.animationValues);for(let e=0;e<la.length;e++)ua(`rotate${la[e]}`,t,i,this.animationValues),ua(`skew${la[e]}`,t,i,this.animationValues);t.render();for(const e in i)t.setStaticValue(e,i[e]),this.animationValues&&(this.animationValues[e]=i[e]);t.scheduleRender()}applyProjectionStyles(t,e){if(!this.instance||this.isSVG)return;if(!this.isVisible)return void(t.visibility="hidden");const n=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,t.visibility="",t.opacity="",t.pointerEvents=ia(e?.pointerEvents)||"",void(t.transform=n?n(this.latestValues,""):"none");const i=this.getLead();if(!this.projectionDelta||!this.layout||!i.target)return this.options.layoutId&&(t.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,t.pointerEvents=ia(e?.pointerEvents)||""),void(this.hasProjected&&!ss(this.latestValues)&&(t.transform=n?n({},""):"none",this.hasProjected=!1));t.visibility="";const s=i.animationValues||i.latestValues;this.applyTransformsToTarget();let o=Kr(this.projectionDeltaWithTransform,this.treeScale,s);n&&(o=n(s,o)),t.transform=o;const{x:r,y:a}=this.projectionDelta;t.transformOrigin=`${100*r.origin}% ${100*a.origin}% 0`,i.animationValues?t.opacity=i===this?s.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:s.opacityExit:t.opacity=i===this?void 0!==s.opacity?s.opacity:"":void 0!==s.opacityExit?s.opacityExit:0;for(const e in nr){if(void 0===s[e])continue;const{correct:n,applyTo:r,isCSSVariable:a}=nr[e],l="none"===o?s[e]:n(s[e],i);if(r){const e=r.length;for(let n=0;n<e;n++)t[r[n]]=l}else a?this.options.visualElement.renderState.vars[e]=l:t[e]=l}this.options.layoutId&&(t.pointerEvents=i===this?ia(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(xa),this.root.sharedNodes.clear()}}}function ma(t){t.updateLayout(),function(t){const{snapshot:e,dragAncestor:n}=t,i=n?.layout;if(!e||!i||t.resumeFrom||t.isAnimationBlocked)return;const s=n.dragSnapshot;Ur(t=>ms(e.layoutBox[t],i.layoutBox[t].min-s.layoutBox[t].min))}(t)}function fa(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=t.layout,{animationType:s}=t.options,o=e.source!==t.layout.source;if("size"===s)Ur(t=>{const i=o?e.measuredBox[t]:e.layoutBox[t],s=vr(i);i.min=n[t].min,i.max=i.min+s});else if("x"===s||"y"===s){const t="x"===s?"y":"x";fr(o?e.measuredBox[t]:e.layoutBox[t],n[t])}else Oa(s,e.layoutBox,n)&&Ur(i=>{const s=o?e.measuredBox[i]:e.layoutBox[i],r=vr(n[i]);s.max=s.min+r,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[i].max=t.relativeTarget[i].min+r)});const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};wr(r,n,e.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?wr(a,t.applyTransform(i,!0),e.measuredBox):wr(a,n,e.layoutBox);const l=!Br(r);let c=!1;if(!t.resumeFrom){const i=t.getClosestProjectingParent();if(i&&!i.resumeFrom){const{snapshot:s,layout:o}=i;if(s&&o){const r=t.options.layoutAnchor||void 0,a={x:{min:0,max:0},y:{min:0,max:0}};Vr(a,e.layoutBox,s.layoutBox,r);const l={x:{min:0,max:0},y:{min:0,max:0}};Vr(l,n,o.layoutBox,r),Or(a,l)||(c=!0),i.options.layoutRoot&&(t.relativeTarget=l,t.relativeTargetOrigin=a,t.relativeParent=i)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function ya(t){_s.value&&aa.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 ga(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function va(t){t.clearSnapshot()}function xa(t){t.clearMeasurements()}function Ta(t){t.isLayoutDirty=!0,t.updateLayout()}function wa(t){t.isLayoutDirty=!1}function ba(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.dragSnapshot||t.layout,t.isLayoutDirty=!0)}function Sa(t){t.relativeTarget&&t.relativeParent?.isLayoutDirty&&(t.currentAnimation?t.isLayoutDirty=!0:(t.targetDelta=void 0,t.removeRelativeTarget()))}function Aa(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Va(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Pa(t){t.resolveTargetDelta()}function Ma(t){t.calcProjection()}function Ea(t){t.resetSkewAndRotation()}function ka(t){t.removeLeadSnapshot()}function Da(t,e,n){t.translate=G(e.translate,0,n),t.scale=G(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Ca(t,e,n,i){t.min=G(e.min,n.min,i),t.max=G(e.max,n.max,i)}function Ra(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const Ba={duration:.45,ease:[.4,0,.1,1]},ja=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),La=ja("applewebkit/")&&!ja("chrome/")?Math.round:e.noop;function Fa(t){t.min=La(t.min),t.max=La(t.max)}function Oa(t,e,n){return"position"===t||"preserve-aspect"===t&&!xr(Ir(e),Ir(n),.2)}function Ia(t){return t!==t.root&&t.scroll?.wasRoot}const Na=pa({attachResizeListener:(t,e)=>Qr(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Ua=t=>!t.isLayoutDirty&&t.willUpdate(!1);const $a={current:void 0},Wa=pa({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!$a.current){const t=new Na({});t.mount(window),t.setOptions({layoutScroll:!0}),$a.current=t}return $a.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),za="[data-layout],[data-layout-id]",Ka=new WeakMap;let Ga;function Ya(t){const e=[];return t instanceof HTMLElement&&t.matches(za)&&e.push(t),t.querySelectorAll(za).forEach(t=>{t instanceof HTMLElement&&e.push(t)}),e}function Xa(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 qa(t,e){let n=Ka.get(t);if(n)n.setOptions(Xa(t,e));else{let i=No.get(t);i||(i=new or({props:{},presenceContext:null,visualState:{latestValues:{},renderState:{transform:{},transformOrigin:{},style:{},vars:{}}}},{allowProjection:!0}),bs(t,i)),t.style.transform&&!ss(i.latestValues)&&(t.style.transform=""),n=new Wa(i.latestValues,function(t){let e=t.parentElement;for(;e;){const t=Ka.get(e);if(t&&t.instance)return t;e=e.parentElement}}(t)),i.projection=n,n.setOptions({...Xa(t,e),visualElement:i}),n.mount(t),Ka.set(t,n)}return n.isPresent=!0,n.options.onExitComplete&&n.setOptions({onExitComplete:void 0}),n}function Ha(t,e){e.setOptions({onExitComplete:void 0});e.getStack()&&!e.isLead()||e.currentAnimation?.stop(),e.unmount(),Ka.delete(t)}function _a(){const t=Ga;Ga=void 0,function(){if(n.isProcessing)return;const t=o.now();n.delta=e.clamp(0,1e3/60,t-n.timestamp),n.timestamp=t,n.isProcessing=!0,ct.update.process(n),ct.preRender.process(n),ct.render.process(n),n.isProcessing=!1}();const i=new Map;for(const e of t)for(const t of e.collectTargets()){const n=i.get(t);n?n.push(e):i.set(t,[e])}const s=new Map;for(const t of(r=i.keys(),[...r].sort((t,e)=>t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1))){const e=i.get(t),n=qa(t,e[e.length-1].transitionFor(t));for(const i of e)i.adopt(t,n);s.set(t,n)}var r;s.forEach(t=>{t.isLayoutDirty=!1,t.willUpdate()});const a=[];for(const e of t){const t=e.runUpdate();t&&a.push(t)}const l=()=>{const e=new Set;for(const n of t)n.reconcileAdditions(e);for(const n of t)n.reconcileRemovals(e);let n;s.forEach(t=>n||(n=t.root));for(const e of t)n||(n=e.getRoot());n?.didUpdate(),As.render(()=>{for(const e of t)e.finalize()})};a.length?Promise.all(a).then(l):l()}class Za{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}),Ga||(Ga=[],queueMicrotask(_a)),Ga.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 Ya(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 Ya(this.scope)){if(this.tracked.has(e))continue;const n=qa(e,this.transitionFor(e));this.adopt(e,n),n.options.layoutId&&t.add(n.options.layoutId)}}reconcileRemovals(t){this.tracked.forEach((e,n)=>{if(n.isConnected)return;const i=this.restorePoints.get(n);this.restorePoints.delete(n);const{layoutId:s}=e.options,o=e.getStack(),r=o&&o.members.some(t=>t!==e&&t.instance?.isConnected);if(s&&e.isLead()&&r&&!t.has(s)&&i&&i.parent.isConnected){if(i.parent.insertBefore(n,i.next&&i.next.parentNode===i.parent?i.next:null),e.isPresent=!1,e.setOptions({onExitComplete:()=>{n.remove(),Ha(n,e)}}),e.relegate())return;n.remove()}Ha(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 Pn([...t]))}}function Ja(t,e,n){if("function"==typeof t)return{scope:document,updateDom:t,defaultOptions:e};return{scope:t instanceof Document?t:Di(t)[0]??document,updateDom:e,defaultOptions:n}}const Qa=at,tl=ot.reduce((t,e)=>(t[e]=t=>lt(t),t),{});t.AsyncMotionValueAnimation=Vn,t.DOMKeyframesResolver=Ti,t.DOMVisualElement=tr,t.DocumentProjectionNode=Na,t.Feature=class{constructor(t){this.isMounted=!1,this.node=t}update(){}},t.FlatTree=ea,t.GroupAnimation=Pn,t.GroupAnimationWithThen=class extends Pn{then(t,e){return this.finished.finally(t).then(()=>{})}},t.HTMLProjectionNode=Wa,t.HTMLVisualElement=or,t.JSAnimation=te,t.KeyframeResolver=Ue,t.LayoutAnimationBuilder=Za,t.MotionValue=Rn,t.MotionValueState=Ri,t.NativeAnimation=tn,t.NativeAnimationExtended=on,t.NativeAnimationWrapper=En,t.NodeStack=sa,t.ObjectVisualElement=class extends Qo{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.SVGVisualElement=class extends tr{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Io}getBaseTargetFromProps(t,e){return Pe.has(e)?super.getBaseTargetFromProps(t,e)??we(e):t[e]}getDefaultValue(t){return Pe.has(t)?this.latestValues[t]??we(t):void 0}readValueFromInstance(t,e){if(Pe.has(e)){const t=ue(e);return t&&t.default||0}if(Gi.includes(e)){const n=getComputedStyle(t)[e];if("string"==typeof n&&n)return n.trim()}return e=rr.has(e)?e:ri(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return cr(t,e,n)}build(t,e,n){Yi(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){lr(t,e,0,i)}mount(t){this.isSVGTag=ar(t.tagName),super.mount(t)}},t.ViewTransitionBuilder=jo,t.VisualElement=Qo,t.acceleratedValues=ln,t.addAttrValue=Xi,t.addDomEvent=Qr,t.addEffect=function(t){e.invariant("function"==typeof t.test&&"function"==typeof t.read,"Effects passed to animate.addEffect() need test() and read().","effect-missing-test"),Vi(t),Ai.unshift(t)},t.addSVGValue=Hi,t.addScaleCorrector=function(t){for(const e in t)nr[e]=t[e],l(e)&&(nr[e].isCSSVariable=!0)},t.addStyleValue=Oi,t.addValueToWillChange=oi,t.alpha=m,t.analyseComplexValue=I,t.animateEffectSubject=Mi,t.animateElement=function(t,e,n,i){if(i)return Pi(t=>i.getValue(t,null),e,n,i);const s=Ts(t);return Mi(s,t,e,n,new ws(s,t))},t.animateLayout=function(t,e,n){const{scope:i,updateDom:s,defaultOptions:o}=Ja(t,e,n);return new Za(i,s,o)},t.animateMotionValue=Wn,t.animateSingleValue=Jr,t.animateTarget=di,t.animateValue=function(t){return new te(t)},t.animateValues=Pi,t.animateVariant=pi,t.animateView=function(t,e={}){return new jo(t,e)},t.animateVisualElement=mi,t.animationMapKey=(t,e="")=>`${t}:${e}`,t.applyAxisDelta=cs,t.applyBoxDelta=us,t.applyGeneratorOptions=Qe,t.applyPointDelta=ls,t.applyPxDefaults=function(t,e){for(let n=0;n<t.length;n++)"number"==typeof t[n]&&bi.has(e)&&(t[n]=t[n]+"px")},t.applyTreeDeltas=ps,t.arc=function(t={}){const n=function({strength:t=.5,peak:n=.5,direction:i,rotate:s=!1}={}){const o=!0===s?1:"number"==typeof s?s:0;let r;return(s,a)=>{const l=a.x-s.x,c=a.y-s.y;let u;u="cw"===i?-t:"ccw"===i?t:(Math.abs(l)>=Math.abs(c)?l:c)<0?-t:t;let h=Gn(s.x,s.y,a.x,a.y,u,n);if(void 0===i){const t=Math.abs(l)<Math.abs(c),e=s.x+l*n,i=s.y+c*n,o=t?Math.sign(h.x-e):Math.sign(h.y-i);void 0!==r&&0!==o&&o!==r?(u=-u,h=Gn(s.x,s.y,a.x,a.y,u,n)):0!==o&&(r=o)}const d=o?Kn(0,s.x,h.x,a.x,s.y,h.y,a.y):0,p=o?Kn(1,s.x,h.x,a.x,s.y,h.y,a.y):0,m=o?e.wrap(-180,180,p-d):0;return t=>{const n={x:zn(t,s.x,h.x,a.x),y:zn(t,s.y,h.y,a.y)};if(o){const i=Kn(t,s.x,h.x,a.x,s.y,h.y,a.y),r=d+m*t;n.rotate=e.wrap(-180,180,i-r)*o}return n}}}(t),i={interpolateProjection(t){const e=t.x.translate,i=t.y.translate;if(!(Math.sqrt(e*e+i*i)<20))return n({x:e,y:i},{x:0,y:0})},animateVisualElement(t,e,i,s,o){if(!("x"in e)&&!("y"in e))return;const r=t.getValue("x",t.latestValues.x??0),a=t.getValue("y",t.latestValues.y??0),l=e.x,c=e.y,u=(Array.isArray(l)&&null!=l[0]?l[0]:r?.get())??0,h=(Array.isArray(c)&&null!=c[0]?c[0]:a?.get())??0,d=Array.isArray(l)?l[l.length-1]:l??u,p=Array.isArray(c)?c[c.length-1]:c??h,m=n({x:u,y:h},{x:d,y:p}),f=void 0!==m(0).rotate?t.getValue("pathRotation",0):void 0,y={delay:s,...Ln(i||{},"x")};delete y.path;const g=Bn(0);g.start(Wn("",g,[0,1e3],{...y,isSync:!0,velocity:0,onUpdate:t=>{const e=m(t/1e3);r?.set(e.x),a?.set(e.y),f&&void 0!==e.rotate&&f.set(e.rotate)},onComplete:()=>{r?.set(d),a?.set(p),f?.set(0)},onStop:()=>f?.set(0),onCancel:()=>f?.set(0)})),g.animation&&o.push(g.animation),delete e.x,delete e.y}};return i},t.aspectRatio=Ir,t.attachFollow=ro,t.attachSpring=lo,t.attrEffect=qi,t.axisDeltaEquals=Nr,t.axisEquals=jr,t.axisEqualsRounded=Fr,t.boxEquals=Lr,t.boxEqualsRounded=Or,t.buildHTMLStyles=$i,t.buildProjectionTransform=Kr,t.buildSVGAttrs=Yi,t.buildSVGPath=Ki,t.buildTransform=yn,t.calcAxisDelta=Tr,t.calcBoxDelta=wr,t.calcChildStagger=Dn,t.calcGeneratorDuration=pt,t.calcLength=vr,t.calcRelativeAxis=br,t.calcRelativeAxisPosition=Ar,t.calcRelativeBox=Sr,t.calcRelativePosition=Vr,t.camelCaseAttributes=rr,t.camelToDash=ri,t.cancelFrame=lt,t.cancelMicrotask=Vs,t.cancelSync=tl,t.checkVariantsDidChange=dr,t.cleanDirtyNodes=ga,t.collectMotionValues=Cn,t.color=C,t.compareByDepth=ta,t.complex=$,t.containsCSSVariable=d,t.convertBoundingBoxToBox=ts,t.convertBoxToBoundingBox=function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}},t.convertOffsetToTimes=Ut,t.copyAxisDeltaInto=gr,t.copyAxisInto=fr,t.copyBoxInto=yr,t.correctBorderRadius=Wr,t.correctBoxShadow=zr,t.createAnimationState=function(t){let e=e=>Promise.all(e.map(({animation:e,options:n})=>mi(t,e,n))),n=pr(),i=!0,s=!1;function o(o){const{props:r,parent:a,manuallyAnimateOnMount:l}=t,c=i||s,u=[],h=new Set;let d={},p=1/0,m=t;do{m=!1!==m.props.inherit&&m.parent}while(m&&!m.isControllingVariants);if(hr.forEach((e,i)=>{const s=n[e],f=r[e],y=m&&m.props[e],g=void 0!==f?f:$o(y)||!1===y?y:void 0,v=$o(g),x=e===o?s.isActive:null;!1===x&&(p=i);const T=v&&void 0===f&&!(c&&l);if(s.protectedKeys={...d},!s.isActive&&null===x||!g&&!s.prevProp||Uo(g)||"boolean"==typeof g)return;if("exit"===e&&s.isActive&&!0!==x)return void(d={...d,...s.prevResolvedValues});const w=dr(s.prevProp,g);let b=w||v&&(x&&!T||i>p),S=!1;const A=Array.isArray(g)?g:[g];let V={};if(!1!==x)for(const n of A){const{transition:i,transitionEnd:s,...o}=_n(t,n,Zn(t,e))||{};V={...V,...o,...s}}const{prevResolvedValues:P}=s;for(const e in{...P,...V}){if(e in d)continue;const n=V[e],i=P[e],o=Array.isArray(n)&&Array.isArray(i)?!ur(n,i)||w:n!==i;if(o&&null==n)h.add(e);else if(o||void 0!==n&&h.has(e)){b=!0,h.delete(e)&&(S=!0),s.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)}else s.protectedKeys[e]=!0}if(s.prevProp=g,s.prevResolvedValues=V,s.isActive&&(d={...d,...V}),b&&(!T||!w||S))for(const n of A){const i={type:e};if("string"==typeof n&&c&&l&&a?.enteringChildren){const e=_n(a,n)?.transition?.delayChildren;i.delay=Dn(a.enteringChildren,t,e)}u.push({animation:n,options:i})}}),h.size){const{initial:e}=r,n={},i="boolean"!=typeof e&&_n(t,Array.isArray(e)?e[0]:e,t.presenceContext?.custom);i&&i.transition&&(n.transition=i.transition),h.forEach(s=>{const o=t.getValue(s);o&&(o.liveStyle=!0);const a=i&&!Array.isArray(e)?i[s]:void 0,l=t.getBaseTargetFromProps(r,s);n[s]=(void 0!==a?a:void 0===l||ii(l)?void 0===t.initialValues[s]?t.baseTarget[s]:void 0:l)??null}),u.push({animation:n})}const f=c&&t.blockInitialAnimation||i&&!l&&(!1===r.initial||r.initial===r.animate);return i=s=!1,!f&&u.length?e(u):Promise.resolve()}return{animateChanges:o,setActive:function(e,i){if(n[e].isActive===i)return Promise.resolve();t.variantChildren?.forEach(t=>t.animationState?.setActive(e,i)),n[e].isActive=i;const s=o(e);for(const t in n)n[t].protectedKeys={};return s},setAnimateFunction:n=>{e=n(t)},getState:()=>n,reset:()=>{n=pr(),s=!0}}},t.createAxis=Oo,t.createAxisDelta=Lo,t.createBox=Io,t.createDelta=Fo,t.createEffect=Bi,t.createGeneratorEasing=mt,t.createProjectionNode=pa,t.createRenderBatcher=rt,t.cubicBezierAsString=qe,t.defaultEasing=$t,t.defaultOffset=Nt,t.defaultTransformValue=we,t.defaultValueTypes=ce,t.degrees=A,t.delay=na,t.delayInSeconds=function(t,n){return na(t,e.secondsToMilliseconds(n))},t.dimensionValueTypes=yi,t.eachAxis=Ur,t.fillOffset=It,t.fillWildcards=pe,t.findDimensionValueType=gi,t.findEffect=function(t){return Ai.find(e=>e.test(t))},t.findValueType=t=>co.find(fi(t)),t.flushKeyframeResolvers=Ne,t.followValue=function(t,e){const n=Bn(ii(t)?t.get():t);return ro(n,t,e),n},t.frame=at,t.frameData=n,t.frameSteps=ct,t.generateLinearEasing=ht,t.getAnimatableNone=de,t.getAnimationMap=function(t){let e=kn.get(t);return e||(e=new Map,kn.set(t,e)),e},t.getComputedStyle=function(t,e){const n=window.getComputedStyle(t);return $e(e)?n.getPropertyValue(e):n[e]},t.getDefaultTransition=Nn,t.getDefaultValueType=ue,t.getFeatureDefinitions=function(){return Jo},t.getFinalKeyframe=Gt,t.getMixer=Q,t.getOptimisedAppearId=ci,t.getOriginIndex=Js,t.getValueAsType=pn,t.getValueTransition=Ln,t.getVariableValue=qn,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<mr;t++){const i=zo[t],s=e.props[i];($o(s)||!1===s)&&(n[i]=s)}return n},t.getViewAnimationLayerInfo=bo,t.getViewAnimations=So,t.globalProjectionState=ra,t.handOffElementState=bs,t.has2DTranslate=os,t.hasComplexValues=O,t.hasReducedMotionListener=qo,t.hasScale=is,t.hasTransform=ss,t.hex=b,t.hover=function(t,e,n={}){const[i,s,o]=Es(t,n);return i.forEach(t=>{let n,i=!1,o=!1;const r=e=>{n&&(n(e),n=void 0),t.removeEventListener("pointerleave",l)},a=t=>{i=!1,window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a),o&&(o=!1,r(t))},l=t=>{"touch"!==t.pointerType&&(i?o=!0:r(t))};t.addEventListener("pointerenter",i=>{if("touch"===i.pointerType||Ms())return;o=!1;const r=e(t,i);"function"==typeof r&&(n=r,t.addEventListener("pointerleave",l,s))},s),t.addEventListener("pointerdown",()=>{i=!0,window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",a,s)},s)}),o},t.hsla=D,t.hslaToRgba=z,t.inertia=Ft,t.initPrefersReducedMotion=_o,t.interpolate=Ot,t.invisibleValues=_,t.isAnimationControls=Uo,t.isCSSVariableName=l,t.isCSSVariableToken=u,t.isControllingVariants=Ko,t.isDeltaZero=Br,t.isDragActive=Ms,t.isDragging=Ps,t.isElementKeyboardAccessible=Rs,t.isElementTextInput=function(t){return Bs.has(t.tagName)||!0===t.isContentEditable},t.isForcedMotionValue=ir,t.isGenerator=Je,t.isHTMLElement=Ei,t.isKeyframesTarget=Qn,t.isMotionValue=ii,t.isNear=xr,t.isNodeOrChild=ks,t.isPrimaryPointer=Ds,t.isSVGElement=ki,t.isSVGSVGElement=Zs,t.isSVGTag=ar,t.isTransitionDefined=$n,t.isVariantLabel=$o,t.isVariantNode=Go,t.isWaapiSupportedEasing=function t(n){return Boolean("function"==typeof n&&Xe()||!n||"string"==typeof n&&(n in He||Xe())||e.isBezierDefinition(n)||Array.isArray(n)&&n.every(t))},t.isWillChangeMotionValue=si,t.keyframes=Wt,t.makeAnimationInstant=an,t.mapEasingToNativeEasing=_e,t.mapValue=function(t,e,n,i){const s=Qs(e,n,i);return ao(()=>s(t.get()))},t.maxGeneratorDuration=dt,t.measurePageBox=function(t,e,n){const i=vs(t,n),{scroll:s}=e;return s&&(ms(i.x,s.offset.x),ms(i.y,s.offset.y)),i},t.measureViewportBox=vs,t.microtask=As,t.mix=st,t.mixArray=tt,t.mixColor=H,t.mixComplex=nt,t.mixImmediate=K,t.mixLinearColor=Y,t.mixNumber=G,t.mixObject=et,t.mixValues=Xr,t.mixVisibility=Z,t.motionValue=Bn,t.nodeGroup=function(){const t=new Set,e=new WeakMap,n=()=>t.forEach(Ua);return{add:i=>{t.add(i),e.set(i,i.addEventListener("willUpdate",n))},remove:i=>{t.delete(i);const s=e.get(i);s&&(s(),e.delete(i)),n()},dirty:n}},t.number=p,t.numberValueTypes=le,t.optimizedAppearDataAttribute=li,t.optimizedAppearDataId=ai,t.originProps=Li,t.parseAnimateLayoutArgs=Ja,t.parseCSSVariable=Xn,t.parseValueFromTransform=be,t.percent=V,t.pixelsToPercent=$r,t.positionalKeys=Jn,t.prefersReducedMotion=Xo,t.press=function(t,e,n={}){const[i,s,o]=Es(t,n),r=t=>{const i=t.currentTarget;if(!Os(t))return;if(Is.has(t))return;js.add(i),n.stopPropagation&&Is.add(t);const o=e(i,t),r={...s,capture:!0},a=(t,e)=>{window.removeEventListener("pointerup",l,r),window.removeEventListener("pointercancel",c,r),js.has(i)&&js.delete(i),Os(t)&&"function"==typeof o&&o(t,{success:e})},l=t=>{a(t,i===window||i===document||n.useGlobalTarget||ks(i,t.target))},c=t=>{a(t,!1)};window.addEventListener("pointerup",l,r),window.addEventListener("pointercancel",c,r)};return i.forEach(t=>{(n.useGlobalTarget?window:t).addEventListener("pointerdown",r,s),Ei(t)&&(t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const i=Ls(()=>{if(js.has(n))return;Fs(n,"down");const t=Ls(()=>{Fs(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>Fs(n,"cancel"),e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)})(t,s)),Rs(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),o},t.progressPercentage=k,t.propEffect=Ss,t.propagateDirtyNodes=ya,t.px=P,t.readSVGValue=_i,t.readStyleValue=Ii,t.readTransformValue=Se,t.recordStats=function(){if(_s.value)throw _s.value=null,_s.addProjectionMetrics=null,new Error("Stats are already being measured");const t=_s;t.value={layoutProjection:{nodes:[],calculatedTargetDeltas:[],calculatedProjections:[]}},t.addProjectionMetrics=e=>{const{layoutProjection:n}=t.value;n.nodes.push(e.nodes),n.calculatedTargetDeltas.push(e.calculatedTargetDeltas),n.calculatedProjections.push(e.calculatedProjections)}},t.removeAxisDelta=Mr,t.removeAxisTransforms=Er,t.removeBoxTransforms=Cr,t.removeEffect=Vi,t.removePointDelta=Pr,t.renderHTML=er,t.renderSVG=lr,t.resize=function(t,e){return"function"==typeof t?Hs(t):Ys(t,e)},t.resolveElements=Di,t.resolveMotionValue=ia,t.resolveTransition=jn,t.resolveVariant=_n,t.resolveVariantFromProps=Hn,t.rgbUnit=T,t.rgba=w,t.rootProjectionNode=$a,t.round=Qt,t.sampleDelta=sn,t.scale=f,t.scaleCorrectors=nr,t.scalePoint=as,t.scrapeHTMLMotionValuesFromProps=sr,t.scrapeSVGMotionValuesFromProps=cr,t.setDragLock=function(t){return"x"===t||"y"===t?Ps[t]?null:(Ps[t]=!0,()=>{Ps[t]=!1}):Ps.x||Ps.y?null:(Ps.x=Ps.y=!0,()=>{Ps.x=Ps.y=!1})},t.setFeatureDefinitions=function(t){Jo=t},t.setStyle=We,t.setTarget=ni,t.spring=Lt,t.springValue=function(t,e){const n=Bn(ii(t)?t.get():t);return lo(n,t,e),n},t.stagger=function(t=.1,{startDelay:n=0,from:i=0,ease:s}={}){return(o,r)=>{const a="number"==typeof i?i:Js(i,r),l=Math.abs(a-o);let c=t*l;if(s){const n=r*t;c=e.easingDefinitionToFunction(s)(c/n)*n}return n+c}},t.startWaapiAnimation=Ze,t.statsBuffer=_s,t.styleEffect=Ui,t.styleSubjectEffect=Ni,t.supportedWaapiEasing=He,t.supportsBrowserAnimation=dn,t.supportsFlags=ze,t.supportsLinearEasing=Xe,t.supportsPartialKeyframes=Si,t.supportsScrollTimeline=Ge,t.supportsViewTimeline=Ye,t.supportsWaapi=hn,t.svgEffect=Ji,t.svgSubjectEffect=Zi,t.sync=Qa,t.testValueType=fi,t.time=o,t.transform=Qs,t.transformAxis=fs,t.transformBox=gs,t.transformBoxPoints=es,t.transformPropOrder=Ve,t.transformProps=Pe,t.transformValue=ao,t.transformValueTypes=ae,t.translateAxis=ms,t.updateMotionValuesFromProps=Yo,t.variantPriorityOrder=Wo,t.variantProps=zo,t.vh=M,t.visualElementStore=No,t.vw=E});