Files
2026-07-28 01:06:53 +03:00

510 lines
31 KiB
TypeScript

/* 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] */
import UserStore from '../../../../stores/UserStore.tsx'; /* Metro dependency 1878 */
import UseSafeAreaInsetsKeyboardAwareNative from '../../../safe_area/useSafeAreaInsetsKeyboardAware.native.tsx'; /* Metro dependency 5463 */
import PromotionsStore from '../../promotions/PromotionsStore.tsx'; /* Metro dependency 7261 */
import BadgeDirectoryStore from '../../../badges/BadgeDirectoryStore.tsx'; /* Metro dependency 7670 */
import UseShouldShowGiftingPromotionDeco from '../../gifting/native/hooks/useShouldShowGiftingPromotionDeco.tsx'; /* Metro dependency 10392 */
import * as FileImportTrackerModule from '../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactNativeModule from '../../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
import * as ReactModule from '../../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as FluxModule from '../../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
import * as ConstantsModule from '../../../../Constants.tsx'; /* Metro dependency 661 */
import * as UseNavigationNativeModule from '../../../../design/components/Navigator/native/useNavigation.native.tsx'; /* Metro dependency 1484 */
import * as NameplateRecordModule from '../../../collectibles/records/NameplateRecord.tsx'; /* Metro dependency 1902 */
import * as ChatInputUtilsModule from '../../../../utils/native/ChatInputUtils.tsx'; /* Metro dependency 4015 */
import * as CreateStylesModule from '../../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
import * as TextModule from '../../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
import * as ButtonNativeModule from '../../../../design/components/Button/native/Button.native.tsx'; /* Metro dependency 4578 */
import * as AvatarDecorationRecordModule from '../../../collectibles/records/AvatarDecorationRecord.tsx'; /* Metro dependency 5126 */
import * as Gift_customization_bannerModule from '../../../../external/discord_common/js/packages/protos/discord_protos/premium_marketing/v1/gift_customization_banner.tsx'; /* Metro dependency 7278 */
import * as IAPUtilsModule from '../../../../utils/native/IAPUtils.tsx'; /* Metro dependency 7355 */
import * as MarketingComponentTypeModule from '../../../../external/discord_common/js/shared/shared-constants/MarketingComponentType.tsx'; /* Metro dependency 7583 */
import * as GiftingBadgeExperimentModule from '../../gifting/experiments/GiftingBadgeExperiment.tsx'; /* Metro dependency 7633 */
import * as NativeGiftContextModule from '../../../payments/native/NativeGiftContext.tsx'; /* Metro dependency 7669 */
import * as IconButtonNativeModule from '../../../../design/components/Button/native/IconButton.native.tsx'; /* Metro dependency 8341 */
import * as UseFetchCollectiblesProductModule from '../../../collectibles/hooks/useFetchCollectiblesProduct.tsx'; /* Metro dependency 8461 */
import * as PremiumGiftModalModule from './PremiumGiftModal.tsx'; /* Metro dependency 10382 */
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});
let value = ReactNativeModule;
const env0_4 = value.StyleSheet;
const env0_5 = value.View;
value = require(33) /* metro dependency 33 */;
const env0_12 = value.jsx;
const env0_13 = value.Fragment;
const env0_14 = value.jsxs;
const env0_15 = (CreateStylesModule).createStyles(_fun80966);
(FileImportTrackerModule).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 = (TextModule).Text;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
var items2;
var Avatar;
const styles = useStyles((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 object = {};
const object2 = {};
const BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
object2.backgroundColor = BACKGROUND_BASE_LOW;
let PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
object2.paddingTop = PX_12;
PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
object2.paddingBottom = PX_12 + a0;
let PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object2.paddingHorizontal = PX_16;
let PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object2.gap = PX_8;
const SHADOW_TOP_HIGH = (importDefault(697) /* metro dependency 697: native */).shadows.SHADOW_TOP_HIGH;
copyDataProperties(object2, SHADOW_TOP_HIGH, undefined);
object.container = object2;
object.chooseRewardContainer = {'flexDirection': 'row', 'alignItems': 'center', 'height': 52};
const object3 = {};
copyDataProperties(object3, StyleSheet.absoluteFillObject, undefined);
object3['borderRadius'] = (importDefault(697) /* metro dependency 697: native */).radii.sm;
object3['overflow'] = 'hidden';
object.gradientBackdrop = object3;
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object.chooseRewardText = {flex: 1, marginStart: PX_8};
object.backgroundImage = {'position': 'absolute', 'top': 0, 'left': 0, 'right': 0, 'bottom': 0, 'opacity': 1};
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object.inAppFlowImage = {'width': 58, 'height': 58, marginStart: PX_8};
object.inAppFlowImageLargeTilted = {'width': 86, 'height': 86, transform: [{rotate: '-4deg'}, {translateY: -11}]};
object.singleAvatarContainer = {'flexDirection': 'row', 'paddingRight': 15, 'justifyContent': 'center',
'alignItems': 'center', 'marginLeft': 5};
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object.selectedRewardRow = {'flexDirection': 'row', 'alignItems': 'center', gap: PX_16};
object.selectedRewardBannerContainer = {'flex': 1, 'flexDirection': 'row', 'alignItems': 'center', 'height': 52};
const object9 = {};
copyDataProperties(object9, StyleSheet.absoluteFillObject, -11);
object9['borderRadius'] = (importDefault(697) /* metro dependency 697: native */).radii.sm;
let PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
object9['top'] = PX_4;
PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
object9['bottom'] = PX_4;
PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
object9['start'] = PX_4;
PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
object9['end'] = PX_4;
PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
object9['marginStart'] = PX_12;
object.selectedRewardBannerGradient = object9;
object.selectedRewardText = {flex: 1};
const object10 = {'position': 'absolute', 'left': 0, 'right': 0, 'top': 0, 'bottom': 0, 'borderRadius': null,
'overflow': 'hidden'};
object10.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
object.nameplateWrapper = object10;
return object;
}
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 = (IconButtonNativeModule).IconButton;
var items3;
var items4;
var TextWithIOSLinkWorkaround;
var format;
var hYoGUM;
var defaultImport5;
const styles = useStyles((UseSafeAreaInsetsKeyboardAwareNative)().insets.bottom);
const env0_1 = (UseNavigationNativeModule).useNavigation();
const value3 = (NativeGiftContextModule).useNativeGiftContext();
const env0_2 = value3.onPurchase;
const isPurchasing = value3.isPurchasing;
const productId = value3.productId;
const allRewards = value3.allRewards;
const claimableRewards = value3.claimableRewards;
const selectedGiftingPromotionReward = value3.selectedGiftingPromotionReward;
const setSelectedGiftingPromotionReward = value3.setSelectedGiftingPromotionReward;
const env0_7 = value3.setCurrentAnalyticsStep;
const useStateFromStores = FluxModule.useStateFromStores;
let items5 = [UserStore];
const currentUser = Reflect.apply(useStateFromStores, FluxModule, [items5, function() {
return UserStore.getCurrentUser();
}]);
const value4 = (IAPUtilsModule).useCanPurchaseIAP(productId);
const value5 = FluxModule.useStateFromStores([PromotionsStore], _fun80969);
const assetVariant = value5?.assetVariant;
const GiftCustomizationBanner_AssetVariant = (Gift_customization_bannerModule).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 = (UseShouldShowGiftingPromotionDeco)();
let r6 = value12 && selectedGiftingPromotionReward == null;
const GiftingBadgeExperiment = (GiftingBadgeExperimentModule).GiftingBadgeExperiment;
const useConfig = GiftingBadgeExperiment.useConfig;
const enabled = Reflect.apply(useConfig, GiftingBadgeExperiment, [{location: 'PremiumGiftPurchaseButton'}]).enabled;
const {nextTier, giftsToNextTier} = FluxModule.useStateFromStoresObject([BadgeDirectoryStore], function() {
var object = {};
var badgeDirectoryStoreBinding = BadgeDirectoryStore;
object.nextTier = badgeDirectoryStoreBinding.getNextTier(require(dependencyMap[27]).BadgeId.GIFTING);
object.giftsToNextTier = badgeDirectoryStoreBinding.getRemainingToNextTier(require(dependencyMap[27]).BadgeId.GIFTING);
return object;
});
allRewards.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;
items5 = [String(BACKGROUND_BRAND)];
String = global.String;
colors = (importDefault(697) /* metro dependency 697: native */).colors;
BACKGROUND_BRAND = colors.BACKGROUND_BRAND;
items5[1] = String(BACKGROUND_BRAND);
r30 = items5;
}
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 = (ButtonNativeModule).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 promotionsStoreBinding = PromotionsStore;
const getMarketingComponentByType = promotionsStoreBinding.getMarketingComponentByType;
const MarketingComponentType = (MarketingComponentTypeModule).MarketingComponentType;
const GIFT_CUSTOMIZATION_BANNER = MarketingComponentType.GIFT_CUSTOMIZATION_BANNER;
value = Reflect.apply(getMarketingComponentByType, promotionsStoreBinding, [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 object;
if (NameplateRecordModule.isNameplateRecord) {
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;
object = {defaultHighlightedReward: r4};
r4 = allRewards ?? [];
object.allRewards = r4;
r4 = claimableRewards ?? [];
object.claimableRewards = r4;
object.onSelect = onSelect_80972;
Reflect.apply(navigate, binding, [REWARD_SELECT, object]);
}
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 = (PremiumGiftModalModule).PremiumGiftScreens;
const CUSTOMIZATION = PremiumGiftScreens.CUSTOMIZATION;
Reflect.apply(navigate, binding, [CUSTOMIZATION]);
}
}
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__;
(ChatInputUtilsModule).dismissKeyboard();
if (env0_10) {
if (NameplateRecordModule.isNameplateRecord) {
navigateToRewardSelection();
} else {
onPurchase(_fun80976);
}
} else {
onPurchase(_fun80976);
}
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 = (PremiumGiftModalModule).PremiumGiftScreens;
const SUCCESS = PremiumGiftScreens.SUCCESS;
Reflect.apply(navigate, binding, [SUCCESS]);
}
}
}
}
global.__d(_fun80964, 10461, [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]) /* metro module 10461, 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] */;