Files
discord-decomp/sources/lib/SoundshareStatsAggregator.tsx
2026-07-28 01:06:53 +03:00

81 lines
4.7 KiB
TypeScript

/* Metro module 4403; source: lib/SoundshareStatsAggregator.tsx; dependencies: [6, 7, 2] */
import ClassCallCheck from '../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */
import CreateClass from '../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */
import * as FileImportTrackerModule from '../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
function _fun37422(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#37422, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4575:6, offset: 0x010a4ac6, size: 124 bytes, params: 8, frame: 18
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const value = _fun37423();
(FileImportTrackerModule).fileFinishedImporting('lib/SoundshareStatsAggregator.tsx');
exports.default = value;
function _fun37423() { // fn#37423, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4575:118, offset: 0x010a4b42, size: 80 bytes, params: 1, frame: 15
return CreateClass(SoundshareStatsAggregator, [{key: 'traceEvent', value: value_37425}, {key: 'getStats',
value: function() {
var r2;
var object = {};
copyDataProperties(object, this._report, r2);
object['soundshare_unique_pids'] = this._pids.size;
return object;
}}]);
function SoundshareStatsAggregator() { // fn#37424, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4575:139, offset: 0x010a4b92, size: 81 bytes, params: 1, frame: 13
const value = environment.__proto__;
env1_0(this, SoundshareStatsAggregator);
this._report = {'soundshare_attach_requested_count': 0, 'soundshare_capturing_count': 0,
'soundshare_capture_stopped_count': 0, 'soundshare_hooked_count': 0, 'soundshare_recv_connect_count': 0,
'soundshare_recv_disconnect_count': 0, 'soundshare_recv_started_count': 0, 'soundshare_recv_stopped_count': 0,
'soundshare_recv_failed_count': 0, 'soundshare_recv_format_count': 0, 'soundshare_send_announce_count': 0,
'soundshare_send_start_count': 0, 'soundshare_send_stop_count': 0, 'soundshare_malformed_trace_count': 0,
'soundshare_audio_detected_count': 0, 'soundshare_state_transition_detached_count': 0,
'soundshare_state_transition_waiting_count': 0, 'soundshare_state_transition_attached_count': 0,
'soundshare_state_transition_started_count': 0, 'soundshare_state_transition_playing_count': 0,
'soundshare_state_transition_silence_count': 0, 'soundshare_unknown_event_count': 0, 'soundshare_first_pid': 0,
'soundshare_last_pid': 0, 'soundshare_unique_pids': 0, 'soundshare_first_session': null,
'soundshare_last_session': null};
const Set = global.Set;
this._pids = new Set();
}
}
}
function value_37425(a0, a1) { // fn#37425, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4575:1179, offset: 0x010a4be3, size: 264 bytes, params: 3, frame: 18
var property;
var soundshare_unknown_event_count;
var pid;
var _pids;
var add;
const _report = this._report;
const r6 = a1.type === 'soundshare_state_transition' ? 'soundshare_state_transition_' + ['detached', 'waiting',
'attached', 'started', 'playing', 'silence'][a1.newState] + '_count' : '' + a1.type + '_count';
if (_report[r6] !== undefined) {
if (_report[r6] < 32767) {
property = _report[r6];
_report[r6] = typeof property === 'bigint' ? property + 1n : +property + 1;
}
} else {
soundshare_unknown_event_count = _report.soundshare_unknown_event_count;
_report.soundshare_unknown_event_count = typeof soundshare_unknown_event_count === 'bigint' ? soundshare_unknown_event_count + 1n : +soundshare_unknown_event_count + 1;
}
if ('pid' in a1) {
if (_report.soundshare_first_pid === 0) {
_report.soundshare_first_pid = a1.pid;
}
pid = a1.pid;
_report.soundshare_last_pid = pid;
_pids = this._pids;
add = _pids.add;
pid = a1.pid;
Reflect.apply(add, _pids, [pid]);
}
if (a0 != null) {
if (_report.soundshare_first_session == null) {
_report.soundshare_first_session = a0;
}
_report.soundshare_last_session = a0;
}
}
global.__d(_fun37422, 4403, [6, 7, 2]) /* metro module 4403, dependencies: [6, 7, 2] */;