decord/alpha/source/components_native/ChannelContainer.tsx

384 lines
12 KiB
TypeScript
Raw Permalink Normal View History

2026-10-13 12:43:34 +00:00
// Module ID: 13073
// Function ID: 13074
// Name: ChannelContainer
2026-10-13 12:43:34 +00:00
// Dependencies: [19, 17, 4751, 2065, 2116, 1085, 2062, 21, 5092, 558, 576, 4979, 13074, 504, 10849, 5922, 4938, 2049, 13193, 13194, 11038, 2]
2026-07-20 16:05:17 +00:00
2026-10-13 12:43:34 +00:00
// Module 13073 (ChannelContainer)
2026-10-03 08:58:59 +00:00
import react_native from "react-native" /* 17 */;
import get_initialized from "get initialized" /* 504 */;
import react2 from "react" /* 576 */;
import Constants from "Constants" /* 1085 */;
2026-10-09 10:00:15 +00:00
import dismissible_content from "dismissible_content" /* 2049 */;
2026-10-10 08:08:14 +00:00
import DismissibleContentConstants from "DismissibleContentConstants" /* 2062 */;
import DismissibleContentUnsafeUtils from "DismissibleContentUnsafeUtils" /* 4938 */;
import useChatLayoutDefault from "useChatLayout" /* 4979 */;
2026-10-03 08:58:59 +00:00
import react_mod from "react" /* 19 */;
2026-10-10 08:08:14 +00:00
import LurkingStore from "LurkingStore" /* 4751 */;
import ChannelStore from "ChannelStore" /* 2065 */;
import SelectedChannelStore from "SelectedChannelStore" /* 2116 */;
2026-10-03 08:58:59 +00:00
import Fragment from "Fragment" /* 21 */;
2026-10-10 08:08:14 +00:00
import createStyles from "createStyles" /* 5092 */;
2026-10-03 08:58:59 +00:00
import ReactCompilerGating_mod from "ReactCompilerGating" /* 558 */;
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
2026-10-08 09:57:35 +00:00
let dependencyMap;
2026-10-03 08:58:59 +00:00
let c10;
let tmp;
let tmp4;
let unpackModuleId;
2026-10-13 12:43:34 +00:00
const common_NotificationsDefault = tmp4(13074);
const useChannelStylesShared = tmp(13193);
2026-10-03 08:58:59 +00:00
let react = react_mod;
const View = react_native.View;
const ChannelTypes = Constants.ChannelTypes;
const ContentDismissActionType = DismissibleContentConstants.ContentDismissActionType;
({ jsx: c10, jsxs: unpackModuleId } = Fragment);
let closure_12 = createStyles.createStyles({ container: { position: "absolute", left: 0, right: 0, backgroundColor: "transparent", marginTop: 8 } });
let ReactCompilerGating = ReactCompilerGating_mod;
2026-10-08 09:57:35 +00:00
let closure_13 = ReactCompilerGating.isReactCompilerEnabled() ? (function NotificationsContainer() {
2026-10-03 08:58:59 +00:00
const obj = react2;
const cResult = obj.c(3);
const tmp3 = closure_12();
let tmp5 = null;
if (useChatLayoutDefault().isChatBesideChannelList) {
let first;
let tmp10;
const _Symbol = Symbol;
if (cResult[0] === Symbol.for("react.memo_cache_sentinel")) {
const tmp9 = authStore(common_NotificationsDefault, {});
cResult[0] = tmp9;
first = tmp9;
} else {
first = cResult[0];
}
if (cResult[1] !== tmp3.container) {
const obj2 = { style: tmp3.container, children: first };
const tmp13 = authStore(View, obj2);
cResult[1] = tmp3.container;
cResult[2] = tmp13;
tmp10 = tmp13;
} else {
tmp10 = cResult[2];
}
tmp5 = tmp10;
}
return tmp5;
2026-10-08 09:57:35 +00:00
}) : (function NotificationsContainer() {
2026-07-29 08:29:29 +00:00
let tmp4 = null;
2026-10-03 08:58:59 +00:00
const tmp = closure_12();
2026-08-24 06:08:38 +00:00
if (useChatLayoutDefault().isChatBesideChannelList) {
2026-10-03 08:58:59 +00:00
const obj = { style: tmp.container, children: authStore(common_NotificationsDefault, {}) };
tmp4 = authStore(View, obj);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp4;
2026-10-03 08:58:59 +00:00
});
ReactCompilerGating = ReactCompilerGating_mod;
2026-10-08 09:57:35 +00:00
let tmp3 = ReactCompilerGating.isReactCompilerEnabled() ? (function ChannelContainer(guildId) {
2026-10-03 08:58:59 +00:00
let channel;
let closure_2;
let closure_3;
let first;
let isStageChannel;
let items2;
let items3;
let tmp11;
let tmp13;
let tmp15;
let tmp7;
let tmp = guildId;
let tmp2 = dependencyMap;
let obj = guildId(576);
const cResult = obj.c(29);
guildId = guildId.guildId;
const channelId = guildId.channelId;
const children = guildId.children;
if (cResult[0] === Symbol.for("react.memo_cache_sentinel")) {
const items = [SelectedChannelStore, ];
items[1] = ChannelStore;
cResult[0] = items;
first = items;
} else {
first = cResult[0];
}
if (cResult[1] !== channelId) {
const fn = function f() {
let _Boolean;
let isGuildStageVoiceResult;
const voiceChannelId = SelectedChannelStore.getVoiceChannelId();
const obj = { channel: ChannelStore.getChannel(channelId), voiceChannelId, isStageChannel: _Boolean(isGuildStageVoiceResult) };
_Boolean = Boolean;
const channel = ChannelStore.getChannel(voiceChannelId);
isGuildStageVoiceResult = undefined;
if (channel != null) {
isGuildStageVoiceResult = channel.isGuildStageVoice();
}
return obj;
};
cResult[1] = channelId;
cResult[2] = fn;
tmp7 = fn;
} else {
tmp7 = cResult[2];
}
const tmpResult = tmp(504);
const stateFromStoresObject = tmpResult.useStateFromStoresObject(first, tmp7);
({ channel, isStageChannel } = stateFromStoresObject);
let voiceChannelId = stateFromStoresObject.voiceChannelId;
let tmp10 = !isStageChannel;
if (isStageChannel) {
2026-10-10 08:08:14 +00:00
tmp10 = channelId(10849)(voiceChannelId);
2026-10-03 08:58:59 +00:00
}
if (cResult[3] === Symbol.for("react.memo_cache_sentinel")) {
const items1 = [LurkingStore];
cResult[3] = items1;
tmp11 = items1;
} else {
tmp11 = cResult[3];
}
if (cResult[4] !== guildId) {
const fn2 = function p() {
const isLurkingResult = null != guildId && LurkingStore.isLurking(tmp);
return isLurkingResult;
};
cResult[4] = guildId;
cResult[5] = fn2;
tmp13 = fn2;
} else {
tmp13 = cResult[5];
}
const tmpResult3 = tmp(504);
const stateFromStores = tmpResult3.useStateFromStores(tmp11, tmp13);
if (cResult[6] !== channel) {
const tmp17 = null != channel && channel.isPrivate();
cResult[6] = channel;
cResult[7] = tmp17;
tmp15 = tmp17;
} else {
tmp15 = cResult[7];
}
dependencyMap = tmp15;
2026-10-10 08:08:14 +00:00
const tmp18 = channelId(5922)(tmp15);
2026-10-03 08:58:59 +00:00
react = tmp18;
2026-10-10 08:08:14 +00:00
const tmp19 = channelId(5922)(channelId);
2026-10-03 08:58:59 +00:00
let closure_4 = tmp19;
if (cResult[8] === channelId) {
if (cResult[9] === tmp15) {
if (cResult[10] === tmp19) {
let tmp20;
let tmp21;
if (cResult[11] === tmp18) {
tmp20 = cResult[12];
tmp21 = cResult[13];
}
const effect = react.useEffect(tmp20, tmp21);
2026-10-13 12:43:34 +00:00
const tmpResult4 = tmp(13193);
2026-10-03 08:58:59 +00:00
const channelStyles = tmpResult4.useChannelStyles();
if (cResult[14] === channel) {
let tmp25;
if (cResult[15] === stateFromStores) {
tmp25 = cResult[16];
}
if (cResult[17] === channelStyles.callPTTButton) {
let tmp31;
if (cResult[18] === tmp10) {
tmp31 = cResult[19];
}
if (cResult[20] === channelStyles.flex) {
if (cResult[21] === children) {
if (cResult[22] === tmp25) {
let tmp34;
let tmp38;
if (cResult[23] === tmp31) {
tmp34 = cResult[24];
}
const _Symbol = Symbol;
if (cResult[25] === Symbol.for("react.memo_cache_sentinel")) {
const tmp41 = closure_10(closure_13, {});
cResult[25] = tmp41;
tmp38 = tmp41;
} else {
tmp38 = cResult[25];
}
if (cResult[26] === channelStyles.scene) {
let tmp42;
if (cResult[27] === tmp34) {
tmp42 = cResult[28];
}
return tmp42;
}
let obj2 = { style: channelStyles.scene, children: items2 };
items2 = [tmp34, tmp38];
const tmp45 = closure_11(closure_4, obj2);
cResult[26] = channelStyles.scene;
cResult[27] = tmp34;
cResult[28] = tmp45;
tmp42 = tmp45;
}
}
}
const obj3 = { style: channelStyles.flex, children: items3 };
items3 = [tmp25, children, tmp31];
const tmp37 = closure_11(closure_4, obj3);
cResult[20] = channelStyles.flex;
cResult[21] = children;
cResult[22] = tmp25;
cResult[23] = tmp31;
cResult[24] = tmp37;
tmp34 = tmp37;
}
let tmp32 = tmp10;
if (tmp32) {
const obj4 = { style: channelStyles.callPTTButton };
2026-10-10 08:08:14 +00:00
tmp32 = closure_10(tmp9(11038), obj4);
2026-10-03 08:58:59 +00:00
}
cResult[17] = channelStyles.callPTTButton;
cResult[18] = tmp10;
cResult[19] = tmp32;
tmp31 = tmp32;
}
let type;
if (channel != null) {
type = channel.type;
}
let tmp29 = null;
if (type === ChannelTypes.GUILD_ANNOUNCEMENT) {
tmp29 = null;
if (stateFromStores) {
const obj5 = { channel };
2026-10-13 12:43:34 +00:00
tmp29 = closure_10(tmp9(13194), obj5);
2026-10-03 08:58:59 +00:00
}
}
cResult[14] = channel;
cResult[15] = stateFromStores;
cResult[16] = tmp29;
tmp25 = tmp29;
}
}
}
const fn3 = function x() {
let tmp = closure_3;
let tmp2 = closure_3 && !closure_2;
if (!tmp2) {
if (tmp) {
tmp = closure_2;
}
if (tmp) {
tmp = channelId !== closure_4;
}
tmp2 = tmp;
}
if (tmp2) {
const obj2 = { dismissAction: ContentDismissActionType.AUTO };
const obj = DismissibleContentUnsafeUtils;
const result = obj.UNSAFE_markDismissibleContentAsDismissed(dismissible_content.DismissibleContent.ACTIVITY_GDM_CALL_TOOLTIP, obj2);
}
};
const items4 = [channelId, tmp19, tmp15, tmp18];
cResult[8] = channelId;
cResult[9] = tmp15;
cResult[10] = tmp19;
cResult[11] = tmp18;
cResult[12] = fn3;
cResult[13] = items4;
tmp21 = items4;
tmp20 = fn3;
2026-10-08 09:57:35 +00:00
}) : (function ChannelContainer(children) {
2026-10-03 08:58:59 +00:00
let c2;
let channel;
let channelId;
let closure_3;
let isStageChannel;
let items3;
let items4;
2026-07-23 10:11:24 +00:00
({ guildId: require, channelId } = children);
2026-08-24 06:08:38 +00:00
dependencyMap = undefined;
2026-10-03 08:58:59 +00:00
react = undefined;
let closure_4;
let tmp = require;
let tmp2 = dependencyMap;
children = children.children;
let obj = get_initialized;
const items = [SelectedChannelStore, ChannelStore];
2026-10-03 08:58:59 +00:00
const stateFromStoresObject = obj.useStateFromStoresObject(items, () => {
let _Boolean;
let isGuildStageVoiceResult;
const voiceChannelId = SelectedChannelStore.getVoiceChannelId();
2026-10-03 08:58:59 +00:00
const obj = { channel: ChannelStore.getChannel(channelId), voiceChannelId, isStageChannel: _Boolean(isGuildStageVoiceResult) };
_Boolean = Boolean;
const channel = ChannelStore.getChannel(voiceChannelId);
2026-10-03 08:58:59 +00:00
isGuildStageVoiceResult = undefined;
2026-07-29 08:29:29 +00:00
if (channel != null) {
2026-07-20 16:05:17 +00:00
isGuildStageVoiceResult = channel.isGuildStageVoice();
}
return obj;
});
2026-07-29 08:29:29 +00:00
({ channel, isStageChannel } = stateFromStoresObject);
2026-10-03 08:58:59 +00:00
let voiceChannelId = stateFromStoresObject.voiceChannelId;
2026-07-29 08:29:29 +00:00
let tmp5 = !isStageChannel;
if (isStageChannel) {
2026-10-10 08:08:14 +00:00
tmp5 = channelId(10849)(voiceChannelId);
2026-07-29 08:29:29 +00:00
}
const items1 = [LurkingStore];
2026-07-20 16:05:17 +00:00
let isPrivateResult = null != channel;
2026-10-03 08:58:59 +00:00
const tmpResult = get_initialized;
const stateFromStores = tmpResult.useStateFromStores(items1, () => {
const isLurkingResult = null != require && LurkingStore.isLurking(tmp);
2026-07-20 16:05:17 +00:00
return isLurkingResult;
});
if (isPrivateResult) {
isPrivateResult = channel.isPrivate();
}
dependencyMap = isPrivateResult;
2026-10-10 08:08:14 +00:00
const tmp8 = channelId(5922)(isPrivateResult);
2026-10-03 08:58:59 +00:00
react = tmp8;
2026-10-10 08:08:14 +00:00
const tmp9 = channelId(5922)(channelId);
2026-08-24 06:08:38 +00:00
closure_4 = tmp9;
2026-07-29 08:29:29 +00:00
const items2 = [channelId, tmp9, isPrivateResult, tmp8];
2026-10-03 08:58:59 +00:00
const effect = react.useEffect(() => {
2026-08-24 06:08:38 +00:00
let tmp = closure_3;
2026-10-03 08:58:59 +00:00
let tmp2 = closure_3 && !c2;
2026-07-29 08:29:29 +00:00
if (!tmp2) {
if (tmp) {
tmp = c2;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp) {
2026-08-24 06:08:38 +00:00
tmp = channelId !== closure_4;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp2 = tmp;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp2) {
const obj2 = { dismissAction: ContentDismissActionType.AUTO };
2026-10-03 08:58:59 +00:00
const obj = DismissibleContentUnsafeUtils;
const result = obj.UNSAFE_markDismissibleContentAsDismissed(dismissible_content.DismissibleContent.ACTIVITY_GDM_CALL_TOOLTIP, obj2);
2026-07-20 16:05:17 +00:00
}
}, items2);
2026-10-03 08:58:59 +00:00
const tmpResult2 = useChannelStylesShared;
const channelStyles = tmpResult2.useChannelStyles();
let obj2 = { style: channelStyles.scene, children: items4 };
2026-07-20 16:05:17 +00:00
let type;
2026-10-03 08:58:59 +00:00
const obj3 = { style: channelStyles.flex, children: items3 };
2026-07-29 08:29:29 +00:00
if (channel != null) {
2026-07-20 16:05:17 +00:00
type = channel.type;
}
2026-07-29 08:29:29 +00:00
let tmp15 = null;
2026-07-20 16:05:17 +00:00
if (type === ChannelTypes.GUILD_ANNOUNCEMENT) {
2026-07-29 08:29:29 +00:00
tmp15 = null;
2026-07-20 16:05:17 +00:00
if (stateFromStores) {
const obj4 = { channel };
2026-10-13 12:43:34 +00:00
tmp15 = closure_10(tmp4(13194), obj4);
2026-07-20 16:05:17 +00:00
}
}
2026-10-03 08:58:59 +00:00
items3 = [tmp15, children, ];
2026-07-29 08:29:29 +00:00
if (tmp5) {
const obj5 = { style: channelStyles.callPTTButton };
2026-10-10 08:08:14 +00:00
tmp5 = closure_10(tmp4(11038), obj5);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
items3[2] = tmp5;
2026-10-03 08:58:59 +00:00
items4 = [closure_11(closure_4, obj3), closure_10(closure_13, {})];
return closure_11(closure_4, obj2);
2026-10-03 08:58:59 +00:00
});
let result = size.fileFinishedImporting("components_native/ChannelContainer.tsx");
export const ChannelContainer = tmp3;