llmtap 0.1.7 → 0.1.8

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 (50) hide show
  1. package/dist/dashboard/assets/CommandBar-CBRbPbgc.js +1 -0
  2. package/dist/dashboard/assets/Costs-B-TMvDlI.js +1 -0
  3. package/dist/dashboard/assets/Dashboard-CFNAMjdc.js +1 -0
  4. package/dist/dashboard/assets/DataTable-p1PD-dJj.js +1 -0
  5. package/dist/dashboard/assets/EmptyState-xDl-M9Rz.js +1 -0
  6. package/dist/dashboard/assets/GettingStartedPanel-Cn46fQ1w.js +18 -0
  7. package/dist/dashboard/assets/Models-BpMhGVp5.js +1 -0
  8. package/dist/dashboard/assets/ProviderBadge-Cs31007s.js +1 -0
  9. package/dist/dashboard/assets/Sessions-CiKyTRlP.js +3 -0
  10. package/dist/dashboard/assets/Settings-7wRfCPnB.js +6 -0
  11. package/dist/dashboard/assets/TraceDetail-CKDDbbEV.js +17 -0
  12. package/dist/dashboard/assets/Traces-BYWwPP14.js +1 -0
  13. package/dist/dashboard/assets/{accordion-DZ-R65JQ.js → accordion-CC_sxDZ8.js} +1 -1
  14. package/dist/dashboard/assets/content-DZmxO8bn.js +2 -0
  15. package/dist/dashboard/assets/format-zoXqpaOb.js +1 -0
  16. package/dist/dashboard/assets/icons-BOLUIAKd.js +1 -0
  17. package/dist/dashboard/assets/index-CtlcBMi-.css +1 -0
  18. package/dist/dashboard/assets/index-DG2eF3M2.js +14 -0
  19. package/dist/dashboard/assets/motion-CSeNjKbZ.js +17 -0
  20. package/dist/dashboard/assets/{number-ticker-DAf-8EjI.js → number-ticker-CjofSQ3s.js} +1 -1
  21. package/dist/dashboard/assets/provider-colors-CTiHNYHs.js +1 -0
  22. package/dist/dashboard/assets/select-BJEJvQo4.js +1 -0
  23. package/dist/dashboard/assets/statistics-with-status-grid-tcb9SpIY.js +1 -0
  24. package/dist/dashboard/index.html +4 -4
  25. package/package.json +3 -3
  26. package/dist/dashboard/assets/Costs-a6RxtEyD.js +0 -1
  27. package/dist/dashboard/assets/Dashboard-Dc3SbA3o.js +0 -1
  28. package/dist/dashboard/assets/DataTable-WlvwCpLc.js +0 -1
  29. package/dist/dashboard/assets/GettingStartedPanel-D2-E8-3Q.js +0 -18
  30. package/dist/dashboard/assets/Models-BwTqYNmO.js +0 -1
  31. package/dist/dashboard/assets/Sessions-PuU5TiOR.js +0 -3
  32. package/dist/dashboard/assets/Settings-Dsgny2rQ.js +0 -6
  33. package/dist/dashboard/assets/StatusDot-D69CfzT5.js +0 -1
  34. package/dist/dashboard/assets/TraceDetail-_YLBxcmc.js +0 -17
  35. package/dist/dashboard/assets/Traces-B5znc91x.js +0 -1
  36. package/dist/dashboard/assets/constants-OlSc-7iA.js +0 -1
  37. package/dist/dashboard/assets/content-BRoZVvRJ.js +0 -2
  38. package/dist/dashboard/assets/format-wxLsIVjs.js +0 -1
  39. package/dist/dashboard/assets/icons-mXW2t-HS.js +0 -1
  40. package/dist/dashboard/assets/index-BjX-ME4E.js +0 -14
  41. package/dist/dashboard/assets/index-C98gdeiH.css +0 -1
  42. package/dist/dashboard/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2 +0 -0
  43. package/dist/dashboard/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2 +0 -0
  44. package/dist/dashboard/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
  45. package/dist/dashboard/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
  46. package/dist/dashboard/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2 +0 -0
  47. package/dist/dashboard/assets/motion-DSHPdBNu.js +0 -17
  48. package/dist/dashboard/assets/provider-colors-BhO_XSTV.js +0 -1
  49. package/dist/dashboard/assets/select-DxzgyWz-.js +0 -1
  50. package/dist/dashboard/assets/statistics-with-status-grid-DE7T_RSi.js +0 -1
@@ -1,17 +0,0 @@
1
- import{r as x,j as Y}from"./query-DVWnIZNd.js";const gi=x.createContext({});function Le(t){const e=x.useRef(null);return e.current===null&&(e.current=t()),e.current}const Eh=typeof window<"u",yi=Eh?x.useLayoutEffect:x.useEffect,kn=x.createContext(null);function vi(t,e){t.indexOf(e)===-1&&t.push(e)}function yn(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const Pt=(t,e,n)=>n>e?e:n<t?t:n;let xi=()=>{};const bt={},il=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function ol(t){return typeof t=="object"&&t!==null}const rl=t=>/^0[^.\s]+$/u.test(t);function al(t){let e;return()=>(e===void 0&&(e=t()),e)}const ct=t=>t,Rh=(t,e)=>n=>e(t(n)),ke=(...t)=>t.reduce(Rh),Ae=(t,e,n)=>{const s=e-t;return s===0?1:(n-t)/s};let Ti=class{constructor(){this.subscriptions=[]}add(e){return vi(this.subscriptions,e),()=>yn(this.subscriptions,e)}notify(e,n,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,s);else for(let r=0;r<i;r++){const o=this.subscriptions[r];o&&o(e,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}};const ot=t=>t*1e3,at=t=>t/1e3;function ll(t,e){return e?t*(1e3/e):0}const cl=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Lh=1e-7,kh=12;function Ih(t,e,n,s,i){let r,o,a=0;do o=e+(n-e)/2,r=cl(o,s,i)-t,r>0?n=o:e=o;while(Math.abs(r)>Lh&&++a<kh);return o}function Ie(t,e,n,s){if(t===e&&n===s)return ct;const i=r=>Ih(r,0,1,t,n);return r=>r===0||r===1?r:cl(i(r),e,s)}const ul=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,hl=t=>e=>1-t(1-e),fl=Ie(.33,1.53,.69,.99),wi=hl(fl),dl=ul(wi),pl=t=>(t*=2)<1?.5*wi(t):.5*(2-Math.pow(2,-10*(t-1))),Pi=t=>1-Math.sin(Math.acos(t)),ml=hl(Pi),gl=ul(Pi),Fh=Ie(.42,0,1,1),Bh=Ie(0,0,.58,1),yl=Ie(.42,0,.58,1),Oh=t=>Array.isArray(t)&&typeof t[0]!="number",vl=t=>Array.isArray(t)&&typeof t[0]=="number",jh={linear:ct,easeIn:Fh,easeInOut:yl,easeOut:Bh,circIn:Pi,circInOut:gl,circOut:ml,backIn:wi,backInOut:dl,backOut:fl,anticipate:pl},Nh=t=>typeof t=="string",Po=t=>{if(vl(t)){xi(t.length===4);const[e,n,s,i]=t;return Ie(e,n,s,i)}else if(Nh(t))return jh[t];return t},Ke=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Uh(t,e){let n=new Set,s=new Set,i=!1,r=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function c(l){o.has(l)&&(u.schedule(l),t()),l(a)}const u={schedule:(l,h=!1,f=!1)=>{const p=f&&i?n:s;return h&&o.add(l),p.has(l)||p.add(l),l},cancel:l=>{s.delete(l),o.delete(l)},process:l=>{if(a=l,i){r=!0;return}i=!0,[n,s]=[s,n],n.forEach(c),n.clear(),i=!1,r&&(r=!1,u.process(l))}};return u}const Wh=40;function xl(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,o=Ke.reduce((v,w)=>(v[w]=Uh(r),v),{}),{setup:a,read:c,resolveKeyframes:u,preUpdate:l,update:h,preRender:f,render:d,postRender:p}=o,m=()=>{const v=bt.useManualTiming?i.timestamp:performance.now();n=!1,bt.useManualTiming||(i.delta=s?1e3/60:Math.max(Math.min(v-i.timestamp,Wh),1)),i.timestamp=v,i.isProcessing=!0,a.process(i),c.process(i),u.process(i),l.process(i),h.process(i),f.process(i),d.process(i),p.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(m))},g=()=>{n=!0,s=!0,i.isProcessing||t(m)};return{schedule:Ke.reduce((v,w)=>{const S=o[w];return v[w]=(M,D=!1,b=!1)=>(n||g(),S.schedule(M,D,b)),v},{}),cancel:v=>{for(let w=0;w<Ke.length;w++)o[Ke[w]].cancel(v)},state:i,steps:o}}const{schedule:L,cancel:At,state:q,steps:Gn}=xl(typeof requestAnimationFrame<"u"?requestAnimationFrame:ct,!0);let Qe;function Kh(){Qe=void 0}const tt={now:()=>(Qe===void 0&&tt.set(q.isProcessing||bt.useManualTiming?q.timestamp:performance.now()),Qe),set:t=>{Qe=t,queueMicrotask(Kh)}},Tl=t=>e=>typeof e=="string"&&e.startsWith(t),wl=Tl("--"),Hh=Tl("var(--"),Si=t=>Hh(t)?Gh.test(t.split("/*")[0].trim()):!1,Gh=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function So(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const re={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Ve={...re,transform:t=>Pt(0,1,t)},He={...re,default:1},ge=t=>Math.round(t*1e5)/1e5,bi=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function zh(t){return t==null}const _h=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ai=(t,e)=>n=>!!(typeof n=="string"&&_h.test(n)&&n.startsWith(t)||e&&!zh(n)&&Object.prototype.hasOwnProperty.call(n,e)),Pl=(t,e,n)=>s=>{if(typeof s!="string")return s;const[i,r,o,a]=s.match(bi);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Xh=t=>Pt(0,255,t),zn={...re,transform:t=>Math.round(Xh(t))},Ot={test:Ai("rgb","red"),parse:Pl("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+zn.transform(t)+", "+zn.transform(e)+", "+zn.transform(n)+", "+ge(Ve.transform(s))+")"};function Yh(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const Ss={test:Ai("#"),parse:Yh,transform:Ot.transform},Fe=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Vt=Fe("deg"),Tt=Fe("%"),V=Fe("px"),qh=Fe("vh"),Zh=Fe("vw"),bo={...Tt,parse:t=>Tt.parse(t)/100,transform:t=>Tt.transform(t*100)},Xt={test:Ai("hsl","hue"),parse:Pl("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+Tt.transform(ge(e))+", "+Tt.transform(ge(n))+", "+ge(Ve.transform(s))+")"},W={test:t=>Ot.test(t)||Ss.test(t)||Xt.test(t),parse:t=>Ot.test(t)?Ot.parse(t):Xt.test(t)?Xt.parse(t):Ss.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Ot.transform(t):Xt.transform(t),getAnimatableNone:t=>{const e=W.parse(t);return e.alpha=0,W.transform(e)}},Jh=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Qh(t){return isNaN(t)&&typeof t=="string"&&(t.match(bi)?.length||0)+(t.match(Jh)?.length||0)>0}const Sl="number",bl="color",tf="var",ef="var(",Ao="${}",nf=/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 se(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const a=e.replace(nf,c=>(W.test(c)?(s.color.push(r),i.push(bl),n.push(W.parse(c))):c.startsWith(ef)?(s.var.push(r),i.push(tf),n.push(c)):(s.number.push(r),i.push(Sl),n.push(parseFloat(c))),++r,Ao)).split(Ao);return{values:n,split:a,indexes:s,types:i}}function sf(t){return se(t).values}function Al({split:t,types:e}){const n=t.length;return s=>{let i="";for(let r=0;r<n;r++)if(i+=t[r],s[r]!==void 0){const o=e[r];o===Sl?i+=ge(s[r]):o===bl?i+=W.transform(s[r]):i+=s[r]}return i}}function of(t){return Al(se(t))}const rf=t=>typeof t=="number"?0:W.test(t)?W.getAnimatableNone(t):t,af=(t,e)=>typeof t=="number"?e?.trim().endsWith("/")?t:0:rf(t);function lf(t){const e=se(t);return Al(e)(e.values.map((s,i)=>af(s,e.split[i])))}const mt={test:Qh,parse:sf,createTransformer:of,getAnimatableNone:lf};function _n(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function cf({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,e/=100,n/=100;let i=0,r=0,o=0;if(!e)i=r=o=n;else{const a=n<.5?n*(1+e):n+e-n*e,c=2*n-a;i=_n(c,a,t+1/3),r=_n(c,a,t),o=_n(c,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(r*255),blue:Math.round(o*255),alpha:s}}function vn(t,e){return n=>n>0?e:t}const B=(t,e,n)=>t+(e-t)*n,Xn=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},uf=[Ss,Ot,Xt],hf=t=>uf.find(e=>e.test(t));function Vo(t){const e=hf(t);if(!e)return!1;let n=e.parse(t);return e===Xt&&(n=cf(n)),n}const Co=(t,e)=>{const n=Vo(t),s=Vo(e);if(!n||!s)return vn(t,e);const i={...n};return r=>(i.red=Xn(n.red,s.red,r),i.green=Xn(n.green,s.green,r),i.blue=Xn(n.blue,s.blue,r),i.alpha=B(n.alpha,s.alpha,r),Ot.transform(i))},bs=new Set(["none","hidden"]);function ff(t,e){return bs.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function df(t,e){return n=>B(t,e,n)}function Vi(t){return typeof t=="number"?df:typeof t=="string"?Si(t)?vn:W.test(t)?Co:gf:Array.isArray(t)?Vl:typeof t=="object"?W.test(t)?Co:pf:vn}function Vl(t,e){const n=[...t],s=n.length,i=t.map((r,o)=>Vi(r)(r,e[o]));return r=>{for(let o=0;o<s;o++)n[o]=i[o](r);return n}}function pf(t,e){const n={...t,...e},s={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(s[i]=Vi(t[i])(t[i],e[i]));return i=>{for(const r in s)n[r]=s[r](i);return n}}function mf(t,e){const n=[],s={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const r=e.types[i],o=t.indexes[r][s[r]],a=t.values[o]??0;n[i]=a,s[r]++}return n}const gf=(t,e)=>{const n=mt.createTransformer(e),s=se(t),i=se(e);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?bs.has(t)&&!i.values.length||bs.has(e)&&!s.values.length?ff(t,e):ke(Vl(mf(s,i),i.values),n):vn(t,e)};function Cl(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?B(t,e,n):Vi(t)(t,e)}const yf=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>L.update(e,n),stop:()=>At(e),now:()=>q.isProcessing?q.timestamp:tt.now()}},$l=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let r=0;r<i;r++)s+=Math.round(t(r/(i-1))*1e4)/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},xn=2e4;function Ci(t){let e=0;const n=50;let s=t.next(e);for(;!s.done&&e<xn;)e+=n,s=t.next(e);return e>=xn?1/0:e}function vf(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(Ci(s),xn);return{type:"keyframes",ease:r=>s.next(i*r).value/e,duration:at(i)}}const O={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function As(t,e){return t*Math.sqrt(1-e*e)}const xf=12;function Tf(t,e,n){let s=n;for(let i=1;i<xf;i++)s=s-t(s)/e(s);return s}const Yn=.001;function wf({duration:t=O.duration,bounce:e=O.bounce,velocity:n=O.velocity,mass:s=O.mass}){let i,r,o=1-e;o=Pt(O.minDamping,O.maxDamping,o),t=Pt(O.minDuration,O.maxDuration,at(t)),o<1?(i=u=>{const l=u*o,h=l*t,f=l-n,d=As(u,o),p=Math.exp(-h);return Yn-f/d*p},r=u=>{const h=u*o*t,f=h*n+n,d=Math.pow(o,2)*Math.pow(u,2)*t,p=Math.exp(-h),m=As(Math.pow(u,2),o);return(-i(u)+Yn>0?-1:1)*((f-d)*p)/m}):(i=u=>{const l=Math.exp(-u*t),h=(u-n)*t+1;return-Yn+l*h},r=u=>{const l=Math.exp(-u*t),h=(n-u)*(t*t);return l*h});const a=5/t,c=Tf(i,r,a);if(t=ot(t),isNaN(c))return{stiffness:O.stiffness,damping:O.damping,duration:t};{const u=Math.pow(c,2)*s;return{stiffness:u,damping:o*2*Math.sqrt(s*u),duration:t}}}const Pf=["duration","bounce"],Sf=["stiffness","damping","mass"];function $o(t,e){return e.some(n=>t[n]!==void 0)}function bf(t){let e={velocity:O.velocity,stiffness:O.stiffness,damping:O.damping,mass:O.mass,isResolvedFromDuration:!1,...t};if(!$o(t,Sf)&&$o(t,Pf))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,r=2*Pt(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:O.mass,stiffness:i,damping:r}}else{const n=wf({...t,velocity:0});e={...e,...n,mass:O.mass},e.isResolvedFromDuration=!0}return e}function Tn(t=O.visualDuration,e=O.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const r=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:c,damping:u,mass:l,duration:h,velocity:f,isResolvedFromDuration:d}=bf({...n,velocity:-at(n.velocity||0)}),p=f||0,m=u/(2*Math.sqrt(c*l)),g=o-r,y=at(Math.sqrt(c/l)),T=Math.abs(g)<5;s||(s=T?O.restSpeed.granular:O.restSpeed.default),i||(i=T?O.restDelta.granular:O.restDelta.default);let v,w,S,M,D,b;if(m<1)S=As(y,m),M=(p+m*y*g)/S,v=P=>{const $=Math.exp(-m*y*P);return o-$*(M*Math.sin(S*P)+g*Math.cos(S*P))},D=m*y*M+g*S,b=m*y*g-M*S,w=P=>Math.exp(-m*y*P)*(D*Math.sin(S*P)+b*Math.cos(S*P));else if(m===1){v=$=>o-Math.exp(-y*$)*(g+(p+y*g)*$);const P=p+y*g;w=$=>Math.exp(-y*$)*(y*P*$-p)}else{const P=y*Math.sqrt(m*m-1);v=N=>{const G=Math.exp(-m*y*N),U=Math.min(P*N,300);return o-G*((p+m*y*g)*Math.sinh(U)+P*g*Math.cosh(U))/P};const $=(p+m*y*g)/P,E=m*y*$-g*P,H=m*y*g-$*P;w=N=>{const G=Math.exp(-m*y*N),U=Math.min(P*N,300);return G*(E*Math.sinh(U)+H*Math.cosh(U))}}const A={calculatedDuration:d&&h||null,velocity:P=>ot(w(P)),next:P=>{if(!d&&m<1){const E=Math.exp(-m*y*P),H=Math.sin(S*P),N=Math.cos(S*P),G=o-E*(M*H+g*N),U=ot(E*(D*H+b*N));return a.done=Math.abs(U)<=s&&Math.abs(o-G)<=i,a.value=a.done?o:G,a}const $=v(P);if(d)a.done=P>=h;else{const E=ot(w(P));a.done=Math.abs(E)<=s&&Math.abs(o-$)<=i}return a.value=a.done?o:$,a},toString:()=>{const P=Math.min(Ci(A),xn),$=$l(E=>A.next(P*E).value,P,30);return P+"ms "+$},toTransition:()=>{}};return A}Tn.applyToOptions=t=>{const e=vf(t,100,Tn);return t.ease=e.ease,t.duration=ot(e.duration),t.type="keyframes",t};const Af=5;function Ml(t,e,n){const s=Math.max(e-Af,0);return ll(n-t(s),e-s)}function Vs({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:c,restDelta:u=.5,restSpeed:l}){const h=t[0],f={done:!1,value:h},d=b=>a!==void 0&&b<a||c!==void 0&&b>c,p=b=>a===void 0?c:c===void 0||Math.abs(a-b)<Math.abs(c-b)?a:c;let m=n*e;const g=h+m,y=o===void 0?g:o(g);y!==g&&(m=y-h);const T=b=>-m*Math.exp(-b/s),v=b=>y+T(b),w=b=>{const A=T(b),P=v(b);f.done=Math.abs(A)<=u,f.value=f.done?y:P};let S,M;const D=b=>{d(f.value)&&(S=b,M=Tn({keyframes:[f.value,p(f.value)],velocity:Ml(v,b,f.value),damping:i,stiffness:r,restDelta:u,restSpeed:l}))};return D(0),{calculatedDuration:null,next:b=>{let A=!1;return!M&&S===void 0&&(A=!0,w(b),D(b)),S!==void 0&&b>=S?M.next(b-S):(!A&&w(b),f)}}}function Vf(t,e,n){const s=[],i=n||bt.mix||Cl,r=t.length-1;for(let o=0;o<r;o++){let a=i(t[o],t[o+1]);if(e){const c=Array.isArray(e)?e[o]||ct:e;a=ke(c,a)}s.push(a)}return s}function Dl(t,e,{clamp:n=!0,ease:s,mixer:i}={}){const r=t.length;if(xi(r===e.length),r===1)return()=>e[0];if(r===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[r-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=Vf(e,s,i),c=a.length,u=l=>{if(o&&l<t[0])return e[0];let h=0;if(c>1)for(;h<t.length-2&&!(l<t[h+1]);h++);const f=Ae(t[h],t[h+1],l);return a[h](f)};return n?l=>u(Pt(t[0],t[r-1],l)):u}function Cf(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=Ae(0,e,s);t.push(B(n,1,i))}}function $f(t){const e=[0];return Cf(e,t.length-1),e}function Mf(t,e){return t.map(n=>n*e)}function Df(t,e){return t.map(()=>e||yl).splice(0,t.length-1)}function ye({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=Oh(s)?s.map(Po):Po(s),r={done:!1,value:e[0]},o=Mf(n&&n.length===e.length?n:$f(e),t),a=Dl(o,e,{ease:Array.isArray(i)?i:Df(e,i)});return{calculatedDuration:t,next:c=>(r.value=a(c),r.done=c>=t,r)}}const Ef=t=>t!==null;function $i(t,{repeat:e,repeatType:n="loop"},s,i=1){const r=t.filter(Ef),a=i<0||e&&n!=="loop"&&e%2===1?0:r.length-1;return!a||s===void 0?r[a]:s}const Rf={decay:Vs,inertia:Vs,tween:ye,keyframes:ye,spring:Tn};function El(t){typeof t.type=="string"&&(t.type=Rf[t.type])}let Mi=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}};const Lf=t=>t/100;let In=class extends Mi{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==tt.now()&&this.tick(tt.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;El(e);const{type:n=ye,repeat:s=0,repeatDelay:i=0,repeatType:r,velocity:o=0}=e;let{keyframes:a}=e;const c=n||ye;c!==ye&&typeof a[0]!="number"&&(this.mixKeyframes=ke(Lf,Cl(a[0],a[1])),a=[0,100]);const u=c({...e,keyframes:a});r==="mirror"&&(this.mirroredGenerator=c({...e,keyframes:[...a].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=Ci(u));const{calculatedDuration:l}=u;this.calculatedDuration=l,this.resolvedDuration=l+i,this.totalDuration=this.resolvedDuration*(s+1)-i,this.generator=u}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:s,totalDuration:i,mixKeyframes:r,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:c}=this;if(this.startTime===null)return s.next(0);const{delay:u=0,keyframes:l,repeat:h,repeatType:f,repeatDelay:d,type:p,onUpdate:m,finalKeyframe:g}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-i/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const y=this.currentTime-u*(this.playbackSpeed>=0?1:-1),T=this.playbackSpeed>=0?y<0:y>i;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let v=this.currentTime,w=s;if(h){const b=Math.min(this.currentTime,i)/a;let A=Math.floor(b),P=b%1;!P&&b>=1&&(P=1),P===1&&A--,A=Math.min(A,h+1),A%2&&(f==="reverse"?(P=1-P,d&&(P-=d/a)):f==="mirror"&&(w=o)),v=Pt(0,1,P)*a}const S=T?{done:!1,value:l[0]}:w.next(v);r&&!T&&(S.value=r(S.value));let{done:M}=S;!T&&c!==null&&(M=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const D=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&M);return D&&p!==Vs&&(S.value=$i(l,this.options,g,this.speed)),m&&m(S.value),D&&this.finish(),S}then(e,n){return this.finished.then(e,n)}get duration(){return at(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+at(e)}get time(){return at(this.currentTime)}set time(e){e=ot(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);const n=this.generator.next(e).value;return Ml(s=>this.generator.next(s).value,e,n)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;n&&this.driver&&this.updateTime(tt.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=at(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=yf,startTime:n}=this.options;this.driver||(this.driver=e(i=>this.tick(i))),this.options.onPlay?.();const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=n??s),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(tt.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&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(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}};function kf(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const jt=t=>t*180/Math.PI,Cs=t=>{const e=jt(Math.atan2(t[1],t[0]));return $s(e)},If={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Cs,rotateZ:Cs,skewX:t=>jt(Math.atan(t[1])),skewY:t=>jt(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},$s=t=>(t=t%360,t<0&&(t+=360),t),Mo=Cs,Do=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Eo=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Ff={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Do,scaleY:Eo,scale:t=>(Do(t)+Eo(t))/2,rotateX:t=>$s(jt(Math.atan2(t[6],t[5]))),rotateY:t=>$s(jt(Math.atan2(-t[2],t[0]))),rotateZ:Mo,rotate:Mo,skewX:t=>jt(Math.atan(t[4])),skewY:t=>jt(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Ms(t){return t.includes("scale")?1:0}function Ds(t,e){if(!t||t==="none")return Ms(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=Ff,i=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=If,i=a}if(!i)return Ms(e);const r=s[e],o=i[1].split(",").map(Of);return typeof r=="function"?r(o):o[r]}const Bf=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Ds(n,e)};function Of(t){return parseFloat(t.trim())}const ae=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],le=new Set(ae),Ro=t=>t===re||t===V,jf=new Set(["x","y","z"]),Nf=ae.filter(t=>!jf.has(t));function Uf(t){const e=[];return Nf.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}const $t={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>Ds(e,"x"),y:(t,{transform:e})=>Ds(e,"y")};$t.translateX=$t.x;$t.translateY=$t.y;const Wt=new Set;let Es=!1,Rs=!1,Ls=!1;function Rl(){if(Rs){const t=Array.from(Wt).filter(s=>s.needsMeasurement),e=new Set(t.map(s=>s.element)),n=new Map;e.forEach(s=>{const i=Uf(s);i.length&&(n.set(s,i),s.render())}),t.forEach(s=>s.measureInitialState()),e.forEach(s=>{s.render();const i=n.get(s);i&&i.forEach(([r,o])=>{s.getValue(r)?.set(o)})}),t.forEach(s=>s.measureEndState()),t.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}Rs=!1,Es=!1,Wt.forEach(t=>t.complete(Ls)),Wt.clear()}function Ll(){Wt.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Rs=!0)})}function Wf(){Ls=!0,Ll(),Rl(),Ls=!1}let Di=class{constructor(e,n,s,i,r,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=s,this.motionValue=i,this.element=r,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(Wt.add(this),Es||(Es=!0,L.read(Ll),L.resolveKeyframes(Rl))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:s,motionValue:i}=this;if(e[0]===null){const r=i?.get(),o=e[e.length-1];if(r!==void 0)e[0]=r;else if(s&&n){const a=s.readValue(n,o);a!=null&&(e[0]=a)}e[0]===void 0&&(e[0]=o),i&&r===void 0&&i.set(e[0])}kf(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Wt.delete(this)}cancel(){this.state==="scheduled"&&(Wt.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}};const Kf=t=>t.startsWith("--");function kl(t,e,n){Kf(e)?t.style.setProperty(e,n):t.style[e]=n}const Hf={};function Il(t,e){const n=al(t);return()=>Hf[e]??n()}const Gf=Il(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Fl=Il(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),pe=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,Lo={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:pe([0,.65,.55,1]),circOut:pe([.55,0,1,.45]),backIn:pe([.31,.01,.66,-.59]),backOut:pe([.33,1.53,.69,.99])};function Bl(t,e){if(t)return typeof t=="function"?Fl()?$l(t,e):"ease-out":vl(t)?pe(t):Array.isArray(t)?t.map(n=>Bl(n,e)||Lo.easeOut):Lo[t]}function zf(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:o="loop",ease:a="easeOut",times:c}={},u=void 0){const l={[e]:n};c&&(l.offset=c);const h=Bl(a,i);Array.isArray(h)&&(l.easing=h);const f={delay:s,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:r+1,direction:o==="reverse"?"alternate":"normal"};return u&&(f.pseudoElement=u),t.animate(l,f)}function Ol(t){return typeof t=="function"&&"applyToOptions"in t}function _f({type:t,...e}){return Ol(t)&&Fl()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}let jl=class extends Mi{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:s,keyframes:i,pseudoElement:r,allowFlatten:o=!1,finalKeyframe:a,onComplete:c}=e;this.isPseudoElement=!!r,this.allowFlatten=o,this.options=e,xi(typeof e.type!="string");const u=_f(e);this.animation=zf(n,s,i,u,r),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const l=$i(i,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(l),kl(n,s,l),this.animation.cancel()}c?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return at(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+at(e)}get time(){return at(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=ot(e),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:n,rangeEnd:s,observe:i}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&Gf()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),s&&(this.animation.rangeEnd=s),ct):i(this)}};const Nl={anticipate:pl,backInOut:dl,circInOut:gl};function Xf(t){return t in Nl}function Yf(t){typeof t.ease=="string"&&Xf(t.ease)&&(t.ease=Nl[t.ease])}const qn=10;let qf=class extends jl{constructor(e){Yf(e),El(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:s,onComplete:i,element:r,...o}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const a=new In({...o,autoplay:!1}),c=Math.max(qn,tt.now()-this.startTime),u=Pt(0,qn,c-qn),l=a.sample(c).value,{name:h}=this.options;r&&h&&kl(r,h,l),n.setWithVelocity(a.sample(Math.max(0,c-u)).value,l,u),a.stop()}};const ko=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(mt.test(t)||t==="0")&&!t.startsWith("url("));function Zf(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function Jf(t,e,n,s){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const r=t[t.length-1],o=ko(i,e),a=ko(r,e);return!o||!a?!1:Zf(t)||(n==="spring"||Ol(n))&&s}function ks(t){t.duration=0,t.type="keyframes"}const Qf=new Set(["opacity","clipPath","filter","transform"]),td=al(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function ed(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:r,type:o}=t;if(!(e?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=e.owner.getProps();return td()&&n&&Qf.has(n)&&(n!=="transform"||!u)&&!c&&!s&&i!=="mirror"&&r!==0&&o!=="inertia"}const nd=40;let sd=class extends Mi{constructor({autoplay:e=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:o="loop",keyframes:a,name:c,motionValue:u,element:l,...h}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=tt.now();const f={autoplay:e,delay:n,type:s,repeat:i,repeatDelay:r,repeatType:o,name:c,motionValue:u,element:l,...h},d=l?.KeyframeResolver||Di;this.keyframeResolver=new d(a,(p,m,g)=>this.onKeyframesResolved(p,m,f,!g),c,u,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,s,i){this.keyframeResolver=void 0;const{name:r,type:o,velocity:a,delay:c,isHandoff:u,onUpdate:l}=s;this.resolvedAt=tt.now(),Jf(e,r,o,a)||((bt.instantAnimations||!c)&&l?.($i(e,s,n)),e[0]=e[e.length-1],ks(s),s.repeat=0);const f={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>nd?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:e},d=!u&&ed(f),p=f.motionValue?.owner?.current,m=d?new qf({...f,element:p}):new In(f);m.finished.then(()=>{this.notifyFinished()}).catch(ct),this.pendingTimeline&&(this.stopTimeline=m.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Wf()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}};function Ul(t,e,n,s=0,i=1){const r=Array.from(t).sort((u,l)=>u.sortNodePosition(l)).indexOf(e),o=t.size,a=(o-1)*s;return typeof n=="function"?n(r,o):i===1?r*s:a-r*s}const id=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function od(t){const e=id.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}function Wl(t,e,n=1){const[s,i]=od(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);if(r){const o=r.trim();return il(o)?parseFloat(o):o}return Si(i)?Wl(i,e,n+1):i}const rd={type:"spring",stiffness:500,damping:25,restSpeed:10},ad=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),ld={type:"keyframes",duration:.8},cd={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ud=(t,{keyframes:e})=>e.length>2?ld:le.has(t)?t.startsWith("scale")?ad(e[1]):rd:cd,hd=t=>t!==null;function fd(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(hd),r=e&&n!=="loop"&&e%2===1?0:i.length-1;return i[r]}function Kl(t,e){if(t?.inherit&&e){const{inherit:n,...s}=t;return{...e,...s}}return t}function Ei(t,e){const n=t?.[e]??t?.default??t;return n!==t?Kl(n,t):n}function dd({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:r,repeatType:o,repeatDelay:a,from:c,elapsed:u,...l}){return!!Object.keys(l).length}const Ri=(t,e,n,s={},i,r)=>o=>{const a=Ei(s,t)||{},c=a.delay||s.delay||0;let{elapsed:u=0}=s;u=u-ot(c);const l={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:f=>{e.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:r?void 0:i};dd(a)||Object.assign(l,ud(t,l)),l.duration&&(l.duration=ot(l.duration)),l.repeatDelay&&(l.repeatDelay=ot(l.repeatDelay)),l.from!==void 0&&(l.keyframes[0]=l.from);let h=!1;if((l.type===!1||l.duration===0&&!l.repeatDelay)&&(ks(l),l.delay===0&&(h=!0)),(bt.instantAnimations||bt.skipAnimations||i?.shouldSkipAnimations)&&(h=!0,ks(l),l.delay=0),l.allowFlatten=!a.type&&!a.ease,h&&!r&&e.get()!==void 0){const f=fd(l.keyframes,a);if(f!==void 0){L.update(()=>{l.onUpdate(f),l.onComplete()});return}}return a.isSync?new In(l):new sd(l)};function Io(t){const e=[{},{}];return t?.values.forEach((n,s)=>{e[0][s]=n.get(),e[1][s]=n.getVelocity()}),e}function Li(t,e,n,s){if(typeof e=="function"){const[i,r]=Io(s);e=e(n!==void 0?n:t.custom,i,r)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,r]=Io(s);e=e(n!==void 0?n:t.custom,i,r)}return e}function ne(t,e,n){const s=t.getProps();return Li(s,e,n!==void 0?n:s.custom,t)}const Hl=new Set(["width","height","top","left","right","bottom",...ae]),Fo=30,pd=t=>!isNaN(parseFloat(t)),ve={current:void 0};let md=class{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{const i=tt.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const r of this.dependents)r.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=tt.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=pd(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new Ti);const s=this.events[e].add(n);return e==="change"?()=>{s(),L.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-s}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return ve.current&&ve.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const e=tt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Fo)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Fo);return ll(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function Gt(t,e){return new md(t,e)}const Is=t=>Array.isArray(t);function gd(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Gt(n))}function yd(t){return Is(t)?t[t.length-1]||0:t}function vd(t,e){const n=ne(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const o in r){const a=yd(r[o]);gd(t,o,a)}}const X=t=>!!(t&&t.getVelocity);function xd(t){return!!(X(t)&&t.add)}function Fs(t,e){const n=t.getValue("willChange");if(xd(n))return n.add(e);if(!n&&bt.WillChange){const s=new bt.WillChange("auto");t.addValue("willChange",s),s.add(e)}}function ki(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const Td="framerAppearId",Gl="data-"+ki(Td);function zl(t){return t.props[Gl]}function wd({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function _l(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:r,transitionEnd:o,...a}=e;const c=t.getDefaultTransition();r=r?Kl(r,c):c;const u=r?.reduceMotion;s&&(r=s);const l=[],h=i&&t.animationState&&t.animationState.getState()[i];for(const f in a){const d=t.getValue(f,t.latestValues[f]??null),p=a[f];if(p===void 0||h&&wd(h,f))continue;const m={delay:n,...Ei(r||{},f)},g=d.get();if(g!==void 0&&!d.isAnimating&&!Array.isArray(p)&&p===g&&!m.velocity)continue;let y=!1;if(window.MotionHandoffAnimation){const w=zl(t);if(w){const S=window.MotionHandoffAnimation(w,f,L);S!==null&&(m.startTime=S,y=!0)}}Fs(t,f);const T=u??t.shouldReduceMotion;d.start(Ri(f,d,p,T&&Hl.has(f)?{type:!1}:m,t,y));const v=d.animation;v&&l.push(v)}if(o){const f=()=>L.update(()=>{o&&vd(t,o)});l.length?Promise.all(l).then(f):f()}return l}function Bs(t,e,n={}){const s=ne(t,e,n.type==="exit"?t.presenceContext?.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const r=s?()=>Promise.all(_l(t,s,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:l,staggerDirection:h}=i;return Pd(t,e,c,u,l,h,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[c,u]=a==="beforeChildren"?[r,o]:[o,r];return c().then(()=>u())}else return Promise.all([r(),o(n.delay)])}function Pd(t,e,n=0,s=0,i=0,r=1,o){const a=[];for(const c of t.variantChildren)c.notify("AnimationStart",e),a.push(Bs(c,e,{...o,delay:n+(typeof s=="function"?0:s)+Ul(t.variantChildren,c,s,i,r)}).then(()=>c.notify("AnimationComplete",e)));return Promise.all(a)}function Sd(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(r=>Bs(t,r,n));s=Promise.all(i)}else if(typeof e=="string")s=Bs(t,e,n);else{const i=typeof e=="function"?ne(t,e,n.custom):e;s=Promise.all(_l(t,i,n))}return s.then(()=>{t.notify("AnimationComplete",e)})}const bd={test:t=>t==="auto",parse:t=>t},Xl=t=>e=>e.test(t),Yl=[re,V,Tt,Vt,Zh,qh,bd],Bo=t=>Yl.find(Xl(t));function Ad(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||rl(t):!0}const Vd=new Set(["brightness","contrast","saturate","opacity"]);function Cd(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(bi)||[];if(!s)return t;const i=n.replace(s,"");let r=Vd.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const $d=/\b([a-z-]*)\(.*?\)/gu,Os={...mt,getAnimatableNone:t=>{const e=t.match($d);return e?e.map(Cd).join(" "):t}},js={...mt,getAnimatableNone:t=>{const e=mt.parse(t);return mt.createTransformer(t)(e.map(s=>typeof s=="number"?0:typeof s=="object"?{...s,alpha:1}:s))}},Oo={...re,transform:Math.round},Md={rotate:Vt,rotateX:Vt,rotateY:Vt,rotateZ:Vt,scale:He,scaleX:He,scaleY:He,scaleZ:He,skew:Vt,skewX:Vt,skewY:Vt,distance:V,translateX:V,translateY:V,translateZ:V,x:V,y:V,z:V,perspective:V,transformPerspective:V,opacity:Ve,originX:bo,originY:bo,originZ:V},Ii={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,...Md,zIndex:Oo,fillOpacity:Ve,strokeOpacity:Ve,numOctaves:Oo},Dd={...Ii,color:W,backgroundColor:W,outlineColor:W,fill:W,stroke:W,borderColor:W,borderTopColor:W,borderRightColor:W,borderBottomColor:W,borderLeftColor:W,filter:Os,WebkitFilter:Os,mask:js,WebkitMask:js},ql=t=>Dd[t],Ed=new Set([Os,js]);function Zl(t,e){let n=ql(t);return Ed.has(n)||(n=mt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Rd=new Set(["auto","none","0"]);function Ld(t,e,n){let s=0,i;for(;s<t.length&&!i;){const r=t[s];typeof r=="string"&&!Rd.has(r)&&se(r).values.length&&(i=t[s]),s++}if(i&&n)for(const r of e)t[r]=Zl(n,i)}let kd=class extends Di{constructor(e,n,s,i,r){super(e,n,s,i,r,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<e.length;l++){let h=e[l];if(typeof h=="string"&&(h=h.trim(),Si(h))){const f=Wl(h,n.current);f!==void 0&&(e[l]=f),l===e.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!Hl.has(s)||e.length!==2)return;const[i,r]=e,o=Bo(i),a=Bo(r),c=So(i),u=So(r);if(c!==u&&$t[s]){this.needsMeasurement=!0;return}if(o!==a)if(Ro(o)&&Ro(a))for(let l=0;l<e.length;l++){const h=e[l];typeof h=="string"&&(e[l]=parseFloat(h))}else $t[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,s=[];for(let i=0;i<e.length;i++)(e[i]===null||Ad(e[i]))&&s.push(i);s.length&&Ld(e,s,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:s}=this;if(!e||!e.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=$t[s](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&e.getValue(s,i).jump(i,!1)}measureEndState(){const{element:e,name:n,unresolvedKeyframes:s}=this;if(!e||!e.current)return;const i=e.getValue(n);i&&i.jump(this.measuredOrigin,!1);const r=s.length-1,o=s[r];s[r]=$t[n](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),this.removedTransforms?.length&&this.removedTransforms.forEach(([a,c])=>{e.getValue(a).set(c)}),this.resolveNoneKeyframes()}};const Id=new Set(["opacity","clipPath","filter","transform"]);function Fi(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){const i=document.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t).filter(s=>s!=null)}const Jl=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function tn(t){return ol(t)&&"offsetHeight"in t}const{schedule:Bi}=xl(queueMicrotask,!1),dt={x:!1,y:!1};function Ql(){return dt.x||dt.y}function Fd(t){return t==="x"||t==="y"?dt[t]?null:(dt[t]=!0,()=>{dt[t]=!1}):dt.x||dt.y?null:(dt.x=dt.y=!0,()=>{dt.x=dt.y=!1})}function tc(t,e){const n=Fi(t),s=new AbortController,i={passive:!0,...e,signal:s.signal};return[n,i,()=>s.abort()]}function Bd(t){return!(t.pointerType==="touch"||Ql())}function Od(t,e,n={}){const[s,i,r]=tc(t,n);return s.forEach(o=>{let a=!1,c=!1,u;const l=()=>{o.removeEventListener("pointerleave",p)},h=g=>{u&&(u(g),u=void 0),l()},f=g=>{a=!1,window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f),c&&(c=!1,h(g))},d=()=>{a=!0,window.addEventListener("pointerup",f,i),window.addEventListener("pointercancel",f,i)},p=g=>{if(g.pointerType!=="touch"){if(a){c=!0;return}h(g)}},m=g=>{if(!Bd(g))return;c=!1;const y=e(o,g);typeof y=="function"&&(u=y,o.addEventListener("pointerleave",p,i))};o.addEventListener("pointerenter",m,i),o.addEventListener("pointerdown",d,i)}),r}const ec=(t,e)=>e?t===e?!0:ec(t,e.parentElement):!1,Oi=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,jd=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Nd(t){return jd.has(t.tagName)||t.isContentEditable===!0}const Ud=new Set(["INPUT","SELECT","TEXTAREA"]);function Wd(t){return Ud.has(t.tagName)||t.isContentEditable===!0}const en=new WeakSet;function jo(t){return e=>{e.key==="Enter"&&t(e)}}function Zn(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Kd=(t,e)=>{const n=t.currentTarget;if(!n)return;const s=jo(()=>{if(en.has(n))return;Zn(n,"down");const i=jo(()=>{Zn(n,"up")}),r=()=>Zn(n,"cancel");n.addEventListener("keyup",i,e),n.addEventListener("blur",r,e)});n.addEventListener("keydown",s,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),e)};function No(t){return Oi(t)&&!Ql()}const Uo=new WeakSet;function Hd(t,e,n={}){const[s,i,r]=tc(t,n),o=a=>{const c=a.currentTarget;if(!No(a)||Uo.has(a))return;en.add(c),n.stopPropagation&&Uo.add(a);const u=e(c,a),l=(d,p)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",f),en.has(c)&&en.delete(c),No(d)&&typeof u=="function"&&u(d,{success:p})},h=d=>{l(d,c===window||c===document||n.useGlobalTarget||ec(c,d.target))},f=d=>{l(d,!1)};window.addEventListener("pointerup",h,i),window.addEventListener("pointercancel",f,i)};return s.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),tn(a)&&(a.addEventListener("focus",u=>Kd(u,i)),!Nd(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),r}function ji(t){return ol(t)&&"ownerSVGElement"in t}const nn=new WeakMap;let sn;const nc=(t,e,n)=>(s,i)=>i&&i[0]?i[0][t+"Size"]:ji(s)&&"getBBox"in s?s.getBBox()[e]:s[n],Gd=nc("inline","width","offsetWidth"),zd=nc("block","height","offsetHeight");function _d({target:t,borderBoxSize:e}){nn.get(t)?.forEach(n=>{n(t,{get width(){return Gd(t,e)},get height(){return zd(t,e)}})})}function Xd(t){t.forEach(_d)}function Yd(){typeof ResizeObserver>"u"||(sn=new ResizeObserver(Xd))}function qd(t,e){sn||Yd();const n=Fi(t);return n.forEach(s=>{let i=nn.get(s);i||(i=new Set,nn.set(s,i)),i.add(e),sn?.observe(s)}),()=>{n.forEach(s=>{const i=nn.get(s);i?.delete(e),i?.size||sn?.unobserve(s)})}}const on=new Set;let Yt;function Zd(){Yt=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};on.forEach(e=>e(t))},window.addEventListener("resize",Yt)}function Jd(t){return on.add(t),Yt||Zd(),()=>{on.delete(t),!on.size&&typeof Yt=="function"&&(window.removeEventListener("resize",Yt),Yt=void 0)}}function Wo(t,e){return typeof t=="function"?Jd(t):qd(t,e)}function Qd(t){return ji(t)&&t.tagName==="svg"}function tp(...t){const e=!Array.isArray(t[0]),n=e?0:-1,s=t[0+n],i=t[1+n],r=t[2+n],o=t[3+n],a=Dl(i,r,o);return e?a(s):a}function ep(t,e,n={}){const s=t.get();let i=null,r=s,o;const a=typeof s=="string"?s.replace(/[\d.-]/g,""):void 0,c=()=>{i&&(i.stop(),i=null)},u=()=>{const h=Ho(t.get()),f=Ho(r);if(h===f){c();return}const d=i?i.getGeneratorVelocity():t.getVelocity();c(),i=new In({keyframes:[h,f],velocity:d,type:"spring",restDelta:.001,restSpeed:.01,...n,onUpdate:o})},l=()=>{u(),t.events.animationStart?.notify(),i?.then(()=>{t.events.animationComplete?.notify()})};if(t.attach((h,f)=>{r=h,o=d=>f(Ko(d,a)),L.postRender(l)},c),X(e)){const h=e.on("change",d=>t.set(Ko(d,a))),f=t.on("destroy",h);return()=>{h(),f()}}return c}function Ko(t,e){return e?t+e:t}function Ho(t){return typeof t=="number"?t:parseFloat(t)}const np=[...Yl,W,mt],sp=t=>np.find(Xl(t)),Go=()=>({translate:0,scale:1,origin:0,originPoint:0}),qt=()=>({x:Go(),y:Go()}),zo=()=>({min:0,max:0}),z=()=>({x:zo(),y:zo()}),ip=new WeakMap;function Fn(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Ce(t){return typeof t=="string"||Array.isArray(t)}const Ni=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ui=["initial",...Ni];function Bn(t){return Fn(t.animate)||Ui.some(e=>Ce(t[e]))}function sc(t){return!!(Bn(t)||t.variants)}function op(t,e,n){for(const s in e){const i=e[s],r=n[s];if(X(i))t.addValue(s,i);else if(X(r))t.addValue(s,Gt(i,{owner:t}));else if(r!==i)if(t.hasValue(s)){const o=t.getValue(s);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=t.getStaticValue(s);t.addValue(s,Gt(o!==void 0?o:i,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const Ns={current:null},ic={current:!1},rp=typeof window<"u";function ap(){if(ic.current=!0,!!rp)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Ns.current=t.matches;t.addEventListener("change",e),e()}else Ns.current=!1}const _o=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let wn={};function oc(t){wn=t}function lp(){return wn}let cp=class{scrapeMotionValuesFromProps(e,n,s){return{}}constructor({parent:e,props:n,presenceContext:s,reducedMotionConfig:i,skipAnimations:r,blockInitialAnimation:o,visualState:a},c={}){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=Di,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 d=tt.now();this.renderScheduledAt<d&&(this.renderScheduledAt=d,L.render(this.render,!1,!0))};const{latestValues:u,renderState:l}=a;this.latestValues=u,this.baseTarget={...u},this.initialValues=n.initial?{...u}:{},this.renderState=l,this.parent=e,this.props=n,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=r,this.options=c,this.blockInitialAnimation=!!o,this.isControllingVariants=Bn(n),this.isVariantNode=sc(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:h,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const d in f){const p=f[d];u[d]!==void 0&&X(p)&&p.set(u[d])}}mount(e){if(this.hasBeenMounted)for(const n in this.initialValues)this.values.get(n)?.jump(this.initialValues[n]),this.latestValues[n]=this.initialValues[n];this.current=e,ip.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,s)=>this.bindToMotionValue(s,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(ic.current||ap(),this.shouldReduceMotion=Ns.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(),At(this.notifyUpdate),At(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),n.accelerate&&Id.has(e)&&this.current instanceof HTMLElement){const{factory:o,keyframes:a,times:c,ease:u,duration:l}=n.accelerate,h=new jl({element:this.current,name:e,keyframes:a,times:c,ease:u,duration:ot(l)}),f=o(h);this.valueSubscriptions.set(e,()=>{f(),h.cancel()});return}const s=le.has(e);s&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&L.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let r;typeof window<"u"&&window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),r&&r(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in wn){const n=wn[e];if(!n)continue;const{isEnabled:s,Feature:i}=n;if(!this.features[e]&&i&&s(this.props)&&(this.features[e]=new i(this)),this.features[e]){const r=this.features[e];r.isMounted?r.update():(r.mount(),r.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):z()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<_o.length;s++){const i=_o[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const r="on"+i,o=e[r];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=op(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const s=this.values.get(e);n!==s&&(s&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let s=this.values.get(e);return s===void 0&&n!==void 0&&(s=Gt(n===null?void 0:n,{owner:this}),this.addValue(e,s)),s}readValue(e,n){let s=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return s!=null&&(typeof s=="string"&&(il(s)||rl(s))?s=parseFloat(s):!sp(s)&&mt.test(n)&&(s=Zl(e,n)),this.setBaseTarget(e,X(s)?s.get():s)),X(s)?s.get():s}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const r=Li(this.props,n,this.presenceContext?.custom);r&&(s=r[e])}if(n&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!X(i)?i:this.initialValues[e]!==void 0&&s===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new Ti),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){Bi.render(this.render)}},rc=class extends cp{constructor(){super(...arguments),this.KeyframeResolver=kd}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){const s=e.style;return s?s[n]:void 0}removeValueFromRenderState(e,{vars:n,style:s}){delete n[e],delete s[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;X(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}},Rt=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function ac({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function up({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function hp(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function Jn(t){return t===void 0||t===1}function Us({scale:t,scaleX:e,scaleY:n}){return!Jn(t)||!Jn(e)||!Jn(n)}function Ft(t){return Us(t)||lc(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function lc(t){return Xo(t.x)||Xo(t.y)}function Xo(t){return t&&t!=="0%"}function Pn(t,e,n){const s=t-n,i=e*s;return n+i}function Yo(t,e,n,s,i){return i!==void 0&&(t=Pn(t,i,s)),Pn(t,n,s)+e}function Ws(t,e=0,n=1,s,i){t.min=Yo(t.min,e,n,s,i),t.max=Yo(t.max,e,n,s,i)}function cc(t,{x:e,y:n}){Ws(t.x,e.translate,e.scale,e.originPoint),Ws(t.y,n.translate,n.scale,n.originPoint)}const qo=.999999999999,Zo=1.0000000000001;function fp(t,e,n,s=!1){const i=n.length;if(!i)return;e.x=e.y=1;let r,o;for(let a=0;a<i;a++){r=n[a],o=r.projectionDelta;const{visualElement:c}=r.options;c&&c.props.style&&c.props.style.display==="contents"||(s&&r.options.layoutScroll&&r.scroll&&r!==r.root&&Jt(t,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),o&&(e.x*=o.x.scale,e.y*=o.y.scale,cc(t,o)),s&&Ft(r.latestValues)&&Jt(t,r.latestValues,r.layout?.layoutBox))}e.x<Zo&&e.x>qo&&(e.x=1),e.y<Zo&&e.y>qo&&(e.y=1)}function Zt(t,e){t.min=t.min+e,t.max=t.max+e}function Jo(t,e,n,s,i=.5){const r=B(t.min,t.max,i);Ws(t,e,n,r,s)}function Qo(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function Jt(t,e,n){const s=n??t;Jo(t.x,Qo(e.x,s.x),e.scaleX,e.scale,e.originX),Jo(t.y,Qo(e.y,s.y),e.scaleY,e.scale,e.originY)}function uc(t,e){return ac(hp(t.getBoundingClientRect(),e))}function dp(t,e,n){const s=uc(t,n),{scroll:i}=e;return i&&(Zt(s.x,i.offset.x),Zt(s.y,i.offset.y)),s}const pp={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},mp=ae.length;function gp(t,e,n){let s="",i=!0;for(let r=0;r<mp;r++){const o=ae[r],a=t[o];if(a===void 0)continue;let c=!0;if(typeof a=="number")c=a===(o.startsWith("scale")?1:0);else{const u=parseFloat(a);c=o.startsWith("scale")?u===1:u===0}if(!c||n){const u=Jl(a,Ii[o]);if(!c){i=!1;const l=pp[o]||o;s+=`${l}(${u}) `}n&&(e[o]=u)}}return s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}function Wi(t,e,n){const{style:s,vars:i,transformOrigin:r}=t;let o=!1,a=!1;for(const c in e){const u=e[c];if(le.has(c)){o=!0;continue}else if(wl(c)){i[c]=u;continue}else{const l=Jl(u,Ii[c]);c.startsWith("origin")?(a=!0,r[c]=l):s[c]=l}}if(e.transform||(o||n?s.transform=gp(e,t.transform,n):s.transform&&(s.transform="none")),a){const{originX:c="50%",originY:u="50%",originZ:l=0}=r;s.transformOrigin=`${c} ${u} ${l}`}}function hc(t,{style:e,vars:n},s,i){const r=t.style;let o;for(o in e)r[o]=e[o];i?.applyProjectionStyles(r,s);for(o in n)r.setProperty(o,n[o])}function tr(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const fe={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(V.test(t))t=parseFloat(t);else return t;const n=tr(t,e.target.x),s=tr(t,e.target.y);return`${n}% ${s}%`}},yp={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=mt.parse(t);if(i.length>5)return s;const r=mt.createTransformer(t),o=typeof i[0]!="number"?1:0,a=n.x.scale*e.x,c=n.y.scale*e.y;i[0+o]/=a,i[1+o]/=c;const u=B(a,c,.5);return typeof i[2+o]=="number"&&(i[2+o]/=u),typeof i[3+o]=="number"&&(i[3+o]/=u),r(i)}},Ks={borderRadius:{...fe,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:fe,borderTopRightRadius:fe,borderBottomLeftRadius:fe,borderBottomRightRadius:fe,boxShadow:yp};function fc(t,{layout:e,layoutId:n}){return le.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!Ks[t]||t==="opacity")}function Ki(t,e,n){const s=t.style,i=e?.style,r={};if(!s)return r;for(const o in s)(X(s[o])||i&&X(i[o])||fc(o,t)||n?.getValue(o)?.liveStyle!==void 0)&&(r[o]=s[o]);return r}function vp(t){return window.getComputedStyle(t)}let xp=class extends rc{constructor(){super(...arguments),this.type="html",this.renderInstance=hc}readValueFromInstance(e,n){if(le.has(n))return this.projection?.isProjecting?Ms(n):Bf(e,n);{const s=vp(e),i=(wl(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return uc(e,n)}build(e,n,s){Wi(e,n,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return Ki(e,n,s)}};const Tp={offset:"stroke-dashoffset",array:"stroke-dasharray"},wp={offset:"strokeDashoffset",array:"strokeDasharray"};function Pp(t,e,n=1,s=0,i=!0){t.pathLength=1;const r=i?Tp:wp;t[r.offset]=`${-s}`,t[r.array]=`${e} ${n}`}const Sp=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function dc(t,{attrX:e,attrY:n,attrScale:s,pathLength:i,pathSpacing:r=1,pathOffset:o=0,...a},c,u,l){if(Wi(t,a,u),c){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:h,style:f}=t;h.transform&&(f.transform=h.transform,delete h.transform),(f.transform||h.transformOrigin)&&(f.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),f.transform&&(f.transformBox=l?.transformBox??"fill-box",delete h.transformBox);for(const d of Sp)h[d]!==void 0&&(f[d]=h[d],delete h[d]);e!==void 0&&(h.x=e),n!==void 0&&(h.y=n),s!==void 0&&(h.scale=s),i!==void 0&&Pp(h,i,r,o,!1)}const pc=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"]),mc=t=>typeof t=="string"&&t.toLowerCase()==="svg";function bp(t,e,n,s){hc(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(pc.has(i)?i:ki(i),e.attrs[i])}function gc(t,e,n){const s=Ki(t,e,n);for(const i in t)if(X(t[i])||X(e[i])){const r=ae.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[r]=t[i]}return s}let Ap=class extends rc{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=z}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(le.has(n)){const s=ql(n);return s&&s.default||0}return n=pc.has(n)?n:ki(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,s){return gc(e,n,s)}build(e,n,s){dc(e,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(e,n,s,i){bp(e,n,s,i)}mount(e){this.isSVGTag=mc(e.tagName),super.mount(e)}};const Vp=Ui.length;function yc(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?yc(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<Vp;n++){const s=Ui[n],i=t.props[s];(Ce(i)||i===!1)&&(e[s]=i)}return e}function vc(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}const Cp=[...Ni].reverse(),$p=Ni.length;function Mp(t){return e=>Promise.all(e.map(({animation:n,options:s})=>Sd(t,n,s)))}function Dp(t){let e=Mp(t),n=er(),s=!0,i=!1;const r=u=>(l,h)=>{const f=ne(t,h,u==="exit"?t.presenceContext?.custom:void 0);if(f){const{transition:d,transitionEnd:p,...m}=f;l={...l,...m,...p}}return l};function o(u){e=u(t)}function a(u){const{props:l}=t,h=yc(t.parent)||{},f=[],d=new Set;let p={},m=1/0;for(let y=0;y<$p;y++){const T=Cp[y],v=n[T],w=l[T]!==void 0?l[T]:h[T],S=Ce(w),M=T===u?v.isActive:null;M===!1&&(m=y);let D=w===h[T]&&w!==l[T]&&S;if(D&&(s||i)&&t.manuallyAnimateOnMount&&(D=!1),v.protectedKeys={...p},!v.isActive&&M===null||!w&&!v.prevProp||Fn(w)||typeof w=="boolean")continue;if(T==="exit"&&v.isActive&&M!==!0){v.prevResolvedValues&&(p={...p,...v.prevResolvedValues});continue}const b=Ep(v.prevProp,w);let A=b||T===u&&v.isActive&&!D&&S||y>m&&S,P=!1;const $=Array.isArray(w)?w:[w];let E=$.reduce(r(T),{});M===!1&&(E={});const{prevResolvedValues:H={}}=v,N={...H,...E},G=R=>{A=!0,d.has(R)&&(P=!0,d.delete(R)),v.needsAnimating[R]=!0;const I=t.getValue(R);I&&(I.liveStyle=!1)};for(const R in N){const I=E[R],Q=H[R];if(p.hasOwnProperty(R))continue;let it=!1;Is(I)&&Is(Q)?it=!vc(I,Q):it=I!==Q,it?I!=null?G(R):d.add(R):I!==void 0&&d.has(R)?G(R):v.protectedKeys[R]=!0}v.prevProp=w,v.prevResolvedValues=E,v.isActive&&(p={...p,...E}),(s||i)&&t.blockInitialAnimation&&(A=!1);const U=D&&b;A&&(!U||P)&&f.push(...$.map(R=>{const I={type:T};if(typeof R=="string"&&(s||i)&&!U&&t.manuallyAnimateOnMount&&t.parent){const{parent:Q}=t,it=ne(Q,R);if(Q.enteringChildren&&it){const{delayChildren:Hn}=it.transition||{};I.delay=Ul(Q.enteringChildren,t,Hn)}}return{animation:R,options:I}}))}if(d.size){const y={};if(typeof l.initial!="boolean"){const T=ne(t,Array.isArray(l.initial)?l.initial[0]:l.initial);T&&T.transition&&(y.transition=T.transition)}d.forEach(T=>{const v=t.getBaseTarget(T),w=t.getValue(T);w&&(w.liveStyle=!0),y[T]=v??null}),f.push({animation:y})}let g=!!f.length;return s&&(l.initial===!1||l.initial===l.animate)&&!t.manuallyAnimateOnMount&&(g=!1),s=!1,i=!1,g?e(f):Promise.resolve()}function c(u,l){if(n[u].isActive===l)return Promise.resolve();t.variantChildren?.forEach(f=>f.animationState?.setActive(u,l)),n[u].isActive=l;const h=a(u);for(const f in n)n[f].protectedKeys={};return h}return{animateChanges:a,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=er(),i=!0}}}function Ep(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!vc(e,t):!1}function kt(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function er(){return{animate:kt(!0),whileInView:kt(),whileHover:kt(),whileTap:kt(),whileDrag:kt(),whileFocus:kt(),exit:kt()}}function nr(t,e){t.min=e.min,t.max=e.max}function ht(t,e){nr(t.x,e.x),nr(t.y,e.y)}function sr(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const xc=1e-4,Rp=1-xc,Lp=1+xc,Tc=.01,kp=0-Tc,Ip=0+Tc;function et(t){return t.max-t.min}function Fp(t,e,n){return Math.abs(t-e)<=n}function ir(t,e,n,s=.5){t.origin=s,t.originPoint=B(e.min,e.max,t.origin),t.scale=et(n)/et(e),t.translate=B(n.min,n.max,t.origin)-t.originPoint,(t.scale>=Rp&&t.scale<=Lp||isNaN(t.scale))&&(t.scale=1),(t.translate>=kp&&t.translate<=Ip||isNaN(t.translate))&&(t.translate=0)}function xe(t,e,n,s){ir(t.x,e.x,n.x,s?s.originX:void 0),ir(t.y,e.y,n.y,s?s.originY:void 0)}function or(t,e,n){t.min=n.min+e.min,t.max=t.min+et(e)}function Bp(t,e,n){or(t.x,e.x,n.x),or(t.y,e.y,n.y)}function rr(t,e,n){t.min=e.min-n.min,t.max=t.min+et(e)}function Sn(t,e,n){rr(t.x,e.x,n.x),rr(t.y,e.y,n.y)}function ar(t,e,n,s,i){return t-=e,t=Pn(t,1/n,s),i!==void 0&&(t=Pn(t,1/i,s)),t}function Op(t,e=0,n=1,s=.5,i,r=t,o=t){if(Tt.test(e)&&(e=parseFloat(e),e=B(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=B(r.min,r.max,s);t===r&&(a-=e),t.min=ar(t.min,e,n,a,i),t.max=ar(t.max,e,n,a,i)}function lr(t,e,[n,s,i],r,o){Op(t,e[n],e[s],e[i],e.scale,r,o)}const jp=["x","scaleX","originX"],Np=["y","scaleY","originY"];function cr(t,e,n,s){lr(t.x,e,jp,n?n.x:void 0,s?s.x:void 0),lr(t.y,e,Np,n?n.y:void 0,s?s.y:void 0)}function ur(t){return t.translate===0&&t.scale===1}function wc(t){return ur(t.x)&&ur(t.y)}function hr(t,e){return t.min===e.min&&t.max===e.max}function Up(t,e){return hr(t.x,e.x)&&hr(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 Pc(t,e){return fr(t.x,e.x)&&fr(t.y,e.y)}function dr(t){return et(t.x)/et(t.y)}function pr(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function yt(t){return[t("x"),t("y")]}function Wp(t,e,n){let s="";const i=t.x.translate/e.x,r=t.y.translate/e.y,o=n?.z||0;if((i||r||o)&&(s=`translate3d(${i}px, ${r}px, ${o}px) `),(e.x!==1||e.y!==1)&&(s+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:u,rotate:l,rotateX:h,rotateY:f,skewX:d,skewY:p}=n;u&&(s=`perspective(${u}px) ${s}`),l&&(s+=`rotate(${l}deg) `),h&&(s+=`rotateX(${h}deg) `),f&&(s+=`rotateY(${f}deg) `),d&&(s+=`skewX(${d}deg) `),p&&(s+=`skewY(${p}deg) `)}const a=t.x.scale*e.x,c=t.y.scale*e.y;return(a!==1||c!==1)&&(s+=`scale(${a}, ${c})`),s||"none"}const Sc=["TopLeft","TopRight","BottomLeft","BottomRight"],Kp=Sc.length,mr=t=>typeof t=="string"?parseFloat(t):t,gr=t=>typeof t=="number"||V.test(t);function Hp(t,e,n,s,i,r){i?(t.opacity=B(0,n.opacity??1,Gp(s)),t.opacityExit=B(e.opacity??1,0,zp(s))):r&&(t.opacity=B(e.opacity??1,n.opacity??1,s));for(let o=0;o<Kp;o++){const a=`border${Sc[o]}Radius`;let c=yr(e,a),u=yr(n,a);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||gr(c)===gr(u)?(t[a]=Math.max(B(mr(c),mr(u),s),0),(Tt.test(u)||Tt.test(c))&&(t[a]+="%")):t[a]=u}(e.rotate||n.rotate)&&(t.rotate=B(e.rotate||0,n.rotate||0,s))}function yr(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const Gp=bc(0,.5,ml),zp=bc(.5,.95,ct);function bc(t,e,n){return s=>s<t?0:s>e?1:n(Ae(t,e,s))}function _p(t,e,n){const s=X(t)?t:Gt(t);return s.start(Ri("",s,e,n)),s.animation}function $e(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}const Xp=(t,e)=>t.depth-e.depth;let Yp=class{constructor(){this.children=[],this.isDirty=!1}add(e){vi(this.children,e),this.isDirty=!0}remove(e){yn(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Xp),this.isDirty=!1,this.children.forEach(e)}};function qp(t,e){const n=tt.now(),s=({timestamp:i})=>{const r=i-n;r>=e&&(At(s),t(r-e))};return L.setup(s,!0),()=>At(s)}function rn(t){return X(t)?t.get():t}let Zp=class{constructor(){this.members=[]}add(e){vi(this.members,e);for(let n=this.members.length-1;n>=0;n--){const s=this.members[n];if(s===e||s===this.lead||s===this.prevLead)continue;const i=s.instance;(!i||i.isConnected===!1)&&!s.snapshot&&(yn(this.members,s),s.unmount())}e.scheduleRender()}remove(e){if(yn(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){for(let n=this.members.indexOf(e)-1;n>=0;n--){const s=this.members[n];if(s.isPresent!==!1&&s.instance?.isConnected!==!1)return this.promote(s),!0}return!1}promote(e,n){const s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.updateSnapshot(),e.scheduleRender();const{layoutDependency:i}=s.options,{layoutDependency:r}=e.options;(i===void 0||i!==r)&&(e.resumeFrom=s,n&&(s.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}};const an={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Qn=["","X","Y","Z"],Jp=1e3;let Qp=0;function ts(t,e,n,s){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),s&&(s[t]=0))}function Ac(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=zl(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:r}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",L,!(i||r))}const{parent:s}=t;s&&!s.hasCheckedOptimisedAppear&&Ac(s)}function Vc({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(o={},a=e?.()){this.id=Qp++,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.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(nm),this.nodes.forEach(rm),this.nodes.forEach(am),this.nodes.forEach(sm)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new Yp)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Ti),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const c=this.eventHandlers.get(o);c&&c.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=ji(o)&&!Qd(o),this.instance=o;const{layoutId:a,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||a)&&(this.isLayoutDirty=!0),t){let l,h=0;const f=()=>this.root.updateBlockedByResize=!1;L.read(()=>{h=window.innerWidth}),t(o,()=>{const d=window.innerWidth;d!==h&&(h=d,this.root.updateBlockedByResize=!0,l&&l(),l=qp(f,250),an.hasAnimatedSinceResize&&(an.hasAnimatedSinceResize=!1,this.nodes.forEach(Tr)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&u&&(a||c)&&this.addEventListener("didUpdate",({delta:l,hasLayoutChanged:h,hasRelativeLayoutChanged:f,layout:d})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const p=this.options.transition||u.getDefaultTransition()||fm,{onLayoutAnimationStart:m,onLayoutAnimationComplete:g}=u.getProps(),y=!this.targetLayout||!Pc(this.targetLayout,d),T=!h&&f;if(this.options.layoutRoot||this.resumeFrom||T||h&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const v={...Ei(p,"layout"),onPlay:m,onComplete:g};(u.shouldReduceMotion||this.options.layoutRoot)&&(v.delay=0,v.type=!1),this.startAnimation(v),this.setAnimationOrigin(l,T)}else h||Tr(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=d})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),At(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(lm),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Ac(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let l=0;l<this.path.length;l++){const h=this.path[l];h.shouldResetTransform=!0,(typeof h.latestValues.x=="string"||typeof h.latestValues.y=="string")&&(h.isLayoutDirty=!0),h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:a,layout:c}=this.options;if(a===void 0&&!c)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(vr);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(xr);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(om),this.nodes.forEach(tm),this.nodes.forEach(em)):this.nodes.forEach(xr),this.clearAllSnapshots();const a=tt.now();q.delta=Pt(0,1e3/60,a-q.timestamp),q.timestamp=a,q.isProcessing=!0,Gn.update.process(q),Gn.preRender.process(q),Gn.render.process(q),q.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Bi.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(im),this.sharedNodes.forEach(cm)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,L.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){L.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!et(this.snapshot.measuredBox.x)&&!et(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=z(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a&&this.instance){const c=s(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!wc(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,l=u!==this.prevTransformTemplateValue;o&&this.instance&&(a||Ft(this.latestValues)||l)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let c=this.removeElementScroll(a);return o&&(c=this.removeTransform(c)),dm(c),{animationId:this.root.animationId,measuredBox:a,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:o}=this.options;if(!o)return z();const a=o.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(pm))){const{scroll:u}=this.root;u&&(Zt(a.x,u.offset.x),Zt(a.y,u.offset.y))}return a}removeElementScroll(o){const a=z();if(ht(a,o),this.scroll?.wasRoot)return a;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:l,options:h}=u;u!==this.root&&l&&h.layoutScroll&&(l.wasRoot&&ht(a,o),Zt(a.x,l.offset.x),Zt(a.y,l.offset.y))}return a}applyTransform(o,a=!1){const c=z();ht(c,o);for(let u=0;u<this.path.length;u++){const l=this.path[u];!a&&l.options.layoutScroll&&l.scroll&&l!==l.root&&Jt(c,{x:-l.scroll.offset.x,y:-l.scroll.offset.y}),Ft(l.latestValues)&&Jt(c,l.latestValues,l.layout?.layoutBox)}return Ft(this.latestValues)&&Jt(c,this.latestValues,this.layout?.layoutBox),c}removeTransform(o){const a=z();ht(a,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!Ft(u.latestValues))continue;let l;u.instance&&(Us(u.latestValues)&&u.updateSnapshot(),l=z(),ht(l,u.measurePageBox())),cr(a,u.latestValues,u.snapshot?.layoutBox,l)}return Ft(this.latestValues)&&cr(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}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!==q.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==a;if(!(o||c&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:l,layoutId:h}=this.options;if(!this.layout||!(l||h))return;this.resolvedRelativeTargetAt=q.timestamp;const f=this.getClosestProjectingParent();f&&this.linkedParentVersion!==f.layoutVersion&&!f.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(f&&f.layout?this.createRelativeTarget(f,this.layout.layoutBox,f.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=z(),this.targetWithTransforms=z()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Bp(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):ht(this.target,this.layout.layoutBox),cc(this.target,this.targetDelta)):ht(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?this.createRelativeTarget(f,this.target,f.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Us(this.parent.latestValues)||lc(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,a,c){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=z(),this.relativeTargetOrigin=z(),Sn(this.relativeTargetOrigin,a,c),ht(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const o=this.getLead(),a=!!this.resumingFrom||this!==o;let c=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(c=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===q.timestamp&&(c=!1),c)return;const{layout:u,layoutId:l}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||l))return;ht(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,f=this.treeScale.y;fp(this.layoutCorrected,this.treeScale,this.path,a),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=z());const{target:d}=o;if(!d){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(sr(this.prevProjectionDelta.x,this.projectionDelta.x),sr(this.prevProjectionDelta.y,this.projectionDelta.y)),xe(this.projectionDelta,this.layoutCorrected,d,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==f||!pr(this.projectionDelta.x,this.prevProjectionDelta.x)||!pr(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",d))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){if(this.options.visualElement?.scheduleRender(),o){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=qt(),this.projectionDelta=qt(),this.projectionDeltaWithTransform=qt()}setAnimationOrigin(o,a=!1){const c=this.snapshot,u=c?c.latestValues:{},l={...this.latestValues},h=qt();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=z(),d=c?c.source:void 0,p=this.layout?this.layout.source:void 0,m=d!==p,g=this.getStack(),y=!g||g.members.length<=1,T=!!(m&&!y&&this.options.crossfade===!0&&!this.path.some(hm));this.animationProgress=0;let v;this.mixTargetDelta=w=>{const S=w/1e3;wr(h.x,o.x,S),wr(h.y,o.y,S),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Sn(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),um(this.relativeTarget,this.relativeTargetOrigin,f,S),v&&Up(this.relativeTarget,v)&&(this.isProjectionDirty=!1),v||(v=z()),ht(v,this.relativeTarget)),m&&(this.animationValues=l,Hp(l,u,this.latestValues,S,T,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(At(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=L.update(()=>{an.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Gt(0)),this.motionValue.jump(0,!1),this.currentAnimation=_p(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),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 o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Jp),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:c,layout:u,latestValues:l}=o;if(!(!a||!c||!u)){if(this!==o&&this.layout&&u&&Cc(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||z();const h=et(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+h;const f=et(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+f}ht(a,c),Jt(a,l),xe(this.projectionDeltaWithTransform,this.layoutCorrected,a,l)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Zp),this.sharedNodes.get(o).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){const{layoutId:o}=this.options;return o?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:o}=this.options;return o?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(a=!0),!a)return;const u={};c.z&&ts("z",o,u,this.animationValues);for(let l=0;l<Qn.length;l++)ts(`rotate${Qn[l]}`,o,u,this.animationValues),ts(`skew${Qn[l]}`,o,u,this.animationValues);o.render();for(const l in u)o.setStaticValue(l,u[l]),this.animationValues&&(this.animationValues[l]=u[l]);o.scheduleRender()}applyProjectionStyles(o,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=rn(a?.pointerEvents)||"",o.transform=c?c(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=rn(a?.pointerEvents)||""),this.hasProjected&&!Ft(this.latestValues)&&(o.transform=c?c({},""):"none",this.hasProjected=!1);return}o.visibility="";const l=u.animationValues||u.latestValues;this.applyTransformsToTarget();let h=Wp(this.projectionDeltaWithTransform,this.treeScale,l);c&&(h=c(l,h)),o.transform=h;const{x:f,y:d}=this.projectionDelta;o.transformOrigin=`${f.origin*100}% ${d.origin*100}% 0`,u.animationValues?o.opacity=u===this?l.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:l.opacityExit:o.opacity=u===this?l.opacity!==void 0?l.opacity:"":l.opacityExit!==void 0?l.opacityExit:0;for(const p in Ks){if(l[p]===void 0)continue;const{correct:m,applyTo:g,isCSSVariable:y}=Ks[p],T=h==="none"?l[p]:m(l[p],u);if(g){const v=g.length;for(let w=0;w<v;w++)o[g[w]]=T}else y?this.options.visualElement.renderState.vars[p]=T:o[p]=T}this.options.layoutId&&(o.pointerEvents=u===this?rn(a?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>o.currentAnimation?.stop()),this.root.nodes.forEach(vr),this.root.sharedNodes.clear()}}}function tm(t){t.updateLayout()}function em(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:s}=t.layout,{animationType:i}=t.options,r=e.source!==t.layout.source;i==="size"?yt(l=>{const h=r?e.measuredBox[l]:e.layoutBox[l],f=et(h);h.min=n[l].min,h.max=h.min+f}):Cc(i,e.layoutBox,n)&&yt(l=>{const h=r?e.measuredBox[l]:e.layoutBox[l],f=et(n[l]);h.max=h.min+f,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[l].max=t.relativeTarget[l].min+f)});const o=qt();xe(o,n,e.layoutBox);const a=qt();r?xe(a,t.applyTransform(s,!0),e.measuredBox):xe(a,n,e.layoutBox);const c=!wc(o);let u=!1;if(!t.resumeFrom){const l=t.getClosestProjectingParent();if(l&&!l.resumeFrom){const{snapshot:h,layout:f}=l;if(h&&f){const d=z();Sn(d,e.layoutBox,h.layoutBox);const p=z();Sn(p,n,f.layoutBox),Pc(d,p)||(u=!0),l.options.layoutRoot&&(t.relativeTarget=p,t.relativeTargetOrigin=d,t.relativeParent=l)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function nm(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function sm(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function im(t){t.clearSnapshot()}function vr(t){t.clearMeasurements()}function xr(t){t.isLayoutDirty=!1}function om(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Tr(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function rm(t){t.resolveTargetDelta()}function am(t){t.calcProjection()}function lm(t){t.resetSkewAndRotation()}function cm(t){t.removeLeadSnapshot()}function wr(t,e,n){t.translate=B(e.translate,0,n),t.scale=B(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Pr(t,e,n,s){t.min=B(e.min,n.min,s),t.max=B(e.max,n.max,s)}function um(t,e,n,s){Pr(t.x,e.x,n.x,s),Pr(t.y,e.y,n.y,s)}function hm(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const fm={duration:.45,ease:[.4,0,.1,1]},Sr=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),br=Sr("applewebkit/")&&!Sr("chrome/")?Math.round:ct;function Ar(t){t.min=br(t.min),t.max=br(t.max)}function dm(t){Ar(t.x),Ar(t.y)}function Cc(t,e,n){return t==="position"||t==="preserve-aspect"&&!Fp(dr(e),dr(n),.2)}function pm(t){return t!==t.root&&t.scroll?.wasRoot}const mm=Vc({attachResizeListener:(t,e)=>$e(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),es={current:void 0},$c=Vc({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!es.current){const t=new mm({});t.mount(window),t.setOptions({layoutScroll:!0}),es.current=t}return es.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),Be=x.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function Vr(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function gm(...t){return e=>{let n=!1;const s=t.map(i=>{const r=Vr(i,e);return!n&&typeof r=="function"&&(n=!0),r});if(n)return()=>{for(let i=0;i<s.length;i++){const r=s[i];typeof r=="function"?r():Vr(t[i],null)}}}}function ym(...t){return x.useCallback(gm(...t),t)}let vm=class extends x.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(tn(n)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const s=n.offsetParent,i=tn(s)&&s.offsetWidth||0,r=tn(s)&&s.offsetHeight||0,o=getComputedStyle(n),a=this.props.sizeRef.current;a.height=parseFloat(o.height),a.width=parseFloat(o.width),a.top=n.offsetTop,a.left=n.offsetLeft,a.right=i-a.width-a.left,a.bottom=r-a.height-a.top}return null}componentDidUpdate(){}render(){return this.props.children}};function xm({children:t,isPresent:e,anchorX:n,anchorY:s,root:i,pop:r}){const o=x.useId(),a=x.useRef(null),c=x.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:u}=x.useContext(Be),l=t.props?.ref??t?.ref,h=ym(a,l);return x.useInsertionEffect(()=>{const{width:f,height:d,top:p,left:m,right:g,bottom:y}=c.current;if(e||r===!1||!a.current||!f||!d)return;const T=n==="left"?`left: ${m}`:`right: ${g}`,v=s==="bottom"?`bottom: ${y}`:`top: ${p}`;a.current.dataset.motionPopId=o;const w=document.createElement("style");u&&(w.nonce=u);const S=i??document.head;return S.appendChild(w),w.sheet&&w.sheet.insertRule(`
2
- [data-motion-pop-id="${o}"] {
3
- position: absolute !important;
4
- width: ${f}px !important;
5
- height: ${d}px !important;
6
- ${T}px !important;
7
- ${v}px !important;
8
- }
9
- `),()=>{S.contains(w)&&S.removeChild(w)}},[e]),Y.jsx(vm,{isPresent:e,childRef:a,sizeRef:c,pop:r,children:r===!1?t:x.cloneElement(t,{ref:h})})}const Tm=({children:t,initial:e,isPresent:n,onExitComplete:s,custom:i,presenceAffectsLayout:r,mode:o,anchorX:a,anchorY:c,root:u})=>{const l=Le(wm),h=x.useId();let f=!0,d=x.useMemo(()=>(f=!1,{id:h,initial:e,isPresent:n,custom:i,onExitComplete:p=>{l.set(p,!0);for(const m of l.values())if(!m)return;s&&s()},register:p=>(l.set(p,!1),()=>l.delete(p))}),[n,l,s]);return r&&f&&(d={...d}),x.useMemo(()=>{l.forEach((p,m)=>l.set(m,!1))},[n]),x.useEffect(()=>{!n&&!l.size&&s&&s()},[n]),t=Y.jsx(xm,{pop:o==="popLayout",isPresent:n,anchorX:a,anchorY:c,root:u,children:t}),Y.jsx(kn.Provider,{value:d,children:t})};function wm(){return new Map}function Mc(t=!0){const e=x.useContext(kn);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:i}=e,r=x.useId();x.useEffect(()=>{if(t)return i(r)},[t]);const o=x.useCallback(()=>t&&s&&s(r),[r,s,t]);return!n&&s?[!1,o]:[!0]}const Ge=t=>t.key||"";function Cr(t){const e=[];return x.Children.forEach(t,n=>{x.isValidElement(n)&&e.push(n)}),e}const Zx=({children:t,custom:e,initial:n=!0,onExitComplete:s,presenceAffectsLayout:i=!0,mode:r="sync",propagate:o=!1,anchorX:a="left",anchorY:c="top",root:u})=>{const[l,h]=Mc(o),f=x.useMemo(()=>Cr(t),[t]),d=o&&!l?[]:f.map(Ge),p=x.useRef(!0),m=x.useRef(f),g=Le(()=>new Map),y=x.useRef(new Set),[T,v]=x.useState(f),[w,S]=x.useState(f);yi(()=>{p.current=!1,m.current=f;for(let b=0;b<w.length;b++){const A=Ge(w[b]);d.includes(A)?(g.delete(A),y.current.delete(A)):g.get(A)!==!0&&g.set(A,!1)}},[w,d.length,d.join("-")]);const M=[];if(f!==T){let b=[...f];for(let A=0;A<w.length;A++){const P=w[A],$=Ge(P);d.includes($)||(b.splice(A,0,P),M.push(P))}return r==="wait"&&M.length&&(b=M),S(Cr(b)),v(f),null}const{forceRender:D}=x.useContext(gi);return Y.jsx(Y.Fragment,{children:w.map(b=>{const A=Ge(b),P=o&&!l?!1:f===w||d.includes(A),$=()=>{if(y.current.has(A))return;if(y.current.add(A),g.has(A))g.set(A,!0);else return;let E=!0;g.forEach(H=>{H||(E=!1)}),E&&(D?.(),S(m.current),o&&h?.(),s&&s())};return Y.jsx(Tm,{isPresent:P,initial:!p.current||n?void 0:!1,custom:e,presenceAffectsLayout:i,mode:r,root:u,onExitComplete:P?void 0:$,anchorX:a,anchorY:c,children:b},A)})})},Dc=x.createContext({strict:!1}),$r={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let Mr=!1;function Pm(){if(Mr)return;const t={};for(const e in $r)t[e]={isEnabled:n=>$r[e].some(s=>!!n[s])};oc(t),Mr=!0}function Ec(){return Pm(),lp()}function Sm(t){const e=Ec();for(const n in t)e[n]={...e[n],...t[n]};oc(e)}const bm=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function bn(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||bm.has(t)}let Rc=t=>!bn(t);function Am(t){typeof t=="function"&&(Rc=e=>e.startsWith("on")?!bn(e):t(e))}try{Am(require("@emotion/is-prop-valid").default)}catch{}function Vm(t,e,n){const s={};for(const i in t)i==="values"&&typeof t.values=="object"||(Rc(i)||n===!0&&bn(i)||!e&&!bn(i)||t.draggable&&i.startsWith("onDrag"))&&(s[i]=t[i]);return s}const On=x.createContext({});function Cm(t,e){if(Bn(t)){const{initial:n,animate:s}=t;return{initial:n===!1||Ce(n)?n:void 0,animate:Ce(s)?s:void 0}}return t.inherit!==!1?e:{}}function $m(t){const{initial:e,animate:n}=Cm(t,x.useContext(On));return x.useMemo(()=>({initial:e,animate:n}),[Dr(e),Dr(n)])}function Dr(t){return Array.isArray(t)?t.join(" "):t}const Hi=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Lc(t,e,n){for(const s in e)!X(e[s])&&!fc(s,n)&&(t[s]=e[s])}function Mm({transformTemplate:t},e){return x.useMemo(()=>{const n=Hi();return Wi(n,e,t),Object.assign({},n.vars,n.style)},[e])}function Dm(t,e){const n=t.style||{},s={};return Lc(s,n,t),Object.assign(s,Mm(t,e)),s}function Em(t,e){const n={},s=Dm(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=s,n}const kc=()=>({...Hi(),attrs:{}});function Rm(t,e,n,s){const i=x.useMemo(()=>{const r=kc();return dc(r,e,mc(s),t.transformTemplate,t.style),{...r.attrs,style:{...r.style}}},[e]);if(t.style){const r={};Lc(r,t.style,t),i.style={...r,...i.style}}return i}const Lm=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Gi(t){return typeof t!="string"||t.includes("-")?!1:!!(Lm.indexOf(t)>-1||/[A-Z]/u.test(t))}function km(t,e,n,{latestValues:s},i,r=!1,o){const c=(o??Gi(t)?Rm:Em)(e,s,i,t),u=Vm(e,typeof t=="string",r),l=t!==x.Fragment?{...u,...c,ref:n}:{},{children:h}=e,f=x.useMemo(()=>X(h)?h.get():h,[h]);return x.createElement(t,{...l,children:f})}function Im({scrapeMotionValuesFromProps:t,createRenderState:e},n,s,i){return{latestValues:Fm(n,s,i,t),renderState:e()}}function Fm(t,e,n,s){const i={},r=s(t,{});for(const f in r)i[f]=rn(r[f]);let{initial:o,animate:a}=t;const c=Bn(t),u=sc(t);e&&u&&!c&&t.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let l=n?n.initial===!1:!1;l=l||o===!1;const h=l?a:o;if(h&&typeof h!="boolean"&&!Fn(h)){const f=Array.isArray(h)?h:[h];for(let d=0;d<f.length;d++){const p=Li(t,f[d]);if(p){const{transitionEnd:m,transition:g,...y}=p;for(const T in y){let v=y[T];if(Array.isArray(v)){const w=l?v.length-1:0;v=v[w]}v!==null&&(i[T]=v)}for(const T in m)i[T]=m[T]}}}return i}const Ic=t=>(e,n)=>{const s=x.useContext(On),i=x.useContext(kn),r=()=>Im(t,e,s,i);return n?r():Le(r)},Bm=Ic({scrapeMotionValuesFromProps:Ki,createRenderState:Hi}),Om=Ic({scrapeMotionValuesFromProps:gc,createRenderState:kc}),jm=Symbol.for("motionComponentSymbol");function Nm(t,e,n){const s=x.useRef(n);x.useInsertionEffect(()=>{s.current=n});const i=x.useRef(null);return x.useCallback(r=>{r&&t.onMount?.(r);const o=s.current;if(typeof o=="function")if(r){const a=o(r);typeof a=="function"&&(i.current=a)}else i.current?(i.current(),i.current=null):o(r);else o&&(o.current=r);e&&(r?e.mount(r):e.unmount())},[e])}const Fc=x.createContext({});function zt(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Um(t,e,n,s,i,r){const{visualElement:o}=x.useContext(On),a=x.useContext(Dc),c=x.useContext(kn),u=x.useContext(Be),l=u.reducedMotion,h=u.skipAnimations,f=x.useRef(null),d=x.useRef(!1);s=s||a.renderer,!f.current&&s&&(f.current=s(t,{visualState:e,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:l,skipAnimations:h,isSVG:r}),d.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));const p=f.current,m=x.useContext(Fc);p&&!p.projection&&i&&(p.type==="html"||p.type==="svg")&&Wm(f.current,n,i,m);const g=x.useRef(!1);x.useInsertionEffect(()=>{p&&g.current&&p.update(n,c)});const y=n[Gl],T=x.useRef(!!y&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(y)&&window.MotionHasOptimisedAnimation?.(y));return yi(()=>{d.current=!0,p&&(g.current=!0,window.MotionIsMounted=!0,p.updateFeatures(),p.scheduleRenderMicrotask(),T.current&&p.animationState&&p.animationState.animateChanges())}),x.useEffect(()=>{p&&(!T.current&&p.animationState&&p.animationState.animateChanges(),T.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(y)}),T.current=!1),p.enteringChildren=void 0)}),p}function Wm(t,e,n,s){const{layoutId:i,layout:r,drag:o,dragConstraints:a,layoutScroll:c,layoutRoot:u,layoutCrossfade:l}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:Bc(t.parent)),t.projection.setOptions({layoutId:i,layout:r,alwaysMeasureLayout:!!o||a&&zt(a),visualElement:t,animationType:typeof r=="string"?r:"both",initialPromotionConfig:s,crossfade:l,layoutScroll:c,layoutRoot:u})}function Bc(t){if(t)return t.options.allowProjection!==!1?t.projection:Bc(t.parent)}function ns(t,{forwardMotionProps:e=!1,type:n}={},s,i){s&&Sm(s);const r=n?n==="svg":Gi(t),o=r?Om:Bm;function a(u,l){let h;const f={...x.useContext(Be),...u,layoutId:Km(u)},{isStatic:d}=f,p=$m(u),m=o(u,d);if(!d&&typeof window<"u"){Hm();const g=Gm(f);h=g.MeasureLayout,p.visualElement=Um(t,m,f,i,g.ProjectionNode,r)}return Y.jsxs(On.Provider,{value:p,children:[h&&p.visualElement?Y.jsx(h,{visualElement:p.visualElement,...f}):null,km(t,u,Nm(m,p.visualElement,l),m,d,e,r)]})}a.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const c=x.forwardRef(a);return c[jm]=t,c}function Km({layoutId:t}){const e=x.useContext(gi).id;return e&&t!==void 0?e+"-"+t:t}function Hm(t,e){x.useContext(Dc).strict}function Gm(t){const e=Ec(),{drag:n,layout:s}=e;if(!n&&!s)return{};const i={...n,...s};return{MeasureLayout:n?.isEnabled(t)||s?.isEnabled(t)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}function zm(t,e){if(typeof Proxy>"u")return ns;const n=new Map,s=(r,o)=>ns(r,o,t,e),i=(r,o)=>s(r,o);return new Proxy(i,{get:(r,o)=>o==="create"?s:(n.has(o)||n.set(o,ns(o,void 0,t,e)),n.get(o))})}const _m=(t,e)=>e.isSVG??Gi(t)?new Ap(e):new xp(e,{allowProjection:t!==x.Fragment});let Xm=class extends Rt{constructor(e){super(e),e.animationState||(e.animationState=Dp(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Fn(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},Ym=0,qm=class extends Rt{constructor(){super(...arguments),this.id=Ym++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===s)return;const i=this.node.animationState.setActive("exit",!e);n&&!e&&i.then(()=>{n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}};const Zm={animation:{Feature:Xm},exit:{Feature:qm}};function Oe(t){return{point:{x:t.pageX,y:t.pageY}}}const Jm=t=>e=>Oi(e)&&t(e,Oe(e));function Te(t,e,n,s){return $e(t,e,Jm(n),s)}const Oc=({current:t})=>t?t.ownerDocument.defaultView:null,Er=(t,e)=>Math.abs(t-e);function Qm(t,e){const n=Er(t.x,e.x),s=Er(t.y,e.y);return Math.sqrt(n**2+s**2)}const Rr=new Set(["auto","scroll"]);let jc=class{constructor(e,n,{transformPagePoint:s,contextWindow:i=window,dragSnapToOrigin:r=!1,distanceThreshold:o=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=d=>{this.handleScroll(d.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=ze(this.lastRawMoveEventInfo,this.transformPagePoint));const d=ss(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,m=Qm(d.offset,{x:0,y:0})>=this.distanceThreshold;if(!p&&!m)return;const{point:g}=d,{timestamp:y}=q;this.history.push({...g,timestamp:y});const{onStart:T,onMove:v}=this.handlers;p||(T&&T(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,d)},this.handlePointerMove=(d,p)=>{this.lastMoveEvent=d,this.lastRawMoveEventInfo=p,this.lastMoveEventInfo=ze(p,this.transformPagePoint),L.update(this.updatePoint,!0)},this.handlePointerUp=(d,p)=>{this.end();const{onEnd:m,onSessionEnd:g,resumeAnimation:y}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const T=ss(d.type==="pointercancel"?this.lastMoveEventInfo:ze(p,this.transformPagePoint),this.history);this.startEvent&&m&&m(d,T),g&&g(d,T)},!Oi(e))return;this.dragSnapToOrigin=r,this.handlers=n,this.transformPagePoint=s,this.distanceThreshold=o,this.contextWindow=i||window;const c=Oe(e),u=ze(c,this.transformPagePoint),{point:l}=u,{timestamp:h}=q;this.history=[{...l,timestamp:h}];const{onSessionStart:f}=n;f&&f(e,ss(u,this.history)),this.removeListeners=ke(Te(this.contextWindow,"pointermove",this.handlePointerMove),Te(this.contextWindow,"pointerup",this.handlePointerUp),Te(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(e){let n=e.parentElement;for(;n;){const s=getComputedStyle(n);(Rr.has(s.overflowX)||Rr.has(s.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const n=this.scrollPositions.get(e);if(!n)return;const s=e===window,i=s?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},r={x:i.x-n.x,y:i.y-n.y};r.x===0&&r.y===0||(s?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=r.x,this.lastMoveEventInfo.point.y+=r.y):this.history.length>0&&(this.history[0].x-=r.x,this.history[0].y-=r.y),this.scrollPositions.set(e,i),L.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),At(this.updatePoint)}};function ze(t,e){return e?{point:e(t.point)}:t}function Lr(t,e){return{x:t.x-e.x,y:t.y-e.y}}function ss({point:t},e){return{point:t,delta:Lr(t,Nc(e)),offset:Lr(t,tg(e)),velocity:eg(e,.1)}}function tg(t){return t[0]}function Nc(t){return t[t.length-1]}function eg(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const i=Nc(t);for(;n>=0&&(s=t[n],!(i.timestamp-s.timestamp>ot(e)));)n--;if(!s)return{x:0,y:0};s===t[0]&&t.length>2&&i.timestamp-s.timestamp>ot(e)*2&&(s=t[1]);const r=at(i.timestamp-s.timestamp);if(r===0)return{x:0,y:0};const o={x:(i.x-s.x)/r,y:(i.y-s.y)/r};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function ng(t,{min:e,max:n},s){return e!==void 0&&t<e?t=s?B(e,t,s.min):Math.max(t,e):n!==void 0&&t>n&&(t=s?B(n,t,s.max):Math.min(t,n)),t}function kr(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function sg(t,{top:e,left:n,bottom:s,right:i}){return{x:kr(t.x,n,i),y:kr(t.y,e,s)}}function Ir(t,e){let n=e.min-t.min,s=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,s]=[s,n]),{min:n,max:s}}function ig(t,e){return{x:Ir(t.x,e.x),y:Ir(t.y,e.y)}}function og(t,e){let n=.5;const s=et(t),i=et(e);return i>s?n=Ae(e.min,e.max-s,t.min):s>i&&(n=Ae(t.min,t.max-i,e.min)),Pt(0,1,n)}function rg(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const Hs=.35;function ag(t=Hs){return t===!1?t=0:t===!0&&(t=Hs),{x:Fr(t,"left","right"),y:Fr(t,"top","bottom")}}function Fr(t,e,n){return{min:Br(t,e),max:Br(t,n)}}function Br(t,e){return typeof t=="number"?t:t[e]||0}const lg=new WeakMap;let cg=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=z(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:s}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const r=h=>{n&&this.snapToCursor(Oe(h).point),this.stopAnimation()},o=(h,f)=>{const{drag:d,dragPropagation:p,onDragStart:m}=this.getProps();if(d&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Fd(d),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),yt(y=>{let T=this.getAxisMotionValue(y).get()||0;if(Tt.test(T)){const{projection:v}=this.visualElement;if(v&&v.layout){const w=v.layout.layoutBox[y];w&&(T=et(w)*(parseFloat(T)/100))}}this.originPoint[y]=T}),m&&L.update(()=>m(h,f),!1,!0),Fs(this.visualElement,"transform");const{animationState:g}=this.visualElement;g&&g.setActive("whileDrag",!0)},a=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f;const{dragPropagation:d,dragDirectionLock:p,onDirectionLock:m,onDrag:g}=this.getProps();if(!d&&!this.openDragLock)return;const{offset:y}=f;if(p&&this.currentDirection===null){this.currentDirection=hg(y),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",f.point,y),this.updateAxis("y",f.point,y),this.visualElement.render(),g&&L.update(()=>g(h,f),!1,!0)},c=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f,this.stop(h,f),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>{const{dragSnapToOrigin:h}=this.getProps();(h||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new jc(e,{onSessionStart:r,onStart:o,onMove:a,onSessionEnd:c,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:s,contextWindow:Oc(this.visualElement),element:this.visualElement.current})}stop(e,n){const s=e||this.latestPointerEvent,i=n||this.latestPanInfo,r=this.isDragging;if(this.cancel(),!r||!i||!s)return;const{velocity:o}=i;this.startAnimation(o);const{onDragEnd:a}=this.getProps();a&&L.postRender(()=>a(s,i))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,s){const{drag:i}=this.getProps();if(!s||!_e(e,i,this.currentDirection))return;const r=this.getAxisMotionValue(e);let o=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(o=ng(o,this.constraints[e],this.elastic[e])),r.set(o)}resolveConstraints(){const{dragConstraints:e,dragElastic:n}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;e&&zt(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&s?this.constraints=sg(s.layoutBox,e):this.constraints=!1,this.elastic=ag(n),i!==this.constraints&&!zt(e)&&s&&this.constraints&&!this.hasMutatedConstraints&&yt(r=>{this.constraints!==!1&&this.getAxisMotionValue(r)&&(this.constraints[r]=rg(s.layoutBox[r],this.constraints[r]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!zt(e))return!1;const s=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const r=dp(s,i.root,this.visualElement.getTransformPagePoint());let o=ig(i.layout.layoutBox,r);if(n){const a=n(up(o));this.hasMutatedConstraints=!!a,a&&(o=ac(a))}return o}startAnimation(e){const{drag:n,dragMomentum:s,dragElastic:i,dragTransition:r,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},u=yt(l=>{if(!_e(l,n,this.currentDirection))return;let h=c&&c[l]||{};o&&(h={min:0,max:0});const f=i?200:1e6,d=i?40:1e7,p={type:"inertia",velocity:s?e[l]:0,bounceStiffness:f,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...r,...h};return this.startAxisValueAnimation(l,p)});return Promise.all(u).then(a)}startAxisValueAnimation(e,n){const s=this.getAxisMotionValue(e);return Fs(this.visualElement,e),s.start(Ri(e,s,0,n,this.visualElement,!1))}stopAnimation(){yt(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,s=this.visualElement.getProps(),i=s[n];return i||this.visualElement.getValue(e,(s.initial?s.initial[e]:void 0)||0)}snapToCursor(e){yt(n=>{const{drag:s}=this.getProps();if(!_e(n,s,this.currentDirection))return;const{projection:i}=this.visualElement,r=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[n],c=r.get()||0;r.set(e[n]-B(o,a,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!zt(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};yt(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const c=a.get();i[o]=og({min:c,max:c},this.constraints[o])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.constraints=!1,this.resolveConstraints(),yt(o=>{if(!_e(o,e,null))return;const a=this.getAxisMotionValue(o),{min:c,max:u}=this.constraints[o];a.set(B(c,u,i[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;lg.set(this.visualElement,this);const e=this.visualElement.current,n=Te(e,"pointerdown",u=>{const{drag:l,dragListener:h=!0}=this.getProps(),f=u.target,d=f!==e&&Wd(f);l&&h&&!d&&this.start(u)});let s;const i=()=>{const{dragConstraints:u}=this.getProps();zt(u)&&u.current&&(this.constraints=this.resolveRefConstraints(),s||(s=ug(e,u.current,()=>this.scalePositionWithinConstraints())))},{projection:r}=this.visualElement,o=r.addEventListener("measure",i);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),L.read(i);const a=$e(window,"resize",()=>this.scalePositionWithinConstraints()),c=r.addEventListener("didUpdate",(({delta:u,hasLayoutChanged:l})=>{this.isDragging&&l&&(yt(h=>{const f=this.getAxisMotionValue(h);f&&(this.originPoint[h]+=u[h].translate,f.set(f.get()+u[h].translate))}),this.visualElement.render())}));return()=>{a(),n(),o(),c&&c(),s&&s()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:i=!1,dragConstraints:r=!1,dragElastic:o=Hs,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:s,dragPropagation:i,dragConstraints:r,dragElastic:o,dragMomentum:a}}};function Or(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function ug(t,e,n){const s=Wo(t,Or(n)),i=Wo(e,Or(n));return()=>{s(),i()}}function _e(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function hg(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}let fg=class extends Rt{constructor(e){super(e),this.removeGroupControls=ct,this.removeListeners=ct,this.controls=new cg(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ct}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}};const is=t=>(e,n)=>{t&&L.update(()=>t(e,n),!1,!0)};let dg=class extends Rt{constructor(){super(...arguments),this.removePointerDownListener=ct}onPointerDown(e){this.session=new jc(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Oc(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:is(e),onStart:is(n),onMove:is(s),onEnd:(r,o)=>{delete this.session,i&&L.postRender(()=>i(r,o))}}}mount(){this.removePointerDownListener=Te(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},os=!1,pg=class extends x.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s,layoutId:i}=this.props,{projection:r}=e;r&&(n.group&&n.group.add(r),s&&s.register&&i&&s.register(r),os&&r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),an.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:s,drag:i,isPresent:r}=this.props,{projection:o}=s;return o&&(o.isPresent=r,e.layoutDependency!==n&&o.setOptions({...o.options,layoutDependency:n}),os=!0,i||e.layoutDependency!==n||n===void 0||e.isPresent!==r?o.willUpdate():this.safeToRemove(),e.isPresent!==r&&(r?o.promote():o.relegate()||L.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),Bi.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:i}=e;os=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),s&&s.deregister&&s.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}};function Uc(t){const[e,n]=Mc(),s=x.useContext(gi);return Y.jsx(pg,{...t,layoutGroup:s,switchLayoutGroup:x.useContext(Fc),isPresent:e,safeToRemove:n})}const mg={pan:{Feature:dg},drag:{Feature:fg,ProjectionNode:$c,MeasureLayout:Uc}};function jr(t,e,n){const{props:s}=t;t.animationState&&s.whileHover&&t.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,r=s[i];r&&L.postRender(()=>r(e,Oe(e)))}let gg=class extends Rt{mount(){const{current:e}=this.node;e&&(this.unmount=Od(e,(n,s)=>(jr(this.node,s,"Start"),i=>jr(this.node,i,"End"))))}unmount(){}},yg=class extends Rt{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=ke($e(this.node.current,"focus",()=>this.onFocus()),$e(this.node.current,"blur",()=>this.onBlur()))}unmount(){}};function Nr(t,e,n){const{props:s}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&s.whileTap&&t.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),r=s[i];r&&L.postRender(()=>r(e,Oe(e)))}let vg=class extends Rt{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:s}=this.node.props;this.unmount=Hd(e,(i,r)=>(Nr(this.node,r,"Start"),(o,{success:a})=>Nr(this.node,o,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:s?.tap===!1})}unmount(){}};const Gs=new WeakMap,rs=new WeakMap,xg=t=>{const e=Gs.get(t.target);e&&e(t)},Tg=t=>{t.forEach(xg)};function wg({root:t,...e}){const n=t||document;rs.has(n)||rs.set(n,{});const s=rs.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(Tg,{root:t,...e})),s[i]}function Pg(t,e,n){const s=wg(e);return Gs.set(t,n),s.observe(t),()=>{Gs.delete(t),s.unobserve(t)}}const Sg={some:0,all:1};let bg=class extends Rt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:s,amount:i="some",once:r}=e,o={root:n?n.current:void 0,rootMargin:s,threshold:typeof i=="number"?i:Sg[i]},a=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,r&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:l,onViewportLeave:h}=this.node.getProps(),f=u?l:h;f&&f(c)};return Pg(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(Ag(e,n))&&this.startObserver()}unmount(){}};function Ag({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Vg={inView:{Feature:bg},tap:{Feature:vg},focus:{Feature:yg},hover:{Feature:gg}},Cg={layout:{ProjectionNode:$c,MeasureLayout:Uc}},$g={...Zm,...Vg,...mg,...Cg},cT=zm($g,_m);function Wc(t){const e=Le(()=>Gt(t)),{isStatic:n}=x.useContext(Be);if(n){const[,s]=x.useState(t);x.useEffect(()=>e.on("change",s),[])}return e}function Kc(t,e){const n=Wc(e()),s=()=>n.set(e());return s(),yi(()=>{const i=()=>L.preRender(s,!1,!0),r=t.map(o=>o.on("change",i));return()=>{r.forEach(o=>o()),At(s)}}),n}function Mg(t){ve.current=[],t();const e=Kc(ve.current,t);return ve.current=void 0,e}function Dg(t,e,n,s){if(typeof t=="function")return Mg(t);const r=typeof e=="function"?e:tp(e,n,s),o=Array.isArray(t)?Ur(t,r):Ur([t],([c])=>r(c)),a=Array.isArray(t)?void 0:t.accelerate;return a&&!a.isTransformed&&typeof e!="function"&&Array.isArray(n)&&s?.clamp!==!1&&(o.accelerate={...a,times:e,keyframes:n,isTransformed:!0}),o}function Ur(t,e){const n=Le(()=>[]);return Kc(t,()=>{n.length=0;const s=t.length;for(let i=0;i<s;i++)n[i]=t[i].get();return e(n)})}function Eg(t,e={}){const{isStatic:n}=x.useContext(Be),s=()=>X(t)?t.get():t;if(n)return Dg(s);const i=Wc(s());return x.useInsertionEffect(()=>ep(i,t,e),[i,JSON.stringify(e)]),i}function uT(t,e={}){return Eg(t,{type:"spring",...e})}const Rg={some:0,all:1};function Lg(t,e,{root:n,margin:s,amount:i="some"}={}){const r=Fi(t),o=new WeakMap,a=u=>{u.forEach(l=>{const h=o.get(l.target);if(l.isIntersecting!==!!h)if(l.isIntersecting){const f=e(l.target,l);typeof f=="function"?o.set(l.target,f):c.unobserve(l.target)}else typeof h=="function"&&(h(l),o.delete(l.target))})},c=new IntersectionObserver(a,{root:n,rootMargin:s,threshold:typeof i=="number"?i:Rg[i]});return r.forEach(u=>c.observe(u)),()=>c.disconnect()}function hT(t,{root:e,margin:n,amount:s,once:i=!1,initial:r=!1}={}){const[o,a]=x.useState(r);return x.useEffect(()=>{if(!t.current||i&&o)return;const c=()=>(a(!0),i?void 0:()=>a(!1)),u={root:e&&e.current||void 0,margin:n,amount:s};return Lg(t.current,c,u)},[e,t,n,i,s]),o}const zi=x.createContext({});function _i(t){const e=x.useRef(null);return e.current===null&&(e.current=t()),e.current}const kg=typeof window<"u",Hc=kg?x.useLayoutEffect:x.useEffect,jn=x.createContext(null);function Xi(t,e){t.indexOf(e)===-1&&t.push(e)}function An(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const St=(t,e,n)=>n>e?e:n<t?t:n;let Yi=()=>{};const Dt={},Gc=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function zc(t){return typeof t=="object"&&t!==null}const _c=t=>/^0[^.\s]+$/u.test(t);function Xc(t){let e;return()=>(e===void 0&&(e=t()),e)}const ut=t=>t,Ig=(t,e)=>n=>e(t(n)),je=(...t)=>t.reduce(Ig),Me=(t,e,n)=>{const s=e-t;return s===0?1:(n-t)/s};class qi{constructor(){this.subscriptions=[]}add(e){return Xi(this.subscriptions,e),()=>An(this.subscriptions,e)}notify(e,n,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,s);else for(let r=0;r<i;r++){const o=this.subscriptions[r];o&&o(e,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const rt=t=>t*1e3,lt=t=>t/1e3;function Yc(t,e){return e?t*(1e3/e):0}const qc=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Fg=1e-7,Bg=12;function Og(t,e,n,s,i){let r,o,a=0;do o=e+(n-e)/2,r=qc(o,s,i)-t,r>0?n=o:e=o;while(Math.abs(r)>Fg&&++a<Bg);return o}function Ne(t,e,n,s){if(t===e&&n===s)return ut;const i=r=>Og(r,0,1,t,n);return r=>r===0||r===1?r:qc(i(r),e,s)}const Zc=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Jc=t=>e=>1-t(1-e),Qc=Ne(.33,1.53,.69,.99),Zi=Jc(Qc),tu=Zc(Zi),eu=t=>t>=1?1:(t*=2)<1?.5*Zi(t):.5*(2-Math.pow(2,-10*(t-1))),Ji=t=>1-Math.sin(Math.acos(t)),nu=Jc(Ji),su=Zc(Ji),jg=Ne(.42,0,1,1),Ng=Ne(0,0,.58,1),iu=Ne(.42,0,.58,1),Ug=t=>Array.isArray(t)&&typeof t[0]!="number",ou=t=>Array.isArray(t)&&typeof t[0]=="number",Wg={linear:ut,easeIn:jg,easeInOut:iu,easeOut:Ng,circIn:Ji,circInOut:su,circOut:nu,backIn:Zi,backInOut:tu,backOut:Qc,anticipate:eu},Kg=t=>typeof t=="string",Wr=t=>{if(ou(t)){Yi(t.length===4);const[e,n,s,i]=t;return Ne(e,n,s,i)}else if(Kg(t))return Wg[t];return t},Xe=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Hg(t,e){let n=new Set,s=new Set,i=!1,r=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function c(l){o.has(l)&&(u.schedule(l),t()),l(a)}const u={schedule:(l,h=!1,f=!1)=>{const p=f&&i?n:s;return h&&o.add(l),p.add(l),l},cancel:l=>{s.delete(l),o.delete(l)},process:l=>{if(a=l,i){r=!0;return}i=!0;const h=n;n=s,s=h,n.forEach(c),n.clear(),i=!1,r&&(r=!1,u.process(l))}};return u}const Gg=40;function ru(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,o=Xe.reduce((v,w)=>(v[w]=Hg(r),v),{}),{setup:a,read:c,resolveKeyframes:u,preUpdate:l,update:h,preRender:f,render:d,postRender:p}=o,m=()=>{const v=Dt.useManualTiming,w=v?i.timestamp:performance.now();n=!1,v||(i.delta=s?1e3/60:Math.max(Math.min(w-i.timestamp,Gg),1)),i.timestamp=w,i.isProcessing=!0,a.process(i),c.process(i),u.process(i),l.process(i),h.process(i),f.process(i),d.process(i),p.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(m))},g=()=>{n=!0,s=!0,i.isProcessing||t(m)};return{schedule:Xe.reduce((v,w)=>{const S=o[w];return v[w]=(M,D=!1,b=!1)=>(n||g(),S.schedule(M,D,b)),v},{}),cancel:v=>{for(let w=0;w<Xe.length;w++)o[Xe[w]].cancel(v)},state:i,steps:o}}const{schedule:k,cancel:Et,state:Z,steps:as}=ru(typeof requestAnimationFrame<"u"?requestAnimationFrame:ut,!0);let ln;function zg(){ln=void 0}const nt={now:()=>(ln===void 0&&nt.set(Z.isProcessing||Dt.useManualTiming?Z.timestamp:performance.now()),ln),set:t=>{ln=t,queueMicrotask(zg)}},au=t=>e=>typeof e=="string"&&e.startsWith(t),lu=au("--"),_g=au("var(--"),Qi=t=>_g(t)?Xg.test(t.split("/*")[0].trim()):!1,Xg=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Kr(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const ce={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},De={...ce,transform:t=>St(0,1,t)},Ye={...ce,default:1},we=t=>Math.round(t*1e5)/1e5,to=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Yg(t){return t==null}const qg=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,eo=(t,e)=>n=>!!(typeof n=="string"&&qg.test(n)&&n.startsWith(t)||e&&!Yg(n)&&Object.prototype.hasOwnProperty.call(n,e)),cu=(t,e,n)=>s=>{if(typeof s!="string")return s;const[i,r,o,a]=s.match(to);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Zg=t=>St(0,255,t),ls={...ce,transform:t=>Math.round(Zg(t))},Nt={test:eo("rgb","red"),parse:cu("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+ls.transform(t)+", "+ls.transform(e)+", "+ls.transform(n)+", "+we(De.transform(s))+")"};function Jg(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const zs={test:eo("#"),parse:Jg,transform:Nt.transform},Ue=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Ct=Ue("deg"),wt=Ue("%"),C=Ue("px"),Qg=Ue("vh"),ty=Ue("vw"),Hr={...wt,parse:t=>wt.parse(t)/100,transform:t=>wt.transform(t*100)},Qt={test:eo("hsl","hue"),parse:cu("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+wt.transform(we(e))+", "+wt.transform(we(n))+", "+we(De.transform(s))+")"},K={test:t=>Nt.test(t)||zs.test(t)||Qt.test(t),parse:t=>Nt.test(t)?Nt.parse(t):Qt.test(t)?Qt.parse(t):zs.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Nt.transform(t):Qt.transform(t),getAnimatableNone:t=>{const e=K.parse(t);return e.alpha=0,K.transform(e)}},ey=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function ny(t){return isNaN(t)&&typeof t=="string"&&(t.match(to)?.length||0)+(t.match(ey)?.length||0)>0}const uu="number",hu="color",sy="var",iy="var(",Gr="${}",oy=/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 ie(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const a=e.replace(oy,c=>(K.test(c)?(s.color.push(r),i.push(hu),n.push(K.parse(c))):c.startsWith(iy)?(s.var.push(r),i.push(sy),n.push(c)):(s.number.push(r),i.push(uu),n.push(parseFloat(c))),++r,Gr)).split(Gr);return{values:n,split:a,indexes:s,types:i}}function ry(t){return ie(t).values}function fu({split:t,types:e}){const n=t.length;return s=>{let i="";for(let r=0;r<n;r++)if(i+=t[r],s[r]!==void 0){const o=e[r];o===uu?i+=we(s[r]):o===hu?i+=K.transform(s[r]):i+=s[r]}return i}}function ay(t){return fu(ie(t))}const ly=t=>typeof t=="number"?0:K.test(t)?K.getAnimatableNone(t):t,cy=(t,e)=>typeof t=="number"?e?.trim().endsWith("/")?t:0:ly(t);function uy(t){const e=ie(t);return fu(e)(e.values.map((s,i)=>cy(s,e.split[i])))}const gt={test:ny,parse:ry,createTransformer:ay,getAnimatableNone:uy};function cs(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function hy({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,e/=100,n/=100;let i=0,r=0,o=0;if(!e)i=r=o=n;else{const a=n<.5?n*(1+e):n+e-n*e,c=2*n-a;i=cs(c,a,t+1/3),r=cs(c,a,t),o=cs(c,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(r*255),blue:Math.round(o*255),alpha:s}}function Vn(t,e){return n=>n>0?e:t}const F=(t,e,n)=>t+(e-t)*n,us=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},fy=[zs,Nt,Qt],dy=t=>fy.find(e=>e.test(t));function zr(t){const e=dy(t);if(!e)return!1;let n=e.parse(t);return e===Qt&&(n=hy(n)),n}const _r=(t,e)=>{const n=zr(t),s=zr(e);if(!n||!s)return Vn(t,e);const i={...n};return r=>(i.red=us(n.red,s.red,r),i.green=us(n.green,s.green,r),i.blue=us(n.blue,s.blue,r),i.alpha=F(n.alpha,s.alpha,r),Nt.transform(i))},_s=new Set(["none","hidden"]);function py(t,e){return _s.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function my(t,e){return n=>F(t,e,n)}function no(t){return typeof t=="number"?my:typeof t=="string"?Qi(t)?Vn:K.test(t)?_r:vy:Array.isArray(t)?du:typeof t=="object"?K.test(t)?_r:gy:Vn}function du(t,e){const n=[...t],s=n.length,i=t.map((r,o)=>no(r)(r,e[o]));return r=>{for(let o=0;o<s;o++)n[o]=i[o](r);return n}}function gy(t,e){const n={...t,...e},s={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(s[i]=no(t[i])(t[i],e[i]));return i=>{for(const r in s)n[r]=s[r](i);return n}}function yy(t,e){const n=[],s={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const r=e.types[i],o=t.indexes[r][s[r]],a=t.values[o]??0;n[i]=a,s[r]++}return n}const vy=(t,e)=>{const n=gt.createTransformer(e),s=ie(t),i=ie(e);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?_s.has(t)&&!i.values.length||_s.has(e)&&!s.values.length?py(t,e):je(du(yy(s,i),i.values),n):Vn(t,e)};function pu(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?F(t,e,n):no(t)(t,e)}const xy=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>k.update(e,n),stop:()=>Et(e),now:()=>Z.isProcessing?Z.timestamp:nt.now()}},mu=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let r=0;r<i;r++)s+=Math.round(t(r/(i-1))*1e4)/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},Cn=2e4;function so(t){let e=0;const n=50;let s=t.next(e);for(;!s.done&&e<Cn;)e+=n,s=t.next(e);return e>=Cn?1/0:e}function Ty(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(so(s),Cn);return{type:"keyframes",ease:r=>s.next(i*r).value/e,duration:lt(i)}}const j={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Xs(t,e){return t*Math.sqrt(1-e*e)}const wy=12;function Py(t,e,n){let s=n;for(let i=1;i<wy;i++)s=s-t(s)/e(s);return s}const hs=.001;function Sy({duration:t=j.duration,bounce:e=j.bounce,velocity:n=j.velocity,mass:s=j.mass}){let i,r,o=1-e;o=St(j.minDamping,j.maxDamping,o),t=St(j.minDuration,j.maxDuration,lt(t)),o<1?(i=u=>{const l=u*o,h=l*t,f=l-n,d=Xs(u,o),p=Math.exp(-h);return hs-f/d*p},r=u=>{const h=u*o*t,f=h*n+n,d=Math.pow(o,2)*Math.pow(u,2)*t,p=Math.exp(-h),m=Xs(Math.pow(u,2),o);return(-i(u)+hs>0?-1:1)*((f-d)*p)/m}):(i=u=>{const l=Math.exp(-u*t),h=(u-n)*t+1;return-hs+l*h},r=u=>{const l=Math.exp(-u*t),h=(n-u)*(t*t);return l*h});const a=5/t,c=Py(i,r,a);if(t=rt(t),isNaN(c))return{stiffness:j.stiffness,damping:j.damping,duration:t};{const u=Math.pow(c,2)*s;return{stiffness:u,damping:o*2*Math.sqrt(s*u),duration:t}}}const by=["duration","bounce"],Ay=["stiffness","damping","mass"];function Xr(t,e){return e.some(n=>t[n]!==void 0)}function Vy(t){let e={velocity:j.velocity,stiffness:j.stiffness,damping:j.damping,mass:j.mass,isResolvedFromDuration:!1,...t};if(!Xr(t,Ay)&&Xr(t,by))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,r=2*St(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:j.mass,stiffness:i,damping:r}}else{const n=Sy({...t,velocity:0});e={...e,...n,mass:j.mass},e.isResolvedFromDuration=!0}return e}function $n(t=j.visualDuration,e=j.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const r=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:c,damping:u,mass:l,duration:h,velocity:f,isResolvedFromDuration:d}=Vy({...n,velocity:-lt(n.velocity||0)}),p=f||0,m=u/(2*Math.sqrt(c*l)),g=o-r,y=lt(Math.sqrt(c/l)),T=Math.abs(g)<5;s||(s=T?j.restSpeed.granular:j.restSpeed.default),i||(i=T?j.restDelta.granular:j.restDelta.default);let v,w,S,M,D,b;if(m<1)S=Xs(y,m),M=(p+m*y*g)/S,v=P=>{const $=Math.exp(-m*y*P);return o-$*(M*Math.sin(S*P)+g*Math.cos(S*P))},D=m*y*M+g*S,b=m*y*g-M*S,w=P=>Math.exp(-m*y*P)*(D*Math.sin(S*P)+b*Math.cos(S*P));else if(m===1){v=$=>o-Math.exp(-y*$)*(g+(p+y*g)*$);const P=p+y*g;w=$=>Math.exp(-y*$)*(y*P*$-p)}else{const P=y*Math.sqrt(m*m-1);v=N=>{const G=Math.exp(-m*y*N),U=Math.min(P*N,300);return o-G*((p+m*y*g)*Math.sinh(U)+P*g*Math.cosh(U))/P};const $=(p+m*y*g)/P,E=m*y*$-g*P,H=m*y*g-$*P;w=N=>{const G=Math.exp(-m*y*N),U=Math.min(P*N,300);return G*(E*Math.sinh(U)+H*Math.cosh(U))}}const A={calculatedDuration:d&&h||null,velocity:P=>rt(w(P)),next:P=>{if(!d&&m<1){const E=Math.exp(-m*y*P),H=Math.sin(S*P),N=Math.cos(S*P),G=o-E*(M*H+g*N),U=rt(E*(D*H+b*N));return a.done=Math.abs(U)<=s&&Math.abs(o-G)<=i,a.value=a.done?o:G,a}const $=v(P);if(d)a.done=P>=h;else{const E=rt(w(P));a.done=Math.abs(E)<=s&&Math.abs(o-$)<=i}return a.value=a.done?o:$,a},toString:()=>{const P=Math.min(so(A),Cn),$=mu(E=>A.next(P*E).value,P,30);return P+"ms "+$},toTransition:()=>{}};return A}$n.applyToOptions=t=>{const e=Ty(t,100,$n);return t.ease=e.ease,t.duration=rt(e.duration),t.type="keyframes",t};const Cy=5;function gu(t,e,n){const s=Math.max(e-Cy,0);return Yc(n-t(s),e-s)}function Ys({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:c,restDelta:u=.5,restSpeed:l}){const h=t[0],f={done:!1,value:h},d=b=>a!==void 0&&b<a||c!==void 0&&b>c,p=b=>a===void 0?c:c===void 0||Math.abs(a-b)<Math.abs(c-b)?a:c;let m=n*e;const g=h+m,y=o===void 0?g:o(g);y!==g&&(m=y-h);const T=b=>-m*Math.exp(-b/s),v=b=>y+T(b),w=b=>{const A=T(b),P=v(b);f.done=Math.abs(A)<=u,f.value=f.done?y:P};let S,M;const D=b=>{d(f.value)&&(S=b,M=$n({keyframes:[f.value,p(f.value)],velocity:gu(v,b,f.value),damping:i,stiffness:r,restDelta:u,restSpeed:l}))};return D(0),{calculatedDuration:null,next:b=>{let A=!1;return!M&&S===void 0&&(A=!0,w(b),D(b)),S!==void 0&&b>=S?M.next(b-S):(!A&&w(b),f)}}}function $y(t,e,n){const s=[],i=n||Dt.mix||pu,r=t.length-1;for(let o=0;o<r;o++){let a=i(t[o],t[o+1]);if(e){const c=Array.isArray(e)?e[o]||ut:e;a=je(c,a)}s.push(a)}return s}function My(t,e,{clamp:n=!0,ease:s,mixer:i}={}){const r=t.length;if(Yi(r===e.length),r===1)return()=>e[0];if(r===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[r-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=$y(e,s,i),c=a.length,u=l=>{if(o&&l<t[0])return e[0];let h=0;if(c>1)for(;h<t.length-2&&!(l<t[h+1]);h++);const f=Me(t[h],t[h+1],l);return a[h](f)};return n?l=>u(St(t[0],t[r-1],l)):u}function Dy(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=Me(0,e,s);t.push(F(n,1,i))}}function Ey(t){const e=[0];return Dy(e,t.length-1),e}function Ry(t,e){return t.map(n=>n*e)}function Ly(t,e){return t.map(()=>e||iu).splice(0,t.length-1)}function Pe({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=Ug(s)?s.map(Wr):Wr(s),r={done:!1,value:e[0]},o=Ry(n&&n.length===e.length?n:Ey(e),t),a=My(o,e,{ease:Array.isArray(i)?i:Ly(e,i)});return{calculatedDuration:t,next:c=>(r.value=a(c),r.done=c>=t,r)}}const ky=t=>t!==null;function Nn(t,{repeat:e,repeatType:n="loop"},s,i=1){const r=t.filter(ky),a=i<0||e&&n!=="loop"&&e%2===1?0:r.length-1;return!a||s===void 0?r[a]:s}const Iy={decay:Ys,inertia:Ys,tween:Pe,keyframes:Pe,spring:$n};function yu(t){typeof t.type=="string"&&(t.type=Iy[t.type])}class io{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const Fy=t=>t/100;class Mn extends io{constructor(e){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:n}=this.options;n&&n.updatedAt!==nt.now()&&this.tick(nt.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;yu(e);const{type:n=Pe,repeat:s=0,repeatDelay:i=0,repeatType:r,velocity:o=0}=e;let{keyframes:a}=e;const c=n||Pe;c!==Pe&&typeof a[0]!="number"&&(this.mixKeyframes=je(Fy,pu(a[0],a[1])),a=[0,100]);const u=c({...e,keyframes:a});r==="mirror"&&(this.mirroredGenerator=c({...e,keyframes:[...a].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=so(u));const{calculatedDuration:l}=u;this.calculatedDuration=l,this.resolvedDuration=l+i,this.totalDuration=this.resolvedDuration*(s+1)-i,this.generator=u}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:s,totalDuration:i,mixKeyframes:r,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:c}=this;if(this.startTime===null)return s.next(0);const{delay:u=0,keyframes:l,repeat:h,repeatType:f,repeatDelay:d,type:p,onUpdate:m,finalKeyframe:g}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-i/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const y=this.currentTime-u*(this.playbackSpeed>=0?1:-1),T=this.playbackSpeed>=0?y<0:y>i;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let v=this.currentTime,w=s;if(h){const b=Math.min(this.currentTime,i)/a;let A=Math.floor(b),P=b%1;!P&&b>=1&&(P=1),P===1&&A--,A=Math.min(A,h+1),A%2&&(f==="reverse"?(P=1-P,d&&(P-=d/a)):f==="mirror"&&(w=o)),v=St(0,1,P)*a}let S;T?(this.delayState.value=l[0],S=this.delayState):S=w.next(v),r&&!T&&(S.value=r(S.value));let{done:M}=S;!T&&c!==null&&(M=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const D=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&M);return D&&p!==Ys&&(S.value=Nn(l,this.options,g,this.speed)),m&&m(S.value),D&&this.finish(),S}then(e,n){return this.finished.then(e,n)}get duration(){return lt(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+lt(e)}get time(){return lt(this.currentTime)}set time(e){e=rt(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);const n=this.generator.next(e).value;return gu(s=>this.generator.next(s).value,e,n)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;n&&this.driver&&this.updateTime(nt.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=lt(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=xy,startTime:n}=this.options;this.driver||(this.driver=e(i=>this.tick(i))),this.options.onPlay?.();const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=n??s),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(nt.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&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(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}function By(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const Ut=t=>t*180/Math.PI,qs=t=>{const e=Ut(Math.atan2(t[1],t[0]));return Zs(e)},Oy={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:qs,rotateZ:qs,skewX:t=>Ut(Math.atan(t[1])),skewY:t=>Ut(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Zs=t=>(t=t%360,t<0&&(t+=360),t),Yr=qs,qr=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Zr=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),jy={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:qr,scaleY:Zr,scale:t=>(qr(t)+Zr(t))/2,rotateX:t=>Zs(Ut(Math.atan2(t[6],t[5]))),rotateY:t=>Zs(Ut(Math.atan2(-t[2],t[0]))),rotateZ:Yr,rotate:Yr,skewX:t=>Ut(Math.atan(t[4])),skewY:t=>Ut(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Js(t){return t.includes("scale")?1:0}function Qs(t,e){if(!t||t==="none")return Js(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=jy,i=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=Oy,i=a}if(!i)return Js(e);const r=s[e],o=i[1].split(",").map(Uy);return typeof r=="function"?r(o):o[r]}const Ny=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Qs(n,e)};function Uy(t){return parseFloat(t.trim())}const ue=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],he=new Set(ue),Jr=t=>t===ce||t===C,Wy=new Set(["x","y","z"]),Ky=ue.filter(t=>!Wy.has(t));function Hy(t){const e=[];return Ky.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}const Mt={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:s})=>{const i=t.max-t.min;return s==="border-box"?i:i-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:s})=>{const i=t.max-t.min;return s==="border-box"?i:i-parseFloat(e)-parseFloat(n)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>Qs(e,"x"),y:(t,{transform:e})=>Qs(e,"y")};Mt.translateX=Mt.x;Mt.translateY=Mt.y;const Kt=new Set;let ti=!1,ei=!1,ni=!1;function vu(){if(ei){const t=Array.from(Kt).filter(s=>s.needsMeasurement),e=new Set(t.map(s=>s.element)),n=new Map;e.forEach(s=>{const i=Hy(s);i.length&&(n.set(s,i),s.render())}),t.forEach(s=>s.measureInitialState()),e.forEach(s=>{s.render();const i=n.get(s);i&&i.forEach(([r,o])=>{s.getValue(r)?.set(o)})}),t.forEach(s=>s.measureEndState()),t.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}ei=!1,ti=!1,Kt.forEach(t=>t.complete(ni)),Kt.clear()}function xu(){Kt.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(ei=!0)})}function Gy(){ni=!0,xu(),vu(),ni=!1}class oo{constructor(e,n,s,i,r,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=s,this.motionValue=i,this.element=r,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(Kt.add(this),ti||(ti=!0,k.read(xu),k.resolveKeyframes(vu))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:s,motionValue:i}=this;if(e[0]===null){const r=i?.get(),o=e[e.length-1];if(r!==void 0)e[0]=r;else if(s&&n){const a=s.readValue(n,o);a!=null&&(e[0]=a)}e[0]===void 0&&(e[0]=o),i&&r===void 0&&i.set(e[0])}By(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Kt.delete(this)}cancel(){this.state==="scheduled"&&(Kt.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const zy=t=>t.startsWith("--");function Tu(t,e,n){zy(e)?t.style.setProperty(e,n):t.style[e]=n}const _y={};function wu(t,e){const n=Xc(t);return()=>_y[e]??n()}const Xy=wu(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Pu=wu(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),me=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,Qr={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:me([0,.65,.55,1]),circOut:me([.55,0,1,.45]),backIn:me([.31,.01,.66,-.59]),backOut:me([.33,1.53,.69,.99])};function Su(t,e){if(t)return typeof t=="function"?Pu()?mu(t,e):"ease-out":ou(t)?me(t):Array.isArray(t)?t.map(n=>Su(n,e)||Qr.easeOut):Qr[t]}function Yy(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:o="loop",ease:a="easeOut",times:c}={},u=void 0){const l={[e]:n};c&&(l.offset=c);const h=Su(a,i);Array.isArray(h)&&(l.easing=h);const f={delay:s,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:r+1,direction:o==="reverse"?"alternate":"normal"};return u&&(f.pseudoElement=u),t.animate(l,f)}function bu(t){return typeof t=="function"&&"applyToOptions"in t}function qy({type:t,...e}){return bu(t)&&Pu()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class Au extends io{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:s,keyframes:i,pseudoElement:r,allowFlatten:o=!1,finalKeyframe:a,onComplete:c}=e;this.isPseudoElement=!!r,this.allowFlatten=o,this.options=e,Yi(typeof e.type!="string");const u=qy(e);this.animation=Yy(n,s,i,u,r),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const l=Nn(i,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(l),Tu(n,s,l),this.animation.cancel()}c?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return lt(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+lt(e)}get time(){return lt(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=rt(e),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:n,rangeEnd:s,observe:i}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&Xy()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),s&&(this.animation.rangeEnd=s),ut):i(this)}}const Vu={anticipate:eu,backInOut:tu,circInOut:su};function Zy(t){return t in Vu}function Jy(t){typeof t.ease=="string"&&Zy(t.ease)&&(t.ease=Vu[t.ease])}const fs=10;class Qy extends Au{constructor(e){Jy(e),yu(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:s,onComplete:i,element:r,...o}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const a=new Mn({...o,autoplay:!1}),c=Math.max(fs,nt.now()-this.startTime),u=St(0,fs,c-fs),l=a.sample(c).value,{name:h}=this.options;r&&h&&Tu(r,h,l),n.setWithVelocity(a.sample(Math.max(0,c-u)).value,l,u),a.stop()}}const ta=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(gt.test(t)||t==="0")&&!t.startsWith("url("));function tv(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function ev(t,e,n,s){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const r=t[t.length-1],o=ta(i,e),a=ta(r,e);return!o||!a?!1:tv(t)||(n==="spring"||bu(n))&&s}function si(t){t.duration=0,t.type="keyframes"}const Cu=new Set(["opacity","clipPath","filter","transform"]),nv=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function sv(t){for(let e=0;e<t.length;e++)if(typeof t[e]=="string"&&nv.test(t[e]))return!0;return!1}const iv=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),ov=Xc(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function rv(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:r,type:o,keyframes:a}=t;if(!(e?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:u,transformTemplate:l}=e.owner.getProps();return ov()&&n&&(Cu.has(n)||iv.has(n)&&sv(a))&&(n!=="transform"||!l)&&!u&&!s&&i!=="mirror"&&r!==0&&o!=="inertia"}const av=40;class lv extends io{constructor({autoplay:e=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:o="loop",keyframes:a,name:c,motionValue:u,element:l,...h}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=nt.now();const f={autoplay:e,delay:n,type:s,repeat:i,repeatDelay:r,repeatType:o,name:c,motionValue:u,element:l,...h},d=l?.KeyframeResolver||oo;this.keyframeResolver=new d(a,(p,m,g)=>this.onKeyframesResolved(p,m,f,!g),c,u,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,s,i){this.keyframeResolver=void 0;const{name:r,type:o,velocity:a,delay:c,isHandoff:u,onUpdate:l}=s;this.resolvedAt=nt.now();let h=!0;ev(e,r,o,a)||(h=!1,(Dt.instantAnimations||!c)&&l?.(Nn(e,s,n)),e[0]=e[e.length-1],si(s),s.repeat=0);const d={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>av?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:e},p=h&&!u&&rv(d),m=d.motionValue?.owner?.current;let g;if(p)try{g=new Qy({...d,element:m})}catch{g=new Mn(d)}else g=new Mn(d);g.finished.then(()=>{this.notifyFinished()}).catch(ut),this.pendingTimeline&&(this.stopTimeline=g.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=g}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Gy()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function $u(t,e,n,s=0,i=1){const r=Array.from(t).sort((u,l)=>u.sortNodePosition(l)).indexOf(e),o=t.size,a=(o-1)*s;return typeof n=="function"?n(r,o):i===1?r*s:a-r*s}const cv=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function uv(t){const e=cv.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}function Mu(t,e,n=1){const[s,i]=uv(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);if(r){const o=r.trim();return Gc(o)?parseFloat(o):o}return Qi(i)?Mu(i,e,n+1):i}const hv={type:"spring",stiffness:500,damping:25,restSpeed:10},fv=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),dv={type:"keyframes",duration:.8},pv={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},mv=(t,{keyframes:e})=>e.length>2?dv:he.has(t)?t.startsWith("scale")?fv(e[1]):hv:pv;function Du(t,e){if(t?.inherit&&e){const{inherit:n,...s}=t;return{...e,...s}}return t}function ro(t,e){const n=t?.[e]??t?.default??t;return n!==t?Du(n,t):n}const gv=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function yv(t){for(const e in t)if(!gv.has(e))return!0;return!1}const ao=(t,e,n,s={},i,r)=>o=>{const a=ro(s,t)||{},c=a.delay||s.delay||0;let{elapsed:u=0}=s;u=u-rt(c);const l={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:f=>{e.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:r?void 0:i};yv(a)||Object.assign(l,mv(t,l)),l.duration&&(l.duration=rt(l.duration)),l.repeatDelay&&(l.repeatDelay=rt(l.repeatDelay)),l.from!==void 0&&(l.keyframes[0]=l.from);let h=!1;if((l.type===!1||l.duration===0&&!l.repeatDelay)&&(si(l),l.delay===0&&(h=!0)),(Dt.instantAnimations||Dt.skipAnimations||i?.shouldSkipAnimations)&&(h=!0,si(l),l.delay=0),l.allowFlatten=!a.type&&!a.ease,h&&!r&&e.get()!==void 0){const f=Nn(l.keyframes,a);if(f!==void 0){k.update(()=>{l.onUpdate(f),l.onComplete()});return}}return a.isSync?new Mn(l):new lv(l)};function ea(t){const e=[{},{}];return t?.values.forEach((n,s)=>{e[0][s]=n.get(),e[1][s]=n.getVelocity()}),e}function lo(t,e,n,s){if(typeof e=="function"){const[i,r]=ea(s);e=e(n!==void 0?n:t.custom,i,r)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,r]=ea(s);e=e(n!==void 0?n:t.custom,i,r)}return e}function Ht(t,e,n){const s=t.getProps();return lo(s,e,n!==void 0?n:s.custom,t)}const Eu=new Set(["width","height","top","left","right","bottom",...ue]),na=30,vv=t=>!isNaN(parseFloat(t));class xv{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{const i=nt.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const r of this.dependents)r.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=nt.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=vv(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new qi);const s=this.events[e].add(n);return e==="change"?()=>{s(),k.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-s}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=nt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>na)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,na);return Yc(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function oe(t,e){return new xv(t,e)}const ii=t=>Array.isArray(t);function Tv(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,oe(n))}function wv(t){return ii(t)?t[t.length-1]||0:t}function Pv(t,e){const n=Ht(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const o in r){const a=wv(r[o]);Tv(t,o,a)}}const J=t=>!!(t&&t.getVelocity);function Sv(t){return!!(J(t)&&t.add)}function oi(t,e){const n=t.getValue("willChange");if(Sv(n))return n.add(e);if(!n&&Dt.WillChange){const s=new Dt.WillChange("auto");t.addValue("willChange",s),s.add(e)}}function co(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const bv="framerAppearId",Ru="data-"+co(bv);function Lu(t){return t.props[Ru]}function Av({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function ku(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:r,transitionEnd:o,...a}=e;const c=t.getDefaultTransition();r=r?Du(r,c):c;const u=r?.reduceMotion;s&&(r=s);const l=[],h=i&&t.animationState&&t.animationState.getState()[i];for(const f in a){const d=t.getValue(f,t.latestValues[f]??null),p=a[f];if(p===void 0||h&&Av(h,f))continue;const m={delay:n,...ro(r||{},f)},g=d.get();if(g!==void 0&&!d.isAnimating()&&!Array.isArray(p)&&p===g&&!m.velocity){k.update(()=>d.set(p));continue}let y=!1;if(window.MotionHandoffAnimation){const w=Lu(t);if(w){const S=window.MotionHandoffAnimation(w,f,k);S!==null&&(m.startTime=S,y=!0)}}oi(t,f);const T=u??t.shouldReduceMotion;d.start(ao(f,d,p,T&&Eu.has(f)?{type:!1}:m,t,y));const v=d.animation;v&&l.push(v)}if(o){const f=()=>k.update(()=>{o&&Pv(t,o)});l.length?Promise.all(l).then(f):f()}return l}function ri(t,e,n={}){const s=Ht(t,e,n.type==="exit"?t.presenceContext?.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const r=s?()=>Promise.all(ku(t,s,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:l,staggerDirection:h}=i;return Vv(t,e,c,u,l,h,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[c,u]=a==="beforeChildren"?[r,o]:[o,r];return c().then(()=>u())}else return Promise.all([r(),o(n.delay)])}function Vv(t,e,n=0,s=0,i=0,r=1,o){const a=[];for(const c of t.variantChildren)c.notify("AnimationStart",e),a.push(ri(c,e,{...o,delay:n+(typeof s=="function"?0:s)+$u(t.variantChildren,c,s,i,r)}).then(()=>c.notify("AnimationComplete",e)));return Promise.all(a)}function Cv(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(r=>ri(t,r,n));s=Promise.all(i)}else if(typeof e=="string")s=ri(t,e,n);else{const i=typeof e=="function"?Ht(t,e,n.custom):e;s=Promise.all(ku(t,i,n))}return s.then(()=>{t.notify("AnimationComplete",e)})}const $v={test:t=>t==="auto",parse:t=>t},Iu=t=>e=>e.test(t),Fu=[ce,C,wt,Ct,ty,Qg,$v],sa=t=>Fu.find(Iu(t));function Mv(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||_c(t):!0}const Dv=new Set(["brightness","contrast","saturate","opacity"]);function Ev(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(to)||[];if(!s)return t;const i=n.replace(s,"");let r=Dv.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const Rv=/\b([a-z-]*)\(.*?\)/gu,ai={...gt,getAnimatableNone:t=>{const e=t.match(Rv);return e?e.map(Ev).join(" "):t}},li={...gt,getAnimatableNone:t=>{const e=gt.parse(t);return gt.createTransformer(t)(e.map(s=>typeof s=="number"?0:typeof s=="object"?{...s,alpha:1}:s))}},ia={...ce,transform:Math.round},Lv={rotate:Ct,rotateX:Ct,rotateY:Ct,rotateZ:Ct,scale:Ye,scaleX:Ye,scaleY:Ye,scaleZ:Ye,skew:Ct,skewX:Ct,skewY:Ct,distance:C,translateX:C,translateY:C,translateZ:C,x:C,y:C,z:C,perspective:C,transformPerspective:C,opacity:De,originX:Hr,originY:Hr,originZ:C},uo={borderWidth:C,borderTopWidth:C,borderRightWidth:C,borderBottomWidth:C,borderLeftWidth:C,borderRadius:C,borderTopLeftRadius:C,borderTopRightRadius:C,borderBottomRightRadius:C,borderBottomLeftRadius:C,width:C,maxWidth:C,height:C,maxHeight:C,top:C,right:C,bottom:C,left:C,inset:C,insetBlock:C,insetBlockStart:C,insetBlockEnd:C,insetInline:C,insetInlineStart:C,insetInlineEnd:C,padding:C,paddingTop:C,paddingRight:C,paddingBottom:C,paddingLeft:C,paddingBlock:C,paddingBlockStart:C,paddingBlockEnd:C,paddingInline:C,paddingInlineStart:C,paddingInlineEnd:C,margin:C,marginTop:C,marginRight:C,marginBottom:C,marginLeft:C,marginBlock:C,marginBlockStart:C,marginBlockEnd:C,marginInline:C,marginInlineStart:C,marginInlineEnd:C,fontSize:C,backgroundPositionX:C,backgroundPositionY:C,...Lv,zIndex:ia,fillOpacity:De,strokeOpacity:De,numOctaves:ia},kv={...uo,color:K,backgroundColor:K,outlineColor:K,fill:K,stroke:K,borderColor:K,borderTopColor:K,borderRightColor:K,borderBottomColor:K,borderLeftColor:K,filter:ai,WebkitFilter:ai,mask:li,WebkitMask:li},Bu=t=>kv[t],Iv=new Set([ai,li]);function Ou(t,e){let n=Bu(t);return Iv.has(n)||(n=gt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Fv=new Set(["auto","none","0"]);function Bv(t,e,n){let s=0,i;for(;s<t.length&&!i;){const r=t[s];typeof r=="string"&&!Fv.has(r)&&ie(r).values.length&&(i=t[s]),s++}if(i&&n)for(const r of e)t[r]=Ou(n,i)}class Ov extends oo{constructor(e,n,s,i,r){super(e,n,s,i,r,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<e.length;l++){let h=e[l];if(typeof h=="string"&&(h=h.trim(),Qi(h))){const f=Mu(h,n.current);f!==void 0&&(e[l]=f),l===e.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!Eu.has(s)||e.length!==2)return;const[i,r]=e,o=sa(i),a=sa(r),c=Kr(i),u=Kr(r);if(c!==u&&Mt[s]){this.needsMeasurement=!0;return}if(o!==a)if(Jr(o)&&Jr(a))for(let l=0;l<e.length;l++){const h=e[l];typeof h=="string"&&(e[l]=parseFloat(h))}else Mt[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,s=[];for(let i=0;i<e.length;i++)(e[i]===null||Mv(e[i]))&&s.push(i);s.length&&Bv(e,s,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:s}=this;if(!e||!e.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Mt[s](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&e.getValue(s,i).jump(i,!1)}measureEndState(){const{element:e,name:n,unresolvedKeyframes:s}=this;if(!e||!e.current)return;const i=e.getValue(n);i&&i.jump(this.measuredOrigin,!1);const r=s.length-1,o=s[r];s[r]=Mt[n](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),this.removedTransforms?.length&&this.removedTransforms.forEach(([a,c])=>{e.getValue(a).set(c)}),this.resolveNoneKeyframes()}}function ju(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let s=document;const i=n?.[t]??s.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t).filter(s=>s!=null)}const Nu=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function cn(t){return zc(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:ho}=ru(queueMicrotask,!1),pt={x:!1,y:!1};function Uu(){return pt.x||pt.y}function jv(t){return t==="x"||t==="y"?pt[t]?null:(pt[t]=!0,()=>{pt[t]=!1}):pt.x||pt.y?null:(pt.x=pt.y=!0,()=>{pt.x=pt.y=!1})}function Wu(t,e){const n=ju(t),s=new AbortController,i={passive:!0,...e,signal:s.signal};return[n,i,()=>s.abort()]}function Nv(t){return!(t.pointerType==="touch"||Uu())}function Uv(t,e,n={}){const[s,i,r]=Wu(t,n);return s.forEach(o=>{let a=!1,c=!1,u;const l=()=>{o.removeEventListener("pointerleave",p)},h=g=>{u&&(u(g),u=void 0),l()},f=g=>{a=!1,window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f),c&&(c=!1,h(g))},d=()=>{a=!0,window.addEventListener("pointerup",f,i),window.addEventListener("pointercancel",f,i)},p=g=>{if(g.pointerType!=="touch"){if(a){c=!0;return}h(g)}},m=g=>{if(!Nv(g))return;c=!1;const y=e(o,g);typeof y=="function"&&(u=y,o.addEventListener("pointerleave",p,i))};o.addEventListener("pointerenter",m,i),o.addEventListener("pointerdown",d,i)}),r}const Ku=(t,e)=>e?t===e?!0:Ku(t,e.parentElement):!1,fo=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,Wv=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Kv(t){return Wv.has(t.tagName)||t.isContentEditable===!0}const Hv=new Set(["INPUT","SELECT","TEXTAREA"]);function Gv(t){return Hv.has(t.tagName)||t.isContentEditable===!0}const un=new WeakSet;function oa(t){return e=>{e.key==="Enter"&&t(e)}}function ds(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const zv=(t,e)=>{const n=t.currentTarget;if(!n)return;const s=oa(()=>{if(un.has(n))return;ds(n,"down");const i=oa(()=>{ds(n,"up")}),r=()=>ds(n,"cancel");n.addEventListener("keyup",i,e),n.addEventListener("blur",r,e)});n.addEventListener("keydown",s,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),e)};function ra(t){return fo(t)&&!Uu()}const aa=new WeakSet;function _v(t,e,n={}){const[s,i,r]=Wu(t,n),o=a=>{const c=a.currentTarget;if(!ra(a)||aa.has(a))return;un.add(c),n.stopPropagation&&aa.add(a);const u=e(c,a),l=(d,p)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",f),un.has(c)&&un.delete(c),ra(d)&&typeof u=="function"&&u(d,{success:p})},h=d=>{l(d,c===window||c===document||n.useGlobalTarget||Ku(c,d.target))},f=d=>{l(d,!1)};window.addEventListener("pointerup",h,i),window.addEventListener("pointercancel",f,i)};return s.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),cn(a)&&(a.addEventListener("focus",u=>zv(u,i)),!Kv(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),r}function po(t){return zc(t)&&"ownerSVGElement"in t}const hn=new WeakMap;let fn;const Hu=(t,e,n)=>(s,i)=>i&&i[0]?i[0][t+"Size"]:po(s)&&"getBBox"in s?s.getBBox()[e]:s[n],Xv=Hu("inline","width","offsetWidth"),Yv=Hu("block","height","offsetHeight");function qv({target:t,borderBoxSize:e}){hn.get(t)?.forEach(n=>{n(t,{get width(){return Xv(t,e)},get height(){return Yv(t,e)}})})}function Zv(t){t.forEach(qv)}function Jv(){typeof ResizeObserver>"u"||(fn=new ResizeObserver(Zv))}function Qv(t,e){fn||Jv();const n=ju(t);return n.forEach(s=>{let i=hn.get(s);i||(i=new Set,hn.set(s,i)),i.add(e),fn?.observe(s)}),()=>{n.forEach(s=>{const i=hn.get(s);i?.delete(e),i?.size||fn?.unobserve(s)})}}const dn=new Set;let te;function t0(){te=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};dn.forEach(e=>e(t))},window.addEventListener("resize",te)}function e0(t){return dn.add(t),te||t0(),()=>{dn.delete(t),!dn.size&&typeof te=="function"&&(window.removeEventListener("resize",te),te=void 0)}}function la(t,e){return typeof t=="function"?e0(t):Qv(t,e)}function n0(t){return po(t)&&t.tagName==="svg"}const s0=[...Fu,K,gt],i0=t=>s0.find(Iu(t)),ca=()=>({translate:0,scale:1,origin:0,originPoint:0}),ee=()=>({x:ca(),y:ca()}),ua=()=>({min:0,max:0}),_=()=>({x:ua(),y:ua()}),o0=new WeakMap;function Un(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Ee(t){return typeof t=="string"||Array.isArray(t)}const mo=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],go=["initial",...mo];function Wn(t){return Un(t.animate)||go.some(e=>Ee(t[e]))}function Gu(t){return!!(Wn(t)||t.variants)}function r0(t,e,n){for(const s in e){const i=e[s],r=n[s];if(J(i))t.addValue(s,i);else if(J(r))t.addValue(s,oe(i,{owner:t}));else if(r!==i)if(t.hasValue(s)){const o=t.getValue(s);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=t.getStaticValue(s);t.addValue(s,oe(o!==void 0?o:i,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const ci={current:null},zu={current:!1},a0=typeof window<"u";function l0(){if(zu.current=!0,!!a0)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>ci.current=t.matches;t.addEventListener("change",e),e()}else ci.current=!1}const ha=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Dn={};function _u(t){Dn=t}function c0(){return Dn}class u0{scrapeMotionValuesFromProps(e,n,s){return{}}constructor({parent:e,props:n,presenceContext:s,reducedMotionConfig:i,skipAnimations:r,blockInitialAnimation:o,visualState:a},c={}){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=oo,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 d=nt.now();this.renderScheduledAt<d&&(this.renderScheduledAt=d,k.render(this.render,!1,!0))};const{latestValues:u,renderState:l}=a;this.latestValues=u,this.baseTarget={...u},this.initialValues=n.initial?{...u}:{},this.renderState=l,this.parent=e,this.props=n,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=r,this.options=c,this.blockInitialAnimation=!!o,this.isControllingVariants=Wn(n),this.isVariantNode=Gu(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:h,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const d in f){const p=f[d];u[d]!==void 0&&J(p)&&p.set(u[d])}}mount(e){if(this.hasBeenMounted)for(const n in this.initialValues)this.values.get(n)?.jump(this.initialValues[n]),this.latestValues[n]=this.initialValues[n];this.current=e,o0.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,s)=>this.bindToMotionValue(s,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(zu.current||l0(),this.shouldReduceMotion=ci.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(),Et(this.notifyUpdate),Et(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),n.accelerate&&Cu.has(e)&&this.current instanceof HTMLElement){const{factory:o,keyframes:a,times:c,ease:u,duration:l}=n.accelerate,h=new Au({element:this.current,name:e,keyframes:a,times:c,ease:u,duration:rt(l)}),f=o(h);this.valueSubscriptions.set(e,()=>{f(),h.cancel()});return}const s=he.has(e);s&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&k.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let r;typeof window<"u"&&window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),r&&r(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in Dn){const n=Dn[e];if(!n)continue;const{isEnabled:s,Feature:i}=n;if(!this.features[e]&&i&&s(this.props)&&(this.features[e]=new i(this)),this.features[e]){const r=this.features[e];r.isMounted?r.update():(r.mount(),r.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):_()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<ha.length;s++){const i=ha[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const r="on"+i,o=e[r];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=r0(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const s=this.values.get(e);n!==s&&(s&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let s=this.values.get(e);return s===void 0&&n!==void 0&&(s=oe(n===null?void 0:n,{owner:this}),this.addValue(e,s)),s}readValue(e,n){let s=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return s!=null&&(typeof s=="string"&&(Gc(s)||_c(s))?s=parseFloat(s):!i0(s)&&gt.test(n)&&(s=Ou(e,n)),this.setBaseTarget(e,J(s)?s.get():s)),J(s)?s.get():s}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const r=lo(this.props,n,this.presenceContext?.custom);r&&(s=r[e])}if(n&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!J(i)?i:this.initialValues[e]!==void 0&&s===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new qi),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){ho.render(this.render)}}class Xu extends u0{constructor(){super(...arguments),this.KeyframeResolver=Ov}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){const s=e.style;return s?s[n]:void 0}removeValueFromRenderState(e,{vars:n,style:s}){delete n[e],delete s[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;J(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Lt{constructor(e){this.isMounted=!1,this.node=e}update(){}}function Yu({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function h0({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function f0(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function ps(t){return t===void 0||t===1}function ui({scale:t,scaleX:e,scaleY:n}){return!ps(t)||!ps(e)||!ps(n)}function Bt(t){return ui(t)||qu(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function qu(t){return fa(t.x)||fa(t.y)}function fa(t){return t&&t!=="0%"}function En(t,e,n){const s=t-n,i=e*s;return n+i}function da(t,e,n,s,i){return i!==void 0&&(t=En(t,i,s)),En(t,n,s)+e}function hi(t,e=0,n=1,s,i){t.min=da(t.min,e,n,s,i),t.max=da(t.max,e,n,s,i)}function Zu(t,{x:e,y:n}){hi(t.x,e.translate,e.scale,e.originPoint),hi(t.y,n.translate,n.scale,n.originPoint)}const pa=.999999999999,ma=1.0000000000001;function d0(t,e,n,s=!1){const i=n.length;if(!i)return;e.x=e.y=1;let r,o;for(let a=0;a<i;a++){r=n[a],o=r.projectionDelta;const{visualElement:c}=r.options;c&&c.props.style&&c.props.style.display==="contents"||(s&&r.options.layoutScroll&&r.scroll&&r!==r.root&&(xt(t.x,-r.scroll.offset.x),xt(t.y,-r.scroll.offset.y)),o&&(e.x*=o.x.scale,e.y*=o.y.scale,Zu(t,o)),s&&Bt(r.latestValues)&&pn(t,r.latestValues,r.layout?.layoutBox))}e.x<ma&&e.x>pa&&(e.x=1),e.y<ma&&e.y>pa&&(e.y=1)}function xt(t,e){t.min+=e,t.max+=e}function ga(t,e,n,s,i=.5){const r=F(t.min,t.max,i);hi(t,e,n,r,s)}function ya(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function pn(t,e,n){const s=n??t;ga(t.x,ya(e.x,s.x),e.scaleX,e.scale,e.originX),ga(t.y,ya(e.y,s.y),e.scaleY,e.scale,e.originY)}function Ju(t,e){return Yu(f0(t.getBoundingClientRect(),e))}function p0(t,e,n){const s=Ju(t,n),{scroll:i}=e;return i&&(xt(s.x,i.offset.x),xt(s.y,i.offset.y)),s}const m0={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},g0=ue.length;function y0(t,e,n){let s="",i=!0;for(let r=0;r<g0;r++){const o=ue[r],a=t[o];if(a===void 0)continue;let c=!0;if(typeof a=="number")c=a===(o.startsWith("scale")?1:0);else{const u=parseFloat(a);c=o.startsWith("scale")?u===1:u===0}if(!c||n){const u=Nu(a,uo[o]);if(!c){i=!1;const l=m0[o]||o;s+=`${l}(${u}) `}n&&(e[o]=u)}}return s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}function yo(t,e,n){const{style:s,vars:i,transformOrigin:r}=t;let o=!1,a=!1;for(const c in e){const u=e[c];if(he.has(c)){o=!0;continue}else if(lu(c)){i[c]=u;continue}else{const l=Nu(u,uo[c]);c.startsWith("origin")?(a=!0,r[c]=l):s[c]=l}}if(e.transform||(o||n?s.transform=y0(e,t.transform,n):s.transform&&(s.transform="none")),a){const{originX:c="50%",originY:u="50%",originZ:l=0}=r;s.transformOrigin=`${c} ${u} ${l}`}}function Qu(t,{style:e,vars:n},s,i){const r=t.style;let o;for(o in e)r[o]=e[o];i?.applyProjectionStyles(r,s);for(o in n)r.setProperty(o,n[o])}function va(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const de={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(C.test(t))t=parseFloat(t);else return t;const n=va(t,e.target.x),s=va(t,e.target.y);return`${n}% ${s}%`}},v0={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=gt.parse(t);if(i.length>5)return s;const r=gt.createTransformer(t),o=typeof i[0]!="number"?1:0,a=n.x.scale*e.x,c=n.y.scale*e.y;i[0+o]/=a,i[1+o]/=c;const u=F(a,c,.5);return typeof i[2+o]=="number"&&(i[2+o]/=u),typeof i[3+o]=="number"&&(i[3+o]/=u),r(i)}},fi={borderRadius:{...de,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:de,borderTopRightRadius:de,borderBottomLeftRadius:de,borderBottomRightRadius:de,boxShadow:v0};function th(t,{layout:e,layoutId:n}){return he.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!fi[t]||t==="opacity")}function vo(t,e,n){const s=t.style,i=e?.style,r={};if(!s)return r;for(const o in s)(J(s[o])||i&&J(i[o])||th(o,t)||n?.getValue(o)?.liveStyle!==void 0)&&(r[o]=s[o]);return r}function x0(t){return window.getComputedStyle(t)}class T0 extends Xu{constructor(){super(...arguments),this.type="html",this.renderInstance=Qu}readValueFromInstance(e,n){if(he.has(n))return this.projection?.isProjecting?Js(n):Ny(e,n);{const s=x0(e),i=(lu(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return Ju(e,n)}build(e,n,s){yo(e,n,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return vo(e,n,s)}}const w0={offset:"stroke-dashoffset",array:"stroke-dasharray"},P0={offset:"strokeDashoffset",array:"strokeDasharray"};function S0(t,e,n=1,s=0,i=!0){t.pathLength=1;const r=i?w0:P0;t[r.offset]=`${-s}`,t[r.array]=`${e} ${n}`}const b0=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function eh(t,{attrX:e,attrY:n,attrScale:s,pathLength:i,pathSpacing:r=1,pathOffset:o=0,...a},c,u,l){if(yo(t,a,u),c){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:h,style:f}=t;h.transform&&(f.transform=h.transform,delete h.transform),(f.transform||h.transformOrigin)&&(f.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),f.transform&&(f.transformBox=l?.transformBox??"fill-box",delete h.transformBox);for(const d of b0)h[d]!==void 0&&(f[d]=h[d],delete h[d]);e!==void 0&&(h.x=e),n!==void 0&&(h.y=n),s!==void 0&&(h.scale=s),i!==void 0&&S0(h,i,r,o,!1)}const nh=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"]),sh=t=>typeof t=="string"&&t.toLowerCase()==="svg";function A0(t,e,n,s){Qu(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(nh.has(i)?i:co(i),e.attrs[i])}function ih(t,e,n){const s=vo(t,e,n);for(const i in t)if(J(t[i])||J(e[i])){const r=ue.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[r]=t[i]}return s}class V0 extends Xu{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=_}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(he.has(n)){const s=Bu(n);return s&&s.default||0}return n=nh.has(n)?n:co(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,s){return ih(e,n,s)}build(e,n,s){eh(e,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(e,n,s,i){A0(e,n,s,i)}mount(e){this.isSVGTag=sh(e.tagName),super.mount(e)}}const C0=go.length;function oh(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?oh(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<C0;n++){const s=go[n],i=t.props[s];(Ee(i)||i===!1)&&(e[s]=i)}return e}function rh(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}const $0=[...mo].reverse(),M0=mo.length;function D0(t){return e=>Promise.all(e.map(({animation:n,options:s})=>Cv(t,n,s)))}function E0(t){let e=D0(t),n=xa(),s=!0,i=!1;const r=u=>(l,h)=>{const f=Ht(t,h,u==="exit"?t.presenceContext?.custom:void 0);if(f){const{transition:d,transitionEnd:p,...m}=f;l={...l,...m,...p}}return l};function o(u){e=u(t)}function a(u){const{props:l}=t,h=oh(t.parent)||{},f=[],d=new Set;let p={},m=1/0;for(let y=0;y<M0;y++){const T=$0[y],v=n[T],w=l[T]!==void 0?l[T]:h[T],S=Ee(w),M=T===u?v.isActive:null;M===!1&&(m=y);let D=w===h[T]&&w!==l[T]&&S;if(D&&(s||i)&&t.manuallyAnimateOnMount&&(D=!1),v.protectedKeys={...p},!v.isActive&&M===null||!w&&!v.prevProp||Un(w)||typeof w=="boolean")continue;if(T==="exit"&&v.isActive&&M!==!0){v.prevResolvedValues&&(p={...p,...v.prevResolvedValues});continue}const b=R0(v.prevProp,w);let A=b||T===u&&v.isActive&&!D&&S||y>m&&S,P=!1;const $=Array.isArray(w)?w:[w];let E=$.reduce(r(T),{});M===!1&&(E={});const{prevResolvedValues:H={}}=v,N={...H,...E},G=R=>{A=!0,d.has(R)&&(P=!0,d.delete(R)),v.needsAnimating[R]=!0;const I=t.getValue(R);I&&(I.liveStyle=!1)};for(const R in N){const I=E[R],Q=H[R];if(p.hasOwnProperty(R))continue;let it=!1;ii(I)&&ii(Q)?it=!rh(I,Q):it=I!==Q,it?I!=null?G(R):d.add(R):I!==void 0&&d.has(R)?G(R):v.protectedKeys[R]=!0}v.prevProp=w,v.prevResolvedValues=E,v.isActive&&(p={...p,...E}),(s||i)&&t.blockInitialAnimation&&(A=!1);const U=D&&b;A&&(!U||P)&&f.push(...$.map(R=>{const I={type:T};if(typeof R=="string"&&(s||i)&&!U&&t.manuallyAnimateOnMount&&t.parent){const{parent:Q}=t,it=Ht(Q,R);if(Q.enteringChildren&&it){const{delayChildren:Hn}=it.transition||{};I.delay=$u(Q.enteringChildren,t,Hn)}}return{animation:R,options:I}}))}if(d.size){const y={};if(typeof l.initial!="boolean"){const T=Ht(t,Array.isArray(l.initial)?l.initial[0]:l.initial);T&&T.transition&&(y.transition=T.transition)}d.forEach(T=>{const v=t.getBaseTarget(T),w=t.getValue(T);w&&(w.liveStyle=!0),y[T]=v??null}),f.push({animation:y})}let g=!!f.length;return s&&(l.initial===!1||l.initial===l.animate)&&!t.manuallyAnimateOnMount&&(g=!1),s=!1,i=!1,g?e(f):Promise.resolve()}function c(u,l){if(n[u].isActive===l)return Promise.resolve();t.variantChildren?.forEach(f=>f.animationState?.setActive(u,l)),n[u].isActive=l;const h=a(u);for(const f in n)n[f].protectedKeys={};return h}return{animateChanges:a,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=xa(),i=!0}}}function R0(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!rh(e,t):!1}function It(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function xa(){return{animate:It(!0),whileInView:It(),whileHover:It(),whileTap:It(),whileDrag:It(),whileFocus:It(),exit:It()}}function di(t,e){t.min=e.min,t.max=e.max}function ft(t,e){di(t.x,e.x),di(t.y,e.y)}function Ta(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const ah=1e-4,L0=1-ah,k0=1+ah,lh=.01,I0=0-lh,F0=0+lh;function st(t){return t.max-t.min}function B0(t,e,n){return Math.abs(t-e)<=n}function wa(t,e,n,s=.5){t.origin=s,t.originPoint=F(e.min,e.max,t.origin),t.scale=st(n)/st(e),t.translate=F(n.min,n.max,t.origin)-t.originPoint,(t.scale>=L0&&t.scale<=k0||isNaN(t.scale))&&(t.scale=1),(t.translate>=I0&&t.translate<=F0||isNaN(t.translate))&&(t.translate=0)}function Se(t,e,n,s){wa(t.x,e.x,n.x,s?s.originX:void 0),wa(t.y,e.y,n.y,s?s.originY:void 0)}function Pa(t,e,n,s=0){const i=s?F(n.min,n.max,s):n.min;t.min=i+e.min,t.max=t.min+st(e)}function O0(t,e,n,s){Pa(t.x,e.x,n.x,s?.x),Pa(t.y,e.y,n.y,s?.y)}function Sa(t,e,n,s=0){const i=s?F(n.min,n.max,s):n.min;t.min=e.min-i,t.max=t.min+st(e)}function Rn(t,e,n,s){Sa(t.x,e.x,n.x,s?.x),Sa(t.y,e.y,n.y,s?.y)}function ba(t,e,n,s,i){return t-=e,t=En(t,1/n,s),i!==void 0&&(t=En(t,1/i,s)),t}function j0(t,e=0,n=1,s=.5,i,r=t,o=t){if(wt.test(e)&&(e=parseFloat(e),e=F(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=F(r.min,r.max,s);t===r&&(a-=e),t.min=ba(t.min,e,n,a,i),t.max=ba(t.max,e,n,a,i)}function Aa(t,e,[n,s,i],r,o){j0(t,e[n],e[s],e[i],e.scale,r,o)}const N0=["x","scaleX","originX"],U0=["y","scaleY","originY"];function Va(t,e,n,s){Aa(t.x,e,N0,n?n.x:void 0,s?s.x:void 0),Aa(t.y,e,U0,n?n.y:void 0,s?s.y:void 0)}function Ca(t){return t.translate===0&&t.scale===1}function ch(t){return Ca(t.x)&&Ca(t.y)}function $a(t,e){return t.min===e.min&&t.max===e.max}function W0(t,e){return $a(t.x,e.x)&&$a(t.y,e.y)}function Ma(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function uh(t,e){return Ma(t.x,e.x)&&Ma(t.y,e.y)}function Da(t){return st(t.x)/st(t.y)}function Ea(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function vt(t){return[t("x"),t("y")]}function K0(t,e,n){let s="";const i=t.x.translate/e.x,r=t.y.translate/e.y,o=n?.z||0;if((i||r||o)&&(s=`translate3d(${i}px, ${r}px, ${o}px) `),(e.x!==1||e.y!==1)&&(s+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:u,rotate:l,rotateX:h,rotateY:f,skewX:d,skewY:p}=n;u&&(s=`perspective(${u}px) ${s}`),l&&(s+=`rotate(${l}deg) `),h&&(s+=`rotateX(${h}deg) `),f&&(s+=`rotateY(${f}deg) `),d&&(s+=`skewX(${d}deg) `),p&&(s+=`skewY(${p}deg) `)}const a=t.x.scale*e.x,c=t.y.scale*e.y;return(a!==1||c!==1)&&(s+=`scale(${a}, ${c})`),s||"none"}const hh=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],H0=hh.length,Ra=t=>typeof t=="string"?parseFloat(t):t,La=t=>typeof t=="number"||C.test(t);function G0(t,e,n,s,i,r){i?(t.opacity=F(0,n.opacity??1,z0(s)),t.opacityExit=F(e.opacity??1,0,_0(s))):r&&(t.opacity=F(e.opacity??1,n.opacity??1,s));for(let o=0;o<H0;o++){const a=hh[o];let c=ka(e,a),u=ka(n,a);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||La(c)===La(u)?(t[a]=Math.max(F(Ra(c),Ra(u),s),0),(wt.test(u)||wt.test(c))&&(t[a]+="%")):t[a]=u}(e.rotate||n.rotate)&&(t.rotate=F(e.rotate||0,n.rotate||0,s))}function ka(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const z0=fh(0,.5,nu),_0=fh(.5,.95,ut);function fh(t,e,n){return s=>s<t?0:s>e?1:n(Me(t,e,s))}function X0(t,e,n){const s=J(t)?t:oe(t);return s.start(ao("",s,e,n)),s.animation}function Re(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}const Y0=(t,e)=>t.depth-e.depth;class q0{constructor(){this.children=[],this.isDirty=!1}add(e){Xi(this.children,e),this.isDirty=!0}remove(e){An(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Y0),this.isDirty=!1,this.children.forEach(e)}}function Z0(t,e){const n=nt.now(),s=({timestamp:i})=>{const r=i-n;r>=e&&(Et(s),t(r-e))};return k.setup(s,!0),()=>Et(s)}function mn(t){return J(t)?t.get():t}class J0{constructor(){this.members=[]}add(e){Xi(this.members,e);for(let n=this.members.length-1;n>=0;n--){const s=this.members[n];if(s===e||s===this.lead||s===this.prevLead)continue;const i=s.instance;(!i||i.isConnected===!1)&&!s.snapshot&&(An(this.members,s),s.unmount())}e.scheduleRender()}remove(e){if(An(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){for(let n=this.members.indexOf(e)-1;n>=0;n--){const s=this.members[n];if(s.isPresent!==!1&&s.instance?.isConnected!==!1)return this.promote(s),!0}return!1}promote(e,n){const s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.updateSnapshot(),e.scheduleRender();const{layoutDependency:i}=s.options,{layoutDependency:r}=e.options;(i===void 0||i!==r)&&(e.resumeFrom=s,n&&(s.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const gn={hasAnimatedSinceResize:!0,hasEverUpdated:!1},ms=["","X","Y","Z"],Q0=1e3;let t1=0;function gs(t,e,n,s){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),s&&(s[t]=0))}function dh(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Lu(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:r}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",k,!(i||r))}const{parent:s}=t;s&&!s.hasCheckedOptimisedAppear&&dh(s)}function ph({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(o={},a=e?.()){this.id=t1++,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.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(s1),this.nodes.forEach(c1),this.nodes.forEach(u1),this.nodes.forEach(i1)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new q0)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new qi),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const c=this.eventHandlers.get(o);c&&c.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=po(o)&&!n0(o),this.instance=o;const{layoutId:a,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||a)&&(this.isLayoutDirty=!0),t){let l,h=0;const f=()=>this.root.updateBlockedByResize=!1;k.read(()=>{h=window.innerWidth}),t(o,()=>{const d=window.innerWidth;d!==h&&(h=d,this.root.updateBlockedByResize=!0,l&&l(),l=Z0(f,250),gn.hasAnimatedSinceResize&&(gn.hasAnimatedSinceResize=!1,this.nodes.forEach(Ba)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&u&&(a||c)&&this.addEventListener("didUpdate",({delta:l,hasLayoutChanged:h,hasRelativeLayoutChanged:f,layout:d})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const p=this.options.transition||u.getDefaultTransition()||m1,{onLayoutAnimationStart:m,onLayoutAnimationComplete:g}=u.getProps(),y=!this.targetLayout||!uh(this.targetLayout,d),T=!h&&f;if(this.options.layoutRoot||this.resumeFrom||T||h&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const v={...ro(p,"layout"),onPlay:m,onComplete:g};(u.shouldReduceMotion||this.options.layoutRoot)&&(v.delay=0,v.type=!1),this.startAnimation(v),this.setAnimationOrigin(l,T)}else h||Ba(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=d})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Et(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(h1),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&dh(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let l=0;l<this.path.length;l++){const h=this.path[l];h.shouldResetTransform=!0,(typeof h.latestValues.x=="string"||typeof h.latestValues.y=="string")&&(h.isLayoutDirty=!0),h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:a,layout:c}=this.options;if(a===void 0&&!c)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const c=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),c&&this.nodes.forEach(r1),this.nodes.forEach(Ia);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Fa);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(a1),this.nodes.forEach(l1),this.nodes.forEach(e1),this.nodes.forEach(n1)):this.nodes.forEach(Fa),this.clearAllSnapshots();const a=nt.now();Z.delta=St(0,1e3/60,a-Z.timestamp),Z.timestamp=a,Z.isProcessing=!0,as.update.process(Z),as.preRender.process(Z),as.render.process(Z),Z.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,ho.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(o1),this.sharedNodes.forEach(f1)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,k.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){k.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!st(this.snapshot.measuredBox.x)&&!st(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=_()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a&&this.instance){const c=s(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!ch(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,l=u!==this.prevTransformTemplateValue;o&&this.instance&&(a||Bt(this.latestValues)||l)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let c=this.removeElementScroll(a);return o&&(c=this.removeTransform(c)),g1(c),{animationId:this.root.animationId,measuredBox:a,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:o}=this.options;if(!o)return _();const a=o.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(y1))){const{scroll:u}=this.root;u&&(xt(a.x,u.offset.x),xt(a.y,u.offset.y))}return a}removeElementScroll(o){const a=_();if(ft(a,o),this.scroll?.wasRoot)return a;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:l,options:h}=u;u!==this.root&&l&&h.layoutScroll&&(l.wasRoot&&ft(a,o),xt(a.x,l.offset.x),xt(a.y,l.offset.y))}return a}applyTransform(o,a=!1,c){const u=c||_();ft(u,o);for(let l=0;l<this.path.length;l++){const h=this.path[l];!a&&h.options.layoutScroll&&h.scroll&&h!==h.root&&(xt(u.x,-h.scroll.offset.x),xt(u.y,-h.scroll.offset.y)),Bt(h.latestValues)&&pn(u,h.latestValues,h.layout?.layoutBox)}return Bt(this.latestValues)&&pn(u,this.latestValues,this.layout?.layoutBox),u}removeTransform(o){const a=_();ft(a,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!Bt(u.latestValues))continue;let l;u.instance&&(ui(u.latestValues)&&u.updateSnapshot(),l=_(),ft(l,u.measurePageBox())),Va(a,u.latestValues,u.snapshot?.layoutBox,l)}return Bt(this.latestValues)&&Va(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}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!==Z.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==a;if(!(o||c&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:l,layoutId:h}=this.options;if(!this.layout||!(l||h))return;this.resolvedRelativeTargetAt=Z.timestamp;const f=this.getClosestProjectingParent();f&&this.linkedParentVersion!==f.layoutVersion&&!f.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&f&&f.layout?this.createRelativeTarget(f,this.layout.layoutBox,f.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=_(),this.targetWithTransforms=_()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),O0(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):ft(this.target,this.layout.layoutBox),Zu(this.target,this.targetDelta)):ft(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?this.createRelativeTarget(f,this.target,f.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||ui(this.parent.latestValues)||qu(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,a,c){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=_(),this.relativeTargetOrigin=_(),Rn(this.relativeTargetOrigin,a,c,this.options.layoutAnchor||void 0),ft(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const o=this.getLead(),a=!!this.resumingFrom||this!==o;let c=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(c=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===Z.timestamp&&(c=!1),c)return;const{layout:u,layoutId:l}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||l))return;ft(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,f=this.treeScale.y;d0(this.layoutCorrected,this.treeScale,this.path,a),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=_());const{target:d}=o;if(!d){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Ta(this.prevProjectionDelta.x,this.projectionDelta.x),Ta(this.prevProjectionDelta.y,this.projectionDelta.y)),Se(this.projectionDelta,this.layoutCorrected,d,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==f||!Ea(this.projectionDelta.x,this.prevProjectionDelta.x)||!Ea(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",d))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){if(this.options.visualElement?.scheduleRender(),o){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ee(),this.projectionDelta=ee(),this.projectionDeltaWithTransform=ee()}setAnimationOrigin(o,a=!1){const c=this.snapshot,u=c?c.latestValues:{},l={...this.latestValues},h=ee();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=_(),d=c?c.source:void 0,p=this.layout?this.layout.source:void 0,m=d!==p,g=this.getStack(),y=!g||g.members.length<=1,T=!!(m&&!y&&this.options.crossfade===!0&&!this.path.some(p1));this.animationProgress=0;let v;this.mixTargetDelta=w=>{const S=w/1e3;Oa(h.x,o.x,S),Oa(h.y,o.y,S),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Rn(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),d1(this.relativeTarget,this.relativeTargetOrigin,f,S),v&&W0(this.relativeTarget,v)&&(this.isProjectionDirty=!1),v||(v=_()),ft(v,this.relativeTarget)),m&&(this.animationValues=l,G0(l,u,this.latestValues,S,T,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Et(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=k.update(()=>{gn.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=oe(0)),this.motionValue.jump(0,!1),this.currentAnimation=X0(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),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 o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Q0),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:c,layout:u,latestValues:l}=o;if(!(!a||!c||!u)){if(this!==o&&this.layout&&u&&mh(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||_();const h=st(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+h;const f=st(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+f}ft(a,c),pn(a,l),Se(this.projectionDeltaWithTransform,this.layoutCorrected,a,l)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new J0),this.sharedNodes.get(o).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){const{layoutId:o}=this.options;return o?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:o}=this.options;return o?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(a=!0),!a)return;const u={};c.z&&gs("z",o,u,this.animationValues);for(let l=0;l<ms.length;l++)gs(`rotate${ms[l]}`,o,u,this.animationValues),gs(`skew${ms[l]}`,o,u,this.animationValues);o.render();for(const l in u)o.setStaticValue(l,u[l]),this.animationValues&&(this.animationValues[l]=u[l]);o.scheduleRender()}applyProjectionStyles(o,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=mn(a?.pointerEvents)||"",o.transform=c?c(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=mn(a?.pointerEvents)||""),this.hasProjected&&!Bt(this.latestValues)&&(o.transform=c?c({},""):"none",this.hasProjected=!1);return}o.visibility="";const l=u.animationValues||u.latestValues;this.applyTransformsToTarget();let h=K0(this.projectionDeltaWithTransform,this.treeScale,l);c&&(h=c(l,h)),o.transform=h;const{x:f,y:d}=this.projectionDelta;o.transformOrigin=`${f.origin*100}% ${d.origin*100}% 0`,u.animationValues?o.opacity=u===this?l.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:l.opacityExit:o.opacity=u===this?l.opacity!==void 0?l.opacity:"":l.opacityExit!==void 0?l.opacityExit:0;for(const p in fi){if(l[p]===void 0)continue;const{correct:m,applyTo:g,isCSSVariable:y}=fi[p],T=h==="none"?l[p]:m(l[p],u);if(g){const v=g.length;for(let w=0;w<v;w++)o[g[w]]=T}else y?this.options.visualElement.renderState.vars[p]=T:o[p]=T}this.options.layoutId&&(o.pointerEvents=u===this?mn(a?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>o.currentAnimation?.stop()),this.root.nodes.forEach(Ia),this.root.sharedNodes.clear()}}}function e1(t){t.updateLayout()}function n1(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:s}=t.layout,{animationType:i}=t.options,r=e.source!==t.layout.source;if(i==="size")vt(l=>{const h=r?e.measuredBox[l]:e.layoutBox[l],f=st(h);h.min=n[l].min,h.max=h.min+f});else if(i==="x"||i==="y"){const l=i==="x"?"y":"x";di(r?e.measuredBox[l]:e.layoutBox[l],n[l])}else mh(i,e.layoutBox,n)&&vt(l=>{const h=r?e.measuredBox[l]:e.layoutBox[l],f=st(n[l]);h.max=h.min+f,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[l].max=t.relativeTarget[l].min+f)});const o=ee();Se(o,n,e.layoutBox);const a=ee();r?Se(a,t.applyTransform(s,!0),e.measuredBox):Se(a,n,e.layoutBox);const c=!ch(o);let u=!1;if(!t.resumeFrom){const l=t.getClosestProjectingParent();if(l&&!l.resumeFrom){const{snapshot:h,layout:f}=l;if(h&&f){const d=t.options.layoutAnchor||void 0,p=_();Rn(p,e.layoutBox,h.layoutBox,d);const m=_();Rn(m,n,f.layoutBox,d),uh(p,m)||(u=!0),l.options.layoutRoot&&(t.relativeTarget=m,t.relativeTargetOrigin=p,t.relativeParent=l)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function s1(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function i1(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function o1(t){t.clearSnapshot()}function Ia(t){t.clearMeasurements()}function r1(t){t.isLayoutDirty=!0,t.updateLayout()}function Fa(t){t.isLayoutDirty=!1}function a1(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function l1(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Ba(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function c1(t){t.resolveTargetDelta()}function u1(t){t.calcProjection()}function h1(t){t.resetSkewAndRotation()}function f1(t){t.removeLeadSnapshot()}function Oa(t,e,n){t.translate=F(e.translate,0,n),t.scale=F(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function ja(t,e,n,s){t.min=F(e.min,n.min,s),t.max=F(e.max,n.max,s)}function d1(t,e,n,s){ja(t.x,e.x,n.x,s),ja(t.y,e.y,n.y,s)}function p1(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const m1={duration:.45,ease:[.4,0,.1,1]},Na=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Ua=Na("applewebkit/")&&!Na("chrome/")?Math.round:ut;function Wa(t){t.min=Ua(t.min),t.max=Ua(t.max)}function g1(t){Wa(t.x),Wa(t.y)}function mh(t,e,n){return t==="position"||t==="preserve-aspect"&&!B0(Da(e),Da(n),.2)}function y1(t){return t!==t.root&&t.scroll?.wasRoot}const v1=ph({attachResizeListener:(t,e)=>Re(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),ys={current:void 0},gh=ph({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!ys.current){const t=new v1({});t.mount(window),t.setOptions({layoutScroll:!0}),ys.current=t}return ys.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),xo=x.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function Ka(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function x1(...t){return e=>{let n=!1;const s=t.map(i=>{const r=Ka(i,e);return!n&&typeof r=="function"&&(n=!0),r});if(n)return()=>{for(let i=0;i<s.length;i++){const r=s[i];typeof r=="function"?r():Ka(t[i],null)}}}}function T1(...t){return x.useCallback(x1(...t),t)}class w1 extends x.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(cn(n)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const s=n.offsetParent,i=cn(s)&&s.offsetWidth||0,r=cn(s)&&s.offsetHeight||0,o=getComputedStyle(n),a=this.props.sizeRef.current;a.height=parseFloat(o.height),a.width=parseFloat(o.width),a.top=n.offsetTop,a.left=n.offsetLeft,a.right=i-a.width-a.left,a.bottom=r-a.height-a.top}return null}componentDidUpdate(){}render(){return this.props.children}}function P1({children:t,isPresent:e,anchorX:n,anchorY:s,root:i,pop:r}){const o=x.useId(),a=x.useRef(null),c=x.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:u}=x.useContext(xo),l=t.props?.ref??t?.ref,h=T1(a,l);return x.useInsertionEffect(()=>{const{width:f,height:d,top:p,left:m,right:g,bottom:y}=c.current;if(e||r===!1||!a.current||!f||!d)return;const T=n==="left"?`left: ${m}`:`right: ${g}`,v=s==="bottom"?`bottom: ${y}`:`top: ${p}`;a.current.dataset.motionPopId=o;const w=document.createElement("style");u&&(w.nonce=u);const S=i??document.head;return S.appendChild(w),w.sheet&&w.sheet.insertRule(`
10
- [data-motion-pop-id="${o}"] {
11
- position: absolute !important;
12
- width: ${f}px !important;
13
- height: ${d}px !important;
14
- ${T}px !important;
15
- ${v}px !important;
16
- }
17
- `),()=>{a.current?.removeAttribute("data-motion-pop-id"),S.contains(w)&&S.removeChild(w)}},[e]),Y.jsx(w1,{isPresent:e,childRef:a,sizeRef:c,pop:r,children:r===!1?t:x.cloneElement(t,{ref:h})})}const S1=({children:t,initial:e,isPresent:n,onExitComplete:s,custom:i,presenceAffectsLayout:r,mode:o,anchorX:a,anchorY:c,root:u})=>{const l=_i(b1),h=x.useId();let f=!0,d=x.useMemo(()=>(f=!1,{id:h,initial:e,isPresent:n,custom:i,onExitComplete:p=>{l.set(p,!0);for(const m of l.values())if(!m)return;s&&s()},register:p=>(l.set(p,!1),()=>l.delete(p))}),[n,l,s]);return r&&f&&(d={...d}),x.useMemo(()=>{l.forEach((p,m)=>l.set(m,!1))},[n]),x.useEffect(()=>{!n&&!l.size&&s&&s()},[n]),t=Y.jsx(P1,{pop:o==="popLayout",isPresent:n,anchorX:a,anchorY:c,root:u,children:t}),Y.jsx(jn.Provider,{value:d,children:t})};function b1(){return new Map}function yh(t=!0){const e=x.useContext(jn);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:i}=e,r=x.useId();x.useEffect(()=>{if(t)return i(r)},[t]);const o=x.useCallback(()=>t&&s&&s(r),[r,s,t]);return!n&&s?[!1,o]:[!0]}const qe=t=>t.key||"";function Ha(t){const e=[];return x.Children.forEach(t,n=>{x.isValidElement(n)&&e.push(n)}),e}const dT=({children:t,custom:e,initial:n=!0,onExitComplete:s,presenceAffectsLayout:i=!0,mode:r="sync",propagate:o=!1,anchorX:a="left",anchorY:c="top",root:u})=>{const[l,h]=yh(o),f=x.useMemo(()=>Ha(t),[t]),d=o&&!l?[]:f.map(qe),p=x.useRef(!0),m=x.useRef(f),g=_i(()=>new Map),y=x.useRef(new Set),[T,v]=x.useState(f),[w,S]=x.useState(f);Hc(()=>{p.current=!1,m.current=f;for(let b=0;b<w.length;b++){const A=qe(w[b]);d.includes(A)?(g.delete(A),y.current.delete(A)):g.get(A)!==!0&&g.set(A,!1)}},[w,d.length,d.join("-")]);const M=[];if(f!==T){let b=[...f];for(let A=0;A<w.length;A++){const P=w[A],$=qe(P);d.includes($)||(b.splice(A,0,P),M.push(P))}return r==="wait"&&M.length&&(b=M),S(Ha(b)),v(f),null}const{forceRender:D}=x.useContext(zi);return Y.jsx(Y.Fragment,{children:w.map(b=>{const A=qe(b),P=o&&!l?!1:f===w||d.includes(A),$=()=>{if(y.current.has(A))return;if(g.has(A))y.current.add(A),g.set(A,!0);else return;let E=!0;g.forEach(H=>{H||(E=!1)}),E&&(D?.(),S(m.current),o&&h?.(),s&&s())};return Y.jsx(S1,{isPresent:P,initial:!p.current||n?void 0:!1,custom:e,presenceAffectsLayout:i,mode:r,root:u,onExitComplete:P?void 0:$,anchorX:a,anchorY:c,children:b},A)})})},vh=x.createContext({strict:!1}),Ga={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let za=!1;function A1(){if(za)return;const t={};for(const e in Ga)t[e]={isEnabled:n=>Ga[e].some(s=>!!n[s])};_u(t),za=!0}function xh(){return A1(),c0()}function V1(t){const e=xh();for(const n in t)e[n]={...e[n],...t[n]};_u(e)}const C1=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Ln(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||C1.has(t)}let Th=t=>!Ln(t);function $1(t){typeof t=="function"&&(Th=e=>e.startsWith("on")?!Ln(e):t(e))}try{$1(require("@emotion/is-prop-valid").default)}catch{}function M1(t,e,n){const s={};for(const i in t)i==="values"&&typeof t.values=="object"||J(t[i])||(Th(i)||n===!0&&Ln(i)||!e&&!Ln(i)||t.draggable&&i.startsWith("onDrag"))&&(s[i]=t[i]);return s}const Kn=x.createContext({});function D1(t,e){if(Wn(t)){const{initial:n,animate:s}=t;return{initial:n===!1||Ee(n)?n:void 0,animate:Ee(s)?s:void 0}}return t.inherit!==!1?e:{}}function E1(t){const{initial:e,animate:n}=D1(t,x.useContext(Kn));return x.useMemo(()=>({initial:e,animate:n}),[_a(e),_a(n)])}function _a(t){return Array.isArray(t)?t.join(" "):t}const To=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function wh(t,e,n){for(const s in e)!J(e[s])&&!th(s,n)&&(t[s]=e[s])}function R1({transformTemplate:t},e){return x.useMemo(()=>{const n=To();return yo(n,e,t),Object.assign({},n.vars,n.style)},[e])}function L1(t,e){const n=t.style||{},s={};return wh(s,n,t),Object.assign(s,R1(t,e)),s}function k1(t,e){const n={},s=L1(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=s,n}const Ph=()=>({...To(),attrs:{}});function I1(t,e,n,s){const i=x.useMemo(()=>{const r=Ph();return eh(r,e,sh(s),t.transformTemplate,t.style),{...r.attrs,style:{...r.style}}},[e]);if(t.style){const r={};wh(r,t.style,t),i.style={...r,...i.style}}return i}const F1=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function wo(t){return typeof t!="string"||t.includes("-")?!1:!!(F1.indexOf(t)>-1||/[A-Z]/u.test(t))}function B1(t,e,n,{latestValues:s},i,r=!1,o){const c=(o??wo(t)?I1:k1)(e,s,i,t),u=M1(e,typeof t=="string",r),l=t!==x.Fragment?{...u,...c,ref:n}:{},{children:h}=e,f=x.useMemo(()=>J(h)?h.get():h,[h]);return x.createElement(t,{...l,children:f})}function O1({scrapeMotionValuesFromProps:t,createRenderState:e},n,s,i){return{latestValues:j1(n,s,i,t),renderState:e()}}function j1(t,e,n,s){const i={},r=s(t,{});for(const f in r)i[f]=mn(r[f]);let{initial:o,animate:a}=t;const c=Wn(t),u=Gu(t);e&&u&&!c&&t.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let l=n?n.initial===!1:!1;l=l||o===!1;const h=l?a:o;if(h&&typeof h!="boolean"&&!Un(h)){const f=Array.isArray(h)?h:[h];for(let d=0;d<f.length;d++){const p=lo(t,f[d]);if(p){const{transitionEnd:m,transition:g,...y}=p;for(const T in y){let v=y[T];if(Array.isArray(v)){const w=l?v.length-1:0;v=v[w]}v!==null&&(i[T]=v)}for(const T in m)i[T]=m[T]}}}return i}const Sh=t=>(e,n)=>{const s=x.useContext(Kn),i=x.useContext(jn),r=()=>O1(t,e,s,i);return n?r():_i(r)},N1=Sh({scrapeMotionValuesFromProps:vo,createRenderState:To}),U1=Sh({scrapeMotionValuesFromProps:ih,createRenderState:Ph}),W1=Symbol.for("motionComponentSymbol");function K1(t,e,n){const s=x.useRef(n);x.useInsertionEffect(()=>{s.current=n});const i=x.useRef(null);return x.useCallback(r=>{r&&t.onMount?.(r);const o=s.current;if(typeof o=="function")if(r){const a=o(r);typeof a=="function"&&(i.current=a)}else i.current?(i.current(),i.current=null):o(r);else o&&(o.current=r);e&&(r?e.mount(r):e.unmount())},[e])}const bh=x.createContext({});function _t(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function H1(t,e,n,s,i,r){const{visualElement:o}=x.useContext(Kn),a=x.useContext(vh),c=x.useContext(jn),u=x.useContext(xo),l=u.reducedMotion,h=u.skipAnimations,f=x.useRef(null),d=x.useRef(!1);s=s||a.renderer,!f.current&&s&&(f.current=s(t,{visualState:e,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:l,skipAnimations:h,isSVG:r}),d.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));const p=f.current,m=x.useContext(bh);p&&!p.projection&&i&&(p.type==="html"||p.type==="svg")&&G1(f.current,n,i,m);const g=x.useRef(!1);x.useInsertionEffect(()=>{p&&g.current&&p.update(n,c)});const y=n[Ru],T=x.useRef(!!y&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(y)&&window.MotionHasOptimisedAnimation?.(y));return Hc(()=>{d.current=!0,p&&(g.current=!0,window.MotionIsMounted=!0,p.updateFeatures(),p.scheduleRenderMicrotask(),T.current&&p.animationState&&p.animationState.animateChanges())}),x.useEffect(()=>{p&&(!T.current&&p.animationState&&p.animationState.animateChanges(),T.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(y)}),T.current=!1),p.enteringChildren=void 0)}),p}function G1(t,e,n,s){const{layoutId:i,layout:r,drag:o,dragConstraints:a,layoutScroll:c,layoutRoot:u,layoutAnchor:l,layoutCrossfade:h}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:Ah(t.parent)),t.projection.setOptions({layoutId:i,layout:r,alwaysMeasureLayout:!!o||a&&_t(a),visualElement:t,animationType:typeof r=="string"?r:"both",initialPromotionConfig:s,crossfade:h,layoutScroll:c,layoutRoot:u,layoutAnchor:l})}function Ah(t){if(t)return t.options.allowProjection!==!1?t.projection:Ah(t.parent)}function vs(t,{forwardMotionProps:e=!1,type:n}={},s,i){s&&V1(s);const r=n?n==="svg":wo(t),o=r?U1:N1;function a(u,l){let h;const f={...x.useContext(xo),...u,layoutId:z1(u)},{isStatic:d}=f,p=E1(u),m=o(u,d);if(!d&&typeof window<"u"){_1();const g=X1(f);h=g.MeasureLayout,p.visualElement=H1(t,m,f,i,g.ProjectionNode,r)}return Y.jsxs(Kn.Provider,{value:p,children:[h&&p.visualElement?Y.jsx(h,{visualElement:p.visualElement,...f}):null,B1(t,u,K1(m,p.visualElement,l),m,d,e,r)]})}a.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const c=x.forwardRef(a);return c[W1]=t,c}function z1({layoutId:t}){const e=x.useContext(zi).id;return e&&t!==void 0?e+"-"+t:t}function _1(t,e){x.useContext(vh).strict}function X1(t){const e=xh(),{drag:n,layout:s}=e;if(!n&&!s)return{};const i={...n,...s};return{MeasureLayout:n?.isEnabled(t)||s?.isEnabled(t)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}function Y1(t,e){if(typeof Proxy>"u")return vs;const n=new Map,s=(r,o)=>vs(r,o,t,e),i=(r,o)=>s(r,o);return new Proxy(i,{get:(r,o)=>o==="create"?s:(n.has(o)||n.set(o,vs(o,void 0,t,e)),n.get(o))})}const q1=(t,e)=>e.isSVG??wo(t)?new V0(e):new T0(e,{allowProjection:t!==x.Fragment});class Z1 extends Lt{constructor(e){super(e),e.animationState||(e.animationState=E0(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Un(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let J1=0;class Q1 extends Lt{constructor(){super(...arguments),this.id=J1++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===s)return;if(e&&s===!1){if(this.isExitComplete){const{initial:r,custom:o}=this.node.getProps();if(typeof r=="string"){const a=Ht(this.node,r,o);if(a){const{transition:c,transitionEnd:u,...l}=a;for(const h in l)this.node.getValue(h)?.jump(l[h])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const i=this.node.animationState.setActive("exit",!e);n&&!e&&i.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const tx={animation:{Feature:Z1},exit:{Feature:Q1}};function We(t){return{point:{x:t.pageX,y:t.pageY}}}const ex=t=>e=>fo(e)&&t(e,We(e));function be(t,e,n,s){return Re(t,e,ex(n),s)}const Vh=({current:t})=>t?t.ownerDocument.defaultView:null,Xa=(t,e)=>Math.abs(t-e);function nx(t,e){const n=Xa(t.x,e.x),s=Xa(t.y,e.y);return Math.sqrt(n**2+s**2)}const Ya=new Set(["auto","scroll"]);class Ch{constructor(e,n,{transformPagePoint:s,contextWindow:i=window,dragSnapToOrigin:r=!1,distanceThreshold:o=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=d=>{this.handleScroll(d.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Ze(this.lastRawMoveEventInfo,this.transformPagePoint));const d=xs(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,m=nx(d.offset,{x:0,y:0})>=this.distanceThreshold;if(!p&&!m)return;const{point:g}=d,{timestamp:y}=Z;this.history.push({...g,timestamp:y});const{onStart:T,onMove:v}=this.handlers;p||(T&&T(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,d)},this.handlePointerMove=(d,p)=>{this.lastMoveEvent=d,this.lastRawMoveEventInfo=p,this.lastMoveEventInfo=Ze(p,this.transformPagePoint),k.update(this.updatePoint,!0)},this.handlePointerUp=(d,p)=>{this.end();const{onEnd:m,onSessionEnd:g,resumeAnimation:y}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const T=xs(d.type==="pointercancel"?this.lastMoveEventInfo:Ze(p,this.transformPagePoint),this.history);this.startEvent&&m&&m(d,T),g&&g(d,T)},!fo(e))return;this.dragSnapToOrigin=r,this.handlers=n,this.transformPagePoint=s,this.distanceThreshold=o,this.contextWindow=i||window;const c=We(e),u=Ze(c,this.transformPagePoint),{point:l}=u,{timestamp:h}=Z;this.history=[{...l,timestamp:h}];const{onSessionStart:f}=n;f&&f(e,xs(u,this.history)),this.removeListeners=je(be(this.contextWindow,"pointermove",this.handlePointerMove),be(this.contextWindow,"pointerup",this.handlePointerUp),be(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(e){let n=e.parentElement;for(;n;){const s=getComputedStyle(n);(Ya.has(s.overflowX)||Ya.has(s.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const n=this.scrollPositions.get(e);if(!n)return;const s=e===window,i=s?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},r={x:i.x-n.x,y:i.y-n.y};r.x===0&&r.y===0||(s?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=r.x,this.lastMoveEventInfo.point.y+=r.y):this.history.length>0&&(this.history[0].x-=r.x,this.history[0].y-=r.y),this.scrollPositions.set(e,i),k.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Et(this.updatePoint)}}function Ze(t,e){return e?{point:e(t.point)}:t}function qa(t,e){return{x:t.x-e.x,y:t.y-e.y}}function xs({point:t},e){return{point:t,delta:qa(t,$h(e)),offset:qa(t,sx(e)),velocity:ix(e,.1)}}function sx(t){return t[0]}function $h(t){return t[t.length-1]}function ix(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const i=$h(t);for(;n>=0&&(s=t[n],!(i.timestamp-s.timestamp>rt(e)));)n--;if(!s)return{x:0,y:0};s===t[0]&&t.length>2&&i.timestamp-s.timestamp>rt(e)*2&&(s=t[1]);const r=lt(i.timestamp-s.timestamp);if(r===0)return{x:0,y:0};const o={x:(i.x-s.x)/r,y:(i.y-s.y)/r};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function ox(t,{min:e,max:n},s){return e!==void 0&&t<e?t=s?F(e,t,s.min):Math.max(t,e):n!==void 0&&t>n&&(t=s?F(n,t,s.max):Math.min(t,n)),t}function Za(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function rx(t,{top:e,left:n,bottom:s,right:i}){return{x:Za(t.x,n,i),y:Za(t.y,e,s)}}function Ja(t,e){let n=e.min-t.min,s=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,s]=[s,n]),{min:n,max:s}}function ax(t,e){return{x:Ja(t.x,e.x),y:Ja(t.y,e.y)}}function lx(t,e){let n=.5;const s=st(t),i=st(e);return i>s?n=Me(e.min,e.max-s,t.min):s>i&&(n=Me(t.min,t.max-i,e.min)),St(0,1,n)}function cx(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const pi=.35;function ux(t=pi){return t===!1?t=0:t===!0&&(t=pi),{x:Qa(t,"left","right"),y:Qa(t,"top","bottom")}}function Qa(t,e,n){return{min:tl(t,e),max:tl(t,n)}}function tl(t,e){return typeof t=="number"?t:t[e]||0}const hx=new WeakMap;class fx{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=_(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:s}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const r=h=>{n&&this.snapToCursor(We(h).point),this.stopAnimation()},o=(h,f)=>{const{drag:d,dragPropagation:p,onDragStart:m}=this.getProps();if(d&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=jv(d),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),vt(y=>{let T=this.getAxisMotionValue(y).get()||0;if(wt.test(T)){const{projection:v}=this.visualElement;if(v&&v.layout){const w=v.layout.layoutBox[y];w&&(T=st(w)*(parseFloat(T)/100))}}this.originPoint[y]=T}),m&&k.update(()=>m(h,f),!1,!0),oi(this.visualElement,"transform");const{animationState:g}=this.visualElement;g&&g.setActive("whileDrag",!0)},a=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f;const{dragPropagation:d,dragDirectionLock:p,onDirectionLock:m,onDrag:g}=this.getProps();if(!d&&!this.openDragLock)return;const{offset:y}=f;if(p&&this.currentDirection===null){this.currentDirection=px(y),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",f.point,y),this.updateAxis("y",f.point,y),this.visualElement.render(),g&&k.update(()=>g(h,f),!1,!0)},c=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f,this.stop(h,f),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>{const{dragSnapToOrigin:h}=this.getProps();(h||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new Ch(e,{onSessionStart:r,onStart:o,onMove:a,onSessionEnd:c,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:s,contextWindow:Vh(this.visualElement),element:this.visualElement.current})}stop(e,n){const s=e||this.latestPointerEvent,i=n||this.latestPanInfo,r=this.isDragging;if(this.cancel(),!r||!i||!s)return;const{velocity:o}=i;this.startAnimation(o);const{onDragEnd:a}=this.getProps();a&&k.postRender(()=>a(s,i))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,s){const{drag:i}=this.getProps();if(!s||!Je(e,i,this.currentDirection))return;const r=this.getAxisMotionValue(e);let o=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(o=ox(o,this.constraints[e],this.elastic[e])),r.set(o)}resolveConstraints(){const{dragConstraints:e,dragElastic:n}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;e&&_t(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&s?this.constraints=rx(s.layoutBox,e):this.constraints=!1,this.elastic=ux(n),i!==this.constraints&&!_t(e)&&s&&this.constraints&&!this.hasMutatedConstraints&&vt(r=>{this.constraints!==!1&&this.getAxisMotionValue(r)&&(this.constraints[r]=cx(s.layoutBox[r],this.constraints[r]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!_t(e))return!1;const s=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const r=p0(s,i.root,this.visualElement.getTransformPagePoint());let o=ax(i.layout.layoutBox,r);if(n){const a=n(h0(o));this.hasMutatedConstraints=!!a,a&&(o=Yu(a))}return o}startAnimation(e){const{drag:n,dragMomentum:s,dragElastic:i,dragTransition:r,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},u=vt(l=>{if(!Je(l,n,this.currentDirection))return;let h=c&&c[l]||{};(o===!0||o===l)&&(h={min:0,max:0});const f=i?200:1e6,d=i?40:1e7,p={type:"inertia",velocity:s?e[l]:0,bounceStiffness:f,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...r,...h};return this.startAxisValueAnimation(l,p)});return Promise.all(u).then(a)}startAxisValueAnimation(e,n){const s=this.getAxisMotionValue(e);return oi(this.visualElement,e),s.start(ao(e,s,0,n,this.visualElement,!1))}stopAnimation(){vt(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,s=this.visualElement.getProps(),i=s[n];return i||this.visualElement.getValue(e,(s.initial?s.initial[e]:void 0)||0)}snapToCursor(e){vt(n=>{const{drag:s}=this.getProps();if(!Je(n,s,this.currentDirection))return;const{projection:i}=this.visualElement,r=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[n],c=r.get()||0;r.set(e[n]-F(o,a,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!_t(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};vt(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const c=a.get();i[o]=lx({min:c,max:c},this.constraints[o])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.constraints=!1,this.resolveConstraints(),vt(o=>{if(!Je(o,e,null))return;const a=this.getAxisMotionValue(o),{min:c,max:u}=this.constraints[o];a.set(F(c,u,i[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;hx.set(this.visualElement,this);const e=this.visualElement.current,n=be(e,"pointerdown",u=>{const{drag:l,dragListener:h=!0}=this.getProps(),f=u.target,d=f!==e&&Gv(f);l&&h&&!d&&this.start(u)});let s;const i=()=>{const{dragConstraints:u}=this.getProps();_t(u)&&u.current&&(this.constraints=this.resolveRefConstraints(),s||(s=dx(e,u.current,()=>this.scalePositionWithinConstraints())))},{projection:r}=this.visualElement,o=r.addEventListener("measure",i);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),k.read(i);const a=Re(window,"resize",()=>this.scalePositionWithinConstraints()),c=r.addEventListener("didUpdate",(({delta:u,hasLayoutChanged:l})=>{this.isDragging&&l&&(vt(h=>{const f=this.getAxisMotionValue(h);f&&(this.originPoint[h]+=u[h].translate,f.set(f.get()+u[h].translate))}),this.visualElement.render())}));return()=>{a(),n(),o(),c&&c(),s&&s()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:i=!1,dragConstraints:r=!1,dragElastic:o=pi,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:s,dragPropagation:i,dragConstraints:r,dragElastic:o,dragMomentum:a}}}function el(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function dx(t,e,n){const s=la(t,el(n)),i=la(e,el(n));return()=>{s(),i()}}function Je(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function px(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class mx extends Lt{constructor(e){super(e),this.removeGroupControls=ut,this.removeListeners=ut,this.controls=new fx(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ut}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Ts=t=>(e,n)=>{t&&k.update(()=>t(e,n),!1,!0)};class gx extends Lt{constructor(){super(...arguments),this.removePointerDownListener=ut}onPointerDown(e){this.session=new Ch(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Vh(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:Ts(e),onStart:Ts(n),onMove:Ts(s),onEnd:(r,o)=>{delete this.session,i&&k.postRender(()=>i(r,o))}}}mount(){this.removePointerDownListener=be(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let ws=!1;class yx extends x.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s,layoutId:i}=this.props,{projection:r}=e;r&&(n.group&&n.group.add(r),s&&s.register&&i&&s.register(r),ws&&r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),gn.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:s,drag:i,isPresent:r}=this.props,{projection:o}=s;return o&&(o.isPresent=r,e.layoutDependency!==n&&o.setOptions({...o.options,layoutDependency:n}),ws=!0,i||e.layoutDependency!==n||n===void 0||e.isPresent!==r?o.willUpdate():this.safeToRemove(),e.isPresent!==r&&(r?o.promote():o.relegate()||k.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:e,layoutAnchor:n}=this.props,{projection:s}=e;s&&(s.options.layoutAnchor=n,s.root.didUpdate(),ho.postRender(()=>{!s.currentAnimation&&s.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:i}=e;ws=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),s&&s.deregister&&s.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function Mh(t){const[e,n]=yh(),s=x.useContext(zi);return Y.jsx(yx,{...t,layoutGroup:s,switchLayoutGroup:x.useContext(bh),isPresent:e,safeToRemove:n})}const vx={pan:{Feature:gx},drag:{Feature:mx,ProjectionNode:gh,MeasureLayout:Mh}};function nl(t,e,n){const{props:s}=t;t.animationState&&s.whileHover&&t.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,r=s[i];r&&k.postRender(()=>r(e,We(e)))}class xx extends Lt{mount(){const{current:e}=this.node;e&&(this.unmount=Uv(e,(n,s)=>(nl(this.node,s,"Start"),i=>nl(this.node,i,"End"))))}unmount(){}}class Tx extends Lt{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=je(Re(this.node.current,"focus",()=>this.onFocus()),Re(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function sl(t,e,n){const{props:s}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&s.whileTap&&t.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),r=s[i];r&&k.postRender(()=>r(e,We(e)))}class wx extends Lt{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:s}=this.node.props;this.unmount=_v(e,(i,r)=>(sl(this.node,r,"Start"),(o,{success:a})=>sl(this.node,o,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:s?.tap===!1})}unmount(){}}const mi=new WeakMap,Ps=new WeakMap,Px=t=>{const e=mi.get(t.target);e&&e(t)},Sx=t=>{t.forEach(Px)};function bx({root:t,...e}){const n=t||document;Ps.has(n)||Ps.set(n,{});const s=Ps.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(Sx,{root:t,...e})),s[i]}function Ax(t,e,n){const s=bx(e);return mi.set(t,n),s.observe(t),()=>{mi.delete(t),s.unobserve(t)}}const Vx={some:0,all:1};class Cx extends Lt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:e={}}=this.node.getProps(),{root:n,margin:s,amount:i="some",once:r}=e,o={root:n?n.current:void 0,rootMargin:s,threshold:typeof i=="number"?i:Vx[i]},a=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,r&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:l,onViewportLeave:h}=this.node.getProps(),f=u?l:h;f&&f(c)};this.stopObserver=Ax(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some($x(e,n))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function $x({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Mx={inView:{Feature:Cx},tap:{Feature:wx},focus:{Feature:Tx},hover:{Feature:xx}},Dx={layout:{ProjectionNode:gh,MeasureLayout:Mh}},Ex={...tx,...Mx,...vx,...Dx},pT=Y1(Ex,q1);export{dT as A,Zx as a,cT as b,uT as c,Dg as d,pT as m,hT as u};