2026-08-11 06:20:06 +00:00
// Module ID: 1728
// Function ID: 1729
2026-07-29 08:29:29 +00:00
// Name: validateConfig
2026-08-11 06:20:06 +00:00
// Dependencies: [1664, 1693, 1729, 1730, 1731]
2026-07-29 08:29:29 +00:00
2026-08-11 06:20:06 +00:00
// Module 1728 (validateConfig)
2026-07-29 08:29:29 +00:00
const require = arg1 ;
let dependencyMap = arg6 ;
function validateConfig ( clamp ) {
if ( clamp . clamp ) {
const _Array = Array ;
if ( Array . isArray ( clamp . clamp ) ) {
if ( 2 !== clamp . clamp . length ) {
const _HermesInternal3 = HermesInternal ;
2026-08-11 06:20:06 +00:00
const reanimatedError = new require ( 1664 ) /* t */ . ReanimatedError ( "`clamp array` must contain 2 items but is given " + clamp . clamp . length + "." ) ;
2026-07-29 08:29:29 +00:00
throw reanimatedError ;
}
} else {
const _HermesInternal = HermesInternal ;
2026-08-11 06:20:06 +00:00
const reanimatedError1 = new require ( 1664 ) /* t */ . ReanimatedError ( "`config.clamp` must be an array but is " + typeof clamp . clamp + "." ) ;
2026-07-29 08:29:29 +00:00
throw reanimatedError1 ;
}
}
if ( clamp . velocityFactor <= 0 ) {
const _HermesInternal2 = HermesInternal ;
2026-08-11 06:20:06 +00:00
const reanimatedError2 = new require ( 1664 ) /* t */ . ReanimatedError ( "`config.velocityFactor` must be greater then 0 but is " + clamp . velocityFactor + "." ) ;
2026-07-29 08:29:29 +00:00
throw reanimatedError2 ;
} else if ( clamp . rubberBandEffect ) {
if ( ! clamp . clamp ) {
2026-08-11 06:20:06 +00:00
const reanimatedError3 = new require ( 1664 ) /* t */ . ReanimatedError ( "You need to set `clamp` property when using `rubberBandEffect`." ) ;
2026-07-29 08:29:29 +00:00
throw reanimatedError3 ;
}
}
}
validateConfig . _ _closure = { } ;
validateConfig . _ _workletHash = 14532293098342 ;
validateConfig . _ _initData = { code : "function validateConfig_Pnpm_decayTs1(config){if(config.clamp){if(!Array.isArray(config.clamp)){throw new ReanimatedError(\"`config.clamp` must be an array but is \"+typeof config.clamp+\".\");}if(config.clamp.length!==2){throw new ReanimatedError(\"`clamp array` must contain 2 items but is given \"+config.clamp.length+\".\");}}if(config.velocityFactor<=0){throw new ReanimatedError(\"`config.velocityFactor` must be greater then 0 but is \"+config.velocityFactor+\".\");}if(config.rubberBandEffect&&!config.clamp){throw new ReanimatedError('You need to set `clamp` property when using `rubberBandEffect`.');}}" } ;
let closure _3 = { code : "function pnpm_decayTs3(){const{userConfig,isValidRubberBandConfig,rubberBandDecay,rigidDecay,validateConfig,callback,getReduceMotionForAnimation}=this.__closure;var _config$velocity;const config={deceleration:0.998,velocityFactor:1,velocity:0,rubberBandFactor:0.6};if(userConfig){Object.keys(userConfig).forEach(function(key){return config[key]=userConfig[key];});}const decay=isValidRubberBandConfig(config)?function(animation,now){return rubberBandDecay(animation,now,config);}:function(animation,now){return rigidDecay(animation,now,config);};function onStart(animation,value,now){const initialVelocity=config.velocity;animation.current=value;animation.lastTimestamp=now;animation.startTimestamp=now;animation.initialVelocity=initialVelocity;animation.velocity=initialVelocity;validateConfig(config);if(animation.reduceMotion&&config.clamp){if(value<config.clamp[0]){animation.current=config.clamp[0];}else if(value>config.clamp[1]){animation.current=config.clamp[1];}}}return{onFrame:decay,onStart:onStart,callback:callback,velocity:(_config$velocity=config.velocity)!==null&&_config$velocity!==void 0?_config$velocity:0,initialVelocity:0,current:undefined,lastTimestamp:0,startTimestamp:0,reduceMotion:getReduceMotionForAnimation(config.reduceMotion)};}" } ;
let fn = function n ( userConfig , callback ) {
const _require = userConfig ;
const dependencyMap = callback ;
2026-08-11 06:20:06 +00:00
let obj = _require ( 1693 ) ;
2026-07-29 08:29:29 +00:00
const fn = function c ( ) {
let obj = { deceleration : 0.998 , velocityFactor : 1 , velocity : 0 , rubberBandFactor : 0.6 } ;
if ( obj ) {
const _Object = Object ;
const keys = Object . keys ( tmp ) ;
const item = keys . forEach ( ( arg0 ) => {
obj [ arg0 ] = obj [ arg0 ] ;
return obj [ arg0 ] ;
} ) ;
}
obj = {
onFrame : userConfig ( table [ 2 ] ) . isValidRubberBandConfig ( obj ) ? ( ( current , lastTimestamp ) => {
2026-08-11 06:20:06 +00:00
obj = obj ( 1730 ) ;
2026-07-29 08:29:29 +00:00
return obj . rubberBandDecay ( current , lastTimestamp , obj ) ;
} ) : ( ( initialVelocity , lastTimestamp ) => {
2026-08-11 06:20:06 +00:00
obj = obj ( 1731 ) ;
2026-07-29 08:29:29 +00:00
return obj . rigidDecay ( initialVelocity , lastTimestamp , obj ) ;
} ) ,
onStart ( reduceMotion , current , lastTimestamp ) {
const velocity = obj . velocity ;
reduceMotion . current = current ;
reduceMotion . lastTimestamp = lastTimestamp ;
reduceMotion . startTimestamp = lastTimestamp ;
reduceMotion . initialVelocity = velocity ;
reduceMotion . velocity = velocity ;
outer2 _2 ( obj ) ;
if ( tmp3 ) {
if ( current < tmp . clamp [ 0 ] ) {
reduceMotion . current = tmp . clamp [ 0 ] ;
} else if ( current > tmp . clamp [ 1 ] ) {
reduceMotion . current = tmp . clamp [ 1 ] ;
}
}
} ,
callback : table ,
velocity : null ,
initialVelocity : 0 ,
2026-08-08 06:10:11 +00:00
current : "sa" ,
2026-07-29 08:29:29 +00:00
lastTimestamp : null ,
2026-08-14 17:33:39 +00:00
startTimestamp : "ex" ,
reduceMotion : "is"
2026-07-29 08:29:29 +00:00
} ;
let num = obj . velocity ;
if ( num == null ) {
num = 0 ;
}
obj [ 3 ] = num ;
const obj2 = userConfig ( table [ 2 ] ) ;
const tmp4 = userConfig ;
const tmp5 = table ;
obj [ 8 ] = userConfig ( table [ 1 ] ) . getReduceMotionForAnimation ( obj . reduceMotion ) ;
return obj ;
} ;
2026-08-11 06:20:06 +00:00
obj = { userConfig , isValidRubberBandConfig : _require ( 1729 ) . isValidRubberBandConfig , rubberBandDecay : _require ( 1730 ) . rubberBandDecay , rigidDecay : _require ( 1731 ) . rigidDecay , validateConfig , callback , getReduceMotionForAnimation : _require ( 1693 ) . getReduceMotionForAnimation } ;
2026-07-29 08:29:29 +00:00
fn . _ _closure = obj ;
fn . _ _workletHash = 17099614658252 ;
fn . _ _initData = closure _3 ;
return obj . defineAnimation ( 0 , fn ) ;
} ;
fn . _ _closure = { defineAnimation : require ( "isValidLayoutAnimationProp" ) . defineAnimation , isValidRubberBandConfig : require ( "isValidRubberBandConfig" ) . isValidRubberBandConfig , rubberBandDecay : require ( "rubberBandDecay" ) . rubberBandDecay , rigidDecay : require ( "rigidDecay" ) . rigidDecay , validateConfig , getReduceMotionForAnimation : require ( "isValidLayoutAnimationProp" ) . getReduceMotionForAnimation } ;
fn . _ _workletHash = 3913201228611 ;
fn . _ _initData = { code : "function pnpm_decayTs2(userConfig,callback){const{defineAnimation,isValidRubberBandConfig,rubberBandDecay,rigidDecay,validateConfig,getReduceMotionForAnimation}=this.__closure;return defineAnimation(0,function(){'worklet';var _config$velocity;const config={deceleration:0.998,velocityFactor:1,velocity:0,rubberBandFactor:0.6};if(userConfig){Object.keys(userConfig).forEach(function(key){return config[key]=userConfig[key];});}const decay=isValidRubberBandConfig(config)?function(animation,now){return rubberBandDecay(animation,now,config);}:function(animation,now){return rigidDecay(animation,now,config);};function onStart(animation,value,now){const initialVelocity=config.velocity;animation.current=value;animation.lastTimestamp=now;animation.startTimestamp=now;animation.initialVelocity=initialVelocity;animation.velocity=initialVelocity;validateConfig(config);if(animation.reduceMotion&&config.clamp){if(value<config.clamp[0]){animation.current=config.clamp[0];}else if(value>config.clamp[1]){animation.current=config.clamp[1];}}}return{onFrame:decay,onStart:onStart,callback:callback,velocity:(_config$velocity=config.velocity)!==null&&_config$velocity!==void 0?_config$velocity:0,initialVelocity:0,current:undefined,lastTimestamp:0,startTimestamp:0,reduceMotion:getReduceMotionForAnimation(config.reduceMotion)};});}" } ;
arg5 . withDecay = fn ;