/* Metro module 15859; source: modules/guild_settings/native/GuildSettingsModalLanding.tsx; dependencies: [31, 1935, 1867, 3784, 1878, 15860, 9113, 661, 33, 4863, 4501, 6238, 1244, 4068, 15861, 8931, 3789, 15863, 13467, 7950, 10976, 10315, 9097, 15865, 4056, 6231, 13142, 6699, 9409, 3860, 697, 1484, 566, 9112, 15866, 6850, 6858, 3856, 7972, 4572, 15211, 1423, 15867, 5462, 2] */ import Native from '../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */ import GuildStore from '../../../stores/GuildStore.tsx'; /* Metro dependency 1867 */ import UserStore from '../../../stores/UserStore.tsx'; /* Metro dependency 1878 */ import GuildChannelStore from '../../../stores/GuildChannelStore.tsx'; /* Metro dependency 1935 */ import PermissionStore from '../../../stores/PermissionStore.tsx'; /* Metro dependency 3784 */ import GuildSettingsActionCreators from '../GuildSettingsActionCreators.tsx'; /* Metro dependency 9112 */ import GuildSettingsStore from '../GuildSettingsStore.tsx'; /* Metro dependency 9113 */ import IconLabelBlock from '../../../components_native/common/IconLabelBlock.tsx'; /* Metro dependency 15211 */ import GuildSettingsModalChannelsStore from '../GuildSettingsModalChannelsStore.tsx'; /* Metro dependency 15860 */ 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 ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */ 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 UseTokenModule from '../../../design/tokens/native/useToken.tsx'; /* Metro dependency 3860 */ import * as CircleInformationIconModule from '../../../design/components/Icon/native/redesign/generated/CircleInformationIcon.tsx'; /* Metro dependency 4068 */ import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */ import * as StackNativeModule from '../../../design/components/Stack/native/Stack.native.tsx'; /* Metro dependency 4572 */ import * as NavScrimAndroidModule from '../../../design/components/Navigator/native/NavScrim.android.tsx'; /* Metro dependency 5462 */ import * as TableRowGroupNativeModule from '../../../design/components/TableRow/native/TableRowGroup.native.tsx'; /* Metro dependency 6231 */ import * as GroupIconModule from '../../../design/components/Icon/native/redesign/generated/GroupIcon.tsx'; /* Metro dependency 6699 */ import * as GuildRoleSubscriptionSettingUtilsModule from '../../guild_role_subscriptions/feature_gating/GuildRoleSubscriptionSettingUtils.tsx'; /* Metro dependency 6850 */ import * as NativeModule from '../../../design/void/Form/native/index.tsx'; /* Metro dependency 7972 */ import * as UseChannelsAllowedToUnlinkModule from '../../lobbies/hooks/useChannelsAllowedToUnlink.tsx'; /* Metro dependency 15866 */ function _fun122020(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#122020, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16067:6, offset: 0x0255776e, size: 432 bytes, params: 8, frame: 20 const env0_0 = require; const trackPaneViewed = function(a0, a1) { var defaultImport = importDefault(dependencyMap[9]); var SETTINGS_PANE_VIEWED = AnalyticEvents.SETTINGS_PANE_VIEWED; defaultImport.trackWithMetadata(SETTINGS_PANE_VIEWED, {settings_type: 'guild', origin_pane: a1, destination_pane: a0}); }; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); let value = ConstantsModule; const env0_11 = value.GuildFeatures; const env0_12 = value.GuildSettingsSections; const env0_13 = value.ChannelTypes; const env0_14 = value.AnalyticEvents; value = require(33) /* metro dependency 33 */; const env0_15 = value.jsx; const env0_16 = value.jsxs; const env0_17 = value.Fragment; const pushRow = function(a0, a1) { a1.push(a0); }; const env0_19 = (CreateStylesModule).createStyles({container: {flex: 1}, containerContent: {paddingTop: 16}}); (FileImportTrackerModule).fileFinishedImporting('modules/guild_settings/native/GuildSettingsModalLanding.tsx'); exports.default = GuildSettingsModalLanding; function SettingsSection({guild, isGuildAdmin, canManageGuild, canManageGuildExpressions, canManageChannels, canViewAuditLog, canManageWebhooks, canUnlinkChannelLobbies, canConfigureOfficialMessages, categories, pushScreen}) { // fn#122022, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16067:543, offset: 0x0255796a, size: 2077 bytes, params: 2, frame: 38 var pushRowBinding; var object2; var object3; const TableRow = (require(6238) /* metro dependency 6238: TableRowNative */).TableRow; let object = {}; const intl = (require(1244) /* metro dependency 1244: indexNative */).intl; const string = intl.string; const t = (require(1244) /* metro dependency 1244: indexNative */).t; object.label = Reflect.apply(string, intl, [t['/dp6yY']]); object.arrow = true; const TableRow2 = (require(6238) /* metro dependency 6238: TableRowNative */).TableRow; let Icon = TableRow2.Icon; const CircleInformationIcon = (CircleInformationIconModule).CircleInformationIcon; object.icon = ; object.onPress = function() { return pushScreen(GuildSettingsSections.OVERVIEW); }; object = [ , ]; const currentUser = UserStore.getCurrentUser(); if (canManageGuild) { pushRow( )((require(6238) /* metro dependency 6238: TableRowNative */).TableRow.Icon)} onPress={function() { return pushScreen(GuildSettingsSections.MODERATION); }} key="moderation" />, object); } if (canViewAuditLog) { pushRow( )((require(6238) /* metro dependency 6238: TableRowNative */).TableRow.Icon)} onPress={function() { return pushScreen(GuildSettingsSections.AUDIT_LOG); }} key="auditlogs" />, object); } if (canManageChannels || currentUser != null && (importAll(3789) /* metro dependency 3789: PermissionUtils */).canManageACategory(currentUser, guild, categories)) { pushRow( )((require(6238) /* metro dependency 6238: TableRowNative */).TableRow.Icon)} onPress={function() { GuildSettingsModalChannelsStore.initGuild(guild.id); pushScreen(GuildSettingsSections.CHANNELS); }} key="channels" />, object); } let r12 = canManageGuild || canManageWebhooks; r12 = !r12 ? canUnlinkChannelLobbies : r12; if (r12) { pushRow( )((require(6238) /* metro dependency 6238: TableRowNative */).TableRow.Icon)} onPress={function() { return pushScreen(GuildSettingsSections.INTEGRATIONS); }} key="integrations" />, object); } if (canManageGuildExpressions) { pushRowBinding = pushRow; var tableRowProps = {label: intl.string(t.sMOuuS), arrow: true}; Icon = (require(6238) /* metro dependency 6238: TableRowNative */).TableRow.Icon; tableRowProps.icon = ; tableRowProps.onPress = function() { return pushScreen(GuildSettingsSections.EMOJI); }; pushRowBinding(, object); pushRowBinding = pushRow; var tableRowProps2 = {label: intl.string(t.R5nQkS), arrow: true}; Icon = (require(6238) /* metro dependency 6238: TableRowNative */).TableRow.Icon; tableRowProps2.icon = ; tableRowProps2.onPress = onPress_122029; pushRowBinding(, object); } if (canConfigureOfficialMessages) { pushRow( )((require(6238) /* metro dependency 6238: TableRowNative */).TableRow.Icon)} onPress={function() { return pushScreen(GuildSettingsSections.OFFICIAL_MESSAGES); }} key="official-messages" />, object); } if (canManageGuild) { pushRow( )((require(6238) /* metro dependency 6238: TableRowNative */).TableRow.Icon)} onPress={function() { return pushScreen(GuildSettingsSections.SECURITY); }} key="security" />, object); } if (isGuildAdmin && (require(15865) /* metro dependency 15865: GuildSettingsVanityURLUtils */).canSeeVanityUrlSettings(guild)) { pushRow( )((require(6238) /* metro dependency 6238: TableRowNative */).TableRow.Icon)} onPress={function() { return pushScreen(GuildSettingsSections.VANITY_URL); }} key="vanity" />, object); } if (object.length === 0) { return null; } else { const TableRowGroup = (require(6231) /* metro dependency 6231: TableRowGroupNative */).TableRowGroup; return ( {object} ); } function SettingsSectionOnPress_122029() { // fn#122029, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16067:2262, owner: SettingsSection.onPress, offset: 0x0255824f, size: 29 bytes, params: 1, frame: 11 const pushScreenBinding = pushScreen; const STICKERS = GuildSettingsSections.STICKERS; return pushScreenBinding(STICKERS); } } function CommunitySection({guild, pushScreen}) { // fn#122033, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16067:3062, offset: 0x025582c3, size: 427 bytes, params: 2, frame: 30 var tableRow; const features = guild.features; const has = features.has; let COMMUNITY = GuildFeatures.COMMUNITY; const value2 = Reflect.apply(has, features, [COMMUNITY]); const TableRowGroup = (TableRowGroupNativeModule).TableRowGroup; const object = {}; const intl = (IndexNativeModule).intl; let string = intl.string; const t = (IndexNativeModule).t; object.title = Reflect.apply(string, intl, [t['1g9A/f']]); object.hasIcons = true; const TableRow = (require(6238) /* metro dependency 6238: TableRowNative */).TableRow; const object2 = {}; string = intl.string; if (value2) { object2.label = Reflect.apply(string, intl, [t.nRtNqn]); object2.arrow = true; object2.icon = ((Icon) => )((require(6238) /* metro dependency 6238: TableRowNative */).TableRow.Icon); object2.onPress = function() { var pushScreenBinding = pushScreen; var COMMUNITY = GuildSettingsSections.COMMUNITY; return pushScreenBinding(COMMUNITY, {}); }; tableRow = ; } else { object2.label = Reflect.apply(string, intl, [t.ElKTeb]); object2.arrow = true; object2.icon = ((Icon) => )((require(6238) /* metro dependency 6238: TableRowNative */).TableRow.Icon); object2.onPress = onPress_122035; tableRow = ; } return ( {tableRow} ); function CommunitySectionOnPress_122035() { // fn#122035, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16067:3604, owner: CommunitySection.onPress, offset: 0x0255848e, size: 32 bytes, params: 1, frame: 13 const pushScreenBinding = pushScreen; const COMMUNITY_INTRO = GuildSettingsSections.COMMUNITY_INTRO; return pushScreenBinding(COMMUNITY_INTRO, {}); } } function UserManagementSection({canManageGuild, canManageRoles, canManageBans, pushScreen}) { // fn#122036, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16067:3654, offset: 0x025584ae, size: 862 bytes, params: 2, frame: 29 const TableRow = (require(6238) /* metro dependency 6238: TableRowNative */).TableRow; let object = {}; const intl = (require(1244) /* metro dependency 1244: indexNative */).intl; object.label = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['9Oq93m']); object.arrow = true; const TableRow2 = (require(6238) /* metro dependency 6238: TableRowNative */).TableRow; const Icon = TableRow2.Icon; const GroupIcon = (GroupIconModule).GroupIcon; object.icon = ; object.onPress = function() { return pushScreen(GuildSettingsSections.MEMBERS); }; object = [ , ]; if (canManageRoles) { pushRow( )((require(6238) /* metro dependency 6238: TableRowNative */).TableRow.Icon)} onPress={function() { return pushScreen(GuildSettingsSections.ROLES); }} key="roles" />, object); } if (canManageGuild) { pushRow( )((require(6238) /* metro dependency 6238: TableRowNative */).TableRow.Icon)} onPress={function() { return pushScreen(GuildSettingsSections.INSTANT_INVITES); }} key="invites" />, object); } if (canManageBans) { pushRow( )((require(6238) /* metro dependency 6238: TableRowNative */).TableRow.Icon)} onPress={function() { return pushScreen(GuildSettingsSections.BANS); }} key="bans" />, object); } if (object.length === 0) { return null; } else { const TableRowGroup = (require(6231) /* metro dependency 6231: TableRowGroupNative */).TableRowGroup; return ( {object} ); } } function GuildSettingsModalLandingInner({guild, contentContainerStyle, updateErrors}) { // fn#122041, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16067:4651, offset: 0x02558880, size: 998 bytes, params: 2, frame: 41 const useToken = UseTokenModule.useToken; const TABLE_ROW_PADDING = (Native).modules.mobile.TABLE_ROW_PADDING; const value2 = Reflect.apply(useToken, UseTokenModule, [TABLE_ROW_PADDING]); const styles = useStyles(); let value3 = (UseNavigationNativeModule).useNavigation(); let value4 = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildChannelStore], function() { var guildChannelStoreBinding = GuildChannelStore; var property = guildChannelStoreBinding.getChannels; var guildBinding = guild; var value3 = undefined; var value4 = Reflect.apply(property, guildChannelStoreBinding, [guildBinding == null ? value3 : guild.id]); return value4 == null ? value3 : value4[ChannelTypes.GUILD_CATEGORY]; }); const value5 = (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([PermissionStore], function() { return PermissionStore.getGuildPermissionProps(guild); }); ReactModule.useEffect(function() { trackPaneViewed(GuildSettingsSections.LANDING); }, []); const value6 = ReactModule.useCallback(_fun122045, [value3]); const isGuildAdmin = value5.isGuildAdmin; const canManageGuild = value5.canManageGuild; const canManageRoles = value5.canManageRoles; const canManageBans = value5.canManageBans; const canManageGuildExpressions = value5.canManageGuildExpressions; const canManageChannels = value5.canManageChannels; const canViewAuditLog = value5.canViewAuditLog; const canManageWebhooks = value5.canManageWebhooks; const useChannelsAllowedToUnlink = UseChannelsAllowedToUnlinkModule.useChannelsAllowedToUnlink; const value7 = Reflect.apply(useChannelsAllowedToUnlink, UseChannelsAllowedToUnlinkModule, [guild.id]).length > 0; const value8 = (GuildRoleSubscriptionSettingUtilsModule).useCanManageGuildRoleSubscriptions(guild); const r21 = canManageGuild && (require(6858) /* metro dependency 6858: GuildOfficialMessageUtils */).isGuildOfficialMessagesEnabled(guild, 'GuildSettingsModalLanding'); ReactModule.useLayoutEffect(_fun122046, [updateErrors.message]); const jsxRuntimeEnv0_17Binding = jsxRuntimeEnv0_17; const Form = (NativeModule).Form; const items3 = [styles.containerContent, contentContainerStyle]; const Stack = (StackNativeModule).Stack; const object2 = {paddingHorizontal: value2}; const PX_24 = (Native).space.PX_24; const items2 = [ ((Component) => )(IconLabelBlock), ]; items2[1] = ( ); items2[2] = canManageGuild && ; items2[3] = value8 && ((Component) => )(importDefault(15867) /* metro dependency 15867: GuildSettingsRoleSubscriptionsSection */); items2[4] = ( ); const form = (
{items2}
); const NavScrim = (NavScrimAndroidModule).NavScrim; return ( <> {form} ); function _fun122045(a0) { // fn#122045, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16067:5117, offset: 0x02558ce1, size: 111 bytes, params: 2, frame: 18 const value = copyRestArgs(0, undefined); const property = value[0]; (GuildSettingsActionCreators).setSection(property); const binding = env0_2; const push = binding.push; const items2 = []; arraySpread(items2, value, 0, 0); apply(push, items2, binding, 0); const trackPaneViewedBinding = trackPaneViewed; const LANDING = GuildSettingsSections.LANDING; trackPaneViewedBinding(property, LANDING); } function _fun122046() { // fn#122046, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16067:5580, offset: 0x02558d50, size: 67 bytes, params: 1, frame: 12 var value2; var moduleValue; if (updateErrors.message != null) { value2 = environment.__proto__; moduleValue = require(3856) /* metro dependency 3856: ToastUtils */; moduleValue.presentError(updateErrors.message); } } function onUpload(a0) { // fn#122047, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16067:5871, owner: GuildSettingsModalLandingInner.onUpload, offset: 0x02558d93, size: 54 bytes, params: 2, frame: 14 let value = environment.__proto__; value = importDefault(9112) /* metro dependency 9112: GuildSettingsActionCreators */; value.updateIcon(guild.id, a0); } function GuildSettingsModalLandingInnerMakeURL(a0) { // fn#122048, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16067:5949, owner: GuildSettingsModalLandingInner.makeURL, offset: 0x02558dc9, size: 83 bytes, params: 2, frame: 14 var r0; var value2; let value = a0; if (value) { value2 = environment.__proto__; value = (importDefault(1423) /* metro dependency 1423: AvatarUtils */).getGuildIconURL({id: guild.id, icon: value, canAnimate: true, size: 64}); r0 = value; } else { r0 = value; } return r0; } } function GuildSettingsModalLanding({guildId, contentContainerStyle}) { // fn#122050, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16067:6633, offset: 0x02558e30, size: 167 bytes, params: 2, frame: 21 const guild = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildStore], function() { return GuildStore.getGuild(guildId); }); const fluxModule = require(566) /* metro dependency 566: flux */; const useStateFromStoresObject = fluxModule.useStateFromStoresObject; return ( guild == null ? null : ( ) ); } } global.__d(_fun122020, 15859, [31, 1935, 1867, 3784, 1878, 15860, 9113, 661, 33, 4863, 4501, 6238, 1244, 4068, 15861, 8931, 3789, 15863, 13467, 7950, 10976, 10315, 9097, 15865, 4056, 6231, 13142, 6699, 9409, 3860, 697, 1484, 566, 9112, 15866, 6850, 6858, 3856, 7972, 4572, 15211, 1423, 15867, 5462, 2]) /* metro module 15859, dependencies: [31, 1935, 1867, 3784, 1878, 15860, 9113, 661, 33, 4863, 4501, 6238, 1244, 4068, 15861, 8931, 3789, 15863, 13467, 7950, 10976, 10315, 9097, 15865, 4056, 6231, 13142, 6699, 9409, 3860, 697, 1484, 566, 9112, 15866, 6850, 6858, 3856, 7972, 4572, 15211, 1423, 15867, 5462, 2] */;