2026-10-10 08:08:14 +00:00
// Module ID: 11193
// Function ID: 11194
2026-09-10 05:38:07 +00:00
// Name: RouteManagerUtils
2026-10-12 06:59:38 +00:00
// Dependencies: [109, 10354, 2069, 2065, 4943, 4748, 2116, 1085, 10355, 3, 4957, 11194, 5889, 1112, 11199, 5934, 7482, 6098, 4976, 584, 5106, 5027, 11200, 2]
2026-07-29 08:29:29 +00:00
// Exports: cleanupRouteManager, extractParamsFromVoiceModalRoute, initializeRouteManagerIfNeeded, popVoiceRoute, transitionToVoiceRoute
2026-07-20 16:05:17 +00:00
2026-10-10 08:08:14 +00:00
// Module 11193 (RouteManagerUtils)
2026-09-10 05:38:07 +00:00
import LoggerDefault from "Logger" /* 3 */ ;
2026-10-03 08:58:59 +00:00
import DispatcherDefault from "Dispatcher" /* 584 */ ;
import router_utils from "router_utils" /* 1112 */ ;
2026-10-10 08:08:14 +00:00
import ChannelRecord from "ChannelRecord" /* 2069 */ ;
import RouteUtils from "RouteUtils" /* 4957 */ ;
import flow_Client from "flow/Client" /* 5027 */ ;
import ChannelRTCActionCreatorsDefault from "ChannelRTCActionCreators" /* 5106 */ ;
import SelectedChannelActionCreatorsDefault from "SelectedChannelActionCreators" /* 5889 */ ;
import ModalActionCreatorsDefault from "ModalActionCreators" /* 5934 */ ;
2026-10-12 06:59:38 +00:00
import GuildActionCreatorsDefault from "GuildActionCreators" /* 6098 */ ;
import PrivateChannelCallUtils from "PrivateChannelCallUtils" /* 7482 */ ;
import ChannelCallStore from "ChannelCallStore" /* 10354 */ ;
import ChannelCallConstants from "ChannelCallConstants" /* 10355 */ ;
2026-10-10 08:08:14 +00:00
import _mod11194 from "module_11194" /* 11194 */ ;
import DefaultRouteActionCreators from "DefaultRouteActionCreators" /* 11199 */ ;
import RouteManagerDefault from "RouteManager" /* 11200 */ ;
2026-09-10 05:38:07 +00:00
import _objectWithoutProperties from "_objectWithoutProperties" /* 109 */ ;
2026-10-10 08:08:14 +00:00
import ChannelStore from "ChannelStore" /* 2065 */ ;
import DefaultRouteStore from "DefaultRouteStore" /* 4943 */ ;
import GuildChannelStore from "GuildChannelStore" /* 4748 */ ;
import SelectedChannelStore from "SelectedChannelStore" /* 2116 */ ;
2026-10-03 08:58:59 +00:00
import Constants from "Constants" /* 1085 */ ;
import size from "module_2" /* 2 */ ;
2026-07-23 10:11:24 +00:00
2026-10-03 08:58:59 +00:00
let Routes ;
let unpackModuleId ;
2026-09-10 05:38:07 +00:00
function voiceRouteRewriter ( location ) {
2026-10-03 08:58:59 +00:00
let channelId ;
let obj2 ;
let obj3 ;
let pathname ;
let state ;
const obj = { match : obj2.matchPath ( pathname , obj3 ) , location } ;
2026-09-10 05:38:07 +00:00
( { state , pathname } = location ) ;
2026-10-10 08:08:14 +00:00
obj2 = _mod11194 ;
2026-10-03 08:58:59 +00:00
obj3 = { path : items , strict : false , exact : false } ;
2026-07-20 16:05:17 +00:00
const tmp = extractParams ( obj ) ;
( { channelId , guildId } = tmp ) ;
2026-09-10 05:38:07 +00:00
const tmp2 = _objectWithoutProperties ( tmp , closure_3 ) ;
const channel = ChannelStore . getChannel ( channelId ) ;
2026-07-20 16:05:17 +00:00
let tmp4 = null ;
if ( null != channelId ) {
tmp4 = null ;
if ( null != guildId ) {
let type ;
2026-07-29 08:29:29 +00:00
if ( channel != null ) {
2026-07-20 16:05:17 +00:00
type = channel . type ;
}
if ( type === ChannelTypes . GUILD_VOICE ) {
2026-10-03 08:58:59 +00:00
const obj4 = { channelId , guildId } ;
2026-07-20 16:05:17 +00:00
const merged = Object . assign ( tmp2 ) ;
2026-09-10 05:38:07 +00:00
tmp4 = obj4 ;
2026-07-20 16:05:17 +00:00
} else {
let type1 ;
2026-07-29 08:29:29 +00:00
if ( channel != null ) {
2026-07-20 16:05:17 +00:00
type1 = channel . type ;
}
tmp4 = null ;
}
}
}
if ( null != tmp4 ) {
2026-10-03 08:58:59 +00:00
if ( logger != null ) {
2026-07-20 16:05:17 +00:00
const _JSON = JSON ;
const _HermesInternal = HermesInternal ;
2026-10-03 08:58:59 +00:00
logger . log ( "voiceRouteRewriter: has voiceChannelParams = " + JSON . stringify ( tmp4 ) ) ;
2026-07-20 16:05:17 +00:00
}
const _HermesInternal2 = HermesInternal ;
2026-09-10 05:38:07 +00:00
const combined = "" + DefaultRouteStore . lastNonVoiceRoute + Routes . VOICE_CHAT_CHANNEL_PARTIAL ( tmp4 . guildId , tmp4 . channelId , tmp4 . messageId ) ;
2026-07-29 08:29:29 +00:00
let tmp17 = null ;
2026-09-10 05:38:07 +00:00
if ( combined !== location . pathname ) {
2026-10-03 08:58:59 +00:00
if ( logger != null ) {
2026-07-20 16:05:17 +00:00
const _HermesInternal3 = HermesInternal ;
2026-10-03 08:58:59 +00:00
logger . log ( "voiceRouteRewriter: rewriting route: " + location . pathname + " -> " + combined ) ;
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
tmp17 = { path : combined , state } ;
2026-09-10 05:38:07 +00:00
const obj6 = { path : combined , state } ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp17 ;
2026-07-20 16:05:17 +00:00
} else {
return null ;
}
}
function saveLastRouteListener ( pathname ) {
2026-10-03 08:58:59 +00:00
const obj = DefaultRouteActionCreators ;
obj . saveLastRoute ( pathname . pathname ) ;
2026-07-20 16:05:17 +00:00
}
function saveLastNonVoiceRouteListener ( pathname ) {
2026-10-03 08:58:59 +00:00
pathname = pathname . pathname ;
2026-10-10 08:08:14 +00:00
const obj = _mod11194 ;
2026-10-03 08:58:59 +00:00
const obj2 = { path : items , strict : false , exact : false } ;
const matchPathResult = obj . matchPath ( pathname , obj2 ) ;
2026-07-20 16:05:17 +00:00
let channelId ;
2026-10-03 08:58:59 +00:00
const getChannel = ChannelStore . getChannel ;
2026-07-29 08:29:29 +00:00
if ( matchPathResult != null ) {
channelId = matchPathResult . params . channelId ;
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
const channel = getChannel ( channelId ) ;
2026-07-20 16:05:17 +00:00
let type ;
2026-07-29 08:29:29 +00:00
if ( channel != null ) {
2026-07-20 16:05:17 +00:00
type = channel . type ;
}
2026-07-29 08:29:29 +00:00
let tmp9 = null ;
2026-07-20 16:05:17 +00:00
if ( type !== ChannelTypes . GUILD_VOICE ) {
let type1 ;
2026-07-29 08:29:29 +00:00
if ( channel != null ) {
2026-07-20 16:05:17 +00:00
type1 = channel . type ;
}
2026-07-29 08:29:29 +00:00
tmp9 = null ;
if ( type1 !== tmp8 . GUILD_STAGE_VOICE ) {
2026-09-10 05:38:07 +00:00
const obj3 = { match : matchPathResult , location : pathname } ;
tmp9 = extractParams ( obj3 ) ;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
if ( null != tmp9 ) {
2026-09-10 05:38:07 +00:00
const tmpResult = DefaultRouteActionCreators ;
2026-10-03 08:58:59 +00:00
const result = tmpResult . saveLastNonVoiceRoute ( Routes . CHANNEL ( tmp9 . guildId , tmp9 . channelId ) ) ;
2026-07-20 16:05:17 +00:00
}
}
2026-10-06 11:16:32 +00:00
function updateSelectedChannelListener ( location , arg1 ) {
let channel1 ;
2026-10-03 08:58:59 +00:00
let channelId ;
let jumpType ;
let messageId ;
2026-10-06 11:16:32 +00:00
let tmp21 ;
let tmp53 ;
let tmp55 ;
2026-10-03 08:58:59 +00:00
let voiceChannelId ;
let voiceChannelId2 ;
let voiceGuildId ;
let voiceGuildId2 ;
let voiceMessageId ;
let voiceMessageId2 ;
const pathname = location . pathname ;
2026-10-10 08:08:14 +00:00
let obj = channel1 ( 11194 ) ;
2026-10-03 08:58:59 +00:00
const obj2 = { path : items , strict : false , exact : false } ;
const matchPathResult = obj . matchPath ( pathname , obj2 ) ;
2026-07-29 08:29:29 +00:00
let params ;
if ( matchPathResult != null ) {
params = matchPathResult . params ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if ( params == null ) {
params = { } ;
}
2026-10-03 08:58:59 +00:00
const obj3 = { voiceChannelId , voiceGuildId , voiceMessageId } ;
const obj4 = { match : matchPathResult , location } ;
2026-07-29 08:29:29 +00:00
( { voiceChannelId , voiceGuildId , voiceMessageId } = params ) ;
2026-10-03 08:58:59 +00:00
const merged = Object . assign ( extractParams ( obj4 ) ) ;
2026-09-10 05:38:07 +00:00
( { guildId , channelId , messageId , jumpType , voiceChannelId : voiceChannelId2 , voiceGuildId : voiceGuildId2 , voiceMessageId : voiceMessageId2 } = obj3 ) ;
2026-07-29 08:29:29 +00:00
if ( null == voiceChannelId2 ) {
if ( null == voiceGuildId2 ) {
2026-10-06 11:16:32 +00:00
const tmp42 = closure_15 ;
2026-07-29 08:29:29 +00:00
if ( closure_15 != null ) {
2026-07-20 16:05:17 +00:00
const _JSON5 = JSON ;
2026-10-06 11:16:32 +00:00
const verbose2 = tmp42 . verbose ;
2026-07-20 16:05:17 +00:00
const json = JSON . stringify ( location ) ;
const _JSON6 = JSON ;
const _HermesInternal3 = HermesInternal ;
2026-10-03 08:58:59 +00:00
const obj5 = { guildId , channelId , messageId , jumpType , voiceChannelId : voiceChannelId2 , voiceGuildId : voiceGuildId2 , voiceMessageId : voiceMessageId2 } ;
verbose2 ( "UpdateSelectedChannelListener -> no voice route present in " + json + " " + JSON . stringify ( obj5 ) + " " ) ;
2026-07-20 16:05:17 +00:00
}
2026-09-10 05:38:07 +00:00
const channel = ChannelStore . getChannel ( SelectedChannelStore . getLastSelectedChannelId ( ) ) ;
2026-07-29 08:29:29 +00:00
let isGuildVoiceResult ;
if ( channel != null ) {
isGuildVoiceResult = channel . isGuildVoice ( ) ;
}
if ( ! isGuildVoiceResult ) {
let isGuildStageVoiceResult ;
if ( channel != null ) {
isGuildStageVoiceResult = channel . isGuildStageVoice ( ) ;
}
isGuildVoiceResult = isGuildStageVoiceResult ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if ( isGuildVoiceResult ) {
2026-10-03 08:58:59 +00:00
const popWithKey = ModalActionCreatorsDefault . popWithKey ;
ModalActionCreatorsDefault ;
2026-10-12 06:59:38 +00:00
const tmpResult = channel1 ( 7482 ) ;
2026-10-03 08:58:59 +00:00
popWithKey ( tmpResult . getVoiceChannelKey ( channel . id ) ) ;
2026-07-20 16:05:17 +00:00
}
2026-10-06 11:16:32 +00:00
const obj17 = GuildActionCreatorsDefault ;
const guild = obj17 . selectGuild ( guildId ) ;
const obj6 = { guildId , channelId , messageId , jumpType , skipMessageFetch : tmp5 , opensChannel : tmp53 , isAppStartupNavigation : tmp55 } ;
tmp53 = null != channelId ;
const selectChannel2 = SelectedChannelActionCreatorsDefault . selectChannel ;
2026-10-03 08:58:59 +00:00
SelectedChannelActionCreatorsDefault ;
2026-10-06 11:16:32 +00:00
if ( tmp53 ) {
tmp53 = true !== location . navigationReplace || true === location . openChannel ;
2026-09-03 10:05:34 +00:00
}
2026-10-06 11:16:32 +00:00
tmp55 = true === location . isAppStartupNavigation && "POP" !== arg1 ;
const channel2 = selectChannel2 ( obj6 ) ;
2026-07-20 16:05:17 +00:00
}
}
2026-10-06 11:16:32 +00:00
channel1 = ChannelStore . getChannel ( voiceChannelId2 ) ;
2026-07-20 16:05:17 +00:00
let type ;
2026-10-06 11:16:32 +00:00
if ( channel1 != null ) {
type = channel1 . type ;
2026-07-20 16:05:17 +00:00
}
if ( type !== ChannelTypes . GUILD_VOICE ) {
let type1 ;
2026-10-06 11:16:32 +00:00
if ( channel1 != null ) {
type1 = channel1 . type ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if ( type1 !== tmp7 . GUILD_STAGE_VOICE ) {
2026-10-06 11:16:32 +00:00
const tmp57 = closure_15 ;
2026-07-29 08:29:29 +00:00
if ( closure_15 != null ) {
2026-07-20 16:05:17 +00:00
let id ;
2026-10-06 11:16:32 +00:00
const log = tmp57 . log ;
if ( channel1 != null ) {
id = channel1 . id ;
2026-07-20 16:05:17 +00:00
}
const _JSON = JSON ;
const _JSON2 = JSON ;
2026-09-10 05:38:07 +00:00
const obj7 = { guildId , channelId , messageId , jumpType , voiceChannelId : voiceChannelId2 , voiceGuildId : voiceGuildId2 , voiceMessageId : voiceMessageId2 } ;
2026-07-20 16:05:17 +00:00
const json1 = JSON . stringify ( location ) ;
const _HermesInternal = HermesInternal ;
2026-10-03 08:58:59 +00:00
log ( "UpdateSelectedChannelListener -> !!!VERY BAD!!! channel.id " + id + " (voiceChannelId " + voiceChannelId2 + ") is not a voice channel! and yet RouteUtils thinks it is! " + json1 + " " + JSON . stringify ( obj7 ) + " " ) ;
2026-07-20 16:05:17 +00:00
}
}
}
2026-10-03 08:58:59 +00:00
const tmp15 = closure_15 ;
2026-07-29 08:29:29 +00:00
if ( closure_15 != null ) {
2026-07-20 16:05:17 +00:00
const _JSON3 = JSON ;
2026-10-03 08:58:59 +00:00
const verbose = tmp15 . verbose ;
2026-07-20 16:05:17 +00:00
const json2 = JSON . stringify ( location ) ;
const _JSON4 = JSON ;
const _HermesInternal2 = HermesInternal ;
2026-10-06 11:16:32 +00:00
const obj9 = { guildId , channelId , messageId , jumpType , voiceChannelId : voiceChannelId2 , voiceGuildId : voiceGuildId2 , voiceMessageId : voiceMessageId2 } ;
verbose ( "UpdateSelectedChannelListener -> voice route present! " + json2 + " " + JSON . stringify ( obj9 ) + " " ) ;
2026-09-19 06:52:51 +00:00
}
2026-10-06 11:16:32 +00:00
const isGuildStageVoiceResult1 = channel1 . isGuildStageVoice ( ) && SelectedChannelStore . getVoiceChannelId ( ) === channel1 . id ;
2026-09-19 06:52:51 +00:00
if ( isGuildStageVoiceResult1 ) {
2026-10-03 08:58:59 +00:00
const obj8 = GuildActionCreatorsDefault ;
const guild1 = obj8 . selectGuild ( voiceGuildId2 ) ;
2026-10-06 11:16:32 +00:00
const obj10 = { guildId : voiceGuildId2 , channelId : voiceChannelId2 , messageId : voiceMessageId2 , jumpType , isAppStartupNavigation : tmp21 } ;
tmp21 = true === location . isAppStartupNavigation ;
const selectChannel = SelectedChannelActionCreatorsDefault . selectChannel ;
SelectedChannelActionCreatorsDefault ;
if ( tmp21 ) {
tmp21 = "POP" !== arg1 ;
}
const channel3 = selectChannel ( obj10 ) ;
2026-09-10 05:38:07 +00:00
}
2026-10-10 08:08:14 +00:00
const isModalOpen = channel1 ( 4976 ) . isModalOpen ;
channel1 ( 4976 ) ;
2026-10-12 06:59:38 +00:00
const tmpResult5 = channel1 ( 7482 ) ;
2026-10-06 11:16:32 +00:00
if ( ! isModalOpen ( tmpResult5 . getVoiceChannelKey ( channel1 . id ) ) ) {
2026-10-03 08:58:59 +00:00
const popAboveKey = ModalActionCreatorsDefault . popAboveKey ;
ModalActionCreatorsDefault ;
2026-10-12 06:59:38 +00:00
const tmpResult6 = channel1 ( 7482 ) ;
2026-10-06 11:16:32 +00:00
popAboveKey ( tmpResult6 . getVoiceChannelKey ( channel1 . id ) ) ;
const obj12 = DispatcherDefault ;
obj12 . wait ( ( ) = > {
2026-10-03 08:58:59 +00:00
const obj = PrivateChannelCallUtils ;
2026-10-06 11:16:32 +00:00
obj . openGuildVoiceModal ( channel1 ) ;
2026-07-20 16:05:17 +00:00
} ) ;
}
2026-10-06 11:16:32 +00:00
const tmp28 = channel1 . isGuildVoice ( ) && null != voiceMessageId2 || channel1 . isGuildStageVoice ( ) ;
if ( tmp28 ) {
2026-09-19 06:52:51 +00:00
if ( isGuildStageVoiceResult1 ) {
2026-10-06 11:16:32 +00:00
setVoiceChatDrawerState ( channel1 . id , VoiceChatDrawerState . OPEN ) ;
2026-09-19 06:52:51 +00:00
} else {
2026-10-10 08:08:14 +00:00
const obj13 = ChannelRTCActionCreatorsDefault ;
obj13 . updateChatOpen ( channel1 . id , true ) ;
2026-09-19 06:52:51 +00:00
}
2026-10-06 11:16:32 +00:00
const tmp34 = null != voiceGuildId2 && null != voiceChannelId2 && null != voiceMessageId2 ;
if ( tmp34 ) {
const obj14 = ChannelRTCActionCreatorsDefault ;
const result = obj14 . jumpToVoiceChannelMessage ( voiceGuildId2 , voiceChannelId2 , voiceMessageId2 , jumpType ) ;
2026-07-20 16:05:17 +00:00
}
}
}
function extractParams ( arg0 ) {
2026-10-03 08:58:59 +00:00
let _location ;
let channelId ;
let match ;
let tmp ;
2026-07-20 16:05:17 +00:00
( { match , location : _location } = arg0 ) ;
if ( null == match ) {
2026-10-03 08:58:59 +00:00
const obj = { guildId : unpackModuleId , channelId : null , messageId : null , jumpType : flow_Client.JumpType.ANIMATED , skipMessageFetch : false } ;
2026-07-20 16:05:17 +00:00
return obj ;
} else {
2026-10-03 08:58:59 +00:00
let ANIMATED ;
2026-07-20 16:05:17 +00:00
const params = match . params ;
( { guildId , channelId } = params ) ;
2026-10-03 08:58:59 +00:00
const messageId = params . messageId ;
if ( _location . jumpType === flow_Client . JumpType . INSTANT ) {
2026-10-10 08:08:14 +00:00
ANIMATED = tmp5 ( 5027 ) . JumpType . INSTANT ;
2026-07-20 16:05:17 +00:00
} else {
2026-10-10 08:08:14 +00:00
ANIMATED = tmp5 ( 5027 ) . JumpType . ANIMATED ;
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
RouteUtils ;
const obj2 = { guildId : unpackModuleId , channelId : tmp , messageId , jumpType : ANIMATED , skipMessageFetch : _location.skipMessageFetch } ;
tmp = null ;
const tmp5Result2 = RouteUtils ;
2026-09-10 05:38:07 +00:00
if ( tmp5Result2 . isValidChannelId ( channelId ) ) {
2026-07-29 08:29:29 +00:00
tmp = channelId ;
2026-07-20 16:05:17 +00:00
}
2026-09-10 05:38:07 +00:00
return obj2 ;
2026-07-20 16:05:17 +00:00
}
}
function logRouteChange ( pathname ) {
2026-08-24 06:08:38 +00:00
logger . log ( "Navigated to: " + pathname . pathname ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
let closure_3 = [ "channelId" , "guildId" ] ;
2026-10-03 08:58:59 +00:00
const setVoiceChatDrawerState = ChannelCallStore . setVoiceChatDrawerState ;
let closure_6 = ChannelRecord . isGuildSelectableChannelType ;
( { ME : unpackModuleId , Routes } = Constants ) ;
2026-09-10 05:38:07 +00:00
const ChannelTypes = Constants . ChannelTypes ;
2026-10-03 08:58:59 +00:00
const VoiceChatDrawerState = ChannelCallConstants . VoiceChatDrawerState ;
2026-09-10 05:38:07 +00:00
const tmp3 = new LoggerDefault ( "RouteUtils" ) ;
2026-10-03 08:58:59 +00:00
const logger = tmp3 ;
let c16 = false ;
const CHANNEL = Routes . CHANNEL ;
const RouteParam = RouteUtils . RouteParam ;
2026-07-20 16:05:17 +00:00
const guildIdResult = RouteParam . guildId ( ) ;
2026-10-03 08:58:59 +00:00
const RouteParam2 = RouteUtils . RouteParam ;
const CHANNELResult = CHANNEL ( guildIdResult , RouteParam2 . channelId ( { optional : true } ) , ":messageId?" ) ;
const VOICE_CHAT_CHANNEL_PARTIAL = Routes . VOICE_CHAT_CHANNEL_PARTIAL ;
const RouteParam3 = RouteUtils . RouteParam ;
const guildIdResult1 = RouteParam3 . guildId ( { name : "voiceGuildId" } ) ;
const RouteParam4 = RouteUtils . RouteParam ;
const items = [ "" + CHANNELResult + VOICE_CHAT_CHANNEL_PARTIAL ( guildIdResult1 , RouteParam4 . channelId ( { name : "voiceChannelId" } ) , ":voiceMessageId?" ) , CHANNELResult ] ;
2026-09-10 05:38:07 +00:00
let result = size . fileFinishedImporting ( "modules/routing/native/RouteManagerUtils.tsx" ) ;
2026-07-20 16:05:17 +00:00
export const MAIN_DRAWER_ROUTES = CHANNELResult ;
2026-07-29 08:29:29 +00:00
export const extractParamsFromVoiceModalRoute = function extractParamsFromVoiceModalRoute ( location ) {
2026-10-03 08:58:59 +00:00
let voiceChannelId ;
let voiceGuildId ;
let voiceMessageId ;
const pathname = location . pathname ;
2026-10-10 08:08:14 +00:00
const obj = _mod11194 ;
2026-10-03 08:58:59 +00:00
const obj2 = { path : items , strict : false , exact : false } ;
const matchPathResult = obj . matchPath ( pathname , obj2 ) ;
2026-07-29 08:29:29 +00:00
let params ;
if ( matchPathResult != null ) {
params = matchPathResult . params ;
}
if ( params == null ) {
params = { } ;
}
2026-10-03 08:58:59 +00:00
const obj3 = { voiceChannelId , voiceGuildId , voiceMessageId } ;
const obj4 = { match : matchPathResult , location } ;
2026-07-29 08:29:29 +00:00
( { voiceChannelId , voiceGuildId , voiceMessageId } = params ) ;
2026-10-03 08:58:59 +00:00
const merged = Object . assign ( extractParams ( obj4 ) ) ;
2026-09-10 05:38:07 +00:00
return obj3 ;
2026-07-29 08:29:29 +00:00
} ;
2026-07-20 16:05:17 +00:00
export const popVoiceRoute = function popVoiceRoute ( guildId ) {
2026-10-03 08:58:59 +00:00
let id ;
2026-09-10 05:38:07 +00:00
const lastNonVoiceRoute = DefaultRouteStore . lastNonVoiceRoute ;
2026-08-24 06:08:38 +00:00
logger . log ( "popVoiceRoute: last non-voice route is " + lastNonVoiceRoute ) ;
2026-10-03 08:58:59 +00:00
const obj = { guildId , channelId : null } ;
const selectChannel = SelectedChannelActionCreatorsDefault . selectChannel ;
SelectedChannelActionCreatorsDefault ;
2026-09-10 05:38:07 +00:00
const channel = ChannelStore . getChannel ( SelectedChannelStore . getLastSelectedChannelId ( ) ) ;
2026-07-29 08:29:29 +00:00
let type ;
2026-10-03 08:58:59 +00:00
const obj2 = SelectedChannelStore ;
2026-07-29 08:29:29 +00:00
if ( channel != null ) {
type = channel . type ;
}
if ( null != type ) {
let type1 ;
2026-10-03 08:58:59 +00:00
const tmp6 = closure_6 ;
2026-07-29 08:29:29 +00:00
if ( channel != null ) {
type1 = channel . type ;
}
2026-10-03 08:58:59 +00:00
if ( tmp6 ( type1 ) ) {
id = channel . id ;
2026-07-29 08:29:29 +00:00
}
2026-10-03 08:58:59 +00:00
obj . channelId = id ;
const channel1 = selectChannel ( obj ) ;
const obj3 = router_utils ;
obj3 . transitionTo ( lastNonVoiceRoute ) ;
2026-07-29 08:29:29 +00:00
}
2026-10-03 08:58:59 +00:00
id = obj2 . getMostRecentSelectedTextChannelId ( guildId ) ;
2026-07-29 08:29:29 +00:00
if ( id == null ) {
2026-09-10 05:38:07 +00:00
const defaultChannel = GuildChannelStore . getDefaultChannel ( guildId ) ;
let id1 ;
2026-07-29 08:29:29 +00:00
if ( defaultChannel != null ) {
2026-09-10 05:38:07 +00:00
id1 = defaultChannel . id ;
2026-07-29 08:29:29 +00:00
}
2026-09-10 05:38:07 +00:00
id = id1 ;
2026-07-29 08:29:29 +00:00
}
2026-07-20 16:05:17 +00:00
} ;
export const transitionToVoiceRoute = function transitionToVoiceRoute ( arg0 , arg1 ) {
2026-09-10 05:38:07 +00:00
const defaultRoute = DefaultRouteStore . defaultRoute ;
2026-10-10 08:08:14 +00:00
const obj = _mod11194 ;
2026-10-03 08:58:59 +00:00
const obj2 = { path : items , strict : false , exact : false } ;
const matchPathResult = obj . matchPath ( defaultRoute , obj2 ) ;
2026-07-20 16:05:17 +00:00
let params ;
2026-07-29 08:29:29 +00:00
if ( matchPathResult != null ) {
params = matchPathResult . params ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if ( params == null ) {
2026-07-20 16:05:17 +00:00
params = { } ;
}
const voiceChannelId = params . voiceChannelId ;
2026-08-24 06:08:38 +00:00
logger . log ( "transitionToVoiceRoute(<" + arg0 + ">, <" + arg1 + ">), current route " + defaultRoute + " has voiceChannelId " + voiceChannelId ) ;
2026-10-03 08:58:59 +00:00
const obj4 = logger ;
2026-07-20 16:05:17 +00:00
if ( voiceChannelId !== arg1 ) {
2026-09-10 05:38:07 +00:00
const tmpResult = router_utils ;
2026-10-03 08:58:59 +00:00
tmpResult . transitionToGuild ( arg0 , arg1 ) ;
2026-07-20 16:05:17 +00:00
} else {
const _HermesInternal = HermesInternal ;
2026-10-03 08:58:59 +00:00
obj4 . log ( "transitionToVoiceRoute -> " + voiceChannelId + " === " + arg1 + ". staying where we are" ) ;
2026-07-20 16:05:17 +00:00
}
} ;
export { voiceRouteRewriter } ;
export { saveLastRouteListener } ;
export { saveLastNonVoiceRouteListener } ;
export { updateSelectedChannelListener } ;
export { extractParams } ;
export const initializeRouteManagerIfNeeded = function initializeRouteManagerIfNeeded() {
2026-10-03 08:58:59 +00:00
const tmp = c16 ;
if ( ! tmp ) {
const obj = RouteManagerDefault ;
obj . addRouteRewriter ( voiceRouteRewriter ) ;
const obj2 = RouteManagerDefault ;
const result = obj2 . addRouteChangeListener ( saveLastRouteListener ) ;
const obj3 = RouteManagerDefault ;
const result1 = obj3 . addRouteChangeListener ( saveLastNonVoiceRouteListener ) ;
const obj4 = RouteManagerDefault ;
const result2 = obj4 . addRouteChangeListener ( updateSelectedChannelListener ) ;
const obj5 = RouteManagerDefault ;
const result3 = obj5 . addRouteChangeListener ( logRouteChange ) ;
const obj6 = RouteManagerDefault ;
obj6 . initialize ( ) ;
2026-07-23 10:11:24 +00:00
c16 = true ;
2026-07-20 16:05:17 +00:00
}
} ;
export const cleanupRouteManager = function cleanupRouteManager() {
2026-10-03 08:58:59 +00:00
const tmp = c16 ;
if ( tmp ) {
const obj = RouteManagerDefault ;
obj . removeRouteRewriter ( voiceRouteRewriter ) ;
const obj2 = RouteManagerDefault ;
const result = obj2 . removeRouteChangeListener ( saveLastRouteListener ) ;
const obj3 = RouteManagerDefault ;
const result1 = obj3 . removeRouteChangeListener ( saveLastNonVoiceRouteListener ) ;
const obj4 = RouteManagerDefault ;
const result2 = obj4 . removeRouteChangeListener ( updateSelectedChannelListener ) ;
const obj5 = RouteManagerDefault ;
const result3 = obj5 . removeRouteChangeListener ( logRouteChange ) ;
const obj6 = RouteManagerDefault ;
obj6 . cleanup ( ) ;
2026-07-23 10:11:24 +00:00
c16 = false ;
2026-07-20 16:05:17 +00:00
}
} ;