react-night-toggle
Version:
A modern dark mode toggle for ReactJs with smooth animations.
1 lines • 118 kB
JavaScript
"use strict";"use client";var Mo=Object.defineProperty;var il=Object.getOwnPropertyDescriptor;var nl=Object.getOwnPropertyNames;var sl=Object.prototype.hasOwnProperty;var al=(t,e)=>{for(var r in e)Mo(t,r,{get:e[r],enumerable:!0})},ll=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of nl(e))!sl.call(t,i)&&i!==r&&Mo(t,i,{get:()=>e[i],enumerable:!(o=il(e,i))||o.enumerable});return t};var ml=t=>ll(Mo({},"__esModule",{value:!0}),t);var wc={};al(wc,{DarkModeSwitch:()=>Ac});module.exports=ml(wc);var el=require("react");var Fi=require("react"),cr=(0,Fi.createContext)({});var Oi=require("react");function ji(t){let e=(0,Oi.useRef)(null);return e.current===null&&(e.current=t()),e.current}var ur=require("react");var ee=typeof window!="undefined";var Ni=ee?ur.useLayoutEffect:ur.useEffect;var Gi=require("react"),re=(0,Gi.createContext)(null);function It(t,e){t.indexOf(e)===-1&&t.push(e)}function kt(t,e){let r=t.indexOf(e);r>-1&&t.splice(r,1)}var O=(t,e,r)=>r>e?e:r<t?t:r;function Ce(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}var tt=()=>{},G=()=>{};process.env.NODE_ENV!=="production"&&(tt=(t,e,r)=>{!t&&typeof console!="undefined"&&console.warn(Ce(e,r))},G=(t,e,r)=>{if(!t)throw new Error(Ce(e,r))});var K={};var De=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function Ee(t){return typeof t=="object"&&t!==null}var Re=t=>/^0[^.\s]+$/u.test(t);function Ft(t){let e;return()=>(e===void 0&&(e=t()),e)}var R=t=>t;var cl=(t,e)=>r=>e(t(r)),ot=(...t)=>t.reduce(cl);var at=(t,e,r)=>{let o=e-t;return o===0?1:(r-t)/o};var ut=class{constructor(){this.subscriptions=[]}add(e){return It(this.subscriptions,e),()=>kt(this.subscriptions,e)}notify(e,r,o){let i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,r,o);else for(let s=0;s<i;s++){let n=this.subscriptions[s];n&&n(e,r,o)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}};var k=t=>t*1e3,U=t=>t/1e3;function Le(t,e){return e?t*(1e3/e):0}var Ui=new Set;function Ot(t,e,r){t||Ui.has(e)||(console.warn(Ce(e,r)),Ui.add(e))}var Ki=(t,e,r)=>(((1-3*r+3*e)*t+(3*r-6*e))*t+3*e)*t,ul=1e-7,fl=12;function pl(t,e,r,o,i){let s,n,a=0;do n=e+(r-e)/2,s=Ki(n,o,i)-t,s>0?r=n:e=n;while(Math.abs(s)>ul&&++a<fl);return n}function Vt(t,e,r,o){if(t===e&&r===o)return R;let i=s=>pl(s,0,1,t,r);return s=>s===0||s===1?s:Ki(i(s),e,o)}var fr=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2;var pr=t=>e=>1-t(1-e);var hr=Vt(.33,1.53,.69,.99),oe=pr(hr),Be=fr(oe);var Ie=t=>(t*=2)<1?.5*oe(t):.5*(2-Math.pow(2,-10*(t-1)));var ke=t=>1-Math.sin(Math.acos(t)),Fe=pr(ke),Oe=fr(ke);var Co=Vt(.42,0,1,1),Do=Vt(0,0,.58,1),je=Vt(.42,0,.58,1);var Eo=t=>Array.isArray(t)&&typeof t[0]!="number";var Ne=t=>Array.isArray(t)&&typeof t[0]=="number";var Wi={linear:R,easeIn:Co,easeInOut:je,easeOut:Do,circIn:ke,circInOut:Oe,circOut:Fe,backIn:oe,backInOut:Be,backOut:hr,anticipate:Ie},hl=t=>typeof t=="string",dr=t=>{if(Ne(t)){G(t.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");let[e,r,o,i]=t;return Vt(e,r,o,i)}else if(hl(t))return G(Wi[t]!==void 0,`Invalid easing type '${t}'`,"invalid-easing-type"),Wi[t];return t};var Ge=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];var H={value:null,addProjectionMetrics:null};function zi(t,e){let r=new Set,o=new Set,i=!1,s=!1,n=new WeakSet,a={delta:0,timestamp:0,isProcessing:!1},l=0;function c(u){n.has(u)&&(m.schedule(u),t()),l++,u(a)}let m={schedule:(u,f=!1,p=!1)=>{let d=p&&i?r:o;return f&&n.add(u),d.has(u)||d.add(u),u},cancel:u=>{o.delete(u),n.delete(u)},process:u=>{if(a=u,i){s=!0;return}i=!0,[r,o]=[o,r],r.forEach(c),e&&H.value&&H.value.frameloop[e].push(l),l=0,r.clear(),i=!1,s&&(s=!1,m.process(u))}};return m}var dl=40;function gr(t,e){let r=!1,o=!0,i={delta:0,timestamp:0,isProcessing:!1},s=()=>r=!0,n=Ge.reduce((x,A)=>(x[A]=zi(s,e?A:void 0),x),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:m,update:u,preRender:f,render:p,postRender:h}=n,d=()=>{let x=K.useManualTiming?i.timestamp:performance.now();r=!1,K.useManualTiming||(i.delta=o?1e3/60:Math.max(Math.min(x-i.timestamp,dl),1)),i.timestamp=x,i.isProcessing=!0,a.process(i),l.process(i),c.process(i),m.process(i),u.process(i),f.process(i),p.process(i),h.process(i),i.isProcessing=!1,r&&e&&(o=!1,t(d))},y=()=>{r=!0,o=!0,i.isProcessing||t(d)};return{schedule:Ge.reduce((x,A)=>{let V=n[A];return x[A]=(w,I=!1,b=!1)=>(r||y(),V.schedule(w,I,b)),x},{}),cancel:x=>{for(let A=0;A<Ge.length;A++)n[Ge[A]].cancel(x)},state:i,steps:n}}var{schedule:S,cancel:_,state:L,steps:Ue}=gr(typeof requestAnimationFrame!="undefined"?requestAnimationFrame:R,!0);var yr;function gl(){yr=void 0}var B={now:()=>(yr===void 0&&B.set(L.isProcessing||K.useManualTiming?L.timestamp:performance.now()),yr),set:t=>{yr=t,queueMicrotask(gl)}};var it={layout:0,mainThread:0,waapi:0};var $i=t=>e=>typeof e=="string"&&e.startsWith(t),jt=$i("--"),yl=$i("var(--"),Nt=t=>yl(t)?xl.test(t.split("/*")[0].trim()):!1,xl=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;var lt={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},ft={...lt,transform:t=>O(0,1,t)},Ke={...lt,default:1};var St=t=>Math.round(t*1e5)/1e5;var ie=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Hi(t){return t==null}var _i=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;var ne=(t,e)=>r=>!!(typeof r=="string"&&_i.test(r)&&r.startsWith(t)||e&&!Hi(r)&&Object.prototype.hasOwnProperty.call(r,e)),xr=(t,e,r)=>o=>{if(typeof o!="string")return o;let[i,s,n,a]=o.match(ie);return{[t]:parseFloat(i),[e]:parseFloat(s),[r]:parseFloat(n),alpha:a!==void 0?parseFloat(a):1}};var vl=t=>O(0,255,t),Ro={...lt,transform:t=>Math.round(vl(t))},mt={test:ne("rgb","red"),parse:xr("red","green","blue"),transform:({red:t,green:e,blue:r,alpha:o=1})=>"rgba("+Ro.transform(t)+", "+Ro.transform(e)+", "+Ro.transform(r)+", "+St(ft.transform(o))+")"};function Tl(t){let e="",r="",o="",i="";return t.length>5?(e=t.substring(1,3),r=t.substring(3,5),o=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),r=t.substring(2,3),o=t.substring(3,4),i=t.substring(4,5),e+=e,r+=r,o+=o,i+=i),{red:parseInt(e,16),green:parseInt(r,16),blue:parseInt(o,16),alpha:i?parseInt(i,16)/255:1}}var We={test:ne("#"),parse:Tl,transform:mt.transform};var ze=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),nt=ze("deg"),W=ze("%"),v=ze("px"),Lo=ze("vh"),Bo=ze("vw"),vr={...W,parse:t=>W.parse(t)/100,transform:t=>W.transform(t*100)};var bt={test:ne("hsl","hue"),parse:xr("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:r,alpha:o=1})=>"hsla("+Math.round(t)+", "+W.transform(St(e))+", "+W.transform(St(r))+", "+St(ft.transform(o))+")"};var E={test:t=>mt.test(t)||We.test(t)||bt.test(t),parse:t=>mt.test(t)?mt.parse(t):bt.test(t)?bt.parse(t):We.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?mt.transform(t):bt.transform(t),getAnimatableNone:t=>{let e=E.parse(t);return e.alpha=0,E.transform(e)}};var Yi=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Vl(t){var e,r;return isNaN(t)&&typeof t=="string"&&(((e=t.match(ie))==null?void 0:e.length)||0)+(((r=t.match(Yi))==null?void 0:r.length)||0)>0}var qi="number",Zi="color",Sl="var",bl="var(",Xi="${}",Pl=/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 Pt(t){let e=t.toString(),r=[],o={color:[],number:[],var:[]},i=[],s=0,a=e.replace(Pl,l=>(E.test(l)?(o.color.push(s),i.push(Zi),r.push(E.parse(l))):l.startsWith(bl)?(o.var.push(s),i.push(Sl),r.push(l)):(o.number.push(s),i.push(qi),r.push(parseFloat(l))),++s,Xi)).split(Xi);return{values:r,split:a,indexes:o,types:i}}function Ji(t){return Pt(t).values}function Qi(t){let{split:e,types:r}=Pt(t),o=e.length;return i=>{let s="";for(let n=0;n<o;n++)if(s+=e[n],i[n]!==void 0){let a=r[n];a===qi?s+=St(i[n]):a===Zi?s+=E.transform(i[n]):s+=i[n]}return s}}var Al=t=>typeof t=="number"?0:E.test(t)?E.getAnimatableNone(t):t;function wl(t){let e=Ji(t);return Qi(t)(e.map(Al))}var z={test:Vl,parse:Ji,createTransformer:Qi,getAnimatableNone:wl};function Io(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function tn({hue:t,saturation:e,lightness:r,alpha:o}){t/=360,e/=100,r/=100;let i=0,s=0,n=0;if(!e)i=s=n=r;else{let a=r<.5?r*(1+e):r+e-r*e,l=2*r-a;i=Io(l,a,t+1/3),s=Io(l,a,t),n=Io(l,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(n*255),alpha:o}}function se(t,e){return r=>r>0?e:t}var P=(t,e,r)=>t+(e-t)*r;var ko=(t,e,r)=>{let o=t*t,i=r*(e*e-o)+o;return i<0?0:Math.sqrt(i)},Ml=[We,mt,bt],Cl=t=>Ml.find(e=>e.test(t));function en(t){let e=Cl(t);if(tt(!!e,`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!e)return!1;let r=e.parse(t);return e===bt&&(r=tn(r)),r}var Fo=(t,e)=>{let r=en(t),o=en(e);if(!r||!o)return se(t,e);let i={...r};return s=>(i.red=ko(r.red,o.red,s),i.green=ko(r.green,o.green,s),i.blue=ko(r.blue,o.blue,s),i.alpha=P(r.alpha,o.alpha,s),mt.transform(i))};var Tr=new Set(["none","hidden"]);function rn(t,e){return Tr.has(t)?r=>r<=0?t:e:r=>r>=1?e:t}function Dl(t,e){return r=>P(t,e,r)}function Vr(t){return typeof t=="number"?Dl:typeof t=="string"?Nt(t)?se:E.test(t)?Fo:Ll:Array.isArray(t)?on:typeof t=="object"?E.test(t)?Fo:El:se}function on(t,e){let r=[...t],o=r.length,i=t.map((s,n)=>Vr(s)(s,e[n]));return s=>{for(let n=0;n<o;n++)r[n]=i[n](s);return r}}function El(t,e){let r={...t,...e},o={};for(let i in r)t[i]!==void 0&&e[i]!==void 0&&(o[i]=Vr(t[i])(t[i],e[i]));return i=>{for(let s in o)r[s]=o[s](i);return r}}function Rl(t,e){var i;let r=[],o={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){let n=e.types[s],a=t.indexes[n][o[n]],l=(i=t.values[a])!=null?i:0;r[s]=l,o[n]++}return r}var Ll=(t,e)=>{let r=z.createTransformer(e),o=Pt(t),i=Pt(e);return o.indexes.var.length===i.indexes.var.length&&o.indexes.color.length===i.indexes.color.length&&o.indexes.number.length>=i.indexes.number.length?Tr.has(t)&&!i.values.length||Tr.has(e)&&!o.values.length?rn(t,e):ot(on(Rl(o,i),i.values),r):(tt(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),se(t,e))};function Sr(t,e,r){return typeof t=="number"&&typeof e=="number"&&typeof r=="number"?P(t,e,r):Vr(t)(t,e)}var nn=t=>{let e=({timestamp:r})=>t(r);return{start:(r=!0)=>S.update(e,r),stop:()=>_(e),now:()=>L.isProcessing?L.timestamp:B.now()}};var br=(t,e,r=10)=>{let o="",i=Math.max(Math.round(e/r),2);for(let s=0;s<i;s++)o+=Math.round(t(s/(i-1))*1e4)/1e4+", ";return`linear(${o.substring(0,o.length-2)})`};function ae(t){let e=0,r=50,o=t.next(e);for(;!o.done&&e<2e4;)e+=r,o=t.next(e);return e>=2e4?1/0:e}function sn(t,e=100,r){let o=r({...t,keyframes:[0,e]}),i=Math.min(ae(o),2e4);return{type:"keyframes",ease:s=>o.next(i*s).value/e,duration:U(i)}}var Bl=5;function Pr(t,e,r){let o=Math.max(e-Bl,0);return Le(r-t(o),e-o)}var C={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};var jo=.001;function an({duration:t=C.duration,bounce:e=C.bounce,velocity:r=C.velocity,mass:o=C.mass}){let i,s;tt(t<=k(C.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let n=1-e;n=O(C.minDamping,C.maxDamping,n),t=O(C.minDuration,C.maxDuration,U(t)),n<1?(i=c=>{let m=c*n,u=m*t,f=m-r,p=Ar(c,n),h=Math.exp(-u);return jo-f/p*h},s=c=>{let u=c*n*t,f=u*r+r,p=Math.pow(n,2)*Math.pow(c,2)*t,h=Math.exp(-u),d=Ar(Math.pow(c,2),n);return(-i(c)+jo>0?-1:1)*((f-p)*h)/d}):(i=c=>{let m=Math.exp(-c*t),u=(c-r)*t+1;return-jo+m*u},s=c=>{let m=Math.exp(-c*t),u=(r-c)*(t*t);return m*u});let a=5/t,l=kl(i,s,a);if(t=k(t),isNaN(l))return{stiffness:C.stiffness,damping:C.damping,duration:t};{let c=Math.pow(l,2)*o;return{stiffness:c,damping:n*2*Math.sqrt(o*c),duration:t}}}var Il=12;function kl(t,e,r){let o=r;for(let i=1;i<Il;i++)o=o-t(o)/e(o);return o}function Ar(t,e){return t*Math.sqrt(1-e*e)}var Fl=["duration","bounce"],Ol=["stiffness","damping","mass"];function ln(t,e){return e.some(r=>t[r]!==void 0)}function jl(t){let e={velocity:C.velocity,stiffness:C.stiffness,damping:C.damping,mass:C.mass,isResolvedFromDuration:!1,...t};if(!ln(t,Ol)&&ln(t,Fl))if(t.visualDuration){let r=t.visualDuration,o=2*Math.PI/(r*1.2),i=o*o,s=2*O(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:C.mass,stiffness:i,damping:s}}else{let r=an(t);e={...e,...r,mass:C.mass},e.isResolvedFromDuration=!0}return e}function le(t=C.visualDuration,e=C.bounce){let r=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t,{restSpeed:o,restDelta:i}=r,s=r.keyframes[0],n=r.keyframes[r.keyframes.length-1],a={done:!1,value:s},{stiffness:l,damping:c,mass:m,duration:u,velocity:f,isResolvedFromDuration:p}=jl({...r,velocity:-U(r.velocity||0)}),h=f||0,d=c/(2*Math.sqrt(l*m)),y=n-s,g=U(Math.sqrt(l/m)),T=Math.abs(y)<5;o||(o=T?C.restSpeed.granular:C.restSpeed.default),i||(i=T?C.restDelta.granular:C.restDelta.default);let x;if(d<1){let V=Ar(g,d);x=w=>{let I=Math.exp(-d*g*w);return n-I*((h+d*g*y)/V*Math.sin(V*w)+y*Math.cos(V*w))}}else if(d===1)x=V=>n-Math.exp(-g*V)*(y+(h+g*y)*V);else{let V=g*Math.sqrt(d*d-1);x=w=>{let I=Math.exp(-d*g*w),b=Math.min(V*w,300);return n-I*((h+d*g*y)*Math.sinh(b)+V*y*Math.cosh(b))/V}}let A={calculatedDuration:p&&u||null,next:V=>{let w=x(V);if(p)a.done=V>=u;else{let I=V===0?h:0;d<1&&(I=V===0?k(h):Pr(x,V,w));let b=Math.abs(I)<=o,$=Math.abs(n-w)<=i;a.done=b&&$}return a.value=a.done?n:w,a},toString:()=>{let V=Math.min(ae(A),2e4),w=br(I=>A.next(V*I).value,V,30);return V+"ms "+w},toTransition:()=>{}};return A}le.applyToOptions=t=>{let e=sn(t,100,le);return t.ease=e.ease,t.duration=k(e.duration),t.type="keyframes",t};function $e({keyframes:t,velocity:e=0,power:r=.8,timeConstant:o=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:n,min:a,max:l,restDelta:c=.5,restSpeed:m}){let u=t[0],f={done:!1,value:u},p=b=>a!==void 0&&b<a||l!==void 0&&b>l,h=b=>a===void 0?l:l===void 0||Math.abs(a-b)<Math.abs(l-b)?a:l,d=r*e,y=u+d,g=n===void 0?y:n(y);g!==y&&(d=g-u);let T=b=>-d*Math.exp(-b/o),x=b=>g+T(b),A=b=>{let $=T(b),J=x(b);f.done=Math.abs($)<=c,f.value=f.done?g:J},V,w,I=b=>{p(f.value)&&(V=b,w=le({keyframes:[f.value,h(f.value)],velocity:Pr(x,b,f.value),damping:i,stiffness:s,restDelta:c,restSpeed:m}))};return I(0),{calculatedDuration:null,next:b=>{let $=!1;return!w&&V===void 0&&($=!0,A(b),I(b)),V!==void 0&&b>=V?w.next(b-V):(!$&&A(b),f)}}}function Nl(t,e,r){let o=[],i=r||K.mix||Sr,s=t.length-1;for(let n=0;n<s;n++){let a=i(t[n],t[n+1]);if(e){let l=Array.isArray(e)?e[n]||R:e;a=ot(l,a)}o.push(a)}return o}function mn(t,e,{clamp:r=!0,ease:o,mixer:i}={}){let s=t.length;if(G(s===e.length,"Both input and output ranges must be the same length","range-length"),s===1)return()=>e[0];if(s===2&&e[0]===e[1])return()=>e[1];let n=t[0]===t[1];t[0]>t[s-1]&&(t=[...t].reverse(),e=[...e].reverse());let a=Nl(e,o,i),l=a.length,c=m=>{if(n&&m<t[0])return e[0];let u=0;if(l>1)for(;u<t.length-2&&!(m<t[u+1]);u++);let f=at(t[u],t[u+1],m);return a[u](f)};return r?m=>c(O(t[0],t[s-1],m)):c}function cn(t,e){let r=t[t.length-1];for(let o=1;o<=e;o++){let i=at(0,e,o);t.push(P(r,1,i))}}function un(t){let e=[0];return cn(e,t.length-1),e}function fn(t,e){return t.map(r=>r*e)}function Gl(t,e){return t.map(()=>e||je).splice(0,t.length-1)}function At({duration:t=300,keyframes:e,times:r,ease:o="easeInOut"}){let i=Eo(o)?o.map(dr):dr(o),s={done:!1,value:e[0]},n=fn(r&&r.length===e.length?r:un(e),t),a=mn(n,e,{ease:Array.isArray(i)?i:Gl(e,i)});return{calculatedDuration:t,next:l=>(s.value=a(l),s.done=l>=t,s)}}var Ul=t=>t!==null;function me(t,{repeat:e,repeatType:r="loop"},o,i=1){let s=t.filter(Ul),a=i<0||e&&r!=="loop"&&e%2===1?0:s.length-1;return!a||o===void 0?s[a]:o}var Kl={decay:$e,inertia:$e,tween:At,keyframes:At,spring:le};function wr(t){typeof t.type=="string"&&(t.type=Kl[t.type])}var wt=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,r){return this.finished.then(e,r)}};var Wl=t=>t/100,pt=class extends wt{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var o,i;let{motionValue:r}=this.options;r&&r.updatedAt!==B.now()&&this.tick(B.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(o=this.options).onStop)==null||i.call(o))},it.mainThread++,this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;wr(e);let{type:r=At,repeat:o=0,repeatDelay:i=0,repeatType:s,velocity:n=0}=e,{keyframes:a}=e,l=r||At;process.env.NODE_ENV!=="production"&&l!==At&&G(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),l!==At&&typeof a[0]!="number"&&(this.mixKeyframes=ot(Wl,Sr(a[0],a[1])),a=[0,100]);let c=l({...e,keyframes:a});s==="mirror"&&(this.mirroredGenerator=l({...e,keyframes:[...a].reverse(),velocity:-n})),c.calculatedDuration===null&&(c.calculatedDuration=ae(c));let{calculatedDuration:m}=c;this.calculatedDuration=m,this.resolvedDuration=m+i,this.totalDuration=this.resolvedDuration*(o+1)-i,this.generator=c}updateTime(e){let r=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=r}tick(e,r=!1){let{generator:o,totalDuration:i,mixKeyframes:s,mirroredGenerator:n,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return o.next(0);let{delay:c=0,keyframes:m,repeat:u,repeatType:f,repeatDelay:p,type:h,onUpdate:d,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)),r?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),T=this.playbackSpeed>=0?g<0:g>i;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let x=this.currentTime,A=o;if(u){let b=Math.min(this.currentTime,i)/a,$=Math.floor(b),J=b%1;!J&&b>=1&&(J=1),J===1&&$--,$=Math.min($,u+1),!!($%2)&&(f==="reverse"?(J=1-J,p&&(J-=p/a)):f==="mirror"&&(A=n)),x=O(0,1,J)*a}let V=T?{done:!1,value:m[0]}:A.next(x);s&&(V.value=s(V.value));let{done:w}=V;!T&&l!==null&&(w=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);let I=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&w);return I&&h!==$e&&(V.value=me(m,this.options,y,this.speed)),d&&d(V.value),I&&this.finish(),V}then(e,r){return this.finished.then(e,r)}get duration(){return U(this.calculatedDuration)}get time(){return U(this.currentTime)}set time(e){var r;e=k(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),(r=this.driver)==null||r.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(B.now());let r=this.playbackSpeed!==e;this.playbackSpeed=e,r&&(this.time=U(this.currentTime))}play(){var i,s;if(this.isStopped)return;let{driver:e=nn,startTime:r}=this.options;this.driver||(this.driver=e(n=>this.tick(n))),(s=(i=this.options).onPlay)==null||s.call(i);let o=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=o):this.holdTime!==null?this.startTime=o-this.holdTime:this.startTime||(this.startTime=r!=null?r:o),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(B.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,r;this.notifyFinished(),this.teardown(),this.state="finished",(r=(e=this.options).onComplete)==null||r.call(e)}cancel(){var e,r;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(r=(e=this.options).onCancel)==null||r.call(e)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null,it.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){var r;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(r=this.driver)==null||r.stop(),e.observe(this)}};function pn(t){var e;for(let r=1;r<t.length;r++)(e=t[r])!=null||(t[r]=t[r-1])}var Gt=t=>t*180/Math.PI,No=t=>{let e=Gt(Math.atan2(t[1],t[0]));return Go(e)},zl={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:No,rotateZ:No,skewX:t=>Gt(Math.atan(t[1])),skewY:t=>Gt(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Go=t=>(t=t%360,t<0&&(t+=360),t),hn=No,dn=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),gn=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),$l={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:dn,scaleY:gn,scale:t=>(dn(t)+gn(t))/2,rotateX:t=>Go(Gt(Math.atan2(t[6],t[5]))),rotateY:t=>Go(Gt(Math.atan2(-t[2],t[0]))),rotateZ:hn,rotate:hn,skewX:t=>Gt(Math.atan(t[4])),skewY:t=>Gt(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function He(t){return t.includes("scale")?1:0}function _e(t,e){if(!t||t==="none")return He(e);let r=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),o,i;if(r)o=$l,i=r;else{let a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);o=zl,i=a}if(!i)return He(e);let s=o[e],n=i[1].split(",").map(Hl);return typeof s=="function"?s(n):n[s]}var Uo=(t,e)=>{let{transform:r="none"}=getComputedStyle(t);return _e(r,e)};function Hl(t){return parseFloat(t.trim())}var st=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],q=new Set(st);var Ko=t=>t===lt||t===v,_l=new Set(["x","y","z"]),Yl=st.filter(t=>!_l.has(t));function yn(t){let e=[];return Yl.forEach(r=>{let o=t.getValue(r);o!==void 0&&(e.push([r,o.get()]),o.set(r.startsWith("scale")?1:0))}),e}var Mt={width:({x:t},{paddingLeft:e="0",paddingRight:r="0"})=>t.max-t.min-parseFloat(e)-parseFloat(r),height:({y:t},{paddingTop:e="0",paddingBottom:r="0"})=>t.max-t.min-parseFloat(e)-parseFloat(r),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})=>_e(e,"x"),y:(t,{transform:e})=>_e(e,"y")};Mt.translateX=Mt.x;Mt.translateY=Mt.y;var Ut=new Set,Wo=!1,zo=!1,$o=!1;function xn(){if(zo){let t=Array.from(Ut).filter(o=>o.needsMeasurement),e=new Set(t.map(o=>o.element)),r=new Map;e.forEach(o=>{let i=yn(o);i.length&&(r.set(o,i),o.render())}),t.forEach(o=>o.measureInitialState()),e.forEach(o=>{o.render();let i=r.get(o);i&&i.forEach(([s,n])=>{var a;(a=o.getValue(s))==null||a.set(n)})}),t.forEach(o=>o.measureEndState()),t.forEach(o=>{o.suspendedScrollY!==void 0&&window.scrollTo(0,o.suspendedScrollY)})}zo=!1,Wo=!1,Ut.forEach(t=>t.complete($o)),Ut.clear()}function vn(){Ut.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(zo=!0)})}function Ho(){$o=!0,vn(),xn(),$o=!1}var ht=class{constructor(e,r,o,i,s,n=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=r,this.name=o,this.motionValue=i,this.element=s,this.isAsync=n}scheduleResolve(){this.state="scheduled",this.isAsync?(Ut.add(this),Wo||(Wo=!0,S.read(vn),S.resolveKeyframes(xn))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:r,element:o,motionValue:i}=this;if(e[0]===null){let s=i==null?void 0:i.get(),n=e[e.length-1];if(s!==void 0)e[0]=s;else if(o&&r){let a=o.readValue(r,n);a!=null&&(e[0]=a)}e[0]===void 0&&(e[0]=n),i&&s===void 0&&i.set(e[0])}pn(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Ut.delete(this)}cancel(){this.state==="scheduled"&&(Ut.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}};var Tn=t=>t.startsWith("--");function Vn(t,e,r){Tn(e)?t.style.setProperty(e,r):t.style[e]=r}var Sn=Ft(()=>window.ScrollTimeline!==void 0);var bn={};function Pn(t,e){let r=Ft(t);return()=>{var o;return(o=bn[e])!=null?o:r()}}var Mr=Pn(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing");var Kt=([t,e,r,o])=>`cubic-bezier(${t}, ${e}, ${r}, ${o})`;var _o={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Kt([0,.65,.55,1]),circOut:Kt([.55,0,1,.45]),backIn:Kt([.31,.01,.66,-.59]),backOut:Kt([.33,1.53,.69,.99])};function Yo(t,e){if(t)return typeof t=="function"?Mr()?br(t,e):"ease-out":Ne(t)?Kt(t):Array.isArray(t)?t.map(r=>Yo(r,e)||_o.easeOut):_o[t]}function An(t,e,r,{delay:o=0,duration:i=300,repeat:s=0,repeatType:n="loop",ease:a="easeOut",times:l}={},c=void 0){let m={[e]:r};l&&(m.offset=l);let u=Yo(a,i);Array.isArray(u)&&(m.easing=u),H.value&&it.waapi++;let f={delay:o,duration:i,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:s+1,direction:n==="reverse"?"alternate":"normal"};c&&(f.pseudoElement=c);let p=t.animate(m,f);return H.value&&p.finished.finally(()=>{it.waapi--}),p}function Cr(t){return typeof t=="function"&&"applyToOptions"in t}function wn({type:t,...e}){var r,o;return Cr(t)&&Mr()?t.applyToOptions(e):((r=e.duration)!=null||(e.duration=300),(o=e.ease)!=null||(e.ease="easeOut"),e)}var Dr=class extends wt{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,!e)return;let{element:r,name:o,keyframes:i,pseudoElement:s,allowFlatten:n=!1,finalKeyframe:a,onComplete:l}=e;this.isPseudoElement=!!s,this.allowFlatten=n,this.options=e,G(typeof e.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");let c=wn(e);this.animation=An(r,o,i,c,s),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){let m=me(i,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(m):Vn(r,o,m),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,r;(r=(e=this.animation).finish)==null||r.call(e)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var e,r;this.isPseudoElement||(r=(e=this.animation).commitStyles)==null||r.call(e)}get duration(){var r,o;let e=((o=(r=this.animation.effect)==null?void 0:r.getComputedTiming)==null?void 0:o.call(r).duration)||0;return U(Number(e))}get time(){return U(Number(this.animation.currentTime)||0)}set time(e){this.finishedTime=null,this.animation.currentTime=k(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 Number(this.animation.startTime)}set startTime(e){this.animation.startTime=e}attachTimeline({timeline:e,observe:r}){var o;return this.allowFlatten&&((o=this.animation.effect)==null||o.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&Sn()?(this.animation.timeline=e,R):r(this)}};var Mn={anticipate:Ie,backInOut:Be,circInOut:Oe};function Xl(t){return t in Mn}function Cn(t){typeof t.ease=="string"&&Xl(t.ease)&&(t.ease=Mn[t.ease])}var Dn=10,Er=class extends Dr{constructor(e){Cn(e),wr(e),super(e),e.startTime&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){var c;let{motionValue:r,onUpdate:o,onComplete:i,element:s,...n}=this.options;if(!r)return;if(e!==void 0){r.set(e);return}let a=new pt({...n,autoplay:!1}),l=k((c=this.finishedTime)!=null?c:this.time);r.setWithVelocity(a.sample(l-Dn).value,a.sample(l).value,Dn),a.stop()}};var Xo=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(z.test(t)||t==="0")&&!t.startsWith("url("));function ql(t){let e=t[0];if(t.length===1)return!0;for(let r=0;r<t.length;r++)if(t[r]!==e)return!0}function En(t,e,r,o){let i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;let s=t[t.length-1],n=Xo(i,e),a=Xo(s,e);return tt(n===a,`You are trying to animate ${e} from "${i}" to "${s}". "${n?s:i}" is not an animatable value.`,"value-not-animatable"),!n||!a?!1:ql(t)||(r==="spring"||Cr(r))&&o}function ce(t){t.duration=0,t.type}var Zl=new Set(["opacity","clipPath","filter","transform"]),Jl=Ft(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Rn(t){var m;let{motionValue:e,name:r,repeatDelay:o,repeatType:i,damping:s,type:n}=t;if(!(((m=e==null?void 0:e.owner)==null?void 0:m.current)instanceof HTMLElement))return!1;let{onUpdate:l,transformTemplate:c}=e.owner.getProps();return Jl()&&r&&Zl.has(r)&&(r!=="transform"||!c)&&!l&&!o&&i!=="mirror"&&s!==0&&n!=="inertia"}var Ql=40,Ye=class extends wt{constructor({autoplay:e=!0,delay:r=0,type:o="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:n="loop",keyframes:a,name:l,motionValue:c,element:m,...u}){var h;super(),this.stop=()=>{var d,y;this._animation&&(this._animation.stop(),(d=this.stopTimeline)==null||d.call(this)),(y=this.keyframeResolver)==null||y.cancel()},this.createdAt=B.now();let f={autoplay:e,delay:r,type:o,repeat:i,repeatDelay:s,repeatType:n,name:l,motionValue:c,element:m,...u},p=(m==null?void 0:m.KeyframeResolver)||ht;this.keyframeResolver=new p(a,(d,y,g)=>this.onKeyframesResolved(d,y,f,!g),l,c,m),(h=this.keyframeResolver)==null||h.scheduleResolve()}onKeyframesResolved(e,r,o,i){this.keyframeResolver=void 0;let{name:s,type:n,velocity:a,delay:l,isHandoff:c,onUpdate:m}=o;this.resolvedAt=B.now(),En(e,s,n,a)||((K.instantAnimations||!l)&&(m==null||m(me(e,o,r))),e[0]=e[e.length-1],ce(o),o.repeat=0);let f={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>Ql?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:r,...o,keyframes:e},p=!c&&Rn(f)?new Er({...f,element:f.motionValue.owner.current}):new pt(f);p.finished.then(()=>this.notifyFinished()).catch(R),this.pendingTimeline&&(this.stopTimeline=p.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=p}get finished(){return this._animation?this.animation.finished:this._finished}then(e,r){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),Ho()),this._animation}get duration(){return this.animation.duration}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(){var e;this._animation&&this.animation.cancel(),(e=this.keyframeResolver)==null||e.cancel()}};var tm=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function em(t){let e=tm.exec(t);if(!e)return[,];let[,r,o,i]=e;return[`--${r!=null?r:o}`,i]}var rm=4;function qo(t,e,r=1){G(r<=rm,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");let[o,i]=em(t);if(!o)return;let s=window.getComputedStyle(e).getPropertyValue(o);if(s){let n=s.trim();return De(n)?parseFloat(n):n}return Nt(i)?qo(i,e,r+1):i}function Wt(t,e){var r,o;return(o=(r=t==null?void 0:t[e])!=null?r:t==null?void 0:t.default)!=null?o:t}var Xe=new Set(["width","height","top","left","right","bottom",...st]);var Ln={test:t=>t==="auto",parse:t=>t};var Rr=t=>e=>e.test(t);var Zo=[lt,v,W,nt,Bo,Lo,Ln],Jo=t=>Zo.find(Rr(t));function Bn(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||Re(t):!0}var om=new Set(["brightness","contrast","saturate","opacity"]);function im(t){let[e,r]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;let[o]=r.match(ie)||[];if(!o)return t;let i=r.replace(o,""),s=om.has(e)?1:0;return o!==r&&(s*=100),e+"("+s+i+")"}var nm=/\b([a-z-]*)\(.*?\)/gu,qe={...z,getAnimatableNone:t=>{let e=t.match(nm);return e?e.map(im).join(" "):t}};var Qo={...lt,transform:Math.round};var In={rotate:nt,rotateX:nt,rotateY:nt,rotateZ:nt,scale:Ke,scaleX:Ke,scaleY:Ke,scaleZ:Ke,skew:nt,skewX:nt,skewY:nt,distance:v,translateX:v,translateY:v,translateZ:v,x:v,y:v,z:v,perspective:v,transformPerspective:v,opacity:ft,originX:vr,originY:vr,originZ:v};var zt={borderWidth:v,borderTopWidth:v,borderRightWidth:v,borderBottomWidth:v,borderLeftWidth:v,borderRadius:v,radius:v,borderTopLeftRadius:v,borderTopRightRadius:v,borderBottomRightRadius:v,borderBottomLeftRadius:v,width:v,maxWidth:v,height:v,maxHeight:v,top:v,right:v,bottom:v,left:v,padding:v,paddingTop:v,paddingRight:v,paddingBottom:v,paddingLeft:v,margin:v,marginTop:v,marginRight:v,marginBottom:v,marginLeft:v,backgroundPositionX:v,backgroundPositionY:v,...In,zIndex:Qo,fillOpacity:ft,strokeOpacity:ft,numOctaves:Qo};var kn={...zt,color:E,backgroundColor:E,outlineColor:E,fill:E,stroke:E,borderColor:E,borderTopColor:E,borderRightColor:E,borderBottomColor:E,borderLeftColor:E,filter:qe,WebkitFilter:qe},Ze=t=>kn[t];function Je(t,e){let r=Ze(t);return r!==qe&&(r=z),r.getAnimatableNone?r.getAnimatableNone(e):void 0}var sm=new Set(["auto","none","0"]);function Fn(t,e,r){let o=0,i;for(;o<t.length&&!i;){let s=t[o];typeof s=="string"&&!sm.has(s)&&Pt(s).values.length&&(i=t[o]),o++}if(i&&r)for(let s of e)t[s]=Je(r,i)}var Qe=class extends ht{constructor(e,r,o,i,s){super(e,r,o,i,s,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:r,name:o}=this;if(!r||!r.current)return;super.readKeyframes();for(let l=0;l<e.length;l++){let c=e[l];if(typeof c=="string"&&(c=c.trim(),Nt(c))){let m=qo(c,r.current);m!==void 0&&(e[l]=m),l===e.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!Xe.has(o)||e.length!==2)return;let[i,s]=e,n=Jo(i),a=Jo(s);if(n!==a)if(Ko(n)&&Ko(a))for(let l=0;l<e.length;l++){let c=e[l];typeof c=="string"&&(e[l]=parseFloat(c))}else Mt[o]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:r}=this,o=[];for(let i=0;i<e.length;i++)(e[i]===null||Bn(e[i]))&&o.push(i);o.length&&Fn(e,o,r)}measureInitialState(){let{element:e,unresolvedKeyframes:r,name:o}=this;if(!e||!e.current)return;o==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Mt[o](e.measureViewportBox(),window.getComputedStyle(e.current)),r[0]=this.measuredOrigin;let i=r[r.length-1];i!==void 0&&e.getValue(o,i).jump(i,!1)}measureEndState(){var a;let{element:e,name:r,unresolvedKeyframes:o}=this;if(!e||!e.current)return;let i=e.getValue(r);i&&i.jump(this.measuredOrigin,!1);let s=o.length-1,n=o[s];o[s]=Mt[r](e.measureViewportBox(),window.getComputedStyle(e.current)),n!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=n),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([l,c])=>{e.getValue(l).set(c)}),this.resolveNoneKeyframes()}};function On(t,e,r){var o;if(t instanceof EventTarget)return[t];if(typeof t=="string"){let i=document;e&&(i=e.current);let s=(o=r==null?void 0:r[t])!=null?o:i.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t)}var tr=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function jn(t){return Ee(t)&&"offsetHeight"in t}var Nn=30,am=t=>!isNaN(parseFloat(t)),ti={current:void 0},Lr=class{constructor(e,r={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=o=>{var s;let i=B.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(o),this.current!==this.prev&&((s=this.events.change)==null||s.notify(this.current),this.dependents))for(let n of this.dependents)n.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=r.owner}setCurrent(e){this.current=e,this.updatedAt=B.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=am(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return process.env.NODE_ENV!=="production"&&Ot(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",e)}on(e,r){this.events[e]||(this.events[e]=new ut);let o=this.events[e].add(r);return e==="change"?()=>{o(),S.read(()=>{this.events.change.getSize()||this.stop()})}:o}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,r){this.passiveEffect=e,this.stopPassiveEffect=r}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,r,o){this.set(r),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-o}jump(e,r=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,r&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var e;(e=this.events.change)==null||e.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 ti.current&&ti.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=B.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Nn)return 0;let r=Math.min(this.updatedAt-this.prevUpdatedAt,Nn);return Le(parseFloat(this.current)-parseFloat(this.prevFrameValue),r)}start(e){return this.stop(),new Promise(r=>{this.hasAnimated=!0,this.animation=e(r),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(){var e,r;(e=this.dependents)==null||e.clear(),(r=this.events.destroy)==null||r.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function et(t,e){return new Lr(t,e)}var{schedule:$t,cancel:lm}=gr(queueMicrotask,!1);var rt={x:!1,y:!1};function Br(){return rt.x||rt.y}function ei(t){return t==="x"||t==="y"?rt[t]?null:(rt[t]=!0,()=>{rt[t]=!1}):rt.x||rt.y?null:(rt.x=rt.y=!0,()=>{rt.x=rt.y=!1})}function Ir(t,e){let r=On(t),o=new AbortController,i={passive:!0,...e,signal:o.signal};return[r,i,()=>o.abort()]}function Gn(t){return!(t.pointerType==="touch"||Br())}function ri(t,e,r={}){let[o,i,s]=Ir(t,r),n=a=>{if(!Gn(a))return;let{target:l}=a,c=e(l,a);if(typeof c!="function"||!l)return;let m=u=>{Gn(u)&&(c(u),l.removeEventListener("pointerleave",m))};l.addEventListener("pointerleave",m,i)};return o.forEach(a=>{a.addEventListener("pointerenter",n,i)}),s}var oi=(t,e)=>e?t===e?!0:oi(t,e.parentElement):!1;var Ht=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1;var mm=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Un(t){return mm.has(t.tagName)||t.tabIndex!==-1}var ue=new WeakSet;function Kn(t){return e=>{e.key==="Enter"&&t(e)}}function ii(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}var Wn=(t,e)=>{let r=t.currentTarget;if(!r)return;let o=Kn(()=>{if(ue.has(r))return;ii(r,"down");let i=Kn(()=>{ii(r,"up")}),s=()=>ii(r,"cancel");r.addEventListener("keyup",i,e),r.addEventListener("blur",s,e)});r.addEventListener("keydown",o,e),r.addEventListener("blur",()=>r.removeEventListener("keydown",o),e)};function zn(t){return Ht(t)&&!Br()}function ni(t,e,r={}){let[o,i,s]=Ir(t,r),n=a=>{let l=a.currentTarget;if(!zn(a))return;ue.add(l);let c=e(l,a),m=(p,h)=>{window.removeEventListener("pointerup",u),window.removeEventListener("pointercancel",f),ue.has(l)&&ue.delete(l),zn(p)&&typeof c=="function"&&c(p,{success:h})},u=p=>{m(p,l===window||l===document||r.useGlobalTarget||oi(l,p.target))},f=p=>{m(p,!1)};window.addEventListener("pointerup",u,i),window.addEventListener("pointercancel",f,i)};return o.forEach(a=>{(r.useGlobalTarget?window:a).addEventListener("pointerdown",n,i),jn(a)&&(a.addEventListener("focus",c=>Wn(c,i)),!Un(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),s}function er(t){return Ee(t)&&"ownerSVGElement"in t}function si(t){return er(t)&&t.tagName==="svg"}var M=t=>!!(t&&t.getVelocity);var cm=[...Zo,E,z],ai=t=>cm.find(Rr(t));var $n=require("react"),kr=(0,$n.createContext)({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});var Ct=require("react");function Hn(t=!0){let e=(0,Ct.useContext)(re);if(e===null)return[!0,null];let{isPresent:r,onExitComplete:o,register:i}=e,s=(0,Ct.useId)();(0,Ct.useEffect)(()=>{if(t)return i(s)},[t]);let n=(0,Ct.useCallback)(()=>t&&o&&o(s),[s,o,t]);return!r&&o?[!1,n]:[!0]}var _n=require("react"),Fr=(0,_n.createContext)({strict:!1});var Yn={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"]},dt={};for(let t in Yn)dt[t]={isEnabled:e=>Yn[t].some(r=>!!e[r])};function Xn(t){for(let e in t)dt[e]={...dt[e],...t[e]}}var um=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","ignoreStrict","viewport"]);function rr(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||um.has(t)}var qn=t=>!rr(t);function fm(t){typeof t=="function"&&(qn=e=>e.startsWith("on")?!rr(e):t(e))}try{fm(require("@emotion/is-prop-valid").default)}catch{}function Zn(t,e,r){let o={};for(let i in t)i==="values"&&typeof t.values=="object"||(qn(i)||r===!0&&rr(i)||!e&&!rr(i)||t.draggable&&i.startsWith("onDrag"))&&(o[i]=t[i]);return o}var Yr=require("react/jsx-runtime");var Te=require("react");var Jn=require("react"),Dt=(0,Jn.createContext)({});var Nr=require("react");function Et(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function gt(t){return typeof t=="string"||Array.isArray(t)}var Or=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],or=["initial",...Or];function _t(t){return Et(t.animate)||or.some(e=>gt(t[e]))}function jr(t){return!!(_t(t)||t.variants)}function Qn(t,e){if(_t(t)){let{initial:r,animate:o}=t;return{initial:r===!1||gt(r)?r:void 0,animate:gt(o)?o:void 0}}return t.inherit!==!1?e:{}}function es(t){let{initial:e,animate:r}=Qn(t,(0,Nr.useContext)(Dt));return(0,Nr.useMemo)(()=>({initial:e,animate:r}),[ts(e),ts(r)])}function ts(t){return Array.isArray(t)?t.join(" "):t}var de=require("react");var is=require("react");var Yt={};function rs(t){for(let e in t)Yt[e]=t[e],jt(e)&&(Yt[e].isCSSVariable=!0)}function Gr(t,{layout:e,layoutId:r}){return q.has(t)||t.startsWith("origin")||(e||r!==void 0)&&(!!Yt[t]||t==="opacity")}var pm={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},hm=st.length;function os(t,e,r){let o="",i=!0;for(let s=0;s<hm;s++){let n=st[s],a=t[n];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(n.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||r){let c=tr(a,zt[n]);if(!l){i=!1;let m=pm[n]||n;o+=`${m}(${c}) `}r&&(e[n]=c)}}return o=o.trim(),r?o=r(e,i?"":o):i&&(o="none"),o}function fe(t,e,r){let{style:o,vars:i,transformOrigin:s}=t,n=!1,a=!1;for(let l in e){let c=e[l];if(q.has(l)){n=!0;continue}else if(jt(l)){i[l]=c;continue}else{let m=tr(c,zt[l]);l.startsWith("origin")?(a=!0,s[l]=m):o[l]=m}}if(e.transform||(n||r?o.transform=os(e,t.transform,r):o.transform&&(o.transform="none")),a){let{originX:l="50%",originY:c="50%",originZ:m=0}=s;o.transformOrigin=`${l} ${c} ${m}`}}var pe=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function li(t,e,r){for(let o in e)!M(e[o])&&!Gr(o,r)&&(t[o]=e[o])}function dm({transformTemplate:t},e){return(0,is.useMemo)(()=>{let r=pe();return fe(r,e,t),Object.assign({},r.vars,r.style)},[e])}function gm(t,e){let r=t.style||{},o={};return li(o,r,t),Object.assign(o,dm(t,e)),o}function ns(t,e){let r={},o=gm(t,e);return t.drag&&t.dragListener!==!1&&(r.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(r.tabIndex=0),r.style=o,r}var as=require("react");var ym={offset:"stroke-dashoffset",array:"stroke-dasharray"},xm={offset:"strokeDashoffset",array:"strokeDasharray"};function ss(t,e,r=1,o=0,i=!0){t.pathLength=1;let s=i?ym:xm;t[s.offset]=v.transform(-o);let n=v.transform(e),a=v.transform(r);t[s.array]=`${n} ${a}`}function Ur(t,{attrX:e,attrY:r,attrScale:o,pathLength:i,pathSpacing:s=1,pathOffset:n=0,...a},l,c,m){var p,h;if(fe(t,a,c),l){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};let{attrs:u,style:f}=t;u.transform&&(f.transform=u.transform,delete u.transform),(f.transform||u.transformOrigin)&&(f.transformOrigin=(p=u.transformOrigin)!=null?p:"50% 50%",delete u.transformOrigin),f.transform&&(f.transformBox=(h=m==null?void 0:m.transformBox)!=null?h:"fill-box",delete u.transformBox),e!==void 0&&(u.x=e),r!==void 0&&(u.y=r),o!==void 0&&(u.scale=o),i!==void 0&&ss(u,i,s,n,!1)}var Kr=()=>({...pe(),attrs:{}});var Wr=t=>typeof t=="string"&&t.toLowerCase()==="svg";function ls(t,e,r,o){let i=(0,as.useMemo)(()=>{let s=Kr();return Ur(s,e,Wr(o),t.transformTemplate,t.style),{...s.attrs,style:{...s.style}}},[e]);if(t.style){let s={};li(s,t.style,t),i.style={...s,...i.style}}return i}var ms=["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 he(t){return typeof t!="string"||t.includes("-")?!1:!!(ms.indexOf(t)>-1||/[A-Z]/u.test(t))}function cs(t,e,r,{latestValues:o},i,s=!1){let a=(he(t)?ls:ns)(e,o,i,t),l=Zn(e,typeof t=="string",s),c=t!==de.Fragment?{...l,...a,ref:r}:{},{children:m}=e,u=(0,de.useMemo)(()=>M(m)?m.get():m,[m]);return(0,de.createElement)(t,{...c,children:u})}var mi=require("react");function us(t){let e=[{},{}];return t==null||t.values.forEach((r,o)=>{e[0][o]=r.get(),e[1][o]=r.getVelocity()}),e}function ge(t,e,r,o){if(typeof e=="function"){let[i,s]=us(o);e=e(r!==void 0?r:t.custom,i,s)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){let[i,s]=us(o);e=e(r!==void 0?r:t.custom,i,s)}return e}function ye(t){return M(t)?t.get():t}function vm({scrapeMotionValuesFromProps:t,createRenderState:e},r,o,i){return{latestValues:Tm(r,o,i,t),renderState:e()}}function Tm(t,e,r,o){let i={},s=o(t,{});for(let f in s)i[f]=ye(s[f]);let{initial:n,animate:a}=t,l=_t(t),c=jr(t);e&&c&&!l&&t.inherit!==!1&&(n===void 0&&(n=e.initial),a===void 0&&(a=e.animate));let m=r?r.initial===!1:!1;m=m||n===!1;let u=m?a:n;if(u&&typeof u!="boolean"&&!Et(u)){let f=Array.isArray(u)?u:[u];for(let p=0;p<f.length;p++){let h=ge(t,f[p]);if(h){let{transitionEnd:d,transition:y,...g}=h;for(let T in g){let x=g[T];if(Array.isArray(x)){let A=m?x.length-1:0;x=x[A]}x!==null&&(i[T]=x)}for(let T in d)i[T]=d[T]}}}return i}var zr=t=>(e,r)=>{let o=(0,mi.useContext)(Dt),i=(0,mi.useContext)(re),s=()=>vm(t,e,o,i);return r?s():ji(s)};function xe(t,e,r){var s;let{style:o}=t,i={};for(let n in o)(M(o[n])||e.style&&M(e.style[n])||Gr(n,t)||((s=r==null?void 0:r.getValue(n))==null?void 0:s.liveStyle)!==void 0)&&(i[n]=o[n]);return i}var fs=zr({scrapeMotionValuesFromProps:xe,createRenderState:pe});function $r(t,e,r){let o=xe(t,e,r);for(let i in t)if(M(t[i])||M(e[i])){let s=st.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;o[s]=t[i]}return o}var ps=zr({scrapeMotionValuesFromProps:$r,createRenderState:Kr});var hs=Symbol.for("motionComponentSymbol");var ds=require("react");function yt(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function gs(t,e,r){return(0,ds.useCallback)(o=>{o&&t.onMount&&t.onMount(o),e&&(o?e.mount(o):e.unmount()),r&&(typeof r=="function"?r(o):yt(r)&&(r.current=o))},[e])}var Y=require("react");var ve=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase();var Vm="framerAppearId",Hr="data-"+ve(Vm);var ys=require("react"),_r=(0,ys.createContext)({});function xs(t,e,r,o,i){var d,y;let{visualElement:s}=(0,Y.useContext)(Dt),n=(0,Y.useContext)(Fr),a=(0,Y.useContext)(re),l=(0,Y.useContext)(kr).reducedMotion,c=(0,Y.useRef)(null);o=o||n.renderer,!c.current&&o&&(c.current=o(t,{visualState:e,parent:s,props:r,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));let m=c.current,u=(0,Y.useContext)(_r);m&&!m.projection&&i&&(m.type==="html"||m.type==="svg")&&Sm(c.current,r,i