decord/source/modules/calls/ChannelRTCStore.tsx

1015 lines
32 KiB
TypeScript
Raw Normal View History

2026-07-25 08:10:48 +00:00
// Module ID: 4144
2026-07-27 11:26:19 +00:00
// Function ID: 34745
2026-07-20 16:05:17 +00:00
// Name: _isNativeReflectConstruct
2026-07-27 11:26:19 +00:00
// Dependencies: [6, 7, 15, 17, 18, 57, 1347, 4145, 4150, 1194, 4810, 1348, 4218, 1907, 4953, 1850, 10450, 4147, 4149, 653, 3, 10449, 22, 44, 8848, 4195, 566, 686, 2]
2026-07-20 16:05:17 +00:00
2026-07-25 08:10:48 +00:00
// Module 4144 (_isNativeReflectConstruct)
2026-07-23 10:11:24 +00:00
import _createForOfIteratorHelperLoose from "_createForOfIteratorHelperLoose";
import _isNativeReflectConstruct from "_isNativeReflectConstruct";
import closure_5 from "_isNativeReflectConstruct";
import closure_6 from "_isNativeReflectConstruct";
import closure_7 from "ParticipantTypes";
import _slicedToArray from "_slicedToArray";
import closure_9 from "_createForOfIteratorHelperLoose";
import closure_10 from "_isNativeReflectConstruct";
import closure_11 from "_isNativeReflectConstruct";
import closure_12 from "_isNativeReflectConstruct";
import closure_13 from "_isNativeReflectConstruct";
import closure_14 from "_isNativeReflectConstruct";
import closure_15 from "_isNativeReflectConstruct";
import closure_16 from "_isNativeReflectConstruct";
import closure_17 from "_isNativeReflectConstruct";
import closure_18 from "_isNativeReflectConstruct";
import closure_19 from "_isNativeReflectConstruct";
import closure_20 from "_isNativeReflectConstruct";
import ParticipantTypes from "ParticipantTypes";
import ME from "ME";
import importDefaultResult from "_getPrototypeOf";
import set from "_possibleConstructorReturn";
let closure_21;
let closure_22;
let closure_23;
let closure_24;
let closure_25;
let closure_26;
let closure_27;
let require = arg1;
2026-07-20 16:05:17 +00:00
function _isNativeReflectConstruct() {
let closure_0 = !valueOf.call(Reflect.construct(Boolean, [], () => {
}));
function _isNativeReflectConstruct() {
return closure_0;
}
const result = _isNativeReflectConstruct();
}
2026-07-23 10:11:24 +00:00
function _createForOfIteratorHelperLoose(iterable) {
let closure_0 = iterable;
iterable = "undefined" !== typeof Symbol;
if (iterable) {
2026-07-20 16:05:17 +00:00
const _Symbol = Symbol;
2026-07-23 10:11:24 +00:00
iterable = iterable[Symbol.iterator];
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
if (!iterable) {
iterable = iterable[Symbol.iterator];
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
if (iterable) {
const iter = iterable.call(iterable);
2026-07-20 16:05:17 +00:00
const next = iter.next;
return next.bind(iter);
} else {
const _Array = Array;
2026-07-23 10:11:24 +00:00
let tmp = iterable;
if (!Array.isArray(iterable)) {
2026-07-20 16:05:17 +00:00
let tmp2;
2026-07-23 10:11:24 +00:00
if (iterable) {
if ("string" === typeof iterable) {
tmp2 = _arrayLikeToArray(iterable, undefined);
2026-07-20 16:05:17 +00:00
} else {
const toString = {}.toString;
2026-07-23 10:11:24 +00:00
const substr = toString.call(iterable).slice(8, -1);
2026-07-20 16:05:17 +00:00
let name = substr;
if (tmp3) {
2026-07-23 10:11:24 +00:00
name = iterable.constructor.name;
2026-07-20 16:05:17 +00:00
}
if ("Map" !== name) {
if ("Set" !== name) {
if ("Arguments" === name) {
2026-07-23 10:11:24 +00:00
let arr = _arrayLikeToArray(iterable, undefined);
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
let obj = /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/;
2026-07-20 16:05:17 +00:00
}
}
tmp2 = arr;
}
const _Array2 = Array;
2026-07-23 10:11:24 +00:00
arr = Array.from(iterable);
const callResult = toString.call(iterable);
tmp3 = "Object" === substr && iterable.constructor;
2026-07-20 16:05:17 +00:00
}
}
tmp = tmp2;
if (!tmp2) {
const _TypeError = TypeError;
const typeError = new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
throw typeError;
}
}
if (tmp) {
2026-07-23 10:11:24 +00:00
closure_0 = tmp;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
let c1 = 0;
2026-07-20 16:05:17 +00:00
return () => {
2026-07-23 10:11:24 +00:00
if (closure_1 >= length.length) {
2026-07-20 16:05:17 +00:00
let obj = { done: true };
} else {
obj = { done: false };
closure_1 = tmp3 + 1;
2026-07-23 10:11:24 +00:00
obj.value = length[+closure_1];
2026-07-20 16:05:17 +00:00
}
return obj;
};
}
}
function _arrayLikeToArray(arg0, arg1) {
let length;
if (tmp) {
length = arg0.length;
}
const ArrayResult = Array(length);
for (let num = 0; num < length; num = num + 1) {
ArrayResult[num] = arg0[num];
}
return ArrayResult;
}
function _getParticipants(channelId) {
2026-07-23 10:11:24 +00:00
let tmp = table[channelId];
2026-07-20 16:05:17 +00:00
if (null == tmp) {
2026-07-27 11:26:19 +00:00
let tmp4 = importDefault(10449);
2026-07-20 16:05:17 +00:00
const prototype = tmp4.prototype;
tmp4 = new tmp4(channelId);
2026-07-23 10:11:24 +00:00
table[channelId] = tmp4;
2026-07-20 16:05:17 +00:00
tmp = tmp4;
}
return tmp;
}
function updateParticipants(arg0) {
let arr = arg1;
2026-07-23 10:11:24 +00:00
let closure_0 = arg0;
2026-07-20 16:05:17 +00:00
if (arg1 === undefined) {
arr = closure_30;
}
return arr.reduce((arg0, arg1) => {
2026-07-23 10:11:24 +00:00
if (!callback(outer1_45(arg1))) {
2026-07-20 16:05:17 +00:00
return arg0;
} else {
2026-07-23 10:11:24 +00:00
let obj = outer1_45(arg1);
2026-07-20 16:05:17 +00:00
if (0 === obj.size()) {
2026-07-23 10:11:24 +00:00
(function updateSelectedParticipantId(arg0) {
let id = outer2_12.getId();
const obj = outer2_45(arg0);
2026-07-20 16:05:17 +00:00
if (0 !== obj.size()) {
2026-07-23 10:11:24 +00:00
if (outer2_16.getVoiceChannelId() === arg0) {
const NONE2 = outer2_22.NONE;
const found = obj.toArray(callback(outer2_2[21]).ChannelRTCParticipantsIndexes.STREAM).find((type) => {
let activeStreamForStreamKey = type.type === outer3_21.STREAM;
2026-07-20 16:05:17 +00:00
if (activeStreamForStreamKey) {
2026-07-23 10:11:24 +00:00
activeStreamForStreamKey = outer3_11.getActiveStreamForStreamKey(type.id);
2026-07-20 16:05:17 +00:00
}
return activeStreamForStreamKey;
});
if (null != found) {
2026-07-23 10:11:24 +00:00
outer2_1(outer2_2[23])(found.type === outer2_21.STREAM, "Impossible condition");
2026-07-20 16:05:17 +00:00
id = found.id;
} else if (1 !== obj.size()) {
2026-07-23 10:11:24 +00:00
if (1 === obj.size(callback(outer2_2[21]).ChannelRTCParticipantsIndexes.VIDEO)) {
id = outer2_8(obj.toArray(callback(outer2_2[21]).ChannelRTCParticipantsIndexes.VIDEO), 1)[0].id;
2026-07-20 16:05:17 +00:00
} else {
const found1 = obj.toArray().find((type) => {
2026-07-23 10:11:24 +00:00
let tmp = type.type === outer3_21.USER;
2026-07-20 16:05:17 +00:00
if (tmp) {
tmp = type.id !== id;
}
if (tmp) {
tmp = !type.ringing;
}
return tmp;
});
let id1;
if (null != found1) {
id1 = found1.id;
}
if (null != id1) {
id = id1;
}
const toArrayResult1 = obj.toArray();
}
}
2026-07-23 10:11:24 +00:00
const first = outer2_8(outer2_48(arg0), 1)[0];
2026-07-20 16:05:17 +00:00
let NONE = first;
2026-07-23 10:11:24 +00:00
if (first !== outer2_22.AUTO) {
2026-07-20 16:05:17 +00:00
NONE = first;
2026-07-23 10:11:24 +00:00
if (first !== outer2_22.NONE) {
2026-07-20 16:05:17 +00:00
const participant = obj.getParticipant(first);
let tmp17 = null == participant;
if (!tmp17) {
2026-07-23 10:11:24 +00:00
let tmp19 = participant.type === outer2_21.STREAM;
2026-07-20 16:05:17 +00:00
if (tmp19) {
2026-07-23 10:11:24 +00:00
tmp19 = null == outer2_11.getActiveStreamForStreamKey(participant.id);
2026-07-20 16:05:17 +00:00
}
tmp17 = tmp19;
}
NONE = first;
if (tmp17) {
2026-07-23 10:11:24 +00:00
NONE = outer2_22.NONE;
2026-07-20 16:05:17 +00:00
}
}
}
const items = [NONE, id];
2026-07-23 10:11:24 +00:00
outer2_51(arg0, items);
2026-07-20 16:05:17 +00:00
}
}
2026-07-23 10:11:24 +00:00
outer2_51(arg0, null);
})(arg1);
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
if (!outer1_58(arg1)) {
if (!outer1_52(obj)) {
let VIDEO = outer1_25.VOICE;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
if (VIDEO !== outer1_25.VOICE) {
outer1_35[arg1] = VIDEO;
2026-07-20 16:05:17 +00:00
}
}
2026-07-23 10:11:24 +00:00
VIDEO = outer1_25.VIDEO;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
let tmp13;
if (null != outer1_36[arg1]) {
tmp13 = tmp11[outer1_27.APP];
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
delete tmp3[tmp2];
if (tmp13 !== outer1_24.HAVEN) {
delete tmp[tmp2];
2026-07-20 16:05:17 +00:00
}
}
}, false);
}
function updateParticipant(arg0) {
let tmp = arg1;
2026-07-23 10:11:24 +00:00
let closure_0 = arg0;
2026-07-20 16:05:17 +00:00
if (arg1 === undefined) {
tmp = closure_30;
}
2026-07-23 10:11:24 +00:00
return updateParticipants((updateParticipant) => updateParticipant.updateParticipant(closure_0), tmp);
2026-07-20 16:05:17 +00:00
}
function _getSelectedParticipantId(channelId) {
const channel = store2.getChannel(channelId);
if (null != channel) {
channel.isDM();
}
2026-07-23 10:11:24 +00:00
let tmp3 = dependencyMap[channelId];
2026-07-20 16:05:17 +00:00
if (null == tmp3) {
const items = [tmp2, constants2.NONE];
tmp3 = items;
}
return tmp3;
}
function getHasSelectedParticipant(channelId) {
2026-07-23 10:11:24 +00:00
let tmp = null != dependencyMap[channelId];
2026-07-20 16:05:17 +00:00
if (tmp) {
2026-07-23 10:11:24 +00:00
tmp = callback3(dependencyMap[channelId], 1)[0] !== constants2.NONE;
2026-07-20 16:05:17 +00:00
}
return tmp;
}
function updateElapsedSelectedParticipantStats(currentVoiceChannelId) {
2026-07-23 10:11:24 +00:00
if (null == dependencyMap2[currentVoiceChannelId]) {
dependencyMap2[currentVoiceChannelId] = { gridDurationMs: 0, focusDurationMs: 0, toggleCount: 0, lastUpdate: 0 };
2026-07-20 16:05:17 +00:00
}
const nowResult = performance.now();
2026-07-23 10:11:24 +00:00
if (dependencyMap2[currentVoiceChannelId].lastUpdate > 0) {
2026-07-20 16:05:17 +00:00
let str = "gridDurationMs";
const diff = nowResult - tmp2.lastUpdate;
if (tmp4) {
str = "focusDurationMs";
}
tmp2[str] = tmp2[str] + diff;
}
2026-07-23 10:11:24 +00:00
dependencyMap2[currentVoiceChannelId].lastUpdate = nowResult;
2026-07-20 16:05:17 +00:00
}
function setSelectedParticipantId(channelId, arg1) {
updateElapsedSelectedParticipantStats(channelId);
if (null == arg1) {
2026-07-23 10:11:24 +00:00
delete tmp2[tmp];
2026-07-20 16:05:17 +00:00
} else {
2026-07-21 22:01:30 +00:00
closure_33[channelId] = arg1;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
if (tmp4 !== getHasSelectedParticipant(channelId)) {
dependencyMap2[channelId].toggleCount = dependencyMap2[channelId].toggleCount + 1;
2026-07-20 16:05:17 +00:00
}
}
function hasVideo(id) {
2026-07-27 11:26:19 +00:00
let hasEmbeddedActivityResult = id.size(require(10449) /* getEmbeddedActivityParticipantId */.ChannelRTCParticipantsIndexes.STREAM) > 0;
2026-07-20 16:05:17 +00:00
if (!hasEmbeddedActivityResult) {
2026-07-27 11:26:19 +00:00
hasEmbeddedActivityResult = id.size(require(10449) /* getEmbeddedActivityParticipantId */.ChannelRTCParticipantsIndexes.VIDEO) > 0;
2026-07-20 16:05:17 +00:00
}
if (!hasEmbeddedActivityResult) {
hasEmbeddedActivityResult = id.hasEmbeddedActivity();
}
return hasEmbeddedActivityResult;
}
function clearChannel(arg0) {
2026-07-23 10:11:24 +00:00
delete tmp3[tmp2];
delete tmp3[tmp2];
delete tmp3[tmp2];
delete tmp[tmp2];
2026-07-20 16:05:17 +00:00
}
function handleRebuildActiveChannels() {
const items = [];
const channelId = store3.getChannelId();
if (null != channelId) {
items.push(channelId);
}
const voiceChannelId = store3.getVoiceChannelId();
if (!tmp5) {
items.push(voiceChannelId);
}
2026-07-23 10:11:24 +00:00
remoteSessionId = remoteSessionId.getRemoteSessionId();
voiceStateForSession = voiceStateForSession.getVoiceStateForSession(store.getId(), remoteSessionId);
2026-07-20 16:05:17 +00:00
let channelId1;
if (null != voiceStateForSession) {
channelId1 = voiceStateForSession.channelId;
}
if (null != channelId1) {
let channelId2;
if (null != voiceStateForSession) {
channelId2 = voiceStateForSession.channelId;
}
items.push(channelId2);
}
const tmp = updateParticipants;
2026-07-23 10:11:24 +00:00
tmp5 = null == voiceChannelId || items.includes(voiceChannelId);
const obj = importDefault(22);
const item = importDefault(22).difference(items, items).forEach(clearChannel);
const differenceResult = importDefault(22).difference(items, items);
return tmp((rebuild) => rebuild.rebuild(), importDefault(22).difference(items, items));
2026-07-20 16:05:17 +00:00
}
2026-07-21 22:01:30 +00:00
function setChatOpen(channelId, chatOpen) {
closure_39[channelId] = chatOpen;
if (chatOpen) {
obj.add(channelId);
} else {
obj.delete(channelId);
}
}
function deleteChatOpen(currentVoiceChannelId) {
2026-07-23 10:11:24 +00:00
delete tmp[tmp2];
2026-07-21 22:01:30 +00:00
set.delete(currentVoiceChannelId);
}
2026-07-20 16:05:17 +00:00
function handleEmbeddedActivityChange() {
return updateParticipants((updateEmbeddedActivities) => updateEmbeddedActivities.updateEmbeddedActivities());
}
function handleSpeaking(userId) {
2026-07-23 10:11:24 +00:00
userId = userId.userId;
2026-07-20 16:05:17 +00:00
return updateParticipants((updateParticipantSpeaking) => updateParticipantSpeaking.updateParticipantSpeaking(userId));
}
function handleUserUpdate(user) {
return updateParticipant(user.user.id);
}
function handleCallUpdate(channelId) {
const items = [channelId.channelId];
return updateParticipants((rebuild) => rebuild.rebuild(), items);
}
function handleChannelDelete(channel) {
2026-07-21 22:01:30 +00:00
const id = channel.channel.id;
deleteChatOpen(id);
2026-07-23 10:11:24 +00:00
delete tmp2[tmp];
2026-07-21 22:01:30 +00:00
clearChannel(id);
2026-07-20 16:05:17 +00:00
}
function handleStreamClose(streamKey) {
2026-07-25 08:10:48 +00:00
const decodeStreamKeyResult = require(4195) /* isStreamKey */.decodeStreamKey(streamKey.streamKey);
2026-07-20 16:05:17 +00:00
const items = [decodeStreamKeyResult.channelId];
return updateParticipant(decodeStreamKeyResult.ownerId, items);
}
function isGuildVocalOrThread(channelId) {
const channel = store2.getChannel(channelId);
let isGuildVocalOrThreadResult;
if (null != channel) {
isGuildVocalOrThreadResult = channel.isGuildVocalOrThread();
}
return Boolean(isGuildVocalOrThreadResult);
}
2026-07-23 10:11:24 +00:00
({ ParticipantTypes: closure_21, ParticipantSelectionTypes: closure_22, isStreamParticipant: closure_23 } = ParticipantTypes);
({ ChannelLayouts: closure_24, ChannelModes: closure_25, ChannelTypes: closure_26, AppContext: closure_27 } = ME);
2026-07-20 16:05:17 +00:00
importDefaultResult = new importDefaultResult("ChannelRTCStore");
importDefaultResult.enableNativeLogger(true);
const frozen = Object.freeze([]);
let closure_30 = [];
2026-07-23 10:11:24 +00:00
let set = new Set();
2026-07-20 16:05:17 +00:00
let closure_32 = {};
let closure_33 = {};
let closure_34 = {};
let closure_35 = {};
let closure_36 = {};
let closure_37 = {};
let closure_38 = {};
let closure_39 = {};
let closure_40 = {};
2026-07-21 22:01:30 +00:00
let closure_41 = {};
2026-07-23 10:11:24 +00:00
let tmp8 = ((PersistedStore) => {
2026-07-20 16:05:17 +00:00
class ChannelRTCStore {
constructor() {
self = this;
2026-07-23 10:11:24 +00:00
tmp = outer1_3(this, ChannelRTCStore);
obj = outer1_6(ChannelRTCStore);
tmp2 = outer1_5;
if (outer1_42()) {
2026-07-20 16:05:17 +00:00
tmp6 = globalThis;
_Reflect = Reflect;
2026-07-23 10:11:24 +00:00
tmp7 = outer1_6;
2026-07-20 16:05:17 +00:00
tmp8 = arguments;
2026-07-23 10:11:24 +00:00
constructResult = Reflect.construct(obj, arguments, outer1_6(self).constructor);
2026-07-20 16:05:17 +00:00
} else {
tmp3 = arguments;
tmp4 = arguments;
constructResult = obj(...arguments);
}
return tmp2(self, constructResult);
}
}
callback2(ChannelRTCStore, PersistedStore);
let obj = {
key: "initialize",
value(voiceParticipantsHidden) {
2026-07-23 10:11:24 +00:00
this.waitFor(outer1_11, outer1_12, outer1_13, outer1_14, outer1_9, outer1_10, outer1_15, outer1_16, outer1_17, outer1_18, outer1_19, outer1_20);
const items = [outer1_9];
this.syncWith(items, outer1_57);
const items1 = [outer1_10];
this.syncWith(items1, outer1_54);
2026-07-20 16:05:17 +00:00
let prop;
if (null != voiceParticipantsHidden) {
prop = voiceParticipantsHidden.voiceParticipantsHidden;
}
if (undefined !== prop) {
let prop1;
if (null != voiceParticipantsHidden) {
prop1 = voiceParticipantsHidden.voiceParticipantsHidden;
}
2026-07-23 10:11:24 +00:00
const merged = Object.assign(outer1_38, prop1);
const tmp6 = outer1_38;
2026-07-20 16:05:17 +00:00
}
}
};
2026-07-23 10:11:24 +00:00
let items = [obj, , , , , , , , , , , , , , , , , , , , , , , , , ];
2026-07-20 16:05:17 +00:00
obj = {
key: "getState",
value() {
2026-07-23 10:11:24 +00:00
return { voiceParticipantsHidden: outer1_38 };
2026-07-20 16:05:17 +00:00
}
};
items[1] = obj;
obj = {
key: "getParticipantsVersion",
value(arg0) {
2026-07-23 10:11:24 +00:00
return outer1_45(arg0).version;
2026-07-20 16:05:17 +00:00
}
};
items[2] = obj;
items[3] = {
key: "getParticipants",
value(arg0) {
2026-07-23 10:11:24 +00:00
let toArrayResult = outer1_45(arg0).toArray();
2026-07-20 16:05:17 +00:00
if (null == toArrayResult) {
2026-07-23 10:11:24 +00:00
toArrayResult = outer1_29;
2026-07-20 16:05:17 +00:00
}
return toArrayResult;
}
};
items[4] = {
key: "getSpeakingParticipants",
value(arg0) {
2026-07-23 10:11:24 +00:00
let toArrayResult = outer1_45(arg0).toArray(ChannelRTCStore(outer1_2[21]).ChannelRTCParticipantsIndexes.SPEAKING);
2026-07-20 16:05:17 +00:00
if (null == toArrayResult) {
2026-07-23 10:11:24 +00:00
toArrayResult = outer1_29;
2026-07-20 16:05:17 +00:00
}
return toArrayResult;
}
};
items[5] = {
key: "getFilteredParticipants",
value(arg0) {
2026-07-23 10:11:24 +00:00
const obj = outer1_45(arg0);
if (null != outer1_38[arg0]) {
2026-07-20 16:05:17 +00:00
if (tmp) {
2026-07-23 10:11:24 +00:00
let toArrayResult = obj.toArray(ChannelRTCStore(outer1_2[21]).ChannelRTCParticipantsIndexes.FILTERED);
2026-07-20 16:05:17 +00:00
}
return toArrayResult;
}
2026-07-23 10:11:24 +00:00
toArrayResult = obj.toArray(ChannelRTCStore(outer1_2[21]).ChannelRTCParticipantsIndexes.NOT_POPPED_OUT);
2026-07-20 16:05:17 +00:00
}
};
items[6] = {
key: "getVideoParticipants",
value(arg0) {
2026-07-23 10:11:24 +00:00
let toArrayResult = outer1_45(arg0).toArray(ChannelRTCStore(outer1_2[21]).ChannelRTCParticipantsIndexes.VIDEO);
2026-07-20 16:05:17 +00:00
if (null == toArrayResult) {
2026-07-23 10:11:24 +00:00
toArrayResult = outer1_29;
2026-07-20 16:05:17 +00:00
}
return toArrayResult;
}
};
items[7] = {
key: "getStreamParticipants",
value(arg0) {
2026-07-23 10:11:24 +00:00
let toArrayResult = outer1_45(arg0).toArray(ChannelRTCStore(outer1_2[21]).ChannelRTCParticipantsIndexes.STREAM);
2026-07-20 16:05:17 +00:00
if (null == toArrayResult) {
2026-07-23 10:11:24 +00:00
toArrayResult = outer1_29;
2026-07-20 16:05:17 +00:00
}
return toArrayResult;
}
};
items[8] = {
key: "getActivityParticipants",
value(arg0) {
2026-07-23 10:11:24 +00:00
let toArrayResult = outer1_45(arg0).toArray(ChannelRTCStore(outer1_2[21]).ChannelRTCParticipantsIndexes.ACTIVITY);
2026-07-20 16:05:17 +00:00
if (null == toArrayResult) {
2026-07-23 10:11:24 +00:00
toArrayResult = outer1_29;
2026-07-20 16:05:17 +00:00
}
return toArrayResult;
}
};
items[9] = {
key: "getParticipant",
value(arg0, arg1) {
2026-07-23 10:11:24 +00:00
return outer1_45(arg0).getParticipant(arg1);
2026-07-20 16:05:17 +00:00
}
};
items[10] = {
key: "getUserParticipantCount",
value(arg0) {
2026-07-23 10:11:24 +00:00
const obj = outer1_45(arg0);
const diff = obj.size() - obj.size(ChannelRTCStore(outer1_2[21]).ChannelRTCParticipantsIndexes.STREAM);
return diff - obj.size(ChannelRTCStore(outer1_2[21]).ChannelRTCParticipantsIndexes.ACTIVITY);
2026-07-20 16:05:17 +00:00
}
};
items[11] = {
key: "getParticipantsOpen",
value(arg0) {
2026-07-23 10:11:24 +00:00
return null == outer1_37[arg0] || outer1_37[arg0];
2026-07-20 16:05:17 +00:00
}
};
items[12] = {
key: "getVoiceParticipantsHidden",
value(arg0) {
2026-07-23 10:11:24 +00:00
return null != outer1_38[arg0] && outer1_38[arg0];
2026-07-20 16:05:17 +00:00
}
};
items[13] = {
key: "getSelectedParticipantId",
value(arg0) {
2026-07-23 10:11:24 +00:00
const tmp = outer1_8(outer1_48(arg0), 2);
2026-07-20 16:05:17 +00:00
let first = tmp[0];
let tmp4 = null;
2026-07-23 10:11:24 +00:00
if (first !== outer1_22.NONE) {
if (first === outer1_22.AUTO) {
2026-07-20 16:05:17 +00:00
let tmp7 = null;
2026-07-23 10:11:24 +00:00
if (tmp3 !== outer1_22.NONE) {
2026-07-20 16:05:17 +00:00
tmp7 = null;
2026-07-23 10:11:24 +00:00
if (tmp3 !== outer1_22.AUTO) {
2026-07-20 16:05:17 +00:00
tmp7 = tmp3;
}
}
first = tmp7;
}
tmp4 = first;
}
return tmp4;
}
};
items[14] = {
key: "getSelectedParticipant",
value(arg0) {
const selectedParticipantId = this.getSelectedParticipantId(arg0);
let participant = null;
if (null != selectedParticipantId) {
2026-07-23 10:11:24 +00:00
participant = outer1_45(arg0).getParticipant(selectedParticipantId);
const obj = outer1_45(arg0);
2026-07-20 16:05:17 +00:00
}
return participant;
}
};
items[15] = {
key: "getSelectedParticipantStats",
value(arg0) {
2026-07-23 10:11:24 +00:00
if (null == outer1_34[arg0]) {
2026-07-20 16:05:17 +00:00
let obj = {};
} else {
obj = {};
const _Math = Math;
obj.view_mode_grid_duration_ms = Math.floor(tmp.gridDurationMs);
const _Math2 = Math;
obj.view_mode_focus_duration_ms = Math.floor(tmp.focusDurationMs);
obj.view_mode_toggle_count = tmp.toggleCount;
}
return obj;
}
};
items[16] = {
key: "getGuildRingingUsers",
value(arg0) {
2026-07-23 10:11:24 +00:00
return outer1_45(arg0).guildRingingUsers;
2026-07-20 16:05:17 +00:00
}
};
items[17] = {
key: "getMode",
value(arg0) {
2026-07-23 10:11:24 +00:00
if (null != outer1_35[arg0]) {
2026-07-20 16:05:17 +00:00
return tmp;
} else {
2026-07-23 10:11:24 +00:00
outer1_58(arg0) ? outer1_25.VIDEO : outer1_25.VOICE;
2026-07-20 16:05:17 +00:00
}
}
};
items[18] = {
key: "getLayout",
value(arg0) {
if (arg1 === undefined) {
2026-07-23 10:11:24 +00:00
const APP = outer1_27.APP;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
return outer1_24.NORMAL;
2026-07-20 16:05:17 +00:00
}
};
items[19] = {
key: "getChatOpen",
value(arg0) {
2026-07-23 10:11:24 +00:00
return null != outer1_39[arg0] && outer1_39[arg0];
2026-07-20 16:05:17 +00:00
}
};
items[20] = {
key: "getAllChatOpen",
value() {
2026-07-23 10:11:24 +00:00
return outer1_39;
2026-07-20 16:05:17 +00:00
}
};
items[21] = {
2026-07-21 22:01:30 +00:00
key: "getOpenChatChannelIds",
value() {
2026-07-23 10:11:24 +00:00
return outer1_31;
2026-07-21 22:01:30 +00:00
}
};
items[22] = {
2026-07-20 16:05:17 +00:00
key: "isFullscreenInContext",
value() {
let APP = arg0;
if (arg0 === undefined) {
2026-07-23 10:11:24 +00:00
APP = outer1_27.APP;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
const values = Object.values(outer1_36);
return values.some((arg0) => arg0[APP] === outer2_24.FULL_SCREEN);
2026-07-20 16:05:17 +00:00
}
};
2026-07-21 22:01:30 +00:00
items[23] = {
2026-07-20 16:05:17 +00:00
key: "getStageStreamSize",
value(arg0) {
2026-07-23 10:11:24 +00:00
return outer1_40[arg0];
2026-07-20 16:05:17 +00:00
}
};
2026-07-21 22:01:30 +00:00
items[24] = {
2026-07-20 16:05:17 +00:00
key: "getStageVideoLimitBoostUpsellDismissed",
value(arg0) {
2026-07-23 10:11:24 +00:00
return outer1_41[arg0];
2026-07-20 16:05:17 +00:00
}
};
2026-07-21 22:01:30 +00:00
items[25] = {
2026-07-20 16:05:17 +00:00
key: "isParticipantPoppedOut",
value(arg0, arg1) {
const participant = this.getParticipant(arg0, arg1);
let tmp2 = null != participant;
if (tmp2) {
tmp2 = "isPoppedOut" in participant && participant.isPoppedOut;
const tmp3 = "isPoppedOut" in participant && participant.isPoppedOut;
}
return tmp2;
}
};
return callback(ChannelRTCStore, items);
2026-07-23 10:11:24 +00:00
})(require("initialize").PersistedStore);
2026-07-21 22:01:30 +00:00
tmp8.displayName = "ChannelRTCStore";
tmp8.persistKey = "ChannelRTCStore";
2026-07-23 10:11:24 +00:00
tmp8 = new tmp8(require("dispatcher"), {
2026-07-20 16:05:17 +00:00
CONNECTION_OPEN: function handleConnectionOpen() {
let done;
const tmp = _createForOfIteratorHelperLoose(closure_30);
let iter = tmp();
if (!iter.done) {
do {
2026-07-23 10:11:24 +00:00
let tmp2 = clearChannel;
let tmp3 = clearChannel(iter.value);
2026-07-20 16:05:17 +00:00
let iter2 = tmp();
iter = iter2;
done = iter2.done;
} while (!done);
}
handleRebuildActiveChannels();
},
CONNECTION_OPEN_SUPPLEMENTAL: handleRebuildActiveChannels,
THREAD_LIST_SYNC: handleRebuildActiveChannels,
OVERLAY_INITIALIZE: handleRebuildActiveChannels,
VOICE_CHANNEL_SELECT: function handleVoiceChannelSelect(arg0) {
let channelId;
let currentVoiceChannelId;
({ channelId, currentVoiceChannelId } = arg0);
2026-07-23 10:11:24 +00:00
let c0;
2026-07-20 16:05:17 +00:00
if (null != channelId) {
2026-07-23 10:11:24 +00:00
delete tmp[tmp4];
2026-07-20 16:05:17 +00:00
} else if (null != currentVoiceChannelId) {
2026-07-21 22:01:30 +00:00
deleteChatOpen(currentVoiceChannelId);
2026-07-23 10:11:24 +00:00
delete tmp2[tmp3];
2026-07-20 16:05:17 +00:00
updateElapsedSelectedParticipantStats(currentVoiceChannelId);
}
let flag = false;
if (channelId !== currentVoiceChannelId) {
flag = false;
if (null != currentVoiceChannelId) {
2026-07-23 10:11:24 +00:00
const tmp12 = _getParticipants(currentVoiceChannelId);
c0 = tmp12;
const guildRingingUsers = tmp12.guildRingingUsers;
const item = guildRingingUsers.forEach((arg0) => _undefined.updateGuildRingingUsers(arg0, false));
2026-07-20 16:05:17 +00:00
const items = [currentVoiceChannelId];
flag = updateParticipants((rebuild) => rebuild.rebuild(), items);
}
}
if (!flag) {
flag = handleRebuildActiveChannels();
}
return flag;
},
CHANNEL_SELECT: function handleChannelSelect(channelId) {
channelId = channelId.channelId;
const tmp = handleRebuildActiveChannels();
if (null == channelId) {
return tmp;
} else if (null == channelId.messageId) {
return tmp;
2026-07-23 10:11:24 +00:00
} else if (table2[channelId]) {
2026-07-20 16:05:17 +00:00
return tmp;
} else {
const channel = store2.getChannel(channelId);
let tmp4 = tmp;
if (null != channel) {
let flag = tmp;
if (channel.isGuildVocal()) {
2026-07-21 22:01:30 +00:00
setChatOpen(channelId, true);
2026-07-20 16:05:17 +00:00
flag = true;
}
tmp4 = flag;
}
return tmp4;
}
},
CHANNEL_RTC_ACTIVE_CHANNELS: handleRebuildActiveChannels,
VOICE_STATE_UPDATES: function handleVoiceStateUpdates(arg0) {
2026-07-23 10:11:24 +00:00
let require;
2026-07-20 16:05:17 +00:00
let voiceStates;
2026-07-23 10:11:24 +00:00
({ voiceStates, initial: require } = arg0);
2026-07-20 16:05:17 +00:00
return voiceStates.reduce((arg0, arg1) => {
let channelId;
let guildId;
let userId;
({ userId, channelId, guildId } = arg1);
if (tmp) {
2026-07-23 10:11:24 +00:00
let obj = outer1_1(outer1_2[24]);
2026-07-20 16:05:17 +00:00
obj = { guildId, location: "voice_status_update" };
obj = { autoTrackExposure: false };
if (obj.getCurrentConfig(obj, obj).enabled) {
2026-07-23 10:11:24 +00:00
const result = outer1_45(channelId).updateGuildRingingUsers(userId, false);
const obj4 = outer1_45(channelId);
2026-07-20 16:05:17 +00:00
}
}
if (closure_0) {
if (null != channelId) {
let tmp7 = arg0;
}
return tmp7;
}
2026-07-23 10:11:24 +00:00
tmp7 = outer1_47(userId) || arg0;
2026-07-20 16:05:17 +00:00
}, false);
},
CHANNEL_CREATE: function handleChannelCreate(channel) {
channel = channel.channel;
if (channel.type === constants4.GROUP_DM) {
const originChannelId = channel.originChannelId;
if (null != originChannelId) {
const obj = {};
let NORMAL;
2026-07-23 10:11:24 +00:00
if (null != dependencyMap3[originChannelId]) {
NORMAL = tmp5[constants5.APP];
2026-07-20 16:05:17 +00:00
}
if (null == NORMAL) {
NORMAL = constants3.NORMAL;
}
obj[constants5.APP] = NORMAL;
2026-07-23 10:11:24 +00:00
dependencyMap3[channel.id] = obj;
2026-07-20 16:05:17 +00:00
return true;
}
}
return false;
},
CHANNEL_DELETE: handleChannelDelete,
THREAD_DELETE: handleChannelDelete,
CALL_CREATE: handleCallUpdate,
CALL_UPDATE: handleCallUpdate,
CALL_DELETE: function handleCallDelete(channelId) {
clearChannel(channelId.channelId);
},
CHANNEL_RTC_SELECT_PARTICIPANT: function handleSelectParticipant(channelId) {
channelId = channelId.channelId;
const id = channelId.id;
const tmp3 = _getParticipants(channelId);
2026-07-23 10:11:24 +00:00
const require = tmp3;
2026-07-20 16:05:17 +00:00
if (null == id) {
2026-07-27 11:26:19 +00:00
const item = tmp3.toArray(require(10449) /* getEmbeddedActivityParticipantId */.ChannelRTCParticipantsIndexes.STREAM).forEach((user) => {
2026-07-23 10:11:24 +00:00
if (outer1_23(user)) {
2026-07-20 16:05:17 +00:00
tmp3.updateParticipant(user.user.id);
}
});
2026-07-27 11:26:19 +00:00
const toArrayResult = tmp3.toArray(require(10449) /* getEmbeddedActivityParticipantId */.ChannelRTCParticipantsIndexes.STREAM);
2026-07-20 16:05:17 +00:00
}
if (null != id) {
let NONE = id;
} else {
NONE = constants2.NONE;
}
const items = [NONE, callback3(_getSelectedParticipantId(channelId), 2)[1]];
setSelectedParticipantId(channelId, items);
if (obj2.isStreamKey(id)) {
2026-07-25 08:10:48 +00:00
const ownerId = require(4195) /* isStreamKey */.decodeStreamKey(tmp2).ownerId;
2026-07-20 16:05:17 +00:00
if (ownerId === store.getId()) {
const items1 = [tmp];
updateParticipant(tmp14, items1);
}
while (true) {
let tmp20 = hasVideo;
if (hasVideo(tmp3)) {
break;
} else {
2026-07-21 22:01:30 +00:00
let tmp21 = closure_37;
2026-07-20 16:05:17 +00:00
let tmp22 = channelId;
let flag = false;
2026-07-21 22:01:30 +00:00
closure_37[tmp] = false;
2026-07-20 16:05:17 +00:00
break;
}
break;
}
2026-07-25 08:10:48 +00:00
const obj3 = require(4195) /* isStreamKey */;
2026-07-23 10:11:24 +00:00
tmp14 = ownerId;
2026-07-20 16:05:17 +00:00
}
},
CHANNEL_RTC_POPOUT_PARTICIPANT: function handlePopOutParticipant(arg0) {
let channelId;
let participantId;
({ channelId, participantId } = arg0);
if (callback3(_getSelectedParticipantId(channelId), 1)[0] === participantId) {
setSelectedParticipantId(channelId, null);
}
const obj = _getParticipants(channelId);
const participant = obj.getParticipant(participantId);
let tmp5 = null != participant;
if (tmp5) {
tmp5 = participant.type !== constants.ACTIVITY;
}
if (tmp5) {
const result = obj.updateParticipantPoppedOut(participantId, true);
const items = [channelId];
updateParticipant(participant.user.id, items);
}
},
CHANNEL_RTC_RETURN_PARTICIPANT: function handleReturnParticipant(arg0) {
let channelId;
let participantId;
({ channelId, participantId } = arg0);
const obj = _getParticipants(channelId);
const result = obj.updateParticipantPoppedOut(participantId, false);
const participant = obj.getParticipant(participantId);
let tmp3 = null != participant;
if (tmp3) {
tmp3 = participant.type !== constants.ACTIVITY;
}
if (tmp3) {
const items = [channelId];
updateParticipant(participant.user.id, items);
}
},
CHANNEL_RTC_UPDATE_LAYOUT: function handleCallLayout(channelId) {
let appContext;
let layout;
channelId = channelId.channelId;
const obj = {};
({ layout, appContext } = channelId);
2026-07-23 10:11:24 +00:00
const merged = Object.assign(dependencyMap3[channelId]);
2026-07-20 16:05:17 +00:00
obj[appContext] = layout;
2026-07-23 10:11:24 +00:00
dependencyMap3[channelId] = obj;
2026-07-20 16:05:17 +00:00
},
CHANNEL_RTC_UPDATE_PARTICIPANTS_OPEN: function handleUpdateParticipantsOpen(channelId) {
2026-07-21 22:01:30 +00:00
closure_37[channelId.channelId] = channelId.participantsOpen;
2026-07-20 16:05:17 +00:00
},
CHANNEL_RTC_UPDATE_VOICE_PARTICIPANTS_HIDDEN: function handleUpdateVoiceParticipantsHidden(channelId) {
2026-07-21 22:01:30 +00:00
closure_38[channelId.channelId] = channelId.voiceParticipantsHidden;
2026-07-20 16:05:17 +00:00
},
CHANNEL_RTC_UPDATE_STAGE_STREAM_SIZE: function handleUpdateStageStreamSize(channelId) {
2026-07-21 22:01:30 +00:00
closure_40[channelId.channelId] = channelId.large;
2026-07-20 16:05:17 +00:00
},
CHANNEL_RTC_UPDATE_STAGE_VIDEO_LIMIT_BOOST_UPSELL_DISMISSED: function handleUpdateStageVideoLimitBoostUpsellDismissed(channelId) {
2026-07-21 22:01:30 +00:00
closure_41[channelId.channelId] = channelId.dismissed;
2026-07-20 16:05:17 +00:00
},
STREAM_UPDATE_SELF_HIDDEN: function handleUpdateSelfStreamHidden(channelId) {
channelId = channelId.channelId;
const id = store.getId();
if (channelId.selfStreamHidden) {
const first = callback3(_getSelectedParticipantId(channelId), 1)[0];
2026-07-25 08:10:48 +00:00
const obj2 = require(4195) /* isStreamKey */;
2026-07-20 16:05:17 +00:00
if (tmp6) {
setSelectedParticipantId(channelId, null);
}
2026-07-25 08:10:48 +00:00
tmp6 = require(4195) /* isStreamKey */.isStreamKey(first) && first.includes(id);
2026-07-20 16:05:17 +00:00
}
const items = [channelId];
updateParticipant(id, items);
},
CHANNEL_RTC_UPDATE_CHAT_OPEN: function handleUpdateChatOpen(channelId) {
2026-07-21 22:01:30 +00:00
setChatOpen(channelId.channelId, channelId.chatOpen);
2026-07-20 16:05:17 +00:00
},
RTC_CONNECTION_VIDEO: function handleRTCConnectionVideo(channelId) {
const items = [channelId.channelId];
return updateParticipant(channelId.userId, items);
},
RTC_CONNECTION_PLATFORM: function handleRTCConnectionPlatform(channelId) {
const items = [channelId.channelId];
return updateParticipant(channelId.userId, items);
},
AUDIO_SET_LOCAL_VIDEO_DISABLED: function handleMediaEngineSetLocalVideoDisabled(userId) {
return updateParticipant(userId.userId);
},
MEDIA_ENGINE_VIDEO_SOURCE_QUALITY_CHANGED: function handleVideoSourceQuality(channelId) {
2026-07-23 10:11:24 +00:00
let dependencyMap;
let importDefault;
let require;
({ senderUserId: require, maxResolution: importDefault, maxFrameRate: dependencyMap } = channelId);
2026-07-20 16:05:17 +00:00
const items = [channelId.channelId];
return updateParticipants((updateParticipantQuality) => updateParticipantQuality.updateParticipantQuality(closure_0, closure_1, closure_2), items);
},
STREAM_CLOSE: handleStreamClose,
STREAM_DELETE: handleStreamClose,
STREAM_WATCH: function handleStreamWatch(streamKey) {
2026-07-25 08:10:48 +00:00
const decodeStreamKeyResult = require(4195) /* isStreamKey */.decodeStreamKey(streamKey.streamKey);
2026-07-20 16:05:17 +00:00
const items = [decodeStreamKeyResult.channelId];
return updateParticipant(decodeStreamKeyResult.ownerId, items);
},
SPEAKING: handleSpeaking,
GUILD_SOUNDBOARD_SOUND_PLAY_START: handleSpeaking,
GUILD_SOUNDBOARD_SOUND_PLAY_END: handleSpeaking,
PUSH_TO_TALK_STATE_CHANGE: function handlePushToTalkStateChange() {
2026-07-23 10:11:24 +00:00
return updateParticipants((updateParticipantSpeaking) => updateParticipantSpeaking.updateParticipantSpeaking(outer1_12.getId()));
2026-07-20 16:05:17 +00:00
},
GUILD_RING_START: function handleGuildRingStart(channelId) {
let guildId;
let ongoingRings;
channelId = channelId.channelId;
let closure_0;
({ guildId, ongoingRings } = channelId);
if (obj.getCurrentConfig({ guildId, location: "guild_ring_start" }).enabled) {
closure_0 = _getParticipants(channelId);
const _Object = Object;
const keys = Object.keys(ongoingRings);
const item = keys.forEach((arg0) => closure_0.updateGuildRingingUsers(arg0, true));
const items = [channelId];
return updateParticipants((rebuild) => rebuild.rebuild(), items);
} else {
return false;
}
2026-07-25 08:10:48 +00:00
obj = importDefault(8848);
2026-07-20 16:05:17 +00:00
},
GUILD_RING_STOP: function handleGuildRingStop(guildId) {
let channelId;
let ringing;
({ channelId, ringing } = guildId);
let closure_0;
if (obj.getCurrentConfig({ guildId: guildId.guildId, location: "guild_ring_start" }).enabled) {
closure_0 = _getParticipants(channelId);
const item = ringing.forEach((arg0) => closure_0.updateGuildRingingUsers(arg0, false));
const items = [channelId];
return updateParticipants((rebuild) => rebuild.rebuild(), items);
} else {
return false;
}
2026-07-25 08:10:48 +00:00
obj = importDefault(8848);
2026-07-20 16:05:17 +00:00
},
USER_UPDATE: handleUserUpdate,
GUILD_MEMBER_UPDATE: handleUserUpdate,
GUILD_DELETE: function handleGuildDelete(guild) {
2026-07-23 10:11:24 +00:00
guild = guild.guild;
2026-07-20 16:05:17 +00:00
const items = [];
2026-07-23 10:11:24 +00:00
const item = items(22).forEach(closure_30, (channelId) => {
const channel = outer1_14.getChannel(channelId);
2026-07-20 16:05:17 +00:00
let tmp = null != channel;
if (tmp) {
tmp = channel.getGuildId() !== guild.id;
}
if (!tmp) {
items.push(channelId);
}
});
if (0 === items.length) {
return false;
} else {
2026-07-23 10:11:24 +00:00
const item1 = items(22).forEach(items, (arg0) => {
outer1_53(arg0);
2026-07-20 16:05:17 +00:00
});
}
2026-07-23 10:11:24 +00:00
const arr2 = items(22);
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
});
let result = set.fileFinishedImporting("modules/calls/ChannelRTCStore.tsx");
2026-07-20 16:05:17 +00:00
2026-07-21 22:01:30 +00:00
export default tmp8;
2026-07-20 16:05:17 +00:00
export const NO_PARTICIPANTS = frozen;