Files
discord-decomp/sources/by-id/module-06379.jsx
T
2026-07-27 16:20:00 +03:00

71 lines
3.2 KiB
React

/* Metro module 6379; source: unknown; dependencies: [6374, 6375] */
function _fun49974(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#49974, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6557:6, offset: 0x0120e5a7, size: 112 bytes, params: 8, frame: 18
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_0 = importDefault(6374) /* metro dependency 6374 */;
const env0_1 = importDefault(6375) /* metro dependency 6375 */;
const value = _fun49975();
const value2 = _fun49980();
exports.AverageWindow = value;
exports.MultiTypeAverageWindow = value2;
}
function _fun49975() { // fn#49975, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6557:118, offset: 0x0120e617, size: 101 bytes, params: 1, frame: 15
return env0_1(AverageWindow, [{key: 'currentValue', get: function() {
return this.currentAverage;
}}, {key: 'addValue', value: function(a0) {
var r1;
var value = this.getNextIndex();
var property = this.inputValues[value];
r1 = property === undefined ? this.currentCount + 1 : this.currentCount;
this.inputValues[value] = a0;
this.currentAverage = this.currentAverage * (this.currentCount / r1) + (a0 - (property ?? 0)) / r1;
this.currentCount = r1;
}}, {key: 'getNextIndex', value: function() {
var nextIndex = this.nextIndex;
this.nextIndex = (this.nextIndex + 1) % this.inputValues.length;
return nextIndex;
}}]);
}
function _fun49980() { // fn#49980, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6557:854, offset: 0x0120e7c4, size: 101 bytes, params: 1, frame: 15
return env0_1(MultiTypeAverageWindow, [{key: 'addValue', value: value_49982}, {key: 'getCurrentValue',
value: function(a0) {
var r1;
r1 = this.averageWindows.get(a0)?.currentValue;
r1 = r1 ?? this.defaultValue;
return r1 ?? 0;
}}, {key: 'reset', value: function() {
this.averageWindows.clear();
}}]);
}
function MultiTypeAverageWindow(a0, a1) { // fn#49981, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6557:875, offset: 0x0120e829, size: 79 bytes, params: 3, frame: 13
const value = environment.__proto__;
env1_0(this, MultiTypeAverageWindow);
const Map = global.Map;
this.averageWindows = new Map();
this.windowSize = a0;
this.defaultValue = a1;
}
function value_49982(a0, a1) { // fn#49982, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6557:1034, offset: 0x0120e878, size: 96 bytes, params: 3, frame: 15
var r2;
var binding;
var windowSize;
var binding2;
let value = this.averageWindows.get(a1);
if (value) {
r2 = value;
} else {
value = environment.__proto__;
binding = env1_2;
windowSize = this.windowSize;
binding2 = new binding();
this.averageWindows.set(a1, binding2);
r2 = binding2;
}
r2.addValue(a0);
}