decord/source/modules/voice_panel/VoicePanelStore.tsx
github-actions ecf26fc058 chore: update source for alpha 347.2
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4823.js (118.4 MB)
2026-09-16 07:03:15 +00:00

216 lines
6.5 KiB
TypeScript

// Module ID: 4846
// Function ID: 4847
// Name: VoicePanelStore
// Dependencies: [1958, 1243, 4847, 1248, 2]
// Module 4846 (VoicePanelStore)
import ChannelStore from "ChannelStore" /* 1958 */;
const require = fn;
const identity = fn(1243);
const withEqualityFn = identity.createWithEqualityFn((arg0, arg1) => {
closure_0 = arg0;
dependencyMap = arg1;
let obj = {
channels: new Set(),
isActivityFocused: false,
isVoicePanelFullscreen() {
return dependencyMap().voicePanelsFullscreen.size > 0;
},
isAnyVoicePanelOpen() {
return dependencyMap().voicePanelsOpened.size > 0;
},
voicePanelsFullscreen: null,
voicePanelsOpened: null,
voicePanelsPIP: null,
openChannel: null,
closeChannel: null,
isMounted: null,
setIsActivityFocused: null,
setChannelPanelFullscreen: null,
setChannelPanelOpen: null,
isChannelOpen: null,
setChannelPanelPIP: null
};
let set = new Set();
obj.voicePanelsFullscreen = new Set();
let set1 = new Set();
obj.voicePanelsOpened = new Set();
let set2 = new Set();
obj.voicePanelsPIP = new Set();
obj.openChannel = function openChannel(arg0) {
closure_0 = arg0;
let result = closure_0(4847).isStageVoicePanelEnabled("voice_panel_store");
if (!result) {
channel = channel.getChannel(arg0);
let isGuildStageVoiceResult;
if (channel != null) {
isGuildStageVoiceResult = channel.isGuildStageVoice();
}
result = true !== isGuildStageVoiceResult;
}
if (result) {
const channels = dependencyMap().channels;
if (!channels.has(arg0)) {
closure_0(1248).batchUpdates(() => {
closure_0((channels) => {
const obj = {};
const merged = Object.assign(channels);
const items = [closure_1_0, ...Array.from(channels.channels)];
obj.channels = new Set(items);
const items1 = [closure_1_0, ...Array.from(channels.voicePanelsOpened)];
const set = new Set(items);
obj.voicePanelsOpened = new Set(items1);
return obj;
});
});
const tmpResult = closure_0(1248);
}
}
};
obj.closeChannel = function closeChannel(channelId) {
channelId(1248).batchUpdates(() => {
channelId((arg0) => {
({ channels, voicePanelsFullscreen, voicePanelsOpened } = arg0);
if (!channels.has(channelId)) {
if (!voicePanelsFullscreen.has(tmp)) {
let tmp2 = arg0;
}
return tmp2;
}
let tmp3 = channels;
if (channels.has(channelId)) {
const _Set = Set;
const set = new Set(channels);
set.delete(tmp);
tmp3 = set;
}
let tmp10 = voicePanelsFullscreen;
if (voicePanelsFullscreen.has(channelId)) {
const _Set2 = Set;
const set1 = new Set(voicePanelsFullscreen);
set1.delete(tmp);
tmp10 = set1;
}
let tmp17 = voicePanelsOpened;
if (voicePanelsOpened.has(channelId)) {
const _Set3 = Set;
const set2 = new Set(voicePanelsOpened);
set2.delete(tmp);
tmp17 = set2;
}
const obj = {};
const merged = Object.assign(arg0);
obj.channels = tmp3;
obj.voicePanelsFullscreen = tmp10;
obj.voicePanelsOpened = tmp17;
tmp2 = obj;
});
});
};
obj.isMounted = function isMounted(arg0) {
const channels = dependencyMap().channels;
return channels.has(arg0);
};
obj.setIsActivityFocused = function setIsActivityFocused(connectedValue) {
connectedValue(1248).batchUpdates(() => {
connectedValue((isActivityFocused) => {
let tmp2 = isActivityFocused;
if (isActivityFocused.isActivityFocused !== connectedValue) {
const obj = {};
const merged = Object.assign(isActivityFocused);
obj.isActivityFocused = tmp;
tmp2 = obj;
}
return tmp2;
});
});
};
obj.setChannelPanelFullscreen = function setChannelPanelFullscreen(channelId, arg1) {
dependencyMap = arg1;
channelId(1248).batchUpdates(() => {
channelId((voicePanelsFullscreen) => {
const set = new Set(voicePanelsFullscreen.voicePanelsFullscreen);
const hasItem = set.has(channelId);
if (closure_1_1) {
if (hasItem) {
return voicePanelsFullscreen;
} else {
set.add(tmp);
}
} else if (hasItem) {
set.delete(tmp);
} else {
return voicePanelsFullscreen;
}
const obj = {};
const merged = Object.assign(voicePanelsFullscreen);
obj.voicePanelsFullscreen = set;
return obj;
});
});
};
obj.setChannelPanelOpen = function setChannelPanelOpen(channelId, arg1) {
dependencyMap = arg1;
channelId(1248).batchUpdates(() => {
channelId((channels) => {
channels = channels.channels;
if (channels.has(channelId)) {
const _Set = Set;
const set = new Set(channels.voicePanelsOpened);
const hasItem = set.has(tmp);
if (closure_1_1) {
if (hasItem) {
return channels;
} else {
set.add(tmp);
}
} else if (hasItem) {
set.delete(tmp);
} else {
return channels;
}
const obj = {};
const merged = Object.assign(channels);
obj.voicePanelsOpened = set;
return obj;
} else {
return channels;
}
});
});
};
obj.isChannelOpen = function isChannelOpen(arg0) {
const voicePanelsOpened = dependencyMap().voicePanelsOpened;
return voicePanelsOpened.has(arg0);
};
obj.setChannelPanelPIP = function setChannelPanelPIP(channelId, arg1) {
dependencyMap = arg1;
channelId(1248).batchUpdates(() => {
channelId((voicePanelsPIP) => {
const set = new Set(voicePanelsPIP.voicePanelsPIP);
const hasItem = set.has(channelId);
if (closure_1_1) {
if (hasItem) {
return voicePanelsPIP;
} else {
set.add(tmp);
}
} else if (hasItem) {
set.delete(tmp);
} else {
return voicePanelsPIP;
}
const obj = {};
const merged = Object.assign(voicePanelsPIP);
obj.voicePanelsPIP = set;
return obj;
});
});
};
return obj;
});
const size = fn(2);
let result = size.fileFinishedImporting("modules/voice_panel/VoicePanelStore.tsx");
export default withEqualityFn;