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

401 lines
17 KiB
TypeScript

/* Metro module 12042; source: modules/nuf/native/components/ChannelPrompt.tsx; dependencies: [5, 57, 31, 27, 1935, 1867, 33, 4501, 5314, 566, 1484, 5282, 1244, 4603, 4131, 6618, 6819, 1423, 4573, 8967, 4578, 8970, 2] */
import Module00005 from '../../../../by-id/module-00005.js'; /* Metro dependency 5 */
import Module00057 from '../../../../by-id/module-00057.js'; /* Metro dependency 57 */
import GuildStore from '../../../../stores/GuildStore.tsx'; /* Metro dependency 1867 */
import GuildChannelStore from '../../../../stores/GuildChannelStore.tsx'; /* Metro dependency 1935 */
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 UseNavigationNativeModule from '../../../../design/components/Navigator/native/useNavigation.native.tsx'; /* Metro dependency 1484 */
import * as TextModule from '../../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
import * as NavigatorConstantsNativeModule from '../../../../design/components/Navigator/native/NavigatorConstants.native.tsx'; /* Metro dependency 5314 */
function _fun92533(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#92533, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12228:6, offset: 0x0208e36e, size: 430 bytes, params: 8, frame: 23
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = ReactNativeModule;
const env0_6 = value.ScrollView;
const env0_7 = value.View;
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;
const NAV_BAR_HEIGHT = (NavigatorConstantsNativeModule).NAV_BAR_HEIGHT;
const env0_12 = Reflect.apply(createStyles, value, [{flex: {flex: 1}, safePadding: {marginTop: NAV_BAR_HEIGHT,
flex: 1}, contentContainer: {paddingHorizontal: 16}, guildIcon: {alignSelf: 'center'},
guildName: {'marginTop': 8, 'textAlign': 'center'}, title: {'marginTop': 16, 'textAlign': 'center'},
subTitle: {'marginTop': 8, 'textAlign': 'center'}, topicInput: {marginTop: 24}, buttonWrapper: {marginTop: 8},
error: {marginTop: 4}}]);
(FileImportTrackerModule).fileFinishedImporting('modules/nuf/native/components/ChannelPrompt.tsx');
exports.default = ChannelPrompt;
function ChannelPrompt({guildId, buttonText, hasBack, hasSkip, onCancel, onSuccess}) { // fn#92534, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12228:666, offset: 0x0208e51c, size: 1286 bytes, params: 2, frame: 38
var r9;
var r0;
var SafeAreaPaddingView;
var GuildIcon;
var name;
var items2;
const Text = (TextModule).Text;
const intl = (IndexNativeModule).intl;
var string;
const t = (IndexNativeModule).t;
var FreeFormInputGroup;
const onCancel2 = onCancel;
const onSuccess2 = onSuccess;
var value;
const styles = useStyles();
const guild = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildStore], function() {
return GuildStore.getGuild(guildId);
});
let useState = ReactModule.useState;
const value3 = Reflect.apply(useState, ReactModule, ['']);
const binding2 = onSuccess2;
const value4 = binding2(value3, 2);
const property = value4[0];
const property2 = value4[1];
useState = ReactModule.useState;
const value5 = binding2(Reflect.apply(useState, ReactModule, [false]), 2);
const property3 = value5[0];
const env0_6 = value5[1];
useState = ReactModule.useState;
const value7 = binding2(Reflect.apply(useState, ReactModule, [null]), 2);
const property4 = value7[0];
const env0_7 = value7[1];
ReactModule.useLayoutEffect(_fun92536,
[(UseNavigationNativeModule).useNavigation(), hasBack, hasSkip, onCancel,
onSuccess]);
const value10 = ReactModule.useCallback(onCancel2(_fun92540), [guildId, onSuccess, property]);
if (guild == null) {
r0 = null;
} else {
SafeAreaPaddingView = (require(6618) /* metro dependency 6618: SafeAreaView */).SafeAreaPaddingView;
var safeAreaPaddingViewProps = {top: true, style: styles.safePadding};
var scrollViewBindingProps = {'style': null, 'contentInset': null, 'automaticallyAdjustContentInsets': false,
'keyboardShouldPersistTaps': 'handled', 'alwaysBounceVertical': false, style: styles.flex,
contentInset: {top: 0}, contentContainerStyle: styles.contentContainer};
GuildIcon = importDefault(6819) /* metro dependency 6819: GuildIcon */;
name = guild.name;
items2 = [
<GuildIcon
style={styles.guildIcon}
value={name}
icon={guild.icon != null ? (importDefault(1423) /* metro dependency 1423: AvatarUtils */).getGuildIconURL({id: guild.id,
icon: guild.icon, canAnimate: true, size: 128}) : null}
selected
/>,
];
name = guild.name;
items2[1] = (
<Text
style={styles.guildName}
lineClamp={1}
variant="text-sm/semibold"
color="mobile-text-heading-primary"
>
{name}
</Text>
);
string = intl.string;
items2[2] = (
<Text
style={styles.title}
accessibilityRole="header"
variant="heading-xl/extrabold"
color="mobile-text-heading-primary"
>
{Reflect.apply(string, intl, [t['8VRa7d']])}
</Text>
);
string = intl.string;
items2[3] = (
<Text
style={styles.subTitle}
variant="text-sm/medium"
color="text-default"
>
{Reflect.apply(string, intl, [t['+855Pm']])}
</Text>
);
FreeFormInputGroup = importDefault(8967) /* metro dependency 8967: FreeFormInputGroup */;
items2[4] = (
<FreeFormInputGroup
style={styles.topicInput}
label={intl.string(t.bY20tU)}
value={property}
error={property4?.getFirstFieldErrorMessage('name')}
onChangeText={property2}
onSubmitEditing={value10}
maxLength={100}
placeholder={intl.string(t.xGOYA8)}
returnKeyType="done"
autoFocus
/>
);
items2[5] = (
<View style={styles.buttonWrapper}>
{((Button) => <Button size="md" text={buttonText} onPress={value10} loading={property3} disabled={property3} grow />)((require(4578) /* metro dependency 4578: ButtonNative */).Button)}
</View>
);
if (property4 != null) {
if (property4.hasFieldErrors()) {
value = importDefault(8970) /* metro dependency 8970: FreeFormErrorLabel */;
value = ((Component) => <Component style={styles.error}>{property4?.getAnyErrorMessage()}</Component>)(value);
r9 = value;
} else {
r9 = null;
}
} else {
r9 = null;
}
items2[6] = r9;
value = (
<SafeAreaPaddingView {...safeAreaPaddingViewProps}>
<ScrollView {...scrollViewBindingProps}>
{items2}
</ScrollView>
</SafeAreaPaddingView>
);
r0 = value;
}
return r0;
function _fun92536() { // fn#92536, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12228:990, offset: 0x0208ea22, size: 196 bytes, params: 1, frame: 22
var environment;
var r5;
var r3;
var value2;
var moduleValue;
var value4;
var moduleValue2;
var getHeaderTextButton;
var intl;
const binding = env0_8;
const setOptions = binding.setOptions;
const object = {};
if (hasBack) {
value2 = environment.__proto__;
moduleValue = require(5282) /* metro dependency 5282: NavigatorHeaderNative */;
r5 = moduleValue.getHeaderBackButton(onCancel);
} else {
r5 = function() {
return null;
};
}
object.headerLeft = r5;
if (hasSkip) {
value4 = environment.__proto__;
moduleValue2 = require(5282) /* metro dependency 5282: NavigatorHeaderNative */;
getHeaderTextButton = moduleValue2.getHeaderTextButton;
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
r3 = Reflect.apply(getHeaderTextButton, moduleValue2,
[intl.string((require(1244) /* metro dependency 1244: indexNative */).t['5Wxrcd']), onSuccess]);
} else {
r3 = function() {
return null;
};
}
object.headerRight = r3;
Reflect.apply(setOptions, binding, [object]);
}
function* _fun92540() { // fn#92540, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12228:1201, offset: 0x0208eaf1, size: 295 bytes, params: 1, frame: 25
var parent_id;
var binding2;
var property;
var value6;
var intl;
var formatToPlainString;
var value7;
var t;
var V4lepJ;
var object;
var value8;
var binding3;
var value9;
var createTextChannel;
var value10;
var textChannel;
var value11;
var value12;
var error;
var APIError;
var prototype;
var value13;
var aPIError;
var value14;
let value = undefined;
if (true) {
value = undefined;
View(null);
ScrollView(true);
var binding = env2_8;
var defaultChannel = binding.getDefaultChannel(require);
reducibleJoin3: while (true) {
reduciblePort36: while (true) {
exceptionLanding35: while (true) {
try {
binding = env2_0;
} catch (error) {
break exceptionLanding35;
}
break reducibleJoin3;
}
binding = env2_0;
APIError = binding(env2_2[14]).APIError;
prototype = APIError.prototype;
value13 = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value14 = aPIError instanceof Object ? aPIError : value13;
View(value14);
break reduciblePort36;
}
ScrollView(false);
return value;
}
try {
binding2 = env2_2;
} catch (error) {
break exceptionLanding35;
}
try {
property = binding2[12];
} catch (error) {
break exceptionLanding35;
}
try {
value6 = binding(property);
} catch (error) {
break exceptionLanding35;
}
try {
intl = value6.intl;
} catch (error) {
break exceptionLanding35;
}
try {
formatToPlainString = intl.formatToPlainString;
} catch (error) {
break exceptionLanding35;
}
try {
property = binding2[12];
} catch (error) {
break exceptionLanding35;
}
try {
value7 = binding(property);
} catch (error) {
break exceptionLanding35;
}
try {
t = value7.t;
} catch (error) {
break exceptionLanding35;
}
try {
V4lepJ = t.V4lepJ;
} catch (error) {
break exceptionLanding35;
}
try {
object = {};
} catch (error) {
break exceptionLanding35;
}
try {
binding = env1_5;
} catch (error) {
break exceptionLanding35;
}
try {
object.topic = binding;
} catch (error) {
break exceptionLanding35;
}
try {
value8 = Reflect.apply(formatToPlainString, intl, [V4lepJ, object]);
} catch (error) {
break exceptionLanding35;
}
try {
binding3 = env2_1;
} catch (error) {
break exceptionLanding35;
}
try {
property = binding2[13];
} catch (error) {
break exceptionLanding35;
}
try {
value9 = binding3(property);
} catch (error) {
break exceptionLanding35;
}
try {
createTextChannel = value9.createTextChannel;
} catch (error) {
break exceptionLanding35;
}
try {
} catch (error) {
break exceptionLanding35;
}
try {
value10 = defaultChannel == null;
} catch (error) {
break exceptionLanding35;
}
reducibleJoin27: while (true) {
if (value10) {
parent_id = value;
break reducibleJoin27;
}
try {
parent_id = defaultChannel.parent_id;
} catch (error) {
break exceptionLanding35;
}
break reducibleJoin27;
}
try {
textChannel = Reflect.apply(createTextChannel, value9, [require, binding, parent_id, value8]);
} catch (error) {
break exceptionLanding35;
}
yield textChannel;
try {
value11 = undefined;
value12 = false;
} catch (error) {
break exceptionLanding35;
}
if (value12) {
return value11;
}
try {
binding = env1_4;
} catch (error) {
break exceptionLanding35;
}
try {
binding();
} catch (error) {
break exceptionLanding35;
}
ScrollView(false);
}
return value;
}
}
}
global.__d(_fun92533, 12042, [5, 57, 31, 27, 1935, 1867, 33, 4501, 5314, 566, 1484, 5282, 1244, 4603, 4131, 6618,
6819, 1423, 4573, 8967, 4578, 8970,
2]) /* metro module 12042, dependencies: [5, 57, 31, 27, 1935, 1867, 33, 4501, 5314, 566, 1484, 5282, 1244, 4603, 4131, 6618, 6819, 1423, 4573, 8967, 4578, 8970, 2] */;