138 lines
7.5 KiB
TypeScript
138 lines
7.5 KiB
TypeScript
/* Metro module 8477; source: modules/collectibles/profile_effects/useClock.tsx; dependencies: [31, 44, 4594, 2] */
|
|
import UseMountEffect from '../../../hooks/useMountEffect.tsx'; /* Metro dependency 4594 */
|
|
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
|
|
|
|
function _fun67302(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#67302, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8662:6, offset: 0x01c1d5ba, size: 117 bytes, params: 8, frame: 17
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/collectibles/profile_effects/useClock.tsx');
|
|
exports.default = _default_67303;
|
|
function _default_67303(a0) { // fn#67303, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8662:115, offset: 0x01c1d62f, size: 460 bytes, params: 2, frame: 24
|
|
const value = a1;
|
|
const env0_0 = a0;
|
|
const r1 = value !== undefined ? value : {};
|
|
let minInterval = r1.minInterval;
|
|
minInterval = minInterval === undefined ? 41.666666666666664 : minInterval;
|
|
const allowableMinInterval = r1.allowableMinInterval;
|
|
const allowableMinInterval2 = allowableMinInterval;
|
|
const droppedFramesCallbackThreshold = r1.droppedFramesCallbackThreshold;
|
|
const droppedFramesCallback = r1.droppedFramesCallback;
|
|
let droppedFramesResetTime = r1.droppedFramesResetTime;
|
|
droppedFramesResetTime = droppedFramesResetTime === undefined ? 3000 : droppedFramesResetTime;
|
|
const binding = allowableMinInterval2;
|
|
const env0_6 = binding.useRef(minInterval);
|
|
const env0_7 = binding.useRef(0);
|
|
const env0_8 = binding.useRef(undefined);
|
|
const env0_9 = binding.useRef(undefined);
|
|
const value2 = binding.useRef(true);
|
|
const env0_11 = binding.useRef(0);
|
|
const env0_12 = binding.useRef(undefined);
|
|
const value3 = binding.useCallback(_fun67304, []);
|
|
const value4 = binding.useCallback(_fun67305, []);
|
|
const value6 = binding.useCallback(_fun67307, [binding.useCallback(_fun67306, [allowableMinInterval, value3,
|
|
droppedFramesResetTime, droppedFramesCallbackThreshold, droppedFramesCallback, a0])]);
|
|
binding.useEffect(_fun67308, [minInterval]);
|
|
(UseMountEffect)(_fun67309);
|
|
return {stop: value4, reset: value6, ticking: value2};
|
|
function _fun67304() { // fn#67304, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8662:403, offset: 0x01c1d7fb, size: 68 bytes, params: 1, frame: 12
|
|
env0_11.current = 0;
|
|
if (env0_12.current != null) {
|
|
global.clearTimeout(env0_12.current);
|
|
env0_12.current = undefined;
|
|
}
|
|
}
|
|
|
|
function _fun67305() { // fn#67305, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8662:503, offset: 0x01c1d83f, size: 61 bytes, params: 1, frame: 13
|
|
env0_10.current = false;
|
|
global.cancelAnimationFrame(env0_7.current);
|
|
global.clearTimeout(env0_12.current);
|
|
}
|
|
|
|
function _fun67306(a0) { // fn#67306, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8662:600, offset: 0x01c1d87c, size: 417 bytes, params: 2, frame: 20
|
|
var allowableMinInterval2;
|
|
var value2;
|
|
var value3;
|
|
var Math;
|
|
var min;
|
|
var binding;
|
|
var value6;
|
|
var defaultImport;
|
|
var droppedFramesCallbackBinding;
|
|
let current = env0_10.current;
|
|
if (current) {
|
|
current = env0_8.current;
|
|
if (current == null) {
|
|
env0_8.current = a0;
|
|
}
|
|
current = env0_9.current;
|
|
if (current == null) {
|
|
env0_9.current = a0;
|
|
}
|
|
current = env0_9.current;
|
|
value2 = a0 - current;
|
|
current = env0_8.current;
|
|
value3 = a0 - current;
|
|
Math = global.Math;
|
|
min = Math.min;
|
|
allowableMinInterval2 = allowableMinInterval ?? 120;
|
|
current = env0_6.current;
|
|
if (value3 > 1.5 * Reflect.apply(min, Math, [allowableMinInterval2, current])) {
|
|
binding = env0_11;
|
|
current = binding.current;
|
|
binding.current = current + 1;
|
|
current = env0_12.current;
|
|
if (current != null) {
|
|
global.clearTimeout(env0_12.current);
|
|
}
|
|
binding = env0_12;
|
|
binding.current = global.setTimeout(env0_13, droppedFramesResetTime);
|
|
if (droppedFramesCallbackThreshold != null) {
|
|
if (env0_11.current > droppedFramesCallbackThreshold) {
|
|
value6 = environment.__proto__;
|
|
defaultImport = importDefault(44) /* metro dependency 44 */;
|
|
droppedFramesCallbackBinding = droppedFramesCallback;
|
|
defaultImport(droppedFramesCallbackBinding != null,
|
|
'useClock - If you set a dropped frames threshold, you must provide a droppedFramesCallback to do something when that threshold is hit');
|
|
if (droppedFramesCallbackBinding()) {
|
|
env0_11.current = 0;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
env0_8.current = a0;
|
|
current = env0_6.current;
|
|
if (value2 >= current - 3) {
|
|
env0_9.current = a0;
|
|
env0_0(value2);
|
|
}
|
|
binding = env0_7;
|
|
binding.current = global.requestAnimationFrame(env0_15);
|
|
}
|
|
}
|
|
|
|
function _fun67307() { // fn#67307, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8662:1144, offset: 0x01c1da1d, size: 56 bytes, params: 1, frame: 12
|
|
env0_10.current = true;
|
|
env0_9.current = undefined;
|
|
env0_7.current = global.requestAnimationFrame(env0_15);
|
|
}
|
|
|
|
function _fun67308() { // fn#67308, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8662:1241, offset: 0x01c1da55, size: 21 bytes, params: 1, frame: 2
|
|
env0_6.current = minInterval;
|
|
}
|
|
|
|
function _fun67309() { // fn#67309, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8662:1274, offset: 0x01c1da6a, size: 43 bytes, params: 1, frame: 12
|
|
env0_7.current = global.requestAnimationFrame(env0_15);
|
|
return _fun67310;
|
|
function _fun67310() { // fn#67310, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8662:1314, offset: 0x01c1da95, size: 15 bytes, params: 1, frame: 9
|
|
return env1_14();
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun67302, 8477, [31, 44, 4594, 2]) /* metro module 8477, dependencies: [31, 44, 4594, 2] */;
|