text: import _defineProperty from"@babel/runtime/helpers/defineProperty";function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly)symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable;});keys.push.apply(keys,symbols);}return keys;}function _objectSpread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};if(i%2){ownKeys(Object(source),true).forEach(function(key){_defineProperty(target,key,source[key]);});}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(target,Object.getOwnPropertyDescriptors(source));}else{ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key));});}}return target;}import Animated,{Easing}from"react-native-reanimated";import{State}from"react-native-gesture-handler";import{useMemoOne}from"use-memo-one";import{bin}from"./Math";var Value=Animated.Value,cond=Animated.cond,eq=Animated.eq,block=Animated.block,set=Animated.set,Clock=Animated.Clock,spring=Animated.spring,startClock=Animated.startClock,timing=Animated.timing,neq=Animated.neq,useCode=Animated.useCode,SpringUtils=Animated.SpringUtils;var defaultSpringConfig=SpringUtils.makeDefaultConfig();export var withTransition=function withTransition(value){var timingConfig=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var gestureState=arguments.length>2&&arguments[2]!==undefined?arguments[2]:new Value(State.UNDETERMINED);var clock=new Clock();var state={finished:new Value(0),frameTime:new Value(0),position:new Value(0),time:new Value(0)};var config=_objectSpread({toValue:new Value(0),duration:250,easing:Easing.linear},timingConfig);return block([startClock(clock),cond(neq(config.toValue,value),[set(state.frameTime,0),set(state.time,0),set(state.finished,0),set(config.toValue,value)]),cond(eq(gestureState,State.ACTIVE),[set(state.position,value)],timing(clock,state,config)),state.position]);};export var withSpringTransition=function withSpringTransition(value){var springConfig=arguments.length>1&&arguments[1]!==undefined?arguments[1]:defaultSpringConfig;var velocity=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var gestureState=arguments.length>3&&arguments[3]!==undefined?arguments[3]:new Value(State.UNDETERMINED);var clock=new Clock();var state={finished:new Value(0),velocity:new Value(0),position:new Value(0),time:new Value(0)};var config=_objectSpread({toValue:new Value(0),damping:15,mass:1,stiffness:150,overshootClamping:false,restSpeedThreshold:1,restDisplacementThreshold:1},springConfig);return block([startClock(clock),set(config.toValue,value),cond(eq(gestureState,State.ACTIVE),[set(state.velocity,velocity),set(state.position,value)],spring(clock,state,config)),state.position]);};export var withTimingTransition=withTransition;export var useTransition=function useTransition(state){var config=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var value=useMemoOne(function(){return new Value(0);},[]);useCode(function(){return set(value,typeof state==="boolean"?bin(state):state);},[state,value]);var transition=useMemoOne(function(){return withTransition(value,config);},[value]);return transition;};export var useSpringTransition=function useSpringTransition(state){var config=arguments.length>1&&arguments[1]!==undefined?arguments[1]:defaultSpringConfig;var value=useMemoOne(function(){return new Value(0);},[]);useCode(function(){return set(value,typeof state==="boolean"?bin(state):state);},[state,value]);var transition=useMemoOne(function(){return withSpringTransition(value,config);},[value]);return transition;};export var useTimingTransition=useTransition;
  //# sourceMappingURL=Transitions.js.map