2026-10-13 12:43:34 +00:00
|
|
|
// Module ID: 12327
|
|
|
|
|
// Function ID: 12328
|
2026-09-10 05:38:07 +00:00
|
|
|
// Name: ChannelTabsStore
|
2026-10-13 12:43:34 +00:00
|
|
|
// Dependencies: [32, 2116, 4939, 2072, 12328, 1383, 504, 584, 2]
|
2026-08-24 06:08:38 +00:00
|
|
|
|
2026-10-13 12:43:34 +00:00
|
|
|
// Module 12327 (ChannelTabsStore)
|
2026-10-03 08:58:59 +00:00
|
|
|
import get_initializedDefault from "get initialized" /* 504 */;
|
|
|
|
|
import DispatcherDefault from "Dispatcher" /* 584 */;
|
2026-10-09 10:00:15 +00:00
|
|
|
import utils_PlatformUtils from "utils/PlatformUtils" /* 1383 */;
|
2026-10-10 08:08:14 +00:00
|
|
|
import ChannelConstants from "ChannelConstants" /* 2072 */;
|
2026-10-13 12:43:34 +00:00
|
|
|
import TabsExperimentDefault from "TabsExperiment" /* 12328 */;
|
2026-10-03 08:58:59 +00:00
|
|
|
import _slicedToArray from "_slicedToArray" /* 32 */;
|
2026-10-10 08:08:14 +00:00
|
|
|
import SelectedChannelStore from "SelectedChannelStore" /* 2116 */;
|
|
|
|
|
import SelectedGuildStore from "SelectedGuildStore" /* 4939 */;
|
2026-10-03 08:58:59 +00:00
|
|
|
import size from "module_2" /* 2 */;
|
2026-08-24 06:08:38 +00:00
|
|
|
|
2026-10-13 12:43:34 +00:00
|
|
|
const f112689 = (id) => id.id === activeTabId;
|
2026-08-24 06:08:38 +00:00
|
|
|
function handleChannelDelete(channel) {
|
2026-10-03 08:58:59 +00:00
|
|
|
let found;
|
2026-08-24 06:08:38 +00:00
|
|
|
channel = channel.channel;
|
2026-10-03 08:58:59 +00:00
|
|
|
let enabled = flag;
|
2026-09-10 05:38:07 +00:00
|
|
|
if (enabled) {
|
2026-10-03 08:58:59 +00:00
|
|
|
const tmp = importDefault;
|
|
|
|
|
const obj = TabsExperimentDefault;
|
|
|
|
|
enabled = obj.getConfig({ location: "ChannelTabsStore" }).enabled;
|
2026-08-24 06:08:38 +00:00
|
|
|
}
|
|
|
|
|
if (enabled) {
|
2026-10-03 08:58:59 +00:00
|
|
|
let tmp3 = channel;
|
2026-10-09 10:00:15 +00:00
|
|
|
const obj2 = channel(1383);
|
2026-10-03 08:58:59 +00:00
|
|
|
enabled = obj2.isDesktop();
|
2026-08-24 06:08:38 +00:00
|
|
|
}
|
|
|
|
|
if (enabled) {
|
2026-10-03 08:58:59 +00:00
|
|
|
if (0 === found.filter((kind) => "channel" === kind.kind && kind.channelId === channel.id && kind.id !== activeTabId).length) {
|
2026-08-24 06:08:38 +00:00
|
|
|
return false;
|
|
|
|
|
} else {
|
|
|
|
|
found = found.filter((kind) => {
|
|
|
|
|
let tmp3 = !tmp;
|
2026-10-03 08:58:59 +00:00
|
|
|
if ("channel" === kind.kind && kind.channelId === channel.id) {
|
|
|
|
|
tmp3 = kind.id === activeTabId;
|
2026-08-24 06:08:38 +00:00
|
|
|
}
|
|
|
|
|
return tmp3;
|
|
|
|
|
});
|
2026-10-03 08:58:59 +00:00
|
|
|
let enabled2 = flag;
|
|
|
|
|
if (enabled2) {
|
|
|
|
|
const obj3 = TabsExperimentDefault;
|
|
|
|
|
enabled2 = obj3.getConfig({ location: "ChannelTabsStore" }).enabled;
|
2026-08-24 06:08:38 +00:00
|
|
|
}
|
|
|
|
|
if (enabled2) {
|
2026-10-09 10:00:15 +00:00
|
|
|
const obj4 = channel(1383);
|
2026-10-03 08:58:59 +00:00
|
|
|
enabled2 = obj4.isDesktop();
|
2026-08-24 06:08:38 +00:00
|
|
|
}
|
|
|
|
|
let tmp10 = !enabled2;
|
2026-10-03 08:58:59 +00:00
|
|
|
if (tmp10) {
|
2026-08-24 06:08:38 +00:00
|
|
|
let tmp11 = 0 === found.length;
|
|
|
|
|
if (!tmp11) {
|
|
|
|
|
tmp11 = 1 === found.length && !found[0].pinned;
|
|
|
|
|
}
|
|
|
|
|
tmp10 = tmp11;
|
|
|
|
|
}
|
|
|
|
|
if (tmp10) {
|
|
|
|
|
found = [];
|
2026-10-03 08:58:59 +00:00
|
|
|
let c8 = null;
|
2026-08-24 06:08:38 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-10-03 08:58:59 +00:00
|
|
|
const isStaticChannelRoute = ChannelConstants.isStaticChannelRoute;
|
2026-09-10 05:38:07 +00:00
|
|
|
let tabs = [];
|
2026-10-03 08:58:59 +00:00
|
|
|
let activeTabId = null;
|
2026-09-10 05:38:07 +00:00
|
|
|
let closure_9 = 1;
|
2026-10-03 08:58:59 +00:00
|
|
|
let flag = false;
|
|
|
|
|
const PersistedStore = get_initializedDefault.PersistedStore;
|
2026-08-24 06:08:38 +00:00
|
|
|
class ChannelTabsStore extends PersistedStore {
|
2026-10-03 08:58:59 +00:00
|
|
|
initialize(enabled) {
|
|
|
|
|
this.waitFor(SelectedChannelStore, SelectedGuildStore);
|
|
|
|
|
flag = undefined;
|
|
|
|
|
if (enabled != null) {
|
|
|
|
|
flag = enabled.enabled;
|
|
|
|
|
}
|
|
|
|
|
if (flag == null) {
|
|
|
|
|
flag = false;
|
|
|
|
|
}
|
|
|
|
|
tabs = undefined;
|
|
|
|
|
if (enabled != null) {
|
|
|
|
|
tabs = enabled.tabs;
|
|
|
|
|
}
|
|
|
|
|
if (tabs == null) {
|
|
|
|
|
tabs = [];
|
|
|
|
|
}
|
|
|
|
|
activeTabId = undefined;
|
|
|
|
|
if (enabled != null) {
|
|
|
|
|
activeTabId = enabled.activeTabId;
|
|
|
|
|
}
|
|
|
|
|
if (activeTabId == null) {
|
|
|
|
|
activeTabId = null;
|
|
|
|
|
}
|
|
|
|
|
closure_9 = tabs.reduce((acc, id) => {
|
|
|
|
|
const NumberResult = Number(id.id);
|
|
|
|
|
let tmp2 = acc;
|
|
|
|
|
if (Number.isFinite(NumberResult)) {
|
|
|
|
|
tmp2 = acc;
|
|
|
|
|
if (NumberResult > acc) {
|
|
|
|
|
tmp2 = NumberResult;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return tmp2;
|
|
|
|
|
}, 0) + 1;
|
|
|
|
|
const someResult = null == activeTabId || tabs.some((id) => id.id === activeTabId);
|
|
|
|
|
if (!someResult) {
|
|
|
|
|
const first = tabs[0];
|
|
|
|
|
let id;
|
|
|
|
|
if (first != null) {
|
|
|
|
|
id = first.id;
|
|
|
|
|
}
|
|
|
|
|
if (id == null) {
|
|
|
|
|
id = null;
|
|
|
|
|
}
|
|
|
|
|
activeTabId = id;
|
|
|
|
|
}
|
2026-08-24 06:08:38 +00:00
|
|
|
}
|
2026-10-03 08:58:59 +00:00
|
|
|
getState() {
|
|
|
|
|
return { tabs, activeTabId, enabled: flag };
|
2026-08-24 06:08:38 +00:00
|
|
|
}
|
2026-10-03 08:58:59 +00:00
|
|
|
getTabs() {
|
|
|
|
|
return tabs;
|
2026-08-24 06:08:38 +00:00
|
|
|
}
|
2026-10-03 08:58:59 +00:00
|
|
|
getActiveTabId() {
|
|
|
|
|
return activeTabId;
|
2026-08-24 06:08:38 +00:00
|
|
|
}
|
2026-10-03 08:58:59 +00:00
|
|
|
getActiveTab() {
|
|
|
|
|
let found = tabs.find((id) => id.id === activeTabId);
|
|
|
|
|
if (found == null) {
|
|
|
|
|
found = null;
|
2026-08-24 06:08:38 +00:00
|
|
|
}
|
2026-10-03 08:58:59 +00:00
|
|
|
return found;
|
2026-08-24 06:08:38 +00:00
|
|
|
}
|
2026-10-03 08:58:59 +00:00
|
|
|
isEnabled() {
|
|
|
|
|
let enabled = flag;
|
|
|
|
|
if (enabled) {
|
|
|
|
|
const obj = TabsExperimentDefault;
|
|
|
|
|
enabled = obj.getConfig({ location: "ChannelTabsStore" }).enabled;
|
2026-08-24 06:08:38 +00:00
|
|
|
}
|
2026-10-03 08:58:59 +00:00
|
|
|
if (enabled) {
|
|
|
|
|
const obj2 = utils_PlatformUtils;
|
|
|
|
|
enabled = obj2.isDesktop();
|
2026-08-24 06:08:38 +00:00
|
|
|
}
|
2026-10-03 08:58:59 +00:00
|
|
|
return enabled;
|
2026-08-24 06:08:38 +00:00
|
|
|
}
|
2026-10-03 08:58:59 +00:00
|
|
|
isUserOptedIn() {
|
|
|
|
|
return flag;
|
2026-08-24 06:08:38 +00:00
|
|
|
}
|
2026-10-03 08:58:59 +00:00
|
|
|
isTabBarVisible() {
|
|
|
|
|
let enabled = flag;
|
|
|
|
|
if (enabled) {
|
|
|
|
|
const obj = TabsExperimentDefault;
|
|
|
|
|
enabled = obj.getConfig({ location: "ChannelTabsStore" }).enabled;
|
|
|
|
|
}
|
|
|
|
|
if (enabled) {
|
|
|
|
|
const obj2 = utils_PlatformUtils;
|
|
|
|
|
enabled = obj2.isDesktop();
|
|
|
|
|
}
|
|
|
|
|
if (enabled) {
|
|
|
|
|
enabled = tabs.length >= 1;
|
|
|
|
|
}
|
|
|
|
|
return enabled;
|
2026-08-24 06:08:38 +00:00
|
|
|
}
|
2026-10-03 08:58:59 +00:00
|
|
|
isAtMaxTabs() {
|
|
|
|
|
return tabs.length >= 25;
|
2026-08-24 06:08:38 +00:00
|
|
|
}
|
2026-10-03 08:58:59 +00:00
|
|
|
canGoBackInActiveTab() {
|
|
|
|
|
const activeTab = this.getActiveTab();
|
|
|
|
|
return null != activeTab && activeTab.index > 0;
|
2026-08-24 06:08:38 +00:00
|
|
|
}
|
2026-10-03 08:58:59 +00:00
|
|
|
canGoForwardInActiveTab() {
|
|
|
|
|
const activeTab = this.getActiveTab();
|
|
|
|
|
return null != activeTab && activeTab.index < activeTab.entries.length - 1;
|
2026-08-24 06:08:38 +00:00
|
|
|
}
|
2026-10-03 08:58:59 +00:00
|
|
|
}
|
|
|
|
|
const prototype = ChannelTabsStore.prototype;
|
2026-08-24 06:08:38 +00:00
|
|
|
ChannelTabsStore.displayName = "ChannelTabsStore";
|
|
|
|
|
ChannelTabsStore.persistKey = "ChannelTabsStore";
|
|
|
|
|
let items = [
|
|
|
|
|
(enabled) => {
|
2026-10-03 08:58:59 +00:00
|
|
|
const obj = { tabs: [], activeTabId: null, enabled: flag };
|
|
|
|
|
flag = undefined;
|
2026-08-24 06:08:38 +00:00
|
|
|
if (enabled != null) {
|
|
|
|
|
flag = enabled.enabled;
|
|
|
|
|
}
|
|
|
|
|
if (flag == null) {
|
|
|
|
|
flag = false;
|
|
|
|
|
}
|
|
|
|
|
return obj;
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
ChannelTabsStore.migrations = items;
|
2026-10-03 08:58:59 +00:00
|
|
|
let obj = {
|
2026-08-24 06:08:38 +00:00
|
|
|
CHANNEL_TABS_OPEN: function handleOpenTab(kind) {
|
2026-10-03 08:58:59 +00:00
|
|
|
let guildId;
|
|
|
|
|
let items;
|
|
|
|
|
let items2;
|
2026-09-10 05:38:07 +00:00
|
|
|
if (tabs.length >= 25) {
|
2026-08-24 06:08:38 +00:00
|
|
|
return false;
|
|
|
|
|
} else {
|
2026-10-03 08:58:59 +00:00
|
|
|
let obj9;
|
2026-09-10 05:38:07 +00:00
|
|
|
if (0 === tabs.length) {
|
|
|
|
|
const currentlySelectedChannelId = SelectedChannelStore.getCurrentlySelectedChannelId();
|
2026-08-24 06:08:38 +00:00
|
|
|
if (null != currentlySelectedChannelId) {
|
|
|
|
|
if (!isStaticChannelRoute(currentlySelectedChannelId)) {
|
2026-10-03 08:58:59 +00:00
|
|
|
const obj = { kind: "channel", channelId: currentlySelectedChannelId, guildId };
|
|
|
|
|
guildId = SelectedGuildStore.getGuildId();
|
2026-08-24 06:08:38 +00:00
|
|
|
if (guildId == null) {
|
|
|
|
|
guildId = null;
|
|
|
|
|
}
|
2026-10-03 08:58:59 +00:00
|
|
|
const obj2 = { id: String(+closure_9), pinned: false, entries: items, index: 0 };
|
2026-08-24 06:08:38 +00:00
|
|
|
const _String = String;
|
2026-10-03 08:58:59 +00:00
|
|
|
closure_9 = tmp6 + 1;
|
2026-08-24 06:08:38 +00:00
|
|
|
const merged = Object.assign(obj);
|
2026-10-03 08:58:59 +00:00
|
|
|
items = [obj];
|
2026-09-10 05:38:07 +00:00
|
|
|
const items1 = [obj2];
|
|
|
|
|
tabs = items1;
|
2026-10-03 08:58:59 +00:00
|
|
|
activeTabId = obj2.id;
|
2026-08-24 06:08:38 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if ("route" === kind.kind) {
|
2026-09-10 05:38:07 +00:00
|
|
|
const obj5 = { kind: "route", routePath: null, routeLabel: null };
|
2026-10-03 08:58:59 +00:00
|
|
|
({ routePath: obj4.routePath, routeLabel: obj4.routeLabel } = kind);
|
|
|
|
|
obj9 = obj5;
|
2026-08-24 06:08:38 +00:00
|
|
|
} else {
|
2026-09-10 05:38:07 +00:00
|
|
|
obj9 = { kind: "channel", channelId: null, guildId: null };
|
|
|
|
|
({ channelId: obj3.channelId, guildId: obj3.guildId } = kind);
|
2026-08-24 06:08:38 +00:00
|
|
|
}
|
2026-10-03 08:58:59 +00:00
|
|
|
const obj10 = { id: String(+closure_9), pinned: false, entries: items2, index: 0 };
|
2026-08-24 06:08:38 +00:00
|
|
|
const _String2 = String;
|
2026-10-03 08:58:59 +00:00
|
|
|
closure_9 = tmp13 + 1;
|
2026-09-10 05:38:07 +00:00
|
|
|
const merged1 = Object.assign(obj9);
|
2026-10-03 08:58:59 +00:00
|
|
|
items2 = [obj9];
|
2026-09-10 05:38:07 +00:00
|
|
|
const items3 = [];
|
2026-10-03 08:58:59 +00:00
|
|
|
items3[HermesBuiltin.arraySpread(items3, tabs, 0)] = obj10;
|
2026-09-10 05:38:07 +00:00
|
|
|
tabs = items3;
|
2026-10-03 08:58:59 +00:00
|
|
|
const tmp19 = true !== kind.active && null != activeTabId;
|
|
|
|
|
if (!tmp19) {
|
|
|
|
|
activeTabId = obj10.id;
|
2026-08-24 06:08:38 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
CHANNEL_TABS_CLOSE: function handleCloseTab(tabId) {
|
|
|
|
|
tabId = tabId.tabId;
|
2026-09-10 05:38:07 +00:00
|
|
|
const findIndexResult = tabs.findIndex((id) => id.id === tabId);
|
2026-08-24 06:08:38 +00:00
|
|
|
if (-1 === findIndexResult) {
|
|
|
|
|
return false;
|
|
|
|
|
} else {
|
2026-10-03 08:58:59 +00:00
|
|
|
let enabled = flag;
|
2026-09-10 05:38:07 +00:00
|
|
|
if (enabled) {
|
2026-10-03 08:58:59 +00:00
|
|
|
const obj = TabsExperimentDefault;
|
|
|
|
|
enabled = obj.getConfig({ location: "ChannelTabsStore" }).enabled;
|
2026-08-24 06:08:38 +00:00
|
|
|
}
|
|
|
|
|
if (enabled) {
|
2026-10-03 08:58:59 +00:00
|
|
|
const obj2 = utils_PlatformUtils;
|
|
|
|
|
enabled = obj2.isDesktop();
|
2026-08-24 06:08:38 +00:00
|
|
|
}
|
|
|
|
|
if (enabled) {
|
2026-09-10 05:38:07 +00:00
|
|
|
if (1 === tabs.length) {
|
2026-08-24 06:08:38 +00:00
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-10-03 08:58:59 +00:00
|
|
|
const id = tabs[findIndexResult].id;
|
2026-09-10 05:38:07 +00:00
|
|
|
const found = tabs.filter((id) => id.id !== tabId);
|
|
|
|
|
tabs = found;
|
2026-10-03 08:58:59 +00:00
|
|
|
let enabled2 = flag;
|
|
|
|
|
const tmp8 = activeTabId;
|
|
|
|
|
if (enabled2) {
|
|
|
|
|
const obj3 = TabsExperimentDefault;
|
|
|
|
|
enabled2 = obj3.getConfig({ location: "ChannelTabsStore" }).enabled;
|
2026-08-24 06:08:38 +00:00
|
|
|
}
|
|
|
|
|
if (enabled2) {
|
2026-10-03 08:58:59 +00:00
|
|
|
const obj4 = utils_PlatformUtils;
|
|
|
|
|
enabled2 = obj4.isDesktop();
|
2026-08-24 06:08:38 +00:00
|
|
|
}
|
|
|
|
|
let tmp14 = !enabled2;
|
2026-10-03 08:58:59 +00:00
|
|
|
if (tmp14) {
|
2026-08-24 06:08:38 +00:00
|
|
|
let tmp15 = 0 === found.length;
|
|
|
|
|
if (!tmp15) {
|
|
|
|
|
tmp15 = 1 === found.length && !found[0].pinned;
|
|
|
|
|
}
|
|
|
|
|
tmp14 = tmp15;
|
|
|
|
|
}
|
|
|
|
|
if (tmp14) {
|
2026-09-10 05:38:07 +00:00
|
|
|
tabs = [];
|
2026-10-03 08:58:59 +00:00
|
|
|
activeTabId = null;
|
|
|
|
|
} else if (id === tmp8) {
|
2026-08-24 06:08:38 +00:00
|
|
|
const _Math = Math;
|
2026-10-03 08:58:59 +00:00
|
|
|
activeTabId = tabs[Math.min(Math, findIndexResult, tabs.length - 1)].id;
|
2026-08-24 06:08:38 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
CHANNEL_TABS_SET_ACTIVE: function handleSetActiveTab(tabId) {
|
|
|
|
|
tabId = tabId.tabId;
|
2026-10-03 08:58:59 +00:00
|
|
|
let tmp = activeTabId !== tabId;
|
2026-08-24 06:08:38 +00:00
|
|
|
if (tmp) {
|
2026-09-10 05:38:07 +00:00
|
|
|
const tmp4 = null != tabs.find((id) => id.id === tabId);
|
|
|
|
|
if (tmp4) {
|
2026-10-03 08:58:59 +00:00
|
|
|
activeTabId = tabId;
|
2026-09-10 05:38:07 +00:00
|
|
|
}
|
2026-08-24 06:08:38 +00:00
|
|
|
tmp = tmp4;
|
|
|
|
|
}
|
|
|
|
|
return tmp;
|
|
|
|
|
},
|
|
|
|
|
CHANNEL_TABS_MOVE: function handleMoveTab(tabId) {
|
|
|
|
|
tabId = tabId.tabId;
|
2026-10-03 08:58:59 +00:00
|
|
|
const toIndex = tabId.toIndex;
|
2026-09-10 05:38:07 +00:00
|
|
|
const findIndexResult = tabs.findIndex((id) => id.id === tabId);
|
2026-10-03 08:58:59 +00:00
|
|
|
const bound = Math.max(0, Math.min(toIndex, tabs.length - 1));
|
2026-08-24 06:08:38 +00:00
|
|
|
if (-1 !== findIndexResult) {
|
|
|
|
|
if (findIndexResult !== bound) {
|
2026-09-10 05:38:07 +00:00
|
|
|
const items = [];
|
2026-10-03 08:58:59 +00:00
|
|
|
HermesBuiltin.arraySpread(items, tabs, 0);
|
2026-09-10 05:38:07 +00:00
|
|
|
items.splice(bound, 0, _slicedToArray(items.splice(findIndexResult, 1), 1)[0]);
|
|
|
|
|
tabs = items;
|
2026-08-24 06:08:38 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
},
|
|
|
|
|
CHANNEL_TABS_SET_PINNED: function handleSetPinned(arg0) {
|
2026-10-03 08:58:59 +00:00
|
|
|
let closure_129_0;
|
|
|
|
|
let pinned;
|
|
|
|
|
({ tabId: closure_129_0, pinned } = arg0);
|
|
|
|
|
const found = tabs.find((id) => id.id === closure_1_0);
|
2026-08-24 06:08:38 +00:00
|
|
|
if (null != found) {
|
|
|
|
|
if (found.pinned !== pinned) {
|
2026-09-10 05:38:07 +00:00
|
|
|
tabs = tabs.map((id) => {
|
2026-08-24 06:08:38 +00:00
|
|
|
let tmp = id;
|
2026-10-03 08:58:59 +00:00
|
|
|
if (id.id === closure_1_0) {
|
|
|
|
|
const obj = { pinned };
|
2026-08-24 06:08:38 +00:00
|
|
|
const merged = Object.assign(id);
|
|
|
|
|
tmp = obj;
|
|
|
|
|
}
|
|
|
|
|
return tmp;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
},
|
|
|
|
|
CHANNEL_TABS_BACK: function handleTabHistoryBack() {
|
2026-10-03 08:58:59 +00:00
|
|
|
let closure_7;
|
2026-10-13 12:43:34 +00:00
|
|
|
const found = tabs.find(f112689);
|
2026-10-03 08:58:59 +00:00
|
|
|
flag = false;
|
2026-08-24 06:08:38 +00:00
|
|
|
if (null != found) {
|
|
|
|
|
const sum = found.index + -1;
|
|
|
|
|
require = sum;
|
2026-10-03 08:58:59 +00:00
|
|
|
let closure_1 = tmp3;
|
2026-08-24 06:08:38 +00:00
|
|
|
flag = false;
|
|
|
|
|
if (null != found.entries[sum]) {
|
2026-09-10 05:38:07 +00:00
|
|
|
tabs = tabs.map((id) => {
|
2026-10-03 08:58:59 +00:00
|
|
|
let entries;
|
2026-08-24 06:08:38 +00:00
|
|
|
let tmp = id;
|
2026-10-03 08:58:59 +00:00
|
|
|
if (id.id === activeTabId) {
|
|
|
|
|
const obj = { id: null, pinned: null, entries, index: require };
|
2026-09-10 05:38:07 +00:00
|
|
|
({ id: obj.id, pinned: obj.pinned } = id);
|
2026-10-03 08:58:59 +00:00
|
|
|
entries = id.entries;
|
2026-08-24 06:08:38 +00:00
|
|
|
const merged = Object.assign(closure_1);
|
|
|
|
|
tmp = obj;
|
|
|
|
|
}
|
|
|
|
|
return tmp;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return flag;
|
|
|
|
|
},
|
|
|
|
|
CHANNEL_TABS_FORWARD: function handleTabHistoryForward() {
|
2026-10-03 08:58:59 +00:00
|
|
|
let closure_7;
|
2026-10-13 12:43:34 +00:00
|
|
|
const found = tabs.find(f112689);
|
2026-10-03 08:58:59 +00:00
|
|
|
flag = false;
|
2026-08-24 06:08:38 +00:00
|
|
|
if (null != found) {
|
|
|
|
|
const sum = found.index + 1;
|
|
|
|
|
require = sum;
|
2026-10-03 08:58:59 +00:00
|
|
|
let closure_1 = tmp3;
|
2026-08-24 06:08:38 +00:00
|
|
|
flag = false;
|
|
|
|
|
if (null != found.entries[sum]) {
|
2026-09-10 05:38:07 +00:00
|
|
|
tabs = tabs.map((id) => {
|
2026-10-03 08:58:59 +00:00
|
|
|
let entries;
|
2026-08-24 06:08:38 +00:00
|
|
|
let tmp = id;
|
2026-10-03 08:58:59 +00:00
|
|
|
if (id.id === activeTabId) {
|
|
|
|
|
const obj = { id: null, pinned: null, entries, index: require };
|
2026-09-10 05:38:07 +00:00
|
|
|
({ id: obj.id, pinned: obj.pinned } = id);
|
2026-10-03 08:58:59 +00:00
|
|
|
entries = id.entries;
|
2026-08-24 06:08:38 +00:00
|
|
|
const merged = Object.assign(closure_1);
|
|
|
|
|
tmp = obj;
|
|
|
|
|
}
|
|
|
|
|
return tmp;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return flag;
|
|
|
|
|
},
|
|
|
|
|
CHANNEL_TABS_SET_ENABLED: function handleSetEnabled(enabled) {
|
2026-10-03 08:58:59 +00:00
|
|
|
let guildId;
|
|
|
|
|
let items;
|
2026-08-24 06:08:38 +00:00
|
|
|
enabled = enabled.enabled;
|
2026-10-03 08:58:59 +00:00
|
|
|
if (flag !== enabled) {
|
|
|
|
|
flag = enabled;
|
|
|
|
|
if (flag) {
|
2026-08-24 06:08:38 +00:00
|
|
|
if (enabled) {
|
2026-10-03 08:58:59 +00:00
|
|
|
const obj = TabsExperimentDefault;
|
|
|
|
|
enabled = obj.getConfig({ location: "ChannelTabsStore" }).enabled;
|
2026-08-24 06:08:38 +00:00
|
|
|
}
|
|
|
|
|
if (enabled) {
|
2026-10-03 08:58:59 +00:00
|
|
|
const obj2 = utils_PlatformUtils;
|
|
|
|
|
enabled = obj2.isDesktop();
|
2026-08-24 06:08:38 +00:00
|
|
|
}
|
|
|
|
|
if (enabled) {
|
2026-09-10 05:38:07 +00:00
|
|
|
if (tabs.length <= 0) {
|
|
|
|
|
const currentlySelectedChannelId = SelectedChannelStore.getCurrentlySelectedChannelId();
|
2026-08-24 06:08:38 +00:00
|
|
|
if (null != currentlySelectedChannelId) {
|
|
|
|
|
if (!isStaticChannelRoute(currentlySelectedChannelId)) {
|
2026-10-03 08:58:59 +00:00
|
|
|
const obj3 = { kind: "channel", channelId: currentlySelectedChannelId, guildId };
|
|
|
|
|
guildId = SelectedGuildStore.getGuildId();
|
2026-08-24 06:08:38 +00:00
|
|
|
if (guildId == null) {
|
|
|
|
|
guildId = null;
|
|
|
|
|
}
|
2026-10-03 08:58:59 +00:00
|
|
|
const obj4 = { id: String(+closure_9), pinned: false, entries: items, index: 0 };
|
2026-08-24 06:08:38 +00:00
|
|
|
const _String = String;
|
|
|
|
|
closure_9 = tmp16 + 1;
|
2026-09-10 05:38:07 +00:00
|
|
|
const merged = Object.assign(obj3);
|
2026-10-03 08:58:59 +00:00
|
|
|
flag = false;
|
|
|
|
|
items = [obj3];
|
2026-09-10 05:38:07 +00:00
|
|
|
const items1 = [obj4];
|
|
|
|
|
tabs = items1;
|
2026-10-03 08:58:59 +00:00
|
|
|
activeTabId = obj4.id;
|
2026-08-24 06:08:38 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
2026-09-10 05:38:07 +00:00
|
|
|
tabs = [];
|
2026-10-03 08:58:59 +00:00
|
|
|
activeTabId = null;
|
2026-08-24 06:08:38 +00:00
|
|
|
}
|
|
|
|
|
}
|
2026-10-03 08:58:59 +00:00
|
|
|
return flag !== enabled;
|
2026-08-24 06:08:38 +00:00
|
|
|
},
|
|
|
|
|
CHANNEL_TABS_NAVIGATE_ROUTE: function handleNavigateRoute(routePath) {
|
2026-10-03 08:58:59 +00:00
|
|
|
let closure_7;
|
|
|
|
|
let id;
|
|
|
|
|
let items;
|
2026-08-24 06:08:38 +00:00
|
|
|
routePath = routePath.routePath;
|
2026-09-10 05:38:07 +00:00
|
|
|
let obj3;
|
2026-10-03 08:58:59 +00:00
|
|
|
let enabled = flag;
|
|
|
|
|
const routeLabel = routePath.routeLabel;
|
|
|
|
|
if (flag) {
|
|
|
|
|
let obj = TabsExperimentDefault;
|
|
|
|
|
enabled = obj.getConfig({ location: "ChannelTabsStore" }).enabled;
|
2026-08-24 06:08:38 +00:00
|
|
|
}
|
|
|
|
|
if (enabled) {
|
2026-10-09 10:00:15 +00:00
|
|
|
const obj2 = obj3(1383);
|
2026-10-03 08:58:59 +00:00
|
|
|
enabled = obj2.isDesktop();
|
2026-08-24 06:08:38 +00:00
|
|
|
}
|
|
|
|
|
if (enabled) {
|
2026-09-10 05:38:07 +00:00
|
|
|
if (0 !== tabs.length) {
|
2026-08-24 06:08:38 +00:00
|
|
|
if (null != id) {
|
2026-09-10 05:38:07 +00:00
|
|
|
const found = tabs.find((id) => id.id === id);
|
2026-08-24 06:08:38 +00:00
|
|
|
if (null != found) {
|
2026-10-03 08:58:59 +00:00
|
|
|
obj3 = { kind: "route", routePath, routeLabel };
|
2026-08-24 06:08:38 +00:00
|
|
|
if (found.pinned) {
|
2026-10-03 08:58:59 +00:00
|
|
|
if (tabs.length >= 25) {
|
2026-08-24 06:08:38 +00:00
|
|
|
return false;
|
|
|
|
|
} else {
|
2026-10-03 08:58:59 +00:00
|
|
|
const obj4 = { id: String(+closure_9), pinned: false, entries: items, index: 0 };
|
2026-08-24 06:08:38 +00:00
|
|
|
const _String = String;
|
2026-10-03 08:58:59 +00:00
|
|
|
closure_9 = tmp9 + 1;
|
2026-09-10 05:38:07 +00:00
|
|
|
let merged = Object.assign(obj3);
|
2026-10-03 08:58:59 +00:00
|
|
|
items = [obj3];
|
2026-08-24 06:08:38 +00:00
|
|
|
const items1 = [];
|
2026-10-03 08:58:59 +00:00
|
|
|
items1[HermesBuiltin.arraySpread(items1, tabs, 0)] = obj4;
|
2026-09-10 05:38:07 +00:00
|
|
|
tabs = items1;
|
|
|
|
|
id = obj4.id;
|
2026-08-24 06:08:38 +00:00
|
|
|
}
|
|
|
|
|
} else {
|
2026-09-10 05:38:07 +00:00
|
|
|
tabs = arr.map((id) => {
|
2026-10-03 08:58:59 +00:00
|
|
|
let diff;
|
|
|
|
|
if (id.id !== activeTabId) {
|
2026-08-24 06:08:38 +00:00
|
|
|
return id;
|
|
|
|
|
} else {
|
|
|
|
|
const entries = id.entries;
|
|
|
|
|
const items = [];
|
2026-10-03 08:58:59 +00:00
|
|
|
items[HermesBuiltin.arraySpread(items, entries.slice(0, id.index + 1), 0)] = obj3;
|
|
|
|
|
const obj = { id: null, pinned: null, entries: items, index: diff };
|
2026-09-10 05:38:07 +00:00
|
|
|
({ id: obj.id, pinned: obj.pinned } = id);
|
2026-10-03 08:58:59 +00:00
|
|
|
diff = items.length - 1;
|
2026-09-10 05:38:07 +00:00
|
|
|
const merged = Object.assign(obj3);
|
2026-08-24 06:08:38 +00:00
|
|
|
return obj;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
},
|
|
|
|
|
CHANNEL_SELECT: function handleChannelSelect(arg0) {
|
2026-10-03 08:58:59 +00:00
|
|
|
let channelId;
|
|
|
|
|
let closure_7;
|
|
|
|
|
let guildId;
|
|
|
|
|
let items;
|
|
|
|
|
let items2;
|
2026-08-24 06:08:38 +00:00
|
|
|
({ channelId, guildId } = arg0);
|
2026-09-10 05:38:07 +00:00
|
|
|
let obj3;
|
2026-10-03 08:58:59 +00:00
|
|
|
let enabled = flag;
|
2026-09-10 05:38:07 +00:00
|
|
|
if (enabled) {
|
2026-10-03 08:58:59 +00:00
|
|
|
let obj = TabsExperimentDefault;
|
|
|
|
|
enabled = obj.getConfig({ location: "ChannelTabsStore" }).enabled;
|
2026-08-24 06:08:38 +00:00
|
|
|
}
|
|
|
|
|
if (enabled) {
|
2026-10-09 10:00:15 +00:00
|
|
|
const obj2 = obj3(1383);
|
2026-10-03 08:58:59 +00:00
|
|
|
enabled = obj2.isDesktop();
|
2026-08-24 06:08:38 +00:00
|
|
|
}
|
|
|
|
|
if (enabled) {
|
|
|
|
|
if (null != channelId) {
|
|
|
|
|
if (!isStaticChannelRoute(channelId)) {
|
2026-10-03 08:58:59 +00:00
|
|
|
let id;
|
|
|
|
|
obj3 = { kind: "channel", channelId, guildId };
|
2026-08-24 06:08:38 +00:00
|
|
|
if (guildId == null) {
|
|
|
|
|
guildId = null;
|
|
|
|
|
}
|
2026-09-10 05:38:07 +00:00
|
|
|
if (0 === tabs.length) {
|
2026-10-03 08:58:59 +00:00
|
|
|
const obj4 = { id: String(+closure_9), pinned: false, entries: items, index: 0 };
|
2026-08-24 06:08:38 +00:00
|
|
|
const _String2 = String;
|
2026-10-03 08:58:59 +00:00
|
|
|
closure_9 = tmp18 + 1;
|
2026-09-10 05:38:07 +00:00
|
|
|
let merged = Object.assign(obj3);
|
2026-10-03 08:58:59 +00:00
|
|
|
items = [obj3];
|
2026-09-10 05:38:07 +00:00
|
|
|
const items1 = [obj4];
|
|
|
|
|
tabs = items1;
|
2026-10-03 08:58:59 +00:00
|
|
|
id = obj4.id;
|
2026-08-24 06:08:38 +00:00
|
|
|
} else if (null == id) {
|
|
|
|
|
return false;
|
|
|
|
|
} else {
|
2026-09-10 05:38:07 +00:00
|
|
|
const found = tabs.find((id) => id.id === id);
|
2026-08-24 06:08:38 +00:00
|
|
|
if (null != found) {
|
|
|
|
|
if (found.pinned) {
|
2026-10-03 08:58:59 +00:00
|
|
|
if (tabs.length >= 25) {
|
2026-08-24 06:08:38 +00:00
|
|
|
return false;
|
|
|
|
|
} else {
|
2026-10-03 08:58:59 +00:00
|
|
|
const obj5 = { id: String(+closure_9), pinned: false, entries: items2, index: 0 };
|
2026-08-24 06:08:38 +00:00
|
|
|
const _String = String;
|
2026-10-03 08:58:59 +00:00
|
|
|
closure_9 = tmp10 + 1;
|
2026-09-10 05:38:07 +00:00
|
|
|
const merged1 = Object.assign(obj3);
|
2026-10-03 08:58:59 +00:00
|
|
|
items2 = [obj3];
|
2026-08-24 06:08:38 +00:00
|
|
|
const items3 = [];
|
2026-10-03 08:58:59 +00:00
|
|
|
items3[HermesBuiltin.arraySpread(items3, tabs, 0)] = obj5;
|
2026-09-10 05:38:07 +00:00
|
|
|
tabs = items3;
|
|
|
|
|
id = obj5.id;
|
2026-08-24 06:08:38 +00:00
|
|
|
}
|
|
|
|
|
} else {
|
2026-09-10 05:38:07 +00:00
|
|
|
tabs = arr.map((id) => {
|
2026-10-03 08:58:59 +00:00
|
|
|
let diff;
|
|
|
|
|
if (id.id !== activeTabId) {
|
2026-08-24 06:08:38 +00:00
|
|
|
return id;
|
|
|
|
|
} else {
|
|
|
|
|
const entries = id.entries;
|
|
|
|
|
const items = [];
|
2026-10-03 08:58:59 +00:00
|
|
|
items[HermesBuiltin.arraySpread(items, entries.slice(0, id.index + 1), 0)] = obj3;
|
|
|
|
|
const obj = { id: null, pinned: null, entries: items, index: diff };
|
2026-09-10 05:38:07 +00:00
|
|
|
({ id: obj.id, pinned: obj.pinned } = id);
|
2026-10-03 08:58:59 +00:00
|
|
|
diff = items.length - 1;
|
2026-09-10 05:38:07 +00:00
|
|
|
const merged = Object.assign(obj3);
|
2026-08-24 06:08:38 +00:00
|
|
|
return obj;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
} else {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
CHANNEL_DELETE: handleChannelDelete,
|
|
|
|
|
THREAD_DELETE: handleChannelDelete,
|
|
|
|
|
LOGOUT: function handleLogout() {
|
2026-09-10 05:38:07 +00:00
|
|
|
if (0 === tabs.length) {
|
2026-08-24 06:08:38 +00:00
|
|
|
return false;
|
|
|
|
|
} else {
|
2026-09-10 05:38:07 +00:00
|
|
|
tabs = [];
|
2026-10-03 08:58:59 +00:00
|
|
|
activeTabId = null;
|
2026-08-24 06:08:38 +00:00
|
|
|
}
|
|
|
|
|
}
|
2026-10-03 08:58:59 +00:00
|
|
|
};
|
|
|
|
|
const channelTabsStore = new ChannelTabsStore(DispatcherDefault, obj);
|
2026-09-10 05:38:07 +00:00
|
|
|
const result = size.fileFinishedImporting("modules/tabs/ChannelTabsStore.tsx");
|
2026-08-24 06:08:38 +00:00
|
|
|
|
|
|
|
|
export default channelTabsStore;
|