2026-07-20 16:05:17 +00:00
// Module ID: 1665
2026-07-25 08:10:48 +00:00
// Function ID: 18461
2026-07-20 16:05:17 +00:00
// Name: checkIfConfigIsValid
2026-07-23 10:11:24 +00:00
// Dependencies: [65, 57, 1586]
2026-07-20 16:05:17 +00:00
// Module 1665 (checkIfConfigIsValid)
2026-07-23 10:11:24 +00:00
import _toConsumableArray from "_toConsumableArray" ;
import _slicedToArray from "_slicedToArray" ;
const require = arg1 ;
2026-07-20 16:05:17 +00:00
let closure _4 = { code : "function checkIfConfigIsValid_Pnpm_springUtilsTs1(config){const{logger}=this.__closure;var _config$clamp,_config$clamp2;let errorMessage='';['stiffness','damping','dampingRatio','restDisplacementThreshold','restSpeedThreshold','mass'].forEach(function(prop){const value=config[prop];if(value<=0){errorMessage+=\", \"+prop+\" must be grater than zero but got \"+value;}});if(config.duration<0){errorMessage+=\", duration can't be negative, got \"+config.duration;}if((_config$clamp=config.clamp)!==null&&_config$clamp!==void 0&&_config$clamp.min&&(_config$clamp2=config.clamp)!==null&&_config$clamp2!==void 0&&_config$clamp2.max&&config.clamp.min>config.clamp.max){errorMessage+=\", clamp.min should be lower than clamp.max, got clamp: {min: \"+config.clamp.min+\", max: \"+config.clamp.max+\"} \";}if(errorMessage!==''){logger.warn('Invalid spring config'+errorMessage);}return errorMessage==='';}" } ;
let closure _5 = { code : "function bisectRoot_Pnpm_springUtilsTs2({min:min,max:max,func:func,maxIterations=20}){const ACCURACY=0.00005;let idx=maxIterations;let current=(max+min)/2;while(Math.abs(func(current))>ACCURACY&&idx>0){idx-=1;if(func(current)<0){min=current;}else{max=current;}current=(min+max)/2;}return current;}" } ;
2026-07-23 10:11:24 +00:00
let tmp3 = ( ( ) => {
export function bisectRoot ( arg0 ) {
2026-07-20 16:05:17 +00:00
let func ;
let max ;
let maxIterations ;
let min ;
( { min , max , func , maxIterations } = arg0 ) ;
let num = 20 ;
if ( undefined !== maxIterations ) {
num = maxIterations ;
}
const result = ( max + min ) / 2 ;
let tmp2 = result ;
if ( Math . abs ( func ( result ) ) > 0.00005 ) {
let tmp3 = result ;
tmp2 = result ;
if ( num > 0 ) {
while ( true ) {
num = num - 1 ;
let tmp4 = tmp3 ;
let tmp5 = tmp3 ;
if ( func ( tmp3 ) < 0 ) {
min = tmp3 ;
tmp5 = max ;
}
let result1 = ( min + tmp5 ) / 2 ;
let _Math = Math ;
tmp2 = result1 ;
if ( Math . abs ( func ( result1 ) ) <= 0.00005 ) {
break ;
} else {
max = tmp5 ;
tmp3 = result1 ;
tmp2 = result1 ;
if ( num <= 0 ) {
break ;
}
}
}
}
}
return tmp2 ;
}
bisectRoot . _ _closure = { } ;
bisectRoot . _ _workletHash = 3467677822604 ;
bisectRoot . _ _initData = closure _5 ;
return bisectRoot ;
2026-07-23 10:11:24 +00:00
} ) ( ) ;
let closure _6 = tmp3 ;
2026-07-20 16:05:17 +00:00
let closure _7 = { code : "function initialCalculations_Pnpm_springUtilsTs3(mass=0,config){if(config.skipAnimation){return{zeta:0,omega0:0,omega1:0};}if(config.useDuration){const{stiffness:k,dampingRatio:zeta}=config;const omega0=Math.sqrt(k/mass);const omega1=zeta<1?omega0*Math.sqrt(1-zeta**2):0;return{zeta:zeta,omega0:omega0,omega1:omega1};}else{const{damping:c,mass:m,stiffness:k}=config;const zeta=c/(2*Math.sqrt(k*m));const omega0=Math.sqrt(k/m);const omega1=zeta<1?omega0*Math.sqrt(1-zeta**2):0;return{zeta:zeta,omega0:omega0,omega1:omega1};}}" } ;
let closure _8 = { code : "function scaleZetaToMatchClamps_Pnpm_springUtilsTs4(animation,clamp){const{zeta:zeta,toValue:toValue,startValue:startValue}=animation;const toValueNum=Number(toValue);if(toValueNum===startValue){return zeta;}const[firstBound,secondBound]=toValueNum-startValue>0?[clamp.min,clamp.max]:[clamp.max,clamp.min];const relativeExtremum1=secondBound!==undefined?Math.abs((secondBound-toValueNum)/(toValueNum-startValue)):undefined;const relativeExtremum2=firstBound!==undefined?Math.abs((firstBound-toValueNum)/(toValueNum-startValue)):undefined;const newZeta1=relativeExtremum1!==undefined?Math.abs(Math.log(relativeExtremum1)/Math.PI):undefined;const newZeta2=relativeExtremum2!==undefined?Math.abs(Math.log(relativeExtremum2)/(2*Math.PI)):undefined;const zetaSatisfyingClamp=[newZeta1,newZeta2].filter(function(x){return x!==undefined;});return Math.max(...zetaSatisfyingClamp,zeta);}" } ;
2026-07-23 10:11:24 +00:00
let tmp2 = ( ( ) => {
export function checkIfConfigIsValid ( merged ) {
let closure _0 = merged ;
2026-07-20 16:05:17 +00:00
let closure _1 = "" ;
2026-07-23 10:11:24 +00:00
const items = [ "stiffness" , "damping" , "dampingRatio" , "restDisplacementThreshold" , "restSpeedThreshold" , "mass" ] ;
2026-07-20 16:05:17 +00:00
const item = items . forEach ( ( arg0 ) => {
2026-07-23 10:11:24 +00:00
if ( merged [ arg0 ] <= 0 ) {
2026-07-20 16:05:17 +00:00
const _HermesInternal = HermesInternal ;
closure _1 = closure _1 + ", " + arg0 + " must be grater than zero but got " + tmp ;
}
} ) ;
if ( merged . duration < 0 ) {
2026-07-23 10:11:24 +00:00
let _HermesInternal = HermesInternal ;
2026-07-20 16:05:17 +00:00
closure _1 = closure _1 + ", duration can't be negative, got " + merged . duration ;
}
const clamp = merged . clamp ;
let max = null != clamp && clamp . min ;
if ( max ) {
const clamp2 = merged . clamp ;
max = null != clamp2 ;
const tmp4 = clamp2 ;
}
if ( max ) {
max = tmp4 . max ;
}
if ( max ) {
max = merged . clamp . min > merged . clamp . max ;
}
if ( max ) {
const _HermesInternal2 = HermesInternal ;
closure _1 = closure _1 + ", clamp.min should be lower than clamp.max, got clamp: {min: " + merged . clamp . min + ", max: " + merged . clamp . max + "} " ;
}
if ( "" !== closure _1 ) {
2026-07-23 10:11:24 +00:00
const logger = outer1 _0 ( outer1 _1 [ 2 ] ) . logger ;
2026-07-20 16:05:17 +00:00
logger . warn ( ` Invalid spring config ${ closure _1 } ` ) ;
}
return "" === closure _1 ;
}
2026-07-23 10:11:24 +00:00
checkIfConfigIsValid . _ _closure = { logger : require ( 1586 ) /* noop */ . logger } ;
2026-07-20 16:05:17 +00:00
checkIfConfigIsValid . _ _workletHash = 16835320063819 ;
checkIfConfigIsValid . _ _initData = closure _4 ;
return checkIfConfigIsValid ;
2026-07-23 10:11:24 +00:00
} ) ( ) ;
2026-07-20 16:05:17 +00:00
let closure _9 = { code : "function calculateNewMassToMatchDuration_Pnpm_springUtilsTs5(x0,config,v0){const{bisectRoot}=this.__closure;if(config.skipAnimation){return 0;}const{stiffness:k,dampingRatio:zeta,restSpeedThreshold:threshold,duration:duration}=config;const durationForMass=function(mass){'worklet';const amplitude=(mass*v0*v0+k*x0*x0)/(Math.exp(1-0.5*zeta)*k);const c=zeta*2*Math.sqrt(k*mass);return 1000*(-2*mass/c)*Math.log(threshold*0.01/amplitude)-duration;};return bisectRoot({min:0,max:100,func:durationForMass});}" } ;
let closure _10 = { code : "function pnpm_springUtilsTs6(mass){const{v0,k,x0,zeta,threshold,duration}=this.__closure;const amplitude=(mass*v0*v0+k*x0*x0)/(Math.exp(1-0.5*zeta)*k);const c=zeta*2*Math.sqrt(k*mass);return 1000*(-2*mass/c)*Math.log(threshold*0.01/amplitude)-duration;}" } ;
2026-07-23 10:11:24 +00:00
let tmp4 = ( ( ) => {
export function initialCalculations ( mass , merged ) {
2026-07-20 16:05:17 +00:00
let stiffness ;
let num = 0 ;
if ( arguments . length > 0 ) {
num = 0 ;
if ( undefined !== arguments [ 0 ] ) {
num = arguments [ 0 ] ;
}
}
let tmp ;
if ( arguments . length > 1 ) {
tmp = arguments [ 1 ] ;
}
if ( tmp . skipAnimation ) {
2026-07-23 10:11:24 +00:00
return { zeta : 0 , omega0 : 0 , omega1 : 0 } ;
2026-07-20 16:05:17 +00:00
} else if ( tmp . useDuration ) {
const dampingRatio = tmp . dampingRatio ;
const _Math4 = Math ;
const sqrtResult = Math . sqrt ( tmp . stiffness / num ) ;
let obj = { zeta : dampingRatio , omega0 : sqrtResult } ;
let num5 = 0 ;
if ( dampingRatio < 1 ) {
const _Math5 = Math ;
num5 = sqrtResult * Math . sqrt ( 1 - dampingRatio * * 2 ) ;
}
obj . omega1 = num5 ;
return obj ;
} else {
( { mass , stiffness } = tmp ) ;
const _Math = Math ;
const result = tmp . damping / ( 2 * Math . sqrt ( stiffness * mass ) ) ;
const _Math2 = Math ;
const sqrtResult1 = Math . sqrt ( stiffness / mass ) ;
obj = { zeta : result , omega0 : sqrtResult1 } ;
let num3 = 0 ;
if ( result < 1 ) {
const _Math3 = Math ;
num3 = sqrtResult1 * Math . sqrt ( 1 - result * * 2 ) ;
}
obj . omega1 = num3 ;
return obj ;
}
}
initialCalculations . _ _closure = { } ;
initialCalculations . _ _workletHash = 5986209785952 ;
initialCalculations . _ _initData = closure _7 ;
return initialCalculations ;
2026-07-23 10:11:24 +00:00
} ) ( ) ;
2026-07-20 16:05:17 +00:00
let closure _11 = { code : "function criticallyDampedSpringCalculations_Pnpm_springUtilsTs7(animation,precalculatedValues){const{toValue:toValue}=animation;const{v0:v0,x0:x0,omega0:omega0,t:t}=precalculatedValues;const criticallyDampedEnvelope=Math.exp(-omega0*t);const criticallyDampedPosition=toValue-criticallyDampedEnvelope*(x0+(v0+omega0*x0)*t);const criticallyDampedVelocity=criticallyDampedEnvelope*(v0*(t*omega0-1)+t*x0*omega0*omega0);return{position:criticallyDampedPosition,velocity:criticallyDampedVelocity};}" } ;
2026-07-23 10:11:24 +00:00
let tmp5 = ( ( ) => {
export function scaleZetaToMatchClamps ( toValue , clamp ) {
2026-07-20 16:05:17 +00:00
let startValue ;
let zeta ;
( { zeta , startValue } = toValue ) ;
const NumberResult = Number ( toValue . toValue ) ;
if ( NumberResult === startValue ) {
return zeta ;
} else {
if ( NumberResult - startValue > 0 ) {
const items = [ , ] ;
( { min : arr2 [ 0 ] , max : arr2 [ 1 ] } = clamp ) ;
let items1 = items ;
} else {
items1 = [ , ] ;
( { max : arr [ 0 ] , min : arr [ 1 ] } = clamp ) ;
}
2026-07-23 10:11:24 +00:00
const tmp3 = outer1 _3 ( items1 , 2 ) ;
2026-07-20 16:05:17 +00:00
const first = tmp3 [ 0 ] ;
let absolute ;
if ( undefined !== tmp3 [ 1 ] ) {
const _Math = Math ;
absolute = Math . abs ( ( tmp5 - NumberResult ) / ( NumberResult - startValue ) ) ;
}
let absolute1 ;
if ( undefined !== first ) {
const _Math2 = Math ;
absolute1 = Math . abs ( ( first - NumberResult ) / ( NumberResult - startValue ) ) ;
}
let absolute2 ;
if ( undefined !== absolute ) {
const _Math3 = Math ;
const _Math4 = Math ;
const _Math5 = Math ;
absolute2 = Math . abs ( Math . log ( absolute ) / Math . PI ) ;
}
const items2 = [ absolute2 , ] ;
let absolute3 ;
if ( undefined !== absolute1 ) {
const _Math6 = Math ;
const _Math7 = Math ;
const _Math8 = Math ;
absolute3 = Math . abs ( Math . log ( absolute1 ) / ( 2 * Math . PI ) ) ;
}
items2 [ 1 ] = absolute3 ;
const _Math9 = Math ;
const _Math10 = Math ;
const items3 = [ zeta ] ;
2026-07-23 10:11:24 +00:00
return max . apply ( Math , outer1 _2 ( items2 . filter ( ( arg0 ) => undefined !== arg0 ) ) . concat ( items3 ) ) ;
2026-07-20 16:05:17 +00:00
}
}
scaleZetaToMatchClamps . _ _closure = { } ;
scaleZetaToMatchClamps . _ _workletHash = 5791837772627 ;
scaleZetaToMatchClamps . _ _initData = closure _8 ;
return scaleZetaToMatchClamps ;
2026-07-23 10:11:24 +00:00
} ) ( ) ;
2026-07-20 16:05:17 +00:00
let closure _12 = { code : "function underDampedSpringCalculations_Pnpm_springUtilsTs8(animation,precalculatedValues){const{toValue:toValue,current:current,velocity:velocity}=animation;const{zeta:zeta,t:t,omega0:omega0,omega1:omega1}=precalculatedValues;const v0=-velocity;const x0=toValue-current;const sin1=Math.sin(omega1*t);const cos1=Math.cos(omega1*t);const underDampedEnvelope=Math.exp(-zeta*omega0*t);const underDampedFrag1=underDampedEnvelope*(sin1*((v0+zeta*omega0*x0)/omega1)+x0*cos1);const underDampedPosition=toValue-underDampedFrag1;const underDampedVelocity=zeta*omega0*underDampedFrag1-underDampedEnvelope*(cos1*(v0+zeta*omega0*x0)-omega1*x0*sin1);return{position:underDampedPosition,velocity:underDampedVelocity};}" } ;
2026-07-23 10:11:24 +00:00
const tmp6 = ( ( ) => {
export function calculateNewMassToMatchDuration ( diff , merged , velocity ) {
let closure _0 = diff ;
let closure _1 = velocity ;
2026-07-20 16:05:17 +00:00
if ( merged . skipAnimation ) {
return 0 ;
} else {
const stiffness = merged . stiffness ;
const dampingRatio = merged . dampingRatio ;
const restSpeedThreshold = merged . restSpeedThreshold ;
const duration = merged . duration ;
/* worklet (recovered source) */ function pnpm _springUtilsTs6 ( mass ) { const { v0 , k , x0 , zeta , threshold , duration } = this . _ _closure ; const amplitude = ( mass * v0 * v0 + k * x0 * x0 ) / ( Math . exp ( 1 - 0.5 * zeta ) * k ) ; const c = zeta * 2 * Math . sqrt ( k * mass ) ; return 1000 * ( - 2 * mass / c ) * Math . log ( threshold * 0.01 / amplitude ) - duration ; }
let obj = { v0 : velocity , k : stiffness , x0 : diff , zeta : dampingRatio , threshold : restSpeedThreshold , duration } ;
pnpm _springUtilsTs6 . _ _closure = obj ;
pnpm _springUtilsTs6 . _ _workletHash = 9188609427640 ;
2026-07-23 10:11:24 +00:00
pnpm _springUtilsTs6 . _ _initData = outer1 _10 ;
obj = { min : 0 , max : 100 , func : pnpm _springUtilsTs6 } ;
return outer1 _6 ( obj ) ;
2026-07-20 16:05:17 +00:00
}
}
2026-07-23 10:11:24 +00:00
calculateNewMassToMatchDuration . _ _closure = { bisectRoot : closure _6 } ;
2026-07-20 16:05:17 +00:00
calculateNewMassToMatchDuration . _ _workletHash = 4742488441783 ;
calculateNewMassToMatchDuration . _ _initData = closure _9 ;
return calculateNewMassToMatchDuration ;
2026-07-23 10:11:24 +00:00
} ) ( ) ;
2026-07-20 16:05:17 +00:00
let closure _13 = { code : "function isAnimationTerminatingCalculation_Pnpm_springUtilsTs9(animation,config){const{toValue:toValue,velocity:velocity,startValue:startValue,current:current}=animation;const isOvershooting=config.overshootClamping?current>toValue&&startValue<toValue||current<toValue&&startValue>toValue:false;const isVelocity=Math.abs(velocity)<config.restSpeedThreshold;const isDisplacement=Math.abs(toValue-current)<config.restDisplacementThreshold;return{isOvershooting:isOvershooting,isVelocity:isVelocity,isDisplacement:isDisplacement};}" } ;
2026-07-23 10:11:24 +00:00
const tmp7 = ( ( ) => {
export function criticallyDampedSpringCalculations ( toValue , arg1 ) {
2026-07-20 16:05:17 +00:00
let omega0 ;
let t ;
let v0 ;
let x0 ;
( { v0 , x0 , omega0 , t } = arg1 ) ;
const expResult = Math . exp ( - omega0 * t ) ;
return { position : toValue . toValue - expResult * ( x0 + ( v0 + omega0 * x0 ) * t ) , velocity : expResult * ( v0 * ( t * omega0 - 1 ) + t * x0 * omega0 * omega0 ) } ;
}
criticallyDampedSpringCalculations . _ _closure = { } ;
criticallyDampedSpringCalculations . _ _workletHash = 57813752690 ;
criticallyDampedSpringCalculations . _ _initData = closure _11 ;
return criticallyDampedSpringCalculations ;
2026-07-23 10:11:24 +00:00
} ) ( ) ;
2026-07-20 16:05:17 +00:00
2026-07-23 10:11:24 +00:00
export const underDampedSpringCalculations = ( ( ) => {
2026-07-20 16:05:17 +00:00
function underDampedSpringCalculations ( toValue , arg1 ) {
let omega0 ;
let omega1 ;
let t ;
let zeta ;
toValue = toValue . toValue ;
( { zeta , t , omega0 , omega1 } = arg1 ) ;
const diff = toValue - toValue . current ;
const sinResult = Math . sin ( omega1 * t ) ;
const cosResult = Math . cos ( omega1 * t ) ;
const expResult = Math . exp ( - zeta * omega0 * t ) ;
const result = expResult * ( sinResult * ( ( tmp + zeta * omega0 * diff ) / omega1 ) + diff * cosResult ) ;
return { position : toValue - result , velocity : zeta * omega0 * result - expResult * ( cosResult * ( - toValue . velocity + zeta * omega0 * diff ) - omega1 * diff * sinResult ) } ;
}
underDampedSpringCalculations . _ _closure = { } ;
underDampedSpringCalculations . _ _workletHash = 16542539931641 ;
underDampedSpringCalculations . _ _initData = closure _12 ;
return underDampedSpringCalculations ;
2026-07-23 10:11:24 +00:00
} ) ( ) ;
export const isAnimationTerminatingCalculation = ( ( ) => {
2026-07-20 16:05:17 +00:00
function isAnimationTerminatingCalculation ( velocity , merged ) {
let current ;
let startValue ;
let toValue ;
( { toValue , startValue , current } = velocity ) ;
const obj = { } ;
let tmp2 = ! tmp ;
if ( ! ! merged . overshootClamping ) {
let tmp3 = current > toValue && startValue < toValue ;
if ( ! tmp3 ) {
tmp3 = current < toValue && startValue > toValue ;
const tmp4 = current < toValue && startValue > toValue ;
}
tmp2 = tmp3 ;
}
obj . isOvershooting = tmp2 ;
obj . isVelocity = Math . abs ( velocity . velocity ) < merged . restSpeedThreshold ;
obj . isDisplacement = Math . abs ( toValue - current ) < merged . restDisplacementThreshold ;
return obj ;
}
isAnimationTerminatingCalculation . _ _closure = { } ;
isAnimationTerminatingCalculation . _ _workletHash = 3775628746247 ;
isAnimationTerminatingCalculation . _ _initData = closure _13 ;
return isAnimationTerminatingCalculation ;
2026-07-23 10:11:24 +00:00
} ) ( ) ;