decord/source/modules/soundplayer/SoundPlayer.tsx

732 lines
27 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 16237
// Function ID: 16238
2026-07-29 08:29:29 +00:00
// Name: MuteDeafen
2026-08-24 06:08:38 +00:00
// Dependencies: [19, 1390, 8745, 4545, 15912, 1395, 4658, 1218, 1391, 1910, 4501, 10054, 4544, 1980, 4779, 4547, 4550, 676, 8746, 21, 589, 10079, 4986, 4536, 4014, 1370, 7252, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-24 06:08:38 +00:00
// Module 16237 (MuteDeafen)
import closure_2 from "noop" /* 19 */;
import closure_3 from "participantFromServer" /* 1390 */;
import { NO_ACTIVITIES } from "participantFromServer" /* 1390 */;
import closure_5 from "map" /* 8745 */;
import closure_6 from "set" /* 4545 */;
import closure_7 from "isProjectOwner" /* 15912 */;
import { SILENT_JOIN_LEAVE_CHANNEL_TYPES as closure_8 } from "createChannelRecord" /* 1395 */;
import closure_9 from "reset" /* 4658 */;
import closure_10 from "fetchFingerprint" /* 1218 */;
import closure_11 from "ensureGuildLoaded" /* 1391 */;
import closure_12 from "createGuildRecordFromRust" /* 1910 */;
import closure_13 from "_detectH265HardwareDecode" /* 4501 */;
import closure_14 from "DesktopNotificationTypes" /* 10054 */;
import closure_15 from "createRTCConnection" /* 4544 */;
import closure_16 from "handleConnectionOpen" /* 1980 */;
import closure_17 from "anyoneHasFlagInContext" /* 4779 */;
import closure_18 from "updateVoiceState" /* 4547 */;
import closure_19 from "getVoiceStatesForGuild" /* 4550 */;
import ME from "ME" /* 676 */;
import FrameLayoutModes from "FrameLayoutModes" /* 8746 */;
import jsxProd from "jsxProd" /* 21 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-20 16:05:17 +00:00
function MuteDeafen() {
2026-08-24 06:08:38 +00:00
const items = [closure_13, closure_16];
const f100270 = () => ({ inVoiceChannel: null != voiceChannelId.getVoiceChannelId(), selfMute: closure_13.isSelfMute(), selfDeaf: closure_13.isSelfDeaf(), audioPermissionReady: closure_13.isNativeAudioPermissionReady(), shouldSkipMuteUnmuteSound: closure_13.shouldSkipMuteUnmuteSound() });
const f100271 = (selfDeaf) => {
2026-07-20 16:05:17 +00:00
({ 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-08-24 06:08:38 +00:00
const result = closure_13.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-24 06:08:38 +00:00
const effect = f100271.useEffect(() => {
closure_0 = batchedStoreListener();
batchedStoreListener = new items(f100288[20]).BatchedStoreListener(closure_0, () => {
2026-07-29 08:29:29 +00:00
const tmp = batchedStoreListener();
2026-08-24 06:08:38 +00:00
const tmp2 = closure_1_2(closure_0, tmp);
2026-07-29 08:29:29 +00:00
let isSoundDisabledResult = null == tmp2;
if (!isSoundDisabledResult) {
2026-08-24 06:08:38 +00:00
isSoundDisabledResult = closure_2_14.isSoundDisabled(tmp2);
2026-07-29 08:29:29 +00:00
}
if (!isSoundDisabledResult) {
2026-08-24 06:08:38 +00:00
items(f100288[21]).playSound(tmp2, 0.4);
const obj = items(f100288[21]);
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-08-24 06:08:38 +00:00
const items = [closure_13, closure_16];
const f100272 = () => ({ videoEnabled: videoEnabled.isVideoEnabled(), inVoiceChannel: null != voiceChannelId.getVoiceChannelId() });
const f100273 = (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-24 06:08:38 +00:00
const effect = f100273.useEffect(() => {
closure_0 = batchedStoreListener();
batchedStoreListener = new items(f100288[20]).BatchedStoreListener(closure_0, () => {
2026-07-29 08:29:29 +00:00
const tmp = batchedStoreListener();
2026-08-24 06:08:38 +00:00
const tmp2 = closure_1_2(closure_0, tmp);
2026-07-29 08:29:29 +00:00
let isSoundDisabledResult = null == tmp2;
if (!isSoundDisabledResult) {
2026-08-24 06:08:38 +00:00
isSoundDisabledResult = closure_2_14.isSoundDisabled(tmp2);
2026-07-29 08:29:29 +00:00
}
if (!isSoundDisabledResult) {
2026-08-24 06:08:38 +00:00
items(f100288[21]).playSound(tmp2, 0.4);
const obj = items(f100288[21]);
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-08-24 06:08:38 +00:00
const items = [closure_11, closure_15, closure_16, closure_6];
const f100274 = () => {
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-24 06:08:38 +00:00
const f100275 = (channelType) => {
2026-07-20 16:05:17 +00:00
({ 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-24 06:08:38 +00:00
const effect = f100275.useEffect(() => {
closure_0 = batchedStoreListener();
batchedStoreListener = new items(f100288[20]).BatchedStoreListener(closure_0, () => {
2026-07-29 08:29:29 +00:00
const tmp = batchedStoreListener();
2026-08-24 06:08:38 +00:00
const tmp2 = closure_1_2(closure_0, tmp);
2026-07-29 08:29:29 +00:00
let isSoundDisabledResult = null == tmp2;
if (!isSoundDisabledResult) {
2026-08-24 06:08:38 +00:00
isSoundDisabledResult = closure_2_14.isSoundDisabled(tmp2);
2026-07-29 08:29:29 +00:00
}
if (!isSoundDisabledResult) {
2026-08-24 06:08:38 +00:00
items(f100288[21]).playSound(tmp2, 0.4);
const obj = items(f100288[21]);
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-08-24 06:08:38 +00:00
const items = [closure_17];
const f100276 = () => currentUserPTTActive.isCurrentUserPTTActive();
const f100277 = (arg0, arg1) => {
2026-07-20 16:05:17 +00:00
if (arg0 !== arg1) {
2026-08-24 06:08:38 +00:00
if (closure_13.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-08-24 06:08:38 +00:00
isSelfMuteResult = closure_13.isSelfMute();
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
};
2026-08-24 06:08:38 +00:00
const effect = f100277.useEffect(() => {
closure_0 = batchedStoreListener();
batchedStoreListener = new items(f100288[20]).BatchedStoreListener(closure_0, () => {
2026-07-29 08:29:29 +00:00
const tmp = batchedStoreListener();
2026-08-24 06:08:38 +00:00
const tmp2 = closure_1_2(closure_0, tmp);
2026-07-29 08:29:29 +00:00
let isSoundDisabledResult = null == tmp2;
if (!isSoundDisabledResult) {
2026-08-24 06:08:38 +00:00
isSoundDisabledResult = closure_2_14.isSoundDisabled(tmp2);
2026-07-29 08:29:29 +00:00
}
if (!isSoundDisabledResult) {
2026-08-24 06:08:38 +00:00
items(f100288[21]).playSound(tmp2, 0.4);
const obj = items(f100288[21]);
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-08-24 06:08:38 +00:00
const items = [closure_13];
const f100278 = () => closure_13.isSelfMutedTemporarily();
const f100279 = (arg0, arg1) => {
2026-07-20 16:05:17 +00:00
if (arg0 !== arg1) {
2026-08-24 06:08:38 +00:00
if (closure_13.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-08-24 06:08:38 +00:00
isSelfMuteResult = closure_13.isSelfMute();
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
};
2026-08-24 06:08:38 +00:00
const effect = f100279.useEffect(() => {
closure_0 = batchedStoreListener();
batchedStoreListener = new items(f100288[20]).BatchedStoreListener(closure_0, () => {
2026-07-29 08:29:29 +00:00
const tmp = batchedStoreListener();
2026-08-24 06:08:38 +00:00
const tmp2 = closure_1_2(closure_0, tmp);
2026-07-29 08:29:29 +00:00
let isSoundDisabledResult = null == tmp2;
if (!isSoundDisabledResult) {
2026-08-24 06:08:38 +00:00
isSoundDisabledResult = closure_2_14.isSoundDisabled(tmp2);
2026-07-29 08:29:29 +00:00
}
if (!isSoundDisabledResult) {
2026-08-24 06:08:38 +00:00
items(f100288[21]).playSound(tmp2, 0.4);
const obj = items(f100288[21]);
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-08-24 06:08:38 +00:00
const items = [closure_17];
const f100280 = () => currentUserPrioritySpeaker.isCurrentUserPrioritySpeaker();
const f100281 = (arg0, arg1) => {
2026-07-20 16:05:17 +00:00
if (arg0 !== arg1) {
2026-08-24 06:08:38 +00:00
if (closure_13.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-08-24 06:08:38 +00:00
isSelfMuteResult = closure_13.isSelfMute();
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
};
2026-08-24 06:08:38 +00:00
const effect = f100281.useEffect(() => {
closure_0 = batchedStoreListener();
batchedStoreListener = new items(f100288[20]).BatchedStoreListener(closure_0, () => {
2026-07-29 08:29:29 +00:00
const tmp = batchedStoreListener();
2026-08-24 06:08:38 +00:00
const tmp2 = closure_1_2(closure_0, tmp);
2026-07-29 08:29:29 +00:00
let isSoundDisabledResult = null == tmp2;
if (!isSoundDisabledResult) {
2026-08-24 06:08:38 +00:00
isSoundDisabledResult = closure_2_14.isSoundDisabled(tmp2);
2026-07-29 08:29:29 +00:00
}
if (!isSoundDisabledResult) {
2026-08-24 06:08:38 +00:00
items(f100288[21]).playSound(tmp2, 0.4);
const obj = items(f100288[21]);
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-08-24 06:08:38 +00:00
const items = [closure_18];
const f100282 = () => obj.userHasBeenMovedVersion;
const f100283 = (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-24 06:08:38 +00:00
const effect = f100283.useEffect(() => {
closure_0 = batchedStoreListener();
batchedStoreListener = new items(f100288[20]).BatchedStoreListener(closure_0, () => {
2026-07-29 08:29:29 +00:00
const tmp = batchedStoreListener();
2026-08-24 06:08:38 +00:00
const tmp2 = closure_1_2(closure_0, tmp);
2026-07-29 08:29:29 +00:00
let isSoundDisabledResult = null == tmp2;
if (!isSoundDisabledResult) {
2026-08-24 06:08:38 +00:00
isSoundDisabledResult = closure_2_14.isSoundDisabled(tmp2);
2026-07-29 08:29:29 +00:00
}
if (!isSoundDisabledResult) {
2026-08-24 06:08:38 +00:00
items(f100288[21]).playSound(tmp2, 0.4);
const obj = items(f100288[21]);
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-08-24 06:08:38 +00:00
const items = [closure_16, closure_18];
const f100284 = () => {
2026-07-29 08:29:29 +00:00
voiceChannelId = voiceChannelId.getVoiceChannelId();
2026-07-20 16:05:17 +00:00
if (null == voiceChannelId) {
2026-08-24 06:08:38 +00:00
return items(f100284[22]).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-24 06:08:38 +00:00
return items(f100284[22]).getAudienceRequestToSpeakState(voiceStateForChannel);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
};
2026-08-24 06:08:38 +00:00
const f100285 = (arg0, arg1) => {
2026-07-20 16:05:17 +00:00
if (arg0 !== arg1) {
2026-08-24 06:08:38 +00:00
if (arg1 === items(f100284[22]).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-24 06:08:38 +00:00
const effect = f100285.useEffect(() => {
closure_0 = batchedStoreListener();
batchedStoreListener = new items(f100288[20]).BatchedStoreListener(closure_0, () => {
2026-07-29 08:29:29 +00:00
const tmp = batchedStoreListener();
2026-08-24 06:08:38 +00:00
const tmp2 = closure_1_2(closure_0, tmp);
2026-07-29 08:29:29 +00:00
let isSoundDisabledResult = null == tmp2;
if (!isSoundDisabledResult) {
2026-08-24 06:08:38 +00:00
isSoundDisabledResult = closure_2_14.isSoundDisabled(tmp2);
2026-07-29 08:29:29 +00:00
}
if (!isSoundDisabledResult) {
2026-08-24 06:08:38 +00:00
items(f100288[21]).playSound(tmp2, 0.4);
const obj = items(f100288[21]);
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-08-24 06:08:38 +00:00
let items = [closure_16, closure_9, closure_10, closure_18, closure_11];
const f100286 = () => {
2026-07-29 08:29:29 +00:00
voiceChannelId = voiceChannelId.getVoiceChannelId();
const currentUserId = id.getId();
2026-08-24 06:08:38 +00:00
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-08-24 06:08:38 +00:00
const result = closure_19.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-24 06:08:38 +00:00
const encodeStreamKeyResult = currentUserId(f100286[23]).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-24 06:08:38 +00:00
const obj2 = currentUserId(f100286[23]);
2026-07-29 08:29:29 +00:00
}
return { channelType, voiceChannelId, voiceChannelUserCount, streamingUserIds, singleActiveStreamKey, singleActiveStreamViewerCount, currentUserId, allActiveStreams };
};
2026-08-24 06:08:38 +00:00
const f100287 = (voiceChannelId) => {
closure_0 = voiceChannelId;
2026-07-20 16:05:17 +00:00
({ channelType, voiceChannelId, voiceChannelUserCount, streamingUserIds } = arg1);
2026-08-24 06:08:38 +00:00
({ singleActiveStreamKey, singleActiveStreamViewerCount, currentUserId: f100287 } = arg1);
closure_3 = undefined;
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-08-24 06:08:38 +00:00
closure_3 = 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-24 06:08:38 +00:00
const effect = f100287.useEffect(() => {
closure_0 = batchedStoreListener();
batchedStoreListener = new items(f100288[20]).BatchedStoreListener(closure_0, () => {
2026-07-29 08:29:29 +00:00
const tmp = batchedStoreListener();
2026-08-24 06:08:38 +00:00
const tmp2 = closure_1_2(closure_0, tmp);
2026-07-29 08:29:29 +00:00
let isSoundDisabledResult = null == tmp2;
if (!isSoundDisabledResult) {
2026-08-24 06:08:38 +00:00
isSoundDisabledResult = closure_2_14.isSoundDisabled(tmp2);
2026-07-29 08:29:29 +00:00
}
if (!isSoundDisabledResult) {
2026-08-24 06:08:38 +00:00
items(f100288[21]).playSound(tmp2, 0.4);
const obj = items(f100288[21]);
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-24 06:08:38 +00:00
const items = [closure_16, closure_3, closure_5, closure_10, closure_11, closure_7];
const f100288 = () => {
2026-07-29 08:29:29 +00:00
const voiceChannelId = store.getVoiceChannelId();
const channelId = store.getChannelId();
let obj = connectedActivityLocation;
connectedActivityLocation = connectedActivityLocation.getConnectedActivityLocation();
2026-08-24 06:08:38 +00:00
const embeddedActivityLocationChannelId = items(f100288[24]).getEmbeddedActivityLocationChannelId(connectedActivityLocation);
2026-07-29 08:29:29 +00:00
id = id.getId();
2026-08-24 06:08:38 +00:00
const obj2 = items(f100288[24]);
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-06 08:05:19 +00:00
let tmp4Result = tmp4(tmp5[25]);
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-06 08:05:19 +00:00
tmp4Result = tmp4(tmp5[25]);
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-24 06:08:38 +00:00
obj3 = items(f100288[25]);
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-08-06 08:05:19 +00:00
mainFrame = mainFrame.getMainFrame();
let surface;
if (mainFrame != null) {
surface = mainFrame.surface;
2026-07-25 08:10:48 +00:00
}
2026-08-06 08:05:19 +00:00
const tmp13Result = closure_23(surface);
let result = null == tmp13Result;
2026-08-03 11:20:01 +00:00
if (result) {
2026-07-25 08:10:48 +00:00
let applicationId;
2026-08-06 08:05:19 +00:00
if (mainFrame != null) {
applicationId = mainFrame.applicationId;
2026-07-25 08:10:48 +00:00
}
2026-08-24 06:08:38 +00:00
result = vibegrationsProjectApplication.isVibegrationsProjectApplication(applicationId);
2026-07-25 08:10:48 +00:00
}
2026-08-06 08:05:19 +00:00
let result1 = null != tmp13Result;
2026-08-03 11:20:01 +00:00
if (result1) {
2026-08-06 08:05:19 +00:00
result1 = tmp4(tmp5[26]).isVibegrationsChannelCandidate(channel.getChannel(tmp13Result), "ActivitySounds");
const tmp4Result2 = tmp4(tmp5[26]);
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-06 08:05:19 +00:00
obj = { connectedActivityLocation, voiceChannelId, currentUserId: id, channelActivities: embeddedActivitiesForChannel, connectedChannelActivities: embeddedActivitiesForChannel2, userConnectedActivity: selfEmbeddedActivityForLocation, voiceChannelActivities: embeddedActivitiesForChannel1, hasFrame: callback(mainFrame), inVibegrationsChannel: result1 };
2026-07-20 16:05:17 +00:00
return obj;
2026-07-29 08:29:29 +00:00
};
2026-08-24 06:08:38 +00:00
const f100289 = (voiceChannelActivities) => {
2026-07-29 08:29:29 +00:00
({ connectedActivityLocation, currentUserId: items, userConnectedActivity } = arg1);
2026-08-06 08:05:19 +00:00
({ voiceChannelActivities, hasFrame, 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-06 08:05:19 +00:00
let tmp2Result = tmp2(tmp3[25]);
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-06 08:05:19 +00:00
tmp2Result = tmp2(tmp3[25]);
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-06 08:05:19 +00:00
isNotNullishResult2 = tmp2(tmp3[25]).isNotNullish(found1);
const tmp2Result1 = tmp2(tmp3[25]);
2026-07-20 16:05:17 +00:00
}
if (isNotNullishResult2) {
isNotNullishResult2 = found1.userIds.size > 1;
}
if (isNotNullishResult2) {
str2 = "activity_user_join";
}
2026-08-06 08:05:19 +00:00
let isNotNullishResult3 = tmp2(tmp3[25]).isNotNullish(found1);
2026-07-20 16:05:17 +00:00
if (isNotNullishResult3) {
2026-08-06 08:05:19 +00:00
isNotNullishResult3 = tmp2(tmp3[25]).isNotNullish(found);
const tmp2Result3 = tmp2(tmp3[25]);
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-06 08:05:19 +00:00
const tmp2Result2 = tmp2(tmp3[25]);
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-06 08:05:19 +00:00
isNotNullishResult4 = tmp2(tmp3[25]).isNotNullish(userConnectedActivity2);
const tmp2Result4 = tmp2(tmp3[25]);
2026-07-20 16:05:17 +00:00
}
if (isNotNullishResult4) {
str = "activity_end";
}
2026-08-06 08:05:19 +00:00
let isNotNullishResult5 = tmp2(tmp3[25]).isNotNullish(userConnectedActivity);
2026-07-20 16:05:17 +00:00
if (isNotNullishResult5) {
2026-08-06 08:05:19 +00:00
isNotNullishResult5 = tmp2(tmp3[25]).isNotNullish(userConnectedActivity2);
const tmp2Result6 = tmp2(tmp3[25]);
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-06 08:05:19 +00:00
const tmp2Result5 = tmp2(tmp3[25]);
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-08-06 08:05:19 +00:00
let tmp18 = null == str4;
if (tmp18) {
tmp18 = voiceChannelActivities.hasFrame || hasFrame;
const tmp19 = voiceChannelActivities.hasFrame || hasFrame;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let tmp20 = str4;
2026-08-06 08:05:19 +00:00
if (tmp18) {
if (!voiceChannelActivities.hasFrame) {
if (hasFrame) {
2026-07-24 07:16:23 +00:00
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-08-06 08:05:19 +00:00
const hasFrame2 = voiceChannelActivities.hasFrame;
let inVibegrationsChannel2 = !hasFrame2;
if (hasFrame2) {
inVibegrationsChannel2 = hasFrame;
}
if (!inVibegrationsChannel2) {
inVibegrationsChannel2 = voiceChannelActivities.inVibegrationsChannel;
}
if (!inVibegrationsChannel2) {
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-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp20;
};
2026-08-24 06:08:38 +00:00
const effect = f100289.useEffect(() => {
closure_0 = batchedStoreListener();
batchedStoreListener = new items(f100288[20]).BatchedStoreListener(closure_0, () => {
2026-07-29 08:29:29 +00:00
const tmp = batchedStoreListener();
2026-08-24 06:08:38 +00:00
const tmp2 = closure_1_2(closure_0, tmp);
2026-07-29 08:29:29 +00:00
let isSoundDisabledResult = null == tmp2;
if (!isSoundDisabledResult) {
2026-08-24 06:08:38 +00:00
isSoundDisabledResult = closure_2_14.isSoundDisabled(tmp2);
2026-07-29 08:29:29 +00:00
}
if (!isSoundDisabledResult) {
2026-08-24 06:08:38 +00:00
items(f100288[21]).playSound(tmp2, 0.4);
const obj = items(f100288[21]);
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-06 08:05:19 +00:00
({ getChannelIdForSurface: closure_23, isLaunched: closure_24 } = FrameLayoutModes);
({ jsx: closure_25, Fragment: closure_26, jsxs: closure_27 } = jsxProd);
2026-08-24 06:08:38 +00:00
let result = require("set").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-06 08:05:19 +00:00
return callback2(closure_26, obj);
2026-07-20 16:05:17 +00:00
};