Files
discord-decomp/sources/modules/application_commands/native/ExecutedApplicationCommandPopout.tsx
T
2026-07-27 16:20:00 +03:00

1440 lines
61 KiB
TypeScript

/* Metro module 9901; source: modules/application_commands/native/ExecutedApplicationCommandPopout.tsx; dependencies: [31, 27, 1379, 1938, 1867, 4814, 3793, 1878, 7861, 5066, 661, 1483, 6625, 33, 4501, 697, 1909, 1305, 4080, 8743, 3995, 4573, 4805, 1244, 6771, 566, 5475, 1426, 6239, 477, 9902, 3856, 6238, 1583, 5068, 4572, 6231, 6789, 8055, 6275, 2] */
function _fun77586(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#77586, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10087:6, offset: 0x01e020e8, size: 693 bytes, params: 8, frame: 24
var object2;
const env0_0 = require;
const _arrayLikeToArray_77589 = function(a0, a1) {
var r0;
var r1;
var r2;
var value3;
var length;
var value5;
var value = undefined;
var value2 = value == null;
reducibleJoin2: while (true) {
if (value2) {
r0 = value2;
break reducibleJoin2;
}
value3 = value > a0.length;
r0 = value3;
break reducibleJoin2;
}
reducibleJoin4: while (true) {
if (r0) {
length = a0.length;
r1 = length;
break reducibleJoin4;
}
r1 = value;
break reducibleJoin4;
}
value = (0, global.Array)(r1);
var value4 = 0;
if (value4 < r1) {
r2 = value4;
reducibleLoop5: while (true) {
value[r2] = a0[r2];
value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
if (value5 < r1) {
r2 = value5;
continue reducibleLoop5;
}
break reducibleLoop5;
}
}
return value;
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_4 = importAll(31) /* metro dependency 31 */;
let value = require(27) /* metro dependency 27 */;
const env0_5 = value.ActivityIndicator;
const env0_6 = value.NativeModules;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const guildRoleStore = importDefault(1938) /* metro dependency 1938: GuildRoleStore */;
const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
const messageStore = importDefault(4814) /* metro dependency 4814: MessageStore */;
const relationshipStore = importDefault(3793) /* metro dependency 3793: RelationshipStore */;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
const applicationCommandIndexStore = importDefault(7861) /* metro dependency 7861: ApplicationCommandIndexStore */;
const env0_14 = (require(5066) /* metro dependency 5066: ApplicationCommandConstants */).SUB_COMMAND_KEY_SEPARATOR;
value = require(661) /* metro dependency 661: Constants */;
const Fonts = value.Fonts;
const env0_15 = value.MessageTypes;
const env0_16 = value.WHITESPACE_RE;
const env0_17 = (require(1483) /* metro dependency 1483: AppLauncherNativeConstants */).AppLauncherRouteName;
value = require(6625) /* metro dependency 6625: ChannelAutocompleteConstants */;
const env0_18 = value.CHANNEL_SENTINEL;
const env0_19 = value.COMMAND_SENTINEL;
const env0_20 = value.MENTION_SENTINEL;
value = require(33) /* metro dependency 33 */;
const env0_21 = value.jsx;
const env0_22 = value.jsxs;
const env0_23 = value.Fragment;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
object2 = {container: {'paddingVertical': 8, 'paddingHorizontal': 16, 'gap': 16}};
object2.activityIndicator = {padding: 16};
const PRIMARY_SEMIBOLD = Fonts.PRIMARY_SEMIBOLD;
object2.commandUserText = {fontFamily: PRIMARY_SEMIBOLD};
object2.applicationIcon = {'width': 18, 'height': 18, 'borderRadius': 9, 'alignSelf': 'center'};
object2.applicationNameText = {textAlignVertical: 'center'};
object2.commandOptionText = {marginTop: 12};
const BACKGROUND_BRAND = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BRAND;
object2.commandOptionMentionText = {color: BACKGROUND_BRAND};
const MOBILE_TEXT_HEADING_PRIMARY = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_TEXT_HEADING_PRIMARY;
object2.commandText = {fontSize: 16, color: MOBILE_TEXT_HEADING_PRIMARY};
const env0_24 = Reflect.apply(createStyles, value, [object2]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/application_commands/native/ExecutedApplicationCommandPopout.tsx');
exports.default = _default_77615;
}
function _createForOfIteratorHelperLoose_77587(a0, a1) { // fn#77587, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10087:484, offset: 0x01e0239d, size: 372 bytes, params: 3, frame: 20
var r6;
var r9;
var r5;
var value3;
var regexp;
const env0_0 = a0;
const Symbol = global.Symbol;
let value = typeof Symbol !== 'undefined';
let r1 = value && a0[global.Symbol.iterator];
r1 = !r1 ? a0['@@iterator'] : r1;
if (r1) {
value = r1.call(a0);
return value.next.bind(value);
}
const Array = global.Array;
if (Array.isArray(a0)) {
if (r1) {
}
return _fun77588;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_77589(a0, value);
r5 = value;
} else {
value3 = ({}).toString.call(a0).slice(8, -1);
r6 = value3 === 'Object' && a0.constructor;
r9 = r6 ? a0.constructor.name : value3;
if (r9 === 'Map') {
r6 = global.Array.from(a0);
} else if (r9 === 'Set') {
r6 = global.Array.from(a0);
} else if (r9 === 'Arguments') {
value = _arrayLikeToArray_77589(a0, value);
r6 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_77589(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun77588;
}
const TypeError = global.TypeError;
throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
}
function getCommandOptionComponents({option, channel, guild, messageId, parentOptionName, commandOptionSpec, styles, analyticsLocations}) { // fn#77590, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10087:1887, offset: 0x01e02511, size: 1479 bytes, params: 2, frame: 37
var name_localized;
var r6;
var r0;
var r19;
var r17;
var r4;
var r18;
var r15;
var r2;
var HermesInternal;
var concat;
var closure;
var closure2;
var closure3;
var value10;
var USER;
var CHANNEL;
var ROLE;
var MENTIONABLE;
var ATTACHMENT;
var intl;
var string;
var t;
var nONJVc;
var value11;
var value12;
var toString;
var value13;
var getRole;
var id;
var value14;
var getUser;
var value15;
var value16;
var value17;
var value18;
var value19;
var value20;
var value21;
var value22;
var value23;
var getChannel;
var value24;
var jsxRuntimeEnv0_22Binding;
const LegacyText = (require(1305) /* metro dependency 1305: native */).LegacyText;
var object3;
var commandOptionMentionText;
var items2;
var moduleValue;
var computeChannelName;
var legacyText;
var value26;
var value27;
var value28;
var value29;
var value30;
var choices;
var find;
var value31;
var value32;
var value33;
var length;
var value34;
var test;
var value35;
var value36;
var push;
var Fragment;
var jsxRuntimeEnv0_21Binding;
var Object;
var fromEntries;
var map;
var _createForOfIteratorHelperLoose_77587Binding;
var value37;
var value38;
var done;
var value39;
var getCommandOptionComponentsBinding;
var value40;
var value41;
let value = ' ';
const value2 = parentOptionName + value;
let name = option.name;
const value3 = value2 + name;
const items3 = [];
reducibleJoin2: while (true) {
if (commandOptionSpec == null) {
name_localized = undefined;
break reducibleJoin2;
}
name_localized = commandOptionSpec.name_localized;
break reducibleJoin2;
}
reducibleJoin4: while (true) {
if (name_localized != null) {
r6 = name_localized;
break reducibleJoin4;
}
name = option.name;
r6 = name;
break reducibleJoin4;
}
let r3 = option.value != null ? value + r6 + ':' : value + r6;
let type = option.type;
const ApplicationCommandOptionType = (require(1909) /* metro dependency 1909: Server */).ApplicationCommandOptionType;
const SUB_COMMAND = ApplicationCommandOptionType.SUB_COMMAND;
if (type !== SUB_COMMAND) {
type = option.type;
reducibleJoin44: while (true) {
if (type !== ApplicationCommandOptionType.SUB_COMMAND_GROUP) {
closure = getUserComponent;
closure2 = getRoleComponent;
closure3 = getCommandValueText;
value10 = option.value;
reducibleJoin43: while (true) {
if (value10 == null) {
break reducibleJoin43;
}
type = option.type;
USER = ApplicationCommandOptionType.USER;
if (USER === type) {
value26 = option.value;
toString = value26.toString;
value27 = Reflect.apply(toString, value26, []);
getUser = UserStore.getUser;
value28 = Reflect.apply(getUser, UserStore, [value27]);
reducibleJoin30: while (true) {
if (value28 != null) {
value29 = closure(value28, styles);
r19 = value29;
break reducibleJoin30;
}
r19 = null;
break reducibleJoin30;
}
} else {
CHANNEL = ApplicationCommandOptionType.CHANNEL;
if (CHANNEL === type) {
value22 = option.value;
toString = value22.toString;
value23 = Reflect.apply(toString, value22, []);
getChannel = ChannelStore.getChannel;
value24 = Reflect.apply(getChannel, ChannelStore, [value23]);
reducibleJoin30: while (true) {
if (value24 != null) {
jsxRuntimeEnv0_22Binding = jsxRuntimeEnv0_22;
object3 = {};
commandOptionMentionText = styles.commandOptionMentionText;
object3.style = commandOptionMentionText;
items2 = [CHANNEL_SENTINEL];
moduleValue = require(4805) /* metro dependency 4805: useChannelName */;
computeChannelName = moduleValue.computeChannelName;
items2[1] = Reflect.apply(computeChannelName, moduleValue, [value24, UserStore,
RelationshipStore]);
name = option.name;
HermesInternal = global.HermesInternal;
concat = HermesInternal.concat;
legacyText = <LegacyText {...object3} key={'optionValue-' + name}>{items2}</LegacyText>;
r19 = legacyText;
break reducibleJoin30;
}
r19 = null;
break reducibleJoin30;
}
} else {
ROLE = ApplicationCommandOptionType.ROLE;
if (ROLE === type) {
value18 = option.value;
toString = value18.toString;
value19 = Reflect.apply(toString, value18, []);
reducibleJoin24: while (true) {
if (guild != null) {
getRole = GuildRoleStore.getRole;
id = guild.id;
value20 = Reflect.apply(getRole, GuildRoleStore, [id, value19]);
r0 = value20;
break reducibleJoin24;
}
r0 = undefined;
break reducibleJoin24;
}
reducibleJoin30: while (true) {
if (r0 != null) {
value21 = closure2(r0);
r19 = value21;
break reducibleJoin30;
}
r19 = null;
break reducibleJoin30;
}
} else {
MENTIONABLE = ApplicationCommandOptionType.MENTIONABLE;
if (MENTIONABLE === type) {
value12 = option.value;
toString = value12.toString;
value13 = Reflect.apply(toString, value12, []);
reducibleJoin18: while (true) {
if (guild != null) {
getRole = GuildRoleStore.getRole;
id = guild.id;
value14 = Reflect.apply(getRole, GuildRoleStore, [id, value13]);
r0 = value14;
break reducibleJoin18;
}
r0 = undefined;
break reducibleJoin18;
}
if (r0 != null) {
value17 = closure2(r0);
r19 = value17;
} else {
getUser = UserStore.getUser;
value15 = Reflect.apply(getUser, UserStore, [value13]);
reducibleJoin30: while (true) {
if (value15 != null) {
value16 = closure(value15, styles);
r19 = value16;
break reducibleJoin30;
}
r19 = null;
break reducibleJoin30;
}
}
} else {
ATTACHMENT = ApplicationCommandOptionType.ATTACHMENT;
reducibleJoin30: while (true) {
if (ATTACHMENT !== type) {
r19 = null;
break reducibleJoin30;
}
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
string = intl.string;
t = (require(1244) /* metro dependency 1244: indexNative */).t;
nONJVc = t.nONJVc;
value11 = closure3(Reflect.apply(string, intl, [nONJVc]));
r19 = value11;
break reducibleJoin30;
}
}
}
}
}
value30 = true;
reducibleJoin41: while (true) {
if (r19 == null) {
reducibleJoin34: while (true) {
if (commandOptionSpec == null) {
r17 = undefined;
break reducibleJoin34;
}
choices = commandOptionSpec.choices;
if (choices == null) {
r17 = undefined;
break reducibleJoin34;
}
find = choices.find;
value31 = Reflect.apply(find, choices, [function({value}) {
return value === option.value;
}]);
r17 = value31;
break reducibleJoin34;
}
value32 = option.value;
toString = value32.toString;
value33 = Reflect.apply(toString, value32, []);
reducibleJoin38: while (true) {
if (r17 == null) {
r4 = value33;
break reducibleJoin38;
}
name_localized = r17.name_localized;
reducibleJoin37: while (true) {
if (name_localized != null) {
r0 = name_localized;
break reducibleJoin37;
}
name = r17.name;
r0 = name;
break reducibleJoin37;
}
r4 = r0;
break reducibleJoin38;
}
length = r4.length;
value34 = length > 0;
reducibleJoin40: while (true) {
if (value34) {
test = WHITESPACE_RE.test;
value35 = !Reflect.apply(test, WHITESPACE_RE, [r4[0]]);
r0 = value35;
break reducibleJoin40;
}
r0 = value34;
break reducibleJoin40;
}
value36 = closure3(r4);
r18 = r0;
r19 = value36;
break reducibleJoin41;
}
r18 = value30;
break reducibleJoin41;
}
push = items3.push;
jsxRuntimeEnv0_22Binding = jsxRuntimeEnv0_22;
Fragment = env0_4.Fragment;
jsxRuntimeEnv0_21Binding = jsxRuntimeEnv0_21;
if (r18) {
r18 = value;
}
name = option.name;
HermesInternal = global.HermesInternal;
concat = HermesInternal.concat;
value = <LegacyText key={'optionKey-' + name}>{r3 + r18}</LegacyText>;
Reflect.apply(push, items3, [<Fragment key={value3}>{value}{r19}</Fragment>]);
break reducibleJoin43;
}
return items3;
}
break reducibleJoin44;
}
}
push = items3.push;
Fragment = env0_4.Fragment;
name = option.name;
HermesInternal = global.HermesInternal;
concat = HermesInternal.concat;
Reflect.apply(push, items3,
[<Fragment key={value3}><LegacyText {...{children: r3}} key={'optionKey-' + name} /></Fragment>]);
let options = option.options;
reducibleJoin51: while (true) {
if (options == null) {
r0 = items3;
break reducibleJoin51;
}
Object = global.Object;
fromEntries = Object.fromEntries;
reducibleJoin47: while (true) {
if (commandOptionSpec == null) {
options = undefined;
break reducibleJoin47;
}
options = commandOptionSpec.options;
break reducibleJoin47;
}
reducibleJoin49: while (true) {
if (options != null) {
r15 = options;
break reducibleJoin49;
}
r15 = [];
break reducibleJoin49;
}
map = r15.map;
value = Reflect.apply(fromEntries, Object, [Reflect.apply(map, r15, [function(a0) {
return [a0.name, a0];
}])]);
_createForOfIteratorHelperLoose_77587Binding = _createForOfIteratorHelperLoose_77587;
options = option.options;
value37 = _createForOfIteratorHelperLoose_77587Binding(options);
value38 = value37();
done = value38.done;
if (done) {
r0 = items3;
break reducibleJoin51;
}
r2 = value38;
r3 = items3;
reducibleLoop50: while (true) {
value39 = r2.value;
concat = r3.concat;
getCommandOptionComponentsBinding = getCommandOptionComponents;
name = value39.name;
value40 = Reflect.apply(concat, r3, [getCommandOptionComponentsBinding({option: value39, channel: channel,
guild: guild, messageId: messageId, parentOptionName: value3, commandOptionSpec: value[name],
styles: styles,
analyticsLocations: analyticsLocations})]);
value41 = value37();
done = value41.done;
if (done) {
r0 = value40;
break reducibleJoin51;
}
r2 = value41;
r3 = value40;
continue reducibleLoop50;
}
}
return r0;
}
function getCommandCopyText(a0, a1, a2, a3) { // fn#77597, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10087:4479, offset: 0x01e02ce9, size: 1055 bytes, params: 5, frame: 29
var name_localized;
var r11;
var r4;
var r0;
var r2;
var name;
var concat;
var value7;
var USER;
var CHANNEL;
var ROLE;
var MENTIONABLE;
var value8;
var toString;
var value9;
var getRole;
var id;
var value10;
var getUser;
var value11;
var defaultImport;
var getUserTag;
var value12;
var value13;
var value14;
var value15;
var value16;
var value17;
var value18;
var value19;
var getChannel;
var value20;
var moduleValue;
var computeChannelName;
var value21;
var value22;
var value23;
var value24;
var defaultImport2;
var value25;
var choices;
var find;
var value26;
var String;
var push;
var Object;
var fromEntries;
var map;
var _createForOfIteratorHelperLoose_77587Binding;
var value27;
var value28;
var done;
var value29;
var getCommandCopyTextBinding;
var value30;
var value31;
const env0_0 = a0;
const items2 = [];
let value = null;
const value2 = undefined;
reducibleJoin2: while (true) {
if (value == a3) {
name_localized = value2;
break reducibleJoin2;
}
name_localized = a3.name_localized;
break reducibleJoin2;
}
reducibleJoin4: while (true) {
if (value != name_localized) {
r11 = name_localized;
break reducibleJoin4;
}
name = a0.name;
r11 = name;
break reducibleJoin4;
}
let r3 = value != a0.value ? '' + r11 + ':' : '' + r11;
let type = a0.type;
const ApplicationCommandOptionType = (require(1909) /* metro dependency 1909: Server */).ApplicationCommandOptionType;
const SUB_COMMAND = ApplicationCommandOptionType.SUB_COMMAND;
if (type !== SUB_COMMAND) {
type = a0.type;
reducibleJoin38: while (true) {
if (type !== ApplicationCommandOptionType.SUB_COMMAND_GROUP) {
value7 = a0.value;
reducibleJoin28: while (true) {
if (value != value7) {
type = a0.type;
USER = ApplicationCommandOptionType.USER;
if (USER === type) {
value22 = a0.value;
value23 = value22.toString();
value24 = UserStore.getUser(value23);
if (value != value24) {
defaultImport2 = importDefault(3995) /* metro dependency 3995: UserUtils */;
getUserTag = defaultImport2.getUserTag;
value25 = MENTION_SENTINEL + Reflect.apply(getUserTag, defaultImport2, [value24,
{decoration: 'never'}]);
r0 = value25;
break reducibleJoin28;
}
r0 = value;
break reducibleJoin28;
}
CHANNEL = ApplicationCommandOptionType.CHANNEL;
if (CHANNEL === type) {
value18 = a0.value;
value19 = value18.toString();
getChannel = ChannelStore.getChannel;
value20 = Reflect.apply(getChannel, ChannelStore, [value19]);
if (value != value20) {
moduleValue = require(4805) /* metro dependency 4805: useChannelName */;
computeChannelName = moduleValue.computeChannelName;
value21 = CHANNEL_SENTINEL + Reflect.apply(computeChannelName, moduleValue, [value20,
UserStore,
RelationshipStore]);
r0 = value21;
break reducibleJoin28;
}
r0 = value;
break reducibleJoin28;
}
ROLE = ApplicationCommandOptionType.ROLE;
if (ROLE === type) {
value14 = a0.value;
value15 = value14.toString();
reducibleJoin22: while (true) {
if (value != a2) {
getRole = GuildRoleStore.getRole;
id = a2.id;
value16 = Reflect.apply(getRole, GuildRoleStore, [id, value15]);
r4 = value16;
break reducibleJoin22;
}
r4 = value2;
break reducibleJoin22;
}
if (value != r4) {
name = r4.name;
value17 = MENTION_SENTINEL + name;
r0 = value17;
break reducibleJoin28;
}
r0 = value;
break reducibleJoin28;
}
MENTIONABLE = ApplicationCommandOptionType.MENTIONABLE;
if (MENTIONABLE !== type) {
r0 = value;
break reducibleJoin28;
}
value8 = a0.value;
toString = value8.toString;
value9 = Reflect.apply(toString, value8, []);
reducibleJoin16: while (true) {
if (value != a2) {
getRole = GuildRoleStore.getRole;
id = a2.id;
value10 = Reflect.apply(getRole, GuildRoleStore, [id, value9]);
r4 = value10;
break reducibleJoin16;
}
r4 = value2;
break reducibleJoin16;
}
if (value != r4) {
name = r4.name;
value13 = MENTION_SENTINEL + name;
r0 = value13;
break reducibleJoin28;
}
getUser = UserStore.getUser;
value11 = Reflect.apply(getUser, UserStore, [value9]);
if (value != value11) {
defaultImport = importDefault(3995) /* metro dependency 3995: UserUtils */;
getUserTag = defaultImport.getUserTag;
value12 = MENTION_SENTINEL + Reflect.apply(getUserTag, defaultImport, [value11,
{decoration: 'never'}]);
r0 = value12;
break reducibleJoin28;
}
r0 = value;
break reducibleJoin28;
}
r0 = value;
break reducibleJoin28;
}
reducibleJoin37: while (true) {
if (value != r0) {
break reducibleJoin37;
}
reducibleJoin32: while (true) {
if (value == a3) {
r11 = value2;
break reducibleJoin32;
}
choices = a3.choices;
if (value == choices) {
r11 = value2;
break reducibleJoin32;
}
find = choices.find;
value26 = Reflect.apply(find, choices, [_fun77599]);
r11 = value26;
break reducibleJoin32;
}
if (value != r11) {
name_localized = r11.name_localized;
reducibleJoin36: while (true) {
if (value != name_localized) {
r4 = name_localized;
break reducibleJoin36;
}
name = r11.name;
r4 = name;
break reducibleJoin36;
}
r0 = r4;
break reducibleJoin37;
}
String = global.String;
value = a0.value;
value = String(value);
r0 = value;
break reducibleJoin37;
}
push = items2.push;
Reflect.apply(push, items2, [r3 + r0]);
return items2;
}
break reducibleJoin38;
}
}
items2.push(r3);
let options = a0.options;
reducibleJoin45: while (true) {
if (value == options) {
r0 = items2;
break reducibleJoin45;
}
Object = global.Object;
fromEntries = Object.fromEntries;
reducibleJoin41: while (true) {
if (value == a3) {
options = value2;
break reducibleJoin41;
}
options = a3.options;
break reducibleJoin41;
}
reducibleJoin43: while (true) {
if (value != options) {
r11 = options;
break reducibleJoin43;
}
r11 = [];
break reducibleJoin43;
}
map = r11.map;
value = Reflect.apply(fromEntries, Object, [Reflect.apply(map, r11, [function(a0) {
return [a0.name, a0];
}])]);
_createForOfIteratorHelperLoose_77587Binding = _createForOfIteratorHelperLoose_77587;
options = a0.options;
value27 = _createForOfIteratorHelperLoose_77587Binding(options);
value28 = value27();
done = value28.done;
if (done) {
r0 = items2;
break reducibleJoin45;
}
r2 = value28;
r3 = items2;
reducibleLoop44: while (true) {
value29 = r2.value;
concat = r3.concat;
getCommandCopyTextBinding = getCommandCopyText;
name = value29.name;
value30 = Reflect.apply(concat, r3, [getCommandCopyTextBinding(value29, a1, a2, value[name])]);
value31 = value27();
done = value31.done;
if (done) {
r0 = value30;
break reducibleJoin45;
}
r2 = value31;
r3 = value30;
continue reducibleLoop44;
}
}
return r0;
}
function CommandContentContainer({channelId, author, applicationUser, data, guildId, messageType, messageId}) { // fn#77600, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10087:5892, offset: 0x01e03108, size: 633 bytes, params: 2, frame: 27
const styles = useStyles();
const analyticsLocations = (importDefault(6771) /* metro dependency 6771: useAnalyticsLocations */)().analyticsLocations;
const {channel, guild} = (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([ChannelStore,
GuildStore], _fun77601, [channelId]);
const r10 = data.application_command?.name_localized ?? data.name;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const value4 = intl.format((require(1244) /* metro dependency 1244: indexNative */).t['sj/RT9'],
{userHook: userHook, commandHook: commandHook, applicationHook: applicationHook_77604});
const value5 = guildId.useMemo(_fun77605, [channel, guild, messageId, data.name, data.options,
data.application_command, r10, styles, analyticsLocations]);
const Card = (require(6239) /* metro dependency 6239: CardNative */).Card;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
return (
<Card>
<Text
style={styles.commandText}
variant="text-md/medium"
color="mobile-text-heading-primary"
key={'commandName-' + data.name}
>
{value4}
</Text>
<Text
style={styles.commandOptionText}
variant="text-md/medium"
color="text-default"
key={'commandOption-' + data.name}
>
{value5}
</Text>
</Card>
);
}
function CommandActionsContainer({channelId, chatInputRef, data}) { // fn#77607, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10087:7700, offset: 0x01e036f2, size: 674 bytes, params: 2, frame: 25
var r0;
const TableRow = (require(6238) /* metro dependency 6238: TableRowNative */).TableRow;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
var Stack;
const options = data.options;
let value = null;
const r2 = value != options && options.some(function({type}) {
return type === require(dependencyMap[16]).ApplicationCommandOptionType.ATTACHMENT;
});
const {channel, guild} = (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([ChannelStore,
GuildStore], _fun77609, [channelId]);
const env0_5 = guild.useCallback(_fun77610, [data, channel, guild]);
items2 = [];
if (!r2) {
items2.push(<TableRow label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['42H+Nb'])} onPress={onPress_77612} />);
}
if (value != chatInputRef) {
items2.push(<TableRow label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.lNWC7s)} onPress={onPress_77613} />);
}
if (items2.length === 0) {
r0 = value;
} else {
Stack = (require(4572) /* metro dependency 4572: StackNative */).Stack;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
value = <Text variant="text-sm/semibold" color="text-subtle">{intl.string((require(1244) /* metro dependency 1244: indexNative */).t['3eF5/L'])}</Text>;
value = <Stack spacing={8}>{value}{((TableRowGroup) => <TableRowGroup hasIcons={false}>{items2.map(_fun77614)}</TableRowGroup>)((require(6231) /* metro dependency 6231: TableRowGroupNative */).TableRowGroup)}</Stack>;
r0 = value;
}
return r0;
}
function _default_77615({user, channelId, chatInputRef, messageId, author, applicationUser, guildId, messageType}) { // fn#77615, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10087:10312, offset: 0x01e03f26, size: 516 bytes, params: 2, frame: 33
var r6;
var jsxRuntimeEnv0_23Binding;
var items2;
const styles = useStyles();
const message = (require(566) /* metro dependency 566: flux */).useStateFromStores([MessageStore], function() {
return MessageStore.getMessage(channelId, messageId);
});
const defaultImport = importDefault(6771) /* metro dependency 6771: useAnalyticsLocations */;
const EXECUTED_COMMAND = (importDefault(6789) /* metro dependency 6789: AnalyticsLocation */).EXECUTED_COMMAND;
const analyticsLocations = defaultImport(EXECUTED_COMMAND).analyticsLocations;
const binding = env0_4;
const useEffect = binding.useEffect;
let interactionData = message?.interactionData;
Reflect.apply(useEffect, binding, [_fun77617, [channelId, messageId, interactionData]]);
const AnalyticsLocationProvider = (require(6771) /* metro dependency 6771: useAnalyticsLocations */).AnalyticsLocationProvider;
const BottomSheet = (require(6275) /* metro dependency 6275: BottomSheetNative */).BottomSheet;
interactionData = message?.interactionData;
if (interactionData != null) {
jsxRuntimeEnv0_23Binding = jsxRuntimeEnv0_23;
interactionData = message?.interactionData;
items2 = [<CommandContentContainer guildId={guildId} user={user} channelId={channelId} messageId={messageId} author={author} applicationUser={applicationUser} data={interactionData} messageType={messageType} />];
interactionData = message?.interactionData;
items2[1] = <CommandActionsContainer channelId={channelId} chatInputRef={chatInputRef} data={interactionData} />;
r6 = <>{items2}</>;
} else {
r6 = <ActivityIndicator style={styles.activityIndicator} size="large" />;
}
return (
<AnalyticsLocationProvider value={analyticsLocations}>
<BottomSheet startExpanded bodyStyles={styles.container}>
{r6}
</BottomSheet>
</AnalyticsLocationProvider>
);
}
function getUserComponent(a0, a1) { // fn#77592, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10087:2717, owner: getCommandOptionComponents.getUserComponent, offset: 0x01e02ad8, size: 176 bytes, params: 3, frame: 20
var environment;
const env0_0 = a0;
let value = environment.__proto__;
const LegacyText = (require(1305) /* metro dependency 1305: native */).LegacyText;
const legacyTextProps = {style: a1.commandOptionMentionText, onPress: onPress_77593};
const items2 = [MENTION_SENTINEL];
value = importDefault(3995) /* metro dependency 3995: UserUtils */;
const getUserTag = value.getUserTag;
items2[1] = Reflect.apply(getUserTag, value, [a0, {decoration: 'never'}]);
return (
<LegacyText {...legacyTextProps} key={'optionValue-' + option.name}>
{items2}
</LegacyText>
);
}
function getRoleComponent(a0) { // fn#77594, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10087:2979, owner: getCommandOptionComponents.getRoleComponent, offset: 0x01e02bef, size: 124 bytes, params: 2, frame: 17
const LegacyText = (require(1305) /* metro dependency 1305: native */).LegacyText;
return (
<LegacyText style={styles.commandOptionMentionText} key={'optionValue-' + option.name}>
{[MENTION_SENTINEL, a0.name]}
</LegacyText>
);
}
function getCommandValueText(a0) { // fn#77595, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10087:3105, owner: getCommandOptionComponents.getCommandValueText, offset: 0x01e02c6b, size: 100 bytes, params: 2, frame: 17
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
return (
<Text
variant="text-sm/medium"
color="mobile-text-heading-primary"
key={'optionValue-' + option.name}
>
{a0}
</Text>
);
}
function _fun77601() { // fn#77601, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10087:6071, offset: 0x01e03381, size: 67 bytes, params: 1, frame: 14
const value = environment.__proto__;
const channel = ChannelStore.getChannel(channelId);
const getGuild = GuildStore.getGuild;
return {channel: channel, guild: Reflect.apply(getGuild, GuildStore, [channel?.guild_id])};
}
function userHook() { // fn#77602, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10087:6313, owner: CommandContentContainer.userHook, offset: 0x01e033c4, size: 130 bytes, params: 1, frame: 19
const LegacyText = (require(1305) /* metro dependency 1305: native */).LegacyText;
return (
<LegacyText style={[styles.commandUserText,
{color: author.colorString ?? styles.commandText.color}]} key="user">
{author.nick}
</LegacyText>
);
}
function commandHook() { // fn#77603, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10087:6479, owner: CommandContentContainer.commandHook, offset: 0x01e03446, size: 121 bytes, params: 1, frame: 19
const value = environment.__proto__;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
const messageTypeBinding = messageType;
const CHAT_INPUT_COMMAND = MessageTypes.CHAT_INPUT_COMMAND;
return (
<Text variant="text-sm/semibold" key="command">
{messageTypeBinding === CHAT_INPUT_COMMAND ? '' + COMMAND_SENTINEL + env0_11 : env0_11}
</Text>
);
}
function CommandContentContainerApplicationHook() { // fn#77604, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10087:6603, owner: CommandContentContainer.applicationHook, offset: 0x01e034bf, size: 222 bytes, params: 1, frame: 22
let value = environment.__proto__;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
const stylesBinding = styles;
const applicationNameText = stylesBinding.applicationNameText;
value = importDefault(5475) /* metro dependency 5475: FastImage */;
const applicationIcon = stylesBinding.applicationIcon;
const avatarUtilsModule = require(1426) /* metro dependency 1426: AvatarUtils */;
const ensureAvatarSource = avatarUtilsModule.ensureAvatarSource;
const applicationUserBinding = applicationUser;
const getAvatarSource = applicationUserBinding.getAvatarSource;
value = ((Component) => <Component style={applicationIcon} source={Reflect.apply(ensureAvatarSource,
avatarUtilsModule, [Reflect.apply(getAvatarSource, applicationUserBinding,
[guildId])])} key={'icon-' + applicationUserBinding.id} />)(value);
const username = applicationUserBinding.username;
return (
<Text
style={applicationNameText}
variant="text-sm/semibold"
key="application"
>
{[value, ' ' + username]}
</Text>
);
}
function _fun77605() { // fn#77605, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10087:6849, offset: 0x01e0359d, size: 341 bytes, params: 1, frame: 24
var r5;
var r2;
var r3;
var r0;
var Object;
var fromEntries;
var application_command;
var map;
var value5;
var _createForOfIteratorHelperLoose_77587Binding;
var value6;
var value7;
var done;
var value8;
var getCommandOptionComponentsBinding;
var value9;
var value10;
const value2 = undefined;
const LegacyText = (require(1305) /* metro dependency 1305: native */).LegacyText;
const dataBinding = data;
let name = dataBinding.name;
const HermesInternal = global.HermesInternal;
let concat = HermesInternal.concat;
items = [<LegacyText key={'integrationName-' + name}>{'/' + env0_11}</LegacyText>];
let options = dataBinding.options;
reducibleJoin7: while (true) {
if (options == null) {
r0 = items;
break reducibleJoin7;
}
Object = global.Object;
fromEntries = Object.fromEntries;
application_command = data.application_command;
reducibleJoin3: while (true) {
if (application_command == null) {
options = value2;
break reducibleJoin3;
}
options = application_command.options;
break reducibleJoin3;
}
reducibleJoin5: while (true) {
if (options != null) {
r5 = options;
break reducibleJoin5;
}
r5 = [];
break reducibleJoin5;
}
map = r5.map;
value5 = Reflect.apply(fromEntries, Object, [Reflect.apply(map, r5, [function(a0) {
return [a0.name, a0];
}])]);
_createForOfIteratorHelperLoose_77587Binding = _createForOfIteratorHelperLoose_77587;
options = data.options;
value6 = _createForOfIteratorHelperLoose_77587Binding(options);
value7 = value6();
done = value7.done;
if (done) {
r0 = items;
break reducibleJoin7;
}
r2 = value7;
r3 = items;
reducibleLoop6: while (true) {
value8 = r2.value;
concat = r3.concat;
getCommandOptionComponentsBinding = getCommandOptionComponents;
name = value8.name;
value9 = Reflect.apply(concat, r3, [getCommandOptionComponentsBinding({option: value8, channel: channel,
guild: guild, messageId: messageId, parentOptionName: '', commandOptionSpec: value5[name],
styles: styles,
analyticsLocations: analyticsLocations})]);
value10 = value6();
done = value10.done;
if (done) {
r0 = value9;
break reducibleJoin7;
}
r2 = value10;
r3 = value9;
continue reducibleLoop6;
}
}
return r0;
}
function _fun77610() { // fn#77610, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10087:8023, offset: 0x01e039c7, size: 587 bytes, params: 1, frame: 26
var name_localized;
var r5;
var r8;
var r6;
var r9;
var name;
var Object;
var fromEntries;
var map;
var value5;
var _createForOfIteratorHelperLoose_77587Binding;
var value6;
var value7;
var done;
var value8;
var concat;
var getCommandCopyTextBinding;
var channelBinding;
var guildBinding;
var value9;
var value10;
var DCDClipboardManager;
var setItem;
var JSON;
var stringify;
var join;
var defaultImport;
var value13;
var value14;
var query;
var ApplicationCommandType;
var CHAT;
let application_command = data.application_command;
const value2 = undefined;
reducibleJoin2: while (true) {
if (application_command == null) {
name_localized = value2;
break reducibleJoin2;
}
name_localized = application_command.name_localized;
break reducibleJoin2;
}
reducibleJoin4: while (true) {
if (name_localized != null) {
r5 = name_localized;
break reducibleJoin4;
}
name = data.name;
r5 = name;
break reducibleJoin4;
}
let object = [COMMAND_SENTINEL + r5];
let options = data.options;
reducibleJoin11: while (true) {
if (options == null) {
r9 = object;
break reducibleJoin11;
}
Object = global.Object;
fromEntries = Object.fromEntries;
application_command = data.application_command;
reducibleJoin7: while (true) {
if (application_command == null) {
options = value2;
break reducibleJoin7;
}
options = application_command.options;
break reducibleJoin7;
}
reducibleJoin9: while (true) {
if (options != null) {
r8 = options;
break reducibleJoin9;
}
r8 = [];
break reducibleJoin9;
}
map = r8.map;
value5 = Reflect.apply(fromEntries, Object, [Reflect.apply(map, r8, [function(a0) {
return [a0.name, a0];
}])]);
_createForOfIteratorHelperLoose_77587Binding = _createForOfIteratorHelperLoose_77587;
options = data.options;
value6 = _createForOfIteratorHelperLoose_77587Binding(options);
value7 = value6();
done = value7.done;
if (done) {
r9 = object;
break reducibleJoin11;
}
r5 = value7;
r6 = object;
reducibleLoop10: while (true) {
value8 = r5.value;
concat = r6.concat;
getCommandCopyTextBinding = getCommandCopyText;
channelBinding = channel;
guildBinding = guild;
name = value8.name;
value9 = Reflect.apply(concat, r6, [getCommandCopyTextBinding(value8, channelBinding, guildBinding,
value5[name])]);
value10 = value6();
done = value10.done;
if (done) {
r9 = value9;
break reducibleJoin11;
}
r5 = value10;
r6 = value9;
continue reducibleLoop10;
}
}
const platformUtilsModule = require(477) /* metro dependency 477: PlatformUtils */;
if (platformUtilsModule.isAndroid()) {
reducibleJoin15: while (true) {
if ((importDefault(9902) /* metro dependency 9902: NativeCommandClipboardModule */) == null) {
break reducibleJoin15;
}
defaultImport = importDefault(9902) /* metro dependency 9902: NativeCommandClipboardModule */;
setItem = defaultImport.setItem;
JSON = global.JSON;
stringify = JSON.stringify;
value13 = Reflect.apply(stringify, JSON, [data]);
join = r9.join;
value14 = Reflect.apply(join, r9, [' ']);
Reflect.apply(setItem, defaultImport, [value13, 'application/x-discord-interaction-data', value14]);
break reducibleJoin15;
}
} else {
DCDClipboardManager = NativeModules.DCDClipboardManager;
setItem = DCDClipboardManager.setItem;
JSON = global.JSON;
Reflect.apply(setItem, DCDClipboardManager, [JSON.stringify(data), 'application/x-discord-interaction-data',
r9.join(' ')]);
}
reducibleJoin17: while (true) {
if (channel == null) {
break reducibleJoin17;
}
query = ApplicationCommandIndexStore.query;
object = {};
object.channel = channel;
object.type = 'channel';
ApplicationCommandType = (require(1909) /* metro dependency 1909: Server */).ApplicationCommandType;
CHAT = ApplicationCommandType.CHAT;
Reflect.apply(query, ApplicationCommandIndexStore, [object, {commandTypes: [CHAT]}, {allowFetch: true}]);
break reducibleJoin17;
}
(require(3856) /* metro dependency 3856: ToastUtils */).presentCommandCopied();
return value2;
}
function CommandActionsContainerOnPress() { // fn#77612, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10087:8880, owner: CommandActionsContainer.onPress, offset: 0x01e03c12, size: 48 bytes, params: 1, frame: 11
const value = environment.__proto__;
(importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */).hideActionSheet();
env0_5();
}
function CommandActionsContainerOnPress_77613() { // fn#77613, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10087:9015, owner: CommandActionsContainer.onPress, offset: 0x01e03c42, size: 700 bytes, params: 1, frame: 21
var r1;
var r5;
var r3;
var r6;
const ApplicationCommandOptionType = (require(1909) /* metro dependency 1909: Server */).ApplicationCommandOptionType;
var items2;
var includes;
var value4;
var current;
var openCustomKeyboard;
const KeyboardTypes = (require(1583) /* metro dependency 1583: KeyboardTypes */).KeyboardTypes;
const ApplicationCommandTriggerLocations = (require(5068) /* metro dependency 5068: ApplicationCommandTypes */).ApplicationCommandTriggerLocations;
var items3;
var value9;
const value = environment.__proto__;
const value2 = undefined;
(importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */).hideActionSheet();
let options = data.options;
if (options == null) {
value4 = chatInputRef == null;
if (value4) {
r1 = value4;
r5 = value2;
} else {
current = chatInputRef.current;
r1 = current == null;
r5 = current;
}
if (!r1) {
openCustomKeyboard = r5.openCustomKeyboard;
dataBinding = data;
Reflect.apply(openCustomKeyboard, r5, [{type: KeyboardTypes.APP_LAUNCHER,
context: {initialRouteName: AppLauncherRouteName.COMMAND_VIEW,
analyticsLocation: ApplicationCommandTriggerLocations.RECALL,
preSelectedCommand: {commandId: dataBinding.id,
prefilledOptions: dataBinding.options}}}]);
}
} else {
options = data.options;
if (options.length > 0) {
items2 = [ApplicationCommandOptionType.SUB_COMMAND];
items2[1] = ApplicationCommandOptionType.SUB_COMMAND_GROUP;
includes = items2.includes;
options = data.options;
if (Reflect.apply(includes, items2, [options[0].type])) {
dataBinding = data;
options = dataBinding.options;
items2 = [options[0].name];
options = dataBinding.options;
options = options[0].options;
r3 = options != null && options.length > 0;
if (r3) {
items3 = [ApplicationCommandOptionType.SUB_COMMAND];
items3[1] = ApplicationCommandOptionType.SUB_COMMAND_GROUP;
r3 = items3.includes(options[0].type);
}
if (r3) {
items2.push(options[0].name);
options = options[0].options;
r6 = options;
} else {
r6 = options;
}
value9 = chatInputRef == null;
if (value9) {
r1 = value9;
r3 = value2;
} else {
current = chatInputRef.current;
r1 = current == null;
r3 = current;
}
if (!r1) {
r3.openCustomKeyboard({type: KeyboardTypes.APP_LAUNCHER,
context: {initialRouteName: AppLauncherRouteName.COMMAND_VIEW,
analyticsLocation: ApplicationCommandTriggerLocations.RECALL,
preSelectedCommand: {commandId: data.id + SUB_COMMAND_KEY_SEPARATOR + items2.join(SUB_COMMAND_KEY_SEPARATOR),
prefilledOptions: r6}}});
}
} else {
value4 = chatInputRef == null;
if (value4) {
r1 = value4;
r5 = value2;
} else {
current = chatInputRef.current;
r1 = current == null;
r5 = current;
}
if (!r1) {
openCustomKeyboard = r5.openCustomKeyboard;
dataBinding = data;
Reflect.apply(openCustomKeyboard, r5, [{type: KeyboardTypes.APP_LAUNCHER,
context: {initialRouteName: AppLauncherRouteName.COMMAND_VIEW,
analyticsLocation: ApplicationCommandTriggerLocations.RECALL,
preSelectedCommand: {commandId: dataBinding.id,
prefilledOptions: dataBinding.options}}}]);
}
}
} else {
value4 = chatInputRef == null;
if (value4) {
r1 = value4;
r5 = value2;
} else {
current = chatInputRef.current;
r1 = current == null;
r5 = current;
}
if (!r1) {
openCustomKeyboard = r5.openCustomKeyboard;
dataBinding = data;
Reflect.apply(openCustomKeyboard, r5, [{type: KeyboardTypes.APP_LAUNCHER,
context: {initialRouteName: AppLauncherRouteName.COMMAND_VIEW,
analyticsLocation: ApplicationCommandTriggerLocations.RECALL,
preSelectedCommand: {commandId: dataBinding.id,
prefilledOptions: dataBinding.options}}}]);
}
}
}
return value2;
}
function _fun77614(a0, a1) { // fn#77614, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10087:10259, offset: 0x01e03efe, size: 40 bytes, params: 3, frame: 15
const Fragment = env1_4.Fragment;
return <Fragment {...{children: a0}} key={a1} />;
}
function _fun77617() { // fn#77617, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10087:10564, offset: 0x01e0414a, size: 191 bytes, params: 1, frame: 17
var value7;
var moduleValue;
const messageBinding = message;
const value2 = undefined;
if ((messageBinding == null ? value2 : message.interactionData) == null || (message == null ? value2 : message.interactionData.type) === (require(1909) /* metro dependency 1909: Server */).ApplicationCommandType.CHAT && value2 === (message == null ? value2 : message.interactionData.application_command)) {
value7 = environment.__proto__;
moduleValue = importAll(8055) /* metro dependency 8055: InteractionActionCreators */;
moduleValue.fetchMessageInteractionData(channelId, messageId);
}
return value2;
}
function getUserComponentOnPress() { // fn#77593, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10087:2789, owner: getCommandOptionComponents.getUserComponent.onPress, offset: 0x01e02b88, size: 103 bytes, params: 1, frame: 14
let value = environment.__proto__.__proto__;
value = undefined;
(importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */).hideActionSheet();
(importDefault(8743) /* metro dependency 8743: showUserProfileActionSheet */)({userId: env0_0.id,
channelId: channel == null ? value : channel.id});
return value;
}