360 lines
19 KiB
TypeScript
360 lines
19 KiB
TypeScript
/* Metro module 4097; source: stores/InviteStore.tsx; dependencies: [6, 7, 15, 17, 18, 661, 4098, 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 */
|
|
import * as InviteCodeUtilsModule from '../modules/instant_invite/InviteCodeUtils.tsx'; /* Metro dependency 4098 */
|
|
|
|
function _fun33568(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#33568, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4255:6, offset: 0x01034f4a, size: 541 bytes, params: 8, frame: 21
|
|
let env0_0 = require;
|
|
const closure = function(a0) {
|
|
var env0_0 = a0;
|
|
updateInvite(a0.code, _fun33574);
|
|
};
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let Map = global.Map;
|
|
let map = new Map();
|
|
Map = global.Map;
|
|
map = new Map();
|
|
const env0_10 = {};
|
|
Map = global.Map;
|
|
map = new Map();
|
|
const Store = (Flux).Store;
|
|
_fun33575(Store).displayName = 'InviteStore';
|
|
map = new map(importDefault(694) /* metro dependency 694: Dispatcher */, {INVITE_RESOLVE: INVITE_RESOLVE,
|
|
INVITE_RESOLVE_SUCCESS: function(a0) {
|
|
var env0_0 = a0;
|
|
updateInvite(a0.code, _fun33584);
|
|
}, INVITE_RESOLVE_FAILURE: closure, INSTANT_INVITE_REVOKE_SUCCESS: closure,
|
|
FRIEND_INVITE_CREATE_SUCCESS: function(a0) {
|
|
var env0_0 = a0;
|
|
updateInvite(a0.invite.code, _fun33586);
|
|
}, FRIEND_INVITE_REVOKE_SUCCESS: function({invites}) {
|
|
invites.forEach(_fun33588);
|
|
}, INSTANT_INVITE_CREATE_SUCCESS: function(a0) {
|
|
var env0_0 = a0;
|
|
updateInvite(a0.invite.code, _fun33591);
|
|
}, INVITE_ACCEPT: function(a0) {
|
|
updateInvite(a0.code, _fun33593);
|
|
}, INVITE_ACCEPT_SUCCESS: function(a0) {
|
|
var env0_0 = a0;
|
|
updateInvite(a0.code, _fun33595);
|
|
}, INVITE_ACCEPT_FAILURE: INVITE_ACCEPT_FAILURE, INVITE_APP_OPENING: function(a0) {
|
|
updateInvite(a0.code, _fun33599);
|
|
}, INVITE_APP_OPENED: function(a0) {
|
|
updateInvite(a0.code, _fun33601);
|
|
}, INVITE_APP_NOT_OPENED: function(a0) {
|
|
updateInvite(a0.code, _fun33603);
|
|
}, INVITE_FRIEND_MEMBERS_FETCH_SUCCESS: INVITE_FRIEND_MEMBERS_FETCH_SUCCESS,
|
|
INVITE_FRIEND_MEMBERS_FETCH_FAILURE: INVITE_FRIEND_MEMBERS_FETCH_FAILURE});
|
|
(FileImportTrackerModule).fileFinishedImporting('stores/InviteStore.tsx');
|
|
exports.default = map;
|
|
function _isNativeReflectConstruct_33569() { // fn#33569, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4255:171, offset: 0x01035167, 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_33569_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function updateInvite(a0, a1) { // fn#33572, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4255:403, offset: 0x010351c5, size: 248 bytes, params: 3, frame: 17
|
|
var r12;
|
|
var object;
|
|
var RESOLVING;
|
|
const r1 = a0 ?? '';
|
|
const value3 = undefined;
|
|
const extraDataFromInviteKey = (InviteCodeUtilsModule).parseExtraDataFromInviteKey(r1);
|
|
let binding = env0_8;
|
|
const value4 = binding.get(r1);
|
|
if (value4 != null) {
|
|
object = {};
|
|
RESOLVING = InviteStates.RESOLVING;
|
|
object.state = RESOLVING;
|
|
copyDataProperties(object, value4, RESOLVING);
|
|
r12 = object;
|
|
} else {
|
|
r12 = {state: InviteStates.RESOLVING, code: extraDataFromInviteKey.baseCode};
|
|
}
|
|
a1(r12);
|
|
const Map = global.Map;
|
|
binding = env0_8;
|
|
const value5 = Object.create(Map.prototype, {constructor: {value: Map}});
|
|
const map = new Map(binding);
|
|
(map instanceof Object ? map : value5).set(r1, r12);
|
|
const guild = r12.guild;
|
|
const value7 = guild == null;
|
|
if ((value7 ? value3 : guild.id) != null) {
|
|
object = {};
|
|
copyDataProperties(object, env0_10, value7);
|
|
object[r12.guild.id] = r1;
|
|
}
|
|
return value3;
|
|
}
|
|
|
|
function INSTANT_INVITE_REVOKE_SUCCESS(a0) { // fn#33573, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4255:672, offset: 0x010352bd, size: 36 bytes, params: 2, frame: 13
|
|
const env0_0 = a0;
|
|
updateInvite(a0.code, _fun33574);
|
|
function _fun33574(a0) { // fn#33574, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4255:739, offset: 0x010352e1, size: 72 bytes, params: 2, frame: 3
|
|
a0.state = 'banned' in env0_0 && env0_0.banned ? InviteStates.BANNED : InviteStates.EXPIRED;
|
|
}
|
|
|
|
}
|
|
|
|
function _fun33575(a0) { // fn#33575, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4255:802, offset: 0x01035329, size: 162 bytes, params: 2, frame: 16
|
|
const InviteStore2 = InviteStore;
|
|
Inherits(InviteStore2, a0);
|
|
return CreateClass(InviteStore2, [{key: 'getInvite', value: value_33577}, {key: 'getInviteError', value: value_33578},
|
|
{key: 'getInvites', value: value_33579}, {key: 'getInviteKeyForGuildId', value: value_33580},
|
|
{key: 'getFriendMemberIds', value: value_33581}]);
|
|
function InviteStore() { // fn#33576, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4255:814, offset: 0x00de700a, size: 113 bytes, params: 1, frame: 20
|
|
const value = environment.__proto__;
|
|
env1_2(this, InviteStore);
|
|
const value3 = env1_5(InviteStore);
|
|
return env1_4(this, _isNativeReflectConstruct_33569() ? global.Reflect.construct(value3, arguments,
|
|
env1_5(this).constructor) : value3.apply(this, arguments));
|
|
}
|
|
|
|
function value_33577(a0) { // fn#33577, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4255:1086, offset: 0x010353cb, size: 22 bytes, params: 2, frame: 11
|
|
return env1_8.get(a0);
|
|
}
|
|
|
|
function value_33578(a0) { // fn#33578, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4255:1144, offset: 0x00f7ebd1, size: 22 bytes, params: 2, frame: 11
|
|
return env1_9.get(a0);
|
|
}
|
|
|
|
function value_33579() { // fn#33579, offset: 0x00fbd9d4, size: 9 bytes, params: 1, frame: 1
|
|
return env1_8;
|
|
}
|
|
|
|
function value_33580(a0) { // fn#33580, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4255:1256, offset: 0x010353e1, size: 16 bytes, params: 2, frame: 2
|
|
return env1_10[a0];
|
|
}
|
|
|
|
function value_33581(a0) { // fn#33581, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4255:1314, offset: 0x010353f1, size: 22 bytes, params: 2, frame: 11
|
|
return env1_11.get(a0);
|
|
}
|
|
|
|
}
|
|
|
|
function INVITE_RESOLVE({code}) { // fn#33582, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4255:1426, offset: 0x01035407, size: 119 bytes, params: 2, frame: 16
|
|
const extraDataFromInviteKey = (InviteCodeUtilsModule).parseExtraDataFromInviteKey(code);
|
|
const Map = global.Map;
|
|
const map = new Map(env0_8);
|
|
const set = map.set;
|
|
const RESOLVING = InviteStates.RESOLVING;
|
|
Reflect.apply(set, map, [code, {code: extraDataFromInviteKey.baseCode, state: RESOLVING}]);
|
|
}
|
|
|
|
function INVITE_RESOLVE_SUCCESS(a0) { // fn#33583, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4255:1592, offset: 0x0103547e, size: 36 bytes, params: 2, frame: 13
|
|
const env0_0 = a0;
|
|
updateInvite(a0.code, _fun33584);
|
|
function _fun33584(a0) { // fn#33584, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4255:1659, offset: 0x010354a2, size: 369 bytes, params: 2, frame: 6
|
|
const RESOLVED = InviteStates.RESOLVED;
|
|
a0.state = RESOLVED;
|
|
let binding = env0_0;
|
|
a0.guild = binding.invite.guild;
|
|
a0.channel = binding.invite.channel;
|
|
a0.inviter = binding.invite.inviter;
|
|
const approximate_member_count = binding.invite.approximate_member_count;
|
|
const value2 = null;
|
|
a0.approximate_member_count = value2 != approximate_member_count ? approximate_member_count : value2;
|
|
const approximate_presence_count = env0_0.invite.approximate_presence_count;
|
|
a0.approximate_presence_count = value2 != approximate_presence_count ? approximate_presence_count : value2;
|
|
binding = env0_0;
|
|
a0.target_type = binding.invite.target_type;
|
|
a0.target_user = binding.invite.target_user;
|
|
a0.target_application = binding.invite.target_application;
|
|
a0.expires_at = binding.invite.expires_at;
|
|
a0.friends_count = binding.invite.friends_count;
|
|
a0.is_contact = binding.invite.is_contact;
|
|
a0.guild_scheduled_event = binding.invite.guild_scheduled_event;
|
|
a0.type = binding.invite.type;
|
|
a0.flags = binding.invite.flags;
|
|
a0.is_nickname_changeable = binding.invite.is_nickname_changeable;
|
|
a0.profile = binding.invite.profile;
|
|
a0.roles = binding.invite.roles;
|
|
}
|
|
|
|
}
|
|
|
|
function FRIEND_INVITE_CREATE_SUCCESS(a0) { // fn#33585, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4255:2497, offset: 0x01035613, size: 42 bytes, params: 2, frame: 13
|
|
const env0_0 = a0;
|
|
updateInvite(a0.invite.code, _fun33586);
|
|
function _fun33586(a0) { // fn#33586, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4255:2569, offset: 0x0103563d, size: 51 bytes, params: 2, frame: 2
|
|
const RESOLVED = InviteStates.RESOLVED;
|
|
a0.state = RESOLVED;
|
|
a0.inviter = env0_0.invite.inviter;
|
|
}
|
|
|
|
}
|
|
|
|
function FRIEND_INVITE_REVOKE_SUCCESS({invites}) { // fn#33587, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4255:2652, offset: 0x01035670, size: 30 bytes, params: 2, frame: 11
|
|
invites.forEach(function(a0) {
|
|
updateInvite(a0.code, _fun33589);
|
|
});
|
|
function _fun33588({code}) { // fn#33588, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4255:2715, offset: 0x0103568e, size: 32 bytes, params: 2, frame: 13
|
|
updateInvite(code, function(a0) {
|
|
a0.state = InviteStates.EXPIRED;
|
|
});
|
|
function _fun33589(a0) { // fn#33589, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4255:2739, offset: 0x010356ae, size: 26 bytes, params: 2, frame: 2
|
|
const EXPIRED = InviteStates.EXPIRED;
|
|
a0.state = EXPIRED;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function INSTANT_INVITE_CREATE_SUCCESS(a0) { // fn#33590, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4255:2797, offset: 0x010356c8, size: 42 bytes, params: 2, frame: 13
|
|
const env0_0 = a0;
|
|
updateInvite(a0.invite.code, _fun33591);
|
|
function _fun33591(a0) { // fn#33591, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4255:2870, offset: 0x010356f2, size: 298 bytes, params: 2, frame: 6
|
|
const RESOLVED = InviteStates.RESOLVED;
|
|
a0.state = RESOLVED;
|
|
let binding = env0_0;
|
|
a0.guild = binding.invite.guild;
|
|
a0.channel = binding.invite.channel;
|
|
a0.inviter = binding.invite.inviter;
|
|
const approximate_member_count = binding.invite.approximate_member_count;
|
|
const value2 = null;
|
|
a0.approximate_member_count = value2 != approximate_member_count ? approximate_member_count : value2;
|
|
const approximate_presence_count = env0_0.invite.approximate_presence_count;
|
|
a0.approximate_presence_count = value2 != approximate_presence_count ? approximate_presence_count : value2;
|
|
binding = env0_0;
|
|
a0.target_type = binding.invite.target_type;
|
|
a0.target_user = binding.invite.target_user;
|
|
a0.target_application = binding.invite.target_application;
|
|
a0.guild_scheduled_event = binding.invite.guild_scheduled_event;
|
|
a0.type = binding.invite.type;
|
|
a0.is_nickname_changeable = binding.invite.is_nickname_changeable;
|
|
a0.profile = binding.invite.profile;
|
|
a0.roles = binding.invite.roles;
|
|
}
|
|
|
|
}
|
|
|
|
function INVITE_ACCEPT({code}) { // fn#33592, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4255:3458, offset: 0x0103581c, size: 32 bytes, params: 2, frame: 13
|
|
updateInvite(code, function(a0) {
|
|
a0.state = InviteStates.ACCEPTING;
|
|
});
|
|
function _fun33593(a0) { // fn#33593, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4255:3517, offset: 0x0103583c, size: 26 bytes, params: 2, frame: 2
|
|
const ACCEPTING = InviteStates.ACCEPTING;
|
|
a0.state = ACCEPTING;
|
|
}
|
|
|
|
}
|
|
|
|
function INVITE_ACCEPT_SUCCESS_33594(a0) { // fn#33594, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4255:3567, offset: 0x01035856, size: 36 bytes, params: 2, frame: 13
|
|
const env0_0 = a0;
|
|
updateInvite(a0.code, _fun33595);
|
|
function _fun33595(a0) { // fn#33595, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4255:3633, offset: 0x0103587a, size: 106 bytes, params: 2, frame: 13
|
|
const value = environment.__proto__;
|
|
const ACCEPTED = InviteStates.ACCEPTED;
|
|
a0.state = ACCEPTED;
|
|
const binding = env0_0;
|
|
a0.guild = binding.invite.guild;
|
|
a0.new_member = binding.invite.new_member;
|
|
const object = {};
|
|
copyDataProperties(object, binding.invite.channel, copyDataProperties(object, a0.channel, undefined));
|
|
a0.channel = object;
|
|
}
|
|
|
|
}
|
|
|
|
function INVITE_ACCEPT_FAILURE(a0) { // fn#33596, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4255:3783, offset: 0x010358e4, size: 57 bytes, params: 2, frame: 15
|
|
const binding = env0_9;
|
|
binding.set(a0.code, a0.error);
|
|
updateInvite(a0.code, function(a0) {
|
|
a0.state = InviteStates.ERROR;
|
|
});
|
|
}
|
|
|
|
function INVITE_APP_OPENING({code}) { // fn#33598, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4255:3914, offset: 0x01035937, size: 32 bytes, params: 2, frame: 13
|
|
updateInvite(code, function(a0) {
|
|
a0.state = InviteStates.APP_OPENING;
|
|
});
|
|
function _fun33599(a0) { // fn#33599, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4255:3977, offset: 0x01035957, size: 26 bytes, params: 2, frame: 2
|
|
const APP_OPENING = InviteStates.APP_OPENING;
|
|
a0.state = APP_OPENING;
|
|
}
|
|
|
|
}
|
|
|
|
function INVITE_APP_OPENED({code}) { // fn#33600, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4255:4025, offset: 0x01035971, size: 32 bytes, params: 2, frame: 13
|
|
updateInvite(code, function(a0) {
|
|
a0.state = InviteStates.APP_OPENED;
|
|
});
|
|
function _fun33601(a0) { // fn#33601, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4255:4087, offset: 0x01035991, size: 26 bytes, params: 2, frame: 2
|
|
const APP_OPENED = InviteStates.APP_OPENED;
|
|
a0.state = APP_OPENED;
|
|
}
|
|
|
|
}
|
|
|
|
function INVITE_APP_NOT_OPENED({code}) { // fn#33602, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4255:4138, offset: 0x010359ab, size: 32 bytes, params: 2, frame: 13
|
|
updateInvite(code, function(a0) {
|
|
a0.state = InviteStates.APP_NOT_OPENED;
|
|
});
|
|
function _fun33603(a0) { // fn#33603, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4255:4203, offset: 0x010359cb, size: 26 bytes, params: 2, frame: 2
|
|
const APP_NOT_OPENED = InviteStates.APP_NOT_OPENED;
|
|
a0.state = APP_NOT_OPENED;
|
|
}
|
|
|
|
}
|
|
|
|
function INVITE_FRIEND_MEMBERS_FETCH_SUCCESS({code, friendMemberIds}) { // fn#33604, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4255:4272, offset: 0x010359e5, size: 68 bytes, params: 2, frame: 14
|
|
const Map = global.Map;
|
|
const binding = env0_11;
|
|
const value2 = Object.create(Map.prototype, {constructor: {value: Map}});
|
|
const map = new Map(binding);
|
|
(map instanceof Object ? map : value2).set(code, friendMemberIds);
|
|
}
|
|
|
|
function INVITE_FRIEND_MEMBERS_FETCH_FAILURE(a0) { // fn#33605, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4255:4404, offset: 0x01035a29, size: 87 bytes, params: 2, frame: 13
|
|
var Map;
|
|
var value2;
|
|
var map;
|
|
let binding = env0_11;
|
|
if (binding.has(a0.code)) {
|
|
Map = global.Map;
|
|
binding = env0_11;
|
|
value2 = Object.create(Map.prototype, {constructor: {value: Map}});
|
|
map = new Map(binding);
|
|
(map instanceof Object ? map : value2).delete(a0.code);
|
|
return undefined;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun33568, 4097, [6, 7, 15, 17, 18, 661, 4098, 566, 694,
|
|
2]) /* metro module 4097, dependencies: [6, 7, 15, 17, 18, 661, 4098, 566, 694, 2] */;
|