UNPKG

pulsewidget

Version:

A beautiful, customizable chatbot widget for React applications with full TypeScript support and smooth animations

9 lines 249 kB
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("react/jsx-runtime"),D=require("react");function ru(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const xn=ru(D),Li=D.createContext({});function Vi(t){const e=D.useRef(null);return e.current===null&&(e.current=t()),e.current}const Fi=typeof window<"u",Lo=Fi?D.useLayoutEffect:D.useEffect,bn=D.createContext(null);function Oi(t,e){t.indexOf(e)===-1&&t.push(e)}function Ni(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const Vt=(t,e,n)=>n>e?e:n<t?t:n;function ei(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}let me=()=>{},Ft=()=>{};process.env.NODE_ENV!=="production"&&(me=(t,e,n)=>{!t&&typeof console<"u"&&console.warn(ei(e,n))},Ft=(t,e,n)=>{if(!t)throw new Error(ei(e,n))});const Ot={},Vo=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function Fo(t){return typeof t=="object"&&t!==null}const Oo=t=>/^0[^.\s]+$/u.test(t);function Bi(t){let e;return()=>(e===void 0&&(e=t()),e)}const St=t=>t,su=(t,e)=>n=>e(t(n)),$e=(...t)=>t.reduce(su),Ne=(t,e,n)=>{const i=e-t;return i===0?1:(n-t)/i};class ji{constructor(){this.subscriptions=[]}add(e){return Oi(this.subscriptions,e),()=>Ni(this.subscriptions,e)}notify(e,n,i){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,n,i);else for(let o=0;o<r;o++){const s=this.subscriptions[o];s&&s(e,n,i)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Pt=t=>t*1e3,kt=t=>t/1e3;function No(t,e){return e?t*(1e3/e):0}const Rr=new Set;function zi(t,e,n){t||Rr.has(e)||(console.warn(ei(e,n)),Rr.add(e))}const Bo=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,ou=1e-7,au=12;function lu(t,e,n,i,r){let o,s,a=0;do s=e+(n-e)/2,o=Bo(s,i,r)-t,o>0?n=s:e=s;while(Math.abs(o)>ou&&++a<au);return s}function We(t,e,n,i){if(t===e&&n===i)return St;const r=o=>lu(o,0,1,t,n);return o=>o===0||o===1?o:Bo(r(o),e,i)}const jo=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,zo=t=>e=>1-t(1-e),_o=We(.33,1.53,.69,.99),_i=zo(_o),Uo=jo(_i),Ho=t=>(t*=2)<1?.5*_i(t):.5*(2-Math.pow(2,-10*(t-1))),Ui=t=>1-Math.sin(Math.acos(t)),$o=zo(Ui),Wo=jo(Ui),uu=We(.42,0,1,1),cu=We(0,0,.58,1),qo=We(.42,0,.58,1),hu=t=>Array.isArray(t)&&typeof t[0]!="number",Ko=t=>Array.isArray(t)&&typeof t[0]=="number",Lr={linear:St,easeIn:uu,easeInOut:qo,easeOut:cu,circIn:Ui,circInOut:Wo,circOut:$o,backIn:_i,backInOut:Uo,backOut:_o,anticipate:Ho},fu=t=>typeof t=="string",Vr=t=>{if(Ko(t)){Ft(t.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,n,i,r]=t;return We(e,n,i,r)}else if(fu(t))return Ft(Lr[t]!==void 0,`Invalid easing type '${t}'`,"invalid-easing-type"),Lr[t];return t},Ze=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function pu(t,e){let n=new Set,i=new Set,r=!1,o=!1;const s=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function u(l){s.has(l)&&(c.schedule(l),t()),l(a)}const c={schedule:(l,h=!1,p=!1)=>{const y=p&&r?n:i;return h&&s.add(l),y.has(l)||y.add(l),l},cancel:l=>{i.delete(l),s.delete(l)},process:l=>{if(a=l,r){o=!0;return}r=!0,[n,i]=[i,n],n.forEach(u),n.clear(),r=!1,o&&(o=!1,c.process(l))}};return c}const du=40;function Xo(t,e){let n=!1,i=!0;const r={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,s=Ze.reduce((k,M)=>(k[M]=pu(o),k),{}),{setup:a,read:u,resolveKeyframes:c,preUpdate:l,update:h,preRender:p,render:f,postRender:y}=s,x=()=>{const k=Ot.useManualTiming?r.timestamp:performance.now();n=!1,Ot.useManualTiming||(r.delta=i?1e3/60:Math.max(Math.min(k-r.timestamp,du),1)),r.timestamp=k,r.isProcessing=!0,a.process(r),u.process(r),c.process(r),l.process(r),h.process(r),p.process(r),f.process(r),y.process(r),r.isProcessing=!1,n&&e&&(i=!1,t(x))},w=()=>{n=!0,i=!0,r.isProcessing||t(x)};return{schedule:Ze.reduce((k,M)=>{const C=s[M];return k[M]=(b,R=!1,E=!1)=>(n||w(),C.schedule(b,R,E)),k},{}),cancel:k=>{for(let M=0;M<Ze.length;M++)s[Ze[M]].cancel(k)},state:r,steps:s}}const{schedule:Z,cancel:zt,state:st,steps:An}=Xo(typeof requestAnimationFrame<"u"?requestAnimationFrame:St,!0);let sn;function mu(){sn=void 0}const ht={now:()=>(sn===void 0&&ht.set(st.isProcessing||Ot.useManualTiming?st.timestamp:performance.now()),sn),set:t=>{sn=t,queueMicrotask(mu)}},Yo=t=>e=>typeof e=="string"&&e.startsWith(t),Hi=Yo("--"),gu=Yo("var(--"),$i=t=>gu(t)?yu.test(t.split("/*")[0].trim()):!1,yu=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,ge={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Be={...ge,transform:t=>Vt(0,1,t)},Qe={...ge,default:1},Ie=t=>Math.round(t*1e5)/1e5,Wi=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function xu(t){return t==null}const bu=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,qi=(t,e)=>n=>!!(typeof n=="string"&&bu.test(n)&&n.startsWith(t)||e&&!xu(n)&&Object.prototype.hasOwnProperty.call(n,e)),Go=(t,e,n)=>i=>{if(typeof i!="string")return i;const[r,o,s,a]=i.match(Wi);return{[t]:parseFloat(r),[e]:parseFloat(o),[n]:parseFloat(s),alpha:a!==void 0?parseFloat(a):1}},wu=t=>Vt(0,255,t),En={...ge,transform:t=>Math.round(wu(t))},Xt={test:qi("rgb","red"),parse:Go("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+En.transform(t)+", "+En.transform(e)+", "+En.transform(n)+", "+Ie(Be.transform(i))+")"};function ku(t){let e="",n="",i="",r="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),r=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),r=t.substring(4,5),e+=e,n+=n,i+=i,r+=r),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:r?parseInt(r,16)/255:1}}const ni={test:qi("#"),parse:ku,transform:Xt.transform},qe=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),jt=qe("deg"),Dt=qe("%"),B=qe("px"),Su=qe("vh"),vu=qe("vw"),Fr={...Dt,parse:t=>Dt.parse(t)/100,transform:t=>Dt.transform(t*100)},re={test:qi("hsl","hue"),parse:Go("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+Dt.transform(Ie(e))+", "+Dt.transform(Ie(n))+", "+Ie(Be.transform(i))+")"},nt={test:t=>Xt.test(t)||ni.test(t)||re.test(t),parse:t=>Xt.test(t)?Xt.parse(t):re.test(t)?re.parse(t):ni.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Xt.transform(t):re.transform(t),getAnimatableNone:t=>{const e=nt.parse(t);return e.alpha=0,nt.transform(e)}},Tu=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Cu(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(Wi))==null?void 0:e.length)||0)+(((n=t.match(Tu))==null?void 0:n.length)||0)>0}const Zo="number",Qo="color",Pu="var",Au="var(",Or="${}",Eu=/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 je(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},r=[];let o=0;const a=e.replace(Eu,u=>(nt.test(u)?(i.color.push(o),r.push(Qo),n.push(nt.parse(u))):u.startsWith(Au)?(i.var.push(o),r.push(Pu),n.push(u)):(i.number.push(o),r.push(Zo),n.push(parseFloat(u))),++o,Or)).split(Or);return{values:n,split:a,indexes:i,types:r}}function Jo(t){return je(t).values}function ta(t){const{split:e,types:n}=je(t),i=e.length;return r=>{let o="";for(let s=0;s<i;s++)if(o+=e[s],r[s]!==void 0){const a=n[s];a===Zo?o+=Ie(r[s]):a===Qo?o+=nt.transform(r[s]):o+=r[s]}return o}}const Du=t=>typeof t=="number"?0:nt.test(t)?nt.getAnimatableNone(t):t;function Iu(t){const e=Jo(t);return ta(t)(e.map(Du))}const _t={test:Cu,parse:Jo,createTransformer:ta,getAnimatableNone:Iu};function Dn(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 Mu({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,e/=100,n/=100;let r=0,o=0,s=0;if(!e)r=o=s=n;else{const a=n<.5?n*(1+e):n+e-n*e,u=2*n-a;r=Dn(u,a,t+1/3),o=Dn(u,a,t),s=Dn(u,a,t-1/3)}return{red:Math.round(r*255),green:Math.round(o*255),blue:Math.round(s*255),alpha:i}}function cn(t,e){return n=>n>0?e:t}const J=(t,e,n)=>t+(e-t)*n,In=(t,e,n)=>{const i=t*t,r=n*(e*e-i)+i;return r<0?0:Math.sqrt(r)},Ru=[ni,Xt,re],Lu=t=>Ru.find(e=>e.test(t));function Nr(t){const e=Lu(t);if(me(!!e,`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!e)return!1;let n=e.parse(t);return e===re&&(n=Mu(n)),n}const Br=(t,e)=>{const n=Nr(t),i=Nr(e);if(!n||!i)return cn(t,e);const r={...n};return o=>(r.red=In(n.red,i.red,o),r.green=In(n.green,i.green,o),r.blue=In(n.blue,i.blue,o),r.alpha=J(n.alpha,i.alpha,o),Xt.transform(r))},ii=new Set(["none","hidden"]);function Vu(t,e){return ii.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function Fu(t,e){return n=>J(t,e,n)}function Ki(t){return typeof t=="number"?Fu:typeof t=="string"?$i(t)?cn:nt.test(t)?Br:Bu:Array.isArray(t)?ea:typeof t=="object"?nt.test(t)?Br:Ou:cn}function ea(t,e){const n=[...t],i=n.length,r=t.map((o,s)=>Ki(o)(o,e[s]));return o=>{for(let s=0;s<i;s++)n[s]=r[s](o);return n}}function Ou(t,e){const n={...t,...e},i={};for(const r in n)t[r]!==void 0&&e[r]!==void 0&&(i[r]=Ki(t[r])(t[r],e[r]));return r=>{for(const o in i)n[o]=i[o](r);return n}}function Nu(t,e){const n=[],i={color:0,var:0,number:0};for(let r=0;r<e.values.length;r++){const o=e.types[r],s=t.indexes[o][i[o]],a=t.values[s]??0;n[r]=a,i[o]++}return n}const Bu=(t,e)=>{const n=_t.createTransformer(e),i=je(t),r=je(e);return i.indexes.var.length===r.indexes.var.length&&i.indexes.color.length===r.indexes.color.length&&i.indexes.number.length>=r.indexes.number.length?ii.has(t)&&!r.values.length||ii.has(e)&&!i.values.length?Vu(t,e):$e(ea(Nu(i,r),r.values),n):(me(!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"),cn(t,e))};function na(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?J(t,e,n):Ki(t)(t,e)}const ju=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>Z.update(e,n),stop:()=>zt(e),now:()=>st.isProcessing?st.timestamp:ht.now()}},ia=(t,e,n=10)=>{let i="";const r=Math.max(Math.round(e/n),2);for(let o=0;o<r;o++)i+=Math.round(t(o/(r-1))*1e4)/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},hn=2e4;function Xi(t){let e=0;const n=50;let i=t.next(e);for(;!i.done&&e<hn;)e+=n,i=t.next(e);return e>=hn?1/0:e}function zu(t,e=100,n){const i=n({...t,keyframes:[0,e]}),r=Math.min(Xi(i),hn);return{type:"keyframes",ease:o=>i.next(r*o).value/e,duration:kt(r)}}const _u=5;function ra(t,e,n){const i=Math.max(e-_u,0);return No(n-t(i),e-i)}const Q={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},Mn=.001;function Uu({duration:t=Q.duration,bounce:e=Q.bounce,velocity:n=Q.velocity,mass:i=Q.mass}){let r,o;me(t<=Pt(Q.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let s=1-e;s=Vt(Q.minDamping,Q.maxDamping,s),t=Vt(Q.minDuration,Q.maxDuration,kt(t)),s<1?(r=c=>{const l=c*s,h=l*t,p=l-n,f=ri(c,s),y=Math.exp(-h);return Mn-p/f*y},o=c=>{const h=c*s*t,p=h*n+n,f=Math.pow(s,2)*Math.pow(c,2)*t,y=Math.exp(-h),x=ri(Math.pow(c,2),s);return(-r(c)+Mn>0?-1:1)*((p-f)*y)/x}):(r=c=>{const l=Math.exp(-c*t),h=(c-n)*t+1;return-Mn+l*h},o=c=>{const l=Math.exp(-c*t),h=(n-c)*(t*t);return l*h});const a=5/t,u=$u(r,o,a);if(t=Pt(t),isNaN(u))return{stiffness:Q.stiffness,damping:Q.damping,duration:t};{const c=Math.pow(u,2)*i;return{stiffness:c,damping:s*2*Math.sqrt(i*c),duration:t}}}const Hu=12;function $u(t,e,n){let i=n;for(let r=1;r<Hu;r++)i=i-t(i)/e(i);return i}function ri(t,e){return t*Math.sqrt(1-e*e)}const Wu=["duration","bounce"],qu=["stiffness","damping","mass"];function jr(t,e){return e.some(n=>t[n]!==void 0)}function Ku(t){let e={velocity:Q.velocity,stiffness:Q.stiffness,damping:Q.damping,mass:Q.mass,isResolvedFromDuration:!1,...t};if(!jr(t,qu)&&jr(t,Wu))if(t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(n*1.2),r=i*i,o=2*Vt(.05,1,1-(t.bounce||0))*Math.sqrt(r);e={...e,mass:Q.mass,stiffness:r,damping:o}}else{const n=Uu(t);e={...e,...n,mass:Q.mass},e.isResolvedFromDuration=!0}return e}function fn(t=Q.visualDuration,e=Q.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:r}=n;const o=n.keyframes[0],s=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:u,damping:c,mass:l,duration:h,velocity:p,isResolvedFromDuration:f}=Ku({...n,velocity:-kt(n.velocity||0)}),y=p||0,x=c/(2*Math.sqrt(u*l)),w=s-o,g=kt(Math.sqrt(u/l)),v=Math.abs(w)<5;i||(i=v?Q.restSpeed.granular:Q.restSpeed.default),r||(r=v?Q.restDelta.granular:Q.restDelta.default);let k;if(x<1){const C=ri(g,x);k=b=>{const R=Math.exp(-x*g*b);return s-R*((y+x*g*w)/C*Math.sin(C*b)+w*Math.cos(C*b))}}else if(x===1)k=C=>s-Math.exp(-g*C)*(w+(y+g*w)*C);else{const C=g*Math.sqrt(x*x-1);k=b=>{const R=Math.exp(-x*g*b),E=Math.min(C*b,300);return s-R*((y+x*g*w)*Math.sinh(E)+C*w*Math.cosh(E))/C}}const M={calculatedDuration:f&&h||null,next:C=>{const b=k(C);if(f)a.done=C>=h;else{let R=C===0?y:0;x<1&&(R=C===0?Pt(y):ra(k,C,b));const E=Math.abs(R)<=i,O=Math.abs(s-b)<=r;a.done=E&&O}return a.value=a.done?s:b,a},toString:()=>{const C=Math.min(Xi(M),hn),b=ia(R=>M.next(C*R).value,C,30);return C+"ms "+b},toTransition:()=>{}};return M}fn.applyToOptions=t=>{const e=zu(t,100,fn);return t.ease=e.ease,t.duration=Pt(e.duration),t.type="keyframes",t};function si({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:r=10,bounceStiffness:o=500,modifyTarget:s,min:a,max:u,restDelta:c=.5,restSpeed:l}){const h=t[0],p={done:!1,value:h},f=E=>a!==void 0&&E<a||u!==void 0&&E>u,y=E=>a===void 0?u:u===void 0||Math.abs(a-E)<Math.abs(u-E)?a:u;let x=n*e;const w=h+x,g=s===void 0?w:s(w);g!==w&&(x=g-h);const v=E=>-x*Math.exp(-E/i),k=E=>g+v(E),M=E=>{const O=v(E),j=k(E);p.done=Math.abs(O)<=c,p.value=p.done?g:j};let C,b;const R=E=>{f(p.value)&&(C=E,b=fn({keyframes:[p.value,y(p.value)],velocity:ra(k,E,p.value),damping:r,stiffness:o,restDelta:c,restSpeed:l}))};return R(0),{calculatedDuration:null,next:E=>{let O=!1;return!b&&C===void 0&&(O=!0,M(E),R(E)),C!==void 0&&E>=C?b.next(E-C):(!O&&M(E),p)}}}function Xu(t,e,n){const i=[],r=n||Ot.mix||na,o=t.length-1;for(let s=0;s<o;s++){let a=r(t[s],t[s+1]);if(e){const u=Array.isArray(e)?e[s]||St:e;a=$e(u,a)}i.push(a)}return i}function Yu(t,e,{clamp:n=!0,ease:i,mixer:r}={}){const o=t.length;if(Ft(o===e.length,"Both input and output ranges must be the same length","range-length"),o===1)return()=>e[0];if(o===2&&e[0]===e[1])return()=>e[1];const s=t[0]===t[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=Xu(e,i,r),u=a.length,c=l=>{if(s&&l<t[0])return e[0];let h=0;if(u>1)for(;h<t.length-2&&!(l<t[h+1]);h++);const p=Ne(t[h],t[h+1],l);return a[h](p)};return n?l=>c(Vt(t[0],t[o-1],l)):c}function Gu(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const r=Ne(0,e,i);t.push(J(n,1,r))}}function Zu(t){const e=[0];return Gu(e,t.length-1),e}function Qu(t,e){return t.map(n=>n*e)}function Ju(t,e){return t.map(()=>e||qo).splice(0,t.length-1)}function se({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const r=hu(i)?i.map(Vr):Vr(i),o={done:!1,value:e[0]},s=Qu(n&&n.length===e.length?n:Zu(e),t),a=Yu(s,e,{ease:Array.isArray(r)?r:Ju(e,r)});return{calculatedDuration:t,next:u=>(o.value=a(u),o.done=u>=t,o)}}const tc=t=>t!==null;function Yi(t,{repeat:e,repeatType:n="loop"},i,r=1){const o=t.filter(tc),a=r<0||e&&n!=="loop"&&e%2===1?0:o.length-1;return!a||i===void 0?o[a]:i}const ec={decay:si,inertia:si,tween:se,keyframes:se,spring:fn};function sa(t){typeof t.type=="string"&&(t.type=ec[t.type])}class Gi{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 nc=t=>t/100;class Zi extends Gi{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var i,r;const{motionValue:n}=this.options;n&&n.updatedAt!==ht.now()&&this.tick(ht.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(r=(i=this.options).onStop)==null||r.call(i))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;sa(e);const{type:n=se,repeat:i=0,repeatDelay:r=0,repeatType:o,velocity:s=0}=e;let{keyframes:a}=e;const u=n||se;process.env.NODE_ENV!=="production"&&u!==se&&Ft(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),u!==se&&typeof a[0]!="number"&&(this.mixKeyframes=$e(nc,na(a[0],a[1])),a=[0,100]);const c=u({...e,keyframes:a});o==="mirror"&&(this.mirroredGenerator=u({...e,keyframes:[...a].reverse(),velocity:-s})),c.calculatedDuration===null&&(c.calculatedDuration=Xi(c));const{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(i+1)-r,this.generator=c}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:i,totalDuration:r,mixKeyframes:o,mirroredGenerator:s,resolvedDuration:a,calculatedDuration:u}=this;if(this.startTime===null)return i.next(0);const{delay:c=0,keyframes:l,repeat:h,repeatType:p,repeatDelay:f,type:y,onUpdate:x,finalKeyframe:w}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=r);let k=this.currentTime,M=i;if(h){const E=Math.min(this.currentTime,r)/a;let O=Math.floor(E),j=E%1;!j&&E>=1&&(j=1),j===1&&O--,O=Math.min(O,h+1),!!(O%2)&&(p==="reverse"?(j=1-j,f&&(j-=f/a)):p==="mirror"&&(M=s)),k=Vt(0,1,j)*a}const C=v?{done:!1,value:l[0]}:M.next(k);o&&(C.value=o(C.value));let{done:b}=C;!v&&u!==null&&(b=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);const R=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&b);return R&&y!==si&&(C.value=Yi(l,this.options,w,this.speed)),x&&x(C.value),R&&this.finish(),C}then(e,n){return this.finished.then(e,n)}get duration(){return kt(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+kt(e)}get time(){return kt(this.currentTime)}set time(e){var n;e=Pt(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),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(ht.now());const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=kt(this.currentTime))}play(){var r,o;if(this.isStopped)return;const{driver:e=ju,startTime:n}=this.options;this.driver||(this.driver=e(s=>this.tick(s))),(o=(r=this.options).onPlay)==null||o.call(r);const i=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=i):this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime||(this.startTime=n??i),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(ht.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(e=this.options).onComplete)==null||n.call(e)}cancel(){var e,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(e=this.options).onCancel)==null||n.call(e)}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){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),e.observe(this)}}function ic(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const Yt=t=>t*180/Math.PI,oi=t=>{const e=Yt(Math.atan2(t[1],t[0]));return ai(e)},rc={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:oi,rotateZ:oi,skewX:t=>Yt(Math.atan(t[1])),skewY:t=>Yt(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},ai=t=>(t=t%360,t<0&&(t+=360),t),zr=oi,_r=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Ur=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),sc={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:_r,scaleY:Ur,scale:t=>(_r(t)+Ur(t))/2,rotateX:t=>ai(Yt(Math.atan2(t[6],t[5]))),rotateY:t=>ai(Yt(Math.atan2(-t[2],t[0]))),rotateZ:zr,rotate:zr,skewX:t=>Yt(Math.atan(t[4])),skewY:t=>Yt(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function li(t){return t.includes("scale")?1:0}function ui(t,e){if(!t||t==="none")return li(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,r;if(n)i=sc,r=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=rc,r=a}if(!r)return li(e);const o=i[e],s=r[1].split(",").map(ac);return typeof o=="function"?o(s):s[o]}const oc=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return ui(n,e)};function ac(t){return parseFloat(t.trim())}const ye=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],xe=new Set(ye),Hr=t=>t===ge||t===B,lc=new Set(["x","y","z"]),uc=ye.filter(t=>!lc.has(t));function cc(t){const e=[];return uc.forEach(n=>{const i=t.getValue(n);i!==void 0&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e}const Gt={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})=>ui(e,"x"),y:(t,{transform:e})=>ui(e,"y")};Gt.translateX=Gt.x;Gt.translateY=Gt.y;const Zt=new Set;let ci=!1,hi=!1,fi=!1;function oa(){if(hi){const t=Array.from(Zt).filter(i=>i.needsMeasurement),e=new Set(t.map(i=>i.element)),n=new Map;e.forEach(i=>{const r=cc(i);r.length&&(n.set(i,r),i.render())}),t.forEach(i=>i.measureInitialState()),e.forEach(i=>{i.render();const r=n.get(i);r&&r.forEach(([o,s])=>{var a;(a=i.getValue(o))==null||a.set(s)})}),t.forEach(i=>i.measureEndState()),t.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}hi=!1,ci=!1,Zt.forEach(t=>t.complete(fi)),Zt.clear()}function aa(){Zt.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(hi=!0)})}function hc(){fi=!0,aa(),oa(),fi=!1}class Qi{constructor(e,n,i,r,o,s=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=i,this.motionValue=r,this.element=o,this.isAsync=s}scheduleResolve(){this.state="scheduled",this.isAsync?(Zt.add(this),ci||(ci=!0,Z.read(aa),Z.resolveKeyframes(oa))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:i,motionValue:r}=this;if(e[0]===null){const o=r==null?void 0:r.get(),s=e[e.length-1];if(o!==void 0)e[0]=o;else if(i&&n){const a=i.readValue(n,s);a!=null&&(e[0]=a)}e[0]===void 0&&(e[0]=s),r&&o===void 0&&r.set(e[0])}ic(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Zt.delete(this)}cancel(){this.state==="scheduled"&&(Zt.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const fc=t=>t.startsWith("--");function pc(t,e,n){fc(e)?t.style.setProperty(e,n):t.style[e]=n}const dc=Bi(()=>window.ScrollTimeline!==void 0),mc={};function gc(t,e){const n=Bi(t);return()=>mc[e]??n()}const la=gc(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),De=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,$r={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:De([0,.65,.55,1]),circOut:De([.55,0,1,.45]),backIn:De([.31,.01,.66,-.59]),backOut:De([.33,1.53,.69,.99])};function ua(t,e){if(t)return typeof t=="function"?la()?ia(t,e):"ease-out":Ko(t)?De(t):Array.isArray(t)?t.map(n=>ua(n,e)||$r.easeOut):$r[t]}function yc(t,e,n,{delay:i=0,duration:r=300,repeat:o=0,repeatType:s="loop",ease:a="easeOut",times:u}={},c=void 0){const l={[e]:n};u&&(l.offset=u);const h=ua(a,r);Array.isArray(h)&&(l.easing=h);const p={delay:i,duration:r,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:o+1,direction:s==="reverse"?"alternate":"normal"};return c&&(p.pseudoElement=c),t.animate(l,p)}function ca(t){return typeof t=="function"&&"applyToOptions"in t}function xc({type:t,...e}){return ca(t)&&la()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class bc extends Gi{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,!e)return;const{element:n,name:i,keyframes:r,pseudoElement:o,allowFlatten:s=!1,finalKeyframe:a,onComplete:u}=e;this.isPseudoElement=!!o,this.allowFlatten=s,this.options=e,Ft(typeof e.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const c=xc(e);this.animation=yc(n,i,r,c,o),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const l=Yi(r,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(l):pc(n,i,l),this.animation.cancel()}u==null||u(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,n;(n=(e=this.animation).finish)==null||n.call(e)}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(){var e,n;this.isPseudoElement||(n=(e=this.animation).commitStyles)==null||n.call(e)}get duration(){var n,i;const e=((i=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:i.call(n).duration)||0;return kt(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+kt(e)}get time(){return kt(Number(this.animation.currentTime)||0)}set time(e){this.finishedTime=null,this.animation.currentTime=Pt(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:n}){var i;return this.allowFlatten&&((i=this.animation.effect)==null||i.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&dc()?(this.animation.timeline=e,St):n(this)}}const ha={anticipate:Ho,backInOut:Uo,circInOut:Wo};function wc(t){return t in ha}function kc(t){typeof t.ease=="string"&&wc(t.ease)&&(t.ease=ha[t.ease])}const Wr=10;class Sc extends bc{constructor(e){kc(e),sa(e),super(e),e.startTime&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:i,onComplete:r,element:o,...s}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const a=new Zi({...s,autoplay:!1}),u=Pt(this.finishedTime??this.time);n.setWithVelocity(a.sample(u-Wr).value,a.sample(u).value,Wr),a.stop()}}const qr=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(_t.test(t)||t==="0")&&!t.startsWith("url("));function vc(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 Tc(t,e,n,i){const r=t[0];if(r===null)return!1;if(e==="display"||e==="visibility")return!0;const o=t[t.length-1],s=qr(r,e),a=qr(o,e);return me(s===a,`You are trying to animate ${e} from "${r}" to "${o}". "${s?o:r}" is not an animatable value.`,"value-not-animatable"),!s||!a?!1:vc(t)||(n==="spring"||ca(n))&&i}function pi(t){t.duration=0,t.type="keyframes"}const Cc=new Set(["opacity","clipPath","filter","transform"]),Pc=Bi(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Ac(t){var l;const{motionValue:e,name:n,repeatDelay:i,repeatType:r,damping:o,type:s}=t;if(!(((l=e==null?void 0:e.owner)==null?void 0:l.current)instanceof HTMLElement))return!1;const{onUpdate:u,transformTemplate:c}=e.owner.getProps();return Pc()&&n&&Cc.has(n)&&(n!=="transform"||!c)&&!u&&!i&&r!=="mirror"&&o!==0&&s!=="inertia"}const Ec=40;class Dc extends Gi{constructor({autoplay:e=!0,delay:n=0,type:i="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:s="loop",keyframes:a,name:u,motionValue:c,element:l,...h}){var y;super(),this.stop=()=>{var x,w;this._animation&&(this._animation.stop(),(x=this.stopTimeline)==null||x.call(this)),(w=this.keyframeResolver)==null||w.cancel()},this.createdAt=ht.now();const p={autoplay:e,delay:n,type:i,repeat:r,repeatDelay:o,repeatType:s,name:u,motionValue:c,element:l,...h},f=(l==null?void 0:l.KeyframeResolver)||Qi;this.keyframeResolver=new f(a,(x,w,g)=>this.onKeyframesResolved(x,w,p,!g),u,c,l),(y=this.keyframeResolver)==null||y.scheduleResolve()}onKeyframesResolved(e,n,i,r){this.keyframeResolver=void 0;const{name:o,type:s,velocity:a,delay:u,isHandoff:c,onUpdate:l}=i;this.resolvedAt=ht.now(),Tc(e,o,s,a)||((Ot.instantAnimations||!u)&&(l==null||l(Yi(e,i,n))),e[0]=e[e.length-1],pi(i),i.repeat=0);const p={startTime:r?this.resolvedAt?this.resolvedAt-this.createdAt>Ec?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...i,keyframes:e},f=!c&&Ac(p)?new Sc({...p,element:p.motionValue.owner.current}):new Zi(p);f.finished.then(()=>this.notifyFinished()).catch(St),this.pendingTimeline&&(this.stopTimeline=f.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=f}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),hc()),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(){var e;this._animation&&this.animation.cancel(),(e=this.keyframeResolver)==null||e.cancel()}}const Ic=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Mc(t){const e=Ic.exec(t);if(!e)return[,];const[,n,i,r]=e;return[`--${n??i}`,r]}const Rc=4;function fa(t,e,n=1){Ft(n<=Rc,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[i,r]=Mc(t);if(!i)return;const o=window.getComputedStyle(e).getPropertyValue(i);if(o){const s=o.trim();return Vo(s)?parseFloat(s):s}return $i(r)?fa(r,e,n+1):r}function Ji(t,e){return(t==null?void 0:t[e])??(t==null?void 0:t.default)??t}const pa=new Set(["width","height","top","left","right","bottom",...ye]),Lc={test:t=>t==="auto",parse:t=>t},da=t=>e=>e.test(t),ma=[ge,B,Dt,jt,vu,Su,Lc],Kr=t=>ma.find(da(t));function Vc(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||Oo(t):!0}const Fc=new Set(["brightness","contrast","saturate","opacity"]);function Oc(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[i]=n.match(Wi)||[];if(!i)return t;const r=n.replace(i,"");let o=Fc.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+r+")"}const Nc=/\b([a-z-]*)\(.*?\)/gu,di={..._t,getAnimatableNone:t=>{const e=t.match(Nc);return e?e.map(Oc).join(" "):t}},Xr={...ge,transform:Math.round},Bc={rotate:jt,rotateX:jt,rotateY:jt,rotateZ:jt,scale:Qe,scaleX:Qe,scaleY:Qe,scaleZ:Qe,skew:jt,skewX:jt,skewY:jt,distance:B,translateX:B,translateY:B,translateZ:B,x:B,y:B,z:B,perspective:B,transformPerspective:B,opacity:Be,originX:Fr,originY:Fr,originZ:B},tr={borderWidth:B,borderTopWidth:B,borderRightWidth:B,borderBottomWidth:B,borderLeftWidth:B,borderRadius:B,radius:B,borderTopLeftRadius:B,borderTopRightRadius:B,borderBottomRightRadius:B,borderBottomLeftRadius:B,width:B,maxWidth:B,height:B,maxHeight:B,top:B,right:B,bottom:B,left:B,padding:B,paddingTop:B,paddingRight:B,paddingBottom:B,paddingLeft:B,margin:B,marginTop:B,marginRight:B,marginBottom:B,marginLeft:B,backgroundPositionX:B,backgroundPositionY:B,...Bc,zIndex:Xr,fillOpacity:Be,strokeOpacity:Be,numOctaves:Xr},jc={...tr,color:nt,backgroundColor:nt,outlineColor:nt,fill:nt,stroke:nt,borderColor:nt,borderTopColor:nt,borderRightColor:nt,borderBottomColor:nt,borderLeftColor:nt,filter:di,WebkitFilter:di},ga=t=>jc[t];function ya(t,e){let n=ga(t);return n!==di&&(n=_t),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const zc=new Set(["auto","none","0"]);function _c(t,e,n){let i=0,r;for(;i<t.length&&!r;){const o=t[i];typeof o=="string"&&!zc.has(o)&&je(o).values.length&&(r=t[i]),i++}if(r&&n)for(const o of e)t[o]=ya(n,r)}class Uc extends Qi{constructor(e,n,i,r,o){super(e,n,i,r,o,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:i}=this;if(!n||!n.current)return;super.readKeyframes();for(let u=0;u<e.length;u++){let c=e[u];if(typeof c=="string"&&(c=c.trim(),$i(c))){const l=fa(c,n.current);l!==void 0&&(e[u]=l),u===e.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!pa.has(i)||e.length!==2)return;const[r,o]=e,s=Kr(r),a=Kr(o);if(s!==a)if(Hr(s)&&Hr(a))for(let u=0;u<e.length;u++){const c=e[u];typeof c=="string"&&(e[u]=parseFloat(c))}else Gt[i]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,i=[];for(let r=0;r<e.length;r++)(e[r]===null||Vc(e[r]))&&i.push(r);i.length&&_c(e,i,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:i}=this;if(!e||!e.current)return;i==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Gt[i](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const r=n[n.length-1];r!==void 0&&e.getValue(i,r).jump(r,!1)}measureEndState(){var a;const{element:e,name:n,unresolvedKeyframes:i}=this;if(!e||!e.current)return;const r=e.getValue(n);r&&r.jump(this.measuredOrigin,!1);const o=i.length-1,s=i[o];i[o]=Gt[n](e.measureViewportBox(),window.getComputedStyle(e.current)),s!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=s),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([u,c])=>{e.getValue(u).set(c)}),this.resolveNoneKeyframes()}}function Hc(t,e,n){if(t instanceof EventTarget)return[t];if(typeof t=="string"){let i=document;const r=(n==null?void 0:n[t])??i.querySelectorAll(t);return r?Array.from(r):[]}return Array.from(t)}const xa=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function ba(t){return Fo(t)&&"offsetHeight"in t}const Yr=30,$c=t=>!isNaN(parseFloat(t));class Wc{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=i=>{var o;const r=ht.now();if(this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(i),this.current!==this.prev&&((o=this.events.change)==null||o.notify(this.current),this.dependents))for(const s of this.dependents)s.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=ht.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=$c(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return process.env.NODE_ENV!=="production"&&zi(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new ji);const i=this.events[e].add(n);return e==="change"?()=>{i(),Z.read(()=>{this.events.change.getSize()||this.stop()})}:i}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,i){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-i}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&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 this.current}getPrevious(){return this.prev}getVelocity(){const e=ht.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Yr)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Yr);return No(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(){var e,n;(e=this.dependents)==null||e.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function pe(t,e){return new Wc(t,e)}const{schedule:er}=Xo(queueMicrotask,!1),Ct={x:!1,y:!1};function wa(){return Ct.x||Ct.y}function qc(t){return t==="x"||t==="y"?Ct[t]?null:(Ct[t]=!0,()=>{Ct[t]=!1}):Ct.x||Ct.y?null:(Ct.x=Ct.y=!0,()=>{Ct.x=Ct.y=!1})}function ka(t,e){const n=Hc(t),i=new AbortController,r={passive:!0,...e,signal:i.signal};return[n,r,()=>i.abort()]}function Gr(t){return!(t.pointerType==="touch"||wa())}function Kc(t,e,n={}){const[i,r,o]=ka(t,n),s=a=>{if(!Gr(a))return;const{target:u}=a,c=e(u,a);if(typeof c!="function"||!u)return;const l=h=>{Gr(h)&&(c(h),u.removeEventListener("pointerleave",l))};u.addEventListener("pointerleave",l,r)};return i.forEach(a=>{a.addEventListener("pointerenter",s,r)}),o}const Sa=(t,e)=>e?t===e?!0:Sa(t,e.parentElement):!1,nr=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,Xc=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Yc(t){return Xc.has(t.tagName)||t.tabIndex!==-1}const on=new WeakSet;function Zr(t){return e=>{e.key==="Enter"&&t(e)}}function Rn(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Gc=(t,e)=>{const n=t.currentTarget;if(!n)return;const i=Zr(()=>{if(on.has(n))return;Rn(n,"down");const r=Zr(()=>{Rn(n,"up")}),o=()=>Rn(n,"cancel");n.addEventListener("keyup",r,e),n.addEventListener("blur",o,e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)};function Qr(t){return nr(t)&&!wa()}function Zc(t,e,n={}){const[i,r,o]=ka(t,n),s=a=>{const u=a.currentTarget;if(!Qr(a))return;on.add(u);const c=e(u,a),l=(f,y)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",p),on.has(u)&&on.delete(u),Qr(f)&&typeof c=="function"&&c(f,{success:y})},h=f=>{l(f,u===window||u===document||n.useGlobalTarget||Sa(u,f.target))},p=f=>{l(f,!1)};window.addEventListener("pointerup",h,r),window.addEventListener("pointercancel",p,r)};return i.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",s,r),ba(a)&&(a.addEventListener("focus",c=>Gc(c,r)),!Yc(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),o}function va(t){return Fo(t)&&"ownerSVGElement"in t}function Qc(t){return va(t)&&t.tagName==="svg"}const at=t=>!!(t&&t.getVelocity),Jc=[...ma,nt,_t],th=t=>Jc.find(da(t)),ir=D.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function Jr(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function eh(...t){return e=>{let n=!1;const i=t.map(r=>{const o=Jr(r,e);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let r=0;r<i.length;r++){const o=i[r];typeof o=="function"?o():Jr(t[r],null)}}}}function nh(...t){return xn.useCallback(eh(...t),t)}class ih extends xn.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(n&&e.isPresent&&!this.props.isPresent){const i=n.offsetParent,r=ba(i)&&i.offsetWidth||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=r-o.width-o.left}return null}componentDidUpdate(){}render(){return this.props.children}}function rh({children:t,isPresent:e,anchorX:n,root:i}){const r=D.useId(),o=D.useRef(null),s=D.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:a}=D.useContext(ir),u=nh(o,t==null?void 0:t.ref);return D.useInsertionEffect(()=>{const{width:c,height:l,top:h,left:p,right:f}=s.current;if(e||!o.current||!c||!l)return;const y=n==="left"?`left: ${p}`:`right: ${f}`;o.current.dataset.motionPopId=r;const x=document.createElement("style");a&&(x.nonce=a);const w=i??document.head;return w.appendChild(x),x.sheet&&x.sheet.insertRule(` [data-motion-pop-id="${r}"] { position: absolute !important; width: ${c}px !important; height: ${l}px !important; ${y}px !important; top: ${h}px !important; } `),()=>{w.contains(x)&&w.removeChild(x)}},[e]),I.jsx(ih,{isPresent:e,childRef:o,sizeRef:s,children:xn.cloneElement(t,{ref:u})})}const sh=({children:t,initial:e,isPresent:n,onExitComplete:i,custom:r,presenceAffectsLayout:o,mode:s,anchorX:a,root:u})=>{const c=Vi(oh),l=D.useId();let h=!0,p=D.useMemo(()=>(h=!1,{id:l,initial:e,isPresent:n,custom:r,onExitComplete:f=>{c.set(f,!0);for(const y of c.values())if(!y)return;i&&i()},register:f=>(c.set(f,!1),()=>c.delete(f))}),[n,c,i]);return o&&h&&(p={...p}),D.useMemo(()=>{c.forEach((f,y)=>c.set(y,!1))},[n]),xn.useEffect(()=>{!n&&!c.size&&i&&i()},[n]),s==="popLayout"&&(t=I.jsx(rh,{isPresent:n,anchorX:a,root:u,children:t})),I.jsx(bn.Provider,{value:p,children:t})};function oh(){return new Map}function Ta(t=!0){const e=D.useContext(bn);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:i,register:r}=e,o=D.useId();D.useEffect(()=>{if(t)return r(o)},[t]);const s=D.useCallback(()=>t&&i&&i(o),[o,i,t]);return!n&&i?[!1,s]:[!0]}const Je=t=>t.key||"";function ts(t){const e=[];return D.Children.forEach(t,n=>{D.isValidElement(n)&&e.push(n)}),e}const pn=({children:t,custom:e,initial:n=!0,onExitComplete:i,presenceAffectsLayout:r=!0,mode:o="sync",propagate:s=!1,anchorX:a="left",root:u})=>{const[c,l]=Ta(s),h=D.useMemo(()=>ts(t),[t]),p=s&&!c?[]:h.map(Je),f=D.useRef(!0),y=D.useRef(h),x=Vi(()=>new Map),[w,g]=D.useState(h),[v,k]=D.useState(h);Lo(()=>{f.current=!1,y.current=h;for(let b=0;b<v.length;b++){const R=Je(v[b]);p.includes(R)?x.delete(R):x.get(R)!==!0&&x.set(R,!1)}},[v,p.length,p.join("-")]);const M=[];if(h!==w){let b=[...h];for(let R=0;R<v.length;R++){const E=v[R],O=Je(E);p.includes(O)||(b.splice(R,0,E),M.push(E))}return o==="wait"&&M.length&&(b=M),k(ts(b)),g(h),null}process.env.NODE_ENV!=="production"&&o==="wait"&&v.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:C}=D.useContext(Li);return I.jsx(I.Fragment,{children:v.map(b=>{const R=Je(b),E=s&&!c?!1:h===v||p.includes(R),O=()=>{if(x.has(R))x.set(R,!0);else return;let j=!0;x.forEach(L=>{L||(j=!1)}),j&&(C==null||C(),k(y.current),s&&(l==null||l()),i&&i())};return I.jsx(sh,{isPresent:E,initial:!f.current||n?void 0:!1,custom:e,presenceAffectsLayout:r,mode:o,root:u,onExitComplete:E?void 0:O,anchorX:a,children:b},R)})})},Ca=D.createContext({strict:!1}),es={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"]},de={};for(const t in es)de[t]={isEnabled:e=>es[t].some(n=>!!e[n])};function ah(t){for(const e in t)de[e]={...de[e],...t[e]}}const lh=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 dn(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||lh.has(t)}let Pa=t=>!dn(t);function uh(t){typeof t=="function"&&(Pa=e=>e.startsWith("on")?!dn(e):t(e))}try{uh(require("@emotion/is-prop-valid").default)}catch{}function ch(t,e,n){const i={};for(const r in t)r==="values"&&typeof t.values=="object"||(Pa(r)||n===!0&&dn(r)||!e&&!dn(r)||t.draggable&&r.startsWith("onDrag"))&&(i[r]=t[r]);return i}const wn=D.createContext({});function kn(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function ze(t){return typeof t=="string"||Array.isArray(t)}const rr=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],sr=["initial",...rr];function Sn(t){return kn(t.animate)||sr.some(e=>ze(t[e]))}function Aa(t){return!!(Sn(t)||t.variants)}function hh(t,e){if(Sn(t)){const{initial:n,animate:i}=t;return{initial:n===!1||ze(n)?n:void 0,animate:ze(i)?i:void 0}}return t.inherit!==!1?e:{}}function fh(t){const{initial:e,animate:n}=hh(t,D.useContext(wn));return D.useMemo(()=>({initial:e,animate:n}),[ns(e),ns(n)])}function ns(t){return Array.isArray(t)?t.join(" "):t}const _e={};function ph(t){for(const e in t)_e[e]=t[e],Hi(e)&&(_e[e].isCSSVariable=!0)}function Ea(t,{layout:e,layoutId:n}){return xe.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!_e[t]||t==="opacity")}const dh={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},mh=ye.length;function gh(t,e,n){let i="",r=!0;for(let o=0;o<mh;o++){const s=ye[o],a=t[s];if(a===void 0)continue;let u=!0;if(typeof a=="number"?u=a===(s.startsWith("scale")?1:0):u=parseFloat(a)===0,!u||n){const c=xa(a,tr[s]);if(!u){r=!1;const l=dh[s]||s;i+=`${l}(${c}) `}n&&(e[s]=c)}}return i=i.trim(),n?i=n(e,r?"":i):r&&(i="none"),i}function or(t,e,n){const{style:i,vars:r,transformOrigin:o}=t;let s=!1,a=!1;for(const u in e){const c=e[u];if(xe.has(u)){s=!0;continue}else if(Hi(u)){r[u]=c;continue}else{const l=xa(c,tr[u]);u.startsWith("origin")?(a=!0,o[u]=l):i[u]=l}}if(e.transform||(s||n?i.transform=gh(e,t.transform,n):i.transform&&(i.transform="none")),a){const{originX:u="50%",originY:c="50%",originZ:l=0}=o;i.transformOrigin=`${u} ${c} ${l}`}}const ar=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Da(t,e,n){for(const i in e)!at(e[i])&&!Ea(i,n)&&(t[i]=e[i])}function yh({transformTemplate:t},e){return D.useMemo(()=>{const n=ar();return or(n,e,t),Object.assign({},n.vars,n.style)},[e])}function xh(t,e){const n=t.style||{},i={};return Da(i,n,t),Object.assign(i,yh(t,e)),i}function bh(t,e){const n={},i=xh(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.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=i,n}const wh={offset:"stroke-dashoffset",array:"stroke-dasharray"},kh={offset:"strokeDashoffset",array:"strokeDasharray"};function Sh(t,e,n=1,i=0,r=!0){t.pathLength=1;const o=r?wh:kh;t[o.offset]=B.transform(-i);const s=B.transform(e),a=B.transform(n);t[o.array]=`${s} ${a}`}function Ia(t,{attrX:e,attrY:n,attrScale:i,pathLength:r,pathSpacing:o=1,pathOffset:s=0,...a},u,c,l){if(or(t,a,c),u){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:h,style:p}=t;h.transform&&(p.transform=h.transform,delete h.transform),(p.transform||h.transformOrigin)&&(p.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),p.transform&&(p.transformBox=(l==null?void 0:l.transformBox)??"fill-box",delete h.transformBox),e!==void 0&&(h.x=e),n!==void 0&&(h.y=n),i!==void 0&&(h.scale=i),r!==void 0&&Sh(h,r,o,s,!1)}const Ma=()=>({...ar(),attrs:{}}),Ra=t=>typeof t=="string"&&t.toLowerCase()==="svg";function vh(t,e,n,i){const r=D.useMemo(()=>{const o=Ma();return Ia(o,e,R