@robthepcguy/rag-vault 1.7.0 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/README.md +28 -9
  2. package/dist/chunker/semantic-chunker.d.ts +0 -1
  3. package/dist/chunker/semantic-chunker.d.ts.map +1 -1
  4. package/dist/chunker/semantic-chunker.js +1 -1
  5. package/dist/chunker/semantic-chunker.js.map +1 -1
  6. package/dist/embedder/index.d.ts +5 -0
  7. package/dist/embedder/index.d.ts.map +1 -1
  8. package/dist/embedder/index.js +40 -5
  9. package/dist/embedder/index.js.map +1 -1
  10. package/dist/errors/index.d.ts +1 -1
  11. package/dist/errors/index.d.ts.map +1 -1
  12. package/dist/flywheel/feedback.d.ts +1 -1
  13. package/dist/flywheel/feedback.d.ts.map +1 -1
  14. package/dist/flywheel/feedback.js +1 -1
  15. package/dist/flywheel/feedback.js.map +1 -1
  16. package/dist/parser/pdf-filter.d.ts +3 -5
  17. package/dist/parser/pdf-filter.d.ts.map +1 -1
  18. package/dist/parser/pdf-filter.js +1 -1
  19. package/dist/parser/pdf-filter.js.map +1 -1
  20. package/dist/query/parser.d.ts +2 -6
  21. package/dist/query/parser.d.ts.map +1 -1
  22. package/dist/query/parser.js +14 -22
  23. package/dist/query/parser.js.map +1 -1
  24. package/dist/server/index.d.ts.map +1 -1
  25. package/dist/server/index.js +37 -34
  26. package/dist/server/index.js.map +1 -1
  27. package/dist/server/raw-data-utils.d.ts +0 -40
  28. package/dist/server/raw-data-utils.d.ts.map +1 -1
  29. package/dist/server/raw-data-utils.js +9 -8
  30. package/dist/server/raw-data-utils.js.map +1 -1
  31. package/dist/server/remote-transport.d.ts +2 -1
  32. package/dist/server/remote-transport.d.ts.map +1 -1
  33. package/dist/server/remote-transport.js +27 -7
  34. package/dist/server/remote-transport.js.map +1 -1
  35. package/dist/server/schemas.d.ts +5 -29
  36. package/dist/server/schemas.d.ts.map +1 -1
  37. package/dist/server/schemas.js +6 -6
  38. package/dist/server/schemas.js.map +1 -1
  39. package/dist/vectordb/index.d.ts +12 -9
  40. package/dist/vectordb/index.d.ts.map +1 -1
  41. package/dist/vectordb/index.js +242 -163
  42. package/dist/vectordb/index.js.map +1 -1
  43. package/dist/web/api-routes.d.ts.map +1 -1
  44. package/dist/web/api-routes.js +23 -10
  45. package/dist/web/api-routes.js.map +1 -1
  46. package/dist/web/database-manager.d.ts.map +1 -1
  47. package/dist/web/database-manager.js +32 -25
  48. package/dist/web/database-manager.js.map +1 -1
  49. package/dist/web/http-server.d.ts +0 -5
  50. package/dist/web/http-server.d.ts.map +1 -1
  51. package/dist/web/http-server.js +4 -8
  52. package/dist/web/http-server.js.map +1 -1
  53. package/dist/web/index.js +4 -2
  54. package/dist/web/index.js.map +1 -1
  55. package/dist/web/middleware/async-handler.d.ts +2 -1
  56. package/dist/web/middleware/async-handler.d.ts.map +1 -1
  57. package/dist/web/middleware/rate-limit.d.ts +2 -1
  58. package/dist/web/middleware/rate-limit.d.ts.map +1 -1
  59. package/dist/web/middleware/request-logger.d.ts +1 -1
  60. package/dist/web/middleware/request-logger.d.ts.map +1 -1
  61. package/package.json +1 -1
  62. package/web-ui/dist/assets/{CollectionsPage-BDmEfv3V.js → CollectionsPage-CjLs8_5j.js} +1 -1
  63. package/web-ui/dist/assets/{FilesPage-pG9HmpgQ.js → FilesPage-Bw9x9aMr.js} +1 -1
  64. package/web-ui/dist/assets/ReaderPage-JPNiOF-x.js +28 -0
  65. package/web-ui/dist/assets/{ReaderSettingsContext-CkSjqsRh.js → ReaderSettingsContext-BLFJnEne.js} +1 -1
  66. package/web-ui/dist/assets/{SearchPage-DAltjnLL.js → SearchPage-D3_Vtbdw.js} +1 -1
  67. package/web-ui/dist/assets/{SettingsPage-C6J5BITP.js → SettingsPage-BAxB2264.js} +1 -1
  68. package/web-ui/dist/assets/{StatusPage-powRGmW3.js → StatusPage-CzJZW8Gs.js} +1 -1
  69. package/web-ui/dist/assets/{UploadPage-eyfSjL4u.js → UploadPage-DW8OujeJ.js} +5 -5
  70. package/web-ui/dist/assets/index-ANt8Xo4z.js +6 -0
  71. package/web-ui/dist/assets/index-DovQIIL4.css +1 -0
  72. package/web-ui/dist/assets/motion-Brxs0UET.js +9 -0
  73. package/web-ui/dist/assets/vendor-DSXQOR6A.js +10 -0
  74. package/web-ui/dist/index.html +3 -3
  75. package/web-ui/dist/assets/ReaderPage-CwMN03NU.js +0 -28
  76. package/web-ui/dist/assets/index-BpwaiuGL.css +0 -1
  77. package/web-ui/dist/assets/index-D068MV_o.js +0 -6
  78. package/web-ui/dist/assets/motion-CKwJwI3J.js +0 -9
  79. package/web-ui/dist/assets/vendor-C2QPsZ3S.js +0 -10
@@ -0,0 +1,9 @@
1
+ import{a as x,j as Y}from"./query-DPt-uCb6.js";const _e=x.createContext({});function Xe(t){const e=x.useRef(null);return e.current===null&&(e.current=t()),e.current}const Lo=typeof window<"u",Hs=Lo?x.useLayoutEffect:x.useEffect,ne=x.createContext(null);function Ye(t,e){t.indexOf(e)===-1&&t.push(e)}function Xt(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const X=(t,e,n)=>n>e?e:n<t?t:n;let qe=()=>{};const q={},zs=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function Gs(t){return typeof t=="object"&&t!==null}const _s=t=>/^0[^.\s]+$/u.test(t);function Xs(t){let e;return()=>(e===void 0&&(e=t()),e)}const W=t=>t,ko=(t,e)=>n=>e(t(n)),Lt=(...t)=>t.reduce(ko),Ct=(t,e,n)=>{const s=e-t;return s===0?1:(n-t)/s};class Ze{constructor(){this.subscriptions=[]}add(e){return Ye(this.subscriptions,e),()=>Xt(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 H=t=>t*1e3,U=t=>t/1e3;function Ys(t,e){return e?t*(1e3/e):0}const qs=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Fo=1e-7,Io=12;function Bo(t,e,n,s,i){let r,o,a=0;do o=e+(n-e)/2,r=qs(o,s,i)-t,r>0?n=o:e=o;while(Math.abs(r)>Fo&&++a<Io);return o}function kt(t,e,n,s){if(t===e&&n===s)return W;const i=r=>Bo(r,0,1,t,n);return r=>r===0||r===1?r:qs(i(r),e,s)}const Zs=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Js=t=>e=>1-t(1-e),Qs=kt(.33,1.53,.69,.99),Je=Js(Qs),ti=Zs(Je),ei=t=>(t*=2)<1?.5*Je(t):.5*(2-Math.pow(2,-10*(t-1))),Qe=t=>1-Math.sin(Math.acos(t)),ni=Js(Qe),si=Zs(Qe),jo=kt(.42,0,1,1),Oo=kt(0,0,.58,1),ii=kt(.42,0,.58,1),No=t=>Array.isArray(t)&&typeof t[0]!="number",oi=t=>Array.isArray(t)&&typeof t[0]=="number",Uo={linear:W,easeIn:jo,easeInOut:ii,easeOut:Oo,circIn:Qe,circInOut:si,circOut:ni,backIn:Je,backInOut:ti,backOut:Qs,anticipate:ei},Wo=t=>typeof t=="string",Cn=t=>{if(oi(t)){qe(t.length===4);const[e,n,s,i]=t;return kt(e,n,s,i)}else if(Wo(t))return Uo[t];return t},jt=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Ko(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,f=!1,h=!1)=>{const p=h&&i?n:s;return f&&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 $o=40;function ri(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,o=jt.reduce((g,P)=>(g[P]=Ko(r),g),{}),{setup:a,read:c,resolveKeyframes:u,preUpdate:l,update:f,preRender:h,render:d,postRender:p}=o,m=()=>{const g=q.useManualTiming?i.timestamp:performance.now();n=!1,q.useManualTiming||(i.delta=s?1e3/60:Math.max(Math.min(g-i.timestamp,$o),1)),i.timestamp=g,i.isProcessing=!0,a.process(i),c.process(i),u.process(i),l.process(i),f.process(i),h.process(i),d.process(i),p.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(m))},y=()=>{n=!0,s=!0,i.isProcessing||t(m)};return{schedule:jt.reduce((g,P)=>{const S=o[P];return g[P]=(V,M=!1,b=!1)=>(n||y(),S.schedule(V,M,b)),g},{}),cancel:g=>{for(let P=0;P<jt.length;P++)o[jt[P]].cancel(g)},state:i,steps:o}}const{schedule:C,cancel:tt,state:I,steps:re}=ri(typeof requestAnimationFrame<"u"?requestAnimationFrame:W,!0);let Wt;function Ho(){Wt=void 0}const j={now:()=>(Wt===void 0&&j.set(I.isProcessing||q.useManualTiming?I.timestamp:performance.now()),Wt),set:t=>{Wt=t,queueMicrotask(Ho)}},ai=t=>e=>typeof e=="string"&&e.startsWith(t),li=ai("--"),zo=ai("var(--"),tn=t=>zo(t)?Go.test(t.split("/*")[0].trim()):!1,Go=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Mn(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const vt={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Mt={...vt,transform:t=>X(0,1,t)},Ot={...vt,default:1},St=t=>Math.round(t*1e5)/1e5,en=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function _o(t){return t==null}const Xo=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,nn=(t,e)=>n=>!!(typeof n=="string"&&Xo.test(n)&&n.startsWith(t)||e&&!_o(n)&&Object.prototype.hasOwnProperty.call(n,e)),ci=(t,e,n)=>s=>{if(typeof s!="string")return s;const[i,r,o,a]=s.match(en);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Yo=t=>X(0,255,t),ae={...vt,transform:t=>Math.round(Yo(t))},rt={test:nn("rgb","red"),parse:ci("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+ae.transform(t)+", "+ae.transform(e)+", "+ae.transform(n)+", "+St(Mt.transform(s))+")"};function qo(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 Se={test:nn("#"),parse:qo,transform:rt.transform},Ft=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),J=Ft("deg"),_=Ft("%"),w=Ft("px"),Zo=Ft("vh"),Jo=Ft("vw"),Dn={..._,parse:t=>_.parse(t)/100,transform:t=>_.transform(t*100)},ht={test:nn("hsl","hue"),parse:ci("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+_.transform(St(e))+", "+_.transform(St(n))+", "+St(Mt.transform(s))+")"},R={test:t=>rt.test(t)||Se.test(t)||ht.test(t),parse:t=>rt.test(t)?rt.parse(t):ht.test(t)?ht.parse(t):Se.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?rt.transform(t):ht.transform(t),getAnimatableNone:t=>{const e=R.parse(t);return e.alpha=0,R.transform(e)}},Qo=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function tr(t){return isNaN(t)&&typeof t=="string"&&(t.match(en)?.length||0)+(t.match(Qo)?.length||0)>0}const ui="number",hi="color",er="var",nr="var(",En="${}",sr=/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 Dt(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const a=e.replace(sr,c=>(R.test(c)?(s.color.push(r),i.push(hi),n.push(R.parse(c))):c.startsWith(nr)?(s.var.push(r),i.push(er),n.push(c)):(s.number.push(r),i.push(ui),n.push(parseFloat(c))),++r,En)).split(En);return{values:n,split:a,indexes:s,types:i}}function fi(t){return Dt(t).values}function di(t){const{split:e,types:n}=Dt(t),s=e.length;return i=>{let r="";for(let o=0;o<s;o++)if(r+=e[o],i[o]!==void 0){const a=n[o];a===ui?r+=St(i[o]):a===hi?r+=R.transform(i[o]):r+=i[o]}return r}}const ir=t=>typeof t=="number"?0:R.test(t)?R.getAnimatableNone(t):t;function or(t){const e=fi(t);return di(t)(e.map(ir))}const z={test:tr,parse:fi,createTransformer:di,getAnimatableNone:or};function le(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 rr({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=le(c,a,t+1/3),r=le(c,a,t),o=le(c,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(r*255),blue:Math.round(o*255),alpha:s}}function Yt(t,e){return n=>n>0?e:t}const D=(t,e,n)=>t+(e-t)*n,ce=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},ar=[Se,rt,ht],lr=t=>ar.find(e=>e.test(t));function Rn(t){const e=lr(t);if(!e)return!1;let n=e.parse(t);return e===ht&&(n=rr(n)),n}const Ln=(t,e)=>{const n=Rn(t),s=Rn(e);if(!n||!s)return Yt(t,e);const i={...n};return r=>(i.red=ce(n.red,s.red,r),i.green=ce(n.green,s.green,r),i.blue=ce(n.blue,s.blue,r),i.alpha=D(n.alpha,s.alpha,r),rt.transform(i))},be=new Set(["none","hidden"]);function cr(t,e){return be.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function ur(t,e){return n=>D(t,e,n)}function sn(t){return typeof t=="number"?ur:typeof t=="string"?tn(t)?Yt:R.test(t)?Ln:dr:Array.isArray(t)?pi:typeof t=="object"?R.test(t)?Ln:hr:Yt}function pi(t,e){const n=[...t],s=n.length,i=t.map((r,o)=>sn(r)(r,e[o]));return r=>{for(let o=0;o<s;o++)n[o]=i[o](r);return n}}function hr(t,e){const n={...t,...e},s={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(s[i]=sn(t[i])(t[i],e[i]));return i=>{for(const r in s)n[r]=s[r](i);return n}}function fr(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 dr=(t,e)=>{const n=z.createTransformer(e),s=Dt(t),i=Dt(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?be.has(t)&&!i.values.length||be.has(e)&&!s.values.length?cr(t,e):Lt(pi(fr(s,i),i.values),n):Yt(t,e)};function mi(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?D(t,e,n):sn(t)(t,e)}const pr=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>C.update(e,n),stop:()=>tt(e),now:()=>I.isProcessing?I.timestamp:j.now()}},gi=(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)})`},qt=2e4;function on(t){let e=0;const n=50;let s=t.next(e);for(;!s.done&&e<qt;)e+=n,s=t.next(e);return e>=qt?1/0:e}function mr(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(on(s),qt);return{type:"keyframes",ease:r=>s.next(i*r).value/e,duration:U(i)}}const gr=5;function yi(t,e,n){const s=Math.max(e-gr,0);return Ys(n-t(s),e-s)}const E={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},ue=.001;function yr({duration:t=E.duration,bounce:e=E.bounce,velocity:n=E.velocity,mass:s=E.mass}){let i,r,o=1-e;o=X(E.minDamping,E.maxDamping,o),t=X(E.minDuration,E.maxDuration,U(t)),o<1?(i=u=>{const l=u*o,f=l*t,h=l-n,d=Ae(u,o),p=Math.exp(-f);return ue-h/d*p},r=u=>{const f=u*o*t,h=f*n+n,d=Math.pow(o,2)*Math.pow(u,2)*t,p=Math.exp(-f),m=Ae(Math.pow(u,2),o);return(-i(u)+ue>0?-1:1)*((h-d)*p)/m}):(i=u=>{const l=Math.exp(-u*t),f=(u-n)*t+1;return-ue+l*f},r=u=>{const l=Math.exp(-u*t),f=(n-u)*(t*t);return l*f});const a=5/t,c=Tr(i,r,a);if(t=H(t),isNaN(c))return{stiffness:E.stiffness,damping:E.damping,duration:t};{const u=Math.pow(c,2)*s;return{stiffness:u,damping:o*2*Math.sqrt(s*u),duration:t}}}const vr=12;function Tr(t,e,n){let s=n;for(let i=1;i<vr;i++)s=s-t(s)/e(s);return s}function Ae(t,e){return t*Math.sqrt(1-e*e)}const xr=["duration","bounce"],wr=["stiffness","damping","mass"];function kn(t,e){return e.some(n=>t[n]!==void 0)}function Pr(t){let e={velocity:E.velocity,stiffness:E.stiffness,damping:E.damping,mass:E.mass,isResolvedFromDuration:!1,...t};if(!kn(t,wr)&&kn(t,xr))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,r=2*X(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:E.mass,stiffness:i,damping:r}}else{const n=yr({...t,velocity:0});e={...e,...n,mass:E.mass},e.isResolvedFromDuration=!0}return e}function Zt(t=E.visualDuration,e=E.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:f,velocity:h,isResolvedFromDuration:d}=Pr({...n,velocity:-U(n.velocity||0)}),p=h||0,m=u/(2*Math.sqrt(c*l)),y=o-r,v=U(Math.sqrt(c/l)),T=Math.abs(y)<5;s||(s=T?E.restSpeed.granular:E.restSpeed.default),i||(i=T?E.restDelta.granular:E.restDelta.default);let g;if(m<1){const S=Ae(v,m);g=V=>{const M=Math.exp(-m*v*V);return o-M*((p+m*v*y)/S*Math.sin(S*V)+y*Math.cos(S*V))}}else if(m===1)g=S=>o-Math.exp(-v*S)*(y+(p+v*y)*S);else{const S=v*Math.sqrt(m*m-1);g=V=>{const M=Math.exp(-m*v*V),b=Math.min(S*V,300);return o-M*((p+m*v*y)*Math.sinh(b)+S*y*Math.cosh(b))/S}}const P={calculatedDuration:d&&f||null,next:S=>{const V=g(S);if(d)a.done=S>=f;else{let M=S===0?p:0;m<1&&(M=S===0?H(p):yi(g,S,V));const b=Math.abs(M)<=s,A=Math.abs(o-V)<=i;a.done=b&&A}return a.value=a.done?o:V,a},toString:()=>{const S=Math.min(on(P),qt),V=gi(M=>P.next(S*M).value,S,30);return S+"ms "+V},toTransition:()=>{}};return P}Zt.applyToOptions=t=>{const e=mr(t,100,Zt);return t.ease=e.ease,t.duration=H(e.duration),t.type="keyframes",t};function Ve({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 f=t[0],h={done:!1,value:f},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 y=f+m,v=o===void 0?y:o(y);v!==y&&(m=v-f);const T=b=>-m*Math.exp(-b/s),g=b=>v+T(b),P=b=>{const A=T(b),L=g(b);h.done=Math.abs(A)<=u,h.value=h.done?v:L};let S,V;const M=b=>{d(h.value)&&(S=b,V=Zt({keyframes:[h.value,p(h.value)],velocity:yi(g,b,h.value),damping:i,stiffness:r,restDelta:u,restSpeed:l}))};return M(0),{calculatedDuration:null,next:b=>{let A=!1;return!V&&S===void 0&&(A=!0,P(b),M(b)),S!==void 0&&b>=S?V.next(b-S):(!A&&P(b),h)}}}function Sr(t,e,n){const s=[],i=n||q.mix||mi,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]||W:e;a=Lt(c,a)}s.push(a)}return s}function br(t,e,{clamp:n=!0,ease:s,mixer:i}={}){const r=t.length;if(qe(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=Sr(e,s,i),c=a.length,u=l=>{if(o&&l<t[0])return e[0];let f=0;if(c>1)for(;f<t.length-2&&!(l<t[f+1]);f++);const h=Ct(t[f],t[f+1],l);return a[f](h)};return n?l=>u(X(t[0],t[r-1],l)):u}function Ar(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=Ct(0,e,s);t.push(D(n,1,i))}}function Vr(t){const e=[0];return Ar(e,t.length-1),e}function Cr(t,e){return t.map(n=>n*e)}function Mr(t,e){return t.map(()=>e||ii).splice(0,t.length-1)}function bt({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=No(s)?s.map(Cn):Cn(s),r={done:!1,value:e[0]},o=Cr(n&&n.length===e.length?n:Vr(e),t),a=br(o,e,{ease:Array.isArray(i)?i:Mr(e,i)});return{calculatedDuration:t,next:c=>(r.value=a(c),r.done=c>=t,r)}}const Dr=t=>t!==null;function rn(t,{repeat:e,repeatType:n="loop"},s,i=1){const r=t.filter(Dr),a=i<0||e&&n!=="loop"&&e%2===1?0:r.length-1;return!a||s===void 0?r[a]:s}const Er={decay:Ve,inertia:Ve,tween:bt,keyframes:bt,spring:Zt};function vi(t){typeof t.type=="string"&&(t.type=Er[t.type])}class an{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 Rr=t=>t/100;class ln extends an{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!==j.now()&&this.tick(j.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;vi(e);const{type:n=bt,repeat:s=0,repeatDelay:i=0,repeatType:r,velocity:o=0}=e;let{keyframes:a}=e;const c=n||bt;c!==bt&&typeof a[0]!="number"&&(this.mixKeyframes=Lt(Rr,mi(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=on(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:f,repeatType:h,repeatDelay:d,type:p,onUpdate:m,finalKeyframe:y}=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 v=this.currentTime-u*(this.playbackSpeed>=0?1:-1),T=this.playbackSpeed>=0?v<0:v>i;this.currentTime=Math.max(v,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let g=this.currentTime,P=s;if(f){const b=Math.min(this.currentTime,i)/a;let A=Math.floor(b),L=b%1;!L&&b>=1&&(L=1),L===1&&A--,A=Math.min(A,f+1),A%2&&(h==="reverse"?(L=1-L,d&&(L-=d/a)):h==="mirror"&&(P=o)),g=X(0,1,L)*a}const S=T?{done:!1,value:l[0]}:P.next(g);r&&(S.value=r(S.value));let{done:V}=S;!T&&c!==null&&(V=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const M=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&V);return M&&p!==Ve&&(S.value=rn(l,this.options,y,this.speed)),m&&m(S.value),M&&this.finish(),S}then(e,n){return this.finished.then(e,n)}get duration(){return U(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+U(e)}get time(){return U(this.currentTime)}set time(e){e=H(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?.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(j.now());const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=U(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=pr,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(j.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 Lr(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const at=t=>t*180/Math.PI,Ce=t=>{const e=at(Math.atan2(t[1],t[0]));return Me(e)},kr={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Ce,rotateZ:Ce,skewX:t=>at(Math.atan(t[1])),skewY:t=>at(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Me=t=>(t=t%360,t<0&&(t+=360),t),Fn=Ce,In=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Bn=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Fr={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:In,scaleY:Bn,scale:t=>(In(t)+Bn(t))/2,rotateX:t=>Me(at(Math.atan2(t[6],t[5]))),rotateY:t=>Me(at(Math.atan2(-t[2],t[0]))),rotateZ:Fn,rotate:Fn,skewX:t=>at(Math.atan(t[4])),skewY:t=>at(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function De(t){return t.includes("scale")?1:0}function Ee(t,e){if(!t||t==="none")return De(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=Fr,i=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=kr,i=a}if(!i)return De(e);const r=s[e],o=i[1].split(",").map(Br);return typeof r=="function"?r(o):o[r]}const Ir=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Ee(n,e)};function Br(t){return parseFloat(t.trim())}const Tt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],xt=new Set(Tt),jn=t=>t===vt||t===w,jr=new Set(["x","y","z"]),Or=Tt.filter(t=>!jr.has(t));function Nr(t){const e=[];return Or.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}const Q={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})=>Ee(e,"x"),y:(t,{transform:e})=>Ee(e,"y")};Q.translateX=Q.x;Q.translateY=Q.y;const lt=new Set;let Re=!1,Le=!1,ke=!1;function Ti(){if(Le){const t=Array.from(lt).filter(s=>s.needsMeasurement),e=new Set(t.map(s=>s.element)),n=new Map;e.forEach(s=>{const i=Nr(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)})}Le=!1,Re=!1,lt.forEach(t=>t.complete(ke)),lt.clear()}function xi(){lt.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Le=!0)})}function Ur(){ke=!0,xi(),Ti(),ke=!1}class cn{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?(lt.add(this),Re||(Re=!0,C.read(xi),C.resolveKeyframes(Ti))):(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])}Lr(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),lt.delete(this)}cancel(){this.state==="scheduled"&&(lt.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Wr=t=>t.startsWith("--");function Kr(t,e,n){Wr(e)?t.style.setProperty(e,n):t.style[e]=n}const $r={};function wi(t,e){const n=Xs(t);return()=>$r[e]??n()}const Hr=wi(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Pi=wi(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Pt=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,On={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Pt([0,.65,.55,1]),circOut:Pt([.55,0,1,.45]),backIn:Pt([.31,.01,.66,-.59]),backOut:Pt([.33,1.53,.69,.99])};function Si(t,e){if(t)return typeof t=="function"?Pi()?gi(t,e):"ease-out":oi(t)?Pt(t):Array.isArray(t)?t.map(n=>Si(n,e)||On.easeOut):On[t]}function zr(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 f=Si(a,i);Array.isArray(f)&&(l.easing=f);const h={delay:s,duration:i,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:r+1,direction:o==="reverse"?"alternate":"normal"};return u&&(h.pseudoElement=u),t.animate(l,h)}function bi(t){return typeof t=="function"&&"applyToOptions"in t}function Gr({type:t,...e}){return bi(t)&&Pi()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class Ai extends an{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,qe(typeof e.type!="string");const u=Gr(e);this.animation=zr(n,s,i,u,r),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const l=rn(i,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(l),Kr(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 U(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+U(e)}get time(){return U(Number(this.animation.currentTime)||0)}set time(e){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=H(e)}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&&Hr()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),s&&(this.animation.rangeEnd=s),W):i(this)}}const Vi={anticipate:ei,backInOut:ti,circInOut:si};function _r(t){return t in Vi}function Xr(t){typeof t.ease=="string"&&_r(t.ease)&&(t.ease=Vi[t.ease])}const he=10;class Yr extends Ai{constructor(e){Xr(e),vi(e),super(e),e.startTime!==void 0&&(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 ln({...o,autoplay:!1}),c=Math.max(he,j.now()-this.startTime),u=X(0,he,c-he);n.setWithVelocity(a.sample(Math.max(0,c-u)).value,a.sample(c).value,u),a.stop()}}const Nn=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(z.test(t)||t==="0")&&!t.startsWith("url("));function qr(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 Zr(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=Nn(i,e),a=Nn(r,e);return!o||!a?!1:qr(t)||(n==="spring"||bi(n))&&s}function Fe(t){t.duration=0,t.type="keyframes"}const Jr=new Set(["opacity","clipPath","filter","transform"]),Qr=Xs(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function ta(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 Qr()&&n&&Jr.has(n)&&(n!=="transform"||!u)&&!c&&!s&&i!=="mirror"&&r!==0&&o!=="inertia"}const ea=40;class na extends an{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,...f}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=j.now();const h={autoplay:e,delay:n,type:s,repeat:i,repeatDelay:r,repeatType:o,name:c,motionValue:u,element:l,...f},d=l?.KeyframeResolver||cn;this.keyframeResolver=new d(a,(p,m,y)=>this.onKeyframesResolved(p,m,h,!y),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=j.now(),Zr(e,r,o,a)||((q.instantAnimations||!c)&&l?.(rn(e,s,n)),e[0]=e[e.length-1],Fe(s),s.repeat=0);const h={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>ea?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:e},d=!u&&ta(h),p=h.motionValue?.owner?.current,m=d?new Yr({...h,element:p}):new ln(h);m.finished.then(()=>{this.notifyFinished()}).catch(W),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(),Ur()),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 Ci(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 sa=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ia(t){const e=sa.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}function Mi(t,e,n=1){const[s,i]=ia(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);if(r){const o=r.trim();return zs(o)?parseFloat(o):o}return tn(i)?Mi(i,e,n+1):i}const oa={type:"spring",stiffness:500,damping:25,restSpeed:10},ra=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),aa={type:"keyframes",duration:.8},la={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ca=(t,{keyframes:e})=>e.length>2?aa:xt.has(t)?t.startsWith("scale")?ra(e[1]):oa:la,ua=t=>t!==null;function ha(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(ua),r=e&&n!=="loop"&&e%2===1?0:i.length-1;return i[r]}function Di(t,e){if(t?.inherit&&e){const{inherit:n,...s}=t;return{...e,...s}}return t}function un(t,e){const n=t?.[e]??t?.default??t;return n!==t?Di(n,t):n}function fa({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 hn=(t,e,n,s={},i,r)=>o=>{const a=un(s,t)||{},c=a.delay||s.delay||0;let{elapsed:u=0}=s;u=u-H(c);const l={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:h=>{e.set(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:r?void 0:i};fa(a)||Object.assign(l,ca(t,l)),l.duration&&(l.duration=H(l.duration)),l.repeatDelay&&(l.repeatDelay=H(l.repeatDelay)),l.from!==void 0&&(l.keyframes[0]=l.from);let f=!1;if((l.type===!1||l.duration===0&&!l.repeatDelay)&&(Fe(l),l.delay===0&&(f=!0)),(q.instantAnimations||q.skipAnimations||i?.shouldSkipAnimations)&&(f=!0,Fe(l),l.delay=0),l.allowFlatten=!a.type&&!a.ease,f&&!r&&e.get()!==void 0){const h=ha(l.keyframes,a);if(h!==void 0){C.update(()=>{l.onUpdate(h),l.onComplete()});return}}return a.isSync?new ln(l):new na(l)};function Un(t){const e=[{},{}];return t?.values.forEach((n,s)=>{e[0][s]=n.get(),e[1][s]=n.getVelocity()}),e}function fn(t,e,n,s){if(typeof e=="function"){const[i,r]=Un(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]=Un(s);e=e(n!==void 0?n:t.custom,i,r)}return e}function gt(t,e,n){const s=t.getProps();return fn(s,e,n!==void 0?n:s.custom,t)}const Ei=new Set(["width","height","top","left","right","bottom",...Tt]),Wn=30,da=t=>!isNaN(parseFloat(t));class pa{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{const i=j.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=j.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=da(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 Ze);const s=this.events[e].add(n);return e==="change"?()=>{s(),C.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=j.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Wn)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Wn);return Ys(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 yt(t,e){return new pa(t,e)}const Ie=t=>Array.isArray(t);function ma(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,yt(n))}function ga(t){return Ie(t)?t[t.length-1]||0:t}function ya(t,e){const n=gt(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const o in r){const a=ga(r[o]);ma(t,o,a)}}const B=t=>!!(t&&t.getVelocity);function va(t){return!!(B(t)&&t.add)}function Be(t,e){const n=t.getValue("willChange");if(va(n))return n.add(e);if(!n&&q.WillChange){const s=new q.WillChange("auto");t.addValue("willChange",s),s.add(e)}}function dn(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const Ta="framerAppearId",Ri="data-"+dn(Ta);function Li(t){return t.props[Ri]}function xa({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function ki(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:r,transitionEnd:o,...a}=e;const c=t.getDefaultTransition();r=r?Di(r,c):c;const u=r?.reduceMotion;s&&(r=s);const l=[],f=i&&t.animationState&&t.animationState.getState()[i];for(const h in a){const d=t.getValue(h,t.latestValues[h]??null),p=a[h];if(p===void 0||f&&xa(f,h))continue;const m={delay:n,...un(r||{},h)},y=d.get();if(y!==void 0&&!d.isAnimating&&!Array.isArray(p)&&p===y&&!m.velocity)continue;let v=!1;if(window.MotionHandoffAnimation){const P=Li(t);if(P){const S=window.MotionHandoffAnimation(P,h,C);S!==null&&(m.startTime=S,v=!0)}}Be(t,h);const T=u??t.shouldReduceMotion;d.start(hn(h,d,p,T&&Ei.has(h)?{type:!1}:m,t,v));const g=d.animation;g&&l.push(g)}if(o){const h=()=>C.update(()=>{o&&ya(t,o)});l.length?Promise.all(l).then(h):h()}return l}function je(t,e,n={}){const s=gt(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(ki(t,s,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:l,staggerDirection:f}=i;return wa(t,e,c,u,l,f,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 wa(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(je(c,e,{...o,delay:n+(typeof s=="function"?0:s)+Ci(t.variantChildren,c,s,i,r)}).then(()=>c.notify("AnimationComplete",e)));return Promise.all(a)}function Pa(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(r=>je(t,r,n));s=Promise.all(i)}else if(typeof e=="string")s=je(t,e,n);else{const i=typeof e=="function"?gt(t,e,n.custom):e;s=Promise.all(ki(t,i,n))}return s.then(()=>{t.notify("AnimationComplete",e)})}const Sa={test:t=>t==="auto",parse:t=>t},Fi=t=>e=>e.test(t),Ii=[vt,w,_,J,Jo,Zo,Sa],Kn=t=>Ii.find(Fi(t));function ba(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||_s(t):!0}const Aa=new Set(["brightness","contrast","saturate","opacity"]);function Va(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(en)||[];if(!s)return t;const i=n.replace(s,"");let r=Aa.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const Ca=/\b([a-z-]*)\(.*?\)/gu,Oe={...z,getAnimatableNone:t=>{const e=t.match(Ca);return e?e.map(Va).join(" "):t}},Ne={...z,getAnimatableNone:t=>{const e=z.parse(t);return z.createTransformer(t)(e.map(s=>typeof s=="number"?0:typeof s=="object"?{...s,alpha:1}:s))}},$n={...vt,transform:Math.round},Ma={rotate:J,rotateX:J,rotateY:J,rotateZ:J,scale:Ot,scaleX:Ot,scaleY:Ot,scaleZ:Ot,skew:J,skewX:J,skewY:J,distance:w,translateX:w,translateY:w,translateZ:w,x:w,y:w,z:w,perspective:w,transformPerspective:w,opacity:Mt,originX:Dn,originY:Dn,originZ:w},pn={borderWidth:w,borderTopWidth:w,borderRightWidth:w,borderBottomWidth:w,borderLeftWidth:w,borderRadius:w,borderTopLeftRadius:w,borderTopRightRadius:w,borderBottomRightRadius:w,borderBottomLeftRadius:w,width:w,maxWidth:w,height:w,maxHeight:w,top:w,right:w,bottom:w,left:w,inset:w,insetBlock:w,insetBlockStart:w,insetBlockEnd:w,insetInline:w,insetInlineStart:w,insetInlineEnd:w,padding:w,paddingTop:w,paddingRight:w,paddingBottom:w,paddingLeft:w,paddingBlock:w,paddingBlockStart:w,paddingBlockEnd:w,paddingInline:w,paddingInlineStart:w,paddingInlineEnd:w,margin:w,marginTop:w,marginRight:w,marginBottom:w,marginLeft:w,marginBlock:w,marginBlockStart:w,marginBlockEnd:w,marginInline:w,marginInlineStart:w,marginInlineEnd:w,fontSize:w,backgroundPositionX:w,backgroundPositionY:w,...Ma,zIndex:$n,fillOpacity:Mt,strokeOpacity:Mt,numOctaves:$n},Da={...pn,color:R,backgroundColor:R,outlineColor:R,fill:R,stroke:R,borderColor:R,borderTopColor:R,borderRightColor:R,borderBottomColor:R,borderLeftColor:R,filter:Oe,WebkitFilter:Oe,mask:Ne,WebkitMask:Ne},Bi=t=>Da[t],Ea=new Set([Oe,Ne]);function ji(t,e){let n=Bi(t);return Ea.has(n)||(n=z),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Ra=new Set(["auto","none","0"]);function La(t,e,n){let s=0,i;for(;s<t.length&&!i;){const r=t[s];typeof r=="string"&&!Ra.has(r)&&Dt(r).values.length&&(i=t[s]),s++}if(i&&n)for(const r of e)t[r]=ji(n,i)}class ka extends cn{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 f=e[l];if(typeof f=="string"&&(f=f.trim(),tn(f))){const h=Mi(f,n.current);h!==void 0&&(e[l]=h),l===e.length-1&&(this.finalKeyframe=f)}}if(this.resolveNoneKeyframes(),!Ei.has(s)||e.length!==2)return;const[i,r]=e,o=Kn(i),a=Kn(r),c=Mn(i),u=Mn(r);if(c!==u&&Q[s]){this.needsMeasurement=!0;return}if(o!==a)if(jn(o)&&jn(a))for(let l=0;l<e.length;l++){const f=e[l];typeof f=="string"&&(e[l]=parseFloat(f))}else Q[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,s=[];for(let i=0;i<e.length;i++)(e[i]===null||ba(e[i]))&&s.push(i);s.length&&La(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=Q[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]=Q[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 Fa=new Set(["opacity","clipPath","filter","transform"]);function Oi(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 Ni=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function Ue(t){return Gs(t)&&"offsetHeight"in t}const{schedule:mn}=ri(queueMicrotask,!1),$={x:!1,y:!1};function Ui(){return $.x||$.y}function Ia(t){return t==="x"||t==="y"?$[t]?null:($[t]=!0,()=>{$[t]=!1}):$.x||$.y?null:($.x=$.y=!0,()=>{$.x=$.y=!1})}function Wi(t,e){const n=Oi(t),s=new AbortController,i={passive:!0,...e,signal:s.signal};return[n,i,()=>s.abort()]}function Ba(t){return!(t.pointerType==="touch"||Ui())}function ja(t,e,n={}){const[s,i,r]=Wi(t,n);return s.forEach(o=>{let a=!1,c=!1,u;const l=()=>{o.removeEventListener("pointerleave",p)},f=y=>{u&&(u(y),u=void 0),l()},h=y=>{a=!1,window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",h),c&&(c=!1,f(y))},d=()=>{a=!0,window.addEventListener("pointerup",h,i),window.addEventListener("pointercancel",h,i)},p=y=>{if(y.pointerType!=="touch"){if(a){c=!0;return}f(y)}},m=y=>{if(!Ba(y))return;c=!1;const v=e(o,y);typeof v=="function"&&(u=v,o.addEventListener("pointerleave",p,i))};o.addEventListener("pointerenter",m,i),o.addEventListener("pointerdown",d,i)}),r}const Ki=(t,e)=>e?t===e?!0:Ki(t,e.parentElement):!1,gn=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,Oa=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Na(t){return Oa.has(t.tagName)||t.isContentEditable===!0}const Ua=new Set(["INPUT","SELECT","TEXTAREA"]);function Wa(t){return Ua.has(t.tagName)||t.isContentEditable===!0}const Kt=new WeakSet;function Hn(t){return e=>{e.key==="Enter"&&t(e)}}function fe(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Ka=(t,e)=>{const n=t.currentTarget;if(!n)return;const s=Hn(()=>{if(Kt.has(n))return;fe(n,"down");const i=Hn(()=>{fe(n,"up")}),r=()=>fe(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 zn(t){return gn(t)&&!Ui()}const Gn=new WeakSet;function $a(t,e,n={}){const[s,i,r]=Wi(t,n),o=a=>{const c=a.currentTarget;if(!zn(a)||Gn.has(a))return;Kt.add(c),n.stopPropagation&&Gn.add(a);const u=e(c,a),l=(d,p)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),Kt.has(c)&&Kt.delete(c),zn(d)&&typeof u=="function"&&u(d,{success:p})},f=d=>{l(d,c===window||c===document||n.useGlobalTarget||Ki(c,d.target))},h=d=>{l(d,!1)};window.addEventListener("pointerup",f,i),window.addEventListener("pointercancel",h,i)};return s.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),Ue(a)&&(a.addEventListener("focus",u=>Ka(u,i)),!Na(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),r}function yn(t){return Gs(t)&&"ownerSVGElement"in t}const $t=new WeakMap;let Ht;const $i=(t,e,n)=>(s,i)=>i&&i[0]?i[0][t+"Size"]:yn(s)&&"getBBox"in s?s.getBBox()[e]:s[n],Ha=$i("inline","width","offsetWidth"),za=$i("block","height","offsetHeight");function Ga({target:t,borderBoxSize:e}){$t.get(t)?.forEach(n=>{n(t,{get width(){return Ha(t,e)},get height(){return za(t,e)}})})}function _a(t){t.forEach(Ga)}function Xa(){typeof ResizeObserver>"u"||(Ht=new ResizeObserver(_a))}function Ya(t,e){Ht||Xa();const n=Oi(t);return n.forEach(s=>{let i=$t.get(s);i||(i=new Set,$t.set(s,i)),i.add(e),Ht?.observe(s)}),()=>{n.forEach(s=>{const i=$t.get(s);i?.delete(e),i?.size||Ht?.unobserve(s)})}}const zt=new Set;let ft;function qa(){ft=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};zt.forEach(e=>e(t))},window.addEventListener("resize",ft)}function Za(t){return zt.add(t),ft||qa(),()=>{zt.delete(t),!zt.size&&typeof ft=="function"&&(window.removeEventListener("resize",ft),ft=void 0)}}function _n(t,e){return typeof t=="function"?Za(t):Ya(t,e)}function Ja(t){return yn(t)&&t.tagName==="svg"}const Qa=[...Ii,R,z],tl=t=>Qa.find(Fi(t)),Xn=()=>({translate:0,scale:1,origin:0,originPoint:0}),dt=()=>({x:Xn(),y:Xn()}),Yn=()=>({min:0,max:0}),k=()=>({x:Yn(),y:Yn()}),el=new WeakMap;function se(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Et(t){return typeof t=="string"||Array.isArray(t)}const vn=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Tn=["initial",...vn];function ie(t){return se(t.animate)||Tn.some(e=>Et(t[e]))}function Hi(t){return!!(ie(t)||t.variants)}function nl(t,e,n){for(const s in e){const i=e[s],r=n[s];if(B(i))t.addValue(s,i);else if(B(r))t.addValue(s,yt(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,yt(o!==void 0?o:i,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const We={current:null},zi={current:!1},sl=typeof window<"u";function il(){if(zi.current=!0,!!sl)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>We.current=t.matches;t.addEventListener("change",e),e()}else We.current=!1}const qn=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Jt={};function Gi(t){Jt=t}function ol(){return Jt}class rl{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=cn,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=j.now();this.renderScheduledAt<d&&(this.renderScheduledAt=d,C.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=ie(n),this.isVariantNode=Hi(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:f,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const d in h){const p=h[d];u[d]!==void 0&&B(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,el.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:(zi.current||il(),this.shouldReduceMotion=We.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(),tt(this.notifyUpdate),tt(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&&Fa.has(e)&&this.current instanceof HTMLElement){const{factory:o,keyframes:a,times:c,ease:u,duration:l}=n.accelerate,f=new Ai({element:this.current,name:e,keyframes:a,times:c,ease:u,duration:H(l)}),h=o(f);this.valueSubscriptions.set(e,()=>{h(),f.cancel()});return}const s=xt.has(e);s&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&C.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 Jt){const n=Jt[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):k()}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<qn.length;s++){const i=qn[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=nl(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=yt(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"&&(zs(s)||_s(s))?s=parseFloat(s):!tl(s)&&z.test(n)&&(s=ji(e,n)),this.setBaseTarget(e,B(s)?s.get():s)),B(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=fn(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&&!B(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 Ze),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){mn.render(this.render)}}class _i extends rl{constructor(){super(...arguments),this.KeyframeResolver=ka}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;B(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class et{constructor(e){this.isMounted=!1,this.node=e}update(){}}function Xi({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function al({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function ll(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 de(t){return t===void 0||t===1}function Ke({scale:t,scaleX:e,scaleY:n}){return!de(t)||!de(e)||!de(n)}function ot(t){return Ke(t)||Yi(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Yi(t){return Zn(t.x)||Zn(t.y)}function Zn(t){return t&&t!=="0%"}function Qt(t,e,n){const s=t-n,i=e*s;return n+i}function Jn(t,e,n,s,i){return i!==void 0&&(t=Qt(t,i,s)),Qt(t,n,s)+e}function $e(t,e=0,n=1,s,i){t.min=Jn(t.min,e,n,s,i),t.max=Jn(t.max,e,n,s,i)}function qi(t,{x:e,y:n}){$e(t.x,e.translate,e.scale,e.originPoint),$e(t.y,n.translate,n.scale,n.originPoint)}const Qn=.999999999999,ts=1.0000000000001;function cl(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&&mt(t,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),o&&(e.x*=o.x.scale,e.y*=o.y.scale,qi(t,o)),s&&ot(r.latestValues)&&mt(t,r.latestValues))}e.x<ts&&e.x>Qn&&(e.x=1),e.y<ts&&e.y>Qn&&(e.y=1)}function pt(t,e){t.min=t.min+e,t.max=t.max+e}function es(t,e,n,s,i=.5){const r=D(t.min,t.max,i);$e(t,e,n,r,s)}function ns(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function mt(t,e){es(t.x,ns(e.x,t.x),e.scaleX,e.scale,e.originX),es(t.y,ns(e.y,t.y),e.scaleY,e.scale,e.originY)}function Zi(t,e){return Xi(ll(t.getBoundingClientRect(),e))}function ul(t,e,n){const s=Zi(t,n),{scroll:i}=e;return i&&(pt(s.x,i.offset.x),pt(s.y,i.offset.y)),s}const hl={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},fl=Tt.length;function dl(t,e,n){let s="",i=!0;for(let r=0;r<fl;r++){const o=Tt[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=Ni(a,pn[o]);if(!c){i=!1;const l=hl[o]||o;s+=`${l}(${u}) `}n&&(e[o]=u)}}return s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}function xn(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(xt.has(c)){o=!0;continue}else if(li(c)){i[c]=u;continue}else{const l=Ni(u,pn[c]);c.startsWith("origin")?(a=!0,r[c]=l):s[c]=l}}if(e.transform||(o||n?s.transform=dl(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 Ji(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 ss(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const wt={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(w.test(t))t=parseFloat(t);else return t;const n=ss(t,e.target.x),s=ss(t,e.target.y);return`${n}% ${s}%`}},pl={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=z.parse(t);if(i.length>5)return s;const r=z.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=D(a,c,.5);return typeof i[2+o]=="number"&&(i[2+o]/=u),typeof i[3+o]=="number"&&(i[3+o]/=u),r(i)}},He={borderRadius:{...wt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:wt,borderTopRightRadius:wt,borderBottomLeftRadius:wt,borderBottomRightRadius:wt,boxShadow:pl};function Qi(t,{layout:e,layoutId:n}){return xt.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!He[t]||t==="opacity")}function wn(t,e,n){const s=t.style,i=e?.style,r={};if(!s)return r;for(const o in s)(B(s[o])||i&&B(i[o])||Qi(o,t)||n?.getValue(o)?.liveStyle!==void 0)&&(r[o]=s[o]);return r}function ml(t){return window.getComputedStyle(t)}class gl extends _i{constructor(){super(...arguments),this.type="html",this.renderInstance=Ji}readValueFromInstance(e,n){if(xt.has(n))return this.projection?.isProjecting?De(n):Ir(e,n);{const s=ml(e),i=(li(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return Zi(e,n)}build(e,n,s){xn(e,n,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return wn(e,n,s)}}const yl={offset:"stroke-dashoffset",array:"stroke-dasharray"},vl={offset:"strokeDashoffset",array:"strokeDasharray"};function Tl(t,e,n=1,s=0,i=!0){t.pathLength=1;const r=i?yl:vl;t[r.offset]=`${-s}`,t[r.array]=`${e} ${n}`}const xl=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function to(t,{attrX:e,attrY:n,attrScale:s,pathLength:i,pathSpacing:r=1,pathOffset:o=0,...a},c,u,l){if(xn(t,a,u),c){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:f,style:h}=t;f.transform&&(h.transform=f.transform,delete f.transform),(h.transform||f.transformOrigin)&&(h.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),h.transform&&(h.transformBox=l?.transformBox??"fill-box",delete f.transformBox);for(const d of xl)f[d]!==void 0&&(h[d]=f[d],delete f[d]);e!==void 0&&(f.x=e),n!==void 0&&(f.y=n),s!==void 0&&(f.scale=s),i!==void 0&&Tl(f,i,r,o,!1)}const eo=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"]),no=t=>typeof t=="string"&&t.toLowerCase()==="svg";function wl(t,e,n,s){Ji(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(eo.has(i)?i:dn(i),e.attrs[i])}function so(t,e,n){const s=wn(t,e,n);for(const i in t)if(B(t[i])||B(e[i])){const r=Tt.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[r]=t[i]}return s}class Pl extends _i{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=k}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(xt.has(n)){const s=Bi(n);return s&&s.default||0}return n=eo.has(n)?n:dn(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,s){return so(e,n,s)}build(e,n,s){to(e,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(e,n,s,i){wl(e,n,s,i)}mount(e){this.isSVGTag=no(e.tagName),super.mount(e)}}const Sl=Tn.length;function io(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?io(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<Sl;n++){const s=Tn[n],i=t.props[s];(Et(i)||i===!1)&&(e[s]=i)}return e}function oo(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 bl=[...vn].reverse(),Al=vn.length;function Vl(t){return e=>Promise.all(e.map(({animation:n,options:s})=>Pa(t,n,s)))}function Cl(t){let e=Vl(t),n=is(),s=!0,i=!1;const r=u=>(l,f)=>{const h=gt(t,f,u==="exit"?t.presenceContext?.custom:void 0);if(h){const{transition:d,transitionEnd:p,...m}=h;l={...l,...m,...p}}return l};function o(u){e=u(t)}function a(u){const{props:l}=t,f=io(t.parent)||{},h=[],d=new Set;let p={},m=1/0;for(let v=0;v<Al;v++){const T=bl[v],g=n[T],P=l[T]!==void 0?l[T]:f[T],S=Et(P),V=T===u?g.isActive:null;V===!1&&(m=v);let M=P===f[T]&&P!==l[T]&&S;if(M&&(s||i)&&t.manuallyAnimateOnMount&&(M=!1),g.protectedKeys={...p},!g.isActive&&V===null||!P&&!g.prevProp||se(P)||typeof P=="boolean")continue;if(T==="exit"&&g.isActive&&V!==!0){g.prevResolvedValues&&(p={...p,...g.prevResolvedValues});continue}const b=Ml(g.prevProp,P);let A=b||T===u&&g.isActive&&!M&&S||v>m&&S,L=!1;const nt=Array.isArray(P)?P:[P];let Z=nt.reduce(r(T),{});V===!1&&(Z={});const{prevResolvedValues:Bt={}}=g,Eo={...Bt,...Z},An=F=>{A=!0,d.has(F)&&(L=!0,d.delete(F)),g.needsAnimating[F]=!0;const N=t.getValue(F);N&&(N.liveStyle=!1)};for(const F in Eo){const N=Z[F],st=Bt[F];if(p.hasOwnProperty(F))continue;let ct=!1;Ie(N)&&Ie(st)?ct=!oo(N,st):ct=N!==st,ct?N!=null?An(F):d.add(F):N!==void 0&&d.has(F)?An(F):g.protectedKeys[F]=!0}g.prevProp=P,g.prevResolvedValues=Z,g.isActive&&(p={...p,...Z}),(s||i)&&t.blockInitialAnimation&&(A=!1);const Vn=M&&b;A&&(!Vn||L)&&h.push(...nt.map(F=>{const N={type:T};if(typeof F=="string"&&(s||i)&&!Vn&&t.manuallyAnimateOnMount&&t.parent){const{parent:st}=t,ct=gt(st,F);if(st.enteringChildren&&ct){const{delayChildren:Ro}=ct.transition||{};N.delay=Ci(st.enteringChildren,t,Ro)}}return{animation:F,options:N}}))}if(d.size){const v={};if(typeof l.initial!="boolean"){const T=gt(t,Array.isArray(l.initial)?l.initial[0]:l.initial);T&&T.transition&&(v.transition=T.transition)}d.forEach(T=>{const g=t.getBaseTarget(T),P=t.getValue(T);P&&(P.liveStyle=!0),v[T]=g??null}),h.push({animation:v})}let y=!!h.length;return s&&(l.initial===!1||l.initial===l.animate)&&!t.manuallyAnimateOnMount&&(y=!1),s=!1,i=!1,y?e(h):Promise.resolve()}function c(u,l){if(n[u].isActive===l)return Promise.resolve();t.variantChildren?.forEach(h=>h.animationState?.setActive(u,l)),n[u].isActive=l;const f=a(u);for(const h in n)n[h].protectedKeys={};return f}return{animateChanges:a,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=is(),i=!0}}}function Ml(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!oo(e,t):!1}function it(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function is(){return{animate:it(!0),whileInView:it(),whileHover:it(),whileTap:it(),whileDrag:it(),whileFocus:it(),exit:it()}}function os(t,e){t.min=e.min,t.max=e.max}function K(t,e){os(t.x,e.x),os(t.y,e.y)}function rs(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const ro=1e-4,Dl=1-ro,El=1+ro,ao=.01,Rl=0-ao,Ll=0+ao;function O(t){return t.max-t.min}function kl(t,e,n){return Math.abs(t-e)<=n}function as(t,e,n,s=.5){t.origin=s,t.originPoint=D(e.min,e.max,t.origin),t.scale=O(n)/O(e),t.translate=D(n.min,n.max,t.origin)-t.originPoint,(t.scale>=Dl&&t.scale<=El||isNaN(t.scale))&&(t.scale=1),(t.translate>=Rl&&t.translate<=Ll||isNaN(t.translate))&&(t.translate=0)}function At(t,e,n,s){as(t.x,e.x,n.x,s?s.originX:void 0),as(t.y,e.y,n.y,s?s.originY:void 0)}function ls(t,e,n){t.min=n.min+e.min,t.max=t.min+O(e)}function Fl(t,e,n){ls(t.x,e.x,n.x),ls(t.y,e.y,n.y)}function cs(t,e,n){t.min=e.min-n.min,t.max=t.min+O(e)}function te(t,e,n){cs(t.x,e.x,n.x),cs(t.y,e.y,n.y)}function us(t,e,n,s,i){return t-=e,t=Qt(t,1/n,s),i!==void 0&&(t=Qt(t,1/i,s)),t}function Il(t,e=0,n=1,s=.5,i,r=t,o=t){if(_.test(e)&&(e=parseFloat(e),e=D(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=D(r.min,r.max,s);t===r&&(a-=e),t.min=us(t.min,e,n,a,i),t.max=us(t.max,e,n,a,i)}function hs(t,e,[n,s,i],r,o){Il(t,e[n],e[s],e[i],e.scale,r,o)}const Bl=["x","scaleX","originX"],jl=["y","scaleY","originY"];function fs(t,e,n,s){hs(t.x,e,Bl,n?n.x:void 0,s?s.x:void 0),hs(t.y,e,jl,n?n.y:void 0,s?s.y:void 0)}function ds(t){return t.translate===0&&t.scale===1}function lo(t){return ds(t.x)&&ds(t.y)}function ps(t,e){return t.min===e.min&&t.max===e.max}function Ol(t,e){return ps(t.x,e.x)&&ps(t.y,e.y)}function ms(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function co(t,e){return ms(t.x,e.x)&&ms(t.y,e.y)}function gs(t){return O(t.x)/O(t.y)}function ys(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function G(t){return[t("x"),t("y")]}function Nl(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:f,rotateY:h,skewX:d,skewY:p}=n;u&&(s=`perspective(${u}px) ${s}`),l&&(s+=`rotate(${l}deg) `),f&&(s+=`rotateX(${f}deg) `),h&&(s+=`rotateY(${h}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 uo=["TopLeft","TopRight","BottomLeft","BottomRight"],Ul=uo.length,vs=t=>typeof t=="string"?parseFloat(t):t,Ts=t=>typeof t=="number"||w.test(t);function Wl(t,e,n,s,i,r){i?(t.opacity=D(0,n.opacity??1,Kl(s)),t.opacityExit=D(e.opacity??1,0,$l(s))):r&&(t.opacity=D(e.opacity??1,n.opacity??1,s));for(let o=0;o<Ul;o++){const a=`border${uo[o]}Radius`;let c=xs(e,a),u=xs(n,a);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||Ts(c)===Ts(u)?(t[a]=Math.max(D(vs(c),vs(u),s),0),(_.test(u)||_.test(c))&&(t[a]+="%")):t[a]=u}(e.rotate||n.rotate)&&(t.rotate=D(e.rotate||0,n.rotate||0,s))}function xs(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const Kl=ho(0,.5,ni),$l=ho(.5,.95,W);function ho(t,e,n){return s=>s<t?0:s>e?1:n(Ct(t,e,s))}function Hl(t,e,n){const s=B(t)?t:yt(t);return s.start(hn("",s,e,n)),s.animation}function Rt(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}const zl=(t,e)=>t.depth-e.depth;class Gl{constructor(){this.children=[],this.isDirty=!1}add(e){Ye(this.children,e),this.isDirty=!0}remove(e){Xt(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(zl),this.isDirty=!1,this.children.forEach(e)}}function _l(t,e){const n=j.now(),s=({timestamp:i})=>{const r=i-n;r>=e&&(tt(s),t(r-e))};return C.setup(s,!0),()=>tt(s)}function Gt(t){return B(t)?t.get():t}class Xl{constructor(){this.members=[]}add(e){Ye(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&&(Xt(this.members,s),s.unmount())}e.scheduleRender()}remove(e){if(Xt(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 _t={hasAnimatedSinceResize:!0,hasEverUpdated:!1},pe=["","X","Y","Z"],Yl=1e3;let ql=0;function me(t,e,n,s){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),s&&(s[t]=0))}function fo(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Li(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:r}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",C,!(i||r))}const{parent:s}=t;s&&!s.hasCheckedOptimisedAppear&&fo(s)}function po({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(o={},a=e?.()){this.id=ql++,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(Ql),this.nodes.forEach(sc),this.nodes.forEach(ic),this.nodes.forEach(tc)},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 Gl)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Ze),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=yn(o)&&!Ja(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,f=0;const h=()=>this.root.updateBlockedByResize=!1;C.read(()=>{f=window.innerWidth}),t(o,()=>{const d=window.innerWidth;d!==f&&(f=d,this.root.updateBlockedByResize=!0,l&&l(),l=_l(h,250),_t.hasAnimatedSinceResize&&(_t.hasAnimatedSinceResize=!1,this.nodes.forEach(Ss)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&u&&(a||c)&&this.addEventListener("didUpdate",({delta:l,hasLayoutChanged:f,hasRelativeLayoutChanged:h,layout:d})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const p=this.options.transition||u.getDefaultTransition()||cc,{onLayoutAnimationStart:m,onLayoutAnimationComplete:y}=u.getProps(),v=!this.targetLayout||!co(this.targetLayout,d),T=!f&&h;if(this.options.layoutRoot||this.resumeFrom||T||f&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const g={...un(p,"layout"),onPlay:m,onComplete:y};(u.shouldReduceMotion||this.options.layoutRoot)&&(g.delay=0,g.type=!1),this.startAnimation(g),this.setAnimationOrigin(l,T)}else f||Ss(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(),tt(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(oc),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&&fo(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let l=0;l<this.path.length;l++){const f=this.path[l];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.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(ws);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Ps);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(nc),this.nodes.forEach(Zl),this.nodes.forEach(Jl)):this.nodes.forEach(Ps),this.clearAllSnapshots();const a=j.now();I.delta=X(0,1e3/60,a-I.timestamp),I.timestamp=a,I.isProcessing=!0,re.update.process(I),re.preRender.process(I),re.render.process(I),I.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,mn.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(ec),this.sharedNodes.forEach(rc)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,C.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){C.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!O(this.snapshot.measuredBox.x)&&!O(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=k(),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&&!lo(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,l=u!==this.prevTransformTemplateValue;o&&this.instance&&(a||ot(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)),uc(c),{animationId:this.root.animationId,measuredBox:a,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:o}=this.options;if(!o)return k();const a=o.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(hc))){const{scroll:u}=this.root;u&&(pt(a.x,u.offset.x),pt(a.y,u.offset.y))}return a}removeElementScroll(o){const a=k();if(K(a,o),this.scroll?.wasRoot)return a;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:l,options:f}=u;u!==this.root&&l&&f.layoutScroll&&(l.wasRoot&&K(a,o),pt(a.x,l.offset.x),pt(a.y,l.offset.y))}return a}applyTransform(o,a=!1){const c=k();K(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&&mt(c,{x:-l.scroll.offset.x,y:-l.scroll.offset.y}),ot(l.latestValues)&&mt(c,l.latestValues)}return ot(this.latestValues)&&mt(c,this.latestValues),c}removeTransform(o){const a=k();K(a,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!u.instance||!ot(u.latestValues))continue;Ke(u.latestValues)&&u.updateSnapshot();const l=k(),f=u.measurePageBox();K(l,f),fs(a,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,l)}return ot(this.latestValues)&&fs(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!==I.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:f}=this.options;if(!this.layout||!(l||f))return;this.resolvedRelativeTargetAt=I.timestamp;const h=this.getClosestProjectingParent();h&&this.linkedParentVersion!==h.layoutVersion&&!h.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(h&&h.layout?this.createRelativeTarget(h,this.layout.layoutBox,h.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=k(),this.targetWithTransforms=k()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Fl(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):K(this.target,this.layout.layoutBox),qi(this.target,this.targetDelta)):K(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,h&&!!h.resumingFrom==!!this.resumingFrom&&!h.options.layoutScroll&&h.target&&this.animationProgress!==1?this.createRelativeTarget(h,this.target,h.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Ke(this.parent.latestValues)||Yi(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=k(),this.relativeTargetOrigin=k(),te(this.relativeTargetOrigin,a,c),K(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===I.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;K(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,h=this.treeScale.y;cl(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=k());const{target:d}=o;if(!d){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(rs(this.prevProjectionDelta.x,this.projectionDelta.x),rs(this.prevProjectionDelta.y,this.projectionDelta.y)),At(this.projectionDelta,this.layoutCorrected,d,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==h||!ys(this.projectionDelta.x,this.prevProjectionDelta.x)||!ys(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=dt(),this.projectionDelta=dt(),this.projectionDeltaWithTransform=dt()}setAnimationOrigin(o,a=!1){const c=this.snapshot,u=c?c.latestValues:{},l={...this.latestValues},f=dt();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const h=k(),d=c?c.source:void 0,p=this.layout?this.layout.source:void 0,m=d!==p,y=this.getStack(),v=!y||y.members.length<=1,T=!!(m&&!v&&this.options.crossfade===!0&&!this.path.some(lc));this.animationProgress=0;let g;this.mixTargetDelta=P=>{const S=P/1e3;bs(f.x,o.x,S),bs(f.y,o.y,S),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(te(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),ac(this.relativeTarget,this.relativeTargetOrigin,h,S),g&&Ol(this.relativeTarget,g)&&(this.isProjectionDirty=!1),g||(g=k()),K(g,this.relativeTarget)),m&&(this.animationValues=l,Wl(l,u,this.latestValues,S,T,v)),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&&(tt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=C.update(()=>{_t.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=yt(0)),this.motionValue.jump(0,!1),this.currentAnimation=Hl(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(Yl),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&&mo(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||k();const f=O(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+f;const h=O(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+h}K(a,c),mt(a,l),At(this.projectionDeltaWithTransform,this.layoutCorrected,a,l)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Xl),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&&me("z",o,u,this.animationValues);for(let l=0;l<pe.length;l++)me(`rotate${pe[l]}`,o,u,this.animationValues),me(`skew${pe[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=Gt(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=Gt(a?.pointerEvents)||""),this.hasProjected&&!ot(this.latestValues)&&(o.transform=c?c({},""):"none",this.hasProjected=!1);return}o.visibility="";const l=u.animationValues||u.latestValues;this.applyTransformsToTarget();let f=Nl(this.projectionDeltaWithTransform,this.treeScale,l);c&&(f=c(l,f)),o.transform=f;const{x:h,y:d}=this.projectionDelta;o.transformOrigin=`${h.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 He){if(l[p]===void 0)continue;const{correct:m,applyTo:y,isCSSVariable:v}=He[p],T=f==="none"?l[p]:m(l[p],u);if(y){const g=y.length;for(let P=0;P<g;P++)o[y[P]]=T}else v?this.options.visualElement.renderState.vars[p]=T:o[p]=T}this.options.layoutId&&(o.pointerEvents=u===this?Gt(a?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>o.currentAnimation?.stop()),this.root.nodes.forEach(ws),this.root.sharedNodes.clear()}}}function Zl(t){t.updateLayout()}function Jl(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"?G(l=>{const f=r?e.measuredBox[l]:e.layoutBox[l],h=O(f);f.min=n[l].min,f.max=f.min+h}):mo(i,e.layoutBox,n)&&G(l=>{const f=r?e.measuredBox[l]:e.layoutBox[l],h=O(n[l]);f.max=f.min+h,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[l].max=t.relativeTarget[l].min+h)});const o=dt();At(o,n,e.layoutBox);const a=dt();r?At(a,t.applyTransform(s,!0),e.measuredBox):At(a,n,e.layoutBox);const c=!lo(o);let u=!1;if(!t.resumeFrom){const l=t.getClosestProjectingParent();if(l&&!l.resumeFrom){const{snapshot:f,layout:h}=l;if(f&&h){const d=k();te(d,e.layoutBox,f.layoutBox);const p=k();te(p,n,h.layoutBox),co(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 Ql(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 tc(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function ec(t){t.clearSnapshot()}function ws(t){t.clearMeasurements()}function Ps(t){t.isLayoutDirty=!1}function nc(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Ss(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function sc(t){t.resolveTargetDelta()}function ic(t){t.calcProjection()}function oc(t){t.resetSkewAndRotation()}function rc(t){t.removeLeadSnapshot()}function bs(t,e,n){t.translate=D(e.translate,0,n),t.scale=D(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function As(t,e,n,s){t.min=D(e.min,n.min,s),t.max=D(e.max,n.max,s)}function ac(t,e,n,s){As(t.x,e.x,n.x,s),As(t.y,e.y,n.y,s)}function lc(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const cc={duration:.45,ease:[.4,0,.1,1]},Vs=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Cs=Vs("applewebkit/")&&!Vs("chrome/")?Math.round:W;function Ms(t){t.min=Cs(t.min),t.max=Cs(t.max)}function uc(t){Ms(t.x),Ms(t.y)}function mo(t,e,n){return t==="position"||t==="preserve-aspect"&&!kl(gs(e),gs(n),.2)}function hc(t){return t!==t.root&&t.scroll?.wasRoot}const fc=po({attachResizeListener:(t,e)=>Rt(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),ge={current:void 0},go=po({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!ge.current){const t=new fc({});t.mount(window),t.setOptions({layoutScroll:!0}),ge.current=t}return ge.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),Pn=x.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function Ds(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function dc(...t){return e=>{let n=!1;const s=t.map(i=>{const r=Ds(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():Ds(t[i],null)}}}}function pc(...t){return x.useCallback(dc(...t),t)}class mc extends x.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(n&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const s=n.offsetParent,i=Ue(s)&&s.offsetWidth||0,r=Ue(s)&&s.offsetHeight||0,o=this.props.sizeRef.current;o.height=n.offsetHeight||0,o.width=n.offsetWidth||0,o.top=n.offsetTop,o.left=n.offsetLeft,o.right=i-o.width-o.left,o.bottom=r-o.height-o.top}return null}componentDidUpdate(){}render(){return this.props.children}}function gc({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(Pn),l=t.props?.ref??t?.ref,f=pc(a,l);return x.useInsertionEffect(()=>{const{width:h,height:d,top:p,left:m,right:y,bottom:v}=c.current;if(e||r===!1||!a.current||!h||!d)return;const T=n==="left"?`left: ${m}`:`right: ${y}`,g=s==="bottom"?`bottom: ${v}`:`top: ${p}`;a.current.dataset.motionPopId=o;const P=document.createElement("style");u&&(P.nonce=u);const S=i??document.head;return S.appendChild(P),P.sheet&&P.sheet.insertRule(`
2
+ [data-motion-pop-id="${o}"] {
3
+ position: absolute !important;
4
+ width: ${h}px !important;
5
+ height: ${d}px !important;
6
+ ${T}px !important;
7
+ ${g}px !important;
8
+ }
9
+ `),()=>{S.contains(P)&&S.removeChild(P)}},[e]),Y.jsx(mc,{isPresent:e,childRef:a,sizeRef:c,pop:r,children:r===!1?t:x.cloneElement(t,{ref:f})})}const yc=({children:t,initial:e,isPresent:n,onExitComplete:s,custom:i,presenceAffectsLayout:r,mode:o,anchorX:a,anchorY:c,root:u})=>{const l=Xe(vc),f=x.useId();let h=!0,d=x.useMemo(()=>(h=!1,{id:f,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&&h&&(d={...d}),x.useMemo(()=>{l.forEach((p,m)=>l.set(m,!1))},[n]),x.useEffect(()=>{!n&&!l.size&&s&&s()},[n]),t=Y.jsx(gc,{pop:o==="popLayout",isPresent:n,anchorX:a,anchorY:c,root:u,children:t}),Y.jsx(ne.Provider,{value:d,children:t})};function vc(){return new Map}function yo(t=!0){const e=x.useContext(ne);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 Nt=t=>t.key||"";function Es(t){const e=[];return x.Children.forEach(t,n=>{x.isValidElement(n)&&e.push(n)}),e}const Du=({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,f]=yo(o),h=x.useMemo(()=>Es(t),[t]),d=o&&!l?[]:h.map(Nt),p=x.useRef(!0),m=x.useRef(h),y=Xe(()=>new Map),v=x.useRef(new Set),[T,g]=x.useState(h),[P,S]=x.useState(h);Hs(()=>{p.current=!1,m.current=h;for(let b=0;b<P.length;b++){const A=Nt(P[b]);d.includes(A)?(y.delete(A),v.current.delete(A)):y.get(A)!==!0&&y.set(A,!1)}},[P,d.length,d.join("-")]);const V=[];if(h!==T){let b=[...h];for(let A=0;A<P.length;A++){const L=P[A],nt=Nt(L);d.includes(nt)||(b.splice(A,0,L),V.push(L))}return r==="wait"&&V.length&&(b=V),S(Es(b)),g(h),null}const{forceRender:M}=x.useContext(_e);return Y.jsx(Y.Fragment,{children:P.map(b=>{const A=Nt(b),L=o&&!l?!1:h===P||d.includes(A),nt=()=>{if(v.current.has(A))return;if(v.current.add(A),y.has(A))y.set(A,!0);else return;let Z=!0;y.forEach(Bt=>{Bt||(Z=!1)}),Z&&(M?.(),S(m.current),o&&f?.(),s&&s())};return Y.jsx(yc,{isPresent:L,initial:!p.current||n?void 0:!1,custom:e,presenceAffectsLayout:i,mode:r,root:u,onExitComplete:L?void 0:nt,anchorX:a,anchorY:c,children:b},A)})})},vo=x.createContext({strict:!1}),Rs={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 Ls=!1;function Tc(){if(Ls)return;const t={};for(const e in Rs)t[e]={isEnabled:n=>Rs[e].some(s=>!!n[s])};Gi(t),Ls=!0}function To(){return Tc(),ol()}function xc(t){const e=To();for(const n in t)e[n]={...e[n],...t[n]};Gi(e)}const wc=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 ee(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||wc.has(t)}let xo=t=>!ee(t);function Pc(t){typeof t=="function"&&(xo=e=>e.startsWith("on")?!ee(e):t(e))}try{Pc(require("@emotion/is-prop-valid").default)}catch{}function Sc(t,e,n){const s={};for(const i in t)i==="values"&&typeof t.values=="object"||(xo(i)||n===!0&&ee(i)||!e&&!ee(i)||t.draggable&&i.startsWith("onDrag"))&&(s[i]=t[i]);return s}const oe=x.createContext({});function bc(t,e){if(ie(t)){const{initial:n,animate:s}=t;return{initial:n===!1||Et(n)?n:void 0,animate:Et(s)?s:void 0}}return t.inherit!==!1?e:{}}function Ac(t){const{initial:e,animate:n}=bc(t,x.useContext(oe));return x.useMemo(()=>({initial:e,animate:n}),[ks(e),ks(n)])}function ks(t){return Array.isArray(t)?t.join(" "):t}const Sn=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function wo(t,e,n){for(const s in e)!B(e[s])&&!Qi(s,n)&&(t[s]=e[s])}function Vc({transformTemplate:t},e){return x.useMemo(()=>{const n=Sn();return xn(n,e,t),Object.assign({},n.vars,n.style)},[e])}function Cc(t,e){const n=t.style||{},s={};return wo(s,n,t),Object.assign(s,Vc(t,e)),s}function Mc(t,e){const n={},s=Cc(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 Po=()=>({...Sn(),attrs:{}});function Dc(t,e,n,s){const i=x.useMemo(()=>{const r=Po();return to(r,e,no(s),t.transformTemplate,t.style),{...r.attrs,style:{...r.style}}},[e]);if(t.style){const r={};wo(r,t.style,t),i.style={...r,...i.style}}return i}const Ec=["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 bn(t){return typeof t!="string"||t.includes("-")?!1:!!(Ec.indexOf(t)>-1||/[A-Z]/u.test(t))}function Rc(t,e,n,{latestValues:s},i,r=!1,o){const c=(o??bn(t)?Dc:Mc)(e,s,i,t),u=Sc(e,typeof t=="string",r),l=t!==x.Fragment?{...u,...c,ref:n}:{},{children:f}=e,h=x.useMemo(()=>B(f)?f.get():f,[f]);return x.createElement(t,{...l,children:h})}function Lc({scrapeMotionValuesFromProps:t,createRenderState:e},n,s,i){return{latestValues:kc(n,s,i,t),renderState:e()}}function kc(t,e,n,s){const i={},r=s(t,{});for(const h in r)i[h]=Gt(r[h]);let{initial:o,animate:a}=t;const c=ie(t),u=Hi(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 f=l?a:o;if(f&&typeof f!="boolean"&&!se(f)){const h=Array.isArray(f)?f:[f];for(let d=0;d<h.length;d++){const p=fn(t,h[d]);if(p){const{transitionEnd:m,transition:y,...v}=p;for(const T in v){let g=v[T];if(Array.isArray(g)){const P=l?g.length-1:0;g=g[P]}g!==null&&(i[T]=g)}for(const T in m)i[T]=m[T]}}}return i}const So=t=>(e,n)=>{const s=x.useContext(oe),i=x.useContext(ne),r=()=>Lc(t,e,s,i);return n?r():Xe(r)},Fc=So({scrapeMotionValuesFromProps:wn,createRenderState:Sn}),Ic=So({scrapeMotionValuesFromProps:so,createRenderState:Po}),Bc=Symbol.for("motionComponentSymbol");function jc(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 bo=x.createContext({});function ut(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Oc(t,e,n,s,i,r){const{visualElement:o}=x.useContext(oe),a=x.useContext(vo),c=x.useContext(ne),u=x.useContext(Pn),l=u.reducedMotion,f=u.skipAnimations,h=x.useRef(null),d=x.useRef(!1);s=s||a.renderer,!h.current&&s&&(h.current=s(t,{visualState:e,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:l,skipAnimations:f,isSVG:r}),d.current&&h.current&&(h.current.manuallyAnimateOnMount=!0));const p=h.current,m=x.useContext(bo);p&&!p.projection&&i&&(p.type==="html"||p.type==="svg")&&Nc(h.current,n,i,m);const y=x.useRef(!1);x.useInsertionEffect(()=>{p&&y.current&&p.update(n,c)});const v=n[Ri],T=x.useRef(!!v&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(v)&&window.MotionHasOptimisedAnimation?.(v));return Hs(()=>{d.current=!0,p&&(y.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?.(v)}),T.current=!1),p.enteringChildren=void 0)}),p}function Nc(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:Ao(t.parent)),t.projection.setOptions({layoutId:i,layout:r,alwaysMeasureLayout:!!o||a&&ut(a),visualElement:t,animationType:typeof r=="string"?r:"both",initialPromotionConfig:s,crossfade:l,layoutScroll:c,layoutRoot:u})}function Ao(t){if(t)return t.options.allowProjection!==!1?t.projection:Ao(t.parent)}function ye(t,{forwardMotionProps:e=!1,type:n}={},s,i){s&&xc(s);const r=n?n==="svg":bn(t),o=r?Ic:Fc;function a(u,l){let f;const h={...x.useContext(Pn),...u,layoutId:Uc(u)},{isStatic:d}=h,p=Ac(u),m=o(u,d);if(!d&&typeof window<"u"){Wc();const y=Kc(h);f=y.MeasureLayout,p.visualElement=Oc(t,m,h,i,y.ProjectionNode,r)}return Y.jsxs(oe.Provider,{value:p,children:[f&&p.visualElement?Y.jsx(f,{visualElement:p.visualElement,...h}):null,Rc(t,u,jc(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[Bc]=t,c}function Uc({layoutId:t}){const e=x.useContext(_e).id;return e&&t!==void 0?e+"-"+t:t}function Wc(t,e){x.useContext(vo).strict}function Kc(t){const e=To(),{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 $c(t,e){if(typeof Proxy>"u")return ye;const n=new Map,s=(r,o)=>ye(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,ye(o,void 0,t,e)),n.get(o))})}const Hc=(t,e)=>e.isSVG??bn(t)?new Pl(e):new gl(e,{allowProjection:t!==x.Fragment});class zc extends et{constructor(e){super(e),e.animationState||(e.animationState=Cl(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();se(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 Gc=0;class _c extends et{constructor(){super(...arguments),this.id=Gc++}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 Xc={animation:{Feature:zc},exit:{Feature:_c}};function It(t){return{point:{x:t.pageX,y:t.pageY}}}const Yc=t=>e=>gn(e)&&t(e,It(e));function Vt(t,e,n,s){return Rt(t,e,Yc(n),s)}const Vo=({current:t})=>t?t.ownerDocument.defaultView:null,Fs=(t,e)=>Math.abs(t-e);function qc(t,e){const n=Fs(t.x,e.x),s=Fs(t.y,e.y);return Math.sqrt(n**2+s**2)}const Is=new Set(["auto","scroll"]);class Co{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.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;const d=Te(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,m=qc(d.offset,{x:0,y:0})>=this.distanceThreshold;if(!p&&!m)return;const{point:y}=d,{timestamp:v}=I;this.history.push({...y,timestamp:v});const{onStart:T,onMove:g}=this.handlers;p||(T&&T(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),g&&g(this.lastMoveEvent,d)},this.handlePointerMove=(d,p)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=ve(p,this.transformPagePoint),C.update(this.updatePoint,!0)},this.handlePointerUp=(d,p)=>{this.end();const{onEnd:m,onSessionEnd:y,resumeAnimation:v}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&v&&v(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const T=Te(d.type==="pointercancel"?this.lastMoveEventInfo:ve(p,this.transformPagePoint),this.history);this.startEvent&&m&&m(d,T),y&&y(d,T)},!gn(e))return;this.dragSnapToOrigin=r,this.handlers=n,this.transformPagePoint=s,this.distanceThreshold=o,this.contextWindow=i||window;const c=It(e),u=ve(c,this.transformPagePoint),{point:l}=u,{timestamp:f}=I;this.history=[{...l,timestamp:f}];const{onSessionStart:h}=n;h&&h(e,Te(u,this.history)),this.removeListeners=Lt(Vt(this.contextWindow,"pointermove",this.handlePointerMove),Vt(this.contextWindow,"pointerup",this.handlePointerUp),Vt(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(e){let n=e.parentElement;for(;n;){const s=getComputedStyle(n);(Is.has(s.overflowX)||Is.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),C.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),tt(this.updatePoint)}}function ve(t,e){return e?{point:e(t.point)}:t}function Bs(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Te({point:t},e){return{point:t,delta:Bs(t,Mo(e)),offset:Bs(t,Zc(e)),velocity:Jc(e,.1)}}function Zc(t){return t[0]}function Mo(t){return t[t.length-1]}function Jc(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const i=Mo(t);for(;n>=0&&(s=t[n],!(i.timestamp-s.timestamp>H(e)));)n--;if(!s)return{x:0,y:0};s===t[0]&&t.length>2&&i.timestamp-s.timestamp>H(e)*2&&(s=t[1]);const r=U(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 Qc(t,{min:e,max:n},s){return e!==void 0&&t<e?t=s?D(e,t,s.min):Math.max(t,e):n!==void 0&&t>n&&(t=s?D(n,t,s.max):Math.min(t,n)),t}function js(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 tu(t,{top:e,left:n,bottom:s,right:i}){return{x:js(t.x,n,i),y:js(t.y,e,s)}}function Os(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 eu(t,e){return{x:Os(t.x,e.x),y:Os(t.y,e.y)}}function nu(t,e){let n=.5;const s=O(t),i=O(e);return i>s?n=Ct(e.min,e.max-s,t.min):s>i&&(n=Ct(t.min,t.max-i,e.min)),X(0,1,n)}function su(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 ze=.35;function iu(t=ze){return t===!1?t=0:t===!0&&(t=ze),{x:Ns(t,"left","right"),y:Ns(t,"top","bottom")}}function Ns(t,e,n){return{min:Us(t,e),max:Us(t,n)}}function Us(t,e){return typeof t=="number"?t:t[e]||0}const ou=new WeakMap;class ru{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=k(),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=f=>{n&&this.snapToCursor(It(f).point),this.stopAnimation()},o=(f,h)=>{const{drag:d,dragPropagation:p,onDragStart:m}=this.getProps();if(d&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Ia(d),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=h,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),G(v=>{let T=this.getAxisMotionValue(v).get()||0;if(_.test(T)){const{projection:g}=this.visualElement;if(g&&g.layout){const P=g.layout.layoutBox[v];P&&(T=O(P)*(parseFloat(T)/100))}}this.originPoint[v]=T}),m&&C.update(()=>m(f,h),!1,!0),Be(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},a=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h;const{dragPropagation:d,dragDirectionLock:p,onDirectionLock:m,onDrag:y}=this.getProps();if(!d&&!this.openDragLock)return;const{offset:v}=h;if(p&&this.currentDirection===null){this.currentDirection=lu(v),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",h.point,v),this.updateAxis("y",h.point,v),this.visualElement.render(),y&&C.update(()=>y(f,h),!1,!0)},c=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h,this.stop(f,h),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>{const{dragSnapToOrigin:f}=this.getProps();(f||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new Co(e,{onSessionStart:r,onStart:o,onMove:a,onSessionEnd:c,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:s,contextWindow:Vo(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&&C.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||!Ut(e,i,this.currentDirection))return;const r=this.getAxisMotionValue(e);let o=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(o=Qc(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&&ut(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&s?this.constraints=tu(s.layoutBox,e):this.constraints=!1,this.elastic=iu(n),i!==this.constraints&&!ut(e)&&s&&this.constraints&&!this.hasMutatedConstraints&&G(r=>{this.constraints!==!1&&this.getAxisMotionValue(r)&&(this.constraints[r]=su(s.layoutBox[r],this.constraints[r]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!ut(e))return!1;const s=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const r=ul(s,i.root,this.visualElement.getTransformPagePoint());let o=eu(i.layout.layoutBox,r);if(n){const a=n(al(o));this.hasMutatedConstraints=!!a,a&&(o=Xi(a))}return o}startAnimation(e){const{drag:n,dragMomentum:s,dragElastic:i,dragTransition:r,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},u=G(l=>{if(!Ut(l,n,this.currentDirection))return;let f=c&&c[l]||{};o&&(f={min:0,max:0});const h=i?200:1e6,d=i?40:1e7,p={type:"inertia",velocity:s?e[l]:0,bounceStiffness:h,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...r,...f};return this.startAxisValueAnimation(l,p)});return Promise.all(u).then(a)}startAxisValueAnimation(e,n){const s=this.getAxisMotionValue(e);return Be(this.visualElement,e),s.start(hn(e,s,0,n,this.visualElement,!1))}stopAnimation(){G(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){G(n=>{const{drag:s}=this.getProps();if(!Ut(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]-D(o,a,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!ut(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};G(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const c=a.get();i[o]=nu({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(),G(o=>{if(!Ut(o,e,null))return;const a=this.getAxisMotionValue(o),{min:c,max:u}=this.constraints[o];a.set(D(c,u,i[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;ou.set(this.visualElement,this);const e=this.visualElement.current,n=Vt(e,"pointerdown",u=>{const{drag:l,dragListener:f=!0}=this.getProps(),h=u.target,d=h!==e&&Wa(h);l&&f&&!d&&this.start(u)});let s;const i=()=>{const{dragConstraints:u}=this.getProps();ut(u)&&u.current&&(this.constraints=this.resolveRefConstraints(),s||(s=au(e,u.current,()=>this.scalePositionWithinConstraints())))},{projection:r}=this.visualElement,o=r.addEventListener("measure",i);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),C.read(i);const a=Rt(window,"resize",()=>this.scalePositionWithinConstraints()),c=r.addEventListener("didUpdate",(({delta:u,hasLayoutChanged:l})=>{this.isDragging&&l&&(G(f=>{const h=this.getAxisMotionValue(f);h&&(this.originPoint[f]+=u[f].translate,h.set(h.get()+u[f].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=ze,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:s,dragPropagation:i,dragConstraints:r,dragElastic:o,dragMomentum:a}}}function Ws(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function au(t,e,n){const s=_n(t,Ws(n)),i=_n(e,Ws(n));return()=>{s(),i()}}function Ut(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function lu(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class cu extends et{constructor(e){super(e),this.removeGroupControls=W,this.removeListeners=W,this.controls=new ru(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||W}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 xe=t=>(e,n)=>{t&&C.update(()=>t(e,n),!1,!0)};class uu extends et{constructor(){super(...arguments),this.removePointerDownListener=W}onPointerDown(e){this.session=new Co(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Vo(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:xe(e),onStart:xe(n),onMove:xe(s),onEnd:(r,o)=>{delete this.session,i&&C.postRender(()=>i(r,o))}}}mount(){this.removePointerDownListener=Vt(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 we=!1;class hu 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),we&&r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),_t.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}),we=!0,i||e.layoutDependency!==n||n===void 0||e.isPresent!==r?o.willUpdate():this.safeToRemove(),e.isPresent!==r&&(r?o.promote():o.relegate()||C.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),mn.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:i}=e;we=!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 Do(t){const[e,n]=yo(),s=x.useContext(_e);return Y.jsx(hu,{...t,layoutGroup:s,switchLayoutGroup:x.useContext(bo),isPresent:e,safeToRemove:n})}const fu={pan:{Feature:uu},drag:{Feature:cu,ProjectionNode:go,MeasureLayout:Do}};function Ks(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&&C.postRender(()=>r(e,It(e)))}class du extends et{mount(){const{current:e}=this.node;e&&(this.unmount=ja(e,(n,s)=>(Ks(this.node,s,"Start"),i=>Ks(this.node,i,"End"))))}unmount(){}}class pu extends et{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=Lt(Rt(this.node.current,"focus",()=>this.onFocus()),Rt(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function $s(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&&C.postRender(()=>r(e,It(e)))}class mu extends et{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:s}=this.node.props;this.unmount=$a(e,(i,r)=>($s(this.node,r,"Start"),(o,{success:a})=>$s(this.node,o,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:s?.tap===!1})}unmount(){}}const Ge=new WeakMap,Pe=new WeakMap,gu=t=>{const e=Ge.get(t.target);e&&e(t)},yu=t=>{t.forEach(gu)};function vu({root:t,...e}){const n=t||document;Pe.has(n)||Pe.set(n,{});const s=Pe.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(yu,{root:t,...e})),s[i]}function Tu(t,e,n){const s=vu(e);return Ge.set(t,n),s.observe(t),()=>{Ge.delete(t),s.unobserve(t)}}const xu={some:0,all:1};class wu extends et{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:xu[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:f}=this.node.getProps(),h=u?l:f;h&&h(c)};return Tu(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(Pu(e,n))&&this.startObserver()}unmount(){}}function Pu({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Su={inView:{Feature:wu},tap:{Feature:mu},focus:{Feature:pu},hover:{Feature:du}},bu={layout:{ProjectionNode:go,MeasureLayout:Do}},Au={...Xc,...Su,...fu,...bu},Eu=$c(Au,Hc);export{Du as A,Eu as m};