233 lines
15 KiB
TypeScript
233 lines
15 KiB
TypeScript
/* Metro module 9280; source: modules/rtc/native/SecureFramesUserVerificationModal.tsx; dependencies: [57, 31, 27, 1379, 1878, 9277, 661, 1309, 33, 4501, 697, 566, 4617, 9281, 9282, 9256, 9283, 9275, 5080, 3857, 4073, 1244, 4248, 9284, 9212, 6771, 8743, 9285, 1305, 6618, 5278, 5284, 4573, 4572, 9286, 9288, 4578, 2] */
|
|
function _fun72582(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#72582, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9466:6, offset: 0x01d4a679, size: 499 bytes, params: 8, frame: 22
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(57) /* metro dependency 57 */;
|
|
const env0_4 = importAll(31) /* metro dependency 31 */;
|
|
let value = require(27) /* metro dependency 27 */;
|
|
const env0_5 = value.ActivityIndicator;
|
|
const env0_6 = value.View;
|
|
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
|
|
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
|
|
value = require(9277) /* metro dependency 9277: SecureFramesConstants */;
|
|
const env0_9 = value.USER_VERIFICATION_CHUNK_SIZE;
|
|
const env0_10 = value.USER_VERIFICATION_LENGTH;
|
|
const env0_11 = value.USER_VERIFICATION_NUM_COLUMNS;
|
|
const env0_12 = value.USER_VERIFIED_TOAST_KEY;
|
|
value = require(661) /* metro dependency 661: Constants */;
|
|
const env0_13 = value.AnalyticsLocations;
|
|
const env0_14 = value.AnalyticsSections;
|
|
const env0_15 = (require(1309) /* metro dependency 1309: FormConstants */).ANDROID_FOREGROUND_RIPPLE;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_16 = value.jsx;
|
|
const env0_17 = value.jsxs;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
const BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
|
|
const env0_18 = Reflect.apply(createStyles, value, [{container: {'flex': 1, 'padding': 16,
|
|
'flexDirection': 'column', backgroundColor: BACKGROUND_BASE_LOW}, footer: {'flex': 1, 'gap': 16,
|
|
'justifyContent': 'flex-end'}, footerText: {textAlign: 'center'}, header: {'height': 56, 'flexDirection': 'row',
|
|
'alignItems': 'center', 'justifyContent': 'space-between'}, subtitle: {textAlign: 'center'},
|
|
code: {marginTop: 24}, helpMessage: {marginBottom: 16}}]);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rtc/native/SecureFramesUserVerificationModal.tsx');
|
|
exports.default = SecureFramesUserVerificationModal;
|
|
}
|
|
|
|
function SecureFramesUserVerificationModal({userId, channelId}) { // fn#72583, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9466:912, offset: 0x01d4a86c, size: 1954 bytes, params: 2, frame: 44
|
|
var object3;
|
|
var object2;
|
|
var RDE0Sc;
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
const styles = useStyles();
|
|
const user = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
|
|
return UserStore.getUser(userId);
|
|
});
|
|
const value3 = (importDefault(4617) /* metro dependency 4617: NicknameUtils */).useName((require(566) /* metro dependency 566: flux */).useStateFromStores([ChannelStore],
|
|
_fun72585), null, user);
|
|
const value4 = (require(9281) /* metro dependency 9281: useSecureFramesPairwiseFingerprint */).useSecureFramesPairwiseFingerprint({userId: userId});
|
|
const fingerprint = value4.fingerprint;
|
|
const env0_3 = fingerprint;
|
|
const userKey = value4.userKey;
|
|
const env0_4 = userKey;
|
|
const value5 = (require(9282) /* metro dependency 9282: useReadableSecureFramesFingerprint */).useReadableSecureFramesFingerprint({fingerprintBase64: fingerprint,
|
|
chunkSize: USER_VERIFICATION_CHUNK_SIZE, desiredLength: USER_VERIFICATION_LENGTH});
|
|
const value6 = (require(9256) /* metro dependency 9256: useIsSecureFramesVerified */).useIsUserSecureFramesVerified({userId: userId,
|
|
channelId: channelId});
|
|
const {isCurrentUserKeyPersistent, isOtherUserKeyPersistent,
|
|
loading} = (require(9283) /* metro dependency 9283: useIsPersistentSecureFramesFingerprint */).useIsPersistentSecureFramesFingerprint({userId: userId});
|
|
const binding = env0_4;
|
|
const value8 = binding.useCallback(_fun72586, [channelId, userKey, isOtherUserKeyPersistent, value3, userId]);
|
|
const value9 = binding.useCallback(_fun72587, [userKey, isOtherUserKeyPersistent, userId]);
|
|
const secureFramesDeeplinkExperimentModule = require(4248) /* metro dependency 4248: SecureFramesDeeplinkExperiment */;
|
|
const useSecureFramesDeeplinkExperiment = secureFramesDeeplinkExperimentModule.useSecureFramesDeeplinkExperiment;
|
|
const value10 = binding.useCallback(_fun72588, [channelId, value5, fingerprint,
|
|
Reflect.apply(useSecureFramesDeeplinkExperiment, secureFramesDeeplinkExperimentModule,
|
|
[{location: 'SecureFramesUserVerificationModal'}]).enabled, userId]);
|
|
const value11 = binding.useCallback(_fun72589,
|
|
[(importDefault(6771) /* metro dependency 6771: useAnalyticsLocations */)().analyticsLocations, channelId,
|
|
userId]);
|
|
const useIsSecureFramesKeyInconsistentModule = require(9285) /* metro dependency 9285: useIsSecureFramesKeyInconsistent */;
|
|
const useAlertIfSecureFramesKeyInconsistent = useIsSecureFramesKeyInconsistentModule.useAlertIfSecureFramesKeyInconsistent;
|
|
object3 = {channelId: channelId, userId: userId, nickname: value3};
|
|
object3.onAlertOpen = (importDefault(5080) /* metro dependency 5080: ModalActionCreators */).pop;
|
|
Reflect.apply(useAlertIfSecureFramesKeyInconsistent, useIsSecureFramesKeyInconsistentModule, [object3]);
|
|
const useMemo = binding.useMemo;
|
|
const value13 = env0_3(Reflect.apply(useMemo, binding, [_fun72590, [value6]]), 2);
|
|
const property = value13[0];
|
|
const property2 = value13[1];
|
|
const value14 = binding.useMemo(_fun72591, [isCurrentUserKeyPersistent, isOtherUserKeyPersistent, value3]);
|
|
binding.useEffect(_fun72592, [channelId, userId]);
|
|
const SafeAreaPaddingView = (require(6618) /* metro dependency 6618: SafeAreaView */).SafeAreaPaddingView;
|
|
const PressableOpacity = (require(5278) /* metro dependency 5278: Pressables */).PressableOpacity;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
let string = intl.string;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
const cpT0Cq = t.cpT0Cq;
|
|
const ArrowLargeLeftIcon = (require(5284) /* metro dependency 5284: ArrowLargeLeftIcon */).ArrowLargeLeftIcon;
|
|
const pressableOpacity = <PressableOpacity accessibilityRole="button" accessibilityLabel={Reflect.apply(string,
|
|
intl,
|
|
[cpT0Cq])} androidRippleConfig={ANDROID_FOREGROUND_RIPPLE} hitSlop={8} onPress={value11}><ArrowLargeLeftIcon size="md" /></PressableOpacity>;
|
|
let r7 = fingerprint != null && value5 != null;
|
|
if (r7) {
|
|
object2 = {accessibilityRole: 'button'};
|
|
string = intl.string;
|
|
RDE0Sc = t.RDE0Sc;
|
|
object2.accessibilityLabel = Reflect.apply(string, intl, [RDE0Sc]);
|
|
object2.androidRippleConfig = ANDROID_FOREGROUND_RIPPLE;
|
|
object2.hitSlop = 8;
|
|
object2.onPress = value10;
|
|
string = intl.string;
|
|
RDE0Sc = t.RDE0Sc;
|
|
r7 = <PressableOpacity {...object2}><Text variant="text-md/semibold" color="text-brand">{Reflect.apply(string,
|
|
intl,
|
|
[RDE0Sc])}</Text></PressableOpacity>;
|
|
}
|
|
const items2 = [<View style={styles.header}>{pressableOpacity}{r7}</View>];
|
|
const Stack = (require(4572) /* metro dependency 4572: StackNative */).Stack;
|
|
items2[1] = <Stack spacing={8} justify="center" align="center" direction="vertical"><Text variant="heading-xl/bold" color="mobile-text-heading-primary">{intl.string((require(1244) /* metro dependency 1244: indexNative */).t['/WPGnF'])}</Text><Text style={styles.subtitle} variant="text-md/medium" color="text-default">{intl.format((require(1244) /* metro dependency 1244: indexNative */).t.oc2kce,
|
|
{username: value3})}</Text></Stack>;
|
|
items2[2] = <View style={styles.code}>{((Component) => <Component style={styles.helpMessage} userId={userId} userKey={userKey} />)(importDefault(9286) /* metro dependency 9286: SecureFramesExistingVerificationsHelpMessage */)}{((Component) => <Component title={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['/WPGnF'])} chunks={value5} columns={USER_VERIFICATION_NUM_COLUMNS} trailing={value5 == null ? <ActivityIndicator /> : ((TextBadge) => <TextBadge color={property2} text={property} />)((require(1305) /* metro dependency 1305: native */).TextBadge)} />)(importDefault(9288) /* metro dependency 9288: SecureFramesCode */)}</View>;
|
|
const text = <Text style={styles.footerText} variant="text-xs/normal" color="text-default">{value14}</Text>;
|
|
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
|
|
const r16 = value5 == null || loading;
|
|
const r14 = value6 ? value9 : value8;
|
|
string = intl.string;
|
|
items2[3] = <View style={styles.footer}>{text}<Button disabled={r16} variant="primary" onPress={r14} text={value6 ? Reflect.apply(string,
|
|
intl, [t['Osb+/n']]) : Reflect.apply(string, intl, [t['0tvNAn']])} /></View>;
|
|
return (
|
|
<SafeAreaPaddingView
|
|
top
|
|
bottom
|
|
style={styles.container}
|
|
>
|
|
{items2}
|
|
</SafeAreaPaddingView>
|
|
);
|
|
}
|
|
|
|
function _fun72585() { // fn#72585, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9466:1078, offset: 0x01d4b00e, size: 47 bytes, params: 1, frame: 11
|
|
var r0;
|
|
let value = environment.__proto__;
|
|
value = ChannelStore.getChannel(channelId);
|
|
if (value == null) {
|
|
r0 = undefined;
|
|
} else {
|
|
value = value.getGuildId();
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun72586() { // fn#72586, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9466:1575, offset: 0x01d4b03d, size: 239 bytes, params: 1, frame: 24
|
|
var value2;
|
|
var moduleValue;
|
|
var defaultImport2;
|
|
var open;
|
|
var object2;
|
|
var intl;
|
|
if (userKey != null) {
|
|
value2 = environment.__proto__;
|
|
moduleValue = require(9275) /* metro dependency 9275: SecureFramesUtils */;
|
|
moduleValue.addVerification(userId, userKey, isOtherUserKeyPersistent, channelId,
|
|
AnalyticsLocations.E2EE_USER_VERIFY_MODAL);
|
|
(importDefault(5080) /* metro dependency 5080: ModalActionCreators */).pop();
|
|
defaultImport2 = importDefault(3857) /* metro dependency 3857: ToastActionCreators */;
|
|
open = defaultImport2.open;
|
|
object2 = {};
|
|
object2.key = USER_VERIFIED_TOAST_KEY;
|
|
object2.iconColor = 'text-feedback-positive';
|
|
object2.IconComponent = (require(4073) /* metro dependency 4073: CircleCheckIcon */).CircleCheckIcon;
|
|
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
object2.content = intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t.Gwu134,
|
|
{username: env0_2});
|
|
Reflect.apply(open, defaultImport2, [object2]);
|
|
}
|
|
}
|
|
|
|
function _fun72587() { // fn#72587, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9466:1868, offset: 0x01d4b12c, size: 93 bytes, params: 1, frame: 18
|
|
var value2;
|
|
var moduleValue;
|
|
if (userKey != null) {
|
|
value2 = environment.__proto__;
|
|
moduleValue = require(9275) /* metro dependency 9275: SecureFramesUtils */;
|
|
moduleValue.deleteVerification(userId, userKey, isOtherUserKeyPersistent);
|
|
(importDefault(5080) /* metro dependency 5080: ModalActionCreators */).pop();
|
|
}
|
|
}
|
|
|
|
function _fun72588() { // fn#72588, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9466:2063, offset: 0x01d4b189, size: 228 bytes, params: 1, frame: 16
|
|
var r4;
|
|
var value2;
|
|
var moduleValue2;
|
|
if (fingerprint != null) {
|
|
if (env0_5 != null) {
|
|
value2 = environment.__proto__;
|
|
(importDefault(5080) /* metro dependency 5080: ModalActionCreators */).pop();
|
|
(require(9284) /* metro dependency 9284: SecureFramesTracking */).trackE2EEUserVerificationShareClicked({userId: userId,
|
|
|
|
|
|
channelId: channelId});
|
|
if (enabled) {
|
|
moduleValue2 = require(9275) /* metro dependency 9275: SecureFramesUtils */;
|
|
r4 = moduleValue2.getUserVerificationDeeplink(userId, fingerprint);
|
|
} else {
|
|
r4 = env0_5.join(' ');
|
|
}
|
|
(require(9212) /* metro dependency 9212: showShareActionSheetAndroid */).showShareActionSheet({message: r4},
|
|
AnalyticsSections.SECURE_FRAMES_VOICE_BOTTOM_SHEET);
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun72589() { // fn#72589, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9466:2380, offset: 0x01d4b26d, size: 91 bytes, params: 1, frame: 13
|
|
const value = environment.__proto__;
|
|
(importDefault(5080) /* metro dependency 5080: ModalActionCreators */).pop();
|
|
(importDefault(8743) /* metro dependency 8743: showUserProfileActionSheet */)({userId: userId, channelId: channelId,
|
|
isVoiceContext: true, sourceAnalyticsLocations: analyticsLocations});
|
|
}
|
|
|
|
function _fun72590() { // fn#72590, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9466:2613, offset: 0x01d4b2c8, size: 162 bytes, params: 1, frame: 16
|
|
const BadgeColors = (require(1305) /* metro dependency 1305: native */).BadgeColors;
|
|
const binding = env0_6;
|
|
const value = environment.__proto__;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const string = intl.string;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
return binding ? [Reflect.apply(string, intl, [t.UNUuem]), BadgeColors.INFO] : [Reflect.apply(string, intl,
|
|
[t.y2b7CA]), BadgeColors.DANGER];
|
|
}
|
|
|
|
function _fun72591() { // fn#72591, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9466:2799, offset: 0x01d4b36a, size: 70 bytes, params: 1, frame: 13
|
|
const value = environment.__proto__;
|
|
return (require(9275) /* metro dependency 9275: SecureFramesUtils */).getUserVerificationFooterText({isCurrentUserKeyPersistent: isCurrentUserKeyPersistent,
|
|
isOtherUserKeyPersistent: isOtherUserKeyPersistent, otherUserNickname: env0_2});
|
|
}
|
|
|
|
function _fun72592() { // fn#72592, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9466:2951, offset: 0x01d4b3b0, size: 59 bytes, params: 1, frame: 14
|
|
const value = environment.__proto__;
|
|
(require(9284) /* metro dependency 9284: SecureFramesTracking */).trackE2EEUserVerificationViewed({userId: userId,
|
|
channelId: channelId});
|
|
}
|
|
|