246 lines
11 KiB
TypeScript
246 lines
11 KiB
TypeScript
/* Metro module 13259; source: modules/auth_sessions/AuthSessionsStore.tsx; dependencies: [6, 7, 15, 17, 18, 566, 694, 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 PossibleConstructorReturn from '../../by-id/module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */
|
|
import Module00017 from '../../by-id/module-00017.js'; /* Metro dependency 17 */
|
|
import Inherits from '../../by-id/module-00018-Inherits.js'; /* Metro dependency 18 */
|
|
import Flux from '../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
|
|
function _fun101098(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#101098, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13449:6, offset: 0x0220812c, size: 328 bytes, params: 8, frame: 19
|
|
const _arrayLikeToArray_101104 = 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 closure = function() {
|
|
env0_5 = [];
|
|
};
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let env0_5 = [];
|
|
const Store = (Flux).Store;
|
|
let value = _fun101106(Store);
|
|
value.displayName = 'AuthSessionsStore';
|
|
value = new value(importDefault(694) /* metro dependency 694: Dispatcher */, {LOGOUT: closure,
|
|
LOGIN_SUCCESS: closure, FETCH_AUTH_SESSIONS_SUCCESS: function({sessions}) {
|
|
env0_5 = sessions.map(_fun101110);
|
|
}, LOGOUT_AUTH_SESSIONS_SUCCESS: LOGOUT_AUTH_SESSIONS_SUCCESS});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/auth_sessions/AuthSessionsStore.tsx');
|
|
exports.default = value;
|
|
function _isNativeReflectConstruct_101099() { // fn#101099, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13449:150, offset: 0x02208274, size: 98 bytes, params: 1, frame: 18
|
|
var Boolean;
|
|
var prototype;
|
|
var valueOf;
|
|
var call;
|
|
var Reflect;
|
|
var construct;
|
|
var closure;
|
|
var value;
|
|
var error;
|
|
try {
|
|
Boolean = global.Boolean;
|
|
prototype = Boolean.prototype;
|
|
valueOf = prototype.valueOf;
|
|
call = valueOf.call;
|
|
Reflect = global.Reflect;
|
|
construct = Reflect.construct;
|
|
Boolean = global.Boolean;
|
|
closure = function() {
|
|
};
|
|
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
|
|
value = Reflect.apply(call, valueOf, [value]);
|
|
var result = !value;
|
|
} catch (error) {
|
|
}
|
|
return (_isNativeReflectConstruct_101099_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function _createForOfIteratorHelperLoose_101102(a0, a1) { // fn#101102, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13449:343, offset: 0x022082d6, size: 372 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 _fun101103;
|
|
}
|
|
value = undefined;
|
|
if (a0) {
|
|
if (typeof a0 === 'string') {
|
|
value = _arrayLikeToArray_101104(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_101104(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
|
if (regexp.test(r9)) {
|
|
value = _arrayLikeToArray_101104(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
r6 = value;
|
|
}
|
|
}
|
|
r5 = r6;
|
|
}
|
|
} else {
|
|
r5 = value;
|
|
}
|
|
if (r5) {
|
|
if (r5) {
|
|
}
|
|
return _fun101103;
|
|
}
|
|
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 _fun101103() { // fn#101103, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13449:914, offset: 0x00c39d73, size: 69 bytes, params: 1, frame: 5
|
|
return CreateClass >= env0_0.length ? {done: true} : {done: false,
|
|
value: env0_0[typeof CreateClass === 'bigint' ? CreateClass : +CreateClass]};
|
|
}
|
|
|
|
}
|
|
|
|
function _fun101106(a0) { // fn#101106, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13449:1295, offset: 0x0220844a, size: 72 bytes, params: 2, frame: 15
|
|
const AuthSessionsStore2 = AuthSessionsStore;
|
|
Inherits(AuthSessionsStore2, a0);
|
|
return CreateClass(AuthSessionsStore2, [{key: 'getSessions', value: value_101108}]);
|
|
function AuthSessionsStore() { // fn#101107, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13449:1307, offset: 0x00c7a0d6, size: 113 bytes, params: 1, frame: 20
|
|
const value = environment.__proto__;
|
|
env1_0(this, AuthSessionsStore);
|
|
const value3 = env1_3(AuthSessionsStore);
|
|
return env1_2(this, _isNativeReflectConstruct_101099() ? global.Reflect.construct(value3, arguments,
|
|
env1_3(this).constructor) : value3.apply(this, arguments));
|
|
}
|
|
|
|
function value_101108() { // fn#101108, offset: 0x00e40571, size: 9 bytes, params: 1, frame: 1
|
|
return env1_5;
|
|
}
|
|
|
|
}
|
|
|
|
function FETCH_AUTH_SESSIONS_SUCCESS({sessions}) { // fn#101109, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13449:1777, offset: 0x02208492, size: 39 bytes, params: 2, frame: 11
|
|
const value = sessions.map(function(a0) {
|
|
var r3;
|
|
var object = {};
|
|
copyDataProperties(object, a0, r3);
|
|
var Date = global.Date;
|
|
object['approx_last_used_time'] = new Date(a0.approx_last_used_time);
|
|
return object;
|
|
});
|
|
}
|
|
|
|
function LOGOUT_AUTH_SESSIONS_SUCCESS({sessionIdHashes}) { // fn#101111, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13449:1940, offset: 0x022084f5, size: 111 bytes, params: 2, frame: 20
|
|
var r6;
|
|
var value4;
|
|
var value5;
|
|
arraySpread([], env0_5, 0, undefined);
|
|
const LOGOUT_AUTH_SESSIONS_SUCCESS_loop2 = LOGOUT_AUTH_SESSIONS_SUCCESS_loop;
|
|
const value2 = _createForOfIteratorHelperLoose_101102(sessionIdHashes);
|
|
const value3 = value2();
|
|
let done = value3.done;
|
|
if (!done) {
|
|
r6 = value3;
|
|
reducibleLoop1: while (true) {
|
|
value4 = r6.value;
|
|
LOGOUT_AUTH_SESSIONS_SUCCESS_loop2(value4);
|
|
value5 = value2();
|
|
done = value5.done;
|
|
if (done) {
|
|
break reducibleLoop1;
|
|
}
|
|
r6 = value5;
|
|
continue reducibleLoop1;
|
|
}
|
|
}
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
return false;
|
|
function LOGOUT_AUTH_SESSIONS_SUCCESS_loop(a0) { // fn#101112, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13449:2032, owner: LOGOUT_AUTH_SESSIONS_SUCCESS._loop, offset: 0x02208564, size: 69 bytes, params: 2, frame: 14
|
|
const env0_0 = a0;
|
|
const index = env0_0.findIndex(_fun101113);
|
|
if (index >= 0) {
|
|
env0_0.splice(index, 1);
|
|
}
|
|
function _fun101113({id_hash}) { // fn#101113, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13449:2063, offset: 0x02208045, size: 22 bytes, params: 2, frame: 2
|
|
return id_hash === env0_0;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function _fun101110(a0) { // fn#101110, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13449:1840, offset: 0x022084b9, size: 60 bytes, params: 2, frame: 13
|
|
const object = {};
|
|
copyDataProperties(object, a0, undefined);
|
|
const Date = global.Date;
|
|
object['approx_last_used_time'] = new Date(a0.approx_last_used_time);
|
|
return object;
|
|
}
|
|
|
|
global.__d(_fun101098, 13259, [6, 7, 15, 17, 18, 566, 694,
|
|
2]) /* metro module 13259, dependencies: [6, 7, 15, 17, 18, 566, 694, 2] */;
|