361 lines
19 KiB
TypeScript
361 lines
19 KiB
TypeScript
/* Metro module 8762; source: modules/user_profile/native/UserProfileAboutMeCard.tsx; dependencies: [31, 27, 1949, 1945, 1867, 6816, 661, 1483, 33, 4501, 3860, 697, 4573, 1244, 8763, 566, 5043, 21, 8765, 6819, 6771, 8514, 8767, 8743, 4080, 4008, 1230, 5459, 4015, 1583, 8768, 4578, 6815, 2] */
|
|
function _fun68561(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#68561, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8947:6, offset: 0x01c53d52, size: 517 bytes, params: 8, frame: 20
|
|
var object2;
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importAll(31) /* metro dependency 31 */;
|
|
const env0_4 = (require(27) /* metro dependency 27 */).View;
|
|
const localeStore = importDefault(1949) /* metro dependency 1949: LocaleStore */;
|
|
const guildMemberStore = importDefault(1945) /* metro dependency 1945: GuildMemberStore */;
|
|
const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
|
|
let value = require(6816) /* metro dependency 6816: Constants */;
|
|
const env0_8 = value.DIVIDER_DOT;
|
|
const UserProfileThemeTypes = value.UserProfileThemeTypes;
|
|
const env0_9 = (require(661) /* metro dependency 661: Constants */).Routes;
|
|
const env0_10 = (require(1483) /* metro dependency 1483: AppLauncherNativeConstants */).AppLauncherRouteName;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_11 = value.jsx;
|
|
const env0_12 = value.jsxs;
|
|
const env0_13 = value.Fragment;
|
|
const env0_14 = {'headingVariant': 'text-sm/semibold', 'textVariant': 'text-md/normal', 'headingSpacing': 8,
|
|
'rowGap': 24, 'columnGap': 6};
|
|
object2 = {};
|
|
const PREVIEW = UserProfileThemeTypes.PREVIEW;
|
|
object2[PREVIEW] = {'headingVariant': 'text-xs/semibold', 'textVariant': 'text-sm/normal', 'headingSpacing': 4,
|
|
'rowGap': 12, 'columnGap': 3};
|
|
const env0_17 = (require(4501) /* metro dependency 4501: createStyles */).createStyles({card: {flexDirection: 'column'},
|
|
textWithIcon: {'flexDirection': 'row', 'alignItems': 'center'}, memberJoinDates: {'flexDirection': 'row',
|
|
'flexWrap': 'wrap'}, slashCommands: {'flex': 1, 'flexDirection': 'row', 'flexWrap': 'wrap',
|
|
'marginBottom': 12}});
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/user_profile/native/UserProfileAboutMeCard.tsx');
|
|
exports.default = UserProfileAboutMeCard;
|
|
}
|
|
|
|
function Heading(a0) { // fn#68562, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8947:826, offset: 0x01c53f57, size: 177 bytes, params: 2, frame: 20
|
|
const children = a0.children;
|
|
const {headingVariant, headingSpacing} = getStyleConfig_68574(a0.themeType);
|
|
const useTokenModule = require(3860) /* metro dependency 3860: useToken */;
|
|
const useToken = useTokenModule.useToken;
|
|
const USER_PROFILE_ABOUT_ME_HEADING_TEXT_STYLE = (importDefault(697) /* metro dependency 697: native */).modules.mobile.USER_PROFILE_ABOUT_ME_HEADING_TEXT_STYLE;
|
|
const value3 = Reflect.apply(useToken, useTokenModule, [USER_PROFILE_ABOUT_ME_HEADING_TEXT_STYLE]);
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
return (
|
|
<Text
|
|
accessibilityRole="header"
|
|
variant={value3 ?? headingVariant}
|
|
color="user-profile-about-me-heading-text"
|
|
style={{marginBottom: headingSpacing}}
|
|
>
|
|
{children}
|
|
</Text>
|
|
);
|
|
}
|
|
|
|
function TextWithIcon({icon, children, themeType, accessibilityLabel}) { // fn#68563, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8947:1168, offset: 0x01c54008, size: 186 bytes, params: 2, frame: 21
|
|
const styles = useStyles();
|
|
const {textVariant, columnGap} = getStyleConfig_68574(themeType);
|
|
const items2 = [styles.textWithIcon];
|
|
items2[1] = {columnGap: columnGap};
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
return (
|
|
<View
|
|
style={items2}
|
|
accessible
|
|
accessibilityLabel={accessibilityLabel}
|
|
>
|
|
{icon}
|
|
<Text variant={textVariant} color="text-default">
|
|
{children}
|
|
</Text>
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function Bio({userId, displayProfile, pendingBio, themeType, lineClamp}) { // fn#68564, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8947:1464, offset: 0x01c540c2, size: 262 bytes, params: 2, frame: 27
|
|
var r0;
|
|
var object;
|
|
var intl;
|
|
var items2;
|
|
var value;
|
|
const textVariant = getStyleConfig_68574(themeType).textVariant;
|
|
const previewBio = displayProfile?.getPreviewBio(pendingBio);
|
|
if (previewBio == null) {
|
|
r0 = null;
|
|
} else if (previewBio === '') {
|
|
r0 = null;
|
|
} else {
|
|
object = {themeType: themeType};
|
|
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
items2 = [<Heading {...object}>{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.ZzAR2Y)}</Heading>];
|
|
value = importDefault(8763) /* metro dependency 8763: BioText */;
|
|
items2[1] = ((Component) => <Component bio={previewBio} userId={userId} textVariant={textVariant} lineClamp={lineClamp} />)(value);
|
|
value = <View>{items2}</View>;
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function MemberJoinDates({userId, guildId, themeType}) { // fn#68565, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8947:1791, offset: 0x01c541c8, size: 848 bytes, params: 2, frame: 36
|
|
var jsxRuntimeEnv0_13Binding;
|
|
var items4;
|
|
var object;
|
|
var value;
|
|
const styles = useStyles();
|
|
const {textVariant, columnGap} = getStyleConfig_68574(themeType);
|
|
const locale = (require(566) /* metro dependency 566: flux */).useStateFromStores([LocaleStore], function() {
|
|
return LocaleStore.locale;
|
|
});
|
|
const value4 = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildStore], _fun68567);
|
|
const value5 = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildMemberStore], _fun68568);
|
|
const connectionsUtilsModule = require(5043) /* metro dependency 5043: ConnectionsUtils */;
|
|
const getCreatedAtDate = connectionsUtilsModule.getCreatedAtDate;
|
|
const defaultImport = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
const value6 = Reflect.apply(getCreatedAtDate, connectionsUtilsModule, [defaultImport.extractTimestamp(userId),
|
|
locale]);
|
|
const createdAtDate = connectionsUtilsModule.getCreatedAtDate(value5?.joinedAt, locale);
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const heading = <Heading themeType={themeType}>{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.a6XYD9)}</Heading>;
|
|
const items2 = [styles.memberJoinDates];
|
|
items2[1] = {columnGap: columnGap};
|
|
const object2 = {themeType: themeType};
|
|
const ClydeIcon = (require(8765) /* metro dependency 8765: ClydeIcon */).ClydeIcon;
|
|
object2.icon = <ClydeIcon size="xs" />;
|
|
object2.accessibilityLabel = intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t['9t7w53'],
|
|
{date: value6});
|
|
const textWithIcon = <TextWithIcon {...object2}>{value6}</TextWithIcon>;
|
|
let r9 = value4 != null && createdAtDate != null;
|
|
if (r9) {
|
|
jsxRuntimeEnv0_13Binding = jsxRuntimeEnv0_13;
|
|
items4 = [((Text) => <Text variant={textVariant} color="text-default" accessibilityElementsHidden importantForAccessibility="no-hide-descendants">{DIVIDER_DOT}</Text>)((require(4573) /* metro dependency 4573: Text */).Text)];
|
|
object = {themeType: themeType};
|
|
value = importDefault(6819) /* metro dependency 6819: GuildIcon */;
|
|
object.icon = ((Component) => <Component guild={value4} size={(require(6819) /* metro dependency 6819: GuildIcon */).GuildIconSizes.XXSMALL} />)(value);
|
|
object.accessibilityLabel = intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t.FdLNDK,
|
|
|
|
{guildName: value4.name, date: createdAtDate});
|
|
items4[1] = <TextWithIcon {...object}>{createdAtDate}</TextWithIcon>;
|
|
value = <>{items4}</>;
|
|
r9 = value;
|
|
}
|
|
return (
|
|
<View>
|
|
{heading}
|
|
<View style={items2}>
|
|
{textWithIcon}
|
|
{r9}
|
|
</View>
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function BotSlashCommands({applicationId, channel, commandIds, themeType}) { // fn#68569, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8947:2918, offset: 0x01c5457c, size: 521 bytes, params: 2, frame: 30
|
|
var r6;
|
|
var r0;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
var items2;
|
|
const styles = useStyles();
|
|
const analyticsLocations = (importDefault(6771) /* metro dependency 6771: useAnalyticsLocations */)().analyticsLocations;
|
|
const userProfileAnalyticsContextModule = require(8514) /* metro dependency 8514: UserProfileAnalyticsContext */;
|
|
const useUserProfileAnalyticsContext = userProfileAnalyticsContextModule.useUserProfileAnalyticsContext;
|
|
const context = Reflect.apply(useUserProfileAnalyticsContext, userProfileAnalyticsContextModule, []).context;
|
|
const {commands, application} = (importDefault(8767) /* metro dependency 8767: useBotProfileCommands */)(channel,
|
|
applicationId, commandIds);
|
|
const binding = application;
|
|
const useCallback = binding.useCallback;
|
|
const items3 = [application];
|
|
items3[1] = channel.id;
|
|
items3[2] = channel.guild_id;
|
|
items3[3] = context;
|
|
items3[4] = analyticsLocations;
|
|
if (commands == null) {
|
|
r0 = null;
|
|
} else if (commands.length === 0) {
|
|
r0 = null;
|
|
} else {
|
|
items2 = [<Heading themeType={themeType}>{intl.string((require(1244) /* metro dependency 1244: indexNative */).t['0hKkS+'])}</Heading>];
|
|
items2[1] = <View style={styles.slashCommands}>{commands.map(_fun68573)}</View>;
|
|
r6 = application != null && application.bot != null;
|
|
r6 = r6 && ((Button) => <Button size="sm" variant="tertiary" text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.VEfKyb)} onPress={Reflect.apply(useCallback,
|
|
|
|
binding, [_fun68570, items3])} />)((require(4578) /* metro dependency 4578: ButtonNative */).Button);
|
|
items2[2] = r6;
|
|
r0 = <View>{items2}</View>;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function getStyleConfig_68574(a0) { // fn#68574, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8947:536, offset: 0x01c54a11, size: 38 bytes, params: 2, frame: 4
|
|
let r0 = a0 != null ? env0_15[a0] : undefined;
|
|
r0 = r0 ?? env0_14;
|
|
return r0;
|
|
}
|
|
|
|
function UserProfileAboutMeCard({userId, displayProfile, channel, pendingBio, bioLineClamp, themeType, style}) { // fn#68575, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8947:4305, offset: 0x01c54a37, size: 330 bytes, params: 2, frame: 26
|
|
const styles = useStyles();
|
|
const rowGap = getStyleConfig_68574(themeType).rowGap;
|
|
const application = displayProfile?.application;
|
|
const UserProfileCard = importDefault(6815) /* metro dependency 6815: UserProfileCard */;
|
|
const items3 = [styles.card];
|
|
items3[1] = {rowGap: rowGap};
|
|
items3[2] = style;
|
|
const items2 = [<Bio userId={userId} displayProfile={displayProfile} pendingBio={pendingBio} themeType={themeType} lineClamp={bioLineClamp} />];
|
|
items2[1] = <MemberJoinDates userId={userId} guildId={displayProfile?.guildId} themeType={themeType} />;
|
|
items2[2] = application?.popularApplicationCommandIds != null && channel != null && <BotSlashCommands applicationId={application.id} channel={channel} commandIds={application.popularApplicationCommandIds} themeType={themeType} />;
|
|
return (
|
|
<UserProfileCard style={items3}>
|
|
{items2}
|
|
</UserProfileCard>
|
|
);
|
|
}
|
|
|
|
function _fun68567() { // fn#68567, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8947:1995, offset: 0x01c54527, size: 40 bytes, params: 1, frame: 12
|
|
const guildIdBinding = guildId;
|
|
const value2 = null;
|
|
return value2 != guildIdBinding ? GuildStore.getGuild(guildId) : value2;
|
|
}
|
|
|
|
function _fun68568() { // fn#68568, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8947:2063, offset: 0x01c5454f, size: 45 bytes, params: 1, frame: 14
|
|
const guildIdBinding = guildId;
|
|
const value2 = null;
|
|
return value2 != guildIdBinding ? GuildMemberStore.getMember(guildId, userId) : value2;
|
|
}
|
|
|
|
function _fun68570() { // fn#68570, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8947:3158, offset: 0x01c54785, size: 340 bytes, params: 1, frame: 19
|
|
var environment;
|
|
var length;
|
|
var r5;
|
|
var bot;
|
|
var id;
|
|
var value2;
|
|
var value3;
|
|
var moduleValue;
|
|
var getUserProfileActionSheetKey;
|
|
var value4;
|
|
var defaultImport;
|
|
var hideActionSheet;
|
|
var moduleValue2;
|
|
var getRootNavigationRef;
|
|
var value5;
|
|
var isReady;
|
|
var getState;
|
|
var value6;
|
|
var routes;
|
|
var value7;
|
|
var goBack;
|
|
var value8;
|
|
var moduleValue3;
|
|
var transitionTo;
|
|
var CHANNEL;
|
|
var channelBinding;
|
|
var guild_id;
|
|
var runAfterInteractions;
|
|
let value = environment;
|
|
reducibleJoin12: while (true) {
|
|
if (application == null) {
|
|
break reducibleJoin12;
|
|
}
|
|
bot = application.bot;
|
|
if (bot == null) {
|
|
break reducibleJoin12;
|
|
}
|
|
bot = application.bot;
|
|
id = bot.id;
|
|
var env0_0 = id;
|
|
value2 = environment.__proto__;
|
|
value3 = undefined;
|
|
moduleValue = require(8743) /* metro dependency 8743: showUserProfileActionSheet */;
|
|
getUserProfileActionSheetKey = moduleValue.getUserProfileActionSheetKey;
|
|
value4 = Reflect.apply(getUserProfileActionSheetKey, moduleValue, [id]);
|
|
defaultImport = importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */;
|
|
hideActionSheet = defaultImport.hideActionSheet;
|
|
Reflect.apply(hideActionSheet, defaultImport, [value4]);
|
|
moduleValue2 = require(4008) /* metro dependency 4008: RootNavigationRefNative */;
|
|
getRootNavigationRef = moduleValue2.getRootNavigationRef;
|
|
value5 = Reflect.apply(getRootNavigationRef, moduleValue2, []);
|
|
reducibleJoin11: while (true) {
|
|
if (value5 == null) {
|
|
break reducibleJoin11;
|
|
}
|
|
isReady = value5.isReady;
|
|
if (Reflect.apply(isReady, value5, [])) {
|
|
getState = value5.getState;
|
|
value6 = Reflect.apply(getState, value5, []);
|
|
reducibleJoin7: while (true) {
|
|
if (value6 == null) {
|
|
length = value3;
|
|
break reducibleJoin7;
|
|
}
|
|
routes = value6.routes;
|
|
if (routes == null) {
|
|
length = value3;
|
|
break reducibleJoin7;
|
|
}
|
|
length = routes.length;
|
|
break reducibleJoin7;
|
|
}
|
|
value7 = 0;
|
|
r5 = length ?? value7;
|
|
if (r5 > 1) {
|
|
reducibleLoop9: while (true) {
|
|
goBack = value5.goBack;
|
|
Reflect.apply(goBack, value5, []);
|
|
value8 = typeof r5 === 'bigint' ? r5 - 1n : +r5 - 1;
|
|
if (value8 > 1) {
|
|
r5 = value8;
|
|
continue reducibleLoop9;
|
|
}
|
|
break reducibleLoop9;
|
|
}
|
|
}
|
|
moduleValue3 = require(1230) /* metro dependency 1230: router_utils */;
|
|
transitionTo = moduleValue3.transitionTo;
|
|
CHANNEL = Routes.CHANNEL;
|
|
channelBinding = channel;
|
|
guild_id = channelBinding.guild_id;
|
|
id = channelBinding.id;
|
|
Reflect.apply(transitionTo, moduleValue3, [Reflect.apply(CHANNEL, Routes, [guild_id, id])]);
|
|
break reducibleJoin11;
|
|
}
|
|
break reducibleJoin11;
|
|
}
|
|
value = require(5459) /* metro dependency 5459: RunAfterInteractionsUtils */;
|
|
runAfterInteractions = value.runAfterInteractions;
|
|
Reflect.apply(runAfterInteractions, value, [_fun68571]);
|
|
break reducibleJoin12;
|
|
}
|
|
}
|
|
|
|
function _fun68573(a0) { // fn#68573, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8947:4015, offset: 0x01c549c9, size: 72 bytes, params: 2, frame: 17
|
|
const value = environment.__proto__;
|
|
return ((Component) => <Component application={application} channel={channel} command={a0} key={a0.id} />)(importDefault(8768) /* metro dependency 8768: UserProfileAboutMeCardCommand */);
|
|
}
|
|
|
|
function _fun68571() { // fn#68571, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8947:3530, offset: 0x01c548d9, size: 145 bytes, params: 1, frame: 16
|
|
var environment;
|
|
var openCustomKeyboard;
|
|
var object2;
|
|
const bestActiveInput = (require(4015) /* metro dependency 4015: ChatInputUtils */).getBestActiveInput();
|
|
if (bestActiveInput != null) {
|
|
openCustomKeyboard = bestActiveInput.openCustomKeyboard;
|
|
object2 = {};
|
|
object2.type = (require(1583) /* metro dependency 1583: KeyboardTypes */).KeyboardTypes.APP_LAUNCHER;
|
|
value = environment.__proto__;
|
|
object2.context = {initialRouteName: AppLauncherRouteName.APPLICATION_VIEW, initiallyExpanded: true,
|
|
application: application, onPressBack: onPressBack_68572};
|
|
Reflect.apply(openCustomKeyboard, bestActiveInput, [object2]);
|
|
}
|
|
}
|
|
|
|
function onPressBack_68572() { // fn#68572, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8947:3737, offset: 0x01c5496a, size: 95 bytes, params: 1, frame: 15
|
|
let value = environment.__proto__.__proto__.__proto__;
|
|
value = importDefault(8743) /* metro dependency 8743: showUserProfileActionSheet */;
|
|
const object2 = {};
|
|
copyDataProperties(object2, context, undefined);
|
|
object2['userId'] = id;
|
|
object2['channelId'] = channel.id;
|
|
object2['sourceAnalyticsLocations'] = analyticsLocations;
|
|
value(object2);
|
|
}
|
|
|