This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

+68
View File
@@ -0,0 +1,68 @@
// Metro module 10876 (f10877).
import { ME, Routes } from "../../Constants";
import { matchPath } from "./matchPathCompat";
import { RouteParam } from "./RouteUtils";
import { createWithEqualityFn } from "../../_bundle/identity_700";
import { batchUpdates } from "../../_bundle/Module705";
const getMatchData = function getMatchData(a0) {
let r7 = a0;
const r26 = matchPath(a0 == null ? "" : a0, {
path: Routes.CHANNEL(RouteParam.guildId(), RouteParam.channelId({
optional: true
}), ":messageId?")
});
if (r26 != null) {
const params = r26.params;
const guildId3 = params.guildId;
let channelId3 = params.channelId;
const guildId4 = guildId3 !== ME ? guildId3 : null;
if (channelId3 == null) {
channelId3 = null;
}
return {
guildId: guildId4,
channelId: channelId3
};
}
if (a0 == null) {
r7 = "";
}
const r38 = matchPath(r7, {
path: Routes.GUILD_BOOSTING_MARKETING(RouteParam.guildId())
});
return r38 != null ? {
guildId: r38.params.guildId,
channelId: null
} : {
guildId: null,
channelId: null
};
};
const withEqualityFn = createWithEqualityFn((c18334_0) => ({
path: null,
basePath: "/",
guildId: null,
channelId: null,
updatePath: (a0) => {
const path = a0;
const matchData = getMatchData(a0);
const { guildId, channelId } = matchData;
batchUpdates(() => c18334_0({
path,
guildId,
channelId
}));
},
resetPath: (a0) => {
const basePath = a0;
const matchData = getMatchData(a0);
const { guildId: guildId2, channelId: channelId2 } = matchData;
batchUpdates(() => c18334_0({
path: null,
guildId: guildId2,
channelId: channelId2,
basePath
}));
}
}));
export default withEqualityFn;
+252
View File
@@ -0,0 +1,252 @@
// Metro module 677 (f678).
import { CollectibleShopTab } from "../collectibles/CollectiblesShopConstants";
import { CONFERENCE_MODE_ENABLED } from "../conference_mode/ConferenceModeConstants";
import { ApplicationDirectoryProfileSections, GlobalDiscoveryAppsSections } from "../global_discovery_apps/GlobalDiscoveryAppsConstants";
import { wrapPaths } from "../../_bundle/getAuthenticationPath";
let c585_3 = "@me";
const r29 = ["@me", "@favorites", "@guilds-empty-nux", "@inbox", "@guild-upsell-list"];
const r107 = wrapPaths(Object.freeze({
INDEX: "/",
APP: "/app",
APP_WITH_INVITE_AND_GUILD_ONBOARDING: (a0) => `/app/invite-with-guild-onboarding/${a0}`,
APP_WITH_GIFT_CODE: (a0) => `/app/gifts/${a0}`,
ACTIVITY: "/activity",
ACTIVITIES: "/activities",
ACTIVITIES_HAPPENING_NOW: "/activities/happening-now",
ACTIVITY_DETAILS: (a0) => `/activities/${a0}`,
APPLICATION_LIBRARY: "/library",
APPLICATION_LIBRARY_INVENTORY: "/library/inventory",
APPLICATION_LIBRARY_ACTION: (a0, a1) => `/library/${a0}/${a1}`,
APPLICATION_LIBRARY_SETTINGS: "/library/settings",
APPLICATION_STORE: "/store",
APPLICATION_STORE_LISTING_SKU: (a0, a1) => `/store/skus/${a0}${a1 != null ? `/${a1}` : ""}`,
APPLICATION_STORE_LISTING_APPLICATION: (a0, a1) => `/store/applications/${a0}${a1 != null ? `/${a1}` : ""}`,
BILLING_PREFIX: "/billing",
BILLING_LOGIN_HANDOFF: "/billing/login/handoff",
BILLING_PREMIUM_SUBSCRIBE: "/billing/premium/subscribe",
BILLING_PAYMENT_SOURCES_CREATE: "/billing/payment-sources/create",
BILLING_PREMIUM_SWITCH_PLAN: "/billing/premium/switch-plan",
BILLING_GUILD_SUBSCRIPTIONS_PURCHASE: "/billing/guild-subscriptions/purchase",
BILLING_PAYMENTS: "/billing/payments",
BILLING_PROMOTION_REDEMPTION: (a0) => `/billing/promotions/${a0}`,
BILLING_PROMOTION_REDEMPTION_GENERIC: "/billing/promotions",
BILLING_PROMOTION_DIRECT_FULFILLMENT_REDEMPTION: (a0, a1) => `/billing/partner-promotions/${a0}/${a1}`,
GIFT_CARD_REDEEM: "/redeem",
FRIENDS: "/channels/@me",
ME: "/channels/@me",
MESSAGE_REQUESTS: "/message-requests",
CHANNEL: (a0, a1, a2) => {
let r10;
let r3 = a0;
if (a1 == null) {
if (!a0) {
r3 = c585_3;
}
r10 = `/channels/${r3}`;
} else {
r10 = `/channels/${a0 ? a0 : c585_3}/${a1}`;
}
return a2 != null ? `${r10}/${a2}` : r10;
},
CHANNEL_THREAD_VIEW: (a0, a1, a2, a3) => {
const r4 = `/channels/${a0}/${a1}/threads/${a2}`;
return a3 != null ? `${r4}/${a3}` : r4;
},
VOICE_CHAT_CHANNEL_PARTIAL: (a0, a1, a2) => {
const r9 = `/voice/${a0}/${a1}`;
return a2 != null ? `${r9}/${a2}` : r9;
},
LOGIN: "/login",
LOGIN_HANDOFF: "/login/handoff",
LOGIN_ONE_TIME: "/login/one-time",
REGISTER: "/register",
DEFAULT_LOGGED_OUT: CONFERENCE_MODE_ENABLED ? "/register" : "/login",
INVITE: (a0) => `/invite/${a0}`,
INVITE_LOGIN: (a0) => `/invite/${a0}/login`,
INVITE_REGISTER: (a0) => `/invite/${a0}/register`,
INVITE_PROXY: (a0, a1) => a1 != null ? `/invite-proxy/${a0}?messageId=${a1}` : `/invite-proxy/${a0}`,
GUILD_TEMPLATE: (a0) => `/template/${a0}`,
GUILD_TEMPLATE_LOGIN: (a0) => `/template/${a0}/login`,
GIFT_CODE: (a0) => `/gifts/${a0}`,
GIFT_CODE_LOGIN: (a0) => `/gifts/${a0}/login`,
WELCOME: (a0, a1) => {
let r9;
let r6 = a0;
if (a1 != null) {
if (a0 == null) {
r6 = c585_3;
}
r9 = `/welcome/${r6}/${a1}`;
} else {
r9 = `/welcome/${a0 == null ? c585_3 : a0}`;
}
return r9;
},
VERIFY: "/verify",
VERIFY_REQUEST: "/verify-request",
RESET: "/reset",
APPS: "/apps",
ACTIVATE: "/activate",
ACTIVATE_HANDOFF: "/activate/handoff",
CONNECTION_LINK: (a0) => `/connections/${a0}/link`,
CONNECTION_LINK_AUTHORIZE: (a0) => `/connections/${a0}/link-authorize`,
CONNECTIONS_SUCCESS: (a0) => `/connections/${a0}/success`,
CONNECTIONS_ERROR: (a0) => `/connections/${a0}/error`,
CONNECTIONS: (a0) => `/connections/${a0}`,
CONNECTIONS_AUTHORIZE_CONTINUE: (a0) => `/connections/${a0}/authorize-continue`,
CONNECT_AUTHORIZE: "/connect/authorize",
OAUTH2_AUTHORIZE: "/oauth2/authorize",
OAUTH2_AUTHORIZED: "/oauth2/authorized",
OAUTH2_ERROR: "/oauth2/error",
SETTINGS: (a0, a1) => `/settings/${a0}${a1 != null ? `/${a1}` : ""}`,
DEVELOPER_ACTIVATE_APPLICATION_TEST_MODE: "/settings/advanced/activate-application-test-mode",
SNOWSGIVING: "/snowsgiving",
PLAYGROUND: (a0, a1) => {
const r1 = a0 != null;
let r2 = "/playground";
if (r1) {
const r11 = "/playground" + `/${a0}`;
r2 = a1 != null ? r11 + `/${a1}` : r11;
}
return r2;
},
CHANGELOGS: (a0) => "/settings/changelogs" + (a0 != null ? `/${a0}` : ""),
USERS: (a0) => `/users/${a0}`,
GUILD_CREATE: "/guilds/create",
DISABLE_EMAIL_NOTIFICATIONS: "/disable-email-notifications",
DISABLE_SERVER_HIGHLIGHT_NOTIFICATIONS: "/disable-server-highlight-notifications",
USER_GUILD_NOTIFICATION_SETTINGS: (a0) => `/guilds/${a0}/notification-settings`,
AUTHORIZE_IP: "/authorize-ip",
REJECT_IP: "/reject-ip",
REJECT_MFA: "/reject-mfa",
AUTHORIZE_PAYMENT: "/authorize-payment",
HANDOFF: "/handoff",
DOMAIN_MIGRATION: "/domain-migration",
XBOX_EDU: "/connections/xbox/intro",
XBOX_PIN: "/connections/xbox/pin",
DOWNLOAD_QR_CODE_REDIRECT: "/download-qr-code",
BILLING_POPUP_BRIDGE_CALLBACK: "/billing/popup-bridge/callback",
OAUTH2_WHITELIST_ACCEPT: "/oauth2/allowlist/accept",
GUILD_DISCOVERY: "/guild-discovery",
GLOBAL_DISCOVERY: "/discovery",
QUEST_HOME_DEPRECATED: "/discovery/quests",
QUEST_HOME: "/quest-home",
GLOBAL_DISCOVERY_SERVERS: "/discovery/servers",
GLOBAL_DISCOVERY_APPS: "/discovery/applications",
GLOBAL_DISCOVERY_APPS_CATEGORY: (a0) => `/discovery/applications/categories/${a0}`,
GLOBAL_DISCOVERY_APPS_PROFILE: (a0) => `/discovery/applications/${a0}`,
GLOBAL_DISCOVERY_APPS_PROFILE_SECTION: (a0, a1) => `/discovery/applications/${a0}/${a1}`,
GLOBAL_DISCOVERY_APPS_PROFILE_STORE_SKU: (a0, a1) => `/discovery/applications/${a0}/${GlobalDiscoveryAppsSections.STORE}/${a1}`,
GLOBAL_DISCOVERY_APPS_SEARCH: "/discovery/applications/search",
GUILD_MEMBER_VERIFICATION: (a0) => `/member-verification/${a0}`,
GUILD_MEMBER_VERIFICATION_FOR_HUB: (a0, a1) => `/member-verification-for-hub/${a0}${a1 != null ? `/${a1}` : ""}`,
POPOUT_WINDOW: "/popout",
UPCOMING_STAGES: (a0, a1) => `/guild-stages/${a0}${a1 != null ? `/${a1}` : ""}`,
VERIFY_HUB_EMAIL: "/verify-hub-email",
OPEN_APP_FROM_EMAIL: "/open-app-from-email",
BILLING_MANAGE_SUBSCRIPTION: "/billing/premium/manage",
BILLING_PAST_DUE_SUBSCRIPTION: "/billing/premium/past-due",
BILLING_MANAGE_SUBSCRIPTION_WITH_DEEP_LINK: (a0, a1) => `/billing/premium/manage?deep_link_type=${a0}${a1 != null ? `&load_id=${a1}` : ""}`,
BILLING_MANAGE_SUBSCRIPTION_WITH_FLOW_TYPE: (a0, a1) => `/billing/premium/manage?flow_type=${a0}${a1 != null ? `&load_id=${a1}` : ""}`,
BILLING_STANDALONE_CHECKOUT_PAGE: (a0, a1, a2, a3, a4, a5, a6) => {
const r1 = a3 != null;
let r12 = "";
const r11 = r1 ? `&payment_method_type=${a3}` : "";
const r10 = a4 != null ? `&deep_link_type=${a4}` : "";
const r9 = a5 != null ? `&use_preset_offer=${a5}` : "";
if (a6 != null) {
r12 = `&flow_type=${a6}`;
}
return `/billing/premium/subscribe?plan_id=${a0}&gift=${a1}&load_id=${a2}${r11}${r10}${r9}${r12}`;
},
BILLING_STANDALONE_GUILD_BOOST_CHECKOUT_PAGE: (a0, a1, a2, a3) => {
const r1 = a1 != null;
let r7 = "";
const r6 = r1 ? `&deep_link_type=${a1}` : "";
const r5 = a2 != null ? `&load_id=${a2}` : "";
if (a3 != null) {
r7 = `&flow_type=${a3}`;
}
return `/billing/guild-subscriptions/purchase?guild_id=${a0}${r6}${r5}${r7}`;
},
GUILD_BOOSTING_MARKETING: (a0) => `/guilds/${a0}/premium-guild-subscriptions`,
GUILD_SETTINGS: (a0, a1, a2) => {
const r16 = `/guilds/${a0}/settings${a1 != null ? `/${a1}` : ""}`;
return a2 != null ? `${r16}/${a2}` : r16;
},
PICK_GUILD_SETTINGS: (a0, a1, a2) => {
const r11 = "/guilds/settings" + (a0 != null ? `/${a0}` : "");
return `${a1 != null ? `${r11}/${a1}` : r11}${a2 != null ? `?feature=${a2}` : ""}`;
},
GUILD_EVENT_DETAILS: (a0, a1, a2) => `/events/${a0}/${a1}` + (a2 != null ? `/${a2}` : ""),
FEATURE: (a0) => `/feature/${a0}`,
GUILD_FEATURE: (a0, a1) => `/feature/${a0}/${a1}`,
GUILD_JOIN_REQUEST: (a0, a1) => `/guilds/${a0}/requests/${a1}`,
MOBILE_WEB_HANDOFF: "/mweb-handoff",
APPLICATION_DIRECTORY: "/application-directory",
APPLICATION_DIRECTORY_PROFILE: (a0) => `/application-directory/${a0}`,
APPLICATION_DIRECTORY_PROFILE_SECTION: (a0, a1) => `/application-directory/${a0}/${a1}`,
APPLICATION_DIRECTORY_PROFILE_STORE_SKU: (a0, a1) => `/application-directory/${a0}/${ApplicationDirectoryProfileSections.STORE}/${a1}`,
APPLICATION_DIRECTORY_SEARCH: "/application-directory/search",
FAMILY_CENTER: "/family-center",
FAMILY_CENTER_MY_FAMILY: (a0, a1) => `/feature/family-center/my-family/${a0}/${a1}`,
SERVER_SHOP: (a0) => `/channels/${a0}/shop`,
CHANNELS_GAME_SHOP: (a0, a1, a2, a3) => {
let r5 = a1;
const r10 = `/channels/${a0}/game-shop`;
if (a1 == null) {
r5 = 0;
}
const r15 = r10 + `/${r5}`;
let r16 = r15;
if (a2 != null) {
const r21 = r15 + `/${a2}`;
r16 = a3 != null ? r21 + `/${a3}` : r21;
}
return r16;
},
GAME_SHOP: (a0, a1, a2) => {
const r9 = `/game-shop/${a0}`;
let r10 = r9;
if (a1 != null) {
const r14 = r9 + `/${a1}`;
r10 = a2 != null ? r14 + `/${a2}` : r14;
}
return r10;
},
GUILD_PRODUCT: (a0, a1) => `/channels/${a0}/shop/${a1}`,
REPORT: "/report",
REPORT_SECOND_LOOK: "/report-review",
COLLECTIBLES_SHOP: "/shop",
COLLECTIBLES_SHOP_GAME_SHOP: (a0, a1, a2, a3) => {
const r11 = `/shop?tab=${CollectibleShopTab.GAME_SHOPS}&applicationId=${a0}`;
const r12 = a1 != null ? r11 + `&pageIndex=${a1}` : r11;
const r18 = a2 != null ? r12 + `&skuId=${a2}` : r12;
return a3 != null ? r18 + `&slug=${a3}` : r18;
},
COLLECTIBLES_SHOP_WITH_TAB: (a0) => `/shop?tab=${a0}`,
COLLECTIBLES_SHOP_COLLECTION_DETAIL: (a0) => `/shop/collection/${a0}`,
COLLECTIBLES_SHOP_PRODUCT_DETAIL: (a0) => `/shop/product/${a0}`,
COLLECTIBLES_SHOP_LAYOUT: (a0) => `/shop/layout/${a0}`,
NITRO_HOME: "/store",
ACCOUNT_STANDING: "/account-standing",
CHANNEL_SUMMARIES: (a0) => `/channels/${a0}/summaries`,
CHANNEL_SUMMARY: (a0, a1) => `/channels/${a0}/summaries/${a1}`,
USER_SUMMARIES: "/users/@me/summaries",
QUESTS: (a0) => `/quests/${a0}`,
GAME_PROFILE: (a0) => `/games/${a0}`,
ACCOUNT_REVERT: (a0) => `/wasntme/${a0}`,
POWERUP_STORE: (a0) => `/channels/${a0}/boosts`,
CONFERENCE_MODE: "/conference-mode",
CONFERENCE_MODE_VOICE: (a0, a1) => `/conference-mode/voice/${a0}/${a1}`,
QUEST_PREVIEW: (a0) => `/quest-preview/${a0}`,
QUEST_PREVIEW_TOOL_2: (a0) => `/quest-home?tab=preview_tool&quest_id=${a0}`,
ICYMI: "/icymi"
}), [":", "?", "@"]);
export const ME = "@me";
export const FAVORITES = "@favorites";
export const NOTIFICATIONS_INBOX = "@inbox";
export const EMPTY_NUX_SERVER = "@guilds-empty-nux";
export const MOBILE_GUILD_UPSELL_LIST = "@guild-upsell-list";
export { r29 as PSEUDO_GUILD_IDS };
export { r107 as Routes };
+179
View File
@@ -0,0 +1,179 @@
// Metro module 10875 (f10876).
import GatewayConnectionStore from "../gateway/GatewayConnectionStore";
import KeybindRouterStore from "./KeybindRouterStore";
import "../../Constants";
import * as _router_utils from "./router_utils";
import { replaceWith } from "./router_utils";
import { addBreadcrumb } from "../../_bundle/Module6363";
function $mk85698($env) {
return () => {
const r5 = $env;
const r2 = $env.$parent;
const isConnected = r2[2].isConnected();
const r8 = isConnected && !r5[0].connected;
const r10 = r5[0];
r10.connected = isConnected;
if (r8) {
r10.routeChangeCount = 0;
r10.executeRouteRewrites((0, r2[0])(r2[1][3]).getHistory().location, "REPLACE");
}
};
}
function $mk85699($env) {
return (a0, a1) => {
const r1 = $env;
if (a1 !== "POP") {
if (r1[0].executeRouteRewrites(a0, a1)) {
return void 0;
}
const r24 = $env.$parent;
const r7 = r24[0];
const r25 = r24[1];
if (!r7(r25[4]).convertRouteToNavigation(a0)) {
r7(r25[3]).replaceWith(r24[4].ME);
return void 0;
}
}
const state = $env.$parent[3].getState();
if (state.basePath !== a0.pathname) {
state.resetPath(a0.pathname);
}
for (const listener of r1[0].listeners) {
const r52 = listener;
try {
r52(a0, a1);
} catch ($e) {}
}
r1[0].routeChangeCount = 0;
};
}
function $mk85700($env) {
return ({ path }) => {
const r7 = $env[0];
if (r7.timer !== -1) {
clearTimeout(r7.timer);
}
if (path != null) {
r7.timer = setTimeout(r7.flushRoute, 200);
}
};
}
function $mk85701($env) {
return () => {
clearTimeout($env[0].timer);
const r9 = $env.$parent;
const state = r9[3].getState();
if (state.path != null) {
(0, r9[0])(r9[1][3]).transitionTo(state.path);
}
};
}
let c7316_0;
let env7315;
let env7316;
const r7 = env7315 = {};
class RouteManager {
constructor() {
let env18331;
const r3 = env18331 = {
$parent: env7315
};
env18331[0] = this;
this.rewrites = new Set();
this.listeners = new Set();
this.routeChangeCount = 0;
this.timer = -1;
this.connected = false;
this.handleConnectionChange = $mk85698(r3);
this.handleRouteChange = $mk85699(r3);
this.handleKeybindRouteChange = $mk85700(r3);
this.flushRoute = $mk85701(r3);
}
initialize() {
this.cleanup();
this.unlistenHistory = _router_utils.getHistory().listen(this.handleRouteChange);
const pathname = _router_utils.getHistory().location.pathname;
KeybindRouterStore.getState().resetPath(pathname);
this.unlistenKeyboardChange = KeybindRouterStore.subscribe(this.handleKeybindRouteChange);
GatewayConnectionStore.addChangeListener(this.handleConnectionChange);
}
executeRouteRewrites(a0, a1) {
this.routeChangeCount = this.routeChangeCount + 1;
if (!(this.routeChangeCount < 10)) {
throw new Error("RouteManager: Something has gone horribly wrong with rewrites");
}
for (const rewrite of this.rewrites) {
const pathname = _router_utils.getHistory().location.pathname;
const r45 = rewrite(a0, a1);
if (r45 == null) {
continue;
}
addBreadcrumb({
message: "RouteManager.handleRouteChange: A route rewrite is replacing the current route",
data: {
replacePath: r45.path,
previousPath: pathname
}
});
replaceWith(r45.path, r45.state);
return true;
}
return false;
}
cleanup() {
const unlistenHistory = this.unlistenHistory;
if (unlistenHistory != null) {
unlistenHistory.call(this);
}
this.unlistenHistory = void 0;
const unlistenKeyboardChange = this.unlistenKeyboardChange;
if (unlistenKeyboardChange != null) {
unlistenKeyboardChange.call(this);
}
this.unlistenKeyboardChange = void 0;
GatewayConnectionStore.removeChangeListener(this.handleConnectionChange);
}
addRouteChangeListener(a0) {
if (this.unlistenHistory != null) {
a0(_router_utils.getHistory().location, "REPLACE");
}
this.listeners.add(a0);
return () => this.removeRouteChangeListener(a0);
}
addRouteRewriter(a0) {
if (this.unlistenHistory != null) {
const r19 = a0(_router_utils.getHistory().location, _router_utils.getHistory().action);
if (r19 != null) {
replaceWith(r19.path, r19.state);
}
}
this.rewrites.add(a0);
return () => this.removeRouteRewriter(a0);
}
removeRouteChangeListener(a0) {
this.listeners.delete(a0);
}
removeRouteRewriter(a0) {
this.rewrites.delete(a0);
}
getHistory() {
return _router_utils.getHistory();
}
}
const r45 = {
__proto__: RouteManager.prototype
};
const r46 = env7316 = {
$parent: r7
};
c7316_0 = r45;
r45.rewrites = new Set();
r45.listeners = new Set();
r45.routeChangeCount = 0;
r45.timer = -1;
r45.connected = false;
r45.handleConnectionChange = $mk85698(r46);
r45.handleRouteChange = $mk85699(r46);
r45.handleKeybindRouteChange = $mk85700(r46);
r45.flushRoute = $mk85701(r46);
export default r45;
+30
View File
@@ -0,0 +1,30 @@
// Metro module 4025 (f4026).
import { PSEUDO_GUILD_IDS } from "./RouteConstants";
import { StaticChannelRoutes } from "../channel/ChannelConstants";
import { UnescapedPathParam } from "../../_bundle/getAuthenticationPath";
import escapeRegExp from "../../_bundle/escapeRegExp";
const r20 = {
guildId: function guildId(r2 = {}) {
const { name = "guildId", optional = false } = r2;
const r27 = `${PSEUDO_GUILD_IDS.map(escapeRegExp).join("|")}|\\d+`;
let optional2 = ({
optional
}).optional;
if (optional2 === void 0) {
optional2 = false;
}
return new UnescapedPathParam(`:${escapeRegExp(name)}(${r27})${optional2 ? "?" : ""}`);
},
channelId: function channelId(r3 = {}) {
const { name = "channelId", optional = false } = r3;
const r28 = `${[...StaticChannelRoutes].map(escapeRegExp).join("|")}|\\d+`;
let optional2 = ({
optional
}).optional;
if (optional2 === void 0) {
optional2 = false;
}
return new UnescapedPathParam(`:${escapeRegExp(name)}(${r28})${optional2 ? "?" : ""}`);
}
};
export { r20 as RouteParam };
+15
View File
@@ -0,0 +1,15 @@
// Metro module 4024 (f4025).
import { PSEUDO_GUILD_IDS } from "./RouteConstants";
import { isStaticChannelRoute } from "../channel/ChannelConstants";
import { RouteParam } from "./RouteParam";
let c2302_2 = /^\d+$/;
exports.RouteParam = RouteParam;
export function isPseudoGuildId(a0) {
return PSEUDO_GUILD_IDS.includes(a0);
}
export function isValidGuildId(a0) {
return a0 != null && (!!PSEUDO_GUILD_IDS.includes(a0) || !!c2302_2.test(a0));
}
export function isValidChannelId(a0) {
return a0 == null || (!!c2302_2.test(a0) || !!isStaticChannelRoute(a0));
}
+11
View File
@@ -0,0 +1,11 @@
// Metro module 1234 (f1235).
import { OpenThreadAnalyticsLocations } from "../threads/ThreadConstants";
const r17 = {
INVITE_ACCEPT: "invite_accept",
CHANNEL_LIST_SUGGESTED_SECTION: "channel_list_suggested_section",
USER_NAVIGATED_BACK: "user_navigated_back",
USER_NAVIGATED_FORWARD: "user_navigated_forward"
};
const set = new Set([OpenThreadAnalyticsLocations.EMBED, OpenThreadAnalyticsLocations.FORUM]);
export default r17;
export { set as ChannelBackNavigationSources };
@@ -0,0 +1,129 @@
// Metro module 10877 (f10878).
import { Routes } from "../../Constants";
import { getChatLayout } from "../chat/native/useChatLayout";
import { coerceGuildsRoute, navigateToRootTab, navigateToChannel, navigateToMemberVerification, resetToAuthRoute } from "../main_tabs_v2/helpers/NavigationRouteUtils.native";
import { getRootNavigationRef } from "../main_tabs_v2/RootNavigationRef.native";
import { matchPath } from "./matchPathCompat";
import { RouteParam } from "./RouteUtils";
export function convertRouteToNavigation(a0) {
let r89;
const pathname = a0.pathname;
const rootNavigationRef = getRootNavigationRef();
if (rootNavigationRef != null && rootNavigationRef.isReady()) {
if (pathname.startsWith("/channels/")) {
if (matchPath(pathname, {
path: `${Routes.CHANNEL(RouteParam.guildId(), RouteParam.channelId({
optional: true
}))}${Routes.VOICE_CHAT_CHANNEL_PARTIAL(RouteParam.guildId({
name: "voiceGuildId"
}), RouteParam.channelId({
name: "voiceChannelId"
}), ":voiceMessageId?")}`
}) != null) {
return true;
}
const r75 = matchPath(pathname, {
path: Routes.CHANNEL(RouteParam.guildId(), RouteParam.channelId({
optional: true
}), ":messageId?")
});
if (r75 != null) {
L39: {
const params = r75.params;
const { channelId, guildId, messageId } = params;
const { navigationReplace, openChannel } = a0;
if (getChatLayout().isChatLockedOpen) {
if (channelId != null && navigationReplace === false) {
const rootNavigationRef2 = getRootNavigationRef();
const r163 = coerceGuildsRoute(rootNavigationRef2 == null ? void 0 : rootNavigationRef2.getCurrentRoute());
if ((r163 == null ? void 0 : r163.params?.channelId) === channelId) {
navigateToRootTab({
screen: "guilds",
guildId,
channelId,
resetRoot: navigationReplace
});
break L39;
}
navigateToChannel({
channelId,
guildId,
messageId,
replaceChannelAndFixRoot: navigationReplace
});
break L39;
}
navigateToRootTab({
screen: "guilds",
guildId,
channelId,
resetRoot: navigationReplace
});
} else if (channelId != null) {
if (navigationReplace === true && openChannel) {
navigateToChannel({
channelId,
guildId,
messageId,
replaceChannelAndFixRoot: navigationReplace,
openChannel: true
});
break L39;
}
if (navigationReplace !== false) {
navigateToRootTab({
screen: "guilds",
guildId,
channelId,
resetRoot: navigationReplace
});
}
if (channelId != null && navigationReplace !== true) {
navigateToChannel({
channelId,
guildId,
messageId,
replaceChannelAndFixRoot: void 0
});
}
} else {
navigateToRootTab({
screen: "guilds",
guildId,
channelId,
resetRoot: navigationReplace
});
}
}
return true;
}
}
if (pathname.startsWith("/member-verification/")) {
const r109 = matchPath(pathname, {
path: Routes.GUILD_MEMBER_VERIFICATION(RouteParam.guildId())
});
if (r109 != null) {
navigateToMemberVerification(r109.params.guildId, r109.params.inviteCode);
}
return true;
}
L12: {
if (!pathname.startsWith(Routes.LOGIN) && !pathname.startsWith(Routes.REGISTER)) {
r89 = !!pathname.startsWith(Routes.ACCOUNT_STANDING);
if (!r89) {
break L12;
}
rootNavigationRef.navigate({
name: "account-standing",
params: void 0
});
r89 = true;
} else {
resetToAuthRoute();
r89 = true;
}
}
return r89;
}
return true;
}
@@ -0,0 +1,41 @@
// Metro module 5653 (f5654).
import GuildOnboardingStore from "../guild_onboarding/GuildOnboardingStore";
import ChannelStore from "../../stores/ChannelStore";
import GuildChannelStore from "../../stores/GuildChannelStore";
import GuildStore from "../../stores/GuildStore";
import SelectedChannelStore from "../../stores/SelectedChannelStore";
import PrivateChannelSortStore from "../../stores/views/PrivateChannelSortStore";
import { ME } from "../../Constants";
import { StaticChannelRoute } from "../channel/ChannelConstants";
import { canSeeOnboardingHome } from "../guild_onboarding_home/OnboardingHomeUtils";
import { canUseGuildSpace } from "../guild_space/canUseGuildSpace";
import { canSeeGameShop } from "../slayer_storefront/SlayerStorefrontUtils";
export function getChannelIdForGuildTransition(a0) {
const channelId = SelectedChannelStore.getChannelId(a0);
let r14 = GuildChannelStore.getDefaultChannel(a0)?.id;
if (r14 == null) {
let r15 = void 0;
if (a0 === ME) {
const privateChannelIds = PrivateChannelSortStore.getPrivateChannelIds();
r15 = privateChannelIds.length > 0 ? privateChannelIds[0] : void 0;
}
r14 = r15;
}
if (channelId === StaticChannelRoute.GUILD_ONBOARDING && !GuildOnboardingStore.shouldShowOnboarding(a0)) {
return r14;
}
if (channelId === StaticChannelRoute.GUILD_HOME && !canSeeOnboardingHome(a0)) {
return r14;
}
if (channelId === StaticChannelRoute.GUILD_SPACE) {
if (canUseGuildSpace(GuildStore.getGuild(a0), "getChannelIdForGuildTransition")) {
r14 = channelId;
}
return r14;
}
if (channelId === StaticChannelRoute.GAME_SHOP && canSeeGameShop(a0)) {
return channelId;
}
const channel = ChannelStore.getChannel(channelId);
return channel != null ? channel.isGuildVocal() ? r14 : channelId : r14;
}
+3
View File
@@ -0,0 +1,3 @@
// Metro module 4011 (f4012).
import * as _Module4012 from "../../_bundle/Module4012";
export const matchPath = _Module4012.matchPath;
@@ -0,0 +1,37 @@
// Metro module 13505 (f13506).
import { BackHandler } from "react-native";
import { hideContextMenu } from "../../../design/components/ContextMenu/native/ContextMenuState.native";
import { getKeyboardType } from "../../keyboard/native/useKeyboardType";
import { KeyboardTypes } from "../../keyboard/native/KeyboardTypes";
import { setKeyboardType } from "../../keyboard/native/KeyboardUIStore.native";
import LifecycleManager from "../../../lib/LifecycleManager";
import { isAndroid } from "../../../utils/PlatformUtils";
const handleBackPress = function handleBackPress() {
hideContextMenu();
let r0 = getKeyboardType() !== KeyboardTypes.SYSTEM;
if (r0) {
setKeyboardType({
type: KeyboardTypes.SYSTEM
});
r0 = true;
}
return !!r0;
};
class BackPressManager extends LifecycleManager {
_initialize() {
if (isAndroid()) {
this._initializeGlobalBackPressListener();
}
}
_initializeGlobalBackPressListener() {
this._backPressEventSubscription = BackHandler.addEventListener("hardwareBackPress", handleBackPress);
}
_terminate() {
const _backPressEventSubscription = this._backPressEventSubscription;
if (_backPressEventSubscription != null) {
_backPressEventSubscription.remove();
}
}
}
const backPressManager = new BackPressManager();
export default backPressManager;
@@ -0,0 +1,321 @@
// Metro module 10868 (f10869).
import { setVoiceChatDrawerState } from "../../video_calls/native/ChannelCallStore";
import { isGuildSelectableChannelType } from "../../../records/ChannelRecord";
import ChannelStore from "../../../stores/ChannelStore";
import DefaultRouteStore from "../../../stores/DefaultRouteStore";
import GuildChannelStore from "../../../stores/GuildChannelStore";
import SelectedChannelStore from "../../../stores/SelectedChannelStore";
import { ChannelTypes, ME, Routes } from "../../../Constants";
import { VoiceChatDrawerState } from "../../video_calls/native/ChannelCallConstants";
import Logger from "../../debug/Logger";
import { isValidGuildId, isValidChannelId, RouteParam } from "../RouteUtils";
import { matchPath } from "../../../_bundle/Module10869";
import SelectedChannelActionCreators from "../../../actions/SelectedChannelActionCreators";
import { transitionTo, transitionToGuild } from "../router_utils";
import { saveLastRoute, saveLastNonVoiceRoute } from "../../../actions/DefaultRouteActionCreators";
import ModalActionCreators from "../../../actions/ModalActionCreators";
import { getVoiceChannelKey, openGuildVoiceModal } from "../../../utils/native/PrivateChannelCallUtils";
import GuildActionCreators from "../../../actions/GuildActionCreators";
import { isVoicePanelEnabled } from "../../voice_panel/VoicePanelUtils.native";
import { isModalOpen } from "../../main_tabs_v2/helpers/NavigationRouteUtils.native";
import Dispatcher from "../../../Dispatcher";
import ChannelRTCActionCreators from "../../../actions/ChannelRTCActionCreators";
import { JumpType } from "../../../flow/Client";
import RouteManager from "../RouteManager";
let _excluded, c7306_15, c7306_16, path, saveLastRouteListener, saveLastNonVoiceRouteListener, updateSelectedChannelListener, extractParams, logRouteChange;
const voiceRouteRewriter = function voiceRouteRewriter(a0) {
let r30, state;
L9: {
state = a0.state;
const r21 = extractParams({
match: matchPath(a0.pathname, {
path,
strict: false,
exact: false
}),
location: a0
});
const { channelId, guildId, ...rest } = r21;
const channel2 = ChannelStore.getChannel(channelId);
const r2 = channelId == null;
r30 = null;
if (!r2) {
const r31 = guildId == null;
r30 = null;
if (!r31) {
if (channel2?.type !== ChannelTypes.GUILD_VOICE) {
const type = channel2?.type;
const GUILD_STAGE_VOICE = ChannelTypes.GUILD_STAGE_VOICE;
r30 = null;
if (type !== GUILD_STAGE_VOICE) {
break L9;
}
}
r30 = {
...rest,
channelId,
guildId
};
}
}
}
if (r30 != null) {
if (c7306_15 != null) {
c7306_15.log(`voiceRouteRewriter: has voiceChannelParams = ${JSON.stringify(r30)}`);
}
const path2 = `${DefaultRouteStore.lastNonVoiceRoute}${Routes.VOICE_CHAT_CHANNEL_PARTIAL(r30.guildId, r30.channelId, r30.messageId)}`;
const pathname = a0.pathname;
let r65 = null;
if (path2 !== pathname) {
if (c7306_15 != null) {
c7306_15.log(`voiceRouteRewriter: rewriting route: ${a0.pathname} -> ${path2}`);
}
r65 = {
path: path2,
state
};
}
return r65;
}
return null;
};
saveLastRouteListener = function saveLastRouteListener(a0) {
saveLastRoute(a0.pathname);
};
saveLastNonVoiceRouteListener = function saveLastNonVoiceRouteListener(a0) {
const match = matchPath(a0.pathname, {
path,
strict: false,
exact: false
});
const channel2 = ChannelStore.getChannel(match == null ? void 0 : match.params.channelId);
const r23 = channel2?.type !== ChannelTypes.GUILD_VOICE ? channel2?.type !== ChannelTypes.GUILD_STAGE_VOICE ? extractParams({
match,
location: a0
}) : null : null;
if (r23 != null) {
saveLastNonVoiceRoute(Routes.CHANNEL(r23.guildId, r23.channelId));
}
};
updateSelectedChannelListener = function updateSelectedChannelListener(a0) {
const match = matchPath(a0.pathname, {
path,
strict: false,
exact: false
});
let r38 = match?.params;
if (r38 == null) {
r38 = {};
}
const { voiceChannelId: voiceChannelId2, voiceGuildId: voiceGuildId2, voiceMessageId: voiceMessageId2 } = r38;
const r42 = {
...extractParams({
match,
location: a0
}),
voiceChannelId: voiceChannelId2,
voiceGuildId: voiceGuildId2,
voiceMessageId: voiceMessageId2
};
const { guildId, channelId, messageId, jumpType, voiceChannelId, voiceGuildId, voiceMessageId, skipMessageFetch } = r42;
if (voiceChannelId == null && voiceGuildId == null) {
if (c7306_15 != null) {
c7306_15.verbose(`UpdateSelectedChannelListener -> no voice route present in ${JSON.stringify(a0)} ${JSON.stringify({
guildId,
channelId,
messageId,
jumpType,
voiceChannelId,
voiceGuildId,
voiceMessageId
})} `);
}
const channel2 = ChannelStore.getChannel(SelectedChannelStore.getLastSelectedChannelId());
if ((channel2 == null ? void 0 : channel2.isGuildVoice()) || (channel2 == null ? void 0 : channel2.isGuildStageVoice())) {
ModalActionCreators.popWithKey(getVoiceChannelKey(channel2.id));
}
GuildActionCreators.selectGuild(guildId);
SelectedChannelActionCreators.selectChannel({
guildId,
channelId,
messageId,
jumpType,
skipMessageFetch
});
return void 0;
}
const channel = ChannelStore.getChannel(voiceChannelId);
const type = channel?.type;
L33: {
if (type !== ChannelTypes.GUILD_VOICE && channel?.type !== ChannelTypes.GUILD_STAGE_VOICE) {
if (c7306_15 == null) {
break L33;
}
c7306_15.log(`UpdateSelectedChannelListener -> !!!VERY BAD!!! channel.id ${channel?.id} (voiceChannelId ${voiceChannelId}) is not a voice channel! and yet RouteUtils thinks it is! ${JSON.stringify(a0)} ${JSON.stringify({
guildId,
channelId,
messageId,
jumpType,
voiceChannelId,
voiceGuildId,
voiceMessageId
})} `);
} else {
if (c7306_15 != null) {
c7306_15.verbose(`UpdateSelectedChannelListener -> voice route present! ${JSON.stringify(a0)} ${JSON.stringify({
guildId,
channelId,
messageId,
jumpType,
voiceChannelId,
voiceGuildId,
voiceMessageId
})} `);
}
if (!isVoicePanelEnabled(channel)) {
GuildActionCreators.selectGuild(voiceGuildId);
SelectedChannelActionCreators.selectChannel({
guildId: voiceGuildId,
channelId: voiceChannelId,
messageId: voiceMessageId,
jumpType
});
}
if (!isModalOpen(getVoiceChannelKey(channel.id))) {
ModalActionCreators.popAboveKey(getVoiceChannelKey(channel.id));
Dispatcher.wait(() => {
openGuildVoiceModal(channel);
});
}
if (channel.isGuildVoice() && voiceMessageId != null || channel.isGuildStageVoice()) {
setVoiceChatDrawerState(channel.id, VoiceChatDrawerState.OPEN);
if (voiceGuildId != null && voiceChannelId != null && voiceMessageId != null) {
ChannelRTCActionCreators.jumpToVoiceChannelMessage(voiceGuildId, voiceChannelId, voiceMessageId, jumpType);
}
}
}
}
};
extractParams = function extractParams({ match, location: location2 }) {
if (match == null) {
return {
guildId: ME,
channelId: null,
messageId: null,
jumpType: JumpType.ANIMATED,
skipMessageFetch: false
};
}
const params = match.params;
let guildId = params.guildId;
const { channelId, messageId } = params;
const jumpType = location2.jumpType === JumpType.INSTANT ? JumpType.INSTANT : JumpType.ANIMATED;
if (!isValidGuildId(guildId)) {
guildId = ME;
}
return {
guildId,
channelId: isValidChannelId(channelId) ? channelId : null,
messageId,
jumpType,
skipMessageFetch: !!location2.skipMessageFetch
};
};
logRouteChange = function logRouteChange(a0) {
c7306_15.log(`Navigated to: ${a0.pathname}`);
};
_excluded = ["channelId", "guildId"];
c7306_15 = new Logger("RouteUtils");
c7306_16 = false;
const r67 = Routes.CHANNEL(RouteParam.guildId(), RouteParam.channelId({
optional: true
}), ":messageId?");
path = [`${r67}${Routes.VOICE_CHAT_CHANNEL_PARTIAL(RouteParam.guildId({
name: "voiceGuildId"
}), RouteParam.channelId({
name: "voiceChannelId"
}), ":voiceMessageId?")}`, r67];
export { r67 as MAIN_DRAWER_ROUTES };
export function extractParamsFromVoiceModalRoute(a0) {
const match = matchPath(a0.pathname, {
path,
strict: false,
exact: false
});
let r16 = match?.params;
if (r16 == null) {
r16 = {};
}
const { voiceChannelId, voiceGuildId, voiceMessageId } = r16;
return {
...extractParams({
match,
location: a0
}),
voiceChannelId,
voiceGuildId,
voiceMessageId
};
}
export function popVoiceRoute(a0) {
let id;
c7306_15.log(`popVoiceRoute: last non-voice route is ${DefaultRouteStore.lastNonVoiceRoute}`);
const channel2 = ChannelStore.getChannel(SelectedChannelStore.getLastSelectedChannelId());
if (channel2?.type != null && isGuildSelectableChannelType(channel2?.type)) {
id = channel2.id;
} else {
id = SelectedChannelStore.getMostRecentSelectedTextChannelId(a0);
if (id == null) {
id = GuildChannelStore.getDefaultChannel(a0)?.id;
}
}
SelectedChannelActionCreators.selectChannel({
guildId: a0,
channelId: id
});
transitionTo(DefaultRouteStore.lastNonVoiceRoute);
}
export function transitionToVoiceRoute(a0, a1) {
let r28 = matchPath(DefaultRouteStore.defaultRoute, {
path,
strict: false,
exact: false
})?.params;
if (r28 == null) {
r28 = {};
}
const voiceChannelId = r28.voiceChannelId;
c7306_15.log(`transitionToVoiceRoute(<${a0}>, <${a1}>), current route ${DefaultRouteStore.defaultRoute} has voiceChannelId ${voiceChannelId}`);
if (voiceChannelId !== a1) {
transitionToGuild(a0, a1);
} else {
c7306_15.log(`transitionToVoiceRoute -> ${voiceChannelId} === ${a1}. staying where we are`);
}
}
export { voiceRouteRewriter };
export { saveLastRouteListener };
export { saveLastNonVoiceRouteListener };
export { updateSelectedChannelListener };
export { extractParams };
export function initializeRouteManagerIfNeeded() {
if (!c7306_16) {
RouteManager.addRouteRewriter(voiceRouteRewriter);
RouteManager.addRouteChangeListener(saveLastRouteListener);
RouteManager.addRouteChangeListener(saveLastNonVoiceRouteListener);
RouteManager.addRouteChangeListener(updateSelectedChannelListener);
RouteManager.addRouteChangeListener(logRouteChange);
RouteManager.initialize();
c7306_16 = true;
}
}
export function cleanupRouteManager() {
if (c7306_16) {
RouteManager.removeRouteRewriter(voiceRouteRewriter);
RouteManager.removeRouteChangeListener(saveLastRouteListener);
RouteManager.removeRouteChangeListener(saveLastNonVoiceRouteListener);
RouteManager.removeRouteChangeListener(updateSelectedChannelListener);
RouteManager.removeRouteChangeListener(logRouteChange);
RouteManager.cleanup();
c7306_16 = false;
}
}
@@ -0,0 +1,29 @@
// Metro module 4597 (f4598).
import { useRef, useLayoutEffect, useEffect } from "react";
import { BackHandler, NativeModules } from "react-native";
import { isIOS } from "../../../utils/PlatformUtils";
const r19 = {
minimize: () => {
NativeModules.MinimizeApp.minimizeApp();
return true;
}
};
export default function useBackPressHandler(a0) {
const current = a0;
let r6 = arguments[1];
if (r6 === void 0) {
r6 = true;
}
let c14340_1 = r6;
const ref = useRef(a0);
useLayoutEffect(() => {
ref.current = current;
});
useEffect(() => {
if (!isIOS() && c14340_1) {
let c25252_0 = BackHandler.addEventListener("hardwareBackPress", () => ref.current());
return () => c25252_0.remove();
}
}, [r6]);
};
export { r19 as BackPressHandler };
+156
View File
@@ -0,0 +1,156 @@
// Metro module 1222 (f1223).
import { ComponentActions, PageAnalyticsLocations, Routes, RelativeMarketingURLs } from "../../Constants";
import Logger from "../debug/Logger";
import { createMemoryHistory } from "../../_bundle/Module1223";
import { ComponentDispatch } from "../../utils/ComponentDispatchUtils";
import { ChannelBackNavigationSources } from "./RoutingSources";
function $mk68500($env) {
return (a0) => $env[0].startsWith(a0);
}
let memoryHistory, source, sourceLocationStack, c1027_8, c1027_9, c1027_10;
const transitionTo = function transitionTo(a0, a1) {
let env12924;
const r2 = env12924 = {};
env12924[0] = a0;
const r1 = typeof a0 === "string" ? !c1027_9.some($mk68500(r2)) : typeof a0 !== "string";
let r0 = !r1;
if (!r1) {
c1027_8.log(`assign - route to external path ${a0}`);
window.dispatchEvent(new Event("beforeunload"));
window.location.assign(a0);
r0 = true;
}
if (!r0) {
c1027_8.log(`transitionTo - Transitioning to ${a0}`);
const source2 = a1?.source;
const sourceLocationStack2 = a1?.sourceLocationStack;
if (a1 == null) {
memoryHistory.push(a0);
} else {
const uRL = new URL(a0, `https:${window.GLOBAL_ENV.WEBAPP_ENDPOINT}`);
memoryHistory.push({
pathname: uRL.pathname,
search: uRL.search,
hash: uRL.hash,
...a1
});
}
source = source2;
sourceLocationStack = sourceLocationStack2;
}
};
c1027_8 = new Logger("Routing/Utils");
c1027_9 = [RelativeMarketingURLs.DEVELOPER_PORTAL];
memoryHistory = createMemoryHistory();
c1027_10 = memoryHistory.listen((a0, a1) => {
if (a1 !== "REPLACE") {
c1027_10();
}
});
export function shouldNavigate() {
return !ComponentDispatch.hasSubscribers(ComponentActions.MODAL_CLOSE);
}
export { transitionTo };
export function transitionToGuild(a0, a1, a2, a3) {
c1027_8.log(`transitionToGuild - Transitioning to ${JSON.stringify({
guildId: a0,
channelId: a1,
messageId: a2
})}`);
transitionTo(Routes.CHANNEL(a0, a1, a2), a3);
}
export function currentRouteHasBackNavigation() {
return source != null && ChannelBackNavigationSources.has(source);
}
export function replaceWith(a0, a1, a2) {
let env12925;
const r2 = env12925 = {};
env12925[0] = a0;
const r0 = typeof a0 === "string" ? !c1027_9.some($mk68500(r2)) : typeof a0 !== "string";
let r1 = !r0;
if (!r0) {
c1027_8.log(`replace - route to external path ${a0}`);
window.dispatchEvent(new Event("beforeunload"));
window.location.replace(a0);
r1 = true;
}
if (!r1) {
c1027_8.log(`Replacing route with ${a0}`);
if (typeof a0 === "string") {
memoryHistory.replace(a0, a1);
} else {
memoryHistory.replace(a0);
}
source = a2;
}
}
export function getHistory() {
return memoryHistory;
}
export function getLastRouteChangeSource() {
return source;
}
export function getLastRouteChangeSourceLocationStack() {
return sourceLocationStack;
}
export function isValidFingerprintRoute(a0) {
if (a0 == null) {
memoryHistory.location.pathname == null;
}
return true;
}
export function getFingerprintLocation(a0) {
let r1 = a0;
if (a0 == null) {
let pathname = memoryHistory.location.pathname;
if (pathname == null) {
pathname = "";
}
r1 = pathname;
}
if (r1.startsWith(Routes.LOGIN)) {
r1 = PageAnalyticsLocations.LOGIN;
} else if (r1.startsWith(Routes.REGISTER)) {
r1 = PageAnalyticsLocations.REGISTER;
} else if (r1.startsWith(Routes.INVITE(""))) {
r1 = PageAnalyticsLocations.INVITE;
} else if (r1.startsWith(Routes.VERIFY)) {
r1 = PageAnalyticsLocations.VERIFY;
} else if (r1.startsWith(Routes.DISABLE_EMAIL_NOTIFICATIONS)) {
r1 = PageAnalyticsLocations.DISABLE_EMAIL_NOTIFICATIONS;
} else if (r1.startsWith(Routes.DISABLE_SERVER_HIGHLIGHT_NOTIFICATIONS)) {
r1 = PageAnalyticsLocations.DISABLE_SERVER_HIGHLIGHT_NOTIFICATIONS;
} else if (r1.startsWith(Routes.REJECT_IP)) {
r1 = PageAnalyticsLocations.REJECT_IP;
} else if (r1.startsWith(Routes.REJECT_MFA)) {
r1 = PageAnalyticsLocations.REJECT_MFA;
} else if (r1.startsWith(Routes.AUTHORIZE_IP)) {
r1 = PageAnalyticsLocations.AUTHORIZE_IP;
} else if (r1.startsWith(Routes.AUTHORIZE_PAYMENT)) {
r1 = PageAnalyticsLocations.AUTHORIZE_PAYMENT;
} else if (r1.startsWith(Routes.RESET)) {
r1 = PageAnalyticsLocations.RESET;
} else if (r1.startsWith(Routes.REPORT)) {
r1 = PageAnalyticsLocations.REPORT;
} else if (r1.startsWith(Routes.REPORT_SECOND_LOOK)) {
r1 = PageAnalyticsLocations.REPORT_SECOND_LOOK;
} else if (r1.startsWith(Routes.ACCOUNT_REVERT(""))) {
r1 = PageAnalyticsLocations.ACCOUNT_REVERT;
}
return r1;
}
export function hasNavigated() {
return false;
}
export function back() {
if (!ComponentDispatch.hasSubscribers(ComponentActions.MODAL_CLOSE)) {
source = null;
memoryHistory.goBack();
}
}
export function forward() {
if (!ComponentDispatch.hasSubscribers(ComponentActions.MODAL_CLOSE)) {
source = null;
memoryHistory.goForward();
}
}
+74
View File
@@ -0,0 +1,74 @@
// Metro module 4197 (f4198).
import ChannelStore from "../../stores/ChannelStore";
import { Routes } from "../../Constants";
import { getGuildIdForGenericRedirect } from "./useGuildIdForChannelRoute";
import ChannelActionCreators from "../../actions/ChannelActionCreators";
import { transitionTo } from "./router_utils";
import ChannelRTCActionCreators from "../../actions/ChannelRTCActionCreators";
import Module38 from "../../_bundle/Module38";
export function transitionToChannel(a0, a1) {
const channel = ChannelStore.getChannel(a0);
if (channel != null) {
const guildIdForGenericRedirect = getGuildIdForGenericRedirect(channel);
ChannelActionCreators.preload(channel.guild_id, channel.id);
transitionTo(Routes.CHANNEL(guildIdForGenericRedirect, channel.id), {
openChannel: true,
...a1
});
if (a1?.openTextInVoiceIfVoiceChannel && channel.isGuildVocal()) {
ChannelRTCActionCreators.updateChatOpen(channel.id, true);
}
}
}
export function transitionToThread(a0, a1) {
Module38(a0.parent_id != null, "Thread must have a parent ID.");
transitionTo(Routes.CHANNEL(getGuildIdForGenericRedirect(a0), a0.id), {
openChannel: true,
...a1
});
}
export function transitionToThreadMessage(a0, a1, a2) {
Module38(a0.parent_id != null, "Thread must have a parent ID.");
transitionTo(Routes.CHANNEL(getGuildIdForGenericRedirect(a0), a0.id, a1), {
openChannel: true,
...a2
});
}
export function tryTransitionToThreadMessage(a0, a1, a2, a3) {
const channel = ChannelStore.getChannel(a1);
if (channel != null) {
Module38(channel.parent_id != null, "Thread must have a parent ID.");
transitionTo(Routes.CHANNEL(getGuildIdForGenericRedirect(channel), channel.id, a2), {
openChannel: true,
...a3
});
} else {
const channel2 = ChannelStore.getChannel(a0);
if (channel2 != null) {
const guildIdForGenericRedirect = getGuildIdForGenericRedirect(channel2);
ChannelActionCreators.preload(channel2.guild_id, channel2.id);
transitionTo(Routes.CHANNEL(guildIdForGenericRedirect, channel2.id), {
openChannel: true,
...a3
});
if (a3?.openTextInVoiceIfVoiceChannel && channel2.isGuildVocal()) {
ChannelRTCActionCreators.updateChatOpen(channel2.id, true);
}
}
}
}
export function transitionToMessage(a0, a1, a2) {
const channel = ChannelStore.getChannel(a0);
if (channel != null) {
transitionTo(Routes.CHANNEL(getGuildIdForGenericRedirect(channel), channel.id, a1), {
openChannel: true,
...a2
});
}
}
export function transitionToStaticChannelRoute(a0, a1, a2) {
transitionTo(Routes.CHANNEL(a0, a1), {
openChannel: true,
...a2
});
}
@@ -0,0 +1,18 @@
// Metro module 6690 (f6691).
import { Routes } from "../../Constants";
import { getChannelIdForGuildTransition } from "./getChannelIdForGuildTransition";
import { DeprecatedLayoutAnimation } from "../animations/native/DeprecatedLayoutAnimation";
import { transitionTo } from "./router_utils";
export function transitionToGuild(a0, a1) {
const channelIdForGuildTransition = getChannelIdForGuildTransition(a0);
DeprecatedLayoutAnimation({
duration: 0,
create: void 0,
update: void 0,
delete: void 0
});
transitionTo(Routes.CHANNEL(a0, channelIdForGuildTransition), {
navigationReplace: true,
...a1
});
}
@@ -0,0 +1,34 @@
// Metro module 4198 (f4199).
import FavoriteStore from "../favorites/FavoriteStore";
import SelectedGuildStore from "../../stores/SelectedGuildStore";
import { FAVORITES } from "../../Constants";
import { useStateFromStores } from "../../_bundle/Module589";
import { isFavoritesGuildId } from "../favorites/FavoritesUtils";
export default function useGuildIdForChannelRoute(a0) {
let r10 = useStateFromStores([SelectedGuildStore], () => SelectedGuildStore.getGuildId());
if (r10 == null) {
r10 = a0.getGuildId();
}
return r10;
};
export function getGuildIdForGenericRedirect(a0) {
let r22;
L6: {
L4: {
if (isFavoritesGuildId(SelectedGuildStore.getGuildId())) {
if (!FavoriteStore.isFavorite(a0.id)) {
if (!a0.isThread()) {
break L4;
}
if (!FavoriteStore.isFavorite(a0.parent_id)) {
break L4;
}
}
r22 = FAVORITES;
break L6;
}
}
r22 = a0.getGuildId();
}
return r22;
}