436 lines
20 KiB
TypeScript
436 lines
20 KiB
TypeScript
/* Metro module 9092; source: modules/guild_profile/GuildProfileStore.tsx; dependencies: [6, 7, 15, 17, 18, 661, 6718, 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 */
|
|
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
|
|
|
|
function _fun71097(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#71097, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9277:6, offset: 0x01d14a66, size: 548 bytes, params: 8, frame: 23
|
|
const env0_0 = require;
|
|
const GUILD_PROFILE_UPDATE2 = GUILD_PROFILE_UPDATE;
|
|
const GUILD_PROFILE_UPDATE_FAILURE2 = GUILD_PROFILE_UPDATE_FAILURE;
|
|
const INVITE_RESOLVE_SUCCESS_711032 = INVITE_RESOLVE_SUCCESS_71103;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
object = {NOT_FETCHED: 'NOT_FETCHED', FETCHING: 'FETCHING', FETCHED: 'FETCHED'};
|
|
const Map = global.Map;
|
|
let map = new Map();
|
|
const object2 = {'profile': null, 'lastSyncTimestamp': null, 'fetchStatus': null, 'isUpdating': false,
|
|
'error': null};
|
|
const NOT_FETCHED = object.NOT_FETCHED;
|
|
object2.fetchStatus = NOT_FETCHED;
|
|
const Store = (Flux).Store;
|
|
_fun71104(Store).displayName = 'GuildProfileStore';
|
|
map = new map(importDefault(694) /* metro dependency 694: Dispatcher */, {GUILD_PROFILE_FETCH: GUILD_PROFILE_FETCH,
|
|
GUILD_PROFILE_FETCH_SUCCESS: GUILD_PROFILE_FETCH_SUCCESS,
|
|
GUILD_PROFILE_FETCH_FAILURE: GUILD_PROFILE_FETCH_FAILURE, GUILD_PROFILE_UPDATE: GUILD_PROFILE_UPDATE2,
|
|
GUILD_PROFILE_UPDATE_SUCCESS: GUILD_PROFILE_UPDATE_SUCCESS,
|
|
GUILD_PROFILE_UPDATE_FAILURE: GUILD_PROFILE_UPDATE_FAILURE2,
|
|
MEMBER_VERIFICATION_FORM_UPDATE: MEMBER_VERIFICATION_FORM_UPDATE_71115,
|
|
INVITE_RESOLVE_SUCCESS: INVITE_RESOLVE_SUCCESS_711032,
|
|
INSTANT_INVITE_CREATE_SUCCESS: INVITE_RESOLVE_SUCCESS_711032, CHANNEL_CREATE: CHANNEL_CREATE_71116,
|
|
GUILD_SETTINGS_SET_WIDGET: GUILD_SETTINGS_SET_WIDGET, GUILD_UPDATE: GUILD_UPDATE_71118,
|
|
GUILD_PROFILE_UPDATE_VISIBILITY: GUILD_PROFILE_UPDATE2,
|
|
GUILD_PROFILE_UPDATE_VISIBILITY_SUCCESS: GUILD_PROFILE_UPDATE_VISIBILITY_SUCCESS,
|
|
GUILD_PROFILE_UPDATE_VISIBILITY_FAILURE: GUILD_PROFILE_UPDATE_FAILURE2});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/guild_profile/GuildProfileStore.tsx');
|
|
exports.default = map;
|
|
exports.GuildProfileFetchStatus = object;
|
|
function _isNativeReflectConstruct_71098() { // fn#71098, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9277:171, offset: 0x01d14c8a, 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_71098_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function GUILD_PROFILE_UPDATE({guildId}) { // fn#71101, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9277:567, offset: 0x01d14cec, size: 114 bytes, params: 2, frame: 16
|
|
var set;
|
|
var object;
|
|
let binding = env0_9;
|
|
const value2 = binding.get(guildId);
|
|
if (value2 == null) {
|
|
binding = env0_9;
|
|
set = binding.set;
|
|
object = {};
|
|
copyDataProperties(object, env0_10, undefined);
|
|
object['isUpdating'] = true;
|
|
Reflect.apply(set, binding, [guildId, object]);
|
|
} else {
|
|
binding = env0_9;
|
|
set = binding.set;
|
|
object = {};
|
|
copyDataProperties(object, value2, undefined);
|
|
object['isUpdating'] = true;
|
|
Reflect.apply(set, binding, [guildId, object]);
|
|
}
|
|
}
|
|
|
|
function GUILD_PROFILE_UPDATE_FAILURE({guildId, error}) { // fn#71102, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9277:690, offset: 0x01d14d5e, size: 126 bytes, params: 2, frame: 17
|
|
var set;
|
|
var object;
|
|
let binding = env0_9;
|
|
const value2 = binding.get(guildId);
|
|
if (value2 == null) {
|
|
binding = env0_9;
|
|
set = binding.set;
|
|
object = {};
|
|
copyDataProperties(object, env0_10, undefined);
|
|
object['error'] = error;
|
|
Reflect.apply(set, binding, [guildId, object]);
|
|
} else {
|
|
binding = env0_9;
|
|
set = binding.set;
|
|
object = {};
|
|
copyDataProperties(object, value2, undefined);
|
|
object['error'] = error;
|
|
object['isUpdating'] = false;
|
|
Reflect.apply(set, binding, [guildId, object]);
|
|
}
|
|
}
|
|
|
|
function INSTANT_INVITE_CREATE_SUCCESS_71103({invite}) { // fn#71103, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9277:825, offset: 0x01d14ddc, size: 262 bytes, params: 2, frame: 18
|
|
var binding;
|
|
var get;
|
|
var id;
|
|
var value2;
|
|
var guildProfileFromServer;
|
|
var set;
|
|
var object;
|
|
const profile = invite.profile;
|
|
if (profile != null) {
|
|
binding = env0_9;
|
|
get = binding.get;
|
|
id = profile.id;
|
|
value2 = Reflect.apply(get, binding, [id]);
|
|
guildProfileFromServer = (require(6718) /* metro dependency 6718: GuildProfileBuilders */).buildGuildProfileFromServer(profile);
|
|
if (value2 == null) {
|
|
binding = env0_9;
|
|
set = binding.set;
|
|
id = profile.id;
|
|
object = {};
|
|
copyDataProperties(object, env0_10, undefined);
|
|
object['profile'] = guildProfileFromServer;
|
|
object['lastSyncTimestamp'] = global.Date.now();
|
|
object['fetchStatus'] = env0_8.FETCHED;
|
|
Reflect.apply(set, binding, [id, object]);
|
|
} else {
|
|
binding = env0_9;
|
|
set = binding.set;
|
|
id = profile.id;
|
|
object = {};
|
|
copyDataProperties(object, value2, undefined);
|
|
object['profile'] = guildProfileFromServer;
|
|
object['lastSyncTimestamp'] = global.Date.now();
|
|
object['fetchStatus'] = env0_8.FETCHED;
|
|
Reflect.apply(set, binding, [id, object]);
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun71104(a0) { // fn#71104, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9277:1136, offset: 0x01d14ee2, size: 176 bytes, params: 2, frame: 16
|
|
const GuildProfileStore2 = GuildProfileStore;
|
|
Inherits(GuildProfileStore2, a0);
|
|
return CreateClass(GuildProfileStore2, [{key: 'getProfile', value: value_71106}, {key: 'getFetchStatus',
|
|
value: value_71107}, {key: 'getLastSyncTimestamp', value: value_71108}, {key: 'getIsUpdating',
|
|
value: value_71109}, {key: 'getErrorCode', value: value_71110}]);
|
|
function GuildProfileStore() { // fn#71105, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9277:1148, offset: 0x00ff71a7, size: 113 bytes, params: 1, frame: 20
|
|
const value = environment.__proto__;
|
|
env1_2(this, GuildProfileStore);
|
|
const value3 = env1_5(GuildProfileStore);
|
|
return env1_4(this, _isNativeReflectConstruct_71098() ? global.Reflect.construct(value3, arguments,
|
|
env1_5(this).constructor) : value3.apply(this, arguments));
|
|
}
|
|
|
|
function value_71106(a0) { // fn#71106, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9277:1451, offset: 0x01d14f92, size: 63 bytes, params: 2, frame: 13
|
|
var profile;
|
|
var r0;
|
|
var value2;
|
|
var value3;
|
|
const value = null;
|
|
if (value == a0) {
|
|
r0 = value;
|
|
} else {
|
|
value2 = environment.__proto__;
|
|
value3 = env1_9.get(a0);
|
|
profile = value == value3 ? undefined : value3.profile;
|
|
r0 = value != profile ? profile : value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function value_71107(a0) { // fn#71107, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9277:1574, offset: 0x01d14fd1, size: 72 bytes, params: 2, frame: 13
|
|
return a0 == null ? env1_8.NOT_FETCHED : env1_9.get(a0)?.fetchStatus ?? env1_8.NOT_FETCHED;
|
|
}
|
|
|
|
function value_71108(a0) { // fn#71108, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9277:1725, offset: 0x01d15019, size: 63 bytes, params: 2, frame: 13
|
|
var lastSyncTimestamp;
|
|
var r0;
|
|
var value2;
|
|
var value3;
|
|
const value = null;
|
|
if (value == a0) {
|
|
r0 = value;
|
|
} else {
|
|
value2 = environment.__proto__;
|
|
value3 = env1_9.get(a0);
|
|
lastSyncTimestamp = value == value3 ? undefined : value3.lastSyncTimestamp;
|
|
r0 = value != lastSyncTimestamp ? lastSyncTimestamp : value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function value_71109(a0) { // fn#71109, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9277:1857, offset: 0x01d15058, size: 59 bytes, params: 2, frame: 13
|
|
var isUpdating;
|
|
var r0;
|
|
let value = a0 != null;
|
|
if (value) {
|
|
value = environment.__proto__;
|
|
value = env1_9.get(a0);
|
|
isUpdating = value?.isUpdating;
|
|
value = isUpdating != null;
|
|
r0 = value && isUpdating;
|
|
} else {
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function value_71110(a0) { // fn#71110, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9277:1975, offset: 0x01d15093, size: 76 bytes, params: 2, frame: 14
|
|
var code;
|
|
var r0;
|
|
var value2;
|
|
var value3;
|
|
const value = null;
|
|
if (value == a0) {
|
|
r0 = value;
|
|
} else {
|
|
value2 = environment.__proto__;
|
|
value3 = env1_9.get(a0);
|
|
code = value == value3 || value == value3.error ? undefined : value3.error.code;
|
|
r0 = value != code ? code : value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
}
|
|
|
|
function GUILD_PROFILE_FETCH({guildId}) { // fn#71111, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9277:2179, offset: 0x01d150df, size: 130 bytes, params: 2, frame: 16
|
|
var set;
|
|
var object;
|
|
let binding = env0_9;
|
|
const value2 = binding.get(guildId);
|
|
if (value2 == null) {
|
|
binding = env0_9;
|
|
set = binding.set;
|
|
object = {};
|
|
copyDataProperties(object, env0_10, undefined);
|
|
object['fetchStatus'] = env0_8.FETCHING;
|
|
Reflect.apply(set, binding, [guildId, object]);
|
|
} else {
|
|
binding = env0_9;
|
|
set = binding.set;
|
|
object = {};
|
|
copyDataProperties(object, value2, undefined);
|
|
object['fetchStatus'] = env0_8.FETCHING;
|
|
Reflect.apply(set, binding, [guildId, object]);
|
|
}
|
|
}
|
|
|
|
function GUILD_PROFILE_FETCH_SUCCESS({guildId, profile}) { // fn#71112, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9277:2348, offset: 0x01d15161, size: 206 bytes, params: 2, frame: 17
|
|
var set;
|
|
var object;
|
|
let binding = env0_9;
|
|
const value2 = binding.get(guildId);
|
|
if (value2 == null) {
|
|
binding = env0_9;
|
|
set = binding.set;
|
|
object = {};
|
|
copyDataProperties(object, env0_10, undefined);
|
|
object['profile'] = profile;
|
|
object['lastSyncTimestamp'] = global.Date.now();
|
|
object['fetchStatus'] = env0_8.FETCHED;
|
|
Reflect.apply(set, binding, [guildId, object]);
|
|
} else {
|
|
binding = env0_9;
|
|
set = binding.set;
|
|
object = {};
|
|
copyDataProperties(object, value2, undefined);
|
|
object['profile'] = profile;
|
|
object['lastSyncTimestamp'] = global.Date.now();
|
|
object['fetchStatus'] = env0_8.FETCHED;
|
|
Reflect.apply(set, binding, [guildId, object]);
|
|
}
|
|
}
|
|
|
|
function GUILD_PROFILE_FETCH_FAILURE({guildId, error}) { // fn#71113, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9277:2605, offset: 0x01d1522f, size: 153 bytes, params: 2, frame: 17
|
|
var set;
|
|
var object;
|
|
let binding = env0_9;
|
|
const value2 = binding.get(guildId);
|
|
if (value2 == null) {
|
|
binding = env0_9;
|
|
set = binding.set;
|
|
object = {};
|
|
copyDataProperties(object, env0_10, undefined);
|
|
object['error'] = error;
|
|
object['fetchStatus'] = env0_8.FETCHED;
|
|
Reflect.apply(set, binding, [guildId, object]);
|
|
} else {
|
|
binding = env0_9;
|
|
set = binding.set;
|
|
object = {};
|
|
copyDataProperties(object, value2, undefined);
|
|
object['error'] = error;
|
|
object['fetchStatus'] = env0_8.FETCHED;
|
|
Reflect.apply(set, binding, [guildId, object]);
|
|
}
|
|
}
|
|
|
|
function GUILD_PROFILE_UPDATE_SUCCESS({guildId, profile}) { // fn#71114, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9277:2838, offset: 0x01d152c8, size: 127 bytes, params: 2, frame: 17
|
|
var set;
|
|
var object;
|
|
let binding = env0_9;
|
|
const value2 = binding.get(guildId);
|
|
if (value2 == null) {
|
|
binding = env0_9;
|
|
set = binding.set;
|
|
object = {};
|
|
copyDataProperties(object, env0_10, undefined);
|
|
object['profile'] = profile;
|
|
Reflect.apply(set, binding, [guildId, object]);
|
|
} else {
|
|
binding = env0_9;
|
|
set = binding.set;
|
|
object = {};
|
|
copyDataProperties(object, value2, undefined);
|
|
object['profile'] = profile;
|
|
object['isUpdating'] = false;
|
|
Reflect.apply(set, binding, [guildId, object]);
|
|
}
|
|
}
|
|
|
|
function MEMBER_VERIFICATION_FORM_UPDATE_71115({form, guildId}) { // fn#71115, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9277:3061, offset: 0x01d15347, size: 228 bytes, params: 2, frame: 18
|
|
var binding;
|
|
var value3;
|
|
var set;
|
|
var object;
|
|
const profile = form?.profile;
|
|
if (profile != null) {
|
|
binding = env0_9;
|
|
value3 = binding.get(guildId);
|
|
if (value3 == null) {
|
|
binding = env0_9;
|
|
set = binding.set;
|
|
object = {};
|
|
copyDataProperties(object, env0_10, undefined);
|
|
object['profile'] = profile;
|
|
object['lastSyncTimestamp'] = global.Date.now();
|
|
object['fetchStatus'] = env0_8.FETCHED;
|
|
Reflect.apply(set, binding, [guildId, object]);
|
|
} else {
|
|
binding = env0_9;
|
|
set = binding.set;
|
|
object = {};
|
|
copyDataProperties(object, value3, undefined);
|
|
object['profile'] = profile;
|
|
object['lastSyncTimestamp'] = global.Date.now();
|
|
object['fetchStatus'] = env0_8.FETCHED;
|
|
Reflect.apply(set, binding, [guildId, object]);
|
|
}
|
|
}
|
|
}
|
|
|
|
function CHANNEL_CREATE_71116({channel}) { // fn#71116, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9277:3470, offset: 0x01d1542b, size: 70 bytes, params: 2, frame: 13
|
|
const type = channel.type;
|
|
const GUILD_ANNOUNCEMENT = ChannelTypes.GUILD_ANNOUNCEMENT;
|
|
if (type === GUILD_ANNOUNCEMENT && channel.guild_id != null) {
|
|
env0_9.delete(channel.guild_id);
|
|
}
|
|
}
|
|
|
|
function GUILD_SETTINGS_SET_WIDGET({guildId, enabled}) { // fn#71117, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9277:3609, offset: 0x01d15471, size: 49 bytes, params: 2, frame: 12
|
|
if (guildId != null && enabled) {
|
|
env0_9.delete(guildId);
|
|
}
|
|
}
|
|
|
|
function GUILD_UPDATE_71118({guild}) { // fn#71118, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9277:3695, offset: 0x01d154a2, size: 211 bytes, params: 2, frame: 17
|
|
let binding = env0_9;
|
|
const get = binding.get;
|
|
let id = guild.id;
|
|
const value2 = Reflect.apply(get, binding, [id]);
|
|
if (value2 == null) {
|
|
return false;
|
|
}
|
|
if (value2.profile == null) {
|
|
return false;
|
|
}
|
|
const object = {};
|
|
copyDataProperties(object, value2.profile, undefined);
|
|
object['name'] = guild.name;
|
|
object['icon'] = guild.icon ?? null;
|
|
const description = guild.description;
|
|
const value4 = description != null;
|
|
object['description'] = value4 ? description : '';
|
|
object['customBanner'] = guild.discovery_splash ?? null;
|
|
binding = env0_9;
|
|
const set = binding.set;
|
|
id = guild.id;
|
|
const object2 = {};
|
|
copyDataProperties(object2, value2, value4);
|
|
object2['profile'] = object;
|
|
Reflect.apply(set, binding, [id, object2]);
|
|
}
|
|
|
|
function GUILD_PROFILE_UPDATE_VISIBILITY_SUCCESS({guildId, visibility}) { // fn#71119, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9277:4066, offset: 0x01d15575, size: 134 bytes, params: 2, frame: 18
|
|
var set;
|
|
var object;
|
|
var object2;
|
|
let binding = env0_9;
|
|
const value2 = binding.get(guildId);
|
|
const profile = value2?.profile;
|
|
if (value2 != null && profile != null) {
|
|
binding = env0_9;
|
|
set = binding.set;
|
|
object = {};
|
|
copyDataProperties(object, value2, undefined);
|
|
object['isUpdating'] = false;
|
|
object2 = {};
|
|
copyDataProperties(object2, profile, false);
|
|
object2['visibility'] = visibility;
|
|
object['profile'] = object2;
|
|
Reflect.apply(set, binding, [guildId, object]);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun71097, 9092, [6, 7, 15, 17, 18, 661, 6718, 566, 694,
|
|
2]) /* metro module 9092, dependencies: [6, 7, 15, 17, 18, 661, 6718, 566, 694, 2] */;
|