decord/source/components_native/premium/OutboundPromotionClaimAlert.tsx

198 lines
8.8 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 13032
// Function ID: 13033
2026-07-20 16:05:17 +00:00
// Name: OutboundPromotionClaimAlert
2026-08-25 06:04:03 +00:00
// Dependencies: [32, 19, 17, 21, 4380, 712, 13033, 5834, 5854, 7790, 13034, 4376, 1236, 4815, 5862, 13035, 4833, 4094, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-25 06:04:03 +00:00
// Module 13032 (OutboundPromotionClaimAlert)
2026-08-24 06:08:38 +00:00
import ThemesDefault from "Themes" /* 712 */;
import closure_3 from "_slicedToArray" /* 32 */;
import closure_4 from "noop" /* 19 */;
import get_ActivityIndicator from "get ActivityIndicator" /* 17 */;
import jsxProd from "jsxProd" /* 21 */;
2026-08-25 06:04:03 +00:00
import createCacheKey from "createCacheKey" /* 4380 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-08-24 06:08:38 +00:00
({ ActivityIndicator: c5, View: closure_6, Image: error, ScrollView: closure_8 } = get_ActivityIndicator);
2026-07-29 08:29:29 +00:00
({ jsx: c9, jsxs: c10 } = jsxProd);
createCacheKey = { loading: { marginVertical: 80 }, body: { alignItems: "center" }, title: { marginBottom: 8 }, errorTitle: { lineHeight: 24, marginBottom: 8 }, bodyText: { textAlign: "center", lineHeight: 20 }, copyInputContainer: null, copyInputLabel: null, copyInput: null, copyInputCopied: null, copyButton: null, promotionArt: null, errorArt: null };
2026-08-24 06:08:38 +00:00
createCacheKey = { backgroundColor: ThemesDefault.colors.BACKGROUND_SURFACE_HIGH, marginTop: 16, padding: 12, borderRadius: ThemesDefault.radii.sm };
2026-07-29 08:29:29 +00:00
createCacheKey[5] = createCacheKey;
createCacheKey[6] = { lineHeight: 20, marginBottom: 8 };
2026-08-24 06:08:38 +00:00
createCacheKey[7] = { borderWidth: 1, borderColor: ThemesDefault.colors.BACKGROUND_BASE_LOWEST, borderRadius: ThemesDefault.radii.xs, padding: 8, marginBottom: 8, flexDirection: "row", alignItems: "center", justifyContent: "space-between" };
let obj1 = { borderWidth: 1, borderColor: ThemesDefault.colors.BACKGROUND_BASE_LOWEST, borderRadius: ThemesDefault.radii.xs, padding: 8, marginBottom: 8, flexDirection: "row", alignItems: "center", justifyContent: "space-between" };
createCacheKey[8] = { borderColor: ThemesDefault.colors.ICON_FEEDBACK_POSITIVE };
2026-07-29 08:29:29 +00:00
createCacheKey[9] = { paddingHorizontal: 8, marginLeft: 8 };
createCacheKey[10] = { width: 200, height: 100, marginBottom: 20 };
createCacheKey[11] = { width: 141, height: 99, marginBottom: 20 };
2026-08-24 06:08:38 +00:00
let closure_11 = createCacheKey.createStyles(createCacheKey);
let obj2 = { borderColor: ThemesDefault.colors.ICON_FEEDBACK_POSITIVE };
let result = require("set").fileFinishedImporting("components_native/premium/OutboundPromotionClaimAlert.tsx");
2026-07-20 16:05:17 +00:00
export default function OutboundPromotionClaimAlert(onCancel) {
onCancel = onCancel.onCancel;
const onClaim = onCancel.onClaim;
const code = onCancel.code;
const outboundPromotion = onCancel.outboundPromotion;
2026-07-29 08:29:29 +00:00
let React;
c5 = undefined;
2026-08-24 06:08:38 +00:00
closure_6 = undefined;
2026-07-29 08:29:29 +00:00
let analyticsLocations;
2026-08-24 06:08:38 +00:00
const tmp = callback3();
2026-07-29 08:29:29 +00:00
[tmp3, c4] = outboundPromotion(React.useState(null), 2);
2026-07-23 10:11:24 +00:00
const tmp2 = outboundPromotion(React.useState(null), 2);
2026-07-29 08:29:29 +00:00
[tmp7, c5] = outboundPromotion(onClaim(code[6])(false, 2000), 2);
2026-08-24 06:08:38 +00:00
closure_6 = tmp8;
2026-07-29 08:29:29 +00:00
const tmp6 = outboundPromotion(onClaim(code[6])(false, 2000), 2);
analyticsLocations = onClaim(code[7])(onClaim(code[8]).USER_SETTINGS_GIFT_INVENTORY).analyticsLocations;
2026-07-23 10:11:24 +00:00
const items = [null != code, , , , , ];
2026-07-20 16:05:17 +00:00
({ id: arr[1], outboundTitle: arr[2], partnerId: arr[3] } = outboundPromotion);
items[4] = onClaim;
items[5] = analyticsLocations;
const effect = React.useEffect(() => {
2026-08-24 06:08:38 +00:00
if (!closure_6) {
2026-07-20 16:05:17 +00:00
let obj = onCancel(code[9]);
2026-07-29 08:29:29 +00:00
obj = { promotionId: null, promotionTitle: null, partnerId: null, analyticsLocations: null };
({ id: obj2[0], outboundTitle: obj2[1], partnerId: obj2[2] } = outboundPromotion);
obj[3] = analyticsLocations;
2026-07-20 16:05:17 +00:00
const result = obj.claimOutboundPromotion(obj);
2026-07-29 08:29:29 +00:00
result.then((arg0) => callback(arg0)).catch((arg0) => callback2(arg0));
const nextPromise = result.then((arg0) => callback(arg0));
2026-07-20 16:05:17 +00:00
}
}, items);
if (null != code) {
2026-07-29 08:29:29 +00:00
let obj = { style: null, children: null };
obj[0] = tmp.body;
obj = { source: null, style: null };
obj[0] = tmp4(tmp5[10]);
obj[1] = tmp.promotionArt;
2026-07-23 10:11:24 +00:00
const items1 = [callback(analyticsLocations, obj), , , ];
2026-07-29 08:29:29 +00:00
let Text = onCancel;
2026-08-24 06:08:38 +00:00
obj1 = { style: null, variant: "heading-xl/bold", color: "mobile-text-heading-primary", children: null };
2026-07-29 08:29:29 +00:00
obj1[0] = tmp.title;
const intl = onCancel(tmp5[12]).intl;
obj1[3] = intl.string(onCancel(tmp5[12]).t["23BfZh"]);
items1[1] = callback(onCancel(tmp5[11]).Heading, obj1);
let obj2 = { style: null, variant: "text-md/medium", children: null };
obj2[0] = tmp.bodyText;
obj2[2] = outboundPromotion.outboundRedemptionModalBody;
items1[2] = callback(onCancel(tmp5[11]).Text, obj2);
let obj3 = { style: null, children: null };
obj3[0] = tmp.copyInputContainer;
const obj4 = { style: null, variant: "text-md/semibold", color: "mobile-text-heading-primary", children: null };
obj4[0] = tmp.copyInputLabel;
const intl2 = onCancel(tmp5[12]).intl;
obj4[3] = intl2.string(onCancel(tmp5[12]).t.s9LFQh);
const items2 = [callback(onCancel(tmp5[11]).Text, obj4), , ];
2026-07-20 16:05:17 +00:00
const copyInput = tmp.copyInput;
2026-07-29 08:29:29 +00:00
if (tmp7) {
const obj5 = {};
2026-07-20 16:05:17 +00:00
const merged = Object.assign(copyInput);
const merged1 = Object.assign(tmp.copyInputCopied);
2026-07-29 08:29:29 +00:00
let tmp18 = obj5;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
tmp18 = copyInput;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let obj6 = { style: null, children: null };
obj6[0] = tmp18;
const obj7 = { style: null, horizontal: true, showsHorizontalScrollIndicator: false, children: null };
obj7[0] = { flex: 1 };
const obj8 = { onStartShouldSetResponderCapture: null, children: null };
obj8[0] = function onStartShouldSetResponderCapture() {
return true;
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
const obj9 = { lineClamp: 1, variant: "text-sm/medium", color: "interactive-text-active", children: null };
obj9[3] = code;
obj8[1] = callback(Text(tmp5[11]).Text, obj9);
2026-08-24 06:08:38 +00:00
obj7[3] = callback(closure_6, obj8);
2026-07-29 08:29:29 +00:00
const items3 = [callback(closure_8, obj7), ];
let obj10 = { style: null, children: null };
obj10[0] = tmp.copyButton;
const intl3 = Text(tmp5[12]).intl;
2026-07-20 16:05:17 +00:00
const string = intl3.string;
2026-07-29 08:29:29 +00:00
let t = Text(tmp5[12]).t;
if (tmp7) {
let stringResult = string(t.t5VZ88);
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
stringResult = string(t.OpuAlK);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const obj11 = { text: null, size: "sm", onPress: null };
obj11[0] = stringResult;
obj11[2] = function onPress() {
2026-07-20 16:05:17 +00:00
onCancel(code[14]).copy(code);
2026-07-29 08:29:29 +00:00
_undefined(true);
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
t = tmp16(Text(tmp5[13]).Button, obj11);
obj10[1] = t;
obj10 = tmp16(tmp15, obj10);
items3[1] = obj10;
obj6[1] = items3;
2026-08-24 06:08:38 +00:00
items2[1] = callback2(closure_6, obj6);
2026-07-29 08:29:29 +00:00
Text = Text(tmp5[11]).Text;
obj6 = tmp16(Text, { variant: "text-sm/medium", color: "text-muted", children: "This code is included in your confirmation email" });
items2[2] = obj6;
obj3[1] = items2;
obj3 = tmp14(tmp15, obj3);
2026-07-20 16:05:17 +00:00
items1[3] = obj3;
2026-07-29 08:29:29 +00:00
obj[1] = items1;
2026-08-24 06:08:38 +00:00
callback2(closure_6, obj);
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
obj = { style: null };
obj[0] = tmp.loading;
let tmp13 = callback(c5, obj);
const obj12 = { style: null, children: null };
obj12[0] = tmp.body;
const obj13 = { source: null, style: null };
obj13[0] = tmp4(tmp5[15]);
obj13[1] = tmp.errorArt;
const items4 = [callback(analyticsLocations, obj13), , ];
const obj14 = { style: null, variant: "text-lg/bold", color: "mobile-text-heading-primary", children: null };
obj14[0] = tmp.errorTitle;
const intl4 = onCancel(tmp5[12]).intl;
obj14[3] = intl4.string(onCancel(tmp5[12]).t.iufib1);
items4[1] = callback(onCancel(tmp5[11]).Text, obj14);
const obj15 = { style: null, variant: "text-md/medium", children: null };
obj15[0] = tmp.bodyText;
const intl5 = onCancel(tmp5[12]).intl;
obj15[2] = intl5.string(onCancel(tmp5[12]).t.eAn6z2);
items4[2] = callback(onCancel(tmp5[11]).Text, obj15);
obj12[1] = items4;
const obj16 = { onCancel: null, confirmText: null, onConfirm: null, cancelText: null, noDefaultButtons: null, children: null };
obj16[0] = onCancel;
2026-08-24 06:08:38 +00:00
const tmp32 = callback2(closure_6, obj12);
2026-07-29 08:29:29 +00:00
if (null != tmp3) {
const intl7 = tmp31(tmp5[12]).intl;
let stringResult1 = intl7.string(tmp31(tmp5[12]).t.cpT0Cq);
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
const intl6 = tmp31(tmp5[12]).intl;
stringResult1 = intl6.string(tmp31(tmp5[12]).t["+zx47d"]);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj16[1] = stringResult1;
obj16[2] = function onConfirm() {
2026-07-20 16:05:17 +00:00
if (null != code) {
2026-07-29 08:29:29 +00:00
const outboundPromotionRedemptionUrl = onCancel(code[9]).getOutboundPromotionRedemptionUrl(tmp, outboundPromotion);
2026-07-20 16:05:17 +00:00
const obj = onCancel(code[9]);
onClaim(code[17]).openURL(outboundPromotionRedemptionUrl);
const obj2 = onClaim(code[17]);
}
onCancel();
};
let stringResult2;
2026-07-29 08:29:29 +00:00
if (null == tmp3) {
const intl8 = tmp31(tmp5[12]).intl;
stringResult2 = intl8.string(tmp31(tmp5[12]).t.TulDPl);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj16[3] = stringResult2;
let tmp36 = !tmp8;
if (!tmp8) {
tmp36 = null == tmp3;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj16[4] = tmp36;
if (null != tmp3) {
tmp13 = tmp32;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj16[5] = tmp13;
return callback(tmp4(tmp5[16]), obj16);
2026-07-20 16:05:17 +00:00
}
};