Files
2026-07-28 01:06:53 +03:00

166 lines
7.1 KiB
JavaScript

/* Metro module 7392; source: unknown; dependencies: [7368, 7369, 7393, 7383, 7380, 7375] */
import * as DEBUG_BUILDModule from './module-07368-DEBUG_BUILD.js'; /* Metro dependency 7368 */
import * as Module07369Module from './module-07369.js'; /* Metro dependency 7369 */
import * as Module07375Module from './module-07375.js'; /* Metro dependency 7375 */
import * as Module07383Module from './module-07383.js'; /* Metro dependency 7383 */
import * as Module07393Module from './module-07393.js'; /* Metro dependency 7393 */
function _fun59559(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#59559, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7570:6, offset: 0x016ecb8a, size: 127 bytes, params: 8, frame: 19
let env0_0 = require;
const updateSession_595602 = updateSession_59560;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
DEBUG_BUILDModule;
Module07369Module;
Module07393Module;
exports.closeSession = function(a0, a1) {
updateSession_59560(a0, a1 ? {status: a1} : a0.status !== 'ok' ? {} : {status: 'exited'});
};
exports.makeSession = function(a0) {
var value2 = require(dependencyMap[3]).timestampInSeconds();
var object = {'sid': null, 'init': true, 'timestamp': null, 'started': null, 'duration': 0, 'status': 'ok',
'errors': 0, 'ignoreDuration': false};
object.sid = require(dependencyMap[4]).uuid4();
object.timestamp = value2;
object.started = value2;
object.toJSON = _fun59563;
var env0_0 = object;
if (a0) {
updateSession_59560(object, a0);
}
return object;
};
exports.updateSession = updateSession_595602;
function updateSession_59560(a0) { // fn#59560, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7570:30, offset: 0x016ecc09, size: 643 bytes, params: 2, frame: 15
var r3;
var did;
var value;
var value2;
const r1 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
const user = r1.user;
if (user) {
r3 = !a0.ipAddress && r1.user.ip_address;
if (r3) {
a0.ipAddress = r1.user.ip_address;
}
did = a0.did;
did = !did ? r1.did : did;
if (!did) {
r3 = r1.user.id || r1.user.email;
r3 = !r3 ? r1.user.username : r3;
a0.did = r3;
}
}
const timestamp = r1.timestamp;
if (timestamp) {
r3 = timestamp;
} else {
value = require(7383) /* metro dependency 7383 */;
value = value.timestampInSeconds();
r3 = value;
}
a0.timestamp = r3;
if (r1.abnormal_mechanism) {
a0.abnormal_mechanism = r1.abnormal_mechanism;
}
if (r1.ignoreDuration) {
a0.ignoreDuration = r1.ignoreDuration;
}
if (r1.sid) {
if (r1.sid.length === 32) {
r3 = r1.sid;
} else {
value = require(7380) /* metro dependency 7380 */;
value = value.uuid4();
r3 = value;
}
a0.sid = r3;
}
if (r1.init !== undefined) {
a0.init = r1.init;
}
if (!a0.did && r1.did) {
a0.did = '' + r1.did;
}
if (typeof r1.started === 'number') {
a0.started = r1.started;
}
if (a0.ignoreDuration) {
a0.duration = undefined;
} else if (typeof r1.duration === 'number') {
a0.duration = r1.duration;
} else {
value = a0.timestamp - a0.started;
value2 = 0;
a0.duration = value >= value2 ? value : value2;
}
if (r1.release) {
a0.release = r1.release;
}
if (r1.environment) {
a0.environment = r1.environment;
}
if (!a0.ipAddress && r1.ipAddress) {
a0.ipAddress = r1.ipAddress;
}
const userAgent = a0.userAgent;
if (!userAgent && r1.userAgent) {
a0.userAgent = r1.userAgent;
}
if (typeof r1.errors === 'number') {
a0.errors = r1.errors;
}
if (r1.status) {
a0.status = r1.status;
}
}
function makeSession_59562(a0) { // fn#59562, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7570:1226, offset: 0x016ece8c, size: 119 bytes, params: 2, frame: 18
const value2 = (Module07383Module).timestampInSeconds();
const object = {'sid': null, 'init': true, 'timestamp': null, 'started': null, 'duration': 0, 'status': 'ok',
'errors': 0, 'ignoreDuration': false};
object.sid = (require(7380) /* metro dependency 7380 */).uuid4();
object.timestamp = value2;
object.started = value2;
object.toJSON = toJSON_59563;
if (a0) {
updateSession_59560(object, a0);
}
return object;
function makeSession_59562ToJSON() { // fn#59563, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7570:1395, owner: makeSession_59562.toJSON, offset: 0x016ecf03, size: 353 bytes, params: 1, frame: 19
var environment;
const binding = env0_0;
let value = environment.__proto__;
value = undefined;
const dropUndefinedKeys = Module07375Module.dropUndefinedKeys;
const object = {};
object.sid = '' + binding.sid;
object.init = binding.init;
let Date = global.Date;
const value2 = 1000 * binding.started;
const value3 = Object.create(Date.prototype, {constructor: {value: Date}});
let date = new Date(value2);
object.started = (date instanceof Object ? date : value3).toISOString();
Date = global.Date;
const value5 = 1000 * binding.timestamp;
const value6 = Object.create(Date.prototype, {constructor: {value: Date}});
date = new Date(value5);
object.timestamp = (date instanceof Object ? date : value6).toISOString();
object.status = binding.status;
object.errors = binding.errors;
object.did = typeof binding.did === 'number' ? '' + binding.did : typeof binding.did !== 'string' ? value : '' + binding.did;
object.duration = binding.duration;
object.abnormal_mechanism = binding.abnormal_mechanism;
const userAgent = binding.userAgent;
object.attrs = {release: binding.release, environment: binding.environment, ip_address: binding.ipAddress,
user_agent: userAgent};
return Reflect.apply(dropUndefinedKeys, Module07375Module, [object]);
}
}
}
global.__d(_fun59559, 7392, [7368, 7369, 7393, 7383, 7380,
7375]) /* metro module 7392, dependencies: [7368, 7369, 7393, 7383, 7380, 7375] */;