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

163 lines
9.3 KiB
TypeScript

/* Metro module 5265; source: modules/age_assurance/native/AgeVerificationModal.tsx; dependencies: [31, 5262, 33, 5266, 4007, 4813, 5269, 4501, 697, 5080, 5277, 1244, 5280, 2] */
import Native from '../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
import ModalActionCreators from '../../../actions/ModalActionCreators.tsx'; /* Metro dependency 5080 */
import Module05269 from '../../../by-id/module-05269.js'; /* Metro dependency 5269 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as JsxRuntimeModule from '../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
import * as NavigationRouteUtilsNativeModule from '../../main_tabs_v2/helpers/NavigationRouteUtils.native.tsx'; /* Metro dependency 4007 */
import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
import * as AgeVerificationUtilsModule from '../AgeVerificationUtils.tsx'; /* Metro dependency 4813 */
import * as AgeVerificationConstantsModule from '../AgeVerificationConstants.tsx'; /* Metro dependency 5262 */
import * as SafetyHubUtilsModule from '../../safety_hub/SafetyHubUtils.tsx'; /* Metro dependency 5266 */
import * as HeaderActionButtonNativeModule from '../../../design/components/Navigator/native/HeaderActionButton.native.tsx'; /* Metro dependency 5277 */
import * as NavigatorNativeModule from '../../../design/components/Navigator/native/Navigator.native.tsx'; /* Metro dependency 5280 */
function _fun46822(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#46822, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5443:6, offset: 0x011afb0a, size: 258 bytes, params: 8, frame: 21
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
object = {VERIFY_AGE: 'VERIFY_AGE'};
const createStyles = CreateStylesModule.createStyles;
const BACKGROUND_BASE_LOWER = (Native).colors.BACKGROUND_BASE_LOWER;
const env0_8 = Reflect.apply(createStyles, CreateStylesModule,
[{headerStyle: {backgroundColor: BACKGROUND_BASE_LOWER}}]);
(FileImportTrackerModule).fileFinishedImporting('modules/age_assurance/native/AgeVerificationModal.tsx');
exports.default = AgeVerificationModal;
function getScreens({headerStyle}, a1, a2, a3, a4) { // fn#46823, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5443:1022, offset: 0x011afc0c, size: 98 bytes, params: 6, frame: 5
const env0_0 = a1;
const env0_1 = a2;
const env0_2 = a3;
const VERIFY_AGE = env0_6.VERIFY_AGE;
return {[VERIFY_AGE]: {headerStyle: headerStyle, headerTitle: a4, headerLeft: headerLeft, render: render_46826}};
function handleClose() { // fn#46824, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5443:1069, owner: getScreens.handleClose, offset: 0x011afc6e, size: 48 bytes, params: 1, frame: 12
importAll();
const value = environment.__proto__;
(ModalActionCreators).pop();
}
function headerLeft() { // fn#46825, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5443:1167, owner: getScreens.headerLeft, offset: 0x011afc9e, size: 107 bytes, params: 1, frame: 18
const HeaderActionButton = (HeaderActionButtonNativeModule).HeaderActionButton;
const handleCloseBinding = handleClose;
const intl = (IndexNativeModule).intl;
return (
<HeaderActionButton
onPress={handleCloseBinding}
text={intl.string((IndexNativeModule).t.cpT0Cq)}
/>
);
}
function getScreensRender() { // fn#46826, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5443:1276, owner: getScreens.render, offset: 0x011afd09, size: 53 bytes, params: 1, frame: 14
return (
<AgeVerifyScreen
webviewUrl={require}
onComplete={importDefault}
onClose={handleClose}
/>
);
}
}
function AgeVerifyScreen({webviewUrl, onComplete, onClose}) { // fn#46827, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5443:232, offset: 0x011afd3e, size: 241 bytes, params: 2, frame: 21
const value2 = (SafetyHubUtilsModule).useIsSuspendedUser();
let useCallback = ReactModule.useCallback;
const value3 = Reflect.apply(useCallback, ReactModule, [function() {
onComplete();
onClose();
}, [onComplete, onClose]]);
useCallback = ReactModule.useCallback;
(AgeVerificationUtilsModule).useWatchAgeVerificationStatusChange(Reflect.apply(useCallback,
ReactModule, [_fun46829, [value3]]));
return ((Component) => <Component allowsInlineMediaPlayback javaScriptEnabled source={{uri: webviewUrl}} onMessage={ReactModule.useCallback(_fun46830,
[value3,
value2])} injectedJavaScript={"\n window.addEventListener('message', function(event) {\n window.ReactNativeWebView.postMessage(event.data);\n }, true);\n"} />)(Module05269);
function _fun46829() { // fn#46829, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5443:365, offset: 0x011afe2f, size: 56 bytes, params: 1, frame: 12
if (NavigationRouteUtilsNativeModule.isModalOpen(AGE_VERIFICATION_MODAL_KEY)) {
ReactModule();
}
}
function _fun46830(a0) { // fn#46830, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5443:473, offset: 0x011afe67, size: 162 bytes, params: 2, frame: 15
var r1;
var eventType;
var r2;
var value2;
var JSON;
var parse;
var value3;
var value4;
var binding;
var value5;
var value6;
var error;
const value = undefined;
let nativeEvent = a0.nativeEvent;
let data = nativeEvent.data;
if (data != null) {
try {
nativeEvent = a0.nativeEvent;
data = nativeEvent.data;
value2 = typeof data === 'string';
if (value2) {
JSON = global.JSON;
parse = JSON.parse;
nativeEvent = a0.nativeEvent;
data = nativeEvent.data;
value3 = Reflect.apply(parse, JSON, [data]);
r1 = value3;
} else {
nativeEvent = a0.nativeEvent;
data = nativeEvent.data;
r1 = data;
}
value4 = environment;
binding = env0_2;
if (binding) {
value5 = r1 == null;
eventType = value5 ? value : r1.eventType;
value6 = eventType === 'Verification.Result';
r2 = value6;
} else {
r2 = binding;
}
if (r2) {
binding = ReactModule;
binding();
}
} catch (error) {
}
}
return value;
}
}
function AgeVerificationModal({webviewUrl, onComplete, onClose}) { // fn#46831, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5443:1448, offset: 0x011aff09, size: 258 bytes, params: 2, frame: 23
const styles = useStyles();
const styles2 = styles;
const intl = (IndexNativeModule).intl;
const value3 = styles2.useMemo(_fun46832, [styles, webviewUrl, onComplete, onClose,
intl.string((IndexNativeModule).t.wJVyYR)]);
const Navigator = (NavigatorNativeModule).Navigator;
const VERIFY_AGE = env0_6.VERIFY_AGE;
return (
<Navigator
screens={value3}
initialRouteName={VERIFY_AGE}
headerBackTitle={intl.string((IndexNativeModule).t['13/7kX'])}
/>
);
function _fun46832() { // fn#46832, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5443:1582, offset: 0x011b000b, size: 38 bytes, params: 1, frame: 19
return getScreens(styles, webviewUrl, onComplete, onClose, AgeVerificationConstantsModule.AGE_VERIFICATION_MODAL_KEY);
}
}
}
global.__d(_fun46822, 5265, [31, 5262, 33, 5266, 4007, 4813, 5269, 4501, 697, 5080, 5277, 1244, 5280,
2]) /* metro module 5265, dependencies: [31, 5262, 33, 5266, 4007, 4813, 5269, 4501, 697, 5080, 5277, 1244, 5280, 2] */;