166 lines
11 KiB
TypeScript
166 lines
11 KiB
TypeScript
/* Metro module 15448; source: modules/voice_panel/native/VoicePanelSystemUIManager.tsx; dependencies: [57, 31, 4606, 11795, 11793, 4299, 33, 11794, 690, 477, 6949, 4017, 7739, 7725, 7727, 2] */
|
|
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import ChannelRTCStore from '../../calls/ChannelRTCStore.tsx'; /* Metro dependency 4606 */
|
|
import Module06949 from '../../../by-id/module-06949.js'; /* Metro dependency 6949 */
|
|
import VoicePanelStateContext from './VoicePanelStateContext.tsx'; /* Metro dependency 11794 */
|
|
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
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 PlatformUtilsModule from '../../../utils/PlatformUtils.tsx'; /* Metro dependency 477 */
|
|
import * as ReactBatchUpdatesNativeModule from '../../../external/discord_common/js/shared/utils/ReactBatchUpdates.native.tsx'; /* Metro dependency 690 */
|
|
import * as ReanimatedRexportModule from '../../reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
|
|
import * as CallConstantsModule from '../../calls/CallConstants.tsx'; /* Metro dependency 4299 */
|
|
import * as CheapWorkletShallowEqualModule from '../../reanimated/native/cheapWorkletShallowEqual.tsx'; /* Metro dependency 7739 */
|
|
import * as VoicePanelControlsConstantsModule from './controls/VoicePanelControlsConstants.tsx'; /* Metro dependency 11793 */
|
|
import * as VoicePanelConstantsModule from '../VoicePanelConstants.tsx'; /* Metro dependency 11795 */
|
|
|
|
function _fun118240(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#118240, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15645:6, offset: 0x024d2865, size: 301 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactModule;
|
|
object = {code: 'function VoicePanelSystemUIManagerTsx1(){const{focused,mode,controlsSpecs,windowDimensions}=this.__closure;var _focused$get;return{focusedId:(_focused$get=focused.get())===null||_focused$get===void 0?void 0:_focused$get.id,mode:mode.get(),controlsMode:controlsSpecs.get().mode,landscape:windowDimensions.get().landscape};}'};
|
|
object = {code: 'function VoicePanelSystemUIManagerTsx2(props,previous){const{cheapWorkletShallowEqual,runOnJS,handleStateChange}=this.__closure;if(cheapWorkletShallowEqual(props,previous!==null&&previous!==void 0?previous:undefined))return;runOnJS(handleStateChange)(props);}'};
|
|
value = value.memo(VoicePanelSystemUIManager);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/voice_panel/native/VoicePanelSystemUIManager.tsx');
|
|
exports.default = value;
|
|
function VoicePanelSystemUIManager() { // fn#118241, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15645:872, offset: 0x024d2992, size: 597 bytes, params: 1, frame: 28
|
|
const binding = env0_4;
|
|
const value2 = binding.useContext(VoicePanelStateContext);
|
|
const focused = value2.focused;
|
|
const channelId = value2.channelId;
|
|
const mode = value2.mode;
|
|
const controlsSpecs = value2.controlsSpecs;
|
|
const controlsSpecs2 = controlsSpecs;
|
|
const windowDimensions = value2.windowDimensions;
|
|
let useState = binding.useState;
|
|
const value3 = Reflect.apply(useState, binding, [true]);
|
|
const binding2 = controlsSpecs2;
|
|
const value4 = binding2(value3, 2);
|
|
const property = value4[0];
|
|
const env0_5 = value4[1];
|
|
useState = binding.useState;
|
|
const value5 = binding2(Reflect.apply(useState, binding, [true]), 2);
|
|
const property2 = value5[0];
|
|
const env0_6 = value5[1];
|
|
useState = binding.useState;
|
|
const value6 = binding2(Reflect.apply(useState, binding, [false]), 2);
|
|
const property3 = value6[0];
|
|
const env0_7 = value6[1];
|
|
useState = binding.useState;
|
|
const value7 = binding2(Reflect.apply(useState, binding, [false]), 2);
|
|
const property4 = value7[0];
|
|
const env0_8 = value7[1];
|
|
const {cancelPendingDebounce, handleStateChange} = binding.useMemo(_fun118242, [channelId]);
|
|
binding.useEffect(function() {
|
|
return _fun118248;
|
|
}, [cancelPendingDebounce]);
|
|
const useAnimatedReaction = ReanimatedRexportModule.useAnimatedReaction;
|
|
const closure = function() {
|
|
var object = {};
|
|
object.focusedId = focused.get()?.id;
|
|
object.mode = mode.get();
|
|
object.controlsMode = controlsSpecs.get().mode;
|
|
object.landscape = windowDimensions.get().landscape;
|
|
return object;
|
|
};
|
|
closure.__closure = {focused: focused, mode: mode, controlsSpecs: controlsSpecs, windowDimensions: windowDimensions};
|
|
closure.__workletHash = 2478376475717;
|
|
closure.__initData = env0_12;
|
|
const VoicePanelSystemUIManagerU2 = VoicePanelSystemUIManagerU;
|
|
VoicePanelSystemUIManagerU2.__closure = {cheapWorkletShallowEqual: (require(7739) /* metro dependency 7739: cheapWorkletShallowEqual */).cheapWorkletShallowEqual,
|
|
runOnJS: ReanimatedRexportModule.runOnJS, handleStateChange: handleStateChange};
|
|
VoicePanelSystemUIManagerU2.__workletHash = 3592680244658;
|
|
VoicePanelSystemUIManagerU2.__initData = env0_13;
|
|
Reflect.apply(useAnimatedReaction, ReanimatedRexportModule, [closure, VoicePanelSystemUIManagerU2]);
|
|
return (
|
|
<>
|
|
{
|
|
property2
|
|
? ((Component) => <Component hidden={!property} barStyle="light-content" />)(importDefault(7725) /* metro dependency 7725: StatusBarAndroid */)
|
|
: null
|
|
}
|
|
{((Component) => <Component prefersHidden={property3} prefersDeferringSystemGestures={property4} />)(importDefault(7727) /* metro dependency 7727: HomeIndicator */)}
|
|
</>
|
|
);
|
|
function _fun118242() { // fn#118242, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15645:1188, offset: 0x024d2be7, size: 100 bytes, params: 1, frame: 16
|
|
var environment;
|
|
const updateState_1182432 = updateState_118243;
|
|
const value = environment.__proto__;
|
|
const env0_1 = (Module06949)(updateState_1182432, 500, {maxWait: 2000});
|
|
return {cancelPendingDebounce: cancelPendingDebounce, handleStateChange: handleStateChange_118246};
|
|
function updateState_118243({focusedId, mode, controlsMode, landscape}) { // fn#118243, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15645:1209, offset: 0x024d2c4b, size: 89 bytes, params: 2, frame: 12
|
|
var environment;
|
|
const value = environment.__proto__.__proto__;
|
|
(ReactBatchUpdatesNativeModule).batchUpdates(_fun118244);
|
|
function _fun118244() { // fn#118244, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15645:1283, offset: 0x024d2ca4, size: 233 bytes, params: 1, frame: 19
|
|
const value = environment.__proto__.__proto__;
|
|
const binding = env2_6;
|
|
const modeBinding = mode;
|
|
const PIP = VoicePanelModes.PIP;
|
|
const value4 = undefined;
|
|
binding(modeBinding !== PIP);
|
|
const controlsModeBinding = controlsMode;
|
|
const HIDDEN = VoicePanelControlsModes.HIDDEN;
|
|
const value5 = controlsModeBinding !== HIDDEN;
|
|
let r2 = !(focusedId != null) && !landscape;
|
|
r2 = !r2 ? value5 : r2;
|
|
env2_5(r2);
|
|
const r22 = focusedId != null ? ChannelRTCStore.getParticipant(channelId, focusedId) : value4;
|
|
const type = r22 == null ? value4 : r22.type;
|
|
const ACTIVITY = ParticipantTypes.ACTIVITY;
|
|
const value10 = type === ACTIVITY;
|
|
const isIOS2 = (PlatformUtilsModule).isIOS();
|
|
const r3 = isIOS2 ? value10 : !!isIOS2;
|
|
env2_8(r3);
|
|
env2_7(!r2 && !r3);
|
|
return value4;
|
|
}
|
|
|
|
}
|
|
|
|
function cancelPendingDebounce() { // fn#118245, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15645:1527, offset: 0x024d2d8d, size: 21 bytes, params: 1, frame: 9
|
|
env0_1.cancel();
|
|
}
|
|
|
|
function handleStateChange_118246(a0) { // fn#118246, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15645:1563, offset: 0x024d2da2, size: 72 bytes, params: 2, frame: 12
|
|
const binding = env0_2;
|
|
let focusedId = a0.focusedId;
|
|
if (binding !== focusedId) {
|
|
focusedId = a0.focusedId;
|
|
env0_1(a0);
|
|
} else {
|
|
env0_1.cancel();
|
|
updateState_118243(a0);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function _fun118247() { // fn#118247, offset: 0x024d2dea, size: 11 bytes, params: 1, frame: 1
|
|
return function() {
|
|
return cancelPendingDebounce();
|
|
};
|
|
function _fun118248() { // fn#118248, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15645:1730, offset: 0x01010e35, size: 15 bytes, params: 1, frame: 9
|
|
return cancelPendingDebounce();
|
|
}
|
|
|
|
}
|
|
|
|
function VoicePanelSystemUIManagerU(a0, a1) { // fn#118250, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15645:2021, owner: VoicePanelSystemUIManager.u, offset: 0x024d2e5e, size: 104 bytes, params: 3, frame: 17
|
|
let value = a1;
|
|
const value3 = undefined;
|
|
if (!CheapWorkletShallowEqualModule.cheapWorkletShallowEqual(a0, value ?? value3)) {
|
|
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
|
|
value.runOnJS(handleStateChange)(a0);
|
|
}
|
|
return value3;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun118240, 15448, [57, 31, 4606, 11795, 11793, 4299, 33, 11794, 690, 477, 6949, 4017, 7739, 7725, 7727,
|
|
2]) /* metro module 15448, dependencies: [57, 31, 4606, 11795, 11793, 4299, 33, 11794, 690, 477, 6949, 4017, 7739, 7725, 7727, 2] */;
|