/* Metro module 15814; source: modules/push_notifications/native/PushNotificationCacheManager.tsx; dependencies: [7, 6, 15, 17, 18, 11876, 1878, 3995, 10741, 4860, 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 UserStore from '../../../stores/UserStore.tsx'; /* Metro dependency 1878 */ import AutomaticLifecycleManager from '../../../lib/AutomaticLifecycleManager.tsx'; /* Metro dependency 4860 */ import PushNotification from '../../../lib/pushnotification/PushNotification.tsx'; /* Metro dependency 10741 */ import MultiAccountStore from '../../multi_account/MultiAccountStore.tsx'; /* Metro dependency 11876 */ import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */ function _fun121530(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#121530, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16022:6, offset: 0x0254a3e7, size: 258 bytes, params: 8, frame: 18 const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); let value = AutomaticLifecycleManager; value = _fun121534(value); value = new value(); (FileImportTrackerModule).fileFinishedImporting('modules/push_notifications/native/PushNotificationCacheManager.tsx'); exports.default = value; function _isNativeReflectConstruct_121531() { // fn#121531, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16022:168, offset: 0x0254a4e9, 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_121531_isNativeReflectConstruct = function() { return !!result; })(); } function _fun121534(a0) { // fn#121534, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16022:371, offset: 0x0254a54b, size: 42 bytes, params: 2, frame: 14 const PushNotificationCacheManager2 = PushNotificationCacheManager; Inherits(PushNotificationCacheManager2, a0); return CreateClass(PushNotificationCacheManager2); function PushNotificationCacheManager(a0) { // fn#121535, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16022:383, offset: 0x0254a575, size: 283 bytes, params: 2, frame: 21 var r0; var Reflect; let value = copyRestArgs(0, undefined); let binding = env1_3; binding(this, PushNotificationCacheManager); const items2 = []; arraySpread(items2, value, 0, items2); value = env1_5(PushNotificationCacheManager); binding = env1_4; if (_isNativeReflectConstruct_121531()) { Reflect = global.Reflect; value = Reflect.construct(value, items2, env1_5(this).constructor); r0 = value; } else { value = value.apply(this, items2); r0 = value; } value = binding(this, r0); value.actions = {POST_CONNECTION_OPEN: POST_CONNECTION_OPEN_121536, CURRENT_USER_UPDATE: CURRENT_USER_UPDATE_121537, LOGOUT: LOGOUT_121538}; const Map = global.Map; const items3 = [[MultiAccountStore, _fun121539]]; const value4 = Object.create(Map.prototype, {constructor: {value: Map}}); const map = new Map(items3); value.stores = map instanceof Object ? map : value4; value.handleUserUpdate = handleUserUpdate_121540; value.syncMultiAccountUsers = syncMultiAccountUsers; value.handleLogout = handleLogout_121544; return value; function PushNotificationCacheManagerPOST_CONNECTION_OPEN() { // fn#121536, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16022:685, owner: PushNotificationCacheManager.POST_CONNECTION_OPEN, offset: 0x0254a690, size: 19 bytes, params: 1, frame: 9 return env0_0.handleUserUpdate(); } function PushNotificationCacheManagerCURRENT_USER_UPDATE() { // fn#121537, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16022:730, owner: PushNotificationCacheManager.CURRENT_USER_UPDATE, offset: 0x0254a690, size: 19 bytes, params: 1, frame: 9 return env0_0.handleUserUpdate(); } function PushNotificationCacheManagerLOGOUT() { // fn#121538, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16022:762, owner: PushNotificationCacheManager.LOGOUT, offset: 0x022ad16f, size: 19 bytes, params: 1, frame: 9 return env0_0.handleLogout(); } function _fun121539() { // fn#121539, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16022:805, offset: 0x0254a6a3, size: 19 bytes, params: 1, frame: 9 return env0_0.syncMultiAccountUsers(); } function PushNotificationCacheManagerHandleUserUpdate() { // fn#121540, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16022:857, owner: PushNotificationCacheManager.handleUserUpdate, offset: 0x0254a6b6, size: 107 bytes, params: 1, frame: 15 let value = environment.__proto__.__proto__; const currentUser = UserStore.getCurrentUser(); if (currentUser != null) { value = importDefault(10741) /* metro dependency 10741: PushNotification */; value.setCurrentUser(currentUser.username, currentUser.id); } else { (importDefault(10741) /* metro dependency 10741: PushNotification */).setCurrentUser(null, null); } } function syncMultiAccountUsers() { // fn#121541, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16022:994, owner: PushNotificationCacheManager.syncMultiAccountUsers, offset: 0x0254a721, size: 51 bytes, params: 1, frame: 12 var environment; const value = environment.__proto__.__proto__; (PushNotification).setMultiAccountUsers(buildMultiAccountUsers()); function buildMultiAccountUsers() { // fn#121542, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16022:1028, owner: PushNotificationCacheManager.syncMultiAccountUsers.buildMultiAccountUsers, offset: 0x0254a754, size: 77 bytes, params: 1, frame: 12 var environment; let value = environment.__proto__.__proto__.__proto__; if (MultiAccountStore.canUseMultiAccountNotifications) { value = MultiAccountStore.getValidUsers(); if (value.length < 2) { return {}; } value.forEach(_fun121543); } return {}; function _fun121543(a0) { // fn#121543, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16022:1183, offset: 0x0254a7a1, size: 69 bytes, params: 2, frame: 17 const binding = env0_0; const id = a0.id; let value = environment.__proto__.__proto__.__proto__.__proto__; value = importDefault(3995) /* metro dependency 3995: UserUtils */; const getUserTag = value.getUserTag; binding[id] = Reflect.apply(getUserTag, value, [a0, {identifiable: 'always'}]); } } } function PushNotificationCacheManagerHandleLogout() { // fn#121544, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16022:1266, owner: PushNotificationCacheManager.handleLogout, offset: 0x0254a7e6, size: 54 bytes, params: 1, frame: 11 const value = environment.__proto__.__proto__; (PushNotification).clearPushNotificationLogs(); env0_0.handleUserUpdate(); } } } } global.__d(_fun121530, 15814, [7, 6, 15, 17, 18, 11876, 1878, 3995, 10741, 4860, 2]) /* metro module 15814, dependencies: [7, 6, 15, 17, 18, 11876, 1878, 3995, 10741, 4860, 2] */;