281 lines
15 KiB
TypeScript
281 lines
15 KiB
TypeScript
/* Metro module 11425; source: modules/create_guild/native/AcceptGuildTemplate.tsx; dependencies: [31, 27, 1383, 1939, 661, 6934, 33, 4501, 697, 6597, 5461, 44, 1585, 1942, 4573, 1244, 9664, 8967, 4578, 7331, 1305, 22, 9062, 11426, 11427, 11428, 673, 2] */
|
|
function _fun87468(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#87468, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11611:6, offset: 0x01fbf3af, size: 950 bytes, params: 8, frame: 31
|
|
var object2;
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
importAll(31) /* metro dependency 31 */;
|
|
let value = require(27) /* metro dependency 27 */;
|
|
const env0_4 = value.View;
|
|
const env0_5 = value.ScrollView;
|
|
const env0_6 = (require(1383) /* metro dependency 1383: ChannelRecord */).isGuildVocalChannelType;
|
|
const env0_7 = (require(1939) /* metro dependency 1939: GuildRoleRecord */).isEveryoneRole;
|
|
value = require(661) /* metro dependency 661: Constants */;
|
|
const env0_8 = value.MarketingURLs;
|
|
const Fonts = value.Fonts;
|
|
const env0_9 = value.ChannelTypes;
|
|
const env0_10 = (require(6934) /* metro dependency 6934: GuildTemplatesConstants */).GuildTemplateStates;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_11 = value.jsx;
|
|
const env0_12 = value.jsxs;
|
|
const env0_13 = value.Fragment;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object2 = {};
|
|
const BACKGROUND_BASE_LOWER = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOWER;
|
|
object2.wrapper = {backgroundColor: BACKGROUND_BASE_LOWER, padding: 16};
|
|
const object4 = {textAlign: 'center'};
|
|
const textStyles = importDefault(6597) /* metro dependency 6597: TextStyles */;
|
|
let DISPLAY_EXTRABOLD = Fonts.DISPLAY_EXTRABOLD;
|
|
let MOBILE_TEXT_HEADING_PRIMARY = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_TEXT_HEADING_PRIMARY;
|
|
copyDataProperties(object4, textStyles(DISPLAY_EXTRABOLD, MOBILE_TEXT_HEADING_PRIMARY, 24), undefined);
|
|
object2.header = object4;
|
|
object2.description = {'textAlign': 'center', 'marginTop': 8, 'marginBottom': 32};
|
|
object2.iconUploader = {'alignSelf': 'center', 'marginBottom': 12};
|
|
object2.createButtonWrapper = {marginTop: 8};
|
|
object2.resolvingContainer = {'alignItems': 'center', 'flex': 1, 'justifyContent': 'center'};
|
|
object2.divider = {marginTop: 8};
|
|
const object5 = {};
|
|
const value3 = textStyles;
|
|
DISPLAY_EXTRABOLD = Fonts.DISPLAY_EXTRABOLD;
|
|
MOBILE_TEXT_HEADING_PRIMARY = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_TEXT_HEADING_PRIMARY;
|
|
copyDataProperties(object5, value3(DISPLAY_EXTRABOLD, MOBILE_TEXT_HEADING_PRIMARY, 16), undefined);
|
|
object5['marginTop'] = 24;
|
|
object2.sectionHeader = object5;
|
|
const object8 = {};
|
|
const BACKGROUND_SURFACE_HIGH = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_SURFACE_HIGH;
|
|
object8.backgroundColor = BACKGROUND_SURFACE_HIGH;
|
|
object8.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
|
|
object8.marginTop = 8;
|
|
object8.padding = 8;
|
|
object2.rolesChannelsWrapper = object8;
|
|
object2.channelsWrapper = {'flexDirection': 'column', 'paddingVertical': 0};
|
|
object2.rolesWrapper = {'flexDirection': 'row', 'flexWrap': 'wrap'};
|
|
object2.channelRow = {'alignItems': 'center', 'flexDirection': 'row', 'height': 40};
|
|
object2.channelIcon = {'marginLeft': 12, 'marginRight': 8, 'height': 20, 'width': 20};
|
|
object2.channelCategoryIcon = {'marginLeft': 0, 'marginRight': 2, 'height': 12, 'width': 12};
|
|
const CHANNELS_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.CHANNELS_DEFAULT;
|
|
object2.channelName = {'color': null, 'fontSize': 16, 'flex': 1, color: CHANNELS_DEFAULT};
|
|
const object10 = {};
|
|
const value4 = textStyles;
|
|
DISPLAY_EXTRABOLD = Fonts.DISPLAY_EXTRABOLD;
|
|
copyDataProperties(object10, value4(DISPLAY_EXTRABOLD, undefined, 12, {uppercase: true}), 12);
|
|
object2.channelCategoryName = object10;
|
|
object2.sectionTip = {marginTop: 8};
|
|
const GREEN_360 = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.GREEN_360;
|
|
const PRIMARY_BOLD = Fonts.PRIMARY_BOLD;
|
|
object2.protip = {color: GREEN_360, fontFamily: PRIMARY_BOLD, textTransform: 'uppercase'};
|
|
const env0_14 = Reflect.apply(createStyles, value, [object2]);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/create_guild/native/AcceptGuildTemplate.tsx');
|
|
exports.default = AcceptGuildTemplate;
|
|
}
|
|
|
|
function GuildTemplateResolving() { // fn#87469, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11611:1583, offset: 0x01fbf765, size: 83 bytes, params: 1, frame: 17
|
|
const styles = useStyles();
|
|
const ActivityIndicator = (require(5461) /* metro dependency 5461: ActivityIndicatorNative */).ActivityIndicator;
|
|
return (
|
|
<View style={styles.resolvingContainer}>
|
|
<ActivityIndicator />
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function GuildTemplateResolved({guildTemplate, createServer, name, setName, icon, chooseIcon, errors}) { // fn#87470, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11611:1710, offset: 0x01fbf7b8, size: 1660 bytes, params: 2, frame: 35
|
|
var r5;
|
|
var jsxRuntimeEnv0_13Binding;
|
|
var items5;
|
|
const styles = useStyles();
|
|
(importDefault(44) /* metro dependency 44 */)(guildTemplate != null, 'guild template cannot be null');
|
|
const defaultImport2 = importDefault(44) /* metro dependency 44 */;
|
|
let state = guildTemplate.state;
|
|
const RESOLVING = GuildTemplateStates.RESOLVING;
|
|
defaultImport2(state !== RESOLVING, 'guild must be resolved');
|
|
const bottom = (importDefault(1585) /* metro dependency 1585: useSafeAreaInsetsNative */)().bottom;
|
|
const value5 = guildTemplate.serializedSourceGuild.roles.map(_fun87471).filter(function(a0) {
|
|
return !isEveryoneRole(a0);
|
|
});
|
|
const items3 = [styles.wrapper];
|
|
items3[1] = {marginBottom: bottom};
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
let string = intl.string;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
const QzUORX = t.QzUORX;
|
|
const items2 = [<Text style={styles.header} variant="heading-xl/extrabold" color="mobile-text-heading-primary">{Reflect.apply(string,
|
|
intl, [QzUORX])}</Text>];
|
|
items2[1] = <Text style={styles.description} variant="text-lg/medium" color="text-default">{guildTemplate.name}</Text>;
|
|
items2[2] = ((Component) => <Component iconBackgroundColor={styles.wrapper.backgroundColor} style={styles.iconUploader} onPress={chooseIcon} icon={icon} />)(importDefault(9664) /* metro dependency 9664: GuildIconUploader */);
|
|
const FreeFormInputGroup = importDefault(8967) /* metro dependency 8967: FreeFormInputGroup */;
|
|
const freeFormInputGroupProps = {label: intl.string((require(1244) /* metro dependency 1244: indexNative */).t.dBih7e),
|
|
error: errors?.name};
|
|
const format = intl.format;
|
|
const property = (require(1244) /* metro dependency 1244: indexNative */).t['2bprXx'];
|
|
const GUIDELINES = MarketingURLs.GUIDELINES;
|
|
freeFormInputGroupProps.hint = Reflect.apply(format, intl, [property, {guidelinesURL: GUIDELINES}]);
|
|
freeFormInputGroupProps.value = name;
|
|
freeFormInputGroupProps.onChangeText = setName;
|
|
freeFormInputGroupProps.autoFocus = true;
|
|
freeFormInputGroupProps.autoCorrect = false;
|
|
freeFormInputGroupProps.returnKeyType = 'done';
|
|
items2[3] = <FreeFormInputGroup {...freeFormInputGroupProps} />;
|
|
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
|
|
const buttonProps = {size: 'md',
|
|
text: intl.string((require(1244) /* metro dependency 1244: indexNative */).t['O0p/lS']), onPress: createServer};
|
|
state = guildTemplate.state;
|
|
let ACCEPTING = GuildTemplateStates.ACCEPTING;
|
|
buttonProps.loading = state === ACCEPTING;
|
|
state = guildTemplate.state;
|
|
ACCEPTING = GuildTemplateStates.ACCEPTING;
|
|
buttonProps.disabled = state === ACCEPTING;
|
|
buttonProps.grow = true;
|
|
items2[4] = <View style={styles.createButtonWrapper}><Button {...buttonProps} /></View>;
|
|
items2[5] = ((Component) => <Component style={styles.divider} outer />)(importDefault(7331) /* metro dependency 7331: FormDivider */);
|
|
string = intl.string;
|
|
const OGiMXJ = (require(1244) /* metro dependency 1244: indexNative */).t.OGiMXJ;
|
|
items2[6] = <Text style={styles.sectionHeader} variant="heading-md/extrabold" color="mobile-text-heading-primary">{Reflect.apply(string,
|
|
intl, [OGiMXJ])}</Text>;
|
|
string = intl.string;
|
|
const Ztwyoz = (require(1244) /* metro dependency 1244: indexNative */).t.Ztwyoz;
|
|
items2[7] = <Text variant="text-xs/medium" color="text-default">{Reflect.apply(string, intl, [Ztwyoz])}</Text>;
|
|
items2[8] = <Channels channels={guildTemplate.serializedSourceGuild.channels} />;
|
|
const LegacyText = (require(1305) /* metro dependency 1305: native */).LegacyText;
|
|
const items4 = [<LegacyText style={styles.protip}>{intl.string((require(1244) /* metro dependency 1244: indexNative */).t['8tvIiN'])}{': '}</LegacyText>];
|
|
items4[1] = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.de7DpI);
|
|
items2[9] = <Text style={styles.sectionTip} variant="text-xs/medium" color="interactive-text-default">{items4}</Text>;
|
|
if (value5.length > 0) {
|
|
jsxRuntimeEnv0_13Binding = jsxRuntimeEnv0_13;
|
|
string = intl.string;
|
|
items5 = [<Text style={styles.sectionHeader} variant="heading-md/extrabold" color="mobile-text-heading-primary">{Reflect.apply(string,
|
|
|
|
intl, [t.mQ0H1p])}</Text>];
|
|
string = intl.string;
|
|
items5[1] = <Text variant="text-xs/medium" color="text-default">{Reflect.apply(string, intl,
|
|
[t.jOPEYC])}</Text>;
|
|
items5[2] = <Roles roles={value5} />;
|
|
r5 = <>{items5}</>;
|
|
} else {
|
|
r5 = null;
|
|
}
|
|
items2[10] = r5;
|
|
return (
|
|
<ScrollView contentContainerStyle={items3} keyboardShouldPersistTaps="handled">
|
|
{items2}
|
|
</ScrollView>
|
|
);
|
|
}
|
|
|
|
function Channels({channels}) { // fn#87473, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11611:3909, offset: 0x01fbfe86, size: 147 bytes, params: 2, frame: 17
|
|
const styles = useStyles();
|
|
return (
|
|
<View style={[styles.rolesChannelsWrapper, styles.channelsWrapper]}>
|
|
{(importDefault(22) /* metro dependency 22 */)(channels).sortBy(function(a0) {
|
|
var r0;
|
|
var value;
|
|
if (a0.parent_id == null) {
|
|
value = global.Number(a0.id);
|
|
value = 10000 * value;
|
|
r0 = value;
|
|
} else {
|
|
value = global.Number(a0.parent_id);
|
|
value = 10000 * value;
|
|
value += a0.id;
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}).map(_fun87475).value()}
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function getChannelIcon_87476({type}) { // fn#87476, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11611:4495, offset: 0x01fc00b7, size: 105 bytes, params: 2, frame: 14
|
|
return isGuildVocalChannelType(type) ? importDefault(9062) /* metro dependency 9062 */ : type === ChannelTypes.GUILD_CATEGORY ? importDefault(11426) /* metro dependency 11426 */ : importDefault(11427) /* metro dependency 11427 */;
|
|
}
|
|
|
|
function Roles({roles}) { // fn#87477, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11611:4589, offset: 0x01fc0120, size: 110 bytes, params: 2, frame: 17
|
|
const styles = useStyles();
|
|
return (
|
|
<View style={[styles.rolesChannelsWrapper, styles.rolesWrapper]}>
|
|
{roles.slice().reverse().map(_fun87478)}
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function AcceptGuildTemplate(a0) { // fn#87479, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11611:4923, offset: 0x01fc01ff, size: 172 bytes, params: 2, frame: 15
|
|
const guildTemplate = a0.guildTemplate;
|
|
if (guildTemplate != null) {
|
|
var state = guildTemplate.state;
|
|
var RESOLVED = GuildTemplateStates.RESOLVED;
|
|
if (RESOLVED === state) {
|
|
return <GuildTemplateResolved {...a0} />;
|
|
}
|
|
var ACCEPTING = GuildTemplateStates.ACCEPTING;
|
|
if (ACCEPTING === state) {
|
|
return <GuildTemplateResolved {...a0} />;
|
|
}
|
|
var ACCEPTED = GuildTemplateStates.ACCEPTED;
|
|
if (ACCEPTED === state) {
|
|
return <GuildTemplateResolved {...a0} />;
|
|
}
|
|
var RESOLVING = GuildTemplateStates.RESOLVING;
|
|
if (RESOLVING === state) {
|
|
return <GuildTemplateResolving {...a0} />;
|
|
}
|
|
}
|
|
return <GuildTemplateResolving {...a0} />;
|
|
}
|
|
|
|
function _fun87471(a0) { // fn#87471, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11611:1999, offset: 0x01fbfe34, size: 60 bytes, params: 2, frame: 13
|
|
let value = environment.__proto__;
|
|
value = importAll(1942) /* metro dependency 1942: GuildRoleRecordUtils */;
|
|
return value.fromServer(guildTemplate.serializedSourceGuild.id, a0);
|
|
}
|
|
|
|
function _fun87475(a0) { // fn#87475, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11611:4047, offset: 0x01fbff72, size: 325 bytes, params: 2, frame: 26
|
|
const type = a0.type;
|
|
const GUILD_CATEGORY = ChannelTypes.GUILD_CATEGORY;
|
|
const value2 = type === GUILD_CATEGORY;
|
|
const stylesBinding = styles;
|
|
const channelRow = stylesBinding.channelRow;
|
|
const Icon = (require(1305) /* metro dependency 1305: native */).Icon;
|
|
const items2 = [stylesBinding.channelIcon];
|
|
const value4 = null;
|
|
items2[1] = value2 ? styles.channelCategoryIcon : value4;
|
|
const PRIMARY_400 = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.PRIMARY_400;
|
|
const Icon2 = (require(1305) /* metro dependency 1305: native */).Icon;
|
|
const Sizes = Icon2.Sizes;
|
|
const CUSTOM = Sizes.CUSTOM;
|
|
const icon = <Icon style={items2} color={PRIMARY_400} size={CUSTOM} source={getChannelIcon_87476(a0)} />;
|
|
const LegacyText = (require(1305) /* metro dependency 1305: native */).LegacyText;
|
|
return (
|
|
<View style={channelRow} key={a0.id}>
|
|
{icon}
|
|
<LegacyText numberOfLines={1} style={[styles.channelName, value2 ? styles.channelCategoryName : value4]}>
|
|
{a0.name}
|
|
</LegacyText>
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function _fun87478(a0) { // fn#87478, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11611:4652, offset: 0x01fc018e, size: 113 bytes, params: 2, frame: 19
|
|
var r5;
|
|
let value = environment.__proto__;
|
|
const value2 = undefined;
|
|
const RolePill = importDefault(11428) /* metro dependency 11428: RolePill */;
|
|
if (a0.color === 0) {
|
|
r5 = value2;
|
|
} else {
|
|
value = require(673) /* metro dependency 673: ColorUtils */;
|
|
value = value.int2hex(a0.color);
|
|
r5 = value;
|
|
}
|
|
return (
|
|
<RolePill
|
|
disableInteraction
|
|
role={a0}
|
|
color={r5}
|
|
key={a0.id}
|
|
/>
|
|
);
|
|
}
|
|
|