/* Metro module 15934; source: modules/guild_settings/native/GuildSettingsModalChannels.tsx; dependencies: [6, 7, 15, 17, 18, 31, 27, 1379, 1867, 3784, 3793, 1878, 15860, 661, 33, 4501, 6597, 697, 1244, 4002, 673, 7972, 1305, 15935, 3868, 566, 6647, 4805, 5278, 1585, 4578, 6802, 9087, 10083, 15936, 15937, 15858, 11427, 13761, 3789, 6593, 4647, 5277, 15938, 5462, 8148, 1484, 44, 4584, 2] */
import ClassCallCheck from '../../../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */
import CreateClass from '../../../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */
import PossibleConstructorReturn from '../../../by-id/module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */
import Module00017 from '../../../by-id/module-00017.js'; /* Metro dependency 17 */
import Inherits from '../../../by-id/module-00018-Inherits.js'; /* Metro dependency 18 */
import Module00044 from '../../../by-id/module-00044.js'; /* Metro dependency 44 */
import Native from '../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
import ChannelStore from '../../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
import UseSafeAreaInsetsNative from '../../safe_area/useSafeAreaInsets.native.tsx'; /* Metro dependency 1585 */
import GuildStore from '../../../stores/GuildStore.tsx'; /* Metro dependency 1867 */
import UserStore from '../../../stores/UserStore.tsx'; /* Metro dependency 1878 */
import PermissionStore from '../../../stores/PermissionStore.tsx'; /* Metro dependency 3784 */
import RelationshipStore from '../../../stores/RelationshipStore.tsx'; /* Metro dependency 3793 */
import TextStyles from '../../rebrand/native/TextStyles.tsx'; /* Metro dependency 6597 */
import GuildSettingsModalChannelsActionCreators from '../GuildSettingsModalChannelsActionCreators.tsx'; /* Metro dependency 15858 */
import GuildSettingsModalChannelsStore from '../GuildSettingsModalChannelsStore.tsx'; /* Metro dependency 15860 */
import SortableChannels from '../../../components_native/common/SortableChannels.tsx'; /* Metro dependency 15938 */
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 JsxRuntimeModule from '../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
import * as FluxModule from '../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
import * as ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
import * as ColorUtilsModule from '../../../external/discord_common/js/shared/utils/ColorUtils.tsx'; /* Metro dependency 673 */
import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
import * as NativeModule from '../../../design/void/native.tsx'; /* Metro dependency 1305 */
import * as UseNavigationNativeModule from '../../../design/components/Navigator/native/useNavigation.native.tsx'; /* Metro dependency 1484 */
import * as NativeModule2 from '../../../external/discord_common/js/packages/design/native.tsx'; /* Metro dependency 3868 */
import * as SharedModule from '../../../design/shared.tsx'; /* Metro dependency 4002 */
import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
import * as UseChannelNameModule from '../../channel/useChannelName.tsx'; /* Metro dependency 4805 */
import * as HeaderActionButtonNativeModule from '../../../design/components/Navigator/native/HeaderActionButton.native.tsx'; /* Metro dependency 5277 */
import * as PressablesModule from '../../../design/void/Pressables/native/Pressables.tsx'; /* Metro dependency 5278 */
import * as NavScrimAndroidModule from '../../../design/components/Navigator/native/NavScrim.android.tsx'; /* Metro dependency 5462 */
import * as ChannelUtilsModule from '../../../utils/native/ChannelUtils.tsx'; /* Metro dependency 6647 */
import * as NativeModule3 from '../../../design/void/Form/native/index.tsx'; /* Metro dependency 7972 */
import * as ChannelSettingsActionCreatorsModule from '../../../actions/ChannelSettingsActionCreators.tsx'; /* Metro dependency 8148 */
import * as ChannelSortingUtilsModule from '../../../utils/ChannelSortingUtils.tsx'; /* Metro dependency 15936 */
function _fun122895(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#122895, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16142:6, offset: 0x02579a95, size: 996 bytes, params: 8, frame: 33
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const StyleSheet = ReactNativeModule.StyleSheet;
const Fonts = ConstantsModule.Fonts;
const createLegacyClassComponentStyles = CreateStylesModule.createLegacyClassComponentStyles;
object = {};
const object2 = {};
let PRIMARY_SEMIBOLD = Fonts.PRIMARY_SEMIBOLD;
const MOBILE_TEXT_HEADING_PRIMARY = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_TEXT_HEADING_PRIMARY;
copyDataProperties(object2, TextStyles(PRIMARY_SEMIBOLD, MOBILE_TEXT_HEADING_PRIMARY, 16), undefined);
object2['textTransform'] = 'capitalize';
object.headerRight = object2;
const BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
object.containerView = {flex: 1, backgroundColor: BACKGROUND_BASE_LOW};
const object4 = {};
const DISPLAY_EXTRABOLD = Fonts.DISPLAY_EXTRABOLD;
let TEXT_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_SUBTLE;
copyDataProperties(object4, TextStyles(DISPLAY_EXTRABOLD, TEXT_SUBTLE, 12, {uppercase: true}), 12);
object.categoryText = object4;
object.categoryView = {'paddingTop': 36, 'paddingBottom': 8};
object.sortingCategoryView = {paddingTop: 16};
const object7 = {};
PRIMARY_SEMIBOLD = Fonts.PRIMARY_SEMIBOLD;
TEXT_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_SUBTLE;
copyDataProperties(object7, TextStyles(PRIMARY_SEMIBOLD, TEXT_SUBTLE, 14), 12);
object.edit = object7;
object.row = {marginTop: -StyleSheet.hairlineWidth};
object.formRowStyle = {paddingVertical: 12};
const GREEN_360 = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.GREEN_360;
object.dropHighlight = {backgroundColor: GREEN_360, opacity: 0.3};
object.floatingActionButtonContainer = {'position': 'absolute', 'bottom': 16, 'right': 0, 'left': 0,
'flexDirection': 'row', 'justifyContent': 'center'};
const env0_23 = Reflect.apply(createLegacyClassComponentStyles, CreateStylesModule, [object]);
let PureComponent = ReactModule.PureComponent;
const value9 = _fun122909(PureComponent);
const ThemeContext = (NativeModule2).ThemeContext;
value9.contextType = ThemeContext;
PureComponent = ReactModule.PureComponent;
_fun122914(PureComponent).contextType = ThemeContext;
PureComponent = ReactModule.PureComponent;
_fun122917(PureComponent).contextType = ThemeContext;
(FileImportTrackerModule).fileFinishedImporting('modules/guild_settings/native/GuildSettingsModalChannels.tsx');
exports.default = GuildSettingsModalChannelsConnected;
function _callSuper_122896(a0, a1, a2) { // fn#122896, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16142:387, offset: 0x02579e79, size: 100 bytes, params: 4, frame: 20
var r0;
var Reflect;
let value = a2;
const value3 = Module00017(a1);
if (_isNativeReflectConstruct_122897()) {
Reflect = global.Reflect;
value = Reflect.construct(value3, value || [], Module00017(a0).constructor);
r0 = value;
} else {
value = value3.apply(a0, value);
r0 = value;
}
return PossibleConstructorReturn(a0, r0);
}
function _isNativeReflectConstruct_122897() { // fn#122897, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16142:518, offset: 0x02579edd, size: 98 bytes, params: 1, frame: 18
var Boolean;
var prototype;
var valueOf;
var call;
var Reflect;
var construct;
var closure;
var value;
var error;
try {
Boolean = global.Boolean;
prototype = Boolean.prototype;
valueOf = prototype.valueOf;
call = valueOf.call;
Reflect = global.Reflect;
construct = Reflect.construct;
Boolean = global.Boolean;
closure = function() {
};
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
value = Reflect.apply(call, valueOf, [value]);
var result = !value;
} catch (error) {
}
return (_isNativeReflectConstruct_122897_isNativeReflectConstruct = function() {
return !!result;
})();
}
function ChannelItem({style, channelIconStyle, actionIconStyle, channel, sortingEnabled, onPress, sortHandlers}) { // fn#122900, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16142:2482, offset: 0x02579f3f, size: 783 bytes, params: 2, frame: 38
const value3 = (CreateStylesModule).useLegacyClassComponentStyles(env0_23);
const useThemeContext = SharedModule.useThemeContext;
const theme = Reflect.apply(useThemeContext, SharedModule, []).theme;
const value4 = (FluxModule).useStateFromStores([PermissionStore], _fun122901,
[channel]);
sortHandlers = !value4 ? undefined : sortHandlers;
const channelIcon = (ChannelUtilsModule).getChannelIcon(channel);
const channelIconComponent = (ChannelUtilsModule).getChannelIconComponent(channel);
object = {accessibilityRole: 'button'};
const isThemeDark2 = SharedModule.isThemeDark(theme);
const hex2rgb = ColorUtilsModule.hex2rgb;
const unsafe_rawColors = (Native).unsafe_rawColors;
let r7 = isThemeDark2 ? Reflect.apply(hex2rgb, ColorUtilsModule, [unsafe_rawColors.PRIMARY_700,
0.6]) : Reflect.apply(hex2rgb, ColorUtilsModule, [unsafe_rawColors.PRIMARY_200, 0.6]);
object.underlayColor = r7 ?? undefined;
object.style = style;
copyDataProperties(object, sortHandlers, undefined);
r7 = sortingEnabled ? value4 ? null : {opacity: 0.3} : null;
const FormRow = (require(7972) /* metro dependency 7972: native */).FormRow;
const formRowProps = {leading: channelIconComponent != null ? ((Component) => )(channelIconComponent) : ((Icon) => )((require(7972) /* metro dependency 7972: native */).FormRow.Icon),
style: value3.formRowStyle};
formRowProps.label = UseChannelNameModule.computeChannelName(channel, UserStore, RelationshipStore);
formRowProps.onPress = sortingEnabled ? undefined : function() {
return onPress(channel.id);
};
formRowProps.trailing = (
value4 && sortingEnabled
? ((Icon) => )((require(7972) /* metro dependency 7972: native */).FormRow.Icon)
: null
);
formRowProps.numberOfLines = sortingEnabled ? 1 : undefined;
return (
);
function _fun122901() { // fn#122901, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16142:2723, offset: 0x0257a24e, size: 112 bytes, params: 1, frame: 15
return channel.parent_id == null ? PermissionStore.canWithPartialContext(Permissions.MANAGE_CHANNELS,
{guildId: channel.guild_id}) : PermissionStore.canWithPartialContext(Permissions.MANAGE_CHANNELS,
{channelId: channel.parent_id});
}
}
function isValidDrop(a0, a1) { // fn#122903, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16142:4048, offset: 0x0257a2be, size: 110 bytes, params: 3, frame: 16
return a0 != null && (a0.parentId == null ? PermissionStore.can(Permissions.MANAGE_CHANNELS,
a1) : PermissionStore.can(Permissions.MANAGE_CHANNELS, ChannelStore.getChannel(a0.parentId)));
}
function CreateButton({guild}) { // fn#122904, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16142:4186, offset: 0x0257a32c, size: 332 bytes, params: 2, frame: 24
var r0;
var Button;
var intl;
const value2 = (CreateStylesModule).useLegacyClassComponentStyles(env0_23);
const value3 = env0_9.useMemo(function() {
return {bottom: 16 + bottom};
}, [(importDefault(1585) /* metro dependency 1585: useSafeAreaInsetsNative */)().bottom]);
const permissionStoreBinding = PermissionStore;
const can = permissionStoreBinding.can;
const MANAGE_CHANNELS = Permissions.MANAGE_CHANNELS;
if (Reflect.apply(can, permissionStoreBinding, [MANAGE_CHANNELS, guild])) {
var viewBindingProps = {style: [value2.floatingActionButtonContainer, value3]};
Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
r0 = (
);
} else {
r0 = null;
}
return r0;
function CreateButtonOnPress() { // fn#122906, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16142:4488, owner: CreateButton.onPress, offset: 0x0257a48e, size: 254 bytes, params: 1, frame: 20
var environment;
let value = environment.__proto__;
value = require(6802) /* metro dependency 6802: showSimpleActionSheet */;
const showSimpleActionSheet = value.showSimpleActionSheet;
const object = {key: 'GuildSettingsChannelsCreate'};
const intl = (IndexNativeModule).intl;
let string = intl.string;
const t = (IndexNativeModule).t;
const CumH4u = t.CumH4u;
object.header = {title: Reflect.apply(string, intl, [CumH4u])};
string = intl.string;
const GK18KJ = t.GK18KJ;
object.options = [{label: intl.string(t.vHCZwr), onPress: function() {
var defaultImport = importDefault(dependencyMap[32]);
var GUILD_CATEGORY = ChannelTypes.GUILD_CATEGORY;
defaultImport.open(GUILD_CATEGORY, guild.id, null, null);
}}, {label: Reflect.apply(string, intl, [GK18KJ]), onPress: onPress_122908}];
object.hasIcons = false;
Reflect.apply(showSimpleActionSheet, value, [object]);
function onPressOnPress_body_122908() { // fn#122908, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16142:4776, owner: CreateButton.onPress.body, offset: 0x0257a5ce, size: 58 bytes, params: 1, frame: 16
let value = environment.__proto__.__proto__;
value = importDefault(9087) /* metro dependency 9087: CreateChannelModalActionCreators */;
value.open(null, guild.id, null, null);
}
}
}
function _fun122909(a0) { // fn#122909, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16142:1475, offset: 0x0257a608, size: 72 bytes, params: 2, frame: 15
const Category2 = Category;
Inherits(Category2, a0);
return CreateClass(Category2, [{key: 'render', value: value_122911}]);
function Category() { // fn#122910, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16142:1487, offset: 0x0257a650, size: 42 bytes, params: 1, frame: 16
env1_4(this, Category);
return _callSuper_122896(this, Category, arguments);
}
function value_122911() { // fn#122911, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16142:1620, offset: 0x0257a67a, size: 596 bytes, params: 1, frame: 30
var environment;
const value = environment.__proto__;
const binding = env1_23;
const context = this.context;
const value2 = undefined;
const value3 = binding(context);
const {category, onPress, sortingEnabled, editStyle, actionIconStyle} = this.props;
const value4 = null;
const sortHandlers = sortingEnabled ? this.props.sortHandlers : value4;
const object = {accessibilityRole: 'button'};
const object2 = {name: 'activate'};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
object2.label = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.bt75uw);
object.accessibilityActions = [object2];
object.onAccessibilityAction = function(a0) {
return a0.nativeEvent.actionName !== 'activate' || onPress == null ? undefined : onPress(category.id);
};
const isThemeDark2 = SharedModule.isThemeDark(this.context.theme);
const hex2rgb = ColorUtilsModule.hex2rgb;
const unsafe_rawColors = (Native).unsafe_rawColors;
const r5 = isThemeDark2 ? Reflect.apply(hex2rgb, ColorUtilsModule, [unsafe_rawColors.PRIMARY_700,
0.6]) : Reflect.apply(hex2rgb, ColorUtilsModule, [unsafe_rawColors.PRIMARY_200, 0.6]);
object.underlayColor = value4 != r5 ? r5 : value2;
copyDataProperties(object, sortHandlers, intl);
const FormTitle = (NativeModule3).FormTitle;
return (
)(env1_25)
: (
value4 != sortHandlers
? ((Icon) => )((require(1305) /* metro dependency 1305: native */).Icon)
: value4
)}
/>
);
}
}
function _fun122914(a0) { // fn#122914, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16142:3620, offset: 0x0257a912, size: 72 bytes, params: 2, frame: 15
const SectionEditAction2 = SectionEditAction;
Inherits(SectionEditAction2, a0);
return CreateClass(SectionEditAction2, [{key: 'render', value: value_122916}]);
function SectionEditAction() { // fn#122915, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16142:3632, offset: 0x0257a650, size: 42 bytes, params: 1, frame: 16
env1_4(this, SectionEditAction);
return _callSuper_122896(this, SectionEditAction, arguments);
}
function value_122916() { // fn#122916, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16142:3810, offset: 0x0257a95a, size: 164 bytes, params: 1, frame: 21
const {style, onPress} = this.props;
const PressableOpacity = (PressablesModule).PressableOpacity;
const LegacyText = (NativeModule).LegacyText;
const intl = (IndexNativeModule).intl;
return (
{intl.string((IndexNativeModule).t.bt75uw)}
);
}
}
function _fun122917(a0) { // fn#122917, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16142:4937, offset: 0x0257a9fe, size: 199 bytes, params: 2, frame: 16
const GuildSettingsModalChannels2 = GuildSettingsModalChannels;
Inherits(GuildSettingsModalChannels2, a0);
return CreateClass(GuildSettingsModalChannels2, [{key: 'componentDidMount', value: function() {
this.updateNavigation();
}}, {key: 'componentDidUpdate', value: function(a0) {
this.updateNavigation(a0);
}}, {key: 'updateNavigation', value: value_122934}, {key: 'render', value: value_122938},
{key: 'handleChannelPress', value: value_122942}, {key: 'handleSortStop', value: value_122943}]);
function GuildSettingsModalChannels(a0) { // fn#122918, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16142:4949, offset: 0x0257aac5, size: 159 bytes, params: 2, frame: 18
let value = copyRestArgs(0, undefined);
env1_4(this, GuildSettingsModalChannels);
const _callSuper_122896Binding = _callSuper_122896;
const items2 = [];
arraySpread(items2, value, 0, undefined);
value = _callSuper_122896Binding(this, GuildSettingsModalChannels, items2);
value.state = {hovering: null};
value.renderActiveDivider = renderActiveDivider_122919;
value.renderSectionHeader = renderSectionHeader_122920;
value.renderItem = renderItem_122921;
value.handleHoverChange = handleHoverChange;
value.handleSortStart = handleSortStart;
value.handleDrop = handleDrop;
return value;
function GuildSettingsModalChannelsRenderActiveDivider(a0, a1, a2) { // fn#122919, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16142:5138, owner: GuildSettingsModalChannels.renderActiveDivider, offset: 0x0257ab64, size: 268 bytes, params: 4, frame: 26
const value = environment.__proto__.__proto__;
const binding = env2_23;
const binding2 = env0_0;
const value3 = binding(binding2.context);
const {sortingType, order, channelList, guild} = binding2.props;
const value4 = null;
if (value4 == sortingType) {
return value4;
}
if (value4 == order) {
return value4;
}
if (value4 == channelList) {
return value4;
}
const localChannel = GuildSettingsModalChannelsStore.getLocalChannel(a1);
const r10 = value4 != a2 ? GuildSettingsModalChannelsStore.getLocalChannel(a2) : value4;
const r9 = value4 != a2 ? order.indexOf(a2) : -1;
const value9 = order.indexOf(a1);
const isValidDropBinding = isValidDrop;
const getDropData = ChannelSortingUtilsModule.getDropData;
return (
isValidDropBinding(Reflect.apply(getDropData, ChannelSortingUtilsModule, [r10, r9, localChannel, value9,
channelList]), guild)
? (
)
: value4
);
}
function GuildSettingsModalChannelsRenderSectionHeader(a0) { // fn#122920, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16142:5498, owner: GuildSettingsModalChannels.renderSectionHeader, offset: 0x0257ac70, size: 246 bytes, params: 2, frame: 22
var r0;
var object;
const id = a0.section.category.id;
const value = environment.__proto__.__proto__;
let binding = env2_23;
const binding2 = env0_0;
const context = binding2.context;
const value3 = undefined;
const value4 = binding(context);
const {sortingType, channels} = binding2.props;
const value5 = null;
let r9 = id === 'null' ? value5 : GuildSettingsModalChannelsStore.getLocalChannel(id);
if (value5 != r9) {
binding = env2_24;
object = {category: r9};
r9 = value5 != sortingType && sortingType.has(ChannelTypes.GUILD_CATEGORY);
object.sortingEnabled = r9;
object.editStyle = value4.edit;
object.onPress = value5 == sortingType ? env0_0.handleChannelPress : value3;
r0 = ((Component) => )(binding);
} else {
r0 = 0 ? {marginTop: 36} : value5} />;
}
return r0;
}
function GuildSettingsModalChannelsRenderItem(a0) { // fn#122921, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16142:5841, owner: GuildSettingsModalChannels.renderItem, offset: 0x0257ad66, size: 124 bytes, params: 2, frame: 19
const {channel, sortingType} = a0.item;
const value = environment.__proto__.__proto__;
return (
channel != null
? (
)
: (
)
);
}
function handleHoverChange(a0) { // fn#122922, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16142:6032, owner: GuildSettingsModalChannels.handleHoverChange, offset: 0x0257ade2, size: 32 bytes, params: 2, frame: 12
env0_0.setState({hovering: a0});
}
function handleSortStart() { // fn#122923, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16142:6080, owner: GuildSettingsModalChannels.handleSortStart, offset: 0x0257ae02, size: 452 bytes, params: 1, frame: 21
var environment;
var push;
var object;
const intl = (IndexNativeModule).intl;
const t = (IndexNativeModule).t;
const guild = env0_0.props.guild;
const items2 = [];
let value = environment.__proto__.__proto__;
const permissionStoreBinding = PermissionStore;
const can = permissionStoreBinding.can;
const MANAGE_CHANNELS = Permissions.MANAGE_CHANNELS;
if (Reflect.apply(can, permissionStoreBinding, [MANAGE_CHANNELS, guild])) {
push = items2.push;
object = {};
object.label = intl.string(t.ffgJrs);
object.icon = importDefault(15937) /* metro dependency 15937 */;
object.onPress = function() {
importDefault(dependencyMap[36]).startReordering(ChannelTypes.GUILD_CATEGORY);
};
Reflect.apply(push, items2, [object]);
}
push = items2.push;
const object2 = {};
object2.label = intl.string(t.nIfr0Y);
object2.icon = importDefault(11427) /* metro dependency 11427 */;
object2.onPress = function() {
var defaultImport = importDefault(dependencyMap[36]);
var GUILD_TEXT = ChannelTypes.GUILD_TEXT;
var GUILD_ANNOUNCEMENT = ChannelTypes.GUILD_ANNOUNCEMENT;
var GUILD_FORUM = ChannelTypes.GUILD_FORUM;
defaultImport.startReordering(GUILD_TEXT, GUILD_ANNOUNCEMENT, GUILD_FORUM, ChannelTypes.GUILD_MEDIA);
};
Reflect.apply(push, items2, [object2]);
push = items2.push;
const object3 = {};
const string = intl.string;
const CYnO4s = t.CYnO4s;
object3.label = Reflect.apply(string, intl, [CYnO4s]);
object3.icon = importDefault(13761) /* metro dependency 13761 */;
object3.onPress = function() {
var defaultImport = importDefault(dependencyMap[36]);
var GUILD_VOICE = ChannelTypes.GUILD_VOICE;
defaultImport.startReordering(GUILD_VOICE, ChannelTypes.GUILD_STAGE_VOICE);
};
Reflect.apply(push, items2, [object3]);
value = require(6802) /* metro dependency 6802: showSimpleActionSheet */;
const showSimpleActionSheet = value.showSimpleActionSheet;
const object5 = {};
object5.title = intl.string(t['0dOFq+']);
Reflect.apply(showSimpleActionSheet, value, [{key: 'GuildSettingsChannelsSort', header: object5, options: items2,
hasIcons: true}]);
}
function handleDrop(a0) { // fn#122927, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16142:6732, owner: GuildSettingsModalChannels.handleDrop, offset: 0x0257b081, size: 735 bytes, params: 2, frame: 33
var r3;
var r12;
var referenceId;
var moduleValue2;
var getDnDUpdates;
var parentId;
var value8;
var parent_id;
var onCancel_1229302;
var channelStoreBinding;
var value9;
var defaultImport;
var show;
var object;
const intl = (IndexNativeModule).intl;
const t = (IndexNativeModule).t;
var format;
var property;
var object2;
var moduleValue3;
var moduleValue4;
const {order, channels, channelList, guild} = env0_0.props;
const guildSettingsModalChannelsStoreBinding = GuildSettingsModalChannelsStore;
const localChannel = guildSettingsModalChannelsStoreBinding.getLocalChannel(order[a0.from]);
const localChannel2 = guildSettingsModalChannelsStoreBinding.getLocalChannel(order[a0.to]);
const dropData = (require(15936) /* metro dependency 15936: ChannelSortingUtils */).getDropData(localChannel,
a0.from, localChannel2, a0.to, channelList);
const value5 = null;
if (value5 != dropData) {
if (localChannel2 !== localChannel) {
if (value5 != localChannel) {
if (value5 != localChannel2) {
if (isValidDrop(dropData, guild)) {
referenceId = dropData.referenceId;
moduleValue2 = require(15936) /* metro dependency 15936: ChannelSortingUtils */;
getDnDUpdates = moduleValue2.getDnDUpdates;
r3 = value5 != referenceId ? GuildSettingsModalChannelsStore.getLocalChannel(referenceId) : value5;
parentId = dropData.parentId;
value8 = Reflect.apply(getDnDUpdates, moduleValue2, [localChannel, r3, parentId,
channels]).filter(_fun122928);
parent_id = localChannel.parent_id;
parentId = dropData.parentId;
if (parent_id !== parentId) {
value8.find(_fun122929);
}
onCancel_1229302 = onCancel_122930;
if (value5 != env0_2) {
channelStoreBinding = ChannelStore;
value9 = channelStoreBinding.getChannel(env0_2.parent_id);
defaultImport = importDefault(4647) /* metro dependency 4647: AlertActionCreators */;
show = defaultImport.show;
object = {};
object.title = intl.string(t.YWMtRe);
format = intl.format;
property = t['iKW+jY'];
object2 = {};
moduleValue3 = require(4805) /* metro dependency 4805: useChannelName */;
object2.channelName = moduleValue3.computeChannelName(localChannel, UserStore,
RelationshipStore,
true);
if (value5 != value9) {
moduleValue4 = require(4805) /* metro dependency 4805: useChannelName */;
r12 = moduleValue4.computeChannelName(value9, UserStore, RelationshipStore);
} else {
r12 = '';
}
object2.categoryName = r12;
object.body = Reflect.apply(format, intl, [property, object2]);
object.confirmText = intl.string(t.eW8Gy4);
object.cancelText = intl.string(t.s4uM3b);
object.onConfirm = onConfirm_122931;
object.onCancel = onCancel_1229302;
Reflect.apply(show, defaultImport, [object]);
} else {
onCancel_1229302();
}
}
}
}
}
}
function _fun122928({id}) { // fn#122928, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16142:7061, offset: 0x0257b360, size: 141 bytes, params: 2, frame: 15
const value = environment.__proto__.__proto__.__proto__;
const channel = ChannelStore.getChannel(id);
if (channel == null) {
return false;
}
const channel2 = ChannelStore.getChannel(channel.parent_id);
const type = channel.type;
const GUILD_CATEGORY = ChannelTypes.GUILD_CATEGORY;
return type === GUILD_CATEGORY || channel2 == null ? PermissionStore.can(Permissions.MANAGE_CHANNELS,
guild) : PermissionStore.can(Permissions.MANAGE_CHANNELS, channel2);
}
function _fun122929(a0) { // fn#122929, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16142:7279, offset: 0x0257b3ed, size: 244 bytes, params: 2, frame: 21
var r2;
var moduleValue;
var areChannelsLocked;
var binding;
var value4;
var moduleValue2;
var value5;
if (a0.id !== env0_1.id) {
return false;
}
let channelStoreBinding = ChannelStore;
let getChannel = channelStoreBinding.getChannel;
let parent_id = a0.parent_id;
const value3 = Reflect.apply(getChannel, channelStoreBinding, [parent_id]);
if (value3 != null) {
var can = PermissionStore.can;
var MANAGE_ROLES = Permissions.MANAGE_ROLES;
if (Reflect.apply(can, permissionStoreBinding, [MANAGE_ROLES, env0_1])) {
permissionStoreBinding = PermissionStore;
if (permissionStoreBinding.can(Permissions.MANAGE_ROLES, value3)) {
moduleValue = importAll(3789) /* metro dependency 3789: PermissionUtils */;
areChannelsLocked = moduleValue.areChannelsLocked;
binding = env0_1;
value4 = Reflect.apply(areChannelsLocked, moduleValue, [binding, value3]);
moduleValue2 = importAll(3789) /* metro dependency 3789: PermissionUtils */;
areChannelsLocked = moduleValue2.areChannelsLocked;
channelStoreBinding = ChannelStore;
getChannel = channelStoreBinding.getChannel;
parent_id = binding.parent_id;
value5 = Reflect.apply(areChannelsLocked, moduleValue2, [binding, Reflect.apply(getChannel,
channelStoreBinding,
[parent_id])]);
parent_id = binding.parent_id;
r2 = parent_id == null && !value4;
r2 = !r2 ? value5 && !value4 : r2;
if (r2) {
env0_2 = a0;
}
return true;
}
return true;
}
}
return true;
}
function handleDropOnCancel() { // fn#122930, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16142:7574, owner: GuildSettingsModalChannels.handleDrop.onCancel, offset: 0x0257b4e1, size: 82 bytes, params: 1, frame: 16
let value = environment.__proto__.__proto__.__proto__;
(GuildSettingsModalChannelsActionCreators).localChannelUpdate(env0_3);
value = importDefault(6593) /* metro dependency 6593: GuildActionCreators */;
value.batchChannelUpdate(env0_1.guild_id, env0_3);
}
function handleDropOnConfirm() { // fn#122931, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16142:8030, owner: GuildSettingsModalChannels.handleDrop.onConfirm, offset: 0x0257b533, size: 27 bytes, params: 1, frame: 10
env0_2.lock_permissions = true;
onCancel_122930();
}
}
}
function value_122934(a0) { // fn#122934, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16142:8356, offset: 0x0257b54e, size: 311 bytes, params: 2, frame: 24
var environment;
var r7;
var r4;
var setOptions;
var object;
var moduleValue;
var intl;
const value = environment.__proto__;
const binding = env1_23;
const context = this.context;
const value2 = undefined;
const env0_1 = binding(context);
const {sortingType, order, navigation, guild, channels, user} = this.props;
let r1 = a0 != null && sortingType === a0.sortingType && order === a0.order;
r1 = r1 && guild === a0.guild && channels === a0.channels;
if (!r1) {
setOptions = navigation.setOptions;
object = {};
object.headerLeft = sortingType != null ? function() {
return null;
} : value2;
if (sortingType != null) {
r7 = _fun122936;
} else {
moduleValue = importAll(3789) /* metro dependency 3789: PermissionUtils */;
r7 = moduleValue.canManageACategory(user, guild, channels._categories) ? _fun122937 : value2;
}
object.headerRight = r7;
if (sortingType != null) {
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
r4 = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.OGiMXJ);
} else {
r4 = value2;
}
object.headerTitle = r4;
Reflect.apply(setOptions, navigation, [object]);
}
return value2;
function _fun122936() { // fn#122936, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16142:8615, offset: 0x0257b685, size: 130 bytes, params: 1, frame: 19
const HeaderActionButton = (HeaderActionButtonNativeModule).HeaderActionButton;
const headerRight = env0_1.headerRight;
const intl = (IndexNativeModule).intl;
return (
);
}
function _fun122937() { // fn#122937, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16142:8796, offset: 0x0257b707, size: 128 bytes, params: 1, frame: 19
const HeaderActionButton = (HeaderActionButtonNativeModule).HeaderActionButton;
const headerRight = env0_1.headerRight;
const intl = (IndexNativeModule).intl;
return (
);
}
}
function value_122938() { // fn#122938, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16142:9032, offset: 0x0257b787, size: 355 bytes, params: 1, frame: 25
const value2 = env1_23(this.context);
const {channels, order, sortingType, guild} = this.props;
const value3 = ((a0, a1, a2) => {
var env0_0 = a0;
var env0_1 = a1;
var env0_2 = a2;
if (a0 != null) {
var env0_4 = -1;
a0._categories.forEach(_fun122940);
}
return [];
})(channels, sortingType, this.state.hovering);
const containerView = value2.containerView;
const renderSectionHeader = this.renderSectionHeader;
const renderItem = this.renderItem;
const handleDrop = this.handleDrop;
const items2 = [NULL_STRING_CHANNEL_ID];
arraySpread(items2, order, 1, order);
const sortableChannels = (
);
const r6 = sortingType == null && ;
const NavScrim = (NavScrimAndroidModule).NavScrim;
return (
{sortableChannels}
{r6}
);
function getListViewData(a0, a1, a2) { // fn#122939, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16142:9129, owner: value_122938.getListViewData, offset: 0x0257b8ea, size: 74 bytes, params: 4, frame: 12
const env0_0 = a0;
const env0_1 = a1;
const env0_2 = a2;
if (a0 != null) {
a0._categories.forEach(_fun122940);
}
return [];
function _fun122940({channel}) { // fn#122940, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16142:9229, offset: 0x0257b934, size: 160 bytes, params: 2, frame: 15
var environment;
var value;
var permissionStoreBinding;
var value2;
var object;
var binding;
let id = channel.id;
if (id === 'null') {
value2 = ClassCallCheck + 1;
object = {data: [], category: channel};
id = channel.id;
object.key = id;
object.index = value2;
binding = object;
id = channel.id;
binding[id].forEach(_fun122941);
binding = env0_3;
binding.push(object);
} else {
value = environment.__proto__.__proto__.__proto__;
permissionStoreBinding = PermissionStore;
if (permissionStoreBinding.can(Permissions.VIEW_CHANNEL, channel)) {
value2 = ClassCallCheck + 1;
object = {data: [], category: channel};
id = channel.id;
object.key = id;
object.index = value2;
binding = object;
id = channel.id;
binding[id].forEach(_fun122941);
binding = env0_3;
binding.push(object);
}
}
function _fun122941({channel}) { // fn#122941, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16142:9354, offset: 0x0257b9d4, size: 135 bytes, params: 2, frame: 14
var binding;
var value4;
var data;
var push;
var object;
var id;
if (require == null || require.has(channel.type)) {
binding = env1_4;
value4 = typeof binding === 'bigint' ? binding + 1n : +binding + 1;
data = env0_0.data;
push = data.push;
object = {};
id = channel.id;
object.key = id;
object.channel = channel;
object.sortingType = require;
id = channel.id;
object.isHovered = importDefault === id;
object.index = value4;
Reflect.apply(push, data, [object]);
}
}
}
}
}
function value_122942(a0) { // fn#122942, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16142:9992, offset: 0x0257ba5b, size: 41 bytes, params: 2, frame: 12
const value = environment.__proto__;
(ChannelSettingsActionCreatorsModule).open(a0);
}
function value_122943() { // fn#122943, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16142:10051, offset: 0x0257ba84, size: 37 bytes, params: 1, frame: 11
const value = environment.__proto__;
(GuildSettingsModalChannelsActionCreators).stopReordering();
}
}
function GuildSettingsModalChannelsConnected({guildId, contentContainerStyle}) { // fn#122944, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16142:10252, offset: 0x0257baa9, size: 485 bytes, params: 2, frame: 26
const value2 = (UseNavigationNativeModule).useNavigation();
let useStateFromStores = FluxModule.useStateFromStores;
const guild = Reflect.apply(useStateFromStores, FluxModule, [[GuildStore], function() {
return GuildStore.getGuild(guildId);
}]);
useStateFromStores = FluxModule.useStateFromStores;
const guildSettingsModalChannelsStoreBinding = GuildSettingsModalChannelsStore;
const channels = Reflect.apply(useStateFromStores, FluxModule, [[guildSettingsModalChannelsStoreBinding],
function() {
return GuildSettingsModalChannelsStore.channels;
}]);
const currentUser = FluxModule.useStateFromStores([UserStore], _fun122947);
const channelList = FluxModule.useStateFromStores([guildSettingsModalChannelsStoreBinding], function() {
return GuildSettingsModalChannelsStore.channelList;
});
const order = FluxModule.useStateFromStores([guildSettingsModalChannelsStoreBinding], function() {
return GuildSettingsModalChannelsStore.order;
});
const sortingType = FluxModule.useStateFromStores([guildSettingsModalChannelsStoreBinding], function() {
return GuildSettingsModalChannelsStore.sortingType;
});
const value3 = (UseSafeAreaInsetsNative)();
const binding = env0_9;
const useMemo = binding.useMemo;
return (
order == null || channelList == null || (channels == null || guild == null) || currentUser == null
? null
: ((Component) => )(env0_26)
);
function _fun122947() { // fn#122947, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16142:10507, offset: 0x0257bcb8, size: 58 bytes, params: 1, frame: 14
const value = environment.__proto__;
const currentUser = UserStore.getCurrentUser();
(Module00044)(currentUser != null,
'GuildSettingsModalChannelsConnected: currentUser cannot be undefined');
return currentUser;
}
function _fun122951() { // fn#122951, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16142:10823, offset: 0x0257bd1f, size: 70 bytes, params: 1, frame: 5
return sortingType == null ? [contentContainerStyle,
{paddingBottom: env0_3.bottom + 32 + 44}] : contentContainerStyle;
}
}
}
global.__d(_fun122895, 15934, [6, 7, 15, 17, 18, 31, 27, 1379, 1867, 3784, 3793, 1878, 15860, 661, 33, 4501, 6597,
697, 1244, 4002, 673, 7972, 1305, 15935, 3868, 566, 6647, 4805, 5278, 1585, 4578, 6802, 9087, 10083, 15936,
15937, 15858, 11427, 13761, 3789, 6593, 4647, 5277, 15938, 5462, 8148, 1484, 44, 4584,
2]) /* metro module 15934, dependencies: [6, 7, 15, 17, 18, 31, 27, 1379, 1867, 3784, 3793, 1878, 15860, 661, 33, 4501, 6597, 697, 1244, 4002, 673, 7972, 1305, 15935, 3868, 566, 6647, 4805, 5278, 1585, 4578, 6802, 9087, 10083, 15936, 15937, 15858, 11427, 13761, 3789, 6593, 4647, 5277, 15938, 5462, 8148, 1484, 44, 4584, 2] */;