145 lines
7.5 KiB
TypeScript
145 lines
7.5 KiB
TypeScript
/* Metro module 9152; source: stores/CreateInviteModalStore.tsx; dependencies: [6, 7, 15, 17, 18, 1379, 1867, 8880, 661, 9153, 9155, 44, 566, 694, 2] */
|
|
function _fun71695(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#71695, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9337:6, offset: 0x01d2a4b3, size: 508 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const init_71701 = function(a0) {
|
|
env0_12 = a0.guildId;
|
|
var value2 = null;
|
|
env0_13 = value2;
|
|
var property = a0.targetType;
|
|
var r5 = value2 != property ? property : value2;
|
|
property = a0.targetUserId;
|
|
var r4 = value2 != property ? property : value2;
|
|
property = a0.targetApplicationId;
|
|
updateWithLatestInvite(a0.channelId, {targetType: r5, targetUserId: r4,
|
|
targetApplicationId: value2 != property ? property : value2});
|
|
};
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(6) /* metro dependency 6 */;
|
|
const env0_4 = importDefault(7) /* metro dependency 7 */;
|
|
const env0_5 = importDefault(15) /* metro dependency 15 */;
|
|
const env0_6 = importDefault(17) /* metro dependency 17 */;
|
|
const env0_7 = importDefault(18) /* metro dependency 18 */;
|
|
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
|
|
const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
|
|
const instantInviteStore = importDefault(8880) /* metro dependency 8880: InstantInviteStore */;
|
|
const FormStates = (require(661) /* metro dependency 661: Constants */).FormStates;
|
|
const INVITE_OPTIONS_UNLIMITED = (importDefault(9153) /* metro dependency 9153: InstantInviteUtils */).INVITE_OPTIONS_UNLIMITED;
|
|
let value = INVITE_OPTIONS_UNLIMITED.value;
|
|
let env0_19 = FormStates.CLOSED;
|
|
const Store = (importDefault(566) /* metro dependency 566: flux */).Store;
|
|
_fun71702(Store).displayName = 'CreateInviteModalStore';
|
|
value = new value(importDefault(694) /* metro dependency 694: Dispatcher */,
|
|
{CREATE_INVITE_MODAL_INIT: function(a0) {
|
|
init_71701(a0);
|
|
}, CREATE_INVITE_MODAL_OPEN: function(a0) {
|
|
env0_19 = FormStates.OPEN;
|
|
var onClose = a0.onClose;
|
|
var value2 = undefined;
|
|
env0_17 = onClose ?? value2;
|
|
init_71701(a0);
|
|
return value2;
|
|
}, CREATE_INVITE_MODAL_UPDATE_SETTINGS: CREATE_INVITE_MODAL_UPDATE_SETTINGS,
|
|
CREATE_INVITE_MODAL_RESET_SETTINGS: CREATE_INVITE_MODAL_RESET_SETTINGS,
|
|
CREATE_INVITE_MODAL_GENERATE_INVITE: CREATE_INVITE_MODAL_GENERATE_INVITE,
|
|
CREATE_INVITE_MODAL_GENERATE_INVITE_SUCCESS: CREATE_INVITE_MODAL_GENERATE_INVITE_SUCCESS,
|
|
CREATE_INVITE_MODAL_GENERATE_INVITE_FAILURE: function(a0) {
|
|
env0_14 = null;
|
|
env0_20 = false;
|
|
env0_13 = a0.message;
|
|
}, CREATE_INVITE_MODAL_CLOSE: function() {
|
|
env0_19 = FormStates.CLOSED;
|
|
env0_17 = undefined;
|
|
}});
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('stores/CreateInviteModalStore.tsx');
|
|
exports.default = value;
|
|
}
|
|
|
|
function _isNativeReflectConstruct_71696() { // fn#71696, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9337:201, offset: 0x01d2a6af, 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_71696_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function updateWithLatestInvite(a0, {targetType, targetUserId, targetApplicationId}) { // fn#71699, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9337:467, offset: 0x01d2a711, size: 343 bytes, params: 3, frame: 21
|
|
var object2;
|
|
const defaultInviteExpiration = (require(9155) /* metro dependency 9155: DefaultInviteExpirationExperiments */).getDefaultInviteExpiration({guild: GuildStore.getGuild(ChannelStore.getChannel(a0)?.guild_id)});
|
|
const invite = InstantInviteStore.getInvite(a0, {targetType: targetType, targetUserId: targetUserId,
|
|
targetApplicationId: targetApplicationId});
|
|
env0_14 = invite;
|
|
object2 = {channelId: a0};
|
|
object2.maxAge = invite == null ? defaultInviteExpiration : env0_14.maxAge;
|
|
object2.maxUses = env0_14 != null ? env0_14.maxUses : value;
|
|
object2.temporary = env0_14 != null && env0_14.temporary;
|
|
object2.flags = env0_14 != null ? env0_14.flags : 0;
|
|
object2.targetType = targetType;
|
|
object2.targetUserId = targetUserId;
|
|
object2.targetApplicationId = targetApplicationId;
|
|
const binding = env0_14;
|
|
let r3 = binding == null || binding.roles == null ? undefined : binding.roles.map(function(a0) {
|
|
return a0.id;
|
|
});
|
|
r3 = r3 ?? [];
|
|
object2.roleIds = r3;
|
|
}
|
|
|
|
function _fun71702(a0) { // fn#71702, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9337:1247, offset: 0x01d2a8d7, size: 322 bytes, params: 2, frame: 16
|
|
const closure = CreateInviteModalStore;
|
|
env0_7(closure, a0);
|
|
return env0_4(closure, [{key: 'initialize', value: function() {
|
|
this.waitFor(ChannelStore, GuildStore, InstantInviteStore);
|
|
}}, {key: 'init', value: function() {
|
|
this.waitFor(InstantInviteStore);
|
|
}}, {key: 'isOpen', value: function() {
|
|
return CLOSED !== FormStates.CLOSED;
|
|
}}, {key: 'isSubmitting', value: value_71707}, {key: 'getGuildId', value: value_71708}, {key: 'getError',
|
|
value: value_71709}, {key: 'getInvite', value: value_71710}, {key: 'getInviteSettings', value: value_71711},
|
|
{key: 'getPendingSettings', value: value_71712}, {key: 'getProps', value: function() {
|
|
return {};
|
|
}}, {key: 'onClose', get: get_71714}]);
|
|
}
|
|
|
|
function CREATE_INVITE_MODAL_UPDATE_SETTINGS({settings}) { // fn#71717, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9337:2376, offset: 0x01d2aa7c, size: 53 bytes, params: 2, frame: 13
|
|
var object2;
|
|
const binding = env0_16;
|
|
if (binding != null) {
|
|
object2 = {};
|
|
copyDataProperties(object2, settings, copyDataProperties(object2, env0_16, binding));
|
|
}
|
|
}
|
|
|
|
function CREATE_INVITE_MODAL_GENERATE_INVITE() { // fn#71719, offset: 0x01d2aac0, size: 21 bytes, params: 1, frame: 2
|
|
}
|
|
|
|
function CREATE_INVITE_MODAL_GENERATE_INVITE_SUCCESS({channelId}) { // fn#71720, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9337:2639, offset: 0x01d2aad5, size: 116 bytes, params: 2, frame: 15
|
|
(importDefault(44) /* metro dependency 44 */)(env0_15 != null, 'No invite settings for generated invite');
|
|
const binding = env0_15;
|
|
updateWithLatestInvite(channelId, {targetType: binding.targetType, targetUserId: binding.targetUserId,
|
|
targetApplicationId: binding.targetApplicationId});
|
|
}
|
|
|