/* Metro module 854; source: unknown; dependencies: [847, 839] */ import * as Module00847Module from './module-00847.js'; /* Metro dependency 847 */ function _fun9240(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#9240, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:981:6, offset: 0x00d60bdf, size: 104 bytes, params: 8, frame: 18 let env0_0 = require; const updateSession2 = updateSession; const Object = global.Object; const defineProperty = Object.defineProperty; const Symbol = global.Symbol; Reflect.apply(defineProperty, Object, [exports, Symbol.toStringTag, {value: 'Module'}]); exports.closeSession = function(a0, a1) { updateSession(a0, a1 ? {status: a1} : a0.status !== 'ok' ? {} : {status: 'exited'}); }; exports.makeSession = function(a0) { var value2 = require(dependencyMap[0]).timestampInSeconds(); var object = {'sid': null, 'init': true, 'timestamp': null, 'started': null, 'duration': 0, 'status': 'ok', 'errors': 0, 'ignoreDuration': false}; object.sid = require(dependencyMap[1]).uuid4(); object.timestamp = value2; object.started = value2; object.toJSON = _fun9244; var env0_0 = object; if (a0) { updateSession(object, a0); } return object; }; exports.updateSession = updateSession2; function updateSession(a0) { // fn#9241, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:981:30, offset: 0x00d60c47, size: 639 bytes, params: 2, frame: 16 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(847) /* metro dependency 847 */; 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(839) /* metro dependency 839 */; 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(a0) { // fn#9243, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:981:1214, offset: 0x00d60f07, size: 118 bytes, params: 2, frame: 18 const value2 = (Module00847Module).timestampInSeconds(); const object = {'sid': null, 'init': true, 'timestamp': null, 'started': null, 'duration': 0, 'status': 'ok', 'errors': 0, 'ignoreDuration': false}; object.sid = (require(839) /* metro dependency 839 */).uuid4(); object.timestamp = value2; object.started = value2; object.toJSON = toJSON_9244; if (a0) { updateSession(object, a0); } return object; function makeSessionToJSON() { // fn#9244, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:981:1383, owner: makeSession.toJSON, offset: 0x00d60f7d, size: 317 bytes, params: 1, frame: 16 const binding = env0_0; const object = {}; object.sid = '' + binding.sid; object.init = binding.init; let Date = global.Date; let value = 1000 * binding.started; const value2 = Object.create(Date.prototype, {constructor: {value: Date}}); let date = new Date(); object.started = (date instanceof Object ? date : value2).toISOString(); Date = global.Date; value = 1000 * binding.timestamp; const value3 = Object.create(Date.prototype, {constructor: {value: Date}}); date = new Date(); object.timestamp = (date instanceof Object ? date : value3).toISOString(); object.status = binding.status; object.errors = binding.errors; object.did = typeof binding.did === 'number' ? '' + binding.did : typeof binding.did !== 'string' ? undefined : '' + 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 object; } } } global.__d(_fun9240, 854, [847, 839]) /* metro module 854, dependencies: [847, 839] */;