decord/source/modules/connectivity/native/components/GlobalStatusContent.tsx

135 lines
4.9 KiB
TypeScript
Raw Normal View History

// Module ID: 9717
// Function ID: 9718
// Name: GlobalStatusContent
// Dependencies: [19, 17, 1957, 1979, 4597, 4592, 9712, 1074, 21, 4574, 576, 9247, 504, 9615, 9710, 4425, 4509, 5140, 4431, 9498, 1115, 1611, 9513, 9718, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
// Module 9717 (GlobalStatusContent)
import nativeDefault from "native" /* 576 */;
import useThemeDefault from "useTheme" /* 4509 */;
import useVoiceStateForRemoteSessionDefault from "useVoiceStateForRemoteSession" /* 9247 */;
import useCanSpeakInChannelDefault from "useCanSpeakInChannel" /* 9615 */;
import useIsInvitedToSpeakDefault from "useIsInvitedToSpeak" /* 9710 */;
import noop from "module_19" /* 19 */;
import ChannelStore from "ChannelStore" /* 1957 */;
import GuildStore from "GuildStore" /* 1979 */;
import RTCConnectionStore from "RTCConnectionStore" /* 4597 */;
import SessionsStore from "SessionsStore" /* 4592 */;
2026-07-23 10:11:24 +00:00
const require = globalThis.__r;
const require = fn;
const View = fn(17).View;
const RTC_PANEL_HEIGHT = fn(9712).RTC_PANEL_HEIGHT;
const RTCConnectionStates = fn(1074).RTCConnectionStates;
const jsxProd = fn(21);
({ jsx: c10, jsxs: closure_11 } = jsxProd);
const createStyles = fn(4574);
let obj2 = { bgNeutral: { backgroundColor: nativeDefault.colors.BACKGROUND_BASE_LOWEST }, bg: null, container: null };
const obj3 = { backgroundColor: nativeDefault.colors.BACKGROUND_BASE_LOWEST };
obj2.bg = { backgroundColor: nativeDefault.unsafe_rawColors.GREEN_360 };
obj2.container = { paddingHorizontal: 16, alignItems: "center", justifyContent: "center" };
let closure_12 = createStyles.createStyles(obj2);
const size = fn(2);
const result = size.fileFinishedImporting("modules/connectivity/native/components/GlobalStatusContent.tsx");
2026-07-20 16:05:17 +00:00
export default function ConnectivityGlobalStatusContent() {
const tmp = closure_12();
2026-08-24 06:08:38 +00:00
const tmp4 = useVoiceStateForRemoteSessionDefault();
_require = tmp4;
const items = [RTCConnectionStore, GuildStore, ChannelStore, SessionsStore];
2026-07-29 08:29:29 +00:00
const items1 = [tmp4];
const stateFromStoresObject = require("initialize").useStateFromStoresObject(items, () => {
2026-07-20 16:05:17 +00:00
let channelId;
2026-07-29 08:29:29 +00:00
if (closure_0 != null) {
2026-07-20 16:05:17 +00:00
channelId = tmp2.channelId;
}
2026-07-29 08:29:29 +00:00
if (channelId == null) {
channelId = RTCConnectionStore.getChannelId();
2026-07-20 16:05:17 +00:00
}
const channel = ChannelStore.getChannel(channelId);
2026-07-29 08:29:29 +00:00
if (null != closure_0) {
2026-07-20 16:05:17 +00:00
let guildId;
2026-07-29 08:29:29 +00:00
if (channel != null) {
2026-07-20 16:05:17 +00:00
guildId = channel.getGuildId();
}
let guildId1 = guildId;
} else {
guildId1 = RTCConnectionStore.getGuildId();
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let str;
const guild = GuildStore.getGuild(guildId1);
2026-07-29 08:29:29 +00:00
if (closure_0 != null) {
str = tmp2.sessionId;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (str == null) {
str = "";
2026-07-20 16:05:17 +00:00
}
const sessionById = SessionsStore.getSessionById(str);
2026-07-20 16:05:17 +00:00
let os;
2026-07-29 08:29:29 +00:00
if (sessionById != null) {
2026-07-20 16:05:17 +00:00
os = sessionById.clientInfo.os;
}
2026-07-29 08:29:29 +00:00
const obj = { guild, channel, rtcConnectionState: null, remotePlatform: null };
if (null != closure_0) {
let RTC_CONNECTED = RTCConnectionStates.RTC_CONNECTED;
2026-07-20 16:05:17 +00:00
} else {
RTC_CONNECTED = RTCConnectionStore.getState();
2026-07-20 16:05:17 +00:00
}
obj.rtcConnectionState = RTC_CONNECTED;
obj.remotePlatform = os;
2026-07-20 16:05:17 +00:00
return obj;
}, items1);
2026-07-23 10:11:24 +00:00
let channel = stateFromStoresObject.channel;
2026-07-20 16:05:17 +00:00
let isGuildStageVoiceResult;
({ guild, rtcConnectionState, remotePlatform } = stateFromStoresObject);
2026-07-29 08:29:29 +00:00
if (channel != null) {
2026-07-20 16:05:17 +00:00
isGuildStageVoiceResult = channel.isGuildStageVoice();
}
let id;
let obj = require("initialize");
2026-07-29 08:29:29 +00:00
if (channel != null) {
2026-07-20 16:05:17 +00:00
id = channel.id;
}
let tmp2ResultResult = useCanSpeakInChannelDefault(id);
const tmp2Result = useCanSpeakInChannelDefault;
2026-08-24 06:08:38 +00:00
const tmp11 = useIsInvitedToSpeakDefault();
let tmp14 = tmp12;
const tmp5Result = require("shared");
2026-07-20 16:05:17 +00:00
if (isGuildStageVoiceResult) {
2026-07-29 08:29:29 +00:00
if (!tmp2ResultResult) {
tmp2ResultResult = tmp11;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp14 = tmp2ResultResult;
2026-07-20 16:05:17 +00:00
}
const isThemeDarkResult = require("shared").isThemeDark(useThemeDefault());
let isScreenLandscape = require("useIsScreenLandscape").useIsScreenLandscape();
2026-07-20 16:05:17 +00:00
if (isScreenLandscape) {
isScreenLandscape = tmp5(4431).isModalOpen(tmp2(9498));
const tmp5Result5 = tmp5(4431);
2026-07-20 16:05:17 +00:00
}
if (isScreenLandscape) {
isScreenLandscape = tmp5(1115).isAndroid();
const tmp5Result6 = tmp5(1115);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let num = 0;
2026-07-20 16:05:17 +00:00
if (!isScreenLandscape) {
num = tmp2(1611)().top;
2026-07-20 16:05:17 +00:00
}
const obj2 = { style: null, children: null };
const items2 = [tmp14 ? tmp.bg : tmp.bgNeutral, tmp.container, { minHeight: RTC_PANEL_HEIGHT + num, paddingTop: num }];
obj2.style = items2;
2026-07-20 16:05:17 +00:00
if (isScreenLandscape) {
isScreenLandscape = closure_10(tmp2(9513), { hidden: true });
2026-07-20 16:05:17 +00:00
}
const items3 = [isScreenLandscape, ];
2026-07-29 08:29:29 +00:00
let tmp19 = null;
2026-07-20 16:05:17 +00:00
if (isGuildStageVoiceResult) {
const obj4 = { channel, guild, hasRTCConnectivity: tmp12, isDarkTheme: isThemeDarkResult, rtcConnectionState, remotePlatform };
tmp19 = closure_10(tmp2(9718), obj4);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
items3[1] = tmp19;
obj2.children = items3;
return closure_11(View, obj2);
2026-07-20 16:05:17 +00:00
};