/* Metro module 1228; source: stores/MobileCacheSnapshotStore.tsx; dependencies: [6, 7, 15, 17, 18, 694, 44, 587, 566, 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 defaultImport2 from '../by-id/module-00044.js'; /* Metro dependency 44 */ import Flux from '../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */ import Dispatcher from '../Dispatcher.tsx'; /* Metro dependency 694 */ import * as FileImportTrackerModule from '../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */ import * as StorageModule from '../external/discord_common/js/packages/storage/Storage.tsx'; /* Metro dependency 587 */ function _fun13772(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#13772, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1355:6, offset: 0x00df4835, size: 222 bytes, params: 8, frame: 19 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); const Store = (Flux).Store; const value = _fun13776(Store); value.allStores = []; (FileImportTrackerModule).fileFinishedImporting('stores/MobileCacheSnapshotStore.tsx'); exports.default = value; function _isNativeReflectConstruct_13773() { // fn#13773, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1355:148, offset: 0x00df4913, size: 94 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_13773_isNativeReflectConstruct = function() { return !!result; })(); } function _fun13776(a0) { // fn#13776, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1355:347, offset: 0x00df4971, size: 188 bytes, params: 2, frame: 17 const MobileCacheSnapshotStore2 = MobileCacheSnapshotStore; Inherits(MobileCacheSnapshotStore2, a0); return CreateClass(MobileCacheSnapshotStore2, [{key: 'persistKey', get: function() { return '' + this.getClass().displayName + '-snapshot'; }}, {key: 'clear', value: function() { var Storage = require(dependencyMap[7]).Storage; Storage.remove(this.persistKey); }}, {key: 'save', value: function() { var Storage = require(dependencyMap[7]).Storage; Storage.set(this.persistKey, this.takeSnapshot()); }}, {key: 'readSnapshot', value: value_13783}, {key: 'getClass', value: function() { return this.constructor; }}], [{key: 'clearAll', value: function() { MobileCacheSnapshotStore.allStores.forEach(_fun13786); }}]); function MobileCacheSnapshotStore(a0, a1) { // fn#13777, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1355:359, offset: 0x00df4a2d, size: 309 bytes, params: 3, frame: 26 var environment; let value = environment.__proto__; env1_3(this, MobileCacheSnapshotStore); const items2 = [Dispatcher]; const object = {}; copyDataProperties(object, a0, undefined); object['CLEAR_CACHES'] = CLEAR_CACHES; object['WRITE_CACHES'] = WRITE_CACHES; items2[1] = object; items2[2] = a1; const value3 = env1_6(MobileCacheSnapshotStore); value = env1_5(this, _isNativeReflectConstruct_13773() ? global.Reflect.construct(value3, items2, env1_6(this).constructor) : value3.apply(this, items2)); const getClass = value.getClass; defaultImport2(Reflect.apply(getClass, value, []).displayName != null, 'Snapshot stores need a display name'); defaultImport2(!('CLEAR_CACHES' in a0), "MobileCacheSnapshotStores cannot use the 'CLEAR_CACHES' action"); defaultImport2(!('WRITE_CACHES' in a0), "MobileCacheSnapshotStores cannot use the 'WRITE_CACHES' action"); MobileCacheSnapshotStore.allStores.push(value); return value; function CLEAR_CACHES() { // fn#13778, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1355:636, owner: MobileCacheSnapshotStore.CLEAR_CACHES, offset: 0x00df4b62, size: 21 bytes, params: 1, frame: 9 env0_0.clear(); return false; } function WRITE_CACHES() { // fn#13779, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1355:668, owner: MobileCacheSnapshotStore.WRITE_CACHES, offset: 0x00df4b77, size: 21 bytes, params: 1, frame: 9 env0_0.save(); return false; } } function value_13783(a0) { // fn#13783, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1355:1340, offset: 0x00df4c31, size: 83 bytes, params: 2, frame: 13 let value = environment.__proto__; const Storage = (StorageModule).Storage; value = Storage.get(this.persistKey); const value2 = null; return value2 == value || value.version !== a0 ? value2 : value.data; } function value_13785() { // fn#13785, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1355:1522, offset: 0x00df4c84, size: 34 bytes, params: 1, frame: 11 MobileCacheSnapshotStore.allStores.forEach(function(a0) { return a0.clear(); }); } } } function _fun13786(a0) { // fn#13786, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1355:1577, offset: 0x00df4ca6, size: 15 bytes, params: 2, frame: 9 return a0.clear(); } global.__d(_fun13772, 1228, [6, 7, 15, 17, 18, 694, 44, 587, 566, 2]) /* metro module 1228, dependencies: [6, 7, 15, 17, 18, 694, 44, 587, 566, 2] */;