74 lines
4.3 KiB
JavaScript
74 lines
4.3 KiB
JavaScript
/* Metro module 1688; source: unknown; dependencies: [1686] */
|
|
import * as Module01686Module from './module-01686.js'; /* Metro dependency 1686 */
|
|
|
|
function _fun18422(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#18422, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1815:6, offset: 0x00e8bb56, size: 86 bytes, params: 8, frame: 16
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
object = {code: 'function rigidDecay_Pnpm_rigidDecayTs1(animation,now,config){const{SLOPE_FACTOR,VELOCITY_EPS}=this.__closure;const{lastTimestamp:lastTimestamp,startTimestamp:startTimestamp,initialVelocity:initialVelocity,current:current,velocity:velocity}=animation;const deltaTime=Math.min(Math.max(now-lastTimestamp,0),64);const v=velocity*Math.exp(-(1-config.deceleration)*(now-startTimestamp)*SLOPE_FACTOR);animation.current=current+v*config.velocityFactor*deltaTime/1000;animation.velocity=v;animation.lastTimestamp=now;if(config.clamp){if(initialVelocity<0&&animation.current<=config.clamp[0]){animation.current=config.clamp[0];return true;}else if(initialVelocity>0&&animation.current>=config.clamp[1]){animation.current=config.clamp[1];return true;}}return Math.abs(v)<VELOCITY_EPS;}'};
|
|
exports.rigidDecay = _fun18423();
|
|
function _fun18423() { // fn#18423, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1815:885, offset: 0x00e8bbac, size: 98 bytes, params: 1, frame: 16
|
|
const rigidDecay2 = rigidDecay;
|
|
const object = {};
|
|
const SLOPE_FACTOR = (Module01686Module).SLOPE_FACTOR;
|
|
object.SLOPE_FACTOR = SLOPE_FACTOR;
|
|
const VELOCITY_EPS = (Module01686Module).VELOCITY_EPS;
|
|
object.VELOCITY_EPS = VELOCITY_EPS;
|
|
rigidDecay2.__closure = object;
|
|
rigidDecay2.__workletHash = 6356485112123;
|
|
rigidDecay2.__initData = env0_2;
|
|
return rigidDecay2;
|
|
function rigidDecay(a0, a1, a2) { // fn#18424, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1815:902, offset: 0x00e8bc0e, size: 347 bytes, params: 4, frame: 26
|
|
const VELOCITY_EPS = (Module01686Module).VELOCITY_EPS;
|
|
const lastTimestamp = a0.lastTimestamp;
|
|
const startTimestamp = a0.startTimestamp;
|
|
const initialVelocity = a0.initialVelocity;
|
|
const current = a0.current;
|
|
const velocity = a0.velocity;
|
|
let Math = global.Math;
|
|
const min = Math.min;
|
|
const Math2 = global.Math;
|
|
let value = Math2.max(a1 - lastTimestamp, 0);
|
|
value = Reflect.apply(min, Math, [value, 64]);
|
|
Math = global.Math;
|
|
const exp = Math.exp;
|
|
const value4 = -(1 - a2.deceleration) * (a1 - startTimestamp);
|
|
const SLOPE_FACTOR = (Module01686Module).SLOPE_FACTOR;
|
|
const value6 = velocity * Reflect.apply(exp, Math, [value4 * SLOPE_FACTOR]);
|
|
a0.current = current + value6 * a2.velocityFactor * value / 1000;
|
|
a0.velocity = value6;
|
|
a0.lastTimestamp = a1;
|
|
if (a2.clamp) {
|
|
if (initialVelocity < 0) {
|
|
if (a0.current <= a2.clamp[0]) {
|
|
a0.current = a2.clamp[0];
|
|
return true;
|
|
}
|
|
if (initialVelocity > 0) {
|
|
if (a0.current >= a2.clamp[1]) {
|
|
a0.current = a2.clamp[1];
|
|
return true;
|
|
}
|
|
return global.Math.abs(value6) < VELOCITY_EPS;
|
|
}
|
|
return global.Math.abs(value6) < VELOCITY_EPS;
|
|
}
|
|
if (initialVelocity > 0) {
|
|
if (a0.current >= a2.clamp[1]) {
|
|
a0.current = a2.clamp[1];
|
|
return true;
|
|
}
|
|
return global.Math.abs(value6) < VELOCITY_EPS;
|
|
}
|
|
return global.Math.abs(value6) < VELOCITY_EPS;
|
|
}
|
|
Math = global.Math;
|
|
return Math.abs(value6) < VELOCITY_EPS;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun18422, 1688, [1686]) /* metro module 1688, dependencies: [1686] */;
|