Initial commit

This commit is contained in:
janisslsm committed 2026-07-27 16:20:00 +03:00
commit af3b49f756
16065 files changed
+2938410

No files matched your search

@@ -0,0 +1,266 @@
/* Metro module 10468; source: modules/premium/native/gifting/GiftBadgePostPurchase.tsx; dependencies: [31, 27, 7670, 10469, 1376, 33, 4501, 697, 1585, 5080, 4008, 4578, 10112, 1244, 2320, 10470, 4573, 4081, 4082, 10388, 10471, 3968, 1365, 566, 7635, 2] */
function _fun81003(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#81003, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10654:6, offset: 0x01e9497e, size: 318 bytes, params: 8, frame: 19
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 badgeDirectoryStore = importDefault(7670) /* metro dependency 7670: BadgeDirectoryStore */;
let value = require(10469) /* metro dependency 10469: GiftingBadgeConstants */;
const env0_6 = value.getRemainingGiftsToNextTier;
const env0_7 = value.getTierForProgress;
const env0_8 = value.getNextTierForProgress;
const env0_9 = (require(1376) /* metro dependency 1376: DismissibleContentConstants */).ContentDismissActionType;
value = require(33) /* metro dependency 33 */;
const env0_10 = value.jsx;
const env0_11 = value.jsxs;
const env0_12 = (require(4501) /* metro dependency 4501: createStyles */).createStyles(_fun81010);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/native/gifting/GiftBadgePostPurchase.tsx');
exports.default = GiftBadgePostPurchase;
}
function PostPurchaseFooter({onSendGift}) { // fn#81004, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10654:984, offset: 0x01e94abc, size: 414 bytes, params: 2, frame: 28
const styles = useStyles((importDefault(1585) /* metro dependency 1585: useSafeAreaInsetsNative */)().bottom);
const value2 = env0_3.useCallback(_fun81005, [onSendGift]);
const value3 = env0_3.useCallback(_fun81006, []);
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
const object = {'grow': true, 'variant': 'primary'};
const GiftIcon = (require(10112) /* metro dependency 10112: GiftIcon */).GiftIcon;
const CONTROL_PRIMARY_TEXT_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.CONTROL_PRIMARY_TEXT_DEFAULT;
object.icon = <GiftIcon size="sm" color={CONTROL_PRIMARY_TEXT_DEFAULT} />;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
object.text = intl.string((importDefault(2320) /* metro dependency 2320: GiftingBadgeMessages */).g86YiI);
object.onPress = value2;
return (
<View style={styles.footer}>
<Button {...object} />
<Button
grow
variant="secondary"
text={(require(1244) /* metro dependency 1244: indexNative */).intl.string((importDefault(2320) /* metro dependency 2320: GiftingBadgeMessages */)['sa/cfM'])}
onPress={value3}
/>
</View>
);
}
function InProgressScreen({progress, title, progressBarTitle, description, currentTier, nextTier, onSendGift}) { // fn#81007, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10654:1547, offset: 0x01e94cde, size: 424 bytes, params: 2, frame: 32
const styles = useStyles((importDefault(1585) /* metro dependency 1585: useSafeAreaInsetsNative */)().bottom);
const view = <View style={styles.progressWrapper}>{((Component) => <Component progress={progress} currentTier={currentTier} nextTier={nextTier} iconSize={48} title={progressBarTitle} />)(importDefault(10470) /* metro dependency 10470: GiftingBadgeProgress */)}</View>;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
return (
<View style={styles.screenContainer}>
<View style={styles.content}>
{view}
<View style={styles.messageSection}>
<Text variant="heading-xxl/bold" style={styles.centerText}>
{title}
</Text>
<Text
variant="text-md/medium"
color="text-subtle"
style={styles.centerText}
>
{description}
</Text>
</View>
</View>
<PostPurchaseFooter onSendGift={onSendGift} />
</View>
);
}
function LevelUpScreen({simulatedProgress, currentTier, newTier, nextTier, giftsToNextTier, onSendGift}) { // fn#81008, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10654:2151, offset: 0x01e94e86, size: 743 bytes, params: 2, frame: 44
const styles = useStyles((importDefault(1585) /* metro dependency 1585: useSafeAreaInsetsNative */)().bottom);
env0_3.useEffect(function() {
require(dependencyMap[17]).triggerHapticFeedback(importDefault(dependencyMap[18]).IMPACT_HEAVY);
}, []);
const view = <View style={styles.levelUpIconWrapper}>{newTier.simple_icon_url != null && ((Component) => <Component icon={newTier.simple_icon_url} size={140} />)(importDefault(10388) /* metro dependency 10388: GiftingBadgeIcon */)}</View>;
const value5 = ((Component) => <Component progress={simulatedProgress} currentTier={currentTier} newTier={newTier} style={styles.levelUpProgress} />)(importDefault(10471) /* metro dependency 10471: GiftingBadgeLevelUpProgress */);
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const format = intl.format;
const k8MmO8 = (importDefault(2320) /* metro dependency 2320: GiftingBadgeMessages */).k8MmO8;
const name = newTier.name;
const value6 = '';
return (
<View style={styles.screenContainer}>
<View style={styles.content}>
{view}
<View style={styles.levelUpBody}>
{value5}
<View style={styles.messageSection}>
<Text variant="heading-xxl/bold" style={styles.centerText}>
{Reflect.apply(format, intl, [k8MmO8, {tierName: name ?? value6}])}
</Text>
{nextTier != null && giftsToNextTier != null && giftsToNextTier > 0 && <Text variant="text-md/normal" color="text-subtle" style={styles.centerText}>{intl.format((importDefault(2320) /* metro dependency 2320: GiftingBadgeMessages */)['6QVlxw'],
{count: giftsToNextTier, nextTierName: nextTier.name ?? value6})}</Text>}
</View>
</View>
</View>
<PostPurchaseFooter onSendGift={onSendGift} />
</View>
);
}
function _fun81010(a0) { // fn#81010, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10654:309, offset: 0x01e951a9, size: 417 bytes, params: 2, frame: 17
const object2 = {};
object2.screenContainer = {flex: 1};
let PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object2.content = {'flex': 1, 'alignItems': 'center', 'justifyContent': 'center', padding: PX_16};
const object3 = {};
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object3.padding = PX_16;
object3.width = '100%';
const PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
object3.marginBottom = PX_24;
object2.progressWrapper = object3;
const object6 = {'gap': null, 'alignItems': 'center', 'width': '100%'};
let PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
object6.gap = PX_12;
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object6.paddingHorizontal = PX_16;
object2.messageSection = object6;
object2.centerText = {textAlign: 'center'};
const PX_48 = (importDefault(697) /* metro dependency 697: native */).space.PX_48;
object2.levelUpIconWrapper = {'paddingVertical': 26, 'paddingHorizontal': 74, marginBottom: PX_48};
PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
object2.levelUpBody = {'gap': null, 'alignItems': 'center', 'width': '100%', gap: PX_12};
object2.levelUpProgress = {maxWidth: 260};
const object7 = {width: '100%'};
PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
object7.gap = PX_12;
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object7.paddingHorizontal = PX_16;
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object7.paddingBottom = PX_16 + a0;
object2.footer = object7;
return object2;
}
function GiftBadgePostPurchase({currentProgress, onSendGift}) { // fn#81011, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10654:3208, offset: 0x01e9534a, size: 777 bytes, params: 2, frame: 31
var r12;
var r13;
var r1;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
env0_3.useEffect(function() {
var moduleValue = require(dependencyMap[21]);
var NEW_GIFTING_BADGES_COACHMARK = require(dependencyMap[22]).DismissibleContent.NEW_GIFTING_BADGES_COACHMARK;
moduleValue.UNSAFE_markDismissibleContentAsDismissed(NEW_GIFTING_BADGES_COACHMARK,
{dismissAction: ContentDismissActionType.INDIRECT_ACTION});
}, []);
const fluxModule = require(566) /* metro dependency 566: flux */;
const useStateFromStores = fluxModule.useStateFromStores;
let object = [BadgeDirectoryStore];
const value3 = Reflect.apply(useStateFromStores, fluxModule, [object, _fun81013]);
if (value3 == null) {
return null;
}
const getTierForProgressBinding = getTierForProgress;
const tierForProgressBinding = getTierForProgressBinding(value3, currentProgress);
const value5 = currentProgress + 1;
const tierForProgressBinding2 = getTierForProgressBinding(value3, value5);
const key = tierForProgressBinding2?.key;
const key2 = tierForProgressBinding?.key;
const nextTierForProgress = getNextTierForProgress(value3, value5);
const remainingGiftsToNextTier = getRemainingGiftsToNextTier(value3, value5);
if (key === key2) {
if (remainingGiftsToNextTier === 1) {
object = {};
object.title = intl.formatToPlainString((importDefault(2320) /* metro dependency 2320: GiftingBadgeMessages */).KjdBPz,
{nextTier: nextTierForProgress?.name ?? ''});
object.description = intl.string((importDefault(2320) /* metro dependency 2320: GiftingBadgeMessages */).oqDrEM);
object.progressBarTitle = intl.string((importDefault(2320) /* metro dependency 2320: GiftingBadgeMessages */)['Ka5s+Q']);
object.progress = value5;
r13 = tierForProgressBinding2 ?? undefined;
object.currentTier = r13;
r13 = nextTierForProgress ?? undefined;
object.nextTier = r13;
object.onSendGift = onSendGift;
r1 = object;
} else {
object = {};
object.title = intl.string((importDefault(2320) /* metro dependency 2320: GiftingBadgeMessages */)['/rBQud']);
object.description = intl.string((importDefault(2320) /* metro dependency 2320: GiftingBadgeMessages */).DDQMlx);
r12 = tierForProgressBinding?.name != null ? intl.formatToPlainString((importDefault(2320) /* metro dependency 2320: GiftingBadgeMessages */).bwyQt8,
{tierName: tierForProgressBinding?.name}) : '';
object.progressBarTitle = r12;
object.progress = value5;
r12 = tierForProgressBinding2 ?? undefined;
object.currentTier = r12;
r12 = nextTierForProgress ?? undefined;
object.nextTier = r12;
object.onSendGift = onSendGift;
r1 = object;
}
r1 = <InProgressScreen {...r1} />;
} else if (tierForProgressBinding2 != null) {
r1 = <LevelUpScreen simulatedProgress={value5} currentTier={tierForProgressBinding} newTier={tierForProgressBinding2} nextTier={nextTierForProgress} giftsToNextTier={remainingGiftsToNextTier} onSendGift={onSendGift} />;
} else {
if (remainingGiftsToNextTier === 1) {
object = {};
object.title = intl.formatToPlainString((importDefault(2320) /* metro dependency 2320: GiftingBadgeMessages */).KjdBPz,
{nextTier: nextTierForProgress?.name ?? ''});
object.description = intl.string((importDefault(2320) /* metro dependency 2320: GiftingBadgeMessages */).oqDrEM);
object.progressBarTitle = intl.string((importDefault(2320) /* metro dependency 2320: GiftingBadgeMessages */)['Ka5s+Q']);
object.progress = value5;
r13 = tierForProgressBinding2 ?? undefined;
object.currentTier = r13;
r13 = nextTierForProgress ?? undefined;
object.nextTier = r13;
object.onSendGift = onSendGift;
r1 = object;
} else {
object = {};
object.title = intl.string((importDefault(2320) /* metro dependency 2320: GiftingBadgeMessages */)['/rBQud']);
object.description = intl.string((importDefault(2320) /* metro dependency 2320: GiftingBadgeMessages */).DDQMlx);
r12 = tierForProgressBinding?.name != null ? intl.formatToPlainString((importDefault(2320) /* metro dependency 2320: GiftingBadgeMessages */).bwyQt8,
{tierName: tierForProgressBinding?.name}) : '';
object.progressBarTitle = r12;
object.progress = value5;
r12 = tierForProgressBinding2 ?? undefined;
object.currentTier = r12;
r12 = nextTierForProgress ?? undefined;
object.nextTier = r12;
object.onSendGift = onSendGift;
r1 = object;
}
r1 = <InProgressScreen {...r1} />;
}
return r1;
}
function _fun81005() { // fn#81005, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10654:1075, offset: 0x01e94c5a, size: 48 bytes, params: 1, frame: 11
const value = environment.__proto__;
(importDefault(5080) /* metro dependency 5080: ModalActionCreators */).pop();
onSendGift();
}
function _fun81006() { // fn#81006, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10654:1122, offset: 0x01e94c8a, size: 84 bytes, params: 1, frame: 13
let value = environment.__proto__;
(importDefault(5080) /* metro dependency 5080: ModalActionCreators */).pop();
value = require(4008) /* metro dependency 4008: RootNavigationRefNative */;
value = value.getRootNavigationRef();
if (value != null) {
value.navigate('you');
}
}
function _fun81013() { // fn#81013, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10654:3478, offset: 0x01e956a3, size: 69 bytes, params: 1, frame: 13
let value = environment.__proto__;
const getBadgeById = BadgeDirectoryStore.getBadgeById;
value = undefined;
const BadgeId = (require(7635) /* metro dependency 7635: BadgeId */).BadgeId;
const GIFTING = BadgeId.GIFTING;
const value2 = Reflect.apply(getBadgeById, BadgeDirectoryStore, [GIFTING]);
return value2 == null ? value : value2.tiers;
}
@@ -0,0 +1,141 @@
/* Metro module 11771; source: modules/premium/native/gifting/PremiumAnimatedGiftButton.tsx; dependencies: [31, 4502, 33, 4501, 697, 1357, 3860, 566, 477, 4017, 5278, 6760, 2] */
function _fun90148(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#90148, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11957:6, offset: 0x0202dada, size: 209 bytes, params: 8, frame: 19
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(31) /* metro dependency 31 */).useRef;
const accessibilityStore = importDefault(4502) /* metro dependency 4502: AccessibilityStore */;
const env0_6 = (require(33) /* metro dependency 33 */).jsx;
const env0_7 = (require(4501) /* metro dependency 4501: createStyles */).createStyles(_fun90149);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/native/gifting/PremiumAnimatedGiftButton.tsx');
exports.PremiumAnimatedGiftButton = PremiumAnimatedGiftButton;
}
function _fun90149(a0, a1) { // fn#90149, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11957:171, offset: 0x0202dbab, size: 204 bytes, params: 3, frame: 19
const object4 = {};
const object5 = {};
const REDESIGN_BUTTON_TERTIARY_BACKGROUND = (importDefault(697) /* metro dependency 697: native */).colors.REDESIGN_BUTTON_TERTIARY_BACKGROUND;
object5.backgroundColor = REDESIGN_BUTTON_TERTIARY_BACKGROUND;
object5.width = a0;
object5.height = a0;
object5.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
object5.marginHorizontal = a1;
object5.display = 'flex';
object5.alignItems = 'center';
object5.justifyContent = 'center';
object4.container = object5;
const object6 = {width: a0, height: a0};
object6.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
object6.marginHorizontal = a1;
object6.display = 'flex';
object6.alignItems = 'center';
object6.justifyContent = 'center';
object4.containerRefresh = object6;
object4.animation = {'width': 30, 'height': 30};
object4.animationRefresh = {'width': 24, 'height': 24};
return object4;
}
function PremiumAnimatedGiftButton(a0) { // fn#90150, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11957:727, offset: 0x0202dc77, size: 698 bytes, params: 2, frame: 33
const active = a0.active;
const style = a0.style;
const activeStyle = a0.activeStyle;
const disabled = a0.disabled;
const accessibilityState = a0.accessibilityState;
const channelId = a0.channelId;
const animationDataUrl = a0.animationDataUrl;
const onAnimationFinished = a0.onAnimationFinished;
const loop = a0.loop;
const value2 = undefined;
const mobileVisualRefreshExperimentModule = require(1357) /* metro dependency 1357: MobileVisualRefreshExperiment */;
const useMobileVisualRefreshConfig = mobileVisualRefreshExperimentModule.useMobileVisualRefreshConfig;
const enabled = Reflect.apply(useMobileVisualRefreshConfig, mobileVisualRefreshExperimentModule,
[{location: 'PremiumAnimatedGiftButton'}]).enabled;
const useTokenModule = require(3860) /* metro dependency 3860: useToken */;
let useToken = useTokenModule.useToken;
const CHAT_INPUT_ACTION_BUTTON_SIZE = (importDefault(697) /* metro dependency 697: native */).modules.mobile.CHAT_INPUT_ACTION_BUTTON_SIZE;
const value3 = Reflect.apply(useToken, useTokenModule, [CHAT_INPUT_ACTION_BUTTON_SIZE]);
const moduleValue3 = useTokenModule;
useToken = moduleValue3.useToken;
const CHAT_INPUT_ACTION_BUTTON_MARGIN = (importDefault(697) /* metro dependency 697: native */).modules.mobile.CHAT_INPUT_ACTION_BUTTON_MARGIN;
const value4 = Reflect.apply(useToken, moduleValue3, [CHAT_INPUT_ACTION_BUTTON_MARGIN]);
const moduleValue4 = useTokenModule;
useToken = moduleValue4.useToken;
const CHAT_INPUT_ACTION_BUTTON_MIN_TOUCH_TARGET_SIZE = (importDefault(697) /* metro dependency 697: native */).modules.mobile.CHAT_INPUT_ACTION_BUTTON_MIN_TOUCH_TARGET_SIZE;
const value5 = Reflect.apply(useToken, moduleValue4, [CHAT_INPUT_ACTION_BUTTON_MIN_TOUCH_TARGET_SIZE]);
const styles = useStyles(value3, value4);
const Math = global.Math;
const value6 = Math.max(0, (value5 - value3) / 2);
const value7 = useRef(null);
const useReducedMotion = (require(566) /* metro dependency 566: flux */).useStateFromStores([AccessibilityStore],
function() {
return AccessibilityStore.useReducedMotion;
});
env0_3.useEffect(_fun90152, [channelId, useReducedMotion]);
const View = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
const FadeOut = useReducedMotion ? value2 : (require(4017) /* metro dependency 4017: ReanimatedRexport */).FadeOut;
const PressableOpacity = (require(5278) /* metro dependency 5278: Pressables */).PressableOpacity;
const object = {};
const r23 = enabled ? styles.containerRefresh : styles.container;
object.style = [r23, style, active && !disabled && activeStyle];
object.hitSlop = value6 > 0 ? value6 : value2;
object.accessibilityRole = 'button';
const object4 = {disabled: disabled};
copyDataProperties(object4, accessibilityState, r23);
object.accessibilityState = object4;
copyDataProperties(object, a0, r23);
let value = importDefault(6760) /* metro dependency 6760: LottieAnimationView */;
value = ((Component) => <Component ref={value7} style={enabled ? styles.animationRefresh : styles.animation} source={{uri: animationDataUrl}} loop={loop} autoPlay={false} onAnimationFinish={onAnimationFinished} />)(value);
return (
<View exiting={FadeOut}>
<PressableOpacity {...object}>
{value}
</PressableOpacity>
</View>
);
}
function _fun90152() { // fn#90152, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11957:1355, offset: 0x0202df31, size: 143 bytes, params: 1, frame: 14
var r0;
var r3;
var r1;
var value2;
var value3;
var moduleValue;
var value4;
var current;
var value6;
if (!useReducedMotion) {
value2 = environment.__proto__;
value3 = undefined;
moduleValue = require(477) /* metro dependency 477: PlatformUtils */;
if (moduleValue.isIOS()) {
value4 = env0_0 == null;
if (value4) {
r0 = value4;
r3 = value3;
} else {
current = env0_0.current;
r0 = current == null;
r3 = current;
}
if (!r0) {
r3.reset();
}
}
value6 = env0_0 == null;
if (value6) {
r0 = value6;
r1 = value3;
} else {
current = env0_0.current;
r0 = current == null;
r1 = current;
}
if (!r0) {
r1.play();
}
}
}
@@ -0,0 +1,67 @@
/* Metro module 10394; source: modules/premium/native/gifting/PremiumFeaturesPromotionalLogo.tsx; dependencies: [57, 31, 4502, 33, 566, 7897, 477, 10395, 5475, 2] */
function _fun80492(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#80492, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10580:6, offset: 0x01e7decf, size: 174 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
const env0_4 = importAll(31) /* metro dependency 31 */;
const accessibilityStore = importDefault(4502) /* metro dependency 4502: AccessibilityStore */;
const env0_6 = (require(33) /* metro dependency 33 */).jsx;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/native/gifting/PremiumFeaturesPromotionalLogo.tsx');
exports.default = PremiumFeaturesPromotionalLogo;
}
function PremiumFeaturesPromotionalLogo({rotatingAvatarImageUrl, promoRotatingStyle, shouldAnimate}) { // fn#80493, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10580:249, offset: 0x01e7df7d, size: 412 bytes, params: 2, frame: 26
var r0;
shouldAnimate = shouldAnimate === undefined || shouldAnimate;
var env0_4 = undefined;
var value;
const useReducedMotion = (require(566) /* metro dependency 566: flux */).useStateFromStores([AccessibilityStore],
function() {
return AccessibilityStore.useReducedMotion;
});
const binding = env0_4;
const value3 = binding.useRef(null);
const value4 = (require(7897) /* metro dependency 7897: APNGPlayerAndroid */).useAPNGPlayerControls(value3);
var [property, env0_4] = undefined(binding.useState(false), 2);
binding.useEffect(_fun80495, [shouldAnimate, value4, useReducedMotion]);
(importDefault(10395) /* metro dependency 10395: useTimeout */)(_fun80496, property ? 100 : null);
const platformUtilsModule = require(477) /* metro dependency 477: PlatformUtils */;
if (platformUtilsModule.isAndroid()) {
if (useReducedMotion) {
value = importDefault(5475) /* metro dependency 5475: FastImage */;
value = ((Component) => <Component style={promoRotatingStyle} resizeMode="contain" source={{uri: rotatingAvatarImageUrl}} />)(value);
r0 = value;
} else {
const APNGPlayer = (require(7897) /* metro dependency 7897: APNGPlayerAndroid */).APNGPlayer;
r0 = <APNGPlayer ref={value3} url={rotatingAvatarImageUrl} autoplay={false} style={promoRotatingStyle} />;
}
} else {
value = importDefault(5475) /* metro dependency 5475: FastImage */;
value = ((Component) => <Component style={promoRotatingStyle} resizeMode="contain" source={{uri: rotatingAvatarImageUrl}} />)(value);
r0 = value;
}
return r0;
}
function _fun80495() { // fn#80495, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10580:532, offset: 0x01e7e119, size: 118 bytes, params: 1, frame: 13
let value = environment.__proto__;
value = require(477) /* metro dependency 477: PlatformUtils */;
value = value.isAndroid();
if (value && !useReducedMotion) {
if (shouldAnimate) {
env0_2.seek(0);
env0_4(true);
} else {
env0_4(false);
env0_2.stop();
}
}
}
function _fun80496() { // fn#80496, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10580:621, offset: 0x01e7e18f, size: 28 bytes, params: 1, frame: 9
if (env0_3) {
env0_2.play();
}
}
@@ -0,0 +1,132 @@
/* Metro module 10472; source: modules/premium/native/gifting/PremiumGiftAnalytics.tsx; dependencies: [31, 661, 7669, 7294, 683, 1244, 7295, 2] */
function _fun81025(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#81025, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10658:6, offset: 0x01e96141, size: 143 bytes, params: 8, frame: 18
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(661) /* metro dependency 661: Constants */).AnalyticEvents;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/native/gifting/PremiumGiftAnalytics.tsx');
exports.default = PremiumGiftAnalytics;
}
function PremiumGiftAnalytics({currentStep, children}) { // fn#81026, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10658:230, offset: 0x01e961d0, size: 224 bytes, params: 2, frame: 20
const {customGiftMessage, productId,
basePurchaseAnalytics} = (require(7669) /* metro dependency 7669: NativeGiftContext */).useNativeGiftContext();
const binding = basePurchaseAnalytics;
const value = binding.useRef(null);
const Date = global.Date;
const value3 = Date.now();
const env0_5 = binding.useRef(value3);
const env0_6 = binding.useRef(value3);
binding.useEffect(_fun81027, [basePurchaseAnalytics, currentStep, value, customGiftMessage, productId]);
binding.useEffect(function() {
return _fun81029;
}, [basePurchaseAnalytics, value]);
return children;
}
function _fun81027() { // fn#81027, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10658:465, offset: 0x01e962b0, size: 584 bytes, params: 1, frame: 25
var r15;
var value2;
var value3;
var moduleValue;
var trackPaymentFlowStartedAnalyticsAndCTP;
var basePurchaseAnalyticsBinding;
var defaultImport;
var track;
var PAYMENT_FLOW_LOADED;
var object2;
var moduleValue2;
var getPaymentFlowStepAnalyticsFields;
var value4;
var defaultImport2;
var PAYMENT_FLOW_SUCCEEDED;
var moduleValue3;
var productIdBinding;
var customGiftMessageBinding;
var intl;
var defaultImport3;
var PAYMENT_FLOW_STEP;
var moduleValue4;
var object3;
let currentStepBinding = currentStep;
let current = env0_4.current;
if (currentStepBinding !== current) {
value2 = global.Date.now();
current = env0_4.current;
if (current != null) {
currentStepBinding = currentStep;
value4 = environment.__proto__;
if (currentStepBinding === (require(7294) /* metro dependency 7294: PremiumAnalyticsUtils */).PaymentFlowStep.CONFIRM) {
defaultImport2 = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
track = defaultImport2.track;
PAYMENT_FLOW_SUCCEEDED = AnalyticEvents.PAYMENT_FLOW_SUCCEEDED;
object2 = {};
moduleValue3 = require(7294) /* metro dependency 7294: PremiumAnalyticsUtils */;
getPaymentFlowStepAnalyticsFields = moduleValue3.getPaymentFlowStepAnalyticsFields;
basePurchaseAnalyticsBinding = basePurchaseAnalytics;
productIdBinding = productId;
copyDataProperties(object2, Reflect.apply(getPaymentFlowStepAnalyticsFields, moduleValue3,
[basePurchaseAnalyticsBinding, {subscription_plan_gateway_plan_id: productIdBinding}]),
productIdBinding);
customGiftMessageBinding = customGiftMessage;
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
object2['is_custom_message_edited'] = customGiftMessageBinding !== intl.string((require(1244) /* metro dependency 1244: indexNative */).t.ZkOo1U);
object2['is_custom_emoji_sound_available'] = false;
Reflect.apply(track, defaultImport2, [PAYMENT_FLOW_SUCCEEDED, object2]);
r15 = productIdBinding;
}
defaultImport3 = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
track = defaultImport3.track;
PAYMENT_FLOW_STEP = AnalyticEvents.PAYMENT_FLOW_STEP;
object2 = {};
moduleValue4 = require(7294) /* metro dependency 7294: PremiumAnalyticsUtils */;
getPaymentFlowStepAnalyticsFields = moduleValue4.getPaymentFlowStepAnalyticsFields;
basePurchaseAnalyticsBinding = basePurchaseAnalytics;
object3 = {};
current = env0_4.current;
object3.from_step = current;
object3.to_step = currentStep;
current = env0_6.current;
object3.step_duration_ms = value2 - current;
current = env0_5.current;
object3.flow_duration_ms = value2 - current;
object3.subscription_plan_gateway_plan_id = productId;
copyDataProperties(object2, Reflect.apply(getPaymentFlowStepAnalyticsFields, moduleValue4,
[basePurchaseAnalyticsBinding, object3]), r15);
Reflect.apply(track, defaultImport3, [PAYMENT_FLOW_STEP, object2]);
} else {
value3 = environment.__proto__;
moduleValue = require(7295) /* metro dependency 7295: PaymentFlowStartedTriggerPoint */;
trackPaymentFlowStartedAnalyticsAndCTP = moduleValue.trackPaymentFlowStartedAnalyticsAndCTP;
basePurchaseAnalyticsBinding = basePurchaseAnalytics;
Reflect.apply(trackPaymentFlowStartedAnalyticsAndCTP, moduleValue, [basePurchaseAnalyticsBinding]);
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
track = defaultImport.track;
PAYMENT_FLOW_LOADED = AnalyticEvents.PAYMENT_FLOW_LOADED;
object2 = {};
moduleValue2 = require(7294) /* metro dependency 7294: PremiumAnalyticsUtils */;
copyDataProperties(object2, moduleValue2.getPaymentFlowStepAnalyticsFields(basePurchaseAnalyticsBinding,
{initial_step: currentStep}), r15);
Reflect.apply(track, defaultImport, [PAYMENT_FLOW_LOADED, object2]);
}
env0_4.current = currentStep;
env0_6.current = value2;
}
}
function _fun81028() { // fn#81028, offset: 0x01e964f8, size: 11 bytes, params: 1, frame: 1
return _fun81029;
}
function _fun81029() { // fn#81029, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10658:1214, offset: 0x01e96503, size: 100 bytes, params: 1, frame: 15
var defaultImport;
const current = env1_4.current;
const PaymentFlowStep = (require(7294) /* metro dependency 7294: PremiumAnalyticsUtils */).PaymentFlowStep;
const CONFIRM = PaymentFlowStep.CONFIRM;
if (current !== CONFIRM) {
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
defaultImport.track(AnalyticEvents.PAYMENT_FLOW_CANCELED, basePurchaseAnalytics);
}
}
@@ -0,0 +1,171 @@
/* Metro module 7642; source: modules/premium/native/gifting/PremiumGiftBackgroundAnimation.android.tsx; dependencies: [57, 31, 27, 4502, 33, 4501, 566, 7643, 7644, 6760, 2] */
function _fun61186(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#61186, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7820:6, offset: 0x0171d404, size: 320 bytes, params: 8, frame: 20
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
const env0_4 = importAll(31) /* metro dependency 31 */;
const env0_5 = (require(27) /* metro dependency 27 */).View;
const accessibilityStore = importDefault(4502) /* metro dependency 4502: AccessibilityStore */;
const value = require(33) /* metro dependency 33 */;
const env0_7 = value.jsx;
const env0_8 = value.jsxs;
const env0_9 = (require(4501) /* metro dependency 4501: createStyles */).createStyles({container: {'display': 'flex',
'alignItems': 'flex-end', 'justifyContent': 'center', 'flexDirection': 'row'}, consistentHeight: {height: 300},
animation: {'maxWidth': 375, 'width': '100%', 'height': 'auto'}, baseAnimation: {'position': 'absolute',
'bottom': 0}, lottie: {height: 275}});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/native/gifting/PremiumGiftBackgroundAnimation.android.tsx');
exports.default = PremiumGiftBackgroundAnimation;
}
function PremiumGiftBackgroundAnimation({giftStyle, withConsistentHeight}) { // fn#61187, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7820:552, offset: 0x0171d544, size: 987 bytes, params: 2, frame: 38
const styles = useStyles();
const useReducedMotion = (require(566) /* metro dependency 566: flux */).useStateFromStores([AccessibilityStore],
function() {
return AccessibilityStore.useReducedMotion;
});
const binding = env0_4;
const value2 = binding.useRef(null);
const value3 = binding.useRef(null);
const env0_3 = value3;
let useState = binding.useState;
const AnimationState = (require(7643) /* metro dependency 7643: PremiumGiftingUtils */).AnimationState;
const ACTION = AnimationState.ACTION;
const value4 = Reflect.apply(useState, binding, [ACTION]);
const binding2 = env0_3;
const value5 = binding2(value4, 2);
const property = value5[0];
const env0_5 = value5[1];
useState = binding.useState;
const value8 = binding2(Reflect.apply(useState, binding, [undefined]), 2);
const property2 = value8[0];
const env0_7 = value8[1];
useState = binding.useState;
const value9 = binding2(Reflect.apply(useState, binding, [undefined]), 2);
const property3 = value9[0];
const env0_9 = value9[1];
useState = binding.useState;
const value10 = binding2(Reflect.apply(useState, binding, [false]), 2);
const property4 = value10[0];
const env0_11 = value10[1];
const value11 = binding.useMemo(_fun61189, [giftStyle]);
const value12 = binding.useMemo(_fun61190, [giftStyle]);
const lottieType = (require(7644) /* metro dependency 7644: GiftAnimationData */).getLottieType(giftStyle);
binding.useMemo(_fun61191, [property3, property2, giftStyle, property]);
const value14 = binding.useCallback(_fun61192, [property, property4]);
binding.useEffect(_fun61193, [property]);
binding.useEffect(_fun61194, [useReducedMotion]);
const items3 = [styles.container];
items3[1] = withConsistentHeight && styles.consistentHeight;
const LottieAnimationView = importDefault(6760) /* metro dependency 6760: LottieAnimationView */;
const items2 = [styles.baseAnimation];
items2[1] = styles.animation;
const LottieType = (require(7644) /* metro dependency 7644: GiftAnimationData */).LottieType;
let LOTTIE = LottieType.LOTTIE;
items2[2] = lottieType === LOTTIE && styles.lottie;
const object = {};
const value16 = property2 === giftStyle;
object.opacity = value16 ? property === (require(7643) /* metro dependency 7643: PremiumGiftingUtils */).AnimationState.LOOP ? 0 : 1 : 0;
items2[3] = object;
LOTTIE = LottieType.LOTTIE;
const value17 = !useReducedMotion;
const lottieAnimationView = <LottieAnimationView style={items2} hardwareAccelerationAndroid={lottieType === LOTTIE} ref={value2} source={value11} autoPlay={value17} onAnimationFinish={value14} loop={false} />;
const defaultImport2 = LottieAnimationView;
const items4 = [styles.animation];
LOTTIE = LottieType.LOTTIE;
items4[1] = lottieType === LOTTIE && styles.lottie;
const object2 = {};
object2.opacity = value16 ? property !== (require(7643) /* metro dependency 7643: PremiumGiftingUtils */).AnimationState.LOOP ? 0 : 1 : 0;
items4[2] = object2;
LOTTIE = LottieType.LOTTIE;
return (
<View style={items3}>
{lottieAnimationView}
{((Component) => <Component style={items4} hardwareAccelerationAndroid={lottieType === LOTTIE} ref={value3} source={value12} autoPlay={useReducedMotion ? value17 : property === (require(7643) /* metro dependency 7643: PremiumGiftingUtils */).AnimationState.LOOP} loop />)(defaultImport2)}
</View>
);
}
function _fun61189() { // fn#61189, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7820:941, offset: 0x0171d91f, size: 70 bytes, params: 1, frame: 16
let value = environment.__proto__;
value = require(7644) /* metro dependency 7644: GiftAnimationData */;
const getGiftAnimationData = value.getGiftAnimationData;
const giftStyleBinding = giftStyle;
const AnimationState = (require(7643) /* metro dependency 7643: PremiumGiftingUtils */).AnimationState;
const ACTION = AnimationState.ACTION;
return Reflect.apply(getGiftAnimationData, value, [giftStyleBinding, ACTION]);
}
function _fun61190() { // fn#61190, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7820:1026, offset: 0x0171d965, size: 70 bytes, params: 1, frame: 16
let value = environment.__proto__;
value = require(7644) /* metro dependency 7644: GiftAnimationData */;
const getGiftAnimationData = value.getGiftAnimationData;
const giftStyleBinding = giftStyle;
const AnimationState = (require(7643) /* metro dependency 7643: PremiumGiftingUtils */).AnimationState;
const LOOP = AnimationState.LOOP;
return Reflect.apply(getGiftAnimationData, value, [giftStyleBinding, LOOP]);
}
function _fun61191() { // fn#61191, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7820:1134, offset: 0x0171d9ab, size: 137 bytes, params: 1, frame: 16
var binding2;
var value2;
const AnimationState = (require(7643) /* metro dependency 7643: PremiumGiftingUtils */).AnimationState;
let binding = env0_6;
if (binding !== giftStyle) {
binding = env0_7;
binding(giftStyle);
binding = env0_11;
binding2 = env0_4;
value2 = environment.__proto__;
binding(binding2 !== AnimationState.LOOP && env0_8 != null);
binding = env0_5;
binding(AnimationState.ACTION);
}
}
function _fun61192(a0) { // fn#61192, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7820:1264, offset: 0x0171da34, size: 157 bytes, params: 2, frame: 16
var binding;
var value3;
const AnimationState = (require(7643) /* metro dependency 7643: PremiumGiftingUtils */).AnimationState;
if (env0_10) {
env0_11(false);
} else {
binding = env0_4;
value3 = environment.__proto__;
if (!(binding === AnimationState.LOOP || a0)) {
binding = env0_9;
binding(AnimationState.ACTION);
binding = env0_5;
binding(AnimationState.LOOP);
}
}
}
function _fun61193() { // fn#61193, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7820:1407, offset: 0x0171dad1, size: 102 bytes, params: 1, frame: 13
var current;
const binding = env0_4;
const AnimationState = (require(7643) /* metro dependency 7643: PremiumGiftingUtils */).AnimationState;
const LOOP = AnimationState.LOOP;
if (binding === LOOP) {
current = env0_2.current;
if (current != null) {
current.reset();
}
} else {
current = env0_3.current;
if (current != null) {
current.reset();
}
}
}
function _fun61194() { // fn#61194, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7820:1534, offset: 0x0171db37, size: 39 bytes, params: 1, frame: 9
var current;
if (useReducedMotion) {
current = env0_2.current;
if (current != null) {
current.reset();
}
}
}
@@ -0,0 +1,79 @@
/* Metro module 7641; source: modules/premium/native/gifting/PremiumGiftBackgroundSelect.tsx; dependencies: [57, 31, 27, 33, 4017, 4501, 697, 1478, 4504, 1305, 7642, 7669, 2] */
function _fun61180(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#61180, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7819:6, offset: 0x0171cfea, size: 332 bytes, params: 8, frame: 22
const env0_0 = require;
const closure = GiftBackgroundSelect;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
const env0_4 = importAll(31) /* metro dependency 31 */;
const ScrollView = (require(27) /* metro dependency 27 */).ScrollView;
let value = require(33) /* metro dependency 33 */;
const env0_5 = value.jsx;
const env0_6 = value.Fragment;
const env0_7 = value.jsxs;
const env0_8 = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).createAnimatedComponent(ScrollView);
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
const PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
const env0_9 = Reflect.apply(createStyles, value, [{scrollView: {flex: 1, marginTop: PX_24},
contentContainer: {justifyContent: 'center'}}]);
object = {code: 'function PremiumGiftBackgroundSelectTsx1(){const{STANDARD_EASING,withTiming,visibility}=this.__closure;const animationSettings={easing:STANDARD_EASING,duration:100};return{opacity:withTiming(visibility.get()?1:0,animationSettings)};}'};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/native/gifting/PremiumGiftBackgroundSelect.tsx');
exports.default = PremiumGiftBackgroundSelect;
exports.GiftBackgroundSelect = closure;
}
function GiftBackgroundSelect({giftStyle, withConsistentHeight}) { // fn#61181, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7819:578, offset: 0x0171d136, size: 473 bytes, params: 2, frame: 28
var object2;
withConsistentHeight = withConsistentHeight === undefined || withConsistentHeight;
const styles = useStyles();
const width = (importDefault(1478) /* metro dependency 1478: useWindowDimensionsNative */)().width;
const [property, env0_1] = env0_3(env0_4.useState(), 2);
const value4 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(false);
env0_4.useEffect(_fun61182, [property, value4]);
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const useAnimatedStyle = reanimatedRexportModule.useAnimatedStyle;
const closure = GiftBackgroundSelectN;
object2 = {};
const STANDARD_EASING = (require(1305) /* metro dependency 1305: native */).STANDARD_EASING;
object2.STANDARD_EASING = STANDARD_EASING;
object2.withTiming = (require(4504) /* metro dependency 4504: timing */).withTiming;
object2.visibility = value4;
closure.__closure = object2;
closure.__workletHash = 5743780040676;
closure.__initData = env0_10;
return (
<>
{((Component) => <Component giftStyle={giftStyle} withConsistentHeight={withConsistentHeight} />)(importDefault(7642) /* metro dependency 7642: PremiumGiftBackgroundAnimationAndroid */)}
{((Component) => <Component onContentSizeChange={onContentSizeChange} contentContainerStyle={[styles.contentContainer,
property != null && property < width && ({flex: 1})]} style={[styles.scrollView,
Reflect.apply(useAnimatedStyle, reanimatedRexportModule,
[closure])]} horizontal showsHorizontalScrollIndicator={false} />)(env0_8)}
</>
);
}
function PremiumGiftBackgroundSelect() { // fn#61185, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7819:1438, offset: 0x0171d3b9, size: 75 bytes, params: 1, frame: 15
const {giftStyle,
setGiftStyle} = (require(7669) /* metro dependency 7669: NativeGiftContext */).useNativeGiftContext();
return <GiftBackgroundSelect giftStyle={giftStyle} setGiftStyle={setGiftStyle} />;
}
function _fun61182() { // fn#61182, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7819:757, offset: 0x0171d30f, size: 31 bytes, params: 1, frame: 12
env0_2.set(env0_0 != null);
}
function GiftBackgroundSelectN() { // fn#61183, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7819:823, owner: GiftBackgroundSelect.N, offset: 0x0171d32e, size: 108 bytes, params: 1, frame: 18
const timingModule = require(4504) /* metro dependency 4504: timing */;
const withTiming = timingModule.withTiming;
const r2 = env0_2.get() ? 1 : 0;
const STANDARD_EASING = (require(1305) /* metro dependency 1305: native */).STANDARD_EASING;
return {opacity: Reflect.apply(withTiming, timingModule, [r2, {easing: STANDARD_EASING, duration: 100}])};
}
function GiftBackgroundSelectOnContentSizeChange(a0) { // fn#61184, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7819:1170, owner: GiftBackgroundSelect.onContentSizeChange, offset: 0x0171d39a, size: 31 bytes, params: 2, frame: 11
if (env0_0 == null) {
env0_1(a0);
}
}
@@ -0,0 +1,95 @@
/* Metro module 12158; source: modules/premium/native/gifting/PremiumGiftBackgroundSelectTile.tsx; dependencies: [31, 27, 1880, 12159, 33, 12160, 12161, 12162, 12163, 10527, 12164, 12165, 12166, 12167, 4501, 697, 1244, 2288, 5475, 2] */
function _fun93249(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#93249, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12344:6, offset: 0x020ac448, size: 535 bytes, params: 8, frame: 21
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
importAll(31) /* metro dependency 31 */;
let value = require(27) /* metro dependency 27 */;
const env0_3 = value.View;
const env0_4 = value.Pressable;
const PremiumGiftStyles = (require(1880) /* metro dependency 1880: PremiumConstants */).PremiumGiftStyles;
const env0_5 = (require(12159) /* metro dependency 12159: PremiumGiftingConstants */).GIFT_STYLE_DESCRIPTIONS;
value = require(33) /* metro dependency 33 */;
const env0_6 = value.jsx;
const env0_7 = value.jsxs;
object2 = {};
const STANDARD_BOX = PremiumGiftStyles.STANDARD_BOX;
object2[STANDARD_BOX] = importDefault(12160) /* metro dependency 12160 */;
const CAKE = PremiumGiftStyles.CAKE;
object2[CAKE] = importDefault(12161) /* metro dependency 12161 */;
const CHEST = PremiumGiftStyles.CHEST;
object2[CHEST] = importDefault(12162) /* metro dependency 12162 */;
const COFFEE = PremiumGiftStyles.COFFEE;
object2[COFFEE] = importDefault(12163) /* metro dependency 12163 */;
const NITROWEEN_STANDARD = PremiumGiftStyles.NITROWEEN_STANDARD;
object2[NITROWEEN_STANDARD] = {uri: importDefault(10527) /* metro dependency 10527: halloweenCardSmallPng */};
const SNOWGLOBE = PremiumGiftStyles.SNOWGLOBE;
object2[SNOWGLOBE] = null;
const BOX = PremiumGiftStyles.BOX;
object2[BOX] = null;
const CUP = PremiumGiftStyles.CUP;
object2[CUP] = null;
const SEASONAL_CAKE = PremiumGiftStyles.SEASONAL_CAKE;
object2[SEASONAL_CAKE] = {uri: importDefault(12164) /* metro dependency 12164: gift_cakePng */};
const SEASONAL_CHEST = PremiumGiftStyles.SEASONAL_CHEST;
object2[SEASONAL_CHEST] = {uri: importDefault(12165) /* metro dependency 12165: gift_chestPng */};
const SEASONAL_COFFEE = PremiumGiftStyles.SEASONAL_COFFEE;
object2[SEASONAL_COFFEE] = {uri: importDefault(12166) /* metro dependency 12166: gift_coffeePng */};
const SEASONAL_STANDARD_BOX = PremiumGiftStyles.SEASONAL_STANDARD_BOX;
object2[SEASONAL_STANDARD_BOX] = {uri: importDefault(12167) /* metro dependency 12167: gift_boxPng */};
const env0_9 = (require(4501) /* metro dependency 4501: createStyles */).createStyles(_fun93250);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/native/gifting/PremiumGiftBackgroundSelectTile.tsx');
exports.default = GiftBackgroundSelectTile;
exports.GIFT_STYLE_IMG = object2;
}
function _fun93250(a0) { // fn#93250, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12344:559, offset: 0x020ac65f, size: 177 bytes, params: 2, frame: 15
const object2 = {};
const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
const value2 = 0;
object2.container = {'width': 78, 'height': 44, 'justifyContent': 'center', marginEnd: PX_8,
marginStart: value2 !== a0 ? value2 : 20};
const object4 = {'position': 'absolute', 'borderColor': null, 'borderRadius': null, 'borderWidth': 2, 'flex': 1,
'width': 78, 'height': 44};
const TEXT_BRAND = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_BRAND;
object4.borderColor = TEXT_BRAND;
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
object2.selected = object4;
object2.image = {'width': 72, 'height': 38, 'alignSelf': 'center'};
return object2;
}
function GiftBackgroundSelectTile({index, selected, giftStyle, onPress}) { // fn#93251, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12344:974, offset: 0x020ac710, size: 298 bytes, params: 2, frame: 27
var r0;
var object2;
var intl;
var formatToPlainString;
var property2;
var intl2;
var items2;
var value;
const styles = useStyles(index);
const property = env0_8[giftStyle];
if (property == null) {
r0 = null;
} else {
object2 = {};
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
formatToPlainString = intl.formatToPlainString;
property2 = (importDefault(2288) /* metro dependency 2288: PremiumGiftingMessages */)['+utqaz'];
intl2 = (require(1244) /* metro dependency 1244: indexNative */).intl;
object2['aria-label'] = Reflect.apply(formatToPlainString, intl, [property2,
{giftStyle: intl2.string(GIFT_STYLE_DESCRIPTIONS[giftStyle])}]);
object2['aria-selected'] = selected;
object2.style = styles.container;
object2.onPress = onPress;
items2 = [selected && <View style={styles.selected} />];
value = importDefault(5475) /* metro dependency 5475: FastImage */;
items2[1] = ((Component) => <Component resizeMode="contain" style={styles.image} source={property} />)(value);
value = <Pressable {...object2}>{items2}</Pressable>;
r0 = value;
}
return r0;
}
@@ -0,0 +1,65 @@
/* Metro module 7680; source: modules/premium/native/gifting/PremiumGiftCustomMessage.tsx; dependencies: [31, 27, 1880, 33, 4501, 697, 1244, 7681, 7669, 2] */
function _fun61352(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#61352, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7858:6, offset: 0x01b3c6a0, size: 289 bytes, params: 8, frame: 24
const env0_0 = require;
const closure = GiftCustomMessage;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = importAll(31) /* metro dependency 31 */;
const env0_3 = (require(27) /* metro dependency 27 */).View;
const env0_4 = (require(1880) /* metro dependency 1880: PremiumConstants */).CUSTOM_GIFT_MESSAGE_MAX_LENGTH;
const env0_5 = (require(33) /* metro dependency 33 */).jsx;
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = createStylesModule.createStyles;
const object = {};
const PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
object.marginTop = PX_24;
const PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object.marginHorizontal = PX_16;
const env0_6 = Reflect.apply(createStyles, createStylesModule, [{container: object}]);
value = value.memo(_fun61356);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/native/gifting/PremiumGiftCustomMessage.tsx');
exports.default = value;
exports.GiftCustomMessage = closure;
}
function GiftCustomMessage({onFocusMessage, setMessagePosition, customGiftMessage, setCustomGiftMessage}) { // fn#61353, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7858:283, offset: 0x01b3c7c1, size: 282 bytes, params: 2, frame: 26
const styles = useStyles();
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
const ZkOo1U = (require(1244) /* metro dependency 1244: indexNative */).t.ZkOo1U;
const value2 = Reflect.apply(string, intl, [ZkOo1U]);
const value3 = env0_2.useCallback(function(a0) {
setCustomGiftMessage(a0);
}, [setCustomGiftMessage]);
const TextArea = (require(7681) /* metro dependency 7681: TextAreaNative */).TextArea;
string = intl.string;
const B3miE8 = (require(1244) /* metro dependency 1244: indexNative */).t.B3miE8;
return (
<View style={styles.container} onLayout={function(a0) {
return setMessagePosition(a0.nativeEvent.layout.y);
}}>
<TextArea
label={Reflect.apply(string, intl, [B3miE8])}
placeholder={value2}
value={customGiftMessage}
onChange={value3}
maxLength={CUSTOM_GIFT_MESSAGE_MAX_LENGTH}
onFocus={onFocusMessage}
/>
</View>
);
}
function _fun61356({onFocusMessage, setMessagePosition}) { // fn#61356, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7858:691, offset: 0x01b3c8ff, size: 100 bytes, params: 2, frame: 17
const {customGiftMessage,
setCustomGiftMessage} = (require(7669) /* metro dependency 7669: NativeGiftContext */).useNativeGiftContext();
return (
<GiftCustomMessage
onFocusMessage={onFocusMessage}
setMessagePosition={setMessagePosition}
customGiftMessage={customGiftMessage}
setCustomGiftMessage={setCustomGiftMessage}
/>
);
}
@@ -0,0 +1,93 @@
/* Metro module 10458; source: modules/premium/native/gifting/PremiumGiftCustomization.tsx; dependencies: [57, 31, 27, 1880, 33, 4501, 697, 1484, 7669, 10459, 1244, 7641, 10460, 4573, 7678, 7680, 10461, 2] */
function _fun80951(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#80951, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10644:6, offset: 0x01e9112d, size: 413 bytes, params: 8, frame: 22
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
const env0_4 = importAll(31) /* metro dependency 31 */;
let value = require(27) /* metro dependency 27 */;
const env0_5 = value.View;
const env0_6 = value.ScrollView;
const env0_7 = (require(1880) /* metro dependency 1880: PremiumConstants */).PremiumTypes;
value = require(33) /* metro dependency 33 */;
const env0_8 = value.jsx;
const env0_9 = value.Fragment;
const env0_10 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
object2 = {};
const BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
object2.container = {flex: 1, backgroundColor: BACKGROUND_BASE_LOW};
let PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
object2.scrollViewContainer = {paddingBottom: PX_24};
const object3 = {};
PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
object3.marginTop = PX_24;
const PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object3.marginLeft = PX_16;
const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object3.marginBottom = PX_8;
object3.fontSize = 14;
object2.senderHeaderTitle = object3;
const env0_11 = Reflect.apply(createStyles, value, [object2]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/native/gifting/PremiumGiftCustomization.tsx');
exports.default = PremiumGiftCustomization;
}
function PremiumGiftCustomization() { // fn#80952, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10644:594, offset: 0x01e912ca, size: 779 bytes, params: 1, frame: 35
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const value2 = (require(1484) /* metro dependency 1484: useNavigationNative */).useNavigation();
const styles = useStyles();
const value3 = (require(7669) /* metro dependency 7669: NativeGiftContext */).useNativeGiftContext();
const recipientUser = value3.recipientUser;
const premiumType = value3.premiumType;
const value4 = (require(10459) /* metro dependency 10459: useGiftingPromotionDefaultSelection */).useGiftingPromotionDefaultSelectionV2(value3.claimableRewards,
value3.selectedGiftingPromotionReward);
const binding = env0_4;
const [property, property2] = env0_3(binding.useState(0), 2);
const value7 = binding.useRef(null);
const value8 = binding.useCallback(function() {
global.setTimeout(_fun80954, 100);
}, [property]);
const TIER_2 = PremiumTypes.TIER_2;
env0_4.useEffect(_fun80955, [value2,
premiumType === TIER_2 ? intl.string((require(1244) /* metro dependency 1244: indexNative */).t.lG6a5x) : intl.string((require(1244) /* metro dependency 1244: indexNative */).t['t9uG/o'])]);
const items2 = [((Component) => <Component />)(importDefault(7641) /* metro dependency 7641: PremiumGiftBackgroundSelect */)];
items2[1] = ((Component) => <Component />)(importDefault(10460) /* metro dependency 10460: PremiumGiftDuration */);
items2[2] = recipientUser != null && <>{((Text) => <Text style={styles.senderHeaderTitle} variant="text-md/semibold">{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.NlkxGS)}</Text>)((require(4573) /* metro dependency 4573: Text */).Text)}{((Component) => <Component user={recipientUser} />)(importDefault(7678) /* metro dependency 7678: LockedRecipientField */)}{((Component) => <Component onFocusMessage={value8} setMessagePosition={property2} />)(importDefault(7680) /* metro dependency 7680: PremiumGiftCustomMessage */)}</>;
return (
<View style={styles.container}>
<ScrollView
ref={value7}
contentContainerStyle={styles.scrollViewContainer}
showsVerticalScrollIndicator={false}
>
<View>
{items2}
</View>
</ScrollView>
{((Component) => <Component defaultSelection={value4} />)(importDefault(10461) /* metro dependency 10461: PremiumGiftPurchaseButton */)}
</View>
);
}
function _fun80953() { // fn#80953, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10644:915, offset: 0x01e915d5, size: 30 bytes, params: 1, frame: 13
global.setTimeout(_fun80954, 100);
}
function _fun80955() { // fn#80955, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10644:1139, offset: 0x01e91628, size: 100 bytes, params: 1, frame: 19
const binding = env0_0;
const setOptions = binding.setOptions;
const object2 = {};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
object2.title = intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t['RMu0/q'],
{nitroTierName: env0_3});
Reflect.apply(setOptions, binding, [object2]);
}
function _fun80954() { // fn#80954, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10644:932, offset: 0x01e915f3, size: 53 bytes, params: 1, frame: 13
const value = environment.__proto__;
return env1_2.current?.scrollTo({y: env1_1, animated: true});
}
@@ -0,0 +1,89 @@
/* Metro module 10466; source: modules/premium/native/gifting/PremiumGiftDMPurchaseSuccess.tsx; dependencies: [31, 27, 33, 4501, 697, 7669, 1484, 7633, 10382, 4578, 1244, 2288, 7642, 4573, 2] */
function _fun80994(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#80994, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10652:6, offset: 0x01e93fd0, size: 297 bytes, params: 8, frame: 23
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;
let value = require(33) /* metro dependency 33 */;
const env0_5 = value.jsx;
const env0_6 = value.Fragment;
const env0_7 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
object2 = {};
const PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
object2.title = {marginTop: PX_24, textAlign: 'center'};
const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object2.description = {marginTop: PX_8, textAlign: 'center'};
const env0_8 = Reflect.apply(createStyles, value, [object2]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/native/gifting/PremiumGiftDMPurchaseSuccess.tsx');
exports.default = PremiumGiftDMSuccessBody;
exports.PremiumGiftDMSuccessActions = PremiumGiftDMSuccessActions;
}
function PremiumGiftDMSuccessBody() { // fn#80995, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10652:414, offset: 0x01e940f9, size: 320 bytes, params: 1, frame: 25
const styles = useStyles();
const nativeGiftContextModule = require(7669) /* metro dependency 7669: NativeGiftContext */;
const useNativeGiftContext = nativeGiftContextModule.useNativeGiftContext;
const giftStyle = Reflect.apply(useNativeGiftContext, nativeGiftContextModule, []).giftStyle;
const jsxRuntimeEnv0_6Binding = jsxRuntimeEnv0_6;
let value = importDefault(7642) /* metro dependency 7642: PremiumGiftBackgroundAnimationAndroid */;
value = <View>{((Component) => <Component giftStyle={giftStyle} />)(value)}</View>;
const items2 = [value];
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
const MqZXbv = (require(1244) /* metro dependency 1244: indexNative */).t.MqZXbv;
items2[1] = <Text style={styles.title} variant="heading-lg/bold">{Reflect.apply(string, intl, [MqZXbv])}</Text>;
string = intl.string;
const Y1keV0 = (require(1244) /* metro dependency 1244: indexNative */).t.Y1keV0;
items2[2] = <Text style={styles.description} variant="text-md/medium">{Reflect.apply(string, intl, [Y1keV0])}</Text>;
return (
<>
{items2}
</>
);
}
function PremiumGiftDMSuccessActions() { // fn#80996, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10652:822, offset: 0x01e94239, size: 271 bytes, params: 1, frame: 21
const {onClose,
prePurchaseGiftingBadgeProgress} = (require(7669) /* metro dependency 7669: NativeGiftContext */).useNativeGiftContext();
const value3 = (require(1484) /* metro dependency 1484: useNavigationNative */).useNavigation();
const GiftingBadgeExperiment = (require(7633) /* metro dependency 7633: GiftingBadgeExperiment */).GiftingBadgeExperiment;
const useConfig = GiftingBadgeExperiment.useConfig;
const enabled = Reflect.apply(useConfig, GiftingBadgeExperiment,
[{location: 'PremiumGiftDMSuccessActions'}]).enabled;
const value4 = enabled.useCallback(_fun80997, [enabled, prePurchaseGiftingBadgeProgress, value3, onClose]);
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
return (
<Button
text={intl.string((importDefault(2288) /* metro dependency 2288: PremiumGiftingMessages */).bGKjmg)}
variant="primary"
onPress={value4}
/>
);
}
function _fun80997() { // fn#80997, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10652:1082, offset: 0x01e94348, size: 100 bytes, params: 1, frame: 15
var binding;
var navigate;
var value2;
if (enabled) {
if (prePurchaseGiftingBadgeProgress != null) {
binding = env0_2;
navigate = binding.navigate;
value2 = environment.__proto__;
Reflect.apply(navigate, binding,
[(require(10382) /* metro dependency 10382: PremiumGiftModal */).PremiumGiftScreens.GIFTING_BADGE,
{currentProgress: prePurchaseGiftingBadgeProgress}]);
} else {
onClose();
}
} else {
onClose();
}
}
@@ -0,0 +1,125 @@
/* Metro module 10460; source: modules/premium/native/gifting/PremiumGiftDuration.tsx; dependencies: [31, 27, 1880, 33, 4501, 697, 7669, 6238, 7975, 10391, 3874, 4573, 1244, 7672, 6518, 2] */
function _fun80958(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#80958, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10646:6, offset: 0x01e91715, size: 567 bytes, params: 8, frame: 24
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;
let value = require(1880) /* metro dependency 1880: PremiumConstants */;
const env0_5 = value.PREMIUM_YEARLY_DISCOUNT_PERCENT;
const SubscriptionIntervalTypes = value.SubscriptionIntervalTypes;
value = require(33) /* metro dependency 33 */;
const env0_7 = value.jsx;
const env0_8 = value.jsxs;
const YEAR = SubscriptionIntervalTypes.YEAR;
object = [YEAR];
const MONTH = SubscriptionIntervalTypes.MONTH;
object[1] = MONTH;
value = require(4501) /* metro dependency 4501: createStyles */;
let createStyles = value.createStyles;
object = {};
let PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object.container = {marginTop: PX_8};
const object2 = {};
const BACKGROUND_BRAND = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BRAND;
object2.borderColor = BACKGROUND_BRAND;
object2.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
object2.borderWidth = 2;
object.containerSelected = object2;
object.labelContainer = {flexDirection: 'row'};
const object4 = {};
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object4.marginStart = PX_8;
const STATUS_POSITIVE_BACKGROUND = (importDefault(697) /* metro dependency 697: native */).colors.STATUS_POSITIVE_BACKGROUND;
object4.backgroundColor = STATUS_POSITIVE_BACKGROUND;
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object4.paddingHorizontal = PX_8;
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
object.labelPromo = object4;
const env0_10 = Reflect.apply(createStyles, value, [object]);
value = require(4501) /* metro dependency 4501: createStyles */;
createStyles = value.createStyles;
object = {};
const PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object.durationContainer = {marginHorizontal: PX_16};
const PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
object.durationTitle = {marginTop: PX_24};
const env0_11 = Reflect.apply(createStyles, value, [object]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/native/gifting/PremiumGiftDuration.tsx');
exports.default = PremiumGiftDuration;
}
function PremiumGiftDurationButton({selected, planInterval}) { // fn#80959, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10646:627, offset: 0x01e9194c, size: 773 bytes, params: 2, frame: 40
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const value2 = (require(7669) /* metro dependency 7669: NativeGiftContext */).useNativeGiftContext();
const premiumType = value2.premiumType;
const env0_1 = value2.setPlanInterval;
const styles = useStyles();
const r6 = selected ? (require(6238) /* metro dependency 6238: TableRowNative */).TableRow : (require(7975) /* metro dependency 7975: RowButtonNative */).RowButton;
const YEAR = SubscriptionIntervalTypes.YEAR;
const r29 = planInterval !== YEAR ? null : '' + PREMIUM_YEARLY_DISCOUNT_PERCENT + '%';
const value5 = (importDefault(10391) /* metro dependency 10391: usePremiumProductPricingString */)(premiumType,
planInterval);
const {accessibilityRole,
accessibilityState} = (require(3874) /* metro dependency 3874: useA11yRolesNative */).useRadioA11yNative({selected: selected});
const items2 = [styles.container];
items2[1] = selected && styles.containerSelected;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
const MONTH = SubscriptionIntervalTypes.MONTH;
return (
<View style={items2}>
{((Component) => <Component label={<View style={styles.labelContainer}><Text variant="text-md/semibold">{planInterval === MONTH ? intl.string((require(1244) /* metro dependency 1244: indexNative */).t.Mh9bTt) : intl.string((require(1244) /* metro dependency 1244: indexNative */).t.DRgqMo)}</Text>{r29 != null && <View style={styles.labelPromo}><Text variant="text-md/bold" color="always-white">{intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t.IAybsG,
{discount: r29}).toUpperCase()}</Text></View>}</View>} trailing={<Text variant="text-md/semibold">{value5}</Text>} onPress={function() {
setPlanInterval(planInterval);
}} arrow={false} accessibilityRole={accessibilityRole} accessibilityState={accessibilityState} start end />)(r6)}
</View>
);
}
function PremiumGiftDuration() { // fn#80961, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10646:1785, offset: 0x01e91c51, size: 314 bytes, params: 1, frame: 23
const styles = useStyles();
const nativeGiftContextModule = require(7669) /* metro dependency 7669: NativeGiftContext */;
const useNativeGiftContext = nativeGiftContextModule.useNativeGiftContext;
const env0_0 = Reflect.apply(useNativeGiftContext, nativeGiftContextModule, []).planInterval;
const defaultImport = importDefault(7672) /* metro dependency 7672: NitroGiftPriceCopyExperiment */;
const useConfig = defaultImport.useConfig;
const value3 = env0_3.useMemo(_fun80962,
[(importDefault(6518) /* metro dependency 6518: useInitialValue */)(Reflect.apply(useConfig, defaultImport,
[{location: 'PremiumGiftDuration'}]).monthlyDefaultSelected)]);
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const items2 = [<Text style={styles.durationTitle} variant="text-sm/semibold">{intl.string((require(1244) /* metro dependency 1244: indexNative */).t['8XT6Nf'])}</Text>];
items2[1] = value3.map(_fun80963);
return (
<View style={styles.durationContainer}>
{items2}
</View>
);
}
function _fun80962() { // fn#80962, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10646:1977, offset: 0x01e91d8b, size: 50 bytes, params: 1, frame: 14
var r0;
var items2;
const binding = env0_1;
const value = environment.__proto__;
const binding2 = env1_9;
if (binding) {
items2 = [];
arraySpread(items2, binding2, 0, binding2);
r0 = items2.reverse();
} else {
r0 = binding2;
}
return r0;
}
function _fun80963(a0, a1) { // fn#80963, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10646:2183, offset: 0x01e91dbd, size: 51 bytes, params: 3, frame: 15
return (
<PremiumGiftDurationButton
selected={planInterval === a0}
planInterval={a0}
key={a1}
/>
);
}
@@ -0,0 +1,235 @@
/* Metro module 10389; source: modules/premium/native/gifting/PremiumGiftFeaturesCard.tsx; dependencies: [57, 31, 27, 7261, 1880, 482, 33, 697, 4501, 6597, 566, 7583, 10390, 7947, 10391, 7672, 10392, 5475, 7962, 10393, 7966, 7964, 4573, 1244, 7971, 4578, 2] */
function _fun80476(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#80476, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10575:6, offset: 0x01e7c9a3, size: 684 bytes, params: 8, frame: 22
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
let value = importAll(31) /* metro dependency 31 */;
const env0_5 = (require(27) /* metro dependency 27 */).View;
const promotionsStore = importDefault(7261) /* metro dependency 7261: PromotionsStore */;
const premiumConstantsModule = require(1880) /* metro dependency 1880: PremiumConstants */;
const env0_7 = premiumConstantsModule.PremiumTypes;
const env0_8 = premiumConstantsModule.SubscriptionIntervalTypes;
const env0_9 = (require(482) /* metro dependency 482: Constants */).Fonts;
const value3 = require(33) /* metro dependency 33 */;
const env0_10 = value3.jsx;
const env0_11 = value3.Fragment;
const env0_12 = value3.jsxs;
object2 = {};
let PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object2.default = {paddingVertical: PX_8};
const PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
object2.compact = {paddingVertical: PX_4};
object2.smallCompact = {paddingVertical: 2};
object2 = {};
let PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
object2.default = {marginTop: PX_24};
let PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
object2.compact = {marginTop: PX_12};
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object2.smallCompact = {marginTop: PX_8};
object2 = {};
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object2.default = {marginTop: PX_8};
PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
object2.compact = {marginTop: PX_12};
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object2.smallCompact = {marginTop: PX_8};
object2 = {};
PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
object2.default = {marginTop: PX_24};
PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
object2.compact = {marginTop: PX_12};
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object2.smallCompact = {marginTop: PX_8};
const env0_17 = (require(4501) /* metro dependency 4501: createStyles */).createStyles(_fun80477);
value = value.memo(PremiumGiftFeaturesCard);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/native/gifting/PremiumGiftFeaturesCard.tsx');
exports.default = value;
}
function _fun80477() { // fn#80477, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10575:788, offset: 0x01e7cc4f, size: 652 bytes, params: 1, frame: 18
const object5 = {};
const object6 = {overflow: 'hidden'};
object6.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
object5.promotional = object6;
const object7 = {justifyContent: 'flex-start'};
object7.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
const BG_SURFACE_RAISED = (importDefault(697) /* metro dependency 697: native */).colors.BG_SURFACE_RAISED;
object7.backgroundColor = BG_SURFACE_RAISED;
const SHADOW_LOW = (importDefault(697) /* metro dependency 697: native */).shadows.SHADOW_LOW;
copyDataProperties(object7, SHADOW_LOW, undefined);
object5.card = object7;
const object8 = {};
const PX_40 = (importDefault(697) /* metro dependency 697: native */).space.PX_40;
object8.marginTop = PX_40;
let PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
object8.marginStart = PX_24;
object5.logo = object8;
PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
object5.promotionalLogo = {marginTop: PX_24};
const PX_32 = (importDefault(697) /* metro dependency 697: native */).space.PX_32;
object5.promotionalLogoSingleLine = {marginTop: PX_32};
object5.promotionalLogoSmallCompact = {marginTop: 18};
PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
object5.pricing = {maxWidth: 140, marginStart: PX_24};
PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
object5.featureTitle = {marginStart: PX_24};
const object9 = {};
const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object9.marginTop = PX_8;
PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
object9.marginHorizontal = PX_24;
object5.features = object9;
const object12 = {};
PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
object12.marginHorizontal = PX_24;
PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
object12.marginBottom = PX_24;
object5.button = object12;
const PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
object5.promotionalButton = {marginTop: PX_12};
object5.featureIcon = {'width': 24, 'height': 24};
const object14 = {};
const defaultImport = importDefault(6597) /* metro dependency 6597: TextStyles */;
const PRIMARY_NORMAL = Fonts.PRIMARY_NORMAL;
const WHITE = (importDefault(697) /* metro dependency 697: native */).colors.WHITE;
copyDataProperties(object14, defaultImport(PRIMARY_NORMAL, WHITE, 16), undefined);
object14['marginStart'] = -8;
object5.featureText = object14;
object5.wumpusNoPrice = {'height': 75, 'right': 8};
object5.promotionalCardImage = {'position': 'absolute', 'top': 0, 'left': 0, 'right': 0, 'bottom': 0};
object5.promotionalBackground = {'position': 'absolute', 'height': 300, 'width': 150, 'right': 0};
return object5;
}
function PremiumGiftFeaturesCard(a0) { // fn#80478, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10575:1839, offset: 0x01e7cedb, size: 1919 bytes, params: 2, frame: 46
var r11;
var text;
var r8;
var jsxRuntimeEnv0_11Binding;
var items5;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
var items10;
const premiumType = a0.premiumType;
const onPress = a0.onPress;
const style = a0.style;
const claimableRewards = a0.claimableRewards;
let isSelected = a0.isSelected;
const value = undefined;
isSelected = isSelected === value || isSelected;
let variant = a0.variant;
variant = variant === value ? 'default' : variant;
let object = {'premiumType': 0, 'onPress': 0, 'style': 0, 'claimableRewards': 0, 'isSelected': 0, 'variant': 0};
silentSetPrototypeOf(object, null, undefined);
const value4 = copyDataProperties({}, a0, object, undefined);
const value6 = (require(566) /* metro dependency 566: flux */).useStateFromStores([PromotionsStore], _fun80479);
const value7 = (require(10390) /* metro dependency 10390: MarketingComponentHooks */).useThemeAndReducedMotionAwareAssetUrl(value6 == null ? value : value6.cardAsset);
const value8 = (require(10390) /* metro dependency 10390: MarketingComponentHooks */).useThemeAndReducedMotionAwareAssetUrl(value6 == null ? value : value6.backgroundAsset);
const styles = useStyles(claimableRewards != null && claimableRewards.length === 1);
const value11 = (importDefault(7947) /* metro dependency 7947: usePremiumFeatures */)(premiumType);
const defaultImport = importDefault(10391) /* metro dependency 10391: usePremiumProductPricingString */;
const MONTH = SubscriptionIntervalTypes.MONTH;
const value12 = defaultImport(premiumType, MONTH);
const defaultImport2 = defaultImport;
const YEAR = SubscriptionIntervalTypes.YEAR;
const value13 = defaultImport2(premiumType, YEAR);
const {showGiftPrice,
useNewCopy} = (importDefault(7672) /* metro dependency 7672: NitroGiftPriceCopyExperiment */).useConfig({location: 'PremiumGiftFeaturesCard'});
let r13 = (importDefault(10392) /* metro dependency 10392: useShouldShowGiftingPromotionDeco */)(premiumType) && claimableRewards != null && claimableRewards.length > 0;
const r21 = r13 && value7 != null;
const binding = env0_4;
const value20 = env0_3(binding.useState(0), 2);
const property = value20[0];
const value21 = 1;
const env0_0 = value20[value21];
const value22 = binding.useCallback(_fun80480, []);
const items2 = [styles.card, style];
items2[2] = r13 && styles.promotional;
const r5 = r21 && ((Component) => <Component style={styles.promotionalCardImage} resizeMode="cover" source={{uri: value7}} />)(importDefault(5475) /* metro dependency 5475: FastImage */);
const PremiumFeaturesBackground = importDefault(7962) /* metro dependency 7962: PremiumFeaturesBackground */;
const premiumFeaturesBackgroundProps = {premiumType: premiumType, opacity: r21 ? 0.82 : value21,
style: [styles.card, style, r13 && styles.promotional], ...value4};
if (r13) {
jsxRuntimeEnv0_11Binding = jsxRuntimeEnv0_11;
items5 = [value6 != null && ((Component) => <Component giftPlanSelectionCardBannerComponent={value6} claimableRewards={claimableRewards} isSelected={isSelected} onLayout={value22} />)(importDefault(10393) /* metro dependency 10393: PremiumGiftPlanSelectPromotionalBanner */)];
items5[1] = value8 != null && ((Component) => <Component style={[styles.promotionalBackground,
{top: property}]} resizeMode="cover" source={{uri: value8}} />)(importDefault(5475) /* metro dependency 5475: FastImage */);
r11 = <>{items5}</>;
} else {
r11 = ((Component) => <Component premiumType={premiumType} style={!showGiftPrice && styles.wumpusNoPrice} />)(importDefault(7966) /* metro dependency 7966: PremiumFeaturesWumpus */);
}
object = [r11];
object[1] = ((Component) => <Component style={[styles.logo,
r13 && (value21 === claimableRewards.length ? styles.promotionalLogoSingleLine : styles.promotionalLogo),
r13 && variant === 'smallCompact' && styles.promotionalLogoSmallCompact]} premiumType={premiumType} />)(importDefault(7964) /* metro dependency 7964: PremiumFeaturesLogo */);
if (showGiftPrice) {
if (useNewCopy) {
var textProps = {'style': null, 'variant': 'text-sm/medium', 'color': 'always-white',
style: [styles.pricing,
env0_15[variant]]};
items10 = [value12, ' '];
items10[2] = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.lVQycU);
text = <Text {...textProps}>{items10}</Text>;
} else {
text = <Text style={[styles.pricing,
env0_15[variant]]} variant="text-sm/medium" color="always-white">{intl.format((require(1244) /* metro dependency 1244: indexNative */).t.Ob6fwp,
{monthlyPrice: value12, yearlyPrice: value13})}</Text>;
}
r8 = text;
} else {
r8 = showGiftPrice;
}
object[2] = r8;
const items11 = [styles.featureTitle, env0_14[variant]];
const string = intl.string;
const JgsVht = (require(1244) /* metro dependency 1244: indexNative */).t.JgsVht;
object[3] = <Text style={items11} variant="heading-sm/bold" color="always-white">{Reflect.apply(string, intl,
[JgsVht])}</Text>;
object[4] = ((Component) => <Component style={styles.features} features={value11} iconStyle={styles.featureIcon} labelStyle={styles.featureText} rowStyle={env0_13[variant]} />)(importDefault(7971) /* metro dependency 7971: PremiumFeatureList */);
object[5] = <View style={{flexGrow: value21}} />;
const items12 = [styles.button, env0_16[variant]];
r13 = r13 && styles.promotionalButton;
items12[2] = r13;
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
const TIER_0 = PremiumTypes.TIER_0;
object[6] = <View style={items12}><Button variant="experimental_premium-secondary" text={premiumType === TIER_0 ? intl.string((require(1244) /* metro dependency 1244: indexNative */).t.rk4Uu8) : intl.string((require(1244) /* metro dependency 1244: indexNative */).t.Ve9Ge6)} onPress={onPress} /></View>;
return (
<View style={items2}>
{r5}
<PremiumFeaturesBackground {...premiumFeaturesBackgroundProps}>
{object}
</PremiumFeaturesBackground>
</View>
);
}
function _fun80479() { // fn#80479, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10575:2006, offset: 0x01e7d65a, size: 111 bytes, params: 1, frame: 13
var giftPlanSelectionCardBanner;
var properties;
let value = environment.__proto__;
const getMarketingComponentByType = PromotionsStore.getMarketingComponentByType;
const MarketingComponentType = (require(7583) /* metro dependency 7583: MarketingComponentType */).MarketingComponentType;
const GIFT_PLAN_SELECTION_CARD_BANNER = MarketingComponentType.GIFT_PLAN_SELECTION_CARD_BANNER;
value = Reflect.apply(getMarketingComponentByType, PromotionsStore, [GIFT_PLAN_SELECTION_CARD_BANNER]);
const value2 = null;
if (value2 == value) {
giftPlanSelectionCardBanner = value2;
} else {
properties = value.properties;
properties = properties.properties;
if (properties.oneofKind !== 'giftPlanSelectionCardBanner') {
giftPlanSelectionCardBanner = value2;
} else {
properties = value.properties;
properties = properties.properties;
giftPlanSelectionCardBanner = properties.giftPlanSelectionCardBanner;
}
}
return giftPlanSelectionCardBanner;
}
@@ -0,0 +1,204 @@
/* Metro module 10382; source: modules/premium/native/gifting/PremiumGiftModal.tsx; dependencies: [57, 31, 1878, 33, 7294, 4501, 697, 566, 10034, 1244, 5282, 10383, 10456, 10458, 10463, 2320, 10468, 10381, 6789, 6771, 6518, 491, 5080, 3815, 7636, 7669, 10472, 5280, 2] */
function _fun80412(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#80412, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10568:6, offset: 0x01e79964, size: 485 bytes, params: 8, frame: 22
var object3;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
const env0_4 = importAll(31) /* metro dependency 31 */;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
const env0_6 = (require(33) /* metro dependency 33 */).jsx;
object3 = {PLAN_SELECT: 'PremiumGiftPlanSelect', REWARD_SELECT: 'GiftingSKUSelect',
CUSTOMIZATION: 'PremiumGiftCustomization', SUCCESS: 'PremiumGiftSuccess',
GIFTING_BADGE: 'GiftingBadgePostPurchase'};
const object4 = {};
let PLAN_SELECT = object3.PLAN_SELECT;
const PaymentFlowStep = (require(7294) /* metro dependency 7294: PremiumAnalyticsUtils */).PaymentFlowStep;
const SKU_SELECT = PaymentFlowStep.SKU_SELECT;
object4[PLAN_SELECT] = SKU_SELECT;
const REWARD_SELECT = object3.REWARD_SELECT;
const REWARD_SKU_SELECT = PaymentFlowStep.REWARD_SKU_SELECT;
object4[REWARD_SELECT] = REWARD_SKU_SELECT;
const CUSTOMIZATION = object3.CUSTOMIZATION;
PLAN_SELECT = PaymentFlowStep.PLAN_SELECT;
object4[CUSTOMIZATION] = PLAN_SELECT;
const SUCCESS = object3.SUCCESS;
let CONFIRM = PaymentFlowStep.CONFIRM;
object4[SUCCESS] = CONFIRM;
const GIFTING_BADGE = object3.GIFTING_BADGE;
CONFIRM = PaymentFlowStep.CONFIRM;
object4[GIFTING_BADGE] = CONFIRM;
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = createStylesModule.createStyles;
const BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
const env0_9 = Reflect.apply(createStyles, createStylesModule, [{header: {backgroundColor: BACKGROUND_BASE_LOW,
shadowColor: 'transparent'}}]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/native/gifting/PremiumGiftModal.tsx');
exports.default = PremiumGiftModal;
exports.PremiumGiftScreens = object3;
}
function PremiumGiftModal({recipientUserId, premiumType, planInterval, analyticsLocation, analyticsLocations, initialRoute, order, onDismiss}) { // fn#80413, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10568:829, offset: 0x01e79b49, size: 613 bytes, params: 2, frame: 33
var r0;
var UnsupportedFeatureModal;
var intl;
var AnalyticsLocationProvider;
var NativeGiftContextProvider;
var object3;
var value;
const analyticsLocations2 = (importDefault(6771) /* metro dependency 6771: useAnalyticsLocations */)(analyticsLocations).analyticsLocations;
const value2 = (importDefault(6518) /* metro dependency 6518: useInitialValue */)(_fun80414);
const env0_3 = value2;
let binding = undefined;
const useMemo = binding.useMemo;
let object = [value2, analyticsLocation, analyticsLocations];
const value3 = Reflect.apply(useMemo, binding, [_fun80415, object]);
const r2 = initialRoute ?? (premiumType != null ? env0_7.CUSTOMIZATION : env0_7.PLAN_SELECT);
binding = undefined;
const value4 = binding.useCallback(_fun80416, [onDismiss]);
const value5 = useGetScreens(r2, value4, recipientUserId);
const value7 = env0_3(binding.useState(env0_8[r2]), 2);
if ((require(3815) /* metro dependency 3815: BillingPlatformUtils */).isPremiumGiftingSupported()) {
AnalyticsLocationProvider = (require(6771) /* metro dependency 6771: useAnalyticsLocations */).AnalyticsLocationProvider;
object = {value: analyticsLocations2};
NativeGiftContextProvider = (require(7669) /* metro dependency 7669: NativeGiftContext */).NativeGiftContextProvider;
object3 = {basePurchaseAnalytics: value3, recipientUserId: recipientUserId, onClose: value4,
setCurrentAnalyticsStep: value7[1], premiumType: premiumType, planInterval: planInterval,
initialOrder: order};
value = importDefault(10472) /* metro dependency 10472: PremiumGiftAnalytics */;
value = <AnalyticsLocationProvider {...object}><NativeGiftContextProvider {...object3}>{((Component) => <Component currentStep={value7[0]}>{((Navigator) => <Navigator initialRouteName={r2} screens={value5} onStateChange={onStateChange} />)((require(5280) /* metro dependency 5280: NavigatorNative */).Navigator)}</Component>)(value)}</NativeGiftContextProvider></AnalyticsLocationProvider>;
r0 = value;
} else {
UnsupportedFeatureModal = importDefault(7636) /* metro dependency 7636: UnsupportedFeatureModal */;
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
r0 = <UnsupportedFeatureModal title={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['JCFN/y'])} />;
}
return r0;
}
function _fun80415() { // fn#80415, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10568:1063, offset: 0x01e79dd3, size: 77 bytes, params: 1, frame: 13
const value = environment.__proto__;
return (require(7294) /* metro dependency 7294: PremiumAnalyticsUtils */).getBasePurchaseFlowAnalyticsFields({isGift: true,
analyticsLoadId: env0_3, analyticsLocation: analyticsLocation, analyticsLocations: analyticsLocations});
}
function _fun80416() { // fn#80416, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10568:1259, offset: 0x01e79e20, size: 58 bytes, params: 1, frame: 12
const value = environment.__proto__;
(importDefault(5080) /* metro dependency 5080: ModalActionCreators */).pop();
if (onDismiss != null) {
onDismiss();
}
}
function useGetScreens(a0, a1, a2) { // fn#80417, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10568:1301, owner: PremiumGiftModal.useGetScreens, offset: 0x01e79e5a, size: 802 bytes, params: 4, frame: 25
var object4;
var environment;
var r1;
var object2;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const env0_0 = a2;
const value = environment.__proto__;
const styles = useStyles();
const value2 = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], _fun80418);
const value3 = (require(10034) /* metro dependency 10034: useWishlistHooks */).useFetchWishlistAndProfileInfoForUser(a2);
const env0_1 = value3.wishlist;
const env0_2 = value3.userProfile;
const env0_3 = value3.wishlistId;
const env0_4 = value3.error;
const value4 = (require(10034) /* metro dependency 10034: useWishlistHooks */).useShouldShowWishlistInDMGifting({'isGift': true,
'giftRecipient': null, 'isSocialLayerStorefrontEnabled': false, giftRecipient: value2});
object4 = {};
const PLAN_SELECT = env1_7.PLAN_SELECT;
if (value4) {
object2 = {};
object2.title = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['JCFN/y']);
object2.headerLeft = (require(5282) /* metro dependency 5282: NavigatorHeaderNative */).getHeaderCloseButton(a1);
object2.headerStyle = styles.header;
object2.render = render_80419;
r1 = object2;
} else {
r1 = {'title': '', 'headerShown': false, render: render_80420};
}
object4[PLAN_SELECT] = r1;
let binding = env1_7;
const REWARD_SELECT = binding.REWARD_SELECT;
const REWARD_SELECT2 = binding.REWARD_SELECT;
object4[REWARD_SELECT] = {title: '',
headerLeft: a0 === REWARD_SELECT2 ? (require(5282) /* metro dependency 5282: NavigatorHeaderNative */).getHeaderCloseButton(a1) : (require(5282) /* metro dependency 5282: NavigatorHeaderNative */).getHeaderBackButton(),
headerStyle: styles.header, render: render_80421};
binding = env1_7;
const CUSTOMIZATION = binding.CUSTOMIZATION;
const CUSTOMIZATION2 = binding.CUSTOMIZATION;
object4[CUSTOMIZATION] = {title: '',
headerLeft: a0 === CUSTOMIZATION2 ? (require(5282) /* metro dependency 5282: NavigatorHeaderNative */).getHeaderCloseButton(a1) : (require(5282) /* metro dependency 5282: NavigatorHeaderNative */).getHeaderBackButton(),
headerStyle: styles.header, render: render_80422};
binding = env1_7;
const SUCCESS = binding.SUCCESS;
const object5 = {title: ''};
object5.headerLeft = (require(5282) /* metro dependency 5282: NavigatorHeaderNative */).getHeaderCloseButton(a1);
object5.headerStyle = styles.header;
object5.render = render_80423;
object4[SUCCESS] = object5;
const GIFTING_BADGE = binding.GIFTING_BADGE;
const object8 = {};
object8.title = intl.string((importDefault(2320) /* metro dependency 2320: GiftingBadgeMessages */).roVAey);
object8.headerLeft = (require(5282) /* metro dependency 5282: NavigatorHeaderNative */).getHeaderCloseButton(a1);
object8.headerTransparent = true;
object8.headerStyle = {'backgroundColor': 'transparent', 'shadowColor': 'transparent'};
object8.render = render_80424;
object4[GIFTING_BADGE] = object8;
return object4;
}
function PremiumGiftModalOnStateChange(a0) { // fn#80426, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10568:3384, owner: PremiumGiftModal.onStateChange, offset: 0x01e7a385, size: 58 bytes, params: 2, frame: 11
var name;
var value;
var binding;
if (a0 != null) {
name = a0.routes[a0.index].name;
binding = env0_4;
value = environment.__proto__;
binding(env1_8[name]);
}
}
function _fun80418() { // fn#80418, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10568:1375, offset: 0x01e7a17c, size: 40 bytes, params: 1, frame: 12
const value2 = null;
return value2 != importDefault ? UserStore.getUser(importDefault) : value2;
}
function useGetScreensRender() { // fn#80419, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10568:1763, owner: PremiumGiftModal.useGetScreens.render, offset: 0x01e7a1a4, size: 51 bytes, params: 1, frame: 13
const value = environment.__proto__.__proto__;
return ((Component) => <Component shouldUseDMWishlistGiftingDesign isLoadingWishlist={false} />)(importDefault(10383) /* metro dependency 10383: PremiumGiftPlanSelect */);
}
function useGetScreensRender_80420() { // fn#80420, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10568:1871, owner: PremiumGiftModal.useGetScreens.render, offset: 0x01e7a1d7, size: 124 bytes, params: 1, frame: 19
const value = environment.__proto__.__proto__;
return ((Component) => <Component shouldUseDMWishlistGiftingDesign={false} isLoadingWishlist={importDefault != null && !env0_5 && error == null && (userProfile == null || wishlistId != null && wishlist == null)} />)(importDefault(10383) /* metro dependency 10383: PremiumGiftPlanSelect */);
}
function useGetScreensRender_80421({defaultHighlightedReward, allRewards, claimableRewards, onSelect}) { // fn#80421, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10568:2138, owner: PremiumGiftModal.useGetScreens.render, offset: 0x01e7a253, size: 86 bytes, params: 2, frame: 17
const value = environment.__proto__.__proto__;
return ((Component) => <Component defaultHighlightedReward={defaultHighlightedReward} allRewards={allRewards} claimableRewards={claimableRewards} onSelect={onSelect} />)(importDefault(10456) /* metro dependency 10456: GiftingSKUSelectScreen */);
}
function useGetScreensRender_80422() { // fn#80422, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10568:2474, owner: PremiumGiftModal.useGetScreens.render, offset: 0x01e7a2a9, size: 39 bytes, params: 1, frame: 13
const value = environment.__proto__.__proto__;
return ((Component) => <Component />)(importDefault(10458) /* metro dependency 10458: PremiumGiftCustomization */);
}
function useGetScreensRender_80423() { // fn#80423, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10568:2588, owner: PremiumGiftModal.useGetScreens.render, offset: 0x01e7a2d0, size: 39 bytes, params: 1, frame: 13
const value = environment.__proto__.__proto__;
return ((Component) => <Component />)(importDefault(10463) /* metro dependency 10463: PremiumGiftSuccess */);
}
function useGetScreensRender_80424(a0) { // fn#80424, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10568:2812, owner: PremiumGiftModal.useGetScreens.render, offset: 0x01e7a2f7, size: 67 bytes, params: 2, frame: 14
var environment;
const value = environment.__proto__.__proto__;
return ((Component) => <Component currentProgress={a0.currentProgress} onSendGift={function() {
var moduleValue = require(dependencyMap[17]);
var GIFTING_BADGE_POST_PURCHASE = importDefault(dependencyMap[18]).GIFTING_BADGE_POST_PURCHASE;
moduleValue.openGiftModal({analyticsLocations: [GIFTING_BADGE_POST_PURCHASE]});
}} />)(importDefault(10468) /* metro dependency 10468: GiftBadgePostPurchase */);
}
@@ -0,0 +1,493 @@
/* Metro module 10383; source: modules/premium/native/gifting/PremiumGiftPlanSelect.tsx; dependencies: [57, 31, 27, 7670, 7261, 1880, 661, 33, 4501, 697, 674, 1484, 1585, 1478, 7669, 4559, 5286, 566, 10384, 7633, 7635, 10382, 10386, 10389, 9625, 4017, 1305, 4504, 10396, 6789, 10397, 10431, 7725, 1244, 5312, 5475, 10455, 4589, 5314, 4573, 2] */
function _fun80427(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#80427, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10569:6, offset: 0x01e7a3bf, size: 393 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
const env0_4 = importAll(31) /* metro dependency 31 */;
let value = require(27) /* metro dependency 27 */;
const env0_5 = value.ActivityIndicator;
const env0_6 = value.Pressable;
const env0_7 = value.View;
const env0_8 = value.ScrollView;
const badgeDirectoryStore = importDefault(7670) /* metro dependency 7670: BadgeDirectoryStore */;
const promotionsStore = importDefault(7261) /* metro dependency 7261: PromotionsStore */;
const PremiumTypes = (require(1880) /* metro dependency 1880: PremiumConstants */).PremiumTypes;
const env0_11 = (require(661) /* metro dependency 661: Constants */).VerticalGradient;
value = require(33) /* metro dependency 33 */;
const env0_12 = value.jsx;
const env0_13 = value.jsxs;
const env0_14 = value.Fragment;
const TIER_2 = PremiumTypes.TIER_2;
object = [TIER_2];
const TIER_0 = PremiumTypes.TIER_0;
object[1] = TIER_0;
const env0_16 = (require(4501) /* metro dependency 4501: createStyles */).createStyles(_fun80428);
object = {code: 'function PremiumGiftPlanSelectTsx1(){const{STANDARD_EASING,withTiming,carouselVisibility}=this.__closure;const animationSettings={easing:STANDARD_EASING,duration:500};return{opacity:withTiming(carouselVisibility.get()?1:0,animationSettings),transform:[{translateY:withTiming(carouselVisibility.get()?0:100,animationSettings)}]};}'};
object = {code: 'function PremiumGiftPlanSelectTsx2(value,index){const{lastItemIndex,leftOffset,centerOffset,rightOffset,carouselStep}=this.__closure;const activeIndex=index-value;const leftT=Math.max(0,Math.min(1,activeIndex));const rightT=Math.max(0,Math.min(1,activeIndex-(lastItemIndex-1)));const offset=leftOffset+leftT*(centerOffset-leftOffset)+rightT*(rightOffset-centerOffset);return{transform:[{translateX:value*carouselStep+offset}]};}'};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/native/gifting/PremiumGiftPlanSelect.tsx');
exports.default = PremiumGiftPlanSelect;
}
function _fun80428(a0, a1, a2) { // fn#80428, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10569:349, offset: 0x01e7a548, size: 701 bytes, params: 4, frame: 22
const object2 = {};
let BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
object2.container = {flex: 1, backgroundColor: BACKGROUND_BASE_LOW};
object2.headerBackground = {position: 'absolute', width: a0, height: 0.1 * a1, top: a1 / 1.75 - 0.1 * a1};
BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
object2.headerBackgroundColor = {color: BACKGROUND_BASE_LOW};
object2.headerImageContainer = {position: 'absolute', width: a0, height: a1 / 1.75};
object2.headerImage = {width: a0};
const object3 = {width: a0};
object3.backgroundColor = (importDefault(674) /* metro dependency 674 */)('#000000').alpha(0.8).hex();
object2.headerOverlay = object3;
object2.avatar = {alignSelf: 'center'};
const object4 = {textAlign: 'center'};
let space = (importDefault(697) /* metro dependency 697: native */).space;
object4.marginTop = a2 ? space.PX_16 : space.PX_12;
let PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
object4.marginHorizontal = PX_24;
object2.title = object4;
const object5 = {textAlign: 'center'};
space = (importDefault(697) /* metro dependency 697: native */).space;
object5.marginTop = a2 ? space.PX_16 : space.PX_12;
PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
object5.marginHorizontal = PX_24;
object2.description = object5;
space = (importDefault(697) /* metro dependency 697: native */).space;
object2.carousel = {marginTop: a2 ? space.PX_16 : space.PX_32};
const object6 = {};
let PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object6.paddingTop = PX_16;
const PX_48 = (importDefault(697) /* metro dependency 697: native */).space.PX_48;
object6.paddingBottom = PX_48;
object2.dmGiftingContent = object6;
object2.loadingContainer = {'flex': 1, 'alignItems': 'center', 'justifyContent': 'center'};
object2.closeButtonContainer = {'position': 'absolute', 'top': 0, 'left': 0, 'zIndex': 1};
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object2.closeButton = {padding: PX_16};
object2.closeButtonIcon = {'width': 24, 'height': 24, 'tintColor': 'white'};
const object8 = {};
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object8.marginTop = PX_16;
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object8.marginHorizontal = PX_16;
object2.badgeBanner = object8;
return object2;
}
function PremiumGiftPlanSelect({shouldUseDMWishlistGiftingDesign, isLoadingWishlist}) { // fn#80429, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10569:2346, offset: 0x01e7a805, size: 3448 bytes, params: 2, frame: 61
var object5;
var r33;
var r40;
var r42;
var r36;
var r17;
var r16;
var r0;
var jsxRuntimeEnv0_14Binding;
var items2;
var object2;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
var FastImage;
var headerImageContainer;
var object3;
var object4;
var value39;
var Avatar;
var AvatarSizes;
var items6;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
var jsxRuntimeEnv0_14Binding2;
var defaultImport6;
var items9;
var defaultImport8;
let value = undefined;
const env0_17 = value;
const value3 = (require(1484) /* metro dependency 1484: useNavigationNative */).useNavigation();
const {top, bottom} = (importDefault(1585) /* metro dependency 1585: useSafeAreaInsetsNative */)();
const {width, height} = (importDefault(1478) /* metro dependency 1478: useWindowDimensionsNative */)();
const {recipientUser, claimableRewards,
onClose} = (require(7669) /* metro dependency 7669: NativeGiftContext */).useNativeGiftContext();
const value7 = (require(4559) /* metro dependency 4559: useIsScreenReaderEnabledNative */).useIsScreenReaderEnabled();
(require(5286) /* metro dependency 5286: useNavigatorBackPressHandlerNative */).useNavigatorBackPressHandler(function() {
onClose();
return true;
});
const value8 = (require(566) /* metro dependency 566: flux */).useStateFromStoresArray([PromotionsStore],
function() {
return PromotionsStore.getGiftPromotionRewardSkuIds();
});
const value9 = (require(10384) /* metro dependency 10384: useSelectPremiumGift */).useSelectPremiumGift('PremiumGiftPlanSelect');
const env0_3 = value9;
const defaultImport = importDefault(7633) /* metro dependency 7633: GiftingBadgeExperiment */;
const useConfig = defaultImport.useConfig;
const enabled = Reflect.apply(useConfig, defaultImport, [{location: 'PremiumGiftPlanSelect'}]).enabled;
const {nextTier,
giftsToNextTier} = (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([BadgeDirectoryStore],
function() {
var object = {};
object.nextTier = BadgeDirectoryStore.getNextTier(require(dependencyMap[20]).BadgeId.GIFTING);
object.giftsToNextTier = BadgeDirectoryStore.getRemainingToNextTier(require(dependencyMap[20]).BadgeId.GIFTING);
return object;
});
const r10 = enabled && nextTier != null;
const env0_4 = r10;
const styles = useStyles(width, height, r10);
let binding = env0_4;
let useState = binding.useState;
const value12 = Reflect.apply(useState, binding, [0]);
const binding2 = env0_3;
const value13 = binding2(value12, 2);
const property = value13[0];
const property2 = value13[1];
useState = binding.useState;
const value15 = binding2(Reflect.apply(useState, binding, [false]), 2);
const property3 = value15[0];
const env0_7 = value15[1];
binding.useEffect(_fun80433, [value3]);
useState = binding.useState;
const value17 = binding2(Reflect.apply(useState, binding, [null]), 2);
const property4 = value17[0];
const property5 = value17[1];
const value18 = binding.useRef([]);
binding.useEffect(_fun80436, [shouldUseDMWishlistGiftingDesign]);
let useCallback = binding.useCallback;
const value19 = Reflect.apply(useCallback, binding, [_fun80437, [property5]]);
let closure = function() {
importDefault(dependencyMap[22])();
};
const value20 = binding.useCallback(closure, []);
const value21 = 0.86 * width;
const value22 = binding.useCallback(function(a0) {
var value = a1;
var env0_0 = a0;
var env0_1 = (value !== undefined ? value : {forScreenReader: false}).forScreenReader;
return _fun80440;
}, [value9, value21, value18, value19, property4, property, claimableRewards]);
const r8 = (require(9625) /* metro dependency 9625: useIsWindowSmall */).useIsWindowSmall() || claimableRewards != null && claimableRewards.length > 0 ? 'smallCompact' : 'compact';
binding = env0_4;
const value28 = binding.useMemo(_fun80444, [value22, r8]);
const value29 = binding.useMemo(_fun80445, [value22]);
const value30 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(false);
const env0_15 = value30;
binding.useEffect(_fun80446, [value30, property4]);
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const useAnimatedStyle = reanimatedRexportModule.useAnimatedStyle;
closure = PremiumGiftPlanSelectPe;
object5 = {};
const STANDARD_EASING = (require(1305) /* metro dependency 1305: native */).STANDARD_EASING;
object5.STANDARD_EASING = STANDARD_EASING;
object5.withTiming = (require(4504) /* metro dependency 4504: timing */).withTiming;
object5.carouselVisibility = value30;
closure.__closure = object5;
closure.__workletHash = 2946262965957;
closure.__initData = env0_17;
const value31 = Reflect.apply(useAnimatedStyle, reanimatedRexportModule, [closure]);
const value32 = binding.useMemo(_fun80448, [styles]);
const value33 = value21 + 16;
const value34 = env0_15.length - 1;
const value35 = (width - value21) / 2;
const env0_18 = value35;
const value36 = width - value21 - 16;
useCallback = binding.useCallback;
closure = PremiumGiftPlanSelectSe;
closure.__closure = {lastItemIndex: value34, leftOffset: 16, centerOffset: value35, rightOffset: value36,
carouselStep: value33};
closure.__workletHash = 8954351954675;
closure.__initData = env0_18;
const value37 = Reflect.apply(useCallback, binding, [closure, [value33, value34, 16, value35, value36]]);
if (isLoadingWishlist) {
r0 = <View style={[styles.container, styles.loadingContainer]}><ActivityIndicator size="large" /></View>;
} else if (shouldUseDMWishlistGiftingDesign) {
var viewBindingProps = {style: styles.container};
var scrollViewBindingProps = {contentContainerStyle: {paddingBottom: bottom}};
items9 = [r10 && <View style={styles.badgeBanner}><Pressable onPress={value20} accessibilityRole="button">{((Component) => <Component giftsToNextTier={giftsToNextTier} nextTierName={nextTier.name ?? ''} nextTierIcon={nextTier.simple_icon_url} analyticsLocation={(importDefault(6789) /* metro dependency 6789: AnalyticsLocation */).PREMIUM_GIFT_PLAN_SELECTION} />)(importDefault(10396) /* metro dependency 10396: GiftingBadgeProgressBanner */)}</Pressable></View>];
var viewBinding3Props = {style: styles.dmGiftingContent};
if (value8.length === 0) {
if (value7) {
r17 = <ScrollView horizontal showsHorizontalScrollIndicator={false} contentContainerStyle={{'gap': 16,
'paddingHorizontal': 16}}>{env0_15.map(_fun80450)}</ScrollView>;
} else {
defaultImport8 = importDefault(10397) /* metro dependency 10397 */;
binding = env0_15;
r17 = ((Component) => <Component style={value31} data={binding} renderItem={value28} width={width} windowSize={binding.length} height={(property4 ?? 1) + 2 * (importDefault(697) /* metro dependency 697: native */).space.PX_8} onConfigurePanGesture={function(a0) {
a0.activeOffsetX([-10, 10]);
}} loop={false} scrollAnimationDuration={200} customAnimation={value37} onSnapToItem={property2} />)(defaultImport8);
}
r16 = r17;
} else if (value === claimableRewards) {
r16 = null;
} else {
if (value7) {
r17 = <ScrollView horizontal showsHorizontalScrollIndicator={false} contentContainerStyle={{'gap': 16,
'paddingHorizontal': 16}}>{env0_15.map(_fun80450)}</ScrollView>;
} else {
defaultImport8 = importDefault(10397) /* metro dependency 10397 */;
binding = env0_15;
r17 = ((Component) => <Component style={value31} data={binding} renderItem={value28} width={width} windowSize={binding.length} height={(property4 ?? 1) + 2 * (importDefault(697) /* metro dependency 697: native */).space.PX_8} onConfigurePanGesture={onConfigurePanGesture_80451} loop={false} scrollAnimationDuration={200} customAnimation={value37} onSnapToItem={property2} />)(defaultImport8);
}
r16 = r17;
}
items9[1] = <View {...viewBinding3Props}>{r16}</View>;
items9[2] = recipientUser != null && ((PremiumGiftWishlistBanner) => <PremiumGiftWishlistBanner giftRecipient={recipientUser} />)((require(10431) /* metro dependency 10431: PremiumGiftWishlistBanner */).PremiumGiftWishlistBanner);
value = <View {...viewBindingProps}><ScrollView {...scrollViewBindingProps}>{items9}</ScrollView></View>;
r0 = value;
} else {
jsxRuntimeEnv0_14Binding = jsxRuntimeEnv0_14;
items2 = [property3 && ((Component) => <Component animated barStyle="light-content" />)(importDefault(7725) /* metro dependency 7725: StatusBarAndroid */)];
items2[1] = <Pressable style={[styles.closeButtonContainer,
{paddingTop: top}]} onPress={onClose} accessibilityRole="button" accessibilityLabel={intl.string(t.cpT0Cq)}><View style={styles.closeButton}>{((XSmallIcon) => <XSmallIcon size="md" style={styles.closeButtonIcon} />)((require(5312) /* metro dependency 5312: XSmallIcon */).XSmallIcon)}</View></Pressable>;
FastImage = importDefault(5475) /* metro dependency 5475: FastImage */;
headerImageContainer = styles.headerImageContainer;
items2[2] = <FastImage resizeMode="cover" style={[headerImageContainer,
styles.headerImage]} source={importDefault(10455) /* metro dependency 10455 */} />;
headerImageContainer = styles.headerImageContainer;
items2[3] = <View style={[headerImageContainer, styles.headerOverlay]} />;
items2[4] = ((Component) => <Component style={styles.headerBackground} start={VerticalGradient.START} end={VerticalGradient.END} colors={value32} />)(importDefault(4589) /* metro dependency 4589 */);
var scrollViewBindingProps = {contentContainerStyle: {paddingBottom: bottom}};
object3 = {};
object4 = {};
object4.paddingTop = top + (require(5314) /* metro dependency 5314: NavigatorConstantsNative */).NAV_BAR_HEIGHT;
object3.style = [object4];
value39 = recipientUser != null;
if (value39) {
Avatar = (require(1305) /* metro dependency 1305: native */).Avatar;
var avatarProps = {style: styles.avatar, guildId: value};
AvatarSizes = (require(1305) /* metro dependency 1305: native */).AvatarSizes;
avatarProps.size = r10 ? AvatarSizes.LARGE_48 : AvatarSizes.XLARGE;
avatarProps.user = recipientUser;
r33 = <Avatar {...avatarProps} />;
} else {
r33 = value39;
}
items6 = [r33];
var textProps = {style: styles.title};
r40 = recipientUser != null ? 'heading-xl/extrabold' : 'heading-xxl/extrabold';
textProps.variant = r40;
textProps.color = 'always-white';
r40 = recipientUser != null ? intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t.m5ggvH,
{username: recipientUser.globalName ?? recipientUser.username}) : intl.string((require(1244) /* metro dependency 1244: indexNative */).t.dqQgZv);
items6[1] = <Text {...textProps}>{r40}</Text>;
items6[2] = <Text style={styles.description} variant="heading-sm/medium" color="always-white">{intl.string(t['30qzrd'])}</Text>;
r33 = r10 && <Pressable style={styles.badgeBanner} onPress={value20} accessibilityRole="button">{((Component) => <Component giftsToNextTier={giftsToNextTier} nextTierName={nextTier.name ?? ''} nextTierIcon={nextTier.simple_icon_url} analyticsLocation={(importDefault(6789) /* metro dependency 6789: AnalyticsLocation */).PREMIUM_GIFT_PLAN_SELECTION} />)(importDefault(10396) /* metro dependency 10396: GiftingBadgeProgressBanner */)}</Pressable>;
items6[3] = r33;
if (value8.length === 0) {
if (value7) {
r36 = <ScrollView horizontal showsHorizontalScrollIndicator={false} style={styles.carousel} contentContainerStyle={{'gap': 16,
'paddingHorizontal': 16}}>{env0_15.map(_fun80452)}</ScrollView>;
} else {
jsxRuntimeEnv0_14Binding2 = jsxRuntimeEnv0_14;
defaultImport6 = importDefault(10397) /* metro dependency 10397 */;
var defaultImport6Props = {style: [styles.carousel, value31], data: env0_15};
r42 = r10 ? value28 : value29;
defaultImport6Props.renderItem = r42;
defaultImport6Props.width = width;
r42 = property4 != null ? property4 + 2 * (importDefault(697) /* metro dependency 697: native */).space.PX_8 : value;
defaultImport6Props.height = r42;
defaultImport6Props.onConfigurePanGesture = onConfigurePanGesture;
defaultImport6Props.loop = false;
defaultImport6Props.scrollAnimationDuration = 200;
r42 = r10 ? value37 : value;
defaultImport6Props.customAnimation = r42;
defaultImport6Props.mode = 'parallax';
defaultImport6Props.modeConfig = {'parallaxScrollingScale': 1, 'parallaxScrollingOffset': 40};
defaultImport6Props.onSnapToItem = property2;
r36 = <>{((Component) => <Component {...defaultImport6Props} />)(defaultImport6)}{((CarouselPagination) => <CarouselPagination numberOfItems={env0_15.length} currentIndex={property} />)((require(1305) /* metro dependency 1305: native */).CarouselPagination)}</>;
}
r33 = r36;
} else if (value === claimableRewards) {
r33 = null;
} else {
if (value7) {
r36 = <ScrollView horizontal showsHorizontalScrollIndicator={false} style={styles.carousel} contentContainerStyle={{'gap': 16,
'paddingHorizontal': 16}}>{env0_15.map(_fun80452)}</ScrollView>;
} else {
jsxRuntimeEnv0_14Binding2 = jsxRuntimeEnv0_14;
defaultImport6 = importDefault(10397) /* metro dependency 10397 */;
var defaultImport6Props = {style: [styles.carousel, value31], data: env0_15};
r42 = r10 ? value28 : value29;
defaultImport6Props.renderItem = r42;
defaultImport6Props.width = width;
r42 = property4 != null ? property4 + 2 * (importDefault(697) /* metro dependency 697: native */).space.PX_8 : value;
defaultImport6Props.height = r42;
defaultImport6Props.onConfigurePanGesture = onConfigurePanGesture;
defaultImport6Props.loop = false;
defaultImport6Props.scrollAnimationDuration = 200;
r42 = r10 ? value37 : value;
defaultImport6Props.customAnimation = r42;
defaultImport6Props.mode = 'parallax';
defaultImport6Props.modeConfig = {'parallaxScrollingScale': 1, 'parallaxScrollingOffset': 40};
defaultImport6Props.onSnapToItem = property2;
r36 = <>{((Component) => <Component {...defaultImport6Props} />)(defaultImport6)}{((CarouselPagination) => <CarouselPagination numberOfItems={env0_15.length} currentIndex={property} />)((require(1305) /* metro dependency 1305: native */).CarouselPagination)}</>;
}
r33 = r36;
}
items6[4] = r33;
items2[5] = <ScrollView {...scrollViewBindingProps}><View {...object3}>{items6}</View></ScrollView>;
value = <>{items2}</>;
r0 = value;
}
return r0;
}
function _fun80433() { // fn#80433, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10569:3235, offset: 0x01e7b5f2, size: 45 bytes, params: 1, frame: 14
const env0_0Binding = env0_0.addListener('state', _fun80434);
return _fun80435;
}
function _fun80436() { // fn#80436, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10569:3498, offset: 0x01e7b69a, size: 32 bytes, params: 1, frame: 11
env0_10.current = [];
env0_9(null);
}
function _fun80437() { // fn#80437, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10569:3555, offset: 0x01e7b6ba, size: 116 bytes, params: 1, frame: 17
var Math;
var max;
var items2;
var value3;
var Number;
let current = env0_10.current;
if (current.length >= env1_15.length) {
Math = global.Math;
max = Math.max;
current = env0_10.current;
items2 = [];
arraySpread(items2, current, 0, undefined);
value3 = apply(max, items2, Math, undefined);
Number = global.Number;
if (!Number.isNaN(value3)) {
env0_9(value3);
}
}
}
function _fun80439(a0) { // fn#80439, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10569:3721, offset: 0x01e7b74d, size: 49 bytes, params: 2, frame: 4
const value = a1;
const env0_0 = a0;
const env0_1 = (value !== undefined ? value : {forScreenReader: false}).forScreenReader;
return _fun80440;
}
function _fun80444() { // fn#80444, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10569:4365, offset: 0x01e7b931, size: 20 bytes, params: 1, frame: 11
return env0_13(env0_14);
}
function _fun80445() { // fn#80445, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10569:4400, offset: 0x01e7b945, size: 20 bytes, params: 1, frame: 11
return env0_13('default');
}
function _fun80446() { // fn#80446, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10569:4469, offset: 0x01e7b959, size: 31 bytes, params: 1, frame: 12
env0_15.set(env0_8 != null);
}
function PremiumGiftPlanSelectPe() { // fn#80447, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10569:4549, owner: PremiumGiftPlanSelect.pe, offset: 0x01e7b978, size: 171 bytes, params: 1, frame: 20
const object4 = {};
let value = environment.__proto__;
const STANDARD_EASING = (require(1305) /* metro dependency 1305: native */).STANDARD_EASING;
object4.easing = STANDARD_EASING;
object4.duration = 500;
const object5 = {};
const timingModule = require(4504) /* metro dependency 4504: timing */;
const withTiming = timingModule.withTiming;
const value3 = env0_15.get();
const value4 = 0;
object5.opacity = Reflect.apply(withTiming, timingModule, [value3 ? 1 : value4, object4]);
const object6 = {};
value = timingModule;
object6.translateY = value.withTiming(env0_15.get() ? value4 : 100, object4);
object5.transform = [object6];
return object5;
}
function _fun80448() { // fn#80448, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10569:4902, offset: 0x01e7ba23, size: 138 bytes, params: 1, frame: 16
let value = environment.__proto__;
value = importDefault(674) /* metro dependency 674 */;
value = value(styles.headerBackgroundColor.color);
value = value.alpha(0);
value = value.hex();
const items2 = [value];
value = importDefault(674) /* metro dependency 674 */;
value = value(styles.headerBackgroundColor.color);
value = value.alpha(1);
items2[1] = value.hex();
return items2;
}
function PremiumGiftPlanSelectSe(a0, a1) { // fn#80449, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10569:5090, owner: PremiumGiftPlanSelect.Se, offset: 0x01e7baad, size: 174 bytes, params: 3, frame: 20
let value = a1 - a0;
let Math = global.Math;
let max = Math.max;
const Math2 = global.Math;
const value3 = Reflect.apply(max, Math, [0, Math2.min(1, value)]);
Math = global.Math;
max = Math.max;
const Math3 = global.Math;
value = Reflect.apply(max, Math, [0, Math3.min(1, value - (env0_17 - 1))]);
const value5 = a0 * env0_16;
const value6 = value3 * (env0_18 - 16);
value *= env0_19 - env0_18;
return {transform: [{translateX: value5 + (16 + value6 + value)}]};
}
function _fun80450(a0, a1) { // fn#80450, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10569:6007, offset: 0x01e7bb5b, size: 51 bytes, params: 3, frame: 13
return env0_13(env0_14, {forScreenReader: true})({item: a0, index: a1});
}
function _fun80452(a0, a1) { // fn#80452, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10569:7978, offset: 0x01e7bbb5, size: 62 bytes, params: 3, frame: 13
return env0_13(env0_4 ? env0_14 : 'default', {forScreenReader: true})({item: a0, index: a1});
}
function _fun80434() { // fn#80434, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10569:3269, offset: 0x01e7b61f, size: 89 bytes, params: 1, frame: 13
let binding = env1_0;
const state = binding.getState();
const property = state.routes[state.index];
binding = env1_7;
const name = property.name;
const PremiumGiftScreens = (require(10382) /* metro dependency 10382: PremiumGiftModal */).PremiumGiftScreens;
const PLAN_SELECT = PremiumGiftScreens.PLAN_SELECT;
binding(name === PLAN_SELECT);
}
function _fun80440({item, index}) { // fn#80440, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10569:3767, offset: 0x01e7b77e, size: 303 bytes, params: 2, frame: 24
var environment;
const env0_0 = item;
const value = environment.__proto__.__proto__;
const r2 = forScreenReader ? Pressable : View;
const r2Props = {accessible: forScreenReader || undefined,
accessibilityRole: forScreenReader ? 'button' : undefined, onPress: forScreenReader ? _fun80441 : undefined};
const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
r2Props.style = {paddingVertical: PX_8};
return ((Component) => <Component {...r2Props}>{((Component) => <Component premiumType={item} variant={env0_0} onPress={onPress_80442} style={{height: env1_8 ?? undefined,
width: env1_12,
alignSelf: env0_0 !== 'default' ? undefined : 'center'}} onLayout={onLayout_80443} claimableRewards={claimableRewards} isSelected={env1_6 === index} key={index} />)(importDefault(10389) /* metro dependency 10389: PremiumGiftFeaturesCard */)}</Component>)(r2);
}
function _fun80441() { // fn#80441, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10569:3877, offset: 0x01e7b8ad, size: 23 bytes, params: 1, frame: 11
return env2_3(item);
}
function onLayout_80443({nativeEvent}) { // fn#80443, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10569:4090, offset: 0x01e7b8c4, size: 109 bytes, params: 2, frame: 18
var value2;
var current;
var indexBinding;
var Math;
const height = nativeEvent.layout.height;
if (height > 0) {
value2 = environment.__proto__.__proto__;
current = env2_10.current;
indexBinding = index;
Math = global.Math;
current[indexBinding] = Math.max(height, env2_10.current[indexBinding] ?? 0);
env2_11();
}
}
@@ -0,0 +1,72 @@
/* Metro module 10393; source: modules/premium/native/gifting/PremiumGiftPlanSelectPromotionalBanner.tsx; dependencies: [31, 27, 33, 4501, 697, 7277, 10390, 4589, 5475, 4573, 1244, 10394, 2] */
function _fun80489(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#80489, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10579:6, offset: 0x01e7d9f1, size: 211 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = importAll(31) /* metro dependency 31 */;
const env0_3 = (require(27) /* metro dependency 27 */).View;
const value2 = require(33) /* metro dependency 33 */;
const env0_4 = value2.jsx;
const env0_5 = value2.jsxs;
const env0_6 = (require(4501) /* metro dependency 4501: createStyles */).createStyles(_fun80490);
value = value.memo(PremiumGiftPlanSelectPromotionalBanner);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/native/gifting/PremiumGiftPlanSelectPromotionalBanner.tsx');
exports.default = value;
}
function _fun80490() { // fn#80490, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10579:172, offset: 0x01e7dac4, size: 272 bytes, params: 1, frame: 15
const object = {'minHeight': 60, 'justifyContent': 'center', 'gap': 2};
let PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
object.paddingTop = PX_12;
PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
object.paddingBottom = PX_12;
const PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
object.paddingStart = PX_24;
object.paddingEnd = 120;
return {gradient: {minHeight: 60}, bannerImage: {'position': 'absolute', 'top': 0, 'left': 0, 'right': 0,
'width': '100%', 'aspectRatio': 5}, content: object, heading: {}, subheading: {},
logoContainer: {'position': 'absolute', 'top': 0, 'bottom': 0, 'right': 10, 'justifyContent': 'center',
'alignItems': 'center'}, logoContainerLargeTilted: {transform: [{rotate: '-7deg'}, {translateY: 8}]},
logo: {'width': 95, 'height': 95}, logoLargeTilted: {'width': 120, 'height': 120}};
}
function PremiumGiftPlanSelectPromotionalBanner({giftPlanSelectionCardBannerComponent, claimableRewards, isSelected, onLayout}) { // fn#80491, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10579:733, offset: 0x01e7dbd4, size: 763 bytes, params: 2, frame: 34
var r5;
var object8;
var value;
const styles = useStyles();
const gradient = giftPlanSelectionCardBannerComponent.gradient;
const assetVariant = giftPlanSelectionCardBannerComponent.assetVariant;
const GiftPlanSelectionCardBanner_AssetVariant = (require(7277) /* metro dependency 7277: gift_plan_selection_card_banner */).GiftPlanSelectionCardBanner_AssetVariant;
const LARGE_TILTED = GiftPlanSelectionCardBanner_AssetVariant.LARGE_TILTED;
const value3 = assetVariant === LARGE_TILTED;
const value4 = (require(10390) /* metro dependency 10390: MarketingComponentHooks */).useThemeAndReducedMotionAwareAssetUrl(giftPlanSelectionCardBannerComponent.mobileBannerAsset);
const value5 = (require(10390) /* metro dependency 10390: MarketingComponentHooks */).useThemeAndReducedMotionAwareAssetUrl(giftPlanSelectionCardBannerComponent.avatarAsset,
true);
const defaultImport = importDefault(4589) /* metro dependency 4589 */;
const defaultImportProps2 = {style: styles.gradient, useAngle: true, angle: gradient?.angle ?? 90,
angleCenter: {'x': 0.5, 'y': 0.5}, colors: gradient?.colors ?? [], onLayout: onLayout};
const items2 = [value4 != null && ((Component) => <Component style={styles.bannerImage} resizeMode="cover" source={{uri: value4}} />)(importDefault(5475) /* metro dependency 5475: FastImage */)];
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const OEtqpm = (require(1244) /* metro dependency 1244: indexNative */).t.OEtqpm;
items2[1] = <View style={styles.content}><Text style={styles.heading} variant="text-md/bold" color="white">{Reflect.apply(string,
intl,
[OEtqpm])}</Text><Text style={styles.subheading} variant="text-md/medium" color="white">{intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t['2h5M+X'],
{availableCount: claimableRewards.length})}</Text></View>;
const value10 = value5 != null;
if (value10) {
var viewProps = {style: [styles.logoContainer, value3 && styles.logoContainerLargeTilted]};
value = importDefault(10394) /* metro dependency 10394: PremiumFeaturesPromotionalLogo */;
value = <View {...viewProps}>{((Component) => <Component shouldAnimate={isSelected} promoRotatingStyle={[styles.logo,
value3 && styles.logoLargeTilted]} rotatingAvatarImageUrl={value5} />)(value)}</View>;
r5 = value;
} else {
r5 = value10;
}
items2[2] = r5;
return ((Component) => <Component {...defaultImportProps2}>{items2}</Component>)(defaultImport);
}
@@ -0,0 +1,372 @@
/* Metro module 10461; source: modules/premium/native/gifting/PremiumGiftPurchaseButton.tsx; dependencies: [31, 27, 7670, 5126, 1902, 1878, 7261, 661, 33, 4501, 697, 5463, 8483, 1901, 1305, 4573, 1244, 4589, 10462, 1484, 7669, 566, 7355, 7583, 7278, 10392, 7633, 7635, 7294, 10382, 8461, 10390, 5475, 8341, 9646, 10396, 6789, 6766, 1948, 4578, 4015, 2] */
function _fun80964(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#80964, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10647:6, offset: 0x01e91df0, size: 350 bytes, params: 8, frame: 19
const env0_0 = require;
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.StyleSheet;
const env0_5 = value.View;
const badgeDirectoryStore = importDefault(7670) /* metro dependency 7670: BadgeDirectoryStore */;
const env0_7 = (require(5126) /* metro dependency 5126: AvatarDecorationRecord */).isAvatarDecorationRecord;
const env0_8 = (require(1902) /* metro dependency 1902: NameplateRecord */).isNameplateRecord;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
const promotionsStore = importDefault(7261) /* metro dependency 7261: PromotionsStore */;
const env0_11 = (require(661) /* metro dependency 661: Constants */).HelpdeskArticles;
value = require(33) /* metro dependency 33 */;
const env0_12 = value.jsx;
const env0_13 = value.Fragment;
const env0_14 = value.jsxs;
const env0_15 = (require(4501) /* metro dependency 4501: createStyles */).createStyles(_fun80966);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/native/gifting/PremiumGiftPurchaseButton.tsx');
exports.default = PremiumGiftPurchaseButton;
}
function RewardPreview({collectiblesItem, currentUser, gradientColors, gradientAngle}) { // fn#80965, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10647:1685, offset: 0x01e91f4e, size: 791 bytes, params: 2, frame: 28
var r0;
var isAvatarDecorationRecord2;
var value2;
var jsxRuntimeEnv0_13Binding;
var items3;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
var items2;
var Avatar;
const styles = useStyles((importDefault(5463) /* metro dependency 5463: useSafeAreaInsetsKeyboardAwareNative */)().insets.bottom);
if (isNameplateRecord(collectiblesItem)) {
jsxRuntimeEnv0_13Binding = jsxRuntimeEnv0_13;
items2 = [<View style={styles.nameplateWrapper}>{((Component) => <Component nameplate={(require(1901) /* metro dependency 1901: utils */).getNameplateData(collectiblesItem)} fullOpacity animate />)(importDefault(8483) /* metro dependency 8483: Nameplate */)}</View>];
var viewBindingProps2 = {style: styles.singleAvatarContainer};
Avatar = (require(1305) /* metro dependency 1305: native */).Avatar;
var avatarProps = {user: currentUser, guildId: undefined,
size: (require(1305) /* metro dependency 1305: native */).AvatarSizes.SMALL};
avatarProps['aria-hidden'] = true;
items2[1] = <View {...viewBindingProps2}><Avatar {...avatarProps} /></View>;
items2[2] = <Text style={styles.selectedRewardText} variant="text-xs/medium">{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.Rh4oem)}</Text>;
r0 = <>{items2}</>;
} else {
isAvatarDecorationRecord2 = isAvatarDecorationRecord(collectiblesItem);
value2 = null;
if (isAvatarDecorationRecord2) {
jsxRuntimeEnv0_13Binding = jsxRuntimeEnv0_13;
items3 = [((Component) => <Component style={styles.selectedRewardBannerGradient} useAngle angle={value2 != gradientAngle ? gradientAngle : 90} angleCenter={{'x': 0.5,
'y': 0.5}} colors={gradientColors} />)(importDefault(4589) /* metro dependency 4589 */)];
items3[1] = <View style={styles.singleAvatarContainer}>{((Component) => <Component size={(require(1305) /* metro dependency 1305: native */).AvatarSizes.NORMAL} asset={collectiblesItem.asset} />)(importDefault(10462) /* metro dependency 10462: GiftingRewardPreviewAvatar */)}</View>;
items3[2] = <Text style={styles.selectedRewardText} variant="text-xs/medium" color="white">{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.Rh4oem)}</Text>;
r0 = <>{items3}</>;
} else {
r0 = value2;
}
}
return r0;
}
function _fun80966(a0) { // fn#80966, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10647:324, offset: 0x01e92265, size: 753 bytes, params: 2, frame: 21
const object4 = {};
const object5 = {};
const BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
object5.backgroundColor = BACKGROUND_BASE_LOW;
let PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
object5.paddingTop = PX_12;
PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
object5.paddingBottom = PX_12 + a0;
let PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object5.paddingHorizontal = PX_16;
let PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object5.gap = PX_8;
const SHADOW_TOP_HIGH = (importDefault(697) /* metro dependency 697: native */).shadows.SHADOW_TOP_HIGH;
copyDataProperties(object5, SHADOW_TOP_HIGH, undefined);
object4.container = object5;
object4.chooseRewardContainer = {'flexDirection': 'row', 'alignItems': 'center', 'height': 52};
const object6 = {};
copyDataProperties(object6, StyleSheet.absoluteFillObject, undefined);
object6['borderRadius'] = (importDefault(697) /* metro dependency 697: native */).radii.sm;
object6['overflow'] = 'hidden';
object4.gradientBackdrop = object6;
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object4.chooseRewardText = {flex: 1, marginStart: PX_8};
object4.backgroundImage = {'position': 'absolute', 'top': 0, 'left': 0, 'right': 0, 'bottom': 0, 'opacity': 1};
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object4.inAppFlowImage = {'width': 58, 'height': 58, marginStart: PX_8};
object4.inAppFlowImageLargeTilted = {'width': 86, 'height': 86, transform: [{rotate: '-4deg'}, {translateY: -11}]};
object4.singleAvatarContainer = {'flexDirection': 'row', 'paddingRight': 15, 'justifyContent': 'center',
'alignItems': 'center', 'marginLeft': 5};
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object4.selectedRewardRow = {'flexDirection': 'row', 'alignItems': 'center', gap: PX_16};
object4.selectedRewardBannerContainer = {'flex': 1, 'flexDirection': 'row', 'alignItems': 'center', 'height': 52};
const object7 = {};
copyDataProperties(object7, StyleSheet.absoluteFillObject, -11);
object7['borderRadius'] = (importDefault(697) /* metro dependency 697: native */).radii.sm;
let PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
object7['top'] = PX_4;
PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
object7['bottom'] = PX_4;
PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
object7['start'] = PX_4;
PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
object7['end'] = PX_4;
PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
object7['marginStart'] = PX_12;
object4.selectedRewardBannerGradient = object7;
object4.selectedRewardText = {flex: 1};
const object8 = {'position': 'absolute', 'left': 0, 'right': 0, 'top': 0, 'bottom': 0, 'borderRadius': null,
'overflow': 'hidden'};
object8.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
object4.nameplateWrapper = object8;
return object4;
}
function PremiumGiftPurchaseButton({defaultSelection}) { // fn#80967, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10647:2712, offset: 0x01e92556, size: 2182 bytes, params: 2, frame: 43
var r30;
var r18;
var r7;
var String;
var BACKGROUND_BRAND;
var items2;
const IconButton = (require(8341) /* metro dependency 8341: IconButtonNative */).IconButton;
var items3;
var items4;
var TextWithIOSLinkWorkaround;
var format;
var hYoGUM;
var defaultImport5;
const styles = useStyles((importDefault(5463) /* metro dependency 5463: useSafeAreaInsetsKeyboardAwareNative */)().insets.bottom);
const env0_1 = (require(1484) /* metro dependency 1484: useNavigationNative */).useNavigation();
const value3 = (require(7669) /* metro dependency 7669: NativeGiftContext */).useNativeGiftContext();
const env0_2 = value3.onPurchase;
const isPurchasing = value3.isPurchasing;
const productId = value3.productId;
const env0_3 = value3.allRewards;
const claimableRewards = value3.claimableRewards;
const selectedGiftingPromotionReward = value3.selectedGiftingPromotionReward;
const setSelectedGiftingPromotionReward = value3.setSelectedGiftingPromotionReward;
const env0_7 = value3.setCurrentAnalyticsStep;
const fluxModule = require(566) /* metro dependency 566: flux */;
const useStateFromStores = fluxModule.useStateFromStores;
let items = [UserStore];
const currentUser = Reflect.apply(useStateFromStores, fluxModule, [items, function() {
return UserStore.getCurrentUser();
}]);
const value4 = (require(7355) /* metro dependency 7355: IAPUtils */).useCanPurchaseIAP(productId);
const value5 = fluxModule.useStateFromStores([PromotionsStore], _fun80969);
const assetVariant = value5?.assetVariant;
const GiftCustomizationBanner_AssetVariant = (require(7278) /* metro dependency 7278: gift_customization_banner */).GiftCustomizationBanner_AssetVariant;
const LARGE_TILTED = GiftCustomizationBanner_AssetVariant.LARGE_TILTED;
const value7 = assetVariant === LARGE_TILTED;
const r14 = claimableRewards != null && claimableRewards.length > 0;
const r19 = claimableRewards != null && claimableRewards.length === 1;
const value12 = (importDefault(10392) /* metro dependency 10392: useShouldShowGiftingPromotionDeco */)();
let r6 = value12 && selectedGiftingPromotionReward == null;
const GiftingBadgeExperiment = (require(7633) /* metro dependency 7633: GiftingBadgeExperiment */).GiftingBadgeExperiment;
const useConfig = GiftingBadgeExperiment.useConfig;
const enabled = Reflect.apply(useConfig, GiftingBadgeExperiment, [{location: 'PremiumGiftPurchaseButton'}]).enabled;
const {nextTier, giftsToNextTier} = fluxModule.useStateFromStoresObject([BadgeDirectoryStore], function() {
var object = {};
object.nextTier = BadgeDirectoryStore.getNextTier(require(dependencyMap[27]).BadgeId.GIFTING);
object.giftsToNextTier = BadgeDirectoryStore.getRemainingToNextTier(require(dependencyMap[27]).BadgeId.GIFTING);
return object;
});
env0_3.useEffect(_fun80973, [r19, claimableRewards, setSelectedGiftingPromotionReward]);
let colors = value5 == null || value5.gradient == null ? undefined : value5.gradient.colors;
const r26 = colors ?? [];
if (r26.length > 0) {
r30 = r26;
} else {
String = global.String;
colors = (importDefault(697) /* metro dependency 697: native */).colors;
BACKGROUND_BRAND = colors.BACKGROUND_BRAND;
items = [String(BACKGROUND_BRAND)];
String = global.String;
colors = (importDefault(697) /* metro dependency 697: native */).colors;
BACKGROUND_BRAND = colors.BACKGROUND_BRAND;
items[1] = String(BACKGROUND_BRAND);
r30 = items;
}
const useFetchCollectiblesProductModule = require(8461) /* metro dependency 8461: useFetchCollectiblesProduct */;
const useFetchCollectiblesProduct = useFetchCollectiblesProductModule.useFetchCollectiblesProduct;
const product = Reflect.apply(useFetchCollectiblesProduct, useFetchCollectiblesProductModule,
[selectedGiftingPromotionReward]).product;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
const r11 = r6 ? Reflect.apply(string, intl, [t['gNZY/B']]) : Reflect.apply(string, intl, [t.ouo4FK]);
const r12 = r6 ? 'primary' : 'active';
const value20 = (require(10390) /* metro dependency 10390: MarketingComponentHooks */).useThemeAndReducedMotionAwareAssetUrl(value5?.mobileBackgroundAsset);
const value21 = (require(10390) /* metro dependency 10390: MarketingComponentHooks */).useThemeAndReducedMotionAwareAssetUrl(value5?.asset);
const r32 = product == null ? undefined : product.items[0];
if (r6) {
if (r14) {
var viewBinding4Props = {style: styles.chooseRewardContainer};
var viewBinding5Props = {style: styles.gradientBackdrop, pointerEvents: 'none'};
items3 = [((Component) => <Component style={StyleSheet.absoluteFillObject} useAngle angle={(value5 == null || value5.gradient == null ? undefined : value5.gradient.angle) ?? 90} angleCenter={{'x': 0.5,
'y': 0.5}} colors={r26} />)(importDefault(4589) /* metro dependency 4589 */)];
items3[1] = value20 != null && ((Component) => <Component style={styles.backgroundImage} resizeMode="cover" source={{uri: value20}} />)(importDefault(5475) /* metro dependency 5475: FastImage */);
items4 = [<View {...viewBinding5Props}>{items3}</View>];
items4[1] = value21 != null && ((Component) => <Component style={[styles.inAppFlowImage,
value7 && styles.inAppFlowImageLargeTilted]} resizeMode="contain" source={{uri: value21}} />)(importDefault(5475) /* metro dependency 5475: FastImage */);
items4[2] = ((Text) => <Text style={styles.chooseRewardText} variant="text-xs/semibold" color="white">{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.cMiNit)}</Text>)((require(4573) /* metro dependency 4573: Text */).Text);
r7 = <View {...viewBinding4Props}>{items4}</View>;
} else if (r32 == null) {
r7 = enabled && nextTier != null ? ((Component) => <Component giftsToNextTier={giftsToNextTier} nextTierName={nextTier.name ?? ''} nextTierIcon={nextTier.simple_icon_url} analyticsLocation={(importDefault(6789) /* metro dependency 6789: AnalyticsLocation */).PREMIUM_GIFT_CUSTOMIZATION} />)(importDefault(10396) /* metro dependency 10396: GiftingBadgeProgressBanner */) : null;
} else if (value12) {
if (selectedGiftingPromotionReward != null) {
var viewBinding2Props = {style: styles.selectedRewardRow};
items2 = [<View style={styles.selectedRewardBannerContainer}><RewardPreview collectiblesItem={r32} currentUser={currentUser} gradientColors={r30} gradientAngle={value5 == null || value5.gradient == null ? undefined : value5.gradient.angle} /></View>];
if (r19) {
r18 = !r19;
} else {
r18 = <IconButton variant="tertiary" size="sm" icon={((PencilIcon) => <PencilIcon size="sm" />)((require(9646) /* metro dependency 9646: PencilIcon */).PencilIcon)} accessibilityLabel={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.bt75uw)} onPress={function() {
navigateToRewardSelection(selectedGiftingPromotionReward);
}} />;
}
items2[1] = r18;
r7 = <View {...viewBinding2Props}>{items2}</View>;
} else {
r7 = enabled && nextTier != null ? ((Component) => <Component giftsToNextTier={giftsToNextTier} nextTierName={nextTier.name ?? ''} nextTierIcon={nextTier.simple_icon_url} analyticsLocation={(importDefault(6789) /* metro dependency 6789: AnalyticsLocation */).PREMIUM_GIFT_CUSTOMIZATION} />)(importDefault(10396) /* metro dependency 10396: GiftingBadgeProgressBanner */) : null;
}
} else {
r7 = enabled && nextTier != null ? ((Component) => <Component giftsToNextTier={giftsToNextTier} nextTierName={nextTier.name ?? ''} nextTierIcon={nextTier.simple_icon_url} analyticsLocation={(importDefault(6789) /* metro dependency 6789: AnalyticsLocation */).PREMIUM_GIFT_CUSTOMIZATION} />)(importDefault(10396) /* metro dependency 10396: GiftingBadgeProgressBanner */) : null;
}
} else if (r32 == null) {
r7 = enabled && nextTier != null ? ((Component) => <Component giftsToNextTier={giftsToNextTier} nextTierName={nextTier.name ?? ''} nextTierIcon={nextTier.simple_icon_url} analyticsLocation={(importDefault(6789) /* metro dependency 6789: AnalyticsLocation */).PREMIUM_GIFT_CUSTOMIZATION} />)(importDefault(10396) /* metro dependency 10396: GiftingBadgeProgressBanner */) : null;
} else if (value12) {
if (selectedGiftingPromotionReward != null) {
var viewBinding2Props = {style: styles.selectedRewardRow};
items2 = [<View style={styles.selectedRewardBannerContainer}><RewardPreview collectiblesItem={r32} currentUser={currentUser} gradientColors={r30} gradientAngle={value5 == null || value5.gradient == null ? undefined : value5.gradient.angle} /></View>];
if (r19) {
r18 = !r19;
} else {
r18 = <IconButton variant="tertiary" size="sm" icon={((PencilIcon) => <PencilIcon size="sm" />)((require(9646) /* metro dependency 9646: PencilIcon */).PencilIcon)} accessibilityLabel={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.bt75uw)} onPress={onPress_80974} />;
}
items2[1] = r18;
r7 = <View {...viewBinding2Props}>{items2}</View>;
} else {
r7 = enabled && nextTier != null ? ((Component) => <Component giftsToNextTier={giftsToNextTier} nextTierName={nextTier.name ?? ''} nextTierIcon={nextTier.simple_icon_url} analyticsLocation={(importDefault(6789) /* metro dependency 6789: AnalyticsLocation */).PREMIUM_GIFT_CUSTOMIZATION} />)(importDefault(10396) /* metro dependency 10396: GiftingBadgeProgressBanner */) : null;
}
} else {
r7 = enabled && nextTier != null ? ((Component) => <Component giftsToNextTier={giftsToNextTier} nextTierName={nextTier.name ?? ''} nextTierIcon={nextTier.simple_icon_url} analyticsLocation={(importDefault(6789) /* metro dependency 6789: AnalyticsLocation */).PREMIUM_GIFT_CUSTOMIZATION} />)(importDefault(10396) /* metro dependency 10396: GiftingBadgeProgressBanner */) : null;
}
if (r6) {
r6 = !r6;
} else {
TextWithIOSLinkWorkaround = (require(6766) /* metro dependency 6766: TextWithIOSLinkWorkaround */).TextWithIOSLinkWorkaround;
format = intl.format;
hYoGUM = (require(1244) /* metro dependency 1244: indexNative */).t.hYoGUM;
defaultImport5 = importDefault(1948) /* metro dependency 1948: HelpdeskUtils */;
r6 = <TextWithIOSLinkWorkaround variant="text-sm/normal">{Reflect.apply(format, intl, [hYoGUM,
{paidURL: defaultImport5.getArticleURL(HelpdeskArticles.PAID_TERMS)}])}</TextWithIOSLinkWorkaround>;
}
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
return (
<View style={styles.container}>
{r7}
{r6}
<Button
loading={isPurchasing}
variant={r12}
text={r11}
disabled={value4 ? isPurchasing : !value4}
onPress={isPurchasing ? undefined : _fun80975}
/>
</View>
);
}
function _fun80969() { // fn#80969, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10647:3190, offset: 0x01e92ddc, size: 111 bytes, params: 1, frame: 13
var giftCustomizationBanner;
var properties;
let value = environment.__proto__;
const getMarketingComponentByType = PromotionsStore.getMarketingComponentByType;
const MarketingComponentType = (require(7583) /* metro dependency 7583: MarketingComponentType */).MarketingComponentType;
const GIFT_CUSTOMIZATION_BANNER = MarketingComponentType.GIFT_CUSTOMIZATION_BANNER;
value = Reflect.apply(getMarketingComponentByType, PromotionsStore, [GIFT_CUSTOMIZATION_BANNER]);
const value2 = null;
if (value2 == value) {
giftCustomizationBanner = value2;
} else {
properties = value.properties;
properties = properties.properties;
if (properties.oneofKind !== 'giftCustomizationBanner') {
giftCustomizationBanner = value2;
} else {
properties = value.properties;
properties = properties.properties;
giftCustomizationBanner = properties.giftCustomizationBanner;
}
}
return giftCustomizationBanner;
}
function navigateToRewardSelection(a0) { // fn#80971, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10647:3909, owner: PremiumGiftPurchaseButton.navigateToRewardSelection, offset: 0x01e92ead, size: 191 bytes, params: 2, frame: 18
var environment;
var r4;
var setCurrentAnalyticsStepBinding;
var value3;
var binding;
var navigate;
var REWARD_SELECT;
var object2;
if (env0_8) {
setCurrentAnalyticsStepBinding = setCurrentAnalyticsStep;
value3 = environment.__proto__;
setCurrentAnalyticsStepBinding((require(7294) /* metro dependency 7294: PremiumAnalyticsUtils */).PaymentFlowStep.REWARD_SKU_SELECT);
r4 = a0 ?? defaultSelection;
binding = env0_1;
navigate = binding.navigate;
REWARD_SELECT = (require(10382) /* metro dependency 10382: PremiumGiftModal */).PremiumGiftScreens.REWARD_SELECT;
object2 = {defaultHighlightedReward: r4};
r4 = allRewards ?? [];
object2.allRewards = r4;
r4 = claimableRewards ?? [];
object2.claimableRewards = r4;
object2.onSelect = onSelect_80972;
Reflect.apply(navigate, binding, [REWARD_SELECT, object2]);
}
}
function _fun80973() { // fn#80973, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10647:4208, offset: 0x01e92fb1, size: 35 bytes, params: 1, frame: 11
if (env0_9) {
setSelectedGiftingPromotionReward(claimableRewards[0]);
}
}
function PremiumGiftPurchaseButtonOnPress() { // fn#80974, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10647:5802, owner: PremiumGiftPurchaseButton.onPress, offset: 0x01e92fd4, size: 20 bytes, params: 1, frame: 11
navigateToRewardSelection(selectedGiftingPromotionReward);
}
function _fun80975() { // fn#80975, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10647:6253, offset: 0x01e92fe8, size: 82 bytes, params: 1, frame: 12
var environment;
const value = environment.__proto__;
(require(4015) /* metro dependency 4015: ChatInputUtils */).dismissKeyboard();
if (env0_10) {
if (env0_8) {
navigateToRewardSelection();
} else {
onPurchase(_fun80976);
}
} else {
onPurchase(_fun80976);
}
}
function navigateToRewardSelectionOnSelect(a0) { // fn#80972, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10647:4127, owner: PremiumGiftPurchaseButton.navigateToRewardSelection.onSelect, offset: 0x01e92f6c, size: 69 bytes, params: 2, frame: 14
setSelectedGiftingPromotionReward(a0);
const binding = env1_1;
const navigate = binding.navigate;
const PremiumGiftScreens = (require(10382) /* metro dependency 10382: PremiumGiftModal */).PremiumGiftScreens;
const CUSTOMIZATION = PremiumGiftScreens.CUSTOMIZATION;
Reflect.apply(navigate, binding, [CUSTOMIZATION]);
}
function _fun80976() { // fn#80976, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10647:6321, offset: 0x01e9303a, size: 57 bytes, params: 1, frame: 13
const binding = env1_1;
const navigate = binding.navigate;
const PremiumGiftScreens = (require(10382) /* metro dependency 10382: PremiumGiftModal */).PremiumGiftScreens;
const SUCCESS = PremiumGiftScreens.SUCCESS;
Reflect.apply(navigate, binding, [SUCCESS]);
}
@@ -0,0 +1,153 @@
/* Metro module 10465; source: modules/premium/native/gifting/PremiumGiftPurchaseSuccess.tsx; dependencies: [31, 27, 4279, 1880, 661, 33, 4501, 697, 7669, 1484, 7633, 4129, 10382, 9212, 4578, 1244, 3802, 6797, 3856, 7642, 4573, 8554, 4061, 2] */
function _fun80988(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#80988, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10651:6, offset: 0x01e93720, size: 473 bytes, params: 8, frame: 23
var object3;
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 skuStore = importDefault(4279) /* metro dependency 4279: SKUStore */;
const env0_6 = (require(1880) /* metro dependency 1880: PremiumConstants */).SubscriptionIntervalTypes;
const env0_7 = (require(661) /* metro dependency 661: Constants */).AnalyticsSections;
let value = require(33) /* metro dependency 33 */;
const env0_8 = value.jsx;
const env0_9 = value.Fragment;
const env0_10 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
object3 = {};
const object4 = {};
let PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
object4.marginTop = PX_4;
const PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object4.marginBottom = PX_16;
object3.disclaimer = object4;
let PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
object3.title = {marginTop: PX_24, textAlign: 'center'};
const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object3.description = {marginTop: PX_8, textAlign: 'center'};
PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
object3.input = {marginTop: PX_24};
PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
object3.inputLabel = {marginBottom: PX_4};
const env0_11 = Reflect.apply(createStyles, value, [object3]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/native/gifting/PremiumGiftPurchaseSuccess.tsx');
exports.default = PremiumGiftSuccessBody;
exports.PremiumGiftSuccessActions = PremiumGiftSuccessActions;
}
function PremiumGiftSuccessBody({giftCodeRecord}) { // fn#80989, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10651:644, offset: 0x01e938f9, size: 916 bytes, params: 2, frame: 31
const styles = useStyles();
let {premiumType, planInterval,
giftStyle} = (require(7669) /* metro dependency 7669: NativeGiftContext */).useNativeGiftContext();
const giftCodeURL = (require(4129) /* metro dependency 4129: GiftCodeUtils */).getGiftCodeURL(giftCodeRecord.code);
giftStyle = giftCodeRecord.giftStyle ?? giftStyle;
const r4 = giftCodeRecord.subscriptionPlanId ?? (require(3802) /* metro dependency 3802: PremiumUtils */).getPlanIdForPremiumType(premiumType,
planInterval);
const tierDisplayNameByPlanId = (importDefault(3802) /* metro dependency 3802: PremiumUtils */).getTierDisplayNameByPlanId(r4);
const defaultImport2 = importDefault(3802) /* metro dependency 3802: PremiumUtils */;
const getInterval = defaultImport2.getInterval;
const intervalType = Reflect.apply(getInterval, defaultImport2, [r4]).intervalType;
const YEAR = SubscriptionIntervalTypes.YEAR;
const value6 = env0_3.useCallback(_fun80990, [giftCodeRecord, giftCodeURL]);
const jsxRuntimeEnv0_9Binding = jsxRuntimeEnv0_9;
const items2 = [<View>{((Component) => <Component giftStyle={giftStyle} />)(importDefault(7642) /* metro dependency 7642: PremiumGiftBackgroundAnimationAndroid */)}</View>];
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
items2[1] = <Text style={styles.title} variant="heading-lg/bold">{Reflect.apply(string, intl,
[(require(1244) /* metro dependency 1244: indexNative */).t['/s1xR7']])}</Text>;
items2[2] = <Text style={styles.description} variant="text-md/medium">{intl.format(intervalType === YEAR ? (require(1244) /* metro dependency 1244: indexNative */).t.rli5ey : (require(1244) /* metro dependency 1244: indexNative */).t.bUdTqI,
{intervalCount: 1, name: tierDisplayNameByPlanId})}</Text>;
const text = <Text style={styles.inputLabel} variant="heading-md/bold">{intl.string((require(1244) /* metro dependency 1244: indexNative */).t['qS+yMo'])}</Text>;
const InputButton = (require(8554) /* metro dependency 8554: native */).InputButton;
items2[3] = <View style={styles.input}>{text}<InputButton text={giftCodeURL} icon={importDefault(4061) /* metro dependency 4061 */} iconPosition="end" onPress={value6} /></View>;
string = intl.string;
const As9eLl = (require(1244) /* metro dependency 1244: indexNative */).t.As9eLl;
items2[4] = <Text style={styles.disclaimer} variant="text-xs/normal">{Reflect.apply(string, intl, [As9eLl])}</Text>;
return (
<>
{items2}
</>
);
}
function PremiumGiftSuccessActions({giftCodeRecord}) { // fn#80991, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10651:1878, offset: 0x01e93d13, size: 460 bytes, params: 2, frame: 25
const {onClose,
prePurchaseGiftingBadgeProgress} = (require(7669) /* metro dependency 7669: NativeGiftContext */).useNativeGiftContext();
const value3 = (require(1484) /* metro dependency 1484: useNavigationNative */).useNavigation();
const GiftingBadgeExperiment = (require(7633) /* metro dependency 7633: GiftingBadgeExperiment */).GiftingBadgeExperiment;
const useConfig = GiftingBadgeExperiment.useConfig;
const enabled = Reflect.apply(useConfig, GiftingBadgeExperiment, [{location: 'PremiumGiftSuccessActions'}]).enabled;
const env0_3 = enabled;
const giftCodeURL = (require(4129) /* metro dependency 4129: GiftCodeUtils */).getGiftCodeURL(giftCodeRecord.code);
const binding = env0_3;
const value5 = binding.useCallback(_fun80992, [enabled, prePurchaseGiftingBadgeProgress, value3, onClose]);
const value6 = binding.useCallback(_fun80993, [giftCodeURL, enabled, prePurchaseGiftingBadgeProgress, value3]);
const jsxRuntimeEnv0_9Binding = jsxRuntimeEnv0_9;
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const RDE0Sc = (require(1244) /* metro dependency 1244: indexNative */).t.RDE0Sc;
return (
<>
<Button
variant="primary"
text={Reflect.apply(string, intl, [RDE0Sc])}
onPress={value6}
/>
<Button
variant="secondary"
text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.cpT0Cq)}
onPress={value5}
/>
</>
);
}
function _fun80990() { // fn#80990, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10651:1048, offset: 0x01e93c8d, size: 134 bytes, params: 1, frame: 15
var moduleValue;
const value = environment.__proto__;
const value3 = SKUStore.get(giftCodeRecord.skuId);
if (value3 != null) {
moduleValue = require(4129) /* metro dependency 4129: GiftCodeUtils */;
moduleValue.trackGiftCodeCopy(giftCodeRecord, value3);
}
(require(6797) /* metro dependency 6797: ClipboardUtilsNative */).copy(env0_1);
(require(3856) /* metro dependency 3856: ToastUtils */).presentCopiedToClipboard();
}
function _fun80992() { // fn#80992, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10651:2187, offset: 0x01e93edf, size: 100 bytes, params: 1, frame: 15
var binding;
var navigate;
var value2;
if (enabled) {
if (prePurchaseGiftingBadgeProgress != null) {
binding = env0_2;
navigate = binding.navigate;
value2 = environment.__proto__;
Reflect.apply(navigate, binding,
[(require(10382) /* metro dependency 10382: PremiumGiftModal */).PremiumGiftScreens.GIFTING_BADGE,
{currentProgress: prePurchaseGiftingBadgeProgress}]);
} else {
onClose();
}
} else {
onClose();
}
}
function _fun80993() { // fn#80993, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10651:2311, offset: 0x01e93f43, size: 141 bytes, params: 1, frame: 16
var binding;
const showShareActionSheetAndroidModule = require(9212) /* metro dependency 9212: showShareActionSheetAndroid */;
const showShareActionSheet = showShareActionSheetAndroidModule.showShareActionSheet;
const PREMIUM_GIFT_SUCCESS_MODAL = AnalyticsSections.PREMIUM_GIFT_SUCCESS_MODAL;
Reflect.apply(showShareActionSheet, showShareActionSheetAndroidModule, [{url: env0_4}, PREMIUM_GIFT_SUCCESS_MODAL]);
if (enabled && prePurchaseGiftingBadgeProgress != null) {
binding = env0_2;
binding.navigate((require(10382) /* metro dependency 10382: PremiumGiftModal */).PremiumGiftScreens.GIFTING_BADGE,
{currentProgress: prePurchaseGiftingBadgeProgress});
}
}
@@ -0,0 +1,85 @@
/* Metro module 10463; source: modules/premium/native/gifting/PremiumGiftSuccess.tsx; dependencies: [31, 27, 7261, 1376, 33, 4501, 697, 1585, 7669, 44, 10464, 10392, 7675, 566, 1367, 1365, 10465, 10466, 10467, 2] */
function _fun80981(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#80981, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10649:6, offset: 0x01e931f3, size: 253 bytes, params: 8, frame: 19
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 promotionsStore = importDefault(7261) /* metro dependency 7261: PromotionsStore */;
const env0_6 = (require(1376) /* metro dependency 1376: DismissibleContentConstants */).ContentDismissActionType;
const value = require(33) /* metro dependency 33 */;
const env0_7 = value.jsx;
const env0_8 = value.Fragment;
const env0_9 = value.jsxs;
const env0_10 = (require(4501) /* metro dependency 4501: createStyles */).createStyles(_fun80982);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/native/gifting/PremiumGiftSuccess.tsx');
exports.default = PremiumGiftSuccess;
}
function _fun80982(a0) { // fn#80982, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10649:230, offset: 0x01e932f0, size: 250 bytes, params: 2, frame: 17
const object4 = {};
const object5 = {'backgroundColor': null, 'paddingHorizontal': null, 'flex': 1, 'alignContent': 'center',
'justifyContent': 'center', 'flexGrow': 1};
let BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
object5.backgroundColor = BACKGROUND_BASE_LOW;
let PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object5.paddingHorizontal = PX_16;
object4.bodyContainer = object5;
const object6 = {};
BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
object6.backgroundColor = BACKGROUND_BASE_LOW;
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object6.paddingTop = PX_16;
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object6.paddingBottom = a0 + PX_16;
const PX_162 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object6.paddingHorizontal = PX_162;
const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object6.gap = PX_8;
const SHADOW_TOP_LOW = (importDefault(697) /* metro dependency 697: native */).shadows.SHADOW_TOP_LOW;
copyDataProperties(object6, SHADOW_TOP_LOW, PX_16);
object4.actionContainer = object6;
return object4;
}
function PremiumGiftSuccess() { // fn#80983, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10649:737, offset: 0x01e933ea, size: 560 bytes, params: 1, frame: 24
const styles = useStyles((importDefault(1585) /* metro dependency 1585: useSafeAreaInsetsNative */)().bottom);
const {recipientUser, giftCodeRecord,
selectedGiftingPromotionReward} = (require(7669) /* metro dependency 7669: NativeGiftContext */).useNativeGiftContext();
(importDefault(44) /* metro dependency 44 */)(giftCodeRecord != null,
'Gift code record cannot be null on success screen');
const value3 = (importDefault(10464) /* metro dependency 10464: useGiftingPromotionConfig */)();
const value4 = (importDefault(10392) /* metro dependency 10392: useShouldShowGiftingPromotionDeco */)();
const value5 = (require(7675) /* metro dependency 7675: useFetchCollectiblesCategoriesAndPurchases */).useGetOrFetchPurchase(selectedGiftingPromotionReward,
false);
env0_3.useEffect(_fun80985, [value4, value3,
(require(566) /* metro dependency 566: flux */).useStateFromStores([PromotionsStore], _fun80984)]);
return (
<>
<View style={styles.bodyContainer}>
{recipientUser == null ? ((Component) => <Component giftCodeRecord={giftCodeRecord} />)(importDefault(10465) /* metro dependency 10465: PremiumGiftPurchaseSuccess */) : ((Component) => <Component />)(importDefault(10466) /* metro dependency 10466: PremiumGiftDMPurchaseSuccess */)}
</View>
<View style={styles.actionContainer}>
{value5 != null ? ((Component) => <Component purchase={value5} />)(importDefault(10467) /* metro dependency 10467: PremiumGiftingPromotionSuccessActions */) : recipientUser == null ? ((PremiumGiftSuccessActions) => <PremiumGiftSuccessActions giftCodeRecord={giftCodeRecord} />)((require(10465) /* metro dependency 10465: PremiumGiftPurchaseSuccess */).PremiumGiftSuccessActions) : ((PremiumGiftDMSuccessActions) => <PremiumGiftDMSuccessActions />)((require(10466) /* metro dependency 10466: PremiumGiftDMPurchaseSuccess */).PremiumGiftDMSuccessActions)}
</View>
</>
);
}
function _fun80984() { // fn#80984, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10649:1075, offset: 0x01e9361a, size: 35 bytes, params: 1, frame: 10
const value = environment.__proto__;
return PromotionsStore.getGiftPromotion()?.id;
}
function _fun80985() { // fn#80985, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10649:1152, offset: 0x01e9363d, size: 140 bytes, params: 1, frame: 18
var value5;
var moduleValue;
if (env0_0 != null && env0_0.reminderNotice != null && env0_1 && env0_2 != null) {
value5 = environment.__proto__;
moduleValue = require(1367) /* metro dependency 1367: DismissibleContentUtils */;
moduleValue.markSnowflakeBoundDismissibleContentAsDismissed((require(1365) /* metro dependency 1365: dismissible_content */).DismissibleContent.GIFTING_PROMOTION_REMINDER,
env0_2, {dismissAction: ContentDismissActionType.INDIRECT_ACTION});
}
}
@@ -0,0 +1,351 @@
/* Metro module 10431; source: modules/premium/native/gifting/PremiumGiftWishlistBanner.tsx; dependencies: [5, 31, 27, 6830, 1880, 661, 663, 8516, 33, 697, 4501, 10020, 10034, 10432, 10344, 10436, 6771, 6789, 683, 8743, 10384, 10437, 4008, 3857, 1244, 5120, 7631, 3995, 4573, 10450, 10454, 2] */
function _fun80690(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#80690, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10617:6, offset: 0x01e86586, size: 410 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(5) /* metro dependency 5 */;
const env0_4 = importAll(31) /* metro dependency 31 */;
let value = require(27) /* metro dependency 27 */;
const env0_5 = value.ScrollView;
const env0_6 = value.View;
const env0_7 = (require(6830) /* metro dependency 6830: WishlistRecommendationRecord */).WishlistRecommendationReason;
value = require(1880) /* metro dependency 1880: PremiumConstants */;
const env0_8 = value.GiftingOrigin;
const env0_9 = value.PremiumSubscriptionSKUToPremiumType;
value = require(661) /* metro dependency 661: Constants */;
const env0_10 = value.AnalyticEvents;
const env0_11 = value.SKUProductLines;
const env0_12 = (require(663) /* metro dependency 663: CollectiblesShopConstants */).CollectiblesMobileShopScreen;
const env0_13 = (require(8516) /* metro dependency 8516: Constants */).UserProfileSections;
value = require(33) /* metro dependency 33 */;
const env0_14 = value.jsx;
const env0_15 = value.jsxs;
let PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
const env0_18 = (require(4501) /* metro dependency 4501: createStyles */).createStyles(_fun80691);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/native/gifting/PremiumGiftWishlistBanner.tsx');
exports.PremiumGiftWishlistBanner = PremiumGiftWishlistBanner;
}
function _fun80691(a0, a1) { // fn#80691, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10617:475, offset: 0x01e86720, size: 280 bytes, params: 3, frame: 20
const object2 = {};
const PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
object2.title = {marginBottom: PX_4, paddingHorizontal: PX_16};
const PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
object2.subtitle = {marginBottom: PX_12, paddingHorizontal: PX_16};
object2.placeholderRow = {flexDirection: 'row', gap: PX_16, paddingHorizontal: PX_16};
const object3 = {width: a0, height: a1};
object3.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
const BACKGROUND_SECONDARY_ALT = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_SECONDARY_ALT;
object3.backgroundColor = BACKGROUND_SECONDARY_ALT;
object2.placeholder = object3;
const object4 = {width: a0, height: a1};
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
const BG_SURFACE_RAISED = (importDefault(697) /* metro dependency 697: native */).colors.BG_SURFACE_RAISED;
object4.backgroundColor = BG_SURFACE_RAISED;
const SHADOW_LOW = (importDefault(697) /* metro dependency 697: native */).shadows.SHADOW_LOW;
copyDataProperties(object4, SHADOW_LOW, 'row');
object2.wishlistItemShadow = object4;
return object2;
}
function PremiumGiftWishlistBanner({giftRecipient}) { // fn#80692, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10617:1069, offset: 0x01e86838, size: 1233 bytes, params: 2, frame: 37
var r12;
var object6;
var object2;
var items7;
var value17;
var Array;
const object3 = {};
const COLLECTIBLES_SHOP_CARD_WIDTH = (require(10020) /* metro dependency 10020: CollectiblesShopCardV2 */).COLLECTIBLES_SHOP_CARD_WIDTH;
object3.width = COLLECTIBLES_SHOP_CARD_WIDTH;
const COLLECTIBLES_SHOP_CARD_HEIGHT = (require(10020) /* metro dependency 10020: CollectiblesShopCardV2 */).COLLECTIBLES_SHOP_CARD_HEIGHT;
object3.height = COLLECTIBLES_SHOP_CARD_HEIGHT;
const WISHLIST_IN_DM_LENGTH_MOBILE = (require(10034) /* metro dependency 10034: useWishlistHooks */).WISHLIST_IN_DM_LENGTH_MOBILE;
const value2 = (require(10432) /* metro dependency 10432: useWishlistRecommendations */).useWishlistRecommendationsForSingleUser({userId: giftRecipient.id,
numItems: WISHLIST_IN_DM_LENGTH_MOBILE});
const wishlistAndRecommendations = value2.wishlistAndRecommendations;
const skusToUserAndReason = value2.skusToUserAndReason;
const env0_4 = skusToUserAndReason;
const status = value2.status;
const totalUnownedWishlistItemCount = value2.totalUnownedWishlistItemCount;
const defaultWishlistId = value2.defaultWishlistId;
const binding = env0_4;
const value3 = binding.useMemo(_fun80693, [wishlistAndRecommendations, giftRecipient.id, skusToUserAndReason]);
const value4 = binding.useMemo(_fun80696, [totalUnownedWishlistItemCount, WISHLIST_IN_DM_LENGTH_MOBILE, value3]);
const defaultImport = importDefault(6771) /* metro dependency 6771: useAnalyticsLocations */;
const WISHLIST_BANNER = (importDefault(6789) /* metro dependency 6789: AnalyticsLocation */).WISHLIST_BANNER;
const analyticsLocations = defaultImport(WISHLIST_BANNER).analyticsLocations;
const env0_10 = binding.useRef(false);
binding.useEffect(_fun80697, [status, value3, giftRecipient.id, analyticsLocations]);
const value5 = binding.useCallback(function() {
importDefault(dependencyMap[19])({userId: giftRecipient.id, initialSection: UserProfileSections.WISHLIST,
sourceAnalyticsLocations: analyticsLocations});
}, [giftRecipient.id, analyticsLocations]);
const env0_12 = binding.useCallback(_fun80701(), [giftRecipient, defaultWishlistId,
(require(10384) /* metro dependency 10384: useSelectPremiumGift */).useSelectPremiumGift('PremiumGiftWishlistBanner')]);
const name = (importDefault(3995) /* metro dependency 3995: UserUtils */).getName(giftRecipient);
const BANNER_CONFIG_MOBILE = (require(10436) /* metro dependency 10436: WishlistBannerUtils */).BANNER_CONFIG_MOBILE;
const property = BANNER_CONFIG_MOBILE[value4];
const title = property.title;
const subtitle = property.getSubtitle(name);
const styles = useStyles(COLLECTIBLES_SHOP_CARD_WIDTH, COLLECTIBLES_SHOP_CARD_HEIGHT);
if (status === 'error') {
return null;
}
let r5 = status === 'loading' || value3.length === 0;
const value12 = totalUnownedWishlistItemCount > WISHLIST_IN_DM_LENGTH_MOBILE;
const r16 = value12 ? value3.slice(0, WISHLIST_IN_DM_LENGTH_MOBILE - 1) : value3;
const r25 = value12 ? value3[WISHLIST_IN_DM_LENGTH_MOBILE - 1] : null;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
const items6 = [<Text style={styles.title} variant="text-lg/semibold">{title}</Text>];
items6[1] = <Text style={styles.subtitle} variant="text-sm/medium" color="text-muted">{subtitle}</Text>;
if (r5) {
Array = global.Array;
r5 = <View style={styles.placeholderRow}>{Array.from({length: WISHLIST_IN_DM_LENGTH_MOBILE}, _fun80705)}</View>;
} else {
var scrollViewProps = {'horizontal': true, 'showsHorizontalScrollIndicator': false, 'snapToInterval': null,
'snapToAlignment': 'start', 'decelerationRate': 'fast', 'nestedScrollEnabled': true,
snapToInterval: COLLECTIBLES_SHOP_CARD_WIDTH + PX_16};
object2 = {gap: PX_16};
object2.paddingHorizontal = PX_16;
object2.paddingVertical = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
scrollViewProps.contentContainerStyle = object2;
items7 = [r16.map(_fun80706)];
value17 = r25 != null;
if (value17) {
var viewBinding2Props = {style: styles.wishlistItemShadow};
if (value12) {
viewBinding2Props.children = ((Component) => <Component item={r25.item} size={object3} recipientName={name} overflowCount={totalUnownedWishlistItemCount - WISHLIST_IN_DM_LENGTH_MOBILE + 1} onPress={value5} />)(importDefault(10454) /* metro dependency 10454: WishlistViewMoreCard */);
} else {
viewBinding2Props.children = ((Component) => <Component item={r25.item} size={object3} source={r25.source} recipientName={name} onPress={onPress_80708} />)(importDefault(10450) /* metro dependency 10450: WishlistItemCard */);
}
r12 = <View {...viewBinding2Props} />;
} else {
r12 = value17;
}
items7[1] = r12;
r5 = <ScrollView {...scrollViewProps}>{items7}</ScrollView>;
}
items6[2] = r5;
return (
<View>
{items6}
</View>
);
}
function _fun80693() { // fn#80693, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10617:1473, offset: 0x01e86d09, size: 45 bytes, params: 1, frame: 12
return wishlistAndRecommendations.map(_fun80694).filter(function(a0) {
return a0.item != null;
});
}
function _fun80696() { // fn#80696, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10617:1704, offset: 0x01e86df9, size: 70 bytes, params: 1, frame: 13
const value = environment.__proto__;
return (require(10436) /* metro dependency 10436: WishlistBannerUtils */).getBannerModeFromDisplayItems({totalUnownedWishlistItemCount: totalUnownedWishlistItemCount,
wishlistInDmLength: WISHLIST_IN_DM_LENGTH_MOBILE, displayItems: env0_8});
}
function _fun80697() { // fn#80697, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10617:1914, offset: 0x01e86e3f, size: 239 bytes, params: 1, frame: 20
var environment;
var value5;
var defaultImport;
var track;
var IMPRESSION_GIFT_OPTION_WISHLIST_BANNER_VIEWED;
var object2;
var binding;
var Array;
var from;
var Set;
var value6;
var value7;
var set;
if (!env0_10.current && status === 'success' && env0_8.length > 0) {
value5 = environment.__proto__;
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
track = defaultImport.track;
IMPRESSION_GIFT_OPTION_WISHLIST_BANNER_VIEWED = AnalyticEvents.IMPRESSION_GIFT_OPTION_WISHLIST_BANNER_VIEWED;
object2 = {};
object2.gift_recipient_id = giftRecipient.id;
binding = env0_8;
object2.sku_ids = binding.map(function(a0) {
return a0.item.skuId;
});
object2.location_stack = analyticsLocations;
Array = global.Array;
from = Array.from;
Set = global.Set;
value6 = binding.map(_fun80699);
value7 = Object.create(Set.prototype, {constructor: {value: Set}});
set = new Set();
object2.product_lines = Reflect.apply(from, Array, [set instanceof Object ? set : value7]);
Reflect.apply(track, defaultImport, [IMPRESSION_GIFT_OPTION_WISHLIST_BANNER_VIEWED, object2]);
env0_10.current = true;
}
}
function _fun80701() { // fn#80701, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10617:2399, offset: 0x01e86f97, size: 36 bytes, params: 1, frame: 12
const env0_0 = env1_3(_fun80703);
return _fun80704;
}
function _fun80705(a0, a1) { // fn#80705, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10617:4039, offset: 0x01e87295, size: 44 bytes, params: 3, frame: 15
return <View style={styles.placeholder} key={a1} />;
}
function _fun80706({item, source}) { // fn#80706, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10617:4361, offset: 0x01e872c1, size: 137 bytes, params: 2, frame: 21
var environment;
const env0_1 = source;
const value = environment.__proto__;
return (
<View style={styles.wishlistItemShadow} key={item.skuId}>
{((Component) => <Component item={item} size={env0_1} source={source} recipientName={env0_13} onPress={onPress_80707} />)(importDefault(10450) /* metro dependency 10450: WishlistItemCard */)}
</View>
);
}
function PremiumGiftWishlistBannerOnPress() { // fn#80708, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10617:4750, owner: PremiumGiftWishlistBanner.onPress, offset: 0x01e87366, size: 35 bytes, params: 1, frame: 13
return env0_12(env0_15.item, env0_15.source);
}
function _fun80694(a0) { // fn#80694, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10617:1484, offset: 0x01e86d36, size: 179 bytes, params: 2, frame: 15
var r1;
var property;
const WishlistItemSource = (require(10034) /* metro dependency 10034: useWishlistHooks */).WishlistItemSource;
const object2 = {};
object2.item = (require(10344) /* metro dependency 10344: WishlistUtils */).wishlistItemFromSKU(a0);
let skusToUserAndReasonBinding = skusToUserAndReason;
let id = a0.id;
if (skusToUserAndReasonBinding[id] == null) {
r1 = WishlistItemSource.POPULAR;
} else {
skusToUserAndReasonBinding = skusToUserAndReason;
id = a0.id;
property = skusToUserAndReasonBinding[id];
id = giftRecipient.id;
property = property[id];
r1 = property === WishlistRecommendationReason.WISHLIST ? WishlistItemSource.WISHLIST : WishlistItemSource.POPULAR;
}
object2.source = r1;
return object2;
}
function _fun80699({item}) { // fn#80699, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10617:2141, offset: 0x01e86f3d, size: 16 bytes, params: 2, frame: 1
return item.skuProductLine;
}
function* _fun80703(a0, a1) { // fn#80703, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10617:2419, offset: 0x01e86fc6, size: 719 bytes, params: 3, frame: 22
var binding3;
var value9;
var openSocialLayerStorefrontGiftModal;
var GIFT_SELECTION_MODAL_WISHLIST;
var value10;
var rootNavigationRef;
var binding4;
var value13;
var open;
var intl;
var binding5;
var value14;
var openCollectiblesShopMobile;
var binding6;
var value15;
var openShopGiftModal;
var value16;
if (true) {
value = environment.__proto__.__proto__.__proto__;
var binding = env3_1;
var binding2 = env3_2;
var value3 = binding(binding2[18]);
var track = value3.track;
var GIFTING_ITEM_CLICKED = env3_10.GIFTING_ITEM_CLICKED;
var object2 = {};
object2.sku_id = a0.skuId;
var WishlistItemSource = env3_0(binding2[12]).WishlistItemSource;
var WISHLIST = WishlistItemSource.WISHLIST;
object2.item_source = a1 !== WISHLIST ? 'shop' : 'wishlist';
WishlistItemSource = env3_0(env3_2[12]).WishlistItemSource;
WISHLIST = WishlistItemSource.WISHLIST;
var value6 = null;
var WishlistRecommendationReason2 = a1 !== WISHLIST ? value6 : WishlistRecommendationReason;
object2.wishlist_id = WishlistRecommendationReason2;
var skuProductLine = a0.skuProductLine;
object2.product_line = skuProductLine;
Reflect.apply(track, value3, [GIFTING_ITEM_CLICKED, object2]);
skuProductLine = a0.skuProductLine;
var PREMIUM = env3_11.PREMIUM;
if (skuProductLine !== PREMIUM) {
if (a0.skuProductLine !== env3_11.SOCIAL_LAYER_GAME_ITEM) {
binding = env3_0;
rootNavigationRef = binding(env3_2[22]).getRootNavigationRef();
if (value6 == rootNavigationRef) {
binding = env3_1;
binding4 = env3_2;
value13 = binding(binding4[23]);
open = value13.open;
object2 = {key: 'WISHLIST_ITEM_PRESS_ERROR'};
binding = env3_0;
intl = binding(binding4[24]).intl;
object2.content = intl.string(binding(binding4[24]).t['rTU7/z']);
Reflect.apply(open, value13, [object2]);
} else if (rootNavigationRef.isReady()) {
binding = env3_0;
binding5 = env3_2;
value14 = binding(binding5[25]);
openCollectiblesShopMobile = value14.openCollectiblesShopMobile;
object2 = {};
binding6 = env3_1;
GIFT_SELECTION_MODAL_WISHLIST = binding6(binding5[17]).GIFT_SELECTION_MODAL_WISHLIST;
object2.analyticsLocations = [GIFT_SELECTION_MODAL_WISHLIST];
GIFT_SELECTION_MODAL_WISHLIST = binding6(binding5[17]).GIFT_SELECTION_MODAL_WISHLIST;
object2.analyticsSource = GIFT_SELECTION_MODAL_WISHLIST;
object2.screen = env3_12.FEATURED_PAGE;
Reflect.apply(openCollectiblesShopMobile, value14, [object2]);
value15 = binding(binding5[26]);
openShopGiftModal = value15.openShopGiftModal;
object2 = {};
object2.skuId = a0.skuId;
GIFT_SELECTION_MODAL_WISHLIST = binding6(binding5[17]).GIFT_SELECTION_MODAL_WISHLIST;
object2.analyticsLocations = [GIFT_SELECTION_MODAL_WISHLIST];
value16 = environment.__proto__.__proto__;
object2.lockedRecipientUser = require;
object2.giftingOrigin = env3_8.DM_CHANNEL_WISHLIST;
Reflect.apply(openShopGiftModal, value15, [object2]);
} else {
binding = env3_1;
binding4 = env3_2;
value13 = binding(binding4[23]);
open = value13.open;
object2 = {key: 'WISHLIST_ITEM_PRESS_ERROR'};
binding = env3_0;
intl = binding(binding4[24]).intl;
object2.content = intl.string(binding(binding4[24]).t['rTU7/z']);
Reflect.apply(open, value13, [object2]);
}
} else {
binding = env3_0;
binding3 = env3_2;
value9 = binding(binding3[21]);
openSocialLayerStorefrontGiftModal = value9.openSocialLayerStorefrontGiftModal;
object2 = {};
object2.skuId = a0.skuId;
binding = env3_1;
object2.analyticsLocations = [binding(binding3[17]).GIFT_SELECTION_MODAL_WISHLIST];
value10 = environment.__proto__.__proto__;
object2.lockedRecipientUser = require;
object2.giftingOrigin = env3_8.DM_CHANNEL_WISHLIST;
Reflect.apply(openSocialLayerStorefrontGiftModal, value9, [object2]);
}
return undefined;
}
var property = env3_9[a0.skuId];
value = environment.__proto__.__proto__;
yield SKUProductLines(property);
}
}
function onPress_80707() { // fn#80707, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10617:4483, offset: 0x01e8734a, size: 28 bytes, params: 1, frame: 13
return env1_12(item, source);
}
@@ -0,0 +1,123 @@
/* Metro module 10467; source: modules/premium/native/gifting/PremiumGiftingPromotionSuccessActions.tsx; dependencies: [31, 27, 5126, 1902, 1878, 33, 4501, 697, 566, 7669, 1484, 7633, 8461, 10382, 7589, 8483, 1901, 1305, 10462, 4578, 1244, 2] */
function _fun80998(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#80998, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10653:6, offset: 0x01e943ac, size: 413 bytes, params: 8, frame: 22
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 env0_5 = (require(5126) /* metro dependency 5126: AvatarDecorationRecord */).isAvatarDecorationRecord;
const env0_6 = (require(1902) /* metro dependency 1902: NameplateRecord */).isNameplateRecord;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
let value = require(33) /* metro dependency 33 */;
const env0_8 = value.jsx;
const env0_9 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
object2 = {};
const PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object2.container = {'flexDirection': 'column', 'alignItems': 'center', gap: PX_16};
const object5 = {'width': 234, 'height': 40, 'flexDirection': 'row', 'alignItems': 'center', 'position': 'relative',
'borderRadius': null, 'overflow': 'hidden'};
object5.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
object2.nameplateContainer = object5;
const object6 = {'position': 'absolute', 'left': 0, 'right': 0, 'top': 0, 'bottom': 0, 'borderRadius': null,
'overflow': 'hidden'};
object6.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
object2.nameplateWrapper = object6;
object2.singleAvatarContainer = {'flexDirection': 'row', 'paddingRight': 15, 'justifyContent': 'center',
'alignItems': 'center', 'marginLeft': 5};
const env0_10 = Reflect.apply(createStyles, value, [object2]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/native/gifting/PremiumGiftingPromotionSuccessActions.tsx');
exports.default = PremiumGiftingPromotionSuccessActions;
}
function PremiumGiftingPromotionSuccessActions({purchase}) { // fn#80999, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10653:826, offset: 0x01e94549, size: 820 bytes, params: 2, frame: 31
var r6;
var items2;
var Avatar;
const styles = useStyles();
const currentUser = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
return UserStore.getCurrentUser();
});
const {onClose,
prePurchaseGiftingBadgeProgress} = (require(7669) /* metro dependency 7669: NativeGiftContext */).useNativeGiftContext();
const value4 = (require(1484) /* metro dependency 1484: useNavigationNative */).useNavigation();
const GiftingBadgeExperiment = (require(7633) /* metro dependency 7633: GiftingBadgeExperiment */).GiftingBadgeExperiment;
const useConfig = GiftingBadgeExperiment.useConfig;
const enabled = Reflect.apply(useConfig, GiftingBadgeExperiment,
[{location: 'PremiumGiftingPromotionSuccessActions'}]).enabled;
const env0_3 = enabled;
const {product,
isFetching} = (require(8461) /* metro dependency 8461: useFetchCollectiblesProduct */).useFetchCollectiblesProduct(purchase.skuId);
const binding = env0_3;
const value7 = binding.useCallback(_fun81002, [product, onClose, binding.useCallback(_fun81001, [enabled,
prePurchaseGiftingBadgeProgress, value4]), enabled, prePurchaseGiftingBadgeProgress, value4]);
const property = purchase.items[0];
if (isNameplateRecord(property)) {
var viewBinding2Props = {style: styles.nameplateContainer};
items2 = [<View style={styles.nameplateWrapper}>{((Component) => <Component nameplate={(require(1901) /* metro dependency 1901: utils */).getNameplateData(property)} fullOpacity animate />)(importDefault(8483) /* metro dependency 8483: Nameplate */)}</View>];
var viewBinding2Props3 = {style: styles.singleAvatarContainer};
Avatar = (require(1305) /* metro dependency 1305: native */).Avatar;
var avatarProps = {user: currentUser, guildId: undefined,
size: (require(1305) /* metro dependency 1305: native */).AvatarSizes.SMALL};
avatarProps['aria-hidden'] = true;
items2[1] = <View {...viewBinding2Props3}><Avatar {...avatarProps} /></View>;
r6 = <View {...viewBinding2Props}>{items2}</View>;
} else {
r6 = isAvatarDecorationRecord(property) ? ((Component) => <Component size={(require(1305) /* metro dependency 1305: native */).AvatarSizes.LARGE} asset={property.asset} />)(importDefault(10462) /* metro dependency 10462: GiftingRewardPreviewAvatar */) : undefined;
}
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
return (
<View style={styles.container}>
{r6}
<Button
grow
text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.kMYVwv)}
loading={isFetching}
onPress={value7}
/>
</View>
);
}
function _fun81001() { // fn#81001, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10653:1260, offset: 0x01e9487d, size: 91 bytes, params: 1, frame: 15
var binding;
var navigate;
var value3;
if (enabled && prePurchaseGiftingBadgeProgress != null) {
binding = env0_2;
navigate = binding.navigate;
value3 = environment.__proto__;
Reflect.apply(navigate, binding,
[(require(10382) /* metro dependency 10382: PremiumGiftModal */).PremiumGiftScreens.GIFTING_BADGE,
{currentProgress: prePurchaseGiftingBadgeProgress}]);
}
}
function _fun81002() { // fn#81002, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10653:1379, offset: 0x01e948d8, size: 166 bytes, params: 1, frame: 15
var binding;
var navigate;
var value2;
var value3;
if (product != null) {
value3 = environment.__proto__;
(importDefault(7589) /* metro dependency 7589: ProductPurchaseSuccessActionCreators */).open({product: product,
onCancel: env0_5});
} else if (enabled) {
if (prePurchaseGiftingBadgeProgress != null) {
binding = env0_2;
navigate = binding.navigate;
value2 = environment.__proto__;
Reflect.apply(navigate, binding,
[(require(10382) /* metro dependency 10382: PremiumGiftModal */).PremiumGiftScreens.GIFTING_BADGE,
{currentProgress: prePurchaseGiftingBadgeProgress}]);
} else {
onClose();
}
} else {
onClose();
}
}