react-ui-animate 3.0.0-rc.3 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/animation/{lib/animationType.d.ts → animationType.d.ts} +1 -1
- package/dist/animation/helpers/index.d.ts +2 -0
- package/dist/animation/helpers/isDefined.d.ts +1 -0
- package/dist/animation/{lib/index.d.ts → index.d.ts} +2 -1
- package/dist/animation/{lib/interpolation.d.ts → interpolation.d.ts} +1 -1
- package/dist/animation/{lib/modules → modules}/AnimatedBlock.d.ts +2 -2
- package/dist/animation/{lib/modules → modules}/AnimatedImage.d.ts +2 -2
- package/dist/animation/{lib/modules → modules}/AnimatedInline.d.ts +2 -2
- package/dist/animation/{lib/modules → modules}/MountedBlock.d.ts +1 -1
- package/dist/animation/{lib/useAnimatedValue.d.ts → useAnimatedValue.d.ts} +1 -1
- package/dist/animation/{lib/useMountedValue.d.ts → useMountedValue.d.ts} +1 -1
- package/dist/animation/{lib/withFunctions.d.ts → withFunctions.d.ts} +5 -5
- package/dist/index.d.ts +6 -7
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +4 -1
- package/dist/animation/core/controllers/Animation.d.ts +0 -16
- package/dist/animation/core/controllers/FluidValue.d.ts +0 -32
- package/dist/animation/core/controllers/RequestAnimationFrame.d.ts +0 -8
- package/dist/animation/core/controllers/SpringAnimation.d.ts +0 -41
- package/dist/animation/core/controllers/TimingAnimation.d.ts +0 -35
- package/dist/animation/core/easing/Bezier.d.ts +0 -8
- package/dist/animation/core/easing/Easing.d.ts +0 -40
- package/dist/animation/core/helpers/camelCaseToKebabCase.d.ts +0 -8
- package/dist/animation/core/helpers/getCleanProps.d.ts +0 -10
- package/dist/animation/core/helpers/getCssValue.d.ts +0 -8
- package/dist/animation/core/helpers/index.d.ts +0 -5
- package/dist/animation/core/helpers/isDefined.d.ts +0 -12
- package/dist/animation/core/helpers/isFluidValue.d.ts +0 -10
- package/dist/animation/core/index.d.ts +0 -11
- package/dist/animation/core/interpolation/Colors.d.ts +0 -25
- package/dist/animation/core/interpolation/Interpolation.d.ts +0 -80
- package/dist/animation/core/interpolation/__tests__/Colors.test.d.ts +0 -1
- package/dist/animation/core/react/fluid.d.ts +0 -6
- package/dist/animation/core/react/makeFluid.d.ts +0 -30
- package/dist/animation/core/react/transforms.d.ts +0 -6
- package/dist/animation/core/react/useFluidValue.d.ts +0 -9
- package/dist/animation/core/react/useMount.d.ts +0 -20
- package/dist/animation/lib/getInitialConfig.d.ts +0 -4
- package/dist/utils/index.d.ts +0 -1
- /package/dist/{utils → animation/helpers}/delay.d.ts +0 -0
- /package/dist/animation/{lib/modules → modules}/ScrollableBlock.d.ts +0 -0
- /package/dist/animation/{lib/modules → modules}/TransitionBlock.d.ts +0 -0
- /package/dist/animation/{lib/modules → modules}/index.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isDefined: <T>(value: T) => value is NonNullable<T>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { interpolate, bInterpolate } from './interpolation';
|
|
2
2
|
export { AnimatedBlock, AnimatedImage, AnimatedInline, MountedBlock, ScrollableBlock, TransitionBlock, } from './modules';
|
|
3
3
|
export { useAnimatedValue, UseAnimatedValueConfig } from './useAnimatedValue';
|
|
4
|
-
export { useMountedValue } from './useMountedValue';
|
|
4
|
+
export { useMountedValue, UseMountedValueConfig } from './useMountedValue';
|
|
5
5
|
export { AnimationConfigUtils } from './animationType';
|
|
6
6
|
export { withSpring, withTiming, withSequence, withDelay, } from './withFunctions';
|
|
7
|
+
export { delay } from './helpers';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ExtrapolateConfig, FluidValue } from '
|
|
1
|
+
import { ExtrapolateConfig, FluidValue } from '@raidipesh78/re-motion';
|
|
2
2
|
import { ValueType } from './useAnimatedValue';
|
|
3
3
|
/**
|
|
4
4
|
* Maps the input range to the given output range using the specified extrapolation configuration.
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
* which can accept `AnimatedValue`. It also exposes some extra style properties like
|
|
4
4
|
* translateX, translateY, rotateX, rotateY, scaleX, etc.
|
|
5
5
|
*/
|
|
6
|
-
export declare const AnimatedBlock: import("react").ForwardRefExoticComponent<Omit<import("
|
|
7
|
-
style?: import("
|
|
6
|
+
export declare const AnimatedBlock: import("react").ForwardRefExoticComponent<Omit<import("@raidipesh78/re-motion/dist/types/fluid").FluidHTMLAttributes<"div"> & import("@raidipesh78/re-motion/dist/types/fluid").FluidSVGAttributes<"div">, "style"> & {
|
|
7
|
+
style?: import("@raidipesh78/re-motion/dist/types/fluid").FluidCSSProperties | undefined;
|
|
8
8
|
} & import("react").RefAttributes<unknown>>;
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
* which can accept `AnimatedValue`. It also exposes some extra style properties like
|
|
4
4
|
* translateX, translateY, rotateX, rotateY, scaleX, etc.
|
|
5
5
|
*/
|
|
6
|
-
export declare const AnimatedImage: import("react").ForwardRefExoticComponent<Omit<import("
|
|
7
|
-
style?: import("
|
|
6
|
+
export declare const AnimatedImage: import("react").ForwardRefExoticComponent<Omit<import("@raidipesh78/re-motion/dist/types/fluid").FluidHTMLAttributes<"img"> & import("@raidipesh78/re-motion/dist/types/fluid").FluidSVGAttributes<"img">, "style"> & {
|
|
7
|
+
style?: import("@raidipesh78/re-motion/dist/types/fluid").FluidCSSProperties | undefined;
|
|
8
8
|
} & import("react").RefAttributes<unknown>>;
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
* which can accept `AnimatedValue`. It also exposes some extra style properties like
|
|
4
4
|
* translateX, translateY, rotateX, rotateY, scaleX, etc.
|
|
5
5
|
*/
|
|
6
|
-
export declare const AnimatedInline: import("react").ForwardRefExoticComponent<Omit<import("
|
|
7
|
-
style?: import("
|
|
6
|
+
export declare const AnimatedInline: import("react").ForwardRefExoticComponent<Omit<import("@raidipesh78/re-motion/dist/types/fluid").FluidHTMLAttributes<"span"> & import("@raidipesh78/re-motion/dist/types/fluid").FluidSVGAttributes<"span">, "style"> & {
|
|
7
|
+
style?: import("@raidipesh78/re-motion/dist/types/fluid").FluidCSSProperties | undefined;
|
|
8
8
|
} & import("react").RefAttributes<unknown>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FluidValueConfig, Length } from '
|
|
1
|
+
import type { FluidValueConfig, Length } from '@raidipesh78/re-motion';
|
|
2
2
|
interface WithSpringConfig extends Pick<FluidValueConfig, 'mass' | 'friction' | 'tension'> {
|
|
3
3
|
}
|
|
4
4
|
/**
|
|
@@ -51,12 +51,12 @@ export declare const withDelay: (delay: number, animation: {
|
|
|
51
51
|
tension?: number;
|
|
52
52
|
friction?: number;
|
|
53
53
|
duration?: number;
|
|
54
|
-
easing?: import("
|
|
54
|
+
easing?: import("@raidipesh78/re-motion/dist/types/common").Fn<number, number>;
|
|
55
55
|
immediate?: boolean;
|
|
56
56
|
restDistance?: number;
|
|
57
|
-
onChange?: import("
|
|
58
|
-
onRest?: import("
|
|
59
|
-
onStart?: import("
|
|
57
|
+
onChange?: import("@raidipesh78/re-motion/dist/types/common").Fn<number, void>;
|
|
58
|
+
onRest?: import("@raidipesh78/re-motion/dist/types/common").Fn<import("@raidipesh78/re-motion/dist/types/animation").ResultType, void>;
|
|
59
|
+
onStart?: import("@raidipesh78/re-motion/dist/types/common").Fn<number, void>;
|
|
60
60
|
};
|
|
61
61
|
toValue: Length;
|
|
62
62
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
export { Easing, makeFluid, fluid } from '
|
|
2
|
-
export { AnimatedBlock, AnimatedImage, AnimatedInline, AnimationConfigUtils, MountedBlock, ScrollableBlock, TransitionBlock, } from './animation
|
|
3
|
-
export { bInterpolate, interpolate } from './animation
|
|
4
|
-
export { useAnimatedValue, useMountedValue } from './animation
|
|
5
|
-
export { delay } from './
|
|
6
|
-
export { withSpring, withTiming, withSequence, withDelay, } from './animation/lib';
|
|
1
|
+
export { Easing, makeFluid, fluid } from '@raidipesh78/re-motion';
|
|
2
|
+
export { AnimatedBlock, AnimatedImage, AnimatedInline, AnimationConfigUtils, MountedBlock, ScrollableBlock, TransitionBlock, } from './animation';
|
|
3
|
+
export { bInterpolate, interpolate } from './animation';
|
|
4
|
+
export { useAnimatedValue, useMountedValue } from './animation';
|
|
5
|
+
export { withSpring, withTiming, withSequence, withDelay, delay, } from './animation';
|
|
7
6
|
export { useMeasure, useOutsideClick, useWindowDimension } from './hooks';
|
|
8
7
|
export { useDrag, useGesture, useMouseMove, useScroll, useWheel, } from './gestures/hooks';
|
|
9
8
|
export { bin, clamp, mix, rubberClamp, move, snapTo } from './gestures/helpers';
|
|
10
|
-
export type { UseAnimatedValueConfig } from './animation
|
|
9
|
+
export type { UseAnimatedValueConfig, UseMountedValueConfig, } from './animation';
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var e=require("react"),t=require("react/jsx-runtime");function n(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var i=n(e),r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)};function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var a=function(){return a=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},a.apply(this,arguments)};function s(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n}function f(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{f(i.next(e))}catch(e){o(e)}}function s(e){try{f(i.throw(e))}catch(e){o(e)}}function f(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}f((i=i.apply(e,t||[])).next())}))}function u(e,t){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(f){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,i=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,f])}}}function l(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function c(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,r,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=o.next()).done;)a.push(i.value)}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return a}function h(e,t,n){if(n||2===arguments.length)for(var i,r=0,o=t.length;r<o;r++)!i&&r in t||(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var d=function(){function e(){}return e.prototype._debounceOnEnd=function(e){var t=this._onEnd,n=this._onRest;this._onEnd=null,this._onRest=null,n&&n(e),t&&t(e)},e.prototype.stop=function(){},e}(),p={current:function(e){return window.requestAnimationFrame(e)},inject:function(e){p.current=e}},v={current:function(e){return window.cancelAnimationFrame(e)},inject:function(e){v.current=e}},m=function(e){function t(t){var n,i,r,o,a,s,f=t.initialPosition,u=t.config,l=e.call(this)||this;return l._overshootClamping=!1,l._initialVelocity=0,l._lastVelocity=0,l._startPosition=f,l._position=l._startPosition,l._restDisplacementThreshold=null!==(n=null==u?void 0:u.restDistance)&&void 0!==n?n:.001,l._restSpeedThreshold=null!==(i=null==u?void 0:u.restDistance)&&void 0!==i?i:.001,l._mass=null!==(r=null==u?void 0:u.mass)&&void 0!==r?r:1,l._tension=null!==(o=null==u?void 0:u.tension)&&void 0!==o?o:170,l._friction=null!==(a=null==u?void 0:u.friction)&&void 0!==a?a:26,l._delay=null!==(s=null==u?void 0:u.delay)&&void 0!==s?s:0,l._onRest=null==u?void 0:u.onRest,l._onChange=null==u?void 0:u.onChange,l}return o(t,e),t.prototype.onChange=function(e){this._onFrame(e),this._lastPosition!==e&&this._onChange&&this._onChange(e),this._lastPosition=e},t.prototype.onUpdate=function(){var e=this,t=Date.now(),n=Math.min(t-this._lastTime,64);this._lastTime=t;var i=this._friction,r=this._mass,o=this._tension,a=-this._lastVelocity,s=this._toValue-this._position,f=i/(2*Math.sqrt(o*r)),u=Math.sqrt(o/r),l=u*Math.sqrt(1-Math.pow(f,2)),c=n/1e3,h=Math.sin(l*c),d=Math.cos(l*c),v=Math.exp(-f*u*c),m=v*(h*((a+f*u*s)/l)+s*d),y=this._toValue-m,g=f*u*m-v*(d*(a+f*u*s)-l*s*h),b=Math.exp(-u*c),_=this._toValue-b*(s+(a+u*s)*c),w=b*(a*(c*u-1)+c*s*u*u);this.onChange(this._position);var x=Math.abs(this._lastVelocity)<this._restSpeedThreshold,E=0===this._tension||Math.abs(this._toValue-this._position)<this._restDisplacementThreshold;if(f<1?(this._position=y,this._lastVelocity=g):(this._position=_,this._lastVelocity=w),e._overshootClamping&&0!==e._tension&&(e._position<e._toValue?e._position>e._toValue:e._position<e._toValue)||x&&E)return 0!==this._tension&&(this._lastVelocity=0,this._position=this._toValue,this.onChange(this._position)),this._lastTime=0,void this._debounceOnEnd({finished:!0,value:this._toValue});this._animationFrame=p.current(this.onUpdate.bind(this))},t.prototype.stop=function(){this._active=!1,clearTimeout(this._timeout),v.current(this._animationFrame),this._debounceOnEnd({finished:!1,value:this._position})},t.prototype.set=function(e){this.stop(),this._position=e,this._lastTime=0,this._lastVelocity=0,this.onChange(e)},t.prototype.start=function(e){var n=this,i=e.toValue,r=e.onFrame,o=e.previousAnimation,a=e.onEnd,s=function(){n._onFrame=r,n._active=!0,n._toValue=i,n._onEnd=a;var e=Date.now();o instanceof t?(n._lastVelocity=o._lastVelocity||n._lastVelocity||0,n._lastTime=o._lastTime||e):n._lastTime=e,n._animationFrame=p.current(n.onUpdate.bind(n))};0!==this._delay?this._timeout=setTimeout((function(){return s()}),this._delay):s()},t}(d),y=4,g=1e-7,b=10,_=.1,w="function"==typeof Float32Array;function x(e,t){return 1-3*t+3*e}function E(e,t){return 3*t-6*e}function k(e){return 3*e}function M(e,t,n){return((x(t,n)*e+E(t,n))*e+k(t))*e}function T(e,t,n){return 3*x(t,n)*e*e+2*E(t,n)*e+k(t)}function I(e){return e}function O(e,t,n,i){if(!(0<=e&&e<=1&&0<=n&&n<=1))throw new Error("bezier x values must be in [0, 1] range");if(e===t&&n===i)return I;for(var r=w?new Float32Array(11):new Array(11),o=0;o<11;++o)r[o]=M(o*_,e,n);function a(t){for(var i=0,o=1;10!==o&&r[o]<=t;++o)i+=_;--o;var a=i+(t-r[o])/(r[o+1]-r[o])*_,s=T(a,e,n);return s>=.001?function(e,t,n,i){for(var r=0;r<y;++r){var o=T(t,n,i);if(0===o)return t;t-=(M(t,n,i)-e)/o}return t}(t,a,e,n):0===s?a:function(e,t,n,i,r){var o,a,s=0;do{(o=M(a=t+(n-t)/2,i,r)-e)>0?n=a:t=a}while(Math.abs(o)>g&&++s<b);return a}(t,i,i+_,e,n)}return function(e){return 0===e||1===e?e:M(a(e),t,i)}}var C=function(){function e(){}return e.step0=function(e){return e>0?1:0},e.step1=function(e){return e>=1?1:0},e.linear=function(e){return e},e.ease=function(e){return V(e)},e.quad=function(e){return e*e},e.cubic=function(e){return e*e*e},e.poly=function(e){return function(t){return Math.pow(t,e)}},e.sin=function(e){return 1-Math.cos(e*Math.PI/2)},e.circle=function(e){return 1-Math.sqrt(1-e*e)},e.exp=function(e){return Math.pow(2,10*(e-1))},e.elastic=function(e){void 0===e&&(e=1);var t=e*Math.PI;return function(e){return 1-Math.pow(Math.cos(e*Math.PI/2),3)*Math.cos(e*t)}},e.back=function(e){return void 0===e&&(e=1.70158),function(t){return t*t*((e+1)*t-e)}},e.bounce=function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},e.bezier=function(e,t,n,i){return O(e,t,n,i)},e.in=function(e){return e},e.out=function(e){return function(t){return 1-e(1-t)}},e.inOut=function(e){return function(t){return t<.5?e(2*t)/2:1-e(2*(1-t))/2}},e}(),V=C.bezier(.42,0,1,1),S=function(e){function t(t){var n,i,r,o=t.initialPosition,a=t.config,s=e.call(this)||this;return s._fromValue=o,s._position=s._fromValue,s._easing=null!==(n=null==a?void 0:a.easing)&&void 0!==n?n:C.linear,s._duration=null!==(i=null==a?void 0:a.duration)&&void 0!==i?i:500,s._tempDuration=s._duration,(null==a?void 0:a.immediate)&&(s._duration=0),s._delay=null!==(r=null==a?void 0:a.delay)&&void 0!==r?r:0,s._onRest=null==a?void 0:a.onRest,s._onChange=null==a?void 0:a.onChange,s}return o(t,e),t.prototype.onChange=function(e){this._onFrame(e),this._lastPosition!==e&&this._onChange&&this._onChange(e),this._lastPosition=e},t.prototype.onUpdate=function(){var e=Date.now()-this._startTime;if(e>=this._duration)return this._startTime=0,this._position=this._toValue,this.onChange(this._position),void this._debounceOnEnd({finished:!0,value:this._position});var t=this._easing(e/this._duration);this._position=this._fromValue+(this._toValue-this._fromValue)*t,this.onChange(this._position),this._animationFrame=p.current(this.onUpdate.bind(this))},t.prototype.stop=function(){this._active=!1,clearTimeout(this._timeout),v.current(this._animationFrame),this._debounceOnEnd({finished:!1,value:this._position})},t.prototype.set=function(e){this.stop(),this._position=e,this.onChange(e)},t.prototype.start=function(e){var n=this,i=e.toValue,r=e.onFrame,o=e.previousAnimation,a=e.onEnd,s=function(){if(n._onFrame=r,n._active=!0,n._onEnd=a,n._toValue=i,o&&o instanceof t&&o._toValue===i&&o._startTime)n._startTime=o._startTime,n._fromValue=o._fromValue;else{var e=Date.now();n._startTime=e,n._fromValue=n._position}n._animationFrame=p.current(n.onUpdate.bind(n))};0!==this._delay?this._timeout=setTimeout((function(){return s()}),this._delay):s()},t}(d),L=/[+-]?\d+(\.\d+)?|[\s]?\.\d+|#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})/gi,A=/#[a-f\d]{3,}|transparent|aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|burntsienna|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen/gi,R={transparent:"#00000000",aliceblue:"#f0f8ffff",antiquewhite:"#faebd7ff",aqua:"#00ffffff",aquamarine:"#7fffd4ff",azure:"#f0ffffff",beige:"#f5f5dcff",bisque:"#ffe4c4ff",black:"#000000ff",blanchedalmond:"#ffebcdff",blue:"#0000ffff",blueviolet:"#8a2be2ff",brown:"#a52a2aff",burlywood:"#deb887ff",burntsienna:"#ea7e5dff",cadetblue:"#5f9ea0ff",chartreuse:"#7fff00ff",chocolate:"#d2691eff",coral:"#ff7f50ff",cornflowerblue:"#6495edff",cornsilk:"#fff8dcff",crimson:"#dc143cff",cyan:"#00ffffff",darkblue:"#00008bff",darkcyan:"#008b8bff",darkgoldenrod:"#b8860bff",darkgray:"#a9a9a9ff",darkgreen:"#006400ff",darkgrey:"#a9a9a9ff",darkkhaki:"#bdb76bff",darkmagenta:"#8b008bff",darkolivegreen:"#556b2fff",darkorange:"#ff8c00ff",darkorchid:"#9932ccff",darkred:"#8b0000ff",darksalmon:"#e9967aff",darkseagreen:"#8fbc8fff",darkslateblue:"#483d8bff",darkslategray:"#2f4f4fff",darkslategrey:"#2f4f4fff",darkturquoise:"#00ced1ff",darkviolet:"#9400d3ff",deeppink:"#ff1493ff",deepskyblue:"#00bfffff",dimgray:"#696969ff",dimgrey:"#696969ff",dodgerblue:"#1e90ffff",firebrick:"#b22222ff",floralwhite:"#fffaf0ff",forestgreen:"#228b22ff",fuchsia:"#ff00ffff",gainsboro:"#dcdcdcff",ghostwhite:"#f8f8ffff",gold:"#ffd700ff",goldenrod:"#daa520ff",gray:"#808080ff",green:"#008000ff",greenyellow:"#adff2fff",grey:"#808080ff",honeydew:"#f0fff0ff",hotpink:"#ff69b4ff",indianred:"#cd5c5cff",indigo:"#4b0082ff",ivory:"#fffff0ff",khaki:"#f0e68cff",lavender:"#e6e6faff",lavenderblush:"#fff0f5ff",lawngreen:"#7cfc00ff",lemonchiffon:"#fffacdff",lightblue:"#add8e6ff",lightcoral:"#f08080ff",lightcyan:"#e0ffffff",lightgoldenrodyellow:"#fafad2ff",lightgray:"#d3d3d3ff",lightgreen:"#90ee90ff",lightgrey:"#d3d3d3ff",lightpink:"#ffb6c1ff",lightsalmon:"#ffa07aff",lightseagreen:"#20b2aaff",lightskyblue:"#87cefaff",lightslategray:"#778899ff",lightslategrey:"#778899ff",lightsteelblue:"#b0c4deff",lightyellow:"#ffffe0ff",lime:"#00ff00ff",limegreen:"#32cd32ff",linen:"#faf0e6ff",magenta:"#ff00ffff",maroon:"#800000ff",mediumaquamarine:"#66cdaaff",mediumblue:"#0000cdff",mediumorchid:"#ba55d3ff",mediumpurple:"#9370dbff",mediumseagreen:"#3cb371ff",mediumslateblue:"#7b68eeff",mediumspringgreen:"#00fa9aff",mediumturquoise:"#48d1ccff",mediumvioletred:"#c71585ff",midnightblue:"#191970ff",mintcream:"#f5fffaff",mistyrose:"#ffe4e1ff",moccasin:"#ffe4b5ff",navajowhite:"#ffdeadff",navy:"#000080ff",oldlace:"#fdf5e6ff",olive:"#808000ff",olivedrab:"#6b8e23ff",orange:"#ffa500ff",orangered:"#ff4500ff",orchid:"#da70d6ff",palegoldenrod:"#eee8aaff",palegreen:"#98fb98ff",paleturquoise:"#afeeeeff",palevioletred:"#db7093ff",papayawhip:"#ffefd5ff",peachpuff:"#ffdab9ff",peru:"#cd853fff",pink:"#ffc0cbff",plum:"#dda0ddff",powderblue:"#b0e0e6ff",purple:"#800080ff",rebeccapurple:"#663399ff",red:"#ff0000ff",rosybrown:"#bc8f8fff",royalblue:"#4169e1ff",saddlebrown:"#8b4513ff",salmon:"#fa8072ff",sandybrown:"#f4a460ff",seagreen:"#2e8b57ff",seashell:"#fff5eeff",sienna:"#a0522dff",silver:"#c0c0c0ff",skyblue:"#87ceebff",slateblue:"#6a5acdff",slategray:"#708090ff",slategrey:"#708090ff",snow:"#fffafaff",springgreen:"#00ff7fff",steelblue:"#4682b4ff",tan:"#d2b48cff",teal:"#008080ff",thistle:"#d8bfd8ff",tomato:"#ff6347ff",turquoise:"#40e0d0ff",violet:"#ee82eeff",wheat:"#f5deb3ff",white:"#ffffffff",whitesmoke:"#f5f5f5ff",yellow:"#ffff00ff",yellowgreen:"#9acd32ff"};function Y(e){var t=function(e){return e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(e,t,n,i){return"#"+t+t+n+n+i+i}))}(e),n=function(e){return 7===e.length?e+"FF":e}(t),i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(n);return{r:parseInt(i[1],16),g:parseInt(i[2],16),b:parseInt(i[3],16),a:parseInt(i[4],16)/255}}function D(e){var t=e.r,n=e.g,i=e.b,r=e.a;return"#"+(256|t).toString(16).slice(1)+(256|n).toString(16).slice(1)+(256|i).toString(16).slice(1)+(255*r|256).toString(16).slice(1)}var F=function(e){return null!=e},P=function(e){return F(e)&&"object"==typeof e&&"_subscribe"in e},j=["borderImageOutset","borderImageSlice","borderImageWidth","fontWeight","lineHeight","opacity","orphans","tabSize","widows","zIndex","zoom","fillOpacity","floodOpacity","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth","animationIterationCount","boxFlex","boxFlexGroup","boxOrdinalGroup","columnCount","flex","flexGrow","flexPositive","flexShrink","flexNegative","flexOrder","gridRow","gridColumn","order","lineClamp"];var X=function(e,t,n,i){var r=c(t,4),o=r[0],a=r[1],s=r[2],f=r[3],u=e;if(u<o){if("identity"===n)return u;"clamp"===n&&(u=o)}if(u>a){if("identity"===i)return u;"clamp"===i&&(u=a)}return s===f?s:o===a?e<=o?s:f:(o===-1/0?u=-u:a===1/0?u-=o:u=(u-o)/(a-o),s===-1/0?u=-u:f===1/0?u+=s:u=u*(f-s)+s,u)},q=function(e,t,n){var i=t.length,r=[];e<t[0]?r=[t[0],t[1],n[0],n[1]]:e>t[i-1]&&(r=[t[i-2],t[i-1],n[i-2],n[i-1]]);for(var o=1;o<i;++o)if(e<=t[o]){r=[t[o-1],t[o],n[o-1],n[o]];break}return r},W=function(e,t,n,i){var r=c(t,4),o=r[0],a=r[1],s=r[2],f=r[3];if(s.length===f.length)return s.map((function(t,r){return"string"==typeof t?function(e,t){var n=c(t,4),i=n[0],r=n[1],o=n[2],a=n[3],s=Y(o),f=Y(a);return D({r:X(e,[i,r,s.r,f.r],"clamp","clamp"),g:X(e,[i,r,s.g,f.g],"clamp","clamp"),b:X(e,[i,r,s.b,f.b],"clamp","clamp"),a:X(e,[i,r,s.a,f.a],"clamp","clamp")})}(e,[o,a,t,f[r]]):X(e,[o,a,t,f[r]],n,i)}));throw new Error("Array length doesn't match")},z=function(e){return e.replace(L,"$")},U=function(e){return e.match(L).map((function(e){return-1!==e.indexOf("#")?e:Number(e)}))},B=function(e,t){return z(e).trim().replace(/\s/g,"")===z(t).trim().replace(/\s/g,"")},G=function(e){return e.replace(A,(function(e){if(-1!==e.indexOf("#"))return D(Y(e));if(Object.prototype.hasOwnProperty.call(R,e))return R[e];throw new Error("String cannot be parsed!")}))};function N(e,t,n,i){var r,o,a=null==i?void 0:i.extrapolate,s=null==i?void 0:i.extrapolateLeft,f=null==i?void 0:i.extrapolateRight,u=q(e,t,n),h="extend";void 0!==s?h=s:void 0!==a&&(h=a);var d="extend";if(void 0!==f?d=f:void 0!==a&&(d=a),n.length){if("number"==typeof n[0])return X(e,u,h,d);if(Array.isArray(n[0]))return W(e,u,h,d);var p=c(u,4),v=p[0],m=p[1],y=p[2],g=p[3],b=G(y),_=G(g),w=z(b);if(B(b,_)){var x=U(b),E=U(_),k=W(e,[v,m,x,E],h,d);try{for(var M=l(k),T=M.next();!T.done;T=M.next()){var I=T.value;w=w.replace("$",I)}}catch(e){r={error:e}}finally{try{T&&!T.done&&(o=M.return)&&o.call(M)}finally{if(r)throw r.error}}return w}throw new Error("Output range doesn't match string format!")}throw new Error("Output range cannot be Empty")}var H=function(e,t,n,i){if(P(e))return function(e,t,n,i){return a(a({},e),{isInterpolation:!0,interpolationConfig:{inputRange:t,outputRange:n,extrapolateConfig:i}})}(e,t,n,i);if("number"==typeof e)return N(e,t,n,i);throw new Error("'".concat(typeof e,"' cannot be interpolated!"))};var Z=["translate","translateX","translateY","translateZ","scale","scaleX","scaleY","scaleZ","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"];function $(e){var t=e.match(/(-)?(\d+.)?\d+/g),n=e.match(/px|rem|em|ex|%|cm|mm|in|pt|pc|ch|vh|vw|vmin|vmax/);return{value:Number(t),unit:n&&n[0]}}function J(e,t){var n=function(e,t){var n,i=$(String(t)).value,r=$(String(t)).unit;return r?{value:i,unit:r}:(e.includes("translate")||e.includes("perspective")?n="px":e.includes("scale")?n="":(e.includes("rotate")||e.includes("skew"))&&(n="deg"),{value:t,unit:n})}(e,t);if(e.includes("X")||e.includes("Y")||e.includes("Z")||e.includes("rotate")||e.includes("skew")||e.includes("scale"))return"".concat(e,"(").concat(n.value).concat(n.unit,")");if(e.includes("translate")||e.indexOf("scale"))return"".concat(e,"(").concat(n.value).concat(n.unit,", ").concat(n.value).concat(n.unit,")");throw new Error("Error! Property '".concat(e,"' cannot be transformed"))}function K(t){return e.forwardRef((function(n,i){var r=e.useRef(null),o=e.useRef({}),f=e.useMemo((function(){var e=n.style,t=s(n,["style"]),i=ee("style",e),r=ee("props",t);return{fluids:h(h([],c(i.fluids),!1),c(r.fluids),!1),nonFluids:h(h([],c(i.nonFluids),!1),c(r.nonFluids),!1)}}),[n]),u=f.fluids,l=f.nonFluids,d=function(e){var t,n=e.isTransform,i=e.propertyType,a=e.property,s=e.value;r.current&&("style"===i?n?(o.current[a]=s,r.current.style.transform=(t=o.current,Object.entries(t).map((function(e){var t=c(e,2);return J(t[0],t[1])})).reduce((function(e,t){return e+" ".concat(t)}),"").trim())):r.current.style[a]=function(e,t){return"number"==typeof t?j.includes(e)?t:t+"px":t}(a,s):"props"===i&&r.current.setAttribute(a.replace(/([A-Z])/g,(function(e){return"-"+e.toLowerCase()})),s))};return e.useLayoutEffect((function(){l.forEach((function(e){var t=e.isTransform,n=e.property,i=e.propertyType,r=e.value;return d({isTransform:t,property:n,propertyType:i,value:r})}))}),[l]),e.useLayoutEffect((function(){var e=[];return u.forEach((function(t){var n,i=t.value,r=t.propertyType,o=t.property,s=t.isTransform,f=i._subscribe,u=i._value,l=i._currentValue,c=i._config,h=[],p=(n=c,function(e,t){var i=a(a({},n),t);return new(F(null==i?void 0:i.duration)||(null==i?void 0:i.immediate)?S:m)({initialPosition:e,config:i})}),v=null,y=function(e){l.current=e;var t=i.isInterpolation&&i.interpolationConfig?N(e,i.interpolationConfig.inputRange,i.interpolationConfig.outputRange,i.interpolationConfig.extrapolateConfig):e;d({isTransform:s,propertyType:r,property:o,value:t})};v=p("string"==typeof u?0:u),d({isTransform:s,propertyType:r,property:o,value:u});var g=f((function(e,t){var n=e.toValue,a=e.config;if(function(e,t){if(typeof e!=typeof t)return!1;if("number"==typeof t)return!0;if("string"==typeof e){var n=G(e),i=G(t);return n!==i&&z(n)===z(i)}return!1}(u,n)){var f=v;f._value!==n&&(v.stop(),v=p(f._position,a),(null==a?void 0:a.onStart)&&a.onStart(f._position),"string"==typeof n&&(h.includes(u)||h.push(u),h.includes(n)||h.push(n),i.isInterpolation=!0,i.interpolationConfig={inputRange:h.map((function(e,t){return t})),outputRange:h}),v.start({toValue:"string"==typeof n?h.indexOf(n):n,onFrame:y,previousAnimation:f,onEnd:t}))}else{if(typeof n!=typeof u)throw new Error("Cannot assign ".concat(typeof n," to animated ").concat(typeof u));d({isTransform:s,propertyType:r,property:o,value:n})}}),o,Date.now());e.push(g)})),function(){e.forEach((function(e){return e()}))}}),[]),e.createElement(t,a(a({},function(e){e.style;var t=s(e,["style"]);return Object.fromEntries(Object.entries(t).filter((function(e){var t=c(e,2);t[0];var n=t[1];return!P(n)})))}(n)),{ref:Q(r,i)}))}))}function Q(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){e.forEach((function(e){e&&("function"!=typeof e?"current"in e&&(e.current=t):e(t))}))}}function ee(e,t){return void 0===t&&(t={}),Object.entries(t).reduce((function(t,n){var i,r=c(n,2),o=r[0],a=r[1],s="style"===e&&(i=o,Z.includes(i));return P(a)?t.fluids.push({isTransform:s,property:o,propertyType:e,value:a}):t.nonFluids.push({isTransform:s,property:o,propertyType:e,value:a}),t}),{fluids:[],nonFluids:[]})}var te={};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noindex","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","small","source","span","strong","style","sub","summary","sup","table","template","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","svg","animate","animateMotion","animateTransform","circle","clipPath","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","foreignObject","g","image","line","linearGradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","switch","symbol","text","textPath","tspan","use","view"].forEach((function(e){te[e]=K(e)}));var ne=function(){function e(e,t){var n=this;this._subscriptions=new Map,this._subscribe=function(e,t,i){return n._subscriptions.set({uuid:i,property:t},e),function(){var e,t;try{for(var i=l(n._subscriptions.keys()),r=i.next();!r.done;r=i.next()){var o=r.value;n._subscriptions.delete(o)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}}},this._value=e,this._currentValue={current:e},this._config=t,this.get=function(){return n._currentValue.current}}return e.prototype.setValue=function(e,t){var n,i,r=this;if("function"!=typeof e)try{for(var o=l(this._subscriptions.keys()),a=o.next();!a.done;a=o.next()){var s=a.value,f=this._subscriptions.get(s);f&&f(e,t)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}else e((function(e){var n=new Promise((function(n){var i,o;try{for(var a=l(r._subscriptions.keys()),s=a.next();!s.done;s=a.next()){var f=s.value,u=r._subscriptions.get(f);u&&u(e,(function(i){i.finished&&n(e),t&&t(i)}))}}catch(e){i={error:e}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}}));return n}))},e}(),ie=function(t,n){var i=e.useRef(new ne(t,n)).current;return e.useLayoutEffect((function(){i.setValue({toValue:t,config:n})}),[t]),[i,i.setValue.bind(i)]};function re(e){if(!F(e)||"number"!=typeof e&&!P(e))throw console.log(e),new Error("Invalid ".concat(e," type for interpolate function. Expected number or FluidValue."));return e}var oe=K("div"),ae=K("span"),se=K("img");function fe(t,n){var i=function(t,n){var i=c(e.useState(!1),2),r=i[0],o=i[1],a=e.useRef(n).current,s=a.from,f=a.enter,u=a.exit,l=a.config,h=a.enterConfig,d=a.exitConfig,p=c(ie(s,l),2),v=p[0],m=p[1];return e.useLayoutEffect((function(){t?(o(!0),queueMicrotask((function(){return m({toValue:f,config:h})}))):m({toValue:u,config:d},(function(e){e.finished&&o(!1)}))}),[t]),function(e){return e(v,r)}}(t,n);return function(e){return i((function(t,n){return e({value:t},n)}))}}var ue=function(e){switch(e){case"elastic":return{mass:1,friction:18,tension:250};case"stiff":return{mass:1,friction:18,tension:350};case"wooble":return{mass:1,friction:8,tension:250};case"bounce":return{duration:500,easing:C.bounce};case"power1":return{duration:500,easing:C.bezier(.17,.42,.51,.97)};case"power2":return{duration:500,easing:C.bezier(.07,.11,.13,1)};case"power3":return{duration:500,easing:C.bezier(.09,.7,.16,1.04)};case"power4":return{duration:500,easing:C.bezier(.05,.54,0,1.03)};case"linear":return{duration:500,easing:C.linear};case"easein":return{duration:500,easing:C.in(C.ease)};case"easeout":return{duration:500,easing:C.out(C.ease)};case"easeinout":return{duration:500,easing:C.inOut(C.ease)};default:return{mass:1,friction:34,tension:290}}},le={ELASTIC:ue("elastic"),BOUNCE:ue("bounce"),EASE:ue("ease"),STIFF:ue("stiff"),WOOBLE:ue("wooble"),EASE_IN:ue("easein"),EASE_OUT:ue("easeout"),EASE_IN_OUT:ue("easeinout"),POWER1:ue("power1"),POWER2:ue("power2"),POWER3:ue("power3"),POWER4:ue("power4"),LINEAR:ue("linear")};function ce(e,t){var n=c(ie(e,a(a({},le.EASE),t)),2),i=n[0],r=n[1],o={value:i,currentValue:i.get()};return new Proxy(o,{set:function(e,t,n){if("value"===t)return"number"==typeof n||"string"==typeof n?r({toValue:n}):"object"!=typeof n&&"function"!=typeof n||r(n),!0;throw new Error("You cannot set any other property to animation node.")},get:function(e,t){if("value"===t)return i;if("currentValue"===t)return i.get();throw new Error("You cannot access any other property from animation node.")}})}function he(e){return e?1:0}function de(e,t,n){return Math.min(Math.max(e,t),n)}function pe(e,t,n){return 0===t||Math.abs(t)===1/0?function(e,t){return Math.pow(e,5*t)}(e,n):e*t*n/(t+n*e)}function ve(e,t){var n=new Map;return t.forEach((function(t){var i=c(t,3),r=i[0],o=i[1],a=i[2],s=void 0!==a&&a;n.set(r,function(e,t,n,i){return void 0===i&&(i=!1),e.forEach((function(e){e.addEventListener(t,n,i)})),function(){e.forEach((function(e){e.removeEventListener(t,n,i)}))}}(e,r,o,s))})),function(e){var t,i;try{for(var r=l(n.entries()),o=r.next();!o.done;o=r.next()){var a=c(o.value,2),s=a[0],f=a[1];if(!e)return void f();-1!==e.indexOf(s)&&f()}}catch(e){t={error:e}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}}}var me=function(e,t){return{x:e,y:t}},ye=function(){function e(){this.lastTimeStamp=Date.now(),this.isActive=!1,this.targetElements=[]}return e.prototype._initEvents=function(){},e.prototype._cancelEvents=function(){this._subscribe&&this._subscribe()},e.prototype.applyCallback=function(e){this.callback=e},e.prototype.applyGesture=function(e){var t=this,n=e.targetElement,i=e.targetElements,r=e.callback,o=e.config;return this.targetElement=n,this.targetElements=i.map((function(e){return e.current})),this.callback=r,this.config=o,this._initEvents(),function(){return t._subscribe&&t._subscribe()}},e._VELOCITY_LIMIT=20,e}(),ge=function(e){function t(){var t=e.apply(this,h([],c(arguments),!1))||this;return t.movementStart=me(0,0),t.initialMovement=me(0,0),t.movement=me(0,0),t.previousMovement=me(0,0),t.translation=me(0,0),t.offset=me(0,0),t.velocity=me(0,0),t}return o(t,e),t.prototype._initEvents=function(){(this.targetElement||this.targetElements.length>0)&&(this._subscribe=ve([window],[["mousedown",this.pointerDown.bind(this)],["mousemove",this.pointerMove.bind(this)],["mouseup",this.pointerUp.bind(this)],["touchstart",this.pointerDown.bind(this),{passive:!1}],["touchmove",this.pointerMove.bind(this),{passive:!1}],["touchend",this.pointerUp.bind(this)]]))},t.prototype._cancelEvents=function(){this._subscribe&&this._subscribe(["mousedown","mousemove","touchstart","touchmove"])},t.prototype._handleCallback=function(){var e=this;this.callback&&this.callback({args:[this.currentIndex],down:this.isActive,movementX:this.movement.x,movementY:this.movement.y,offsetX:this.translation.x,offsetY:this.translation.y,velocityX:this.velocity.x,velocityY:this.velocity.y,distanceX:Math.abs(this.movement.x),distanceY:Math.abs(this.movement.y),directionX:Math.sign(this.movement.x),directionY:Math.sign(this.movement.y),cancel:function(){e._cancelEvents()}})},t.prototype.pointerDown=function(e){var t;"touchstart"===e.type?this.movementStart={x:e.touches[0].clientX,y:e.touches[0].clientY}:this.movementStart={x:e.clientX,y:e.clientY},this.movement={x:0,y:0},this.offset={x:this.translation.x,y:this.translation.y},this.previousMovement={x:0,y:0},this.velocity={x:0,y:0};var n=this.targetElements.find((function(t){return t===e.target}));if(e.target===this.targetElement||n){this.isActive=!0,e.preventDefault(),n&&(this.currentIndex=this.targetElements.indexOf(n));var i=(null===(t=this.config)||void 0===t?void 0:t.initial)&&this.config.initial(),r=null==i?void 0:i.movementX,o=null==i?void 0:i.movementY;this.initialMovement={x:null!=r?r:0,y:null!=o?o:0},this.movement={x:this.initialMovement.x,y:this.initialMovement.y},this.previousMovement={x:this.initialMovement.x,y:this.initialMovement.y},this._handleCallback()}},t.prototype.pointerMove=function(e){if(this.isActive){e.preventDefault();var t=Date.now(),n=de(t-this.lastTimeStamp,.1,64);this.lastTimeStamp=t;var i=n/1e3;"touchmove"===e.type?this.movement={x:this.initialMovement.x+(e.touches[0].clientX-this.movementStart.x),y:this.initialMovement.y+(e.touches[0].clientY-this.movementStart.y)}:this.movement={x:this.initialMovement.x+(e.clientX-this.movementStart.x),y:this.initialMovement.y+(e.clientY-this.movementStart.y)},this.translation={x:this.offset.x+this.movement.x,y:this.offset.y+this.movement.y},this.velocity={x:de((this.movement.x-this.previousMovement.x)/i/1e3,-1*ye._VELOCITY_LIMIT,ye._VELOCITY_LIMIT),y:de((this.movement.y-this.previousMovement.y)/i/1e3,-1*ye._VELOCITY_LIMIT,ye._VELOCITY_LIMIT)},this.previousMovement={x:this.movement.x,y:this.movement.y},this._handleCallback()}},t.prototype.pointerUp=function(){this.isActive&&(this.isActive=!1,this._handleCallback(),this._cancelEvents(),this._initEvents())},t}(ye),be=function(e){function t(){var t=e.apply(this,h([],c(arguments),!1))||this;return t.movement=me(0,0),t.previousMovement=me(0,0),t.velocity=me(0,0),t.direction=me(0,0),t}return o(t,e),t.prototype._initEvents=function(){this.targetElement?this._subscribe=ve([this.targetElement],[["mousemove",this.onMouseMove.bind(this)]]):this.targetElements.length>0?this._subscribe=ve(this.targetElements,[["mousemove",this.onMouseMove.bind(this)]]):this._subscribe=ve([window],[["mousemove",this.onMouseMove.bind(this)]])},t.prototype._handleCallback=function(){var e;this.callback&&this.callback({args:[this.currentIndex],event:this.event,isMoving:this.isActive,target:null===(e=this.event)||void 0===e?void 0:e.target,mouseX:this.movement.x,mouseY:this.movement.y,velocityX:this.velocity.x,velocityY:this.velocity.y,directionX:this.direction.x,directionY:this.direction.y})},t.prototype.onMouseMove=function(e){var t=this,n=this.targetElements.find((function(t){return t===e.target}));n&&(this.currentIndex=this.targetElements.indexOf(n)),this.event=e;var i=Date.now(),r=Math.min(i-this.lastTimeStamp,64);this.lastTimeStamp=i;var o=r/1e3,a=e.clientX,s=e.clientY;this.movement={x:a,y:s},-1!==this.isActiveID&&(this.isActive=!0,clearTimeout(this.isActiveID)),this.isActiveID=setTimeout((function(){t.isActive=!1,t.direction={x:0,y:0},t.velocity={x:0,y:0},t._handleCallback()}),250);var f=this.movement.x-this.previousMovement.x,u=this.movement.y-this.previousMovement.y;this.direction={x:Math.sign(f),y:Math.sign(u)},this.velocity={x:de(f/o/1e3,-1*ye._VELOCITY_LIMIT,ye._VELOCITY_LIMIT),y:de(u/o/1e3,-1*ye._VELOCITY_LIMIT,ye._VELOCITY_LIMIT)},this.previousMovement={x:this.movement.x,y:this.movement.y},this._handleCallback()},t}(ye),_e=function(e){function t(){var t=e.apply(this,h([],c(arguments),!1))||this;return t.movement=me(0,0),t.previousMovement=me(0,0),t.direction=me(0,0),t.velocity=me(0,0),t}return o(t,e),t.prototype._initEvents=function(){this.targetElement?this._subscribe=ve([this.targetElement],[["scroll",this.scrollElementListener.bind(this)]]):this._subscribe=ve([window],[["scroll",this.scrollListener.bind(this)]])},t.prototype._handleCallback=function(){this.callback&&this.callback({isScrolling:this.isActive,scrollX:this.movement.x,scrollY:this.movement.y,velocityX:this.velocity.x,velocityY:this.velocity.y,directionX:this.direction.x,directionY:this.direction.y})},t.prototype.onScroll=function(e){var t=this,n=e.x,i=e.y,r=Date.now(),o=Math.min(r-this.lastTimeStamp,64);this.lastTimeStamp=r;var a=o/1e3;this.movement={x:n,y:i},-1!==this.isActiveID&&(this.isActive=!0,clearTimeout(this.isActiveID)),this.isActiveID=setTimeout((function(){t.isActive=!1,t.direction={x:0,y:0},t.velocity={x:0,y:0},t._handleCallback()}),250);var s=this.movement.x-this.previousMovement.x,f=this.movement.y-this.previousMovement.y;this.direction={x:Math.sign(s),y:Math.sign(f)},this.velocity={x:de(s/a/1e3,-1*ye._VELOCITY_LIMIT,ye._VELOCITY_LIMIT),y:de(f/a/1e3,-1*ye._VELOCITY_LIMIT,ye._VELOCITY_LIMIT)},this.previousMovement={x:this.movement.x,y:this.movement.y},this._handleCallback()},t.prototype.scrollListener=function(){var e=window.pageYOffset,t=window.pageXOffset;this.onScroll({x:t,y:e})},t.prototype.scrollElementListener=function(){var e,t,n=(null===(e=this.targetElement)||void 0===e?void 0:e.scrollLeft)||0,i=(null===(t=this.targetElement)||void 0===t?void 0:t.scrollTop)||0;this.onScroll({x:n,y:i})},t}(ye),we=function(e){function t(){var t=e.apply(this,h([],c(arguments),!1))||this;return t.movement=me(0,0),t.previousMovement=me(0,0),t.direction=me(0,0),t.velocity=me(0,0),t.delta=me(0,0),t.offset=me(0,0),t.translation=me(0,0),t}return o(t,e),t.prototype._initEvents=function(){this.targetElement&&(this._subscribe=ve([this.targetElement],[["wheel",this.onWheel.bind(this)]]))},t.prototype._handleCallback=function(){this.callback&&this.callback({target:this.targetElement,isWheeling:this.isActive,deltaX:this.delta.x,deltaY:this.delta.y,directionX:this.direction.x,directionY:this.direction.y,movementX:this.movement.x,movementY:this.movement.y,offsetX:this.offset.x,offsetY:this.offset.y,velocityX:this.velocity.x,velocityY:this.velocity.y})},t.prototype.onWheel=function(e){var t=this,n=e.deltaX,i=e.deltaY,r=e.deltaMode,o=Date.now(),a=Math.min(o-this.lastTimeStamp,64);this.lastTimeStamp=o;var s=a/1e3;this.isActive=!0,-1!==this.isActiveID&&(this.isActive=!0,clearTimeout(this.isActiveID)),this.isActiveID=setTimeout((function(){t.isActive=!1,t.translation={x:t.offset.x,y:t.offset.y},t._handleCallback(),t.velocity={x:0,y:0},t.movement={x:0,y:0}}),200),1===r?(n*=40,i*=40):2===r&&(n*=800,i*=800),this.delta={x:n,y:i},this.movement={x:this.movement.x+n,y:this.movement.y+i},this.offset={x:this.translation.x+this.movement.x,y:this.translation.y+this.movement.y};var f=this.movement.x-this.previousMovement.x,u=this.movement.y-this.previousMovement.y;this.direction={x:Math.sign(f),y:Math.sign(u)},this.velocity={x:de(f/s/1e3,-1*ye._VELOCITY_LIMIT,ye._VELOCITY_LIMIT),y:de(u/s/1e3,-1*ye._VELOCITY_LIMIT,ye._VELOCITY_LIMIT)},this.previousMovement={x:this.movement.x,y:this.movement.y},this._handleCallback()},t}(ye),xe=function(e){var t=i.useRef(),n=i.useRef([]),r=i.useRef(new Map).current;return i.useEffect((function(){var t,n;try{for(var i=l(r.entries()),o=i.next();!o.done;o=i.next()){var a=c(o.value,2)[1],s=a.keyIndex,f=a.gesture,u=c(e[s],3)[2];f.applyCallback(u)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}}),[e]),i.useEffect((function(){return e.forEach((function(e,i){var o=c(e,4),a=o[0],s=o[1],f=o[2],u=o[3];r.set(a,{keyIndex:i,gesture:s,unsubscribe:s.applyGesture({targetElement:t.current,targetElements:n.current,callback:f,config:u})})})),function(){var e,t;try{for(var n=l(r.entries()),i=n.next();!i.done;i=n.next()){var o=c(i.value,2)[1].unsubscribe;o&&o()}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}}}),[]),function(e){return null==e?{ref:t}:(n.current[e]=n.current[e]||i.createRef(),{ref:n.current[e]})}};exports.AnimatedBlock=oe,exports.AnimatedImage=se,exports.AnimatedInline=ae,exports.AnimationConfigUtils=le,exports.Easing=C,exports.MountedBlock=function(e){var n=e.state,i=e.children,r=e.from,o=void 0===r?0:r,a=e.enter,s=void 0===a?1:a,f=e.exit,u=fe(n,{from:o,enter:s,exit:void 0===f?0:f,config:e.config,enterConfig:e.enterConfig,exitConfig:e.exitConfig});return t.jsx(t.Fragment,{children:u((function(e,t){return t&&i({value:e.value})}))})},exports.ScrollableBlock=function(e){var n=e.children,r=e.direction,o=void 0===r?"single":r,a=e.animationConfig,s=e.threshold,f=void 0===s?.2:s,u=i.useRef(null),l=ce(0,a);return i.useEffect((function(){var e=u.current,t=new IntersectionObserver((function(e){c(e,1)[0].isIntersecting?l.value=1:"both"===o&&(l.value=0)}),{root:null,threshold:f});return e&&t.observe(e),function(){e&&t.unobserve(e)}}),[]),t.jsx("div",{ref:u,children:n&&n({value:l.value})})},exports.TransitionBlock=function(e){var n=e.state,i=e.children,r=e.config,o=ce(he(n),r);return t.jsx(t.Fragment,{children:i({value:o.value})})},exports.bInterpolate=function(e,t,n,i){var r=re(e);return H(r,[0,1],[t,n],i)},exports.bin=he,exports.clamp=de,exports.delay=function(e){return new Promise((function(t){setTimeout((function(){return t(null)}),e)}))},exports.fluid=te,exports.interpolate=function(e,t,n,i){var r=re(e);return H(r,t,n,i)},exports.makeFluid=K,exports.mix=function(e,t,n){return t*(1-e)+n*e},exports.move=function(e,t,n){var i=e[t],r=e.length,o=t-n;if(o>0)return h(h(h(h([],c(e.slice(0,n)),!1),[i],!1),c(e.slice(n,t)),!1),c(e.slice(t+1,r)),!1);if(o<0){var a=n+1;return h(h(h(h([],c(e.slice(0,t)),!1),c(e.slice(t+1,a)),!1),[i],!1),c(e.slice(a,r)),!1)}return e},exports.rubberClamp=function(e,t,n,i){return void 0===i&&(i=.15),0===i?de(e,t,n):e<t?-pe(t-e,n-t,i)+t:e>n?+pe(e-n,n-t,i)+n:e},exports.snapTo=function(e,t,n){var i=e+.2*t,r=function(e){return Math.abs(e-i)},o=n.map(r),a=Math.min.apply(Math,h([],c(o),!1));return n.reduce((function(e,t){return r(t)===a?t:e}))},exports.useAnimatedValue=ce,exports.useDrag=function(e,t){var n=i.useRef(new ge).current;return xe([["drag",n,e,t]])},exports.useGesture=function(e){var t=e.onDrag,n=e.onWheel,r=e.onScroll,o=e.onMouseMove,a=i.useRef(new ge).current,s=i.useRef(new we).current,f=i.useRef(new _e).current,u=i.useRef(new be).current;return xe([["drag",a,t],["wheel",s,n],["scroll",f,r],["move",u,o]])},exports.useMeasure=function(t,n){var i=e.useRef(null),r=e.useRef([]),o=e.useRef(t);return e.useEffect((function(){return o.current=t,function(){o.current=function(){return!1}}}),n),e.useEffect((function(){var e=i.current||document.documentElement,t=r.current,n=new ResizeObserver((function(t){var n=c(t,1)[0].target.getBoundingClientRect(),i=n.left,r=n.top,a=n.width,s=n.height,f=window.pageXOffset,u=window.pageYOffset;if(o){if(e===document.documentElement)return;o.current({left:i+f,top:r+u,width:a,height:s,vLeft:i,vTop:r})}})),a=new ResizeObserver((function(e){var t=[],n=[],i=[],r=[],a=[],s=[];e.forEach((function(e){var o=e.target.getBoundingClientRect(),f=o.left,u=o.top,l=o.width,c=o.height,h=f+window.pageXOffset,d=u+window.pageYOffset;t.push(h),n.push(d),i.push(l),r.push(c),a.push(f),s.push(u)})),o&&o.current({left:t,top:n,width:i,height:r,vLeft:a,vTop:s})}));return e&&(e===document.documentElement&&t.length>0?t.forEach((function(e){a.observe(e.current)})):n.observe(e)),function(){e&&(e===document.documentElement&&t.length>0?t.forEach((function(e){a.unobserve(e.current)})):n.unobserve(e))}}),[]),function(t){return null==t?{ref:i}:(r.current[t]=r.current[t]||e.createRef(),{ref:r.current[t]})}},exports.useMountedValue=fe,exports.useMouseMove=function(e){var t=i.useRef(new be).current;return xe([["move",t,e]])},exports.useOutsideClick=function(t,n,i){var r=e.useRef();r.current||(r.current=n),e.useEffect((function(){return r.current=n,function(){r.current=function(){return!1}}}),i),e.useEffect((function(){var e=ve([document],[["click",function(e){var n;(null===(n=null==t?void 0:t.current)||void 0===n?void 0:n.contains(e.target))||r.current&&r.current(e)}]]);return function(){return e&&e()}}),[])},exports.useScroll=function(e){var t=i.useRef(new _e).current;return xe([["scroll",t,e]])},exports.useWheel=function(e){var t=i.useRef(new we).current;return xe([["wheel",t,e]])},exports.useWindowDimension=function(t,n){var i=e.useRef({width:0,height:0,innerWidth:0,innerHeight:0}),r=e.useRef(t);e.useEffect((function(){return r.current=t,function(){r.current=function(){return!1}}}),n),e.useEffect((function(){var e=new ResizeObserver((function(e){var t=c(e,1)[0].target,n=t.clientWidth,o=t.clientHeight,s=window.innerWidth,f=window.innerHeight;i.current={width:n,height:o,innerWidth:s,innerHeight:f},r&&r.current(a({},i.current))}));return e.observe(document.documentElement),function(){return e.unobserve(document.documentElement)}}),[])},exports.withDelay=function(e,t){return a(a({},t),{config:a(a({},t.config),{delay:e})})},exports.withSequence=function(e){var t=c(e).slice(0);return function(e){return f(void 0,void 0,void 0,(function(){var n,i,r,o,a,s;return u(this,(function(f){switch(f.label){case 0:f.trys.push([0,5,6,7]),n=l(t),i=n.next(),f.label=1;case 1:return i.done?[3,4]:(r=i.value,[4,e(r)]);case 2:f.sent(),f.label=3;case 3:return i=n.next(),[3,1];case 4:return[3,7];case 5:return o=f.sent(),a={error:o},[3,7];case 6:try{i&&!i.done&&(s=n.return)&&s.call(n)}finally{if(a)throw a.error}return[7];case 7:return[2]}}))}))}},exports.withSpring=function(e,t){return void 0===t&&(t=le.ELASTIC),{toValue:e,config:t}},exports.withTiming=function(e,t){return void 0===t&&(t={duration:250}),{toValue:e,config:t}};
|
|
1
|
+
var t=require("@raidipesh78/re-motion"),e=require("react/jsx-runtime"),n=require("react");function i(t){var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var r=i(n),o=function(t){return null!=t};function s(e){if(!o(e)||"number"!=typeof e&&!t.isFluidValue(e))throw console.log(e),new Error("Invalid ".concat(e," type for interpolate function. Expected number or FluidValue."));return e}var u=t.makeFluid("div"),a=t.makeFluid("span"),c=t.makeFluid("img");function l(e,n){var i=t.useMount(e,n);return function(t){return i((function(e,n){return t({value:e},n)}))}}var h=function(t,e){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},h(t,e)};function f(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}h(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var v=function(){return v=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},v.apply(this,arguments)};function m(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{a(i.next(t))}catch(t){o(t)}}function u(t){try{a(i.throw(t))}catch(t){o(t)}}function a(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,u)}a((i=i.apply(t,e||[])).next())}))}function p(t,e){var n,i,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(u){return function(a){return function(u){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(s=0)),s;)try{if(n=1,i&&(r=2&u[0]?i.return:u[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,u[1])).done)return r;switch(i=0,r&&(u=[2&u[0],r.value]),u[0]){case 0:case 1:r=u;break;case 4:return s.label++,{value:u[1],done:!1};case 5:s.label++,i=u[1],u=[0];continue;case 7:u=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==u[0]&&2!==u[0])){s=0;continue}if(3===u[0]&&(!r||u[1]>r[0]&&u[1]<r[3])){s.label=u[1];break}if(6===u[0]&&s.label<r[1]){s.label=r[1],r=u;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(u);break}r[2]&&s.ops.pop(),s.trys.pop();continue}u=e.call(t,s)}catch(t){u=[6,t],i=0}finally{n=r=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}}function y(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],i=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function d(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,r,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)s.push(i.value)}catch(t){r={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return s}function x(t,e,n){if(n||2===arguments.length)for(var i,r=0,o=e.length;r<o;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var g=function(e){switch(e){case"elastic":return{mass:1,friction:18,tension:250};case"stiff":return{mass:1,friction:18,tension:350};case"wooble":return{mass:1,friction:8,tension:250};case"bounce":return{duration:500,easing:t.Easing.bounce};case"power1":return{duration:500,easing:t.Easing.bezier(.17,.42,.51,.97)};case"power2":return{duration:500,easing:t.Easing.bezier(.07,.11,.13,1)};case"power3":return{duration:500,easing:t.Easing.bezier(.09,.7,.16,1.04)};case"power4":return{duration:500,easing:t.Easing.bezier(.05,.54,0,1.03)};case"linear":return{duration:500,easing:t.Easing.linear};case"easein":return{duration:500,easing:t.Easing.in(t.Easing.ease)};case"easeout":return{duration:500,easing:t.Easing.out(t.Easing.ease)};case"easeinout":return{duration:500,easing:t.Easing.inOut(t.Easing.ease)};default:return{mass:1,friction:34,tension:290}}},b={ELASTIC:g("elastic"),BOUNCE:g("bounce"),EASE:g("ease"),STIFF:g("stiff"),WOOBLE:g("wooble"),EASE_IN:g("easein"),EASE_OUT:g("easeout"),EASE_IN_OUT:g("easeinout"),POWER1:g("power1"),POWER2:g("power2"),POWER3:g("power3"),POWER4:g("power4"),LINEAR:g("linear")};function E(e,n){var i=d(t.useFluidValue(e,v(v({},b.EASE),n)),2),r=i[0],o=i[1],s={value:r,currentValue:r.get()};return new Proxy(s,{set:function(t,e,n){if("value"===e)return"number"==typeof n||"string"==typeof n?o({toValue:n}):"object"!=typeof n&&"function"!=typeof n||o(n),!0;throw new Error("You cannot set any other property to animation node.")},get:function(t,e){if("value"===e)return r;if("currentValue"===e)return r.get();throw new Error("You cannot access any other property from animation node.")}})}function w(t){return t?1:0}function M(t,e,n){return Math.min(Math.max(t,e),n)}function _(t,e,n){return 0===e||Math.abs(e)===1/0?function(t,e){return Math.pow(t,5*e)}(t,n):t*e*n/(e+n*t)}function I(t,e){var n=new Map;return e.forEach((function(e){var i=d(e,3),r=i[0],o=i[1],s=i[2],u=void 0!==s&&s;n.set(r,function(t,e,n,i){return void 0===i&&(i=!1),t.forEach((function(t){t.addEventListener(e,n,i)})),function(){t.forEach((function(t){t.removeEventListener(e,n,i)}))}}(t,r,o,u))})),function(t){var e,i;try{for(var r=y(n.entries()),o=r.next();!o.done;o=r.next()){var s=d(o.value,2),u=s[0],a=s[1];if(!t)return void a();-1!==t.indexOf(u)&&a()}}catch(t){e={error:t}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(e)throw e.error}}}}var T=function(t,e){return{x:t,y:e}},O=function(){function t(){this.lastTimeStamp=Date.now(),this.isActive=!1,this.targetElements=[]}return t.prototype._initEvents=function(){},t.prototype._cancelEvents=function(){this._subscribe&&this._subscribe()},t.prototype.applyCallback=function(t){this.callback=t},t.prototype.applyGesture=function(t){var e=this,n=t.targetElement,i=t.targetElements,r=t.callback,o=t.config;return this.targetElement=n,this.targetElements=i.map((function(t){return t.current})),this.callback=r,this.config=o,this._initEvents(),function(){return e._subscribe&&e._subscribe()}},t._VELOCITY_LIMIT=20,t}(),L=function(t){function e(){var e=t.apply(this,x([],d(arguments),!1))||this;return e.movementStart=T(0,0),e.initialMovement=T(0,0),e.movement=T(0,0),e.previousMovement=T(0,0),e.translation=T(0,0),e.offset=T(0,0),e.velocity=T(0,0),e}return f(e,t),e.prototype._initEvents=function(){(this.targetElement||this.targetElements.length>0)&&(this._subscribe=I([window],[["mousedown",this.pointerDown.bind(this)],["mousemove",this.pointerMove.bind(this)],["mouseup",this.pointerUp.bind(this)],["touchstart",this.pointerDown.bind(this),{passive:!1}],["touchmove",this.pointerMove.bind(this),{passive:!1}],["touchend",this.pointerUp.bind(this)]]))},e.prototype._cancelEvents=function(){this._subscribe&&this._subscribe(["mousedown","mousemove","touchstart","touchmove"])},e.prototype._handleCallback=function(){var t=this;this.callback&&this.callback({args:[this.currentIndex],down:this.isActive,movementX:this.movement.x,movementY:this.movement.y,offsetX:this.translation.x,offsetY:this.translation.y,velocityX:this.velocity.x,velocityY:this.velocity.y,distanceX:Math.abs(this.movement.x),distanceY:Math.abs(this.movement.y),directionX:Math.sign(this.movement.x),directionY:Math.sign(this.movement.y),cancel:function(){t._cancelEvents()}})},e.prototype.pointerDown=function(t){var e;"touchstart"===t.type?this.movementStart={x:t.touches[0].clientX,y:t.touches[0].clientY}:this.movementStart={x:t.clientX,y:t.clientY},this.movement={x:0,y:0},this.offset={x:this.translation.x,y:this.translation.y},this.previousMovement={x:0,y:0},this.velocity={x:0,y:0};var n=this.targetElements.find((function(e){return e===t.target}));if(t.target===this.targetElement||n){this.isActive=!0,t.preventDefault(),n&&(this.currentIndex=this.targetElements.indexOf(n));var i=(null===(e=this.config)||void 0===e?void 0:e.initial)&&this.config.initial(),r=null==i?void 0:i.movementX,o=null==i?void 0:i.movementY;this.initialMovement={x:null!=r?r:0,y:null!=o?o:0},this.movement={x:this.initialMovement.x,y:this.initialMovement.y},this.previousMovement={x:this.initialMovement.x,y:this.initialMovement.y},this._handleCallback()}},e.prototype.pointerMove=function(t){if(this.isActive){t.preventDefault();var e=Date.now(),n=M(e-this.lastTimeStamp,.1,64);this.lastTimeStamp=e;var i=n/1e3;"touchmove"===t.type?this.movement={x:this.initialMovement.x+(t.touches[0].clientX-this.movementStart.x),y:this.initialMovement.y+(t.touches[0].clientY-this.movementStart.y)}:this.movement={x:this.initialMovement.x+(t.clientX-this.movementStart.x),y:this.initialMovement.y+(t.clientY-this.movementStart.y)},this.translation={x:this.offset.x+this.movement.x,y:this.offset.y+this.movement.y},this.velocity={x:M((this.movement.x-this.previousMovement.x)/i/1e3,-1*O._VELOCITY_LIMIT,O._VELOCITY_LIMIT),y:M((this.movement.y-this.previousMovement.y)/i/1e3,-1*O._VELOCITY_LIMIT,O._VELOCITY_LIMIT)},this.previousMovement={x:this.movement.x,y:this.movement.y},this._handleCallback()}},e.prototype.pointerUp=function(){this.isActive&&(this.isActive=!1,this._handleCallback(),this._cancelEvents(),this._initEvents())},e}(O),C=function(t){function e(){var e=t.apply(this,x([],d(arguments),!1))||this;return e.movement=T(0,0),e.previousMovement=T(0,0),e.velocity=T(0,0),e.direction=T(0,0),e}return f(e,t),e.prototype._initEvents=function(){this.targetElement?this._subscribe=I([this.targetElement],[["mousemove",this.onMouseMove.bind(this)]]):this.targetElements.length>0?this._subscribe=I(this.targetElements,[["mousemove",this.onMouseMove.bind(this)]]):this._subscribe=I([window],[["mousemove",this.onMouseMove.bind(this)]])},e.prototype._handleCallback=function(){var t;this.callback&&this.callback({args:[this.currentIndex],event:this.event,isMoving:this.isActive,target:null===(t=this.event)||void 0===t?void 0:t.target,mouseX:this.movement.x,mouseY:this.movement.y,velocityX:this.velocity.x,velocityY:this.velocity.y,directionX:this.direction.x,directionY:this.direction.y})},e.prototype.onMouseMove=function(t){var e=this,n=this.targetElements.find((function(e){return e===t.target}));n&&(this.currentIndex=this.targetElements.indexOf(n)),this.event=t;var i=Date.now(),r=Math.min(i-this.lastTimeStamp,64);this.lastTimeStamp=i;var o=r/1e3,s=t.clientX,u=t.clientY;this.movement={x:s,y:u},-1!==this.isActiveID&&(this.isActive=!0,clearTimeout(this.isActiveID)),this.isActiveID=setTimeout((function(){e.isActive=!1,e.direction={x:0,y:0},e.velocity={x:0,y:0},e._handleCallback()}),250);var a=this.movement.x-this.previousMovement.x,c=this.movement.y-this.previousMovement.y;this.direction={x:Math.sign(a),y:Math.sign(c)},this.velocity={x:M(a/o/1e3,-1*O._VELOCITY_LIMIT,O._VELOCITY_LIMIT),y:M(c/o/1e3,-1*O._VELOCITY_LIMIT,O._VELOCITY_LIMIT)},this.previousMovement={x:this.movement.x,y:this.movement.y},this._handleCallback()},e}(O),k=function(t){function e(){var e=t.apply(this,x([],d(arguments),!1))||this;return e.movement=T(0,0),e.previousMovement=T(0,0),e.direction=T(0,0),e.velocity=T(0,0),e}return f(e,t),e.prototype._initEvents=function(){this.targetElement?this._subscribe=I([this.targetElement],[["scroll",this.scrollElementListener.bind(this)]]):this._subscribe=I([window],[["scroll",this.scrollListener.bind(this)]])},e.prototype._handleCallback=function(){this.callback&&this.callback({isScrolling:this.isActive,scrollX:this.movement.x,scrollY:this.movement.y,velocityX:this.velocity.x,velocityY:this.velocity.y,directionX:this.direction.x,directionY:this.direction.y})},e.prototype.onScroll=function(t){var e=this,n=t.x,i=t.y,r=Date.now(),o=Math.min(r-this.lastTimeStamp,64);this.lastTimeStamp=r;var s=o/1e3;this.movement={x:n,y:i},-1!==this.isActiveID&&(this.isActive=!0,clearTimeout(this.isActiveID)),this.isActiveID=setTimeout((function(){e.isActive=!1,e.direction={x:0,y:0},e.velocity={x:0,y:0},e._handleCallback()}),250);var u=this.movement.x-this.previousMovement.x,a=this.movement.y-this.previousMovement.y;this.direction={x:Math.sign(u),y:Math.sign(a)},this.velocity={x:M(u/s/1e3,-1*O._VELOCITY_LIMIT,O._VELOCITY_LIMIT),y:M(a/s/1e3,-1*O._VELOCITY_LIMIT,O._VELOCITY_LIMIT)},this.previousMovement={x:this.movement.x,y:this.movement.y},this._handleCallback()},e.prototype.scrollListener=function(){var t=window.pageYOffset,e=window.pageXOffset;this.onScroll({x:e,y:t})},e.prototype.scrollElementListener=function(){var t,e,n=(null===(t=this.targetElement)||void 0===t?void 0:t.scrollLeft)||0,i=(null===(e=this.targetElement)||void 0===e?void 0:e.scrollTop)||0;this.onScroll({x:n,y:i})},e}(O),Y=function(t){function e(){var e=t.apply(this,x([],d(arguments),!1))||this;return e.movement=T(0,0),e.previousMovement=T(0,0),e.direction=T(0,0),e.velocity=T(0,0),e.delta=T(0,0),e.offset=T(0,0),e.translation=T(0,0),e}return f(e,t),e.prototype._initEvents=function(){this.targetElement&&(this._subscribe=I([this.targetElement],[["wheel",this.onWheel.bind(this)]]))},e.prototype._handleCallback=function(){this.callback&&this.callback({target:this.targetElement,isWheeling:this.isActive,deltaX:this.delta.x,deltaY:this.delta.y,directionX:this.direction.x,directionY:this.direction.y,movementX:this.movement.x,movementY:this.movement.y,offsetX:this.offset.x,offsetY:this.offset.y,velocityX:this.velocity.x,velocityY:this.velocity.y})},e.prototype.onWheel=function(t){var e=this,n=t.deltaX,i=t.deltaY,r=t.deltaMode,o=Date.now(),s=Math.min(o-this.lastTimeStamp,64);this.lastTimeStamp=o;var u=s/1e3;this.isActive=!0,-1!==this.isActiveID&&(this.isActive=!0,clearTimeout(this.isActiveID)),this.isActiveID=setTimeout((function(){e.isActive=!1,e.translation={x:e.offset.x,y:e.offset.y},e._handleCallback(),e.velocity={x:0,y:0},e.movement={x:0,y:0}}),200),1===r?(n*=40,i*=40):2===r&&(n*=800,i*=800),this.delta={x:n,y:i},this.movement={x:this.movement.x+n,y:this.movement.y+i},this.offset={x:this.translation.x+this.movement.x,y:this.translation.y+this.movement.y};var a=this.movement.x-this.previousMovement.x,c=this.movement.y-this.previousMovement.y;this.direction={x:Math.sign(a),y:Math.sign(c)},this.velocity={x:M(a/u/1e3,-1*O._VELOCITY_LIMIT,O._VELOCITY_LIMIT),y:M(c/u/1e3,-1*O._VELOCITY_LIMIT,O._VELOCITY_LIMIT)},this.previousMovement={x:this.movement.x,y:this.movement.y},this._handleCallback()},e}(O),S=function(t){var e=r.useRef(),n=r.useRef([]),i=r.useRef(new Map).current;return r.useEffect((function(){var e,n;try{for(var r=y(i.entries()),o=r.next();!o.done;o=r.next()){var s=d(o.value,2)[1],u=s.keyIndex,a=s.gesture,c=d(t[u],3)[2];a.applyCallback(c)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}}),[t]),r.useEffect((function(){return t.forEach((function(t,r){var o=d(t,4),s=o[0],u=o[1],a=o[2],c=o[3];i.set(s,{keyIndex:r,gesture:u,unsubscribe:u.applyGesture({targetElement:e.current,targetElements:n.current,callback:a,config:c})})})),function(){var t,e;try{for(var n=y(i.entries()),r=n.next();!r.done;r=n.next()){var o=d(r.value,2)[1].unsubscribe;o&&o()}}catch(e){t={error:e}}finally{try{r&&!r.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}}}),[]),function(t){return null==t?{ref:e}:(n.current[t]=n.current[t]||r.createRef(),{ref:n.current[t]})}};Object.defineProperty(exports,"Easing",{enumerable:!0,get:function(){return t.Easing}}),Object.defineProperty(exports,"fluid",{enumerable:!0,get:function(){return t.fluid}}),Object.defineProperty(exports,"makeFluid",{enumerable:!0,get:function(){return t.makeFluid}}),exports.AnimatedBlock=u,exports.AnimatedImage=c,exports.AnimatedInline=a,exports.AnimationConfigUtils=b,exports.MountedBlock=function(t){var n=t.state,i=t.children,r=t.from,o=void 0===r?0:r,s=t.enter,u=void 0===s?1:s,a=t.exit,c=l(n,{from:o,enter:u,exit:void 0===a?0:a,config:t.config,enterConfig:t.enterConfig,exitConfig:t.exitConfig});return e.jsx(e.Fragment,{children:c((function(t,e){return e&&i({value:t.value})}))})},exports.ScrollableBlock=function(t){var n=t.children,i=t.direction,o=void 0===i?"single":i,s=t.animationConfig,u=t.threshold,a=void 0===u?.2:u,c=r.useRef(null),l=E(0,s);return r.useEffect((function(){var t=c.current,e=new IntersectionObserver((function(t){d(t,1)[0].isIntersecting?l.value=1:"both"===o&&(l.value=0)}),{root:null,threshold:a});return t&&e.observe(t),function(){t&&e.unobserve(t)}}),[]),e.jsx("div",{ref:c,children:n&&n({value:l.value})})},exports.TransitionBlock=function(t){var n=t.state,i=t.children,r=t.config,o=E(w(n),r);return e.jsx(e.Fragment,{children:i({value:o.value})})},exports.bInterpolate=function(e,n,i,r){var o=s(e);return t.interpolate(o,[0,1],[n,i],r)},exports.bin=w,exports.clamp=M,exports.delay=function(t){return new Promise((function(e){setTimeout((function(){return e(null)}),t)}))},exports.interpolate=function(e,n,i,r){var o=s(e);return t.interpolate(o,n,i,r)},exports.mix=function(t,e,n){return e*(1-t)+n*t},exports.move=function(t,e,n){var i=t[e],r=t.length,o=e-n;if(o>0)return x(x(x(x([],d(t.slice(0,n)),!1),[i],!1),d(t.slice(n,e)),!1),d(t.slice(e+1,r)),!1);if(o<0){var s=n+1;return x(x(x(x([],d(t.slice(0,e)),!1),d(t.slice(e+1,s)),!1),[i],!1),d(t.slice(s,r)),!1)}return t},exports.rubberClamp=function(t,e,n,i){return void 0===i&&(i=.15),0===i?M(t,e,n):t<e?-_(e-t,n-e,i)+e:t>n?+_(t-n,n-e,i)+n:t},exports.snapTo=function(t,e,n){var i=t+.2*e,r=function(t){return Math.abs(t-i)},o=n.map(r),s=Math.min.apply(Math,x([],d(o),!1));return n.reduce((function(t,e){return r(e)===s?e:t}))},exports.useAnimatedValue=E,exports.useDrag=function(t,e){var n=r.useRef(new L).current;return S([["drag",n,t,e]])},exports.useGesture=function(t){var e=t.onDrag,n=t.onWheel,i=t.onScroll,o=t.onMouseMove,s=r.useRef(new L).current,u=r.useRef(new Y).current,a=r.useRef(new k).current,c=r.useRef(new C).current;return S([["drag",s,e],["wheel",u,n],["scroll",a,i],["move",c,o]])},exports.useMeasure=function(t,e){var i=n.useRef(null),r=n.useRef([]),o=n.useRef(t);return n.useEffect((function(){return o.current=t,function(){o.current=function(){return!1}}}),e),n.useEffect((function(){var t=i.current||document.documentElement,e=r.current,n=new ResizeObserver((function(e){var n=d(e,1)[0].target.getBoundingClientRect(),i=n.left,r=n.top,s=n.width,u=n.height,a=window.pageXOffset,c=window.pageYOffset;if(o){if(t===document.documentElement)return;o.current({left:i+a,top:r+c,width:s,height:u,vLeft:i,vTop:r})}})),s=new ResizeObserver((function(t){var e=[],n=[],i=[],r=[],s=[],u=[];t.forEach((function(t){var o=t.target.getBoundingClientRect(),a=o.left,c=o.top,l=o.width,h=o.height,f=a+window.pageXOffset,v=c+window.pageYOffset;e.push(f),n.push(v),i.push(l),r.push(h),s.push(a),u.push(c)})),o&&o.current({left:e,top:n,width:i,height:r,vLeft:s,vTop:u})}));return t&&(t===document.documentElement&&e.length>0?e.forEach((function(t){s.observe(t.current)})):n.observe(t)),function(){t&&(t===document.documentElement&&e.length>0?e.forEach((function(t){s.unobserve(t.current)})):n.unobserve(t))}}),[]),function(t){return null==t?{ref:i}:(r.current[t]=r.current[t]||n.createRef(),{ref:r.current[t]})}},exports.useMountedValue=l,exports.useMouseMove=function(t){var e=r.useRef(new C).current;return S([["move",e,t]])},exports.useOutsideClick=function(t,e,i){var r=n.useRef();r.current||(r.current=e),n.useEffect((function(){return r.current=e,function(){r.current=function(){return!1}}}),i),n.useEffect((function(){var e=I([document],[["click",function(e){var n;(null===(n=null==t?void 0:t.current)||void 0===n?void 0:n.contains(e.target))||r.current&&r.current(e)}]]);return function(){return e&&e()}}),[])},exports.useScroll=function(t){var e=r.useRef(new k).current;return S([["scroll",e,t]])},exports.useWheel=function(t){var e=r.useRef(new Y).current;return S([["wheel",e,t]])},exports.useWindowDimension=function(t,e){var i=n.useRef({width:0,height:0,innerWidth:0,innerHeight:0}),r=n.useRef(t);n.useEffect((function(){return r.current=t,function(){r.current=function(){return!1}}}),e),n.useEffect((function(){var t=new ResizeObserver((function(t){var e=d(t,1)[0].target,n=e.clientWidth,o=e.clientHeight,s=window.innerWidth,u=window.innerHeight;i.current={width:n,height:o,innerWidth:s,innerHeight:u},r&&r.current(v({},i.current))}));return t.observe(document.documentElement),function(){return t.unobserve(document.documentElement)}}),[])},exports.withDelay=function(t,e){return v(v({},e),{config:v(v({},e.config),{delay:t})})},exports.withSequence=function(t){var e=d(t).slice(0);return function(t){return m(void 0,void 0,void 0,(function(){var n,i,r,o,s,u;return p(this,(function(a){switch(a.label){case 0:a.trys.push([0,5,6,7]),n=y(e),i=n.next(),a.label=1;case 1:return i.done?[3,4]:(r=i.value,[4,t(r)]);case 2:a.sent(),a.label=3;case 3:return i=n.next(),[3,1];case 4:return[3,7];case 5:return o=a.sent(),s={error:o},[3,7];case 6:try{i&&!i.done&&(u=n.return)&&u.call(n)}finally{if(s)throw s.error}return[7];case 7:return[2]}}))}))}},exports.withSpring=function(t,e){return void 0===e&&(e=b.ELASTIC),{toValue:t,config:e}},exports.withTiming=function(t,e){return void 0===e&&(e={duration:250}),{toValue:t,config:e}};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|