/* Metro module 4042; source: modules/guild_themes/GuildThemeRuntimeStore.tsx; dependencies: [6, 7, 15, 17, 18, 1867, 3969, 1866, 22, 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 GuildStore from '../../stores/GuildStore.tsx'; /* Metro dependency 1867 */ import SelectedGuildStore from '../../stores/SelectedGuildStore.tsx'; /* Metro dependency 3969 */ import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */ function _fun33341(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#33341, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4200:6, offset: 0x0102c9dd, size: 411 bytes, params: 8, frame: 21 const env0_0 = require; const CACHE_LOADED_333482 = CACHE_LOADED_33348; const GUILD_SETTINGS_GUILD_THEME_SAVE_SUCCESS_333502 = GUILD_SETTINGS_GUILD_THEME_SAVE_SUCCESS_33350; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); const Store = (Flux).Store; let value = _fun33351(Store); value.displayName = 'GuildThemeRuntimeStore'; value = new value(importDefault(694) /* metro dependency 694: Dispatcher */, {CACHE_LOADED: CACHE_LOADED_333482, CACHE_LOADED_LAZY: CACHE_LOADED_333482, CHANNEL_SELECT: CHANNEL_SELECT_33355, CONNECTION_OPEN: CACHE_LOADED_333482, GUILD_DELETE: function({guild}) { return snapshotSelectedGuildAfterSelectedGuildChange(guild.id); }, GUILD_MEMBER_REMOVE: function({guildId}) { return snapshotSelectedGuildAfterSelectedGuildChange(guildId); }, GUILD_SETTINGS_GUILD_THEME_SAVE_SUCCESS: GUILD_SETTINGS_GUILD_THEME_SAVE_SUCCESS_333502, GUILD_THEME_PREVIEW_SAVE_SUCCESS: GUILD_SETTINGS_GUILD_THEME_SAVE_SUCCESS_333502, OVERLAY_INITIALIZE: CACHE_LOADED_333482, LOGOUT: function() { return clearSelectedGuildThemeSnapshot(); }}); (FileImportTrackerModule).fileFinishedImporting('modules/guild_themes/GuildThemeRuntimeStore.tsx'); exports.default = value; function _isNativeReflectConstruct_33342() { // fn#33342, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4200:168, offset: 0x0102cb78, 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_33342_isNativeReflectConstruct = function() { return !!result; })(); } function clearSelectedGuildThemeSnapshot() { // fn#33345, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4200:372, offset: 0x0102cbd6, size: 24 bytes, params: 1, frame: 4 return env0_9 != null && true; } function setSelectedGuildThemeSnapshot(a0, a1) { // fn#33346, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4200:443, offset: 0x0102cbee, size: 105 bytes, params: 3, frame: 17 var r0; var moduleValue; const value3 = env0_9?.guildId !== a0; if (value3) { r0 = value3; } else { moduleValue = require(22) /* metro dependency 22 */; r0 = !moduleValue.isEqual(env0_9.guildTheme, a1); } r0 = r0 && true; return r0; } function snapshotSelectedGuildId(a0) { // fn#33347, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4200:603, offset: 0x0102cc57, size: 102 bytes, params: 2, frame: 17 var r0; var value; var setSelectedGuildThemeSnapshotBinding; var value2; var moduleValue; var cloneGuildTheme; if (a0 == null) { r0 = clearSelectedGuildThemeSnapshot(); } else { setSelectedGuildThemeSnapshotBinding = setSelectedGuildThemeSnapshot; value2 = undefined; moduleValue = require(1866) /* metro dependency 1866: guildThemeSerialization */; cloneGuildTheme = moduleValue.cloneGuildTheme; value = GuildStore.getGuild(a0); value = setSelectedGuildThemeSnapshotBinding(a0, Reflect.apply(cloneGuildTheme, moduleValue, [value == null ? value2 : value.guildTheme])); r0 = value; } return r0; } function CACHE_LOADED_33348() { // fn#33348, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4200:834, offset: 0x0102ccbd, size: 30 bytes, params: 1, frame: 11 return snapshotSelectedGuildId(SelectedGuildStore.getGuildId()); } function snapshotSelectedGuildAfterSelectedGuildChange(a0) { // fn#33349, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4200:914, offset: 0x0102ccdb, size: 68 bytes, params: 2, frame: 14 if (env0_9?.guildId !== a0) { return false; } const guildId = SelectedGuildStore.getGuildId(); return guildId !== a0 && snapshotSelectedGuildId(guildId); } function GUILD_SETTINGS_GUILD_THEME_SAVE_SUCCESS_33350({guildId, guildTheme}) { // fn#33350, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4200:1087, offset: 0x0102cd1f, size: 83 bytes, params: 2, frame: 16 var r0; var setSelectedGuildThemeSnapshotBinding; var value; const selectedGuildStoreBinding = SelectedGuildStore; const getGuildId = selectedGuildStoreBinding.getGuildId; const value2 = guildId === Reflect.apply(getGuildId, selectedGuildStoreBinding, []); if (value2) { setSelectedGuildThemeSnapshotBinding = setSelectedGuildThemeSnapshot; value = require(1866) /* metro dependency 1866: guildThemeSerialization */; value = setSelectedGuildThemeSnapshotBinding(guildId, value.cloneGuildTheme(guildTheme)); r0 = value; } else { r0 = value2; } return r0; } function _fun33351(a0) { // fn#33351, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4200:1237, offset: 0x0102cd72, size: 91 bytes, params: 2, frame: 16 const GuildThemeRuntimeStore2 = GuildThemeRuntimeStore; Inherits(GuildThemeRuntimeStore2, a0); return CreateClass(GuildThemeRuntimeStore2, [{key: 'initialize', value: function() { this.waitFor(GuildStore, SelectedGuildStore); }}, {key: 'getGuildThemeSnapshot', value: value_33354}]); function GuildThemeRuntimeStore() { // fn#33352, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4200:1249, offset: 0x00ec62ac, size: 113 bytes, params: 1, frame: 20 const value = environment.__proto__; env1_2(this, GuildThemeRuntimeStore); const value3 = env1_5(GuildThemeRuntimeStore); return env1_4(this, _isNativeReflectConstruct_33342() ? global.Reflect.construct(value3, arguments, env1_5(this).constructor) : value3.apply(this, arguments)); } function value_33354(a0) { // fn#33354, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4200:1643, offset: 0x0102cdeb, size: 44 bytes, params: 2, frame: 5 const binding = env1_9; const value2 = undefined; return a0 !== (binding == null ? value2 : binding.guildId) ? value2 : env1_9.guildTheme; } } function CHANNEL_SELECT_33355({guildId}) { // fn#33355, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4200:1894, offset: 0x0102ce17, size: 70 bytes, params: 2, frame: 14 return guildId == null ? clearSelectedGuildThemeSnapshot() : env0_9?.guildId !== env0_9?.guildId && snapshotSelectedGuildId(env0_9?.guildId); } } global.__d(_fun33341, 4042, [6, 7, 15, 17, 18, 1867, 3969, 1866, 22, 566, 694, 2]) /* metro module 4042, dependencies: [6, 7, 15, 17, 18, 1867, 3969, 1866, 22, 566, 694, 2] */;