157 lines
11 KiB
React
157 lines
11 KiB
React
/* Metro module 1685; source: unknown; dependencies: [1621, 1650, 1686, 1687, 1688] */
|
|
function _fun18407(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#18407, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1812:6, offset: 0x00e8b207, size: 270 bytes, params: 8, frame: 20
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
object = {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`.\');}}'};
|
|
const value = _fun18408();
|
|
const env0_4 = {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)};}'};
|
|
const closure = withDecay;
|
|
const object2 = {};
|
|
object2.defineAnimation = (require(1650) /* metro dependency 1650 */).defineAnimation;
|
|
object2.isValidRubberBandConfig = (require(1686) /* metro dependency 1686 */).isValidRubberBandConfig;
|
|
object2.rubberBandDecay = (require(1687) /* metro dependency 1687 */).rubberBandDecay;
|
|
object2.rigidDecay = (require(1688) /* metro dependency 1688 */).rigidDecay;
|
|
object2.validateConfig = value;
|
|
const getReduceMotionForAnimation = (require(1650) /* metro dependency 1650 */).getReduceMotionForAnimation;
|
|
object2.getReduceMotionForAnimation = getReduceMotionForAnimation;
|
|
closure.__closure = object2;
|
|
closure.__workletHash = 3913201228611;
|
|
closure.__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)};});}"};
|
|
exports.withDecay = closure;
|
|
}
|
|
|
|
function _fun18408() { // fn#18408, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1812:714, offset: 0x00e8b315, size: 46 bytes, params: 1, frame: 2
|
|
const closure = validateConfig;
|
|
closure.__closure = {};
|
|
closure.__workletHash = 14532293098342;
|
|
closure.__initData = env0_2;
|
|
return closure;
|
|
}
|
|
|
|
function withDecay(a0, a1) { // fn#18410, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1812:3979, offset: 0x00e8b4e3, size: 204 bytes, params: 3, frame: 20
|
|
const env0_0 = a0;
|
|
const env0_1 = a1;
|
|
const moduleValue = require(1650) /* metro dependency 1650 */;
|
|
const defineAnimation = moduleValue.defineAnimation;
|
|
const closure = pnpm_decayTs3;
|
|
const object2 = {userConfig: a0};
|
|
object2.isValidRubberBandConfig = (require(1686) /* metro dependency 1686 */).isValidRubberBandConfig;
|
|
object2.rubberBandDecay = (require(1687) /* metro dependency 1687 */).rubberBandDecay;
|
|
object2.rigidDecay = (require(1688) /* metro dependency 1688 */).rigidDecay;
|
|
object2.validateConfig = env0_3;
|
|
object2.callback = a1;
|
|
const getReduceMotionForAnimation = moduleValue.getReduceMotionForAnimation;
|
|
object2.getReduceMotionForAnimation = getReduceMotionForAnimation;
|
|
closure.__closure = object2;
|
|
closure.__workletHash = 17099614658252;
|
|
closure.__initData = env0_4;
|
|
return Reflect.apply(defineAnimation, moduleValue, [0, closure]);
|
|
}
|
|
|
|
function validateConfig(a0) { // fn#18409, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1812:731, offset: 0x00e8b343, size: 416 bytes, params: 2, frame: 16
|
|
var Array;
|
|
var isArray;
|
|
var value;
|
|
const ReanimatedError = (require(1621) /* metro dependency 1621 */).ReanimatedError;
|
|
let clamp = a0.clamp;
|
|
if (clamp) {
|
|
Array = global.Array;
|
|
isArray = Array.isArray;
|
|
clamp = a0.clamp;
|
|
if (Reflect.apply(isArray, Array, [clamp])) {
|
|
if (a0.clamp.length !== 2) {
|
|
value = environment.__proto__;
|
|
value = '`clamp array` must contain 2 items but is given ' + a0.clamp.length + '.';
|
|
throw new ReanimatedError();
|
|
}
|
|
if (a0.velocityFactor <= 0) {
|
|
value = environment.__proto__;
|
|
value = '`config.velocityFactor` must be greater then 0 but is ' + a0.velocityFactor + '.';
|
|
throw new ReanimatedError();
|
|
}
|
|
if (a0.rubberBandEffect) {
|
|
if (a0.clamp) {
|
|
return undefined;
|
|
}
|
|
value = environment.__proto__;
|
|
throw new ReanimatedError('You need to set `clamp` property when using `rubberBandEffect`.');
|
|
}
|
|
return undefined;
|
|
}
|
|
value = environment.__proto__;
|
|
clamp = a0.clamp;
|
|
value = '`config.clamp` must be an array but is ' + typeof clamp + '.';
|
|
throw new ReanimatedError();
|
|
}
|
|
if (a0.velocityFactor <= 0) {
|
|
value = environment.__proto__;
|
|
value = '`config.velocityFactor` must be greater then 0 but is ' + a0.velocityFactor + '.';
|
|
throw new ReanimatedError();
|
|
}
|
|
if (a0.rubberBandEffect) {
|
|
if (a0.clamp) {
|
|
return undefined;
|
|
}
|
|
value = environment.__proto__;
|
|
throw new ReanimatedError('You need to set `clamp` property when using `rubberBandEffect`.');
|
|
}
|
|
}
|
|
|
|
function pnpm_decayTs3() { // fn#18411, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1812:4044, owner: withDecay.pnpm_decayTs3, offset: 0x00e8b5af, size: 234 bytes, params: 1, frame: 18
|
|
const object3 = {'deceleration': 0.998, 'velocityFactor': 1, 'velocity': 0, 'rubberBandFactor': 0.6};
|
|
const value = 0;
|
|
const env0_0 = object3;
|
|
if (env0_0) {
|
|
global.Object.keys(env0_0).forEach(_fun18412);
|
|
}
|
|
const object4 = {};
|
|
const moduleValue = require(1686) /* metro dependency 1686 */;
|
|
object4.onFrame = moduleValue.isValidRubberBandConfig(object3) ? _fun18413 : _fun18414;
|
|
object4.onStart = onStart_18415;
|
|
object4.callback = require;
|
|
object4.velocity = object3.velocity ?? value;
|
|
object4.initialVelocity = value;
|
|
object4.current = undefined;
|
|
object4.lastTimestamp = value;
|
|
object4.startTimestamp = value;
|
|
object4.reduceMotion = (require(1650) /* metro dependency 1650 */).getReduceMotionForAnimation(object3.reduceMotion);
|
|
return object4;
|
|
}
|
|
|
|
function _fun18412(a0) { // fn#18412, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1812:4179, offset: 0x00e8b699, size: 27 bytes, params: 2, frame: 3
|
|
const binding = env0_0;
|
|
const property = env1_0[a0];
|
|
binding[a0] = property;
|
|
return property;
|
|
}
|
|
|
|
function _fun18413(a0, a1) { // fn#18413, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1812:4255, offset: 0x00e8b6b4, size: 53 bytes, params: 3, frame: 15
|
|
const value = environment.__proto__.__proto__;
|
|
return (require(1687) /* metro dependency 1687 */).rubberBandDecay(a0, a1, env0_0);
|
|
}
|
|
|
|
function _fun18414(a0, a1) { // fn#18414, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1812:4308, offset: 0x00e8b6e9, size: 53 bytes, params: 3, frame: 15
|
|
const value = environment.__proto__.__proto__;
|
|
return (require(1688) /* metro dependency 1688 */).rigidDecay(a0, a1, env0_0);
|
|
}
|
|
|
|
function pnpm_decayTs3OnStart(a0, a1, a2) { // fn#18415, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1812:4364, owner: withDecay.pnpm_decayTs3.onStart, offset: 0x00e8b71e, size: 173 bytes, params: 4, frame: 15
|
|
const binding = env0_0;
|
|
const velocity = binding.velocity;
|
|
a0.current = a1;
|
|
a0.lastTimestamp = a2;
|
|
a0.startTimestamp = a2;
|
|
a0.initialVelocity = velocity;
|
|
a0.velocity = velocity;
|
|
env2_3(binding);
|
|
if (a0.reduceMotion && env0_0.clamp) {
|
|
if (a1 < env0_0.clamp[0]) {
|
|
a0.current = env0_0.clamp[0];
|
|
} else if (a1 > env0_0.clamp[1]) {
|
|
a0.current = env0_0.clamp[1];
|
|
}
|
|
}
|
|
}
|
|
|