decord/source/modules/soundplayer/SoundPlayer.tsx

754 lines
28 KiB
TypeScript
Raw Normal View History

2026-08-05 07:35:12 +00:00
// Module ID: 15848
// Function ID: 15849
2026-07-29 08:29:29 +00:00
// Name: MuteDeafen
2026-08-05 07:35:12 +00:00
// Dependencies: [19, 1371, 10478, 4269, 15849, 1376, 4274, 1218, 1372, 1862, 4302, 9639, 4326, 1931, 5089, 4271, 4327, 676, 21, 589, 9665, 4439, 4318, 3873, 1351, 5762, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-05 07:35:12 +00:00
// Module 15848 (MuteDeafen)
2026-08-03 11:20:01 +00:00
import initialize from "initialize";
2026-07-29 08:29:29 +00:00
import participantFromServer from "participantFromServer";
import { NO_ACTIVITIES } from "participantFromServer";
import map from "map";
import set from "set";
2026-08-03 11:20:01 +00:00
import handleProjectUpsert from "handleProjectUpsert";
2026-07-29 08:29:29 +00:00
import { SILENT_JOIN_LEAVE_CHANNEL_TYPES as closure_8 } from "createChannelRecord";
import reset from "reset";
import fetchFingerprint from "fetchFingerprint";
import ensureGuildLoaded from "ensureGuildLoaded";
import createGuildRecordFromRust from "createGuildRecordFromRust";
import _detectH265HardwareDecode from "_detectH265HardwareDecode";
import DesktopNotificationTypes from "DesktopNotificationTypes";
import createRTCConnection from "createRTCConnection";
import handleConnectionOpen from "handleConnectionOpen";
import anyoneHasFlagInContext from "anyoneHasFlagInContext";
import updateVoiceState from "updateVoiceState";
import getVoiceStatesForGuild from "getVoiceStatesForGuild";
2026-07-23 10:11:24 +00:00
import ME from "ME";
2026-08-03 11:20:01 +00:00
import jsxProd from "useAudienceRequestToSpeakState";
2026-07-23 10:11:24 +00:00
let closure_20;
let closure_21;
let closure_22;
2026-08-03 11:20:01 +00:00
let closure_23;
2026-07-23 10:11:24 +00:00
let closure_24;
2026-07-25 08:10:48 +00:00
let closure_25;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-20 16:05:17 +00:00
function MuteDeafen() {
2026-07-29 08:29:29 +00:00
const items = [_detectH265HardwareDecode, handleConnectionOpen];
2026-08-05 07:35:12 +00:00
const f98091 = () => ({ inVoiceChannel: null != voiceChannelId.getVoiceChannelId(), selfMute: _detectH265HardwareDecode.isSelfMute(), selfDeaf: _detectH265HardwareDecode.isSelfDeaf(), audioPermissionReady: _detectH265HardwareDecode.isNativeAudioPermissionReady(), shouldSkipMuteUnmuteSound: _detectH265HardwareDecode.shouldSkipMuteUnmuteSound() });
const f98092 = (selfDeaf) => {
2026-07-20 16:05:17 +00:00
let inVoiceChannel;
let selfMute;
({ inVoiceChannel, selfMute, selfDeaf } = arg1);
if (inVoiceChannel) {
if (selfDeaf.selfDeaf !== selfDeaf) {
let str2 = "undeafen";
if (selfDeaf) {
str2 = "deafen";
}
return str2;
} else if (tmp) {
if (selfDeaf.selfMute !== selfMute) {
if (tmp2) {
2026-07-29 08:29:29 +00:00
const result = _detectH265HardwareDecode.notifyMuteUnmuteSoundWasSkipped();
2026-07-20 16:05:17 +00:00
} else {
let str = "unmute";
if (selfMute) {
str = "mute";
}
}
}
}
}
2026-07-29 08:29:29 +00:00
};
2026-08-05 07:35:12 +00:00
const effect = f98092.useEffect(() => {
2026-07-29 08:29:29 +00:00
let closure_0 = batchedStoreListener();
2026-08-05 07:35:12 +00:00
batchedStoreListener = new items(f98109[19]).BatchedStoreListener(closure_0, () => {
2026-07-29 08:29:29 +00:00
const tmp = batchedStoreListener();
const tmp2 = outer1_2(closure_0, tmp);
let isSoundDisabledResult = null == tmp2;
if (!isSoundDisabledResult) {
isSoundDisabledResult = outer2_14.isSoundDisabled(tmp2);
}
if (!isSoundDisabledResult) {
2026-08-05 07:35:12 +00:00
items(f98109[20]).playSound(tmp2, 0.4);
const obj = items(f98109[20]);
2026-07-29 08:29:29 +00:00
}
closure_0 = tmp;
});
batchedStoreListener.attach("useSound");
return () => batchedStoreListener.detach();
2026-07-20 16:05:17 +00:00
});
return null;
}
function Camera() {
2026-07-29 08:29:29 +00:00
const items = [_detectH265HardwareDecode, handleConnectionOpen];
2026-08-05 07:35:12 +00:00
const f98093 = () => ({ videoEnabled: videoEnabled.isVideoEnabled(), inVoiceChannel: null != voiceChannelId.getVoiceChannelId() });
const f98094 = (videoEnabled, videoEnabled2) => {
2026-07-20 16:05:17 +00:00
videoEnabled = videoEnabled2.videoEnabled;
if (videoEnabled.videoEnabled !== videoEnabled) {
if (videoEnabled.inVoiceChannel) {
if (videoEnabled2.inVoiceChannel) {
let str = "camera_off";
if (videoEnabled) {
str = "camera_on";
}
return str;
}
}
}
2026-07-29 08:29:29 +00:00
};
2026-08-05 07:35:12 +00:00
const effect = f98094.useEffect(() => {
2026-07-29 08:29:29 +00:00
let closure_0 = batchedStoreListener();
2026-08-05 07:35:12 +00:00
batchedStoreListener = new items(f98109[19]).BatchedStoreListener(closure_0, () => {
2026-07-29 08:29:29 +00:00
const tmp = batchedStoreListener();
const tmp2 = outer1_2(closure_0, tmp);
let isSoundDisabledResult = null == tmp2;
if (!isSoundDisabledResult) {
isSoundDisabledResult = outer2_14.isSoundDisabled(tmp2);
}
if (!isSoundDisabledResult) {
2026-08-05 07:35:12 +00:00
items(f98109[20]).playSound(tmp2, 0.4);
const obj = items(f98109[20]);
2026-07-29 08:29:29 +00:00
}
closure_0 = tmp;
});
batchedStoreListener.attach("useSound");
return () => batchedStoreListener.detach();
2026-07-20 16:05:17 +00:00
});
return null;
}
function RTCConnect() {
2026-07-29 08:29:29 +00:00
const items = [ensureGuildLoaded, createRTCConnection, handleConnectionOpen, set];
2026-08-05 07:35:12 +00:00
const f98095 = () => {
2026-07-29 08:29:29 +00:00
channel = channel.getChannel(voiceChannelId.getVoiceChannelId());
2026-07-20 16:05:17 +00:00
let type;
2026-07-29 08:29:29 +00:00
if (channel != null) {
2026-07-20 16:05:17 +00:00
type = channel.type;
}
let guildId;
2026-07-29 08:29:29 +00:00
if (channel != null) {
2026-07-20 16:05:17 +00:00
guildId = channel.getGuildId();
}
2026-07-29 08:29:29 +00:00
const wasEverRtcConnected = store2.getWasEverRtcConnected();
const state = store2.getState();
const obj = { channelType: type, guildId, connected: state === constants.RTC_CONNECTED, connectHasStarted: null, awaitingRemote: null, connectedRemote: null };
let tmp6 = !wasEverRtcConnected;
if (!wasEverRtcConnected) {
tmp6 = state !== tmp5.DISCONNECTED;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (!tmp6) {
tmp6 = state === tmp5.RTC_CONNECTED;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[3] = tmp6;
obj[4] = null != store.getAwaitingRemoteSessionInfo();
obj[5] = null != store.getRemoteSessionId();
2026-07-20 16:05:17 +00:00
return obj;
2026-07-29 08:29:29 +00:00
};
2026-08-05 07:35:12 +00:00
const f98096 = (channelType) => {
2026-07-20 16:05:17 +00:00
let connectedRemote;
({ channelType, connectedRemote } = arg1);
const channelType2 = channelType.channelType;
if (channelType.connectHasStarted) {
if (tmp4) {
if (!tmp) {
if (!tmp3) {
if (!connectedRemote) {
return "disconnect";
}
}
}
}
}
return "user_join";
2026-07-29 08:29:29 +00:00
};
2026-08-05 07:35:12 +00:00
const effect = f98096.useEffect(() => {
2026-07-29 08:29:29 +00:00
let closure_0 = batchedStoreListener();
2026-08-05 07:35:12 +00:00
batchedStoreListener = new items(f98109[19]).BatchedStoreListener(closure_0, () => {
2026-07-29 08:29:29 +00:00
const tmp = batchedStoreListener();
const tmp2 = outer1_2(closure_0, tmp);
let isSoundDisabledResult = null == tmp2;
if (!isSoundDisabledResult) {
isSoundDisabledResult = outer2_14.isSoundDisabled(tmp2);
}
if (!isSoundDisabledResult) {
2026-08-05 07:35:12 +00:00
items(f98109[20]).playSound(tmp2, 0.4);
const obj = items(f98109[20]);
2026-07-29 08:29:29 +00:00
}
closure_0 = tmp;
});
batchedStoreListener.attach("useSound");
return () => batchedStoreListener.detach();
2026-07-20 16:05:17 +00:00
});
return null;
}
function Speaking() {
2026-07-29 08:29:29 +00:00
const items = [anyoneHasFlagInContext];
2026-08-05 07:35:12 +00:00
const f98097 = () => currentUserPTTActive.isCurrentUserPTTActive();
const f98098 = (arg0, arg1) => {
2026-07-20 16:05:17 +00:00
if (arg0 !== arg1) {
2026-07-29 08:29:29 +00:00
if (_detectH265HardwareDecode.getMode() === constants.PUSH_TO_TALK) {
2026-07-20 16:05:17 +00:00
if (!isSelfMuteResult) {
let str = "ptt_stop";
if (arg1) {
str = "ptt_start";
}
return str;
}
}
2026-07-29 08:29:29 +00:00
isSelfMuteResult = _detectH265HardwareDecode.isSelfMute();
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
};
2026-08-05 07:35:12 +00:00
const effect = f98098.useEffect(() => {
2026-07-29 08:29:29 +00:00
let closure_0 = batchedStoreListener();
2026-08-05 07:35:12 +00:00
batchedStoreListener = new items(f98109[19]).BatchedStoreListener(closure_0, () => {
2026-07-29 08:29:29 +00:00
const tmp = batchedStoreListener();
const tmp2 = outer1_2(closure_0, tmp);
let isSoundDisabledResult = null == tmp2;
if (!isSoundDisabledResult) {
isSoundDisabledResult = outer2_14.isSoundDisabled(tmp2);
}
if (!isSoundDisabledResult) {
2026-08-05 07:35:12 +00:00
items(f98109[20]).playSound(tmp2, 0.4);
const obj = items(f98109[20]);
2026-07-29 08:29:29 +00:00
}
closure_0 = tmp;
});
batchedStoreListener.attach("useSound");
return () => batchedStoreListener.detach();
2026-07-20 16:05:17 +00:00
});
return null;
}
function SelfMutedTemporarily() {
2026-07-29 08:29:29 +00:00
const items = [_detectH265HardwareDecode];
2026-08-05 07:35:12 +00:00
const f98099 = () => _detectH265HardwareDecode.isSelfMutedTemporarily();
const f98100 = (arg0, arg1) => {
2026-07-20 16:05:17 +00:00
if (arg0 !== arg1) {
2026-07-29 08:29:29 +00:00
if (_detectH265HardwareDecode.getMode() === constants.VOICE_ACTIVITY) {
2026-07-20 16:05:17 +00:00
if (!isSelfMuteResult) {
let str = "ptt_start";
if (arg1) {
str = "ptt_stop";
}
return str;
}
}
2026-07-29 08:29:29 +00:00
isSelfMuteResult = _detectH265HardwareDecode.isSelfMute();
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
};
2026-08-05 07:35:12 +00:00
const effect = f98100.useEffect(() => {
2026-07-29 08:29:29 +00:00
let closure_0 = batchedStoreListener();
2026-08-05 07:35:12 +00:00
batchedStoreListener = new items(f98109[19]).BatchedStoreListener(closure_0, () => {
2026-07-29 08:29:29 +00:00
const tmp = batchedStoreListener();
const tmp2 = outer1_2(closure_0, tmp);
let isSoundDisabledResult = null == tmp2;
if (!isSoundDisabledResult) {
isSoundDisabledResult = outer2_14.isSoundDisabled(tmp2);
}
if (!isSoundDisabledResult) {
2026-08-05 07:35:12 +00:00
items(f98109[20]).playSound(tmp2, 0.4);
const obj = items(f98109[20]);
2026-07-29 08:29:29 +00:00
}
closure_0 = tmp;
});
batchedStoreListener.attach("useSound");
return () => batchedStoreListener.detach();
2026-07-20 16:05:17 +00:00
});
return null;
}
function PriorityVAD() {
2026-07-29 08:29:29 +00:00
const items = [anyoneHasFlagInContext];
2026-08-05 07:35:12 +00:00
const f98101 = () => currentUserPrioritySpeaker.isCurrentUserPrioritySpeaker();
const f98102 = (arg0, arg1) => {
2026-07-20 16:05:17 +00:00
if (arg0 !== arg1) {
2026-07-29 08:29:29 +00:00
if (_detectH265HardwareDecode.getMode() === constants.VOICE_ACTIVITY) {
2026-07-20 16:05:17 +00:00
if (!isSelfMuteResult) {
let str = "ptt_stop";
if (arg1) {
str = "ptt_start";
}
return str;
}
}
2026-07-29 08:29:29 +00:00
isSelfMuteResult = _detectH265HardwareDecode.isSelfMute();
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
};
2026-08-05 07:35:12 +00:00
const effect = f98102.useEffect(() => {
2026-07-29 08:29:29 +00:00
let closure_0 = batchedStoreListener();
2026-08-05 07:35:12 +00:00
batchedStoreListener = new items(f98109[19]).BatchedStoreListener(closure_0, () => {
2026-07-29 08:29:29 +00:00
const tmp = batchedStoreListener();
const tmp2 = outer1_2(closure_0, tmp);
let isSoundDisabledResult = null == tmp2;
if (!isSoundDisabledResult) {
isSoundDisabledResult = outer2_14.isSoundDisabled(tmp2);
}
if (!isSoundDisabledResult) {
2026-08-05 07:35:12 +00:00
items(f98109[20]).playSound(tmp2, 0.4);
const obj = items(f98109[20]);
2026-07-29 08:29:29 +00:00
}
closure_0 = tmp;
});
batchedStoreListener.attach("useSound");
return () => batchedStoreListener.detach();
2026-07-20 16:05:17 +00:00
});
return null;
}
function UserHasBeenMoved() {
2026-07-29 08:29:29 +00:00
const items = [updateVoiceState];
2026-08-05 07:35:12 +00:00
const f98103 = () => obj.userHasBeenMovedVersion;
const f98104 = (arg0, arg1) => {
2026-07-20 16:05:17 +00:00
if (arg0 !== arg1) {
return "user_moved";
}
2026-07-29 08:29:29 +00:00
};
2026-08-05 07:35:12 +00:00
const effect = f98104.useEffect(() => {
2026-07-29 08:29:29 +00:00
let closure_0 = batchedStoreListener();
2026-08-05 07:35:12 +00:00
batchedStoreListener = new items(f98109[19]).BatchedStoreListener(closure_0, () => {
2026-07-29 08:29:29 +00:00
const tmp = batchedStoreListener();
const tmp2 = outer1_2(closure_0, tmp);
let isSoundDisabledResult = null == tmp2;
if (!isSoundDisabledResult) {
isSoundDisabledResult = outer2_14.isSoundDisabled(tmp2);
}
if (!isSoundDisabledResult) {
2026-08-05 07:35:12 +00:00
items(f98109[20]).playSound(tmp2, 0.4);
const obj = items(f98109[20]);
2026-07-29 08:29:29 +00:00
}
closure_0 = tmp;
});
batchedStoreListener.attach("useSound");
return () => batchedStoreListener.detach();
2026-07-20 16:05:17 +00:00
});
return null;
}
function UserInvitedToSpeak() {
2026-07-29 08:29:29 +00:00
const items = [handleConnectionOpen, updateVoiceState];
2026-08-05 07:35:12 +00:00
const f98105 = () => {
2026-07-29 08:29:29 +00:00
voiceChannelId = voiceChannelId.getVoiceChannelId();
2026-07-20 16:05:17 +00:00
if (null == voiceChannelId) {
2026-08-05 07:35:12 +00:00
return items(f98105[21]).RequestToSpeakStates.NONE;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
voiceStateForChannel = voiceStateForChannel.getVoiceStateForChannel(voiceChannelId);
2026-08-05 07:35:12 +00:00
return items(f98105[21]).getAudienceRequestToSpeakState(voiceStateForChannel);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
};
2026-08-05 07:35:12 +00:00
const f98106 = (arg0, arg1) => {
2026-07-20 16:05:17 +00:00
if (arg0 !== arg1) {
2026-08-05 07:35:12 +00:00
if (arg1 === items(f98105[21]).RequestToSpeakStates.REQUESTED_TO_SPEAK_AND_AWAITING_USER_ACK) {
2026-07-20 16:05:17 +00:00
return "reconnect";
}
}
2026-07-29 08:29:29 +00:00
};
2026-08-05 07:35:12 +00:00
const effect = f98106.useEffect(() => {
2026-07-29 08:29:29 +00:00
let closure_0 = batchedStoreListener();
2026-08-05 07:35:12 +00:00
batchedStoreListener = new items(f98109[19]).BatchedStoreListener(closure_0, () => {
2026-07-29 08:29:29 +00:00
const tmp = batchedStoreListener();
const tmp2 = outer1_2(closure_0, tmp);
let isSoundDisabledResult = null == tmp2;
if (!isSoundDisabledResult) {
isSoundDisabledResult = outer2_14.isSoundDisabled(tmp2);
}
if (!isSoundDisabledResult) {
2026-08-05 07:35:12 +00:00
items(f98109[20]).playSound(tmp2, 0.4);
const obj = items(f98109[20]);
2026-07-29 08:29:29 +00:00
}
closure_0 = tmp;
});
batchedStoreListener.attach("useSound");
return () => batchedStoreListener.detach();
2026-07-20 16:05:17 +00:00
});
return null;
}
function VoiceChannel() {
2026-07-29 08:29:29 +00:00
let items = [handleConnectionOpen, reset, fetchFingerprint, updateVoiceState, ensureGuildLoaded];
2026-08-05 07:35:12 +00:00
const f98107 = () => {
2026-07-29 08:29:29 +00:00
voiceChannelId = voiceChannelId.getVoiceChannelId();
const currentUserId = id.getId();
2026-07-20 16:05:17 +00:00
const items = [];
2026-07-29 08:29:29 +00:00
allActiveStreams = allActiveStreams.getAllActiveStreams();
let streamingUserIds = items;
let voiceChannelUserCount;
let channelType;
2026-07-20 16:05:17 +00:00
if (null != voiceChannelId) {
2026-07-29 08:29:29 +00:00
const channel = store.getChannel(voiceChannelId);
streamingUserIds = items;
2026-07-20 16:05:17 +00:00
if (null != channel) {
2026-07-29 08:29:29 +00:00
const result = getVoiceStatesForGuild.countVoiceStatesForChannel(channel.id);
2026-07-20 16:05:17 +00:00
let num = 0;
2026-07-29 08:29:29 +00:00
if (inChannel.isInChannel(channel.id)) {
2026-07-20 16:05:17 +00:00
num = 1;
}
2026-07-29 08:29:29 +00:00
voiceChannelUserCount = result - num;
const allApplicationStreamsForChannel = obj.getAllApplicationStreamsForChannel(channel.id);
streamingUserIds = allApplicationStreamsForChannel.map((ownerId) => ownerId.ownerId);
channelType = channel.type;
2026-07-20 16:05:17 +00:00
}
}
if (1 === allActiveStreams.length) {
let first = allActiveStreams[0];
} else {
2026-07-29 08:29:29 +00:00
first = obj.getCurrentUserActiveStream();
2026-07-20 16:05:17 +00:00
}
let state;
2026-07-29 08:29:29 +00:00
if (first != null) {
2026-07-20 16:05:17 +00:00
state = first.state;
}
2026-07-29 08:29:29 +00:00
if (state === constants.CONNECTING) {
2026-07-20 16:05:17 +00:00
first = null;
}
2026-07-29 08:29:29 +00:00
let singleActiveStreamViewerCount = 0;
let singleActiveStreamKey = null;
2026-07-20 16:05:17 +00:00
if (null != first) {
2026-08-05 07:35:12 +00:00
const encodeStreamKeyResult = currentUserId(f98107[22]).encodeStreamKey(first);
2026-07-29 08:29:29 +00:00
const viewerIds = obj.getViewerIds(encodeStreamKeyResult);
singleActiveStreamViewerCount = viewerIds.filter((arg0) => arg0 !== currentUserId).length;
singleActiveStreamKey = encodeStreamKeyResult;
2026-08-05 07:35:12 +00:00
const obj2 = currentUserId(f98107[22]);
2026-07-29 08:29:29 +00:00
}
return { channelType, voiceChannelId, voiceChannelUserCount, streamingUserIds, singleActiveStreamKey, singleActiveStreamViewerCount, currentUserId, allActiveStreams };
};
2026-08-05 07:35:12 +00:00
const f98108 = (voiceChannelId) => {
2026-07-20 16:05:17 +00:00
let channelType;
2026-08-05 07:35:12 +00:00
let f98108;
2026-07-20 16:05:17 +00:00
let singleActiveStreamKey;
let singleActiveStreamViewerCount;
let streamingUserIds;
let voiceChannelUserCount;
2026-07-23 10:11:24 +00:00
let closure_0 = voiceChannelId;
2026-07-20 16:05:17 +00:00
({ channelType, voiceChannelId, voiceChannelUserCount, streamingUserIds } = arg1);
2026-08-05 07:35:12 +00:00
({ singleActiveStreamKey, singleActiveStreamViewerCount, currentUserId: f98108 } = arg1);
2026-07-29 08:29:29 +00:00
let participantFromServer;
2026-07-20 16:05:17 +00:00
if (voiceChannelId.voiceChannelId === voiceChannelId) {
if (null != voiceChannelId) {
2026-07-29 08:29:29 +00:00
const channel = store.getChannel(voiceChannelId);
2026-07-20 16:05:17 +00:00
let flag = false;
if (null != channel) {
const guildId = channel.getGuildId();
flag = false;
if (null != guildId) {
2026-07-29 08:29:29 +00:00
guild = guild.getGuild(guildId);
2026-07-20 16:05:17 +00:00
flag = null != guild && guild.afkChannelId === channel.id;
const tmp4 = null != guild && guild.afkChannelId === channel.id;
}
}
if (!flag) {
const allActiveStreams = voiceChannelId.allActiveStreams;
2026-07-29 08:29:29 +00:00
participantFromServer = allActiveStreams.map((ownerId) => ownerId.ownerId);
2026-07-20 16:05:17 +00:00
const streamingUserIds2 = voiceChannelId.streamingUserIds;
let str = "stream_started";
if (!someResult) {
let str2 = "stream_ended";
if (!tmp8) {
if (voiceChannelId.singleActiveStreamViewerCount <= 25) {
if (tmp6) {
let str3 = "stream_user_joined";
}
str2 = str3;
}
if (null != voiceChannelId.voiceChannelUserCount) {
if (null != voiceChannelUserCount) {
if (voiceChannelId.voiceChannelUserCount <= 25) {
let str4 = "user_join";
}
str3 = str4;
}
}
if (null != voiceChannelId.voiceChannelUserCount) {
if (null != voiceChannelUserCount) {
if (voiceChannelId.voiceChannelUserCount <= 25) {
let str5 = "user_leave";
}
str4 = str5;
}
}
let str6;
if (voiceChannelId.singleActiveStreamViewerCount <= 25) {
if (tmp6) {
if (singleActiveStreamViewerCount < voiceChannelId.singleActiveStreamViewerCount) {
str6 = "stream_user_left";
}
}
}
str5 = str6;
}
str = str2;
}
return str;
}
}
}
2026-07-29 08:29:29 +00:00
};
2026-08-05 07:35:12 +00:00
const effect = f98108.useEffect(() => {
2026-07-29 08:29:29 +00:00
let closure_0 = batchedStoreListener();
2026-08-05 07:35:12 +00:00
batchedStoreListener = new items(f98109[19]).BatchedStoreListener(closure_0, () => {
2026-07-29 08:29:29 +00:00
const tmp = batchedStoreListener();
const tmp2 = outer1_2(closure_0, tmp);
let isSoundDisabledResult = null == tmp2;
if (!isSoundDisabledResult) {
isSoundDisabledResult = outer2_14.isSoundDisabled(tmp2);
}
if (!isSoundDisabledResult) {
2026-08-05 07:35:12 +00:00
items(f98109[20]).playSound(tmp2, 0.4);
const obj = items(f98109[20]);
2026-07-29 08:29:29 +00:00
}
closure_0 = tmp;
});
batchedStoreListener.attach("useSound");
return () => batchedStoreListener.detach();
2026-07-20 16:05:17 +00:00
});
return null;
}
function ActivitySounds() {
2026-08-03 11:20:01 +00:00
const items = [handleConnectionOpen, participantFromServer, map, fetchFingerprint, ensureGuildLoaded, handleProjectUpsert];
2026-08-05 07:35:12 +00:00
const f98109 = () => {
2026-07-29 08:29:29 +00:00
const voiceChannelId = store.getVoiceChannelId();
const channelId = store.getChannelId();
let obj = connectedActivityLocation;
connectedActivityLocation = connectedActivityLocation.getConnectedActivityLocation();
2026-08-05 07:35:12 +00:00
const embeddedActivityLocationChannelId = items(f98109[23]).getEmbeddedActivityLocationChannelId(connectedActivityLocation);
2026-07-29 08:29:29 +00:00
id = id.getId();
2026-08-05 07:35:12 +00:00
const obj2 = items(f98109[23]);
2026-07-29 08:29:29 +00:00
if (obj3.isNotNullish(channelId)) {
let embeddedActivitiesForChannel = obj.getEmbeddedActivitiesForChannel(channelId);
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
embeddedActivitiesForChannel = closure_4;
2026-07-20 16:05:17 +00:00
}
2026-08-03 11:20:01 +00:00
let tmp4Result = tmp4(tmp5[24]);
2026-07-29 08:29:29 +00:00
if (tmp4Result.isNotNullish(voiceChannelId)) {
let embeddedActivitiesForChannel1 = obj.getEmbeddedActivitiesForChannel(voiceChannelId);
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
embeddedActivitiesForChannel1 = closure_4;
2026-07-20 16:05:17 +00:00
}
2026-08-03 11:20:01 +00:00
tmp4Result = tmp4(tmp5[24]);
2026-07-29 08:29:29 +00:00
if (tmp4Result.isNotNullish(embeddedActivityLocationChannelId)) {
let embeddedActivitiesForChannel2 = obj.getEmbeddedActivitiesForChannel(embeddedActivityLocationChannelId);
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
embeddedActivitiesForChannel2 = closure_4;
2026-07-20 16:05:17 +00:00
}
2026-08-05 07:35:12 +00:00
obj3 = items(f98109[24]);
2026-07-20 16:05:17 +00:00
let selfEmbeddedActivityForLocation = null;
2026-07-29 08:29:29 +00:00
if (tmp4Result1.isNotNullish(connectedActivityLocation)) {
selfEmbeddedActivityForLocation = obj.getSelfEmbeddedActivityForLocation(connectedActivityLocation);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
connectedFrame = connectedFrame.getConnectedFrame();
2026-08-03 11:20:01 +00:00
let channelId1;
if (connectedFrame != null) {
channelId1 = connectedFrame.channelId;
2026-07-25 08:10:48 +00:00
}
2026-08-03 11:20:01 +00:00
let result = null == channelId1;
if (result) {
2026-07-25 08:10:48 +00:00
let applicationId;
2026-07-29 08:29:29 +00:00
if (connectedFrame != null) {
2026-07-25 08:10:48 +00:00
applicationId = connectedFrame.applicationId;
}
2026-08-03 11:20:01 +00:00
result = ownedVibegrationsProjectApplication.isOwnedVibegrationsProjectApplication(applicationId);
2026-07-25 08:10:48 +00:00
}
2026-07-29 08:29:29 +00:00
obj = { connectedActivityLocation, voiceChannelId, currentUserId: id, channelActivities: embeddedActivitiesForChannel, connectedChannelActivities: embeddedActivitiesForChannel2, userConnectedActivity: selfEmbeddedActivityForLocation, voiceChannelActivities: embeddedActivitiesForChannel1, connectedFrame, inVibegrationsChannel: null };
2026-07-25 08:10:48 +00:00
let channelId2;
2026-07-29 08:29:29 +00:00
if (connectedFrame != null) {
2026-07-25 08:10:48 +00:00
channelId2 = connectedFrame.channelId;
2026-07-24 07:16:23 +00:00
}
2026-08-03 11:20:01 +00:00
let result1 = null != channelId2;
if (result1) {
2026-07-25 08:10:48 +00:00
let channelId3;
2026-07-29 08:29:29 +00:00
if (connectedFrame != null) {
2026-07-25 08:10:48 +00:00
channelId3 = connectedFrame.channelId;
2026-07-24 07:16:23 +00:00
}
2026-08-03 11:20:01 +00:00
result1 = tmp4(tmp5[25]).isVibegrationsChannelCandidate(channel.getChannel(channelId3), "ActivitySounds");
const tmp4Result2 = tmp4(tmp5[25]);
2026-07-25 08:10:48 +00:00
}
2026-08-03 11:20:01 +00:00
if (!result1) {
result1 = result;
2026-07-24 07:16:23 +00:00
}
2026-08-03 11:20:01 +00:00
obj[8] = result1;
2026-07-20 16:05:17 +00:00
return obj;
2026-07-29 08:29:29 +00:00
};
2026-08-05 07:35:12 +00:00
const f98110 = (voiceChannelActivities) => {
2026-07-20 16:05:17 +00:00
let channelActivities;
let connectedActivityLocation;
let connectedChannelActivities;
let connectedFrame;
2026-07-24 07:16:23 +00:00
let inVibegrationsChannel;
2026-07-29 08:29:29 +00:00
let items;
2026-07-20 16:05:17 +00:00
let userConnectedActivity;
let voiceChannelId;
2026-07-29 08:29:29 +00:00
({ connectedActivityLocation, currentUserId: items, userConnectedActivity } = arg1);
2026-07-24 07:16:23 +00:00
({ voiceChannelActivities, connectedFrame, voiceChannelId, channelActivities, connectedChannelActivities, inVibegrationsChannel } = arg1);
2026-07-20 16:05:17 +00:00
const someResult = voiceChannelActivities.some((applicationId) => {
applicationId = undefined;
2026-07-29 08:29:29 +00:00
if (userConnectedActivity != null) {
applicationId = tmp.applicationId;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return applicationId.applicationId === applicationId && applicationId.launchId === userConnectedActivity.launchId;
2026-07-20 16:05:17 +00:00
});
let str;
if (obj.isNotNullish(voiceChannelId)) {
const prop = voiceChannelActivities.voiceChannelActivities;
const found = prop.find((userIds) => {
userIds = userIds.userIds;
return userIds.has(closure_0);
});
const found1 = voiceChannelActivities.find((userIds) => {
userIds = userIds.userIds;
return userIds.has(closure_0);
});
let isNotNullishResult = voiceChannelActivities.voiceChannelActivities.length < voiceChannelActivities.length;
if (isNotNullishResult) {
2026-08-03 11:20:01 +00:00
let tmp2Result = tmp2(tmp3[24]);
2026-07-29 08:29:29 +00:00
isNotNullishResult = tmp2Result.isNotNullish(voiceChannelActivities.voiceChannelId);
2026-07-20 16:05:17 +00:00
}
let str2;
if (isNotNullishResult) {
str2 = "activity_launch";
}
let isNotNullishResult1 = undefined === found1;
if (isNotNullishResult1) {
2026-08-03 11:20:01 +00:00
tmp2Result = tmp2(tmp3[24]);
2026-07-29 08:29:29 +00:00
isNotNullishResult1 = tmp2Result.isNotNullish(found);
2026-07-20 16:05:17 +00:00
}
if (isNotNullishResult1) {
str2 = "activity_end";
}
let isNotNullishResult2 = undefined === found;
if (isNotNullishResult2) {
2026-08-03 11:20:01 +00:00
isNotNullishResult2 = tmp2(tmp3[24]).isNotNullish(found1);
const tmp2Result1 = tmp2(tmp3[24]);
2026-07-20 16:05:17 +00:00
}
if (isNotNullishResult2) {
isNotNullishResult2 = found1.userIds.size > 1;
}
if (isNotNullishResult2) {
str2 = "activity_user_join";
}
2026-08-03 11:20:01 +00:00
let isNotNullishResult3 = tmp2(tmp3[24]).isNotNullish(found1);
2026-07-20 16:05:17 +00:00
if (isNotNullishResult3) {
2026-08-03 11:20:01 +00:00
isNotNullishResult3 = tmp2(tmp3[24]).isNotNullish(found);
const tmp2Result3 = tmp2(tmp3[24]);
2026-07-20 16:05:17 +00:00
}
str = str2;
if (isNotNullishResult3) {
if (found1.userIds.size > found.userIds.size) {
str2 = "activity_user_join";
}
if (found1.userIds.size < found.userIds.size) {
str2 = "activity_user_left";
}
str = str2;
}
2026-08-03 11:20:01 +00:00
const tmp2Result2 = tmp2(tmp3[24]);
2026-07-20 16:05:17 +00:00
}
let str3 = str;
if (!someResult) {
2026-07-29 08:29:29 +00:00
if (tmp10) {
2026-07-20 16:05:17 +00:00
str = "activity_launch";
}
const userConnectedActivity2 = voiceChannelActivities.userConnectedActivity;
let isNotNullishResult4 = null == userConnectedActivity;
if (isNotNullishResult4) {
2026-08-03 11:20:01 +00:00
isNotNullishResult4 = tmp2(tmp3[24]).isNotNullish(userConnectedActivity2);
const tmp2Result4 = tmp2(tmp3[24]);
2026-07-20 16:05:17 +00:00
}
if (isNotNullishResult4) {
str = "activity_end";
}
2026-08-03 11:20:01 +00:00
let isNotNullishResult5 = tmp2(tmp3[24]).isNotNullish(userConnectedActivity);
2026-07-20 16:05:17 +00:00
if (isNotNullishResult5) {
2026-08-03 11:20:01 +00:00
isNotNullishResult5 = tmp2(tmp3[24]).isNotNullish(userConnectedActivity2);
const tmp2Result6 = tmp2(tmp3[24]);
2026-07-20 16:05:17 +00:00
}
str3 = str;
if (isNotNullishResult5) {
if (userConnectedActivity.userIds.size > userConnectedActivity2.userIds.size) {
str = "activity_user_join";
}
if (userConnectedActivity.userIds.size < userConnectedActivity2.userIds.size) {
str = "activity_user_left";
}
str3 = str;
}
2026-07-29 08:29:29 +00:00
tmp10 = voiceChannelActivities.connectedChannelActivities.length < connectedChannelActivities.length && voiceChannelActivities.channelActivities.length < channelActivities.length;
2026-08-03 11:20:01 +00:00
const tmp2Result5 = tmp2(tmp3[24]);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let tmp14 = null != str3;
if (!tmp14) {
tmp14 = null == voiceChannelActivities.connectedActivityLocation && null == connectedActivityLocation;
const tmp15 = null == voiceChannelActivities.connectedActivityLocation && null == connectedActivityLocation;
2026-07-20 16:05:17 +00:00
}
let str4 = str3;
2026-07-29 08:29:29 +00:00
if (!tmp14) {
2026-07-20 16:05:17 +00:00
if (null != voiceChannelActivities.connectedActivityLocation) {
if (null == voiceChannelActivities.connectedActivityLocation) {
2026-07-29 08:29:29 +00:00
let tmp17 = str3;
if (tmp16) {
2026-07-20 16:05:17 +00:00
let str7 = "activity_user_join";
if (voiceChannelActivities.userConnectedActivity.userIds.size >= userConnectedActivity.userIds.size) {
if (voiceChannelActivities.userConnectedActivity.userIds.size > userConnectedActivity.userIds.size) {
str3 = "activity_user_leave";
}
str7 = str3;
}
2026-07-29 08:29:29 +00:00
tmp17 = str7;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let str6 = tmp17;
tmp16 = null != userConnectedActivity && null != voiceChannelActivities.userConnectedActivity;
2026-07-20 16:05:17 +00:00
} else {
str6 = "activity_end";
}
let str5 = str6;
} else {
str5 = "activity_launch";
}
str4 = str5;
}
2026-07-29 08:29:29 +00:00
let tmp18 = null != str4;
if (!tmp18) {
tmp18 = null == voiceChannelActivities.connectedFrame && null == connectedFrame;
const tmp19 = null == voiceChannelActivities.connectedFrame && null == connectedFrame;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let tmp20 = str4;
if (!tmp18) {
2026-07-24 07:16:23 +00:00
if (null == voiceChannelActivities.connectedFrame) {
if (null != connectedFrame) {
let str8 = "activity_launch";
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp20 = str8;
2026-07-24 07:16:23 +00:00
}
2026-07-29 08:29:29 +00:00
if (!tmp21) {
2026-07-24 07:16:23 +00:00
str4 = "activity_end";
2026-07-20 16:05:17 +00:00
}
2026-07-24 07:16:23 +00:00
str8 = str4;
2026-07-29 08:29:29 +00:00
tmp21 = null == voiceChannelActivities.connectedFrame || null != connectedFrame || voiceChannelActivities.inVibegrationsChannel;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp20;
};
2026-08-05 07:35:12 +00:00
const effect = f98110.useEffect(() => {
2026-07-29 08:29:29 +00:00
let closure_0 = batchedStoreListener();
2026-08-05 07:35:12 +00:00
batchedStoreListener = new items(f98109[19]).BatchedStoreListener(closure_0, () => {
2026-07-29 08:29:29 +00:00
const tmp = batchedStoreListener();
const tmp2 = outer1_2(closure_0, tmp);
let isSoundDisabledResult = null == tmp2;
if (!isSoundDisabledResult) {
isSoundDisabledResult = outer2_14.isSoundDisabled(tmp2);
}
if (!isSoundDisabledResult) {
2026-08-05 07:35:12 +00:00
items(f98109[20]).playSound(tmp2, 0.4);
const obj = items(f98109[20]);
2026-07-29 08:29:29 +00:00
}
closure_0 = tmp;
});
batchedStoreListener.attach("useSound");
return () => batchedStoreListener.detach();
2026-07-20 16:05:17 +00:00
});
return null;
}
2026-07-25 08:10:48 +00:00
({ InputModes: closure_20, ApplicationStreamStates: closure_21, RTCConnectionStates: closure_22 } = ME);
2026-08-03 11:20:01 +00:00
({ jsx: closure_23, Fragment: closure_24, jsxs: closure_25 } = jsxProd);
2026-07-29 08:29:29 +00:00
let result = require("map").fileFinishedImporting("modules/soundplayer/SoundPlayer.tsx");
2026-07-20 16:05:17 +00:00
export default function SoundPlayer() {
2026-07-29 08:29:29 +00:00
const obj = { children: null };
2026-07-20 16:05:17 +00:00
const items = [callback(MuteDeafen, {}), callback(Camera, {}), callback(RTCConnect, {}), callback(Speaking, {}), callback(SelfMutedTemporarily, {}), callback(UserHasBeenMoved, {}), callback(VoiceChannel, {}), callback(UserInvitedToSpeak, {}), callback(ActivitySounds, {}), callback(PriorityVAD, {})];
2026-07-29 08:29:29 +00:00
obj[0] = items;
2026-08-03 11:20:01 +00:00
return callback2(closure_24, obj);
2026-07-20 16:05:17 +00:00
};