Files
echo-nexus/node_modules/framer-motion/dist/size-rollup-dom-animation.js
T

2 lines
38 KiB
JavaScript

import{n as t,p as e,q as n,t as i,u as s,v as r,w as o,x as a,y as u,z as l,A as c,B as h,C as d,D as m,E as p,M as f,K as y,F as v,G as g,H as T,I as b,r as w,J as S,i as A,o as x,L as M,N as k,O as C,P as E,Q as V,R as P,V as D,S as O,T as F,U as I,d as K,s as R,W as L,X as B,k as N,e as $,f as j,Y as q,b as U,Z as _,j as H,_ as W,g as z}from"./size-rollup-dom-animation-assets.js";import{Fragment as G}from"react";function Y(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}let X=()=>{},J=()=>{};function Z(t){let e;return()=>(void 0===e&&(e=t()),e)}"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(X=(t,e,n)=>{t||"undefined"==typeof console||console.warn(Y(e,n))},J=(t,e,n)=>{if(!t)throw new Error(Y(e,n))});const Q=(t,e)=>n=>e(t(n)),tt=(...t)=>t.reduce(Q),et=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i},nt=t=>1e3*t,it=t=>t/1e3,st=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function rt(e,n,i,s){if(e===n&&i===s)return t;const r=t=>function(t,e,n,i,s){let r,o,a=0;do{o=e+(n-e)/2,r=st(o,i,s)-t,r>0?n=o:e=o}while(Math.abs(r)>1e-7&&++a<12);return o}(t,0,1,e,i);return t=>0===t||1===t?t:st(r(t),n,s)}const ot=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,at=t=>e=>1-t(1-e),ut=rt(.33,1.53,.69,.99),lt=at(ut),ct=ot(lt),ht=t=>(t*=2)<1?.5*lt(t):.5*(2-Math.pow(2,-10*(t-1))),dt=t=>1-Math.sin(Math.acos(t)),mt=at(dt),pt=ot(dt),ft=rt(.42,0,1,1),yt=rt(0,0,.58,1),vt=rt(.42,0,.58,1),gt=t=>Array.isArray(t)&&"number"==typeof t[0],Tt={linear:t,easeIn:ft,easeInOut:vt,easeOut:yt,circIn:dt,circInOut:pt,circOut:mt,backIn:lt,backInOut:ct,backOut:ut,anticipate:ht},bt=t=>{if(gt(t)){J(4===t.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,n,i,s]=t;return rt(e,n,i,s)}return"string"==typeof t?(J(void 0!==Tt[t],`Invalid easing type '${t}'`,"invalid-easing-type"),Tt[t]):t};function wt(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function St(t,e){return n=>n>0?e:t}const At=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},xt=[s,n,i];function Mt(t){const e=(n=t,xt.find(t=>t.test(n)));var n;if(X(Boolean(e),`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(e))return!1;let s=e.parse(t);return e===i&&(s=function({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let s=0,r=0,o=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;s=wt(a,i,t+1/3),r=wt(a,i,t),o=wt(a,i,t-1/3)}else s=r=o=n;return{red:Math.round(255*s),green:Math.round(255*r),blue:Math.round(255*o),alpha:i}}(s)),s}const kt=(t,i)=>{const s=Mt(t),r=Mt(i);if(!s||!r)return St(t,i);const o={...s};return t=>(o.red=At(s.red,r.red,t),o.green=At(s.green,r.green,t),o.blue=At(s.blue,r.blue,t),o.alpha=e(s.alpha,r.alpha,t),n.transform(o))},Ct=new Set(["none","hidden"]);function Et(t,n){return i=>e(t,n,i)}function Vt(t){return"number"==typeof t?Et:"string"==typeof t?r(t)?St:o.test(t)?kt:Ot:Array.isArray(t)?Pt:"object"==typeof t?o.test(t)?kt:Dt:St}function Pt(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>Vt(t)(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=s[e](t);return n}}function Dt(t,e){const n={...t,...e},i={};for(const s in n)void 0!==t[s]&&void 0!==e[s]&&(i[s]=Vt(t[s])(t[s],e[s]));return t=>{for(const e in i)n[e]=i[e](t);return n}}const Ot=(t,e)=>{const n=a.createTransformer(e),i=u(t),s=u(e);return i.indexes.var.length===s.indexes.var.length&&i.indexes.color.length===s.indexes.color.length&&i.indexes.number.length>=s.indexes.number.length?Ct.has(t)&&!s.values.length||Ct.has(e)&&!i.values.length?function(t,e){return Ct.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):tt(Pt(function(t,e){const n=[],i={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const r=e.types[s],o=t.indexes[r][i[r]],a=t.values[o]??0;n[s]=a,i[r]++}return n}(i,s),s.values),n):(X(!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"),St(t,e))};function Ft(t,n,i){if("number"==typeof t&&"number"==typeof n&&"number"==typeof i)return e(t,n,i);return Vt(t)(t,n)}const It=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>l.update(e,t),stop:()=>c(e),now:()=>h.isProcessing?h.timestamp:d.now()}},Kt=(t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let e=0;e<s;e++)i+=Math.round(1e4*t(e/(s-1)))/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},Rt=2e4;function Lt(t){let e=0;let n=t.next(e);for(;!n.done&&e<Rt;)e+=50,n=t.next(e);return e>=Rt?1/0:e}function Bt(t,e,n){const i=Math.max(e-5,0);return m(n-t(i),e-i)}const Nt=100,$t=10,jt=1,qt=0,Ut=800,_t=.3,Ht=.3,Wt={granular:.01,default:2},zt={granular:.005,default:.5},Gt=.01,Yt=10,Xt=.05,Jt=1,Zt=.001;function Qt({duration:t=Ut,bounce:e=_t,velocity:n=qt,mass:i=jt}){let s,r;X(t<=nt(Yt),"Spring duration must be 10 seconds or less","spring-duration-limit");let o=1-e;o=p(Xt,Jt,o),t=p(Gt,Yt,it(t)),o<1?(s=e=>{const i=e*o,s=i*t,r=i-n,a=ee(e,o),u=Math.exp(-s);return Zt-r/a*u},r=e=>{const i=e*o*t,r=i*n+n,a=Math.pow(o,2)*Math.pow(e,2)*t,u=Math.exp(-i),l=ee(Math.pow(e,2),o);return(-s(e)+Zt>0?-1:1)*((r-a)*u)/l}):(s=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,r=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let i=n;for(let n=1;n<te;n++)i-=t(i)/e(i);return i}(s,r,5/t);if(t=nt(t),isNaN(a))return{stiffness:Nt,damping:$t,duration:t};{const e=Math.pow(a,2)*i;return{stiffness:e,damping:2*o*Math.sqrt(i*e),duration:t}}}const te=12;function ee(t,e){return t*Math.sqrt(1-e*e)}const ne=["duration","bounce"],ie=["stiffness","damping","mass"];function se(t,e){return e.some(e=>void 0!==t[e])}function re(t=Ht,e=_t){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:s}=n;const r=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:u,damping:l,mass:c,duration:h,velocity:d,isResolvedFromDuration:m}=function(t){let e={velocity:qt,stiffness:Nt,damping:$t,mass:jt,isResolvedFromDuration:!1,...t};if(!se(t,ie)&&se(t,ne))if(t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(1.2*n),s=i*i,r=2*p(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:jt,stiffness:s,damping:r}}else{const n=Qt(t);e={...e,...n,mass:jt},e.isResolvedFromDuration=!0}return e}({...n,velocity:-it(n.velocity||0)}),f=d||0,y=l/(2*Math.sqrt(u*c)),v=o-r,g=it(Math.sqrt(u/c)),T=Math.abs(v)<5;let b;if(i||(i=T?Wt.granular:Wt.default),s||(s=T?zt.granular:zt.default),y<1){const t=ee(g,y);b=e=>{const n=Math.exp(-y*g*e);return o-n*((f+y*g*v)/t*Math.sin(t*e)+v*Math.cos(t*e))}}else if(1===y)b=t=>o-Math.exp(-g*t)*(v+(f+g*v)*t);else{const t=g*Math.sqrt(y*y-1);b=e=>{const n=Math.exp(-y*g*e),i=Math.min(t*e,300);return o-n*((f+y*g*v)*Math.sinh(i)+t*v*Math.cosh(i))/t}}const w={calculatedDuration:m&&h||null,next:t=>{const e=b(t);if(m)a.done=t>=h;else{let n=0===t?f:0;y<1&&(n=0===t?nt(f):Bt(b,t,e));const r=Math.abs(n)<=i,u=Math.abs(o-e)<=s;a.done=r&&u}return a.value=a.done?o:e,a},toString:()=>{const t=Math.min(Lt(w),Rt),e=Kt(e=>w.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return w}function oe({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:u,restDelta:l=.5,restSpeed:c}){const h=t[0],d={done:!1,value:h},m=t=>void 0===a?u:void 0===u||Math.abs(a-t)<Math.abs(u-t)?a:u;let p=n*e;const f=h+p,y=void 0===o?f:o(f);y!==f&&(p=y-h);const v=t=>-p*Math.exp(-t/i),g=t=>y+v(t),T=t=>{const e=v(t),n=g(t);d.done=Math.abs(e)<=l,d.value=d.done?y:n};let b,w;const S=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==u&&e>u)&&(b=t,w=re({keyframes:[d.value,m(d.value)],velocity:Bt(g,t,d.value),damping:s,stiffness:r,restDelta:l,restSpeed:c}))};return S(0),{calculatedDuration:null,next:t=>{let e=!1;return w||void 0!==b||(e=!0,T(t),S(t)),void 0!==b&&t>=b?w.next(t-b):(!e&&T(t),d)}}}function ae(e,n,{clamp:i=!0,ease:s,mixer:r}={}){const o=e.length;if(J(o===n.length,"Both input and output ranges must be the same length","range-length"),1===o)return()=>n[0];if(2===o&&n[0]===n[1])return()=>n[1];const a=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),n=[...n].reverse());const u=function(e,n,i){const s=[],r=i||f.mix||Ft,o=e.length-1;for(let i=0;i<o;i++){let o=r(e[i],e[i+1]);if(n){const e=Array.isArray(n)?n[i]||t:n;o=tt(e,o)}s.push(o)}return s}(n,s,r),l=u.length,c=t=>{if(a&&t<e[0])return n[0];let i=0;if(l>1)for(;i<e.length-2&&!(t<e[i+1]);i++);const s=et(e[i],e[i+1],t);return u[i](s)};return i?t=>c(p(e[0],e[o-1],t)):c}function ue(t){const n=[0];return function(t,n){const i=t[t.length-1];for(let s=1;s<=n;s++){const r=et(0,n,s);t.push(e(i,1,r))}}(n,t.length-1),n}function le({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const s=(t=>Array.isArray(t)&&"number"!=typeof t[0])(i)?i.map(bt):bt(i),r={done:!1,value:e[0]},o=function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:ue(e),t),a=ae(o,e,{ease:Array.isArray(s)?s:(u=e,l=s,u.map(()=>l||vt).splice(0,u.length-1))});var u,l;return{calculatedDuration:t,next:e=>(r.value=a(e),r.done=e>=t,r)}}re.applyToOptions=t=>{const e=function(t,e=100,n){const i=n({...t,keyframes:[0,e]}),s=Math.min(Lt(i),Rt);return{type:"keyframes",ease:t=>i.next(s*t).value/e,duration:it(s)}}(t,100,re);return t.ease=e.ease,t.duration=nt(e.duration),t.type="keyframes",t};const ce=t=>null!==t;function he(t,{repeat:e,repeatType:n="loop"},i,s=1){const r=t.filter(ce),o=s<0||e&&"loop"!==n&&e%2==1?0:r.length-1;return o&&void 0!==i?i:r[o]}const de={decay:oe,inertia:oe,tween:le,keyframes:le,spring:re};function me(t){"string"==typeof t.type&&(t.type=de[t.type])}class pe{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const fe=t=>t/100;class ye extends pe{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==d.now()&&this.tick(d.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;me(t);const{type:e=le,repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:r=0}=t;let{keyframes:o}=t;const a=e||le;a!==le&&"number"!=typeof o[0]&&(this.mixKeyframes=tt(fe,Ft(o[0],o[1])),o=[0,100]);const u=a({...t,keyframes:o});"mirror"===s&&(this.mirroredGenerator=a({...t,keyframes:[...o].reverse(),velocity:-r})),null===u.calculatedDuration&&(u.calculatedDuration=Lt(u));const{calculatedDuration:l}=u;this.calculatedDuration=l,this.resolvedDuration=l+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=u}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:n,totalDuration:i,mixKeyframes:s,mirroredGenerator:r,resolvedDuration:o,calculatedDuration:a}=this;if(null===this.startTime)return n.next(0);const{delay:u=0,keyframes:l,repeat:c,repeatType:h,repeatDelay:d,type:m,onUpdate:f,finalKeyframe:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const v=this.currentTime-u*(this.playbackSpeed>=0?1:-1),g=this.playbackSpeed>=0?v<0:v>i;this.currentTime=Math.max(v,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);let T=this.currentTime,b=n;if(c){const t=Math.min(this.currentTime,i)/o;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,c+1);Boolean(e%2)&&("reverse"===h?(n=1-n,d&&(n-=d/o)):"mirror"===h&&(b=r)),T=p(0,1,n)*o}const w=g?{done:!1,value:l[0]}:b.next(T);s&&(w.value=s(w.value));let{done:S}=w;g||null===a||(S=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const A=null===this.holdTime&&("finished"===this.state||"running"===this.state&&S);return A&&m!==oe&&(w.value=he(l,this.options,y,this.speed)),f&&f(w.value),A&&this.finish(),w}then(t,e){return this.finished.then(t,e)}get duration(){return it(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+it(t)}get time(){return it(this.currentTime)}set time(t){t=nt(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(d.now());const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=it(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=It,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=e??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(d.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}const ve=Z(()=>void 0!==window.ScrollTimeline),ge={};function Te(t,e){const n=Z(t);return()=>ge[e]??n()}const be=Te(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),we=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,Se={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:we([0,.65,.55,1]),circOut:we([.55,0,1,.45]),backIn:we([.31,.01,.66,-.59]),backOut:we([.33,1.53,.69,.99])};function Ae(t,e){return t?"function"==typeof t?be()?Kt(t,e):"ease-out":gt(t)?we(t):Array.isArray(t)?t.map(t=>Ae(t,e)||Se.easeOut):Se[t]:void 0}function xe(t,e,n,{delay:i=0,duration:s=300,repeat:r=0,repeatType:o="loop",ease:a="easeOut",times:u}={},l=void 0){const c={[e]:n};u&&(c.offset=u);const h=Ae(a,s);Array.isArray(h)&&(c.easing=h);const d={delay:i,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:r+1,direction:"reverse"===o?"alternate":"normal"};l&&(d.pseudoElement=l);return t.animate(c,d)}function Me(t){return"function"==typeof t&&"applyToOptions"in t}class ke extends pe{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:n,keyframes:i,pseudoElement:s,allowFlatten:r=!1,finalKeyframe:o,onComplete:a}=t;this.isPseudoElement=Boolean(s),this.allowFlatten=r,this.options=t,J("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const u=function({type:t,...e}){return Me(t)&&be()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=xe(e,n,i,u,s),!1===u.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const t=he(i,this.options,o,this.speed);this.updateMotionValue?this.updateMotionValue(t):function(t,e,n){(t=>t.startsWith("--"))(e)?t.style.setProperty(e,n):t.style[e]=n}(e,n,t),this.animation.cancel()}a?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return it(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+it(t)}get time(){return it(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=nt(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:e,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&ve()?(this.animation.timeline=e,t):n(this)}}const Ce={anticipate:ht,backInOut:ct,circInOut:pt};function Ee(t){"string"==typeof t.ease&&t.ease in Ce&&(t.ease=Ce[t.ease])}class Ve extends ke{constructor(t){Ee(t),me(t),super(t),void 0!==t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:n,onComplete:i,element:s,...r}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const o=new ye({...r,autoplay:!1}),a=Math.max(10,d.now()-this.startTime),u=p(0,10,a-10);e.setWithVelocity(o.sample(Math.max(0,a-u)).value,o.sample(a).value,u),o.stop()}}const Pe=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!a.test(t)&&"0"!==t||t.startsWith("url(")));function De(t){t.duration=0,t.type="keyframes"}const Oe=new Set(["opacity","clipPath","filter","transform"]),Fe=Z(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class Ie extends pe{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:r="loop",keyframes:o,name:a,motionValue:u,element:l,...c}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=d.now();const h={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:s,repeatType:r,name:a,motionValue:u,element:l,...c},m=l?.KeyframeResolver||y;this.keyframeResolver=new m(o,(t,e,n)=>this.onKeyframesResolved(t,e,h,!n),a,u,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,i,s){this.keyframeResolver=void 0;const{name:r,type:o,velocity:a,delay:u,isHandoff:l,onUpdate:c}=i;this.resolvedAt=d.now(),function(t,e,n,i){const s=t[0];if(null===s)return!1;if("display"===e||"visibility"===e)return!0;const r=t[t.length-1],o=Pe(s,e),a=Pe(r,e);return X(o===a,`You are trying to animate ${e} from "${s}" to "${r}". "${o?r:s}" is not an animatable value.`,"value-not-animatable"),!(!o||!a)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}(t)||("spring"===n||Me(n))&&i)}(e,r,o,a)||(!f.instantAnimations&&u||c?.(he(e,i,n)),e[0]=e[e.length-1],De(i),i.repeat=0);const h={startTime:s?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:n,...i,keyframes:e},m=!l&&function(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:r,type:o}=t,a=e?.owner?.current;if(!(a instanceof HTMLElement))return!1;const{onUpdate:u,transformTemplate:l}=e.owner.getProps();return Fe()&&n&&Oe.has(n)&&("transform"!==n||!l)&&!u&&!i&&"mirror"!==s&&0!==r&&"inertia"!==o}(h)?new Ve({...h,element:h.motionValue.owner.current}):new ye(h);m.finished.then(()=>this.notifyFinished()).catch(t),this.pendingTimeline&&(this.stopTimeline=m.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),v()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const Ke=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Re(t,e,n=1){J(n<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[i,s]=function(t){const e=Ke.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n??i}`,s]}(t);if(!i)return;const o=window.getComputedStyle(e).getPropertyValue(i);if(o){const t=o.trim();return g(t)?parseFloat(t):t}return r(s)?Re(s,e,n+1):s}function Le(t,e){return t?.[e]??t?.default??t}const Be={type:"spring",stiffness:500,damping:25,restSpeed:10},Ne={type:"keyframes",duration:.8},$e={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},je=(t,{keyframes:e})=>e.length>2?Ne:T.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Be:$e;const qe=t=>null!==t;function Ue(t,e,n,i=0,s=1){const r=Array.from(t).sort((t,e)=>t.sortNodePosition(e)).indexOf(e),o=t.size,a=(o-1)*i;return"function"==typeof n?n(r,o):1===s?r*i:a-r*i}const _e=(t,e,n,i={},s,r)=>o=>{const a=Le(i,t)||{},u=a.delay||i.delay||0;let{elapsed:c=0}=i;c-=nt(u);const h={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-c,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:r?void 0:s};(function({when:t,delay:e,delayChildren:n,staggerChildren:i,staggerDirection:s,repeat:r,repeatType:o,repeatDelay:a,from:u,elapsed:l,...c}){return!!Object.keys(c).length})(a)||Object.assign(h,je(t,h)),h.duration&&(h.duration=nt(h.duration)),h.repeatDelay&&(h.repeatDelay=nt(h.repeatDelay)),void 0!==h.from&&(h.keyframes[0]=h.from);let d=!1;if((!1===h.type||0===h.duration&&!h.repeatDelay)&&(De(h),0===h.delay&&(d=!0)),(f.instantAnimations||f.skipAnimations)&&(d=!0,De(h),h.delay=0),h.allowFlatten=!a.type&&!a.ease,d&&!r&&void 0!==e.get()){const t=function(t,{repeat:e,repeatType:n="loop"},i){const s=t.filter(qe),r=e&&"loop"!==n&&e%2==1?0:s.length-1;return r&&void 0!==i?i:s[r]}(h.keyframes,a);if(void 0!==t)return void l.update(()=>{h.onUpdate(t),h.onComplete()})}return a.isSync?new ye(h):new Ie(h)},He=new Set(["width","height","top","left","right","bottom",...b]);function We(t,e,n){const i=t.getProps();return w(i,e,void 0!==n?n:i.custom,t)}const ze=t=>Array.isArray(t);function Ge(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,S(n))}function Ye(t){return ze(t)?t[t.length-1]||0:t}function Xe(t,e){const n=t.getValue("willChange");if(i=n,Boolean(A(i)&&i.add))return n.add(e);if(!n&&f.WillChange){const n=new f.WillChange("auto");t.addValue("willChange",n),n.add(e)}var i}function Je(t){return t.props[x]}function Ze({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function Qe(t,e,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:r=t.getDefaultTransition(),transitionEnd:o,...a}=e;i&&(r=i);const u=[],c=s&&t.animationState&&t.animationState.getState()[s];for(const e in a){const i=t.getValue(e,t.latestValues[e]??null),s=a[e];if(void 0===s||c&&Ze(c,e))continue;const o={delay:n,...Le(r||{},e)},h=i.get();if(void 0!==h&&!i.isAnimating&&!Array.isArray(s)&&s===h&&!o.velocity)continue;let d=!1;if(window.MotionHandoffAnimation){const n=Je(t);if(n){const t=window.MotionHandoffAnimation(n,e,l);null!==t&&(o.startTime=t,d=!0)}}Xe(t,e),i.start(_e(e,i,s,t.shouldReduceMotion&&He.has(e)?{type:!1}:o,t,d));const m=i.animation;m&&u.push(m)}return o&&Promise.all(u).then(()=>{l.update(()=>{o&&function(t,e){const n=We(t,e);let{transitionEnd:i={},transition:s={},...r}=n||{};r={...r,...i};for(const e in r)Ge(t,e,Ye(r[e]))}(t,o)})}),u}function tn(t,e,n={}){const i=We(t,e,"exit"===n.type?t.presenceContext?.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const r=i?()=>Promise.all(Qe(t,i,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(i=0)=>{const{delayChildren:r=0,staggerChildren:o,staggerDirection:a}=s;return function(t,e,n=0,i=0,s=0,r=1,o){const a=[];for(const u of t.variantChildren)u.notify("AnimationStart",e),a.push(tn(u,e,{...o,delay:n+("function"==typeof i?0:i)+Ue(t.variantChildren,u,i,s,r)}).then(()=>u.notify("AnimationComplete",e)));return Promise.all(a)}(t,e,i,r,o,a,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[t,e]="beforeChildren"===a?[r,o]:[o,r];return t().then(()=>e())}return Promise.all([r(),o(n.delay)])}function en(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||M(t))}const nn=new Set(["auto","none","0"]);class sn extends y{constructor(t,e,n,i,s){super(t,e,n,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){let i=t[n];if("string"==typeof i&&(i=i.trim(),r(i))){const s=Re(i,e.current);void 0!==s&&(t[n]=s),n===t.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!He.has(n)||2!==t.length)return;const[i,s]=t,o=C(i),a=C(s);if(E(i)!==E(s)&&V[n])this.needsMeasurement=!0;else if(o!==a)if(P(o)&&P(a))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else V[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)(null===t[e]||en(t[e]))&&n.push(e);n.length&&function(t,e,n){let i,s=0;for(;s<t.length&&!i;){const e=t[s];"string"==typeof e&&!nn.has(e)&&u(e).values.length&&(i=t[s]),s++}if(i&&n)for(const s of e)t[s]=k(n,i)}(t,n,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=V[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const i=e[e.length-1];void 0!==i&&t.getValue(n,i).jump(i,!1)}measureEndState(){const{element:t,name:e,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const i=t.getValue(e);i&&i.jump(this.measuredOrigin,!1);const s=n.length-1,r=n[s];n[s]=V[e](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==r&&void 0===this.finalKeyframe&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(([e,n])=>{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const rn=!1;function on(){return rn}function an(t,e){const n=function(t){if(t instanceof EventTarget)return[t];if("string"==typeof t){const e=document.querySelectorAll(t);return e?Array.from(e):[]}return Array.from(t)}(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}function un(t){return!("touch"===t.pointerType||on())}const ln=(t,e)=>!!e&&(t===e||ln(t,e.parentElement)),cn=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const hn=new WeakSet;function dn(t){return e=>{"Enter"===e.key&&t(e)}}function mn(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function pn(t){return(t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary)(t)&&!on()}function fn(t,e,n={}){const[i,s,r]=an(t,n),o=t=>{const i=t.currentTarget;if(!pn(t))return;hn.add(i);const r=e(i,t),o=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",u),hn.has(i)&&hn.delete(i),pn(t)&&"function"==typeof r&&r(t,{success:e})},a=t=>{o(t,i===window||i===document||n.useGlobalTarget||ln(i,t.target))},u=t=>{o(t,!1)};window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",u,s)};return i.forEach(t=>{var e,i;(n.useGlobalTarget?window:t).addEventListener("pointerdown",o,s),"object"==typeof(i=e=t)&&null!==i&&"offsetHeight"in e&&(t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const i=dn(()=>{if(hn.has(n))return;mn(n,"down");const t=dn(()=>{mn(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>mn(n,"cancel"),e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)})(t,s)),function(t){return cn.has(t.tagName)||!0===t.isContentEditable}(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),r}class yn{constructor(t){this.isMounted=!1,this.node=t}update(){}}class vn extends D{constructor(){super(...arguments),this.KeyframeResolver=sn}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){const n=t.style;return n?n[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;A(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}function gn(t,{style:e,vars:n},i,s){const r=t.style;let o;for(o in e)r[o]=e[o];for(o in s?.applyProjectionStyles(r,i),n)r.setProperty(o,n[o])}class Tn extends vn{constructor(){super(...arguments),this.type="html",this.renderInstance=gn}readValueFromInstance(t,e){if(T.has(e))return this.projection?.isProjecting?O(e):F(t,e);{const i=(n=t,window.getComputedStyle(n)),s=(I(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return function(t,e){return function({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}(t.getBoundingClientRect(),e))}(t,e)}build(t,e,n){K(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return R(t,e,n)}}const bn=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);class wn extends vn{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=B}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(T.has(e)){const t=q(e);return t&&t.default||0}return e=bn.has(e)?e:L(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return N(t,e,n)}build(t,e,n){$(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){!function(t,e,n,i){gn(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(bn.has(n)?n:L(n),e.attrs[n])}(t,e,0,i)}mount(t){this.isSVGTag=j(t.tagName),super.mount(t)}}const Sn=_.length;function An(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&An(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let n=0;n<Sn;n++){const i=_[n],s=t.props[i];(U(s)||!1===s)&&(e[i]=s)}return e}function xn(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let i=0;i<n;i++)if(e[i]!==t[i])return!1;return!0}const Mn=[...W].reverse(),kn=W.length;function Cn(t){return e=>Promise.all(e.map(({animation:e,options:n})=>function(t,e,n={}){let i;if(t.notify("AnimationStart",e),Array.isArray(e)){const s=e.map(e=>tn(t,e,n));i=Promise.all(s)}else if("string"==typeof e)i=tn(t,e,n);else{const s="function"==typeof e?We(t,e,n.custom):e;i=Promise.all(Qe(t,s,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}(t,e,n)))}function En(t){let e=Cn(t),n=Dn(),i=!0;const s=e=>(n,i)=>{const s=We(t,i,"exit"===e?t.presenceContext?.custom:void 0);if(s){const{transition:t,transitionEnd:e,...i}=s;n={...n,...i,...e}}return n};function r(r){const{props:o}=t,a=An(t.parent)||{},u=[],l=new Set;let c={},h=1/0;for(let e=0;e<kn;e++){const d=Mn[e],m=n[d],p=void 0!==o[d]?o[d]:a[d],f=U(p),y=d===r?m.isActive:null;!1===y&&(h=e);let v=p===a[d]&&p!==o[d]&&f;if(v&&i&&t.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...c},!m.isActive&&null===y||!p&&!m.prevProp||H(p)||"boolean"==typeof p)continue;const g=Vn(m.prevProp,p);let T=g||d===r&&m.isActive&&!v&&f||e>h&&f,b=!1;const w=Array.isArray(p)?p:[p];let S=w.reduce(s(d),{});!1===y&&(S={});const{prevResolvedValues:A={}}=m,x={...A,...S},M=e=>{T=!0,l.has(e)&&(b=!0,l.delete(e)),m.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)};for(const t in x){const e=S[t],n=A[t];if(c.hasOwnProperty(t))continue;let i=!1;i=ze(e)&&ze(n)?!xn(e,n):e!==n,i?null!=e?M(t):l.add(t):void 0!==e&&l.has(t)?M(t):m.protectedKeys[t]=!0}m.prevProp=p,m.prevResolvedValues=S,m.isActive&&(c={...c,...S}),i&&t.blockInitialAnimation&&(T=!1);const k=v&&g;T&&(!k||b)&&u.push(...w.map(e=>{const n={type:d};if("string"==typeof e&&i&&!k&&t.manuallyAnimateOnMount&&t.parent){const{parent:i}=t,s=We(i,e);if(i.enteringChildren&&s){const{delayChildren:e}=s.transition||{};n.delay=Ue(i.enteringChildren,t,e)}}return{animation:e,options:n}}))}if(l.size){const e={};if("boolean"!=typeof o.initial){const n=We(t,Array.isArray(o.initial)?o.initial[0]:o.initial);n&&n.transition&&(e.transition=n.transition)}l.forEach(n=>{const i=t.getBaseTarget(n),s=t.getValue(n);s&&(s.liveStyle=!0),e[n]=i??null}),u.push({animation:e})}let d=Boolean(u.length);return!i||!1!==o.initial&&o.initial!==o.animate||t.manuallyAnimateOnMount||(d=!1),i=!1,d?e(u):Promise.resolve()}return{animateChanges:r,setActive:function(e,i){if(n[e].isActive===i)return Promise.resolve();t.variantChildren?.forEach(t=>t.animationState?.setActive(e,i)),n[e].isActive=i;const s=r(e);for(const t in n)n[t].protectedKeys={};return s},setAnimateFunction:function(n){e=n(t)},getState:()=>n,reset:()=>{n=Dn()}}}function Vn(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!xn(e,t)}function Pn(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Dn(){return{animate:Pn(!0),whileInView:Pn(),whileHover:Pn(),whileTap:Pn(),whileDrag:Pn(),whileFocus:Pn(),exit:Pn()}}function On(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}let Fn=0;const In={animation:{Feature:class extends yn{constructor(t){super(t),t.animationState||(t.animationState=En(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();H(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}},exit:{Feature:class extends yn{constructor(){super(...arguments),this.id=Fn++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;const i=this.node.animationState.setActive("exit",!t);e&&!t&&i.then(()=>{e(this.id)})}mount(){const{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id))}unmount(){}}}};function Kn(t){return{point:{x:t.pageX,y:t.pageY}}}function Rn(t,e,n){const{props:i}=t;t.animationState&&i.whileHover&&t.animationState.setActive("whileHover","Start"===n);const s=i["onHover"+n];s&&l.postRender(()=>s(e,Kn(e)))}function Ln(t,e,n){const{props:i}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&i.whileTap&&t.animationState.setActive("whileTap","Start"===n);const s=i["onTap"+("End"===n?"":n)];s&&l.postRender(()=>s(e,Kn(e)))}const Bn=new WeakMap,Nn=new WeakMap,$n=t=>{const e=Bn.get(t.target);e&&e(t)},jn=t=>{t.forEach($n)};function qn(t,e,n){const i=function({root:t,...e}){const n=t||document;Nn.has(n)||Nn.set(n,{});const i=Nn.get(n),s=JSON.stringify(e);return i[s]||(i[s]=new IntersectionObserver(jn,{root:t,...e})),i[s]}(e);return Bn.set(t,n),i.observe(t),()=>{Bn.delete(t),i.unobserve(t)}}const Un={some:0,all:1};const _n={renderer:(t,e)=>e.isSVG??z(t)?new wn(e):new Tn(e,{allowProjection:t!==G}),...In,...{inView:{Feature:class extends yn{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:i="some",once:s}=t,r={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof i?i:Un[i]};return qn(this.node.current,r,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,s&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:n,onViewportLeave:i}=this.node.getProps(),r=e?n:i;r&&r(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends yn{mount(){const{current:t}=this.node;t&&(this.unmount=fn(t,(t,e)=>(Ln(this.node,e,"Start"),(t,{success:e})=>Ln(this.node,t,e?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends yn{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=tt(On(this.node.current,"focus",()=>this.onFocus()),On(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends yn{mount(){const{current:t}=this.node;t&&(this.unmount=function(t,e,n={}){const[i,s,r]=an(t,n),o=t=>{if(!un(t))return;const{target:n}=t,i=e(n,t);if("function"!=typeof i||!n)return;const r=t=>{un(t)&&(i(t),n.removeEventListener("pointerleave",r))};n.addEventListener("pointerleave",r,s)};return i.forEach(t=>{t.addEventListener("pointerenter",o,s)}),r}(t,(t,e)=>(Rn(this.node,e,"Start"),t=>Rn(this.node,t,"End"))))}unmount(){}}}}};export{_n as domAnimation};