UNPKG

stream-chat-react

Version:

React components to create chat conversations or livestream style chat

1 lines 2.05 MB
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/components/AIStateIndicator/hooks/useAIState.ts","../../src/context/AttachmentSelectorContext.tsx","../../src/context/MessageContext.tsx","../../src/components/MessageComposer/preEditSnapshot.ts","../../src/context/MessageBounceContext.tsx","../../src/context/MessageListContext.tsx","../../src/context/MessageTranslationViewContext.tsx","../../src/context/ModalContext.tsx","../../src/context/PollContext.tsx","../../src/context/WithComponents.tsx","../../src/components/AIStateIndicator/AIStateIndicator.tsx","../../src/components/VisuallyHidden/VisuallyHidden.tsx","../../src/components/Accessibility/useAriaLiveAnnouncer.ts","../../src/components/Accessibility/AriaLiveRegion.tsx","../../src/components/Notifications/NotificationConfigurationContext.tsx","../../src/components/Notifications/hooks/useNotifications.ts","../../src/a11y/hooks/useAriaIdentifiers.ts","../../src/components/Dialog/components/Alert.tsx","../../src/components/Dialog/service/DialogAnchor.tsx","../../src/components/Button/PlayButton.tsx","../../src/components/Dialog/components/Callout.tsx","../../src/components/Avatar/Avatar.tsx","../../src/components/Badge/Badge.tsx","../../src/components/Avatar/AvatarStack.tsx","../../src/components/Avatar/ChannelAvatar.tsx","../../src/components/Avatar/GroupAvatar.tsx","../../src/a11y/a11yUtils.ts","../../src/components/Dialog/components/ContextMenu.tsx","../../src/components/Dialog/components/Prompt.tsx","../../src/components/Dialog/components/Viewer.tsx","../../src/i18n/de.json","../../src/i18n/en.json","../../src/i18n/es.json","../../src/i18n/fr.json","../../src/i18n/hi.json","../../src/i18n/it.json","../../src/i18n/ja.json","../../src/i18n/ko.json","../../src/i18n/nl.json","../../src/i18n/pt.json","../../src/i18n/ru.json","../../src/i18n/tr.json","../../src/i18n/TranslationBuilder/TranslationBuilder.ts","../../src/i18n/TranslationBuilder/notifications/translators.ts","../../src/i18n/TranslationBuilder/notifications/translatorsByNotificationType.ts","../../src/i18n/TranslationBuilder/notifications/NotificationTranslationTopic.ts","../../src/i18n/Streami18n.ts","../../src/components/Loading/LoadingChannels.tsx","../../src/components/Loading/LoadingIndicator.tsx","../../src/components/Loading/progress-indicators.tsx","../../src/components/Loading/UploadProgressIndicator.tsx","../../src/components/MessageComposer/hooks/utils.ts","../../src/components/Attachment/components/FileSizeIndicator.tsx","../../src/components/Loading/UploadedSizeIndicator.tsx","../../src/utils/useStableCallback.ts","../../src/components/Message/hooks/useActionHandler.ts","../../src/components/Message/hooks/useDeleteHandler.ts","../../src/components/Message/hooks/useFlagHandler.ts","../../src/components/Message/hooks/useMentionsHandler.ts","../../src/components/Message/hooks/useMarkUnreadHandler.ts","../../src/components/Message/hooks/useMuteHandler.ts","../../src/components/Message/hooks/useOpenThreadHandler.ts","../../src/components/Message/hooks/usePinHandler.ts","../../src/components/Reactions/reactionOptions.tsx","../../src/components/Message/hooks/useReactionHandler.ts","../../src/components/Message/hooks/useRetryHandler.ts","../../src/components/Message/hooks/useUserHandler.ts","../../src/components/Message/hooks/useUserRole.ts","../../src/components/Message/hooks/useReactionsFetcher.ts","../../src/components/Message/hooks/useMessageTextStreaming.ts","../../src/components/Message/hooks/useMessageReminder.ts","../../src/a11y/hooks/useResolvedModalAriaProps.ts","../../src/components/Modal/GlobalModal.tsx","../../src/components/MessageBounce/MessageBounceModal.tsx","../../src/components/MessageBounce/MessageBouncePrompt.tsx","../../src/components/Message/MessageBubble.tsx","../../src/components/Message/MessageDeletedBubble.tsx","../../src/components/Message/MessageBlocked.tsx","../../src/components/MessageActions/hooks/useBaseMessageActionSetFilter.ts","../../src/components/Message/MessageAlsoSentInChannelIndicator.tsx","../../src/components/Message/MessageRepliesCountButton.tsx","../../src/components/Message/PinIndicator.tsx","../../src/components/Tooltip/Tooltip.tsx","../../src/components/Tooltip/hooks/useEnterLeaveHandlers.ts","../../src/components/Message/MessageStatus.tsx","../../src/components/Message/renderText/regex.ts","../../src/components/Message/renderText/rehypePlugins/emojiMarkdownPlugin.ts","../../src/components/Message/renderText/rehypePlugins/mentionsMarkdownPlugin.ts","../../src/components/Message/renderText/remarkPlugins/htmlToTextPlugin.ts","../../src/components/Message/renderText/remarkPlugins/imageToLink.ts","../../src/components/Message/renderText/remarkPlugins/keepLineBreaksPlugin.ts","../../src/components/Message/renderText/remarkPlugins/plusPlusToEmphasis.ts","../../src/components/Message/renderText/remarkPlugins/remarkIgnoreMarkdown.ts","../../src/components/Message/renderText/componentRenderers/Anchor.tsx","../../src/components/Message/renderText/componentRenderers/Emoji.tsx","../../src/components/Message/renderText/componentRenderers/Mention.tsx","../../src/components/UtilityComponents/NullComponent.tsx","../../src/components/UtilityComponents/ErrorBoundary.tsx","../../src/components/Message/renderText/renderText.tsx","../../src/components/Message/MessageText.tsx","../../src/components/Message/Timestamp.tsx","../../src/components/Message/MessageTimestamp.tsx","../../src/components/Message/MessageEditedIndicator.tsx","../../src/components/Message/MessageTranslationIndicator.tsx","../../src/components/Attachment/components/DownloadButton.tsx","../../src/components/FileIcon/FileIconSet.tsx","../../src/components/FileIcon/mimeTypes.ts","../../src/components/FileIcon/iconMap.ts","../../src/components/FileIcon/FileIcon.tsx","../../src/components/AudioPlayback/components/formatTime.ts","../../src/components/AudioPlayback/components/DurationDisplay.tsx","../../src/components/AudioPlayback/components/PlaybackRateButton.tsx","../../src/components/AudioPlayback/components/keyboardSeek.ts","../../src/components/AudioPlayback/components/progressBarA11y.ts","../../src/components/AudioPlayback/components/useInteractiveProgressBar.ts","../../src/components/AudioPlayback/components/ProgressBar.tsx","../../src/components/Attachment/utils.tsx","../../src/components/Attachment/audioSampling.ts","../../src/components/AudioPlayback/components/WaveProgressBar.tsx","../../src/components/Attachment/Audio.tsx","../../src/components/Attachment/AttachmentActions.tsx","../../src/components/Attachment/VoiceRecording.tsx","../../src/components/BaseImage/ImagePlaceholder.tsx","../../src/components/BaseImage/BaseImage.tsx","../../src/components/BaseImage/toBaseImageDescriptors.ts","../../src/components/Gallery/GalleryContext.tsx","../../src/components/Gallery/GalleryHeader.tsx","../../src/components/VideoPlayer/VideoPlayer.tsx","../../src/components/VideoPlayer/VideoThumbnail.tsx","../../src/components/Gallery/GalleryUI.tsx","../../src/components/Gallery/Gallery.tsx","../../src/components/Attachment/ModalGallery.tsx","../../src/components/Attachment/Image.tsx","../../src/components/SafeAnchor/SafeAnchor.tsx","../../src/components/Attachment/LinkPreview/UnableToRenderCard.tsx","../../src/components/Attachment/LinkPreview/Card.tsx","../../src/components/Attachment/FileAttachment.tsx","../../src/components/Attachment/Giphy.tsx","../../src/components/Attachment/icons.tsx","../../src/components/Attachment/Geolocation.tsx","../../src/components/Attachment/UnsupportedAttachment.tsx","../../src/components/Attachment/VisibilityDisclaimer.tsx","../../src/components/Attachment/VideoAttachment.tsx","../../src/components/Attachment/AttachmentContainer.tsx","../../src/components/Attachment/Attachment.tsx","../../src/components/Location/hooks/useLiveLocationSharingManager.ts","../../src/components/MessageComposer/hooks/useAttachmentManagerState.ts","../../src/components/MessageComposer/hooks/useAttachmentsForPreview.ts","../../src/components/MessageComposer/hooks/useCanCreatePoll.ts","../../src/components/MessageComposer/hooks/useCooldownRemaining.tsx","../../src/components/MessageComposer/hooks/useTextareaRef.ts","../../src/components/MessageComposer/hooks/useSubmitHandler.ts","../../src/components/ReactFileUtilities/UploadButton.tsx","../../src/components/MessageComposer/hooks/usePasteHandler.ts","../../src/components/MediaRecorder/observable/Subscription.ts","../../src/components/MediaRecorder/observable/Observer.ts","../../src/components/MediaRecorder/observable/Observable.ts","../../src/components/MediaRecorder/observable/Subject.ts","../../src/components/MediaRecorder/observable/BehaviorSubject.ts","../../src/components/MediaRecorder/classes/BrowserPermission.ts","../../src/utils/mergeDeep.ts","../../src/components/MediaRecorder/classes/AmplitudeRecorder.ts","../../src/components/MediaRecorder/transcode/wav.ts","../../src/components/MediaRecorder/transcode/index.ts","../../src/components/MediaRecorder/classes/MediaRecorderController.ts","../../src/components/MediaRecorder/hooks/useMediaRecorder.ts","../../src/components/MessageComposer/hooks/useMessageComposerBindings.ts","../../src/components/MessageComposer/hooks/useMessageComposerCommands.ts","../../src/components/MessageComposer/hooks/useMessageComposerHasSendableData.ts","../../src/components/MessageComposer/hooks/useMessageContentIsEmpty.ts","../../src/components/MessageComposer/RemoveAttachmentPreviewButton.tsx","../../src/components/MessageComposer/QuotedMessageIndicator.tsx","../../src/components/MessageComposer/QuotedMessagePreview.tsx","../../src/components/Message/QuotedMessage.tsx","../../src/components/Message/ReminderNotification.tsx","../../src/components/Message/StreamedMessageText.tsx","../../src/components/Form/Dropdown.tsx","../../src/components/Form/SwitchField.tsx","../../src/components/Location/ShareLocationDialog.tsx","../../src/components/Poll/PollHeader.tsx","../../src/components/Form/FieldError.tsx","../../src/components/Form/NumericInput.tsx","../../src/components/Form/TextInput.tsx","../../src/components/DragAndDrop/DragAndDropContainer.tsx","../../src/components/Form/TextInputFieldSet.tsx","../../src/components/Form/hooks/useFormState.ts","../../src/components/Poll/PollActions/AddCommentPrompt.tsx","../../src/components/Poll/PollActions/EndPollAlert.tsx","../../src/components/Poll/PollActions/PollAction.tsx","../../src/components/Poll/PollActions/SuggestPollOptionPrompt.tsx","../../src/components/Poll/PollVote.tsx","../../src/components/Poll/hooks/useManagePollVotesRealtime.ts","../../src/components/InfiniteScrollPaginator/hooks/useCursorPaginator.ts","../../src/components/Poll/hooks/usePollAnswerPagination.ts","../../src/components/Poll/hooks/usePollOptionVotesPagination.ts","../../src/components/InfiniteScrollPaginator/InfiniteScrollPaginator.tsx","../../src/components/Poll/PollActions/PollAnswerList.tsx","../../src/components/Poll/PollActions/PollResults/PollOptionWithVotesHeader.tsx","../../src/components/Poll/PollActions/PollResults/PollOptionWithVotes.tsx","../../src/components/Poll/PollActions/PollQuestion.tsx","../../src/components/Poll/PollActions/PollResults/PollOptionWithVotesList.tsx","../../src/components/Poll/PollActions/PollResults/PollResults.tsx","../../src/components/Poll/PollActions/PollActions.tsx","../../src/components/Poll/PollOptionSelector.tsx","../../src/components/Poll/PollOptionList.tsx","../../src/components/Poll/PollActions/PollOptionsFullList.tsx","../../src/components/Poll/PollContent.tsx","../../src/components/Poll/Poll.tsx","../../src/components/Poll/PollCreationDialog/MultipleAnswersField.tsx","../../src/components/Poll/PollCreationDialog/NameField.tsx","../../src/components/Poll/PollCreationDialog/OptionFieldSet.tsx","../../src/components/Poll/PollCreationDialog/PollCreationDialogControls.tsx","../../src/components/Poll/PollCreationDialog/PollCreationDialog.tsx","../../src/components/MessageComposer/AttachmentSelector/CommandsMenu.tsx","../../src/components/MessageComposer/AttachmentSelector/AttachmentSelector.tsx","../../src/components/MessageComposer/AttachmentPreviewList/UnsupportedAttachmentPreview.tsx","../../src/components/MessageComposer/AttachmentPreviewList/AttachmentUploadedSizeIndicator.tsx","../../src/components/MessageComposer/AttachmentPreviewList/utils/AttachmentPreviewRoot.tsx","../../src/components/MessageComposer/AttachmentPreviewList/FileAttachmentPreview.tsx","../../src/components/MessageComposer/AttachmentPreviewList/AudioAttachmentPreview.tsx","../../src/components/Badge/MediaBadge.tsx","../../src/components/MessageComposer/AttachmentPreviewList/MediaAttachmentPreview.tsx","../../src/components/MessageComposer/AttachmentPreviewList/AttachmentPreviewList.tsx","../../src/components/MessageComposer/AttachmentPreviewList/VoiceRecordingPreviewSlot.tsx","../../src/components/MessageComposer/CommandChip.tsx","../../src/components/MessageComposer/CooldownTimer.tsx","../../src/components/MessageComposer/icons.tsx","../../src/components/MessageComposer/LinkPreviewList.tsx","../../src/components/MediaRecorder/RecordingPermissionDeniedNotification.tsx","../../src/components/MediaRecorder/AudioRecorder/AudioRecordingPlayback.tsx","../../src/components/MediaRecorder/AudioRecorder/hooks/useTimeElapsed.ts","../../src/components/MediaRecorder/AudioRecorder/RecordingTimer.tsx","../../src/components/MediaRecorder/AudioRecorder/AudioRecordingPreview.tsx","../../src/components/MediaRecorder/AudioRecorder/recordingStateIdentity.ts","../../src/components/MediaRecorder/AudioRecorder/AudioRecorderRecordingControls.tsx","../../src/components/MediaRecorder/AudioRecorder/AudioRecorder.tsx","../../src/components/MediaRecorder/AudioRecorder/AudioRecordingButtonWithNotification.tsx","../../src/components/MessageComposer/EditedMessagePreview.tsx","../../src/components/MessageComposer/SendToChannelCheckbox.tsx","../../src/components/TextareaComposer/SuggestionList/CommandItem.tsx","../../src/components/TextareaComposer/SuggestionList/EmoticonItem.tsx","../../src/components/TextareaComposer/SuggestionList/SuggestionListItem.tsx","../../src/components/TextareaComposer/SuggestionList/UserItem.tsx","../../src/utils/getTextareaCaretRect.ts","../../src/components/TextareaComposer/SuggestionList/SuggestionList.tsx","../../src/components/TextareaComposer/hooks/useTextareaPlaceholder.ts","../../src/components/TextareaComposer/TextareaComposer.tsx","../../src/components/MessageComposer/WithDragAndDropUpload.tsx","../../src/components/MessageComposer/StopAIGenerationButton.tsx","../../src/components/MessageComposer/SendButton.tsx","../../src/components/MessageComposer/MessageComposerActions.tsx","../../src/components/MessageComposer/AttachmentPreviewList/GeolocationPreview.tsx","../../src/components/MessageComposer/MessageComposerUI.tsx","../../src/components/MessageComposer/hooks/useCreateMessageComposerContext.ts","../../src/components/MessageComposer/MessageComposer.tsx","../../src/components/ChannelListItem/utils.tsx","../../src/components/ChannelListItem/hooks/useChannelDisplayName.ts","../../src/components/ChannelListItem/hooks/useChannelPreviewInfo.ts","../../src/components/TypingIndicator/TypingIndicatorDots.tsx","../../src/components/TypingIndicator/hooks/useDebouncedTypingActive.ts","../../src/components/TypingIndicator/utils/getTypingStatusMessage.ts","../../src/components/TypingIndicator/TypingIndicatorHeader.tsx","../../src/components/Thread/ThreadHeader.tsx","../../src/components/Thread/ThreadStart.tsx","../../src/components/DateSeparator/DateSeparator.tsx","../../src/components/Thread/ThreadHead.tsx","../../src/components/Thread/Thread.tsx","../../src/components/Reactions/ReactionSelector.tsx","../../src/components/Reactions/hooks/useFetchReactions.ts","../../src/components/Reactions/MessageReactionsDetail.tsx","../../src/components/Reactions/hooks/useProcessReactions.tsx","../../src/components/Reactions/MessageReactions.tsx","../../src/components/Reactions/utils/utils.ts","../../src/components/Reactions/SpriteImage.tsx","../../src/components/Reactions/ReactionSelectorWithButton.tsx","../../src/components/MessageActions/RemindMeSubmenu.tsx","../../src/components/MessageActions/downloadUtils.ts","../../src/components/MessageActions/DownloadSubmenu.tsx","../../src/components/MessageActions/QuickMessageActionButton.tsx","../../src/components/MessageActions/DeleteMessageAlert.tsx","../../src/components/MessageActions/MessageActions.defaults.tsx","../../src/components/Chat/hooks/useSplitActionSet.ts","../../src/components/MessageActions/MessageActions.tsx","../../src/components/Message/MessageUI.tsx","../../src/components/Message/Message.tsx","../../src/components/MessageList/GiphyPreviewMessage.tsx","../../src/components/MessageList/hooks/MessageList/useEnrichedMessages.ts","../../src/components/MessageList/hooks/MessageList/useFloatingDateSeparatorMessageList.ts","../../src/components/MessageList/hooks/useLastReadData.ts","../../src/components/MessageList/hooks/useLastDeliveredData.ts","../../src/components/MessageList/hooks/MessageList/useMessageListElements.tsx","../../src/components/MessageList/hooks/MessageList/useMessageListScrollManager.ts","../../src/components/MessageList/hooks/MessageList/useScrollLocationLogic.tsx","../../src/components/MessageList/MessageListMainPanel.tsx","../../src/components/MessageList/UnreadMessagesSeparator.tsx","../../src/components/MessageList/hooks/MessageList/useUnreadMessagesNotification.ts","../../src/components/MessageList/hooks/useMarkRead.ts","../../src/components/MessageList/NewMessageNotification.tsx","../../src/components/MessageList/UnreadMessagesNotification.tsx","../../src/components/InfiniteScrollPaginator/InfiniteScroll.tsx","../../src/components/TypingIndicator/TypingIndicator.tsx","../../src/components/MessageList/hooks/VirtualizedMessageList/useFloatingDateSeparator.ts","../../src/components/MessageList/hooks/VirtualizedMessageList/useGiphyPreview.ts","../../src/components/MessageList/hooks/VirtualizedMessageList/useMessageSetKey.ts","../../src/components/MessageList/hooks/VirtualizedMessageList/useNewMessageNotification.ts","../../src/components/MessageList/hooks/VirtualizedMessageList/usePrependMessagesCount.ts","../../src/components/MessageList/hooks/VirtualizedMessageList/useScrollToBottomOnNewMessage.ts","../../src/components/MessageList/hooks/VirtualizedMessageList/useShouldForceScrollToBottom.ts","../../src/components/MessageList/hooks/VirtualizedMessageList/useUnreadMessagesNotificationVirtualized.ts","../../src/components/MessageList/FloatingDateSeparator.tsx","../../src/components/EventComponent/EventComponent.tsx","../../src/components/MessageList/renderMessages.tsx","../../src/utils/findReverse.ts","../../src/components/MessageList/hooks/useLastOwnMessage.ts","../../src/components/MessageList/hooks/useReducedMotionPreference.ts","../../src/components/MessageList/ScrollToLatestMessageButton.tsx","../../src/components/MessageList/MessageList.tsx","../../src/components/MessageList/VirtualizedMessageListComponents.tsx","../../src/context/VirtualizedMessageListContext.tsx","../../src/components/MessageList/VirtualizedMessageList.tsx","../../src/utils/getWholeChar.ts","../../src/components/Search/hooks/useSearchQueriesInProgress.ts","../../src/components/ChannelList/hooks/useConnectionRecoveredListener.ts","../../src/components/ChannelList/hooks/usePaginatedChannels.ts","../../src/components/ChannelList/utils.ts","../../src/components/ChannelList/hooks/useChannelListShape.ts","../../src/components/ChannelList/ChannelListUI.tsx","../../src/components/Search/SearchContext.tsx","../../src/components/Search/SearchBar/SearchBar.tsx","../../src/components/Search/SearchResults/SearchResultItem.tsx","../../src/components/Search/SearchSourceResultsContext.tsx","../../src/components/Search/SearchResults/SearchSourceResultsLoadingIndicator.tsx","../../src/components/Search/SearchResults/SearchSourceResultListFooter.tsx","../../src/components/Search/SearchResults/SearchSourceResultList.tsx","../../src/components/Search/SearchResults/SearchSourceResultsEmpty.tsx","../../src/components/Search/SearchResults/SearchSourceResultsHeader.tsx","../../src/components/Search/SearchResults/SearchSourceResults.tsx","../../src/components/Search/SearchResults/SearchResultsHeader.tsx","../../src/components/Search/SearchResults/SearchResultsPresearch.tsx","../../src/components/Search/SearchResults/SearchResults.tsx","../../src/components/Search/Search.tsx","../../src/components/LoadMore/LoadMoreButton.tsx","../../src/components/LoadMore/LoadMorePaginator.tsx","../../src/components/ChannelList/ChannelListHeader.tsx","../../src/components/ChannelList/ChannelList.tsx","../../src/components/ChannelList/hooks/useSelectedChannelState.ts","../../src/components/ChannelList/hooks/useChannelMembershipState.ts","../../src/components/ChannelList/hooks/useChannelMembersState.ts","../../src/components/ChannelListItem/hooks/useIsChannelMuted.ts","../../src/components/ChannelListItem/ChannelListItemActionButtons.defaults.tsx","../../src/components/ChannelListItem/ChannelListItemActionButtons.tsx","../../src/components/ChannelListItem/ChannelListItemTimestamp.tsx","../../src/components/SummarizedMessagePreview/hooks/useLatestMessagePreview.ts","../../src/components/SummarizedMessagePreview/SummarizedMessagePreview.tsx","../../src/components/ChannelListItem/ChannelListItemUI.tsx","../../src/components/ChannelListItem/hooks/useMessageDeliveryStatus.ts","../../src/components/ChannelListItem/ChannelListItem.tsx","../../src/components/Threads/ThreadList/ThreadListItemUI.tsx","../../src/components/Threads/ThreadList/ThreadListItem.tsx","../../src/components/Threads/ThreadList/ThreadListEmptyPlaceholder.tsx","../../src/components/Threads/ThreadList/ThreadListUnseenThreadsBanner.tsx","../../src/components/Threads/ThreadList/ThreadListLoadingIndicator.tsx","../../src/components/Threads/ThreadList/ThreadListHeader.tsx","../../src/components/Threads/ThreadList/ThreadList.tsx","../../src/components/Notifications/hooks/useSystemNotifications.ts","../../src/components/Notifications/Notification.tsx","../../src/components/Notifications/NotificationList.tsx","../../src/components/Accessibility/NotificationAnnouncer.tsx","../../src/components/Accessibility/hooks/useIncomingMessageAnnouncements.ts","../../src/components/ChannelHeader/hooks/useChannelHeaderOnlineStatus.ts","../../src/components/ChannelHeader/ChannelHeader.tsx","../../src/components/SkipNavigation/SkipNavigation.tsx","../../src/components/Chat/hooks/useChat.ts","../../src/components/Chat/hooks/useReportLostConnectionSystemNotification.ts","../../src/components/Chat/hooks/useCreateChatContext.ts","../../src/components/Chat/hooks/useChannelsQueryState.ts","../../src/components/Chat/Chat.tsx","../../src/components/Chat/hooks/useCreateChatClient.ts","../../src/components/Window/Window.tsx"],"sourcesContent":["import { useEffect, useState } from 'react';\nimport type { AIState, Channel, Event } from 'stream-chat';\n\nexport const AIStates = {\n Error: 'AI_STATE_ERROR',\n ExternalSources: 'AI_STATE_EXTERNAL_SOURCES',\n Generating: 'AI_STATE_GENERATING',\n Idle: 'AI_STATE_IDLE',\n Stop: 'AI_STATE_STOP',\n Thinking: 'AI_STATE_THINKING',\n};\n\n/**\n * A hook that returns the current state of the AI.\n * @param {Channel} channel - The channel for which we want to know the AI state.\n * @returns {{ aiState: AIState }} The current AI state for the given channel.\n */\nexport const useAIState = (channel?: Channel): { aiState: AIState } => {\n const [aiState, setAiState] = useState<AIState>(AIStates.Idle);\n\n useEffect(() => {\n if (!channel) {\n return;\n }\n\n const indicatorChangedListener = channel.on('ai_indicator.update', (event: Event) => {\n const { cid } = event;\n const state = event.ai_state as AIState;\n if (channel.cid === cid) {\n setAiState(state);\n }\n });\n\n const indicatorClearedListener = channel.on('ai_indicator.clear', (event) => {\n const { cid } = event;\n if (channel.cid === cid) {\n setAiState(AIStates.Idle);\n }\n });\n\n const indicatorStoppedListener = channel.on('ai_indicator.stop', (event) => {\n const { cid } = event;\n if (channel.cid === cid) {\n setAiState(AIStates.Stop);\n }\n });\n\n return () => {\n indicatorChangedListener.unsubscribe();\n indicatorClearedListener.unsubscribe();\n indicatorStoppedListener.unsubscribe();\n };\n }, [channel]);\n\n return { aiState };\n};\n","import type { PropsWithChildren } from 'react';\nimport React, { createContext, useContext } from 'react';\n\nexport type AttachmentSelectorContextValue = {\n fileInput: HTMLInputElement | null;\n};\n\nconst AttachmentSelectorContext = createContext<AttachmentSelectorContextValue>({\n fileInput: null,\n});\n\nexport const AttachmentSelectorContextProvider = ({\n children,\n value,\n}: PropsWithChildren<{ value: AttachmentSelectorContextValue }>) => (\n <AttachmentSelectorContext.Provider value={value}>\n {children}\n </AttachmentSelectorContext.Provider>\n);\n\nexport const useAttachmentSelectorContext = () => useContext(AttachmentSelectorContext);\n","import type { BaseSyntheticEvent, PropsWithChildren, ReactNode } from 'react';\nimport React, { useContext } from 'react';\n\nimport type {\n DeleteMessageOptions,\n LocalMessage,\n Mute,\n ReactionResponse,\n ReactionSort,\n UserResponse,\n} from 'stream-chat';\n\nimport type { ChannelActionContextValue } from './ChannelActionContext';\n\nimport type { ActionHandlerReturnType } from '../components/Message/hooks/useActionHandler';\nimport type { ReactEventHandler } from '../components/Message/types';\nimport type { MessageActionsArray } from '../components/Message/utils';\nimport type { GroupStyle } from '../components/MessageList/utils';\nimport type { ReactionsComparator, ReactionType } from '../components/Reactions/types';\n\nimport type { RenderTextOptions } from '../components/Message/renderText';\n\nexport type MessageContextValue = {\n /** If actions such as edit, delete, flag, mute are enabled on Message */\n actionsEnabled: boolean;\n /**\n * Returns all allowed actions on message by current user e.g., ['edit', 'delete', 'flag', 'mute', 'pin', 'quote', 'react', 'reply'].\n * Please check [Message](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Message.tsx) component for default implementation.\n */\n getMessageActions: () => MessageActionsArray<string>;\n /** Function to send an action in a Channel */\n handleAction: ActionHandlerReturnType;\n /** Function to delete a message in a Channel */\n handleDelete: (options?: DeleteMessageOptions) => Promise<void> | void;\n /** Function to fetch the message reactions */\n handleFetchReactions: (\n reactionType?: ReactionType,\n sort?: ReactionSort,\n ) => Promise<Array<ReactionResponse>>;\n /** Function to flag a message in a Channel */\n handleFlag: ReactEventHandler;\n /** Function to mark message and the messages that follow it as unread in a Channel */\n handleMarkUnread: ReactEventHandler;\n /** Function to mute a user in a Channel */\n handleMute: ReactEventHandler;\n /** Function to open a Thread on a Message */\n handleOpenThread: ReactEventHandler;\n /** Function to pin a Message in a Channel */\n handlePin: ReactEventHandler;\n /** Function to post a reaction on a Message */\n handleReaction: (\n reactionType: string,\n event: React.BaseSyntheticEvent,\n ) => Promise<void>;\n /** Function to retry sending a Message */\n handleRetry: ChannelActionContextValue['retrySendMessage'];\n /** Function that returns whether the Message belongs to the current user */\n isMyMessage: () => boolean;\n /** The message object */\n message: LocalMessage;\n /** Indicates whether a message has not been read yet or has been marked unread */\n messageIsUnread: boolean;\n /** Handler function for a click event on an @mention in Message */\n onMentionsClickMessage: ReactEventHandler;\n /** Handler function for a hover event on an @mention in Message */\n onMentionsHoverMessage: ReactEventHandler;\n /** Handler function for a click event on the user that posted the Message */\n onUserClick: ReactEventHandler;\n /** Handler function for a hover event on the user that posted the Message */\n onUserHover: ReactEventHandler;\n /** Call this function to keep message list scrolled to the bottom when the scroll height increases, e.g. an element appears below the last message (only used in the `VirtualizedMessageList`) */\n autoscrollToBottom?: () => void;\n /** Message component configuration prop. If true, picking a reaction from the `ReactionSelector` component will close the selector */\n closeReactionSelectorOnClick?: boolean;\n /** An array of user IDs that have confirmed the message delivery to their device */\n deliveredTo?: UserResponse[];\n /** If true, the message is the last one in a group sent by a specific user (only used in the `VirtualizedMessageList`) */\n endOfGroup?: boolean;\n /** If true, the message is the first one in a group sent by a specific user (only used in the `VirtualizedMessageList`) */\n firstOfGroup?: boolean;\n /** Override the default formatting of the date. This is a function that has access to the original date object, returns a string */\n formatDate?: (date: Date) => string;\n /** If true, group messages sent by each user (only used in the `VirtualizedMessageList`) */\n groupedByUser?: boolean;\n /** A list of styles to apply to this message, ie. top, bottom, single */\n groupStyles?: GroupStyle[];\n /** Whether to highlight and focus the message on load */\n highlighted?: boolean;\n /** Whether the threaded message is the first in the thread list */\n initialMessage?: boolean;\n /**\n * A factory function that determines whether a message is AI generated or not.\n */\n isMessageAIGenerated?: (message: LocalMessage) => boolean;\n /** Latest own message in currently displayed message set. */\n lastOwnMessage?: LocalMessage;\n /** Latest message id on current channel */\n lastReceivedId?: string | null;\n /** DOMRect object for parent MessageList component */\n messageListRect?: DOMRect;\n /** Array of muted users coming from [ChannelStateContext](https://getstream.io/chat/docs/sdk/react/contexts/channel_state_context/#mutes) */\n mutes?: Mute[];\n /** Sort options to provide to a reactions query */\n reactionDetailsSort?: ReactionSort;\n /** A list of users that have read this Message */\n readBy?: UserResponse[];\n /** When set, shows the sender avatar in a grid layout. Values: true | 'incoming' | 'outgoing'. */\n showAvatar?: boolean | 'incoming' | 'outgoing';\n /** Custom function to render message text content, defaults to the renderText function: [utils](https://github.com/GetStream/stream-chat-react/blob/master/src/utils.tsx) */\n renderText?: (\n text?: string,\n mentioned_users?: UserResponse[],\n options?: RenderTextOptions,\n ) => ReactNode;\n /** Keep track of read receipts for each message sent by the user. When disabled, only the last own message delivery / read status is rendered. */\n returnAllReadData?: boolean;\n /** Comparator function to sort reactions, defaults to chronological order */\n sortReactions?: ReactionsComparator;\n /** Whether or not the Message is in a Thread */\n threadList?: boolean;\n /** render HTML instead of markdown. Posting HTML is only allowed server-side */\n unsafeHTML?: boolean;\n /**\n * User-specific view for translated messages: which text to show.\n * - `'original'`: show `message.text` (source language).\n * - `'translated'`: show the translation for the **current user language** (from\n * `useTranslationContext().userLanguage`), i.e. `message.i18n[userLanguage + '_text']`\n * or fallback to `message.text` when missing. Resolved via `getTranslatedMessageText`.\n */\n translationView?: 'original' | 'translated';\n /** Set whether this message shows original or translated text (user-specific, does not change message data). */\n setTranslationView?: (view: 'original' | 'translated') => void;\n};\n\nexport const MessageContext = React.createContext<MessageContextValue | undefined>(\n undefined,\n);\n\nexport const MessageProvider = ({\n children,\n value,\n}: PropsWithChildren<{\n value: MessageContextValue;\n}>) => (\n <MessageContext.Provider value={value as unknown as MessageContextValue}>\n {children}\n </MessageContext.Provider>\n);\n\nexport const useMessageContext = (\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _componentName?: string,\n) => {\n const contextValue = useContext(MessageContext);\n\n if (!contextValue) {\n return {} as MessageContextValue;\n }\n\n return contextValue as unknown as MessageContextValue;\n};\n","import type { MessageComposer } from 'stream-chat';\n\ntype RestoreFunction = () => void;\n\nconst snapshots = new WeakMap<MessageComposer, RestoreFunction>();\n\n/**\n * Captures a full state snapshot of the composer before entering edit mode.\n * Does nothing if a snapshot already exists (e.g. switching between edits).\n */\nexport const savePreEditSnapshot = (messageComposer: MessageComposer) => {\n if (snapshots.has(messageComposer)) return;\n\n const composerState = messageComposer.state.getLatestValue();\n const textState = messageComposer.textComposer.state.getLatestValue();\n const attachmentState = messageComposer.attachmentManager.state.getLatestValue();\n const linkPreviewState = messageComposer.linkPreviewsManager.state.getLatestValue();\n const locationState = messageComposer.locationComposer.state.getLatestValue();\n const pollState = messageComposer.pollComposer.state.getLatestValue();\n const customDataState = messageComposer.customDataManager.state.getLatestValue();\n\n snapshots.set(messageComposer, () => {\n messageComposer.state.next(composerState);\n messageComposer.textComposer.state.next(textState);\n messageComposer.attachmentManager.state.next(attachmentState);\n messageComposer.linkPreviewsManager.state.next(linkPreviewState);\n messageComposer.locationComposer.state.next(locationState);\n messageComposer.pollComposer.state.next(pollState);\n messageComposer.customDataManager.state.next(customDataState);\n });\n};\n\n/**\n * Restores the composer to the state captured before editing began.\n * Falls back to `clear()` if no snapshot exists.\n */\nexport const restorePreEditSnapshot = (messageComposer: MessageComposer) => {\n const restore = snapshots.get(messageComposer);\n snapshots.delete(messageComposer);\n if (restore) {\n restore();\n } else {\n messageComposer.clear();\n }\n};\n\n/**\n * Discards the snapshot without restoring (e.g. after a successful edit save).\n */\nexport const discardPreEditSnapshot = (messageComposer: MessageComposer) => {\n snapshots.delete(messageComposer);\n};\n","import type { ReactEventHandler } from 'react';\nimport React, { createContext, useCallback, useContext, useMemo } from 'react';\nimport { useMessageContext } from './MessageContext';\nimport { useChannelActionContext } from './ChannelActionContext';\nimport { isMessageBounced, useMessageComposerController } from '../components';\nimport { savePreEditSnapshot } from '../components/MessageComposer/preEditSnapshot';\nimport type { LocalMessage } from 'stream-chat';\nimport type { PropsWithChildrenOnly } from '../types/types';\n\nexport interface MessageBounceContextValue {\n handleDelete: ReactEventHandler;\n handleEdit: ReactEventHandler;\n handleRetry: ReactEventHandler;\n message: LocalMessage;\n}\n\nconst MessageBounceContext = createContext<MessageBounceContextValue | undefined>(\n undefined,\n);\n\nexport function useMessageBounceContext(componentName?: string) {\n const contextValue = useContext(MessageBounceContext);\n\n if (!contextValue) {\n console.warn(\n `The useMessageBounceContext hook was called outside of the MessageBounceContext provider. The errored call is located in the ${componentName} component.`,\n );\n\n return {} as MessageBounceContextValue;\n }\n\n return contextValue;\n}\n\nexport function MessageBounceProvider({ children }: PropsWithChildrenOnly) {\n const messageComposer = useMessageComposerController();\n const { handleRetry: doHandleRetry, message } = useMessageContext(\n 'MessageBounceProvider',\n );\n\n if (!isMessageBounced(message)) {\n console.warn(\n `The MessageBounceProvider was rendered for a message that is not bounced. Have you missed the \"isMessageBounced\" check?`,\n );\n }\n\n const { removeMessage } = useChannelActionContext('MessageBounceProvider');\n\n const handleDelete: ReactEventHandler = useCallback(() => {\n removeMessage(message);\n }, [message, removeMessage]);\n\n const handleEdit: ReactEventHandler = useCallback(\n (e) => {\n e.preventDefault();\n savePreEditSnapshot(messageComposer);\n messageComposer.initState({ composition: message });\n },\n [message, messageComposer],\n );\n\n const handleRetry = useCallback(() => {\n doHandleRetry(message);\n }, [doHandleRetry, message]);\n\n const value = useMemo(\n () => ({\n handleDelete,\n handleEdit,\n handleRetry,\n message,\n }),\n [handleDelete, handleEdit, handleRetry, message],\n );\n\n return (\n <MessageBounceContext.Provider value={value}>\n {children}\n </MessageBounceContext.Provider>\n );\n}\n","import React, { createContext, useContext } from 'react';\nimport type { PropsWithChildren } from 'react';\nimport type { RenderedMessage } from '../components';\n\nexport type MessageListContextValue = {\n /** Enriched message list, including date separators and intro message (if enabled) */\n processedMessages: RenderedMessage[];\n /** The scroll container within which the messages and typing indicator are rendered */\n listElement: HTMLDivElement | null;\n /** Function that scrolls the `listElement` to the bottom. */\n scrollToBottom: () => void;\n};\n\nexport const MessageListContext = createContext<MessageListContextValue | undefined>(\n undefined,\n);\n\n/**\n * Context provider for components rendered within the `MessageList`\n */\nexport const MessageListContextProvider = ({\n children,\n value,\n}: PropsWithChildren<{\n value: MessageListContextValue;\n}>) => (\n <MessageListContext.Provider value={value as MessageListContextValue}>\n {children}\n </MessageListContext.Provider>\n);\n\nexport const useMessageListContext = (componentName?: string) => {\n const contextValue = useContext(MessageListContext);\n\n if (!contextValue) {\n console.warn(\n `The useMessageListContext hook was called outside of the MessageListContext provider. Make sure this hook is called within the MessageList component. The errored call is located in the ${componentName} component.`,\n );\n\n return {} as MessageListContextValue;\n }\n\n return contextValue as MessageListContextValue;\n};\n","/**\n * Message translation view context: user-specific state for whether each message\n * shows original text or a translation.\n *\n * ## Spec\n *\n * - **State**: Per message list (channel vs thread), we store a map\n * `messageId → 'original' | 'translated'`. Default for messages with `message.i18n`\n * is `'translated'`; otherwise `'original'`.\n *\n * - **Provider placement**: The provider is tied to the **message list**, not the channel.\n * It is rendered inside `MessageList` and `VirtualizedMessageList`. That way the\n * main channel list and the thread list each have their own translation view state\n * (e.g. Thread.tsx gets correct behavior without sharing channel state).\n *\n * - **Multiple translations**: `message.i18n` can contain multiple languages, e.g.:\n * `{ en_text: \"Good morning\", fr_text: \"Bonjour\", it_text: \"Buongiorno\", language: \"en\" }`.\n * Which translation is shown is determined by the app’s **user language**\n * (`useTranslationContext().userLanguage`). We use `message.i18n[userLanguage + '_text']`;\n * if missing, we fall back to `message.text`. Only one translation is shown at a time.\n *\n * - **Source language**: When present, `message.i18n.language` is the original/source\n * language of `message.text`. It can be used for the indicator label, e.g.\n * \"Translated from English · View original\".\n *\n * - **Invariants**: The original message content, layout, grouping, and order stay\n * unchanged. Removing or toggling translation only changes the annotation and which\n * text is displayed. \"View original\" / \"View translation\" switch the displayed\n * text and update the annotation (e.g. \"Original · View translation\" when showing\n * original).\n *\n * - **Translation indicator visibility**: The translation indicator (e.g. \"Translated ·\n * View original\") is **not** shown when the currently viewed text already corresponds\n * to `userLanguage` — for example when viewing original and the original text is the\n * user-language version (i.e. `getTranslatedMessageText({ language: userLanguage, message })`\n * equals `message.text`). In that case there is no meaningful original/translated choice,\n * so the indicator is hidden.\n */\n\nimport React, { createContext, useCallback, useContext, useState } from 'react';\nimport type { LocalMessage, TranslationLanguages } from 'stream-chat';\n\n/**\n * Returns the translated message text for a given language from `message.i18n`, or\n * undefined if not present. Used to resolve which of the multiple translations to show.\n */\nexport const getTranslatedMessageText = ({\n language,\n message,\n}: {\n language: string;\n message?: LocalMessage;\n}): string | undefined =>\n message?.i18n?.[`${language}_text` as `${TranslationLanguages}_text`];\n\n/**\n * Which message text to show.\n * - `'original'`: `message.text` (source language).\n * - `'translated'`: translation for the **current user language** (TranslationContext’s\n * `userLanguage`), i.e. `getTranslatedMessageText({ language: userLanguage, message })`\n * or fallback to `message.text`.\n */\nexport type TranslationView = 'original' | 'translated';\n\nexport type MessageTranslationViewContextValue = {\n getTranslationView: (messageId: string, hasI18n: boolean) => TranslationView;\n setTranslationView: (messageId: string, view: TranslationView) => void;\n};\n\nconst defaultContextValue: MessageTranslationViewContextValue = {\n getTranslationView: (_messageId, hasI18n) => (hasI18n ? 'translated' : 'original'),\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n setTranslationView: () => {},\n};\n\nexport const MessageTranslationViewContext =\n createContext<MessageTranslationViewContextValue>(defaultContextValue);\n\nexport const MessageTranslationViewProvider = ({\n children,\n}: {\n children: React.ReactNode;\n}) => {\n const [viewByMessageId, setViewByMessageId] = useState<Record<string, TranslationView>>(\n {},\n );\n\n const setTranslationView = useCallback((messageId: string, view: TranslationView) => {\n setViewByMessageId((prev) => ({ ...prev, [messageId]: view }));\n }, []);\n\n const getTranslationView = useCallback(\n (messageId: string, hasI18n: boolean): TranslationView =>\n viewByMessageId[messageId] ?? (hasI18n ? 'translated' : 'original'),\n [viewByMessageId],\n );\n\n const stableValue = React.useMemo(\n () => ({ getTranslationView, setTranslationView }),\n [getTranslationView, setTranslationView],\n );\n\n return (\n <MessageTranslationViewContext.Provider value={stableValue}>\n {children}\n </MessageTranslationViewContext.Provider>\n );\n};\n\nexport const useMessageTranslationViewContext =\n (): MessageTranslationViewContextValue => {\n const context = useContext(MessageTranslationViewContext);\n return context ?? defaultContextValue;\n };\n","import type { PropsWithChildren } from 'react';\nimport React, { useContext } from 'react';\n\nexport type ModalContextValue = {\n close: () => void;\n dialogId?: string;\n};\n\nexport const ModalContext = React.createContext<ModalContextValue | undefined>(undefined);\n\nexport const ModalContextProvider = ({\n children,\n value,\n}: PropsWithChildren<{\n value: ModalContextValue;\n}>) => <ModalContext.Provider value={value}>{children}</ModalContext.Provider>;\n\nexport const useModalContext = () => {\n const contextValue = useContext(ModalContext);\n\n if (!contextValue) {\n console.warn(\n `The useModalContext hook was called outside of the ModalContext provider. Make sure this hook is called within a child of the GlobalModal.`,\n );\n\n return { close: () => null };\n }\n\n return contextValue;\n};\n","import React, { useContext } from 'react';\nimport type { PropsWithChildren } from 'react';\nimport type { Poll } from 'stream-chat';\n\nexport type PollContextValue = {\n poll: Poll;\n};\n\nexport const PollContext = React.createContext<PollContextValue | undefined>(undefined);\n\nexport const PollProvider = ({\n children,\n poll,\n}: PropsWithChildren<{\n poll: Poll;\n}>) =>\n poll ? (\n <PollContext.Provider value={{ poll } as unknown as PollContextValue}>\n {children}\n </PollContext.Provider>\n ) : null;\n\nexport const usePollContext = () => {\n const contextValue = useContext(PollContext);\n return contextValue as unknown as PollContextValue;\n};\n","import React, { useContext } from 'react';\nimport type { PropsWithChildren } from 'react';\n\nimport { ComponentContext } from './ComponentContext';\nimport type { ComponentContextValue } from './ComponentContext';\n\nexport function WithComponents({\n children,\n overrides,\n}: PropsWithChildren<{ overrides: Partial<ComponentContextValue> }>) {\n const parentOverrides = useContext(ComponentContext);\n const actualOverrides: ComponentContextValue = { ...parentOverrides, ...overrides };\n return (\n <ComponentContext.Provider value={actualOverrides}>\n {children}\n </ComponentContext.Provider>\n );\n}\n","import React from 'react';\nimport type { Channel } from 'stream-chat';\n\nimport { AIStates, useAIState } from './hooks/useAIState';\n\nimport { useChannelStateContext, useTranslationContext } from '../../context';\n\nexport type AIStateIndicatorProps = {\n channel?: Channel;\n};\n\nexport const AIStateIndicator = ({\n channel: channelFromProps,\n}: AIStateIndicatorProps) => {\n const { t } = useTranslationContext();\n const { channel: channelFromContext } = useChannelStateContext('AIStateIndicator');\n const channel = channelFromProps || channelFromContext;\n const { aiState } = useAIState(channel);\n const allowedStates = {\n [AIStates.Thinking]: t('Thinking...'),\n [AIStates.Generating]: t('Generating...'),\n };\n\n return aiState in allowedStates ? (\n <div className='str-chat__ai-state-indicator-container'>\n <p className='str-chat__ai-state-indicator-text'>{allowedStates[aiState]}</p>\n </div>\n ) : null;\n};\n","import React, { type ComponentPropsWithoutRef, type CSSProperties } from 'react';\n\nexport type VisuallyHiddenProps = ComponentPropsWithoutRef<'span'>;\n\nconst visuallyHiddenStyle: CSSProperties = {\n border: 0,\n clip: 'rect(0, 0, 0, 0)',\n height: '1px',\n margin: '-1px',\n overflow: 'hidden',\n padding: 0,\n position: 'absolute',\n whiteSpace: 'nowrap',\n width: '1px',\n};\n\n/**\n * Hides content visually while preserving it for assistive technologies.\n */\nexport const VisuallyHidden = ({ children, style, ...rest }: VisuallyHiddenProps) => (\n <span {...rest} style={{ ...visuallyHiddenStyle, ...style }}>\n {children}\n </span>\n);\n","import { createContext, useContext } from 'react';\n\nexport type AriaLivePriority = 'assertive' | 'polite';\nexport type AriaLiveAnnounce = (message: string, priority?: AriaLivePriority) => void;\n\nexport type AriaLiveAnnouncerContextValue = {\n announce: AriaLiveAnnounce;\n};\n\nconst noopAnnounce: AriaLiveAnnounce = () => undefined;\n\nexport const AriaLiveAnnouncerContext = createContext<\n AriaLiveAnnouncerContextValue | undefined\n>(undefined);\n\nexport const useAriaLiveAnnouncer = () => {\n const contextValue = useContext(AriaLiveAnnouncerContext);\n\n if (!contextValue) {\n console.warn(\n 'The useAriaLiveAnnouncer hook was called outside of the AriaLiveRegion provider.',\n );\n\n return noopAnnounce;\n }\n\n return contextValue.announce;\n};\n","import type { PropsWithChildren } from 'react';\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { Portal } from '../Portal/Portal';\nimport { VisuallyHidden } from '../VisuallyHidden';\nimport {\n type AriaLiveAnnounce,\n AriaLiveAnnouncerContext,\n type AriaLivePriority,\n} from './useAriaLiveAnnouncer';\n\ntype SequenceByPriority = {\n [key in AriaLivePriority]: number;\n};\n\ntype TimeoutByPriority = {\n [key in AriaLivePriority]: ReturnType<typeof setTimeout> | undefined;\n};\n\nexport const AriaLiveRegion = ({ children }: PropsWithChildren) => {\n const [assertiveMessage, setAssertiveMessage] = useState('');\n const [politeMessage, setPoliteMessage] = useState('');\n const sequenceByPriorityRef = useRef<SequenceByPriority>({\n assertive: 0,\n polite: 0,\n });\n const timeoutByPriorityRef = useRef<TimeoutByPriority>({\n assertive: undefined,\n polite: undefined,\n });\n const unmountedRef = useRef(false);\n\n const clearPendingTimeout = useCallback((priority: AriaLivePriority) => {\n if (!timeoutByPriorityRef.current[priority]) return;\n clearTimeout(timeoutByPriorityRef.current[priority]);\n timeoutByPriorityRef.current[priority] = undefined;\n }, []);\n\n const clearPendingTimeouts = useCallback(() => {\n clearPendingTimeout('as