decord/source/modules/premium/native/gifting/PremiumGiftPurchaseSuccess.tsx

161 lines
7.1 KiB
TypeScript
Raw Normal View History

2026-08-05 07:35:12 +00:00
// Module ID: 10008
// Function ID: 10009
2026-07-20 16:05:17 +00:00
// Name: PremiumGiftSuccessBody
2026-08-05 07:35:12 +00:00
// Dependencies: [19, 17, 4300, 1876, 676, 21, 4255, 712, 9500, 1480, 9467, 4489, 9921, 8817, 4665, 1236, 3901, 5623, 3955, 9474, 4251, 8557, 4204, 2]
2026-07-20 16:05:17 +00:00
// Exports: PremiumGiftSuccessActions, default
2026-08-05 07:35:12 +00:00
// Module 10008 (PremiumGiftSuccessBody)
2026-07-29 08:29:29 +00:00
import PremiumGiftBackgroundAnimation from "PremiumGiftBackgroundAnimation";
import { View } from "_copy";
import addSku from "addSku";
2026-07-23 10:11:24 +00:00
import { SubscriptionIntervalTypes } from "GuildFeatures";
import { AnalyticsSections } from "ME";
2026-07-29 08:29:29 +00:00
import jsxProd from "TwinButtons";
import createCacheKey from "createCacheKey";
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
let c10;
let c9;
let metroImportAll;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-29 08:29:29 +00:00
({ jsx: metroImportAll, Fragment: c9, jsxs: c10 } = jsxProd);
createCacheKey = { disclaimer: null, title: null, description: null, input: null, inputLabel: null };
createCacheKey = { marginTop: require("Themes").space.PX_4, marginBottom: require("Themes").space.PX_16 };
createCacheKey[0] = createCacheKey;
createCacheKey[1] = { marginTop: require("Themes").space.PX_24, textAlign: "center" };
let obj1 = { marginTop: require("Themes").space.PX_24, textAlign: "center" };
createCacheKey[2] = { marginTop: require("Themes").space.PX_8, textAlign: "center" };
let obj2 = { marginTop: require("Themes").space.PX_8, textAlign: "center" };
createCacheKey[3] = { marginTop: require("Themes").space.PX_24 };
let obj3 = { marginTop: require("Themes").space.PX_24 };
createCacheKey[4] = { marginBottom: require("Themes").space.PX_4 };
createCacheKey = createCacheKey.createStyles(createCacheKey);
let obj4 = { marginBottom: require("Themes").space.PX_4 };
let result = require("addSku").fileFinishedImporting("modules/premium/native/gifting/PremiumGiftPurchaseSuccess.tsx");
2026-07-20 16:05:17 +00:00
export default function PremiumGiftSuccessBody(giftCodeRecord) {
2026-07-29 08:29:29 +00:00
let giftStyle;
2026-07-20 16:05:17 +00:00
let planInterval;
let premiumType;
giftCodeRecord = giftCodeRecord.giftCodeRecord;
2026-07-29 08:29:29 +00:00
let giftCodeURL;
let tmp = createCacheKey();
2026-08-05 07:35:12 +00:00
let obj = giftCodeRecord(9500);
2026-07-20 16:05:17 +00:00
const nativeGiftContext = obj.useNativeGiftContext();
2026-07-29 08:29:29 +00:00
({ giftStyle, premiumType, planInterval } = nativeGiftContext);
2026-08-05 07:35:12 +00:00
let obj1 = giftCodeRecord(4489);
2026-07-29 08:29:29 +00:00
giftCodeURL = obj1.getGiftCodeURL(giftCodeRecord.code);
2026-07-20 16:05:17 +00:00
if (null != giftCodeRecord.giftStyle) {
giftStyle = giftCodeRecord.giftStyle;
}
if (null != giftCodeRecord.subscriptionPlanId) {
let subscriptionPlanId = giftCodeRecord.subscriptionPlanId;
} else {
2026-08-05 07:35:12 +00:00
subscriptionPlanId = tmp2(3901).getPlanIdForPremiumType(premiumType, planInterval);
const tmp2Result = tmp2(3901);
2026-07-20 16:05:17 +00:00
}
2026-08-05 07:35:12 +00:00
let obj3 = giftCodeURL(3901);
2026-07-20 16:05:17 +00:00
const tierDisplayNameByPlanId = obj3.getTierDisplayNameByPlanId(subscriptionPlanId);
2026-08-05 07:35:12 +00:00
let obj4 = giftCodeURL(3901);
2026-07-20 16:05:17 +00:00
const items = [giftCodeRecord, giftCodeURL];
2026-07-29 08:29:29 +00:00
obj = { children: null };
2026-07-20 16:05:17 +00:00
const callback = React.useCallback(() => {
2026-07-23 10:11:24 +00:00
const value = outer1_5.get(giftCodeRecord.skuId);
2026-07-20 16:05:17 +00:00
if (null != value) {
2026-07-29 08:29:29 +00:00
giftCodeRecord(outer1_2[11]).trackGiftCodeCopy(tmp, value);
2026-07-23 10:11:24 +00:00
const obj = giftCodeRecord(outer1_2[11]);
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
giftCodeRecord(outer1_2[17]).copy(giftCodeURL);
const obj2 = giftCodeRecord(outer1_2[17]);
2026-07-29 08:29:29 +00:00
tmp = giftCodeRecord;
2026-07-23 10:11:24 +00:00
const result = giftCodeRecord(outer1_2[18]).presentCopiedToClipboard();
2026-07-20 16:05:17 +00:00
}, items);
2026-08-05 07:35:12 +00:00
obj[0] = callback(giftCodeURL(9474), { giftStyle });
2026-07-20 16:05:17 +00:00
const items1 = [callback(View, obj), , , , ];
2026-07-29 08:29:29 +00:00
obj = { style: tmp.title, variant: "heading-lg/bold", children: null };
const intl = tmp2(1236).intl;
obj[2] = intl.string(giftCodeRecord(1236).t["/s1xR7"]);
2026-08-05 07:35:12 +00:00
items1[1] = callback(giftCodeRecord(4251).Text, obj);
2026-07-29 08:29:29 +00:00
obj1 = { style: tmp.description, variant: "text-md/medium", children: null };
const intl2 = tmp2(1236).intl;
2026-07-20 16:05:17 +00:00
if (obj4.getInterval(subscriptionPlanId).intervalType === SubscriptionIntervalTypes.YEAR) {
2026-07-29 08:29:29 +00:00
let bUdTqI = tmp2(1236).t.rli5ey;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
bUdTqI = tmp2(1236).t.bUdTqI;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let obj2 = { children: null };
obj1[2] = intl2.format(bUdTqI, { intervalCount: 1, name: tierDisplayNameByPlanId });
2026-08-05 07:35:12 +00:00
items1[2] = callback(giftCodeRecord(4251).Text, obj1);
2026-07-29 08:29:29 +00:00
obj3 = { style: tmp.input, children: null };
obj4 = { style: tmp.inputLabel, variant: "heading-md/bold", children: null };
const intl3 = tmp2(1236).intl;
obj4[2] = intl3.string(giftCodeRecord(1236).t["qS+yMo"]);
2026-08-05 07:35:12 +00:00
const items2 = [callback(giftCodeRecord(4251).Text, obj4), ];
2026-07-29 08:29:29 +00:00
const obj5 = { text: giftCodeURL, icon: null, iconPosition: "end", onPress: null };
2026-08-05 07:35:12 +00:00
obj5[1] = giftCodeURL(4204);
2026-07-29 08:29:29 +00:00
obj5[3] = callback;
2026-08-05 07:35:12 +00:00
items2[1] = callback(giftCodeRecord(8557).InputButton, obj5);
2026-07-29 08:29:29 +00:00
obj3[1] = items2;
items1[3] = closure_10(View, obj3);
const obj6 = { style: tmp.disclaimer, variant: "text-xs/normal", children: null };
const intl4 = tmp2(1236).intl;
obj6[2] = intl4.string(giftCodeRecord(1236).t.As9eLl);
2026-08-05 07:35:12 +00:00
items1[4] = callback(giftCodeRecord(4251).Text, obj6);
2026-07-29 08:29:29 +00:00
obj2[0] = items1;
return closure_10(closure_9, obj2);
2026-07-20 16:05:17 +00:00
};
export const PremiumGiftSuccessActions = function PremiumGiftSuccessActions(giftCodeRecord) {
2026-07-29 08:29:29 +00:00
let onClose;
let prePurchaseGiftingBadgeProgress;
let navigation;
let enabled;
let giftCodeURL;
2026-07-23 10:11:24 +00:00
let obj = onClose(navigation[8]);
2026-07-20 16:05:17 +00:00
const nativeGiftContext = obj.useNativeGiftContext();
2026-07-23 10:11:24 +00:00
onClose = nativeGiftContext.onClose;
2026-07-29 08:29:29 +00:00
prePurchaseGiftingBadgeProgress = nativeGiftContext.prePurchaseGiftingBadgeProgress;
2026-07-23 10:11:24 +00:00
let obj1 = onClose(navigation[9]);
navigation = obj1.useNavigation();
const GiftingBadgeExperiment = onClose(navigation[10]).GiftingBadgeExperiment;
2026-07-29 08:29:29 +00:00
enabled = GiftingBadgeExperiment.useConfig({ location: "PremiumGiftSuccessActions" }).enabled;
giftCodeURL = onClose(navigation[11]).getGiftCodeURL(giftCodeRecord.giftCodeRecord.code);
2026-07-20 16:05:17 +00:00
const items = [enabled, prePurchaseGiftingBadgeProgress, navigation, onClose];
const items1 = [giftCodeURL, enabled, prePurchaseGiftingBadgeProgress, navigation];
2026-07-23 10:11:24 +00:00
const callback = enabled.useCallback(() => {
2026-07-20 16:05:17 +00:00
if (enabled) {
if (null != prePurchaseGiftingBadgeProgress) {
2026-07-29 08:29:29 +00:00
const obj = { currentProgress: null };
obj[0] = tmp;
2026-07-20 16:05:17 +00:00
navigation.navigate(onClose(navigation[12]).PremiumGiftScreens.GIFTING_BADGE, obj);
}
}
onClose();
}, items);
2026-07-29 08:29:29 +00:00
obj = { children: null };
2026-07-23 10:11:24 +00:00
const callback1 = enabled.useCallback(() => {
2026-07-20 16:05:17 +00:00
let obj = onClose(navigation[13]);
obj = { url: giftCodeURL };
2026-07-23 10:11:24 +00:00
obj.showShareActionSheet(obj, outer1_7.PREMIUM_GIFT_SUCCESS_MODAL);
2026-07-29 08:29:29 +00:00
let tmp4 = enabled;
2026-07-20 16:05:17 +00:00
if (enabled) {
2026-07-29 08:29:29 +00:00
tmp4 = null != prePurchaseGiftingBadgeProgress;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp4) {
obj = { currentProgress: null };
obj[0] = prePurchaseGiftingBadgeProgress;
2026-07-20 16:05:17 +00:00
navigation.navigate(onClose(navigation[12]).PremiumGiftScreens.GIFTING_BADGE, obj);
}
}, items1);
2026-07-29 08:29:29 +00:00
obj = { variant: "primary", text: null, onPress: null };
2026-07-23 10:11:24 +00:00
const intl = onClose(navigation[15]).intl;
2026-07-29 08:29:29 +00:00
obj[1] = intl.string(onClose(navigation[15]).t.RDE0Sc);
obj[2] = callback1;
2026-07-23 10:11:24 +00:00
const items2 = [callback(onClose(navigation[14]).Button, obj), ];
2026-07-29 08:29:29 +00:00
obj1 = { variant: "secondary", text: null, onPress: null };
2026-07-23 10:11:24 +00:00
const intl2 = onClose(navigation[15]).intl;
2026-07-29 08:29:29 +00:00
obj1[1] = intl2.string(onClose(navigation[15]).t.cpT0Cq);
obj1[2] = callback;
2026-07-23 10:11:24 +00:00
items2[1] = callback(onClose(navigation[14]).Button, obj1);
2026-07-29 08:29:29 +00:00
obj[0] = items2;
2026-07-20 16:05:17 +00:00
return callback2(closure_9, obj);
};