209 lines
7.8 KiB
TypeScript
209 lines
7.8 KiB
TypeScript
/* Metro module 7131; source: lib/Histogram.tsx; dependencies: [6, 7, 7132, 2] */
|
|
function _fun57033(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#57033, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7309:6, offset: 0x013da7e7, size: 150 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const _arrayLikeToArray_57036 = function(a0, a1) {
|
|
var r0;
|
|
var r1;
|
|
var r2;
|
|
var value3;
|
|
var length;
|
|
var value5;
|
|
var value = undefined;
|
|
var value2 = value == null;
|
|
reducibleJoin2: while (true) {
|
|
if (value2) {
|
|
r0 = value2;
|
|
break reducibleJoin2;
|
|
}
|
|
value3 = value > a0.length;
|
|
r0 = value3;
|
|
break reducibleJoin2;
|
|
}
|
|
reducibleJoin4: while (true) {
|
|
if (r0) {
|
|
length = a0.length;
|
|
r1 = length;
|
|
break reducibleJoin4;
|
|
}
|
|
r1 = value;
|
|
break reducibleJoin4;
|
|
}
|
|
value = (0, global.Array)(r1);
|
|
var value4 = 0;
|
|
if (value4 < r1) {
|
|
r2 = value4;
|
|
reducibleLoop5: while (true) {
|
|
value[r2] = a0[r2];
|
|
value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
|
|
if (value5 < r1) {
|
|
r2 = value5;
|
|
continue reducibleLoop5;
|
|
}
|
|
break reducibleLoop5;
|
|
}
|
|
}
|
|
return value;
|
|
};
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_2 = importDefault(6) /* metro dependency 6 */;
|
|
const env0_3 = importDefault(7) /* metro dependency 7 */;
|
|
let value = _fun57037();
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('lib/Histogram.tsx');
|
|
exports.Histogram = value;
|
|
}
|
|
|
|
function _createForOfIteratorHelperLoose_57034(a0, a1) { // fn#57034, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7309:120, offset: 0x013da87d, size: 370 bytes, params: 3, frame: 20
|
|
var r6;
|
|
var r9;
|
|
var r5;
|
|
var value3;
|
|
var regexp;
|
|
const env0_0 = a0;
|
|
const Symbol = global.Symbol;
|
|
let value = typeof Symbol !== 'undefined';
|
|
let r1 = value && a0[global.Symbol.iterator];
|
|
r1 = !r1 ? a0['@@iterator'] : r1;
|
|
if (r1) {
|
|
value = r1.call(a0);
|
|
return value.next.bind(value);
|
|
}
|
|
const Array = global.Array;
|
|
if (Array.isArray(a0)) {
|
|
if (r1) {
|
|
}
|
|
return _fun57035;
|
|
}
|
|
value = undefined;
|
|
if (a0) {
|
|
if (typeof a0 === 'string') {
|
|
value = _arrayLikeToArray_57036(a0, value);
|
|
r5 = value;
|
|
} else {
|
|
value3 = ({}).toString.call(a0).slice(8, -1);
|
|
r6 = value3 === 'Object' && a0.constructor;
|
|
r9 = r6 ? a0.constructor.name : value3;
|
|
if (r9 === 'Map') {
|
|
r6 = global.Array.from(a0);
|
|
} else if (r9 === 'Set') {
|
|
r6 = global.Array.from(a0);
|
|
} else if (r9 === 'Arguments') {
|
|
value = _arrayLikeToArray_57036(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
|
if (regexp.test(r9)) {
|
|
value = _arrayLikeToArray_57036(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
r6 = value;
|
|
}
|
|
}
|
|
r5 = r6;
|
|
}
|
|
} else {
|
|
r5 = value;
|
|
}
|
|
if (r5) {
|
|
if (r5) {
|
|
}
|
|
return _fun57035;
|
|
}
|
|
const TypeError = global.TypeError;
|
|
throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
|
|
}
|
|
|
|
function _fun57037() { // fn#57037, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7309:1036, offset: 0x013da9ef, size: 147 bytes, params: 1, frame: 15
|
|
return env0_3(Histogram, [{key: 'getSamples', value: function() {
|
|
return this.samples;
|
|
}}, {key: 'addSample', value: value_57040}, {key: 'addSamples', value: value_57041}, {key: 'getReport',
|
|
value: value_57043}, {key: 'getPercentile', value: function(a0) {
|
|
return this.digest.percentile(a0 / 100) ?? 0;
|
|
}}]);
|
|
}
|
|
|
|
function Histogram() { // fn#57038, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7309:1057, offset: 0x013daa82, size: 99 bytes, params: 1, frame: 14
|
|
const value = environment.__proto__;
|
|
env1_2(this, Histogram);
|
|
const Digest = (require(7132) /* metro dependency 7132 */).Digest;
|
|
this.digest = new Digest();
|
|
this.total = 0;
|
|
this.samples = 0;
|
|
this.totalWeight = 0;
|
|
}
|
|
|
|
function value_57040(a0) { // fn#57040, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7309:1259, offset: 0x013daaf0, size: 144 bytes, params: 2, frame: 17
|
|
let value = a1;
|
|
const r5 = value !== undefined ? value : 1;
|
|
this.total = this.total + a0 * r5;
|
|
this.totalWeight = this.totalWeight + r5;
|
|
const samples = this.samples;
|
|
this.samples = typeof samples === 'bigint' ? samples + 1n : +samples + 1;
|
|
value = environment.__proto__;
|
|
const TDigest = (require(7132) /* metro dependency 7132 */).TDigest;
|
|
const push = TDigest.prototype.push;
|
|
push.call(this.digest, a0, r5);
|
|
this.digest.check_continuous();
|
|
}
|
|
|
|
function value_57041(a0) { // fn#57041, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7309:1437, offset: 0x013dab80, size: 180 bytes, params: 2, frame: 18
|
|
var environment;
|
|
let value = a1;
|
|
const r5 = value !== undefined ? value : 1;
|
|
this.total = this.total + a0.reduce(_fun57042, 0);
|
|
this.totalWeight = this.totalWeight + r5 * a0.length;
|
|
this.samples = this.samples + a0.length;
|
|
value = environment.__proto__;
|
|
const TDigest = (require(7132) /* metro dependency 7132 */).TDigest;
|
|
const push = TDigest.prototype.push;
|
|
push.call(this.digest, a0, r5);
|
|
this.digest.check_continuous();
|
|
}
|
|
|
|
function value_57043() { // fn#57043, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7309:1654, offset: 0x013dac4b, size: 268 bytes, params: 1, frame: 20
|
|
var r5;
|
|
var r0;
|
|
var value4;
|
|
var digest;
|
|
var value5;
|
|
var value6;
|
|
let value = a0;
|
|
const r2 = value !== undefined ? value : [25, 50, 75, 90, 95];
|
|
const object3 = {};
|
|
value = environment.__proto__;
|
|
value = _createForOfIteratorHelperLoose_57034(r2);
|
|
const value2 = value();
|
|
let done = value2.done;
|
|
const value3 = 0;
|
|
if (!done) {
|
|
r5 = value2;
|
|
while (true) {
|
|
value4 = r5.value;
|
|
digest = this.digest;
|
|
value5 = digest.percentile(value4 / 100);
|
|
r0 = value5 ?? value3;
|
|
object3[value4] = r0;
|
|
value6 = value();
|
|
done = value6.done;
|
|
if (done) {
|
|
break;
|
|
}
|
|
r5 = value6;
|
|
continue;
|
|
}
|
|
}
|
|
const object4 = {};
|
|
object4.min = this.digest.percentile(value3) ?? value3;
|
|
object4.max = this.digest.percentile(1) ?? value3;
|
|
object4.count = this.digest.size() ?? value3;
|
|
object4.percentiles = object3;
|
|
object4.mean = this.totalWeight > value3 ? this.total / this.totalWeight : value3;
|
|
object4.samples = this.samples;
|
|
return object4;
|
|
}
|
|
|
|
function _fun57042(a0, a1) { // fn#57042, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7309:1475, offset: 0x013dac34, size: 23 bytes, params: 3, frame: 2
|
|
return a0 + a1 * env0_0;
|
|
}
|
|
|