Files
discord-decomp/sources/modules/voice_panel/native/VoicePanelController.tsx
T
2026-07-28 01:06:53 +03:00

1868 lines
118 KiB
TypeScript

/* Metro module 15405; source: modules/voice_panel/native/VoicePanelController.tsx; dependencies: [57, 31, 27, 4502, 1378, 4606, 9559, 10724, 7730, 1379, 4259, 4294, 7710, 11795, 11793, 661, 4237, 8044, 4299, 11796, 33, 15406, 4017, 7739, 672, 15407, 566, 3857, 10696, 1244, 15408, 15409, 8899, 7860, 15410, 1478, 1585, 15432, 11797, 11282, 22, 491, 1239, 690, 10712, 11534, 4827, 683, 7717, 4610, 15362, 4508, 15433, 7712, 4863, 4015, 5459, 15434, 15435, 3774, 15436, 15442, 15443, 15367, 1216, 15444, 11794, 4037, 2] */
import Module00022 from '../../../by-id/module-00022.js'; /* Metro dependency 22 */
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
import Durations from '../../../utils/Durations.tsx'; /* Metro dependency 672 */
import EmbeddedActivitiesStore from '../../activities/EmbeddedActivitiesStore.tsx'; /* Metro dependency 1378 */
import ChannelStore from '../../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
import GuildThemeGuildIdOverrideContext from '../../guild_themes/native/GuildThemeGuildIdOverrideContext.tsx'; /* Metro dependency 4037 */
import MediaEngineStore from '../../../stores/MediaEngineStore.tsx'; /* Metro dependency 4259 */
import RTCConnectionStore from '../../../stores/RTCConnectionStore.tsx'; /* Metro dependency 4294 */
import AccessibilityStore from '../../a11y/AccessibilityStore.tsx'; /* Metro dependency 4502 */
import ChannelRTCStore from '../../calls/ChannelRTCStore.tsx'; /* Metro dependency 4606 */
import VoicePanelStore from '../VoicePanelStore.tsx'; /* Metro dependency 7710 */
import ChannelCallLifecycleStore from '../../video_calls/native/ChannelCallLifecycleStore.tsx'; /* Metro dependency 7730 */
import AppFreezeStore from '../../panels/morphable/AppFreezeStore.tsx'; /* Metro dependency 9559 */
import SubscribeToSafeAreaInsetsNative from '../../safe_area/subscribeToSafeAreaInsets.native.tsx'; /* Metro dependency 10712 */
import SafeAreaDisabledStore from '../../panels/morphable/native/SafeAreaDisabledStore.tsx'; /* Metro dependency 10724 */
import UpdateSharedValueIfChangedNative from '../../reanimated/utils/updateSharedValueIfChanged.native.tsx'; /* Metro dependency 11282 */
import SubscribeToWindowDimensionsNative from '../../screen/subscribeToWindowDimensions.native.tsx'; /* Metro dependency 11534 */
import VoicePanelStateContext from './VoicePanelStateContext.tsx'; /* Metro dependency 11794 */
import VoicePanelCardLayoutManager from './card/VoicePanelCardLayoutManager.tsx'; /* Metro dependency 11797 */
import UseHandleOAuthNavigation from '../../activities/utils/native/useHandleOAuthNavigation.tsx'; /* Metro dependency 15367 */
import MobileMuteIndicatorExperiment from '../../calls/MobileMuteIndicatorExperiment.tsx'; /* Metro dependency 15407 */
import UseIsVoicePanelParticipantFocusable from './utils/useIsVoicePanelParticipantFocusable.tsx'; /* Metro dependency 15433 */
import VoicePanelStreamOutputSinkStack from './controller/VoicePanelStreamOutputSinkStack.tsx'; /* Metro dependency 15434 */
import UseVoicePanelParticipants from './hooks/useVoicePanelParticipants.tsx'; /* Metro dependency 15435 */
import UsePIPAvoidanceSpecs from './pip/usePIPAvoidanceSpecs.tsx'; /* Metro dependency 15442 */
import UsePanelOpenState from './controller/usePanelOpenState.tsx'; /* Metro dependency 15443 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactNativeModule from '../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as JsxRuntimeModule from '../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
import * as FluxModule from '../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
import * as ReactBatchUpdatesNativeModule from '../../../external/discord_common/js/shared/utils/ReactBatchUpdates.native.tsx'; /* Metro dependency 690 */
import * as ComponentDispatchUtilsModule from '../../../utils/ComponentDispatchUtils.tsx'; /* Metro dependency 1239 */
import * as UseWindowDimensionsNativeModule from '../../screen/useWindowDimensions.native.tsx'; /* Metro dependency 1478 */
import * as UseSafeAreaInsetsNativeModule from '../../safe_area/useSafeAreaInsets.native.tsx'; /* Metro dependency 1585 */
import * as ReanimatedRexportModule from '../../reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
import * as ConstantsModule from '../../activities/Constants.tsx'; /* Metro dependency 4237 */
import * as CallConstantsModule from '../../calls/CallConstants.tsx'; /* Metro dependency 4299 */
import * as TransitionGroupModule from '../../../design/components/TransitionGroup/TransitionGroup.tsx'; /* Metro dependency 4508 */
import * as DeviceOrientationModule from '../../device/native/DeviceOrientation.tsx'; /* Metro dependency 7717 */
import * as CheapWorkletShallowEqualModule from '../../reanimated/native/cheapWorkletShallowEqual.tsx'; /* Metro dependency 7739 */
import * as ActivityPanelConstantsModule from '../../activities/panel/ActivityPanelConstants.tsx'; /* Metro dependency 8044 */
import * as VoicePanelConstantsModule from '../VoicePanelConstants.tsx'; /* Metro dependency 11795 */
import * as MorphablePanelConstantsModule from '../../panels/morphable/native/MorphablePanelConstants.tsx'; /* Metro dependency 11796 */
import * as VoicePanelCardLayoutManagerModule from './card/VoicePanelCardLayoutManager.tsx'; /* Metro dependency 11797 */
import * as VoicePanelPIPStateContextModule from './pip/VoicePanelPIPStateContext.tsx'; /* Metro dependency 15444 */
function _fun117729(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#117729, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:6, offset: 0x024bf1dc, size: 859 bytes, params: 8, frame: 19
const env0_0 = require;
const _arrayLikeToArray_117732 = function(a0, a1) {
var r0;
var r1;
var r2;
var value3;
var length;
var value5;
var value = undefined;
var value2 = value == null;
reducibleJoin2: while (true) {
if (value2) {
r0 = value2;
break reducibleJoin2;
}
value3 = value > a0.length;
r0 = value3;
break reducibleJoin2;
}
reducibleJoin4: while (true) {
if (r0) {
length = a0.length;
r1 = length;
break reducibleJoin4;
}
r1 = value;
break reducibleJoin4;
}
value = (0, global.Array)(r1);
var value4 = 0;
if (value4 < r1) {
r2 = value4;
reducibleLoop5: while (true) {
value[r2] = a0[r2];
value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
if (value5 < r1) {
r2 = value5;
continue reducibleLoop5;
}
break reducibleLoop5;
}
}
return value;
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = VoicePanelConstantsModule;
const env0_16 = value.VoicePanelModes;
const env0_17 = value.getAnalyticsNameForVoicePanelMode;
value = require(11793) /* metro dependency 11793: VoicePanelControlsConstants */;
const env0_18 = value.CONTROLS_HEIGHT;
const env0_19 = value.CONTROLS_HEIGHT_PTT;
const env0_20 = value.CONTROLS_HIDE_TIMEOUT;
const env0_21 = value.VoicePanelControlsModes;
value = require(661) /* metro dependency 661: Constants */;
const env0_22 = value.AnalyticEvents;
const env0_23 = value.ComponentActions;
const env0_24 = value.InputModes;
object = {code: 'function VoicePanelControllerTsx1(){const{focused,mode,connected}=this.__closure;var _focused$get;return[(_focused$get=focused.get())===null||_focused$get===void 0?void 0:_focused$get.id,mode.get(),connected.get()];}'};
object = {code: 'function VoicePanelControllerTsx2(props,previous){const{cheapWorkletArrayShallowEqual,runOnJS,handleAnimatedReaction}=this.__closure;if(cheapWorkletArrayShallowEqual(props,previous!==null&&previous!==void 0?previous:undefined))return;const[focusedParticipantId,voicePanelMode,connectedValue]=props;runOnJS(handleAnimatedReaction)({focusedParticipantId:focusedParticipantId,voicePanelMode:voicePanelMode,connectedValue:connectedValue});}'};
const Millis = (Durations).Millis;
const MINUTE = Millis.MINUTE;
const env0_32 = 5 * MINUTE;
object = {code: 'function VoicePanelControllerTsx3(){const{focused,pipState}=this.__closure;var _focused$get;return[(_focused$get=focused.get())===null||_focused$get===void 0?void 0:_focused$get.id,pipState.id];}'};
object = {code: 'function VoicePanelControllerTsx4(props,previous){const{cheapWorkletArrayShallowEqual,runOnJS,handleStateUpdates}=this.__closure;if(cheapWorkletArrayShallowEqual(props,previous!==null&&previous!==void 0?previous:undefined))return;const[focusedId,pipParticipantId]=props;runOnJS(handleStateUpdates)({focusedId:focusedId,pipParticipantId:pipParticipantId});}'};
object = {code: 'function VoicePanelControllerTsx5(value){const{isFocusedVideoZoomed}=this.__closure;isFocusedVideoZoomed.set(value);}'};
object = {code: 'function VoicePanelControllerTsx6(){const{mode,VoicePanelModes,MorphablePanelModes}=this.__closure;switch(mode.get()){case VoicePanelModes.PANEL:{return MorphablePanelModes.PANEL;}case VoicePanelModes.PIP:{return MorphablePanelModes.PIP;}default:{return MorphablePanelModes.UNDEFINED;}}}'};
object = {code: 'function VoicePanelControllerTsx7(){const{mode}=this.__closure;return mode.get();}'};
object = {code: 'function VoicePanelControllerTsx8(value){const{VoicePanelModes,runOnJS,_queueHideControls,_clearHideControlsQueue}=this.__closure;if(value===VoicePanelModes.PANEL){runOnJS(_queueHideControls)();}else{runOnJS(_clearHideControlsQueue)();}}'};
object = {code: 'function VoicePanelControllerTsx9(){const{connected}=this.__closure;return connected.get();}'};
object = {code: 'function VoicePanelControllerTsx10(connected){const{updateSharedValueIfChanged,controlsSpecs,pushToTalk,CONTROLS_HEIGHT_PTT,CONTROLS_HEIGHT}=this.__closure;updateSharedValueIfChanged(controlsSpecs,{height:pushToTalk&&connected?CONTROLS_HEIGHT_PTT:CONTROLS_HEIGHT,pushToTalk:pushToTalk});}'};
object = {code: 'function VoicePanelControllerTsx11({windowState:windowState,safeAreaState:safeAreaState,contentState:contentState}){const{isConnected,cheapWorkletShallowEqual,contentDimensions,windowDimensions,safeArea,runOnJS,executeLayoutManagerEffect}=this.__closure;if(isConnected&&!cheapWorkletShallowEqual(contentDimensions.get(),contentState)){contentDimensions.set(contentState);}if(!cheapWorkletShallowEqual(windowDimensions.get(),windowState)){windowDimensions.set(windowState);}if(!cheapWorkletShallowEqual(safeArea.get(),safeAreaState)){safeArea.set(safeAreaState);}runOnJS(executeLayoutManagerEffect)();}'};
object = {code: 'function VoicePanelControllerTsx12(){const{connected,mode,sharedTransitionState}=this.__closure;return[connected.get(),mode.get(),sharedTransitionState.get()];}'};
object = {code: 'function VoicePanelControllerTsx13(props,previous){const{cheapWorkletArrayShallowEqual,TransitionStates,VoicePanelModes,runOnJS,setMode}=this.__closure;if(cheapWorkletArrayShallowEqual(props,previous!==null&&previous!==void 0?previous:undefined))return;const[isConnected,currentMode,currentTransitionState]=props;if(currentTransitionState===TransitionStates.YEETED){if(currentMode!==VoicePanelModes.DISMISSED){runOnJS(setMode)(VoicePanelModes.DISMISSED);}}else if(currentMode===VoicePanelModes.DISMISSED){var _previous$;let previousMode=(_previous$=previous===null||previous===void 0?void 0:previous[1])!==null&&_previous$!==void 0?_previous$:VoicePanelModes.PANEL;switch(previousMode){case VoicePanelModes.PANEL:case VoicePanelModes.PIP:if(!isConnected){previousMode=VoicePanelModes.PANEL;}break;default:previousMode=VoicePanelModes.PANEL;}runOnJS(setMode)(previousMode);}else if(!isConnected&&(previous===null||previous===void 0?void 0:previous[0])===true&&currentMode===VoicePanelModes.PIP){runOnJS(setMode)(VoicePanelModes.PANEL);}}'};
object = {code: 'function VoicePanelControllerTsx14(){const{mode,controlsSpecs}=this.__closure;return[mode.get(),controlsSpecs.get().mode];}'};
object = {code: 'function VoicePanelControllerTsx15(props,previous){const{cheapWorkletArrayShallowEqual,VoicePanelControlsModes,VoicePanelModes,runOnJS,dismissKeyboard}=this.__closure;if(cheapWorkletArrayShallowEqual(props,previous!==null&&previous!==void 0?previous:undefined))return;const[currentMode,currentControlsMode]=props;if(currentControlsMode!==VoicePanelControlsModes.DRAWER||currentMode!==VoicePanelModes.PANEL||(previous===null||previous===void 0?void 0:previous[0])!==VoicePanelModes.PANEL){runOnJS(dismissKeyboard)();}}'};
(FileImportTrackerModule).fileFinishedImporting('modules/voice_panel/native/VoicePanelController.tsx');
exports.default = VoicePanelController;
function _createForOfIteratorHelperLoose_117730(a0, a1) { // fn#117730, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:637, offset: 0x024bf537, size: 372 bytes, params: 3, frame: 20
var r6;
var r9;
var r5;
var value3;
var regexp;
const env0_0 = a0;
const Symbol = global.Symbol;
let value = typeof Symbol !== 'undefined';
let r1 = value && a0[global.Symbol.iterator];
r1 = !r1 ? a0['@@iterator'] : r1;
if (r1) {
value = r1.call(a0);
return value.next.bind(value);
}
const Array = global.Array;
if (Array.isArray(a0)) {
if (r1) {
}
return _fun117731;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_117732(a0, value);
r5 = value;
} else {
value3 = ({}).toString.call(a0).slice(8, -1);
r6 = value3 === 'Object' && a0.constructor;
r9 = r6 ? a0.constructor.name : value3;
if (r9 === 'Map') {
r6 = global.Array.from(a0);
} else if (r9 === 'Set') {
r6 = global.Array.from(a0);
} else if (r9 === 'Arguments') {
value = _arrayLikeToArray_117732(a0, value);
r6 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_117732(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun117731;
}
const TypeError = global.TypeError;
throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
function _fun117731() { // fn#117731, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:1208, offset: 0x00c39d73, size: 69 bytes, params: 1, frame: 5
return env0_1 >= env0_0.length ? {done: true} : {done: false,
value: env0_0[typeof env0_1 === 'bigint' ? env0_1 : +env0_1]};
}
}
function useLayoutManagerState({windowDimensions, safeArea, contentDimensions, isConnected, layoutManager, items, pushToTalk}) { // fn#117733, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:4637, offset: 0x024bf6ab, size: 670 bytes, params: 2, frame: 30
const isConnected2 = isConnected;
const layoutManager2 = layoutManager;
let binding = layoutManager2;
let useState = binding.useState;
const isConnected22 = isConnected2(Reflect.apply(useState, binding, [_fun117734]), 2);
const property = isConnected22[0];
const property2 = isConnected22[1];
binding = layoutManager2;
useState = binding.useState;
const getSafeAreaInsets = UseSafeAreaInsetsNativeModule.getSafeAreaInsets;
const isConnected23 = isConnected2(Reflect.apply(useState, binding, [Reflect.apply(getSafeAreaInsets,
UseSafeAreaInsetsNativeModule, [])]), 2);
const property3 = isConnected23[0];
const property4 = isConnected23[1];
const value6 = (VoicePanelCardLayoutManagerModule).useManagerSubscription(layoutManager);
binding = layoutManager2;
const useRef = binding.useRef;
let object = {timeout: -1, layoutKey: value6, connected: isConnected, windowState: property,
safeAreaState: property3, contentDimensions: {'width': 0, 'height': 0}};
object = {isConnected: isConnected, currentUpdatesRef: Reflect.apply(useRef, binding, [object]),
setWindowState: property2, setSafeAreaState: property4};
useUpdateLayoutManagerState(object);
layoutManager2.useLayoutEffect(_fun117744, [layoutManager2.useCallback(_fun117739, [])]);
layoutManager2.useLayoutEffect(_fun117748, [isConnected, layoutManager2.useId()]);
layoutManager.updateState(items, {windowWidth: property.width, windowHeight: property.height,
safeAreaLeft: property3.left, safeAreaRight: property3.right, safeAreaTop: property3.top,
safeAreaBottom: property3.bottom, controlBarSize: pushToTalk ? CONTROLS_HEIGHT_PTT : CONTROLS_HEIGHT});
layoutManager2.useLayoutEffect(_fun117750, [contentDimensions, layoutManager.getContentDimensions(), value6,
layoutManager, safeArea, property3, windowDimensions, property, isConnected]);
layoutManager2.useEffect(function() {
var closure = _fun117754;
var env0_4 = closure;
if (require(dependencyMap[46]).isStable) {
return undefined;
}
var env0_0 = (0, global.setInterval)(closure, 1000);
var env0_1 = null;
var env0_2 = AppState.addEventListener('change', _fun117756);
var env0_3 = false;
return _fun117757;
}, [layoutManager]);
layoutManager2.useLayoutEffect(function() {
return _fun117759;
}, []);
function _fun117734() { // fn#117734, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:4790, offset: 0x024bf949, size: 66 bytes, params: 1, frame: 12
let value = environment.__proto__;
value = require(1478) /* metro dependency 1478: useWindowDimensionsNative */;
value = value.getWindowDimensions();
const width = value.width;
const height = value.height;
return {width: width, height: height, landscape: width > height};
}
function useUpdateLayoutManagerState({isConnected, currentUpdatesRef, setWindowState, setSafeAreaState}) { // fn#117735, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:5141, owner: useLayoutManagerState.useUpdateLayoutManagerState, offset: 0x024bf98b, size: 95 bytes, params: 2, frame: 17
env1_4.useLayoutEffect(function() {
if (currentUpdatesRef.current.connected !== isConnected) {
currentUpdatesRef.current.connected = isConnected;
setWindowState(_fun117737);
setSafeAreaState(_fun117738);
}
}, [currentUpdatesRef, isConnected, setWindowState, setSafeAreaState]);
function _fun117736() { // fn#117736, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:5270, offset: 0x024bf9ea, size: 85 bytes, params: 1, frame: 13
if (currentUpdatesRef.current.connected !== isConnected) {
currentUpdatesRef.current.connected = isConnected;
setWindowState(_fun117737);
setSafeAreaState(function(a0) {
var value = a0;
var currentUpdatesRefBinding = currentUpdatesRef;
currentUpdatesRefBinding.current.safeAreaState = require(dependencyMap[36]).getSafeAreaInsets();
return require(dependencyMap[23]).cheapWorkletShallowEqual(value,
currentUpdatesRefBinding.current.safeAreaState) ? value : currentUpdatesRef.current.safeAreaState;
});
}
function _fun117737(a0) { // fn#117737, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:5326, offset: 0x024bfa3f, size: 140 bytes, params: 2, frame: 20
const value = a0;
const {width, height} = (UseWindowDimensionsNativeModule).getWindowDimensions();
const currentUpdatesRefBinding = currentUpdatesRef;
currentUpdatesRefBinding.current.windowState = {width: width, height: height, landscape: width > height};
return CheapWorkletShallowEqualModule.cheapWorkletShallowEqual(value,
currentUpdatesRefBinding.current.windowState) ? value : currentUpdatesRef.current.windowState;
}
function _fun117738(a0) { // fn#117738, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:5541, offset: 0x024bfacb, size: 111 bytes, params: 2, frame: 18
const value = a0;
const currentUpdatesRefBinding = currentUpdatesRef;
currentUpdatesRefBinding.current.safeAreaState = (require(1585) /* metro dependency 1585: useSafeAreaInsetsNative */).getSafeAreaInsets();
return CheapWorkletShallowEqualModule.cheapWorkletShallowEqual(value,
currentUpdatesRefBinding.current.safeAreaState) ? value : currentUpdatesRef.current.safeAreaState;
}
}
}
function _fun117739() { // fn#117739, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:5799, offset: 0x024bfb3a, size: 70 bytes, params: 1, frame: 14
const clearTimeout = global.clearTimeout;
const binding = env0_10;
clearTimeout(binding.current.timeout);
binding.current.timeout = global.setTimeout(_fun117740, 60);
function _fun117740() { // fn#117740, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:5866, offset: 0x024bfb80, size: 78 bytes, params: 1, frame: 12
var environment;
const clearTimeout = global.clearTimeout;
let value = environment.__proto__;
clearTimeout(env1_10.current.timeout);
value = environment.__proto__.__proto__;
(ReactBatchUpdatesNativeModule).batchUpdates(_fun117741);
function _fun117741() { // fn#117741, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:5927, offset: 0x024bfbce, size: 41 bytes, params: 1, frame: 13
env2_6(_fun117742);
env2_8(_fun117743);
function _fun117742(a0) { // fn#117742, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:5935, offset: 0x024bfbf7, size: 78 bytes, params: 2, frame: 14
const value = a0;
return CheapWorkletShallowEqualModule.cheapWorkletShallowEqual(env3_10.current.windowState,
value) ? value : env3_10.current.windowState;
}
function _fun117743(a0) { // fn#117743, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:6027, offset: 0x024bfc45, size: 78 bytes, params: 2, frame: 14
const value = a0;
return CheapWorkletShallowEqualModule.cheapWorkletShallowEqual(env3_10.current.safeAreaState,
value) ? value : env3_10.current.safeAreaState;
}
}
}
}
function _fun117744() { // fn#117744, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:6154, offset: 0x024bfc93, size: 115 bytes, params: 1, frame: 15
var environment;
let closure = updateSafeAreas;
let value = environment.__proto__;
const env0_0 = (SubscribeToSafeAreaInsetsNative)(closure);
value = require(1585) /* metro dependency 1585: useSafeAreaInsetsNative */;
const getSafeAreaInsets = value.getSafeAreaInsets;
closure(Reflect.apply(getSafeAreaInsets, value, []));
closure = updateWindowDimensions;
const env0_1 = (SubscribeToWindowDimensionsNative)(closure);
closure();
return _fun117747;
function updateSafeAreas(a0) { // fn#117745, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:6179, offset: 0x024bfd06, size: 98 bytes, params: 2, frame: 15
var object;
let value = environment.__proto__.__proto__;
value = require(7739) /* metro dependency 7739: cheapWorkletShallowEqual */;
const cheapWorkletShallowEqual = value.cheapWorkletShallowEqual;
let current = env1_10.current;
if (!Reflect.apply(cheapWorkletShallowEqual, value, [current.safeAreaState, a0])) {
current = env1_10.current;
object = {};
copyDataProperties(object, a0, value);
current.safeAreaState = object;
env1_11();
}
}
function updateWindowDimensions() { // fn#117746, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:6386, offset: 0x024bfd68, size: 152 bytes, params: 1, frame: 15
var r1;
let value = a0;
if (value !== undefined) {
r1 = value;
} else {
value = environment.__proto__.__proto__;
value = require(1478) /* metro dependency 1478: useWindowDimensionsNative */;
value = value.getWindowDimensions();
r1 = value;
}
const width = r1.width;
const height = r1.height;
const object = {width: width, height: height, landscape: width > height};
value = environment.__proto__.__proto__;
value = require(7739) /* metro dependency 7739: cheapWorkletShallowEqual */;
if (!value.cheapWorkletShallowEqual(env1_10.current.windowState, object)) {
env1_10.current.windowState = object;
env1_11();
}
}
function _fun117747() { // fn#117747, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:6639, offset: 0x00e6ab0d, size: 23 bytes, params: 1, frame: 10
env0_0();
env0_1();
}
}
function _fun117748() { // fn#117748, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:6695, offset: 0x024bfe00, size: 70 bytes, params: 1, frame: 12
var environment;
var value2;
var state;
if (isConnected) {
value2 = environment.__proto__;
state = SafeAreaDisabledStore.getState();
state.requestSafeAreaDisableLock({key: env0_12, lockEnabled: true});
return _fun117749;
}
function _fun117749() { // fn#117749, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:6776, offset: 0x024bfe46, size: 52 bytes, params: 1, frame: 12
const value = environment.__proto__.__proto__;
SafeAreaDisabledStore.getState().requestSafeAreaDisableLock({key: env1_12, lockEnabled: false});
}
}
function _fun117750() { // fn#117750, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:7071, offset: 0x024bfe7a, size: 232 bytes, params: 1, frame: 20
env0_10.current.layoutKey = env0_9;
const closure = function() {
return layoutManager.handleLayoutEffect();
};
const runOnUI = ReanimatedRexportModule.runOnUI;
const e_1177522 = e_117752;
const object = {};
object.isConnected = isConnected;
object.cheapWorkletShallowEqual = (require(7739) /* metro dependency 7739: cheapWorkletShallowEqual */).cheapWorkletShallowEqual;
object.contentDimensions = contentDimensions;
object.windowDimensions = windowDimensions;
object.safeArea = safeArea;
object.runOnJS = ReanimatedRexportModule.runOnJS;
object.executeLayoutManagerEffect = closure;
e_1177522.__closure = object;
e_1177522.__workletHash = 13791383688018;
e_1177522.__initData = env1_41;
Reflect.apply(runOnUI, ReanimatedRexportModule, [e_1177522])({windowState: ReactNativeModule.AppState, safeAreaState: env0_7,
contentState: env0_13});
function e_117752({windowState, safeAreaState, contentState}) { // fn#117752, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:7179, offset: 0x024bff77, size: 270 bytes, params: 2, frame: 19
var r0;
var value2;
var moduleValue;
var cheapWorkletShallowEqual;
var contentDimensionsBinding;
let value = environment.__proto__;
const isConnectedBinding = isConnected;
if (isConnectedBinding) {
value2 = environment.__proto__.__proto__;
moduleValue = require(7739) /* metro dependency 7739: cheapWorkletShallowEqual */;
cheapWorkletShallowEqual = moduleValue.cheapWorkletShallowEqual;
contentDimensionsBinding = contentDimensions;
r0 = !Reflect.apply(cheapWorkletShallowEqual, moduleValue, [contentDimensionsBinding.get(), contentState]);
} else {
r0 = isConnectedBinding;
}
if (r0) {
contentDimensions.set(contentState);
}
const cheapWorkletShallowEqualModule = require(7739) /* metro dependency 7739: cheapWorkletShallowEqual */;
cheapWorkletShallowEqual = cheapWorkletShallowEqualModule.cheapWorkletShallowEqual;
const windowDimensionsBinding = windowDimensions;
let get = windowDimensionsBinding.get;
if (!Reflect.apply(cheapWorkletShallowEqual, cheapWorkletShallowEqualModule, [Reflect.apply(get,
windowDimensionsBinding, []), windowState])) {
windowDimensions.set(windowState);
}
const moduleValue3 = cheapWorkletShallowEqualModule;
cheapWorkletShallowEqual = moduleValue3.cheapWorkletShallowEqual;
const safeAreaBinding = safeArea;
get = safeAreaBinding.get;
if (!Reflect.apply(cheapWorkletShallowEqual, moduleValue3, [Reflect.apply(get, safeAreaBinding, []),
safeAreaState])) {
safeArea.set(safeAreaState);
}
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
value.runOnJS(executeLayoutManagerEffect)();
}
}
function _fun117753() { // fn#117753, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:7808, offset: 0x024c0085, size: 125 bytes, params: 1, frame: 15
const checkDimensions2 = checkDimensions;
if ((require(4827) /* metro dependency 4827: ReleaseChannelUtilsNative */).isStable) {
return undefined;
}
const env0_0 = global.setInterval(checkDimensions2, 1000);
const env0_2 = AppState.addEventListener('change', _fun117756);
return _fun117757;
function checkDimensions() { // fn#117754, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:8095, offset: 0x024c0102, size: 126 bytes, params: 1, frame: 16
var environment;
var value2;
var windowDimensions;
var width;
var height;
var value4;
if (!Module00057) {
value2 = environment.__proto__.__proto__;
windowDimensions = (require(1478) /* metro dependency 1478: useWindowDimensionsNative */).getWindowDimensions();
width = windowDimensions.width;
height = windowDimensions.height;
var env0_1;
value4 = environment.__proto__;
if (layoutManager.checkDimensionsMismatch(width, height) != null) {
env0_1 = global.setTimeout(_fun117755, 250);
}
}
function _fun117755() { // fn#117755, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:8245, offset: 0x024c0180, size: 232 bytes, params: 1, frame: 18
var value6;
var value8;
var defaultImport;
const windowDimensions = (UseWindowDimensionsNativeModule).getWindowDimensions();
const width2 = windowDimensions.width;
const height2 = windowDimensions.height;
if (width === width2 && height === height2) {
value6 = environment.__proto__.__proto__;
if (layoutManager.checkDimensionsMismatch(width2, height2) != null) {
value8 = environment.__proto__;
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
defaultImport.track(AnalyticEvents.VOICE_PANEL_LAYOUT_DESYNC, {layout_width: env0_2.staleWidth,
layout_height: env0_2.staleHeight, window_width: width, window_height: height,
was_dirty: env0_2.wasDirty});
}
}
}
}
function _fun117756(a0) { // fn#117756, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:7914, offset: 0x024c0268, size: 107 bytes, params: 2, frame: 15
if (a0 !== 'active') {
if (a0 !== 'active') {
global.clearInterval(env0_0);
global.clearTimeout(env0_1);
}
} else if (env0_0 == null) {
env0_0 = global.setInterval(checkDimensions, 1000);
} else if (a0 !== 'active') {
global.clearInterval(env0_0);
global.clearTimeout(env0_1);
}
}
function _fun117757() { // fn#117757, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:8045, offset: 0x024c02d3, size: 53 bytes, params: 1, frame: 13
global.clearInterval(env0_0);
global.clearTimeout(env0_1);
env0_2.remove();
}
}
function _fun117758() { // fn#117758, offset: 0x024c0308, size: 11 bytes, params: 1, frame: 1
return _fun117759;
function _fun117759() { // fn#117759, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:8569, offset: 0x024c0313, size: 35 bytes, params: 1, frame: 11
return global.clearTimeout(env1_10.current.timeout);
}
}
}
function VoicePanelController({channelId, guildId, children, transitionState, transitionCleanUp}) { // fn#117760, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:10600, offset: 0x024c0336, size: 1578 bytes, params: 2, frame: 43
const value3 = (require(566) /* metro dependency 566: flux */).useStateFromStores([MediaEngineStore], function() {
return MediaEngineStore.getMode() === InputModes.PUSH_TO_TALK;
});
let property = env0_3(channelType.useState(_fun117762), 1)[0];
channelType.useEffect(function() {
return _fun117764;
}, [property]);
const {items,
isConnected} = (UseVoicePanelParticipants)(channelId,
guildId);
var env0_3 = useMountedCards(items, isConnected);
const value7 = useCoreSharedState(channelId, isConnected, items, value3);
var channelType = value7.channelType;
const connected = value7.connected;
const contentDimensions = value7.contentDimensions;
const env0_7 = value7.dragScrolling;
const focused = value7.focused;
const env0_9 = value7.isCall;
const layoutManager = value7.layoutManager;
const mode = value7.mode;
const env0_12 = value7.preJoinContentSize;
const safeArea = value7.safeArea;
const env0_14 = value7.scrollPosition;
const windowDimensions = value7.windowDimensions;
const env0_16 = value7.wrapperDimensions;
const env0_17 = value7.isFocusedVideoZoomed;
const env0_18 = value7.setIsFocusedVideoZoomed;
const env0_19 = value7.useReducedMotion;
const env0_20 = value7.wrapperOffset;
const env0_21 = value7.morphablePanelMode;
const env0_22 = value7.panelCardStillInPIP;
const value8 = useControlsState(mode, isConnected, connected, value3);
const env0_23 = value8.generateStateLocker;
const controlsSpecs = value8.controlsSpecs;
const showControls = value8.showControls;
const env0_26 = value8.hideControls;
const setControlsMode = value8.setControlsMode;
const value9 = useSelectedMode({channelId: channelId, isConnected: isConnected, mode: mode, connected: connected,
transitionState: transitionState, controlsSpecs: controlsSpecs, setControlsMode: setControlsMode});
const selectedMode = value9.selectedMode;
const setMode = value9.setMode;
const env0_30 = value9.dismissPanel;
const value10 = useManuallyFocusedItem({guildId: guildId, channelId: channelId, layoutManager: layoutManager,
focused: focused});
const manualFocusedItem = value10.manualFocusedItem;
const env0_31 = value10.setFocused;
const value11 = (require(566) /* metro dependency 566: flux */).useStateFromStores([EmbeddedActivitiesStore],
_fun117812);
useLayoutManagerState({isConnected: isConnected, windowDimensions: windowDimensions,
contentDimensions: contentDimensions, safeArea: safeArea, layoutManager: layoutManager, items: items,
pushToTalk: value3});
channelType.useLayoutEffect(_fun117813, [selectedMode, value11]);
useKeyboardDismissHandler({mode: mode, controlsSpecs: controlsSpecs});
useTransitionState({channelId: channelId, transitionState: transitionState, transitionCleanUp: transitionCleanUp,
connected: connected, mode: mode, setMode: setMode});
const value13 = (require(15436) /* metro dependency 15436: useControllerPIPState */).useControllerPIPState({channelId: channelId,
connected: isConnected, focusedId: manualFocusedItem ?? undefined, layoutManager: layoutManager,
mode: selectedMode});
const env0_33 = (UsePIPAvoidanceSpecs)({mode: mode,
controlsSpecs: controlsSpecs, safeArea: safeArea, windowDimensions: windowDimensions});
useSelectedParticipantEffects({channelId: channelId, selectedMode: selectedMode,
manualFocusedItem: manualFocusedItem});
useHandleThermalState({channelId: channelId, focused: focused, pipState: value13,
manuallyFocusedId: manualFocusedItem});
useActivityFocused({channelId: channelId, focused: focused, mode: mode, connected: connected});
useActivityConnected({setControlsMode: setControlsMode});
useSpeakingWhileMutedNotification({showControls: showControls});
(UsePanelOpenState)(channelId, mode, setMode, connected);
(UseHandleOAuthNavigation)();
VoicePanelControllerUseActivityOrientationState({isConnected: isConnected, selectedMode: selectedMode,
manualFocusedItem: manualFocusedItem, isNonVoiceEmbeddedActivityInPanelMode: value11});
useVoicePanelAnalytics({channelId: channelId, isConnected: isConnected, selectedMode: selectedMode});
const value14 = useShowFloatingCTA(mode);
const env0_34 = value14.showFloatingCTA;
const env0_35 = value14.setShowFloatingCTA;
const env0_36 = channelType.useRef(undefined);
const value15 = channelType.useRef(0);
channelType.useEffect(_fun117855);
let current = value15.current;
if (current != null) {
current = value15.current;
value15.current = typeof current === 'bigint' ? current + 1n : +current + 1;
current = value15.current;
if (current > 10) {
(importDefault(1216) /* metro dependency 1216: SentryUtilsNative */).addBreadcrumb({category: 'voice-panel',
message: 'VoicePanelController is rendering too many times (>' + value15.current + ')'});
value15.current = null;
}
}
property = env0_3(channelType.useState(_fun117856), 1)[0];
const Provider = (VoicePanelStateContext).Provider;
const VoicePanelPIPStateContext = (VoicePanelPIPStateContextModule).VoicePanelPIPStateContext;
const Provider2 = VoicePanelPIPStateContext.Provider;
const Provider3 = (GuildThemeGuildIdOverrideContext).Provider;
return (
<Provider value={property}>
<Provider2 value={value13}>
<Provider3 value={guildId ?? null}>
{children}
</Provider3>
</Provider2>
</Provider>
);
function _fun117762() { // fn#117762, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:10793, offset: 0x024c0981, size: 61 bytes, params: 1, frame: 12
let value = environment.__proto__;
const defaultImport = VoicePanelStreamOutputSinkStack;
value = MediaEngineStore.getMediaEngine();
const value2 = Object.create(defaultImport.prototype, {constructor: {value: defaultImport}});
value = new defaultImport(value);
return value instanceof Object ? value : value2;
}
function _fun117763() { // fn#117763, offset: 0x024c09be, size: 11 bytes, params: 1, frame: 1
return _fun117764;
function _fun117764() { // fn#117764, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:10862, offset: 0x024c09c9, size: 19 bytes, params: 1, frame: 9
return env1_2.cleanUp();
}
}
function useMountedCards(a0, a1) { // fn#117765, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:10934, owner: VoicePanelController.useMountedCards, offset: 0x024c09dc, size: 105 bytes, params: 3, frame: 17
var environment;
const env0_0 = a0;
const env0_1 = a1;
let value = environment.__proto__;
const property = env1_3(env1_4.useState(function() {
var Set = global.Set;
var value = Object.create(Set.prototype, {constructor: {value: Set}});
var value2 = new Set();
return value2 instanceof Object ? value2 : value;
}), 1)[0];
env1_4.useEffect(_fun117767, [a1, a0, property]);
return property;
function _fun117767() { // fn#117767, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:11028, offset: 0x024c0a45, size: 90 bytes, params: 1, frame: 14
var environment;
var value;
if (require) {
value = environment.__proto__.__proto__;
value = require(5459) /* metro dependency 5459: RunAfterInteractionsUtils */;
var env0_0 = value.runAfterInteractions(_fun117768, 100);
return _fun117769;
}
env0_2.clear();
function _fun117768() { // fn#117768, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:11077, offset: 0x024c0a9f, size: 88 bytes, params: 1, frame: 15
var r2;
var value5;
var add;
var id;
var value6;
let binding = env1_2;
binding.clear();
const value3 = _createForOfIteratorHelperLoose_117730(env1_0);
const value4 = value3();
let done = value4.done;
if (!done) {
for (r2 = value4; true; r2 = value6) {
value5 = r2.value;
binding = env1_2;
add = binding.add;
id = value5.id;
Reflect.apply(add, binding, [id]);
value6 = value3();
done = value6.done;
if (done) {
break;
}
}
}
}
function _fun117769() { // fn#117769, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:11195, offset: 0x024c0af7, size: 31 bytes, params: 1, frame: 10
if (env0_0 != null) {
env0_0.cancel();
}
}
}
}
function useCoreSharedState(a0, a1, a2, a3) { // fn#117770, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:11254, owner: VoicePanelController.useCoreSharedState, offset: 0x024c0b16, size: 1044 bytes, params: 5, frame: 38
var environment;
let env0_0 = a0;
const env0_1 = a2;
const env0_2 = a3;
let value = environment.__proto__;
const channel = ChannelStore.getChannel(a0);
const value3 = undefined;
const r2 = channel == null ? value3 : channel.isDM();
const r14 = r2 != null && r2;
const type = channel == null ? value3 : channel.type;
let useSharedValue = ReanimatedRexportModule.useSharedValue;
const value5 = Reflect.apply(useSharedValue, ReanimatedRexportModule, [a1]);
useSharedValue = ReanimatedRexportModule.useSharedValue;
let PANEL = VoicePanelModes.PANEL;
const value6 = Reflect.apply(useSharedValue, ReanimatedRexportModule, [PANEL]);
const windowDimensions = (UseWindowDimensionsNativeModule).getWindowDimensions();
const value8 = ReanimatedRexportModule.useSharedValue({width: windowDimensions.width,
height: windowDimensions.height, landscape: windowDimensions.width > windowDimensions.height});
const safeAreaInsets = (UseSafeAreaInsetsNativeModule).getSafeAreaInsets();
useSharedValue = ReanimatedRexportModule.useSharedValue;
object = {};
copyDataProperties(object, safeAreaInsets, undefined);
const value10 = Reflect.apply(useSharedValue, ReanimatedRexportModule, [object]);
const maxPanelWidth = (require(15432) /* metro dependency 15432: PanelSizeUtils */).getMaxPanelWidth({windowWidth: windowDimensions.width,
connected: a1, safeAreaLeft: safeAreaInsets.left, safeAreaRight: safeAreaInsets.right});
useSharedValue = ReanimatedRexportModule.useSharedValue;
object = {};
object.drawerHeight = windowDimensions.height;
object.drawerWidth = maxPanelWidth;
object.drawerX = (require(15432) /* metro dependency 15432: PanelSizeUtils */).getPanelX(windowDimensions.width,
maxPanelWidth);
object.drawerY = windowDimensions.height;
object.pipX = -1;
object.pipY = -1;
object.animated = true;
PANEL = VoicePanelModes.PANEL;
object.mode = PANEL;
const value12 = Reflect.apply(useSharedValue, ReanimatedRexportModule, [object]);
const value13 = ReanimatedRexportModule.useSharedValue(0);
const value14 = ReanimatedRexportModule.useSharedValue(false);
const value15 = ReanimatedRexportModule.useSharedValue(null);
const value16 = ReanimatedRexportModule.useSharedValue(0);
const value17 = ReanimatedRexportModule.useSharedValue(false);
const value18 = ReanimatedRexportModule.useSharedValue(false);
const binding = env1_4;
const useCallback = binding.useCallback;
let closure = useCoreSharedStateC;
closure.__closure = {isFocusedVideoZoomed: value18};
closure.__workletHash = 13885070318174;
closure.__initData = env1_35;
const value19 = Reflect.apply(useCallback, binding, [closure, [value18]]);
useSharedValue = ReanimatedRexportModule.useSharedValue;
const useReducedMotion = AccessibilityStore.useReducedMotion;
const value20 = Reflect.apply(useSharedValue, ReanimatedRexportModule, [useReducedMotion]);
env1_4.useEffect(function() {
var closure = _fun117773;
var env0_0 = closure;
AccessibilityStore.addReactChangeListener(closure);
return _fun117774;
}, [value20]);
const value21 = ReanimatedRexportModule.useSharedValue({'gestureActive': false, 'x': 0, 'y': 0});
const useDerivedValue = ReanimatedRexportModule.useDerivedValue;
closure = useCoreSharedStateW;
closure.__closure = {mode: value6, VoicePanelModes: VoicePanelModes, MorphablePanelModes: MorphablePanelModes};
closure.__workletHash = 931249605381;
closure.__initData = env1_36;
const value22 = Reflect.apply(useDerivedValue, ReanimatedRexportModule, [closure]);
const property = env1_3(env1_4.useState(_fun117776), 1)[0];
env1_4.useLayoutEffect(function() {
return _fun117778;
}, [property]);
object = {channelType: type, connected: value5};
value = ReanimatedRexportModule;
useSharedValue = value.useSharedValue;
const getContentDimensions = property.getContentDimensions;
object.contentDimensions = Reflect.apply(useSharedValue, value, [Reflect.apply(getContentDimensions, property, [])]);
object.dragScrolling = value14;
object.focused = value15;
object.isCall = r14;
object.layoutManager = property;
object.mode = value6;
object.preJoinContentSize = value16;
object.safeArea = value10;
object.scrollPosition = value13;
object.windowDimensions = value8;
object.wrapperDimensions = value12;
object.isFocusedVideoZoomed = value18;
object.setIsFocusedVideoZoomed = value19;
object.useReducedMotion = value20;
object.wrapperOffset = value21;
object.morphablePanelMode = value22;
object.panelCardStillInPIP = value17;
return object;
function useCoreSharedStateC(a0) { // fn#117771, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:12109, owner: VoicePanelController.useCoreSharedState.c, offset: 0x010c5543, size: 24 bytes, params: 2, frame: 11
env0_6.set(a0);
}
function _fun117772() { // fn#117772, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:12280, offset: 0x024c0f2a, size: 40 bytes, params: 1, frame: 12
AccessibilityStore.addReactChangeListener(onChange_117773);
return function() {
AccessibilityStore.removeReactChangeListener(onChange_117773);
};
function onChange_117773() { // fn#117773, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:12285, offset: 0x024c0f52, size: 34 bytes, params: 1, frame: 11
const useReducedMotion = AccessibilityStore.useReducedMotion;
env1_7.set(useReducedMotion);
}
function _fun117774() { // fn#117774, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:12381, offset: 0x024c0f74, size: 29 bytes, params: 1, frame: 11
const accessibilityStoreBinding = AccessibilityStore;
accessibilityStoreBinding.removeReactChangeListener(onChange_117773);
}
}
function useCoreSharedStateW() { // fn#117775, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:12525, owner: VoicePanelController.useCoreSharedState.W, offset: 0x024c0f91, size: 83 bytes, params: 1, frame: 10
const value = env0_3.get();
const PANEL = VoicePanelModes.PANEL;
if (PANEL === value) {
return MorphablePanelModes.PANEL;
}
const PIP = VoicePanelModes.PIP;
if (PIP === value) {
return MorphablePanelModes.PIP;
}
return MorphablePanelModes.UNDEFINED;
}
function _fun117776() { // fn#117776, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:12755, offset: 0x024c0fe4, size: 178 bytes, params: 1, frame: 16
const value4 = new (VoicePanelCardLayoutManager)(env0_0);
value4.updateState(importDefault, {windowWidth: ReactModule.width, windowHeight: ReactModule.height,
safeAreaLeft: ReactNativeModule.AppState.left, safeAreaRight: ReactNativeModule.AppState.right, safeAreaTop: ReactNativeModule.AppState.top, safeAreaBottom: ReactNativeModule.AppState.bottom,
controlBarSize: importAll ? CONTROLS_HEIGHT_PTT : CONTROLS_HEIGHT});
return value4;
}
function _fun117777() { // fn#117777, offset: 0x024c1096, size: 11 bytes, params: 1, frame: 1
return _fun117778;
function _fun117778() { // fn#117778, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:13003, offset: 0x024c10a1, size: 19 bytes, params: 1, frame: 9
return env1_8.cleanUp();
}
}
}
function useControlsState(a0, a1, a2, a3) { // fn#117779, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:13804, owner: VoicePanelController.useControlsState, offset: 0x024c10b4, size: 862 bytes, params: 5, frame: 32
let env0_0 = a0;
const env0_1 = a1;
const env0_2 = a2;
const env0_3 = a3;
const useSharedValue = ReanimatedRexportModule.useSharedValue;
const FLOATING_DEFAULT = VoicePanelControlsModes.FLOATING_DEFAULT;
const value2 = Reflect.apply(useSharedValue, ReanimatedRexportModule, [{mode: FLOATING_DEFAULT, locked: false,
height: a3 && a1 ? CONTROLS_HEIGHT_PTT : CONTROLS_HEIGHT, pushToTalk: a3}]);
let binding = env1_4;
let useRef = binding.useRef;
const env0_5 = Reflect.apply(useRef, binding, [-1]);
binding = env1_4;
let closure = _fun117780;
const value3 = binding.useCallback(closure, []);
const value4 = env1_4.useCallback(_fun117781, [value2, value3, a0]);
const {cancelControlsDebounce, setControlsMode} = env1_4.useMemo(_fun117783, [value2, value4]);
binding = env1_4;
useRef = binding.useRef;
const Set = global.Set;
const value6 = Object.create(Set.prototype, {constructor: {value: Set}});
const set = new Set();
const env0_10 = Reflect.apply(useRef, binding, [set instanceof Object ? set : value6]);
const value8 = env1_4.useCallback(_fun117787, [value2, value4, value3]);
const value9 = env1_4.useCallback(_fun117790, [setControlsMode]);
const value10 = env1_4.useCallback(_fun117791, [setControlsMode, value2]);
let useAnimatedReaction = ReanimatedRexportModule.useAnimatedReaction;
closure = useControlsStateS;
closure.__closure = {mode: a0};
closure.__workletHash = 12140218650562;
closure.__initData = env1_37;
const useControlsStateR2 = useControlsStateR;
object = {};
object.VoicePanelModes = VoicePanelModes;
object.runOnJS = ReanimatedRexportModule.runOnJS;
object._queueHideControls = value4;
object._clearHideControlsQueue = value3;
useControlsStateR2.__closure = object;
useControlsStateR2.__workletHash = 7742206515980;
useControlsStateR2.__initData = env1_38;
Reflect.apply(useAnimatedReaction, ReanimatedRexportModule, [closure, useControlsStateR2]);
env1_4.useLayoutEffect(_fun117794, [a3, value2, a1]);
useAnimatedReaction = ReanimatedRexportModule.useAnimatedReaction;
closure = function() {
return importDefault.get();
};
closure.__closure = {connected: a2};
closure.__workletHash = 16653595323628;
closure.__initData = env1_39;
const useControlsStateL2 = useControlsStateL;
object = {};
object.updateSharedValueIfChanged = importDefault(11282) /* metro dependency 11282: updateSharedValueIfChangedNative */;
object.controlsSpecs = value2;
object.pushToTalk = a3;
object.CONTROLS_HEIGHT_PTT = CONTROLS_HEIGHT_PTT;
object.CONTROLS_HEIGHT = CONTROLS_HEIGHT;
useControlsStateL2.__closure = object;
useControlsStateL2.__workletHash = 2154816141018;
useControlsStateL2.__initData = env1_40;
Reflect.apply(useAnimatedReaction, ReanimatedRexportModule, [closure, useControlsStateL2]);
env1_4.useLayoutEffect(function() {
return _fun117798;
}, [cancelControlsDebounce, value3]);
env1_4.useEffect(function() {
var closure = _fun117800;
var env0_0 = closure;
var ComponentDispatch = require(dependencyMap[42]).ComponentDispatch;
ComponentDispatch.subscribe(ComponentActions.VOICE_PANEL_TIV_CLOSE, closure);
return _fun117801;
}, [setControlsMode]);
return {generateStateLocker: value8, setControlsMode: setControlsMode, showControls: value10, hideControls: value9,
controlsSpecs: value2};
function _fun117780() { // fn#117780, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:13976, offset: 0x024c1412, size: 60 bytes, params: 1, frame: 13
if (env0_5.current !== -1) {
global.clearTimeout(env0_5.current);
env0_5.current = -1;
}
}
function _fun117781() { // fn#117781, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:14059, offset: 0x024c144e, size: 74 bytes, params: 1, frame: 14
var environment;
var binding;
var setTimeout;
env0_6();
if (env0_5.current === -1) {
binding = env0_5;
setTimeout = global.setTimeout;
value = environment.__proto__.__proto__;
binding.current = setTimeout(_fun117782, CONTROLS_HIDE_TIMEOUT);
}
function _fun117782() { // fn#117782, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:14107, offset: 0x024c1498, size: 148 bytes, params: 1, frame: 15
env1_6();
let binding = env1_0;
const value2 = binding.get();
const PANEL = VoicePanelModes.PANEL;
if (value2 === PANEL) {
binding = env1_4;
if (!(binding.get().mode !== VoicePanelControlsModes.FLOATING_DEFAULT || env1_4.get().locked)) {
(importDefault(11282) /* metro dependency 11282: updateSharedValueIfChangedNative */)(env1_4,
{mode: VoicePanelControlsModes.HIDDEN});
}
}
}
}
function _fun117783() { // fn#117783, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:14246, offset: 0x024c152c, size: 85 bytes, params: 1, frame: 14
var environment;
const _setControlsMode2 = _setControlsMode;
const value = environment.__proto__.__proto__;
const env0_1 = (Module00022).debounce(_setControlsMode2, 200);
return {cancelControlsDebounce: cancelControlsDebounce, setControlsMode: setControlsMode_117786};
function _setControlsMode(a0, a1) { // fn#117784, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:14272, offset: 0x024c1581, size: 65 bytes, params: 3, frame: 15
const value = environment.__proto__.__proto__.__proto__;
(UpdateSharedValueIfChangedNative)(env1_4, {mode: a0,
returnMode: a1});
env1_7();
}
function cancelControlsDebounce() { // fn#117785, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:14391, offset: 0x024c15c2, size: 19 bytes, params: 1, frame: 9
return env0_1.cancel();
}
function setControlsMode_117786({mode, debounce, returnMode = VoicePanelControlsModes.FLOATING_DEFAULT}) { // fn#117786, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:14422, offset: 0x024c15d5, size: 85 bytes, params: 2, frame: 15
debounce = !(debounce === undefined) && debounce;
const binding = env0_1;
if (debounce) {
binding(mode, returnMode);
} else {
binding.cancel();
_setControlsMode(mode, returnMode);
}
}
}
function _fun117787(a0) { // fn#117787, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:14620, offset: 0x024c162a, size: 78 bytes, params: 2, frame: 13
var environment;
let value = a0;
if (value == null) {
value = environment.__proto__.__proto__;
value = require(491) /* metro dependency 491 */;
value = value.v4();
}
return {lock: lock, unlock: unlock};
function lock(a0) { // fn#117788, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:14662, offset: 0x024c1678, size: 144 bytes, params: 2, frame: 15
var object;
var value3;
let current = env1_10.current;
if (!current.has(env0_0)) {
env1_6();
current = env1_10.current;
current.add(env0_0);
object = {};
current = env1_10.current;
object.locked = current.size > 0;
if (a0 != null) {
object.mode = a0;
}
value3 = environment.__proto__.__proto__.__proto__;
(importDefault(11282) /* metro dependency 11282: updateSharedValueIfChangedNative */)(env1_4, object);
}
}
function unlock(a0) { // fn#117789, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:14781, offset: 0x024c1708, size: 144 bytes, params: 2, frame: 15
var object;
var value3;
let current = env1_10.current;
if (current.has(env0_0)) {
current = env1_10.current;
current.delete(env0_0);
object = {};
current = env1_10.current;
object.locked = current.size > 0;
if (a0 != null) {
object.mode = a0;
}
value3 = environment.__proto__.__proto__.__proto__;
(importDefault(11282) /* metro dependency 11282: updateSharedValueIfChangedNative */)(env1_4, object);
env1_7();
}
}
}
function _fun117790() { // fn#117790, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:14933, offset: 0x024c1798, size: 65 bytes, params: 1, frame: 13
let value = a0;
const debounce = (value !== undefined ? value : {debounce: false}).debounce;
const setControlsModeBinding = setControlsMode;
value = environment.__proto__.__proto__;
const HIDDEN = VoicePanelControlsModes.HIDDEN;
setControlsModeBinding({mode: HIDDEN, debounce: debounce});
}
function _fun117791() { // fn#117791, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:15018, offset: 0x024c17d9, size: 86 bytes, params: 1, frame: 14
const value = a0;
let debounce = (value !== undefined ? value : {}).debounce;
debounce = !(debounce === undefined) && debounce;
const setControlsModeBinding = setControlsMode;
const get = ReactModule.get;
return setControlsModeBinding({mode: Reflect.apply(get, ReactModule,
[]).returnMode ?? VoicePanelControlsModes.FLOATING_DEFAULT, debounce: debounce});
}
function useControlsStateS() { // fn#117792, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:15175, owner: VoicePanelController.useControlsState.s, offset: 0x01c3cd06, size: 18 bytes, params: 1, frame: 9
return env0_0.get();
}
function useControlsStateR(a0) { // fn#117793, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:15259, owner: VoicePanelController.useControlsState.r, offset: 0x024c182f, size: 112 bytes, params: 2, frame: 13
let value = environment.__proto__.__proto__;
const PANEL = VoicePanelModes.PANEL;
if (a0 === PANEL) {
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
value.runOnJS(env0_7)();
} else {
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
value.runOnJS(env0_6)();
}
}
function _fun117794() { // fn#117794, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:15502, offset: 0x024c189f, size: 79 bytes, params: 1, frame: 17
(importDefault(11282) /* metro dependency 11282: updateSharedValueIfChangedNative */)(ReactModule,
{height: importAll && require ? CONTROLS_HEIGHT_PTT : CONTROLS_HEIGHT, pushToTalk: importAll});
}
function useControlsStateL(a0) { // fn#117796, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:15683, owner: VoicePanelController.useControlsState.l, offset: 0x024c18ee, size: 78 bytes, params: 2, frame: 17
(importDefault(11282) /* metro dependency 11282: updateSharedValueIfChangedNative */)(ReactModule,
{height: importAll && a0 ? CONTROLS_HEIGHT_PTT : CONTROLS_HEIGHT, pushToTalk: importAll});
}
function _fun117797() { // fn#117797, offset: 0x024c193c, size: 11 bytes, params: 1, frame: 1
return _fun117798;
function _fun117798() { // fn#117798, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:15930, offset: 0x024c1947, size: 23 bytes, params: 1, frame: 10
cancelControlsDebounce();
env1_6();
}
}
function _fun117799() { // fn#117799, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:15965, offset: 0x024c195e, size: 75 bytes, params: 1, frame: 15
const closure = function() {
setControlsMode({mode: VoicePanelControlsModes.FLOATING_DEFAULT});
};
let ComponentDispatch = (ComponentDispatchUtilsModule).ComponentDispatch;
const subscribe = ComponentDispatch.subscribe;
let VOICE_PANEL_TIV_CLOSE = ComponentActions.VOICE_PANEL_TIV_CLOSE;
Reflect.apply(subscribe, ComponentDispatch, [VOICE_PANEL_TIV_CLOSE, closure]);
return function() {
var ComponentDispatch = require(dependencyMap[42]).ComponentDispatch;
var VOICE_PANEL_TIV_CLOSE = ComponentActions.VOICE_PANEL_TIV_CLOSE;
ComponentDispatch.unsubscribe(VOICE_PANEL_TIV_CLOSE, closeTiV);
};
function closeTiV() { // fn#117800, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:15983, offset: 0x024c19a9, size: 35 bytes, params: 1, frame: 11
const setControlsModeBinding = setControlsMode;
const FLOATING_DEFAULT = VoicePanelControlsModes.FLOATING_DEFAULT;
setControlsModeBinding({mode: FLOATING_DEFAULT});
}
function _fun117801() { // fn#117801, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:16097, offset: 0x024c19cc, size: 62 bytes, params: 1, frame: 14
const ComponentDispatch = (ComponentDispatchUtilsModule).ComponentDispatch;
const unsubscribe = ComponentDispatch.unsubscribe;
const VOICE_PANEL_TIV_CLOSE = ComponentActions.VOICE_PANEL_TIV_CLOSE;
Reflect.apply(unsubscribe, ComponentDispatch, [VOICE_PANEL_TIV_CLOSE, closeTiV]);
}
}
}
function useSelectedMode({channelId, isConnected, mode, connected, transitionState, controlsSpecs, setControlsMode}) { // fn#117802, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:16394, owner: VoicePanelController.useSelectedMode, offset: 0x024c1a0a, size: 223 bytes, params: 2, frame: 21
var environment;
const value = environment.__proto__;
let binding = env1_4;
const useState = binding.useState;
const PANEL = VoicePanelModes.PANEL;
const value3 = env1_3(Reflect.apply(useState, binding, [PANEL]), 2);
const property = value3[0];
const property2 = value3[1];
env1_4.useLayoutEffect(_fun117803);
binding = env1_4;
const useCallback = binding.useCallback;
let object = [channelId, connected, mode, controlsSpecs, setControlsMode];
object = {selectedMode: property, setMode: property2, dismissPanel: Reflect.apply(useCallback, binding, [_fun117804,
object])};
return object;
function _fun117803() { // fn#117803, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:16587, offset: 0x024c1ae9, size: 86 bytes, params: 1, frame: 13
var connectedBinding;
mode.set(env0_7);
const transitionStateBinding = transitionState;
const TransitionStates = (TransitionGroupModule).TransitionStates;
const YEETED = TransitionStates.YEETED;
if (transitionStateBinding !== YEETED) {
connectedBinding = connected;
connectedBinding.set(isConnected);
}
}
function _fun117804() { // fn#117804, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:16673, offset: 0x024c1b3f, size: 176 bytes, params: 1, frame: 15
var r3;
var r0;
var connectedBinding;
var state;
var value5;
const controlsSpecsBinding = controlsSpecs;
const get = controlsSpecsBinding.get;
const mode2 = Reflect.apply(get, controlsSpecsBinding, []).mode;
const DRAWER = VoicePanelControlsModes.DRAWER;
if (mode2 === DRAWER) {
setControlsMode({mode: VoicePanelControlsModes.FLOATING_DEFAULT});
r0 = true;
} else {
connectedBinding = connected;
if (connectedBinding.get()) {
value5 = mode.get() === VoicePanelModes.PANEL;
if (value5) {
env0_8(VoicePanelModes.PIP);
r3 = true;
} else {
r3 = value5;
}
r0 = r3;
} else {
state = VoicePanelStore.getState();
state.closeChannel(channelId);
r0 = true;
}
}
return r0;
}
}
function useManuallyFocusedItem({guildId, channelId, layoutManager, focused}) { // fn#117805, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:17033, owner: VoicePanelController.useManuallyFocusedItem, offset: 0x024c1bef, size: 343 bytes, params: 2, frame: 22
const value = undefined;
const selectedParticipantId = (require(566) /* metro dependency 566: flux */).useStateFromStores([ChannelRTCStore],
function() {
return ChannelRTCStore.getSelectedParticipantId(channelId);
});
const value3 = env1_4.useCallback(_fun117807, [guildId, channelId]);
const env0_5 = env1_4.useRef(value);
env1_4.useLayoutEffect(_fun117808, [focused, selectedParticipantId,
layoutManager.getTargetDimensions(selectedParticipantId ?? value)]);
env1_4.useEffect(_fun117809, [selectedParticipantId,
(UseIsVoicePanelParticipantFocusable)(guildId, channelId,
selectedParticipantId), value3]);
env1_4.useEffect(function() {
return _fun117811;
}, [value3]);
return {setFocused: value3, manualFocusedItem: selectedParticipantId};
function _fun117807(a0) { // fn#117807, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:17209, offset: 0x024c1d61, size: 112 bytes, params: 2, frame: 16
var r0;
let value = a0 == null;
if (value) {
r0 = value;
} else {
value = environment.__proto__.__proto__;
value = require(15433) /* metro dependency 15433: useIsVoicePanelParticipantFocusable */;
value = value.isVoicePanelParticipantFocusable(guildId, channelId, a0);
r0 = value;
}
if (r0) {
value = environment.__proto__.__proto__;
value = importDefault(7712) /* metro dependency 7712: ChannelRTCActionCreators */;
value.selectParticipant(channelId, a0);
}
}
function _fun117808() { // fn#117808, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:17396, offset: 0x024c1dd1, size: 141 bytes, params: 1, frame: 18
var r3;
var object;
const selectedParticipantIdBinding = selectedParticipantId;
const value2 = null;
if (value2 != selectedParticipantIdBinding) {
object = {};
object.id = selectedParticipantId;
copyDataProperties(object, env0_6, undefined);
r3 = object;
} else {
r3 = value2;
}
const value4 = undefined;
const cheapWorkletShallowEqual = CheapWorkletShallowEqualModule.cheapWorkletShallowEqual;
const r4 = value2 != r3 ? r3 : value4;
const current = env0_5.current;
if (!Reflect.apply(cheapWorkletShallowEqual, CheapWorkletShallowEqualModule, [r4,
value2 != current ? current : value4])) {
env0_5.current = r3;
focused.set(r3);
}
return value4;
}
function _fun117809() { // fn#117809, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:17593, offset: 0x024c1e5e, size: 35 bytes, params: 1, frame: 11
if (selectedParticipantId != null) {
if (!env0_7) {
ReactModule(null);
}
}
}
function _fun117810() { // fn#117810, offset: 0x024c1e81, size: 11 bytes, params: 1, frame: 1
return _fun117811;
function _fun117811() { // fn#117811, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:17648, offset: 0x024c1e8c, size: 18 bytes, params: 1, frame: 11
return env1_4(null);
}
}
}
function _fun117812() { // fn#117812, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:17833, offset: 0x024c1e9e, size: 99 bytes, params: 1, frame: 14
const value = environment.__proto__;
const embeddedActivitiesStoreBinding = EmbeddedActivitiesStore;
const connectedActivityLocation = embeddedActivitiesStoreBinding.getConnectedActivityLocation();
return connectedActivityLocation != null && (require(3774) /* metro dependency 3774: embeddedActivityLocationUtils */).getEmbeddedActivityLocationChannelId(connectedActivityLocation) !== channelId && embeddedActivitiesStoreBinding.getActivityPanelMode() === ActivityPanelModes.PANEL;
}
function _fun117813() { // fn#117813, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:18144, offset: 0x024c1f01, size: 81 bytes, params: 1, frame: 12
var value;
const selectedModeBinding = selectedMode;
const PANEL = VoicePanelModes.PANEL;
if (selectedModeBinding === PANEL && env0_32) {
value = require(7860) /* metro dependency 7860: EmbeddedActivitiesActionCreators */;
value.updateActivityPanelMode(ActivityPanelModes.PIP);
}
}
function useKeyboardDismissHandler({mode, controlsSpecs}) { // fn#117814, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:18219, owner: VoicePanelController.useKeyboardDismissHandler, offset: 0x024c1f52, size: 236 bytes, params: 2, frame: 21
const useAnimatedReaction = ReanimatedRexportModule.useAnimatedReaction;
const closure = function() {
var items = [mode.get()];
items[1] = controlsSpecs.get().mode;
return items;
};
closure.__closure = {mode: mode, controlsSpecs: controlsSpecs};
closure.__workletHash = 10791754460802;
closure.__initData = env1_44;
const useKeyboardDismissHandlerN2 = useKeyboardDismissHandlerN;
object = {};
object.cheapWorkletArrayShallowEqual = (require(7739) /* metro dependency 7739: cheapWorkletShallowEqual */).cheapWorkletArrayShallowEqual;
object.VoicePanelControlsModes = VoicePanelControlsModes;
object.VoicePanelModes = VoicePanelModes;
object.runOnJS = ReanimatedRexportModule.runOnJS;
object.dismissKeyboard = (require(4015) /* metro dependency 4015: ChatInputUtils */).dismissKeyboard;
useKeyboardDismissHandlerN2.__closure = object;
useKeyboardDismissHandlerN2.__workletHash = 16494740341507;
useKeyboardDismissHandlerN2.__initData = env1_45;
Reflect.apply(useAnimatedReaction, ReanimatedRexportModule, [closure, useKeyboardDismissHandlerN2]);
function useKeyboardDismissHandlerN(a0, a1) { // fn#117816, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:18437, owner: VoicePanelController.useKeyboardDismissHandler.n, offset: 0x024c206e, size: 207 bytes, params: 3, frame: 18
var value4;
let value = a1;
const value3 = undefined;
const cheapWorkletArrayShallowEqual = CheapWorkletShallowEqualModule.cheapWorkletArrayShallowEqual;
let r2 = value ?? value3;
if (!Reflect.apply(cheapWorkletArrayShallowEqual, CheapWorkletShallowEqualModule, [a0, r2])) {
value4 = env2_3(a0, 2);
r2 = value4[1] === VoicePanelControlsModes.DRAWER && value4[0] === VoicePanelModes.PANEL;
if (r2) {
value = (value == null ? value3 : value[0]) === VoicePanelModes.PANEL;
r2 = value;
}
if (!r2) {
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
value.runOnJS((require(4015) /* metro dependency 4015: ChatInputUtils */).dismissKeyboard)();
}
}
return value3;
}
}
function useTransitionState({channelId, transitionState, transitionCleanUp, connected, mode, setMode}) { // fn#117817, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:18921, owner: VoicePanelController.useTransitionState, offset: 0x024c213d, size: 374 bytes, params: 2, frame: 25
const value2 = (ReanimatedRexportModule).useSharedValue(transitionState);
env1_4.useLayoutEffect(_fun117818, [transitionState, value2, transitionCleanUp, channelId]);
env1_4.useLayoutEffect(function() {
return _fun117821;
}, [channelId]);
const useAnimatedReaction = ReanimatedRexportModule.useAnimatedReaction;
const useTransitionStateH2 = useTransitionStateH;
useTransitionStateH2.__closure = {connected: connected, mode: mode, sharedTransitionState: value2};
useTransitionStateH2.__workletHash = 7656858903152;
useTransitionStateH2.__initData = env1_42;
const useTransitionStateU2 = useTransitionStateU;
object = {};
object.cheapWorkletArrayShallowEqual = (require(7739) /* metro dependency 7739: cheapWorkletShallowEqual */).cheapWorkletArrayShallowEqual;
const TransitionStates = (TransitionGroupModule).TransitionStates;
object.TransitionStates = TransitionStates;
object.VoicePanelModes = VoicePanelModes;
object.runOnJS = ReanimatedRexportModule.runOnJS;
object.setMode = setMode;
useTransitionStateU2.__closure = object;
useTransitionStateU2.__workletHash = 5740547237317;
useTransitionStateU2.__initData = env1_43;
Reflect.apply(useAnimatedReaction, ReanimatedRexportModule, [useTransitionStateH2, useTransitionStateU2]);
function _fun117818() { // fn#117818, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:19088, offset: 0x024c22b3, size: 167 bytes, params: 1, frame: 19
const binding = env0_6;
const set = binding.set;
const transitionStateBinding = transitionState;
Reflect.apply(set, binding, [transitionStateBinding]);
const TransitionStates = (TransitionGroupModule).TransitionStates;
const YEETED = TransitionStates.YEETED;
if (transitionStateBinding === YEETED) {
AppFreezeStore.getState().requestFreezeLock({lockEnabled: false, key: 'voice-panel-freeze-' + channelId});
var env0_0 = global.setTimeout(transitionCleanUp, 500);
return _fun117819;
}
function _fun117819() { // fn#117819, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:19253, offset: 0x016d7e7e, size: 24 bytes, params: 1, frame: 11
return global.clearTimeout(env0_0);
}
}
function _fun117820() { // fn#117820, offset: 0x024c235a, size: 11 bytes, params: 1, frame: 1
return _fun117821;
function _fun117821() { // fn#117821, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:19310, offset: 0x024c2365, size: 76 bytes, params: 1, frame: 14
const value = environment.__proto__.__proto__.__proto__;
AppFreezeStore.getState().requestFreezeLock({lockEnabled: false, key: 'voice-panel-freeze-' + channelId});
}
}
function useTransitionStateH() { // fn#117822, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:19435, owner: VoicePanelController.useTransitionState.h, offset: 0x024c23b1, size: 60 bytes, params: 1, frame: 11
const connectedBinding = connected;
let get = connectedBinding.get;
const items2 = [Reflect.apply(get, connectedBinding, [])];
const modeBinding = mode;
get = modeBinding.get;
items2[1] = Reflect.apply(get, modeBinding, []);
const binding = env0_6;
get = binding.get;
items2[2] = Reflect.apply(get, binding, []);
return items2;
}
function useTransitionStateU(a0, a1) { // fn#117823, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:19573, owner: VoicePanelController.useTransitionState.u, offset: 0x024c23ed, size: 449 bytes, params: 3, frame: 21
var r5;
var r4;
var value4;
var property;
var property2;
let value = a1;
const value3 = undefined;
if (!CheapWorkletShallowEqualModule.cheapWorkletArrayShallowEqual(a0, value ?? value3)) {
value4 = env2_3(a0, 3);
property = value4[0];
property2 = value4[1];
if (value4[2] === (require(4508) /* metro dependency 4508: TransitionGroup */).TransitionStates.YEETED) {
if (property2 !== VoicePanelModes.DISMISSED) {
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
value = value.runOnJS(setMode);
value(VoicePanelModes.DISMISSED);
}
} else if (property2 === VoicePanelModes.DISMISSED) {
r5 = value == null ? value3 : value[1];
r5 = r5 ?? VoicePanelModes.PANEL;
r4 = (VoicePanelModes.PANEL === r5 || VoicePanelModes.PIP === r5) && property ? r5 : VoicePanelModes.PANEL;
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
value.runOnJS(setMode)(r4);
} else {
if (property) {
r5 = property;
} else {
value = (value == null ? value3 : value[0]) !== true;
r5 = value;
}
r5 = !r5 ? property2 !== VoicePanelModes.PIP : r5;
if (!r5) {
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
value = value.runOnJS(setMode);
value(VoicePanelModes.PANEL);
}
}
}
return value3;
}
}
function useSelectedParticipantEffects({channelId, selectedMode, manualFocusedItem}) { // fn#117824, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:20533, owner: VoicePanelController.useSelectedParticipantEffects, offset: 0x024c25ae, size: 118 bytes, params: 2, frame: 17
const env0_2 = env1_4.useRef(null);
env1_4.useLayoutEffect(_fun117825, [selectedMode, manualFocusedItem, channelId]);
env1_4.useLayoutEffect(_fun117826);
function _fun117825() { // fn#117825, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:20662, offset: 0x024c2624, size: 177 bytes, params: 1, frame: 13
const value = environment.__proto__.__proto__;
const rTCConnection = RTCConnectionStore.getRTCConnection();
if (rTCConnection != null && RTCConnectionStore.getChannelId() === channelId) {
if (env0_2.current === VoicePanelModes.PIP) {
if (env0_2.current === VoicePanelModes.PIP && selectedMode !== VoicePanelModes.PIP) {
rTCConnection.setPipOpen(false);
}
} else if (selectedMode !== VoicePanelModes.PIP) {
if (env0_2.current === VoicePanelModes.PIP && selectedMode !== VoicePanelModes.PIP) {
rTCConnection.setPipOpen(false);
}
} else {
rTCConnection.setPipOpen(true);
}
}
}
function _fun117826() { // fn#117826, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:20850, offset: 0x0100b231, size: 21 bytes, params: 1, frame: 2
env0_2.current = selectedMode;
}
}
function useHandleThermalState({channelId, focused, pipState, manuallyFocusedId}) { // fn#117827, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:20923, owner: VoicePanelController.useHandleThermalState, offset: 0x024c26d5, size: 299 bytes, params: 2, frame: 22
const value2 = env1_4.useCallback(_fun117828, [channelId]);
env1_4.useEffect(_fun117829, [manuallyFocusedId, pipState, value2, channelId]);
const useAnimatedReaction = ReanimatedRexportModule.useAnimatedReaction;
const closure = function() {
return [focused.get()?.id, pipState.id];
};
closure.__closure = {focused: focused, pipState: pipState};
closure.__workletHash = 94735519164;
closure.__initData = env1_33;
const useHandleThermalStateL2 = useHandleThermalStateL;
object = {};
object.cheapWorkletArrayShallowEqual = (require(7739) /* metro dependency 7739: cheapWorkletShallowEqual */).cheapWorkletArrayShallowEqual;
object.runOnJS = ReanimatedRexportModule.runOnJS;
object.handleStateUpdates = value2;
useHandleThermalStateL2.__closure = object;
useHandleThermalStateL2.__workletHash = 15246095289306;
useHandleThermalStateL2.__initData = env1_34;
Reflect.apply(useAnimatedReaction, ReanimatedRexportModule, [closure, useHandleThermalStateL2]);
function _fun117828({focusedId, pipParticipantId}) { // fn#117828, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:21035, offset: 0x024c2800, size: 438 bytes, params: 2, frame: 20
var isVideoEnabled2;
var defaultImport;
var open;
var object;
var intl;
const value = environment.__proto__.__proto__;
const channelCallLifecycleStoreBinding = ChannelCallLifecycleStore;
const shouldReactToSeriousThermalStateWhenActivityFocused2 = channelCallLifecycleStoreBinding.shouldReactToSeriousThermalStateWhenActivityFocused();
const value2 = channelCallLifecycleStoreBinding.consumedRequestToRespondToSeriousThermalState();
const r5 = focusedId != null && isActivityParticipant(ChannelRTCStore.getParticipant(channelId, focusedId));
const r6 = pipParticipantId != null ? ChannelRTCStore.getParticipant(channelId, pipParticipantId) : undefined;
if (r5) {
if (shouldReactToSeriousThermalStateWhenActivityFocused2) {
if (!value2) {
isVideoEnabled2 = MediaEngineStore.isVideoEnabled();
if (isVideoEnabled2 || r6?.streamId != null && (r6 == null || r6.voiceState == null ? undefined : r6.voiceState.selfVideo) === true) {
defaultImport = importDefault(3857) /* metro dependency 3857: ToastActionCreators */;
open = defaultImport.open;
object = {'key': 'EMBEDDED_ACTIVITIES_VIDEO_DISABLED_FOR_THERMAL_STATE', 'icon': null,
'content': null,
'disableAnimations': true, 'toastDurationMs': 3000};
object.icon = importDefault(15408) /* metro dependency 15408 */;
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
object.content = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.O2IlPT);
Reflect.apply(open, defaultImport, [object]);
(require(15409) /* metro dependency 15409: trackActivityThermalStateNoticeShown */).trackActivityThermalStateNoticeShown();
}
if (isVideoEnabled2) {
(importDefault(8899) /* metro dependency 8899: AudioActionCreators */).setVideoEnabled(false);
}
(require(7860) /* metro dependency 7860: EmbeddedActivitiesActionCreators */).consumeRequestToReactToSeriousThermalState();
}
}
}
}
function _fun117829() { // fn#117829, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:21751, offset: 0x024c29b6, size: 138 bytes, params: 1, frame: 15
var environment;
const value = environment.__proto__.__proto__;
const BatchedStoreListener = (FluxModule).BatchedStoreListener;
const batchedStoreListener = new BatchedStoreListener([ChannelCallLifecycleStore, ChannelRTCStore], _fun117830);
batchedStoreListener.attach('thermal-state-reactions-' + channelId);
return _fun117831;
function _fun117830() { // fn#117830, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:21805, offset: 0x024c2a40, size: 56 bytes, params: 1, frame: 14
const binding = env1_4;
const manuallyFocusedIdBinding = manuallyFocusedId;
const value2 = undefined;
binding({focusedId: manuallyFocusedIdBinding != null ? manuallyFocusedId : value2, pipParticipantId: pipState.id});
return value2;
}
function _fun117831() { // fn#117831, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:21915, offset: 0x00d0ff6d, size: 19 bytes, params: 1, frame: 9
return env0_0.detach();
}
}
function useHandleThermalStateL(a0, a1) { // fn#117833, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:22116, owner: VoicePanelController.useHandleThermalState.l, offset: 0x024c2aaf, size: 142 bytes, params: 3, frame: 17
var property;
var property2;
let value = a1;
const value3 = undefined;
if (!CheapWorkletShallowEqualModule.cheapWorkletArrayShallowEqual(a0, value ?? value3)) {
value = env2_3(a0, 2);
property = value[0];
property2 = value[1];
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
value = value.runOnJS(ReactModule);
value({focusedId: property, pipParticipantId: property2});
}
return value3;
}
}
function useActivityFocused({channelId, focused, mode, connected}) { // fn#117834, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:22518, owner: VoicePanelController.useActivityFocused, offset: 0x024c2b3d, size: 260 bytes, params: 2, frame: 23
const value2 = env1_4.useCallback(_fun117835, [channelId]);
const useAnimatedReaction = ReanimatedRexportModule.useAnimatedReaction;
const closure = function() {
var items = [focused.get()?.id];
items[1] = mode.get();
items[2] = connected.get();
return items;
};
closure.__closure = {focused: focused, mode: mode, connected: connected};
closure.__workletHash = 16641161683997;
closure.__initData = env1_30;
const useActivityFocusedL2 = useActivityFocusedL;
object = {};
object.cheapWorkletArrayShallowEqual = (require(7739) /* metro dependency 7739: cheapWorkletShallowEqual */).cheapWorkletArrayShallowEqual;
object.runOnJS = ReanimatedRexportModule.runOnJS;
object.handleAnimatedReaction = value2;
useActivityFocusedL2.__closure = object;
useActivityFocusedL2.__workletHash = 15290799116693;
useActivityFocusedL2.__initData = env1_31;
Reflect.apply(useAnimatedReaction, ReanimatedRexportModule, [closure, useActivityFocusedL2]);
function _fun117835({focusedParticipantId, voicePanelMode, connectedValue}) { // fn#117835, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:22615, offset: 0x024c2c41, size: 125 bytes, params: 2, frame: 16
var r0;
var r2;
var value;
var isActivityParticipantBinding;
var channelRTCStoreBinding;
if (connectedValue) {
value = environment.__proto__.__proto__;
value = voicePanelMode === VoicePanelModes.PANEL;
r0 = value;
} else {
r0 = connectedValue;
}
value = focusedParticipantId != null;
if (value) {
value = environment.__proto__.__proto__;
isActivityParticipantBinding = isActivityParticipant;
channelRTCStoreBinding = ChannelRTCStore;
value = channelRTCStoreBinding.getParticipant(channelId, focusedParticipantId);
value = isActivityParticipantBinding(value);
r2 = value;
} else {
r2 = value;
}
r2 = r2 && r0;
value = environment.__proto__.__proto__;
VoicePanelStore.getState().setIsActivityFocused(r2);
}
function useActivityFocusedL(a0, a1) { // fn#117837, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:22976, owner: VoicePanelController.useActivityFocused.l, offset: 0x024c2d0a, size: 154 bytes, params: 3, frame: 17
var property;
var property2;
var property3;
let value = a1;
const value3 = undefined;
if (!CheapWorkletShallowEqualModule.cheapWorkletArrayShallowEqual(a0, value ?? value3)) {
value = env2_3(a0, 3);
property = value[0];
property2 = value[1];
property3 = value[2];
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
value = value.runOnJS(ReactModule);
value({focusedParticipantId: property, voicePanelMode: property2, connectedValue: property3});
}
return value3;
}
}
function useActivityConnected({setControlsMode}) { // fn#117838, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:23403, owner: VoicePanelController.useActivityConnected, offset: 0x024c2da4, size: 84 bytes, params: 2, frame: 15
var environment;
const value = environment.__proto__;
const binding = env1_4;
const useCallback = binding.useCallback;
(importDefault(15406) /* metro dependency 15406: useTransitionToConnectedActivityInVoice */)({onTransition: Reflect.apply(useCallback,
binding, [function() {
setControlsMode({mode: VoicePanelControlsModes.FLOATING_DEFAULT});
}, [setControlsMode]])});
}
function useSpeakingWhileMutedNotification({showControls}) { // fn#117840, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:23566, owner: VoicePanelController.useSpeakingWhileMutedNotification, offset: 0x024c2e1b, size: 183 bytes, params: 2, frame: 18
const defaultImport = MobileMuteIndicatorExperiment;
const useConfig = defaultImport.useConfig;
const enableMuteWarning = Reflect.apply(useConfig, defaultImport,
[{location: 'VoicePanelController'}]).enableMuteWarning;
const env0_2 = env1_4.useRef(0);
env1_4.useEffect(_fun117842, [(require(566) /* metro dependency 566: flux */).useStateFromStores([MediaEngineStore],
function() {
return MediaEngineStore.getSpeakingWhileMuted();
}), enableMuteWarning, showControls]);
function _fun117842() { // fn#117842, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:23800, offset: 0x024c2ee7, size: 230 bytes, params: 1, frame: 17
var value3;
var value4;
var open;
var object;
var intl;
var value;
if (speakingWhileMuted && enableMuteWarning) {
value3 = global.performance.now() - env0_2.current;
value4 = environment.__proto__.__proto__;
if (!(value3 < env2_32)) {
env0_2.current = global.performance.now();
showControls();
value = importDefault(3857) /* metro dependency 3857: ToastActionCreators */;
open = value.open;
object = {key: 'SPEAKING_WHILE_MUTED', icon: importDefault(10696) /* metro dependency 10696 */};
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
object.content = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['29gnR4']);
object.toastDurationMs = 3000;
Reflect.apply(open, value, [object]);
}
}
}
}
function VoicePanelControllerUseActivityOrientationState({isConnected, selectedMode, manualFocusedItem, isNonVoiceEmbeddedActivityInPanelMode}) { // fn#117843, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:24072, owner: VoicePanelController.useActivityOrientationState, offset: 0x024c2fcd, size: 214 bytes, params: 2, frame: 22
const {applicationId, activityOrientationLockState,
instanceId} = (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([EmbeddedActivitiesStore],
function() {
var r5;
var value2 = EmbeddedActivitiesStore.getCurrentEmbeddedActivity();
var value3 = undefined;
r5 = value2 == null ? value3 : value2.applicationId;
var object = {applicationId: r5};
object.instanceId = value2 == null ? value3 : value2.compositeInstanceId;
object.activityOrientationLockState = r5 == null ? OrientationLockState.UNLOCKED : EmbeddedActivitiesStore.getOrientationLockStateForApp(r5) ?? OrientationLockState.UNLOCKED;
return object;
});
env1_4.useLayoutEffect(_fun117845, [applicationId, isConnected, selectedMode, activityOrientationLockState,
manualFocusedItem, isNonVoiceEmbeddedActivityInPanelMode, instanceId]);
env1_4.useLayoutEffect(function() {
return _fun117847;
}, []);
function _fun117845() { // fn#117845, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:24580, offset: 0x024c3106, size: 225 bytes, params: 1, frame: 16
var selectedModeBinding;
var value2;
var manualFocusedItemBinding;
var moduleValue;
var getEmbeddedActivityParticipantId;
var object;
if (!isNonVoiceEmbeddedActivityInPanelMode) {
selectedModeBinding = selectedMode;
value2 = environment.__proto__.__proto__;
if (selectedModeBinding !== VoicePanelModes.PANEL) {
(require(7717) /* metro dependency 7717: DeviceOrientation */).restoreDefaultOrientation();
} else if (isConnected) {
if (applicationId == null) {
(require(7717) /* metro dependency 7717: DeviceOrientation */).unlockOrientation({unlockAfterRotatingToPreviousLock: false});
} else {
manualFocusedItemBinding = manualFocusedItem;
moduleValue = require(4610) /* metro dependency 4610: ChannelRTCParticipants */;
getEmbeddedActivityParticipantId = moduleValue.getEmbeddedActivityParticipantId;
object = {};
object.applicationId = applicationId;
object.instanceId = instanceId;
if (manualFocusedItemBinding !== Reflect.apply(getEmbeddedActivityParticipantId, moduleValue,
[object])) {
(require(7717) /* metro dependency 7717: DeviceOrientation */).unlockOrientation({unlockAfterRotatingToPreviousLock: false});
} else {
(importDefault(15362) /* metro dependency 15362: applyActivityOrientationLock */)(activityOrientationLockState);
}
}
} else {
(require(7717) /* metro dependency 7717: DeviceOrientation */).restoreDefaultOrientation();
}
}
}
function _fun117846() { // fn#117846, offset: 0x024c31e7, size: 11 bytes, params: 1, frame: 1
return _fun117847;
function _fun117847() { // fn#117847, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:24853, offset: 0x024c31f2, size: 37 bytes, params: 1, frame: 11
const value = environment.__proto__.__proto__.__proto__;
return (DeviceOrientationModule).restoreDefaultOrientation();
}
}
}
function useVoicePanelAnalytics({channelId, isConnected, selectedMode}) { // fn#117848, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:24997, owner: VoicePanelController.useVoicePanelAnalytics, offset: 0x024c3217, size: 79 bytes, params: 2, frame: 16
env1_4.useEffect(_fun117849, [selectedMode, channelId, isConnected]);
function _fun117849() { // fn#117849, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:25086, offset: 0x024c3266, size: 139 bytes, params: 1, frame: 19
var defaultImport;
var track;
var VIDEO_LAYOUT_TOGGLED;
var object;
var getAnalyticsNameForVoicePanelModeBinding;
var moduleValue;
const selectedModeBinding = selectedMode;
const DISMISSED = VoicePanelModes.DISMISSED;
if (selectedModeBinding !== DISMISSED && isConnected) {
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
track = defaultImport.track;
VIDEO_LAYOUT_TOGGLED = AnalyticEvents.VIDEO_LAYOUT_TOGGLED;
object = {};
getAnalyticsNameForVoicePanelModeBinding = getAnalyticsNameForVoicePanelMode;
object.video_layout = getAnalyticsNameForVoicePanelModeBinding(selectedMode);
moduleValue = require(4863) /* metro dependency 4863: AppAnalyticsUtils */;
copyDataProperties(object, moduleValue.collectVoiceAnalyticsMetadata(channelId),
getAnalyticsNameForVoicePanelModeBinding);
Reflect.apply(track, defaultImport, [VIDEO_LAYOUT_TOGGLED, object]);
}
}
}
function useShowFloatingCTA(a0) { // fn#117850, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:25281, owner: VoicePanelController.useShowFloatingCTA, offset: 0x024c32f1, size: 150 bytes, params: 2, frame: 16
const env0_0 = a0;
const env0_1 = env1_4.useRef(-1);
const value2 = (ReanimatedRexportModule).useSharedValue(null);
const value3 = env1_4.useCallback(_fun117851, [a0, value2]);
env1_4.useLayoutEffect(function() {
return _fun117854;
}, []);
return {showFloatingCTA: value2, setShowFloatingCTA: value3};
function _fun117851(a0) { // fn#117851, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:25381, offset: 0x024c3387, size: 137 bytes, params: 2, frame: 15
var clearTimeout;
let binding = env0_0;
const value2 = binding.get();
const PANEL = VoicePanelModes.PANEL;
if (value2 === PANEL) {
binding = env0_2;
binding.set(a0);
if (a0 != null) {
clearTimeout = global.clearTimeout;
binding = env0_1;
clearTimeout(binding.current);
binding.current = global.setTimeout(_fun117852,
(require(15410) /* metro dependency 15410: VoicePanelFloatingCTAUtils */).FLOATING_CTA_HIDE_TIMEOUT);
}
}
function _fun117852() { // fn#117852, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:25470, offset: 0x024c3410, size: 23 bytes, params: 1, frame: 11
env1_2.set(null);
}
}
function _fun117853() { // fn#117853, offset: 0x024c3427, size: 11 bytes, params: 1, frame: 1
return _fun117854;
function _fun117854() { // fn#117854, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:25567, offset: 0x01d39579, size: 29 bytes, params: 1, frame: 11
return global.clearTimeout(env1_1.current);
}
}
}
function _fun117855() { // fn#117855, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:25741, offset: 0x024c3432, size: 19 bytes, params: 1, frame: 2
env0_37.current = 0;
}
function _fun117856() { // fn#117856, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15602:25972, offset: 0x024c3445, size: 355 bytes, params: 1, frame: 13
const object = {};
object.channelId = channelId;
object.channelType = channelType;
object.connected = connected;
object.contentDimensions = contentDimensions;
object.controlsSpecs = controlsSpecs;
object.dismissPanel = dismissPanel;
object.dismissToPIPGestureRef = env0_36;
object.dragScrolling = dragScrolling;
object.focused = focused;
object.generateStateLocker = generateStateLocker;
object.guildId = guildId;
object.hideControls = hideControls;
object.isCall = isCall;
object.isFocusedVideoZoomed = isFocusedVideoZoomed;
object.layoutManager = layoutManager;
object.mode = mode;
object.morphablePanelMode = morphablePanelMode;
object.mountedCards = env0_3;
object.pipAvoidanceSpecs = env0_33;
object.preJoinContentSize = preJoinContentSize;
object.safeArea = safeArea;
object.scrollPosition = scrollPosition;
object.setControlsMode = setControlsMode;
object.setFocused = setFocused;
object.setIsFocusedVideoZoomed = setIsFocusedVideoZoomed;
object.setMode = setMode;
object.setShowFloatingCTA = setShowFloatingCTA;
object.showControls = showControls;
object.showFloatingCTA = showFloatingCTA;
object.streamOutputSinkStack = env0_2;
const usePIPState = (VoicePanelPIPStateContextModule).usePIPState;
object.usePIPState = usePIPState;
object.useReducedMotion = useReducedMotion;
object.windowDimensions = windowDimensions;
object.wrapperDimensions = wrapperDimensions;
object.wrapperOffset = wrapperOffset;
object.panelCardStillInPIP = panelCardStillInPIP;
return object;
}
}
}
global.__d(_fun117729, 15405, [57, 31, 27, 4502, 1378, 4606, 9559, 10724, 7730, 1379, 4259, 4294, 7710, 11795,
11793, 661, 4237, 8044, 4299, 11796, 33, 15406, 4017, 7739, 672, 15407, 566, 3857, 10696, 1244, 15408, 15409,
8899, 7860, 15410, 1478, 1585, 15432, 11797, 11282, 22, 491, 1239, 690, 10712, 11534, 4827, 683, 7717, 4610,
15362, 4508, 15433, 7712, 4863, 4015, 5459, 15434, 15435, 3774, 15436, 15442, 15443, 15367, 1216, 15444, 11794,
4037,
2]) /* metro module 15405, dependencies: [57, 31, 27, 4502, 1378, 4606, 9559, 10724, 7730, 1379, 4259, 4294, 7710, 11795, 11793, 661, 4237, 8044, 4299, 11796, 33, 15406, 4017, 7739, 672, 15407, 566, 3857, 10696, 1244, 15408, 15409, 8899, 7860, 15410, 1478, 1585, 15432, 11797, 11282, 22, 491, 1239, 690, 10712, 11534, 4827, 683, 7717, 4610, 15362, 4508, 15433, 7712, 4863, 4015, 5459, 15434, 15435, 3774, 15436, 15442, 15443, 15367, 1216, 15444, 11794, 4037, 2] */;