/* Metro module 8695; source: modules/user_profile/native/UserProfilePrimaryInfo.tsx; dependencies: [31, 27, 8516, 6816, 661, 8187, 33, 4501, 697, 8696, 8697, 8706, 5278, 8708, 4573, 8710, 7122, 4008, 10497, 1244, 10499, 7635, 7007, 3857, 8501, 683, 7120, 6531, 477, 10500, 1478, 8401, 9299, 3995, 2] */ function _fun68322(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#68322, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8880:6, offset: 0x01c48e9c, size: 731 bytes, params: 8, frame: 27 var object2; const env0_0 = require; const closure = DisplayName; const closure2 = UserTagAndPronouns; const closure3 = ProfileBadgeRows; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); const env0_3 = importAll(31) /* metro dependency 31 */; let value = require(27) /* metro dependency 27 */; const env0_4 = value.Image; const env0_5 = value.View; value = require(8516) /* metro dependency 8516: Constants */; const env0_6 = value.getBadgeAssetFromCDN; const env0_7 = value.getBadgeName; value = require(6816) /* metro dependency 6816: Constants */; const env0_8 = value.DIVIDER_DOT; const env0_9 = value.PROFILE_SIDE_PADDING; const UserProfileThemeTypes = value.UserProfileThemeTypes; value = require(661) /* metro dependency 661: Constants */; const env0_11 = value.AnalyticEvents; const env0_12 = value.UserSettingsSections; const GuildTagBadgeSize = (require(8187) /* metro dependency 8187: GuildTagConstants */).GuildTagBadgeSize; value = require(33) /* metro dependency 33 */; const env0_13 = value.jsx; const env0_14 = value.jsxs; const env0_15 = value.Fragment; value = require(4501) /* metro dependency 4501: createStyles */; const createStyles = value.createStyles; object2 = {}; object2.container = {flexDirection: 'column'}; object2.displayName = {'flexDirection': 'row', 'alignItems': 'center', 'columnGap': 4}; object2.details = {'flexDirection': 'row', 'flexWrap': 'wrap', 'gap': 8}; object2.detailsText = {'flexDirection': 'row', 'flexWrap': 'wrap', 'alignContent': 'center', 'paddingVertical': 2}; object2.botTag = {marginLeft: 4}; const object3 = {'alignSelf': 'center', 'justifyContent': 'center', 'borderRadius': null, 'columnGap': 4}; object3.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm; object2.guildTag = object3; object2.transparentBackground = {backgroundColor: 'transparent'}; object2.badge = {resizeMode: 'contain'}; object2.badges = {'alignSelf': 'center', 'flexDirection': 'column', 'justifyContent': 'flex-start', 'rowGap': 8}; const object5 = {'borderRadius': null, 'paddingVertical': 2, 'justifyContent': 'flex-start', 'flexDirection': 'row', 'marginRight': 'auto', 'columnGap': 4}; object5.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm; object2.badgeRow = object5; const env0_16 = Reflect.apply(createStyles, value, [object2]); object2 = {'headingVariant': 'heading-xl/bold', 'textVariant': 'text-md/normal', 'badgeSize': 20, 'badgeRowHorizontalPadding': 7, 'guildTagBadgeSize': null, 'guildTagTextVariant': 'text-sm/medium', 'guildTagHorizontalPadding': 8}; const SIZE_16 = GuildTagBadgeSize.SIZE_16; object2.guildTagBadgeSize = SIZE_16; object2 = {}; const PREVIEW = UserProfileThemeTypes.PREVIEW; const SIZE_12 = GuildTagBadgeSize.SIZE_12; object2[PREVIEW] = {'headingVariant': 'heading-lg/bold', 'textVariant': 'text-sm/normal', 'badgeSize': 16, 'badgeRowHorizontalPadding': 6, 'guildTagBadgeSize': null, 'guildTagTextVariant': 'text-xs/medium', 'guildTagHorizontalPadding': 6, guildTagBadgeSize: SIZE_12}; (require(2) /* metro dependency 2 */).fileFinishedImporting('modules/user_profile/native/UserProfilePrimaryInfo.tsx'); exports.default = UserProfilePrimaryInfo; exports.DisplayName = closure; exports.UserTagAndPronouns = closure2; exports.ProfileBadgeRows = closure3; } function DisplayName({user, guildId, name, themeType, onPress, accessibilityHint, showChevron, pendingDisplayNameStyles, displayNameAccessibilityRole}) { // fn#68323, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8880:1564, offset: 0x01c49177, size: 341 bytes, params: 2, frame: 22 var r0; var PressableOpacity; var items2; showChevron = !(showChevron === undefined) && showChevron; var value; const styles = useStyles(); const env0_6 = getStyleConfig(themeType).headingVariant; const closure = renderDisplayName; const closure2 = renderBotTag; if (onPress == null) { value = closure(); value = {[value, closure2()]}; r0 = value; } else { PressableOpacity = (require(5278) /* metro dependency 5278: Pressables */).PressableOpacity; var pressableOpacityProps = {onPress: onPress, accessibilityRole: 'button', accessibilityLabel: name, accessibilityHint: accessibilityHint, style: styles.displayName}; items2 = [closure(), closure2()]; items2[2] = showChevron && ((ChevronSmallDownIcon) => )((require(8708) /* metro dependency 8708: ChevronSmallDownIcon */).ChevronSmallDownIcon); r0 = {items2}; } return r0; } function UserTagAndPronouns({userTag, pronouns, themeType, onPressUserTag, userTagAccessibilityHint, onPressPronouns, pronounsAccessibilityHint}) { // fn#68326, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8880:2532, offset: 0x01c49446, size: 414 bytes, params: 2, frame: 30 var jsxRuntimeEnv0_15Binding; var items2; const env0_3 = userTagAccessibilityHint; const styles = useStyles(); let r5 = pronouns != null && pronouns.length > 0; const textVariant = getStyleConfig(themeType).textVariant; const value4 = env0_3.useCallback(_fun68327, [onPressUserTag, textVariant, userTag, userTagAccessibilityHint]); const closure = renderPronouns; const value5 = value4(); if (r5) { jsxRuntimeEnv0_15Binding = jsxRuntimeEnv0_15; items2 = [((Text) => {DIVIDER_DOT})((require(4573) /* metro dependency 4573: Text */).Text)]; items2[1] = onPressUserTag != null ? ((PressableOpacity) => {closure()})((require(5278) /* metro dependency 5278: Pressables */).PressableOpacity) : {closure()}; r5 = <>{items2}; } return ( {value5} {r5} ); } function ProfileBadge({source, id, label, badgeSize, userId, themeType, showToastOnPress}) { // fn#68329, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8880:3563, offset: 0x01c496f6, size: 800 bytes, params: 2, frame: 29 showToastOnPress = showToastOnPress === undefined || showToastOnPress; let env0_3 = undefined; const styles = useStyles(); const r15 = badgeSize != null ? {width: badgeSize, height: badgeSize} : undefined; const value5 = env0_3.useRef(null); env0_3 = (require(8710) /* metro dependency 8710: useTieredTenureBadgeClickHandler */).useTieredTenureBadgeClickHandler(id, userId, themeType); const env0_4 = (require(7122) /* metro dependency 7122: AdDataUtilsAndroid */).useAdUser('profile_badge'); const rootNavigationRef = (require(4008) /* metro dependency 4008: RootNavigationRefNative */).getRootNavigationRef(); const r5 = rootNavigationRef != null && rootNavigationRef.isReady() ? rootNavigationRef.getCurrentRoute() : undefined; const showOrbsBadgeCoachmark = r5 == null || r5.params == null ? undefined : r5.params.showOrbsBadgeCoachmark; const value9 = (require(10497) /* metro dependency 10497: OrbsBadgeCoachmark */).useOrbsBadgeCoachmark({disabled: !(showOrbsBadgeCoachmark != null && showOrbsBadgeCoachmark)}); const intl = (require(1244) /* metro dependency 1244: indexNative */).intl; const formatToPlainString = intl.formatToPlainString; const A0LN9t = (require(1244) /* metro dependency 1244: indexNative */).t.A0LN9t; const value10 = Reflect.apply(formatToPlainString, intl, [A0LN9t, {badgeLabel: label}]); let YOU_SCREEN = UserProfileThemeTypes.YOU_SCREEN; const r7 = themeType === YOU_SCREEN && typeof id === 'string' ? ((Component) => )(importDefault(10499) /* metro dependency 10499: TieredTenureBadgeCoachmark */) : null; YOU_SCREEN = UserProfileThemeTypes.YOU_SCREEN; const r6 = themeType === YOU_SCREEN && typeof id === 'string' && id === 'orb_profile_badge' && value9 != null ? ((Component) => )(importDefault(10497) /* metro dependency 10497: OrbsBadgeCoachmark */) : null; const jsxRuntimeEnv0_15Binding = jsxRuntimeEnv0_15; const object2 = {}; if (showToastOnPress) { object2.children = [((PressableOpacity) => )((require(5278) /* metro dependency 5278: Pressables */).PressableOpacity), r7, r6]; } else { object2.children = [, r7, r6]; } return ((Fragment) => )(jsxRuntimeEnv0_15Binding); } function ProfileBadgeRows({userId, badges, isTryItOut, style, themeType, showToastOnPress}) { // fn#68331, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8880:5071, offset: 0x01c49c0e, size: 519 bytes, params: 2, frame: 27 var push; var object; const intl = (require(1244) /* metro dependency 1244: indexNative */).intl; var formatToPlainString; var property; var Date; var value6; var date; const env0_3 = showToastOnPress; const styles = useStyles(); const {badgeSize, badgeRowHorizontalPadding} = getStyleConfig(themeType); const value3 = badges.map(_fun68332); if (isTryItOut && badges.find(function(a0) { return a0.id === 'premium'; }) == null) { push = value3.push; var profileBadgeProps = {source: importDefault(10500) /* metro dependency 10500 */, id: 'premium', userId: userId}; formatToPlainString = intl.formatToPlainString; property = (require(1244) /* metro dependency 1244: indexNative */).t['8zbGNR']; Date = global.Date; value6 = Object.create(Date.prototype, {constructor: {value: Date}}); date = new Date(); profileBadgeProps.label = Reflect.apply(formatToPlainString, intl, [property, {date: date instanceof Object ? date : value6}]); profileBadgeProps.badgeSize = badgeSize; profileBadgeProps.showToastOnPress = showToastOnPress; Reflect.apply(push, value3, []); } const value8 = env0_3.useMemo(_fun68334, [value3, badgeRowHorizontalPadding, badgeSize, (importDefault(1478) /* metro dependency 1478: useWindowDimensionsNative */)().width]); const items2 = [styles.badges]; const string = intl.string; const VWV0y5 = (require(1244) /* metro dependency 1244: indexNative */).t.VWV0y5; return ( {value8.map(_fun68336)} ); } function GuildTag({user, themeType, style, showToastOnPress}) { // fn#68337, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8880:6011, offset: 0x01c49fb2, size: 386 bytes, params: 2, frame: 27 showToastOnPress = !(showToastOnPress === undefined) && showToastOnPress; const styles = useStyles(); const {tag, guildId} = (require(8401) /* metro dependency 8401: GuildTagUtils */).getUserPrimaryGuild(user?.primaryGuild); const {badgeSize, guildTagBadgeSize, guildTagHorizontalPadding, guildTagTextVariant} = getStyleConfig(themeType); const r6 = (require(477) /* metro dependency 477: PlatformUtils */).isAndroid() ? 2 : 4; const TextStyleSheet = (require(4573) /* metro dependency 4573: Text */).TextStyleSheet; return tag == null || guildId == null ? null : {((Component) => )(importDefault(9299) /* metro dependency 9299: GuildTag */)}; } function getStyleConfig(a0) { // fn#68338, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8880:1514, offset: 0x01c4a134, size: 38 bytes, params: 2, frame: 4 let r0 = a0 != null ? env0_18[a0] : undefined; r0 = r0 ?? env0_17; return r0; } function UserProfilePrimaryInfo({user, guildId, displayName, pronouns, style, badges, badgeContainerBackground, themeType, onPressDisplayName, displayNameAccessibilityHint, displayNameAccessibilityRole, onPressUserTag, userTagAccessibilityHint, onPressPronouns, pronounsAccessibilityHint, showChevron, showBadgeToastOnPress, pendingDisplayNameStyles}) { // fn#68339, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8880:6688, offset: 0x01c4a15a, size: 501 bytes, params: 2, frame: 38 const styles = useStyles(); const object2 = {backgroundColor: badgeContainerBackground}; const value2 = (importDefault(3995) /* metro dependency 3995: UserUtils */).useName(user); return ( ); } function renderDisplayName() { // fn#68324, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8880:1792, owner: DisplayName.renderDisplayName, offset: 0x01c492cc, size: 149 bytes, params: 1, frame: 17 const UsernameWithEffects = importDefault(8696) /* metro dependency 8696: UsernameWithEffects */; const id = user.id; const guildIdBinding = guildId; const nameBinding = name; const headingVariantBinding = headingVariant; const EffectDisplayType = (require(8697) /* metro dependency 8697: types */).EffectDisplayType; const STATIC = EffectDisplayType.STATIC; return ( ); } function renderBotTag() { // fn#68325, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8880:2020, owner: DisplayName.renderBotTag, offset: 0x01c49361, size: 229 bytes, params: 1, frame: 19 const userBinding = user; return userBinding.isSystemUser() ? ((Component) => )(importDefault(8706) /* metro dependency 8706: BotTag */) : user.bot ? ((Component) => )(importDefault(8706) /* metro dependency 8706: BotTag */) : null; } function _fun68327() { // fn#68327, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8880:2767, offset: 0x01c495e4, size: 197 bytes, params: 1, frame: 18 if (userTag == null) { return null; } const Text = (require(4573) /* metro dependency 4573: Text */).Text; const text = {userTag}; if (onPressUserTag != null) { const PressableOpacity = (require(5278) /* metro dependency 5278: Pressables */).PressableOpacity; return ( {text} ); } else { return ( {text} ); } } function renderPronouns() { // fn#68328, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8880:3070, owner: UserTagAndPronouns.renderPronouns, offset: 0x01c496a9, size: 77 bytes, params: 1, frame: 15 const Text = (require(4573) /* metro dependency 4573: Text */).Text; return ( {pronouns} ); } function ProfileBadgeOnPress() { // fn#68330, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8880:4416, owner: ProfileBadge.onPress, offset: 0x01c49a16, size: 504 bytes, params: 1, frame: 22 var advertisingId; var idBinding; var value3; var object2; var defaultImport; var open; var labelBinding; var defaultImport2; var track; var QUEST_CONTENT_VIEWED; var moduleValue; var moduleValue2; var moduleValue3; const value2 = null; if (value2 == env0_3) { idBinding = id; value3 = environment.__proto__; if (idBinding !== getBadgeName(require(dependencyMap[21]).BadgeId.GIFTING)) { defaultImport = importDefault(dependencyMap[23]); open = defaultImport.open; object2 = {}; labelBinding = label; object2.key = 'PROFILE_BADGE-' + labelBinding; object2.content = labelBinding; object2.icon = source; Reflect.apply(open, defaultImport, [object2]); if (id === require(dependencyMap[24]).QUEST_COMPLETED_BADGE) { defaultImport2 = importDefault(dependencyMap[25]); track = defaultImport2.track; QUEST_CONTENT_VIEWED = AnalyticEvents.QUEST_CONTENT_VIEWED; object2 = {}; moduleValue = require(dependencyMap[26]); copyDataProperties(object2, moduleValue.getContentProperties(require(dependencyMap[27]).QuestContent.QUEST_BADGE), dependencyMap); if (value2 != env0_4) { moduleValue2 = require(dependencyMap[28]); advertisingId = moduleValue2.isIOS() ? env0_4.advertisingId : value2; } else { advertisingId = value2; } object2['apple_advertising_id'] = advertisingId; if (value2 != env0_4) { moduleValue3 = require(dependencyMap[28]); advertisingId = moduleValue3.isAndroid() ? env0_4.advertisingId : value2; } else { advertisingId = value2; } object2['android_advertising_id'] = advertisingId; object2['is_targeted'] = false; Reflect.apply(track, defaultImport2, [QUEST_CONTENT_VIEWED, object2]); } } else { require(dependencyMap[22]).openUserSettings({screen: UserSettingsSections.PREMIUM_GIFTING, params: {}}); } } else { env0_3(); } } function _fun68332(a0) { // fn#68332, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8880:5253, offset: 0x01c49e15, size: 126 bytes, params: 2, frame: 20 const value = environment.__proto__; const profileBadgeBindingProps = {id: a0.id, userId: userId}; const object = {}; object.uri = a0.iconSrc ?? getBadgeAssetFromCDN(a0.icon); profileBadgeBindingProps.source = object; profileBadgeBindingProps.label = a0.description; profileBadgeBindingProps.badgeSize = badgeSize; profileBadgeBindingProps.themeType = themeType; profileBadgeBindingProps.showToastOnPress = showToastOnPress; return ; } function _fun68334() { // fn#68334, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8880:5672, offset: 0x01c49ea5, size: 143 bytes, params: 1, frame: 18 let Math = global.Math; const value6 = Math.floor((width - 2 * PROFILE_SIDE_PADDING - 2 * badgeRowHorizontalPadding + 4) / (badgeSize + 4)); const Array = global.Array; const from = Array.from; Math = global.Math; return Reflect.apply(from, Array, [{length: Math.ceil(env0_7.length / value6)}, _fun68335]); } function _fun68336(a0, a1) { // fn#68336, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8880:5937, offset: 0x01c49f61, size: 81 bytes, params: 3, frame: 17 return ( {a0} ); } function _fun68335(a0, a1) { // fn#68335, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8880:5765, offset: 0x01c49f34, size: 45 bytes, params: 3, frame: 15 const value = environment.__proto__; const binding = env1_7; const slice = binding.slice; const binding2 = env0_0; return Reflect.apply(slice, binding, [a1 * binding2, (a1 + 1) * binding2]); }