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AAkBA,EAAE,mBAAlsB,GAAwtB,IAAIK,EAAE/M,EAAEwX,EAAQ,IAAIzK,KAAKF,EAAE7M,EAAE+M,GAAGF,EAAEE,GAAGF,EAAEmL,YAAYhgB,OAAOyf,eAAezX,EAAE,aAAa,CAACrJ,OAAM,KAA1nf","sources":["webpack://telegram-t/./src/global/actions/api/calls.async.ts","webpack://telegram-t/./src/util/vibrate.ts","webpack://telegram-t/./src/components/common/AnimatedIcon.tsx","webpack://telegram-t/./src/components/calls/group/MicrophoneButton.tsx","webpack://telegram-t/./src/components/calls/group/GroupCallParticipantMenu.tsx","webpack://telegram-t/./src/hooks/useThrottle.ts","webpack://telegram-t/./src/components/calls/group/OutlinedMicrophoneIcon.tsx","webpack://telegram-t/./src/components/calls/group/GroupCallParticipant.tsx","webpack://telegram-t/./src/components/calls/group/GroupCallParticipantList.tsx","webpack://telegram-t/./src/components/calls/group/GroupCallParticipantVideo.tsx","webpack://telegram-t/./src/components/calls/group/GroupCallParticipantStreams.tsx","webpack://telegram-t/./src/components/calls/group/GroupCall.tsx","webpack://telegram-t/./src/components/calls/ActiveCallHeader.tsx","webpack://telegram-t/./src/components/calls/CallFallbackConfirm.tsx","webpack://telegram-t/./src/lib/secret-sauce/index.js"],"sourcesContent":["import { addActionHandler, getGlobal, setGlobal } from '../../index';\nimport {\n joinGroupCall,\n startSharingScreen,\n leaveGroupCall,\n toggleStream,\n isStreamEnabled,\n setVolume,\n handleUpdateGroupCallParticipants, handleUpdateGroupCallConnection,\n} from '../../../lib/secret-sauce';\n\nimport { GROUP_CALL_VOLUME_MULTIPLIER } from '../../../config';\nimport { callApi } from '../../../api/gramjs';\nimport { selectChat, selectCurrentMessageList, selectUser } from '../../selectors';\nimport {\n selectActiveGroupCall,\n selectCallFallbackChannelTitle,\n selectGroupCallParticipant,\n} from '../../selectors/calls';\nimport {\n removeGroupCall,\n updateActiveGroupCall,\n updateGroupCall,\n updateGroupCallParticipant,\n} from '../../reducers/calls';\nimport { omit } from '../../../util/iteratees';\nimport { getServerTime } from '../../../util/serverTime';\nimport { fetchFile } from '../../../util/files';\nimport { getGroupCallAudioContext, getGroupCallAudioElement, removeGroupCallAudioElement } from '../ui/calls';\nimport { loadFullChat } from './chats';\n\nimport callFallbackAvatarPath from '../../../assets/call-fallback-avatar.png';\n\nconst FALLBACK_INVITE_EXPIRE_SECONDS = 1800; // 30 min\n\naddActionHandler('apiUpdate', (global, actions, update) => {\n const { activeGroupCallId } = global.groupCalls;\n\n switch (update['@type']) {\n case 'updateGroupCallLeavePresentation': {\n actions.toggleGroupCallPresentation({ value: false });\n break;\n }\n case 'updateGroupCallStreams': {\n if (!update.userId || !activeGroupCallId) break;\n if (!selectGroupCallParticipant(global, activeGroupCallId, update.userId)) break;\n\n return updateGroupCallParticipant(global, activeGroupCallId, update.userId, omit(update, ['@type', 'userId']));\n }\n case 'updateGroupCallConnectionState': {\n if (!activeGroupCallId) break;\n\n if (update.connectionState === 'disconnected') {\n actions.leaveGroupCall({ isFromLibrary: true });\n break;\n }\n\n return updateGroupCall(global, activeGroupCallId, {\n connectionState: update.connectionState,\n isSpeakerDisabled: update.isSpeakerDisabled,\n });\n }\n case 'updateGroupCallParticipants': {\n const { groupCallId, participants } = update;\n if (activeGroupCallId === groupCallId) {\n void handleUpdateGroupCallParticipants(participants);\n }\n break;\n }\n case 'updateGroupCallConnection': {\n if (update.data.stream) {\n actions.showNotification({ message: 'Big live streams are not yet supported' });\n actions.leaveGroupCall();\n break;\n }\n void handleUpdateGroupCallConnection(update.data, update.presentation);\n\n const groupCall = selectActiveGroupCall(global);\n if (groupCall?.participants && Object.keys(groupCall.participants).length > 0) {\n void handleUpdateGroupCallParticipants(Object.values(groupCall.participants));\n }\n break;\n }\n }\n\n return undefined;\n});\n\naddActionHandler('leaveGroupCall', async (global, actions, payload) => {\n const {\n isFromLibrary, shouldDiscard, shouldRemove, rejoin,\n } = payload || {};\n const groupCall = selectActiveGroupCall(global);\n if (!groupCall) {\n return;\n }\n\n setGlobal(updateActiveGroupCall(global, { connectionState: 'disconnected' }, groupCall.participantsCount - 1));\n\n await callApi('leaveGroupCall', {\n call: groupCall,\n });\n\n let shouldResetFallbackState = false;\n if (shouldDiscard) {\n global = getGlobal();\n\n if (global.groupCalls.fallbackChatId === groupCall.chatId) {\n shouldResetFallbackState = true;\n\n global.groupCalls.fallbackUserIdsToRemove?.forEach((userId) => {\n actions.deleteChatMember({ chatId: global.groupCalls.fallbackChatId, userId });\n });\n }\n\n await callApi('discardGroupCall', {\n call: groupCall,\n });\n }\n\n global = getGlobal();\n if (shouldRemove) {\n global = removeGroupCall(global, groupCall.id);\n }\n\n removeGroupCallAudioElement();\n\n setGlobal({\n ...global,\n groupCalls: {\n ...global.groupCalls,\n isGroupCallPanelHidden: true,\n activeGroupCallId: undefined,\n ...(shouldResetFallbackState && {\n fallbackChatId: undefined,\n fallbackUserIdsToRemove: undefined,\n }),\n },\n });\n\n if (!isFromLibrary) {\n leaveGroupCall();\n }\n\n if (rejoin) {\n actions.joinGroupCall(rejoin);\n }\n});\n\naddActionHandler('toggleGroupCallVideo', async (global) => {\n const groupCall = selectActiveGroupCall(global);\n const user = selectUser(global, global.currentUserId!);\n if (!user || !groupCall) {\n return;\n }\n\n await toggleStream('video');\n\n await callApi('editGroupCallParticipant', {\n call: groupCall,\n videoStopped: !isStreamEnabled('video'),\n participant: user,\n });\n});\n\naddActionHandler('requestToSpeak', (global, actions, payload) => {\n const { value } = payload || { value: true };\n const groupCall = selectActiveGroupCall(global);\n const user = selectUser(global, global.currentUserId!);\n if (!user || !groupCall) {\n return;\n }\n\n void callApi('editGroupCallParticipant', {\n call: groupCall,\n raiseHand: value,\n participant: user,\n });\n});\n\naddActionHandler('setGroupCallParticipantVolume', (global, actions, payload) => {\n const { participantId, volume } = payload!;\n\n const groupCall = selectActiveGroupCall(global);\n const user = selectUser(global, participantId);\n if (!user || !groupCall) {\n return;\n }\n\n setVolume(participantId, Math.floor(volume / GROUP_CALL_VOLUME_MULTIPLIER) / 100);\n\n void callApi('editGroupCallParticipant', {\n call: groupCall,\n volume: Number(volume),\n participant: user,\n });\n});\n\naddActionHandler('toggleGroupCallMute', async (global, actions, payload) => {\n const { participantId, value } = payload || {};\n const groupCall = selectActiveGroupCall(global);\n const user = selectUser(global, participantId || global.currentUserId!);\n if (!user || !groupCall) {\n return;\n }\n\n const muted = value === undefined ? isStreamEnabled('audio', user.id) : value;\n\n if (!participantId) {\n await toggleStream('audio');\n } else {\n setVolume(participantId, muted ? 0 : 1);\n }\n\n await callApi('editGroupCallParticipant', {\n call: groupCall,\n muted,\n participant: user,\n });\n});\n\naddActionHandler('toggleGroupCallPresentation', async (global, actions, payload) => {\n const groupCall = selectActiveGroupCall(global);\n const user = selectUser(global, global.currentUserId!);\n if (!user || !groupCall) {\n return;\n }\n\n const value = payload?.value !== undefined ? payload?.value : !isStreamEnabled('presentation');\n if (value) {\n const params = await startSharingScreen();\n if (!params) {\n return;\n }\n\n await callApi('joinGroupCallPresentation', {\n call: groupCall,\n params,\n });\n } else {\n await toggleStream('presentation', false);\n await callApi('leaveGroupCallPresentation', {\n call: groupCall,\n });\n }\n\n await callApi('editGroupCallParticipant', {\n call: groupCall,\n presentationPaused: !isStreamEnabled('presentation'),\n participant: user,\n });\n});\n\naddActionHandler('connectToActiveGroupCall', async (global, actions) => {\n const groupCall = selectActiveGroupCall(global);\n if (!groupCall) return;\n\n if (groupCall.connectionState === 'discarded') {\n actions.showNotification({ message: 'This voice chat is not active' });\n return;\n }\n\n const audioElement = getGroupCallAudioElement();\n const audioContext = getGroupCallAudioContext();\n\n if (!audioElement || !audioContext) {\n return;\n }\n\n const {\n currentUserId,\n } = global;\n\n if (!currentUserId) return;\n\n const params = await joinGroupCall(currentUserId, audioContext, audioElement, actions.apiUpdate);\n\n const result = await callApi('joinGroupCall', {\n call: groupCall,\n params,\n inviteHash: groupCall.inviteHash,\n });\n\n if (!result) return;\n\n actions.loadMoreGroupCallParticipants();\n\n if (groupCall.chatId) {\n const chat = selectChat(getGlobal(), groupCall.chatId);\n if (!chat) return;\n await loadFullChat(chat);\n }\n});\n\naddActionHandler('inviteToCallFallback', async (global, actions, payload) => {\n const { chatId } = selectCurrentMessageList(global) || {};\n if (!chatId) {\n return;\n }\n\n const user = selectUser(global, chatId);\n if (!user) {\n return;\n }\n\n const { shouldRemove } = payload;\n\n const fallbackChannelTitle = selectCallFallbackChannelTitle(global);\n\n let fallbackChannel = Object.values(global.chats.byId).find((channel) => {\n return (\n channel.title === fallbackChannelTitle\n && channel.isCreator\n && !channel.isRestricted\n && !channel.isForbidden\n );\n });\n if (!fallbackChannel) {\n fallbackChannel = await callApi('createChannel', {\n title: fallbackChannelTitle,\n users: [user],\n });\n\n if (!fallbackChannel) {\n return;\n }\n\n const photo = await fetchFile(callFallbackAvatarPath, 'avatar.png');\n void callApi('editChatPhoto', {\n chatId: fallbackChannel.id,\n accessHash: fallbackChannel.accessHash,\n photo,\n });\n } else {\n actions.updateChatMemberBannedRights({\n chatId: fallbackChannel.id,\n userId: chatId,\n bannedRights: {},\n });\n\n void callApi('addChatMembers', fallbackChannel, [user], true);\n }\n\n const inviteLink = await callApi('updatePrivateLink', {\n chat: fallbackChannel,\n usageLimit: 1,\n expireDate: getServerTime(global.serverTimeOffset) + FALLBACK_INVITE_EXPIRE_SECONDS,\n });\n if (!inviteLink) {\n return;\n }\n\n if (shouldRemove) {\n global = getGlobal();\n const fallbackUserIdsToRemove = global.groupCalls.fallbackUserIdsToRemove || [];\n setGlobal({\n ...global,\n groupCalls: {\n ...global.groupCalls,\n fallbackChatId: fallbackChannel.id,\n fallbackUserIdsToRemove: [...fallbackUserIdsToRemove, chatId],\n },\n });\n }\n\n actions.sendMessage({ text: `Join a call: ${inviteLink}` });\n actions.openChat({ id: fallbackChannel.id });\n actions.createGroupCall({ chatId: fallbackChannel.id });\n actions.closeCallFallbackConfirm();\n});\n","export const vibrateShort = () => {\n navigator.vibrate?.(50);\n};\n","import React, {\n FC, memo, useEffect, useState,\n} from '../../lib/teact/teact';\n\nimport getAnimationData, { ANIMATED_STICKERS_PATHS } from './helpers/animatedAssets';\n\nimport AnimatedSticker from './AnimatedSticker';\n\ntype OwnProps = {\n name: keyof typeof ANIMATED_STICKERS_PATHS;\n size: number;\n playSegment?: [number, number];\n color?: [number, number, number];\n};\n\nconst AnimatedIcon: FC<OwnProps> = ({\n size,\n name,\n playSegment,\n color,\n}) => {\n const [iconData, setIconData] = useState<string>();\n\n useEffect(() => {\n getAnimationData(name).then(setIconData);\n }, [name]);\n\n return (\n <AnimatedSticker\n id={name}\n play\n noLoop\n playSegment={playSegment}\n size={size}\n speed={1}\n animationData={iconData}\n color={color}\n />\n );\n};\n\nexport default memo(AnimatedIcon);\n","import { GroupCallConnectionState } from '../../../lib/secret-sauce';\nimport React, {\n FC, memo, useEffect, useMemo, useRef, useState,\n} from '../../../lib/teact/teact';\nimport { getActions, withGlobal } from '../../../global';\n\nimport buildClassName from '../../../util/buildClassName';\nimport { vibrateShort } from '../../../util/vibrate';\nimport usePrevious from '../../../hooks/usePrevious';\nimport { selectActiveGroupCall, selectGroupCallParticipant } from '../../../global/selectors/calls';\nimport useLang from '../../../hooks/useLang';\n\nimport AnimatedIcon from '../../common/AnimatedIcon';\n\nimport './MicrophoneButton.scss';\n\nconst CONNECTION_STATE_DEFAULT = 'discarded';\n\ntype StateProps = {\n connectionState?: GroupCallConnectionState;\n hasRequestedToSpeak: boolean;\n isMuted?: boolean;\n canSelfUnmute?: boolean;\n noAudioStream: boolean;\n};\n\nconst REQUEST_TO_SPEAK_THROTTLE = 3000;\nconst HOLD_TO_SPEAK_TIME = 200;\nconst ICON_SIZE = 48;\n\nconst MicrophoneButton: FC<StateProps> = ({\n noAudioStream,\n canSelfUnmute,\n isMuted,\n hasRequestedToSpeak,\n connectionState,\n}) => {\n const {\n toggleGroupCallMute,\n requestToSpeak,\n playGroupCallSound,\n } = getActions();\n\n const lang = useLang();\n const muteMouseDownState = useRef('up');\n\n const [isRequestingToSpeak, setIsRequestingToSpeak] = useState(false);\n const isConnecting = connectionState !== 'connected';\n const shouldRaiseHand = !canSelfUnmute && isMuted;\n const prevShouldRaiseHand = usePrevious(shouldRaiseHand);\n\n useEffect(() => {\n if (prevShouldRaiseHand && !shouldRaiseHand) {\n playGroupCallSound('allowTalk');\n }\n }, [playGroupCallSound, prevShouldRaiseHand, shouldRaiseHand]);\n\n // Voice mini\n // unmuted -> muted [69, 99]\n // muted -> unmuted [36, 69]\n // raise -> muted [0, 36]\n // muted -> raise [99, 136]\n // unmuted -> raise [136, 172]\n // TODO should probably move to other component\n const playSegment: [number, number] = useMemo(() => {\n if (isRequestingToSpeak) {\n const r = Math.floor(Math.random() * 100);\n return (r < 32 ? [0, 120]\n : (r < 64 ? [120, 240]\n : (r < 97 ? [240, 420]\n : [420, 540]\n )\n )\n );\n }\n if (!prevShouldRaiseHand && shouldRaiseHand) {\n return noAudioStream ? [99, 135] : [136, 172];\n }\n if (prevShouldRaiseHand && !shouldRaiseHand) {\n return [0, 36];\n }\n if (!shouldRaiseHand) {\n return noAudioStream ? [69, 99] : [36, 69];\n }\n return [0, 0];\n }, [prevShouldRaiseHand, isRequestingToSpeak, noAudioStream, shouldRaiseHand]);\n\n const animatedIconName = isRequestingToSpeak ? 'HandFilled' : 'VoiceMini';\n\n const toggleMute = () => {\n vibrateShort();\n toggleGroupCallMute();\n };\n\n const handleMouseDownMute = () => {\n if (shouldRaiseHand) {\n if (isRequestingToSpeak) return;\n vibrateShort();\n requestToSpeak();\n setIsRequestingToSpeak(true);\n setTimeout(() => {\n setIsRequestingToSpeak(false);\n }, REQUEST_TO_SPEAK_THROTTLE);\n return;\n }\n muteMouseDownState.current = 'down';\n if (noAudioStream) {\n setTimeout(() => {\n if (muteMouseDownState.current === 'down') {\n muteMouseDownState.current = 'hold';\n toggleMute();\n }\n }, HOLD_TO_SPEAK_TIME);\n }\n };\n\n const handleMouseUpMute = () => {\n if (shouldRaiseHand) {\n return;\n }\n toggleMute();\n muteMouseDownState.current = 'up';\n };\n\n const buttonText = useMemo(() => {\n return lang(\n hasRequestedToSpeak ? 'VoipMutedTapedForSpeak' : (\n shouldRaiseHand ? 'VoipMutedByAdmin' : (\n noAudioStream ? 'VoipUnmute' : 'VoipTapToMute'\n )\n ),\n );\n }, [hasRequestedToSpeak, noAudioStream, lang, shouldRaiseHand]);\n\n return (\n <div className=\"button-wrapper microphone-wrapper\">\n <button\n className={buildClassName(\n 'MicrophoneButton',\n noAudioStream && 'crossed',\n canSelfUnmute && 'can-self-unmute',\n isConnecting && 'is-connecting',\n shouldRaiseHand && 'muted-by-admin',\n )}\n onMouseDown={handleMouseDownMute}\n onMouseUp={handleMouseUpMute}\n >\n <AnimatedIcon\n name={animatedIconName}\n size={ICON_SIZE}\n playSegment={playSegment}\n />\n </button>\n <div className=\"button-text\">\n {buttonText}\n </div>\n </div>\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const groupCall = selectActiveGroupCall(global);\n\n const { connectionState } = groupCall || {};\n const meParticipant = groupCall && selectGroupCallParticipant(global, groupCall.id, global.currentUserId!);\n\n const {\n raiseHandRating, hasAudioStream, canSelfUnmute, isMuted,\n } = meParticipant || {};\n\n return {\n connectionState: connectionState || CONNECTION_STATE_DEFAULT,\n hasRequestedToSpeak: Boolean(raiseHandRating),\n noAudioStream: !hasAudioStream,\n canSelfUnmute,\n isMuted,\n };\n },\n)(MicrophoneButton));\n","import { GroupCallParticipant } from '../../../lib/secret-sauce';\nimport React, {\n FC, memo, useCallback, useEffect, useState,\n} from '../../../lib/teact/teact';\nimport { getActions, withGlobal } from '../../../global';\n\nimport { IAnchorPosition } from '../../../types';\n\nimport buildClassName from '../../../util/buildClassName';\nimport useThrottle from '../../../hooks/useThrottle';\nimport useFlag from '../../../hooks/useFlag';\nimport useLang from '../../../hooks/useLang';\nimport { selectIsAdminInActiveGroupCall } from '../../../global/selectors/calls';\nimport { GROUP_CALL_DEFAULT_VOLUME, GROUP_CALL_VOLUME_MULTIPLIER } from '../../../config';\n\nimport Menu from '../../ui/Menu';\nimport MenuItem from '../../ui/MenuItem';\nimport AnimatedIcon from '../../common/AnimatedIcon';\nimport DeleteMemberModal from '../../right/DeleteMemberModal';\n\nimport './GroupCallParticipantMenu.scss';\n\nconst SPEAKER_ICON_DISABLED_SEGMENT: [number, number] = [0, 17];\nconst SPEAKER_ICON_ENABLED_SEGMENT: [number, number] = [17, 34];\n\ntype OwnProps = {\n participant?: GroupCallParticipant;\n closeDropdown: VoidFunction;\n isDropdownOpen: boolean;\n anchor?: IAnchorPosition;\n};\n\ntype StateProps = {\n isAdmin: boolean;\n};\n\nconst VOLUME_ZERO = 0;\nconst VOLUME_LOW = 50;\nconst VOLUME_MEDIUM = 100;\nconst VOLUME_NORMAL = 150;\n\nconst VOLUME_CHANGE_THROTTLE = 500;\n\nconst SPEAKER_ICON_SIZE = 24;\n\nconst GroupCallParticipantMenu: FC<OwnProps & StateProps> = ({\n participant,\n closeDropdown,\n isDropdownOpen,\n anchor,\n isAdmin,\n}) => {\n const {\n toggleGroupCallMute,\n setGroupCallParticipantVolume,\n toggleGroupCallPanel,\n openChat,\n requestToSpeak,\n } = getActions();\n\n const lang = useLang();\n const [isDeleteUserModalOpen, openDeleteUserModal, closeDeleteUserModal] = useFlag();\n\n const id = participant?.id;\n const {\n isMutedByMe, isMuted, isSelf, canSelfUnmute,\n } = participant || {};\n const isRaiseHand = Boolean(participant?.raiseHandRating);\n const shouldRaiseHand = !canSelfUnmute && isMuted;\n\n const [localVolume, setLocalVolume] = useState(\n isMutedByMe ? VOLUME_ZERO : ((participant?.volume || GROUP_CALL_DEFAULT_VOLUME) / GROUP_CALL_VOLUME_MULTIPLIER),\n );\n\n useEffect(() => {\n setLocalVolume(isMutedByMe\n ? VOLUME_ZERO\n : ((participant?.volume || GROUP_CALL_DEFAULT_VOLUME) / GROUP_CALL_VOLUME_MULTIPLIER));\n // We only want to initialize local volume when switching participants and ignore following updates from server\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [id]);\n\n const runThrottled = useThrottle(VOLUME_CHANGE_THROTTLE);\n\n const handleRemove = useCallback((e: React.SyntheticEvent<any>) => {\n e.stopPropagation();\n openDeleteUserModal();\n closeDropdown();\n }, [openDeleteUserModal, closeDropdown]);\n\n const handleCancelRequestToSpeak = useCallback((e: React.SyntheticEvent<any>) => {\n e.stopPropagation();\n requestToSpeak({\n value: false,\n });\n closeDropdown();\n }, [requestToSpeak, closeDropdown]);\n\n const handleMute = useCallback((e: React.SyntheticEvent<any>) => {\n e.stopPropagation();\n closeDropdown();\n\n if (!isAdmin) {\n setLocalVolume(isMutedByMe ? GROUP_CALL_DEFAULT_VOLUME / GROUP_CALL_VOLUME_MULTIPLIER : VOLUME_ZERO);\n }\n\n toggleGroupCallMute({\n participantId: id,\n value: isAdmin ? !shouldRaiseHand : !isMutedByMe,\n });\n }, [closeDropdown, toggleGroupCallMute, id, isAdmin, shouldRaiseHand, isMutedByMe]);\n\n const handleOpenProfile = useCallback((e: React.SyntheticEvent<any>) => {\n e.stopPropagation();\n toggleGroupCallPanel();\n openChat({\n id,\n });\n closeDropdown();\n }, [toggleGroupCallPanel, closeDropdown, openChat, id]);\n\n const isLocalVolumeZero = localVolume === VOLUME_ZERO;\n const speakerIconPlaySegment = isLocalVolumeZero ? SPEAKER_ICON_DISABLED_SEGMENT : SPEAKER_ICON_ENABLED_SEGMENT;\n\n const handleChangeVolume = (e: React.ChangeEvent<HTMLInputElement>) => {\n const value = Number(e.target.value);\n setLocalVolume(value);\n runThrottled(() => {\n if (value === VOLUME_ZERO) {\n toggleGroupCallMute({\n participantId: id,\n value: true,\n });\n } else {\n setGroupCallParticipantVolume({\n participantId: id,\n volume: Math.floor(value * GROUP_CALL_VOLUME_MULTIPLIER),\n });\n }\n });\n };\n\n return (\n <div>\n <Menu\n isOpen={isDropdownOpen}\n positionX=\"right\"\n autoClose\n style={anchor ? `right: 1rem; top: ${anchor.y}px;` : undefined}\n onClose={closeDropdown}\n className=\"participant-menu\"\n >\n {!isSelf && !shouldRaiseHand && (\n <div className=\"group\">\n <div className={buildClassName(\n 'volume-control',\n localVolume < VOLUME_LOW && 'low',\n localVolume >= VOLUME_LOW && localVolume < VOLUME_MEDIUM && 'medium',\n localVolume >= VOLUME_MEDIUM && localVolume < VOLUME_NORMAL && 'normal',\n localVolume >= VOLUME_NORMAL && 'high',\n )}\n >\n <input\n type=\"range\"\n min=\"0\"\n max=\"200\"\n value={localVolume}\n onChange={handleChangeVolume}\n />\n <div className=\"info\">\n <AnimatedIcon\n name=\"Speaker\"\n playSegment={speakerIconPlaySegment}\n size={SPEAKER_ICON_SIZE}\n />\n <span>{localVolume}%</span>\n </div>\n </div>\n </div>\n )}\n <div className=\"group\">\n {(isRaiseHand && isSelf) && (\n <MenuItem\n icon=\"stop-raising-hand\"\n onClick={handleCancelRequestToSpeak}\n >\n {lang('VoipGroupCancelRaiseHand')}\n </MenuItem>\n )}\n {!isSelf && <MenuItem icon=\"user\" onClick={handleOpenProfile}>{lang('VoipGroupOpenProfile')}</MenuItem>}\n {!isSelf && (\n // TODO cross mic\n <MenuItem\n icon={isMuted ? (isAdmin ? 'allow-speak' : 'microphone-alt') : 'microphone-alt'}\n onClick={handleMute}\n >\n {isAdmin\n ? lang(shouldRaiseHand ? 'VoipGroupAllowToSpeak' : 'VoipMute')\n : lang(isMutedByMe ? 'VoipGroupUnmuteForMe' : 'VoipGroupMuteForMe')}\n </MenuItem>\n )}\n {!isSelf && isAdmin && (\n // TODO replace with hand\n <MenuItem icon=\"delete-user\" destructive onClick={handleRemove}>\n {lang('VoipGroupUserRemove')}\n </MenuItem>\n )}\n </div>\n </Menu>\n\n {!isSelf && isAdmin && (\n <DeleteMemberModal\n isOpen={isDeleteUserModalOpen}\n userId={id}\n onClose={closeDeleteUserModal}\n />\n )}\n </div>\n );\n};\n\nexport default memo(withGlobal<OwnProps>(\n (global): StateProps => {\n return {\n isAdmin: selectIsAdminInActiveGroupCall(global),\n };\n },\n)(GroupCallParticipantMenu));\n","import { useMemo } from '../lib/teact/teact';\n\nimport { throttle } from '../util/schedulers';\n\nconst useThrottle = (ms: number, noFirst = false) => {\n return useMemo(() => {\n return throttle((cb) => cb(), ms, !noFirst);\n }, [ms, noFirst]);\n};\n\nexport default useThrottle;\n","import { GroupCallParticipant, THRESHOLD } from '../../../lib/secret-sauce';\nimport React, { FC, memo, useMemo } from '../../../lib/teact/teact';\nimport AnimatedIcon from '../../common/AnimatedIcon';\nimport usePrevious from '../../../hooks/usePrevious';\n\ntype OwnProps = {\n participant: GroupCallParticipant;\n noColor?: boolean;\n};\n\nconst OutlinedMicrophoneIcon: FC<OwnProps> = ({\n participant,\n noColor,\n}) => {\n const { isMuted, isMutedByMe } = participant;\n const isSpeaking = (participant.amplitude || 0) > THRESHOLD;\n const isRaiseHand = Boolean(participant.raiseHandRating);\n const prevIsRaiseHand = usePrevious(isRaiseHand);\n const canSelfUnmute = Boolean(participant?.canSelfUnmute);\n const shouldRaiseHand = !canSelfUnmute && isMuted;\n const prevIsMuted = usePrevious(isMuted);\n\n const playSegment: [number, number] = useMemo(() => {\n if (isMuted && !prevIsMuted) {\n return [43, 64];\n }\n\n if (!isMuted && prevIsMuted) {\n return [22, 42];\n }\n\n if (isRaiseHand && !prevIsRaiseHand) {\n return [65, 84];\n }\n\n if (!shouldRaiseHand && prevIsRaiseHand) {\n return [0, 21];\n }\n\n // TODO cancel request to speak should play in reverse\n // if (!isRaiseHand && prevIsRaiseHand) {\n // return [84, 65];\n // }\n\n return isMuted ? [22, 23] : [43, 44];\n // eslint-disable-next-line\n }, [isMuted, shouldRaiseHand, isRaiseHand]);\n\n const microphoneColor: [number, number, number] | undefined = useMemo(() => {\n return noColor ? [0xff, 0xff, 0xff] : (\n isRaiseHand ? [0x4d, 0xa6, 0xe0]\n : (shouldRaiseHand || isMutedByMe ? [0xFF, 0x70, 0x6F] : (\n isSpeaking ? [0x57, 0xBC, 0x6C] : [0x84, 0x8D, 0x94]\n ))\n );\n }, [noColor, isRaiseHand, shouldRaiseHand, isMutedByMe, isSpeaking]);\n\n return (\n <AnimatedIcon\n name=\"VoiceOutlined\"\n playSegment={playSegment}\n size={28}\n color={microphoneColor}\n />\n );\n};\n\nexport default memo(OutlinedMicrophoneIcon);\n","import { GroupCallParticipant as TypeGroupCallParticipant, THRESHOLD } from '../../../lib/secret-sauce';\nimport React, {\n FC, memo, useMemo, useRef,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../global';\n\nimport { ApiChat, ApiUser } from '../../../api/types';\n\nimport buildClassName from '../../../util/buildClassName';\nimport { selectChat, selectUser } from '../../../global/selectors';\nimport useLang from '../../../hooks/useLang';\nimport { GROUP_CALL_DEFAULT_VOLUME, GROUP_CALL_VOLUME_MULTIPLIER } from '../../../config';\n\nimport Avatar from '../../common/Avatar';\nimport OutlinedMicrophoneIcon from './OutlinedMicrophoneIcon';\n\nimport './GroupCallParticipant.scss';\n\ntype OwnProps = {\n participant: TypeGroupCallParticipant;\n openParticipantMenu: (anchor: HTMLDivElement, participant: TypeGroupCallParticipant) => void;\n};\n\ntype StateProps = {\n user?: ApiUser;\n chat?: ApiChat;\n};\n\nconst GroupCallParticipant: FC<OwnProps & StateProps> = ({\n openParticipantMenu,\n participant,\n user,\n chat,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const anchorRef = useRef<HTMLDivElement>(null);\n const lang = useLang();\n\n const { isSelf, isMutedByMe, isMuted } = participant;\n const isSpeaking = (participant.amplitude || 0) > THRESHOLD;\n const isRaiseHand = Boolean(participant.raiseHandRating);\n\n const handleOnClick = () => {\n if (isSelf) return;\n openParticipantMenu(anchorRef.current!, participant);\n };\n\n const [aboutText, aboutColor] = useMemo(() => {\n if (isSelf) {\n return [lang('ThisIsYou'), 'blue'];\n }\n if (isMutedByMe) {\n return [lang('VoipGroupMutedForMe'), 'red'];\n }\n return isRaiseHand\n ? [lang('WantsToSpeak'), 'blue']\n : (!isMuted && isSpeaking ? [\n participant.volume && participant.volume !== GROUP_CALL_DEFAULT_VOLUME\n ? lang('SpeakingWithVolume',\n (participant.volume / GROUP_CALL_VOLUME_MULTIPLIER).toString())\n .replace('%%', '%') : lang('Speaking'),\n 'green',\n ]\n : (participant.about ? [participant.about, ''] : [lang('Listening'), 'blue']));\n }, [isSpeaking, participant.volume, lang, isSelf, isMutedByMe, isRaiseHand, isMuted, participant.about]);\n\n if (!user && !chat) {\n return undefined;\n }\n\n const name = user ? `${user.firstName || ''} ${user.lastName || ''}` : chat?.title;\n\n return (\n <div\n className={buildClassName(\n 'GroupCallParticipant',\n participant.canSelfUnmute && 'can-self-unmute',\n )}\n onClick={handleOnClick}\n ref={anchorRef}\n >\n <Avatar user={user} chat={chat} size=\"medium\" />\n <div className=\"info\">\n <span className=\"name\">{name}</span>\n <span className={buildClassName('about', aboutColor)}>{aboutText}</span>\n </div>\n <div className=\"microphone\">\n <OutlinedMicrophoneIcon participant={participant} />\n </div>\n </div>\n );\n};\n\nexport default memo(withGlobal<OwnProps>(\n (global, { participant }): StateProps => {\n return {\n user: participant.isUser ? selectUser(global, participant.id) : undefined,\n chat: !participant.isUser ? selectChat(global, participant.id) : undefined,\n };\n },\n)(GroupCallParticipant));\n","import { GroupCallParticipant as TypeGroupCallParticipant } from '../../../lib/secret-sauce';\nimport React, { FC, memo, useMemo } from '../../../lib/teact/teact';\nimport { getActions, withGlobal } from '../../../global';\n\nimport useLang from '../../../hooks/useLang';\nimport { selectActiveGroupCall } from '../../../global/selectors/calls';\nimport useInfiniteScroll from '../../../hooks/useInfiniteScroll';\n\nimport GroupCallParticipant from './GroupCallParticipant';\nimport InfiniteScroll from '../../ui/InfiniteScroll';\n\ntype OwnProps = {\n openParticipantMenu: (anchor: HTMLDivElement, participant: TypeGroupCallParticipant) => void;\n};\n\ntype StateProps = {\n participantsCount: number;\n participants?: Record<string, TypeGroupCallParticipant>;\n canInvite?: boolean;\n};\n\nconst GroupCallParticipantList: FC<OwnProps & StateProps> = ({\n participants,\n participantsCount,\n openParticipantMenu,\n}) => {\n const {\n createGroupCallInviteLink,\n loadMoreGroupCallParticipants,\n } = getActions();\n\n const lang = useLang();\n\n const participantsIds = useMemo(() => {\n return Object.keys(participants || {});\n }, [participants]);\n\n const [viewportIds, getMore] = useInfiniteScroll(\n loadMoreGroupCallParticipants,\n participantsIds,\n participantsIds.length >= participantsCount,\n );\n\n return (\n <div className=\"participants\">\n <div className=\"invite-btn\" onClick={createGroupCallInviteLink}>\n <div className=\"icon\">\n <i className=\"icon-add-user\" />\n </div>\n <div className=\"text\">{lang('VoipGroupInviteMember')}</div>\n </div>\n\n <InfiniteScroll\n items={viewportIds}\n onLoadMore={getMore}\n >\n {viewportIds?.map(\n (participantId) => (\n participants![participantId] && (\n <GroupCallParticipant\n key={participantId}\n openParticipantMenu={openParticipantMenu}\n participant={participants![participantId]}\n />\n )\n ),\n )}\n </InfiniteScroll>\n\n </div>\n );\n};\n\nexport default memo(withGlobal<OwnProps>(\n (global): StateProps => {\n const { participantsCount, participants } = selectActiveGroupCall(global) || {};\n\n return {\n participants,\n participantsCount: participantsCount || 0,\n };\n },\n)(GroupCallParticipantList));\n","import { getUserStreams, GroupCallParticipant as TypeGroupCallParticipant, THRESHOLD } from '../../../lib/secret-sauce';\nimport React, { FC, memo, useCallback } from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../global';\n\nimport { ApiChat, ApiUser } from '../../../api/types';\n\nimport buildClassName from '../../../util/buildClassName';\nimport { selectChat, selectUser } from '../../../global/selectors';\nimport useLang from '../../../hooks/useLang';\nimport { ENABLE_THUMBNAIL_VIDEO } from '../../../config';\n\nimport Avatar from '../../common/Avatar';\n\nimport './GroupCallParticipantVideo.scss';\n\ntype OwnProps = {\n participant: TypeGroupCallParticipant;\n type: 'video' | 'presentation';\n onClick?: (id: string, type: 'video' | 'presentation') => void;\n isFullscreen?: boolean;\n};\n\ntype StateProps = {\n user?: ApiUser;\n chat?: ApiChat;\n currentUserId?: string;\n isActive?: boolean;\n};\n\nconst GroupCallParticipantVideo: FC<OwnProps & StateProps> = ({\n type,\n onClick,\n user,\n chat,\n isActive,\n isFullscreen,\n}) => {\n const lang = useLang();\n\n const handleClick = useCallback(() => {\n if (onClick) {\n onClick(user?.id || chat!.id, type);\n }\n }, [chat, onClick, type, user?.id]);\n\n if (!user && !chat) return undefined;\n\n const streams = getUserStreams(user?.id || chat!.id);\n\n return (\n <div\n className={buildClassName('GroupCallParticipantVideo', isActive && 'active')}\n onClick={handleClick}\n >\n {isFullscreen && (\n <button className=\"back-button\">\n <i className=\"icon-arrow-left\" />\n {lang('Back')}\n </button>\n )}\n <Avatar user={user} chat={chat} className=\"thumbnail-avatar\" />\n {ENABLE_THUMBNAIL_VIDEO && (\n <div className=\"thumbnail-wrapper\">\n <video className=\"thumbnail\" muted autoPlay playsInline srcObject={streams?.[type]} />\n </div>\n )}\n <video className=\"video\" muted autoPlay playsInline srcObject={streams?.[type]} />\n <div className=\"info\">\n <i className=\"icon-microphone-alt\" />\n <span className=\"name\">{user?.firstName || chat?.title}</span>\n {type === 'presentation' && <i className=\"last-icon icon-active-sessions\" />}\n </div>\n </div>\n );\n};\n\nexport default memo(withGlobal<OwnProps>(\n (global, { participant }): StateProps => {\n return {\n currentUserId: global.currentUserId,\n user: participant.isUser ? selectUser(global, participant.id) : undefined,\n chat: !participant.isUser ? selectChat(global, participant.id) : undefined,\n isActive: (participant.amplitude || 0) > THRESHOLD,\n };\n },\n)(GroupCallParticipantVideo));\n","import { GroupCallParticipant } from '../../../lib/secret-sauce';\nimport React, {\n FC, memo, useCallback, useMemo, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../global';\nimport GroupCallParticipantVideo from './GroupCallParticipantVideo';\nimport { selectActiveGroupCall } from '../../../global/selectors/calls';\nimport buildClassName from '../../../util/buildClassName';\n\ntype OwnProps = {\n onDoubleClick?: VoidFunction;\n};\n\ntype StateProps = {\n participants?: Record<string, GroupCallParticipant>;\n};\n\ntype SelectedVideo = {\n type: 'video' | 'presentation';\n id: string;\n};\n\nconst GroupCallParticipantStreams: FC<OwnProps & StateProps> = ({\n participants,\n onDoubleClick,\n}) => {\n const [selectedVideo, setSelectedVideo] = useState<SelectedVideo | undefined>(undefined);\n const presentationParticipants = useMemo(() => {\n return Object.values(participants || {}).filter((l) => l.hasPresentationStream);\n }, [participants]);\n const videoParticipants = useMemo(() => {\n return Object.values(participants || {}).filter((l) => l.hasVideoStream);\n }, [participants]);\n\n const totalVideoCount = videoParticipants.length + presentationParticipants.length;\n // TODO replace with more adequate solution.\n // There's a max of 30 videos or so right now\n const columnCount = totalVideoCount <= 2 ? 1 : (\n totalVideoCount <= 6 ? 2 : (\n totalVideoCount <= 9 ? 3 : 4\n )\n );\n\n const shouldSpanLastVideo = totalVideoCount === 3 || (columnCount === 2 && totalVideoCount % 2 !== 0);\n\n const handleClickVideo = useCallback((id: string, type: 'video' | 'presentation') => {\n if (!selectedVideo || (id !== selectedVideo.id || type !== selectedVideo.type)) {\n setSelectedVideo({\n id,\n type,\n });\n } else {\n setSelectedVideo(undefined);\n }\n }, [selectedVideo]);\n\n return (\n <div className=\"streams\" onDoubleClick={onDoubleClick}>\n <div\n className={buildClassName(\n 'videos',\n shouldSpanLastVideo && 'span-last-video',\n )}\n style={`--column-count: ${selectedVideo ? 1 : columnCount}`}\n >\n {selectedVideo && (\n <GroupCallParticipantVideo\n key={selectedVideo.id}\n isFullscreen\n onClick={handleClickVideo}\n participant={participants![selectedVideo.id]}\n type={selectedVideo.type}\n />\n )}\n\n {!selectedVideo ? presentationParticipants.map((participant) => (\n <GroupCallParticipantVideo\n key={participant.id}\n onClick={handleClickVideo}\n participant={participant}\n type=\"presentation\"\n />\n )) : undefined}\n {!selectedVideo ? videoParticipants.map((participant) => (\n <GroupCallParticipantVideo\n key={participant.id}\n onClick={handleClickVideo}\n participant={participant}\n type=\"video\"\n />\n )) : undefined}\n </div>\n </div>\n );\n};\n\nexport default memo(withGlobal<OwnProps>(\n (global): StateProps => {\n const { participants } = selectActiveGroupCall(global) || {};\n return {\n participants,\n };\n },\n)(GroupCallParticipantStreams));\n","import {\n GroupCallConnectionState, GroupCallParticipant as TypeGroupCallParticipant,\n IS_SCREENSHARE_SUPPORTED, switchCameraInput, toggleSpeaker,\n} from '../../../lib/secret-sauce';\nimport React, {\n FC, memo, useCallback, useEffect, useMemo, useRef, useState,\n} from '../../../lib/teact/teact';\nimport { getActions, withGlobal } from '../../../global';\nimport '../../../global/actions/calls';\n\nimport { IAnchorPosition } from '../../../types';\n\nimport {\n IS_ANDROID,\n IS_IOS,\n IS_REQUEST_FULLSCREEN_SUPPORTED,\n IS_SINGLE_COLUMN_LAYOUT,\n} from '../../../util/environment';\nimport buildClassName from '../../../util/buildClassName';\nimport {\n selectGroupCall,\n selectGroupCallParticipant,\n selectIsAdminInActiveGroupCall,\n} from '../../../global/selectors/calls';\nimport useFlag from '../../../hooks/useFlag';\nimport useLang from '../../../hooks/useLang';\n\nimport Loading from '../../ui/Loading';\nimport Button from '../../ui/Button';\nimport DropdownMenu from '../../ui/DropdownMenu';\nimport MenuItem from '../../ui/MenuItem';\nimport Modal from '../../ui/Modal';\nimport MicrophoneButton from './MicrophoneButton';\nimport AnimatedIcon from '../../common/AnimatedIcon';\nimport Checkbox from '../../ui/Checkbox';\nimport GroupCallParticipantMenu from './GroupCallParticipantMenu';\nimport GroupCallParticipantList from './GroupCallParticipantList';\nimport GroupCallParticipantStreams from './GroupCallParticipantStreams';\n\nimport './GroupCall.scss';\n\nconst CAMERA_FLIP_PLAY_SEGMENT: [number, number] = [0, 10];\nconst PARTICIPANT_HEIGHT = 60;\n\nexport type OwnProps = {\n groupCallId: string;\n};\n\ntype StateProps = {\n isGroupCallPanelHidden: boolean;\n connectionState: GroupCallConnectionState;\n title?: string;\n meParticipant?: TypeGroupCallParticipant;\n participantsCount?: number;\n isSpeakerEnabled?: boolean;\n isAdmin: boolean;\n participants: Record<string, TypeGroupCallParticipant>;\n};\n\nconst GroupCall: FC<OwnProps & StateProps> = ({\n groupCallId,\n isGroupCallPanelHidden,\n connectionState,\n isSpeakerEnabled,\n title,\n meParticipant,\n isAdmin,\n participants,\n\n}) => {\n const {\n toggleGroupCallVideo,\n toggleGroupCallPresentation,\n leaveGroupCall,\n toggleGroupCallPanel,\n connectToActiveGroupCall,\n playGroupCallSound,\n } = getActions();\n\n const lang = useLang();\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef<HTMLDivElement>(null);\n\n const [isLeaving, setIsLeaving] = useState(false);\n const [isFullscreen, openFullscreen, closeFullscreen] = useFlag();\n const [isSidebarOpen, openSidebar, closeSidebar] = useFlag(true);\n const hasVideoParticipants = participants && Object.values(participants).some((l) => l.video || l.presentation);\n const isLandscape = isFullscreen && !IS_SINGLE_COLUMN_LAYOUT && hasVideoParticipants;\n\n const [participantMenu, setParticipantMenu] = useState<{\n participant: TypeGroupCallParticipant;\n anchor: IAnchorPosition;\n } | undefined>();\n const [isParticipantMenuOpen, openParticipantMenu, closeParticipantMenu] = useFlag();\n\n const [isConfirmLeaveModalOpen, openConfirmLeaveModal, closeConfirmLeaveModal] = useFlag();\n const [isEndGroupCallModal, setIsEndGroupCallModal] = useState(false);\n const [shouldEndGroupCall, setShouldEndGroupCall] = useState(false);\n\n const hasVideo = meParticipant?.hasVideoStream;\n const hasPresentation = meParticipant?.hasPresentationStream;\n const isConnecting = connectionState !== 'connected';\n const canSelfUnmute = meParticipant?.canSelfUnmute;\n const shouldRaiseHand = !canSelfUnmute && meParticipant?.isMuted;\n\n const handleOpenParticipantMenu = useCallback((anchor: HTMLDivElement, participant: TypeGroupCallParticipant) => {\n const rect = anchor.getBoundingClientRect();\n const container = containerRef.current!;\n\n setParticipantMenu({\n anchor: { x: rect.left, y: rect.top - container.offsetTop + PARTICIPANT_HEIGHT },\n participant,\n });\n\n openParticipantMenu();\n }, [openParticipantMenu]);\n\n useEffect(() => {\n if (connectionState === 'connected') {\n playGroupCallSound({ sound: 'join' });\n } else if (connectionState === 'reconnecting') {\n playGroupCallSound({ sound: 'connecting' });\n }\n }, [connectionState, playGroupCallSound]);\n\n const handleCloseConfirmLeaveModal = useCallback(() => {\n closeConfirmLeaveModal();\n setIsEndGroupCallModal(false);\n }, [closeConfirmLeaveModal]);\n\n const MainButton: FC<{ onTrigger: () => void; isOpen?: boolean }> = useMemo(() => {\n return ({ onTrigger, isOpen }) => (\n <Button\n round\n size=\"smaller\"\n color=\"translucent\"\n className={isOpen ? 'active' : undefined}\n onClick={onTrigger}\n ariaLabel={lang('AccDescrMoreOptions')}\n >\n <i className=\"icon-more\" />\n </Button>\n );\n }, [lang]);\n\n const handleToggleFullscreen = useCallback(() => {\n if (!containerRef.current) return;\n\n if (isFullscreen) {\n document.exitFullscreen().then(closeFullscreen);\n } else {\n containerRef.current.requestFullscreen().then(openFullscreen);\n }\n }, [closeFullscreen, isFullscreen, openFullscreen]);\n\n const handleToggleSidebar = useCallback(() => {\n if (isSidebarOpen) {\n closeSidebar();\n } else {\n openSidebar();\n }\n }, [closeSidebar, isSidebarOpen, openSidebar]);\n\n const handleStreamsDoubleClick = useCallback(() => {\n if (!IS_REQUEST_FULLSCREEN_SUPPORTED) return;\n\n if (!isFullscreen) {\n closeSidebar();\n handleToggleFullscreen();\n } else {\n handleToggleFullscreen();\n }\n }, [closeSidebar, handleToggleFullscreen, isFullscreen]);\n\n const toggleFullscreen = useCallback(() => {\n if (isFullscreen) {\n closeFullscreen();\n } else {\n openFullscreen();\n }\n }, [closeFullscreen, isFullscreen, openFullscreen]);\n\n const handleClose = useCallback(() => {\n toggleGroupCallPanel();\n if (isFullscreen) {\n closeFullscreen();\n }\n }, [closeFullscreen, isFullscreen, toggleGroupCallPanel]);\n\n useEffect(() => {\n if (!IS_REQUEST_FULLSCREEN_SUPPORTED) return undefined;\n const container = containerRef.current;\n if (!container) return undefined;\n\n container.addEventListener('fullscreenchange', toggleFullscreen);\n\n return () => {\n container.removeEventListener('fullscreenchange', toggleFullscreen);\n };\n }, [toggleFullscreen]);\n\n const handleClickVideoOrSpeaker = () => {\n if (shouldRaiseHand) {\n toggleSpeaker();\n } else {\n toggleGroupCallVideo();\n }\n };\n\n useEffect(() => {\n connectToActiveGroupCall();\n }, [connectToActiveGroupCall, groupCallId]);\n\n const endGroupCall = useCallback(() => {\n setIsEndGroupCallModal(true);\n setShouldEndGroupCall(true);\n openConfirmLeaveModal();\n if (isFullscreen) {\n handleToggleFullscreen();\n }\n }, [handleToggleFullscreen, isFullscreen, openConfirmLeaveModal]);\n\n const handleLeaveGroupCall = useCallback(() => {\n if (isAdmin && !isConfirmLeaveModalOpen) {\n openConfirmLeaveModal();\n if (isFullscreen) {\n handleToggleFullscreen();\n }\n return;\n }\n playGroupCallSound({ sound: 'leave' });\n setIsLeaving(true);\n closeConfirmLeaveModal();\n }, [\n closeConfirmLeaveModal, handleToggleFullscreen, isAdmin, isConfirmLeaveModalOpen, isFullscreen,\n openConfirmLeaveModal, playGroupCallSound,\n ]);\n\n const handleCloseAnimationEnd = useCallback(() => {\n if (isLeaving) {\n leaveGroupCall({\n shouldDiscard: shouldEndGroupCall,\n });\n }\n }, [isLeaving, leaveGroupCall, shouldEndGroupCall]);\n\n return (\n <Modal\n isOpen={!isGroupCallPanelHidden && !isLeaving}\n onClose={toggleGroupCallPanel}\n className={buildClassName(\n 'GroupCall',\n IS_SINGLE_COLUMN_LAYOUT && 'single-column',\n isLandscape && 'landscape',\n !isSidebarOpen && 'no-sidebar',\n )}\n dialogRef={containerRef}\n onCloseAnimationEnd={handleCloseAnimationEnd}\n >\n <div className=\"header\">\n <h3>{title || lang('VoipGroupVoiceChat')}</h3>\n {IS_REQUEST_FULLSCREEN_SUPPORTED && (\n <Button\n round\n size=\"smaller\"\n color=\"translucent\"\n onClick={handleToggleFullscreen}\n ariaLabel={lang(isFullscreen ? 'AccExitFullscreen' : 'AccSwitchToFullscreen')}\n >\n <i className={isFullscreen ? 'icon-smallscreen' : 'icon-fullscreen'} />\n </Button>\n )}\n {isLandscape && (\n <Button\n round\n size=\"smaller\"\n color=\"translucent\"\n onClick={handleToggleSidebar}\n >\n <i className=\"icon-sidebar\" />\n </Button>\n )}\n {((IS_SCREENSHARE_SUPPORTED && !shouldRaiseHand) || isAdmin) && (\n <DropdownMenu\n positionX=\"right\"\n trigger={MainButton}\n >\n {IS_SCREENSHARE_SUPPORTED && !shouldRaiseHand && (\n <MenuItem\n icon=\"share-screen\"\n onClick={toggleGroupCallPresentation}\n >\n {lang(hasPresentation ? 'VoipChatStopScreenCapture' : 'VoipChatStartScreenCapture')}\n </MenuItem>\n )}\n {isAdmin && (\n <MenuItem\n icon=\"phone-discard-outline\"\n onClick={endGroupCall}\n destructive\n >\n {lang('VoipGroupLeaveAlertEndChat')}\n </MenuItem>\n )}\n </DropdownMenu>\n )}\n <Button\n round\n size=\"smaller\"\n color=\"translucent\"\n onClick={handleClose}\n >\n <i className=\"icon-close\" />\n </Button>\n </div>\n\n <div className=\"scrollable custom-scroll\">\n <GroupCallParticipantStreams onDoubleClick={handleStreamsDoubleClick} />\n\n {(!isLandscape || isSidebarOpen)\n && <GroupCallParticipantList openParticipantMenu={handleOpenParticipantMenu} />}\n </div>\n\n <GroupCallParticipantMenu\n participant={participantMenu?.participant}\n anchor={participantMenu?.anchor}\n isDropdownOpen={isParticipantMenuOpen}\n closeDropdown={closeParticipantMenu}\n />\n\n <div className=\"buttons\">\n {isConnecting && <Loading />}\n\n <div className=\"button-wrapper\">\n <div className=\"video-buttons\">\n {hasVideo && (IS_ANDROID || IS_IOS) && (\n <button className=\"smaller-button\" onClick={switchCameraInput}>\n <AnimatedIcon name=\"CameraFlip\" playSegment={CAMERA_FLIP_PLAY_SEGMENT} size={24} />\n </button>\n )}\n <button\n className={buildClassName(\n 'small-button',\n shouldRaiseHand ? 'speaker' : 'camera',\n (hasVideo || (shouldRaiseHand && isSpeakerEnabled)) && 'active',\n )}\n onClick={handleClickVideoOrSpeaker}\n >\n <i className={shouldRaiseHand ? 'icon-speaker' : (hasVideo ? 'icon-video-stop' : 'icon-video')} />\n </button>\n </div>\n\n <div className=\"button-text\">\n {lang(shouldRaiseHand ? 'VoipSpeaker' : 'VoipCamera')}\n </div>\n </div>\n\n <MicrophoneButton />\n\n <div className=\"button-wrapper\">\n <button className=\"small-button leave\" onClick={handleLeaveGroupCall}>\n <i className=\"icon-phone-discard\" />\n </button>\n\n <div className=\"button-text\">\n {lang('VoipGroupLeave')}\n </div>\n </div>\n </div>\n\n <Modal\n isOpen={isConfirmLeaveModalOpen}\n onClose={handleCloseConfirmLeaveModal}\n className=\"error\"\n title={lang(isEndGroupCallModal ? 'VoipGroupEndAlertTitle' : 'VoipGroupLeaveAlertTitle')}\n >\n <p>{lang(isEndGroupCallModal ? 'VoipGroupEndAlertText' : 'VoipGroupLeaveAlertText')}</p>\n {!isEndGroupCallModal && (\n <Checkbox\n label={lang('VoipGroupEndChat')}\n checked={shouldEndGroupCall}\n onCheck={setShouldEndGroupCall}\n />\n )}\n <Button isText className=\"confirm-dialog-button\" onClick={handleLeaveGroupCall}>\n {lang(isEndGroupCallModal ? 'VoipGroupEnd' : 'VoipGroupLeave')}\n </Button>\n <Button isText className=\"confirm-dialog-button\" onClick={handleCloseConfirmLeaveModal}>\n {lang('Cancel')}\n </Button>\n </Modal>\n </Modal>\n );\n};\n\nexport default memo(withGlobal<OwnProps>(\n (global, { groupCallId }): StateProps => {\n const {\n connectionState, title, isSpeakerDisabled, participants, participantsCount,\n } = selectGroupCall(global, groupCallId)! || {};\n\n return {\n connectionState,\n title,\n isSpeakerEnabled: !isSpeakerDisabled,\n participantsCount,\n meParticipant: selectGroupCallParticipant(global, groupCallId, global.currentUserId!),\n isGroupCallPanelHidden: Boolean(global.groupCalls.isGroupCallPanelHidden),\n isAdmin: selectIsAdminInActiveGroupCall(global),\n participants,\n };\n },\n)(GroupCall));\n","import { GroupCallParticipant } from '../../lib/secret-sauce';\nimport React, {\n FC, memo, useEffect,\n} from '../../lib/teact/teact';\nimport { getActions, withGlobal } from '../../global';\n\nimport { ApiGroupCall } from '../../api/types';\n\nimport { selectActiveGroupCall, selectGroupCallParticipant } from '../../global/selectors/calls';\nimport buildClassName from '../../util/buildClassName';\nimport useLang from '../../hooks/useLang';\n\nimport './ActiveCallHeader.scss';\n\ntype StateProps = {\n isGroupCallPanelHidden?: boolean;\n meParticipant: GroupCallParticipant;\n groupCall?: ApiGroupCall;\n};\n\nconst ActiveCallHeader: FC<StateProps> = ({\n groupCall,\n meParticipant,\n isGroupCallPanelHidden,\n}) => {\n const { toggleGroupCallPanel } = getActions();\n\n const lang = useLang();\n\n useEffect(() => {\n document.body.classList.toggle('has-group-call-header', isGroupCallPanelHidden);\n\n return () => {\n document.body.classList.toggle('has-group-call-header', false);\n };\n }, [isGroupCallPanelHidden]);\n\n if (!groupCall || !meParticipant) return undefined;\n\n return (\n <div\n className={buildClassName(\n 'ActiveCallHeader',\n isGroupCallPanelHidden && 'open',\n )}\n onClick={toggleGroupCallPanel}\n >\n <span className=\"title\">{groupCall.title || lang('VoipGroupVoiceChat')}</span>\n </div>\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n return {\n groupCall: selectActiveGroupCall(global),\n isGroupCallPanelHidden: global.groupCalls.isGroupCallPanelHidden,\n meParticipant: selectGroupCallParticipant(global, global.groupCalls.activeGroupCallId!, global.currentUserId!),\n };\n },\n)(ActiveCallHeader));\n","import React, {\n FC, memo, useCallback, useState,\n} from '../../lib/teact/teact';\nimport { getActions, withGlobal } from '../../global';\n\nimport ConfirmDialog from '../ui/ConfirmDialog';\nimport Checkbox from '../ui/Checkbox';\nimport { selectCallFallbackChannelTitle } from '../../global/selectors/calls';\nimport { getUserFullName } from '../../global/helpers';\nimport { selectCurrentMessageList, selectUser } from '../../global/selectors';\nimport useCurrentOrPrev from '../../hooks/useCurrentOrPrev';\n\nexport type OwnProps = {\n isOpen: boolean;\n};\n\ninterface StateProps {\n userFullName?: string;\n channelTitle: string;\n}\n\nconst CallFallbackConfirm: FC<OwnProps & StateProps> = ({\n isOpen,\n channelTitle,\n userFullName,\n}) => {\n const {\n closeCallFallbackConfirm,\n inviteToCallFallback,\n } = getActions();\n\n const [shouldRemove, setShouldRemove] = useState(true);\n const renderingUserFullName = useCurrentOrPrev(userFullName, true);\n\n const handleConfirm = useCallback(() => {\n inviteToCallFallback({ shouldRemove });\n }, [inviteToCallFallback, shouldRemove]);\n\n return (\n <ConfirmDialog\n title=\"Start Call\"\n isOpen={isOpen}\n confirmHandler={handleConfirm}\n onClose={closeCallFallbackConfirm}\n >\n <p>The call will be started in a private channel <b>{channelTitle}</b>.</p>\n <Checkbox\n label={`Remove ${renderingUserFullName} from this channel after the call`}\n checked={shouldRemove}\n onCheck={setShouldRemove}\n />\n </ConfirmDialog>\n );\n};\n\nexport default memo(withGlobal<OwnProps>(\n (global): StateProps => {\n const { chatId } = selectCurrentMessageList(global) || {};\n const user = chatId ? selectUser(global, chatId) : undefined;\n\n return {\n userFullName: user ? getUserFullName(user) : undefined,\n channelTitle: selectCallFallbackChannelTitle(global),\n };\n },\n)(CallFallbackConfirm));\n","/*! For license information please see index.js.LICENSE.txt */\n(()=>{\"use strict\";var e={\"./src/blacksilence.ts\":(e,t,n)=>{n.r(t),n.d(t,{silence:()=>a,black:()=>i});const a=e=>{const t=e.createOscillator(),n=t.connect(e.createMediaStreamDestination());return t.start(),new MediaStream([Object.assign(n.stream.getAudioTracks()[0],{enabled:!1})])},i=({width:e=640,height:t=480}={})=>{const n=Object.assign(document.createElement(\"canvas\"),{width:e,height:t}),a=n.getContext(\"2d\");if(!a)throw Error(\"Cannot create canvas ctx\");a.fillRect(0,0,e,t);const i=n.captureStream();return new MediaStream([Object.assign(i.getVideoTracks()[0],{enabled:!1})])}},\"./src/buildSdp.ts\":(e,t,n)=>{n.r(t),n.d(t,{default:()=>i});var a=n(\"./src/utils.ts\");const i=(e,t=!1,n=!1)=>{const i=[],r=e=>{i.push(e)},{sessionId:s,ssrcs:o,audioExtensions:c,videoExtensions:d,audioPayloadTypes:p,videoPayloadTypes:u,transport:{ufrag:l,pwd:m,fingerprints:f,candidates:g}}=e;r(\"v=0\"),r(`o=- ${s} 2 IN IP4 0.0.0.0`),r(\"s=-\"),r(\"t=0 0\"),r(`a=group:BUNDLE ${o.map((e=>e.endpoint)).join(\" \")}${n?\"\":\" 2\"}`),r(\"a=ice-lite\");const S=e=>{let t=\"\";t+=\"a=candidate:\",t+=`${e.foundation} ${e.component} ${e.protocol} ${e.priority} ${e.ip} ${e.port} typ ${e.type}`,\"rel-addr\"in e&&(t+=` raddr ${e[\"rel-addr\"]} rport ${e[\"rel-port\"]}`),t+=` generation ${e.generation}`,r(t)},v=()=>{r(`a=ice-ufrag:${l}`),r(`a=ice-pwd:${m}`),f.forEach((e=>{r(`a=fingerprint:${e.hash} ${e.fingerprint}`),r(\"a=setup:passive\")})),g.forEach(S)},h=e=>{const{channels:t,id:n,name:a,clockrate:i,parameters:s}=e;var o=t?`/${t}`:\"\";r(`a=rtpmap:${n} ${a}/${i}${o}`),s&&(o=Object.keys(s).map((e=>`${e}=${s[e]};`)).join(\" \"),r(`a=fmtp:${n} ${o}`)),e[\"rtcp-fbs\"]?.forEach((e=>{r(`a=rtcp-fb:${n} ${e.type}${e.subtype?` ${e.subtype}`:\"\"}`)}))};return e=e=>{const n=e.isVideo?u:p;var i=e.isVideo?\"video\":\"audio\";r(`m=${i} ${e.isMain?1:0} RTP/SAVPF ${n.map((e=>e.id)).join(\" \")}`),r(\"c=IN IP4 0.0.0.0\"),r(\"b=AS:1300\"),r(`a=mid:${e.endpoint}`),r(\"a=rtcp-mux\"),n.forEach(h),r(\"a=rtcp:1 IN IP4 0.0.0.0\"),e.isVideo&&r(\"a=rtcp-rsize\"),(e.isVideo?d:c).forEach((({id:e,uri:t})=>{r(`a=extmap:${e} ${t}`)})),e.isRemoved?r(\"a=inactive\"):(v(),t?r(\"a=recvonly\"):(e.isMain?r(\"a=sendrecv\"):(r(\"a=sendonly\"),r(\"a=bundle-only\")),e.sourceGroups.forEach((t=>{r(`a=ssrc-group:${t.semantics} ${t.sources.map(a.fromTelegramSource).join(\" \")}`),t.sources.forEach((t=>{t=(0,a.fromTelegramSource)(t),r(`a=ssrc:${t} cname:${e.endpoint}`),r(`a=ssrc:${t} msid:${e.endpoint} ${e.endpoint}`),r(`a=ssrc:${t} mslabel:${e.endpoint}`),r(`a=ssrc:${t} label:${e.endpoint}`)}))}))))},o.filter((e=>\"0\"===e.endpoint||\"1\"===e.endpoint)).map(e),n||(r(\"m=application 1 UDP/DTLS/SCTP webrtc-datachannel\"),r(\"c=IN IP4 0.0.0.0\"),v(),r(\"a=ice-options:trickle\"),r(\"a=mid:\"+(n?\"1\":\"2\")),r(\"a=sctp-port:5000\"),r(\"a=max-message-size:262144\")),o.filter((e=>\"0\"!==e.endpoint&&\"1\"!==e.endpoint)).map(e),`${i.join(\"\\n\")}\\n`}},\"./src/parseSdp.ts\":(e,t,n)=>{n.r(t),n.d(t,{default:()=>i});var a=n(\"./src/utils.ts\");const i=e=>{if(!e||!e.sdp)throw Error(\"Failed parsing SDP: session description is null\");const t=e.sdp.split(\"\\r\\nm=\").map(((e,t)=>0===t?e:`m=${e}`)).reduce(((e,t)=>(e[t.match(/^m=(.+?)\\s/)?.[1]||\"header\"]=t.split(\"\\r\\n\").filter(Boolean),e)),{});var n=(e,n)=>n?t[n]?.find((t=>t.startsWith(e)))?.substr(e.length):Object.values(t).map((t=>t.find((t=>t.startsWith(e)))?.substr(e.length))).filter(Boolean)[0];const i=n(\"a=ssrc:\",\"audio\");var r=i&&Number(i.split(\" \")[0]);const s=n(\"a=ssrc-group:\",\"video\")?.split(\" \")||void 0;if(!s)throw Error(\"Failed parsing SDP: no video ssrc\");var[o,c]=n(\"a=fingerprint:\")?.split(\" \")||[];if(!o||!c)throw Error(\"Failed parsing SDP: no fingerprint\");if(e=n(\"a=ice-ufrag:\"),n=n(\"a=ice-pwd:\"),!e||!n)throw Error(\"Failed parsing SDP: no ICE ufrag or pwd\");return{fingerprints:[{fingerprint:c,hash:o,setup:\"active\"}],pwd:n,ufrag:e,...r&&{ssrc:(0,a.toTelegramSource)(r)},...s&&{\"ssrc-groups\":[{semantics:s[0],sources:s.slice(1,s.length).map(Number).map(a.toTelegramSource)}]}}}},\"./src/secretsauce.ts\":(e,t,n)=>{n.r(t),n.d(t,{getDevices:()=>async function(e,t=!0){return(await navigator.mediaDevices.enumerateDevices()).filter((n=>n.kind===`${e}${t?\"input\":\"output\"}`))},toggleSpeaker:()=>function(){o&&(o.isSpeakerDisabled=!o.isSpeakerDisabled,o?.onUpdate?.({\"@type\":\"updateGroupCallConnectionState\",connectionState:\"connected\",isSpeakerDisabled:o.isSpeakerDisabled}),o.participantFunctions&&Object.values(o.participantFunctions).forEach((e=>{e.toggleMute?.(!!o?.isSpeakerDisabled)})))},toggleNoiseSuppression:()=>function(){if(o&&o.myId&&o.streams){const n=o.streams[o.myId].audio;if(n){const a=n.getTracks()[0];var e,t;a&&(({echoCancellation:e,noiseSuppression:t}=a.getConstraints()),a.applyConstraints({echoCancellation:!e,noiseSuppression:!t}))}}},getUserStreams:()=>d,setVolume:()=>function(e,t){const n=o?.participantFunctions?.[e];n&&n.setVolume?.(t)},isStreamEnabled:()=>p,switchCameraInput:()=>async function(){if(o?.myId&&o.connection&&o.streams&&o.facingMode){const e=d(o.myId)?.video;if(e){const t=e.getTracks()[0];if(t){const e=o.connection.getSenders().find((e=>t.id===e.track?.id));if(e){o.facingMode=\"environment\"===o.facingMode?\"user\":\"environment\";try{const t=await l(\"video\",o.facingMode);await e.replaceTrack(t.getTracks()[0]),o.streams[o.myId].video=t}catch(e){}}}}}},toggleStream:()=>m,leaveGroupCall:()=>g,handleUpdateGroupCallParticipants:()=>async function(e){if(o){const{participants:a,conference:r,connection:s,myId:c}=o;if(a&&r&&s&&r.ssrcs&&r.transport&&c)if(e.find((e=>e.isSelf&&e.source!==o?.conference?.ssrcs?.find((e=>e.isMain&&!e.isVideo))?.sourceGroups[0].sources[0])))g();else{const a=[];if(e.forEach((e=>{if(e.isSelf)e.isMuted&&!e.canSelfUnmute&&(m(\"audio\",!1),m(\"video\",!1),m(\"presentation\",!1));else{var t=e.isLeft;const n=e.isMuted||e.isMutedByMe,i=!e.isVideoJoined||!e.video||t,s=!e.presentation||t;let o=!1,c=!1,d=!1;r.ssrcs.filter((t=>t.userId===e.id)).forEach((t=>{t.isVideo||(t.sourceGroups[0].sources[0]===e.source&&(c=!0),t.isRemoved=n),t.isVideo&&(t.isPresentation||(e.video&&t.endpoint===e.video.endpoint&&(o=!0),t.isRemoved=i),t.isPresentation&&(e.presentation&&t.endpoint===e.presentation.endpoint&&(d=!0),t.isRemoved=s))})),n||c||r.ssrcs.push({userId:e.id,isMain:!1,endpoint:`audio${e.source}`,isVideo:!1,sourceGroups:[{semantics:\"FID\",sources:[e.source]}]}),i||o||!e.video||(a.push(e.video.endpoint),r.ssrcs.push({userId:e.id,isMain:!1,endpoint:e.video.endpoint,isVideo:!0,sourceGroups:e.video.sourceGroups})),s||d||!e.presentation||r.ssrcs.push({isPresentation:!0,userId:e.id,isMain:!1,endpoint:e.presentation.endpoint,isVideo:!0,sourceGroups:e.presentation.sourceGroups})}})),o.updatingParticipantsQueue)o.updatingParticipantsQueue.push(r);else{o.updatingParticipantsQueue=[],e=(0,i.default)(r),await s.setRemoteDescription({type:\"offer\",sdp:e});try{var t=await s.createAnswer();if(await s.setLocalDescription(t),u(c),0<o.updatingParticipantsQueue.length)for(const e of o.updatingParticipantsQueue){await s.setRemoteDescription({type:\"offer\",sdp:(0,i.default)(e)});var n=await s.createAnswer();await s.setLocalDescription(n),u(c)}o.updatingParticipantsQueue=void 0}catch(e){console.error(e)}}}}},handleUpdateGroupCallConnection:()=>async function(e,t){if(o){var n=t?o.screenshareConference:o.conference;const r=t?o.screenshareConnection:o.connection;if(n&&r&&n.ssrcs){var a=Date.now();e={...n,transport:e.transport,sessionId:a,audioExtensions:e.audio?.[\"rtp-hdrexts\"],audioPayloadTypes:e.audio?.[\"payload-types\"],videoExtensions:e.video?.[\"rtp-hdrexts\"],videoPayloadTypes:e.video?.[\"payload-types\"]};o={...o,...t?{screenshareConference:e}:{conference:e}};try{await r.setRemoteDescription({type:\"answer\",sdp:(0,i.default)(e,!0,t)})}catch(e){console.error(e)}}}},startSharingScreen:()=>async function(){if(o)try{const e=await l(\"presentation\");return e?(e.getTracks()[0].onended=()=>{o&&o.myId&&(o.streams?.[o.myId].presentation,u(o.myId),c())},new Promise((t=>{var{connection:n,dataChannel:t}=h([e],t,!0);o={...o,screenshareConnection:n,screenshareDataChannel:t}}))):void 0}catch(e){return}},joinGroupCall:()=>function(e,t,n,a){if(o)throw Error(\"Already in call\");f(\"connecting\");var i=new MediaStream;return n.srcObject=i,n.play().catch((e=>console.warn(e))),o={onUpdate:a,participants:[],myId:e,speaking:{},silence:(0,r.silence)(t),black:(0,r.black)({width:640,height:480}),analyserInterval:setInterval(S,1e3),audioElement:n,audioContext:t,mediaStream:i},new Promise((e=>{o={...o,...h([o.silence,o.black],e)}}))}});var a=n(\"./src/parseSdp.ts\"),i=n(\"./src/buildSdp.ts\"),r=n(\"./src/blacksilence.ts\"),s=n(\"./src/utils.ts\");let o;function c(e){o&&(o.screenshareDataChannel?.close(),o.screenshareConnection?.close(),e||o.onUpdate?.({\"@type\":\"updateGroupCallLeavePresentation\"}))}function d(e){return o?.streams?.[e]}function p(e,t){const n=(t=t||o?.myId)&&d(t)?.[e];return!!n&&n.getTracks()[0]?.enabled}function u(e){o?.onUpdate?.({\"@type\":\"updateGroupCallStreams\",userId:e,hasAudioStream:p(\"audio\",e),hasVideoStream:p(\"video\",e),hasPresentationStream:p(\"presentation\",e),amplitude:o.speaking?.[e]})}function l(e,t=\"user\"){return\"presentation\"===e?navigator.mediaDevices.getDisplayMedia({audio:!1,video:!0}):navigator.mediaDevices.getUserMedia({audio:\"audio\"===e&&{...s.IS_ECHO_CANCELLATION_SUPPORTED&&{echoCancellation:!0},...s.IS_NOISE_SUPPRESSION_SUPPORTED&&{noiseSuppression:!0}},video:\"video\"===e&&{facingMode:t}})}async function m(e,t){if(o&&o.myId&&o.connection&&o.streams){const n=d(o.myId)?.[e];if(n){const a=n.getTracks()[0];if(a){const n=[...o.connection.getSenders(),...o.screenshareConnection?.getSenders()||[]].find((e=>a.id===e.track?.id));if(n){t=void 0===t?!a.enabled:t;try{if(t&&!a.enabled){const t=await l(e);if(await n.replaceTrack(t.getTracks()[0]),o.streams[o.myId][e]=t,\"video\"===e)o.facingMode=\"user\";else if(\"audio\"===e){const e=o.audioContext;if(!e)return;const n=e.createMediaStreamSource(t),a=e.createAnalyser();a.minDecibels=-100,a.maxDecibels=-30,a.smoothingTimeConstant=.05,a.fftSize=1024,n.connect(a),o={...o,participantFunctions:{...o.participantFunctions,[o.myId]:{...o.participantFunctions?.[o.myId],getCurrentAmplitude:()=>{var e=new Uint8Array(a.frequencyBinCount);return a.getByteFrequencyData(e),(0,s.getAmplitude)(e,1.5)}}}}}}else if(!t&&a.enabled){a.stop();const t=\"audio\"===e?o.silence:o.black;if(!t)return;await n.replaceTrack(t.getTracks()[0]),o.streams[o.myId][e]=t,\"video\"===e&&(o.facingMode=void 0)}u(o.myId),\"presentation\"!==e||t||c(!0)}catch(e){}}}}}}function f(e){o?.onUpdate?.({\"@type\":\"updateGroupCallConnectionState\",connectionState:e})}function g(){o&&(o.myId&&o.streams?.[o.myId]&&Object.values(o.streams[o.myId]||{}).forEach((e=>{e?.getTracks().forEach((e=>{e.stop()}))})),c(!0),o.dataChannel?.close(),o.connection?.close(),f(\"disconnected\"),o.analyserInterval&&clearInterval(o.analyserInterval),o=void 0)}function S(){o&&o.participantFunctions&&Object.keys(o.participantFunctions).forEach((e=>{const t=o.participantFunctions[Number(e)].getCurrentAmplitude;var n,a;t&&(n=t(),a=o.speaking[e]||0,((o.speaking[e]=n)>s.THRESHOLD&&a<=s.THRESHOLD||n<=s.THRESHOLD&&a>s.THRESHOLD)&&u(e))}))}function v(e){if(o&&o.audioElement&&o.audioContext&&o.mediaStream){var t=o.conference?.ssrcs?.find((t=>t.endpoint===e.track.id));if(t&&t.userId){const{userId:a,isPresentation:i}=t;var n=o.participants?.find((e=>e.id===a));const r=\"video\"===e.track.kind?i?\"presentation\":\"video\":\"audio\";if(e.track.onended=()=>{o?.streams?.[a][r],u(a)},t=e.streams[0],\"audio\"===e.track.kind){const e=o.mediaStream,i=new window.AudioContext,r=i.createMediaStreamSource(t),c=i.createGain();c.gain.value=(n?.volume||1e4)/1e4;const d=i.createGain();c.gain.value=1;const p=i.createAnalyser();p.minDecibels=-100,p.maxDecibels=-30,p.smoothingTimeConstant=.05,p.fftSize=1024,r.connect(p).connect(d).connect(c).connect(i.destination),e.addTrack(r.mediaStream.getAudioTracks()[0]);const u=new Audio;u.srcObject=t,u.muted=!0,u.remove(),o={...o,participantFunctions:{...o.participantFunctions,[a]:{...o.participantFunctions?.[a],setVolume:e=>{c.gain.value=1<e?2*e:e},toggleMute:e=>{d.gain.value=e?0:1},getCurrentAmplitude:()=>{var e=new Uint8Array(p.frequencyBinCount);return p.getByteFrequencyData(e),(0,s.getAmplitude)(e,1.5)}}}}}o={...o,streams:{...o.streams,[a]:{...o.streams?.[a],[r]:t}}},u(a)}}}function h(e,t,n=!1){const i=new RTCPeerConnection;var r=n?void 0:function(e){const t=e.createDataChannel(\"data\",{id:0});return t.onopen=()=>{},t.onmessage=e=>{JSON.parse(e.data).colibriClass},t.onerror=e=>{console.log(\"%conerror\",\"background: green; font-size: 5em\"),console.error(e)},t}(i);return e.forEach((e=>e.getTracks().forEach((t=>{i.addTrack(t,e)})))),n||(i.oniceconnectionstatechange=()=>{var e=i.iceConnectionState;\"connected\"===e||\"completed\"===e?f(\"connected\"):\"checking\"===e||\"new\"===e?f(\"connecting\"):\"disconnected\"===i.iceConnectionState&&f(\"reconnecting\")}),i.ontrack=v,i.onnegotiationneeded=async()=>{if(o){var r=o.myId;if(r){var s=await i.createOffer({offerToReceiveVideo:!0,offerToReceiveAudio:!n});if(await i.setLocalDescription(s),s.sdp){var c=(0,a.default)(s),d=n?void 0:{userId:\"\",sourceGroups:[{semantics:\"FID\",sources:[c.ssrc||0]}],isRemoved:n,isMain:!0,isVideo:!1,isPresentation:n,endpoint:n?\"1\":\"0\"},p=c[\"ssrc-groups\"]&&{isPresentation:n,userId:\"\",sourceGroups:c[\"ssrc-groups\"],isMain:!0,isVideo:!0,endpoint:n?\"0\":\"1\"};s=n?o.screenshareConference:o.conference;const i=[];n?(p&&i.push(p),d&&i.push(d)):(d&&i.push(d),p&&i.push(p)),d=e.find((e=>\"audio\"===e.getTracks()[0].kind)),p=e.find((e=>\"video\"===e.getTracks()[0].kind)),o={...o,...n?{screenshareConference:{...s,ssrcs:i}}:{conference:{...s,ssrcs:i}},streams:{...o.streams,[r]:{...o.streams?.[r],...d&&{audio:d},...!n&&p?{video:p}:{presentation:p}}}},u(r),t(c)}}}},{connection:i,dataChannel:r}}},\"./src/types.ts\":(e,t,n)=>{n.r(t)},\"./src/utils.ts\":(e,t,n)=>{function a(){var{userAgent:e,platform:t}=window.navigator;let n;return-1!==[\"Macintosh\",\"MacIntel\",\"MacPPC\",\"Mac68K\"].indexOf(t)?n=\"macOS\":-1!==[\"iPhone\",\"iPad\",\"iPod\"].indexOf(t)?n=\"iOS\":-1!==[\"Win32\",\"Win64\",\"Windows\",\"WinCE\"].indexOf(t)?n=\"Windows\":/Android/.test(e)?n=\"Android\":/Linux/.test(t)&&(n=\"Linux\"),n}n.r(t),n.d(t,{toTelegramSource:()=>function(e){return e<<0},fromTelegramSource:()=>function(e){return e>>>0},getAmplitude:()=>function(e,t=3){if(!e)return 0;var n=e.length;let a=0;for(let t=0;t<n;t++)a+=e[t]*e[t];var i=Math.sqrt(a/n)/255;return Math.min(1,i*t)},getPlatform:()=>a,THRESHOLD:()=>i,PLATFORM_ENV:()=>r,IS_MAC_OS:()=>s,IS_IOS:()=>o,IS_SCREENSHARE_SUPPORTED:()=>c,IS_ECHO_CANCELLATION_SUPPORTED:()=>d,IS_NOISE_SUPPRESSION_SUPPORTED:()=>p});const i=.1,r=a(),s=\"macOS\"===r,o=\"iOS\"===r,c=\"getDisplayMedia\"in(navigator?.mediaDevices||{}),d=navigator?.mediaDevices?.getSupportedConstraints().echoCancellation,p=navigator?.mediaDevices?.getSupportedConstraints().noiseSuppression}},t={};function n(a){var i=t[a];return void 0!==i||(i=t[a]={exports:{}},e[a](i,i.exports,n)),i.exports}n.d=(e,t)=>{for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})};var a={};(()=>{n.r(a),n.d(a,{handleUpdateGroupCallConnection:()=>e.handleUpdateGroupCallConnection,startSharingScreen:()=>e.startSharingScreen,joinGroupCall:()=>e.joinGroupCall,getDevices:()=>e.getDevices,getUserStreams:()=>e.getUserStreams,setVolume:()=>e.setVolume,isStreamEnabled:()=>e.isStreamEnabled,toggleStream:()=>e.toggleStream,leaveGroupCall:()=>e.leaveGroupCall,handleUpdateGroupCallParticipants:()=>e.handleUpdateGroupCallParticipants,switchCameraInput:()=>e.switchCameraInput,toggleSpeaker:()=>e.toggleSpeaker,toggleNoiseSuppression:()=>e.toggleNoiseSuppression,IS_SCREENSHARE_SUPPORTED:()=>t.IS_SCREENSHARE_SUPPORTED,THRESHOLD:()=>t.THRESHOLD});var e=n(\"./src/secretsauce.ts\"),t=n(\"./src/utils.ts\");n(\"./src/types.ts\")})();var i,r=exports;for(i in a)r[i]=a[i];a.__esModule&&Object.defineProperty(r,\"__esModule\",{value:!0})})();"],"names":["addActionHandler","global","actions","update","activeGroupCallId","groupCalls","toggleGroupCallPresentation","value","userId","selectGroupCallParticipant","updateGroupCallParticipant","omit","connectionState","leaveGroupCall","isFromLibrary","updateGroupCall","isSpeakerDisabled","groupCallId","participants","handleUpdateGroupCallParticipants","data","stream","showNotification","message","handleUpdateGroupCallConnection","presentation","groupCall","selectActiveGroupCall","Object","keys","length","values","async","payload","shouldDiscard","shouldRemove","rejoin","setGlobal","updateActiveGroupCall","participantsCount","callApi","call","shouldResetFallbackState","getGlobal","fallbackChatId","chatId","fallbackUserIdsToRemove","forEach","deleteChatMember","removeGroupCall","id","removeGroupCallAudioElement","isGroupCallPanelHidden","undefined","joinGroupCall","user","selectUser","currentUserId","toggleStream","videoStopped","isStreamEnabled","participant","raiseHand","participantId","volume","setVolume","Math","floor","GROUP_CALL_VOLUME_MULTIPLIER","Number","muted","params","startSharingScreen","presentationPaused","audioElement","getGroupCallAudioElement","audioContext","getGroupCallAudioContext","apiUpdate","inviteHash","loadMoreGroupCallParticipants","chat","selectChat","loadFullChat","selectCurrentMessageList","fallbackChannelTitle","selectCallFallbackChannelTitle","fallbackChannel","chats","byId","find","channel","title","isCreator","isRestricted","isForbidden","updateChatMemberBannedRights","bannedRights","users","photo","fetchFile","callFallbackAvatarPath","accessHash","inviteLink","usageLimit","expireDate","getServerTime","serverTimeOffset","sendMessage","text","openChat","createGroupCall","closeCallFallbackConfirm","vibrateShort","navigator","vibrate","memo","size","name","playSegment","color","iconData","setIconData","useState","useEffect","getAnimationData","then","AnimatedSticker","play","noLoop","speed","animationData","withGlobal","meParticipant","raiseHandRating","hasAudioStream","canSelfUnmute","isMuted","hasRequestedToSpeak","Boolean","noAudioStream","toggleGroupCallMute","requestToSpeak","playGroupCallSound","getActions","lang","useLang","muteMouseDownState","useRef","isRequestingToSpeak","setIsRequestingToSpeak","isConnecting","shouldRaiseHand","prevShouldRaiseHand","usePrevious","useMemo","r","random","animatedIconName","toggleMute","buttonText","className","buildClassName","onMouseDown","setTimeout","current","onMouseUp","SPEAKER_ICON_DISABLED_SEGMENT","SPEAKER_ICON_ENABLED_SEGMENT","isAdmin","selectIsAdminInActiveGroupCall","closeDropdown","isDropdownOpen","anchor","setGroupCallParticipantVolume","toggleGroupCallPanel","isDeleteUserModalOpen","openDeleteUserModal","closeDeleteUserModal","useFlag","isMutedByMe","isSelf","isRaiseHand","localVolume","setLocalVolume","GROUP_CALL_DEFAULT_VOLUME","runThrottled","ms","noFirst","throttle","cb","useThrottle","handleRemove","useCallback","e","stopPropagation","handleCancelRequestToSpeak","handleMute","handleOpenProfile","speakerIconPlaySegment","Menu","isOpen","positionX","autoClose","style","y","onClose","type","min","max","onChange","target","MenuItem","icon","onClick","destructive","DeleteMemberModal","noColor","isSpeaking","amplitude","THRESHOLD","prevIsRaiseHand","prevIsMuted","microphoneColor","isUser","openParticipantMenu","anchorRef","aboutText","aboutColor","toString","replace","about","firstName","lastName","ref","Avatar","createGroupCallInviteLink","participantsIds","viewportIds","getMore","useInfiniteScroll","InfiniteScroll","items","onLoadMore","map","key","isActive","isFullscreen","handleClick","streams","getUserStreams","ENABLE_THUMBNAIL_VIDEO","autoPlay","playsInline","srcObject","onDoubleClick","selectedVideo","setSelectedVideo","presentationParticipants","filter","l","hasPresentationStream","videoParticipants","hasVideoStream","totalVideoCount","columnCount","shouldSpanLastVideo","handleClickVideo","CAMERA_FLIP_PLAY_SEGMENT","selectGroupCall","isSpeakerEnabled","toggleGroupCallVideo","connectToActiveGroupCall","containerRef","isLeaving","setIsLeaving","openFullscreen","closeFullscreen","isSidebarOpen","openSidebar","closeSidebar","hasVideoParticipants","some","video","isLandscape","IS_SINGLE_COLUMN_LAYOUT","participantMenu","setParticipantMenu","isParticipantMenuOpen","closeParticipantMenu","isConfirmLeaveModalOpen","openConfirmLeaveModal","closeConfirmLeaveModal","isEndGroupCallModal","setIsEndGroupCallModal","shouldEndGroupCall","setShouldEndGroupCall","hasVideo","hasPresentation","handleOpenParticipantMenu","rect","getBoundingClientRect","container","x","left","top","offsetTop","sound","handleCloseConfirmLeaveModal","MainButton","onTrigger","Button","round","ariaLabel","handleToggleFullscreen","document","exitFullscreen","requestFullscreen","handleToggleSidebar","handleStreamsDoubleClick","IS_REQUEST_FULLSCREEN_SUPPORTED","toggleFullscreen","handleClose","addEventListener","removeEventListener","endGroupCall","handleLeaveGroupCall","handleCloseAnimationEnd","Modal","dialogRef","onCloseAnimationEnd","IS_SCREENSHARE_SUPPORTED","DropdownMenu","trigger","Loading","IS_ANDROID","IS_IOS","switchCameraInput","toggleSpeaker","Checkbox","label","checked","onCheck","isText","body","classList","toggle","userFullName","getUserFullName","channelTitle","inviteToCallFallback","setShouldRemove","renderingUserFullName","useCurrentOrPrev","handleConfirm","ConfirmDialog","confirmHandler","t","n","d","silence","a","black","i","createOscillator","connect","createMediaStreamDestination","start","MediaStream","assign","getAudioTracks","enabled","width","height","createElement","getContext","Error","fillRect","captureStream","getVideoTracks","default","push","sessionId","s","ssrcs","o","audioExtensions","c","videoExtensions","audioPayloadTypes","p","videoPayloadTypes","u","transport","ufrag","pwd","m","fingerprints","f","candidates","g","endpoint","join","S","foundation","component","protocol","priority","ip","port","generation","v","hash","fingerprint","h","channels","clockrate","parameters","subtype","isVideo","isMain","uri","isRemoved","sourceGroups","semantics","sources","fromTelegramSource","sdp","split","reduce","match","startsWith","substr","setup","ssrc","toTelegramSource","slice","getDevices","mediaDevices","enumerateDevices","kind","onUpdate","participantFunctions","toggleNoiseSuppression","myId","audio","getTracks","echoCancellation","noiseSuppression","getConstraints","applyConstraints","connection","facingMode","getSenders","track","replaceTrack","conference","source","isLeft","isVideoJoined","isPresentation","updatingParticipantsQueue","setRemoteDescription","createAnswer","setLocalDescription","console","error","screenshareConference","screenshareConnection","Date","now","onended","Promise","dataChannel","screenshareDataChannel","catch","warn","speaking","analyserInterval","setInterval","mediaStream","close","getDisplayMedia","getUserMedia","IS_ECHO_CANCELLATION_SUPPORTED","IS_NOISE_SUPPRESSION_SUPPORTED","createMediaStreamSource","createAnalyser","minDecibels","maxDecibels","smoothingTimeConstant","fftSize","getCurrentAmplitude","Uint8Array","frequencyBinCount","getByteFrequencyData","getAmplitude","stop","clearInterval","window","AudioContext","createGain","gain","destination","addTrack","Audio","remove","RTCPeerConnection","createDataChannel","onopen","onmessage","JSON","parse","colibriClass","onerror","log","oniceconnectionstatechange","iceConnectionState","ontrack","onnegotiationneeded","createOffer","offerToReceiveVideo","offerToReceiveAudio","userAgent","platform","indexOf","test","sqrt","getPlatform","PLATFORM_ENV","IS_MAC_OS","getSupportedConstraints","exports","defineProperty","enumerable","get","prototype","hasOwnProperty","Symbol","toStringTag","__esModule"],"sourceRoot":""}