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

237 lines
14 KiB
TypeScript

/* Metro module 12614; source: components_native/add_friend/AddFriendModal.tsx; dependencies: [57, 31, 27, 1878, 661, 11995, 33, 4501, 6597, 697, 11997, 4594, 683, 477, 1487, 5080, 3995, 1244, 9212, 5277, 12615, 5282, 4573, 12616, 12618, 1585, 5280, 2] */
import Module00057 from '../../by-id/module-00057.js'; /* Metro dependency 57 */
import AnalyticsUtils from '../../utils/AnalyticsUtils.tsx'; /* Metro dependency 683 */
import Native from '../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
import UseSafeAreaInsetsNative from '../../modules/safe_area/useSafeAreaInsets.native.tsx'; /* Metro dependency 1585 */
import UserStore from '../../stores/UserStore.tsx'; /* Metro dependency 1878 */
import UseMountEffect from '../../hooks/useMountEffect.tsx'; /* Metro dependency 4594 */
import ModalActionCreators from '../../actions/ModalActionCreators.tsx'; /* Metro dependency 5080 */
import TextStyles from '../../modules/rebrand/native/TextStyles.tsx'; /* Metro dependency 6597 */
import Module12615 from '../../by-id/module-12615.js'; /* Metro dependency 12615 */
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 IndexNativeModule from '../../intl/index.native.tsx'; /* Metro dependency 1244 */
import * as Module01487Module from '../../by-id/module-01487.js'; /* Metro dependency 1487 */
import * as TextModule from '../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
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 */
import * as ShowShareActionSheetAndroidModule from '../../modules/action_sheet/native/showShareActionSheet.android.tsx'; /* Metro dependency 9212 */
import * as ContactSyncConstantsModule from '../../modules/contact_sync/native/ContactSyncConstants.tsx'; /* Metro dependency 11995 */
import * as ContactSyncUtilsModule from '../../modules/contact_sync/native/ContactSyncUtils.tsx'; /* Metro dependency 11997 */
function _fun96754(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#96754, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12804:6, offset: 0x021652f4, size: 489 bytes, params: 8, frame: 26
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = ReactNativeModule;
const env0_5 = value.View;
const env0_6 = value.ScrollView;
value = require(661) /* metro dependency 661: Constants */;
const env0_8 = value.AnalyticEvents;
const Fonts = value.Fonts;
value = require(33) /* metro dependency 33 */;
const env0_10 = value.jsx;
const env0_11 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
object = {};
const object2 = {};
const DISPLAY_EXTRABOLD = Fonts.DISPLAY_EXTRABOLD;
const MOBILE_TEXT_HEADING_PRIMARY = (Native).colors.MOBILE_TEXT_HEADING_PRIMARY;
copyDataProperties(object2, TextStyles(DISPLAY_EXTRABOLD, MOBILE_TEXT_HEADING_PRIMARY, 24), undefined);
object2['marginTop'] = 32;
object2['marginHorizontal'] = 16;
object2['textAlign'] = 'center';
object.headerText = object2;
object.subheaderText = {'lineHeight': 18, 'marginVertical': 8, 'marginHorizontal': 16, 'textAlign': 'center'};
object.input = {marginTop: 16};
object.otherOptionsContainer = {'marginTop': 16, 'paddingHorizontal': 16};
const BACKGROUND_SURFACE_HIGH = (Native).colors.BACKGROUND_SURFACE_HIGH;
object.rowContainer = {backgroundColor: BACKGROUND_SURFACE_HIGH, marginTop: 8};
const env0_12 = Reflect.apply(createStyles, value, [object]);
(FileImportTrackerModule).fileFinishedImporting('components_native/add_friend/AddFriendModal.tsx');
exports.default = AddFriendModal;
function AddFriendModalScene({onSkip, sourceMetadata}) { // fn#96755, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12804:671, offset: 0x021654dd, size: 775 bytes, params: 2, frame: 28
var r9;
var value;
const styles = useStyles();
const value2 = (ContactSyncUtilsModule).useContactSyncAccount();
const binding = env0_4;
const useState = binding.useState;
const value4 = env0_3(Reflect.apply(useState, binding, [!ContactSyncUtilsModule.isContactSyncEnabled(value2)]), 2);
const property = value4[0];
var env0_3 = value4[1];
(UseMountEffect)(_fun96756);
const value5 = (Module01487Module).useNavigation();
var env0_4 = value5;
env0_4.useLayoutEffect(_fun96760, [env0_4.useCallback(_fun96758, [onSkip]), env0_4.useCallback(_fun96759, []),
value5]);
const Text = (TextModule).Text;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const GWMTSE = (require(1244) /* metro dependency 1244: indexNative */).t.GWMTSE;
const items2 = [
<Text
style={styles.headerText}
accessibilityRole="header"
variant="heading-xl/extrabold"
color="mobile-text-heading-primary"
>
{Reflect.apply(string, intl, [GWMTSE])}
</Text>,
];
items2[1] = (
<Text
style={styles.subheaderText}
variant="text-sm/medium"
color="text-default"
>
{intl.string((require(1244) /* metro dependency 1244: indexNative */).t['Rn/sLl'])}
</Text>
);
items2[2] = ((Component) => <Component style={styles.input} autoFocusInput={false} />)(importDefault(12616) /* metro dependency 12616: AddFriendById */);
const text = (
<Text
accessibilityRole="header"
variant="eyebrow"
color="text-default"
>
{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.dukg0Z)}
</Text>
);
if (property) {
value = importDefault(12618) /* metro dependency 12618: ContactSyncUpsellCTA */;
value = ((Component) => <Component style={styles.rowContainer} location="Add Friend Modal" />)(value);
r9 = value;
} else {
r9 = null;
}
items2[3] = (
<View style={styles.otherOptionsContainer}>
{text}
{r9}
</View>
);
return (
<ScrollView keyboardShouldPersistTaps="handled">
{items2}
</ScrollView>
);
function _fun96756() { // fn#96756, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12804:855, offset: 0x021657e4, size: 100 bytes, params: 1, frame: 16
var environment;
let value = environment.__proto__;
const defaultImport = AnalyticsUtils;
const track = defaultImport.track;
const FRIEND_ADD_VIEWED = AnalyticEvents.FRIEND_ADD_VIEWED;
Reflect.apply(track, defaultImport, [FRIEND_ADD_VIEWED, sourceMetadata]);
value = require(11997) /* metro dependency 11997: ContactSyncUtils */;
value = value.checkContactPermissions();
value.then(_fun96757);
function _fun96757(a0) { // fn#96757, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12804:939, offset: 0x02165848, size: 133 bytes, params: 2, frame: 14
var isContactSyncEnabled;
var value4;
let value = environment.__proto__.__proto__;
const NOT_DETERMINED = ContactPermissions.NOT_DETERMINED;
let r2 = a0 === NOT_DETERMINED || (require(477) /* metro dependency 477: PlatformUtils */).isAndroid() && a0 === ContactPermissions.UNAUTHORIZED;
if (!r2) {
value = require(11997) /* metro dependency 11997: ContactSyncUtils */;
isContactSyncEnabled = value.isContactSyncEnabled;
value4 = environment.__proto__;
value = !Reflect.apply(isContactSyncEnabled, value, [env1_2]);
r2 = value;
}
value = environment.__proto__;
env1_3(r2);
}
}
function _fun96758() { // fn#96758, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12804:1114, offset: 0x021658cd, size: 60 bytes, params: 1, frame: 11
if (onSkip != null) {
onSkip();
}
const value = environment.__proto__;
(ModalActionCreators).pop();
}
function _fun96759() { // fn#96759, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12804:1171, offset: 0x02165909, size: 222 bytes, params: 1, frame: 19
let value = environment.__proto__;
const currentUser = UserStore.getCurrentUser();
const value3 = undefined;
const r8 = currentUser != null ? (importDefault(3995) /* metro dependency 3995: UserUtils */).getUserTag(currentUser) : value3;
const defaultImport2 = AnalyticsUtils;
const track = defaultImport2.track;
const FRIEND_ADD_VIEWED = AnalyticEvents.FRIEND_ADD_VIEWED;
Reflect.apply(track, defaultImport2, [FRIEND_ADD_VIEWED, {'friend_add_type': 'Invite',
'source_page': 'Add Friend Modal'}]);
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
value = intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t['6E9a1J'],
{url: 'https://discord.com/', username: r8});
ShowShareActionSheetAndroidModule.showShareActionSheet({message: value}, 'Add Friend Modal');
return value3;
}
function _fun96760() { // fn#96760, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12804:1531, offset: 0x021659e7, size: 81 bytes, params: 1, frame: 15
const binding = env0_4;
const setOptions = binding.setOptions;
const object = {headerRight: headerRight_96761};
object.headerLeft = (require(5282) /* metro dependency 5282: NavigatorHeaderNative */).getHeaderCloseButton(env0_5);
Reflect.apply(setOptions, binding, [object]);
function headerRight_96761() { // fn#96761, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12804:1562, offset: 0x02165a38, size: 127 bytes, params: 1, frame: 18
const HeaderActionButton = (HeaderActionButtonNativeModule).HeaderActionButton;
const headerActionButtonProps = {source: Module12615, onPress: env1_6};
const intl = (IndexNativeModule).intl;
const string = intl.string;
const RDE0Sc = (IndexNativeModule).t.RDE0Sc;
headerActionButtonProps.accessibilityLabel = Reflect.apply(string, intl, [RDE0Sc]);
return <HeaderActionButton {...headerActionButtonProps} />;
}
}
}
function AddFriendModal(a0) { // fn#96762, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12804:2419, offset: 0x02165ab7, size: 128 bytes, params: 2, frame: 18
const env0_0 = a0;
const top = (UseSafeAreaInsetsNative)().top;
const value2 = ReactModule.useMemo(_fun96763, [a0]);
const Navigator = (NavigatorNativeModule).Navigator;
return (
<Navigator
screens={value2}
initialRouteName="ADD_FRIEND"
headerStatusBarHeight={top}
/>
);
function _fun96763() { // fn#96763, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12804:2480, offset: 0x02165b37, size: 25 bytes, params: 1, frame: 11
return ((a0) => {
var object2 = {ignoreKeyboard: true};
object2.title = (require(1244) /* metro dependency 1244: indexNative */).intl.string((require(1244) /* metro dependency 1244: indexNative */).t.w5uwoI);
object2.initialParams = a0;
object2.render = _fun96765;
return {ADD_FRIEND: object2};
})(env0_0);
function getScreens_96764(a0) { // fn#96764, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12804:2484, offset: 0x02165b50, size: 104 bytes, params: 2, frame: 16
const object2 = {ignoreKeyboard: true};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
object2.title = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.w5uwoI);
object2.initialParams = a0;
object2.render = render_96765;
return {ADD_FRIEND: object2};
function getScreens_96764Render(a0) { // fn#96765, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12804:2613, owner: getScreens_96764.render, offset: 0x02165bb8, size: 33 bytes, params: 2, frame: 13
return <AddFriendModalScene {...a0} />;
}
}
}
}
}
global.__d(_fun96754, 12614, [57, 31, 27, 1878, 661, 11995, 33, 4501, 6597, 697, 11997, 4594, 683, 477, 1487, 5080,
3995, 1244, 9212, 5277, 12615, 5282, 4573, 12616, 12618, 1585, 5280,
2]) /* metro module 12614, dependencies: [57, 31, 27, 1878, 661, 11995, 33, 4501, 6597, 697, 11997, 4594, 683, 477, 1487, 5080, 3995, 1244, 9212, 5277, 12615, 5282, 4573, 12616, 12618, 1585, 5280, 2] */;