Files
discord-decomp/sources/modules/captcha/native/CaptchaModal.tsx
T
2026-07-28 01:06:53 +03:00

143 lines
8.3 KiB
TypeScript

/* Metro module 15636; source: modules/captcha/native/CaptchaModal.tsx; dependencies: [31, 27, 14304, 14305, 33, 4501, 8973, 1536, 15637, 6275, 4572, 5473, 4573, 1244, 4578, 9486, 15638, 14312, 2] */
import Module01536 from '../../../by-id/module-01536.js'; /* Metro dependency 1536 */
import UseWideAuthView from '../../auth/native/useWideAuthView.tsx'; /* Metro dependency 8973 */
import UseCaptchaModalEffects from '../useCaptchaModalEffects.tsx'; /* Metro dependency 15637 */
import CaptchaUtils from '../../../utils/native/CaptchaUtils.tsx'; /* Metro dependency 15638 */
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 StackNativeModule from '../../../design/components/Stack/native/Stack.native.tsx'; /* Metro dependency 4572 */
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 NativeModule from '../../../design/assets/native.tsx'; /* Metro dependency 5473 */
import * as BottomSheetNativeModule from '../../../design/components/Sheet/native/BottomSheet.native.tsx'; /* Metro dependency 6275 */
import * as SharedCaptchaUtilsModule from '../SharedCaptchaUtils.tsx'; /* Metro dependency 9486 */
import * as RegistrationUIStoreModule from '../../auth/native/RegistrationUIStore.tsx'; /* Metro dependency 14304 */
function _fun119735(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#119735, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15844:6, offset: 0x02517660, size: 269 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = ReactNativeModule;
const env0_4 = value.Keyboard;
const env0_5 = value.View;
value = require(14305) /* metro dependency 14305: RegistrationConstants */;
const env0_7 = value.RegisterTransitionSteps;
const env0_8 = value.RegistrationTransitionActionTypes;
value = require(33) /* metro dependency 33 */;
const env0_9 = value.jsx;
const env0_10 = value.jsxs;
const env0_11 = (require(4501) /* metro dependency 4501: createStyles */).createStyles(function(a0) {
return {contentContainer: {'alignItems': 'center', 'paddingVertical': 8, paddingHorizontal: a0 ? 32 : 8},
description: {'paddingBottom': 12, 'paddingTop': 4}};
});
(FileImportTrackerModule).fileFinishedImporting('modules/captcha/native/CaptchaModal.tsx');
exports.default = CaptchaModal;
function CaptchaModal({onCaptchaVerify, onReject, close, sitekey, captchaService, headerText, bodyText, rqdata, rqtoken, userflow}) { // fn#119737, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15844:527, offset: 0x025177a6, size: 756 bytes, params: 2, frame: 34
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const styles = useStyles((UseWideAuthView)());
const value3 = (Module01536)();
const binding = sitekey;
const useMemo = binding.useMemo;
const env0_9 = (UseCaptchaModalEffects)({onReject: onReject,
analyticsType: Reflect.apply(useMemo, binding, [_fun119738, [value3]])});
binding.useEffect(function() {
Keyboard.dismiss();
}, []);
const BottomSheet = (BottomSheetNativeModule).BottomSheet;
const Stack = (StackNativeModule).Stack;
const DisguiseSpotIllustration = (NativeModule).DisguiseSpotIllustration;
const items2 = [
<DisguiseSpotIllustration scale={0.5} />,
];
const Text = (TextModule).Text;
items2[1] = (
<View>
<Text variant="heading-xl/bold" accessibilityRole="header">
{headerText ?? intl.string((require(1244) /* metro dependency 1244: indexNative */).t.FpoiHe)}
</Text>
<Text
variant="text-md/medium"
color="text-subtle"
style={styles.description}
>
{bodyText ?? intl.string((require(1244) /* metro dependency 1244: indexNative */).t['/CidxO'])}
</Text>
</View>
);
const Button = (ButtonNativeModule).Button;
items2[2] = (
<Button
grow
onPress={onPress_119740}
text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['cY+Oob'])}
/>
);
return (
<BottomSheet startHeight={900} startExpanded>
<Stack style={styles.contentContainer} spacing={12}>
{items2}
</Stack>
</BottomSheet>
);
function _fun119738() { // fn#119738, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15844:718, offset: 0x02517a9a, size: 89 bytes, params: 1, frame: 12
const binding = env0_8;
const getState = binding.getState;
const name = Reflect.apply(getState, binding, []).routes[0]?.name;
const value2 = 'Guild Join Captcha';
return name !== 'auth' ? value2 : doesRegistrationHaveIdentityType() ? 'User Registration Captcha' : value2;
}
function CaptchaModalOnPress() { // fn#119740, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15844:1444, owner: CaptchaModal.onPress, offset: 0x02517b08, size: 139 bytes, params: 1, frame: 18
env0_9();
close();
SharedCaptchaUtilsModule.emitCaptchaDistributionMetric(userflow);
const defaultImport = CaptchaUtils;
let value = defaultImport.showCaptcha(captchaService, sitekey, rqdata);
value = value.then(_fun119741);
value.catch(function(a0) {
if (onReject != null) {
onReject(a0);
}
});
function _fun119741(a0) { // fn#119741, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15844:1533, offset: 0x02517b93, size: 266 bytes, params: 2, frame: 17
var r1;
var value5;
let value = environment.__proto__;
let binding = env1_8;
let getState = binding.getState;
if (Reflect.apply(getState, binding, []).routes[0].name === 'auth' && doesRegistrationHaveIdentityType()) {
value5 = environment.__proto__.__proto__;
(require(14312) /* metro dependency 14312: RegistrationUtils */).trackRegTransition({step: RegisterTransitionSteps.CAPTCHA,
actionType: RegistrationTransitionActionTypes.SUBMITTED});
}
onCaptchaVerify(a0, rqtoken);
binding = env1_8;
getState = binding.getState;
value = Reflect.apply(getState, binding, []).routes[0].name === 'auth';
if (value) {
value = environment.__proto__.__proto__;
value = doesRegistrationHaveIdentityType();
r1 = value;
} else {
r1 = value;
}
if (r1) {
value = environment.__proto__.__proto__;
(require(14312) /* metro dependency 14312: RegistrationUtils */).trackRegTransition({step: RegisterTransitionSteps.CAPTCHA,
actionType: RegistrationTransitionActionTypes.SUCCESS});
}
}
}
}
}
global.__d(_fun119735, 15636, [31, 27, 14304, 14305, 33, 4501, 8973, 1536, 15637, 6275, 4572, 5473, 4573, 1244,
4578, 9486, 15638, 14312,
2]) /* metro module 15636, dependencies: [31, 27, 14304, 14305, 33, 4501, 8973, 1536, 15637, 6275, 4572, 5473, 4573, 1244, 4578, 9486, 15638, 14312, 2] */;