Files
discord-decomp/sources/modules/checkout/native/gifting/UnifiedGiftModalDetailsScreen.tsx
T
2026-07-27 16:20:00 +03:00

162 lines
9.9 KiB
TypeScript

/* Metro module 7639; source: modules/checkout/native/gifting/UnifiedGiftModalDetailsScreen.tsx; dependencies: [57, 31, 27, 661, 33, 4501, 697, 1484, 7638, 6771, 6518, 491, 683, 7640, 7641, 4573, 1244, 7678, 7679, 7680, 2] */
function _fun61166(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#61166, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7817:6, offset: 0x0171c792, size: 421 bytes, params: 8, frame: 23
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 value2 = require(27) /* metro dependency 27 */;
const env0_5 = value2.ScrollView;
const env0_6 = value2.View;
const env0_7 = (require(661) /* metro dependency 661: Constants */).AnalyticEvents;
const value3 = require(33) /* metro dependency 33 */;
const env0_8 = value3.jsx;
const env0_9 = value3.jsxs;
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = createStylesModule.createStyles;
object2 = {};
const PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
object2.container = {'flex': 1, 'paddingTop': null, 'alignItems': 'stretch', paddingTop: PX_12};
let PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
object2.scrollView = {paddingBottom: PX_24};
const object3 = {};
PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
object3.marginTop = PX_24;
const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object3.marginBottom = PX_8;
const PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object3.paddingHorizontal = PX_16;
object3.textTransform = 'capitalize';
object2.sectionHeader = object3;
const env0_10 = Reflect.apply(createStyles, createStylesModule, [object2]);
value = value.memo(_fun61167);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/checkout/native/gifting/UnifiedGiftModalDetailsScreen.tsx');
exports.default = value;
}
function _fun61167({skuId, applicationId, recipientUser, setRecipientUser, lockedRecipient, validateRecipient, renderProductDetails, renderPurchaseSection}) { // fn#61167, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7817:499, offset: 0x0171c937, size: 1086 bytes, params: 2, frame: 43
const env0_3 = validateRecipient;
const styles = useStyles();
const value2 = (require(1484) /* metro dependency 1484: useNavigationNative */).useNavigation();
const binding = value2;
let useState = binding.useState;
const value3 = Reflect.apply(useState, binding, [true]);
const binding2 = env0_3;
const value4 = binding2(value3, 2);
const property = value4[0];
const env0_5 = value4[1];
useState = binding.useState;
const value5 = binding2(Reflect.apply(useState, binding, [false]), 2);
const property2 = value5[0];
const env0_6 = value5[1];
const value6 = binding.useCallback(_fun61168, [value2]);
const value8 = binding.useMemo(_fun61170,
[(importDefault(6771) /* metro dependency 6771: useAnalyticsLocations */)().analyticsLocations, skuId,
applicationId, (importDefault(6518) /* metro dependency 6518: useInitialValue */)(_fun61169)]);
binding.useEffect(_fun61171, [recipientUser, skuId, validateRecipient]);
binding.useEffect(_fun61174, [value8]);
const value9 = (require(7640) /* metro dependency 7640: useGiftStyles */).useGiftStyles();
useState = binding.useState;
const value10 = binding2(Reflect.apply(useState, binding, [value9[0]]), 2);
const property3 = value10[0];
const property4 = value10[1];
const value11 = binding.useRef(null);
useState = binding.useState;
const value12 = binding2(Reflect.apply(useState, binding, [0]), 2);
const property5 = value12[0];
const property6 = value12[1];
useState = binding.useState;
const value13 = binding2(Reflect.apply(useState, binding, [undefined]), 2);
const property7 = value13[0];
const property8 = value13[1];
const value14 = binding.useCallback(function() {
global.setTimeout(_fun61176, 100);
}, [property5]);
const value15 = binding.useMemo(_fun61177, [property3, recipientUser, property7]);
const GiftBackgroundSelect = (require(7641) /* metro dependency 7641: PremiumGiftBackgroundSelect */).GiftBackgroundSelect;
const items3 = [<GiftBackgroundSelect giftStyle={property3} setGiftStyle={property4} withConsistentHeight={false} />];
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
let sectionHeader = styles.sectionHeader;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
items3[1] = <Text variant="text-sm/semibold" style={sectionHeader}>{Reflect.apply(string, intl,
[(require(1244) /* metro dependency 1244: indexNative */).t.xFn72s])}</Text>;
items3[2] = lockedRecipient && recipientUser != null ? ((Component) => <Component user={recipientUser} />)(importDefault(7678) /* metro dependency 7678: LockedRecipientField */) : ((Component) => <Component selectedUser={recipientUser} onPress={value6} setSelectedUser={setRecipientUser} />)(importDefault(7679) /* metro dependency 7679: SelectedUserField */);
sectionHeader = styles.sectionHeader;
string = intl.string;
const PpoJzt = (require(1244) /* metro dependency 1244: indexNative */).t.PpoJzt;
items3[3] = <Text variant="text-sm/semibold" style={sectionHeader}>{Reflect.apply(string, intl, [PpoJzt])}</Text>;
items3[4] = renderProductDetails({recipientUser: recipientUser, isValidRecipient: property});
const GiftCustomMessage = (require(7680) /* metro dependency 7680: PremiumGiftCustomMessage */).GiftCustomMessage;
items3[5] = <GiftCustomMessage onFocusMessage={value14} setMessagePosition={property6} customGiftMessage={property7} setCustomGiftMessage={property8} />;
const items2 = [<ScrollView ref={value11} contentContainerStyle={styles.scrollView} showsVerticalScrollIndicator={false}>{items3}</ScrollView>];
let r9 = recipientUser == null || property2;
r9 = !r9 ? !property : r9;
items2[1] = renderPurchaseSection({isPurchaseDisabled: r9, giftOptions: value15, baseAnalyticsFields: value8});
return (
<View style={styles.container}>
{items2}
</View>
);
}
function _fun61168() { // fn#61168, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7817:788, offset: 0x0171cd75, size: 57 bytes, params: 1, frame: 13
const binding = env0_4;
const navigate = binding.navigate;
const UnifiedGiftModalScreens = (require(7638) /* metro dependency 7638: UnifiedGiftModalTypes */).UnifiedGiftModalScreens;
const RECIPENT_SELECT = UnifiedGiftModalScreens.RECIPENT_SELECT;
Reflect.apply(navigate, binding, [RECIPENT_SELECT]);
}
function _fun61169() { // fn#61169, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7817:903, offset: 0x0171cdae, size: 37 bytes, params: 1, frame: 11
const value = environment.__proto__;
return (require(491) /* metro dependency 491 */).v4();
}
function _fun61170() { // fn#61170, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7817:936, offset: 0x0171cdd3, size: 56 bytes, params: 1, frame: 3
return {'is_gift': true, 'location_stack': null, 'payment_type': 'sku', location_stack: analyticsLocations,
sku_id: skuId, application_id: applicationId, load_id: env0_8};
}
function _fun61171() { // fn#61171, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7817:1052, offset: 0x0171ce0b, size: 88 bytes, params: 1, frame: 14
var value;
env0_5(true);
if (recipientUser != null) {
env0_6(true);
value = validateRecipient(recipientUser.id);
value = value.then(_fun61172);
value.finally(_fun61173);
}
}
function _fun61174() { // fn#61174, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7817:1153, offset: 0x0171ce75, size: 108 bytes, params: 1, frame: 18
let value = environment.__proto__;
const defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
let track = defaultImport.track;
const PAYMENT_FLOW_STARTED = AnalyticEvents.PAYMENT_FLOW_STARTED;
const binding = env0_9;
Reflect.apply(track, defaultImport, [PAYMENT_FLOW_STARTED, binding]);
value = defaultImport;
track = value.track;
const PAYMENT_FLOW_LOADED = AnalyticEvents.PAYMENT_FLOW_LOADED;
const object2 = {};
copyDataProperties(object2, binding, defaultImport);
object2['initial_step'] = 'gift_customization';
Reflect.apply(track, value, [PAYMENT_FLOW_LOADED, object2]);
}
function _fun61175() { // fn#61175, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7817:1475, offset: 0x0171cee1, size: 28 bytes, params: 1, frame: 13
global.setTimeout(_fun61176, 100);
}
function _fun61177() { // fn#61177, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7817:1594, offset: 0x0171cf32, size: 54 bytes, params: 1, frame: 4
return {gift_style: env0_10, recipient_id: recipientUser?.id, custom_message: env0_13};
}
function _fun61176() { // fn#61176, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7817:1492, offset: 0x0171cefd, size: 53 bytes, params: 1, frame: 13
const value = environment.__proto__;
return env1_11.current?.scrollTo({y: env1_12, animated: true});
}