// Metro module 15922 (f15923). import _slicedToArray from "../../../_bundle/_slicedToArray"; import * as Module19 from "react"; import { useContext, useState, useMemo, useEffect } from "react"; import "../../calls/ChannelRTCStore"; import "../VoicePanelConstants"; import "./controls/VoicePanelControlsConstants"; import "../../calls/CallConstants"; import { jsx } from "react/jsx-runtime"; import VoicePanelStateContext from "./VoicePanelStateContext"; import { batchUpdates } from "../../../_bundle/Module705"; import debounce from "../../../_bundle/debounce"; import * as _ReanimatedRexport from "../../reanimated/ReanimatedRexport"; import { useAnimatedReaction } from "../../reanimated/ReanimatedRexport"; import * as _cheapWorkletShallowEqual from "../../reanimated/native/cheapWorkletShallowEqual"; import StatusBar_android from "../../status_bar/native/components/StatusBar.android"; import HomeIndicator from "./HomeIndicator"; function $mk117102($env) { return () => { const r8 = $env; const r4 = $env.$parent; const r5 = r4[6]; const r9 = r8[1]; const r7 = $env.$parent.$parent; r5(r9 !== r7[6].PIP); const r13 = r8[2]; const HIDDEN = r7[7].HIDDEN; const r10 = r8[0]; const r0 = !(r10 != null) && !r8[3] || r13 !== HIDDEN; (0, r4[5])(r0); const type = (r10 != null ? r7[5].getParticipant(r4[1], r10) : void 0)?.type; const ACTIVITY = r7[8].ACTIVITY; const r36 = !!(0, r7[0])(r7[2][9]).isIOS() && type === ACTIVITY; (0, r4[8])(r36); r4[7](r0 ? !r0 : !r36); }; } let env11405 = {}; const c11405_12 = { 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};}" }; const c11405_13 = { 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);}" }; const r37 = Module19.memo(function VoicePanelSystemUIManager() { let env22608 = { $parent: env11405 }; const context = useContext(VoicePanelStateContext); const focused = context.focused; env22608[0] = focused; const channelId = context.channelId; env22608[1] = channelId; const mode = context.mode; env22608[2] = mode; const controlsSpecs = context.controlsSpecs; env22608[3] = controlsSpecs; const windowDimensions = context.windowDimensions; env22608[4] = windowDimensions; const r26 = _slicedToArray(useState(true), 2); const r14 = r26[0]; env22608[5] = r26[1]; const r6 = _slicedToArray(useState(true), 2); const r30 = r6[0]; env22608[6] = r6[1]; const r35 = _slicedToArray(useState(false), 2); const prefersHidden = r35[0]; env22608[7] = r35[1]; const r39 = _slicedToArray(useState(false), 2); const prefersDeferringSystemGestures = r39[0]; env22608[8] = r39[1]; const memo = useMemo(() => { let focusedId; let c28184_0 = debounce(function updateState(a0) { let env30934; const r1 = env30934 = { $parent: env22608 }; env30934[0] = a0.focusedId; env30934[1] = a0.mode; env30934[2] = a0.controlsMode; env30934[3] = a0.landscape; batchUpdates($mk117102(r1)); }, 500, { maxWait: 2000 }); focusedId = void 0; return { cancelPendingDebounce: () => { c28184_0.cancel(); }, handleStateChange: (a0) => { if (focusedId !== a0.focusedId) { focusedId = a0.focusedId; c28184_0(a0); } else { let env30935; c28184_0.cancel(); const r10 = env30935 = { $parent: env22608 }; env30935[0] = void 0; env30935[1] = void 0; env30935[2] = void 0; env30935[3] = void 0; env30935[0] = a0.focusedId; env30935[1] = a0.mode; env30935[2] = a0.controlsMode; env30935[3] = a0.landscape; batchUpdates($mk117102(r10)); } } }; }, [channelId]); const cancelPendingDebounce2 = memo.cancelPendingDebounce; env22608[9] = cancelPendingDebounce2; const handleStateChange2 = memo.handleStateChange; env22608[10] = handleStateChange2; useEffect(() => () => (0, env22608[9])(), [cancelPendingDebounce2]); const v = () => ({ focusedId: env22608[0].get()?.id, mode: env22608[2].get(), controlsMode: env22608[3].get().mode, landscape: env22608[4].get().landscape }); v.__closure = { focused, mode, controlsSpecs, windowDimensions }; v.__workletHash = 2478376475717; v.__initData = c11405_12; const u = function u(a0, a1) { if (!_cheapWorkletShallowEqual.cheapWorkletShallowEqual(a0, a1 == null ? void 0 : a1)) { _ReanimatedRexport.runOnJS(env22608[10])(a0); } }; u.__closure = { cheapWorkletShallowEqual: _cheapWorkletShallowEqual.cheapWorkletShallowEqual, runOnJS: _ReanimatedRexport.runOnJS, handleStateChange: handleStateChange2 }; u.__workletHash = 3592680244658; u.__initData = c11405_13; useAnimatedReaction(v, u); return <> {r30 ? (0, jsx)(StatusBar_android, { hidden: !r14, barStyle: "light-content" }) : null} {(0, jsx)(HomeIndicator, { prefersHidden, prefersDeferringSystemGestures })} ; }); export default r37;